diff --git a/internal/mptest/main_linux_amd64.go b/internal/mptest/main_linux_amd64.go index e7df4a5..927a31c 100644 --- a/internal/mptest/main_linux_amd64.go +++ b/internal/mptest/main_linux_amd64.go @@ -1,4 +1,4 @@ -// Code generated by 'ccgo -export-defines "" -o internal/mptest/main_linux_amd64.go -trace-translation-units testdata/sqlite-src-3330000/mptest/mptest.c -Itestdata/sqlite-amalgamation-3330000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_UNIX=1', DO NOT EDIT. +// Code generated by 'ccgo -export-defines "" -o internal/mptest/main_linux_amd64.go -trace-translation-units testdata/sqlite-src-3350000/mptest/mptest.c -Itestdata/sqlite-amalgamation-3350000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_UNIX=1', DO NOT EDIT. package main @@ -443,6 +443,7 @@ const ( SQLITE_IOERR_CLOSE = 4106 SQLITE_IOERR_COMMIT_ATOMIC = 7690 SQLITE_IOERR_CONVPATH = 6666 + SQLITE_IOERR_CORRUPTFS = 8458 SQLITE_IOERR_DATA = 8202 SQLITE_IOERR_DELETE = 2570 SQLITE_IOERR_DELETE_NOENT = 5898 @@ -581,7 +582,7 @@ const ( SQLITE_SHM_SHARED = 4 SQLITE_SHM_UNLOCK = 1 SQLITE_SOUNDEX = 1 - SQLITE_SOURCE_ID = "2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f" + SQLITE_SOURCE_ID = "2021-03-12 15:10:09 acd63062eb06748bfe9e4886639e4f2b54ea6a496a83f10716abbaba4115500b" SQLITE_STATUS_MALLOC_COUNT = 9 SQLITE_STATUS_MALLOC_SIZE = 5 SQLITE_STATUS_MEMORY_USED = 0 @@ -618,7 +619,7 @@ const ( SQLITE_TESTCTRL_INTERNAL_FUNCTIONS = 17 SQLITE_TESTCTRL_ISINIT = 23 SQLITE_TESTCTRL_ISKEYWORD = 16 - SQLITE_TESTCTRL_LAST = 29 + SQLITE_TESTCTRL_LAST = 31 SQLITE_TESTCTRL_LOCALTIME_FAULT = 18 SQLITE_TESTCTRL_NEVER_CORRUPT = 20 SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD = 19 @@ -632,7 +633,9 @@ const ( SQLITE_TESTCTRL_RESERVE = 14 SQLITE_TESTCTRL_RESULT_INTREAL = 27 SQLITE_TESTCTRL_SCRATCHMALLOC = 17 + SQLITE_TESTCTRL_SEEK_COUNT = 30 SQLITE_TESTCTRL_SORTER_MMAP = 24 + SQLITE_TESTCTRL_TRACEFLAGS = 31 SQLITE_TESTCTRL_VDBE_COVERAGE = 21 SQLITE_TEXT = 3 SQLITE_THREADSAFE = 1 @@ -642,14 +645,17 @@ const ( SQLITE_TRACE_ROW = 0x04 SQLITE_TRACE_STMT = 0x01 SQLITE_TRANSACTION = 22 + SQLITE_TXN_NONE = 0 + SQLITE_TXN_READ = 1 + SQLITE_TXN_WRITE = 2 SQLITE_UPDATE = 23 SQLITE_UTF16 = 4 SQLITE_UTF16BE = 3 SQLITE_UTF16LE = 2 SQLITE_UTF16_ALIGNED = 8 SQLITE_UTF8 = 1 - SQLITE_VERSION = "3.33.0" - SQLITE_VERSION_NUMBER = 3033000 + SQLITE_VERSION = "3.35.0" + SQLITE_VERSION_NUMBER = 3035000 SQLITE_VTAB_CONSTRAINT_SUPPORT = 1 SQLITE_VTAB_DIRECTONLY = 3 SQLITE_VTAB_INNOCUOUS = 2 @@ -679,11 +685,14 @@ const ( X_BITS_ERRNO_H = 1 X_BITS_FLOATN_COMMON_H = 0 X_BITS_FLOATN_H = 0 + X_BITS_G_CONFIG_H = 1 + X_BITS_LIBIO_H = 1 X_BITS_POSIX_OPT_H = 1 X_BITS_PTHREADTYPES_ARCH_H = 1 X_BITS_PTHREADTYPES_COMMON_H = 1 X_BITS_STDINT_INTN_H = 1 X_BITS_STDIO_LIM_H = 1 + X_BITS_SYSMACROS_H = 1 X_BITS_TYPESIZES_H = 1 X_BITS_TYPES_H = 1 X_BITS_TYPES_LOCALE_T_H = 1 @@ -702,11 +711,62 @@ const ( X_GCC_WCHAR_T = 0 X_GETOPT_CORE_H = 1 X_GETOPT_POSIX_H = 1 + X_G_BUFSIZ = 8192 + X_G_HAVE_MMAP = 1 + X_G_HAVE_MREMAP = 1 + X_G_HAVE_ST_BLKSIZE = 0 + X_G_IO_IO_FILE_VERSION = 0x20001 X_IOFBF = 0 X_IOLBF = 1 X_IONBF = 2 - X_IO_EOF_SEEN = 0x0010 - X_IO_ERR_SEEN = 0x0020 + X_IOS_APPEND = 8 + X_IOS_ATEND = 4 + X_IOS_BIN = 128 + X_IOS_INPUT = 1 + X_IOS_NOCREATE = 32 + X_IOS_NOREPLACE = 64 + X_IOS_OUTPUT = 2 + X_IOS_TRUNC = 16 + X_IO_BAD_SEEN = 0x4000 + X_IO_BOOLALPHA = 0200000 + X_IO_BUFSIZ = 8192 + X_IO_CURRENTLY_PUTTING = 0x800 + X_IO_DEC = 020 + X_IO_DELETE_DONT_CLOSE = 0x40 + X_IO_DONT_CLOSE = 0100000 + X_IO_EOF_SEEN = 0x10 + X_IO_ERR_SEEN = 0x20 + X_IO_FIXED = 010000 + X_IO_FLAGS2_MMAP = 1 + X_IO_FLAGS2_NOTCANCEL = 2 + X_IO_FLAGS2_USER_WBUF = 8 + X_IO_HAVE_ST_BLKSIZE = 0 + X_IO_HEX = 0100 + X_IO_INTERNAL = 010 + X_IO_IN_BACKUP = 0x100 + X_IO_IS_APPENDING = 0x1000 + X_IO_IS_FILEBUF = 0x2000 + X_IO_LEFT = 02 + X_IO_LINE_BUF = 0x200 + X_IO_LINKED = 0x80 + X_IO_MAGIC = 0xFBAD0000 + X_IO_MAGIC_MASK = 0xFFFF0000 + X_IO_NO_READS = 4 + X_IO_NO_WRITES = 8 + X_IO_OCT = 040 + X_IO_RIGHT = 04 + X_IO_SCIENTIFIC = 04000 + X_IO_SHOWBASE = 0200 + X_IO_SHOWPOINT = 0400 + X_IO_SHOWPOS = 02000 + X_IO_SKIPWS = 01 + X_IO_STDIO = 040000 + X_IO_TIED_PUT_GET = 0x400 + X_IO_UNBUFFERED = 2 + X_IO_UNIFIED_JUMPTABLES = 1 + X_IO_UNITBUF = 020000 + X_IO_UPPERCASE = 01000 + X_IO_USER_BUF = 1 X_IO_USER_LOCK = 0x8000 X_LFS64_ASYNCHRONOUS_IO = 1 X_LFS64_LARGEFILE = 1 @@ -714,6 +774,7 @@ const ( X_LFS_ASYNCHRONOUS_IO = 1 X_LFS_LARGEFILE = 1 X_LP64 = 1 + X_OLD_STDIO_MAGIC = 0xFABC0000 X_POSIX2_CHAR_TERM = 200809 X_POSIX2_C_BIND = 200809 X_POSIX2_C_DEV = 200809 @@ -790,6 +851,7 @@ const ( X_STDARG_H = 0 X_STDC_PREDEF_H = 1 X_STDIO_H = 1 + X_STDIO_USES_IOSTREAM = 0 X_STDLIB_H = 1 X_STRINGS_H = 1 X_STRING_H = 1 @@ -797,6 +859,7 @@ const ( X_SYS_CDEFS_H = 1 X_SYS_SELECT_H = 1 X_SYS_SIZE_T_H = 0 + X_SYS_SYSMACROS_H = 1 X_SYS_TYPES_H = 1 X_THREAD_SHARED_TYPES_H = 1 X_T_SIZE = 0 @@ -816,6 +879,7 @@ const ( X_WCHAR_T_H = 0 X_XBS5_LP64_OFF64 = 1 X_XBS5_LPBIG_OFFBIG = -1 + X_XOPEN_CRYPT = 1 X_XOPEN_ENH_I18N = 1 X_XOPEN_LEGACY = 1 X_XOPEN_REALTIME = 1 @@ -1342,6 +1406,14 @@ const ( /* confname.h:71:1: */ _SC_THREAD_ROBUST_PRIO_PROTECT = 248 ) +// This is the structure from the libstdc++ codecvt class. +const ( /* libio.h:180:1: */ + __codecvt_ok = 0 + __codecvt_partial = 1 + __codecvt_error = 2 + __codecvt_noconv = 3 +) + // In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. // are already defined. // BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. @@ -1542,7 +1614,7 @@ type sqlite3_callback = uintptr /* sqlite3.h:338:13 */ // for their own use. The pMethods entry is a pointer to an // [sqlite3_io_methods] object that defines methods for performing // I/O operations on the open file. -type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:683:9 */ +type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:684:9 */ // CAPI3REF: Result Codes // KEYWORDS: {result code definitions} @@ -1653,7 +1725,7 @@ type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:683:9 */ // for their own use. The pMethods entry is a pointer to an // [sqlite3_io_methods] object that defines methods for performing // I/O operations on the open file. -type sqlite3_file = sqlite3_file1 /* sqlite3.h:683:29 */ +type sqlite3_file = sqlite3_file1 /* sqlite3.h:684:29 */ type sqlite3_io_methods1 = struct { iVersion int32 _ [4]byte @@ -1675,7 +1747,7 @@ type sqlite3_io_methods1 = struct { xShmUnmap uintptr xFetch uintptr xUnfetch uintptr -} /* sqlite3.h:683:9 */ +} /* sqlite3.h:684:9 */ // CAPI3REF: OS Interface File Virtual Methods Object // @@ -1769,7 +1841,7 @@ type sqlite3_io_methods1 = struct { // fails to zero-fill short reads might seem to work. However, // failure to zero-fill short reads will eventually lead to // database corruption. -type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:782:35 */ +type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:783:35 */ // CAPI3REF: OS Interface Object // @@ -1962,7 +2034,7 @@ type sqlite3_vfs1 = struct { xSetSystemCall uintptr xGetSystemCall uintptr xNextSystemCall uintptr -} /* sqlite3.h:1367:9 */ +} /* sqlite3.h:1368:9 */ // CAPI3REF: OS Interface Object // @@ -2131,8 +2203,8 @@ type sqlite3_vfs1 = struct { // or all of these interfaces to be NULL or for their behavior to change // from one release to the next. Applications must not attempt to access // any of these methods if the iVersion of the VFS is less than 3. -type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1367:28 */ -type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1368:14 */ +type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1368:28 */ +type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1369:14 */ // CAPI3REF: Memory Allocation Routines // @@ -2204,7 +2276,7 @@ type sqlite3_mem_methods1 = struct { xInit uintptr xShutdown uintptr pAppData uintptr -} /* sqlite3.h:1665:9 */ +} /* sqlite3.h:1666:9 */ // CAPI3REF: Memory Allocation Routines // @@ -2267,7 +2339,7 @@ type sqlite3_mem_methods1 = struct { // // SQLite will never invoke xInit() more than once without an intervening // call to xShutdown(). -type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1665:36 */ +type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1666:36 */ // CAPI3REF: Constants Defining Special Destructor Behavior // @@ -2281,7 +2353,7 @@ type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1665:36 */ // // The typedef is necessary to work around problems in certain // C++ compilers. -type sqlite3_destructor_type = uintptr /* sqlite3.h:5621:14 */ +type sqlite3_destructor_type = uintptr /* sqlite3.h:5635:14 */ // The interface to the virtual-table mechanism is currently considered // to be experimental. The interface might change in incompatible ways. @@ -2296,7 +2368,7 @@ type sqlite3_vtab1 = struct { nRef int32 _ [4]byte zErrMsg uintptr -} /* sqlite3.h:6689:9 */ +} /* sqlite3.h:6754:9 */ // The interface to the virtual-table mechanism is currently considered // to be experimental. The interface might change in incompatible ways. @@ -2306,7 +2378,7 @@ type sqlite3_vtab1 = struct { // interface fixed, support it indefinitely, and remove this comment. // Structures used by the virtual table interface -type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6689:29 */ +type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6754:29 */ type sqlite3_index_info1 = struct { nConstraint int32 _ [4]byte @@ -2325,12 +2397,12 @@ type sqlite3_index_info1 = struct { idxFlags int32 _ [4]byte colUsed sqlite3_uint64 -} /* sqlite3.h:6690:9 */ +} /* sqlite3.h:6755:9 */ -type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6690:35 */ -type sqlite3_vtab_cursor1 = struct{ pVtab uintptr } /* sqlite3.h:6691:9 */ +type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6755:35 */ +type sqlite3_vtab_cursor1 = struct{ pVtab uintptr } /* sqlite3.h:6756:9 */ -type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6691:36 */ +type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6756:36 */ type sqlite3_module1 = struct { iVersion int32 _ [4]byte @@ -2357,9 +2429,9 @@ type sqlite3_module1 = struct { xRelease uintptr xRollbackTo uintptr xShadowName uintptr -} /* sqlite3.h:6689:9 */ +} /* sqlite3.h:6754:9 */ -type sqlite3_module = sqlite3_module1 /* sqlite3.h:6692:31 */ +type sqlite3_module = sqlite3_module1 /* sqlite3.h:6757:31 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -2467,7 +2539,7 @@ type sqlite3_index_constraint = struct { usable uint8 _ [2]byte iTermOffset int32 -} /* sqlite3.h:6690:9 */ +} /* sqlite3.h:6755:9 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -2573,7 +2645,7 @@ type sqlite3_index_orderby = struct { iColumn int32 desc uint8 _ [3]byte -} /* sqlite3.h:6690:9 */ +} /* sqlite3.h:6755:9 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -2679,7 +2751,7 @@ type sqlite3_index_constraint_usage = struct { argvIndex int32 omit uint8 _ [3]byte -} /* sqlite3.h:6690:9 */ +} /* sqlite3.h:6755:9 */ // CAPI3REF: Mutex Methods Object // @@ -2754,7 +2826,7 @@ type sqlite3_mutex_methods1 = struct { xMutexLeave uintptr xMutexHeld uintptr xMutexNotheld uintptr -} /* sqlite3.h:7524:9 */ +} /* sqlite3.h:7589:9 */ // CAPI3REF: Mutex Methods Object // @@ -2819,7 +2891,7 @@ type sqlite3_mutex_methods1 = struct { // called, but only if the prior call to xMutexInit returned SQLITE_OK. // If xMutexInit fails in any way, it is expected to clean up after itself // prior to returning. -type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7524:38 */ +type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7589:38 */ // CAPI3REF: Custom Page Cache Object // @@ -2832,7 +2904,7 @@ type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7524:38 */ type sqlite3_pcache_page1 = struct { pBuf uintptr pExtra uintptr -} /* sqlite3.h:8277:9 */ +} /* sqlite3.h:8344:9 */ // CAPI3REF: Custom Page Cache Object // @@ -2842,7 +2914,7 @@ type sqlite3_pcache_page1 = struct { // of this object as parameters or as their return value. // // See [sqlite3_pcache_methods2] for additional information. -type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8277:36 */ +type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8344:36 */ // CAPI3REF: Application Defined Page Cache. // KEYWORDS: {page cache} @@ -3016,7 +3088,7 @@ type sqlite3_pcache_methods21 = struct { xTruncate uintptr xDestroy uintptr xShrink uintptr -} /* sqlite3.h:8442:9 */ +} /* sqlite3.h:8509:9 */ // CAPI3REF: Application Defined Page Cache. // KEYWORDS: {page cache} @@ -3175,7 +3247,7 @@ type sqlite3_pcache_methods21 = struct { // free up as much of heap memory as possible. The page cache implementation // is not obligated to free any memory, but well-behaved implementations should // do their best. -type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8442:40 */ +type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8509:40 */ // This is the obsolete pcache_methods object that has now been replaced // by sqlite3_pcache_methods2. This object is not used by SQLite. It is @@ -3192,12 +3264,12 @@ type sqlite3_pcache_methods1 = struct { xRekey uintptr xTruncate uintptr xDestroy uintptr -} /* sqlite3.h:8465:9 */ +} /* sqlite3.h:8532:9 */ // This is the obsolete pcache_methods object that has now been replaced // by sqlite3_pcache_methods2. This object is not used by SQLite. It is // retained in the header file for backwards compatibility only. -type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8465:39 */ +type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8532:39 */ // CAPI3REF: Database Snapshot // KEYWORDS: {snapshot} {sqlite3_snapshot} @@ -3217,7 +3289,7 @@ type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8465:39 */ // version of the database file so that it is possible to later open a new read // transaction that sees that historical version of the database rather than // the most recent version. -type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9512:9 */ +type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9589:9 */ // CAPI3REF: Database Snapshot // KEYWORDS: {snapshot} {sqlite3_snapshot} @@ -3237,7 +3309,7 @@ type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9512:9 */ // version of the database file so that it is possible to later open a new read // transaction that sees that historical version of the database rather than // the most recent version. -type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9514:3 */ +type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9591:3 */ // CAPI3REF: Flags for sqlite3_deserialize() // @@ -3281,7 +3353,7 @@ type sqlite3_rtree_geometry1 = struct { aParam uintptr pUser uintptr xDelUser uintptr -} /* sqlite3.h:9839:9 */ +} /* sqlite3.h:9916:9 */ // CAPI3REF: Flags for sqlite3_deserialize() // @@ -3318,7 +3390,7 @@ type sqlite3_rtree_geometry1 = struct { // // -type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9839:39 */ +type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9916:39 */ type sqlite3_rtree_query_info1 = struct { pContext uintptr nParam int32 @@ -3338,13 +3410,13 @@ type sqlite3_rtree_query_info1 = struct { eWithin int32 rScore sqlite3_rtree_dbl apSqlParam uintptr -} /* sqlite3.h:9840:9 */ +} /* sqlite3.h:9917:9 */ -type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9840:41 */ +type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9917:41 */ // The double-precision datatype used by RTree depends on the // SQLITE_RTREE_INT_ONLY compile-time option. -type sqlite3_rtree_dbl = float64 /* sqlite3.h:9848:18 */ +type sqlite3_rtree_dbl = float64 /* sqlite3.h:9925:18 */ // Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. @@ -3399,7 +3471,7 @@ type Fts5ExtensionApi1 = struct { xPhraseNext uintptr xPhraseFirstColumn uintptr xPhraseNextColumn uintptr -} /* sqlite3.h:11634:9 */ +} /* sqlite3.h:11724:9 */ // Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. @@ -3432,22 +3504,22 @@ type Fts5ExtensionApi1 = struct { // Virtual table implementations may overload SQL functions by implementing // the sqlite3_module.xFindFunction() method. -type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11634:33 */ +type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11724:33 */ type Fts5PhraseIter1 = struct { a uintptr b uintptr -} /* sqlite3.h:11636:9 */ +} /* sqlite3.h:11726:9 */ -type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11636:31 */ +type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11726:31 */ -type fts5_extension_function = uintptr /* sqlite3.h:11638:14 */ +type fts5_extension_function = uintptr /* sqlite3.h:11728:14 */ type fts5_tokenizer1 = struct { xCreate uintptr xDelete uintptr xTokenize uintptr -} /* sqlite3.h:12097:9 */ +} /* sqlite3.h:12187:9 */ -type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12097:31 */ +type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12187:31 */ // Flags that may be passed as the third argument to xTokenize() @@ -3467,7 +3539,7 @@ type fts5_api1 = struct { xCreateTokenizer uintptr xFindTokenizer uintptr xCreateFunction uintptr -} /* sqlite3.h:12133:9 */ +} /* sqlite3.h:12223:9 */ // Flags that may be passed as the third argument to xTokenize() @@ -3481,51 +3553,9 @@ type fts5_api1 = struct { // ************************************************************************ // // FTS5 EXTENSION REGISTRATION API -type fts5_api = fts5_api1 /* sqlite3.h:12133:25 */ +type fts5_api = fts5_api1 /* sqlite3.h:12223:25 */ -// The tag name of this struct is _G_fpos_t to preserve historic -// C++ mangled names for functions taking fpos_t arguments. -// That name should not be used in new code. -type _G_fpos_t = struct { - __pos int64 - __state struct { - __count int32 - __value struct{ __wch uint32 } - } -} /* __fpos_t.h:10:9 */ - -// bits/types.h -- definitions of __*_t types underlying *_t types. -// Copyright (C) 2002-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// Never include this file directly; use instead. - -// The tag name of this struct is _G_fpos64_t to preserve historic -// C++ mangled names for functions taking fpos_t and/or fpos64_t -// arguments. That name should not be used in new code. -type _G_fpos64_t = struct { - __pos int64 - __state struct { - __count int32 - __value struct{ __wch uint32 } - } -} /* __fpos64_t.h:10:9 */ - -type _IO_FILE = struct { +type _IO_FILE1 = struct { _flags int32 _ [4]byte _IO_read_ptr uintptr @@ -3550,28 +3580,50 @@ type _IO_FILE = struct { _ [4]byte _lock uintptr _offset int64 - _codecvt uintptr - _wide_data uintptr - _freeres_list uintptr - _freeres_buf uintptr + __pad1 uintptr + __pad2 uintptr + __pad3 uintptr + __pad4 uintptr __pad5 size_t _mode int32 _unused2 [20]int8 } /* __FILE.h:4:1 */ // The opaque type of streams. This is the definition used elsewhere. -type FILE = _IO_FILE /* FILE.h:7:25 */ +type FILE = _IO_FILE1 /* FILE.h:7:25 */ -// These macros are used by bits/stdio.h and internal headers. +type _G_fpos_t = struct { + __pos int64 + __state struct { + __count int32 + __value struct{ __wch uint32 } + } +} /* _G_config.h:30:3 */ +type _G_fpos64_t = struct { + __pos int64 + __state struct { + __count int32 + __value struct{ __wch uint32 } + } +} /* _G_config.h:35:3 */ -// Many more flag bits are defined internally. +// A streammarker remembers a position in a buffer. -type off_t = int64 /* stdio.h:65:19 */ +type _IO_marker = struct { + _next uintptr + _sbuf uintptr + _pos int32 + _ [4]byte +} /* __FILE.h:4:1 */ -type ssize_t = int64 /* stdio.h:77:19 */ +type _IO_FILE = _IO_FILE1 /* libio.h:314:25 */ + +type off_t = int64 /* stdio.h:59:19 */ + +type ssize_t = int64 /* stdio.h:71:19 */ // The type of the second argument to `fgetpos' and `fsetpos'. -type fpos_t = _G_fpos64_t /* stdio.h:86:20 */ +type fpos_t = _G_fpos64_t /* stdio.h:80:21 */ // If we are compiling with optimizing read this file. It contains // several optimizing inline functions and macros. @@ -3646,6 +3698,8 @@ type fpos_t = _G_fpos64_t /* stdio.h:86:20 */ // The X/Open Unix extensions are available. +// Encryption is present. + // The enhanced internationalization capabilities according to XPG4.2 // are present. @@ -3937,7 +3991,7 @@ type fpos_t = _G_fpos64_t /* stdio.h:86:20 */ // Never include this file directly; use instead. -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -4021,17 +4075,17 @@ type fpos_t = _G_fpos64_t /* stdio.h:86:20 */ // The Single Unix specification says that some more types are // available here. -type gid_t = uint32 /* unistd.h:232:17 */ +type gid_t = uint32 /* unistd.h:235:17 */ -type uid_t = uint32 /* unistd.h:237:17 */ +type uid_t = uint32 /* unistd.h:240:17 */ -type useconds_t = uint32 /* unistd.h:255:22 */ +type useconds_t = uint32 /* unistd.h:258:22 */ -type pid_t = int32 /* unistd.h:260:17 */ +type pid_t = int32 /* unistd.h:263:17 */ -type intptr_t = int64 /* unistd.h:267:20 */ +type intptr_t = int64 /* unistd.h:270:20 */ -type socklen_t = uint32 /* unistd.h:274:21 */ +type socklen_t = uint32 /* unistd.h:277:21 */ // In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. // are already defined. @@ -4265,11 +4319,6 @@ type idtype_t = uint32 /* waitflags.h:57:3 */ // configurations support _Float128x or, as of GCC 7, have compiler // support for a type meeting the requirements for _Float128x. -// Defined to 1 if the corresponding _FloatN type is not binary compatible -// with the corresponding ISO C type in the current compilation unit as -// opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built -// in glibc. - // Defined to 1 if any _FloatN or _FloatNx types that are not // ABI-distinct are however distinct types at the C language level (so // for the purposes of __builtin_types_compatible_p and _Generic). @@ -4370,22 +4419,23 @@ type u_long = uint64 /* types.h:36:18 */ type quad_t = int64 /* types.h:37:18 */ type u_quad_t = uint64 /* types.h:38:20 */ type fsid_t = struct{ __val [2]int32 } /* types.h:39:18 */ -type loff_t = int64 /* types.h:42:18 */ -type ino_t = uint64 /* types.h:49:19 */ +type loff_t = int64 /* types.h:44:18 */ -type dev_t = uint64 /* types.h:59:17 */ +type ino_t = uint64 /* types.h:50:19 */ -type mode_t = uint32 /* types.h:69:18 */ +type dev_t = uint64 /* types.h:60:17 */ -type nlink_t = uint64 /* types.h:74:19 */ +type mode_t = uint32 /* types.h:70:18 */ -type id_t = uint32 /* types.h:103:16 */ +type nlink_t = uint64 /* types.h:75:19 */ -type daddr_t = int32 /* types.h:114:19 */ -type caddr_t = uintptr /* types.h:115:19 */ +type id_t = uint32 /* types.h:104:16 */ -type key_t = int32 /* types.h:121:17 */ +type daddr_t = int32 /* types.h:115:19 */ +type caddr_t = uintptr /* types.h:116:19 */ + +type key_t = int32 /* types.h:122:17 */ // bits/types.h -- definitions of __*_t types underlying *_t types. // Copyright (C) 2002-2018 Free Software Foundation, Inc. @@ -4479,7 +4529,7 @@ type time_t = int64 /* time_t.h:7:18 */ // Timer ID returned by `timer_create'. type timer_t = uintptr /* timer_t.h:7:19 */ -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -4562,9 +4612,9 @@ type timer_t = uintptr /* timer_t.h:7:19 */ // A null pointer constant. // Old compatibility names for C types. -type ulong = uint64 /* types.h:148:27 */ -type ushort = uint16 /* types.h:149:28 */ -type uint = uint32 /* types.h:150:22 */ +type ulong = uint64 /* types.h:149:27 */ +type ushort = uint16 /* types.h:150:28 */ +type uint = uint32 /* types.h:151:22 */ // These size-specific names are used by some of the inet code. @@ -4613,12 +4663,12 @@ type int64_t = int64 /* stdint-intn.h:27:19 */ // For GCC 2.7 and later, we can use specific type-size attributes. -type u_int8_t = uint32 /* types.h:177:1 */ -type u_int16_t = uint32 /* types.h:178:1 */ -type u_int32_t = uint32 /* types.h:179:1 */ -type u_int64_t = uint32 /* types.h:180:1 */ +type u_int8_t = uint32 /* types.h:178:1 */ +type u_int16_t = uint32 /* types.h:179:1 */ +type u_int32_t = uint32 /* types.h:180:1 */ +type u_int64_t = uint32 /* types.h:181:1 */ -type register_t = int32 /* types.h:182:13 */ +type register_t = int32 /* types.h:183:13 */ // A set of signals to be blocked, unblocked, or waited for. type sigset_t = struct{ __val [16]uint64 } /* sigset_t.h:7:20 */ @@ -4694,14 +4744,12 @@ type fd_set = struct{ __fds_bits [16]int64 } /* select.h:70:5 */ // Sometimes the fd_set member is assumed to have this type. type fd_mask = int64 /* select.h:77:19 */ -// Define some inlines helping to catch common problems. - -type blksize_t = int64 /* types.h:202:21 */ +type blksize_t = int64 /* types.h:212:21 */ // Types from the Large File Support interface. -type blkcnt_t = int64 /* types.h:222:22 */ // Type to count number of disk blocks. -type fsblkcnt_t = uint64 /* types.h:226:24 */ // Type to count file system blocks. -type fsfilcnt_t = uint64 /* types.h:230:24 */ // Type to count file system inodes. +type blkcnt_t = int64 /* types.h:232:22 */ // Type to count number of disk blocks. +type fsblkcnt_t = uint64 /* types.h:236:24 */ // Type to count file system blocks. +type fsfilcnt_t = uint64 /* types.h:240:24 */ // Type to count file system inodes. // Now add the thread types. // Declaration of common pthread types for all architectures. @@ -6321,11 +6369,11 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18: if strglob(tls, ts+2323 /* "*.test" */, g.zDbFile) != 0 { usage(tls, *(*uintptr)(unsafe.Pointer(argv))) } - if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2020-08-14 13:23..." */) != 0 { + if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-03-12 15:10..." */) != 0 { libc.Xfprintf(tls, libc.Xstderr, ts+2415, /* "SQLite library a..." */ - libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2020-08-14 13:23..." */)) + libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2021-03-12 15:10..." */)) libc.Xexit(tls, 1) } *(*int32)(unsafe.Pointer(bp + 232 /* n */)) = (argc - 2) @@ -6384,7 +6432,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18: libc.Xprintf(tls, ts+2317 /* " %s" */, libc.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } libc.Xprintf(tls, ts+2321 /* "\n" */, 0) - libc.Xprintf(tls, ts+2617 /* "With SQLite 3.33..." */, 0) + libc.Xprintf(tls, ts+2617 /* "With SQLite 3.35..." */, 0) for i = 0; (libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ { libc.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, libc.VaList(bp+80, zCOption)) } @@ -6531,5 +6579,5 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18: return (libc.Bool32(g.nError > 0)) } -var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\x00BEGIN IMMEDIATE\x00in startScript: %s\x00UPDATE counters SET nError=nError+%d, nTest=nTest+%d\x00SELECT 1 FROM client WHERE id=%d AND wantHalt\x00DELETE FROM client WHERE id=%d\x00COMMIT TRANSACTION;\x00SELECT script, id, name FROM task WHERE client=%d AND starttime IS NULL ORDER BY id LIMIT 1\x00%s\x00UPDATE task SET starttime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00Waited over 30 seconds with no work. Giving up.\x00DELETE FROM client WHERE id=%d; COMMIT;\x00COMMIT\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00INSERT OR IGNORE INTO client VALUES(%d,0)\x00%s \"%s\" --client %d --trace %d\x00%z --sqltrace\x00%z --sync\x00%z --vfs \"%s\"\x00system('%q')\x00%z &\x00system() fails with error code %d\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\x00SELECT 1 FROM task WHERE client=%d AND client IN (SELECT id FROM client) AND endtime IS NULL\x00SELECT 1 FROM task WHERE client IN (SELECT id FROM client) AND endtime IS NULL\x00\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\x00task\x00line %d of %s: bad client number: %d\x00%s:%d\x00INSERT INTO task(client,script,name) VALUES(%d,'%q',%Q)\x00breakpoint\x00show-sql-errors\x00line %d of %s: unknown command --%s\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.33.0 2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\x00cannot open [%s]\x00PRAGMA journal_mode=%Q;\x00PRAGMA synchronous=OFF\x00vfsname\x00eval\x00start-client\x00begin %s (%d)\x00end %s (%d)\x00end-client\x00missing script filename\x00DROP TABLE IF EXISTS task;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00" +var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\x00BEGIN IMMEDIATE\x00in startScript: %s\x00UPDATE counters SET nError=nError+%d, nTest=nTest+%d\x00SELECT 1 FROM client WHERE id=%d AND wantHalt\x00DELETE FROM client WHERE id=%d\x00COMMIT TRANSACTION;\x00SELECT script, id, name FROM task WHERE client=%d AND starttime IS NULL ORDER BY id LIMIT 1\x00%s\x00UPDATE task SET starttime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00Waited over 30 seconds with no work. Giving up.\x00DELETE FROM client WHERE id=%d; COMMIT;\x00COMMIT\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00INSERT OR IGNORE INTO client VALUES(%d,0)\x00%s \"%s\" --client %d --trace %d\x00%z --sqltrace\x00%z --sync\x00%z --vfs \"%s\"\x00system('%q')\x00%z &\x00system() fails with error code %d\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\x00SELECT 1 FROM task WHERE client=%d AND client IN (SELECT id FROM client) AND endtime IS NULL\x00SELECT 1 FROM task WHERE client IN (SELECT id FROM client) AND endtime IS NULL\x00\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\x00task\x00line %d of %s: bad client number: %d\x00%s:%d\x00INSERT INTO task(client,script,name) VALUES(%d,'%q',%Q)\x00breakpoint\x00show-sql-errors\x00line %d of %s: unknown command --%s\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002021-03-12 15:10:09 acd63062eb06748bfe9e4886639e4f2b54ea6a496a83f10716abbaba4115500b\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.35.0 2021-03-12 15:10:09 acd63062eb06748bfe9e4886639e4f2b54ea6a496a83f10716abbaba4115500b\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\x00cannot open [%s]\x00PRAGMA journal_mode=%Q;\x00PRAGMA synchronous=OFF\x00vfsname\x00eval\x00start-client\x00begin %s (%d)\x00end %s (%d)\x00end-client\x00missing script filename\x00DROP TABLE IF EXISTS task;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00" var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data diff --git a/internal/testfixture/testfixture_linux_amd64.go b/internal/testfixture/testfixture_linux_amd64.go index 6a7d9fc..ceb60f1 100644 --- a/internal/testfixture/testfixture_linux_amd64.go +++ b/internal/testfixture/testfixture_linux_amd64.go @@ -1,4 +1,4 @@ -// Code generated by 'ccgo -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 -DSQLITE_SERVER=1 -DTCLSH_INIT_PROC=sqlite3TestInit -D_HAVE_SQLITE_CONFIG_H -I/usr/include/tcl8.6 -export-defines "" -export-fields F -trace-translation-units -volatile=sqlite3_io_error_pending,sqlite3_open_file_count,sqlite3_pager_readdb_count,sqlite3_pager_writedb_count,sqlite3_pager_writej_count,sqlite3_search_count,sqlite3_sort_count,saved_cnt -lmodernc.org/sqlite/internal/libc2 -lmodernc.org/sqlite/libtest -lmodernc.org/tcl/lib -lmodernc.org/z/lib -o internal/testfixture/testfixture_linux_amd64.go -Itestdata/sqlite-src-3330000/ext/async -Itestdata/sqlite-src-3330000/ext/fts3 -Itestdata/sqlite-src-3330000/ext/icu -Itestdata/sqlite-src-3330000/ext/rtree -Itestdata/sqlite-src-3330000/ext/session -Itestdata/sqlite-src-3330000/ext/userauth -Itestdata/sqlite-src-3330000/src -Itestdata/sqlite-amalgamation-3330000 -Itestdata/sqlite-src-3330000 testdata/sqlite-src-3330000/ext/expert/sqlite3expert.c testdata/sqlite-src-3330000/ext/expert/test_expert.c testdata/sqlite-src-3330000/ext/fts3/fts3_term.c testdata/sqlite-src-3330000/ext/fts3/fts3_test.c testdata/sqlite-src-3330000/ext/fts5/fts5_tcl.c testdata/sqlite-src-3330000/ext/fts5/fts5_test_mi.c testdata/sqlite-src-3330000/ext/fts5/fts5_test_tok.c testdata/sqlite-src-3330000/ext/misc/amatch.c testdata/sqlite-src-3330000/ext/misc/carray.c testdata/sqlite-src-3330000/ext/misc/closure.c testdata/sqlite-src-3330000/ext/misc/csv.c testdata/sqlite-src-3330000/ext/misc/decimal.c testdata/sqlite-src-3330000/ext/misc/eval.c testdata/sqlite-src-3330000/ext/misc/explain.c testdata/sqlite-src-3330000/ext/misc/fileio.c testdata/sqlite-src-3330000/ext/misc/fuzzer.c testdata/sqlite-src-3330000/ext/misc/ieee754.c testdata/sqlite-src-3330000/ext/misc/mmapwarm.c testdata/sqlite-src-3330000/ext/misc/nextchar.c testdata/sqlite-src-3330000/ext/misc/normalize.c testdata/sqlite-src-3330000/ext/misc/percentile.c testdata/sqlite-src-3330000/ext/misc/prefixes.c testdata/sqlite-src-3330000/ext/misc/regexp.c testdata/sqlite-src-3330000/ext/misc/remember.c testdata/sqlite-src-3330000/ext/misc/series.c testdata/sqlite-src-3330000/ext/misc/spellfix.c testdata/sqlite-src-3330000/ext/misc/totype.c testdata/sqlite-src-3330000/ext/misc/unionvtab.c testdata/sqlite-src-3330000/ext/misc/wholenumber.c testdata/sqlite-src-3330000/ext/misc/zipfile.c testdata/sqlite-src-3330000/ext/rbu/test_rbu.c testdata/sqlite-src-3330000/ext/userauth/userauth.c testdata/sqlite-src-3330000/src/tclsqlite.c testdata/sqlite-src-3330000/src/test1.c testdata/sqlite-src-3330000/src/test2.c testdata/sqlite-src-3330000/src/test3.c testdata/sqlite-src-3330000/src/test4.c testdata/sqlite-src-3330000/src/test5.c testdata/sqlite-src-3330000/src/test6.c testdata/sqlite-src-3330000/src/test7.c testdata/sqlite-src-3330000/src/test8.c testdata/sqlite-src-3330000/src/test9.c testdata/sqlite-src-3330000/src/test_async.c testdata/sqlite-src-3330000/src/test_autoext.c testdata/sqlite-src-3330000/src/test_backup.c testdata/sqlite-src-3330000/src/test_bestindex.c testdata/sqlite-src-3330000/src/test_blob.c testdata/sqlite-src-3330000/src/test_btree.c testdata/sqlite-src-3330000/src/test_config.c testdata/sqlite-src-3330000/src/test_delete.c testdata/sqlite-src-3330000/src/test_demovfs.c testdata/sqlite-src-3330000/src/test_devsym.c testdata/sqlite-src-3330000/src/test_fs.c testdata/sqlite-src-3330000/src/test_func.c testdata/sqlite-src-3330000/src/test_hexio.c testdata/sqlite-src-3330000/src/test_init.c testdata/sqlite-src-3330000/src/test_intarray.c testdata/sqlite-src-3330000/src/test_journal.c testdata/sqlite-src-3330000/src/test_malloc.c testdata/sqlite-src-3330000/src/test_md5.c testdata/sqlite-src-3330000/src/test_multiplex.c testdata/sqlite-src-3330000/src/test_mutex.c testdata/sqlite-src-3330000/src/test_onefile.c testdata/sqlite-src-3330000/src/test_osinst.c testdata/sqlite-src-3330000/src/test_pcache.c testdata/sqlite-src-3330000/src/test_quota.c testdata/sqlite-src-3330000/src/test_rtree.c testdata/sqlite-src-3330000/src/test_schema.c testdata/sqlite-src-3330000/src/test_server.c testdata/sqlite-src-3330000/src/test_superlock.c testdata/sqlite-src-3330000/src/test_syscall.c testdata/sqlite-src-3330000/src/test_tclsh.c testdata/sqlite-src-3330000/src/test_tclvar.c testdata/sqlite-src-3330000/src/test_thread.c testdata/sqlite-src-3330000/src/test_vdbecov.c testdata/sqlite-src-3330000/src/test_vfs.c testdata/sqlite-src-3330000/src/test_windirent.c testdata/sqlite-src-3330000/src/test_window.c testdata/sqlite-src-3330000/src/test_wsd.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1', DO NOT EDIT. +// Code generated by 'ccgo -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 -DSQLITE_SERVER=1 -DTCLSH_INIT_PROC=sqlite3TestInit -D_HAVE_SQLITE_CONFIG_H -I/usr/include/tcl8.6 -export-defines "" -export-fields F -trace-translation-units -volatile=sqlite3_io_error_pending,sqlite3_open_file_count,sqlite3_pager_readdb_count,sqlite3_pager_writedb_count,sqlite3_pager_writej_count,sqlite3_search_count,sqlite3_sort_count,saved_cnt -lmodernc.org/sqlite/internal/libc2 -lmodernc.org/sqlite/libtest -lmodernc.org/tcl/lib -lmodernc.org/z/lib -o internal/testfixture/testfixture_linux_amd64.go -Itestdata/sqlite-src-3350000/ext/async -Itestdata/sqlite-src-3350000/ext/fts3 -Itestdata/sqlite-src-3350000/ext/icu -Itestdata/sqlite-src-3350000/ext/rtree -Itestdata/sqlite-src-3350000/ext/session -Itestdata/sqlite-src-3350000/ext/userauth -Itestdata/sqlite-src-3350000/src -Itestdata/sqlite-amalgamation-3350000 -Itestdata/sqlite-src-3350000 testdata/sqlite-src-3350000/ext/expert/sqlite3expert.c testdata/sqlite-src-3350000/ext/expert/test_expert.c testdata/sqlite-src-3350000/ext/fts3/fts3_term.c testdata/sqlite-src-3350000/ext/fts3/fts3_test.c testdata/sqlite-src-3350000/ext/fts5/fts5_tcl.c testdata/sqlite-src-3350000/ext/fts5/fts5_test_mi.c testdata/sqlite-src-3350000/ext/fts5/fts5_test_tok.c testdata/sqlite-src-3350000/ext/misc/appendvfs.c testdata/sqlite-src-3350000/ext/misc/amatch.c testdata/sqlite-src-3350000/ext/misc/carray.c testdata/sqlite-src-3350000/ext/misc/cksumvfs.c testdata/sqlite-src-3350000/ext/misc/closure.c testdata/sqlite-src-3350000/ext/misc/csv.c testdata/sqlite-src-3350000/ext/misc/decimal.c testdata/sqlite-src-3350000/ext/misc/eval.c testdata/sqlite-src-3350000/ext/misc/explain.c testdata/sqlite-src-3350000/ext/misc/fileio.c testdata/sqlite-src-3350000/ext/misc/fuzzer.c testdata/sqlite-src-3350000/ext/misc/ieee754.c testdata/sqlite-src-3350000/ext/misc/mmapwarm.c testdata/sqlite-src-3350000/ext/misc/nextchar.c testdata/sqlite-src-3350000/ext/misc/normalize.c testdata/sqlite-src-3350000/ext/misc/percentile.c testdata/sqlite-src-3350000/ext/misc/prefixes.c testdata/sqlite-src-3350000/ext/misc/regexp.c testdata/sqlite-src-3350000/ext/misc/remember.c testdata/sqlite-src-3350000/ext/misc/series.c testdata/sqlite-src-3350000/ext/misc/spellfix.c testdata/sqlite-src-3350000/ext/misc/totype.c testdata/sqlite-src-3350000/ext/misc/unionvtab.c testdata/sqlite-src-3350000/ext/misc/wholenumber.c testdata/sqlite-src-3350000/ext/misc/zipfile.c testdata/sqlite-src-3350000/ext/rbu/test_rbu.c testdata/sqlite-src-3350000/ext/userauth/userauth.c testdata/sqlite-src-3350000/src/tclsqlite.c testdata/sqlite-src-3350000/src/test1.c testdata/sqlite-src-3350000/src/test2.c testdata/sqlite-src-3350000/src/test3.c testdata/sqlite-src-3350000/src/test4.c testdata/sqlite-src-3350000/src/test5.c testdata/sqlite-src-3350000/src/test6.c testdata/sqlite-src-3350000/src/test7.c testdata/sqlite-src-3350000/src/test8.c testdata/sqlite-src-3350000/src/test9.c testdata/sqlite-src-3350000/src/test_async.c testdata/sqlite-src-3350000/src/test_autoext.c testdata/sqlite-src-3350000/src/test_backup.c testdata/sqlite-src-3350000/src/test_bestindex.c testdata/sqlite-src-3350000/src/test_blob.c testdata/sqlite-src-3350000/src/test_btree.c testdata/sqlite-src-3350000/src/test_config.c testdata/sqlite-src-3350000/src/test_delete.c testdata/sqlite-src-3350000/src/test_demovfs.c testdata/sqlite-src-3350000/src/test_devsym.c testdata/sqlite-src-3350000/src/test_fs.c testdata/sqlite-src-3350000/src/test_func.c testdata/sqlite-src-3350000/src/test_hexio.c testdata/sqlite-src-3350000/src/test_init.c testdata/sqlite-src-3350000/src/test_intarray.c testdata/sqlite-src-3350000/src/test_journal.c testdata/sqlite-src-3350000/src/test_malloc.c testdata/sqlite-src-3350000/src/test_md5.c testdata/sqlite-src-3350000/src/test_multiplex.c testdata/sqlite-src-3350000/src/test_mutex.c testdata/sqlite-src-3350000/src/test_onefile.c testdata/sqlite-src-3350000/src/test_osinst.c testdata/sqlite-src-3350000/src/test_pcache.c testdata/sqlite-src-3350000/src/test_quota.c testdata/sqlite-src-3350000/src/test_rtree.c testdata/sqlite-src-3350000/src/test_schema.c testdata/sqlite-src-3350000/src/test_server.c testdata/sqlite-src-3350000/src/test_superlock.c testdata/sqlite-src-3350000/src/test_syscall.c testdata/sqlite-src-3350000/src/test_tclsh.c testdata/sqlite-src-3350000/src/test_tclvar.c testdata/sqlite-src-3350000/src/test_thread.c testdata/sqlite-src-3350000/src/test_vdbecov.c testdata/sqlite-src-3350000/src/test_vfs.c testdata/sqlite-src-3350000/src/test_windirent.c testdata/sqlite-src-3350000/src/test_window.c testdata/sqlite-src-3350000/src/test_wsd.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CKSUMVFS_STATIC -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1', DO NOT EDIT. package main @@ -85,6 +85,7 @@ const ( SQLITE_CHECKPOINT_PASSIVE = 0 SQLITE_CHECKPOINT_RESTART = 2 SQLITE_CHECKPOINT_TRUNCATE = 3 + SQLITE_CKSUMVFS_STATIC = 1 SQLITE_CONFIG_COVERING_INDEX_SCAN = 20 SQLITE_CONFIG_GETMALLOC = 5 SQLITE_CONFIG_GETMUTEX = 11 @@ -309,6 +310,7 @@ const ( SQLITE_IOERR_CLOSE = 4106 SQLITE_IOERR_COMMIT_ATOMIC = 7690 SQLITE_IOERR_CONVPATH = 6666 + SQLITE_IOERR_CORRUPTFS = 8458 SQLITE_IOERR_DATA = 8202 SQLITE_IOERR_DELETE = 2570 SQLITE_IOERR_DELETE_NOENT = 5898 @@ -449,7 +451,7 @@ const ( SQLITE_SHM_SHARED = 4 SQLITE_SHM_UNLOCK = 1 SQLITE_SOUNDEX = 1 - SQLITE_SOURCE_ID = "2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f" + SQLITE_SOURCE_ID = "2021-03-12 15:10:09 acd63062eb06748bfe9e4886639e4f2b54ea6a496a83f10716abbaba4115500b" SQLITE_STATUS_MALLOC_COUNT = 9 SQLITE_STATUS_MALLOC_SIZE = 5 SQLITE_STATUS_MEMORY_USED = 0 @@ -488,7 +490,7 @@ const ( SQLITE_TESTCTRL_INTERNAL_FUNCTIONS = 17 SQLITE_TESTCTRL_ISINIT = 23 SQLITE_TESTCTRL_ISKEYWORD = 16 - SQLITE_TESTCTRL_LAST = 29 + SQLITE_TESTCTRL_LAST = 31 SQLITE_TESTCTRL_LOCALTIME_FAULT = 18 SQLITE_TESTCTRL_NEVER_CORRUPT = 20 SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD = 19 @@ -502,7 +504,9 @@ const ( SQLITE_TESTCTRL_RESERVE = 14 SQLITE_TESTCTRL_RESULT_INTREAL = 27 SQLITE_TESTCTRL_SCRATCHMALLOC = 17 + SQLITE_TESTCTRL_SEEK_COUNT = 30 SQLITE_TESTCTRL_SORTER_MMAP = 24 + SQLITE_TESTCTRL_TRACEFLAGS = 31 SQLITE_TESTCTRL_VDBE_COVERAGE = 21 SQLITE_TEXT = 3 SQLITE_THREADSAFE = 1 @@ -512,14 +516,17 @@ const ( SQLITE_TRACE_ROW = 0x04 SQLITE_TRACE_STMT = 0x01 SQLITE_TRANSACTION = 22 + SQLITE_TXN_NONE = 0 + SQLITE_TXN_READ = 1 + SQLITE_TXN_WRITE = 2 SQLITE_UPDATE = 23 SQLITE_UTF16 = 4 SQLITE_UTF16BE = 3 SQLITE_UTF16LE = 2 SQLITE_UTF16_ALIGNED = 8 SQLITE_UTF8 = 1 - SQLITE_VERSION = "3.33.0" - SQLITE_VERSION_NUMBER = 3033000 + SQLITE_VERSION = "3.35.0" + SQLITE_VERSION_NUMBER = 3035000 SQLITE_VTAB_CONSTRAINT_SUPPORT = 1 SQLITE_VTAB_DIRECTONLY = 3 SQLITE_VTAB_INNOCUOUS = 2 @@ -532,6 +539,8 @@ const ( X_ANSI_STDARG_H_ = 0 X_ASSERT_H = 1 X_ATFILE_SOURCE = 1 + X_BITS_G_CONFIG_H = 1 + X_BITS_LIBIO_H = 1 X_BITS_STDIO_LIM_H = 1 X_BITS_TYPESIZES_H = 1 X_BITS_TYPES_H = 1 @@ -544,14 +553,66 @@ const ( X_FILE_OFFSET_BITS = 64 X_FTS5_H = 0 X_GCC_SIZE_T = 0 + X_G_BUFSIZ = 8192 + X_G_HAVE_MMAP = 1 + X_G_HAVE_MREMAP = 1 + X_G_HAVE_ST_BLKSIZE = 0 + X_G_IO_IO_FILE_VERSION = 0x20001 X_HAVE_SQLITE_CONFIG_H = 1 X_IOFBF = 0 X_IOLBF = 1 X_IONBF = 2 - X_IO_EOF_SEEN = 0x0010 - X_IO_ERR_SEEN = 0x0020 + X_IOS_APPEND = 8 + X_IOS_ATEND = 4 + X_IOS_BIN = 128 + X_IOS_INPUT = 1 + X_IOS_NOCREATE = 32 + X_IOS_NOREPLACE = 64 + X_IOS_OUTPUT = 2 + X_IOS_TRUNC = 16 + X_IO_BAD_SEEN = 0x4000 + X_IO_BOOLALPHA = 0200000 + X_IO_BUFSIZ = 8192 + X_IO_CURRENTLY_PUTTING = 0x800 + X_IO_DEC = 020 + X_IO_DELETE_DONT_CLOSE = 0x40 + X_IO_DONT_CLOSE = 0100000 + X_IO_EOF_SEEN = 0x10 + X_IO_ERR_SEEN = 0x20 + X_IO_FIXED = 010000 + X_IO_FLAGS2_MMAP = 1 + X_IO_FLAGS2_NOTCANCEL = 2 + X_IO_FLAGS2_USER_WBUF = 8 + X_IO_HAVE_ST_BLKSIZE = 0 + X_IO_HEX = 0100 + X_IO_INTERNAL = 010 + X_IO_IN_BACKUP = 0x100 + X_IO_IS_APPENDING = 0x1000 + X_IO_IS_FILEBUF = 0x2000 + X_IO_LEFT = 02 + X_IO_LINE_BUF = 0x200 + X_IO_LINKED = 0x80 + X_IO_MAGIC = 0xFBAD0000 + X_IO_MAGIC_MASK = 0xFFFF0000 + X_IO_NO_READS = 4 + X_IO_NO_WRITES = 8 + X_IO_OCT = 040 + X_IO_RIGHT = 04 + X_IO_SCIENTIFIC = 04000 + X_IO_SHOWBASE = 0200 + X_IO_SHOWPOINT = 0400 + X_IO_SHOWPOS = 02000 + X_IO_SKIPWS = 01 + X_IO_STDIO = 040000 + X_IO_TIED_PUT_GET = 0x400 + X_IO_UNBUFFERED = 2 + X_IO_UNIFIED_JUMPTABLES = 1 + X_IO_UNITBUF = 020000 + X_IO_UPPERCASE = 01000 + X_IO_USER_BUF = 1 X_IO_USER_LOCK = 0x8000 X_LP64 = 1 + X_OLD_STDIO_MAGIC = 0xFABC0000 X_POSIX_C_SOURCE = 200809 X_POSIX_SOURCE = 1 X_SIZET_ = 0 @@ -564,6 +625,7 @@ const ( X_STDARG_H = 0 X_STDC_PREDEF_H = 1 X_STDIO_H = 1 + X_STDIO_USES_IOSTREAM = 0 X_STRINGS_H = 1 X_STRING_H = 1 X_SYS_CDEFS_H = 1 @@ -698,7 +760,7 @@ const ( TCL_PARSE_QUOTE_EXTRA = 1 TCL_PARSE_SUCCESS = 0 TCL_PARSE_SYNTAX = 8 - TCL_PATCH_LEVEL = "8.6.9" + TCL_PATCH_LEVEL = "8.6.8" TCL_READABLE = 2 TCL_REG_ADVANCED = 000003 TCL_REG_ADVF = 000002 @@ -715,7 +777,7 @@ const ( TCL_REG_NOTEOL = 0002 TCL_REG_QUOTE = 000004 TCL_RELEASE_LEVEL = 2 - TCL_RELEASE_SERIAL = 9 + TCL_RELEASE_SERIAL = 8 TCL_RESULT_SIZE = 200 TCL_RETURN = 2 TCL_SERVICE_ALL = 1 @@ -780,6 +842,15 @@ const ( X_TCLPLATDECLS = 0 X_FTSINT_H = 0 FTS3_TOK_SCHEMA = "CREATE TABLE x(input HIDDEN, token, start, end, position)" + APND_MARK_FOS_SZ = 8 + APND_MARK_PREFIX = "Start-Of-SQLite3-" + APND_MARK_PREFIX_SZ = 17 + APND_MARK_SIZE = 25 + APND_MAX_SIZE = 1000013824 + APND_ROUNDUP_BITS = 12 + SQLITE3EXT_H = 0 + SQLITE_EXTENSION_INIT1 = 0 + SQLITE_EXTENSION_INIT3 = 0 AMATCH_COL_COMMAND = 3 AMATCH_COL_DISTANCE = 1 AMATCH_COL_LANGUAGE = 2 @@ -796,9 +867,6 @@ const ( LITTLE_ENDIAN = 1234 PDP_ENDIAN = 3412 RAND_MAX = 2147483647 - SQLITE3EXT_H = 0 - SQLITE_EXTENSION_INIT1 = 0 - SQLITE_EXTENSION_INIT3 = 0 WCONTINUED = 8 WEXITED = 4 WNOHANG = 1 @@ -812,6 +880,7 @@ const ( X_BITS_PTHREADTYPES_ARCH_H = 1 X_BITS_PTHREADTYPES_COMMON_H = 1 X_BITS_STDINT_INTN_H = 1 + X_BITS_SYSMACROS_H = 1 X_BITS_UINTN_IDENTITY_H = 1 X_CTYPE_H = 1 X_ENDIAN_H = 1 @@ -819,6 +888,7 @@ const ( X_STDLIB_H = 1 X_STRUCT_TIMESPEC = 1 X_SYS_SELECT_H = 1 + X_SYS_SYSMACROS_H = 1 X_SYS_TYPES_H = 1 X_THREAD_SHARED_TYPES_H = 1 X_T_WCHAR = 0 @@ -1269,6 +1339,7 @@ const ( X_UTIME_H = 1 X_XBS5_LP64_OFF64 = 1 X_XBS5_LPBIG_OFFBIG = -1 + X_XOPEN_CRYPT = 1 X_XOPEN_ENH_I18N = 1 X_XOPEN_LEGACY = 1 X_XOPEN_REALTIME = 1 @@ -1598,7 +1669,6 @@ const ( SQLITE_EVAL_WITHOUTNULLS = 0x00001 SQLITE_TCL_NRE = 1 TCLSH = 1 - X_BITS_SIGACTION_H = 1 X_BITS_SIGCONTEXT_H = 1 X_BITS_SIGEVENT_CONSTS_H = 1 X_BITS_SIGINFO_ARCH_H = 1 @@ -1632,6 +1702,7 @@ const ( BTREE_LARGEST_ROOT_PAGE = 4 BTREE_MEMORY = 2 BTREE_OMIT_JOURNAL = 1 + BTREE_PREFORMAT = 0x80 BTREE_SAVEPOSITION = 0x02 BTREE_SCHEMA_VERSION = 1 BTREE_SEEK_EQ = 0x00000002 @@ -1678,7 +1749,6 @@ const ( ENAME_SPAN = 1 ENAME_TAB = 2 EP_Agg = 0x000010 - EP_Alias = 0x400000 EP_CanBeNull = 0x100000 EP_Collate = 0x000100 EP_Commuted = 0x000200 @@ -1689,6 +1759,7 @@ const ( EP_FromDDL = 0x40000000 EP_FromJoin = 0x000001 EP_HasFunc = 0x000004 + EP_IfNullRow = 0x020000 EP_Immutable = 0x02 EP_InfixFunc = 0x000080 EP_IntValue = 0x000400 @@ -1712,7 +1783,7 @@ const ( EP_xIsSelect = 0x000800 EXCLUSIVE_LOCK = 4 EXPRDUP_REDUCE = 0x0001 - GCC_VERSION = 8003000 + GCC_VERSION = 7005000 HAVE_DLFCN_H = 1 HAVE_FCHOWN = 1 HAVE_FDATASYNC = 1 @@ -1748,7 +1819,8 @@ const ( HAVE_UINTPTR_T = 1 HAVE_UNISTD_H = 1 HAVE_UTIME = 1 - INITFLAG_AlterTable = 0x0001 + INITFLAG_AlterDrop = 0x0002 + INITFLAG_AlterRename = 0x0001 INLINEFUNC_affinity = 4 INLINEFUNC_coalesce = 0 INLINEFUNC_expr_compare = 3 @@ -1820,6 +1892,9 @@ const ( LOOKASIDE_SMALL = 128 LT_OBJDIR = ".libs/" L_cuserid = 9 + M10d_Any = 1 + M10d_No = 2 + M10d_Yes = 0 MEMTYPE_HEAP = 0x01 MEMTYPE_LOOKASIDE = 0x02 MEMTYPE_PCACHE = 0x04 @@ -1857,6 +1932,7 @@ const ( NC_PartIdx = 0x00002 NC_SelfRef = 0x0002e NC_UAggInfo = 0x00100 + NC_UBaseReg = 0x00400 NC_UEList = 0x00080 NC_UUpsert = 0x00200 NC_VarSelect = 0x00040 @@ -1891,6 +1967,7 @@ const ( OPFLAG_NOCHNG_MAGIC = 0x6d OPFLAG_P2ISREG = 0x10 OPFLAG_PERMUTE = 0x01 + OPFLAG_PREFORMAT = 0x80 OPFLAG_SAVEPOSITION = 0x02 OPFLAG_SEEKEQ = 0x02 OPFLAG_TYPEOFARG = 0x80 @@ -1901,51 +1978,52 @@ const ( OPFLG_JUMP = 0x01 OPFLG_OUT2 = 0x10 OPFLG_OUT3 = 0x20 - OP_Abortable = 175 - OP_Add = 105 - OP_AddImm = 82 - OP_Affinity = 90 - OP_AggFinal = 157 - OP_AggInverse = 153 - OP_AggStep = 154 - OP_AggStep1 = 155 - OP_AggValue = 156 + OP_Abortable = 178 + OP_Add = 106 + OP_AddImm = 83 + OP_Affinity = 91 + OP_AggFinal = 160 + OP_AggInverse = 156 + OP_AggStep = 157 + OP_AggStep1 = 158 + OP_AggValue = 159 OP_And = 44 OP_AutoCommit = 1 - OP_BitAnd = 101 - OP_BitNot = 112 - OP_BitOr = 102 + OP_BitAnd = 102 + OP_BitNot = 113 + OP_BitOr = 103 OP_Blob = 74 - OP_Cast = 84 + OP_Cast = 85 OP_Checkpoint = 6 - OP_Clear = 137 - OP_Close = 116 - OP_CollSeq = 81 - OP_Column = 89 - OP_ColumnsUsed = 117 - OP_Compare = 86 - OP_Concat = 110 + OP_ChngCntRow = 80 + OP_Clear = 140 + OP_Close = 117 + OP_CollSeq = 82 + OP_Column = 90 + OP_ColumnsUsed = 118 + OP_Compare = 87 + OP_Concat = 111 OP_Copy = 77 - OP_Count = 92 - OP_CreateBtree = 139 - OP_CursorHint = 171 - OP_CursorLock = 159 - OP_CursorUnlock = 160 + OP_Count = 93 + OP_CreateBtree = 142 + OP_CursorHint = 174 + OP_CursorLock = 162 + OP_CursorUnlock = 163 OP_DecrJumpZero = 59 - OP_DeferredSeek = 133 - OP_Delete = 122 - OP_Destroy = 136 - OP_Divide = 108 - OP_DropIndex = 144 - OP_DropTable = 143 - OP_DropTrigger = 145 + OP_DeferredSeek = 136 + OP_Delete = 125 + OP_Destroy = 139 + OP_Divide = 109 + OP_DropIndex = 147 + OP_DropTable = 146 + OP_DropTrigger = 148 OP_ElseNotEq = 58 OP_EndCoroutine = 66 OP_Eq = 53 - OP_Expire = 158 - OP_Explain = 174 - OP_FinishSeek = 135 - OP_FkCounter = 149 + OP_Expire = 161 + OP_Explain = 177 + OP_FinishSeek = 138 + OP_FkCounter = 153 OP_FkIfZero = 47 OP_Found = 30 OP_Function = 64 @@ -1955,13 +2033,13 @@ const ( OP_Gt = 54 OP_Halt = 68 OP_HaltIfNull = 67 - OP_IdxDelete = 132 + OP_IdxDelete = 135 OP_IdxGE = 41 OP_IdxGT = 39 - OP_IdxInsert = 130 + OP_IdxInsert = 133 OP_IdxLE = 38 OP_IdxLT = 40 - OP_IdxRowid = 134 + OP_IdxRowid = 137 OP_If = 18 OP_IfNoHope = 27 OP_IfNot = 20 @@ -1973,106 +2051,108 @@ const ( OP_IncrVacuum = 60 OP_Init = 62 OP_InitCoroutine = 13 - OP_Insert = 121 + OP_Insert = 123 OP_Int64 = 70 OP_IntCopy = 79 OP_Integer = 69 - OP_IntegrityCk = 146 + OP_IntegrityCk = 149 OP_IsNull = 50 - OP_IsTrue = 87 + OP_IsTrue = 88 OP_JournalMode = 7 OP_Jump = 16 OP_Last = 33 OP_Le = 55 - OP_LoadAnalysis = 142 + OP_LoadAnalysis = 145 OP_Lt = 56 - OP_MakeRecord = 91 - OP_MaxPgcnt = 169 - OP_MemMax = 151 + OP_MakeRecord = 92 + OP_MaxPgcnt = 172 + OP_MemMax = 154 OP_Move = 76 - OP_Multiply = 107 + OP_Multiply = 108 OP_MustBeInt = 15 OP_Ne = 52 - OP_NewRowid = 120 + OP_NewRowid = 122 OP_Next = 5 OP_NoConflict = 28 - OP_Noop = 173 + OP_Noop = 176 OP_Not = 19 OP_NotExists = 32 OP_NotFound = 29 OP_NotNull = 51 OP_Null = 72 - OP_NullRow = 128 - OP_Offset = 88 - OP_OffsetLimit = 152 + OP_NullRow = 131 + OP_Offset = 89 + OP_OffsetLimit = 155 OP_Once = 17 - OP_OpenAutoindex = 99 - OP_OpenDup = 98 - OP_OpenEphemeral = 100 - OP_OpenPseudo = 114 - OP_OpenRead = 96 - OP_OpenWrite = 97 + OP_OpenAutoindex = 100 + OP_OpenDup = 99 + OP_OpenEphemeral = 101 + OP_OpenPseudo = 115 + OP_OpenRead = 97 + OP_OpenWrite = 98 OP_Or = 43 - OP_Pagecount = 168 - OP_Param = 148 - OP_ParseSchema = 141 - OP_Permutation = 85 + OP_Pagecount = 171 + OP_Param = 151 + OP_ParseSchema = 144 + OP_Permutation = 86 OP_Prev = 4 OP_Program = 46 OP_PureFunc = 63 - OP_ReadCookie = 93 - OP_Real = 150 - OP_RealAffinity = 83 - OP_ReleaseReg = 172 - OP_Remainder = 109 - OP_ReopenIdx = 95 - OP_ResetCount = 123 - OP_ResetSorter = 138 - OP_ResultRow = 80 + OP_ReadCookie = 94 + OP_Real = 152 + OP_RealAffinity = 84 + OP_ReleaseReg = 175 + OP_Remainder = 110 + OP_ReopenIdx = 96 + OP_ResetCount = 126 + OP_ResetSorter = 141 + OP_ResultRow = 81 OP_Return = 65 OP_Rewind = 37 - OP_RowData = 126 - OP_RowSetAdd = 147 + OP_RowCell = 124 + OP_RowData = 129 + OP_RowSetAdd = 150 OP_RowSetRead = 42 OP_RowSetTest = 45 - OP_Rowid = 127 + OP_Rowid = 130 OP_SCopy = 78 OP_Savepoint = 0 - OP_SeekEnd = 129 + OP_SeekEnd = 132 OP_SeekGE = 24 OP_SeekGT = 25 - OP_SeekHit = 118 + OP_SeekHit = 120 OP_SeekLE = 23 OP_SeekLT = 22 OP_SeekRowid = 31 - OP_Sequence = 119 - OP_SequenceTest = 113 - OP_SetCookie = 94 - OP_ShiftLeft = 103 - OP_ShiftRight = 104 + OP_SeekScan = 119 + OP_Sequence = 121 + OP_SequenceTest = 114 + OP_SetCookie = 95 + OP_ShiftLeft = 104 + OP_ShiftRight = 105 OP_SoftNull = 73 OP_Sort = 36 - OP_SorterCompare = 124 - OP_SorterData = 125 - OP_SorterInsert = 131 + OP_SorterCompare = 127 + OP_SorterData = 128 + OP_SorterInsert = 134 OP_SorterNext = 3 - OP_SorterOpen = 111 + OP_SorterOpen = 112 OP_SorterSort = 35 - OP_SqlExec = 140 + OP_SqlExec = 143 OP_String = 71 - OP_String8 = 115 - OP_Subtract = 106 - OP_TableLock = 161 - OP_Trace = 170 + OP_String8 = 116 + OP_Subtract = 107 + OP_TableLock = 164 + OP_Trace = 173 OP_Transaction = 2 - OP_VBegin = 162 - OP_VColumn = 166 - OP_VCreate = 163 - OP_VDestroy = 164 + OP_VBegin = 165 + OP_VColumn = 169 + OP_VCreate = 166 + OP_VDestroy = 167 OP_VFilter = 9 OP_VNext = 61 - OP_VOpen = 165 - OP_VRename = 167 + OP_VOpen = 168 + OP_VRename = 170 OP_VUpdate = 10 OP_Vacuum = 8 OP_Variable = 75 @@ -2104,7 +2184,7 @@ const ( P5_ConstraintUnique = 2 PACKAGE_BUGREPORT = "" PACKAGE_NAME = "sqlite" - PACKAGE_STRING = "sqlite 3.33.0" + PACKAGE_STRING = "sqlite 3.35.0" PACKAGE_TARNAME = "sqlite" PAGER_CACHESPILL = 0x20 PAGER_CKPT_FULLFSYNC = 0x10 @@ -2188,9 +2268,6 @@ const ( PTRDIFF_MAX = 9223372036854775807 PTRDIFF_MIN = -9223372036854775808 PTRDIFF_WIDTH = 64 - RENAME_EXCHANGE = 2 - RENAME_NOREPLACE = 1 - RENAME_WHITEOUT = 4 RESERVED_LOCK = 2 RLIM64_INFINITY = 0xffffffffffffffff RLIM_INFINITY = 0xffffffffffffffff @@ -2251,9 +2328,11 @@ const ( SF_IncludeHidden = 0x0020000 SF_MaybeConvert = 0x0008000 SF_MinMaxAgg = 0x0001000 + SF_MultiPart = 0x2000000 SF_MultiValue = 0x0000400 SF_NestedFrom = 0x0000800 SF_NoopOrderBy = 0x0400000 + SF_PushDown = 0x1000000 SF_Recursive = 0x0002000 SF_Resolved = 0x0000004 SF_UpdateFrom = 0x0800000 @@ -2279,7 +2358,7 @@ const ( SQLITE_AFF_REAL = 0x45 SQLITE_AFF_TEXT = 0x42 SQLITE_ASCII = 1 - SQLITE_AllOpts = 0xffff + SQLITE_AllOpts = 0xffffffff SQLITE_AutoIndex = 0x00008000 SQLITE_BIGENDIAN = 0 SQLITE_BIG_DBL = 0 @@ -2288,9 +2367,9 @@ const ( SQLITE_CacheSpill = 0x00000020 SQLITE_CellSizeCk = 0x00200000 SQLITE_CkptFullFSync = 0x00000010 - SQLITE_CountOfView = 0x0200 - SQLITE_CoverIdxScan = 0x0020 - SQLITE_CursorHints = 0x0400 + SQLITE_CountOfView = 0x00000200 + SQLITE_CoverIdxScan = 0x00000020 + SQLITE_CursorHints = 0x00000400 SQLITE_DEFAULT_AUTOVACUUM = 0 SQLITE_DEFAULT_CACHE_SIZE = -2000 SQLITE_DEFAULT_FILE_FORMAT = 4 @@ -2306,7 +2385,7 @@ const ( SQLITE_DEFAULT_WORKER_THREADS = 0 SQLITE_Defensive = 0x10000000 SQLITE_DeferFKs = 0x00080000 - SQLITE_DistinctOpt = 0x0010 + SQLITE_DistinctOpt = 0x00000010 SQLITE_DqsDDL = 0x20000000 SQLITE_DqsDML = 0x40000000 SQLITE_ECEL_DUP = 0x01 @@ -2317,6 +2396,7 @@ const ( SQLITE_EnableQPSG = 0x00800000 SQLITE_EnableTrigger = 0x00040000 SQLITE_EnableView = 0x80000000 + SQLITE_ExistsToIN = 0x00020000 SQLITE_FAULTINJECTOR_COUNT = 1 SQLITE_FAULTINJECTOR_MALLOC = 0 SQLITE_FCNTL_DB_UNCHANGED = 0xca093fa0 @@ -2342,13 +2422,14 @@ const ( SQLITE_FUNC_UNLIKELY = 0x0400 SQLITE_FUNC_UNSAFE = 0x00200000 SQLITE_FUNC_WINDOW = 0x00010000 - SQLITE_FactorOutConst = 0x0008 + SQLITE_FactorOutConst = 0x00000008 SQLITE_ForeignKeys = 0x00004000 SQLITE_Fts3Tokenizer = 0x00400000 SQLITE_FullColNames = 0x00000004 SQLITE_FullFSync = 0x00000008 - SQLITE_GroupByOrder = 0x0004 + SQLITE_GroupByOrder = 0x00000004 SQLITE_HASH_H = 0 + SQLITE_HAVE_C99_MATH_FUNCS = 1 SQLITE_HAVE_OS_TRACE = 0 SQLITE_IDXTYPE_APPDEF = 0 SQLITE_IDXTYPE_IPK = 3 @@ -2373,6 +2454,7 @@ const ( SQLITE_MAX_ATTACHED = 10 SQLITE_MAX_COLUMN = 2000 SQLITE_MAX_COMPOUND_SELECT = 500 + SQLITE_MAX_DB = 12 SQLITE_MAX_DEFAULT_PAGE_SIZE = 8192 SQLITE_MAX_EXPR_DEPTH = 1000 SQLITE_MAX_FILE_FORMAT = 4 @@ -2390,6 +2472,7 @@ const ( SQLITE_MAX_WORKER_THREADS = 8 SQLITE_MSVC_H = 0 SQLITE_MX_JUMP_OPCODE = 62 + SQLITE_MinMaxOpt = 0x00010000 SQLITE_NEED_ERR_NAME = 0 SQLITE_NOMEM_BKPT = 7 SQLITE_NOTNULL = 0x90 @@ -2403,8 +2486,8 @@ const ( SQLITE_OS_SETUP_H = 0 SQLITE_OS_UNIX = 1 SQLITE_OS_WIN = 0 - SQLITE_OmitNoopJoin = 0x0100 - SQLITE_OrderByIdxJoin = 0x0040 + SQLITE_OmitNoopJoin = 0x00000100 + SQLITE_OrderByIdxJoin = 0x00000040 SQLITE_PAGER_H = 0 SQLITE_POWERSAFE_OVERWRITE = 1 SQLITE_PREPARE_MASK = 0x0f @@ -2413,9 +2496,9 @@ const ( SQLITE_PRINTF_MALLOCED = 0x04 SQLITE_PRINTF_SQLFUNC = 0x02 SQLITE_PTRSIZE = 8 - SQLITE_PropagateConst = 0x8000 - SQLITE_PushDown = 0x1000 - SQLITE_QueryFlattener = 0x0001 + SQLITE_PropagateConst = 0x00008000 + SQLITE_PushDown = 0x00001000 + SQLITE_QueryFlattener = 0x00000001 SQLITE_QueryOnly = 0x00100000 SQLITE_ReadUncommit = 0x00000400 SQLITE_RecTriggers = 0x00002000 @@ -2427,16 +2510,16 @@ const ( SQLITE_STOREP2 = 0x20 SQLITE_SYSTEM_MALLOC = 1 SQLITE_ShortColNames = 0x00000040 - SQLITE_SimplifyJoin = 0x2000 - SQLITE_SkipScan = 0x4000 - SQLITE_Stat4 = 0x0800 + SQLITE_SimplifyJoin = 0x00002000 + SQLITE_SkipScan = 0x00004000 + SQLITE_Stat4 = 0x00000800 SQLITE_TEMP_FILE_PREFIX = "etilqs_" SQLITE_TOKEN_KEYWORD = 0x2 SQLITE_TOKEN_QUOTED = 0x1 SQLITE_TRACE_LEGACY = 0x40 SQLITE_TRACE_NONLEGACY_MASK = 0x0f SQLITE_TRACE_XPROFILE = 0x80 - SQLITE_Transitive = 0x0080 + SQLITE_Transitive = 0x00000080 SQLITE_TriggerEQP = 0x01000000 SQLITE_TrustedSchema = 0x00000080 SQLITE_UTF16NATIVE = 2 @@ -2446,16 +2529,16 @@ const ( SQLITE_VTABRISK_Low = 0 SQLITE_VTABRISK_Normal = 1 SQLITE_WSD = 0 - SQLITE_WindowFunc = 0x0002 + SQLITE_WindowFunc = 0x00000002 SQLITE_WriteSchema = 0x00000001 SRT_Coroutine = 13 SRT_Discard = 4 - SRT_DistFifo = 6 - SRT_DistQueue = 8 + SRT_DistFifo = 5 + SRT_DistQueue = 6 SRT_EphemTab = 12 SRT_Except = 2 SRT_Exists = 3 - SRT_Fifo = 5 + SRT_Fifo = 8 SRT_Mem = 10 SRT_Output = 9 SRT_Queue = 7 @@ -2465,11 +2548,13 @@ const ( SRT_Upfrom = 15 STDC_HEADERS = 1 TF_Autoincrement = 0x0008 - TF_Ephemeral = 0x0002 + TF_Ephemeral = 0x4000 TF_HasGenerated = 0x0060 + TF_HasHidden = 0x0002 TF_HasNotNull = 0x0800 TF_HasPrimaryKey = 0x0004 TF_HasStat1 = 0x0010 + TF_HasStat4 = 0x2000 TF_HasStored = 0x0040 TF_HasVirtual = 0x0020 TF_NoVisibleRowid = 0x0200 @@ -2480,152 +2565,154 @@ const ( TF_WithoutRowid = 0x0080 TK_ABORT = 27 TK_ACTION = 28 - TK_ADD = 160 + TK_ADD = 162 TK_AFTER = 29 - TK_AGG_COLUMN = 166 - TK_AGG_FUNCTION = 165 - TK_ALL = 133 - TK_ALTER = 159 + TK_AGG_COLUMN = 168 + TK_AGG_FUNCTION = 167 + TK_ALL = 134 + TK_ALTER = 161 TK_ALWAYS = 96 TK_ANALYZE = 30 TK_AND = 44 - TK_ANY = 100 + TK_ANY = 101 TK_AS = 24 TK_ASC = 31 - TK_ASTERISK = 177 + TK_ASTERISK = 179 TK_ATTACH = 32 - TK_AUTOINCR = 124 + TK_AUTOINCR = 125 TK_BEFORE = 33 TK_BEGIN = 5 TK_BETWEEN = 48 TK_BY = 34 TK_CASCADE = 35 - TK_CASE = 154 + TK_CASE = 156 TK_CAST = 36 - TK_CHECK = 122 - TK_COLLATE = 111 - TK_COLUMN = 164 + TK_CHECK = 123 + TK_COLLATE = 112 + TK_COLUMN = 166 TK_COLUMNKW = 60 TK_COMMIT = 10 TK_CONFLICT = 37 - TK_CONSTRAINT = 117 + TK_CONSTRAINT = 118 TK_CREATE = 17 - TK_CTIME_KW = 99 + TK_CTIME_KW = 100 TK_CURRENT = 85 TK_DATABASE = 38 - TK_DEFAULT = 118 - TK_DEFERRABLE = 129 + TK_DEFAULT = 119 + TK_DEFERRABLE = 130 TK_DEFERRED = 7 - TK_DELETE = 126 + TK_DELETE = 127 TK_DESC = 39 TK_DETACH = 40 - TK_DISTINCT = 138 + TK_DISTINCT = 139 TK_DO = 61 - TK_DROP = 131 + TK_DROP = 132 TK_EACH = 41 - TK_ELSE = 157 + TK_ELSE = 159 TK_END = 11 TK_ESCAPE = 58 - TK_EXCEPT = 134 + TK_EXCEPT = 135 TK_EXCLUDE = 91 TK_EXCLUSIVE = 9 TK_EXISTS = 20 TK_EXPLAIN = 2 TK_FAIL = 42 - TK_FILTER = 163 + TK_FILTER = 165 TK_FIRST = 83 TK_FOLLOWING = 86 TK_FOR = 62 - TK_FOREIGN = 130 - TK_FROM = 140 - TK_FUNCTION = 169 + TK_FOREIGN = 131 + TK_FROM = 141 + TK_FUNCTION = 171 TK_GENERATED = 95 - TK_GROUP = 144 + TK_GROUP = 145 TK_GROUPS = 92 - TK_HAVING = 145 + TK_HAVING = 146 TK_IF = 18 - TK_IF_NULL_ROW = 176 + TK_IF_NULL_ROW = 178 TK_IGNORE = 63 TK_IMMEDIATE = 8 TK_IN = 49 - TK_INDEX = 158 - TK_INDEXED = 114 + TK_INDEX = 160 + TK_INDEXED = 115 TK_INITIALLY = 64 - TK_INSERT = 125 + TK_INSERT = 126 TK_INSTEAD = 65 - TK_INTERSECT = 135 - TK_INTO = 148 + TK_INTERSECT = 136 + TK_INTO = 150 TK_IS = 45 - TK_ISNOT = 168 + TK_ISNOT = 170 TK_ISNULL = 50 - TK_JOIN = 141 - TK_JOIN_KW = 116 + TK_JOIN = 142 + TK_JOIN_KW = 117 TK_KEY = 67 TK_LAST = 84 TK_LIKE_KW = 47 - TK_LIMIT = 146 + TK_LIMIT = 147 TK_MATCH = 46 + TK_MATERIALIZED = 97 TK_NO = 66 TK_NOT = 19 - TK_NOTHING = 149 + TK_NOTHING = 151 TK_NOTNULL = 51 - TK_NULL = 119 + TK_NULL = 120 TK_NULLS = 82 TK_OF = 68 TK_OFFSET = 69 - TK_ON = 113 + TK_ON = 114 TK_OR = 43 - TK_ORDER = 143 + TK_ORDER = 144 TK_OTHERS = 93 - TK_OVER = 162 + TK_OVER = 164 TK_PARTITION = 87 TK_PLAN = 4 TK_PRAGMA = 70 TK_PRECEDING = 88 - TK_PRIMARY = 120 + TK_PRIMARY = 121 TK_QUERY = 3 TK_RAISE = 71 TK_RANGE = 89 TK_RECURSIVE = 72 - TK_REFERENCES = 123 - TK_REGISTER = 173 - TK_REINDEX = 97 + TK_REFERENCES = 124 + TK_REGISTER = 175 + TK_REINDEX = 98 TK_RELEASE = 14 - TK_RENAME = 98 + TK_RENAME = 99 TK_REPLACE = 73 TK_RESTRICT = 74 + TK_RETURNING = 149 TK_ROLLBACK = 12 TK_ROW = 75 TK_ROWS = 76 TK_SAVEPOINT = 13 - TK_SELECT = 136 - TK_SELECT_COLUMN = 175 - TK_SET = 128 - TK_SPAN = 178 + TK_SELECT = 137 + TK_SELECT_COLUMN = 177 + TK_SET = 129 + TK_SPAN = 180 TK_TABLE = 16 TK_TEMP = 21 - TK_THEN = 156 + TK_THEN = 158 TK_TIES = 94 TK_TO = 15 TK_TRANSACTION = 6 TK_TRIGGER = 77 - TK_TRUEFALSE = 167 - TK_TRUTH = 172 - TK_UMINUS = 170 + TK_TRUEFALSE = 169 + TK_TRUTH = 174 + TK_UMINUS = 172 TK_UNBOUNDED = 90 - TK_UNION = 132 - TK_UNIQUE = 121 - TK_UPDATE = 127 - TK_UPLUS = 171 - TK_USING = 142 + TK_UNION = 133 + TK_UNIQUE = 122 + TK_UPDATE = 128 + TK_UPLUS = 173 + TK_USING = 143 TK_VACUUM = 78 - TK_VALUES = 137 - TK_VECTOR = 174 + TK_VALUES = 138 + TK_VECTOR = 176 TK_VIEW = 79 TK_VIRTUAL = 80 - TK_WHEN = 155 - TK_WHERE = 147 - TK_WINDOW = 161 + TK_WHEN = 157 + TK_WHERE = 148 + TK_WINDOW = 163 TK_WITH = 81 TK_WITHOUT = 25 TRIGGER_AFTER = 2 @@ -2681,8 +2768,6 @@ const ( WHERE_ORDERBY_MIN = 0x0001 WHERE_ORDERBY_NORMAL = 0x0000 WHERE_OR_SUBCLAUSE = 0x0020 - WHERE_SEEK_TABLE = 0x0400 - WHERE_SEEK_UNIQ_TABLE = 0x1000 WHERE_SORTBYGROUP = 0x0200 WHERE_USE_LIMIT = 0x4000 WHERE_WANT_DISTINCT = 0x0100 @@ -2828,7 +2913,6 @@ const ( X_BITS_SCHED_H = 1 X_BITS_SETJMP_H = 1 X_BITS_TIMEX_H = 1 - X_BITS_TYPES_STRUCT_SCHED_PARAM = 1 X_PTHREAD_H = 1 X_SCHED_H = 1 TCL_THREADS = 0 @@ -2840,10 +2924,6 @@ const ( WRITECRASH_NAME = "writecrash" AT_EMPTY_PATH = 0x1000 AT_NO_AUTOMOUNT = 0x800 - AT_STATX_DONT_SYNC = 0x4000 - AT_STATX_FORCE_SYNC = 0x2000 - AT_STATX_SYNC_AS_STAT = 0x0000 - AT_STATX_SYNC_TYPE = 0x6000 DN_ACCESS = 0x00000001 DN_ATTRIB = 0x00000020 DN_CREATE = 0x00000004 @@ -2900,27 +2980,6 @@ const ( SPLICE_F_MORE = 4 SPLICE_F_MOVE = 1 SPLICE_F_NONBLOCK = 2 - STATX_ALL = 0x0fff - STATX_ATIME = 0x0020 - STATX_ATTR_APPEND = 0x0020 - STATX_ATTR_AUTOMOUNT = 0x1000 - STATX_ATTR_COMPRESSED = 0x0004 - STATX_ATTR_ENCRYPTED = 0x0800 - STATX_ATTR_IMMUTABLE = 0x0010 - STATX_ATTR_NODUMP = 0x0040 - STATX_BASIC_STATS = 0x07ff - STATX_BLOCKS = 0x0400 - STATX_BTIME = 0x0800 - STATX_CTIME = 0x0080 - STATX_GID = 0x0010 - STATX_INO = 0x0100 - STATX_MODE = 0x0002 - STATX_MTIME = 0x0040 - STATX_NLINK = 0x0004 - STATX_SIZE = 0x0200 - STATX_TYPE = 0x0001 - STATX_UID = 0x0008 - STATX__RESERVED = 0x80000000 SYNC_FILE_RANGE_WAIT_AFTER = 4 SYNC_FILE_RANGE_WAIT_BEFORE = 1 SYNC_FILE_RANGE_WRITE = 2 @@ -3012,7 +3071,6 @@ const ( MAP_EXECUTABLE = 0x01000 MAP_FILE = 0 MAP_FIXED = 0x10 - MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x00100 MAP_HUGETLB = 0x40000 MAP_HUGE_MASK = 0x3f @@ -3023,9 +3081,7 @@ const ( MAP_POPULATE = 0x08000 MAP_PRIVATE = 0x02 MAP_SHARED = 0x01 - MAP_SHARED_VALIDATE = 0x03 MAP_STACK = 0x20000 - MAP_SYNC = 0x80000 MAP_TYPE = 0x0f MCL_CURRENT = 1 MCL_FUTURE = 2 @@ -3084,8 +3140,23 @@ const ( TESTVFS_WRITE_MASK = 0x00001000 ) -// If we are compiling with optimizing read this file. It contains -// several optimizing inline functions and macros. +// Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface. +// Copyright (C) 1996-2018 Free Software Foundation, Inc. +// This file is part of the GNU C Library. +// +// The GNU C Library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// The GNU C Library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with the GNU C Library; if not, see +// . // Copyright (C) 1991-2018 Free Software Foundation, Inc. // This file is part of the GNU C Library. @@ -3295,7 +3366,7 @@ const ( /* pthread.h:77:1: */ // Positions to pass to Tcl_QueueEvent: -const ( /* tcl.h:1387:1: */ +const ( /* tcl.h:1391:1: */ TCL_QUEUE_TAIL = 0 TCL_QUEUE_HEAD = 1 TCL_QUEUE_MARK = 2 @@ -3308,7 +3379,7 @@ const ( /* tcl.h:1387:1: */ //---------------------------------------------------------------------------- // Enum for different types of file paths. -const ( /* tcl.h:1609:1: */ +const ( /* tcl.h:1613:1: */ TCL_PATH_ABSOLUTE = 0 TCL_PATH_RELATIVE = 1 TCL_PATH_VOLUME_RELATIVE = 2 @@ -3338,7 +3409,7 @@ const ( /* tcl.h:1609:1: */ // Argument descriptors for math function callbacks in expressions: -const ( /* tcl.h:690:1: */ +const ( /* tcl.h:694:1: */ TCL_INT = 0 TCL_DOUBLE = 1 TCL_EITHER = 2 @@ -3753,6 +3824,14 @@ const ( /* fcntl-linux.h:265:1: */ F_OWNER_GID = 2 ) +// This is the structure from the libstdc++ codecvt class. +const ( /* libio.h:180:1: */ + __codecvt_ok = 0 + __codecvt_partial = 1 + __codecvt_error = 2 + __codecvt_noconv = 3 +) + // Whose usage statistics do you want? const ( /* resource.h:158:1: */ // The calling process. @@ -3760,6 +3839,10 @@ const ( /* resource.h:158:1: */ // All of its terminated child processes. RUSAGE_CHILDREN = -1 +) + +// Whose usage statistics do you want? +const ( /* resource.h:158:1: */ // The calling thread. RUSAGE_THREAD = 1 ) @@ -4204,7 +4287,7 @@ type sqlite32 = struct { FerrCode int32 FerrMask int32 FiSysErrno int32 - FdbOptFlags u16 + FdbOptFlags u322 Fenc u8 FautoCommit u8 Ftemp_store u8 @@ -4218,13 +4301,14 @@ type sqlite32 = struct { FmTrace u8 FnoSharedCache u8 FnSqlExec u8 - _ [1]byte + _ [3]byte FnextPagesize int32 Fmagic u322 FnChange int32 FnTotalChange int32 FaLimit [12]int32 FnMaxSorterMmap int32 + _ [4]byte Finit struct { FnewTnum Pgno FiDb u8 @@ -4429,7 +4513,7 @@ type sqlite3_callback = uintptr /* sqlite3.h:338:13 */ // for their own use. The pMethods entry is a pointer to an // [sqlite3_io_methods] object that defines methods for performing // I/O operations on the open file. -type sqlite3_file1 = struct{ FpMethods uintptr } /* sqlite3.h:683:9 */ +type sqlite3_file1 = struct{ FpMethods uintptr } /* sqlite3.h:684:9 */ // CAPI3REF: Result Codes // KEYWORDS: {result code definitions} @@ -4540,7 +4624,7 @@ type sqlite3_file1 = struct{ FpMethods uintptr } /* sqlite3.h:683:9 */ // for their own use. The pMethods entry is a pointer to an // [sqlite3_io_methods] object that defines methods for performing // I/O operations on the open file. -type sqlite3_file = sqlite3_file1 /* sqlite3.h:683:29 */ +type sqlite3_file = sqlite3_file1 /* sqlite3.h:684:29 */ type sqlite3_io_methods1 = struct { FiVersion int32 _ [4]byte @@ -4562,7 +4646,7 @@ type sqlite3_io_methods1 = struct { FxShmUnmap uintptr FxFetch uintptr FxUnfetch uintptr -} /* sqlite3.h:683:9 */ +} /* sqlite3.h:684:9 */ // CAPI3REF: OS Interface File Virtual Methods Object // @@ -4656,7 +4740,7 @@ type sqlite3_io_methods1 = struct { // fails to zero-fill short reads might seem to work. However, // failure to zero-fill short reads will eventually lead to // database corruption. -type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:782:35 */ +type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:783:35 */ // CAPI3REF: Standard File Control Opcodes // KEYWORDS: {file control opcodes} {file control opcode} @@ -4993,7 +5077,7 @@ type sqlite3_mutex1 = struct { FpReal uintptr FeType int32 _ [4]byte -} /* sqlite3.h:1186:9 */ +} /* sqlite3.h:1187:9 */ // CAPI3REF: Loadable Extension Thunk // @@ -5254,7 +5338,8 @@ type sqlite3_api_routines1 = struct { Fcreate_filename uintptr Ffree_filename uintptr Fdatabase_file_object uintptr -} /* sqlite3.h:1196:9 */ + Ftxn_state uintptr +} /* sqlite3.h:1197:9 */ // CAPI3REF: OS Interface Object // @@ -5447,7 +5532,7 @@ type sqlite3_vfs1 = struct { FxSetSystemCall uintptr FxGetSystemCall uintptr FxNextSystemCall uintptr -} /* sqlite3.h:1367:9 */ +} /* sqlite3.h:1368:9 */ // CAPI3REF: OS Interface Object // @@ -5616,8 +5701,8 @@ type sqlite3_vfs1 = struct { // or all of these interfaces to be NULL or for their behavior to change // from one release to the next. Applications must not attempt to access // any of these methods if the iVersion of the VFS is less than 3. -type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1367:28 */ -type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1368:14 */ +type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1368:28 */ +type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1369:14 */ // CAPI3REF: Memory Allocation Routines // @@ -5689,7 +5774,7 @@ type sqlite3_mem_methods1 = struct { FxInit uintptr FxShutdown uintptr FpAppData uintptr -} /* sqlite3.h:1665:9 */ +} /* sqlite3.h:1666:9 */ // CAPI3REF: Memory Allocation Routines // @@ -5752,7 +5837,7 @@ type sqlite3_mem_methods1 = struct { // // SQLite will never invoke xInit() more than once without an intervening // call to xShutdown(). -type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1665:36 */ +type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1666:36 */ // CAPI3REF: Dynamically Typed Value Object // KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} @@ -5841,7 +5926,7 @@ type sqlite3_context1 = struct { // // The typedef is necessary to work around problems in certain // C++ compilers. -type sqlite3_destructor_type = uintptr /* sqlite3.h:5621:14 */ +type sqlite3_destructor_type = uintptr /* sqlite3.h:5635:14 */ // The interface to the virtual-table mechanism is currently considered // to be experimental. The interface might change in incompatible ways. @@ -5856,7 +5941,7 @@ type sqlite3_vtab1 = struct { FnRef int32 _ [4]byte FzErrMsg uintptr -} /* sqlite3.h:6689:9 */ +} /* sqlite3.h:6754:9 */ // The interface to the virtual-table mechanism is currently considered // to be experimental. The interface might change in incompatible ways. @@ -5866,7 +5951,7 @@ type sqlite3_vtab1 = struct { // interface fixed, support it indefinitely, and remove this comment. // Structures used by the virtual table interface -type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6689:29 */ +type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6754:29 */ type sqlite3_index_info1 = struct { FnConstraint int32 _ [4]byte @@ -5885,12 +5970,12 @@ type sqlite3_index_info1 = struct { FidxFlags int32 _ [4]byte FcolUsed sqlite3_uint64 -} /* sqlite3.h:6690:9 */ +} /* sqlite3.h:6755:9 */ -type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6690:35 */ -type sqlite3_vtab_cursor1 = struct{ FpVtab uintptr } /* sqlite3.h:6691:9 */ +type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6755:35 */ +type sqlite3_vtab_cursor1 = struct{ FpVtab uintptr } /* sqlite3.h:6756:9 */ -type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6691:36 */ +type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6756:36 */ type sqlite3_module1 = struct { FiVersion int32 _ [4]byte @@ -5917,9 +6002,9 @@ type sqlite3_module1 = struct { FxRelease uintptr FxRollbackTo uintptr FxShadowName uintptr -} /* sqlite3.h:6689:9 */ +} /* sqlite3.h:6754:9 */ -type sqlite3_module = sqlite3_module1 /* sqlite3.h:6692:31 */ +type sqlite3_module = sqlite3_module1 /* sqlite3.h:6757:31 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -6027,7 +6112,7 @@ type sqlite3_index_constraint = struct { Fusable uint8 _ [2]byte FiTermOffset int32 -} /* sqlite3.h:6690:9 */ +} /* sqlite3.h:6755:9 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -6133,7 +6218,7 @@ type sqlite3_index_orderby = struct { FiColumn int32 Fdesc uint8 _ [3]byte -} /* sqlite3.h:6690:9 */ +} /* sqlite3.h:6755:9 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -6239,7 +6324,7 @@ type sqlite3_index_constraint_usage = struct { FargvIndex int32 Fomit uint8 _ [3]byte -} /* sqlite3.h:6690:9 */ +} /* sqlite3.h:6755:9 */ // CAPI3REF: Mutex Methods Object // @@ -6314,7 +6399,7 @@ type sqlite3_mutex_methods1 = struct { FxMutexLeave uintptr FxMutexHeld uintptr FxMutexNotheld uintptr -} /* sqlite3.h:7524:9 */ +} /* sqlite3.h:7589:9 */ // CAPI3REF: Mutex Methods Object // @@ -6379,7 +6464,7 @@ type sqlite3_mutex_methods1 = struct { // called, but only if the prior call to xMutexInit returned SQLITE_OK. // If xMutexInit fails in any way, it is expected to clean up after itself // prior to returning. -type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7524:38 */ +type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7589:38 */ // CAPI3REF: Dynamic String Object // KEYWORDS: {dynamic string} @@ -6404,7 +6489,7 @@ type sqlite3_str1 = struct { FaccError u8 FprintfFlags u8 _ [2]byte -} /* sqlite3.h:7784:9 */ +} /* sqlite3.h:7851:9 */ // CAPI3REF: Custom Page Cache Object // @@ -6417,7 +6502,7 @@ type sqlite3_str1 = struct { type sqlite3_pcache_page1 = struct { FpBuf uintptr FpExtra uintptr -} /* sqlite3.h:8277:9 */ +} /* sqlite3.h:8344:9 */ // CAPI3REF: Custom Page Cache Object // @@ -6427,7 +6512,7 @@ type sqlite3_pcache_page1 = struct { // of this object as parameters or as their return value. // // See [sqlite3_pcache_methods2] for additional information. -type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8277:36 */ +type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8344:36 */ // CAPI3REF: Application Defined Page Cache. // KEYWORDS: {page cache} @@ -6601,7 +6686,7 @@ type sqlite3_pcache_methods21 = struct { FxTruncate uintptr FxDestroy uintptr FxShrink uintptr -} /* sqlite3.h:8442:9 */ +} /* sqlite3.h:8509:9 */ // CAPI3REF: Application Defined Page Cache. // KEYWORDS: {page cache} @@ -6760,7 +6845,7 @@ type sqlite3_pcache_methods21 = struct { // free up as much of heap memory as possible. The page cache implementation // is not obligated to free any memory, but well-behaved implementations should // do their best. -type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8442:40 */ +type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8509:40 */ // This is the obsolete pcache_methods object that has now been replaced // by sqlite3_pcache_methods2. This object is not used by SQLite. It is @@ -6777,12 +6862,12 @@ type sqlite3_pcache_methods1 = struct { FxRekey uintptr FxTruncate uintptr FxDestroy uintptr -} /* sqlite3.h:8465:9 */ +} /* sqlite3.h:8532:9 */ // This is the obsolete pcache_methods object that has now been replaced // by sqlite3_pcache_methods2. This object is not used by SQLite. It is // retained in the header file for backwards compatibility only. -type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8465:39 */ +type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8532:39 */ // CAPI3REF: Database Snapshot // KEYWORDS: {snapshot} {sqlite3_snapshot} @@ -6802,7 +6887,7 @@ type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8465:39 */ // version of the database file so that it is possible to later open a new read // transaction that sees that historical version of the database rather than // the most recent version. -type sqlite3_snapshot1 = struct{ Fhidden [48]uint8 } /* sqlite3.h:9512:9 */ +type sqlite3_snapshot1 = struct{ Fhidden [48]uint8 } /* sqlite3.h:9589:9 */ // CAPI3REF: Database Snapshot // KEYWORDS: {snapshot} {sqlite3_snapshot} @@ -6822,7 +6907,7 @@ type sqlite3_snapshot1 = struct{ Fhidden [48]uint8 } /* sqlite3.h:9512:9 */ // version of the database file so that it is possible to later open a new read // transaction that sees that historical version of the database rather than // the most recent version. -type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9514:3 */ +type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9591:3 */ // CAPI3REF: Flags for sqlite3_deserialize() // @@ -6866,7 +6951,7 @@ type sqlite3_rtree_geometry1 = struct { FaParam uintptr FpUser uintptr FxDelUser uintptr -} /* sqlite3.h:9839:9 */ +} /* sqlite3.h:9916:9 */ // CAPI3REF: Flags for sqlite3_deserialize() // @@ -6903,7 +6988,7 @@ type sqlite3_rtree_geometry1 = struct { // // -type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9839:39 */ +type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9916:39 */ type sqlite3_rtree_query_info1 = struct { FpContext uintptr FnParam int32 @@ -6923,13 +7008,13 @@ type sqlite3_rtree_query_info1 = struct { FeWithin int32 FrScore sqlite3_rtree_dbl FapSqlParam uintptr -} /* sqlite3.h:9840:9 */ +} /* sqlite3.h:9917:9 */ -type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9840:41 */ +type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9917:41 */ // The double-precision datatype used by RTree depends on the // SQLITE_RTREE_INT_ONLY compile-time option. -type sqlite3_rtree_dbl = float64 /* sqlite3.h:9848:18 */ +type sqlite3_rtree_dbl = float64 /* sqlite3.h:9925:18 */ // Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. @@ -6984,7 +7069,7 @@ type Fts5ExtensionApi1 = struct { FxPhraseNext uintptr FxPhraseFirstColumn uintptr FxPhraseNextColumn uintptr -} /* sqlite3.h:11634:9 */ +} /* sqlite3.h:11724:9 */ // Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. @@ -7017,22 +7102,22 @@ type Fts5ExtensionApi1 = struct { // Virtual table implementations may overload SQL functions by implementing // the sqlite3_module.xFindFunction() method. -type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11634:33 */ +type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11724:33 */ type Fts5PhraseIter1 = struct { Fa uintptr Fb uintptr -} /* sqlite3.h:11636:9 */ +} /* sqlite3.h:11726:9 */ -type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11636:31 */ +type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11726:31 */ -type fts5_extension_function = uintptr /* sqlite3.h:11638:14 */ +type fts5_extension_function = uintptr /* sqlite3.h:11728:14 */ type fts5_tokenizer1 = struct { FxCreate uintptr FxDelete uintptr FxTokenize uintptr -} /* sqlite3.h:12097:9 */ +} /* sqlite3.h:12187:9 */ -type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12097:31 */ +type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12187:31 */ // Flags that may be passed as the third argument to xTokenize() @@ -7052,7 +7137,7 @@ type fts5_api1 = struct { FxCreateTokenizer uintptr FxFindTokenizer uintptr FxCreateFunction uintptr -} /* sqlite3.h:12133:9 */ +} /* sqlite3.h:12223:9 */ // Flags that may be passed as the third argument to xTokenize() @@ -7066,7 +7151,7 @@ type fts5_api1 = struct { // ************************************************************************ // // FTS5 EXTENSION REGISTRATION API -type fts5_api = fts5_api1 /* sqlite3.h:12133:25 */ +type fts5_api = fts5_api1 /* sqlite3.h:12223:25 */ // // END OF REGISTRATION API @@ -7154,49 +7239,7 @@ type __locale_struct = struct { type locale_t = uintptr /* locale_t.h:24:20 */ -// The tag name of this struct is _G_fpos_t to preserve historic -// C++ mangled names for functions taking fpos_t arguments. -// That name should not be used in new code. -type _G_fpos_t = struct { - F__pos int64 - F__state struct { - F__count int32 - F__value struct{ F__wch uint32 } - } -} /* __fpos_t.h:10:9 */ - -// bits/types.h -- definitions of __*_t types underlying *_t types. -// Copyright (C) 2002-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// Never include this file directly; use instead. - -// The tag name of this struct is _G_fpos64_t to preserve historic -// C++ mangled names for functions taking fpos_t and/or fpos64_t -// arguments. That name should not be used in new code. -type _G_fpos64_t = struct { - F__pos int64 - F__state struct { - F__count int32 - F__value struct{ F__wch uint32 } - } -} /* __fpos64_t.h:10:9 */ - -type _IO_FILE = struct { +type _IO_FILE1 = struct { F_flags int32 _ [4]byte F_IO_read_ptr uintptr @@ -7221,28 +7264,50 @@ type _IO_FILE = struct { _ [4]byte F_lock uintptr F_offset int64 - F_codecvt uintptr - F_wide_data uintptr - F_freeres_list uintptr - F_freeres_buf uintptr + F__pad1 uintptr + F__pad2 uintptr + F__pad3 uintptr + F__pad4 uintptr F__pad5 size_t F_mode int32 F_unused2 [20]int8 } /* __FILE.h:4:1 */ // The opaque type of streams. This is the definition used elsewhere. -type FILE = _IO_FILE /* FILE.h:7:25 */ +type FILE = _IO_FILE1 /* FILE.h:7:25 */ -// These macros are used by bits/stdio.h and internal headers. +type _G_fpos_t = struct { + F__pos int64 + F__state struct { + F__count int32 + F__value struct{ F__wch uint32 } + } +} /* _G_config.h:30:3 */ +type _G_fpos64_t = struct { + F__pos int64 + F__state struct { + F__count int32 + F__value struct{ F__wch uint32 } + } +} /* _G_config.h:35:3 */ -// Many more flag bits are defined internally. +// A streammarker remembers a position in a buffer. -type off_t = int64 /* stdio.h:65:19 */ +type _IO_marker = struct { + F_next uintptr + F_sbuf uintptr + F_pos int32 + _ [4]byte +} /* __FILE.h:4:1 */ -type ssize_t = int64 /* stdio.h:77:19 */ +type _IO_FILE = _IO_FILE1 /* libio.h:314:25 */ + +type off_t = int64 /* stdio.h:59:19 */ + +type ssize_t = int64 /* stdio.h:71:19 */ // The type of the second argument to `fgetpos' and `fsetpos'. -type fpos_t = _G_fpos64_t /* stdio.h:86:20 */ +type fpos_t = _G_fpos64_t /* stdio.h:80:21 */ // If we are compiling with optimizing read this file. It contains // several optimizing inline functions and macros. @@ -7381,7 +7446,7 @@ func idxHashString(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3expert.c for i = 0; i < n; i++ { ret = ret + ((ret << 3) + uint32((uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))))) } - return (int32(ret % IDX_HASH_SIZE)) + return (int32(ret % uint32(IDX_HASH_SIZE))) } // If zKey is already present in the hash table, return non-zero and do @@ -7809,15 +7874,17 @@ func idxGetTableInfo(tls *libc.TLS, db uintptr, zTab uintptr, ppOut uintptr, pzE var rc2 int32 var pCsr uintptr = uintptr(0) + var nPk int32 = 0 - *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = idxPrintfPrepareStmt(tls, db, bp+8 /* &p1 */, pzErrmsg, ts+63 /* "PRAGMA table_inf..." */, libc.VaList(bp, zTab)) + *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = idxPrintfPrepareStmt(tls, db, bp+8 /* &p1 */, pzErrmsg, ts+63 /* "PRAGMA table_xin..." */, libc.VaList(bp, zTab)) for (*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK) && (SQLITE_ROW == sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */)))) { *(*uintptr)(unsafe.Pointer(bp + 16 /* zCol */)) = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */)), 1) nByte = nByte + (1 + int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zCol */))))) *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = sqlite3.Xsqlite3_table_column_metadata(tls, - db, ts+84 /* "main" */, zTab, *(*uintptr)(unsafe.Pointer(bp + 16 /* zCol */)), uintptr(0), bp+16 /* &zCol */, uintptr(0), uintptr(0), uintptr(0)) + db, ts+85 /* "main" */, zTab, *(*uintptr)(unsafe.Pointer(bp + 16 /* zCol */)), uintptr(0), bp+16 /* &zCol */, uintptr(0), uintptr(0), uintptr(0)) nByte = nByte + (1 + int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zCol */))))) nCol++ + nPk = nPk + (libc.Bool32(sqlite3.Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */)), 5) > 0)) } rc2 = sqlite3.Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */))) if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK { @@ -7839,12 +7906,12 @@ func idxGetTableInfo(tls *libc.TLS, db uintptr, zTab uintptr, ppOut uintptr, pzE *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)) = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */)), 1) var nCopy int32 = (int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)))) + 1) (*IdxColumn)(unsafe.Pointer((*IdxTable)(unsafe.Pointer(pNew)).FaCol + uintptr(nCol)*24)).FzName = pCsr - (*IdxColumn)(unsafe.Pointer((*IdxTable)(unsafe.Pointer(pNew)).FaCol + uintptr(nCol)*24)).FiPk = sqlite3.Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */)), 5) + (*IdxColumn)(unsafe.Pointer((*IdxTable)(unsafe.Pointer(pNew)).FaCol + uintptr(nCol)*24)).FiPk = (libc.Bool32((sqlite3.Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */)), 5) == 1) && (nPk == 1))) libc.Xmemcpy(tls, pCsr, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)), uint64(nCopy)) pCsr += uintptr(nCopy) *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = sqlite3.Xsqlite3_table_column_metadata(tls, - db, ts+84 /* "main" */, zTab, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)), uintptr(0), bp+32 /* &zCol */, uintptr(0), uintptr(0), uintptr(0)) + db, ts+85 /* "main" */, zTab, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)), uintptr(0), bp+32 /* &zCol */, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK { nCopy = (int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)))) + 1) (*IdxColumn)(unsafe.Pointer((*IdxTable)(unsafe.Pointer(pNew)).FaCol + uintptr(nCol)*24)).FzColl = pCsr @@ -7875,7 +7942,7 @@ func idxGetTableInfo(tls *libc.TLS, db uintptr, zTab uintptr, ppOut uintptr, pzE // the printf() style arguments is appended to zIn and the result returned // in a buffer allocated by sqlite3_malloc(). sqlite3_free() is called on // zIn before returning. -func idxAppendText(tls *libc.TLS, pRc uintptr, zIn uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3expert.c:756:13: */ +func idxAppendText(tls *libc.TLS, pRc uintptr, zIn uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3expert.c:758:13: */ var ap va_list _ = ap var zAppend uintptr = uintptr(0) @@ -7913,7 +7980,7 @@ func idxAppendText(tls *libc.TLS, pRc uintptr, zIn uintptr, zFmt uintptr, va uin // Return true if zId must be quoted in order to use it as an SQL // identifier, or false otherwise. -func idxIdentifierRequiresQuotes(tls *libc.TLS, zId uintptr) int32 { /* sqlite3expert.c:788:12: */ +func idxIdentifierRequiresQuotes(tls *libc.TLS, zId uintptr) int32 { /* sqlite3expert.c:790:12: */ var i int32 for i = 0; *(*int8)(unsafe.Pointer(zId + uintptr(i))) != 0; i++ { if ((!(int32(*(*int8)(unsafe.Pointer(zId + uintptr(i)))) == '_') && @@ -7928,32 +7995,32 @@ func idxIdentifierRequiresQuotes(tls *libc.TLS, zId uintptr) int32 { /* sqlite3e // This function appends an index column definition suitable for constraint // pCons to the string passed as zIn and returns the result. -func idxAppendColDefn(tls *libc.TLS, pRc uintptr, zIn uintptr, pTab uintptr, pCons uintptr) uintptr { /* sqlite3expert.c:806:13: */ +func idxAppendColDefn(tls *libc.TLS, pRc uintptr, zIn uintptr, pTab uintptr, pCons uintptr) uintptr { /* sqlite3expert.c:808:13: */ bp := tls.Alloc(32) defer tls.Free(32) var zRet uintptr = zIn var p uintptr = ((*IdxTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*IdxConstraint)(unsafe.Pointer(pCons)).FiCol)*24) if zRet != 0 { - zRet = idxAppendText(tls, pRc, zRet, ts+89 /* ", " */, 0) + zRet = idxAppendText(tls, pRc, zRet, ts+90 /* ", " */, 0) } if idxIdentifierRequiresQuotes(tls, (*IdxColumn)(unsafe.Pointer(p)).FzName) != 0 { - zRet = idxAppendText(tls, pRc, zRet, ts+92 /* "%Q" */, libc.VaList(bp, (*IdxColumn)(unsafe.Pointer(p)).FzName)) + zRet = idxAppendText(tls, pRc, zRet, ts+93 /* "%Q" */, libc.VaList(bp, (*IdxColumn)(unsafe.Pointer(p)).FzName)) } else { zRet = idxAppendText(tls, pRc, zRet, ts /* "%s" */, libc.VaList(bp+8, (*IdxColumn)(unsafe.Pointer(p)).FzName)) } if sqlite3.Xsqlite3_stricmp(tls, (*IdxColumn)(unsafe.Pointer(p)).FzColl, (*IdxConstraint)(unsafe.Pointer(pCons)).FzColl) != 0 { if idxIdentifierRequiresQuotes(tls, (*IdxConstraint)(unsafe.Pointer(pCons)).FzColl) != 0 { - zRet = idxAppendText(tls, pRc, zRet, ts+95 /* " COLLATE %Q" */, libc.VaList(bp+16, (*IdxConstraint)(unsafe.Pointer(pCons)).FzColl)) + zRet = idxAppendText(tls, pRc, zRet, ts+96 /* " COLLATE %Q" */, libc.VaList(bp+16, (*IdxConstraint)(unsafe.Pointer(pCons)).FzColl)) } else { - zRet = idxAppendText(tls, pRc, zRet, ts+107 /* " COLLATE %s" */, libc.VaList(bp+24, (*IdxConstraint)(unsafe.Pointer(pCons)).FzColl)) + zRet = idxAppendText(tls, pRc, zRet, ts+108 /* " COLLATE %s" */, libc.VaList(bp+24, (*IdxConstraint)(unsafe.Pointer(pCons)).FzColl)) } } if (*IdxConstraint)(unsafe.Pointer(pCons)).FbDesc != 0 { - zRet = idxAppendText(tls, pRc, zRet, ts+119 /* " DESC" */, 0) + zRet = idxAppendText(tls, pRc, zRet, ts+120 /* " DESC" */, 0) } return zRet } @@ -7964,7 +8031,7 @@ func idxAppendColDefn(tls *libc.TLS, pRc uintptr, zIn uintptr, pTab uintptr, pCo // return zero. // // If an error occurs, set *pRc to an SQLite error code and return zero. -func idxFindCompatible(tls *libc.TLS, pRc uintptr, dbm uintptr, pScan uintptr, pEq uintptr, pTail uintptr) int32 { /* sqlite3expert.c:844:12: */ +func idxFindCompatible(tls *libc.TLS, pRc uintptr, dbm uintptr, pScan uintptr, pEq uintptr, pTail uintptr) int32 { /* sqlite3expert.c:846:12: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -7979,7 +8046,7 @@ func idxFindCompatible(tls *libc.TLS, pRc uintptr, dbm uintptr, pScan uintptr, p nEq++ } - *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = idxPrintfPrepareStmt(tls, dbm, bp+16 /* &pIdxList */, uintptr(0), ts+125 /* "PRAGMA index_lis..." */, libc.VaList(bp, zTbl)) + *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = idxPrintfPrepareStmt(tls, dbm, bp+16 /* &pIdxList */, uintptr(0), ts+126 /* "PRAGMA index_lis..." */, libc.VaList(bp, zTbl)) for (*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == SQLITE_OK) && (sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pIdxList */))) == SQLITE_ROW) { var bMatch int32 = 1 var pT uintptr = pTail @@ -7991,7 +8058,7 @@ func idxFindCompatible(tls *libc.TLS, pRc uintptr, dbm uintptr, pScan uintptr, p (*IdxConstraint)(unsafe.Pointer(pIter)).FbFlag = 0 } - *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = idxPrintfPrepareStmt(tls, dbm, bp+24 /* &pInfo */, uintptr(0), ts+146 /* "PRAGMA index_xIn..." */, libc.VaList(bp+8, zIdx)) + *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = idxPrintfPrepareStmt(tls, dbm, bp+24 /* &pInfo */, uintptr(0), ts+147 /* "PRAGMA index_xIn..." */, libc.VaList(bp+8, zIdx)) for (*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == SQLITE_OK) && (sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pInfo */))) == SQLITE_ROW) { var iIdx int32 = sqlite3.Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pInfo */)), 0) var iCol int32 = sqlite3.Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pInfo */)), 1) @@ -8038,7 +8105,7 @@ func idxFindCompatible(tls *libc.TLS, pRc uintptr, dbm uintptr, pScan uintptr, p return 0 } -func idxCreateFromCons(tls *libc.TLS, p uintptr, pScan uintptr, pEq uintptr, pTail uintptr) int32 { /* sqlite3expert.c:911:12: */ +func idxCreateFromCons(tls *libc.TLS, p uintptr, pScan uintptr, pEq uintptr, pTail uintptr) int32 { /* sqlite3expert.c:913:12: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -8067,14 +8134,14 @@ func idxCreateFromCons(tls *libc.TLS, p uintptr, pScan uintptr, pEq uintptr, pTa for i = 0; *(*int8)(unsafe.Pointer(zCols + uintptr(i))) != 0; i++ { h = h + ((h << 3) + uint32(*(*int8)(unsafe.Pointer(zCols + uintptr(i))))) } - zName = sqlite3.Xsqlite3_mprintf(tls, ts+168 /* "%s_idx_%08x" */, libc.VaList(bp, zTable, h)) + zName = sqlite3.Xsqlite3_mprintf(tls, ts+169 /* "%s_idx_%08x" */, libc.VaList(bp, zTable, h)) if zName == uintptr(0) { *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_NOMEM } else { if idxIdentifierRequiresQuotes(tls, zTable) != 0 { - zFmt = ts + 180 /* "CREATE INDEX '%q..." */ + zFmt = ts + 181 /* "CREATE INDEX '%q..." */ } else { - zFmt = ts + 208 /* "CREATE INDEX %s ..." */ + zFmt = ts + 209 /* "CREATE INDEX %s ..." */ } zIdx = sqlite3.Xsqlite3_mprintf(tls, zFmt, libc.VaList(bp+16, zName, zTable, zCols)) if !(zIdx != 0) { @@ -8095,7 +8162,7 @@ func idxCreateFromCons(tls *libc.TLS, p uintptr, pScan uintptr, pEq uintptr, pTa // Return true if list pList (linked by IdxConstraint.pLink) contains // a constraint compatible with *p. Otherwise return false. -func idxFindConstraint(tls *libc.TLS, pList uintptr, p uintptr) int32 { /* sqlite3expert.c:972:12: */ +func idxFindConstraint(tls *libc.TLS, pList uintptr, p uintptr) int32 { /* sqlite3expert.c:974:12: */ var pCmp uintptr for pCmp = pList; pCmp != 0; pCmp = (*IdxConstraint)(unsafe.Pointer(pCmp)).FpLink { if (*IdxConstraint)(unsafe.Pointer(p)).FiCol == (*IdxConstraint)(unsafe.Pointer(pCmp)).FiCol { @@ -8105,7 +8172,7 @@ func idxFindConstraint(tls *libc.TLS, pList uintptr, p uintptr) int32 { /* sqlit return 0 } -func idxCreateFromWhere(tls *libc.TLS, p uintptr, pScan uintptr, pTail uintptr) int32 { /* sqlite3expert.c:980:12: */ +func idxCreateFromWhere(tls *libc.TLS, p uintptr, pScan uintptr, pTail uintptr) int32 { /* sqlite3expert.c:982:12: */ var p1 uintptr = uintptr(0) var pCon uintptr var rc int32 @@ -8138,7 +8205,7 @@ func idxCreateFromWhere(tls *libc.TLS, p uintptr, pScan uintptr, pTail uintptr) // Create candidate indexes in database [dbm] based on the data in // linked-list pScan. -func idxCreateCandidates(tls *libc.TLS, p uintptr) int32 { /* sqlite3expert.c:1019:12: */ +func idxCreateCandidates(tls *libc.TLS, p uintptr) int32 { /* sqlite3expert.c:1021:12: */ var rc int32 = SQLITE_OK var pIter uintptr @@ -8153,7 +8220,7 @@ func idxCreateCandidates(tls *libc.TLS, p uintptr) int32 { /* sqlite3expert.c:10 } // Free all elements of the linked list starting at pConstraint. -func idxConstraintFree(tls *libc.TLS, pConstraint uintptr) { /* sqlite3expert.c:1036:13: */ +func idxConstraintFree(tls *libc.TLS, pConstraint uintptr) { /* sqlite3expert.c:1038:13: */ var pNext uintptr var p uintptr @@ -8165,7 +8232,7 @@ func idxConstraintFree(tls *libc.TLS, pConstraint uintptr) { /* sqlite3expert.c: // Free all elements of the linked list starting from pScan up until pLast // (pLast is not freed). -func idxScanFree(tls *libc.TLS, pScan uintptr, pLast uintptr) { /* sqlite3expert.c:1050:13: */ +func idxScanFree(tls *libc.TLS, pScan uintptr, pLast uintptr) { /* sqlite3expert.c:1052:13: */ var p uintptr var pNext uintptr for p = pScan; p != pLast; p = pNext { @@ -8179,7 +8246,7 @@ func idxScanFree(tls *libc.TLS, pScan uintptr, pLast uintptr) { /* sqlite3expert // Free all elements of the linked list starting from pStatement up // until pLast (pLast is not freed). -func idxStatementFree(tls *libc.TLS, pStatement uintptr, pLast uintptr) { /* sqlite3expert.c:1066:13: */ +func idxStatementFree(tls *libc.TLS, pStatement uintptr, pLast uintptr) { /* sqlite3expert.c:1068:13: */ var p uintptr var pNext uintptr for p = pStatement; p != pLast; p = pNext { @@ -8191,7 +8258,7 @@ func idxStatementFree(tls *libc.TLS, pStatement uintptr, pLast uintptr) { /* sql } // Free the linked list of IdxTable objects starting at pTab. -func idxTableFree(tls *libc.TLS, pTab uintptr) { /* sqlite3expert.c:1080:13: */ +func idxTableFree(tls *libc.TLS, pTab uintptr) { /* sqlite3expert.c:1082:13: */ var pIter uintptr var pNext uintptr for pIter = pTab; pIter != 0; pIter = pNext { @@ -8201,7 +8268,7 @@ func idxTableFree(tls *libc.TLS, pTab uintptr) { /* sqlite3expert.c:1080:13: */ } // Free the linked list of IdxWrite objects starting at pTab. -func idxWriteFree(tls *libc.TLS, pTab uintptr) { /* sqlite3expert.c:1092:13: */ +func idxWriteFree(tls *libc.TLS, pTab uintptr) { /* sqlite3expert.c:1094:13: */ var pIter uintptr var pNext uintptr for pIter = pTab; pIter != 0; pIter = pNext { @@ -8213,7 +8280,7 @@ func idxWriteFree(tls *libc.TLS, pTab uintptr) { /* sqlite3expert.c:1092:13: */ // This function is called after candidate indexes have been created. It // runs all the queries to see which indexes they prefer, and populates // IdxStatement.zIdx and IdxStatement.zEQP with the results. -func idxFindIndexes(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1108:5: */ +func idxFindIndexes(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1110:5: */ bp := tls.Alloc(8228) defer tls.Free(8228) @@ -8246,7 +8313,7 @@ __1: *(*uintptr)(unsafe.Pointer(bp + 8216 /* pExplain */)) = uintptr(0) idxHashClear(tls, bp+24 /* &hIdx */) *(*int32)(unsafe.Pointer(bp + 8224 /* rc */)) = idxPrintfPrepareStmt(tls, dbm, bp+8216 /* &pExplain */, pzErr, - ts+234 /* "EXPLAIN QUERY PL..." */, libc.VaList(bp, (*IdxStatement)(unsafe.Pointer(pStmt)).FzSql)) + ts+235 /* "EXPLAIN QUERY PL..." */, libc.VaList(bp, (*IdxStatement)(unsafe.Pointer(pStmt)).FzSql)) __4: if !((*(*int32)(unsafe.Pointer(bp + 8224 /* rc */)) == SQLITE_OK) && (sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8216 /* pExplain */))) == SQLITE_ROW)) { goto __5 @@ -8270,14 +8337,14 @@ __7: goto __9 } zIdx = uintptr(0) - if !(((i + 13) < nDetail) && (libc.Xmemcmp(tls, (zDetail+uintptr(i)), ts+256 /* " USING INDEX " */, uint64(13)) == 0)) { + if !(((i + 13) < nDetail) && (libc.Xmemcmp(tls, (zDetail+uintptr(i)), ts+257 /* " USING INDEX " */, uint64(13)) == 0)) { goto __10 } zIdx = (zDetail + uintptr((i + 13))) goto __11 __10: if !(((i + 22) < nDetail) && - (libc.Xmemcmp(tls, (zDetail+uintptr(i)), ts+270 /* " USING COVERING ..." */, uint64(22)) == 0)) { + (libc.Xmemcmp(tls, (zDetail+uintptr(i)), ts+271 /* " USING COVERING ..." */, uint64(22)) == 0)) { goto __12 } zIdx = (zDetail + uintptr((i + 22))) @@ -8324,7 +8391,7 @@ __9: if !(int32(*(*int8)(unsafe.Pointer(zDetail))) != '-') { goto __18 } - (*IdxStatement)(unsafe.Pointer(pStmt)).FzEQP = idxAppendText(tls, bp+8224 /* &rc */, (*IdxStatement)(unsafe.Pointer(pStmt)).FzEQP, ts+293 /* "%s\n" */, libc.VaList(bp+8, zDetail)) + (*IdxStatement)(unsafe.Pointer(pStmt)).FzEQP = idxAppendText(tls, bp+8224 /* &rc */, (*IdxStatement)(unsafe.Pointer(pStmt)).FzEQP, ts+294 /* "%s\n" */, libc.VaList(bp+8, zDetail)) __18: ; goto __4 @@ -8336,7 +8403,7 @@ __19: if !(pEntry != 0) { goto __21 } - (*IdxStatement)(unsafe.Pointer(pStmt)).FzIdx = idxAppendText(tls, bp+8224 /* &rc */, (*IdxStatement)(unsafe.Pointer(pStmt)).FzIdx, ts+297 /* "%s;\n" */, libc.VaList(bp+16, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey)) + (*IdxStatement)(unsafe.Pointer(pStmt)).FzIdx = idxAppendText(tls, bp+8224 /* &rc */, (*IdxStatement)(unsafe.Pointer(pStmt)).FzIdx, ts+298 /* "%s;\n" */, libc.VaList(bp+16, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey)) goto __20 __20: pEntry = (*IdxHashEntry)(unsafe.Pointer(pEntry)).FpNext @@ -8359,7 +8426,7 @@ find_indexes_out: return *(*int32)(unsafe.Pointer(bp + 8224 /* rc */)) } -func idxAuthCallback(tls *libc.TLS, pCtx uintptr, eOp int32, z3 uintptr, z4 uintptr, zDb uintptr, zTrigger uintptr) int32 { /* sqlite3expert.c:1178:12: */ +func idxAuthCallback(tls *libc.TLS, pCtx uintptr, eOp int32, z3 uintptr, z4 uintptr, zDb uintptr, zTrigger uintptr) int32 { /* sqlite3expert.c:1180:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -8367,7 +8434,7 @@ func idxAuthCallback(tls *libc.TLS, pCtx uintptr, eOp int32, z3 uintptr, z4 uint _ = z4 _ = zTrigger if ((eOp == SQLITE_INSERT) || (eOp == SQLITE_UPDATE)) || (eOp == SQLITE_DELETE) { - if sqlite3.Xsqlite3_stricmp(tls, zDb, ts+84 /* "main" */) == 0 { + if sqlite3.Xsqlite3_stricmp(tls, zDb, ts+85 /* "main" */) == 0 { var p uintptr = pCtx var pTab uintptr for pTab = (*sqlite3expert)(unsafe.Pointer(p)).FpTable; pTab != 0; pTab = (*IdxTable)(unsafe.Pointer(pTab)).FpNext { @@ -8397,13 +8464,13 @@ func idxAuthCallback(tls *libc.TLS, pCtx uintptr, eOp int32, z3 uintptr, z4 uint return *(*int32)(unsafe.Pointer(bp /* rc */)) } -func idxProcessOneTrigger(tls *libc.TLS, p uintptr, pWrite uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1216:12: */ +func idxProcessOneTrigger(tls *libc.TLS, p uintptr, pWrite uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1218:12: */ bp := tls.Alloc(104) defer tls.Free(104) var pTab uintptr = (*IdxWrite)(unsafe.Pointer(pWrite)).FpTab var zTab uintptr = (*IdxTable)(unsafe.Pointer(pTab)).FzName - var zSql uintptr = ts + 302 /* "SELECT 'CREATE T..." */ + var zSql uintptr = ts + 303 /* "SELECT 'CREATE T..." */ *(*uintptr)(unsafe.Pointer(bp + 80 /* pSelect */)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = SQLITE_OK var zWrite uintptr = uintptr(0) @@ -8418,7 +8485,7 @@ func idxProcessOneTrigger(tls *libc.TLS, p uintptr, pWrite uintptr, pzErr uintpt // Rename the table in the temp schema to zInt if *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) == SQLITE_OK { - var z uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+428 /* "ALTER TABLE temp..." */, libc.VaList(bp+16, zTab, zInt)) + var z uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+429 /* "ALTER TABLE temp..." */, libc.VaList(bp+16, zTab, zInt)) if z == uintptr(0) { *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = SQLITE_NOMEM } else { @@ -8431,29 +8498,29 @@ func idxProcessOneTrigger(tls *libc.TLS, p uintptr, pWrite uintptr, pzErr uintpt case SQLITE_INSERT: { var i int32 - zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+461 /* "INSERT INTO %Q V..." */, libc.VaList(bp+32, zInt)) + zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+462 /* "INSERT INTO %Q V..." */, libc.VaList(bp+32, zInt)) for i = 0; i < (*IdxTable)(unsafe.Pointer(pTab)).FnCol; i++ { - zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+484 /* "%s?" */, libc.VaList(bp+40, func() uintptr { + zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+485 /* "%s?" */, libc.VaList(bp+40, func() uintptr { if i == 0 { - return ts + 488 /* "" */ + return ts + 489 /* "" */ } - return ts + 89 /* ", " */ + return ts + 90 /* ", " */ }())) } - zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+489 /* ")" */, 0) + zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+490 /* ")" */, 0) break } case SQLITE_UPDATE: { var i int32 - zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+491 /* "UPDATE %Q SET " */, libc.VaList(bp+48, zInt)) + zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+492 /* "UPDATE %Q SET " */, libc.VaList(bp+48, zInt)) for i = 0; i < (*IdxTable)(unsafe.Pointer(pTab)).FnCol; i++ { - zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+506 /* "%s%Q=?" */, libc.VaList(bp+56, func() uintptr { + zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+507 /* "%s%Q=?" */, libc.VaList(bp+56, func() uintptr { if i == 0 { - return ts + 488 /* "" */ + return ts + 489 /* "" */ } - return ts + 89 /* ", " */ + return ts + 90 /* ", " */ }(), (*IdxColumn)(unsafe.Pointer((*IdxTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*24)).FzName)) } @@ -8464,7 +8531,7 @@ func idxProcessOneTrigger(tls *libc.TLS, p uintptr, pWrite uintptr, pzErr uintpt { if *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) == SQLITE_OK { - zWrite = sqlite3.Xsqlite3_mprintf(tls, ts+513 /* "DELETE FROM %Q" */, libc.VaList(bp+72, zInt)) + zWrite = sqlite3.Xsqlite3_mprintf(tls, ts+514 /* "DELETE FROM %Q" */, libc.VaList(bp+72, zInt)) if zWrite == uintptr(0) { *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = SQLITE_NOMEM } @@ -8490,10 +8557,10 @@ func idxProcessOneTrigger(tls *libc.TLS, p uintptr, pWrite uintptr, pzErr uintpt return *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) } -var zInt uintptr = ts + 528 /* "t592690916721053..." */ /* sqlite3expert.c:1221:21 */ -var zDrop uintptr = ts + 566 /* "DROP TABLE t5926..." */ /* sqlite3expert.c:1222:21 */ +var zInt uintptr = ts + 529 /* "t592690916721053..." */ /* sqlite3expert.c:1223:21 */ +var zDrop uintptr = ts + 567 /* "DROP TABLE t5926..." */ /* sqlite3expert.c:1224:21 */ -func idxProcessTriggers(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1298:12: */ +func idxProcessTriggers(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1300:12: */ var rc int32 = SQLITE_OK var pEnd uintptr = uintptr(0) var pFirst uintptr = (*sqlite3expert)(unsafe.Pointer(p)).FpWrite @@ -8510,7 +8577,7 @@ func idxProcessTriggers(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqli return rc } -func idxCreateVtabSchema(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sqlite3expert.c:1316:12: */ +func idxCreateVtabSchema(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sqlite3expert.c:1318:12: */ bp := tls.Alloc(60) defer tls.Free(60) @@ -8523,7 +8590,7 @@ func idxCreateVtabSchema(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* // 2) Create the equivalent virtual table in dbv. *(*int32)(unsafe.Pointer(bp + 56 /* rc */)) = idxPrepareStmt(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdb, bp+40 /* &pSchema */, pzErrmsg, - ts+615 /* "SELECT type, nam..." */) + ts+616 /* "SELECT type, nam..." */) for (*(*int32)(unsafe.Pointer(bp + 56 /* rc */)) == SQLITE_OK) && (SQLITE_ROW == sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pSchema */)))) { var zType uintptr = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pSchema */)), 0) var zName uintptr = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pSchema */)), 1) @@ -8543,21 +8610,21 @@ func idxCreateVtabSchema(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* (*sqlite3expert)(unsafe.Pointer(p)).FpTable = *(*uintptr)(unsafe.Pointer(bp + 48 /* pTab */)) // The statement the vtab will pass to sqlite3_declare_vtab() - zInner = idxAppendText(tls, bp+56 /* &rc */, uintptr(0), ts+883 /* "CREATE TABLE x(" */, 0) + zInner = idxAppendText(tls, bp+56 /* &rc */, uintptr(0), ts+884 /* "CREATE TABLE x(" */, 0) for i = 0; i < (*IdxTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* pTab */)))).FnCol; i++ { - zInner = idxAppendText(tls, bp+56 /* &rc */, zInner, ts+899, /* "%s%Q COLLATE %s" */ + zInner = idxAppendText(tls, bp+56 /* &rc */, zInner, ts+900, /* "%s%Q COLLATE %s" */ libc.VaList(bp, func() uintptr { if i == 0 { - return ts + 488 /* "" */ + return ts + 489 /* "" */ } - return ts + 89 /* ", " */ + return ts + 90 /* ", " */ }(), (*IdxColumn)(unsafe.Pointer((*IdxTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* pTab */)))).FaCol+uintptr(i)*24)).FzName, (*IdxColumn)(unsafe.Pointer((*IdxTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* pTab */)))).FaCol+uintptr(i)*24)).FzColl)) } - zInner = idxAppendText(tls, bp+56 /* &rc */, zInner, ts+489 /* ")" */, 0) + zInner = idxAppendText(tls, bp+56 /* &rc */, zInner, ts+490 /* ")" */, 0) // The CVT statement to create the vtab zOuter = idxAppendText(tls, bp+56 /* &rc */, uintptr(0), - ts+915 /* "CREATE VIRTUAL T..." */, libc.VaList(bp+24, zName, zInner)) + ts+916 /* "CREATE VIRTUAL T..." */, libc.VaList(bp+24, zName, zInner)) if *(*int32)(unsafe.Pointer(bp + 56 /* rc */)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 56 /* rc */)) = sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbv, zOuter, uintptr(0), uintptr(0), pzErrmsg) } @@ -8576,9 +8643,9 @@ type IdxSampleCtx = struct { Ftarget float64 FnRow float64 FnRet float64 -} /* sqlite3expert.c:1376:1 */ +} /* sqlite3expert.c:1378:1 */ -func idxSampleFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3expert.c:1383:13: */ +func idxSampleFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3expert.c:1385:13: */ bp := tls.Alloc(2) defer tls.Free(2) @@ -8616,7 +8683,7 @@ type IdxRemCtx = struct { Fn int32 Fz uintptr } -} /* sqlite3expert.c:1409:1 */ +} /* sqlite3expert.c:1411:1 */ type IdxRemSlot = struct { FeType int32 @@ -8626,10 +8693,10 @@ type IdxRemSlot = struct { FnByte int32 Fn int32 Fz uintptr -} /* sqlite3expert.c:1409:1 */ +} /* sqlite3expert.c:1411:1 */ // Implementation of scalar function rem(). -func idxRemFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3expert.c:1424:13: */ +func idxRemFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3expert.c:1426:13: */ var p uintptr = sqlite3.Xsqlite3_user_data(tls, pCtx) var pSlot uintptr var iSlot int32 @@ -8700,12 +8767,12 @@ func idxRemFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqli } } -func idxLargestIndex(tls *libc.TLS, db uintptr, pnMax uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1497:12: */ +func idxLargestIndex(tls *libc.TLS, db uintptr, pnMax uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1499:12: */ bp := tls.Alloc(12) defer tls.Free(12) *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_OK - var zMax uintptr = ts + 956 /* "SELECT max(i.seq..." */ + var zMax uintptr = ts + 957 /* "SELECT max(i.seq..." */ *(*uintptr)(unsafe.Pointer(bp /* pMax */)) = uintptr(0) *(*int32)(unsafe.Pointer(pnMax)) = 0 @@ -8718,7 +8785,7 @@ func idxLargestIndex(tls *libc.TLS, db uintptr, pnMax uintptr, pzErr uintptr) in return *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) } -func idxPopulateOneStat1(tls *libc.TLS, p uintptr, pIndexXInfo uintptr, pWriteStat uintptr, zTab uintptr, zIdx uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1517:12: */ +func idxPopulateOneStat1(tls *libc.TLS, p uintptr, pIndexXInfo uintptr, pWriteStat uintptr, zTab uintptr, zIdx uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1519:12: */ bp := tls.Alloc(128) defer tls.Free(128) @@ -8736,24 +8803,24 @@ func idxPopulateOneStat1(tls *libc.TLS, p uintptr, pIndexXInfo uintptr, pWriteSt for (SQLITE_OK == *(*int32)(unsafe.Pointer(bp + 112 /* rc */))) && (SQLITE_ROW == sqlite3.Xsqlite3_step(tls, pIndexXInfo)) { var zComma uintptr if zCols == uintptr(0) { - zComma = ts + 488 /* "" */ + zComma = ts + 489 /* "" */ } else { - zComma = ts + 89 /* ", " */ + zComma = ts + 90 /* ", " */ } var zName uintptr = sqlite3.Xsqlite3_column_text(tls, pIndexXInfo, 0) var zColl uintptr = sqlite3.Xsqlite3_column_text(tls, pIndexXInfo, 1) zCols = idxAppendText(tls, bp+112 /* &rc */, zCols, - ts+1093 /* "%sx.%Q IS rem(%d..." */, libc.VaList(bp, zComma, zName, nCol, zName, zColl)) - zOrder = idxAppendText(tls, bp+112 /* &rc */, zOrder, ts+1128 /* "%s%d" */, libc.VaList(bp+40, zComma, libc.PreIncInt32(&nCol, 1))) + ts+1094 /* "%sx.%Q IS rem(%d..." */, libc.VaList(bp, zComma, zName, nCol, zName, zColl)) + zOrder = idxAppendText(tls, bp+112 /* &rc */, zOrder, ts+1129 /* "%s%d" */, libc.VaList(bp+40, zComma, libc.PreIncInt32(&nCol, 1))) } sqlite3.Xsqlite3_reset(tls, pIndexXInfo) if *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) == SQLITE_OK { if (*sqlite3expert)(unsafe.Pointer(p)).FiSample == 100 { zQuery = sqlite3.Xsqlite3_mprintf(tls, - ts+1133 /* "SELECT %s FROM %..." */, libc.VaList(bp+56, zCols, zTab, zOrder)) + ts+1134 /* "SELECT %s FROM %..." */, libc.VaList(bp+56, zCols, zTab, zOrder)) } else { zQuery = sqlite3.Xsqlite3_mprintf(tls, - ts+1165 /* "SELECT %s FROM t..." */, libc.VaList(bp+80, zCols, zOrder)) + ts+1166 /* "SELECT %s FROM t..." */, libc.VaList(bp+80, zCols, zOrder)) } } sqlite3.Xsqlite3_free(tls, zCols) @@ -8794,12 +8861,12 @@ func idxPopulateOneStat1(tls *libc.TLS, p uintptr, pIndexXInfo uintptr, pWriteSt if *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) == SQLITE_OK { var s0 int32 = *(*int32)(unsafe.Pointer(aStat)) - zStat = sqlite3.Xsqlite3_mprintf(tls, ts+1237 /* "%d" */, libc.VaList(bp+96, s0)) + zStat = sqlite3.Xsqlite3_mprintf(tls, ts+1238 /* "%d" */, libc.VaList(bp+96, s0)) if zStat == uintptr(0) { *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = SQLITE_NOMEM } for i = 1; (*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) == SQLITE_OK) && (i <= nCol); i++ { - zStat = idxAppendText(tls, bp+112 /* &rc */, zStat, ts+1240 /* " %d" */, libc.VaList(bp+104, ((s0+(*(*int32)(unsafe.Pointer(aStat + uintptr(i)*4))/2)) / *(*int32)(unsafe.Pointer(aStat + uintptr(i)*4))))) + zStat = idxAppendText(tls, bp+112 /* &rc */, zStat, ts+1241 /* " %d" */, libc.VaList(bp+104, ((s0+(*(*int32)(unsafe.Pointer(aStat + uintptr(i)*4))/2)) / *(*int32)(unsafe.Pointer(aStat + uintptr(i)*4))))) } } @@ -8825,20 +8892,20 @@ func idxPopulateOneStat1(tls *libc.TLS, p uintptr, pIndexXInfo uintptr, pWriteSt return *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) } -func idxBuildSampleTable(tls *libc.TLS, p uintptr, zTab uintptr) int32 { /* sqlite3expert.c:1617:12: */ +func idxBuildSampleTable(tls *libc.TLS, p uintptr, zTab uintptr) int32 { /* sqlite3expert.c:1619:12: */ bp := tls.Alloc(8) defer tls.Free(8) var rc int32 var zSql uintptr - rc = sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbv, ts+1244 /* "DROP TABLE IF EX..." */, uintptr(0), uintptr(0), uintptr(0)) + rc = sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbv, ts+1245 /* "DROP TABLE IF EX..." */, uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { return rc } zSql = sqlite3.Xsqlite3_mprintf(tls, - ts+1308 /* "CREATE TABLE tem..." */, libc.VaList(bp, zTab)) + ts+1309 /* "CREATE TABLE tem..." */, libc.VaList(bp, zTab)) if zSql == uintptr(0) { return SQLITE_NOMEM } @@ -8853,7 +8920,7 @@ func idxBuildSampleTable(tls *libc.TLS, p uintptr, zTab uintptr) int32 { /* sqli // function populates sqlite_stat1 table in the same database. // // The stat1 data is generated by querying the -func idxPopulateStat1(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1641:12: */ +func idxPopulateStat1(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1643:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -8868,9 +8935,9 @@ func idxPopulateStat1(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite *(*uintptr)(unsafe.Pointer(bp + 48 /* pIndexXInfo */)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 56 /* pWrite */)) = uintptr(0) - var zAllIndex uintptr = ts + 1384 /* "SELECT s.rowid, ..." */ - var zIndexXInfo uintptr = ts + 1498 /* "SELECT name, col..." */ - var zWrite uintptr = ts + 1553 /* "INSERT INTO sqli..." */ + var zAllIndex uintptr = ts + 1385 /* "SELECT s.rowid, ..." */ + var zIndexXInfo uintptr = ts + 1499 /* "SELECT name, col..." */ + var zWrite uintptr = ts + 1554 /* "INSERT INTO sqli..." */ // If iSample==0, no sqlite_stat1 data is required. if (*sqlite3expert)(unsafe.Pointer(p)).FiSample == 0 { @@ -8882,7 +8949,7 @@ func idxPopulateStat1(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite return *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) } - *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbm, ts+1594 /* "ANALYZE; PRAGMA ..." */, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbm, ts+1595 /* "ANALYZE; PRAGMA ..." */, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK { var nByte int32 = (int32(uint64(unsafe.Sizeof(IdxRemCtx{})) + (uint64(unsafe.Sizeof(IdxRemSlot{})) * uint64(*(*int32)(unsafe.Pointer(bp /* nMax */)))))) @@ -8897,13 +8964,13 @@ func idxPopulateStat1(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite return (*sqlite3expert)(unsafe.Pointer(p)).Fdbv }() *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3.Xsqlite3_create_function(tls, - dbrem, ts+1628 /* "rem" */, 2, SQLITE_UTF8, pCtx, *(*uintptr)(unsafe.Pointer(&struct { + dbrem, ts+1629 /* "rem" */, 2, SQLITE_UTF8, pCtx, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{idxRemFunc})), uintptr(0), uintptr(0)) } if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3.Xsqlite3_create_function(tls, - (*sqlite3expert)(unsafe.Pointer(p)).Fdb, ts+1632 /* "sample" */, 0, SQLITE_UTF8, bp+8 /* &samplectx */, *(*uintptr)(unsafe.Pointer(&struct { + (*sqlite3expert)(unsafe.Pointer(p)).Fdb, ts+1633 /* "sample" */, 0, SQLITE_UTF8, bp+8 /* &samplectx */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{idxSampleFunc})), uintptr(0), uintptr(0)) } @@ -8938,28 +9005,30 @@ func idxPopulateStat1(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite } if (*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK) && ((*sqlite3expert)(unsafe.Pointer(p)).FiSample < 100) { *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbv, - ts+1244 /* "DROP TABLE IF EX..." */, uintptr(0), uintptr(0), uintptr(0)) + ts+1245 /* "DROP TABLE IF EX..." */, uintptr(0), uintptr(0), uintptr(0)) } idxFinalize(tls, bp+4 /* &rc */, *(*uintptr)(unsafe.Pointer(bp + 40 /* pAllIndex */))) idxFinalize(tls, bp+4 /* &rc */, *(*uintptr)(unsafe.Pointer(bp + 48 /* pIndexXInfo */))) idxFinalize(tls, bp+4 /* &rc */, *(*uintptr)(unsafe.Pointer(bp + 56 /* pWrite */))) - for i = 0; i < (*IdxRemCtx)(unsafe.Pointer(pCtx)).FnSlot; i++ { - sqlite3.Xsqlite3_free(tls, (*IdxRemSlot)(unsafe.Pointer((pCtx+8 /* &.aSlot */)+uintptr(i)*40)).Fz) + if pCtx != 0 { + for i = 0; i < (*IdxRemCtx)(unsafe.Pointer(pCtx)).FnSlot; i++ { + sqlite3.Xsqlite3_free(tls, (*IdxRemSlot)(unsafe.Pointer((pCtx+8 /* &.aSlot */)+uintptr(i)*40)).Fz) + } + sqlite3.Xsqlite3_free(tls, pCtx) } - sqlite3.Xsqlite3_free(tls, pCtx) if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbm, ts+1639 /* "ANALYZE sqlite_s..." */, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbm, ts+1640 /* "ANALYZE sqlite_s..." */, uintptr(0), uintptr(0), uintptr(0)) } - sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdb, ts+1244 /* "DROP TABLE IF EX..." */, uintptr(0), uintptr(0), uintptr(0)) + sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdb, ts+1245 /* "DROP TABLE IF EX..." */, uintptr(0), uintptr(0), uintptr(0)) return *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) } // Allocate a new sqlite3expert object. -func sqlite3_expert_new(tls *libc.TLS, db uintptr, pzErrmsg uintptr) uintptr { /* sqlite3expert.c:1738:15: */ +func sqlite3_expert_new(tls *libc.TLS, db uintptr, pzErrmsg uintptr) uintptr { /* sqlite3expert.c:1742:15: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -8976,10 +9045,10 @@ func sqlite3_expert_new(tls *libc.TLS, db uintptr, pzErrmsg uintptr) uintptr { / if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK { (*sqlite3expert)(unsafe.Pointer(pNew)).Fdb = db (*sqlite3expert)(unsafe.Pointer(pNew)).FiSample = 100 - *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3.Xsqlite3_open(tls, ts+1661 /* ":memory:" */, (pNew + 24 /* &.dbv */)) + *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3.Xsqlite3_open(tls, ts+1662 /* ":memory:" */, (pNew + 24 /* &.dbv */)) } if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3.Xsqlite3_open(tls, ts+1661 /* ":memory:" */, (pNew + 16 /* &.dbm */)) + *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3.Xsqlite3_open(tls, ts+1662 /* ":memory:" */, (pNew + 16 /* &.dbm */)) if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK { sqlite3.Xsqlite3_db_config(tls, (*sqlite3expert)(unsafe.Pointer(pNew)).Fdbm, SQLITE_DBCONFIG_TRIGGER_EQP, libc.VaList(bp, 1, uintptr(0))) } @@ -8991,7 +9060,7 @@ func sqlite3_expert_new(tls *libc.TLS, db uintptr, pzErrmsg uintptr) uintptr { / *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = idxPrintfPrepareStmt(tls, (*sqlite3expert)(unsafe.Pointer(pNew)).Fdb, bp+24 /* &pSql */, pzErrmsg, - ts+1670 /* "SELECT sql FROM ..." */, 0) + ts+1671 /* "SELECT sql FROM ..." */, 0) for (*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK) && (SQLITE_ROW == sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pSql */)))) { var zSql uintptr = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pSql */)), 0) *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(pNew)).Fdbm, zSql, uintptr(0), uintptr(0), pzErrmsg) @@ -9021,7 +9090,7 @@ func sqlite3_expert_new(tls *libc.TLS, db uintptr, pzErrmsg uintptr) uintptr { / } // Configure an sqlite3expert object. -func sqlite3_expert_config(tls *libc.TLS, p uintptr, op int32, va uintptr) int32 { /* sqlite3expert.c:1799:5: */ +func sqlite3_expert_config(tls *libc.TLS, p uintptr, op int32, va uintptr) int32 { /* sqlite3expert.c:1803:5: */ var rc int32 = SQLITE_OK var ap va_list _ = ap @@ -9050,7 +9119,7 @@ func sqlite3_expert_config(tls *libc.TLS, p uintptr, op int32, va uintptr) int32 } // Add an SQL statement to the analysis. -func sqlite3_expert_sql(tls *libc.TLS, p uintptr, zSql uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1823:5: */ +func sqlite3_expert_sql(tls *libc.TLS, p uintptr, zSql uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1827:5: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -9098,7 +9167,7 @@ func sqlite3_expert_sql(tls *libc.TLS, p uintptr, zSql uintptr, pzErr uintptr) i return *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) } -func sqlite3_expert_analyze(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1868:5: */ +func sqlite3_expert_analyze(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1872:5: */ bp := tls.Alloc(28) defer tls.Free(28) @@ -9122,12 +9191,12 @@ func sqlite3_expert_analyze(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* // Formulate the EXPERT_REPORT_CANDIDATES text for pEntry = (*sqlite3expert)(unsafe.Pointer(p)).FhIdx.FpFirst; pEntry != 0; pEntry = (*IdxHashEntry)(unsafe.Pointer(pEntry)).FpNext { (*sqlite3expert)(unsafe.Pointer(p)).FzCandidates = idxAppendText(tls, bp+24 /* &rc */, (*sqlite3expert)(unsafe.Pointer(p)).FzCandidates, - ts+1769 /* "%s;%s%s\n" */, libc.VaList(bp, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzVal, + ts+1770 /* "%s;%s%s\n" */, libc.VaList(bp, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzVal, func() uintptr { if (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzVal2 != 0 { - return ts + 1778 /* " -- stat1: " */ + return ts + 1779 /* " -- stat1: " */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzVal2)) } @@ -9145,7 +9214,7 @@ func sqlite3_expert_analyze(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* // Return the total number of statements that have been added to this // sqlite3expert using sqlite3_expert_sql(). -func sqlite3_expert_count(tls *libc.TLS, p uintptr) int32 { /* sqlite3expert.c:1909:5: */ +func sqlite3_expert_count(tls *libc.TLS, p uintptr) int32 { /* sqlite3expert.c:1913:5: */ var nRet int32 = 0 if (*sqlite3expert)(unsafe.Pointer(p)).FpStatement != 0 { nRet = ((*IdxStatement)(unsafe.Pointer((*sqlite3expert)(unsafe.Pointer(p)).FpStatement)).FiId + 1) @@ -9154,7 +9223,7 @@ func sqlite3_expert_count(tls *libc.TLS, p uintptr) int32 { /* sqlite3expert.c:1 } // Return a component of the report. -func sqlite3_expert_report(tls *libc.TLS, p uintptr, iStmt int32, eReport int32) uintptr { /* sqlite3expert.c:1918:12: */ +func sqlite3_expert_report(tls *libc.TLS, p uintptr, iStmt int32, eReport int32) uintptr { /* sqlite3expert.c:1922:12: */ var zRet uintptr = uintptr(0) var pStmt uintptr @@ -9187,7 +9256,7 @@ func sqlite3_expert_report(tls *libc.TLS, p uintptr, iStmt int32, eReport int32) } // Free an sqlite3expert object. -func sqlite3_expert_destroy(tls *libc.TLS, p uintptr) { /* sqlite3expert.c:1944:6: */ +func sqlite3_expert_destroy(tls *libc.TLS, p uintptr) { /* sqlite3expert.c:1948:6: */ if p != 0 { sqlite3.Xsqlite3_close(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbm) sqlite3.Xsqlite3_close(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbv) @@ -9213,7 +9282,7 @@ func sqlite3_expert_destroy(tls *libc.TLS, p uintptr) { /* sqlite3expert.c:1944: // // New code should just directly be written to use stdarg.h conventions. -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -9290,7 +9359,7 @@ func sqlite3_expert_destroy(tls *libc.TLS, p uintptr) { /* sqlite3expert.c:1944: // Miscellaneous declarations. -type ClientData = uintptr /* tcl.h:340:15 */ +type ClientData = uintptr /* tcl.h:344:15 */ // Darwin specific configure overrides (to support fat compiles, where // configure runs only once for multiple architectures): @@ -9314,8 +9383,8 @@ type ClientData = uintptr /* tcl.h:340:15 */ // tclObj.c) depends on the function // sprintf(...,"%" TCL_LL_MODIFIER "d",...). -type Tcl_WideInt = int64 /* tcl.h:415:28 */ -type Tcl_WideUInt = uint64 /* tcl.h:416:36 */ +type Tcl_WideInt = int64 /* tcl.h:419:28 */ +type Tcl_WideUInt = uint64 /* tcl.h:420:36 */ // The next short section of defines are only done when not running on Windows // or some other strange platform. @@ -9370,7 +9439,7 @@ type Tcl_Interp1 = struct { FfreeProcDontUse uintptr FerrorLineDontUse int32 _ [4]byte -} /* tcl.h:493:9 */ +} /* tcl.h:497:9 */ //---------------------------------------------------------------------------- // Data structures defined opaquely in this module. The definitions below just @@ -9390,33 +9459,33 @@ type Tcl_Interp1 = struct { // Instead, they set a Tcl_Obj member in the "real" structure that can be // accessed with Tcl_GetObjResult() and Tcl_SetObjResult(). -type Tcl_Interp = Tcl_Interp1 /* tcl.h:525:1 */ +type Tcl_Interp = Tcl_Interp1 /* tcl.h:529:1 */ -type Tcl_AsyncHandler = uintptr /* tcl.h:527:34 */ -type Tcl_Channel = uintptr /* tcl.h:528:29 */ -type Tcl_ChannelTypeVersion = uintptr /* tcl.h:529:40 */ -type Tcl_Command = uintptr /* tcl.h:530:29 */ -type Tcl_Condition = uintptr /* tcl.h:531:31 */ -type Tcl_Dict = uintptr /* tcl.h:532:26 */ -type Tcl_EncodingState = uintptr /* tcl.h:533:35 */ -type Tcl_Encoding = uintptr /* tcl.h:534:30 */ +type Tcl_AsyncHandler = uintptr /* tcl.h:531:34 */ +type Tcl_Channel = uintptr /* tcl.h:532:29 */ +type Tcl_ChannelTypeVersion = uintptr /* tcl.h:533:40 */ +type Tcl_Command = uintptr /* tcl.h:534:29 */ +type Tcl_Condition = uintptr /* tcl.h:535:31 */ +type Tcl_Dict = uintptr /* tcl.h:536:26 */ +type Tcl_EncodingState = uintptr /* tcl.h:537:35 */ +type Tcl_Encoding = uintptr /* tcl.h:538:30 */ type Tcl_Event1 = struct { Fproc uintptr FnextPtr uintptr -} /* tcl.h:535:9 */ +} /* tcl.h:539:9 */ -type Tcl_Event = Tcl_Event1 /* tcl.h:535:26 */ -type Tcl_InterpState = uintptr /* tcl.h:536:33 */ -type Tcl_LoadHandle = uintptr /* tcl.h:537:32 */ -type Tcl_Mutex = uintptr /* tcl.h:538:27 */ -type Tcl_Pid = uintptr /* tcl.h:539:25 */ -type Tcl_RegExp = uintptr /* tcl.h:540:28 */ -type Tcl_ThreadDataKey = uintptr /* tcl.h:541:35 */ -type Tcl_ThreadId = uintptr /* tcl.h:542:30 */ -type Tcl_TimerToken = uintptr /* tcl.h:543:32 */ -type Tcl_Trace = uintptr /* tcl.h:544:27 */ -type Tcl_Var = uintptr /* tcl.h:545:25 */ -type Tcl_ZlibStream = uintptr /* tcl.h:546:32 */ +type Tcl_Event = Tcl_Event1 /* tcl.h:539:26 */ +type Tcl_InterpState = uintptr /* tcl.h:540:33 */ +type Tcl_LoadHandle = uintptr /* tcl.h:541:32 */ +type Tcl_Mutex = uintptr /* tcl.h:542:27 */ +type Tcl_Pid = uintptr /* tcl.h:543:25 */ +type Tcl_RegExp = uintptr /* tcl.h:544:28 */ +type Tcl_ThreadDataKey = uintptr /* tcl.h:545:35 */ +type Tcl_ThreadId = uintptr /* tcl.h:546:30 */ +type Tcl_TimerToken = uintptr /* tcl.h:547:32 */ +type Tcl_Trace = uintptr /* tcl.h:548:27 */ +type Tcl_Var = uintptr /* tcl.h:549:25 */ +type Tcl_ZlibStream = uintptr /* tcl.h:550:32 */ // Threading function return types used for abstracting away platform // differences when writing a Tcl_ThreadCreateProc. See the NewThread function @@ -9438,7 +9507,7 @@ type Tcl_ZlibStream = uintptr /* tcl.h:546:32 */ type Tcl_RegExpIndices1 = struct { Fstart int64 Fend int64 -} /* tcl.h:623:9 */ +} /* tcl.h:627:9 */ // Threading function return types used for abstracting away platform // differences when writing a Tcl_ThreadCreateProc. See the NewThread function @@ -9457,7 +9526,7 @@ type Tcl_RegExpIndices1 = struct { // relative to the start of the match string, not the beginning of the entire // string. -type Tcl_RegExpIndices = Tcl_RegExpIndices1 /* tcl.h:628:3 */ +type Tcl_RegExpIndices = Tcl_RegExpIndices1 /* tcl.h:632:3 */ type Tcl_RegExpInfo1 = struct { Fnsubs int32 @@ -9465,15 +9534,15 @@ type Tcl_RegExpInfo1 = struct { Fmatches uintptr FextendStart int64 Freserved int64 -} /* tcl.h:630:9 */ +} /* tcl.h:634:9 */ -type Tcl_RegExpInfo = Tcl_RegExpInfo1 /* tcl.h:637:3 */ +type Tcl_RegExpInfo = Tcl_RegExpInfo1 /* tcl.h:641:3 */ // Picky compilers complain if this typdef doesn't appear before the struct's // reference in tclDecls.h. -type Tcl_Stat_ = uintptr /* tcl.h:644:21 */ -type Tcl_OldStat_ = uintptr /* tcl.h:645:21 */ +type Tcl_Stat_ = uintptr /* tcl.h:648:21 */ +type Tcl_OldStat_ = uintptr /* tcl.h:649:21 */ //---------------------------------------------------------------------------- // When a TCL command returns, the interpreter contains a result from the @@ -9499,7 +9568,7 @@ type Tcl_OldStat_ = uintptr /* tcl.h:645:21 */ // Argument descriptors for math function callbacks in expressions: -type Tcl_ValueType = uint32 /* tcl.h:692:3 */ +type Tcl_ValueType = uint32 /* tcl.h:696:3 */ type Tcl_Value1 = struct { Ftype Tcl_ValueType @@ -9507,9 +9576,9 @@ type Tcl_Value1 = struct { FintValue int64 FdoubleValue float64 FwideValue Tcl_WideInt -} /* tcl.h:694:9 */ +} /* tcl.h:698:9 */ -type Tcl_Value = Tcl_Value1 /* tcl.h:700:3 */ +type Tcl_Value = Tcl_Value1 /* tcl.h:704:3 */ // Forward declaration of Tcl_Obj to prevent an error when the forward // reference to Tcl_Obj is encountered in the function types declared below. @@ -9525,7 +9594,7 @@ type Tcl_Obj1 = struct { FlongValue int64 _ [8]byte } -} /* tcl.h:707:1 */ +} /* tcl.h:711:1 */ //---------------------------------------------------------------------------- // The following structure represents a type of object, which is a particular @@ -9538,20 +9607,20 @@ type Tcl_ObjType1 = struct { FdupIntRepProc uintptr FupdateStringProc uintptr FsetFromAnyProc uintptr -} /* tcl.h:707:1 */ +} /* tcl.h:711:1 */ //---------------------------------------------------------------------------- // The following structure represents a type of object, which is a particular // internal representation for an object plus a set of functions that provide // standard operations on objects of that type. -type Tcl_ObjType = Tcl_ObjType1 /* tcl.h:796:3 */ +type Tcl_ObjType = Tcl_ObjType1 /* tcl.h:800:3 */ // One of the following structures exists for each object in the Tcl system. // An object stores a value as either a string, some internal representation, // or both. -type Tcl_Obj = Tcl_Obj1 /* tcl.h:843:3 */ +type Tcl_Obj = Tcl_Obj1 /* tcl.h:847:3 */ //---------------------------------------------------------------------------- // The following structure contains the state needed by Tcl_SaveResult. No-one @@ -9567,14 +9636,14 @@ type Tcl_SavedResult1 = struct { FappendUsed int32 FresultSpace [201]int8 _ [7]byte -} /* tcl.h:864:9 */ +} /* tcl.h:868:9 */ //---------------------------------------------------------------------------- // The following structure contains the state needed by Tcl_SaveResult. No-one // outside of Tcl should access any of these fields. This structure is // typically allocated on the stack. -type Tcl_SavedResult = Tcl_SavedResult1 /* tcl.h:872:3 */ +type Tcl_SavedResult = Tcl_SavedResult1 /* tcl.h:876:3 */ //---------------------------------------------------------------------------- // The following definitions support Tcl's namespace facility. Note: the first @@ -9587,14 +9656,14 @@ type Tcl_Namespace1 = struct { FclientData ClientData FdeleteProc uintptr FparentPtr uintptr -} /* tcl.h:881:9 */ +} /* tcl.h:885:9 */ //---------------------------------------------------------------------------- // The following definitions support Tcl's namespace facility. Note: the first // five fields must match exactly the fields in a Namespace structure (see // tclInt.h). -type Tcl_Namespace = Tcl_Namespace1 /* tcl.h:897:3 */ +type Tcl_Namespace = Tcl_Namespace1 /* tcl.h:901:3 */ //---------------------------------------------------------------------------- // The following structure represents a call frame, or activation record. A @@ -9634,7 +9703,7 @@ type Tcl_CallFrame1 = struct { Fdummy11 uintptr Fdummy12 uintptr Fdummy13 uintptr -} /* tcl.h:922:9 */ +} /* tcl.h:926:9 */ //---------------------------------------------------------------------------- // The following structure represents a call frame, or activation record. A @@ -9657,7 +9726,7 @@ type Tcl_CallFrame1 = struct { // WARNING!! The structure definition must be kept consistent with the // CallFrame structure in tclInt.h. If you change one, change the other. -type Tcl_CallFrame = Tcl_CallFrame1 /* tcl.h:937:3 */ +type Tcl_CallFrame = Tcl_CallFrame1 /* tcl.h:941:3 */ //---------------------------------------------------------------------------- // Information about commands that is returned by Tcl_GetCommandInfo and @@ -9682,7 +9751,7 @@ type Tcl_CmdInfo1 = struct { FdeleteProc uintptr FdeleteData ClientData FnamespacePtr uintptr -} /* tcl.h:954:9 */ +} /* tcl.h:958:9 */ //---------------------------------------------------------------------------- // Information about commands that is returned by Tcl_GetCommandInfo and @@ -9697,7 +9766,7 @@ type Tcl_CmdInfo1 = struct { // wrapper that does string-to-object or object-to-string argument conversions // then calls the other function. -type Tcl_CmdInfo = Tcl_CmdInfo1 /* tcl.h:973:3 */ +type Tcl_CmdInfo = Tcl_CmdInfo1 /* tcl.h:977:3 */ //---------------------------------------------------------------------------- // The structure defined below is used to hold dynamic strings. The only @@ -9709,14 +9778,14 @@ type Tcl_DString1 = struct { Flength int32 FspaceAvl int32 FstaticSpace [200]int8 -} /* tcl.h:983:9 */ +} /* tcl.h:987:9 */ //---------------------------------------------------------------------------- // The structure defined below is used to hold dynamic strings. The only // fields that clients should use are string and length, accessible via the // macros Tcl_DStringValue and Tcl_DStringLength. -type Tcl_DString = Tcl_DString1 /* tcl.h:993:3 */ +type Tcl_DString = Tcl_DString1 /* tcl.h:997:3 */ // Definitions for the maximum number of digits of precision that may be // specified in the "tcl_precision" variable, and the number of bytes of @@ -9788,7 +9857,7 @@ type Tcl_HashKeyType1 = struct { FcompareKeysProc uintptr FallocEntryProc uintptr FfreeEntryProc uintptr -} /* tcl.h:1152:9 */ +} /* tcl.h:1156:9 */ // Definitions for the maximum number of digits of precision that may be // specified in the "tcl_precision" variable, and the number of bytes of @@ -9853,7 +9922,7 @@ type Tcl_HashKeyType1 = struct { //---------------------------------------------------------------------------- // Forward declarations of Tcl_HashTable and related types. -type Tcl_HashKeyType = Tcl_HashKeyType1 /* tcl.h:1152:32 */ +type Tcl_HashKeyType = Tcl_HashKeyType1 /* tcl.h:1156:32 */ type Tcl_HashTable1 = struct { Fbuckets uintptr FstaticBuckets [4]uintptr @@ -9866,18 +9935,18 @@ type Tcl_HashTable1 = struct { FfindProc uintptr FcreateProc uintptr FtypePtr uintptr -} /* tcl.h:1153:9 */ +} /* tcl.h:1157:9 */ -type Tcl_HashTable = Tcl_HashTable1 /* tcl.h:1153:30 */ +type Tcl_HashTable = Tcl_HashTable1 /* tcl.h:1157:30 */ type Tcl_HashEntry1 = struct { FnextPtr uintptr FtablePtr uintptr Fhash uintptr FclientData ClientData Fkey struct{ FoneWordValue uintptr } -} /* tcl.h:1153:9 */ +} /* tcl.h:1157:9 */ -type Tcl_HashEntry = Tcl_HashEntry1 /* tcl.h:1154:30 */ +type Tcl_HashEntry = Tcl_HashEntry1 /* tcl.h:1158:30 */ // Structure definition for information used to keep track of searches through // hash tables: @@ -9887,12 +9956,12 @@ type Tcl_HashSearch1 = struct { FnextIndex int32 _ [4]byte FnextEntryPtr uintptr -} /* tcl.h:1308:9 */ +} /* tcl.h:1312:9 */ // Structure definition for information used to keep track of searches through // hash tables: -type Tcl_HashSearch = Tcl_HashSearch1 /* tcl.h:1314:3 */ +type Tcl_HashSearch = Tcl_HashSearch1 /* tcl.h:1318:3 */ // Acceptable key types for hash tables: // @@ -9922,11 +9991,11 @@ type Tcl_DictSearch = struct { Fepoch int32 _ [4]byte FdictionaryPtr Tcl_Dict -} /* tcl.h:1354:3 */ +} /* tcl.h:1358:3 */ // Positions to pass to Tcl_QueueEvent: -type Tcl_QueuePosition = uint32 /* tcl.h:1389:3 */ +type Tcl_QueuePosition = uint32 /* tcl.h:1393:3 */ // Values to pass to Tcl_SetServiceMode to specify the behavior of notifier // event routines. @@ -9938,7 +10007,7 @@ type Tcl_QueuePosition = uint32 /* tcl.h:1389:3 */ type Tcl_Time1 = struct { Fsec int64 Fusec int64 -} /* tcl.h:1405:9 */ +} /* tcl.h:1409:9 */ // Values to pass to Tcl_SetServiceMode to specify the behavior of notifier // event routines. @@ -9947,7 +10016,7 @@ type Tcl_Time1 = struct { // absolute time (the number of seconds from the epoch) or as an elapsed time. // On Unix systems the epoch is Midnight Jan 1, 1970 GMT. -type Tcl_Time = Tcl_Time1 /* tcl.h:1408:3 */ +type Tcl_Time = Tcl_Time1 /* tcl.h:1412:3 */ // struct Tcl_ChannelType: // @@ -9976,7 +10045,7 @@ type Tcl_ChannelType1 = struct { FwideSeekProc uintptr FthreadActionProc uintptr FtruncateProc uintptr -} /* tcl.h:1524:9 */ +} /* tcl.h:1528:9 */ // struct Tcl_ChannelType: // @@ -9987,7 +10056,7 @@ type Tcl_ChannelType1 = struct { // It is recommend that the Tcl_Channel* functions are used to access elements // of this structure, instead of direct accessing. -type Tcl_ChannelType = Tcl_ChannelType1 /* tcl.h:1592:3 */ +type Tcl_ChannelType = Tcl_ChannelType1 /* tcl.h:1596:3 */ // The following flags determine whether the blockModeProc above should set // the channel into blocking or nonblocking mode. They are passed as arguments @@ -9996,7 +10065,7 @@ type Tcl_ChannelType = Tcl_ChannelType1 /* tcl.h:1592:3 */ //---------------------------------------------------------------------------- // Enum for different types of file paths. -type Tcl_PathType = uint32 /* tcl.h:1613:3 */ +type Tcl_PathType = uint32 /* tcl.h:1617:3 */ // The following structure is used to pass glob type data amongst the various // glob routines and Tcl_FSMatchInDirectory. @@ -10006,19 +10075,19 @@ type Tcl_GlobTypeData1 = struct { Fperm int32 FmacType uintptr FmacCreator uintptr -} /* tcl.h:1620:9 */ +} /* tcl.h:1624:9 */ // The following structure is used to pass glob type data amongst the various // glob routines and Tcl_FSMatchInDirectory. -type Tcl_GlobTypeData = Tcl_GlobTypeData1 /* tcl.h:1625:3 */ +type Tcl_GlobTypeData = Tcl_GlobTypeData1 /* tcl.h:1629:3 */ // We have to declare the utime structure here. type utimbuf = struct { Factime int64 Fmodtime int64 } /* utime.h:36:1 */ -type Tcl_FSVersion = uintptr /* tcl.h:1700:31 */ +type Tcl_FSVersion = uintptr /* tcl.h:1704:31 */ //---------------------------------------------------------------------------- // Data structures related to hooking into the filesystem @@ -10069,7 +10138,7 @@ type Tcl_Filesystem1 = struct { FloadFileProc uintptr FgetCwdProc uintptr FchdirProc uintptr -} /* tcl.h:1726:9 */ +} /* tcl.h:1730:9 */ //---------------------------------------------------------------------------- // Data structures related to hooking into the filesystem @@ -10087,7 +10156,7 @@ type Tcl_Filesystem1 = struct { // However, a complete filesystem should provide all of these functions. The // explanations in the structure show the importance of each function. -type Tcl_Filesystem = Tcl_Filesystem1 /* tcl.h:1873:3 */ +type Tcl_Filesystem = Tcl_Filesystem1 /* tcl.h:1877:3 */ // The following definitions are used as values for the 'linkAction' flag to // Tcl_FSLink, or the linkProc of any filesystem. Any combination of flags can @@ -10110,7 +10179,7 @@ type Tcl_NotifierProcs1 = struct { FfinalizeNotifierProc uintptr FalertNotifierProc uintptr FserviceModeHookProc uintptr -} /* tcl.h:1894:9 */ +} /* tcl.h:1898:9 */ // The following definitions are used as values for the 'linkAction' flag to // Tcl_FSLink, or the linkProc of any filesystem. Any combination of flags can @@ -10124,7 +10193,7 @@ type Tcl_NotifierProcs1 = struct { // The following structure represents the Notifier functions that you can // override with the Tcl_SetNotifier call. -type Tcl_NotifierProcs = Tcl_NotifierProcs1 /* tcl.h:1903:3 */ +type Tcl_NotifierProcs = Tcl_NotifierProcs1 /* tcl.h:1907:3 */ //---------------------------------------------------------------------------- // The following data structures and declarations are for the new Tcl parser. @@ -10139,7 +10208,7 @@ type Tcl_Token1 = struct { Fstart uintptr Fsize int32 FnumComponents int32 -} /* tcl.h:1914:9 */ +} /* tcl.h:1918:9 */ //---------------------------------------------------------------------------- // The following data structures and declarations are for the new Tcl parser. @@ -10148,7 +10217,7 @@ type Tcl_Token1 = struct { // reference, one of the following structures is created to describe the // token. -type Tcl_Token = Tcl_Token1 /* tcl.h:1924:3 */ +type Tcl_Token = Tcl_Token1 /* tcl.h:1928:3 */ // Type values defined for Tcl_Token structures. These values are defined as // mask bits so that it's easy to check for collections of types. @@ -10208,7 +10277,7 @@ type Tcl_Token = Tcl_Token1 /* tcl.h:1924:3 */ // TCL_TOKEN_OPERATOR - The token describes one expression operator. // An operator might be the name of a math // function such as "abs". A TCL_TOKEN_OPERATOR -// token is always preceded by one +// token is always preceeded by one // TCL_TOKEN_SUB_EXPR token for the operator's // subexpression, and is followed by zero or more // TCL_TOKEN_SUB_EXPR tokens for the operator's @@ -10244,7 +10313,7 @@ type Tcl_Parse1 = struct { Fincomplete int32 _ [4]byte FstaticTokens [20]Tcl_Token -} /* tcl.h:2030:9 */ +} /* tcl.h:2034:9 */ // Type values defined for Tcl_Token structures. These values are defined as // mask bits so that it's easy to check for collections of types. @@ -10304,7 +10373,7 @@ type Tcl_Parse1 = struct { // TCL_TOKEN_OPERATOR - The token describes one expression operator. // An operator might be the name of a math // function such as "abs". A TCL_TOKEN_OPERATOR -// token is always preceded by one +// token is always preceeded by one // TCL_TOKEN_SUB_EXPR token for the operator's // subexpression, and is followed by zero or more // TCL_TOKEN_SUB_EXPR tokens for the operator's @@ -10321,7 +10390,7 @@ type Tcl_Parse1 = struct { // A structure of the following type is filled in by Tcl_ParseCommand. It // describes a single command parsed from an input string. -type Tcl_Parse = Tcl_Parse1 /* tcl.h:2083:3 */ +type Tcl_Parse = Tcl_Parse1 /* tcl.h:2087:3 */ //---------------------------------------------------------------------------- // The following structure represents a user-defined encoding. It collects @@ -10335,13 +10404,13 @@ type Tcl_EncodingType1 = struct { FclientData ClientData FnullSize int32 _ [4]byte -} /* tcl.h:2091:9 */ +} /* tcl.h:2095:9 */ //---------------------------------------------------------------------------- // The following structure represents a user-defined encoding. It collects // together all the functions that are used by the specific encoding. -type Tcl_EncodingType = Tcl_EncodingType1 /* tcl.h:2111:3 */ +type Tcl_EncodingType = Tcl_EncodingType1 /* tcl.h:2115:3 */ // The following definitions are used as values for the conversion control // flags argument when converting text from one character set to another: @@ -10423,7 +10492,7 @@ type Tcl_EncodingType = Tcl_EncodingType1 /* tcl.h:2111:3 */ // This represents a Unicode character. Any changes to this should also be // reflected in regcustom.h. -type Tcl_UniChar = uint16 /* tcl.h:2228:24 */ +type Tcl_UniChar = uint16 /* tcl.h:2232:24 */ //---------------------------------------------------------------------------- // TIP #59: The following structure is used in calls 'Tcl_RegisterConfig' to @@ -10432,14 +10501,14 @@ type Tcl_UniChar = uint16 /* tcl.h:2228:24 */ type Tcl_Config1 = struct { Fkey uintptr Fvalue uintptr -} /* tcl.h:2237:9 */ +} /* tcl.h:2241:9 */ //---------------------------------------------------------------------------- // TIP #59: The following structure is used in calls 'Tcl_RegisterConfig' to // provide the system with the embedded configuration data. -type Tcl_Config = Tcl_Config1 /* tcl.h:2242:3 */ -type mp_digit = uint32 /* tcl.h:2268:22 */ +type Tcl_Config = Tcl_Config1 /* tcl.h:2246:3 */ +type mp_digit = uint32 /* tcl.h:2272:22 */ //---------------------------------------------------------------------------- // Definitions needed for Tcl_ParseArgvObj routines. @@ -10454,7 +10523,7 @@ type Tcl_ArgvInfo = struct { FdstPtr uintptr FhelpStr uintptr FclientData ClientData -} /* tcl.h:2289:3 */ +} /* tcl.h:2293:3 */ type TclPlatStubs1 = struct { Fmagic int32 @@ -11153,7 +11222,7 @@ func dbHandleFromObj(tls *libc.TLS, interp uintptr, pObj uintptr, pDb uintptr) i // var info Tcl_CmdInfo at bp+24, 64 if 0 == tcl.XTcl_GetCommandInfo(tls, interp, tcl.XTcl_GetString(tls, pObj), bp+24 /* &info */) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+1790 /* "no such handle: " */, tcl.XTcl_GetString(tls, pObj), 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+1791 /* "no such handle: " */, tcl.XTcl_GetString(tls, pObj), 0)) return TCL_ERROR } @@ -11172,11 +11241,11 @@ func testExpertCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 var pExpert uintptr = clientData *(*[6]Subcmd)(unsafe.Pointer(bp /* aSub */)) = [6]Subcmd{ - {FzSub: ts + 1807 /* "sql" */, FnArg: 1, FzMsg: ts + 1811 /* "TABLE" */}, // 0 - {FzSub: ts + 1817 /* "analyze" */, FzMsg: ts + 488 /* "" */}, // 1 - {FzSub: ts + 1825 /* "count" */, FzMsg: ts + 488 /* "" */}, // 2 - {FzSub: ts + 1831 /* "report" */, FnArg: 2, FzMsg: ts + 1838 /* "STMT EREPORT" */}, // 3 - {FzSub: ts + 1851 /* "destroy" */, FzMsg: ts + 488 /* "" */}, // 4 + {FzSub: ts + 1808 /* "sql" */, FnArg: 1, FzMsg: ts + 1812 /* "TABLE" */}, // 0 + {FzSub: ts + 1818 /* "analyze" */, FzMsg: ts + 489 /* "" */}, // 1 + {FzSub: ts + 1826 /* "count" */, FzMsg: ts + 489 /* "" */}, // 2 + {FzSub: ts + 1832 /* "report" */, FnArg: 2, FzMsg: ts + 1839 /* "STMT EREPORT" */}, // 3 + {FzSub: ts + 1852 /* "destroy" */, FzMsg: ts + 489 /* "" */}, // 4 {}, } // var iSub int32 at bp+144, 4 @@ -11185,11 +11254,11 @@ func testExpertCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = uintptr(0) if objc < 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1859 /* "SUBCOMMAND ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1860 /* "SUBCOMMAND ..." */) return TCL_ERROR } rc = tcl.XTcl_GetIndexFromObjStruct(tls, interp, - *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &aSub[0] */, int32(unsafe.Sizeof(Subcmd{})), ts+1874 /* "sub-command" */, 0, bp+144 /* &iSub */) + *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &aSub[0] */, int32(unsafe.Sizeof(Subcmd{})), ts+1875 /* "sub-command" */, 0, bp+144 /* &iSub */) if rc != TCL_OK { return rc } @@ -11225,7 +11294,7 @@ func testExpertCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 case 3: { // report *(*[5]uintptr)(unsafe.Pointer(bp + 168 /* aEnum */)) = [5]uintptr{ - ts + 1807 /* "sql" */, ts + 1886 /* "indexes" */, ts + 1894 /* "plan" */, ts + 1899 /* "candidates" */, uintptr(0), + ts + 1808 /* "sql" */, ts + 1887 /* "indexes" */, ts + 1895 /* "plan" */, ts + 1900 /* "candidates" */, uintptr(0), } // var iEnum int32 at bp+208, 4 @@ -11234,7 +11303,7 @@ func testExpertCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 var zReport uintptr if (tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+160 /* &iStmt */) != 0) || - (tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+168 /* &aEnum[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+1831 /* "report" */, 0, bp+208 /* &iEnum */) != 0) { + (tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+168 /* &aEnum[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+1832 /* "report" */, 0, bp+208 /* &iEnum */) != 0) { return TCL_ERROR } @@ -11286,16 +11355,16 @@ func test_sqlite3_expert_new(tls *libc.TLS, clientData uintptr, interp uintptr, var rc int32 = TCL_OK if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if dbHandleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+40 /* &db */) != 0 { return TCL_ERROR } - zCmd = sqlite3.Xsqlite3_mprintf(tls, ts+1913 /* "sqlite3expert%d" */, libc.VaList(bp, libc.PreIncInt32(&iCmd, 1))) + zCmd = sqlite3.Xsqlite3_mprintf(tls, ts+1914 /* "sqlite3expert%d" */, libc.VaList(bp, libc.PreIncInt32(&iCmd, 1))) if zCmd == uintptr(0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+8, ts+1929 /* "out of memory" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+8, ts+1930 /* "out of memory" */, uintptr(0))) return TCL_ERROR } @@ -11329,7 +11398,7 @@ func TestExpert_Init(tls *libc.TLS, interp uintptr) int32 { /* test_expert.c:202 FzCmd uintptr FxProc uintptr }{ - {FzCmd: ts + 1943 /* "sqlite3_expert_n..." */, FxProc: *(*uintptr)(unsafe.Pointer(&struct { + {FzCmd: ts + 1944 /* "sqlite3_expert_n..." */, FxProc: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_sqlite3_expert_new}))}, } @@ -11459,10 +11528,10 @@ func f5tResultToErrorCode(tls *libc.TLS, zRes uintptr) int32 { /* fts5_tcl.c:67: defer tls.Free(64) *(*[4]ErrorCode)(unsafe.Pointer(bp /* aErr */)) = [4]ErrorCode{ - {Frc: SQLITE_DONE, FzError: ts + 1962 /* "SQLITE_DONE" */}, - {Frc: SQLITE_ERROR, FzError: ts + 1974 /* "SQLITE_ERROR" */}, - {FzError: ts + 1987 /* "SQLITE_OK" */}, - {FzError: ts + 488 /* "" */}, + {Frc: SQLITE_DONE, FzError: ts + 1963 /* "SQLITE_DONE" */}, + {Frc: SQLITE_ERROR, FzError: ts + 1975 /* "SQLITE_ERROR" */}, + {FzError: ts + 1988 /* "SQLITE_OK" */}, + {FzError: ts + 489 /* "" */}, } var i int32 @@ -11493,16 +11562,16 @@ func f5tDbAndApi(tls *libc.TLS, interp uintptr, pObj uintptr, ppDb uintptr, ppAp *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 64 /* pApi */)) = uintptr(0) - rc = sqlite3.Xsqlite3_prepare_v2(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), ts+1997 /* "SELECT fts5(?1)" */, -1, bp+56 /* &pStmt */, uintptr(0)) + rc = sqlite3.Xsqlite3_prepare_v2(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), ts+1998 /* "SELECT fts5(?1)" */, -1, bp+56 /* &pStmt */, uintptr(0)) if rc != SQLITE_OK { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+2013 /* "error: " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */))), 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+2014 /* "error: " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */))), 0)) return TCL_ERROR } - sqlite3.Xsqlite3_bind_pointer(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), 1, bp+64 /* &pApi */, ts+2021 /* "fts5_api_ptr" */, uintptr(0)) + sqlite3.Xsqlite3_bind_pointer(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), 1, bp+64 /* &pApi */, ts+2022 /* "fts5_api_ptr" */, uintptr(0)) sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */))) if sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */))) != SQLITE_OK { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+2013 /* "error: " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */))), 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+2014 /* "error: " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */))), 0)) return TCL_ERROR } @@ -11580,7 +11649,7 @@ func xQueryPhraseCb(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr) int (*F5tApi)(unsafe.Pointer(bp + 72 /* &sApi */)).FpApi = pApi (*F5tApi)(unsafe.Pointer(bp + 72 /* &sApi */)).FpFts = pFts - libc.Xsprintf(tls, bp+8 /* &zCmd[0] */, ts+2034 /* "f5t_2_%lld" */, libc.VaList(bp, libc.PostIncInt64(&iCmd1, 1))) + libc.Xsprintf(tls, bp+8 /* &zCmd[0] */, ts+2035 /* "f5t_2_%lld" */, libc.VaList(bp, libc.PostIncInt64(&iCmd1, 1))) tcl.XTcl_CreateObjCommand(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, bp+8 /* &zCmd[0] */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{xF5tApi})), bp+72 /* &sApi */, uintptr(0)) @@ -11625,24 +11694,24 @@ func xF5tApi(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv defer tls.Free(684) *(*[19]Sub)(unsafe.Pointer(bp + 32 /* aSub */)) = [19]Sub{ - {FzName: ts + 2045 /* "xColumnCount" */, FzMsg: ts + 488 /* "" */}, // 0 - {FzName: ts + 2058 /* "xRowCount" */, FzMsg: ts + 488 /* "" */}, // 1 - {FzName: ts + 2068 /* "xColumnTotalSize" */, FnArg: 1, FzMsg: ts + 2085 /* "COL" */}, // 2 - {FzName: ts + 2089 /* "xTokenize" */, FnArg: 2, FzMsg: ts + 2099 /* "TEXT SCRIPT" */}, // 3 - {FzName: ts + 2111 /* "xPhraseCount" */, FzMsg: ts + 488 /* "" */}, // 4 - {FzName: ts + 2124 /* "xPhraseSize" */, FnArg: 1, FzMsg: ts + 2136 /* "PHRASE" */}, // 5 - {FzName: ts + 2143 /* "xInstCount" */, FzMsg: ts + 488 /* "" */}, // 6 - {FzName: ts + 2154 /* "xInst" */, FnArg: 1, FzMsg: ts + 2160 /* "IDX" */}, // 7 - {FzName: ts + 2164 /* "xRowid" */, FzMsg: ts + 488 /* "" */}, // 8 - {FzName: ts + 2171 /* "xColumnText" */, FnArg: 1, FzMsg: ts + 2085 /* "COL" */}, // 9 - {FzName: ts + 2183 /* "xColumnSize" */, FnArg: 1, FzMsg: ts + 2085 /* "COL" */}, // 10 - {FzName: ts + 2195 /* "xQueryPhrase" */, FnArg: 2, FzMsg: ts + 2208 /* "PHRASE SCRIPT" */}, // 11 - {FzName: ts + 2222 /* "xSetAuxdata" */, FnArg: 1, FzMsg: ts + 2234 /* "VALUE" */}, // 12 - {FzName: ts + 2240 /* "xGetAuxdata" */, FnArg: 1, FzMsg: ts + 2252 /* "CLEAR" */}, // 13 - {FzName: ts + 2258 /* "xSetAuxdataInt" */, FnArg: 1, FzMsg: ts + 2273 /* "INTEGER" */}, // 14 - {FzName: ts + 2281 /* "xGetAuxdataInt" */, FnArg: 1, FzMsg: ts + 2252 /* "CLEAR" */}, // 15 - {FzName: ts + 2296 /* "xPhraseForeach" */, FnArg: 4, FzMsg: ts + 2311 /* "IPHRASE COLVAR O..." */}, // 16 - {FzName: ts + 2340 /* "xPhraseColumnFor..." */, FnArg: 3, FzMsg: ts + 2361 /* "IPHRASE COLVAR S..." */}, // 17 + {FzName: ts + 2046 /* "xColumnCount" */, FzMsg: ts + 489 /* "" */}, // 0 + {FzName: ts + 2059 /* "xRowCount" */, FzMsg: ts + 489 /* "" */}, // 1 + {FzName: ts + 2069 /* "xColumnTotalSize" */, FnArg: 1, FzMsg: ts + 2086 /* "COL" */}, // 2 + {FzName: ts + 2090 /* "xTokenize" */, FnArg: 2, FzMsg: ts + 2100 /* "TEXT SCRIPT" */}, // 3 + {FzName: ts + 2112 /* "xPhraseCount" */, FzMsg: ts + 489 /* "" */}, // 4 + {FzName: ts + 2125 /* "xPhraseSize" */, FnArg: 1, FzMsg: ts + 2137 /* "PHRASE" */}, // 5 + {FzName: ts + 2144 /* "xInstCount" */, FzMsg: ts + 489 /* "" */}, // 6 + {FzName: ts + 2155 /* "xInst" */, FnArg: 1, FzMsg: ts + 2161 /* "IDX" */}, // 7 + {FzName: ts + 2165 /* "xRowid" */, FzMsg: ts + 489 /* "" */}, // 8 + {FzName: ts + 2172 /* "xColumnText" */, FnArg: 1, FzMsg: ts + 2086 /* "COL" */}, // 9 + {FzName: ts + 2184 /* "xColumnSize" */, FnArg: 1, FzMsg: ts + 2086 /* "COL" */}, // 10 + {FzName: ts + 2196 /* "xQueryPhrase" */, FnArg: 2, FzMsg: ts + 2209 /* "PHRASE SCRIPT" */}, // 11 + {FzName: ts + 2223 /* "xSetAuxdata" */, FnArg: 1, FzMsg: ts + 2235 /* "VALUE" */}, // 12 + {FzName: ts + 2241 /* "xGetAuxdata" */, FnArg: 1, FzMsg: ts + 2253 /* "CLEAR" */}, // 13 + {FzName: ts + 2259 /* "xSetAuxdataInt" */, FnArg: 1, FzMsg: ts + 2274 /* "INTEGER" */}, // 14 + {FzName: ts + 2282 /* "xGetAuxdataInt" */, FnArg: 1, FzMsg: ts + 2253 /* "CLEAR" */}, // 15 + {FzName: ts + 2297 /* "xPhraseForeach" */, FnArg: 4, FzMsg: ts + 2312 /* "IPHRASE COLVAR O..." */}, // 16 + {FzName: ts + 2341 /* "xPhraseColumnFor..." */, FnArg: 3, FzMsg: ts + 2362 /* "IPHRASE COLVAR S..." */}, // 17 {}, } var rc int32 @@ -11650,12 +11719,12 @@ func xF5tApi(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv var p uintptr = clientData if objc < 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2383 /* "SUB-COMMAND" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2384 /* "SUB-COMMAND" */) return TCL_ERROR } rc = tcl.XTcl_GetIndexFromObjStruct(tls, - interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+32 /* &aSub[0] */, int32(unsafe.Sizeof(Sub{})), ts+2383 /* "SUB-COMMAND" */, 0, bp+488 /* &iSub */) + interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+32 /* &aSub[0] */, int32(unsafe.Sizeof(Sub{})), ts+2384 /* "SUB-COMMAND" */, 0, bp+488 /* &iSub */) if rc != TCL_OK { return rc } @@ -11842,7 +11911,7 @@ func xF5tApi(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv { var pData uintptr = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(F5tAuxData{}))) if pData == uintptr(0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+1929 /* "out of memory" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+1930 /* "out of memory" */, 0)) return TCL_ERROR } (*F5tAuxData)(unsafe.Pointer(pData)).FpObj = *(*uintptr)(unsafe.Pointer(objv + 2*8)) @@ -12017,7 +12086,7 @@ func xF5tFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal (*F5tApi)(unsafe.Pointer(bp + 72 /* &sApi */)).FpApi = pApi (*F5tApi)(unsafe.Pointer(bp + 72 /* &sApi */)).FpFts = pFts - libc.Xsprintf(tls, bp+8 /* &zCmd[0] */, ts+2395 /* "f5t_%lld" */, libc.VaList(bp, libc.PostIncInt64(&iCmd2, 1))) + libc.Xsprintf(tls, bp+8 /* &zCmd[0] */, ts+2396 /* "f5t_%lld" */, libc.VaList(bp, libc.PostIncInt64(&iCmd2, 1))) tcl.XTcl_CreateObjCommand(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, bp+8 /* &zCmd[0] */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{xF5tApi})), bp+72 /* &sApi */, uintptr(0)) @@ -12067,23 +12136,23 @@ func xF5tFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal if (*Tcl_Obj)(unsafe.Pointer(pVar)).FtypePtr != 0 { return (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pVar)).FtypePtr)).Fname } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }() var c int8 = *(*int8)(unsafe.Pointer(zType)) - if ((int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2404 /* "bytearray" */) == 0)) && ((*Tcl_Obj)(unsafe.Pointer(pVar)).Fbytes == uintptr(0)) { + if ((int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2405 /* "bytearray" */) == 0)) && ((*Tcl_Obj)(unsafe.Pointer(pVar)).Fbytes == uintptr(0)) { // Only return a BLOB type if the Tcl variable is a bytearray and // has no string representation. var data uintptr = tcl.XTcl_GetByteArrayFromObj(tls, pVar, bp+88 /* &n */) sqlite3.Xsqlite3_result_blob(tls, pCtx, data, *(*int32)(unsafe.Pointer(bp + 88 /* n */)), libc.UintptrFromInt32(-1)) - } else if (int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2414 /* "boolean" */) == 0) { + } else if (int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2415 /* "boolean" */) == 0) { tcl.XTcl_GetIntFromObj(tls, uintptr(0), pVar, bp+88 /* &n */) sqlite3.Xsqlite3_result_int(tls, pCtx, *(*int32)(unsafe.Pointer(bp + 88 /* n */))) - } else if (int32(c) == 'd') && (libc.Xstrcmp(tls, zType, ts+2422 /* "double" */) == 0) { + } else if (int32(c) == 'd') && (libc.Xstrcmp(tls, zType, ts+2423 /* "double" */) == 0) { // var r float64 at bp+96, 8 tcl.XTcl_GetDoubleFromObj(tls, uintptr(0), pVar, bp+96 /* &r */) sqlite3.Xsqlite3_result_double(tls, pCtx, *(*float64)(unsafe.Pointer(bp + 96 /* r */))) - } else if ((int32(c) == 'w') && (libc.Xstrcmp(tls, zType, ts+2429 /* "wideInt" */) == 0)) || ((int32(c) == 'i') && (libc.Xstrcmp(tls, zType, ts+2437 /* "int" */) == 0)) { + } else if ((int32(c) == 'w') && (libc.Xstrcmp(tls, zType, ts+2430 /* "wideInt" */) == 0)) || ((int32(c) == 'i') && (libc.Xstrcmp(tls, zType, ts+2438 /* "int" */) == 0)) { // var v Tcl_WideInt at bp+104, 8 tcl.XTcl_GetWideIntFromObj(tls, uintptr(0), pVar, bp+104 /* &v */) @@ -12123,7 +12192,7 @@ func f5tCreateFunction(tls *libc.TLS, clientData uintptr, interp uintptr, objc i var rc int32 if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2441 /* "DB NAME SCRIPT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2442 /* "DB NAME SCRIPT" */) return TCL_ERROR } if f5tDbAndApi(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+24 /* &db */, bp+32 /* &pApi */) != 0 { @@ -12142,7 +12211,7 @@ func f5tCreateFunction(tls *libc.TLS, clientData uintptr, interp uintptr, objc i f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) }{xF5tFunction})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{xF5tDestroy}))) if rc != SQLITE_OK { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+2013 /* "error: " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* db */))), 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+2014 /* "error: " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* db */))), 0)) return TCL_ERROR } @@ -12198,13 +12267,13 @@ func f5tTokenize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // var ctx F5tTokenizeCtx at bp+176, 24 if (objc != 4) && (objc != 5) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2456 /* "?-subst? DB NAME..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2457 /* "?-subst? DB NAME..." */) return TCL_ERROR } if objc == 5 { var zOpt uintptr = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) - if libc.Xstrcmp(tls, ts+2478 /* "-subst" */, zOpt) != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+2485 /* "unrecognized opt..." */, zOpt, 0)) + if libc.Xstrcmp(tls, ts+2479 /* "-subst" */, zOpt) != 0 { + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+2486 /* "unrecognized opt..." */, zOpt, 0)) return TCL_ERROR } } @@ -12215,7 +12284,7 @@ func f5tTokenize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, return TCL_ERROR } if *(*int32)(unsafe.Pointer(bp + 112 /* nArg */)) == 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+2507 /* "no such tokenize..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+2508 /* "no such tokenize..." */, 0)) tcl.XTcl_Free(tls, *(*uintptr)(unsafe.Pointer(bp + 120 /* azArg */))) return TCL_ERROR } @@ -12223,13 +12292,13 @@ func f5tTokenize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 104 /* pApi */)) + 16 /* &.xFindTokenizer */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 104 /* pApi */)), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 120 /* azArg */)))), bp+136 /* &pUserdata */, bp+144 /* &tokenizer */) if rc != SQLITE_OK { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, ts+2507 /* "no such tokenize..." */, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 120 /* azArg */)))), 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, ts+2508 /* "no such tokenize..." */, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 120 /* azArg */)))), 0)) return TCL_ERROR } rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((bp + 144 /* &tokenizer */ /* &.xCreate */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 136 /* pUserdata */)), (*(*uintptr)(unsafe.Pointer(bp + 120 /* azArg */)) + 1*8), (*(*int32)(unsafe.Pointer(bp + 112 /* nArg */)) - 1), bp+168 /* &pTok */) if rc != SQLITE_OK { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, ts+2527 /* "error in tokeniz..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, ts+2528 /* "error in tokeniz..." */, 0)) return TCL_ERROR } @@ -12244,7 +12313,7 @@ func f5tTokenize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, }{xTokenizeCb2}))) (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((bp + 144 /* &tokenizer */ + 8 /* &.xDelete */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pTok */))) if rc != SQLITE_OK { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+80, ts+2556 /* "error in tokeniz..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+80, ts+2557 /* "error in tokeniz..." */, 0)) for ok := true; ok; ok = 0 != 0 { var _objPtr uintptr = pRet if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 { @@ -12360,20 +12429,20 @@ func f5tTokenizerTokenize(tls *libc.TLS, p uintptr, pCtx uintptr, flags int32, p (*Tcl_Obj)(unsafe.Pointer(pEval)).FrefCount++ switch flags { case FTS5_TOKENIZE_DOCUMENT: - zFlags = ts + 2587 /* "document" */ + zFlags = ts + 2588 /* "document" */ break case FTS5_TOKENIZE_AUX: - zFlags = ts + 2596 /* "aux" */ + zFlags = ts + 2597 /* "aux" */ break case FTS5_TOKENIZE_QUERY: - zFlags = ts + 2600 /* "query" */ + zFlags = ts + 2601 /* "query" */ break case (FTS5_TOKENIZE_PREFIX | FTS5_TOKENIZE_QUERY): - zFlags = ts + 2606 /* "prefixquery" */ + zFlags = ts + 2607 /* "prefixquery" */ break default: - zFlags = ts + 2618 /* "invalid" */ + zFlags = ts + 2619 /* "invalid" */ break } @@ -12417,7 +12486,7 @@ func f5tTokenizerReturn(tls *libc.TLS, clientData uintptr, interp uintptr, objc goto __1 } zArg = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16 /* &nArg */) - if !(((*(*int32)(unsafe.Pointer(bp + 16 /* nArg */)) <= 10) && (*(*int32)(unsafe.Pointer(bp + 16 /* nArg */)) >= 2)) && (libc.Xmemcmp(tls, ts+2626 /* "-colocated" */, zArg, uint64(*(*int32)(unsafe.Pointer(bp + 16 /* nArg */)))) == 0)) { + if !(((*(*int32)(unsafe.Pointer(bp + 16 /* nArg */)) <= 10) && (*(*int32)(unsafe.Pointer(bp + 16 /* nArg */)) >= 2)) && (libc.Xmemcmp(tls, ts+2627 /* "-colocated" */, zArg, uint64(*(*int32)(unsafe.Pointer(bp + 16 /* nArg */)))) == 0)) { goto __3 } tflags = tflags | (FTS5_TOKEN_COLOCATED) @@ -12450,7 +12519,7 @@ __6: goto __7 } tcl.XTcl_AppendResult(tls, interp, - libc.VaList(bp, ts+2637 /* "sqlite3_fts5_tok..." */, 0)) + libc.VaList(bp, ts+2638 /* "sqlite3_fts5_tok..." */, 0)) return TCL_ERROR __7: ; @@ -12463,7 +12532,7 @@ __7: return TCL_ERROR usage: - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2695 /* "?-colocated? TEX..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2696 /* "?-colocated? TEX..." */) return TCL_ERROR } @@ -12509,7 +12578,7 @@ func f5tCreateTokenizer(tls *libc.TLS, clientData ClientData, interp uintptr, ob var rc int32 if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2441 /* "DB NAME SCRIPT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2442 /* "DB NAME SCRIPT" */) return TCL_ERROR } if f5tDbAndApi(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16 /* &db */, bp+24 /* &pApi */) != 0 { @@ -12533,7 +12602,7 @@ func f5tCreateTokenizer(tls *libc.TLS, clientData ClientData, interp uintptr, ob (*Tcl_Obj)(unsafe.Pointer(pScript)).FrefCount++ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 24 /* pApi */)) + 8 /* &.xCreateTokenizer */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pApi */)), zName, pMod, bp+32 /* &t */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{f5tDelTokenizer}))) if rc != SQLITE_OK { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+2723 /* "error in fts5_ap..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+2724 /* "error in fts5_ap..." */, 0)) return TCL_ERROR } @@ -12554,7 +12623,7 @@ func f5tMayBeCorrupt(tls *libc.TLS, clientData uintptr, interp uintptr, objc int var bOld int32 = sqlite3.Xsqlite3_fts5_may_be_corrupt if (objc != 2) && (objc != 1) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2760 /* "?BOOLEAN?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2761 /* "?BOOLEAN?" */) return TCL_ERROR } if objc == 2 { @@ -12590,7 +12659,7 @@ func f5tTokenHash(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // var nSlot int32 at bp, 4 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2770 /* "NSLOT TOKEN" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2771 /* "NSLOT TOKEN" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &nSlot */) != 0 { @@ -12611,7 +12680,7 @@ func f5tRegisterMatchinfo(tls *libc.TLS, clientData uintptr, interp uintptr, obj *(*uintptr)(unsafe.Pointer(bp /* db */)) = uintptr(0) if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if f5tDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &db */) != 0 { @@ -12635,7 +12704,7 @@ func f5tRegisterTok(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 *(*uintptr)(unsafe.Pointer(bp + 8 /* pApi */)) = uintptr(0) if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if f5tDbAndApi(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &db */, bp+8 /* &pApi */) != 0 { @@ -12701,14 +12770,14 @@ var aCmd = [8]struct { FbTokenizeCtx int32 _ [4]byte }{ - {FzName: ts + 2782 /* "sqlite3_fts5_cre..." */, FxProc: 0, FbTokenizeCtx: 1}, - {FzName: ts + 2812 /* "sqlite3_fts5_tok..." */, FxProc: 0, FbTokenizeCtx: 1}, - {FzName: ts + 2831 /* "sqlite3_fts5_tok..." */, FxProc: 0}, - {FzName: ts + 2853 /* "sqlite3_fts5_cre..." */, FxProc: 0}, - {FzName: ts + 2882 /* "sqlite3_fts5_may..." */, FxProc: 0}, - {FzName: ts + 2910 /* "sqlite3_fts5_tok..." */, FxProc: 0}, - {FzName: ts + 2934 /* "sqlite3_fts5_reg..." */, FxProc: 0}, - {FzName: ts + 2966 /* "sqlite3_fts5_reg..." */, FxProc: 0}, + {FzName: ts + 2783 /* "sqlite3_fts5_cre..." */, FxProc: 0, FbTokenizeCtx: 1}, + {FzName: ts + 2813 /* "sqlite3_fts5_tok..." */, FxProc: 0, FbTokenizeCtx: 1}, + {FzName: ts + 2832 /* "sqlite3_fts5_tok..." */, FxProc: 0}, + {FzName: ts + 2854 /* "sqlite3_fts5_cre..." */, FxProc: 0}, + {FzName: ts + 2883 /* "sqlite3_fts5_may..." */, FxProc: 0}, + {FzName: ts + 2911 /* "sqlite3_fts5_tok..." */, FxProc: 0}, + {FzName: ts + 2935 /* "sqlite3_fts5_reg..." */, FxProc: 0}, + {FzName: ts + 2967 /* "sqlite3_fts5_reg..." */, FxProc: 0}, } /* fts5_tcl.c:1124:5 */ type Fts5MatchinfoCtx1 = struct { @@ -12735,9 +12804,9 @@ func fts5_api_from_db(tls *libc.TLS, db uintptr, ppApi uintptr) int32 { /* fts5_ var rc int32 *(*uintptr)(unsafe.Pointer(ppApi)) = uintptr(0) - rc = sqlite3.Xsqlite3_prepare(tls, db, ts+1997 /* "SELECT fts5(?1)" */, -1, bp /* &pStmt */, uintptr(0)) + rc = sqlite3.Xsqlite3_prepare(tls, db, ts+1998 /* "SELECT fts5(?1)" */, -1, bp /* &pStmt */, uintptr(0)) if rc == SQLITE_OK { - sqlite3.Xsqlite3_bind_pointer(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 1, ppApi, ts+2021 /* "fts5_api_ptr" */, uintptr(0)) + sqlite3.Xsqlite3_bind_pointer(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 1, ppApi, ts+2022 /* "fts5_api_ptr" */, uintptr(0)) sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) rc = sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) } @@ -13029,7 +13098,7 @@ func fts5MatchinfoNew(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, z for i = 0; *(*int8)(unsafe.Pointer(zArg + uintptr(i))) != 0; i++ { var n int32 = fts5MatchinfoFlagsize(tls, nCol, nPhrase, *(*int8)(unsafe.Pointer(zArg + uintptr(i)))) if n < 0 { - var zErr uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+3001 /* "unrecognized mat..." */, libc.VaList(bp, int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))))) + var zErr uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+3002 /* "unrecognized mat..." */, libc.VaList(bp, int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))))) sqlite3.Xsqlite3_result_error(tls, pCtx, zErr, -1) sqlite3.Xsqlite3_free(tls, zErr) return uintptr(0) @@ -13074,7 +13143,7 @@ func fts5MatchinfoFunc(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if nVal > 0 { zArg = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal))) } else { - zArg = ts + 3033 /* "pcx" */ + zArg = ts + 3034 /* "pcx" */ } p = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer((pApi + 120 /* &.xGetAuxdata */))))(tls, pFts, 0) @@ -13127,7 +13196,7 @@ func sqlite3Fts5TestRegisterMatchinfo(tls *libc.TLS, db uintptr) int32 { /* fts5 } // Register the implementation of matchinfo() - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, fts5_extension_function, uintptr) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pApi */)) + 24 /* &.xCreateFunction */))))(tls, *(*uintptr)(unsafe.Pointer(bp /* pApi */)), ts+3037 /* "matchinfo" */, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, fts5_extension_function, uintptr) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pApi */)) + 24 /* &.xCreateFunction */))))(tls, *(*uintptr)(unsafe.Pointer(bp /* pApi */)), ts+3038 /* "matchinfo" */, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) }{fts5MatchinfoFunc})), uintptr(0)) @@ -13350,7 +13419,7 @@ func fts5tokConnectMethod(tls *libc.TLS, db uintptr, pCtx uintptr, argc int32, a var nDequote int32 = 0 rc = sqlite3.Xsqlite3_declare_vtab(tls, db, - ts+3047 /* "CREATE TABLE x(i..." */) + ts+3048 /* "CREATE TABLE x(i..." */) if rc == SQLITE_OK { nDequote = (argc - 3) @@ -13375,7 +13444,12 @@ func fts5tokConnectMethod(tls *libc.TLS, db uintptr, pCtx uintptr, argc int32, a rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 16 /* &.xFindTokenizer */))))(tls, pApi, zModule, bp+8 /* &pTokCtx */, (pTab + 24 /* &.tok */)) if rc == SQLITE_OK { - var azArg uintptr = (*(*uintptr)(unsafe.Pointer(bp /* azDequote */)) + 1*8) + var azArg uintptr = func() uintptr { + if nDequote > 1 { + return (*(*uintptr)(unsafe.Pointer(bp /* azDequote */)) + 1*8) + } + return uintptr(0) + }() var nArg int32 if nDequote > 0 { nArg = (nDequote - 1) @@ -13591,7 +13665,7 @@ func fts5tokRowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { func sqlite3Fts5TestRegisterTok(tls *libc.TLS, db uintptr, pApi uintptr) int32 { /* fts5_test_tok.c:450:5: */ var rc int32 // Return code - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+3105 /* "fts5tokenize" */, uintptr(unsafe.Pointer(&fts5tok_module)), pApi) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+3106 /* "fts5tokenize" */, uintptr(unsafe.Pointer(&fts5tok_module)), pApi) return rc } @@ -13616,11 +13690,551 @@ var fts5tok_module = sqlite3_module{ // iVersion // the third parameter to entry points of [loadable extensions]. This // structure must be typedefed in order to work around compiler warnings // on some platforms. -type sqlite3_api_routines = sqlite3_api_routines1 /* sqlite3.h:1196:37 */ +type sqlite3_api_routines = sqlite3_api_routines1 /* sqlite3.h:1197:37 */ // This is the function signature used for all extension entry points. It // is also defined in the file "loadext.c". -type sqlite3_loadext_entry = uintptr /* sqlite3ext.h:344:13 */ +type sqlite3_loadext_entry = uintptr /* sqlite3ext.h:346:13 */ + +// Copyright (C) 1991-2018 Free Software Foundation, Inc. +// This file is part of the GNU C Library. +// +// The GNU C Library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// The GNU C Library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with the GNU C Library; if not, see +// . + +// ISO C99 Standard: 7.2 Diagnostics + +// Copyright (C) 1991-2018 Free Software Foundation, Inc. +// This file is part of the GNU C Library. +// +// The GNU C Library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// The GNU C Library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with the GNU C Library; if not, see +// . + +// void assert (int expression); +// +// If NDEBUG is defined, do nothing. +// If not, and EXPRESSION is zero, print an error message and abort. + +// void assert_perror (int errnum); +// +// If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an +// error message with the error text for ERRNUM and abort. +// (This is a GNU extension.) + +// The append mark at the end of the database is: +// +// Start-Of-SQLite3-NNNNNNNN +// 123456789 123456789 12345 +// +// The NNNNNNNN represents a 64-bit big-endian unsigned integer which is +// the offset to page 1, and also the length of the prefix content. + +// Maximum size of the combined prefix + database + append-mark. This +// must be less than 0x40000000 to avoid locking issues on Windows. + +// Size of storage page upon which to align appendvfs portion. + +// Forward declaration of objects used by this utility +type ApndVfs = sqlite3_vfs1 /* appendvfs.c:83:28 */ +type ApndFile1 = struct { + Fbase sqlite3_file + FiPgOne sqlite3_int64 + FiMark sqlite3_int64 +} /* appendvfs.c:84:9 */ + +type ApndFile = ApndFile1 /* appendvfs.c:84:25 */ + +var apnd_vfs = sqlite3_vfs{ + FiVersion: 3, // szOsFile (set when registered) + FmxPathname: 1024, // pNext + FzName: ts + 3119, /* "apndvfs" */ /* pAppData (set when registered) */ + FxOpen: 0, // xOpen + FxDelete: 0, // xDelete + FxAccess: 0, // xAccess + FxFullPathname: 0, // xFullPathname + FxDlOpen: 0, // xDlOpen + FxDlError: 0, // xDlError + FxDlSym: 0, // xDlSym + FxDlClose: 0, // xDlClose + FxRandomness: 0, // xRandomness + FxSleep: 0, // xSleep + FxCurrentTime: 0, // xCurrentTime + FxGetLastError: 0, // xGetLastError + FxCurrentTimeInt64: 0, // xCurrentTimeInt64 + FxSetSystemCall: 0, // xSetSystemCall + FxGetSystemCall: 0, // xGetSystemCall + FxNextSystemCall: 0, // xNextSystemCall +} /* appendvfs.c:169:20 */ + +var apnd_io_methods = sqlite3_io_methods{ + FiVersion: 3, // iVersion + FxClose: 0, // xClose + FxRead: 0, // xRead + FxWrite: 0, // xWrite + FxTruncate: 0, // xTruncate + FxSync: 0, // xSync + FxFileSize: 0, // xFileSize + FxLock: 0, // xLock + FxUnlock: 0, // xUnlock + FxCheckReservedLock: 0, // xCheckReservedLock + FxFileControl: 0, // xFileControl + FxSectorSize: 0, // xSectorSize + FxDeviceCharacteristics: 0, // xDeviceCharacteristics + FxShmMap: 0, // xShmMap + FxShmLock: 0, // xShmLock + FxShmBarrier: 0, // xShmBarrier + FxShmUnmap: 0, // xShmUnmap + FxFetch: 0, // xFetch + FxUnfetch: 0, // xUnfetch +} /* appendvfs.c:194:33 */ + +// Close an apnd-file. +func apndClose(tls *libc.TLS, pFile uintptr) int32 { /* appendvfs.c:219:12: */ + pFile = ((pFile) + uintptr(1)*24) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 8 /* &.xClose */))))(tls, pFile) +} + +// Read data from an apnd-file. +func apndRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* appendvfs.c:227:12: */ + var paf uintptr = pFile + pFile = ((pFile) + uintptr(1)*24) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 16 /* &.xRead */))))(tls, pFile, zBuf, iAmt, ((*ApndFile)(unsafe.Pointer(paf)).FiPgOne + iOfst)) +} + +// Add the append-mark onto what should become the end of the file. +// If and only if this succeeds, internal ApndFile.iMark is updated. +// Parameter iWriteEnd is the appendvfs-relative offset of the new mark. +func apndWriteMark(tls *libc.TLS, paf uintptr, pFile uintptr, iWriteEnd sqlite_int64) int32 { /* appendvfs.c:243:12: */ + bp := tls.Alloc(25) + defer tls.Free(25) + + var iPgOne sqlite_int64 = (*ApndFile)(unsafe.Pointer(paf)).FiPgOne + // var a [25]uint8 at bp, 25 + + var i int32 = APND_MARK_FOS_SZ + var rc int32 + + libc.Xmemcpy(tls, bp /* &a[0] */, ts+3127 /* "Start-Of-SQLite3..." */, uint64(APND_MARK_PREFIX_SZ)) + for libc.PreDecInt32(&i, 1) >= 0 { + *(*uint8)(unsafe.Pointer(bp /* &a[0] */ + uintptr((APND_MARK_PREFIX_SZ + i)))) = (uint8(iPgOne & int64(0xff))) + iPgOne >>= 8 + } + iWriteEnd = iWriteEnd + ((*ApndFile)(unsafe.Pointer(paf)).FiPgOne) + if SQLITE_OK == (libc.AssignInt32(&rc, (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 24 /* &.xWrite */))))(tls, pFile, bp /* &a[0] */, (APND_MARK_PREFIX_SZ+APND_MARK_FOS_SZ), iWriteEnd))) { + (*ApndFile)(unsafe.Pointer(paf)).FiMark = iWriteEnd + } + return rc +} + +// Write data to an apnd-file. +func apndWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* appendvfs.c:269:12: */ + var paf uintptr = pFile + var iWriteEnd sqlite_int64 = (iOfst + sqlite_int64(iAmt)) + if iWriteEnd >= (int64(65536 * 15259)) { + return SQLITE_FULL + } + pFile = ((pFile) + uintptr(1)*24) + // If append-mark is absent or will be overwritten, write it. + if ((*ApndFile)(unsafe.Pointer(paf)).FiMark < int64(0)) || (((*ApndFile)(unsafe.Pointer(paf)).FiPgOne + iWriteEnd) > (*ApndFile)(unsafe.Pointer(paf)).FiMark) { + var rc int32 = apndWriteMark(tls, paf, pFile, iWriteEnd) + if SQLITE_OK != rc { + return rc + } + } + return (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 24 /* &.xWrite */))))(tls, pFile, zBuf, iAmt, ((*ApndFile)(unsafe.Pointer(paf)).FiPgOne + iOfst)) +} + +// Truncate an apnd-file. +func apndTruncate(tls *libc.TLS, pFile uintptr, size sqlite_int64) int32 { /* appendvfs.c:291:12: */ + var paf uintptr = pFile + pFile = ((pFile) + uintptr(1)*24) + // The append mark goes out first so truncate failure does not lose it. + if SQLITE_OK != apndWriteMark(tls, paf, pFile, size) { + return SQLITE_IOERR + } + // Truncate underlying file just past append mark + return (*(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 32 /* &.xTruncate */))))(tls, pFile, ((*ApndFile)(unsafe.Pointer(paf)).FiMark + (int64(APND_MARK_PREFIX_SZ + APND_MARK_FOS_SZ)))) +} + +// Sync an apnd-file. +func apndSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* appendvfs.c:304:12: */ + pFile = ((pFile) + uintptr(1)*24) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 40 /* &.xSync */))))(tls, pFile, flags) +} + +// Return the current file-size of an apnd-file. +// If the append mark is not yet there, the file-size is 0. +func apndFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* appendvfs.c:313:12: */ + var paf uintptr = pFile + *(*sqlite_int64)(unsafe.Pointer(pSize)) = func() int64 { + if (*ApndFile)(unsafe.Pointer(paf)).FiMark >= int64(0) { + return ((*ApndFile)(unsafe.Pointer(paf)).FiMark - (*ApndFile)(unsafe.Pointer(paf)).FiPgOne) + } + return int64(0) + }() + return SQLITE_OK +} + +// Lock an apnd-file. +func apndLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* appendvfs.c:322:12: */ + pFile = ((pFile) + uintptr(1)*24) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 56 /* &.xLock */))))(tls, pFile, eLock) +} + +// Unlock an apnd-file. +func apndUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* appendvfs.c:330:12: */ + pFile = ((pFile) + uintptr(1)*24) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 64 /* &.xUnlock */))))(tls, pFile, eLock) +} + +// Check if another file-handle holds a RESERVED lock on an apnd-file. +func apndCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* appendvfs.c:338:12: */ + pFile = ((pFile) + uintptr(1)*24) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, pFile, pResOut) +} + +// File control method. For custom operations on an apnd-file. +func apndFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* appendvfs.c:346:12: */ + bp := tls.Alloc(16) + defer tls.Free(16) + + var paf uintptr = pFile + var rc int32 + pFile = ((pFile) + uintptr(1)*24) + if op == SQLITE_FCNTL_SIZE_HINT { + *(*sqlite3_int64)(unsafe.Pointer(pArg)) += ((*ApndFile)(unsafe.Pointer(paf)).FiPgOne) + } + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 80 /* &.xFileControl */))))(tls, pFile, op, pArg) + if (rc == SQLITE_OK) && (op == SQLITE_FCNTL_VFSNAME) { + *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+3145 /* "apnd(%lld)/%z" */, libc.VaList(bp, (*ApndFile)(unsafe.Pointer(paf)).FiPgOne, *(*uintptr)(unsafe.Pointer(pArg)))) + } + return rc +} + +// Return the sector-size in bytes for an apnd-file. +func apndSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* appendvfs.c:361:12: */ + pFile = ((pFile) + uintptr(1)*24) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 88 /* &.xSectorSize */))))(tls, pFile) +} + +// Return the device characteristic flags supported by an apnd-file. +func apndDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* appendvfs.c:369:12: */ + pFile = ((pFile) + uintptr(1)*24) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, pFile) +} + +// Create a shared memory file mapping +func apndShmMap(tls *libc.TLS, pFile uintptr, iPg int32, pgsz int32, bExtend int32, pp uintptr) int32 { /* appendvfs.c:375:12: */ + pFile = ((pFile) + uintptr(1)*24) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 104 /* &.xShmMap */))))(tls, pFile, iPg, pgsz, bExtend, libc.AtomicLoadUintptr(&pp)) +} + +// Perform locking on a shared-memory segment +func apndShmLock(tls *libc.TLS, pFile uintptr, offset int32, n int32, flags int32) int32 { /* appendvfs.c:387:12: */ + pFile = ((pFile) + uintptr(1)*24) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 112 /* &.xShmLock */))))(tls, pFile, offset, n, flags) +} + +// Memory barrier operation on shared memory +func apndShmBarrier(tls *libc.TLS, pFile uintptr) { /* appendvfs.c:393:13: */ + pFile = ((pFile) + uintptr(1)*24) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 120 /* &.xShmBarrier */))))(tls, pFile) +} + +// Unmap a shared memory segment +func apndShmUnmap(tls *libc.TLS, pFile uintptr, deleteFlag int32) int32 { /* appendvfs.c:399:12: */ + pFile = ((pFile) + uintptr(1)*24) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 128 /* &.xShmUnmap */))))(tls, pFile, deleteFlag) +} + +// Fetch a page of a memory-mapped file +func apndFetch(tls *libc.TLS, pFile uintptr, iOfst sqlite3_int64, iAmt int32, pp uintptr) int32 { /* appendvfs.c:405:12: */ + var p uintptr = pFile + if ((*ApndFile)(unsafe.Pointer(p)).FiMark < int64(0)) || ((iOfst + sqlite3_int64(iAmt)) > (*ApndFile)(unsafe.Pointer(p)).FiMark) { + return SQLITE_IOERR + } // Cannot read what is not yet there. + pFile = ((pFile) + uintptr(1)*24) + return (*(*func(*libc.TLS, uintptr, sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 136 /* &.xFetch */))))(tls, pFile, (iOfst + (*ApndFile)(unsafe.Pointer(p)).FiPgOne), iAmt, pp) +} + +// Release a memory-mapped page +func apndUnfetch(tls *libc.TLS, pFile uintptr, iOfst sqlite3_int64, pPage uintptr) int32 { /* appendvfs.c:419:12: */ + var p uintptr = pFile + pFile = ((pFile) + uintptr(1)*24) + return (*(*func(*libc.TLS, uintptr, sqlite3_int64, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 144 /* &.xUnfetch */))))(tls, pFile, (iOfst + (*ApndFile)(unsafe.Pointer(p)).FiPgOne), pPage) +} + +// Try to read the append-mark off the end of a file. Return the +// start of the appended database if the append-mark is present. +// If there is no valid append-mark, return -1; +// +// An append-mark is only valid if the NNNNNNNN start-of-database offset +// indicates that the appended database contains at least one page. The +// start-of-database value must be a multiple of 512. +func apndReadMark(tls *libc.TLS, sz sqlite3_int64, pFile uintptr) sqlite3_int64 { /* appendvfs.c:434:22: */ + bp := tls.Alloc(25) + defer tls.Free(25) + + var rc int32 + var i int32 + var iMark sqlite3_int64 + var msbs int32 = (8 * (APND_MARK_FOS_SZ - 1)) + // var a [25]uint8 at bp, 25 + + if (int64(APND_MARK_PREFIX_SZ + APND_MARK_FOS_SZ)) != (sz & int64(0x1ff)) { + return int64(-1) + } + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 16 /* &.xRead */))))(tls, pFile, bp /* &a[0] */, (APND_MARK_PREFIX_SZ + APND_MARK_FOS_SZ), (sz - (int64(APND_MARK_PREFIX_SZ + APND_MARK_FOS_SZ)))) + if rc != 0 { + return int64(-1) + } + if libc.Xmemcmp(tls, bp /* &a[0] */, ts+3127 /* "Start-Of-SQLite3..." */, uint64(APND_MARK_PREFIX_SZ)) != 0 { + return int64(-1) + } + iMark = ((sqlite3_int64(int32(*(*uint8)(unsafe.Pointer(bp /* &a[0] */ + 17))) & 0x7f)) << msbs) + for i = 1; i < 8; i++ { + msbs = msbs - (8) + iMark = iMark | (sqlite3_int64(*(*uint8)(unsafe.Pointer(bp /* &a[0] */ + uintptr((APND_MARK_PREFIX_SZ + i))))) << msbs) + } + if iMark > ((sz - (int64(APND_MARK_PREFIX_SZ + APND_MARK_FOS_SZ))) - int64(512)) { + return int64(-1) + } + if (iMark & int64(0x1ff)) != 0 { + return int64(-1) + } + return iMark +} + +var apvfsSqliteHdr = *(*[16]int8)(unsafe.Pointer(ts + 3159 /* "SQLite format 3" */)) /* appendvfs.c:454:19 */ + +// Check to see if the file is an appendvfs SQLite database file. +// Return true iff it is such. Parameter sz is the file's size. +func apndIsAppendvfsDatabase(tls *libc.TLS, sz sqlite3_int64, pFile uintptr) int32 { /* appendvfs.c:459:12: */ + bp := tls.Alloc(16) + defer tls.Free(16) + + var rc int32 + // var zHdr [16]int8 at bp, 16 + + var iMark sqlite3_int64 = apndReadMark(tls, sz, pFile) + if iMark >= int64(0) { + // If file has right end-marker, the expected odd size, and the + // SQLite DB type marker where the end-marker puts it, then it + // is an appendvfs database (to be treated as such.) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 16 /* &.xRead */))))(tls, pFile, bp /* &zHdr[0] */, int32(unsafe.Sizeof([16]int8{})), iMark) + if (((SQLITE_OK == rc) && (libc.Xmemcmp(tls, bp /* &zHdr[0] */, uintptr(unsafe.Pointer(&apvfsSqliteHdr)), uint64(unsafe.Sizeof([16]int8{}))) == 0)) && + ((sz & int64(0x1ff)) == (int64(APND_MARK_PREFIX_SZ + APND_MARK_FOS_SZ)))) && (sz >= (int64(512 + (APND_MARK_PREFIX_SZ + APND_MARK_FOS_SZ)))) { + return 1 + } // It's an appendvfs database + } + return 0 +} + +// Check to see if the file is an ordinary SQLite database file. +// Return true iff so. Parameter sz is the file's size. +func apndIsOrdinaryDatabaseFile(tls *libc.TLS, sz sqlite3_int64, pFile uintptr) int32 { /* appendvfs.c:480:12: */ + bp := tls.Alloc(16) + defer tls.Free(16) + + // var zHdr [16]int8 at bp, 16 + + if (((apndIsAppendvfsDatabase(tls, sz, pFile) != 0) || // rule 2 + ((sz & int64(0x1ff)) != int64(0))) || + (SQLITE_OK != (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 16 /* &.xRead */))))(tls, pFile, bp /* &zHdr[0] */, int32(unsafe.Sizeof([16]int8{})), int64(0)))) || + (libc.Xmemcmp(tls, bp /* &zHdr[0] */, uintptr(unsafe.Pointer(&apvfsSqliteHdr)), uint64(unsafe.Sizeof([16]int8{}))) != 0) { + return 0 + } else { + return 1 + } + return int32(0) +} + +// Round-up used to get appendvfs portion to begin at a page boundary. + +// Open an apnd file handle. +func apndOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* appendvfs.c:501:12: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + var p uintptr + var pSubFile uintptr + var pSubVfs uintptr + var rc int32 + // var sz sqlite3_int64 at bp, 8 + + pSubVfs = (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + if !((flags & SQLITE_OPEN_MAIN_DB) == 0) { + goto __1 + } + // The appendvfs is not to be used for transient or temporary databases. + return (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pSubVfs + 40 /* &.xOpen */))))(tls, pSubVfs, zName, pFile, flags, pOutFlags) +__1: + ; + p = pFile + libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(ApndFile{}))) + pSubFile = ((pFile) + uintptr(1)*24) + (*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods = uintptr(unsafe.Pointer(&apnd_io_methods)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pSubVfs + 40 /* &.xOpen */))))(tls, pSubVfs, zName, pSubFile, flags, pOutFlags) + if !(rc != 0) { + goto __2 + } + goto apnd_open_done +__2: + ; + rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubFile)).FpMethods + 48 /* &.xFileSize */))))(tls, pSubFile, bp /* &sz */) + if !(rc != 0) { + goto __3 + } + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubFile)).FpMethods + 8 /* &.xClose */))))(tls, pSubFile) + goto apnd_open_done +__3: + ; + if !(apndIsOrdinaryDatabaseFile(tls, *(*sqlite3_int64)(unsafe.Pointer(bp /* sz */)), pSubFile) != 0) { + goto __4 + } + libc.Xmemmove(tls, pFile, pSubFile, uint64((*sqlite3_vfs)(unsafe.Pointer(pSubVfs)).FszOsFile)) + return SQLITE_OK +__4: + ; + // Record that append mark has not been written until seen otherwise. + (*ApndFile)(unsafe.Pointer(p)).FiMark = int64(-1) + (*ApndFile)(unsafe.Pointer(p)).FiPgOne = apndReadMark(tls, *(*sqlite3_int64)(unsafe.Pointer(bp /* sz */)), pFile) + if !((*ApndFile)(unsafe.Pointer(p)).FiPgOne >= int64(0)) { + goto __5 + } + // Append mark was found, infer its offset + (*ApndFile)(unsafe.Pointer(p)).FiMark = ((*(*sqlite3_int64)(unsafe.Pointer(bp /* sz */)) - (*ApndFile)(unsafe.Pointer(p)).FiPgOne) - (int64(APND_MARK_PREFIX_SZ + APND_MARK_FOS_SZ))) + return SQLITE_OK +__5: + ; + if !((flags & SQLITE_OPEN_CREATE) == 0) { + goto __6 + } + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubFile)).FpMethods + 8 /* &.xClose */))))(tls, pSubFile) + rc = SQLITE_CANTOPEN +__6: + ; + // Round newly added appendvfs location to #define'd page boundary. + // Note that nothing has yet been written to the underlying file. + // The append mark will be written along with first content write. + // Until then, the p->iMark value indicates it is not yet written. + (*ApndFile)(unsafe.Pointer(p)).FiPgOne = (((*(*sqlite3_int64)(unsafe.Pointer(bp /* sz */))) + (int64((int32(1) << APND_ROUNDUP_BITS) - 1))) & libc.CplInt64((int64((int32(1) << APND_ROUNDUP_BITS) - 1)))) +apnd_open_done: + if !(rc != 0) { + goto __7 + } + (*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods = uintptr(0) +__7: + ; + return rc +} + +// Delete an apnd file. +// For an appendvfs, this could mean delete the appendvfs portion, +// leaving the appendee as it was before it gained an appendvfs. +// For now, this code deletes the underlying file too. +func apndDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* appendvfs.c:562:12: */ + return (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 48 /* &.xDelete */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath, dirSync) +} + +// All other VFS methods are pass-thrus. +func apndAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* appendvfs.c:569:12: */ + return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 56 /* &.xAccess */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath, flags, pResOut) +} + +func apndFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* appendvfs.c:577:12: */ + return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 64 /* &.xFullPathname */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath, nOut, zOut) +} + +func apndDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* appendvfs.c:585:13: */ + return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 72 /* &.xDlOpen */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath) +} + +func apndDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* appendvfs.c:588:13: */ + (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 80 /* &.xDlError */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zErrMsg) +} + +func apndDlSym(tls *libc.TLS, pVfs uintptr, p uintptr, zSym uintptr) uintptr { /* appendvfs.c:591:13: */ + return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 88 /* &.xDlSym */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p, zSym) +} + +func apndDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* appendvfs.c:594:13: */ + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 96 /* &.xDlClose */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, pHandle) +} + +func apndRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* appendvfs.c:597:12: */ + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 104 /* &.xRandomness */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zBufOut) +} + +func apndSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* appendvfs.c:600:12: */ + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 112 /* &.xSleep */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nMicro) +} + +func apndCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* appendvfs.c:603:12: */ + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 120 /* &.xCurrentTime */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, pTimeOut) +} + +func apndGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* appendvfs.c:606:12: */ + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 128 /* &.xGetLastError */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, a, b) +} + +func apndCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, p uintptr) int32 { /* appendvfs.c:609:12: */ + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 136 /* &.xCurrentTimeInt64 */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p) +} + +func apndSetSystemCall(tls *libc.TLS, pVfs uintptr, zName uintptr, pCall sqlite3_syscall_ptr) int32 { /* appendvfs.c:612:12: */ + return (*(*func(*libc.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 144 /* &.xSetSystemCall */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zName, pCall) +} + +func apndGetSystemCall(tls *libc.TLS, pVfs uintptr, zName uintptr) sqlite3_syscall_ptr { /* appendvfs.c:619:28: */ + return (*(*func(*libc.TLS, uintptr, uintptr) sqlite3_syscall_ptr)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 152 /* &.xGetSystemCall */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zName) +} + +func apndNextSystemCall(tls *libc.TLS, pVfs uintptr, zName uintptr) uintptr { /* appendvfs.c:625:19: */ + return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 160 /* &.xNextSystemCall */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zName) +} + +// This routine is called when the extension is loaded. +// Register the new VFS. +func sqlite3_appendvfs_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* appendvfs.c:637:5: */ + var rc int32 = SQLITE_OK + var pOrig uintptr + _ = pApi + + _ = pzErrMsg + _ = db + pOrig = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0)) + apnd_vfs.FiVersion = (*sqlite3_vfs)(unsafe.Pointer(pOrig)).FiVersion + apnd_vfs.FpAppData = pOrig + apnd_vfs.FszOsFile = (int32(uint64((*sqlite3_vfs)(unsafe.Pointer(pOrig)).FszOsFile) + uint64(unsafe.Sizeof(ApndFile{})))) + rc = sqlite3.Xsqlite3_vfs_register(tls, uintptr(unsafe.Pointer(&apnd_vfs)), 0) + if rc == SQLITE_OK { + rc = (SQLITE_OK | (int32(1) << 8)) + } + return rc +} // In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. // are already defined. @@ -13854,11 +14468,6 @@ type idtype_t = uint32 /* waitflags.h:57:3 */ // configurations support _Float128x or, as of GCC 7, have compiler // support for a type meeting the requirements for _Float128x. -// Defined to 1 if the corresponding _FloatN type is not binary compatible -// with the corresponding ISO C type in the current compilation unit as -// opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built -// in glibc. - // Defined to 1 if any _FloatN or _FloatNx types that are not // ABI-distinct are however distinct types at the C language level (so // for the purposes of __builtin_types_compatible_p and _Generic). @@ -13903,28 +14512,29 @@ type u_long = uint64 /* types.h:36:18 */ type quad_t = int64 /* types.h:37:18 */ type u_quad_t = uint64 /* types.h:38:20 */ type fsid_t = struct{ F__val [2]int32 } /* types.h:39:18 */ -type loff_t = int64 /* types.h:42:18 */ -type ino_t = uint64 /* types.h:49:19 */ +type loff_t = int64 /* types.h:44:18 */ -type dev_t = uint64 /* types.h:59:17 */ +type ino_t = uint64 /* types.h:50:19 */ -type gid_t = uint32 /* types.h:64:17 */ +type dev_t = uint64 /* types.h:60:17 */ -type mode_t = uint32 /* types.h:69:18 */ +type gid_t = uint32 /* types.h:65:17 */ -type nlink_t = uint64 /* types.h:74:19 */ +type mode_t = uint32 /* types.h:70:18 */ -type uid_t = uint32 /* types.h:79:17 */ +type nlink_t = uint64 /* types.h:75:19 */ -type pid_t = int32 /* types.h:97:17 */ +type uid_t = uint32 /* types.h:80:17 */ -type id_t = uint32 /* types.h:103:16 */ +type pid_t = int32 /* types.h:98:17 */ -type daddr_t = int32 /* types.h:114:19 */ -type caddr_t = uintptr /* types.h:115:19 */ +type id_t = uint32 /* types.h:104:16 */ -type key_t = int32 /* types.h:121:17 */ +type daddr_t = int32 /* types.h:115:19 */ +type caddr_t = uintptr /* types.h:116:19 */ + +type key_t = int32 /* types.h:122:17 */ // bits/types.h -- definitions of __*_t types underlying *_t types. // Copyright (C) 2002-2018 Free Software Foundation, Inc. @@ -14018,7 +14628,7 @@ type time_t = int64 /* time_t.h:7:18 */ // Timer ID returned by `timer_create'. type timer_t = uintptr /* timer_t.h:7:19 */ -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -14101,9 +14711,9 @@ type timer_t = uintptr /* timer_t.h:7:19 */ // A null pointer constant. // Old compatibility names for C types. -type ulong = uint64 /* types.h:148:27 */ -type ushort = uint16 /* types.h:149:28 */ -type uint = uint32 /* types.h:150:22 */ +type ulong = uint64 /* types.h:149:27 */ +type ushort = uint16 /* types.h:150:28 */ +type uint = uint32 /* types.h:151:22 */ // These size-specific names are used by some of the inet code. @@ -14152,12 +14762,12 @@ type int64_t = int64 /* stdint-intn.h:27:19 */ // For GCC 2.7 and later, we can use specific type-size attributes. -type u_int8_t = uint32 /* types.h:177:1 */ -type u_int16_t = uint32 /* types.h:178:1 */ -type u_int32_t = uint32 /* types.h:179:1 */ -type u_int64_t = uint32 /* types.h:180:1 */ +type u_int8_t = uint32 /* types.h:178:1 */ +type u_int16_t = uint32 /* types.h:179:1 */ +type u_int32_t = uint32 /* types.h:180:1 */ +type u_int64_t = uint32 /* types.h:181:1 */ -type register_t = int32 /* types.h:182:13 */ +type register_t = int32 /* types.h:183:13 */ // A set of signals to be blocked, unblocked, or waited for. type sigset_t = struct{ F__val [16]uint64 } /* sigset_t.h:7:20 */ @@ -14233,14 +14843,12 @@ type fd_set = struct{ F__fds_bits [16]int64 } /* select.h:70:5 */ // Sometimes the fd_set member is assumed to have this type. type fd_mask = int64 /* select.h:77:19 */ -// Define some inlines helping to catch common problems. - -type blksize_t = int64 /* types.h:202:21 */ +type blksize_t = int64 /* types.h:212:21 */ // Types from the Large File Support interface. -type blkcnt_t = int64 /* types.h:222:22 */ // Type to count number of disk blocks. -type fsblkcnt_t = uint64 /* types.h:226:24 */ // Type to count file system blocks. -type fsfilcnt_t = uint64 /* types.h:230:24 */ // Type to count file system inodes. +type blkcnt_t = int64 /* types.h:232:22 */ // Type to count number of disk blocks. +type fsblkcnt_t = uint64 /* types.h:236:24 */ // Type to count file system blocks. +type fsfilcnt_t = uint64 /* types.h:240:24 */ // Type to count file system inodes. // Now add the thread types. // Declaration of common pthread types for all architectures. @@ -14862,10 +15470,10 @@ func amatchLoadOneRule(tls *libc.TLS, p uintptr, pStmt uintptr, ppRule uintptr, var pRule uintptr = uintptr(0) // New rule object to return if zFrom == uintptr(0) { - zFrom = ts + 488 /* "" */ + zFrom = ts + 489 /* "" */ } if zTo == uintptr(0) { - zTo = ts + 488 /* "" */ + zTo = ts + 489 /* "" */ } nFrom = int32(libc.Xstrlen(tls, zFrom)) nTo = int32(libc.Xstrlen(tls, zTo)) @@ -14882,22 +15490,22 @@ func amatchLoadOneRule(tls *libc.TLS, p uintptr, pStmt uintptr, ppRule uintptr, } if (rCost <= 0) || (rCost > AMATCH_MX_COST) { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3118, /* "%s: cost must be..." */ + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3175, /* "%s: cost must be..." */ libc.VaList(bp, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, AMATCH_MX_COST)) rc = SQLITE_ERROR } else if (nFrom > AMATCH_MX_LENGTH) || (nTo > AMATCH_MX_LENGTH) { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3152, /* "%s: maximum stri..." */ + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3209, /* "%s: maximum stri..." */ libc.VaList(bp+16, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, AMATCH_MX_LENGTH)) rc = SQLITE_ERROR - } else if (iLang < int64(0)) || (iLang > AMATCH_MX_LANGID) { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3184, /* "%s: iLang must b..." */ + } else if (iLang < int64(0)) || (iLang > int64(AMATCH_MX_LANGID)) { + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3241, /* "%s: iLang must b..." */ libc.VaList(bp+32, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, AMATCH_MX_LANGID)) rc = SQLITE_ERROR - } else if (libc.Xstrcmp(tls, zFrom, ts+488 /* "" */) == 0) && (libc.Xstrcmp(tls, zTo, ts+3219 /* "?" */) == 0) { + } else if (libc.Xstrcmp(tls, zFrom, ts+489 /* "" */) == 0) && (libc.Xstrcmp(tls, zTo, ts+3276 /* "?" */) == 0) { if ((*amatch_vtab)(unsafe.Pointer(p)).FrIns == 0) || ((*amatch_vtab)(unsafe.Pointer(p)).FrIns > rCost) { (*amatch_vtab)(unsafe.Pointer(p)).FrIns = rCost } - } else if (libc.Xstrcmp(tls, zFrom, ts+3219 /* "?" */) == 0) && (libc.Xstrcmp(tls, zTo, ts+488 /* "" */) == 0) { + } else if (libc.Xstrcmp(tls, zFrom, ts+3276 /* "?" */) == 0) && (libc.Xstrcmp(tls, zTo, ts+489 /* "" */) == 0) { if ((*amatch_vtab)(unsafe.Pointer(p)).FrDel == 0) || ((*amatch_vtab)(unsafe.Pointer(p)).FrDel > rCost) { (*amatch_vtab)(unsafe.Pointer(p)).FrDel = rCost } @@ -14940,7 +15548,7 @@ func amatchLoadRules(tls *libc.TLS, db uintptr, p uintptr, pzErr uintptr) int32 var zSql uintptr // SELECT used to read from rules table var pHead uintptr = uintptr(0) - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+3221 /* "SELECT * FROM %Q..." */, libc.VaList(bp, (*amatch_vtab)(unsafe.Pointer(p)).FzDb, (*amatch_vtab)(unsafe.Pointer(p)).FzCostTab)) + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+3278 /* "SELECT * FROM %Q..." */, libc.VaList(bp, (*amatch_vtab)(unsafe.Pointer(p)).FzDb, (*amatch_vtab)(unsafe.Pointer(p)).FzCostTab)) if zSql == uintptr(0) { rc = SQLITE_NOMEM } else { @@ -14948,9 +15556,9 @@ func amatchLoadRules(tls *libc.TLS, db uintptr, p uintptr, pzErr uintptr) int32 *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)) = uintptr(0) rc = sqlite3.Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+56 /* &pStmt */, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3241 /* "%s: %s" */, libc.VaList(bp+16, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, sqlite3.Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3298 /* "%s: %s" */, libc.VaList(bp+16, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, sqlite3.Xsqlite3_errmsg(tls, db))) } else if sqlite3.Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */))) != 4 { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3248, /* "%s: %s has %d co..." */ + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3305, /* "%s: %s has %d co..." */ libc.VaList(bp+32, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, (*amatch_vtab)(unsafe.Pointer(p)).FzCostTab, sqlite3.Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */))))) rc = SQLITE_ERROR } else { @@ -15167,7 +15775,7 @@ __5: if !(i < argc) { goto __7 } - zVal = amatchValueOfKey(tls, ts+3282 /* "vocabulary_table" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) + zVal = amatchValueOfKey(tls, ts+3339 /* "vocabulary_table" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if !(zVal != 0) { goto __8 } @@ -15182,7 +15790,7 @@ __9: goto __6 __8: ; - zVal = amatchValueOfKey(tls, ts+3299 /* "vocabulary_word" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) + zVal = amatchValueOfKey(tls, ts+3356 /* "vocabulary_word" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if !(zVal != 0) { goto __10 } @@ -15197,7 +15805,7 @@ __11: goto __6 __10: ; - zVal = amatchValueOfKey(tls, ts+3315 /* "vocabulary_langu..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) + zVal = amatchValueOfKey(tls, ts+3372 /* "vocabulary_langu..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if !(zVal != 0) { goto __12 } @@ -15212,7 +15820,7 @@ __13: goto __6 __12: ; - zVal = amatchValueOfKey(tls, ts+3335 /* "edit_distances" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) + zVal = amatchValueOfKey(tls, ts+3392 /* "edit_distances" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if !(zVal != 0) { goto __14 } @@ -15227,7 +15835,7 @@ __15: goto __6 __14: ; - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3350 /* "unrecognized arg..." */, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3407 /* "unrecognized arg..." */, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) amatchFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppVtab)) = uintptr(0) return SQLITE_ERROR @@ -15242,7 +15850,7 @@ __7: if !((*amatch_vtab)(unsafe.Pointer(pNew)).FzCostTab == uintptr(0)) { goto __16 } - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3379 /* "no edit_distance..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3436 /* "no edit_distance..." */, 0) rc = SQLITE_ERROR goto __17 __16: @@ -15255,7 +15863,7 @@ __17: sqlite3.Xsqlite3_vtab_config(tls, db, SQLITE_VTAB_INNOCUOUS, 0) rc = sqlite3.Xsqlite3_declare_vtab(tls, db, - ts+3413 /* "CREATE TABLE x(w..." */) + ts+3470 /* "CREATE TABLE x(w..." */) __18: ; if !(rc != SQLITE_OK) { @@ -15327,7 +15935,7 @@ func amatchEncodeInt(tls *libc.TLS, x int32, z uintptr) { /* amatch.c:978:13: */ *(*int8)(unsafe.Pointer(z + 3)) = a[(x & 0x3f)] } -var a = *(*[65]int8)(unsafe.Pointer(ts + 3480 /* "0123456789ABCDEF..." */)) /* amatch.c:979:21 */ +var a = *(*[65]int8)(unsafe.Pointer(ts + 3537 /* "0123456789ABCDEF..." */)) /* amatch.c:979:21 */ // Write the zCost[] field for a amatch_word object func amatchWriteCost(tls *libc.TLS, pWord uintptr) { /* amatch.c:996:13: */ @@ -15447,15 +16055,15 @@ func amatchNext(tls *libc.TLS, cur uintptr) int32 { /* amatch.c:1102:12: */ var zSql uintptr if ((*amatch_vtab)(unsafe.Pointer(p)).FzVocabLang != 0) && (*(*int8)(unsafe.Pointer((*amatch_vtab)(unsafe.Pointer(p)).FzVocabLang)) != 0) { zSql = sqlite3.Xsqlite3_mprintf(tls, - ts+3545, /* "SELECT \"%w\" FROM..." */ + ts+3602, /* "SELECT \"%w\" FROM..." */ - libc.VaList(bp, ts+3567, /* " WHERE \"%w\">=?1 ..." */ + libc.VaList(bp, ts+3624, /* " WHERE \"%w\">=?1 ..." */ (*amatch_vtab)(unsafe.Pointer(p)).FzVocabWord, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabTab, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabWord, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabLang)) } else { zSql = sqlite3.Xsqlite3_mprintf(tls, - ts+3606, /* "SELECT \"%w\" FROM..." */ + ts+3663, /* "SELECT \"%w\" FROM..." */ libc.VaList(bp+40, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabWord, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabTab, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabWord)) } @@ -15505,7 +16113,7 @@ func amatchNext(tls *libc.TLS, cur uintptr) int32 { /* amatch.c:1102:12: */ if rc == SQLITE_ROW { zW = sqlite3.Xsqlite3_column_text(tls, (*amatch_vtab)(unsafe.Pointer(p)).FpVCheck, 0) if libc.Xstrncmp(tls, zBuf, zW, (uint64(nWord+nNextIn))) == 0 { - amatchAddWord(tls, pCur, (*amatch_word)(unsafe.Pointer(pWord)).FrCost, (int32((*amatch_word)(unsafe.Pointer(pWord)).FnMatch) + nNextIn), zBuf, ts+488 /* "" */) + amatchAddWord(tls, pCur, (*amatch_word)(unsafe.Pointer(pWord)).FrCost, (int32((*amatch_word)(unsafe.Pointer(pWord)).FnMatch) + nNextIn), zBuf, ts+489 /* "" */) } } *(*int8)(unsafe.Pointer(zBuf + uintptr(nWord))) = int8(0) @@ -15555,7 +16163,7 @@ func amatchNext(tls *libc.TLS, cur uintptr) int32 { /* amatch.c:1102:12: */ if (*amatch_vtab)(unsafe.Pointer(p)).FrDel > 0 { *(*int8)(unsafe.Pointer(zBuf + uintptr(nWord))) = int8(0) amatchAddWord(tls, pCur, ((*amatch_word)(unsafe.Pointer(pWord)).FrCost + (*amatch_vtab)(unsafe.Pointer(p)).FrDel), (int32((*amatch_word)(unsafe.Pointer(pWord)).FnMatch) + nNextIn), - zBuf, ts+488 /* "" */) + zBuf, ts+489 /* "" */) } for pRule = (*amatch_vtab)(unsafe.Pointer(p)).FpRule; pRule != 0; pRule = (*amatch_rule)(unsafe.Pointer(pRule)).FpNext { @@ -15581,7 +16189,7 @@ func amatchFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp defer tls.Free(8) var pCur uintptr = pVtabCursor - var zWord uintptr = ts + 3654 /* "*" */ + var zWord uintptr = ts + 3711 /* "*" */ var idx int32 amatchClearCursor(tls, pCur) @@ -15602,7 +16210,7 @@ func amatchFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp if (*amatch_cursor)(unsafe.Pointer(pCur)).FzInput == uintptr(0) { return SQLITE_NOMEM } - amatchAddWord(tls, pCur, 0, 0, ts+488 /* "" */, ts+488 /* "" */) + amatchAddWord(tls, pCur, 0, 0, ts+489 /* "" */, ts+489 /* "" */) amatchNext(tls, pVtabCursor) return SQLITE_OK @@ -15765,12 +16373,12 @@ func amatchUpdate(tls *libc.TLS, pVTab uintptr, argc int32, argv uintptr, pRowid var zCmd uintptr _ = pRowid if argc == 1 { - (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+3656, /* "DELETE from %s i..." */ + (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+3713, /* "DELETE from %s i..." */ libc.VaList(bp, (*amatch_vtab)(unsafe.Pointer(p)).FzSelf)) return SQLITE_ERROR } if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) != SQLITE_NULL { - (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+3686, /* "UPDATE of %s is ..." */ + (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+3743, /* "UPDATE of %s is ..." */ libc.VaList(bp+8, (*amatch_vtab)(unsafe.Pointer(p)).FzSelf)) return SQLITE_ERROR } @@ -15778,7 +16386,7 @@ func amatchUpdate(tls *libc.TLS, pVTab uintptr, argc int32, argv uintptr, pRowid (sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))) != SQLITE_NULL)) || (sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8))) != SQLITE_NULL) { (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, - ts+3714 /* "INSERT INTO %s a..." */, libc.VaList(bp+16, (*amatch_vtab)(unsafe.Pointer(p)).FzSelf)) + ts+3771 /* "INSERT INTO %s a..." */, libc.VaList(bp+16, (*amatch_vtab)(unsafe.Pointer(p)).FzSelf)) return SQLITE_ERROR } zCmd = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 5*8))) @@ -15812,14 +16420,26 @@ func sqlite3_amatch_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintp _ = pApi _ = pzErrMsg // Not used - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+3763 /* "approximate_matc..." */, uintptr(unsafe.Pointer(&amatchModule)), uintptr(0)) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+3820 /* "approximate_matc..." */, uintptr(unsafe.Pointer(&amatchModule)), uintptr(0)) return rc } -// Allowed datatypes +// Allowed values for the mFlags parameter to sqlite3_carray_bind(). +// Must exactly match the definitions in carray.h. -// Names of types -var azType = [4]uintptr{ts + 3781 /* "int32" */, ts + 3787 /* "int64" */, ts + 2422 /* "double" */, ts + 3793 /* "char*" */} /* carray.c:73:19 */ +// Names of allowed datatypes +var azType = [4]uintptr{ts + 3838 /* "int32" */, ts + 3844 /* "int64" */, ts + 2423 /* "double" */, ts + 3850 /* "char*" */} /* carray.c:73:19 */ + +// Structure used to hold the sqlite3_carray_bind() information +type carray_bind1 = struct { + FaData uintptr + FnData int32 + FmFlags int32 + FxDel uintptr +} /* carray.c:78:9 */ + +// Structure used to hold the sqlite3_carray_bind() information +type carray_bind = carray_bind1 /* carray.c:78:28 */ // carray_cursor is a subclass of sqlite3_vtab_cursor which will // serve as the underlying representation of a cursor that scans @@ -15831,12 +16451,12 @@ type carray_cursor1 = struct { FiCnt sqlite3_int64 FeType uint8 _ [7]byte -} /* carray.c:80:9 */ +} /* carray.c:91:9 */ // carray_cursor is a subclass of sqlite3_vtab_cursor which will // serve as the underlying representation of a cursor that scans // over rows of the result -type carray_cursor = carray_cursor1 /* carray.c:80:30 */ +type carray_cursor = carray_cursor1 /* carray.c:91:30 */ // The carrayConnect() method is invoked to create a new // carray_vtab that describes the carray virtual table. @@ -15849,14 +16469,14 @@ type carray_cursor = carray_cursor1 /* carray.c:80:30 */ // // (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the // result set of queries against carray will look like. -func carrayConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* carray.c:102:12: */ +func carrayConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* carray.c:113:12: */ var pNew uintptr var rc int32 // Column numbers rc = sqlite3.Xsqlite3_declare_vtab(tls, db, - ts+3799 /* "CREATE TABLE x(v..." */) + ts+3856 /* "CREATE TABLE x(v..." */) if rc == SQLITE_OK { pNew = libc.AssignPtrUintptr(ppVtab, sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(sqlite3_vtab{})))) if pNew == uintptr(0) { @@ -15868,13 +16488,13 @@ func carrayConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uin } // This method is the destructor for carray_cursor objects. -func carrayDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* carray.c:131:12: */ +func carrayDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* carray.c:142:12: */ sqlite3.Xsqlite3_free(tls, pVtab) return SQLITE_OK } // Constructor for a new carray_cursor object. -func carrayOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* carray.c:139:12: */ +func carrayOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* carray.c:150:12: */ var pCur uintptr pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(carray_cursor{}))) if pCur == uintptr(0) { @@ -15886,13 +16506,13 @@ func carrayOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* carray.c: } // Destructor for a carray_cursor. -func carrayClose(tls *libc.TLS, cur uintptr) int32 { /* carray.c:151:12: */ +func carrayClose(tls *libc.TLS, cur uintptr) int32 { /* carray.c:162:12: */ sqlite3.Xsqlite3_free(tls, cur) return SQLITE_OK } // Advance a carray_cursor to its next row of output. -func carrayNext(tls *libc.TLS, cur uintptr) int32 { /* carray.c:160:12: */ +func carrayNext(tls *libc.TLS, cur uintptr) int32 { /* carray.c:171:12: */ var pCur uintptr = cur (*carray_cursor)(unsafe.Pointer(pCur)).FiRowid++ return SQLITE_OK @@ -15900,7 +16520,7 @@ func carrayNext(tls *libc.TLS, cur uintptr) int32 { /* carray.c:160:12: */ // Return values of columns for the row at which the carray_cursor // is currently pointing. -func carrayColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* carray.c:170:12: */ +func carrayColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* carray.c:181:12: */ var pCur uintptr = cur var x sqlite3_int64 = int64(0) switch i { @@ -15956,7 +16576,7 @@ func carrayColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* c // Return the rowid for the current row. In this implementation, the // rowid is the same as the output value. -func carrayRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* carray.c:217:12: */ +func carrayRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* carray.c:228:12: */ var pCur uintptr = cur *(*sqlite_int64)(unsafe.Pointer(pRowid)) = (*carray_cursor)(unsafe.Pointer(pCur)).FiRowid return SQLITE_OK @@ -15964,47 +16584,65 @@ func carrayRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* carray.c // Return TRUE if the cursor has been moved off of the last // row of output. -func carrayEof(tls *libc.TLS, cur uintptr) int32 { /* carray.c:227:12: */ +func carrayEof(tls *libc.TLS, cur uintptr) int32 { /* carray.c:238:12: */ var pCur uintptr = cur return (libc.Bool32((*carray_cursor)(unsafe.Pointer(pCur)).FiRowid > (*carray_cursor)(unsafe.Pointer(pCur)).FiCnt)) } // This method is called to "rewind" the carray_cursor object back // to the first row of output. -func carrayFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* carray.c:236:12: */ +func carrayFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* carray.c:247:12: */ bp := tls.Alloc(8) defer tls.Free(8) var pCur uintptr = pVtabCursor - if idxNum != 0 { - (*carray_cursor)(unsafe.Pointer(pCur)).FpPtr = sqlite3.Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+3862 /* "carray" */) - (*carray_cursor)(unsafe.Pointer(pCur)).FiCnt = func() int64 { - if (*carray_cursor)(unsafe.Pointer(pCur)).FpPtr != 0 { - return sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + (*carray_cursor)(unsafe.Pointer(pCur)).FpPtr = uintptr(0) + (*carray_cursor)(unsafe.Pointer(pCur)).FiCnt = int64(0) + switch idxNum { + case 1: + { + var pBind uintptr = sqlite3.Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+3919 /* "carray-bind" */) + if pBind == uintptr(0) { + break } - return int64(0) - }() - if idxNum < 3 { - (*carray_cursor)(unsafe.Pointer(pCur)).FeType = CARRAY_INT32 - } else { - var i uint8 - var zType uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) - for i = uint8(0); uint64(i) < (uint64(unsafe.Sizeof(azType)) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { - if sqlite3.Xsqlite3_stricmp(tls, zType, azType[i]) == 0 { - break + (*carray_cursor)(unsafe.Pointer(pCur)).FpPtr = (*carray_bind)(unsafe.Pointer(pBind)).FaData + (*carray_cursor)(unsafe.Pointer(pCur)).FiCnt = sqlite3_int64((*carray_bind)(unsafe.Pointer(pBind)).FnData) + (*carray_cursor)(unsafe.Pointer(pCur)).FeType = (uint8((*carray_bind)(unsafe.Pointer(pBind)).FmFlags & 0x03)) + break + + } + case 2: + fallthrough + case 3: + { + (*carray_cursor)(unsafe.Pointer(pCur)).FpPtr = sqlite3.Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+3931 /* "carray" */) + (*carray_cursor)(unsafe.Pointer(pCur)).FiCnt = func() int64 { + if (*carray_cursor)(unsafe.Pointer(pCur)).FpPtr != 0 { + return sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + } + return int64(0) + }() + if idxNum < 3 { + (*carray_cursor)(unsafe.Pointer(pCur)).FeType = uint8(CARRAY_INT32) + } else { + var i uint8 + var zType uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) + for i = uint8(0); uint64(i) < (uint64(unsafe.Sizeof(azType)) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { + if sqlite3.Xsqlite3_stricmp(tls, zType, azType[i]) == 0 { + break + } + } + if uint64(i) >= (uint64(unsafe.Sizeof(azType)) / uint64(unsafe.Sizeof(uintptr(0)))) { + (*sqlite3_vtab)(unsafe.Pointer((*sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, + ts+3938 /* "unknown datatype..." */, libc.VaList(bp, zType)) + return SQLITE_ERROR + } else { + (*carray_cursor)(unsafe.Pointer(pCur)).FeType = i } } - if uint64(i) >= (uint64(unsafe.Sizeof(azType)) / uint64(unsafe.Sizeof(uintptr(0)))) { - (*sqlite3_vtab)(unsafe.Pointer((*sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, - ts+3869 /* "unknown datatype..." */, libc.VaList(bp, zType)) - return SQLITE_ERROR - } else { - (*carray_cursor)(unsafe.Pointer(pCur)).FeType = i - } + break + } - } else { - (*carray_cursor)(unsafe.Pointer(pCur)).FpPtr = uintptr(0) - (*carray_cursor)(unsafe.Pointer(pCur)).FiCnt = int64(0) } (*carray_cursor)(unsafe.Pointer(pCur)).FiRowid = int64(1) return SQLITE_OK @@ -16018,10 +16656,17 @@ func carrayFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp // In this implementation idxNum is used to represent the // query plan. idxStr is unused. // -// idxNum is 2 if the pointer= and count= constraints exist, -// 3 if the ctype= constraint also exists, and is 0 otherwise. -// If idxNum is 0, then carray becomes an empty table. -func carrayBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* carray.c:282:12: */ +// idxNum is: +// +// 1 If only the pointer= constraint exists. In this case, the +// parameter must be bound using sqlite3_carray_bind(). +// +// 2 if the pointer= and count= constraints exist. +// +// 3 if the ctype= constraint also exists. +// +// idxNum is 0 otherwise and carray becomes an empty table. +func carrayBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* carray.c:311:12: */ var i int32 // Loop over constraints var ptrIdx int32 = -1 // Index of the pointer= constraint, or -1 if none var cntIdx int32 = -1 // Index of the count= constraint, or -1 if none @@ -16062,18 +16707,21 @@ __2: goto __3 __3: ; - if (ptrIdx >= 0) && (cntIdx >= 0) { + if ptrIdx >= 0 { (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ptrIdx)*8)).FargvIndex = 1 (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ptrIdx)*8)).Fomit = uint8(1) - (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(cntIdx)*8)).FargvIndex = 2 - (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(cntIdx)*8)).Fomit = uint8(1) (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(1) (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100) - (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 2 - if ctypeIdx >= 0 { - (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ctypeIdx)*8)).FargvIndex = 3 - (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ctypeIdx)*8)).Fomit = uint8(1) - (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 3 + (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 1 + if cntIdx >= 0 { + (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(cntIdx)*8)).FargvIndex = 2 + (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(cntIdx)*8)).Fomit = uint8(1) + (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 2 + if ctypeIdx >= 0 { + (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ctypeIdx)*8)).FargvIndex = 3 + (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ctypeIdx)*8)).Fomit = uint8(1) + (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 3 + } } } else { (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(2147483647) @@ -16096,7 +16744,88 @@ var carrayModule = sqlite3_module{ // xCreate FxEof: 0, // xEof - check for end of scan FxColumn: 0, // xColumn - read data FxRowid: 0, // xRename -} /* carray.c:333:23 */ +} /* carray.c:365:23 */ + +// Destructor for the carray_bind object +func carrayBindDel(tls *libc.TLS, pPtr uintptr) { /* carray.c:391:13: */ + var p uintptr = pPtr + if (*carray_bind)(unsafe.Pointer(p)).FxDel != (uintptr(0)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((p + 16 /* &.xDel */))))(tls, (*carray_bind)(unsafe.Pointer(p)).FaData) + } + sqlite3.Xsqlite3_free(tls, p) +} + +// Invoke this interface in order to bind to the single-argument +// version of CARRAY(). +func sqlite3_carray_bind(tls *libc.TLS, pStmt uintptr, idx int32, aData uintptr, nData int32, mFlags int32, xDestroy uintptr) int32 { /* carray.c:406:5: */ + var pNew uintptr + var i int32 + pNew = sqlite3.Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(carray_bind{}))) + if pNew == uintptr(0) { + if (xDestroy != (uintptr(0))) && (xDestroy != (libc.UintptrFromInt32(-1))) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&xDestroy)))(tls, aData) + } + return SQLITE_NOMEM + } + (*carray_bind)(unsafe.Pointer(pNew)).FnData = nData + (*carray_bind)(unsafe.Pointer(pNew)).FmFlags = mFlags + if xDestroy == (libc.UintptrFromInt32(-1)) { + var sz sqlite3_int64 = sqlite3_int64(nData) + switch mFlags & 0x03 { + case CARRAY_INT32: + sz = sz * (int64(4)) + break + fallthrough + case CARRAY_INT64: + sz = sz * (int64(8)) + break + fallthrough + case CARRAY_DOUBLE: + sz = sz * (int64(8)) + break + fallthrough + case CARRAY_TEXT: + sz = int64(uint64(sz) * (uint64(unsafe.Sizeof(uintptr(0))))) + break + } + if (mFlags & 0x03) == CARRAY_TEXT { + for i = 0; i < nData; i++ { + var z uintptr = *(*uintptr)(unsafe.Pointer((aData) + uintptr(i)*8)) + if z != 0 { + sz = sqlite3_int64(uint64(sz) + (uint64(libc.Xstrlen(tls, z) + uint64(1)))) + } + } + } + (*carray_bind)(unsafe.Pointer(pNew)).FaData = sqlite3.Xsqlite3_malloc64(tls, uint64(sz)) + if (*carray_bind)(unsafe.Pointer(pNew)).FaData == uintptr(0) { + sqlite3.Xsqlite3_free(tls, pNew) + return SQLITE_NOMEM + } + if (mFlags & 0x03) == CARRAY_TEXT { + var az uintptr = (*carray_bind)(unsafe.Pointer(pNew)).FaData + var z uintptr = (az + uintptr(nData)*8) + for i = 0; i < nData; i++ { + var zData uintptr = *(*uintptr)(unsafe.Pointer((aData) + uintptr(i)*8)) + var n sqlite3_int64 + if zData == uintptr(0) { + *(*uintptr)(unsafe.Pointer(az + uintptr(i)*8)) = uintptr(0) + continue + } + *(*uintptr)(unsafe.Pointer(az + uintptr(i)*8)) = z + n = sqlite3_int64(libc.Xstrlen(tls, zData)) + libc.Xmemcpy(tls, z, zData, (uint64(n + int64(1)))) + z += (uintptr(n + int64(1))) + } + } else { + libc.Xmemcpy(tls, (*carray_bind)(unsafe.Pointer(pNew)).FaData, aData, (uint64(sz * sqlite3_int64(nData)))) + } + (*carray_bind)(unsafe.Pointer(pNew)).FxDel = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})) + } else { + (*carray_bind)(unsafe.Pointer(pNew)).FaData = aData + (*carray_bind)(unsafe.Pointer(pNew)).FxDel = xDestroy + } + return sqlite3.Xsqlite3_bind_pointer(tls, pStmt, idx, pNew, ts+3919 /* "carray-bind" */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{carrayBindDel}))) +} // For testing purpose in the TCL test harness, we need a method for // setting the pointer value. The inttoptr(X) SQL function accomplishes @@ -16105,7 +16834,7 @@ var carrayModule = sqlite3_module{ // xCreate // a pointer. // // This is for testing on TCL only. -func inttoptrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* carray.c:366:13: */ +func inttoptrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* carray.c:481:13: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -16120,16 +16849,16 @@ func inttoptrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* *(*int32)(unsafe.Pointer(bp + 16 /* i32 */)) = (int32(*(*sqlite3_int64)(unsafe.Pointer(bp + 8 /* i64 */)) & int64(0xffffffff))) libc.Xmemcpy(tls, bp /* &p */, bp+16 /* &i32 */, uint64(unsafe.Sizeof(uintptr(0)))) } - sqlite3.Xsqlite3_result_pointer(tls, context, *(*uintptr)(unsafe.Pointer(bp /* p */)), ts+3862 /* "carray" */, uintptr(0)) + sqlite3.Xsqlite3_result_pointer(tls, context, *(*uintptr)(unsafe.Pointer(bp /* p */)), ts+3931 /* "carray" */, uintptr(0)) } -func sqlite3_carray_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* carray.c:389:5: */ +func sqlite3_carray_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* carray.c:504:5: */ var rc int32 = SQLITE_OK _ = pApi - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+3862 /* "carray" */, uintptr(unsafe.Pointer(&carrayModule)), uintptr(0)) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+3931 /* "carray" */, uintptr(unsafe.Pointer(&carrayModule)), uintptr(0)) if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+3890 /* "inttoptr" */, 1, SQLITE_UTF8, uintptr(0), + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+3959 /* "inttoptr" */, 1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{inttoptrFunc})), uintptr(0), uintptr(0)) @@ -16137,6 +16866,581 @@ func sqlite3_carray_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintp return rc } +// Copyright (C) 1991-2018 Free Software Foundation, Inc. +// This file is part of the GNU C Library. +// +// The GNU C Library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// The GNU C Library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with the GNU C Library; if not, see +// . + +// ISO C99 Standard: 7.2 Diagnostics + +// Copyright (C) 1991-2018 Free Software Foundation, Inc. +// This file is part of the GNU C Library. +// +// The GNU C Library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// The GNU C Library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with the GNU C Library; if not, see +// . + +// void assert (int expression); +// +// If NDEBUG is defined, do nothing. +// If not, and EXPRESSION is zero, print an error message and abort. + +// void assert_perror (int errnum); +// +// If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an +// error message with the error text for ERRNUM and abort. +// (This is a GNU extension.) + +// Forward declaration of objects used by this utility +type CksmVfs = sqlite3_vfs1 /* cksumvfs.c:176:28 */ +type CksmFile1 = struct { + Fbase sqlite3_file + FzFName uintptr + FcomputeCksm int8 + FverifyCksm int8 + FisWal int8 + FinCkpt int8 + _ [4]byte + FpPartner uintptr +} /* cksumvfs.c:177:9 */ + +type CksmFile = CksmFile1 /* cksumvfs.c:177:25 */ + +// Useful datatype abbreviations +type u8 = uint8 /* cksumvfs.c:183:25 */ + +var cksm_vfs = sqlite3_vfs{ + FiVersion: 3, // szOsFile (set when registered) + FmxPathname: 1024, // pNext + FzName: ts + 3968, /* "cksmvfs" */ /* pAppData (set when registered) */ + FxOpen: 0, // xOpen + FxDelete: 0, // xDelete + FxAccess: 0, // xAccess + FxFullPathname: 0, // xFullPathname + FxDlOpen: 0, // xDlOpen + FxDlError: 0, // xDlError + FxDlSym: 0, // xDlSym + FxDlClose: 0, // xDlClose + FxRandomness: 0, // xRandomness + FxSleep: 0, // xSleep + FxCurrentTime: 0, // xCurrentTime + FxGetLastError: 0, // xGetLastError + FxCurrentTimeInt64: 0, // xCurrentTimeInt64 + FxSetSystemCall: 0, // xSetSystemCall + FxGetSystemCall: 0, // xGetSystemCall + FxNextSystemCall: 0, // xNextSystemCall +} /* cksumvfs.c:247:20 */ + +var cksm_io_methods = sqlite3_io_methods{ + FiVersion: 3, // iVersion + FxClose: 0, // xClose + FxRead: 0, // xRead + FxWrite: 0, // xWrite + FxTruncate: 0, // xTruncate + FxSync: 0, // xSync + FxFileSize: 0, // xFileSize + FxLock: 0, // xLock + FxUnlock: 0, // xUnlock + FxCheckReservedLock: 0, // xCheckReservedLock + FxFileControl: 0, // xFileControl + FxSectorSize: 0, // xSectorSize + FxDeviceCharacteristics: 0, // xDeviceCharacteristics + FxShmMap: 0, // xShmMap + FxShmLock: 0, // xShmLock + FxShmBarrier: 0, // xShmBarrier + FxShmUnmap: 0, // xShmUnmap + FxFetch: 0, // xFetch + FxUnfetch: 0, // xUnfetch +} /* cksumvfs.c:272:33 */ + +// Do byte swapping on a unsigned 32-bit integer + +// Compute a checksum on a buffer +func cksmCompute(tls *libc.TLS, a uintptr, nByte int32, aOut uintptr) { /* cksumvfs.c:301:13: */ + bp := tls.Alloc(12) + defer tls.Free(12) + + *(*u32)(unsafe.Pointer(bp + 4 /* s1 */)) = u32(0) + *(*u32)(unsafe.Pointer(bp + 8 /* s2 */)) = u32(0) + var aData uintptr = a + var aEnd uintptr = (a + uintptr(nByte)) + *(*u32)(unsafe.Pointer(bp /* x */)) = u32(1) + + if 1 == int32(*(*u8)(unsafe.Pointer(bp /* &x */))) { + // Little-endian + for ok := true; ok; ok = (aData < aEnd) { + *(*u32)(unsafe.Pointer(bp + 4 /* s1 */)) += (*(*u32)(unsafe.Pointer(libc.PostIncUintptr(&aData, 4))) + *(*u32)(unsafe.Pointer(bp + 8 /* s2 */))) + *(*u32)(unsafe.Pointer(bp + 8 /* s2 */)) += (*(*u32)(unsafe.Pointer(libc.PostIncUintptr(&aData, 4))) + *(*u32)(unsafe.Pointer(bp + 4 /* s1 */))) + } + } else { + // Big-endian + for ok1 := true; ok1; ok1 = (aData < aEnd) { + *(*u32)(unsafe.Pointer(bp + 4 /* s1 */)) += (((((((*(*u32)(unsafe.Pointer(aData))) & u32(0x000000FF)) << 24) + (((*(*u32)(unsafe.Pointer(aData))) & u32(0x0000FF00)) << 8)) + (((*(*u32)(unsafe.Pointer(aData))) & u32(0x00FF0000)) >> 8)) + (((*(*u32)(unsafe.Pointer(aData))) & 0xFF000000) >> 24)) + *(*u32)(unsafe.Pointer(bp + 8 /* s2 */))) + *(*u32)(unsafe.Pointer(bp + 8 /* s2 */)) += (((((((*(*u32)(unsafe.Pointer(aData + 1*4))) & u32(0x000000FF)) << 24) + (((*(*u32)(unsafe.Pointer(aData + 1*4))) & u32(0x0000FF00)) << 8)) + (((*(*u32)(unsafe.Pointer(aData + 1*4))) & u32(0x00FF0000)) >> 8)) + (((*(*u32)(unsafe.Pointer(aData + 1*4))) & 0xFF000000) >> 24)) + *(*u32)(unsafe.Pointer(bp + 4 /* s1 */))) + aData += 4 * (uintptr(2)) + } + *(*u32)(unsafe.Pointer(bp + 4 /* s1 */)) = ((((((*(*u32)(unsafe.Pointer(bp + 4 /* s1 */))) & u32(0x000000FF)) << 24) + (((*(*u32)(unsafe.Pointer(bp + 4 /* s1 */))) & u32(0x0000FF00)) << 8)) + (((*(*u32)(unsafe.Pointer(bp + 4 /* s1 */))) & u32(0x00FF0000)) >> 8)) + (((*(*u32)(unsafe.Pointer(bp + 4 /* s1 */))) & 0xFF000000) >> 24)) + *(*u32)(unsafe.Pointer(bp + 8 /* s2 */)) = ((((((*(*u32)(unsafe.Pointer(bp + 8 /* s2 */))) & u32(0x000000FF)) << 24) + (((*(*u32)(unsafe.Pointer(bp + 8 /* s2 */))) & u32(0x0000FF00)) << 8)) + (((*(*u32)(unsafe.Pointer(bp + 8 /* s2 */))) & u32(0x00FF0000)) >> 8)) + (((*(*u32)(unsafe.Pointer(bp + 8 /* s2 */))) & 0xFF000000) >> 24)) + } + libc.Xmemcpy(tls, aOut, bp+4 /* &s1 */, uint64(4)) + libc.Xmemcpy(tls, (aOut + uintptr(4)), bp+8 /* &s2 */, uint64(4)) +} + +// SQL function: verify_checksum(BLOB) +// +// Return 0 or 1 if the checksum is invalid or valid. Or return +// NULL if the input is not a BLOB that is the right size for a +// database page. +func cksmVerifyFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* cksumvfs.c:342:13: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + var nByte int32 + var data uintptr + // var cksum [8]u8 at bp, 8 + + data = sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if data == uintptr(0) { + return + } + if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) != SQLITE_BLOB { + return + } + nByte = sqlite3.Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) + if ((nByte < 512) || (nByte > 65536)) || ((nByte & (nByte - 1)) != 0) { + return + } + cksmCompute(tls, data, (nByte - 8), bp /* &cksum[0] */) + sqlite3.Xsqlite3_result_int(tls, context, (libc.Bool32(libc.Xmemcmp(tls, ((data+uintptr(nByte))-uintptr(8)), bp /* &cksum[0] */, uint64(8)) == 0))) +} + +// Close a cksm-file. +func cksmClose(tls *libc.TLS, pFile uintptr) int32 { /* cksumvfs.c:397:12: */ + var p uintptr = pFile + if (*CksmFile)(unsafe.Pointer(p)).FpPartner != 0 { + + (*CksmFile)(unsafe.Pointer((*CksmFile)(unsafe.Pointer(p)).FpPartner)).FpPartner = uintptr(0) + (*CksmFile)(unsafe.Pointer(p)).FpPartner = uintptr(0) + } + pFile = ((pFile) + uintptr(1)*32) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 8 /* &.xClose */))))(tls, pFile) +} + +// Set the computeCkSm and verifyCksm flags, if they need to be +// changed. +func cksmSetFlags(tls *libc.TLS, p uintptr, hasCorrectReserveSize int32) { /* cksumvfs.c:412:13: */ + if hasCorrectReserveSize != int32((*CksmFile)(unsafe.Pointer(p)).FcomputeCksm) { + (*CksmFile)(unsafe.Pointer(p)).FcomputeCksm = libc.AssignPtrInt8(p+17 /* &.verifyCksm */, int8(hasCorrectReserveSize)) + if (*CksmFile)(unsafe.Pointer(p)).FpPartner != 0 { + (*CksmFile)(unsafe.Pointer((*CksmFile)(unsafe.Pointer(p)).FpPartner)).FverifyCksm = int8(hasCorrectReserveSize) + (*CksmFile)(unsafe.Pointer((*CksmFile)(unsafe.Pointer(p)).FpPartner)).FcomputeCksm = int8(hasCorrectReserveSize) + } + } +} + +// Read data from a cksm-file. +func cksmRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* cksumvfs.c:425:12: */ + bp := tls.Alloc(24) + defer tls.Free(24) + + var rc int32 + var p uintptr = pFile + pFile = ((pFile) + uintptr(1)*32) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 16 /* &.xRead */))))(tls, pFile, zBuf, iAmt, iOfst) + if rc == SQLITE_OK { + if ((iOfst == int64(0)) && (iAmt >= 100)) && ((libc.Xmemcmp(tls, zBuf, ts+3159 /* "SQLite format 3" */, uint64(16)) == 0) || (libc.Xmemcmp(tls, zBuf, ts+3976 /* "ZV-" */, uint64(3)) == 0)) { + var d uintptr = zBuf + var hasCorrectReserveSize int8 = (int8(libc.Bool32(int32(*(*u8)(unsafe.Pointer(d + 20))) == 8))) + cksmSetFlags(tls, p, int32(hasCorrectReserveSize)) + } + // Verify the checksum if + // (1) the size indicates that we are dealing with a complete + // database page + // (2) checksum verification is enabled + // (3) we are not in the middle of checkpoint + if ((iAmt >= 512) && // (1) + ((*CksmFile)(unsafe.Pointer(p)).FverifyCksm != 0)) && // (2) + !(int32((*CksmFile)(unsafe.Pointer(p)).FinCkpt) != 0) { + // var cksum [8]u8 at bp+16, 8 + + cksmCompute(tls, zBuf, (iAmt - 8), bp+16 /* &cksum[0] */) + if libc.Xmemcmp(tls, ((zBuf+uintptr(iAmt))-uintptr(8)), bp+16 /* &cksum[0] */, uint64(8)) != 0 { + sqlite3.Xsqlite3_log(tls, (SQLITE_IOERR | (int32(32) << 8)), + ts+3980, /* "checksum fault o..." */ + libc.VaList(bp, iOfst, (*CksmFile)(unsafe.Pointer(p)).FzFName)) + rc = (SQLITE_IOERR | (int32(32) << 8)) + } + } + } + return rc +} + +// Write data to a cksm-file. +func cksmWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* cksumvfs.c:469:12: */ + var p uintptr = pFile + pFile = ((pFile) + uintptr(1)*32) + if ((iOfst == int64(0)) && (iAmt >= 100)) && ((libc.Xmemcmp(tls, zBuf, ts+3159 /* "SQLite format 3" */, uint64(16)) == 0) || (libc.Xmemcmp(tls, zBuf, ts+3976 /* "ZV-" */, uint64(3)) == 0)) { + var d uintptr = zBuf + var hasCorrectReserveSize int8 = (int8(libc.Bool32(int32(*(*u8)(unsafe.Pointer(d + 20))) == 8))) + cksmSetFlags(tls, p, int32(hasCorrectReserveSize)) + } + // If the write size is appropriate for a database page and if + // checksums where ever enabled, then it will be safe to compute + // the checksums. The reserve byte size might have increased, but + // it will never decrease. And because it cannot decrease, the + // checksum will not overwrite anything. + if ((iAmt >= 512) && + ((*CksmFile)(unsafe.Pointer(p)).FcomputeCksm != 0)) && + !(int32((*CksmFile)(unsafe.Pointer(p)).FinCkpt) != 0) { + cksmCompute(tls, zBuf, (iAmt - 8), (((zBuf) + uintptr(iAmt)) - uintptr(8))) + } + return (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 24 /* &.xWrite */))))(tls, pFile, zBuf, iAmt, iOfst) +} + +// Truncate a cksm-file. +func cksmTruncate(tls *libc.TLS, pFile uintptr, size sqlite_int64) int32 { /* cksumvfs.c:502:12: */ + pFile = ((pFile) + uintptr(1)*32) + return (*(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 32 /* &.xTruncate */))))(tls, pFile, size) +} + +// Sync a cksm-file. +func cksmSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* cksumvfs.c:510:12: */ + pFile = ((pFile) + uintptr(1)*32) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 40 /* &.xSync */))))(tls, pFile, flags) +} + +// Return the current file-size of a cksm-file. +func cksmFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* cksumvfs.c:518:12: */ + var p uintptr = pFile + pFile = ((p) + uintptr(1)*32) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 48 /* &.xFileSize */))))(tls, pFile, pSize) +} + +// Lock a cksm-file. +func cksmLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* cksumvfs.c:527:12: */ + pFile = ((pFile) + uintptr(1)*32) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 56 /* &.xLock */))))(tls, pFile, eLock) +} + +// Unlock a cksm-file. +func cksmUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* cksumvfs.c:535:12: */ + pFile = ((pFile) + uintptr(1)*32) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 64 /* &.xUnlock */))))(tls, pFile, eLock) +} + +// Check if another file-handle holds a RESERVED lock on a cksm-file. +func cksmCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* cksumvfs.c:543:12: */ + pFile = ((pFile) + uintptr(1)*32) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, pFile, pResOut) +} + +// File control method. For custom operations on a cksm-file. +func cksmFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* cksumvfs.c:551:12: */ + bp := tls.Alloc(16) + defer tls.Free(16) + + var rc int32 + var p uintptr = pFile + pFile = ((pFile) + uintptr(1)*32) + if op == SQLITE_FCNTL_PRAGMA { + var azArg uintptr = pArg + + if sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + 1*8)), ts+4015 /* "checksum_verific..." */) == 0 { + var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + 2*8)) + if zArg != uintptr(0) { + if ((((int32(*(*int8)(unsafe.Pointer(zArg))) >= '1') && (int32(*(*int8)(unsafe.Pointer(zArg))) <= '9')) || + (sqlite3.Xsqlite3_strlike(tls, ts+4037 /* "enable%" */, zArg, uint32(0)) == 0)) || + (sqlite3.Xsqlite3_stricmp(tls, ts+4045 /* "yes" */, zArg) == 0)) || + (sqlite3.Xsqlite3_stricmp(tls, ts+4049 /* "on" */, zArg) == 0) { + (*CksmFile)(unsafe.Pointer(p)).FverifyCksm = (*CksmFile)(unsafe.Pointer(p)).FcomputeCksm + } else { + (*CksmFile)(unsafe.Pointer(p)).FverifyCksm = int8(0) + } + if (*CksmFile)(unsafe.Pointer(p)).FpPartner != 0 { + (*CksmFile)(unsafe.Pointer((*CksmFile)(unsafe.Pointer(p)).FpPartner)).FverifyCksm = (*CksmFile)(unsafe.Pointer(p)).FverifyCksm + } + } + *(*uintptr)(unsafe.Pointer(azArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+1238 /* "%d" */, libc.VaList(bp, int32((*CksmFile)(unsafe.Pointer(p)).FverifyCksm))) + return SQLITE_OK + } else if (((*CksmFile)(unsafe.Pointer(p)).FcomputeCksm != 0) && (*(*uintptr)(unsafe.Pointer(azArg + 2*8)) != uintptr(0))) && + (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + 1*8)), ts+4052 /* "page_size" */) == 0) { + // Do not allow page size changes on a checksum database + return SQLITE_OK + } + } else if (op == SQLITE_FCNTL_CKPT_START) || (op == SQLITE_FCNTL_CKPT_DONE) { + (*CksmFile)(unsafe.Pointer(p)).FinCkpt = (int8(libc.Bool32(op == SQLITE_FCNTL_CKPT_START))) + if (*CksmFile)(unsafe.Pointer(p)).FpPartner != 0 { + (*CksmFile)(unsafe.Pointer((*CksmFile)(unsafe.Pointer(p)).FpPartner)).FinCkpt = (*CksmFile)(unsafe.Pointer(p)).FinCkpt + } + } + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 80 /* &.xFileControl */))))(tls, pFile, op, pArg) + if (rc == SQLITE_OK) && (op == SQLITE_FCNTL_VFSNAME) { + *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+4062 /* "cksm/%z" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pArg)))) + } + return rc +} + +// Return the sector-size in bytes for a cksm-file. +func cksmSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* cksumvfs.c:593:12: */ + pFile = ((pFile) + uintptr(1)*32) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 88 /* &.xSectorSize */))))(tls, pFile) +} + +// Return the device characteristic flags supported by a cksm-file. +func cksmDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* cksumvfs.c:601:12: */ + pFile = ((pFile) + uintptr(1)*32) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, pFile) +} + +// Create a shared memory file mapping +func cksmShmMap(tls *libc.TLS, pFile uintptr, iPg int32, pgsz int32, bExtend int32, pp uintptr) int32 { /* cksumvfs.c:607:12: */ + pFile = ((pFile) + uintptr(1)*32) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 104 /* &.xShmMap */))))(tls, pFile, iPg, pgsz, bExtend, libc.AtomicLoadUintptr(&pp)) +} + +// Perform locking on a shared-memory segment +func cksmShmLock(tls *libc.TLS, pFile uintptr, offset int32, n int32, flags int32) int32 { /* cksumvfs.c:619:12: */ + pFile = ((pFile) + uintptr(1)*32) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 112 /* &.xShmLock */))))(tls, pFile, offset, n, flags) +} + +// Memory barrier operation on shared memory +func cksmShmBarrier(tls *libc.TLS, pFile uintptr) { /* cksumvfs.c:625:13: */ + pFile = ((pFile) + uintptr(1)*32) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 120 /* &.xShmBarrier */))))(tls, pFile) +} + +// Unmap a shared memory segment +func cksmShmUnmap(tls *libc.TLS, pFile uintptr, deleteFlag int32) int32 { /* cksumvfs.c:631:12: */ + pFile = ((pFile) + uintptr(1)*32) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 128 /* &.xShmUnmap */))))(tls, pFile, deleteFlag) +} + +// Fetch a page of a memory-mapped file +func cksmFetch(tls *libc.TLS, pFile uintptr, iOfst sqlite3_int64, iAmt int32, pp uintptr) int32 { /* cksumvfs.c:637:12: */ + var p uintptr = pFile + if (*CksmFile)(unsafe.Pointer(p)).FcomputeCksm != 0 { + *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0) + return SQLITE_OK + } + pFile = ((pFile) + uintptr(1)*32) + if ((*sqlite3_io_methods1)(unsafe.Pointer((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods)).FiVersion > 2) && ((*sqlite3_io_methods1)(unsafe.Pointer((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods)).FxFetch != 0) { + return (*(*func(*libc.TLS, uintptr, sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 136 /* &.xFetch */))))(tls, pFile, iOfst, iAmt, pp) + } + *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0) + return SQLITE_OK +} + +// Release a memory-mapped page +func cksmUnfetch(tls *libc.TLS, pFile uintptr, iOfst sqlite3_int64, pPage uintptr) int32 { /* cksumvfs.c:657:12: */ + pFile = ((pFile) + uintptr(1)*32) + if ((*sqlite3_io_methods1)(unsafe.Pointer((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods)).FiVersion > 2) && ((*sqlite3_io_methods1)(unsafe.Pointer((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods)).FxUnfetch != 0) { + return (*(*func(*libc.TLS, uintptr, sqlite3_int64, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods + 144 /* &.xUnfetch */))))(tls, pFile, iOfst, pPage) + } + return SQLITE_OK +} + +// Open a cksm file handle. +func cksmOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* cksumvfs.c:668:12: */ + var p uintptr + var pSubFile uintptr + var pSubVfs uintptr + var rc int32 + var pDb uintptr + pSubVfs = (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + if !((flags & (SQLITE_OPEN_MAIN_DB | SQLITE_OPEN_WAL)) == 0) { + goto __1 + } + return (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pSubVfs + 40 /* &.xOpen */))))(tls, pSubVfs, zName, pFile, flags, pOutFlags) +__1: + ; + p = pFile + libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(CksmFile{}))) + pSubFile = ((pFile) + uintptr(1)*32) + (*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods = uintptr(unsafe.Pointer(&cksm_io_methods)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pSubVfs + 40 /* &.xOpen */))))(tls, pSubVfs, zName, pSubFile, flags, pOutFlags) + if !(rc != 0) { + goto __2 + } + goto cksm_open_done +__2: + ; + if !((flags & SQLITE_OPEN_WAL) != 0) { + goto __3 + } + pDb = sqlite3.Xsqlite3_database_file_object(tls, zName) + (*CksmFile)(unsafe.Pointer(p)).FpPartner = pDb + + (*CksmFile)(unsafe.Pointer((*CksmFile)(unsafe.Pointer(p)).FpPartner)).FpPartner = p + (*CksmFile)(unsafe.Pointer(p)).FisWal = int8(1) + (*CksmFile)(unsafe.Pointer(p)).FcomputeCksm = (*CksmFile)(unsafe.Pointer((*CksmFile)(unsafe.Pointer(p)).FpPartner)).FcomputeCksm + goto __4 +__3: + (*CksmFile)(unsafe.Pointer(p)).FisWal = int8(0) + (*CksmFile)(unsafe.Pointer(p)).FcomputeCksm = int8(0) +__4: + ; + (*CksmFile)(unsafe.Pointer(p)).FzFName = zName +cksm_open_done: + if !(rc != 0) { + goto __5 + } + (*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods = uintptr(0) +__5: + ; + return rc +} + +// All other VFS methods are pass-thrus. +func cksmDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* cksumvfs.c:709:12: */ + return (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 48 /* &.xDelete */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath, dirSync) +} + +func cksmAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* cksumvfs.c:712:12: */ + return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 56 /* &.xAccess */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath, flags, pResOut) +} + +func cksmFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* cksumvfs.c:720:12: */ + return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 64 /* &.xFullPathname */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath, nOut, zOut) +} + +func cksmDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* cksumvfs.c:728:13: */ + return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 72 /* &.xDlOpen */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath) +} + +func cksmDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* cksumvfs.c:731:13: */ + (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 80 /* &.xDlError */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zErrMsg) +} + +func cksmDlSym(tls *libc.TLS, pVfs uintptr, p uintptr, zSym uintptr) uintptr { /* cksumvfs.c:734:13: */ + return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 88 /* &.xDlSym */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p, zSym) +} + +func cksmDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* cksumvfs.c:737:13: */ + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 96 /* &.xDlClose */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, pHandle) +} + +func cksmRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* cksumvfs.c:740:12: */ + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 104 /* &.xRandomness */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zBufOut) +} + +func cksmSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* cksumvfs.c:743:12: */ + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 112 /* &.xSleep */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nMicro) +} + +func cksmCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* cksumvfs.c:746:12: */ + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 120 /* &.xCurrentTime */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, pTimeOut) +} + +func cksmGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* cksumvfs.c:749:12: */ + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 128 /* &.xGetLastError */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, a, b) +} + +func cksmCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, p uintptr) int32 { /* cksumvfs.c:752:12: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + var pOrig uintptr = (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + var rc int32 + + if (*sqlite3_vfs)(unsafe.Pointer(pOrig)).FxCurrentTimeInt64 != 0 { + rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pOrig + 136 /* &.xCurrentTimeInt64 */))))(tls, pOrig, p) + } else { + // var r float64 at bp, 8 + + rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pOrig + 120 /* &.xCurrentTime */))))(tls, pOrig, bp /* &r */) + *(*sqlite3_int64)(unsafe.Pointer(p)) = (sqlite3_int64(*(*float64)(unsafe.Pointer(bp /* r */)) * 86400000.0)) + } + return rc +} + +func cksmSetSystemCall(tls *libc.TLS, pVfs uintptr, zName uintptr, pCall sqlite3_syscall_ptr) int32 { /* cksumvfs.c:765:12: */ + return (*(*func(*libc.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 144 /* &.xSetSystemCall */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zName, pCall) +} + +func cksmGetSystemCall(tls *libc.TLS, pVfs uintptr, zName uintptr) sqlite3_syscall_ptr { /* cksumvfs.c:772:28: */ + return (*(*func(*libc.TLS, uintptr, uintptr) sqlite3_syscall_ptr)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 152 /* &.xGetSystemCall */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zName) +} + +func cksmNextSystemCall(tls *libc.TLS, pVfs uintptr, zName uintptr) uintptr { /* cksumvfs.c:778:19: */ + return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 160 /* &.xNextSystemCall */))))(tls, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zName) +} + +// Register the verify_checksum() SQL function. +func cksmRegisterFunc(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* cksumvfs.c:784:12: */ + var rc int32 + if db == uintptr(0) { + return SQLITE_OK + } + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+4070 /* "verify_checksum" */, 1, + ((SQLITE_UTF8 | SQLITE_INNOCUOUS) | SQLITE_DETERMINISTIC), + uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, int32, uintptr) + }{cksmVerifyFunc})), uintptr(0), uintptr(0)) + return rc +} + +// Register the cksum VFS as the default VFS for the system. +// Also make arrangements to automatically register the "verify_checksum()" +// SQL function on each new database connection. +func cksmRegisterVfs(tls *libc.TLS) int32 { /* cksumvfs.c:807:12: */ + var rc int32 = SQLITE_OK + var pOrig uintptr + if sqlite3.Xsqlite3_vfs_find(tls, ts+3968 /* "cksmvfs" */) != uintptr(0) { + return SQLITE_OK + } + pOrig = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0)) + cksm_vfs.FiVersion = (*sqlite3_vfs)(unsafe.Pointer(pOrig)).FiVersion + cksm_vfs.FpAppData = pOrig + cksm_vfs.FszOsFile = (int32(uint64((*sqlite3_vfs)(unsafe.Pointer(pOrig)).FszOsFile) + uint64(unsafe.Sizeof(CksmFile{})))) + rc = sqlite3.Xsqlite3_vfs_register(tls, uintptr(unsafe.Pointer(&cksm_vfs)), 1) + if rc == SQLITE_OK { + rc = sqlite3.Xsqlite3_auto_extension(tls, *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr, uintptr) int32 + }{cksmRegisterFunc}))) + } + return rc +} + +// This variant of the initializer runs when the extension is +// statically linked. +func sqlite3_register_cksumvfs(tls *libc.TLS, NotUsed uintptr) int32 { /* cksumvfs.c:826:5: */ + _ = NotUsed + return cksmRegisterVfs(tls) +} + +func sqlite3_unregister_cksumvfs(tls *libc.TLS) int32 { /* cksumvfs.c:830:5: */ + if sqlite3.Xsqlite3_vfs_find(tls, ts+3968 /* "cksmvfs" */) != 0 { + sqlite3.Xsqlite3_vfs_unregister(tls, uintptr(unsafe.Pointer(&cksm_vfs))) + sqlite3.Xsqlite3_cancel_auto_extension(tls, *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr, uintptr) int32 + }{cksmRegisterFunc}))) + } + return SQLITE_OK +} + // Forward declaration of objects used by this implementation type closure_vtab1 = struct { Fbase sqlite3_vtab @@ -16538,7 +17842,7 @@ __4: if !(i < argc) { goto __6 } - zVal = closureValueOfKey(tls, ts+3899 /* "tablename" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) + zVal = closureValueOfKey(tls, ts+4086 /* "tablename" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if !(zVal != 0) { goto __7 } @@ -16553,7 +17857,7 @@ __8: goto __5 __7: ; - zVal = closureValueOfKey(tls, ts+3909 /* "idcolumn" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) + zVal = closureValueOfKey(tls, ts+4096 /* "idcolumn" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if !(zVal != 0) { goto __9 } @@ -16568,7 +17872,7 @@ __10: goto __5 __9: ; - zVal = closureValueOfKey(tls, ts+3918 /* "parentcolumn" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) + zVal = closureValueOfKey(tls, ts+4105 /* "parentcolumn" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if !(zVal != 0) { goto __11 } @@ -16583,7 +17887,7 @@ __12: goto __5 __11: ; - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3350 /* "unrecognized arg..." */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3407 /* "unrecognized arg..." */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) closureFree(tls, pNew) *(*uintptr)(unsafe.Pointer(ppVtab)) = uintptr(0) return SQLITE_ERROR @@ -16596,7 +17900,7 @@ __6: ; rc = sqlite3.Xsqlite3_declare_vtab(tls, db, - ts+3931 /* "CREATE TABLE x(i..." */) + ts+4118 /* "CREATE TABLE x(i..." */) if !(rc != SQLITE_OK) { goto __13 } @@ -16726,7 +18030,7 @@ func closureFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uint } zSql = sqlite3.Xsqlite3_mprintf(tls, - ts+4021, /* "SELECT \"%w\".\"%w\"..." */ + ts+4208, /* "SELECT \"%w\".\"%w\"..." */ libc.VaList(bp+24, zTableName, zIdColumn, zTableName, zTableName, zParentColumn)) if zSql == uintptr(0) { return SQLITE_NOMEM @@ -17004,7 +18308,7 @@ func sqlite3_closure_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uint _ = pApi _ = pzErrMsg - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+4067 /* "transitive_closu..." */, uintptr(unsafe.Pointer(&closureModule)), uintptr(0)) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+4254 /* "transitive_closu..." */, uintptr(unsafe.Pointer(&closureModule)), uintptr(0)) return rc } @@ -17088,14 +18392,14 @@ func csv_reader_open(tls *libc.TLS, p uintptr, zFilename uintptr, zData uintptr) if zFilename != 0 { (*CsvReader)(unsafe.Pointer(p)).FzIn = sqlite3.Xsqlite3_malloc(tls, CSV_INBUFSZ) if (*CsvReader)(unsafe.Pointer(p)).FzIn == uintptr(0) { - csv_errmsg(tls, p, ts+1929 /* "out of memory" */, 0) + csv_errmsg(tls, p, ts+1930 /* "out of memory" */, 0) return 1 } - (*CsvReader)(unsafe.Pointer(p)).Fin = libc.Xfopen(tls, zFilename, ts+4086 /* "rb" */) + (*CsvReader)(unsafe.Pointer(p)).Fin = libc.Xfopen(tls, zFilename, ts+4273 /* "rb" */) if (*CsvReader)(unsafe.Pointer(p)).Fin == uintptr(0) { sqlite3.Xsqlite3_free(tls, (*CsvReader)(unsafe.Pointer(p)).FzIn) csv_reader_reset(tls, p) - csv_errmsg(tls, p, ts+4089 /* "cannot open '%s'..." */, libc.VaList(bp, zFilename)) + csv_errmsg(tls, p, ts+4276 /* "cannot open '%s'..." */, libc.VaList(bp, zFilename)) return 1 } } else { @@ -17114,7 +18418,7 @@ func csv_getc_refill(tls *libc.TLS, p uintptr) int32 { /* csv.c:151:25: */ // Only called on an empty input buffer // Only called if reading froma file - got = libc.Xfread(tls, (*CsvReader)(unsafe.Pointer(p)).FzIn, uint64(1), CSV_INBUFSZ, (*CsvReader)(unsafe.Pointer(p)).Fin) + got = libc.Xfread(tls, (*CsvReader)(unsafe.Pointer(p)).FzIn, uint64(1), uint64(CSV_INBUFSZ), (*CsvReader)(unsafe.Pointer(p)).Fin) if got == uint64(0) { return -1 } @@ -17146,7 +18450,7 @@ func csv_resize_and_append(tls *libc.TLS, p uintptr, c int8) int32 { /* csv.c:17 *(*int8)(unsafe.Pointer((*CsvReader)(unsafe.Pointer(p)).Fz + uintptr(libc.PostIncInt32(&(*CsvReader)(unsafe.Pointer(p)).Fn, 1)))) = c return 0 } else { - csv_errmsg(tls, p, ts+1929 /* "out of memory" */, 0) + csv_errmsg(tls, p, ts+1930 /* "out of memory" */, 0) return 1 } return int32(0) @@ -17213,11 +18517,11 @@ func csv_read_one_field(tls *libc.TLS, p uintptr) uintptr { /* csv.c:211:13: */ break } if (pc == '"') && (c != '\r') { - csv_errmsg(tls, p, ts+4118 /* "line %d: unescap..." */, libc.VaList(bp, (*CsvReader)(unsafe.Pointer(p)).FnLine, '"')) + csv_errmsg(tls, p, ts+4305 /* "line %d: unescap..." */, libc.VaList(bp, (*CsvReader)(unsafe.Pointer(p)).FnLine, '"')) break } if c == (-1) { - csv_errmsg(tls, p, ts+4150, /* "line %d: untermi..." */ + csv_errmsg(tls, p, ts+4337, /* "line %d: untermi..." */ libc.VaList(bp+16, startLine, '"')) (*CsvReader)(unsafe.Pointer(p)).FcTerm = int32(int8(c)) break @@ -17387,12 +18691,12 @@ func csv_string_parameter(tls *libc.TLS, p uintptr, zParam uintptr, zArg uintptr } *(*int8)(unsafe.Pointer((p + 64 /* &.zErr */))) = int8(0) if *(*uintptr)(unsafe.Pointer(pzVal)) != 0 { - csv_errmsg(tls, p, ts+4189 /* "more than one '%..." */, libc.VaList(bp, zParam)) + csv_errmsg(tls, p, ts+4376 /* "more than one '%..." */, libc.VaList(bp, zParam)) return 1 } *(*uintptr)(unsafe.Pointer(pzVal)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+8, zValue)) if *(*uintptr)(unsafe.Pointer(pzVal)) == uintptr(0) { - csv_errmsg(tls, p, ts+1929 /* "out of memory" */, 0) + csv_errmsg(tls, p, ts+1930 /* "out of memory" */, 0) return 1 } csv_trim_whitespace(tls, *(*uintptr)(unsafe.Pointer(pzVal))) @@ -17403,15 +18707,15 @@ func csv_string_parameter(tls *libc.TLS, p uintptr, zParam uintptr, zArg uintptr // Return 0 if the argument is false and 1 if it is true. Return -1 if // we cannot really tell. func csv_boolean(tls *libc.TLS, z uintptr) int32 { /* csv.c:421:12: */ - if (((sqlite3.Xsqlite3_stricmp(tls, ts+4218 /* "yes" */, z) == 0) || - (sqlite3.Xsqlite3_stricmp(tls, ts+4222 /* "on" */, z) == 0)) || - (sqlite3.Xsqlite3_stricmp(tls, ts+4225 /* "true" */, z) == 0)) || + if (((sqlite3.Xsqlite3_stricmp(tls, ts+4045 /* "yes" */, z) == 0) || + (sqlite3.Xsqlite3_stricmp(tls, ts+4049 /* "on" */, z) == 0)) || + (sqlite3.Xsqlite3_stricmp(tls, ts+4405 /* "true" */, z) == 0)) || ((int32(*(*int8)(unsafe.Pointer(z))) == '1') && (int32(*(*int8)(unsafe.Pointer(z + 1))) == 0)) { return 1 } - if (((sqlite3.Xsqlite3_stricmp(tls, ts+4230 /* "no" */, z) == 0) || - (sqlite3.Xsqlite3_stricmp(tls, ts+4233 /* "off" */, z) == 0)) || - (sqlite3.Xsqlite3_stricmp(tls, ts+4237 /* "false" */, z) == 0)) || + if (((sqlite3.Xsqlite3_stricmp(tls, ts+4410 /* "no" */, z) == 0) || + (sqlite3.Xsqlite3_stricmp(tls, ts+4413 /* "off" */, z) == 0)) || + (sqlite3.Xsqlite3_stricmp(tls, ts+4417 /* "false" */, z) == 0)) || ((int32(*(*int8)(unsafe.Pointer(z))) == '0') && (int32(*(*int8)(unsafe.Pointer(z + 1))) == 0)) { return 0 } @@ -17527,32 +18831,32 @@ __10: ; goto __9 __8: - if !(csv_boolean_parameter(tls, ts+4243 /* "header" */, 6, z, bp+368 /* &b */) != 0) { + if !(csv_boolean_parameter(tls, ts+4423 /* "header" */, 6, z, bp+368 /* &b */) != 0) { goto __11 } if !(bHeader >= 0) { goto __13 } - csv_errmsg(tls, bp+80 /* &sRdr */, ts+4250 /* "more than one 'h..." */, 0) + csv_errmsg(tls, bp+80 /* &sRdr */, ts+4430 /* "more than one 'h..." */, 0) goto csvtab_connect_error __13: ; bHeader = *(*int32)(unsafe.Pointer(bp + 368 /* b */)) goto __12 __11: - if !((libc.AssignUintptr(&zValue, csv_parameter(tls, ts+4283 /* "testflags" */, 9, z))) != uintptr(0)) { + if !((libc.AssignUintptr(&zValue, csv_parameter(tls, ts+4463 /* "testflags" */, 9, z))) != uintptr(0)) { goto __14 } tstFlags = int32(uint32(libc.Xatoi(tls, zValue))) goto __15 __14: - if !((libc.AssignUintptr(&zValue, csv_parameter(tls, ts+4293 /* "columns" */, 7, z))) != uintptr(0)) { + if !((libc.AssignUintptr(&zValue, csv_parameter(tls, ts+4473 /* "columns" */, 7, z))) != uintptr(0)) { goto __16 } if !(nCol > 0) { goto __18 } - csv_errmsg(tls, bp+80 /* &sRdr */, ts+4301 /* "more than one 'c..." */, 0) + csv_errmsg(tls, bp+80 /* &sRdr */, ts+4481 /* "more than one 'c..." */, 0) goto csvtab_connect_error __18: ; @@ -17560,14 +18864,14 @@ __18: if !(nCol <= 0) { goto __19 } - csv_errmsg(tls, bp+80 /* &sRdr */, ts+4335 /* "column= value mu..." */, 0) + csv_errmsg(tls, bp+80 /* &sRdr */, ts+4515 /* "column= value mu..." */, 0) goto csvtab_connect_error __19: ; goto __17 __16: - csv_errmsg(tls, bp+80 /* &sRdr */, ts+4366 /* "bad parameter: '..." */, libc.VaList(bp, z)) + csv_errmsg(tls, bp+80 /* &sRdr */, ts+4546 /* "bad parameter: '..." */, libc.VaList(bp, z)) goto csvtab_connect_error __17: ; @@ -17587,7 +18891,7 @@ __3: if !((libc.Bool32((*(*uintptr)(unsafe.Pointer(bp + 344 /* &azPValue[0] */))) == uintptr(0))) == (libc.Bool32((*(*uintptr)(unsafe.Pointer(bp + 344 /* &azPValue[0] */ + 1*8))) == uintptr(0)))) { goto __20 } - csv_errmsg(tls, bp+80 /* &sRdr */, ts+4386 /* "must specify eit..." */, 0) + csv_errmsg(tls, bp+80 /* &sRdr */, ts+4566 /* "must specify eit..." */, 0) goto csvtab_connect_error __20: ; @@ -17612,9 +18916,9 @@ __22: goto __23 } pStr = sqlite3.Xsqlite3_str_new(tls, uintptr(0)) - zSep = ts + 488 /* "" */ + zSep = ts + 489 /* "" */ iCol = 0 - sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+883 /* "CREATE TABLE x(" */, 0) + sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+884 /* "CREATE TABLE x(" */, 0) if !((nCol < 0) && (bHeader < 1)) { goto __25 } @@ -17640,8 +18944,8 @@ __31: if !(iCol < nCol) { goto __33 } - sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+4438 /* "%sc%d TEXT" */, libc.VaList(bp+8, zSep, iCol)) - zSep = ts + 4449 /* "," */ + sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+4618 /* "%sc%d TEXT" */, libc.VaList(bp+8, zSep, iCol)) + zSep = ts + 4629 /* "," */ goto __32 __32: iCol++ @@ -17656,8 +18960,8 @@ __34: if !(((nCol > 0) && (iCol < nCol)) || ((nCol < 0) && (bHeader != 0))) { goto __37 } - sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+4451 /* "%s\"%w\" TEXT" */, libc.VaList(bp+24, zSep, z1)) - zSep = ts + 4449 /* "," */ + sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+4631 /* "%s\"%w\" TEXT" */, libc.VaList(bp+24, zSep, z1)) + zSep = ts + 4629 /* "," */ iCol++ __37: ; @@ -17679,8 +18983,8 @@ __40: if !(iCol < nCol) { goto __41 } - sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+4438 /* "%sc%d TEXT" */, libc.VaList(bp+40, zSep, libc.PreIncInt32(&iCol, 1))) - zSep = ts + 4449 /* "," */ + sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+4618 /* "%sc%d TEXT" */, libc.VaList(bp+40, zSep, libc.PreIncInt32(&iCol, 1))) + zSep = ts + 4629 /* "," */ goto __40 __41: ; @@ -17689,7 +18993,7 @@ __39: __30: ; (*CsvTable)(unsafe.Pointer(pNew)).FnCol = nCol - sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+489 /* ")" */, 0) + sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+490 /* ")" */, 0) (*(*uintptr)(unsafe.Pointer(bp + 344 /* &azPValue[0] */ + 2*8))) = sqlite3.Xsqlite3_str_finish(tls, pStr) if !((*(*uintptr)(unsafe.Pointer(bp + 344 /* &azPValue[0] */ + 2*8))) == uintptr(0)) { goto __42 @@ -17747,7 +19051,7 @@ __49: if !(rc != 0) { goto __52 } - csv_errmsg(tls, bp+80 /* &sRdr */, ts+4463 /* "bad schema: '%s'..." */, libc.VaList(bp+56, *(*uintptr)(unsafe.Pointer(bp + 344 /* &azPValue[0] */ + 2*8)), sqlite3.Xsqlite3_errmsg(tls, db))) + csv_errmsg(tls, bp+80 /* &sRdr */, ts+4643 /* "bad schema: '%s'..." */, libc.VaList(bp+56, *(*uintptr)(unsafe.Pointer(bp + 344 /* &azPValue[0] */ + 2*8)), sqlite3.Xsqlite3_errmsg(tls, db))) goto csvtab_connect_error __52: ; @@ -17776,7 +19080,7 @@ __55: csvtab_connect_oom: rc = SQLITE_NOMEM - csv_errmsg(tls, bp+80 /* &sRdr */, ts+1929 /* "out of memory" */, 0) + csv_errmsg(tls, bp+80 /* &sRdr */, ts+1930 /* "out of memory" */, 0) csvtab_connect_error: if !(pNew != 0) { @@ -17816,7 +19120,7 @@ __61: } var azParam = [3]uintptr{ - ts + 4485 /* "filename" */, ts + 4494 /* "data" */, ts + 4499, /* "schema" */ + ts + 4665 /* "filename" */, ts + 4674 /* "data" */, ts + 4679, /* "schema" */ } /* csv.c:504:21 */ // Reset the current row content held by a CsvCursor. @@ -17882,7 +19186,7 @@ func csvtabNext(tls *libc.TLS, cur uintptr) int32 { /* csv.c:728:12: */ if *(*int32)(unsafe.Pointer((*CsvCursor)(unsafe.Pointer(pCur)).FaLen + uintptr(i)*4)) < ((*CsvCursor)(unsafe.Pointer(pCur)).Frdr.Fn + 1) { var zNew uintptr = sqlite3.Xsqlite3_realloc64(tls, *(*uintptr)(unsafe.Pointer((*CsvCursor)(unsafe.Pointer(pCur)).FazVal + uintptr(i)*8)), (uint64((*CsvCursor)(unsafe.Pointer(pCur)).Frdr.Fn + 1))) if zNew == uintptr(0) { - csv_errmsg(tls, (pCur + 8 /* &.rdr */), ts+1929 /* "out of memory" */, 0) + csv_errmsg(tls, (pCur + 8 /* &.rdr */), ts+1930 /* "out of memory" */, 0) csv_xfer_error(tls, pTab, (pCur + 8 /* &.rdr */)) break } @@ -17913,7 +19217,7 @@ func csvtabColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* c var pCur uintptr = cur var pTab uintptr = (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab if ((i >= 0) && (i < (*CsvTable)(unsafe.Pointer(pTab)).FnCol)) && (*(*uintptr)(unsafe.Pointer((*CsvCursor)(unsafe.Pointer(pCur)).FazVal + uintptr(i)*8)) != uintptr(0)) { - sqlite3.Xsqlite3_result_text(tls, ctx, *(*uintptr)(unsafe.Pointer((*CsvCursor)(unsafe.Pointer(pCur)).FazVal + uintptr(i)*8)), -1, uintptr(0)) + sqlite3.Xsqlite3_result_text(tls, ctx, *(*uintptr)(unsafe.Pointer((*CsvCursor)(unsafe.Pointer(pCur)).FazVal + uintptr(i)*8)), -1, libc.UintptrFromInt32(-1)) } return SQLITE_OK } @@ -17955,7 +19259,7 @@ func csvtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp // for testing certain kinds of virtual table behavior. func csvtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* csv.c:833:12: */ (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(1000000) - if ((*CsvTable)(unsafe.Pointer((tab))).FtstFlags & CSVTEST_FIDX) != uint32(0) { + if ((*CsvTable)(unsafe.Pointer((tab))).FtstFlags & uint32(CSVTEST_FIDX)) != uint32(0) { // The usual (and sensible) case is to always do a full table scan. // The code in this branch only runs when testflags=1. This code // generates an artifical and unrealistic plan which is useful @@ -18031,9 +19335,9 @@ func sqlite3_csv_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) var rc int32 _ = pApi - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+4506 /* "csv" */, uintptr(unsafe.Pointer(&CsvModule)), uintptr(0)) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+4686 /* "csv" */, uintptr(unsafe.Pointer(&CsvModule)), uintptr(0)) if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+4510 /* "csv_wr" */, uintptr(unsafe.Pointer(&CsvModuleFauxWrite)), uintptr(0)) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+4690 /* "csv_wr" */, uintptr(unsafe.Pointer(&CsvModuleFauxWrite)), uintptr(0)) } return rc } @@ -18858,7 +20162,7 @@ func sqlite3_decimal_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uint uintptr(0), aFunc[i].FxFunc, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_window_function(tls, db, ts+4517 /* "decimal_sum" */, 1, + rc = sqlite3.Xsqlite3_create_window_function(tls, db, ts+4697 /* "decimal_sum" */, 1, ((SQLITE_UTF8 | SQLITE_INNOCUOUS) | SQLITE_DETERMINISTIC), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) @@ -18868,7 +20172,7 @@ func sqlite3_decimal_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uint }{decimalSumInverse})), uintptr(0)) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_collation(tls, db, ts+4529 /* "decimal" */, SQLITE_UTF8, + rc = sqlite3.Xsqlite3_create_collation(tls, db, ts+4709 /* "decimal" */, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{decimalCollFunc}))) @@ -18882,11 +20186,11 @@ var aFunc = [5]struct { _ [4]byte FxFunc uintptr }{ - {FzFuncName: ts + 4529 /* "decimal" */, FnArg: 1, FxFunc: 0}, - {FzFuncName: ts + 4537 /* "decimal_cmp" */, FnArg: 2, FxFunc: 0}, - {FzFuncName: ts + 4549 /* "decimal_add" */, FnArg: 2, FxFunc: 0}, - {FzFuncName: ts + 4561 /* "decimal_sub" */, FnArg: 2, FxFunc: 0}, - {FzFuncName: ts + 4573 /* "decimal_mul" */, FnArg: 2, FxFunc: 0}, + {FzFuncName: ts + 4709 /* "decimal" */, FnArg: 1, FxFunc: 0}, + {FzFuncName: ts + 4717 /* "decimal_cmp" */, FnArg: 2, FxFunc: 0}, + {FzFuncName: ts + 4729 /* "decimal_add" */, FnArg: 2, FxFunc: 0}, + {FzFuncName: ts + 4741 /* "decimal_sub" */, FnArg: 2, FxFunc: 0}, + {FzFuncName: ts + 4753 /* "decimal_mul" */, FnArg: 2, FxFunc: 0}, } /* decimal.c:606:5 */ // Structure used to accumulate the output @@ -18911,7 +20215,7 @@ func callback(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr, colnames ui if *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) != 0 { z = *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) } else { - z = ts + 488 /* "" */ + z = ts + 489 /* "" */ } var sz size_t = libc.Xstrlen(tls, z) if (((sqlite3_int64(sz) + (*EvalResult)(unsafe.Pointer(p)).FnUsed) + sqlite3_int64((*EvalResult)(unsafe.Pointer(p)).FszSep)) + int64(1)) > (*EvalResult)(unsafe.Pointer(p)).FnAlloc { @@ -18957,7 +20261,7 @@ func sqlEvalFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* // var x EvalResult at bp, 40 libc.Xmemset(tls, bp /* &x */, 0, uint64(unsafe.Sizeof(EvalResult{}))) - (*EvalResult)(unsafe.Pointer(bp /* &x */)).FzSep = ts + 4585 /* " " */ + (*EvalResult)(unsafe.Pointer(bp /* &x */)).FzSep = ts + 4765 /* " " */ zSql = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zSql == uintptr(0) { return @@ -18989,13 +20293,13 @@ func sqlite3_eval_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr _ = pApi _ = pzErrMsg // Unused parameter - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+4587 /* "eval" */, 1, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+4767 /* "eval" */, 1, (SQLITE_UTF8 | SQLITE_DIRECTONLY), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{sqlEvalFunc})), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+4587 /* "eval" */, 2, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+4767 /* "eval" */, 2, (SQLITE_UTF8 | SQLITE_DIRECTONLY), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) @@ -19050,7 +20354,7 @@ func explainConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv ui // Column numbers rc = sqlite3.Xsqlite3_declare_vtab(tls, db, - ts+4592 /* "CREATE TABLE x(a..." */) + ts+4772 /* "CREATE TABLE x(a..." */) if rc == SQLITE_OK { pNew = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(explain_vtab{}))) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -19150,7 +20454,7 @@ func explainFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uint sqlite3.Xsqlite3_free(tls, (*explain_cursor)(unsafe.Pointer(pCur)).FzSql) (*explain_cursor)(unsafe.Pointer(pCur)).FzSql = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))))) if (*explain_cursor)(unsafe.Pointer(pCur)).FzSql != 0 { - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+4654 /* "EXPLAIN %s" */, libc.VaList(bp+8, (*explain_cursor)(unsafe.Pointer(pCur)).FzSql)) + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+4834 /* "EXPLAIN %s" */, libc.VaList(bp+8, (*explain_cursor)(unsafe.Pointer(pCur)).FzSql)) } if zSql == uintptr(0) { rc = SQLITE_NOMEM @@ -19226,7 +20530,7 @@ var explainModule = sqlite3_module{ // xCreate func sqlite3ExplainVtabInit(tls *libc.TLS, db uintptr) int32 { /* explain.c:300:5: */ var rc int32 = SQLITE_OK - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+4665 /* "explain" */, uintptr(unsafe.Pointer(&explainModule)), uintptr(0)) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+4845 /* "explain" */, uintptr(unsafe.Pointer(&explainModule)), uintptr(0)) return rc } @@ -19401,6 +20705,8 @@ type flock = struct { // The X/Open Unix extensions are available. +// Encryption is present. + // The enhanced internationalization capabilities according to XPG4.2 // are present. @@ -19692,7 +20998,7 @@ type flock = struct { // Never include this file directly; use instead. -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -19777,11 +21083,11 @@ type flock = struct { // The Single Unix specification says that some more types are // available here. -type useconds_t = uint32 /* unistd.h:255:22 */ +type useconds_t = uint32 /* unistd.h:258:22 */ -type intptr_t = int64 /* unistd.h:267:20 */ +type intptr_t = int64 /* unistd.h:270:20 */ -type socklen_t = uint32 /* unistd.h:274:21 */ +type socklen_t = uint32 /* unistd.h:277:21 */ // Define some macros helping to catch buffer overflows. @@ -20015,7 +21321,7 @@ type itimerval = struct { // License along with the GNU C Library; if not, see // . -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -20268,7 +21574,7 @@ func readFileContents(tls *libc.TLS, ctx uintptr, zName uintptr) { /* fileio.c:1 var db uintptr var mxBlob int32 - in = libc.Xfopen(tls, zName, ts+4086 /* "rb" */) + in = libc.Xfopen(tls, zName, ts+4273 /* "rb" */) if in == uintptr(0) { // File does not exist or is unreadable. Leave the result set to NULL. return @@ -20428,7 +21734,7 @@ func writeFile(tls *libc.TLS, pCtx uintptr, zFile uintptr, pData uintptr, mode m var nWrite sqlite3_int64 = int64(0) var z uintptr var rc int32 = 0 - var out uintptr = libc.Xfopen(tls, zFile, ts+4673 /* "wb" */) + var out uintptr = libc.Xfopen(tls, zFile, ts+4853 /* "wb" */) if out == uintptr(0) { return 1 } @@ -20479,7 +21785,7 @@ func writefileFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { / if (argc < 2) || (argc > 4) { sqlite3.Xsqlite3_result_error(tls, context, - ts+4676 /* "wrong number of ..." */, -1) + ts+4856 /* "wrong number of ..." */, -1) return } @@ -20503,11 +21809,11 @@ func writefileFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { / if (argc > 2) && (res != 0) { if ((mode) & mode_t(0170000)) == (mode_t(0120000)) { - ctxErrorMsg(tls, context, ts+4726 /* "failed to create..." */, libc.VaList(bp, zFile)) + ctxErrorMsg(tls, context, ts+4906 /* "failed to create..." */, libc.VaList(bp, zFile)) } else if ((mode) & mode_t(0170000)) == (mode_t(0040000)) { - ctxErrorMsg(tls, context, ts+4755 /* "failed to create..." */, libc.VaList(bp+8, zFile)) + ctxErrorMsg(tls, context, ts+4935 /* "failed to create..." */, libc.VaList(bp+8, zFile)) } else { - ctxErrorMsg(tls, context, ts+4786 /* "failed to write ..." */, libc.VaList(bp+16, zFile)) + ctxErrorMsg(tls, context, ts+4966 /* "failed to write ..." */, libc.VaList(bp+16, zFile)) } } } @@ -20620,7 +21926,7 @@ func fsdirConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _ = argc _ = argv _ = pzErr - rc = sqlite3.Xsqlite3_declare_vtab(tls, db, ts+4811 /* "CREATE TABLE x(n..." */) + rc = sqlite3.Xsqlite3_declare_vtab(tls, db, ts+4991 /* "CREATE TABLE x(n..." */) if rc == SQLITE_OK { pNew = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(fsdir_tab{}))) if pNew == uintptr(0) { @@ -20725,7 +22031,7 @@ func fsdirNext(tls *libc.TLS, cur uintptr) int32 { /* fileio.c:666:12: */ (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath = uintptr(0) (*FsdirLevel)(unsafe.Pointer(pLvl)).FpDir = libc.Xopendir(tls, (*FsdirLevel)(unsafe.Pointer(pLvl)).FzDir) if (*FsdirLevel)(unsafe.Pointer(pLvl)).FpDir == uintptr(0) { - fsdirSetErrmsg(tls, pCur, ts+4871 /* "cannot read dire..." */, libc.VaList(bp, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath)) + fsdirSetErrmsg(tls, pCur, ts+5051 /* "cannot read dire..." */, libc.VaList(bp, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath)) return SQLITE_ERROR } } @@ -20743,12 +22049,12 @@ func fsdirNext(tls *libc.TLS, cur uintptr) int32 { /* fileio.c:666:12: */ } } sqlite3.Xsqlite3_free(tls, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath) - (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath = sqlite3.Xsqlite3_mprintf(tls, ts+4897 /* "%s/%s" */, libc.VaList(bp+8, (*FsdirLevel)(unsafe.Pointer(pLvl)).FzDir, pEntry+19 /* &.d_name */)) + (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath = sqlite3.Xsqlite3_mprintf(tls, ts+5077 /* "%s/%s" */, libc.VaList(bp+8, (*FsdirLevel)(unsafe.Pointer(pLvl)).FzDir, pEntry+19 /* &.d_name */)) if (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath == uintptr(0) { return SQLITE_NOMEM } if fileLinkStat(tls, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath, (pCur+40 /* &.sStat */)) != 0 { - fsdirSetErrmsg(tls, pCur, ts+4903 /* "cannot stat file..." */, libc.VaList(bp+24, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath)) + fsdirSetErrmsg(tls, pCur, ts+5083 /* "cannot stat file..." */, libc.VaList(bp+24, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath)) return SQLITE_ERROR } return SQLITE_OK @@ -20870,13 +22176,13 @@ func fsdirFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc fsdirResetCursor(tls, pCur) if idxNum == 0 { - fsdirSetErrmsg(tls, pCur, ts+4924 /* "table function f..." */, 0) + fsdirSetErrmsg(tls, pCur, ts+5104 /* "table function f..." */, 0) return SQLITE_ERROR } zDir = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zDir == uintptr(0) { - fsdirSetErrmsg(tls, pCur, ts+4966 /* "table function f..." */, 0) + fsdirSetErrmsg(tls, pCur, ts+5146 /* "table function f..." */, 0) return SQLITE_ERROR } if argc == 2 { @@ -20884,7 +22190,7 @@ func fsdirFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc } if (*fsdir_cursor)(unsafe.Pointer(pCur)).FzBase != 0 { (*fsdir_cursor)(unsafe.Pointer(pCur)).FnBase = (int32(libc.Xstrlen(tls, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzBase)) + 1) - (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath = sqlite3.Xsqlite3_mprintf(tls, ts+4897 /* "%s/%s" */, libc.VaList(bp, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzBase, zDir)) + (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath = sqlite3.Xsqlite3_mprintf(tls, ts+5077 /* "%s/%s" */, libc.VaList(bp, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzBase, zDir)) } else { (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+16, zDir)) } @@ -20893,7 +22199,7 @@ func fsdirFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc return SQLITE_NOMEM } if fileLinkStat(tls, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath, (pCur+40 /* &.sStat */)) != 0 { - fsdirSetErrmsg(tls, pCur, ts+4903 /* "cannot stat file..." */, libc.VaList(bp+24, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath)) + fsdirSetErrmsg(tls, pCur, ts+5083 /* "cannot stat file..." */, libc.VaList(bp+24, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath)) return SQLITE_ERROR } @@ -20995,7 +22301,7 @@ __3: // Register the "fsdir" virtual table. func fsdirRegister(tls *libc.TLS, db uintptr) int32 { /* fileio.c:938:12: */ - var rc int32 = sqlite3.Xsqlite3_create_module(tls, db, ts+5016 /* "fsdir" */, uintptr(unsafe.Pointer(&fsdirModule1)), uintptr(0)) + var rc int32 = sqlite3.Xsqlite3_create_module(tls, db, ts+5196 /* "fsdir" */, uintptr(unsafe.Pointer(&fsdirModule1)), uintptr(0)) return rc } @@ -21017,20 +22323,20 @@ func sqlite3_fileio_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintp _ = pApi _ = pzErrMsg // Unused parameter - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5022 /* "readfile" */, 1, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5202 /* "readfile" */, 1, (SQLITE_UTF8 | SQLITE_DIRECTONLY), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{readfileFunc})), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5031 /* "writefile" */, -1, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5211 /* "writefile" */, -1, (SQLITE_UTF8 | SQLITE_DIRECTONLY), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{writefileFunc})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5041 /* "lsmode" */, 1, SQLITE_UTF8, uintptr(0), + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5221 /* "lsmode" */, 1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{lsModeFunc})), uintptr(0), uintptr(0)) @@ -21169,10 +22475,10 @@ func fuzzerLoadOneRule(tls *libc.TLS, p uintptr, pStmt uintptr, ppRule uintptr, var pRule uintptr = uintptr(0) // New rule object to return if zFrom == uintptr(0) { - zFrom = ts + 488 /* "" */ + zFrom = ts + 489 /* "" */ } if zTo == uintptr(0) { - zTo = ts + 488 /* "" */ + zTo = ts + 489 /* "" */ } nFrom = int32(libc.Xstrlen(tls, zFrom)) nTo = int32(libc.Xstrlen(tls, zTo)) @@ -21184,15 +22490,15 @@ func fuzzerLoadOneRule(tls *libc.TLS, p uintptr, pStmt uintptr, ppRule uintptr, } if (nCost <= 0) || (nCost > FUZZER_MX_COST) { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3118, /* "%s: cost must be..." */ + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3175, /* "%s: cost must be..." */ libc.VaList(bp, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, FUZZER_MX_COST)) rc = SQLITE_ERROR } else if (nFrom > FUZZER_MX_LENGTH) || (nTo > FUZZER_MX_LENGTH) { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3152, /* "%s: maximum stri..." */ + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3209, /* "%s: maximum stri..." */ libc.VaList(bp+16, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, FUZZER_MX_LENGTH)) rc = SQLITE_ERROR - } else if (iRuleset < int64(0)) || (iRuleset > FUZZER_MX_RULEID) { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+5048, /* "%s: ruleset must..." */ + } else if (iRuleset < int64(0)) || (iRuleset > int64(FUZZER_MX_RULEID)) { + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+5228, /* "%s: ruleset must..." */ libc.VaList(bp+32, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, FUZZER_MX_RULEID)) rc = SQLITE_ERROR } else { @@ -21226,7 +22532,7 @@ func fuzzerLoadRules(tls *libc.TLS, db uintptr, p uintptr, zDb uintptr, zData ui var zSql uintptr // SELECT used to read from rules table var pHead uintptr = uintptr(0) - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+3221 /* "SELECT * FROM %Q..." */, libc.VaList(bp, zDb, zData)) + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+3278 /* "SELECT * FROM %Q..." */, libc.VaList(bp, zDb, zData)) if zSql == uintptr(0) { rc = SQLITE_NOMEM } else { @@ -21234,9 +22540,9 @@ func fuzzerLoadRules(tls *libc.TLS, db uintptr, p uintptr, zDb uintptr, zData ui *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)) = uintptr(0) rc = sqlite3.Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+56 /* &pStmt */, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3241 /* "%s: %s" */, libc.VaList(bp+16, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, sqlite3.Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3298 /* "%s: %s" */, libc.VaList(bp+16, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, sqlite3.Xsqlite3_errmsg(tls, db))) } else if sqlite3.Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */))) != 4 { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3248, /* "%s: %s has %d co..." */ + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3305, /* "%s: %s has %d co..." */ libc.VaList(bp+32, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, zData, sqlite3.Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */))))) rc = SQLITE_ERROR } else { @@ -21363,7 +22669,7 @@ func fuzzerConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uin if argc != 4 { *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, - ts+5085 /* "%s: wrong number..." */, libc.VaList(bp, zModule)) + ts+5265 /* "%s: wrong number..." */, libc.VaList(bp, zModule)) rc = SQLITE_ERROR } else { var nModule sqlite3_int64 // Length of zModule, in bytes @@ -21388,7 +22694,7 @@ func fuzzerConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uin } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_declare_vtab(tls, db, ts+5136 /* "CREATE TABLE x(w..." */) + rc = sqlite3.Xsqlite3_declare_vtab(tls, db, ts+5316 /* "CREATE TABLE x(w..." */) } if rc != SQLITE_OK { fuzzerDisconnect(tls, pNew) @@ -21491,7 +22797,7 @@ func fuzzerHash(tls *libc.TLS, z uintptr) uint32 { /* fuzzer.c:647:21: */ for *(*int8)(unsafe.Pointer(z)) != 0 { h = (((h << 3) ^ (h >> 29)) ^ uint32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) } - return (h % FUZZER_HASH) + return (h % uint32(FUZZER_HASH)) } // Current cost of a stem @@ -21768,7 +23074,7 @@ func fuzzerNext(tls *libc.TLS, cur uintptr) int32 { /* fuzzer.c:901:12: */ // prior to any fuzzerColumn, fuzzerRowid, or fuzzerEof call. func fuzzerFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* fuzzer.c:969:12: */ var pCur uintptr = pVtabCursor - var zWord uintptr = ts + 488 /* "" */ + var zWord uintptr = ts + 489 /* "" */ var pStem uintptr var idx int32 @@ -21791,7 +23097,7 @@ func fuzzerFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp (*fuzzer_cursor)(unsafe.Pointer(pCur)).FnullRule.FrCost = 0 (*fuzzer_cursor)(unsafe.Pointer(pCur)).FnullRule.FnFrom = int8(0) (*fuzzer_cursor)(unsafe.Pointer(pCur)).FnullRule.FnTo = int8(0) - (*fuzzer_cursor)(unsafe.Pointer(pCur)).FnullRule.FzFrom = ts + 488 /* "" */ + (*fuzzer_cursor)(unsafe.Pointer(pCur)).FnullRule.FzFrom = ts + 489 /* "" */ (*fuzzer_cursor)(unsafe.Pointer(pCur)).FiRowid = int64(1) // If the query term is longer than FUZZER_MX_OUTPUT_LENGTH bytes, this @@ -21968,7 +23274,7 @@ func sqlite3_fuzzer_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintp var rc int32 = SQLITE_OK _ = pApi - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+5174 /* "fuzzer" */, uintptr(unsafe.Pointer(&fuzzerModule)), uintptr(0)) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+5354 /* "fuzzer" */, uintptr(unsafe.Pointer(&fuzzerModule)), uintptr(0)) return rc } @@ -22030,7 +23336,7 @@ func ieee754func(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* } switch *(*int32)(unsafe.Pointer(sqlite3.Xsqlite3_user_data(tls, context))) { case 0: - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+40 /* &zResult[0] */, ts+5181, /* "ieee754(%lld,%d)" */ + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+40 /* &zResult[0] */, ts+5361, /* "ieee754(%lld,%d)" */ libc.VaList(bp, m, (e-1075))) sqlite3.Xsqlite3_result_text(tls, context, bp+40 /* &zResult[0] */, -1, libc.UintptrFromInt32(-1)) break @@ -22053,6 +23359,14 @@ func ieee754func(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* var isNeg int32 = 0 m = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv))) e = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + + // Limit the range of e. Ticket 22dea1cfdb9151e4 2021-03-02 + if e > int64(10000) { + e = int64(10000) + } else if e < int64(-10000) { + e = int64(-10000) + } + if m < int64(0) { isNeg = 1 m = -m @@ -22090,7 +23404,7 @@ func ieee754func(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* } // Functions to convert between blobs and floats. -func ieee754func_from_blob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* ieee754.c:205:13: */ +func ieee754func_from_blob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* ieee754.c:213:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -22110,7 +23424,7 @@ func ieee754func_from_blob(tls *libc.TLS, context uintptr, argc int32, argv uint } } -func ieee754func_to_blob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* ieee754.c:225:13: */ +func ieee754func_to_blob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* ieee754.c:233:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -22132,7 +23446,7 @@ func ieee754func_to_blob(tls *libc.TLS, context uintptr, argc int32, argv uintpt } } -func sqlite3_ieee_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* ieee754.c:251:5: */ +func sqlite3_ieee_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* ieee754.c:259:5: */ var i uint32 var rc int32 = SQLITE_OK _ = pApi @@ -22158,13 +23472,13 @@ var aFunc1 = [6]struct { FiAux int32 FxFunc uintptr }{ - {FzFName: ts + 5198 /* "ieee754" */, FnArg: 1, FxFunc: 0}, - {FzFName: ts + 5198 /* "ieee754" */, FnArg: 2, FxFunc: 0}, - {FzFName: ts + 5206 /* "ieee754_mantissa" */, FnArg: 1, FiAux: 1, FxFunc: 0}, - {FzFName: ts + 5223 /* "ieee754_exponent" */, FnArg: 1, FiAux: 2, FxFunc: 0}, - {FzFName: ts + 5240 /* "ieee754_to_blob" */, FnArg: 1, FxFunc: 0}, - {FzFName: ts + 5256 /* "ieee754_from_blo..." */, FnArg: 1, FxFunc: 0}, -} /* ieee754.c:261:5 */ + {FzFName: ts + 5378 /* "ieee754" */, FnArg: 1, FxFunc: 0}, + {FzFName: ts + 5378 /* "ieee754" */, FnArg: 2, FxFunc: 0}, + {FzFName: ts + 5386 /* "ieee754_mantissa" */, FnArg: 1, FiAux: 1, FxFunc: 0}, + {FzFName: ts + 5403 /* "ieee754_exponent" */, FnArg: 1, FiAux: 2, FxFunc: 0}, + {FzFName: ts + 5420 /* "ieee754_to_blob" */, FnArg: 1, FxFunc: 0}, + {FzFName: ts + 5436 /* "ieee754_from_blo..." */, FnArg: 1, FxFunc: 0}, +} /* ieee754.c:269:5 */ // // END OF REGISTRATION API @@ -22203,22 +23517,22 @@ func sqlite3_mmap_warm(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* mmapwa } // Open a read-only transaction on the file in question - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+5274, /* "BEGIN; SELECT * ..." */ + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+5454, /* "BEGIN; SELECT * ..." */ libc.VaList(bp, func() uintptr { if zDb != 0 { - return ts + 5315 /* "'" */ + return ts + 5495 /* "'" */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), func() uintptr { if zDb != 0 { return zDb } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), func() uintptr { if zDb != 0 { - return ts + 5317 /* "'." */ + return ts + 5497 /* "'." */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }())) if zSql == uintptr(0) { return SQLITE_NOMEM @@ -22228,22 +23542,22 @@ func sqlite3_mmap_warm(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* mmapwa // Find the SQLite page size of the file if rc == SQLITE_OK { - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+5320, /* "PRAGMA %s%q%spag..." */ + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+5500, /* "PRAGMA %s%q%spag..." */ libc.VaList(bp+24, func() uintptr { if zDb != 0 { - return ts + 5315 /* "'" */ + return ts + 5495 /* "'" */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), func() uintptr { if zDb != 0 { return zDb } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), func() uintptr { if zDb != 0 { - return ts + 5317 /* "'." */ + return ts + 5497 /* "'." */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }())) if zSql == uintptr(0) { rc = SQLITE_NOMEM @@ -22289,7 +23603,7 @@ func sqlite3_mmap_warm(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* mmapwa iPg++ } sqlite3.Xsqlite3_log(tls, SQLITE_OK, - ts+5343 /* "sqlite3_mmap_war..." */, libc.VaList(bp+48, func() int64 { + ts+5523 /* "sqlite3_mmap_war..." */, libc.VaList(bp+48, func() int64 { if iPg == int64(1) { return int64(0) } @@ -22298,7 +23612,7 @@ func sqlite3_mmap_warm(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* mmapwa sqlite3.Xsqlite3_db_filename(tls, db, zDb))) } - rc2 = sqlite3.Xsqlite3_exec(tls, db, ts+5393 /* "END" */, uintptr(0), uintptr(0), uintptr(0)) + rc2 = sqlite3.Xsqlite3_exec(tls, db, ts+5573 /* "END" */, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } @@ -22477,18 +23791,18 @@ func nextCharFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* if ((argc >= 4) && ((libc.AssignUintptr(&zWhere, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))))) != uintptr(0))) && (int32(*(*uint8)(unsafe.Pointer(zWhere))) != 0) { - zWhereClause = sqlite3.Xsqlite3_mprintf(tls, ts+5397 /* "AND (%s)" */, libc.VaList(bp, zWhere)) + zWhereClause = sqlite3.Xsqlite3_mprintf(tls, ts+5577 /* "AND (%s)" */, libc.VaList(bp, zWhere)) if zWhereClause == uintptr(0) { sqlite3.Xsqlite3_result_error_nomem(tls, context) return } } else { - zWhereClause = ts + 488 /* "" */ + zWhereClause = ts + 489 /* "" */ } if ((argc >= 5) && ((libc.AssignUintptr(&zCollName, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8))))) != uintptr(0))) && (int32(*(*uint8)(unsafe.Pointer(zCollName))) != 0) { - zColl = sqlite3.Xsqlite3_mprintf(tls, ts+5406 /* "collate \"%w\"" */, libc.VaList(bp+8, zCollName)) + zColl = sqlite3.Xsqlite3_mprintf(tls, ts+5586 /* "collate \"%w\"" */, libc.VaList(bp+8, zCollName)) if zColl == uintptr(0) { sqlite3.Xsqlite3_result_error_nomem(tls, context) if *(*int8)(unsafe.Pointer(zWhereClause)) != 0 { @@ -22497,13 +23811,13 @@ func nextCharFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* return } } else { - zColl = ts + 488 /* "" */ + zColl = ts + 489 /* "" */ } zSql = sqlite3.Xsqlite3_mprintf(tls, // 1114111 == 0x10ffff - ts+5419, /* "SELECT %s FROM %..." */ + ts+5599, /* "SELECT %s FROM %..." */ libc.VaList(bp+16, zField, zTable, zField, zColl, zField, zColl, zWhereClause, zColl)) if *(*int8)(unsafe.Pointer(zWhereClause)) != 0 { sqlite3.Xsqlite3_free(tls, zWhereClause) @@ -22549,20 +23863,20 @@ func sqlite3_nextchar_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uin _ = pApi _ = pzErrMsg // Unused parameter - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5527 /* "next_char" */, 3, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5707 /* "next_char" */, 3, (SQLITE_UTF8 | SQLITE_INNOCUOUS), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{nextCharFunc})), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5527 /* "next_char" */, 4, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5707 /* "next_char" */, 4, (SQLITE_UTF8 | SQLITE_INNOCUOUS), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{nextCharFunc})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5527 /* "next_char" */, 5, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5707 /* "next_char" */, 5, (SQLITE_UTF8 | SQLITE_INNOCUOUS), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) @@ -23109,9 +24423,9 @@ func sqlite3_normalize(tls *libc.TLS, zSql uintptr) uintptr { /* normalize.c:555 fallthrough case TK_NAME: { - if (n == 4) && (sqlite3.Xsqlite3_strnicmp(tls, (zSql+uintptr(i)), ts+5537 /* "NULL" */, 4) == 0) { - if (((j >= 3) && (libc.Xstrncmp(tls, ((z+uintptr(j))-uintptr(2)), ts+5542 /* "is" */, uint64(2)) == 0)) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((j - 3)))))]) & 0x46) != 0)) || - (((j >= 4) && (libc.Xstrncmp(tls, ((z+uintptr(j))-uintptr(3)), ts+5545 /* "not" */, uint64(3)) == 0)) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((j - 4)))))]) & 0x46) != 0)) { + if (n == 4) && (sqlite3.Xsqlite3_strnicmp(tls, (zSql+uintptr(i)), ts+5717 /* "NULL" */, 4) == 0) { + if (((j >= 3) && (libc.Xstrncmp(tls, ((z+uintptr(j))-uintptr(2)), ts+5722 /* "is" */, uint64(2)) == 0)) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((j - 3)))))]) & 0x46) != 0)) || + (((j >= 4) && (libc.Xstrncmp(tls, ((z+uintptr(j))-uintptr(3)), ts+5725 /* "not" */, uint64(3)) == 0)) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((j - 4)))))]) & 0x46) != 0)) { // NULL is a keyword in this case, not a literal value } else { // Here the NULL is a literal value @@ -23141,7 +24455,7 @@ func sqlite3_normalize(tls *libc.TLS, zSql uintptr) uintptr { /* normalize.c:555 // Make a second pass converting "in(...)" where the "..." is not a // SELECT statement into "in(?,?,?)" for i = 0; i < j; i = n { - var zIn uintptr = libc.Xstrstr(tls, (z + uintptr(i)), ts+5549 /* "in(" */) + var zIn uintptr = libc.Xstrstr(tls, (z + uintptr(i)), ts+5729 /* "in(" */) var nParen int32 if zIn == uintptr(0) { break @@ -23150,10 +24464,10 @@ func sqlite3_normalize(tls *libc.TLS, zSql uintptr) uintptr { /* normalize.c:555 if (n != 0) && ((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + libc.UintptrFromInt32(-1))))]) & 0x46) != 0) { continue } - if (libc.Xstrncmp(tls, zIn, ts+5553 /* "in(select" */, uint64(9)) == 0) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + 9)))]) & 0x46) != 0) { + if (libc.Xstrncmp(tls, zIn, ts+5733 /* "in(select" */, uint64(9)) == 0) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + 9)))]) & 0x46) != 0) { continue } - if (libc.Xstrncmp(tls, zIn, ts+5563 /* "in(with" */, uint64(7)) == 0) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + 7)))]) & 0x46) != 0) { + if (libc.Xstrncmp(tls, zIn, ts+5743 /* "in(with" */, uint64(7)) == 0) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + 7)))]) & 0x46) != 0) { continue } nParen = 1 @@ -23181,7 +24495,7 @@ func sqlite3_normalize(tls *libc.TLS, zSql uintptr) uintptr { /* normalize.c:555 } j = ((j - k) + 5) *(*int8)(unsafe.Pointer(z + uintptr(j))) = int8(0) - libc.Xmemcpy(tls, (z + uintptr(n)), ts+5571 /* "?,?,?" */, uint64(5)) + libc.Xmemcpy(tls, (z + uintptr(n)), ts+5751 /* "?,?,?" */, uint64(5)) } return z } @@ -23279,7 +24593,7 @@ func percentStep(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* per if (((eType != SQLITE_INTEGER) && (eType != SQLITE_FLOAT)) || (rPct < 0.0)) || (rPct > 100.0) { sqlite3.Xsqlite3_result_error(tls, pCtx, - ts+5577 /* "2nd argument to ..." */, -1) + ts+5757 /* "2nd argument to ..." */, -1) return } @@ -23295,7 +24609,7 @@ func percentStep(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* per (*Percentile)(unsafe.Pointer(p)).FrPct = (rPct + 1.0) } else if !(sameValue(tls, (*Percentile)(unsafe.Pointer(p)).FrPct, (rPct+1.0)) != 0) { sqlite3.Xsqlite3_result_error(tls, pCtx, - ts+5644 /* "2nd argument to ..." */, -1) + ts+5824 /* "2nd argument to ..." */, -1) return } @@ -23309,14 +24623,14 @@ func percentStep(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* per // Requirement 4 if (eType != SQLITE_INTEGER) && (eType != SQLITE_FLOAT) { sqlite3.Xsqlite3_result_error(tls, pCtx, - ts+5708 /* "1st argument to ..." */, -1) + ts+5888 /* "1st argument to ..." */, -1) return } // Throw an error if the Y value is infinity or NaN y = sqlite3.Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))) if isInfinity(tls, y) != 0 { - sqlite3.Xsqlite3_result_error(tls, pCtx, ts+5752 /* "Inf input to per..." */, -1) + sqlite3.Xsqlite3_result_error(tls, pCtx, ts+5932 /* "Inf input to per..." */, -1) return } @@ -23391,7 +24705,7 @@ func sqlite3_percentile_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi u _ = pApi _ = pzErrMsg // Unused parameter - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5778 /* "percentile" */, 2, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5958 /* "percentile" */, 2, (SQLITE_UTF8 | SQLITE_INNOCUOUS), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) @@ -23533,7 +24847,7 @@ func prefixesConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv u var rc int32 rc = sqlite3.Xsqlite3_declare_vtab(tls, db, - ts+5789 /* "CREATE TABLE pre..." */) + ts+5969 /* "CREATE TABLE pre..." */) if rc == SQLITE_OK { pNew = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(prefixes_vtab{}))) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -23748,10 +25062,10 @@ func sqlite3_prefixes_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uin var rc int32 = SQLITE_OK _ = pApi - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+5853 /* "prefixes" */, uintptr(unsafe.Pointer(&prefixesModule)), uintptr(0)) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+6033 /* "prefixes" */, uintptr(unsafe.Pointer(&prefixesModule)), uintptr(0)) if rc == SQLITE_OK { rc = sqlite3.Xsqlite3_create_function(tls, - db, ts+5862 /* "prefix_length" */, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + db, ts+6042 /* "prefix_length" */, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{prefixLengthFunc})), uintptr(0), uintptr(0)) } @@ -24325,13 +25639,13 @@ func re_esc_char(tls *libc.TLS, p uintptr) uint32 { /* regexp.c:403:17: */ } (*ReCompiled)(unsafe.Pointer(p)).FsIn.Fi++ } else { - (*ReCompiled)(unsafe.Pointer(p)).FzErr = ts + 5876 /* "unknown \\ escape" */ + (*ReCompiled)(unsafe.Pointer(p)).FzErr = ts + 6056 /* "unknown \\ escape" */ } return uint32(c) } -var zEsc = *(*[21]int8)(unsafe.Pointer(ts + 5893 /* "afnrtv\\()*.+?[$^..." */)) /* regexp.c:404:21 */ -var zTrans = *(*[7]int8)(unsafe.Pointer(ts + 5914 /* "\a\f\n\r\t\v" */)) /* regexp.c:405:21 */ +var zEsc = *(*[21]int8)(unsafe.Pointer(ts + 6073 /* "afnrtv\\()*.+?[$^..." */)) /* regexp.c:404:21 */ +var zTrans = *(*[7]int8)(unsafe.Pointer(ts + 6094 /* "\a\f\n\r\t\v" */)) /* regexp.c:405:21 */ // Peek at the next byte of input func rePeek(tls *libc.TLS, p uintptr) uint8 { /* regexp.c:444:22: */ @@ -24396,7 +25710,7 @@ func re_subcompile_string(tls *libc.TLS, p uintptr) uintptr { /* regexp.c:474:19 return zErr } if int32(rePeek(tls, p)) != ')' { - return ts + 5921 /* "unmatched '('" */ + return ts + 6101 /* "unmatched '('" */ } (*ReCompiled)(unsafe.Pointer(p)).FsIn.Fi++ break @@ -24416,7 +25730,7 @@ func re_subcompile_string(tls *libc.TLS, p uintptr) uintptr { /* regexp.c:474:19 case uint32('*'): { if iPrev < 0 { - return ts + 5935 /* "'*' without oper..." */ + return ts + 6115 /* "'*' without oper..." */ } re_insert(tls, p, iPrev, RE_OP_GOTO, (int32(((*ReCompiled)(unsafe.Pointer(p)).FnState - uint32(iPrev)) + uint32(1)))) re_append(tls, p, RE_OP_FORK, (int32((uint32(iPrev) - (*ReCompiled)(unsafe.Pointer(p)).FnState) + uint32(1)))) @@ -24426,7 +25740,7 @@ func re_subcompile_string(tls *libc.TLS, p uintptr) uintptr { /* regexp.c:474:19 case uint32('+'): { if iPrev < 0 { - return ts + 5955 /* "'+' without oper..." */ + return ts + 6135 /* "'+' without oper..." */ } re_append(tls, p, RE_OP_FORK, (int32(uint32(iPrev) - (*ReCompiled)(unsafe.Pointer(p)).FnState))) break @@ -24435,7 +25749,7 @@ func re_subcompile_string(tls *libc.TLS, p uintptr) uintptr { /* regexp.c:474:19 case uint32('?'): { if iPrev < 0 { - return ts + 5975 /* "'?' without oper..." */ + return ts + 6155 /* "'?' without oper..." */ } re_insert(tls, p, iPrev, RE_OP_FORK, (int32(((*ReCompiled)(unsafe.Pointer(p)).FnState - uint32(iPrev)) + uint32(1)))) break @@ -24448,7 +25762,7 @@ func re_subcompile_string(tls *libc.TLS, p uintptr) uintptr { /* regexp.c:474:19 var sz int32 var j int32 if iPrev < 0 { - return ts + 5995 /* "'{m,n}' without ..." */ + return ts + 6175 /* "'{m,n}' without ..." */ } for ((libc.AssignUint32(&c, uint32(rePeek(tls, p)))) >= uint32('0')) && (c <= uint32('9')) { m = (int32(((uint32(m * 10)) + c) - uint32('0'))) @@ -24464,16 +25778,16 @@ func re_subcompile_string(tls *libc.TLS, p uintptr) uintptr { /* regexp.c:474:19 } } if c != uint32('}') { - return ts + 6019 /* "unmatched '{'" */ + return ts + 6199 /* "unmatched '{'" */ } if (n > 0) && (n < m) { - return ts + 6033 /* "n less than m in..." */ + return ts + 6213 /* "n less than m in..." */ } (*ReCompiled)(unsafe.Pointer(p)).FsIn.Fi++ sz = (int32((*ReCompiled)(unsafe.Pointer(p)).FnState - uint32(iPrev))) if m == 0 { if n == 0 { - return ts + 6058 /* "both m and n are..." */ + return ts + 6238 /* "both m and n are..." */ } re_insert(tls, p, iPrev, RE_OP_FORK, (sz + 1)) n-- @@ -24503,7 +25817,7 @@ func re_subcompile_string(tls *libc.TLS, p uintptr) uintptr { /* regexp.c:474:19 } for (libc.AssignUint32(&c, (*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer((p + 40 /* &.xNextChar */))))(tls, (p /* &.sIn */)))) != uint32(0) { if (c == uint32('[')) && (int32(rePeek(tls, p)) == ':') { - return ts + 6091 /* "POSIX character ..." */ + return ts + 6271 /* "POSIX character ..." */ } if c == uint32('\\') { c = re_esc_char(tls, p) @@ -24525,7 +25839,7 @@ func re_subcompile_string(tls *libc.TLS, p uintptr) uintptr { /* regexp.c:474:19 } } if c == uint32(0) { - return ts + 6129 /* "unclosed '['" */ + return ts + 6309 /* "unclosed '['" */ } *(*int32)(unsafe.Pointer((*ReCompiled)(unsafe.Pointer(p)).FaArg + uintptr(iFirst)*4)) = (int32((*ReCompiled)(unsafe.Pointer(p)).FnState - uint32(iFirst))) break @@ -24603,7 +25917,7 @@ func sqlite3re_compile(tls *libc.TLS, ppRe uintptr, zIn uintptr, noCase int32) u *(*uintptr)(unsafe.Pointer(ppRe)) = uintptr(0) pRe = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(ReCompiled{}))) if pRe == uintptr(0) { - return ts + 1929 /* "out of memory" */ + return ts + 1930 /* "out of memory" */ } libc.Xmemset(tls, pRe, 0, uint64(unsafe.Sizeof(ReCompiled{}))) (*ReCompiled)(unsafe.Pointer(pRe)).FxNextChar = func() uintptr { @@ -24618,7 +25932,7 @@ func sqlite3re_compile(tls *libc.TLS, ppRe uintptr, zIn uintptr, noCase int32) u }() if re_resize(tls, pRe, 30) != 0 { sqlite3re_free(tls, pRe) - return ts + 1929 /* "out of memory" */ + return ts + 1930 /* "out of memory" */ } if int32(*(*int8)(unsafe.Pointer(zIn))) == '^' { zIn++ @@ -24642,7 +25956,7 @@ func sqlite3re_compile(tls *libc.TLS, ppRe uintptr, zIn uintptr, noCase int32) u *(*uintptr)(unsafe.Pointer(ppRe)) = pRe } else { sqlite3re_free(tls, pRe) - return ts + 6142 /* "unrecognized cha..." */ + return ts + 6322 /* "unrecognized cha..." */ } // The following is a performance optimization. If the regex begins with @@ -24730,7 +26044,7 @@ func sqlite3_regexp_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintp var rc int32 = SQLITE_OK _ = pApi - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+6165 /* "regexp" */, 2, (SQLITE_UTF8 | SQLITE_INNOCUOUS), + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+6345 /* "regexp" */, 2, (SQLITE_UTF8 | SQLITE_INNOCUOUS), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{re_sql_func})), uintptr(0), uintptr(0)) @@ -25111,10 +26425,6 @@ func sqlite3_regexp_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintp // array_name[restrict] // GCC 3.1 supports this. -// Describes a char array whose address can safely be passed as the first -// argument to strncpy and strncat, as the char array is not necessarily -// a NUL-terminated string. - // Determine the wordsize from the preprocessor defines. // Both x86-64 and x32 use the 64-bit system call interface. @@ -25191,7 +26501,7 @@ func rememberFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* re var ptr uintptr v = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv))) - ptr = sqlite3.Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+3862 /* "carray" */) + ptr = sqlite3.Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+3931 /* "carray" */) if ptr != 0 { *(*sqlite3_int64)(unsafe.Pointer(ptr)) = v } @@ -25202,7 +26512,7 @@ func sqlite3_remember_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uin var rc int32 = SQLITE_OK _ = pApi - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+6172 /* "remember" */, 2, SQLITE_UTF8, uintptr(0), + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+6352 /* "remember" */, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rememberFunc})), uintptr(0), uintptr(0)) @@ -25239,14 +26549,18 @@ type series_cursor = series_cursor1 /* series.c:83:30 */ // // (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the // result set of queries against generate_series will look like. -func seriesConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* series.c:107:12: */ +func seriesConnect(tls *libc.TLS, db uintptr, pUnused uintptr, argcUnused int32, argvUnused uintptr, ppVtab uintptr, pzErrUnused uintptr) int32 { /* series.c:107:12: */ var pNew uintptr var rc int32 // Column numbers + _ = pUnused + _ = argcUnused + _ = argvUnused + _ = pzErrUnused rc = sqlite3.Xsqlite3_declare_vtab(tls, db, - ts+6181 /* "CREATE TABLE x(v..." */) + ts+6361 /* "CREATE TABLE x(v..." */) if rc == SQLITE_OK { pNew = libc.AssignPtrUintptr(ppVtab, sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(sqlite3_vtab{})))) if pNew == uintptr(0) { @@ -25259,14 +26573,15 @@ func seriesConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uin } // This method is the destructor for series_cursor objects. -func seriesDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* series.c:137:12: */ +func seriesDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* series.c:141:12: */ sqlite3.Xsqlite3_free(tls, pVtab) return SQLITE_OK } // Constructor for a new series_cursor object. -func seriesOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* series.c:145:12: */ +func seriesOpen(tls *libc.TLS, pUnused uintptr, ppCursor uintptr) int32 { /* series.c:149:12: */ var pCur uintptr + _ = pUnused pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(series_cursor{}))) if pCur == uintptr(0) { return SQLITE_NOMEM @@ -25277,13 +26592,13 @@ func seriesOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* series.c: } // Destructor for a series_cursor. -func seriesClose(tls *libc.TLS, cur uintptr) int32 { /* series.c:157:12: */ +func seriesClose(tls *libc.TLS, cur uintptr) int32 { /* series.c:162:12: */ sqlite3.Xsqlite3_free(tls, cur) return SQLITE_OK } // Advance a series_cursor to its next row of output. -func seriesNext(tls *libc.TLS, cur uintptr) int32 { /* series.c:166:12: */ +func seriesNext(tls *libc.TLS, cur uintptr) int32 { /* series.c:171:12: */ var pCur uintptr = cur if (*series_cursor)(unsafe.Pointer(pCur)).FisDesc != 0 { *(*sqlite3_int64)(unsafe.Pointer(pCur + 24 /* &.iValue */)) -= ((*series_cursor)(unsafe.Pointer(pCur)).FiStep) @@ -25296,7 +26611,7 @@ func seriesNext(tls *libc.TLS, cur uintptr) int32 { /* series.c:166:12: */ // Return values of columns for the row at which the series_cursor // is currently pointing. -func seriesColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* series.c:181:12: */ +func seriesColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* series.c:186:12: */ var pCur uintptr = cur var x sqlite3_int64 = int64(0) switch i { @@ -25320,7 +26635,7 @@ func seriesColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* s // Return the rowid for the current row. In this implementation, the // first row returned is assigned rowid value 1, and each subsequent // row a value 1 more than that of the previous. -func seriesRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* series.c:203:12: */ +func seriesRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* series.c:208:12: */ var pCur uintptr = cur *(*sqlite_int64)(unsafe.Pointer(pRowid)) = (*series_cursor)(unsafe.Pointer(pCur)).FiRowid return SQLITE_OK @@ -25328,7 +26643,7 @@ func seriesRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* series.c // Return TRUE if the cursor has been moved off of the last // row of output. -func seriesEof(tls *libc.TLS, cur uintptr) int32 { /* series.c:213:12: */ +func seriesEof(tls *libc.TLS, cur uintptr) int32 { /* series.c:218:12: */ var pCur uintptr = cur if (*series_cursor)(unsafe.Pointer(pCur)).FisDesc != 0 { return (libc.Bool32((*series_cursor)(unsafe.Pointer(pCur)).FiValue < (*series_cursor)(unsafe.Pointer(pCur)).FmnValue)) @@ -25356,14 +26671,16 @@ func seriesEof(tls *libc.TLS, cur uintptr) int32 { /* series.c:213:12: */ // 4: step=VALUE // // Also, if bit 8 is set, that means that the series should be output -// in descending order rather than in ascending order. +// in descending order rather than in ascending order. If bit 16 is +// set, then output must appear in ascending order. // // This routine should initialize the cursor and position it so that it // is pointing at the first row, or pointing off the end of the table // (so that seriesEof() will return true) if the table is empty. -func seriesFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* series.c:251:12: */ +func seriesFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStrUnused uintptr, argc int32, argv uintptr) int32 { /* series.c:257:12: */ var pCur uintptr = pVtabCursor var i int32 = 0 + _ = idxStrUnused if (idxNum & 1) != 0 { (*series_cursor)(unsafe.Pointer(pCur)).FmnValue = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PostIncInt32(&i, 1))*8))) } else { @@ -25376,8 +26693,13 @@ func seriesFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp } if (idxNum & 4) != 0 { (*series_cursor)(unsafe.Pointer(pCur)).FiStep = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PostIncInt32(&i, 1))*8))) - if (*series_cursor)(unsafe.Pointer(pCur)).FiStep < int64(1) { + if (*series_cursor)(unsafe.Pointer(pCur)).FiStep == int64(0) { (*series_cursor)(unsafe.Pointer(pCur)).FiStep = int64(1) + } else if (*series_cursor)(unsafe.Pointer(pCur)).FiStep < int64(0) { + (*series_cursor)(unsafe.Pointer(pCur)).FiStep = -(*series_cursor)(unsafe.Pointer(pCur)).FiStep + if (idxNum & 16) == 0 { + idxNum = idxNum | (8) + } } } else { (*series_cursor)(unsafe.Pointer(pCur)).FiStep = int64(1) @@ -25419,7 +26741,7 @@ func seriesFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp // (2) stop = $value -- constraint exists // (4) step = $value -- constraint exists // (8) output in descending order -func seriesBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* series.c:313:12: */ +func seriesBestIndex(tls *libc.TLS, tabUnused uintptr, pIdxInfo uintptr) int32 { /* series.c:325:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -25435,6 +26757,7 @@ func seriesBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* se // This implementation assumes that the start, stop, and step columns // are the last three columns in the virtual table. + _ = tabUnused *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */)) = libc.AssignPtrInt32(bp /* &aIdx */ +1*4, libc.AssignPtrInt32(bp /* &aIdx */ +2*4, -1)) pConstraint = (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint i = 0 @@ -25488,6 +26811,8 @@ __3: if (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy == 1 { if (*sqlite3_index_orderby)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy)).Fdesc != 0 { idxNum = idxNum | (8) + } else { + idxNum = idxNum | (16) } (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = 1 } @@ -25513,90 +26838,22 @@ var seriesModule = sqlite3_module{ // xCreate FxNext: 0, // xNext - advance a cursor FxEof: 0, // xEof - check for end of scan FxColumn: 0, // xColumn - read data - FxRowid: 0, // xRename -} /* series.c:380:23 */ + FxRowid: 0, // xShadowName +} /* series.c:397:23 */ -func sqlite3_series_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* series.c:408:5: */ +func sqlite3_series_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* series.c:429:5: */ var rc int32 = SQLITE_OK _ = pApi if sqlite3.Xsqlite3_libversion_number(tls) < 3008012 { *(*uintptr)(unsafe.Pointer(pzErrMsg)) = sqlite3.Xsqlite3_mprintf(tls, - ts+6240 /* "generate_series(..." */, 0) + ts+6420 /* "generate_series(..." */, 0) return SQLITE_ERROR } - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+6290 /* "generate_series" */, uintptr(unsafe.Pointer(&seriesModule)), uintptr(0)) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+6470 /* "generate_series" */, uintptr(unsafe.Pointer(&seriesModule)), uintptr(0)) return rc } -// Floating-point inline functions for stdlib.h. -// Copyright (C) 2012-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// Define some macros helping to catch buffer overflows. - -// Copyright (C) 1991-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// ISO C99 Standard: 7.2 Diagnostics - -// Copyright (C) 1991-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// void assert (int expression); -// -// If NDEBUG is defined, do nothing. -// If not, and EXPRESSION is zero, print an error message and abort. - -// void assert_perror (int errnum); -// -// If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an -// error message with the error text for ERRNUM and abort. -// (This is a GNU extension.) - -type u8 = uint8 /* spellfix.c:33:25 */ type u16 = uint16 /* spellfix.c:34:26 */ // Character classes for ASCII characters: @@ -25618,103 +26875,103 @@ type u16 = uint16 /* spellfix.c:34:26 */ // The following table gives the character class for non-initial ASCII // characters. var midClass = [128]uint8{ - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_SPACE /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_SPACE /* */, CCLASS_SPACE /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_SPACE, - /* ! */ CCLASS_OTHER /* " */, CCLASS_OTHER /* # */, CCLASS_OTHER, - /* $ */ CCLASS_OTHER /* % */, CCLASS_OTHER /* & */, CCLASS_OTHER, - /* ' */ CCLASS_SILENT /* ( */, CCLASS_OTHER /* ) */, CCLASS_OTHER, - /* * */ CCLASS_OTHER /* + */, CCLASS_OTHER /* , */, CCLASS_OTHER, - /* - */ CCLASS_OTHER /* . */, CCLASS_OTHER /* / */, CCLASS_OTHER, - /* 0 */ CCLASS_DIGIT /* 1 */, CCLASS_DIGIT /* 2 */, CCLASS_DIGIT, - /* 3 */ CCLASS_DIGIT /* 4 */, CCLASS_DIGIT /* 5 */, CCLASS_DIGIT, - /* 6 */ CCLASS_DIGIT /* 7 */, CCLASS_DIGIT /* 8 */, CCLASS_DIGIT, - /* 9 */ CCLASS_DIGIT /* : */, CCLASS_OTHER /* ; */, CCLASS_OTHER, - /* < */ CCLASS_OTHER /* = */, CCLASS_OTHER /* > */, CCLASS_OTHER, - /* ? */ CCLASS_OTHER /* @ */, CCLASS_OTHER /* A */, CCLASS_VOWEL, - /* B */ CCLASS_B /* C */, CCLASS_C /* D */, CCLASS_D, - /* E */ CCLASS_VOWEL /* F */, CCLASS_B /* G */, CCLASS_C, - /* H */ CCLASS_SILENT /* I */, CCLASS_VOWEL /* J */, CCLASS_C, - /* K */ CCLASS_C /* L */, CCLASS_L /* M */, CCLASS_M, - /* N */ CCLASS_M /* O */, CCLASS_VOWEL /* P */, CCLASS_B, - /* Q */ CCLASS_C /* R */, CCLASS_R /* S */, CCLASS_C, - /* T */ CCLASS_D /* U */, CCLASS_VOWEL /* V */, CCLASS_B, - /* W */ CCLASS_B /* X */, CCLASS_C /* Y */, CCLASS_VOWEL, - /* Z */ CCLASS_C /* [ */, CCLASS_OTHER /* \ */, CCLASS_OTHER, - /* ] */ CCLASS_OTHER /* ^ */, CCLASS_OTHER /* _ */, CCLASS_OTHER, - /* ` */ CCLASS_OTHER /* a */, CCLASS_VOWEL /* b */, CCLASS_B, - /* c */ CCLASS_C /* d */, CCLASS_D /* e */, CCLASS_VOWEL, - /* f */ CCLASS_B /* g */, CCLASS_C /* h */, CCLASS_SILENT, - /* i */ CCLASS_VOWEL /* j */, CCLASS_C /* k */, CCLASS_C, - /* l */ CCLASS_L /* m */, CCLASS_M /* n */, CCLASS_M, - /* o */ CCLASS_VOWEL /* p */, CCLASS_B /* q */, CCLASS_C, - /* r */ CCLASS_R /* s */, CCLASS_C /* t */, CCLASS_D, - /* u */ CCLASS_VOWEL /* v */, CCLASS_B /* w */, CCLASS_B, - /* x */ CCLASS_C /* y */, CCLASS_VOWEL /* z */, CCLASS_C, - /* { */ CCLASS_OTHER /* | */, CCLASS_OTHER /* } */, CCLASS_OTHER, - /* ~ */ CCLASS_OTHER /* */, CCLASS_OTHER, + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_SPACE) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_SPACE) /* */, uint8(CCLASS_SPACE) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_SPACE), + /* ! */ uint8(CCLASS_OTHER) /* " */, uint8(CCLASS_OTHER) /* # */, uint8(CCLASS_OTHER), + /* $ */ uint8(CCLASS_OTHER) /* % */, uint8(CCLASS_OTHER) /* & */, uint8(CCLASS_OTHER), + /* ' */ uint8(CCLASS_SILENT) /* ( */, uint8(CCLASS_OTHER) /* ) */, uint8(CCLASS_OTHER), + /* * */ uint8(CCLASS_OTHER) /* + */, uint8(CCLASS_OTHER) /* , */, uint8(CCLASS_OTHER), + /* - */ uint8(CCLASS_OTHER) /* . */, uint8(CCLASS_OTHER) /* / */, uint8(CCLASS_OTHER), + /* 0 */ uint8(CCLASS_DIGIT) /* 1 */, uint8(CCLASS_DIGIT) /* 2 */, uint8(CCLASS_DIGIT), + /* 3 */ uint8(CCLASS_DIGIT) /* 4 */, uint8(CCLASS_DIGIT) /* 5 */, uint8(CCLASS_DIGIT), + /* 6 */ uint8(CCLASS_DIGIT) /* 7 */, uint8(CCLASS_DIGIT) /* 8 */, uint8(CCLASS_DIGIT), + /* 9 */ uint8(CCLASS_DIGIT) /* : */, uint8(CCLASS_OTHER) /* ; */, uint8(CCLASS_OTHER), + /* < */ uint8(CCLASS_OTHER) /* = */, uint8(CCLASS_OTHER) /* > */, uint8(CCLASS_OTHER), + /* ? */ uint8(CCLASS_OTHER) /* @ */, uint8(CCLASS_OTHER) /* A */, uint8(CCLASS_VOWEL), + /* B */ uint8(CCLASS_B) /* C */, uint8(CCLASS_C) /* D */, uint8(CCLASS_D), + /* E */ uint8(CCLASS_VOWEL) /* F */, uint8(CCLASS_B) /* G */, uint8(CCLASS_C), + /* H */ uint8(CCLASS_SILENT) /* I */, uint8(CCLASS_VOWEL) /* J */, uint8(CCLASS_C), + /* K */ uint8(CCLASS_C) /* L */, uint8(CCLASS_L) /* M */, uint8(CCLASS_M), + /* N */ uint8(CCLASS_M) /* O */, uint8(CCLASS_VOWEL) /* P */, uint8(CCLASS_B), + /* Q */ uint8(CCLASS_C) /* R */, uint8(CCLASS_R) /* S */, uint8(CCLASS_C), + /* T */ uint8(CCLASS_D) /* U */, uint8(CCLASS_VOWEL) /* V */, uint8(CCLASS_B), + /* W */ uint8(CCLASS_B) /* X */, uint8(CCLASS_C) /* Y */, uint8(CCLASS_VOWEL), + /* Z */ uint8(CCLASS_C) /* [ */, uint8(CCLASS_OTHER) /* \ */, uint8(CCLASS_OTHER), + /* ] */ uint8(CCLASS_OTHER) /* ^ */, uint8(CCLASS_OTHER) /* _ */, uint8(CCLASS_OTHER), + /* ` */ uint8(CCLASS_OTHER) /* a */, uint8(CCLASS_VOWEL) /* b */, uint8(CCLASS_B), + /* c */ uint8(CCLASS_C) /* d */, uint8(CCLASS_D) /* e */, uint8(CCLASS_VOWEL), + /* f */ uint8(CCLASS_B) /* g */, uint8(CCLASS_C) /* h */, uint8(CCLASS_SILENT), + /* i */ uint8(CCLASS_VOWEL) /* j */, uint8(CCLASS_C) /* k */, uint8(CCLASS_C), + /* l */ uint8(CCLASS_L) /* m */, uint8(CCLASS_M) /* n */, uint8(CCLASS_M), + /* o */ uint8(CCLASS_VOWEL) /* p */, uint8(CCLASS_B) /* q */, uint8(CCLASS_C), + /* r */ uint8(CCLASS_R) /* s */, uint8(CCLASS_C) /* t */, uint8(CCLASS_D), + /* u */ uint8(CCLASS_VOWEL) /* v */, uint8(CCLASS_B) /* w */, uint8(CCLASS_B), + /* x */ uint8(CCLASS_C) /* y */, uint8(CCLASS_VOWEL) /* z */, uint8(CCLASS_C), + /* { */ uint8(CCLASS_OTHER) /* | */, uint8(CCLASS_OTHER) /* } */, uint8(CCLASS_OTHER), + /* ~ */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), } /* spellfix.c:75:28 */ // This tables gives the character class for ASCII characters that form the // initial character of a word. The only difference from midClass is with // the letters H, W, and Y. var initClass = [128]uint8{ - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_SPACE /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_SPACE /* */, CCLASS_SPACE /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_OTHER, - /* */ CCLASS_OTHER /* */, CCLASS_OTHER /* */, CCLASS_SPACE, - /* ! */ CCLASS_OTHER /* " */, CCLASS_OTHER /* # */, CCLASS_OTHER, - /* $ */ CCLASS_OTHER /* % */, CCLASS_OTHER /* & */, CCLASS_OTHER, - /* ' */ CCLASS_OTHER /* ( */, CCLASS_OTHER /* ) */, CCLASS_OTHER, - /* * */ CCLASS_OTHER /* + */, CCLASS_OTHER /* , */, CCLASS_OTHER, - /* - */ CCLASS_OTHER /* . */, CCLASS_OTHER /* / */, CCLASS_OTHER, - /* 0 */ CCLASS_DIGIT /* 1 */, CCLASS_DIGIT /* 2 */, CCLASS_DIGIT, - /* 3 */ CCLASS_DIGIT /* 4 */, CCLASS_DIGIT /* 5 */, CCLASS_DIGIT, - /* 6 */ CCLASS_DIGIT /* 7 */, CCLASS_DIGIT /* 8 */, CCLASS_DIGIT, - /* 9 */ CCLASS_DIGIT /* : */, CCLASS_OTHER /* ; */, CCLASS_OTHER, - /* < */ CCLASS_OTHER /* = */, CCLASS_OTHER /* > */, CCLASS_OTHER, - /* ? */ CCLASS_OTHER /* @ */, CCLASS_OTHER /* A */, CCLASS_VOWEL, - /* B */ CCLASS_B /* C */, CCLASS_C /* D */, CCLASS_D, - /* E */ CCLASS_VOWEL /* F */, CCLASS_B /* G */, CCLASS_C, - /* H */ CCLASS_SILENT /* I */, CCLASS_VOWEL /* J */, CCLASS_C, - /* K */ CCLASS_C /* L */, CCLASS_L /* M */, CCLASS_M, - /* N */ CCLASS_M /* O */, CCLASS_VOWEL /* P */, CCLASS_B, - /* Q */ CCLASS_C /* R */, CCLASS_R /* S */, CCLASS_C, - /* T */ CCLASS_D /* U */, CCLASS_VOWEL /* V */, CCLASS_B, - /* W */ CCLASS_B /* X */, CCLASS_C /* Y */, CCLASS_Y, - /* Z */ CCLASS_C /* [ */, CCLASS_OTHER /* \ */, CCLASS_OTHER, - /* ] */ CCLASS_OTHER /* ^ */, CCLASS_OTHER /* _ */, CCLASS_OTHER, - /* ` */ CCLASS_OTHER /* a */, CCLASS_VOWEL /* b */, CCLASS_B, - /* c */ CCLASS_C /* d */, CCLASS_D /* e */, CCLASS_VOWEL, - /* f */ CCLASS_B /* g */, CCLASS_C /* h */, CCLASS_SILENT, - /* i */ CCLASS_VOWEL /* j */, CCLASS_C /* k */, CCLASS_C, - /* l */ CCLASS_L /* m */, CCLASS_M /* n */, CCLASS_M, - /* o */ CCLASS_VOWEL /* p */, CCLASS_B /* q */, CCLASS_C, - /* r */ CCLASS_R /* s */, CCLASS_C /* t */, CCLASS_D, - /* u */ CCLASS_VOWEL /* v */, CCLASS_B /* w */, CCLASS_B, - /* x */ CCLASS_C /* y */, CCLASS_Y /* z */, CCLASS_C, - /* { */ CCLASS_OTHER /* | */, CCLASS_OTHER /* } */, CCLASS_OTHER, - /* ~ */ CCLASS_OTHER /* */, CCLASS_OTHER, + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_SPACE) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_SPACE) /* */, uint8(CCLASS_SPACE) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), + /* */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER) /* */, uint8(CCLASS_SPACE), + /* ! */ uint8(CCLASS_OTHER) /* " */, uint8(CCLASS_OTHER) /* # */, uint8(CCLASS_OTHER), + /* $ */ uint8(CCLASS_OTHER) /* % */, uint8(CCLASS_OTHER) /* & */, uint8(CCLASS_OTHER), + /* ' */ uint8(CCLASS_OTHER) /* ( */, uint8(CCLASS_OTHER) /* ) */, uint8(CCLASS_OTHER), + /* * */ uint8(CCLASS_OTHER) /* + */, uint8(CCLASS_OTHER) /* , */, uint8(CCLASS_OTHER), + /* - */ uint8(CCLASS_OTHER) /* . */, uint8(CCLASS_OTHER) /* / */, uint8(CCLASS_OTHER), + /* 0 */ uint8(CCLASS_DIGIT) /* 1 */, uint8(CCLASS_DIGIT) /* 2 */, uint8(CCLASS_DIGIT), + /* 3 */ uint8(CCLASS_DIGIT) /* 4 */, uint8(CCLASS_DIGIT) /* 5 */, uint8(CCLASS_DIGIT), + /* 6 */ uint8(CCLASS_DIGIT) /* 7 */, uint8(CCLASS_DIGIT) /* 8 */, uint8(CCLASS_DIGIT), + /* 9 */ uint8(CCLASS_DIGIT) /* : */, uint8(CCLASS_OTHER) /* ; */, uint8(CCLASS_OTHER), + /* < */ uint8(CCLASS_OTHER) /* = */, uint8(CCLASS_OTHER) /* > */, uint8(CCLASS_OTHER), + /* ? */ uint8(CCLASS_OTHER) /* @ */, uint8(CCLASS_OTHER) /* A */, uint8(CCLASS_VOWEL), + /* B */ uint8(CCLASS_B) /* C */, uint8(CCLASS_C) /* D */, uint8(CCLASS_D), + /* E */ uint8(CCLASS_VOWEL) /* F */, uint8(CCLASS_B) /* G */, uint8(CCLASS_C), + /* H */ uint8(CCLASS_SILENT) /* I */, uint8(CCLASS_VOWEL) /* J */, uint8(CCLASS_C), + /* K */ uint8(CCLASS_C) /* L */, uint8(CCLASS_L) /* M */, uint8(CCLASS_M), + /* N */ uint8(CCLASS_M) /* O */, uint8(CCLASS_VOWEL) /* P */, uint8(CCLASS_B), + /* Q */ uint8(CCLASS_C) /* R */, uint8(CCLASS_R) /* S */, uint8(CCLASS_C), + /* T */ uint8(CCLASS_D) /* U */, uint8(CCLASS_VOWEL) /* V */, uint8(CCLASS_B), + /* W */ uint8(CCLASS_B) /* X */, uint8(CCLASS_C) /* Y */, uint8(CCLASS_Y), + /* Z */ uint8(CCLASS_C) /* [ */, uint8(CCLASS_OTHER) /* \ */, uint8(CCLASS_OTHER), + /* ] */ uint8(CCLASS_OTHER) /* ^ */, uint8(CCLASS_OTHER) /* _ */, uint8(CCLASS_OTHER), + /* ` */ uint8(CCLASS_OTHER) /* a */, uint8(CCLASS_VOWEL) /* b */, uint8(CCLASS_B), + /* c */ uint8(CCLASS_C) /* d */, uint8(CCLASS_D) /* e */, uint8(CCLASS_VOWEL), + /* f */ uint8(CCLASS_B) /* g */, uint8(CCLASS_C) /* h */, uint8(CCLASS_SILENT), + /* i */ uint8(CCLASS_VOWEL) /* j */, uint8(CCLASS_C) /* k */, uint8(CCLASS_C), + /* l */ uint8(CCLASS_L) /* m */, uint8(CCLASS_M) /* n */, uint8(CCLASS_M), + /* o */ uint8(CCLASS_VOWEL) /* p */, uint8(CCLASS_B) /* q */, uint8(CCLASS_C), + /* r */ uint8(CCLASS_R) /* s */, uint8(CCLASS_C) /* t */, uint8(CCLASS_D), + /* u */ uint8(CCLASS_VOWEL) /* v */, uint8(CCLASS_B) /* w */, uint8(CCLASS_B), + /* x */ uint8(CCLASS_C) /* y */, uint8(CCLASS_Y) /* z */, uint8(CCLASS_C), + /* { */ uint8(CCLASS_OTHER) /* | */, uint8(CCLASS_OTHER) /* } */, uint8(CCLASS_OTHER), + /* ~ */ uint8(CCLASS_OTHER) /* */, uint8(CCLASS_OTHER), } /* spellfix.c:125:28 */ // Mapping from the character class number (0-13) to a symbol for each // character class. Note that initClass[] can be used to map the class // symbol back into the class number. -var className = *(*[14]uint8)(unsafe.Pointer(ts + 6306 /* ".ABCDHLRMY9 ?" */)) /* spellfix.c:176:28 */ +var className = *(*[14]uint8)(unsafe.Pointer(ts + 6486 /* ".ABCDHLRMY9 ?" */)) /* spellfix.c:176:28 */ // Generate a "phonetic hash" from a string of ASCII characters // in zIn[0..nIn-1]. @@ -26099,9 +27356,9 @@ func editdistSqlFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if res == (-3) { sqlite3.Xsqlite3_result_error_nomem(tls, context) } else if res == (-2) { - sqlite3.Xsqlite3_result_error(tls, context, ts+6320 /* "non-ASCII input ..." */, -1) + sqlite3.Xsqlite3_result_error(tls, context, ts+6500 /* "non-ASCII input ..." */, -1) } else { - sqlite3.Xsqlite3_result_error(tls, context, ts+6350 /* "NULL input to ed..." */, -1) + sqlite3.Xsqlite3_result_error(tls, context, ts+6530 /* "NULL input to ed..." */, -1) } } else { sqlite3.Xsqlite3_result_int(tls, context, res) @@ -26300,7 +27557,7 @@ func editDist3ConfigLoad(tls *libc.TLS, p uintptr, db uintptr, zTable uintptr) i var pLang uintptr = uintptr(0) zSql = sqlite3.Xsqlite3_mprintf(tls, - ts+6375 /* "SELECT iLang, cF..." */, libc.VaList(bp, zTable)) + ts+6555 /* "SELECT iLang, cF..." */, libc.VaList(bp, zTable)) if zSql == uintptr(0) { return SQLITE_NOMEM } @@ -26949,20 +28206,20 @@ func editDist3Install(tls *libc.TLS, db uintptr) int32 { /* spellfix.c:1210:12: return SQLITE_NOMEM } libc.Xmemset(tls, pConfig, 0, uint64(unsafe.Sizeof(EditDist3Config{}))) - rc = sqlite3.Xsqlite3_create_function_v2(tls, db, ts+6447, /* "editdist3" */ + rc = sqlite3.Xsqlite3_create_function_v2(tls, db, ts+6627, /* "editdist3" */ 2, (SQLITE_UTF8 | SQLITE_DETERMINISTIC), pConfig, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{editDist3SqlFunc})), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function_v2(tls, db, ts+6447, /* "editdist3" */ + rc = sqlite3.Xsqlite3_create_function_v2(tls, db, ts+6627, /* "editdist3" */ 3, (SQLITE_UTF8 | SQLITE_DETERMINISTIC), pConfig, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{editDist3SqlFunc})), uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function_v2(tls, db, ts+6447, /* "editdist3" */ + rc = sqlite3.Xsqlite3_create_function_v2(tls, db, ts+6627, /* "editdist3" */ 1, (SQLITE_UTF8 | SQLITE_DETERMINISTIC), pConfig, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) @@ -27736,7 +28993,7 @@ func spellfix1Uninit(tls *libc.TLS, isDestroy int32, pVTab uintptr) int32 { /* s *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = SQLITE_OK if isDestroy != 0 { var db uintptr = (*spellfix1_vtab)(unsafe.Pointer(p)).Fdb - spellfix1DbExec(tls, bp+16 /* &rc */, db, ts+6457, /* "DROP TABLE IF EX..." */ + spellfix1DbExec(tls, bp+16 /* &rc */, db, ts+6637, /* "DROP TABLE IF EX..." */ libc.VaList(bp, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName)) } if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK { @@ -27828,27 +29085,27 @@ func spellfix1Init(tls *libc.TLS, isCreate int32, db uintptr, pAux uintptr, argc sqlite3.Xsqlite3_vtab_config(tls, db, SQLITE_VTAB_INNOCUOUS, 0) *(*int32)(unsafe.Pointer(bp + 56 /* rc */)) = sqlite3.Xsqlite3_declare_vtab(tls, db, - ts+6494 /* "CREATE TABLE x(w..." */) + ts+6674 /* "CREATE TABLE x(w..." */) } if (*(*int32)(unsafe.Pointer(bp + 56 /* rc */)) == SQLITE_OK) && (isCreate != 0) { spellfix1DbExec(tls, bp+56 /* &rc */, db, - ts+6648, /* "CREATE TABLE IF ..." */ + ts+6828, /* "CREATE TABLE IF ..." */ libc.VaList(bp+8, zDbName, zTableName)) spellfix1DbExec(tls, bp+56 /* &rc */, db, - ts+6782, /* "CREATE INDEX IF ..." */ + ts+6962, /* "CREATE INDEX IF ..." */ libc.VaList(bp+24, zDbName, zTableName, zTableName)) } for i = 3; (*(*int32)(unsafe.Pointer(bp + 56 /* rc */)) == SQLITE_OK) && (i < argc); i++ { - if (libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ts+6867 /* "edit_cost_table=" */, uint64(16)) == 0) && ((*spellfix1_vtab)(unsafe.Pointer(pNew)).FzCostTable == uintptr(0)) { + if (libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ts+7047 /* "edit_cost_table=" */, uint64(16)) == 0) && ((*spellfix1_vtab)(unsafe.Pointer(pNew)).FzCostTable == uintptr(0)) { (*spellfix1_vtab)(unsafe.Pointer(pNew)).FzCostTable = spellfix1Dequote(tls, (*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) + 16)) if (*spellfix1_vtab)(unsafe.Pointer(pNew)).FzCostTable == uintptr(0) { *(*int32)(unsafe.Pointer(bp + 56 /* rc */)) = SQLITE_NOMEM } continue } - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+6884 /* "bad argument to ..." */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7064 /* "bad argument to ..." */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) *(*int32)(unsafe.Pointer(bp + 56 /* rc */)) = SQLITE_ERROR } } @@ -28401,7 +29658,7 @@ __18: ; zSql = sqlite3.Xsqlite3_mprintf(tls, - ts+6918, /* "SELECT id, word,..." */ + ts+7098, /* "SELECT id, word,..." */ libc.VaList(bp, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, iLang)) if !(zSql == uintptr(0)) { goto __19 @@ -28461,13 +29718,13 @@ func spellfix1FilterForFullScan(tls *libc.TLS, pCur uintptr, argc int32, argv ui spellfix1ResetCursor(tls, pCur) zSql = sqlite3.Xsqlite3_mprintf(tls, - ts+7018, /* "SELECT word, ran..." */ + ts+7198, /* "SELECT word, ran..." */ libc.VaList(bp, (*spellfix1_vtab)(unsafe.Pointer(pVTab)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(pVTab)).FzTableName, func() uintptr { if (idxNum & 64) != 0 { - return ts + 7077 /* " WHERE rowid=?" */ + return ts + 7257 /* " WHERE rowid=?" */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }())) if zSql == uintptr(0) { return SQLITE_NOMEM @@ -28666,7 +29923,7 @@ func spellfix1GetConflict(tls *libc.TLS, db uintptr) uintptr { /* spellfix.c:282 var azConflict = [5]uintptr{ // Note: Instead of "FAIL" - "ABORT". - ts + 7092 /* "ROLLBACK" */, ts + 7101 /* "IGNORE" */, ts + 7108 /* "ABORT" */, ts + 7108 /* "ABORT" */, ts + 7114, /* "REPLACE" */ + ts + 7272 /* "ROLLBACK" */, ts + 7281 /* "IGNORE" */, ts + 7288 /* "ABORT" */, ts + 7288 /* "ABORT" */, ts + 7294, /* "REPLACE" */ } /* spellfix.c:2829:21 */ // The xUpdate() method. @@ -28684,7 +29941,7 @@ func spellfix1Update(tls *libc.TLS, pVTab uintptr, argc int32, argv uintptr, pRo // A delete operation on the rowid given by argv[0] rowid = libc.AssignPtrInt64(pRowid, sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))) spellfix1DbExec(tls, bp+280 /* &rc */, db, - ts+7122, /* "DELETE FROM \"%w\"..." */ + ts+7302, /* "DELETE FROM \"%w\"..." */ libc.VaList(bp, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, rowid)) } else { var zWord uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) @@ -28705,17 +29962,17 @@ func spellfix1Update(tls *libc.TLS, pVTab uintptr, argc int32, argv uintptr, pRo // what special actions to take var zCmd uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 13*8))) if zCmd == uintptr(0) { - (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+7165, /* "NOT NULL constra..." */ + (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+7345, /* "NOT NULL constra..." */ libc.VaList(bp+24, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName)) return (SQLITE_CONSTRAINT | (int32(5) << 8)) } - if libc.Xstrcmp(tls, zCmd, ts+7201 /* "reset" */) == 0 { + if libc.Xstrcmp(tls, zCmd, ts+7381 /* "reset" */) == 0 { // Reset the edit cost table (if there is one). editDist3ConfigDelete(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FpConfig3) (*spellfix1_vtab)(unsafe.Pointer(p)).FpConfig3 = uintptr(0) return SQLITE_OK } - if libc.Xstrncmp(tls, zCmd, ts+6867 /* "edit_cost_table=" */, uint64(16)) == 0 { + if libc.Xstrncmp(tls, zCmd, ts+7047 /* "edit_cost_table=" */, uint64(16)) == 0 { editDist3ConfigDelete(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FpConfig3) (*spellfix1_vtab)(unsafe.Pointer(p)).FpConfig3 = uintptr(0) sqlite3.Xsqlite3_free(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable) @@ -28723,13 +29980,13 @@ func spellfix1Update(tls *libc.TLS, pVTab uintptr, argc int32, argv uintptr, pRo if (*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable == uintptr(0) { return SQLITE_NOMEM } - if (int32(*(*int8)(unsafe.Pointer((*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable))) == 0) || (sqlite3.Xsqlite3_stricmp(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable, ts+7207 /* "null" */) == 0) { + if (int32(*(*int8)(unsafe.Pointer((*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable))) == 0) || (sqlite3.Xsqlite3_stricmp(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable, ts+7387 /* "null" */) == 0) { sqlite3.Xsqlite3_free(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable) (*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable = uintptr(0) } return SQLITE_OK } - (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+7212, /* "unknown value fo..." */ + (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+7392, /* "unknown value fo..." */ libc.VaList(bp+32, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, zCmd)) return SQLITE_ERROR } @@ -28758,14 +30015,14 @@ func spellfix1Update(tls *libc.TLS, pVTab uintptr, argc int32, argv uintptr, pRo if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == SQLITE_NULL { spellfix1DbExec(tls, bp+280 /* &rc */, db, - ts+7247, /* "INSERT INTO \"%w\"..." */ + ts+7427, /* "INSERT INTO \"%w\"..." */ libc.VaList(bp+48, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, iRank, iLang, zWord, zK1, zWord, zK2)) } else { newRowid = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) spellfix1DbExec(tls, bp+280 /* &rc */, db, - ts+7333, /* "INSERT OR %s INT..." */ + ts+7513, /* "INSERT OR %s INT..." */ libc.VaList(bp+112, zConflict, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, newRowid, iRank, iLang, zWord, zK1, zWord, zK2)) } @@ -28775,7 +30032,7 @@ func spellfix1Update(tls *libc.TLS, pVTab uintptr, argc int32, argv uintptr, pRo newRowid = libc.AssignPtrInt64(pRowid, sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) spellfix1DbExec(tls, bp+280 /* &rc */, db, - ts+7433, /* "UPDATE OR %s \"%w..." */ + ts+7613, /* "UPDATE OR %s \"%w..." */ libc.VaList(bp+192, zConflict, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, newRowid, iRank, iLang, zWord, zK1, zWord, zK2, rowid)) } @@ -28798,7 +30055,7 @@ func spellfix1Rename(tls *libc.TLS, pVTab uintptr, zNew uintptr) int32 { /* spel return SQLITE_NOMEM } spellfix1DbExec(tls, bp+32 /* &rc */, db, - ts+7542, /* "ALTER TABLE \"%w\"..." */ + ts+7722, /* "ALTER TABLE \"%w\"..." */ libc.VaList(bp+8, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, zNewName)) if *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == SQLITE_OK { sqlite3.Xsqlite3_free(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName) @@ -28831,34 +30088,34 @@ var spellfix1Module = sqlite3_module{ // iVersion func spellfix1Register(tls *libc.TLS, db uintptr) int32 { /* spellfix.c:3017:12: */ var rc int32 = SQLITE_OK var i int32 - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7591 /* "spellfix1_transl..." */, 1, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7771 /* "spellfix1_transl..." */, 1, (SQLITE_UTF8 | SQLITE_DETERMINISTIC), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{transliterateSqlFunc})), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7610 /* "spellfix1_editdi..." */, 2, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7790 /* "spellfix1_editdi..." */, 2, (SQLITE_UTF8 | SQLITE_DETERMINISTIC), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{editdistSqlFunc})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7629 /* "spellfix1_phoneh..." */, 1, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7809 /* "spellfix1_phoneh..." */, 1, (SQLITE_UTF8 | SQLITE_DETERMINISTIC), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{phoneticHashSqlFunc})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7649 /* "spellfix1_script..." */, 1, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7829 /* "spellfix1_script..." */, 1, (SQLITE_UTF8 | SQLITE_DETERMINISTIC), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{scriptCodeSqlFunc})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+7670 /* "spellfix1" */, uintptr(unsafe.Pointer(&spellfix1Module)), uintptr(0)) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+7850 /* "spellfix1" */, uintptr(unsafe.Pointer(&spellfix1Module)), uintptr(0)) } if rc == SQLITE_OK { rc = editDist3Install(tls, db) @@ -28913,7 +30170,7 @@ func totypeCompare2pow63(tls *libc.TLS, zNum uintptr) int32 { /* totype.c:95:12: var c int32 = 0 var i int32 // 012345678901234567 - var pow63 uintptr = ts + 7680 /* "9223372036854775..." */ + var pow63 uintptr = ts + 7860 /* "9223372036854775..." */ for i = 0; (c == 0) && (i < 18); i++ { c = ((int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))) - int32(*(*int8)(unsafe.Pointer(pow63 + uintptr(i))))) * 10) } @@ -29530,13 +30787,13 @@ func sqlite3_totype_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintp _ = pApi _ = pzErrMsg // Unused parameter - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7699 /* "tointeger" */, 1, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7879 /* "tointeger" */, 1, ((SQLITE_UTF8 | SQLITE_DETERMINISTIC) | SQLITE_INNOCUOUS), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{tointegerFunc})), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7709 /* "toreal" */, 1, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7889 /* "toreal" */, 1, ((SQLITE_UTF8 | SQLITE_DETERMINISTIC) | SQLITE_INNOCUOUS), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) @@ -29751,7 +31008,7 @@ func unionPrepare(tls *libc.TLS, pRc uintptr, db uintptr, zSql uintptr, pzErr ui if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { var rc int32 = sqlite3.Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+8 /* &pRet */, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7716 /* "sql error: %s" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7896 /* "sql error: %s" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, db))) *(*int32)(unsafe.Pointer(pRc)) = rc } } @@ -29891,23 +31148,23 @@ func unionIsIntkeyTable(tls *libc.TLS, db uintptr, pSrc uintptr, pzErr uintptr) var rc int32 sqlite3.Xsqlite3_table_column_metadata(tls, - db, (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb, (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab, ts+7730 /* "_rowid_" */, bp+24 /* &zType */, uintptr(0), uintptr(0), bp+32 /* &bPk */, uintptr(0)) + db, (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb, (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab, ts+7910 /* "_rowid_" */, bp+24 /* &zType */, uintptr(0), uintptr(0), bp+32 /* &bPk */, uintptr(0)) rc = sqlite3.Xsqlite3_errcode(tls, db) if (rc == SQLITE_ERROR) || - ((rc == SQLITE_OK) && (!(*(*int32)(unsafe.Pointer(bp + 32 /* bPk */)) != 0) || (sqlite3.Xsqlite3_stricmp(tls, ts+7738 /* "integer" */, *(*uintptr)(unsafe.Pointer(bp + 24 /* zType */))) != 0))) { + ((rc == SQLITE_OK) && (!(*(*int32)(unsafe.Pointer(bp + 32 /* bPk */)) != 0) || (sqlite3.Xsqlite3_stricmp(tls, ts+7918 /* "integer" */, *(*uintptr)(unsafe.Pointer(bp + 24 /* zType */))) != 0))) { rc = SQLITE_ERROR - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7746, /* "no such rowid ta..." */ + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7926, /* "no such rowid ta..." */ libc.VaList(bp, func() uintptr { if (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb != 0 { return (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), func() uintptr { if (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb != 0 { - return ts + 7774 /* "." */ + return ts + 7954 /* "." */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab)) } @@ -29944,7 +31201,7 @@ func unionSourceToStr(tls *libc.TLS, pRc uintptr, pTab uintptr, pSrc uintptr, pz *(*int32)(unsafe.Pointer(bp /* rc */)) = unionIsIntkeyTable(tls, db, pSrc, pzErr) var pStmt uintptr = unionPrepare(tls, bp /* &rc */, db, - ts+7776 /* "SELECT group_con..." */, pzErr) + ts+7956 /* "SELECT group_con..." */, pzErr) if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK { sqlite3.Xsqlite3_bind_text(tls, pStmt, 1, (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab, -1, uintptr(0)) sqlite3.Xsqlite3_bind_text(tls, pStmt, 2, (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb, -1, uintptr(0)) @@ -29978,7 +31235,7 @@ func unionSourceCheck(tls *libc.TLS, pTab uintptr, pzErr uintptr) int32 { /* uni for i = 1; i < (*UnionTab)(unsafe.Pointer(pTab)).FnSrc; i++ { var z uintptr = unionSourceToStr(tls, bp /* &rc */, pTab, ((*UnionTab)(unsafe.Pointer(pTab)).FaSrc + uintptr(i)*72), pzErr) if (*(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK) && (sqlite3.Xsqlite3_stricmp(tls, z, z0) != 0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7860 /* "source table sch..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8040 /* "source table sch..." */, 0) *(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_ERROR } sqlite3.Xsqlite3_free(tls, z) @@ -30057,7 +31314,7 @@ func unionOpenDatabase(tls *libc.TLS, pTab uintptr, iSrc int32, pzErr uintptr) i (*UnionTab)(unsafe.Pointer(pTab)).FzSourceStr = z } else { if sqlite3.Xsqlite3_stricmp(tls, z, (*UnionTab)(unsafe.Pointer(pTab)).FzSourceStr) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7860 /* "source table sch..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8040 /* "source table sch..." */, 0) *(*int32)(unsafe.Pointer(bp /* rc */)) = SQLITE_ERROR } sqlite3.Xsqlite3_free(tls, z) @@ -30196,47 +31453,47 @@ func unionConfigureVtab(tls *libc.TLS, pRc uintptr, pTab uintptr, pStmt uintptr, var iParam int32 = sqlite3.Xsqlite3_bind_parameter_index(tls, pStmt, zOpt) if iParam == 0 { *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, - ts+7889 /* "swarmvtab: no su..." */, libc.VaList(bp, zOpt)) + ts+8069 /* "swarmvtab: no su..." */, libc.VaList(bp, zOpt)) *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = SQLITE_ERROR } else { *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = sqlite3.Xsqlite3_bind_text(tls, pStmt, iParam, zVal, -1, libc.UintptrFromInt32(-1)) } - } else if (nOpt == 7) && (0 == sqlite3.Xsqlite3_strnicmp(tls, zOpt, ts+7926 /* "maxopen" */, 7)) { + } else if (nOpt == 7) && (0 == sqlite3.Xsqlite3_strnicmp(tls, zOpt, ts+8106 /* "maxopen" */, 7)) { (*UnionTab)(unsafe.Pointer(pTab)).FnMaxOpen = libc.Xatoi(tls, zVal) if (*UnionTab)(unsafe.Pointer(pTab)).FnMaxOpen <= 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7934 /* "swarmvtab: illeg..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8114 /* "swarmvtab: illeg..." */, 0) *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = SQLITE_ERROR } - } else if (nOpt == 7) && (0 == sqlite3.Xsqlite3_strnicmp(tls, zOpt, ts+7967 /* "missing" */, 7)) { + } else if (nOpt == 7) && (0 == sqlite3.Xsqlite3_strnicmp(tls, zOpt, ts+8147 /* "missing" */, 7)) { if (*UnionTab)(unsafe.Pointer(pTab)).FpNotFound != 0 { *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, - ts+7975 /* "swarmvtab: dupli..." */, 0) + ts+8155 /* "swarmvtab: dupli..." */, 0) *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = SQLITE_ERROR } else { (*UnionTab)(unsafe.Pointer(pTab)).FpNotFound = unionPreparePrintf(tls, bp+64 /* &rc */, pzErr, (*UnionTab)(unsafe.Pointer(pTab)).Fdb, - ts+8013 /* "SELECT \"%w\"(?%s)" */, libc.VaList(bp+8, zVal, func() uintptr { + ts+8193 /* "SELECT \"%w\"(?%s)" */, libc.VaList(bp+8, zVal, func() uintptr { if (*UnionTab)(unsafe.Pointer(pTab)).FbHasContext != 0 { - return ts + 8030 /* ",?" */ + return ts + 8210 /* ",?" */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }())) } - } else if (nOpt == 9) && (0 == sqlite3.Xsqlite3_strnicmp(tls, zOpt, ts+8033 /* "openclose" */, 9)) { + } else if (nOpt == 9) && (0 == sqlite3.Xsqlite3_strnicmp(tls, zOpt, ts+8213 /* "openclose" */, 9)) { if (*UnionTab)(unsafe.Pointer(pTab)).FpOpenClose != 0 { *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, - ts+8043 /* "swarmvtab: dupli..." */, 0) + ts+8223 /* "swarmvtab: dupli..." */, 0) *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = SQLITE_ERROR } else { (*UnionTab)(unsafe.Pointer(pTab)).FpOpenClose = unionPreparePrintf(tls, bp+64 /* &rc */, pzErr, (*UnionTab)(unsafe.Pointer(pTab)).Fdb, - ts+8083 /* "SELECT \"%w\"(?,?%..." */, libc.VaList(bp+24, zVal, func() uintptr { + ts+8263 /* "SELECT \"%w\"(?,?%..." */, libc.VaList(bp+24, zVal, func() uintptr { if (*UnionTab)(unsafe.Pointer(pTab)).FbHasContext != 0 { - return ts + 8030 /* ",?" */ + return ts + 8210 /* ",?" */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }())) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8102 /* "swarmvtab: unrec..." */, libc.VaList(bp+40, zOpt)) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8282 /* "swarmvtab: unrec..." */, libc.VaList(bp+40, zOpt)) *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = SQLITE_ERROR } sqlite3.Xsqlite3_free(tls, zVal) @@ -30244,9 +31501,9 @@ func unionConfigureVtab(tls *libc.TLS, pRc uintptr, pTab uintptr, pStmt uintptr, } else { if (i == 0) && (nArg == 1) { (*UnionTab)(unsafe.Pointer(pTab)).FpNotFound = unionPreparePrintf(tls, bp+64 /* &rc */, pzErr, (*UnionTab)(unsafe.Pointer(pTab)).Fdb, - ts+8137 /* "SELECT \"%w\"(?)" */, libc.VaList(bp+48, zArg)) + ts+8317 /* "SELECT \"%w\"(?)" */, libc.VaList(bp+48, zArg)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8152 /* "swarmvtab: parse..." */, libc.VaList(bp+56, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8332 /* "swarmvtab: parse..." */, libc.VaList(bp+56, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)))) *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = SQLITE_ERROR } } @@ -30279,17 +31536,17 @@ func unionConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint }() var zVtab uintptr = func() uintptr { if bSwarm != 0 { - return ts + 8179 /* "swarmvtab" */ + return ts + 8359 /* "swarmvtab" */ } - return ts + 8189 /* "unionvtab" */ + return ts + 8369 /* "unionvtab" */ }() - if sqlite3.Xsqlite3_stricmp(tls, ts+8199 /* "temp" */, *(*uintptr)(unsafe.Pointer(argv + 1*8))) != 0 { + if sqlite3.Xsqlite3_stricmp(tls, ts+8379 /* "temp" */, *(*uintptr)(unsafe.Pointer(argv + 1*8))) != 0 { // unionvtab tables may only be created in the temp schema - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8204 /* "%s tables must b..." */, libc.VaList(bp, zVtab)) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8384 /* "%s tables must b..." */, libc.VaList(bp, zVtab)) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else if (argc < 4) || ((argc > 4) && (bSwarm == 0)) { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8245 /* "wrong number of ..." */, libc.VaList(bp+8, zVtab)) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8425 /* "wrong number of ..." */, libc.VaList(bp+8, zVtab)) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else { var nAlloc int32 = 0 // Allocated size of pTab->aSrc[] @@ -30302,7 +31559,7 @@ func unionConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint // and that the UnionTab.aSrc[] array is always sorted by rowid. unionDequote(tls, zArg) pStmt = unionPreparePrintf(tls, bp+40 /* &rc */, pzErr, db, - ts+8278 /* "SELECT * FROM (%..." */, libc.VaList(bp+16, zArg)) + ts+8458 /* "SELECT * FROM (%..." */, libc.VaList(bp+16, zArg)) // Allocate the UnionTab structure pTab = unionMalloc(tls, bp+40 /* &rc */, int64(unsafe.Sizeof(UnionTab{}))) @@ -30349,7 +31606,7 @@ func unionConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint // Check for problems with the specified range of rowids if (iMax < iMin) || (((*UnionTab)(unsafe.Pointer(pTab)).FnSrc > 0) && (iMin <= (*UnionSrc)(unsafe.Pointer((*UnionTab)(unsafe.Pointer(pTab)).FaSrc+uintptr(((*UnionTab)(unsafe.Pointer(pTab)).FnSrc-1))*72)).FiMax)) { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8308 /* "rowid range mism..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8488 /* "rowid range mism..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } @@ -30376,7 +31633,7 @@ func unionConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint // because there is no way to determine the schema of the virtual // table in this case. if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && ((*UnionTab)(unsafe.Pointer(pTab)).FnSrc == 0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8335 /* "no source tables..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8515 /* "no source tables..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } @@ -30402,7 +31659,7 @@ func unionConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint }() pStmt = unionPreparePrintf(tls, bp+40 /* &rc */, pzErr, tdb, - ts+8363, /* "SELECT 'CREATE T..." */ + ts+8543, /* "SELECT 'CREATE T..." */ libc.VaList(bp+24, (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab, (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb)) } if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && (SQLITE_ROW == sqlite3.Xsqlite3_step(tls, pStmt)) { @@ -30464,13 +31721,13 @@ func doUnionNext(tls *libc.TLS, pCsr uintptr) int32 { /* unionvtab.c:1057:12: */ // It is necessary to scan the next table. *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = unionOpenDatabase(tls, pTab, (*UnionCsr)(unsafe.Pointer(pCsr)).FiTab, (pTab /* &.base */ + 16 /* &.zErrMsg */)) (*UnionCsr)(unsafe.Pointer(pCsr)).FpStmt = unionPreparePrintf(tls, bp+24 /* &rc */, (pTab /* &.base */ + 16 /* &.zErrMsg */), (*UnionSrc)(unsafe.Pointer(pSrc)).Fdb, - ts+8541, /* "SELECT rowid, * ..." */ + ts+8721, /* "SELECT rowid, * ..." */ libc.VaList(bp, (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab, func() uintptr { if (*UnionSrc)(unsafe.Pointer(pSrc)).FiMax > (*UnionCsr)(unsafe.Pointer(pCsr)).FiMaxRowid { - return ts + 8573 /* "WHERE _rowid_ <=" */ + return ts + 8753 /* "WHERE _rowid_ <=" */ } - return ts + 8590 /* "-- " */ + return ts + 8770 /* "-- " */ }(), (*UnionCsr)(unsafe.Pointer(pCsr)).FiMaxRowid)) if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK { @@ -30573,26 +31830,26 @@ func unionFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt continue } - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+8594 /* "%z%sSELECT rowid..." */, libc.VaList(bp, zSql, func() uintptr { + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+8774 /* "%z%sSELECT rowid..." */, libc.VaList(bp, zSql, func() uintptr { if zSql != 0 { - return ts + 8628 /* " UNION ALL " */ + return ts + 8808 /* " UNION ALL " */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), func() uintptr { if (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb != 0 { - return ts + 5315 /* "'" */ + return ts + 5495 /* "'" */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), func() uintptr { if (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb != 0 { return (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), func() uintptr { if (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb != 0 { - return ts + 5317 /* "'." */ + return ts + 5497 /* "'." */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = SQLITE_NOMEM @@ -30600,15 +31857,15 @@ func unionFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt } if iMin == iMax { - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+8640 /* "%z WHERE rowid=%..." */, libc.VaList(bp+48, zSql, iMin)) + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+8820 /* "%z WHERE rowid=%..." */, libc.VaList(bp+48, zSql, iMin)) } else { - var zWhere uintptr = ts + 8660 /* "WHERE" */ + var zWhere uintptr = ts + 8840 /* "WHERE" */ if (iMin != ((int64(-1)) - (int64(0xffffffff) | (sqlite3_int64((int64(0x7fffffff))) << 32)))) && (iMin > (*UnionSrc)(unsafe.Pointer(pSrc)).FiMin) { - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+8666 /* "%z WHERE rowid>=..." */, libc.VaList(bp+64, zSql, iMin)) - zWhere = ts + 8687 /* "AND" */ + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+8846 /* "%z WHERE rowid>=..." */, libc.VaList(bp+64, zSql, iMin)) + zWhere = ts + 8867 /* "AND" */ } if (iMax != (int64(0xffffffff) | (sqlite3_int64((int64(0x7fffffff))) << 32))) && (iMax < (*UnionSrc)(unsafe.Pointer(pSrc)).FiMax) { - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+8691 /* "%z %s rowid<=%ll..." */, libc.VaList(bp+80, zSql, zWhere, iMax)) + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+8871 /* "%z %s rowid<=%ll..." */, libc.VaList(bp+80, zSql, zWhere, iMax)) } } @@ -30722,9 +31979,9 @@ func unionBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* uni func createUnionVtab(tls *libc.TLS, db uintptr) int32 { /* unionvtab.c:1329:12: */ var rc int32 - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+8189 /* "unionvtab" */, uintptr(unsafe.Pointer(&unionModule)), uintptr(0)) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+8369 /* "unionvtab" */, uintptr(unsafe.Pointer(&unionModule)), uintptr(0)) if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+8179 /* "swarmvtab" */, uintptr(unsafe.Pointer(&unionModule)), db) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+8359 /* "swarmvtab" */, uintptr(unsafe.Pointer(&unionModule)), db) } return rc } @@ -30770,7 +32027,7 @@ func wholenumberConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg if pNew == uintptr(0) { return SQLITE_NOMEM } - sqlite3.Xsqlite3_declare_vtab(tls, db, ts+8709 /* "CREATE TABLE x(v..." */) + sqlite3.Xsqlite3_declare_vtab(tls, db, ts+8889 /* "CREATE TABLE x(v..." */) sqlite3.Xsqlite3_vtab_config(tls, db, SQLITE_VTAB_INNOCUOUS, 0) libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(sqlite3_vtab{}))) return SQLITE_OK @@ -30965,7 +32222,7 @@ func sqlite3_wholenumber_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi var rc int32 = SQLITE_OK _ = pApi - rc = sqlite3.Xsqlite3_create_module(tls, db, ts+8731 /* "wholenumber" */, uintptr(unsafe.Pointer(&wholenumberModule)), uintptr(0)) + rc = sqlite3.Xsqlite3_create_module(tls, db, ts+8911 /* "wholenumber" */, uintptr(unsafe.Pointer(&wholenumberModule)), uintptr(0)) return rc } @@ -31029,7 +32286,7 @@ type voidpc = uintptr /* zconf.h:408:23 */ type voidpf = uintptr /* zconf.h:409:23 */ type voidp = uintptr /* zconf.h:410:23 */ -// Copyright (C) 1992-2018 Free Software Foundation, Inc. +// Copyright (C) 1992-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -31181,10 +32438,6 @@ type voidp = uintptr /* zconf.h:410:23 */ // // Never include this file directly; use instead. -// Determine the wordsize from the preprocessor defines. - -// Both x86-64 and x32 use the 64-bit system call interface. - // These are the standard-mandated minimum values. // Minimum number of operations in one list I/O call. @@ -31310,10 +32563,6 @@ type voidp = uintptr /* zconf.h:410:23 */ // Maximum value the semaphore can have. -// ssize_t is not formally required to be the signed type -// corresponding to size_t, but it is for all configurations supported -// by glibc. - // This value is a guaranteed minimum maximum. // The current maximum can be got from `sysconf'. @@ -31364,7 +32613,7 @@ type voidp = uintptr /* zconf.h:410:23 */ // This value is defined like this in regex.h. -// Copyright (C) 1991-2018 Free Software Foundation, Inc. +// Copyright (C) 1991-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -31569,8 +32818,8 @@ type gz_headerp = uintptr /* zlib.h:131:23 */ // allocated, or Z_VERSION_ERROR if the version of the library does not match // the version of the header file. -type in_func = uintptr /* zlib.h:1092:18 */ -type out_func = uintptr /* zlib.h:1094:13 */ +type in_func = uintptr /* zlib.h:1093:18 */ +type out_func = uintptr /* zlib.h:1095:13 */ // // Same as uncompress, except that sourceLen is a pointer, where the // length of the source is *sourceLen. On return, *sourceLen is the number of @@ -31589,7 +32838,7 @@ type gzFile_s = struct { _ [4]byte Fnext uintptr Fpos off_t -} /* zlib.h:1300:9 */ +} /* zlib.h:1301:9 */ // // Same as uncompress, except that sourceLen is a pointer, where the @@ -31604,7 +32853,7 @@ type gzFile_s = struct { // "gz". The gzip format is different from the zlib format. gzip is a gzip // wrapper, documented in RFC 1952, wrapped around a deflate stream. -type gzFile = uintptr /* zlib.h:1300:25 */ +type gzFile = uintptr /* zlib.h:1301:25 */ type u321 = uint64 /* zipfile.c:42:23 */ // Definitions for mode bitmasks S_IFDIR, S_IFREG and S_IFLNK. @@ -31625,7 +32874,7 @@ var ZIPFILE_SCHEMA = // 5: Uncompressed data // 6: Compression method (integer) // 7: Name of zip file -*(*[91]int8)(unsafe.Pointer(ts + 8743 /* "CREATE TABLE y(n..." */)) /* zipfile.c:77:19 */ +*(*[91]int8)(unsafe.Pointer(ts + 8923 /* "CREATE TABLE y(n..." */)) /* zipfile.c:77:19 */ // Magic numbers used to read and write zip files. // @@ -31938,8 +33187,8 @@ func zipfileConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv ui // // CREATE VIRTUAL TABLE zipfile USING zipfile(); - if ((0 != sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ts+8834 /* "zipfile" */)) && (argc < 4)) || (argc > 4) { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8842 /* "zipfile construc..." */, 0) + if ((0 != sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ts+9014 /* "zipfile" */)) && (argc < 4)) || (argc > 4) { + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+9022 /* "zipfile construc..." */, 0) return SQLITE_ERROR } @@ -32088,31 +33337,33 @@ func zipfileReadData(tls *libc.TLS, pFile uintptr, aRead uintptr, nRead int32, i libc.Xfseek(tls, pFile, int64(iOff), SEEK_SET) n = libc.Xfread(tls, aRead, uint64(1), uint64(nRead), pFile) if int32(n) != nRead { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = sqlite3.Xsqlite3_mprintf(tls, ts+8884 /* "error in fread()" */, 0) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = sqlite3.Xsqlite3_mprintf(tls, ts+9064 /* "error in fread()" */, 0) return SQLITE_ERROR } return SQLITE_OK } func zipfileAppendData(tls *libc.TLS, pTab uintptr, aWrite uintptr, nWrite int32) int32 { /* zipfile.c:521:12: */ - var n size_t - libc.Xfseek(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd, int64((*ZipfileTab)(unsafe.Pointer(pTab)).FszCurrent), SEEK_SET) - n = libc.Xfwrite(tls, aWrite, uint64(1), uint64(nWrite), (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd) - if int32(n) != nWrite { - (*ZipfileTab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+8901 /* "error in fwrite(..." */, 0) - return SQLITE_ERROR + if nWrite > 0 { + var n size_t = size_t(nWrite) + libc.Xfseek(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd, int64((*ZipfileTab)(unsafe.Pointer(pTab)).FszCurrent), SEEK_SET) + n = libc.Xfwrite(tls, aWrite, uint64(1), uint64(nWrite), (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd) + if int32(n) != nWrite { + (*ZipfileTab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+9081 /* "error in fwrite(..." */, 0) + return SQLITE_ERROR + } + *(*i64)(unsafe.Pointer(pTab + 88 /* &.szCurrent */)) += (i64(nWrite)) } - *(*i64)(unsafe.Pointer(pTab + 88 /* &.szCurrent */)) += (i64(nWrite)) return SQLITE_OK } // Read and return a 16-bit little-endian unsigned integer from buffer aBuf. -func zipfileGetU16(tls *libc.TLS, aBuf uintptr) u16 { /* zipfile.c:540:12: */ +func zipfileGetU16(tls *libc.TLS, aBuf uintptr) u16 { /* zipfile.c:542:12: */ return (u16((int32(*(*u8)(unsafe.Pointer(aBuf + 1))) << 8) + int32(*(*u8)(unsafe.Pointer(aBuf))))) } // Read and return a 32-bit little-endian unsigned integer from buffer aBuf. -func zipfileGetU32(tls *libc.TLS, aBuf uintptr) u321 { /* zipfile.c:547:12: */ +func zipfileGetU32(tls *libc.TLS, aBuf uintptr) u321 { /* zipfile.c:549:12: */ return (((((u321(*(*u8)(unsafe.Pointer(aBuf + 3)))) << 24) + ((u321(*(*u8)(unsafe.Pointer(aBuf + 2)))) << 16)) + ((u321(*(*u8)(unsafe.Pointer(aBuf + 1)))) << 8)) + @@ -32120,13 +33371,13 @@ func zipfileGetU32(tls *libc.TLS, aBuf uintptr) u321 { /* zipfile.c:547:12: */ } // Write a 16-bit little endiate integer into buffer aBuf. -func zipfilePutU16(tls *libc.TLS, aBuf uintptr, val u16) { /* zipfile.c:557:13: */ +func zipfilePutU16(tls *libc.TLS, aBuf uintptr, val u16) { /* zipfile.c:559:13: */ *(*u8)(unsafe.Pointer(aBuf)) = (u8(int32(val) & 0xFF)) *(*u8)(unsafe.Pointer(aBuf + 1)) = (u8((int32(val) >> 8) & 0xFF)) } // Write a 32-bit little endiate integer into buffer aBuf. -func zipfilePutU32(tls *libc.TLS, aBuf uintptr, val u321) { /* zipfile.c:565:13: */ +func zipfilePutU32(tls *libc.TLS, aBuf uintptr, val u321) { /* zipfile.c:567:13: */ *(*u8)(unsafe.Pointer(aBuf)) = (u8(val & uint64(0xFF))) *(*u8)(unsafe.Pointer(aBuf + 1)) = (u8((val >> 8) & uint64(0xFF))) *(*u8)(unsafe.Pointer(aBuf + 2)) = (u8((val >> 16) & uint64(0xFF))) @@ -32137,11 +33388,11 @@ func zipfilePutU32(tls *libc.TLS, aBuf uintptr, val u321) { /* zipfile.c:565:13: // Decode the CDS record in buffer aBuf into (*pCDS). Return SQLITE_ERROR // if the record is not well-formed, or SQLITE_OK otherwise. -func zipfileReadCDS(tls *libc.TLS, aBuf uintptr, pCDS uintptr) int32 { /* zipfile.c:588:12: */ +func zipfileReadCDS(tls *libc.TLS, aBuf uintptr, pCDS uintptr) int32 { /* zipfile.c:590:12: */ var aRead uintptr = aBuf var sig u321 = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }() var rc int32 = SQLITE_OK - if sig != ZIPFILE_SIGNATURE_CDS { + if sig != uint64(ZIPFILE_SIGNATURE_CDS) { rc = SQLITE_ERROR } else { (*ZipfileCDS)(unsafe.Pointer(pCDS)).FiVersionMadeBy = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }() @@ -32169,12 +33420,12 @@ func zipfileReadCDS(tls *libc.TLS, aBuf uintptr, pCDS uintptr) int32 { /* zipfil // Decode the LFH record in buffer aBuf into (*pLFH). Return SQLITE_ERROR // if the record is not well-formed, or SQLITE_OK otherwise. -func zipfileReadLFH(tls *libc.TLS, aBuffer uintptr, pLFH uintptr) int32 { /* zipfile.c:622:12: */ +func zipfileReadLFH(tls *libc.TLS, aBuffer uintptr, pLFH uintptr) int32 { /* zipfile.c:624:12: */ var aRead uintptr = aBuffer var rc int32 = SQLITE_OK var sig u321 = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }() - if sig != ZIPFILE_SIGNATURE_LFH { + if sig != uint64(ZIPFILE_SIGNATURE_LFH) { rc = SQLITE_ERROR } else { (*ZipfileLFH)(unsafe.Pointer(pLFH)).FiVersionExtract = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }() @@ -32204,7 +33455,7 @@ func zipfileReadLFH(tls *libc.TLS, aBuffer uintptr, pLFH uintptr) int32 { /* zip // Header ID 2 bytes // Data Size 2 bytes // Data N bytes -func zipfileScanExtra(tls *libc.TLS, aExtra uintptr, nExtra int32, pmTime uintptr) int32 { /* zipfile.c:663:12: */ +func zipfileScanExtra(tls *libc.TLS, aExtra uintptr, nExtra int32, pmTime uintptr) int32 { /* zipfile.c:665:12: */ var ret int32 = 0 var p uintptr = aExtra var pEnd uintptr = (aExtra + uintptr(nExtra)) @@ -32247,7 +33498,7 @@ func zipfileScanExtra(tls *libc.TLS, aExtra uintptr, nExtra int32, pmTime uintpt // Bits 09-15: years from 1980 // // https://msdn.microsoft.com/en-us/library/9kkf9tah.aspx -func zipfileMtime(tls *libc.TLS, pCDS uintptr) u321 { /* zipfile.c:706:12: */ +func zipfileMtime(tls *libc.TLS, pCDS uintptr) u321 { /* zipfile.c:708:12: */ var Y int32 = (1980 + ((int32((*ZipfileCDS)(unsafe.Pointer(pCDS)).FmDate) >> 9) & 0x7F)) var M int32 = ((int32((*ZipfileCDS)(unsafe.Pointer(pCDS)).FmDate) >> 5) & 0x0F) var D int32 = (int32((*ZipfileCDS)(unsafe.Pointer(pCDS)).FmDate) & 0x1F) @@ -32279,7 +33530,7 @@ func zipfileMtime(tls *libc.TLS, pCDS uintptr) u321 { /* zipfile.c:706:12: */ // The opposite of zipfileMtime(). This function populates the mTime and // mDate fields of the CDS structure passed as the first argument according // to the UNIX timestamp value passed as the second. -func zipfileMtimeToDos(tls *libc.TLS, pCds uintptr, mUnixTime u321) { /* zipfile.c:742:13: */ +func zipfileMtimeToDos(tls *libc.TLS, pCds uintptr, mUnixTime u321) { /* zipfile.c:744:13: */ // Convert unix timestamp to JD (2440588 is noon on 1/1/1970) var JD i64 = (i64(uint64(int64(2440588)) + (uint64(mUnixTime / (uint64((24 * 60) * 60)))))) var A int32 @@ -32336,7 +33587,7 @@ func zipfileMtimeToDos(tls *libc.TLS, pCds uintptr, mUnixTime u321) { /* zipfile // If successful, SQLITE_OK is returned and (*ppEntry) set to point to // the new object. Otherwise, an SQLite error code is returned and the // final value of (*ppEntry) undefined. -func zipfileGetEntry(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFile uintptr, iOff i64, ppEntry uintptr) int32 { /* zipfile.c:790:12: */ +func zipfileGetEntry(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFile uintptr, iOff i64, ppEntry uintptr) int32 { /* zipfile.c:792:12: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -32371,18 +33622,18 @@ func zipfileGetEntry(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pF libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(ZipfileEntry{}))) rc = zipfileReadCDS(tls, aRead, (pNew /* &.cds */)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8919 /* "failed to read C..." */, libc.VaList(bp, iOff)) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+9099 /* "failed to read C..." */, libc.VaList(bp, iOff)) } else if aBlob == uintptr(0) { rc = zipfileReadData(tls, - pFile, aRead, (nExtra + nFile), (iOff + ZIPFILE_CDS_FIXED_SZ), pzErr) + pFile, aRead, (nExtra + nFile), (iOff + int64(ZIPFILE_CDS_FIXED_SZ)), pzErr) } else { - aRead = (aBlob + uintptr((iOff + ZIPFILE_CDS_FIXED_SZ))) + aRead = (aBlob + uintptr((iOff + int64(ZIPFILE_CDS_FIXED_SZ)))) } } if rc == SQLITE_OK { var pt uintptr = (pNew + 80 /* &.mUnixTime */) - (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FzFile = sqlite3.Xsqlite3_mprintf(tls, ts+8953 /* "%.*s" */, libc.VaList(bp+8, nFile, aRead)) + (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FzFile = sqlite3.Xsqlite3_mprintf(tls, ts+9133 /* "%.*s" */, libc.VaList(bp+8, nFile, aRead)) (*ZipfileEntry)(unsafe.Pointer(pNew)).FaExtra = (pNew + 1*120) libc.Xmemcpy(tls, (*ZipfileEntry)(unsafe.Pointer(pNew)).FaExtra, (aRead + uintptr(nFile)), uint64(nExtra)) if (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FzFile == uintptr(0) { @@ -32403,14 +33654,14 @@ func zipfileGetEntry(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pF rc = zipfileReadLFH(tls, aRead, bp+32 /* &lfh */) if rc == SQLITE_OK { - (*ZipfileEntry)(unsafe.Pointer(pNew)).FiDataOff = (i64((*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiOffset + ZIPFILE_LFH_FIXED_SZ)) + (*ZipfileEntry)(unsafe.Pointer(pNew)).FiDataOff = (i64((*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiOffset + uint64(ZIPFILE_LFH_FIXED_SZ))) *(*i64)(unsafe.Pointer(pNew + 96 /* &.iDataOff */)) += (i64(int32((*ZipfileLFH)(unsafe.Pointer(bp+32 /* &lfh */)).FnFile) + int32((*ZipfileLFH)(unsafe.Pointer(bp+32 /* &lfh */)).FnExtra))) if (aBlob != 0) && ((*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FszCompressed != 0) { (*ZipfileEntry)(unsafe.Pointer(pNew)).FaData = ((*ZipfileEntry)(unsafe.Pointer(pNew)).FaExtra + uintptr(nExtra)) libc.Xmemcpy(tls, (*ZipfileEntry)(unsafe.Pointer(pNew)).FaData, (aBlob + uintptr((*ZipfileEntry)(unsafe.Pointer(pNew)).FiDataOff)), (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FszCompressed) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8958, /* "failed to read L..." */ + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+9138, /* "failed to read L..." */ libc.VaList(bp+24, int32((*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiOffset))) } } @@ -32425,10 +33676,10 @@ func zipfileGetEntry(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pF return rc } -var szFix int32 = ZIPFILE_LFH_FIXED_SZ /* zipfile.c:852:24 */ +var szFix int32 = ZIPFILE_LFH_FIXED_SZ /* zipfile.c:854:24 */ // Advance an ZipfileCsr to its next row of output. -func zipfileNext(tls *libc.TLS, cur uintptr) int32 { /* zipfile.c:888:12: */ +func zipfileNext(tls *libc.TLS, cur uintptr) int32 { /* zipfile.c:890:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -32446,7 +33697,7 @@ func zipfileNext(tls *libc.TLS, cur uintptr) int32 { /* zipfile.c:888:12: */ var pTab uintptr = (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab rc = zipfileGetEntry(tls, pTab, uintptr(0), 0, (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile, (*ZipfileCsr)(unsafe.Pointer(pCsr)).FiNextOff, bp /* &p */) if rc == SQLITE_OK { - *(*i64)(unsafe.Pointer(pCsr + 32 /* &.iNextOff */)) += (ZIPFILE_CDS_FIXED_SZ) + *(*i64)(unsafe.Pointer(pCsr + 32 /* &.iNextOff */)) += (int64(ZIPFILE_CDS_FIXED_SZ)) *(*i64)(unsafe.Pointer(pCsr + 32 /* &.iNextOff */)) += (i64((int32((*ZipfileEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).Fcds.FnExtra) + int32((*ZipfileEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).Fcds.FnFile)) + int32((*ZipfileEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).Fcds.FnComment))) } (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpCurrent = *(*uintptr)(unsafe.Pointer(bp /* p */)) @@ -32464,7 +33715,7 @@ func zipfileNext(tls *libc.TLS, cur uintptr) int32 { /* zipfile.c:888:12: */ return rc } -func zipfileFree(tls *libc.TLS, p uintptr) { /* zipfile.c:921:13: */ +func zipfileFree(tls *libc.TLS, p uintptr) { /* zipfile.c:923:13: */ sqlite3.Xsqlite3_free(tls, p) } @@ -32473,7 +33724,7 @@ func zipfileFree(tls *libc.TLS, p uintptr) { /* zipfile.c:921:13: */ // return value in context pCtx to the result (a blob). // // If an error occurs, an error code is left in pCtx instead. -func zipfileInflate(tls *libc.TLS, pCtx uintptr, aIn uintptr, nIn int32, nOut int32) { /* zipfile.c:932:13: */ +func zipfileInflate(tls *libc.TLS, pCtx uintptr, aIn uintptr, nIn int32, nOut int32) { /* zipfile.c:934:13: */ bp := tls.Alloc(128) defer tls.Free(128) @@ -32491,13 +33742,13 @@ func zipfileInflate(tls *libc.TLS, pCtx uintptr, aIn uintptr, nIn int32, nOut in (*z_stream)(unsafe.Pointer(bp + 16 /* &str */)).Fnext_out = aRes (*z_stream)(unsafe.Pointer(bp + 16 /* &str */)).Favail_out = uInt(nOut) - err = z.XinflateInit2_(tls, bp+16 /* &str */, -15, ts+8990 /* "1.2.11" */, int32(unsafe.Sizeof(z_stream{}))) + err = z.XinflateInit2_(tls, bp+16 /* &str */, -15, ts+9170 /* "1.2.11" */, int32(unsafe.Sizeof(z_stream{}))) if err != Z_OK { - zipfileCtxErrorMsg(tls, pCtx, ts+8997 /* "inflateInit2() f..." */, libc.VaList(bp, err)) + zipfileCtxErrorMsg(tls, pCtx, ts+9177 /* "inflateInit2() f..." */, libc.VaList(bp, err)) } else { err = z.Xinflate(tls, bp+16 /* &str */, Z_NO_FLUSH) if err != Z_STREAM_END { - zipfileCtxErrorMsg(tls, pCtx, ts+9024 /* "inflate() failed..." */, libc.VaList(bp+8, err)) + zipfileCtxErrorMsg(tls, pCtx, ts+9204 /* "inflate() failed..." */, libc.VaList(bp+8, err)) } else { sqlite3.Xsqlite3_result_blob(tls, pCtx, aRes, nOut, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{zipfileFree}))) aRes = uintptr(0) @@ -32518,7 +33769,7 @@ func zipfileInflate(tls *libc.TLS, pCtx uintptr, aIn uintptr, nIn int32, nOut in // code is returned and an error message left in virtual-table handle // pTab. The values of (*ppOut) and (*pnOut) are left unchanged in this // case. -func zipfileDeflate(tls *libc.TLS, aIn uintptr, nIn int32, ppOut uintptr, pnOut uintptr, pzErr uintptr) int32 { /* zipfile.c:980:12: */ +func zipfileDeflate(tls *libc.TLS, aIn uintptr, nIn int32, ppOut uintptr, pnOut uintptr, pzErr uintptr) int32 { /* zipfile.c:982:12: */ bp := tls.Alloc(112) defer tls.Free(112) @@ -32531,7 +33782,7 @@ func zipfileDeflate(tls *libc.TLS, aIn uintptr, nIn int32, ppOut uintptr, pnOut libc.Xmemset(tls, bp /* &str */, 0, uint64(unsafe.Sizeof(z_stream{}))) (*z_stream)(unsafe.Pointer(bp /* &str */)).Fnext_in = aIn (*z_stream)(unsafe.Pointer(bp /* &str */)).Favail_in = uInt(nIn) - z.XdeflateInit2_(tls, bp /* &str */, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY, ts+8990 /* "1.2.11" */, int32(unsafe.Sizeof(z_stream{}))) + z.XdeflateInit2_(tls, bp /* &str */, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY, ts+9170 /* "1.2.11" */, int32(unsafe.Sizeof(z_stream{}))) nAlloc = sqlite3_int64(z.XdeflateBound(tls, bp /* &str */, uint64(nIn))) aOut = sqlite3.Xsqlite3_malloc64(tls, uint64(nAlloc)) @@ -32547,7 +33798,7 @@ func zipfileDeflate(tls *libc.TLS, aIn uintptr, nIn int32, ppOut uintptr, pnOut *(*int32)(unsafe.Pointer(pnOut)) = int32((*z_stream)(unsafe.Pointer(bp /* &str */)).Ftotal_out) } else { sqlite3.Xsqlite3_free(tls, aOut) - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+9046 /* "zipfile: deflate..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+9226 /* "zipfile: deflate..." */, 0) rc = SQLITE_ERROR } z.XdeflateEnd(tls, bp /* &str */) @@ -32558,7 +33809,7 @@ func zipfileDeflate(tls *libc.TLS, aIn uintptr, nIn int32, ppOut uintptr, pnOut // Return values of columns for the row at which the series_cursor // is currently pointing. -func zipfileColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* zipfile.c:1023:12: */ +func zipfileColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* zipfile.c:1025:12: */ var pCsr uintptr = cur var pCDS uintptr = ((*ZipfileCsr)(unsafe.Pointer(pCsr)).FpCurrent /* &.cds */) var rc int32 = SQLITE_OK @@ -32626,8 +33877,8 @@ func zipfileColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* // it to be a directory either if the mode suggests so, or if // the final character in the name is '/'. var mode u321 = ((*ZipfileCDS)(unsafe.Pointer(pCDS)).FiExternalAttr >> 16) - if !((mode & S_IFDIR) != 0) && (int32(*(*int8)(unsafe.Pointer((*ZipfileCDS)(unsafe.Pointer(pCDS)).FzFile + uintptr((int32((*ZipfileCDS)(unsafe.Pointer(pCDS)).FnFile) - 1))))) != '/') { - sqlite3.Xsqlite3_result_blob(tls, ctx, ts+488 /* "" */, 0, uintptr(0)) + if !((mode & uint64(S_IFDIR)) != 0) && (int32(*(*int8)(unsafe.Pointer((*ZipfileCDS)(unsafe.Pointer(pCDS)).FzFile + uintptr((int32((*ZipfileCDS)(unsafe.Pointer(pCDS)).FnFile) - 1))))) != '/') { + sqlite3.Xsqlite3_result_blob(tls, ctx, ts+489 /* "" */, 0, uintptr(0)) } } } @@ -32647,7 +33898,7 @@ func zipfileColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* } // Return TRUE if the cursor is at EOF. -func zipfileEof(tls *libc.TLS, cur uintptr) int32 { /* zipfile.c:1110:12: */ +func zipfileEof(tls *libc.TLS, cur uintptr) int32 { /* zipfile.c:1112:12: */ var pCsr uintptr = cur return int32((*ZipfileCsr)(unsafe.Pointer(pCsr)).FbEof) } @@ -32660,7 +33911,7 @@ func zipfileEof(tls *libc.TLS, cur uintptr) int32 { /* zipfile.c:1110:12: */ // and populate *pEOCD with the results of decoding it. SQLITE_OK is // returned if successful. Otherwise, an SQLite error code is returned and // an English language error message may be left in virtual-table pTab. -func zipfileReadEOCD(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFile uintptr, pEOCD uintptr) int32 { /* zipfile.c:1125:12: */ +func zipfileReadEOCD(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFile uintptr, pEOCD uintptr) int32 { /* zipfile.c:1127:12: */ var aRead uintptr = (*ZipfileTab)(unsafe.Pointer(pTab)).FaBuffer // Temporary buffer var nRead int32 // Bytes to read from file var rc int32 = SQLITE_OK @@ -32704,7 +33955,7 @@ func zipfileReadEOCD(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pF } if i < 0 { (*ZipfileTab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, - ts+9071 /* "cannot find end ..." */, 0) + ts+9251 /* "cannot find end ..." */, 0) return SQLITE_ERROR } @@ -32724,7 +33975,7 @@ func zipfileReadEOCD(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pF // and ends with pLastEntry. If argument pBefore is NULL, then pNew is added // to the end of the list. Otherwise, it is added to the list immediately // before pBefore (which is guaranteed to be a part of said list). -func zipfileAddEntry(tls *libc.TLS, pTab uintptr, pBefore uintptr, pNew uintptr) { /* zipfile.c:1189:13: */ +func zipfileAddEntry(tls *libc.TLS, pTab uintptr, pBefore uintptr, pNew uintptr) { /* zipfile.c:1191:13: */ if pBefore == uintptr(0) { if (*ZipfileTab)(unsafe.Pointer(pTab)).FpFirstEntry == uintptr(0) { @@ -32743,7 +33994,7 @@ func zipfileAddEntry(tls *libc.TLS, pTab uintptr, pBefore uintptr, pNew uintptr) } } -func zipfileLoadDirectory(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32) int32 { /* zipfile.c:1212:12: */ +func zipfileLoadDirectory(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32) int32 { /* zipfile.c:1214:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -32761,7 +34012,7 @@ func zipfileLoadDirectory(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int3 if rc == SQLITE_OK { zipfileAddEntry(tls, pTab, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 24 /* pNew */))) - iOff = iOff + (ZIPFILE_CDS_FIXED_SZ) + iOff = iOff + (int64(ZIPFILE_CDS_FIXED_SZ)) iOff = iOff + (i64((int32((*ZipfileEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pNew */)))).Fcds.FnExtra) + int32((*ZipfileEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pNew */)))).Fcds.FnFile)) + int32((*ZipfileEntry)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pNew */)))).Fcds.FnComment))) } } @@ -32769,7 +34020,7 @@ func zipfileLoadDirectory(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int3 } // xFilter callback. -func zipfileFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* zipfile.c:1236:12: */ +func zipfileFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* zipfile.c:1238:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -32784,7 +34035,7 @@ func zipfileFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, arg if (*ZipfileTab)(unsafe.Pointer(pTab)).FzFile != 0 { zFile = (*ZipfileTab)(unsafe.Pointer(pTab)).FzFile } else if idxNum == 0 { - zipfileCursorErr(tls, pCsr, ts+9115 /* "zipfile() functi..." */, 0) + zipfileCursorErr(tls, pCsr, ts+9295 /* "zipfile() functi..." */, 0) return SQLITE_ERROR } else if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) == SQLITE_BLOB { var aBlob uintptr = sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -32802,9 +34053,9 @@ func zipfileFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, arg } if (uintptr(0) == (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd) && (0 == bInMemory) { - (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile = libc.Xfopen(tls, zFile, ts+4086 /* "rb" */) + (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile = libc.Xfopen(tls, zFile, ts+4273 /* "rb" */) if (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile == uintptr(0) { - zipfileCursorErr(tls, pCsr, ts+9155 /* "cannot open file..." */, libc.VaList(bp, zFile)) + zipfileCursorErr(tls, pCsr, ts+9335 /* "cannot open file..." */, libc.VaList(bp, zFile)) rc = SQLITE_ERROR } else { rc = zipfileReadEOCD(tls, pTab, uintptr(0), 0, (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile, (pCsr + 40 /* &.eocd */)) @@ -32832,7 +34083,7 @@ func zipfileFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, arg } // xBestIndex callback. -func zipfileBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* zipfile.c:1295:12: */ +func zipfileBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* zipfile.c:1297:12: */ var i int32 var idx int32 = -1 var unusable int32 = 0 @@ -32859,7 +34110,7 @@ func zipfileBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* z return SQLITE_OK } -func zipfileNewEntry(tls *libc.TLS, zPath uintptr) uintptr { /* zipfile.c:1323:21: */ +func zipfileNewEntry(tls *libc.TLS, zPath uintptr) uintptr { /* zipfile.c:1325:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -32876,7 +34127,7 @@ func zipfileNewEntry(tls *libc.TLS, zPath uintptr) uintptr { /* zipfile.c:1323:2 return pNew } -func zipfileSerializeLFH(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* zipfile.c:1337:12: */ +func zipfileSerializeLFH(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* zipfile.c:1339:12: */ var pCds uintptr = (pEntry /* &.cds */) var a uintptr = aBuf @@ -32884,7 +34135,7 @@ func zipfileSerializeLFH(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* /* Write the LFH itself */ { - zipfilePutU32(tls, a, ZIPFILE_SIGNATURE_LFH) + zipfilePutU32(tls, a, uint64(ZIPFILE_SIGNATURE_LFH)) a += uintptr(4) } @@ -32944,7 +34195,7 @@ func zipfileSerializeLFH(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* /* The "extra" data */ { - zipfilePutU16(tls, a, ZIPFILE_EXTRA_TIMESTAMP) + zipfilePutU16(tls, a, uint16(ZIPFILE_EXTRA_TIMESTAMP)) a += uintptr(2) } @@ -32962,7 +34213,7 @@ func zipfileSerializeLFH(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* return (int32((int64(a) - int64(aBuf)) / 1)) } -func zipfileAppendEntry(tls *libc.TLS, pTab uintptr, pEntry uintptr, pData uintptr, nData int32) int32 { /* zipfile.c:1370:12: */ +func zipfileAppendEntry(tls *libc.TLS, pTab uintptr, pEntry uintptr, pData uintptr, nData int32) int32 { /* zipfile.c:1372:12: */ var aBuf uintptr = (*ZipfileTab)(unsafe.Pointer(pTab)).FaBuffer var nBuf int32 var rc int32 @@ -32977,7 +34228,7 @@ func zipfileAppendEntry(tls *libc.TLS, pTab uintptr, pEntry uintptr, pData uintp return rc } -func zipfileGetMode(tls *libc.TLS, pVal uintptr, bIsDir int32, pMode uintptr, pzErr uintptr) int32 { /* zipfile.c:1390:12: */ +func zipfileGetMode(tls *libc.TLS, pVal uintptr, bIsDir int32, pMode uintptr, pzErr uintptr) int32 { /* zipfile.c:1392:12: */ bp := tls.Alloc(19) defer tls.Free(19) @@ -33005,7 +34256,7 @@ __1: mode = u321(uint32(sqlite3.Xsqlite3_value_int(tls, pVal))) goto __4 __3: - *(*[11]int8)(unsafe.Pointer(bp + 8 /* zTemplate */)) = *(*[11]int8)(unsafe.Pointer(ts + 9176 /* "-rwxrwxrwx" */)) + *(*[11]int8)(unsafe.Pointer(bp + 8 /* zTemplate */)) = *(*[11]int8)(unsafe.Pointer(ts + 9356 /* "-rwxrwxrwx" */)) if !(libc.Xstrlen(tls, z) != uint64(10)) { goto __5 } @@ -33024,13 +34275,13 @@ __5: } goto __6 __7: - mode = mode | (S_IFREG) + mode = mode | (uint64(S_IFREG)) goto __6 __8: - mode = mode | (S_IFDIR) + mode = mode | (uint64(S_IFDIR)) goto __6 __9: - mode = mode | (S_IFLNK) + mode = mode | (uint64(S_IFLNK)) goto __6 __10: goto parse_error @@ -33066,12 +34317,12 @@ __4: ; __2: ; - if !((libc.Bool32((mode & S_IFDIR) == uint64(0))) == bIsDir) { + if !((libc.Bool32((mode & uint64(S_IFDIR)) == uint64(0))) == bIsDir) { goto __17 } // The "mode" attribute is a directory, but data has been specified. // Or vice-versa - no data but "mode" is a file or symlink. - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+9187 /* "zipfile: mode do..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+9367 /* "zipfile: mode do..." */, 0) return SQLITE_CONSTRAINT __17: ; @@ -33079,7 +34330,7 @@ __17: return SQLITE_OK parse_error: - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+9221 /* "zipfile: parse e..." */, libc.VaList(bp, z)) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+9401 /* "zipfile: parse e..." */, libc.VaList(bp, z)) return SQLITE_ERROR } @@ -33087,7 +34338,7 @@ parse_error: // Both (const char*) arguments point to nul-terminated strings. Argument // nB is the value of strlen(zB). This function returns 0 if the strings are // identical, ignoring any trailing '/' character in either path. -func zipfileComparePath(tls *libc.TLS, zA uintptr, zB uintptr, nB int32) int32 { /* zipfile.c:1435:12: */ +func zipfileComparePath(tls *libc.TLS, zA uintptr, zB uintptr, nB int32) int32 { /* zipfile.c:1437:12: */ var nA int32 = int32(libc.Xstrlen(tls, zA)) if (nA > 0) && (int32(*(*int8)(unsafe.Pointer(zA + uintptr((nA - 1))))) == '/') { nA-- @@ -33101,7 +34352,7 @@ func zipfileComparePath(tls *libc.TLS, zA uintptr, zB uintptr, nB int32) int32 { return 1 } -func zipfileBegin(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:1443:12: */ +func zipfileBegin(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:1445:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -33109,7 +34360,7 @@ func zipfileBegin(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:1443:12: */ var rc int32 = SQLITE_OK if ((*ZipfileTab)(unsafe.Pointer(pTab)).FzFile == uintptr(0)) || (int32(*(*int8)(unsafe.Pointer((*ZipfileTab)(unsafe.Pointer(pTab)).FzFile))) == 0) { - (*ZipfileTab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+9254 /* "zipfile: missing..." */, 0) + (*ZipfileTab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+9434 /* "zipfile: missing..." */, 0) return SQLITE_ERROR } @@ -33117,10 +34368,10 @@ func zipfileBegin(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:1443:12: */ // structure into memory. During the transaction any new file data is // appended to the archive file, but the central directory is accumulated // in main-memory until the transaction is committed. - (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd = libc.Xfopen(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FzFile, ts+9280 /* "ab+" */) + (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd = libc.Xfopen(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FzFile, ts+9460 /* "ab+" */) if (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd == uintptr(0) { (*ZipfileTab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, - ts+9284 /* "zipfile: failed ..." */, libc.VaList(bp, (*ZipfileTab)(unsafe.Pointer(pTab)).FzFile)) + ts+9464 /* "zipfile: failed ..." */, libc.VaList(bp, (*ZipfileTab)(unsafe.Pointer(pTab)).FzFile)) rc = SQLITE_ERROR } else { libc.Xfseek(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd, int64(0), SEEK_END) @@ -33137,7 +34388,7 @@ func zipfileBegin(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:1443:12: */ // Return the current time as a 32-bit timestamp in UNIX epoch format (like // time(2)). -func zipfileTime(tls *libc.TLS) u321 { /* zipfile.c:1480:12: */ +func zipfileTime(tls *libc.TLS) u321 { /* zipfile.c:1482:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -33162,7 +34413,7 @@ func zipfileTime(tls *libc.TLS) u321 { /* zipfile.c:1480:12: */ // If the value passed as the only argument is either NULL or an SQL NULL, // return the current time. Otherwise, return the value stored in (*pVal) // cast to a 32-bit unsigned integer. -func zipfileGetTime(tls *libc.TLS, pVal uintptr) u321 { /* zipfile.c:1502:12: */ +func zipfileGetTime(tls *libc.TLS, pVal uintptr) u321 { /* zipfile.c:1504:12: */ if (pVal == uintptr(0)) || (sqlite3.Xsqlite3_value_type(tls, pVal) == SQLITE_NULL) { return zipfileTime(tls) } @@ -33171,7 +34422,7 @@ func zipfileGetTime(tls *libc.TLS, pVal uintptr) u321 { /* zipfile.c:1502:12: */ // Unless it is NULL, entry pOld is currently part of the pTab->pFirstEntry // linked list. Remove it from the list and free the object. -func zipfileRemoveEntryFromList(tls *libc.TLS, pTab uintptr, pOld uintptr) { /* zipfile.c:1513:13: */ +func zipfileRemoveEntryFromList(tls *libc.TLS, pTab uintptr, pOld uintptr) { /* zipfile.c:1515:13: */ if pOld != 0 { var pp uintptr for pp = (pTab + 64 /* &.pFirstEntry */); (*(*uintptr)(unsafe.Pointer(pp))) != pOld; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 112 /* &.pNext */) { @@ -33182,7 +34433,7 @@ func zipfileRemoveEntryFromList(tls *libc.TLS, pTab uintptr, pOld uintptr) { /* } // xUpdate method. -func zipfileUpdate(tls *libc.TLS, pVtab uintptr, nVal int32, apVal uintptr, pRowid uintptr) int32 { /* zipfile.c:1525:12: */ +func zipfileUpdate(tls *libc.TLS, pVtab uintptr, nVal int32, apVal uintptr, pRowid uintptr) int32 { /* zipfile.c:1527:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -33298,14 +34549,14 @@ __3: if !(sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + 5*8))) != SQLITE_NULL) { goto __11 } - zipfileTableErr(tls, pTab, ts+9328 /* "sz must be NULL" */, 0) + zipfileTableErr(tls, pTab, ts+9508 /* "sz must be NULL" */, 0) rc = SQLITE_CONSTRAINT __11: ; if !(sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + 6*8))) != SQLITE_NULL) { goto __12 } - zipfileTableErr(tls, pTab, ts+9344 /* "rawdata must be ..." */, 0) + zipfileTableErr(tls, pTab, ts+9524 /* "rawdata must be ..." */, 0) rc = SQLITE_CONSTRAINT __12: ; @@ -33333,7 +34584,7 @@ __14: if !((iMethod != 0) && (iMethod != 8)) { goto __16 } - zipfileTableErr(tls, pTab, ts+9365 /* "unknown compress..." */, libc.VaList(bp, iMethod)) + zipfileTableErr(tls, pTab, ts+9545 /* "unknown compress..." */, libc.VaList(bp, iMethod)) rc = SQLITE_CONSTRAINT goto __17 __16: @@ -33378,7 +34629,7 @@ __21: if !(zPath == uintptr(0)) { goto __23 } - zPath = ts + 488 /* "" */ + zPath = ts + 489 /* "" */ __23: ; nPath = int32(libc.Xstrlen(tls, zPath)) @@ -33396,7 +34647,7 @@ __22: if !((nPath <= 0) || (int32(*(*int8)(unsafe.Pointer(zPath + uintptr((nPath - 1))))) != '/')) { goto __25 } - zFree = sqlite3.Xsqlite3_mprintf(tls, ts+9396 /* "%s/" */, libc.VaList(bp+8, zPath)) + zFree = sqlite3.Xsqlite3_mprintf(tls, ts+9576 /* "%s/" */, libc.VaList(bp+8, zPath)) zPath = zFree if !(zFree == uintptr(0)) { goto __26 @@ -33443,7 +34694,7 @@ __35: goto __33 __36: - zipfileTableErr(tls, pTab, ts+9400 /* "duplicate name: ..." */, libc.VaList(bp+16, zPath)) + zipfileTableErr(tls, pTab, ts+9580 /* "duplicate name: ..." */, libc.VaList(bp+16, zPath)) rc = SQLITE_CONSTRAINT goto __33 @@ -33474,8 +34725,8 @@ __28: goto __39 __38: (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiVersionMadeBy = (u16((int32(3) << 8) + 30)) - (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiVersionExtract = ZIPFILE_NEWENTRY_REQUIRED - (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.Fflags = ZIPFILE_NEWENTRY_FLAGS + (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiVersionExtract = u16(ZIPFILE_NEWENTRY_REQUIRED) + (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.Fflags = u16(ZIPFILE_NEWENTRY_FLAGS) (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiCompression = u16(iMethod) zipfileMtimeToDos(tls, (pNew /* &.cds */), mTime) (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.Fcrc32 = iCrc32 @@ -33528,10 +34779,10 @@ zipfile_update_done: return rc } -func zipfileSerializeEOCD(tls *libc.TLS, p uintptr, aBuf uintptr) int32 { /* zipfile.c:1716:12: */ +func zipfileSerializeEOCD(tls *libc.TLS, p uintptr, aBuf uintptr) int32 { /* zipfile.c:1718:12: */ var a uintptr = aBuf { - zipfilePutU32(tls, a, ZIPFILE_SIGNATURE_EOCD) + zipfilePutU32(tls, a, uint64(ZIPFILE_SIGNATURE_EOCD)) a += uintptr(4) } @@ -33574,7 +34825,7 @@ func zipfileSerializeEOCD(tls *libc.TLS, p uintptr, aBuf uintptr) int32 { /* zip return (int32((int64(a) - int64(aBuf)) / 1)) } -func zipfileAppendEOCD(tls *libc.TLS, pTab uintptr, p uintptr) int32 { /* zipfile.c:1730:12: */ +func zipfileAppendEOCD(tls *libc.TLS, pTab uintptr, p uintptr) int32 { /* zipfile.c:1732:12: */ var nBuf int32 = zipfileSerializeEOCD(tls, p, (*ZipfileTab)(unsafe.Pointer(pTab)).FaBuffer) return zipfileAppendData(tls, pTab, (*ZipfileTab)(unsafe.Pointer(pTab)).FaBuffer, nBuf) @@ -33582,7 +34833,7 @@ func zipfileAppendEOCD(tls *libc.TLS, pTab uintptr, p uintptr) int32 { /* zipfil // Serialize the CDS structure into buffer aBuf[]. Return the number // of bytes written. -func zipfileSerializeCDS(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* zipfile.c:1740:12: */ +func zipfileSerializeCDS(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* zipfile.c:1742:12: */ var a uintptr = aBuf var pCDS uintptr = (pEntry /* &.cds */) @@ -33591,7 +34842,7 @@ func zipfileSerializeCDS(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* } { - zipfilePutU32(tls, a, ZIPFILE_SIGNATURE_CDS) + zipfilePutU32(tls, a, uint64(ZIPFILE_SIGNATURE_CDS)) a += uintptr(4) } @@ -33685,7 +34936,7 @@ func zipfileSerializeCDS(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* } else { { - zipfilePutU16(tls, a, ZIPFILE_EXTRA_TIMESTAMP) + zipfilePutU16(tls, a, uint16(ZIPFILE_EXTRA_TIMESTAMP)) a += uintptr(2) } @@ -33705,7 +34956,7 @@ func zipfileSerializeCDS(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* return (int32((int64(a) - int64(aBuf)) / 1)) } -func zipfileCommit(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:1785:12: */ +func zipfileCommit(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:1787:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -33739,11 +34990,11 @@ func zipfileCommit(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:1785:12: * return rc } -func zipfileRollback(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:1815:12: */ +func zipfileRollback(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:1817:12: */ return zipfileCommit(tls, pVtab) } -func zipfileFindCursor(tls *libc.TLS, pTab uintptr, iId i64) uintptr { /* zipfile.c:1819:19: */ +func zipfileFindCursor(tls *libc.TLS, pTab uintptr, iId i64) uintptr { /* zipfile.c:1821:19: */ var pCsr uintptr for pCsr = (*ZipfileTab)(unsafe.Pointer(pTab)).FpCsrList; pCsr != 0; pCsr = (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpCsrNext { if iId == (*ZipfileCsr)(unsafe.Pointer(pCsr)).FiId { @@ -33753,7 +35004,7 @@ func zipfileFindCursor(tls *libc.TLS, pTab uintptr, iId i64) uintptr { /* zipfil return pCsr } -func zipfileFunctionCds(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* zipfile.c:1827:13: */ +func zipfileFunctionCds(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* zipfile.c:1829:13: */ bp := tls.Alloc(128) defer tls.Free(128) @@ -33765,7 +35016,7 @@ func zipfileFunctionCds(tls *libc.TLS, context uintptr, argc int32, argv uintptr var p uintptr = ((*ZipfileCsr)(unsafe.Pointer(pCsr)).FpCurrent /* &.cds */) var zRes uintptr = sqlite3.Xsqlite3_mprintf(tls, - ts+9421, /* "{\"version-made-b..." */ + ts+9601, /* "{\"version-made-b..." */ libc.VaList(bp, u321((*ZipfileCDS)(unsafe.Pointer(p)).FiVersionMadeBy), u321((*ZipfileCDS)(unsafe.Pointer(p)).FiVersionExtract), u321((*ZipfileCDS)(unsafe.Pointer(p)).Fflags), u321((*ZipfileCDS)(unsafe.Pointer(p)).FiCompression), u321((*ZipfileCDS)(unsafe.Pointer(p)).FmTime), u321((*ZipfileCDS)(unsafe.Pointer(p)).FmDate), @@ -33785,8 +35036,8 @@ func zipfileFunctionCds(tls *libc.TLS, context uintptr, argc int32, argv uintptr } // xFindFunction method. -func zipfileFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* zipfile.c:1878:12: */ - if sqlite3.Xsqlite3_stricmp(tls, ts+9763 /* "zipfile_cds" */, zName) == 0 { +func zipfileFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* zipfile.c:1880:12: */ + if sqlite3.Xsqlite3_stricmp(tls, ts+9943 /* "zipfile_cds" */, zName) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{zipfileFunctionCds})) @@ -33800,20 +35051,20 @@ type ZipfileBuffer1 = struct { Fa uintptr Fn int32 FnAlloc int32 -} /* zipfile.c:1893:9 */ +} /* zipfile.c:1895:9 */ -type ZipfileBuffer = ZipfileBuffer1 /* zipfile.c:1893:30 */ +type ZipfileBuffer = ZipfileBuffer1 /* zipfile.c:1895:30 */ type ZipfileCtx1 = struct { FnEntry int32 _ [4]byte Fbody ZipfileBuffer Fcds ZipfileBuffer -} /* zipfile.c:1900:9 */ +} /* zipfile.c:1902:9 */ -type ZipfileCtx = ZipfileCtx1 /* zipfile.c:1900:27 */ +type ZipfileCtx = ZipfileCtx1 /* zipfile.c:1902:27 */ -func zipfileBufferGrow(tls *libc.TLS, pBuf uintptr, nByte int32) int32 { /* zipfile.c:1907:12: */ +func zipfileBufferGrow(tls *libc.TLS, pBuf uintptr, nByte int32) int32 { /* zipfile.c:1909:12: */ if ((*ZipfileBuffer)(unsafe.Pointer(pBuf)).Fn + nByte) > (*ZipfileBuffer)(unsafe.Pointer(pBuf)).FnAlloc { var aNew uintptr var nNew sqlite3_int64 @@ -33843,7 +35094,7 @@ func zipfileBufferGrow(tls *libc.TLS, pBuf uintptr, nByte int32) int32 { /* zipf // SELECT zipfile(name,data) ... // SELECT zipfile(name,mode,mtime,data) ... // SELECT zipfile(name,mode,mtime,data,method) ... -func zipfileStep(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* zipfile.c:1930:6: */ +func zipfileStep(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* zipfile.c:1932:6: */ bp := tls.Alloc(168) defer tls.Free(168) @@ -33907,7 +35158,7 @@ __1: if !(((nVal != 2) && (nVal != 4)) && (nVal != 5)) { goto __2 } - *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+9775 /* "wrong number of ..." */, 0) + *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+9955 /* "wrong number of ..." */, 0) rc = SQLITE_ERROR goto zipfile_step_out __2: @@ -33937,7 +35188,7 @@ __4: if !(zName == uintptr(0)) { goto __6 } - *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+9823 /* "first argument t..." */, 0) + *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+10003 /* "first argument t..." */, 0) rc = SQLITE_ERROR goto zipfile_step_out __6: @@ -33952,7 +35203,7 @@ __6: if !((iMethod != 0) && (iMethod != 8)) { goto __8 } - *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+9868 /* "illegal method v..." */, libc.VaList(bp, iMethod)) + *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+10048 /* "illegal method v..." */, libc.VaList(bp, iMethod)) rc = SQLITE_ERROR goto zipfile_step_out __8: @@ -34021,7 +35272,7 @@ __15: if !((nName > 0) && (int32(*(*int8)(unsafe.Pointer(zName + uintptr((nName - 1))))) == '/')) { goto __18 } - *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+9893 /* "non-directory na..." */, 0) + *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+10073 /* "non-directory na..." */, 0) rc = SQLITE_ERROR goto zipfile_step_out __18: @@ -34031,7 +35282,7 @@ __16: if !((nName == 0) || (int32(*(*int8)(unsafe.Pointer(zName + uintptr((nName - 1))))) != '/')) { goto __19 } - zName = libc.AssignUintptr(&zFree, sqlite3.Xsqlite3_mprintf(tls, ts+9396 /* "%s/" */, libc.VaList(bp+8, zName))) + zName = libc.AssignUintptr(&zFree, sqlite3.Xsqlite3_mprintf(tls, ts+9576 /* "%s/" */, libc.VaList(bp+8, zName))) if !(zName == uintptr(0)) { goto __21 } @@ -34057,8 +35308,8 @@ __17: // Assemble the ZipfileEntry object for the new zip archive entry (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FiVersionMadeBy = (u16((int32(3) << 8) + 30)) - (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FiVersionExtract = ZIPFILE_NEWENTRY_REQUIRED - (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.Fflags = ZIPFILE_NEWENTRY_FLAGS + (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FiVersionExtract = u16(ZIPFILE_NEWENTRY_REQUIRED) + (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.Fflags = u16(ZIPFILE_NEWENTRY_FLAGS) (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FiCompression = u16(iMethod) zipfileMtimeToDos(tls, (bp + 16 /* &e */ /* &.cds */), (*ZipfileEntry)(unsafe.Pointer(bp+16 /* &e */)).FmUnixTime) (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.Fcrc32 = iCrc32 @@ -34128,7 +35379,7 @@ __28: } // xFinalize() callback for zipfile aggregate function. -func zipfileFinal(tls *libc.TLS, pCtx uintptr) { /* zipfile.c:2105:6: */ +func zipfileFinal(tls *libc.TLS, pCtx uintptr) { /* zipfile.c:2107:6: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -34166,14 +35417,14 @@ func zipfileFinal(tls *libc.TLS, pCtx uintptr) { /* zipfile.c:2105:6: */ } // Register the "zipfile" virtual table. -func zipfileRegister(tls *libc.TLS, db uintptr) int32 { /* zipfile.c:2140:12: */ +func zipfileRegister(tls *libc.TLS, db uintptr) int32 { /* zipfile.c:2142:12: */ - var rc int32 = sqlite3.Xsqlite3_create_module(tls, db, ts+8834 /* "zipfile" */, uintptr(unsafe.Pointer(&zipfileModule)), uintptr(0)) + var rc int32 = sqlite3.Xsqlite3_create_module(tls, db, ts+9014 /* "zipfile" */, uintptr(unsafe.Pointer(&zipfileModule)), uintptr(0)) if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_overload_function(tls, db, ts+9763 /* "zipfile_cds" */, -1) + rc = sqlite3.Xsqlite3_overload_function(tls, db, ts+9943 /* "zipfile_cds" */, -1) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+8834 /* "zipfile" */, -1, SQLITE_UTF8, uintptr(0), uintptr(0), + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+9014 /* "zipfile" */, -1, SQLITE_UTF8, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{zipfileStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{zipfileFinal}))) @@ -34199,9 +35450,9 @@ var zipfileModule = sqlite3_module{ FxCommit: 0, // xCommit FxRollback: 0, // xRollback FxFindFunction: 0, // xRename -} /* zipfile.c:2141:25 */ +} /* zipfile.c:2143:25 */ -func sqlite3_zipfile_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* zipfile.c:2180:5: */ +func sqlite3_zipfile_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* zipfile.c:2182:5: */ _ = pApi _ = pzErrMsg // Unused parameter @@ -34215,7 +35466,7 @@ func test_rbu_delta(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* pScript = tcl.XTcl_NewObj(tls) (*Tcl_Obj)(unsafe.Pointer(pScript)).FrefCount++ - tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pScript, tcl.XTcl_NewStringObj(tls, ts+9932 /* "rbu_delta" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pScript, tcl.XTcl_NewStringObj(tls, ts+10112 /* "rbu_delta" */, -1)) for i = 0; i < nArg; i++ { var pIn uintptr = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)) var z uintptr = sqlite3.Xsqlite3_value_text(tls, pIn) @@ -34244,29 +35495,29 @@ func test_sqlite3rbu_cmd(tls *libc.TLS, clientData ClientData, interp uintptr, o var ret int32 = TCL_OK var pRbu uintptr = clientData *(*[14]RbuCmd)(unsafe.Pointer(bp + 24 /* aCmd */)) = [14]RbuCmd{ - {FzName: ts + 9942 /* "step" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 0 - {FzName: ts + 9947 /* "close" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 1 - {FzName: ts + 9953 /* "create_rbu_delta" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 2 - {FzName: ts + 9970 /* "savestate" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 3 - {FzName: ts + 9980 /* "dbMain_eval" */, FnArg: 3, FzUsage: ts + 9992 /* "SQL" */}, // 4 - {FzName: ts + 9996 /* "bp_progress" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 5 - {FzName: ts + 10008 /* "db" */, FnArg: 3, FzUsage: ts + 10011 /* "RBU" */}, // 6 - {FzName: ts + 10015 /* "state" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 7 - {FzName: ts + 10021 /* "progress" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 8 - {FzName: ts + 10030 /* "close_no_error" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 9 - {FzName: ts + 10045 /* "temp_size_limit" */, FnArg: 3, FzUsage: ts + 10061 /* "LIMIT" */}, // 10 - {FzName: ts + 10067 /* "temp_size" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 11 - {FzName: ts + 10077 /* "dbRbu_eval" */, FnArg: 3, FzUsage: ts + 9992 /* "SQL" */}, // 12 + {FzName: ts + 10122 /* "step" */, FnArg: 2, FzUsage: ts + 489 /* "" */}, // 0 + {FzName: ts + 10127 /* "close" */, FnArg: 2, FzUsage: ts + 489 /* "" */}, // 1 + {FzName: ts + 10133 /* "create_rbu_delta" */, FnArg: 2, FzUsage: ts + 489 /* "" */}, // 2 + {FzName: ts + 10150 /* "savestate" */, FnArg: 2, FzUsage: ts + 489 /* "" */}, // 3 + {FzName: ts + 10160 /* "dbMain_eval" */, FnArg: 3, FzUsage: ts + 10172 /* "SQL" */}, // 4 + {FzName: ts + 10176 /* "bp_progress" */, FnArg: 2, FzUsage: ts + 489 /* "" */}, // 5 + {FzName: ts + 10188 /* "db" */, FnArg: 3, FzUsage: ts + 10191 /* "RBU" */}, // 6 + {FzName: ts + 10195 /* "state" */, FnArg: 2, FzUsage: ts + 489 /* "" */}, // 7 + {FzName: ts + 10201 /* "progress" */, FnArg: 2, FzUsage: ts + 489 /* "" */}, // 8 + {FzName: ts + 10210 /* "close_no_error" */, FnArg: 2, FzUsage: ts + 489 /* "" */}, // 9 + {FzName: ts + 10225 /* "temp_size_limit" */, FnArg: 3, FzUsage: ts + 10241 /* "LIMIT" */}, // 10 + {FzName: ts + 10247 /* "temp_size" */, FnArg: 2, FzUsage: ts + 489 /* "" */}, // 11 + {FzName: ts + 10257 /* "dbRbu_eval" */, FnArg: 3, FzUsage: ts + 10172 /* "SQL" */}, // 12 {}, } // var iCmd int32 at bp+360, 4 if objc < 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10088 /* "METHOD" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10268 /* "METHOD" */) return TCL_ERROR } ret = tcl.XTcl_GetIndexFromObjStruct(tls, - interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+24 /* &aCmd[0] */, int32(unsafe.Sizeof(RbuCmd{})), ts+10095 /* "method" */, 0, bp+360 /* &iCmd */) + interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+24 /* &aCmd[0] */, int32(unsafe.Sizeof(RbuCmd{})), ts+10275 /* "method" */, 0, bp+360 /* &iCmd */) if ret != 0 { return TCL_ERROR } @@ -34302,7 +35553,7 @@ func test_sqlite3rbu_cmd(tls *libc.TLS, clientData ClientData, interp uintptr, o } else { tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1)) if *(*uintptr)(unsafe.Pointer(bp + 368 /* zErrmsg */)) != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+10102 /* " - " */, *(*uintptr)(unsafe.Pointer(bp + 368 /* zErrmsg */)), 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+10282 /* " - " */, *(*uintptr)(unsafe.Pointer(bp + 368 /* zErrmsg */)), 0)) sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 368 /* zErrmsg */))) } ret = TCL_ERROR @@ -34315,7 +35566,7 @@ func test_sqlite3rbu_cmd(tls *libc.TLS, clientData ClientData, interp uintptr, o { var db uintptr = sqlite3.Xsqlite3rbu_db(tls, pRbu, 0) var rc int32 = sqlite3.Xsqlite3_create_function(tls, - db, ts+9932 /* "rbu_delta" */, -1, SQLITE_UTF8, interp, *(*uintptr)(unsafe.Pointer(&struct { + db, ts+10112 /* "rbu_delta" */, -1, SQLITE_UTF8, interp, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{test_rbu_delta})), uintptr(0), uintptr(0)) tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1)) @@ -34395,7 +35646,7 @@ func test_sqlite3rbu_cmd(tls *libc.TLS, clientData ClientData, interp uintptr, o } case 7: /* state */ { - *(*[6]uintptr)(unsafe.Pointer(bp + 440 /* aRes */)) = [6]uintptr{uintptr(0), ts + 10106 /* "oal" */, ts + 10110 /* "move" */, ts + 10115 /* "checkpoint" */, ts + 10126 /* "done" */, ts + 10131 /* "error" */} + *(*[6]uintptr)(unsafe.Pointer(bp + 440 /* aRes */)) = [6]uintptr{uintptr(0), ts + 10286 /* "oal" */, ts + 10290 /* "move" */, ts + 10295 /* "checkpoint" */, ts + 10306 /* "done" */, ts + 10311 /* "error" */} var eState int32 = sqlite3.Xsqlite3rbu_state(tls, pRbu) tcl.XTcl_SetResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 440 /* &aRes[0] */ + uintptr(eState)*8)), uintptr(0)) @@ -34455,7 +35706,7 @@ func test_sqlite3rbu(tls *libc.TLS, clientData ClientData, interp uintptr, objc var zStateDb uintptr = uintptr(0) if (objc != 4) && (objc != 5) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10137 /* "NAME TARGET-DB R..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10317 /* "NAME TARGET-DB R..." */) return TCL_ERROR } zCmd = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -34481,7 +35732,7 @@ func test_sqlite3rbu_vacuum(tls *libc.TLS, clientData ClientData, interp uintptr var zStateDb uintptr = uintptr(0) if (objc != 3) && (objc != 4) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10170 /* "NAME TARGET-DB ?..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10350 /* "NAME TARGET-DB ?..." */) return TCL_ERROR } zCmd = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -34508,7 +35759,7 @@ func test_sqlite3rbu_create_vfs(tls *libc.TLS, clientData ClientData, interp uin var rc int32 if (objc != 3) && (objc != 4) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10196 /* "?-default? NAME ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10376 /* "?-default? NAME ..." */) return TCL_ERROR } @@ -34536,7 +35787,7 @@ func test_sqlite3rbu_destroy_vfs(tls *libc.TLS, clientData ClientData, interp ui var zName uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10219 /* "NAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10399 /* "NAME" */) return TCL_ERROR } @@ -34553,13 +35804,13 @@ func test_sqlite3rbu_internal_test(tls *libc.TLS, clientData ClientData, interp var db uintptr if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } db = sqlite3.Xsqlite3rbu_db(tls, uintptr(0), 0) if db != uintptr(0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+10224 /* "sqlite3rbu_db(0,..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+10404 /* "sqlite3rbu_db(0,..." */, 0)) return TCL_ERROR } @@ -34581,11 +35832,11 @@ var aObjCmd = [5]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 10247 /* "sqlite3rbu" */, FxProc: 0}, - {FzName: ts + 10258 /* "sqlite3rbu_vacuu..." */, FxProc: 0}, - {FzName: ts + 10276 /* "sqlite3rbu_creat..." */, FxProc: 0}, - {FzName: ts + 10298 /* "sqlite3rbu_destr..." */, FxProc: 0}, - {FzName: ts + 10321 /* "sqlite3rbu_inter..." */, FxProc: 0}, + {FzName: ts + 10427 /* "sqlite3rbu" */, FxProc: 0}, + {FzName: ts + 10438 /* "sqlite3rbu_vacuu..." */, FxProc: 0}, + {FzName: ts + 10456 /* "sqlite3rbu_creat..." */, FxProc: 0}, + {FzName: ts + 10478 /* "sqlite3rbu_destr..." */, FxProc: 0}, + {FzName: ts + 10501 /* "sqlite3rbu_inter..." */, FxProc: 0}, } /* test_rbu.c:369:5 */ // 2014-09-08 @@ -34934,7 +36185,7 @@ type sigaction = struct { Fsa_flags int32 _ [4]byte Fsa_restorer uintptr -} /* sigaction.h:27:1 */ +} /* sigaction.h:24:1 */ // Get machine-dependent `struct sigcontext' and signal subcodes. // Copyright (C) 2002-2018 Free Software Foundation, Inc. @@ -35078,7 +36329,7 @@ type _xstate = struct { Fymmh struct{ Fymmh_space [64]uint32 } } /* sigcontext.h:189:1 */ -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -35178,7 +36429,7 @@ type _xstate = struct { // License along with the GNU C Library; if not, see // . -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -35409,11 +36660,10 @@ type ucontext_t1 = struct { F_xmm [16]struct{ Felement [4]uint32 } F__glibc_reserved1 [24]uint32 } - F__ssp [4]uint64 } /* ucontext.h:142:9 */ // Userlevel context. -type ucontext_t = ucontext_t1 /* ucontext.h:151:5 */ +type ucontext_t = ucontext_t1 /* ucontext.h:150:5 */ // Define struct sigstack. // Copyright (C) 1998-2018 Free Software Foundation, Inc. @@ -35693,7 +36943,7 @@ func incrblobHandle(tls *libc.TLS, instanceData ClientData, dir int32, hPtr uint } var IncrblobChannelType = Tcl_ChannelType{ - FtypeName: ts + 10346, /* "incrblob" */ // typeName + FtypeName: ts + 10526, /* "incrblob" */ // typeName Fversion: uintptr(0x2), // version FcloseProc: 0, // closeProc FinputProc: 0, // inputProc @@ -35731,7 +36981,7 @@ func createIncrblobChannel(tls *libc.TLS, interp uintptr, pDb uintptr, zDb uintp (*IncrblobChannel)(unsafe.Pointer(p)).FiSeek = 0 (*IncrblobChannel)(unsafe.Pointer(p)).FpBlob = *(*uintptr)(unsafe.Pointer(bp + 8 /* pBlob */)) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+16 /* &zChannel[0] */, ts+10355 /* "incrblob_%d" */, libc.VaList(bp, libc.PreIncInt32(&count, 1))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+16 /* &zChannel[0] */, ts+10535 /* "incrblob_%d" */, libc.VaList(bp, libc.PreIncInt32(&count, 1))) (*IncrblobChannel)(unsafe.Pointer(p)).Fchannel = tcl.XTcl_CreateChannel(tls, uintptr(unsafe.Pointer(&IncrblobChannelType)), bp+16 /* &zChannel[0] */, p, flags) tcl.XTcl_RegisterChannel(tls, interp, (*IncrblobChannel)(unsafe.Pointer(p)).Fchannel) @@ -35925,8 +37175,8 @@ func DbBusyHandler(tls *libc.TLS, cd uintptr, nTries int32) int32 { /* tclsqlite var rc int32 // var zVal [30]int8 at bp+40, 30 - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+40 /* &zVal[0] */, ts+1237 /* "%d" */, libc.VaList(bp, nTries)) - rc = tcl.XTcl_VarEval(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, libc.VaList(bp+8, (*SqliteDb)(unsafe.Pointer(pDb)).FzBusy, ts+4585 /* " " */, bp+40 /* &zVal[0] */, uintptr(0))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+40 /* &zVal[0] */, ts+1238 /* "%d" */, libc.VaList(bp, nTries)) + rc = tcl.XTcl_VarEval(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, libc.VaList(bp+8, (*SqliteDb)(unsafe.Pointer(pDb)).FzBusy, ts+4765 /* " " */, bp+40 /* &zVal[0] */, uintptr(0))) if (rc != TCL_OK) || (libc.Xatoi(tls, tcl.XTcl_GetStringResult(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp)) != 0) { return 0 } @@ -35971,7 +37221,7 @@ func DbTraceV2Handler(tls *libc.TLS, type1 uint32, cd uintptr, pd uintptr, xd ui var pCmd uintptr switch type1 { - case SQLITE_TRACE_STMT: + case uint32(SQLITE_TRACE_STMT): { var pStmt uintptr = pd var zSql uintptr = xd @@ -35993,7 +37243,7 @@ func DbTraceV2Handler(tls *libc.TLS, type1 uint32, cd uintptr, pd uintptr, xd ui break } - case SQLITE_TRACE_PROFILE: + case uint32(SQLITE_TRACE_PROFILE): { var pStmt uintptr = pd var ns sqlite3_int64 = *(*sqlite3_int64)(unsafe.Pointer(xd)) @@ -36015,7 +37265,7 @@ func DbTraceV2Handler(tls *libc.TLS, type1 uint32, cd uintptr, pd uintptr, xd ui break } - case SQLITE_TRACE_ROW: + case uint32(SQLITE_TRACE_ROW): { var pStmt uintptr = pd @@ -36034,7 +37284,7 @@ func DbTraceV2Handler(tls *libc.TLS, type1 uint32, cd uintptr, pd uintptr, xd ui break } - case SQLITE_TRACE_CLOSE: + case uint32(SQLITE_TRACE_CLOSE): { var db uintptr = pd @@ -36068,7 +37318,7 @@ func DbProfileHandler(tls *libc.TLS, cd uintptr, zSql uintptr, tm1 sqlite_uint64 // var zTm [100]int8 at bp+8, 100 - sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof([100]int8{})) - uint64(1))), bp+8 /* &zTm[0] */, ts+10367 /* "%lld" */, libc.VaList(bp, tm1)) + sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof([100]int8{})) - uint64(1))), bp+8 /* &zTm[0] */, ts+10547 /* "%lld" */, libc.VaList(bp, tm1)) tcl.XTcl_DStringInit(tls, bp+112 /* &str */) tcl.XTcl_DStringAppend(tls, bp+112 /* &str */, (*SqliteDb)(unsafe.Pointer(pDb)).FzProfile, -1) tcl.XTcl_DStringAppendElement(tls, bp+112 /* &str */, zSql) @@ -36135,10 +37385,10 @@ func setTestUnlockNotifyVars(tls *libc.TLS, interp uintptr, iArg int32, nArg int // var zBuf [64]int8 at bp+16, 64 - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+16 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp, iArg)) - tcl.XTcl_SetVar2(tls, interp, ts+10372 /* "sqlite_unlock_no..." */, uintptr(0), bp+16 /* &zBuf[0] */, TCL_GLOBAL_ONLY) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+16 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+8, nArg)) - tcl.XTcl_SetVar2(tls, interp, ts+10397 /* "sqlite_unlock_no..." */, uintptr(0), bp+16 /* &zBuf[0] */, TCL_GLOBAL_ONLY) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+16 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp, iArg)) + tcl.XTcl_SetVar2(tls, interp, ts+10552 /* "sqlite_unlock_no..." */, uintptr(0), bp+16 /* &zBuf[0] */, TCL_GLOBAL_ONLY) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+16 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+8, nArg)) + tcl.XTcl_SetVar2(tls, interp, ts+10577 /* "sqlite_unlock_no..." */, uintptr(0), bp+16 /* &zBuf[0] */, TCL_GLOBAL_ONLY) } func DbUnlockNotify(tls *libc.TLS, apArg uintptr, nArg int32) { /* tclsqlite.c:799:13: */ @@ -36180,7 +37430,7 @@ func DbPreUpdateHandler(tls *libc.TLS, p uintptr, db uintptr, op int32, zDb uint } } -var azStr = [3]uintptr{ts + 10427 /* "DELETE" */, ts + 10434 /* "INSERT" */, ts + 10441 /* "UPDATE" */} /* tclsqlite.c:828:21 */ +var azStr = [3]uintptr{ts + 10607 /* "DELETE" */, ts + 10614 /* "INSERT" */, ts + 10621 /* "UPDATE" */} /* tclsqlite.c:828:21 */ func DbUpdateHandler(tls *libc.TLS, p uintptr, op int32, zDb uintptr, zTbl uintptr, rowid sqlite_int64) { /* tclsqlite.c:849:13: */ var pDb uintptr = p @@ -36201,7 +37451,7 @@ func DbUpdateHandler(tls *libc.TLS, p uintptr, op int32, zDb uintptr, zTbl uintp } } -var azStr1 = [3]uintptr{ts + 10427 /* "DELETE" */, ts + 10434 /* "INSERT" */, ts + 10441 /* "UPDATE" */} /* tclsqlite.c:858:21 */ +var azStr1 = [3]uintptr{ts + 10607 /* "DELETE" */, ts + 10614 /* "INSERT" */, ts + 10621 /* "UPDATE" */} /* tclsqlite.c:858:21 */ func tclCollateNeeded(tls *libc.TLS, pCtx uintptr, db uintptr, enc int32, zName uintptr) { /* tclsqlite.c:877:13: */ var pDb uintptr = pCtx @@ -36368,21 +37618,21 @@ func tclSqlFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* t if (*Tcl_Obj)(unsafe.Pointer(pVar)).FtypePtr != 0 { return (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pVar)).FtypePtr)).Fname } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }() var c int8 = *(*int8)(unsafe.Pointer(zType)) var eType int32 = (*SqlFunc)(unsafe.Pointer(p)).FeType if eType == SQLITE_NULL { - if ((int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2404 /* "bytearray" */) == 0)) && ((*Tcl_Obj)(unsafe.Pointer(pVar)).Fbytes == uintptr(0)) { + if ((int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2405 /* "bytearray" */) == 0)) && ((*Tcl_Obj)(unsafe.Pointer(pVar)).Fbytes == uintptr(0)) { // Only return a BLOB type if the Tcl variable is a bytearray and // has no string representation. eType = SQLITE_BLOB - } else if (((int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2414 /* "boolean" */) == 0)) || - ((int32(c) == 'w') && (libc.Xstrcmp(tls, zType, ts+2429 /* "wideInt" */) == 0))) || - ((int32(c) == 'i') && (libc.Xstrcmp(tls, zType, ts+2437 /* "int" */) == 0)) { + } else if (((int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2415 /* "boolean" */) == 0)) || + ((int32(c) == 'w') && (libc.Xstrcmp(tls, zType, ts+2430 /* "wideInt" */) == 0))) || + ((int32(c) == 'i') && (libc.Xstrcmp(tls, zType, ts+2438 /* "int" */) == 0)) { eType = SQLITE_INTEGER - } else if (int32(c) == 'd') && (libc.Xstrcmp(tls, zType, ts+2422 /* "double" */) == 0) { + } else if (int32(c) == 'd') && (libc.Xstrcmp(tls, zType, ts+2423 /* "double" */) == 0) { eType = SQLITE_FLOAT } else { eType = SQLITE_TEXT @@ -36460,109 +37710,109 @@ func auth_callback(tls *libc.TLS, pArg uintptr, code int32, zArg1 uintptr, zArg2 // authorized. switch code { case SQLITE_COPY: - zCode = ts + 10448 /* "SQLITE_COPY" */ + zCode = ts + 10628 /* "SQLITE_COPY" */ break case SQLITE_CREATE_INDEX: - zCode = ts + 10460 /* "SQLITE_CREATE_IN..." */ + zCode = ts + 10640 /* "SQLITE_CREATE_IN..." */ break case SQLITE_CREATE_TABLE: - zCode = ts + 10480 /* "SQLITE_CREATE_TA..." */ + zCode = ts + 10660 /* "SQLITE_CREATE_TA..." */ break case SQLITE_CREATE_TEMP_INDEX: - zCode = ts + 10500 /* "SQLITE_CREATE_TE..." */ + zCode = ts + 10680 /* "SQLITE_CREATE_TE..." */ break case SQLITE_CREATE_TEMP_TABLE: - zCode = ts + 10525 /* "SQLITE_CREATE_TE..." */ + zCode = ts + 10705 /* "SQLITE_CREATE_TE..." */ break case SQLITE_CREATE_TEMP_TRIGGER: - zCode = ts + 10550 /* "SQLITE_CREATE_TE..." */ + zCode = ts + 10730 /* "SQLITE_CREATE_TE..." */ break case SQLITE_CREATE_TEMP_VIEW: - zCode = ts + 10577 /* "SQLITE_CREATE_TE..." */ + zCode = ts + 10757 /* "SQLITE_CREATE_TE..." */ break case SQLITE_CREATE_TRIGGER: - zCode = ts + 10601 /* "SQLITE_CREATE_TR..." */ + zCode = ts + 10781 /* "SQLITE_CREATE_TR..." */ break case SQLITE_CREATE_VIEW: - zCode = ts + 10623 /* "SQLITE_CREATE_VI..." */ + zCode = ts + 10803 /* "SQLITE_CREATE_VI..." */ break case SQLITE_DELETE: - zCode = ts + 10642 /* "SQLITE_DELETE" */ + zCode = ts + 10822 /* "SQLITE_DELETE" */ break case SQLITE_DROP_INDEX: - zCode = ts + 10656 /* "SQLITE_DROP_INDE..." */ + zCode = ts + 10836 /* "SQLITE_DROP_INDE..." */ break case SQLITE_DROP_TABLE: - zCode = ts + 10674 /* "SQLITE_DROP_TABL..." */ + zCode = ts + 10854 /* "SQLITE_DROP_TABL..." */ break case SQLITE_DROP_TEMP_INDEX: - zCode = ts + 10692 /* "SQLITE_DROP_TEMP..." */ + zCode = ts + 10872 /* "SQLITE_DROP_TEMP..." */ break case SQLITE_DROP_TEMP_TABLE: - zCode = ts + 10715 /* "SQLITE_DROP_TEMP..." */ + zCode = ts + 10895 /* "SQLITE_DROP_TEMP..." */ break case SQLITE_DROP_TEMP_TRIGGER: - zCode = ts + 10738 /* "SQLITE_DROP_TEMP..." */ + zCode = ts + 10918 /* "SQLITE_DROP_TEMP..." */ break case SQLITE_DROP_TEMP_VIEW: - zCode = ts + 10763 /* "SQLITE_DROP_TEMP..." */ + zCode = ts + 10943 /* "SQLITE_DROP_TEMP..." */ break case SQLITE_DROP_TRIGGER: - zCode = ts + 10785 /* "SQLITE_DROP_TRIG..." */ + zCode = ts + 10965 /* "SQLITE_DROP_TRIG..." */ break case SQLITE_DROP_VIEW: - zCode = ts + 10805 /* "SQLITE_DROP_VIEW" */ + zCode = ts + 10985 /* "SQLITE_DROP_VIEW" */ break case SQLITE_INSERT: - zCode = ts + 10822 /* "SQLITE_INSERT" */ + zCode = ts + 11002 /* "SQLITE_INSERT" */ break case SQLITE_PRAGMA: - zCode = ts + 10836 /* "SQLITE_PRAGMA" */ + zCode = ts + 11016 /* "SQLITE_PRAGMA" */ break case SQLITE_READ: - zCode = ts + 10850 /* "SQLITE_READ" */ + zCode = ts + 11030 /* "SQLITE_READ" */ break case SQLITE_SELECT: - zCode = ts + 10862 /* "SQLITE_SELECT" */ + zCode = ts + 11042 /* "SQLITE_SELECT" */ break case SQLITE_TRANSACTION: - zCode = ts + 10876 /* "SQLITE_TRANSACTI..." */ + zCode = ts + 11056 /* "SQLITE_TRANSACTI..." */ break case SQLITE_UPDATE: - zCode = ts + 10895 /* "SQLITE_UPDATE" */ + zCode = ts + 11075 /* "SQLITE_UPDATE" */ break case SQLITE_ATTACH: - zCode = ts + 10909 /* "SQLITE_ATTACH" */ + zCode = ts + 11089 /* "SQLITE_ATTACH" */ break case SQLITE_DETACH: - zCode = ts + 10923 /* "SQLITE_DETACH" */ + zCode = ts + 11103 /* "SQLITE_DETACH" */ break case SQLITE_ALTER_TABLE: - zCode = ts + 10937 /* "SQLITE_ALTER_TAB..." */ + zCode = ts + 11117 /* "SQLITE_ALTER_TAB..." */ break case SQLITE_REINDEX: - zCode = ts + 10956 /* "SQLITE_REINDEX" */ + zCode = ts + 11136 /* "SQLITE_REINDEX" */ break case SQLITE_ANALYZE: - zCode = ts + 10971 /* "SQLITE_ANALYZE" */ + zCode = ts + 11151 /* "SQLITE_ANALYZE" */ break case SQLITE_CREATE_VTABLE: - zCode = ts + 10986 /* "SQLITE_CREATE_VT..." */ + zCode = ts + 11166 /* "SQLITE_CREATE_VT..." */ break case SQLITE_DROP_VTABLE: - zCode = ts + 11007 /* "SQLITE_DROP_VTAB..." */ + zCode = ts + 11187 /* "SQLITE_DROP_VTAB..." */ break case SQLITE_FUNCTION: - zCode = ts + 11026 /* "SQLITE_FUNCTION" */ + zCode = ts + 11206 /* "SQLITE_FUNCTION" */ break case SQLITE_SAVEPOINT: - zCode = ts + 11042 /* "SQLITE_SAVEPOINT" */ + zCode = ts + 11222 /* "SQLITE_SAVEPOINT" */ break case SQLITE_RECURSIVE: - zCode = ts + 11059 /* "SQLITE_RECURSIVE" */ + zCode = ts + 11239 /* "SQLITE_RECURSIVE" */ break default: - zCode = ts + 11076 /* "????" */ + zCode = ts + 11256 /* "????" */ break } tcl.XTcl_DStringInit(tls, bp /* &str */) @@ -36572,38 +37822,38 @@ func auth_callback(tls *libc.TLS, pArg uintptr, code int32, zArg1 uintptr, zArg2 if zArg1 != 0 { return zArg1 } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }()) tcl.XTcl_DStringAppendElement(tls, bp /* &str */, func() uintptr { if zArg2 != 0 { return zArg2 } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }()) tcl.XTcl_DStringAppendElement(tls, bp /* &str */, func() uintptr { if zArg3 != 0 { return zArg3 } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }()) tcl.XTcl_DStringAppendElement(tls, bp /* &str */, func() uintptr { if zArg4 != 0 { return zArg4 } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }()) rc = tcl.XTcl_GlobalEval(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, (*Tcl_DString)(unsafe.Pointer(bp /* &str */)).Fstring) tcl.XTcl_DStringFree(tls, bp /* &str */) if rc == TCL_OK { zReply = tcl.XTcl_GetStringResult(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp) } else { - zReply = ts + 11081 /* "SQLITE_DENY" */ + zReply = ts + 11261 /* "SQLITE_DENY" */ } - if libc.Xstrcmp(tls, zReply, ts+1987 /* "SQLITE_OK" */) == 0 { + if libc.Xstrcmp(tls, zReply, ts+1988 /* "SQLITE_OK" */) == 0 { rc = SQLITE_OK - } else if libc.Xstrcmp(tls, zReply, ts+11081 /* "SQLITE_DENY" */) == 0 { + } else if libc.Xstrcmp(tls, zReply, ts+11261 /* "SQLITE_DENY" */) == 0 { rc = SQLITE_DENY - } else if libc.Xstrcmp(tls, zReply, ts+11093 /* "SQLITE_IGNORE" */) == 0 { + } else if libc.Xstrcmp(tls, zReply, ts+11273 /* "SQLITE_IGNORE" */) == 0 { rc = SQLITE_IGNORE } else { rc = 999 @@ -36692,7 +37942,7 @@ func DbTransPostCmd(tls *libc.TLS, data uintptr, interp uintptr, result int32) i tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0))) rc = TCL_ERROR } - sqlite3.Xsqlite3_exec(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, ts+7092 /* "ROLLBACK" */, uintptr(0), uintptr(0), uintptr(0)) + sqlite3.Xsqlite3_exec(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, ts+7272 /* "ROLLBACK" */, uintptr(0), uintptr(0), uintptr(0)) } (*SqliteDb)(unsafe.Pointer(pDb)).FdisableAuth-- @@ -36700,10 +37950,10 @@ func DbTransPostCmd(tls *libc.TLS, data uintptr, interp uintptr, result int32) i } var azEnd = [4]uintptr{ - ts + 11107, /* "RELEASE _tcl_tra..." */ // rc==TCL_ERROR, nTransaction!=0 - ts + 11132, /* "COMMIT" */ // rc!=TCL_ERROR, nTransaction==0 - ts + 11139, /* "ROLLBACK TO _tcl..." */ - ts + 7092, /* "ROLLBACK" */ // rc==TCL_ERROR, nTransaction==0 + ts + 11287, /* "RELEASE _tcl_tra..." */ // rc==TCL_ERROR, nTransaction!=0 + ts + 11312, /* "COMMIT" */ // rc!=TCL_ERROR, nTransaction==0 + ts + 11319, /* "ROLLBACK TO _tcl..." */ + ts + 7272, /* "ROLLBACK" */ // rc==TCL_ERROR, nTransaction==0 } /* tclsqlite.c:1216:21 */ // Unless SQLITE_TEST is defined, this function is a simple wrapper around @@ -36720,7 +37970,7 @@ func dbPrepare(tls *libc.TLS, pDb uintptr, zSql uintptr, ppStmt uintptr, pzOut u // flags, which uses less lookaside memory. But if the cache is small, // omit that flag to make full use of lookaside if (*SqliteDb)(unsafe.Pointer(pDb)).FmaxStmt > 5 { - prepFlags = SQLITE_PREPARE_PERSISTENT + prepFlags = uint32(SQLITE_PREPARE_PERSISTENT) } return sqlite3.Xsqlite3_prepare_v3(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zSql, -1, prepFlags, ppStmt, pzOut) @@ -36867,10 +38117,10 @@ func dbPrepareAndBind(tls *libc.TLS, pDb uintptr, zIn uintptr, pzOut uintptr, pp if (*Tcl_Obj)(unsafe.Pointer(pVar)).FtypePtr != 0 { return (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pVar)).FtypePtr)).Fname } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }() c = *(*int8)(unsafe.Pointer(zType)) - if (int32(*(*int8)(unsafe.Pointer(zVar))) == '@') || (((int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2404 /* "bytearray" */) == 0)) && ((*Tcl_Obj)(unsafe.Pointer(pVar)).Fbytes == uintptr(0))) { + if (int32(*(*int8)(unsafe.Pointer(zVar))) == '@') || (((int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2405 /* "bytearray" */) == 0)) && ((*Tcl_Obj)(unsafe.Pointer(pVar)).Fbytes == uintptr(0))) { // Load a BLOB type if the Tcl variable is a bytearray and // it has no string representation or the host // parameter name begins with "@". @@ -36878,15 +38128,15 @@ func dbPrepareAndBind(tls *libc.TLS, pDb uintptr, zIn uintptr, pzOut uintptr, pp sqlite3.Xsqlite3_bind_blob(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), i, data, *(*int32)(unsafe.Pointer(bp + 8 /* n */)), uintptr(0)) (*Tcl_Obj)(unsafe.Pointer(pVar)).FrefCount++ *(*uintptr)(unsafe.Pointer((*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FapParm + uintptr(libc.PostIncInt32(&iParm, 1))*8)) = pVar - } else if (int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2414 /* "boolean" */) == 0) { + } else if (int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2415 /* "boolean" */) == 0) { tcl.XTcl_GetIntFromObj(tls, interp, pVar, bp+8 /* &n */) sqlite3.Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), i, *(*int32)(unsafe.Pointer(bp + 8 /* n */))) - } else if (int32(c) == 'd') && (libc.Xstrcmp(tls, zType, ts+2422 /* "double" */) == 0) { + } else if (int32(c) == 'd') && (libc.Xstrcmp(tls, zType, ts+2423 /* "double" */) == 0) { // var r float64 at bp+16, 8 tcl.XTcl_GetDoubleFromObj(tls, interp, pVar, bp+16 /* &r */) sqlite3.Xsqlite3_bind_double(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), i, *(*float64)(unsafe.Pointer(bp + 16 /* r */))) - } else if ((int32(c) == 'w') && (libc.Xstrcmp(tls, zType, ts+2429 /* "wideInt" */) == 0)) || ((int32(c) == 'i') && (libc.Xstrcmp(tls, zType, ts+2437 /* "int" */) == 0)) { + } else if ((int32(c) == 'w') && (libc.Xstrcmp(tls, zType, ts+2430 /* "wideInt" */) == 0)) || ((int32(c) == 'i') && (libc.Xstrcmp(tls, zType, ts+2438 /* "int" */) == 0)) { // var v Tcl_WideInt at bp+24, 8 tcl.XTcl_GetWideIntFromObj(tls, interp, pVar, bp+24 /* &v */) @@ -37060,7 +38310,7 @@ func dbEvalRowInfo(tls *libc.TLS, p uintptr, pnCol uintptr, papColName uintptr) if (*DbEvalContext)(unsafe.Pointer(p)).FpArray != 0 { var interp uintptr = (*SqliteDb)(unsafe.Pointer((*DbEvalContext)(unsafe.Pointer(p)).FpDb)).Finterp var pColList uintptr = tcl.XTcl_NewObj(tls) - var pStar uintptr = tcl.XTcl_NewStringObj(tls, ts+3654 /* "*" */, -1) + var pStar uintptr = tcl.XTcl_NewStringObj(tls, ts+3711 /* "*" */, -1) for i = 0; i < nCol; i++ { tcl.XTcl_ListObjAppendElement(tls, interp, pColList, *(*uintptr)(unsafe.Pointer(apColName + uintptr(i)*8))) @@ -37587,11 +38837,11 @@ func DbObjCmd(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv uintpt if !(objc < 2) { goto __1 } - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1859 /* "SUBCOMMAND ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1860 /* "SUBCOMMAND ..." */) return TCL_ERROR __1: ; - if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&DB_strs)), int32(unsafe.Sizeof(uintptr(0))), ts+11195 /* "option" */, 0, bp+1016 /* &choice */) != 0) { + if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&DB_strs)), int32(unsafe.Sizeof(uintptr(0))), ts+11375 /* "option" */, 0, bp+1016 /* &choice */) != 0) { goto __2 } return TCL_ERROR @@ -37949,7 +39199,7 @@ __4: if !(objc > 3) { goto __45 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11202 /* "?CALLBACK?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11382 /* "?CALLBACK?" */) return TCL_ERROR goto __46 __45: @@ -38009,7 +39259,7 @@ __5: if !(objc == 3) { goto __55 } - zSrcDb = ts + 84 /* "main" */ + zSrcDb = ts + 85 /* "main" */ zDestFile = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) goto __56 __55: @@ -38020,7 +39270,7 @@ __55: zDestFile = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8))) goto __58 __57: - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11213 /* "?DATABASE? FILEN..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11393 /* "?DATABASE? FILEN..." */) return TCL_ERROR __58: ; @@ -38031,17 +39281,17 @@ __56: if !(rc != SQLITE_OK) { goto __59 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+11233, /* "cannot open targ..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+11413, /* "cannot open targ..." */ sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 1024 /* pDest */))), uintptr(0))) sqlite3.Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 1024 /* pDest */))) return TCL_ERROR __59: ; - pBackup = sqlite3.Xsqlite3_backup_init(tls, *(*uintptr)(unsafe.Pointer(bp + 1024 /* pDest */)), ts+84 /* "main" */, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zSrcDb) + pBackup = sqlite3.Xsqlite3_backup_init(tls, *(*uintptr)(unsafe.Pointer(bp + 1024 /* pDest */)), ts+85 /* "main" */, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zSrcDb) if !(pBackup == uintptr(0)) { goto __60 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, ts+11263, /* "backup failed: " */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, ts+11443, /* "backup failed: " */ sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 1024 /* pDest */))), uintptr(0))) sqlite3.Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 1024 /* pDest */))) return TCL_ERROR @@ -38061,7 +39311,7 @@ __62: rc = TCL_OK goto __64 __63: - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, ts+11263, /* "backup failed: " */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, ts+11443, /* "backup failed: " */ sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 1024 /* pDest */))), uintptr(0))) rc = TCL_ERROR __64: @@ -38090,7 +39340,7 @@ __6: if !(objc > 3) { goto __65 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11202 /* "?CALLBACK?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11382 /* "?CALLBACK?" */) return TCL_ERROR goto __66 __65: @@ -38136,7 +39386,7 @@ __7: if !(objc > 3) { goto __73 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11279 /* "CALLBACK" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11459 /* "CALLBACK" */) return TCL_ERROR goto __74 __73: @@ -38196,18 +39446,18 @@ __8: if !(objc <= 2) { goto __83 } - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+11288 /* "cache option ?ar..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+11468 /* "cache option ?ar..." */) return TCL_ERROR __83: ; subCmd = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(0)) - if !((int32(*(*int8)(unsafe.Pointer(subCmd))) == 'f') && (libc.Xstrcmp(tls, subCmd, ts+11307 /* "flush" */) == 0)) { + if !((int32(*(*int8)(unsafe.Pointer(subCmd))) == 'f') && (libc.Xstrcmp(tls, subCmd, ts+11487 /* "flush" */) == 0)) { goto __84 } if !(objc != 3) { goto __86 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11307 /* "flush" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11487 /* "flush" */) return TCL_ERROR goto __87 __86: @@ -38216,21 +39466,21 @@ __87: ; goto __85 __84: - if !((int32(*(*int8)(unsafe.Pointer(subCmd))) == 's') && (libc.Xstrcmp(tls, subCmd, ts+11313 /* "size" */) == 0)) { + if !((int32(*(*int8)(unsafe.Pointer(subCmd))) == 's') && (libc.Xstrcmp(tls, subCmd, ts+11493 /* "size" */) == 0)) { goto __88 } if !(objc != 4) { goto __90 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11318 /* "size n" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11498 /* "size n" */) return TCL_ERROR goto __91 __90: if !(TCL_ERROR == tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+1040 /* &n */)) { goto __92 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+120, ts+11325, /* "cannot convert \"" */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)), uintptr(0)), ts+11342 /* "\" to integer" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+120, ts+11505, /* "cannot convert \"" */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)), uintptr(0)), ts+11522 /* "\" to integer" */, uintptr(0))) return TCL_ERROR goto __93 __92: @@ -38256,8 +39506,8 @@ __91: ; goto __89 __88: - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+152, ts+11355, /* "bad option \"" */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(0)), ts+11368, /* "\": must be flush..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+152, ts+11535, /* "bad option \"" */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(0)), ts+11548, /* "\": must be flush..." */ uintptr(0))) return TCL_ERROR __89: @@ -38275,7 +39525,7 @@ __9: if !(objc != 2) { goto __97 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+489 /* "" */) return TCL_ERROR __97: ; @@ -38298,7 +39548,7 @@ __11: if !(objc != 4) { goto __98 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11393 /* "NAME SCRIPT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11573 /* "NAME SCRIPT" */) return TCL_ERROR __98: ; @@ -38336,7 +39586,7 @@ __12: if !(objc != 3) { goto __101 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11405 /* "SCRIPT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11585 /* "SCRIPT" */) return TCL_ERROR __101: ; @@ -38378,7 +39628,7 @@ __13: if !(objc > 3) { goto __107 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11202 /* "?CALLBACK?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11382 /* "?CALLBACK?" */) return TCL_ERROR goto __108 __107: @@ -38437,7 +39687,7 @@ __14: if !(objc != 3) { goto __117 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9992 /* "SQL" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+10172 /* "SQL" */) return TCL_ERROR __117: ; @@ -38454,7 +39704,7 @@ __15: if !(objc > 4) { goto __118 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11412 /* "?OPTION? ?BOOLEA..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11592 /* "?OPTION? ?BOOLEA..." */) return TCL_ERROR __118: ; @@ -38514,8 +39764,8 @@ __127: if !(uint64(ii) >= (uint64(unsafe.Sizeof(aDbConfig)) / uint64(unsafe.Sizeof(DbConfigChoices{})))) { goto __129 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+216, ts+11431 /* "unknown config o..." */, zOpt, - ts+11456 /* "\"" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+216, ts+11611 /* "unknown config o..." */, zOpt, + ts+11636 /* "\"" */, uintptr(0))) return TCL_ERROR __129: ; @@ -38559,7 +39809,7 @@ __16: // The input file goto __132 } tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, - ts+11458 /* "CONFLICT-ALGORIT..." */) + ts+11638 /* "CONFLICT-ALGORIT..." */) return TCL_ERROR __132: ; @@ -38569,7 +39819,7 @@ __132: zSep = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 5*8)), uintptr(0)) goto __134 __133: - zSep = ts + 11520 /* "\t" */ + zSep = ts + 11700 /* "\t" */ __134: ; if !(objc >= 7) { @@ -38578,7 +39828,7 @@ __134: zNull = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 6*8)), uintptr(0)) goto __136 __135: - zNull = ts + 488 /* "" */ + zNull = ts + 489 /* "" */ __136: ; zConflict = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(0)) @@ -38589,25 +39839,25 @@ __136: if !(nSep == 0) { goto __137 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+264, ts+11522, /* "Error: non-null ..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+264, ts+11702, /* "Error: non-null ..." */ uintptr(0))) return TCL_ERROR __137: ; - if !(((((libc.Xstrcmp(tls, zConflict, ts+11566 /* "rollback" */) != 0) && (libc.Xstrcmp(tls, zConflict, ts+11575 /* "abort" */) != 0)) && (libc.Xstrcmp(tls, zConflict, ts+11581 /* "fail" */) != 0)) && (libc.Xstrcmp(tls, zConflict, ts+11586 /* "ignore" */) != 0)) && (libc.Xstrcmp(tls, zConflict, ts+11593 /* "replace" */) != 0)) { + if !(((((libc.Xstrcmp(tls, zConflict, ts+11746 /* "rollback" */) != 0) && (libc.Xstrcmp(tls, zConflict, ts+11755 /* "abort" */) != 0)) && (libc.Xstrcmp(tls, zConflict, ts+11761 /* "fail" */) != 0)) && (libc.Xstrcmp(tls, zConflict, ts+11766 /* "ignore" */) != 0)) && (libc.Xstrcmp(tls, zConflict, ts+11773 /* "replace" */) != 0)) { goto __138 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+280, ts+11601 /* "Error: \"" */, zConflict, + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+280, ts+11781 /* "Error: \"" */, zConflict, - ts+11610 /* "\", conflict-algo..." */, uintptr(0))) + ts+11790 /* "\", conflict-algo..." */, uintptr(0))) return TCL_ERROR __138: ; - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+11690 /* "SELECT * FROM '%..." */, libc.VaList(bp+312, zTable)) + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+11870 /* "SELECT * FROM '%..." */, libc.VaList(bp+312, zTable)) if !(zSql == uintptr(0)) { goto __139 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+320, ts+11709 /* "Error: no such t..." */, zTable, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+320, ts+11889 /* "Error: no such t..." */, zTable, uintptr(0))) return TCL_ERROR __139: ; @@ -38617,7 +39867,7 @@ __139: if !(rc != 0) { goto __140 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+344, ts+11732 /* "Error: " */, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+344, ts+11912 /* "Error: " */, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0))) nCol = 0 goto __141 __140: @@ -38635,11 +39885,11 @@ __142: if !(zSql == uintptr(0)) { goto __143 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+368, ts+11740 /* "Error: can't mal..." */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+368, ts+11920 /* "Error: can't mal..." */, uintptr(0))) return TCL_ERROR __143: ; - sqlite3.Xsqlite3_snprintf(tls, (nByte + 50), zSql, ts+11762, /* "INSERT OR %q INT..." */ + sqlite3.Xsqlite3_snprintf(tls, (nByte + 50), zSql, ts+11942, /* "INSERT OR %q INT..." */ libc.VaList(bp+384, zConflict, zTable)) j = strlen30(tls, zSql) i = 1 @@ -38663,16 +39913,16 @@ __146: if !(rc != 0) { goto __147 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+400, ts+11732 /* "Error: " */, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+400, ts+11912 /* "Error: " */, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0))) sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 1064 /* pStmt */))) return TCL_ERROR __147: ; - in = libc.Xfopen(tls, zFile, ts+4086 /* "rb" */) + in = libc.Xfopen(tls, zFile, ts+4273 /* "rb" */) if !(in == uintptr(0)) { goto __148 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+424, ts+11794 /* "Error: cannot op..." */, zFile, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+424, ts+11974 /* "Error: cannot op..." */, zFile, uintptr(0))) sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 1064 /* pStmt */))) return TCL_ERROR __148: @@ -38681,13 +39931,13 @@ __148: if !(azCol == uintptr(0)) { goto __149 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+448, ts+11740 /* "Error: can't mal..." */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+448, ts+11920 /* "Error: can't mal..." */, uintptr(0))) libc.Xfclose(tls, in) return TCL_ERROR __149: ; - sqlite3.Xsqlite3_exec(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, ts+11820 /* "BEGIN" */, uintptr(0), uintptr(0), uintptr(0)) - zCommit1 = ts + 11132 /* "COMMIT" */ + sqlite3.Xsqlite3_exec(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, ts+12000 /* "BEGIN" */, uintptr(0), uintptr(0), uintptr(0)) + zCommit1 = ts + 11312 /* "COMMIT" */ __150: if !((libc.AssignUintptr(&zLine, local_getline(tls, uintptr(0), in))) != uintptr(0)) { goto __151 @@ -38730,13 +39980,13 @@ __154: goto __158 } sqlite3.Xsqlite3_snprintf(tls, nErr, zErr, - ts+11826, /* "Error: %s line %..." */ + ts+12006, /* "Error: %s line %..." */ libc.VaList(bp+464, zFile, lineno, nCol, (i+1))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+496, zErr, uintptr(0))) libc.Xfree(tls, zErr) __158: ; - zCommit1 = ts + 7092 /* "ROLLBACK" */ + zCommit1 = ts + 7272 /* "ROLLBACK" */ goto __151 __157: ; @@ -38769,8 +40019,8 @@ __161: if !(rc != SQLITE_OK) { goto __164 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+512, ts+11732 /* "Error: " */, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0))) - zCommit1 = ts + 7092 /* "ROLLBACK" */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+512, ts+11912 /* "Error: " */, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0))) + zCommit1 = ts + 7272 /* "ROLLBACK" */ goto __151 __164: ; @@ -38792,8 +40042,8 @@ __151: goto __166 __165: // failure, append lineno where failed - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([80]int8{})), bp+1072 /* &zLineNum[0] */, ts+1237 /* "%d" */, libc.VaList(bp+536, lineno)) - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+544, ts+11886 /* ", failed while p..." */, bp+1072, /* &zLineNum[0] */ + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([80]int8{})), bp+1072 /* &zLineNum[0] */, ts+1238 /* "%d" */, libc.VaList(bp+536, lineno)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+544, ts+12066 /* ", failed while p..." */, bp+1072, /* &zLineNum[0] */ uintptr(0))) rc = TCL_ERROR __166: @@ -38812,7 +40062,7 @@ __17: if !(objc < 3) { goto __167 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11919 /* "?DATABASE? VALUE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12099 /* "?DATABASE? VALUE" */) rc = TCL_ERROR goto __3 __167: @@ -38823,7 +40073,7 @@ __168: goto __170 } z1 = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8))) - if !((libc.Xstrcmp(tls, z1, ts+11936 /* "-maxsize" */) == 0) && (i1 < (objc - 2))) { + if !((libc.Xstrcmp(tls, z1, ts+12116 /* "-maxsize" */) == 0) && (i1 < (objc - 2))) { goto __171 } rc = tcl.XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PreIncInt32(&i1, 1))*8)), bp+1152 /* &mxSize */) @@ -38836,7 +40086,7 @@ __172: goto __169 __171: ; - if !((libc.Xstrcmp(tls, z1, ts+11945 /* "-readonly" */) == 0) && (i1 < (objc - 2))) { + if !((libc.Xstrcmp(tls, z1, ts+12125 /* "-readonly" */) == 0) && (i1 < (objc - 2))) { goto __173 } rc = tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PreIncInt32(&i1, 1))*8)), bp+1160 /* &isReadonly */) @@ -38856,7 +40106,7 @@ __173: goto __169 __175: ; - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+568, ts+11955 /* "unknown option: " */, z1, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+568, ts+12135 /* "unknown option: " */, z1, uintptr(0))) rc = TCL_ERROR goto deserialize_error goto __169 @@ -38872,7 +40122,7 @@ __170: if !((pData == uintptr(0)) && (*(*int32)(unsafe.Pointer(bp + 1164 /* len4 */)) > 0)) { goto __176 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+592, ts+1929 /* "out of memory" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+592, ts+1930 /* "out of memory" */, uintptr(0))) rc = TCL_ERROR goto __177 __176: @@ -38895,7 +40145,7 @@ __180: if !(xrc != 0) { goto __181 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+608, ts+11972 /* "unable to set ME..." */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+608, ts+12152 /* "unable to set ME..." */, uintptr(0))) rc = TCL_ERROR __181: ; @@ -38915,7 +40165,7 @@ deserialize_error: // Turn the extension loading feature on or off. It if off by // default. __18: - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+624, ts+12000, /* "extension loadin..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+624, ts+12180, /* "extension loadin..." */ uintptr(0))) return TCL_ERROR @@ -38938,7 +40188,7 @@ __21: if !(objc != 3) { goto __183 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9992 /* "SQL" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+10172 /* "SQL" */) return TCL_ERROR __183: ; @@ -39001,13 +40251,13 @@ __192: if !(((objc > 3) && ((libc.AssignUintptr(&zOpt1, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))))) != uintptr(0))) && (int32(*(*int8)(unsafe.Pointer(zOpt1))) == '-')) { goto __193 } - if !(libc.Xstrcmp(tls, zOpt1, ts+12048 /* "-withoutnulls" */) == 0) { + if !(libc.Xstrcmp(tls, zOpt1, ts+12228 /* "-withoutnulls" */) == 0) { goto __194 } evalFlags = evalFlags | (SQLITE_EVAL_WITHOUTNULLS) goto __195 __194: - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+640, ts+12062 /* "unknown option: ..." */, zOpt1, ts+11456 /* "\"" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+640, ts+12242 /* "unknown option: ..." */, zOpt1, ts+11636 /* "\"" */, uintptr(0))) return TCL_ERROR __195: ; @@ -39020,7 +40270,7 @@ __193: goto __196 } tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, - ts+12080 /* "?OPTIONS? SQL ?A..." */) + ts+12260 /* "?OPTIONS? SQL ?A..." */) return TCL_ERROR __196: ; @@ -39117,7 +40367,7 @@ __23: if !(objc < 4) { goto __210 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12116 /* "NAME ?SWITCHES? ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12296 /* "NAME ?SWITCHES? ..." */) return TCL_ERROR __210: ; @@ -39128,13 +40378,13 @@ __211: } z2 = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i3)*8))) n1 = strlen30(tls, z2) - if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12139 /* "-argcount" */, uint64(n1)) == 0)) { + if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12319 /* "-argcount" */, uint64(n1)) == 0)) { goto __214 } if !(i3 == (objc - 2)) { goto __216 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+672, ts+12149 /* "option requires ..." */, z2, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+672, ts+12329 /* "option requires ..." */, z2, uintptr(0))) return TCL_ERROR __216: ; @@ -39147,7 +40397,7 @@ __217: if !(*(*int32)(unsafe.Pointer(bp + 1304 /* nArg */)) < 0) { goto __218 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+696, ts+12179, /* "number of argume..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+696, ts+12359, /* "number of argume..." */ uintptr(0))) return TCL_ERROR __218: @@ -39155,38 +40405,38 @@ __218: i3++ goto __215 __214: - if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12220 /* "-deterministic" */, uint64(n1)) == 0)) { + if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12400 /* "-deterministic" */, uint64(n1)) == 0)) { goto __219 } flags1 = flags1 | (SQLITE_DETERMINISTIC) goto __220 __219: - if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12235 /* "-directonly" */, uint64(n1)) == 0)) { + if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12415 /* "-directonly" */, uint64(n1)) == 0)) { goto __221 } flags1 = flags1 | (SQLITE_DIRECTONLY) goto __222 __221: - if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12247 /* "-innocuous" */, uint64(n1)) == 0)) { + if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12427 /* "-innocuous" */, uint64(n1)) == 0)) { goto __223 } flags1 = flags1 | (SQLITE_INNOCUOUS) goto __224 __223: - if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12258 /* "-returntype" */, uint64(n1)) == 0)) { + if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12438 /* "-returntype" */, uint64(n1)) == 0)) { goto __225 } - *(*[6]uintptr)(unsafe.Pointer(bp + 1312 /* azType */)) = [6]uintptr{ts + 7738 /* "integer" */, ts + 12270 /* "real" */, ts + 12275 /* "text" */, ts + 12280 /* "blob" */, ts + 12285 /* "any" */, uintptr(0)} + *(*[6]uintptr)(unsafe.Pointer(bp + 1312 /* azType */)) = [6]uintptr{ts + 7918 /* "integer" */, ts + 12450 /* "real" */, ts + 12455 /* "text" */, ts + 12460 /* "blob" */, ts + 12465 /* "any" */, uintptr(0)} if !(i3 == (objc - 2)) { goto __227 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+712, ts+12149 /* "option requires ..." */, z2, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+712, ts+12329 /* "option requires ..." */, z2, uintptr(0))) return TCL_ERROR __227: ; i3++ - if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i3)*8)), bp+1312 /* &azType[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+12289 /* "type" */, 0, bp+1360 /* &eType */) != 0) { + if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i3)*8)), bp+1312 /* &azType[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+12469 /* "type" */, 0, bp+1360 /* &eType */) != 0) { goto __228 } return TCL_ERROR @@ -39195,9 +40445,9 @@ __228: *(*int32)(unsafe.Pointer(bp + 1360 /* eType */))++ goto __226 __225: - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+736, ts+11355 /* "bad option \"" */, z2, + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+736, ts+11535 /* "bad option \"" */, z2, - ts+12294 /* "\": must be -argc..." */, uintptr(0))) + ts+12474 /* "\": must be -argc..." */, uintptr(0))) return TCL_ERROR __226: ; @@ -39267,10 +40517,10 @@ __235: // $db incrblob ?-readonly? ?DB? TABLE COLUMN ROWID __24: isReadonly1 = 0 - zDb = ts + 84 /* "main" */ + zDb = ts + 85 /* "main" */ // Check for the -readonly option - if !((objc > 3) && (libc.Xstrcmp(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), ts+11945 /* "-readonly" */) == 0)) { + if !((objc > 3) && (libc.Xstrcmp(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), ts+12125 /* "-readonly" */) == 0)) { goto __236 } isReadonly1 = 1 @@ -39280,7 +40530,7 @@ __236: if !((objc != (5 + isReadonly1)) && (objc != (6 + isReadonly1))) { goto __237 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12372 /* "?-readonly? ?DB?..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12552 /* "?-readonly? ?DB?..." */) return TCL_ERROR __237: ; @@ -39322,7 +40572,7 @@ __26: if !((objc != 2) && (objc != 3)) { goto __240 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12408 /* "NULLVALUE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12588 /* "NULLVALUE" */) return TCL_ERROR __240: ; @@ -39359,7 +40609,7 @@ __27: if !(objc != 2) { goto __245 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+489 /* "" */) return TCL_ERROR __245: ; @@ -39427,7 +40677,7 @@ __256: ; goto __250 __249: - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12418 /* "N CALLBACK" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12598 /* "N CALLBACK" */) return TCL_ERROR __250: ; @@ -39444,7 +40694,7 @@ __29: if !(objc > 3) { goto __257 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11202 /* "?CALLBACK?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11382 /* "?CALLBACK?" */) return TCL_ERROR goto __258 __257: @@ -39501,7 +40751,7 @@ __30: if !(objc != 3) { goto __267 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12429 /* "KEY" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12609 /* "KEY" */) return TCL_ERROR __267: ; @@ -39517,7 +40767,7 @@ __31: if !(objc == 3) { goto __268 } - zDestDb = ts + 84 /* "main" */ + zDestDb = ts + 85 /* "main" */ zSrcFile = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) goto __269 __268: @@ -39528,7 +40778,7 @@ __268: zSrcFile = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8))) goto __271 __270: - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11213 /* "?DATABASE? FILEN..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11393 /* "?DATABASE? FILEN..." */) return TCL_ERROR __271: ; @@ -39539,17 +40789,17 @@ __269: if !(rc != SQLITE_OK) { goto __272 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+800, ts+12433, /* "cannot open sour..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+800, ts+12613, /* "cannot open sour..." */ sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 1392 /* pSrc */))), uintptr(0))) sqlite3.Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 1392 /* pSrc */))) return TCL_ERROR __272: ; - pBackup1 = sqlite3.Xsqlite3_backup_init(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zDestDb, *(*uintptr)(unsafe.Pointer(bp + 1392 /* pSrc */)), ts+84 /* "main" */) + pBackup1 = sqlite3.Xsqlite3_backup_init(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zDestDb, *(*uintptr)(unsafe.Pointer(bp + 1392 /* pSrc */)), ts+85 /* "main" */) if !(pBackup1 == uintptr(0)) { goto __273 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+824, ts+12463, /* "restore failed: " */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+824, ts+12643, /* "restore failed: " */ sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0))) sqlite3.Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 1392 /* pSrc */))) return TCL_ERROR @@ -39585,12 +40835,12 @@ __278: if !((rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED)) { goto __280 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+848, ts+12480, /* "restore failed: ..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+848, ts+12660, /* "restore failed: ..." */ uintptr(0))) rc = TCL_ERROR goto __281 __280: - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+864, ts+12463, /* "restore failed: " */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+864, ts+12643, /* "restore failed: " */ sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0))) rc = TCL_ERROR __281: @@ -39607,17 +40857,17 @@ __32: if objc >= 3 { zSchema1 = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) } else { - zSchema1 = ts + 84 /* "main" */ + zSchema1 = ts + 85 /* "main" */ } *(*sqlite3_int64)(unsafe.Pointer(bp + 1400 /* sz */)) = int64(0) if !((objc != 2) && (objc != 3)) { goto __282 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12517 /* "?DATABASE?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12697 /* "?DATABASE?" */) rc = TCL_ERROR goto __283 __282: - pData1 = sqlite3.Xsqlite3_serialize(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zSchema1, bp+1400 /* &sz */, SQLITE_SERIALIZE_NOCOPY) + pData1 = sqlite3.Xsqlite3_serialize(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zSchema1, bp+1400 /* &sz */, uint32(SQLITE_SERIALIZE_NOCOPY)) if !(pData1 != 0) { goto __284 } @@ -39647,37 +40897,37 @@ __33: if !(objc != 3) { goto __287 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12528 /* "(step|sort|autoi..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12708 /* "(step|sort|autoi..." */) return TCL_ERROR __287: ; zOp = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) - if !(libc.Xstrcmp(tls, zOp, ts+9942 /* "step" */) == 0) { + if !(libc.Xstrcmp(tls, zOp, ts+10122 /* "step" */) == 0) { goto __288 } v2 = (*SqliteDb)(unsafe.Pointer(pDb)).FnStep goto __289 __288: - if !(libc.Xstrcmp(tls, zOp, ts+12550 /* "sort" */) == 0) { + if !(libc.Xstrcmp(tls, zOp, ts+12730 /* "sort" */) == 0) { goto __290 } v2 = (*SqliteDb)(unsafe.Pointer(pDb)).FnSort goto __291 __290: - if !(libc.Xstrcmp(tls, zOp, ts+12555 /* "autoindex" */) == 0) { + if !(libc.Xstrcmp(tls, zOp, ts+12735 /* "autoindex" */) == 0) { goto __292 } v2 = (*SqliteDb)(unsafe.Pointer(pDb)).FnIndex goto __293 __292: - if !(libc.Xstrcmp(tls, zOp, ts+12565 /* "vmstep" */) == 0) { + if !(libc.Xstrcmp(tls, zOp, ts+12745 /* "vmstep" */) == 0) { goto __294 } v2 = (*SqliteDb)(unsafe.Pointer(pDb)).FnVMStep goto __295 __294: tcl.XTcl_AppendResult(tls, interp, - libc.VaList(bp+888, ts+12572, /* "bad argument: sh..." */ + libc.VaList(bp+888, ts+12752, /* "bad argument: sh..." */ uintptr(0))) return TCL_ERROR __295: @@ -39698,7 +40948,7 @@ __34: if !(objc != 3) { goto __296 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12628 /* "MILLISECONDS" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12808 /* "MILLISECONDS" */) return TCL_ERROR __296: ; @@ -39719,7 +40969,7 @@ __35: if !(objc != 2) { goto __298 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+489 /* "" */) return TCL_ERROR __298: ; @@ -39736,7 +40986,7 @@ __36: if !(objc > 3) { goto __299 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11202 /* "?CALLBACK?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11382 /* "?CALLBACK?" */) return TCL_ERROR goto __300 __299: @@ -39795,7 +41045,7 @@ __37: if !(objc > 4) { goto __309 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12641 /* "?CALLBACK? ?MASK..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12821 /* "?CALLBACK? ?MASK..." */) return TCL_ERROR goto __310 __309: @@ -39831,7 +41081,7 @@ __317: return TCL_ERROR __320: ; - if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 1424 /* pObj */)), uintptr(unsafe.Pointer(&TTYPE_strs)), int32(unsafe.Sizeof(uintptr(0))), ts+12659 /* "trace type" */, 0, bp+1432 /* &ttype */) != TCL_OK) { + if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 1424 /* pObj */)), uintptr(unsafe.Pointer(&TTYPE_strs)), int32(unsafe.Sizeof(uintptr(0))), ts+12839 /* "trace type" */, 0, bp+1432 /* &ttype */) != TCL_OK) { goto __321 } pError = tcl.XTcl_DuplicateObj(tls, tcl.XTcl_GetObjResult(tls, interp)) @@ -39892,16 +41142,16 @@ __321: } goto __333 __334: - wMask = wMask | (SQLITE_TRACE_STMT) + wMask = wMask | (int64(SQLITE_TRACE_STMT)) goto __333 __335: - wMask = wMask | (SQLITE_TRACE_PROFILE) + wMask = wMask | (int64(SQLITE_TRACE_PROFILE)) goto __333 __336: - wMask = wMask | (SQLITE_TRACE_ROW) + wMask = wMask | (int64(SQLITE_TRACE_ROW)) goto __333 __337: - wMask = wMask | (SQLITE_TRACE_CLOSE) + wMask = wMask | (int64(SQLITE_TRACE_CLOSE)) goto __333 __333: ; @@ -39916,7 +41166,7 @@ __319: ; goto __315 __314: - wMask = SQLITE_TRACE_STMT // use the "legacy" default + wMask = int64(SQLITE_TRACE_STMT) // use the "legacy" default __315: ; if !((*SqliteDb)(unsafe.Pointer(pDb)).FzTraceV2 != 0) { @@ -39965,11 +41215,11 @@ __310: // This command was inspired by Dave Thomas's talk on Ruby at the // 2005 O'Reilly Open Source Convention (OSCON). __38: - zBegin = ts + 12670 /* "SAVEPOINT _tcl_t..." */ + zBegin = ts + 12850 /* "SAVEPOINT _tcl_t..." */ if !((objc != 3) && (objc != 4)) { goto __343 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12697 /* "[TYPE] SCRIPT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12877 /* "[TYPE] SCRIPT" */) return TCL_ERROR __343: ; @@ -39977,7 +41227,7 @@ __343: if !(((*SqliteDb)(unsafe.Pointer(pDb)).FnTransaction == 0) && (objc == 4)) { goto __344 } - if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&TTYPE_strs1)), int32(unsafe.Sizeof(uintptr(0))), ts+12711 /* "transaction type" */, 0, bp+1448 /* &ttype1 */) != 0) { + if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&TTYPE_strs1)), int32(unsafe.Sizeof(uintptr(0))), ts+12891 /* "transaction type" */, 0, bp+1448 /* &ttype1 */) != 0) { goto __345 } return TCL_ERROR @@ -39996,10 +41246,10 @@ __347: /* no-op */ ; goto __346 __348: - zBegin = ts + 12728 /* "BEGIN EXCLUSIVE" */ + zBegin = ts + 12908 /* "BEGIN EXCLUSIVE" */ goto __346 __349: - zBegin = ts + 12744 /* "BEGIN IMMEDIATE" */ + zBegin = ts + 12924 /* "BEGIN IMMEDIATE" */ goto __346 __346: ; @@ -40044,7 +41294,7 @@ __39: if !((objc != 2) && (objc != 3)) { goto __353 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12760 /* "?SCRIPT?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12940 /* "?SCRIPT?" */) rc = TCL_ERROR goto __354 __353: @@ -40106,10 +41356,10 @@ __40: if !(objc < 3) { goto __362 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12769 /* "SUB-COMMAND ?ARG..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12949 /* "SUB-COMMAND ?ARG..." */) __362: ; - if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&azSub)), int32(unsafe.Sizeof(uintptr(0))), ts+1874 /* "sub-command" */, 0, bp+1464 /* &iSub */) != 0) { + if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&azSub)), int32(unsafe.Sizeof(uintptr(0))), ts+1875 /* "sub-command" */, 0, bp+1464 /* &iSub */) != 0) { goto __363 } return TCL_ERROR @@ -40141,7 +41391,7 @@ __366: if !(objc > 4) { goto __370 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12788 /* "hook ?SCRIPT?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12968 /* "hook ?SCRIPT?" */) return TCL_ERROR __370: ; @@ -40157,7 +41407,7 @@ __367: if !(objc != 3) { goto __371 } - tcl.XTcl_WrongNumArgs(tls, interp, 3, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 3, objv, ts+489 /* "" */) return TCL_ERROR __371: ; @@ -40170,7 +41420,7 @@ __369: if !(objc != 4) { goto __372 } - tcl.XTcl_WrongNumArgs(tls, interp, 3, objv, ts+12802 /* "INDEX" */) + tcl.XTcl_WrongNumArgs(tls, interp, 3, objv, ts+12982 /* "INDEX" */) return TCL_ERROR __372: ; @@ -40238,7 +41488,7 @@ __380: if !(objc > 3) { goto __381 } - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12760 /* "?SCRIPT?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12940 /* "?SCRIPT?" */) return TCL_ERROR __381: ; @@ -40265,7 +41515,7 @@ __382: // $db version -use-legacy-prepare BOOLEAN // // Turn the use of legacy sqlite3_prepare() on or off. - if !((libc.Xstrcmp(tls, zArg, ts+12808 /* "-use-legacy-prep..." */) == 0) && ((i5 + 1) < objc)) { + if !((libc.Xstrcmp(tls, zArg, ts+12988 /* "-use-legacy-prep..." */) == 0) && ((i5 + 1) < objc)) { goto __385 } i5++ @@ -40282,10 +41532,10 @@ __385: // // Return a string which is a hex encoding of the pointer to the // most recent sqlite3_stmt in the statement cache. - if !(libc.Xstrcmp(tls, zArg, ts+12828 /* "-last-stmt-ptr" */) == 0) { + if !(libc.Xstrcmp(tls, zArg, ts+13008 /* "-last-stmt-ptr" */) == 0) { goto __388 } - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+1480 /* &zBuf[0] */, ts+12843, /* "%p" */ + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+1480 /* &zBuf[0] */, ts+13023, /* "%p" */ libc.VaList(bp+984, func() uintptr { if (*SqliteDb)(unsafe.Pointer(pDb)).FstmtList != 0 { return (*SqlPreparedStmt)(unsafe.Pointer((*SqliteDb)(unsafe.Pointer(pDb)).FstmtList)).FpStmt @@ -40296,7 +41546,7 @@ __385: goto __389 __388: - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+992, ts+12846 /* "unknown argument..." */, zArg, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+992, ts+13026 /* "unknown argument..." */, zArg, uintptr(0))) return TCL_ERROR __389: ; @@ -40329,46 +41579,46 @@ type DbConfigChoices = struct { } /* tclsqlite.c:2340:18 */ var DB_strs = [42]uintptr{ - ts + 12865 /* "authorizer" */, ts + 12876 /* "backup" */, ts + 12883, /* "bind_fallback" */ - ts + 12897 /* "busy" */, ts + 12902 /* "cache" */, ts + 12908, /* "changes" */ - ts + 9947 /* "close" */, ts + 12916 /* "collate" */, ts + 12924, /* "collation_needed" */ - ts + 12941 /* "commit_hook" */, ts + 12953 /* "complete" */, ts + 12962, /* "config" */ - ts + 12969 /* "copy" */, ts + 12974 /* "deserialize" */, ts + 12986, /* "enable_load_exte..." */ - ts + 13008 /* "errorcode" */, ts + 4587 /* "eval" */, ts + 13018, /* "exists" */ - ts + 13025 /* "function" */, ts + 10346 /* "incrblob" */, ts + 13034, /* "interrupt" */ - ts + 13044 /* "last_insert_rowi..." */, ts + 13062 /* "nullvalue" */, ts + 13072, /* "onecolumn" */ - ts + 13082 /* "preupdate" */, ts + 13092 /* "profile" */, ts + 10021, /* "progress" */ - ts + 13100 /* "rekey" */, ts + 13106 /* "restore" */, ts + 13114, /* "rollback_hook" */ - ts + 13128 /* "serialize" */, ts + 13138 /* "status" */, ts + 13145, /* "timeout" */ - ts + 13153 /* "total_changes" */, ts + 13167 /* "trace" */, ts + 13173, /* "trace_v2" */ - ts + 13182 /* "transaction" */, ts + 13194 /* "unlock_notify" */, ts + 13208, /* "update_hook" */ - ts + 13220 /* "version" */, ts + 13228 /* "wal_hook" */, uintptr(0), + ts + 13045 /* "authorizer" */, ts + 13056 /* "backup" */, ts + 13063, /* "bind_fallback" */ + ts + 13077 /* "busy" */, ts + 13082 /* "cache" */, ts + 13088, /* "changes" */ + ts + 10127 /* "close" */, ts + 13096 /* "collate" */, ts + 13104, /* "collation_needed" */ + ts + 13121 /* "commit_hook" */, ts + 13133 /* "complete" */, ts + 13142, /* "config" */ + ts + 13149 /* "copy" */, ts + 13154 /* "deserialize" */, ts + 13166, /* "enable_load_exte..." */ + ts + 13188 /* "errorcode" */, ts + 4767 /* "eval" */, ts + 13198, /* "exists" */ + ts + 13205 /* "function" */, ts + 10526 /* "incrblob" */, ts + 13214, /* "interrupt" */ + ts + 13224 /* "last_insert_rowi..." */, ts + 13242 /* "nullvalue" */, ts + 13252, /* "onecolumn" */ + ts + 13262 /* "preupdate" */, ts + 13272 /* "profile" */, ts + 10201, /* "progress" */ + ts + 13280 /* "rekey" */, ts + 13286 /* "restore" */, ts + 13294, /* "rollback_hook" */ + ts + 13308 /* "serialize" */, ts + 13318 /* "status" */, ts + 13325, /* "timeout" */ + ts + 13333 /* "total_changes" */, ts + 13347 /* "trace" */, ts + 13353, /* "trace_v2" */ + ts + 13362 /* "transaction" */, ts + 13374 /* "unlock_notify" */, ts + 13388, /* "update_hook" */ + ts + 13400 /* "version" */, ts + 13408 /* "wal_hook" */, uintptr(0), } /* tclsqlite.c:1916:21 */ var aDbConfig = [16]DbConfigChoices{ - {FzName: ts + 13237 /* "defensive" */, Fop: SQLITE_DBCONFIG_DEFENSIVE}, - {FzName: ts + 13247 /* "dqs_ddl" */, Fop: SQLITE_DBCONFIG_DQS_DDL}, - {FzName: ts + 13255 /* "dqs_dml" */, Fop: SQLITE_DBCONFIG_DQS_DML}, - {FzName: ts + 13263 /* "enable_fkey" */, Fop: SQLITE_DBCONFIG_ENABLE_FKEY}, - {FzName: ts + 13275 /* "enable_qpsg" */, Fop: SQLITE_DBCONFIG_ENABLE_QPSG}, - {FzName: ts + 13287 /* "enable_trigger" */, Fop: SQLITE_DBCONFIG_ENABLE_TRIGGER}, - {FzName: ts + 13302 /* "enable_view" */, Fop: SQLITE_DBCONFIG_ENABLE_VIEW}, - {FzName: ts + 13314 /* "fts3_tokenizer" */, Fop: SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER}, - {FzName: ts + 13329 /* "legacy_alter_tab..." */, Fop: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE}, - {FzName: ts + 13348 /* "legacy_file_form..." */, Fop: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT}, - {FzName: ts + 13367 /* "load_extension" */, Fop: SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION}, - {FzName: ts + 13382 /* "no_ckpt_on_close" */, Fop: SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE}, - {FzName: ts + 13399 /* "reset_database" */, Fop: SQLITE_DBCONFIG_RESET_DATABASE}, - {FzName: ts + 13414 /* "trigger_eqp" */, Fop: SQLITE_DBCONFIG_TRIGGER_EQP}, - {FzName: ts + 13426 /* "trusted_schema" */, Fop: SQLITE_DBCONFIG_TRUSTED_SCHEMA}, - {FzName: ts + 13441 /* "writable_schema" */, Fop: SQLITE_DBCONFIG_WRITABLE_SCHEMA}, + {FzName: ts + 13417 /* "defensive" */, Fop: SQLITE_DBCONFIG_DEFENSIVE}, + {FzName: ts + 13427 /* "dqs_ddl" */, Fop: SQLITE_DBCONFIG_DQS_DDL}, + {FzName: ts + 13435 /* "dqs_dml" */, Fop: SQLITE_DBCONFIG_DQS_DML}, + {FzName: ts + 13443 /* "enable_fkey" */, Fop: SQLITE_DBCONFIG_ENABLE_FKEY}, + {FzName: ts + 13455 /* "enable_qpsg" */, Fop: SQLITE_DBCONFIG_ENABLE_QPSG}, + {FzName: ts + 13467 /* "enable_trigger" */, Fop: SQLITE_DBCONFIG_ENABLE_TRIGGER}, + {FzName: ts + 13482 /* "enable_view" */, Fop: SQLITE_DBCONFIG_ENABLE_VIEW}, + {FzName: ts + 13494 /* "fts3_tokenizer" */, Fop: SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER}, + {FzName: ts + 13509 /* "legacy_alter_tab..." */, Fop: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE}, + {FzName: ts + 13528 /* "legacy_file_form..." */, Fop: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT}, + {FzName: ts + 13547 /* "load_extension" */, Fop: SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION}, + {FzName: ts + 13562 /* "no_ckpt_on_close" */, Fop: SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE}, + {FzName: ts + 13579 /* "reset_database" */, Fop: SQLITE_DBCONFIG_RESET_DATABASE}, + {FzName: ts + 13594 /* "trigger_eqp" */, Fop: SQLITE_DBCONFIG_TRIGGER_EQP}, + {FzName: ts + 13606 /* "trusted_schema" */, Fop: SQLITE_DBCONFIG_TRUSTED_SCHEMA}, + {FzName: ts + 13621 /* "writable_schema" */, Fop: SQLITE_DBCONFIG_WRITABLE_SCHEMA}, } /* tclsqlite.c:2343:7 */ var TTYPE_strs = [5]uintptr{ - ts + 13457 /* "statement" */, ts + 13092 /* "profile" */, ts + 13467 /* "row" */, ts + 9947 /* "close" */, uintptr(0), + ts + 13637 /* "statement" */, ts + 13272 /* "profile" */, ts + 13647 /* "row" */, ts + 10127 /* "close" */, uintptr(0), } /* tclsqlite.c:3321:27 */ var TTYPE_strs1 = [4]uintptr{ - ts + 13471 /* "deferred" */, ts + 13480 /* "exclusive" */, ts + 13490 /* "immediate" */, uintptr(0), + ts + 13651 /* "deferred" */, ts + 13660 /* "exclusive" */, ts + 13670 /* "immediate" */, uintptr(0), } /* tclsqlite.c:3404:25 */ -var azSub = [6]uintptr{ts + 1825 /* "count" */, ts + 13500 /* "depth" */, ts + 13506 /* "hook" */, ts + 13511 /* "new" */, ts + 13515 /* "old" */, uintptr(0)} /* tclsqlite.c:3496:23 */ +var azSub = [6]uintptr{ts + 1826 /* "count" */, ts + 13680 /* "depth" */, ts + 13686 /* "hook" */, ts + 13691 /* "new" */, ts + 13695 /* "old" */, uintptr(0)} /* tclsqlite.c:3496:23 */ // Adaptor that provides an objCmd interface to the NRE-enabled // interface implementation. @@ -40383,7 +41633,7 @@ func DbObjCmdAdaptor(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv func sqliteCmdUsage(tls *libc.TLS, interp uintptr, objv uintptr) int32 { /* tclsqlite.c:3661:12: */ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, - ts+13519 /* "HANDLE ?FILENAME..." */) + ts+13699 /* "HANDLE ?FILENAME..." */) return TCL_ERROR } @@ -40429,16 +41679,16 @@ func DbMain(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) } if objc == 2 { zArg = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(0)) - if libc.Xstrcmp(tls, zArg, ts+13665 /* "-version" */) == 0 { + if libc.Xstrcmp(tls, zArg, ts+13845 /* "-version" */) == 0 { tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, sqlite3.Xsqlite3_libversion(tls), uintptr(0))) return TCL_OK } - if libc.Xstrcmp(tls, zArg, ts+13674 /* "-sourceid" */) == 0 { + if libc.Xstrcmp(tls, zArg, ts+13854 /* "-sourceid" */) == 0 { tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, sqlite3.Xsqlite3_sourceid(tls), uintptr(0))) return TCL_OK } - if libc.Xstrcmp(tls, zArg, ts+13684 /* "-has-codec" */) == 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+13695 /* "0" */, uintptr(0))) + if libc.Xstrcmp(tls, zArg, ts+13864 /* "-has-codec" */) == 0 { + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+13875 /* "0" */, uintptr(0))) return TCL_OK } if int32(*(*int8)(unsafe.Pointer(zArg))) == '-' { @@ -40458,11 +41708,11 @@ func DbMain(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) return sqliteCmdUsage(tls, interp, objv) } i++ - if libc.Xstrcmp(tls, zArg, ts+13697 /* "-key" */) == 0 { + if libc.Xstrcmp(tls, zArg, ts+13877 /* "-key" */) == 0 { // no-op - } else if libc.Xstrcmp(tls, zArg, ts+13702 /* "-vfs" */) == 0 { + } else if libc.Xstrcmp(tls, zArg, ts+13882 /* "-vfs" */) == 0 { zVfs = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) - } else if libc.Xstrcmp(tls, zArg, ts+11945 /* "-readonly" */) == 0 { + } else if libc.Xstrcmp(tls, zArg, ts+12125 /* "-readonly" */) == 0 { // var b int32 at bp+88, 4 if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+88 /* &b */) != 0 { @@ -40475,7 +41725,7 @@ func DbMain(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) flags = flags & (libc.CplInt32(SQLITE_OPEN_READONLY)) flags = flags | (SQLITE_OPEN_READWRITE) } - } else if libc.Xstrcmp(tls, zArg, ts+13707 /* "-create" */) == 0 { + } else if libc.Xstrcmp(tls, zArg, ts+13887 /* "-create" */) == 0 { // var b int32 at bp+92, 4 if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+92 /* &b */) != 0 { @@ -40486,7 +41736,7 @@ func DbMain(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) } else { flags = flags & (libc.CplInt32(SQLITE_OPEN_CREATE)) } - } else if libc.Xstrcmp(tls, zArg, ts+13715 /* "-nofollow" */) == 0 { + } else if libc.Xstrcmp(tls, zArg, ts+13895 /* "-nofollow" */) == 0 { // var b int32 at bp+96, 4 if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+96 /* &b */) != 0 { @@ -40497,7 +41747,7 @@ func DbMain(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) } else { flags = flags & (libc.CplInt32(SQLITE_OPEN_NOFOLLOW)) } - } else if libc.Xstrcmp(tls, zArg, ts+13725 /* "-nomutex" */) == 0 { + } else if libc.Xstrcmp(tls, zArg, ts+13905 /* "-nomutex" */) == 0 { // var b int32 at bp+100, 4 if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+100 /* &b */) != 0 { @@ -40509,7 +41759,7 @@ func DbMain(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) } else { flags = flags & (libc.CplInt32(SQLITE_OPEN_NOMUTEX)) } - } else if libc.Xstrcmp(tls, zArg, ts+13734 /* "-fullmutex" */) == 0 { + } else if libc.Xstrcmp(tls, zArg, ts+13914 /* "-fullmutex" */) == 0 { // var b int32 at bp+104, 4 if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+104 /* &b */) != 0 { @@ -40521,7 +41771,7 @@ func DbMain(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) } else { flags = flags & (libc.CplInt32(SQLITE_OPEN_FULLMUTEX)) } - } else if libc.Xstrcmp(tls, zArg, ts+13745 /* "-uri" */) == 0 { + } else if libc.Xstrcmp(tls, zArg, ts+13925 /* "-uri" */) == 0 { // var b int32 at bp+108, 4 if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+108 /* &b */) != 0 { @@ -40532,12 +41782,12 @@ func DbMain(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) } else { flags = flags & (libc.CplInt32(SQLITE_OPEN_URI)) } - } else if libc.Xstrcmp(tls, zArg, ts+13750 /* "-translatefilena..." */) == 0 { + } else if libc.Xstrcmp(tls, zArg, ts+13930 /* "-translatefilena..." */) == 0 { if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+112 /* &bTranslateFileName */) != 0 { return TCL_ERROR } } else { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+11955 /* "unknown option: " */, zArg, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+12135 /* "unknown option: " */, zArg, uintptr(0))) return TCL_ERROR } } @@ -40545,7 +41795,7 @@ func DbMain(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) p = tcl.XTcl_Alloc(tls, uint32(unsafe.Sizeof(SqliteDb{}))) libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(SqliteDb{}))) if zFile == uintptr(0) { - zFile = ts + 488 /* "" */ + zFile = ts + 489 /* "" */ } if *(*int32)(unsafe.Pointer(bp + 112 /* bTranslateFileName */)) != 0 { zFile = tcl.XTcl_TranslateFileName(tls, interp, zFile, bp+120 /* &translatedFilename */) @@ -40612,16 +41862,16 @@ func Sqlite3_Init(tls *libc.TLS, interp uintptr) int32 { /* tclsqlite.c:3877:12: rc = TCL_ERROR } if rc == TCL_OK { - tcl.XTcl_CreateObjCommand(tls, interp, ts+13769 /* "sqlite3" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+13949 /* "sqlite3" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{DbMain})), uintptr(0), uintptr(0)) // The "sqlite" alias is undocumented. It is here only to support // legacy scripts. All new scripts should use only the "sqlite3" // command. - tcl.XTcl_CreateObjCommand(tls, interp, ts+13777 /* "sqlite" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+13957 /* "sqlite" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{DbMain})), uintptr(0), uintptr(0)) - rc = tcl.XTcl_PkgProvideEx(tls, interp, ts+13769 /* "sqlite3" */, ts+13784 /* "3.33.0" */, uintptr(0)) + rc = tcl.XTcl_PkgProvideEx(tls, interp, ts+13949 /* "sqlite3" */, ts+13964 /* "3.35.0" */, uintptr(0)) } return rc } @@ -40674,7 +41924,7 @@ func tclsh_main_loop(tls *libc.TLS) uintptr { /* tclsqlite.c:3920:19: */ return uintptr(unsafe.Pointer(&zMainloop)) } -var zMainloop = *(*[431]int8)(unsafe.Pointer(ts + 13791 /* "if {[llength $ar..." */)) /* tclsqlite.c:3921:21 */ +var zMainloop = *(*[431]int8)(unsafe.Pointer(ts + 13971 /* "if {[llength $ar..." */)) /* tclsqlite.c:3921:21 */ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* tclsqlite.c:3953:18: */ bp := tls.Alloc(64) @@ -40685,10 +41935,10 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* tclsqlite.c:3953: var zScript uintptr = uintptr(0) // var zArgc [32]int8 at bp+32, 32 - if libc.Xgetenv(tls, ts+14222 /* "SQLITE_DEBUG_BRE..." */) != 0 { + if libc.Xgetenv(tls, ts+14402 /* "SQLITE_DEBUG_BRE..." */) != 0 { if (libc.Xisatty(tls, 0) != 0) && (libc.Xisatty(tls, 2) != 0) { libc.Xfprintf(tls, libc.Xstderr, - ts+14241, /* "attach debugger ..." */ + ts+14421, /* "attach debugger ..." */ libc.VaList(bp, libc.Xgetpid(tls))) libc.Xfgetc(tls, libc.Xstdin) } else { @@ -40702,27 +41952,27 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* tclsqlite.c:3953: sqlite3.Xsqlite3_shutdown(tls) tcl.XTcl_FindExecutable(tls, *(*uintptr)(unsafe.Pointer(argv))) - tcl.XTcl_SetSystemEncoding(tls, uintptr(0), ts+14303 /* "utf-8" */) + tcl.XTcl_SetSystemEncoding(tls, uintptr(0), ts+14483 /* "utf-8" */) interp = tcl.XTcl_CreateInterp(tls) Sqlite3_Init(tls, interp) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), bp+32 /* &zArgc[0] */, ts+1237 /* "%d" */, libc.VaList(bp+8, (argc-1))) - tcl.XTcl_SetVar2(tls, interp, ts+14309 /* "argc" */, uintptr(0), bp+32 /* &zArgc[0] */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+14314 /* "argv0" */, uintptr(0), *(*uintptr)(unsafe.Pointer(argv)), TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+14320 /* "argv" */, uintptr(0), ts+488 /* "" */, TCL_GLOBAL_ONLY) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), bp+32 /* &zArgc[0] */, ts+1238 /* "%d" */, libc.VaList(bp+8, (argc-1))) + tcl.XTcl_SetVar2(tls, interp, ts+14489 /* "argc" */, uintptr(0), bp+32 /* &zArgc[0] */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+14494 /* "argv0" */, uintptr(0), *(*uintptr)(unsafe.Pointer(argv)), TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+14500 /* "argv" */, uintptr(0), ts+489 /* "" */, TCL_GLOBAL_ONLY) for i = 1; i < argc; i++ { - tcl.XTcl_SetVar2(tls, interp, ts+14320 /* "argv" */, uintptr(0), *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ((TCL_GLOBAL_ONLY | TCL_LIST_ELEMENT) | TCL_APPEND_VALUE)) + tcl.XTcl_SetVar2(tls, interp, ts+14500 /* "argv" */, uintptr(0), *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ((TCL_GLOBAL_ONLY | TCL_LIST_ELEMENT) | TCL_APPEND_VALUE)) } zScript = sqlite3TestInit(tls, interp) if zScript == uintptr(0) { zScript = tclsh_main_loop(tls) } if tcl.XTcl_GlobalEval(tls, interp, zScript) != TCL_OK { - var zInfo uintptr = tcl.XTcl_GetVar2(tls, interp, ts+14325 /* "errorInfo" */, uintptr(0), TCL_GLOBAL_ONLY) + var zInfo uintptr = tcl.XTcl_GetVar2(tls, interp, ts+14505 /* "errorInfo" */, uintptr(0), TCL_GLOBAL_ONLY) if zInfo == uintptr(0) { zInfo = tcl.XTcl_GetStringResult(tls, interp) } - libc.Xfprintf(tls, libc.Xstderr, ts+14335 /* "%s: %s\n" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv)), zInfo)) + libc.Xfprintf(tls, libc.Xstderr, ts+14515 /* "%s: %s\n" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv)), zInfo)) return 1 } return 0 @@ -40780,7 +42030,7 @@ type sqlite31 = sqlite32 /* sqlite3.h:249:24 */ // [sqlite3_value_dup()]. // The [sqlite3_value_blob | sqlite3_value_type()] family of // interfaces require protected sqlite3_value objects. -type sqlite3_value = sqlite3_value1 /* sqlite3.h:4244:30 */ +type sqlite3_value = sqlite3_value1 /* sqlite3.h:4258:30 */ // CAPI3REF: SQL Function Context Object // @@ -40792,7 +42042,7 @@ type sqlite3_value = sqlite3_value1 /* sqlite3.h:4244:30 */ // [sqlite3_aggregate_context()], [sqlite3_user_data()], // [sqlite3_context_db_handle()], [sqlite3_get_auxdata()], // and/or [sqlite3_set_auxdata()]. -type sqlite3_context = sqlite3_context1 /* sqlite3.h:4258:32 */ +type sqlite3_context = sqlite3_context1 /* sqlite3.h:4272:32 */ // CAPI3REF: Dynamic String Object // KEYWORDS: {dynamic string} @@ -40808,7 +42058,7 @@ type sqlite3_context = sqlite3_context1 /* sqlite3.h:4258:32 */ //
  • ^The sqlite3_str object is destroyed and the string it created // is returned using the [sqlite3_str_finish()] interface. // -type sqlite3_str = sqlite3_str1 /* sqlite3.h:7784:28 */ +type sqlite3_str = sqlite3_str1 /* sqlite3.h:7851:28 */ // Unsigned. // Define uintN_t types. @@ -40857,35 +42107,35 @@ type uint64_t = uint64 /* stdint-uintn.h:27:20 */ // Small types. // Signed. -type int_least8_t = int8 /* stdint.h:43:24 */ -type int_least16_t = int16 /* stdint.h:44:25 */ -type int_least32_t = int32 /* stdint.h:45:25 */ -type int_least64_t = int64 /* stdint.h:46:25 */ +type int_least8_t = int8 /* stdint.h:43:22 */ +type int_least16_t = int16 /* stdint.h:44:20 */ +type int_least32_t = int32 /* stdint.h:45:15 */ +type int_least64_t = int64 /* stdint.h:47:19 */ // Unsigned. -type uint_least8_t = uint8 /* stdint.h:49:25 */ -type uint_least16_t = uint16 /* stdint.h:50:26 */ -type uint_least32_t = uint32 /* stdint.h:51:26 */ -type uint_least64_t = uint64 /* stdint.h:52:26 */ +type uint_least8_t = uint8 /* stdint.h:54:24 */ +type uint_least16_t = uint16 /* stdint.h:55:28 */ +type uint_least32_t = uint32 /* stdint.h:56:23 */ +type uint_least64_t = uint64 /* stdint.h:58:27 */ // Fast types. // Signed. -type int_fast8_t = int8 /* stdint.h:58:22 */ -type int_fast16_t = int64 /* stdint.h:60:19 */ -type int_fast32_t = int64 /* stdint.h:61:19 */ -type int_fast64_t = int64 /* stdint.h:62:19 */ +type int_fast8_t = int8 /* stdint.h:68:22 */ +type int_fast16_t = int64 /* stdint.h:70:19 */ +type int_fast32_t = int64 /* stdint.h:71:19 */ +type int_fast64_t = int64 /* stdint.h:72:19 */ // Unsigned. -type uint_fast8_t = uint8 /* stdint.h:71:24 */ -type uint_fast16_t = uint64 /* stdint.h:73:27 */ -type uint_fast32_t = uint64 /* stdint.h:74:27 */ -type uint_fast64_t = uint64 /* stdint.h:75:27 */ -type uintptr_t = uint64 /* stdint.h:90:27 */ +type uint_fast8_t = uint8 /* stdint.h:81:24 */ +type uint_fast16_t = uint64 /* stdint.h:83:27 */ +type uint_fast32_t = uint64 /* stdint.h:84:27 */ +type uint_fast64_t = uint64 /* stdint.h:85:27 */ +type uintptr_t = uint64 /* stdint.h:100:27 */ // Largest integral types. -type intmax_t = int64 /* stdint.h:101:21 */ -type uintmax_t = uint64 /* stdint.h:102:22 */ +type intmax_t = int64 /* stdint.h:111:21 */ +type uintmax_t = uint64 /* stdint.h:112:22 */ // Macros for printing format specifiers. @@ -41031,26 +42281,16 @@ type _ht = struct { } /* sqlite3.h:249:9 */ // The structure with the cookie function pointers. -// The tag name of this struct is _IO_cookie_io_functions_t to -// preserve historic C++ mangled names for functions taking -// cookie_io_functions_t arguments. That name should not be used in -// new code. type _IO_cookie_io_functions_t = struct { Fread uintptr Fwrite uintptr Fseek uintptr Fclose uintptr -} /* cookie_io_functions_t.h:55:9 */ - -// The structure with the cookie function pointers. -// The tag name of this struct is _IO_cookie_io_functions_t to -// preserve historic C++ mangled names for functions taking -// cookie_io_functions_t arguments. That name should not be used in -// new code. -type cookie_io_functions_t = _IO_cookie_io_functions_t /* cookie_io_functions_t.h:61:3 */ -type off64_t = int64 /* stdio.h:70:19 */ -type fpos64_t = _G_fpos64_t /* stdio.h:89:20 */ -type ino64_t = uint64 /* types.h:54:19 */ +} /* libio.h:374:3 */ +type cookie_io_functions_t = _IO_cookie_io_functions_t /* libio.h:375:35 */ +type off64_t = int64 /* stdio.h:64:19 */ +type fpos64_t = _G_fpos64_t /* stdio.h:83:21 */ +type ino64_t = uint64 /* types.h:55:19 */ // Some versions of define this macros. // It's easier to assume 8-bit bytes than to get CHAR_BIT. @@ -41058,14 +42298,14 @@ type ino64_t = uint64 /* types.h:54:19 */ // fd_set for select and pselect. type fd_set1 = struct{ Ffds_bits [16]int64 } /* select.h:70:5 */ // Type to count file system inodes. -type blkcnt64_t = int64 /* types.h:236:22 */ // Type to count number of disk blocks. -type fsblkcnt64_t = uint64 /* types.h:237:24 */ // Type to count file system blocks. -type fsfilcnt64_t = uint64 /* types.h:238:24 */ +type blkcnt64_t = int64 /* types.h:246:22 */ // Type to count number of disk blocks. +type fsblkcnt64_t = uint64 /* types.h:247:24 */ // Type to count file system blocks. +type fsfilcnt64_t = uint64 /* types.h:248:24 */ type comparison_fn_t = uintptr /* stdlib.h:808:23 */ // 8-byte unsigned integer -type u322 = uint32_t /* sqliteInt.h:780:21 */ // 2-byte unsigned integer -type i16 = int16_t /* sqliteInt.h:782:20 */ // 1-byte unsigned integer -type i8 = int8_t /* sqliteInt.h:784:19 */ // 1-byte signed integer +type u322 = uint32_t /* sqliteInt.h:793:21 */ // 2-byte unsigned integer +type i16 = int16_t /* sqliteInt.h:795:20 */ // 1-byte unsigned integer +type i8 = int8_t /* sqliteInt.h:797:19 */ // 1-byte signed integer // SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value // that can be stored in a u32 without loss of data. The value @@ -41076,7 +42316,7 @@ type i8 = int8_t /* sqliteInt.h:784:19 */ // 1-byte signed integer // table or index. This is an unsigned integer type. For 99.9% of // the world, a 32-bit integer is sufficient. But a 64-bit integer // can be used at compile-time if desired. -type tRowcnt = u322 /* sqliteInt.h:803:14 */ // 32-bit is the default +type tRowcnt = u322 /* sqliteInt.h:816:14 */ // 32-bit is the default // Estimated quantities used for query planning are stored as 16-bit // logarithms. For quantity X, the value stored is 10*log2(X). This @@ -41099,55 +42339,12 @@ type tRowcnt = u322 /* sqliteInt.h:803:14 */ // 32-bit is the default // Examples: // // 0.5 -> -10 0.1 -> -33 0.0625 -> -40 -type LogEst = int16_t /* sqliteInt.h:829:20 */ +type LogEst = int16_t /* sqliteInt.h:842:20 */ // Set the SQLITE_PTRSIZE macro to the number of bytes in a pointer // The uptr type is an unsigned integer large enough to hold a pointer -type uptr = uintptr_t /* sqliteInt.h:849:21 */ - -// The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to -// something between S (inclusive) and E (exclusive). -// -// In other words, S is a buffer and E is a pointer to the first byte after -// the end of buffer S. This macro returns true if P points to something -// contained within the buffer S. - -// Macros to determine whether the machine is big or little endian, -// and whether or not that determination is run-time or compile-time. -// -// For best performance, an attempt is made to guess at the byte-order -// using C-preprocessor macros. If that is unsuccessful, or if -// -DSQLITE_BYTEORDER=0 is set, then byte-order is determined -// at run-time. - -// Constants for the largest and smallest possible 64-bit signed integers. -// These macros are designed to work correctly on both 32-bit and 64-bit -// compilers. - -// Round up a number to the next larger multiple of 8. This is used -// to force 8-byte alignment on 64-bit architectures. - -// Round down to the nearest multiple of 8 - -// Assert that the pointer X is aligned to an 8-byte boundary. This -// macro is used only within assert() to verify that the code gets -// all alignment restrictions correct. -// -// Except, if SQLITE_4_BYTE_ALIGNED_MALLOC is defined, then the -// underlying malloc() implementation might return us 4-byte aligned -// pointers. In that case, only verify 4-byte alignment. - -// Disable MMAP on platforms where it is known to not work - -// Default maximum size of memory used by memory-mapped I/O in the VFS - -// The default MMAP_SIZE is zero on all platforms. Or, even if a larger -// default MMAP_SIZE is specified at compile-time, make sure that it does -// not exceed the maximum mmap size. - -// SELECTTRACE_ENABLED will be either 1 or 0 depending on whether or not -// the Select query generator tracing logic is turned on. +type uptr = uintptr_t /* sqliteInt.h:862:21 */ // An instance of the following structure is used to store the busy-handler // callback for a given sqlite handle. @@ -41163,49 +42360,6 @@ type BusyHandler1 = struct { _ [4]byte } /* sqlite3.h:249:9 */ -// The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to -// something between S (inclusive) and E (exclusive). -// -// In other words, S is a buffer and E is a pointer to the first byte after -// the end of buffer S. This macro returns true if P points to something -// contained within the buffer S. - -// Macros to determine whether the machine is big or little endian, -// and whether or not that determination is run-time or compile-time. -// -// For best performance, an attempt is made to guess at the byte-order -// using C-preprocessor macros. If that is unsuccessful, or if -// -DSQLITE_BYTEORDER=0 is set, then byte-order is determined -// at run-time. - -// Constants for the largest and smallest possible 64-bit signed integers. -// These macros are designed to work correctly on both 32-bit and 64-bit -// compilers. - -// Round up a number to the next larger multiple of 8. This is used -// to force 8-byte alignment on 64-bit architectures. - -// Round down to the nearest multiple of 8 - -// Assert that the pointer X is aligned to an 8-byte boundary. This -// macro is used only within assert() to verify that the code gets -// all alignment restrictions correct. -// -// Except, if SQLITE_4_BYTE_ALIGNED_MALLOC is defined, then the -// underlying malloc() implementation might return us 4-byte aligned -// pointers. In that case, only verify 4-byte alignment. - -// Disable MMAP on platforms where it is known to not work - -// Default maximum size of memory used by memory-mapped I/O in the VFS - -// The default MMAP_SIZE is zero on all platforms. Or, even if a larger -// default MMAP_SIZE is specified at compile-time, make sure that it does -// not exceed the maximum mmap size. - -// SELECTTRACE_ENABLED will be either 1 or 0 depending on whether or not -// the Select query generator tracing logic is turned on. - // An instance of the following structure is used to store the busy-handler // callback for a given sqlite handle. // @@ -41213,7 +42367,7 @@ type BusyHandler1 = struct { // callback for the database handle. Each pager opened via the sqlite // handle is passed a pointer to sqlite.busyHandler. The busy-handler // callback is currently invoked only from within pager.c. -type BusyHandler = BusyHandler1 /* sqliteInt.h:1012:28 */ +type BusyHandler = BusyHandler1 /* sqliteInt.h:1037:28 */ // Name of table that holds the database schema. @@ -41278,7 +42432,6 @@ type AggInfo1 = struct { FaFunc uintptr FnFunc int32 FselId u322 - FpNext uintptr } /* sqlite3.h:249:9 */ // Name of table that holds the database schema. @@ -41328,13 +42481,13 @@ type AggInfo1 = struct { // cases the parameters are named as per the usual conventions. // Forward references to structures -type AggInfo = AggInfo1 /* sqliteInt.h:1108:24 */ +type AggInfo = AggInfo1 /* sqliteInt.h:1133:24 */ type AuthContext1 = struct { FzAuthContext uintptr FpParse uintptr -} /* sqliteInt.h:1109:9 */ +} /* sqliteInt.h:1134:9 */ -type AuthContext = AuthContext1 /* sqliteInt.h:1109:28 */ +type AuthContext = AuthContext1 /* sqliteInt.h:1134:28 */ type AutoincInfo1 = struct { FpNext uintptr FpTab uintptr @@ -41342,7 +42495,7 @@ type AutoincInfo1 = struct { FregCtr int32 } /* sqlite3.h:249:9 */ -type AutoincInfo = AutoincInfo1 /* sqliteInt.h:1110:28 */ +type AutoincInfo = AutoincInfo1 /* sqliteInt.h:1135:28 */ type CollSeq1 = struct { FzName uintptr Fenc u8 @@ -41352,7 +42505,7 @@ type CollSeq1 = struct { FxDel uintptr } /* sqlite3.h:249:9 */ -type CollSeq = CollSeq1 /* sqliteInt.h:1112:24 */ +type CollSeq = CollSeq1 /* sqliteInt.h:1137:24 */ type Column1 = struct { FzName uintptr FpDflt uintptr @@ -41365,7 +42518,29 @@ type Column1 = struct { _ [2]byte } /* sqlite3.h:249:9 */ -type Column = Column1 /* sqliteInt.h:1113:23 */ +type Column = Column1 /* sqliteInt.h:1138:23 */ +type Cte1 = struct { + FzName uintptr + FpCols uintptr + FpSelect uintptr + FzCteErr uintptr + FpUse uintptr + FeM10d u8 + _ [7]byte +} /* sqlite3.h:249:9 */ + +type Cte = Cte1 /* sqliteInt.h:1139:20 */ +type CteUse1 = struct { + FnUse int32 + FaddrM9e int32 + FregRtn int32 + FiCur int32 + FnRowEst LogEst + FeM10d u8 + _ [1]byte +} /* sqlite3.h:249:9 */ + +type CteUse = CteUse1 /* sqliteInt.h:1140:23 */ type Db1 = struct { FzDbSName uintptr FpBt uintptr @@ -41375,7 +42550,19 @@ type Db1 = struct { FpSchema uintptr } /* sqlite3.h:249:9 */ -type Db = Db1 /* sqliteInt.h:1114:19 */ +type Db = Db1 /* sqliteInt.h:1141:19 */ +type DbFixer1 = struct { + FpParse uintptr + Fw Walker + FpSchema uintptr + FbTemp u8 + _ [7]byte + FzDb uintptr + FzType uintptr + FpName uintptr +} /* sqliteInt.h:1142:9 */ + +type DbFixer = DbFixer1 /* sqliteInt.h:1142:24 */ type Schema1 = struct { Fschema_cookie int32 FiGeneration int32 @@ -41390,7 +42577,7 @@ type Schema1 = struct { Fcache_size int32 } /* sqlite3.h:249:9 */ -type Schema = Schema1 /* sqliteInt.h:1115:23 */ +type Schema = Schema1 /* sqliteInt.h:1143:23 */ type Expr1 = struct { Fop u8 FaffExpr int8 @@ -41405,13 +42592,12 @@ type Expr1 = struct { FiTable int32 FiColumn ynVar FiAgg i16 - FiRightJoinTable i16 - _ [2]byte + FiRightJoinTable int32 FpAggInfo uintptr Fy struct{ FpTab uintptr } } /* sqlite3.h:249:9 */ -type Expr = Expr1 /* sqliteInt.h:1116:21 */ +type Expr = Expr1 /* sqliteInt.h:1144:21 */ type ExprList1 = struct { FnExpr int32 _ [4]byte @@ -41433,7 +42619,7 @@ type ExprList1 = struct { } } /* sqlite3.h:249:9 */ -type ExprList = ExprList1 /* sqliteInt.h:1117:25 */ +type ExprList = ExprList1 /* sqliteInt.h:1145:25 */ type FKey1 = struct { FpFrom uintptr FpNextFrom uintptr @@ -41452,15 +42638,15 @@ type FKey1 = struct { } } /* sqlite3.h:249:9 */ -type FKey = FKey1 /* sqliteInt.h:1118:21 */ +type FKey = FKey1 /* sqliteInt.h:1146:21 */ type FuncDestructor1 = struct { FnRef int32 _ [4]byte FxDestroy uintptr FpUserData uintptr -} /* sqliteInt.h:1119:9 */ +} /* sqliteInt.h:1147:9 */ -type FuncDestructor = FuncDestructor1 /* sqliteInt.h:1119:31 */ +type FuncDestructor = FuncDestructor1 /* sqliteInt.h:1147:31 */ type FuncDef1 = struct { FnArg i8 _ [3]byte @@ -41475,17 +42661,17 @@ type FuncDef1 = struct { Fu struct{ FpHash uintptr } } /* sqlite3.h:249:9 */ -type FuncDef = FuncDef1 /* sqliteInt.h:1120:24 */ -type FuncDefHash1 = struct{ Fa [23]uintptr } /* sqliteInt.h:1121:9 */ +type FuncDef = FuncDef1 /* sqliteInt.h:1148:24 */ +type FuncDefHash1 = struct{ Fa [23]uintptr } /* sqliteInt.h:1149:9 */ -type FuncDefHash = FuncDefHash1 /* sqliteInt.h:1121:28 */ +type FuncDefHash = FuncDefHash1 /* sqliteInt.h:1149:28 */ type IdList1 = struct { Fa uintptr FnId int32 _ [4]byte } /* sqlite3.h:249:9 */ -type IdList = IdList1 /* sqliteInt.h:1122:23 */ +type IdList = IdList1 /* sqliteInt.h:1150:23 */ type Index1 = struct { FzName uintptr FaiColumn uintptr @@ -41516,7 +42702,7 @@ type Index1 = struct { FcolNotIdxed Bitmask } /* sqlite3.h:249:9 */ -type Index = Index1 /* sqliteInt.h:1123:22 */ +type Index = Index1 /* sqliteInt.h:1151:22 */ type IndexSample1 = struct { Fp uintptr Fn int32 @@ -41526,7 +42712,7 @@ type IndexSample1 = struct { FanDLt uintptr } /* sqlite3.h:249:9 */ -type IndexSample = IndexSample1 /* sqliteInt.h:1124:28 */ +type IndexSample = IndexSample1 /* sqliteInt.h:1152:28 */ type KeyInfo1 = struct { FnRef u322 Fenc u8 @@ -41539,7 +42725,7 @@ type KeyInfo1 = struct { FaColl [1]uintptr } /* sqlite3.h:249:9 */ -type KeyInfo = KeyInfo1 /* sqliteInt.h:1126:24 */ +type KeyInfo = KeyInfo1 /* sqliteInt.h:1154:24 */ type Lookaside1 = struct { FbDisable u322 Fsz u16 @@ -41558,10 +42744,10 @@ type Lookaside1 = struct { FpEnd uintptr } /* sqlite3.h:249:9 */ -type Lookaside = Lookaside1 /* sqliteInt.h:1127:26 */ +type Lookaside = Lookaside1 /* sqliteInt.h:1155:26 */ type LookasideSlot1 = struct{ FpNext uintptr } /* sqlite3.h:249:9 */ -type LookasideSlot = LookasideSlot1 /* sqliteInt.h:1128:30 */ +type LookasideSlot = LookasideSlot1 /* sqliteInt.h:1156:30 */ type Module1 = struct { FpModule uintptr FzName uintptr @@ -41572,7 +42758,7 @@ type Module1 = struct { FpEpoTab uintptr } /* sqlite3.h:249:9 */ -type Module = Module1 /* sqliteInt.h:1129:23 */ +type Module = Module1 /* sqliteInt.h:1157:23 */ type NameContext1 = struct { FpParse uintptr FpSrcList uintptr @@ -41583,9 +42769,9 @@ type NameContext1 = struct { FncFlags int32 _ [4]byte FpWinSelect uintptr -} /* sqliteInt.h:1130:9 */ +} /* sqliteInt.h:1158:9 */ -type NameContext = NameContext1 /* sqliteInt.h:1130:28 */ +type NameContext = NameContext1 /* sqliteInt.h:1158:28 */ type Parse1 = struct { Fdb uintptr FzErrMsg uintptr @@ -41628,45 +42814,53 @@ type Parse1 = struct { FpToplevel uintptr FpTriggerTab uintptr FpParentParse uintptr - FpAggList uintptr - FaddrCrTab int32 - FnQueryLoop u322 - Foldmask u322 - Fnewmask u322 - FeTriggerOp u8 - FeOrconf u8 - FdisableTriggers u8 - _ [1]byte - FaTempReg [8]int32 - _ [4]byte - FsNameToken Token - FsLastToken Token - FnVar ynVar - FiPkSortOrder u8 - Fexplain u8 - FeParseMode u8 - _ [3]byte - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - _ [4]byte - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg Token - FapVtabLock uintptr - FpZombieTab uintptr - FpTriggerPrg uintptr - FpWith uintptr - FpWithToFree uintptr - FpRename uintptr + Fu1 struct { + _ [0]uint64 + FaddrCrTab int32 + _ [4]byte + } + FnQueryLoop u322 + Foldmask u322 + Fnewmask u322 + FeTriggerOp u8 + FbReturning u8 + FeOrconf u8 + FdisableTriggers u8 + FaTempReg [8]int32 + FsNameToken Token + FsLastToken Token + FnVar ynVar + FiPkSortOrder u8 + Fexplain u8 + FeParseMode u8 + _ [3]byte + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + _ [4]byte + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg Token + FapVtabLock uintptr + FpTriggerPrg uintptr + FpWith uintptr + FpCleanup uintptr + FpRename uintptr } /* sqlite3.h:249:9 */ -type Parse = Parse1 /* sqliteInt.h:1131:22 */ +type Parse = Parse1 /* sqliteInt.h:1159:22 */ +type ParseCleanup1 = struct { + FpNext uintptr + FpPtr uintptr + FxCleanup uintptr +} /* sqlite3.h:249:9 */ + +type ParseCleanup = ParseCleanup1 /* sqliteInt.h:1160:29 */ type PreUpdate1 = struct { Fv uintptr FpCsr uintptr @@ -41685,14 +42879,26 @@ type PreUpdate1 = struct { FpPk uintptr } /* sqlite3.h:249:9 */ -type PreUpdate = PreUpdate1 /* sqliteInt.h:1132:26 */ +type PreUpdate = PreUpdate1 /* sqliteInt.h:1161:26 */ type PrintfArguments1 = struct { FnArg int32 FnUsed int32 FapArg uintptr -} /* sqliteInt.h:1133:9 */ +} /* sqliteInt.h:1162:9 */ -type PrintfArguments = PrintfArguments1 /* sqliteInt.h:1133:32 */ +type PrintfArguments = PrintfArguments1 /* sqliteInt.h:1162:32 */ +type Returning1 = struct { + FpParse uintptr + FpReturnEL uintptr + FretTrig Trigger + FretTStep TriggerStep + FiRetCur int32 + FnRetCol int32 + FiRetReg int32 + _ [4]byte +} /* sqliteInt.h:1164:9 */ + +type Returning = Returning1 /* sqliteInt.h:1164:26 */ type Savepoint1 = struct { FzName uintptr FnDeferredCons i64 @@ -41700,7 +42906,7 @@ type Savepoint1 = struct { FpNext uintptr } /* sqlite3.h:249:9 */ -type Savepoint = Savepoint1 /* sqliteInt.h:1136:26 */ +type Savepoint = Savepoint1 /* sqliteInt.h:1166:26 */ type Select1 = struct { Fop u8 _ [1]byte @@ -41725,7 +42931,7 @@ type Select1 = struct { FpWinDefn uintptr } /* sqlite3.h:249:9 */ -type Select = Select1 /* sqliteInt.h:1137:23 */ +type Select = Select1 /* sqliteInt.h:1167:23 */ type SelectDest1 = struct { FeDest u8 _ [3]byte @@ -41736,40 +42942,43 @@ type SelectDest1 = struct { _ [4]byte FzAffSdst uintptr FpOrderBy uintptr -} /* sqliteInt.h:1139:9 */ +} /* sqliteInt.h:1169:9 */ -type SelectDest = SelectDest1 /* sqliteInt.h:1139:27 */ +type SelectDest = SelectDest1 /* sqliteInt.h:1169:27 */ +type SrcItem1 = struct { + FpSchema uintptr + FzDatabase uintptr + FzName uintptr + FzAlias uintptr + FpTab uintptr + FpSelect uintptr + FaddrFillSub int32 + FregReturn int32 + FregResult int32 + Ffg struct { + _ [0]uint32 + Fjointype u8 + _ [3]byte + FnotIndexed uint8 /* unsigned notIndexed: 1, unsigned isIndexedBy: 1, unsigned isTabFunc: 1, unsigned isCorrelated: 1, unsigned viaCoroutine: 1, unsigned isRecursive: 1, unsigned fromDDL: 1, unsigned isCte: 1 */ + _ [3]byte + } + FiCursor int32 + FpOn uintptr + FpUsing uintptr + FcolUsed Bitmask + Fu1 struct{ FzIndexedBy uintptr } + Fu2 struct{ FpIBIndex uintptr } +} /* sqlite3.h:249:9 */ + +type SrcItem = SrcItem1 /* sqliteInt.h:1170:24 */ type SrcList1 = struct { FnSrc int32 FnAlloc u322 - Fa [1]struct { - FpSchema uintptr - FzDatabase uintptr - FzName uintptr - FzAlias uintptr - FpTab uintptr - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 - Ffg struct { - _ [0]uint32 - Fjointype u8 - _ [3]byte - FnotIndexed uint8 /* unsigned notIndexed: 1, unsigned isIndexedBy: 1, unsigned isTabFunc: 1, unsigned isCorrelated: 1, unsigned viaCoroutine: 1, unsigned isRecursive: 1, unsigned fromDDL: 1 */ - _ [3]byte - } - FiCursor int32 - FpOn uintptr - FpUsing uintptr - FcolUsed Bitmask - Fu1 struct{ FzIndexedBy uintptr } - FpIBIndex uintptr - } + Fa [1]SrcItem } /* sqlite3.h:249:9 */ -type SrcList = SrcList1 /* sqliteInt.h:1140:24 */ -type StrAccum = sqlite3_str1 /* sqliteInt.h:1141:28 */ // Internal alias for sqlite3_str +type SrcList = SrcList1 /* sqliteInt.h:1171:24 */ +type StrAccum = sqlite3_str1 /* sqliteInt.h:1172:28 */ // Internal alias for sqlite3_str type Table1 = struct { FzName uintptr FaCol uintptr @@ -41794,24 +43003,24 @@ type Table1 = struct { FpVTable uintptr FpTrigger uintptr FpSchema uintptr - FpNextZombie uintptr } /* sqlite3.h:249:9 */ // Internal alias for sqlite3_str -type Table = Table1 /* sqliteInt.h:1142:22 */ +type Table = Table1 /* sqliteInt.h:1173:22 */ type Token1 = struct { Fz uintptr Fn uint32 _ [4]byte } /* sqlite3.h:249:9 */ -type Token = Token1 /* sqliteInt.h:1144:22 */ +type Token = Token1 /* sqliteInt.h:1175:22 */ type Trigger1 = struct { FzName uintptr Ftable uintptr Fop u8 Ftr_tm u8 - _ [6]byte + FbReturning u8 + _ [5]byte FpWhen uintptr FpColumns uintptr FpSchema uintptr @@ -41820,7 +43029,7 @@ type Trigger1 = struct { FpNext uintptr } /* sqlite3.h:249:9 */ -type Trigger = Trigger1 /* sqliteInt.h:1146:24 */ +type Trigger = Trigger1 /* sqliteInt.h:1177:24 */ type TriggerPrg1 = struct { FpTrigger uintptr FpNext uintptr @@ -41830,7 +43039,7 @@ type TriggerPrg1 = struct { _ [4]byte } /* sqlite3.h:249:9 */ -type TriggerPrg = TriggerPrg1 /* sqliteInt.h:1147:27 */ +type TriggerPrg = TriggerPrg1 /* sqliteInt.h:1178:27 */ type TriggerStep1 = struct { Fop u8 Forconf u8 @@ -41848,7 +43057,7 @@ type TriggerStep1 = struct { FpLast uintptr } /* sqlite3.h:249:9 */ -type TriggerStep = TriggerStep1 /* sqliteInt.h:1148:28 */ +type TriggerStep = TriggerStep1 /* sqliteInt.h:1179:28 */ type UnpackedRecord1 = struct { FpKeyInfo uintptr FaMem uintptr @@ -41861,12 +43070,16 @@ type UnpackedRecord1 = struct { _ [1]byte } /* sqlite3.h:249:9 */ -type UnpackedRecord = UnpackedRecord1 /* sqliteInt.h:1149:31 */ +type UnpackedRecord = UnpackedRecord1 /* sqliteInt.h:1180:31 */ type Upsert1 = struct { FpUpsertTarget uintptr FpUpsertTargetWhere uintptr FpUpsertSet uintptr FpUpsertWhere uintptr + FpNextUpsert uintptr + FisDoUpdate u8 + _ [7]byte + FpToFree uintptr FpUpsertIdx uintptr FpUpsertSrc uintptr FregData int32 @@ -41875,7 +43088,7 @@ type Upsert1 = struct { _ [4]byte } /* sqlite3.h:249:9 */ -type Upsert = Upsert1 /* sqliteInt.h:1150:23 */ +type Upsert = Upsert1 /* sqliteInt.h:1181:23 */ type VTable1 = struct { Fdb uintptr FpMod uintptr @@ -41889,7 +43102,7 @@ type VTable1 = struct { FpNext uintptr } /* sqlite3.h:249:9 */ -type VTable = VTable1 /* sqliteInt.h:1151:23 */ +type VTable = VTable1 /* sqliteInt.h:1182:23 */ type Walker1 = struct { FpParse uintptr FxExprCallback uintptr @@ -41899,9 +43112,9 @@ type Walker1 = struct { FeCode u16 _ [2]byte Fu struct{ FpNC uintptr } -} /* sqliteInt.h:1153:9 */ +} /* sqliteInt.h:1142:9 */ -type Walker = Walker1 /* sqliteInt.h:1153:23 */ +type Walker = Walker1 /* sqliteInt.h:1184:23 */ type Window1 = struct { FzName uintptr FzBase uintptr @@ -41935,27 +43148,22 @@ type Window1 = struct { _ [3]byte } /* sqlite3.h:249:9 */ -type Window = Window1 /* sqliteInt.h:1155:23 */ +type Window = Window1 /* sqliteInt.h:1186:23 */ type With1 = struct { FnCte int32 _ [4]byte FpOuter uintptr - Fa [1]struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - } + Fa [1]Cte } /* sqlite3.h:249:9 */ -type With = With1 /* sqliteInt.h:1156:21 */ +type With = With1 /* sqliteInt.h:1187:21 */ // The bitmask datatype defined below is used for various optimizations. // // Changing this from a 64-bit to a 32-bit type limits the number of // tables in a join to 32 instead of 64. But it also reduces the size // of the library by 738 bytes on ix86. -type Bitmask = u64 /* sqliteInt.h:1169:15 */ +type Bitmask = u64 /* sqliteInt.h:1200:15 */ // The number of bits in a Bitmask. "BMS" means "BitMask Size". @@ -41966,7 +43174,7 @@ type Bitmask = u64 /* sqliteInt.h:1169:15 */ // variable number associated with that parameter. See the format description // on the sqlite3VListAdd() routine for more information. A VList is really // just an array of integers. -type VList = int32 /* sqliteInt.h:1191:13 */ +type VList = int32 /* sqliteInt.h:1222:13 */ // Defer sourcing vdbe.h and btree.h until after the "u8" and // "BusyHandler" typedefs. vdbe.h also requires a few of the opaque @@ -42105,6 +43313,8 @@ type BtShared1 = struct { FpLock uintptr FpWriter uintptr FpTmpSpace uintptr + FnPreformatSize int32 + _ [4]byte } /* btree.h:39:9 */ type BtreePayload1 = struct { @@ -42166,7 +43376,7 @@ type Vdbe1 = struct { FpParse uintptr FnVar ynVar _ [2]byte - Fmagic u322 + FiVdbeMagic u322 FnMem int32 FnCursor int32 FcacheCtr u322 @@ -42365,11 +43575,14 @@ type RecordCompare = uintptr /* vdbe.h:286:13 */ type PgHdr = PgHdr1 /* pcache.h:18:22 */ // typedef for the authorization callback function. -type sqlite3_xauth = uintptr /* sqliteInt.h:1437:15 */ +type sqlite3_xauth = uintptr /* sqliteInt.h:1468:15 */ // This is an extra SQLITE_TRACE macro that indicates "legacy" tracing // in the style of sqlite3_trace() +// Maximum number of sqlite3.aDb[] entries. This is the number of attached +// databases plus 2 for "main" and "temp". + // Each database connection is an instance of the following structure. type sqlite3InitInfo = struct { FnewTnum Pgno @@ -42391,8 +43604,9 @@ type sqlite3InitInfo = struct { // // Constraints: // -// TF_HasVirtual == COLFLAG_Virtual -// TF_HasStored == COLFLAG_Stored +// TF_HasVirtual == COLFLAG_VIRTUAL +// TF_HasStored == COLFLAG_STORED +// TF_HasHidden == COLFLAG_HIDDEN // Test to see whether or not a table is a virtual table. This is // done as a macro so that it will be optimized out when virtual @@ -42484,14 +43698,14 @@ type AggInfo_func = struct { // need more than about 10 or 20 variables. But some extreme users want // to have prepared statements with over 32766 variables, and for them // the option is available (at compile-time). -type ynVar = i16 /* sqliteInt.h:2566:13 */ +type ynVar = i16 /* sqliteInt.h:2622:13 */ // The following are the meanings of bits in the Expr.flags field. // Value restrictions: // // EP_Agg == NC_HasAgg == SF_HasAgg // EP_Win == NC_HasWin -// 0x020000 // available for reuse +// 0x400000 // Available // 0x80000000 // Available // The EP_Propagate mask is a set of properties that automatically propagate @@ -42574,68 +43788,8 @@ type IdList_item = struct { _ [4]byte } /* sqlite3.h:249:9 */ -// The following structure describes the FROM clause of a SELECT statement. -// Each table or subquery in the FROM clause is a separate element of -// the SrcList.a[] array. -// -// With the addition of multiple database support, the following structure -// can also be used to describe a particular table such as the table that -// is modified by an INSERT, DELETE, or UPDATE statement. In standard SQL, -// such a table must be a simple name: ID. But in SQLite, the table can -// now be identified by a database name, a dot, then the table name: ID.ID. -// -// The jointype starts out showing the join type between the current table -// and the next table on the list. The parser builds the list this way. -// But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -// jointype expresses the join between the table and the previous table. -// -// In the colUsed field, the high-order bit (bit 63) is set if the table -// contains more than 63 columns and the 64-th or later column is used. -type SrcList_item = struct { - FpSchema uintptr - FzDatabase uintptr - FzName uintptr - FzAlias uintptr - FpTab uintptr - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 - Ffg struct { - _ [0]uint32 - Fjointype u8 - _ [3]byte - FnotIndexed uint8 /* unsigned notIndexed: 1, unsigned isIndexedBy: 1, unsigned isTabFunc: 1, unsigned isCorrelated: 1, unsigned viaCoroutine: 1, unsigned isRecursive: 1, unsigned fromDDL: 1 */ - _ [3]byte - } - FiCursor int32 - FpOn uintptr - FpUsing uintptr - FcolUsed Bitmask - Fu1 struct{ FzIndexedBy uintptr } - FpIBIndex uintptr -} /* sqlite3.h:249:9 */ - // The yDbMask datatype for the bitmask of all attached databases. -type yDbMask = uint32 /* sqliteInt.h:3297:24 */ - -// The following structure contains information used by the sqliteFix... -// routines as they walk the parse tree to make database references -// explicit. -type DbFixer1 = struct { - FpParse uintptr - FpSchema uintptr - FbTemp u8 - _ [7]byte - FzDb uintptr - FzType uintptr - FpName uintptr -} /* sqliteInt.h:3596:9 */ - -// The following structure contains information used by the sqliteFix... -// routines as they walk the parse tree to make database references -// explicit. -type DbFixer = DbFixer1 /* sqliteInt.h:3596:24 */ +type yDbMask = uint32 /* sqliteInt.h:3375:24 */ // A pointer to this structure is used to communicate information // from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback. @@ -42648,7 +43802,7 @@ type InitData = struct { FnInitRow u322 FmxPage Pgno _ [4]byte -} /* sqliteInt.h:3638:3 */ +} /* sqliteInt.h:3733:3 */ // Allowed values for mInitFlags @@ -42701,19 +43855,7 @@ type Sqlite3Config = struct { FiOnceResetThreshold int32 FszSorterRef u322 FiPrngSeed uint32 -} /* sqliteInt.h:3650:1 */ - -// Return code from the parse-tree walking primitives and their -// callbacks. - -// An instance of this structure represents a set of one or more CTEs -// (common table expressions) created by a single WITH clause. -type Cte = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr -} /* sqlite3.h:249:9 */ +} /* sqliteInt.h:3746:1 */ // 2003 September 6 // @@ -42774,8 +43916,10 @@ type VdbeCursor1 = struct { FdeferredMoveto u8 FisTable u8 _ [3]byte - FisEphemeral uint8 /* Bool isEphemeral: 1, Bool useRandomRowid: 1, Bool isOrdered: 1, Bool seekHit: 1 */ - _ [7]byte + FisEphemeral uint8 /* Bool isEphemeral: 1, Bool useRandomRowid: 1, Bool isOrdered: 1 */ + _ [1]byte + FseekHit u16 + _ [4]byte FpBtx uintptr FseqCount i64 FaAltMap uintptr @@ -42981,16 +44125,16 @@ func get_sqlite_pointer(tls *libc.TLS, clientData uintptr, interp uintptr, objc // var zBuf [100]int8 at bp+112, 100 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14343 /* "SQLITE-CONNECTIO..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14523 /* "SQLITE-CONNECTIO..." */) return TCL_ERROR } if !(tcl.XTcl_GetCommandInfo(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+48 /* &cmdInfo */) != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14361, /* "command not foun..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14541, /* "command not foun..." */ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0))) return TCL_ERROR } p = (*Tcl_CmdInfo)(unsafe.Pointer(bp + 48 /* &cmdInfo */)).FobjClientData - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+112 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+24, (*struct{ Fdb uintptr })(unsafe.Pointer(p)).Fdb)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+112 /* &zBuf[0] */, ts+13023 /* "%p" */, libc.VaList(bp+24, (*struct{ Fdb uintptr })(unsafe.Pointer(p)).Fdb)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, bp+112 /* &zBuf[0] */, 0)) return TCL_OK } @@ -43027,7 +44171,7 @@ func sqlite3TestErrCode(tls *libc.TLS, interp uintptr, db uintptr, rc int32) int var r2 int32 = sqlite3.Xsqlite3_errcode(tls, db) sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+48, /* &zBuf[0] */ - ts+14381, /* "error code %s (%..." */ + ts+14561, /* "error code %s (%..." */ libc.VaList(bp, sqlite3.Xsqlite3ErrName(tls, rc), rc, sqlite3.Xsqlite3ErrName(tls, r2), r2)) tcl.XTcl_ResetResult(tls, interp) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, bp+48 /* &zBuf[0] */, 0)) @@ -43057,7 +44201,7 @@ func sqlite3TestMakePointerStr(tls *libc.TLS, interp uintptr, zPtr uintptr, p ui bp := tls.Alloc(8) defer tls.Free(8) - sqlite3.Xsqlite3_snprintf(tls, 100, zPtr, ts+12843 /* "%p" */, libc.VaList(bp, p)) + sqlite3.Xsqlite3_snprintf(tls, 100, zPtr, ts+13023 /* "%p" */, libc.VaList(bp, p)) return TCL_OK } @@ -43072,7 +44216,7 @@ func exec_printf_cb(tls *libc.TLS, pArg uintptr, argc int32, argv uintptr, name if *(*uintptr)(unsafe.Pointer(name + uintptr(i)*8)) != 0 { return *(*uintptr)(unsafe.Pointer(name + uintptr(i)*8)) } - return ts + 5537 /* "NULL" */ + return ts + 5717 /* "NULL" */ }()) } } @@ -43081,7 +44225,7 @@ func exec_printf_cb(tls *libc.TLS, pArg uintptr, argc int32, argv uintptr, name if *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) != 0 { return *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) } - return ts + 5537 /* "NULL" */ + return ts + 5717 /* "NULL" */ }()) } return 0 @@ -43106,7 +44250,7 @@ func test_io_trace(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, a // Also return true if the OMIT_MISUSE environment variable exists. func clang_sanitize_address(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:269:26: */ var res int32 = 0 - if (res == 0) && (libc.Xgetenv(tls, ts+14439 /* "OMIT_MISUSE" */) != uintptr(0)) { + if (res == 0) && (libc.Xgetenv(tls, ts+14619 /* "OMIT_MISUSE" */) != uintptr(0)) { res = 1 } tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, res)) @@ -43132,8 +44276,8 @@ func test_exec_printf(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32 // var zBuf [30]int8 at bp+280, 30 if argc != 4 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14477 /* " DB FORMAT STRIN..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14657 /* " DB FORMAT STRIN..." */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+48 /* &db */) != 0 { @@ -43145,7 +44289,7 @@ func test_exec_printf(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32 f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 }{exec_printf_cb})), bp+56 /* &str */, bp+272 /* &zErr */) sqlite3.Xsqlite3_free(tls, zSql) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+280 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+40, rc)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+280 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+40, rc)) tcl.XTcl_AppendElement(tls, interp, bp+280 /* &zBuf[0] */) tcl.XTcl_AppendElement(tls, interp, func() uintptr { if rc == SQLITE_OK { @@ -43186,8 +44330,8 @@ func test_exec_hex(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, a // var zBuf [30]int8 at bp+776, 30 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14495 /* " DB HEX" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14675 /* " DB HEX" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+40 /* &db */) != 0 { @@ -43221,7 +44365,7 @@ __3: rc = sqlite3.Xsqlite3_exec(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* db */)), bp+48 /* &zSql[0] */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 }{exec_printf_cb})), bp+552 /* &str */, bp+768 /* &zErr */) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+776 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, rc)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+776 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+32, rc)) tcl.XTcl_AppendElement(tls, interp, bp+776 /* &zBuf[0] */) tcl.XTcl_AppendElement(tls, interp, func() uintptr { if rc == SQLITE_OK { @@ -43250,8 +44394,8 @@ func db_enter(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv u // var db uintptr at bp+32, 8 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14503 /* " DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14683 /* " DB" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+32 /* &db */) != 0 { @@ -43268,8 +44412,8 @@ func db_leave(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv u // var db uintptr at bp+32, 8 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14503 /* " DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14683 /* " DB" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+32 /* &db */) != 0 { @@ -43298,8 +44442,8 @@ func test_exec(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv // var zBuf [30]int8 at bp+280, 30 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14507 /* " DB SQL" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14687 /* " DB SQL" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+48 /* &db */) != 0 { @@ -43320,7 +44464,7 @@ func test_exec(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 }{exec_printf_cb})), bp+56 /* &str */, bp+272 /* &zErr */) sqlite3.Xsqlite3_free(tls, zSql) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+280 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+40, rc)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+280 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+40, rc)) tcl.XTcl_AppendElement(tls, interp, bp+280 /* &zBuf[0] */) tcl.XTcl_AppendElement(tls, interp, func() uintptr { if rc == SQLITE_OK { @@ -43351,8 +44495,8 @@ func test_exec_nr(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, ar var rc int32 *(*uintptr)(unsafe.Pointer(bp + 40 /* zErr */)) = uintptr(0) if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14507 /* " DB SQL" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14687 /* " DB SQL" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+32 /* &db */) != 0 { @@ -43378,7 +44522,7 @@ func test_mprintf_z(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, var i int32 for i = 2; (i < argc) && ((i == 2) || (zResult != 0)); i++ { - zResult = sqlite3.Xsqlite3_mprintf(tls, ts+14515 /* "%z%s%s" */, libc.VaList(bp, zResult, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + zResult = sqlite3.Xsqlite3_mprintf(tls, ts+14695 /* "%z%s%s" */, libc.VaList(bp, zResult, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, zResult, 0)) sqlite3.Xsqlite3_free(tls, zResult) @@ -43395,7 +44539,7 @@ func test_mprintf_n(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, var zStr uintptr *(*int32)(unsafe.Pointer(bp + 16 /* n */)) = 0 - zStr = sqlite3.Xsqlite3_mprintf(tls, ts+14522 /* "%s%n" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+16 /* &n */)) + zStr = sqlite3.Xsqlite3_mprintf(tls, ts+14702 /* "%s%n" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+16 /* &n */)) sqlite3.Xsqlite3_free(tls, zStr) tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 16 /* n */)))) return TCL_OK @@ -43421,7 +44565,7 @@ func test_snprintf_int(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 if uint64(n) > uint64(unsafe.Sizeof([100]int8{})) { n = int32(unsafe.Sizeof([100]int8{})) } - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+24 /* &zStr[0] */, ts+14527 /* "abcdefghijklmnop..." */, 0) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+24 /* &zStr[0] */, ts+14707 /* "abcdefghijklmnop..." */, 0) sqlite3.Xsqlite3_snprintf(tls, n, bp+24 /* &zStr[0] */, zFormat, libc.VaList(bp, a1)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+8, bp+24 /* &zStr[0] */, 0)) return TCL_OK @@ -43457,8 +44601,8 @@ func test_get_table_printf(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc } } if (argc != 4) && (argc != 5) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14554 /* " DB FORMAT STRIN..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14734 /* " DB FORMAT STRIN..." */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+72 /* &db */) != 0 { @@ -43473,13 +44617,13 @@ func test_get_table_printf(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc *(*int32)(unsafe.Pointer(bp + 64 /* resCount */)) = ((*(*int32)(unsafe.Pointer(bp + 312 /* nRow */)) + 1) * *(*int32)(unsafe.Pointer(bp + 316 /* nCol */))) } sqlite3.Xsqlite3_free(tls, zSql) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+320 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+40, rc)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+320 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+40, rc)) tcl.XTcl_AppendElement(tls, interp, bp+320 /* &zBuf[0] */) if rc == SQLITE_OK { if argc == 4 { - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+320 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 312 /* nRow */)))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+320 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 312 /* nRow */)))) tcl.XTcl_AppendElement(tls, interp, bp+320 /* &zBuf[0] */) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+320 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(bp + 316 /* nCol */)))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+320 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(bp + 316 /* nCol */)))) tcl.XTcl_AppendElement(tls, interp, bp+320 /* &zBuf[0] */) } for i = 0; i < *(*int32)(unsafe.Pointer(bp + 64 /* resCount */)); i++ { @@ -43487,7 +44631,7 @@ func test_get_table_printf(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc if *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 /* aResult */)) + uintptr(i)*8)) != 0 { return *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 /* aResult */)) + uintptr(i)*8)) } - return ts + 5537 /* "NULL" */ + return ts + 5717 /* "NULL" */ }()) } } else { @@ -43515,13 +44659,13 @@ func test_last_rowid(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, // var zBuf [30]int8 at bp+64, 30 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), ts+14580 /* " DB\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), ts+14760 /* " DB\"" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+56 /* &db */) != 0 { return TCL_ERROR } - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+64 /* &zBuf[0] */, ts+10367 /* "%lld" */, libc.VaList(bp+32, sqlite3.Xsqlite3_last_insert_rowid(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */))))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+64 /* &zBuf[0] */, ts+10547 /* "%lld" */, libc.VaList(bp+32, sqlite3.Xsqlite3_last_insert_rowid(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */))))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+64 /* &zBuf[0] */, 0)) return SQLITE_OK } @@ -43551,8 +44695,8 @@ func sqlite_test_close(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 var rc int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14585 /* " FILENAME\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14765 /* " FILENAME\"" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+32 /* &db */) != 0 { @@ -43574,8 +44718,8 @@ func sqlite_test_close_v2(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc i var rc int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14585 /* " FILENAME\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14765 /* " FILENAME\"" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+32 /* &db */) != 0 { @@ -43613,7 +44757,7 @@ func hex8Func(tls *libc.TLS, p uintptr, argc int32, argv uintptr) { /* test1.c:7 z = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) for i = 0; (uint64(i) < ((uint64(unsafe.Sizeof([200]int8{})) / uint64(2)) - uint64(2))) && (*(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0); i++ { - sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof([200]int8{})) - (uint64(i * 2)))), (bp + 8 /* &zBuf */ + uintptr((i * 2))), ts+14596 /* "%02x" */, libc.VaList(bp, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) + sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof([200]int8{})) - (uint64(i * 2)))), (bp + 8 /* &zBuf */ + uintptr((i * 2))), ts+14776 /* "%02x" */, libc.VaList(bp, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) } *(*int8)(unsafe.Pointer(bp + 8 /* &zBuf[0] */ + uintptr((i * 2)))) = int8(0) sqlite3.Xsqlite3_result_text(tls, p, bp+8 /* zBuf */, -1, libc.UintptrFromInt32(-1)) @@ -43629,7 +44773,7 @@ func hex16Func(tls *libc.TLS, p uintptr, argc int32, argv uintptr) { /* test1.c: z = sqlite3.Xsqlite3_value_text16(tls, *(*uintptr)(unsafe.Pointer(argv))) for i = 0; (uint64(i) < ((uint64(unsafe.Sizeof([400]int8{})) / uint64(4)) - uint64(4))) && (*(*uint16)(unsafe.Pointer(z + uintptr(i)*2)) != 0); i++ { - sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof([400]int8{})) - (uint64(i * 4)))), (bp + 8 /* &zBuf */ + uintptr((i * 4))), ts+14601 /* "%04x" */, libc.VaList(bp, (int32(*(*uint16)(unsafe.Pointer(z + uintptr(i)*2)))&0xff))) + sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof([400]int8{})) - (uint64(i * 4)))), (bp + 8 /* &zBuf */ + uintptr((i * 4))), ts+14781 /* "%04x" */, libc.VaList(bp, (int32(*(*uint16)(unsafe.Pointer(z + uintptr(i)*2)))&0xff))) } *(*int8)(unsafe.Pointer(bp + 8 /* &zBuf[0] */ + uintptr((i * 4)))) = int8(0) sqlite3.Xsqlite3_result_text(tls, p, bp+8 /* zBuf */, -1, libc.UintptrFromInt32(-1)) @@ -43669,7 +44813,7 @@ func execFuncCallback(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, No var i int32 for i = 0; i < argc; i++ { if *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) == uintptr(0) { - dstrAppend(tls, p, ts+5537 /* "NULL" */, ' ') + dstrAppend(tls, p, ts+5717 /* "NULL" */, ' ') } else { dstrAppend(tls, p, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ' ') } @@ -43728,7 +44872,7 @@ func tkt2213Function(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { zText3 = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if (zText1 != zText2) || (zText2 != zText3) { - sqlite3.Xsqlite3_result_error(tls, context, ts+14606 /* "tkt2213 is not f..." */, -1) + sqlite3.Xsqlite3_result_error(tls, context, ts+14786 /* "tkt2213 is not f..." */, -1) } else { var zCopy uintptr = sqlite3.Xsqlite3_malloc(tls, nText) libc.Xmemcpy(tls, zCopy, zText1, uint64(nText)) @@ -43769,11 +44913,11 @@ func ptrChngFunction(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if zCmd == uintptr(0) { return } - if libc.Xstrcmp(tls, zCmd, ts+12275 /* "text" */) == 0 { + if libc.Xstrcmp(tls, zCmd, ts+12455 /* "text" */) == 0 { p1 = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - } else if libc.Xstrcmp(tls, zCmd, ts+14627 /* "text16" */) == 0 { + } else if libc.Xstrcmp(tls, zCmd, ts+14807 /* "text16" */) == 0 { p1 = sqlite3.Xsqlite3_value_text16(tls, *(*uintptr)(unsafe.Pointer(argv))) - } else if libc.Xstrcmp(tls, zCmd, ts+12280 /* "blob" */) == 0 { + } else if libc.Xstrcmp(tls, zCmd, ts+12460 /* "blob" */) == 0 { p1 = sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) } else { return @@ -43782,11 +44926,11 @@ func ptrChngFunction(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if zCmd == uintptr(0) { return } - if libc.Xstrcmp(tls, zCmd, ts+14634 /* "bytes" */) == 0 { + if libc.Xstrcmp(tls, zCmd, ts+14814 /* "bytes" */) == 0 { sqlite3.Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) - } else if libc.Xstrcmp(tls, zCmd, ts+14640 /* "bytes16" */) == 0 { + } else if libc.Xstrcmp(tls, zCmd, ts+14820 /* "bytes16" */) == 0 { sqlite3.Xsqlite3_value_bytes16(tls, *(*uintptr)(unsafe.Pointer(argv))) - } else if libc.Xstrcmp(tls, zCmd, ts+14648 /* "noop" */) == 0 { + } else if libc.Xstrcmp(tls, zCmd, ts+14828 /* "noop" */) == 0 { // do nothing } else { return @@ -43795,11 +44939,11 @@ func ptrChngFunction(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if zCmd == uintptr(0) { return } - if libc.Xstrcmp(tls, zCmd, ts+12275 /* "text" */) == 0 { + if libc.Xstrcmp(tls, zCmd, ts+12455 /* "text" */) == 0 { p2 = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - } else if libc.Xstrcmp(tls, zCmd, ts+14627 /* "text16" */) == 0 { + } else if libc.Xstrcmp(tls, zCmd, ts+14807 /* "text16" */) == 0 { p2 = sqlite3.Xsqlite3_value_text16(tls, *(*uintptr)(unsafe.Pointer(argv))) - } else if libc.Xstrcmp(tls, zCmd, ts+12280 /* "blob" */) == 0 { + } else if libc.Xstrcmp(tls, zCmd, ts+12460 /* "blob" */) == 0 { p2 = sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) } else { return @@ -43847,37 +44991,37 @@ func test_create_function(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc i // var db uintptr at bp+32, 8 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14580 /* " DB\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14760 /* " DB\"" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+32 /* &db */) != 0 { return TCL_ERROR } - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14653 /* "x_coalesce" */, -1, SQLITE_UTF8, uintptr(0), + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14833 /* "x_coalesce" */, -1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{t1_ifnullFunc})), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14664 /* "hex8" */, 1, (SQLITE_UTF8 | SQLITE_DETERMINISTIC), + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14844 /* "hex8" */, 1, (SQLITE_UTF8 | SQLITE_DETERMINISTIC), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{hex8Func})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14669 /* "hex16" */, 1, (SQLITE_UTF16 | SQLITE_DETERMINISTIC), + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14849 /* "hex16" */, 1, (SQLITE_UTF16 | SQLITE_DETERMINISTIC), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{hex16Func})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14675 /* "tkt2213func" */, 1, SQLITE_ANY, uintptr(0), + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14855 /* "tkt2213func" */, 1, SQLITE_ANY, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{tkt2213Function})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14687 /* "pointer_change" */, 4, SQLITE_ANY, uintptr(0), + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14867 /* "pointer_change" */, 4, SQLITE_ANY, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{ptrChngFunction})), uintptr(0), uintptr(0)) @@ -43887,13 +45031,13 @@ func test_create_function(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc i // both return an ascending integer with each call. But counter1() is marked // as non-deterministic and counter2() is marked as deterministic. if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14702 /* "counter1" */, -1, SQLITE_UTF8, + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14882 /* "counter1" */, -1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{nondeterministicFunction})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14711 /* "counter2" */, -1, (SQLITE_UTF8 | SQLITE_DETERMINISTIC), + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14891 /* "counter2" */, -1, (SQLITE_UTF8 | SQLITE_DETERMINISTIC), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{nondeterministicFunction})), uintptr(0), uintptr(0)) @@ -43902,7 +45046,7 @@ func test_create_function(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc i // The intreal() function converts its argument to an integer and returns // it as a MEM_IntReal. if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14720 /* "intreal" */, 1, SQLITE_UTF8, + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14900 /* "intreal" */, 1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{intrealFunction})), uintptr(0), uintptr(0)) @@ -43915,8 +45059,8 @@ func test_create_function(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc i var pVal uintptr sqlite3.Xsqlite3_mutex_enter(tls, (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).Fmutex) pVal = sqlite3.Xsqlite3ValueNew(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */))) - sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, ts+14728 /* "x_sqlite_exec" */, SQLITE_UTF8, uintptr(0)) - zUtf16 = sqlite3.Xsqlite3ValueText(tls, pVal, SQLITE_UTF16LE) + sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, ts+14908 /* "x_sqlite_exec" */, uint8(SQLITE_UTF8), uintptr(0)) + zUtf16 = sqlite3.Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE)) if (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).FmallocFailed != 0 { rc = SQLITE_NOMEM } else { @@ -43948,8 +45092,8 @@ func test_drop_modules(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 // var db uintptr at bp+32, 8 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14580 /* " DB\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14760 /* " DB\"" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+32 /* &db */) != 0 { @@ -43998,7 +45142,7 @@ func t1CountStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* if argc > 0 { var v int32 = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))) if v == 40 { - sqlite3.Xsqlite3_result_error(tls, context, ts+14742 /* "value of 40 hand..." */, -1) + sqlite3.Xsqlite3_result_error(tls, context, ts+14922 /* "value of 40 hand..." */, -1) } else if v == 41 { *(*[9]int8)(unsafe.Pointer(bp /* zUtf16ErrMsg */)) = [9]int8{int8(0), int8(0x61), int8(0), int8(0x62), int8(0), int8(0x63), int8(0), int8(0), int8(0)} sqlite3.Xsqlite3_result_error16(tls, context, (bp /* &zUtf16ErrMsg */ + 1), -1) @@ -44011,7 +45155,7 @@ func t1CountFinalize(tls *libc.TLS, context uintptr) { /* test1.c:1149:13: */ p = sqlite3.Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(t1CountCtx{}))) if p != 0 { if (*t1CountCtx)(unsafe.Pointer(p)).Fn == 42 { - sqlite3.Xsqlite3_result_error(tls, context, ts+14772 /* "x_count totals t..." */, -1) + sqlite3.Xsqlite3_result_error(tls, context, ts+14952 /* "x_count totals t..." */, -1) } else { sqlite3.Xsqlite3_result_int(tls, context, func() int32 { if p != 0 { @@ -44056,25 +45200,25 @@ func test_create_aggregate(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc var rc int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14585 /* " FILENAME\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14765 /* " FILENAME\"" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+32 /* &db */) != 0 { return TCL_ERROR } - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14793 /* "x_count" */, 0, SQLITE_UTF8, uintptr(0), uintptr(0), + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14973 /* "x_count" */, 0, SQLITE_UTF8, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{t1CountStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{t1CountFinalize}))) if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14793 /* "x_count" */, 1, SQLITE_UTF8, uintptr(0), uintptr(0), + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14973 /* "x_count" */, 1, SQLITE_UTF8, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{t1CountStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{t1CountFinalize}))) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14801 /* "legacy_count" */, 0, SQLITE_ANY, uintptr(0), uintptr(0), + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14981 /* "legacy_count" */, 0, SQLITE_ANY, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{legacyCountStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{legacyCountFinalize}))) @@ -44097,11 +45241,11 @@ func test_printf(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, arg defer tls.Free(40) if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14814 /* " TEXT\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14994 /* " TEXT\"" */, 0)) return TCL_ERROR } - libc.Xprintf(tls, ts+293 /* "%s\n" */, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) + libc.Xprintf(tls, ts+294 /* "%s\n" */, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) return TCL_OK } @@ -44117,8 +45261,8 @@ func sqlite3_mprintf_int(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc in var i int32 var z uintptr if argc != 5 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14821 /* " FORMAT INT INT ..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+15001 /* " FORMAT INT INT ..." */, 0)) return TCL_ERROR } for i = 2; i < 5; i++ { @@ -44144,13 +45288,13 @@ func sqlite3_mprintf_int64(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc var z uintptr if argc != 5 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14821 /* " FORMAT INT INT ..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+15001 /* " FORMAT INT INT ..." */, 0)) return TCL_ERROR } for i = 2; i < 5; i++ { - if sqlite3.Xsqlite3Atoi64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), (bp+88 /* &a */ +uintptr((i-2))*8), sqlite3.Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))), SQLITE_UTF8) != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+14842 /* "argument is not ..." */, 0)) + if sqlite3.Xsqlite3Atoi64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), (bp+88 /* &a */ +uintptr((i-2))*8), sqlite3.Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))), uint8(SQLITE_UTF8)) != 0 { + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+15022 /* "argument is not ..." */, 0)) return TCL_ERROR } } @@ -44176,8 +45320,8 @@ func sqlite3_mprintf_long(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc i var z uintptr if argc != 5 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14821 /* " FORMAT INT INT ..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+15001 /* " FORMAT INT INT ..." */, 0)) return TCL_ERROR } for i = 2; i < 5; i++ { @@ -44205,8 +45349,8 @@ func sqlite3_mprintf_str(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc in var i int32 var z uintptr if (argc < 4) || (argc > 5) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14881 /* " FORMAT INT INT ..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+15061 /* " FORMAT INT INT ..." */, 0)) return TCL_ERROR } for i = 2; i < 4; i++ { @@ -44239,15 +45383,15 @@ func sqlite3_snprintf_str(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc i var z uintptr if (argc < 5) || (argc > 6) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14907 /* " INT FORMAT INT ..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+15087 /* " INT FORMAT INT ..." */, 0)) return TCL_ERROR } if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+88 /* &n */) != 0 { return TCL_ERROR } if *(*int32)(unsafe.Pointer(bp + 88 /* n */)) < 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+14937 /* "N must be non-ne..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+15117 /* "N must be non-ne..." */, 0)) return TCL_ERROR } for i = 3; i < 5; i++ { @@ -44281,8 +45425,8 @@ func sqlite3_mprintf_double(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc var z uintptr if argc != 5 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14960 /* " FORMAT INT INT ..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+15140 /* " FORMAT INT INT ..." */, 0)) return TCL_ERROR } for i = 2; i < 4; i++ { @@ -44313,8 +45457,8 @@ func sqlite3_mprintf_scaled(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc var z uintptr if argc != 4 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14984 /* " FORMAT DOUBLE D..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+15164 /* " FORMAT DOUBLE D..." */, 0)) return TCL_ERROR } for i = 2; i < 4; i++ { @@ -44339,8 +45483,8 @@ func sqlite3_mprintf_stronly(tls *libc.TLS, NotUsed uintptr, interp uintptr, arg var z uintptr if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+15007 /* " FORMAT STRING\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+15187 /* " FORMAT STRING\"" */, 0)) return TCL_ERROR } z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) @@ -44367,12 +45511,12 @@ func sqlite3_mprintf_hexdouble(tls *libc.TLS, NotUsed uintptr, interp uintptr, a // var d sqlite_uint64 at bp+104, 8 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+15007 /* " FORMAT STRING\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+15187 /* " FORMAT STRING\"" */, 0)) return TCL_ERROR } - if libc.Xsscanf(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ts+15023 /* "%08x%08x" */, libc.VaList(bp+32, bp+88 /* &x2 */, bp+92 /* &x1 */)) != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+15032 /* "2nd argument sho..." */, 0)) + if libc.Xsscanf(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ts+15203 /* "%08x%08x" */, libc.VaList(bp+32, bp+88 /* &x2 */, bp+92 /* &x1 */)) != 2 { + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+15212 /* "2nd argument sho..." */, 0)) return TCL_ERROR } *(*sqlite_uint64)(unsafe.Pointer(bp + 104 /* d */)) = sqlite_uint64(*(*uint32)(unsafe.Pointer(bp + 88 /* x2 */))) @@ -44396,7 +45540,7 @@ func test_enable_shared(tls *libc.TLS, clientData ClientData, interp uintptr, ob var ret int32 = 0 if (objc != 2) && (objc != 1) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2760 /* "?BOOLEAN?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2761 /* "?BOOLEAN?" */) return TCL_ERROR } ret = sqlite3.Xsqlite3Config.FsharedCacheEnabled @@ -44426,7 +45570,7 @@ func test_extended_result_codes(tls *libc.TLS, clientData ClientData, interp uin // var db uintptr at bp, 8 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15076 /* "DB BOOLEAN" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15256 /* "DB BOOLEAN" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { @@ -44470,7 +45614,7 @@ func test_table_column_metadata(tls *libc.TLS, clientData ClientData, interp uin // var autoincrement int32 at bp+48, 4 if (objc != 5) && (objc != 4) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15087 /* "DB dbname tblnam..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15267 /* "DB dbname tblnam..." */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+16 /* &db */) != 0 { @@ -44549,7 +45693,7 @@ func test_blob_reopen(tls *libc.TLS, clientData ClientData, interp uintptr, objc var rc int32 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15113 /* "CHANNEL ROWID" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15293 /* "CHANNEL ROWID" */) return TCL_ERROR } @@ -44644,7 +45788,7 @@ func test_create_collation_v2(tls *libc.TLS, clientData ClientData, interp uintp var rc int32 if objc != 5 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15127 /* "DB-HANDLE NAME C..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15307 /* "DB-HANDLE NAME C..." */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+16 /* &db */) != 0 { @@ -44664,7 +45808,7 @@ func test_create_collation_v2(tls *libc.TLS, clientData ClientData, interp uintp }{testCreateCollationCmp})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testCreateCollationDel}))) if rc != SQLITE_MISUSE { tcl.XTcl_AppendResult(tls, interp, - libc.VaList(bp, ts+15160 /* "sqlite3_create_c..." */, uintptr(0))) + libc.VaList(bp, ts+15340 /* "sqlite3_create_c..." */, uintptr(0))) return TCL_ERROR } rc = sqlite3.Xsqlite3_create_collation_v2(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), SQLITE_UTF8, @@ -44770,16 +45914,16 @@ func test_create_function_v2(tls *libc.TLS, clientData ClientData, interp uintpt var rc int32 *(*[6]EncTable)(unsafe.Pointer(bp + 32 /* aEnc */)) = [6]EncTable{ - {FzEnc: ts + 15225 /* "utf8" */, Fenc: SQLITE_UTF8}, - {FzEnc: ts + 15230 /* "utf16" */, Fenc: SQLITE_UTF16}, - {FzEnc: ts + 15236 /* "utf16le" */, Fenc: SQLITE_UTF16LE}, - {FzEnc: ts + 15244 /* "utf16be" */, Fenc: SQLITE_UTF16BE}, - {FzEnc: ts + 12285 /* "any" */, Fenc: SQLITE_ANY}, - {FzEnc: ts + 13695 /* "0" */}, + {FzEnc: ts + 15405 /* "utf8" */, Fenc: SQLITE_UTF8}, + {FzEnc: ts + 15410 /* "utf16" */, Fenc: SQLITE_UTF16}, + {FzEnc: ts + 15416 /* "utf16le" */, Fenc: SQLITE_UTF16LE}, + {FzEnc: ts + 15424 /* "utf16be" */, Fenc: SQLITE_UTF16BE}, + {FzEnc: ts + 12465 /* "any" */, Fenc: SQLITE_ANY}, + {FzEnc: ts + 13875 /* "0" */}, } if (objc < 5) || ((objc % 2) == 0) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15252 /* "DB NAME NARG ENC..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15432 /* "DB NAME NARG ENC..." */) return TCL_ERROR } @@ -44791,7 +45935,7 @@ func test_create_function_v2(tls *libc.TLS, clientData ClientData, interp uintpt return TCL_ERROR } if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 4*8)), bp+32 /* &aEnc[0] */, int32(unsafe.Sizeof(EncTable{})), - ts+15281 /* "encoding" */, 0, bp+128 /* &enc */) != 0 { + ts+15461 /* "encoding" */, 0, bp+128 /* &enc */) != 0 { return TCL_ERROR } *(*int32)(unsafe.Pointer(bp + 128 /* enc */)) = (*EncTable)(unsafe.Pointer(bp + 32 /* &aEnc */ + uintptr(*(*int32)(unsafe.Pointer(bp + 128 /* enc */)))*16)).Fenc @@ -44804,8 +45948,8 @@ func test_create_function_v2(tls *libc.TLS, clientData ClientData, interp uintpt for i = 5; i < objc; i = i + (2) { // var iSwitch int32 at bp+176, 4 - *(*[5]uintptr)(unsafe.Pointer(bp + 136 /* azSwitch */)) = [5]uintptr{ts + 15290 /* "-func" */, ts + 15296 /* "-step" */, ts + 15302 /* "-final" */, ts + 15309 /* "-destroy" */, uintptr(0)} - if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+136 /* &azSwitch[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+15318 /* "switch" */, 0, bp+176 /* &iSwitch */) != 0 { + *(*[5]uintptr)(unsafe.Pointer(bp + 136 /* azSwitch */)) = [5]uintptr{ts + 15470 /* "-func" */, ts + 15476 /* "-step" */, ts + 15482 /* "-final" */, ts + 15489 /* "-destroy" */, uintptr(0)} + if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+136 /* &azSwitch[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+15498 /* "switch" */, 0, bp+176 /* &iSwitch */) != 0 { sqlite3.Xsqlite3_free(tls, p) return TCL_ERROR } @@ -44907,7 +46051,7 @@ func test_load_extension(tls *libc.TLS, clientData ClientData, interp uintptr, o var zErr uintptr = uintptr(0) if (objc != 4) && (objc != 3) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15325 /* "DB-HANDLE FILE ?..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15505 /* "DB-HANDLE FILE ?..." */) return TCL_ERROR } zDb = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -44918,7 +46062,7 @@ func test_load_extension(tls *libc.TLS, clientData ClientData, interp uintptr, o // Extract the C database handle from the Tcl command name if !(tcl.XTcl_GetCommandInfo(tls, interp, zDb, bp+24 /* &cmdInfo */) != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14361 /* "command not foun..." */, zDb, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14541 /* "command not foun..." */, zDb, uintptr(0))) return TCL_ERROR } db = (*struct{ Fdb uintptr })(unsafe.Pointer((*Tcl_CmdInfo)(unsafe.Pointer(bp + 24 /* &cmdInfo */)).FobjClientData)).Fdb @@ -44927,7 +46071,7 @@ func test_load_extension(tls *libc.TLS, clientData ClientData, interp uintptr, o // TCL_ERROR and load any error string into the interpreter. If no // error occurs, set rc to TCL_OK. rc = SQLITE_ERROR - zErr = sqlite3.Xsqlite3_mprintf(tls, ts+15347 /* "this build omits..." */, 0) + zErr = sqlite3.Xsqlite3_mprintf(tls, ts+15527 /* "this build omits..." */, 0) _ = zProc _ = zFile if rc != SQLITE_OK { @@ -44935,7 +46079,7 @@ func test_load_extension(tls *libc.TLS, clientData ClientData, interp uintptr, o if zErr != 0 { return zErr } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), uintptr(1)) rc = TCL_ERROR } else { @@ -44959,14 +46103,14 @@ func test_enable_load(tls *libc.TLS, clientData ClientData, interp uintptr, objc // var onoff int32 at bp+96, 4 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15389 /* "DB-HANDLE ONOFF" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15569 /* "DB-HANDLE ONOFF" */) return TCL_ERROR } zDb = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) // Extract the C database handle from the Tcl command name if !(tcl.XTcl_GetCommandInfo(tls, interp, zDb, bp+32 /* &cmdInfo */) != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14361 /* "command not foun..." */, zDb, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14541 /* "command not foun..." */, zDb, uintptr(0))) return TCL_ERROR } db = (*struct{ Fdb uintptr })(unsafe.Pointer((*Tcl_CmdInfo)(unsafe.Pointer(bp + 32 /* &cmdInfo */)).FobjClientData)).Fdb @@ -44976,7 +46120,7 @@ func test_enable_load(tls *libc.TLS, clientData ClientData, interp uintptr, objc return TCL_ERROR } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+15347 /* "this build omits..." */)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+15527 /* "this build omits..." */)) return TCL_ERROR } @@ -45003,38 +46147,38 @@ __1: if !(zArg0 != 0) { goto __3 } - if !(0 == sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+2437 /* "int" */)) { + if !(0 == sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+2438 /* "int" */)) { goto __5 } sqlite3.Xsqlite3_result_int(tls, context, sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) goto __6 __5: - if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+3787 /* "int64" */) == 0) { + if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+3844 /* "int64" */) == 0) { goto __7 } sqlite3.Xsqlite3_result_int64(tls, context, sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) goto __8 __7: - if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+15405 /* "string" */) == 0) { + if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+15585 /* "string" */) == 0) { goto __9 } sqlite3.Xsqlite3_result_text(tls, context, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))), -1, libc.UintptrFromInt32(-1)) goto __10 __9: - if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+2422 /* "double" */) == 0) { + if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+2423 /* "double" */) == 0) { goto __11 } sqlite3.Xsqlite3_result_double(tls, context, sqlite3.Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) goto __12 __11: - if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+7207 /* "null" */) == 0) { + if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+7387 /* "null" */) == 0) { goto __13 } sqlite3.Xsqlite3_result_null(tls, context) goto __14 __13: - if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+15412 /* "value" */) == 0) { + if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+15592 /* "value" */) == 0) { goto __15 } sqlite3.Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))*8))) @@ -45067,7 +46211,7 @@ __2: error_out: sqlite3.Xsqlite3_result_error(tls, context, - ts+15418 /* "first argument s..." */, -1) + ts+15598 /* "first argument s..." */, -1) } // Usage: sqlite_register_test_function DB NAME @@ -45081,8 +46225,8 @@ func test_register_func(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int var rc int32 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+15486 /* " DB FUNCTION-NAM..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+15666 /* " DB FUNCTION-NAM..." */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+48 /* &db */) != 0 { @@ -45115,8 +46259,8 @@ func test_finalize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 var db uintptr = uintptr(0) if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15504 /* " " */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15684 /* " " */, 0)) return TCL_ERROR } @@ -45151,7 +46295,7 @@ func test_stmt_status(tls *libc.TLS, clientData uintptr, interp uintptr, objc in // var pStmt uintptr at bp, 8 if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15512 /* "STMT PARAMETER R..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15692 /* "STMT PARAMETER R..." */) return TCL_ERROR } if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &pStmt */) != 0 { @@ -45190,13 +46334,13 @@ var aOp = [7]struct { Fop int32 _ [4]byte }{ - {FzName: ts + 15537 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_FULLSCAN_STEP}, - {FzName: ts + 15569 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_SORT}, - {FzName: ts + 15592 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_AUTOINDEX}, - {FzName: ts + 15620 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_VM_STEP}, - {FzName: ts + 15646 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_REPREPARE}, - {FzName: ts + 15674 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_RUN}, - {FzName: ts + 15696 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_MEMUSED}, + {FzName: ts + 15717 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_FULLSCAN_STEP}, + {FzName: ts + 15749 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_SORT}, + {FzName: ts + 15772 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_AUTOINDEX}, + {FzName: ts + 15800 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_VM_STEP}, + {FzName: ts + 15826 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_REPREPARE}, + {FzName: ts + 15854 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_RUN}, + {FzName: ts + 15876 /* "SQLITE_STMTSTATU..." */, Fop: SQLITE_STMTSTATUS_MEMUSED}, } /* test1.c:2158:5 */ // Usage: sqlite3_config_sorterref @@ -45209,7 +46353,7 @@ func test_config_sorterref(tls *libc.TLS, clientData uintptr, interp uintptr, ob // var iVal int32 at bp+8, 4 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15722 /* "NBYTE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15902 /* "NBYTE" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8 /* &iVal */) != 0 { @@ -45230,7 +46374,7 @@ func vfsCurrentTimeInt64(tls *libc.TLS, clientData uintptr, interp uintptr, objc var pVfs uintptr = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0)) if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, pVfs, bp /* &t */) @@ -45250,7 +46394,7 @@ func test_snapshot_get(tls *libc.TLS, clientData uintptr, interp uintptr, objc i *(*uintptr)(unsafe.Pointer(bp + 8 /* pSnapshot */)) = uintptr(0) if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15728 /* "DB DBNAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15908 /* "DB DBNAME" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { @@ -45284,7 +46428,7 @@ func test_snapshot_recover(tls *libc.TLS, clientData uintptr, interp uintptr, ob var zName uintptr if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15728 /* "DB DBNAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15908 /* "DB DBNAME" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { @@ -45314,7 +46458,7 @@ func test_snapshot_open(tls *libc.TLS, clientData uintptr, interp uintptr, objc var pSnapshot uintptr if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15738 /* "DB DBNAME SNAPSH..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15918 /* "DB DBNAME SNAPSH..." */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { @@ -45337,7 +46481,7 @@ func test_snapshot_open(tls *libc.TLS, clientData uintptr, interp uintptr, objc func test_snapshot_free(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2428:26: */ var pSnapshot uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15757 /* "SNAPSHOT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15937 /* "SNAPSHOT" */) return TCL_ERROR } pSnapshot = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -45351,7 +46495,7 @@ func test_snapshot_cmp(tls *libc.TLS, clientData uintptr, interp uintptr, objc i var p1 uintptr var p2 uintptr if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15766 /* "SNAPSHOT1 SNAPSH..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15946 /* "SNAPSHOT1 SNAPSH..." */) return TCL_ERROR } p1 = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -45373,7 +46517,7 @@ func test_snapshot_get_blob(tls *libc.TLS, clientData uintptr, interp uintptr, o *(*uintptr)(unsafe.Pointer(bp + 8 /* pSnapshot */)) = uintptr(0) if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15728 /* "DB DBNAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15908 /* "DB DBNAME" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { @@ -45406,7 +46550,7 @@ func test_snapshot_open_blob(tls *libc.TLS, clientData uintptr, interp uintptr, // var nBlob int32 at bp+24, 4 if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15738 /* "DB DBNAME SNAPSH..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15918 /* "DB DBNAME SNAPSH..." */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+16 /* &db */) != 0 { @@ -45415,7 +46559,7 @@ func test_snapshot_open_blob(tls *libc.TLS, clientData uintptr, interp uintptr, zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) pBlob = tcl.XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+24 /* &nBlob */) if (uint64(*(*int32)(unsafe.Pointer(bp + 24 /* nBlob */))) != uint64(unsafe.Sizeof(sqlite3_snapshot{}))) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+15786 /* "bad SNAPSHOT" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+15966 /* "bad SNAPSHOT" */, 0)) return TCL_ERROR } rc = sqlite3.Xsqlite3_snapshot_open(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), zName, pBlob) @@ -45439,7 +46583,7 @@ func test_snapshot_cmp_blob(tls *libc.TLS, clientData uintptr, interp uintptr, o // var n2 int32 at bp+20, 4 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15766 /* "SNAPSHOT1 SNAPSH..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15946 /* "SNAPSHOT1 SNAPSH..." */) return TCL_ERROR } @@ -45447,7 +46591,7 @@ func test_snapshot_cmp_blob(tls *libc.TLS, clientData uintptr, interp uintptr, o p2 = tcl.XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+20 /* &n2 */) if (uint64(*(*int32)(unsafe.Pointer(bp + 16 /* n1 */))) != uint64(unsafe.Sizeof(sqlite3_snapshot{}))) || (*(*int32)(unsafe.Pointer(bp + 16 /* n1 */)) != *(*int32)(unsafe.Pointer(bp + 20 /* n2 */))) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+15786 /* "bad SNAPSHOT" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+15966 /* "bad SNAPSHOT" */, 0)) return TCL_ERROR } @@ -45461,7 +46605,7 @@ func test_delete_database(tls *libc.TLS, clientData uintptr, interp uintptr, obj var rc int32 var zFile uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15799 /* "FILE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15979 /* "FILE" */) return TCL_ERROR } zFile = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -45484,7 +46628,7 @@ func test_atomic_batch_write(tls *libc.TLS, clientData uintptr, interp uintptr, var rc int32 // sqlite3_open() return code if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15804 /* "PATH" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15984 /* "PATH" */) return TCL_ERROR } zFile = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -45496,7 +46640,7 @@ func test_atomic_batch_write(tls *libc.TLS, clientData uintptr, interp uintptr, return TCL_ERROR } - rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+84 /* "main" */, SQLITE_FCNTL_FILE_POINTER, bp+24 /* &pFd */) + rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+85 /* "main" */, SQLITE_FCNTL_FILE_POINTER, bp+24 /* &pFd */) dc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pFd */)))).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pFd */))) if (dc & SQLITE_IOCAP_BATCH_ATOMIC) != 0 { bRes = 1 @@ -45520,8 +46664,8 @@ func test_next_stmt(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 // var zBuf [50]int8 at bp+64, 50 if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15809 /* " DB STMT" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15989 /* " DB STMT" */, 0)) return TCL_ERROR } @@ -45554,8 +46698,8 @@ func test_stmt_readonly(tls *libc.TLS, clientData uintptr, interp uintptr, objc var rc int32 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15818 /* " STMT" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15998 /* " STMT" */, 0)) return TCL_ERROR } @@ -45580,8 +46724,8 @@ func test_stmt_isexplain(tls *libc.TLS, clientData uintptr, interp uintptr, objc var rc int32 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15818 /* " STMT" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15998 /* " STMT" */, 0)) return TCL_ERROR } @@ -45606,8 +46750,8 @@ func test_stmt_busy(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 var rc int32 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15818 /* " STMT" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15998 /* " STMT" */, 0)) return TCL_ERROR } @@ -45629,8 +46773,8 @@ func uses_stmt_journal(tls *libc.TLS, clientData uintptr, interp uintptr, objc i // var pStmt uintptr at bp+32, 8 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15818 /* " STMT" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15998 /* " STMT" */, 0)) return TCL_ERROR } @@ -45654,8 +46798,8 @@ func test_reset(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, o var rc int32 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15504 /* " " */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15684 /* " " */, 0)) return TCL_ERROR } @@ -45685,8 +46829,8 @@ func test_expired(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // var pStmt uintptr at bp+32, 8 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15504 /* " " */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15684 /* " " */, 0)) return TCL_ERROR } if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+32 /* &pStmt */) != 0 { @@ -45708,8 +46852,8 @@ func test_transfer_bind(tls *libc.TLS, clientData uintptr, interp uintptr, objc // var pStmt2 uintptr at bp+40, 8 if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+15824 /* " FROM-STMT TO-ST..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16004 /* " FROM-STMT TO-ST..." */, 0)) return TCL_ERROR } if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+32 /* &pStmt1 */) != 0 { @@ -45734,8 +46878,8 @@ func test_changes(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // var db uintptr at bp+32, 8 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+14503 /* " DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+14683 /* " DB" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+32 /* &db */) != 0 { @@ -45769,8 +46913,8 @@ func test_bind(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv // var idx int32 at bp+88, 4 if argc != 5 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+15843 /* " VM IDX VALUE (n..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+16023 /* " VM IDX VALUE (n..." */, 0)) return TCL_ERROR } if getStmtPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+80 /* &pStmt */) != 0 { @@ -45779,20 +46923,20 @@ func test_bind(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+88 /* &idx */) != 0 { return TCL_ERROR } - if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)), ts+7207 /* "null" */) == 0 { + if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)), ts+7387 /* "null" */) == 0 { rc = sqlite3.Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */))) - } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)), ts+15879 /* "static" */) == 0 { + } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)), ts+16059 /* "static" */) == 0 { rc = sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */)), sqlite_static_bind_value, -1, uintptr(0)) - } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)), ts+15886 /* "static-nbytes" */) == 0 { + } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)), ts+16066 /* "static-nbytes" */) == 0 { rc = sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */)), sqlite_static_bind_value, sqlite_static_bind_nbyte, uintptr(0)) - } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)), ts+15900 /* "normal" */) == 0 { + } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)), ts+16080 /* "normal" */) == 0 { rc = sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */)), *(*uintptr)(unsafe.Pointer(argv + 3*8)), -1, libc.UintptrFromInt32(-1)) - } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)), ts+15907 /* "blob10" */) == 0 { - rc = sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */)), ts+15914 /* "abc\x00xyz\x00pq" */, 10, uintptr(0)) + } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)), ts+16087 /* "blob10" */) == 0 { + rc = sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */)), ts+16094 /* "abc\x00xyz\x00pq" */, 10, uintptr(0)) } else { tcl.XTcl_AppendResult(tls, interp, - libc.VaList(bp+32, ts+15925 /* "4th argument sho..." */, 0)) + libc.VaList(bp+32, ts+16105 /* "4th argument sho..." */, 0)) return TCL_ERROR } if sqlite3TestErrCode(tls, interp, sqlite3.Xsqlite3_db_handle(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */))), rc) != 0 { @@ -45801,7 +46945,7 @@ func test_bind(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv if rc != 0 { // var zBuf [50]int8 at bp+92, 50 - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+92 /* &zBuf[0] */, ts+15979 /* "(%d) " */, libc.VaList(bp+48, rc)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+92 /* &zBuf[0] */, ts+16159 /* "(%d) " */, libc.VaList(bp+48, rc)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+92 /* &zBuf[0] */, sqlite3.Xsqlite3ErrStr(tls, rc), 0)) return TCL_ERROR } @@ -45848,18 +46992,18 @@ func test_collate_func(tls *libc.TLS, pCtx uintptr, nA int32, zA uintptr, nB int var pVal uintptr var pX uintptr - pX = tcl.XTcl_NewStringObj(tls, ts+15985 /* "test_collate" */, -1) + pX = tcl.XTcl_NewStringObj(tls, ts+16165 /* "test_collate" */, -1) (*Tcl_Obj)(unsafe.Pointer(pX)).FrefCount++ switch encin { case SQLITE_UTF8: - tcl.XTcl_ListObjAppendElement(tls, i, pX, tcl.XTcl_NewStringObj(tls, ts+15998 /* "UTF-8" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, i, pX, tcl.XTcl_NewStringObj(tls, ts+16178 /* "UTF-8" */, -1)) break case SQLITE_UTF16LE: - tcl.XTcl_ListObjAppendElement(tls, i, pX, tcl.XTcl_NewStringObj(tls, ts+16004 /* "UTF-16LE" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, i, pX, tcl.XTcl_NewStringObj(tls, ts+16184 /* "UTF-16LE" */, -1)) break case SQLITE_UTF16BE: - tcl.XTcl_ListObjAppendElement(tls, i, pX, tcl.XTcl_NewStringObj(tls, ts+16013 /* "UTF-16BE" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, i, pX, tcl.XTcl_NewStringObj(tls, ts+16193 /* "UTF-16BE" */, -1)) break default: @@ -45923,8 +47067,8 @@ __2: return TCL_ERROR __3: ; - rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), ts+15985 /* "test_collate" */, SQLITE_UTF8, - SQLITE_UTF8, func() uintptr { + rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), ts+16165 /* "test_collate" */, SQLITE_UTF8, + uintptr(SQLITE_UTF8), func() uintptr { if *(*int32)(unsafe.Pointer(bp + 56 /* val */)) != 0 { return *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 @@ -45941,8 +47085,8 @@ __3: return TCL_ERROR __5: ; - rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), ts+15985 /* "test_collate" */, SQLITE_UTF16LE, - SQLITE_UTF16LE, func() uintptr { + rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), ts+16165 /* "test_collate" */, SQLITE_UTF16LE, + uintptr(SQLITE_UTF16LE), func() uintptr { if *(*int32)(unsafe.Pointer(bp + 56 /* val */)) != 0 { return *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 @@ -45959,8 +47103,8 @@ __6: sqlite3.Xsqlite3_mutex_enter(tls, (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* db */)))).Fmutex) pVal = sqlite3.Xsqlite3ValueNew(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */))) - sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, ts+15985 /* "test_collate" */, SQLITE_UTF8, uintptr(0)) - zUtf16 = sqlite3.Xsqlite3ValueText(tls, pVal, SQLITE_UTF16LE) + sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, ts+16165 /* "test_collate" */, uint8(SQLITE_UTF8), uintptr(0)) + zUtf16 = sqlite3.Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE)) if !((*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* db */)))).FmallocFailed != 0) { goto __7 } @@ -45968,7 +47112,7 @@ __6: goto __8 __7: rc = sqlite3.Xsqlite3_create_collation16(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), zUtf16, SQLITE_UTF16BE, - SQLITE_UTF16BE, func() uintptr { + uintptr(SQLITE_UTF16BE), func() uintptr { if *(*int32)(unsafe.Pointer(bp + 56 /* val */)) != 0 { return *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 @@ -45999,8 +47143,8 @@ __10: return TCL_OK bad_args: - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16022 /* " " */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16288 /* "" */) } zCode = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -46415,7 +47559,7 @@ func test_bind_zeroblob(tls *libc.TLS, clientData uintptr, interp uintptr, objc var rc int32 if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16121 /* "STMT IDX N" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16301 /* "STMT IDX N" */) return TCL_ERROR } @@ -46458,7 +47602,7 @@ func test_bind_zeroblob64(tls *libc.TLS, clientData uintptr, interp uintptr, obj var rc int32 if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16121 /* "STMT IDX N" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16301 /* "STMT IDX N" */) return TCL_ERROR } @@ -46502,8 +47646,8 @@ func test_bind_int(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 var rc int32 if objc != 4 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16132 /* " STMT N VALUE" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16312 /* " STMT N VALUE" */, 0)) return TCL_ERROR } @@ -46680,8 +47824,8 @@ func test_bind_int64(tls *libc.TLS, clientData uintptr, interp uintptr, objc int var rc int32 if objc != 4 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16132 /* " STMT N VALUE" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16312 /* " STMT N VALUE" */, 0)) return TCL_ERROR } @@ -46725,8 +47869,8 @@ func test_bind_double(tls *libc.TLS, clientData uintptr, interp uintptr, objc in var i int32 if objc != 4 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16132 /* " STMT N VALUE" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16312 /* " STMT N VALUE" */, 0)) return TCL_ERROR } @@ -46781,16 +47925,16 @@ var aSpecialFp = [10]struct { FiUpper uint32 FiLower uint32 }{ - {FzName: ts + 16146 /* "NaN" */, FiUpper: uint32(0x7fffffff), FiLower: 0xffffffff}, - {FzName: ts + 16150 /* "SNaN" */, FiUpper: uint32(0x7ff7ffff), FiLower: 0xffffffff}, - {FzName: ts + 16155 /* "-NaN" */, FiUpper: 0xffffffff, FiLower: 0xffffffff}, - {FzName: ts + 16160 /* "-SNaN" */, FiUpper: 0xfff7ffff, FiLower: 0xffffffff}, - {FzName: ts + 16166 /* "+Inf" */, FiUpper: uint32(0x7ff00000)}, - {FzName: ts + 16171 /* "-Inf" */, FiUpper: 0xfff00000}, - {FzName: ts + 16176 /* "Epsilon" */, FiLower: uint32(0x00000001)}, - {FzName: ts + 16184 /* "-Epsilon" */, FiUpper: 0x80000000, FiLower: uint32(0x00000001)}, - {FzName: ts + 16193 /* "NaN0" */, FiUpper: uint32(0x7ff80000)}, - {FzName: ts + 16198 /* "-NaN0" */, FiUpper: 0xfff80000}, + {FzName: ts + 16326 /* "NaN" */, FiUpper: uint32(0x7fffffff), FiLower: 0xffffffff}, + {FzName: ts + 16330 /* "SNaN" */, FiUpper: uint32(0x7ff7ffff), FiLower: 0xffffffff}, + {FzName: ts + 16335 /* "-NaN" */, FiUpper: 0xffffffff, FiLower: 0xffffffff}, + {FzName: ts + 16340 /* "-SNaN" */, FiUpper: 0xfff7ffff, FiLower: 0xffffffff}, + {FzName: ts + 16346 /* "+Inf" */, FiUpper: uint32(0x7ff00000)}, + {FzName: ts + 16351 /* "-Inf" */, FiUpper: 0xfff00000}, + {FzName: ts + 16356 /* "Epsilon" */, FiLower: uint32(0x00000001)}, + {FzName: ts + 16364 /* "-Epsilon" */, FiUpper: 0x80000000, FiLower: uint32(0x00000001)}, + {FzName: ts + 16373 /* "NaN0" */, FiUpper: uint32(0x7ff80000)}, + {FzName: ts + 16378 /* "-NaN0" */, FiUpper: 0xfff80000}, } /* test1.c:3724:5 */ // Usage: sqlite3_bind_null STMT N @@ -46809,8 +47953,8 @@ func test_bind_null(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 var rc int32 if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16204 /* " STMT N" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16384 /* " STMT N" */, 0)) return TCL_ERROR } @@ -46852,8 +47996,8 @@ func test_bind_text(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 var rc int32 if objc != 5 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16212 /* " STMT N VALUE BY..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16392 /* " STMT N VALUE BY..." */, 0)) return TCL_ERROR } @@ -46911,8 +48055,8 @@ func test_bind_text16(tls *libc.TLS, clientData uintptr, interp uintptr, objc in var oBytes uintptr = *(*uintptr)(unsafe.Pointer(objv + uintptr((objc-1))*8)) if (objc != 5) && (objc != 6) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16212 /* " STMT N VALUE BY..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16392 /* " STMT N VALUE BY..." */, 0)) return TCL_ERROR } @@ -46961,8 +48105,8 @@ func test_bind_blob(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 var xDestructor sqlite3_destructor_type = libc.UintptrFromInt32(-1) if (objc != 5) && (objc != 6) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16232 /* " STMT N DATA BYT..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+16412 /* " STMT N DATA BYT..." */, 0)) return TCL_ERROR } @@ -46987,8 +48131,8 @@ func test_bind_blob(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 // var zBuf [200]int8 at bp+84, 200 sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+84, /* &zBuf[0] */ - ts+16251 /* "cannot use %d bl..." */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 80 /* bytes */)), *(*int32)(unsafe.Pointer(bp + 76 /* len */)))) - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, bp+84 /* &zBuf[0] */, -1)) + ts+16431 /* "cannot use %d bl..." */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 80 /* bytes */)), *(*int32)(unsafe.Pointer(bp + 76 /* len */)))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, bp+84 /* &zBuf[0] */, uintptr(0))) return TCL_ERROR } @@ -47003,17 +48147,404 @@ func test_bind_blob(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 return TCL_OK } +// sqlite3_carray_bind [options...] STMT NAME VALUE ... +// +// Options: +// -transient +// -static +// -int32 +// -int64 +// -double +// -text +// +// Each call clears static data. Called with no options does nothing +// but clear static data. +func test_carray_bind(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3972:26: */ + bp := tls.Alloc(112) + defer tls.Free(112) + + // var pStmt uintptr at bp+80, 8 + + var eType int32 // CARRAY_INT32 + var nData int32 + var aData uintptr + var isTransient int32 + var isStatic int32 + // var idx int32 at bp+88, 4 + + var i int32 + var j int32 + var rc int32 + var xDel uintptr + var z uintptr + // var v int32 at bp+92, 4 + // INT32 + var a uintptr + // var v1 Tcl_WideInt at bp+96, 8 + // INT64 + var a1 uintptr + // var v2 float64 at bp+104, 8 + // DOUBLE + var a2 uintptr + var v3 uintptr // TEXT + var a3 uintptr + eType = 0 + nData = 0 + aData = uintptr(0) + isTransient = 0 + isStatic = 0 + xDel = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})) + + if !(aStaticData != 0) { + goto __1 + } + // Always clear preexisting static data on every call + if !(eStaticType == 3) { + goto __2 + } + i = 0 +__3: + if !(i < nStaticData) { + goto __5 + } + sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((aStaticData) + uintptr(i)*8))) + goto __4 +__4: + i++ + goto __3 + goto __5 +__5: + ; +__2: + ; + sqlite3.Xsqlite3_free(tls, aStaticData) + aStaticData = uintptr(0) + nStaticData = 0 + eStaticType = 0 +__1: + ; + if !(objc == 1) { + goto __6 + } + return TCL_OK +__6: + ; + + i = 1 +__7: + if !((i < objc) && (int32(*(*int8)(unsafe.Pointer(tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))))) == '-')) { + goto __9 + } + z = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) + if !(libc.Xstrcmp(tls, z, ts+16465 /* "-transient" */) == 0) { + goto __10 + } + isTransient = 1 + xDel = libc.UintptrFromInt32(-1) + goto __11 +__10: + if !(libc.Xstrcmp(tls, z, ts+16476 /* "-static" */) == 0) { + goto __12 + } + isStatic = 1 + xDel = uintptr(0) + goto __13 +__12: + if !(libc.Xstrcmp(tls, z, ts+16484 /* "-int32" */) == 0) { + goto __14 + } + eType = 0 // CARRAY_INT32 + goto __15 +__14: + if !(libc.Xstrcmp(tls, z, ts+16491 /* "-int64" */) == 0) { + goto __16 + } + eType = 1 // CARRAY_INT64 + goto __17 +__16: + if !(libc.Xstrcmp(tls, z, ts+16498 /* "-double" */) == 0) { + goto __18 + } + eType = 2 // CARRAY_DOUBLE + goto __19 +__18: + if !(libc.Xstrcmp(tls, z, ts+16506 /* "-text" */) == 0) { + goto __20 + } + eType = 3 // CARRAY_TEXT + goto __21 +__20: + if !(libc.Xstrcmp(tls, z, ts+16512 /* "--" */) == 0) { + goto __22 + } + goto __9 + goto __23 +__22: + + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+12135 /* "unknown option: " */, z, uintptr(0))) + return TCL_ERROR +__23: + ; +__21: + ; +__19: + ; +__17: + ; +__15: + ; +__13: + ; +__11: + ; + goto __8 +__8: + i++ + goto __7 + goto __9 +__9: + ; + if !(((eType == 3) && !(isStatic != 0)) && !(isTransient != 0)) { + goto __24 + } + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+16515, /* "text data must b..." */ + uintptr(0))) + return TCL_ERROR +__24: + ; + if !((isStatic != 0) && (isTransient != 0)) { + goto __25 + } + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, ts+16562, /* "cannot be both -..." */ + uintptr(0))) + return TCL_ERROR +__25: + ; + if !((objc - i) < 2) { + goto __26 + } + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16600 /* "[OPTIONS] STMT I..." */) + return TCL_ERROR +__26: + ; + if !(getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))), bp+80 /* &pStmt */) != 0) { + goto __27 + } + return TCL_ERROR +__27: + ; + i++ + if !(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+88 /* &idx */) != 0) { + goto __28 + } + return TCL_ERROR +__28: + ; + i++ + nData = (objc - i) + switch eType + (4 * (libc.Bool32(nData <= 0))) { + case 0: + goto __30 + case 1: + goto __31 + case 2: + goto __32 + case 3: + goto __33 + case 4: + goto __34 + } + goto __29 +__30: // INT32 + a = sqlite3.Xsqlite3_malloc(tls, (int32(uint64(unsafe.Sizeof(int32(0))) * uint64(nData)))) + if !(a == uintptr(0)) { + goto __35 + } + rc = SQLITE_NOMEM + goto carray_bind_done +__35: + ; + j = 0 +__36: + if !(j < nData) { + goto __38 + } + if !(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+j))*8)), bp+92 /* &v */) != 0) { + goto __39 + } + sqlite3.Xsqlite3_free(tls, a) + return TCL_ERROR +__39: + ; + *(*int32)(unsafe.Pointer(a + uintptr(j)*4)) = *(*int32)(unsafe.Pointer(bp + 92 /* v */)) + goto __37 +__37: + j++ + goto __36 + goto __38 +__38: + ; + aData = a + goto __29 + +__31: // INT64 + a1 = sqlite3.Xsqlite3_malloc(tls, (int32(uint64(unsafe.Sizeof(sqlite3_int64(0))) * uint64(nData)))) + if !(a1 == uintptr(0)) { + goto __40 + } + rc = SQLITE_NOMEM + goto carray_bind_done +__40: + ; + j = 0 +__41: + if !(j < nData) { + goto __43 + } + if !(tcl.XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+j))*8)), bp+96 /* &v1 */) != 0) { + goto __44 + } + sqlite3.Xsqlite3_free(tls, a1) + return TCL_ERROR +__44: + ; + *(*sqlite3_int64)(unsafe.Pointer(a1 + uintptr(j)*8)) = *(*Tcl_WideInt)(unsafe.Pointer(bp + 96 /* v1 */)) + goto __42 +__42: + j++ + goto __41 + goto __43 +__43: + ; + aData = a1 + goto __29 + +__32: // DOUBLE + a2 = sqlite3.Xsqlite3_malloc(tls, (int32(uint64(unsafe.Sizeof(float64(0))) * uint64(nData)))) + if !(a2 == uintptr(0)) { + goto __45 + } + rc = SQLITE_NOMEM + goto carray_bind_done +__45: + ; + j = 0 +__46: + if !(j < nData) { + goto __48 + } + if !(tcl.XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+j))*8)), bp+104 /* &v2 */) != 0) { + goto __49 + } + sqlite3.Xsqlite3_free(tls, a2) + return TCL_ERROR +__49: + ; + *(*float64)(unsafe.Pointer(a2 + uintptr(j)*8)) = *(*float64)(unsafe.Pointer(bp + 104 /* v2 */)) + goto __47 +__47: + j++ + goto __46 + goto __48 +__48: + ; + aData = a2 + goto __29 + +__33: // TEXT + a3 = sqlite3.Xsqlite3_malloc(tls, (int32(uint64(unsafe.Sizeof(uintptr(0))) * uint64(nData)))) + if !(a3 == uintptr(0)) { + goto __50 + } + rc = SQLITE_NOMEM + goto carray_bind_done +__50: + ; + j = 0 +__51: + if !(j < nData) { + goto __53 + } + v3 = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+j))*8))) + *(*uintptr)(unsafe.Pointer(a3 + uintptr(j)*8)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+56, v3)) + goto __52 +__52: + j++ + goto __51 + goto __53 +__53: + ; + aData = a3 + goto __29 + +__34: // nData==0 + aData = ts + 489 /* "" */ + xDel = uintptr(0) + isTransient = 0 + isStatic = 0 + goto __29 + +__29: + ; + if !(isStatic != 0) { + goto __54 + } + aStaticData = aData + nStaticData = nData + eStaticType = eType +__54: + ; + rc = sqlite3_carray_bind(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */)), aData, nData, eType, xDel) + if !(isTransient != 0) { + goto __55 + } + if !(eType == 3) { + goto __56 + } + i = 0 +__57: + if !(i < nData) { + goto __59 + } + sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((aData) + uintptr(i)*8))) + goto __58 +__58: + i++ + goto __57 + goto __59 +__59: + ; +__56: + ; + sqlite3.Xsqlite3_free(tls, aData) +__55: + ; +carray_bind_done: + if !(rc != 0) { + goto __60 + } + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, sqlite3.Xsqlite3_errstr(tls, rc), uintptr(0))) + return TCL_ERROR +__60: + ; + return TCL_OK +} + +var aStaticData uintptr = uintptr(0) /* test1.c:3988:15 */ +var nStaticData int32 = 0 /* test1.c:3989:14 */ +var eStaticType int32 = 0 /* test1.c:3990:14 */ + // Usage: sqlite3_bind_parameter_count STMT // // Return the number of wildcards in the given statement. -func test_bind_parameter_count(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3961:26: */ +func test_bind_parameter_count(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4150:26: */ bp := tls.Alloc(8) defer tls.Free(8) // var pStmt uintptr at bp, 8 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16285 /* "STMT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16629 /* "STMT" */) return TCL_ERROR } if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &pStmt */) != 0 { @@ -47028,7 +48559,7 @@ func test_bind_parameter_count(tls *libc.TLS, clientData uintptr, interp uintptr // Return the name of the Nth wildcard. The first wildcard is 1. // An empty string is returned if N is out of range or if the wildcard // is nameless. -func test_bind_parameter_name(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3985:26: */ +func test_bind_parameter_name(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4174:26: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -47037,7 +48568,7 @@ func test_bind_parameter_name(tls *libc.TLS, clientData uintptr, interp uintptr, // var i int32 at bp+8, 4 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16290 /* "STMT N" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16634 /* "STMT N" */) return TCL_ERROR } if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &pStmt */) != 0 { @@ -47055,14 +48586,14 @@ func test_bind_parameter_name(tls *libc.TLS, clientData uintptr, interp uintptr, // // Return the index of the wildcard called NAME. Return 0 if there is // no such wildcard. -func test_bind_parameter_index(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4012:26: */ +func test_bind_parameter_index(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4201:26: */ bp := tls.Alloc(8) defer tls.Free(8) // var pStmt uintptr at bp, 8 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16297 /* "STMT NAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16641 /* "STMT NAME" */) return TCL_ERROR } if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &pStmt */) != 0 { @@ -47076,14 +48607,14 @@ func test_bind_parameter_index(tls *libc.TLS, clientData uintptr, interp uintptr // Usage: sqlite3_clear_bindings STMT // -func test_clear_bindings(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4037:26: */ +func test_clear_bindings(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4226:26: */ bp := tls.Alloc(8) defer tls.Free(8) // var pStmt uintptr at bp, 8 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16285 /* "STMT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16629 /* "STMT" */) return TCL_ERROR } if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &pStmt */) != 0 { @@ -47094,14 +48625,14 @@ func test_clear_bindings(tls *libc.TLS, clientData uintptr, interp uintptr, objc } // Usage: sqlite3_sleep MILLISECONDS -func test_sleep(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4057:26: */ +func test_sleep(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4246:26: */ bp := tls.Alloc(4) defer tls.Free(4) // var ms int32 at bp, 4 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12628 /* "MILLISECONDS" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12808 /* "MILLISECONDS" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &ms */) != 0 { @@ -47115,7 +48646,7 @@ func test_sleep(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, o // // Return the string representation of the most recent sqlite3_* API // error code. e.g. "SQLITE_ERROR". -func test_ex_errcode(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4082:26: */ +func test_ex_errcode(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4271:26: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -47124,8 +48655,8 @@ func test_ex_errcode(tls *libc.TLS, clientData uintptr, interp uintptr, objc int var rc int32 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+14503 /* " DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+14683 /* " DB" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+48 /* &db */) != 0 { @@ -47140,7 +48671,7 @@ func test_ex_errcode(tls *libc.TLS, clientData uintptr, interp uintptr, objc int // // Return the string representation of the most recent sqlite3_* API // error code. e.g. "SQLITE_ERROR". -func test_errcode(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4109:26: */ +func test_errcode(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4298:26: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -47149,8 +48680,8 @@ func test_errcode(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, var rc int32 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+14503 /* " DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+14683 /* " DB" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+48 /* &db */) != 0 { @@ -47165,7 +48696,7 @@ func test_errcode(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // // Returns the UTF-8 representation of the error message string for the // most recent sqlite3_* API call. -func test_errmsg(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4135:26: */ +func test_errmsg(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4324:26: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -47174,8 +48705,8 @@ func test_errmsg(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, var zErr uintptr if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+14503 /* " DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+14683 /* " DB" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+32 /* &db */) != 0 { @@ -47193,7 +48724,7 @@ func test_errmsg(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // most recent sqlite3_* API call. This is a byte array object at the TCL // level, and it includes the 0x00 0x00 terminator bytes at the end of the // UTF-16 string. -func test_errmsg16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4164:26: */ +func test_errmsg16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4353:26: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -47204,8 +48735,8 @@ func test_errmsg16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 var bytes int32 = 0 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+14503 /* " DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+14683 /* " DB" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+32 /* &db */) != 0 { @@ -47228,7 +48759,7 @@ func test_errmsg16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 // database handle . The parameter is the name of a global // variable that is set to the unused portion of (if any). A // STMT handle is returned. -func test_prepare(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4201:26: */ +func test_prepare(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4390:26: */ bp := tls.Alloc(162) defer tls.Free(162) @@ -47244,8 +48775,8 @@ func test_prepare(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, var rc int32 if (objc != 5) && (objc != 4) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16307 /* " DB sql bytes ?t..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16651 /* " DB sql bytes ?t..." */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+80 /* &db */) != 0 { @@ -47277,7 +48808,7 @@ func test_prepare(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, } if rc != SQLITE_OK { - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+15979 /* "(%d) " */, libc.VaList(bp+32, rc)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+16159 /* "(%d) " */, libc.VaList(bp+32, rc)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+112 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0)) return TCL_ERROR } @@ -47297,7 +48828,7 @@ func test_prepare(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // database handle . The parameter is the name of a global // variable that is set to the unused portion of (if any). A // STMT handle is returned. -func test_prepare_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4258:26: */ +func test_prepare_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4447:26: */ bp := tls.Alloc(162) defer tls.Free(162) @@ -47315,8 +48846,8 @@ func test_prepare_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int var rc int32 if (objc != 5) && (objc != 4) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16331 /* " DB sql bytes ta..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16675 /* " DB sql bytes ta..." */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+80 /* &db */) != 0 { @@ -47361,7 +48892,7 @@ func test_prepare_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int } if rc != SQLITE_OK { - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+15979 /* "(%d) " */, libc.VaList(bp+32, rc)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+16159 /* "(%d) " */, libc.VaList(bp+32, rc)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+112 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0)) return TCL_ERROR } @@ -47381,7 +48912,7 @@ func test_prepare_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int // database handle and flags . The parameter is // the name of a global variable that is set to the unused portion of // (if any). A STMT handle is returned. -func test_prepare_v3(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4332:26: */ +func test_prepare_v3(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4521:26: */ bp := tls.Alloc(162) defer tls.Free(162) @@ -47401,8 +48932,8 @@ func test_prepare_v3(tls *libc.TLS, clientData uintptr, interp uintptr, objc int var rc int32 if (objc != 6) && (objc != 5) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16353 /* " DB sql bytes fl..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16697 /* " DB sql bytes fl..." */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+80 /* &db */) != 0 { @@ -47448,7 +48979,7 @@ func test_prepare_v3(tls *libc.TLS, clientData uintptr, interp uintptr, objc int } if rc != SQLITE_OK { - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+15979 /* "(%d) " */, libc.VaList(bp+32, rc)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+16159 /* "(%d) " */, libc.VaList(bp+32, rc)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+112 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0)) return TCL_ERROR } @@ -47466,7 +48997,7 @@ func test_prepare_v3(tls *libc.TLS, clientData uintptr, interp uintptr, objc int // // Generate a prepared statement for a zero-byte string as a test // for ticket #3134. The string should be preceded by a zero byte. -func test_prepare_tkt3134(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4403:26: */ +func test_prepare_tkt3134(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4592:26: */ bp := tls.Alloc(146) defer tls.Free(146) @@ -47478,8 +49009,8 @@ func test_prepare_tkt3134(tls *libc.TLS, clientData uintptr, interp uintptr, obj var rc int32 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16331 /* " DB sql bytes ta..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16675 /* " DB sql bytes ta..." */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+80 /* &db */) != 0 { @@ -47492,7 +49023,7 @@ func test_prepare_tkt3134(tls *libc.TLS, clientData uintptr, interp uintptr, obj } if rc != SQLITE_OK { - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+96 /* &zBuf[0] */, ts+15979 /* "(%d) " */, libc.VaList(bp+32, rc)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+96 /* &zBuf[0] */, ts+16159 /* "(%d) " */, libc.VaList(bp+32, rc)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+96 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0)) return TCL_ERROR } @@ -47506,7 +49037,7 @@ func test_prepare_tkt3134(tls *libc.TLS, clientData uintptr, interp uintptr, obj return TCL_OK } -var zSql = *(*[10]int8)(unsafe.Pointer(ts + 16381 /* "\x00SELECT 1" */)) /* test1.c:4410:21 */ +var zSql = *(*[10]int8)(unsafe.Pointer(ts + 16725 /* "\x00SELECT 1" */)) /* test1.c:4599:21 */ // Usage: sqlite3_prepare16 DB sql bytes tailvar // @@ -47514,7 +49045,7 @@ var zSql = *(*[10]int8)(unsafe.Pointer(ts + 16381 /* "\x00SELECT 1" */)) /* test // database handle . The parameter is the name of a global // variable that is set to the unused portion of (if any). A // STMT handle is returned. -func test_prepare16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4446:26: */ +func test_prepare16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4635:26: */ bp := tls.Alloc(130) defer tls.Free(130) @@ -47533,8 +49064,8 @@ func test_prepare16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 // The byte-array length of arg 2 if (objc != 5) && (objc != 4) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16307 /* " DB sql bytes ?t..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16651 /* " DB sql bytes ?t..." */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+48 /* &db */) != 0 { @@ -47590,7 +49121,7 @@ func test_prepare16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 // database handle . The parameter is the name of a global // variable that is set to the unused portion of (if any). A // STMT handle is returned. -func test_prepare16_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4506:26: */ +func test_prepare16_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4695:26: */ bp := tls.Alloc(130) defer tls.Free(130) @@ -47609,8 +49140,8 @@ func test_prepare16_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc i // The byte-array length of arg 2 if (objc != 5) && (objc != 4) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16307 /* " DB sql bytes ?t..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16651 /* " DB sql bytes ?t..." */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+48 /* &db */) != 0 { @@ -47661,7 +49192,7 @@ func test_prepare16_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc i } // Usage: sqlite3_open filename ?options-list? -func test_open(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4561:26: */ +func test_open(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4750:26: */ bp := tls.Alloc(156) defer tls.Free(156) @@ -47671,8 +49202,8 @@ func test_open(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, ob // var zBuf [100]int8 at bp+56, 100 if ((objc != 3) && (objc != 2)) && (objc != 1) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16391 /* " filename option..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16735 /* " filename option..." */, 0)) return TCL_ERROR } @@ -47691,7 +49222,7 @@ func test_open(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, ob } // Usage: sqlite3_open_v2 FILENAME FLAGS VFS -func test_open_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4588:26: */ +func test_open_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4777:26: */ bp := tls.Alloc(468) defer tls.Free(468) @@ -47710,7 +49241,7 @@ func test_open_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, var i int32 if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16414 /* "FILENAME FLAGS V..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16758 /* "FILENAME FLAGS V..." */) return TCL_ERROR } zFilename = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -47727,29 +49258,29 @@ func test_open_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // var iFlag int32 at bp+352, 4 *(*[20]OpenFlag)(unsafe.Pointer(bp + 32 /* aFlag */)) = [20]OpenFlag{ - {FzFlag: ts + 16433 /* "SQLITE_OPEN_READ..." */, Fflag: SQLITE_OPEN_READONLY}, - {FzFlag: ts + 16454 /* "SQLITE_OPEN_READ..." */, Fflag: SQLITE_OPEN_READWRITE}, - {FzFlag: ts + 16476 /* "SQLITE_OPEN_CREA..." */, Fflag: SQLITE_OPEN_CREATE}, - {FzFlag: ts + 16495 /* "SQLITE_OPEN_DELE..." */, Fflag: SQLITE_OPEN_DELETEONCLOSE}, - {FzFlag: ts + 16521 /* "SQLITE_OPEN_EXCL..." */, Fflag: SQLITE_OPEN_EXCLUSIVE}, - {FzFlag: ts + 16543 /* "SQLITE_OPEN_AUTO..." */, Fflag: SQLITE_OPEN_AUTOPROXY}, - {FzFlag: ts + 16565 /* "SQLITE_OPEN_MAIN..." */, Fflag: SQLITE_OPEN_MAIN_DB}, - {FzFlag: ts + 16585 /* "SQLITE_OPEN_TEMP..." */, Fflag: SQLITE_OPEN_TEMP_DB}, - {FzFlag: ts + 16605 /* "SQLITE_OPEN_TRAN..." */, Fflag: SQLITE_OPEN_TRANSIENT_DB}, - {FzFlag: ts + 16630 /* "SQLITE_OPEN_MAIN..." */, Fflag: SQLITE_OPEN_MAIN_JOURNAL}, - {FzFlag: ts + 16655 /* "SQLITE_OPEN_TEMP..." */, Fflag: SQLITE_OPEN_TEMP_JOURNAL}, - {FzFlag: ts + 16680 /* "SQLITE_OPEN_SUBJ..." */, Fflag: SQLITE_OPEN_SUBJOURNAL}, - {FzFlag: ts + 16703 /* "SQLITE_OPEN_SUPE..." */, Fflag: SQLITE_OPEN_SUPER_JOURNAL}, - {FzFlag: ts + 16729 /* "SQLITE_OPEN_NOMU..." */, Fflag: SQLITE_OPEN_NOMUTEX}, - {FzFlag: ts + 16749 /* "SQLITE_OPEN_FULL..." */, Fflag: SQLITE_OPEN_FULLMUTEX}, - {FzFlag: ts + 16771 /* "SQLITE_OPEN_SHAR..." */, Fflag: SQLITE_OPEN_SHAREDCACHE}, - {FzFlag: ts + 16795 /* "SQLITE_OPEN_PRIV..." */, Fflag: SQLITE_OPEN_PRIVATECACHE}, - {FzFlag: ts + 16820 /* "SQLITE_OPEN_WAL" */, Fflag: SQLITE_OPEN_WAL}, - {FzFlag: ts + 16836 /* "SQLITE_OPEN_URI" */, Fflag: SQLITE_OPEN_URI}, + {FzFlag: ts + 16777 /* "SQLITE_OPEN_READ..." */, Fflag: SQLITE_OPEN_READONLY}, + {FzFlag: ts + 16798 /* "SQLITE_OPEN_READ..." */, Fflag: SQLITE_OPEN_READWRITE}, + {FzFlag: ts + 16820 /* "SQLITE_OPEN_CREA..." */, Fflag: SQLITE_OPEN_CREATE}, + {FzFlag: ts + 16839 /* "SQLITE_OPEN_DELE..." */, Fflag: SQLITE_OPEN_DELETEONCLOSE}, + {FzFlag: ts + 16865 /* "SQLITE_OPEN_EXCL..." */, Fflag: SQLITE_OPEN_EXCLUSIVE}, + {FzFlag: ts + 16887 /* "SQLITE_OPEN_AUTO..." */, Fflag: SQLITE_OPEN_AUTOPROXY}, + {FzFlag: ts + 16909 /* "SQLITE_OPEN_MAIN..." */, Fflag: SQLITE_OPEN_MAIN_DB}, + {FzFlag: ts + 16929 /* "SQLITE_OPEN_TEMP..." */, Fflag: SQLITE_OPEN_TEMP_DB}, + {FzFlag: ts + 16949 /* "SQLITE_OPEN_TRAN..." */, Fflag: SQLITE_OPEN_TRANSIENT_DB}, + {FzFlag: ts + 16974 /* "SQLITE_OPEN_MAIN..." */, Fflag: SQLITE_OPEN_MAIN_JOURNAL}, + {FzFlag: ts + 16999 /* "SQLITE_OPEN_TEMP..." */, Fflag: SQLITE_OPEN_TEMP_JOURNAL}, + {FzFlag: ts + 17024 /* "SQLITE_OPEN_SUBJ..." */, Fflag: SQLITE_OPEN_SUBJOURNAL}, + {FzFlag: ts + 17047 /* "SQLITE_OPEN_SUPE..." */, Fflag: SQLITE_OPEN_SUPER_JOURNAL}, + {FzFlag: ts + 17073 /* "SQLITE_OPEN_NOMU..." */, Fflag: SQLITE_OPEN_NOMUTEX}, + {FzFlag: ts + 17093 /* "SQLITE_OPEN_FULL..." */, Fflag: SQLITE_OPEN_FULLMUTEX}, + {FzFlag: ts + 17115 /* "SQLITE_OPEN_SHAR..." */, Fflag: SQLITE_OPEN_SHAREDCACHE}, + {FzFlag: ts + 17139 /* "SQLITE_OPEN_PRIV..." */, Fflag: SQLITE_OPEN_PRIVATECACHE}, + {FzFlag: ts + 17164 /* "SQLITE_OPEN_WAL" */, Fflag: SQLITE_OPEN_WAL}, + {FzFlag: ts + 17180 /* "SQLITE_OPEN_URI" */, Fflag: SQLITE_OPEN_URI}, {}, } rc = tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* apFlag */)) + uintptr(i)*8)), bp+32 /* &aFlag[0] */, int32(unsafe.Sizeof(OpenFlag{})), - ts+16852 /* "flag" */, 0, bp+352 /* &iFlag */) + ts+17196 /* "flag" */, 0, bp+352 /* &iFlag */) if rc != TCL_OK { return rc } @@ -47768,10 +49299,10 @@ type OpenFlag = struct { FzFlag uintptr Fflag int32 _ [4]byte -} /* test1.c:4617:5 */ +} /* test1.c:4806:5 */ // Usage: sqlite3_open16 filename options -func test_open16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4658:26: */ +func test_open16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4847:26: */ bp := tls.Alloc(156) defer tls.Free(156) @@ -47781,8 +49312,8 @@ func test_open16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // var zBuf [100]int8 at bp+56, 100 if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16391 /* " filename option..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16735 /* " filename option..." */, 0)) return TCL_ERROR } @@ -47800,11 +49331,11 @@ func test_open16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // // Return 1 if the supplied argument is a complete SQL statement, or zero // otherwise. -func test_complete16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4690:26: */ +func test_complete16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4879:26: */ var zBuf uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16857 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17201 /* "" */) return TCL_ERROR } @@ -47816,12 +49347,12 @@ func test_complete16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int // Usage: sqlite3_normalize SQL // // Return the normalized value for an SQL statement. -func test_normalize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4715:26: */ +func test_normalize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4904:26: */ var zSql uintptr var zNorm uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+9992 /* "SQL" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10172 /* "SQL" */) return TCL_ERROR } @@ -47837,7 +49368,7 @@ func test_normalize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 // Usage: sqlite3_step STMT // // Advance the statement to the next row. -func test_step(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4744:26: */ +func test_step(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4933:26: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -47846,8 +49377,8 @@ func test_step(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, ob var rc int32 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+15818 /* " STMT" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+15998 /* " STMT" */, 0)) return TCL_ERROR } @@ -47861,14 +49392,14 @@ func test_step(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, ob return TCL_OK } -func test_sql(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4767:26: */ +func test_sql(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4956:26: */ bp := tls.Alloc(8) defer tls.Free(8) // var pStmt uintptr at bp, 8 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16285 /* "STMT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16629 /* "STMT" */) return TCL_ERROR } @@ -47879,7 +49410,7 @@ func test_sql(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, obj return TCL_OK } -func test_ex_sql(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4784:26: */ +func test_ex_sql(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4973:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -47888,7 +49419,7 @@ func test_ex_sql(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, var z uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16285 /* "STMT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16629 /* "STMT" */) return TCL_ERROR } @@ -47904,15 +49435,15 @@ func test_ex_sql(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // Usage: sqlite3_column_count STMT // // Return the number of columns returned by the sql statement STMT. -func test_column_count(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4829:26: */ +func test_column_count(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5018:26: */ bp := tls.Alloc(40) defer tls.Free(40) // var pStmt uintptr at bp+32, 8 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16870 /* " STMT column" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+17214 /* " STMT column" */, 0)) return TCL_ERROR } @@ -47927,7 +49458,7 @@ func test_column_count(tls *libc.TLS, clientData uintptr, interp uintptr, objc i // Usage: sqlite3_column_type STMT column // // Return the type of the data in column 'column' of the current row. -func test_column_type(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4854:26: */ +func test_column_type(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5043:26: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -47938,8 +49469,8 @@ func test_column_type(tls *libc.TLS, clientData uintptr, interp uintptr, objc in var tp int32 if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16870 /* " STMT column" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+17214 /* " STMT column" */, 0)) return TCL_ERROR } @@ -47953,19 +49484,19 @@ func test_column_type(tls *libc.TLS, clientData uintptr, interp uintptr, objc in tp = sqlite3.Xsqlite3_column_type(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 40 /* col */))) switch tp { case SQLITE_INTEGER: - tcl.XTcl_SetResult(tls, interp, ts+2273 /* "INTEGER" */, uintptr(0)) + tcl.XTcl_SetResult(tls, interp, ts+2274 /* "INTEGER" */, uintptr(0)) break case SQLITE_NULL: - tcl.XTcl_SetResult(tls, interp, ts+5537 /* "NULL" */, uintptr(0)) + tcl.XTcl_SetResult(tls, interp, ts+5717 /* "NULL" */, uintptr(0)) break case SQLITE_FLOAT: - tcl.XTcl_SetResult(tls, interp, ts+16883 /* "FLOAT" */, uintptr(0)) + tcl.XTcl_SetResult(tls, interp, ts+17227 /* "FLOAT" */, uintptr(0)) break case SQLITE_TEXT: - tcl.XTcl_SetResult(tls, interp, ts+16889 /* "TEXT" */, uintptr(0)) + tcl.XTcl_SetResult(tls, interp, ts+17233 /* "TEXT" */, uintptr(0)) break case SQLITE_BLOB: - tcl.XTcl_SetResult(tls, interp, ts+16894 /* "BLOB" */, uintptr(0)) + tcl.XTcl_SetResult(tls, interp, ts+17238 /* "BLOB" */, uintptr(0)) break default: @@ -47978,7 +49509,7 @@ func test_column_type(tls *libc.TLS, clientData uintptr, interp uintptr, objc in // // Return the data in column 'column' of the current row cast as an // wide (64-bit) integer. -func test_column_int64(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4903:26: */ +func test_column_int64(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5092:26: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -47989,8 +49520,8 @@ func test_column_int64(tls *libc.TLS, clientData uintptr, interp uintptr, objc i var iVal i64 if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16870 /* " STMT column" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+17214 /* " STMT column" */, 0)) return TCL_ERROR } @@ -48007,7 +49538,7 @@ func test_column_int64(tls *libc.TLS, clientData uintptr, interp uintptr, objc i } // Usage: sqlite3_column_blob STMT column -func test_column_blob(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4930:26: */ +func test_column_blob(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5119:26: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -48019,8 +49550,8 @@ func test_column_blob(tls *libc.TLS, clientData uintptr, interp uintptr, objc in var pBlob uintptr if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16870 /* " STMT column" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+17214 /* " STMT column" */, 0)) return TCL_ERROR } @@ -48040,7 +49571,7 @@ func test_column_blob(tls *libc.TLS, clientData uintptr, interp uintptr, objc in // Usage: sqlite3_column_double STMT column // // Return the data in column 'column' of the current row cast as a double. -func test_column_double(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4962:26: */ +func test_column_double(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5151:26: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -48051,8 +49582,8 @@ func test_column_double(tls *libc.TLS, clientData uintptr, interp uintptr, objc var rVal float64 if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16870 /* " STMT column" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+17214 /* " STMT column" */, 0)) return TCL_ERROR } @@ -48071,15 +49602,15 @@ func test_column_double(tls *libc.TLS, clientData uintptr, interp uintptr, objc // Usage: sqlite3_data_count STMT // // Return the number of columns returned by the sql statement STMT. -func test_data_count(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4991:26: */ +func test_data_count(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5180:26: */ bp := tls.Alloc(40) defer tls.Free(40) // var pStmt uintptr at bp+32, 8 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16870 /* " STMT column" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+17214 /* " STMT column" */, 0)) return TCL_ERROR } @@ -48096,7 +49627,7 @@ func test_data_count(tls *libc.TLS, clientData uintptr, interp uintptr, objc int // Usage: sqlite3_column_decltype STMT column // // Usage: sqlite3_column_name STMT column -func test_stmt_utf8(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5018:26: */ +func test_stmt_utf8(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5207:26: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -48109,8 +49640,8 @@ func test_stmt_utf8(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 xFunc = clientData if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16870 /* " STMT column" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+17214 /* " STMT column" */, 0)) return TCL_ERROR } @@ -48127,10 +49658,10 @@ func test_stmt_utf8(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 return TCL_OK } -func test_global_recover(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5045:26: */ +func test_global_recover(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5234:26: */ var rc int32 if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } rc = sqlite3.Xsqlite3_global_recover(tls) @@ -48143,7 +49674,7 @@ func test_global_recover(tls *libc.TLS, clientData uintptr, interp uintptr, objc // Usage: sqlite3_column_decltype STMT column // // Usage: sqlite3_column_name STMT column -func test_stmt_utf16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5070:26: */ +func test_stmt_utf16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5259:26: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -48157,8 +49688,8 @@ func test_stmt_utf16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int xFunc = clientData if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16870 /* " STMT column" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+17214 /* " STMT column" */, 0)) return TCL_ERROR } @@ -48188,7 +49719,7 @@ func test_stmt_utf16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int // // Usage: sqlite3_column_bytes16 STMT column // -func test_stmt_int(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5114:26: */ +func test_stmt_int(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5303:26: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -48200,8 +49731,8 @@ func test_stmt_int(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 xFunc = clientData if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16870 /* " STMT column" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+17214 /* " STMT column" */, 0)) return TCL_ERROR } @@ -48219,29 +49750,29 @@ func test_stmt_int(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 // Usage: sqlite_set_magic DB MAGIC-NUMBER // // Set the db->magic value. This is used to test error recovery logic. -func sqlite_set_magic(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5143:26: */ +func sqlite_set_magic(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5332:26: */ bp := tls.Alloc(40) defer tls.Free(40) // var db uintptr at bp+32, 8 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+16899 /* " DB MAGIC" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+17243 /* " DB MAGIC" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+32 /* &db */) != 0 { return TCL_ERROR } - if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ts+16909 /* "SQLITE_MAGIC_OPE..." */) == 0 { + if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ts+17253 /* "SQLITE_MAGIC_OPE..." */) == 0 { (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).Fmagic = SQLITE_MAGIC_OPEN - } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ts+16927 /* "SQLITE_MAGIC_CLO..." */) == 0 { + } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ts+17271 /* "SQLITE_MAGIC_CLO..." */) == 0 { (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).Fmagic = SQLITE_MAGIC_CLOSED - } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ts+16947 /* "SQLITE_MAGIC_BUS..." */) == 0 { + } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ts+17291 /* "SQLITE_MAGIC_BUS..." */) == 0 { (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).Fmagic = SQLITE_MAGIC_BUSY - } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ts+16965 /* "SQLITE_MAGIC_ERR..." */) == 0 { + } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ts+17309 /* "SQLITE_MAGIC_ERR..." */) == 0 { (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).Fmagic = SQLITE_MAGIC_ERROR - } else if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 2*8)), (*(*uintptr)(unsafe.Pointer(bp + 32 /* db */))+112 /* &.magic */)) != 0 { + } else if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 2*8)), (*(*uintptr)(unsafe.Pointer(bp + 32 /* db */))+116 /* &.magic */)) != 0 { return TCL_ERROR } return TCL_OK @@ -48250,14 +49781,14 @@ func sqlite_set_magic(tls *libc.TLS, clientData uintptr, interp uintptr, argc in // Usage: sqlite3_interrupt DB // // Trigger an interrupt on DB -func test_interrupt(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5175:26: */ +func test_interrupt(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5364:26: */ bp := tls.Alloc(40) defer tls.Free(40) // var db uintptr at bp+32, 8 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), ts+14503 /* " DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), ts+14683 /* " DB" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+32 /* &db */) != 0 { @@ -48272,7 +49803,7 @@ func test_interrupt(tls *libc.TLS, clientData uintptr, interp uintptr, argc int3 // Delete the user function 'function-name' from database handle DB. It // is assumed that the user function was created as UTF8, any number of // arguments (the way the TCL interface does it). -func delete_function(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5198:26: */ +func delete_function(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5387:26: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -48280,8 +49811,8 @@ func delete_function(tls *libc.TLS, clientData uintptr, interp uintptr, argc int // var db uintptr at bp+32, 8 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+16984 /* " DB function-nam..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+17328 /* " DB function-nam..." */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+32 /* &db */) != 0 { @@ -48297,7 +49828,7 @@ func delete_function(tls *libc.TLS, clientData uintptr, interp uintptr, argc int // Delete the collation sequence 'collation-name' from database handle // DB. It is assumed that the collation sequence was created as UTF8 (the // way the TCL interface does it). -func delete_collation(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5224:26: */ +func delete_collation(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5413:26: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -48305,8 +49836,8 @@ func delete_collation(tls *libc.TLS, clientData uintptr, interp uintptr, argc in // var db uintptr at bp+32, 8 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+16984 /* " DB function-nam..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+17328 /* " DB function-nam..." */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+32 /* &db */) != 0 { @@ -48321,7 +49852,7 @@ func delete_collation(tls *libc.TLS, clientData uintptr, interp uintptr, argc in // // Return true if the database DB is currently in auto-commit mode. // Return false if not. -func get_autocommit(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5249:26: */ +func get_autocommit(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5438:26: */ bp := tls.Alloc(94) defer tls.Free(94) @@ -48330,14 +49861,14 @@ func get_autocommit(tls *libc.TLS, clientData uintptr, interp uintptr, argc int3 // var db uintptr at bp+56, 8 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14503 /* " DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14683 /* " DB" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+56 /* &db */) != 0 { return TCL_ERROR } - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+64 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, sqlite3.Xsqlite3_get_autocommit(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */))))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+64 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+32, sqlite3.Xsqlite3_get_autocommit(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */))))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+64 /* &zBuf[0] */, 0)) return TCL_OK } @@ -48347,7 +49878,7 @@ func get_autocommit(tls *libc.TLS, clientData uintptr, interp uintptr, argc int3 // Set the busy timeout. This is more easily done using the timeout // method of the TCL interface. But we need a way to test the case // where it returns SQLITE_MISUSE. -func test_busy_timeout(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5275:26: */ +func test_busy_timeout(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5464:26: */ bp := tls.Alloc(60) defer tls.Free(60) @@ -48357,8 +49888,8 @@ func test_busy_timeout(tls *libc.TLS, clientData uintptr, interp uintptr, argc i // var db uintptr at bp+48, 8 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14503 /* " DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14683 /* " DB" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+48 /* &db */) != 0 { @@ -48376,10 +49907,10 @@ func test_busy_timeout(tls *libc.TLS, clientData uintptr, interp uintptr, argc i // // Return the name of the internal representation for the // value of the given variable. -func tcl_variable_type(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5301:26: */ +func tcl_variable_type(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5490:26: */ var pVar uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17002 /* "VARIABLE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17346 /* "VARIABLE" */) return TCL_ERROR } pVar = tcl.XTcl_GetVar2Ex(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0), TCL_LEAVE_ERR_MSG) @@ -48397,7 +49928,7 @@ func tcl_variable_type(tls *libc.TLS, clientData uintptr, interp uintptr, objc i // Attempt to release memory currently held but not actually required. // The integer N is the number of bytes we are trying to release. The // return value is the amount of memory actually released. -func test_release_memory(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5327:26: */ +func test_release_memory(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5516:26: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -48405,7 +49936,7 @@ func test_release_memory(tls *libc.TLS, clientData uintptr, interp uintptr, objc var amt int32 if (objc != 1) && (objc != 2) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17011 /* "?N?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17355 /* "?N?" */) return TCL_ERROR } if objc == 2 { @@ -48424,7 +49955,7 @@ func test_release_memory(tls *libc.TLS, clientData uintptr, interp uintptr, objc // // Attempt to release memory currently held by database DB. Return the // result code (which in the current implementation is always zero). -func test_db_release_memory(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5358:26: */ +func test_db_release_memory(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5547:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -48432,7 +49963,7 @@ func test_db_release_memory(tls *libc.TLS, clientData uintptr, interp uintptr, o var rc int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { @@ -48446,7 +49977,7 @@ func test_db_release_memory(tls *libc.TLS, clientData uintptr, interp uintptr, o // Usage: sqlite3_db_cacheflush DB // // Attempt to flush any dirty pages to disk. -func test_db_cacheflush(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5381:26: */ +func test_db_cacheflush(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5570:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -48454,7 +49985,7 @@ func test_db_cacheflush(tls *libc.TLS, clientData uintptr, interp uintptr, objc var rc int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { @@ -48473,7 +50004,7 @@ func test_db_cacheflush(tls *libc.TLS, clientData uintptr, interp uintptr, objc // Usage: sqlite3_system_errno DB // // Return the low-level system errno value. -func test_system_errno(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5409:26: */ +func test_system_errno(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5598:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -48481,7 +50012,7 @@ func test_system_errno(tls *libc.TLS, clientData uintptr, interp uintptr, objc i var iErrno int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { @@ -48495,7 +50026,7 @@ func test_system_errno(tls *libc.TLS, clientData uintptr, interp uintptr, objc i // Usage: sqlite3_db_filename DB DBNAME // // Return the name of a file associated with a database. -func test_db_filename(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5432:26: */ +func test_db_filename(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5621:26: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -48503,7 +50034,7 @@ func test_db_filename(tls *libc.TLS, clientData uintptr, interp uintptr, objc in var zDbName uintptr if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15728 /* "DB DBNAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15908 /* "DB DBNAME" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+16 /* &db */) != 0 { @@ -48518,7 +50049,7 @@ func test_db_filename(tls *libc.TLS, clientData uintptr, interp uintptr, objc in // // Return 1 or 0 if DBNAME is readonly or not. Return -1 if DBNAME does // not exist. -func test_db_readonly(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5456:26: */ +func test_db_readonly(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5645:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -48526,7 +50057,7 @@ func test_db_readonly(tls *libc.TLS, clientData uintptr, interp uintptr, objc in var zDbName uintptr if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15728 /* "DB DBNAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15908 /* "DB DBNAME" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { @@ -48542,14 +50073,14 @@ func test_db_readonly(tls *libc.TLS, clientData uintptr, interp uintptr, objc in // Query or set the soft heap limit for the current thread. The // limit is only changed if the N is present. The previous limit // is returned. -func test_soft_heap_limit(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5481:26: */ +func test_soft_heap_limit(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5670:26: */ bp := tls.Alloc(8) defer tls.Free(8) var amt sqlite3_int64 *(*Tcl_WideInt)(unsafe.Pointer(bp /* N */)) = int64(-1) if (objc != 1) && (objc != 2) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17011 /* "?N?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17355 /* "?N?" */) return TCL_ERROR } if objc == 2 { @@ -48567,14 +50098,14 @@ func test_soft_heap_limit(tls *libc.TLS, clientData uintptr, interp uintptr, obj // Query or set the hard heap limit for the current thread. The // limit is only changed if the N is present. The previous limit // is returned. -func test_hard_heap_limit(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5508:26: */ +func test_hard_heap_limit(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5697:26: */ bp := tls.Alloc(8) defer tls.Free(8) var amt sqlite3_int64 *(*Tcl_WideInt)(unsafe.Pointer(bp /* N */)) = int64(-1) if (objc != 1) && (objc != 2) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17011 /* "?N?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17355 /* "?N?" */) return TCL_ERROR } if objc == 2 { @@ -48590,7 +50121,7 @@ func test_hard_heap_limit(tls *libc.TLS, clientData uintptr, interp uintptr, obj // Usage: sqlite3_thread_cleanup // // Call the sqlite3_thread_cleanup API. -func test_thread_cleanup(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5533:26: */ +func test_thread_cleanup(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5722:26: */ sqlite3.Xsqlite3_thread_cleanup(tls) return TCL_OK } @@ -48599,7 +50130,7 @@ func test_thread_cleanup(tls *libc.TLS, clientData uintptr, interp uintptr, objc // // Return a list of numbers which are the PagerRefcount for all // pagers on each database connection. -func test_pager_refcounts(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5551:26: */ +func test_pager_refcounts(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5740:26: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -48611,8 +50142,8 @@ func test_pager_refcounts(tls *libc.TLS, clientData uintptr, interp uintptr, obj var pResult uintptr if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+14503 /* " DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+14683 /* " DB" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+32 /* &db */) != 0 { @@ -48644,12 +50175,12 @@ func test_pager_refcounts(tls *libc.TLS, clientData uintptr, interp uintptr, obj // This command is used to warn users that their TCL build is defective // and that the errors they are seeing in the test scripts might be // a result of their defective TCL rather than problems in SQLite. -func working_64bit_int(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5597:26: */ +func working_64bit_int(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5786:26: */ var pTestObj uintptr var working int32 = 0 pTestObj = tcl.XTcl_NewWideIntObj(tls, (int64(1000000) * int64(1234567890))) - working = (libc.Bool32(libc.Xstrcmp(tls, tcl.XTcl_GetString(tls, pTestObj), ts+17015 /* "1234567890000000" */) == 0)) + working = (libc.Bool32(libc.Xstrcmp(tls, tcl.XTcl_GetString(tls, pTestObj), ts+17359 /* "1234567890000000" */) == 0)) for ok := true; ok; ok = 0 != 0 { var _objPtr uintptr = pTestObj if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 { @@ -48666,7 +50197,7 @@ func working_64bit_int(tls *libc.TLS, clientData ClientData, interp uintptr, obj // it back again. This is used to test the ability to register a // VFS when none are previously registered, and the ability to // unregister the only available VFS. Ticket #2738 -func vfs_unlink_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5622:26: */ +func vfs_unlink_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5811:26: */ bp := tls.Alloc(496) defer tls.Free(496) @@ -48679,8 +50210,8 @@ func vfs_unlink_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc // var two sqlite3_vfs at bp+168, 168 sqlite3.Xsqlite3_vfs_unregister(tls, uintptr(0)) // Unregister of NULL is harmless - (*sqlite3_vfs)(unsafe.Pointer(bp /* &one */)).FzName = ts + 17032 /* "__one" */ - (*sqlite3_vfs)(unsafe.Pointer(bp + 168 /* &two */)).FzName = ts + 17038 /* "__two" */ + (*sqlite3_vfs)(unsafe.Pointer(bp /* &one */)).FzName = ts + 17376 /* "__one" */ + (*sqlite3_vfs)(unsafe.Pointer(bp + 168 /* &two */)).FzName = ts + 17382 /* "__two" */ // Calling sqlite3_vfs_register with 2nd argument of 0 does not // change the default VFS @@ -48747,13 +50278,13 @@ func vfs_unlink_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc // // This TCL command attempts to vfs_find and vfs_register when the // sqlite3_initialize() interface is failing. All calls should fail. -func vfs_initfail_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5724:26: */ +func vfs_initfail_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5913:26: */ bp := tls.Alloc(168) defer tls.Free(168) // var one sqlite3_vfs at bp, 168 - (*sqlite3_vfs)(unsafe.Pointer(bp /* &one */)).FzName = ts + 17032 /* "__one" */ + (*sqlite3_vfs)(unsafe.Pointer(bp /* &one */)).FzName = ts + 17376 /* "__one" */ if sqlite3.Xsqlite3_vfs_find(tls, uintptr(0)) != 0 { return TCL_ERROR @@ -48770,13 +50301,13 @@ func vfs_initfail_test(tls *libc.TLS, clientData ClientData, interp uintptr, obj } // Saved VFSes -var apVfs [20]uintptr /* test1.c:5744:20: */ -var nVfs int32 = 0 /* test1.c:5745:12 */ +var apVfs [20]uintptr /* test1.c:5933:20: */ +var nVfs int32 = 0 /* test1.c:5934:12 */ // tclcmd: vfs_unregister_all // // Unregister all VFSes. -func vfs_unregister_all(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5752:26: */ +func vfs_unregister_all(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5941:26: */ var i int32 for i = 0; i < (int32(uint64(unsafe.Sizeof(apVfs)) / uint64(unsafe.Sizeof(uintptr(0))))); i++ { apVfs[i] = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0)) @@ -48794,7 +50325,7 @@ func vfs_unregister_all(tls *libc.TLS, clientData ClientData, interp uintptr, ob // Restore all VFSes that were removed using vfs_unregister_all. Taking // care to put the linked list back together in the same order as it was // in before vfs_unregister_all was invoked. -func vfs_reregister_all(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5774:26: */ +func vfs_reregister_all(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5963:26: */ var i int32 for i = (nVfs - 1); i >= 0; i-- { sqlite3.Xsqlite3_vfs_register(tls, apVfs[i], 1) @@ -48806,7 +50337,7 @@ func vfs_reregister_all(tls *libc.TLS, clientData ClientData, interp uintptr, ob // // This TCL command runs the sqlite3_file_control interface and // verifies correct operation of the same. -func file_control_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5794:26: */ +func file_control_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5983:26: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -48817,8 +50348,8 @@ func file_control_test(tls *libc.TLS, clientData ClientData, interp uintptr, obj _ = rc if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+14503 /* " DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+14683 /* " DB" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+32 /* &db */) != 0 { @@ -48826,11 +50357,11 @@ func file_control_test(tls *libc.TLS, clientData ClientData, interp uintptr, obj } rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), uintptr(0), 0, bp+40 /* &iArg */) - rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+17044 /* "notadatabase" */, SQLITE_FCNTL_LOCKSTATE, bp+40 /* &iArg */) + rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+17388 /* "notadatabase" */, SQLITE_FCNTL_LOCKSTATE, bp+40 /* &iArg */) - rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+84 /* "main" */, -1, bp+40 /* &iArg */) + rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+85 /* "main" */, -1, bp+40 /* &iArg */) - rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+8199 /* "temp" */, -1, bp+40 /* &iArg */) + rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+8379 /* "temp" */, -1, bp+40 /* &iArg */) return TCL_OK } @@ -48839,7 +50370,7 @@ func file_control_test(tls *libc.TLS, clientData ClientData, interp uintptr, obj // // This TCL command runs the sqlite3_file_control interface and // verifies correct operation of the SQLITE_LAST_ERRNO verb. -func file_control_lasterrno_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5829:26: */ +func file_control_lasterrno_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6018:26: */ bp := tls.Alloc(76) defer tls.Free(76) @@ -48849,8 +50380,8 @@ func file_control_lasterrno_test(tls *libc.TLS, clientData ClientData, interp ui var rc int32 if objc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+14503 /* " DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+14683 /* " DB" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+64 /* &db */) != 0 { @@ -48862,8 +50393,8 @@ func file_control_lasterrno_test(tls *libc.TLS, clientData ClientData, interp ui return TCL_ERROR } if *(*int32)(unsafe.Pointer(bp + 72 /* iArg */)) != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+17057, /* "Unexpected non-z..." */ - tcl.XTcl_GetStringFromObj(tls, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 72 /* iArg */))), uintptr(0)), ts+4585 /* " " */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+17401, /* "Unexpected non-z..." */ + tcl.XTcl_GetStringFromObj(tls, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 72 /* iArg */))), uintptr(0)), ts+4765 /* " " */, 0)) return TCL_ERROR } return TCL_OK @@ -48873,7 +50404,7 @@ func file_control_lasterrno_test(tls *libc.TLS, clientData ClientData, interp ui // // This TCL command runs the sqlite3_file_control with the // SQLITE_FCNTL_DATA_VERSION opcode, returning the result. -func file_control_data_version(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5866:26: */ +func file_control_data_version(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6055:26: */ bp := tls.Alloc(120) defer tls.Free(120) @@ -48886,7 +50417,7 @@ func file_control_data_version(tls *libc.TLS, clientData ClientData, interp uint // var zBuf [100]int8 at bp+20, 100 if (objc != 3) && (objc != 2) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17085 /* "DB [DBNAME]" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17429 /* "DB [DBNAME]" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+8 /* &db */) != 0 { @@ -48903,7 +50434,7 @@ func file_control_data_version(tls *libc.TLS, clientData ClientData, interp uint tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(0)) return TCL_ERROR } else { - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+20 /* &zBuf[0] */, ts+17097 /* "%u" */, libc.VaList(bp, *(*uint32)(unsafe.Pointer(bp + 16 /* iVers */)))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+20 /* &zBuf[0] */, ts+17441 /* "%u" */, libc.VaList(bp, *(*uint32)(unsafe.Pointer(bp + 16 /* iVers */)))) tcl.XTcl_SetResult(tls, interp, bp+20 /* zBuf */, uintptr(1)) return TCL_OK } @@ -48915,7 +50446,7 @@ func file_control_data_version(tls *libc.TLS, clientData ClientData, interp uint // This TCL command runs the sqlite3_file_control interface and // verifies correct operation of the SQLITE_GET_LOCKPROXYFILE and // SQLITE_SET_LOCKPROXYFILE verbs. -func file_control_chunksize_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5905:26: */ +func file_control_chunksize_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6094:26: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -48927,7 +50458,7 @@ func file_control_chunksize_test(tls *libc.TLS, clientData ClientData, interp ui var rc int32 // file_control() return code if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17100 /* "DB DBNAME SIZE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17444 /* "DB DBNAME SIZE" */) return TCL_ERROR } if (getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0) || @@ -48951,7 +50482,7 @@ func file_control_chunksize_test(tls *libc.TLS, clientData ClientData, interp ui // // This TCL command runs the sqlite3_file_control interface // with SQLITE_FCNTL_SIZE_HINT -func file_control_sizehint_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5942:26: */ +func file_control_sizehint_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6131:26: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -48963,7 +50494,7 @@ func file_control_sizehint_test(tls *libc.TLS, clientData ClientData, interp uin var rc int32 // file_control() return code if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17100 /* "DB DBNAME SIZE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17444 /* "DB DBNAME SIZE" */) return TCL_ERROR } if (getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0) || @@ -48988,15 +50519,15 @@ func file_control_sizehint_test(tls *libc.TLS, clientData ClientData, interp uin // This TCL command runs the sqlite3_file_control interface and // verifies correct operation of the SQLITE_GET_LOCKPROXYFILE and // SQLITE_SET_LOCKPROXYFILE verbs. -func file_control_lockproxy_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5980:26: */ +func file_control_lockproxy_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6169:26: */ bp := tls.Alloc(40) defer tls.Free(40) // var db uintptr at bp+32, 8 if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+17115 /* " DB PWD" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+17459 /* " DB PWD" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+32 /* &db */) != 0 { @@ -49010,7 +50541,7 @@ func file_control_lockproxy_test(tls *libc.TLS, clientData ClientData, interp ui // // This TCL command runs the sqlite3_file_control interface with // the SQLITE_FCNTL_PERSIST_WAL opcode. -func file_control_persist_wal(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6151:26: */ +func file_control_persist_wal(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6340:26: */ bp := tls.Alloc(176) defer tls.Free(176) @@ -49022,8 +50553,8 @@ func file_control_persist_wal(tls *libc.TLS, clientData ClientData, interp uintp // var z [100]int8 at bp+76, 100 if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+17123 /* " DB FLAG" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+17467 /* " DB FLAG" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+64 /* &db */) != 0 { @@ -49033,7 +50564,7 @@ func file_control_persist_wal(tls *libc.TLS, clientData ClientData, interp uintp return TCL_ERROR } rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* db */)), uintptr(0), SQLITE_FCNTL_PERSIST_WAL, bp+72 /* &bPersist */) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+76 /* &z[0] */, ts+17132 /* "%d %d" */, libc.VaList(bp+32, rc, *(*int32)(unsafe.Pointer(bp + 72 /* bPersist */)))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+76 /* &z[0] */, ts+17476 /* "%d %d" */, libc.VaList(bp+32, rc, *(*int32)(unsafe.Pointer(bp + 72 /* bPersist */)))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, bp+76 /* &z[0] */, uintptr(0))) return TCL_OK } @@ -49042,7 +50573,7 @@ func file_control_persist_wal(tls *libc.TLS, clientData ClientData, interp uintp // // This TCL command runs the sqlite3_file_control interface with // the SQLITE_FCNTL_POWERSAFE_OVERWRITE opcode. -func file_control_powersafe_overwrite(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6183:26: */ +func file_control_powersafe_overwrite(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6372:26: */ bp := tls.Alloc(176) defer tls.Free(176) @@ -49054,8 +50585,8 @@ func file_control_powersafe_overwrite(tls *libc.TLS, clientData ClientData, inte // var z [100]int8 at bp+76, 100 if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+17123 /* " DB FLAG" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+17467 /* " DB FLAG" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+64 /* &db */) != 0 { @@ -49065,7 +50596,7 @@ func file_control_powersafe_overwrite(tls *libc.TLS, clientData ClientData, inte return TCL_ERROR } rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* db */)), uintptr(0), SQLITE_FCNTL_POWERSAFE_OVERWRITE, bp+72 /* &b */) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+76 /* &z[0] */, ts+17132 /* "%d %d" */, libc.VaList(bp+32, rc, *(*int32)(unsafe.Pointer(bp + 72 /* b */)))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+76 /* &z[0] */, ts+17476 /* "%d %d" */, libc.VaList(bp+32, rc, *(*int32)(unsafe.Pointer(bp + 72 /* b */)))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, bp+76 /* &z[0] */, uintptr(0))) return TCL_OK } @@ -49073,18 +50604,18 @@ func file_control_powersafe_overwrite(tls *libc.TLS, clientData ClientData, inte // tclcmd: file_control_vfsname DB ?AUXDB? // // Return a string that describes the stack of VFSes. -func file_control_vfsname(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6215:26: */ +func file_control_vfsname(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6404:26: */ bp := tls.Alloc(64) defer tls.Free(64) // var db uintptr at bp+48, 8 - var zDbName uintptr = ts + 84 /* "main" */ + var zDbName uintptr = ts + 85 /* "main" */ *(*uintptr)(unsafe.Pointer(bp + 56 /* zVfsName */)) = uintptr(0) if (objc != 2) && (objc != 3) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+17138 /* " DB ?AUXDB?" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+17482 /* " DB ?AUXDB?" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+48 /* &db */) != 0 { @@ -49099,21 +50630,46 @@ func file_control_vfsname(tls *libc.TLS, clientData ClientData, interp uintptr, return TCL_OK } +// tclcmd: file_control_reservebytes DB N +func file_control_reservebytes(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6434:26: */ + bp := tls.Alloc(12) + defer tls.Free(12) + + // var db uintptr at bp, 8 + + var zDbName uintptr = ts + 85 /* "main" */ + *(*int32)(unsafe.Pointer(bp + 8 /* n */)) = 0 + var rc int32 + + if objc != 3 { + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17494 /* "DB N" */) + return TCL_ERROR + } + if (getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0) || + (tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+8 /* &n */) != 0) { + return TCL_ERROR + } + + rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), zDbName, SQLITE_FCNTL_RESERVE_BYTES, bp+8 /* &n */) + tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1)) + return TCL_OK +} + // tclcmd: file_control_tempfilename DB ?AUXDB? // // Return a string that is a temporary filename -func file_control_tempfilename(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6247:26: */ +func file_control_tempfilename(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6466:26: */ bp := tls.Alloc(64) defer tls.Free(64) // var db uintptr at bp+48, 8 - var zDbName uintptr = ts + 84 /* "main" */ + var zDbName uintptr = ts + 85 /* "main" */ *(*uintptr)(unsafe.Pointer(bp + 56 /* zTName */)) = uintptr(0) if (objc != 2) && (objc != 3) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+17138 /* " DB ?AUXDB?" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+17482 /* " DB ?AUXDB?" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+48 /* &db */) != 0 { @@ -49131,11 +50687,11 @@ func file_control_tempfilename(tls *libc.TLS, clientData ClientData, interp uint // tclcmd: sqlite3_vfs_list // // Return a tcl list containing the names of all registered vfs's. -func vfs_list(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6280:26: */ +func vfs_list(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6499:26: */ var pVfs uintptr var pRet uintptr = tcl.XTcl_NewObj(tls) if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } for pVfs = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0)); pVfs != 0; pVfs = (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpNext { @@ -49149,7 +50705,7 @@ func vfs_list(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, // // This TCL command runs the sqlite3_limit interface and // verifies correct operation of the same. -func test_limit(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6305:26: */ +func test_limit(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6524:26: */ bp := tls.Alloc(68) defer tls.Free(68) @@ -49163,8 +50719,8 @@ func test_limit(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32 var zId uintptr if objc != 4 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+17150 /* " DB ID VALUE" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+17499 /* " DB ID VALUE" */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+56 /* &db */) != 0 { @@ -49186,7 +50742,7 @@ func test_limit(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32 Fid int32 _ [4]byte }{}))) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+17163 /* "unknown limit ty..." */, zId, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+17512 /* "unknown limit ty..." */, zId, uintptr(0))) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+64 /* &val */) != 0 { @@ -49202,30 +50758,30 @@ var aId = [14]struct { Fid int32 _ [4]byte }{ - {FzName: ts + 17184 /* "SQLITE_LIMIT_LEN..." */}, - {FzName: ts + 17204 /* "SQLITE_LIMIT_SQL..." */, Fid: SQLITE_LIMIT_SQL_LENGTH}, - {FzName: ts + 17228 /* "SQLITE_LIMIT_COL..." */, Fid: SQLITE_LIMIT_COLUMN}, - {FzName: ts + 17248 /* "SQLITE_LIMIT_EXP..." */, Fid: SQLITE_LIMIT_EXPR_DEPTH}, - {FzName: ts + 17272 /* "SQLITE_LIMIT_COM..." */, Fid: SQLITE_LIMIT_COMPOUND_SELECT}, - {FzName: ts + 17301 /* "SQLITE_LIMIT_VDB..." */, Fid: SQLITE_LIMIT_VDBE_OP}, - {FzName: ts + 17322 /* "SQLITE_LIMIT_FUN..." */, Fid: SQLITE_LIMIT_FUNCTION_ARG}, - {FzName: ts + 17348 /* "SQLITE_LIMIT_ATT..." */, Fid: SQLITE_LIMIT_ATTACHED}, - {FzName: ts + 17370 /* "SQLITE_LIMIT_LIK..." */, Fid: SQLITE_LIMIT_LIKE_PATTERN_LENGTH}, - {FzName: ts + 17403 /* "SQLITE_LIMIT_VAR..." */, Fid: SQLITE_LIMIT_VARIABLE_NUMBER}, - {FzName: ts + 17432 /* "SQLITE_LIMIT_TRI..." */, Fid: SQLITE_LIMIT_TRIGGER_DEPTH}, - {FzName: ts + 17459 /* "SQLITE_LIMIT_WOR..." */, Fid: SQLITE_LIMIT_WORKER_THREADS}, + {FzName: ts + 17533 /* "SQLITE_LIMIT_LEN..." */}, + {FzName: ts + 17553 /* "SQLITE_LIMIT_SQL..." */, Fid: SQLITE_LIMIT_SQL_LENGTH}, + {FzName: ts + 17577 /* "SQLITE_LIMIT_COL..." */, Fid: SQLITE_LIMIT_COLUMN}, + {FzName: ts + 17597 /* "SQLITE_LIMIT_EXP..." */, Fid: SQLITE_LIMIT_EXPR_DEPTH}, + {FzName: ts + 17621 /* "SQLITE_LIMIT_COM..." */, Fid: SQLITE_LIMIT_COMPOUND_SELECT}, + {FzName: ts + 17650 /* "SQLITE_LIMIT_VDB..." */, Fid: SQLITE_LIMIT_VDBE_OP}, + {FzName: ts + 17671 /* "SQLITE_LIMIT_FUN..." */, Fid: SQLITE_LIMIT_FUNCTION_ARG}, + {FzName: ts + 17697 /* "SQLITE_LIMIT_ATT..." */, Fid: SQLITE_LIMIT_ATTACHED}, + {FzName: ts + 17719 /* "SQLITE_LIMIT_LIK..." */, Fid: SQLITE_LIMIT_LIKE_PATTERN_LENGTH}, + {FzName: ts + 17752 /* "SQLITE_LIMIT_VAR..." */, Fid: SQLITE_LIMIT_VARIABLE_NUMBER}, + {FzName: ts + 17781 /* "SQLITE_LIMIT_TRI..." */, Fid: SQLITE_LIMIT_TRIGGER_DEPTH}, + {FzName: ts + 17808 /* "SQLITE_LIMIT_WOR..." */, Fid: SQLITE_LIMIT_WORKER_THREADS}, // Out of range test cases - {FzName: ts + 17487 /* "SQLITE_LIMIT_TOO..." */, Fid: -1}, - {FzName: ts + 17509 /* "SQLITE_LIMIT_TOO..." */, Fid: (SQLITE_LIMIT_WORKER_THREADS + 1)}, -} /* test1.c:6316:5 */ + {FzName: ts + 17836 /* "SQLITE_LIMIT_TOO..." */, Fid: -1}, + {FzName: ts + 17858 /* "SQLITE_LIMIT_TOO..." */, Fid: (SQLITE_LIMIT_WORKER_THREADS + 1)}, +} /* test1.c:6535:5 */ // tclcmd: save_prng_state // // Save the state of the pseudo-random number generator. // At the same time, verify that sqlite3_test_control works even when // called with an out-of-range opcode. -func save_prng_state(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6368:26: */ +func save_prng_state(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6587:26: */ var rc int32 = sqlite3.Xsqlite3_test_control(tls, 9999, 0) _ = rc @@ -49236,13 +50792,13 @@ func save_prng_state(tls *libc.TLS, clientData ClientData, interp uintptr, objc } // tclcmd: restore_prng_state -func restore_prng_state(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6384:26: */ +func restore_prng_state(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6603:26: */ sqlite3.Xsqlite3_test_control(tls, SQLITE_TESTCTRL_PRNG_RESTORE, 0) return TCL_OK } // tclcmd: reset_prng_state -func reset_prng_state(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6396:26: */ +func reset_prng_state(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6615:26: */ sqlite3.Xsqlite3_randomness(tls, 0, uintptr(0)) return TCL_OK } @@ -49260,17 +50816,17 @@ func reset_prng_state(tls *libc.TLS, clientData ClientData, interp uintptr, objc // // If INT==0 and DB==0 then use the default procedure of calling the // xRandomness method on the default VFS to get the PRNG seed. -func prng_seed(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6420:26: */ +func prng_seed(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6639:26: */ bp := tls.Alloc(32) defer tls.Free(32) *(*int32)(unsafe.Pointer(bp + 16 /* i */)) = 0 *(*uintptr)(unsafe.Pointer(bp + 24 /* db */)) = uintptr(0) if (objc != 2) && (objc != 3) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17529 /* "SEED ?DB?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17878 /* "SEED ?DB?" */) return TCL_ERROR } - if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp+16 /* &i */) != 0 { + if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16 /* &i */) != 0 { return TCL_ERROR } if (objc == 3) && (getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), bp+24 /* &db */) != 0) { @@ -49286,13 +50842,13 @@ func prng_seed(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, // This is always enabled in production, but it is sometimes useful to // disable the checks in order to make some internal error states reachable // for testing. -func extra_schema_checks(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6448:26: */ +func extra_schema_checks(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6667:26: */ bp := tls.Alloc(12) defer tls.Free(12) *(*int32)(unsafe.Pointer(bp + 8 /* i */)) = 0 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17539 /* "BOOLEAN" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17888 /* "BOOLEAN" */) return TCL_ERROR } if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8 /* &i */) != 0 { @@ -49306,7 +50862,7 @@ func extra_schema_checks(tls *libc.TLS, clientData ClientData, interp uintptr, o // // Indicate that database files might be corrupt. In other words, set the normal // state of operation. -func database_may_be_corrupt(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6470:26: */ +func database_may_be_corrupt(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6689:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -49319,7 +50875,7 @@ func database_may_be_corrupt(tls *libc.TLS, clientData ClientData, interp uintpt // Indicate that database files are always well-formed. This enables // extra assert() statements that test conditions that are always true // for well-formed databases. -func database_never_corrupt(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6486:26: */ +func database_never_corrupt(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6705:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -49328,7 +50884,7 @@ func database_never_corrupt(tls *libc.TLS, clientData ClientData, interp uintptr } // tclcmd: pcache_stats -func test_pcache_stats(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6499:26: */ +func test_pcache_stats(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6718:26: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -49345,13 +50901,13 @@ func test_pcache_stats(tls *libc.TLS, clientData ClientData, interp uintptr, obj sqlite3.Xsqlite3PcacheStats(tls, bp /* &nCurrent */, bp+4 /* &nMax */, bp+8 /* &nMin */, bp+12 /* &nRecyclable */) pRet = tcl.XTcl_NewObj(tls) - tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+17547 /* "current" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+17896 /* "current" */, -1)) tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp /* nCurrent */)))) - tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+17555 /* "max" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+17904 /* "max" */, -1)) tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 4 /* nMax */)))) - tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+17559 /* "min" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+17908 /* "min" */, -1)) tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 8 /* nMin */)))) - tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+17563 /* "recyclable" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+17912 /* "recyclable" */, -1)) tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 12 /* nRecyclable */)))) tcl.XTcl_SetObjResult(tls, interp, pRet) @@ -49359,15 +50915,15 @@ func test_pcache_stats(tls *libc.TLS, clientData ClientData, interp uintptr, obj return TCL_OK } -func test_unlock_notify_cb(tls *libc.TLS, aArg uintptr, nArg int32) { /* test1.c:6529:13: */ +func test_unlock_notify_cb(tls *libc.TLS, aArg uintptr, nArg int32) { /* test1.c:6748:13: */ var ii int32 for ii = 0; ii < nArg; ii++ { - tcl.XTcl_EvalEx(tls, *(*uintptr)(unsafe.Pointer(aArg + uintptr(ii)*8)), ts+13194 /* "unlock_notify" */, -1, TCL_EVAL_GLOBAL) + tcl.XTcl_EvalEx(tls, *(*uintptr)(unsafe.Pointer(aArg + uintptr(ii)*8)), ts+13374 /* "unlock_notify" */, -1, TCL_EVAL_GLOBAL) } } // tclcmd: sqlite3_unlock_notify db -func test_unlock_notify(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6541:26: */ +func test_unlock_notify(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6760:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -49376,7 +50932,7 @@ func test_unlock_notify(tls *libc.TLS, clientData ClientData, interp uintptr, ob var rc int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } @@ -49391,7 +50947,7 @@ func test_unlock_notify(tls *libc.TLS, clientData ClientData, interp uintptr, ob } // tclcmd: sqlite3_wal_checkpoint db ?NAME? -func test_wal_checkpoint(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6567:26: */ +func test_wal_checkpoint(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6786:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -49401,7 +50957,7 @@ func test_wal_checkpoint(tls *libc.TLS, clientData ClientData, interp uintptr, o var rc int32 if (objc != 3) && (objc != 2) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17574 /* "DB ?NAME?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17923 /* "DB ?NAME?" */) return TCL_ERROR } @@ -49432,7 +50988,7 @@ func test_wal_checkpoint(tls *libc.TLS, clientData ClientData, interp uintptr, o // are the values returned via the output parameters by wal_checkpoint_v2() - // the number of frames in the log and the number of frames in the log // that have been checkpointed. -func test_wal_checkpoint_v2(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6611:26: */ +func test_wal_checkpoint_v2(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6830:26: */ bp := tls.Alloc(96) defer tls.Free(96) @@ -49446,10 +51002,10 @@ func test_wal_checkpoint_v2(tls *libc.TLS, clientData ClientData, interp uintptr *(*int32)(unsafe.Pointer(bp + 92 /* nCkpt */)) = -555 var pRet uintptr - *(*[5]uintptr)(unsafe.Pointer(bp + 48 /* aMode */)) = [5]uintptr{ts + 17584 /* "passive" */, ts + 17592 /* "full" */, ts + 17597 /* "restart" */, ts + 17605 /* "truncate" */, uintptr(0)} + *(*[5]uintptr)(unsafe.Pointer(bp + 48 /* aMode */)) = [5]uintptr{ts + 17933 /* "passive" */, ts + 17941 /* "full" */, ts + 17946 /* "restart" */, ts + 17954 /* "truncate" */, uintptr(0)} if (objc != 3) && (objc != 4) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17614 /* "DB MODE ?NAME?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17963 /* "DB MODE ?NAME?" */) return TCL_ERROR } @@ -49457,7 +51013,7 @@ func test_wal_checkpoint_v2(tls *libc.TLS, clientData ClientData, interp uintptr zDb = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8))) } if (getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+32 /* &db */) != 0) || ((TCL_OK != tcl.XTcl_GetIntFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+40 /* &eMode */)) && - (TCL_OK != tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+48 /* &aMode[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+17629 /* "mode" */, 0, bp+40 /* &eMode */))) { + (TCL_OK != tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+48 /* &aMode[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+17978 /* "mode" */, 0, bp+40 /* &eMode */))) { return TCL_ERROR } @@ -49465,7 +51021,7 @@ func test_wal_checkpoint_v2(tls *libc.TLS, clientData ClientData, interp uintptr if (rc != SQLITE_OK) && (rc != SQLITE_BUSY) { var zErrCode uintptr = sqlite3.Xsqlite3ErrName(tls, rc) tcl.XTcl_ResetResult(tls, interp) - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, zErrCode, ts+10102 /* " - " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */))), 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, zErrCode, ts+10282 /* " - " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */))), 0)) return TCL_ERROR } @@ -49484,7 +51040,7 @@ func test_wal_checkpoint_v2(tls *libc.TLS, clientData ClientData, interp uintptr } // tclcmd: sqlite3_wal_autocheckpoint db VALUE -func test_wal_autocheckpoint(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6667:26: */ +func test_wal_autocheckpoint(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6886:26: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -49494,7 +51050,7 @@ func test_wal_autocheckpoint(tls *libc.TLS, clientData ClientData, interp uintpt // var iVal int32 at bp+8, 4 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17634 /* "DB VALUE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17983 /* "DB VALUE" */) return TCL_ERROR } @@ -49518,12 +51074,12 @@ func test_wal_autocheckpoint(tls *libc.TLS, clientData ClientData, interp uintpt type LogCallback = struct { FpInterp uintptr FpObj uintptr -} /* test1.c:6704:8 */ +} /* test1.c:6923:8 */ // tclcmd: test_sqlite3_log ?SCRIPT? -var logcallback = LogCallback{} /* test1.c:6707:3 */ +var logcallback = LogCallback{} /* test1.c:6926:3 */ -func xLogcallback(tls *libc.TLS, unused uintptr, err int32, zMsg uintptr) { /* test1.c:6708:13: */ +func xLogcallback(tls *libc.TLS, unused uintptr, err int32, zMsg uintptr) { /* test1.c:6927:13: */ var pNew uintptr = tcl.XTcl_DuplicateObj(tls, logcallback.FpObj) (*Tcl_Obj)(unsafe.Pointer(pNew)).FrefCount++ tcl.XTcl_ListObjAppendElement(tls, @@ -49538,12 +51094,12 @@ func xLogcallback(tls *libc.TLS, unused uintptr, err int32, zMsg uintptr) { /* t } } -func test_sqlite3_log(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6718:26: */ +func test_sqlite3_log(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6937:26: */ bp := tls.Alloc(32) defer tls.Free(32) if objc > 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+11405 /* "SCRIPT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+11585 /* "SCRIPT" */) return TCL_ERROR } if logcallback.FpObj != 0 { @@ -49572,23 +51128,23 @@ func test_sqlite3_log(tls *libc.TLS, clientData ClientData, interp uintptr, objc // // Run a TCL command using its objProc interface. Throw an error if // the command has no objProc interface. -func runAsObjProc(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6749:26: */ +func runAsObjProc(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6968:26: */ bp := tls.Alloc(112) defer tls.Free(112) // var cmdInfo Tcl_CmdInfo at bp+48, 64 if objc < 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17643 /* "COMMAND ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17992 /* "COMMAND ..." */) return TCL_ERROR } if !(tcl.XTcl_GetCommandInfo(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+48 /* &cmdInfo */) != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14361, /* "command not foun..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14541, /* "command not foun..." */ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0))) return TCL_ERROR } if (*Tcl_CmdInfo)(unsafe.Pointer(bp+48 /* &cmdInfo */)).FobjProc == uintptr(0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+17655, /* "command has no o..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+18004, /* "command has no o..." */ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0))) return TCL_ERROR } @@ -49601,7 +51157,7 @@ func runAsObjProc(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // Argument pStmt is a prepared SQL statement. This function compiles // an EXPLAIN QUERY PLAN command to report on the prepared statement, // and prints the report to stdout using printf(). -func printExplainQueryPlan(tls *libc.TLS, pStmt uintptr) int32 { /* test1.c:6784:5: */ +func printExplainQueryPlan(tls *libc.TLS, pStmt uintptr) int32 { /* test1.c:7003:5: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -49616,7 +51172,7 @@ func printExplainQueryPlan(tls *libc.TLS, pStmt uintptr) int32 { /* test1.c:6784 return SQLITE_ERROR } - zExplain = sqlite3.Xsqlite3_mprintf(tls, ts+234 /* "EXPLAIN QUERY PL..." */, libc.VaList(bp, zSql)) + zExplain = sqlite3.Xsqlite3_mprintf(tls, ts+235 /* "EXPLAIN QUERY PL..." */, libc.VaList(bp, zSql)) if zExplain == uintptr(0) { return SQLITE_NOMEM } @@ -49633,13 +51189,13 @@ func printExplainQueryPlan(tls *libc.TLS, pStmt uintptr) int32 { /* test1.c:6784 var iFrom int32 = sqlite3.Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pExplain */)), 2) var zDetail uintptr = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pExplain */)), 3) - libc.Xprintf(tls, ts+17680 /* "%d %d %d %s\n" */, libc.VaList(bp+8, iSelectid, iOrder, iFrom, zDetail)) + libc.Xprintf(tls, ts+18029 /* "%d %d %d %s\n" */, libc.VaList(bp+8, iSelectid, iOrder, iFrom, zDetail)) } return sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pExplain */))) } -func test_print_eqp(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6812:26: */ +func test_print_eqp(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7031:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -49647,7 +51203,7 @@ func test_print_eqp(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 // var pStmt uintptr at bp, 8 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16285 /* "STMT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16629 /* "STMT" */) return TCL_ERROR } if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &pStmt */) != 0 { @@ -49663,15 +51219,15 @@ func test_print_eqp(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 } // sqlite3_test_control VERB ARGS... -func test_test_control(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6840:26: */ +func test_test_control(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7059:26: */ bp := tls.Alloc(184) defer tls.Free(184) *(*[4]Verb)(unsafe.Pointer(bp + 64 /* aVerb */)) = [4]Verb{ - {FzName: ts + 17693 /* "SQLITE_TESTCTRL_..." */, Fi: SQLITE_TESTCTRL_LOCALTIME_FAULT}, - {FzName: ts + 17725 /* "SQLITE_TESTCTRL_..." */, Fi: SQLITE_TESTCTRL_SORTER_MMAP}, - {FzName: ts + 17753 /* "SQLITE_TESTCTRL_..." */, Fi: SQLITE_TESTCTRL_IMPOSTER}, - {FzName: ts + 17778 /* "SQLITE_TESTCTRL_..." */, Fi: SQLITE_TESTCTRL_INTERNAL_FUNCTIONS}, + {FzName: ts + 18042 /* "SQLITE_TESTCTRL_..." */, Fi: SQLITE_TESTCTRL_LOCALTIME_FAULT}, + {FzName: ts + 18074 /* "SQLITE_TESTCTRL_..." */, Fi: SQLITE_TESTCTRL_SORTER_MMAP}, + {FzName: ts + 18102 /* "SQLITE_TESTCTRL_..." */, Fi: SQLITE_TESTCTRL_IMPOSTER}, + {FzName: ts + 18127 /* "SQLITE_TESTCTRL_..." */, Fi: SQLITE_TESTCTRL_INTERNAL_FUNCTIONS}, } // var iVerb int32 at bp+128, 4 @@ -49679,12 +51235,12 @@ func test_test_control(tls *libc.TLS, clientData uintptr, interp uintptr, objc i var rc int32 if objc < 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17813 /* "VERB ARGS..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18162 /* "VERB ARGS..." */) return TCL_ERROR } rc = tcl.XTcl_GetIndexFromObjStruct(tls, - interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+64 /* &aVerb[0] */, int32(unsafe.Sizeof(Verb{})), ts+17826 /* "VERB" */, 0, bp+128 /* &iVerb */) + interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+64 /* &aVerb[0] */, int32(unsafe.Sizeof(Verb{})), ts+18175 /* "VERB" */, 0, bp+128 /* &iVerb */) if rc != TCL_OK { return rc } @@ -49695,7 +51251,7 @@ func test_test_control(tls *libc.TLS, clientData uintptr, interp uintptr, objc i { *(*uintptr)(unsafe.Pointer(bp + 136 /* db */)) = uintptr(0) if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), bp+136 /* &db */) != 0 { @@ -49710,7 +51266,7 @@ func test_test_control(tls *libc.TLS, clientData uintptr, interp uintptr, objc i // var val int32 at bp+144, 4 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+17831 /* "ONOFF" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+18180 /* "ONOFF" */) return TCL_ERROR } if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+144 /* &val */) != 0 { @@ -49728,7 +51284,7 @@ func test_test_control(tls *libc.TLS, clientData uintptr, interp uintptr, objc i // var db uintptr at bp+152, 8 if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+17837 /* "DB LIMIT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+18186 /* "DB LIMIT" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), bp+152 /* &db */) != 0 { @@ -49752,7 +51308,7 @@ func test_test_control(tls *libc.TLS, clientData uintptr, interp uintptr, objc i // var db uintptr at bp+168, 8 if objc != 6 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+17846 /* "DB dbName onOff ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+18195 /* "DB dbName onOff ..." */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), bp+168 /* &db */) != 0 { @@ -49779,7 +51335,7 @@ type Verb = struct { FzName uintptr Fi int32 _ [4]byte -} /* test1.c:6846:3 */ +} /* test1.c:7065:3 */ // Value to indicate that there is no limit. @@ -49868,7 +51424,7 @@ type rusage = struct { F__136 struct{ Fru_nivcsw int64 } } /* struct_rusage.h:31:1 */ -func test_getrusage(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6930:26: */ +func test_getrusage(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7149:26: */ bp := tls.Alloc(1216) defer tls.Free(1216) @@ -49880,7 +51436,7 @@ func test_getrusage(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 libc.Xgetrusage(tls, RUSAGE_SELF, bp+48 /* &r */) sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1024]int8{})), bp+192, /* &buf[0] */ - ts+17867, /* "ru_utime=%d.%06d..." */ + ts+18216, /* "ru_utime=%d.%06d..." */ libc.VaList(bp, int32((*rusage)(unsafe.Pointer(bp+48 /* &r */)).Fru_utime.Ftv_sec), int32((*rusage)(unsafe.Pointer(bp+48 /* &r */)).Fru_utime.Ftv_usec), int32((*rusage)(unsafe.Pointer(bp+48 /* &r */)).Fru_stime.Ftv_sec), int32((*rusage)(unsafe.Pointer(bp+48 /* &r */)).Fru_stime.Ftv_usec), int32(*(*int64)(unsafe.Pointer(bp + 48 /* &r */ + 64 /* &.ru_minflt */))), int32(*(*int64)(unsafe.Pointer(bp + 48 /* &r */ + 72 /* &.ru_majflt */))))) @@ -49893,7 +51449,7 @@ func test_getrusage(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 // Enable or disable query optimizations using the sqlite3_test_control() // interface. Disable if BOOLEAN is false and enable if BOOLEAN is true. // OPT is the name of the optimization to be disabled. -func optimization_control(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7210:26: */ +func optimization_control(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7429:26: */ bp := tls.Alloc(68) defer tls.Free(68) @@ -49906,7 +51462,7 @@ func optimization_control(tls *libc.TLS, clientData uintptr, interp uintptr, obj var mask int32 = 0 if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17927 /* "DB OPT BOOLEAN" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18276 /* "DB OPT BOOLEAN" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+56 /* &db */) != 0 { @@ -49934,14 +51490,14 @@ func optimization_control(tls *libc.TLS, clientData uintptr, interp uintptr, obj Fmask int32 _ [4]byte }{}))) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+17942, /* "unknown optimiza..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+18291, /* "unknown optimiza..." */ uintptr(0))) for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aOpt)) / uint64(unsafe.Sizeof(struct { FzOptName uintptr Fmask int32 _ [4]byte }{}))); i++ { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+4585 /* " " */, aOpt[i].FzOptName, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+4765 /* " " */, aOpt[i].FzOptName, uintptr(0))) } return TCL_ERROR } @@ -49954,25 +51510,25 @@ var aOpt = [13]struct { Fmask int32 _ [4]byte }{ - {FzOptName: ts + 17983 /* "all" */, Fmask: SQLITE_AllOpts}, - {FzOptName: ts + 17987 /* "none" */}, - {FzOptName: ts + 17992 /* "query-flattener" */, Fmask: SQLITE_QueryFlattener}, - {FzOptName: ts + 18008 /* "groupby-order" */, Fmask: SQLITE_GroupByOrder}, - {FzOptName: ts + 18022 /* "factor-constants" */, Fmask: SQLITE_FactorOutConst}, - {FzOptName: ts + 18039 /* "distinct-opt" */, Fmask: SQLITE_DistinctOpt}, - {FzOptName: ts + 18052 /* "cover-idx-scan" */, Fmask: SQLITE_CoverIdxScan}, - {FzOptName: ts + 18067 /* "order-by-idx-joi..." */, Fmask: SQLITE_OrderByIdxJoin}, - {FzOptName: ts + 18085 /* "transitive" */, Fmask: SQLITE_Transitive}, - {FzOptName: ts + 18096 /* "omit-noop-join" */, Fmask: SQLITE_OmitNoopJoin}, - {FzOptName: ts + 18111 /* "stat4" */, Fmask: SQLITE_Stat4}, - {FzOptName: ts + 18117 /* "skip-scan" */, Fmask: SQLITE_SkipScan}, - {FzOptName: ts + 18127 /* "push-down" */, Fmask: SQLITE_PushDown}, -} /* test1.c:7224:5 */ + {FzOptName: ts + 18332 /* "all" */, Fmask: libc.Int32FromUint32(SQLITE_AllOpts)}, + {FzOptName: ts + 18336 /* "none" */}, + {FzOptName: ts + 18341 /* "query-flattener" */, Fmask: SQLITE_QueryFlattener}, + {FzOptName: ts + 18357 /* "groupby-order" */, Fmask: SQLITE_GroupByOrder}, + {FzOptName: ts + 18371 /* "factor-constants" */, Fmask: SQLITE_FactorOutConst}, + {FzOptName: ts + 18388 /* "distinct-opt" */, Fmask: SQLITE_DistinctOpt}, + {FzOptName: ts + 18401 /* "cover-idx-scan" */, Fmask: SQLITE_CoverIdxScan}, + {FzOptName: ts + 18416 /* "order-by-idx-joi..." */, Fmask: SQLITE_OrderByIdxJoin}, + {FzOptName: ts + 18434 /* "transitive" */, Fmask: SQLITE_Transitive}, + {FzOptName: ts + 18445 /* "omit-noop-join" */, Fmask: SQLITE_OmitNoopJoin}, + {FzOptName: ts + 18460 /* "stat4" */, Fmask: SQLITE_Stat4}, + {FzOptName: ts + 18466 /* "skip-scan" */, Fmask: SQLITE_SkipScan}, + {FzOptName: ts + 18476 /* "push-down" */, Fmask: SQLITE_PushDown}, +} /* test1.c:7443:5 */ // load_static_extension DB NAME ... // // Load one or more statically linked extensions. -func tclLoadStaticExtensionCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7271:26: */ +func tclLoadStaticExtensionCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7490:26: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -49984,7 +51540,7 @@ func tclLoadStaticExtensionCmd(tls *libc.TLS, clientData uintptr, interp uintptr var rc int32 *(*uintptr)(unsafe.Pointer(bp + 72 /* zErrMsg */)) = uintptr(0) if objc < 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18137 /* "DB NAME ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18486 /* "DB NAME ..." */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+64 /* &db */) != 0 { @@ -50004,7 +51560,7 @@ func tclLoadStaticExtensionCmd(tls *libc.TLS, clientData uintptr, interp uintptr FzExtName uintptr FpInit uintptr }{})))) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+18149 /* "no such extensio..." */, zName, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+18498 /* "no such extensio..." */, zName, uintptr(0))) return TCL_ERROR } if aExtension[i].FpInit != 0 { @@ -50012,8 +51568,8 @@ func tclLoadStaticExtensionCmd(tls *libc.TLS, clientData uintptr, interp uintptr } else { rc = SQLITE_OK } - if (rc != SQLITE_OK) || (*(*uintptr)(unsafe.Pointer(bp + 72 /* zErrMsg */)) != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+18169 /* "initialization o..." */, zName, ts+18188 /* " failed: " */, *(*uintptr)(unsafe.Pointer(bp + 72 /* zErrMsg */)), + if ((rc != SQLITE_OK) && (rc != (SQLITE_OK | (int32(1) << 8)))) || (*(*uintptr)(unsafe.Pointer(bp + 72 /* zErrMsg */)) != 0) { + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+18518 /* "initialization o..." */, zName, ts+18537 /* " failed: " */, *(*uintptr)(unsafe.Pointer(bp + 72 /* zErrMsg */)), uintptr(0))) sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* zErrMsg */))) return TCL_ERROR @@ -50022,43 +51578,44 @@ func tclLoadStaticExtensionCmd(tls *libc.TLS, clientData uintptr, interp uintptr return TCL_OK } -var aExtension = [21]struct { +var aExtension = [22]struct { FzExtName uintptr FpInit uintptr }{ - {FzExtName: ts + 18198 /* "amatch" */, FpInit: 0}, - {FzExtName: ts + 3862 /* "carray" */, FpInit: 0}, - {FzExtName: ts + 18205 /* "closure" */, FpInit: 0}, - {FzExtName: ts + 4506 /* "csv" */, FpInit: 0}, - {FzExtName: ts + 4529 /* "decimal" */, FpInit: 0}, - {FzExtName: ts + 4587 /* "eval" */, FpInit: 0}, - {FzExtName: ts + 4665 /* "explain" */, FpInit: 0}, - {FzExtName: ts + 18213 /* "fileio" */, FpInit: 0}, - {FzExtName: ts + 5174 /* "fuzzer" */, FpInit: 0}, - {FzExtName: ts + 5198 /* "ieee754" */, FpInit: 0}, - {FzExtName: ts + 18220 /* "nextchar" */, FpInit: 0}, - {FzExtName: ts + 5778 /* "percentile" */, FpInit: 0}, - {FzExtName: ts + 5853 /* "prefixes" */, FpInit: 0}, - {FzExtName: ts + 6165 /* "regexp" */, FpInit: 0}, - {FzExtName: ts + 6172 /* "remember" */, FpInit: 0}, - {FzExtName: ts + 18229 /* "series" */, FpInit: 0}, - {FzExtName: ts + 18236 /* "spellfix" */, FpInit: 0}, - {FzExtName: ts + 18245 /* "totype" */, FpInit: 0}, - {FzExtName: ts + 8189 /* "unionvtab" */, FpInit: 0}, - {FzExtName: ts + 8731 /* "wholenumber" */, FpInit: 0}, - {FzExtName: ts + 8834 /* "zipfile" */, FpInit: 0}, -} /* test1.c:7305:5 */ + {FzExtName: ts + 18547 /* "amatch" */, FpInit: 0}, + {FzExtName: ts + 18554 /* "appendvfs" */, FpInit: 0}, + {FzExtName: ts + 3931 /* "carray" */, FpInit: 0}, + {FzExtName: ts + 18564 /* "closure" */, FpInit: 0}, + {FzExtName: ts + 4686 /* "csv" */, FpInit: 0}, + {FzExtName: ts + 4709 /* "decimal" */, FpInit: 0}, + {FzExtName: ts + 4767 /* "eval" */, FpInit: 0}, + {FzExtName: ts + 4845 /* "explain" */, FpInit: 0}, + {FzExtName: ts + 18572 /* "fileio" */, FpInit: 0}, + {FzExtName: ts + 5354 /* "fuzzer" */, FpInit: 0}, + {FzExtName: ts + 5378 /* "ieee754" */, FpInit: 0}, + {FzExtName: ts + 18579 /* "nextchar" */, FpInit: 0}, + {FzExtName: ts + 5958 /* "percentile" */, FpInit: 0}, + {FzExtName: ts + 6033 /* "prefixes" */, FpInit: 0}, + {FzExtName: ts + 6345 /* "regexp" */, FpInit: 0}, + {FzExtName: ts + 6352 /* "remember" */, FpInit: 0}, + {FzExtName: ts + 18588 /* "series" */, FpInit: 0}, + {FzExtName: ts + 18595 /* "spellfix" */, FpInit: 0}, + {FzExtName: ts + 18604 /* "totype" */, FpInit: 0}, + {FzExtName: ts + 8369 /* "unionvtab" */, FpInit: 0}, + {FzExtName: ts + 8911 /* "wholenumber" */, FpInit: 0}, + {FzExtName: ts + 9014 /* "zipfile" */, FpInit: 0}, +} /* test1.c:7525:5 */ // sorter_test_fakeheap BOOL // -func sorter_test_fakeheap(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7369:26: */ +func sorter_test_fakeheap(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7590:26: */ bp := tls.Alloc(4) defer tls.Free(4) // var bArg int32 at bp, 4 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18252 /* "BOOL" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18611 /* "BOOL" */) return TCL_ERROR } @@ -50088,7 +51645,7 @@ func sorter_test_fakeheap(tls *libc.TLS, clientData uintptr, interp uintptr, obj // // Then execute statement $SQL2. Check that the statement returns the same // set of integers in the same order as in the previous step (using $SQL1). -func sorter_test_sort4_helper(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7409:26: */ +func sorter_test_sort4_helper(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7630:26: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -50113,7 +51670,7 @@ func sorter_test_sort4_helper(tls *libc.TLS, clientData uintptr, interp uintptr, if !(objc != 5) { goto __1 } - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18257 /* "DB SQL1 NSTEP SQ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18616 /* "DB SQL1 NSTEP SQ..." */) return TCL_ERROR __1: ; @@ -50151,7 +51708,7 @@ __5: if !(a != sqlite3.Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pStmt */)), iB)) { goto __8 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+18276 /* "data error: (a!=..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+18635 /* "data error: (a!=..." */, 0)) return TCL_ERROR __8: ; @@ -50204,14 +51761,14 @@ __14: if !(iCksum1 != iCksum2) { goto __15 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+18295 /* "checksum mismatc..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+18654 /* "checksum mismatc..." */, 0)) return TCL_ERROR __15: ; return TCL_OK sql_error: - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+18313 /* "sql error: " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */))), 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+18672 /* "sql error: " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */))), 0)) return TCL_ERROR } @@ -50226,7 +51783,7 @@ sql_error: // 2 Jump based on an uninitialized variable // 3 Read after free // 4 Panic -func test_bad_behavior(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7612:26: */ +func test_bad_behavior(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7833:26: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -50239,7 +51796,7 @@ func test_bad_behavior(tls *libc.TLS, clientData ClientData, interp uintptr, obj var a uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18325 /* "TYPE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18684 /* "TYPE" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &iType */) != 0 { @@ -50277,7 +51834,7 @@ func test_bad_behavior(tls *libc.TLS, clientData ClientData, interp uintptr, obj } case 4: { - tcl.XTcl_Panic(tls, ts+18330 /* "Deliberate panic" */, 0) + tcl.XTcl_Panic(tls, ts+18689 /* "Deliberate panic" */, 0) break } @@ -50288,7 +51845,7 @@ func test_bad_behavior(tls *libc.TLS, clientData ClientData, interp uintptr, obj // tclcmd: register_dbstat_vtab DB // // Cause the dbstat virtual table to be available on the connection DB -func test_register_dbstat_vtab(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7662:26: */ +func test_register_dbstat_vtab(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7883:26: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -50296,7 +51853,7 @@ func test_register_dbstat_vtab(tls *libc.TLS, clientData uintptr, interp uintptr // var cmdInfo Tcl_CmdInfo at bp, 64 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } @@ -50311,7 +51868,7 @@ func test_register_dbstat_vtab(tls *libc.TLS, clientData uintptr, interp uintptr // tclcmd: sqlite3_db_config DB SETTING VALUE // // Invoke sqlite3_db_config() for one of the setting values. -func test_sqlite3_db_config(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7696:26: */ +func test_sqlite3_db_config(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7917:26: */ bp := tls.Alloc(28) defer tls.Free(28) @@ -50321,20 +51878,20 @@ func test_sqlite3_db_config(tls *libc.TLS, clientData uintptr, interp uintptr, o // var db uintptr at bp+16, 8 if (objc != 4) && (objc != 3) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18347 /* "DB SETTING [VALU..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18706 /* "DB SETTING [VALU..." */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+16 /* &db */) != 0 { return TCL_ERROR } zSetting = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) - if sqlite3.Xsqlite3_strglob(tls, ts+18366 /* "SQLITE_*" */, zSetting) == 0 { + if sqlite3.Xsqlite3_strglob(tls, ts+18725 /* "SQLITE_*" */, zSetting) == 0 { zSetting += uintptr(7) } - if sqlite3.Xsqlite3_strglob(tls, ts+18375 /* "DBCONFIG_*" */, zSetting) == 0 { + if sqlite3.Xsqlite3_strglob(tls, ts+18734 /* "DBCONFIG_*" */, zSetting) == 0 { zSetting += uintptr(9) } - if sqlite3.Xsqlite3_strglob(tls, ts+18386 /* "ENABLE_*" */, zSetting) == 0 { + if sqlite3.Xsqlite3_strglob(tls, ts+18745 /* "ENABLE_*" */, zSetting) == 0 { zSetting += uintptr(7) } for i = 0; i < (int32(uint64(unsafe.Sizeof(aSetting)) / uint64(unsafe.Sizeof(struct { @@ -50352,7 +51909,7 @@ func test_sqlite3_db_config(tls *libc.TLS, clientData uintptr, interp uintptr, o _ [4]byte }{})))) { tcl.XTcl_SetObjResult(tls, interp, - tcl.XTcl_NewStringObj(tls, ts+18395 /* "unknown sqlite3_..." */, -1)) + tcl.XTcl_NewStringObj(tls, ts+18754 /* "unknown sqlite3_..." */, -1)) return TCL_ERROR } if objc == 4 { @@ -50372,24 +51929,55 @@ var aSetting = [14]struct { FeVal int32 _ [4]byte }{ - {FzName: ts + 18429 /* "FKEY" */, FeVal: SQLITE_DBCONFIG_ENABLE_FKEY}, - {FzName: ts + 18434 /* "TRIGGER" */, FeVal: SQLITE_DBCONFIG_ENABLE_TRIGGER}, - {FzName: ts + 18442 /* "FTS3_TOKENIZER" */, FeVal: SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER}, - {FzName: ts + 18457 /* "LOAD_EXTENSION" */, FeVal: SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION}, - {FzName: ts + 18472 /* "NO_CKPT_ON_CLOSE" */, FeVal: SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE}, - {FzName: ts + 18489 /* "QPSG" */, FeVal: SQLITE_DBCONFIG_ENABLE_QPSG}, - {FzName: ts + 18494 /* "TRIGGER_EQP" */, FeVal: SQLITE_DBCONFIG_TRIGGER_EQP}, - {FzName: ts + 18506 /* "RESET_DB" */, FeVal: SQLITE_DBCONFIG_RESET_DATABASE}, - {FzName: ts + 18515 /* "DEFENSIVE" */, FeVal: SQLITE_DBCONFIG_DEFENSIVE}, - {FzName: ts + 18525 /* "WRITABLE_SCHEMA" */, FeVal: SQLITE_DBCONFIG_WRITABLE_SCHEMA}, - {FzName: ts + 18541 /* "LEGACY_ALTER_TAB..." */, FeVal: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE}, - {FzName: ts + 18560 /* "DQS_DML" */, FeVal: SQLITE_DBCONFIG_DQS_DML}, - {FzName: ts + 18568 /* "DQS_DDL" */, FeVal: SQLITE_DBCONFIG_DQS_DDL}, - {FzName: ts + 18576 /* "LEGACY_FILE_FORM..." */, FeVal: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT}, -} /* test1.c:7705:5 */ + {FzName: ts + 18788 /* "FKEY" */, FeVal: SQLITE_DBCONFIG_ENABLE_FKEY}, + {FzName: ts + 18793 /* "TRIGGER" */, FeVal: SQLITE_DBCONFIG_ENABLE_TRIGGER}, + {FzName: ts + 18801 /* "FTS3_TOKENIZER" */, FeVal: SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER}, + {FzName: ts + 18816 /* "LOAD_EXTENSION" */, FeVal: SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION}, + {FzName: ts + 18831 /* "NO_CKPT_ON_CLOSE" */, FeVal: SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE}, + {FzName: ts + 18848 /* "QPSG" */, FeVal: SQLITE_DBCONFIG_ENABLE_QPSG}, + {FzName: ts + 18853 /* "TRIGGER_EQP" */, FeVal: SQLITE_DBCONFIG_TRIGGER_EQP}, + {FzName: ts + 18865 /* "RESET_DB" */, FeVal: SQLITE_DBCONFIG_RESET_DATABASE}, + {FzName: ts + 18874 /* "DEFENSIVE" */, FeVal: SQLITE_DBCONFIG_DEFENSIVE}, + {FzName: ts + 18884 /* "WRITABLE_SCHEMA" */, FeVal: SQLITE_DBCONFIG_WRITABLE_SCHEMA}, + {FzName: ts + 18900 /* "LEGACY_ALTER_TAB..." */, FeVal: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE}, + {FzName: ts + 18919 /* "DQS_DML" */, FeVal: SQLITE_DBCONFIG_DQS_DML}, + {FzName: ts + 18927 /* "DQS_DDL" */, FeVal: SQLITE_DBCONFIG_DQS_DDL}, + {FzName: ts + 18935 /* "LEGACY_FILE_FORM..." */, FeVal: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT}, +} /* test1.c:7926:5 */ + +// tclcmd: sqlite3_txn_state DB ?SCHEMA? +// +// Invoke sqlite3_txn_state(DB,SCHEMA) and return the +// numeric value that results. Use NULL for SCHEMA if the 3 argument +// is omitted. +func test_sqlite3_txn_state(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7980:26: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + // var db uintptr at bp, 8 + + var zSchema uintptr + var iTxn int32 + + if (objc != 2) && (objc != 3) { + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18954 /* "DB ?SCHEMA?" */) + return TCL_ERROR + } + if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { + return TCL_ERROR + } + if objc == 3 { + zSchema = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) + } else { + zSchema = uintptr(0) + } + iTxn = sqlite3.Xsqlite3_txn_state(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), zSchema) + tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, iTxn)) + return TCL_OK +} // Change the name of the main database schema from "main" to "icecube". -func test_dbconfig_maindbname_icecube(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7756:26: */ +func test_dbconfig_maindbname_icecube(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:8004:26: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -50397,13 +51985,13 @@ func test_dbconfig_maindbname_icecube(tls *libc.TLS, clientData uintptr, interp // var db uintptr at bp+8, 8 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } else { if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+8 /* &db */) != 0 { return TCL_ERROR } - rc = sqlite3.Xsqlite3_db_config(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* db */)), SQLITE_DBCONFIG_MAINDBNAME, libc.VaList(bp, ts+18595 /* "icecube" */)) + rc = sqlite3.Xsqlite3_db_config(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* db */)), SQLITE_DBCONFIG_MAINDBNAME, libc.VaList(bp, ts+18966 /* "icecube" */)) tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, rc)) return TCL_OK } @@ -50411,12 +51999,12 @@ func test_dbconfig_maindbname_icecube(tls *libc.TLS, clientData uintptr, interp } // Usage: sqlite3_mmap_warm DB DBNAME -func test_mmap_warm(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7779:26: */ +func test_mmap_warm(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:8027:26: */ bp := tls.Alloc(8) defer tls.Free(8) if (objc != 2) && (objc != 3) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18603 /* "DB ?DBNAME?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18974 /* "DB ?DBNAME?" */) return TCL_ERROR } else { var rc int32 @@ -50441,7 +52029,7 @@ func test_mmap_warm(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 // Obtain the sqlite3_file* object for the database file for the "main" db // of handle DB. Then invoke its xWrite method to write data DATA to offset // OFFSET. -func test_write_db(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7812:26: */ +func test_write_db(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:8060:26: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -50453,7 +52041,7 @@ func test_write_db(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 var rc int32 if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18615 /* "DB OFFSET DATA" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18986 /* "DB OFFSET DATA" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { @@ -50464,13 +52052,39 @@ func test_write_db(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 } aData = tcl.XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+16 /* &nData */) - sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+84 /* "main" */, SQLITE_FCNTL_FILE_POINTER, bp+24 /* &pFile */) + sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+85 /* "main" */, SQLITE_FCNTL_FILE_POINTER, bp+24 /* &pFile */) rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pFile */)))).FpMethods + 24 /* &.xWrite */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pFile */)), aData, *(*int32)(unsafe.Pointer(bp + 16 /* nData */)), *(*Tcl_WideInt)(unsafe.Pointer(bp + 8 /* iOff */))) tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1)) return TCL_OK } +// Usage: sqlite3_register_cksumvfs +// +func test_register_cksumvfs(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:8092:26: */ + if objc != 1 { + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) + return TCL_ERROR + } else { + var rc int32 = sqlite3_register_cksumvfs(tls, uintptr(0)) + tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1)) + } + return TCL_OK +} + +// Usage: sqlite3_unregister_cksumvfs +// +func test_unregister_cksumvfs(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:8113:26: */ + if objc != 1 { + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) + return TCL_ERROR + } else { + var rc int32 = sqlite3_unregister_cksumvfs(tls) + tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1)) + } + return TCL_OK +} + // Usage: decode_hexdb TEXT // // Example: db deserialize [decode_hexdb $output_of_dbtotxt] @@ -50478,7 +52092,7 @@ func test_write_db(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 // This routine returns a byte-array for an SQLite database file that // is constructed from a text input which is the output of the "dbtotxt" // utility. -func test_decode_hexdb(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7849:26: */ +func test_decode_hexdb(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:8139:26: */ bp := tls.Alloc(296) defer tls.Free(296) @@ -50497,7 +52111,7 @@ func test_decode_hexdb(tls *libc.TLS, clientData uintptr, interp uintptr, objc i // var x [16]uint32 at bp+232, 64 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18630 /* "HEXDB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+19001 /* "HEXDB" */) return TCL_ERROR } zIn = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -50514,33 +52128,33 @@ func test_decode_hexdb(tls *libc.TLS, clientData uintptr, interp uintptr, objc i if a == uintptr(0) { // var pgsz int32 at bp+220, 4 - rc = libc.Xsscanf(tls, (zIn + uintptr(i)), ts+18636 /* "| size %d pagesi..." */, libc.VaList(bp, bp+216 /* &n */, bp+220 /* &pgsz */)) + rc = libc.Xsscanf(tls, (zIn + uintptr(i)), ts+19007 /* "| size %d pagesi..." */, libc.VaList(bp, bp+216 /* &n */, bp+220 /* &pgsz */)) if rc != 2 { continue } if ((*(*int32)(unsafe.Pointer(bp + 220 /* pgsz */)) < 512) || (*(*int32)(unsafe.Pointer(bp + 220 /* pgsz */)) > 65536)) || ((*(*int32)(unsafe.Pointer(bp + 220 /* pgsz */)) & (*(*int32)(unsafe.Pointer(bp + 220 /* pgsz */)) - 1)) != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+18658 /* "bad 'pagesize' f..." */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+19029 /* "bad 'pagesize' f..." */, uintptr(0))) return TCL_ERROR } *(*int32)(unsafe.Pointer(bp + 216 /* n */)) = (((*(*int32)(unsafe.Pointer(bp + 216 /* n */)) + *(*int32)(unsafe.Pointer(bp + 220 /* pgsz */))) - 1) & ^(*(*int32)(unsafe.Pointer(bp + 220 /* pgsz */)) - 1)) // Round n up to the next multiple of pgsz if *(*int32)(unsafe.Pointer(bp + 216 /* n */)) < 512 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+18679 /* "bad 'size' field" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+19050 /* "bad 'size' field" */, uintptr(0))) return TCL_ERROR } a = libc.Xmalloc(tls, uint64(*(*int32)(unsafe.Pointer(bp + 216 /* n */)))) if a == uintptr(0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+1929 /* "out of memory" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+1930 /* "out of memory" */, uintptr(0))) return TCL_ERROR } libc.Xmemset(tls, a, 0, uint64(*(*int32)(unsafe.Pointer(bp + 216 /* n */)))) continue } - rc = libc.Xsscanf(tls, (zIn + uintptr(i)), ts+18696 /* "| page %d offset..." */, libc.VaList(bp+64, bp+224 /* &j */, bp+228 /* &k */)) + rc = libc.Xsscanf(tls, (zIn + uintptr(i)), ts+19067 /* "| page %d offset..." */, libc.VaList(bp+64, bp+224 /* &j */, bp+228 /* &k */)) if rc == 2 { iOffset = *(*int32)(unsafe.Pointer(bp + 228 /* k */)) continue } - rc = libc.Xsscanf(tls, (zIn + uintptr(i)), ts+18716, /* "| %d: %x %x %x %..." */ + rc = libc.Xsscanf(tls, (zIn + uintptr(i)), ts+19087, /* "| %d: %x %x %x %..." */ libc.VaList(bp+80, bp+224 /* &j */, (bp+232 /* &x */), (bp+232 /* &x */ +1*4), (bp+232 /* &x */ +2*4), (bp+232 /* &x */ +3*4), (bp+232 /* &x */ +4*4), (bp+232 /* &x */ +5*4), (bp+232 /* &x */ +6*4), (bp+232 /* &x */ +7*4), (bp+232 /* &x */ +8*4), (bp+232 /* &x */ +9*4), (bp+232 /* &x */ +10*4), (bp+232 /* &x */ +11*4), (bp+232 /* &x */ +12*4), (bp+232 /* &x */ +13*4), (bp+232 /* &x */ +14*4), (bp+232 /* &x */ +15*4))) if rc == 17 { @@ -50560,7 +52174,7 @@ func test_decode_hexdb(tls *libc.TLS, clientData uintptr, interp uintptr, objc i } // Register commands with the TCL interpreter. -func Sqlitetest1_Init(tls *libc.TLS, interp uintptr) int32 { /* test1.c:7921:5: */ +func Sqlitetest1_Init(tls *libc.TLS, interp uintptr) int32 { /* test1.c:8211:5: */ var i int32 for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd1)) / uint64(unsafe.Sizeof(struct { @@ -50577,280 +52191,285 @@ func Sqlitetest1_Init(tls *libc.TLS, interp uintptr) int32 { /* test1.c:7921:5: tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd1[i].FzName, aObjCmd1[i].FxProc, aObjCmd1[i].FclientData, uintptr(0)) } - tcl.XTcl_LinkVar(tls, interp, ts+18770, /* "sqlite_search_co..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19141, /* "sqlite_search_co..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_search_count)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+18790, /* "sqlite_found_cou..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19161, /* "sqlite_found_cou..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_found_count)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+18809, /* "sqlite_sort_coun..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19180, /* "sqlite_sort_coun..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_sort_count)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+18827, /* "sqlite3_max_blob..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19198, /* "sqlite3_max_blob..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_max_blobsize)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+18848, /* "sqlite_like_coun..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19219, /* "sqlite_like_coun..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_like_count)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+18866, /* "sqlite_interrupt..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19237, /* "sqlite_interrupt..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_interrupt_count)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+18889, /* "sqlite_open_file..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19260, /* "sqlite_open_file..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_open_file_count)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+18912, /* "sqlite_current_t..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19283, /* "sqlite_current_t..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_current_time)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+18932, /* "sqlite3_xferopt_..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19303, /* "sqlite3_xferopt_..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_xferopt_count)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+18954, /* "sqlite3_pager_re..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19325, /* "sqlite3_pager_re..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_pager_readdb_count)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+18981, /* "sqlite3_pager_wr..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19352, /* "sqlite3_pager_wr..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_pager_writedb_count)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+19009, /* "sqlite3_pager_wr..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19380, /* "sqlite3_pager_wr..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_pager_writej_count)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+19036, /* "unaligned_string..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19407, /* "unaligned_string..." */ uintptr(unsafe.Pointer(&unaligned_string_counter)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+19061, /* "sqlite_last_need..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19432, /* "sqlite_last_need..." */ uintptr(unsafe.Pointer(&pzNeededCollation)), (TCL_LINK_STRING | TCL_LINK_READ_ONLY)) { - tcl.XTcl_LinkVar(tls, interp, ts+19090, /* "sqlite_query_pla..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19461, /* "sqlite_query_pla..." */ uintptr(unsafe.Pointer(&query_plan)), (TCL_LINK_STRING | TCL_LINK_READ_ONLY)) } - tcl.XTcl_LinkVar(tls, interp, ts+19108, /* "sqlite_opentemp_..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19479, /* "sqlite_opentemp_..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_opentemp_count)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+19130, /* "sqlite_static_bi..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19501, /* "sqlite_static_bi..." */ uintptr(unsafe.Pointer(&sqlite_static_bind_value)), TCL_LINK_STRING) - tcl.XTcl_LinkVar(tls, interp, ts+19155, /* "sqlite_static_bi..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19526, /* "sqlite_static_bi..." */ uintptr(unsafe.Pointer(&sqlite_static_bind_nbyte)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+19180, /* "sqlite_temp_dire..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19551, /* "sqlite_temp_dire..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_temp_directory)), TCL_LINK_STRING) - tcl.XTcl_LinkVar(tls, interp, ts+19202, /* "sqlite_data_dire..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19573, /* "sqlite_data_dire..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_data_directory)), TCL_LINK_STRING) - tcl.XTcl_LinkVar(tls, interp, ts+19224, /* "bitmask_size" */ + tcl.XTcl_LinkVar(tls, interp, ts+19595, /* "bitmask_size" */ uintptr(unsafe.Pointer(&bitmask_size)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) - tcl.XTcl_LinkVar(tls, interp, ts+19237, /* "longdouble_size" */ + tcl.XTcl_LinkVar(tls, interp, ts+19608, /* "longdouble_size" */ uintptr(unsafe.Pointer(&longdouble_size)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) - tcl.XTcl_LinkVar(tls, interp, ts+19253, /* "sqlite_sync_coun..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19624, /* "sqlite_sync_coun..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_sync_count)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+19271, /* "sqlite_fullsync_..." */ + tcl.XTcl_LinkVar(tls, interp, ts+19642, /* "sqlite_fullsync_..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_fullsync_count)), TCL_LINK_INT) return TCL_OK } -var iZero int32 = 0 /* test1.c:7934:14 */ +var iZero int32 = 0 /* test1.c:8224:14 */ var aCmd1 = [40]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 19293 /* "db_enter" */, FxProc: 0}, - {FzName: ts + 19302 /* "db_leave" */, FxProc: 0}, - {FzName: ts + 19311 /* "sqlite3_mprintf_..." */, FxProc: 0}, - {FzName: ts + 19331 /* "sqlite3_mprintf_..." */, FxProc: 0}, - {FzName: ts + 19353 /* "sqlite3_mprintf_..." */, FxProc: 0}, - {FzName: ts + 19374 /* "sqlite3_mprintf_..." */, FxProc: 0}, - {FzName: ts + 19394 /* "sqlite3_snprintf..." */, FxProc: 0}, - {FzName: ts + 19415 /* "sqlite3_mprintf_..." */, FxProc: 0}, - {FzName: ts + 19439 /* "sqlite3_mprintf_..." */, FxProc: 0}, - {FzName: ts + 19462 /* "sqlite3_mprintf_..." */, FxProc: 0}, - {FzName: ts + 19485 /* "sqlite3_mprintf_..." */, FxProc: 0}, - {FzName: ts + 19511 /* "sqlite3_mprintf_..." */, FxProc: 0}, - {FzName: ts + 19534 /* "sqlite3_mprintf_..." */, FxProc: 0}, - {FzName: ts + 19557 /* "sqlite3_snprintf..." */, FxProc: 0}, - {FzName: ts + 19578 /* "sqlite3_last_ins..." */, FxProc: 0}, - {FzName: ts + 19604 /* "sqlite3_exec_pri..." */, FxProc: 0}, - {FzName: ts + 19624 /* "sqlite3_exec_hex" */, FxProc: 0}, - {FzName: ts + 19641 /* "sqlite3_exec" */, FxProc: 0}, - {FzName: ts + 19654 /* "sqlite3_exec_nr" */, FxProc: 0}, - {FzName: ts + 19670 /* "sqlite3_get_tabl..." */, FxProc: 0}, - {FzName: ts + 19695 /* "sqlite3_close" */, FxProc: 0}, - {FzName: ts + 19709 /* "sqlite3_close_v2" */, FxProc: 0}, - {FzName: ts + 19726 /* "sqlite3_create_f..." */, FxProc: 0}, - {FzName: ts + 19750 /* "sqlite3_create_a..." */, FxProc: 0}, - {FzName: ts + 19775 /* "sqlite3_drop_mod..." */, FxProc: 0}, - {FzName: ts + 19796 /* "sqlite_register_..." */, FxProc: 0}, - {FzName: ts + 19826 /* "sqlite_abort" */, FxProc: 0}, - {FzName: ts + 19839 /* "sqlite_bind" */, FxProc: 0}, - {FzName: ts + 19851 /* "breakpoint" */, FxProc: 0}, - {FzName: ts + 19862 /* "sqlite3_key" */, FxProc: 0}, - {FzName: ts + 19874 /* "sqlite3_rekey" */, FxProc: 0}, - {FzName: ts + 19888 /* "sqlite_set_magic" */, FxProc: 0}, - {FzName: ts + 19905 /* "sqlite3_interrup..." */, FxProc: 0}, - {FzName: ts + 19923 /* "sqlite_delete_fu..." */, FxProc: 0}, - {FzName: ts + 19946 /* "sqlite_delete_co..." */, FxProc: 0}, - {FzName: ts + 19970 /* "sqlite3_get_auto..." */, FxProc: 0}, - {FzName: ts + 19993 /* "sqlite3_busy_tim..." */, FxProc: 0}, - {FzName: ts + 20014 /* "printf" */, FxProc: 0}, - {FzName: ts + 20021 /* "sqlite3IoTrace" */, FxProc: 0}, - {FzName: ts + 20036 /* "clang_sanitize_a..." */, FxProc: 0}, -} /* test1.c:7938:5 */ -var aObjCmd1 = [155]struct { + {FzName: ts + 19664 /* "db_enter" */, FxProc: 0}, + {FzName: ts + 19673 /* "db_leave" */, FxProc: 0}, + {FzName: ts + 19682 /* "sqlite3_mprintf_..." */, FxProc: 0}, + {FzName: ts + 19702 /* "sqlite3_mprintf_..." */, FxProc: 0}, + {FzName: ts + 19724 /* "sqlite3_mprintf_..." */, FxProc: 0}, + {FzName: ts + 19745 /* "sqlite3_mprintf_..." */, FxProc: 0}, + {FzName: ts + 19765 /* "sqlite3_snprintf..." */, FxProc: 0}, + {FzName: ts + 19786 /* "sqlite3_mprintf_..." */, FxProc: 0}, + {FzName: ts + 19810 /* "sqlite3_mprintf_..." */, FxProc: 0}, + {FzName: ts + 19833 /* "sqlite3_mprintf_..." */, FxProc: 0}, + {FzName: ts + 19856 /* "sqlite3_mprintf_..." */, FxProc: 0}, + {FzName: ts + 19882 /* "sqlite3_mprintf_..." */, FxProc: 0}, + {FzName: ts + 19905 /* "sqlite3_mprintf_..." */, FxProc: 0}, + {FzName: ts + 19928 /* "sqlite3_snprintf..." */, FxProc: 0}, + {FzName: ts + 19949 /* "sqlite3_last_ins..." */, FxProc: 0}, + {FzName: ts + 19975 /* "sqlite3_exec_pri..." */, FxProc: 0}, + {FzName: ts + 19995 /* "sqlite3_exec_hex" */, FxProc: 0}, + {FzName: ts + 20012 /* "sqlite3_exec" */, FxProc: 0}, + {FzName: ts + 20025 /* "sqlite3_exec_nr" */, FxProc: 0}, + {FzName: ts + 20041 /* "sqlite3_get_tabl..." */, FxProc: 0}, + {FzName: ts + 20066 /* "sqlite3_close" */, FxProc: 0}, + {FzName: ts + 20080 /* "sqlite3_close_v2" */, FxProc: 0}, + {FzName: ts + 20097 /* "sqlite3_create_f..." */, FxProc: 0}, + {FzName: ts + 20121 /* "sqlite3_create_a..." */, FxProc: 0}, + {FzName: ts + 20146 /* "sqlite3_drop_mod..." */, FxProc: 0}, + {FzName: ts + 20167 /* "sqlite_register_..." */, FxProc: 0}, + {FzName: ts + 20197 /* "sqlite_abort" */, FxProc: 0}, + {FzName: ts + 20210 /* "sqlite_bind" */, FxProc: 0}, + {FzName: ts + 20222 /* "breakpoint" */, FxProc: 0}, + {FzName: ts + 20233 /* "sqlite3_key" */, FxProc: 0}, + {FzName: ts + 20245 /* "sqlite3_rekey" */, FxProc: 0}, + {FzName: ts + 20259 /* "sqlite_set_magic" */, FxProc: 0}, + {FzName: ts + 20276 /* "sqlite3_interrup..." */, FxProc: 0}, + {FzName: ts + 20294 /* "sqlite_delete_fu..." */, FxProc: 0}, + {FzName: ts + 20317 /* "sqlite_delete_co..." */, FxProc: 0}, + {FzName: ts + 20341 /* "sqlite3_get_auto..." */, FxProc: 0}, + {FzName: ts + 20364 /* "sqlite3_busy_tim..." */, FxProc: 0}, + {FzName: ts + 20385 /* "printf" */, FxProc: 0}, + {FzName: ts + 20392 /* "sqlite3IoTrace" */, FxProc: 0}, + {FzName: ts + 20407 /* "clang_sanitize_a..." */, FxProc: 0}, +} /* test1.c:8228:5 */ +var aObjCmd1 = [160]struct { FzName uintptr FxProc uintptr FclientData uintptr }{ - {FzName: ts + 20059 /* "sqlite3_db_confi..." */, FxProc: 0}, - {FzName: ts + 20077 /* "bad_behavior" */, FxProc: 0, FclientData: 0}, - {FzName: ts + 20090 /* "register_dbstat_..." */, FxProc: 0}, - {FzName: ts + 20111 /* "sqlite3_connecti..." */, FxProc: 0}, - {FzName: ts + 20138 /* "intarray_addr" */, FxProc: 0}, - {FzName: ts + 20152 /* "int64array_addr" */, FxProc: 0}, - {FzName: ts + 20168 /* "doublearray_addr" */, FxProc: 0}, - {FzName: ts + 20185 /* "textarray_addr" */, FxProc: 0}, - {FzName: ts + 20200 /* "sqlite3_bind_int" */, FxProc: 0}, - {FzName: ts + 20217 /* "sqlite3_bind_zer..." */, FxProc: 0}, - {FzName: ts + 20239 /* "sqlite3_bind_zer..." */, FxProc: 0}, - {FzName: ts + 20263 /* "sqlite3_bind_int..." */, FxProc: 0}, - {FzName: ts + 20282 /* "sqlite3_bind_dou..." */, FxProc: 0}, - {FzName: ts + 20302 /* "sqlite3_bind_nul..." */, FxProc: 0}, - {FzName: ts + 20320 /* "sqlite3_bind_tex..." */, FxProc: 0}, - {FzName: ts + 20338 /* "sqlite3_bind_tex..." */, FxProc: 0}, - {FzName: ts + 20358 /* "sqlite3_bind_blo..." */, FxProc: 0}, - {FzName: ts + 20376 /* "sqlite3_bind_par..." */, FxProc: 0}, - {FzName: ts + 20405 /* "sqlite3_bind_par..." */, FxProc: 0}, - {FzName: ts + 20433 /* "sqlite3_bind_par..." */, FxProc: 0}, - {FzName: ts + 20462 /* "sqlite3_clear_bi..." */, FxProc: 0}, - {FzName: ts + 20485 /* "sqlite3_sleep" */, FxProc: 0}, - {FzName: ts + 20499 /* "sqlite3_errcode" */, FxProc: 0}, - {FzName: ts + 20515 /* "sqlite3_extended..." */, FxProc: 0}, - {FzName: ts + 20540 /* "sqlite3_errmsg" */, FxProc: 0}, - {FzName: ts + 20555 /* "sqlite3_errmsg16" */, FxProc: 0}, - {FzName: ts + 20572 /* "sqlite3_open" */, FxProc: 0}, - {FzName: ts + 20585 /* "sqlite3_open16" */, FxProc: 0}, - {FzName: ts + 20600 /* "sqlite3_open_v2" */, FxProc: 0}, - {FzName: ts + 20616 /* "sqlite3_complete..." */, FxProc: 0}, - {FzName: ts + 20635 /* "sqlite3_normaliz..." */, FxProc: 0}, + {FzName: ts + 20430 /* "sqlite3_db_confi..." */, FxProc: 0}, + {FzName: ts + 20448 /* "sqlite3_txn_stat..." */, FxProc: 0}, + {FzName: ts + 20466 /* "bad_behavior" */, FxProc: 0, FclientData: 0}, + {FzName: ts + 20479 /* "register_dbstat_..." */, FxProc: 0}, + {FzName: ts + 20500 /* "sqlite3_connecti..." */, FxProc: 0}, + {FzName: ts + 20527 /* "intarray_addr" */, FxProc: 0}, + {FzName: ts + 20541 /* "int64array_addr" */, FxProc: 0}, + {FzName: ts + 20557 /* "doublearray_addr" */, FxProc: 0}, + {FzName: ts + 20574 /* "textarray_addr" */, FxProc: 0}, + {FzName: ts + 20589 /* "sqlite3_bind_int" */, FxProc: 0}, + {FzName: ts + 20606 /* "sqlite3_bind_zer..." */, FxProc: 0}, + {FzName: ts + 20628 /* "sqlite3_bind_zer..." */, FxProc: 0}, + {FzName: ts + 20652 /* "sqlite3_bind_int..." */, FxProc: 0}, + {FzName: ts + 20671 /* "sqlite3_bind_dou..." */, FxProc: 0}, + {FzName: ts + 20691 /* "sqlite3_bind_nul..." */, FxProc: 0}, + {FzName: ts + 20709 /* "sqlite3_bind_tex..." */, FxProc: 0}, + {FzName: ts + 20727 /* "sqlite3_bind_tex..." */, FxProc: 0}, + {FzName: ts + 20747 /* "sqlite3_bind_blo..." */, FxProc: 0}, + {FzName: ts + 20765 /* "sqlite3_carray_b..." */, FxProc: 0}, + {FzName: ts + 20785 /* "sqlite3_bind_par..." */, FxProc: 0}, + {FzName: ts + 20814 /* "sqlite3_bind_par..." */, FxProc: 0}, + {FzName: ts + 20842 /* "sqlite3_bind_par..." */, FxProc: 0}, + {FzName: ts + 20871 /* "sqlite3_clear_bi..." */, FxProc: 0}, + {FzName: ts + 20894 /* "sqlite3_sleep" */, FxProc: 0}, + {FzName: ts + 20908 /* "sqlite3_errcode" */, FxProc: 0}, + {FzName: ts + 20924 /* "sqlite3_extended..." */, FxProc: 0}, + {FzName: ts + 20949 /* "sqlite3_errmsg" */, FxProc: 0}, + {FzName: ts + 20964 /* "sqlite3_errmsg16" */, FxProc: 0}, + {FzName: ts + 20981 /* "sqlite3_open" */, FxProc: 0}, + {FzName: ts + 20994 /* "sqlite3_open16" */, FxProc: 0}, + {FzName: ts + 21009 /* "sqlite3_open_v2" */, FxProc: 0}, + {FzName: ts + 21025 /* "sqlite3_complete..." */, FxProc: 0}, + {FzName: ts + 21044 /* "sqlite3_normaliz..." */, FxProc: 0}, - {FzName: ts + 20653 /* "sqlite3_prepare" */, FxProc: 0}, - {FzName: ts + 20669 /* "sqlite3_prepare1..." */, FxProc: 0}, - {FzName: ts + 20687 /* "sqlite3_prepare_..." */, FxProc: 0}, - {FzName: ts + 20706 /* "sqlite3_prepare_..." */, FxProc: 0}, - {FzName: ts + 20725 /* "sqlite3_prepare_..." */, FxProc: 0}, - {FzName: ts + 20749 /* "sqlite3_prepare1..." */, FxProc: 0}, - {FzName: ts + 20770 /* "sqlite3_finalize" */, FxProc: 0}, - {FzName: ts + 20787 /* "sqlite3_stmt_sta..." */, FxProc: 0}, - {FzName: ts + 20807 /* "sqlite3_reset" */, FxProc: 0}, - {FzName: ts + 20821 /* "sqlite3_expired" */, FxProc: 0}, - {FzName: ts + 20837 /* "sqlite3_transfer..." */, FxProc: 0}, - {FzName: ts + 20863 /* "sqlite3_changes" */, FxProc: 0}, - {FzName: ts + 20879 /* "sqlite3_step" */, FxProc: 0}, - {FzName: ts + 20892 /* "sqlite3_sql" */, FxProc: 0}, - {FzName: ts + 20904 /* "sqlite3_expanded..." */, FxProc: 0}, - {FzName: ts + 20925 /* "sqlite3_next_stm..." */, FxProc: 0}, - {FzName: ts + 20943 /* "sqlite3_stmt_rea..." */, FxProc: 0}, - {FzName: ts + 20965 /* "sqlite3_stmt_ise..." */, FxProc: 0}, - {FzName: ts + 20988 /* "sqlite3_stmt_bus..." */, FxProc: 0}, - {FzName: ts + 21006 /* "uses_stmt_journa..." */, FxProc: 0}, + {FzName: ts + 21062 /* "sqlite3_prepare" */, FxProc: 0}, + {FzName: ts + 21078 /* "sqlite3_prepare1..." */, FxProc: 0}, + {FzName: ts + 21096 /* "sqlite3_prepare_..." */, FxProc: 0}, + {FzName: ts + 21115 /* "sqlite3_prepare_..." */, FxProc: 0}, + {FzName: ts + 21134 /* "sqlite3_prepare_..." */, FxProc: 0}, + {FzName: ts + 21158 /* "sqlite3_prepare1..." */, FxProc: 0}, + {FzName: ts + 21179 /* "sqlite3_finalize" */, FxProc: 0}, + {FzName: ts + 21196 /* "sqlite3_stmt_sta..." */, FxProc: 0}, + {FzName: ts + 21216 /* "sqlite3_reset" */, FxProc: 0}, + {FzName: ts + 21230 /* "sqlite3_expired" */, FxProc: 0}, + {FzName: ts + 21246 /* "sqlite3_transfer..." */, FxProc: 0}, + {FzName: ts + 21272 /* "sqlite3_changes" */, FxProc: 0}, + {FzName: ts + 21288 /* "sqlite3_step" */, FxProc: 0}, + {FzName: ts + 21301 /* "sqlite3_sql" */, FxProc: 0}, + {FzName: ts + 21313 /* "sqlite3_expanded..." */, FxProc: 0}, + {FzName: ts + 21334 /* "sqlite3_next_stm..." */, FxProc: 0}, + {FzName: ts + 21352 /* "sqlite3_stmt_rea..." */, FxProc: 0}, + {FzName: ts + 21374 /* "sqlite3_stmt_ise..." */, FxProc: 0}, + {FzName: ts + 21397 /* "sqlite3_stmt_bus..." */, FxProc: 0}, + {FzName: ts + 21415 /* "uses_stmt_journa..." */, FxProc: 0}, - {FzName: ts + 21024 /* "sqlite3_release_..." */, FxProc: 0}, - {FzName: ts + 21047 /* "sqlite3_db_relea..." */, FxProc: 0}, - {FzName: ts + 21073 /* "sqlite3_db_cache..." */, FxProc: 0}, - {FzName: ts + 21095 /* "sqlite3_system_e..." */, FxProc: 0}, - {FzName: ts + 21116 /* "sqlite3_db_filen..." */, FxProc: 0}, - {FzName: ts + 21136 /* "sqlite3_db_reado..." */, FxProc: 0}, - {FzName: ts + 21156 /* "sqlite3_soft_hea..." */, FxProc: 0}, - {FzName: ts + 21180 /* "sqlite3_soft_hea..." */, FxProc: 0}, - {FzName: ts + 21206 /* "sqlite3_hard_hea..." */, FxProc: 0}, - {FzName: ts + 21232 /* "sqlite3_thread_c..." */, FxProc: 0}, - {FzName: ts + 21255 /* "sqlite3_pager_re..." */, FxProc: 0}, + {FzName: ts + 21433 /* "sqlite3_release_..." */, FxProc: 0}, + {FzName: ts + 21456 /* "sqlite3_db_relea..." */, FxProc: 0}, + {FzName: ts + 21482 /* "sqlite3_db_cache..." */, FxProc: 0}, + {FzName: ts + 21504 /* "sqlite3_system_e..." */, FxProc: 0}, + {FzName: ts + 21525 /* "sqlite3_db_filen..." */, FxProc: 0}, + {FzName: ts + 21545 /* "sqlite3_db_reado..." */, FxProc: 0}, + {FzName: ts + 21565 /* "sqlite3_soft_hea..." */, FxProc: 0}, + {FzName: ts + 21589 /* "sqlite3_soft_hea..." */, FxProc: 0}, + {FzName: ts + 21615 /* "sqlite3_hard_hea..." */, FxProc: 0}, + {FzName: ts + 21641 /* "sqlite3_thread_c..." */, FxProc: 0}, + {FzName: ts + 21664 /* "sqlite3_pager_re..." */, FxProc: 0}, - {FzName: ts + 21279 /* "sqlite3_load_ext..." */, FxProc: 0}, - {FzName: ts + 21302 /* "sqlite3_enable_l..." */, FxProc: 0}, - {FzName: ts + 21332 /* "sqlite3_extended..." */, FxProc: 0}, - {FzName: ts + 21362 /* "sqlite3_limit" */, FxProc: 0}, - {FzName: ts + 21376 /* "dbconfig_maindbn..." */, FxProc: 0}, + {FzName: ts + 21688 /* "sqlite3_load_ext..." */, FxProc: 0}, + {FzName: ts + 21711 /* "sqlite3_enable_l..." */, FxProc: 0}, + {FzName: ts + 21741 /* "sqlite3_extended..." */, FxProc: 0}, + {FzName: ts + 21771 /* "sqlite3_limit" */, FxProc: 0}, + {FzName: ts + 21785 /* "dbconfig_maindbn..." */, FxProc: 0}, - {FzName: ts + 21404 /* "save_prng_state" */, FxProc: 0}, - {FzName: ts + 21420 /* "restore_prng_sta..." */, FxProc: 0}, - {FzName: ts + 21439 /* "reset_prng_state" */, FxProc: 0}, - {FzName: ts + 21456 /* "prng_seed" */, FxProc: 0}, - {FzName: ts + 21466 /* "extra_schema_che..." */, FxProc: 0}, - {FzName: ts + 21486 /* "database_never_c..." */, FxProc: 0}, - {FzName: ts + 21509 /* "database_may_be_..." */, FxProc: 0}, - {FzName: ts + 21533 /* "optimization_con..." */, FxProc: 0}, - {FzName: ts + 21554 /* "tcl_objproc" */, FxProc: 0}, + {FzName: ts + 21813 /* "save_prng_state" */, FxProc: 0}, + {FzName: ts + 21829 /* "restore_prng_sta..." */, FxProc: 0}, + {FzName: ts + 21848 /* "reset_prng_state" */, FxProc: 0}, + {FzName: ts + 21865 /* "prng_seed" */, FxProc: 0}, + {FzName: ts + 21875 /* "extra_schema_che..." */, FxProc: 0}, + {FzName: ts + 21895 /* "database_never_c..." */, FxProc: 0}, + {FzName: ts + 21918 /* "database_may_be_..." */, FxProc: 0}, + {FzName: ts + 21942 /* "optimization_con..." */, FxProc: 0}, + {FzName: ts + 21963 /* "tcl_objproc" */, FxProc: 0}, // sqlite3_column_*() API - {FzName: ts + 21566 /* "sqlite3_column_c..." */, FxProc: 0}, - {FzName: ts + 21587 /* "sqlite3_data_cou..." */, FxProc: 0}, - {FzName: ts + 21606 /* "sqlite3_column_t..." */, FxProc: 0}, - {FzName: ts + 21626 /* "sqlite3_column_b..." */, FxProc: 0}, - {FzName: ts + 21646 /* "sqlite3_column_d..." */, FxProc: 0}, - {FzName: ts + 21668 /* "sqlite3_column_i..." */, FxProc: 0}, - {FzName: ts + 21689 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 21709 /* "sqlite3_column_n..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 21729 /* "sqlite3_column_i..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 21748 /* "sqlite3_column_b..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 21769 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 21793 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 21822 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 21848 /* "sqlite3_column_o..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 21975 /* "sqlite3_column_c..." */, FxProc: 0}, + {FzName: ts + 21996 /* "sqlite3_data_cou..." */, FxProc: 0}, + {FzName: ts + 22015 /* "sqlite3_column_t..." */, FxProc: 0}, + {FzName: ts + 22035 /* "sqlite3_column_b..." */, FxProc: 0}, + {FzName: ts + 22055 /* "sqlite3_column_d..." */, FxProc: 0}, + {FzName: ts + 22077 /* "sqlite3_column_i..." */, FxProc: 0}, + {FzName: ts + 22098 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 22118 /* "sqlite3_column_n..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 22138 /* "sqlite3_column_i..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 22157 /* "sqlite3_column_b..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 22178 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 22202 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 22231 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 22257 /* "sqlite3_column_o..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 21875 /* "sqlite3_column_b..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 21898 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 21920 /* "sqlite3_column_n..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 21942 /* "add_alignment_te..." */, FxProc: 0}, - {FzName: ts + 21972 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 21998, /* "sqlite3_column_d..." */ + {FzName: ts + 22284 /* "sqlite3_column_b..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 22307 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 22329 /* "sqlite3_column_n..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 22351 /* "add_alignment_te..." */, FxProc: 0}, + {FzName: ts + 22381 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 22407, /* "sqlite3_column_d..." */ FxProc: 0, FclientData: 0}, - {FzName: ts + 22029 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 22057 /* "sqlite3_column_o..." */, FxProc: 0, FclientData: 0}, - {FzName: ts + 22086 /* "sqlite3_create_c..." */, FxProc: 0}, - {FzName: ts + 22114 /* "sqlite3_global_r..." */, FxProc: 0}, - {FzName: ts + 22137 /* "working_64bit_in..." */, FxProc: 0}, - {FzName: ts + 22155 /* "vfs_unlink_test" */, FxProc: 0}, - {FzName: ts + 22171 /* "vfs_initfail_tes..." */, FxProc: 0}, - {FzName: ts + 22189 /* "vfs_unregister_a..." */, FxProc: 0}, - {FzName: ts + 22208 /* "vfs_reregister_a..." */, FxProc: 0}, - {FzName: ts + 22227 /* "file_control_tes..." */, FxProc: 0}, - {FzName: ts + 22245 /* "file_control_las..." */, FxProc: 0}, - {FzName: ts + 22273 /* "file_control_loc..." */, FxProc: 0}, - {FzName: ts + 22301 /* "file_control_chu..." */, FxProc: 0}, - {FzName: ts + 22329 /* "file_control_siz..." */, FxProc: 0}, - {FzName: ts + 22356 /* "file_control_dat..." */, FxProc: 0}, - {FzName: ts + 22382 /* "file_control_per..." */, FxProc: 0}, - {FzName: ts + 22407 /* "file_control_pow..." */, FxProc: 0}, - {FzName: ts + 22440 /* "file_control_vfs..." */, FxProc: 0}, - {FzName: ts + 22461 /* "file_control_tem..." */, FxProc: 0}, - {FzName: ts + 22487 /* "sqlite3_vfs_list" */, FxProc: 0}, - {FzName: ts + 22504 /* "sqlite3_create_f..." */, FxProc: 0}, + {FzName: ts + 22438 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 22466 /* "sqlite3_column_o..." */, FxProc: 0, FclientData: 0}, + {FzName: ts + 22495 /* "sqlite3_create_c..." */, FxProc: 0}, + {FzName: ts + 22523 /* "sqlite3_global_r..." */, FxProc: 0}, + {FzName: ts + 22546 /* "working_64bit_in..." */, FxProc: 0}, + {FzName: ts + 22564 /* "vfs_unlink_test" */, FxProc: 0}, + {FzName: ts + 22580 /* "vfs_initfail_tes..." */, FxProc: 0}, + {FzName: ts + 22598 /* "vfs_unregister_a..." */, FxProc: 0}, + {FzName: ts + 22617 /* "vfs_reregister_a..." */, FxProc: 0}, + {FzName: ts + 22636 /* "file_control_tes..." */, FxProc: 0}, + {FzName: ts + 22654 /* "file_control_las..." */, FxProc: 0}, + {FzName: ts + 22682 /* "file_control_loc..." */, FxProc: 0}, + {FzName: ts + 22710 /* "file_control_chu..." */, FxProc: 0}, + {FzName: ts + 22738 /* "file_control_siz..." */, FxProc: 0}, + {FzName: ts + 22765 /* "file_control_dat..." */, FxProc: 0}, + {FzName: ts + 22791 /* "file_control_per..." */, FxProc: 0}, + {FzName: ts + 22816 /* "file_control_pow..." */, FxProc: 0}, + {FzName: ts + 22849 /* "file_control_vfs..." */, FxProc: 0}, + {FzName: ts + 22870 /* "file_control_res..." */, FxProc: 0}, + {FzName: ts + 22896 /* "file_control_tem..." */, FxProc: 0}, + {FzName: ts + 22922 /* "sqlite3_vfs_list" */, FxProc: 0}, + {FzName: ts + 22939 /* "sqlite3_create_f..." */, FxProc: 0}, // Functions from os.h - {FzName: ts + 22531 /* "add_test_collate" */, FxProc: 0}, - {FzName: ts + 22548 /* "add_test_collate..." */, FxProc: 0}, - {FzName: ts + 22572 /* "add_test_functio..." */, FxProc: 0}, - {FzName: ts + 22590 /* "add_test_utf16bi..." */, FxProc: 0}, - {FzName: ts + 22616 /* "sqlite3_test_err..." */, FxProc: 0}, - {FzName: ts + 22636 /* "tcl_variable_typ..." */, FxProc: 0}, - {FzName: ts + 22654 /* "sqlite3_enable_s..." */, FxProc: 0}, - {FzName: ts + 22682 /* "sqlite3_shared_c..." */, FxProc: 0}, - {FzName: ts + 22710 /* "sqlite3_libversi..." */, FxProc: 0}, - {FzName: ts + 22736 /* "sqlite3_table_co..." */, FxProc: 0}, - {FzName: ts + 22766 /* "sqlite3_blob_reo..." */, FxProc: 0}, - {FzName: ts + 22786 /* "pcache_stats" */, FxProc: 0}, - {FzName: ts + 22799 /* "sqlite3_unlock_n..." */, FxProc: 0}, - {FzName: ts + 22821 /* "sqlite3_wal_chec..." */, FxProc: 0}, - {FzName: ts + 22844 /* "sqlite3_wal_chec..." */, FxProc: 0}, - {FzName: ts + 22870 /* "sqlite3_wal_auto..." */, FxProc: 0}, - {FzName: ts + 22897 /* "test_sqlite3_log" */, FxProc: 0}, - {FzName: ts + 22914 /* "print_explain_qu..." */, FxProc: 0}, - {FzName: ts + 22939 /* "sqlite3_test_con..." */, FxProc: 0}, - {FzName: ts + 22960 /* "getrusage" */, FxProc: 0}, - {FzName: ts + 22970 /* "load_static_exte..." */, FxProc: 0}, - {FzName: ts + 22992 /* "sorter_test_fake..." */, FxProc: 0}, - {FzName: ts + 23013 /* "sorter_test_sort..." */, FxProc: 0}, - {FzName: ts + 23038 /* "vfs_current_time..." */, FxProc: 0}, - {FzName: ts + 23061 /* "sqlite3_snapshot..." */, FxProc: 0}, - {FzName: ts + 23082 /* "sqlite3_snapshot..." */, FxProc: 0}, - {FzName: ts + 23104 /* "sqlite3_snapshot..." */, FxProc: 0}, - {FzName: ts + 23126 /* "sqlite3_snapshot..." */, FxProc: 0}, - {FzName: ts + 23147 /* "sqlite3_snapshot..." */, FxProc: 0}, - {FzName: ts + 23172 /* "sqlite3_snapshot..." */, FxProc: 0}, - {FzName: ts + 23198 /* "sqlite3_snapshot..." */, FxProc: 0}, - {FzName: ts + 23225 /* "sqlite3_snapshot..." */, FxProc: 0}, - {FzName: ts + 23251 /* "sqlite3_delete_d..." */, FxProc: 0}, - {FzName: ts + 23275 /* "atomic_batch_wri..." */, FxProc: 0}, - {FzName: ts + 23294 /* "sqlite3_mmap_war..." */, FxProc: 0}, - {FzName: ts + 23312 /* "sqlite3_config_s..." */, FxProc: 0}, - {FzName: ts + 23337 /* "decode_hexdb" */, FxProc: 0}, - {FzName: ts + 23350 /* "test_write_db" */, FxProc: 0}, -} /* test1.c:7986:5 */ -var bitmask_size int32 = (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) /* test1.c:8206:14 */ -var longdouble_size int32 = int32(unsafe.Sizeof(float64(0))) /* test1.c:8207:14 */ -var query_plan uintptr = ts + 23364 /* "*** OBSOLETE VAR..." */ /* test1.c:8282:23 */ + {FzName: ts + 22966 /* "add_test_collate" */, FxProc: 0}, + {FzName: ts + 22983 /* "add_test_collate..." */, FxProc: 0}, + {FzName: ts + 23007 /* "add_test_functio..." */, FxProc: 0}, + {FzName: ts + 23025 /* "add_test_utf16bi..." */, FxProc: 0}, + {FzName: ts + 23051 /* "sqlite3_test_err..." */, FxProc: 0}, + {FzName: ts + 23071 /* "tcl_variable_typ..." */, FxProc: 0}, + {FzName: ts + 23089 /* "sqlite3_enable_s..." */, FxProc: 0}, + {FzName: ts + 23117 /* "sqlite3_shared_c..." */, FxProc: 0}, + {FzName: ts + 23145 /* "sqlite3_libversi..." */, FxProc: 0}, + {FzName: ts + 23171 /* "sqlite3_table_co..." */, FxProc: 0}, + {FzName: ts + 23201 /* "sqlite3_blob_reo..." */, FxProc: 0}, + {FzName: ts + 23221 /* "pcache_stats" */, FxProc: 0}, + {FzName: ts + 23234 /* "sqlite3_unlock_n..." */, FxProc: 0}, + {FzName: ts + 23256 /* "sqlite3_wal_chec..." */, FxProc: 0}, + {FzName: ts + 23279 /* "sqlite3_wal_chec..." */, FxProc: 0}, + {FzName: ts + 23305 /* "sqlite3_wal_auto..." */, FxProc: 0}, + {FzName: ts + 23332 /* "test_sqlite3_log" */, FxProc: 0}, + {FzName: ts + 23349 /* "print_explain_qu..." */, FxProc: 0}, + {FzName: ts + 23374 /* "sqlite3_test_con..." */, FxProc: 0}, + {FzName: ts + 23395 /* "getrusage" */, FxProc: 0}, + {FzName: ts + 23405 /* "load_static_exte..." */, FxProc: 0}, + {FzName: ts + 23427 /* "sorter_test_fake..." */, FxProc: 0}, + {FzName: ts + 23448 /* "sorter_test_sort..." */, FxProc: 0}, + {FzName: ts + 23473 /* "vfs_current_time..." */, FxProc: 0}, + {FzName: ts + 23496 /* "sqlite3_snapshot..." */, FxProc: 0}, + {FzName: ts + 23517 /* "sqlite3_snapshot..." */, FxProc: 0}, + {FzName: ts + 23539 /* "sqlite3_snapshot..." */, FxProc: 0}, + {FzName: ts + 23561 /* "sqlite3_snapshot..." */, FxProc: 0}, + {FzName: ts + 23582 /* "sqlite3_snapshot..." */, FxProc: 0}, + {FzName: ts + 23607 /* "sqlite3_snapshot..." */, FxProc: 0}, + {FzName: ts + 23633 /* "sqlite3_snapshot..." */, FxProc: 0}, + {FzName: ts + 23660 /* "sqlite3_snapshot..." */, FxProc: 0}, + {FzName: ts + 23686 /* "sqlite3_delete_d..." */, FxProc: 0}, + {FzName: ts + 23710 /* "atomic_batch_wri..." */, FxProc: 0}, + {FzName: ts + 23729 /* "sqlite3_mmap_war..." */, FxProc: 0}, + {FzName: ts + 23747 /* "sqlite3_config_s..." */, FxProc: 0}, + {FzName: ts + 23772 /* "decode_hexdb" */, FxProc: 0}, + {FzName: ts + 23785 /* "test_write_db" */, FxProc: 0}, + {FzName: ts + 23799 /* "sqlite3_register..." */, FxProc: 0}, + {FzName: ts + 23825 /* "sqlite3_unregist..." */, FxProc: 0}, +} /* test1.c:8276:5 */ +var bitmask_size int32 = (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) /* test1.c:8503:14 */ +var longdouble_size int32 = int32(unsafe.Sizeof(float64(0))) /* test1.c:8504:14 */ +var query_plan uintptr = ts + 23853 /* "*** OBSOLETE VAR..." */ /* test1.c:8576:23 */ // Page size and reserved size used for testing. var test_pagesize int32 = 1024 /* test2.c:31:12 */ @@ -50877,8 +52496,8 @@ func pager_open(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv // var zBuf [100]int8 at bp+92, 100 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23390 /* " FILENAME N-PAGE..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23879 /* " FILENAME N-PAGE..." */, 0)) return TCL_ERROR } if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+72 /* &nPage */) != 0 { @@ -50894,7 +52513,7 @@ func pager_open(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv sqlite3.Xsqlite3PagerSetCachesize(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pPager */)), *(*int32)(unsafe.Pointer(bp + 72 /* nPage */))) *(*u322)(unsafe.Pointer(bp + 88 /* pageSize */)) = u322(test_pagesize) sqlite3.Xsqlite3PagerSetPagesize(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pPager */)), bp+88 /* &pageSize */, -1) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+92 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 80 /* pPager */)))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+92 /* &zBuf[0] */, ts+13023 /* "%p" */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 80 /* pPager */)))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+92 /* &zBuf[0] */, 0)) return TCL_OK } @@ -50909,8 +52528,8 @@ func pager_close(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, arg var pPager uintptr var rc int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -50932,8 +52551,8 @@ func pager_rollback(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, var pPager uintptr var rc int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -50955,8 +52574,8 @@ func pager_commit(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, ar var pPager uintptr var rc int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -50983,8 +52602,8 @@ func pager_stmt_begin(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32 var pPager uintptr var rc int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -51006,8 +52625,8 @@ func pager_stmt_rollback(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc in var pPager uintptr var rc int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -51030,8 +52649,8 @@ func pager_stmt_commit(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 var pPager uintptr var rc int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -51054,8 +52673,8 @@ func pager_stats(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, arg var i int32 var a uintptr if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -51064,15 +52683,15 @@ func pager_stats(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, arg // var zBuf [100]int8 at bp+40, 100 tcl.XTcl_AppendElement(tls, interp, zName[i]) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+40 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(a + uintptr(i)*4)))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+40 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(a + uintptr(i)*4)))) tcl.XTcl_AppendElement(tls, interp, bp+40 /* &zBuf[0] */) } return TCL_OK } var zName = [9]uintptr{ - ts + 23413 /* "ref" */, ts + 23417 /* "page" */, ts + 17555 /* "max" */, ts + 11313 /* "size" */, ts + 10015 /* "state" */, ts + 23422, /* "err" */ - ts + 23426 /* "hit" */, ts + 23430 /* "miss" */, ts + 23435, /* "ovfl" */ + ts + 23902 /* "ref" */, ts + 23906 /* "page" */, ts + 17904 /* "max" */, ts + 11493 /* "size" */, ts + 10195 /* "state" */, ts + 23911, /* "err" */ + ts + 23915 /* "hit" */, ts + 23919 /* "miss" */, ts + 23924, /* "ovfl" */ } /* test2.c:266:17 */ // Usage: pager_pagecount ID @@ -51088,13 +52707,13 @@ func pager_pagecount(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, // var nPage int32 at bp+56, 4 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) sqlite3.Xsqlite3PagerPagecount(tls, pPager, bp+56 /* &nPage */) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+60 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 56 /* nPage */)))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+60 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 56 /* nPage */)))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+60 /* &zBuf[0] */, 0)) return TCL_OK } @@ -51114,8 +52733,8 @@ func page_get(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv u var rc int32 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23440 /* " ID PGNO\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23929 /* " ID PGNO\"" */, 0)) return TCL_ERROR } pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -51130,7 +52749,7 @@ func page_get(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv u tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0)) return TCL_ERROR } - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+88 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 80 /* pPage */)))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+88 /* &zBuf[0] */, ts+13023 /* "%p" */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 80 /* pPage */)))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+88 /* &zBuf[0] */, 0)) return TCL_OK } @@ -51150,8 +52769,8 @@ func page_lookup(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, arg // var pgno int32 at bp+56, 4 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23440 /* " ID PGNO\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23929 /* " ID PGNO\"" */, 0)) return TCL_ERROR } pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -51160,7 +52779,7 @@ func page_lookup(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, arg } pPage = sqlite3.Xsqlite3PagerLookup(tls, pPager, uint32(*(*int32)(unsafe.Pointer(bp + 56 /* pgno */)))) if pPage != 0 { - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+60 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+32, pPage)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+60 /* &zBuf[0] */, ts+13023 /* "%p" */, libc.VaList(bp+32, pPage)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+60 /* &zBuf[0] */, 0)) } return TCL_OK @@ -51175,8 +52794,8 @@ func pager_truncate(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, // var pgno int32 at bp+32, 4 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23440 /* " ID PGNO\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23929 /* " ID PGNO\"" */, 0)) return TCL_ERROR } pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -51196,8 +52815,8 @@ func page_unref(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv var pPage uintptr if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23450 /* " PAGE\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23939 /* " PAGE\"" */, 0)) return TCL_ERROR } pPage = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -51216,8 +52835,8 @@ func page_read(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv var pPage uintptr if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23450 /* " PAGE\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23939 /* " PAGE\"" */, 0)) return TCL_ERROR } pPage = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -51237,12 +52856,12 @@ func page_number(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, arg var pPage uintptr if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23450 /* " PAGE\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23939 /* " PAGE\"" */, 0)) return TCL_ERROR } pPage = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+56 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, sqlite3.Xsqlite3PagerPagenumber(tls, pPage))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+56 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+32, sqlite3.Xsqlite3PagerPagenumber(tls, pPage))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+56 /* &zBuf[0] */, 0)) return TCL_OK } @@ -51258,8 +52877,8 @@ func page_write(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv var pData uintptr var rc int32 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23457 /* " PAGE DATA\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23946 /* " PAGE DATA\"" */, 0)) return TCL_ERROR } pPage = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -51294,8 +52913,8 @@ func fake_big_file(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, a var zFile uintptr var nFile int32 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23469 /* " N-MEGABYTES FIL..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23958 /* " N-MEGABYTES FIL..." */, 0)) return TCL_ERROR } if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+80 /* &n */) != 0 { @@ -51313,17 +52932,17 @@ func fake_big_file(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, a rc = sqlite3.Xsqlite3OsOpenMalloc(tls, pVfs, zFile, bp+88, /* &fd */ ((SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE) | SQLITE_OPEN_MAIN_DB), uintptr(0)) if rc != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+23488 /* "open failed: " */, sqlite3.Xsqlite3ErrName(tls, rc), 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+23977 /* "open failed: " */, sqlite3.Xsqlite3ErrName(tls, rc), 0)) sqlite3.Xsqlite3_free(tls, zFile) return TCL_ERROR } offset = i64(*(*int32)(unsafe.Pointer(bp + 80 /* n */))) offset = offset * (int64(1024 * 1024)) - rc = sqlite3.Xsqlite3OsWrite(tls, *(*uintptr)(unsafe.Pointer(bp + 88 /* fd */)), ts+23502 /* "Hello, World!" */, 14, offset) + rc = sqlite3.Xsqlite3OsWrite(tls, *(*uintptr)(unsafe.Pointer(bp + 88 /* fd */)), ts+23991 /* "Hello, World!" */, 14, offset) sqlite3.Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 88 /* fd */))) sqlite3.Xsqlite3_free(tls, zFile) if rc != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, ts+23516 /* "write failed: " */, sqlite3.Xsqlite3ErrName(tls, rc), 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, ts+24005 /* "write failed: " */, sqlite3.Xsqlite3ErrName(tls, rc), 0)) return TCL_ERROR } return TCL_OK @@ -51340,8 +52959,8 @@ func testPendingByte(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, var rc int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23531 /* " PENDING-BYTE\"" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+24020 /* " PENDING-BYTE\"" */, uintptr(0))) return TCL_ERROR } if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+40 /* &pbyte */) != 0 { @@ -51367,7 +52986,7 @@ func faultSimCallback(tls *libc.TLS, x int32) int32 { /* test2.c:583:12: */ var isNeg int32 var rc int32 if x == 0 { - libc.Xmemcpy(tls, (faultSimScript + uintptr(faultSimScriptSize)), ts+13695 /* "0" */, uint64(2)) + libc.Xmemcpy(tls, (faultSimScript + uintptr(faultSimScriptSize)), ts+13875 /* "0" */, uint64(2)) } else { // Convert x to text without using any sqlite3 routines if x < 0 { @@ -51401,7 +53020,7 @@ func faultSimCallback(tls *libc.TLS, x int32) int32 { /* test2.c:583:12: */ } rc = tcl.XTcl_Eval(tls, faultSimInterp, faultSimScript) if rc != 0 { - libc.Xfprintf(tls, libc.Xstderr, ts+23546 /* "fault simulator ..." */, libc.VaList(bp, faultSimScript)) + libc.Xfprintf(tls, libc.Xstderr, ts+24035 /* "fault simulator ..." */, libc.VaList(bp, faultSimScript)) rc = SQLITE_ERROR } else { rc = libc.Xatoi(tls, tcl.XTcl_GetStringResult(tls, faultSimInterp)) @@ -51423,13 +53042,13 @@ func faultInstallCmd(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, var nScript int32 var rc int32 if (argc != 1) && (argc != 2) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23582 /* " SCRIPT\"" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+24071 /* " SCRIPT\"" */, uintptr(0))) } if argc == 2 { zScript = *(*uintptr)(unsafe.Pointer(argv + 1*8)) } else { - zScript = ts + 488 /* "" */ + zScript = ts + 489 /* "" */ } nScript = int32(libc.Xstrlen(tls, zScript)) if faultSimScript != 0 { @@ -51441,7 +53060,7 @@ func faultInstallCmd(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, } else { faultSimScript = libc.Xmalloc(tls, (uint64(nScript + 100))) if faultSimScript == uintptr(0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, ts+1929 /* "out of memory" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, ts+1930 /* "out of memory" */, uintptr(0))) return SQLITE_ERROR } libc.Xmemcpy(tls, faultSimScript, zScript, uint64(nScript)) @@ -51470,8 +53089,8 @@ func testBitvecBuiltinTest(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc var z uintptr if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23591 /* " SIZE PROGRAM\"" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+24080 /* " SIZE PROGRAM\"" */, uintptr(0))) } if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+48 /* &sz */) != 0 { return TCL_ERROR @@ -51504,19 +53123,19 @@ func Sqlitetest2_Init(tls *libc.TLS, interp uintptr) int32 { /* test2.c:697:5: * }{}))); i++ { tcl.XTcl_CreateCommand(tls, interp, aCmd2[i].FzName, aCmd2[i].FxProc, uintptr(0), uintptr(0)) } - tcl.XTcl_LinkVar(tls, interp, ts+23606, /* "sqlite_io_error_..." */ + tcl.XTcl_LinkVar(tls, interp, ts+24095, /* "sqlite_io_error_..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_io_error_pending)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+23630, /* "sqlite_io_error_..." */ + tcl.XTcl_LinkVar(tls, interp, ts+24119, /* "sqlite_io_error_..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_io_error_persist)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+23654, /* "sqlite_io_error_..." */ + tcl.XTcl_LinkVar(tls, interp, ts+24143, /* "sqlite_io_error_..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_io_error_hit)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+23674, /* "sqlite_io_error_..." */ + tcl.XTcl_LinkVar(tls, interp, ts+24163, /* "sqlite_io_error_..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_io_error_hardhit)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+23698, /* "sqlite_diskfull_..." */ + tcl.XTcl_LinkVar(tls, interp, ts+24187, /* "sqlite_diskfull_..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_diskfull_pending)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+23722, /* "sqlite_diskfull" */ + tcl.XTcl_LinkVar(tls, interp, ts+24211, /* "sqlite_diskfull" */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_diskfull)), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+23738, /* "sqlite_pending_b..." */ + tcl.XTcl_LinkVar(tls, interp, ts+24227, /* "sqlite_pending_b..." */ uintptr(unsafe.Pointer(&sqlite3.Xsqlite3PendingByte)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) return TCL_OK } @@ -51525,26 +53144,26 @@ var aCmd2 = [20]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 23758 /* "pager_open" */, FxProc: 0}, - {FzName: ts + 23769 /* "pager_close" */, FxProc: 0}, - {FzName: ts + 23781 /* "pager_commit" */, FxProc: 0}, - {FzName: ts + 23794 /* "pager_rollback" */, FxProc: 0}, - {FzName: ts + 23809 /* "pager_stmt_begin" */, FxProc: 0}, - {FzName: ts + 23826 /* "pager_stmt_commi..." */, FxProc: 0}, - {FzName: ts + 23844 /* "pager_stmt_rollb..." */, FxProc: 0}, - {FzName: ts + 23864 /* "pager_stats" */, FxProc: 0}, - {FzName: ts + 23876 /* "pager_pagecount" */, FxProc: 0}, - {FzName: ts + 23892 /* "page_get" */, FxProc: 0}, - {FzName: ts + 23901 /* "page_lookup" */, FxProc: 0}, - {FzName: ts + 23913 /* "page_unref" */, FxProc: 0}, - {FzName: ts + 23924 /* "page_read" */, FxProc: 0}, - {FzName: ts + 23934 /* "page_write" */, FxProc: 0}, - {FzName: ts + 23945 /* "page_number" */, FxProc: 0}, - {FzName: ts + 23957 /* "pager_truncate" */, FxProc: 0}, - {FzName: ts + 23972 /* "fake_big_file" */, FxProc: 0}, - {FzName: ts + 23986 /* "sqlite3BitvecBui..." */, FxProc: 0}, - {FzName: ts + 24011 /* "sqlite3_test_con..." */, FxProc: 0}, - {FzName: ts + 24045 /* "sqlite3_test_con..." */, FxProc: 0}, + {FzName: ts + 24247 /* "pager_open" */, FxProc: 0}, + {FzName: ts + 24258 /* "pager_close" */, FxProc: 0}, + {FzName: ts + 24270 /* "pager_commit" */, FxProc: 0}, + {FzName: ts + 24283 /* "pager_rollback" */, FxProc: 0}, + {FzName: ts + 24298 /* "pager_stmt_begin" */, FxProc: 0}, + {FzName: ts + 24315 /* "pager_stmt_commi..." */, FxProc: 0}, + {FzName: ts + 24333 /* "pager_stmt_rollb..." */, FxProc: 0}, + {FzName: ts + 24353 /* "pager_stats" */, FxProc: 0}, + {FzName: ts + 24365 /* "pager_pagecount" */, FxProc: 0}, + {FzName: ts + 24381 /* "page_get" */, FxProc: 0}, + {FzName: ts + 24390 /* "page_lookup" */, FxProc: 0}, + {FzName: ts + 24402 /* "page_unref" */, FxProc: 0}, + {FzName: ts + 24413 /* "page_read" */, FxProc: 0}, + {FzName: ts + 24423 /* "page_write" */, FxProc: 0}, + {FzName: ts + 24434 /* "page_number" */, FxProc: 0}, + {FzName: ts + 24446 /* "pager_truncate" */, FxProc: 0}, + {FzName: ts + 24461 /* "fake_big_file" */, FxProc: 0}, + {FzName: ts + 24475 /* "sqlite3BitvecBui..." */, FxProc: 0}, + {FzName: ts + 24500 /* "sqlite3_test_con..." */, FxProc: 0}, + {FzName: ts + 24534 /* "sqlite3_test_con..." */, FxProc: 0}, } /* test2.c:707:5 */ // 2001 September 15 @@ -52201,7 +53820,7 @@ type IntegrityCk1 = struct { FerrMsg StrAccum Fheap uintptr Fdb uintptr -} /* btreeInt.h:674:9 */ +} /* btreeInt.h:692:9 */ // Legal values for BtCursor.curFlags @@ -52297,7 +53916,7 @@ type IntegrityCk1 = struct { // the database the corresponding bit is set. This allows integrity-check to // detect pages that are used twice and orphaned pages (both of which // indicate corruption). -type IntegrityCk = IntegrityCk1 /* btreeInt.h:674:28 */ +type IntegrityCk = IntegrityCk1 /* btreeInt.h:692:28 */ // A bogus sqlite3 connection structure for use in the btree // tests. @@ -52321,8 +53940,8 @@ func btree_open(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv var n int32 var zFilename uintptr if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24080 /* " FILENAME NCACHE..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+24569 /* " FILENAME NCACHE..." */, 0)) return TCL_ERROR } if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+72 /* &nCache */) != 0 { @@ -52349,7 +53968,7 @@ func btree_open(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv return TCL_ERROR } sqlite3.Xsqlite3BtreeSetCacheSize(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pBt */)), *(*int32)(unsafe.Pointer(bp + 72 /* nCache */))) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+88 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 80 /* pBt */)))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+88 /* &zBuf[0] */, ts+13023 /* "%p" */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 80 /* pBt */)))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+88 /* &zBuf[0] */, 0)) return TCL_OK } @@ -52364,8 +53983,8 @@ func btree_close(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, arg var pBt uintptr var rc int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pBt = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -52394,8 +54013,8 @@ func btree_begin_transaction(tls *libc.TLS, NotUsed uintptr, interp uintptr, arg var pBt uintptr var rc int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pBt = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -52421,8 +54040,8 @@ func btree_pager_stats(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 var a uintptr if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pBt = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -52441,7 +54060,7 @@ func btree_pager_stats(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 // var zBuf [100]int8 at bp+40, 100 tcl.XTcl_AppendElement(tls, interp, zName1[i]) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+40 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(a + uintptr(i)*4)))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+40 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(a + uintptr(i)*4)))) tcl.XTcl_AppendElement(tls, interp, bp+40 /* &zBuf[0] */) } sqlite3.Xsqlite3BtreeLeave(tls, pBt) @@ -52452,8 +54071,8 @@ func btree_pager_stats(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 } var zName1 = [11]uintptr{ - ts + 23413 /* "ref" */, ts + 23417 /* "page" */, ts + 17555 /* "max" */, ts + 11313 /* "size" */, ts + 10015 /* "state" */, ts + 23422, /* "err" */ - ts + 23426 /* "hit" */, ts + 23430 /* "miss" */, ts + 23435 /* "ovfl" */, ts + 24104 /* "read" */, ts + 24109, /* "write" */ + ts + 23902 /* "ref" */, ts + 23906 /* "page" */, ts + 17904 /* "max" */, ts + 11493 /* "size" */, ts + 10195 /* "state" */, ts + 23911, /* "err" */ + ts + 23915 /* "hit" */, ts + 23919 /* "miss" */, ts + 23924 /* "ovfl" */, ts + 24593 /* "read" */, ts + 24598, /* "write" */ } /* test3.c:179:17 */ // Usage: btree_cursor ID TABLENUM WRITEABLE @@ -52473,8 +54092,8 @@ func btree_cursor(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, ar // var zBuf [30]int8 at bp+80, 30 if argc != 4 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24115 /* " ID TABLENUM WRI..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+24604 /* " ID TABLENUM WRI..." */, 0)) return TCL_ERROR } pBt = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -52502,7 +54121,7 @@ func btree_cursor(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, ar tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0)) return TCL_ERROR } - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+80 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+48, pCur)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+80 /* &zBuf[0] */, ts+13023 /* "%p" */, libc.VaList(bp+48, pCur)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+80 /* &zBuf[0] */, 0)) return SQLITE_OK } @@ -52518,8 +54137,8 @@ func btree_close_cursor(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int var rc int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pCur = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -52555,8 +54174,8 @@ func btree_next(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv // var zBuf [100]int8 at bp+72, 100 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pCur = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -52571,7 +54190,7 @@ func btree_next(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0)) return TCL_ERROR } - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+48, res)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+48, res)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+72 /* &zBuf[0] */, 0)) return SQLITE_OK } @@ -52590,8 +54209,8 @@ func btree_first(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, arg // var zBuf [100]int8 at bp+76, 100 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pCur = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -52602,7 +54221,7 @@ func btree_first(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, arg tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0)) return TCL_ERROR } - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+76 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 72 /* res */)))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+76 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 72 /* res */)))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+76 /* &zBuf[0] */, 0)) return SQLITE_OK } @@ -52620,15 +54239,15 @@ func btree_eof(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv // var zBuf [50]int8 at bp+56, 50 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pCur = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) sqlite3.Xsqlite3BtreeEnter(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree) rc = sqlite3.Xsqlite3BtreeEof(tls, pCur) sqlite3.Xsqlite3BtreeLeave(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+56 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, rc)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+56 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+32, rc)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+56 /* &zBuf[0] */, 0)) return SQLITE_OK } @@ -52645,15 +54264,15 @@ func btree_payload_size(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int // var zBuf [50]int8 at bp+56, 50 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pCur = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) sqlite3.Xsqlite3BtreeEnter(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree) n = sqlite3.Xsqlite3BtreePayloadSize(tls, pCur) sqlite3.Xsqlite3BtreeLeave(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+56 /* &zBuf[0] */, ts+17097 /* "%u" */, libc.VaList(bp+32, n)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+56 /* &zBuf[0] */, ts+17441 /* "%u" */, libc.VaList(bp+32, n)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+56 /* &zBuf[0] */, 0)) return SQLITE_OK } @@ -52692,8 +54311,8 @@ func btree_varint_test(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 // var zBuf [100]uint8 at bp+200, 100 if argc != 5 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24139 /* " START MULTIPLIE..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+24628 /* " START MULTIPLIE..." */, 0)) return TCL_ERROR } if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+184 /* &start */) != 0 { @@ -52716,20 +54335,20 @@ func btree_varint_test(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 n1 = sqlite3.Xsqlite3PutVarint(tls, bp+200 /* &zBuf[0] */, in) if (n1 > 9) || (n1 < 1) { sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+300, /* &zErr[0] */ - ts+24174 /* "putVarint return..." */, libc.VaList(bp+32, n1)) + ts+24663 /* "putVarint return..." */, libc.VaList(bp+32, n1)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+300 /* &zErr[0] */, 0)) return TCL_ERROR } n2 = int32(sqlite3.Xsqlite3GetVarint(tls, bp+200 /* &zBuf[0] */, bp+504 /* &out */)) if n1 != n2 { sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+300, /* &zErr[0] */ - ts+24224 /* "putVarint return..." */, libc.VaList(bp+56, n1, n2)) + ts+24713 /* "putVarint return..." */, libc.VaList(bp+56, n1, n2)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, bp+300 /* &zErr[0] */, 0)) return TCL_ERROR } if in != *(*u64)(unsafe.Pointer(bp + 504 /* out */)) { sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+300, /* &zErr[0] */ - ts+24272 /* "Wrote 0x%016llx ..." */, libc.VaList(bp+88, in, *(*u64)(unsafe.Pointer(bp + 504 /* out */)))) + ts+24761 /* "Wrote 0x%016llx ..." */, libc.VaList(bp+88, in, *(*u64)(unsafe.Pointer(bp + 504 /* out */)))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+104, bp+300 /* &zErr[0] */, 0)) return TCL_ERROR } @@ -52748,14 +54367,14 @@ func btree_varint_test(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 *(*u64)(unsafe.Pointer(bp + 504 /* out */)) = u64(*(*u322)(unsafe.Pointer(bp + 512 /* out32 */))) if n1 != n2 { sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+300, /* &zErr[0] */ - ts+24311, /* "putVarint return..." */ + ts+24800, /* "putVarint return..." */ libc.VaList(bp+120, n1, n2)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+136, bp+300 /* &zErr[0] */, 0)) return TCL_ERROR } if in != *(*u64)(unsafe.Pointer(bp + 504 /* out */)) { sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+300, /* &zErr[0] */ - ts+24361, /* "Wrote 0x%016llx ..." */ + ts+24850, /* "Wrote 0x%016llx ..." */ libc.VaList(bp+152, in, *(*u64)(unsafe.Pointer(bp + 504 /* out */)))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+168, bp+300 /* &zErr[0] */, 0)) return TCL_ERROR @@ -52793,13 +54412,13 @@ func btree_from_db(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, a var iDb int32 = 0 if (argc != 2) && (argc != 3) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24417 /* " DB-HANDLE ?N?\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+24906 /* " DB-HANDLE ?N?\"" */, 0)) return TCL_ERROR } if 1 != tcl.XTcl_GetCommandInfo(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8)), bp+72 /* &info */) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24433 /* "No such db-handl..." */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+11456 /* "\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24922 /* "No such db-handl..." */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+11636 /* "\"" */, 0)) return TCL_ERROR } if argc == 3 { @@ -52809,7 +54428,7 @@ func btree_from_db(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, a db = *(*uintptr)(unsafe.Pointer((*Tcl_CmdInfo)(unsafe.Pointer(bp + 72 /* &info */)).FobjClientData)) pBt = (*Db)(unsafe.Pointer((*sqlite31)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+136 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+64, pBt)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+136 /* &zBuf[0] */, ts+13023 /* "%p" */, libc.VaList(bp+64, pBt)) tcl.XTcl_SetResult(tls, interp, bp+136 /* &zBuf[0] */, uintptr(1)) return TCL_OK } @@ -52826,8 +54445,8 @@ func btree_ismemdb(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, a var pFile uintptr if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+23408 /* " ID\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+23897 /* " ID\"" */, 0)) return TCL_ERROR } pBt = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -52854,7 +54473,7 @@ func btree_set_cache_size(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc i if argc != 3 { tcl.XTcl_AppendResult(tls, - interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), ts+24454 /* " BT NCACHE\"" */, 0)) + interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), ts+24943 /* " BT NCACHE\"" */, 0)) return TCL_ERROR } pBt = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -52883,7 +54502,7 @@ func btree_insert(tls *libc.TLS, clientData ClientData, interp uintptr, objc int // var x BtreePayload at bp+16, 48 if (objc != 4) && (objc != 3) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+24466 /* "?-intkey? CSR KE..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+24955 /* "?-intkey? CSR KE..." */) return TCL_ERROR } @@ -52925,7 +54544,7 @@ func Sqlitetest3_Init(tls *libc.TLS, interp uintptr) int32 { /* test3.c:661:5: * tcl.XTcl_CreateCommand(tls, interp, aCmd3[i].FzName, aCmd3[i].FxProc, uintptr(0), uintptr(0)) } - tcl.XTcl_CreateObjCommand(tls, interp, ts+24490 /* "btree_insert" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+24979 /* "btree_insert" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32 }{btree_insert})), uintptr(0), uintptr(0)) @@ -52936,20 +54555,20 @@ var aCmd3 = [14]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 24503 /* "btree_open" */, FxProc: 0}, - {FzName: ts + 24514 /* "btree_close" */, FxProc: 0}, - {FzName: ts + 24526 /* "btree_begin_tran..." */, FxProc: 0}, - {FzName: ts + 24550 /* "btree_pager_stat..." */, FxProc: 0}, - {FzName: ts + 24568 /* "btree_cursor" */, FxProc: 0}, - {FzName: ts + 24581 /* "btree_close_curs..." */, FxProc: 0}, - {FzName: ts + 24600 /* "btree_next" */, FxProc: 0}, - {FzName: ts + 24611 /* "btree_eof" */, FxProc: 0}, - {FzName: ts + 24621 /* "btree_payload_si..." */, FxProc: 0}, - {FzName: ts + 24640 /* "btree_first" */, FxProc: 0}, - {FzName: ts + 24652 /* "btree_varint_tes..." */, FxProc: 0}, - {FzName: ts + 24670 /* "btree_from_db" */, FxProc: 0}, - {FzName: ts + 24684 /* "btree_ismemdb" */, FxProc: 0}, - {FzName: ts + 24698 /* "btree_set_cache_..." */, FxProc: 0}, + {FzName: ts + 24992 /* "btree_open" */, FxProc: 0}, + {FzName: ts + 25003 /* "btree_close" */, FxProc: 0}, + {FzName: ts + 25015 /* "btree_begin_tran..." */, FxProc: 0}, + {FzName: ts + 25039 /* "btree_pager_stat..." */, FxProc: 0}, + {FzName: ts + 25057 /* "btree_cursor" */, FxProc: 0}, + {FzName: ts + 25070 /* "btree_close_curs..." */, FxProc: 0}, + {FzName: ts + 25089 /* "btree_next" */, FxProc: 0}, + {FzName: ts + 25100 /* "btree_eof" */, FxProc: 0}, + {FzName: ts + 25110 /* "btree_payload_si..." */, FxProc: 0}, + {FzName: ts + 25129 /* "btree_first" */, FxProc: 0}, + {FzName: ts + 25141 /* "btree_varint_tes..." */, FxProc: 0}, + {FzName: ts + 25159 /* "btree_from_db" */, FxProc: 0}, + {FzName: ts + 25173 /* "btree_ismemdb" */, FxProc: 0}, + {FzName: ts + 25187 /* "btree_set_cache_..." */, FxProc: 0}, } /* test3.c:665:5 */ // end block for C++ @@ -53104,7 +54723,7 @@ var aCmd3 = [14]struct { // Never include this file directly; use instead. -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -53216,26 +54835,8 @@ var aCmd3 = [14]struct { // Cloning flags. -// Sched parameter structure. Generic version. -// Copyright (C) 1996-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - // Data structure to describe a process' schedulability. -type sched_param = struct{ Fsched_priority int32 } /* struct_sched_param.h:23:1 */ +type sched_param = struct{ Fsched_priority int32 } /* sched.h:75:1 */ // Basic access functions. @@ -53278,7 +54879,7 @@ type cpu_set_t = struct{ F__bits [16]uint64 } /* cpu-set.h:42:3 */ // License along with the GNU C Library; if not, see // . -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -53604,7 +55205,7 @@ func parse_thread_id(tls *libc.TLS, interp uintptr, zArg uintptr) int32 { /* tes defer tls.Free(16) if (((zArg == uintptr(0)) || (int32(*(*int8)(unsafe.Pointer(zArg))) == 0)) || (int32(*(*int8)(unsafe.Pointer(zArg + 1))) != 0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zArg)))))*2))) & int32(_ISupper)) != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+24719 /* "thread ID must b..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+25208 /* "thread ID must b..." */, 0)) return -1 } return (int32(*(*int8)(unsafe.Pointer(zArg))) - 'A') @@ -53624,8 +55225,8 @@ func tcl_thread_create(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 var rc int32 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24758 /* " ID FILENAME" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25247 /* " ID FILENAME" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -53633,7 +55234,7 @@ func tcl_thread_create(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 return TCL_ERROR } if threadset[i].Fbusy != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24771 /* "thread " */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+24779 /* " is already runn..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25260 /* "thread " */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+25268 /* " is already runn..." */, 0)) return TCL_ERROR } threadset[i].Fbusy = 1 @@ -53645,7 +55246,7 @@ func tcl_thread_create(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 f func(*libc.TLS, uintptr) uintptr }{test_thread_main})), (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) if rc != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, ts+24799 /* "failed to create..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, ts+25288 /* "failed to create..." */, 0)) sqlite3.Xsqlite3_free(tls, threadset[i].FzFilename) threadset[i].Fbusy = 0 return TCL_ERROR @@ -53671,8 +55272,8 @@ func tcl_thread_wait(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, var i int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24827 /* " ID" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25316 /* " ID" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -53680,7 +55281,7 @@ func tcl_thread_wait(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) @@ -53711,8 +55312,8 @@ func tcl_thread_halt(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, var i int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24827 /* " ID" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25316 /* " ID" */, 0)) return TCL_ERROR } if (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 1*8))))) == '*') && (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 1*8)) + 1))) == 0) { @@ -53727,7 +55328,7 @@ func tcl_thread_halt(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } test_stop_thread(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) @@ -53747,8 +55348,8 @@ func tcl_thread_argc(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, // var zBuf [100]int8 at bp+72, 100 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24827 /* " ID" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25316 /* " ID" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -53756,11 +55357,11 @@ func tcl_thread_argc(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+48, threadset[i].Fargc)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+48, threadset[i].Fargc)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+72 /* &zBuf[0] */, 0)) return TCL_OK } @@ -53777,8 +55378,8 @@ func tcl_thread_argv(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, // var n int32 at bp+80, 4 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24846 /* " ID N" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25335 /* " ID N" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -53786,7 +55387,7 @@ func tcl_thread_argv(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+80 /* &n */) != 0 { @@ -53794,7 +55395,7 @@ func tcl_thread_argv(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) if (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) < 0) || (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) >= threadset[i].Fargc) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+24852 /* "column number ou..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+25341 /* "column number ou..." */, 0)) return TCL_ERROR } tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680 + 80 /* &.argv */) + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* n */)))*8)), 0)) @@ -53813,8 +55414,8 @@ func tcl_thread_colname(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int // var n int32 at bp+80, 4 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24846 /* " ID N" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25335 /* " ID N" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -53822,7 +55423,7 @@ func tcl_thread_colname(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+80 /* &n */) != 0 { @@ -53830,7 +55431,7 @@ func tcl_thread_colname(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) if (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) < 0) || (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) >= threadset[i].Fargc) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+24852 /* "column number ou..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+25341 /* "column number ou..." */, 0)) return TCL_ERROR } tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680 + 880 /* &.colv */) + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* n */)))*8)), 0)) @@ -53849,8 +55450,8 @@ func tcl_thread_result(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 var zName uintptr if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24827 /* " ID" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25316 /* " ID" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -53858,7 +55459,7 @@ func tcl_thread_result(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) @@ -53878,8 +55479,8 @@ func tcl_thread_error(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32 var i int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24827 /* " ID" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25316 /* " ID" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -53887,7 +55488,7 @@ func tcl_thread_error(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32 return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) @@ -53898,7 +55499,7 @@ func tcl_thread_error(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32 // This procedure runs in the thread to compile an SQL statement. func do_compile(tls *libc.TLS, p uintptr) { /* test4.c:419:13: */ if (*Thread)(unsafe.Pointer(p)).Fdb == uintptr(0) { - (*Thread)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24879 /* "no database is o..." */) + (*Thread)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+25368 /* "no database is o..." */) (*Thread)(unsafe.Pointer(p)).Frc = SQLITE_ERROR return } @@ -53918,8 +55519,8 @@ func tcl_thread_compile(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int var i int32 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24899 /* " ID SQL" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25388 /* " ID SQL" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -53927,7 +55528,7 @@ func tcl_thread_compile(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) @@ -53942,7 +55543,7 @@ func tcl_thread_compile(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int func do_step(tls *libc.TLS, p uintptr) { /* test4.c:466:13: */ var i int32 if (*Thread)(unsafe.Pointer(p)).FpStmt == uintptr(0) { - (*Thread)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24907 /* "no virtual machi..." */) + (*Thread)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+25396 /* "no virtual machi..." */) (*Thread)(unsafe.Pointer(p)).Frc = SQLITE_ERROR return } @@ -53967,8 +55568,8 @@ func tcl_thread_step(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, var i int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24936 /* " IDL" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25425 /* " IDL" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -53976,7 +55577,7 @@ func tcl_thread_step(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) @@ -53988,7 +55589,7 @@ func tcl_thread_step(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, // This procedure runs in the thread to finalize a virtual machine. func do_finalize(tls *libc.TLS, p uintptr) { /* test4.c:517:13: */ if (*Thread)(unsafe.Pointer(p)).FpStmt == uintptr(0) { - (*Thread)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24907 /* "no virtual machi..." */) + (*Thread)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+25396 /* "no virtual machi..." */) (*Thread)(unsafe.Pointer(p)).Frc = SQLITE_ERROR return } @@ -54005,8 +55606,8 @@ func tcl_thread_finalize(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc in var i int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24936 /* " IDL" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25425 /* " IDL" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -54014,7 +55615,7 @@ func tcl_thread_finalize(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc in return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) @@ -54036,8 +55637,8 @@ func tcl_thread_swap(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, var j int32 var temp uintptr if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24941 /* " ID1 ID2" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25430 /* " ID1 ID2" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -54045,7 +55646,7 @@ func tcl_thread_swap(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) @@ -54054,7 +55655,7 @@ func tcl_thread_swap(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset[j].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(j)*1680)) @@ -54077,8 +55678,8 @@ func tcl_thread_db_get(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 // var zBuf [100]int8 at bp+64, 100 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24827 /* " ID" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25316 /* " ID" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -54086,7 +55687,7 @@ func tcl_thread_db_get(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) @@ -54104,8 +55705,8 @@ func tcl_thread_db_put(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 var i int32 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24950 /* " ID DB" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25439 /* " ID DB" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -54113,7 +55714,7 @@ func tcl_thread_db_put(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) @@ -54134,8 +55735,8 @@ func tcl_thread_stmt_get(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc in // var zBuf [100]int8 at bp+64, 100 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24827 /* " ID" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25316 /* " ID" */, 0)) return TCL_ERROR } i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -54143,7 +55744,7 @@ func tcl_thread_stmt_get(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc in return TCL_ERROR } if !(threadset[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680)) @@ -54170,21 +55771,21 @@ var aCmd4 = [15]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 24957 /* "thread_create" */, FxProc: 0}, - {FzName: ts + 24971 /* "thread_wait" */, FxProc: 0}, - {FzName: ts + 24983 /* "thread_halt" */, FxProc: 0}, - {FzName: ts + 24995 /* "thread_argc" */, FxProc: 0}, - {FzName: ts + 25007 /* "thread_argv" */, FxProc: 0}, - {FzName: ts + 25019 /* "thread_colname" */, FxProc: 0}, - {FzName: ts + 25034 /* "thread_result" */, FxProc: 0}, - {FzName: ts + 25048 /* "thread_error" */, FxProc: 0}, - {FzName: ts + 25061 /* "thread_compile" */, FxProc: 0}, - {FzName: ts + 25076 /* "thread_step" */, FxProc: 0}, - {FzName: ts + 25088 /* "thread_finalize" */, FxProc: 0}, - {FzName: ts + 25104 /* "thread_swap" */, FxProc: 0}, - {FzName: ts + 25116 /* "thread_db_get" */, FxProc: 0}, - {FzName: ts + 25130 /* "thread_db_put" */, FxProc: 0}, - {FzName: ts + 25144 /* "thread_stmt_get" */, FxProc: 0}, + {FzName: ts + 25446 /* "thread_create" */, FxProc: 0}, + {FzName: ts + 25460 /* "thread_wait" */, FxProc: 0}, + {FzName: ts + 25472 /* "thread_halt" */, FxProc: 0}, + {FzName: ts + 25484 /* "thread_argc" */, FxProc: 0}, + {FzName: ts + 25496 /* "thread_argv" */, FxProc: 0}, + {FzName: ts + 25508 /* "thread_colname" */, FxProc: 0}, + {FzName: ts + 25523 /* "thread_result" */, FxProc: 0}, + {FzName: ts + 25537 /* "thread_error" */, FxProc: 0}, + {FzName: ts + 25550 /* "thread_compile" */, FxProc: 0}, + {FzName: ts + 25565 /* "thread_step" */, FxProc: 0}, + {FzName: ts + 25577 /* "thread_finalize" */, FxProc: 0}, + {FzName: ts + 25593 /* "thread_swap" */, FxProc: 0}, + {FzName: ts + 25605 /* "thread_db_get" */, FxProc: 0}, + {FzName: ts + 25619 /* "thread_db_put" */, FxProc: 0}, + {FzName: ts + 25633 /* "thread_stmt_get" */, FxProc: 0}, } /* test4.c:700:5 */ // end block for C++ @@ -54271,8 +55872,8 @@ func test_value_overhead(tls *libc.TLS, clientData uintptr, interp uintptr, objc // var val Mem at bp+40, 56 if objc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+25160 /* " ..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), ts+25649 /* " ..." */, 0)) return TCL_ERROR } @@ -54284,8 +55885,8 @@ func test_value_overhead(tls *libc.TLS, clientData uintptr, interp uintptr, objc } (*Mem)(unsafe.Pointer(bp + 40 /* &val */)).Fflags = (u16((MEM_Str | MEM_Term) | MEM_Static)) - (*Mem)(unsafe.Pointer(bp + 40 /* &val */)).Fz = ts + 25187 /* "hello world" */ - (*Mem)(unsafe.Pointer(bp + 40 /* &val */)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(bp + 40 /* &val */)).Fz = ts + 25676 /* "hello world" */ + (*Mem)(unsafe.Pointer(bp + 40 /* &val */)).Fenc = u8(SQLITE_UTF8) for i = 0; i < *(*int32)(unsafe.Pointer(bp + 32 /* repeat_count */)); i++ { if *(*int32)(unsafe.Pointer(bp + 36 /* do_calls */)) != 0 { @@ -54301,10 +55902,10 @@ func name_to_enc(tls *libc.TLS, interp uintptr, pObj uintptr) u8 { /* test5.c:94 defer tls.Free(104) *(*[5]EncName)(unsafe.Pointer(bp + 24 /* encnames */)) = [5]EncName{ - {FzName: ts + 25199 /* "UTF8" */, Fenc: SQLITE_UTF8}, - {FzName: ts + 25204 /* "UTF16LE" */, Fenc: SQLITE_UTF16LE}, - {FzName: ts + 25212 /* "UTF16BE" */, Fenc: SQLITE_UTF16BE}, - {FzName: ts + 25220 /* "UTF16" */, Fenc: SQLITE_UTF16}, + {FzName: ts + 25688 /* "UTF8" */, Fenc: u8(SQLITE_UTF8)}, + {FzName: ts + 25693 /* "UTF16LE" */, Fenc: u8(SQLITE_UTF16LE)}, + {FzName: ts + 25701 /* "UTF16BE" */, Fenc: u8(SQLITE_UTF16BE)}, + {FzName: ts + 25709 /* "UTF16" */, Fenc: u8(SQLITE_UTF16)}, {}, } var pEnc uintptr @@ -54315,10 +55916,10 @@ func name_to_enc(tls *libc.TLS, interp uintptr, pObj uintptr) u8 { /* test5.c:94 } } if !(int32((*EncName)(unsafe.Pointer(pEnc)).Fenc) != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+25226 /* "No such encoding..." */, z, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+25715 /* "No such encoding..." */, z, 0)) } if int32((*EncName)(unsafe.Pointer(pEnc)).Fenc) == SQLITE_UTF16 { - return SQLITE_UTF16LE + return u8(SQLITE_UTF16LE) } return (*EncName)(unsafe.Pointer(pEnc)).Fenc } @@ -54344,9 +55945,9 @@ func test_translate(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 var xDel uintptr = uintptr(0) if (objc != 4) && (objc != 5) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), uintptr(0)), - ts+25245 /* " <..." */, 0)) + ts+25734 /* " <..." */, 0)) return TCL_ERROR } if objc == 5 { @@ -54415,10 +56016,10 @@ var aCmd5 = [4]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 25280 /* "binarize" */, FxProc: 0}, - {FzName: ts + 25289 /* "test_value_overh..." */, FxProc: 0}, - {FzName: ts + 25309 /* "test_translate" */, FxProc: 0}, - {FzName: ts + 25324 /* "translate_selfte..." */, FxProc: 0}, + {FzName: ts + 25769 /* "binarize" */, FxProc: 0}, + {FzName: ts + 25778 /* "test_value_overh..." */, FxProc: 0}, + {FzName: ts + 25798 /* "test_translate" */, FxProc: 0}, + {FzName: ts + 25813 /* "translate_selfte..." */, FxProc: 0}, } /* test5.c:209:5 */ // end block for C++ @@ -54672,7 +56273,7 @@ func writeListAppend(tls *libc.TLS, pFile uintptr, iOffset sqlite3_int64, zBuf u pNew = crash_malloc(tls, (int32(uint64(unsafe.Sizeof(WriteBuffer{})) + uint64(nBuf)))) if pNew == uintptr(0) { - libc.Xfprintf(tls, libc.Xstderr, ts+25343 /* "out of memory in..." */, 0) + libc.Xfprintf(tls, libc.Xstderr, ts+25832 /* "out of memory in..." */, 0) } libc.Xmemset(tls, pNew, 0, (uint64(unsafe.Sizeof(WriteBuffer{})) + uint64(nBuf))) (*WriteBuffer)(unsafe.Pointer(pNew)).FiOffset = iOffset @@ -54828,19 +56429,23 @@ func cfDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* test6.c:54 // Pass-throughs for WAL support. func cfShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* test6.c:552:12: */ - return sqlite3.Xsqlite3OsShmLock(tls, (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile, ofst, n, flags) + var pReal uintptr = (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pReal)).FpMethods + 112 /* &.xShmLock */))))(tls, pReal, ofst, n, flags) } -func cfShmBarrier(tls *libc.TLS, pFile uintptr) { /* test6.c:555:13: */ - sqlite3.Xsqlite3OsShmBarrier(tls, (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile) +func cfShmBarrier(tls *libc.TLS, pFile uintptr) { /* test6.c:556:13: */ + var pReal uintptr = (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pReal)).FpMethods + 120 /* &.xShmBarrier */))))(tls, pReal) } -func cfShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* test6.c:558:12: */ - return sqlite3.Xsqlite3OsShmUnmap(tls, (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile, delFlag) +func cfShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* test6.c:560:12: */ + var pReal uintptr = (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pReal)).FpMethods + 128 /* &.xShmUnmap */))))(tls, pReal, delFlag) } -func cfShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, sz int32, w int32, pp uintptr) int32 { /* test6.c:561:12: */ - return sqlite3.Xsqlite3OsShmMap(tls, (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile, iRegion, sz, w, libc.AtomicLoadUintptr(&pp)) +func cfShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, sz int32, w int32, pp uintptr) int32 { /* test6.c:564:12: */ + var pReal uintptr = (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pReal)).FpMethods + 104 /* &.xShmMap */))))(tls, pReal, iRegion, sz, w, libc.AtomicLoadUintptr(&pp)) } var CrashFileVtab = sqlite3_io_methods{ @@ -54861,10 +56466,10 @@ var CrashFileVtab = sqlite3_io_methods{ FxShmLock: 0, // xShmLock FxShmBarrier: 0, // xShmBarrier FxShmUnmap: 0, // xShmUnmap -} /* test6.c:571:33 */ +} /* test6.c:575:33 */ // Application data for the crash VFS -type crashAppData = struct{ FpOrig uintptr } /* test6.c:594:1 */ +type crashAppData = struct{ FpOrig uintptr } /* test6.c:598:1 */ // Open a crash-file file handle. // @@ -54873,7 +56478,7 @@ type crashAppData = struct{ FpOrig uintptr } /* test6.c:594:1 */ // and allocates space for the "real" file structure using // sqlite3_malloc(). The assumption here is (pVfs->szOsFile) is // equal or greater than sizeof(CrashFile). -func cfOpen(tls *libc.TLS, pCfVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test6.c:607:12: */ +func cfOpen(tls *libc.TLS, pCfVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test6.c:611:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -54926,79 +56531,79 @@ func cfOpen(tls *libc.TLS, pCfVfs uintptr, zName uintptr, pFile uintptr, flags i return rc } -func cfDelete(tls *libc.TLS, pCfVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test6.c:661:12: */ +func cfDelete(tls *libc.TLS, pCfVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test6.c:665:12: */ var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData return (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pVfs + 48 /* &.xDelete */))))(tls, pVfs, zPath, dirSync) } -func cfAccess(tls *libc.TLS, pCfVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test6.c:665:12: */ +func cfAccess(tls *libc.TLS, pCfVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test6.c:669:12: */ var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 56 /* &.xAccess */))))(tls, pVfs, zPath, flags, pResOut) } -func cfFullPathname(tls *libc.TLS, pCfVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* test6.c:674:12: */ +func cfFullPathname(tls *libc.TLS, pCfVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* test6.c:678:12: */ var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 64 /* &.xFullPathname */))))(tls, pVfs, zPath, nPathOut, zPathOut) } -func cfDlOpen(tls *libc.TLS, pCfVfs uintptr, zPath uintptr) uintptr { /* test6.c:683:13: */ +func cfDlOpen(tls *libc.TLS, pCfVfs uintptr, zPath uintptr) uintptr { /* test6.c:687:13: */ var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 72 /* &.xDlOpen */))))(tls, pVfs, zPath) } -func cfDlError(tls *libc.TLS, pCfVfs uintptr, nByte int32, zErrMsg uintptr) { /* test6.c:687:13: */ +func cfDlError(tls *libc.TLS, pCfVfs uintptr, nByte int32, zErrMsg uintptr) { /* test6.c:691:13: */ var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer((pVfs + 80 /* &.xDlError */))))(tls, pVfs, nByte, zErrMsg) } -func cfDlSym(tls *libc.TLS, pCfVfs uintptr, pH uintptr, zSym uintptr) uintptr { /* test6.c:691:13: */ +func cfDlSym(tls *libc.TLS, pCfVfs uintptr, pH uintptr, zSym uintptr) uintptr { /* test6.c:695:13: */ var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 88 /* &.xDlSym */))))(tls, pVfs, pH, zSym) } -func cfDlClose(tls *libc.TLS, pCfVfs uintptr, pHandle uintptr) { /* test6.c:695:13: */ +func cfDlClose(tls *libc.TLS, pCfVfs uintptr, pHandle uintptr) { /* test6.c:699:13: */ var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pVfs + 96 /* &.xDlClose */))))(tls, pVfs, pHandle) } -func cfRandomness(tls *libc.TLS, pCfVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test6.c:699:12: */ +func cfRandomness(tls *libc.TLS, pCfVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test6.c:703:12: */ var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 104 /* &.xRandomness */))))(tls, pVfs, nByte, zBufOut) } -func cfSleep(tls *libc.TLS, pCfVfs uintptr, nMicro int32) int32 { /* test6.c:703:12: */ +func cfSleep(tls *libc.TLS, pCfVfs uintptr, nMicro int32) int32 { /* test6.c:707:12: */ var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pVfs + 112 /* &.xSleep */))))(tls, pVfs, nMicro) } -func cfCurrentTime(tls *libc.TLS, pCfVfs uintptr, pTimeOut uintptr) int32 { /* test6.c:707:12: */ +func cfCurrentTime(tls *libc.TLS, pCfVfs uintptr, pTimeOut uintptr) int32 { /* test6.c:711:12: */ var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 120 /* &.xCurrentTime */))))(tls, pVfs, pTimeOut) } -func cfGetLastError(tls *libc.TLS, pCfVfs uintptr, n int32, z uintptr) int32 { /* test6.c:711:12: */ +func cfGetLastError(tls *libc.TLS, pCfVfs uintptr, n int32, z uintptr) int32 { /* test6.c:715:12: */ var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 128 /* &.xGetLastError */))))(tls, pVfs, n, z) } -func processDevSymArgs(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, piDeviceChar uintptr, piSectorSize uintptr) int32 { /* test6.c:716:12: */ +func processDevSymArgs(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, piDeviceChar uintptr, piSectorSize uintptr) int32 { /* test6.c:720:12: */ bp := tls.Alloc(316) defer tls.Free(316) *(*[14]DeviceFlag)(unsafe.Pointer(bp + 88 /* aFlag */)) = [14]DeviceFlag{ - {FzName: ts + 25381 /* "atomic" */, FiValue: SQLITE_IOCAP_ATOMIC}, - {FzName: ts + 25388 /* "atomic512" */, FiValue: SQLITE_IOCAP_ATOMIC512}, - {FzName: ts + 25398 /* "atomic1k" */, FiValue: SQLITE_IOCAP_ATOMIC1K}, - {FzName: ts + 25407 /* "atomic2k" */, FiValue: SQLITE_IOCAP_ATOMIC2K}, - {FzName: ts + 25416 /* "atomic4k" */, FiValue: SQLITE_IOCAP_ATOMIC4K}, - {FzName: ts + 25425 /* "atomic8k" */, FiValue: SQLITE_IOCAP_ATOMIC8K}, - {FzName: ts + 25434 /* "atomic16k" */, FiValue: SQLITE_IOCAP_ATOMIC16K}, - {FzName: ts + 25444 /* "atomic32k" */, FiValue: SQLITE_IOCAP_ATOMIC32K}, - {FzName: ts + 25454 /* "atomic64k" */, FiValue: SQLITE_IOCAP_ATOMIC64K}, - {FzName: ts + 25464 /* "sequential" */, FiValue: SQLITE_IOCAP_SEQUENTIAL}, - {FzName: ts + 25475 /* "safe_append" */, FiValue: SQLITE_IOCAP_SAFE_APPEND}, - {FzName: ts + 25487 /* "powersafe_overwr..." */, FiValue: SQLITE_IOCAP_POWERSAFE_OVERWRITE}, - {FzName: ts + 25507 /* "batch-atomic" */, FiValue: SQLITE_IOCAP_BATCH_ATOMIC}, + {FzName: ts + 25870 /* "atomic" */, FiValue: SQLITE_IOCAP_ATOMIC}, + {FzName: ts + 25877 /* "atomic512" */, FiValue: SQLITE_IOCAP_ATOMIC512}, + {FzName: ts + 25887 /* "atomic1k" */, FiValue: SQLITE_IOCAP_ATOMIC1K}, + {FzName: ts + 25896 /* "atomic2k" */, FiValue: SQLITE_IOCAP_ATOMIC2K}, + {FzName: ts + 25905 /* "atomic4k" */, FiValue: SQLITE_IOCAP_ATOMIC4K}, + {FzName: ts + 25914 /* "atomic8k" */, FiValue: SQLITE_IOCAP_ATOMIC8K}, + {FzName: ts + 25923 /* "atomic16k" */, FiValue: SQLITE_IOCAP_ATOMIC16K}, + {FzName: ts + 25933 /* "atomic32k" */, FiValue: SQLITE_IOCAP_ATOMIC32K}, + {FzName: ts + 25943 /* "atomic64k" */, FiValue: SQLITE_IOCAP_ATOMIC64K}, + {FzName: ts + 25953 /* "sequential" */, FiValue: SQLITE_IOCAP_SEQUENTIAL}, + {FzName: ts + 25964 /* "safe_append" */, FiValue: SQLITE_IOCAP_SAFE_APPEND}, + {FzName: ts + 25976 /* "powersafe_overwr..." */, FiValue: SQLITE_IOCAP_POWERSAFE_OVERWRITE}, + {FzName: ts + 25996 /* "batch-atomic" */, FiValue: SQLITE_IOCAP_BATCH_ATOMIC}, {}, } var i int32 @@ -55012,15 +56617,15 @@ func processDevSymArgs(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, var zOpt uintptr = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+64 /* &nOpt */) - if (((*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) > 11) || (*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) < 2)) || (libc.Xstrncmp(tls, ts+25520 /* "-sectorsize" */, zOpt, uint64(*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)))) != 0)) && - (((*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) > 16) || (*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) < 2)) || (libc.Xstrncmp(tls, ts+25532 /* "-characteristics" */, zOpt, uint64(*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)))) != 0)) { + if (((*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) > 11) || (*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) < 2)) || (libc.Xstrncmp(tls, ts+26009 /* "-sectorsize" */, zOpt, uint64(*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)))) != 0)) && + (((*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) > 16) || (*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) < 2)) || (libc.Xstrncmp(tls, ts+26021 /* "-characteristics" */, zOpt, uint64(*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)))) != 0)) { tcl.XTcl_AppendResult(tls, interp, - libc.VaList(bp, ts+25549 /* "Bad option: \"" */, zOpt, - ts+25563 /* "\" - must be \"-ch..." */, 0)) + libc.VaList(bp, ts+26038 /* "Bad option: \"" */, zOpt, + ts+26052 /* "\" - must be \"-ch..." */, 0)) return TCL_ERROR } if i == (objc - 1) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25611 /* "Option requires ..." */, zOpt, ts+11456 /* "\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+26100 /* "Option requires ..." */, zOpt, ts+11636 /* "\"" */, 0)) return TCL_ERROR } @@ -55047,7 +56652,7 @@ func processDevSymArgs(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, tcl.XTcl_UtfToLower(tls, tcl.XTcl_GetString(tls, pFlag)) rc = tcl.XTcl_GetIndexFromObjStruct(tls, - interp, pFlag, bp+88 /* &aFlag[0] */, int32(unsafe.Sizeof(DeviceFlag{})), ts+25642 /* "no such flag" */, 0, bp+312 /* &iChoice */) + interp, pFlag, bp+88 /* &aFlag[0] */, int32(unsafe.Sizeof(DeviceFlag{})), ts+26131 /* "no such flag" */, 0, bp+312 /* &iChoice */) for ok := true; ok; ok = 0 != 0 { var _objPtr uintptr = pFlag if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 { @@ -55078,15 +56683,15 @@ type DeviceFlag = struct { FzName uintptr FiValue int32 _ [4]byte -} /* test6.c:723:3 */ +} /* test6.c:727:3 */ // tclcmd: sqlite3_crash_now // // Simulate a crash immediately. This function does not return // (writeListSync() calls exit(-1)). -func crashNowCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:816:26: */ +func crashNowCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:820:26: */ if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } writeListSync(tls, uintptr(0), 1) @@ -55098,7 +56703,7 @@ func crashNowCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // // Parameter ENABLE must be a boolean value. If true, then the "crash" // vfs is added to the system. If false, it is removed. -func crashEnableCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:837:26: */ +func crashEnableCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:841:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -55107,7 +56712,7 @@ func crashEnableCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 *(*int32)(unsafe.Pointer(bp + 4 /* isDefault */)) = 0 if (objc != 2) && (objc != 3) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25655 /* "ENABLE ?DEFAULT?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+26144 /* "ENABLE ?DEFAULT?" */) return TCL_ERROR } @@ -55138,7 +56743,7 @@ func crashEnableCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 var crashVfs = sqlite3_vfs{ FiVersion: 2, // pNext - FzName: ts + 25672, /* "crash" */ // pAppData + FzName: ts + 26161, /* "crash" */ // pAppData FxOpen: 0, // xOpen FxDelete: 0, // xDelete @@ -55152,7 +56757,7 @@ var crashVfs = sqlite3_vfs{ FxSleep: 0, // xSleep FxCurrentTime: 0, // xCurrentTime FxGetLastError: 0, // xCurrentTimeInt64 -} /* test6.c:845:22 */ +} /* test6.c:849:22 */ // tclcmd: sqlite_crashparams ?OPTIONS? DELAY CRASHFILE // @@ -55170,7 +56775,7 @@ var crashVfs = sqlite3_vfs{ // // sqlite_crashparams -sect 1024 -char {atomic sequential} ./test.db 1 // -func crashParamsObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:916:26: */ +func crashParamsObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:920:26: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -55189,7 +56794,7 @@ func crashParamsObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc i if !(objc < 3) { goto __1 } - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25678 /* "?OPTIONS? DELAY ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+26167 /* "?OPTIONS? DELAY ..." */) goto error __1: ; @@ -55198,7 +56803,7 @@ __1: if !(uint64(*(*int32)(unsafe.Pointer(bp + 32 /* nCrashFile */))) >= uint64(unsafe.Sizeof([500]int8{}))) { goto __2 } - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+25704 /* "Filename is too ..." */, zCrashFile, ts+11456 /* "\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+26193 /* "Filename is too ..." */, zCrashFile, ts+11636 /* "\"" */, 0)) goto error __2: ; @@ -55238,7 +56843,7 @@ error: return TCL_ERROR } -func devSymObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:963:26: */ +func devSymObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:967:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -55254,14 +56859,14 @@ func devSymObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, } // tclcmd: sqlite3_crash_on_write N -func writeCrashObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:985:26: */ +func writeCrashObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:989:26: */ bp := tls.Alloc(4) defer tls.Free(4) *(*int32)(unsafe.Pointer(bp /* nWrite */)) = 0 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25728 /* "NWRITE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+26217 /* "NWRITE" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &nWrite */) != 0 { @@ -55273,10 +56878,10 @@ func writeCrashObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc in } // tclcmd: unregister_devsim -func dsUnregisterObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:1009:26: */ +func dsUnregisterObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:1013:26: */ if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } @@ -55285,21 +56890,21 @@ func dsUnregisterObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc } // tclcmd: register_jt_vfs ?-default? PARENT-VFS -func jtObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:1029:26: */ +func jtObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:1033:26: */ bp := tls.Alloc(48) defer tls.Free(48) var zParent uintptr = uintptr(0) if (objc != 2) && (objc != 3) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25735 /* "?-default? PAREN..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+26224 /* "?-default? PAREN..." */) return TCL_ERROR } zParent = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) if objc == 3 { - if libc.Xstrcmp(tls, zParent, ts+25757 /* "-default" */) != 0 { + if libc.Xstrcmp(tls, zParent, ts+26246 /* "-default" */) != 0 { tcl.XTcl_AppendResult(tls, interp, - libc.VaList(bp, ts+11355 /* "bad option \"" */, zParent, ts+25766 /* "\": must be -defa..." */, 0)) + libc.VaList(bp, ts+11535 /* "bad option \"" */, zParent, ts+26255 /* "\": must be -defa..." */, 0)) return TCL_ERROR } zParent = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) @@ -55309,7 +56914,7 @@ func jtObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, obj zParent = uintptr(0) } if jt_register(tls, zParent, (libc.Bool32(objc == 3))) != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25786 /* "Error in jt_regi..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+26275 /* "Error in jt_regi..." */, 0)) return TCL_ERROR } @@ -55317,10 +56922,10 @@ func jtObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, obj } // tclcmd: unregister_jt_vfs -func jtUnregisterObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:1067:26: */ +func jtUnregisterObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:1071:26: */ if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } @@ -55329,29 +56934,29 @@ func jtUnregisterObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc } // This procedure registers the TCL procedures defined in this file. -func Sqlitetest6_Init(tls *libc.TLS, interp uintptr) int32 { /* test6.c:1089:5: */ - tcl.XTcl_CreateObjCommand(tls, interp, ts+25807 /* "sqlite3_crash_en..." */, *(*uintptr)(unsafe.Pointer(&struct { +func Sqlitetest6_Init(tls *libc.TLS, interp uintptr) int32 { /* test6.c:1093:5: */ + tcl.XTcl_CreateObjCommand(tls, interp, ts+26296 /* "sqlite3_crash_en..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{crashEnableCmd})), uintptr(0), uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+25828 /* "sqlite3_crashpar..." */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+26317 /* "sqlite3_crashpar..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{crashParamsObjCmd})), uintptr(0), uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+25848 /* "sqlite3_crash_no..." */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+26337 /* "sqlite3_crash_no..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{crashNowCmd})), uintptr(0), uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+25866 /* "sqlite3_simulate..." */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+26355 /* "sqlite3_simulate..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{devSymObjCmd})), uintptr(0), uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+25890 /* "sqlite3_crash_on..." */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+26379 /* "sqlite3_crash_on..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{writeCrashObjCmd})), uintptr(0), uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+25913 /* "unregister_devsi..." */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+26402 /* "unregister_devsi..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{dsUnregisterObjCmd})), uintptr(0), uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+25931 /* "register_jt_vfs" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+26420 /* "register_jt_vfs" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{jtObjCmd})), uintptr(0), uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+25947 /* "unregister_jt_vf..." */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+26436 /* "unregister_jt_vf..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{jtUnregisterObjCmd})), uintptr(0), uintptr(0)) return TCL_OK @@ -55436,7 +57041,7 @@ func parse_client_id(tls *libc.TLS, interp uintptr, zArg uintptr) int32 { /* tes defer tls.Free(16) if (((zArg == uintptr(0)) || (int32(*(*int8)(unsafe.Pointer(zArg))) == 0)) || (int32(*(*int8)(unsafe.Pointer(zArg + 1))) != 0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zArg)))))*2))) & int32(_ISupper)) != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+24719 /* "thread ID must b..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+25208 /* "thread ID must b..." */, 0)) return -1 } return (int32(*(*int8)(unsafe.Pointer(zArg))) - 'A') @@ -55456,8 +57061,8 @@ func tcl_client_create(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 var rc int32 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24758 /* " ID FILENAME" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25247 /* " ID FILENAME" */, 0)) return TCL_ERROR } i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -55465,7 +57070,7 @@ func tcl_client_create(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 return TCL_ERROR } if threadset1[i].Fbusy != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24771 /* "thread " */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+24779 /* " is already runn..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25260 /* "thread " */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+25268 /* " is already runn..." */, 0)) return TCL_ERROR } threadset1[i].Fbusy = 1 @@ -55477,7 +57082,7 @@ func tcl_client_create(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 f func(*libc.TLS, uintptr) uintptr }{client_main})), (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688)) if rc != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, ts+24799 /* "failed to create..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, ts+25288 /* "failed to create..." */, 0)) sqlite3.Xsqlite3_free(tls, threadset1[i].FzFilename) threadset1[i].Fbusy = 0 return TCL_ERROR @@ -55507,8 +57112,8 @@ func tcl_client_wait(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, var i int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24827 /* " ID" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25316 /* " ID" */, 0)) return TCL_ERROR } i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -55516,7 +57121,7 @@ func tcl_client_wait(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset1[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688)) @@ -55547,8 +57152,8 @@ func tcl_client_halt(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, var i int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24827 /* " ID" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25316 /* " ID" */, 0)) return TCL_ERROR } if (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 1*8))))) == '*') && (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 1*8)) + 1))) == 0) { @@ -55563,7 +57168,7 @@ func tcl_client_halt(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset1[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } stop_thread(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688)) @@ -55598,8 +57203,8 @@ func tcl_client_argc(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, // var zBuf [100]int8 at bp+72, 100 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24827 /* " ID" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25316 /* " ID" */, 0)) return TCL_ERROR } i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -55607,11 +57212,11 @@ func tcl_client_argc(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset1[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688)) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+48, threadset1[i].Fargc)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+1238 /* "%d" */, libc.VaList(bp+48, threadset1[i].Fargc)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+72 /* &zBuf[0] */, 0)) return TCL_OK } @@ -55628,8 +57233,8 @@ func tcl_client_argv(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, // var n int32 at bp+80, 4 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24846 /* " ID N" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25335 /* " ID N" */, 0)) return TCL_ERROR } i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -55637,7 +57242,7 @@ func tcl_client_argv(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset1[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+80 /* &n */) != 0 { @@ -55645,7 +57250,7 @@ func tcl_client_argv(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, } client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688)) if (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) < 0) || (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) >= threadset1[i].Fargc) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+24852 /* "column number ou..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+25341 /* "column number ou..." */, 0)) return TCL_ERROR } tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688 + 80 /* &.argv */) + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* n */)))*8)), 0)) @@ -55664,8 +57269,8 @@ func tcl_client_colname(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int // var n int32 at bp+80, 4 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24846 /* " ID N" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25335 /* " ID N" */, 0)) return TCL_ERROR } i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -55673,7 +57278,7 @@ func tcl_client_colname(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int return TCL_ERROR } if !(threadset1[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+80 /* &n */) != 0 { @@ -55681,7 +57286,7 @@ func tcl_client_colname(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int } client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688)) if (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) < 0) || (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) >= threadset1[i].Fargc) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+24852 /* "column number ou..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+25341 /* "column number ou..." */, 0)) return TCL_ERROR } tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688 + 880 /* &.colv */) + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* n */)))*8)), 0)) @@ -55700,8 +57305,8 @@ func tcl_client_result(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 var zName uintptr if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24827 /* " ID" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25316 /* " ID" */, 0)) return TCL_ERROR } i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -55709,7 +57314,7 @@ func tcl_client_result(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int3 return TCL_ERROR } if !(threadset1[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688)) @@ -55729,8 +57334,8 @@ func tcl_client_error(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32 var i int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24827 /* " ID" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25316 /* " ID" */, 0)) return TCL_ERROR } i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -55738,7 +57343,7 @@ func tcl_client_error(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32 return TCL_ERROR } if !(threadset1[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688)) @@ -55749,7 +57354,7 @@ func tcl_client_error(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32 // This procedure runs in the thread to compile an SQL statement. func do_compile1(tls *libc.TLS, p uintptr) { /* test7.c:466:13: */ if (*Thread1)(unsafe.Pointer(p)).Fdb == uintptr(0) { - (*Thread1)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24879 /* "no database is o..." */) + (*Thread1)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+25368 /* "no database is o..." */) (*Thread1)(unsafe.Pointer(p)).Frc = SQLITE_ERROR return } @@ -55769,8 +57374,8 @@ func tcl_client_compile(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int var i int32 if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24899 /* " ID SQL" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25388 /* " ID SQL" */, 0)) return TCL_ERROR } i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -55778,7 +57383,7 @@ func tcl_client_compile(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int return TCL_ERROR } if !(threadset1[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688)) @@ -55793,7 +57398,7 @@ func tcl_client_compile(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int func do_step1(tls *libc.TLS, p uintptr) { /* test7.c:513:13: */ var i int32 if (*Thread1)(unsafe.Pointer(p)).FpStmt == uintptr(0) { - (*Thread1)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24907 /* "no virtual machi..." */) + (*Thread1)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+25396 /* "no virtual machi..." */) (*Thread1)(unsafe.Pointer(p)).Frc = SQLITE_ERROR return } @@ -55818,8 +57423,8 @@ func tcl_client_step(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, var i int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24936 /* " IDL" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25425 /* " IDL" */, 0)) return TCL_ERROR } i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -55827,7 +57432,7 @@ func tcl_client_step(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset1[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688)) @@ -55839,7 +57444,7 @@ func tcl_client_step(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, // This procedure runs in the thread to finalize a virtual machine. func do_finalize1(tls *libc.TLS, p uintptr) { /* test7.c:564:13: */ if (*Thread1)(unsafe.Pointer(p)).FpStmt == uintptr(0) { - (*Thread1)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24907 /* "no virtual machi..." */) + (*Thread1)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+25396 /* "no virtual machi..." */) (*Thread1)(unsafe.Pointer(p)).Frc = SQLITE_ERROR return } @@ -55856,8 +57461,8 @@ func tcl_client_finalize(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc in var i int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24936 /* " IDL" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25425 /* " IDL" */, 0)) return TCL_ERROR } i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -55865,7 +57470,7 @@ func tcl_client_finalize(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc in return TCL_ERROR } if !(threadset1[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688)) @@ -55879,7 +57484,7 @@ func tcl_client_finalize(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc in // This procedure runs in the thread to reset a virtual machine. func do_reset(tls *libc.TLS, p uintptr) { /* test7.c:608:13: */ if (*Thread1)(unsafe.Pointer(p)).FpStmt == uintptr(0) { - (*Thread1)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24907 /* "no virtual machi..." */) + (*Thread1)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+25396 /* "no virtual machi..." */) (*Thread1)(unsafe.Pointer(p)).Frc = SQLITE_ERROR return } @@ -55896,8 +57501,8 @@ func tcl_client_reset(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32 var i int32 if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24936 /* " IDL" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25425 /* " IDL" */, 0)) return TCL_ERROR } i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -55905,7 +57510,7 @@ func tcl_client_reset(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32 return TCL_ERROR } if !(threadset1[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688)) @@ -55927,8 +57532,8 @@ func tcl_client_swap(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, var j int32 var temp uintptr if argc != 3 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+24941 /* " ID1 ID2" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+25430 /* " ID1 ID2" */, 0)) return TCL_ERROR } i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -55936,7 +57541,7 @@ func tcl_client_swap(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset1[i].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688)) @@ -55945,7 +57550,7 @@ func tcl_client_swap(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, return TCL_ERROR } if !(threadset1[j].Fbusy != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+24831 /* "no such thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+25320 /* "no such thread" */, 0)) return TCL_ERROR } client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(j)*1688)) @@ -55972,19 +57577,19 @@ var aCmd6 = [13]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 25965 /* "client_create" */, FxProc: 0}, - {FzName: ts + 25979 /* "client_wait" */, FxProc: 0}, - {FzName: ts + 25991 /* "client_halt" */, FxProc: 0}, - {FzName: ts + 26003 /* "client_argc" */, FxProc: 0}, - {FzName: ts + 26015 /* "client_argv" */, FxProc: 0}, - {FzName: ts + 26027 /* "client_colname" */, FxProc: 0}, - {FzName: ts + 26042 /* "client_result" */, FxProc: 0}, - {FzName: ts + 26056 /* "client_error" */, FxProc: 0}, - {FzName: ts + 26069 /* "client_compile" */, FxProc: 0}, - {FzName: ts + 26084 /* "client_step" */, FxProc: 0}, - {FzName: ts + 26096 /* "client_reset" */, FxProc: 0}, - {FzName: ts + 26109 /* "client_finalize" */, FxProc: 0}, - {FzName: ts + 26125 /* "client_swap" */, FxProc: 0}, + {FzName: ts + 26454 /* "client_create" */, FxProc: 0}, + {FzName: ts + 26468 /* "client_wait" */, FxProc: 0}, + {FzName: ts + 26480 /* "client_halt" */, FxProc: 0}, + {FzName: ts + 26492 /* "client_argc" */, FxProc: 0}, + {FzName: ts + 26504 /* "client_argv" */, FxProc: 0}, + {FzName: ts + 26516 /* "client_colname" */, FxProc: 0}, + {FzName: ts + 26531 /* "client_result" */, FxProc: 0}, + {FzName: ts + 26545 /* "client_error" */, FxProc: 0}, + {FzName: ts + 26558 /* "client_compile" */, FxProc: 0}, + {FzName: ts + 26573 /* "client_step" */, FxProc: 0}, + {FzName: ts + 26585 /* "client_reset" */, FxProc: 0}, + {FzName: ts + 26598 /* "client_finalize" */, FxProc: 0}, + {FzName: ts + 26614 /* "client_swap" */, FxProc: 0}, } /* test7.c:694:5 */ // end block for C++ @@ -56108,10 +57713,10 @@ func simulateVtabError(tls *libc.TLS, p uintptr, zMethod uintptr) int32 { /* tes // var zVarname [128]int8 at bp+24, 128 *(*int8)(unsafe.Pointer(bp + 24 /* &zVarname[0] */ + 127)) = int8(0) - sqlite3.Xsqlite3_snprintf(tls, 127, bp+24 /* &zVarname[0] */, ts+26137 /* "echo_module_fail..." */, libc.VaList(bp, zMethod, (*echo_vtab)(unsafe.Pointer(p)).FzTableName)) + sqlite3.Xsqlite3_snprintf(tls, 127, bp+24 /* &zVarname[0] */, ts+26626 /* "echo_module_fail..." */, libc.VaList(bp, zMethod, (*echo_vtab)(unsafe.Pointer(p)).FzTableName)) zErr = tcl.XTcl_GetVar2(tls, (*echo_vtab)(unsafe.Pointer(p)).Finterp, bp+24 /* &zVarname[0] */, uintptr(0), TCL_GLOBAL_ONLY) if zErr != 0 { - (*echo_vtab)(unsafe.Pointer(p)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+26161 /* "echo-vtab-error:..." */, libc.VaList(bp+16, zErr)) + (*echo_vtab)(unsafe.Pointer(p)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+26650 /* "echo-vtab-error:..." */, libc.VaList(bp+16, zErr)) } return (libc.Bool32(zErr != uintptr(0))) } @@ -56195,7 +57800,7 @@ func getColumnNames(tls *libc.TLS, db uintptr, zTab uintptr, paCol uintptr, pnCo // Prepare the statement "SELECT * FROM ". The column names // of the result set of the compiled SELECT will be the same as // the column names of table . - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26181 /* "SELECT * FROM %Q" */, libc.VaList(bp, zTab)) + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26670 /* "SELECT * FROM %Q" */, libc.VaList(bp, zTab)) if !(!(zSql != 0)) { goto __1 } @@ -56312,7 +57917,7 @@ __1: ; // Compile an sqlite pragma to loop through all indices on table zTab - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26198 /* "PRAGMA index_lis..." */, libc.VaList(bp, zTab)) + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26687 /* "PRAGMA index_lis..." */, libc.VaList(bp, zTab)) if !(!(zSql != 0)) { goto __2 } @@ -56337,7 +57942,7 @@ __3: goto __3 __5: ; - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26220 /* "PRAGMA index_inf..." */, libc.VaList(bp+8, zIdx)) + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26709 /* "PRAGMA index_inf..." */, libc.VaList(bp+8, zIdx)) if !(!(zSql != 0)) { goto __6 } @@ -56399,11 +58004,11 @@ __12: // the string element zArg to that list in interpreter interp. func appendToEchoModule(tls *libc.TLS, interp uintptr, zArg uintptr) { /* test8.c:313:13: */ var flags int32 = ((TCL_APPEND_VALUE | TCL_LIST_ELEMENT) | TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+26242 /* "echo_module" */, uintptr(0), func() uintptr { + tcl.XTcl_SetVar2(tls, interp, ts+26731 /* "echo_module" */, uintptr(0), func() uintptr { if zArg != 0 { return zArg } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), flags) } @@ -56431,7 +58036,7 @@ func echoDeclareVtab(tls *libc.TLS, pVtab uintptr, db uintptr) int32 { /* test8. if (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName != 0 { *(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = uintptr(0) rc = sqlite3.Xsqlite3_prepare(tls, db, - ts+26254, /* "SELECT sql FROM ..." */ + ts+26743, /* "SELECT sql FROM ..." */ -1, bp /* &pStmt */, uintptr(0)) if rc == SQLITE_OK { sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 1, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName, -1, uintptr(0)) @@ -56509,7 +58114,7 @@ func echoConstructor(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv u (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) dequoteString(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName) if ((*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName != 0) && (int32(*(*int8)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName))) == '*') { - var z uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+26318 /* "%s%s" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ((*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName+1))) + var z uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+26807 /* "%s%s" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + 2*8)), ((*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName+1))) sqlite3.Xsqlite3_free(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName) (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName = z (*echo_vtab)(unsafe.Pointer(pVtab)).FisPattern = 1 @@ -56545,7 +58150,7 @@ func echoCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt defer tls.Free(24) var rc int32 = SQLITE_OK - appendToEchoModule(tls, (*EchoModule)(unsafe.Pointer(pAux)).Finterp, ts+26323 /* "xCreate" */) + appendToEchoModule(tls, (*EchoModule)(unsafe.Pointer(pAux)).Finterp, ts+26812 /* "xCreate" */) rc = echoConstructor(tls, db, pAux, argc, argv, ppVtab, pzErr) // If there were two arguments passed to the module at the SQL level @@ -56561,7 +58166,7 @@ func echoCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt var zSql uintptr var pVtab uintptr = *(*uintptr)(unsafe.Pointer(ppVtab)) (*echo_vtab)(unsafe.Pointer(pVtab)).FzLogName = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + 4*8)))) - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26331 /* "CREATE TABLE %Q(..." */, libc.VaList(bp+8, (*echo_vtab)(unsafe.Pointer(pVtab)).FzLogName)) + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26820 /* "CREATE TABLE %Q(..." */, libc.VaList(bp+8, (*echo_vtab)(unsafe.Pointer(pVtab)).FzLogName)) rc = sqlite3.Xsqlite3_exec(tls, db, zSql, uintptr(0), uintptr(0), uintptr(0)) sqlite3.Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { @@ -56583,13 +58188,13 @@ func echoCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt // Echo virtual table module xConnect method. func echoConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test8.c:512:12: */ - appendToEchoModule(tls, (*EchoModule)(unsafe.Pointer(pAux)).Finterp, ts+26355 /* "xConnect" */) + appendToEchoModule(tls, (*EchoModule)(unsafe.Pointer(pAux)).Finterp, ts+26844 /* "xConnect" */) return echoConstructor(tls, db, pAux, argc, argv, ppVtab, pzErr) } // Echo virtual table module xDisconnect method. func echoDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* test8.c:526:12: */ - appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+26364 /* "xDisconnect" */) + appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+26853 /* "xDisconnect" */) return echoDestructor(tls, pVtab) } @@ -56600,12 +58205,12 @@ func echoDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* test8.c:534:12: */ var rc int32 = SQLITE_OK var p uintptr = pVtab - appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+26376 /* "xDestroy" */) + appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+26865 /* "xDestroy" */) // Drop the "log" table, if one exists (see echoCreate() for details) if (p != 0) && ((*echo_vtab)(unsafe.Pointer(p)).FzLogName != 0) { var zSql uintptr - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26385 /* "DROP TABLE %Q" */, libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(p)).FzLogName)) + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26874 /* "DROP TABLE %Q" */, libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(p)).FzLogName)) rc = sqlite3.Xsqlite3_exec(tls, (*echo_vtab)(unsafe.Pointer(p)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) sqlite3.Xsqlite3_free(tls, zSql) } @@ -56619,7 +58224,7 @@ func echoDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* test8.c:534:12: */ // Echo virtual table module xOpen method. func echoOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test8.c:556:12: */ var pCur uintptr - if simulateVtabError(tls, pVTab, ts+26399 /* "xOpen" */) != 0 { + if simulateVtabError(tls, pVTab, ts+26888 /* "xOpen" */) != 0 { return SQLITE_ERROR } pCur = sqlite3.Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(echo_cursor{}))) @@ -56659,7 +58264,7 @@ func echoNext(tls *libc.TLS, cur uintptr) int32 { /* test8.c:590:12: */ var rc int32 = SQLITE_OK var pCur uintptr = cur - if simulateVtabError(tls, (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab, ts+26405 /* "xNext" */) != 0 { + if simulateVtabError(tls, (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab, ts+26894 /* "xNext" */) != 0 { return SQLITE_ERROR } @@ -56681,7 +58286,7 @@ func echoColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* tes var iCol int32 = (i + 1) var pStmt uintptr = (*echo_cursor)(unsafe.Pointer(cur)).FpStmt - if simulateVtabError(tls, (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab, ts+26411 /* "xColumn" */) != 0 { + if simulateVtabError(tls, (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab, ts+26900 /* "xColumn" */) != 0 { return SQLITE_ERROR } @@ -56698,7 +58303,7 @@ func echoColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* tes func echoRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* test8.c:634:12: */ var pStmt uintptr = (*echo_cursor)(unsafe.Pointer(cur)).FpStmt - if simulateVtabError(tls, (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab, ts+2164 /* "xRowid" */) != 0 { + if simulateVtabError(tls, (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab, ts+2165 /* "xRowid" */) != 0 { return SQLITE_ERROR } @@ -56731,14 +58336,14 @@ func echoFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr var pVtab uintptr = (*sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab var db uintptr = (*echo_vtab)(unsafe.Pointer(pVtab)).Fdb - if simulateVtabError(tls, pVtab, ts+26419 /* "xFilter" */) != 0 { + if simulateVtabError(tls, pVtab, ts+26908 /* "xFilter" */) != 0 { return SQLITE_ERROR } // Check that idxNum matches idxStr // Log arguments to the ::echo_module Tcl variable - appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+26419 /* "xFilter" */) + appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+26908 /* "xFilter" */) appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, idxStr) for i = 0; i < argc; i++ { appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) @@ -56788,7 +58393,7 @@ func string_concat(tls *libc.TLS, pzStr uintptr, zAppend uintptr, doFree int32, } else { if zIn != 0 { var zTemp uintptr = zIn - zIn = sqlite3.Xsqlite3_mprintf(tls, ts+26318 /* "%s%s" */, libc.VaList(bp, zIn, zAppend)) + zIn = sqlite3.Xsqlite3_mprintf(tls, ts+26807 /* "%s%s" */, libc.VaList(bp, zIn, zAppend)) sqlite3.Xsqlite3_free(tls, zTemp) } else { zIn = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+16, zAppend)) @@ -56817,7 +58422,7 @@ func echoSelectList(tls *libc.TLS, pTab uintptr, pIdxInfo uintptr) uintptr { /* var zRet uintptr = uintptr(0) if sqlite3.Xsqlite3_libversion_number(tls) < 3010000 { - zRet = sqlite3.Xsqlite3_mprintf(tls, ts+26427 /* ", *" */, 0) + zRet = sqlite3.Xsqlite3_mprintf(tls, ts+26916 /* ", *" */, 0) } else { var i int32 for i = 0; i < (*echo_vtab)(unsafe.Pointer(pTab)).FnCol; i++ { @@ -56827,9 +58432,9 @@ func echoSelectList(tls *libc.TLS, pTab uintptr, pIdxInfo uintptr) uintptr { /* } return i }()))) != 0 { - zRet = sqlite3.Xsqlite3_mprintf(tls, ts+26431 /* "%z, %s" */, libc.VaList(bp, zRet, *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*8)))) + zRet = sqlite3.Xsqlite3_mprintf(tls, ts+26920 /* "%z, %s" */, libc.VaList(bp, zRet, *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*8)))) } else { - zRet = sqlite3.Xsqlite3_mprintf(tls, ts+26438 /* "%z, NULL" */, libc.VaList(bp+16, zRet)) + zRet = sqlite3.Xsqlite3_mprintf(tls, ts+26927 /* "%z, NULL" */, libc.VaList(bp+16, zRet)) } if !(zRet != 0) { break @@ -56868,7 +58473,7 @@ func echoBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test var zCol uintptr = uintptr(0) var zNew uintptr var nArg int32 = 0 - var zSep uintptr = ts + 8660 /* "WHERE" */ + var zSep uintptr = ts + 8840 /* "WHERE" */ var pVtab uintptr = tab *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)) = uintptr(0) var interp uintptr = (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp @@ -56879,11 +58484,11 @@ func echoBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test var useCost int32 = 0 var cost float64 = float64(0) var isIgnoreUsable int32 = 0 - if tcl.XTcl_GetVar2(tls, interp, ts+26447 /* "echo_module_igno..." */, uintptr(0), TCL_GLOBAL_ONLY) != 0 { + if tcl.XTcl_GetVar2(tls, interp, ts+26936 /* "echo_module_igno..." */, uintptr(0), TCL_GLOBAL_ONLY) != 0 { isIgnoreUsable = 1 } - if simulateVtabError(tls, pVtab, ts+26473 /* "xBestIndex" */) != 0 { + if simulateVtabError(tls, pVtab, ts+26962 /* "xBestIndex" */) != 0 { return SQLITE_ERROR } @@ -56891,11 +58496,11 @@ func echoBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test // variable nRow. The 'estimated-cost' of the scan will be the number of // rows in the table for a linear scan, or the log (base 2) of the // number of rows if the proposed scan uses an index. - if tcl.XTcl_GetVar2(tls, interp, ts+26484 /* "echo_module_cost" */, uintptr(0), TCL_GLOBAL_ONLY) != 0 { - cost = libc.Xatof(tls, tcl.XTcl_GetVar2(tls, interp, ts+26484 /* "echo_module_cost" */, uintptr(0), TCL_GLOBAL_ONLY)) + if tcl.XTcl_GetVar2(tls, interp, ts+26973 /* "echo_module_cost" */, uintptr(0), TCL_GLOBAL_ONLY) != 0 { + cost = libc.Xatof(tls, tcl.XTcl_GetVar2(tls, interp, ts+26973 /* "echo_module_cost" */, uintptr(0), TCL_GLOBAL_ONLY)) useCost = 1 } else { - *(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */)) = sqlite3.Xsqlite3_mprintf(tls, ts+26501 /* "SELECT count(*) ..." */, libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) + *(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */)) = sqlite3.Xsqlite3_mprintf(tls, ts+26990 /* "SELECT count(*) ..." */, libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) if !(*(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */)) != 0) { return SQLITE_NOMEM } @@ -56916,7 +58521,7 @@ func echoBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test if !(zCol != 0) { return SQLITE_NOMEM } - *(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */)) = sqlite3.Xsqlite3_mprintf(tls, ts+26525 /* "SELECT rowid%z F..." */, libc.VaList(bp+8, zCol, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) + *(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */)) = sqlite3.Xsqlite3_mprintf(tls, ts+27014 /* "SELECT rowid%z F..." */, libc.VaList(bp+8, zCol, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) if !(*(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */)) != 0) { return SQLITE_NOMEM } @@ -56939,29 +58544,29 @@ func echoBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test if iCol >= 0 { zNewCol = *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pVtab)).FaCol + uintptr(iCol)*8)) } else { - zNewCol = ts + 26548 /* "rowid" */ + zNewCol = ts + 27037 /* "rowid" */ } var zOp uintptr = uintptr(0) useIdx = 1 switch int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) { case SQLITE_INDEX_CONSTRAINT_EQ: - zOp = ts + 26554 /* "=" */ + zOp = ts + 27043 /* "=" */ break fallthrough case SQLITE_INDEX_CONSTRAINT_LT: - zOp = ts + 26556 /* "<" */ + zOp = ts + 27045 /* "<" */ break fallthrough case SQLITE_INDEX_CONSTRAINT_GT: - zOp = ts + 26558 /* ">" */ + zOp = ts + 27047 /* ">" */ break fallthrough case SQLITE_INDEX_CONSTRAINT_LE: - zOp = ts + 26560 /* "<=" */ + zOp = ts + 27049 /* "<=" */ break fallthrough case SQLITE_INDEX_CONSTRAINT_GE: - zOp = ts + 26563 /* ">=" */ + zOp = ts + 27052 /* ">=" */ break fallthrough case SQLITE_INDEX_CONSTRAINT_MATCH: @@ -56971,30 +58576,30 @@ func echoBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test // of code requires the first letter of this operator to be // in upper-case to trigger the special MATCH handling (i.e. // wrapping the bound parameter with literal '%'s). - zOp = ts + 26566 /* "LIKE" */ + zOp = ts + 27055 /* "LIKE" */ break fallthrough case SQLITE_INDEX_CONSTRAINT_LIKE: - zOp = ts + 26571 /* "like" */ + zOp = ts + 27060 /* "like" */ break fallthrough case SQLITE_INDEX_CONSTRAINT_GLOB: - zOp = ts + 26576 /* "glob" */ + zOp = ts + 27065 /* "glob" */ break fallthrough case SQLITE_INDEX_CONSTRAINT_REGEXP: - zOp = ts + 6165 /* "regexp" */ + zOp = ts + 6345 /* "regexp" */ break } if zOp != 0 { if int32(*(*int8)(unsafe.Pointer(zOp))) == 'L' { - zNew = sqlite3.Xsqlite3_mprintf(tls, ts+26581, /* " %s %s LIKE (SEL..." */ + zNew = sqlite3.Xsqlite3_mprintf(tls, ts+27070, /* " %s %s LIKE (SEL..." */ libc.VaList(bp+24, zSep, zNewCol)) } else { - zNew = sqlite3.Xsqlite3_mprintf(tls, ts+26616 /* " %s %s %s ?" */, libc.VaList(bp+40, zSep, zNewCol, zOp)) + zNew = sqlite3.Xsqlite3_mprintf(tls, ts+27105 /* " %s %s %s ?" */, libc.VaList(bp+40, zSep, zNewCol, zOp)) } string_concat(tls, bp+88 /* &zQuery */, zNew, 1, bp+96 /* &rc */) - zSep = ts + 8687 /* "AND" */ + zSep = ts + 8867 /* "AND" */ (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).FargvIndex = libc.PreIncInt32(&nArg, 1) (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).Fomit = uint8(1) } @@ -57010,20 +58615,20 @@ func echoBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test if iCol >= 0 { zNewCol = *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pVtab)).FaCol + uintptr(iCol)*8)) } else { - zNewCol = ts + 26548 /* "rowid" */ + zNewCol = ts + 27037 /* "rowid" */ } var zDir uintptr if (*sqlite3_index_orderby)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy)).Fdesc != 0 { - zDir = ts + 26628 /* "DESC" */ + zDir = ts + 27117 /* "DESC" */ } else { - zDir = ts + 26633 /* "ASC" */ + zDir = ts + 27122 /* "ASC" */ } - zNew = sqlite3.Xsqlite3_mprintf(tls, ts+26637 /* " ORDER BY %s %s" */, libc.VaList(bp+64, zNewCol, zDir)) + zNew = sqlite3.Xsqlite3_mprintf(tls, ts+27126 /* " ORDER BY %s %s" */, libc.VaList(bp+64, zNewCol, zDir)) string_concat(tls, bp+88 /* &zQuery */, zNew, 1, bp+96 /* &rc */) (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = 1 } - appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+26473 /* "xBestIndex" */) + appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+26962 /* "xBestIndex" */) appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, *(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */))) @@ -57077,14 +58682,14 @@ func echoUpdate(tls *libc.TLS, tab uintptr, nData int32, apData uintptr, pRowid // Ticket #3083 - make sure we always start a transaction prior to // making any changes to a virtual table - if simulateVtabError(tls, pVtab, ts+26653 /* "xUpdate" */) != 0 { + if simulateVtabError(tls, pVtab, ts+27142 /* "xUpdate" */) != 0 { return SQLITE_ERROR } // If apData[0] is an integer and nData>1 then do an UPDATE if (nData > 1) && (sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apData))) == SQLITE_INTEGER) { - var zSep uintptr = ts + 26661 /* " SET" */ - *(*uintptr)(unsafe.Pointer(bp + 96 /* z */)) = sqlite3.Xsqlite3_mprintf(tls, ts+26666 /* "UPDATE %Q" */, libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) + var zSep uintptr = ts + 27150 /* " SET" */ + *(*uintptr)(unsafe.Pointer(bp + 96 /* z */)) = sqlite3.Xsqlite3_mprintf(tls, ts+27155 /* "UPDATE %Q" */, libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) if !(*(*uintptr)(unsafe.Pointer(bp + 96 /* z */)) != 0) { *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = SQLITE_NOMEM } @@ -57093,20 +58698,20 @@ func echoUpdate(tls *libc.TLS, tab uintptr, nData int32, apData uintptr, pRowid bindArgZero = 1 if bindArgOne != 0 { - string_concat(tls, bp+96 /* &z */, ts+26676 /* " SET rowid=?1 " */, 0, bp+104 /* &rc */) - zSep = ts + 4449 /* "," */ + string_concat(tls, bp+96 /* &z */, ts+27165 /* " SET rowid=?1 " */, 0, bp+104 /* &rc */) + zSep = ts + 4629 /* "," */ } for i = 2; i < nData; i++ { if *(*uintptr)(unsafe.Pointer(apData + uintptr(i)*8)) == uintptr(0) { continue } string_concat(tls, bp+96 /* &z */, sqlite3.Xsqlite3_mprintf(tls, - ts+26691 /* "%s %Q=?%d" */, libc.VaList(bp+8, zSep, *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pVtab)).FaCol + uintptr((i-2))*8)), i)), 1, bp+104 /* &rc */) - zSep = ts + 4449 /* "," */ + ts+27180 /* "%s %Q=?%d" */, libc.VaList(bp+8, zSep, *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pVtab)).FaCol + uintptr((i-2))*8)), i)), 1, bp+104 /* &rc */) + zSep = ts + 4629 /* "," */ } - string_concat(tls, bp+96 /* &z */, sqlite3.Xsqlite3_mprintf(tls, ts+26701 /* " WHERE rowid=?%d" */, libc.VaList(bp+32, nData)), 1, bp+104 /* &rc */) + string_concat(tls, bp+96 /* &z */, sqlite3.Xsqlite3_mprintf(tls, ts+27190 /* " WHERE rowid=?%d" */, libc.VaList(bp+32, nData)), 1, bp+104 /* &rc */) } else if (nData == 1) && (sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apData))) == SQLITE_INTEGER) { - *(*uintptr)(unsafe.Pointer(bp + 96 /* z */)) = sqlite3.Xsqlite3_mprintf(tls, ts+26718 /* "DELETE FROM %Q W..." */, libc.VaList(bp+40, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) + *(*uintptr)(unsafe.Pointer(bp + 96 /* z */)) = sqlite3.Xsqlite3_mprintf(tls, ts+27207 /* "DELETE FROM %Q W..." */, libc.VaList(bp+40, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) if !(*(*uintptr)(unsafe.Pointer(bp + 96 /* z */)) != 0) { *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = SQLITE_NOMEM } @@ -57116,37 +58721,37 @@ func echoUpdate(tls *libc.TLS, tab uintptr, nData int32, apData uintptr, pRowid *(*uintptr)(unsafe.Pointer(bp + 112 /* zInsert */)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 120 /* zValues */)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 112 /* zInsert */)) = sqlite3.Xsqlite3_mprintf(tls, ts+26750 /* "INSERT INTO %Q (" */, libc.VaList(bp+48, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) + *(*uintptr)(unsafe.Pointer(bp + 112 /* zInsert */)) = sqlite3.Xsqlite3_mprintf(tls, ts+27239 /* "INSERT INTO %Q (" */, libc.VaList(bp+48, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) if !(*(*uintptr)(unsafe.Pointer(bp + 112 /* zInsert */)) != 0) { *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = SQLITE_NOMEM } if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apData + 1*8))) == SQLITE_INTEGER { bindArgOne = 1 - *(*uintptr)(unsafe.Pointer(bp + 120 /* zValues */)) = sqlite3.Xsqlite3_mprintf(tls, ts+3219 /* "?" */, 0) - string_concat(tls, bp+112 /* &zInsert */, ts+26548 /* "rowid" */, 0, bp+104 /* &rc */) + *(*uintptr)(unsafe.Pointer(bp + 120 /* zValues */)) = sqlite3.Xsqlite3_mprintf(tls, ts+3276 /* "?" */, 0) + string_concat(tls, bp+112 /* &zInsert */, ts+27037 /* "rowid" */, 0, bp+104 /* &rc */) } for ii = 2; ii < nData; ii++ { string_concat(tls, bp+112, /* &zInsert */ - sqlite3.Xsqlite3_mprintf(tls, ts+26767 /* "%s%Q" */, libc.VaList(bp+56, func() uintptr { + sqlite3.Xsqlite3_mprintf(tls, ts+27256 /* "%s%Q" */, libc.VaList(bp+56, func() uintptr { if *(*uintptr)(unsafe.Pointer(bp + 120 /* zValues */)) != 0 { - return ts + 89 /* ", " */ + return ts + 90 /* ", " */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pVtab)).FaCol + uintptr((ii-2))*8)))), 1, bp+104 /* &rc */) string_concat(tls, bp+120, /* &zValues */ - sqlite3.Xsqlite3_mprintf(tls, ts+26772 /* "%s?%d" */, libc.VaList(bp+72, func() uintptr { + sqlite3.Xsqlite3_mprintf(tls, ts+27261 /* "%s?%d" */, libc.VaList(bp+72, func() uintptr { if *(*uintptr)(unsafe.Pointer(bp + 120 /* zValues */)) != 0 { - return ts + 89 /* ", " */ + return ts + 90 /* ", " */ } - return ts + 488 /* "" */ + return ts + 489 /* "" */ }(), ii)), 1, bp+104 /* &rc */) } string_concat(tls, bp+96 /* &z */, *(*uintptr)(unsafe.Pointer(bp + 112 /* zInsert */)), 1, bp+104 /* &rc */) - string_concat(tls, bp+96 /* &z */, ts+26778 /* ") VALUES(" */, 0, bp+104 /* &rc */) + string_concat(tls, bp+96 /* &z */, ts+27267 /* ") VALUES(" */, 0, bp+104 /* &rc */) string_concat(tls, bp+96 /* &z */, *(*uintptr)(unsafe.Pointer(bp + 120 /* zValues */)), 1, bp+104 /* &rc */) - string_concat(tls, bp+96 /* &z */, ts+489 /* ")" */, 0, bp+104 /* &rc */) + string_concat(tls, bp+96 /* &z */, ts+490 /* ")" */, 0, bp+104 /* &rc */) } else { return SQLITE_ERROR @@ -57181,7 +58786,7 @@ func echoUpdate(tls *libc.TLS, tab uintptr, nData int32, apData uintptr, pRowid *(*sqlite_int64)(unsafe.Pointer(pRowid)) = sqlite3.Xsqlite3_last_insert_rowid(tls, db) } if *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != SQLITE_OK { - (*sqlite3_vtab)(unsafe.Pointer(tab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+26161 /* "echo-vtab-error:..." */, libc.VaList(bp+88, sqlite3.Xsqlite3_errmsg(tls, db))) + (*sqlite3_vtab)(unsafe.Pointer(tab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+26650 /* "echo-vtab-error:..." */, libc.VaList(bp+88, sqlite3.Xsqlite3_errmsg(tls, db))) } return *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) @@ -57196,7 +58801,7 @@ func echoTransactionCall(tls *libc.TLS, tab uintptr, zCall uintptr) int32 { /* t var z uintptr var pVtab uintptr = tab - z = sqlite3.Xsqlite3_mprintf(tls, ts+26788 /* "echo(%s)" */, libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) + z = sqlite3.Xsqlite3_mprintf(tls, ts+27277 /* "echo(%s)" */, libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) if z == uintptr(0) { return SQLITE_NOMEM } @@ -57215,17 +58820,17 @@ func echoBegin(tls *libc.TLS, tab uintptr) int32 { /* test8.c:1111:12: */ // Ticket #3083 - do not start a transaction if we are already in // a transaction - if simulateVtabError(tls, pVtab, ts+26797 /* "xBegin" */) != 0 { + if simulateVtabError(tls, pVtab, ts+27286 /* "xBegin" */) != 0 { return SQLITE_ERROR } - rc = echoTransactionCall(tls, tab, ts+26797 /* "xBegin" */) + rc = echoTransactionCall(tls, tab, ts+27286 /* "xBegin" */) if rc == SQLITE_OK { // Check if the $::echo_module_begin_fail variable is defined. If it is, // and it is set to the name of the real table underlying this virtual // echo module table, then cause this xSync operation to fail. - zVal = tcl.XTcl_GetVar2(tls, interp, ts+26804 /* "echo_module_begi..." */, uintptr(0), TCL_GLOBAL_ONLY) + zVal = tcl.XTcl_GetVar2(tls, interp, ts+27293 /* "echo_module_begi..." */, uintptr(0), TCL_GLOBAL_ONLY) if (zVal != 0) && (0 == libc.Xstrcmp(tls, zVal, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) { rc = SQLITE_ERROR } @@ -57245,17 +58850,17 @@ func echoSync(tls *libc.TLS, tab uintptr) int32 { /* test8.c:1142:12: */ // Ticket #3083 - Only call xSync if we have previously started a // transaction - if simulateVtabError(tls, pVtab, ts+26827 /* "xSync" */) != 0 { + if simulateVtabError(tls, pVtab, ts+27316 /* "xSync" */) != 0 { return SQLITE_ERROR } - rc = echoTransactionCall(tls, tab, ts+26827 /* "xSync" */) + rc = echoTransactionCall(tls, tab, ts+27316 /* "xSync" */) if rc == SQLITE_OK { // Check if the $::echo_module_sync_fail variable is defined. If it is, // and it is set to the name of the real table underlying this virtual // echo module table, then cause this xSync operation to fail. - zVal = tcl.XTcl_GetVar2(tls, interp, ts+26833 /* "echo_module_sync..." */, uintptr(0), TCL_GLOBAL_ONLY) + zVal = tcl.XTcl_GetVar2(tls, interp, ts+27322 /* "echo_module_sync..." */, uintptr(0), TCL_GLOBAL_ONLY) if (zVal != 0) && (0 == libc.Xstrcmp(tls, zVal, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) { rc = -1 } @@ -57270,12 +58875,12 @@ func echoCommit(tls *libc.TLS, tab uintptr) int32 { /* test8.c:1170:12: */ // Ticket #3083 - Only call xCommit if we have previously started // a transaction - if simulateVtabError(tls, pVtab, ts+26855 /* "xCommit" */) != 0 { + if simulateVtabError(tls, pVtab, ts+27344 /* "xCommit" */) != 0 { return SQLITE_ERROR } sqlite3.Xsqlite3BeginBenignMalloc(tls) - rc = echoTransactionCall(tls, tab, ts+26855 /* "xCommit" */) + rc = echoTransactionCall(tls, tab, ts+27344 /* "xCommit" */) sqlite3.Xsqlite3EndBenignMalloc(tls) (*echo_vtab)(unsafe.Pointer(pVtab)).FinTransaction = 0 return rc @@ -57288,7 +58893,7 @@ func echoRollback(tls *libc.TLS, tab uintptr) int32 { /* test8.c:1188:12: */ // Ticket #3083 - Only call xRollback if we have previously started // a transaction - rc = echoTransactionCall(tls, tab, ts+26863 /* "xRollback" */) + rc = echoTransactionCall(tls, tab, ts+27352 /* "xRollback" */) (*echo_vtab)(unsafe.Pointer(pVtab)).FinTransaction = 0 return rc } @@ -57306,7 +58911,7 @@ func overloadedGlobFunction(tls *libc.TLS, pContext uintptr, nArg int32, apArg u var i int32 var rc int32 tcl.XTcl_DStringInit(tls, bp /* &str */) - tcl.XTcl_DStringAppendElement(tls, bp /* &str */, ts+26873 /* "::echo_glob_over..." */) + tcl.XTcl_DStringAppendElement(tls, bp /* &str */, ts+27362 /* "::echo_glob_over..." */) for i = 0; i < nArg; i++ { tcl.XTcl_DStringAppendElement(tls, bp /* &str */, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(i)*8)))) } @@ -57335,10 +58940,10 @@ func echoFindFunction(tls *libc.TLS, vtab uintptr, nArg int32, zFuncName uintptr var interp uintptr = (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp // var info Tcl_CmdInfo at bp, 64 - if libc.Xstrcmp(tls, zFuncName, ts+26576 /* "glob" */) != 0 { + if libc.Xstrcmp(tls, zFuncName, ts+27065 /* "glob" */) != 0 { return 0 } - if tcl.XTcl_GetCommandInfo(tls, interp, ts+26873 /* "::echo_glob_over..." */, bp /* &info */) == 0 { + if tcl.XTcl_GetCommandInfo(tls, interp, ts+27362 /* "::echo_glob_over..." */, bp /* &info */) == 0 { return 0 } *(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct { @@ -57355,13 +58960,13 @@ func echoRename(tls *libc.TLS, vtab uintptr, zNewName uintptr) int32 { /* test8. var rc int32 = SQLITE_OK var p uintptr = vtab - if simulateVtabError(tls, p, ts+26894 /* "xRename" */) != 0 { + if simulateVtabError(tls, p, ts+27383 /* "xRename" */) != 0 { return SQLITE_ERROR } if (*echo_vtab)(unsafe.Pointer(p)).FisPattern != 0 { var nThis int32 = int32(libc.Xstrlen(tls, (*echo_vtab)(unsafe.Pointer(p)).FzThis)) - var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+26902, /* "ALTER TABLE %s R..." */ + var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+27391, /* "ALTER TABLE %s R..." */ libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(p)).FzTableName, zNewName, ((*echo_vtab)(unsafe.Pointer(p)).FzTableName+uintptr(nThis)))) rc = sqlite3.Xsqlite3_exec(tls, (*echo_vtab)(unsafe.Pointer(p)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) sqlite3.Xsqlite3_free(tls, zSql) @@ -57450,7 +59055,7 @@ func register_echo_module(tls *libc.TLS, clientData ClientData, interp uintptr, var pMod uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { @@ -57461,13 +59066,13 @@ func register_echo_module(tls *libc.TLS, clientData ClientData, interp uintptr, pMod = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(EchoModule{}))) (*EchoModule)(unsafe.Pointer(pMod)).Finterp = interp rc = sqlite3.Xsqlite3_create_module_v2(tls, - *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+26932 /* "echo" */, uintptr(unsafe.Pointer(&echoModule)), pMod, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{moduleDestroy}))) + *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+27421 /* "echo" */, uintptr(unsafe.Pointer(&echoModule)), pMod, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{moduleDestroy}))) // Virtual table module "echo_v2" if rc == SQLITE_OK { pMod = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(EchoModule{}))) (*EchoModule)(unsafe.Pointer(pMod)).Finterp = interp - rc = sqlite3.Xsqlite3_create_module_v2(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+26937, /* "echo_v2" */ + rc = sqlite3.Xsqlite3_create_module_v2(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+27426, /* "echo_v2" */ uintptr(unsafe.Pointer(&echoModuleV2)), pMod, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{moduleDestroy}))) } @@ -57486,7 +59091,7 @@ func declare_vtab(tls *libc.TLS, clientData ClientData, interp uintptr, objc int var rc int32 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+26945 /* "DB SQL" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27434 /* "DB SQL" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { @@ -57519,8 +59124,8 @@ var aObjCmd2 = [2]struct { FxProc uintptr FclientData uintptr }{ - {FzName: ts + 26952 /* "register_echo_mo..." */, FxProc: 0}, - {FzName: ts + 26973 /* "sqlite3_declare_..." */, FxProc: 0}, + {FzName: ts + 27441 /* "register_echo_mo..." */, FxProc: 0}, + {FzName: ts + 27462 /* "sqlite3_declare_..." */, FxProc: 0}, } /* test8.c:1433:5 */ // end block for C++ @@ -57577,31 +59182,31 @@ func c_collation_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc // var db uintptr at bp+24, 8 var rc int32 - zErrFunction = ts + 26994 /* "N/A" */ + zErrFunction = ts + 27483 /* "N/A" */ if !(objc != 1) { goto __1 } - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR __1: ; // Open a database. - rc = sqlite3.Xsqlite3_open(tls, ts+1661 /* ":memory:" */, bp+24 /* &db */) + rc = sqlite3.Xsqlite3_open(tls, ts+1662 /* ":memory:" */, bp+24 /* &db */) if !(rc != SQLITE_OK) { goto __2 } - zErrFunction = ts + 20572 /* "sqlite3_open" */ + zErrFunction = ts + 20981 /* "sqlite3_open" */ goto error_out __2: ; - rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* db */)), ts+12916 /* "collate" */, 456, uintptr(0), uintptr(0)) + rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* db */)), ts+13096 /* "collate" */, 456, uintptr(0), uintptr(0)) if !(rc != SQLITE_MISUSE) { goto __3 } sqlite3.Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* db */))) - zErrFunction = ts + 26998 /* "sqlite3_create_c..." */ + zErrFunction = ts + 27487 /* "sqlite3_create_c..." */ goto error_out __3: ; @@ -57611,7 +59216,7 @@ __3: error_out: tcl.XTcl_ResetResult(tls, interp) - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27023 /* "Error testing fu..." */, zErrFunction, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27512 /* "Error testing fu..." */, zErrFunction, 0)) return TCL_ERROR } @@ -57622,12 +59227,12 @@ func c_realloc_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc i var p uintptr var zErrFunction uintptr - zErrFunction = ts + 26994 /* "N/A" */ + zErrFunction = ts + 27483 /* "N/A" */ if !(objc != 1) { goto __1 } - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR __1: ; @@ -57636,7 +59241,7 @@ __1: if !(!(p != 0)) { goto __2 } - zErrFunction = ts + 27048 /* "sqlite3_malloc" */ + zErrFunction = ts + 27537 /* "sqlite3_malloc" */ goto error_out __2: ; @@ -57647,7 +59252,7 @@ __2: if !(p != 0) { goto __3 } - zErrFunction = ts + 27063 /* "sqlite3_realloc" */ + zErrFunction = ts + 27552 /* "sqlite3_realloc" */ goto error_out __3: ; @@ -57656,7 +59261,7 @@ __3: error_out: tcl.XTcl_ResetResult(tls, interp) - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27023 /* "Error testing fu..." */, zErrFunction, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27512 /* "Error testing fu..." */, zErrFunction, 0)) return TCL_ERROR } @@ -57671,24 +59276,24 @@ func c_misuse_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc in // var pStmt uintptr at bp+32, 8 var rc int32 - zErrFunction = ts + 26994 /* "N/A" */ + zErrFunction = ts + 27483 /* "N/A" */ *(*uintptr)(unsafe.Pointer(bp + 24 /* db */)) = uintptr(0) if !(objc != 1) { goto __1 } - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR __1: ; // Open a database. Then close it again. We need to do this so that // we have a "closed database handle" to pass to various API functions. - rc = sqlite3.Xsqlite3_open(tls, ts+1661 /* ":memory:" */, bp+24 /* &db */) + rc = sqlite3.Xsqlite3_open(tls, ts+1662 /* ":memory:" */, bp+24 /* &db */) if !(rc != SQLITE_OK) { goto __2 } - zErrFunction = ts + 20572 /* "sqlite3_open" */ + zErrFunction = ts + 20981 /* "sqlite3_open" */ goto error_out __2: ; @@ -57698,7 +59303,7 @@ __2: if !(rc != SQLITE_MISUSE) { goto __3 } - zErrFunction = ts + 20499 /* "sqlite3_errcode" */ + zErrFunction = ts + 20908 /* "sqlite3_errcode" */ goto error_out __3: ; @@ -57708,7 +59313,7 @@ __3: if !(rc != SQLITE_MISUSE) { goto __4 } - zErrFunction = ts + 20653 /* "sqlite3_prepare" */ + zErrFunction = ts + 21062 /* "sqlite3_prepare" */ goto error_out __4: ; @@ -57719,7 +59324,7 @@ __4: if !(rc != SQLITE_MISUSE) { goto __5 } - zErrFunction = ts + 20687 /* "sqlite3_prepare_..." */ + zErrFunction = ts + 21096 /* "sqlite3_prepare_..." */ goto error_out __5: ; @@ -57729,7 +59334,7 @@ __5: if !(rc != SQLITE_MISUSE) { goto __6 } - zErrFunction = ts + 20669 /* "sqlite3_prepare1..." */ + zErrFunction = ts + 21078 /* "sqlite3_prepare1..." */ goto error_out __6: ; @@ -57739,7 +59344,7 @@ __6: if !(rc != SQLITE_MISUSE) { goto __7 } - zErrFunction = ts + 20749 /* "sqlite3_prepare1..." */ + zErrFunction = ts + 21158 /* "sqlite3_prepare1..." */ goto error_out __7: ; @@ -57748,7 +59353,7 @@ __7: error_out: tcl.XTcl_ResetResult(tls, interp) - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27023 /* "Error testing fu..." */, zErrFunction, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27512 /* "Error testing fu..." */, zErrFunction, 0)) return TCL_ERROR } @@ -57771,9 +59376,9 @@ var aObjCmd3 = [3]struct { FxProc uintptr FclientData uintptr }{ - {FzName: ts + 27079 /* "c_misuse_test" */, FxProc: 0}, - {FzName: ts + 27093 /* "c_realloc_test" */, FxProc: 0}, - {FzName: ts + 27108 /* "c_collation_test" */, FxProc: 0}, + {FzName: ts + 27568 /* "c_misuse_test" */, FxProc: 0}, + {FzName: ts + 27582 /* "c_realloc_test" */, FxProc: 0}, + {FzName: ts + 27597 /* "c_collation_test" */, FxProc: 0}, } /* test9.c:193:5 */ // end block for C++ @@ -57814,7 +59419,7 @@ func resetAutoExtObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc // This procedure registers the TCL procs defined in this file. func Sqlitetest_autoext_Init(tls *libc.TLS, interp uintptr) int32 { /* test_autoext.c:210:5: */ - tcl.XTcl_CreateObjCommand(tls, interp, ts+27125, /* "sqlite3_reset_au..." */ + tcl.XTcl_CreateObjCommand(tls, interp, ts+27614, /* "sqlite3_reset_au..." */ *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{resetAutoExtObjCmd})), uintptr(0), uintptr(0)) @@ -57826,10 +59431,10 @@ func backupTestCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc in defer tls.Free(196) *(*[5]BackupSubCommand)(unsafe.Pointer(bp /* aSub */)) = [5]BackupSubCommand{ - {FzCmd: ts + 9942 /* "step" */, FnArg: 1, FzArg: ts + 27154 /* "npage" */}, - {FzCmd: ts + 27160 /* "finish" */, FeCmd: uint32(1) /* BACKUP_FINISH */, FzArg: ts + 488 /* "" */}, - {FzCmd: ts + 27167 /* "remaining" */, FeCmd: uint32(2) /* BACKUP_REMAINING */, FzArg: ts + 488 /* "" */}, - {FzCmd: ts + 27177 /* "pagecount" */, FeCmd: uint32(3) /* BACKUP_PAGECOUNT */, FzArg: ts + 488 /* "" */}, + {FzCmd: ts + 10122 /* "step" */, FnArg: 1, FzArg: ts + 27643 /* "npage" */}, + {FzCmd: ts + 27649 /* "finish" */, FeCmd: uint32(1) /* BACKUP_FINISH */, FzArg: ts + 489 /* "" */}, + {FzCmd: ts + 27656 /* "remaining" */, FeCmd: uint32(2) /* BACKUP_REMAINING */, FzArg: ts + 489 /* "" */}, + {FzCmd: ts + 27666 /* "pagecount" */, FeCmd: uint32(3) /* BACKUP_PAGECOUNT */, FzArg: ts + 489 /* "" */}, {}, } @@ -57839,7 +59444,7 @@ func backupTestCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc in var rc int32 rc = tcl.XTcl_GetIndexFromObjStruct(tls, - interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &aSub[0] */, int32(unsafe.Sizeof(BackupSubCommand{})), ts+11195 /* "option" */, 0, bp+120 /* &iCmd */) + interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &aSub[0] */, int32(unsafe.Sizeof(BackupSubCommand{})), ts+11375 /* "option" */, 0, bp+120 /* &iCmd */) if rc != TCL_OK { return rc } @@ -57921,7 +59526,7 @@ func backupTestInit(tls *libc.TLS, clientData ClientData, interp uintptr, objc i if objc != 6 { tcl.XTcl_WrongNumArgs(tls, - interp, 1, objv, ts+27187 /* "CMDNAME DESTHAND..." */) + interp, 1, objv, ts+27676 /* "CMDNAME DESTHAND..." */) return TCL_ERROR } @@ -57933,7 +59538,7 @@ func backupTestInit(tls *libc.TLS, clientData ClientData, interp uintptr, objc i pBackup = sqlite3.Xsqlite3_backup_init(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pDestDb */)), zDestName, *(*uintptr)(unsafe.Pointer(bp + 24 /* pSrcDb */)), zSrcName) if !(pBackup != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27233 /* "sqlite3_backup_i..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27722 /* "sqlite3_backup_i..." */, 0)) return TCL_ERROR } @@ -57945,7 +59550,7 @@ func backupTestInit(tls *libc.TLS, clientData ClientData, interp uintptr, objc i } func Sqlitetestbackup_Init(tls *libc.TLS, interp uintptr) int32 { /* test_backup.c:154:5: */ - tcl.XTcl_CreateObjCommand(tls, interp, ts+27262 /* "sqlite3_backup" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+27751 /* "sqlite3_backup" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32 }{backupTestInit})), uintptr(0), uintptr(0)) return TCL_OK @@ -58036,7 +59641,7 @@ func tclConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt var rc int32 = SQLITE_OK if argc != 4 { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+27277 /* "wrong number of ..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+27766 /* "wrong number of ..." */, 0) return SQLITE_ERROR } @@ -58054,7 +59659,7 @@ func tclConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt pScript = tcl.XTcl_DuplicateObj(tls, (*tcl_vtab)(unsafe.Pointer(pTab)).FpCmd) (*Tcl_Obj)(unsafe.Pointer(pScript)).FrefCount++ - tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+26355 /* "xConnect" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+26844 /* "xConnect" */, -1)) rc = tcl.XTcl_EvalObjEx(tls, interp, pScript, TCL_EVAL_GLOBAL) if rc != TCL_OK { @@ -58147,12 +59752,12 @@ func tclFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, pScript = tcl.XTcl_DuplicateObj(tls, (*tcl_vtab)(unsafe.Pointer(pTab)).FpCmd) (*Tcl_Obj)(unsafe.Pointer(pScript)).FrefCount++ - tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+26419 /* "xFilter" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+26908 /* "xFilter" */, -1)) tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewIntObj(tls, idxNum)) if idxStr != 0 { tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, idxStr, -1)) } else { - tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+488 /* "" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+489 /* "" */, -1)) } pArg = tcl.XTcl_NewObj(tls) @@ -58199,16 +59804,16 @@ func tclFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, for ii = 0; (rc == SQLITE_OK) && (ii < *(*int32)(unsafe.Pointer(bp + 32 /* nElem */))); ii = ii + (2) { var zCmd uintptr = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 /* apElem */)) + uintptr(ii)*8))) var p uintptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 /* apElem */)) + uintptr((ii+1))*8)) - if sqlite3.Xsqlite3_stricmp(tls, ts+1807 /* "sql" */, zCmd) == 0 { + if sqlite3.Xsqlite3_stricmp(tls, ts+1808 /* "sql" */, zCmd) == 0 { var zSql uintptr = tcl.XTcl_GetString(tls, p) rc = sqlite3.Xsqlite3_prepare_v2(tls, (*tcl_vtab)(unsafe.Pointer(pTab)).Fdb, zSql, -1, (pCsr + 8 /* &.pStmt */), uintptr(0)) if rc != SQLITE_OK { var zErr uintptr = sqlite3.Xsqlite3_errmsg(tls, (*tcl_vtab)(unsafe.Pointer(pTab)).Fdb) - (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+27303 /* "unexpected: %s" */, libc.VaList(bp+16, zErr)) + (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+27792 /* "unexpected: %s" */, libc.VaList(bp+16, zErr)) } } else { rc = SQLITE_ERROR - (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+27303 /* "unexpected: %s" */, libc.VaList(bp+24, zCmd)) + (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+27792 /* "unexpected: %s" */, libc.VaList(bp+24, zCmd)) } } } @@ -58250,67 +59855,67 @@ func tclBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_ pScript = tcl.XTcl_DuplicateObj(tls, (*tcl_vtab)(unsafe.Pointer(pTab)).FpCmd) (*Tcl_Obj)(unsafe.Pointer(pScript)).FrefCount++ - tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+26473 /* "xBestIndex" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+26962 /* "xBestIndex" */, -1)) pArg = tcl.XTcl_NewObj(tls) (*Tcl_Obj)(unsafe.Pointer(pArg)).FrefCount++ for ii = 0; ii < (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint; ii++ { var pCons uintptr = ((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(ii)*12) var pElem uintptr = tcl.XTcl_NewObj(tls) - var zOp uintptr = ts + 3219 /* "?" */ + var zOp uintptr = ts + 3276 /* "?" */ (*Tcl_Obj)(unsafe.Pointer(pElem)).FrefCount++ switch int32((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).Fop) { case SQLITE_INDEX_CONSTRAINT_EQ: - zOp = ts + 27318 /* "eq" */ + zOp = ts + 27807 /* "eq" */ break case SQLITE_INDEX_CONSTRAINT_GT: - zOp = ts + 27321 /* "gt" */ + zOp = ts + 27810 /* "gt" */ break case SQLITE_INDEX_CONSTRAINT_LE: - zOp = ts + 27324 /* "le" */ + zOp = ts + 27813 /* "le" */ break case SQLITE_INDEX_CONSTRAINT_LT: - zOp = ts + 27327 /* "lt" */ + zOp = ts + 27816 /* "lt" */ break case SQLITE_INDEX_CONSTRAINT_GE: - zOp = ts + 27330 /* "ge" */ + zOp = ts + 27819 /* "ge" */ break case SQLITE_INDEX_CONSTRAINT_MATCH: - zOp = ts + 27333 /* "match" */ + zOp = ts + 27822 /* "match" */ break case SQLITE_INDEX_CONSTRAINT_LIKE: - zOp = ts + 26571 /* "like" */ + zOp = ts + 27060 /* "like" */ break case SQLITE_INDEX_CONSTRAINT_GLOB: - zOp = ts + 26576 /* "glob" */ + zOp = ts + 27065 /* "glob" */ break case SQLITE_INDEX_CONSTRAINT_REGEXP: - zOp = ts + 6165 /* "regexp" */ + zOp = ts + 6345 /* "regexp" */ break case SQLITE_INDEX_CONSTRAINT_NE: - zOp = ts + 27339 /* "ne" */ + zOp = ts + 27828 /* "ne" */ break case SQLITE_INDEX_CONSTRAINT_ISNOT: - zOp = ts + 27342 /* "isnot" */ + zOp = ts + 27831 /* "isnot" */ break case SQLITE_INDEX_CONSTRAINT_ISNOTNULL: - zOp = ts + 27348 /* "isnotnull" */ + zOp = ts + 27837 /* "isnotnull" */ break case SQLITE_INDEX_CONSTRAINT_ISNULL: - zOp = ts + 27358 /* "isnull" */ + zOp = ts + 27847 /* "isnull" */ break case SQLITE_INDEX_CONSTRAINT_IS: - zOp = ts + 5542 /* "is" */ + zOp = ts + 5722 /* "is" */ break } - tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27365 /* "op" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27854 /* "op" */, -1)) tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, zOp, -1)) - tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27368 /* "column" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27857 /* "column" */, -1)) tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewIntObj(tls, (*sqlite3_index_constraint)(unsafe.Pointer(pCons)).FiColumn)) - tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27375 /* "usable" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27864 /* "usable" */, -1)) tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewIntObj(tls, int32((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).Fusable))) tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pArg, pElem) @@ -58337,9 +59942,9 @@ func tclBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_ var pElem uintptr = tcl.XTcl_NewObj(tls) (*Tcl_Obj)(unsafe.Pointer(pElem)).FrefCount++ - tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27368 /* "column" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27857 /* "column" */, -1)) tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewIntObj(tls, (*sqlite3_index_orderby)(unsafe.Pointer(pOrder)).FiColumn)) - tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27382 /* "desc" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27871 /* "desc" */, -1)) tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewIntObj(tls, int32((*sqlite3_index_orderby)(unsafe.Pointer(pOrder)).Fdesc))) tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pArg, pElem) @@ -58398,29 +60003,29 @@ func tclBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_ for ii = 0; (rc == SQLITE_OK) && (ii < *(*int32)(unsafe.Pointer(bp + 48 /* nElem */))); ii = ii + (2) { var zCmd uintptr = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* apElem */)) + uintptr(ii)*8))) var p uintptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* apElem */)) + uintptr((ii+1))*8)) - if sqlite3.Xsqlite3_stricmp(tls, ts+27387 /* "cost" */, zCmd) == 0 { + if sqlite3.Xsqlite3_stricmp(tls, ts+27876 /* "cost" */, zCmd) == 0 { rc = tcl.XTcl_GetDoubleFromObj(tls, interp, p, (pIdxInfo + 64 /* &.estimatedCost */)) - } else if sqlite3.Xsqlite3_stricmp(tls, ts+27392 /* "orderby" */, zCmd) == 0 { + } else if sqlite3.Xsqlite3_stricmp(tls, ts+27881 /* "orderby" */, zCmd) == 0 { rc = tcl.XTcl_GetIntFromObj(tls, interp, p, (pIdxInfo + 60 /* &.orderByConsumed */)) - } else if sqlite3.Xsqlite3_stricmp(tls, ts+27400 /* "idxnum" */, zCmd) == 0 { + } else if sqlite3.Xsqlite3_stricmp(tls, ts+27889 /* "idxnum" */, zCmd) == 0 { rc = tcl.XTcl_GetIntFromObj(tls, interp, p, (pIdxInfo + 40 /* &.idxNum */)) - } else if sqlite3.Xsqlite3_stricmp(tls, ts+27407 /* "idxstr" */, zCmd) == 0 { + } else if sqlite3.Xsqlite3_stricmp(tls, ts+27896 /* "idxstr" */, zCmd) == 0 { sqlite3.Xsqlite3_free(tls, (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr) (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+16, tcl.XTcl_GetString(tls, p))) (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr = 1 - } else if sqlite3.Xsqlite3_stricmp(tls, ts+27414 /* "rows" */, zCmd) == 0 { + } else if sqlite3.Xsqlite3_stricmp(tls, ts+27903 /* "rows" */, zCmd) == 0 { *(*Tcl_WideInt)(unsafe.Pointer(bp + 64 /* x */)) = int64(0) rc = tcl.XTcl_GetWideIntFromObj(tls, interp, p, bp+64 /* &x */) (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = sqlite3_int64(tRowcnt(*(*Tcl_WideInt)(unsafe.Pointer(bp + 64 /* x */)))) - } else if (sqlite3.Xsqlite3_stricmp(tls, ts+27419 /* "use" */, zCmd) == 0) || - (sqlite3.Xsqlite3_stricmp(tls, ts+27423 /* "omit" */, zCmd) == 0) { + } else if (sqlite3.Xsqlite3_stricmp(tls, ts+27908 /* "use" */, zCmd) == 0) || + (sqlite3.Xsqlite3_stricmp(tls, ts+27912 /* "omit" */, zCmd) == 0) { // var iCons int32 at bp+72, 4 rc = tcl.XTcl_GetIntFromObj(tls, interp, p, bp+72 /* &iCons */) if rc == SQLITE_OK { if (*(*int32)(unsafe.Pointer(bp + 72 /* iCons */)) < 0) || (*(*int32)(unsafe.Pointer(bp + 72 /* iCons */)) >= (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) { rc = SQLITE_ERROR - (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+27428 /* "unexpected: %d" */, libc.VaList(bp+24, *(*int32)(unsafe.Pointer(bp + 72 /* iCons */)))) + (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+27917 /* "unexpected: %d" */, libc.VaList(bp+24, *(*int32)(unsafe.Pointer(bp + 72 /* iCons */)))) } else { var bOmit int32 = (libc.Bool32((int32(*(*int8)(unsafe.Pointer(zCmd))) == 'o') || (int32(*(*int8)(unsafe.Pointer(zCmd))) == 'O'))) (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(*(*int32)(unsafe.Pointer(bp + 72 /* iCons */)))*8)).FargvIndex = libc.PostIncInt32(&iArgv, 1) @@ -58429,7 +60034,7 @@ func tclBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_ } } else { rc = SQLITE_ERROR - (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+27303 /* "unexpected: %s" */, libc.VaList(bp+32, zCmd)) + (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+27792 /* "unexpected: %s" */, libc.VaList(bp+32, zCmd)) } if (rc != SQLITE_OK) && ((*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg == uintptr(0)) { var zErr uintptr = tcl.XTcl_GetStringResult(tls, interp) @@ -58467,13 +60072,13 @@ func register_tcl_module(tls *libc.TLS, clientData ClientData, interp uintptr, o // var db uintptr at bp, 8 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { return TCL_ERROR } - sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+27443 /* "tcl" */, uintptr(unsafe.Pointer(&tclModule)), interp) + sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+27932 /* "tcl" */, uintptr(unsafe.Pointer(&tclModule)), interp) return TCL_OK } @@ -58496,7 +60101,7 @@ var aObjCmd4 = [1]struct { FxProc uintptr FclientData uintptr }{ - {FzName: ts + 27447 /* "register_tcl_mod..." */, FxProc: 0}, + {FzName: ts + 27936 /* "register_tcl_mod..." */, FxProc: 0}, } /* test_bestindex.c:610:5 */ // Return a pointer to a buffer containing a text representation of the @@ -58506,7 +60111,7 @@ func ptrToText(tls *libc.TLS, p uintptr) uintptr { /* test_blob.c:37:13: */ bp := tls.Alloc(8) defer tls.Free(8) - sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof(buf)) - uint64(1))), uintptr(unsafe.Pointer(&buf)), ts+12843 /* "%p" */, libc.VaList(bp, p)) + sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof(buf)) - uint64(1))), uintptr(unsafe.Pointer(&buf)), ts+13023 /* "%p" */, libc.VaList(bp, p)) return uintptr(unsafe.Pointer(&buf)) } @@ -58532,7 +60137,7 @@ func blobHandleFromObj1(tls *libc.TLS, interp uintptr, pObj uintptr, ppBlob uint z = tcl.XTcl_GetStringFromObj(tls, pObj, bp /* &n */) if *(*int32)(unsafe.Pointer(bp /* n */)) == 0 { *(*uintptr)(unsafe.Pointer(ppBlob)) = uintptr(0) - } else if (*(*int32)(unsafe.Pointer(bp /* n */)) > 9) && (0 == libc.Xmemcmp(tls, ts+27467 /* "incrblob_" */, z, uint64(9))) { + } else if (*(*int32)(unsafe.Pointer(bp /* n */)) > 9) && (0 == libc.Xmemcmp(tls, ts+27956 /* "incrblob_" */, z, uint64(9))) { // var notUsed int32 at bp+4, 4 var channel Tcl_Channel @@ -58596,7 +60201,7 @@ func test_blob_open(tls *libc.TLS, clientData ClientData, interp uintptr, objc i var rc int32 if objc != 8 { - var zUsage uintptr = ts + 27477 /* "DB DATABASE TABL..." */ + var zUsage uintptr = ts + 27966 /* "DB DATABASE TABL..." */ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, zUsage) return TCL_ERROR } @@ -58640,7 +60245,7 @@ func test_blob_close(tls *libc.TLS, clientData ClientData, interp uintptr, objc var rc int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+28011 /* "HANDLE" */) return TCL_ERROR } @@ -58667,7 +60272,7 @@ func test_blob_bytes(tls *libc.TLS, clientData ClientData, interp uintptr, objc var nByte int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+28011 /* "HANDLE" */) return TCL_ERROR } @@ -58707,7 +60312,7 @@ func test_blob_read(tls *libc.TLS, clientData ClientData, interp uintptr, objc i var rc int32 if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27529 /* "CHANNEL OFFSET N" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+28018 /* "CHANNEL OFFSET N" */) return TCL_ERROR } @@ -58722,7 +60327,7 @@ func test_blob_read(tls *libc.TLS, clientData ClientData, interp uintptr, objc i if *(*int32)(unsafe.Pointer(bp + 28 /* nByte */)) > 0 { zBuf = tcl.XTcl_AttemptAlloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 28 /* nByte */)))) if zBuf == uintptr(0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27546 /* "out of memory in..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+28035 /* "out of memory in..." */, 0)) return TCL_ERROR } } @@ -58767,7 +60372,7 @@ func test_blob_write(tls *libc.TLS, clientData ClientData, interp uintptr, objc // var nBuf int32 at bp+12, 4 if (objc != 4) && (objc != 5) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27607 /* "HANDLE OFFSET DA..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+28096 /* "HANDLE OFFSET DA..." */) return TCL_ERROR } @@ -58811,11 +60416,11 @@ var aObjCmd5 = [5]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 27634 /* "sqlite3_blob_ope..." */, FxProc: 0}, - {FzName: ts + 27652 /* "sqlite3_blob_clo..." */, FxProc: 0}, - {FzName: ts + 27671 /* "sqlite3_blob_byt..." */, FxProc: 0}, - {FzName: ts + 27690 /* "sqlite3_blob_rea..." */, FxProc: 0}, - {FzName: ts + 27708 /* "sqlite3_blob_wri..." */, FxProc: 0}, + {FzName: ts + 28123 /* "sqlite3_blob_ope..." */, FxProc: 0}, + {FzName: ts + 28141 /* "sqlite3_blob_clo..." */, FxProc: 0}, + {FzName: ts + 28160 /* "sqlite3_blob_byt..." */, FxProc: 0}, + {FzName: ts + 28179 /* "sqlite3_blob_rea..." */, FxProc: 0}, + {FzName: ts + 28197 /* "sqlite3_blob_wri..." */, FxProc: 0}, } /* test_blob.c:317:5 */ // end block for C++ @@ -58898,393 +60503,395 @@ func sqlite3BtreeCursorList(tls *libc.TLS, p uintptr) { /* test_btree.c:52:6: */ // according to the compile-time configuration of the database. Test // procedures use this to determine when tests should be omitted. func set_options(tls *libc.TLS, interp uintptr) { /* test_config.c:47:13: */ - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27742 /* "malloc_usable_si..." */, ts+27761, /* "1" */ + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28231 /* "malloc_usable_si..." */, ts+28250, /* "1" */ TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27763 /* "rowid32" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28252 /* "rowid32" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27771 /* "casesensitivelik..." */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28260 /* "casesensitivelik..." */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27789 /* "curdir" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28278 /* "curdir" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27796 /* "win32malloc" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28285 /* "win32malloc" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27808 /* "debug" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28297 /* "debug" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27814 /* "default_ckptfull..." */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28303 /* "default_ckptfull..." */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27836 /* "direct_read" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28325 /* "direct_read" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27848 /* "dirsync" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28337 /* "dirsync" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27856 /* "lfs" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28345 /* "lfs" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27860 /* "pagecache_overfl..." */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28349 /* "pagecache_overfl..." */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27885 /* "mmap" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28374 /* "mmap" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27890, /* "worker_threads" */ - ts+27905 /* "8" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28379, /* "worker_threads" */ + ts+28394 /* "8" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27907 /* "memdebug" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28396 /* "memdebug" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27916 /* "8_3_names" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28405 /* "8_3_names" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27926 /* "cursorhints" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28415 /* "cursorhints" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27938 /* "hiddencolumns" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28427 /* "hiddencolumns" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+12974 /* "deserialize" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+13154 /* "deserialize" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27952 /* "mem3" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28441 /* "mathlib" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27957 /* "mem5" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28449 /* "mem3" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27962 /* "offset_sql_func" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28454 /* "mem5" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+13082 /* "preupdate" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28459 /* "offset_sql_func" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27978 /* "snapshot" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+13262 /* "preupdate" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27987 /* "mutex" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28475 /* "snapshot" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27993 /* "mutex_noop" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28484 /* "mutex" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28004 /* "altertable" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28490 /* "mutex_noop" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+1817 /* "analyze" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28501 /* "altertable" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28015 /* "api_armor" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+1818 /* "analyze" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28025 /* "atomicwrite" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28512 /* "api_armor" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28037 /* "json1" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28522 /* "atomicwrite" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28043 /* "has_codec" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28534 /* "json1" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28053 /* "like_match_blobs" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28540 /* "has_codec" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28070 /* "attach" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28550 /* "like_match_blobs" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28077 /* "auth" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28567 /* "attach" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28082 /* "autoinc" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28574 /* "auth" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+12555 /* "autoindex" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28579 /* "autoinc" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28090 /* "autoreset" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+12735 /* "autoindex" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28100 /* "autovacuum" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28111, /* "default_autovacu..." */ - ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28587 /* "autoreset" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28130 /* "between_opt" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28597 /* "autovacuum" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28608, /* "default_autovacu..." */ + ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28142 /* "builtin_test" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28627 /* "between_opt" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28155 /* "bloblit" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28639 /* "builtin_test" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28163 /* "cast" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28652 /* "bloblit" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28168 /* "check" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28660 /* "cast" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28174 /* "cte" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28665 /* "check" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28178 /* "columnmetadata" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28671 /* "cte" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28193 /* "oversize_cell_ch..." */, ts+13695, /* "0" */ + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28675 /* "columnmetadata" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) + + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28690 /* "oversize_cell_ch..." */, ts+13875, /* "0" */ TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28213 /* "compileoption_di..." */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28710 /* "compileoption_di..." */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+12953 /* "complete" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+13133 /* "complete" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28233 /* "compound" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28730 /* "compound" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28242 /* "conflict" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28251 /* "crashtest" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28739 /* "conflict" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28748 /* "crashtest" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28261 /* "datetime" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28758 /* "datetime" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28270 /* "decltype" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28767 /* "decltype" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28279 /* "deprecated" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28776 /* "deprecated" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28290 /* "diskio" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28787 /* "diskio" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+4665 /* "explain" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+4845 /* "explain" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28297 /* "floatingpoint" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28794 /* "floatingpoint" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28311 /* "foreignkey" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28808 /* "foreignkey" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28322 /* "fts1" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28819 /* "fts1" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28327 /* "fts2" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28824 /* "fts2" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28332 /* "fts3" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28829 /* "fts3" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28337 /* "fts5" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28834 /* "fts5" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28342 /* "fts3_unicode" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28839 /* "fts3_unicode" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28355 /* "fts4_deferred" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28852 /* "fts4_deferred" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28369 /* "gettable" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28866 /* "gettable" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28378 /* "icu" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28875 /* "icu" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28382 /* "icu_collations" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28879 /* "icu_collations" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+10346 /* "incrblob" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+10526 /* "incrblob" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28397 /* "integrityck" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28894 /* "integrityck" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28409 /* "legacyformat" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28906 /* "legacyformat" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28422 /* "like_opt" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28919 /* "like_opt" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28431 /* "load_ext" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28928 /* "load_ext" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28440 /* "localtime" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28937 /* "localtime" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28450 /* "lookaside" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28947 /* "lookaside" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28460, /* "long_double" */ + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28957, /* "long_double" */ func() uintptr { if uint64(unsafe.Sizeof(float64(0))) > uint64(unsafe.Sizeof(float64(0))) { - return ts + 27761 /* "1" */ + return ts + 28250 /* "1" */ } - return ts + 13695 /* "0" */ + return ts + 13875 /* "0" */ }(), TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28472 /* "memorydb" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28969 /* "memorydb" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28481 /* "memorymanage" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28978 /* "memorymanage" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28494 /* "mergesort" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+28991 /* "mergesort" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28504 /* "null_trim" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29001 /* "null_trim" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28514 /* "or_opt" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29011 /* "or_opt" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28521 /* "rbu" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29018 /* "rbu" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28525 /* "pager_pragmas" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29022 /* "pager_pragmas" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28539 /* "pragma" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29036 /* "pragma" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+10021 /* "progress" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+10201 /* "progress" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28546 /* "reindex" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29043 /* "reindex" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28554 /* "rtree" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29051 /* "rtree" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28560 /* "rtree_int_only" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29057 /* "rtree_int_only" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28575 /* "schema_pragmas" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29072 /* "schema_pragmas" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28590 /* "schema_version" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29087 /* "schema_version" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28605 /* "session" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29102 /* "session" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+18111 /* "stat4" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28613 /* "stmtvtab" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+18460 /* "stat4" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29110 /* "stmtvtab" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28622 /* "scanstatus" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29119 /* "scanstatus" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28633 /* "lock_proxy_pragm..." */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28652 /* "prefer_proxy_loc..." */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29130 /* "lock_proxy_pragm..." */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29149 /* "prefer_proxy_loc..." */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28673 /* "shared_cache" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29170 /* "shared_cache" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28686 /* "subquery" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29183 /* "subquery" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28695 /* "tclvar" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29192 /* "tclvar" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28702, /* "threadsafe" */ + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29199, /* "threadsafe" */ func() uintptr { if 1 != 0 { - return ts + 27761 /* "1" */ + return ts + 28250 /* "1" */ } - return ts + 13695 /* "0" */ + return ts + 13875 /* "0" */ }(), TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28713, /* "threadsafe1" */ + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29210, /* "threadsafe1" */ func() uintptr { if SQLITE_THREADSAFE == 1 { - return ts + 27761 /* "1" */ + return ts + 28250 /* "1" */ } - return ts + 13695 /* "0" */ + return ts + 13875 /* "0" */ }(), TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28725, /* "threadsafe2" */ + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29222, /* "threadsafe2" */ func() uintptr { if SQLITE_THREADSAFE == 2 { - return ts + 27761 /* "1" */ + return ts + 28250 /* "1" */ } - return ts + 13695 /* "0" */ + return ts + 13875 /* "0" */ }(), TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28737 /* "tempdb" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29234 /* "tempdb" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+13167 /* "trace" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+13347 /* "trace" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28744 /* "trigger" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29241 /* "trigger" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28752 /* "truncate_opt" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29249 /* "truncate_opt" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+15230 /* "utf16" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+15410 /* "utf16" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28765 /* "vacuum" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29262 /* "vacuum" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28772 /* "view" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29269 /* "view" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28777 /* "vtab" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29274 /* "vtab" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28782 /* "wal" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29279 /* "wal" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28786 /* "wsd" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29283 /* "wsd" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28790 /* "update_delete_li..." */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29287 /* "update_delete_li..." */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+13194 /* "unlock_notify" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+13374 /* "unlock_notify" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28810 /* "fast_secure_dele..." */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29307 /* "fast_secure_dele..." */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28829 /* "secure_delete" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29326 /* "secure_delete" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28843 /* "userauth" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29340 /* "userauth" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28852 /* "multiplex_ext_ov..." */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29349 /* "multiplex_ext_ov..." */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28876 /* "yytrackmaxstackd..." */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29373 /* "yytrackmaxstackd..." */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28897 /* "sqllog" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29394 /* "sqllog" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28904 /* "uri_00_error" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29401 /* "uri_00_error" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28917 /* "normalize" */, ts+13695 /* "0" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29414 /* "normalize" */, ts+13875 /* "0" */, TCL_GLOBAL_ONLY) - tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28927 /* "windowfunc" */, ts+27761 /* "1" */, TCL_GLOBAL_ONLY) + tcl.XTcl_SetVar2(tls, interp, ts+28216 /* "sqlite_options" */, ts+29424 /* "windowfunc" */, ts+28250 /* "1" */, TCL_GLOBAL_ONLY) { - tcl.XTcl_LinkVar(tls, interp, ts+28938 /* "SQLITE_MAX_LENGT..." */, uintptr(unsafe.Pointer(&cv_MAX_LENGTH)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29435 /* "SQLITE_MAX_LENGT..." */, uintptr(unsafe.Pointer(&cv_MAX_LENGTH)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+28956 /* "SQLITE_MAX_COLUM..." */, uintptr(unsafe.Pointer(&cv_MAX_COLUMN)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29453 /* "SQLITE_MAX_COLUM..." */, uintptr(unsafe.Pointer(&cv_MAX_COLUMN)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+28974 /* "SQLITE_MAX_SQL_L..." */, uintptr(unsafe.Pointer(&cv_MAX_SQL_LENGTH)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29471 /* "SQLITE_MAX_SQL_L..." */, uintptr(unsafe.Pointer(&cv_MAX_SQL_LENGTH)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+28996 /* "SQLITE_MAX_EXPR_..." */, uintptr(unsafe.Pointer(&cv_MAX_EXPR_DEPTH)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29493 /* "SQLITE_MAX_EXPR_..." */, uintptr(unsafe.Pointer(&cv_MAX_EXPR_DEPTH)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29018 /* "SQLITE_MAX_COMPO..." */, uintptr(unsafe.Pointer(&cv_MAX_COMPOUND_SELECT)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29515 /* "SQLITE_MAX_COMPO..." */, uintptr(unsafe.Pointer(&cv_MAX_COMPOUND_SELECT)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29045 /* "SQLITE_MAX_VDBE_..." */, uintptr(unsafe.Pointer(&cv_MAX_VDBE_OP)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29542 /* "SQLITE_MAX_VDBE_..." */, uintptr(unsafe.Pointer(&cv_MAX_VDBE_OP)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29064 /* "SQLITE_MAX_FUNCT..." */, uintptr(unsafe.Pointer(&cv_MAX_FUNCTION_ARG)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29561 /* "SQLITE_MAX_FUNCT..." */, uintptr(unsafe.Pointer(&cv_MAX_FUNCTION_ARG)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29088 /* "SQLITE_MAX_VARIA..." */, uintptr(unsafe.Pointer(&cv_MAX_VARIABLE_NUMBER)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29585 /* "SQLITE_MAX_VARIA..." */, uintptr(unsafe.Pointer(&cv_MAX_VARIABLE_NUMBER)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29115 /* "SQLITE_MAX_PAGE_..." */, uintptr(unsafe.Pointer(&cv_MAX_PAGE_SIZE)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29612 /* "SQLITE_MAX_PAGE_..." */, uintptr(unsafe.Pointer(&cv_MAX_PAGE_SIZE)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29136 /* "SQLITE_MAX_PAGE_..." */, uintptr(unsafe.Pointer(&cv_MAX_PAGE_COUNT)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29633 /* "SQLITE_MAX_PAGE_..." */, uintptr(unsafe.Pointer(&cv_MAX_PAGE_COUNT)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29158 /* "SQLITE_MAX_LIKE_..." */, uintptr(unsafe.Pointer(&cv_MAX_LIKE_PATTERN_LENGTH)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29655 /* "SQLITE_MAX_LIKE_..." */, uintptr(unsafe.Pointer(&cv_MAX_LIKE_PATTERN_LENGTH)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29189 /* "SQLITE_MAX_TRIGG..." */, uintptr(unsafe.Pointer(&cv_MAX_TRIGGER_DEPTH)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29686 /* "SQLITE_MAX_TRIGG..." */, uintptr(unsafe.Pointer(&cv_MAX_TRIGGER_DEPTH)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29214 /* "SQLITE_DEFAULT_C..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_CACHE_SIZE)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29711 /* "SQLITE_DEFAULT_C..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_CACHE_SIZE)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29240 /* "SQLITE_DEFAULT_P..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_PAGE_SIZE)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29737 /* "SQLITE_DEFAULT_P..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_PAGE_SIZE)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29265 /* "SQLITE_DEFAULT_F..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_FILE_FORMAT)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29762 /* "SQLITE_DEFAULT_F..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_FILE_FORMAT)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29292 /* "SQLITE_DEFAULT_S..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_SYNCHRONOUS)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29789 /* "SQLITE_DEFAULT_S..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_SYNCHRONOUS)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29319 /* "SQLITE_DEFAULT_W..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_WAL_SYNCHRONOUS)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29816 /* "SQLITE_DEFAULT_W..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_WAL_SYNCHRONOUS)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29350 /* "SQLITE_MAX_ATTAC..." */, uintptr(unsafe.Pointer(&cv_MAX_ATTACHED)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29847 /* "SQLITE_MAX_ATTAC..." */, uintptr(unsafe.Pointer(&cv_MAX_ATTACHED)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29370 /* "SQLITE_MAX_DEFAU..." */, uintptr(unsafe.Pointer(&cv_MAX_DEFAULT_PAGE_SIZE)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29867 /* "SQLITE_MAX_DEFAU..." */, uintptr(unsafe.Pointer(&cv_MAX_DEFAULT_PAGE_SIZE)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29399 /* "SQLITE_MAX_WORKE..." */, uintptr(unsafe.Pointer(&cv_MAX_WORKER_THREADS)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) + tcl.XTcl_LinkVar(tls, interp, ts+29896 /* "SQLITE_MAX_WORKE..." */, uintptr(unsafe.Pointer(&cv_MAX_WORKER_THREADS)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29425 /* "TEMP_STORE" */, uintptr(unsafe.Pointer(&cv_TEMP_STORE)), + tcl.XTcl_LinkVar(tls, interp, ts+29922 /* "TEMP_STORE" */, uintptr(unsafe.Pointer(&cv_TEMP_STORE)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } { - tcl.XTcl_LinkVar(tls, interp, ts+29436 /* "__GNUC__" */, uintptr(unsafe.Pointer(&cv___GNUC__)), + tcl.XTcl_LinkVar(tls, interp, ts+29933 /* "__GNUC__" */, uintptr(unsafe.Pointer(&cv___GNUC__)), (TCL_LINK_INT | TCL_LINK_READ_ONLY)) } } -var cv_MAX_LENGTH int32 = SQLITE_MAX_LENGTH /* test_config.c:772:3 */ -var cv_MAX_COLUMN int32 = SQLITE_MAX_COLUMN /* test_config.c:773:3 */ -var cv_MAX_SQL_LENGTH int32 = SQLITE_MAX_SQL_LENGTH /* test_config.c:774:3 */ -var cv_MAX_EXPR_DEPTH int32 = SQLITE_MAX_EXPR_DEPTH /* test_config.c:775:3 */ -var cv_MAX_COMPOUND_SELECT int32 = SQLITE_MAX_COMPOUND_SELECT /* test_config.c:776:3 */ -var cv_MAX_VDBE_OP int32 = SQLITE_MAX_VDBE_OP /* test_config.c:777:3 */ -var cv_MAX_FUNCTION_ARG int32 = SQLITE_MAX_FUNCTION_ARG /* test_config.c:778:3 */ -var cv_MAX_VARIABLE_NUMBER int32 = SQLITE_MAX_VARIABLE_NUMBER /* test_config.c:779:3 */ -var cv_MAX_PAGE_SIZE int32 = SQLITE_MAX_PAGE_SIZE /* test_config.c:780:3 */ -var cv_MAX_PAGE_COUNT int32 = SQLITE_MAX_PAGE_COUNT /* test_config.c:781:3 */ -var cv_MAX_LIKE_PATTERN_LENGTH int32 = SQLITE_MAX_LIKE_PATTERN_LENGTH /* test_config.c:782:3 */ -var cv_MAX_TRIGGER_DEPTH int32 = SQLITE_MAX_TRIGGER_DEPTH /* test_config.c:783:3 */ -var cv_DEFAULT_CACHE_SIZE int32 = -2000 /* test_config.c:784:3 */ -var cv_DEFAULT_PAGE_SIZE int32 = SQLITE_DEFAULT_PAGE_SIZE /* test_config.c:785:3 */ -var cv_DEFAULT_FILE_FORMAT int32 = SQLITE_DEFAULT_FILE_FORMAT /* test_config.c:786:3 */ -var cv_DEFAULT_SYNCHRONOUS int32 = SQLITE_DEFAULT_SYNCHRONOUS /* test_config.c:787:3 */ -var cv_DEFAULT_WAL_SYNCHRONOUS int32 = SQLITE_DEFAULT_SYNCHRONOUS /* test_config.c:788:3 */ -var cv_MAX_ATTACHED int32 = SQLITE_MAX_ATTACHED /* test_config.c:789:3 */ -var cv_MAX_DEFAULT_PAGE_SIZE int32 = SQLITE_MAX_DEFAULT_PAGE_SIZE /* test_config.c:790:3 */ -var cv_MAX_WORKER_THREADS int32 = SQLITE_MAX_WORKER_THREADS /* test_config.c:791:3 */ -var cv_TEMP_STORE int32 = SQLITE_TEMP_STORE /* test_config.c:794:22 */ -var cv___GNUC__ int32 = 1 /* test_config.c:808:22 */ +var cv_MAX_LENGTH int32 = SQLITE_MAX_LENGTH /* test_config.c:778:3 */ +var cv_MAX_COLUMN int32 = SQLITE_MAX_COLUMN /* test_config.c:779:3 */ +var cv_MAX_SQL_LENGTH int32 = SQLITE_MAX_SQL_LENGTH /* test_config.c:780:3 */ +var cv_MAX_EXPR_DEPTH int32 = SQLITE_MAX_EXPR_DEPTH /* test_config.c:781:3 */ +var cv_MAX_COMPOUND_SELECT int32 = SQLITE_MAX_COMPOUND_SELECT /* test_config.c:782:3 */ +var cv_MAX_VDBE_OP int32 = SQLITE_MAX_VDBE_OP /* test_config.c:783:3 */ +var cv_MAX_FUNCTION_ARG int32 = SQLITE_MAX_FUNCTION_ARG /* test_config.c:784:3 */ +var cv_MAX_VARIABLE_NUMBER int32 = SQLITE_MAX_VARIABLE_NUMBER /* test_config.c:785:3 */ +var cv_MAX_PAGE_SIZE int32 = SQLITE_MAX_PAGE_SIZE /* test_config.c:786:3 */ +var cv_MAX_PAGE_COUNT int32 = SQLITE_MAX_PAGE_COUNT /* test_config.c:787:3 */ +var cv_MAX_LIKE_PATTERN_LENGTH int32 = SQLITE_MAX_LIKE_PATTERN_LENGTH /* test_config.c:788:3 */ +var cv_MAX_TRIGGER_DEPTH int32 = SQLITE_MAX_TRIGGER_DEPTH /* test_config.c:789:3 */ +var cv_DEFAULT_CACHE_SIZE int32 = -2000 /* test_config.c:790:3 */ +var cv_DEFAULT_PAGE_SIZE int32 = SQLITE_DEFAULT_PAGE_SIZE /* test_config.c:791:3 */ +var cv_DEFAULT_FILE_FORMAT int32 = SQLITE_DEFAULT_FILE_FORMAT /* test_config.c:792:3 */ +var cv_DEFAULT_SYNCHRONOUS int32 = SQLITE_DEFAULT_SYNCHRONOUS /* test_config.c:793:3 */ +var cv_DEFAULT_WAL_SYNCHRONOUS int32 = SQLITE_DEFAULT_SYNCHRONOUS /* test_config.c:794:3 */ +var cv_MAX_ATTACHED int32 = SQLITE_MAX_ATTACHED /* test_config.c:795:3 */ +var cv_MAX_DEFAULT_PAGE_SIZE int32 = SQLITE_MAX_DEFAULT_PAGE_SIZE /* test_config.c:796:3 */ +var cv_MAX_WORKER_THREADS int32 = SQLITE_MAX_WORKER_THREADS /* test_config.c:797:3 */ +var cv_TEMP_STORE int32 = SQLITE_TEMP_STORE /* test_config.c:800:22 */ +var cv___GNUC__ int32 = 1 /* test_config.c:814:22 */ // Register commands with the TCL interpreter. -func Sqliteconfig_Init(tls *libc.TLS, interp uintptr) int32 { /* test_config.c:819:5: */ +func Sqliteconfig_Init(tls *libc.TLS, interp uintptr) int32 { /* test_config.c:825:5: */ set_options(tls, interp) return TCL_OK } @@ -59347,15 +60954,15 @@ func sqlite3_delete_database(tls *libc.TLS, zFile uintptr) int32 { /* test_delet var rc int32 = 0 // System error code var i int32 // Iterate through azFmt[] and aMFile[] - *(*[4]uintptr)(unsafe.Pointer(bp + 24 /* azFmt */)) = [4]uintptr{ts /* "%s" */, ts + 29445 /* "%s-journal" */, ts + 29456 /* "%s-wal" */, ts + 29463 /* "%s-shm" */} + *(*[4]uintptr)(unsafe.Pointer(bp + 24 /* azFmt */)) = [4]uintptr{ts /* "%s" */, ts + 29942 /* "%s-journal" */, ts + 29953 /* "%s-wal" */, ts + 29960 /* "%s-shm" */} *(*[6]MFile)(unsafe.Pointer(bp + 56 /* aMFile */)) = [6]MFile{ - {FzFmt: ts + 29470 /* "%s%03d" */}, - {FzFmt: ts + 29477 /* "%s-journal%03d" */}, - {FzFmt: ts + 29492 /* "%s-wal%03d" */}, - {FzFmt: ts + 29470 /* "%s%03d" */, Fb83: 1}, - {FzFmt: ts + 29477 /* "%s-journal%03d" */, FiOffset: SQLITE_MULTIPLEX_JOURNAL_8_3_OFFSET, Fb83: 1}, - {FzFmt: ts + 29492 /* "%s-wal%03d" */, FiOffset: SQLITE_MULTIPLEX_WAL_8_3_OFFSET, Fb83: 1}, + {FzFmt: ts + 29967 /* "%s%03d" */}, + {FzFmt: ts + 29974 /* "%s-journal%03d" */}, + {FzFmt: ts + 29989 /* "%s-wal%03d" */}, + {FzFmt: ts + 29967 /* "%s%03d" */, Fb83: 1}, + {FzFmt: ts + 29974 /* "%s-journal%03d" */, FiOffset: SQLITE_MULTIPLEX_JOURNAL_8_3_OFFSET, Fb83: 1}, + {FzFmt: ts + 29989 /* "%s-wal%03d" */, FiOffset: SQLITE_MULTIPLEX_WAL_8_3_OFFSET, Fb83: 1}, } var pVfs uintptr = uintptr(0) @@ -59523,22 +61130,22 @@ func devsymDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* test_d // Shared-memory methods are all pass-thrus. func devsymShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* test_devsym.c:192:12: */ var p uintptr = pFile - return sqlite3.Xsqlite3OsShmLock(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, ofst, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*devsym_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 112 /* &.xShmLock */))))(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, ofst, n, flags) } func devsymShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 { /* test_devsym.c:196:12: */ var p uintptr = pFile - return sqlite3.Xsqlite3OsShmMap(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, iRegion, szRegion, isWrite, libc.AtomicLoadUintptr(&pp)) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*devsym_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 104 /* &.xShmMap */))))(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, iRegion, szRegion, isWrite, libc.AtomicLoadUintptr(&pp)) } func devsymShmBarrier(tls *libc.TLS, pFile uintptr) { /* test_devsym.c:206:13: */ var p uintptr = pFile - sqlite3.Xsqlite3OsShmBarrier(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*devsym_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 120 /* &.xShmBarrier */))))(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal) } func devsymShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* test_devsym.c:210:12: */ var p uintptr = pFile - return sqlite3.Xsqlite3OsShmUnmap(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, delFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*devsym_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 128 /* &.xShmUnmap */))))(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, delFlag) } // Open an devsym file handle. @@ -59670,7 +61277,7 @@ var devsym_vfs = sqlite3_vfs{ FiVersion: 2, // iVersion FszOsFile: int32(unsafe.Sizeof(devsym_file{})), // szOsFile FmxPathname: DEVSYM_MAX_PATHNAME, // pNext - FzName: ts + 29503, /* "devsym" */ // pAppData + FzName: ts + 30000, /* "devsym" */ // pAppData FxOpen: 0, // xOpen FxDelete: 0, // xDelete FxAccess: 0, // xAccess @@ -59684,7 +61291,7 @@ var writecrash_vfs = sqlite3_vfs{ FiVersion: 2, // iVersion FszOsFile: int32(unsafe.Sizeof(devsym_file{})), // szOsFile FmxPathname: DEVSYM_MAX_PATHNAME, // pNext - FzName: ts + 29510, /* "writecrash" */ // pAppData + FzName: ts + 30007, /* "writecrash" */ // pAppData FxOpen: 0, // xOpen FxDelete: 0, // xDelete FxAccess: 0, // xAccess @@ -59740,7 +61347,7 @@ func devsym_crash_on_write(tls *libc.TLS, nWrite int32) { /* test_devsym.c:514:6 // The next short section of defines are only done when not running on Windows // or some other strange platform. -type Tcl_StatBuf = stat /* tcl.h:470:25 */ +type Tcl_StatBuf = stat /* tcl.h:474:25 */ // Note stat64 has the same shape as stat for x86-64. type stat64 = struct { @@ -59770,76 +61377,6 @@ type stat64 = struct { F__glibc_reserved [3]int64 } /* stat.h:119:1 */ -// statx-related definitions and declarations. -// Copyright (C) 2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// This interface is based on in Linux. - -type statx_timestamp = struct { - Ftv_sec int64 - Ftv_nsec uint32 - F__statx_timestamp_pad1 [1]int32 -} /* statx.h:25:1 */ - -// Warning: The kernel may add additional fields to this struct in the -// future. Only use this struct for calling the statx function, not -// for storing data. (Expansion will be controlled by the mask -// argument of the statx function.) -type statx = struct { - Fstx_mask uint32 - Fstx_blksize uint32 - Fstx_attributes uint64 - Fstx_nlink uint32 - Fstx_uid uint32 - Fstx_gid uint32 - Fstx_mode uint16 - F__statx_pad1 [1]uint16 - Fstx_ino uint64 - Fstx_size uint64 - Fstx_blocks uint64 - Fstx_attributes_mask uint64 - Fstx_atime struct { - Ftv_sec int64 - Ftv_nsec uint32 - F__statx_timestamp_pad1 [1]int32 - } - Fstx_btime struct { - Ftv_sec int64 - Ftv_nsec uint32 - F__statx_timestamp_pad1 [1]int32 - } - Fstx_ctime struct { - Ftv_sec int64 - Ftv_nsec uint32 - F__statx_timestamp_pad1 [1]int32 - } - Fstx_mtime struct { - Ftv_sec int64 - Ftv_nsec uint32 - F__statx_timestamp_pad1 [1]int32 - } - Fstx_rdev_major uint32 - Fstx_rdev_minor uint32 - Fstx_dev_major uint32 - Fstx_dev_minor uint32 - F__statx_pad2 [14]uint64 -} /* statx.h:36:1 */ - type flock64 = struct { Fl_type int16 Fl_whence int16 @@ -59900,7 +61437,7 @@ type flock64 = struct { // License along with the GNU C Library; if not, see // . -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -60139,7 +61676,7 @@ func fsdirConnect1(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uin var pTab uintptr if argc != 3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+27277 /* "wrong number of ..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+27766 /* "wrong number of ..." */, 0) return SQLITE_ERROR } @@ -60150,7 +61687,7 @@ func fsdirConnect1(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uin libc.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(FsdirVtab{}))) *(*uintptr)(unsafe.Pointer(ppVtab)) = (pTab /* &.base */) - sqlite3.Xsqlite3_declare_vtab(tls, db, ts+29521 /* "CREATE TABLE xyz..." */) + sqlite3.Xsqlite3_declare_vtab(tls, db, ts+30018 /* "CREATE TABLE xyz..." */) return SQLITE_OK } @@ -60332,7 +61869,7 @@ func fstreeConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uin var pTab uintptr if argc != 3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+27277 /* "wrong number of ..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+27766 /* "wrong number of ..." */, 0) return SQLITE_ERROR } @@ -60344,7 +61881,7 @@ func fstreeConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uin (*FstreeVtab)(unsafe.Pointer(pTab)).Fdb = db *(*uintptr)(unsafe.Pointer(ppVtab)) = (pTab /* &.base */) - sqlite3.Xsqlite3_declare_vtab(tls, db, ts+29550 /* "CREATE TABLE xyz..." */) + sqlite3.Xsqlite3_declare_vtab(tls, db, ts+30047 /* "CREATE TABLE xyz..." */) return SQLITE_OK } @@ -60436,7 +61973,7 @@ func fstreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp var pCsr uintptr = pVtabCursor var pTab uintptr = (*FstreeCsr)(unsafe.Pointer(pCsr)).Fbase.FpVtab var rc int32 - var zSql uintptr = ts + 29586 /* "WITH r(d) AS ( ..." */ + var zSql uintptr = ts + 30083 /* "WITH r(d) AS ( ..." */ var zRoot uintptr var nRoot int32 var zPrefix uintptr @@ -60445,9 +61982,9 @@ func fstreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp var nDir int32 *(*[2]int8)(unsafe.Pointer(bp /* aWild */)) = [2]int8{int8(0), int8(0)} - zRoot = ts + 29818 /* "/" */ + zRoot = ts + 30315 /* "/" */ nRoot = 1 - zPrefix = ts + 488 /* "" */ + zPrefix = ts + 489 /* "" */ nPrefix = 0 zDir = zRoot @@ -60566,7 +62103,7 @@ func fsConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr var zDb uintptr = *(*uintptr)(unsafe.Pointer(argv + 1*8)) if argc != 4 { - *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+27277 /* "wrong number of ..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+27766 /* "wrong number of ..." */, 0) return SQLITE_ERROR } zTbl = *(*uintptr)(unsafe.Pointer(argv + 3*8)) @@ -60583,7 +62120,7 @@ func fsConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr libc.Xmemcpy(tls, (*fs_vtab)(unsafe.Pointer(pVtab)).FzTbl, zTbl, libc.Xstrlen(tls, zTbl)) libc.Xmemcpy(tls, (*fs_vtab)(unsafe.Pointer(pVtab)).FzDb, zDb, libc.Xstrlen(tls, zDb)) *(*uintptr)(unsafe.Pointer(ppVtab)) = (pVtab /* &.base */) - sqlite3.Xsqlite3_declare_vtab(tls, db, ts+29820 /* "CREATE TABLE x(p..." */) + sqlite3.Xsqlite3_declare_vtab(tls, db, ts+30317 /* "CREATE TABLE x(p..." */) return SQLITE_OK } @@ -60637,7 +62174,7 @@ func fsFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, if idxNum == 1 { var zStmt uintptr = sqlite3.Xsqlite3_mprintf(tls, - ts+29857 /* "SELECT * FROM %Q..." */, libc.VaList(bp, (*fs_vtab)(unsafe.Pointer(p)).FzDb, (*fs_vtab)(unsafe.Pointer(p)).FzTbl)) + ts+30354 /* "SELECT * FROM %Q..." */, libc.VaList(bp, (*fs_vtab)(unsafe.Pointer(p)).FzDb, (*fs_vtab)(unsafe.Pointer(p)).FzTbl)) if !(zStmt != 0) { return SQLITE_NOMEM } @@ -60647,7 +62184,7 @@ func fsFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, sqlite3.Xsqlite3_bind_value(tls, (*fs_cursor)(unsafe.Pointer(pCur)).FpStmt, 1, *(*uintptr)(unsafe.Pointer(argv))) } } else { - var zStmt uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+3221 /* "SELECT * FROM %Q..." */, libc.VaList(bp+16, (*fs_vtab)(unsafe.Pointer(p)).FzDb, (*fs_vtab)(unsafe.Pointer(p)).FzTbl)) + var zStmt uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+3278 /* "SELECT * FROM %Q..." */, libc.VaList(bp+16, (*fs_vtab)(unsafe.Pointer(p)).FzDb, (*fs_vtab)(unsafe.Pointer(p)).FzTbl)) if !(zStmt != 0) { return SQLITE_NOMEM } @@ -60796,15 +62333,15 @@ func register_fs_module(tls *libc.TLS, clientData ClientData, interp uintptr, ob // var db uintptr at bp, 8 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { return TCL_ERROR } - sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+29891 /* "fs" */, uintptr(unsafe.Pointer(&fsModule)), interp) - sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+5016 /* "fsdir" */, uintptr(unsafe.Pointer(&fsdirModule)), uintptr(0)) - sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+29894 /* "fstree" */, uintptr(unsafe.Pointer(&fstreeModule)), uintptr(0)) + sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+30388 /* "fs" */, uintptr(unsafe.Pointer(&fsModule)), interp) + sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+5196 /* "fsdir" */, uintptr(unsafe.Pointer(&fsdirModule)), uintptr(0)) + sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+30391 /* "fstree" */, uintptr(unsafe.Pointer(&fstreeModule)), uintptr(0)) return TCL_OK } @@ -60827,7 +62364,7 @@ var aObjCmd6 = [1]struct { FxProc uintptr FclientData uintptr }{ - {FzName: ts + 29901 /* "register_fs_modu..." */, FxProc: 0}, + {FzName: ts + 30398 /* "register_fs_modu..." */, FxProc: 0}, } /* test_fs.c:907:5 */ // Some versions of define this macros. @@ -60893,7 +62430,7 @@ func randStr(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test sqlite3.Xsqlite3_result_text(tls, context, bp+4 /* zBuf */, n, libc.UintptrFromInt32(-1)) } -var zSrc = *(*[79]uint8)(unsafe.Pointer(ts + 29920 /* "abcdefghijklmnop..." */)) /* test_func.c:46:30 */ +var zSrc = *(*[79]uint8)(unsafe.Pointer(ts + 30417 /* "abcdefghijklmnop..." */)) /* test_func.c:46:30 */ // The following two SQL functions are used to test returning a text // result with a destructor. Function 'test_destructor' takes one argument @@ -61086,7 +62623,7 @@ func test_eval(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_ if rc != 0 { var zErr uintptr - zErr = sqlite3.Xsqlite3_mprintf(tls, ts+29999 /* "sqlite3_prepare_..." */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, db))) + zErr = sqlite3.Xsqlite3_mprintf(tls, ts+30496 /* "sqlite3_prepare_..." */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, db))) sqlite3.Xsqlite3_result_text(tls, pCtx, zErr, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free}))) sqlite3.Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -61192,11 +62729,11 @@ func real2hex(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* tes *(*float64)(unsafe.Pointer(bp /* &v */)) = sqlite3.Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))) for i = 0; i < 8; i++ { if bigEndian != 0 { - *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr((i * 2)))) = *(*int8)(unsafe.Pointer(ts + 30030 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) >> 4)))) - *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr(((i * 2) + 1)))) = *(*int8)(unsafe.Pointer(ts + 30030 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) & 0xf)))) + *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr((i * 2)))) = *(*int8)(unsafe.Pointer(ts + 30527 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) >> 4)))) + *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr(((i * 2) + 1)))) = *(*int8)(unsafe.Pointer(ts + 30527 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) & 0xf)))) } else { - *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr((14 - (i * 2))))) = *(*int8)(unsafe.Pointer(ts + 30030 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) >> 4)))) - *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr(((14 - (i * 2)) + 1)))) = *(*int8)(unsafe.Pointer(ts + 30030 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) & 0xf)))) + *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr((14 - (i * 2))))) = *(*int8)(unsafe.Pointer(ts + 30527 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) >> 4)))) + *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr(((14 - (i * 2)) + 1)))) = *(*int8)(unsafe.Pointer(ts + 30527 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) & 0xf)))) } } *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + 16)) = int8(0) @@ -61302,7 +62839,7 @@ func test_decode(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* var n int32 = sqlite3.Xsqlite3_value_bytes(tls, bp+40 /* &mem */) var z uintptr = sqlite3.Xsqlite3_value_blob(tls, bp+40 /* &mem */) var i int32 - pVal = tcl.XTcl_NewStringObj(tls, ts+30047 /* "x'" */, -1) + pVal = tcl.XTcl_NewStringObj(tls, ts+30544 /* "x'" */, -1) for i = 0; i < n; i++ { // var hex [3]int8 at bp+104, 3 @@ -61311,7 +62848,7 @@ func test_decode(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* *(*int8)(unsafe.Pointer(bp + 104 /* &hex[0] */ + 2)) = int8(0) tcl.XTcl_AppendStringsToObj(tls, pVal, libc.VaList(bp, bp+104 /* &hex[0] */, 0)) } - tcl.XTcl_AppendStringsToObj(tls, pVal, libc.VaList(bp+16, ts+5315 /* "'" */, 0)) + tcl.XTcl_AppendStringsToObj(tls, pVal, libc.VaList(bp+16, ts+5495 /* "'" */, 0)) break } @@ -61325,7 +62862,7 @@ func test_decode(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* break case SQLITE_NULL: - pVal = tcl.XTcl_NewStringObj(tls, ts+5537 /* "NULL" */, -1) + pVal = tcl.XTcl_NewStringObj(tls, ts+5717 /* "NULL" */, -1) break default: @@ -61403,7 +62940,7 @@ func registerTestFunctions(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pThunk u int32(aFuncs[i].FeTextRep), uintptr(0), aFuncs[i].FxFunc, uintptr(0), uintptr(0)) } - sqlite3.Xsqlite3_create_function(tls, db, ts+30050 /* "test_agg_errmsg1..." */, 0, SQLITE_ANY, uintptr(0), uintptr(0), + sqlite3.Xsqlite3_create_function(tls, db, ts+30547 /* "test_agg_errmsg1..." */, 0, SQLITE_ANY, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{test_agg_errmsg16_step})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{test_agg_errmsg16_final}))) @@ -61418,26 +62955,26 @@ var aFuncs = [20]struct { FeTextRep uint32 FxFunc uintptr }{ - {FzName: ts + 30068 /* "randstr" */, FnArg: int8(2), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30076 /* "test_destructor" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30092 /* "test_destructor1..." */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30110 /* "hex_to_utf16be" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30125 /* "hex_to_utf16le" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30140 /* "hex_to_utf8" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30152 /* "test_destructor_..." */, FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30174 /* "test_auxdata" */, FnArg: int8(-1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30187 /* "test_error" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30187 /* "test_error" */, FnArg: int8(2), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30198 /* "test_eval" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30208 /* "test_isolation" */, FnArg: int8(2), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30223 /* "test_counter" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30236 /* "real2hex" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30245 /* "test_decode" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30257 /* "test_extract" */, FnArg: int8(2), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30270 /* "test_zeroblob" */, FnArg: int8(1), FeTextRep: (uint32(SQLITE_UTF8 | SQLITE_DETERMINISTIC)), FxFunc: 0}, - {FzName: ts + 30284 /* "test_getsubtype" */, FnArg: int8(1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30300 /* "test_setsubtype" */, FnArg: int8(2), FeTextRep: SQLITE_UTF8, FxFunc: 0}, - {FzName: ts + 30316 /* "test_frombind" */, FnArg: int8(-1), FeTextRep: SQLITE_UTF8, FxFunc: 0}, + {FzName: ts + 30565 /* "randstr" */, FnArg: int8(2), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30573 /* "test_destructor" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30589 /* "test_destructor1..." */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30607 /* "hex_to_utf16be" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30622 /* "hex_to_utf16le" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30637 /* "hex_to_utf8" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30649 /* "test_destructor_..." */, FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30671 /* "test_auxdata" */, FnArg: int8(-1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30684 /* "test_error" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30684 /* "test_error" */, FnArg: int8(2), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30695 /* "test_eval" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30705 /* "test_isolation" */, FnArg: int8(2), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30720 /* "test_counter" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30733 /* "real2hex" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30742 /* "test_decode" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30754 /* "test_extract" */, FnArg: int8(2), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30767 /* "test_zeroblob" */, FnArg: int8(1), FeTextRep: (uint32(SQLITE_UTF8 | SQLITE_DETERMINISTIC)), FxFunc: 0}, + {FzName: ts + 30781 /* "test_getsubtype" */, FnArg: int8(1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30797 /* "test_setsubtype" */, FnArg: int8(2), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, + {FzName: ts + 30813 /* "test_frombind" */, FnArg: int8(-1), FeTextRep: uint32(SQLITE_UTF8), FxFunc: 0}, } /* test_func.c:674:5 */ // TCLCMD: autoinstall_test_functions @@ -61485,7 +63022,7 @@ func abuse_create_function(tls *libc.TLS, clientData uintptr, interp uintptr, ob __1: ; - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30330 /* "tx" */, 1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30827 /* "tx" */, 1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{tStep})), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) @@ -61497,7 +63034,7 @@ __1: __2: ; - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30330 /* "tx" */, 1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30827 /* "tx" */, 1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{tStep})), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) @@ -61509,7 +63046,7 @@ __2: __3: ; - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30330 /* "tx" */, 1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30827 /* "tx" */, 1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{tStep})), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{tFinal}))) if !(rc != SQLITE_MISUSE) { @@ -61519,7 +63056,7 @@ __3: __4: ; - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30330 /* "tx" */, 1, SQLITE_UTF8, uintptr(0), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{tFinal}))) + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30827 /* "tx" */, 1, SQLITE_UTF8, uintptr(0), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{tFinal}))) if !(rc != SQLITE_MISUSE) { goto __5 } @@ -61527,7 +63064,7 @@ __4: __5: ; - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30330 /* "tx" */, 1, SQLITE_UTF8, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30827 /* "tx" */, 1, SQLITE_UTF8, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{tStep})), uintptr(0)) if !(rc != SQLITE_MISUSE) { @@ -61537,7 +63074,7 @@ __5: __6: ; - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30330 /* "tx" */, -2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30827 /* "tx" */, -2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{tStep})), uintptr(0), uintptr(0)) if !(rc != SQLITE_MISUSE) { @@ -61547,7 +63084,7 @@ __6: __7: ; - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30330 /* "tx" */, 128, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30827 /* "tx" */, 128, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{tStep})), uintptr(0), uintptr(0)) if !(rc != SQLITE_MISUSE) { @@ -61559,7 +63096,7 @@ __8: rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), - ts+30333, /* "funcxx_123456789..." */ + ts+30830, /* "funcxx_123456789..." */ 1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{tStep})), uintptr(0), uintptr(0)) @@ -61577,7 +63114,7 @@ __9: mxArg = sqlite3.Xsqlite3_limit(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), SQLITE_LIMIT_FUNCTION_ARG, -1) rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), - ts+30590, /* "nullx_123456789_..." */ + ts+31087, /* "nullx_123456789_..." */ mxArg, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{tStep})), uintptr(0), uintptr(0)) @@ -61591,7 +63128,7 @@ __10: return TCL_OK abuse_err: - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+30846, /* "sqlite3_create_f..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31343, /* "sqlite3_create_f..." */ uintptr(0))) return TCL_ERROR } @@ -61678,7 +63215,7 @@ __2: goto __3 } sqlite3.Xsqlite3_result_error(tls, pCtx, - ts+30889 /* "invalid matchinf..." */, -1) + ts+31386 /* "invalid matchinf..." */, -1) return __3: ; @@ -61739,7 +63276,7 @@ __7: // Jump here if the wrong number of arguments are passed to this function wrong_number_args: - sqlite3.Xsqlite3_result_error(tls, pCtx, ts+30938 /* "wrong number of ..." */, -1) + sqlite3.Xsqlite3_result_error(tls, pCtx, ts+31435 /* "wrong number of ..." */, -1) } func install_fts3_rank_function(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_func.c:910:26: */ @@ -61749,14 +63286,14 @@ func install_fts3_rank_function(tls *libc.TLS, clientData uintptr, interp uintpt // var db uintptr at bp, 8 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { return TCL_ERROR } - sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+30983 /* "rank" */, -1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+31480 /* "rank" */, -1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rankfunc})), uintptr(0), uintptr(0)) return TCL_OK @@ -61786,9 +63323,9 @@ var aObjCmd7 = [3]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 30988 /* "autoinstall_test..." */, FxProc: 0}, - {FzName: ts + 31015 /* "abuse_create_fun..." */, FxProc: 0}, - {FzName: ts + 31037 /* "install_fts3_ran..." */, FxProc: 0}, + {FzName: ts + 31485 /* "autoinstall_test..." */, FxProc: 0}, + {FzName: ts + 31512 /* "abuse_create_fun..." */, FxProc: 0}, + {FzName: ts + 31534 /* "install_fts3_ran..." */, FxProc: 0}, } /* test_func.c:937:5 */ // Some versions of define this macros. @@ -61896,7 +63433,7 @@ func sqlite3TestBinToHex(tls *libc.TLS, zBuf uintptr, N int32) { /* test_hexio.c bp := tls.Alloc(17) defer tls.Free(17) - *(*[17]uint8)(unsafe.Pointer(bp /* zHex */)) = *(*[17]uint8)(unsafe.Pointer(ts + 31064 /* "0123456789ABCDEF" */)) + *(*[17]uint8)(unsafe.Pointer(bp /* zHex */)) = *(*[17]uint8)(unsafe.Pointer(ts + 31561 /* "0123456789ABCDEF" */)) var i int32 var j int32 var c uint8 @@ -61976,7 +63513,7 @@ func hexio_read(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, o var in uintptr if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31081 /* "FILENAME OFFSET ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31578 /* "FILENAME OFFSET ..." */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+40 /* &offset */) != 0 { @@ -61990,12 +63527,12 @@ func hexio_read(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, o if zBuf == uintptr(0) { return TCL_ERROR } - in = libc.Xfopen(tls, zFile, ts+4086 /* "rb" */) + in = libc.Xfopen(tls, zFile, ts+4273 /* "rb" */) if in == uintptr(0) { - in = libc.Xfopen(tls, zFile, ts+31101 /* "r" */) + in = libc.Xfopen(tls, zFile, ts+31598 /* "r" */) } if in == uintptr(0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31103 /* "cannot open inpu..." */, zFile, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31600 /* "cannot open inpu..." */, zFile, 0)) return TCL_ERROR } libc.Xfseek(tls, in, int64(*(*int32)(unsafe.Pointer(bp + 40 /* offset */))), SEEK_SET) @@ -62030,7 +63567,7 @@ func hexio_write(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, var out uintptr if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31127 /* "FILENAME OFFSET ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31624 /* "FILENAME OFFSET ..." */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+24 /* &offset */) != 0 { @@ -62038,17 +63575,17 @@ func hexio_write(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, } zFile = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) zIn = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+28 /* &nIn */) - aOut = sqlite3.Xsqlite3_malloc(tls, (*(*int32)(unsafe.Pointer(bp + 28 /* nIn */)) / 2)) + aOut = sqlite3.Xsqlite3_malloc(tls, (1 + (*(*int32)(unsafe.Pointer(bp + 28 /* nIn */)) / 2))) if aOut == uintptr(0) { return TCL_ERROR } nOut = sqlite3TestHexToBin(tls, zIn, *(*int32)(unsafe.Pointer(bp + 28 /* nIn */)), aOut) - out = libc.Xfopen(tls, zFile, ts+31151 /* "r+b" */) + out = libc.Xfopen(tls, zFile, ts+31648 /* "r+b" */) if out == uintptr(0) { - out = libc.Xfopen(tls, zFile, ts+31155 /* "r+" */) + out = libc.Xfopen(tls, zFile, ts+31652 /* "r+" */) } if out == uintptr(0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31158 /* "cannot open outp..." */, zFile, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31655 /* "cannot open outp..." */, zFile, 0)) return TCL_ERROR } libc.Xfseek(tls, out, int64(*(*int32)(unsafe.Pointer(bp + 24 /* offset */))), SEEK_SET) @@ -62077,11 +63614,11 @@ func hexio_get_int(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 // var aNum [4]uint8 at bp+4, 4 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31183 /* "HEXDATA" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31680 /* "HEXDATA" */) return TCL_ERROR } zIn = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &nIn */) - aOut = sqlite3.Xsqlite3_malloc(tls, (*(*int32)(unsafe.Pointer(bp /* nIn */)) / 2)) + aOut = sqlite3.Xsqlite3_malloc(tls, (1 + (*(*int32)(unsafe.Pointer(bp /* nIn */)) / 2))) if aOut == uintptr(0) { return TCL_ERROR } @@ -62110,7 +63647,7 @@ func hexio_render_int16(tls *libc.TLS, clientData uintptr, interp uintptr, objc // var aNum [10]uint8 at bp+4, 10 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2273 /* "INTEGER" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2274 /* "INTEGER" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &val */) != 0 { @@ -62135,7 +63672,7 @@ func hexio_render_int32(tls *libc.TLS, clientData uintptr, interp uintptr, objc // var aNum [10]uint8 at bp+4, 10 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2273 /* "INTEGER" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2274 /* "INTEGER" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &val */) != 0 { @@ -62160,7 +63697,7 @@ func utf8_to_utf8(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, defer tls.Free(16) tcl.XTcl_AppendResult(tls, interp, - libc.VaList(bp, ts+31191 /* "[utf8_to_utf8] u..." */, 0)) + libc.VaList(bp, ts+31688 /* "[utf8_to_utf8] u..." */, 0)) return TCL_ERROR } @@ -62205,7 +63742,7 @@ func read_fts3varint(tls *libc.TLS, clientData uintptr, interp uintptr, objc int var nVal int32 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31245 /* "BLOB VARNAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31742 /* "BLOB VARNAME" */) return TCL_ERROR } zBlob = tcl.XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &nBlob */) @@ -62229,7 +63766,7 @@ func make_fts3record(tls *libc.TLS, clientData uintptr, interp uintptr, objc int var i int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31258 /* "LIST" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31755 /* "LIST" */) return TCL_ERROR } if tcl.XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &nArg */, bp+8 /* &aArg */) != 0 { @@ -62300,14 +63837,14 @@ var aObjCmd8 = [8]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 31263 /* "hexio_read" */, FxProc: 0}, - {FzName: ts + 31274 /* "hexio_write" */, FxProc: 0}, - {FzName: ts + 31286 /* "hexio_get_int" */, FxProc: 0}, - {FzName: ts + 31300 /* "hexio_render_int..." */, FxProc: 0}, - {FzName: ts + 31319 /* "hexio_render_int..." */, FxProc: 0}, - {FzName: ts + 31338 /* "utf8_to_utf8" */, FxProc: 0}, - {FzName: ts + 31351 /* "read_fts3varint" */, FxProc: 0}, - {FzName: ts + 31367 /* "make_fts3record" */, FxProc: 0}, + {FzName: ts + 31760 /* "hexio_read" */, FxProc: 0}, + {FzName: ts + 31771 /* "hexio_write" */, FxProc: 0}, + {FzName: ts + 31783 /* "hexio_get_int" */, FxProc: 0}, + {FzName: ts + 31797 /* "hexio_render_int..." */, FxProc: 0}, + {FzName: ts + 31816 /* "hexio_render_int..." */, FxProc: 0}, + {FzName: ts + 31835 /* "utf8_to_utf8" */, FxProc: 0}, + {FzName: ts + 31848 /* "read_fts3varint" */, FxProc: 0}, + {FzName: ts + 31864 /* "make_fts3record" */, FxProc: 0}, } /* test_hexio.c:450:5 */ // end block for C++ @@ -62548,14 +64085,14 @@ func init_wrapper_install(tls *libc.TLS, clientData ClientData, interp uintptr, installInitWrappers(tls) for i = 1; i < objc; i++ { var z uintptr = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) - if libc.Xstrcmp(tls, z, ts+31383 /* "mem" */) == 0 { + if libc.Xstrcmp(tls, z, ts+31880 /* "mem" */) == 0 { wrapped.Fmem_fail = 1 - } else if libc.Xstrcmp(tls, z, ts+27987 /* "mutex" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+28484 /* "mutex" */) == 0 { wrapped.Fmutex_fail = 1 - } else if libc.Xstrcmp(tls, z, ts+31387 /* "pcache" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+31884 /* "pcache" */) == 0 { wrapped.Fpcache_fail = 1 } else { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31394 /* "Unknown argument..." */, z, ts+11456 /* "\"" */)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31891 /* "Unknown argument..." */, z, ts+11636 /* "\"" */)) return TCL_ERROR } } @@ -62567,7 +64104,7 @@ func init_wrapper_uninstall(tls *libc.TLS, clientData ClientData, interp uintptr defer tls.Free(24) if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } @@ -62580,7 +64117,7 @@ func init_wrapper_uninstall(tls *libc.TLS, clientData ClientData, interp uintptr func init_wrapper_clear(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_init.c:233:26: */ if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } @@ -62594,19 +64131,19 @@ func init_wrapper_query(tls *libc.TLS, clientData ClientData, interp uintptr, ob var pRet uintptr if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } pRet = tcl.XTcl_NewObj(tls) if wrapped.Fmutex_init != 0 { - tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+27987 /* "mutex" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+28484 /* "mutex" */, -1)) } if wrapped.Fmem_init != 0 { - tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+31383 /* "mem" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+31880 /* "mem" */, -1)) } if wrapped.Fpcache_init != 0 { - tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+31387 /* "pcache" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+31884 /* "pcache" */, -1)) } tcl.XTcl_SetObjResult(tls, interp, pRet) @@ -62630,10 +64167,10 @@ var aObjCmd9 = [4]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 31414 /* "init_wrapper_ins..." */, FxProc: 0}, - {FzName: ts + 31435 /* "init_wrapper_que..." */, FxProc: 0}, - {FzName: ts + 31454 /* "init_wrapper_uni..." */, FxProc: 0}, - {FzName: ts + 31477 /* "init_wrapper_cle..." */, FxProc: 0}, + {FzName: ts + 31911 /* "init_wrapper_ins..." */, FxProc: 0}, + {FzName: ts + 31932 /* "init_wrapper_que..." */, FxProc: 0}, + {FzName: ts + 31951 /* "init_wrapper_uni..." */, FxProc: 0}, + {FzName: ts + 31974 /* "init_wrapper_cle..." */, FxProc: 0}, } /* test_init.c:282:5 */ // @@ -62706,7 +64243,7 @@ func intarrayCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv ui if pVtab != 0 { libc.Xmemset(tls, pVtab, 0, uint64(unsafe.Sizeof(intarray_vtab{}))) (*intarray_vtab)(unsafe.Pointer(pVtab)).FpContent = pAux - rc = sqlite3.Xsqlite3_declare_vtab(tls, db, ts+31496 /* "CREATE TABLE x(v..." */) + rc = sqlite3.Xsqlite3_declare_vtab(tls, db, ts+31993 /* "CREATE TABLE x(v..." */) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pVtab return rc @@ -62816,7 +64353,7 @@ func sqlite3_intarray_create(tls *libc.TLS, db uintptr, zName uintptr, ppReturn *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{intarrayFree}))) if rc == SQLITE_OK { var zSql uintptr - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+31538, /* "CREATE VIRTUAL T..." */ + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+32035, /* "CREATE VIRTUAL T..." */ libc.VaList(bp, zName, zName)) rc = sqlite3.Xsqlite3_exec(tls, db, zSql, uintptr(0), uintptr(0), uintptr(0)) sqlite3.Xsqlite3_free(tls, zSql) @@ -62856,7 +64393,7 @@ func test_intarray_create(tls *libc.TLS, clientData ClientData, interp uintptr, // var zPtr [100]int8 at bp+48, 100 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+32 /* &db */) != 0 { @@ -62887,14 +64424,14 @@ func test_intarray_bind(tls *libc.TLS, clientData ClientData, interp uintptr, ob var a uintptr if objc < 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31576 /* "INTARRAY" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32073 /* "INTARRAY" */) return TCL_ERROR } pArray = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) n = (objc - 2) a = sqlite3.Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(sqlite3_int64(0))) * uint64(n)))) if a == uintptr(0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31585 /* "SQLITE_NOMEM" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+32082 /* "SQLITE_NOMEM" */, uintptr(0))) return TCL_ERROR } for i = 0; i < n; i++ { @@ -62929,8 +64466,8 @@ var aObjCmd10 = [2]struct { FxProc uintptr FclientData uintptr }{ - {FzName: ts + 31598 /* "sqlite3_intarray..." */, FxProc: 0}, - {FzName: ts + 31622 /* "sqlite3_intarray..." */, FxProc: 0}, + {FzName: ts + 32095 /* "sqlite3_intarray..." */, FxProc: 0}, + {FzName: ts + 32119 /* "sqlite3_intarray..." */, FxProc: 0}, } /* test_intarray.c:380:5 */ // Maximum pathname length supported by the jt backend. @@ -62963,7 +64500,7 @@ var jt_vfs = sqlite3_vfs{ FiVersion: 2, // iVersion FszOsFile: int32(unsafe.Sizeof(jt_file{})), // szOsFile FmxPathname: JT_MAX_PATHNAME, // pNext - FzName: ts + 31644, /* "jt" */ // pAppData + FzName: ts + 32141, /* "jt" */ // pAppData FxOpen: 0, // xOpen FxDelete: 0, // xDelete FxAccess: 0, // xAccess @@ -63077,7 +64614,7 @@ func locateDatabaseHandle(tls *libc.TLS, zJournal uintptr, noLock int32) uintptr var pMain uintptr = uintptr(0) enterJtMutex(tls) for pMain = g2.FpList; pMain != 0; pMain = (*jt_file)(unsafe.Pointer(pMain)).FpNext { - var nName int32 = (int32(libc.Xstrlen(tls, zJournal) - libc.Xstrlen(tls, ts+31647 /* "-journal" */))) + var nName int32 = (int32(libc.Xstrlen(tls, zJournal) - libc.Xstrlen(tls, ts+32144 /* "-journal" */))) if (((((*jt_file)(unsafe.Pointer(pMain)).Fflags & SQLITE_OPEN_MAIN_DB) != 0) && (int32(libc.Xstrlen(tls, (*jt_file)(unsafe.Pointer(pMain)).FzName)) == nName)) && (0 == libc.Xmemcmp(tls, (*jt_file)(unsafe.Pointer(pMain)).FzName, zJournal, uint64(nName)))) && @@ -63542,7 +65079,7 @@ func jtOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int // returning. func jtDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test_journal.c:733:12: */ var nPath int32 = int32(libc.Xstrlen(tls, zPath)) - if (nPath > 8) && (0 == libc.Xstrcmp(tls, ts+31647 /* "-journal" */, (zPath+uintptr((nPath-8))))) { + if (nPath > 8) && (0 == libc.Xstrcmp(tls, ts+32144 /* "-journal" */, (zPath+uintptr((nPath-8))))) { // Deleting a journal file. The end of a transaction. var pMain uintptr = locateDatabaseHandle(tls, zPath, 0) if pMain != 0 { @@ -64033,7 +65570,7 @@ func pointerToText(tls *libc.TLS, p uintptr, z uintptr) { /* test_malloc.c:239:1 // var n sqlite3_uint64 at bp, 8 if *(*uintptr)(unsafe.Pointer(bp + 8 /* p */)) == uintptr(0) { - libc.Xstrcpy(tls, z, ts+13695 /* "0" */) + libc.Xstrcpy(tls, z, ts+13875 /* "0" */) return } if uint64(unsafe.Sizeof(sqlite3_uint64(0))) == uint64(unsafe.Sizeof(uintptr(0))) { @@ -64066,7 +65603,7 @@ __3: *(*int8)(unsafe.Pointer(z + 16)) = int8(0) } -var zHex = *(*[17]int8)(unsafe.Pointer(ts + 30030 /* "0123456789abcdef" */)) /* test_malloc.c:240:21 */ +var zHex = *(*[17]int8)(unsafe.Pointer(ts + 30527 /* "0123456789abcdef" */)) /* test_malloc.c:240:21 */ func hexToInt(tls *libc.TLS, h int32) int32 { /* test_malloc.c:262:12: */ if (h >= '0') && (h <= '9') { @@ -64122,7 +65659,7 @@ func test_malloc(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // var zOut [100]int8 at bp+20, 100 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31656 /* "NBYTES" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32153 /* "NBYTES" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16 /* &nByte */) != 0 { @@ -64149,14 +65686,14 @@ func test_realloc(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // var zOut [100]int8 at bp+56, 100 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31663 /* "PRIOR NBYTES" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32160 /* "PRIOR NBYTES" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+40 /* &nByte */) != 0 { return TCL_ERROR } if textToPointer(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+48 /* &pPrior */) != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31676 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+32173 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0))) return TCL_ERROR } p = sqlite3.Xsqlite3_realloc(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* pPrior */)), int32(uint32(*(*int32)(unsafe.Pointer(bp + 40 /* nByte */))))) @@ -64175,11 +65712,11 @@ func test_free(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, ob // var pPrior uintptr at bp+24, 8 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31690 /* "PRIOR" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32187 /* "PRIOR" */) return TCL_ERROR } if textToPointer(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+24 /* &pPrior */) != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31676 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+32173 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0))) return TCL_ERROR } sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPrior */))) @@ -64206,18 +65743,18 @@ func test_memset(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // var zBin [100]int8 at bp+72, 100 if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31696 /* "ADDRESS SIZE HEX" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32193 /* "ADDRESS SIZE HEX" */) return TCL_ERROR } if textToPointer(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+56 /* &p */) != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31676 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+32173 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0))) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+64 /* &size */) != 0 { return TCL_ERROR } if *(*int32)(unsafe.Pointer(bp + 64 /* size */)) <= 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+31713 /* "size must be pos..." */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+32210 /* "size must be pos..." */, uintptr(0))) return TCL_ERROR } zHex = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+68 /* &n */) @@ -64226,7 +65763,7 @@ func test_memset(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, } *(*int32)(unsafe.Pointer(bp + 68 /* n */)) = sqlite3TestHexToBin(tls, zHex, *(*int32)(unsafe.Pointer(bp + 68 /* n */)), bp+72 /* &zBin[0] */) if *(*int32)(unsafe.Pointer(bp + 68 /* n */)) == 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, ts+31735 /* "no data" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, ts+32232 /* "no data" */, uintptr(0))) return TCL_ERROR } zOut = *(*uintptr)(unsafe.Pointer(bp + 56 /* p */)) @@ -64252,18 +65789,18 @@ func test_memget(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // var zHex [100]int8 at bp+68, 100 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31743 /* "ADDRESS SIZE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32240 /* "ADDRESS SIZE" */) return TCL_ERROR } if textToPointer(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+56 /* &p */) != 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31676 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+32173 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), uintptr(0))) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+64 /* &size */) != 0 { return TCL_ERROR } if *(*int32)(unsafe.Pointer(bp + 64 /* size */)) <= 0 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+31713 /* "size must be pos..." */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+32210 /* "size must be pos..." */, uintptr(0))) return TCL_ERROR } zBin = *(*uintptr)(unsafe.Pointer(bp + 56 /* p */)) @@ -64299,7 +65836,7 @@ func test_memory_highwater(tls *libc.TLS, clientData uintptr, interp uintptr, ob *(*int32)(unsafe.Pointer(bp /* resetFlag */)) = 0 if (objc != 1) && (objc != 2) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31756 /* "?RESET?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32253 /* "?RESET?" */) return TCL_ERROR } if objc == 2 { @@ -64323,7 +65860,7 @@ func test_memdebug_backtrace(tls *libc.TLS, clientData uintptr, interp uintptr, // var depth int32 at bp, 4 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31764 /* "DEPT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32261 /* "DEPT" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &depth */) != 0 { @@ -64337,7 +65874,7 @@ func test_memdebug_backtrace(tls *libc.TLS, clientData uintptr, interp uintptr, // Write a summary of unfreed memory to FILENAME. func test_memdebug_dump(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:542:26: */ if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31769 /* "FILENAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32266 /* "FILENAME" */) return TCL_ERROR } return TCL_OK @@ -64349,7 +65886,7 @@ func test_memdebug_dump(tls *libc.TLS, clientData uintptr, interp uintptr, objc func test_memdebug_malloc_count(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:567:26: */ var nMalloc int32 = -1 if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, nMalloc)) @@ -64385,7 +65922,7 @@ func test_memdebug_fail(tls *libc.TLS, clientData uintptr, interp uintptr, objc var nFail int32 = 0 if objc < 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31778 /* "COUNTER ?OPTIONS..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32275 /* "COUNTER ?OPTIONS..." */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+24 /* &iFail */) != 0 { @@ -64398,22 +65935,22 @@ func test_memdebug_fail(tls *libc.TLS, clientData uintptr, interp uintptr, objc var zOption uintptr = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(ii)*8)), bp+28 /* &nOption */) var zErr uintptr = uintptr(0) - if (*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)) > 1) && (libc.Xstrncmp(tls, zOption, ts+31796 /* "-repeat" */, uint64(*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)))) == 0) { + if (*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)) > 1) && (libc.Xstrncmp(tls, zOption, ts+32293 /* "-repeat" */, uint64(*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)))) == 0) { if ii == (objc - 1) { - zErr = ts + 12149 /* "option requires ..." */ + zErr = ts + 12329 /* "option requires ..." */ } else { if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((ii+1))*8)), bp+32 /* &nRepeat */) != 0 { return TCL_ERROR } } - } else if (*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)) > 1) && (libc.Xstrncmp(tls, zOption, ts+31804 /* "-benigncnt" */, uint64(*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)))) == 0) { + } else if (*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)) > 1) && (libc.Xstrncmp(tls, zOption, ts+32301 /* "-benigncnt" */, uint64(*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)))) == 0) { if ii == (objc - 1) { - zErr = ts + 12149 /* "option requires ..." */ + zErr = ts + 12329 /* "option requires ..." */ } else { pBenignCnt = *(*uintptr)(unsafe.Pointer(objv + uintptr((ii+1))*8)) } } else { - zErr = ts + 11955 /* "unknown option: " */ + zErr = ts + 12135 /* "unknown option: " */ } if zErr != 0 { @@ -64441,7 +65978,7 @@ func test_memdebug_fail(tls *libc.TLS, clientData uintptr, interp uintptr, objc func test_memdebug_pending(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:673:26: */ var nPending int32 if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } nPending = faultsimPending(tls) @@ -64465,7 +66002,7 @@ var sqlite3_memdebug_title_count int32 = 0 /* test_malloc.c:694:12 */ func test_memdebug_settitle(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:706:26: */ sqlite3_memdebug_title_count++ if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31815 /* "TITLE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32312 /* "TITLE" */) return TCL_ERROR } return TCL_OK @@ -64518,9 +66055,9 @@ func test_memdebug_log(tls *libc.TLS, clientData uintptr, interp uintptr, objc i } if objc < 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31821 /* "SUB-COMMAND ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32318 /* "SUB-COMMAND ..." */) } - if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&MB_strs)), int32(unsafe.Sizeof(uintptr(0))), ts+1874 /* "sub-command" */, 0, bp /* &iSub */) != 0 { + if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&MB_strs)), int32(unsafe.Sizeof(uintptr(0))), ts+1875 /* "sub-command" */, 0, bp /* &iSub */) != 0 { return TCL_ERROR } @@ -64582,7 +66119,7 @@ func test_memdebug_log(tls *libc.TLS, clientData uintptr, interp uintptr, objc i } var isInit int32 = 0 /* test_malloc.c:793:14 */ -var MB_strs = [5]uintptr{ts + 31837 /* "start" */, ts + 31843 /* "stop" */, ts + 31848 /* "dump" */, ts + 31853 /* "clear" */, ts + 31859 /* "sync" */} /* test_malloc.c:796:21 */ +var MB_strs = [5]uintptr{ts + 32334 /* "start" */, ts + 32340 /* "stop" */, ts + 32345 /* "dump" */, ts + 32350 /* "clear" */, ts + 32356 /* "sync" */} /* test_malloc.c:796:21 */ // Usage: sqlite3_config_pagecache SIZE N // @@ -64602,7 +66139,7 @@ func test_config_pagecache(tls *libc.TLS, clientData uintptr, interp uintptr, ob var pRes uintptr if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31864 /* "SIZE N" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32361 /* "SIZE N" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+48 /* &sz */) != 0 { @@ -64650,7 +66187,7 @@ func test_alt_pcache(tls *libc.TLS, clientData uintptr, interp uintptr, objc int *(*int32)(unsafe.Pointer(bp + 28 /* highStress */)) = 0 if (objc < 2) || (objc > 5) { tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, - ts+31871 /* "INSTALLFLAG DISC..." */) + ts+32368 /* "INSTALLFLAG DISC..." */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16 /* &installFlag */) != 0 { @@ -64666,7 +66203,7 @@ func test_alt_pcache(tls *libc.TLS, clientData uintptr, interp uintptr, objc int return TCL_ERROR } if (*(*int32)(unsafe.Pointer(bp + 20 /* discardChance */)) < 0) || (*(*int32)(unsafe.Pointer(bp + 20 /* discardChance */)) > 100) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31918, /* "discard-chance s..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+32415, /* "discard-chance s..." */ uintptr(0))) return TCL_ERROR } @@ -64686,7 +66223,7 @@ func test_config_memstatus(tls *libc.TLS, clientData uintptr, interp uintptr, ob var rc int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17539 /* "BOOLEAN" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17888 /* "BOOLEAN" */) return TCL_ERROR } if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8 /* &enable */) != 0 { @@ -64709,7 +66246,7 @@ func test_config_lookaside(tls *libc.TLS, clientData uintptr, interp uintptr, ob var pRet uintptr if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31961 /* "SIZE COUNT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32458 /* "SIZE COUNT" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16 /* &sz */) != 0 { @@ -64747,7 +66284,7 @@ func test_db_config_lookaside(tls *libc.TLS, clientData uintptr, interp uintptr, // var bufid int32 at bp+72, 4 if objc != 5 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31972 /* "BUFID SIZE COUNT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32469 /* "BUFID SIZE COUNT" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+64 /* &db */) != 0 { @@ -64767,7 +66304,7 @@ func test_db_config_lookaside(tls *libc.TLS, clientData uintptr, interp uintptr, } else if ((*(*int32)(unsafe.Pointer(bp + 72 /* bufid */)) >= 1) && (*(*int32)(unsafe.Pointer(bp + 72 /* bufid */)) <= 2)) && ((uint64(*(*int32)(unsafe.Pointer(bp + 76 /* sz */)) * *(*int32)(unsafe.Pointer(bp + 80 /* cnt */)))) <= uint64(unsafe.Sizeof([10000]int8{}))) { rc = sqlite3.Xsqlite3_db_config(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* db */)), SQLITE_DBCONFIG_LOOKASIDE, libc.VaList(bp+24, (uintptr(unsafe.Pointer(&azBuf))+uintptr(*(*int32)(unsafe.Pointer(bp + 72 /* bufid */)))*10000), *(*int32)(unsafe.Pointer(bp + 76 /* sz */)), *(*int32)(unsafe.Pointer(bp + 80 /* cnt */)))) } else { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+31989 /* "illegal argument..." */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+32486 /* "illegal argument..." */, uintptr(0))) return TCL_ERROR } tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, rc)) @@ -64791,7 +66328,7 @@ func test_config_heap(tls *libc.TLS, clientData uintptr, interp uintptr, objc in var nArg int32 = (objc - 1) if nArg != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32027 /* "NBYTE NMINALLOC" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32524 /* "NBYTE NMINALLOC" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(aArg)), bp+48 /* &nByte */) != 0 { @@ -64829,7 +66366,7 @@ func test_config_heap_size(tls *libc.TLS, clientData uintptr, interp uintptr, ob var nArg int32 = (objc - 1) if nArg != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15722 /* "NBYTE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15902 /* "NBYTE" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(aArg)), bp+8 /* &nByte */) != 0 { @@ -64853,7 +66390,7 @@ func test_config_error(tls *libc.TLS, clientData uintptr, interp uintptr, objc i // var db uintptr at bp+32, 8 if (objc != 2) && (objc != 1) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32043 /* "[DB]" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32540 /* "[DB]" */) return TCL_ERROR } if objc == 2 { @@ -64862,14 +66399,14 @@ func test_config_error(tls *libc.TLS, clientData uintptr, interp uintptr, objc i } if sqlite3.Xsqlite3_db_config(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), 99999, 0) != SQLITE_ERROR { tcl.XTcl_AppendResult(tls, interp, - libc.VaList(bp, ts+32048, /* "sqlite3_db_confi..." */ + libc.VaList(bp, ts+32545, /* "sqlite3_db_confi..." */ uintptr(0))) return TCL_ERROR } } else { if sqlite3.Xsqlite3_config(tls, 99999, 0) != SQLITE_ERROR { tcl.XTcl_AppendResult(tls, interp, - libc.VaList(bp+16, ts+32106, /* "sqlite3_config(9..." */ + libc.VaList(bp+16, ts+32603, /* "sqlite3_config(9..." */ uintptr(0))) return TCL_ERROR } @@ -64889,7 +66426,7 @@ func test_config_uri(tls *libc.TLS, clientData uintptr, interp uintptr, objc int // var bOpenUri int32 at bp+8, 4 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18252 /* "BOOL" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18611 /* "BOOL" */) return TCL_ERROR } if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8 /* &bOpenUri */) != 0 { @@ -64914,7 +66451,7 @@ func test_config_cis(tls *libc.TLS, clientData uintptr, interp uintptr, objc int // var bUseCis int32 at bp+8, 4 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18252 /* "BOOL" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18611 /* "BOOL" */) return TCL_ERROR } if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8 /* &bUseCis */) != 0 { @@ -64938,7 +66475,7 @@ func test_config_pmasz(tls *libc.TLS, clientData uintptr, interp uintptr, objc i // var iPmaSz int32 at bp+8, 4 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18252 /* "BOOL" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18611 /* "BOOL" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8 /* &iPmaSz */) != 0 { @@ -64957,7 +66494,7 @@ func test_config_pmasz(tls *libc.TLS, clientData uintptr, interp uintptr, objc i // Write a summary of unfreed memsys3 allocations to FILENAME. func test_dump_memsys3(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1251:26: */ if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31769 /* "FILENAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32266 /* "FILENAME" */) return TCL_ERROR } @@ -64995,7 +66532,7 @@ func test_status(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, var zOpName uintptr var pResult uintptr if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32157 /* "PARAMETER RESETF..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32654 /* "PARAMETER RESETF..." */) return TCL_ERROR } zOpName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -65037,16 +66574,16 @@ var aOp1 = [10]struct { Fop int32 _ [4]byte }{ - {FzName: ts + 32177 /* "SQLITE_STATUS_ME..." */}, - {FzName: ts + 32203 /* "SQLITE_STATUS_MA..." */, Fop: SQLITE_STATUS_MALLOC_SIZE}, - {FzName: ts + 32229 /* "SQLITE_STATUS_PA..." */, Fop: SQLITE_STATUS_PAGECACHE_USED}, - {FzName: ts + 32258 /* "SQLITE_STATUS_PA..." */, Fop: SQLITE_STATUS_PAGECACHE_OVERFLOW}, - {FzName: ts + 32291 /* "SQLITE_STATUS_PA..." */, Fop: SQLITE_STATUS_PAGECACHE_SIZE}, - {FzName: ts + 32320 /* "SQLITE_STATUS_SC..." */, Fop: SQLITE_STATUS_SCRATCH_USED}, - {FzName: ts + 32347 /* "SQLITE_STATUS_SC..." */, Fop: SQLITE_STATUS_SCRATCH_OVERFLOW}, - {FzName: ts + 32378 /* "SQLITE_STATUS_SC..." */, Fop: SQLITE_STATUS_SCRATCH_SIZE}, - {FzName: ts + 32405 /* "SQLITE_STATUS_PA..." */, Fop: SQLITE_STATUS_PARSER_STACK}, - {FzName: ts + 32432 /* "SQLITE_STATUS_MA..." */, Fop: SQLITE_STATUS_MALLOC_COUNT}, + {FzName: ts + 32674 /* "SQLITE_STATUS_ME..." */}, + {FzName: ts + 32700 /* "SQLITE_STATUS_MA..." */, Fop: SQLITE_STATUS_MALLOC_SIZE}, + {FzName: ts + 32726 /* "SQLITE_STATUS_PA..." */, Fop: SQLITE_STATUS_PAGECACHE_USED}, + {FzName: ts + 32755 /* "SQLITE_STATUS_PA..." */, Fop: SQLITE_STATUS_PAGECACHE_OVERFLOW}, + {FzName: ts + 32788 /* "SQLITE_STATUS_PA..." */, Fop: SQLITE_STATUS_PAGECACHE_SIZE}, + {FzName: ts + 32817 /* "SQLITE_STATUS_SC..." */, Fop: SQLITE_STATUS_SCRATCH_USED}, + {FzName: ts + 32844 /* "SQLITE_STATUS_SC..." */, Fop: SQLITE_STATUS_SCRATCH_OVERFLOW}, + {FzName: ts + 32875 /* "SQLITE_STATUS_SC..." */, Fop: SQLITE_STATUS_SCRATCH_SIZE}, + {FzName: ts + 32902 /* "SQLITE_STATUS_PA..." */, Fop: SQLITE_STATUS_PARSER_STACK}, + {FzName: ts + 32929 /* "SQLITE_STATUS_MA..." */, Fop: SQLITE_STATUS_MALLOC_COUNT}, } /* test_malloc.c:1299:5 */ // Usage: sqlite3_db_status DATABASE OPCODE RESETFLAG @@ -65071,17 +66608,17 @@ func test_db_status(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 var pResult uintptr if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32459 /* "DB PARAMETER RES..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32956 /* "DB PARAMETER RES..." */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { return TCL_ERROR } zOpName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) - if libc.Xmemcmp(tls, zOpName, ts+32482 /* "SQLITE_" */, uint64(7)) == 0 { + if libc.Xmemcmp(tls, zOpName, ts+32979 /* "SQLITE_" */, uint64(7)) == 0 { zOpName += uintptr(7) } - if libc.Xmemcmp(tls, zOpName, ts+32490 /* "DBSTATUS_" */, uint64(9)) == 0 { + if libc.Xmemcmp(tls, zOpName, ts+32987 /* "DBSTATUS_" */, uint64(9)) == 0 { zOpName += uintptr(9) } for i = 0; i < (int32(uint64(unsafe.Sizeof(aOp2)) / uint64(unsafe.Sizeof(struct { @@ -65122,19 +66659,19 @@ var aOp2 = [13]struct { Fop int32 _ [4]byte }{ - {FzName: ts + 32500 /* "LOOKASIDE_USED" */}, - {FzName: ts + 32515 /* "CACHE_USED" */, Fop: SQLITE_DBSTATUS_CACHE_USED}, - {FzName: ts + 32526 /* "SCHEMA_USED" */, Fop: SQLITE_DBSTATUS_SCHEMA_USED}, - {FzName: ts + 32538 /* "STMT_USED" */, Fop: SQLITE_DBSTATUS_STMT_USED}, - {FzName: ts + 32548 /* "LOOKASIDE_HIT" */, Fop: SQLITE_DBSTATUS_LOOKASIDE_HIT}, - {FzName: ts + 32562 /* "LOOKASIDE_MISS_S..." */, Fop: SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE}, - {FzName: ts + 32582 /* "LOOKASIDE_MISS_F..." */, Fop: SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL}, - {FzName: ts + 32602 /* "CACHE_HIT" */, Fop: SQLITE_DBSTATUS_CACHE_HIT}, - {FzName: ts + 32612 /* "CACHE_MISS" */, Fop: SQLITE_DBSTATUS_CACHE_MISS}, - {FzName: ts + 32623 /* "CACHE_WRITE" */, Fop: SQLITE_DBSTATUS_CACHE_WRITE}, - {FzName: ts + 32635 /* "DEFERRED_FKS" */, Fop: SQLITE_DBSTATUS_DEFERRED_FKS}, - {FzName: ts + 32648 /* "CACHE_USED_SHARE..." */, Fop: SQLITE_DBSTATUS_CACHE_USED_SHARED}, - {FzName: ts + 32666 /* "CACHE_SPILL" */, Fop: SQLITE_DBSTATUS_CACHE_SPILL}, + {FzName: ts + 32997 /* "LOOKASIDE_USED" */}, + {FzName: ts + 33012 /* "CACHE_USED" */, Fop: SQLITE_DBSTATUS_CACHE_USED}, + {FzName: ts + 33023 /* "SCHEMA_USED" */, Fop: SQLITE_DBSTATUS_SCHEMA_USED}, + {FzName: ts + 33035 /* "STMT_USED" */, Fop: SQLITE_DBSTATUS_STMT_USED}, + {FzName: ts + 33045 /* "LOOKASIDE_HIT" */, Fop: SQLITE_DBSTATUS_LOOKASIDE_HIT}, + {FzName: ts + 33059 /* "LOOKASIDE_MISS_S..." */, Fop: SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE}, + {FzName: ts + 33079 /* "LOOKASIDE_MISS_F..." */, Fop: SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL}, + {FzName: ts + 33099 /* "CACHE_HIT" */, Fop: SQLITE_DBSTATUS_CACHE_HIT}, + {FzName: ts + 33109 /* "CACHE_MISS" */, Fop: SQLITE_DBSTATUS_CACHE_MISS}, + {FzName: ts + 33120 /* "CACHE_WRITE" */, Fop: SQLITE_DBSTATUS_CACHE_WRITE}, + {FzName: ts + 33132 /* "DEFERRED_FKS" */, Fop: SQLITE_DBSTATUS_DEFERRED_FKS}, + {FzName: ts + 33145 /* "CACHE_USED_SHARE..." */, Fop: SQLITE_DBSTATUS_CACHE_USED_SHARED}, + {FzName: ts + 33163 /* "CACHE_SPILL" */, Fop: SQLITE_DBSTATUS_CACHE_SPILL}, } /* test_malloc.c:1358:5 */ // install_malloc_faultsim BOOLEAN @@ -65146,7 +66683,7 @@ func test_install_malloc_faultsim(tls *libc.TLS, clientData uintptr, interp uint // var isInstall int32 at bp, 4 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17539 /* "BOOLEAN" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17888 /* "BOOLEAN" */) return TCL_ERROR } if TCL_OK != tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &isInstall */) { @@ -65169,7 +66706,7 @@ func test_vfs_oom_test(tls *libc.TLS, clientData uintptr, interp uintptr, objc i defer tls.Free(4) if objc > 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32678 /* "?INTEGER?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+33175 /* "?INTEGER?" */) return TCL_ERROR } else if objc == 2 { // var iNew int32 at bp, 4 @@ -65204,38 +66741,38 @@ var aObjCmd11 = [32]struct { FclientData int32 _ [4]byte }{ - {FzName: ts + 27048 /* "sqlite3_malloc" */, FxProc: 0}, - {FzName: ts + 27063 /* "sqlite3_realloc" */, FxProc: 0}, - {FzName: ts + 32688 /* "sqlite3_free" */, FxProc: 0}, - {FzName: ts + 32701 /* "memset" */, FxProc: 0}, - {FzName: ts + 32708 /* "memget" */, FxProc: 0}, - {FzName: ts + 32715 /* "sqlite3_memory_u..." */, FxProc: 0}, - {FzName: ts + 32735 /* "sqlite3_memory_h..." */, FxProc: 0}, - {FzName: ts + 32760 /* "sqlite3_memdebug..." */, FxProc: 0}, - {FzName: ts + 32787 /* "sqlite3_memdebug..." */, FxProc: 0}, - {FzName: ts + 32809 /* "sqlite3_memdebug..." */, FxProc: 0}, - {FzName: ts + 32831 /* "sqlite3_memdebug..." */, FxProc: 0}, - {FzName: ts + 32856 /* "sqlite3_memdebug..." */, FxProc: 0}, - {FzName: ts + 32882 /* "sqlite3_memdebug..." */, FxProc: 0}, - {FzName: ts + 32912 /* "sqlite3_memdebug..." */, FxProc: 0}, - {FzName: ts + 32933 /* "sqlite3_config_p..." */, FxProc: 0}, - {FzName: ts + 32958 /* "sqlite3_config_a..." */, FxProc: 0}, - {FzName: ts + 32984 /* "sqlite3_status" */, FxProc: 0}, - {FzName: ts + 32999 /* "sqlite3_db_statu..." */, FxProc: 0}, - {FzName: ts + 33017 /* "install_malloc_f..." */, FxProc: 0}, - {FzName: ts + 33041 /* "sqlite3_config_h..." */, FxProc: 0}, - {FzName: ts + 33061 /* "sqlite3_config_h..." */, FxProc: 0}, - {FzName: ts + 33086 /* "sqlite3_config_m..." */, FxProc: 0}, - {FzName: ts + 33111 /* "sqlite3_config_l..." */, FxProc: 0}, - {FzName: ts + 33136 /* "sqlite3_config_e..." */, FxProc: 0}, - {FzName: ts + 33157 /* "sqlite3_config_u..." */, FxProc: 0}, - {FzName: ts + 33176 /* "sqlite3_config_c..." */, FxProc: 0}, - {FzName: ts + 33195 /* "sqlite3_config_p..." */, FxProc: 0}, - {FzName: ts + 33216 /* "sqlite3_db_confi..." */, FxProc: 0}, - {FzName: ts + 33244 /* "sqlite3_dump_mem..." */, FxProc: 0, FclientData: 3}, - {FzName: ts + 33265 /* "sqlite3_dump_mem..." */, FxProc: 0, FclientData: 5}, - {FzName: ts + 33286 /* "sqlite3_install_..." */, FxProc: 0}, - {FzName: ts + 33310 /* "sqlite3_memdebug..." */, FxProc: 0}, + {FzName: ts + 27537 /* "sqlite3_malloc" */, FxProc: 0}, + {FzName: ts + 27552 /* "sqlite3_realloc" */, FxProc: 0}, + {FzName: ts + 33185 /* "sqlite3_free" */, FxProc: 0}, + {FzName: ts + 33198 /* "memset" */, FxProc: 0}, + {FzName: ts + 33205 /* "memget" */, FxProc: 0}, + {FzName: ts + 33212 /* "sqlite3_memory_u..." */, FxProc: 0}, + {FzName: ts + 33232 /* "sqlite3_memory_h..." */, FxProc: 0}, + {FzName: ts + 33257 /* "sqlite3_memdebug..." */, FxProc: 0}, + {FzName: ts + 33284 /* "sqlite3_memdebug..." */, FxProc: 0}, + {FzName: ts + 33306 /* "sqlite3_memdebug..." */, FxProc: 0}, + {FzName: ts + 33328 /* "sqlite3_memdebug..." */, FxProc: 0}, + {FzName: ts + 33353 /* "sqlite3_memdebug..." */, FxProc: 0}, + {FzName: ts + 33379 /* "sqlite3_memdebug..." */, FxProc: 0}, + {FzName: ts + 33409 /* "sqlite3_memdebug..." */, FxProc: 0}, + {FzName: ts + 33430 /* "sqlite3_config_p..." */, FxProc: 0}, + {FzName: ts + 33455 /* "sqlite3_config_a..." */, FxProc: 0}, + {FzName: ts + 33481 /* "sqlite3_status" */, FxProc: 0}, + {FzName: ts + 33496 /* "sqlite3_db_statu..." */, FxProc: 0}, + {FzName: ts + 33514 /* "install_malloc_f..." */, FxProc: 0}, + {FzName: ts + 33538 /* "sqlite3_config_h..." */, FxProc: 0}, + {FzName: ts + 33558 /* "sqlite3_config_h..." */, FxProc: 0}, + {FzName: ts + 33583 /* "sqlite3_config_m..." */, FxProc: 0}, + {FzName: ts + 33608 /* "sqlite3_config_l..." */, FxProc: 0}, + {FzName: ts + 33633 /* "sqlite3_config_e..." */, FxProc: 0}, + {FzName: ts + 33654 /* "sqlite3_config_u..." */, FxProc: 0}, + {FzName: ts + 33673 /* "sqlite3_config_c..." */, FxProc: 0}, + {FzName: ts + 33692 /* "sqlite3_config_p..." */, FxProc: 0}, + {FzName: ts + 33713 /* "sqlite3_db_confi..." */, FxProc: 0}, + {FzName: ts + 33741 /* "sqlite3_dump_mem..." */, FxProc: 0, FclientData: 3}, + {FzName: ts + 33762 /* "sqlite3_dump_mem..." */, FxProc: 0, FclientData: 5}, + {FzName: ts + 33783 /* "sqlite3_install_..." */, FxProc: 0}, + {FzName: ts + 33807 /* "sqlite3_memdebug..." */, FxProc: 0}, } /* test_malloc.c:1472:5 */ // Some versions of define this macros. @@ -65627,7 +67164,7 @@ func MD5DigestToBase16(tls *libc.TLS, digest uintptr, zBuf uintptr) { /* test_md *(*int8)(unsafe.Pointer(zBuf + uintptr(j))) = int8(0) } -var zEncode = *(*[17]int8)(unsafe.Pointer(ts + 30030 /* "0123456789abcdef" */)) /* test_md5.c:285:21 */ +var zEncode = *(*[17]int8)(unsafe.Pointer(ts + 30527 /* "0123456789abcdef" */)) /* test_md5.c:285:21 */ // Convert a 128-bit MD5 digest into sequency of eight 5-digit integers // each representing 16 bits of the digest and separated from each @@ -65644,7 +67181,7 @@ func MD5DigestToBase10x8(tls *libc.TLS, digest uintptr, zDigest uintptr) { /* te if i > 0 { *(*int8)(unsafe.Pointer(zDigest + uintptr(libc.PostIncInt32(&j, 1)))) = int8('-') } - sqlite3.Xsqlite3_snprintf(tls, (50 - j), (zDigest + uintptr(j)), ts+33340 /* "%05u" */, libc.VaList(bp, x)) + sqlite3.Xsqlite3_snprintf(tls, (50 - j), (zDigest + uintptr(j)), ts+33837 /* "%05u" */, libc.VaList(bp, x)) j = j + (5) } *(*int8)(unsafe.Pointer(zDigest + uintptr(j))) = int8(0) @@ -65665,8 +67202,8 @@ func md5_cmd(tls *libc.TLS, cd uintptr, interp uintptr, argc int32, argv uintptr var converter uintptr if argc != 2 { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+14814 /* " TEXT\"" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+14994 /* " TEXT\"" */, uintptr(0))) return TCL_ERROR } MD5Init(tls, bp+48 /* &ctx */) @@ -65695,8 +67232,8 @@ func md5file_cmd(tls *libc.TLS, cd uintptr, interp uintptr, argc int32, argv uin // var zBuf [10240]int8 at bp+172, 10240 if (argc != 2) && (argc != 4) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), - ts+33345 /* " FILENAME [OFFSE..." */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv)), + ts+33842 /* " FILENAME [OFFSE..." */, uintptr(0))) return TCL_ERROR } if argc == 4 { @@ -65706,10 +67243,10 @@ func md5file_cmd(tls *libc.TLS, cd uintptr, interp uintptr, argc int32, argv uin ofst = 0 amt = 2147483647 } - in = libc.Xfopen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+4086 /* "rb" */) + in = libc.Xfopen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+4273 /* "rb" */) if in == uintptr(0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+33369 /* "unable to open f..." */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), - ts+33391 /* "\" for reading" */, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+33866 /* "unable to open f..." */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), + ts+33888 /* "\" for reading" */, uintptr(0))) return TCL_ERROR } libc.Xfseek(tls, in, int64(ofst), SEEK_SET) @@ -65739,25 +67276,25 @@ func md5file_cmd(tls *libc.TLS, cd uintptr, interp uintptr, argc int32, argv uin // Register the four new TCL commands for generating MD5 checksums // with the TCL interpreter. func Md5_Init(tls *libc.TLS, interp uintptr) int32 { /* test_md5.c:400:5: */ - tcl.XTcl_CreateCommand(tls, interp, ts+33405 /* "md5" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateCommand(tls, interp, ts+33902 /* "md5" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{md5_cmd})), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) }{MD5DigestToBase16})), uintptr(0)) - tcl.XTcl_CreateCommand(tls, interp, ts+33409 /* "md5-10x8" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateCommand(tls, interp, ts+33906 /* "md5-10x8" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{md5_cmd})), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) }{MD5DigestToBase10x8})), uintptr(0)) - tcl.XTcl_CreateCommand(tls, interp, ts+33418 /* "md5file" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateCommand(tls, interp, ts+33915 /* "md5file" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{md5file_cmd})), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) }{MD5DigestToBase16})), uintptr(0)) - tcl.XTcl_CreateCommand(tls, interp, ts+33426 /* "md5file-10x8" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateCommand(tls, interp, ts+33923 /* "md5file-10x8" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{md5file_cmd})), *(*uintptr)(unsafe.Pointer(&struct { @@ -65805,11 +67342,11 @@ func md5finalize(tls *libc.TLS, context uintptr) { /* test_md5.c:432:13: */ } func Md5_Register(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pThunk uintptr) int32 { /* test_md5.c:441:5: */ - var rc int32 = sqlite3.Xsqlite3_create_function(tls, db, ts+33439 /* "md5sum" */, -1, SQLITE_UTF8, uintptr(0), uintptr(0), + var rc int32 = sqlite3.Xsqlite3_create_function(tls, db, ts+33936 /* "md5sum" */, -1, SQLITE_UTF8, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{md5step})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{md5finalize}))) - sqlite3.Xsqlite3_overload_function(tls, db, ts+33439 /* "md5sum" */, -1) // To exercise this API + sqlite3.Xsqlite3_overload_function(tls, db, ts+33936 /* "md5sum" */, -1) // To exercise this API return rc } @@ -65979,7 +67516,7 @@ func multiplexFilename(tls *libc.TLS, zBase uintptr, nBase int32, flags int32, i var n int32 = nBase libc.Xmemcpy(tls, zOut, zBase, (uint64(n + 1))) if (iChunk != 0) && (iChunk <= MX_CHUNK_NUMBER) { - sqlite3.Xsqlite3_snprintf(tls, 4, (zOut + uintptr(n)), ts+33446 /* "%03d" */, libc.VaList(bp, iChunk)) + sqlite3.Xsqlite3_snprintf(tls, 4, (zOut + uintptr(n)), ts+33943 /* "%03d" */, libc.VaList(bp, iChunk)) n = n + (3) } @@ -66006,7 +67543,7 @@ func multiplexSubFilename(tls *libc.TLS, pGroup uintptr, iChunk int32) int32 { / return SQLITE_NOMEM } multiplexFilename(tls, (*multiplexGroup)(unsafe.Pointer(pGroup)).FzName, (*multiplexGroup)(unsafe.Pointer(pGroup)).FnName, (*multiplexGroup)(unsafe.Pointer(pGroup)).Fflags, iChunk, z) - (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal + uintptr(iChunk)*16)).Fz = sqlite3.Xsqlite3_create_filename(tls, z, ts+488 /* "" */, ts+488 /* "" */, 0, uintptr(0)) + (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal + uintptr(iChunk)*16)).Fz = sqlite3.Xsqlite3_create_filename(tls, z, ts+489 /* "" */, ts+489 /* "" */, 0, uintptr(0)) sqlite3.Xsqlite3_free(tls, z) if (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz == uintptr(0) { return SQLITE_NOMEM @@ -66045,7 +67582,7 @@ func multiplexSubOpen(tls *libc.TLS, pGroup uintptr, iChunk int32, rc uintptr, p SQLITE_ACCESS_EXISTS, bp+16 /* &bExists */) if (*(*int32)(unsafe.Pointer(rc)) != 0) || !(*(*int32)(unsafe.Pointer(bp + 16 /* bExists */)) != 0) { if *(*int32)(unsafe.Pointer(rc)) != 0 { - sqlite3.Xsqlite3_log(tls, *(*int32)(unsafe.Pointer(rc)), ts+33451, /* "multiplexor.xAcc..." */ + sqlite3.Xsqlite3_log(tls, *(*int32)(unsafe.Pointer(rc)), ts+33948, /* "multiplexor.xAcc..." */ libc.VaList(bp, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz)) } return uintptr(0) @@ -66061,7 +67598,7 @@ func multiplexSubOpen(tls *libc.TLS, pGroup uintptr, iChunk int32, rc uintptr, p *(*int32)(unsafe.Pointer(rc)) = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 40 /* &.xOpen */))))(tls, pOrigVfs, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz, pSubOpen, flags, pOutFlags) if (*(*int32)(unsafe.Pointer(rc))) != SQLITE_OK { - sqlite3.Xsqlite3_log(tls, *(*int32)(unsafe.Pointer(rc)), ts+33485, /* "multiplexor.xOpe..." */ + sqlite3.Xsqlite3_log(tls, *(*int32)(unsafe.Pointer(rc)), ts+33982, /* "multiplexor.xOpe..." */ libc.VaList(bp+8, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz)) sqlite3.Xsqlite3_free(tls, pSubOpen) (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal + uintptr(iChunk)*16)).Fp = uintptr(0) @@ -66137,7 +67674,7 @@ func multiplexControlFunc(tls *libc.TLS, context uintptr, argc int32, argv uintp // multiplex_control() function. func multiplexFuncInit(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* test_multiplex.c:417:12: */ var rc int32 - rc = sqlite3.Xsqlite3_create_function(tls, db, ts+33517 /* "multiplex_contro..." */, 2, SQLITE_ANY, + rc = sqlite3.Xsqlite3_create_function(tls, db, ts+34014 /* "multiplex_contro..." */, 2, SQLITE_ANY, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{multiplexControlFunc})), uintptr(0), uintptr(0)) @@ -66222,10 +67759,10 @@ func multiplexOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pConn uintptr, fl libc.Xmemset(tls, pGroup, 0, uint64(sz)) (*multiplexConn)(unsafe.Pointer(pMultiplexOpen)).FpGroup = pGroup (*multiplexGroup)(unsafe.Pointer(pGroup)).FbEnabled = libc.Uint8(libc.Uint8FromInt32(-1)) - (*multiplexGroup)(unsafe.Pointer(pGroup)).FbTruncate = uint8(sqlite3.Xsqlite3_uri_boolean(tls, zUri, ts+17605, /* "truncate" */ + (*multiplexGroup)(unsafe.Pointer(pGroup)).FbTruncate = uint8(sqlite3.Xsqlite3_uri_boolean(tls, zUri, ts+17954, /* "truncate" */ (libc.Bool32((flags & SQLITE_OPEN_MAIN_DB) == 0)))) - (*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk = uint32(int32(sqlite3.Xsqlite3_uri_int64(tls, zUri, ts+33535, /* "chunksize" */ - SQLITE_MULTIPLEX_CHUNK_SIZE))) + (*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk = uint32(int32(sqlite3.Xsqlite3_uri_int64(tls, zUri, ts+34032, /* "chunksize" */ + int64(SQLITE_MULTIPLEX_CHUNK_SIZE)))) (*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk = (((*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk + uint32(0xffff)) & libc.Uint32FromInt32(libc.CplInt32(0xffff))) if zName != 0 { var p uintptr = (pGroup + 1*40) @@ -66695,13 +68232,13 @@ func multiplexFileControl(tls *libc.TLS, pConn uintptr, op int32, pArg uintptr) // second element of the array is the name of the pragma and the third // element is the argument to the pragma or NULL if the pragma has no // argument. - if (*(*uintptr)(unsafe.Pointer(aFcntl + 1*8)) != 0) && (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + 1*8)), ts+33545 /* "multiplex_trunca..." */) == 0) { + if (*(*uintptr)(unsafe.Pointer(aFcntl + 1*8)) != 0) && (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + 1*8)), ts+34042 /* "multiplex_trunca..." */) == 0) { if (*(*uintptr)(unsafe.Pointer(aFcntl + 2*8)) != 0) && (*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aFcntl + 2*8)))) != 0) { - if (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + 2*8)), ts+4222 /* "on" */) == 0) || - (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + 2*8)), ts+27761 /* "1" */) == 0) { + if (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + 2*8)), ts+4049 /* "on" */) == 0) || + (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + 2*8)), ts+28250 /* "1" */) == 0) { (*multiplexGroup)(unsafe.Pointer(pGroup)).FbTruncate = uint8(1) - } else if (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + 2*8)), ts+4233 /* "off" */) == 0) || - (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + 2*8)), ts+13695 /* "0" */) == 0) { + } else if (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + 2*8)), ts+4413 /* "off" */) == 0) || + (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + 2*8)), ts+13875 /* "0" */) == 0) { (*multiplexGroup)(unsafe.Pointer(pGroup)).FbTruncate = uint8(0) } } @@ -66712,9 +68249,9 @@ func multiplexFileControl(tls *libc.TLS, pConn uintptr, op int32, pArg uintptr) // or the error message if the pragma fails. *(*uintptr)(unsafe.Pointer(aFcntl)) = sqlite3.Xsqlite3_mprintf(tls, func() uintptr { if (*multiplexGroup)(unsafe.Pointer(pGroup)).FbTruncate != 0 { - return ts + 4222 /* "on" */ + return ts + 4049 /* "on" */ } - return ts + 4233 /* "off" */ + return ts + 4413 /* "off" */ }(), 0) *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_OK break @@ -66729,7 +68266,7 @@ func multiplexFileControl(tls *libc.TLS, pConn uintptr, op int32, pArg uintptr) if pSubOpen != 0 { *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 80 /* &.xFileControl */))))(tls, pSubOpen, op, pArg) if (op == SQLITE_FCNTL_VFSNAME) && (*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK) { - *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+33564 /* "multiplex/%z" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(pArg)))) + *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+34061 /* "multiplex/%z" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(pArg)))) } } break @@ -66851,7 +68388,7 @@ func sqlite3_multiplex_initialize(tls *libc.TLS, zOrigVfsName uintptr, makeDefau gMultiplex.FpOrigVfs = pOrigVfs gMultiplex.FsThisVfs = *(*sqlite3_vfs)(unsafe.Pointer(pOrigVfs)) *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&gMultiplex)) + 8 /* &.sThisVfs */ + 4 /* &.szOsFile */)) += int32((uint64(unsafe.Sizeof(multiplexConn{})))) - gMultiplex.FsThisVfs.FzName = ts + 33577 /* "multiplex" */ + gMultiplex.FsThisVfs.FzName = ts + 34074 /* "multiplex" */ gMultiplex.FsThisVfs.FxOpen = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32 }{multiplexOpen})) @@ -66982,7 +68519,7 @@ func test_multiplex_initialize(tls *libc.TLS, clientData uintptr, interp uintptr // Process arguments if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+33587 /* "NAME MAKEDEFAULT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34084 /* "NAME MAKEDEFAULT" */) return TCL_ERROR } zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -67006,11 +68543,11 @@ func test_multiplex_shutdown(tls *libc.TLS, clientData uintptr, interp uintptr, _ = clientData - if (objc == 2) && (libc.Xstrcmp(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), ts+33604 /* "-force" */) != 0) { + if (objc == 2) && (libc.Xstrcmp(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), ts+34101 /* "-force" */) != 0) { objc = 3 } if (objc != 1) && (objc != 2) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+33611 /* "?-force?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34108 /* "?-force?" */) return TCL_ERROR } @@ -67044,20 +68581,20 @@ func test_multiplex_control(tls *libc.TLS, cd ClientData, interp uintptr, objc i Fop int32 Fargtype int32 }{ - {FzName: ts + 33620 /* "enable" */, Fop: MULTIPLEX_CTRL_ENABLE, Fargtype: 1}, - {FzName: ts + 33627 /* "chunk_size" */, Fop: MULTIPLEX_CTRL_SET_CHUNK_SIZE, Fargtype: 1}, - {FzName: ts + 33638 /* "max_chunks" */, Fop: MULTIPLEX_CTRL_SET_MAX_CHUNKS, Fargtype: 1}, + {FzName: ts + 34117 /* "enable" */, Fop: MULTIPLEX_CTRL_ENABLE, Fargtype: 1}, + {FzName: ts + 34124 /* "chunk_size" */, Fop: MULTIPLEX_CTRL_SET_CHUNK_SIZE, Fargtype: 1}, + {FzName: ts + 34135 /* "max_chunks" */, Fop: MULTIPLEX_CTRL_SET_MAX_CHUNKS, Fargtype: 1}, {}, } if objc != 5 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+33649 /* "HANDLE DBNAME SU..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34146 /* "HANDLE DBNAME SU..." */) return TCL_ERROR } if 0 == tcl.XTcl_GetCommandInfo(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+40 /* &cmdInfo */) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+33685 /* "expected databas..." */, 0)) - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), ts+11456 /* "\"" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+34182 /* "expected databas..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), ts+11636 /* "\"" */, 0)) return TCL_ERROR } else { db = *(*uintptr)(unsafe.Pointer((*Tcl_CmdInfo)(unsafe.Pointer(bp + 40 /* &cmdInfo */)).FobjClientData)) @@ -67068,7 +68605,7 @@ func test_multiplex_control(tls *libc.TLS, cd ClientData, interp uintptr, objc i FzName uintptr Fop int32 Fargtype int32 - }{})), ts+1874 /* "sub-command" */, 0, bp+168 /* &idx */) + }{})), ts+1875 /* "sub-command" */, 0, bp+168 /* &idx */) if rc != TCL_OK { return rc } @@ -67085,7 +68622,7 @@ func test_multiplex_control(tls *libc.TLS, cd ClientData, interp uintptr, objc i pArg = bp + 172 /* &iValue */ break default: - tcl.XTcl_WrongNumArgs(tls, interp, 4, objv, ts+2383 /* "SUB-COMMAND" */) + tcl.XTcl_WrongNumArgs(tls, interp, 4, objv, ts+2384 /* "SUB-COMMAND" */) return TCL_ERROR } @@ -67121,9 +68658,9 @@ var aCmd7 = [3]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 33717 /* "sqlite3_multiple..." */, FxProc: 0}, - {FzName: ts + 33746 /* "sqlite3_multiple..." */, FxProc: 0}, - {FzName: ts + 33773 /* "sqlite3_multiple..." */, FxProc: 0}, + {FzName: ts + 34214 /* "sqlite3_multiple..." */, FxProc: 0}, + {FzName: ts + 34243 /* "sqlite3_multiple..." */, FxProc: 0}, + {FzName: ts + 34270 /* "sqlite3_multiple..." */, FxProc: 0}, } /* test_multiplex.c:1310:5 */ // CAPI3REF: Standard File Control Opcodes @@ -67457,13 +68994,13 @@ var aCmd7 = [3]struct { // deals with pointers to the [sqlite3_mutex] object. // // Mutexes are created using [sqlite3_mutex_alloc()]. -type sqlite3_mutex = sqlite3_mutex1 /* sqlite3.h:1186:30 */ +type sqlite3_mutex = sqlite3_mutex1 /* sqlite3.h:1187:30 */ var aName = [15]uintptr{ - ts + 33799 /* "fast" */, ts + 33804 /* "recursive" */, ts + 33814 /* "static_main" */, ts + 33826, /* "static_mem" */ - ts + 33837 /* "static_open" */, ts + 33849 /* "static_prng" */, ts + 33861 /* "static_lru" */, ts + 33872, /* "static_pmem" */ - ts + 33884 /* "static_app1" */, ts + 33896 /* "static_app2" */, ts + 33908 /* "static_app3" */, ts + 33920, /* "static_vfs1" */ - ts + 33932 /* "static_vfs2" */, ts + 33944 /* "static_vfs3" */, uintptr(0), + ts + 34296 /* "fast" */, ts + 34301 /* "recursive" */, ts + 34311 /* "static_main" */, ts + 34323, /* "static_mem" */ + ts + 34334 /* "static_open" */, ts + 34346 /* "static_prng" */, ts + 34358 /* "static_lru" */, ts + 34369, /* "static_pmem" */ + ts + 34381 /* "static_app1" */, ts + 34393 /* "static_app2" */, ts + 34405 /* "static_app3" */, ts + 34417, /* "static_vfs1" */ + ts + 34429 /* "static_vfs2" */, ts + 34441 /* "static_vfs3" */, uintptr(0), } /* test_mutex.c:32:19 */ // State variables @@ -67570,7 +69107,7 @@ func test_shutdown(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32 var rc int32 if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } @@ -67584,7 +69121,7 @@ func test_initialize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int var rc int32 if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } @@ -67622,7 +69159,7 @@ func test_install_mutex_counters(tls *libc.TLS, clientData uintptr, interp uintp } if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17539 /* "BOOLEAN" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17888 /* "BOOLEAN" */) return TCL_ERROR } if TCL_OK != tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+56 /* &isInstall */) { @@ -67630,12 +69167,12 @@ func test_install_mutex_counters(tls *libc.TLS, clientData uintptr, interp uintp } if *(*int32)(unsafe.Pointer(bp + 56 /* isInstall */)) == g3.FisInstalled { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+33956 /* "mutex counters a..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+34453 /* "mutex counters a..." */, 0)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, func() uintptr { if *(*int32)(unsafe.Pointer(bp + 56 /* isInstall */)) != 0 { - return ts + 33976 /* "already installe..." */ + return ts + 34473 /* "already installe..." */ } - return ts + 33994 /* "not installed" */ + return ts + 34491 /* "not installed" */ }(), 0)) return TCL_ERROR } @@ -67667,7 +69204,7 @@ func test_read_mutex_counters(tls *libc.TLS, clientData uintptr, interp uintptr, var ii int32 if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } @@ -67693,7 +69230,7 @@ func test_clear_mutex_counters(tls *libc.TLS, clientData uintptr, interp uintptr var ii int32 if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } @@ -67714,7 +69251,7 @@ func test_alloc_mutex(tls *libc.TLS, clientData uintptr, interp uintptr, objc in // var zBuf [100]int8 at bp+24, 100 sqlite3.Xsqlite3_mutex_free(tls, p) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+24 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp, p)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+24 /* &zBuf[0] */, ts+13023 /* "%p" */, libc.VaList(bp, p)) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+8, bp+24 /* &zBuf[0] */, uintptr(0))) return TCL_OK } @@ -67733,9 +69270,9 @@ func test_config(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, defer tls.Free(68) *(*[4]ConfigOption)(unsafe.Pointer(bp /* aOpt */)) = [4]ConfigOption{ - {FzName: ts + 34008 /* "singlethread" */, FiValue: SQLITE_CONFIG_SINGLETHREAD}, - {FzName: ts + 34021 /* "multithread" */, FiValue: SQLITE_CONFIG_MULTITHREAD}, - {FzName: ts + 34033 /* "serialized" */, FiValue: SQLITE_CONFIG_SERIALIZED}, + {FzName: ts + 34505 /* "singlethread" */, FiValue: SQLITE_CONFIG_SINGLETHREAD}, + {FzName: ts + 34518 /* "multithread" */, FiValue: SQLITE_CONFIG_MULTITHREAD}, + {FzName: ts + 34530 /* "serialized" */, FiValue: SQLITE_CONFIG_SERIALIZED}, {}, } var s int32 = int32(unsafe.Sizeof(ConfigOption{})) @@ -67744,11 +69281,11 @@ func test_config(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, var rc int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } - if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &aOpt[0] */, s, ts+16852 /* "flag" */, 0, bp+64 /* &i */) != 0 { + if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp /* &aOpt[0] */, s, ts+17196 /* "flag" */, 0, bp+64 /* &i */) != 0 { if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+64 /* &i */) != 0 { return TCL_ERROR } @@ -67790,7 +69327,7 @@ func getStaticMutexPointer(tls *libc.TLS, pInterp uintptr, pObj uintptr) uintptr // var iMutex int32 at bp, 4 - if tcl.XTcl_GetIndexFromObjStruct(tls, pInterp, pObj, uintptr(unsafe.Pointer(&aName)), int32(unsafe.Sizeof(uintptr(0))), ts+34044 /* "mutex name" */, 0, bp /* &iMutex */) != 0 { + if tcl.XTcl_GetIndexFromObjStruct(tls, pInterp, pObj, uintptr(unsafe.Pointer(&aName)), int32(unsafe.Sizeof(uintptr(0))), ts+34541 /* "mutex name" */, 0, bp /* &iMutex */) != 0 { return uintptr(0) } @@ -67800,7 +69337,7 @@ func getStaticMutexPointer(tls *libc.TLS, pInterp uintptr, pObj uintptr) uintptr func test_enter_static_mutex(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:404:26: */ var pMutex uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10219 /* "NAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10399 /* "NAME" */) return TCL_ERROR } pMutex = getStaticMutexPointer(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -67814,7 +69351,7 @@ func test_enter_static_mutex(tls *libc.TLS, clientData uintptr, interp uintptr, func test_leave_static_mutex(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:423:26: */ var pMutex uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10219 /* "NAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10399 /* "NAME" */) return TCL_ERROR } pMutex = getStaticMutexPointer(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -67828,7 +69365,7 @@ func test_leave_static_mutex(tls *libc.TLS, clientData uintptr, interp uintptr, func test_enter_db_mutex(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:442:26: */ var db uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } db = getDbPointer1(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -67842,7 +69379,7 @@ func test_enter_db_mutex(tls *libc.TLS, clientData uintptr, interp uintptr, objc func test_leave_db_mutex(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:461:26: */ var db uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } db = getDbPointer1(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -67862,9 +69399,9 @@ func Sqlitetest_mutex_Init(tls *libc.TLS, interp uintptr) int32 { /* test_mutex. tcl.XTcl_CreateObjCommand(tls, interp, aCmd8[i].FzName, aCmd8[i].FxProc, uintptr(0), uintptr(0)) } - tcl.XTcl_LinkVar(tls, interp, ts+34055, /* "disable_mutex_in..." */ + tcl.XTcl_LinkVar(tls, interp, ts+34552, /* "disable_mutex_in..." */ (uintptr(unsafe.Pointer(&g3)) + 4 /* &.disableInit */), TCL_LINK_INT) - tcl.XTcl_LinkVar(tls, interp, ts+34074, /* "disable_mutex_tr..." */ + tcl.XTcl_LinkVar(tls, interp, ts+34571, /* "disable_mutex_tr..." */ (uintptr(unsafe.Pointer(&g3)) + 8 /* &.disableTry */), TCL_LINK_INT) return SQLITE_OK } @@ -67873,20 +69410,20 @@ var aCmd8 = [11]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 34092 /* "sqlite3_shutdown" */, FxProc: 0}, - {FzName: ts + 34109 /* "sqlite3_initiali..." */, FxProc: 0}, - {FzName: ts + 34128 /* "sqlite3_config" */, FxProc: 0}, + {FzName: ts + 34589 /* "sqlite3_shutdown" */, FxProc: 0}, + {FzName: ts + 34606 /* "sqlite3_initiali..." */, FxProc: 0}, + {FzName: ts + 34625 /* "sqlite3_config" */, FxProc: 0}, - {FzName: ts + 34143 /* "enter_static_mut..." */, FxProc: 0}, - {FzName: ts + 34162 /* "leave_static_mut..." */, FxProc: 0}, + {FzName: ts + 34640 /* "enter_static_mut..." */, FxProc: 0}, + {FzName: ts + 34659 /* "leave_static_mut..." */, FxProc: 0}, - {FzName: ts + 34181 /* "enter_db_mutex" */, FxProc: 0}, - {FzName: ts + 34196 /* "leave_db_mutex" */, FxProc: 0}, + {FzName: ts + 34678 /* "enter_db_mutex" */, FxProc: 0}, + {FzName: ts + 34693 /* "leave_db_mutex" */, FxProc: 0}, - {FzName: ts + 34211 /* "alloc_dealloc_mu..." */, FxProc: 0}, - {FzName: ts + 34231 /* "install_mutex_co..." */, FxProc: 0}, - {FzName: ts + 34254 /* "read_mutex_count..." */, FxProc: 0}, - {FzName: ts + 34274 /* "clear_mutex_coun..." */, FxProc: 0}, + {FzName: ts + 34708 /* "alloc_dealloc_mu..." */, FxProc: 0}, + {FzName: ts + 34728 /* "install_mutex_co..." */, FxProc: 0}, + {FzName: ts + 34751 /* "read_mutex_count..." */, FxProc: 0}, + {FzName: ts + 34771 /* "clear_mutex_coun..." */, FxProc: 0}, } /* test_mutex.c:484:5 */ // Maximum pathname length supported by the fs backend. @@ -67939,7 +69476,7 @@ type fs_vfs_t = fs_vfs_t1 /* test_onefile.c:176:25 */ var fs_vfs = fs_vfs_t{ Fbase: sqlite3_vfs{ FiVersion: 1, // pNext - FzName: ts + 29891, /* "fs" */ // pAppData + FzName: ts + 30388, /* "fs" */ // pAppData FxOpen: 0, // xOpen FxDelete: 0, // xDelete FxAccess: 0, // xAccess @@ -68115,7 +69652,7 @@ func fsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite (((*fs_file)(unsafe.Pointer(p)).FeType == JOURNAL_FILE) && ((sqlite_int64(iAmt) + iOfst) > sqlite_int64((*fs_real_file)(unsafe.Pointer(pReal)).FnJournal))) { rc = (SQLITE_IOERR | (int32(2) << 8)) } else if (*fs_file)(unsafe.Pointer(p)).FeType == DATABASE_FILE { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 16 /* &.xRead */))))(tls, pF, zBuf, iAmt, (iOfst + BLOCKSIZE)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 16 /* &.xRead */))))(tls, pF, zBuf, iAmt, (iOfst + int64(BLOCKSIZE))) } else { // Journal file. var iRem int32 = iAmt @@ -68148,10 +69685,10 @@ func fsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlit var pF uintptr = (*fs_real_file)(unsafe.Pointer(pReal)).FpFile if (*fs_file)(unsafe.Pointer(p)).FeType == DATABASE_FILE { - if ((sqlite_int64(iAmt) + iOfst) + BLOCKSIZE) > (sqlite_int64((*fs_real_file)(unsafe.Pointer(pReal)).FnBlob - (*fs_real_file)(unsafe.Pointer(pReal)).FnJournal)) { + if ((sqlite_int64(iAmt) + iOfst) + int64(BLOCKSIZE)) > (sqlite_int64((*fs_real_file)(unsafe.Pointer(pReal)).FnBlob - (*fs_real_file)(unsafe.Pointer(pReal)).FnJournal)) { rc = SQLITE_FULL } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 24 /* &.xWrite */))))(tls, pF, zBuf, iAmt, (iOfst + BLOCKSIZE)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 24 /* &.xWrite */))))(tls, pF, zBuf, iAmt, (iOfst + int64(BLOCKSIZE))) if rc == SQLITE_OK { (*fs_real_file)(unsafe.Pointer(pReal)).FnDatabase = func() int32 { if (sqlite_int64((*fs_real_file)(unsafe.Pointer(pReal)).FnDatabase)) > (sqlite_int64(iAmt) + iOfst) { @@ -68390,7 +69927,7 @@ __8: if !(*(*sqlite3_int64)(unsafe.Pointer(bp /* size */)) == int64(0)) { goto __9 } - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 24 /* &.xWrite */))))(tls, pRealFile, ts+34295 /* "\x00" */, 1, (int64(BLOBSIZE - 1))) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 24 /* &.xWrite */))))(tls, pRealFile, ts+34792 /* "\x00" */, 1, (int64(BLOBSIZE - 1))) (*fs_real_file)(unsafe.Pointer(pReal)).FnBlob = BLOBSIZE goto __10 __9: @@ -68469,7 +70006,7 @@ func fsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { } if pReal != 0 { pF = (*fs_real_file)(unsafe.Pointer(pReal)).FpFile - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 24 /* &.xWrite */))))(tls, pF, ts+34297 /* "\x00\x00\x00\x00" */, 4, (int64((*fs_real_file)(unsafe.Pointer(pReal)).FnBlob - BLOCKSIZE))) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 24 /* &.xWrite */))))(tls, pF, ts+34794 /* "\x00\x00\x00\x00" */, 4, (int64((*fs_real_file)(unsafe.Pointer(pReal)).FnBlob - BLOCKSIZE))) if rc == SQLITE_OK { (*fs_real_file)(unsafe.Pointer(pReal)).FnJournal = 0 } @@ -68490,7 +70027,7 @@ func fsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut u return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 56 /* &.xAccess */))))(tls, pParent, zPath, flags, pResOut) } - if (nName > 8) && (libc.Xstrcmp(tls, ts+31647 /* "-journal" */, (zPath+uintptr((nName-8)))) == 0) { + if (nName > 8) && (libc.Xstrcmp(tls, ts+32144 /* "-journal" */, (zPath+uintptr((nName-8)))) == 0) { nName = nName - (8) isJournal = 1 } @@ -68871,7 +70408,7 @@ func vfslogFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int var p uintptr = pFile var rc int32 = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 80 /* &.xFileControl */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, op, pArg) if (op == SQLITE_FCNTL_VFSNAME) && (rc == SQLITE_OK) { - *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+34302 /* "vfslog/%z" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(pArg)))) + *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+34799 /* "vfslog/%z" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(pArg)))) } return rc } @@ -69166,7 +70703,7 @@ func sqlite3_vfslog_new(tls *libc.TLS, zVfs uintptr, zParentVfs uintptr, zLog ui (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pParent + 48 /* &.xDelete */))))(tls, pParent, zFile, 0) rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 40 /* &.xOpen */))))(tls, pParent, zFile, (*VfslogVfs)(unsafe.Pointer(p)).FpLog, *(*int32)(unsafe.Pointer(bp /* flags */)), bp /* &flags */) if rc == SQLITE_OK { - libc.Xmemcpy(tls, p+204 /* &.aBuf */, ts+34312 /* "sqlite_ostrace1...." */, uint64(20)) + libc.Xmemcpy(tls, p+204 /* &.aBuf */, ts+34809 /* "sqlite_ostrace1...." */, uint64(20)) (*VfslogVfs)(unsafe.Pointer(p)).FiOffset = int64(0) (*VfslogVfs)(unsafe.Pointer(p)).FnBuf = 20 rc = sqlite3.Xsqlite3_vfs_register(tls, p, 1) @@ -69195,78 +70732,78 @@ func vfslog_eventname(tls *libc.TLS, eEvent int32) uintptr { /* test_osinst.c:76 switch eEvent { case OS_CLOSE: - zEvent = ts + 34333 /* "xClose" */ + zEvent = ts + 34830 /* "xClose" */ break case OS_READ: - zEvent = ts + 34340 /* "xRead" */ + zEvent = ts + 34837 /* "xRead" */ break case OS_WRITE: - zEvent = ts + 34346 /* "xWrite" */ + zEvent = ts + 34843 /* "xWrite" */ break case OS_TRUNCATE: - zEvent = ts + 34353 /* "xTruncate" */ + zEvent = ts + 34850 /* "xTruncate" */ break case OS_SYNC: - zEvent = ts + 26827 /* "xSync" */ + zEvent = ts + 27316 /* "xSync" */ break case OS_FILESIZE: - zEvent = ts + 34363 /* "xFilesize" */ + zEvent = ts + 34860 /* "xFilesize" */ break case OS_LOCK: - zEvent = ts + 34373 /* "xLock" */ + zEvent = ts + 34870 /* "xLock" */ break case OS_UNLOCK: - zEvent = ts + 34379 /* "xUnlock" */ + zEvent = ts + 34876 /* "xUnlock" */ break case OS_CHECKRESERVEDLOCK: - zEvent = ts + 34387 /* "xCheckResLock" */ + zEvent = ts + 34884 /* "xCheckResLock" */ break case OS_FILECONTROL: - zEvent = ts + 34401 /* "xFileControl" */ + zEvent = ts + 34898 /* "xFileControl" */ break case OS_SECTORSIZE: - zEvent = ts + 34414 /* "xSectorSize" */ + zEvent = ts + 34911 /* "xSectorSize" */ break case OS_DEVCHAR: - zEvent = ts + 34426 /* "xDeviceChar" */ + zEvent = ts + 34923 /* "xDeviceChar" */ break case OS_OPEN: - zEvent = ts + 26399 /* "xOpen" */ + zEvent = ts + 26888 /* "xOpen" */ break case OS_DELETE: - zEvent = ts + 34438 /* "xDelete" */ + zEvent = ts + 34935 /* "xDelete" */ break case OS_ACCESS: - zEvent = ts + 34446 /* "xAccess" */ + zEvent = ts + 34943 /* "xAccess" */ break case OS_FULLPATHNAME: - zEvent = ts + 34454 /* "xFullPathname" */ + zEvent = ts + 34951 /* "xFullPathname" */ break case OS_RANDOMNESS: - zEvent = ts + 34468 /* "xRandomness" */ + zEvent = ts + 34965 /* "xRandomness" */ break case OS_SLEEP: - zEvent = ts + 34480 /* "xSleep" */ + zEvent = ts + 34977 /* "xSleep" */ break case OS_CURRENTTIME: - zEvent = ts + 34487 /* "xCurrentTime" */ + zEvent = ts + 34984 /* "xCurrentTime" */ break case OS_SHMUNMAP: - zEvent = ts + 34500 /* "xShmUnmap" */ + zEvent = ts + 34997 /* "xShmUnmap" */ break case OS_SHMLOCK: - zEvent = ts + 34510 /* "xShmLock" */ + zEvent = ts + 35007 /* "xShmLock" */ break case OS_SHMBARRIER: - zEvent = ts + 34519 /* "xShmBarrier" */ + zEvent = ts + 35016 /* "xShmBarrier" */ break case OS_SHMMAP: - zEvent = ts + 34531 /* "xShmMap" */ + zEvent = ts + 35028 /* "xShmMap" */ break case OS_ANNOTATE: - zEvent = ts + 34539 /* "annotation" */ + zEvent = ts + 35036 /* "annotation" */ break } @@ -69365,7 +70902,7 @@ func vlogConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintp if rc == SQLITE_OK { (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVtab)(unsafe.Pointer(p)).FpFd)).FpMethods + 48 /* &.xFileSize */))))(tls, (*VfslogVtab)(unsafe.Pointer(p)).FpFd, (p + 32 /* &.nByte */)) sqlite3.Xsqlite3_declare_vtab(tls, db, - ts+34550 /* "CREATE TABLE xxx..." */) + ts+35047 /* "CREATE TABLE xxx..." */) *(*uintptr)(unsafe.Pointer(ppVtab)) = (p /* &.base */) } else { sqlite3.Xsqlite3_free(tls, p) @@ -69525,7 +71062,7 @@ func vlogRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* test_o func sqlite3_vfslog_register(tls *libc.TLS, db uintptr) int32 { /* test_osinst.c:1071:5: */ - sqlite3.Xsqlite3_create_module(tls, db, ts+34605 /* "vfslog" */, uintptr(unsafe.Pointer(&vfslog_module)), uintptr(0)) + sqlite3.Xsqlite3_create_module(tls, db, ts+35102 /* "vfslog" */, uintptr(unsafe.Pointer(&vfslog_module)), uintptr(0)) return SQLITE_OK } @@ -69563,10 +71100,10 @@ func test_vfslog(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, // var iSub int32 at bp+72, 4 if objc < 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31821 /* "SUB-COMMAND ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32318 /* "SUB-COMMAND ..." */) return TCL_ERROR } - if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&strs)), int32(unsafe.Sizeof(uintptr(0))), ts+1874 /* "sub-command" */, 0, bp+72 /* &iSub */) != 0 { + if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&strs)), int32(unsafe.Sizeof(uintptr(0))), ts+1875 /* "sub-command" */, 0, bp+72 /* &iSub */) != 0 { return TCL_ERROR } @@ -69576,14 +71113,14 @@ func test_vfslog(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, var zVfs uintptr var zMsg uintptr if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 3, objv, ts+34612 /* "VFS" */) + tcl.XTcl_WrongNumArgs(tls, interp, 3, objv, ts+35109 /* "VFS" */) return TCL_ERROR } zVfs = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) zMsg = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8))) rc = sqlite3_vfslog_annotate(tls, zVfs, zMsg) if rc != SQLITE_OK { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+34616 /* "failed" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+35113 /* "failed" */, 0)) return TCL_ERROR } break @@ -69593,13 +71130,13 @@ func test_vfslog(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, { var zVfs uintptr if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+34612 /* "VFS" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+35109 /* "VFS" */) return TCL_ERROR } zVfs = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) rc = sqlite3_vfslog_finalize(tls, zVfs) if rc != SQLITE_OK { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+34616 /* "failed" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+35113 /* "failed" */, 0)) return TCL_ERROR } break @@ -69612,7 +71149,7 @@ func test_vfslog(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, var zParent uintptr var zLog uintptr if objc != 5 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+34623 /* "VFS PARENT LOGFI..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+35120 /* "VFS PARENT LOGFI..." */) return TCL_ERROR } zVfs = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) @@ -69623,7 +71160,7 @@ func test_vfslog(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, } rc = sqlite3_vfslog_new(tls, zVfs, zParent, zLog) if rc != SQLITE_OK { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+34616 /* "failed" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+35113 /* "failed" */, 0)) return TCL_ERROR } break @@ -69634,7 +71171,7 @@ func test_vfslog(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, { var zDb uintptr if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+1911 /* "DB" */) return TCL_ERROR } zDb = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) @@ -69643,7 +71180,7 @@ func test_vfslog(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, rc = sqlite3_vfslog_register(tls, db) } if rc != SQLITE_OK { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+34642 /* "bad sqlite3 hand..." */, zDb, uintptr(0))) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+35139 /* "bad sqlite3 hand..." */, zDb, uintptr(0))) return TCL_ERROR } break @@ -69654,10 +71191,10 @@ func test_vfslog(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, return TCL_OK } -var strs = [5]uintptr{ts + 34663 /* "annotate" */, ts + 34672 /* "finalize" */, ts + 13511 /* "new" */, ts + 34681 /* "register" */, uintptr(0)} /* test_osinst.c:1127:21 */ +var strs = [5]uintptr{ts + 35160 /* "annotate" */, ts + 35169 /* "finalize" */, ts + 13691 /* "new" */, ts + 35178 /* "register" */, uintptr(0)} /* test_osinst.c:1127:21 */ func SqlitetestOsinst_Init(tls *libc.TLS, interp uintptr) int32 { /* test_osinst.c:1219:5: */ - tcl.XTcl_CreateObjCommand(tls, interp, ts+34605 /* "vfslog" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+35102 /* "vfslog" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_vfslog})), uintptr(0), uintptr(0)) return TCL_OK @@ -69877,7 +71414,7 @@ func testpcacheCreate(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int (*testpcache)(unsafe.Pointer(p)).FnPinned = 0 (*testpcache)(unsafe.Pointer(p)).FiRand = testpcacheGlobal.FprngSeed (*testpcache)(unsafe.Pointer(p)).FbPurgeable = bPurgeable - (*testpcache)(unsafe.Pointer(p)).FiMagic = TESTPCACHE_VALID + (*testpcache)(unsafe.Pointer(p)).FiMagic = uint32(TESTPCACHE_VALID) i = 0 __1: if !(i < TESTPCACHE_NPAGE) { @@ -69961,7 +71498,7 @@ func testpcacheFetch(tls *libc.TLS, pCache uintptr, key uint32, createFlag int32 // Find a free page to allocate if there are any free pages. // Withhold TESTPCACHE_RESERVE free pages until createFlag is 2. if ((*testpcache)(unsafe.Pointer(p)).FnFree > TESTPCACHE_RESERVE) || ((createFlag == 2) && ((*testpcache)(unsafe.Pointer(p)).FnFree > 0)) { - j = (int32(testpcacheRandom(tls, p) % TESTPCACHE_NPAGE)) + j = (int32(testpcacheRandom(tls, p) % uint32(TESTPCACHE_NPAGE))) i = 0 __1: if !(i < TESTPCACHE_NPAGE) { @@ -69999,7 +71536,7 @@ func testpcacheFetch(tls *libc.TLS, pCache uintptr, key uint32, createFlag int32 // If there are no free pages, recycle a page. The page to // recycle is selected at random from all unpinned pages. - j = (int32(testpcacheRandom(tls, p) % TESTPCACHE_NPAGE)) + j = (int32(testpcacheRandom(tls, p) % uint32(TESTPCACHE_NPAGE))) i = 0 __4: if !(i < TESTPCACHE_NPAGE) { @@ -70104,7 +71641,7 @@ func testpcacheTruncate(tls *libc.TLS, pCache uintptr, iLimit uint32) { /* test_ var p uintptr = pCache var i uint32 - for i = uint32(0); i < TESTPCACHE_NPAGE; i++ { + for i = uint32(0); i < uint32(TESTPCACHE_NPAGE); i++ { if (*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(i)*24)).Fkey >= iLimit { (*testpcachePage)(unsafe.Pointer((p + 32 /* &.a */) + uintptr(i)*24)).Fkey = uint32(0) if (*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(i)*24)).FisPinned != 0 { @@ -70701,7 +72238,7 @@ func quotaFileControl(tls *libc.TLS, pConn uintptr, op int32, pArg uintptr) int3 var pSubOpen uintptr = quotaSubOpen(tls, pConn) var rc int32 = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 80 /* &.xFileControl */))))(tls, pSubOpen, op, pArg) if (op == SQLITE_FCNTL_VFSNAME) && (rc == SQLITE_OK) { - *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+34690 /* "quota/%z" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(pArg)))) + *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+35187 /* "quota/%z" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(pArg)))) } return rc } @@ -70776,7 +72313,7 @@ func sqlite3_quota_initialize(tls *libc.TLS, zOrigVfsName uintptr, makeDefault i f func(*libc.TLS, uintptr, uintptr, int32) int32 }{quotaDelete})) *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&gQuota)) + 8 /* &.sThisVfs */ + 4 /* &.szOsFile */)) += int32((uint64(unsafe.Sizeof(quotaConn{})))) - gQuota.FsThisVfs.FzName = ts + 34699 /* "quota" */ + gQuota.FsThisVfs.FzName = ts + 35196 /* "quota" */ gQuota.FsIoMethodsV1.FiVersion = 1 gQuota.FsIoMethodsV1.FxClose = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr) int32 @@ -71350,7 +72887,7 @@ func tclQuotaCallback(tls *libc.TLS, zFilename uintptr, piLimit uintptr, iSize s return } - pVarname = tcl.XTcl_NewStringObj(tls, ts+34705 /* "::piLimit_" */, -1) + pVarname = tcl.XTcl_NewStringObj(tls, ts+35202 /* "::piLimit_" */, -1) (*Tcl_Obj)(unsafe.Pointer(pVarname)).FrefCount++ sqlite3.Xsqlite3_randomness(tls, int32(unsafe.Sizeof(uint32(0))), bp /* &rnd */) tcl.XTcl_AppendObjToObj(tls, pVarname, tcl.XTcl_NewIntObj(tls, (int32(*(*uint32)(unsafe.Pointer(bp /* rnd */))&uint32(0x7FFFFFFF))))) @@ -71415,7 +72952,7 @@ func test_quota_initialize(tls *libc.TLS, clientData uintptr, interp uintptr, ob // Process arguments if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+33587 /* "NAME MAKEDEFAULT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34084 /* "NAME MAKEDEFAULT" */) return TCL_ERROR } zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -71438,7 +72975,7 @@ func test_quota_shutdown(tls *libc.TLS, clientData uintptr, interp uintptr, objc var rc int32 // Value returned by quota_shutdown() if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } @@ -71467,7 +73004,7 @@ func test_quota_set(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 // Process arguments if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34716 /* "PATTERN LIMIT SC..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+35213 /* "PATTERN LIMIT SC..." */) return TCL_ERROR } zPattern = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -71481,7 +73018,7 @@ func test_quota_set(tls *libc.TLS, clientData uintptr, interp uintptr, objc int3 // Allocate a TclQuotaCallback object p = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(TclQuotaCallback{}))) if !(p != 0) { - tcl.XTcl_SetResult(tls, interp, ts+31585 /* "SQLITE_NOMEM" */, uintptr(0)) + tcl.XTcl_SetResult(tls, interp, ts+32082 /* "SQLITE_NOMEM" */, uintptr(0)) return TCL_OK } libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(TclQuotaCallback{}))) @@ -71512,7 +73049,7 @@ func test_quota_file(tls *libc.TLS, clientData uintptr, interp uintptr, objc int // Process arguments if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31769 /* "FILENAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32266 /* "FILENAME" */) return TCL_ERROR } zFilename = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -71586,13 +73123,13 @@ func test_quota_fopen(tls *libc.TLS, clientData uintptr, interp uintptr, objc in // Process arguments if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34737 /* "FILENAME MODE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+35234 /* "FILENAME MODE" */) return TCL_ERROR } zFilename = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) zMode = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) p = sqlite3_quota_fopen(tls, zFilename, zMode) - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+8 /* &zReturn[0] */, ts+12843 /* "%p" */, libc.VaList(bp, p)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+8 /* &zReturn[0] */, ts+13023 /* "%p" */, libc.VaList(bp, p)) tcl.XTcl_SetResult(tls, interp, bp+8 /* &zReturn[0] */, uintptr(1)) return TCL_OK } @@ -71611,7 +73148,7 @@ func test_quota_fread(tls *libc.TLS, clientData uintptr, interp uintptr, objc in var got size_t if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34751 /* "HANDLE SIZE NELE..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+35248 /* "HANDLE SIZE NELE..." */) return TCL_ERROR } p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -71623,7 +73160,7 @@ func test_quota_fread(tls *libc.TLS, clientData uintptr, interp uintptr, objc in } zBuf = sqlite3.Xsqlite3_malloc(tls, ((*(*int32)(unsafe.Pointer(bp /* sz */)) * *(*int32)(unsafe.Pointer(bp + 4 /* nElem */))) + 1)) if zBuf == uintptr(0) { - tcl.XTcl_SetResult(tls, interp, ts+1929 /* "out of memory" */, uintptr(0)) + tcl.XTcl_SetResult(tls, interp, ts+1930 /* "out of memory" */, uintptr(0)) return TCL_ERROR } got = sqlite3_quota_fread(tls, zBuf, uint64(*(*int32)(unsafe.Pointer(bp /* sz */))), uint64(*(*int32)(unsafe.Pointer(bp + 4 /* nElem */))), p) @@ -71647,7 +73184,7 @@ func test_quota_fwrite(tls *libc.TLS, clientData uintptr, interp uintptr, objc i var got size_t if objc != 5 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34769 /* "HANDLE SIZE NELE..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+35266 /* "HANDLE SIZE NELE..." */) return TCL_ERROR } p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -71669,7 +73206,7 @@ func test_quota_fclose(tls *libc.TLS, clientData uintptr, interp uintptr, objc i var rc int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+28011 /* "HANDLE" */) return TCL_ERROR } p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -71688,7 +73225,7 @@ func test_quota_fflush(tls *libc.TLS, clientData uintptr, interp uintptr, objc i *(*int32)(unsafe.Pointer(bp /* doSync */)) = 0 if (objc != 2) && (objc != 3) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34795 /* "HANDLE ?HARDSYNC..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+35292 /* "HANDLE ?HARDSYNC..." */) return TCL_ERROR } p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -71715,7 +73252,7 @@ func test_quota_fseek(tls *libc.TLS, clientData uintptr, interp uintptr, objc in var rc int32 if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34813 /* "HANDLE OFFSET WH..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+35310 /* "HANDLE OFFSET WH..." */) return TCL_ERROR } p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -71723,15 +73260,15 @@ func test_quota_fseek(tls *libc.TLS, clientData uintptr, interp uintptr, objc in return TCL_ERROR } zWhence = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 3*8))) - if libc.Xstrcmp(tls, zWhence, ts+34834 /* "SEEK_SET" */) == 0 { + if libc.Xstrcmp(tls, zWhence, ts+35331 /* "SEEK_SET" */) == 0 { whence = SEEK_SET - } else if libc.Xstrcmp(tls, zWhence, ts+34843 /* "SEEK_CUR" */) == 0 { + } else if libc.Xstrcmp(tls, zWhence, ts+35340 /* "SEEK_CUR" */) == 0 { whence = SEEK_CUR - } else if libc.Xstrcmp(tls, zWhence, ts+34852 /* "SEEK_END" */) == 0 { + } else if libc.Xstrcmp(tls, zWhence, ts+35349 /* "SEEK_END" */) == 0 { whence = SEEK_END } else { tcl.XTcl_AppendResult(tls, interp, - libc.VaList(bp, ts+34861 /* "WHENCE should be..." */, uintptr(0))) + libc.VaList(bp, ts+35358 /* "WHENCE should be..." */, uintptr(0))) return TCL_ERROR } rc = sqlite3_quota_fseek(tls, p, int64(*(*int32)(unsafe.Pointer(bp + 16 /* ofst */))), whence) @@ -71743,7 +73280,7 @@ func test_quota_fseek(tls *libc.TLS, clientData uintptr, interp uintptr, objc in func test_quota_rewind(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1718:26: */ var p uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+28011 /* "HANDLE" */) return TCL_ERROR } p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -71756,7 +73293,7 @@ func test_quota_ftell(tls *libc.TLS, clientData uintptr, interp uintptr, objc in var p uintptr var x sqlite3_int64 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+28011 /* "HANDLE" */) return TCL_ERROR } p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -71776,7 +73313,7 @@ func test_quota_ftruncate(tls *libc.TLS, clientData uintptr, interp uintptr, obj var rc int32 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34910 /* "HANDLE SIZE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+35407 /* "HANDLE SIZE" */) return TCL_ERROR } p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -71794,7 +73331,7 @@ func test_quota_file_size(tls *libc.TLS, clientData uintptr, interp uintptr, obj var p uintptr var x sqlite3_int64 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+28011 /* "HANDLE" */) return TCL_ERROR } p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -71808,7 +73345,7 @@ func test_quota_file_truesize(tls *libc.TLS, clientData uintptr, interp uintptr, var p uintptr var x sqlite3_int64 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+28011 /* "HANDLE" */) return TCL_ERROR } p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -71826,7 +73363,7 @@ func test_quota_file_mtime(tls *libc.TLS, clientData uintptr, interp uintptr, ob // var t time_t at bp, 8 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+28011 /* "HANDLE" */) return TCL_ERROR } p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -71841,7 +73378,7 @@ func test_quota_remove(tls *libc.TLS, clientData uintptr, interp uintptr, objc i var zFilename uintptr // File pattern to configure var rc int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31769 /* "FILENAME" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32266 /* "FILENAME" */) return TCL_ERROR } zFilename = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -71859,7 +73396,7 @@ func test_quota_glob(tls *libc.TLS, clientData uintptr, interp uintptr, objc int var zText uintptr // Text to compare agains the pattern var rc int32 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34922 /* "PATTERN TEXT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+35419 /* "PATTERN TEXT" */) return TCL_ERROR } zPattern = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) @@ -71877,7 +73414,7 @@ func test_quota_file_available(tls *libc.TLS, clientData uintptr, interp uintptr var p uintptr var x sqlite3_int64 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+28011 /* "HANDLE" */) return TCL_ERROR } p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -71893,7 +73430,7 @@ func test_quota_ferror(tls *libc.TLS, clientData uintptr, interp uintptr, objc i var p uintptr var x int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+28011 /* "HANDLE" */) return TCL_ERROR } p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)))) @@ -71922,27 +73459,27 @@ var aCmd9 = [21]struct { FzName uintptr FxProc uintptr }{ - {FzName: ts + 34935 /* "sqlite3_quota_in..." */, FxProc: 0}, - {FzName: ts + 34960 /* "sqlite3_quota_sh..." */, FxProc: 0}, - {FzName: ts + 34983 /* "sqlite3_quota_se..." */, FxProc: 0}, - {FzName: ts + 35001 /* "sqlite3_quota_fi..." */, FxProc: 0}, - {FzName: ts + 35020 /* "sqlite3_quota_du..." */, FxProc: 0}, - {FzName: ts + 35039 /* "sqlite3_quota_fo..." */, FxProc: 0}, - {FzName: ts + 35059 /* "sqlite3_quota_fr..." */, FxProc: 0}, - {FzName: ts + 35079 /* "sqlite3_quota_fw..." */, FxProc: 0}, - {FzName: ts + 35100 /* "sqlite3_quota_fc..." */, FxProc: 0}, - {FzName: ts + 35121 /* "sqlite3_quota_ff..." */, FxProc: 0}, - {FzName: ts + 35142 /* "sqlite3_quota_fs..." */, FxProc: 0}, - {FzName: ts + 35162 /* "sqlite3_quota_re..." */, FxProc: 0}, - {FzName: ts + 35183 /* "sqlite3_quota_ft..." */, FxProc: 0}, - {FzName: ts + 35203 /* "sqlite3_quota_ft..." */, FxProc: 0}, - {FzName: ts + 35227 /* "sqlite3_quota_fi..." */, FxProc: 0}, - {FzName: ts + 35251 /* "sqlite3_quota_fi..." */, FxProc: 0}, - {FzName: ts + 35279 /* "sqlite3_quota_fi..." */, FxProc: 0}, - {FzName: ts + 35304 /* "sqlite3_quota_re..." */, FxProc: 0}, - {FzName: ts + 35325 /* "sqlite3_quota_gl..." */, FxProc: 0}, - {FzName: ts + 35344 /* "sqlite3_quota_fi..." */, FxProc: 0}, - {FzName: ts + 35373 /* "sqlite3_quota_fe..." */, FxProc: 0}, + {FzName: ts + 35432 /* "sqlite3_quota_in..." */, FxProc: 0}, + {FzName: ts + 35457 /* "sqlite3_quota_sh..." */, FxProc: 0}, + {FzName: ts + 35480 /* "sqlite3_quota_se..." */, FxProc: 0}, + {FzName: ts + 35498 /* "sqlite3_quota_fi..." */, FxProc: 0}, + {FzName: ts + 35517 /* "sqlite3_quota_du..." */, FxProc: 0}, + {FzName: ts + 35536 /* "sqlite3_quota_fo..." */, FxProc: 0}, + {FzName: ts + 35556 /* "sqlite3_quota_fr..." */, FxProc: 0}, + {FzName: ts + 35576 /* "sqlite3_quota_fw..." */, FxProc: 0}, + {FzName: ts + 35597 /* "sqlite3_quota_fc..." */, FxProc: 0}, + {FzName: ts + 35618 /* "sqlite3_quota_ff..." */, FxProc: 0}, + {FzName: ts + 35639 /* "sqlite3_quota_fs..." */, FxProc: 0}, + {FzName: ts + 35659 /* "sqlite3_quota_re..." */, FxProc: 0}, + {FzName: ts + 35680 /* "sqlite3_quota_ft..." */, FxProc: 0}, + {FzName: ts + 35700 /* "sqlite3_quota_ft..." */, FxProc: 0}, + {FzName: ts + 35724 /* "sqlite3_quota_fi..." */, FxProc: 0}, + {FzName: ts + 35748 /* "sqlite3_quota_fi..." */, FxProc: 0}, + {FzName: ts + 35776 /* "sqlite3_quota_fi..." */, FxProc: 0}, + {FzName: ts + 35801 /* "sqlite3_quota_re..." */, FxProc: 0}, + {FzName: ts + 35822 /* "sqlite3_quota_gl..." */, FxProc: 0}, + {FzName: ts + 35841 /* "sqlite3_quota_fi..." */, FxProc: 0}, + {FzName: ts + 35870 /* "sqlite3_quota_fe..." */, FxProc: 0}, } /* test_quota.c:1948:5 */ // Type used to cache parameter information for the "circle" r-tree geometry @@ -72534,13 +74071,13 @@ func register_cube_geom(tls *libc.TLS, clientData uintptr, interp uintptr, objc var rc int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { return TCL_ERROR } - rc = sqlite3.Xsqlite3_rtree_geometry_callback(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+35394 /* "cube" */, *(*uintptr)(unsafe.Pointer(&struct { + rc = sqlite3.Xsqlite3_rtree_geometry_callback(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+35891 /* "cube" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 }{cube_geom})), uintptr(unsafe.Pointer(&gHere))) tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(0)) @@ -72556,23 +74093,23 @@ func register_circle_geom(tls *libc.TLS, clientData uintptr, interp uintptr, obj var rc int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { return TCL_ERROR } - rc = sqlite3.Xsqlite3_rtree_geometry_callback(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+35399 /* "circle" */, *(*uintptr)(unsafe.Pointer(&struct { + rc = sqlite3.Xsqlite3_rtree_geometry_callback(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+35896 /* "circle" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 }{circle_geom})), uintptr(0)) if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_rtree_query_callback(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+35406, /* "Qcircle" */ + rc = sqlite3.Xsqlite3_rtree_query_callback(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+35903, /* "Qcircle" */ *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr) int32 }{circle_query_func})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = sqlite3.Xsqlite3_rtree_query_callback(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+35414, /* "breadthfirstsear..." */ + rc = sqlite3.Xsqlite3_rtree_query_callback(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+35911, /* "breadthfirstsear..." */ *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr) int32 }{bfs_query_func})), uintptr(0), uintptr(0)) @@ -72582,10 +74119,10 @@ func register_circle_geom(tls *libc.TLS, clientData uintptr, interp uintptr, obj } func Sqlitetestrtree_Init(tls *libc.TLS, interp uintptr) int32 { /* test_rtree.c:507:5: */ - tcl.XTcl_CreateObjCommand(tls, interp, ts+35433 /* "register_cube_ge..." */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+35930 /* "register_cube_ge..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{register_cube_geom})), uintptr(0), uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+35452 /* "register_circle_..." */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+35949 /* "register_circle_..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{register_circle_geom})), uintptr(0), uintptr(0)) return TCL_OK @@ -72815,7 +74352,7 @@ func schemaCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint if pVtab != 0 { libc.Xmemset(tls, pVtab, 0, uint64(unsafe.Sizeof(schema_vtab{}))) (*schema_vtab)(unsafe.Pointer(pVtab)).Fdb = db - rc = sqlite3.Xsqlite3_declare_vtab(tls, db /* Name of database (i.e. main, temp etc.) */ /* Name of table */ /* Column number (from left-to-right, 0 upward) */ /* Column name */ /* Specified type (i.e. VARCHAR(32)) */ /* Boolean. True if NOT NULL was specified */ /* Default value for this column */ /* True if this column is part of the primary key */, ts+35473 /* "CREATE TABLE x(d..." */) + rc = sqlite3.Xsqlite3_declare_vtab(tls, db /* Name of database (i.e. main, temp etc.) */ /* Name of table */ /* Column number (from left-to-right, 0 upward) */ /* Column name */ /* Specified type (i.e. VARCHAR(32)) */ /* Boolean. True if NOT NULL was specified */ /* Default value for this column */ /* True if this column is part of the primary key */, ts+35970 /* "CREATE TABLE x(d..." */) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pVtab return rc @@ -72939,12 +74476,12 @@ __8: goto __9 } zSql = sqlite3.Xsqlite3_mprintf(tls, - ts+35545 /* "SELECT name FROM..." */, 0) + ts+36042 /* "SELECT name FROM..." */, 0) goto __10 __9: pDbList = (*schema_cursor)(unsafe.Pointer(pCur)).FpDbList zSql = sqlite3.Xsqlite3_mprintf(tls, - ts+35600, /* "SELECT name FROM..." */ + ts+36097, /* "SELECT name FROM..." */ libc.VaList(bp, sqlite3.Xsqlite3_column_text(tls, pDbList, 1))) __10: ; @@ -72971,7 +74508,7 @@ __5: // Set zSql to the SQL to the table_info pragma for the table currently // identified by the rows pointed to by statements pCur->pDbList and // pCur->pTableList. - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+35653, /* "PRAGMA %Q.table_..." */ + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+36150, /* "PRAGMA %Q.table_..." */ libc.VaList(bp+8, sqlite3.Xsqlite3_column_text(tls, (*schema_cursor)(unsafe.Pointer(pCur)).FpDbList, 1), sqlite3.Xsqlite3_column_text(tls, (*schema_cursor)(unsafe.Pointer(pCur)).FpTableList, 0))) @@ -73009,7 +74546,7 @@ func schemaFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp finalize(tls, (pCur + 16 /* &.pTableList */)) finalize(tls, (pCur + 24 /* &.pColumnList */)) finalize(tls, (pCur + 8 /* &.pDbList */)) - rc = sqlite3.Xsqlite3_prepare(tls, (*schema_vtab)(unsafe.Pointer(pVtab)).Fdb, ts+35678 /* "PRAGMA database_..." */, -1, (pCur + 8 /* &.pDbList */), uintptr(0)) + rc = sqlite3.Xsqlite3_prepare(tls, (*schema_vtab)(unsafe.Pointer(pVtab)).Fdb, ts+36175 /* "PRAGMA database_..." */, -1, (pCur + 8 /* &.pDbList */), uintptr(0)) return func() int32 { if rc == SQLITE_OK { return schemaNext(tls, pVtabCursor) @@ -73048,13 +74585,13 @@ func register_schema_module(tls *libc.TLS, clientData ClientData, interp uintptr // var db uintptr at bp, 8 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { return TCL_ERROR } - sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+4499 /* "schema" */, uintptr(unsafe.Pointer(&schemaModule)), uintptr(0)) + sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+4679 /* "schema" */, uintptr(unsafe.Pointer(&schemaModule)), uintptr(0)) return TCL_OK } @@ -73077,7 +74614,7 @@ var aObjCmd12 = [1]struct { FxProc uintptr FclientData uintptr }{ - {FzName: ts + 35699 /* "register_schema_..." */, FxProc: 0}, + {FzName: ts + 36196 /* "register_schema_..." */, FxProc: 0}, } /* test_schema.c:335:5 */ // 2001-09-15 @@ -73632,7 +75169,7 @@ func superlockIsWal(tls *libc.TLS, pLock uintptr) int32 { /* test_superlock.c:67 // var pStmt uintptr at bp, 8 // Compiled PRAGMA journal_mode statement - rc = sqlite3.Xsqlite3_prepare(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, ts+35722 /* "PRAGMA main.jour..." */, -1, bp /* &pStmt */, uintptr(0)) + rc = sqlite3.Xsqlite3_prepare(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, ts+36219 /* "PRAGMA main.jour..." */, -1, bp /* &pStmt */, uintptr(0)) if rc != SQLITE_OK { return rc } @@ -73640,7 +75177,7 @@ func superlockIsWal(tls *libc.TLS, pLock uintptr) int32 { /* test_superlock.c:67 (*Superlock)(unsafe.Pointer(pLock)).FbWal = 0 if SQLITE_ROW == sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) { var zMode uintptr = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 0) - if ((zMode != 0) && (libc.Xstrlen(tls, zMode) == uint64(3))) && (sqlite3.Xsqlite3_strnicmp(tls, ts+28782 /* "wal" */, zMode, 3) == 0) { + if ((zMode != 0) && (libc.Xstrlen(tls, zMode) == uint64(3))) && (sqlite3.Xsqlite3_strnicmp(tls, ts+29279 /* "wal" */, zMode, 3) == 0) { (*Superlock)(unsafe.Pointer(pLock)).FbWal = 1 } } @@ -73672,7 +75209,7 @@ func superlockWalLock(tls *libc.TLS, db uintptr, pBusy uintptr) int32 { /* test_ *(*uintptr)(unsafe.Pointer(bp + 8 /* p */)) = uintptr(0) // Pointer to first page of shared memory // Obtain a pointer to the sqlite3_file object open on the main db file. - rc = sqlite3.Xsqlite3_file_control(tls, db, ts+84 /* "main" */, SQLITE_FCNTL_FILE_POINTER, bp /* &fd */) + rc = sqlite3.Xsqlite3_file_control(tls, db, ts+85 /* "main" */, SQLITE_FCNTL_FILE_POINTER, bp /* &fd */) if rc != SQLITE_OK { return rc } @@ -73715,7 +75252,7 @@ func sqlite3demo_superunlock(tls *libc.TLS, pLock uintptr) { /* test_superlock.c var rc int32 // Return code var flags int32 = (SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE) *(*uintptr)(unsafe.Pointer(bp /* fd */)) = uintptr(0) - rc = sqlite3.Xsqlite3_file_control(tls, (*Superlock)(unsafe.Pointer(p)).Fdb, ts+84 /* "main" */, SQLITE_FCNTL_FILE_POINTER, bp /* &fd */) + rc = sqlite3.Xsqlite3_file_control(tls, (*Superlock)(unsafe.Pointer(p)).Fdb, ts+85 /* "main" */, SQLITE_FCNTL_FILE_POINTER, bp /* &fd */) if rc == SQLITE_OK { (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* fd */)))).FpMethods + 112 /* &.xShmLock */))))(tls, *(*uintptr)(unsafe.Pointer(bp /* fd */)), 2, 1, flags) (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* fd */)))).FpMethods + 112 /* &.xShmLock */))))(tls, *(*uintptr)(unsafe.Pointer(bp /* fd */)), 3, (SQLITE_SHM_NLOCK - 3), flags) @@ -73774,7 +75311,7 @@ func sqlite3demo_superlock(tls *libc.TLS, zPath uintptr, zVfs uintptr, xBusy uin sqlite3.Xsqlite3_busy_handler(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32) int32 }{superlockBusyHandler})), bp /* &busy */) - rc = sqlite3.Xsqlite3_exec(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, ts+12728 /* "BEGIN EXCLUSIVE" */, uintptr(0), uintptr(0), uintptr(0)) + rc = sqlite3.Xsqlite3_exec(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, ts+12908 /* "BEGIN EXCLUSIVE" */, uintptr(0), uintptr(0), uintptr(0)) } // If the BEGIN EXCLUSIVE was executed successfully and this is a WAL @@ -73787,7 +75324,7 @@ func sqlite3demo_superlock(tls *libc.TLS, zPath uintptr, zVfs uintptr, xBusy uin // new WAL locks may conflict with the old. if rc == SQLITE_OK { if (SQLITE_OK == (libc.AssignInt32(&rc, superlockIsWal(tls, pLock)))) && ((*Superlock)(unsafe.Pointer(pLock)).FbWal != 0) { - rc = sqlite3.Xsqlite3_exec(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, ts+11132 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0)) + rc = sqlite3.Xsqlite3_exec(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, ts+11312 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = superlockWalLock(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, bp /* &busy */) } @@ -73825,7 +75362,7 @@ func superunlock_del(tls *libc.TLS, cd ClientData) { /* test_superlock.c:274:27: func superunlock_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_superlock.c:278:26: */ if objc != 1 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+489 /* "" */) return TCL_ERROR } tcl.XTcl_DeleteCommand(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv)))) @@ -73870,7 +75407,7 @@ func superlock_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, obj if (objc < 3) || (objc > 5) { tcl.XTcl_WrongNumArgs(tls, - interp, 1, objv, ts+35747 /* "CMDNAME PATH ?VF..." */) + interp, 1, objv, ts+36244 /* "CMDNAME PATH ?VF..." */) return TCL_ERROR } @@ -73907,31 +75444,15 @@ func superlock_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, obj } func SqliteSuperlock_Init(tls *libc.TLS, interp uintptr) int32 { /* test_superlock.c:359:5: */ - tcl.XTcl_CreateObjCommand(tls, interp, ts+35788 /* "sqlite3demo_supe..." */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+36285 /* "sqlite3demo_supe..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32 }{superlock_cmd})), uintptr(0), uintptr(0)) return TCL_OK } -// Define error_t. -// Copyright (C) 1991-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -type error_t = int32 /* error_t.h:22:13 */ +// bits/errno.h may have defined this type. If it didn't, provide a +// fallback definition. +type error_t = int32 /* errno.h:52:13 */ type TestSyscallGlobal = struct { FbPersist int32 @@ -73952,24 +75473,24 @@ type TestSyscallArray = struct { } /* test_syscall.c:127:1 */ var aSyscall = [19]TestSyscallArray{ - /* 0 */ {FzName: ts + 35810 /* "open" */, FxTest: 0, Fdefault_errno: EACCES}, - /* 1 */ {FzName: ts + 9947 /* "close" */, FxTest: 0}, - /* 2 */ {FzName: ts + 35815 /* "access" */, FxTest: 0}, - /* 3 */ {FzName: ts + 35822 /* "getcwd" */, FxTest: 0}, - /* 4 */ {FzName: ts + 35829 /* "stat" */, FxTest: 0}, - /* 5 */ {FzName: ts + 35834 /* "fstat" */, FxTest: 0}, - /* 6 */ {FzName: ts + 35840 /* "ftruncate" */, FxTest: 0, Fdefault_errno: EIO}, - /* 7 */ {FzName: ts + 35850 /* "fcntl" */, FxTest: 0, Fdefault_errno: EACCES}, - /* 8 */ {FzName: ts + 24104 /* "read" */, FxTest: 0}, - /* 9 */ {FzName: ts + 35856 /* "pread" */, FxTest: 0}, - /* 10 */ {FzName: ts + 35862 /* "pread64" */, FxTest: 0}, - /* 11 */ {FzName: ts + 24109 /* "write" */, FxTest: 0}, - /* 12 */ {FzName: ts + 35870 /* "pwrite" */, FxTest: 0}, - /* 13 */ {FzName: ts + 35877 /* "pwrite64" */, FxTest: 0}, - /* 14 */ {FzName: ts + 35886 /* "fchmod" */, FxTest: 0}, - /* 15 */ {FzName: ts + 35893 /* "fallocate" */, FxTest: 0}, - /* 16 */ {FzName: ts + 27885 /* "mmap" */, FxTest: 0}, - /* 17 */ {FzName: ts + 35903 /* "mremap" */, FxTest: 0}, + /* 0 */ {FzName: ts + 36307 /* "open" */, FxTest: 0, Fdefault_errno: EACCES}, + /* 1 */ {FzName: ts + 10127 /* "close" */, FxTest: 0}, + /* 2 */ {FzName: ts + 36312 /* "access" */, FxTest: 0}, + /* 3 */ {FzName: ts + 36319 /* "getcwd" */, FxTest: 0}, + /* 4 */ {FzName: ts + 36326 /* "stat" */, FxTest: 0}, + /* 5 */ {FzName: ts + 36331 /* "fstat" */, FxTest: 0}, + /* 6 */ {FzName: ts + 36337 /* "ftruncate" */, FxTest: 0, Fdefault_errno: EIO}, + /* 7 */ {FzName: ts + 36347 /* "fcntl" */, FxTest: 0, Fdefault_errno: EACCES}, + /* 8 */ {FzName: ts + 24593 /* "read" */, FxTest: 0}, + /* 9 */ {FzName: ts + 36353 /* "pread" */, FxTest: 0}, + /* 10 */ {FzName: ts + 36359 /* "pread64" */, FxTest: 0}, + /* 11 */ {FzName: ts + 24598 /* "write" */, FxTest: 0}, + /* 12 */ {FzName: ts + 36367 /* "pwrite" */, FxTest: 0}, + /* 13 */ {FzName: ts + 36374 /* "pwrite64" */, FxTest: 0}, + /* 14 */ {FzName: ts + 36383 /* "fchmod" */, FxTest: 0}, + /* 15 */ {FzName: ts + 36390 /* "fallocate" */, FxTest: 0}, + /* 16 */ {FzName: ts + 28374 /* "mmap" */, FxTest: 0}, + /* 17 */ {FzName: ts + 36400 /* "mremap" */, FxTest: 0}, {}, } /* test_syscall.c:133:3 */ @@ -74021,7 +75542,7 @@ func tsIsFailErrno(tls *libc.TLS, zFunc uintptr) int32 { /* test_syscall.c:215:1 // A wrapper around open(). func ts_open(tls *libc.TLS, zFile uintptr, flags int32, mode int32) int32 { /* test_syscall.c:226:12: */ - if tsIsFailErrno(tls, ts+35810 /* "open" */) != 0 { + if tsIsFailErrno(tls, ts+36307 /* "open" */) != 0 { return -1 } return (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 16 /* &.xOrig */))))(tls, zFile, flags, mode) @@ -74067,7 +75588,7 @@ func ts_stat(tls *libc.TLS, zPath uintptr, p uintptr) int32 { /* test_syscall.c: // A wrapper around fstat(). func ts_fstat(tls *libc.TLS, fd int32, p uintptr) int32 { /* test_syscall.c:282:12: */ - if tsIsFailErrno(tls, ts+35834 /* "fstat" */) != 0 { + if tsIsFailErrno(tls, ts+36331 /* "fstat" */) != 0 { return -1 } return (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 5*32 + 16 /* &.xOrig */))))(tls, fd, p) @@ -74075,7 +75596,7 @@ func ts_fstat(tls *libc.TLS, fd int32, p uintptr) int32 { /* test_syscall.c:282: // A wrapper around ftruncate(). func ts_ftruncate(tls *libc.TLS, fd int32, n off_t) int32 { /* test_syscall.c:292:12: */ - if tsIsFailErrno(tls, ts+35840 /* "ftruncate" */) != 0 { + if tsIsFailErrno(tls, ts+36337 /* "ftruncate" */) != 0 { return -1 } return (*(*func(*libc.TLS, int32, off_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 6*32 + 16 /* &.xOrig */))))(tls, fd, n) @@ -74089,7 +75610,7 @@ func ts_fcntl(tls *libc.TLS, fd int32, cmd int32, va uintptr) int32 { /* test_sy var ap va_list _ = ap var pArg uintptr - if tsIsFailErrno(tls, ts+35850 /* "fcntl" */) != 0 { + if tsIsFailErrno(tls, ts+36347 /* "fcntl" */) != 0 { return -1 } ap = va @@ -74099,7 +75620,7 @@ func ts_fcntl(tls *libc.TLS, fd int32, cmd int32, va uintptr) int32 { /* test_sy // A wrapper around read(). func ts_read(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t) int32 { /* test_syscall.c:316:12: */ - if tsIsFailErrno(tls, ts+24104 /* "read" */) != 0 { + if tsIsFailErrno(tls, ts+24593 /* "read" */) != 0 { return -1 } return int32((*(*func(*libc.TLS, int32, uintptr, size_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 8*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf)) @@ -74107,7 +75628,7 @@ func ts_read(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t) int32 { /* test // A wrapper around pread(). func ts_pread(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t, off off_t) int32 { /* test_syscall.c:326:12: */ - if tsIsFailErrno(tls, ts+35856 /* "pread" */) != 0 { + if tsIsFailErrno(tls, ts+36353 /* "pread" */) != 0 { return -1 } return int32((*(*func(*libc.TLS, int32, uintptr, size_t, off_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 9*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf, off)) @@ -74115,7 +75636,7 @@ func ts_pread(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t, off off_t) int // A wrapper around pread64(). func ts_pread64(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t, off sqlite3_uint64) int32 { /* test_syscall.c:336:12: */ - if tsIsFailErrno(tls, ts+35862 /* "pread64" */) != 0 { + if tsIsFailErrno(tls, ts+36359 /* "pread64" */) != 0 { return -1 } return int32((*(*func(*libc.TLS, int32, uintptr, size_t, sqlite3_uint64) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 10*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf, off)) @@ -74123,8 +75644,8 @@ func ts_pread64(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t, off sqlite3_ // A wrapper around write(). func ts_write(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t) int32 { /* test_syscall.c:346:12: */ - if tsIsFailErrno(tls, ts+24109 /* "write" */) != 0 { - if tsErrno(tls, ts+24109 /* "write" */) == EINTR { + if tsIsFailErrno(tls, ts+24598 /* "write" */) != 0 { + if tsErrno(tls, ts+24598 /* "write" */) == EINTR { (*(*func(*libc.TLS, int32, uintptr, size_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 11*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, (nBuf / uint64(2))) } return -1 @@ -74134,7 +75655,7 @@ func ts_write(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t) int32 { /* tes // A wrapper around pwrite(). func ts_pwrite(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t, off off_t) int32 { /* test_syscall.c:357:12: */ - if tsIsFailErrno(tls, ts+35870 /* "pwrite" */) != 0 { + if tsIsFailErrno(tls, ts+36367 /* "pwrite" */) != 0 { return -1 } return int32((*(*func(*libc.TLS, int32, uintptr, size_t, off_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 12*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf, off)) @@ -74142,7 +75663,7 @@ func ts_pwrite(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t, off off_t) in // A wrapper around pwrite64(). func ts_pwrite64(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t, off sqlite3_uint64) int32 { /* test_syscall.c:367:12: */ - if tsIsFailErrno(tls, ts+35877 /* "pwrite64" */) != 0 { + if tsIsFailErrno(tls, ts+36374 /* "pwrite64" */) != 0 { return -1 } return int32((*(*func(*libc.TLS, int32, uintptr, size_t, sqlite3_uint64) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 13*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf, off)) @@ -74165,13 +75686,13 @@ func ts_fchmod(tls *libc.TLS, fd int32, mode mode_t) int32 { /* test_syscall.c:3 // failure. Note that errno is not set. func ts_fallocate(tls *libc.TLS, fd int32, off off_t, len off_t) int32 { /* test_syscall.c:393:12: */ if tsIsFail(tls) != 0 { - return tsErrno(tls, ts+35893 /* "fallocate" */) + return tsErrno(tls, ts+36390 /* "fallocate" */) } return (*(*func(*libc.TLS, int32, off_t, off_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 15*32 + 16 /* &.xOrig */))))(tls, fd, off, len) } func ts_mmap(tls *libc.TLS, pAddr uintptr, nByte size_t, prot int32, flags int32, fd int32, iOff off_t) uintptr { /* test_syscall.c:400:13: */ - if tsIsFailErrno(tls, ts+27885 /* "mmap" */) != 0 { + if tsIsFailErrno(tls, ts+28374 /* "mmap" */) != 0 { return libc.UintptrFromInt32(-1) } return (*(*func(*libc.TLS, uintptr, size_t, int32, int32, int32, off_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 16*32 + 16 /* &.xOrig */))))(tls, pAddr, nByte, prot, flags, fd, iOff) @@ -74184,7 +75705,7 @@ func ts_mremap(tls *libc.TLS, a uintptr, b size_t, c size_t, d int32, va uintptr var ap va_list _ = ap var pArg uintptr - if tsIsFailErrno(tls, ts+35903 /* "mremap" */) != 0 { + if tsIsFailErrno(tls, ts+36400 /* "mremap" */) != 0 { return libc.UintptrFromInt32(-1) } ap = va @@ -74203,7 +75724,7 @@ func test_syscall_install(tls *libc.TLS, clientData uintptr, interp uintptr, obj // var apElem uintptr at bp+8, 8 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+35910 /* "SYSCALL-LIST" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+36407 /* "SYSCALL-LIST" */) return TCL_ERROR } if tcl.XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp /* &nElem */, bp+8 /* &apElem */) != 0 { @@ -74215,7 +75736,7 @@ func test_syscall_install(tls *libc.TLS, clientData uintptr, interp uintptr, obj // var iCall int32 at bp+16, 4 var rc int32 = tcl.XTcl_GetIndexFromObjStruct(tls, interp, - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* apElem */)) + uintptr(i)*8)), uintptr(unsafe.Pointer(&aSyscall)), int32(unsafe.Sizeof(TestSyscallArray{})), ts+35923 /* "system-call" */, 0, bp+16 /* &iCall */) + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* apElem */)) + uintptr(i)*8)), uintptr(unsafe.Pointer(&aSyscall)), int32(unsafe.Sizeof(TestSyscallArray{})), ts+36420 /* "system-call" */, 0, bp+16 /* &iCall */) if rc != 0 { return rc } @@ -74234,7 +75755,7 @@ func test_syscall_uninstall(tls *libc.TLS, clientData uintptr, interp uintptr, o var i int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+489 /* "" */) return TCL_ERROR } @@ -74257,7 +75778,7 @@ func test_syscall_reset(tls *libc.TLS, clientData uintptr, interp uintptr, objc var rc int32 if (objc != 2) && (objc != 3) { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+489 /* "" */) return TCL_ERROR } @@ -74296,7 +75817,7 @@ func test_syscall_exists(tls *libc.TLS, clientData uintptr, interp uintptr, objc var x sqlite3_syscall_ptr if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+489 /* "" */) return TCL_ERROR } @@ -74315,7 +75836,7 @@ func test_syscall_fault(tls *libc.TLS, clientData uintptr, interp uintptr, objc *(*int32)(unsafe.Pointer(bp + 4 /* bPersist */)) = 0 if (objc != 2) && (objc != 4) { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+35935 /* "?COUNT PERSIST?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+36432 /* "?COUNT PERSIST?" */) return TCL_ERROR } @@ -74344,32 +75865,32 @@ func test_syscall_errno(tls *libc.TLS, clientData uintptr, interp uintptr, objc var rc int32 *(*[12]Errno)(unsafe.Pointer(bp + 8 /* aErrno */)) = [12]Errno{ - {Fz: ts + 35951 /* "EACCES" */, Fi: EACCES}, - {Fz: ts + 35958 /* "EINTR" */, Fi: EINTR}, - {Fz: ts + 35964 /* "EIO" */, Fi: EIO}, - {Fz: ts + 35968 /* "EOVERFLOW" */, Fi: EOVERFLOW}, - {Fz: ts + 35978 /* "ENOMEM" */, Fi: ENOMEM}, - {Fz: ts + 35985 /* "EAGAIN" */, Fi: EAGAIN}, - {Fz: ts + 35992 /* "ETIMEDOUT" */, Fi: ETIMEDOUT}, - {Fz: ts + 36002 /* "EBUSY" */, Fi: EBUSY}, - {Fz: ts + 36008 /* "EPERM" */, Fi: EPERM}, - {Fz: ts + 36014 /* "EDEADLK" */, Fi: EDEADLK}, - {Fz: ts + 36022 /* "ENOLCK" */, Fi: ENOLCK}, + {Fz: ts + 36448 /* "EACCES" */, Fi: EACCES}, + {Fz: ts + 36455 /* "EINTR" */, Fi: EINTR}, + {Fz: ts + 36461 /* "EIO" */, Fi: EIO}, + {Fz: ts + 36465 /* "EOVERFLOW" */, Fi: EOVERFLOW}, + {Fz: ts + 36475 /* "ENOMEM" */, Fi: ENOMEM}, + {Fz: ts + 36482 /* "EAGAIN" */, Fi: EAGAIN}, + {Fz: ts + 36489 /* "ETIMEDOUT" */, Fi: ETIMEDOUT}, + {Fz: ts + 36499 /* "EBUSY" */, Fi: EBUSY}, + {Fz: ts + 36505 /* "EPERM" */, Fi: EPERM}, + {Fz: ts + 36511 /* "EDEADLK" */, Fi: EDEADLK}, + {Fz: ts + 36519 /* "ENOLCK" */, Fi: ENOLCK}, {}, } if objc != 4 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+36029 /* "SYSCALL ERRNO" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+36526 /* "SYSCALL ERRNO" */) return TCL_ERROR } rc = tcl.XTcl_GetIndexFromObjStruct(tls, interp, - *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&aSyscall)), int32(unsafe.Sizeof(TestSyscallArray{})), ts+35923 /* "system-call" */, 0, bp /* &iCall */) + *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&aSyscall)), int32(unsafe.Sizeof(TestSyscallArray{})), ts+36420 /* "system-call" */, 0, bp /* &iCall */) if rc != TCL_OK { return rc } rc = tcl.XTcl_GetIndexFromObjStruct(tls, interp, - *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+8 /* &aErrno[0] */, int32(unsafe.Sizeof(Errno{})), ts+36043 /* "errno" */, 0, bp+200 /* &iErrno */) + *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+8 /* &aErrno[0] */, int32(unsafe.Sizeof(Errno{})), ts+36540 /* "errno" */, 0, bp+200 /* &iErrno */) if rc != TCL_OK { return rc } @@ -74390,7 +75911,7 @@ func test_syscall_list(tls *libc.TLS, clientData uintptr, interp uintptr, objc i var pList uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+489 /* "" */) return TCL_ERROR } @@ -74415,7 +75936,7 @@ func test_syscall_defaultvfs(tls *libc.TLS, clientData uintptr, interp uintptr, var pVfs uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+488 /* "" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+489 /* "" */) return TCL_ERROR } @@ -74436,7 +75957,7 @@ func test_syscall_pagesize(tls *libc.TLS, clientData uintptr, interp uintptr, ob // var pgsz int32 at bp+16, 4 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+36049 /* "PGSZ" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+36546 /* "PGSZ" */) return TCL_ERROR } if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+16 /* &pgsz */) != 0 { @@ -74445,17 +75966,17 @@ func test_syscall_pagesize(tls *libc.TLS, clientData uintptr, interp uintptr, ob if *(*int32)(unsafe.Pointer(bp + 16 /* pgsz */)) < 0 { if gSyscall.Forig_getpagesize != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls, pVfs, ts+36054 /* "getpagesize" */, gSyscall.Forig_getpagesize) + (*(*func(*libc.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls, pVfs, ts+36551 /* "getpagesize" */, gSyscall.Forig_getpagesize) } } else { if (*(*int32)(unsafe.Pointer(bp + 16 /* pgsz */)) < 512) || ((*(*int32)(unsafe.Pointer(bp + 16 /* pgsz */)) & (*(*int32)(unsafe.Pointer(bp + 16 /* pgsz */)) - 1)) != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+36066 /* "pgsz out of rang..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+36563 /* "pgsz out of rang..." */, 0)) return TCL_ERROR } - gSyscall.Forig_getpagesize = (*(*func(*libc.TLS, uintptr, uintptr) sqlite3_syscall_ptr)(unsafe.Pointer((pVfs + 152 /* &.xGetSystemCall */))))(tls, pVfs, ts+36054 /* "getpagesize" */) + gSyscall.Forig_getpagesize = (*(*func(*libc.TLS, uintptr, uintptr) sqlite3_syscall_ptr)(unsafe.Pointer((pVfs + 152 /* &.xGetSystemCall */))))(tls, pVfs, ts+36551 /* "getpagesize" */) gSyscall.Fpgsz = *(*int32)(unsafe.Pointer(bp + 16 /* pgsz */)) (*(*func(*libc.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls, - pVfs, ts+36054 /* "getpagesize" */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{ts_getpagesize}))) + pVfs, ts+36551 /* "getpagesize" */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{ts_getpagesize}))) } return TCL_OK @@ -74466,31 +75987,31 @@ func test_syscall(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, defer tls.Free(180) *(*[10]SyscallCmd)(unsafe.Pointer(bp + 16 /* aCmd */)) = [10]SyscallCmd{ - {FzName: ts + 36084 /* "fault" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 36581 /* "fault" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_syscall_fault}))}, - {FzName: ts + 36090 /* "install" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 36587 /* "install" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_syscall_install}))}, - {FzName: ts + 36098 /* "uninstall" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 36595 /* "uninstall" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_syscall_uninstall}))}, - {FzName: ts + 7201 /* "reset" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 7381 /* "reset" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_syscall_reset}))}, - {FzName: ts + 36043 /* "errno" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 36540 /* "errno" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_syscall_errno}))}, - {FzName: ts + 13018 /* "exists" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 13198 /* "exists" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_syscall_exists}))}, - {FzName: ts + 36108 /* "list" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 36605 /* "list" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_syscall_list}))}, - {FzName: ts + 36113 /* "defaultvfs" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 36610 /* "defaultvfs" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_syscall_defaultvfs}))}, - {FzName: ts + 36124 /* "pagesize" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 36621 /* "pagesize" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_syscall_pagesize}))}, {}, @@ -74501,15 +76022,15 @@ func test_syscall(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, var pVfs uintptr = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0)) if objc < 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31821 /* "SUB-COMMAND ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32318 /* "SUB-COMMAND ..." */) return TCL_ERROR } if ((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FiVersion < 3) || ((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FxSetSystemCall == uintptr(0)) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+36133 /* "VFS does not sup..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+36630 /* "VFS does not sup..." */, 0)) rc = TCL_ERROR } else { rc = tcl.XTcl_GetIndexFromObjStruct(tls, interp, - *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16 /* &aCmd[0] */, int32(unsafe.Sizeof(SyscallCmd{})), ts+1874 /* "sub-command" */, 0, bp+176 /* &iCmd */) + *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16 /* &aCmd[0] */, int32(unsafe.Sizeof(SyscallCmd{})), ts+1875 /* "sub-command" */, 0, bp+176 /* &iCmd */) } if rc != TCL_OK { return rc @@ -74527,7 +76048,7 @@ func SqlitetestSyscall_Init(tls *libc.TLS, interp uintptr) int32 { /* test_sysca defer tls.Free(16) *(*[1]SyscallCmd)(unsafe.Pointer(bp /* aCmd */)) = [1]SyscallCmd{ - {FzName: ts + 36169 /* "test_syscall" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 36666 /* "test_syscall" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_syscall}))}, } @@ -74567,7 +76088,7 @@ func sqlite3TestInit(tls *libc.TLS, interp uintptr) uintptr { /* test_tclsh.c:58 } - if tcl.XTcl_GetCommandInfo(tls, interp, ts+13769 /* "sqlite3" */, bp+16 /* &cmdInfo */) == 0 { + if tcl.XTcl_GetCommandInfo(tls, interp, ts+13949 /* "sqlite3" */, bp+16 /* &cmdInfo */) == 0 { Sqlite3_Init(tls, interp) } Md5_Init(tls, interp) @@ -74613,7 +76134,7 @@ func sqlite3TestInit(tls *libc.TLS, interp uintptr) uintptr { /* test_tclsh.c:58 Sqlitetestvdbecov_Init(tls, interp) tcl.XTcl_CreateObjCommand(tls, - interp, ts+36182 /* "load_testfixture..." */, *(*uintptr)(unsafe.Pointer(&struct { + interp, ts+36679 /* "load_testfixture..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32 }{load_testfixture_extensions})), uintptr(0), uintptr(0)) return uintptr(0) @@ -74623,7 +76144,7 @@ func sqlite3TestInit(tls *libc.TLS, interp uintptr) uintptr { /* test_tclsh.c:58 func load_testfixture_extensions(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_tclsh.c:185:26: */ var slave uintptr if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+36210 /* "SLAVE" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+36707 /* "SLAVE" */) return TCL_ERROR } @@ -74765,7 +76286,7 @@ var zSchema = // Array index // Value // base(index) name -*(*[100]int8)(unsafe.Pointer(ts + 36216 /* "CREATE TABLE x( ..." */)) /* test_tclvar.c:88:21 */ +*(*[100]int8)(unsafe.Pointer(ts + 36713 /* "CREATE TABLE x( ..." */)) /* test_tclvar.c:88:21 */ // Note that for this virtual table, the xCreate and xConnect // methods are identical. @@ -74817,7 +76338,7 @@ func next2(tls *libc.TLS, interp uintptr, pCur uintptr, pObj uintptr) int32 { /* if pObj != 0 { if !(int32((*tclvar_cursor)(unsafe.Pointer(pCur)).FpList2) != 0) { - p = tcl.XTcl_NewStringObj(tls, ts+36316 /* "array names" */, -1) + p = tcl.XTcl_NewStringObj(tls, ts+36813 /* "array names" */, -1) (*Tcl_Obj)(unsafe.Pointer(p)).FrefCount++ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), p, pObj) tcl.XTcl_EvalObjEx(tls, interp, p, TCL_EVAL_GLOBAL) @@ -74878,13 +76399,13 @@ func tclvarNext(tls *libc.TLS, cur uintptr) int32 { /* test_tclvar.c:168:12: */ func tclvarFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_tclvar.c:188:12: */ var pCur uintptr = pVtabCursor var interp uintptr = (*tclvar_vtab)(unsafe.Pointer((*sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab)).Finterp - var p uintptr = tcl.XTcl_NewStringObj(tls, ts+36328 /* "tclvar_filter_cm..." */, -1) + var p uintptr = tcl.XTcl_NewStringObj(tls, ts+36825 /* "tclvar_filter_cm..." */, -1) - var zEq uintptr = ts + 488 /* "" */ - var zMatch uintptr = ts + 488 /* "" */ - var zGlob uintptr = ts + 488 /* "" */ - var zRegexp uintptr = ts + 488 /* "" */ - var zLike uintptr = ts + 488 /* "" */ + var zEq uintptr = ts + 489 /* "" */ + var zMatch uintptr = ts + 489 /* "" */ + var zGlob uintptr = ts + 489 /* "" */ + var zRegexp uintptr = ts + 489 /* "" */ + var zLike uintptr = ts + 489 /* "" */ var i int32 for i = 0; *(*int8)(unsafe.Pointer(idxStr + uintptr(i))) != 0; i++ { @@ -74957,7 +76478,7 @@ func tclvarColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* t // var p2 uintptr at bp+24, 8 var z1 uintptr - var z2 uintptr = ts + 488 /* "" */ + var z2 uintptr = ts + 489 /* "" */ var pCur uintptr = cur var interp uintptr = (*tclvar_vtab)(unsafe.Pointer((*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).Finterp @@ -74996,7 +76517,7 @@ func tclvarColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* t { var z3 uintptr if *(*uintptr)(unsafe.Pointer(bp + 24 /* p2 */)) != 0 { - z3 = sqlite3.Xsqlite3_mprintf(tls, ts+36346 /* "%s(%s)" */, libc.VaList(bp, z1, z2)) + z3 = sqlite3.Xsqlite3_mprintf(tls, ts+36843 /* "%s(%s)" */, libc.VaList(bp, z1, z2)) sqlite3.Xsqlite3_result_text(tls, ctx, z3, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free}))) } else { sqlite3.Xsqlite3_result_text(tls, ctx, z1, -1, libc.UintptrFromInt32(-1)) @@ -75051,7 +76572,7 @@ func tclvarSetOmit(tls *libc.TLS, interp uintptr) int32 { /* test_tclvar.c:324:1 *(*int32)(unsafe.Pointer(bp /* res */)) = 0 var pRes uintptr rc = tcl.XTcl_Eval(tls, interp, - ts+36353 /* "expr {[info exis..." */) + ts+36850 /* "expr {[info exis..." */) if rc == TCL_OK { pRes = tcl.XTcl_GetObjResult(tls, interp) rc = tcl.XTcl_GetBooleanFromObj(tls, uintptr(0), pRes, bp /* &res */) @@ -75148,7 +76669,7 @@ func tclvarUpdate(tls *libc.TLS, tab uintptr, argc int32, argv uintptr, pRowid u var zValue uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8))) var zName uintptr if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 5*8))) != SQLITE_TEXT { - (*sqlite3_vtab)(unsafe.Pointer(tab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+36414 /* "the 'fullname' c..." */, 0) + (*sqlite3_vtab)(unsafe.Pointer(tab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+36911 /* "the 'fullname' c..." */, 0) return SQLITE_ERROR } zName = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 5*8))) @@ -75174,7 +76695,7 @@ func tclvarUpdate(tls *libc.TLS, tab uintptr, argc int32, argv uintptr, pRowid u } return SQLITE_OK } - (*sqlite3_vtab)(unsafe.Pointer(tab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+36449 /* "prohibited TCL v..." */, 0) + (*sqlite3_vtab)(unsafe.Pointer(tab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+36946 /* "prohibited TCL v..." */, 0) return SQLITE_ERROR } @@ -75205,16 +76726,16 @@ func register_tclvar_module(tls *libc.TLS, clientData ClientData, interp uintptr // var db uintptr at bp, 8 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { return TCL_ERROR } - sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+28695 /* "tclvar" */, uintptr(unsafe.Pointer(&tclvarModule)), interp) + sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+29192 /* "tclvar" */, uintptr(unsafe.Pointer(&tclvarModule)), interp) rc = tcl.XTcl_Eval(tls, interp, - ts+36480 /* "proc like {patte..." */) + ts+36977 /* "proc like {patte..." */) return rc } @@ -75237,7 +76758,7 @@ var aObjCmd13 = [1]struct { FxProc uintptr FclientData uintptr }{ - {FzName: ts + 37016 /* "register_tclvar_..." */, FxProc: 0}, + {FzName: ts + 37513 /* "register_tclvar_..." */, FxProc: 0}, } /* test_tclvar.c:552:5 */ // Define some macros helping to catch buffer overflows. @@ -75318,21 +76839,21 @@ func tclScriptThread(tls *libc.TLS, pSqlThread ClientData) { /* test_thread.c:11 var p uintptr = pSqlThread interp = tcl.XTcl_CreateInterp(tls) - tcl.XTcl_CreateObjCommand(tls, interp, ts+37039 /* "clock_seconds" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+37536 /* "clock_seconds" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32 }{clock_seconds_proc})), uintptr(0), uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+37053 /* "sqlthread" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+37550 /* "sqlthread" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32 }{sqlthread_proc})), pSqlThread, uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+37063 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+37560 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{blocking_step_proc})), uintptr(0), uintptr(0)) tcl.XTcl_CreateObjCommand(tls, interp, - ts+37085 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct { + ts+37582 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{blocking_prepare_v2_proc})), uintptr(1), uintptr(0)) tcl.XTcl_CreateObjCommand(tls, interp, - ts+37113 /* "sqlite3_nonblock..." */, *(*uintptr)(unsafe.Pointer(&struct { + ts+37610 /* "sqlite3_nonblock..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{blocking_prepare_v2_proc})), uintptr(0), uintptr(0)) Sqlitetest1_Init(tls, interp) @@ -75346,7 +76867,7 @@ func tclScriptThread(tls *libc.TLS, pSqlThread ClientData) { /* test_thread.c:11 (*Tcl_Obj)(unsafe.Pointer(pRes)).FrefCount++ if rc != TCL_OK { - tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewStringObj(tls, ts+10131 /* "error" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewStringObj(tls, ts+10311 /* "error" */, -1)) tcl.XTcl_ListObjAppendElement(tls, interp, pList, pRes) postToParent(tls, p, pList) for ok := true; ok; ok = 0 != 0 { @@ -75358,7 +76879,7 @@ func tclScriptThread(tls *libc.TLS, pSqlThread ClientData) { /* test_thread.c:11 pList = tcl.XTcl_NewObj(tls) } - tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewStringObj(tls, ts+37144 /* "set" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewStringObj(tls, ts+37641 /* "set" */, -1)) tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewStringObj(tls, (*SqlThread)(unsafe.Pointer(p)).FzVarname, -1)) tcl.XTcl_ListObjAppendElement(tls, interp, pList, pRes) postToParent(tls, p, pList) @@ -75426,7 +76947,7 @@ func sqlthread_spawn(tls *libc.TLS, clientData ClientData, interp uintptr, objc rc = tcl.XTcl_CreateThread(tls, bp+24 /* &x */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{tclScriptThread})), pNew, nStack, flags) if rc != TCL_OK { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+37148 /* "Error in Tcl_Cre..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+37645 /* "Error in Tcl_Cre..." */, 0)) tcl.XTcl_Free(tls, pNew) return TCL_ERROR } @@ -75456,7 +76977,7 @@ func sqlthread_parent(tls *libc.TLS, clientData ClientData, interp uintptr, objc _ = objc if p == uintptr(0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+37176 /* "no parent thread" */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+37673 /* "no parent thread" */, 0)) return TCL_ERROR } @@ -75544,18 +77065,18 @@ func sqlthread_proc(tls *libc.TLS, clientData ClientData, interp uintptr, objc i _ [4]byte FzUsage uintptr }{ - {FzName: ts + 37193 /* "parent" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 37690 /* "parent" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32 - }{sqlthread_parent})), FnArg: 1, FzUsage: ts + 11405 /* "SCRIPT" */}, - {FzName: ts + 37200 /* "spawn" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct { + }{sqlthread_parent})), FnArg: 1, FzUsage: ts + 11585 /* "SCRIPT" */}, + {FzName: ts + 37697 /* "spawn" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32 - }{sqlthread_spawn})), FnArg: 2, FzUsage: ts + 37206 /* "VARNAME SCRIPT" */}, - {FzName: ts + 35810 /* "open" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct { + }{sqlthread_spawn})), FnArg: 2, FzUsage: ts + 37703 /* "VARNAME SCRIPT" */}, + {FzName: ts + 36307 /* "open" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32 - }{sqlthread_open})), FnArg: 1, FzUsage: ts + 37221 /* "DBNAME" */}, - {FzName: ts + 37228 /* "id" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct { + }{sqlthread_open})), FnArg: 1, FzUsage: ts + 37718 /* "DBNAME" */}, + {FzName: ts + 37725 /* "id" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32 - }{sqlthread_id})), FzUsage: ts + 488 /* "" */}, + }{sqlthread_id})), FzUsage: ts + 489 /* "" */}, {}, } var pSub uintptr @@ -75563,7 +77084,7 @@ func sqlthread_proc(tls *libc.TLS, clientData ClientData, interp uintptr, objc i // var iIndex int32 at bp+160, 4 if objc < 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2383 /* "SUB-COMMAND" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2384 /* "SUB-COMMAND" */) return TCL_ERROR } @@ -75574,7 +77095,7 @@ func sqlthread_proc(tls *libc.TLS, clientData ClientData, interp uintptr, objc i FnArg int32 _ [4]byte FzUsage uintptr - }{})), ts+1874 /* "sub-command" */, 0, bp+160 /* &iIndex */) + }{})), ts+1875 /* "sub-command" */, 0, bp+160 /* &iIndex */) if rc != TCL_OK { return rc } @@ -75748,7 +77269,7 @@ func blocking_step_proc(tls *libc.TLS, clientData uintptr, interp uintptr, objc var rc int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16285 /* "STMT" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16629 /* "STMT" */) return TCL_ERROR } @@ -75778,8 +77299,8 @@ func blocking_prepare_v2_proc(tls *libc.TLS, clientData uintptr, interp uintptr, var isBlocking int32 = libc.BoolInt32(!(clientData == uintptr(0))) if (objc != 5) && (objc != 4) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */ - tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16331 /* " DB sql bytes ta..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14631, /* "wrong # args: sh..." */ + tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv))), ts+16675 /* " DB sql bytes ta..." */, 0)) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp+80 /* &db */) != 0 { @@ -75804,7 +77325,7 @@ func blocking_prepare_v2_proc(tls *libc.TLS, clientData uintptr, interp uintptr, } if rc != SQLITE_OK { - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+37231 /* "%s " */, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc))) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+37728 /* "%s " */, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc))) tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+112 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0)) return TCL_ERROR } @@ -75824,21 +77345,21 @@ func blocking_prepare_v2_proc(tls *libc.TLS, clientData uintptr, interp uintptr, // Register commands with the TCL interpreter. func SqlitetestThread_Init(tls *libc.TLS, interp uintptr) int32 { /* test_thread.c:619:5: */ - tcl.XTcl_CreateObjCommand(tls, interp, ts+37053 /* "sqlthread" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+37550 /* "sqlthread" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32 }{sqlthread_proc})), uintptr(0), uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+37039 /* "clock_seconds" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+37536 /* "clock_seconds" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32 }{clock_seconds_proc})), uintptr(0), uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+37063 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+37560 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{blocking_step_proc})), uintptr(0), uintptr(0)) tcl.XTcl_CreateObjCommand(tls, interp, - ts+37085 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct { + ts+37582 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{blocking_prepare_v2_proc})), uintptr(1), uintptr(0)) tcl.XTcl_CreateObjCommand(tls, interp, - ts+37113 /* "sqlite3_nonblock..." */, *(*uintptr)(unsafe.Pointer(&struct { + ts+37610 /* "sqlite3_nonblock..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{blocking_prepare_v2_proc})), uintptr(0), uintptr(0)) return TCL_OK @@ -75954,15 +77475,15 @@ func tvfsResultCode(tls *libc.TLS, p uintptr, pRc uintptr) int32 { /* test_vfs.c defer tls.Free(144) *(*[9]errcode)(unsafe.Pointer(bp /* aCode */)) = [9]errcode{ - {FzCode: ts + 1987 /* "SQLITE_OK" */}, - {FeCode: SQLITE_ERROR, FzCode: ts + 1974 /* "SQLITE_ERROR" */}, - {FeCode: SQLITE_IOERR, FzCode: ts + 37235 /* "SQLITE_IOERR" */}, - {FeCode: SQLITE_LOCKED, FzCode: ts + 37248 /* "SQLITE_LOCKED" */}, - {FeCode: SQLITE_BUSY, FzCode: ts + 37262 /* "SQLITE_BUSY" */}, - {FeCode: SQLITE_READONLY, FzCode: ts + 37274 /* "SQLITE_READONLY" */}, - {FeCode: (SQLITE_READONLY | (int32(5) << 8)), FzCode: ts + 37290 /* "SQLITE_READONLY_..." */}, - {FeCode: SQLITE_NOTFOUND, FzCode: ts + 37315 /* "SQLITE_NOTFOUND" */}, - {FeCode: -1, FzCode: ts + 37331 /* "SQLITE_OMIT" */}, + {FzCode: ts + 1988 /* "SQLITE_OK" */}, + {FeCode: SQLITE_ERROR, FzCode: ts + 1975 /* "SQLITE_ERROR" */}, + {FeCode: SQLITE_IOERR, FzCode: ts + 37732 /* "SQLITE_IOERR" */}, + {FeCode: SQLITE_LOCKED, FzCode: ts + 37745 /* "SQLITE_LOCKED" */}, + {FeCode: SQLITE_BUSY, FzCode: ts + 37759 /* "SQLITE_BUSY" */}, + {FeCode: SQLITE_READONLY, FzCode: ts + 37771 /* "SQLITE_READONLY" */}, + {FeCode: (SQLITE_READONLY | (int32(5) << 8)), FzCode: ts + 37787 /* "SQLITE_READONLY_..." */}, + {FeCode: SQLITE_NOTFOUND, FzCode: ts + 37812 /* "SQLITE_NOTFOUND" */}, + {FeCode: -1, FzCode: ts + 37828 /* "SQLITE_OMIT" */}, } var z uintptr var i int32 @@ -76042,7 +77563,7 @@ func tvfsClose(tls *libc.TLS, pFile uintptr) int32 { /* test_vfs.c:317:12: */ var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_CLOSE_MASK) != 0) { - tvfsExecTcl(tls, p, ts+34333, /* "xClose" */ + tvfsExecTcl(tls, p, ts+34830, /* "xClose" */ tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, uintptr(0), uintptr(0)) } @@ -76073,7 +77594,7 @@ func tvfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqli var pFd uintptr = (*TestvfsFile)(unsafe.Pointer(pFile)).FpFd var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_READ_MASK) != 0) { - tvfsExecTcl(tls, p, ts+34340, /* "xRead" */ + tvfsExecTcl(tls, p, ts+34837, /* "xRead" */ tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, uintptr(0), uintptr(0)) tvfsResultCode(tls, p, bp /* &rc */) } @@ -76096,7 +77617,7 @@ func tvfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sql var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_WRITE_MASK) != 0) { - tvfsExecTcl(tls, p, ts+34346, /* "xWrite" */ + tvfsExecTcl(tls, p, ts+34843, /* "xWrite" */ tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, tcl.XTcl_NewWideIntObj(tls, iOfst), tcl.XTcl_NewIntObj(tls, iAmt)) tvfsResultCode(tls, p, bp /* &rc */) @@ -76128,7 +77649,7 @@ func tvfsTruncate(tls *libc.TLS, pFile uintptr, size sqlite_int64) int32 { /* te var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_TRUNCATE_MASK) != 0) { - tvfsExecTcl(tls, p, ts+34353, /* "xTruncate" */ + tvfsExecTcl(tls, p, ts+34850, /* "xTruncate" */ tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, uintptr(0), uintptr(0)) tvfsResultCode(tls, p, bp /* &rc */) } @@ -76153,26 +77674,26 @@ func tvfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* test_vfs.c:4 switch flags { case SQLITE_SYNC_NORMAL: - zFlags = ts + 15900 /* "normal" */ + zFlags = ts + 16080 /* "normal" */ break fallthrough case SQLITE_SYNC_FULL: - zFlags = ts + 17592 /* "full" */ + zFlags = ts + 17941 /* "full" */ break fallthrough case (SQLITE_SYNC_NORMAL | SQLITE_SYNC_DATAONLY): - zFlags = ts + 37343 /* "normal|dataonly" */ + zFlags = ts + 37840 /* "normal|dataonly" */ break fallthrough case (SQLITE_SYNC_FULL | SQLITE_SYNC_DATAONLY): - zFlags = ts + 37359 /* "full|dataonly" */ + zFlags = ts + 37856 /* "full|dataonly" */ break fallthrough default: } - tvfsExecTcl(tls, p, ts+26827, /* "xSync" */ + tvfsExecTcl(tls, p, ts+27316, /* "xSync" */ tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, tcl.XTcl_NewStringObj(tls, zFlags, -1), uintptr(0)) tvfsResultCode(tls, p, bp /* &rc */) @@ -76205,8 +77726,8 @@ func tvfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_vfs.c:4 if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_LOCK_MASK) != 0) { // var zLock [30]int8 at bp+8, 30 - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zLock[0] */, ts+1237 /* "%d" */, libc.VaList(bp, eLock)) - tvfsExecTcl(tls, p, ts+34373 /* "xLock" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zLock[0] */, ts+1238 /* "%d" */, libc.VaList(bp, eLock)) + tvfsExecTcl(tls, p, ts+34870 /* "xLock" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), tcl.XTcl_NewStringObj(tls, bp+8 /* &zLock[0] */, -1), uintptr(0), uintptr(0)) } return sqlite3.Xsqlite3OsLock(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal, eLock) @@ -76222,8 +77743,8 @@ func tvfsUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_vfs.c if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_UNLOCK_MASK) != 0) { // var zLock [30]int8 at bp+8, 30 - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zLock[0] */, ts+1237 /* "%d" */, libc.VaList(bp, eLock)) - tvfsExecTcl(tls, p, ts+34379 /* "xUnlock" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zLock[0] */, ts+1238 /* "%d" */, libc.VaList(bp, eLock)) + tvfsExecTcl(tls, p, ts+34876 /* "xUnlock" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), tcl.XTcl_NewStringObj(tls, bp+8 /* &zLock[0] */, -1), uintptr(0), uintptr(0)) } if (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_WRITE_MASK) != 0) && (tvfsInjectIoerr(tls, p) != 0) { @@ -76237,7 +77758,7 @@ func tvfsCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 var pFd uintptr = (*TestvfsFile)(unsafe.Pointer(pFile)).FpFd var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_CKLOCK_MASK) != 0) { - tvfsExecTcl(tls, p, ts+37373 /* "xCheckReservedLo..." */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), + tvfsExecTcl(tls, p, ts+37870 /* "xCheckReservedLo..." */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), uintptr(0), uintptr(0), uintptr(0)) } return sqlite3.Xsqlite3OsCheckReservedLock(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal, pResOut) @@ -76252,7 +77773,7 @@ func tvfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData if op == SQLITE_FCNTL_PRAGMA { var argv uintptr = pArg - if sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+10131 /* "error" */) == 0 { + if sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+10311 /* "error" */) == 0 { var rc int32 = SQLITE_ERROR if *(*uintptr)(unsafe.Pointer(argv + 2*8)) != 0 { var z uintptr = *(*uintptr)(unsafe.Pointer(argv + 2*8)) @@ -76272,16 +77793,16 @@ func tvfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 } return rc } - if sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+4485 /* "filename" */) == 0 { + if sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+4665 /* "filename" */) == 0 { *(*uintptr)(unsafe.Pointer(argv)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+8, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename)) return SQLITE_OK } } if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_FCNTL_MASK) != 0) { *(*[3]Fcntl)(unsafe.Pointer(bp + 16 /* aF */)) = [3]Fcntl{ - {FiFnctl: SQLITE_FCNTL_BEGIN_ATOMIC_WRITE, FzFnctl: ts + 37392 /* "BEGIN_ATOMIC_WRI..." */}, - {FiFnctl: SQLITE_FCNTL_COMMIT_ATOMIC_WRITE, FzFnctl: ts + 37411 /* "COMMIT_ATOMIC_WR..." */}, - {FiFnctl: SQLITE_FCNTL_ZIPVFS, FzFnctl: ts + 37431 /* "ZIPVFS" */}, + {FiFnctl: SQLITE_FCNTL_BEGIN_ATOMIC_WRITE, FzFnctl: ts + 37889 /* "BEGIN_ATOMIC_WRI..." */}, + {FiFnctl: SQLITE_FCNTL_COMMIT_ATOMIC_WRITE, FzFnctl: ts + 37908 /* "COMMIT_ATOMIC_WR..." */}, + {FiFnctl: SQLITE_FCNTL_ZIPVFS, FzFnctl: ts + 37928 /* "ZIPVFS" */}, } var i int32 for i = 0; uint64(i) < (uint64(unsafe.Sizeof([3]Fcntl{})) / uint64(unsafe.Sizeof(Fcntl{}))); i++ { @@ -76291,7 +77812,7 @@ func tvfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 } if uint64(i) < (uint64(unsafe.Sizeof([3]Fcntl{})) / uint64(unsafe.Sizeof(Fcntl{}))) { *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = 0 - tvfsExecTcl(tls, p, ts+34401, /* "xFileControl" */ + tvfsExecTcl(tls, p, ts+34898, /* "xFileControl" */ tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), tcl.XTcl_NewStringObj(tls, (*Fcntl)(unsafe.Pointer(bp+16 /* &aF */ +uintptr(i)*16)).FzFnctl, -1), uintptr(0), uintptr(0)) @@ -76378,7 +77899,7 @@ func tvfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags i z += (uintptr(libc.Xstrlen(tls, z) + uint64(1))) } } - tvfsExecTcl(tls, p, ts+26399 /* "xOpen" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), pArg, uintptr(0), uintptr(0)) + tvfsExecTcl(tls, p, ts+26888 /* "xOpen" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), pArg, uintptr(0), uintptr(0)) for ok := true; ok; ok = 0 != 0 { var _objPtr uintptr = pArg if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 { @@ -76405,7 +77926,7 @@ func tvfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags i } if !(pId != 0) { - pId = tcl.XTcl_NewStringObj(tls, ts+37438 /* "anon" */, -1) + pId = tcl.XTcl_NewStringObj(tls, ts+37935 /* "anon" */, -1) } (*Tcl_Obj)(unsafe.Pointer(pId)).FrefCount++ (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId = pId @@ -76451,7 +77972,7 @@ func tvfsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 var p uintptr = (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_DELETE_MASK) != 0) { - tvfsExecTcl(tls, p, ts+34438, /* "xDelete" */ + tvfsExecTcl(tls, p, ts+34935, /* "xDelete" */ tcl.XTcl_NewStringObj(tls, zPath, -1), tcl.XTcl_NewIntObj(tls, dirSync), uintptr(0), uintptr(0)) tvfsResultCode(tls, p, bp /* &rc */) } @@ -76473,15 +77994,15 @@ func tvfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut var zArg uintptr = uintptr(0) if flags == SQLITE_ACCESS_EXISTS { - zArg = ts + 37443 /* "SQLITE_ACCESS_EX..." */ + zArg = ts + 37940 /* "SQLITE_ACCESS_EX..." */ } if flags == SQLITE_ACCESS_READWRITE { - zArg = ts + 37464 /* "SQLITE_ACCESS_RE..." */ + zArg = ts + 37961 /* "SQLITE_ACCESS_RE..." */ } if flags == SQLITE_ACCESS_READ { - zArg = ts + 37488 /* "SQLITE_ACCESS_RE..." */ + zArg = ts + 37985 /* "SQLITE_ACCESS_RE..." */ } - tvfsExecTcl(tls, p, ts+34446, /* "xAccess" */ + tvfsExecTcl(tls, p, ts+34943, /* "xAccess" */ tcl.XTcl_NewStringObj(tls, zPath, -1), tcl.XTcl_NewStringObj(tls, zArg, -1), uintptr(0), uintptr(0)) if tvfsResultCode(tls, p, bp /* &rc */) != 0 { if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK { @@ -76508,7 +78029,7 @@ func tvfsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zO if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_FULLPATHNAME_MASK) != 0) { // var rc int32 at bp, 4 - tvfsExecTcl(tls, p, ts+34454 /* "xFullPathname" */, tcl.XTcl_NewStringObj(tls, zPath, -1), uintptr(0), uintptr(0), uintptr(0)) + tvfsExecTcl(tls, p, ts+34951 /* "xFullPathname" */, tcl.XTcl_NewStringObj(tls, zPath, -1), uintptr(0), uintptr(0), uintptr(0)) if tvfsResultCode(tls, p, bp /* &rc */) != 0 { if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp /* rc */)) @@ -76552,7 +78073,7 @@ func tvfsShmOpen(tls *libc.TLS, pFile uintptr) int32 { /* test_vfs.c:827:12: */ // SCRIPT xShmOpen FILENAME tcl.XTcl_ResetResult(tls, (*Testvfs)(unsafe.Pointer(p)).Finterp) if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_SHMOPEN_MASK) != 0) { - tvfsExecTcl(tls, p, ts+37507 /* "xShmOpen" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), uintptr(0), uintptr(0), uintptr(0)) + tvfsExecTcl(tls, p, ts+38004 /* "xShmOpen" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), uintptr(0), uintptr(0), uintptr(0)) if tvfsResultCode(tls, p, bp /* &rc */) != 0 { if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp /* rc */)) @@ -76606,7 +78127,8 @@ func tvfsShmMap(tls *libc.TLS, pFile uintptr, iPage int32, pgsz int32, isWrite i var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData if (*Testvfs)(unsafe.Pointer(p)).FisFullshm != 0 { - return sqlite3.Xsqlite3OsShmMap(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal, iPage, pgsz, isWrite, libc.AtomicLoadUintptr(&pp)) + var pReal uintptr = (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pReal)).FpMethods + 104 /* &.xShmMap */))))(tls, pReal, iPage, pgsz, isWrite, libc.AtomicLoadUintptr(&pp)) } if uintptr(0) == (*TestvfsFd)(unsafe.Pointer(pFd)).FpShm { @@ -76622,7 +78144,7 @@ func tvfsShmMap(tls *libc.TLS, pFile uintptr, iPage int32, pgsz int32, isWrite i tcl.XTcl_ListObjAppendElement(tls, (*Testvfs)(unsafe.Pointer(p)).Finterp, pArg, tcl.XTcl_NewIntObj(tls, iPage)) tcl.XTcl_ListObjAppendElement(tls, (*Testvfs)(unsafe.Pointer(p)).Finterp, pArg, tcl.XTcl_NewIntObj(tls, pgsz)) tcl.XTcl_ListObjAppendElement(tls, (*Testvfs)(unsafe.Pointer(p)).Finterp, pArg, tcl.XTcl_NewIntObj(tls, isWrite)) - tvfsExecTcl(tls, p, ts+34531, /* "xShmMap" */ + tvfsExecTcl(tls, p, ts+35028, /* "xShmMap" */ tcl.XTcl_NewStringObj(tls, (*TestvfsBuffer)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpShm)).FzFile, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, pArg, uintptr(0)) tvfsResultCode(tls, p, bp /* &rc */) for ok := true; ok; ok = 0 != 0 { @@ -76646,7 +78168,7 @@ func tvfsShmMap(tls *libc.TLS, pFile uintptr, iPage int32, pgsz int32, isWrite i return *(*int32)(unsafe.Pointer(bp /* rc */)) } -func tvfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* test_vfs.c:935:12: */ +func tvfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* test_vfs.c:936:12: */ bp := tls.Alloc(100) defer tls.Free(100) @@ -76657,24 +78179,25 @@ func tvfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) // var zLock [80]int8 at bp+16, 80 if (*Testvfs)(unsafe.Pointer(p)).FisFullshm != 0 { - return sqlite3.Xsqlite3OsShmLock(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal, ofst, n, flags) + var pReal uintptr = (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pReal)).FpMethods + 112 /* &.xShmLock */))))(tls, pReal, ofst, n, flags) } if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_SHMLOCK_MASK) != 0) { - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([80]int8{})), bp+16 /* &zLock[0] */, ts+17132 /* "%d %d" */, libc.VaList(bp, ofst, n)) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([80]int8{})), bp+16 /* &zLock[0] */, ts+17476 /* "%d %d" */, libc.VaList(bp, ofst, n)) nLock = int32(libc.Xstrlen(tls, bp+16 /* &zLock[0] */)) if (flags & SQLITE_SHM_LOCK) != 0 { - libc.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+37516 /* " lock" */) + libc.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+38013 /* " lock" */) } else { - libc.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+37522 /* " unlock" */) + libc.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+38019 /* " unlock" */) } nLock = nLock + (int32(libc.Xstrlen(tls, (bp + 16 /* &zLock */ + uintptr(nLock))))) if (flags & SQLITE_SHM_SHARED) != 0 { - libc.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+37530 /* " shared" */) + libc.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+38027 /* " shared" */) } else { - libc.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+37538 /* " exclusive" */) + libc.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+38035 /* " exclusive" */) } - tvfsExecTcl(tls, p, ts+34510, /* "xShmLock" */ + tvfsExecTcl(tls, p, ts+35007, /* "xShmLock" */ tcl.XTcl_NewStringObj(tls, (*TestvfsBuffer)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpShm)).FzFile, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, tcl.XTcl_NewStringObj(tls, bp+16 /* &zLock[0] */, -1), uintptr(0)) tvfsResultCode(tls, p, bp+96 /* &rc */) @@ -76720,7 +78243,7 @@ func tvfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) return *(*int32)(unsafe.Pointer(bp + 96 /* rc */)) } -func tvfsShmBarrier(tls *libc.TLS, pFile uintptr) { /* test_vfs.c:1002:13: */ +func tvfsShmBarrier(tls *libc.TLS, pFile uintptr) { /* test_vfs.c:1004:13: */ var pFd uintptr = (*TestvfsFile)(unsafe.Pointer(pFile)).FpFd var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData @@ -76729,18 +78252,19 @@ func tvfsShmBarrier(tls *libc.TLS, pFile uintptr) { /* test_vfs.c:1002:13: */ if (*TestvfsFd)(unsafe.Pointer(pFd)).FpShm != 0 { z = (*TestvfsBuffer)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpShm)).FzFile } else { - z = ts + 488 /* "" */ + z = ts + 489 /* "" */ } - tvfsExecTcl(tls, p, ts+34519 /* "xShmBarrier" */, tcl.XTcl_NewStringObj(tls, z, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, uintptr(0), uintptr(0)) + tvfsExecTcl(tls, p, ts+35016 /* "xShmBarrier" */, tcl.XTcl_NewStringObj(tls, z, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, uintptr(0), uintptr(0)) } if (*Testvfs)(unsafe.Pointer(p)).FisFullshm != 0 { - sqlite3.Xsqlite3OsShmBarrier(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal) + var pReal uintptr = (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pReal)).FpMethods + 120 /* &.xShmBarrier */))))(tls, pReal) return } } -func tvfsShmUnmap(tls *libc.TLS, pFile uintptr, deleteFlag int32) int32 { /* test_vfs.c:1017:12: */ +func tvfsShmUnmap(tls *libc.TLS, pFile uintptr, deleteFlag int32) int32 { /* test_vfs.c:1020:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -76751,7 +78275,8 @@ func tvfsShmUnmap(tls *libc.TLS, pFile uintptr, deleteFlag int32) int32 { /* tes var ppFd uintptr if (*Testvfs)(unsafe.Pointer(p)).FisFullshm != 0 { - return sqlite3.Xsqlite3OsShmUnmap(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal, deleteFlag) + var pReal uintptr = (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pReal)).FpMethods + 128 /* &.xShmUnmap */))))(tls, pReal, deleteFlag) } if !(pBuffer != 0) { @@ -76759,7 +78284,7 @@ func tvfsShmUnmap(tls *libc.TLS, pFile uintptr, deleteFlag int32) int32 { /* tes } if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & TESTVFS_SHMCLOSE_MASK) != 0) { - tvfsExecTcl(tls, p, ts+34500, /* "xShmUnmap" */ + tvfsExecTcl(tls, p, ts+34997, /* "xShmUnmap" */ tcl.XTcl_NewStringObj(tls, (*TestvfsBuffer)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpShm)).FzFile, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, uintptr(0), uintptr(0)) tvfsResultCode(tls, p, bp /* &rc */) } @@ -76786,41 +78311,41 @@ func tvfsShmUnmap(tls *libc.TLS, pFile uintptr, deleteFlag int32) int32 { /* tes return *(*int32)(unsafe.Pointer(bp /* rc */)) } -func tvfsFetch(tls *libc.TLS, pFile uintptr, iOfst sqlite3_int64, iAmt int32, pp uintptr) int32 { /* test_vfs.c:1061:12: */ +func tvfsFetch(tls *libc.TLS, pFile uintptr, iOfst sqlite3_int64, iAmt int32, pp uintptr) int32 { /* test_vfs.c:1065:12: */ var pFd uintptr = (*TestvfsFile)(unsafe.Pointer(pFile)).FpFd return sqlite3.Xsqlite3OsFetch(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal, iOfst, iAmt, pp) } -func tvfsUnfetch(tls *libc.TLS, pFile uintptr, iOfst sqlite3_int64, p uintptr) int32 { /* test_vfs.c:1071:12: */ +func tvfsUnfetch(tls *libc.TLS, pFile uintptr, iOfst sqlite3_int64, p uintptr) int32 { /* test_vfs.c:1075:12: */ var pFd uintptr = (*TestvfsFile)(unsafe.Pointer(pFile)).FpFd return sqlite3.Xsqlite3OsUnfetch(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal, iOfst, p) } -func testvfs_obj_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1076:26: */ +func testvfs_obj_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1080:26: */ bp := tls.Alloc(568) defer tls.Free(568) var p uintptr = cd *(*[10]TestvfsSubcmd)(unsafe.Pointer(bp + 96 /* aSubcmd */)) = [10]TestvfsSubcmd{ - {FzName: ts + 37549 /* "shm" */}, - {FzName: ts + 37553 /* "delete" */, FeCmd: uint32(1) /* CMD_DELETE */}, - {FzName: ts + 37560 /* "filter" */, FeCmd: uint32(2) /* CMD_FILTER */}, - {FzName: ts + 37567 /* "ioerr" */, FeCmd: uint32(3) /* CMD_IOERR */}, - {FzName: ts + 37573 /* "fullerr" */, FeCmd: uint32(7) /* CMD_FULLERR */}, - {FzName: ts + 37581 /* "cantopenerr" */, FeCmd: uint32(8) /* CMD_CANTOPENERR */}, - {FzName: ts + 37593 /* "script" */, FeCmd: uint32(4) /* CMD_SCRIPT */}, - {FzName: ts + 37600 /* "devchar" */, FeCmd: uint32(5) /* CMD_DEVCHAR */}, - {FzName: ts + 37608 /* "sectorsize" */, FeCmd: uint32(6) /* CMD_SECTORSIZE */}, + {FzName: ts + 38046 /* "shm" */}, + {FzName: ts + 38050 /* "delete" */, FeCmd: uint32(1) /* CMD_DELETE */}, + {FzName: ts + 38057 /* "filter" */, FeCmd: uint32(2) /* CMD_FILTER */}, + {FzName: ts + 38064 /* "ioerr" */, FeCmd: uint32(3) /* CMD_IOERR */}, + {FzName: ts + 38070 /* "fullerr" */, FeCmd: uint32(7) /* CMD_FULLERR */}, + {FzName: ts + 38078 /* "cantopenerr" */, FeCmd: uint32(8) /* CMD_CANTOPENERR */}, + {FzName: ts + 38090 /* "script" */, FeCmd: uint32(4) /* CMD_SCRIPT */}, + {FzName: ts + 38097 /* "devchar" */, FeCmd: uint32(5) /* CMD_DEVCHAR */}, + {FzName: ts + 38105 /* "sectorsize" */, FeCmd: uint32(6) /* CMD_SECTORSIZE */}, {}, } // var i int32 at bp+256, 4 if objc < 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1859 /* "SUBCOMMAND ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1860 /* "SUBCOMMAND ..." */) return TCL_ERROR } if tcl.XTcl_GetIndexFromObjStruct(tls, - interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+96 /* &aSubcmd[0] */, int32(unsafe.Sizeof(TestvfsSubcmd{})), ts+37619 /* "subcommand" */, 0, bp+256 /* &i */) != 0 { + interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+96 /* &aSubcmd[0] */, int32(unsafe.Sizeof(TestvfsSubcmd{})), ts+38116 /* "subcommand" */, 0, bp+256 /* &i */) != 0 { return TCL_ERROR } tcl.XTcl_ResetResult(tls, interp) @@ -76833,7 +78358,7 @@ func testvfs_obj_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, o var pBuffer uintptr var zName uintptr if (objc != 3) && (objc != 4) { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+37630 /* "FILE ?VALUE?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+38127 /* "FILE ?VALUE?" */) return TCL_ERROR } zName = tcl.XTcl_Alloc(tls, uint32((*sqlite3_vfs)(unsafe.Pointer((*Testvfs)(unsafe.Pointer(p)).FpParent)).FmxPathname)) @@ -76841,7 +78366,7 @@ func testvfs_obj_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, o (*Testvfs)(unsafe.Pointer(p)).FpParent, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), (*sqlite3_vfs)(unsafe.Pointer((*Testvfs)(unsafe.Pointer(p)).FpParent)).FmxPathname, zName) if rc != SQLITE_OK { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+37643, /* "failed to get fu..." */ + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+38140, /* "failed to get fu..." */ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), 0)) tcl.XTcl_Free(tls, zName) return TCL_ERROR @@ -76853,7 +78378,7 @@ func testvfs_obj_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, o } tcl.XTcl_Free(tls, zName) if !(pBuffer != 0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+37669 /* "no such file: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+38166 /* "no such file: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), 0)) return TCL_ERROR } if objc == 4 { @@ -76896,7 +78421,7 @@ func testvfs_obj_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, o *(*int32)(unsafe.Pointer(bp + 264 /* nElem */)) = 0 var mask int32 = 0 if objc != 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+31258 /* "LIST" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+31755 /* "LIST" */) return TCL_ERROR } if tcl.XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+264 /* &nElem */, bp+272 /* &apElem */) != 0 { @@ -76913,7 +78438,7 @@ func testvfs_obj_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, o } } if iMethod == (int32(uint64(unsafe.Sizeof(vfsmethod)) / uint64(unsafe.Sizeof(VfsMethod{})))) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+37684 /* "unknown method: " */, zElem, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+38181 /* "unknown method: " */, zElem, 0)) return TCL_ERROR } } @@ -76946,7 +78471,7 @@ func testvfs_obj_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, o (*Tcl_Obj)(unsafe.Pointer((*Testvfs)(unsafe.Pointer(p)).FpScript)).FrefCount++ } } else if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12760 /* "?SCRIPT?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12940 /* "?SCRIPT?" */) return TCL_ERROR } @@ -77005,7 +78530,7 @@ func testvfs_obj_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, o }() (*TestFaultInject)(unsafe.Pointer(pTest)).FiCnt = *(*int32)(unsafe.Pointer(bp + 284 /* iCnt */)) } else if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+37701 /* "?CNT PERSIST?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+38198 /* "?CNT PERSIST?" */) return TCL_ERROR } tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, iRet)) @@ -77023,28 +78548,28 @@ func testvfs_obj_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, o case uint32(5) /* CMD_DEVCHAR */ : { *(*[16]DeviceFlag)(unsafe.Pointer(bp + 304 /* aFlag */)) = [16]DeviceFlag{ - {FzName: ts + 37715 /* "default" */, FiValue: -1}, - {FzName: ts + 25381 /* "atomic" */, FiValue: SQLITE_IOCAP_ATOMIC}, - {FzName: ts + 25388 /* "atomic512" */, FiValue: SQLITE_IOCAP_ATOMIC512}, - {FzName: ts + 25398 /* "atomic1k" */, FiValue: SQLITE_IOCAP_ATOMIC1K}, - {FzName: ts + 25407 /* "atomic2k" */, FiValue: SQLITE_IOCAP_ATOMIC2K}, - {FzName: ts + 25416 /* "atomic4k" */, FiValue: SQLITE_IOCAP_ATOMIC4K}, - {FzName: ts + 25425 /* "atomic8k" */, FiValue: SQLITE_IOCAP_ATOMIC8K}, - {FzName: ts + 25434 /* "atomic16k" */, FiValue: SQLITE_IOCAP_ATOMIC16K}, - {FzName: ts + 25444 /* "atomic32k" */, FiValue: SQLITE_IOCAP_ATOMIC32K}, - {FzName: ts + 25454 /* "atomic64k" */, FiValue: SQLITE_IOCAP_ATOMIC64K}, - {FzName: ts + 25464 /* "sequential" */, FiValue: SQLITE_IOCAP_SEQUENTIAL}, - {FzName: ts + 25475 /* "safe_append" */, FiValue: SQLITE_IOCAP_SAFE_APPEND}, - {FzName: ts + 37723 /* "undeletable_when..." */, FiValue: SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN}, - {FzName: ts + 25487 /* "powersafe_overwr..." */, FiValue: SQLITE_IOCAP_POWERSAFE_OVERWRITE}, - {FzName: ts + 37745 /* "immutable" */, FiValue: SQLITE_IOCAP_IMMUTABLE}, + {FzName: ts + 38212 /* "default" */, FiValue: -1}, + {FzName: ts + 25870 /* "atomic" */, FiValue: SQLITE_IOCAP_ATOMIC}, + {FzName: ts + 25877 /* "atomic512" */, FiValue: SQLITE_IOCAP_ATOMIC512}, + {FzName: ts + 25887 /* "atomic1k" */, FiValue: SQLITE_IOCAP_ATOMIC1K}, + {FzName: ts + 25896 /* "atomic2k" */, FiValue: SQLITE_IOCAP_ATOMIC2K}, + {FzName: ts + 25905 /* "atomic4k" */, FiValue: SQLITE_IOCAP_ATOMIC4K}, + {FzName: ts + 25914 /* "atomic8k" */, FiValue: SQLITE_IOCAP_ATOMIC8K}, + {FzName: ts + 25923 /* "atomic16k" */, FiValue: SQLITE_IOCAP_ATOMIC16K}, + {FzName: ts + 25933 /* "atomic32k" */, FiValue: SQLITE_IOCAP_ATOMIC32K}, + {FzName: ts + 25943 /* "atomic64k" */, FiValue: SQLITE_IOCAP_ATOMIC64K}, + {FzName: ts + 25953 /* "sequential" */, FiValue: SQLITE_IOCAP_SEQUENTIAL}, + {FzName: ts + 25964 /* "safe_append" */, FiValue: SQLITE_IOCAP_SAFE_APPEND}, + {FzName: ts + 38220 /* "undeletable_when..." */, FiValue: SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN}, + {FzName: ts + 25976 /* "powersafe_overwr..." */, FiValue: SQLITE_IOCAP_POWERSAFE_OVERWRITE}, + {FzName: ts + 38242 /* "immutable" */, FiValue: SQLITE_IOCAP_IMMUTABLE}, {}, } var pRet uintptr var iFlag int32 if objc > 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+37755 /* "?ATTR-LIST?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+38252 /* "?ATTR-LIST?" */) return TCL_ERROR } if objc == 3 { @@ -77060,11 +78585,11 @@ func testvfs_obj_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, o for j = 0; j < *(*int32)(unsafe.Pointer(bp + 292 /* nFlags */)); j++ { *(*int32)(unsafe.Pointer(bp + 560 /* idx */)) = 0 if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 /* flags */)) + uintptr(j)*8)), bp+304, /* &aFlag[0] */ - int32(unsafe.Sizeof(DeviceFlag{})), ts+16852 /* "flag" */, 0, bp+560 /* &idx */) != 0 { + int32(unsafe.Sizeof(DeviceFlag{})), ts+17196 /* "flag" */, 0, bp+560 /* &idx */) != 0 { return TCL_ERROR } if ((*DeviceFlag)(unsafe.Pointer(bp+304 /* &aFlag */ +uintptr(*(*int32)(unsafe.Pointer(bp + 560 /* idx */)))*16)).FiValue < 0) && (*(*int32)(unsafe.Pointer(bp + 292 /* nFlags */)) > 1) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, ts+37767 /* "bad flags: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, ts+38264 /* "bad flags: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))), 0)) return TCL_ERROR } iNew = iNew | ((*DeviceFlag)(unsafe.Pointer(bp + 304 /* &aFlag */ + uintptr(*(*int32)(unsafe.Pointer(bp + 560 /* idx */)))*16)).FiValue) @@ -77089,7 +78614,7 @@ func testvfs_obj_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, o case uint32(6) /* CMD_SECTORSIZE */ : { if objc > 3 { - tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+37779 /* "?VALUE?" */) + tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+38276 /* "?VALUE?" */) return TCL_ERROR } if objc == 3 { @@ -77112,36 +78637,36 @@ type TestvfsSubcmd = struct { FzName uintptr FeCmd uint32 _ [4]byte -} /* test_vfs.c:1088:3 */ +} /* test_vfs.c:1092:3 */ type VfsMethod = struct { FzName uintptr Fmask int32 _ [4]byte -} /* test_vfs.c:1175:14 */ +} /* test_vfs.c:1179:14 */ var vfsmethod = [18]VfsMethod{ - {FzName: ts + 37507 /* "xShmOpen" */, Fmask: TESTVFS_SHMOPEN_MASK}, - {FzName: ts + 34510 /* "xShmLock" */, Fmask: TESTVFS_SHMLOCK_MASK}, - {FzName: ts + 34519 /* "xShmBarrier" */, Fmask: TESTVFS_SHMBARRIER_MASK}, - {FzName: ts + 34500 /* "xShmUnmap" */, Fmask: TESTVFS_SHMCLOSE_MASK}, - {FzName: ts + 34531 /* "xShmMap" */, Fmask: TESTVFS_SHMMAP_MASK}, - {FzName: ts + 26827 /* "xSync" */, Fmask: TESTVFS_SYNC_MASK}, - {FzName: ts + 34438 /* "xDelete" */, Fmask: TESTVFS_DELETE_MASK}, - {FzName: ts + 34346 /* "xWrite" */, Fmask: TESTVFS_WRITE_MASK}, - {FzName: ts + 34340 /* "xRead" */, Fmask: TESTVFS_READ_MASK}, - {FzName: ts + 34353 /* "xTruncate" */, Fmask: TESTVFS_TRUNCATE_MASK}, - {FzName: ts + 26399 /* "xOpen" */, Fmask: TESTVFS_OPEN_MASK}, - {FzName: ts + 34333 /* "xClose" */, Fmask: TESTVFS_CLOSE_MASK}, - {FzName: ts + 34446 /* "xAccess" */, Fmask: TESTVFS_ACCESS_MASK}, - {FzName: ts + 34454 /* "xFullPathname" */, Fmask: TESTVFS_FULLPATHNAME_MASK}, - {FzName: ts + 34379 /* "xUnlock" */, Fmask: TESTVFS_UNLOCK_MASK}, - {FzName: ts + 34373 /* "xLock" */, Fmask: TESTVFS_LOCK_MASK}, - {FzName: ts + 37373 /* "xCheckReservedLo..." */, Fmask: TESTVFS_CKLOCK_MASK}, - {FzName: ts + 34401 /* "xFileControl" */, Fmask: TESTVFS_FCNTL_MASK}, -} /* test_vfs.c:1178:9 */ + {FzName: ts + 38004 /* "xShmOpen" */, Fmask: TESTVFS_SHMOPEN_MASK}, + {FzName: ts + 35007 /* "xShmLock" */, Fmask: TESTVFS_SHMLOCK_MASK}, + {FzName: ts + 35016 /* "xShmBarrier" */, Fmask: TESTVFS_SHMBARRIER_MASK}, + {FzName: ts + 34997 /* "xShmUnmap" */, Fmask: TESTVFS_SHMCLOSE_MASK}, + {FzName: ts + 35028 /* "xShmMap" */, Fmask: TESTVFS_SHMMAP_MASK}, + {FzName: ts + 27316 /* "xSync" */, Fmask: TESTVFS_SYNC_MASK}, + {FzName: ts + 34935 /* "xDelete" */, Fmask: TESTVFS_DELETE_MASK}, + {FzName: ts + 34843 /* "xWrite" */, Fmask: TESTVFS_WRITE_MASK}, + {FzName: ts + 34837 /* "xRead" */, Fmask: TESTVFS_READ_MASK}, + {FzName: ts + 34850 /* "xTruncate" */, Fmask: TESTVFS_TRUNCATE_MASK}, + {FzName: ts + 26888 /* "xOpen" */, Fmask: TESTVFS_OPEN_MASK}, + {FzName: ts + 34830 /* "xClose" */, Fmask: TESTVFS_CLOSE_MASK}, + {FzName: ts + 34943 /* "xAccess" */, Fmask: TESTVFS_ACCESS_MASK}, + {FzName: ts + 34951 /* "xFullPathname" */, Fmask: TESTVFS_FULLPATHNAME_MASK}, + {FzName: ts + 34876 /* "xUnlock" */, Fmask: TESTVFS_UNLOCK_MASK}, + {FzName: ts + 34870 /* "xLock" */, Fmask: TESTVFS_LOCK_MASK}, + {FzName: ts + 37870 /* "xCheckReservedLo..." */, Fmask: TESTVFS_CKLOCK_MASK}, + {FzName: ts + 34898 /* "xFileControl" */, Fmask: TESTVFS_FCNTL_MASK}, +} /* test_vfs.c:1182:9 */ -func testvfs_obj_del(tls *libc.TLS, cd ClientData) { /* test_vfs.c:1389:27: */ +func testvfs_obj_del(tls *libc.TLS, cd ClientData) { /* test_vfs.c:1393:27: */ var p uintptr = cd if (*Testvfs)(unsafe.Pointer(p)).FpScript != 0 { for ok := true; ok; ok = 0 != 0 { @@ -77191,7 +78716,7 @@ func testvfs_obj_del(tls *libc.TLS, cd ClientData) { /* test_vfs.c:1389:27: */ // SCRIPT xShmLock FILENAME ID LOCK // // where LOCK is of the form "OFFSET NBYTE lock/unlock shared/exclusive" -func testvfs_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1434:26: */ +func testvfs_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1438:26: */ bp := tls.Alloc(28) defer tls.Free(28) @@ -77236,7 +78761,7 @@ __2: } zSwitch = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp /* &nSwitch */) - if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+37787 /* "-noshm" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) { + if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+38284 /* "-noshm" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) { goto __5 } if !(tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+4 /* &isNoshm */) != 0) { @@ -77253,7 +78778,7 @@ __8: ; goto __6 __5: - if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+25757 /* "-default" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) { + if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+26246 /* "-default" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) { goto __9 } if !(tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+8 /* &isDefault */) != 0) { @@ -77264,7 +78789,7 @@ __11: ; goto __10 __9: - if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+37794 /* "-szosfile" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) { + if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+38291 /* "-szosfile" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) { goto __12 } if !(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+12 /* &szOsFile */) != 0) { @@ -77275,7 +78800,7 @@ __14: ; goto __13 __12: - if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+37804 /* "-mxpathname" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) { + if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+38301 /* "-mxpathname" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) { goto __15 } if !(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+16 /* &mxPathname */) != 0) { @@ -77286,7 +78811,7 @@ __17: ; goto __16 __15: - if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+37816 /* "-iversion" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) { + if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+38313 /* "-iversion" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) { goto __18 } if !(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+20 /* &iVersion */) != 0) { @@ -77297,7 +78822,7 @@ __20: ; goto __19 __18: - if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+37826 /* "-fullshm" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) { + if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+38323 /* "-fullshm" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) { goto __21 } if !(tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+24 /* &isFullshm */) != 0) { @@ -77386,7 +78911,7 @@ __26: return TCL_OK bad_args: - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+37835 /* "VFSNAME ?-noshm ..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+38332 /* "VFSNAME ?-noshm ..." */) return TCL_ERROR } @@ -77399,15 +78924,15 @@ var tvfs_vfs = sqlite3_vfs{ FxRandomness: 0, // xRandomness FxSleep: 0, // xSleep FxCurrentTime: 0, // xNextSystemCall -} /* test_vfs.c:1440:22 */ +} /* test_vfs.c:1444:22 */ // tclcmd: vfs_shmlock DB DBNAME (shared|exclusive) (lock|unlock) OFFSET N -func test_vfs_shmlock(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1582:26: */ +func test_vfs_shmlock(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1586:26: */ bp := tls.Alloc(88) defer tls.Free(88) - *(*[3]uintptr)(unsafe.Pointer(bp + 8 /* azArg1 */)) = [3]uintptr{ts + 37939 /* "shared" */, ts + 13480 /* "exclusive" */, uintptr(0)} - *(*[3]uintptr)(unsafe.Pointer(bp + 40 /* azArg2 */)) = [3]uintptr{ts + 37946 /* "lock" */, ts + 37951 /* "unlock" */, uintptr(0)} + *(*[3]uintptr)(unsafe.Pointer(bp + 8 /* azArg1 */)) = [3]uintptr{ts + 38436 /* "shared" */, ts + 13660 /* "exclusive" */, uintptr(0)} + *(*[3]uintptr)(unsafe.Pointer(bp + 40 /* azArg2 */)) = [3]uintptr{ts + 38443 /* "lock" */, ts + 38448 /* "unlock" */, uintptr(0)} *(*uintptr)(unsafe.Pointer(bp /* db */)) = uintptr(0) var rc int32 = SQLITE_OK var zDbname uintptr = uintptr(0) @@ -77419,14 +78944,14 @@ func test_vfs_shmlock(tls *libc.TLS, clientData uintptr, interp uintptr, objc in if objc != 7 { tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, - ts+37958 /* "DB DBNAME (share..." */) + ts+38455 /* "DB DBNAME (share..." */) return TCL_ERROR } zDbname = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) if ((((getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0) || - (tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+8 /* &azArg1[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+38010 /* "ARG" */, 0, bp+32 /* &iArg1 */) != 0)) || - (tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 4*8)), bp+40 /* &azArg2[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+38010 /* "ARG" */, 0, bp+64 /* &iArg2 */) != 0)) || + (tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+8 /* &azArg1[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+38507 /* "ARG" */, 0, bp+32 /* &iArg1 */) != 0)) || + (tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 4*8)), bp+40 /* &azArg2[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+38507 /* "ARG" */, 0, bp+64 /* &iArg2 */) != 0)) || (tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 5*8)), bp+68 /* &iOffset */) != 0)) || (tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 6*8)), bp+72 /* &n */) != 0) { return TCL_ERROR @@ -77453,7 +78978,7 @@ func test_vfs_shmlock(tls *libc.TLS, clientData uintptr, interp uintptr, objc in return TCL_OK } -func test_vfs_set_readmark(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1628:26: */ +func test_vfs_set_readmark(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1632:26: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -77469,7 +78994,7 @@ func test_vfs_set_readmark(tls *libc.TLS, clientData uintptr, interp uintptr, ob var iOff int32 if (objc != 4) && (objc != 5) { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+38014 /* "DB DBNAME SLOT ?..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+38511 /* "DB DBNAME SLOT ?..." */) return TCL_ERROR } @@ -77490,7 +79015,7 @@ func test_vfs_set_readmark(tls *libc.TLS, clientData uintptr, interp uintptr, ob return TCL_ERROR } if libc.AtomicLoadPUintptr(bp+40 /* pShm */) == uintptr(0) { - tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+38037 /* "*-shm is not yet..." */, 0)) + tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+38534 /* "*-shm is not yet..." */, 0)) return TCL_ERROR } aShm = libc.AtomicLoadPUintptr(bp + 40 /* pShm */) @@ -77504,14 +79029,14 @@ func test_vfs_set_readmark(tls *libc.TLS, clientData uintptr, interp uintptr, ob return TCL_OK } -func Sqlitetestvfs_Init(tls *libc.TLS, interp uintptr) int32 { /* test_vfs.c:1681:5: */ - tcl.XTcl_CreateObjCommand(tls, interp, ts+38061 /* "testvfs" */, *(*uintptr)(unsafe.Pointer(&struct { +func Sqlitetestvfs_Init(tls *libc.TLS, interp uintptr) int32 { /* test_vfs.c:1685:5: */ + tcl.XTcl_CreateObjCommand(tls, interp, ts+38558 /* "testvfs" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32 }{testvfs_cmd})), uintptr(0), uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+38069 /* "vfs_shmlock" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+38566 /* "vfs_shmlock" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_vfs_shmlock})), uintptr(0), uintptr(0)) - tcl.XTcl_CreateObjCommand(tls, interp, ts+38081 /* "vfs_set_readmark" */, *(*uintptr)(unsafe.Pointer(&struct { + tcl.XTcl_CreateObjCommand(tls, interp, ts+38578 /* "vfs_set_readmark" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{test_vfs_set_readmark})), uintptr(0), uintptr(0)) return TCL_OK @@ -77562,7 +79087,7 @@ func doTestWindowStep(tls *libc.TLS, bInverse int32, ctx uintptr, nArg int32, ap if (*TestWindowCtx)(unsafe.Pointer(pCtx)).FpVal != 0 { tcl.XTcl_ListObjAppendElement(tls, (*TestWindow)(unsafe.Pointer(p)).Finterp, pEval, tcl.XTcl_DuplicateObj(tls, (*TestWindowCtx)(unsafe.Pointer(pCtx)).FpVal)) } else { - tcl.XTcl_ListObjAppendElement(tls, (*TestWindow)(unsafe.Pointer(p)).Finterp, pEval, tcl.XTcl_NewStringObj(tls, ts+488 /* "" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, (*TestWindow)(unsafe.Pointer(p)).Finterp, pEval, tcl.XTcl_NewStringObj(tls, ts+489 /* "" */, -1)) } for i = 0; i < nArg; i++ { var pArg uintptr @@ -77611,7 +79136,7 @@ func doTestWindowFinalize(tls *libc.TLS, bValue int32, ctx uintptr) { /* test_wi if (*TestWindowCtx)(unsafe.Pointer(pCtx)).FpVal != 0 { tcl.XTcl_ListObjAppendElement(tls, (*TestWindow)(unsafe.Pointer(p)).Finterp, pEval, tcl.XTcl_DuplicateObj(tls, (*TestWindowCtx)(unsafe.Pointer(pCtx)).FpVal)) } else { - tcl.XTcl_ListObjAppendElement(tls, (*TestWindow)(unsafe.Pointer(p)).Finterp, pEval, tcl.XTcl_NewStringObj(tls, ts+488 /* "" */, -1)) + tcl.XTcl_ListObjAppendElement(tls, (*TestWindow)(unsafe.Pointer(p)).Finterp, pEval, tcl.XTcl_NewStringObj(tls, ts+489 /* "" */, -1)) } rc = tcl.XTcl_EvalObjEx(tls, (*TestWindow)(unsafe.Pointer(p)).Finterp, pEval, TCL_EVAL_GLOBAL) @@ -77674,7 +79199,7 @@ func test_create_window(tls *libc.TLS, clientData uintptr, interp uintptr, objc var rc int32 if objc != 7 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+38098 /* "DB NAME XSTEP XF..." */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+38595 /* "DB NAME XSTEP XF..." */) return TCL_ERROR } @@ -77721,7 +79246,7 @@ func test_create_window_misuse(tls *libc.TLS, clientData uintptr, interp uintptr if !(objc != 2) { goto __1 } - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR __1: ; @@ -77732,7 +79257,7 @@ __1: __2: ; - rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38135 /* "fff" */, -1, SQLITE_UTF8, uintptr(0), + rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38632 /* "fff" */, -1, SQLITE_UTF8, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowFinal})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowValue})), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{testWindowInverse})), @@ -77743,7 +79268,7 @@ __2: goto error __3: ; - rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38135 /* "fff" */, -1, SQLITE_UTF8, uintptr(0), + rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38632 /* "fff" */, -1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{testWindowStep})), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowValue})), *(*uintptr)(unsafe.Pointer(&struct { @@ -77756,7 +79281,7 @@ __3: goto error __4: ; - rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38135 /* "fff" */, -1, SQLITE_UTF8, uintptr(0), + rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38632 /* "fff" */, -1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{testWindowStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowFinal})), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { @@ -77769,7 +79294,7 @@ __4: goto error __5: ; - rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38135 /* "fff" */, -1, SQLITE_UTF8, uintptr(0), + rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38632 /* "fff" */, -1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{testWindowStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowFinal})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowValue})), uintptr(0), @@ -77784,7 +79309,7 @@ __6: return TCL_OK error: - tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, ts+38139 /* "misuse test erro..." */, -1)) + tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, ts+38636 /* "misuse test erro..." */, -1)) return TCL_ERROR } @@ -77793,7 +79318,7 @@ func sumintStep(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* test var pInt uintptr if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != SQLITE_INTEGER { - sqlite3.Xsqlite3_result_error(tls, ctx, ts+38157 /* "invalid argument" */, -1) + sqlite3.Xsqlite3_result_error(tls, ctx, ts+38654 /* "invalid argument" */, -1) return } pInt = sqlite3.Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(sqlite3_int64(0)))) @@ -77840,14 +79365,14 @@ func test_create_sumint(tls *libc.TLS, clientData uintptr, interp uintptr, objc var rc int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { return TCL_ERROR } - rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38174 /* "sumint" */, 1, SQLITE_UTF8, uintptr(0), + rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38671 /* "sumint" */, 1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{sumintStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sumintFinal})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sumintValue})), *(*uintptr)(unsafe.Pointer(&struct { @@ -77871,14 +79396,14 @@ func test_override_sum(tls *libc.TLS, clientData uintptr, interp uintptr, objc i var rc int32 if objc != 2 { - tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */) + tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1911 /* "DB" */) return TCL_ERROR } if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))), bp /* &db */) != 0 { return TCL_ERROR } - rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38181 /* "sum" */, -1, SQLITE_UTF8, uintptr(0), + rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38678 /* "sum" */, -1, SQLITE_UTF8, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{sumintStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sumintFinal}))) @@ -77910,10 +79435,10 @@ var aObjCmd14 = [4]struct { FclientData int32 _ [4]byte }{ - {FzName: ts + 38185 /* "sqlite3_create_w..." */, FxProc: 0}, - {FzName: ts + 38216 /* "test_create_wind..." */, FxProc: 0}, - {FzName: ts + 38251 /* "test_create_sumi..." */, FxProc: 0}, - {FzName: ts + 38270 /* "test_override_su..." */, FxProc: 0}, + {FzName: ts + 38682 /* "sqlite3_create_w..." */, FxProc: 0}, + {FzName: ts + 38713 /* "test_create_wind..." */, FxProc: 0}, + {FzName: ts + 38748 /* "test_create_sumi..." */, FxProc: 0}, + {FzName: ts + 38767 /* "test_override_su..." */, FxProc: 0}, } /* test_window.c:336:5 */ // 2008 September 1 @@ -77932,22 +79457,22 @@ var aObjCmd14 = [4]struct { // SQLITE_OMIT_WSD symbol is defined at build time. func init() { - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 8 /* .xClose */)) = cfClose // test6.c:573:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 16 /* .xRead */)) = cfRead // test6.c:574:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 24 /* .xWrite */)) = cfWrite // test6.c:575:3: - *(*func(*libc.TLS, uintptr, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 32 /* .xTruncate */)) = cfTruncate // test6.c:576:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 40 /* .xSync */)) = cfSync // test6.c:577:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 48 /* .xFileSize */)) = cfFileSize // test6.c:578:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 56 /* .xLock */)) = cfLock // test6.c:579:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 64 /* .xUnlock */)) = cfUnlock // test6.c:580:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 72 /* .xCheckReservedLock */)) = cfCheckReservedLock // test6.c:581:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 80 /* .xFileControl */)) = cfFileControl // test6.c:582:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 88 /* .xSectorSize */)) = cfSectorSize // test6.c:583:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 96 /* .xDeviceCharacteristics */)) = cfDeviceCharacteristics // test6.c:584:3: - *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 104 /* .xShmMap */)) = cfShmMap // test6.c:585:3: - *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 112 /* .xShmLock */)) = cfShmLock // test6.c:586:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 120 /* .xShmBarrier */)) = cfShmBarrier // test6.c:587:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 128 /* .xShmUnmap */)) = cfShmUnmap // test6.c:588:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 8 /* .xClose */)) = cfClose // test6.c:577:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 16 /* .xRead */)) = cfRead // test6.c:578:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 24 /* .xWrite */)) = cfWrite // test6.c:579:3: + *(*func(*libc.TLS, uintptr, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 32 /* .xTruncate */)) = cfTruncate // test6.c:580:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 40 /* .xSync */)) = cfSync // test6.c:581:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 48 /* .xFileSize */)) = cfFileSize // test6.c:582:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 56 /* .xLock */)) = cfLock // test6.c:583:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 64 /* .xUnlock */)) = cfUnlock // test6.c:584:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 72 /* .xCheckReservedLock */)) = cfCheckReservedLock // test6.c:585:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 80 /* .xFileControl */)) = cfFileControl // test6.c:586:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 88 /* .xSectorSize */)) = cfSectorSize // test6.c:587:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 96 /* .xDeviceCharacteristics */)) = cfDeviceCharacteristics // test6.c:588:3: + *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 104 /* .xShmMap */)) = cfShmMap // test6.c:589:3: + *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 112 /* .xShmLock */)) = cfShmLock // test6.c:590:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 120 /* .xShmBarrier */)) = cfShmBarrier // test6.c:591:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 128 /* .xShmUnmap */)) = cfShmUnmap // test6.c:592:3: *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 8 /* .xCreate */)) = csvtabCreate // csv.c:874:3: *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 16 /* .xConnect */)) = csvtabConnect // csv.c:875:3: *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 24 /* .xBestIndex */)) = csvtabBestIndex // csv.c:876:3: @@ -77989,124 +79514,124 @@ func init() { *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 176 /* .xProc */)) = f5tRegisterTok // fts5_tcl.c:1132:45: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 8 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{db_enter})) // test1.c:7939:41: + }{db_enter})) // test1.c:8229:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 24 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{db_leave})) // test1.c:7940:41: + }{db_leave})) // test1.c:8230:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 40 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{sqlite3_mprintf_int})) // test1.c:7941:41: + }{sqlite3_mprintf_int})) // test1.c:8231:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 56 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{sqlite3_mprintf_int64})) // test1.c:7942:41: + }{sqlite3_mprintf_int64})) // test1.c:8232:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 72 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{sqlite3_mprintf_long})) // test1.c:7943:41: + }{sqlite3_mprintf_long})) // test1.c:8233:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 88 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{sqlite3_mprintf_str})) // test1.c:7944:41: + }{sqlite3_mprintf_str})) // test1.c:8234:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 104 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{sqlite3_snprintf_str})) // test1.c:7945:41: + }{sqlite3_snprintf_str})) // test1.c:8235:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 120 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{sqlite3_mprintf_stronly})) // test1.c:7946:41: + }{sqlite3_mprintf_stronly})) // test1.c:8236:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 136 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{sqlite3_mprintf_double})) // test1.c:7947:41: + }{sqlite3_mprintf_double})) // test1.c:8237:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 152 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{sqlite3_mprintf_scaled})) // test1.c:7948:41: + }{sqlite3_mprintf_scaled})) // test1.c:8238:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 168 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{sqlite3_mprintf_hexdouble})) // test1.c:7949:39: + }{sqlite3_mprintf_hexdouble})) // test1.c:8239:39: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 184 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_mprintf_z})) // test1.c:7950:41: + }{test_mprintf_z})) // test1.c:8240:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 200 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_mprintf_n})) // test1.c:7951:41: + }{test_mprintf_n})) // test1.c:8241:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 216 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_snprintf_int})) // test1.c:7952:41: + }{test_snprintf_int})) // test1.c:8242:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 232 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_last_rowid})) // test1.c:7953:41: + }{test_last_rowid})) // test1.c:8243:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 248 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_exec_printf})) // test1.c:7954:41: + }{test_exec_printf})) // test1.c:8244:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 264 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_exec_hex})) // test1.c:7955:41: + }{test_exec_hex})) // test1.c:8245:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 280 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_exec})) // test1.c:7956:41: + }{test_exec})) // test1.c:8246:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 296 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_exec_nr})) // test1.c:7957:41: + }{test_exec_nr})) // test1.c:8247:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 312 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_get_table_printf})) // test1.c:7959:41: + }{test_get_table_printf})) // test1.c:8249:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 328 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{sqlite_test_close})) // test1.c:7961:41: + }{sqlite_test_close})) // test1.c:8251:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 344 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{sqlite_test_close_v2})) // test1.c:7962:41: + }{sqlite_test_close_v2})) // test1.c:8252:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 360 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_create_function})) // test1.c:7963:41: + }{test_create_function})) // test1.c:8253:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 376 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_create_aggregate})) // test1.c:7964:41: + }{test_create_aggregate})) // test1.c:8254:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 392 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_drop_modules})) // test1.c:7965:41: + }{test_drop_modules})) // test1.c:8255:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 408 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_register_func})) // test1.c:7966:41: + }{test_register_func})) // test1.c:8256:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 424 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{sqlite_abort})) // test1.c:7967:41: + }{sqlite_abort})) // test1.c:8257:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 440 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_bind})) // test1.c:7968:41: + }{test_bind})) // test1.c:8258:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 456 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_breakpoint})) // test1.c:7969:41: + }{test_breakpoint})) // test1.c:8259:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 472 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_key})) // test1.c:7970:41: + }{test_key})) // test1.c:8260:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 488 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_rekey})) // test1.c:7971:41: + }{test_rekey})) // test1.c:8261:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 504 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{sqlite_set_magic})) // test1.c:7972:41: + }{sqlite_set_magic})) // test1.c:8262:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 520 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_interrupt})) // test1.c:7973:41: + }{test_interrupt})) // test1.c:8263:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 536 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{delete_function})) // test1.c:7974:41: + }{delete_function})) // test1.c:8264:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 552 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{delete_collation})) // test1.c:7975:41: + }{delete_collation})) // test1.c:8265:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 568 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{get_autocommit})) // test1.c:7976:41: + }{get_autocommit})) // test1.c:8266:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 584 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_busy_timeout})) // test1.c:7977:41: + }{test_busy_timeout})) // test1.c:8267:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 600 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_printf})) // test1.c:7978:41: + }{test_printf})) // test1.c:8268:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 616 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{test_io_trace})) // test1.c:7979:39: + }{test_io_trace})) // test1.c:8269:39: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 632 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 - }{clang_sanitize_address})) // test1.c:7980:41: + }{clang_sanitize_address})) // test1.c:8270:41: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 8 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{pager_open})) // test2.c:708:34: @@ -78362,38 +79887,39 @@ func init() { *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 296 /* .xProc */)) = test_quota_glob // test_quota.c:1967:38: *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 312 /* .xProc */)) = test_quota_file_available // test_quota.c:1968:38: *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 328 /* .xProc */)) = test_quota_ferror // test_quota.c:1969:38: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 8 /* .pInit */)) = sqlite3_amatch_init // test1.c:7306:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 24 /* .pInit */)) = sqlite3_carray_init // test1.c:7307:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 40 /* .pInit */)) = sqlite3_closure_init // test1.c:7308:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 56 /* .pInit */)) = sqlite3_csv_init // test1.c:7309:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 72 /* .pInit */)) = sqlite3_decimal_init // test1.c:7310:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 88 /* .pInit */)) = sqlite3_eval_init // test1.c:7311:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 104 /* .pInit */)) = sqlite3_explain_init // test1.c:7312:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 120 /* .pInit */)) = sqlite3_fileio_init // test1.c:7313:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 136 /* .pInit */)) = sqlite3_fuzzer_init // test1.c:7314:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 152 /* .pInit */)) = sqlite3_ieee_init // test1.c:7315:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 168 /* .pInit */)) = sqlite3_nextchar_init // test1.c:7316:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 184 /* .pInit */)) = sqlite3_percentile_init // test1.c:7317:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 200 /* .pInit */)) = sqlite3_prefixes_init // test1.c:7319:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 216 /* .pInit */)) = sqlite3_regexp_init // test1.c:7321:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 232 /* .pInit */)) = sqlite3_remember_init // test1.c:7322:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 248 /* .pInit */)) = sqlite3_series_init // test1.c:7323:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 264 /* .pInit */)) = sqlite3_spellfix_init // test1.c:7324:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 280 /* .pInit */)) = sqlite3_totype_init // test1.c:7325:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 296 /* .pInit */)) = sqlite3_unionvtab_init // test1.c:7326:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 312 /* .pInit */)) = sqlite3_wholenumber_init // test1.c:7327:32: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 328 /* .pInit */)) = sqlite3_zipfile_init // test1.c:7329:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 8 /* .pInit */)) = sqlite3_amatch_init // test1.c:7526:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 24 /* .pInit */)) = sqlite3_appendvfs_init // test1.c:7527:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 40 /* .pInit */)) = sqlite3_carray_init // test1.c:7528:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 56 /* .pInit */)) = sqlite3_closure_init // test1.c:7529:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 72 /* .pInit */)) = sqlite3_csv_init // test1.c:7530:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 88 /* .pInit */)) = sqlite3_decimal_init // test1.c:7531:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 104 /* .pInit */)) = sqlite3_eval_init // test1.c:7532:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 120 /* .pInit */)) = sqlite3_explain_init // test1.c:7533:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 136 /* .pInit */)) = sqlite3_fileio_init // test1.c:7534:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 152 /* .pInit */)) = sqlite3_fuzzer_init // test1.c:7535:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 168 /* .pInit */)) = sqlite3_ieee_init // test1.c:7536:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 184 /* .pInit */)) = sqlite3_nextchar_init // test1.c:7537:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 200 /* .pInit */)) = sqlite3_percentile_init // test1.c:7538:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 216 /* .pInit */)) = sqlite3_prefixes_init // test1.c:7540:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 232 /* .pInit */)) = sqlite3_regexp_init // test1.c:7542:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 248 /* .pInit */)) = sqlite3_remember_init // test1.c:7543:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 264 /* .pInit */)) = sqlite3_series_init // test1.c:7544:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 280 /* .pInit */)) = sqlite3_spellfix_init // test1.c:7545:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 296 /* .pInit */)) = sqlite3_totype_init // test1.c:7546:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 312 /* .pInit */)) = sqlite3_unionvtab_init // test1.c:7547:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 328 /* .pInit */)) = sqlite3_wholenumber_init // test1.c:7548:32: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 344 /* .pInit */)) = sqlite3_zipfile_init // test1.c:7550:32: *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 16 /* .xFunc */)) = decimalFunc // decimal.c:607:29: *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 40 /* .xFunc */)) = decimalCmpFunc // decimal.c:608:29: *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 64 /* .xFunc */)) = decimalAddFunc // decimal.c:609:29: *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 88 /* .xFunc */)) = decimalSubFunc // decimal.c:610:29: *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 112 /* .xFunc */)) = decimalMulFunc // decimal.c:611:29: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 16 /* .xFunc */)) = ieee754func // ieee754.c:262:36: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 40 /* .xFunc */)) = ieee754func // ieee754.c:263:36: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 64 /* .xFunc */)) = ieee754func // ieee754.c:264:36: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 88 /* .xFunc */)) = ieee754func // ieee754.c:265:36: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 112 /* .xFunc */)) = ieee754func_to_blob // ieee754.c:266:36: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 136 /* .xFunc */)) = ieee754func_from_blob // ieee754.c:267:36: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 16 /* .xFunc */)) = ieee754func // ieee754.c:270:36: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 40 /* .xFunc */)) = ieee754func // ieee754.c:271:36: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 64 /* .xFunc */)) = ieee754func // ieee754.c:272:36: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 88 /* .xFunc */)) = ieee754func // ieee754.c:273:36: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 112 /* .xFunc */)) = ieee754func_to_blob // ieee754.c:274:36: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 136 /* .xFunc */)) = ieee754func_from_blob // ieee754.c:275:36: *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 16 /* .xFunc */)) = randStr // test_func.c:675:48: *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 40 /* .xFunc */)) = test_destructor // test_func.c:676:48: *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 64 /* .xFunc */)) = test_destructor16 // test_func.c:678:48: @@ -78419,207 +79945,212 @@ func init() { *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 40 /* .xProc */)) = test_sqlite3rbu_create_vfs // test_rbu.c:372:32: *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 56 /* .xProc */)) = test_sqlite3rbu_destroy_vfs // test_rbu.c:373:33: *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 72 /* .xProc */)) = test_sqlite3rbu_internal_test // test_rbu.c:374:35: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 8 /* .xProc */)) = test_sqlite3_db_config // test1.c:7987:41: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 32 /* .xProc */)) = test_bad_behavior // test1.c:7988:41: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 40 /* .clientData */)) = uintptr(unsafe.Pointer(&iZero)) // test1.c:7988:61: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 56 /* .xProc */)) = test_register_dbstat_vtab // test1.c:7989:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 80 /* .xProc */)) = get_sqlite_pointer // test1.c:7990:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 104 /* .xProc */)) = test_intarray_addr // test1.c:7991:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 128 /* .xProc */)) = test_int64array_addr // test1.c:7992:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 152 /* .xProc */)) = test_doublearray_addr // test1.c:7993:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 176 /* .xProc */)) = test_textarray_addr // test1.c:7994:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 200 /* .xProc */)) = test_bind_int // test1.c:7995:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 224 /* .xProc */)) = test_bind_zeroblob // test1.c:7996:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 248 /* .xProc */)) = test_bind_zeroblob64 // test1.c:7997:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 272 /* .xProc */)) = test_bind_int64 // test1.c:7998:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 296 /* .xProc */)) = test_bind_double // test1.c:7999:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 320 /* .xProc */)) = test_bind_null // test1.c:8000:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 344 /* .xProc */)) = test_bind_text // test1.c:8001:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 368 /* .xProc */)) = test_bind_text16 // test1.c:8002:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 392 /* .xProc */)) = test_bind_blob // test1.c:8003:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 416 /* .xProc */)) = test_bind_parameter_count // test1.c:8004:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 440 /* .xProc */)) = test_bind_parameter_name // test1.c:8005:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 464 /* .xProc */)) = test_bind_parameter_index // test1.c:8006:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 488 /* .xProc */)) = test_clear_bindings // test1.c:8007:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 512 /* .xProc */)) = test_sleep // test1.c:8008:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 536 /* .xProc */)) = test_errcode // test1.c:8009:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 560 /* .xProc */)) = test_ex_errcode // test1.c:8010:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 584 /* .xProc */)) = test_errmsg // test1.c:8011:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 608 /* .xProc */)) = test_errmsg16 // test1.c:8012:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 632 /* .xProc */)) = test_open // test1.c:8013:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 656 /* .xProc */)) = test_open16 // test1.c:8014:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 680 /* .xProc */)) = test_open_v2 // test1.c:8015:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 704 /* .xProc */)) = test_complete16 // test1.c:8016:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 728 /* .xProc */)) = test_normalize // test1.c:8017:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 752 /* .xProc */)) = test_prepare // test1.c:8019:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 776 /* .xProc */)) = test_prepare16 // test1.c:8020:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 800 /* .xProc */)) = test_prepare_v2 // test1.c:8021:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 824 /* .xProc */)) = test_prepare_v3 // test1.c:8022:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 848 /* .xProc */)) = test_prepare_tkt3134 // test1.c:8023:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 872 /* .xProc */)) = test_prepare16_v2 // test1.c:8024:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 896 /* .xProc */)) = test_finalize // test1.c:8025:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 920 /* .xProc */)) = test_stmt_status // test1.c:8026:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 944 /* .xProc */)) = test_reset // test1.c:8027:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 968 /* .xProc */)) = test_expired // test1.c:8028:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 992 /* .xProc */)) = test_transfer_bind // test1.c:8029:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1016 /* .xProc */)) = test_changes // test1.c:8030:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1040 /* .xProc */)) = test_step // test1.c:8031:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1064 /* .xProc */)) = test_sql // test1.c:8032:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1088 /* .xProc */)) = test_ex_sql // test1.c:8033:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1112 /* .xProc */)) = test_next_stmt // test1.c:8037:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1136 /* .xProc */)) = test_stmt_readonly // test1.c:8038:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1160 /* .xProc */)) = test_stmt_isexplain // test1.c:8039:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1184 /* .xProc */)) = test_stmt_busy // test1.c:8040:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1208 /* .xProc */)) = uses_stmt_journal // test1.c:8041:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1232 /* .xProc */)) = test_release_memory // test1.c:8043:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1256 /* .xProc */)) = test_db_release_memory // test1.c:8044:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1280 /* .xProc */)) = test_db_cacheflush // test1.c:8045:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1304 /* .xProc */)) = test_system_errno // test1.c:8046:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1328 /* .xProc */)) = test_db_filename // test1.c:8047:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1352 /* .xProc */)) = test_db_readonly // test1.c:8048:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1376 /* .xProc */)) = test_soft_heap_limit // test1.c:8049:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1400 /* .xProc */)) = test_soft_heap_limit // test1.c:8050:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1424 /* .xProc */)) = test_hard_heap_limit // test1.c:8051:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1448 /* .xProc */)) = test_thread_cleanup // test1.c:8052:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1472 /* .xProc */)) = test_pager_refcounts // test1.c:8053:41: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1496 /* .xProc */)) = test_load_extension // test1.c:8055:41: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1520 /* .xProc */)) = test_enable_load // test1.c:8056:41: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1544 /* .xProc */)) = test_extended_result_codes // test1.c:8057:41: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1568 /* .xProc */)) = test_limit // test1.c:8058:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1592 /* .xProc */)) = test_dbconfig_maindbname_icecube // test1.c:8059:41: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1616 /* .xProc */)) = save_prng_state // test1.c:8061:41: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1640 /* .xProc */)) = restore_prng_state // test1.c:8062:41: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1664 /* .xProc */)) = reset_prng_state // test1.c:8063:41: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1688 /* .xProc */)) = prng_seed // test1.c:8064:41: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1712 /* .xProc */)) = extra_schema_checks // test1.c:8065:41: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1736 /* .xProc */)) = database_never_corrupt // test1.c:8066:41: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1760 /* .xProc */)) = database_may_be_corrupt // test1.c:8067:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1784 /* .xProc */)) = optimization_control // test1.c:8068:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1808 /* .xProc */)) = runAsObjProc // test1.c:8077:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1832 /* .xProc */)) = test_column_count // test1.c:8080:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1856 /* .xProc */)) = test_data_count // test1.c:8081:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1880 /* .xProc */)) = test_column_type // test1.c:8082:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1904 /* .xProc */)) = test_column_blob // test1.c:8083:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1928 /* .xProc */)) = test_column_double // test1.c:8084:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1952 /* .xProc */)) = test_column_int64 // test1.c:8085:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1976 /* .xProc */)) = test_stmt_utf8 // test1.c:8086:33: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1984 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, int32) uintptr - }{sqlite3.Xsqlite3_column_text})) // test1.c:8086:50: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2000 /* .xProc */)) = test_stmt_utf8 // test1.c:8087:33: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2008 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, int32) uintptr - }{sqlite3.Xsqlite3_column_name})) // test1.c:8087:50: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2024 /* .xProc */)) = test_stmt_int // test1.c:8088:33: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 8 /* .xProc */)) = test_sqlite3_db_config // test1.c:8277:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 32 /* .xProc */)) = test_sqlite3_txn_state // test1.c:8278:41: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 56 /* .xProc */)) = test_bad_behavior // test1.c:8279:41: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 64 /* .clientData */)) = uintptr(unsafe.Pointer(&iZero)) // test1.c:8279:61: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 80 /* .xProc */)) = test_register_dbstat_vtab // test1.c:8280:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 104 /* .xProc */)) = get_sqlite_pointer // test1.c:8281:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 128 /* .xProc */)) = test_intarray_addr // test1.c:8282:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 152 /* .xProc */)) = test_int64array_addr // test1.c:8283:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 176 /* .xProc */)) = test_doublearray_addr // test1.c:8284:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 200 /* .xProc */)) = test_textarray_addr // test1.c:8285:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 224 /* .xProc */)) = test_bind_int // test1.c:8286:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 248 /* .xProc */)) = test_bind_zeroblob // test1.c:8287:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 272 /* .xProc */)) = test_bind_zeroblob64 // test1.c:8288:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 296 /* .xProc */)) = test_bind_int64 // test1.c:8289:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 320 /* .xProc */)) = test_bind_double // test1.c:8290:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 344 /* .xProc */)) = test_bind_null // test1.c:8291:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 368 /* .xProc */)) = test_bind_text // test1.c:8292:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 392 /* .xProc */)) = test_bind_text16 // test1.c:8293:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 416 /* .xProc */)) = test_bind_blob // test1.c:8294:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 440 /* .xProc */)) = test_carray_bind // test1.c:8296:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 464 /* .xProc */)) = test_bind_parameter_count // test1.c:8298:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 488 /* .xProc */)) = test_bind_parameter_name // test1.c:8299:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 512 /* .xProc */)) = test_bind_parameter_index // test1.c:8300:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 536 /* .xProc */)) = test_clear_bindings // test1.c:8301:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 560 /* .xProc */)) = test_sleep // test1.c:8302:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 584 /* .xProc */)) = test_errcode // test1.c:8303:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 608 /* .xProc */)) = test_ex_errcode // test1.c:8304:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 632 /* .xProc */)) = test_errmsg // test1.c:8305:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 656 /* .xProc */)) = test_errmsg16 // test1.c:8306:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 680 /* .xProc */)) = test_open // test1.c:8307:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 704 /* .xProc */)) = test_open16 // test1.c:8308:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 728 /* .xProc */)) = test_open_v2 // test1.c:8309:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 752 /* .xProc */)) = test_complete16 // test1.c:8310:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 776 /* .xProc */)) = test_normalize // test1.c:8311:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 800 /* .xProc */)) = test_prepare // test1.c:8313:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 824 /* .xProc */)) = test_prepare16 // test1.c:8314:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 848 /* .xProc */)) = test_prepare_v2 // test1.c:8315:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 872 /* .xProc */)) = test_prepare_v3 // test1.c:8316:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 896 /* .xProc */)) = test_prepare_tkt3134 // test1.c:8317:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 920 /* .xProc */)) = test_prepare16_v2 // test1.c:8318:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 944 /* .xProc */)) = test_finalize // test1.c:8319:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 968 /* .xProc */)) = test_stmt_status // test1.c:8320:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 992 /* .xProc */)) = test_reset // test1.c:8321:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1016 /* .xProc */)) = test_expired // test1.c:8322:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1040 /* .xProc */)) = test_transfer_bind // test1.c:8323:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1064 /* .xProc */)) = test_changes // test1.c:8324:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1088 /* .xProc */)) = test_step // test1.c:8325:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1112 /* .xProc */)) = test_sql // test1.c:8326:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1136 /* .xProc */)) = test_ex_sql // test1.c:8327:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1160 /* .xProc */)) = test_next_stmt // test1.c:8331:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1184 /* .xProc */)) = test_stmt_readonly // test1.c:8332:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1208 /* .xProc */)) = test_stmt_isexplain // test1.c:8333:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1232 /* .xProc */)) = test_stmt_busy // test1.c:8334:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1256 /* .xProc */)) = uses_stmt_journal // test1.c:8335:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1280 /* .xProc */)) = test_release_memory // test1.c:8337:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1304 /* .xProc */)) = test_db_release_memory // test1.c:8338:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1328 /* .xProc */)) = test_db_cacheflush // test1.c:8339:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1352 /* .xProc */)) = test_system_errno // test1.c:8340:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1376 /* .xProc */)) = test_db_filename // test1.c:8341:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1400 /* .xProc */)) = test_db_readonly // test1.c:8342:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1424 /* .xProc */)) = test_soft_heap_limit // test1.c:8343:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1448 /* .xProc */)) = test_soft_heap_limit // test1.c:8344:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1472 /* .xProc */)) = test_hard_heap_limit // test1.c:8345:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1496 /* .xProc */)) = test_thread_cleanup // test1.c:8346:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1520 /* .xProc */)) = test_pager_refcounts // test1.c:8347:41: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1544 /* .xProc */)) = test_load_extension // test1.c:8349:41: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1568 /* .xProc */)) = test_enable_load // test1.c:8350:41: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1592 /* .xProc */)) = test_extended_result_codes // test1.c:8351:41: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1616 /* .xProc */)) = test_limit // test1.c:8352:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1640 /* .xProc */)) = test_dbconfig_maindbname_icecube // test1.c:8353:41: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1664 /* .xProc */)) = save_prng_state // test1.c:8355:41: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1688 /* .xProc */)) = restore_prng_state // test1.c:8356:41: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1712 /* .xProc */)) = reset_prng_state // test1.c:8357:41: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1736 /* .xProc */)) = prng_seed // test1.c:8358:41: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1760 /* .xProc */)) = extra_schema_checks // test1.c:8359:41: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1784 /* .xProc */)) = database_never_corrupt // test1.c:8360:41: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1808 /* .xProc */)) = database_may_be_corrupt // test1.c:8361:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1832 /* .xProc */)) = optimization_control // test1.c:8362:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1856 /* .xProc */)) = runAsObjProc // test1.c:8371:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1880 /* .xProc */)) = test_column_count // test1.c:8374:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1904 /* .xProc */)) = test_data_count // test1.c:8375:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1928 /* .xProc */)) = test_column_type // test1.c:8376:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1952 /* .xProc */)) = test_column_blob // test1.c:8377:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1976 /* .xProc */)) = test_column_double // test1.c:8378:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2000 /* .xProc */)) = test_column_int64 // test1.c:8379:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2024 /* .xProc */)) = test_stmt_utf8 // test1.c:8380:33: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2032 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, int32) int32 - }{sqlite3.Xsqlite3_column_int})) // test1.c:8088:50: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2048 /* .xProc */)) = test_stmt_int // test1.c:8089:33: + f func(*libc.TLS, uintptr, int32) uintptr + }{sqlite3.Xsqlite3_column_text})) // test1.c:8380:50: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2048 /* .xProc */)) = test_stmt_utf8 // test1.c:8381:33: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2056 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, int32) int32 - }{sqlite3.Xsqlite3_column_bytes})) // test1.c:8089:50: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2072 /* .xProc */)) = test_stmt_utf8 // test1.c:8091:34: + f func(*libc.TLS, uintptr, int32) uintptr + }{sqlite3.Xsqlite3_column_name})) // test1.c:8381:50: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2072 /* .xProc */)) = test_stmt_int // test1.c:8382:33: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2080 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, int32) uintptr - }{sqlite3.Xsqlite3_column_decltype})) // test1.c:8091:49: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2096 /* .xProc */)) = test_stmt_utf8 // test1.c:8094:34: + f func(*libc.TLS, uintptr, int32) int32 + }{sqlite3.Xsqlite3_column_int})) // test1.c:8382:50: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2096 /* .xProc */)) = test_stmt_int // test1.c:8383:33: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2104 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, int32) uintptr - }{sqlite3.Xsqlite3_column_database_name})) // test1.c:8094:49: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2120 /* .xProc */)) = test_stmt_utf8 // test1.c:8095:31: + f func(*libc.TLS, uintptr, int32) int32 + }{sqlite3.Xsqlite3_column_bytes})) // test1.c:8383:50: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2120 /* .xProc */)) = test_stmt_utf8 // test1.c:8385:34: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2128 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32) uintptr - }{sqlite3.Xsqlite3_column_table_name})) // test1.c:8095:46: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2144 /* .xProc */)) = test_stmt_utf8 // test1.c:8096:32: + }{sqlite3.Xsqlite3_column_decltype})) // test1.c:8385:49: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2144 /* .xProc */)) = test_stmt_utf8 // test1.c:8388:34: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2152 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32) uintptr - }{sqlite3.Xsqlite3_column_origin_name})) // test1.c:8096:47: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2168 /* .xProc */)) = test_stmt_int // test1.c:8100:34: + }{sqlite3.Xsqlite3_column_database_name})) // test1.c:8388:49: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2168 /* .xProc */)) = test_stmt_utf8 // test1.c:8389:31: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2176 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, int32) int32 - }{sqlite3.Xsqlite3_column_bytes16})) // test1.c:8100:49: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2192 /* .xProc */)) = test_stmt_utf16 // test1.c:8101:34: + f func(*libc.TLS, uintptr, int32) uintptr + }{sqlite3.Xsqlite3_column_table_name})) // test1.c:8389:46: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2192 /* .xProc */)) = test_stmt_utf8 // test1.c:8390:32: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2200 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32) uintptr - }{sqlite3.Xsqlite3_column_text16})) // test1.c:8101:51: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2216 /* .xProc */)) = test_stmt_utf16 // test1.c:8102:34: + }{sqlite3.Xsqlite3_column_origin_name})) // test1.c:8390:47: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2216 /* .xProc */)) = test_stmt_int // test1.c:8394:34: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2224 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, int32) int32 + }{sqlite3.Xsqlite3_column_bytes16})) // test1.c:8394:49: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2240 /* .xProc */)) = test_stmt_utf16 // test1.c:8395:34: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2248 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32) uintptr - }{sqlite3.Xsqlite3_column_name16})) // test1.c:8102:51: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2240 /* .xProc */)) = add_alignment_test_collations // test1.c:8103:41: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2264 /* .xProc */)) = test_stmt_utf16 // test1.c:8105:36: + }{sqlite3.Xsqlite3_column_text16})) // test1.c:8395:51: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2264 /* .xProc */)) = test_stmt_utf16 // test1.c:8396:34: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2272 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32) uintptr - }{sqlite3.Xsqlite3_column_decltype16})) // test1.c:8105:52: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2288 /* .xProc */)) = test_stmt_utf16 // test1.c:8109:3: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2296 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, int32) uintptr - }{sqlite3.Xsqlite3_column_database_name16})) // test1.c:8109:20: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2312 /* .xProc */)) = test_stmt_utf16 // test1.c:8110:33: + }{sqlite3.Xsqlite3_column_name16})) // test1.c:8396:51: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2288 /* .xProc */)) = add_alignment_test_collations // test1.c:8397:41: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2312 /* .xProc */)) = test_stmt_utf16 // test1.c:8399:36: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2320 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32) uintptr - }{sqlite3.Xsqlite3_column_table_name16})) // test1.c:8110:50: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2336 /* .xProc */)) = test_stmt_utf16 // test1.c:8111:34: + }{sqlite3.Xsqlite3_column_decltype16})) // test1.c:8399:52: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2336 /* .xProc */)) = test_stmt_utf16 // test1.c:8403:3: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2344 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32) uintptr - }{sqlite3.Xsqlite3_column_origin_name16})) // test1.c:8111:51: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2360 /* .xProc */)) = test_create_collation_v2 // test1.c:8114:39: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2384 /* .xProc */)) = test_global_recover // test1.c:8115:38: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2408 /* .xProc */)) = working_64bit_int // test1.c:8116:38: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2432 /* .xProc */)) = vfs_unlink_test // test1.c:8117:38: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2456 /* .xProc */)) = vfs_initfail_test // test1.c:8118:38: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2480 /* .xProc */)) = vfs_unregister_all // test1.c:8119:38: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2504 /* .xProc */)) = vfs_reregister_all // test1.c:8120:38: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2528 /* .xProc */)) = file_control_test // test1.c:8121:38: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2552 /* .xProc */)) = file_control_lasterrno_test // test1.c:8122:39: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2576 /* .xProc */)) = file_control_lockproxy_test // test1.c:8123:39: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2600 /* .xProc */)) = file_control_chunksize_test // test1.c:8124:39: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2624 /* .xProc */)) = file_control_sizehint_test // test1.c:8125:39: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2648 /* .xProc */)) = file_control_data_version // test1.c:8126:39: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2672 /* .xProc */)) = file_control_persist_wal // test1.c:8132:39: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2696 /* .xProc */)) = file_control_powersafe_overwrite // test1.c:8133:43: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2720 /* .xProc */)) = file_control_vfsname // test1.c:8134:39: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2744 /* .xProc */)) = file_control_tempfilename // test1.c:8135:39: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2768 /* .xProc */)) = vfs_list // test1.c:8136:38: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2792 /* .xProc */)) = test_create_function_v2 // test1.c:8137:38: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2816 /* .xProc */)) = test_collate // test1.c:8141:35: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2840 /* .xProc */)) = test_collate_needed // test1.c:8142:35: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2864 /* .xProc */)) = test_function // test1.c:8143:35: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2888 /* .xProc */)) = test_utf16bin_collate // test1.c:8144:40: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2912 /* .xProc */)) = test_errstr // test1.c:8146:35: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2936 /* .xProc */)) = tcl_variable_type // test1.c:8147:35: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2960 /* .xProc */)) = test_enable_shared // test1.c:8149:39: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2984 /* .xProc */)) = sqlite3BtreeSharedCacheReport // test1.c:8150:39: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3008 /* .xProc */)) = test_libversion_number // test1.c:8152:37: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3032 /* .xProc */)) = test_table_column_metadata // test1.c:8153:41: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3056 /* .xProc */)) = test_blob_reopen // test1.c:8155:31: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3080 /* .xProc */)) = test_pcache_stats // test1.c:8157:30: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3104 /* .xProc */)) = test_unlock_notify // test1.c:8159:33: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3128 /* .xProc */)) = test_wal_checkpoint // test1.c:8161:36: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3152 /* .xProc */)) = test_wal_checkpoint_v2 // test1.c:8162:36: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3176 /* .xProc */)) = test_wal_autocheckpoint // test1.c:8163:37: - *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3200 /* .xProc */)) = test_sqlite3_log // test1.c:8164:36: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3224 /* .xProc */)) = test_print_eqp // test1.c:8166:36: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3248 /* .xProc */)) = test_test_control // test1.c:8168:32: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3272 /* .xProc */)) = test_getrusage // test1.c:8170:21: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3296 /* .xProc */)) = tclLoadStaticExtensionCmd // test1.c:8172:33: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3320 /* .xProc */)) = sorter_test_fakeheap // test1.c:8173:32: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3344 /* .xProc */)) = sorter_test_sort4_helper // test1.c:8174:36: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3368 /* .xProc */)) = vfsCurrentTimeInt64 // test1.c:8188:44: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3392 /* .xProc */)) = test_snapshot_get // test1.c:8190:32: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3416 /* .xProc */)) = test_snapshot_open // test1.c:8191:33: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3440 /* .xProc */)) = test_snapshot_free // test1.c:8192:33: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3464 /* .xProc */)) = test_snapshot_cmp // test1.c:8193:32: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3488 /* .xProc */)) = test_snapshot_recover // test1.c:8194:36: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3512 /* .xProc */)) = test_snapshot_get_blob // test1.c:8195:37: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3536 /* .xProc */)) = test_snapshot_open_blob // test1.c:8196:38: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3560 /* .xProc */)) = test_snapshot_cmp_blob // test1.c:8197:37: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3584 /* .xProc */)) = test_delete_database // test1.c:8199:35: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3608 /* .xProc */)) = test_atomic_batch_write // test1.c:8200:35: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3632 /* .xProc */)) = test_mmap_warm // test1.c:8201:35: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3656 /* .xProc */)) = test_config_sorterref // test1.c:8202:36: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3680 /* .xProc */)) = test_decode_hexdb // test1.c:8203:36: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3704 /* .xProc */)) = test_write_db // test1.c:8204:36: + }{sqlite3.Xsqlite3_column_database_name16})) // test1.c:8403:20: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2360 /* .xProc */)) = test_stmt_utf16 // test1.c:8404:33: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2368 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, int32) uintptr + }{sqlite3.Xsqlite3_column_table_name16})) // test1.c:8404:50: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2384 /* .xProc */)) = test_stmt_utf16 // test1.c:8405:34: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2392 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, int32) uintptr + }{sqlite3.Xsqlite3_column_origin_name16})) // test1.c:8405:51: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2408 /* .xProc */)) = test_create_collation_v2 // test1.c:8408:39: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2432 /* .xProc */)) = test_global_recover // test1.c:8409:38: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2456 /* .xProc */)) = working_64bit_int // test1.c:8410:38: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2480 /* .xProc */)) = vfs_unlink_test // test1.c:8411:38: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2504 /* .xProc */)) = vfs_initfail_test // test1.c:8412:38: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2528 /* .xProc */)) = vfs_unregister_all // test1.c:8413:38: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2552 /* .xProc */)) = vfs_reregister_all // test1.c:8414:38: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2576 /* .xProc */)) = file_control_test // test1.c:8415:38: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2600 /* .xProc */)) = file_control_lasterrno_test // test1.c:8416:39: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2624 /* .xProc */)) = file_control_lockproxy_test // test1.c:8417:39: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2648 /* .xProc */)) = file_control_chunksize_test // test1.c:8418:39: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2672 /* .xProc */)) = file_control_sizehint_test // test1.c:8419:39: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2696 /* .xProc */)) = file_control_data_version // test1.c:8420:39: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2720 /* .xProc */)) = file_control_persist_wal // test1.c:8426:39: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2744 /* .xProc */)) = file_control_powersafe_overwrite // test1.c:8427:43: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2768 /* .xProc */)) = file_control_vfsname // test1.c:8428:39: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2792 /* .xProc */)) = file_control_reservebytes // test1.c:8429:39: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2816 /* .xProc */)) = file_control_tempfilename // test1.c:8430:39: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2840 /* .xProc */)) = vfs_list // test1.c:8431:38: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2864 /* .xProc */)) = test_create_function_v2 // test1.c:8432:38: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2888 /* .xProc */)) = test_collate // test1.c:8436:35: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2912 /* .xProc */)) = test_collate_needed // test1.c:8437:35: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2936 /* .xProc */)) = test_function // test1.c:8438:35: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2960 /* .xProc */)) = test_utf16bin_collate // test1.c:8439:40: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2984 /* .xProc */)) = test_errstr // test1.c:8441:35: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3008 /* .xProc */)) = tcl_variable_type // test1.c:8442:35: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3032 /* .xProc */)) = test_enable_shared // test1.c:8444:39: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3056 /* .xProc */)) = sqlite3BtreeSharedCacheReport // test1.c:8445:39: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3080 /* .xProc */)) = test_libversion_number // test1.c:8447:37: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3104 /* .xProc */)) = test_table_column_metadata // test1.c:8448:41: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3128 /* .xProc */)) = test_blob_reopen // test1.c:8450:31: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3152 /* .xProc */)) = test_pcache_stats // test1.c:8452:30: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3176 /* .xProc */)) = test_unlock_notify // test1.c:8454:33: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3200 /* .xProc */)) = test_wal_checkpoint // test1.c:8456:36: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3224 /* .xProc */)) = test_wal_checkpoint_v2 // test1.c:8457:36: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3248 /* .xProc */)) = test_wal_autocheckpoint // test1.c:8458:37: + *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3272 /* .xProc */)) = test_sqlite3_log // test1.c:8459:36: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3296 /* .xProc */)) = test_print_eqp // test1.c:8461:36: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3320 /* .xProc */)) = test_test_control // test1.c:8463:32: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3344 /* .xProc */)) = test_getrusage // test1.c:8465:21: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3368 /* .xProc */)) = tclLoadStaticExtensionCmd // test1.c:8467:33: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3392 /* .xProc */)) = sorter_test_fakeheap // test1.c:8468:32: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3416 /* .xProc */)) = sorter_test_sort4_helper // test1.c:8469:36: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3440 /* .xProc */)) = vfsCurrentTimeInt64 // test1.c:8483:44: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3464 /* .xProc */)) = test_snapshot_get // test1.c:8485:32: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3488 /* .xProc */)) = test_snapshot_open // test1.c:8486:33: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3512 /* .xProc */)) = test_snapshot_free // test1.c:8487:33: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3536 /* .xProc */)) = test_snapshot_cmp // test1.c:8488:32: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3560 /* .xProc */)) = test_snapshot_recover // test1.c:8489:36: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3584 /* .xProc */)) = test_snapshot_get_blob // test1.c:8490:37: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3608 /* .xProc */)) = test_snapshot_open_blob // test1.c:8491:38: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3632 /* .xProc */)) = test_snapshot_cmp_blob // test1.c:8492:37: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3656 /* .xProc */)) = test_delete_database // test1.c:8494:35: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3680 /* .xProc */)) = test_atomic_batch_write // test1.c:8495:35: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3704 /* .xProc */)) = test_mmap_warm // test1.c:8496:35: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3728 /* .xProc */)) = test_config_sorterref // test1.c:8497:36: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3752 /* .xProc */)) = test_decode_hexdb // test1.c:8498:36: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3776 /* .xProc */)) = test_write_db // test1.c:8499:36: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3800 /* .xProc */)) = test_register_cksumvfs // test1.c:8500:37: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3824 /* .xProc */)) = test_unregister_cksumvfs // test1.c:8501:39: *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 8 /* .xProc */)) = test_intarray_create // test_intarray.c:381:35: *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 32 /* .xProc */)) = test_intarray_bind // test_intarray.c:382:33: *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 8 /* .xProc */)) = test_malloc // test_malloc.c:1473:38: @@ -78752,16 +80283,84 @@ func init() { *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 88 /* .xColumn */)) = amatchColumn // amatch.c:1466:3: *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 96 /* .xRowid */)) = amatchRowid // amatch.c:1467:3: *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 104 /* .xUpdate */)) = amatchUpdate // amatch.c:1468:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 16 /* .xConnect */)) = carrayConnect // carray.c:336:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 24 /* .xBestIndex */)) = carrayBestIndex // carray.c:337:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 32 /* .xDisconnect */)) = carrayDisconnect // carray.c:338:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 48 /* .xOpen */)) = carrayOpen // carray.c:340:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 56 /* .xClose */)) = carrayClose // carray.c:341:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 64 /* .xFilter */)) = carrayFilter // carray.c:342:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 72 /* .xNext */)) = carrayNext // carray.c:343:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 80 /* .xEof */)) = carrayEof // carray.c:344:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 88 /* .xColumn */)) = carrayColumn // carray.c:345:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 96 /* .xRowid */)) = carrayRowid // carray.c:346:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 8 /* .xClose */)) = apndClose // appendvfs.c:196:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 16 /* .xRead */)) = apndRead // appendvfs.c:197:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 24 /* .xWrite */)) = apndWrite // appendvfs.c:198:3: + *(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 32 /* .xTruncate */)) = apndTruncate // appendvfs.c:199:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 40 /* .xSync */)) = apndSync // appendvfs.c:200:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 48 /* .xFileSize */)) = apndFileSize // appendvfs.c:201:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 56 /* .xLock */)) = apndLock // appendvfs.c:202:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 64 /* .xUnlock */)) = apndUnlock // appendvfs.c:203:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 72 /* .xCheckReservedLock */)) = apndCheckReservedLock // appendvfs.c:204:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 80 /* .xFileControl */)) = apndFileControl // appendvfs.c:205:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 88 /* .xSectorSize */)) = apndSectorSize // appendvfs.c:206:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 96 /* .xDeviceCharacteristics */)) = apndDeviceCharacteristics // appendvfs.c:207:3: + *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 104 /* .xShmMap */)) = apndShmMap // appendvfs.c:208:3: + *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 112 /* .xShmLock */)) = apndShmLock // appendvfs.c:209:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 120 /* .xShmBarrier */)) = apndShmBarrier // appendvfs.c:210:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 128 /* .xShmUnmap */)) = apndShmUnmap // appendvfs.c:211:3: + *(*func(*libc.TLS, uintptr, sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 136 /* .xFetch */)) = apndFetch // appendvfs.c:212:3: + *(*func(*libc.TLS, uintptr, sqlite3_int64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_io_methods)) + 144 /* .xUnfetch */)) = apndUnfetch // appendvfs.c:213:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 40 /* .xOpen */)) = apndOpen // appendvfs.c:176:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 48 /* .xDelete */)) = apndDelete // appendvfs.c:177:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 56 /* .xAccess */)) = apndAccess // appendvfs.c:178:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 64 /* .xFullPathname */)) = apndFullPathname // appendvfs.c:179:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 72 /* .xDlOpen */)) = apndDlOpen // appendvfs.c:180:3: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 80 /* .xDlError */)) = apndDlError // appendvfs.c:181:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 88 /* .xDlSym */)) = apndDlSym // appendvfs.c:182:3: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 96 /* .xDlClose */)) = apndDlClose // appendvfs.c:183:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 104 /* .xRandomness */)) = apndRandomness // appendvfs.c:184:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 112 /* .xSleep */)) = apndSleep // appendvfs.c:185:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 120 /* .xCurrentTime */)) = apndCurrentTime // appendvfs.c:186:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 128 /* .xGetLastError */)) = apndGetLastError // appendvfs.c:187:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 136 /* .xCurrentTimeInt64 */)) = apndCurrentTimeInt64 // appendvfs.c:188:3: + *(*func(*libc.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 144 /* .xSetSystemCall */)) = apndSetSystemCall // appendvfs.c:189:3: + *(*func(*libc.TLS, uintptr, uintptr) sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 152 /* .xGetSystemCall */)) = apndGetSystemCall // appendvfs.c:190:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&apnd_vfs)) + 160 /* .xNextSystemCall */)) = apndNextSystemCall // appendvfs.c:191:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 16 /* .xConnect */)) = carrayConnect // carray.c:368:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 24 /* .xBestIndex */)) = carrayBestIndex // carray.c:369:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 32 /* .xDisconnect */)) = carrayDisconnect // carray.c:370:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 48 /* .xOpen */)) = carrayOpen // carray.c:372:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 56 /* .xClose */)) = carrayClose // carray.c:373:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 64 /* .xFilter */)) = carrayFilter // carray.c:374:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 72 /* .xNext */)) = carrayNext // carray.c:375:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 80 /* .xEof */)) = carrayEof // carray.c:376:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 88 /* .xColumn */)) = carrayColumn // carray.c:377:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 96 /* .xRowid */)) = carrayRowid // carray.c:378:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 8 /* .xClose */)) = cksmClose // cksumvfs.c:274:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 16 /* .xRead */)) = cksmRead // cksumvfs.c:275:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 24 /* .xWrite */)) = cksmWrite // cksumvfs.c:276:3: + *(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 32 /* .xTruncate */)) = cksmTruncate // cksumvfs.c:277:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 40 /* .xSync */)) = cksmSync // cksumvfs.c:278:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 48 /* .xFileSize */)) = cksmFileSize // cksumvfs.c:279:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 56 /* .xLock */)) = cksmLock // cksumvfs.c:280:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 64 /* .xUnlock */)) = cksmUnlock // cksumvfs.c:281:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 72 /* .xCheckReservedLock */)) = cksmCheckReservedLock // cksumvfs.c:282:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 80 /* .xFileControl */)) = cksmFileControl // cksumvfs.c:283:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 88 /* .xSectorSize */)) = cksmSectorSize // cksumvfs.c:284:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 96 /* .xDeviceCharacteristics */)) = cksmDeviceCharacteristics // cksumvfs.c:285:3: + *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 104 /* .xShmMap */)) = cksmShmMap // cksumvfs.c:286:3: + *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 112 /* .xShmLock */)) = cksmShmLock // cksumvfs.c:287:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 120 /* .xShmBarrier */)) = cksmShmBarrier // cksumvfs.c:288:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 128 /* .xShmUnmap */)) = cksmShmUnmap // cksumvfs.c:289:3: + *(*func(*libc.TLS, uintptr, sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 136 /* .xFetch */)) = cksmFetch // cksumvfs.c:290:3: + *(*func(*libc.TLS, uintptr, sqlite3_int64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_io_methods)) + 144 /* .xUnfetch */)) = cksmUnfetch // cksumvfs.c:291:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 40 /* .xOpen */)) = cksmOpen // cksumvfs.c:254:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 48 /* .xDelete */)) = cksmDelete // cksumvfs.c:255:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 56 /* .xAccess */)) = cksmAccess // cksumvfs.c:256:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 64 /* .xFullPathname */)) = cksmFullPathname // cksumvfs.c:257:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 72 /* .xDlOpen */)) = cksmDlOpen // cksumvfs.c:258:3: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 80 /* .xDlError */)) = cksmDlError // cksumvfs.c:259:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 88 /* .xDlSym */)) = cksmDlSym // cksumvfs.c:260:3: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 96 /* .xDlClose */)) = cksmDlClose // cksumvfs.c:261:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 104 /* .xRandomness */)) = cksmRandomness // cksumvfs.c:262:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 112 /* .xSleep */)) = cksmSleep // cksumvfs.c:263:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 120 /* .xCurrentTime */)) = cksmCurrentTime // cksumvfs.c:264:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 128 /* .xGetLastError */)) = cksmGetLastError // cksumvfs.c:265:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 136 /* .xCurrentTimeInt64 */)) = cksmCurrentTimeInt64 // cksumvfs.c:266:3: + *(*func(*libc.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 144 /* .xSetSystemCall */)) = cksmSetSystemCall // cksumvfs.c:267:3: + *(*func(*libc.TLS, uintptr, uintptr) sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 152 /* .xGetSystemCall */)) = cksmGetSystemCall // cksumvfs.c:268:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&cksm_vfs)) + 160 /* .xNextSystemCall */)) = cksmNextSystemCall // cksumvfs.c:269:3: *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 8 /* .xCreate */)) = closureConnect // closure.c:920:3: *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 16 /* .xConnect */)) = closureConnect // closure.c:921:3: *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 24 /* .xBestIndex */)) = closureBestIndex // closure.c:922:3: @@ -78774,18 +80373,18 @@ func init() { *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 80 /* .xEof */)) = closureEof // closure.c:929:3: *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 88 /* .xColumn */)) = closureColumn // closure.c:930:3: *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 96 /* .xRowid */)) = closureRowid // closure.c:931:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 40 /* .xOpen */)) = cfOpen // test6.c:853:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 48 /* .xDelete */)) = cfDelete // test6.c:854:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 56 /* .xAccess */)) = cfAccess // test6.c:855:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 64 /* .xFullPathname */)) = cfFullPathname // test6.c:856:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 72 /* .xDlOpen */)) = cfDlOpen // test6.c:857:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 80 /* .xDlError */)) = cfDlError // test6.c:858:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 88 /* .xDlSym */)) = cfDlSym // test6.c:859:5: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 96 /* .xDlClose */)) = cfDlClose // test6.c:860:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 104 /* .xRandomness */)) = cfRandomness // test6.c:861:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 112 /* .xSleep */)) = cfSleep // test6.c:862:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 120 /* .xCurrentTime */)) = cfCurrentTime // test6.c:863:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 128 /* .xGetLastError */)) = cfGetLastError // test6.c:864:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 40 /* .xOpen */)) = cfOpen // test6.c:857:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 48 /* .xDelete */)) = cfDelete // test6.c:858:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 56 /* .xAccess */)) = cfAccess // test6.c:859:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 64 /* .xFullPathname */)) = cfFullPathname // test6.c:860:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 72 /* .xDlOpen */)) = cfDlOpen // test6.c:861:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 80 /* .xDlError */)) = cfDlError // test6.c:862:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 88 /* .xDlSym */)) = cfDlSym // test6.c:863:5: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 96 /* .xDlClose */)) = cfDlClose // test6.c:864:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 104 /* .xRandomness */)) = cfRandomness // test6.c:865:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 112 /* .xSleep */)) = cfSleep // test6.c:866:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 120 /* .xCurrentTime */)) = cfCurrentTime // test6.c:867:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 128 /* .xGetLastError */)) = cfGetLastError // test6.c:868:5: *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 8 /* .xClose */)) = devsymClose // test_devsym.c:229:3: *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 16 /* .xRead */)) = devsymRead // test_devsym.c:230:3: *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 24 /* .xWrite */)) = devsymWrite // test_devsym.c:231:3: @@ -79026,16 +80625,16 @@ func init() { *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 80 /* .xEof */)) = schemaEof // test_schema.c:285:3: *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 88 /* .xColumn */)) = schemaColumn // test_schema.c:286:3: *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 96 /* .xRowid */)) = schemaRowid // test_schema.c:287:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 16 /* .xConnect */)) = seriesConnect // series.c:383:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 24 /* .xBestIndex */)) = seriesBestIndex // series.c:384:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 32 /* .xDisconnect */)) = seriesDisconnect // series.c:385:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 48 /* .xOpen */)) = seriesOpen // series.c:387:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 56 /* .xClose */)) = seriesClose // series.c:388:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 64 /* .xFilter */)) = seriesFilter // series.c:389:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 72 /* .xNext */)) = seriesNext // series.c:390:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 80 /* .xEof */)) = seriesEof // series.c:391:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 88 /* .xColumn */)) = seriesColumn // series.c:392:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 96 /* .xRowid */)) = seriesRowid // series.c:393:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 16 /* .xConnect */)) = seriesConnect // series.c:400:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 24 /* .xBestIndex */)) = seriesBestIndex // series.c:401:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 32 /* .xDisconnect */)) = seriesDisconnect // series.c:402:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 48 /* .xOpen */)) = seriesOpen // series.c:404:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 56 /* .xClose */)) = seriesClose // series.c:405:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 64 /* .xFilter */)) = seriesFilter // series.c:406:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 72 /* .xNext */)) = seriesNext // series.c:407:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 80 /* .xEof */)) = seriesEof // series.c:408:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 88 /* .xColumn */)) = seriesColumn // series.c:409:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 96 /* .xRowid */)) = seriesRowid // series.c:410:3: *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 8 /* .xCreate */)) = spellfix1Create // spellfix.c:2993:3: *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 16 /* .xConnect */)) = spellfix1Connect // spellfix.c:2994:3: *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 24 /* .xBestIndex */)) = spellfix1BestIndex // spellfix.c:2995:3: @@ -79116,13 +80715,13 @@ func init() { *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 128 /* .xShmUnmap */)) = tvfsShmUnmap // test_vfs.c:221:3: *(*func(*libc.TLS, uintptr, sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 136 /* .xFetch */)) = tvfsFetch // test_vfs.c:222:3: *(*func(*libc.TLS, uintptr, sqlite3_int64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 144 /* .xUnfetch */)) = tvfsUnfetch // test_vfs.c:223:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 40 /* .xOpen */)) = tvfsOpen // test_vfs.c:1447:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 48 /* .xDelete */)) = tvfsDelete // test_vfs.c:1448:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 56 /* .xAccess */)) = tvfsAccess // test_vfs.c:1449:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 64 /* .xFullPathname */)) = tvfsFullPathname // test_vfs.c:1450:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 104 /* .xRandomness */)) = tvfsRandomness // test_vfs.c:1462:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 112 /* .xSleep */)) = tvfsSleep // test_vfs.c:1463:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 120 /* .xCurrentTime */)) = tvfsCurrentTime // test_vfs.c:1464:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 40 /* .xOpen */)) = tvfsOpen // test_vfs.c:1451:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 48 /* .xDelete */)) = tvfsDelete // test_vfs.c:1452:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 56 /* .xAccess */)) = tvfsAccess // test_vfs.c:1453:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 64 /* .xFullPathname */)) = tvfsFullPathname // test_vfs.c:1454:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 104 /* .xRandomness */)) = tvfsRandomness // test_vfs.c:1466:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 112 /* .xSleep */)) = tvfsSleep // test_vfs.c:1467:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 120 /* .xCurrentTime */)) = tvfsCurrentTime // test_vfs.c:1468:5: *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 8 /* .xCreate */)) = unionConnect // unionvtab.c:1332:5: *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 16 /* .xConnect */)) = unionConnect // unionvtab.c:1333:5: *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 24 /* .xBestIndex */)) = unionBestIndex // unionvtab.c:1334:5: @@ -79211,23 +80810,23 @@ func init() { *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 104 /* .xRandomness */)) = devsymRandomness // test_devsym.c:472:3: *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 112 /* .xSleep */)) = devsymSleep // test_devsym.c:473:3: *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 120 /* .xCurrentTime */)) = devsymCurrentTime // test_devsym.c:474:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 8 /* .xCreate */)) = zipfileConnect // zipfile.c:2143:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 16 /* .xConnect */)) = zipfileConnect // zipfile.c:2144:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 24 /* .xBestIndex */)) = zipfileBestIndex // zipfile.c:2145:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 32 /* .xDisconnect */)) = zipfileDisconnect // zipfile.c:2146:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 40 /* .xDestroy */)) = zipfileDisconnect // zipfile.c:2147:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 48 /* .xOpen */)) = zipfileOpen // zipfile.c:2148:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 56 /* .xClose */)) = zipfileClose // zipfile.c:2149:5: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 64 /* .xFilter */)) = zipfileFilter // zipfile.c:2150:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 72 /* .xNext */)) = zipfileNext // zipfile.c:2151:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 80 /* .xEof */)) = zipfileEof // zipfile.c:2152:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 88 /* .xColumn */)) = zipfileColumn // zipfile.c:2153:5: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 104 /* .xUpdate */)) = zipfileUpdate // zipfile.c:2155:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 112 /* .xBegin */)) = zipfileBegin // zipfile.c:2156:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 128 /* .xCommit */)) = zipfileCommit // zipfile.c:2158:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 136 /* .xRollback */)) = zipfileRollback // zipfile.c:2159:5: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 144 /* .xFindFunction */)) = zipfileFindFunction // zipfile.c:2160:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 8 /* .xCreate */)) = zipfileConnect // zipfile.c:2145:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 16 /* .xConnect */)) = zipfileConnect // zipfile.c:2146:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 24 /* .xBestIndex */)) = zipfileBestIndex // zipfile.c:2147:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 32 /* .xDisconnect */)) = zipfileDisconnect // zipfile.c:2148:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 40 /* .xDestroy */)) = zipfileDisconnect // zipfile.c:2149:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 48 /* .xOpen */)) = zipfileOpen // zipfile.c:2150:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 56 /* .xClose */)) = zipfileClose // zipfile.c:2151:5: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 64 /* .xFilter */)) = zipfileFilter // zipfile.c:2152:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 72 /* .xNext */)) = zipfileNext // zipfile.c:2153:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 80 /* .xEof */)) = zipfileEof // zipfile.c:2154:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 88 /* .xColumn */)) = zipfileColumn // zipfile.c:2155:5: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 104 /* .xUpdate */)) = zipfileUpdate // zipfile.c:2157:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 112 /* .xBegin */)) = zipfileBegin // zipfile.c:2158:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 128 /* .xCommit */)) = zipfileCommit // zipfile.c:2160:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 136 /* .xRollback */)) = zipfileRollback // zipfile.c:2161:5: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 144 /* .xFindFunction */)) = zipfileFindFunction // zipfile.c:2162:5: } -var ts1 = "%s\x00internal error!\x00SELECT * FROM main.%Q WHERE sample()\x00expert\x00PRAGMA table_info=%Q\x00main\x00, \x00%Q\x00 COLLATE %Q\x00 COLLATE %s\x00 DESC\x00PRAGMA index_list=%Q\x00PRAGMA index_xInfo=%Q\x00%s_idx_%08x\x00CREATE INDEX '%q' ON %Q(%s)\x00CREATE INDEX %s ON %s(%s)\x00EXPLAIN QUERY PLAN %s\x00 USING INDEX \x00 USING COVERING INDEX \x00%s\n\x00%s;\n\x00SELECT 'CREATE TEMP' || substr(sql, 7) FROM sqlite_schema WHERE tbl_name = %Q AND type IN ('table', 'trigger') ORDER BY type;\x00ALTER TABLE temp.%Q RENAME TO %Q\x00INSERT INTO %Q VALUES(\x00%s?\x00\x00)\x00UPDATE %Q SET \x00%s%Q=?\x00DELETE FROM %Q\x00t592690916721053953805701627921227776\x00DROP TABLE t592690916721053953805701627921227776\x00SELECT type, name, sql, 1 FROM sqlite_schema WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%%' UNION ALL SELECT type, name, sql, 2 FROM sqlite_schema WHERE type = 'trigger' AND tbl_name IN(SELECT name FROM sqlite_schema WHERE type = 'view') ORDER BY 4, 1\x00CREATE TABLE x(\x00%s%Q COLLATE %s\x00CREATE VIRTUAL TABLE %Q USING expert(%Q)\x00SELECT max(i.seqno) FROM sqlite_schema AS s, pragma_index_list(s.name) AS l, pragma_index_info(l.name) AS i WHERE s.type = 'table'\x00%sx.%Q IS rem(%d, x.%Q) COLLATE %s\x00%s%d\x00SELECT %s FROM %Q x ORDER BY %s\x00SELECT %s FROM temp.t592690916721053953805701627921227776 x ORDER BY %s\x00%d\x00 %d\x00DROP TABLE IF EXISTS temp.t592690916721053953805701627921227776\x00CREATE TABLE temp.t592690916721053953805701627921227776 AS SELECT * FROM %Q\x00SELECT s.rowid, s.name, l.name FROM sqlite_schema AS s, pragma_index_list(s.name) AS l WHERE s.type = 'table'\x00SELECT name, coll FROM pragma_index_xinfo(?) WHERE key\x00INSERT INTO sqlite_stat1 VALUES(?, ?, ?)\x00ANALYZE; PRAGMA writable_schema=1\x00rem\x00sample\x00ANALYZE sqlite_schema\x00:memory:\x00SELECT sql FROM sqlite_schema WHERE name NOT LIKE 'sqlite_%%' AND sql NOT LIKE 'CREATE VIRTUAL %%'\x00%s;%s%s\n\x00 -- stat1: \x00no such handle: \x00sql\x00TABLE\x00analyze\x00count\x00report\x00STMT EREPORT\x00destroy\x00SUBCOMMAND ...\x00sub-command\x00indexes\x00plan\x00candidates\x00DB\x00sqlite3expert%d\x00out of memory\x00sqlite3_expert_new\x00SQLITE_DONE\x00SQLITE_ERROR\x00SQLITE_OK\x00SELECT fts5(?1)\x00error: \x00fts5_api_ptr\x00f5t_2_%lld\x00xColumnCount\x00xRowCount\x00xColumnTotalSize\x00COL\x00xTokenize\x00TEXT SCRIPT\x00xPhraseCount\x00xPhraseSize\x00PHRASE\x00xInstCount\x00xInst\x00IDX\x00xRowid\x00xColumnText\x00xColumnSize\x00xQueryPhrase\x00PHRASE SCRIPT\x00xSetAuxdata\x00VALUE\x00xGetAuxdata\x00CLEAR\x00xSetAuxdataInt\x00INTEGER\x00xGetAuxdataInt\x00xPhraseForeach\x00IPHRASE COLVAR OFFVAR SCRIPT\x00xPhraseColumnForeach\x00IPHRASE COLVAR SCRIPT\x00SUB-COMMAND\x00f5t_%lld\x00bytearray\x00boolean\x00double\x00wideInt\x00int\x00DB NAME SCRIPT\x00?-subst? DB NAME TEXT\x00-subst\x00unrecognized option: \x00no such tokenizer: \x00error in tokenizer.xCreate()\x00error in tokenizer.xTokenize()\x00document\x00aux\x00query\x00prefixquery\x00invalid\x00-colocated\x00sqlite3_fts5_token may only be used by tokenizer callback\x00?-colocated? TEXT START END\x00error in fts5_api.xCreateTokenizer()\x00?BOOLEAN?\x00NSLOT TOKEN\x00sqlite3_fts5_create_tokenizer\x00sqlite3_fts5_token\x00sqlite3_fts5_tokenize\x00sqlite3_fts5_create_function\x00sqlite3_fts5_may_be_corrupt\x00sqlite3_fts5_token_hash\x00sqlite3_fts5_register_matchinfo\x00sqlite3_fts5_register_fts5tokenize\x00unrecognized matchinfo flag: %c\x00pcx\x00matchinfo\x00CREATE TABLE x(input HIDDEN, token, start, end, position)\x00fts5tokenize\x00%s: cost must be between 1 and %d\x00%s: maximum string length is %d\x00%s: iLang must be between 0 and %d\x00?\x00SELECT * FROM %Q.%Q\x00%s: %s\x00%s: %s has %d columns, expected 4\x00vocabulary_table\x00vocabulary_word\x00vocabulary_language\x00edit_distances\x00unrecognized argument: [%s]\n\x00no edit_distances table specified\x00CREATE TABLE x(word,distance,language,command HIDDEN,nword HIDDEN)\x000123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^abcdefghijklmnopqrstuvwxyz~\x00SELECT \"%w\" FROM \"%w\"\x00 WHERE \"%w\">=?1 AND \"%w\"=?2 ORDER BY 1\x00SELECT \"%w\" FROM \"%w\" WHERE \"%w\">=?1 ORDER BY 1\x00*\x00DELETE from %s is not allowed\x00UPDATE of %s is not allowed\x00INSERT INTO %s allowed for column [command] only\x00approximate_match\x00int32\x00int64\x00char*\x00CREATE TABLE x(value,pointer hidden,count hidden,ctype hidden)\x00carray\x00unknown datatype: %Q\x00inttoptr\x00tablename\x00idcolumn\x00parentcolumn\x00CREATE TABLE x(id,depth,root HIDDEN,tablename HIDDEN,idcolumn HIDDEN,parentcolumn HIDDEN)\x00SELECT \"%w\".\"%w\" FROM \"%w\" WHERE \"%w\".\"%w\"=?1\x00transitive_closure\x00rb\x00cannot open '%s' for reading\x00line %d: unescaped %c character\x00line %d: unterminated %c-quoted field\n\x00more than one '%s' parameter\x00yes\x00on\x00true\x00no\x00off\x00false\x00header\x00more than one 'header' parameter\x00testflags\x00columns\x00more than one 'columns' parameter\x00column= value must be positive\x00bad parameter: '%s'\x00must specify either filename= or data= but not both\x00%sc%d TEXT\x00,\x00%s\"%w\" TEXT\x00bad schema: '%s' - %s\x00filename\x00data\x00schema\x00csv\x00csv_wr\x00decimal_sum\x00decimal\x00decimal_cmp\x00decimal_add\x00decimal_sub\x00decimal_mul\x00 \x00eval\x00CREATE TABLE x(addr,opcode,p1,p2,p3,p4,p5,comment,sql HIDDEN)\x00EXPLAIN %s\x00explain\x00wb\x00wrong number of arguments to function writefile()\x00failed to create symlink: %s\x00failed to create directory: %s\x00failed to write file: %s\x00CREATE TABLE x(name,mode,mtime,data,path HIDDEN,dir HIDDEN)\x00cannot read directory: %s\x00%s/%s\x00cannot stat file: %s\x00table function fsdir requires an argument\x00table function fsdir requires a non-NULL argument\x00fsdir\x00readfile\x00writefile\x00lsmode\x00%s: ruleset must be between 0 and %d\x00%s: wrong number of CREATE VIRTUAL TABLE arguments\x00CREATE TABLE x(word,distance,ruleset)\x00fuzzer\x00ieee754(%lld,%d)\x00ieee754\x00ieee754_mantissa\x00ieee754_exponent\x00ieee754_to_blob\x00ieee754_from_blob\x00BEGIN; SELECT * FROM %s%q%ssqlite_schema\x00'\x00'.\x00PRAGMA %s%q%spage_size\x00sqlite3_mmap_warm_cache: Warmed up %d pages of %s\x00END\x00AND (%s)\x00collate \"%w\"\x00SELECT %s FROM %s WHERE %s>=(?1 || ?2) %s AND %s<=(?1 || char(1114111)) %s %s ORDER BY 1 %s ASC LIMIT 1\x00next_char\x00NULL\x00is\x00not\x00in(\x00in(select\x00in(with\x00?,?,?\x002nd argument to percentile() is not a number between 0.0 and 100.0\x002nd argument to percentile() is not the same for all input rows\x001st argument to percentile() is not numeric\x00Inf input to percentile()\x00percentile\x00CREATE TABLE prefixes(prefix TEXT, original_string TEXT HIDDEN)\x00prefixes\x00prefix_length\x00unknown \\ escape\x00afnrtv\\()*.+?[$^{|}]\x00\a\f\n\r\t\v\x00unmatched '('\x00'*' without operand\x00'+' without operand\x00'?' without operand\x00'{m,n}' without operand\x00unmatched '{'\x00n less than m in '{m,n}'\x00both m and n are zero in '{m,n}'\x00POSIX character classes not supported\x00unclosed '['\x00unrecognized character\x00regexp\x00remember\x00CREATE TABLE x(value,start hidden,stop hidden,step hidden)\x00generate_series() requires SQLite 3.8.12 or later\x00generate_series\x00.ABCDHLRMY9 ?\x00non-ASCII input to editdist()\x00NULL input to editdist()\x00SELECT iLang, cFrom, cTo, iCost FROM \"%w\" WHERE iLang>=0 ORDER BY iLang\x00editdist3\x00DROP TABLE IF EXISTS \"%w\".\"%w_vocab\"\x00CREATE TABLE x(word,rank,distance,langid, score, matchlen, phonehash HIDDEN, top HIDDEN, scope HIDDEN, srchcnt HIDDEN, soundslike HIDDEN, command HIDDEN)\x00CREATE TABLE IF NOT EXISTS \"%w\".\"%w_vocab\"(\n id INTEGER PRIMARY KEY,\n rank INT,\n langid INT,\n word TEXT,\n k1 TEXT,\n k2 TEXT\n);\n\x00CREATE INDEX IF NOT EXISTS \"%w\".\"%w_vocab_index_langid_k2\" ON \"%w_vocab\"(langid,k2);\x00edit_cost_table=\x00bad argument to spellfix1(): \"%s\"\x00SELECT id, word, rank, coalesce(k1,word) FROM \"%w\".\"%w_vocab\" WHERE langid=%d AND k2>=?1 AND k2=%lld\x00AND\x00%z %s rowid<=%lld\x00CREATE TABLE x(value)\x00wholenumber\x00CREATE TABLE y(name PRIMARY KEY,mode,mtime,sz,rawdata,data,method,z HIDDEN) WITHOUT ROWID;\x00zipfile\x00zipfile constructor requires one argument\x00error in fread()\x00error in fwrite()\x00failed to read CDS at offset %lld\x00%.*s\x00failed to read LFH at offset %d\x001.2.11\x00inflateInit2() failed (%d)\x00inflate() failed (%d)\x00zipfile: deflate() error\x00cannot find end of central directory record\x00zipfile() function requires an argument\x00cannot open file: %s\x00-rwxrwxrwx\x00zipfile: mode does not match data\x00zipfile: parse error in mode: %s\x00zipfile: missing filename\x00ab+\x00zipfile: failed to open file %s for writing\x00sz must be NULL\x00rawdata must be NULL\x00unknown compression method: %d\x00%s/\x00duplicate name: \"%s\"\x00{\"version-made-by\" : %u, \"version-to-extract\" : %u, \"flags\" : %u, \"compression\" : %u, \"time\" : %u, \"date\" : %u, \"crc32\" : %u, \"compressed-size\" : %u, \"uncompressed-size\" : %u, \"file-name-length\" : %u, \"extra-field-length\" : %u, \"file-comment-length\" : %u, \"disk-number-start\" : %u, \"internal-attr\" : %u, \"external-attr\" : %u, \"offset\" : %u }\x00zipfile_cds\x00wrong number of arguments to function zipfile()\x00first argument to zipfile() must be non-NULL\x00illegal method value: %d\x00non-directory name must not end with /\x00rbu_delta\x00step\x00close\x00create_rbu_delta\x00savestate\x00dbMain_eval\x00SQL\x00bp_progress\x00db\x00RBU\x00state\x00progress\x00close_no_error\x00temp_size_limit\x00LIMIT\x00temp_size\x00dbRbu_eval\x00METHOD\x00method\x00 - \x00oal\x00move\x00checkpoint\x00done\x00error\x00NAME TARGET-DB RBU-DB ?STATE-DB?\x00NAME TARGET-DB ?STATE-DB?\x00?-default? NAME PARENT\x00NAME\x00sqlite3rbu_db(0, 0)!=0\x00sqlite3rbu\x00sqlite3rbu_vacuum\x00sqlite3rbu_create_vfs\x00sqlite3rbu_destroy_vfs\x00sqlite3rbu_internal_test\x00incrblob\x00incrblob_%d\x00%lld\x00sqlite_unlock_notify_arg\x00sqlite_unlock_notify_argcount\x00DELETE\x00INSERT\x00UPDATE\x00SQLITE_COPY\x00SQLITE_CREATE_INDEX\x00SQLITE_CREATE_TABLE\x00SQLITE_CREATE_TEMP_INDEX\x00SQLITE_CREATE_TEMP_TABLE\x00SQLITE_CREATE_TEMP_TRIGGER\x00SQLITE_CREATE_TEMP_VIEW\x00SQLITE_CREATE_TRIGGER\x00SQLITE_CREATE_VIEW\x00SQLITE_DELETE\x00SQLITE_DROP_INDEX\x00SQLITE_DROP_TABLE\x00SQLITE_DROP_TEMP_INDEX\x00SQLITE_DROP_TEMP_TABLE\x00SQLITE_DROP_TEMP_TRIGGER\x00SQLITE_DROP_TEMP_VIEW\x00SQLITE_DROP_TRIGGER\x00SQLITE_DROP_VIEW\x00SQLITE_INSERT\x00SQLITE_PRAGMA\x00SQLITE_READ\x00SQLITE_SELECT\x00SQLITE_TRANSACTION\x00SQLITE_UPDATE\x00SQLITE_ATTACH\x00SQLITE_DETACH\x00SQLITE_ALTER_TABLE\x00SQLITE_REINDEX\x00SQLITE_ANALYZE\x00SQLITE_CREATE_VTABLE\x00SQLITE_DROP_VTABLE\x00SQLITE_FUNCTION\x00SQLITE_SAVEPOINT\x00SQLITE_RECURSIVE\x00????\x00SQLITE_DENY\x00SQLITE_IGNORE\x00RELEASE _tcl_transaction\x00COMMIT\x00ROLLBACK TO _tcl_transaction ; RELEASE _tcl_transaction\x00option\x00?CALLBACK?\x00?DATABASE? FILENAME\x00cannot open target database: \x00backup failed: \x00CALLBACK\x00cache option ?arg?\x00flush\x00size\x00size n\x00cannot convert \"\x00\" to integer\x00bad option \"\x00\": must be flush or size\x00NAME SCRIPT\x00SCRIPT\x00?OPTION? ?BOOLEAN?\x00unknown config option: \"\x00\"\x00CONFLICT-ALGORITHM TABLE FILENAME ?SEPARATOR? ?NULLINDICATOR?\x00\t\x00Error: non-null separator required for copy\x00rollback\x00abort\x00fail\x00ignore\x00replace\x00Error: \"\x00\", conflict-algorithm must be one of: rollback, abort, fail, ignore, or replace\x00SELECT * FROM '%q'\x00Error: no such table: \x00Error: \x00Error: can't malloc()\x00INSERT OR %q INTO '%q' VALUES(?\x00Error: cannot open file: \x00BEGIN\x00Error: %s line %d: expected %d columns of data but found %d\x00, failed while processing line: \x00?DATABASE? VALUE\x00-maxsize\x00-readonly\x00unknown option: \x00unable to set MEMDB content\x00extension loading is turned off at compile-time\x00-withoutnulls\x00unknown option: \"\x00?OPTIONS? SQL ?ARRAY-NAME? ?SCRIPT?\x00NAME ?SWITCHES? SCRIPT\x00-argcount\x00option requires an argument: \x00number of arguments must be non-negative\x00-deterministic\x00-directonly\x00-innocuous\x00-returntype\x00real\x00text\x00blob\x00any\x00type\x00\": must be -argcount, -deterministic, -directonly, -innocuous, or -returntype\x00?-readonly? ?DB? TABLE COLUMN ROWID\x00NULLVALUE\x00N CALLBACK\x00KEY\x00cannot open source database: \x00restore failed: \x00restore failed: source database busy\x00?DATABASE?\x00(step|sort|autoindex)\x00sort\x00autoindex\x00vmstep\x00bad argument: should be autoindex, step, sort or vmstep\x00MILLISECONDS\x00?CALLBACK? ?MASK?\x00trace type\x00SAVEPOINT _tcl_transaction\x00[TYPE] SCRIPT\x00transaction type\x00BEGIN EXCLUSIVE\x00BEGIN IMMEDIATE\x00?SCRIPT?\x00SUB-COMMAND ?ARGS?\x00hook ?SCRIPT?\x00INDEX\x00-use-legacy-prepare\x00-last-stmt-ptr\x00%p\x00unknown argument: \x00authorizer\x00backup\x00bind_fallback\x00busy\x00cache\x00changes\x00collate\x00collation_needed\x00commit_hook\x00complete\x00config\x00copy\x00deserialize\x00enable_load_extension\x00errorcode\x00exists\x00function\x00interrupt\x00last_insert_rowid\x00nullvalue\x00onecolumn\x00preupdate\x00profile\x00rekey\x00restore\x00rollback_hook\x00serialize\x00status\x00timeout\x00total_changes\x00trace\x00trace_v2\x00transaction\x00unlock_notify\x00update_hook\x00version\x00wal_hook\x00defensive\x00dqs_ddl\x00dqs_dml\x00enable_fkey\x00enable_qpsg\x00enable_trigger\x00enable_view\x00fts3_tokenizer\x00legacy_alter_table\x00legacy_file_format\x00load_extension\x00no_ckpt_on_close\x00reset_database\x00trigger_eqp\x00trusted_schema\x00writable_schema\x00statement\x00row\x00deferred\x00exclusive\x00immediate\x00depth\x00hook\x00new\x00old\x00HANDLE ?FILENAME? ?-vfs VFSNAME? ?-readonly BOOLEAN? ?-create BOOLEAN? ?-nofollow BOOLEAN? ?-nomutex BOOLEAN? ?-fullmutex BOOLEAN? ?-uri BOOLEAN?\x00-version\x00-sourceid\x00-has-codec\x000\x00-key\x00-vfs\x00-create\x00-nofollow\x00-nomutex\x00-fullmutex\x00-uri\x00-translatefilename\x00sqlite3\x00sqlite\x003.33.0\x00if {[llength $argv]>=1} {\nset argv0 [lindex $argv 0]\nset argv [lrange $argv 1 end]\nsource $argv0\n} else {\nset line {}\nwhile {![eof stdin]} {\nif {$line!=\"\"} {\nputs -nonewline \"> \"\n} else {\nputs -nonewline \"% \"\n}\nflush stdout\nappend line [gets stdin]\nif {[info complete $line]} {\nif {[catch {uplevel #0 $line} result]} {\nputs stderr \"Error: $result\"\n} elseif {$result!=\"\"} {\nputs $result\n}\nset line {}\n} else {\nappend line \\n\n}\n}\n}\n\x00SQLITE_DEBUG_BREAK\x00attach debugger to process %d and press any key to continue.\n\x00utf-8\x00argc\x00argv0\x00argv\x00errorInfo\x00%s: %s\n\x00SQLITE-CONNECTION\x00command not found: \x00error code %s (%d) does not match sqlite3_errcode %s (%d)\x00OMIT_MISUSE\x00wrong # args: should be \"\x00 DB FORMAT STRING\x00 DB HEX\x00 DB\x00 DB SQL\x00%z%s%s\x00%s%n\x00abcdefghijklmnopqrstuvwxyz\x00 DB FORMAT STRING ?COUNT?\x00 DB\"\x00 FILENAME\"\x00%02x\x00%04x\x00tkt2213 is not fixed\x00text16\x00bytes\x00bytes16\x00noop\x00x_coalesce\x00hex8\x00hex16\x00tkt2213func\x00pointer_change\x00counter1\x00counter2\x00intreal\x00x_sqlite_exec\x00value of 40 handed to x_count\x00x_count totals to 42\x00x_count\x00legacy_count\x00 TEXT\"\x00 FORMAT INT INT INT\"\x00argument is not a valid 64-bit integer\x00 FORMAT INT INT ?STRING?\"\x00 INT FORMAT INT INT ?STRING?\"\x00N must be non-negative\x00 FORMAT INT INT DOUBLE\"\x00 FORMAT DOUBLE DOUBLE\"\x00 FORMAT STRING\"\x00%08x%08x\x002nd argument should be 16-characters of hex\x00DB BOOLEAN\x00DB dbname tblname colname\x00CHANNEL ROWID\x00DB-HANDLE NAME CMP-PROC DEL-PROC\x00sqlite3_create_collate_v2() failed to detect an invalid encoding\x00utf8\x00utf16\x00utf16le\x00utf16be\x00DB NAME NARG ENC SWITCHES...\x00encoding\x00-func\x00-step\x00-final\x00-destroy\x00switch\x00DB-HANDLE FILE ?PROC?\x00this build omits sqlite3_load_extension()\x00DB-HANDLE ONOFF\x00string\x00value\x00first argument should be one of: int int64 string double null value\x00 DB FUNCTION-NAME\x00 \x00STMT PARAMETER RESETFLAG\x00SQLITE_STMTSTATUS_FULLSCAN_STEP\x00SQLITE_STMTSTATUS_SORT\x00SQLITE_STMTSTATUS_AUTOINDEX\x00SQLITE_STMTSTATUS_VM_STEP\x00SQLITE_STMTSTATUS_REPREPARE\x00SQLITE_STMTSTATUS_RUN\x00SQLITE_STMTSTATUS_MEMUSED\x00NBYTE\x00DB DBNAME\x00DB DBNAME SNAPSHOT\x00SNAPSHOT\x00SNAPSHOT1 SNAPSHOT2\x00bad SNAPSHOT\x00FILE\x00PATH\x00 DB STMT\x00 STMT\x00 FROM-STMT TO-STMT\x00 VM IDX VALUE (null|static|normal)\"\x00static\x00static-nbytes\x00normal\x00blob10\x00abc\x00xyz\x00pq\x004th argument should be \"null\" or \"static\" or \"normal\"\x00(%d) \x00test_collate\x00UTF-8\x00UTF-16LE\x00UTF-16BE\x00 \x00utf16bin\x00utf16_unaligned\x00utf16_aligned\x00test_function\x00\x00STMT IDX N\x00 STMT N VALUE\x00NaN\x00SNaN\x00-NaN\x00-SNaN\x00+Inf\x00-Inf\x00Epsilon\x00-Epsilon\x00NaN0\x00-NaN0\x00 STMT N\x00 STMT N VALUE BYTES\x00 STMT N DATA BYTES\x00cannot use %d blob bytes, have %d\x00STMT\x00STMT N\x00STMT NAME\x00 DB sql bytes ?tailvar?\x00 DB sql bytes tailvar\x00 DB sql bytes flags tailvar\x00\x00SELECT 1\x00 filename options-list\x00FILENAME FLAGS VFS\x00SQLITE_OPEN_READONLY\x00SQLITE_OPEN_READWRITE\x00SQLITE_OPEN_CREATE\x00SQLITE_OPEN_DELETEONCLOSE\x00SQLITE_OPEN_EXCLUSIVE\x00SQLITE_OPEN_AUTOPROXY\x00SQLITE_OPEN_MAIN_DB\x00SQLITE_OPEN_TEMP_DB\x00SQLITE_OPEN_TRANSIENT_DB\x00SQLITE_OPEN_MAIN_JOURNAL\x00SQLITE_OPEN_TEMP_JOURNAL\x00SQLITE_OPEN_SUBJOURNAL\x00SQLITE_OPEN_SUPER_JOURNAL\x00SQLITE_OPEN_NOMUTEX\x00SQLITE_OPEN_FULLMUTEX\x00SQLITE_OPEN_SHAREDCACHE\x00SQLITE_OPEN_PRIVATECACHE\x00SQLITE_OPEN_WAL\x00SQLITE_OPEN_URI\x00flag\x00\x00 STMT column\x00FLOAT\x00TEXT\x00BLOB\x00 DB MAGIC\x00SQLITE_MAGIC_OPEN\x00SQLITE_MAGIC_CLOSED\x00SQLITE_MAGIC_BUSY\x00SQLITE_MAGIC_ERROR\x00 DB function-name\x00VARIABLE\x00?N?\x001234567890000000\x00__one\x00__two\x00notadatabase\x00Unexpected non-zero errno: \x00DB [DBNAME]\x00%u\x00DB DBNAME SIZE\x00 DB PWD\x00 DB FLAG\x00%d %d\x00 DB ?AUXDB?\x00 DB ID VALUE\x00unknown limit type: \x00SQLITE_LIMIT_LENGTH\x00SQLITE_LIMIT_SQL_LENGTH\x00SQLITE_LIMIT_COLUMN\x00SQLITE_LIMIT_EXPR_DEPTH\x00SQLITE_LIMIT_COMPOUND_SELECT\x00SQLITE_LIMIT_VDBE_OP\x00SQLITE_LIMIT_FUNCTION_ARG\x00SQLITE_LIMIT_ATTACHED\x00SQLITE_LIMIT_LIKE_PATTERN_LENGTH\x00SQLITE_LIMIT_VARIABLE_NUMBER\x00SQLITE_LIMIT_TRIGGER_DEPTH\x00SQLITE_LIMIT_WORKER_THREADS\x00SQLITE_LIMIT_TOOSMALL\x00SQLITE_LIMIT_TOOBIG\x00SEED ?DB?\x00BOOLEAN\x00current\x00max\x00min\x00recyclable\x00DB ?NAME?\x00passive\x00full\x00restart\x00truncate\x00DB MODE ?NAME?\x00mode\x00DB VALUE\x00COMMAND ...\x00command has no objProc: \x00%d %d %d %s\n\x00SQLITE_TESTCTRL_LOCALTIME_FAULT\x00SQLITE_TESTCTRL_SORTER_MMAP\x00SQLITE_TESTCTRL_IMPOSTER\x00SQLITE_TESTCTRL_INTERNAL_FUNCTIONS\x00VERB ARGS...\x00VERB\x00ONOFF\x00DB LIMIT\x00DB dbName onOff tnum\x00ru_utime=%d.%06d ru_stime=%d.%06d ru_minflt=%d ru_majflt=%d\x00DB OPT BOOLEAN\x00unknown optimization - should be one of:\x00all\x00none\x00query-flattener\x00groupby-order\x00factor-constants\x00distinct-opt\x00cover-idx-scan\x00order-by-idx-join\x00transitive\x00omit-noop-join\x00stat4\x00skip-scan\x00push-down\x00DB NAME ...\x00no such extension: \x00initialization of \x00 failed: \x00amatch\x00closure\x00fileio\x00nextchar\x00series\x00spellfix\x00totype\x00BOOL\x00DB SQL1 NSTEP SQL2\x00data error: (a!=b)\x00checksum mismatch\x00sql error: \x00TYPE\x00Deliberate panic\x00DB SETTING [VALUE]\x00SQLITE_*\x00DBCONFIG_*\x00ENABLE_*\x00unknown sqlite3_db_config setting\x00FKEY\x00TRIGGER\x00FTS3_TOKENIZER\x00LOAD_EXTENSION\x00NO_CKPT_ON_CLOSE\x00QPSG\x00TRIGGER_EQP\x00RESET_DB\x00DEFENSIVE\x00WRITABLE_SCHEMA\x00LEGACY_ALTER_TABLE\x00DQS_DML\x00DQS_DDL\x00LEGACY_FILE_FORMAT\x00icecube\x00DB ?DBNAME?\x00DB OFFSET DATA\x00HEXDB\x00| size %d pagesize %d\x00bad 'pagesize' field\x00bad 'size' field\x00| page %d offset %d\x00| %d: %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x\x00sqlite_search_count\x00sqlite_found_count\x00sqlite_sort_count\x00sqlite3_max_blobsize\x00sqlite_like_count\x00sqlite_interrupt_count\x00sqlite_open_file_count\x00sqlite_current_time\x00sqlite3_xferopt_count\x00sqlite3_pager_readdb_count\x00sqlite3_pager_writedb_count\x00sqlite3_pager_writej_count\x00unaligned_string_counter\x00sqlite_last_needed_collation\x00sqlite_query_plan\x00sqlite_opentemp_count\x00sqlite_static_bind_value\x00sqlite_static_bind_nbyte\x00sqlite_temp_directory\x00sqlite_data_directory\x00bitmask_size\x00longdouble_size\x00sqlite_sync_count\x00sqlite_fullsync_count\x00db_enter\x00db_leave\x00sqlite3_mprintf_int\x00sqlite3_mprintf_int64\x00sqlite3_mprintf_long\x00sqlite3_mprintf_str\x00sqlite3_snprintf_str\x00sqlite3_mprintf_stronly\x00sqlite3_mprintf_double\x00sqlite3_mprintf_scaled\x00sqlite3_mprintf_hexdouble\x00sqlite3_mprintf_z_test\x00sqlite3_mprintf_n_test\x00sqlite3_snprintf_int\x00sqlite3_last_insert_rowid\x00sqlite3_exec_printf\x00sqlite3_exec_hex\x00sqlite3_exec\x00sqlite3_exec_nr\x00sqlite3_get_table_printf\x00sqlite3_close\x00sqlite3_close_v2\x00sqlite3_create_function\x00sqlite3_create_aggregate\x00sqlite3_drop_modules\x00sqlite_register_test_function\x00sqlite_abort\x00sqlite_bind\x00breakpoint\x00sqlite3_key\x00sqlite3_rekey\x00sqlite_set_magic\x00sqlite3_interrupt\x00sqlite_delete_function\x00sqlite_delete_collation\x00sqlite3_get_autocommit\x00sqlite3_busy_timeout\x00printf\x00sqlite3IoTrace\x00clang_sanitize_address\x00sqlite3_db_config\x00bad_behavior\x00register_dbstat_vtab\x00sqlite3_connection_pointer\x00intarray_addr\x00int64array_addr\x00doublearray_addr\x00textarray_addr\x00sqlite3_bind_int\x00sqlite3_bind_zeroblob\x00sqlite3_bind_zeroblob64\x00sqlite3_bind_int64\x00sqlite3_bind_double\x00sqlite3_bind_null\x00sqlite3_bind_text\x00sqlite3_bind_text16\x00sqlite3_bind_blob\x00sqlite3_bind_parameter_count\x00sqlite3_bind_parameter_name\x00sqlite3_bind_parameter_index\x00sqlite3_clear_bindings\x00sqlite3_sleep\x00sqlite3_errcode\x00sqlite3_extended_errcode\x00sqlite3_errmsg\x00sqlite3_errmsg16\x00sqlite3_open\x00sqlite3_open16\x00sqlite3_open_v2\x00sqlite3_complete16\x00sqlite3_normalize\x00sqlite3_prepare\x00sqlite3_prepare16\x00sqlite3_prepare_v2\x00sqlite3_prepare_v3\x00sqlite3_prepare_tkt3134\x00sqlite3_prepare16_v2\x00sqlite3_finalize\x00sqlite3_stmt_status\x00sqlite3_reset\x00sqlite3_expired\x00sqlite3_transfer_bindings\x00sqlite3_changes\x00sqlite3_step\x00sqlite3_sql\x00sqlite3_expanded_sql\x00sqlite3_next_stmt\x00sqlite3_stmt_readonly\x00sqlite3_stmt_isexplain\x00sqlite3_stmt_busy\x00uses_stmt_journal\x00sqlite3_release_memory\x00sqlite3_db_release_memory\x00sqlite3_db_cacheflush\x00sqlite3_system_errno\x00sqlite3_db_filename\x00sqlite3_db_readonly\x00sqlite3_soft_heap_limit\x00sqlite3_soft_heap_limit64\x00sqlite3_hard_heap_limit64\x00sqlite3_thread_cleanup\x00sqlite3_pager_refcounts\x00sqlite3_load_extension\x00sqlite3_enable_load_extension\x00sqlite3_extended_result_codes\x00sqlite3_limit\x00dbconfig_maindbname_icecube\x00save_prng_state\x00restore_prng_state\x00reset_prng_state\x00prng_seed\x00extra_schema_checks\x00database_never_corrupt\x00database_may_be_corrupt\x00optimization_control\x00tcl_objproc\x00sqlite3_column_count\x00sqlite3_data_count\x00sqlite3_column_type\x00sqlite3_column_blob\x00sqlite3_column_double\x00sqlite3_column_int64\x00sqlite3_column_text\x00sqlite3_column_name\x00sqlite3_column_int\x00sqlite3_column_bytes\x00sqlite3_column_decltype\x00sqlite3_column_database_name\x00sqlite3_column_table_name\x00sqlite3_column_origin_name\x00sqlite3_column_bytes16\x00sqlite3_column_text16\x00sqlite3_column_name16\x00add_alignment_test_collations\x00sqlite3_column_decltype16\x00sqlite3_column_database_name16\x00sqlite3_column_table_name16\x00sqlite3_column_origin_name16\x00sqlite3_create_collation_v2\x00sqlite3_global_recover\x00working_64bit_int\x00vfs_unlink_test\x00vfs_initfail_test\x00vfs_unregister_all\x00vfs_reregister_all\x00file_control_test\x00file_control_lasterrno_test\x00file_control_lockproxy_test\x00file_control_chunksize_test\x00file_control_sizehint_test\x00file_control_data_version\x00file_control_persist_wal\x00file_control_powersafe_overwrite\x00file_control_vfsname\x00file_control_tempfilename\x00sqlite3_vfs_list\x00sqlite3_create_function_v2\x00add_test_collate\x00add_test_collate_needed\x00add_test_function\x00add_test_utf16bin_collate\x00sqlite3_test_errstr\x00tcl_variable_type\x00sqlite3_enable_shared_cache\x00sqlite3_shared_cache_report\x00sqlite3_libversion_number\x00sqlite3_table_column_metadata\x00sqlite3_blob_reopen\x00pcache_stats\x00sqlite3_unlock_notify\x00sqlite3_wal_checkpoint\x00sqlite3_wal_checkpoint_v2\x00sqlite3_wal_autocheckpoint\x00test_sqlite3_log\x00print_explain_query_plan\x00sqlite3_test_control\x00getrusage\x00load_static_extension\x00sorter_test_fakeheap\x00sorter_test_sort4_helper\x00vfs_current_time_int64\x00sqlite3_snapshot_get\x00sqlite3_snapshot_open\x00sqlite3_snapshot_free\x00sqlite3_snapshot_cmp\x00sqlite3_snapshot_recover\x00sqlite3_snapshot_get_blob\x00sqlite3_snapshot_open_blob\x00sqlite3_snapshot_cmp_blob\x00sqlite3_delete_database\x00atomic_batch_write\x00sqlite3_mmap_warm\x00sqlite3_config_sorterref\x00decode_hexdb\x00test_write_db\x00*** OBSOLETE VARIABLE ***\x00 FILENAME N-PAGE\"\x00 ID\"\x00ref\x00page\x00err\x00hit\x00miss\x00ovfl\x00 ID PGNO\"\x00 PAGE\"\x00 PAGE DATA\"\x00 N-MEGABYTES FILE\"\x00open failed: \x00Hello, World!\x00write failed: \x00 PENDING-BYTE\"\x00fault simulator script failed: [%s]\x00 SCRIPT\"\x00 SIZE PROGRAM\"\x00sqlite_io_error_pending\x00sqlite_io_error_persist\x00sqlite_io_error_hit\x00sqlite_io_error_hardhit\x00sqlite_diskfull_pending\x00sqlite_diskfull\x00sqlite_pending_byte\x00pager_open\x00pager_close\x00pager_commit\x00pager_rollback\x00pager_stmt_begin\x00pager_stmt_commit\x00pager_stmt_rollback\x00pager_stats\x00pager_pagecount\x00page_get\x00page_lookup\x00page_unref\x00page_read\x00page_write\x00page_number\x00pager_truncate\x00fake_big_file\x00sqlite3BitvecBuiltinTest\x00sqlite3_test_control_pending_byte\x00sqlite3_test_control_fault_install\x00 FILENAME NCACHE FLAGS\"\x00read\x00write\x00 ID TABLENUM WRITEABLE\"\x00 START MULTIPLIER COUNT INCREMENT\"\x00putVarint returned %d - should be between 1 and 9\x00putVarint returned %d and getVarint returned %d\x00Wrote 0x%016llx and got back 0x%016llx\x00putVarint returned %d and GetVarint32 returned %d\x00Wrote 0x%016llx and got back 0x%016llx from GetVarint32\x00 DB-HANDLE ?N?\"\x00No such db-handle: \"\x00 BT NCACHE\"\x00?-intkey? CSR KEY VALUE\x00btree_insert\x00btree_open\x00btree_close\x00btree_begin_transaction\x00btree_pager_stats\x00btree_cursor\x00btree_close_cursor\x00btree_next\x00btree_eof\x00btree_payload_size\x00btree_first\x00btree_varint_test\x00btree_from_db\x00btree_ismemdb\x00btree_set_cache_size\x00thread ID must be an upper case letter\x00 ID FILENAME\x00thread \x00 is already running\x00failed to create the thread\x00 ID\x00no such thread\x00 ID N\x00column number out of range\x00no database is open\x00 ID SQL\x00no virtual machine available\x00 IDL\x00 ID1 ID2\x00 ID DB\x00thread_create\x00thread_wait\x00thread_halt\x00thread_argc\x00thread_argv\x00thread_colname\x00thread_result\x00thread_error\x00thread_compile\x00thread_step\x00thread_finalize\x00thread_swap\x00thread_db_get\x00thread_db_put\x00thread_stmt_get\x00 \x00hello world\x00UTF8\x00UTF16LE\x00UTF16BE\x00UTF16\x00No such encoding: \x00 \x00binarize\x00test_value_overhead\x00test_translate\x00translate_selftest\x00out of memory in the crash simulator\n\x00atomic\x00atomic512\x00atomic1k\x00atomic2k\x00atomic4k\x00atomic8k\x00atomic16k\x00atomic32k\x00atomic64k\x00sequential\x00safe_append\x00powersafe_overwrite\x00batch-atomic\x00-sectorsize\x00-characteristics\x00Bad option: \"\x00\" - must be \"-characteristics\" or \"-sectorsize\"\x00Option requires an argument: \"\x00no such flag\x00ENABLE ?DEFAULT?\x00crash\x00?OPTIONS? DELAY CRASHFILE\x00Filename is too long: \"\x00NWRITE\x00?-default? PARENT-VFS\x00-default\x00\": must be -default\x00Error in jt_register\x00sqlite3_crash_enable\x00sqlite3_crashparams\x00sqlite3_crash_now\x00sqlite3_simulate_device\x00sqlite3_crash_on_write\x00unregister_devsim\x00register_jt_vfs\x00unregister_jt_vfs\x00client_create\x00client_wait\x00client_halt\x00client_argc\x00client_argv\x00client_colname\x00client_result\x00client_error\x00client_compile\x00client_step\x00client_reset\x00client_finalize\x00client_swap\x00echo_module_fail(%s,%s)\x00echo-vtab-error: %s\x00SELECT * FROM %Q\x00PRAGMA index_list(%s)\x00PRAGMA index_info(%s)\x00echo_module\x00SELECT sql FROM sqlite_schema WHERE type = 'table' AND name = ?\x00%s%s\x00xCreate\x00CREATE TABLE %Q(logmsg)\x00xConnect\x00xDisconnect\x00xDestroy\x00DROP TABLE %Q\x00xOpen\x00xNext\x00xColumn\x00xFilter\x00, *\x00%z, %s\x00%z, NULL\x00echo_module_ignore_usable\x00xBestIndex\x00echo_module_cost\x00SELECT count(*) FROM %Q\x00SELECT rowid%z FROM %Q\x00rowid\x00=\x00<\x00>\x00<=\x00>=\x00LIKE\x00like\x00glob\x00 %s %s LIKE (SELECT '%%'||?||'%%')\x00 %s %s %s ?\x00DESC\x00ASC\x00 ORDER BY %s %s\x00xUpdate\x00 SET\x00UPDATE %Q\x00 SET rowid=?1 \x00%s %Q=?%d\x00 WHERE rowid=?%d\x00DELETE FROM %Q WHERE rowid = ?1\x00INSERT INTO %Q (\x00%s%Q\x00%s?%d\x00) VALUES(\x00echo(%s)\x00xBegin\x00echo_module_begin_fail\x00xSync\x00echo_module_sync_fail\x00xCommit\x00xRollback\x00::echo_glob_overload\x00xRename\x00ALTER TABLE %s RENAME TO %s%s\x00echo\x00echo_v2\x00DB SQL\x00register_echo_module\x00sqlite3_declare_vtab\x00N/A\x00sqlite3_create_collation\x00Error testing function: \x00sqlite3_malloc\x00sqlite3_realloc\x00c_misuse_test\x00c_realloc_test\x00c_collation_test\x00sqlite3_reset_auto_extension\x00npage\x00finish\x00remaining\x00pagecount\x00CMDNAME DESTHANDLE DESTNAME SRCHANDLE SRCNAME\x00sqlite3_backup_init() failed\x00sqlite3_backup\x00wrong number of arguments\x00unexpected: %s\x00eq\x00gt\x00le\x00lt\x00ge\x00match\x00ne\x00isnot\x00isnotnull\x00isnull\x00op\x00column\x00usable\x00desc\x00cost\x00orderby\x00idxnum\x00idxstr\x00rows\x00use\x00omit\x00unexpected: %d\x00tcl\x00register_tcl_module\x00incrblob_\x00DB DATABASE TABLE COLUMN ROWID FLAGS VARNAME\x00HANDLE\x00CHANNEL OFFSET N\x00out of memory in testdata/sqlite-src-3330000/src/test_blob.c\x00HANDLE OFFSET DATA ?NDATA?\x00sqlite3_blob_open\x00sqlite3_blob_close\x00sqlite3_blob_bytes\x00sqlite3_blob_read\x00sqlite3_blob_write\x00sqlite_options\x00malloc_usable_size\x001\x00rowid32\x00casesensitivelike\x00curdir\x00win32malloc\x00debug\x00default_ckptfullfsync\x00direct_read\x00dirsync\x00lfs\x00pagecache_overflow_stats\x00mmap\x00worker_threads\x008\x00memdebug\x008_3_names\x00cursorhints\x00hiddencolumns\x00mem3\x00mem5\x00offset_sql_func\x00snapshot\x00mutex\x00mutex_noop\x00altertable\x00api_armor\x00atomicwrite\x00json1\x00has_codec\x00like_match_blobs\x00attach\x00auth\x00autoinc\x00autoreset\x00autovacuum\x00default_autovacuum\x00between_opt\x00builtin_test\x00bloblit\x00cast\x00check\x00cte\x00columnmetadata\x00oversize_cell_check\x00compileoption_diags\x00compound\x00conflict\x00crashtest\x00datetime\x00decltype\x00deprecated\x00diskio\x00floatingpoint\x00foreignkey\x00fts1\x00fts2\x00fts3\x00fts5\x00fts3_unicode\x00fts4_deferred\x00gettable\x00icu\x00icu_collations\x00integrityck\x00legacyformat\x00like_opt\x00load_ext\x00localtime\x00lookaside\x00long_double\x00memorydb\x00memorymanage\x00mergesort\x00null_trim\x00or_opt\x00rbu\x00pager_pragmas\x00pragma\x00reindex\x00rtree\x00rtree_int_only\x00schema_pragmas\x00schema_version\x00session\x00stmtvtab\x00scanstatus\x00lock_proxy_pragmas\x00prefer_proxy_locking\x00shared_cache\x00subquery\x00tclvar\x00threadsafe\x00threadsafe1\x00threadsafe2\x00tempdb\x00trigger\x00truncate_opt\x00vacuum\x00view\x00vtab\x00wal\x00wsd\x00update_delete_limit\x00fast_secure_delete\x00secure_delete\x00userauth\x00multiplex_ext_overwrite\x00yytrackmaxstackdepth\x00sqllog\x00uri_00_error\x00normalize\x00windowfunc\x00SQLITE_MAX_LENGTH\x00SQLITE_MAX_COLUMN\x00SQLITE_MAX_SQL_LENGTH\x00SQLITE_MAX_EXPR_DEPTH\x00SQLITE_MAX_COMPOUND_SELECT\x00SQLITE_MAX_VDBE_OP\x00SQLITE_MAX_FUNCTION_ARG\x00SQLITE_MAX_VARIABLE_NUMBER\x00SQLITE_MAX_PAGE_SIZE\x00SQLITE_MAX_PAGE_COUNT\x00SQLITE_MAX_LIKE_PATTERN_LENGTH\x00SQLITE_MAX_TRIGGER_DEPTH\x00SQLITE_DEFAULT_CACHE_SIZE\x00SQLITE_DEFAULT_PAGE_SIZE\x00SQLITE_DEFAULT_FILE_FORMAT\x00SQLITE_DEFAULT_SYNCHRONOUS\x00SQLITE_DEFAULT_WAL_SYNCHRONOUS\x00SQLITE_MAX_ATTACHED\x00SQLITE_MAX_DEFAULT_PAGE_SIZE\x00SQLITE_MAX_WORKER_THREADS\x00TEMP_STORE\x00__GNUC__\x00%s-journal\x00%s-wal\x00%s-shm\x00%s%03d\x00%s-journal%03d\x00%s-wal%03d\x00devsym\x00writecrash\x00CREATE TABLE xyz(dir, name);\x00CREATE TABLE xyz(path, size, data);\x00WITH r(d) AS ( SELECT CASE WHEN dir=?2 THEN ?3 ELSE dir END || '/' || name FROM fsdir WHERE dir=?1 AND name NOT LIKE '.%' UNION ALL SELECT dir || '/' || name FROM r, fsdir WHERE dir=d AND name NOT LIKE '.%') SELECT d FROM r;\x00/\x00CREATE TABLE x(path TEXT, data TEXT)\x00SELECT * FROM %Q.%Q WHERE rowid=?\x00fs\x00fstree\x00register_fs_module\x00abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-!,:*^+=_|?/<> \x00sqlite3_prepare_v2() error: %s\x000123456789abcdef\x00x'\x00test_agg_errmsg16\x00randstr\x00test_destructor\x00test_destructor16\x00hex_to_utf16be\x00hex_to_utf16le\x00hex_to_utf8\x00test_destructor_count\x00test_auxdata\x00test_error\x00test_eval\x00test_isolation\x00test_counter\x00real2hex\x00test_decode\x00test_extract\x00test_zeroblob\x00test_getsubtype\x00test_setsubtype\x00test_frombind\x00tx\x00funcxx_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789\x00nullx_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789\x00sqlite3_create_function abused test failed\x00invalid matchinfo blob passed to function rank()\x00wrong number of arguments to function rank()\x00rank\x00autoinstall_test_functions\x00abuse_create_function\x00install_fts3_rank_function\x000123456789ABCDEF\x00FILENAME OFFSET AMT\x00r\x00cannot open input file \x00FILENAME OFFSET HEXDATA\x00r+b\x00r+\x00cannot open output file \x00HEXDATA\x00[utf8_to_utf8] unavailable - SQLITE_DEBUG not defined\x00BLOB VARNAME\x00LIST\x00hexio_read\x00hexio_write\x00hexio_get_int\x00hexio_render_int16\x00hexio_render_int32\x00utf8_to_utf8\x00read_fts3varint\x00make_fts3record\x00mem\x00pcache\x00Unknown argument: \"\x00init_wrapper_install\x00init_wrapper_query\x00init_wrapper_uninstall\x00init_wrapper_clear\x00CREATE TABLE x(value INTEGER PRIMARY KEY)\x00CREATE VIRTUAL TABLE temp.%Q USING %Q\x00INTARRAY\x00SQLITE_NOMEM\x00sqlite3_intarray_create\x00sqlite3_intarray_bind\x00jt\x00-journal\x00NBYTES\x00PRIOR NBYTES\x00bad pointer: \x00PRIOR\x00ADDRESS SIZE HEX\x00size must be positive\x00no data\x00ADDRESS SIZE\x00?RESET?\x00DEPT\x00FILENAME\x00COUNTER ?OPTIONS?\x00-repeat\x00-benigncnt\x00TITLE\x00SUB-COMMAND ...\x00start\x00stop\x00dump\x00clear\x00sync\x00SIZE N\x00INSTALLFLAG DISCARDCHANCE PRNGSEEED HIGHSTRESS\x00discard-chance should be between 0 and 100\x00SIZE COUNT\x00BUFID SIZE COUNT\x00illegal arguments - see documentation\x00NBYTE NMINALLOC\x00[DB]\x00sqlite3_db_config(db, 99999) does not return SQLITE_ERROR\x00sqlite3_config(99999) does not return SQLITE_ERROR\x00PARAMETER RESETFLAG\x00SQLITE_STATUS_MEMORY_USED\x00SQLITE_STATUS_MALLOC_SIZE\x00SQLITE_STATUS_PAGECACHE_USED\x00SQLITE_STATUS_PAGECACHE_OVERFLOW\x00SQLITE_STATUS_PAGECACHE_SIZE\x00SQLITE_STATUS_SCRATCH_USED\x00SQLITE_STATUS_SCRATCH_OVERFLOW\x00SQLITE_STATUS_SCRATCH_SIZE\x00SQLITE_STATUS_PARSER_STACK\x00SQLITE_STATUS_MALLOC_COUNT\x00DB PARAMETER RESETFLAG\x00SQLITE_\x00DBSTATUS_\x00LOOKASIDE_USED\x00CACHE_USED\x00SCHEMA_USED\x00STMT_USED\x00LOOKASIDE_HIT\x00LOOKASIDE_MISS_SIZE\x00LOOKASIDE_MISS_FULL\x00CACHE_HIT\x00CACHE_MISS\x00CACHE_WRITE\x00DEFERRED_FKS\x00CACHE_USED_SHARED\x00CACHE_SPILL\x00?INTEGER?\x00sqlite3_free\x00memset\x00memget\x00sqlite3_memory_used\x00sqlite3_memory_highwater\x00sqlite3_memdebug_backtrace\x00sqlite3_memdebug_dump\x00sqlite3_memdebug_fail\x00sqlite3_memdebug_pending\x00sqlite3_memdebug_settitle\x00sqlite3_memdebug_malloc_count\x00sqlite3_memdebug_log\x00sqlite3_config_pagecache\x00sqlite3_config_alt_pcache\x00sqlite3_status\x00sqlite3_db_status\x00install_malloc_faultsim\x00sqlite3_config_heap\x00sqlite3_config_heap_size\x00sqlite3_config_memstatus\x00sqlite3_config_lookaside\x00sqlite3_config_error\x00sqlite3_config_uri\x00sqlite3_config_cis\x00sqlite3_config_pmasz\x00sqlite3_db_config_lookaside\x00sqlite3_dump_memsys3\x00sqlite3_dump_memsys5\x00sqlite3_install_memsys3\x00sqlite3_memdebug_vfs_oom_test\x00%05u\x00 FILENAME [OFFSET AMT]\"\x00unable to open file \"\x00\" for reading\x00md5\x00md5-10x8\x00md5file\x00md5file-10x8\x00md5sum\x00%03d\x00multiplexor.xAccess failure on %s\x00multiplexor.xOpen failure on %s\x00multiplex_control\x00chunksize\x00multiplex_truncate\x00multiplex/%z\x00multiplex\x00NAME MAKEDEFAULT\x00-force\x00?-force?\x00enable\x00chunk_size\x00max_chunks\x00HANDLE DBNAME SUB-COMMAND INT-VALUE\x00expected database handle, got \"\x00sqlite3_multiplex_initialize\x00sqlite3_multiplex_shutdown\x00sqlite3_multiplex_control\x00fast\x00recursive\x00static_main\x00static_mem\x00static_open\x00static_prng\x00static_lru\x00static_pmem\x00static_app1\x00static_app2\x00static_app3\x00static_vfs1\x00static_vfs2\x00static_vfs3\x00mutex counters are \x00already installed\x00not installed\x00singlethread\x00multithread\x00serialized\x00mutex name\x00disable_mutex_init\x00disable_mutex_try\x00sqlite3_shutdown\x00sqlite3_initialize\x00sqlite3_config\x00enter_static_mutex\x00leave_static_mutex\x00enter_db_mutex\x00leave_db_mutex\x00alloc_dealloc_mutex\x00install_mutex_counters\x00read_mutex_counters\x00clear_mutex_counters\x00\x00\x00\x00\x00\x00\x00\x00vfslog/%z\x00sqlite_ostrace1.....\x00xClose\x00xRead\x00xWrite\x00xTruncate\x00xFilesize\x00xLock\x00xUnlock\x00xCheckResLock\x00xFileControl\x00xSectorSize\x00xDeviceChar\x00xDelete\x00xAccess\x00xFullPathname\x00xRandomness\x00xSleep\x00xCurrentTime\x00xShmUnmap\x00xShmLock\x00xShmBarrier\x00xShmMap\x00annotation\x00CREATE TABLE xxx(event, file, click, rc, size, offset)\x00vfslog\x00VFS\x00failed\x00VFS PARENT LOGFILE\x00bad sqlite3 handle: \x00annotate\x00finalize\x00register\x00quota/%z\x00quota\x00::piLimit_\x00PATTERN LIMIT SCRIPT\x00FILENAME MODE\x00HANDLE SIZE NELEM\x00HANDLE SIZE NELEM CONTENT\x00HANDLE ?HARDSYNC?\x00HANDLE OFFSET WHENCE\x00SEEK_SET\x00SEEK_CUR\x00SEEK_END\x00WHENCE should be SEEK_SET, SEEK_CUR, or SEEK_END\x00HANDLE SIZE\x00PATTERN TEXT\x00sqlite3_quota_initialize\x00sqlite3_quota_shutdown\x00sqlite3_quota_set\x00sqlite3_quota_file\x00sqlite3_quota_dump\x00sqlite3_quota_fopen\x00sqlite3_quota_fread\x00sqlite3_quota_fwrite\x00sqlite3_quota_fclose\x00sqlite3_quota_fflush\x00sqlite3_quota_fseek\x00sqlite3_quota_rewind\x00sqlite3_quota_ftell\x00sqlite3_quota_ftruncate\x00sqlite3_quota_file_size\x00sqlite3_quota_file_truesize\x00sqlite3_quota_file_mtime\x00sqlite3_quota_remove\x00sqlite3_quota_glob\x00sqlite3_quota_file_available\x00sqlite3_quota_ferror\x00cube\x00circle\x00Qcircle\x00breadthfirstsearch\x00register_cube_geom\x00register_circle_geom\x00CREATE TABLE x(database,tablename,cid,name,type,not_null,dflt_value,pk)\x00SELECT name FROM sqlite_temp_schema WHERE type='table'\x00SELECT name FROM %Q.sqlite_schema WHERE type='table'\x00PRAGMA %Q.table_info(%Q)\x00PRAGMA database_list\x00register_schema_module\x00PRAGMA main.journal_mode\x00CMDNAME PATH ?VFS? ?BUSY-HANDLER-SCRIPT?\x00sqlite3demo_superlock\x00open\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00pread\x00pread64\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00mremap\x00SYSCALL-LIST\x00system-call\x00?COUNT PERSIST?\x00EACCES\x00EINTR\x00EIO\x00EOVERFLOW\x00ENOMEM\x00EAGAIN\x00ETIMEDOUT\x00EBUSY\x00EPERM\x00EDEADLK\x00ENOLCK\x00SYSCALL ERRNO\x00errno\x00PGSZ\x00getpagesize\x00pgsz out of range\x00fault\x00install\x00uninstall\x00list\x00defaultvfs\x00pagesize\x00VFS does not support xSetSystemCall\x00test_syscall\x00load_testfixture_extensions\x00SLAVE\x00CREATE TABLE x( name TEXT, arrayname TEXT, value TEXT, fullname TEXT PRIMARY KEY) WITHOUT ROWID\x00array names\x00tclvar_filter_cmd\x00%s(%s)\x00expr {[info exists ::tclvar_set_omit] && $::tclvar_set_omit}\x00the 'fullname' column must be TEXT\x00prohibited TCL variable change\x00proc like {pattern str} {\n set p [string map {% * _ ?} $pattern]\n string match $p $str\n}\nproc tclvar_filter_cmd {eq match glob regexp like} {\n set res {}\n set pattern $eq\n if {$pattern=={}} { set pattern $match }\n if {$pattern=={}} { set pattern * }\n foreach v [uplevel #0 info vars $pattern] {\n if {($glob=={} || [string match $glob [uplevel #0 set $v]])\n && ($like=={} || [like $like [uplevel #0 set $v]])\n && ($regexp=={} || [regexp $regexp [uplevel #0 set $v]])\n } {\n lappend res $v\n }\n }\n set res\n}\n\x00register_tclvar_module\x00clock_seconds\x00sqlthread\x00sqlite3_blocking_step\x00sqlite3_blocking_prepare_v2\x00sqlite3_nonblocking_prepare_v2\x00set\x00Error in Tcl_CreateThread()\x00no parent thread\x00parent\x00spawn\x00VARNAME SCRIPT\x00DBNAME\x00id\x00%s \x00SQLITE_IOERR\x00SQLITE_LOCKED\x00SQLITE_BUSY\x00SQLITE_READONLY\x00SQLITE_READONLY_CANTINIT\x00SQLITE_NOTFOUND\x00SQLITE_OMIT\x00normal|dataonly\x00full|dataonly\x00xCheckReservedLock\x00BEGIN_ATOMIC_WRITE\x00COMMIT_ATOMIC_WRITE\x00ZIPVFS\x00anon\x00SQLITE_ACCESS_EXISTS\x00SQLITE_ACCESS_READWRITE\x00SQLITE_ACCESS_READ\x00xShmOpen\x00 lock\x00 unlock\x00 shared\x00 exclusive\x00shm\x00delete\x00filter\x00ioerr\x00fullerr\x00cantopenerr\x00script\x00devchar\x00sectorsize\x00subcommand\x00FILE ?VALUE?\x00failed to get full path: \x00no such file: \x00unknown method: \x00?CNT PERSIST?\x00default\x00undeletable_when_open\x00immutable\x00?ATTR-LIST?\x00bad flags: \x00?VALUE?\x00-noshm\x00-szosfile\x00-mxpathname\x00-iversion\x00-fullshm\x00VFSNAME ?-noshm BOOL? ?-fullshm BOOL? ?-default BOOL? ?-mxpathname INT? ?-szosfile INT? ?-iversion INT?\x00shared\x00lock\x00unlock\x00DB DBNAME (shared|exclusive) (lock|unlock) OFFSET N\x00ARG\x00DB DBNAME SLOT ?VALUE?\x00*-shm is not yet mapped\x00testvfs\x00vfs_shmlock\x00vfs_set_readmark\x00DB NAME XSTEP XFINAL XVALUE XINVERSE\x00fff\x00misuse test error\x00invalid argument\x00sumint\x00sum\x00sqlite3_create_window_function\x00test_create_window_function_misuse\x00test_create_sumint\x00test_override_sum\x00" +var ts1 = "%s\x00internal error!\x00SELECT * FROM main.%Q WHERE sample()\x00expert\x00PRAGMA table_xinfo=%Q\x00main\x00, \x00%Q\x00 COLLATE %Q\x00 COLLATE %s\x00 DESC\x00PRAGMA index_list=%Q\x00PRAGMA index_xInfo=%Q\x00%s_idx_%08x\x00CREATE INDEX '%q' ON %Q(%s)\x00CREATE INDEX %s ON %s(%s)\x00EXPLAIN QUERY PLAN %s\x00 USING INDEX \x00 USING COVERING INDEX \x00%s\n\x00%s;\n\x00SELECT 'CREATE TEMP' || substr(sql, 7) FROM sqlite_schema WHERE tbl_name = %Q AND type IN ('table', 'trigger') ORDER BY type;\x00ALTER TABLE temp.%Q RENAME TO %Q\x00INSERT INTO %Q VALUES(\x00%s?\x00\x00)\x00UPDATE %Q SET \x00%s%Q=?\x00DELETE FROM %Q\x00t592690916721053953805701627921227776\x00DROP TABLE t592690916721053953805701627921227776\x00SELECT type, name, sql, 1 FROM sqlite_schema WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%%' UNION ALL SELECT type, name, sql, 2 FROM sqlite_schema WHERE type = 'trigger' AND tbl_name IN(SELECT name FROM sqlite_schema WHERE type = 'view') ORDER BY 4, 1\x00CREATE TABLE x(\x00%s%Q COLLATE %s\x00CREATE VIRTUAL TABLE %Q USING expert(%Q)\x00SELECT max(i.seqno) FROM sqlite_schema AS s, pragma_index_list(s.name) AS l, pragma_index_info(l.name) AS i WHERE s.type = 'table'\x00%sx.%Q IS rem(%d, x.%Q) COLLATE %s\x00%s%d\x00SELECT %s FROM %Q x ORDER BY %s\x00SELECT %s FROM temp.t592690916721053953805701627921227776 x ORDER BY %s\x00%d\x00 %d\x00DROP TABLE IF EXISTS temp.t592690916721053953805701627921227776\x00CREATE TABLE temp.t592690916721053953805701627921227776 AS SELECT * FROM %Q\x00SELECT s.rowid, s.name, l.name FROM sqlite_schema AS s, pragma_index_list(s.name) AS l WHERE s.type = 'table'\x00SELECT name, coll FROM pragma_index_xinfo(?) WHERE key\x00INSERT INTO sqlite_stat1 VALUES(?, ?, ?)\x00ANALYZE; PRAGMA writable_schema=1\x00rem\x00sample\x00ANALYZE sqlite_schema\x00:memory:\x00SELECT sql FROM sqlite_schema WHERE name NOT LIKE 'sqlite_%%' AND sql NOT LIKE 'CREATE VIRTUAL %%'\x00%s;%s%s\n\x00 -- stat1: \x00no such handle: \x00sql\x00TABLE\x00analyze\x00count\x00report\x00STMT EREPORT\x00destroy\x00SUBCOMMAND ...\x00sub-command\x00indexes\x00plan\x00candidates\x00DB\x00sqlite3expert%d\x00out of memory\x00sqlite3_expert_new\x00SQLITE_DONE\x00SQLITE_ERROR\x00SQLITE_OK\x00SELECT fts5(?1)\x00error: \x00fts5_api_ptr\x00f5t_2_%lld\x00xColumnCount\x00xRowCount\x00xColumnTotalSize\x00COL\x00xTokenize\x00TEXT SCRIPT\x00xPhraseCount\x00xPhraseSize\x00PHRASE\x00xInstCount\x00xInst\x00IDX\x00xRowid\x00xColumnText\x00xColumnSize\x00xQueryPhrase\x00PHRASE SCRIPT\x00xSetAuxdata\x00VALUE\x00xGetAuxdata\x00CLEAR\x00xSetAuxdataInt\x00INTEGER\x00xGetAuxdataInt\x00xPhraseForeach\x00IPHRASE COLVAR OFFVAR SCRIPT\x00xPhraseColumnForeach\x00IPHRASE COLVAR SCRIPT\x00SUB-COMMAND\x00f5t_%lld\x00bytearray\x00boolean\x00double\x00wideInt\x00int\x00DB NAME SCRIPT\x00?-subst? DB NAME TEXT\x00-subst\x00unrecognized option: \x00no such tokenizer: \x00error in tokenizer.xCreate()\x00error in tokenizer.xTokenize()\x00document\x00aux\x00query\x00prefixquery\x00invalid\x00-colocated\x00sqlite3_fts5_token may only be used by tokenizer callback\x00?-colocated? TEXT START END\x00error in fts5_api.xCreateTokenizer()\x00?BOOLEAN?\x00NSLOT TOKEN\x00sqlite3_fts5_create_tokenizer\x00sqlite3_fts5_token\x00sqlite3_fts5_tokenize\x00sqlite3_fts5_create_function\x00sqlite3_fts5_may_be_corrupt\x00sqlite3_fts5_token_hash\x00sqlite3_fts5_register_matchinfo\x00sqlite3_fts5_register_fts5tokenize\x00unrecognized matchinfo flag: %c\x00pcx\x00matchinfo\x00CREATE TABLE x(input HIDDEN, token, start, end, position)\x00fts5tokenize\x00apndvfs\x00Start-Of-SQLite3-\x00apnd(%lld)/%z\x00SQLite format 3\x00%s: cost must be between 1 and %d\x00%s: maximum string length is %d\x00%s: iLang must be between 0 and %d\x00?\x00SELECT * FROM %Q.%Q\x00%s: %s\x00%s: %s has %d columns, expected 4\x00vocabulary_table\x00vocabulary_word\x00vocabulary_language\x00edit_distances\x00unrecognized argument: [%s]\n\x00no edit_distances table specified\x00CREATE TABLE x(word,distance,language,command HIDDEN,nword HIDDEN)\x000123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^abcdefghijklmnopqrstuvwxyz~\x00SELECT \"%w\" FROM \"%w\"\x00 WHERE \"%w\">=?1 AND \"%w\"=?2 ORDER BY 1\x00SELECT \"%w\" FROM \"%w\" WHERE \"%w\">=?1 ORDER BY 1\x00*\x00DELETE from %s is not allowed\x00UPDATE of %s is not allowed\x00INSERT INTO %s allowed for column [command] only\x00approximate_match\x00int32\x00int64\x00char*\x00CREATE TABLE x(value,pointer hidden,count hidden,ctype hidden)\x00carray-bind\x00carray\x00unknown datatype: %Q\x00inttoptr\x00cksmvfs\x00ZV-\x00checksum fault offset %lld of \"%s\"\x00checksum_verification\x00enable%\x00yes\x00on\x00page_size\x00cksm/%z\x00verify_checksum\x00tablename\x00idcolumn\x00parentcolumn\x00CREATE TABLE x(id,depth,root HIDDEN,tablename HIDDEN,idcolumn HIDDEN,parentcolumn HIDDEN)\x00SELECT \"%w\".\"%w\" FROM \"%w\" WHERE \"%w\".\"%w\"=?1\x00transitive_closure\x00rb\x00cannot open '%s' for reading\x00line %d: unescaped %c character\x00line %d: unterminated %c-quoted field\n\x00more than one '%s' parameter\x00true\x00no\x00off\x00false\x00header\x00more than one 'header' parameter\x00testflags\x00columns\x00more than one 'columns' parameter\x00column= value must be positive\x00bad parameter: '%s'\x00must specify either filename= or data= but not both\x00%sc%d TEXT\x00,\x00%s\"%w\" TEXT\x00bad schema: '%s' - %s\x00filename\x00data\x00schema\x00csv\x00csv_wr\x00decimal_sum\x00decimal\x00decimal_cmp\x00decimal_add\x00decimal_sub\x00decimal_mul\x00 \x00eval\x00CREATE TABLE x(addr,opcode,p1,p2,p3,p4,p5,comment,sql HIDDEN)\x00EXPLAIN %s\x00explain\x00wb\x00wrong number of arguments to function writefile()\x00failed to create symlink: %s\x00failed to create directory: %s\x00failed to write file: %s\x00CREATE TABLE x(name,mode,mtime,data,path HIDDEN,dir HIDDEN)\x00cannot read directory: %s\x00%s/%s\x00cannot stat file: %s\x00table function fsdir requires an argument\x00table function fsdir requires a non-NULL argument\x00fsdir\x00readfile\x00writefile\x00lsmode\x00%s: ruleset must be between 0 and %d\x00%s: wrong number of CREATE VIRTUAL TABLE arguments\x00CREATE TABLE x(word,distance,ruleset)\x00fuzzer\x00ieee754(%lld,%d)\x00ieee754\x00ieee754_mantissa\x00ieee754_exponent\x00ieee754_to_blob\x00ieee754_from_blob\x00BEGIN; SELECT * FROM %s%q%ssqlite_schema\x00'\x00'.\x00PRAGMA %s%q%spage_size\x00sqlite3_mmap_warm_cache: Warmed up %d pages of %s\x00END\x00AND (%s)\x00collate \"%w\"\x00SELECT %s FROM %s WHERE %s>=(?1 || ?2) %s AND %s<=(?1 || char(1114111)) %s %s ORDER BY 1 %s ASC LIMIT 1\x00next_char\x00NULL\x00is\x00not\x00in(\x00in(select\x00in(with\x00?,?,?\x002nd argument to percentile() is not a number between 0.0 and 100.0\x002nd argument to percentile() is not the same for all input rows\x001st argument to percentile() is not numeric\x00Inf input to percentile()\x00percentile\x00CREATE TABLE prefixes(prefix TEXT, original_string TEXT HIDDEN)\x00prefixes\x00prefix_length\x00unknown \\ escape\x00afnrtv\\()*.+?[$^{|}]\x00\a\f\n\r\t\v\x00unmatched '('\x00'*' without operand\x00'+' without operand\x00'?' without operand\x00'{m,n}' without operand\x00unmatched '{'\x00n less than m in '{m,n}'\x00both m and n are zero in '{m,n}'\x00POSIX character classes not supported\x00unclosed '['\x00unrecognized character\x00regexp\x00remember\x00CREATE TABLE x(value,start hidden,stop hidden,step hidden)\x00generate_series() requires SQLite 3.8.12 or later\x00generate_series\x00.ABCDHLRMY9 ?\x00non-ASCII input to editdist()\x00NULL input to editdist()\x00SELECT iLang, cFrom, cTo, iCost FROM \"%w\" WHERE iLang>=0 ORDER BY iLang\x00editdist3\x00DROP TABLE IF EXISTS \"%w\".\"%w_vocab\"\x00CREATE TABLE x(word,rank,distance,langid, score, matchlen, phonehash HIDDEN, top HIDDEN, scope HIDDEN, srchcnt HIDDEN, soundslike HIDDEN, command HIDDEN)\x00CREATE TABLE IF NOT EXISTS \"%w\".\"%w_vocab\"(\n id INTEGER PRIMARY KEY,\n rank INT,\n langid INT,\n word TEXT,\n k1 TEXT,\n k2 TEXT\n);\n\x00CREATE INDEX IF NOT EXISTS \"%w\".\"%w_vocab_index_langid_k2\" ON \"%w_vocab\"(langid,k2);\x00edit_cost_table=\x00bad argument to spellfix1(): \"%s\"\x00SELECT id, word, rank, coalesce(k1,word) FROM \"%w\".\"%w_vocab\" WHERE langid=%d AND k2>=?1 AND k2=%lld\x00AND\x00%z %s rowid<=%lld\x00CREATE TABLE x(value)\x00wholenumber\x00CREATE TABLE y(name PRIMARY KEY,mode,mtime,sz,rawdata,data,method,z HIDDEN) WITHOUT ROWID;\x00zipfile\x00zipfile constructor requires one argument\x00error in fread()\x00error in fwrite()\x00failed to read CDS at offset %lld\x00%.*s\x00failed to read LFH at offset %d\x001.2.11\x00inflateInit2() failed (%d)\x00inflate() failed (%d)\x00zipfile: deflate() error\x00cannot find end of central directory record\x00zipfile() function requires an argument\x00cannot open file: %s\x00-rwxrwxrwx\x00zipfile: mode does not match data\x00zipfile: parse error in mode: %s\x00zipfile: missing filename\x00ab+\x00zipfile: failed to open file %s for writing\x00sz must be NULL\x00rawdata must be NULL\x00unknown compression method: %d\x00%s/\x00duplicate name: \"%s\"\x00{\"version-made-by\" : %u, \"version-to-extract\" : %u, \"flags\" : %u, \"compression\" : %u, \"time\" : %u, \"date\" : %u, \"crc32\" : %u, \"compressed-size\" : %u, \"uncompressed-size\" : %u, \"file-name-length\" : %u, \"extra-field-length\" : %u, \"file-comment-length\" : %u, \"disk-number-start\" : %u, \"internal-attr\" : %u, \"external-attr\" : %u, \"offset\" : %u }\x00zipfile_cds\x00wrong number of arguments to function zipfile()\x00first argument to zipfile() must be non-NULL\x00illegal method value: %d\x00non-directory name must not end with /\x00rbu_delta\x00step\x00close\x00create_rbu_delta\x00savestate\x00dbMain_eval\x00SQL\x00bp_progress\x00db\x00RBU\x00state\x00progress\x00close_no_error\x00temp_size_limit\x00LIMIT\x00temp_size\x00dbRbu_eval\x00METHOD\x00method\x00 - \x00oal\x00move\x00checkpoint\x00done\x00error\x00NAME TARGET-DB RBU-DB ?STATE-DB?\x00NAME TARGET-DB ?STATE-DB?\x00?-default? NAME PARENT\x00NAME\x00sqlite3rbu_db(0, 0)!=0\x00sqlite3rbu\x00sqlite3rbu_vacuum\x00sqlite3rbu_create_vfs\x00sqlite3rbu_destroy_vfs\x00sqlite3rbu_internal_test\x00incrblob\x00incrblob_%d\x00%lld\x00sqlite_unlock_notify_arg\x00sqlite_unlock_notify_argcount\x00DELETE\x00INSERT\x00UPDATE\x00SQLITE_COPY\x00SQLITE_CREATE_INDEX\x00SQLITE_CREATE_TABLE\x00SQLITE_CREATE_TEMP_INDEX\x00SQLITE_CREATE_TEMP_TABLE\x00SQLITE_CREATE_TEMP_TRIGGER\x00SQLITE_CREATE_TEMP_VIEW\x00SQLITE_CREATE_TRIGGER\x00SQLITE_CREATE_VIEW\x00SQLITE_DELETE\x00SQLITE_DROP_INDEX\x00SQLITE_DROP_TABLE\x00SQLITE_DROP_TEMP_INDEX\x00SQLITE_DROP_TEMP_TABLE\x00SQLITE_DROP_TEMP_TRIGGER\x00SQLITE_DROP_TEMP_VIEW\x00SQLITE_DROP_TRIGGER\x00SQLITE_DROP_VIEW\x00SQLITE_INSERT\x00SQLITE_PRAGMA\x00SQLITE_READ\x00SQLITE_SELECT\x00SQLITE_TRANSACTION\x00SQLITE_UPDATE\x00SQLITE_ATTACH\x00SQLITE_DETACH\x00SQLITE_ALTER_TABLE\x00SQLITE_REINDEX\x00SQLITE_ANALYZE\x00SQLITE_CREATE_VTABLE\x00SQLITE_DROP_VTABLE\x00SQLITE_FUNCTION\x00SQLITE_SAVEPOINT\x00SQLITE_RECURSIVE\x00????\x00SQLITE_DENY\x00SQLITE_IGNORE\x00RELEASE _tcl_transaction\x00COMMIT\x00ROLLBACK TO _tcl_transaction ; RELEASE _tcl_transaction\x00option\x00?CALLBACK?\x00?DATABASE? FILENAME\x00cannot open target database: \x00backup failed: \x00CALLBACK\x00cache option ?arg?\x00flush\x00size\x00size n\x00cannot convert \"\x00\" to integer\x00bad option \"\x00\": must be flush or size\x00NAME SCRIPT\x00SCRIPT\x00?OPTION? ?BOOLEAN?\x00unknown config option: \"\x00\"\x00CONFLICT-ALGORITHM TABLE FILENAME ?SEPARATOR? ?NULLINDICATOR?\x00\t\x00Error: non-null separator required for copy\x00rollback\x00abort\x00fail\x00ignore\x00replace\x00Error: \"\x00\", conflict-algorithm must be one of: rollback, abort, fail, ignore, or replace\x00SELECT * FROM '%q'\x00Error: no such table: \x00Error: \x00Error: can't malloc()\x00INSERT OR %q INTO '%q' VALUES(?\x00Error: cannot open file: \x00BEGIN\x00Error: %s line %d: expected %d columns of data but found %d\x00, failed while processing line: \x00?DATABASE? VALUE\x00-maxsize\x00-readonly\x00unknown option: \x00unable to set MEMDB content\x00extension loading is turned off at compile-time\x00-withoutnulls\x00unknown option: \"\x00?OPTIONS? SQL ?ARRAY-NAME? ?SCRIPT?\x00NAME ?SWITCHES? SCRIPT\x00-argcount\x00option requires an argument: \x00number of arguments must be non-negative\x00-deterministic\x00-directonly\x00-innocuous\x00-returntype\x00real\x00text\x00blob\x00any\x00type\x00\": must be -argcount, -deterministic, -directonly, -innocuous, or -returntype\x00?-readonly? ?DB? TABLE COLUMN ROWID\x00NULLVALUE\x00N CALLBACK\x00KEY\x00cannot open source database: \x00restore failed: \x00restore failed: source database busy\x00?DATABASE?\x00(step|sort|autoindex)\x00sort\x00autoindex\x00vmstep\x00bad argument: should be autoindex, step, sort or vmstep\x00MILLISECONDS\x00?CALLBACK? ?MASK?\x00trace type\x00SAVEPOINT _tcl_transaction\x00[TYPE] SCRIPT\x00transaction type\x00BEGIN EXCLUSIVE\x00BEGIN IMMEDIATE\x00?SCRIPT?\x00SUB-COMMAND ?ARGS?\x00hook ?SCRIPT?\x00INDEX\x00-use-legacy-prepare\x00-last-stmt-ptr\x00%p\x00unknown argument: \x00authorizer\x00backup\x00bind_fallback\x00busy\x00cache\x00changes\x00collate\x00collation_needed\x00commit_hook\x00complete\x00config\x00copy\x00deserialize\x00enable_load_extension\x00errorcode\x00exists\x00function\x00interrupt\x00last_insert_rowid\x00nullvalue\x00onecolumn\x00preupdate\x00profile\x00rekey\x00restore\x00rollback_hook\x00serialize\x00status\x00timeout\x00total_changes\x00trace\x00trace_v2\x00transaction\x00unlock_notify\x00update_hook\x00version\x00wal_hook\x00defensive\x00dqs_ddl\x00dqs_dml\x00enable_fkey\x00enable_qpsg\x00enable_trigger\x00enable_view\x00fts3_tokenizer\x00legacy_alter_table\x00legacy_file_format\x00load_extension\x00no_ckpt_on_close\x00reset_database\x00trigger_eqp\x00trusted_schema\x00writable_schema\x00statement\x00row\x00deferred\x00exclusive\x00immediate\x00depth\x00hook\x00new\x00old\x00HANDLE ?FILENAME? ?-vfs VFSNAME? ?-readonly BOOLEAN? ?-create BOOLEAN? ?-nofollow BOOLEAN? ?-nomutex BOOLEAN? ?-fullmutex BOOLEAN? ?-uri BOOLEAN?\x00-version\x00-sourceid\x00-has-codec\x000\x00-key\x00-vfs\x00-create\x00-nofollow\x00-nomutex\x00-fullmutex\x00-uri\x00-translatefilename\x00sqlite3\x00sqlite\x003.35.0\x00if {[llength $argv]>=1} {\nset argv0 [lindex $argv 0]\nset argv [lrange $argv 1 end]\nsource $argv0\n} else {\nset line {}\nwhile {![eof stdin]} {\nif {$line!=\"\"} {\nputs -nonewline \"> \"\n} else {\nputs -nonewline \"% \"\n}\nflush stdout\nappend line [gets stdin]\nif {[info complete $line]} {\nif {[catch {uplevel #0 $line} result]} {\nputs stderr \"Error: $result\"\n} elseif {$result!=\"\"} {\nputs $result\n}\nset line {}\n} else {\nappend line \\n\n}\n}\n}\n\x00SQLITE_DEBUG_BREAK\x00attach debugger to process %d and press any key to continue.\n\x00utf-8\x00argc\x00argv0\x00argv\x00errorInfo\x00%s: %s\n\x00SQLITE-CONNECTION\x00command not found: \x00error code %s (%d) does not match sqlite3_errcode %s (%d)\x00OMIT_MISUSE\x00wrong # args: should be \"\x00 DB FORMAT STRING\x00 DB HEX\x00 DB\x00 DB SQL\x00%z%s%s\x00%s%n\x00abcdefghijklmnopqrstuvwxyz\x00 DB FORMAT STRING ?COUNT?\x00 DB\"\x00 FILENAME\"\x00%02x\x00%04x\x00tkt2213 is not fixed\x00text16\x00bytes\x00bytes16\x00noop\x00x_coalesce\x00hex8\x00hex16\x00tkt2213func\x00pointer_change\x00counter1\x00counter2\x00intreal\x00x_sqlite_exec\x00value of 40 handed to x_count\x00x_count totals to 42\x00x_count\x00legacy_count\x00 TEXT\"\x00 FORMAT INT INT INT\"\x00argument is not a valid 64-bit integer\x00 FORMAT INT INT ?STRING?\"\x00 INT FORMAT INT INT ?STRING?\"\x00N must be non-negative\x00 FORMAT INT INT DOUBLE\"\x00 FORMAT DOUBLE DOUBLE\"\x00 FORMAT STRING\"\x00%08x%08x\x002nd argument should be 16-characters of hex\x00DB BOOLEAN\x00DB dbname tblname colname\x00CHANNEL ROWID\x00DB-HANDLE NAME CMP-PROC DEL-PROC\x00sqlite3_create_collate_v2() failed to detect an invalid encoding\x00utf8\x00utf16\x00utf16le\x00utf16be\x00DB NAME NARG ENC SWITCHES...\x00encoding\x00-func\x00-step\x00-final\x00-destroy\x00switch\x00DB-HANDLE FILE ?PROC?\x00this build omits sqlite3_load_extension()\x00DB-HANDLE ONOFF\x00string\x00value\x00first argument should be one of: int int64 string double null value\x00 DB FUNCTION-NAME\x00 \x00STMT PARAMETER RESETFLAG\x00SQLITE_STMTSTATUS_FULLSCAN_STEP\x00SQLITE_STMTSTATUS_SORT\x00SQLITE_STMTSTATUS_AUTOINDEX\x00SQLITE_STMTSTATUS_VM_STEP\x00SQLITE_STMTSTATUS_REPREPARE\x00SQLITE_STMTSTATUS_RUN\x00SQLITE_STMTSTATUS_MEMUSED\x00NBYTE\x00DB DBNAME\x00DB DBNAME SNAPSHOT\x00SNAPSHOT\x00SNAPSHOT1 SNAPSHOT2\x00bad SNAPSHOT\x00FILE\x00PATH\x00 DB STMT\x00 STMT\x00 FROM-STMT TO-STMT\x00 VM IDX VALUE (null|static|normal)\"\x00static\x00static-nbytes\x00normal\x00blob10\x00abc\x00xyz\x00pq\x004th argument should be \"null\" or \"static\" or \"normal\"\x00(%d) \x00test_collate\x00UTF-8\x00UTF-16LE\x00UTF-16BE\x00 \x00utf16bin\x00utf16_unaligned\x00utf16_aligned\x00test_function\x00\x00STMT IDX N\x00 STMT N VALUE\x00NaN\x00SNaN\x00-NaN\x00-SNaN\x00+Inf\x00-Inf\x00Epsilon\x00-Epsilon\x00NaN0\x00-NaN0\x00 STMT N\x00 STMT N VALUE BYTES\x00 STMT N DATA BYTES\x00cannot use %d blob bytes, have %d\x00-transient\x00-static\x00-int32\x00-int64\x00-double\x00-text\x00--\x00text data must be either -static or -transient\x00cannot be both -static and -transient\x00[OPTIONS] STMT IDX VALUE ...\x00STMT\x00STMT N\x00STMT NAME\x00 DB sql bytes ?tailvar?\x00 DB sql bytes tailvar\x00 DB sql bytes flags tailvar\x00\x00SELECT 1\x00 filename options-list\x00FILENAME FLAGS VFS\x00SQLITE_OPEN_READONLY\x00SQLITE_OPEN_READWRITE\x00SQLITE_OPEN_CREATE\x00SQLITE_OPEN_DELETEONCLOSE\x00SQLITE_OPEN_EXCLUSIVE\x00SQLITE_OPEN_AUTOPROXY\x00SQLITE_OPEN_MAIN_DB\x00SQLITE_OPEN_TEMP_DB\x00SQLITE_OPEN_TRANSIENT_DB\x00SQLITE_OPEN_MAIN_JOURNAL\x00SQLITE_OPEN_TEMP_JOURNAL\x00SQLITE_OPEN_SUBJOURNAL\x00SQLITE_OPEN_SUPER_JOURNAL\x00SQLITE_OPEN_NOMUTEX\x00SQLITE_OPEN_FULLMUTEX\x00SQLITE_OPEN_SHAREDCACHE\x00SQLITE_OPEN_PRIVATECACHE\x00SQLITE_OPEN_WAL\x00SQLITE_OPEN_URI\x00flag\x00\x00 STMT column\x00FLOAT\x00TEXT\x00BLOB\x00 DB MAGIC\x00SQLITE_MAGIC_OPEN\x00SQLITE_MAGIC_CLOSED\x00SQLITE_MAGIC_BUSY\x00SQLITE_MAGIC_ERROR\x00 DB function-name\x00VARIABLE\x00?N?\x001234567890000000\x00__one\x00__two\x00notadatabase\x00Unexpected non-zero errno: \x00DB [DBNAME]\x00%u\x00DB DBNAME SIZE\x00 DB PWD\x00 DB FLAG\x00%d %d\x00 DB ?AUXDB?\x00DB N\x00 DB ID VALUE\x00unknown limit type: \x00SQLITE_LIMIT_LENGTH\x00SQLITE_LIMIT_SQL_LENGTH\x00SQLITE_LIMIT_COLUMN\x00SQLITE_LIMIT_EXPR_DEPTH\x00SQLITE_LIMIT_COMPOUND_SELECT\x00SQLITE_LIMIT_VDBE_OP\x00SQLITE_LIMIT_FUNCTION_ARG\x00SQLITE_LIMIT_ATTACHED\x00SQLITE_LIMIT_LIKE_PATTERN_LENGTH\x00SQLITE_LIMIT_VARIABLE_NUMBER\x00SQLITE_LIMIT_TRIGGER_DEPTH\x00SQLITE_LIMIT_WORKER_THREADS\x00SQLITE_LIMIT_TOOSMALL\x00SQLITE_LIMIT_TOOBIG\x00SEED ?DB?\x00BOOLEAN\x00current\x00max\x00min\x00recyclable\x00DB ?NAME?\x00passive\x00full\x00restart\x00truncate\x00DB MODE ?NAME?\x00mode\x00DB VALUE\x00COMMAND ...\x00command has no objProc: \x00%d %d %d %s\n\x00SQLITE_TESTCTRL_LOCALTIME_FAULT\x00SQLITE_TESTCTRL_SORTER_MMAP\x00SQLITE_TESTCTRL_IMPOSTER\x00SQLITE_TESTCTRL_INTERNAL_FUNCTIONS\x00VERB ARGS...\x00VERB\x00ONOFF\x00DB LIMIT\x00DB dbName onOff tnum\x00ru_utime=%d.%06d ru_stime=%d.%06d ru_minflt=%d ru_majflt=%d\x00DB OPT BOOLEAN\x00unknown optimization - should be one of:\x00all\x00none\x00query-flattener\x00groupby-order\x00factor-constants\x00distinct-opt\x00cover-idx-scan\x00order-by-idx-join\x00transitive\x00omit-noop-join\x00stat4\x00skip-scan\x00push-down\x00DB NAME ...\x00no such extension: \x00initialization of \x00 failed: \x00amatch\x00appendvfs\x00closure\x00fileio\x00nextchar\x00series\x00spellfix\x00totype\x00BOOL\x00DB SQL1 NSTEP SQL2\x00data error: (a!=b)\x00checksum mismatch\x00sql error: \x00TYPE\x00Deliberate panic\x00DB SETTING [VALUE]\x00SQLITE_*\x00DBCONFIG_*\x00ENABLE_*\x00unknown sqlite3_db_config setting\x00FKEY\x00TRIGGER\x00FTS3_TOKENIZER\x00LOAD_EXTENSION\x00NO_CKPT_ON_CLOSE\x00QPSG\x00TRIGGER_EQP\x00RESET_DB\x00DEFENSIVE\x00WRITABLE_SCHEMA\x00LEGACY_ALTER_TABLE\x00DQS_DML\x00DQS_DDL\x00LEGACY_FILE_FORMAT\x00DB ?SCHEMA?\x00icecube\x00DB ?DBNAME?\x00DB OFFSET DATA\x00HEXDB\x00| size %d pagesize %d\x00bad 'pagesize' field\x00bad 'size' field\x00| page %d offset %d\x00| %d: %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x\x00sqlite_search_count\x00sqlite_found_count\x00sqlite_sort_count\x00sqlite3_max_blobsize\x00sqlite_like_count\x00sqlite_interrupt_count\x00sqlite_open_file_count\x00sqlite_current_time\x00sqlite3_xferopt_count\x00sqlite3_pager_readdb_count\x00sqlite3_pager_writedb_count\x00sqlite3_pager_writej_count\x00unaligned_string_counter\x00sqlite_last_needed_collation\x00sqlite_query_plan\x00sqlite_opentemp_count\x00sqlite_static_bind_value\x00sqlite_static_bind_nbyte\x00sqlite_temp_directory\x00sqlite_data_directory\x00bitmask_size\x00longdouble_size\x00sqlite_sync_count\x00sqlite_fullsync_count\x00db_enter\x00db_leave\x00sqlite3_mprintf_int\x00sqlite3_mprintf_int64\x00sqlite3_mprintf_long\x00sqlite3_mprintf_str\x00sqlite3_snprintf_str\x00sqlite3_mprintf_stronly\x00sqlite3_mprintf_double\x00sqlite3_mprintf_scaled\x00sqlite3_mprintf_hexdouble\x00sqlite3_mprintf_z_test\x00sqlite3_mprintf_n_test\x00sqlite3_snprintf_int\x00sqlite3_last_insert_rowid\x00sqlite3_exec_printf\x00sqlite3_exec_hex\x00sqlite3_exec\x00sqlite3_exec_nr\x00sqlite3_get_table_printf\x00sqlite3_close\x00sqlite3_close_v2\x00sqlite3_create_function\x00sqlite3_create_aggregate\x00sqlite3_drop_modules\x00sqlite_register_test_function\x00sqlite_abort\x00sqlite_bind\x00breakpoint\x00sqlite3_key\x00sqlite3_rekey\x00sqlite_set_magic\x00sqlite3_interrupt\x00sqlite_delete_function\x00sqlite_delete_collation\x00sqlite3_get_autocommit\x00sqlite3_busy_timeout\x00printf\x00sqlite3IoTrace\x00clang_sanitize_address\x00sqlite3_db_config\x00sqlite3_txn_state\x00bad_behavior\x00register_dbstat_vtab\x00sqlite3_connection_pointer\x00intarray_addr\x00int64array_addr\x00doublearray_addr\x00textarray_addr\x00sqlite3_bind_int\x00sqlite3_bind_zeroblob\x00sqlite3_bind_zeroblob64\x00sqlite3_bind_int64\x00sqlite3_bind_double\x00sqlite3_bind_null\x00sqlite3_bind_text\x00sqlite3_bind_text16\x00sqlite3_bind_blob\x00sqlite3_carray_bind\x00sqlite3_bind_parameter_count\x00sqlite3_bind_parameter_name\x00sqlite3_bind_parameter_index\x00sqlite3_clear_bindings\x00sqlite3_sleep\x00sqlite3_errcode\x00sqlite3_extended_errcode\x00sqlite3_errmsg\x00sqlite3_errmsg16\x00sqlite3_open\x00sqlite3_open16\x00sqlite3_open_v2\x00sqlite3_complete16\x00sqlite3_normalize\x00sqlite3_prepare\x00sqlite3_prepare16\x00sqlite3_prepare_v2\x00sqlite3_prepare_v3\x00sqlite3_prepare_tkt3134\x00sqlite3_prepare16_v2\x00sqlite3_finalize\x00sqlite3_stmt_status\x00sqlite3_reset\x00sqlite3_expired\x00sqlite3_transfer_bindings\x00sqlite3_changes\x00sqlite3_step\x00sqlite3_sql\x00sqlite3_expanded_sql\x00sqlite3_next_stmt\x00sqlite3_stmt_readonly\x00sqlite3_stmt_isexplain\x00sqlite3_stmt_busy\x00uses_stmt_journal\x00sqlite3_release_memory\x00sqlite3_db_release_memory\x00sqlite3_db_cacheflush\x00sqlite3_system_errno\x00sqlite3_db_filename\x00sqlite3_db_readonly\x00sqlite3_soft_heap_limit\x00sqlite3_soft_heap_limit64\x00sqlite3_hard_heap_limit64\x00sqlite3_thread_cleanup\x00sqlite3_pager_refcounts\x00sqlite3_load_extension\x00sqlite3_enable_load_extension\x00sqlite3_extended_result_codes\x00sqlite3_limit\x00dbconfig_maindbname_icecube\x00save_prng_state\x00restore_prng_state\x00reset_prng_state\x00prng_seed\x00extra_schema_checks\x00database_never_corrupt\x00database_may_be_corrupt\x00optimization_control\x00tcl_objproc\x00sqlite3_column_count\x00sqlite3_data_count\x00sqlite3_column_type\x00sqlite3_column_blob\x00sqlite3_column_double\x00sqlite3_column_int64\x00sqlite3_column_text\x00sqlite3_column_name\x00sqlite3_column_int\x00sqlite3_column_bytes\x00sqlite3_column_decltype\x00sqlite3_column_database_name\x00sqlite3_column_table_name\x00sqlite3_column_origin_name\x00sqlite3_column_bytes16\x00sqlite3_column_text16\x00sqlite3_column_name16\x00add_alignment_test_collations\x00sqlite3_column_decltype16\x00sqlite3_column_database_name16\x00sqlite3_column_table_name16\x00sqlite3_column_origin_name16\x00sqlite3_create_collation_v2\x00sqlite3_global_recover\x00working_64bit_int\x00vfs_unlink_test\x00vfs_initfail_test\x00vfs_unregister_all\x00vfs_reregister_all\x00file_control_test\x00file_control_lasterrno_test\x00file_control_lockproxy_test\x00file_control_chunksize_test\x00file_control_sizehint_test\x00file_control_data_version\x00file_control_persist_wal\x00file_control_powersafe_overwrite\x00file_control_vfsname\x00file_control_reservebytes\x00file_control_tempfilename\x00sqlite3_vfs_list\x00sqlite3_create_function_v2\x00add_test_collate\x00add_test_collate_needed\x00add_test_function\x00add_test_utf16bin_collate\x00sqlite3_test_errstr\x00tcl_variable_type\x00sqlite3_enable_shared_cache\x00sqlite3_shared_cache_report\x00sqlite3_libversion_number\x00sqlite3_table_column_metadata\x00sqlite3_blob_reopen\x00pcache_stats\x00sqlite3_unlock_notify\x00sqlite3_wal_checkpoint\x00sqlite3_wal_checkpoint_v2\x00sqlite3_wal_autocheckpoint\x00test_sqlite3_log\x00print_explain_query_plan\x00sqlite3_test_control\x00getrusage\x00load_static_extension\x00sorter_test_fakeheap\x00sorter_test_sort4_helper\x00vfs_current_time_int64\x00sqlite3_snapshot_get\x00sqlite3_snapshot_open\x00sqlite3_snapshot_free\x00sqlite3_snapshot_cmp\x00sqlite3_snapshot_recover\x00sqlite3_snapshot_get_blob\x00sqlite3_snapshot_open_blob\x00sqlite3_snapshot_cmp_blob\x00sqlite3_delete_database\x00atomic_batch_write\x00sqlite3_mmap_warm\x00sqlite3_config_sorterref\x00decode_hexdb\x00test_write_db\x00sqlite3_register_cksumvfs\x00sqlite3_unregister_cksumvfs\x00*** OBSOLETE VARIABLE ***\x00 FILENAME N-PAGE\"\x00 ID\"\x00ref\x00page\x00err\x00hit\x00miss\x00ovfl\x00 ID PGNO\"\x00 PAGE\"\x00 PAGE DATA\"\x00 N-MEGABYTES FILE\"\x00open failed: \x00Hello, World!\x00write failed: \x00 PENDING-BYTE\"\x00fault simulator script failed: [%s]\x00 SCRIPT\"\x00 SIZE PROGRAM\"\x00sqlite_io_error_pending\x00sqlite_io_error_persist\x00sqlite_io_error_hit\x00sqlite_io_error_hardhit\x00sqlite_diskfull_pending\x00sqlite_diskfull\x00sqlite_pending_byte\x00pager_open\x00pager_close\x00pager_commit\x00pager_rollback\x00pager_stmt_begin\x00pager_stmt_commit\x00pager_stmt_rollback\x00pager_stats\x00pager_pagecount\x00page_get\x00page_lookup\x00page_unref\x00page_read\x00page_write\x00page_number\x00pager_truncate\x00fake_big_file\x00sqlite3BitvecBuiltinTest\x00sqlite3_test_control_pending_byte\x00sqlite3_test_control_fault_install\x00 FILENAME NCACHE FLAGS\"\x00read\x00write\x00 ID TABLENUM WRITEABLE\"\x00 START MULTIPLIER COUNT INCREMENT\"\x00putVarint returned %d - should be between 1 and 9\x00putVarint returned %d and getVarint returned %d\x00Wrote 0x%016llx and got back 0x%016llx\x00putVarint returned %d and GetVarint32 returned %d\x00Wrote 0x%016llx and got back 0x%016llx from GetVarint32\x00 DB-HANDLE ?N?\"\x00No such db-handle: \"\x00 BT NCACHE\"\x00?-intkey? CSR KEY VALUE\x00btree_insert\x00btree_open\x00btree_close\x00btree_begin_transaction\x00btree_pager_stats\x00btree_cursor\x00btree_close_cursor\x00btree_next\x00btree_eof\x00btree_payload_size\x00btree_first\x00btree_varint_test\x00btree_from_db\x00btree_ismemdb\x00btree_set_cache_size\x00thread ID must be an upper case letter\x00 ID FILENAME\x00thread \x00 is already running\x00failed to create the thread\x00 ID\x00no such thread\x00 ID N\x00column number out of range\x00no database is open\x00 ID SQL\x00no virtual machine available\x00 IDL\x00 ID1 ID2\x00 ID DB\x00thread_create\x00thread_wait\x00thread_halt\x00thread_argc\x00thread_argv\x00thread_colname\x00thread_result\x00thread_error\x00thread_compile\x00thread_step\x00thread_finalize\x00thread_swap\x00thread_db_get\x00thread_db_put\x00thread_stmt_get\x00 \x00hello world\x00UTF8\x00UTF16LE\x00UTF16BE\x00UTF16\x00No such encoding: \x00 \x00binarize\x00test_value_overhead\x00test_translate\x00translate_selftest\x00out of memory in the crash simulator\n\x00atomic\x00atomic512\x00atomic1k\x00atomic2k\x00atomic4k\x00atomic8k\x00atomic16k\x00atomic32k\x00atomic64k\x00sequential\x00safe_append\x00powersafe_overwrite\x00batch-atomic\x00-sectorsize\x00-characteristics\x00Bad option: \"\x00\" - must be \"-characteristics\" or \"-sectorsize\"\x00Option requires an argument: \"\x00no such flag\x00ENABLE ?DEFAULT?\x00crash\x00?OPTIONS? DELAY CRASHFILE\x00Filename is too long: \"\x00NWRITE\x00?-default? PARENT-VFS\x00-default\x00\": must be -default\x00Error in jt_register\x00sqlite3_crash_enable\x00sqlite3_crashparams\x00sqlite3_crash_now\x00sqlite3_simulate_device\x00sqlite3_crash_on_write\x00unregister_devsim\x00register_jt_vfs\x00unregister_jt_vfs\x00client_create\x00client_wait\x00client_halt\x00client_argc\x00client_argv\x00client_colname\x00client_result\x00client_error\x00client_compile\x00client_step\x00client_reset\x00client_finalize\x00client_swap\x00echo_module_fail(%s,%s)\x00echo-vtab-error: %s\x00SELECT * FROM %Q\x00PRAGMA index_list(%s)\x00PRAGMA index_info(%s)\x00echo_module\x00SELECT sql FROM sqlite_schema WHERE type = 'table' AND name = ?\x00%s%s\x00xCreate\x00CREATE TABLE %Q(logmsg)\x00xConnect\x00xDisconnect\x00xDestroy\x00DROP TABLE %Q\x00xOpen\x00xNext\x00xColumn\x00xFilter\x00, *\x00%z, %s\x00%z, NULL\x00echo_module_ignore_usable\x00xBestIndex\x00echo_module_cost\x00SELECT count(*) FROM %Q\x00SELECT rowid%z FROM %Q\x00rowid\x00=\x00<\x00>\x00<=\x00>=\x00LIKE\x00like\x00glob\x00 %s %s LIKE (SELECT '%%'||?||'%%')\x00 %s %s %s ?\x00DESC\x00ASC\x00 ORDER BY %s %s\x00xUpdate\x00 SET\x00UPDATE %Q\x00 SET rowid=?1 \x00%s %Q=?%d\x00 WHERE rowid=?%d\x00DELETE FROM %Q WHERE rowid = ?1\x00INSERT INTO %Q (\x00%s%Q\x00%s?%d\x00) VALUES(\x00echo(%s)\x00xBegin\x00echo_module_begin_fail\x00xSync\x00echo_module_sync_fail\x00xCommit\x00xRollback\x00::echo_glob_overload\x00xRename\x00ALTER TABLE %s RENAME TO %s%s\x00echo\x00echo_v2\x00DB SQL\x00register_echo_module\x00sqlite3_declare_vtab\x00N/A\x00sqlite3_create_collation\x00Error testing function: \x00sqlite3_malloc\x00sqlite3_realloc\x00c_misuse_test\x00c_realloc_test\x00c_collation_test\x00sqlite3_reset_auto_extension\x00npage\x00finish\x00remaining\x00pagecount\x00CMDNAME DESTHANDLE DESTNAME SRCHANDLE SRCNAME\x00sqlite3_backup_init() failed\x00sqlite3_backup\x00wrong number of arguments\x00unexpected: %s\x00eq\x00gt\x00le\x00lt\x00ge\x00match\x00ne\x00isnot\x00isnotnull\x00isnull\x00op\x00column\x00usable\x00desc\x00cost\x00orderby\x00idxnum\x00idxstr\x00rows\x00use\x00omit\x00unexpected: %d\x00tcl\x00register_tcl_module\x00incrblob_\x00DB DATABASE TABLE COLUMN ROWID FLAGS VARNAME\x00HANDLE\x00CHANNEL OFFSET N\x00out of memory in testdata/sqlite-src-3350000/src/test_blob.c\x00HANDLE OFFSET DATA ?NDATA?\x00sqlite3_blob_open\x00sqlite3_blob_close\x00sqlite3_blob_bytes\x00sqlite3_blob_read\x00sqlite3_blob_write\x00sqlite_options\x00malloc_usable_size\x001\x00rowid32\x00casesensitivelike\x00curdir\x00win32malloc\x00debug\x00default_ckptfullfsync\x00direct_read\x00dirsync\x00lfs\x00pagecache_overflow_stats\x00mmap\x00worker_threads\x008\x00memdebug\x008_3_names\x00cursorhints\x00hiddencolumns\x00mathlib\x00mem3\x00mem5\x00offset_sql_func\x00snapshot\x00mutex\x00mutex_noop\x00altertable\x00api_armor\x00atomicwrite\x00json1\x00has_codec\x00like_match_blobs\x00attach\x00auth\x00autoinc\x00autoreset\x00autovacuum\x00default_autovacuum\x00between_opt\x00builtin_test\x00bloblit\x00cast\x00check\x00cte\x00columnmetadata\x00oversize_cell_check\x00compileoption_diags\x00compound\x00conflict\x00crashtest\x00datetime\x00decltype\x00deprecated\x00diskio\x00floatingpoint\x00foreignkey\x00fts1\x00fts2\x00fts3\x00fts5\x00fts3_unicode\x00fts4_deferred\x00gettable\x00icu\x00icu_collations\x00integrityck\x00legacyformat\x00like_opt\x00load_ext\x00localtime\x00lookaside\x00long_double\x00memorydb\x00memorymanage\x00mergesort\x00null_trim\x00or_opt\x00rbu\x00pager_pragmas\x00pragma\x00reindex\x00rtree\x00rtree_int_only\x00schema_pragmas\x00schema_version\x00session\x00stmtvtab\x00scanstatus\x00lock_proxy_pragmas\x00prefer_proxy_locking\x00shared_cache\x00subquery\x00tclvar\x00threadsafe\x00threadsafe1\x00threadsafe2\x00tempdb\x00trigger\x00truncate_opt\x00vacuum\x00view\x00vtab\x00wal\x00wsd\x00update_delete_limit\x00fast_secure_delete\x00secure_delete\x00userauth\x00multiplex_ext_overwrite\x00yytrackmaxstackdepth\x00sqllog\x00uri_00_error\x00normalize\x00windowfunc\x00SQLITE_MAX_LENGTH\x00SQLITE_MAX_COLUMN\x00SQLITE_MAX_SQL_LENGTH\x00SQLITE_MAX_EXPR_DEPTH\x00SQLITE_MAX_COMPOUND_SELECT\x00SQLITE_MAX_VDBE_OP\x00SQLITE_MAX_FUNCTION_ARG\x00SQLITE_MAX_VARIABLE_NUMBER\x00SQLITE_MAX_PAGE_SIZE\x00SQLITE_MAX_PAGE_COUNT\x00SQLITE_MAX_LIKE_PATTERN_LENGTH\x00SQLITE_MAX_TRIGGER_DEPTH\x00SQLITE_DEFAULT_CACHE_SIZE\x00SQLITE_DEFAULT_PAGE_SIZE\x00SQLITE_DEFAULT_FILE_FORMAT\x00SQLITE_DEFAULT_SYNCHRONOUS\x00SQLITE_DEFAULT_WAL_SYNCHRONOUS\x00SQLITE_MAX_ATTACHED\x00SQLITE_MAX_DEFAULT_PAGE_SIZE\x00SQLITE_MAX_WORKER_THREADS\x00TEMP_STORE\x00__GNUC__\x00%s-journal\x00%s-wal\x00%s-shm\x00%s%03d\x00%s-journal%03d\x00%s-wal%03d\x00devsym\x00writecrash\x00CREATE TABLE xyz(dir, name);\x00CREATE TABLE xyz(path, size, data);\x00WITH r(d) AS ( SELECT CASE WHEN dir=?2 THEN ?3 ELSE dir END || '/' || name FROM fsdir WHERE dir=?1 AND name NOT LIKE '.%' UNION ALL SELECT dir || '/' || name FROM r, fsdir WHERE dir=d AND name NOT LIKE '.%') SELECT d FROM r;\x00/\x00CREATE TABLE x(path TEXT, data TEXT)\x00SELECT * FROM %Q.%Q WHERE rowid=?\x00fs\x00fstree\x00register_fs_module\x00abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-!,:*^+=_|?/<> \x00sqlite3_prepare_v2() error: %s\x000123456789abcdef\x00x'\x00test_agg_errmsg16\x00randstr\x00test_destructor\x00test_destructor16\x00hex_to_utf16be\x00hex_to_utf16le\x00hex_to_utf8\x00test_destructor_count\x00test_auxdata\x00test_error\x00test_eval\x00test_isolation\x00test_counter\x00real2hex\x00test_decode\x00test_extract\x00test_zeroblob\x00test_getsubtype\x00test_setsubtype\x00test_frombind\x00tx\x00funcxx_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789\x00nullx_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789\x00sqlite3_create_function abused test failed\x00invalid matchinfo blob passed to function rank()\x00wrong number of arguments to function rank()\x00rank\x00autoinstall_test_functions\x00abuse_create_function\x00install_fts3_rank_function\x000123456789ABCDEF\x00FILENAME OFFSET AMT\x00r\x00cannot open input file \x00FILENAME OFFSET HEXDATA\x00r+b\x00r+\x00cannot open output file \x00HEXDATA\x00[utf8_to_utf8] unavailable - SQLITE_DEBUG not defined\x00BLOB VARNAME\x00LIST\x00hexio_read\x00hexio_write\x00hexio_get_int\x00hexio_render_int16\x00hexio_render_int32\x00utf8_to_utf8\x00read_fts3varint\x00make_fts3record\x00mem\x00pcache\x00Unknown argument: \"\x00init_wrapper_install\x00init_wrapper_query\x00init_wrapper_uninstall\x00init_wrapper_clear\x00CREATE TABLE x(value INTEGER PRIMARY KEY)\x00CREATE VIRTUAL TABLE temp.%Q USING %Q\x00INTARRAY\x00SQLITE_NOMEM\x00sqlite3_intarray_create\x00sqlite3_intarray_bind\x00jt\x00-journal\x00NBYTES\x00PRIOR NBYTES\x00bad pointer: \x00PRIOR\x00ADDRESS SIZE HEX\x00size must be positive\x00no data\x00ADDRESS SIZE\x00?RESET?\x00DEPT\x00FILENAME\x00COUNTER ?OPTIONS?\x00-repeat\x00-benigncnt\x00TITLE\x00SUB-COMMAND ...\x00start\x00stop\x00dump\x00clear\x00sync\x00SIZE N\x00INSTALLFLAG DISCARDCHANCE PRNGSEEED HIGHSTRESS\x00discard-chance should be between 0 and 100\x00SIZE COUNT\x00BUFID SIZE COUNT\x00illegal arguments - see documentation\x00NBYTE NMINALLOC\x00[DB]\x00sqlite3_db_config(db, 99999) does not return SQLITE_ERROR\x00sqlite3_config(99999) does not return SQLITE_ERROR\x00PARAMETER RESETFLAG\x00SQLITE_STATUS_MEMORY_USED\x00SQLITE_STATUS_MALLOC_SIZE\x00SQLITE_STATUS_PAGECACHE_USED\x00SQLITE_STATUS_PAGECACHE_OVERFLOW\x00SQLITE_STATUS_PAGECACHE_SIZE\x00SQLITE_STATUS_SCRATCH_USED\x00SQLITE_STATUS_SCRATCH_OVERFLOW\x00SQLITE_STATUS_SCRATCH_SIZE\x00SQLITE_STATUS_PARSER_STACK\x00SQLITE_STATUS_MALLOC_COUNT\x00DB PARAMETER RESETFLAG\x00SQLITE_\x00DBSTATUS_\x00LOOKASIDE_USED\x00CACHE_USED\x00SCHEMA_USED\x00STMT_USED\x00LOOKASIDE_HIT\x00LOOKASIDE_MISS_SIZE\x00LOOKASIDE_MISS_FULL\x00CACHE_HIT\x00CACHE_MISS\x00CACHE_WRITE\x00DEFERRED_FKS\x00CACHE_USED_SHARED\x00CACHE_SPILL\x00?INTEGER?\x00sqlite3_free\x00memset\x00memget\x00sqlite3_memory_used\x00sqlite3_memory_highwater\x00sqlite3_memdebug_backtrace\x00sqlite3_memdebug_dump\x00sqlite3_memdebug_fail\x00sqlite3_memdebug_pending\x00sqlite3_memdebug_settitle\x00sqlite3_memdebug_malloc_count\x00sqlite3_memdebug_log\x00sqlite3_config_pagecache\x00sqlite3_config_alt_pcache\x00sqlite3_status\x00sqlite3_db_status\x00install_malloc_faultsim\x00sqlite3_config_heap\x00sqlite3_config_heap_size\x00sqlite3_config_memstatus\x00sqlite3_config_lookaside\x00sqlite3_config_error\x00sqlite3_config_uri\x00sqlite3_config_cis\x00sqlite3_config_pmasz\x00sqlite3_db_config_lookaside\x00sqlite3_dump_memsys3\x00sqlite3_dump_memsys5\x00sqlite3_install_memsys3\x00sqlite3_memdebug_vfs_oom_test\x00%05u\x00 FILENAME [OFFSET AMT]\"\x00unable to open file \"\x00\" for reading\x00md5\x00md5-10x8\x00md5file\x00md5file-10x8\x00md5sum\x00%03d\x00multiplexor.xAccess failure on %s\x00multiplexor.xOpen failure on %s\x00multiplex_control\x00chunksize\x00multiplex_truncate\x00multiplex/%z\x00multiplex\x00NAME MAKEDEFAULT\x00-force\x00?-force?\x00enable\x00chunk_size\x00max_chunks\x00HANDLE DBNAME SUB-COMMAND INT-VALUE\x00expected database handle, got \"\x00sqlite3_multiplex_initialize\x00sqlite3_multiplex_shutdown\x00sqlite3_multiplex_control\x00fast\x00recursive\x00static_main\x00static_mem\x00static_open\x00static_prng\x00static_lru\x00static_pmem\x00static_app1\x00static_app2\x00static_app3\x00static_vfs1\x00static_vfs2\x00static_vfs3\x00mutex counters are \x00already installed\x00not installed\x00singlethread\x00multithread\x00serialized\x00mutex name\x00disable_mutex_init\x00disable_mutex_try\x00sqlite3_shutdown\x00sqlite3_initialize\x00sqlite3_config\x00enter_static_mutex\x00leave_static_mutex\x00enter_db_mutex\x00leave_db_mutex\x00alloc_dealloc_mutex\x00install_mutex_counters\x00read_mutex_counters\x00clear_mutex_counters\x00\x00\x00\x00\x00\x00\x00\x00vfslog/%z\x00sqlite_ostrace1.....\x00xClose\x00xRead\x00xWrite\x00xTruncate\x00xFilesize\x00xLock\x00xUnlock\x00xCheckResLock\x00xFileControl\x00xSectorSize\x00xDeviceChar\x00xDelete\x00xAccess\x00xFullPathname\x00xRandomness\x00xSleep\x00xCurrentTime\x00xShmUnmap\x00xShmLock\x00xShmBarrier\x00xShmMap\x00annotation\x00CREATE TABLE xxx(event, file, click, rc, size, offset)\x00vfslog\x00VFS\x00failed\x00VFS PARENT LOGFILE\x00bad sqlite3 handle: \x00annotate\x00finalize\x00register\x00quota/%z\x00quota\x00::piLimit_\x00PATTERN LIMIT SCRIPT\x00FILENAME MODE\x00HANDLE SIZE NELEM\x00HANDLE SIZE NELEM CONTENT\x00HANDLE ?HARDSYNC?\x00HANDLE OFFSET WHENCE\x00SEEK_SET\x00SEEK_CUR\x00SEEK_END\x00WHENCE should be SEEK_SET, SEEK_CUR, or SEEK_END\x00HANDLE SIZE\x00PATTERN TEXT\x00sqlite3_quota_initialize\x00sqlite3_quota_shutdown\x00sqlite3_quota_set\x00sqlite3_quota_file\x00sqlite3_quota_dump\x00sqlite3_quota_fopen\x00sqlite3_quota_fread\x00sqlite3_quota_fwrite\x00sqlite3_quota_fclose\x00sqlite3_quota_fflush\x00sqlite3_quota_fseek\x00sqlite3_quota_rewind\x00sqlite3_quota_ftell\x00sqlite3_quota_ftruncate\x00sqlite3_quota_file_size\x00sqlite3_quota_file_truesize\x00sqlite3_quota_file_mtime\x00sqlite3_quota_remove\x00sqlite3_quota_glob\x00sqlite3_quota_file_available\x00sqlite3_quota_ferror\x00cube\x00circle\x00Qcircle\x00breadthfirstsearch\x00register_cube_geom\x00register_circle_geom\x00CREATE TABLE x(database,tablename,cid,name,type,not_null,dflt_value,pk)\x00SELECT name FROM sqlite_temp_schema WHERE type='table'\x00SELECT name FROM %Q.sqlite_schema WHERE type='table'\x00PRAGMA %Q.table_info(%Q)\x00PRAGMA database_list\x00register_schema_module\x00PRAGMA main.journal_mode\x00CMDNAME PATH ?VFS? ?BUSY-HANDLER-SCRIPT?\x00sqlite3demo_superlock\x00open\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00pread\x00pread64\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00mremap\x00SYSCALL-LIST\x00system-call\x00?COUNT PERSIST?\x00EACCES\x00EINTR\x00EIO\x00EOVERFLOW\x00ENOMEM\x00EAGAIN\x00ETIMEDOUT\x00EBUSY\x00EPERM\x00EDEADLK\x00ENOLCK\x00SYSCALL ERRNO\x00errno\x00PGSZ\x00getpagesize\x00pgsz out of range\x00fault\x00install\x00uninstall\x00list\x00defaultvfs\x00pagesize\x00VFS does not support xSetSystemCall\x00test_syscall\x00load_testfixture_extensions\x00SLAVE\x00CREATE TABLE x( name TEXT, arrayname TEXT, value TEXT, fullname TEXT PRIMARY KEY) WITHOUT ROWID\x00array names\x00tclvar_filter_cmd\x00%s(%s)\x00expr {[info exists ::tclvar_set_omit] && $::tclvar_set_omit}\x00the 'fullname' column must be TEXT\x00prohibited TCL variable change\x00proc like {pattern str} {\n set p [string map {% * _ ?} $pattern]\n string match $p $str\n}\nproc tclvar_filter_cmd {eq match glob regexp like} {\n set res {}\n set pattern $eq\n if {$pattern=={}} { set pattern $match }\n if {$pattern=={}} { set pattern * }\n foreach v [uplevel #0 info vars $pattern] {\n if {($glob=={} || [string match $glob [uplevel #0 set $v]])\n && ($like=={} || [like $like [uplevel #0 set $v]])\n && ($regexp=={} || [regexp $regexp [uplevel #0 set $v]])\n } {\n lappend res $v\n }\n }\n set res\n}\n\x00register_tclvar_module\x00clock_seconds\x00sqlthread\x00sqlite3_blocking_step\x00sqlite3_blocking_prepare_v2\x00sqlite3_nonblocking_prepare_v2\x00set\x00Error in Tcl_CreateThread()\x00no parent thread\x00parent\x00spawn\x00VARNAME SCRIPT\x00DBNAME\x00id\x00%s \x00SQLITE_IOERR\x00SQLITE_LOCKED\x00SQLITE_BUSY\x00SQLITE_READONLY\x00SQLITE_READONLY_CANTINIT\x00SQLITE_NOTFOUND\x00SQLITE_OMIT\x00normal|dataonly\x00full|dataonly\x00xCheckReservedLock\x00BEGIN_ATOMIC_WRITE\x00COMMIT_ATOMIC_WRITE\x00ZIPVFS\x00anon\x00SQLITE_ACCESS_EXISTS\x00SQLITE_ACCESS_READWRITE\x00SQLITE_ACCESS_READ\x00xShmOpen\x00 lock\x00 unlock\x00 shared\x00 exclusive\x00shm\x00delete\x00filter\x00ioerr\x00fullerr\x00cantopenerr\x00script\x00devchar\x00sectorsize\x00subcommand\x00FILE ?VALUE?\x00failed to get full path: \x00no such file: \x00unknown method: \x00?CNT PERSIST?\x00default\x00undeletable_when_open\x00immutable\x00?ATTR-LIST?\x00bad flags: \x00?VALUE?\x00-noshm\x00-szosfile\x00-mxpathname\x00-iversion\x00-fullshm\x00VFSNAME ?-noshm BOOL? ?-fullshm BOOL? ?-default BOOL? ?-mxpathname INT? ?-szosfile INT? ?-iversion INT?\x00shared\x00lock\x00unlock\x00DB DBNAME (shared|exclusive) (lock|unlock) OFFSET N\x00ARG\x00DB DBNAME SLOT ?VALUE?\x00*-shm is not yet mapped\x00testvfs\x00vfs_shmlock\x00vfs_set_readmark\x00DB NAME XSTEP XFINAL XVALUE XINVERSE\x00fff\x00misuse test error\x00invalid argument\x00sumint\x00sum\x00sqlite3_create_window_function\x00test_create_window_function_misuse\x00test_create_sumint\x00test_override_sum\x00" var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data diff --git a/lib/capi_linux_amd64.go b/lib/capi_linux_amd64.go index 352807a..3d2452b 100644 --- a/lib/capi_linux_amd64.go +++ b/lib/capi_linux_amd64.go @@ -1,4 +1,4 @@ -// Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines -export-enums -export-externs X -export-fields F -export-typedefs -pkgname sqlite3 -o lib/sqlite_linux_amd64.go -trace-translation-units testdata/sqlite-amalgamation-3330000/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_UNIX=1', DO NOT EDIT. +// Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines -export-enums -export-externs X -export-fields F -export-typedefs -pkgname sqlite3 -o lib/sqlite_linux_amd64.go -trace-translation-units testdata/sqlite-amalgamation-3350000/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_UNIX=1', DO NOT EDIT. package sqlite3 @@ -13,10 +13,12 @@ var CAPI = map[string]struct{}{ "sqlite3AddInt64": {}, "sqlite3AddNotNull": {}, "sqlite3AddPrimaryKey": {}, + "sqlite3AddReturning": {}, "sqlite3AffinityType": {}, "sqlite3AggInfoPersistWalkerInit": {}, "sqlite3AllocateIndexObject": {}, "sqlite3AlterBeginAddColumn": {}, + "sqlite3AlterDropColumn": {}, "sqlite3AlterFinishAddColumn": {}, "sqlite3AlterFunctions": {}, "sqlite3AlterRenameColumn": {}, @@ -100,8 +102,6 @@ var CAPI = map[string]struct{}{ "sqlite3BtreeIntegerKey": {}, "sqlite3BtreeIntegrityCheck": {}, "sqlite3BtreeIsInBackup": {}, - "sqlite3BtreeIsInReadTrans": {}, - "sqlite3BtreeIsInTrans": {}, "sqlite3BtreeIsReadonly": {}, "sqlite3BtreeLast": {}, "sqlite3BtreeLastPage": {}, @@ -137,7 +137,9 @@ var CAPI = map[string]struct{}{ "sqlite3BtreeSetSpillSize": {}, "sqlite3BtreeSetVersion": {}, "sqlite3BtreeSharable": {}, + "sqlite3BtreeTransferRow": {}, "sqlite3BtreeTripAllCursors": {}, + "sqlite3BtreeTxnState": {}, "sqlite3BtreeUpdateMeta": {}, "sqlite3BuiltinFunctions": {}, "sqlite3CantopenError": {}, @@ -157,6 +159,7 @@ var CAPI = map[string]struct{}{ "sqlite3CodeVerifySchema": {}, "sqlite3CollapseDatabaseArray": {}, "sqlite3ColumnDefault": {}, + "sqlite3ColumnIndex": {}, "sqlite3ColumnType": {}, "sqlite3ColumnsFromExprList": {}, "sqlite3CommitInternalChanges": {}, @@ -174,6 +177,8 @@ var CAPI = map[string]struct{}{ "sqlite3CreateFunc": {}, "sqlite3CreateIndex": {}, "sqlite3CreateView": {}, + "sqlite3CteDelete": {}, + "sqlite3CteNew": {}, "sqlite3CtypeMap": {}, "sqlite3DbFree": {}, "sqlite3DbFreeNN": {}, @@ -210,6 +215,7 @@ var CAPI = map[string]struct{}{ "sqlite3EndTransaction": {}, "sqlite3ErrStr": {}, "sqlite3Error": {}, + "sqlite3ErrorClear": {}, "sqlite3ErrorMsg": {}, "sqlite3ErrorToParser": {}, "sqlite3ErrorWithMsg": {}, @@ -297,7 +303,6 @@ var CAPI = map[string]struct{}{ "sqlite3FinishCoding": {}, "sqlite3FinishTrigger": {}, "sqlite3FixExpr": {}, - "sqlite3FixExprList": {}, "sqlite3FixInit": {}, "sqlite3FixSelect": {}, "sqlite3FixSrcList": {}, @@ -526,6 +531,7 @@ var CAPI = map[string]struct{}{ "sqlite3PagerWrite": {}, "sqlite3ParseUri": {}, "sqlite3Parser": {}, + "sqlite3ParserAddCleanup": {}, "sqlite3ParserFallback": {}, "sqlite3ParserFinalize": {}, "sqlite3ParserInit": {}, @@ -620,7 +626,9 @@ var CAPI = map[string]struct{}{ "sqlite3SelectDup": {}, "sqlite3SelectExprHeight": {}, "sqlite3SelectNew": {}, + "sqlite3SelectOpName": {}, "sqlite3SelectPrep": {}, + "sqlite3SelectTrace": {}, "sqlite3SelectWalkFail": {}, "sqlite3SelectWalkNoop": {}, "sqlite3SelectWrongNumTermsError": {}, @@ -689,6 +697,8 @@ var CAPI = map[string]struct{}{ "sqlite3UpsertDoUpdate": {}, "sqlite3UpsertDup": {}, "sqlite3UpsertNew": {}, + "sqlite3UpsertNextIsIPK": {}, + "sqlite3UpsertOfIndex": {}, "sqlite3Utf16ByteLen": {}, "sqlite3Utf16to8": {}, "sqlite3Utf8CharLen": {}, @@ -916,11 +926,13 @@ var CAPI = map[string]struct{}{ "sqlite3WhereIsDistinct": {}, "sqlite3WhereIsOrdered": {}, "sqlite3WhereIsSorted": {}, + "sqlite3WhereMinMaxOptEarlyOut": {}, "sqlite3WhereOkOnePass": {}, "sqlite3WhereOrderByLimitOptLabel": {}, "sqlite3WhereOutputRowCount": {}, "sqlite3WhereSplit": {}, "sqlite3WhereTabFuncArgs": {}, + "sqlite3WhereTrace": {}, "sqlite3WhereUsesDeferredSeek": {}, "sqlite3WindowAlloc": {}, "sqlite3WindowAssemble": {}, @@ -1177,8 +1189,8 @@ var CAPI = map[string]struct{}{ "sqlite3_trace": {}, "sqlite3_trace_v2": {}, "sqlite3_transfer_bindings": {}, + "sqlite3_txn_state": {}, "sqlite3_unlock_notify": {}, - "sqlite3_unsupported_selecttrace": {}, "sqlite3_update_hook": {}, "sqlite3_uri_boolean": {}, "sqlite3_uri_int64": {}, diff --git a/lib/sqlite_darwin_amd64.go b/lib/sqlite_darwin_amd64.go index 7950464..efb4be1 100644 --- a/lib/sqlite_darwin_amd64.go +++ b/lib/sqlite_darwin_amd64.go @@ -119281,7 +119281,6 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt goto __4 goto __6 __6: - } } @@ -174506,7 +174505,6 @@ __15: goto __14 goto __16 __16: - } // This is a helper function for rbuObjIterCacheTableInfo(). It populates diff --git a/lib/sqlite_linux_amd64.go b/lib/sqlite_linux_amd64.go index bb46dac..4921f24 100644 --- a/lib/sqlite_linux_amd64.go +++ b/lib/sqlite_linux_amd64.go @@ -1,4 +1,4 @@ -// Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines "" -export-enums "" -export-externs X -export-fields F -export-typedefs "" -pkgname sqlite3 -o lib/sqlite_linux_amd64.go -trace-translation-units testdata/sqlite-amalgamation-3330000/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_UNIX=1', DO NOT EDIT. +// Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines "" -export-enums "" -export-externs X -export-fields F -export-typedefs "" -pkgname sqlite3 -o lib/sqlite_linux_amd64.go -trace-translation-units testdata/sqlite-amalgamation-3350000/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_UNIX=1', DO NOT EDIT. package sqlite3 @@ -41,10 +41,6 @@ const ( AT_FDCWD = -100 AT_NO_AUTOMOUNT = 0x800 AT_REMOVEDIR = 0x200 - AT_STATX_DONT_SYNC = 0x4000 - AT_STATX_FORCE_SYNC = 0x2000 - AT_STATX_SYNC_AS_STAT = 0x0000 - AT_STATX_SYNC_TYPE = 0x6000 AT_SYMLINK_FOLLOW = 0x400 AT_SYMLINK_NOFOLLOW = 0x100 BIG_ENDIAN = 4321 @@ -80,6 +76,7 @@ const ( BTREE_LARGEST_ROOT_PAGE = 4 BTREE_MEMORY = 2 BTREE_OMIT_JOURNAL = 1 + BTREE_PREFORMAT = 0x80 BTREE_SAVEPOSITION = 0x02 BTREE_SCHEMA_VERSION = 1 BTREE_SEEK_EQ = 0x00000002 @@ -109,13 +106,14 @@ const ( CC_DOT = 26 CC_EQ = 14 CC_GT = 13 - CC_ID = 2 - CC_ILLEGAL = 27 - CC_KYWD = 1 + CC_ID = 27 + CC_ILLEGAL = 28 + CC_KYWD = 2 + CC_KYWD0 = 1 CC_LP = 17 CC_LT = 12 CC_MINUS = 11 - CC_NUL = 28 + CC_NUL = 29 CC_PERCENT = 22 CC_PIPE = 10 CC_PLUS = 20 @@ -326,7 +324,6 @@ const ( EPROTONOSUPPORT = 93 EPROTOTYPE = 91 EP_Agg = 0x000010 - EP_Alias = 0x400000 EP_CanBeNull = 0x100000 EP_Collate = 0x000100 EP_Commuted = 0x000200 @@ -337,6 +334,7 @@ const ( EP_FromDDL = 0x40000000 EP_FromJoin = 0x000001 EP_HasFunc = 0x000004 + EP_IfNullRow = 0x020000 EP_Immutable = 0x02 EP_InfixFunc = 0x000080 EP_IntValue = 0x000400 @@ -486,11 +484,15 @@ const ( FTS5_MAX_PREFIX_INDEXES = 31 FTS5_MAX_SEGMENT = 2000 FTS5_MAX_TOKEN_SIZE = 32768 + FTS5_MERGE_NLIST = 16 FTS5_MINUS = 6 FTS5_MIN_DLIDX_SIZE = 4 FTS5_NOT = 3 FTS5_OPT_WORK_UNIT = 1000 FTS5_OR = 1 + FTS5_PATTERN_GLOB = 66 + FTS5_PATTERN_LIKE = 65 + FTS5_PATTERN_NONE = 0 FTS5_PLAN_MATCH = 1 FTS5_PLAN_ROWID = 6 FTS5_PLAN_SCAN = 5 @@ -586,7 +588,7 @@ const ( F_ULOCK = 0 F_UNLCK = 2 F_WRLCK = 1 - GCC_VERSION = 8003000 + GCC_VERSION = 7005000 GEOPOLY_PI = 3.1415926535897932385 HASHSIZE = 97 HASHTABLE_HASH_1 = 383 @@ -602,7 +604,8 @@ const ( INCRINIT_NORMAL = 0 INCRINIT_ROOT = 2 INCRINIT_TASK = 1 - INITFLAG_AlterTable = 0x0001 + INITFLAG_AlterDrop = 0x0002 + INITFLAG_AlterRename = 0x0001 INLINEFUNC_affinity = 4 INLINEFUNC_coalesce = 0 INLINEFUNC_expr_compare = 3 @@ -683,6 +686,9 @@ const ( L_ctermid = 9 L_cuserid = 9 L_tmpnam = 20 + M10d_Any = 1 + M10d_No = 2 + M10d_Yes = 0 MADV_DODUMP = 17 MADV_DOFORK = 11 MADV_DONTDUMP = 16 @@ -708,7 +714,6 @@ const ( MAP_EXECUTABLE = 0x01000 MAP_FILE = 0 MAP_FIXED = 0x10 - MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x00100 MAP_HUGETLB = 0x40000 MAP_HUGE_MASK = 0x3f @@ -719,9 +724,7 @@ const ( MAP_POPULATE = 0x08000 MAP_PRIVATE = 0x02 MAP_SHARED = 0x01 - MAP_SHARED_VALIDATE = 0x03 MAP_STACK = 0x20000 - MAP_SYNC = 0x80000 MAP_TYPE = 0x0f MATH_ERREXCEPT = 2 MATH_ERRNO = 1 @@ -883,6 +886,7 @@ const ( NC_PartIdx = 0x00002 NC_SelfRef = 0x0002e NC_UAggInfo = 0x00100 + NC_UBaseReg = 0x00400 NC_UEList = 0x00080 NC_UUpsert = 0x00200 NC_VarSelect = 0x00040 @@ -939,6 +943,7 @@ const ( OPFLAG_NOCHNG_MAGIC = 0x6d OPFLAG_P2ISREG = 0x10 OPFLAG_PERMUTE = 0x01 + OPFLAG_PREFORMAT = 0x80 OPFLAG_SAVEPOSITION = 0x02 OPFLAG_SEEKEQ = 0x02 OPFLAG_TYPEOFARG = 0x80 @@ -949,51 +954,52 @@ const ( OPFLG_JUMP = 0x01 OPFLG_OUT2 = 0x10 OPFLG_OUT3 = 0x20 - OP_Abortable = 175 - OP_Add = 105 - OP_AddImm = 82 - OP_Affinity = 90 - OP_AggFinal = 157 - OP_AggInverse = 153 - OP_AggStep = 154 - OP_AggStep1 = 155 - OP_AggValue = 156 + OP_Abortable = 178 + OP_Add = 106 + OP_AddImm = 83 + OP_Affinity = 91 + OP_AggFinal = 160 + OP_AggInverse = 156 + OP_AggStep = 157 + OP_AggStep1 = 158 + OP_AggValue = 159 OP_And = 44 OP_AutoCommit = 1 - OP_BitAnd = 101 - OP_BitNot = 112 - OP_BitOr = 102 + OP_BitAnd = 102 + OP_BitNot = 113 + OP_BitOr = 103 OP_Blob = 74 - OP_Cast = 84 + OP_Cast = 85 OP_Checkpoint = 6 - OP_Clear = 137 - OP_Close = 116 - OP_CollSeq = 81 - OP_Column = 89 - OP_ColumnsUsed = 117 - OP_Compare = 86 - OP_Concat = 110 + OP_ChngCntRow = 80 + OP_Clear = 140 + OP_Close = 117 + OP_CollSeq = 82 + OP_Column = 90 + OP_ColumnsUsed = 118 + OP_Compare = 87 + OP_Concat = 111 OP_Copy = 77 - OP_Count = 92 - OP_CreateBtree = 139 - OP_CursorHint = 171 - OP_CursorLock = 159 - OP_CursorUnlock = 160 + OP_Count = 93 + OP_CreateBtree = 142 + OP_CursorHint = 174 + OP_CursorLock = 162 + OP_CursorUnlock = 163 OP_DecrJumpZero = 59 - OP_DeferredSeek = 133 - OP_Delete = 122 - OP_Destroy = 136 - OP_Divide = 108 - OP_DropIndex = 144 - OP_DropTable = 143 - OP_DropTrigger = 145 + OP_DeferredSeek = 136 + OP_Delete = 125 + OP_Destroy = 139 + OP_Divide = 109 + OP_DropIndex = 147 + OP_DropTable = 146 + OP_DropTrigger = 148 OP_ElseNotEq = 58 OP_EndCoroutine = 66 OP_Eq = 53 - OP_Expire = 158 - OP_Explain = 174 - OP_FinishSeek = 135 - OP_FkCounter = 149 + OP_Expire = 161 + OP_Explain = 177 + OP_FinishSeek = 138 + OP_FkCounter = 153 OP_FkIfZero = 47 OP_Found = 30 OP_Function = 64 @@ -1003,13 +1009,13 @@ const ( OP_Gt = 54 OP_Halt = 68 OP_HaltIfNull = 67 - OP_IdxDelete = 132 + OP_IdxDelete = 135 OP_IdxGE = 41 OP_IdxGT = 39 - OP_IdxInsert = 130 + OP_IdxInsert = 133 OP_IdxLE = 38 OP_IdxLT = 40 - OP_IdxRowid = 134 + OP_IdxRowid = 137 OP_If = 18 OP_IfNoHope = 27 OP_IfNot = 20 @@ -1021,106 +1027,108 @@ const ( OP_IncrVacuum = 60 OP_Init = 62 OP_InitCoroutine = 13 - OP_Insert = 121 + OP_Insert = 123 OP_Int64 = 70 OP_IntCopy = 79 OP_Integer = 69 - OP_IntegrityCk = 146 + OP_IntegrityCk = 149 OP_IsNull = 50 - OP_IsTrue = 87 + OP_IsTrue = 88 OP_JournalMode = 7 OP_Jump = 16 OP_Last = 33 OP_Le = 55 - OP_LoadAnalysis = 142 + OP_LoadAnalysis = 145 OP_Lt = 56 - OP_MakeRecord = 91 - OP_MaxPgcnt = 169 - OP_MemMax = 151 + OP_MakeRecord = 92 + OP_MaxPgcnt = 172 + OP_MemMax = 154 OP_Move = 76 - OP_Multiply = 107 + OP_Multiply = 108 OP_MustBeInt = 15 OP_Ne = 52 - OP_NewRowid = 120 + OP_NewRowid = 122 OP_Next = 5 OP_NoConflict = 28 - OP_Noop = 173 + OP_Noop = 176 OP_Not = 19 OP_NotExists = 32 OP_NotFound = 29 OP_NotNull = 51 OP_Null = 72 - OP_NullRow = 128 - OP_Offset = 88 - OP_OffsetLimit = 152 + OP_NullRow = 131 + OP_Offset = 89 + OP_OffsetLimit = 155 OP_Once = 17 - OP_OpenAutoindex = 99 - OP_OpenDup = 98 - OP_OpenEphemeral = 100 - OP_OpenPseudo = 114 - OP_OpenRead = 96 - OP_OpenWrite = 97 + OP_OpenAutoindex = 100 + OP_OpenDup = 99 + OP_OpenEphemeral = 101 + OP_OpenPseudo = 115 + OP_OpenRead = 97 + OP_OpenWrite = 98 OP_Or = 43 - OP_Pagecount = 168 - OP_Param = 148 - OP_ParseSchema = 141 - OP_Permutation = 85 + OP_Pagecount = 171 + OP_Param = 151 + OP_ParseSchema = 144 + OP_Permutation = 86 OP_Prev = 4 OP_Program = 46 OP_PureFunc = 63 - OP_ReadCookie = 93 - OP_Real = 150 - OP_RealAffinity = 83 - OP_ReleaseReg = 172 - OP_Remainder = 109 - OP_ReopenIdx = 95 - OP_ResetCount = 123 - OP_ResetSorter = 138 - OP_ResultRow = 80 + OP_ReadCookie = 94 + OP_Real = 152 + OP_RealAffinity = 84 + OP_ReleaseReg = 175 + OP_Remainder = 110 + OP_ReopenIdx = 96 + OP_ResetCount = 126 + OP_ResetSorter = 141 + OP_ResultRow = 81 OP_Return = 65 OP_Rewind = 37 - OP_RowData = 126 - OP_RowSetAdd = 147 + OP_RowCell = 124 + OP_RowData = 129 + OP_RowSetAdd = 150 OP_RowSetRead = 42 OP_RowSetTest = 45 - OP_Rowid = 127 + OP_Rowid = 130 OP_SCopy = 78 OP_Savepoint = 0 - OP_SeekEnd = 129 + OP_SeekEnd = 132 OP_SeekGE = 24 OP_SeekGT = 25 - OP_SeekHit = 118 + OP_SeekHit = 120 OP_SeekLE = 23 OP_SeekLT = 22 OP_SeekRowid = 31 - OP_Sequence = 119 - OP_SequenceTest = 113 - OP_SetCookie = 94 - OP_ShiftLeft = 103 - OP_ShiftRight = 104 + OP_SeekScan = 119 + OP_Sequence = 121 + OP_SequenceTest = 114 + OP_SetCookie = 95 + OP_ShiftLeft = 104 + OP_ShiftRight = 105 OP_SoftNull = 73 OP_Sort = 36 - OP_SorterCompare = 124 - OP_SorterData = 125 - OP_SorterInsert = 131 + OP_SorterCompare = 127 + OP_SorterData = 128 + OP_SorterInsert = 134 OP_SorterNext = 3 - OP_SorterOpen = 111 + OP_SorterOpen = 112 OP_SorterSort = 35 - OP_SqlExec = 140 + OP_SqlExec = 143 OP_String = 71 - OP_String8 = 115 - OP_Subtract = 106 - OP_TableLock = 161 - OP_Trace = 170 + OP_String8 = 116 + OP_Subtract = 107 + OP_TableLock = 164 + OP_Trace = 173 OP_Transaction = 2 - OP_VBegin = 162 - OP_VColumn = 166 - OP_VCreate = 163 - OP_VDestroy = 164 + OP_VBegin = 165 + OP_VColumn = 169 + OP_VCreate = 166 + OP_VDestroy = 167 OP_VFilter = 9 OP_VNext = 61 - OP_VOpen = 165 - OP_VRename = 167 + OP_VOpen = 168 + OP_VRename = 170 OP_VUpdate = 10 OP_Vacuum = 8 OP_Variable = 75 @@ -1341,10 +1349,8 @@ const ( RBU_UPDATE = 6 READMARK_NOT_USED = 0xffffffff READ_LOCK = 1 - RENAME_EXCHANGE = 2 - RENAME_NOREPLACE = 1 - RENAME_WHITEOUT = 4 RESERVED_LOCK = 2 + RETURNING_TRIGGER_NAME = "sqlite_returning" RNDAWAY = 0 RNDTOWARDS = 0 ROWSET_ALLOCATION_SIZE = 1024 @@ -1408,9 +1414,11 @@ const ( SF_IncludeHidden = 0x0020000 SF_MaybeConvert = 0x0008000 SF_MinMaxAgg = 0x0001000 + SF_MultiPart = 0x2000000 SF_MultiValue = 0x0000400 SF_NestedFrom = 0x0000800 SF_NoopOrderBy = 0x0400000 + SF_PushDown = 0x1000000 SF_Recursive = 0x0002000 SF_Resolved = 0x0000004 SF_UpdateFrom = 0x0800000 @@ -1515,7 +1523,7 @@ const ( SQLITE_ATTACH = 24 SQLITE_AUTH = 23 SQLITE_AUTH_USER = 279 - SQLITE_AllOpts = 0xffff + SQLITE_AllOpts = 0xffffffff SQLITE_AutoIndex = 0x00008000 SQLITE_BIGENDIAN = 0 SQLITE_BIG_DBL = 0 @@ -1600,9 +1608,9 @@ const ( SQLITE_CacheSpill = 0x00000020 SQLITE_CellSizeCk = 0x00200000 SQLITE_CkptFullFSync = 0x00000010 - SQLITE_CountOfView = 0x0200 - SQLITE_CoverIdxScan = 0x0020 - SQLITE_CursorHints = 0x0400 + SQLITE_CountOfView = 0x00000200 + SQLITE_CoverIdxScan = 0x00000020 + SQLITE_CursorHints = 0x00000400 SQLITE_DBCONFIG_DEFENSIVE = 1010 SQLITE_DBCONFIG_DQS_DDL = 1014 SQLITE_DBCONFIG_DQS_DML = 1013 @@ -1675,7 +1683,7 @@ const ( SQLITE_DROP_VTABLE = 30 SQLITE_Defensive = 0x10000000 SQLITE_DeferFKs = 0x00080000 - SQLITE_DistinctOpt = 0x0010 + SQLITE_DistinctOpt = 0x00000010 SQLITE_DqsDDL = 0x20000000 SQLITE_DqsDML = 0x40000000 SQLITE_ECEL_DUP = 0x01 @@ -1706,6 +1714,7 @@ const ( SQLITE_EnableQPSG = 0x00800000 SQLITE_EnableTrigger = 0x00040000 SQLITE_EnableView = 0x80000000 + SQLITE_ExistsToIN = 0x00020000 SQLITE_FAIL = 3 SQLITE_FAULTINJECTOR_COUNT = 1 SQLITE_FAULTINJECTOR_MALLOC = 0 @@ -1778,14 +1787,15 @@ const ( SQLITE_FUNC_UNLIKELY = 0x0400 SQLITE_FUNC_UNSAFE = 0x00200000 SQLITE_FUNC_WINDOW = 0x00010000 - SQLITE_FactorOutConst = 0x0008 + SQLITE_FactorOutConst = 0x00000008 SQLITE_ForeignKeys = 0x00004000 SQLITE_Fts3Tokenizer = 0x00400000 SQLITE_FullColNames = 0x00000004 SQLITE_FullFSync = 0x00000008 SQLITE_GET_LOCKPROXYFILE = 2 - SQLITE_GroupByOrder = 0x0004 + SQLITE_GroupByOrder = 0x00000004 SQLITE_HASH_H = 0 + SQLITE_HAVE_C99_MATH_FUNCS = 1 SQLITE_IDXTYPE_APPDEF = 0 SQLITE_IDXTYPE_IPK = 3 SQLITE_IDXTYPE_PRIMARYKEY = 2 @@ -1837,6 +1847,7 @@ const ( SQLITE_IOERR_CLOSE = 4106 SQLITE_IOERR_COMMIT_ATOMIC = 7690 SQLITE_IOERR_CONVPATH = 6666 + SQLITE_IOERR_CORRUPTFS = 8458 SQLITE_IOERR_DATA = 8202 SQLITE_IOERR_DELETE = 2570 SQLITE_IOERR_DELETE_NOENT = 5898 @@ -1903,6 +1914,7 @@ const ( SQLITE_MAX_ATTACHED = 10 SQLITE_MAX_COLUMN = 2000 SQLITE_MAX_COMPOUND_SELECT = 500 + SQLITE_MAX_DB = 12 SQLITE_MAX_DEFAULT_PAGE_SIZE = 8192 SQLITE_MAX_EXPR_DEPTH = 1000 SQLITE_MAX_FILE_FORMAT = 4 @@ -1947,6 +1959,7 @@ const ( SQLITE_MUTEX_STATIC_VFS2 = 12 SQLITE_MUTEX_STATIC_VFS3 = 13 SQLITE_MX_JUMP_OPCODE = 62 + SQLITE_MinMaxOpt = 0x00010000 SQLITE_NOLFS = 22 SQLITE_NOMATCH = 1 SQLITE_NOMEM = 7 @@ -1962,7 +1975,7 @@ const ( SQLITE_NULL = 5 SQLITE_NULLEQ = 0x80 SQLITE_N_BTREE_META = 16 - SQLITE_N_KEYWORD = 145 + SQLITE_N_KEYWORD = 147 SQLITE_N_LIMIT = 12 SQLITE_NoCkptOnClose = 0x00000800 SQLITE_NoSchemaError = 0x08000000 @@ -1995,8 +2008,8 @@ const ( SQLITE_OS_SETUP_H = 0 SQLITE_OS_UNIX = 1 SQLITE_OS_WIN = 0 - SQLITE_OmitNoopJoin = 0x0100 - SQLITE_OrderByIdxJoin = 0x0040 + SQLITE_OmitNoopJoin = 0x00000100 + SQLITE_OrderByIdxJoin = 0x00000040 SQLITE_PAGER_H = 0 SQLITE_PERM = 3 SQLITE_POWERSAFE_OVERWRITE = 1 @@ -2013,11 +2026,11 @@ const ( SQLITE_PRIVATE = 0 SQLITE_PROTOCOL = 15 SQLITE_PTRSIZE = 8 - SQLITE_PropagateConst = 0x8000 - SQLITE_PushDown = 0x1000 + SQLITE_PropagateConst = 0x00008000 + SQLITE_PushDown = 0x00001000 SQLITE_QUERY_PLANNER_LIMIT = 20000 SQLITE_QUERY_PLANNER_LIMIT_INCR = 1000 - SQLITE_QueryFlattener = 0x0001 + SQLITE_QueryFlattener = 0x00000001 SQLITE_QueryOnly = 0x00100000 SQLITE_RANGE = 25 SQLITE_RBU_STATE_CHECKPOINT = 3 @@ -2061,7 +2074,7 @@ const ( SQLITE_SHM_UNLOCK = 1 SQLITE_SORTER_PMASZ = 250 SQLITE_SOUNDEX = 1 - SQLITE_SOURCE_ID = "2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f" + SQLITE_SOURCE_ID = "2021-03-12 15:10:09 acd63062eb06748bfe9e4886639e4f2b54ea6a496a83f10716abbaba4115500b" SQLITE_SO_ASC = 0 SQLITE_SO_DESC = 1 SQLITE_SO_UNDEFINED = -1 @@ -2093,9 +2106,9 @@ const ( SQLITE_SYSAPI = 0 SQLITE_SYSTEM_MALLOC = 1 SQLITE_ShortColNames = 0x00000040 - SQLITE_SimplifyJoin = 0x2000 - SQLITE_SkipScan = 0x4000 - SQLITE_Stat4 = 0x0800 + SQLITE_SimplifyJoin = 0x00002000 + SQLITE_SkipScan = 0x00004000 + SQLITE_Stat4 = 0x00000800 SQLITE_TCLAPI = 0 SQLITE_TEMP_FILE_PREFIX = "etilqs_" SQLITE_TEMP_STORE = 1 @@ -2112,7 +2125,7 @@ const ( SQLITE_TESTCTRL_INTERNAL_FUNCTIONS = 17 SQLITE_TESTCTRL_ISINIT = 23 SQLITE_TESTCTRL_ISKEYWORD = 16 - SQLITE_TESTCTRL_LAST = 29 + SQLITE_TESTCTRL_LAST = 31 SQLITE_TESTCTRL_LOCALTIME_FAULT = 18 SQLITE_TESTCTRL_NEVER_CORRUPT = 20 SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD = 19 @@ -2126,7 +2139,9 @@ const ( SQLITE_TESTCTRL_RESERVE = 14 SQLITE_TESTCTRL_RESULT_INTREAL = 27 SQLITE_TESTCTRL_SCRATCHMALLOC = 17 + SQLITE_TESTCTRL_SEEK_COUNT = 30 SQLITE_TESTCTRL_SORTER_MMAP = 24 + SQLITE_TESTCTRL_TRACEFLAGS = 31 SQLITE_TESTCTRL_VDBE_COVERAGE = 21 SQLITE_TEXT = 3 SQLITE_THREADSAFE = 1 @@ -2141,7 +2156,10 @@ const ( SQLITE_TRACE_STMT = 0x01 SQLITE_TRACE_XPROFILE = 0x80 SQLITE_TRANSACTION = 22 - SQLITE_Transitive = 0x0080 + SQLITE_TXN_NONE = 0 + SQLITE_TXN_READ = 1 + SQLITE_TXN_WRITE = 2 + SQLITE_Transitive = 0x00000080 SQLITE_TriggerEQP = 0x01000000 SQLITE_TrustedSchema = 0x00000080 SQLITE_UPDATE = 23 @@ -2154,8 +2172,8 @@ const ( SQLITE_UTF8 = 1 SQLITE_VDBEINT_H = 0 SQLITE_VDBE_H = 0 - SQLITE_VERSION = "3.33.0" - SQLITE_VERSION_NUMBER = 3033000 + SQLITE_VERSION = "3.35.0" + SQLITE_VERSION_NUMBER = 3035000 SQLITE_VTABRISK_High = 2 SQLITE_VTABRISK_Low = 0 SQLITE_VTABRISK_Normal = 1 @@ -2169,16 +2187,16 @@ const ( SQLITE_WIN32_DATA_DIRECTORY_TYPE = 1 SQLITE_WIN32_TEMP_DIRECTORY_TYPE = 2 SQLITE_WSD = 0 - SQLITE_WindowFunc = 0x0002 + SQLITE_WindowFunc = 0x00000002 SQLITE_WriteSchema = 0x00000001 SRT_Coroutine = 13 SRT_Discard = 4 - SRT_DistFifo = 6 - SRT_DistQueue = 8 + SRT_DistFifo = 5 + SRT_DistQueue = 6 SRT_EphemTab = 12 SRT_Except = 2 SRT_Exists = 3 - SRT_Fifo = 5 + SRT_Fifo = 8 SRT_Mem = 10 SRT_Output = 9 SRT_Queue = 7 @@ -2186,27 +2204,6 @@ const ( SRT_Table = 14 SRT_Union = 1 SRT_Upfrom = 15 - STATX_ALL = 0x0fff - STATX_ATIME = 0x0020 - STATX_ATTR_APPEND = 0x0020 - STATX_ATTR_AUTOMOUNT = 0x1000 - STATX_ATTR_COMPRESSED = 0x0004 - STATX_ATTR_ENCRYPTED = 0x0800 - STATX_ATTR_IMMUTABLE = 0x0010 - STATX_ATTR_NODUMP = 0x0040 - STATX_BASIC_STATS = 0x07ff - STATX_BLOCKS = 0x0400 - STATX_BTIME = 0x0800 - STATX_CTIME = 0x0080 - STATX_GID = 0x0010 - STATX_INO = 0x0100 - STATX_MODE = 0x0002 - STATX_MTIME = 0x0040 - STATX_NLINK = 0x0004 - STATX_SIZE = 0x0200 - STATX_TYPE = 0x0001 - STATX_UID = 0x0008 - STATX__RESERVED = 0x80000000 STAT_GET_NDLT = 4 STAT_GET_NEQ = 2 STAT_GET_NLT = 3 @@ -2294,11 +2291,13 @@ const ( TERM_VIRTUAL = 0x0002 TERM_VNULL = 0x0080 TF_Autoincrement = 0x0008 - TF_Ephemeral = 0x0002 + TF_Ephemeral = 0x4000 TF_HasGenerated = 0x0060 + TF_HasHidden = 0x0002 TF_HasNotNull = 0x0800 TF_HasPrimaryKey = 0x0004 TF_HasStat1 = 0x0010 + TF_HasStat4 = 0x2000 TF_HasStored = 0x0040 TF_HasVirtual = 0x0020 TF_NoVisibleRowid = 0x0200 @@ -2375,182 +2374,184 @@ const ( TIOCVHANGUP = 0x5437 TK_ABORT = 27 TK_ACTION = 28 - TK_ADD = 160 + TK_ADD = 162 TK_AFTER = 29 - TK_AGG_COLUMN = 166 - TK_AGG_FUNCTION = 165 - TK_ALL = 133 - TK_ALTER = 159 + TK_AGG_COLUMN = 168 + TK_AGG_FUNCTION = 167 + TK_ALL = 134 + TK_ALTER = 161 TK_ALWAYS = 96 TK_ANALYZE = 30 TK_AND = 44 - TK_ANY = 100 + TK_ANY = 101 TK_AS = 24 TK_ASC = 31 - TK_ASTERISK = 177 + TK_ASTERISK = 179 TK_ATTACH = 32 - TK_AUTOINCR = 124 + TK_AUTOINCR = 125 TK_BEFORE = 33 TK_BEGIN = 5 TK_BETWEEN = 48 - TK_BITAND = 101 - TK_BITNOT = 112 - TK_BITOR = 102 - TK_BLOB = 151 + TK_BITAND = 102 + TK_BITNOT = 113 + TK_BITOR = 103 + TK_BLOB = 153 TK_BY = 34 TK_CASCADE = 35 - TK_CASE = 154 + TK_CASE = 156 TK_CAST = 36 - TK_CHECK = 122 - TK_COLLATE = 111 - TK_COLUMN = 164 + TK_CHECK = 123 + TK_COLLATE = 112 + TK_COLUMN = 166 TK_COLUMNKW = 60 TK_COMMA = 26 TK_COMMIT = 10 - TK_CONCAT = 110 + TK_CONCAT = 111 TK_CONFLICT = 37 - TK_CONSTRAINT = 117 + TK_CONSTRAINT = 118 TK_CREATE = 17 - TK_CTIME_KW = 99 + TK_CTIME_KW = 100 TK_CURRENT = 85 TK_DATABASE = 38 - TK_DEFAULT = 118 - TK_DEFERRABLE = 129 + TK_DEFAULT = 119 + TK_DEFERRABLE = 130 TK_DEFERRED = 7 - TK_DELETE = 126 + TK_DELETE = 127 TK_DESC = 39 TK_DETACH = 40 - TK_DISTINCT = 138 + TK_DISTINCT = 139 TK_DO = 61 - TK_DOT = 139 - TK_DROP = 131 + TK_DOT = 140 + TK_DROP = 132 TK_EACH = 41 - TK_ELSE = 157 + TK_ELSE = 159 TK_END = 11 TK_EQ = 53 TK_ESCAPE = 58 - TK_EXCEPT = 134 + TK_EXCEPT = 135 TK_EXCLUDE = 91 TK_EXCLUSIVE = 9 TK_EXISTS = 20 TK_EXPLAIN = 2 TK_FAIL = 42 - TK_FILTER = 163 + TK_FILTER = 165 TK_FIRST = 83 - TK_FLOAT = 150 + TK_FLOAT = 152 TK_FOLLOWING = 86 TK_FOR = 62 - TK_FOREIGN = 130 - TK_FROM = 140 - TK_FUNCTION = 169 + TK_FOREIGN = 131 + TK_FROM = 141 + TK_FUNCTION = 171 TK_GE = 57 TK_GENERATED = 95 - TK_GROUP = 144 + TK_GROUP = 145 TK_GROUPS = 92 TK_GT = 54 - TK_HAVING = 145 + TK_HAVING = 146 TK_ID = 59 TK_IF = 18 - TK_IF_NULL_ROW = 176 + TK_IF_NULL_ROW = 178 TK_IGNORE = 63 - TK_ILLEGAL = 180 + TK_ILLEGAL = 182 TK_IMMEDIATE = 8 TK_IN = 49 - TK_INDEX = 158 - TK_INDEXED = 114 + TK_INDEX = 160 + TK_INDEXED = 115 TK_INITIALLY = 64 - TK_INSERT = 125 + TK_INSERT = 126 TK_INSTEAD = 65 - TK_INTEGER = 152 - TK_INTERSECT = 135 - TK_INTO = 148 + TK_INTEGER = 154 + TK_INTERSECT = 136 + TK_INTO = 150 TK_IS = 45 - TK_ISNOT = 168 + TK_ISNOT = 170 TK_ISNULL = 50 - TK_JOIN = 141 - TK_JOIN_KW = 116 + TK_JOIN = 142 + TK_JOIN_KW = 117 TK_KEY = 67 TK_LAST = 84 TK_LE = 55 TK_LIKE_KW = 47 - TK_LIMIT = 146 + TK_LIMIT = 147 TK_LP = 22 - TK_LSHIFT = 103 + TK_LSHIFT = 104 TK_LT = 56 TK_MATCH = 46 - TK_MINUS = 106 + TK_MATERIALIZED = 97 + TK_MINUS = 107 TK_NE = 52 TK_NO = 66 TK_NOT = 19 - TK_NOTHING = 149 + TK_NOTHING = 151 TK_NOTNULL = 51 - TK_NULL = 119 + TK_NULL = 120 TK_NULLS = 82 TK_OF = 68 TK_OFFSET = 69 - TK_ON = 113 + TK_ON = 114 TK_OR = 43 - TK_ORDER = 143 + TK_ORDER = 144 TK_OTHERS = 93 - TK_OVER = 162 + TK_OVER = 164 TK_PARTITION = 87 TK_PLAN = 4 - TK_PLUS = 105 + TK_PLUS = 106 TK_PRAGMA = 70 TK_PRECEDING = 88 - TK_PRIMARY = 120 + TK_PRIMARY = 121 TK_QUERY = 3 TK_RAISE = 71 TK_RANGE = 89 TK_RECURSIVE = 72 - TK_REFERENCES = 123 - TK_REGISTER = 173 - TK_REINDEX = 97 + TK_REFERENCES = 124 + TK_REGISTER = 175 + TK_REINDEX = 98 TK_RELEASE = 14 - TK_REM = 109 - TK_RENAME = 98 + TK_REM = 110 + TK_RENAME = 99 TK_REPLACE = 73 TK_RESTRICT = 74 + TK_RETURNING = 149 TK_ROLLBACK = 12 TK_ROW = 75 TK_ROWS = 76 TK_RP = 23 - TK_RSHIFT = 104 + TK_RSHIFT = 105 TK_SAVEPOINT = 13 - TK_SELECT = 136 - TK_SELECT_COLUMN = 175 + TK_SELECT = 137 + TK_SELECT_COLUMN = 177 TK_SEMI = 1 - TK_SET = 128 - TK_SLASH = 108 - TK_SPACE = 179 - TK_SPAN = 178 - TK_STAR = 107 - TK_STRING = 115 + TK_SET = 129 + TK_SLASH = 109 + TK_SPACE = 181 + TK_SPAN = 180 + TK_STAR = 108 + TK_STRING = 116 TK_TABLE = 16 TK_TEMP = 21 - TK_THEN = 156 + TK_THEN = 158 TK_TIES = 94 TK_TO = 15 TK_TRANSACTION = 6 TK_TRIGGER = 77 - TK_TRUEFALSE = 167 - TK_TRUTH = 172 - TK_UMINUS = 170 + TK_TRUEFALSE = 169 + TK_TRUTH = 174 + TK_UMINUS = 172 TK_UNBOUNDED = 90 - TK_UNION = 132 - TK_UNIQUE = 121 - TK_UPDATE = 127 - TK_UPLUS = 171 - TK_USING = 142 + TK_UNION = 133 + TK_UNIQUE = 122 + TK_UPDATE = 128 + TK_UPLUS = 173 + TK_USING = 143 TK_VACUUM = 78 - TK_VALUES = 137 - TK_VARIABLE = 153 - TK_VECTOR = 174 + TK_VALUES = 138 + TK_VARIABLE = 155 + TK_VECTOR = 176 TK_VIEW = 79 TK_VIRTUAL = 80 - TK_WHEN = 155 - TK_WHERE = 147 - TK_WINDOW = 161 + TK_WHEN = 157 + TK_WHERE = 148 + TK_WINDOW = 163 TK_WITH = 81 TK_WITHOUT = 25 TMP_MAX = 238328 @@ -2621,6 +2622,7 @@ const ( WHERE_INDEXED = 0x00000200 WHERE_IN_ABLE = 0x00000800 WHERE_IN_EARLYOUT = 0x00040000 + WHERE_IN_SEEKSCAN = 0x00100000 WHERE_IPK = 0x00000100 WHERE_MULTI_OR = 0x00002000 WHERE_ONEPASS_DESIRED = 0x0004 @@ -2632,8 +2634,6 @@ const ( WHERE_ORDERBY_NORMAL = 0x0000 WHERE_OR_SUBCLAUSE = 0x0020 WHERE_PARTIALIDX = 0x00020000 - WHERE_SEEK_TABLE = 0x0400 - WHERE_SEEK_UNIQ_TABLE = 0x1000 WHERE_SKIPSCAN = 0x00008000 WHERE_SORTBYGROUP = 0x0200 WHERE_TOP_LIMIT = 0x00000010 @@ -2677,29 +2677,29 @@ const ( XN_ROWID = -1 X_OK = 1 YYFALLBACK = 1 - YYNOCODE = 310 + YYNOCODE = 316 YYNOERRORRECOVERY = 1 - YYNRULE = 385 - YYNRULE_WITH_ACTION = 325 - YYNSTATE = 553 - YYNTOKEN = 181 + YYNRULE = 398 + YYNRULE_WITH_ACTION = 337 + YYNSTATE = 570 + YYNTOKEN = 183 YYPARSEFREENEVERNULL = 1 YYSTACKDEPTH = 100 - YYWILDCARD = 100 - YY_ACCEPT_ACTION = 1189 - YY_ACTTAB_COUNT = 1962 - YY_ERROR_ACTION = 1188 - YY_MAX_REDUCE = 1575 - YY_MAX_SHIFT = 552 - YY_MAX_SHIFTREDUCE = 1187 - YY_MIN_REDUCE = 1191 - YY_MIN_SHIFTREDUCE = 803 - YY_NO_ACTION = 1190 - YY_REDUCE_COUNT = 391 - YY_REDUCE_MAX = 1625 - YY_REDUCE_MIN = -262 - YY_SHIFT_COUNT = 552 - YY_SHIFT_MAX = 1951 + YYWILDCARD = 101 + YY_ACCEPT_ACTION = 1224 + YY_ACTTAB_COUNT = 2020 + YY_ERROR_ACTION = 1223 + YY_MAX_REDUCE = 1623 + YY_MAX_SHIFT = 569 + YY_MAX_SHIFTREDUCE = 1222 + YY_MIN_REDUCE = 1226 + YY_MIN_SHIFTREDUCE = 825 + YY_NO_ACTION = 1225 + YY_REDUCE_COUNT = 405 + YY_REDUCE_MAX = 1690 + YY_REDUCE_MIN = -265 + YY_SHIFT_COUNT = 569 + YY_SHIFT_MAX = 2009 YY_SHIFT_MIN = 0 X_ALLOCA_H = 1 X_ANSI_STDARG_H_ = 0 @@ -2713,6 +2713,8 @@ const ( X_BITS_ERRNO_H = 1 X_BITS_FLOATN_COMMON_H = 0 X_BITS_FLOATN_H = 0 + X_BITS_G_CONFIG_H = 1 + X_BITS_LIBIO_H = 1 X_BITS_LIBM_SIMD_DECL_STUBS_H = 1 X_BITS_POSIX_OPT_H = 1 X_BITS_PTHREADTYPES_ARCH_H = 1 @@ -2720,6 +2722,7 @@ const ( X_BITS_STAT_H = 1 X_BITS_STDINT_INTN_H = 1 X_BITS_STDIO_LIM_H = 1 + X_BITS_SYSMACROS_H = 1 X_BITS_TIMEX_H = 1 X_BITS_TIME_H = 1 X_BITS_TYPESIZES_H = 1 @@ -2748,6 +2751,11 @@ const ( X_GETOPT_CORE_H = 1 X_GETOPT_POSIX_H = 1 X_GNU_SOURCE = 0 + X_G_BUFSIZ = 8192 + X_G_HAVE_MMAP = 1 + X_G_HAVE_MREMAP = 1 + X_G_HAVE_ST_BLKSIZE = 1 + X_G_IO_IO_FILE_VERSION = 0x20001 X_IOC_DIRBITS = 2 X_IOC_DIRMASK = 3 X_IOC_DIRSHIFT = 30 @@ -2766,8 +2774,54 @@ const ( X_IOFBF = 0 X_IOLBF = 1 X_IONBF = 2 - X_IO_EOF_SEEN = 0x0010 - X_IO_ERR_SEEN = 0x0020 + X_IOS_APPEND = 8 + X_IOS_ATEND = 4 + X_IOS_BIN = 128 + X_IOS_INPUT = 1 + X_IOS_NOCREATE = 32 + X_IOS_NOREPLACE = 64 + X_IOS_OUTPUT = 2 + X_IOS_TRUNC = 16 + X_IO_BAD_SEEN = 0x4000 + X_IO_BOOLALPHA = 0200000 + X_IO_BUFSIZ = 8192 + X_IO_CURRENTLY_PUTTING = 0x800 + X_IO_DEC = 020 + X_IO_DELETE_DONT_CLOSE = 0x40 + X_IO_DONT_CLOSE = 0100000 + X_IO_EOF_SEEN = 0x10 + X_IO_ERR_SEEN = 0x20 + X_IO_FIXED = 010000 + X_IO_FLAGS2_MMAP = 1 + X_IO_FLAGS2_NOTCANCEL = 2 + X_IO_FLAGS2_USER_WBUF = 8 + X_IO_HAVE_ST_BLKSIZE = 1 + X_IO_HEX = 0100 + X_IO_INTERNAL = 010 + X_IO_IN_BACKUP = 0x100 + X_IO_IS_APPENDING = 0x1000 + X_IO_IS_FILEBUF = 0x2000 + X_IO_LEFT = 02 + X_IO_LINE_BUF = 0x200 + X_IO_LINKED = 0x80 + X_IO_MAGIC = 0xFBAD0000 + X_IO_MAGIC_MASK = 0xFFFF0000 + X_IO_NO_READS = 4 + X_IO_NO_WRITES = 8 + X_IO_OCT = 040 + X_IO_RIGHT = 04 + X_IO_SCIENTIFIC = 04000 + X_IO_SHOWBASE = 0200 + X_IO_SHOWPOINT = 0400 + X_IO_SHOWPOS = 02000 + X_IO_SKIPWS = 01 + X_IO_STDIO = 040000 + X_IO_TIED_PUT_GET = 0x400 + X_IO_UNBUFFERED = 2 + X_IO_UNIFIED_JUMPTABLES = 1 + X_IO_UNITBUF = 020000 + X_IO_UPPERCASE = 01000 + X_IO_USER_BUF = 1 X_IO_USER_LOCK = 0x8000 X_ISOC11_SOURCE = 1 X_ISOC95_SOURCE = 1 @@ -2785,6 +2839,7 @@ const ( X_MATH_H = 1 X_MKNOD_VER = 0 X_MKNOD_VER_LINUX = 0 + X_OLD_STDIO_MAGIC = 0xFABC0000 X_OS_COMMON_H_ = 0 X_POSIX2_CHAR_TERM = 200809 X_POSIX2_C_BIND = 200809 @@ -2875,6 +2930,7 @@ const ( X_STDDEF_H = 0 X_STDDEF_H_ = 0 X_STDIO_H = 1 + X_STDIO_USES_IOSTREAM = 0 X_STDLIB_H = 1 X_STRINGS_H = 1 X_STRING_H = 1 @@ -2885,6 +2941,7 @@ const ( X_SYS_SELECT_H = 1 X_SYS_SIZE_T_H = 0 X_SYS_STAT_H = 1 + X_SYS_SYSMACROS_H = 1 X_SYS_TIME_H = 1 X_SYS_TTYDEFAULTS_H_ = 0 X_SYS_TYPES_H = 1 @@ -2909,6 +2966,7 @@ const ( X_WCHAR_T_H = 0 X_XBS5_LP64_OFF64 = 1 X_XBS5_LPBIG_OFFBIG = -1 + X_XOPEN_CRYPT = 1 X_XOPEN_ENH_I18N = 1 X_XOPEN_LEGACY = 1 X_XOPEN_REALTIME = 1 @@ -3125,7 +3183,7 @@ const ( /* math.h:237:1: */ // ISO C99 defines some generic macros which work on any data type. // All floating-point numbers can be put in one of these categories. -const ( /* math.h:853:1: */ +const ( /* math.h:569:1: */ FP_NAN = 0 FP_INFINITE = 1 FP_ZERO = 2 @@ -3541,6 +3599,14 @@ const ( /* fcntl-linux.h:265:1: */ F_OWNER_GID = 2 ) +// This is the structure from the libstdc++ codecvt class. +const ( /* libio.h:180:1: */ + X__codecvt_ok = 0 + X__codecvt_partial = 1 + X__codecvt_error = 2 + X__codecvt_noconv = 3 +) + // In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. // are already defined. // BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. @@ -3614,7 +3680,7 @@ type X__float128 = float64 /* :47:21 */ // ***************************************************************************** // // This file is an amalgamation of many separate C source files from SQLite -// version 3.33.0. By combining all the individual C code files into this +// version 3.35.0. 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 @@ -3664,7 +3730,7 @@ type X__float128 = float64 /* :47:21 */ var sqlite3azCompileOpt = [16]uintptr{ // BEGIN CODE GENERATED BY tool/mkctime.tcl - ts, /* "COMPILER=gcc-8.3..." */ + ts, /* "COMPILER=gcc-7.5..." */ ts + 19, /* "ENABLE_COLUMN_ME..." */ ts + 42, /* "ENABLE_FTS5" */ ts + 54, /* "ENABLE_GEOPOLY" */ @@ -3683,7 +3749,7 @@ var sqlite3azCompileOpt = [16]uintptr{ // END CODE GENERATED BY tool/mkctime.tcl } /* sqlite3.c:72:19 */ -func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr { /* sqlite3.c:782:27: */ +func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr { /* sqlite3.c:785:27: */ *(*int32)(unsafe.Pointer(pnOpt)) = (int32(uint64(unsafe.Sizeof(sqlite3azCompileOpt)) / uint64(unsafe.Sizeof(uintptr(0))))) return uintptr(uintptr(unsafe.Pointer(&sqlite3azCompileOpt))) } @@ -3810,6 +3876,9 @@ func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr { /* sqlite3.c // so the GCC_VERSION macro will be set to a correct non-zero value even // when compiling with clang. +// Some C99 functions in "math.h" are only present for MSVC when its version +// is associated with Visual Studio 2013 or higher. + // Needed for various definitions... // Macro to disable warnings about missing "break" at the end of a "case". @@ -3866,7 +3935,7 @@ func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr { /* sqlite3.c // The makefile makes some minor changes to this file (such as inserting // the version number) and changes its name to "sqlite3.h" as // part of the build process. -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -3992,7 +4061,7 @@ type Va_list = X__gnuc_va_list /* stdarg.h:99:24 */ // of the hash might be different from [SQLITE_SOURCE_ID].)^ // // See also: [sqlite_version()] and [sqlite_source_id()]. -var Xsqlite3_version = *(*[7]int8)(unsafe.Pointer(ts + 259 /* "3.33.0" */)) /* sqlite3.c:1210:23 */ +var Xsqlite3_version = *(*[7]int8)(unsafe.Pointer(ts + 259 /* "3.35.0" */)) /* sqlite3.c:1225:23 */ // CAPI3REF: Database Connection Handle // KEYWORDS: {database connection} {database connections} @@ -4022,7 +4091,7 @@ type sqlite3 = struct { FerrCode int32 FerrMask int32 FiSysErrno int32 - FdbOptFlags U16 + FdbOptFlags U32 Fenc U8 FautoCommit U8 Ftemp_store U8 @@ -4036,13 +4105,14 @@ type sqlite3 = struct { FmTrace U8 FnoSharedCache U8 FnSqlExec U8 - _ [1]byte + _ [3]byte FnextPagesize int32 Fmagic U32 FnChange int32 FnTotalChange int32 FaLimit [12]int32 FnMaxSorterMmap int32 + _ [4]byte Finit struct { FnewTnum Pgno FiDb U8 @@ -4112,7 +4182,7 @@ type sqlite3 = struct { FpUnlockArg uintptr FxUnlockNotify uintptr FpNextBlocked uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: Database Connection Handle // KEYWORDS: {database connection} {database connections} @@ -4126,7 +4196,7 @@ type sqlite3 = struct { // [sqlite3_prepare_v2()], [sqlite3_create_function()], and // [sqlite3_busy_timeout()] to name but three) that are methods on an // sqlite3 object. -type Sqlite3 = sqlite3 /* sqlite3.c:1297:24 */ +type Sqlite3 = sqlite3 /* sqlite3.c:1312:24 */ // CAPI3REF: 64-Bit Integer Types // KEYWORDS: sqlite_int64 sqlite_uint64 @@ -4142,15 +4212,15 @@ type Sqlite3 = sqlite3 /* sqlite3.c:1297:24 */ // between -9223372036854775808 and +9223372036854775807 inclusive. ^The // sqlite3_uint64 and sqlite_uint64 types can store integer values // between 0 and +18446744073709551615 inclusive. -type Sqlite_int64 = int64 /* sqlite3.c:1326:25 */ -type Sqlite_uint64 = uint64 /* sqlite3.c:1327:34 */ -type Sqlite3_int64 = Sqlite_int64 /* sqlite3.c:1329:22 */ -type Sqlite3_uint64 = Sqlite_uint64 /* sqlite3.c:1330:23 */ +type Sqlite_int64 = int64 /* sqlite3.c:1341:25 */ +type Sqlite_uint64 = uint64 /* sqlite3.c:1342:34 */ +type Sqlite3_int64 = Sqlite_int64 /* sqlite3.c:1344:22 */ +type Sqlite3_uint64 = Sqlite_uint64 /* sqlite3.c:1345:23 */ // The type for a callback function. // This is legacy and deprecated. It is included for historical // compatibility and is not documented. -type Sqlite3_callback = uintptr /* sqlite3.c:1386:13 */ +type Sqlite3_callback = uintptr /* sqlite3.c:1401:13 */ // CAPI3REF: Result Codes // KEYWORDS: {result code definitions} @@ -4261,7 +4331,7 @@ type Sqlite3_callback = uintptr /* sqlite3.c:1386:13 */ // for their own use. The pMethods entry is a pointer to an // [sqlite3_io_methods] object that defines methods for performing // I/O operations on the open file. -type sqlite3_file = struct{ FpMethods uintptr } /* sqlite3.c:1297:9 */ +type sqlite3_file = struct{ FpMethods uintptr } /* sqlite3.c:1312:9 */ // CAPI3REF: Result Codes // KEYWORDS: {result code definitions} @@ -4372,7 +4442,7 @@ type sqlite3_file = struct{ FpMethods uintptr } /* sqlite3.c:1297:9 */ // for their own use. The pMethods entry is a pointer to an // [sqlite3_io_methods] object that defines methods for performing // I/O operations on the open file. -type Sqlite3_file = sqlite3_file /* sqlite3.c:1731:29 */ +type Sqlite3_file = sqlite3_file /* sqlite3.c:1747:29 */ type sqlite3_io_methods = struct { FiVersion int32 _ [4]byte @@ -4394,7 +4464,7 @@ type sqlite3_io_methods = struct { FxShmUnmap uintptr FxFetch uintptr FxUnfetch uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: OS Interface File Virtual Methods Object // @@ -4488,7 +4558,7 @@ type sqlite3_io_methods = struct { // fails to zero-fill short reads might seem to work. However, // failure to zero-fill short reads will eventually lead to // database corruption. -type Sqlite3_io_methods = sqlite3_io_methods /* sqlite3.c:1830:35 */ +type Sqlite3_io_methods = sqlite3_io_methods /* sqlite3.c:1846:35 */ // CAPI3REF: Loadable Extension Thunk // @@ -4749,7 +4819,8 @@ type sqlite3_api_routines = struct { Fcreate_filename uintptr Ffree_filename uintptr Fdatabase_file_object uintptr -} /* sqlite3.c:2244:9 */ + Ftxn_state uintptr +} /* sqlite3.c:2260:9 */ // CAPI3REF: Loadable Extension Thunk // @@ -4757,7 +4828,7 @@ type sqlite3_api_routines = struct { // the third parameter to entry points of [loadable extensions]. This // structure must be typedefed in order to work around compiler warnings // on some platforms. -type Sqlite3_api_routines = sqlite3_api_routines /* sqlite3.c:2244:37 */ +type Sqlite3_api_routines = sqlite3_api_routines /* sqlite3.c:2260:37 */ // CAPI3REF: OS Interface Object // @@ -4950,7 +5021,7 @@ type sqlite3_vfs = struct { FxSetSystemCall uintptr FxGetSystemCall uintptr FxNextSystemCall uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: OS Interface Object // @@ -5119,8 +5190,8 @@ type sqlite3_vfs = struct { // or all of these interfaces to be NULL or for their behavior to change // from one release to the next. Applications must not attempt to access // any of these methods if the iVersion of the VFS is less than 3. -type Sqlite3_vfs = sqlite3_vfs /* sqlite3.c:2415:28 */ -type Sqlite3_syscall_ptr = uintptr /* sqlite3.c:2416:14 */ +type Sqlite3_vfs = sqlite3_vfs /* sqlite3.c:2431:28 */ +type Sqlite3_syscall_ptr = uintptr /* sqlite3.c:2432:14 */ // CAPI3REF: Memory Allocation Routines // @@ -5192,7 +5263,7 @@ type sqlite3_mem_methods = struct { FxInit uintptr FxShutdown uintptr FpAppData uintptr -} /* sqlite3.c:2713:9 */ +} /* sqlite3.c:2729:9 */ // CAPI3REF: Memory Allocation Routines // @@ -5255,7 +5326,7 @@ type sqlite3_mem_methods = struct { // // SQLite will never invoke xInit() more than once without an intervening // call to xShutdown(). -type Sqlite3_mem_methods = sqlite3_mem_methods /* sqlite3.c:2713:36 */ +type Sqlite3_mem_methods = sqlite3_mem_methods /* sqlite3.c:2729:36 */ // CAPI3REF: Dynamically Typed Value Object // KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} @@ -5307,7 +5378,7 @@ type sqlite3_value = struct { FuTemp U32 Fdb uintptr FxDel uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: Dynamically Typed Value Object // KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} @@ -5347,7 +5418,7 @@ type sqlite3_value = struct { // [sqlite3_value_dup()]. // The [sqlite3_value_blob | sqlite3_value_type()] family of // interfaces require protected sqlite3_value objects. -type Sqlite3_value = sqlite3_value /* sqlite3.c:5292:30 */ +type Sqlite3_value = sqlite3_value /* sqlite3.c:5321:30 */ // CAPI3REF: SQL Function Context Object // @@ -5370,7 +5441,7 @@ type sqlite3_context = struct { Fargc U8 _ [6]byte Fargv [1]uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: SQL Function Context Object // @@ -5382,7 +5453,7 @@ type sqlite3_context = struct { // [sqlite3_aggregate_context()], [sqlite3_user_data()], // [sqlite3_context_db_handle()], [sqlite3_get_auxdata()], // and/or [sqlite3_set_auxdata()]. -type Sqlite3_context = sqlite3_context /* sqlite3.c:5306:32 */ +type Sqlite3_context = sqlite3_context /* sqlite3.c:5335:32 */ // CAPI3REF: Constants Defining Special Destructor Behavior // @@ -5396,7 +5467,7 @@ type Sqlite3_context = sqlite3_context /* sqlite3.c:5306:32 */ // // The typedef is necessary to work around problems in certain // C++ compilers. -type Sqlite3_destructor_type = uintptr /* sqlite3.c:6669:14 */ +type Sqlite3_destructor_type = uintptr /* sqlite3.c:6698:14 */ // The interface to the virtual-table mechanism is currently considered // to be experimental. The interface might change in incompatible ways. @@ -5411,7 +5482,7 @@ type sqlite3_vtab = struct { FnRef int32 _ [4]byte FzErrMsg uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // The interface to the virtual-table mechanism is currently considered // to be experimental. The interface might change in incompatible ways. @@ -5421,7 +5492,7 @@ type sqlite3_vtab = struct { // interface fixed, support it indefinitely, and remove this comment. // Structures used by the virtual table interface -type Sqlite3_vtab = sqlite3_vtab /* sqlite3.c:7737:29 */ +type Sqlite3_vtab = sqlite3_vtab /* sqlite3.c:7817:29 */ type sqlite3_index_info = struct { FnConstraint int32 _ [4]byte @@ -5440,12 +5511,12 @@ type sqlite3_index_info = struct { FidxFlags int32 _ [4]byte FcolUsed Sqlite3_uint64 -} /* sqlite3.c:7738:9 */ +} /* sqlite3.c:7818:9 */ -type Sqlite3_index_info = sqlite3_index_info /* sqlite3.c:7738:35 */ -type sqlite3_vtab_cursor = struct{ FpVtab uintptr } /* sqlite3.c:7739:9 */ +type Sqlite3_index_info = sqlite3_index_info /* sqlite3.c:7818:35 */ +type sqlite3_vtab_cursor = struct{ FpVtab uintptr } /* sqlite3.c:7819:9 */ -type Sqlite3_vtab_cursor = sqlite3_vtab_cursor /* sqlite3.c:7739:36 */ +type Sqlite3_vtab_cursor = sqlite3_vtab_cursor /* sqlite3.c:7819:36 */ type sqlite3_module = struct { FiVersion int32 _ [4]byte @@ -5472,9 +5543,9 @@ type sqlite3_module = struct { FxRelease uintptr FxRollbackTo uintptr FxShadowName uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Sqlite3_module = sqlite3_module /* sqlite3.c:7740:31 */ +type Sqlite3_module = sqlite3_module /* sqlite3.c:7820:31 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -5582,7 +5653,7 @@ type sqlite3_index_constraint = struct { Fusable uint8 _ [2]byte FiTermOffset int32 -} /* sqlite3.c:7738:9 */ +} /* sqlite3.c:7818:9 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -5688,7 +5759,7 @@ type sqlite3_index_orderby = struct { FiColumn int32 Fdesc uint8 _ [3]byte -} /* sqlite3.c:7738:9 */ +} /* sqlite3.c:7818:9 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -5794,7 +5865,7 @@ type sqlite3_index_constraint_usage = struct { FargvIndex int32 Fomit uint8 _ [3]byte -} /* sqlite3.c:7738:9 */ +} /* sqlite3.c:7818:9 */ // CAPI3REF: Mutex Methods Object // @@ -5869,7 +5940,7 @@ type sqlite3_mutex_methods = struct { FxMutexLeave uintptr FxMutexHeld uintptr FxMutexNotheld uintptr -} /* sqlite3.c:8572:9 */ +} /* sqlite3.c:8652:9 */ // CAPI3REF: Mutex Methods Object // @@ -5934,7 +6005,7 @@ type sqlite3_mutex_methods = struct { // called, but only if the prior call to xMutexInit returned SQLITE_OK. // If xMutexInit fails in any way, it is expected to clean up after itself // prior to returning. -type Sqlite3_mutex_methods = sqlite3_mutex_methods /* sqlite3.c:8572:38 */ +type Sqlite3_mutex_methods = sqlite3_mutex_methods /* sqlite3.c:8652:38 */ // CAPI3REF: Dynamic String Object // KEYWORDS: {dynamic string} @@ -5959,7 +6030,7 @@ type sqlite3_str = struct { FaccError U8 FprintfFlags U8 _ [2]byte -} /* sqlite3.c:8832:9 */ +} /* sqlite3.c:8914:9 */ // CAPI3REF: Dynamic String Object // KEYWORDS: {dynamic string} @@ -5975,7 +6046,7 @@ type sqlite3_str = struct { //
  • ^The sqlite3_str object is destroyed and the string it created // is returned using the [sqlite3_str_finish()] interface. // -type Sqlite3_str = sqlite3_str /* sqlite3.c:8832:28 */ +type Sqlite3_str = sqlite3_str /* sqlite3.c:8914:28 */ // CAPI3REF: Custom Page Cache Object // @@ -5988,7 +6059,7 @@ type Sqlite3_str = sqlite3_str /* sqlite3.c:8832:28 */ type sqlite3_pcache_page = struct { FpBuf uintptr FpExtra uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: Custom Page Cache Object // @@ -5998,7 +6069,7 @@ type sqlite3_pcache_page = struct { // of this object as parameters or as their return value. // // See [sqlite3_pcache_methods2] for additional information. -type Sqlite3_pcache_page = sqlite3_pcache_page /* sqlite3.c:9325:36 */ +type Sqlite3_pcache_page = sqlite3_pcache_page /* sqlite3.c:9407:36 */ // CAPI3REF: Application Defined Page Cache. // KEYWORDS: {page cache} @@ -6172,7 +6243,7 @@ type sqlite3_pcache_methods2 = struct { FxTruncate uintptr FxDestroy uintptr FxShrink uintptr -} /* sqlite3.c:9490:9 */ +} /* sqlite3.c:9572:9 */ // CAPI3REF: Application Defined Page Cache. // KEYWORDS: {page cache} @@ -6331,7 +6402,7 @@ type sqlite3_pcache_methods2 = struct { // free up as much of heap memory as possible. The page cache implementation // is not obligated to free any memory, but well-behaved implementations should // do their best. -type Sqlite3_pcache_methods2 = sqlite3_pcache_methods2 /* sqlite3.c:9490:40 */ +type Sqlite3_pcache_methods2 = sqlite3_pcache_methods2 /* sqlite3.c:9572:40 */ // This is the obsolete pcache_methods object that has now been replaced // by sqlite3_pcache_methods2. This object is not used by SQLite. It is @@ -6348,12 +6419,12 @@ type sqlite3_pcache_methods = struct { FxRekey uintptr FxTruncate uintptr FxDestroy uintptr -} /* sqlite3.c:9513:9 */ +} /* sqlite3.c:9595:9 */ // This is the obsolete pcache_methods object that has now been replaced // by sqlite3_pcache_methods2. This object is not used by SQLite. It is // retained in the header file for backwards compatibility only. -type Sqlite3_pcache_methods = sqlite3_pcache_methods /* sqlite3.c:9513:39 */ +type Sqlite3_pcache_methods = sqlite3_pcache_methods /* sqlite3.c:9595:39 */ // CAPI3REF: Online Backup Object // @@ -6377,7 +6448,7 @@ type sqlite3_backup = struct { FnPagecount Pgno FisAttached int32 FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: Online Backup Object // @@ -6387,7 +6458,7 @@ type sqlite3_backup = struct { // [sqlite3_backup_finish()]. // // See Also: [Using the SQLite Online Backup API] -type Sqlite3_backup = sqlite3_backup /* sqlite3.c:9539:31 */ +type Sqlite3_backup = sqlite3_backup /* sqlite3.c:9621:31 */ // CAPI3REF: Database Snapshot // KEYWORDS: {snapshot} {sqlite3_snapshot} @@ -6407,7 +6478,7 @@ type Sqlite3_backup = sqlite3_backup /* sqlite3.c:9539:31 */ // version of the database file so that it is possible to later open a new read // transaction that sees that historical version of the database rather than // the most recent version. -type sqlite3_snapshot = struct{ Fhidden [48]uint8 } /* sqlite3.c:10560:9 */ +type sqlite3_snapshot = struct{ Fhidden [48]uint8 } /* sqlite3.c:10652:9 */ // CAPI3REF: Database Snapshot // KEYWORDS: {snapshot} {sqlite3_snapshot} @@ -6427,7 +6498,7 @@ type sqlite3_snapshot = struct{ Fhidden [48]uint8 } /* sqlite3.c:10560:9 */ // version of the database file so that it is possible to later open a new read // transaction that sees that historical version of the database rather than // the most recent version. -type Sqlite3_snapshot = sqlite3_snapshot /* sqlite3.c:10562:3 */ +type Sqlite3_snapshot = sqlite3_snapshot /* sqlite3.c:10654:3 */ // CAPI3REF: Flags for sqlite3_deserialize() // @@ -6471,7 +6542,7 @@ type sqlite3_rtree_geometry = struct { FaParam uintptr FpUser uintptr FxDelUser uintptr -} /* sqlite3.c:10887:9 */ +} /* sqlite3.c:10979:9 */ // CAPI3REF: Flags for sqlite3_deserialize() // @@ -6508,7 +6579,7 @@ type sqlite3_rtree_geometry = struct { // // -type Sqlite3_rtree_geometry = sqlite3_rtree_geometry /* sqlite3.c:10887:39 */ +type Sqlite3_rtree_geometry = sqlite3_rtree_geometry /* sqlite3.c:10979:39 */ type sqlite3_rtree_query_info = struct { FpContext uintptr FnParam int32 @@ -6528,13 +6599,13 @@ type sqlite3_rtree_query_info = struct { FeWithin int32 FrScore Sqlite3_rtree_dbl FapSqlParam uintptr -} /* sqlite3.c:10888:9 */ +} /* sqlite3.c:10980:9 */ -type Sqlite3_rtree_query_info = sqlite3_rtree_query_info /* sqlite3.c:10888:41 */ +type Sqlite3_rtree_query_info = sqlite3_rtree_query_info /* sqlite3.c:10980:41 */ // The double-precision datatype used by RTree depends on the // SQLITE_RTREE_INT_ONLY compile-time option. -type Sqlite3_rtree_dbl = float64 /* sqlite3.c:10896:18 */ +type Sqlite3_rtree_dbl = float64 /* sqlite3.c:10988:18 */ // Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. @@ -6589,7 +6660,7 @@ type Fts5ExtensionApi1 = struct { FxPhraseNext uintptr FxPhraseFirstColumn uintptr FxPhraseNextColumn uintptr -} /* sqlite3.c:12682:9 */ +} /* sqlite3.c:12787:9 */ // Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. @@ -6622,22 +6693,22 @@ type Fts5ExtensionApi1 = struct { // Virtual table implementations may overload SQL functions by implementing // the sqlite3_module.xFindFunction() method. -type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.c:12682:33 */ +type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.c:12787:33 */ type Fts5PhraseIter1 = struct { Fa uintptr Fb uintptr -} /* sqlite3.c:12684:9 */ +} /* sqlite3.c:12789:9 */ -type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.c:12684:31 */ +type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.c:12789:31 */ -type Fts5_extension_function = uintptr /* sqlite3.c:12686:14 */ +type Fts5_extension_function = uintptr /* sqlite3.c:12791:14 */ type fts5_tokenizer = struct { FxCreate uintptr FxDelete uintptr FxTokenize uintptr -} /* sqlite3.c:13145:9 */ +} /* sqlite3.c:13250:9 */ -type Fts5_tokenizer = fts5_tokenizer /* sqlite3.c:13145:31 */ +type Fts5_tokenizer = fts5_tokenizer /* sqlite3.c:13250:31 */ // Flags that may be passed as the third argument to xTokenize() @@ -6657,7 +6728,7 @@ type fts5_api = struct { FxCreateTokenizer uintptr FxFindTokenizer uintptr FxCreateFunction uintptr -} /* sqlite3.c:13181:9 */ +} /* sqlite3.c:13286:9 */ // Flags that may be passed as the third argument to xTokenize() @@ -6671,7 +6742,7 @@ type fts5_api = struct { // ************************************************************************ // // FTS5 EXTENSION REGISTRATION API -type Fts5_api = fts5_api /* sqlite3.c:13181:25 */ +type Fts5_api = fts5_api /* sqlite3.c:13286:25 */ // // END OF REGISTRATION API @@ -6731,11 +6802,7 @@ type Fts5_api = fts5_api /* sqlite3.c:13181:25 */ // The maximum depth of an expression tree. This is limited to // some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might // want to place more severe limits on the complexity of an -// expression. -// -// A value of 0 used to mean that the limit was not enforced. -// But that is no longer true. The limit is now strictly enforced -// at all times. +// expression. A value of 0 means that there is no limit. // The maximum number of terms in a compound SELECT statement. // The code generator for compound SELECT statements does one @@ -6997,7 +7064,7 @@ type Hash1 = struct { Fcount uint32 Ffirst uintptr Fht uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // // END OF REGISTRATION API @@ -7057,11 +7124,7 @@ type Hash1 = struct { // The maximum depth of an expression tree. This is limited to // some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might // want to place more severe limits on the complexity of an -// expression. -// -// A value of 0 used to mean that the limit was not enforced. -// But that is no longer true. The limit is now strictly enforced -// at all times. +// expression. A value of 0 means that there is no limit. // The maximum number of terms in a compound SELECT statement. // The code generator for compound SELECT statements does one @@ -7318,15 +7381,15 @@ type Hash1 = struct { // used in SQLite. // Forward declarations of structures. -type Hash = Hash1 /* sqlite3.c:13860:21 */ +type Hash = Hash1 /* sqlite3.c:13962:21 */ type HashElem1 = struct { Fnext uintptr Fprev uintptr Fdata uintptr FpKey uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type HashElem = HashElem1 /* sqlite3.c:13861:25 */ +type HashElem = HashElem1 /* sqlite3.c:13963:25 */ // A complete hash table is an instance of the following structure. // The internals of this structure are intended to be opaque -- client @@ -7352,7 +7415,7 @@ type _ht = struct { Fcount uint32 _ [4]byte Fchain uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Wide character type. // Locale-writers should change this as necessary to @@ -7369,31 +7432,6 @@ type _ht = struct { // A null pointer constant. -// Copyright (C) 1989-2018 Free Software Foundation, Inc. -// -// This file is part of GCC. -// -// GCC is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// GCC is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. -// -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -// ISO C Standard: 7.15 Variable arguments - // bits/types.h -- definitions of __*_t types underlying *_t types. // Copyright (C) 2002-2018 Free Software Foundation, Inc. // This file is part of the GNU C Library. @@ -7451,23 +7489,13 @@ type X__uint32_t = uint32 /* types.h:41:22 */ type X__int64_t = int64 /* types.h:43:25 */ type X__uint64_t = uint64 /* types.h:44:27 */ -// Smallest types with at least a given width. -type X__int_least8_t = X__int8_t /* types.h:51:18 */ -type X__uint_least8_t = X__uint8_t /* types.h:52:19 */ -type X__int_least16_t = X__int16_t /* types.h:53:19 */ -type X__uint_least16_t = X__uint16_t /* types.h:54:20 */ -type X__int_least32_t = X__int32_t /* types.h:55:19 */ -type X__uint_least32_t = X__uint32_t /* types.h:56:20 */ -type X__int_least64_t = X__int64_t /* types.h:57:19 */ -type X__uint_least64_t = X__uint64_t /* types.h:58:20 */ - // quad_t is also 64 bits. -type X__quad_t = int64 /* types.h:62:18 */ -type X__u_quad_t = uint64 /* types.h:63:27 */ +type X__quad_t = int64 /* types.h:52:18 */ +type X__u_quad_t = uint64 /* types.h:53:27 */ // Largest integral types. -type X__intmax_t = int64 /* types.h:71:18 */ -type X__uintmax_t = uint64 /* types.h:72:27 */ +type X__intmax_t = int64 /* types.h:61:18 */ +type X__uintmax_t = uint64 /* types.h:62:27 */ // The machine-dependent file defines __*_T_TYPE // macros for each of the OS types we define below. The definitions @@ -7532,173 +7560,76 @@ type X__uintmax_t = uint64 /* types.h:72:27 */ // Number of descriptors that can fit in an `fd_set'. -type X__dev_t = uint64 /* types.h:143:25 */ // Type of device numbers. -type X__uid_t = uint32 /* types.h:144:25 */ // Type of user identifications. -type X__gid_t = uint32 /* types.h:145:25 */ // Type of group identifications. -type X__ino_t = uint64 /* types.h:146:25 */ // Type of file serial numbers. -type X__ino64_t = uint64 /* types.h:147:27 */ // Type of file serial numbers (LFS). -type X__mode_t = uint32 /* types.h:148:26 */ // Type of file attribute bitmasks. -type X__nlink_t = uint64 /* types.h:149:27 */ // Type of file link counts. -type X__off_t = int64 /* types.h:150:25 */ // Type of file sizes and offsets. -type X__off64_t = int64 /* types.h:151:27 */ // Type of file sizes and offsets (LFS). -type X__pid_t = int32 /* types.h:152:25 */ // Type of process identifications. -type X__fsid_t = struct{ F__val [2]int32 } /* types.h:153:26 */ // Type of file system IDs. -type X__clock_t = int64 /* types.h:154:27 */ // Type of CPU usage counts. -type X__rlim_t = uint64 /* types.h:155:26 */ // Type for resource measurement. -type X__rlim64_t = uint64 /* types.h:156:28 */ // Type for resource measurement (LFS). -type X__id_t = uint32 /* types.h:157:24 */ // General type for IDs. -type X__time_t = int64 /* types.h:158:26 */ // Seconds since the Epoch. -type X__useconds_t = uint32 /* types.h:159:30 */ // Count of microseconds. -type X__suseconds_t = int64 /* types.h:160:31 */ // Signed count of microseconds. +type X__dev_t = uint64 /* types.h:133:25 */ // Type of device numbers. +type X__uid_t = uint32 /* types.h:134:25 */ // Type of user identifications. +type X__gid_t = uint32 /* types.h:135:25 */ // Type of group identifications. +type X__ino_t = uint64 /* types.h:136:25 */ // Type of file serial numbers. +type X__ino64_t = uint64 /* types.h:137:27 */ // Type of file serial numbers (LFS). +type X__mode_t = uint32 /* types.h:138:26 */ // Type of file attribute bitmasks. +type X__nlink_t = uint64 /* types.h:139:27 */ // Type of file link counts. +type X__off_t = int64 /* types.h:140:25 */ // Type of file sizes and offsets. +type X__off64_t = int64 /* types.h:141:27 */ // Type of file sizes and offsets (LFS). +type X__pid_t = int32 /* types.h:142:25 */ // Type of process identifications. +type X__fsid_t = struct{ F__val [2]int32 } /* types.h:143:26 */ // Type of file system IDs. +type X__clock_t = int64 /* types.h:144:27 */ // Type of CPU usage counts. +type X__rlim_t = uint64 /* types.h:145:26 */ // Type for resource measurement. +type X__rlim64_t = uint64 /* types.h:146:28 */ // Type for resource measurement (LFS). +type X__id_t = uint32 /* types.h:147:24 */ // General type for IDs. +type X__time_t = int64 /* types.h:148:26 */ // Seconds since the Epoch. +type X__useconds_t = uint32 /* types.h:149:30 */ // Count of microseconds. +type X__suseconds_t = int64 /* types.h:150:31 */ // Signed count of microseconds. -type X__daddr_t = int32 /* types.h:162:27 */ // The type of a disk address. -type X__key_t = int32 /* types.h:163:25 */ // Type of an IPC key. +type X__daddr_t = int32 /* types.h:152:27 */ // The type of a disk address. +type X__key_t = int32 /* types.h:153:25 */ // Type of an IPC key. // Clock ID used in clock and timer functions. -type X__clockid_t = int32 /* types.h:166:29 */ +type X__clockid_t = int32 /* types.h:156:29 */ // Timer ID returned by `timer_create'. -type X__timer_t = uintptr /* types.h:169:12 */ +type X__timer_t = uintptr /* types.h:159:12 */ // Type to represent block size. -type X__blksize_t = int64 /* types.h:172:29 */ +type X__blksize_t = int64 /* types.h:162:29 */ // Types from the Large File Support interface. // Type to count number of disk blocks. -type X__blkcnt_t = int64 /* types.h:177:28 */ -type X__blkcnt64_t = int64 /* types.h:178:30 */ +type X__blkcnt_t = int64 /* types.h:167:28 */ +type X__blkcnt64_t = int64 /* types.h:168:30 */ // Type to count file system blocks. -type X__fsblkcnt_t = uint64 /* types.h:181:30 */ -type X__fsblkcnt64_t = uint64 /* types.h:182:32 */ +type X__fsblkcnt_t = uint64 /* types.h:171:30 */ +type X__fsblkcnt64_t = uint64 /* types.h:172:32 */ // Type to count file system nodes. -type X__fsfilcnt_t = uint64 /* types.h:185:30 */ -type X__fsfilcnt64_t = uint64 /* types.h:186:32 */ +type X__fsfilcnt_t = uint64 /* types.h:175:30 */ +type X__fsfilcnt64_t = uint64 /* types.h:176:32 */ // Type of miscellaneous file system fields. -type X__fsword_t = int64 /* types.h:189:28 */ +type X__fsword_t = int64 /* types.h:179:28 */ -type X__ssize_t = int64 /* types.h:191:27 */ // Type of a byte count, or error. +type X__ssize_t = int64 /* types.h:181:27 */ // Type of a byte count, or error. // Signed long type used in system calls. -type X__syscall_slong_t = int64 /* types.h:194:33 */ +type X__syscall_slong_t = int64 /* types.h:184:33 */ // Unsigned long type used in system calls. -type X__syscall_ulong_t = uint64 /* types.h:196:33 */ +type X__syscall_ulong_t = uint64 /* types.h:186:33 */ // These few don't really vary by system, they always correspond // to one of the other defined types. -type X__loff_t = X__off64_t /* types.h:200:19 */ // Type of file sizes and offsets (LFS). -type X__caddr_t = uintptr /* types.h:201:14 */ +type X__loff_t = X__off64_t /* types.h:190:19 */ // Type of file sizes and offsets (LFS). +type X__caddr_t = uintptr /* types.h:191:14 */ // Duplicates info from stdint.h but this is used in unistd.h. -type X__intptr_t = int64 /* types.h:204:25 */ +type X__intptr_t = int64 /* types.h:194:25 */ // Duplicate info from sys/socket.h. -type X__socklen_t = uint32 /* types.h:207:23 */ +type X__socklen_t = uint32 /* types.h:197:23 */ // C99: An integer type that can be accessed as an atomic entity, // even in the presence of asynchronous interrupts. // It is not currently necessary for this to be machine-specific. -type X__sig_atomic_t = int32 /* types.h:212:13 */ - -// bits/types.h -- definitions of __*_t types underlying *_t types. -// Copyright (C) 2002-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// Never include this file directly; use instead. - -// Integral type unchanged by default argument promotions that can -// hold any value corresponding to members of the extended character -// set, as well as at least one value that does not correspond to any -// member of the extended character set. - -// Conversion state information. -type X__mbstate_t = struct { - F__count int32 - F__value struct{ F__wch uint32 } -} /* __mbstate_t.h:21:3 */ - -// The tag name of this struct is _G_fpos_t to preserve historic -// C++ mangled names for functions taking fpos_t arguments. -// That name should not be used in new code. -type _G_fpos_t = struct { - F__pos X__off_t - F__state X__mbstate_t -} /* __fpos_t.h:10:9 */ - -// The tag name of this struct is _G_fpos_t to preserve historic -// C++ mangled names for functions taking fpos_t arguments. -// That name should not be used in new code. -type X__fpos_t = _G_fpos_t /* __fpos_t.h:14:3 */ - -// bits/types.h -- definitions of __*_t types underlying *_t types. -// Copyright (C) 2002-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// Never include this file directly; use instead. - -// The tag name of this struct is _G_fpos64_t to preserve historic -// C++ mangled names for functions taking fpos_t and/or fpos64_t -// arguments. That name should not be used in new code. -type _G_fpos64_t = struct { - F__pos X__off64_t - F__state X__mbstate_t -} /* __fpos64_t.h:10:9 */ - -// bits/types.h -- definitions of __*_t types underlying *_t types. -// Copyright (C) 2002-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// Never include this file directly; use instead. - -// The tag name of this struct is _G_fpos64_t to preserve historic -// C++ mangled names for functions taking fpos_t and/or fpos64_t -// arguments. That name should not be used in new code. -type X__fpos64_t = _G_fpos64_t /* __fpos64_t.h:14:3 */ +type X__sig_atomic_t = int32 /* types.h:202:13 */ type _IO_FILE = struct { F_flags int32 @@ -7725,10 +7656,10 @@ type _IO_FILE = struct { _ [4]byte F_lock uintptr F_offset X__off64_t - F_codecvt uintptr - F_wide_data uintptr - F_freeres_list uintptr - F_freeres_buf uintptr + F__pad1 uintptr + F__pad2 uintptr + F__pad3 uintptr + F__pad4 uintptr F__pad5 Size_t F_mode int32 F_unused2 [20]int8 @@ -7739,33 +7670,188 @@ type X__FILE = _IO_FILE /* __FILE.h:5:25 */ // The opaque type of streams. This is the definition used elsewhere. type FILE = _IO_FILE /* FILE.h:7:25 */ +// Copyright (C) 1991-2018 Free Software Foundation, Inc. +// This file is part of the GNU C Library. +// Written by Per Bothner . +// +// The GNU C Library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// The GNU C Library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with the GNU C Library; if not, see +// . +// +// As a special exception, if you link the code in this file with +// files compiled with a GNU compiler to produce an executable, +// that does not cause the resulting executable to be covered by +// the GNU Lesser General Public License. This exception does not +// however invalidate any other reasons why the executable file +// might be covered by the GNU Lesser General Public License. +// This exception applies to code released by its copyright holders +// in files containing the exception. + +// This file is needed by libio to define various configuration parameters. +// These are always the same in the GNU C library. + +// Define types for libio in terms of the standard internal type names. + +// bits/types.h -- definitions of __*_t types underlying *_t types. +// Copyright (C) 2002-2018 Free Software Foundation, Inc. +// This file is part of the GNU C Library. +// +// The GNU C Library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// The GNU C Library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with the GNU C Library; if not, see +// . + +// Never include this file directly; use instead. + +// Copyright (C) 1989-2017 Free Software Foundation, Inc. +// +// This file is part of GCC. +// +// GCC is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// GCC is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. +// +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +// ISO C Standard: 7.17 Common definitions + +// Any one of these symbols __need_* means that GNU libc +// wants us just to define one data type. So don't define +// the symbols that indicate this file's entire job has been done. + +// This avoids lossage on SunOS but only if stdtypes.h comes first. +// There's no way to win with the other order! Sun lossage. + +// On 4.3bsd-net2, make sure ansi.h is included, so we have +// one less case to deal with in the following. +// On FreeBSD 5, machine/ansi.h does not exist anymore... + +// In 4.3bsd-net2, machine/ansi.h defines these symbols, which are +// defined if the corresponding type is *not* defined. +// FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_. +// NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_ + +// Sequent's header files use _PTRDIFF_T_ in some conflicting way. +// Just ignore it. + +// On VxWorks, may have defined macros like +// _TYPE_size_t which will typedef size_t. fixincludes patched the +// vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is +// not defined, and so that defining this macro defines _GCC_SIZE_T. +// If we find that the macros are still defined at this point, we must +// invoke them so that the type is defined as expected. + +// In case nobody has defined these types, but we aren't running under +// GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and +// __WCHAR_TYPE__ have reasonable values. This can happen if the +// parts of GCC is compiled by an older compiler, that actually +// include gstddef.h, such as collect2. + +// Signed type of difference of two pointers. + +// Define this type if we are doing the whole job, +// or if we want this type in particular. + +// Unsigned type of `sizeof' something. + +// Define this type if we are doing the whole job, +// or if we want this type in particular. + +// Wide character type. +// Locale-writers should change this as necessary to +// be big enough to hold unique values not between 0 and 127, +// and not (wchar_t) -1, for each defined multibyte character. + +// Define this type if we are doing the whole job, +// or if we want this type in particular. + +// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. +// are already defined. +// BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. +// NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here. + +// A null pointer constant. + +// Integral type unchanged by default argument promotions that can +// hold any value corresponding to members of the extended character +// set, as well as at least one value that does not correspond to any +// member of the extended character set. + +// Conversion state information. +type X__mbstate_t = struct { + F__count int32 + F__value struct{ F__wch uint32 } +} /* __mbstate_t.h:21:3 */ + +type X_G_fpos_t = struct { + F__pos X__off_t + F__state X__mbstate_t +} /* _G_config.h:30:3 */ +type X_G_fpos64_t = struct { + F__pos X__off64_t + F__state X__mbstate_t +} /* _G_config.h:35:3 */ + +// A streammarker remembers a position in a buffer. + +type _IO_marker = struct { + F_next uintptr + F_sbuf uintptr + F_pos int32 + _ [4]byte +} /* __FILE.h:4:1 */ + +type X_IO_FILE = _IO_FILE /* libio.h:314:25 */ + // The structure with the cookie function pointers. -// The tag name of this struct is _IO_cookie_io_functions_t to -// preserve historic C++ mangled names for functions taking -// cookie_io_functions_t arguments. That name should not be used in -// new code. -type _IO_cookie_io_functions_t = struct { +type X_IO_cookie_io_functions_t = struct { Fread uintptr Fwrite uintptr Fseek uintptr Fclose uintptr -} /* cookie_io_functions_t.h:55:9 */ +} /* libio.h:374:3 */ +type Cookie_io_functions_t = X_IO_cookie_io_functions_t /* libio.h:375:35 */ -// The structure with the cookie function pointers. -// The tag name of this struct is _IO_cookie_io_functions_t to -// preserve historic C++ mangled names for functions taking -// cookie_io_functions_t arguments. That name should not be used in -// new code. -type Cookie_io_functions_t = _IO_cookie_io_functions_t /* cookie_io_functions_t.h:61:3 */ +type Off_t = X__off64_t /* stdio.h:59:19 */ +type Off64_t = X__off64_t /* stdio.h:64:19 */ -type Off_t = X__off64_t /* stdio.h:65:19 */ -type Off64_t = X__off64_t /* stdio.h:70:19 */ - -type Ssize_t = X__ssize_t /* stdio.h:77:19 */ +type Ssize_t = X__ssize_t /* stdio.h:71:19 */ // The type of the second argument to `fgetpos' and `fsetpos'. -type Fpos_t = X__fpos64_t /* stdio.h:86:20 */ -type Fpos64_t = X__fpos64_t /* stdio.h:89:20 */ +type Fpos_t = X_G_fpos64_t /* stdio.h:80:21 */ +type Fpos64_t = X_G_fpos64_t /* stdio.h:83:21 */ // In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. // are already defined. @@ -7999,11 +8085,6 @@ type Idtype_t = uint32 /* waitflags.h:57:3 */ // configurations support _Float128x or, as of GCC 7, have compiler // support for a type meeting the requirements for _Float128x. -// Defined to 1 if the corresponding _FloatN type is not binary compatible -// with the corresponding ISO C type in the current compilation unit as -// opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built -// in glibc. - // Defined to 1 if any _FloatN or _FloatNx types that are not // ABI-distinct are however distinct types at the C language level (so // for the purposes of __builtin_types_compatible_p and _Generic). @@ -8161,29 +8242,30 @@ type U_long = X__u_long /* types.h:36:18 */ type Quad_t = X__quad_t /* types.h:37:18 */ type U_quad_t = X__u_quad_t /* types.h:38:20 */ type Fsid_t = X__fsid_t /* types.h:39:18 */ -type Loff_t = X__loff_t /* types.h:42:18 */ -type Ino_t = X__ino64_t /* types.h:49:19 */ -type Ino64_t = X__ino64_t /* types.h:54:19 */ +type Loff_t = X__loff_t /* types.h:44:18 */ -type Dev_t = X__dev_t /* types.h:59:17 */ +type Ino_t = X__ino64_t /* types.h:50:19 */ +type Ino64_t = X__ino64_t /* types.h:55:19 */ -type Gid_t = X__gid_t /* types.h:64:17 */ +type Dev_t = X__dev_t /* types.h:60:17 */ -type Mode_t = X__mode_t /* types.h:69:18 */ +type Gid_t = X__gid_t /* types.h:65:17 */ -type Nlink_t = X__nlink_t /* types.h:74:19 */ +type Mode_t = X__mode_t /* types.h:70:18 */ -type Uid_t = X__uid_t /* types.h:79:17 */ +type Nlink_t = X__nlink_t /* types.h:75:19 */ -type Pid_t = X__pid_t /* types.h:97:17 */ +type Uid_t = X__uid_t /* types.h:80:17 */ -type Id_t = X__id_t /* types.h:103:16 */ +type Pid_t = X__pid_t /* types.h:98:17 */ -type Daddr_t = X__daddr_t /* types.h:114:19 */ -type Caddr_t = X__caddr_t /* types.h:115:19 */ +type Id_t = X__id_t /* types.h:104:16 */ -type Key_t = X__key_t /* types.h:121:17 */ +type Daddr_t = X__daddr_t /* types.h:115:19 */ +type Caddr_t = X__caddr_t /* types.h:116:19 */ + +type Key_t = X__key_t /* types.h:122:17 */ // bits/types.h -- definitions of __*_t types underlying *_t types. // Copyright (C) 2002-2018 Free Software Foundation, Inc. @@ -8277,10 +8359,10 @@ type Time_t = X__time_t /* time_t.h:7:18 */ // Timer ID returned by `timer_create'. type Timer_t = X__timer_t /* timer_t.h:7:19 */ -type Useconds_t = X__useconds_t /* types.h:134:22 */ -type Suseconds_t = X__suseconds_t /* types.h:138:23 */ +type Useconds_t = X__useconds_t /* types.h:135:22 */ +type Suseconds_t = X__suseconds_t /* types.h:139:23 */ -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -8363,9 +8445,9 @@ type Suseconds_t = X__suseconds_t /* types.h:138:23 */ // A null pointer constant. // Old compatibility names for C types. -type Ulong = uint64 /* types.h:148:27 */ -type Ushort = uint16 /* types.h:149:28 */ -type Uint = uint32 /* types.h:150:22 */ +type Ulong = uint64 /* types.h:149:27 */ +type Ushort = uint16 /* types.h:150:28 */ +type Uint = uint32 /* types.h:151:22 */ // These size-specific names are used by some of the inet code. @@ -8414,12 +8496,12 @@ type Int64_t = X__int64_t /* stdint-intn.h:27:19 */ // For GCC 2.7 and later, we can use specific type-size attributes. -type U_int8_t = uint32 /* types.h:177:1 */ -type U_int16_t = uint32 /* types.h:178:1 */ -type U_int32_t = uint32 /* types.h:179:1 */ -type U_int64_t = uint32 /* types.h:180:1 */ +type U_int8_t = uint32 /* types.h:178:1 */ +type U_int16_t = uint32 /* types.h:179:1 */ +type U_int32_t = uint32 /* types.h:180:1 */ +type U_int64_t = uint32 /* types.h:181:1 */ -type Register_t = int32 /* types.h:182:13 */ +type Register_t = int32 /* types.h:183:13 */ // It also defines `fd_set' and the FD_* macros for `select'. // `fd_set' type and related macros, and `select'/`pselect' declarations. @@ -8581,18 +8663,16 @@ type Fd_set = struct{ Ffds_bits [16]X__fd_mask } /* select.h:70:5 */ // Sometimes the fd_set member is assumed to have this type. type Fd_mask = X__fd_mask /* select.h:77:19 */ -// Define some inlines helping to catch common problems. - -type Blksize_t = X__blksize_t /* types.h:202:21 */ +type Blksize_t = X__blksize_t /* types.h:212:21 */ // Types from the Large File Support interface. -type Blkcnt_t = X__blkcnt64_t /* types.h:222:22 */ // Type to count number of disk blocks. -type Fsblkcnt_t = X__fsblkcnt64_t /* types.h:226:24 */ // Type to count file system blocks. -type Fsfilcnt_t = X__fsfilcnt64_t /* types.h:230:24 */ // Type to count file system inodes. +type Blkcnt_t = X__blkcnt64_t /* types.h:232:22 */ // Type to count number of disk blocks. +type Fsblkcnt_t = X__fsblkcnt64_t /* types.h:236:24 */ // Type to count file system blocks. +type Fsfilcnt_t = X__fsfilcnt64_t /* types.h:240:24 */ // Type to count file system inodes. -type Blkcnt64_t = X__blkcnt64_t /* types.h:236:22 */ // Type to count number of disk blocks. -type Fsblkcnt64_t = X__fsblkcnt64_t /* types.h:237:24 */ // Type to count file system blocks. -type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:238:24 */ // Type to count file system inodes. +type Blkcnt64_t = X__blkcnt64_t /* types.h:246:22 */ // Type to count number of disk blocks. +type Fsblkcnt64_t = X__fsblkcnt64_t /* types.h:247:24 */ // Type to count file system blocks. +type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:248:24 */ // Type to count file system inodes. // Now add the thread types. // Declaration of common pthread types for all architectures. @@ -8942,13 +9022,13 @@ type Max_align_t = struct { // types can be conveniently redefined at compile-type. Like this: // // cc '-DUINTPTR_TYPE=long long int' ... -type I64 = Sqlite_int64 /* sqlite3.c:14329:22 */ // 8-byte signed integer -type U64 = Sqlite_uint64 /* sqlite3.c:14330:23 */ // 8-byte unsigned integer -type U32 = uint32 /* sqlite3.c:14331:21 */ // 4-byte unsigned integer -type U16 = uint16 /* sqlite3.c:14332:21 */ // 2-byte unsigned integer -type I16 = int16 /* sqlite3.c:14333:20 */ // 2-byte signed integer -type U8 = uint8 /* sqlite3.c:14334:20 */ // 1-byte unsigned integer -type I8 = int8 /* sqlite3.c:14335:19 */ // 1-byte signed integer +type I64 = Sqlite_int64 /* sqlite3.c:14433:22 */ // 8-byte signed integer +type U64 = Sqlite_uint64 /* sqlite3.c:14434:23 */ // 8-byte unsigned integer +type U32 = uint32 /* sqlite3.c:14435:21 */ // 4-byte unsigned integer +type U16 = uint16 /* sqlite3.c:14436:21 */ // 2-byte unsigned integer +type I16 = int16 /* sqlite3.c:14437:20 */ // 2-byte signed integer +type U8 = uint8 /* sqlite3.c:14438:20 */ // 1-byte unsigned integer +type I8 = int8 /* sqlite3.c:14439:19 */ // 1-byte signed integer // SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value // that can be stored in a u32 without loss of data. The value @@ -8959,7 +9039,7 @@ type I8 = int8 /* sqlite3.c:14335:19 */ // 1-byte signed integer // table or index. This is an unsigned integer type. For 99.9% of // the world, a 32-bit integer is sufficient. But a 64-bit integer // can be used at compile-time if desired. -type TRowcnt = U32 /* sqlite3.c:14354:14 */ // 32-bit is the default +type TRowcnt = U32 /* sqlite3.c:14458:14 */ // 32-bit is the default // Estimated quantities used for query planning are stored as 16-bit // logarithms. For quantity X, the value stored is 10*log2(X). This @@ -8982,55 +9062,12 @@ type TRowcnt = U32 /* sqlite3.c:14354:14 */ // 32-bit is the default // Examples: // // 0.5 -> -10 0.1 -> -33 0.0625 -> -40 -type LogEst = int16 /* sqlite3.c:14380:20 */ +type LogEst = int16 /* sqlite3.c:14484:20 */ // Set the SQLITE_PTRSIZE macro to the number of bytes in a pointer // The uptr type is an unsigned integer large enough to hold a pointer -type Uptr = U64 /* sqlite3.c:14404:15 */ - -// The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to -// something between S (inclusive) and E (exclusive). -// -// In other words, S is a buffer and E is a pointer to the first byte after -// the end of buffer S. This macro returns true if P points to something -// contained within the buffer S. - -// Macros to determine whether the machine is big or little endian, -// and whether or not that determination is run-time or compile-time. -// -// For best performance, an attempt is made to guess at the byte-order -// using C-preprocessor macros. If that is unsuccessful, or if -// -DSQLITE_BYTEORDER=0 is set, then byte-order is determined -// at run-time. - -// Constants for the largest and smallest possible 64-bit signed integers. -// These macros are designed to work correctly on both 32-bit and 64-bit -// compilers. - -// Round up a number to the next larger multiple of 8. This is used -// to force 8-byte alignment on 64-bit architectures. - -// Round down to the nearest multiple of 8 - -// Assert that the pointer X is aligned to an 8-byte boundary. This -// macro is used only within assert() to verify that the code gets -// all alignment restrictions correct. -// -// Except, if SQLITE_4_BYTE_ALIGNED_MALLOC is defined, then the -// underlying malloc() implementation might return us 4-byte aligned -// pointers. In that case, only verify 4-byte alignment. - -// Disable MMAP on platforms where it is known to not work - -// Default maximum size of memory used by memory-mapped I/O in the VFS - -// The default MMAP_SIZE is zero on all platforms. Or, even if a larger -// default MMAP_SIZE is specified at compile-time, make sure that it does -// not exceed the maximum mmap size. - -// SELECTTRACE_ENABLED will be either 1 or 0 depending on whether or not -// the Select query generator tracing logic is turned on. +type Uptr = U64 /* sqlite3.c:14508:15 */ // An instance of the following structure is used to store the busy-handler // callback for a given sqlite handle. @@ -9044,50 +9081,7 @@ type BusyHandler1 = struct { FpBusyArg uintptr FnBusy int32 _ [4]byte -} /* sqlite3.c:1297:9 */ - -// The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to -// something between S (inclusive) and E (exclusive). -// -// In other words, S is a buffer and E is a pointer to the first byte after -// the end of buffer S. This macro returns true if P points to something -// contained within the buffer S. - -// Macros to determine whether the machine is big or little endian, -// and whether or not that determination is run-time or compile-time. -// -// For best performance, an attempt is made to guess at the byte-order -// using C-preprocessor macros. If that is unsuccessful, or if -// -DSQLITE_BYTEORDER=0 is set, then byte-order is determined -// at run-time. - -// Constants for the largest and smallest possible 64-bit signed integers. -// These macros are designed to work correctly on both 32-bit and 64-bit -// compilers. - -// Round up a number to the next larger multiple of 8. This is used -// to force 8-byte alignment on 64-bit architectures. - -// Round down to the nearest multiple of 8 - -// Assert that the pointer X is aligned to an 8-byte boundary. This -// macro is used only within assert() to verify that the code gets -// all alignment restrictions correct. -// -// Except, if SQLITE_4_BYTE_ALIGNED_MALLOC is defined, then the -// underlying malloc() implementation might return us 4-byte aligned -// pointers. In that case, only verify 4-byte alignment. - -// Disable MMAP on platforms where it is known to not work - -// Default maximum size of memory used by memory-mapped I/O in the VFS - -// The default MMAP_SIZE is zero on all platforms. Or, even if a larger -// default MMAP_SIZE is specified at compile-time, make sure that it does -// not exceed the maximum mmap size. - -// SELECTTRACE_ENABLED will be either 1 or 0 depending on whether or not -// the Select query generator tracing logic is turned on. +} /* sqlite3.c:1312:9 */ // An instance of the following structure is used to store the busy-handler // callback for a given sqlite handle. @@ -9096,7 +9090,7 @@ type BusyHandler1 = struct { // callback for the database handle. Each pager opened via the sqlite // handle is passed a pointer to sqlite.busyHandler. The busy-handler // callback is currently invoked only from within pager.c. -type BusyHandler = BusyHandler1 /* sqlite3.c:14563:28 */ +type BusyHandler = BusyHandler1 /* sqlite3.c:14679:28 */ // Name of table that holds the database schema. @@ -9161,8 +9155,7 @@ type AggInfo1 = struct { FaFunc uintptr FnFunc int32 FselId U32 - FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Name of table that holds the database schema. @@ -9211,21 +9204,21 @@ type AggInfo1 = struct { // cases the parameters are named as per the usual conventions. // Forward references to structures -type AggInfo = AggInfo1 /* sqlite3.c:14659:24 */ +type AggInfo = AggInfo1 /* sqlite3.c:14775:24 */ type AuthContext1 = struct { FzAuthContext uintptr FpParse uintptr -} /* sqlite3.c:14660:9 */ +} /* sqlite3.c:14776:9 */ -type AuthContext = AuthContext1 /* sqlite3.c:14660:28 */ +type AuthContext = AuthContext1 /* sqlite3.c:14776:28 */ type AutoincInfo1 = struct { FpNext uintptr FpTab uintptr FiDb int32 FregCtr int32 -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type AutoincInfo = AutoincInfo1 /* sqlite3.c:14661:28 */ +type AutoincInfo = AutoincInfo1 /* sqlite3.c:14777:28 */ type Bitvec1 = struct { FiSize U32 FnSet U32 @@ -9235,9 +9228,9 @@ type Bitvec1 = struct { _ [0]uint64 FaBitmap [496]U8 } -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Bitvec = Bitvec1 /* sqlite3.c:14662:23 */ +type Bitvec = Bitvec1 /* sqlite3.c:14778:23 */ type CollSeq1 = struct { FzName uintptr Fenc U8 @@ -9245,9 +9238,9 @@ type CollSeq1 = struct { FpUser uintptr FxCmp uintptr FxDel uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type CollSeq = CollSeq1 /* sqlite3.c:14663:24 */ +type CollSeq = CollSeq1 /* sqlite3.c:14779:24 */ type Column1 = struct { FzName uintptr FpDflt uintptr @@ -9258,9 +9251,31 @@ type Column1 = struct { FhName U8 FcolFlags U16 _ [2]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Column = Column1 /* sqlite3.c:14664:23 */ +type Column = Column1 /* sqlite3.c:14780:23 */ +type Cte1 = struct { + FzName uintptr + FpCols uintptr + FpSelect uintptr + FzCteErr uintptr + FpUse uintptr + FeM10d U8 + _ [7]byte +} /* sqlite3.c:1312:9 */ + +type Cte = Cte1 /* sqlite3.c:14781:20 */ +type CteUse1 = struct { + FnUse int32 + FaddrM9e int32 + FregRtn int32 + FiCur int32 + FnRowEst LogEst + FeM10d U8 + _ [1]byte +} /* sqlite3.c:1312:9 */ + +type CteUse = CteUse1 /* sqlite3.c:14782:23 */ type Db1 = struct { FzDbSName uintptr FpBt uintptr @@ -9268,9 +9283,21 @@ type Db1 = struct { FbSyncSet U8 _ [6]byte FpSchema uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Db = Db1 /* sqlite3.c:14665:19 */ +type Db = Db1 /* sqlite3.c:14783:19 */ +type DbFixer1 = struct { + FpParse uintptr + Fw Walker + FpSchema uintptr + FbTemp U8 + _ [7]byte + FzDb uintptr + FzType uintptr + FpName uintptr +} /* sqlite3.c:14784:9 */ + +type DbFixer = DbFixer1 /* sqlite3.c:14784:24 */ type Schema1 = struct { Fschema_cookie int32 FiGeneration int32 @@ -9283,9 +9310,9 @@ type Schema1 = struct { Fenc U8 FschemaFlags U16 Fcache_size int32 -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Schema = Schema1 /* sqlite3.c:14666:23 */ +type Schema = Schema1 /* sqlite3.c:14785:23 */ type Expr1 = struct { Fop U8 FaffExpr int8 @@ -9300,13 +9327,12 @@ type Expr1 = struct { FiTable int32 FiColumn YnVar FiAgg I16 - FiRightJoinTable I16 - _ [2]byte + FiRightJoinTable int32 FpAggInfo uintptr Fy struct{ FpTab uintptr } -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Expr = Expr1 /* sqlite3.c:14667:21 */ +type Expr = Expr1 /* sqlite3.c:14786:21 */ type ExprList1 = struct { FnExpr int32 _ [4]byte @@ -9326,9 +9352,9 @@ type ExprList1 = struct { } _ [4]byte } -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type ExprList = ExprList1 /* sqlite3.c:14668:25 */ +type ExprList = ExprList1 /* sqlite3.c:14787:25 */ type FKey1 = struct { FpFrom uintptr FpNextFrom uintptr @@ -9345,17 +9371,17 @@ type FKey1 = struct { _ [4]byte FzCol uintptr } -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type FKey = FKey1 /* sqlite3.c:14669:21 */ +type FKey = FKey1 /* sqlite3.c:14788:21 */ type FuncDestructor1 = struct { FnRef int32 _ [4]byte FxDestroy uintptr FpUserData uintptr -} /* sqlite3.c:14670:9 */ +} /* sqlite3.c:14789:9 */ -type FuncDestructor = FuncDestructor1 /* sqlite3.c:14670:31 */ +type FuncDestructor = FuncDestructor1 /* sqlite3.c:14789:31 */ type FuncDef1 = struct { FnArg I8 _ [3]byte @@ -9368,19 +9394,19 @@ type FuncDef1 = struct { FxInverse uintptr FzName uintptr Fu struct{ FpHash uintptr } -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type FuncDef = FuncDef1 /* sqlite3.c:14671:24 */ -type FuncDefHash1 = struct{ Fa [23]uintptr } /* sqlite3.c:14672:9 */ +type FuncDef = FuncDef1 /* sqlite3.c:14790:24 */ +type FuncDefHash1 = struct{ Fa [23]uintptr } /* sqlite3.c:14791:9 */ -type FuncDefHash = FuncDefHash1 /* sqlite3.c:14672:28 */ +type FuncDefHash = FuncDefHash1 /* sqlite3.c:14791:28 */ type IdList1 = struct { Fa uintptr FnId int32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type IdList = IdList1 /* sqlite3.c:14673:23 */ +type IdList = IdList1 /* sqlite3.c:14792:23 */ type Index1 = struct { FzName uintptr FaiColumn uintptr @@ -9409,9 +9435,9 @@ type Index1 = struct { FnRowEst0 TRowcnt _ [4]byte FcolNotIdxed Bitmask -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Index = Index1 /* sqlite3.c:14674:22 */ +type Index = Index1 /* sqlite3.c:14793:22 */ type IndexSample1 = struct { Fp uintptr Fn int32 @@ -9419,9 +9445,9 @@ type IndexSample1 = struct { FanEq uintptr FanLt uintptr FanDLt uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type IndexSample = IndexSample1 /* sqlite3.c:14675:28 */ +type IndexSample = IndexSample1 /* sqlite3.c:14794:28 */ type KeyInfo1 = struct { FnRef U32 Fenc U8 @@ -9432,9 +9458,9 @@ type KeyInfo1 = struct { Fdb uintptr FaSortFlags uintptr FaColl [1]uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type KeyInfo = KeyInfo1 /* sqlite3.c:14677:24 */ +type KeyInfo = KeyInfo1 /* sqlite3.c:14796:24 */ type Lookaside1 = struct { FbDisable U32 Fsz U16 @@ -9451,12 +9477,12 @@ type Lookaside1 = struct { FpMiddle uintptr FpStart uintptr FpEnd uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Lookaside = Lookaside1 /* sqlite3.c:14678:26 */ -type LookasideSlot1 = struct{ FpNext uintptr } /* sqlite3.c:1297:9 */ +type Lookaside = Lookaside1 /* sqlite3.c:14797:26 */ +type LookasideSlot1 = struct{ FpNext uintptr } /* sqlite3.c:1312:9 */ -type LookasideSlot = LookasideSlot1 /* sqlite3.c:14679:30 */ +type LookasideSlot = LookasideSlot1 /* sqlite3.c:14798:30 */ type Module1 = struct { FpModule uintptr FzName uintptr @@ -9465,9 +9491,9 @@ type Module1 = struct { FpAux uintptr FxDestroy uintptr FpEpoTab uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Module = Module1 /* sqlite3.c:14680:23 */ +type Module = Module1 /* sqlite3.c:14799:23 */ type NameContext1 = struct { FpParse uintptr FpSrcList uintptr @@ -9478,9 +9504,9 @@ type NameContext1 = struct { FncFlags int32 _ [4]byte FpWinSelect uintptr -} /* sqlite3.c:14681:9 */ +} /* sqlite3.c:14800:9 */ -type NameContext = NameContext1 /* sqlite3.c:14681:28 */ +type NameContext = NameContext1 /* sqlite3.c:14800:28 */ type Parse1 = struct { Fdb uintptr FzErrMsg uintptr @@ -9523,45 +9549,53 @@ type Parse1 = struct { FpToplevel uintptr FpTriggerTab uintptr FpParentParse uintptr - FpAggList uintptr - FaddrCrTab int32 - FnQueryLoop U32 - Foldmask U32 - Fnewmask U32 - FeTriggerOp U8 - FeOrconf U8 - FdisableTriggers U8 - _ [1]byte - FaTempReg [8]int32 - _ [4]byte - FsNameToken Token - FsLastToken Token - FnVar YnVar - FiPkSortOrder U8 - Fexplain U8 - FeParseMode U8 - _ [3]byte - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - _ [4]byte - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg Token - FapVtabLock uintptr - FpZombieTab uintptr - FpTriggerPrg uintptr - FpWith uintptr - FpWithToFree uintptr - FpRename uintptr -} /* sqlite3.c:1297:9 */ + Fu1 struct { + _ [0]uint64 + FaddrCrTab int32 + _ [4]byte + } + FnQueryLoop U32 + Foldmask U32 + Fnewmask U32 + FeTriggerOp U8 + FbReturning U8 + FeOrconf U8 + FdisableTriggers U8 + FaTempReg [8]int32 + FsNameToken Token + FsLastToken Token + FnVar YnVar + FiPkSortOrder U8 + Fexplain U8 + FeParseMode U8 + _ [3]byte + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + _ [4]byte + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg Token + FapVtabLock uintptr + FpTriggerPrg uintptr + FpWith uintptr + FpCleanup uintptr + FpRename uintptr +} /* sqlite3.c:1312:9 */ -type Parse = Parse1 /* sqlite3.c:14682:22 */ +type Parse = Parse1 /* sqlite3.c:14801:22 */ +type ParseCleanup1 = struct { + FpNext uintptr + FpPtr uintptr + FxCleanup uintptr +} /* sqlite3.c:1312:9 */ + +type ParseCleanup = ParseCleanup1 /* sqlite3.c:14802:29 */ type PreUpdate1 = struct { Fv uintptr FpCsr uintptr @@ -9578,23 +9612,35 @@ type PreUpdate1 = struct { FaNew uintptr FpTab uintptr FpPk uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type PreUpdate = PreUpdate1 /* sqlite3.c:14683:26 */ +type PreUpdate = PreUpdate1 /* sqlite3.c:14803:26 */ type PrintfArguments1 = struct { FnArg int32 FnUsed int32 FapArg uintptr -} /* sqlite3.c:14684:9 */ +} /* sqlite3.c:14804:9 */ -type PrintfArguments = PrintfArguments1 /* sqlite3.c:14684:32 */ +type PrintfArguments = PrintfArguments1 /* sqlite3.c:14804:32 */ type RenameToken1 = struct { Fp uintptr Ft Token FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type RenameToken = RenameToken1 /* sqlite3.c:14685:28 */ +type RenameToken = RenameToken1 /* sqlite3.c:14805:28 */ +type Returning1 = struct { + FpParse uintptr + FpReturnEL uintptr + FretTrig Trigger + FretTStep TriggerStep + FiRetCur int32 + FnRetCol int32 + FiRetReg int32 + _ [4]byte +} /* sqlite3.c:14806:9 */ + +type Returning = Returning1 /* sqlite3.c:14806:26 */ type RowSet1 = struct { FpChunk uintptr Fdb uintptr @@ -9605,17 +9651,17 @@ type RowSet1 = struct { FnFresh U16 FrsFlags U16 FiBatch int32 -} /* sqlite3.c:14686:9 */ +} /* sqlite3.c:14807:9 */ -type RowSet = RowSet1 /* sqlite3.c:14686:23 */ +type RowSet = RowSet1 /* sqlite3.c:14807:23 */ type Savepoint1 = struct { FzName uintptr FnDeferredCons I64 FnDeferredImmCons I64 FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Savepoint = Savepoint1 /* sqlite3.c:14687:26 */ +type Savepoint = Savepoint1 /* sqlite3.c:14808:26 */ type Select1 = struct { Fop U8 _ [1]byte @@ -9638,16 +9684,16 @@ type Select1 = struct { FpWith uintptr FpWin uintptr FpWinDefn uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Select = Select1 /* sqlite3.c:14688:23 */ +type Select = Select1 /* sqlite3.c:14809:23 */ type SQLiteThread1 = struct { FxTask uintptr FpIn uintptr FpResult uintptr -} /* sqlite3.c:14689:9 */ +} /* sqlite3.c:14810:9 */ -type SQLiteThread = SQLiteThread1 /* sqlite3.c:14689:29 */ +type SQLiteThread = SQLiteThread1 /* sqlite3.c:14810:29 */ type SelectDest1 = struct { FeDest U8 _ [3]byte @@ -9658,40 +9704,43 @@ type SelectDest1 = struct { _ [4]byte FzAffSdst uintptr FpOrderBy uintptr -} /* sqlite3.c:14690:9 */ +} /* sqlite3.c:14811:9 */ -type SelectDest = SelectDest1 /* sqlite3.c:14690:27 */ +type SelectDest = SelectDest1 /* sqlite3.c:14811:27 */ +type SrcItem1 = struct { + FpSchema uintptr + FzDatabase uintptr + FzName uintptr + FzAlias uintptr + FpTab uintptr + FpSelect uintptr + FaddrFillSub int32 + FregReturn int32 + FregResult int32 + Ffg struct { + _ [0]uint32 + Fjointype U8 + _ [3]byte + FnotIndexed uint8 /* unsigned notIndexed: 1, unsigned isIndexedBy: 1, unsigned isTabFunc: 1, unsigned isCorrelated: 1, unsigned viaCoroutine: 1, unsigned isRecursive: 1, unsigned fromDDL: 1, unsigned isCte: 1 */ + _ [3]byte + } + FiCursor int32 + FpOn uintptr + FpUsing uintptr + FcolUsed Bitmask + Fu1 struct{ FzIndexedBy uintptr } + Fu2 struct{ FpIBIndex uintptr } +} /* sqlite3.c:1312:9 */ + +type SrcItem = SrcItem1 /* sqlite3.c:14812:24 */ type SrcList1 = struct { FnSrc int32 FnAlloc U32 - Fa [1]struct { - FpSchema uintptr - FzDatabase uintptr - FzName uintptr - FzAlias uintptr - FpTab uintptr - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 - Ffg struct { - _ [0]uint32 - Fjointype U8 - _ [3]byte - FnotIndexed uint8 /* unsigned notIndexed: 1, unsigned isIndexedBy: 1, unsigned isTabFunc: 1, unsigned isCorrelated: 1, unsigned viaCoroutine: 1, unsigned isRecursive: 1, unsigned fromDDL: 1 */ - _ [3]byte - } - FiCursor int32 - FpOn uintptr - FpUsing uintptr - FcolUsed Bitmask - Fu1 struct{ FzIndexedBy uintptr } - FpIBIndex uintptr - } -} /* sqlite3.c:1297:9 */ + Fa [1]SrcItem +} /* sqlite3.c:1312:9 */ -type SrcList = SrcList1 /* sqlite3.c:14691:24 */ -type StrAccum = sqlite3_str /* sqlite3.c:14692:28 */ // Internal alias for sqlite3_str +type SrcList = SrcList1 /* sqlite3.c:14813:24 */ +type StrAccum = sqlite3_str /* sqlite3.c:14814:28 */ // Internal alias for sqlite3_str type Table1 = struct { FzName uintptr FaCol uintptr @@ -9716,42 +9765,42 @@ type Table1 = struct { FpVTable uintptr FpTrigger uintptr FpSchema uintptr - FpNextZombie uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Internal alias for sqlite3_str -type Table = Table1 /* sqlite3.c:14693:22 */ +type Table = Table1 /* sqlite3.c:14815:22 */ type TableLock1 = struct { FiDb int32 FiTab Pgno FisWriteLock U8 _ [7]byte FzLockName uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type TableLock = TableLock1 /* sqlite3.c:14694:26 */ +type TableLock = TableLock1 /* sqlite3.c:14816:26 */ type Token1 = struct { Fz uintptr Fn uint32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Token = Token1 /* sqlite3.c:14695:22 */ +type Token = Token1 /* sqlite3.c:14817:22 */ type Trigger1 = struct { FzName uintptr Ftable uintptr Fop U8 Ftr_tm U8 - _ [6]byte + FbReturning U8 + _ [5]byte FpWhen uintptr FpColumns uintptr FpSchema uintptr FpTabSchema uintptr Fstep_list uintptr FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Trigger = Trigger1 /* sqlite3.c:14697:24 */ +type Trigger = Trigger1 /* sqlite3.c:14819:24 */ type TriggerPrg1 = struct { FpTrigger uintptr FpNext uintptr @@ -9759,9 +9808,9 @@ type TriggerPrg1 = struct { Forconf int32 FaColmask [2]U32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type TriggerPrg = TriggerPrg1 /* sqlite3.c:14698:27 */ +type TriggerPrg = TriggerPrg1 /* sqlite3.c:14820:27 */ type TriggerStep1 = struct { Fop U8 Forconf U8 @@ -9777,9 +9826,9 @@ type TriggerStep1 = struct { FzSpan uintptr FpNext uintptr FpLast uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type TriggerStep = TriggerStep1 /* sqlite3.c:14699:28 */ +type TriggerStep = TriggerStep1 /* sqlite3.c:14821:28 */ type UnpackedRecord1 = struct { FpKeyInfo uintptr FaMem uintptr @@ -9790,23 +9839,27 @@ type UnpackedRecord1 = struct { Fr2 I8 FeqSeen U8 _ [1]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type UnpackedRecord = UnpackedRecord1 /* sqlite3.c:14700:31 */ +type UnpackedRecord = UnpackedRecord1 /* sqlite3.c:14822:31 */ type Upsert1 = struct { FpUpsertTarget uintptr FpUpsertTargetWhere uintptr FpUpsertSet uintptr FpUpsertWhere uintptr + FpNextUpsert uintptr + FisDoUpdate U8 + _ [7]byte + FpToFree uintptr FpUpsertIdx uintptr FpUpsertSrc uintptr FregData int32 FiDataCur int32 FiIdxCur int32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Upsert = Upsert1 /* sqlite3.c:14701:23 */ +type Upsert = Upsert1 /* sqlite3.c:14823:23 */ type VTable1 = struct { Fdb uintptr FpMod uintptr @@ -9818,18 +9871,18 @@ type VTable1 = struct { FiSavepoint int32 _ [4]byte FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type VTable = VTable1 /* sqlite3.c:14702:23 */ +type VTable = VTable1 /* sqlite3.c:14824:23 */ type VtabCtx1 = struct { FpVTable uintptr FpTab uintptr FpPrior uintptr FbDeclared int32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type VtabCtx = VtabCtx1 /* sqlite3.c:14703:24 */ +type VtabCtx = VtabCtx1 /* sqlite3.c:14825:24 */ type Walker1 = struct { FpParse uintptr FxExprCallback uintptr @@ -9839,9 +9892,9 @@ type Walker1 = struct { FeCode U16 _ [2]byte Fu struct{ FpNC uintptr } -} /* sqlite3.c:14704:9 */ +} /* sqlite3.c:14784:9 */ -type Walker = Walker1 /* sqlite3.c:14704:23 */ +type Walker = Walker1 /* sqlite3.c:14826:23 */ type WhereInfo1 = struct { FpParse uintptr FpTabList uintptr @@ -9862,16 +9915,16 @@ type WhereInfo1 = struct { _ [1]byte FnRowOut LogEst FiTop int32 - _ [4]byte + FiEndWhere int32 FpLoops uintptr FpExprMods uintptr FrevMask Bitmask FsWC WhereClause FsMaskSet WhereMaskSet Fa [1]WhereLevel -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ -type WhereInfo = WhereInfo1 /* sqlite3.c:14705:26 */ +type WhereInfo = WhereInfo1 /* sqlite3.c:14827:26 */ type Window1 = struct { FzName uintptr FzBase uintptr @@ -9903,29 +9956,24 @@ type Window1 = struct { FregEndRowid int32 FbExprArgs U8 _ [3]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Window = Window1 /* sqlite3.c:14706:23 */ +type Window = Window1 /* sqlite3.c:14828:23 */ type With1 = struct { FnCte int32 _ [4]byte FpOuter uintptr - Fa [1]struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - } -} /* sqlite3.c:1297:9 */ + Fa [1]Cte +} /* sqlite3.c:1312:9 */ -type With = With1 /* sqlite3.c:14707:21 */ +type With = With1 /* sqlite3.c:14829:21 */ // The bitmask datatype defined below is used for various optimizations. // // Changing this from a 64-bit to a 32-bit type limits the number of // tables in a join to 32 instead of 64. But it also reduces the size // of the library by 738 bytes on ix86. -type Bitmask = U64 /* sqlite3.c:14720:15 */ +type Bitmask = U64 /* sqlite3.c:14842:15 */ // The number of bits in a Bitmask. "BMS" means "BitMask Size". @@ -9936,7 +9984,7 @@ type Bitmask = U64 /* sqlite3.c:14720:15 */ // variable number associated with that parameter. See the format description // on the sqlite3VListAdd() routine for more information. A VList is really // just an array of integers. -type VList = int32 /* sqlite3.c:14742:13 */ +type VList = int32 /* sqlite3.c:14864:13 */ // Defer sourcing vdbe.h and btree.h until after the "u8" and // "BusyHandler" typedefs. vdbe.h also requires a few of the opaque @@ -9963,7 +10011,7 @@ type VList = int32 /* sqlite3.c:14742:13 */ // The type used to represent a page number. The first page in a file // is called page 1. 0 is used to represent "not a page". -type Pgno = U32 /* sqlite3.c:14783:13 */ +type Pgno = U32 /* sqlite3.c:14905:13 */ // Each open file is managed by a separate instance of the "Pager" structure. type Pager1 = struct { @@ -10031,10 +10079,10 @@ type Pager1 = struct { FpPCache uintptr FpWal uintptr FzWal uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Each open file is managed by a separate instance of the "Pager" structure. -type Pager = Pager1 /* sqlite3.c:14788:22 */ +type Pager = Pager1 /* sqlite3.c:14910:22 */ // Handle type for pages. type PgHdr2 = struct { @@ -10049,10 +10097,10 @@ type PgHdr2 = struct { FnRef I16 FpDirtyNext uintptr FpDirtyPrev uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Handle type for pages. -type DbPage = PgHdr2 /* sqlite3.c:14793:22 */ +type DbPage = PgHdr2 /* sqlite3.c:14915:22 */ // Functions to support testing and debugging. @@ -10094,7 +10142,7 @@ type Btree1 = struct { FpNext uintptr FpPrev uintptr Flock BtLock -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Functions to support testing and debugging. @@ -10123,7 +10171,7 @@ type Btree1 = struct { // it must be turned on for each database using "PRAGMA auto_vacuum = 1". // Forward declarations of structure -type Btree = Btree1 /* sqlite3.c:15036:22 */ +type Btree = Btree1 /* sqlite3.c:15158:22 */ type BtCursor1 = struct { FeState U8 FcurFlags U8 @@ -10146,9 +10194,9 @@ type BtCursor1 = struct { FpKeyInfo uintptr FpPage uintptr FapPage [19]uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type BtCursor = BtCursor1 /* sqlite3.c:15037:25 */ +type BtCursor = BtCursor1 /* sqlite3.c:15159:25 */ type BtShared1 = struct { FpPager uintptr Fdb uintptr @@ -10183,9 +10231,11 @@ type BtShared1 = struct { FpLock uintptr FpWriter uintptr FpTmpSpace uintptr -} /* sqlite3.c:1297:9 */ + FnPreformatSize int32 + _ [4]byte +} /* sqlite3.c:1312:9 */ -type BtShared = BtShared1 /* sqlite3.c:15038:25 */ +type BtShared = BtShared1 /* sqlite3.c:15160:25 */ type BtreePayload1 = struct { FpKey uintptr FnKey Sqlite3_int64 @@ -10196,9 +10246,9 @@ type BtreePayload1 = struct { FnData int32 FnZero int32 _ [4]byte -} /* sqlite3.c:15039:9 */ +} /* sqlite3.c:15161:9 */ -type BtreePayload = BtreePayload1 /* sqlite3.c:15039:29 */ +type BtreePayload = BtreePayload1 /* sqlite3.c:15161:29 */ //************* End of btree.h ********************************************** //************* Continuing where we left off in sqliteInt.h ***************** @@ -10231,7 +10281,7 @@ type Vdbe1 = struct { FpParse uintptr FnVar YnVar _ [2]byte - Fmagic U32 + FiVdbeMagic U32 FnMem int32 FnCursor int32 FcacheCtr U32 @@ -10275,7 +10325,7 @@ type Vdbe1 = struct { Fexpmask U32 FpProgram uintptr FpAuxData uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ //************* End of btree.h ********************************************** //************* Continuing where we left off in sqliteInt.h ***************** @@ -10301,11 +10351,11 @@ type Vdbe1 = struct { // A single VDBE is an opaque structure named "Vdbe". Only routines // in the source file sqliteVdbe.c are allowed to see the insides // of this structure. -type Vdbe = Vdbe1 /* sqlite3.c:15420:21 */ +type Vdbe = Vdbe1 /* sqlite3.c:15559:21 */ // The names of the following types declared in vdbeInt.h are required // for the VdbeOp definition. -type Mem = sqlite3_value /* sqlite3.c:15426:30 */ +type Mem = sqlite3_value /* sqlite3.c:15565:30 */ type SubProgram1 = struct { FaOp uintptr FnOp int32 @@ -10315,9 +10365,9 @@ type SubProgram1 = struct { FaOnce uintptr Ftoken uintptr FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type SubProgram = SubProgram1 /* sqlite3.c:15427:27 */ +type SubProgram = SubProgram1 /* sqlite3.c:15566:27 */ // A single instruction of the virtual machine has an opcode // and as many as three operands. The instruction is recorded @@ -10334,7 +10384,7 @@ type VdbeOp1 = struct { Fi int32 _ [4]byte } -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // A single instruction of the virtual machine has an opcode // and as many as three operands. The instruction is recorded @@ -10343,9 +10393,9 @@ type p4union = struct { _ [0]uint64 Fi int32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type VdbeOp = VdbeOp1 /* sqlite3.c:15473:23 */ +type VdbeOp = VdbeOp1 /* sqlite3.c:15612:23 */ // A smaller version of VdbeOp used for the VdbeAddOpList() function because // it takes up less space. @@ -10354,11 +10404,11 @@ type VdbeOpList1 = struct { Fp1 int8 Fp2 int8 Fp3 int8 -} /* sqlite3.c:15493:1 */ +} /* sqlite3.c:15632:1 */ -type VdbeOpList = VdbeOpList1 /* sqlite3.c:15499:27 */ +type VdbeOpList = VdbeOpList1 /* sqlite3.c:15638:27 */ -type RecordCompare = uintptr /* sqlite3.c:15904:13 */ +type RecordCompare = uintptr /* sqlite3.c:16046:13 */ // Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on // each VDBE opcode. @@ -10423,7 +10473,7 @@ type RecordCompare = uintptr /* sqlite3.c:15904:13 */ // This header file defines the interface that the sqlite page cache // subsystem. -type PgHdr = PgHdr2 /* sqlite3.c:16037:22 */ +type PgHdr = PgHdr2 /* sqlite3.c:16179:22 */ type PCache2 = struct { FpDirty uintptr FpDirtyTail uintptr @@ -10439,16 +10489,19 @@ type PCache2 = struct { FxStress uintptr FpStress uintptr FpCache uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type PCache = PCache2 /* sqlite3.c:16038:23 */ +type PCache = PCache2 /* sqlite3.c:16180:23 */ // typedef for the authorization callback function. -type Sqlite3_xauth = uintptr /* sqlite3.c:16800:15 */ +type Sqlite3_xauth = uintptr /* sqlite3.c:16942:15 */ // This is an extra SQLITE_TRACE macro that indicates "legacy" tracing // in the style of sqlite3_trace() +// Maximum number of sqlite3.aDb[] entries. This is the number of attached +// databases plus 2 for "main" and "temp". + // Each database connection is an instance of the following structure. type sqlite3InitInfo = struct { FnewTnum Pgno @@ -10458,7 +10511,7 @@ type sqlite3InitInfo = struct { ForphanTrigger uint8 /* unsigned orphanTrigger: 1, unsigned imposterTable: 1, unsigned reopenMemdb: 1 */ _ [7]byte FazInit uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Allowed values for Table.tabFlags. // @@ -10470,8 +10523,9 @@ type sqlite3InitInfo = struct { // // Constraints: // -// TF_HasVirtual == COLFLAG_Virtual -// TF_HasStored == COLFLAG_Stored +// TF_HasVirtual == COLFLAG_VIRTUAL +// TF_HasStored == COLFLAG_STORED +// TF_HasHidden == COLFLAG_HIDDEN // Test to see whether or not a table is a virtual table. This is // done as a macro so that it will be optimized out when virtual @@ -10514,7 +10568,7 @@ type sColMap = struct { FiFrom int32 _ [4]byte FzCol uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // An instance of this structure contains information needed to generate // code for a SELECT that contains aggregate functions. @@ -10535,7 +10589,7 @@ type AggInfo_col = struct { FiColumn I16 FiSorterColumn I16 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // An instance of this structure contains information needed to generate // code for a SELECT that contains aggregate functions. @@ -10553,7 +10607,7 @@ type AggInfo_func = struct { FpFunc uintptr FiMem int32 FiDistinct int32 -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // The datatype ynVar is a signed integer, either 16-bit or 32-bit. // Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater @@ -10563,14 +10617,14 @@ type AggInfo_func = struct { // need more than about 10 or 20 variables. But some extreme users want // to have prepared statements with over 32766 variables, and for them // the option is available (at compile-time). -type YnVar = I16 /* sqlite3.c:17929:13 */ +type YnVar = I16 /* sqlite3.c:18096:13 */ // The following are the meanings of bits in the Expr.flags field. // Value restrictions: // // EP_Agg == NC_HasAgg == SF_HasAgg // EP_Win == NC_HasWin -// 0x020000 // available for reuse +// 0x400000 // Available // 0x80000000 // Available // The EP_Propagate mask is a set of properties that automatically propagate @@ -10630,7 +10684,7 @@ type ExprList_item = struct { } } _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Allowed values for Expr.a.eEName @@ -10651,70 +10705,10 @@ type IdList_item = struct { FzName uintptr Fidx int32 _ [4]byte -} /* sqlite3.c:1297:9 */ - -// The following structure describes the FROM clause of a SELECT statement. -// Each table or subquery in the FROM clause is a separate element of -// the SrcList.a[] array. -// -// With the addition of multiple database support, the following structure -// can also be used to describe a particular table such as the table that -// is modified by an INSERT, DELETE, or UPDATE statement. In standard SQL, -// such a table must be a simple name: ID. But in SQLite, the table can -// now be identified by a database name, a dot, then the table name: ID.ID. -// -// The jointype starts out showing the join type between the current table -// and the next table on the list. The parser builds the list this way. -// But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -// jointype expresses the join between the table and the previous table. -// -// In the colUsed field, the high-order bit (bit 63) is set if the table -// contains more than 63 columns and the 64-th or later column is used. -type SrcList_item = struct { - FpSchema uintptr - FzDatabase uintptr - FzName uintptr - FzAlias uintptr - FpTab uintptr - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 - Ffg struct { - _ [0]uint32 - Fjointype U8 - _ [3]byte - FnotIndexed uint8 /* unsigned notIndexed: 1, unsigned isIndexedBy: 1, unsigned isTabFunc: 1, unsigned isCorrelated: 1, unsigned viaCoroutine: 1, unsigned isRecursive: 1, unsigned fromDDL: 1 */ - _ [3]byte - } - FiCursor int32 - FpOn uintptr - FpUsing uintptr - FcolUsed Bitmask - Fu1 struct{ FzIndexedBy uintptr } - FpIBIndex uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // The yDbMask datatype for the bitmask of all attached databases. -type YDbMask = uint32 /* sqlite3.c:18660:24 */ - -// The following structure contains information used by the sqliteFix... -// routines as they walk the parse tree to make database references -// explicit. -type DbFixer1 = struct { - FpParse uintptr - FpSchema uintptr - FbTemp U8 - _ [7]byte - FzDb uintptr - FzType uintptr - FpName uintptr -} /* sqlite3.c:18959:9 */ - -// The following structure contains information used by the sqliteFix... -// routines as they walk the parse tree to make database references -// explicit. -type DbFixer = DbFixer1 /* sqlite3.c:18959:24 */ +type YDbMask = uint32 /* sqlite3.c:18849:24 */ // A pointer to this structure is used to communicate information // from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback. @@ -10727,7 +10721,7 @@ type InitData = struct { FnInitRow U32 FmxPage Pgno _ [4]byte -} /* sqlite3.c:19001:3 */ +} /* sqlite3.c:19207:3 */ // Allowed values for mInitFlags @@ -10779,7 +10773,7 @@ type Sqlite3Config = struct { FiOnceResetThreshold int32 FszSorterRef U32 FiPrngSeed uint32 -} /* sqlite3.c:19013:1 */ +} /* sqlite3.c:19220:1 */ // This macro is used inside of assert() statements to indicate that // the assert is only valid on a well-formed database. Instead of: @@ -10803,7 +10797,7 @@ type SrcCount = struct { FnThis int32 FnOther int32 _ [4]byte -} /* sqlite3.c:19107:5 */ +} /* sqlite3.c:19314:5 */ // This macro is used inside of assert() statements to indicate that // the assert is only valid on a well-formed database. Instead of: @@ -10825,7 +10819,7 @@ type IdxCover = struct { FpIdx uintptr FiCur int32 _ [4]byte -} /* sqlite3.c:19110:5 */ +} /* sqlite3.c:19317:5 */ // This macro is used inside of assert() statements to indicate that // the assert is only valid on a well-formed database. Instead of: @@ -10851,7 +10845,7 @@ type IdxExprTrans1 = struct { FiTabCol int32 FpWInfo uintptr Fdb uintptr -} /* sqlite3.c:19111:5 */ +} /* sqlite3.c:19318:5 */ // This macro is used inside of assert() statements to indicate that // the assert is only valid on a well-formed database. Instead of: @@ -10875,7 +10869,7 @@ type WindowRewrite1 = struct { FpSub uintptr FpTab uintptr FpSubSelect uintptr -} /* sqlite3.c:19114:5 */ +} /* sqlite3.c:19321:5 */ // This macro is used inside of assert() statements to indicate that // the assert is only valid on a well-formed database. Instead of: @@ -10898,7 +10892,7 @@ type WhereConst1 = struct { FnConst int32 FnChng int32 FapExpr uintptr -} /* sqlite3.c:19115:5 */ +} /* sqlite3.c:19322:5 */ // This macro is used inside of assert() statements to indicate that // the assert is only valid on a well-formed database. Instead of: @@ -10922,19 +10916,7 @@ type RenameCtx1 = struct { FiCol int32 FpTab uintptr FzOld uintptr -} /* sqlite3.c:19116:5 */ - -// Return code from the parse-tree walking primitives and their -// callbacks. - -// An instance of this structure represents a set of one or more CTEs -// (common table expressions) created by a single WITH clause. -type Cte = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:19323:5 */ //************* End of sqliteInt.h ****************************************** //************* Begin file global.c ***************************************** @@ -10974,7 +10956,7 @@ var Xsqlite3UpperToLower = [256]uint8{ uint8(216), uint8(217), uint8(218), uint8(219), uint8(220), uint8(221), uint8(222), uint8(223), uint8(224), uint8(225), uint8(226), uint8(227), uint8(228), uint8(229), uint8(230), uint8(231), uint8(232), uint8(233), uint8(234), uint8(235), uint8(236), uint8(237), uint8(238), uint8(239), uint8(240), uint8(241), uint8(242), uint8(243), uint8(244), uint8(245), uint8(246), uint8(247), uint8(248), uint8(249), uint8(250), uint8(251), uint8(252), uint8(253), uint8(254), uint8(255), -} /* sqlite3.c:20392:36 */ +} /* sqlite3.c:20664:36 */ // The following 256 byte lookup table is used to support SQLites built-in // equivalents to the following standard library functions: @@ -11038,7 +11020,7 @@ var Xsqlite3CtypeMap = [256]uint8{ uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), // e8..ef ........ uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), // f0..f7 ........ uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), // f8..ff ........ -} /* sqlite3.c:20458:36 */ +} /* sqlite3.c:20730:36 */ // EVIDENCE-OF: R-02982-34736 In order to maintain full backwards // compatibility for legacy applications, the URI filename capability is @@ -11087,22 +11069,22 @@ var Xsqlite3Config = Sqlite3Config{ FbMemstat: SQLITE_DEFAULT_MEMSTATUS, // bMemstat FbCoreMutex: U8(1), // bCoreMutex FbFullMutex: (U8(libc.Bool32(SQLITE_THREADSAFE == 1))), // bOpenUri - FbUseCis: SQLITE_ALLOW_COVERING_INDEX_SCAN, // bSmallMalloc + FbUseCis: U8(SQLITE_ALLOW_COVERING_INDEX_SCAN), // bSmallMalloc FbExtraSchemaChecks: U8(1), // bExtraSchemaChecks FmxStrlen: 0x7ffffffe, // neverCorrupt FszLookaside: 1200, FnLookaside: 40, // szLookaside, nLookaside - FnStmtSpill: (64 * 1024), // szMmap - FmxMmap: SQLITE_MAX_MMAP_SIZE, // szPage - FnPage: SQLITE_DEFAULT_PCACHE_INITSZ, // sharedCacheEnabled - FszPma: SQLITE_SORTER_PMASZ, // bLocaltimeFault - FiOnceResetThreshold: 0x7ffffffe, // iOnceResetThreshold - FszSorterRef: SQLITE_DEFAULT_SORTERREF_SIZE, // iPrngSeed -} /* sqlite3.c:20578:48 */ + FnStmtSpill: (64 * 1024), // szMmap + FmxMmap: int64(SQLITE_MAX_MMAP_SIZE), // szPage + FnPage: SQLITE_DEFAULT_PCACHE_INITSZ, // sharedCacheEnabled + FszPma: U32(SQLITE_SORTER_PMASZ), // bLocaltimeFault + FiOnceResetThreshold: 0x7ffffffe, // iOnceResetThreshold + FszSorterRef: U32(SQLITE_DEFAULT_SORTERREF_SIZE), // iPrngSeed +} /* sqlite3.c:20850:48 */ // Hash table for global functions - functions common to all // database connections. After initialization, this table is // read-only. -var Xsqlite3BuiltinFunctions FuncDefHash /* sqlite3.c:20639:28: */ +var Xsqlite3BuiltinFunctions FuncDefHash /* sqlite3.c:20911:28: */ // The value of the "pending" byte must be 0x40000000 (1 byte past the // 1-gibabyte boundary) in a compatible database. SQLite never uses @@ -11120,20 +11102,21 @@ var Xsqlite3BuiltinFunctions FuncDefHash /* sqlite3.c:20639:28: */ // 0x40000000 results in an incompatible database file format! // Changing the pending byte during operation will result in undefined // and incorrect behavior. -var Xsqlite3PendingByte int32 = 0x40000000 /* sqlite3.c:20668:20 */ +var Xsqlite3PendingByte int32 = 0x40000000 /* sqlite3.c:20940:20 */ -// Flags for select tracing and the ".selecttrace" macro of the CLI -var Xsqlite3_unsupported_selecttrace U32 = U32(0) /* sqlite3.c:20674:16 */ +// Tracing flags set by SQLITE_TESTCTRL_TRACEFLAGS. +var Xsqlite3SelectTrace U32 = U32(0) /* sqlite3.c:20946:20 */ +var Xsqlite3WhereTrace U32 = U32(0) /* sqlite3.c:20947:20 */ // #include "opcodes.h" // Properties of opcodes. The OPFLG_INITIALIZER macro is // created by mkopcodeh.awk during compilation. Data is obtained // from the comments following the "case OP_xxxx:" statements in // the vdbe.c file. -var Xsqlite3OpcodeProperty = [176]uint8{ /* 0 */ uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00), uint8(0x10) /* 8 */, uint8(0x00), uint8(0x01), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x03) /* 16 */, uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x12), uint8(0x03), uint8(0x01), uint8(0x09), uint8(0x09) /* 24 */, uint8(0x09), uint8(0x09), uint8(0x01), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09) /* 32 */, uint8(0x09), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01) /* 40 */, uint8(0x01), uint8(0x01), uint8(0x23), uint8(0x26), uint8(0x26), uint8(0x0b), uint8(0x01), uint8(0x01) /* 48 */, uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x0b), uint8(0x0b), uint8(0x0b), uint8(0x0b) /* 56 */, uint8(0x0b), uint8(0x0b), uint8(0x01), uint8(0x03), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00) /* 64 */, uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x08), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x10) /* 72 */, uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10) /* 80 */, uint8(0x00), uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x00), uint8(0x00), uint8(0x12) /* 88 */, uint8(0x20), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00) /* 96 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x26), uint8(0x26), uint8(0x26) /* 104 */, uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x00) /* 112 */, uint8(0x12), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10) /* 120 */, uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10) /* 128 */, uint8(0x00), uint8(0x00), uint8(0x04), uint8(0x04), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00) /* 136 */, uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 144 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x06), uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x04) /* 152 */, uint8(0x1a), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 160 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 168 */, uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00)} /* sqlite3.c:20683:36 */ +var Xsqlite3OpcodeProperty = [179]uint8{ /* 0 */ uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00), uint8(0x10) /* 8 */, uint8(0x00), uint8(0x01), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x03) /* 16 */, uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x12), uint8(0x03), uint8(0x01), uint8(0x09), uint8(0x09) /* 24 */, uint8(0x09), uint8(0x09), uint8(0x01), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09) /* 32 */, uint8(0x09), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01) /* 40 */, uint8(0x01), uint8(0x01), uint8(0x23), uint8(0x26), uint8(0x26), uint8(0x0b), uint8(0x01), uint8(0x01) /* 48 */, uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x0b), uint8(0x0b), uint8(0x0b), uint8(0x0b) /* 56 */, uint8(0x0b), uint8(0x0b), uint8(0x01), uint8(0x03), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00) /* 64 */, uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x08), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x10) /* 72 */, uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10) /* 80 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x00), uint8(0x00) /* 88 */, uint8(0x12), uint8(0x20), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00) /* 96 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x26), uint8(0x26) /* 104 */, uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26) /* 112 */, uint8(0x00), uint8(0x12), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00) /* 120 */, uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 128 */, uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x04), uint8(0x04), uint8(0x00) /* 136 */, uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00) /* 144 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x06), uint8(0x10) /* 152 */, uint8(0x10), uint8(0x00), uint8(0x04), uint8(0x1a), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 160 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 168 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00) /* 176 */, uint8(0x00), uint8(0x00), uint8(0x00)} /* sqlite3.c:20956:36 */ // Name of the default collating sequence -var Xsqlite3StrBINARY = *(*[7]int8)(unsafe.Pointer(ts + 266 /* "BINARY" */)) /* sqlite3.c:20688:27 */ +var Xsqlite3StrBINARY = *(*[7]int8)(unsafe.Pointer(ts + 266 /* "BINARY" */)) /* sqlite3.c:20961:27 */ //************* End of global.c ********************************************* //************* Begin file status.c ***************************************** @@ -11178,10 +11161,10 @@ var Xsqlite3StrBINARY = *(*[7]int8)(unsafe.Pointer(ts + 266 /* "BINARY" */)) /* // SQL is translated into a sequence of instructions to be // executed by a virtual machine. Each instruction is an instance // of the following structure. -type Op = VdbeOp1 /* sqlite3.c:20755:23 */ +type Op = VdbeOp1 /* sqlite3.c:21028:23 */ // Boolean values -type Bool = uint32 /* sqlite3.c:20760:18 */ +type Bool = uint32 /* sqlite3.c:21033:18 */ // Opaque type used by code in vdbesort.c type VdbeSorter1 = struct { @@ -11204,10 +11187,10 @@ type VdbeSorter1 = struct { FtypeMask U8 _ [3]byte FaTask [1]SortSubtask -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // Opaque type used by code in vdbesort.c -type VdbeSorter = VdbeSorter1 /* sqlite3.c:20763:27 */ +type VdbeSorter = VdbeSorter1 /* sqlite3.c:21036:27 */ // Elements of the linked list at Vdbe.pAuxData type AuxData1 = struct { @@ -11216,10 +11199,10 @@ type AuxData1 = struct { FpAux uintptr FxDeleteAux uintptr FpNextAux uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Elements of the linked list at Vdbe.pAuxData -type AuxData = AuxData1 /* sqlite3.c:20766:24 */ +type AuxData = AuxData1 /* sqlite3.c:21039:24 */ // Types of VDBE cursors @@ -11238,8 +11221,10 @@ type VdbeCursor1 = struct { FdeferredMoveto U8 FisTable U8 _ [3]byte - FisEphemeral uint8 /* Bool isEphemeral: 1, Bool useRandomRowid: 1, Bool isOrdered: 1, Bool seekHit: 1 */ - _ [7]byte + FisEphemeral uint8 /* Bool isEphemeral: 1, Bool useRandomRowid: 1, Bool isOrdered: 1 */ + _ [1]byte + FseekHit U16 + _ [4]byte FpBtx uintptr FseqCount I64 FaAltMap uintptr @@ -11260,7 +11245,7 @@ type VdbeCursor1 = struct { FszRow U32 FaType [1]U32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Types of VDBE cursors @@ -11272,7 +11257,7 @@ type VdbeCursor1 = struct { // * A sorter // * A virtual table // * A one-row "pseudotable" stored in a single register -type VdbeCursor = VdbeCursor1 /* sqlite3.c:20784:27 */ +type VdbeCursor = VdbeCursor1 /* sqlite3.c:21057:27 */ // A value for VdbeCursor.cacheStatus that means the cache is always invalid. @@ -11314,7 +11299,7 @@ type VdbeFrame1 = struct { FnChildCsr int32 FnChange int32 FnDbChange int32 -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // A value for VdbeCursor.cacheStatus that means the cache is always invalid. @@ -11337,7 +11322,7 @@ type VdbeFrame1 = struct { // // The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is // set to NULL if the currently executing frame is the main program. -type VdbeFrame = VdbeFrame1 /* sqlite3.c:20870:26 */ +type VdbeFrame = VdbeFrame1 /* sqlite3.c:21143:26 */ // Magic number for sanity checking on VdbeFrame objects @@ -11347,11 +11332,11 @@ type VdbeFrame = VdbeFrame1 /* sqlite3.c:20870:26 */ // Internally, the vdbe manipulates nearly all SQL values as Mem // structures. Each Mem struct may cache multiple representations (string, // integer etc.) of the same value. -type MemValue = struct{ Fr float64 } /* sqlite3.c:1297:9 */ +type MemValue = struct{ Fr float64 } /* sqlite3.c:1312:9 */ // A bitfield type for use inside of structures. Always follow with :N where // N is the number of bits. -type Bft = uint32 /* sqlite3.c:21053:18 */ // Bit Field Type +type Bft = uint32 /* sqlite3.c:21326:18 */ // Bit Field Type // The ScanStatus object holds a single value for the // sqlite3_stmt_scanstatus() interface. @@ -11363,13 +11348,13 @@ type ScanStatus1 = struct { FnEst LogEst _ [6]byte FzName uintptr -} /* sqlite3.c:21058:9 */ +} /* sqlite3.c:21331:9 */ // Bit Field Type // The ScanStatus object holds a single value for the // sqlite3_stmt_scanstatus() interface. -type ScanStatus = ScanStatus1 /* sqlite3.c:21058:27 */ +type ScanStatus = ScanStatus1 /* sqlite3.c:21331:27 */ // The DblquoteStr object holds the text of a double-quoted // string for a prepared statement. A linked list of these objects @@ -11380,7 +11365,7 @@ type ScanStatus = ScanStatus1 /* sqlite3.c:21058:27 */ type DblquoteStr1 = struct { FpNextStr uintptr Fz [8]int8 -} /* sqlite3.c:21075:9 */ +} /* sqlite3.c:21348:9 */ // The DblquoteStr object holds the text of a double-quoted // string for a prepared statement. A linked list of these objects @@ -11388,20 +11373,20 @@ type DblquoteStr1 = struct { // When computing a normalized SQL statement for an SQL statement, that // list is consulted for each double-quoted identifier to see if the // identifier should really be a string literal. -type DblquoteStr = DblquoteStr1 /* sqlite3.c:21075:28 */ +type DblquoteStr = DblquoteStr1 /* sqlite3.c:21348:28 */ //************* End of vdbeInt.h ******************************************** //************* Continuing where we left off in status.c ******************** // Variables in which to record status information. -type Sqlite3StatValueType = Sqlite3_int64 /* sqlite3.c:21341:23 */ +type Sqlite3StatValueType = Sqlite3_int64 /* sqlite3.c:21614:23 */ type sqlite3StatType = struct { FnowValue [10]Sqlite3StatValueType FmxValue [10]Sqlite3StatValueType -} /* sqlite3.c:21345:9 */ +} /* sqlite3.c:21618:9 */ -type Sqlite3StatType = sqlite3StatType /* sqlite3.c:21345:32 */ -var sqlite3Stat = sqlite3StatType{} /* sqlite3.c:21349:3 */ +type Sqlite3StatType = sqlite3StatType /* sqlite3.c:21618:32 */ +var sqlite3Stat = sqlite3StatType{} /* sqlite3.c:21622:3 */ // Elements of sqlite3Stat[] are protected by either the memory allocator // mutex, or by the pcache1 mutex. The following array determines which. @@ -11416,7 +11401,7 @@ var statMutex = [10]int8{ int8(1), // SQLITE_STATUS_PAGECACHE_SIZE int8(0), // SQLITE_STATUS_SCRATCH_SIZE int8(0), // SQLITE_STATUS_MALLOC_COUNT -} /* sqlite3.c:21355:19 */ +} /* sqlite3.c:21628:19 */ // The "wsdStat" macro will resolve to the status information // state vector. If writable static data is unsupported on the target, @@ -11426,7 +11411,7 @@ var statMutex = [10]int8{ // Return the current value of a status parameter. The caller must // be holding the appropriate mutex. -func Xsqlite3StatusValue(tls *libc.TLS, op int32) Sqlite3_int64 { /* sqlite3.c:21387:30: */ +func Xsqlite3StatusValue(tls *libc.TLS, op int32) Sqlite3_int64 { /* sqlite3.c:21660:30: */ return *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*8)) } @@ -11440,7 +11425,7 @@ func Xsqlite3StatusValue(tls *libc.TLS, op int32) Sqlite3_int64 { /* sqlite3.c:2 // // The StatusDown() routine lowers the current value by N. The highwater // mark is unchanged. N must be non-negative for StatusDown(). -func Xsqlite3StatusUp(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21407:21: */ +func Xsqlite3StatusUp(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21680:21: */ *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*8)) += (Sqlite3StatValueType(N)) if *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*8)) > *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) + 80 /* &.mxValue */) + uintptr(op)*8)) { @@ -11448,14 +11433,14 @@ func Xsqlite3StatusUp(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21407:21: } } -func Xsqlite3StatusDown(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21418:21: */ +func Xsqlite3StatusDown(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21691:21: */ *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*8)) -= (Sqlite3StatValueType(N)) } // Adjust the highwater mark if necessary. // The caller must hold the appropriate mutex. -func Xsqlite3StatusHighwater(tls *libc.TLS, op int32, X int32) { /* sqlite3.c:21432:21: */ +func Xsqlite3StatusHighwater(tls *libc.TLS, op int32, X int32) { /* sqlite3.c:21705:21: */ var newValue Sqlite3StatValueType newValue = Sqlite3StatValueType(X) @@ -11466,12 +11451,12 @@ func Xsqlite3StatusHighwater(tls *libc.TLS, op int32, X int32) { /* sqlite3.c:21 } // Query status information. -func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21452:16: */ +func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21725:16: */ var pMutex uintptr _ = pMutex if (op < 0) || (op >= (int32(uint64(unsafe.Sizeof([10]Sqlite3StatValueType{})) / uint64(unsafe.Sizeof(Sqlite3StatValueType(0)))))) { - return Xsqlite3MisuseError(tls, 21461) + return Xsqlite3MisuseError(tls, 21734) } if statMutex[op] != 0 { pMutex = Xsqlite3Pcache1Mutex(tls) @@ -11489,7 +11474,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin return SQLITE_OK } -func Xsqlite3_status(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21477:16: */ +func Xsqlite3_status(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21750:16: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -11505,7 +11490,7 @@ func Xsqlite3_status(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintp } // Return the number of LookasideSlot elements on the linked list -func countLookasideSlots(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:21494:12: */ +func countLookasideSlots(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:21767:12: */ var cnt U32 = U32(0) for p != 0 { p = (*LookasideSlot)(unsafe.Pointer(p)).FpNext @@ -11515,7 +11500,7 @@ func countLookasideSlots(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:21494:12: } // Count the number of slots of lookaside memory that are outstanding -func Xsqlite3LookasideUsed(tls *libc.TLS, db uintptr, pHighwater uintptr) int32 { /* sqlite3.c:21506:20: */ +func Xsqlite3LookasideUsed(tls *libc.TLS, db uintptr, pHighwater uintptr) int32 { /* sqlite3.c:21779:20: */ var nInit U32 = countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit) var nFree U32 = countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree) nInit = nInit + (countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit)) @@ -11527,7 +11512,7 @@ func Xsqlite3LookasideUsed(tls *libc.TLS, db uintptr, pHighwater uintptr) int32 } // Query status information for a single database connection -func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21520:16: */ +func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21793:16: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -11569,9 +11554,9 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p { *(*int32)(unsafe.Pointer(pCurrent)) = 0 - *(*int32)(unsafe.Pointer(pHighwater)) = int32(*(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-SQLITE_DBSTATUS_LOOKASIDE_HIT))*4))) + *(*int32)(unsafe.Pointer(pHighwater)) = int32(*(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-SQLITE_DBSTATUS_LOOKASIDE_HIT))*4))) if resetFlag != 0 { - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-SQLITE_DBSTATUS_LOOKASIDE_HIT))*4)) = U32(0) + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-SQLITE_DBSTATUS_LOOKASIDE_HIT))*4)) = U32(0) } break @@ -11802,7 +11787,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p // License along with the GNU C Library; if not, see // . -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -12127,14 +12112,14 @@ type DateTime1 = struct { FtzSet int8 FisError int8 _ [1]byte -} /* sqlite3.c:21780:9 */ +} /* sqlite3.c:22053:9 */ // The MSVC CRT on Windows CE may not have a localtime() function. // So declare a substitute. The substitute function itself is // defined in "os_win.c". // A structure for holding a single date and time. -type DateTime = DateTime1 /* sqlite3.c:21780:25 */ +type DateTime = DateTime1 /* sqlite3.c:22053:25 */ // Convert zDate into one or more integers according to the conversion // specifier zFormat. @@ -12161,7 +12146,7 @@ type DateTime = DateTime1 /* sqlite3.c:21780:25 */ // the 2-digit day which is the last integer in the set. // // The function returns the number of successful conversions. -func getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:21824:12: */ +func getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:22097:12: */ var ap Va_list _ = ap var cnt int32 @@ -12218,7 +12203,7 @@ end_getDigits: return cnt } -var aMx = [6]U16{U16(12), U16(14), U16(24), U16(31), U16(59), U16(9999)} /* sqlite3.c:21827:20 */ +var aMx = [6]U16{U16(12), U16(14), U16(24), U16(31), U16(59), U16(9999)} /* sqlite3.c:22100:20 */ // Parse a timezone extension on the end of a date-time. // The extension is of the form: @@ -12234,7 +12219,7 @@ var aMx = [6]U16{U16(12), U16(14), U16(24), U16(31), U16(59), U16(9999)} /* sqli // return non-zero. // // A missing specifier is not considered an error. -func parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:21878:12: */ +func parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22151:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -12308,7 +12293,7 @@ __11: // fractional seconds FFFF can be one or more digits. // // Return 1 if there is a parsing error and 0 on success. -func parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:21914:12: */ +func parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22187:12: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -12361,7 +12346,7 @@ func parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:2 } // Put the DateTime object into its error state. -func datetimeError(tls *libc.TLS, p uintptr) { /* sqlite3.c:21954:13: */ +func datetimeError(tls *libc.TLS, p uintptr) { /* sqlite3.c:22227:13: */ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(DateTime{}))) (*DateTime)(unsafe.Pointer(p)).FisError = int8(1) } @@ -12370,7 +12355,7 @@ func datetimeError(tls *libc.TLS, p uintptr) { /* sqlite3.c:21954:13: */ // that the YYYY-MM-DD is according to the Gregorian calendar. // // Reference: Meeus page 61 -func computeJD(tls *libc.TLS, p uintptr) { /* sqlite3.c:21965:13: */ +func computeJD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22238:13: */ var Y int32 var M int32 var D int32 @@ -12426,7 +12411,7 @@ func computeJD(tls *libc.TLS, p uintptr) { /* sqlite3.c:21965:13: */ // 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 *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22015:12: */ +func parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22288:12: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -12477,7 +12462,7 @@ func parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c // Set the time to the current time reported by the VFS. // // Return the number of errors. -func setDateTimeToCurrent(tls *libc.TLS, context uintptr, p uintptr) int32 { /* sqlite3.c:22052:12: */ +func setDateTimeToCurrent(tls *libc.TLS, context uintptr, p uintptr) int32 { /* sqlite3.c:22325:12: */ (*DateTime)(unsafe.Pointer(p)).FiJD = Xsqlite3StmtCurrentTime(tls, context) if (*DateTime)(unsafe.Pointer(p)).FiJD > int64(0) { (*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) @@ -12492,7 +12477,7 @@ func setDateTimeToCurrent(tls *libc.TLS, context uintptr, p uintptr) int32 { /* // 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 *libc.TLS, p uintptr, r float64) { /* sqlite3.c:22068:13: */ +func setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { /* sqlite3.c:22341:13: */ (*DateTime)(unsafe.Pointer(p)).Fs = r (*DateTime)(unsafe.Pointer(p)).FrawS = int8(1) if (r >= 0.0) && (r < 5373484.5) { @@ -12515,7 +12500,7 @@ func setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { /* sqlite3.c:22068: // (":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 *libc.TLS, context uintptr, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22093:12: */ +func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22366:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -12527,7 +12512,7 @@ func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) i return 0 } else if (Xsqlite3StrICmp(tls, zDate, ts+305 /* "now" */) == 0) && (Xsqlite3NotPureFunc(tls, context) != 0) { return setDateTimeToCurrent(tls, context, p) - } else if Xsqlite3AtoF(tls, zDate, bp /* &r */, Xsqlite3Strlen30(tls, zDate), SQLITE_UTF8) > 0 { + } else if Xsqlite3AtoF(tls, zDate, bp /* &r */, Xsqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 { setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp /* r */))) return 0 } @@ -12544,12 +12529,12 @@ func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) i // Return TRUE if the given julian day number is within range. // // The input is the JulianDay times 86400000. -func validJulianDay(tls *libc.TLS, iJD Sqlite3_int64) int32 { /* sqlite3.c:22126:12: */ +func validJulianDay(tls *libc.TLS, iJD Sqlite3_int64) int32 { /* sqlite3.c:22399:12: */ return (libc.Bool32((iJD >= int64(0)) && (iJD <= ((I64((int64(0x1a640))) << 32) | int64(0x1072fdff))))) } // Compute the Year, Month, and Day from the julian day number. -func computeYMD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22133:13: */ +func computeYMD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22406:13: */ var Z int32 var A int32 var B int32 @@ -12594,7 +12579,7 @@ func computeYMD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22133:13: */ } // Compute the Hour, Minute, and Seconds from the julian day number. -func computeHMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22162:13: */ +func computeHMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22435:13: */ var s int32 if (*DateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { return @@ -12613,13 +12598,13 @@ func computeHMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22162:13: */ } // Compute both YMD and HMS -func computeYMD_HMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22181:13: */ +func computeYMD_HMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22454:13: */ computeYMD(tls, p) computeHMS(tls, p) } // Clear the YMD and HMS and the TZ -func clearYMD_HMS_TZ(tls *libc.TLS, p uintptr) { /* sqlite3.c:22189:13: */ +func clearYMD_HMS_TZ(tls *libc.TLS, p uintptr) { /* sqlite3.c:22462:13: */ (*DateTime)(unsafe.Pointer(p)).FvalidYMD = int8(0) (*DateTime)(unsafe.Pointer(p)).FvalidHMS = int8(0) (*DateTime)(unsafe.Pointer(p)).FvalidTZ = int8(0) @@ -12647,7 +12632,7 @@ func clearYMD_HMS_TZ(tls *libc.TLS, p uintptr) { /* sqlite3.c:22189:13: */ // 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 *libc.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:22227:12: */ +func osLocaltime(tls *libc.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:22500:12: */ var rc int32 var pX uintptr var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN) @@ -12670,7 +12655,7 @@ func osLocaltime(tls *libc.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:222 // // Or, if an error does occur, set *pRc to SQLITE_ERROR. The returned value // is undefined in this case. -func localtimeOffset(tls *libc.TLS, p uintptr, pCtx uintptr, pRc uintptr) Sqlite3_int64 { /* sqlite3.c:22266:22: */ +func localtimeOffset(tls *libc.TLS, p uintptr, pCtx uintptr, pRc uintptr) Sqlite3_int64 { /* sqlite3.c:22539:22: */ bp := tls.Alloc(160) defer tls.Free(160) @@ -12748,7 +12733,7 @@ var aXformType = [6]struct { {FnName: U8(3), FzName: ts + 351 /* "day" */, FrLimit: 5373485.0, FrXform: 86400000.0}, {FeType: U8(1), FnName: U8(5), FzName: ts + 355 /* "month" */, FrLimit: 176546.0, FrXform: 2592000000.0}, {FeType: U8(2), FnName: U8(4), FzName: ts + 361 /* "year" */, FrLimit: 14713.0, FrXform: 31536000000.0}, -} /* sqlite3.c:22337:3 */ +} /* sqlite3.c:22610:3 */ // Process a modifier to a date-time stamp. The modifiers are // as follows: @@ -12772,7 +12757,7 @@ var aXformType = [6]struct { // 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 *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) int32 { /* sqlite3.c:22370:12: */ +func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) int32 { /* sqlite3.c:22643:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -12835,7 +12820,7 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i // weekday N where 0==Sunday, 1==Monday, and so forth. If the // date is already on the appropriate weekday, this is a no-op. if ((((Xsqlite3_strnicmp(tls, z, ts+390 /* "weekday " */, 8) == 0) && - (Xsqlite3AtoF(tls, (z+8), bp+8 /* &r */, Xsqlite3Strlen30(tls, (z+8)), SQLITE_UTF8) > 0)) && + (Xsqlite3AtoF(tls, (z+8), bp+8 /* &r */, Xsqlite3Strlen30(tls, (z+8)), uint8(SQLITE_UTF8)) > 0)) && ((float64(libc.AssignInt32(&n, int32(*(*float64)(unsafe.Pointer(bp + 8 /* r */)))))) == *(*float64)(unsafe.Pointer(bp + 8 /* r */)))) && (n >= 0)) && (*(*float64)(unsafe.Pointer(bp + 8 /* r */)) < float64(7)) { var Z Sqlite3_int64 computeYMD_HMS(tls, p) @@ -12914,7 +12899,7 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i var i int32 for n = 1; ((*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != ':')) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(n))))]) & 0x01) != 0); n++ { } - if Xsqlite3AtoF(tls, z, bp+8 /* &r */, n, SQLITE_UTF8) <= 0 { + if Xsqlite3AtoF(tls, z, bp+8 /* &r */, n, uint8(SQLITE_UTF8)) <= 0 { *(*int32)(unsafe.Pointer(bp /* rc */)) = 1 break } @@ -13035,7 +13020,7 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i // // If there are zero parameters (if even argv[0] is undefined) // then assume a default value of "now" for argv[0]. -func isDate(tls *libc.TLS, context uintptr, argc int32, argv uintptr, p uintptr) int32 { /* sqlite3.c:22587:12: */ +func isDate(tls *libc.TLS, context uintptr, argc int32, argv uintptr, p uintptr) int32 { /* sqlite3.c:22860:12: */ var i int32 var n int32 var z uintptr @@ -13073,7 +13058,7 @@ func isDate(tls *libc.TLS, context uintptr, argc int32, argv uintptr, p uintptr) // julianday( TIMESTRING, MOD, MOD, ...) // // Return the julian day number of the date specified in the arguments -func juliandayFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22630:13: */ +func juliandayFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22903:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -13088,7 +13073,7 @@ func juliandayFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { / // datetime( TIMESTRING, MOD, MOD, ...) // // Return YYYY-MM-DD HH:MM:SS -func datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22647:13: */ +func datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22920:13: */ bp := tls.Alloc(196) defer tls.Free(196) @@ -13107,7 +13092,7 @@ func datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* // time( TIMESTRING, MOD, MOD, ...) // // Return HH:MM:SS -func timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22667:13: */ +func timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22940:13: */ bp := tls.Alloc(172) defer tls.Free(172) @@ -13125,7 +13110,7 @@ func timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql // date( TIMESTRING, MOD, MOD, ...) // // Return YYYY-MM-DD -func dateFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22686:13: */ +func dateFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22959:13: */ bp := tls.Alloc(172) defer tls.Free(172) @@ -13157,7 +13142,7 @@ func dateFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql // %W week of year 00-53 // %Y year 0000-9999 // %% % -func strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22719:13: */ +func strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22992:13: */ bp := tls.Alloc(280) defer tls.Free(280) @@ -13243,7 +13228,7 @@ __3: if n < U64(unsafe.Sizeof([100]int8{})) { z = bp + 128 /* &zBuf[0] */ - } else if n > U64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) { + } else if n > U64(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) { Xsqlite3_result_error_toobig(tls, context) return } else { @@ -13373,7 +13358,7 @@ __3: // current_time() // // This function returns the same value as time('now'). -func ctimeFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:22857:13: */ +func ctimeFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:23130:13: */ _ = NotUsed _ = NotUsed2 timeFunc(tls, context, 0, uintptr(0)) @@ -13382,7 +13367,7 @@ func ctimeFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) // current_date() // // This function returns the same value as date('now'). -func cdateFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:22871:13: */ +func cdateFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:23144:13: */ _ = NotUsed _ = NotUsed2 dateFunc(tls, context, 0, uintptr(0)) @@ -13391,7 +13376,7 @@ func cdateFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) // current_timestamp() // // This function returns the same value as datetime('now'). -func ctimestampFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:22885:13: */ +func ctimestampFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:23158:13: */ _ = NotUsed _ = NotUsed2 datetimeFunc(tls, context, 0, uintptr(0)) @@ -13400,7 +13385,7 @@ func ctimestampFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uint // 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 Xsqlite3RegisterDateTimeFunctions(tls *libc.TLS) { /* sqlite3.c:22945:21: */ +func Xsqlite3RegisterDateTimeFunctions(tls *libc.TLS) { /* sqlite3.c:23218:21: */ Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aDateTimeFuncs)), (int32(uint64(unsafe.Sizeof(aDateTimeFuncs)) / uint64(unsafe.Sizeof(FuncDef{}))))) } @@ -13412,7 +13397,7 @@ var aDateTimeFuncs = [8]FuncDef{ {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_SLOCHNG | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FpUserData: 0, FxSFunc: 0, FzName: ts + 526 /* "strftime" */}, {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 535 /* "current_time" */}, {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 548 /* "current_timestam..." */}, - {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 566 /* "current_date" */}} /* sqlite3.c:22946:18 */ + {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 566 /* "current_date" */}} /* sqlite3.c:23219:18 */ //************* End of date.c *********************************************** //************* Begin file os.c ********************************************* @@ -13464,28 +13449,28 @@ var aDateTimeFuncs = [8]FuncDef{ // 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 Xsqlite3OsClose(tls *libc.TLS, pId uintptr) { /* sqlite3.c:23048:21: */ +func Xsqlite3OsClose(tls *libc.TLS, pId uintptr) { /* sqlite3.c:23321:21: */ if (*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods + 8 /* &.xClose */))))(tls, pId) (*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } -func Xsqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23054:20: */ +func Xsqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23327:20: */ return (*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 16 /* &.xRead */))))(tls, id, pBuf, amt, offset) } -func Xsqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23058:20: */ +func Xsqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23331:20: */ return (*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 24 /* &.xWrite */))))(tls, id, pBuf, amt, offset) } -func Xsqlite3OsTruncate(tls *libc.TLS, id uintptr, size I64) int32 { /* sqlite3.c:23062:20: */ +func Xsqlite3OsTruncate(tls *libc.TLS, id uintptr, size I64) int32 { /* sqlite3.c:23335:20: */ return (*(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 32 /* &.xTruncate */))))(tls, id, size) } -func Xsqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:23065:20: */ +func Xsqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:23338:20: */ if flags != 0 { return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 40 /* &.xSync */))))(tls, id, flags) @@ -13493,21 +13478,21 @@ func Xsqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c return SQLITE_OK } -func Xsqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:23069:20: */ +func Xsqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:23342:20: */ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 48 /* &.xFileSize */))))(tls, id, pSize) } -func Xsqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23073:20: */ +func Xsqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23346:20: */ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 56 /* &.xLock */))))(tls, id, lockType) } -func Xsqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23077:20: */ +func Xsqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23350:20: */ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 64 /* &.xUnlock */))))(tls, id, lockType) } -func Xsqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:23080:20: */ +func Xsqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:23353:20: */ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, id, pResOut) } @@ -13518,20 +13503,20 @@ func Xsqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int // 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 Xsqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:23093:20: */ +func Xsqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:23366:20: */ if (*Sqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return SQLITE_NOTFOUND } return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 80 /* &.xFileControl */))))(tls, id, op, pArg) } -func Xsqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { /* sqlite3.c:23114:21: */ +func Xsqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { /* sqlite3.c:23394:21: */ if (*Sqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 80 /* &.xFileControl */))))(tls, id, op, pArg) } } -func Xsqlite3OsSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23118:20: */ +func Xsqlite3OsSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23398:20: */ var xSectorSize uintptr = (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize return func() int32 { if xSectorSize != 0 { @@ -13541,40 +13526,40 @@ func Xsqlite3OsSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23118: }() } -func Xsqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23122:20: */ +func Xsqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23402:20: */ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, id) } -func Xsqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) int32 { /* sqlite3.c:23126:20: */ +func Xsqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) int32 { /* sqlite3.c:23406:20: */ return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 112 /* &.xShmLock */))))(tls, id, offset, n, flags) } -func Xsqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { /* sqlite3.c:23129:21: */ +func Xsqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { /* sqlite3.c:23409:21: */ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 120 /* &.xShmBarrier */))))(tls, id) } -func Xsqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) int32 { /* sqlite3.c:23132:20: */ +func Xsqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) int32 { /* sqlite3.c:23412:20: */ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 128 /* &.xShmUnmap */))))(tls, id, deleteFlag) } -func Xsqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:23135:20: */ +func Xsqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:23415:20: */ return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 104 /* &.xShmMap */))))(tls, id, iPage, pgsz, bExtend, libc.AtomicLoadUintptr(&pp)) } // The real implementation of xFetch and xUnfetch -func Xsqlite3OsFetch(tls *libc.TLS, id uintptr, iOff I64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:23149:20: */ +func Xsqlite3OsFetch(tls *libc.TLS, id uintptr, iOff I64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:23429:20: */ return (*(*func(*libc.TLS, uintptr, Sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 136 /* &.xFetch */))))(tls, id, iOff, iAmt, pp) } -func Xsqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:23153:20: */ +func Xsqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:23433:20: */ return (*(*func(*libc.TLS, uintptr, Sqlite3_int64, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 144 /* &.xUnfetch */))))(tls, id, iOff, p) } // The next group of routines are convenience wrappers around the // VFS methods. -func Xsqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pFlagsOut uintptr) int32 { /* sqlite3.c:23171:20: */ +func Xsqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pFlagsOut uintptr) int32 { /* sqlite3.c:23451:20: */ var rc int32 // 0x87f7f is a mask of SQLITE_OPEN_ flags that are valid to be passed @@ -13586,39 +13571,39 @@ func Xsqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, f return rc } -func Xsqlite3OsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:23188:20: */ +func Xsqlite3OsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:23468:20: */ return (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pVfs + 48 /* &.xDelete */))))(tls, pVfs, zPath, dirSync) } -func Xsqlite3OsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:23193:20: */ +func Xsqlite3OsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:23473:20: */ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 56 /* &.xAccess */))))(tls, pVfs, zPath, flags, pResOut) } -func Xsqlite3OsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* sqlite3.c:23202:20: */ +func Xsqlite3OsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* sqlite3.c:23482:20: */ *(*int8)(unsafe.Pointer(zPathOut)) = int8(0) return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 64 /* &.xFullPathname */))))(tls, pVfs, zPath, nPathOut, zPathOut) } -func Xsqlite3OsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:23213:21: */ +func Xsqlite3OsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:23493:21: */ return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 72 /* &.xDlOpen */))))(tls, pVfs, zPath) } -func Xsqlite3OsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) { /* sqlite3.c:23216:21: */ +func Xsqlite3OsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) { /* sqlite3.c:23496:21: */ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer((pVfs + 80 /* &.xDlError */))))(tls, pVfs, nByte, zBufOut) } -func Xsqlite3OsDlSym(tls *libc.TLS, pVfs uintptr, pHdle uintptr, zSym uintptr) uintptr { /* sqlite3.c:23219:21: */ +func Xsqlite3OsDlSym(tls *libc.TLS, pVfs uintptr, pHdle uintptr, zSym uintptr) uintptr { /* sqlite3.c:23499:21: */ return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 88 /* &.xDlSym */))))(tls, pVfs, pHdle, zSym) } -func Xsqlite3OsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:23222:21: */ +func Xsqlite3OsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:23502:21: */ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pVfs + 96 /* &.xDlClose */))))(tls, pVfs, pHandle) } -func Xsqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:23226:20: */ +func Xsqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:23506:20: */ if Xsqlite3Config.FiPrngSeed != 0 { libc.Xmemset(tls, zBufOut, 0, uint64(nByte)) if nByte > int32(unsafe.Sizeof(uint32(0))) { @@ -13633,18 +13618,18 @@ func Xsqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uint } -func Xsqlite3OsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:23237:20: */ +func Xsqlite3OsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:23517:20: */ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pVfs + 112 /* &.xSleep */))))(tls, pVfs, nMicro) } -func Xsqlite3OsGetLastError(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:23240:20: */ +func Xsqlite3OsGetLastError(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:23520:20: */ if (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxGetLastError != 0 { return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 128 /* &.xGetLastError */))))(tls, pVfs, 0, uintptr(0)) } return 0 } -func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:23243:20: */ +func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:23523:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -13665,7 +13650,7 @@ func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) i return rc } -func Xsqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:23261:20: */ +func Xsqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:23541:20: */ var rc int32 var pFile uintptr pFile = Xsqlite3MallocZero(tls, uint64((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile)) @@ -13682,7 +13667,7 @@ func Xsqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uin return rc } -func Xsqlite3OsCloseFree(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:23283:21: */ +func Xsqlite3OsCloseFree(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:23563:21: */ Xsqlite3OsClose(tls, pFile) Xsqlite3_free(tls, pFile) @@ -13692,7 +13677,7 @@ func Xsqlite3OsCloseFree(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:23283:21: // 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 Xsqlite3OsInit(tls *libc.TLS) int32 { /* sqlite3.c:23295:20: */ +func Xsqlite3OsInit(tls *libc.TLS) int32 { /* sqlite3.c:23575:20: */ var p uintptr = Xsqlite3_malloc(tls, 10) if p == uintptr(0) { return SQLITE_NOMEM @@ -13702,11 +13687,11 @@ func Xsqlite3OsInit(tls *libc.TLS) int32 { /* sqlite3.c:23295:20: */ } // The list of all registered VFS implementations. -var vfsList uintptr = uintptr(0) /* sqlite3.c:23305:20 */ +var vfsList uintptr = uintptr(0) /* sqlite3.c:23585:20 */ // Locate a VFS by name. If no name is given, simply return the // first VFS on the list. -func Xsqlite3_vfs_find(tls *libc.TLS, zVfs uintptr) uintptr { /* sqlite3.c:23312:24: */ +func Xsqlite3_vfs_find(tls *libc.TLS, zVfs uintptr) uintptr { /* sqlite3.c:23592:24: */ var pVfs uintptr = uintptr(0) var mutex uintptr var rc int32 = Xsqlite3_initialize(tls) @@ -13728,7 +13713,7 @@ func Xsqlite3_vfs_find(tls *libc.TLS, zVfs uintptr) uintptr { /* sqlite3.c:23312 } // Unlink a VFS from the linked list -func vfsUnlink(tls *libc.TLS, pVfs uintptr) { /* sqlite3.c:23336:13: */ +func vfsUnlink(tls *libc.TLS, pVfs uintptr) { /* sqlite3.c:23616:13: */ if pVfs == uintptr(0) { // No-op @@ -13748,7 +13733,7 @@ func vfsUnlink(tls *libc.TLS, pVfs uintptr) { /* sqlite3.c:23336:13: */ // 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 *libc.TLS, pVfs uintptr, makeDflt int32) int32 { /* sqlite3.c:23358:16: */ +func Xsqlite3_vfs_register(tls *libc.TLS, pVfs uintptr, makeDflt int32) int32 { /* sqlite3.c:23638:16: */ var mutex uintptr var rc int32 = Xsqlite3_initialize(tls) if rc != 0 { @@ -13771,7 +13756,7 @@ func Xsqlite3_vfs_register(tls *libc.TLS, pVfs uintptr, makeDflt int32) int32 { } // Unregister a VFS so that it is no longer accessible. -func Xsqlite3_vfs_unregister(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:23386:16: */ +func Xsqlite3_vfs_unregister(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:23666:16: */ var mutex uintptr var rc int32 = Xsqlite3_initialize(tls) if rc != 0 { @@ -13816,7 +13801,7 @@ func Xsqlite3_vfs_unregister(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:2 type BenignMallocHooks1 = struct { FxBenignBegin uintptr FxBenignEnd uintptr -} /* sqlite3.c:23434:9 */ +} /* sqlite3.c:23714:9 */ //************* End of os.c ************************************************* //************* Begin file fault.c ****************************************** @@ -13847,8 +13832,8 @@ type BenignMallocHooks1 = struct { // #include "sqliteInt.h" // Global variables. -type BenignMallocHooks = BenignMallocHooks1 /* sqlite3.c:23434:34 */ -var sqlite3Hooks = BenignMallocHooks1{} /* sqlite3.c:23438:3 */ +type BenignMallocHooks = BenignMallocHooks1 /* sqlite3.c:23714:34 */ +var sqlite3Hooks = BenignMallocHooks1{} /* sqlite3.c:23718:3 */ // The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks // structure. If writable static data is unsupported on the target, @@ -13858,7 +13843,7 @@ var sqlite3Hooks = BenignMallocHooks1{} /* sqlite3.c:23438:3 */ // Register hooks to call when sqlite3BeginBenignMalloc() and // sqlite3EndBenignMalloc() are called, respectively. -func Xsqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { /* sqlite3.c:23460:21: */ +func Xsqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { /* sqlite3.c:23740:21: */ sqlite3Hooks.FxBenignBegin = xBenignBegin sqlite3Hooks.FxBenignEnd = xBenignEnd @@ -13867,14 +13852,14 @@ func Xsqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd u // 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 Xsqlite3BeginBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23474:21: */ +func Xsqlite3BeginBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23754:21: */ if sqlite3Hooks.FxBenignBegin != 0 { (*(*func(*libc.TLS))(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Hooks)) /* &.xBenignBegin */))))(tls) } } -func Xsqlite3EndBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23480:21: */ +func Xsqlite3EndBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23760:21: */ if sqlite3Hooks.FxBenignEnd != 0 { (*(*func(*libc.TLS))(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Hooks)) + 8 /* &.xBenignEnd */))))(tls) @@ -13972,7 +13957,7 @@ func Xsqlite3EndBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23480:21: */ // 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 *libc.TLS, nByte int32) uintptr { /* sqlite3.c:23680:13: */ +func sqlite3MemMalloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:23960:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -13995,7 +13980,7 @@ func sqlite3MemMalloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:23680:1 // 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 *libc.TLS, pPrior uintptr) { /* sqlite3.c:23714:13: */ +func sqlite3MemFree(tls *libc.TLS, pPrior uintptr) { /* sqlite3.c:23994:13: */ var p uintptr = pPrior p -= 8 @@ -14004,7 +13989,7 @@ func sqlite3MemFree(tls *libc.TLS, pPrior uintptr) { /* sqlite3.c:23714:13: */ // Report the allocated size of a prior return from xMalloc() // or xRealloc(). -func sqlite3MemSize(tls *libc.TLS, pPrior uintptr) int32 { /* sqlite3.c:23729:12: */ +func sqlite3MemSize(tls *libc.TLS, pPrior uintptr) int32 { /* sqlite3.c:24009:12: */ var p uintptr p = pPrior @@ -14020,7 +14005,7 @@ func sqlite3MemSize(tls *libc.TLS, pPrior uintptr) int32 { /* sqlite3.c:23729:12 // 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 *libc.TLS, pPrior uintptr, nByte int32) uintptr { /* sqlite3.c:23752:13: */ +func sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) uintptr { /* sqlite3.c:24032:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -14042,18 +14027,18 @@ func sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) uintptr { /* } // Round up a request size to the next valid allocation size. -func sqlite3MemRoundup(tls *libc.TLS, n int32) int32 { /* sqlite3.c:23784:12: */ +func sqlite3MemRoundup(tls *libc.TLS, n int32) int32 { /* sqlite3.c:24064:12: */ return (((n) + 7) & libc.CplInt32(7)) } // Initialize this module. -func sqlite3MemInit(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:23791:12: */ +func sqlite3MemInit(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:24071:12: */ _ = NotUsed return SQLITE_OK } // Deinitialize this module. -func sqlite3MemShutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:23818:13: */ +func sqlite3MemShutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:24098:13: */ _ = NotUsed return } @@ -14062,7 +14047,7 @@ func sqlite3MemShutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:23818:13: // // Populate the low-level memory allocation function pointers in // sqlite3GlobalConfig.m with pointers to the routines in this file. -func Xsqlite3MemSetDefault(tls *libc.TLS) { /* sqlite3.c:23829:21: */ +func Xsqlite3MemSetDefault(tls *libc.TLS) { /* sqlite3.c:24109:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -14077,7 +14062,7 @@ var defaultMethods = Sqlite3_mem_methods{ FxRoundup: 0, FxInit: 0, FxShutdown: 0, -} /* sqlite3.c:23830:36 */ +} /* sqlite3.c:24110:36 */ //************* End of mem1.c *********************************************** //************* Begin file mem2.c ******************************************* @@ -14211,7 +14196,7 @@ var defaultMethods = Sqlite3_mem_methods{ // #include "sqliteInt.h" // Initialize the mutex system. -func Xsqlite3MutexInit(tls *libc.TLS) int32 { /* sqlite3.c:25865:20: */ +func Xsqlite3MutexInit(tls *libc.TLS) int32 { /* sqlite3.c:26145:20: */ var rc int32 = SQLITE_OK if !(int32(Xsqlite3Config.Fmutex.FxMutexAlloc) != 0) { // If the xMutexAlloc method has not been set, then the user did not @@ -14245,7 +14230,7 @@ func Xsqlite3MutexInit(tls *libc.TLS) int32 { /* sqlite3.c:25865:20: */ // Shutdown the mutex system. This call frees resources allocated by // sqlite3MutexInit(). -func Xsqlite3MutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:25911:20: */ +func Xsqlite3MutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:26191:20: */ var rc int32 = SQLITE_OK if Xsqlite3Config.Fmutex.FxMutexEnd != 0 { rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 8 /* &.xMutexEnd */))))(tls) @@ -14255,7 +14240,7 @@ func Xsqlite3MutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:25911:20: */ } // Retrieve a pointer to a static mutex or allocate a new dynamic one. -func Xsqlite3_mutex_alloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:25927:26: */ +func Xsqlite3_mutex_alloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26207:26: */ if (id <= SQLITE_MUTEX_RECURSIVE) && (Xsqlite3_initialize(tls) != 0) { return uintptr(0) } @@ -14266,7 +14251,7 @@ func Xsqlite3_mutex_alloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:25927: return (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 16 /* &.xMutexAlloc */))))(tls, id) } -func Xsqlite3MutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:25936:30: */ +func Xsqlite3MutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26216:30: */ if !(int32(Xsqlite3Config.FbCoreMutex) != 0) { return uintptr(0) } @@ -14275,7 +14260,7 @@ func Xsqlite3MutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:25936:30 } // Free a dynamic mutex. -func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:25948:17: */ +func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:26228:17: */ if p != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 24 /* &.xMutexFree */))))(tls, p) @@ -14284,7 +14269,7 @@ func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:25948:17: */ // Obtain the mutex p. If some other thread already has the mutex, block // until it can be obtained. -func Xsqlite3_mutex_enter(tls *libc.TLS, p uintptr) { /* sqlite3.c:25959:17: */ +func Xsqlite3_mutex_enter(tls *libc.TLS, p uintptr) { /* sqlite3.c:26239:17: */ if p != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 32 /* &.xMutexEnter */))))(tls, p) @@ -14293,7 +14278,7 @@ func Xsqlite3_mutex_enter(tls *libc.TLS, p uintptr) { /* sqlite3.c:25959: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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:25970:16: */ +func Xsqlite3_mutex_try(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:26250:16: */ var rc int32 = SQLITE_OK if p != 0 { @@ -14306,7 +14291,7 @@ func Xsqlite3_mutex_try(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:25970:16: // 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 *libc.TLS, p uintptr) { /* sqlite3.c:25985:17: */ +func Xsqlite3_mutex_leave(tls *libc.TLS, p uintptr) { /* sqlite3.c:26265:17: */ if p != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 48 /* &.xMutexLeave */))))(tls, p) @@ -14345,40 +14330,40 @@ func Xsqlite3_mutex_leave(tls *libc.TLS, p uintptr) { /* sqlite3.c:25985:17: */ // Stub routines for all mutex methods. // // This routines provide no mutual exclusion or error checking. -func noopMutexInit(tls *libc.TLS) int32 { /* sqlite3.c:26048:12: */ +func noopMutexInit(tls *libc.TLS) int32 { /* sqlite3.c:26328:12: */ return SQLITE_OK } -func noopMutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:26049:12: */ +func noopMutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:26329:12: */ return SQLITE_OK } -func noopMutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26050:22: */ +func noopMutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26330:22: */ _ = id return uintptr(8) } -func noopMutexFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:26054:13: */ +func noopMutexFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:26334:13: */ _ = p return } -func noopMutexEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:26055:13: */ +func noopMutexEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:26335:13: */ _ = p return } -func noopMutexTry(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:26056:12: */ +func noopMutexTry(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:26336:12: */ _ = p return SQLITE_OK } -func noopMutexLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:26060:13: */ +func noopMutexLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:26340:13: */ _ = p return } -func Xsqlite3NoopMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26062:44: */ +func Xsqlite3NoopMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26342:44: */ return uintptr(unsafe.Pointer(&sMutex)) } @@ -14391,11 +14376,11 @@ var sMutex = Sqlite3_mutex_methods{ FxMutexEnter: 0, FxMutexTry: 0, FxMutexLeave: 0, -} /* sqlite3.c:26063:38 */ +} /* sqlite3.c:26343:38 */ // If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation // is used regardless of the run-time threadsafety setting. -func Xsqlite3DefaultMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26221:44: */ +func Xsqlite3DefaultMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26501:44: */ return Xsqlite3NoopMutex(tls) } @@ -14458,7 +14443,7 @@ func Xsqlite3DefaultMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26221:44: */ // 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 *libc.TLS, n int32) int32 { /* sqlite3.c:27340:16: */ +func Xsqlite3_release_memory(tls *libc.TLS, n int32) int32 { /* sqlite3.c:27620:16: */ return Xsqlite3PcacheReleaseMemory(tls, n) } @@ -14471,22 +14456,22 @@ type Mem0Global = struct { FhardLimit Sqlite3_int64 FnearlyFull int32 _ [4]byte -} /* sqlite3.c:27362:19 */ +} /* sqlite3.c:27642:19 */ // Default value of the hard heap limit. 0 means "no limit". // State information local to the memory allocation subsystem. -var mem0 = Mem0Global{} /* sqlite3.c:27372:3 */ +var mem0 = Mem0Global{} /* sqlite3.c:27652:3 */ // Return the memory allocator mutex. sqlite3_status() needs it. -func Xsqlite3MallocMutex(tls *libc.TLS) uintptr { /* sqlite3.c:27379:30: */ +func Xsqlite3MallocMutex(tls *libc.TLS) uintptr { /* sqlite3.c:27659:30: */ return mem0.Fmutex } // Deprecated external interface. It used to set an alarm callback // that was invoked when memory usage grew too large. Now it is a // no-op. -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Sqlite3_int64) int32 { /* sqlite3.c:27389:16: */ +func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Sqlite3_int64) int32 { /* sqlite3.c:27669:16: */ _ = xCallback _ = pArg _ = iThreshold @@ -14502,7 +14487,7 @@ func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThre // // If the hard heap limit is enabled, then the soft heap limit cannot // be disabled nor raised above the hard heap limit. -func Xsqlite3_soft_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27412:26: */ +func Xsqlite3_soft_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27692:26: */ var priorLimit Sqlite3_int64 var excess Sqlite3_int64 var nUsed Sqlite3_int64 @@ -14530,7 +14515,7 @@ func Xsqlite3_soft_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { return priorLimit } -func Xsqlite3_soft_heap_limit(tls *libc.TLS, n int32) { /* sqlite3.c:27437:17: */ +func Xsqlite3_soft_heap_limit(tls *libc.TLS, n int32) { /* sqlite3.c:27717:17: */ if n < 0 { n = 0 } @@ -14547,7 +14532,7 @@ func Xsqlite3_soft_heap_limit(tls *libc.TLS, n int32) { /* sqlite3.c:27437:17: * // Setting the hard heap limit will also activate the soft heap limit // and constrain the soft heap limit to be no more than the hard heap // limit. -func Xsqlite3_hard_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27454:26: */ +func Xsqlite3_hard_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27734:26: */ var priorLimit Sqlite3_int64 var rc int32 = Xsqlite3_initialize(tls) if rc != 0 { @@ -14566,7 +14551,7 @@ func Xsqlite3_hard_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { } // Initialize the memory allocation subsystem. -func Xsqlite3MallocInit(tls *libc.TLS) int32 { /* sqlite3.c:27476:20: */ +func Xsqlite3MallocInit(tls *libc.TLS) int32 { /* sqlite3.c:27756:20: */ var rc int32 if Xsqlite3Config.Fm.FxMalloc == uintptr(0) { Xsqlite3MemSetDefault(tls) @@ -14588,12 +14573,12 @@ func Xsqlite3MallocInit(tls *libc.TLS) int32 { /* sqlite3.c:27476:20: */ // 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 Xsqlite3HeapNearlyFull(tls *libc.TLS) int32 { /* sqlite3.c:27498:20: */ +func Xsqlite3HeapNearlyFull(tls *libc.TLS) int32 { /* sqlite3.c:27778:20: */ return libc.AtomicLoadNInt32((uintptr(unsafe.Pointer(&mem0)) + 24 /* &.nearlyFull */), 0) } // Deinitialize the memory allocation subsystem. -func Xsqlite3MallocEnd(tls *libc.TLS) { /* sqlite3.c:27505:21: */ +func Xsqlite3MallocEnd(tls *libc.TLS) { /* sqlite3.c:27785:21: */ if Xsqlite3Config.Fm.FxShutdown != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 48 /* &.xShutdown */))))(tls, Xsqlite3Config.Fm.FpAppData) } @@ -14601,7 +14586,7 @@ func Xsqlite3MallocEnd(tls *libc.TLS) { /* sqlite3.c:27505:21: */ } // Return the amount of memory currently checked out. -func Xsqlite3_memory_used(tls *libc.TLS) Sqlite3_int64 { /* sqlite3.c:27515:26: */ +func Xsqlite3_memory_used(tls *libc.TLS) Sqlite3_int64 { /* sqlite3.c:27795:26: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -14616,7 +14601,7 @@ func Xsqlite3_memory_used(tls *libc.TLS) Sqlite3_int64 { /* sqlite3.c:27515:26: // 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 *libc.TLS, resetFlag int32) Sqlite3_int64 { /* sqlite3.c:27526:26: */ +func Xsqlite3_memory_highwater(tls *libc.TLS, resetFlag int32) Sqlite3_int64 { /* sqlite3.c:27806:26: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -14629,7 +14614,7 @@ func Xsqlite3_memory_highwater(tls *libc.TLS, resetFlag int32) Sqlite3_int64 { / } // Trigger the alarm -func sqlite3MallocAlarm(tls *libc.TLS, nByte int32) { /* sqlite3.c:27535:13: */ +func sqlite3MallocAlarm(tls *libc.TLS, nByte int32) { /* sqlite3.c:27815:13: */ if mem0.FalarmThreshold <= int64(0) { return } @@ -14640,7 +14625,7 @@ func sqlite3MallocAlarm(tls *libc.TLS, nByte int32) { /* sqlite3.c:27535:13: */ // Do a memory allocation with statistics and alarms. Assume the // lock is already held. -func mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) { /* sqlite3.c:27546:13: */ +func mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) { /* sqlite3.c:27826:13: */ var p uintptr var nFull int32 @@ -14683,7 +14668,7 @@ func mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) { /* sqlite3.c:27546:13 // Allocate memory. This routine is like sqlite3_malloc() except that it // assumes the memory subsystem has already been initialized. -func Xsqlite3Malloc(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:27595:21: */ +func Xsqlite3Malloc(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:27875:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -14710,7 +14695,7 @@ func Xsqlite3Malloc(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:27595:21: */ // 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 *libc.TLS, n int32) uintptr { /* sqlite3.c:27620:17: */ +func Xsqlite3_malloc(tls *libc.TLS, n int32) uintptr { /* sqlite3.c:27900:17: */ if Xsqlite3_initialize(tls) != 0 { return uintptr(0) } @@ -14720,7 +14705,7 @@ func Xsqlite3_malloc(tls *libc.TLS, n int32) uintptr { /* sqlite3.c:27620:17: */ return Xsqlite3Malloc(tls, uint64(n)) } -func Xsqlite3_malloc64(tls *libc.TLS, n Sqlite3_uint64) uintptr { /* sqlite3.c:27626:17: */ +func Xsqlite3_malloc64(tls *libc.TLS, n Sqlite3_uint64) uintptr { /* sqlite3.c:27906:17: */ if Xsqlite3_initialize(tls) != 0 { return uintptr(0) } @@ -14728,25 +14713,25 @@ func Xsqlite3_malloc64(tls *libc.TLS, n Sqlite3_uint64) uintptr { /* sqlite3.c:2 } // TRUE if p is a lookaside memory allocation from db -func isLookaside(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27637:12: */ +func isLookaside(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27917:12: */ return (libc.Bool32((Uptr((p)) >= Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart))) && (Uptr((p)) < Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd))))) } // Return the size of a memory allocation previously obtained from // sqlite3Malloc() or sqlite3_malloc(). -func Xsqlite3MallocSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:27648:20: */ +func Xsqlite3MallocSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:27928:20: */ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 24 /* &.xSize */))))(tls, p) } -func lookasideMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27652:12: */ +func lookasideMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27932:12: */ if p < (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle { return int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) } return LOOKASIDE_SMALL } -func Xsqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27659:20: */ +func Xsqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27939:20: */ if db != 0 { if (Uptr(p)) < Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd)) { @@ -14763,7 +14748,7 @@ func Xsqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlit return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 24 /* &.xSize */))))(tls, p) } -func Xsqlite3_msize(tls *libc.TLS, p uintptr) Sqlite3_uint64 { /* sqlite3.c:27688:27: */ +func Xsqlite3_msize(tls *libc.TLS, p uintptr) Sqlite3_uint64 { /* sqlite3.c:27968:27: */ if p != 0 { return uint64((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 24 /* &.xSize */))))(tls, p)) @@ -14772,7 +14757,7 @@ func Xsqlite3_msize(tls *libc.TLS, p uintptr) Sqlite3_uint64 { /* sqlite3.c:2768 } // Free memory previously obtained from sqlite3Malloc(). -func Xsqlite3_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:27697:17: */ +func Xsqlite3_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:27977:17: */ if p == uintptr(0) { return } // IMP: R-49053-54554 @@ -14790,14 +14775,14 @@ func Xsqlite3_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:27697:17: */ // Add the size of memory allocation "p" to the count in // *db->pnBytesFreed. -func measureAllocationSize(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27716:29: */ +func measureAllocationSize(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27996:29: */ *(*int32)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed)) += (Xsqlite3DbMallocSize(tls, db, p)) } // 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 Xsqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27725:21: */ +func Xsqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:28005:21: */ if db != 0 { if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed != 0 { @@ -14823,7 +14808,7 @@ func Xsqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27725 Xsqlite3_free(tls, p) } -func Xsqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27762:21: */ +func Xsqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:28042:21: */ if p != 0 { Xsqlite3DbFreeNN(tls, db, p) @@ -14831,7 +14816,7 @@ func Xsqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27762:2 } // Change the size of an existing memory allocation -func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlite3.c:27770:21: */ +func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlite3.c:28050:21: */ var nOld int32 var nNew int32 var nDiff int32 @@ -14856,11 +14841,16 @@ func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlit if nOld == nNew { pNew = pOld } else if Xsqlite3Config.FbMemstat != 0 { + var nUsed Sqlite3_int64 Xsqlite3_mutex_enter(tls, mem0.Fmutex) Xsqlite3StatusHighwater(tls, SQLITE_STATUS_MALLOC_SIZE, int32(nBytes)) nDiff = (nNew - nOld) - if (nDiff > 0) && (Xsqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED) >= (mem0.FalarmThreshold - Sqlite3_int64(nDiff))) { + if (nDiff > 0) && ((libc.AssignInt64(&nUsed, Xsqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED))) >= (mem0.FalarmThreshold - Sqlite3_int64(nDiff))) { sqlite3MallocAlarm(tls, nDiff) + if (mem0.FhardLimit > int64(0)) && (nUsed >= (mem0.FhardLimit - Sqlite3_int64(nDiff))) { + Xsqlite3_mutex_leave(tls, mem0.Fmutex) + return uintptr(0) + } } pNew = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 16 /* &.xRealloc */))))(tls, pOld, nNew) if (pNew == uintptr(0)) && (mem0.FalarmThreshold > int64(0)) { @@ -14881,7 +14871,7 @@ func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlit // The public interface to sqlite3Realloc. Make sure that the memory // subsystem is initialized prior to invoking sqliteRealloc. -func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) uintptr { /* sqlite3.c:27824:17: */ +func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) uintptr { /* sqlite3.c:28109:17: */ if Xsqlite3_initialize(tls) != 0 { return uintptr(0) } @@ -14891,7 +14881,7 @@ func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) uintptr { /* sqlite3 return Xsqlite3Realloc(tls, pOld, uint64(n)) } -func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Sqlite3_uint64) uintptr { /* sqlite3.c:27831:17: */ +func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Sqlite3_uint64) uintptr { /* sqlite3.c:28116:17: */ if Xsqlite3_initialize(tls) != 0 { return uintptr(0) } @@ -14899,7 +14889,7 @@ func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Sqlite3_uint64) uintptr { } // Allocate and zero memory. -func Xsqlite3MallocZero(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:27842:21: */ +func Xsqlite3MallocZero(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:28127:21: */ var p uintptr = Xsqlite3Malloc(tls, n) if p != 0 { libc.Xmemset(tls, p, 0, Size_t(n)) @@ -14909,7 +14899,7 @@ func Xsqlite3MallocZero(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:27842:21: * // Allocate and zero memory. If the allocation fails, make // the mallocFailed flag in the connection pointer. -func Xsqlite3DbMallocZero(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27854:21: */ +func Xsqlite3DbMallocZero(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28139:21: */ var p uintptr p = Xsqlite3DbMallocRaw(tls, db, n) @@ -14921,7 +14911,7 @@ func Xsqlite3DbMallocZero(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3 // Finish the work of sqlite3DbMallocRawNN for the unusual and // slower case when the allocation cannot be fulfilled using lookaside. -func dbMallocRawFinish(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27866:29: */ +func dbMallocRawFinish(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28151:29: */ var p uintptr p = Xsqlite3Malloc(tls, n) @@ -14952,7 +14942,7 @@ func dbMallocRawFinish(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c: // // The sqlite3MallocRawNN() variant guarantees that the "db" parameter is // not a NULL pointer. -func Xsqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27898:21: */ +func Xsqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28183:21: */ var p uintptr if db != 0 { return Xsqlite3DbMallocRawNN(tls, db, n) @@ -14962,45 +14952,45 @@ func Xsqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3. return p } -func Xsqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27905:21: */ +func Xsqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28190:21: */ var pBuf uintptr if n > U64((*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz) { if !(int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable) != 0) { - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + 1*4))++ + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */) + 1*4))++ } else if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return uintptr(0) } return dbMallocRawFinish(tls, db, n) } - if n <= LOOKASIDE_SMALL { + if n <= uint64(LOOKASIDE_SMALL) { if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree)) != uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */)))++ + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */)))++ return pBuf } else if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit)) != uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */)))++ + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */)))++ return pBuf } } if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree)) != uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */)))++ + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */)))++ return pBuf } else if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit)) != uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */)))++ + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */)))++ return pBuf } else { - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + 2*4))++ + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */) + 2*4))++ } return dbMallocRawFinish(tls, db, n) } // 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 Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:27961:21: */ +func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28246:21: */ if p == uintptr(0) { return Xsqlite3DbMallocRawNN(tls, db, n) @@ -15008,7 +14998,7 @@ func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* if (Uptr(p)) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) { if (Uptr(p)) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { - if n <= LOOKASIDE_SMALL { + if n <= uint64(LOOKASIDE_SMALL) { return p } } else if (Uptr(p)) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { @@ -15020,7 +15010,7 @@ func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* return dbReallocFinish(tls, db, p, n) } -func dbReallocFinish(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:27977:29: */ +func dbReallocFinish(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28262:29: */ var pNew uintptr = uintptr(0) if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -15044,7 +15034,7 @@ func dbReallocFinish(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* s // Attempt to reallocate p. If the reallocation fails, then free p // and set the mallocFailed flag in the database connection. -func Xsqlite3DbReallocOrFree(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28007:21: */ +func Xsqlite3DbReallocOrFree(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28292:21: */ var pNew uintptr pNew = Xsqlite3DbRealloc(tls, db, p, n) if !(pNew != 0) { @@ -15058,7 +15048,7 @@ func Xsqlite3DbReallocOrFree(tls *libc.TLS, db uintptr, p uintptr, n U64) uintpt // 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 Xsqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) uintptr { /* sqlite3.c:28023:21: */ +func Xsqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) uintptr { /* sqlite3.c:28308:21: */ var zNew uintptr var n Size_t if z == uintptr(0) { @@ -15072,7 +15062,7 @@ func Xsqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) uintptr { /* sqlite3 return zNew } -func Xsqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n U64) uintptr { /* sqlite3.c:28036:21: */ +func Xsqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n U64) uintptr { /* sqlite3.c:28321:21: */ var zNew uintptr if z != 0 { @@ -15090,7 +15080,7 @@ func Xsqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n U64) uintptr { /* // The text between zStart and zEnd represents a phrase within a larger // SQL statement. Make a copy of this phrase in space obtained form // sqlite3DbMalloc(). Omit leading and trailing whitespace. -func Xsqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:28054:21: */ +func Xsqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:28339:21: */ var n int32 for (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zStart)))]) & 0x01) != 0 { zStart++ @@ -15103,7 +15093,7 @@ func Xsqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) } // Free any prior content in *pz and replace it with a copy of zNew. -func Xsqlite3SetString(tls *libc.TLS, pz uintptr, db uintptr, zNew uintptr) { /* sqlite3.c:28065:21: */ +func Xsqlite3SetString(tls *libc.TLS, pz uintptr, db uintptr, zNew uintptr) { /* sqlite3.c:28350:21: */ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pz))) *(*uintptr)(unsafe.Pointer(pz)) = Xsqlite3DbStrDup(tls, db, zNew) } @@ -15112,11 +15102,11 @@ func Xsqlite3SetString(tls *libc.TLS, pz uintptr, db uintptr, zNew uintptr) { /* // has happened. This routine will set db->mallocFailed, and also // temporarily disable the lookaside memory allocator and interrupt // any running VDBEs. -func Xsqlite3OomFault(tls *libc.TLS, db uintptr) { /* sqlite3.c:28076:21: */ +func Xsqlite3OomFault(tls *libc.TLS, db uintptr) { /* sqlite3.c:28361:21: */ if (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).FbBenignMalloc) == 0) { (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed = U8(1) if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 0 { - libc.AtomicStoreNInt32((db + 392 /* &.u1 */ /* &.isInterrupted */), int32(1), 0) + libc.AtomicStoreNInt32((db + 400 /* &.u1 */ /* &.isInterrupted */), int32(1), 0) } (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0) @@ -15131,10 +15121,10 @@ func Xsqlite3OomFault(tls *libc.TLS, db uintptr) { /* sqlite3.c:28076:21: */ // // The memory allocator is not restarted if there are running // VDBEs. -func Xsqlite3OomClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:28096:21: */ +func Xsqlite3OomClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:28381:21: */ if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0) { (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed = U8(0) - libc.AtomicStoreNInt32((db + 392 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) + libc.AtomicStoreNInt32((db + 400 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable-- (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 { @@ -15146,11 +15136,14 @@ func Xsqlite3OomClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:28096:21: */ } } -// Take actions at the end of an API call to indicate an OOM error -func apiOomError(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:28108:28: */ - Xsqlite3OomClear(tls, db) - Xsqlite3Error(tls, db, SQLITE_NOMEM) - return SQLITE_NOMEM +// Take actions at the end of an API call to deal with error codes. +func apiHandleError(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28393:28: */ + if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || (rc == (SQLITE_IOERR | (int32(12) << 8))) { + Xsqlite3OomClear(tls, db) + Xsqlite3Error(tls, db, SQLITE_NOMEM) + return SQLITE_NOMEM + } + return (rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask) } // This function must be called before exiting any API function (i.e. @@ -15163,13 +15156,13 @@ func apiOomError(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:28108:28: */ // // If an OOM as occurred, then the connection error-code (the value // returned by sqlite3_errcode()) is set to SQLITE_NOMEM. -func Xsqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28126:20: */ +func Xsqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28414:20: */ // If the db handle must hold the connection handle mutex here. // Otherwise the read (and possible write) of db->mallocFailed // is unsafe, as is the call to sqlite3Error(). - if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || (rc == (SQLITE_IOERR | (int32(12) << 8))) { - return apiOomError(tls, db) + if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || (rc != 0) { + return apiHandleError(tls, db, rc) } return (rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask) } @@ -15192,7 +15185,7 @@ func Xsqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:2 // The rest are extensions, not normally found in printf() // An "etByte" is an 8-bit unsigned value. -type EtByte = uint8 /* sqlite3.c:28184:23 */ +type EtByte = uint8 /* sqlite3.c:28472:23 */ // Each builtin conversion character (ex: the 'd' in "%d") is described // by an instance of the following structure @@ -15203,51 +15196,51 @@ type et_info = struct { Ftype EtByte Fcharset EtByte Fprefix EtByte -} /* sqlite3.c:28190:9 */ +} /* sqlite3.c:28478:9 */ // Each builtin conversion character (ex: the 'd' in "%d") is described // by an instance of the following structure -type Et_info = et_info /* sqlite3.c:28197:3 */ +type Et_info = et_info /* sqlite3.c:28485:3 */ // Allowed values for et_info.flags // The following table is searched linearly, so it is good to put the // most frequently used conversion types first. -var aDigits = *(*[33]int8)(unsafe.Pointer(ts + 653 /* "0123456789ABCDEF..." */)) /* sqlite3.c:28210:19 */ -var aPrefix = *(*[7]int8)(unsafe.Pointer(ts + 686 /* "-x0\x00X0" */)) /* sqlite3.c:28211:19 */ +var aDigits = *(*[33]int8)(unsafe.Pointer(ts + 653 /* "0123456789ABCDEF..." */)) /* sqlite3.c:28498:19 */ +var aPrefix = *(*[7]int8)(unsafe.Pointer(ts + 686 /* "-x0\x00X0" */)) /* sqlite3.c:28499:19 */ var fmtinfo = [23]Et_info{ - {Ffmttype: int8('d'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtDECIMAL}, - {Ffmttype: int8('s'), Fflags: EtByte(4), Ftype: EtSTRING}, - {Ffmttype: int8('g'), Fflags: EtByte(1), Ftype: EtGENERIC, Fcharset: EtByte(30)}, - {Ffmttype: int8('z'), Fflags: EtByte(4), Ftype: EtDYNSTRING}, - {Ffmttype: int8('q'), Fflags: EtByte(4), Ftype: EtSQLESCAPE}, - {Ffmttype: int8('Q'), Fflags: EtByte(4), Ftype: EtSQLESCAPE2}, - {Ffmttype: int8('w'), Fflags: EtByte(4), Ftype: EtSQLESCAPE3}, - {Ffmttype: int8('c'), Ftype: EtCHARX}, + {Ffmttype: int8('d'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtDECIMAL)}, + {Ffmttype: int8('s'), Fflags: EtByte(4), Ftype: EtByte(EtSTRING)}, + {Ffmttype: int8('g'), Fflags: EtByte(1), Ftype: EtByte(EtGENERIC), Fcharset: EtByte(30)}, + {Ffmttype: int8('z'), Fflags: EtByte(4), Ftype: EtByte(EtDYNSTRING)}, + {Ffmttype: int8('q'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE)}, + {Ffmttype: int8('Q'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE2)}, + {Ffmttype: int8('w'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE3)}, + {Ffmttype: int8('c'), Ftype: EtByte(EtCHARX)}, {Ffmttype: int8('o'), Fbase: EtByte(8), Fprefix: EtByte(2)}, - {Ffmttype: int8('u'), Fbase: EtByte(10), Ftype: EtDECIMAL}, + {Ffmttype: int8('u'), Fbase: EtByte(10), Ftype: EtByte(EtDECIMAL)}, {Ffmttype: int8('x'), Fbase: EtByte(16), Fcharset: EtByte(16), Fprefix: EtByte(1)}, {Ffmttype: int8('X'), Fbase: EtByte(16), Fprefix: EtByte(4)}, - {Ffmttype: int8('f'), Fflags: EtByte(1), Ftype: EtFLOAT}, - {Ffmttype: int8('e'), Fflags: EtByte(1), Ftype: EtEXP, Fcharset: EtByte(30)}, - {Ffmttype: int8('E'), Fflags: EtByte(1), Ftype: EtEXP, Fcharset: EtByte(14)}, - {Ffmttype: int8('G'), Fflags: EtByte(1), Ftype: EtGENERIC, Fcharset: EtByte(14)}, - {Ffmttype: int8('i'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtDECIMAL}, - {Ffmttype: int8('n'), Ftype: EtSIZE}, - {Ffmttype: int8('%'), Ftype: EtPERCENT}, - {Ffmttype: int8('p'), Fbase: EtByte(16), Ftype: EtPOINTER, Fprefix: EtByte(1)}, + {Ffmttype: int8('f'), Fflags: EtByte(1), Ftype: EtByte(EtFLOAT)}, + {Ffmttype: int8('e'), Fflags: EtByte(1), Ftype: EtByte(EtEXP), Fcharset: EtByte(30)}, + {Ffmttype: int8('E'), Fflags: EtByte(1), Ftype: EtByte(EtEXP), Fcharset: EtByte(14)}, + {Ffmttype: int8('G'), Fflags: EtByte(1), Ftype: EtByte(EtGENERIC), Fcharset: EtByte(14)}, + {Ffmttype: int8('i'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtDECIMAL)}, + {Ffmttype: int8('n'), Ftype: EtByte(EtSIZE)}, + {Ffmttype: int8('%'), Ftype: EtByte(EtPERCENT)}, + {Ffmttype: int8('p'), Fbase: EtByte(16), Ftype: EtByte(EtPOINTER), Fprefix: EtByte(1)}, // All the rest are undocumented and are for internal use only - {Ffmttype: int8('T'), Ftype: EtTOKEN}, - {Ffmttype: int8('S'), Ftype: EtSRCLIST}, - {Ffmttype: int8('r'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtORDINAL}, -} /* sqlite3.c:28212:22 */ + {Ffmttype: int8('T'), Ftype: EtByte(EtTOKEN)}, + {Ffmttype: int8('S'), Ftype: EtByte(EtSRCLIST)}, + {Ffmttype: int8('r'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtORDINAL)}, +} /* sqlite3.c:28500:22 */ // Floating point constants used for rounding var arRound = [10]float64{ 5.0e-01, 5.0e-02, 5.0e-03, 5.0e-04, 5.0e-05, 5.0e-06, 5.0e-07, 5.0e-08, 5.0e-09, 5.0e-10, -} /* sqlite3.c:28243:21 */ +} /* sqlite3.c:28531:21 */ // If SQLITE_OMIT_FLOATING_POINT is defined, then none of the floating point // conversions will work. @@ -15262,7 +15255,7 @@ var arRound = [10]float64{ // 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 *libc.TLS, val uintptr, cnt uintptr) int8 { /* sqlite3.c:28266:13: */ +func et_getdigit(tls *libc.TLS, val uintptr, cnt uintptr) int8 { /* sqlite3.c:28554:13: */ var digit int32 var d float64 if (*(*int32)(unsafe.Pointer(cnt))) <= 0 { @@ -15277,7 +15270,7 @@ func et_getdigit(tls *libc.TLS, val uintptr, cnt uintptr) int8 { /* sqlite3.c:28 } // Set the StrAccum object to an error mode. -func setStrAccumError(tls *libc.TLS, p uintptr, eError U8) { /* sqlite3.c:28282:13: */ +func setStrAccumError(tls *libc.TLS, p uintptr, eError U8) { /* sqlite3.c:28570:13: */ (*StrAccum)(unsafe.Pointer(p)).FaccError = eError if (*StrAccum)(unsafe.Pointer(p)).FmxAlloc != 0 { @@ -15289,21 +15282,21 @@ func setStrAccumError(tls *libc.TLS, p uintptr, eError U8) { /* sqlite3.c:28282: } // Extra argument values from a PrintfArguments object -func getIntArg(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:28292:22: */ +func getIntArg(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:28580:22: */ if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed { return int64(0) } return Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(libc.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*8))) } -func getDoubleArg(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:28296:15: */ +func getDoubleArg(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:28584:15: */ if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed { return 0.0 } return Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(libc.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*8))) } -func getTextArg(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:28300:13: */ +func getTextArg(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:28588:13: */ if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed { return uintptr(0) } @@ -15317,18 +15310,18 @@ func getTextArg(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:28300:13: */ // Do the size check before the memory allocation to prevent rogue // SQL from requesting large allocations using the precision or width // field of the printf() function. -func printfTempBuf(tls *libc.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /* sqlite3.c:28314:13: */ +func printfTempBuf(tls *libc.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /* sqlite3.c:28602:13: */ var z uintptr if (*Sqlite3_str)(unsafe.Pointer(pAccum)).FaccError != 0 { return uintptr(0) } if (n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc)) && (n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc)) { - setStrAccumError(tls, pAccum, SQLITE_TOOBIG) + setStrAccumError(tls, pAccum, uint8(SQLITE_TOOBIG)) return uintptr(0) } z = Xsqlite3DbMallocRaw(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, uint64(n)) if z == uintptr(0) { - setStrAccumError(tls, pAccum, SQLITE_NOMEM) + setStrAccumError(tls, pAccum, uint8(SQLITE_NOMEM)) } return z } @@ -15339,7 +15332,7 @@ func printfTempBuf(tls *libc.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /* // Hard limit on the precision of floating-point conversions. // Render a string given by "fmt" into the StrAccum object. -func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_list) { /* sqlite3.c:28347:17: */ +func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_list) { /* sqlite3.c:28635:17: */ bp := tls.Alloc(100) defer tls.Free(100) @@ -15416,7 +15409,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_lis var pSrc uintptr var k1 int32 var pItem uintptr - xtype = EtINVALID + xtype = EtByte(EtINVALID) zExtra = uintptr(0) pArgList = uintptr(0) // Conversion buffer @@ -15682,7 +15675,7 @@ __14: // Fetch the info entry for the field infop = (uintptr(unsafe.Pointer(&fmtinfo))) - xtype = EtINVALID + xtype = EtByte(EtINVALID) idx = 0 __54: if !(idx < (int32(uint64(unsafe.Sizeof(fmtinfo)) / uint64(unsafe.Sizeof(Et_info{}))))) { @@ -15804,15 +15797,9 @@ __80: if !(v < int64(0)) { goto __85 } - if !(v == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))) { - goto __87 - } - longvalue = (U64((uint64(1))) << 63) - goto __88 -__87: - longvalue = Sqlite_uint64(-v) -__88: - ; + + longvalue = Sqlite_uint64(^v) + longvalue++ prefix = int8('-') goto __86 __85: @@ -15823,162 +15810,162 @@ __86: goto __78 __77: if !(bArgList != 0) { - goto __89 + goto __87 } longvalue = U64(getIntArg(tls, pArgList)) - goto __90 -__89: + goto __88 +__87: if !(flag_long != 0) { - goto __91 + goto __89 } if !(int32(flag_long) == 2) { - goto __93 + goto __91 } longvalue = Sqlite_uint64(libc.VaUint64(&ap)) - goto __94 -__93: - longvalue = Sqlite_uint64(libc.VaUint64(&ap)) -__94: - ; goto __92 __91: - longvalue = Sqlite_uint64(libc.VaUint32(&ap)) + longvalue = Sqlite_uint64(libc.VaUint64(&ap)) __92: ; + goto __90 +__89: + longvalue = Sqlite_uint64(libc.VaUint32(&ap)) __90: ; +__88: + ; prefix = int8(0) __78: ; if !(longvalue == uint64(0)) { - goto __95 + goto __93 } flag_alternateform = EtByte(0) -__95: +__93: ; if !((flag_zeropad != 0) && (precision < (width - (libc.Bool32(int32(prefix) != 0))))) { - goto __96 + goto __94 } precision = (width - (libc.Bool32(int32(prefix) != 0))) -__96: +__94: ; if !(precision < ((SQLITE_PRINT_BUF_SIZE - 10) - (SQLITE_PRINT_BUF_SIZE / 3))) { - goto __97 + goto __95 } nOut = SQLITE_PRINT_BUF_SIZE zOut = bp /* &buf[0] */ - goto __98 -__97: + goto __96 +__95: n = (U64(precision) + uint64(10)) if !(cThousand != 0) { - goto __99 + goto __97 } n = n + (U64(precision / 3)) -__99: +__97: ; zOut = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, int64(n))) if !(zOut == uintptr(0)) { - goto __100 + goto __98 } return -__100: +__98: ; nOut = int32(n) -__98: +__96: ; bufpt = (zOut + uintptr((nOut - 1))) if !(int32(xtype) == EtORDINAL) { - goto __101 + goto __99 } x = (int32(longvalue % uint64(10))) if !((x >= 4) || (((longvalue / uint64(10)) % uint64(10)) == uint64(1))) { - goto __102 + goto __100 } x = 0 -__102: +__100: ; *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = zOrd[((x * 2) + 1)] *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = zOrd[(x * 2)] -__101: +__99: ; cset = (uintptr(unsafe.Pointer(&aDigits)) + uintptr((*Et_info)(unsafe.Pointer(infop)).Fcharset)) base = (*Et_info)(unsafe.Pointer(infop)).Fbase -__103: // Convert to ascii +__101: // Convert to ascii *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = *(*int8)(unsafe.Pointer(cset + uintptr((longvalue % Sqlite_uint64(base))))) longvalue = (longvalue / Sqlite_uint64(base)) - goto __104 -__104: + goto __102 +__102: if longvalue > uint64(0) { - goto __103 + goto __101 } - goto __105 -__105: + goto __103 +__103: ; length = (int32((int64((zOut + uintptr((nOut - 1)))) - int64(bufpt)) / 1)) -__106: +__104: if !(precision > length) { - goto __107 + goto __105 } *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = int8('0') // Zero pad length++ - goto __106 -__107: + goto __104 +__105: ; if !(cThousand != 0) { - goto __108 + goto __106 } nn = ((length - 1) / 3) // Number of "," to insert ix = (((length - 1) % 3) + 1) bufpt -= uintptr(nn) idx = 0 -__109: +__107: if !(nn > 0) { - goto __111 + goto __109 } *(*int8)(unsafe.Pointer(bufpt + uintptr(idx))) = *(*int8)(unsafe.Pointer(bufpt + uintptr((idx + nn)))) ix-- if !(ix == 0) { - goto __112 + goto __110 } *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PreIncInt32(&idx, 1)))) = int8(cThousand) nn-- ix = 3 -__112: - ; - goto __110 __110: - idx++ - goto __109 - goto __111 -__111: ; + goto __108 __108: + idx++ + goto __107 + goto __109 +__109: + ; +__106: ; if !(prefix != 0) { - goto __113 + goto __111 } *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = prefix -__113: +__111: ; // Add sign if !((flag_alternateform != 0) && ((*Et_info)(unsafe.Pointer(infop)).Fprefix != 0)) { - goto __114 + goto __112 } pre = (uintptr(unsafe.Pointer(&aPrefix)) + uintptr((*Et_info)(unsafe.Pointer(infop)).Fprefix)) -__115: +__113: if !((int32(libc.AssignInt8(&x1, *(*int8)(unsafe.Pointer(pre))))) != 0) { - goto __117 + goto __115 } *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = x1 - goto __116 -__116: - pre++ - goto __115 - goto __117 -__117: - ; + goto __114 __114: + pre++ + goto __113 + goto __115 +__115: + ; +__112: ; length = (int32((int64((zOut + uintptr((nOut - 1)))) - int64(bufpt)) / 1)) goto __58 @@ -15986,184 +15973,184 @@ __63: __64: __65: if !(bArgList != 0) { - goto __118 + goto __116 } *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) = getDoubleArg(tls, pArgList) - goto __119 -__118: + goto __117 +__116: *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) = float64(libc.VaFloat64(&ap)) -__119: +__117: ; if !(precision < 0) { - goto __120 + goto __118 } precision = 6 -__120: +__118: ; // Set default precision if !(precision > SQLITE_FP_PRECISION_LIMIT) { - goto __121 + goto __119 } precision = SQLITE_FP_PRECISION_LIMIT -__121: +__119: ; if !(*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) < 0.0) { - goto __122 + goto __120 } *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) = -*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) prefix = int8('-') - goto __123 -__122: + goto __121 +__120: prefix = int8(flag_prefix) -__123: +__121: ; if !((int32(xtype) == EtGENERIC) && (precision > 0)) { - goto __124 + goto __122 } precision-- -__124: +__122: ; idx = (precision & 0xfff) rounder = arRound[(idx % 10)] -__125: +__123: if !(idx >= 10) { - goto __126 + goto __124 } rounder = rounder * (1.0e-10) idx = idx - (10) - goto __125 -__126: + goto __123 +__124: ; if !(int32(xtype) == EtFLOAT) { - goto __127 + goto __125 } *(*float64)(unsafe.Pointer(bp + 80 /* rx */)) = *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) libc.Xmemcpy(tls, bp+72 /* &u */, bp+80 /* &rx */, uint64(unsafe.Sizeof(Sqlite3_uint64(0)))) ex = (-1023 + (int32((*(*Sqlite3_uint64)(unsafe.Pointer(bp + 72 /* u */)) >> 52) & uint64(0x7ff)))) if !((precision + (ex / 3)) < 15) { - goto __128 + goto __126 } rounder = rounder + (*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) * 3e-16) -__128: +__126: ; *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) += rounder -__127: +__125: ; // Normalize realvalue to within 10.0 > realvalue >= 1.0 exp = 0 if !(Xsqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */))) != 0) { - goto __129 + goto __127 } bufpt = ts + 695 /* "NaN" */ length = 3 goto __58 -__129: +__127: ; if !(*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) > 0.0) { - goto __130 + goto __128 } scale = 1.0 -__131: +__129: if !((*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) >= (1e100 * scale)) && (exp <= 350)) { - goto __132 + goto __130 } scale = scale * (1e100) exp = exp + (100) + goto __129 +__130: + ; +__131: + if !((*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) >= (1e10 * scale)) && (exp <= 350)) { + goto __132 + } + scale = scale * (1e10) + exp = exp + (10) goto __131 __132: ; __133: - if !((*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) >= (1e10 * scale)) && (exp <= 350)) { - goto __134 - } - scale = scale * (1e10) - exp = exp + (10) - goto __133 -__134: - ; -__135: if !((*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) >= (10.0 * scale)) && (exp <= 350)) { - goto __136 + goto __134 } scale = scale * (10.0) exp++ - goto __135 -__136: + goto __133 +__134: ; *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) /= scale -__137: +__135: if !(*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) < 1e-8) { - goto __138 + goto __136 } *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) *= 1e8 exp = exp - (8) - goto __137 -__138: + goto __135 +__136: ; -__139: +__137: if !(*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) < 1.0) { - goto __140 + goto __138 } *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) *= 10.0 exp-- - goto __139 -__140: + goto __137 +__138: ; if !(exp > 350) { - goto __141 + goto __139 } bufpt = bp /* &buf[0] */ *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = prefix libc.Xmemcpy(tls, (bp /* &buf[0] */ + uintptr((libc.Bool32(int32(prefix) != 0)))), ts+699 /* "Inf" */, uint64(4)) length = (3 + (libc.Bool32(int32(prefix) != 0))) goto __58 -__141: +__139: ; -__130: +__128: ; bufpt = bp /* &buf[0] */ // If the field type is etGENERIC, then convert to either etEXP // or etFLOAT, as appropriate. if !(int32(xtype) != EtFLOAT) { - goto __142 + goto __140 } *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) += rounder if !(*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) >= 10.0) { - goto __143 + goto __141 } *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) *= 0.1 exp++ -__143: +__141: ; -__142: +__140: ; if !(int32(xtype) == EtGENERIC) { - goto __144 + goto __142 } flag_rtz = libc.BoolUint8(!(flag_alternateform != 0)) if !((exp < -4) || (exp > precision)) { - goto __146 + goto __144 } - xtype = EtEXP - goto __147 -__146: - precision = (precision - exp) - xtype = EtFLOAT -__147: - ; + xtype = EtByte(EtEXP) goto __145 __144: - flag_rtz = flag_altform2 + precision = (precision - exp) + xtype = EtByte(EtFLOAT) __145: + ; + goto __143 +__142: + flag_rtz = flag_altform2 +__143: ; if !(int32(xtype) == EtEXP) { - goto __148 + goto __146 } e2 = 0 - goto __149 -__148: + goto __147 +__146: e2 = exp -__149: +__147: ; // Size of a temporary buffer needed szBufNeeded = ((((func() int64 { @@ -16172,17 +16159,17 @@ __149: } return int64(0) }()) + I64(precision)) + I64(width)) + int64(15)) - if !(szBufNeeded > SQLITE_PRINT_BUF_SIZE) { - goto __150 + if !(szBufNeeded > int64(SQLITE_PRINT_BUF_SIZE)) { + goto __148 } bufpt = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, szBufNeeded)) if !(bufpt == uintptr(0)) { - goto __151 + goto __149 } return -__151: +__149: ; -__150: +__148: ; zOut = bufpt @@ -16195,120 +16182,120 @@ __150: }()) | int32(flag_alternateform)) | int32(flag_altform2))) // The sign in front of the number if !(prefix != 0) { - goto __152 + goto __150 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = prefix -__152: +__150: ; // Digits prior to the decimal point if !(e2 < 0) { - goto __153 + goto __151 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('0') - goto __154 -__153: + goto __152 +__151: ; -__155: +__153: if !(e2 >= 0) { - goto __157 + goto __155 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = et_getdigit(tls, bp+88 /* &realvalue */, bp+96 /* &nsd */) - goto __156 -__156: - e2-- - goto __155 - goto __157 -__157: - ; + goto __154 __154: + e2-- + goto __153 + goto __155 +__155: + ; +__152: ; // The decimal point if !(flag_dp != 0) { - goto __158 + goto __156 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('.') -__158: +__156: ; // "0" digits after the decimal point but before the first // significant digit of the number e2++ -__159: +__157: if !(e2 < 0) { - goto __161 + goto __159 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('0') - goto __160 -__160: + goto __158 +__158: precision-- e2++ + goto __157 goto __159 - goto __161 -__161: +__159: ; // Significant digits after the decimal point -__162: +__160: if !((libc.PostDecInt32(&precision, 1)) > 0) { - goto __163 + goto __161 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = et_getdigit(tls, bp+88 /* &realvalue */, bp+96 /* &nsd */) - goto __162 -__163: + goto __160 +__161: ; // Remove trailing zeros and the "." if no digits follow the "." if !((flag_rtz != 0) && (flag_dp != 0)) { + goto __162 + } +__163: + if !(int32(*(*int8)(unsafe.Pointer(bufpt + libc.UintptrFromInt32(-1)))) == '0') { goto __164 } -__165: - if !(int32(*(*int8)(unsafe.Pointer(bufpt + libc.UintptrFromInt32(-1)))) == '0') { - goto __166 - } *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = int8(0) - goto __165 -__166: + goto __163 +__164: ; if !(int32(*(*int8)(unsafe.Pointer(bufpt + libc.UintptrFromInt32(-1)))) == '.') { - goto __167 + goto __165 } if !(flag_altform2 != 0) { - goto __168 + goto __166 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('0') - goto __169 -__168: + goto __167 +__166: *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = int8(0) -__169: - ; __167: ; -__164: +__165: + ; +__162: ; // Add the "eNNN" suffix if !(int32(xtype) == EtEXP) { - goto __170 + goto __168 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = aDigits[(*Et_info)(unsafe.Pointer(infop)).Fcharset] if !(exp < 0) { - goto __171 + goto __169 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('-') exp = -exp - goto __172 -__171: + goto __170 +__169: *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('+') -__172: +__170: ; if !(exp >= 100) { - goto __173 + goto __171 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = (int8((exp / 100) + '0')) // 100's digit exp = exp % (100) -__173: +__171: ; *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = (int8((exp / 10) + '0')) // 10's digit *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = (int8((exp % 10) + '0')) // 1's digit -__170: +__168: ; *(*int8)(unsafe.Pointer(bufpt)) = int8(0) @@ -16321,41 +16308,41 @@ __170: // Special case: Add leading zeros if the flag_zeropad flag is // set and we are not left justified if !(((flag_zeropad != 0) && !(flag_leftjustify != 0)) && (length < width)) { - goto __174 + goto __172 } nPad = (width - length) i = width -__175: +__173: if !(i >= nPad) { - goto __177 + goto __175 } *(*int8)(unsafe.Pointer(bufpt + uintptr(i))) = *(*int8)(unsafe.Pointer(bufpt + uintptr((i - nPad)))) - goto __176 -__176: + goto __174 +__174: i-- + goto __173 goto __175 - goto __177 -__177: +__175: ; i = (libc.Bool32(int32(prefix) != 0)) -__178: +__176: if !(libc.PostDecInt32(&nPad, 1) != 0) { - goto __179 + goto __177 } *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&i, 1)))) = int8('0') - goto __178 -__179: + goto __176 +__177: ; length = width -__174: +__172: ; goto __58 __66: if !(!(bArgList != 0)) { - goto __180 + goto __178 } *(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar) -__180: +__178: ; length = libc.AssignInt32(&width, 0) goto __58 @@ -16366,92 +16353,92 @@ __67: goto __58 __68: if !(bArgList != 0) { - goto __181 + goto __179 } bufpt = getTextArg(tls, pArgList) length = 1 if !(bufpt != 0) { - goto __183 + goto __181 } *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = int8(libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1)))))) if !((c & 0xc0) == 0xc0) { + goto __183 + } +__184: + if !((length < 4) && ((int32(*(*int8)(unsafe.Pointer(bufpt))) & 0xc0) == 0x80)) { goto __185 } -__186: - if !((length < 4) && ((int32(*(*int8)(unsafe.Pointer(bufpt))) & 0xc0) == 0x80)) { - goto __187 - } *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(libc.PostIncInt32(&length, 1)))) = *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) - goto __186 -__187: - ; + goto __184 __185: ; - goto __184 __183: - *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = int8(0) -__184: ; goto __182 __181: + *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = int8(0) +__182: + ; + goto __180 +__179: ch = uint32(libc.VaUint32(&ap)) if !(ch < uint32(0x00080)) { - goto __188 + goto __186 } *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = (int8(ch & uint32(0xff))) length = 1 - goto __189 -__188: + goto __187 +__186: if !(ch < uint32(0x00800)) { - goto __190 + goto __188 } *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = (int8(0xc0 + int32((U8((ch >> 6) & uint32(0x1f)))))) *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + 1)) = (int8(0x80 + int32((U8(ch & uint32(0x3f)))))) length = 2 - goto __191 -__190: + goto __189 +__188: if !(ch < uint32(0x10000)) { - goto __192 + goto __190 } *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = (int8(0xe0 + int32((U8((ch >> 12) & uint32(0x0f)))))) *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + 1)) = (int8(0x80 + int32((U8((ch >> 6) & uint32(0x3f)))))) *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + 2)) = (int8(0x80 + int32((U8(ch & uint32(0x3f)))))) length = 3 - goto __193 -__192: + goto __191 +__190: *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = (int8(0xf0 + int32((U8((ch >> 18) & uint32(0x07)))))) *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + 1)) = (int8(0x80 + int32((U8((ch >> 12) & uint32(0x3f)))))) *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + 2)) = (int8(0x80 + int32((U8((ch >> 6) & uint32(0x3f)))))) *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + 3)) = (int8(0x80 + int32((U8(ch & uint32(0x3f)))))) length = 4 -__193: - ; __191: ; __189: ; -__182: +__187: + ; +__180: ; if !(precision > 1) { - goto __194 + goto __192 } width = width - (precision - 1) if !((width > 1) && !(flag_leftjustify != 0)) { - goto __195 + goto __193 } Xsqlite3_str_appendchar(tls, pAccum, (width - 1), int8(' ')) width = 0 -__195: - ; -__196: - if !(libc.PostDecInt32(&precision, 1) > 1) { - goto __197 - } - Xsqlite3_str_append(tls, pAccum, bp /* &buf[0] */, length) - goto __196 -__197: +__193: ; __194: + if !(libc.PostDecInt32(&precision, 1) > 1) { + goto __195 + } + Xsqlite3_str_append(tls, pAccum, bp /* &buf[0] */, length) + goto __194 +__195: + ; +__192: ; bufpt = bp /* &buf[0] */ flag_altform2 = EtByte(1) @@ -16459,30 +16446,30 @@ __194: __69: __70: if !(bArgList != 0) { - goto __198 + goto __196 } bufpt = getTextArg(tls, pArgList) - xtype = EtSTRING - goto __199 -__198: + xtype = EtByte(EtSTRING) + goto __197 +__196: bufpt = libc.VaUintptr(&ap) -__199: +__197: ; if !(bufpt == uintptr(0)) { - goto __200 + goto __198 } bufpt = ts + 703 /* "" */ - goto __201 -__200: + goto __199 +__198: if !(int32(xtype) == EtDYNSTRING) { - goto __202 + goto __200 } if !((((((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar == U32(0)) && ((*Sqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0)) && (width == 0)) && (precision < 0)) && (int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0)) { - goto __203 + goto __201 } // Special optimization for sqlite3_mprintf("%z..."): // Extend an existing memory allocation rather than creating @@ -16494,86 +16481,86 @@ __200: *(*U8)(unsafe.Pointer(pAccum + 29 /* &.printfFlags */)) |= U8((SQLITE_PRINTF_MALLOCED)) length = 0 goto __58 -__203: - ; - zExtra = bufpt -__202: - ; __201: + ; + zExtra = bufpt +__200: + ; +__199: ; if !(precision >= 0) { - goto __204 + goto __202 } if !(flag_altform2 != 0) { - goto __206 + goto __204 } // Set length to the number of bytes needed in order to display // precision characters z = bufpt -__208: +__206: if !((libc.PostDecInt32(&precision, 1) > 0) && (*(*uint8)(unsafe.Pointer(z)) != 0)) { - goto __209 + goto __207 } if !((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) >= 0xc0) { + goto __208 + } +__209: + if !((int32(*(*uint8)(unsafe.Pointer(z))) & 0xc0) == 0x80) { goto __210 } -__211: - if !((int32(*(*uint8)(unsafe.Pointer(z))) & 0xc0) == 0x80) { - goto __212 - } z++ - goto __211 -__212: - ; + goto __209 __210: ; +__208: + ; - goto __208 -__209: - ; - length = (int32((int64(z) - int64(bufpt)) / 1)) - goto __207 -__206: - length = 0 -__213: - if !((length < precision) && (*(*int8)(unsafe.Pointer(bufpt + uintptr(length))) != 0)) { - goto __215 - } - goto __214 -__214: - length++ - goto __213 - goto __215 -__215: - ; + goto __206 __207: ; + length = (int32((int64(z) - int64(bufpt)) / 1)) goto __205 __204: - length = (0x7fffffff & int32(libc.Xstrlen(tls, bufpt))) + length = 0 +__211: + if !((length < precision) && (*(*int8)(unsafe.Pointer(bufpt + uintptr(length))) != 0)) { + goto __213 + } + goto __212 +__212: + length++ + goto __211 + goto __213 +__213: + ; __205: ; + goto __203 +__202: + length = (0x7fffffff & int32(libc.Xstrlen(tls, bufpt))) +__203: + ; adjust_width_for_utf8: if !((flag_altform2 != 0) && (width > 0)) { - goto __216 + goto __214 } // Adjust width to account for extra bytes in UTF-8 characters ii = (length - 1) -__217: +__215: if !(ii >= 0) { - goto __218 + goto __216 } if !((int32(*(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostDecInt32(&ii, 1))))) & 0xc0) == 0x80) { - goto __219 + goto __217 } width++ -__219: - ; - goto __217 -__218: +__217: ; + goto __215 __216: ; +__214: + ; goto __58 __71: // %q: Escape ' characters __72: // %Q: Escape ' and enclose in '...' @@ -16586,17 +16573,17 @@ __73: }() if !(bArgList != 0) { - goto __220 + goto __218 } escarg = getTextArg(tls, pArgList) - goto __221 -__220: + goto __219 +__218: escarg = libc.VaUintptr(&ap) -__221: +__219: ; isnull = (libc.Bool32(escarg == uintptr(0))) if !(isnull != 0) { - goto __222 + goto __220 } escarg = func() uintptr { if int32(xtype) == EtSQLESCAPE2 { @@ -16604,7 +16591,7 @@ __221: } return ts + 709 /* "(NULL)" */ }() -__222: +__220: ; // For %q, %Q, and %w, the precision is the number of bytes (or // characters if the ! flags is present) to use from the input. @@ -16612,86 +16599,86 @@ __222: // of output characters may be larger than the precision. k = precision i1 = libc.AssignInt32(&n1, 0) -__223: +__221: if !((k != 0) && ((int32(libc.AssignInt8(&ch1, *(*int8)(unsafe.Pointer(escarg + uintptr(i1)))))) != 0)) { - goto __225 + goto __223 } if !(int32(ch1) == int32(q)) { - goto __226 + goto __224 } n1++ -__226: +__224: ; if !((flag_altform2 != 0) && ((int32(ch1) & 0xc0) == 0xc0)) { + goto __225 + } +__226: + if !((int32(*(*int8)(unsafe.Pointer(escarg + uintptr((i1 + 1))))) & 0xc0) == 0x80) { goto __227 } -__228: - if !((int32(*(*int8)(unsafe.Pointer(escarg + uintptr((i1 + 1))))) & 0xc0) == 0x80) { - goto __229 - } i1++ - goto __228 -__229: - ; + goto __226 __227: ; - goto __224 -__224: +__225: + ; + goto __222 +__222: i1++ k-- + goto __221 goto __223 - goto __225 -__225: +__223: ; needQuote = (libc.Bool32(!(isnull != 0) && (int32(xtype) == EtSQLESCAPE2))) n1 = n1 + (i1 + 3) if !(n1 > SQLITE_PRINT_BUF_SIZE) { - goto __230 + goto __228 } bufpt = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, int64(n1))) if !(bufpt == uintptr(0)) { - goto __232 + goto __230 } return -__232: - ; - goto __231 __230: + ; + goto __229 +__228: bufpt = bp /* &buf[0] */ -__231: +__229: ; j = 0 if !(needQuote != 0) { - goto __233 + goto __231 } *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&j, 1)))) = q -__233: +__231: ; k = i1 i1 = 0 -__234: +__232: if !(i1 < k) { - goto __236 + goto __234 } *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&j, 1)))) = libc.AssignInt8(&ch1, *(*int8)(unsafe.Pointer(escarg + uintptr(i1)))) if !(int32(ch1) == int32(q)) { - goto __237 + goto __235 } *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&j, 1)))) = ch1 -__237: - ; - goto __235 __235: + ; + goto __233 +__233: i1++ + goto __232 goto __234 - goto __236 -__236: +__234: ; if !(needQuote != 0) { - goto __238 + goto __236 } *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&j, 1)))) = q -__238: +__236: ; *(*int8)(unsafe.Pointer(bufpt + uintptr(j))) = int8(0) length = j @@ -16699,41 +16686,41 @@ __238: __74: if !((int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags) & SQLITE_PRINTF_INTERNAL) == 0) { - goto __239 + goto __237 } return -__239: +__237: ; pToken = libc.VaUintptr(&ap) if !((pToken != 0) && ((*Token)(unsafe.Pointer(pToken)).Fn != 0)) { - goto __240 + goto __238 } Xsqlite3_str_append(tls, pAccum, (*Token)(unsafe.Pointer(pToken)).Fz, int32((*Token)(unsafe.Pointer(pToken)).Fn)) -__240: +__238: ; length = libc.AssignInt32(&width, 0) goto __58 __75: if !((int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags) & SQLITE_PRINTF_INTERNAL) == 0) { - goto __241 + goto __239 } return -__241: +__239: ; pSrc = libc.VaUintptr(&ap) k1 = int32(libc.VaInt32(&ap)) pItem = ((pSrc + 8 /* &.a */) + uintptr(k1)*112) - if !((*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase != 0) { - goto __242 + if !((*SrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0) { + goto __240 } - Xsqlite3_str_appendall(tls, pAccum, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase) + Xsqlite3_str_appendall(tls, pAccum, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase) Xsqlite3_str_append(tls, pAccum, ts+716 /* "." */, 1) -__242: +__240: ; - Xsqlite3_str_appendall(tls, pAccum, (*SrcList_item)(unsafe.Pointer(pItem)).FzName) + Xsqlite3_str_appendall(tls, pAccum, (*SrcItem)(unsafe.Pointer(pItem)).FzName) length = libc.AssignInt32(&width, 0) goto __58 @@ -16751,33 +16738,33 @@ __58: // then the values have been translated prior to reaching this point. width = width - (length) if !(width > 0) { - goto __243 + goto __241 } if !(!(flag_leftjustify != 0)) { - goto __245 + goto __243 } Xsqlite3_str_appendchar(tls, pAccum, width, int8(' ')) -__245: +__243: ; Xsqlite3_str_append(tls, pAccum, bufpt, length) if !(flag_leftjustify != 0) { - goto __246 + goto __244 } Xsqlite3_str_appendchar(tls, pAccum, width, int8(' ')) -__246: - ; - goto __244 -__243: - Xsqlite3_str_append(tls, pAccum, bufpt, length) __244: ; + goto __242 +__241: + Xsqlite3_str_append(tls, pAccum, bufpt, length) +__242: + ; if !(zExtra != 0) { - goto __247 + goto __245 } Xsqlite3DbFree(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, zExtra) zExtra = uintptr(0) -__247: +__245: ; goto __4 __4: @@ -16788,7 +16775,7 @@ __5: // End for loop over the format string } -var zOrd = *(*[9]int8)(unsafe.Pointer(ts + 718 /* "thstndrd" */)) /* sqlite3.c:28611:29 */ +var zOrd = *(*[9]int8)(unsafe.Pointer(ts + 718 /* "thstndrd" */)) /* sqlite3.c:28898:29 */ // End of function @@ -16797,7 +16784,7 @@ var zOrd = *(*[9]int8)(unsafe.Pointer(ts + 718 /* "thstndrd" */)) /* sqlite3.c:2 // // 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 *libc.TLS, p uintptr, N int32) int32 { /* sqlite3.c:29051:12: */ +func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite3.c:29338:12: */ var zNew uintptr // Only called if really needed if (*StrAccum)(unsafe.Pointer(p)).FaccError != 0 { @@ -16805,7 +16792,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite return 0 } if (*StrAccum)(unsafe.Pointer(p)).FmxAlloc == U32(0) { - setStrAccumError(tls, p, SQLITE_TOOBIG) + setStrAccumError(tls, p, uint8(SQLITE_TOOBIG)) return (int32(((*StrAccum)(unsafe.Pointer(p)).FnAlloc - (*StrAccum)(unsafe.Pointer(p)).FnChar) - U32(1))) } else { var zOld uintptr @@ -16815,7 +16802,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite zOld = uintptr(0) } var szNew I64 = I64((*StrAccum)(unsafe.Pointer(p)).FnChar) - szNew = szNew + (I64(N + 1)) + szNew = szNew + (Sqlite3_int64(N) + int64(1)) if (szNew + I64((*StrAccum)(unsafe.Pointer(p)).FnChar)) <= I64((*StrAccum)(unsafe.Pointer(p)).FmxAlloc) { // Force exponential buffer size growth as long as it does not overflow, // to avoid having to call this routine too often @@ -16823,7 +16810,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite } if szNew > I64((*StrAccum)(unsafe.Pointer(p)).FmxAlloc) { Xsqlite3_str_reset(tls, p) - setStrAccumError(tls, p, SQLITE_TOOBIG) + setStrAccumError(tls, p, uint8(SQLITE_TOOBIG)) return 0 } else { (*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(int32(szNew)) @@ -16843,7 +16830,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite *(*U8)(unsafe.Pointer(p + 29 /* &.printfFlags */)) |= U8((SQLITE_PRINTF_MALLOCED)) } else { Xsqlite3_str_reset(tls, p) - setStrAccumError(tls, p, SQLITE_NOMEM) + setStrAccumError(tls, p, uint8(SQLITE_NOMEM)) return 0 } } @@ -16851,7 +16838,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite } // Append N copies of character c to the given string buffer. -func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c int8) { /* sqlite3.c:29101:17: */ +func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c int8) { /* sqlite3.c:29388:17: */ if ((I64((*Sqlite3_str)(unsafe.Pointer(p)).FnChar) + I64(N)) >= I64((*Sqlite3_str)(unsafe.Pointer(p)).FnAlloc)) && ((libc.AssignInt32(&N, sqlite3StrAccumEnlarge(tls, p, N))) <= 0) { return @@ -16867,7 +16854,7 @@ func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c int8) { /* sql // This is a helper routine to sqlite3_str_append() that does special-case // work (enlarging the buffer) using tail recursion, so that the // sqlite3_str_append() routine can use fast calling semantics. -func enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29117:29: */ +func enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29404:29: */ N = sqlite3StrAccumEnlarge(tls, p, N) if N > 0 { libc.Xmemcpy(tls, ((*StrAccum)(unsafe.Pointer(p)).FzText + uintptr((*StrAccum)(unsafe.Pointer(p)).FnChar)), z, uint64(N)) @@ -16877,7 +16864,7 @@ func enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3 // Append N bytes of text from z to the StrAccum object. Increase the // size of the memory allocation for StrAccum if necessary. -func Xsqlite3_str_append(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29129:17: */ +func Xsqlite3_str_append(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29416:17: */ if ((*Sqlite3_str)(unsafe.Pointer(p)).FnChar + U32(N)) >= (*Sqlite3_str)(unsafe.Pointer(p)).FnAlloc { enlargeAndAppend(tls, p, z, N) @@ -16889,14 +16876,14 @@ func Xsqlite3_str_append(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqli } // Append the complete text of zero-terminated string z[] to the p string. -func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:29146:17: */ +func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:29433:17: */ Xsqlite3_str_append(tls, p, z, Xsqlite3Strlen30(tls, z)) } // 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 *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29156:29: */ +func strAccumFinishRealloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29443:29: */ var zText uintptr zText = Xsqlite3DbMallocRaw(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, (uint64((*StrAccum)(unsafe.Pointer(p)).FnChar + U32(1)))) @@ -16904,13 +16891,13 @@ func strAccumFinishRealloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:2915 libc.Xmemcpy(tls, zText, (*StrAccum)(unsafe.Pointer(p)).FzText, (uint64((*StrAccum)(unsafe.Pointer(p)).FnChar + U32(1)))) *(*U8)(unsafe.Pointer(p + 29 /* &.printfFlags */)) |= U8((SQLITE_PRINTF_MALLOCED)) } else { - setStrAccumError(tls, p, SQLITE_NOMEM) + setStrAccumError(tls, p, uint8(SQLITE_NOMEM)) } (*StrAccum)(unsafe.Pointer(p)).FzText = zText return zText } -func Xsqlite3StrAccumFinish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29169:21: */ +func Xsqlite3StrAccumFinish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29456:21: */ if (*StrAccum)(unsafe.Pointer(p)).FzText != 0 { *(*int8)(unsafe.Pointer((*StrAccum)(unsafe.Pointer(p)).FzText + uintptr((*StrAccum)(unsafe.Pointer(p)).FnChar))) = int8(0) if ((*StrAccum)(unsafe.Pointer(p)).FmxAlloc > U32(0)) && !((int32((*StrAccum)(unsafe.Pointer((p))).FprintfFlags) & SQLITE_PRINTF_MALLOCED) != 0) { @@ -16924,10 +16911,10 @@ func Xsqlite3StrAccumFinish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:291 // sqlite3_malloc() fails to provide space for a real one. This // sqlite3_str object accepts no new text and always returns // an SQLITE_NOMEM error. -var sqlite3OomStr = Sqlite3_str{FaccError: SQLITE_NOMEM} /* sqlite3.c:29185:20 */ +var sqlite3OomStr = Sqlite3_str{FaccError: U8(SQLITE_NOMEM)} /* sqlite3.c:29472:20 */ // Finalize a string created using sqlite3_str_new(). -func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29191:17: */ +func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29478:17: */ var z uintptr if (p != uintptr(0)) && (p != uintptr(unsafe.Pointer(&sqlite3OomStr))) { z = Xsqlite3StrAccumFinish(tls, p) @@ -16939,7 +16926,7 @@ func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29191: } // Return any error code associated with p -func Xsqlite3_str_errcode(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29203:16: */ +func Xsqlite3_str_errcode(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29490:16: */ if p != 0 { return int32((*Sqlite3_str)(unsafe.Pointer(p)).FaccError) } @@ -16947,7 +16934,7 @@ func Xsqlite3_str_errcode(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29203:1 } // Return the current length of p in bytes -func Xsqlite3_str_length(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29208:16: */ +func Xsqlite3_str_length(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29495:16: */ if p != 0 { return int32((*Sqlite3_str)(unsafe.Pointer(p)).FnChar) } @@ -16955,7 +16942,7 @@ func Xsqlite3_str_length(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29208:16 } // Return the current value for p -func Xsqlite3_str_value(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29213:17: */ +func Xsqlite3_str_value(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29500:17: */ if (p == uintptr(0)) || ((*Sqlite3_str)(unsafe.Pointer(p)).FnChar == U32(0)) { return uintptr(0) } @@ -16964,7 +16951,7 @@ func Xsqlite3_str_value(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29213:1 } // Reset an StrAccum string. Reclaim all malloced memory. -func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) { /* sqlite3.c:29222:17: */ +func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) { /* sqlite3.c:29509:17: */ if (int32((*StrAccum)(unsafe.Pointer((p))).FprintfFlags) & SQLITE_PRINTF_MALLOCED) != 0 { Xsqlite3DbFree(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, (*StrAccum)(unsafe.Pointer(p)).FzText) *(*U8)(unsafe.Pointer(p + 29 /* &.printfFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(SQLITE_PRINTF_MALLOCED))) @@ -16986,7 +16973,7 @@ func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) { /* sqlite3.c:29222:17: */ // 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 Xsqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n int32, mx int32) { /* sqlite3.c:29246:21: */ +func Xsqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n int32, mx int32) { /* sqlite3.c:29533:21: */ (*StrAccum)(unsafe.Pointer(p)).FzText = zBase (*StrAccum)(unsafe.Pointer(p)).Fdb = db (*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(n) @@ -16997,13 +16984,13 @@ func Xsqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n } // Allocate and initialize a new dynamic string object -func Xsqlite3_str_new(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:29257:24: */ +func Xsqlite3_str_new(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:29544:24: */ var p uintptr = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Sqlite3_str{}))) if p != 0 { Xsqlite3StrAccumInit(tls, p, uintptr(0), uintptr(0), 0, func() int32 { if db != 0 { - return *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */))) + return *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */))) } return SQLITE_MAX_LENGTH }()) @@ -17015,7 +17002,7 @@ func Xsqlite3_str_new(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:29257:24 // Print into memory obtained from sqliteMalloc(). Use the internal // %-conversion extensions. -func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29272:21: */ +func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29559:21: */ bp := tls.Alloc(102) defer tls.Free(102) @@ -17025,8 +17012,8 @@ func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) ui // var acc StrAccum at bp, 32 Xsqlite3StrAccumInit(tls, bp /* &acc */, db, bp+32 /* &zBase[0] */, int32(unsafe.Sizeof([70]int8{})), - *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) - (*StrAccum)(unsafe.Pointer(bp /* &acc */)).FprintfFlags = SQLITE_PRINTF_INTERNAL + *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) + (*StrAccum)(unsafe.Pointer(bp /* &acc */)).FprintfFlags = U8(SQLITE_PRINTF_INTERNAL) Xsqlite3_str_vappendf(tls, bp /* &acc */, zFormat, ap) z = Xsqlite3StrAccumFinish(tls, bp /* &acc */) if int32((*StrAccum)(unsafe.Pointer(bp /* &acc */)).FaccError) == SQLITE_NOMEM { @@ -17037,7 +17024,7 @@ func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) ui // Print into memory obtained from sqliteMalloc(). Use the internal // %-conversion extensions. -func Xsqlite3MPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29292:21: */ +func Xsqlite3MPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29579:21: */ var ap Va_list _ = ap var z uintptr @@ -17049,7 +17036,7 @@ func Xsqlite3MPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, va uintptr) uin // Print into memory obtained from sqlite3_malloc(). Omit the internal // %-conversion extensions. -func Xsqlite3_vmprintf(tls *libc.TLS, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29305:17: */ +func Xsqlite3_vmprintf(tls *libc.TLS, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29592:17: */ bp := tls.Alloc(102) defer tls.Free(102) @@ -17069,7 +17056,7 @@ func Xsqlite3_vmprintf(tls *libc.TLS, zFormat uintptr, ap Va_list) uintptr { /* // Print into memory obtained from sqlite3_malloc()(). Omit the internal // %-conversion extensions. -func Xsqlite3_mprintf(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29329:17: */ +func Xsqlite3_mprintf(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29616:17: */ var ap Va_list _ = ap var z uintptr @@ -17093,7 +17080,7 @@ func Xsqlite3_mprintf(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* s // mistake. // // sqlite3_vsnprintf() is the varargs version. -func Xsqlite3_vsnprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29354:17: */ +func Xsqlite3_vsnprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29641:17: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -17108,7 +17095,7 @@ func Xsqlite3_vsnprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, a return zBuf } -func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29369:17: */ +func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29656:17: */ var z uintptr var ap Va_list _ = ap @@ -17130,7 +17117,7 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // 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 *libc.TLS, iErrCode int32, zFormat uintptr, ap Va_list) { /* sqlite3.c:29392:13: */ +func renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Va_list) { /* sqlite3.c:29679:13: */ bp := tls.Alloc(242) defer tls.Free(242) @@ -17146,7 +17133,7 @@ func renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Va_list) { } // Format and write a message to the log if logging is enabled. -func Xsqlite3_log(tls *libc.TLS, iErrCode int32, zFormat uintptr, va uintptr) { /* sqlite3.c:29405:17: */ +func Xsqlite3_log(tls *libc.TLS, iErrCode int32, zFormat uintptr, va uintptr) { /* sqlite3.c:29692:17: */ var ap Va_list _ = ap // Vararg list if Xsqlite3Config.FxLog != 0 { @@ -17158,7 +17145,7 @@ func Xsqlite3_log(tls *libc.TLS, iErrCode int32, zFormat uintptr, va uintptr) { // variable-argument wrapper around sqlite3_str_vappendf(). The bFlags argument // can contain the bit SQLITE_PRINTF_INTERNAL enable internal formats. -func Xsqlite3_str_appendf(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:29446:17: */ +func Xsqlite3_str_appendf(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:29733:17: */ var ap Va_list _ = ap ap = va @@ -17213,7 +17200,7 @@ type sqlite3PrngType = struct { Fi uint8 Fj uint8 Fs [256]uint8 -} /* sqlite3.c:30258:19 */ +} /* sqlite3.c:30551:19 */ //************* End of printf.c ********************************************* //************* Begin file treeview.c *************************************** @@ -17257,10 +17244,10 @@ type sqlite3PrngType = struct { // All threads share a single random number generator. // This structure is the current state of the generator. -var sqlite3Prng sqlite3PrngType /* sqlite3.c:30262:3: */ +var sqlite3Prng sqlite3PrngType /* sqlite3.c:30555:3: */ // Return N random bytes. -func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { /* sqlite3.c:30267:17: */ +func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { /* sqlite3.c:30560:17: */ bp := tls.Alloc(256) defer tls.Free(256) @@ -17334,16 +17321,16 @@ func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { /* sqlite3.c:30 // // The sqlite3_test_control() interface calls these routines to // control the PRNG. -var sqlite3SavedPrng sqlite3PrngType /* sqlite3.c:30353:42: */ +var sqlite3SavedPrng sqlite3PrngType /* sqlite3.c:30646:42: */ -func Xsqlite3PrngSaveState(tls *libc.TLS) { /* sqlite3.c:30354:21: */ +func Xsqlite3PrngSaveState(tls *libc.TLS) { /* sqlite3.c:30647:21: */ libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&sqlite3SavedPrng)), uintptr(unsafe.Pointer(&sqlite3Prng)), uint64(unsafe.Sizeof(sqlite3Prng))) } -func Xsqlite3PrngRestoreState(tls *libc.TLS) { /* sqlite3.c:30361:21: */ +func Xsqlite3PrngRestoreState(tls *libc.TLS) { /* sqlite3.c:30654:21: */ libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&sqlite3Prng)), uintptr(unsafe.Pointer(&sqlite3SavedPrng)), @@ -17351,7 +17338,7 @@ func Xsqlite3PrngRestoreState(tls *libc.TLS) { /* sqlite3.c:30361:21: */ } // Create a new thread -func Xsqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:30597:20: */ +func Xsqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:30890:20: */ var p uintptr *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) @@ -17371,7 +17358,7 @@ func Xsqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui } // Get the results of the thread -func Xsqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) int32 { /* sqlite3.c:30621:20: */ +func Xsqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) int32 { /* sqlite3.c:30914:20: */ if p == uintptr(0) { return SQLITE_NOMEM @@ -17438,7 +17425,7 @@ var sqlite3Utf8Trans1 = [64]uint8{ uint8(0x08), uint8(0x09), uint8(0x0a), uint8(0x0b), uint8(0x0c), uint8(0x0d), uint8(0x0e), uint8(0x0f), uint8(0x00), uint8(0x01), uint8(0x02), uint8(0x03), uint8(0x04), uint8(0x05), uint8(0x06), uint8(0x07), uint8(0x00), uint8(0x01), uint8(0x02), uint8(0x03), uint8(0x00), uint8(0x01), uint8(0x00), uint8(0x00), -} /* sqlite3.c:30700:28 */ +} /* sqlite3.c:30993:28 */ // Translate a single UTF-8 character. Return the unicode value. // @@ -17465,7 +17452,7 @@ var sqlite3Utf8Trans1 = [64]uint8{ // * This routine accepts over-length UTF8 encodings // for unicode values 0x80 and greater. It does not change over-length // encodings to 0xfffd as some systems recommend. -func Xsqlite3Utf8Read(tls *libc.TLS, pz uintptr) U32 { /* sqlite3.c:30794:20: */ +func Xsqlite3Utf8Read(tls *libc.TLS, pz uintptr) U32 { /* sqlite3.c:31087:20: */ var c uint32 // Same as READ_UTF8() above but without the zTerm parameter. @@ -17492,7 +17479,7 @@ func Xsqlite3Utf8Read(tls *libc.TLS, pz uintptr) U32 { /* sqlite3.c:30794:20: */ // 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 Xsqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc U8) int32 { /* sqlite3.c:30830:36: */ +func Xsqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc U8) int32 { /* sqlite3.c:31123:36: */ var len Sqlite3_int64 // Maximum length of output string in bytes var zOut uintptr // Output buffer var zIn uintptr // Input iterator @@ -17817,7 +17804,7 @@ translate_out: // // The allocation (static, dynamic etc.) and encoding of the Mem may be // changed by this function. -func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:31025:20: */ +func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:31318:20: */ var rc int32 = SQLITE_OK var bom U8 = U8(0) @@ -17825,10 +17812,10 @@ func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c: var b1 U8 = *(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz)) var b2 U8 = *(*U8)(unsafe.Pointer((((*Mem)(unsafe.Pointer(pMem)).Fz) + uintptr(1)))) if (int32(b1) == 0xFE) && (int32(b2) == 0xFF) { - bom = SQLITE_UTF16BE + bom = U8(SQLITE_UTF16BE) } if (int32(b1) == 0xFF) && (int32(b2) == 0xFE) { - bom = SQLITE_UTF16LE + bom = U8(SQLITE_UTF16LE) } } @@ -17851,7 +17838,7 @@ func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c: // 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 Xsqlite3Utf8CharLen(tls *libc.TLS, zIn uintptr, nByte int32) int32 { /* sqlite3.c:31063:20: */ +func Xsqlite3Utf8CharLen(tls *libc.TLS, zIn uintptr, nByte int32) int32 { /* sqlite3.c:31356:20: */ var r int32 = 0 var z uintptr = zIn var zTerm uintptr @@ -17883,7 +17870,7 @@ func Xsqlite3Utf8CharLen(tls *libc.TLS, zIn uintptr, nByte int32) int32 { /* sql // be freed by the calling function. // // NULL is returned if there is an allocation error. -func Xsqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc U8) uintptr { /* sqlite3.c:31117:21: */ +func Xsqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc U8) uintptr { /* sqlite3.c:31410:21: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -17904,7 +17891,7 @@ func Xsqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc U8) // 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 Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sqlite3.c:31138:20: */ +func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sqlite3.c:31431:20: */ var c int32 var z uintptr = zIn var n int32 = 0 @@ -18203,7 +18190,7 @@ type Double_t = float64 /* math.h:150:16 */ // sqlite3FaultSim() instance is being invoked. Each call to sqlite3FaultSim() // should have a unique code. To prevent legacy testing applications from // breaking, the codes should not be changed or reused. -func Xsqlite3FaultSim(tls *libc.TLS, iTest int32) int32 { /* sqlite3.c:31240:20: */ +func Xsqlite3FaultSim(tls *libc.TLS, iTest int32) int32 { /* sqlite3.c:31533:20: */ var xCallback uintptr = Xsqlite3Config.FxTestCallback if xCallback != 0 { return (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&xCallback)))(tls, iTest) @@ -18212,7 +18199,7 @@ func Xsqlite3FaultSim(tls *libc.TLS, iTest int32) int32 { /* sqlite3.c:31240:20: } // Return true if the floating point value is Not a Number (NaN). -func Xsqlite3IsNaN(tls *libc.TLS, x float64) int32 { /* sqlite3.c:31250:20: */ +func Xsqlite3IsNaN(tls *libc.TLS, x float64) int32 { /* sqlite3.c:31543:20: */ bp := tls.Alloc(16) defer tls.Free(16) *(*float64)(unsafe.Pointer(bp + 8)) = x @@ -18229,7 +18216,7 @@ func Xsqlite3IsNaN(tls *libc.TLS, x float64) int32 { /* sqlite3.c:31250:20: */ // 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 Xsqlite3Strlen30(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:31265:20: */ +func Xsqlite3Strlen30(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:31558:20: */ if z == uintptr(0) { return 0 } @@ -18241,7 +18228,7 @@ func Xsqlite3Strlen30(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:31265:20: * // // 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 Xsqlite3ColumnType(tls *libc.TLS, pCol uintptr, zDflt uintptr) uintptr { /* sqlite3.c:31277:21: */ +func Xsqlite3ColumnType(tls *libc.TLS, pCol uintptr, zDflt uintptr) uintptr { /* sqlite3.c:31570:21: */ if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_HASTYPE) == 0 { return zDflt } @@ -18251,7 +18238,7 @@ func Xsqlite3ColumnType(tls *libc.TLS, pCol uintptr, zDflt uintptr) uintptr { /* // Helper function for sqlite3Error() - called rarely. Broken out into // a separate routine to avoid unnecessary register saves on entry to // sqlite3Error(). -func sqlite3ErrorFinish(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:31287:30: */ +func sqlite3ErrorFinish(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:31580:30: */ if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 { Xsqlite3ValueSetNull(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr) } @@ -18261,7 +18248,7 @@ func sqlite3ErrorFinish(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3. // 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 Xsqlite3Error(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:31297:21: */ +func Xsqlite3Error(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:31590:21: */ (*Sqlite3)(unsafe.Pointer(db)).FerrCode = err_code if (err_code != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FpErr != 0) { @@ -18269,9 +18256,19 @@ func Xsqlite3Error(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:312 } } +// The equivalent of sqlite3Error(db, SQLITE_OK). Clear the error state +// and error message. +func Xsqlite3ErrorClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:31600:21: */ + + (*Sqlite3)(unsafe.Pointer(db)).FerrCode = SQLITE_OK + if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 { + Xsqlite3ValueSetNull(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr) + } +} + // Load the sqlite3.iSysErrno field if that is an appropriate thing // to do based on the SQLite error code in rc. -func Xsqlite3SystemError(tls *libc.TLS, db uintptr, rc int32) { /* sqlite3.c:31307:21: */ +func Xsqlite3SystemError(tls *libc.TLS, db uintptr, rc int32) { /* sqlite3.c:31610:21: */ if rc == (SQLITE_IOERR | (int32(12) << 8)) { return } @@ -18300,20 +18297,20 @@ func Xsqlite3SystemError(tls *libc.TLS, db uintptr, rc int32) { /* sqlite3.c:313 // 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 Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uintptr, va uintptr) { /* sqlite3.c:31336:21: */ +func Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uintptr, va uintptr) { /* sqlite3.c:31639:21: */ (*Sqlite3)(unsafe.Pointer(db)).FerrCode = err_code Xsqlite3SystemError(tls, db, err_code) if zFormat == uintptr(0) { Xsqlite3Error(tls, db, err_code) - } else if ((*Sqlite3)(unsafe.Pointer(db)).FpErr != 0) || ((libc.AssignPtrUintptr(db+384 /* &.pErr */, Xsqlite3ValueNew(tls, db))) != uintptr(0)) { + } else if ((*Sqlite3)(unsafe.Pointer(db)).FpErr != 0) || ((libc.AssignPtrUintptr(db+392 /* &.pErr */, Xsqlite3ValueNew(tls, db))) != uintptr(0)) { var z uintptr var ap Va_list _ = ap ap = va z = Xsqlite3VMPrintf(tls, db, zFormat, ap) _ = ap - Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, z, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) + Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, z, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) } } @@ -18332,7 +18329,7 @@ func Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uin // stored by this function into the database handle using sqlite3Error(). // Functions sqlite3Error() or sqlite3ErrorWithMsg() should be used // during statement execution (sqlite3_step() etc.). -func Xsqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:31369:21: */ +func Xsqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:31672:21: */ var zMsg uintptr var ap Va_list _ = ap @@ -18354,7 +18351,7 @@ func Xsqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr // If database connection db is currently parsing SQL, then transfer // error code errCode to that parser if the parser has not already // encountered some other kind of error. -func Xsqlite3ErrorToParser(tls *libc.TLS, db uintptr, errCode int32) int32 { /* sqlite3.c:31392:20: */ +func Xsqlite3ErrorToParser(tls *libc.TLS, db uintptr, errCode int32) int32 { /* sqlite3.c:31695:20: */ var pParse uintptr if (db == uintptr(0)) || ((libc.AssignUintptr(&pParse, (*Sqlite3)(unsafe.Pointer(db)).FpParse)) == uintptr(0)) { return errCode @@ -18379,7 +18376,7 @@ func Xsqlite3ErrorToParser(tls *libc.TLS, db uintptr, errCode int32) int32 { /* // 2002-02-14: This routine is extended to remove MS-Access style // brackets from around identifiers. For example: "[a-b-c]" becomes // "a-b-c". -func Xsqlite3Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:31417:21: */ +func Xsqlite3Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:31720:21: */ var quote int8 var i int32 var j int32 @@ -18411,19 +18408,19 @@ func Xsqlite3Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:31417:21: */ *(*int8)(unsafe.Pointer(z + uintptr(j))) = int8(0) } -func Xsqlite3DequoteExpr(tls *libc.TLS, p uintptr) { /* sqlite3.c:31439:21: */ +func Xsqlite3DequoteExpr(tls *libc.TLS, p uintptr) { /* sqlite3.c:31742:21: */ *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (func() uint32 { if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))))) == '"' { return (uint32(EP_Quoted | EP_DblQuoted)) } - return EP_Quoted + return uint32(EP_Quoted) }()) Xsqlite3Dequote(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) } // Generate a Token object from a string -func Xsqlite3TokenInit(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:31448:21: */ +func Xsqlite3TokenInit(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:31751:21: */ (*Token)(unsafe.Pointer(p)).Fz = z (*Token)(unsafe.Pointer(p)).Fn = uint32(Xsqlite3Strlen30(tls, z)) } @@ -18438,7 +18435,7 @@ func Xsqlite3TokenInit(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:31448 // 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 *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31466:16: */ +func Xsqlite3_stricmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31769:16: */ if zLeft == uintptr(0) { if zRight != 0 { return -1 @@ -18450,7 +18447,7 @@ func Xsqlite3_stricmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* s return Xsqlite3StrICmp(tls, zLeft, zRight) } -func Xsqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31474:20: */ +func Xsqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31777:20: */ var a uintptr var b uintptr var c int32 @@ -18476,7 +18473,7 @@ func Xsqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sq return c } -func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) int32 { /* sqlite3.c:31493:16: */ +func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) int32 { /* sqlite3.c:31796:16: */ var a uintptr var b uintptr if zLeft == uintptr(0) { @@ -18500,7 +18497,7 @@ func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) in } // Compute an 8-bit hash on a string that is insensitive to case differences -func Xsqlite3StrIHash(tls *libc.TLS, z uintptr) U8 { /* sqlite3.c:31509:19: */ +func Xsqlite3StrIHash(tls *libc.TLS, z uintptr) U8 { /* sqlite3.c:31812:19: */ var h U8 = U8(0) if z == uintptr(0) { return U8(0) @@ -18516,7 +18513,7 @@ func Xsqlite3StrIHash(tls *libc.TLS, z uintptr) U8 { /* sqlite3.c:31509:19: */ // E==2 results in 100. E==50 results in 1.0e50. // // This routine only works for values of E between 1 and 341. -func sqlite3Pow10(tls *libc.TLS, E int32) float64 { /* sqlite3.c:31525:24: */ +func sqlite3Pow10(tls *libc.TLS, E int32) float64 { /* sqlite3.c:31828:24: */ var x float64 = 10.0 var r float64 = 1.0 for 1 != 0 { @@ -18559,7 +18556,7 @@ func sqlite3Pow10(tls *libc.TLS, E int32) float64 { /* sqlite3.c:31525:24: */ // 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 Xsqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc U8) int32 { /* sqlite3.c:31590:20: */ +func Xsqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc U8) int32 { /* sqlite3.c:31893:20: */ var incr int32 var zEnd uintptr // sign * significand * (10 ^ (esign * exponent)) @@ -18939,7 +18936,7 @@ __57: // Render an signed 64-bit integer as text. Store the result in zOut[]. // // The caller must ensure that zOut[] is at least 21 bytes in size. -func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr) { /* sqlite3.c:31789:21: */ +func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr) { /* sqlite3.c:32092:21: */ bp := tls.Alloc(22) defer tls.Free(22) @@ -18980,7 +18977,7 @@ func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr) { /* sqlite3.c:3178 // compare2pow63("9223372036854775800", 1) // // will return -8. -func compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) int32 { /* sqlite3.c:31822:12: */ +func compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) int32 { /* sqlite3.c:32125:12: */ var c int32 = 0 var i int32 // 012345678901234567 @@ -19009,7 +19006,7 @@ func compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) int32 { /* sqlite3.c // 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 Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc U8) int32 { /* sqlite3.c:31855:20: */ +func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc U8) int32 { /* sqlite3.c:32158:20: */ var incr int32 var u U64 = uint64(0) var neg int32 = 0 // assume positive @@ -19024,6 +19021,7 @@ func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc incr = 1 } else { incr = 2 + length = length & (libc.CplInt32(1)) for i = (3 - int32(enc)); (i < length) && (int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))) == 0); i = i + (2) { } @@ -19130,7 +19128,7 @@ func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc // 1 Excess text after the integer value // 2 Integer too large for a 64-bit signed integer or is malformed // 3 Special case of 9223372036854775808 -func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sqlite3.c:31957:20: */ +func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sqlite3.c:32261:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -19150,7 +19148,7 @@ func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sq } return 2 } else { - return Xsqlite3Atoi64(tls, z, pOut, Xsqlite3Strlen30(tls, z), SQLITE_UTF8) + return Xsqlite3Atoi64(tls, z, pOut, Xsqlite3Strlen30(tls, z), uint8(SQLITE_UTF8)) } return int32(0) } @@ -19163,7 +19161,7 @@ func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sq // Any non-numeric characters that following zNum are ignored. // This is different from sqlite3Atoi64() which requires the // input number to be zero-terminated. -func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32 { /* sqlite3.c:31987:20: */ +func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32 { /* sqlite3.c:32291:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -19225,7 +19223,7 @@ func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32 { /* sq // Return a 32-bit integer value extracted from a string. If the // string is not an integer, just return 0. -func Xsqlite3Atoi(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:32046:20: */ +func Xsqlite3Atoi(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:32350:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -19238,7 +19236,7 @@ func Xsqlite3Atoi(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:32046:20: */ // success and false if there is an error. // // Only decimal notation is accepted. -func Xsqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) int32 { /* sqlite3.c:32058:20: */ +func Xsqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) int32 { /* sqlite3.c:32362:20: */ var v U64 = uint64(0) var i int32 for i = 0; (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))]) & 0x04) != 0; i++ { @@ -19281,7 +19279,7 @@ func Xsqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) int32 { /* sqlite3. // 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 *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32099:28: */ +func putVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32403:28: */ bp := tls.Alloc(10) defer tls.Free(10) @@ -19327,7 +19325,7 @@ __3: return n } -func Xsqlite3PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32123:20: */ +func Xsqlite3PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32427:20: */ if v <= uint64(0x7f) { *(*uint8)(unsafe.Pointer(p)) = (uint8(v & uint64(0x7f))) return 1 @@ -19350,7 +19348,7 @@ func Xsqlite3PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:321 // 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 Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32153:19: */ +func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32457:19: */ var a U32 var b U32 var s U32 @@ -19372,7 +19370,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 a = a | (U32(*(*uint8)(unsafe.Pointer(p)))) // a: p0<<14 | p2 (unmasked) if !((a & U32(0x80)) != 0) { - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) b = b & (U32(0x7f)) b = (b << 7) a = a | (b) @@ -19381,13 +19379,13 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 } // CSE1 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) // b: p1<<14 | p3 (unmasked) if !((b & U32(0x80)) != 0) { - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); a = (a << 7) @@ -19401,7 +19399,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) s = a // s: p0<<14 | p2 (masked) @@ -19433,7 +19431,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 if !((b & U32(0x80)) != 0) { // we can skip this cause it was (effectively) done above in calc'ing s // b &= (0x7f<<28)|(0x7f<<14)|(0x7f); - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) a = (a << 7) a = a | (b) s = (s >> 18) @@ -19447,7 +19445,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // a: p2<<28 | p4<<14 | p6 (unmasked) if !((a & U32(0x80)) != 0) { a = a & (SLOT_4_2_0) - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 7) a = a | (b) s = (s >> 11) @@ -19456,7 +19454,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 } // CSE2 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) @@ -19479,7 +19477,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // moved CSE2 up // a &= (0x7f<<29)|(0x7f<<15)|(0xff); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 8) a = a | (b) @@ -19503,7 +19501,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // 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 Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32314:19: */ +func Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32618:19: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -19571,7 +19569,7 @@ func Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c: // Return the number of bytes that will be needed to store the given // 64-bit integer. -func Xsqlite3VarintLen(tls *libc.TLS, v U64) int32 { /* sqlite3.c:32436:20: */ +func Xsqlite3VarintLen(tls *libc.TLS, v U64) int32 { /* sqlite3.c:32740:20: */ var i int32 for i = 1; (libc.AssignShrUint64(&v, int(uint64(7)))) != uint64(0); i++ { } @@ -19579,7 +19577,7 @@ func Xsqlite3VarintLen(tls *libc.TLS, v U64) int32 { /* sqlite3.c:32436:20: */ } // Read or write a four-byte big-endian integer value. -func Xsqlite3Get4byte(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:32446:20: */ +func Xsqlite3Get4byte(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:32750:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -19589,7 +19587,7 @@ func Xsqlite3Get4byte(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:32446:20: */ return libc.X__builtin_bswap32(tls, *(*U32)(unsafe.Pointer(bp /* x */))) } -func Xsqlite3Put4byte(tls *libc.TLS, p uintptr, v U32) { /* sqlite3.c:32464:21: */ +func Xsqlite3Put4byte(tls *libc.TLS, p uintptr, v U32) { /* sqlite3.c:32768:21: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -19600,7 +19598,7 @@ func Xsqlite3Put4byte(tls *libc.TLS, p uintptr, v U32) { /* sqlite3.c:32464:21: // 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 Xsqlite3HexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:32488:19: */ +func Xsqlite3HexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:32792:19: */ h = h + (9 * (1 & (h >> 6))) return (U8(h & 0xf)) @@ -19610,7 +19608,7 @@ func Xsqlite3HexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:32488:19: */ // 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 Xsqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) uintptr { /* sqlite3.c:32506:21: */ +func Xsqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) uintptr { /* sqlite3.c:32810:21: */ var zBlob uintptr var i int32 @@ -19628,7 +19626,7 @@ func Xsqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) uintptr { // 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 *libc.TLS, zType uintptr) { /* sqlite3.c:32527:13: */ +func logBadConnection(tls *libc.TLS, zType uintptr) { /* sqlite3.c:32831:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -19649,7 +19647,7 @@ func logBadConnection(tls *libc.TLS, zType uintptr) { /* sqlite3.c:32527:13: */ // 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 Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32548:20: */ +func Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32852:20: */ var magic U32 if db == uintptr(0) { logBadConnection(tls, ts+704 /* "NULL" */) @@ -19668,10 +19666,10 @@ func Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32548 return int32(0) } -func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32565:20: */ +func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32869:20: */ var magic U32 magic = (*Sqlite3)(unsafe.Pointer(db)).Fmagic - if ((magic != SQLITE_MAGIC_SICK) && (magic != SQLITE_MAGIC_OPEN)) && (magic != SQLITE_MAGIC_BUSY) { + if ((magic != U32(SQLITE_MAGIC_SICK)) && (magic != SQLITE_MAGIC_OPEN)) && (magic != SQLITE_MAGIC_BUSY) { logBadConnection(tls, ts+800 /* "invalid" */) return 0 @@ -19685,21 +19683,21 @@ func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c // 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 Xsqlite3AddInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32585:20: */ +func Xsqlite3AddInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32889:20: */ return libc.X__builtin_add_overflowInt64(tls, *(*I64)(unsafe.Pointer(pA)), iB, pA) } -func Xsqlite3SubInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32605:20: */ +func Xsqlite3SubInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32909:20: */ return libc.X__builtin_sub_overflowInt64(tls, *(*I64)(unsafe.Pointer(pA)), iB, pA) } -func Xsqlite3MulInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32620:20: */ +func Xsqlite3MulInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32924:20: */ return libc.X__builtin_mul_overflowInt64(tls, *(*I64)(unsafe.Pointer(pA)), iB, pA) } // Compute the absolute value of a 32-bit signed integer, of possible. Or // if the integer has a value of -2147483648, return +2147483647 -func Xsqlite3AbsInt32(tls *libc.TLS, x int32) int32 { /* sqlite3.c:32646:20: */ +func Xsqlite3AbsInt32(tls *libc.TLS, x int32) int32 { /* sqlite3.c:32950:20: */ if x >= 0 { return x } @@ -19713,7 +19711,7 @@ func Xsqlite3AbsInt32(tls *libc.TLS, x int32) int32 { /* sqlite3.c:32646:20: */ // not a simple "+" operator because LogEst is stored as a logarithmic // value. // -func Xsqlite3LogEstAdd(tls *libc.TLS, a LogEst, b LogEst) LogEst { /* sqlite3.c:32689:23: */ +func Xsqlite3LogEstAdd(tls *libc.TLS, a LogEst, b LogEst) LogEst { /* sqlite3.c:32993:23: */ if int32(a) >= int32(b) { if int32(a) > (int32(b) + 49) { return a @@ -19744,11 +19742,11 @@ var x = [32]uint8{ uint8(4), uint8(4), uint8(4), uint8(4), // 15-18 uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), // 19-24 uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), // 25-31 -} /* sqlite3.c:32690:30 */ +} /* sqlite3.c:32994:30 */ // Convert an integer into a LogEst. In other words, compute an // approximation for 10*log2(x). -func Xsqlite3LogEst(tls *libc.TLS, x U64) LogEst { /* sqlite3.c:32716:23: */ +func Xsqlite3LogEst(tls *libc.TLS, x U64) LogEst { /* sqlite3.c:33020:23: */ var y LogEst = int16(40) if x < uint64(8) { if x < uint64(2) { @@ -19766,11 +19764,11 @@ func Xsqlite3LogEst(tls *libc.TLS, x U64) LogEst { /* sqlite3.c:32716:23: */ return (LogEst((int32(a[(x&uint64(7))]) + int32(y)) - 10)) } -var a = [8]LogEst{int16(0), int16(2), int16(3), int16(5), int16(6), int16(7), int16(8), int16(9)} /* sqlite3.c:32717:17 */ +var a = [8]LogEst{int16(0), int16(2), int16(3), int16(5), int16(6), int16(7), int16(8), int16(9)} /* sqlite3.c:33021:17 */ // Convert a double into a LogEst // In other words, compute an approximation for 10*log2(x). -func Xsqlite3LogEstFromDouble(tls *libc.TLS, x float64) LogEst { /* sqlite3.c:32740:23: */ +func Xsqlite3LogEstFromDouble(tls *libc.TLS, x float64) LogEst { /* sqlite3.c:33044:23: */ bp := tls.Alloc(16) defer tls.Free(16) *(*float64)(unsafe.Pointer(bp + 8)) = x @@ -19794,7 +19792,7 @@ func Xsqlite3LogEstFromDouble(tls *libc.TLS, x float64) LogEst { /* sqlite3.c:32 // // Note that this routine is only used when one or more of various // non-standard compile-time options is enabled. -func Xsqlite3LogEstToInt(tls *libc.TLS, x LogEst) U64 { /* sqlite3.c:32761:20: */ +func Xsqlite3LogEstToInt(tls *libc.TLS, x LogEst) U64 { /* sqlite3.c:33065:20: */ var n U64 n = (U64(int32(x) % 10)) x = int16(int32(x) / (10)) @@ -19846,7 +19844,7 @@ func Xsqlite3LogEstToInt(tls *libc.TLS, x LogEst) U64 { /* sqlite3.c:32761:20: * // 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 Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) uintptr { /* sqlite3.c:32815:22: */ +func Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) uintptr { /* sqlite3.c:33119:22: */ var nInt int32 // number of sizeof(int) objects needed for zName var z uintptr // Pointer to where zName will be stored var i int32 // Index in pIn[] where zName is stored @@ -19885,7 +19883,7 @@ func Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nNa // 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 Xsqlite3VListNumToName(tls *libc.TLS, pIn uintptr, iVal int32) uintptr { /* sqlite3.c:32853:27: */ +func Xsqlite3VListNumToName(tls *libc.TLS, pIn uintptr, iVal int32) uintptr { /* sqlite3.c:33157:27: */ var i int32 var mx int32 if pIn == uintptr(0) { @@ -19904,7 +19902,7 @@ func Xsqlite3VListNumToName(tls *libc.TLS, pIn uintptr, iVal int32) uintptr { /* // Return the number of the variable named zName, if it is in VList. // or return 0 if there is no such variable. -func Xsqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:32869:20: */ +func Xsqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:33173:20: */ var i int32 var mx int32 if pIn == uintptr(0) { @@ -19943,7 +19941,7 @@ func Xsqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int // fields of the Hash structure. // // "pNew" is a pointer to the hash table that is to be initialized. -func Xsqlite3HashInit(tls *libc.TLS, pNew uintptr) { /* sqlite3.c:32906:21: */ +func Xsqlite3HashInit(tls *libc.TLS, pNew uintptr) { /* sqlite3.c:33210:21: */ (*Hash)(unsafe.Pointer(pNew)).Ffirst = uintptr(0) (*Hash)(unsafe.Pointer(pNew)).Fcount = uint32(0) @@ -19954,7 +19952,7 @@ func Xsqlite3HashInit(tls *libc.TLS, pNew uintptr) { /* sqlite3.c:32906:21: */ // 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 Xsqlite3HashClear(tls *libc.TLS, pH uintptr) { /* sqlite3.c:32918:21: */ +func Xsqlite3HashClear(tls *libc.TLS, pH uintptr) { /* sqlite3.c:33222:21: */ var elem uintptr // For looping over all elements of the table elem = (*Hash)(unsafe.Pointer(pH)).Ffirst @@ -19971,7 +19969,7 @@ func Xsqlite3HashClear(tls *libc.TLS, pH uintptr) { /* sqlite3.c:32918:21: */ } // The hashing function. -func strHash(tls *libc.TLS, z uintptr) uint32 { /* sqlite3.c:32938:21: */ +func strHash(tls *libc.TLS, z uintptr) uint32 { /* sqlite3.c:33242:21: */ var h uint32 = uint32(0) var c uint8 for (int32(libc.AssignUint8(&c, uint8(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))))) != 0 { //OPTIMIZATION-IF-TRUE @@ -19986,7 +19984,7 @@ func strHash(tls *libc.TLS, z uintptr) uint32 { /* sqlite3.c:32938:21: */ // Link pNew element into the hash table pH. If pEntry!=0 then also // insert pNew into the pEntry hash bucket. -func insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { /* sqlite3.c:32955:13: */ +func insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { /* sqlite3.c:33259:13: */ var pHead uintptr // First element already in pEntry if pEntry != 0 { if (*_ht)(unsafe.Pointer(pEntry)).Fcount != 0 { @@ -20023,13 +20021,13 @@ func insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { /* // 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 *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:32989:12: */ +func rehash(tls *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:33293:12: */ var new_ht uintptr // The new hash table var elem uintptr var next_elem uintptr // For looping over existing elements - if (uint64(new_size) * uint64(unsafe.Sizeof(_ht{}))) > SQLITE_MALLOC_SOFT_LIMIT { - new_size = (uint32(SQLITE_MALLOC_SOFT_LIMIT / uint64(unsafe.Sizeof(_ht{})))) + if (uint64(new_size) * uint64(unsafe.Sizeof(_ht{}))) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { + new_size = (uint32(uint64(SQLITE_MALLOC_SOFT_LIMIT) / uint64(unsafe.Sizeof(_ht{})))) } if new_size == (*Hash)(unsafe.Pointer(pH)).Fhtsize { return 0 @@ -20067,7 +20065,7 @@ func rehash(tls *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:329 // hash table that matches the given key. If no element is found, // a pointer to a static null element with HashElem.data==0 is returned. // If pH is not NULL, then the hash for this key is written to *pH. -func findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr) uintptr { /* sqlite3.c:33030:17: */ +func findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr) uintptr { /* sqlite3.c:33334:17: */ var elem uintptr // Used to loop thru the element list var count uint32 // Number of elements left to test var h uint32 @@ -20096,11 +20094,11 @@ func findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr) return uintptr(unsafe.Pointer(&nullElement)) } -var nullElement = HashElem{} /* sqlite3.c:33038:19 */ +var nullElement = HashElem{} /* sqlite3.c:33342:19 */ // 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 *libc.TLS, pH uintptr, elem uintptr, h uint32) { /* sqlite3.c:33065:13: */ +func removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { /* sqlite3.c:33369:13: */ var pEntry uintptr if (*HashElem)(unsafe.Pointer(elem)).Fprev != 0 { (*HashElem)(unsafe.Pointer((*HashElem)(unsafe.Pointer(elem)).Fprev)).Fnext = (*HashElem)(unsafe.Pointer(elem)).Fnext @@ -20129,7 +20127,7 @@ func removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { // 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 Xsqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) uintptr { /* sqlite3.c:33100:21: */ +func Xsqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) uintptr { /* sqlite3.c:33404:21: */ return (*HashElem)(unsafe.Pointer(findElementWithHash(tls, pH, pKey, uintptr(0)))).Fdata } @@ -20147,7 +20145,7 @@ func Xsqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) uintptr { /* sqli // // If the "data" parameter to this function is NULL, then the // element corresponding to "key" is removed from the hash table. -func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) uintptr { /* sqlite3.c:33120:21: */ +func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) uintptr { /* sqlite3.c:33424:21: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -20196,11 +20194,11 @@ func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) u //************* Begin file opcodes.c **************************************** // Automatically generated. Do not edit // See the tool/mkopcodec.tcl script for details. -func Xsqlite3OpcodeName(tls *libc.TLS, i int32) uintptr { /* sqlite3.c:33166:27: */ +func Xsqlite3OpcodeName(tls *libc.TLS, i int32) uintptr { /* sqlite3.c:33470:27: */ return azName[i] } -var azName = [176]uintptr{ +var azName = [179]uintptr{ /* 0 */ ts + 808, /* "Savepoint" */ /* 1 */ ts + 818, /* "AutoCommit" */ /* 2 */ ts + 829, /* "Transaction" */ @@ -20281,103 +20279,106 @@ var azName = [176]uintptr{ /* 77 */ ts + 1385, /* "Copy" */ /* 78 */ ts + 1390, /* "SCopy" */ /* 79 */ ts + 1396, /* "IntCopy" */ - /* 80 */ ts + 1404, /* "ResultRow" */ - /* 81 */ ts + 1414, /* "CollSeq" */ - /* 82 */ ts + 1422, /* "AddImm" */ - /* 83 */ ts + 1429, /* "RealAffinity" */ - /* 84 */ ts + 1442, /* "Cast" */ - /* 85 */ ts + 1447, /* "Permutation" */ - /* 86 */ ts + 1459, /* "Compare" */ - /* 87 */ ts + 1467, /* "IsTrue" */ - /* 88 */ ts + 1474, /* "Offset" */ - /* 89 */ ts + 1481, /* "Column" */ - /* 90 */ ts + 1488, /* "Affinity" */ - /* 91 */ ts + 1497, /* "MakeRecord" */ - /* 92 */ ts + 1508, /* "Count" */ - /* 93 */ ts + 1514, /* "ReadCookie" */ - /* 94 */ ts + 1525, /* "SetCookie" */ - /* 95 */ ts + 1535, /* "ReopenIdx" */ - /* 96 */ ts + 1545, /* "OpenRead" */ - /* 97 */ ts + 1554, /* "OpenWrite" */ - /* 98 */ ts + 1564, /* "OpenDup" */ - /* 99 */ ts + 1572, /* "OpenAutoindex" */ - /* 100 */ ts + 1586, /* "OpenEphemeral" */ - /* 101 */ ts + 1600, /* "BitAnd" */ - /* 102 */ ts + 1607, /* "BitOr" */ - /* 103 */ ts + 1613, /* "ShiftLeft" */ - /* 104 */ ts + 1623, /* "ShiftRight" */ - /* 105 */ ts + 1634, /* "Add" */ - /* 106 */ ts + 1638, /* "Subtract" */ - /* 107 */ ts + 1647, /* "Multiply" */ - /* 108 */ ts + 1656, /* "Divide" */ - /* 109 */ ts + 1663, /* "Remainder" */ - /* 110 */ ts + 1673, /* "Concat" */ - /* 111 */ ts + 1680, /* "SorterOpen" */ - /* 112 */ ts + 1691, /* "BitNot" */ - /* 113 */ ts + 1698, /* "SequenceTest" */ - /* 114 */ ts + 1711, /* "OpenPseudo" */ - /* 115 */ ts + 1722, /* "String8" */ - /* 116 */ ts + 1730, /* "Close" */ - /* 117 */ ts + 1736, /* "ColumnsUsed" */ - /* 118 */ ts + 1748, /* "SeekHit" */ - /* 119 */ ts + 1756, /* "Sequence" */ - /* 120 */ ts + 1765, /* "NewRowid" */ - /* 121 */ ts + 1774, /* "Insert" */ - /* 122 */ ts + 1781, /* "Delete" */ - /* 123 */ ts + 1788, /* "ResetCount" */ - /* 124 */ ts + 1799, /* "SorterCompare" */ - /* 125 */ ts + 1813, /* "SorterData" */ - /* 126 */ ts + 1824, /* "RowData" */ - /* 127 */ ts + 1832, /* "Rowid" */ - /* 128 */ ts + 1838, /* "NullRow" */ - /* 129 */ ts + 1846, /* "SeekEnd" */ - /* 130 */ ts + 1854, /* "IdxInsert" */ - /* 131 */ ts + 1864, /* "SorterInsert" */ - /* 132 */ ts + 1877, /* "IdxDelete" */ - /* 133 */ ts + 1887, /* "DeferredSeek" */ - /* 134 */ ts + 1900, /* "IdxRowid" */ - /* 135 */ ts + 1909, /* "FinishSeek" */ - /* 136 */ ts + 1920, /* "Destroy" */ - /* 137 */ ts + 1928, /* "Clear" */ - /* 138 */ ts + 1934, /* "ResetSorter" */ - /* 139 */ ts + 1946, /* "CreateBtree" */ - /* 140 */ ts + 1958, /* "SqlExec" */ - /* 141 */ ts + 1966, /* "ParseSchema" */ - /* 142 */ ts + 1978, /* "LoadAnalysis" */ - /* 143 */ ts + 1991, /* "DropTable" */ - /* 144 */ ts + 2001, /* "DropIndex" */ - /* 145 */ ts + 2011, /* "DropTrigger" */ - /* 146 */ ts + 2023, /* "IntegrityCk" */ - /* 147 */ ts + 2035, /* "RowSetAdd" */ - /* 148 */ ts + 2045, /* "Param" */ - /* 149 */ ts + 2051, /* "FkCounter" */ - /* 150 */ ts + 2061, /* "Real" */ - /* 151 */ ts + 2066, /* "MemMax" */ - /* 152 */ ts + 2073, /* "OffsetLimit" */ - /* 153 */ ts + 2085, /* "AggInverse" */ - /* 154 */ ts + 2096, /* "AggStep" */ - /* 155 */ ts + 2104, /* "AggStep1" */ - /* 156 */ ts + 2113, /* "AggValue" */ - /* 157 */ ts + 2122, /* "AggFinal" */ - /* 158 */ ts + 2131, /* "Expire" */ - /* 159 */ ts + 2138, /* "CursorLock" */ - /* 160 */ ts + 2149, /* "CursorUnlock" */ - /* 161 */ ts + 2162, /* "TableLock" */ - /* 162 */ ts + 2172, /* "VBegin" */ - /* 163 */ ts + 2179, /* "VCreate" */ - /* 164 */ ts + 2187, /* "VDestroy" */ - /* 165 */ ts + 2196, /* "VOpen" */ - /* 166 */ ts + 2202, /* "VColumn" */ - /* 167 */ ts + 2210, /* "VRename" */ - /* 168 */ ts + 2218, /* "Pagecount" */ - /* 169 */ ts + 2228, /* "MaxPgcnt" */ - /* 170 */ ts + 2237, /* "Trace" */ - /* 171 */ ts + 2243, /* "CursorHint" */ - /* 172 */ ts + 2254, /* "ReleaseReg" */ - /* 173 */ ts + 2265, /* "Noop" */ - /* 174 */ ts + 2270, /* "Explain" */ - /* 175 */ ts + 2278, /* "Abortable" */ -} /* sqlite3.c:33167:20 */ + /* 80 */ ts + 1404, /* "ChngCntRow" */ + /* 81 */ ts + 1415, /* "ResultRow" */ + /* 82 */ ts + 1425, /* "CollSeq" */ + /* 83 */ ts + 1433, /* "AddImm" */ + /* 84 */ ts + 1440, /* "RealAffinity" */ + /* 85 */ ts + 1453, /* "Cast" */ + /* 86 */ ts + 1458, /* "Permutation" */ + /* 87 */ ts + 1470, /* "Compare" */ + /* 88 */ ts + 1478, /* "IsTrue" */ + /* 89 */ ts + 1485, /* "Offset" */ + /* 90 */ ts + 1492, /* "Column" */ + /* 91 */ ts + 1499, /* "Affinity" */ + /* 92 */ ts + 1508, /* "MakeRecord" */ + /* 93 */ ts + 1519, /* "Count" */ + /* 94 */ ts + 1525, /* "ReadCookie" */ + /* 95 */ ts + 1536, /* "SetCookie" */ + /* 96 */ ts + 1546, /* "ReopenIdx" */ + /* 97 */ ts + 1556, /* "OpenRead" */ + /* 98 */ ts + 1565, /* "OpenWrite" */ + /* 99 */ ts + 1575, /* "OpenDup" */ + /* 100 */ ts + 1583, /* "OpenAutoindex" */ + /* 101 */ ts + 1597, /* "OpenEphemeral" */ + /* 102 */ ts + 1611, /* "BitAnd" */ + /* 103 */ ts + 1618, /* "BitOr" */ + /* 104 */ ts + 1624, /* "ShiftLeft" */ + /* 105 */ ts + 1634, /* "ShiftRight" */ + /* 106 */ ts + 1645, /* "Add" */ + /* 107 */ ts + 1649, /* "Subtract" */ + /* 108 */ ts + 1658, /* "Multiply" */ + /* 109 */ ts + 1667, /* "Divide" */ + /* 110 */ ts + 1674, /* "Remainder" */ + /* 111 */ ts + 1684, /* "Concat" */ + /* 112 */ ts + 1691, /* "SorterOpen" */ + /* 113 */ ts + 1702, /* "BitNot" */ + /* 114 */ ts + 1709, /* "SequenceTest" */ + /* 115 */ ts + 1722, /* "OpenPseudo" */ + /* 116 */ ts + 1733, /* "String8" */ + /* 117 */ ts + 1741, /* "Close" */ + /* 118 */ ts + 1747, /* "ColumnsUsed" */ + /* 119 */ ts + 1759, /* "SeekScan" */ + /* 120 */ ts + 1768, /* "SeekHit" */ + /* 121 */ ts + 1776, /* "Sequence" */ + /* 122 */ ts + 1785, /* "NewRowid" */ + /* 123 */ ts + 1794, /* "Insert" */ + /* 124 */ ts + 1801, /* "RowCell" */ + /* 125 */ ts + 1809, /* "Delete" */ + /* 126 */ ts + 1816, /* "ResetCount" */ + /* 127 */ ts + 1827, /* "SorterCompare" */ + /* 128 */ ts + 1841, /* "SorterData" */ + /* 129 */ ts + 1852, /* "RowData" */ + /* 130 */ ts + 1860, /* "Rowid" */ + /* 131 */ ts + 1866, /* "NullRow" */ + /* 132 */ ts + 1874, /* "SeekEnd" */ + /* 133 */ ts + 1882, /* "IdxInsert" */ + /* 134 */ ts + 1892, /* "SorterInsert" */ + /* 135 */ ts + 1905, /* "IdxDelete" */ + /* 136 */ ts + 1915, /* "DeferredSeek" */ + /* 137 */ ts + 1928, /* "IdxRowid" */ + /* 138 */ ts + 1937, /* "FinishSeek" */ + /* 139 */ ts + 1948, /* "Destroy" */ + /* 140 */ ts + 1956, /* "Clear" */ + /* 141 */ ts + 1962, /* "ResetSorter" */ + /* 142 */ ts + 1974, /* "CreateBtree" */ + /* 143 */ ts + 1986, /* "SqlExec" */ + /* 144 */ ts + 1994, /* "ParseSchema" */ + /* 145 */ ts + 2006, /* "LoadAnalysis" */ + /* 146 */ ts + 2019, /* "DropTable" */ + /* 147 */ ts + 2029, /* "DropIndex" */ + /* 148 */ ts + 2039, /* "DropTrigger" */ + /* 149 */ ts + 2051, /* "IntegrityCk" */ + /* 150 */ ts + 2063, /* "RowSetAdd" */ + /* 151 */ ts + 2073, /* "Param" */ + /* 152 */ ts + 2079, /* "Real" */ + /* 153 */ ts + 2084, /* "FkCounter" */ + /* 154 */ ts + 2094, /* "MemMax" */ + /* 155 */ ts + 2101, /* "OffsetLimit" */ + /* 156 */ ts + 2113, /* "AggInverse" */ + /* 157 */ ts + 2124, /* "AggStep" */ + /* 158 */ ts + 2132, /* "AggStep1" */ + /* 159 */ ts + 2141, /* "AggValue" */ + /* 160 */ ts + 2150, /* "AggFinal" */ + /* 161 */ ts + 2159, /* "Expire" */ + /* 162 */ ts + 2166, /* "CursorLock" */ + /* 163 */ ts + 2177, /* "CursorUnlock" */ + /* 164 */ ts + 2190, /* "TableLock" */ + /* 165 */ ts + 2200, /* "VBegin" */ + /* 166 */ ts + 2207, /* "VCreate" */ + /* 167 */ ts + 2215, /* "VDestroy" */ + /* 168 */ ts + 2224, /* "VOpen" */ + /* 169 */ ts + 2230, /* "VColumn" */ + /* 170 */ ts + 2238, /* "VRename" */ + /* 171 */ ts + 2246, /* "Pagecount" */ + /* 172 */ ts + 2256, /* "MaxPgcnt" */ + /* 173 */ ts + 2265, /* "Trace" */ + /* 174 */ ts + 2271, /* "CursorHint" */ + /* 175 */ ts + 2282, /* "ReleaseReg" */ + /* 176 */ ts + 2293, /* "Noop" */ + /* 177 */ ts + 2298, /* "Explain" */ + /* 178 */ ts + 2306, /* "Abortable" */ +} /* sqlite3.c:33471:20 */ //************* End of opcodes.c ******************************************** //************* Begin file os_unix.c **************************************** @@ -20601,76 +20602,6 @@ type stat64 = struct { F__glibc_reserved [3]X__syscall_slong_t } /* stat.h:119:1 */ -// statx-related definitions and declarations. -// Copyright (C) 2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// This interface is based on in Linux. - -type statx_timestamp = struct { - Ftv_sec X__int64_t - Ftv_nsec X__uint32_t - F__statx_timestamp_pad1 [1]X__int32_t -} /* statx.h:25:1 */ - -// Warning: The kernel may add additional fields to this struct in the -// future. Only use this struct for calling the statx function, not -// for storing data. (Expansion will be controlled by the mask -// argument of the statx function.) -type statx = struct { - Fstx_mask X__uint32_t - Fstx_blksize X__uint32_t - Fstx_attributes X__uint64_t - Fstx_nlink X__uint32_t - Fstx_uid X__uint32_t - Fstx_gid X__uint32_t - Fstx_mode X__uint16_t - F__statx_pad1 [1]X__uint16_t - Fstx_ino X__uint64_t - Fstx_size X__uint64_t - Fstx_blocks X__uint64_t - Fstx_attributes_mask X__uint64_t - Fstx_atime struct { - Ftv_sec X__int64_t - Ftv_nsec X__uint32_t - F__statx_timestamp_pad1 [1]X__int32_t - } - Fstx_btime struct { - Ftv_sec X__int64_t - Ftv_nsec X__uint32_t - F__statx_timestamp_pad1 [1]X__int32_t - } - Fstx_ctime struct { - Ftv_sec X__int64_t - Ftv_nsec X__uint32_t - F__statx_timestamp_pad1 [1]X__int32_t - } - Fstx_mtime struct { - Ftv_sec X__int64_t - Ftv_nsec X__uint32_t - F__statx_timestamp_pad1 [1]X__int32_t - } - Fstx_rdev_major X__uint32_t - Fstx_rdev_minor X__uint32_t - Fstx_dev_major X__uint32_t - Fstx_dev_minor X__uint32_t - F__statx_pad2 [14]X__uint64_t -} /* statx.h:36:1 */ - // Copyright (C) 1991-2018 Free Software Foundation, Inc. // This file is part of the GNU C Library. // @@ -20822,7 +20753,7 @@ type flock64 = struct { // License along with the GNU C Library; if not, see // . -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -21244,6 +21175,8 @@ type termio = struct { // The X/Open Unix extensions are available. +// Encryption is present. + // The enhanced internationalization capabilities according to XPG4.2 // are present. @@ -21535,7 +21468,7 @@ type termio = struct { // Never include this file directly; use instead. -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -21624,9 +21557,9 @@ type termio = struct { // The Single Unix specification says that some more types are // available here. -type Intptr_t = X__intptr_t /* unistd.h:267:20 */ +type Intptr_t = X__intptr_t /* unistd.h:270:20 */ -type Socklen_t = X__socklen_t /* unistd.h:274:21 */ +type Socklen_t = X__socklen_t /* unistd.h:277:21 */ // Define some macros helping to catch buffer overflows. @@ -21733,25 +21666,9 @@ type itimerval = struct { // strict C++ rules prevent the automatic promotion. type X__itimer_which_t = uint32 /* time.h:115:29 */ -// Define error_t. -// Copyright (C) 1991-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -type Error_t = int32 /* error_t.h:22:13 */ +// bits/errno.h may have defined this type. If it didn't, provide a +// fallback definition. +type Error_t = int32 /* errno.h:52:13 */ // Try to determine if gethostuuid() is available based on standard // macros. This might sometimes compute the wrong value for some @@ -21792,7 +21709,7 @@ type unixShm = struct { FsharedMask U16 FexclMask U16 _ [2]byte -} /* sqlite3.c:33546:9 */ +} /* sqlite3.c:33854:9 */ // Try to determine if gethostuuid() is available based on standard // macros. This might sometimes compute the wrong value for some @@ -21825,7 +21742,7 @@ type unixShm = struct { // a normal expected return code of SQLITE_BUSY or SQLITE_OK // Forward references -type UnixShm = unixShm /* sqlite3.c:33546:24 */ // Connection shared memory +type UnixShm = unixShm /* sqlite3.c:33854:24 */ // Connection shared memory type unixShmNode = struct { FpInode uintptr FpShmMutex uintptr @@ -21840,10 +21757,11 @@ type unixShmNode = struct { FnRef int32 _ [4]byte FpFirst uintptr -} /* sqlite3.c:33546:9 */ + FaLock [8]int32 +} /* sqlite3.c:33854:9 */ // Connection shared memory -type UnixShmNode = unixShmNode /* sqlite3.c:33547:28 */ // Shared memory instance +type UnixShmNode = unixShmNode /* sqlite3.c:33855:28 */ // Shared memory instance type unixInodeInfo = struct { FfileId struct { Fdev Dev_t @@ -21861,18 +21779,18 @@ type unixInodeInfo = struct { FpShmNode uintptr FpNext uintptr FpPrev uintptr -} /* sqlite3.c:33546:9 */ +} /* sqlite3.c:33854:9 */ // Shared memory instance -type UnixInodeInfo = unixInodeInfo /* sqlite3.c:33548:30 */ // An i-node +type UnixInodeInfo = unixInodeInfo /* sqlite3.c:33856:30 */ // An i-node type UnixUnusedFd1 = struct { Ffd int32 Fflags int32 FpNext uintptr -} /* sqlite3.c:33546:9 */ +} /* sqlite3.c:33854:9 */ // An i-node -type UnixUnusedFd = UnixUnusedFd1 /* sqlite3.c:33549:29 */ +type UnixUnusedFd = UnixUnusedFd1 /* sqlite3.c:33857:29 */ // The unixFile structure is subclass of sqlite3_file specific to the unix // VFS implementations. @@ -21898,16 +21816,16 @@ type unixFile = struct { FpMapRegion uintptr FsectorSize int32 FdeviceCharacteristics int32 -} /* sqlite3.c:33567:9 */ +} /* sqlite3.c:33875:9 */ // The unixFile structure is subclass of sqlite3_file specific to the unix // VFS implementations. -type UnixFile = unixFile /* sqlite3.c:33567:25 */ +type UnixFile = unixFile /* sqlite3.c:33875:25 */ // This variable holds the process id (pid) from when the xRandomness() // method was called. If xOpen() is called from a different process id, // indicating that a fork() has occurred, the PRNG will be reset. -var randomnessPid Pid_t = 0 /* sqlite3.c:33628:14 */ +var randomnessPid Pid_t = 0 /* sqlite3.c:33936:14 */ // Allowed values for the unixFile.ctrlFlags bitmask: @@ -21966,7 +21884,7 @@ var randomnessPid Pid_t = 0 /* sqlite3.c:33628:14 */ // // 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 *libc.TLS, zFile uintptr, flags int32, mode int32) int32 { /* sqlite3.c:33917:12: */ +func posixOpen(tls *libc.TLS, zFile uintptr, flags int32, mode int32) int32 { /* sqlite3.c:34225:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -21981,82 +21899,82 @@ type unix_syscall = struct { FzName uintptr FpCurrent Sqlite3_syscall_ptr FpDefault Sqlite3_syscall_ptr -} /* sqlite3.c:33931:8 */ +} /* sqlite3.c:34239:8 */ // Many system calls are accessed through pointer-to-functions so that // they may be overridden at runtime to facilitate fault injection during // testing and sandboxing. The following array holds the names and pointers // to all overrideable system calls. var aSyscall = [29]unix_syscall{ - {FzName: ts + 2288 /* "open" */, FpCurrent: 0}, + {FzName: ts + 2316 /* "open" */, FpCurrent: 0}, - {FzName: ts + 2293 /* "close" */, FpCurrent: 0}, + {FzName: ts + 2321 /* "close" */, FpCurrent: 0}, - {FzName: ts + 2299 /* "access" */, FpCurrent: 0}, + {FzName: ts + 2327 /* "access" */, FpCurrent: 0}, - {FzName: ts + 2306 /* "getcwd" */, FpCurrent: 0}, + {FzName: ts + 2334 /* "getcwd" */, FpCurrent: 0}, - {FzName: ts + 2313 /* "stat" */, FpCurrent: 0}, + {FzName: ts + 2341 /* "stat" */, FpCurrent: 0}, // The DJGPP compiler environment looks mostly like Unix, but it // lacks the fcntl() system call. So redefine fcntl() to be something // that always succeeds. This means that locking does not occur under // DJGPP. But it is DOS - what did you expect? - {FzName: ts + 2318 /* "fstat" */, FpCurrent: 0}, + {FzName: ts + 2346 /* "fstat" */, FpCurrent: 0}, - {FzName: ts + 2324 /* "ftruncate" */, FpCurrent: 0}, + {FzName: ts + 2352 /* "ftruncate" */, FpCurrent: 0}, - {FzName: ts + 2334 /* "fcntl" */, FpCurrent: 0}, + {FzName: ts + 2362 /* "fcntl" */, FpCurrent: 0}, - {FzName: ts + 2340 /* "read" */, FpCurrent: 0}, + {FzName: ts + 2368 /* "read" */, FpCurrent: 0}, - {FzName: ts + 2345 /* "pread" */}, + {FzName: ts + 2373 /* "pread" */}, - {FzName: ts + 2351 /* "pread64" */}, + {FzName: ts + 2379 /* "pread64" */}, - {FzName: ts + 2359 /* "write" */, FpCurrent: 0}, + {FzName: ts + 2387 /* "write" */, FpCurrent: 0}, - {FzName: ts + 2365 /* "pwrite" */}, + {FzName: ts + 2393 /* "pwrite" */}, - {FzName: ts + 2372 /* "pwrite64" */}, + {FzName: ts + 2400 /* "pwrite64" */}, - {FzName: ts + 2381 /* "fchmod" */, FpCurrent: 0}, + {FzName: ts + 2409 /* "fchmod" */, FpCurrent: 0}, - {FzName: ts + 2388 /* "fallocate" */}, + {FzName: ts + 2416 /* "fallocate" */}, - {FzName: ts + 2398 /* "unlink" */, FpCurrent: 0}, + {FzName: ts + 2426 /* "unlink" */, FpCurrent: 0}, - {FzName: ts + 2405 /* "openDirectory" */, FpCurrent: 0}, + {FzName: ts + 2433 /* "openDirectory" */, FpCurrent: 0}, - {FzName: ts + 2419 /* "mkdir" */, FpCurrent: 0}, + {FzName: ts + 2447 /* "mkdir" */, FpCurrent: 0}, - {FzName: ts + 2425 /* "rmdir" */, FpCurrent: 0}, + {FzName: ts + 2453 /* "rmdir" */, FpCurrent: 0}, - {FzName: ts + 2431 /* "fchown" */, FpCurrent: 0}, + {FzName: ts + 2459 /* "fchown" */, FpCurrent: 0}, - {FzName: ts + 2438 /* "geteuid" */, FpCurrent: 0}, + {FzName: ts + 2466 /* "geteuid" */, FpCurrent: 0}, - {FzName: ts + 2446 /* "mmap" */, FpCurrent: 0}, + {FzName: ts + 2474 /* "mmap" */, FpCurrent: 0}, - {FzName: ts + 2451 /* "munmap" */, FpCurrent: 0}, + {FzName: ts + 2479 /* "munmap" */, FpCurrent: 0}, - {FzName: ts + 2458 /* "mremap" */, FpCurrent: 0}, + {FzName: ts + 2486 /* "mremap" */, FpCurrent: 0}, - {FzName: ts + 2465 /* "getpagesize" */, FpCurrent: 0}, + {FzName: ts + 2493 /* "getpagesize" */, FpCurrent: 0}, - {FzName: ts + 2477 /* "readlink" */, FpCurrent: 0}, + {FzName: ts + 2505 /* "readlink" */, FpCurrent: 0}, - {FzName: ts + 2486 /* "lstat" */, FpCurrent: 0}, + {FzName: ts + 2514 /* "lstat" */, FpCurrent: 0}, - {FzName: ts + 2492 /* "ioctl" */}, -} /* sqlite3.c:33935:3 */ + {FzName: ts + 2520 /* "ioctl" */}, +} /* sqlite3.c:34243:3 */ // End of the overrideable system calls // 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 *libc.TLS, fd int32, uid Uid_t, gid Gid_t) int32 { /* sqlite3.c:34105:12: */ +func robustFchown(tls *libc.TLS, fd int32, uid Uid_t, gid Gid_t) int32 { /* sqlite3.c:34413:12: */ if (*(*func(*libc.TLS) Uid_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 21*24 + 8 /* &.pCurrent */))))(tls) != 0 { return 0 } @@ -22067,7 +21985,7 @@ func robustFchown(tls *libc.TLS, fd int32, uid Uid_t, gid Gid_t) int32 { /* sqli // "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 *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Sqlite3_syscall_ptr) int32 { /* sqlite3.c:34119:12: */ +func unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Sqlite3_syscall_ptr) int32 { /* sqlite3.c:34427:12: */ var i uint32 var rc int32 = SQLITE_NOTFOUND @@ -22104,7 +22022,7 @@ func unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc // 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 *libc.TLS, pNotUsed uintptr, zName uintptr) Sqlite3_syscall_ptr { /* sqlite3.c:34162:28: */ +func unixGetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr) Sqlite3_syscall_ptr { /* sqlite3.c:34470:28: */ var i uint32 _ = pNotUsed @@ -22120,7 +22038,7 @@ func unixGetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr) Sqlite3_s // 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 *libc.TLS, p uintptr, zName uintptr) uintptr { /* sqlite3.c:34181:19: */ +func unixNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) uintptr { /* sqlite3.c:34489:19: */ var i int32 = -1 _ = p @@ -22158,7 +22076,7 @@ func unixNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) uintptr { /* sq // 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 *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3.c:34222:12: */ +func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3.c:34530:12: */ bp := tls.Alloc(160) defer tls.Free(160) @@ -22167,7 +22085,7 @@ func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3 if m != 0 { m2 = m } else { - m2 = SQLITE_DEFAULT_FILE_PERMISSIONS + m2 = uint32(SQLITE_DEFAULT_FILE_PERMISSIONS) } for 1 != 0 { fd = (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 8 /* &.pCurrent */))))(tls, z, (f | 02000000), int32(m2)) @@ -22182,9 +22100,9 @@ func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3 } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 1*24 + 8 /* &.pCurrent */))))(tls, fd) Xsqlite3_log(tls, SQLITE_WARNING, - ts+2498 /* "attempt to open ..." */, libc.VaList(bp, z, fd)) + ts+2526 /* "attempt to open ..." */, libc.VaList(bp, z, fd)) fd = -1 - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 8 /* &.pCurrent */))))(tls, ts+2541 /* "/dev/null" */, O_RDONLY, int32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 8 /* &.pCurrent */))))(tls, ts+2569 /* "/dev/null" */, O_RDONLY, int32(m)) < 0 { break } } @@ -22225,14 +22143,14 @@ func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3 // OK: enter(unixBigLock) // OK: enter(pLockInfo) // ERROR: enter(pLockInfo), enter(unixBigLock) -var unixBigLock uintptr = uintptr(0) /* sqlite3.c:34284:22 */ +var unixBigLock uintptr = uintptr(0) /* sqlite3.c:34592:22 */ -func unixEnterMutex(tls *libc.TLS) { /* sqlite3.c:34285:13: */ +func unixEnterMutex(tls *libc.TLS) { /* sqlite3.c:34593:13: */ // Not a recursive mutex Xsqlite3_mutex_enter(tls, unixBigLock) } -func unixLeaveMutex(tls *libc.TLS) { /* sqlite3.c:34289:13: */ +func unixLeaveMutex(tls *libc.TLS) { /* sqlite3.c:34597:13: */ Xsqlite3_mutex_leave(tls, unixBigLock) } @@ -22242,7 +22160,7 @@ func unixLeaveMutex(tls *libc.TLS) { /* sqlite3.c:34289:13: */ // 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 *libc.TLS, h int32, sz Sqlite3_int64) int32 { /* sqlite3.c:34385:12: */ +func robust_ftruncate(tls *libc.TLS, h int32, sz Sqlite3_int64) int32 { /* sqlite3.c:34693:12: */ var rc int32 for ok := true; ok; ok = ((rc < 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == EINTR)) { rc = (*(*func(*libc.TLS, int32, Off_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 6*24 + 8 /* &.pCurrent */))))(tls, h, int64(sz)) @@ -22258,7 +22176,7 @@ func robust_ftruncate(tls *libc.TLS, h int32, sz Sqlite3_int64) int32 { /* sqlit // // Errors during initialization of locks, or file system support for locks, // should handle ENOLCK, ENOTSUP, EOPNOTSUPP separately. -func sqliteErrorFromPosixError(tls *libc.TLS, posixError int32, sqliteIOErr int32) int32 { /* sqlite3.c:34410:12: */ +func sqliteErrorFromPosixError(tls *libc.TLS, posixError int32, sqliteIOErr int32) int32 { /* sqlite3.c:34718:12: */ switch posixError { case EACCES: @@ -22307,7 +22225,7 @@ type vxworksFileId = struct { FnRef int32 FnName int32 FzCanonicalName uintptr -} /* sqlite3.c:34452:1 */ +} /* sqlite3.c:34760:1 */ // ************** End of Unique File ID Utility Used By VxWorks **************** // @@ -22408,12 +22326,12 @@ type vxworksFileId = struct { type unixFileId = struct { Fdev Dev_t Fino U64 -} /* sqlite3.c:33546:9 */ +} /* sqlite3.c:33854:9 */ // A lists of all unixInodeInfo objects. // // Must hold unixBigLock in order to read or write this variable. -var inodeList uintptr = uintptr(0) /* sqlite3.c:34734:22 */ +var inodeList uintptr = uintptr(0) /* sqlite3.c:35042:22 */ // All unixInodeInfo objects @@ -22431,7 +22349,7 @@ var inodeList uintptr = uintptr(0) /* sqlite3.c:34734:22 */ // The two subsequent arguments should be the name of the OS function that // failed (e.g. "unlink", "open") and the associated file-system path, // if any. -func unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uintptr, iLine int32) int32 { /* sqlite3.c:34769:12: */ +func unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uintptr, iLine int32) int32 { /* sqlite3.c:35077:12: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -22448,7 +22366,7 @@ func unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uintp zPath = ts + 703 /* "" */ } Xsqlite3_log(tls, errcode, - ts+2551, /* "os_unix.c:%d: (%..." */ + ts+2579, /* "os_unix.c:%d: (%..." */ libc.VaList(bp, iLine, iErrno, zFunc, zPath, zErr)) return errcode @@ -22465,9 +22383,9 @@ func unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uintp // 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 *libc.TLS, pFile uintptr, h int32, lineno int32) { /* sqlite3.c:34834:13: */ +func robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { /* sqlite3.c:35142:13: */ if (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 1*24 + 8 /* &.pCurrent */))))(tls, h) != 0 { - unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(16) << 8)), ts+2293, /* "close" */ + unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(16) << 8)), ts+2321, /* "close" */ func() uintptr { if pFile != 0 { return (*UnixFile)(unsafe.Pointer(pFile)).FzPath @@ -22479,19 +22397,19 @@ func robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { /* sqli // Set the pFile->lastErrno. Do this in a subroutine as that provides // a convenient place to set a breakpoint. -func storeLastErrno(tls *libc.TLS, pFile uintptr, error int32) { /* sqlite3.c:34845:13: */ +func storeLastErrno(tls *libc.TLS, pFile uintptr, error int32) { /* sqlite3.c:35153:13: */ (*UnixFile)(unsafe.Pointer(pFile)).FlastErrno = error } // Close all file descriptors accumuated in the unixInodeInfo->pUnused list. -func closePendingFds(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:34852:13: */ +func closePendingFds(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35160:13: */ var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode var p uintptr var pNext uintptr for p = (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpUnused; p != 0; p = pNext { pNext = (*UnixUnusedFd)(unsafe.Pointer(p)).FpNext - robust_close(tls, pFile, (*UnixUnusedFd)(unsafe.Pointer(p)).Ffd, 34859) + robust_close(tls, pFile, (*UnixUnusedFd)(unsafe.Pointer(p)).Ffd, 35167) Xsqlite3_free(tls, p) } (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpUnused = uintptr(0) @@ -22501,7 +22419,7 @@ func closePendingFds(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:34852:13: */ // // The global mutex must be held when this routine is called, but the mutex // on the inode being deleted must NOT be held. -func releaseInodeInfo(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:34871:13: */ +func releaseInodeInfo(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35179:13: */ var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode if pInode != 0 { @@ -22535,7 +22453,7 @@ func releaseInodeInfo(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:34871:13: */ // The global mutex must held when calling this routine. // // Return an appropriate error code. -func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sqlite3.c:34908:12: */ +func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sqlite3.c:35216:12: */ bp := tls.Alloc(160) defer tls.Free(160) @@ -22594,7 +22512,7 @@ func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sql } // Return TRUE if pFile has been renamed or unlinked since it was first opened. -func fileHasMoved(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:35000:12: */ +func fileHasMoved(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:35308:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -22611,7 +22529,7 @@ func fileHasMoved(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:35000:12: * // (3) The file has not been renamed or unlinked // // Issue sqlite3_log(SQLITE_WARNING,...) messages if anything is not right. -func verifyDbFile(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35021:13: */ +func verifyDbFile(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35329:13: */ bp := tls.Alloc(176) defer tls.Free(176) @@ -22626,19 +22544,19 @@ func verifyDbFile(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35021:13: */ rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 5*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, bp+32 /* &buf */) if rc != 0 { - Xsqlite3_log(tls, SQLITE_WARNING, ts+2582 /* "cannot fstat db ..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, SQLITE_WARNING, ts+2610 /* "cannot fstat db ..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) return } if (*stat)(unsafe.Pointer(bp+32 /* &buf */)).Fst_nlink == uint64(0) { - Xsqlite3_log(tls, SQLITE_WARNING, ts+2606 /* "file unlinked wh..." */, libc.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, SQLITE_WARNING, ts+2634 /* "file unlinked wh..." */, libc.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) return } if (*stat)(unsafe.Pointer(bp+32 /* &buf */)).Fst_nlink > uint64(1) { - Xsqlite3_log(tls, SQLITE_WARNING, ts+2635 /* "multiple links t..." */, libc.VaList(bp+16, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, SQLITE_WARNING, ts+2663 /* "multiple links t..." */, libc.VaList(bp+16, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) return } if fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, SQLITE_WARNING, ts+2662 /* "file renamed whi..." */, libc.VaList(bp+24, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, SQLITE_WARNING, ts+2690 /* "file renamed whi..." */, libc.VaList(bp+24, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -22647,7 +22565,7 @@ func verifyDbFile(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35021:13: */ // 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 *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:35054:12: */ +func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:35362:12: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -22666,10 +22584,10 @@ func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { / if !(reserved != 0) && !(int32((*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FbProcessLock) != 0) { // var lock flock at bp+8, 32 - (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 1)) (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_len = int64(1) - (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = int16(F_WRLCK) if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_GETLK64, libc.VaList(bp, bp+8 /* &lock */)) != 0 { rc = (SQLITE_IOERR | (int32(14) << 8)) storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) @@ -22713,7 +22631,7 @@ func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { / // // 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 *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite3.c:35152:12: */ +func unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite3.c:35463:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -22724,10 +22642,10 @@ func unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite if int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0 { // var lock flock at bp+16, 32 - (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_len = SHARED_SIZE - (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_len = int64(SHARED_SIZE) + (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_type = int16(F_WRLCK) rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_SETLK64, libc.VaList(bp, bp+16 /* &lock */)) if rc < 0 { return rc @@ -22765,7 +22683,7 @@ func unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite // // This routine will only increase a lock. Use the sqlite3OsUnlock() // routine to lower a locking level. -func unixLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35202:12: */ +func unixLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35513:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -22854,7 +22772,7 @@ __2: goto __3 } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared++ (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnLock++ goto end_lock @@ -22865,16 +22783,16 @@ __3: // acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will // be released. (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = 1 - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET) if !((eFileLock == SHARED_LOCK) || ((eFileLock == EXCLUSIVE_LOCK) && (int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock) < PENDING_LOCK))) { goto __4 } (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = func() int16 { if eFileLock == SHARED_LOCK { - return F_RDLCK + return int16(F_RDLCK) } - return F_WRLCK + return int16(F_WRLCK) }() (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte) if !(unixFileLock(tls, pFile, bp /* &lock */) != 0) { @@ -22902,7 +22820,7 @@ __4: // Now get the read-lock (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = SHARED_SIZE + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = int64(SHARED_SIZE) if !(unixFileLock(tls, pFile, bp /* &lock */) != 0) { goto __9 } @@ -22914,7 +22832,7 @@ __9: // Drop the temporary PENDING lock (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = 1 - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = F_UNLCK + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_UNLCK) if !((unixFileLock(tls, pFile, bp /* &lock */) != 0) && (rc == SQLITE_OK)) { goto __10 } @@ -22936,7 +22854,7 @@ __13: goto end_lock goto __12 __11: - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnLock++ (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared = 1 __12: @@ -22955,7 +22873,7 @@ __14: // assumed that there is a SHARED or greater lock on the file // already. ; - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_WRLCK) if !(eFileLock == RESERVED_LOCK) { goto __16 @@ -22965,7 +22883,7 @@ __14: goto __17 __16: (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = SHARED_SIZE + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = int64(SHARED_SIZE) __17: ; @@ -22997,8 +22915,8 @@ __20: if !(eFileLock == EXCLUSIVE_LOCK) { goto __22 } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = PENDING_LOCK - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = PENDING_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(PENDING_LOCK) + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(PENDING_LOCK) __22: ; __21: @@ -23012,7 +22930,7 @@ end_lock: // Add the file descriptor used by file handle pFile to the corresponding // pUnused list. -func setPendingFd(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35429:13: */ +func setPendingFd(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35740:13: */ var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode var p uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused @@ -23033,7 +22951,7 @@ func setPendingFd(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35429:13: */ // 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 *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock int32) int32 { /* sqlite3.c:35452:12: */ +func posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock int32) int32 { /* sqlite3.c:35763:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -23071,10 +22989,10 @@ __1: } _ = handleNFSUnlock - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = F_RDLCK - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_RDLCK) + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = SHARED_SIZE + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = int64(SHARED_SIZE) if !(unixFileLock(tls, pFile, bp /* &lock */) != 0) { goto __4 } @@ -23092,14 +23010,14 @@ __4: __3: ; - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = F_UNLCK - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_UNLCK) + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_len = 2 if !(unixFileLock(tls, pFile, bp /* &lock */) == 0) { goto __5 } - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = SHARED_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(SHARED_LOCK) goto __6 __5: rc = (SQLITE_IOERR | (int32(8) << 8)) @@ -23119,19 +23037,19 @@ __2: if !((*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared == 0) { goto __8 } - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = F_UNLCK - (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_type = int16(F_UNLCK) + (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp /* &lock */)).Fl_start = libc.AssignPtrInt64(bp /* &lock */ +16 /* &.l_len */, 0) if !(unixFileLock(tls, pFile, bp /* &lock */) == 0) { goto __9 } - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = NO_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(NO_LOCK) goto __10 __9: rc = (SQLITE_IOERR | (int32(8) << 8)) storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = NO_LOCK - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = NO_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(NO_LOCK) + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(NO_LOCK) __10: ; __8: @@ -23167,7 +23085,7 @@ __12: // // 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 *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35612:12: */ +func unixUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35923:12: */ return posixUnlock(tls, id, eFileLock, 0) } @@ -23180,11 +23098,11 @@ func unixUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c // 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 *libc.TLS, id uintptr) int32 { /* sqlite3.c:35634:12: */ +func closeUnixFile(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35945:12: */ var pFile uintptr = id unixUnmapfile(tls, pFile) if (*UnixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - robust_close(tls, pFile, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 35640) + robust_close(tls, pFile, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 35951) (*UnixFile)(unsafe.Pointer(pFile)).Fh = -1 } @@ -23194,7 +23112,7 @@ func closeUnixFile(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35634:12: */ } // Close a file. -func unixClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35669:12: */ +func unixClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35980:12: */ var rc int32 = SQLITE_OK var pFile uintptr = id var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode @@ -23217,6 +23135,7 @@ func unixClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35669:12: */ } Xsqlite3_mutex_leave(tls, (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) releaseInodeInfo(tls, pFile) + rc = closeUnixFile(tls, id) unixLeaveMutex(tls) return rc @@ -23243,26 +23162,26 @@ func unixClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35669:12: */ // database connections are accessing the same database file at the same // time and one or more of those connections are writing. -func nolockCheckReservedLock(tls *libc.TLS, NotUsed uintptr, pResOut uintptr) int32 { /* sqlite3.c:35720:12: */ +func nolockCheckReservedLock(tls *libc.TLS, NotUsed uintptr, pResOut uintptr) int32 { /* sqlite3.c:36032:12: */ _ = NotUsed *(*int32)(unsafe.Pointer(pResOut)) = 0 return SQLITE_OK } -func nolockLock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:35725:12: */ +func nolockLock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:36037:12: */ _ = NotUsed _ = NotUsed2 return SQLITE_OK } -func nolockUnlock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:35729:12: */ +func nolockUnlock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:36041:12: */ _ = NotUsed _ = NotUsed2 return SQLITE_OK } // Close the file. -func nolockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35737:12: */ +func nolockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36049:12: */ return closeUnixFile(tls, id) } @@ -23303,7 +23222,7 @@ func nolockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35737:12: */ // 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 *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:35782:12: */ +func dotlockCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:36094:12: */ var rc int32 = SQLITE_OK var reserved int32 = 0 var pFile uintptr = id @@ -23339,7 +23258,7 @@ func dotlockCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 // // With dotfile locking, we really only support state (4): EXCLUSIVE. // But we track the other locking levels internally. -func dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35823:12: */ +func dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:36135:12: */ var pFile uintptr = id var zLockFile uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext var rc int32 = SQLITE_OK @@ -23381,7 +23300,7 @@ func dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3. // the requested locking level, this routine is a no-op. // // When the locking level reaches NO_LOCK, delete the lock file. -func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35873:12: */ +func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:36185:12: */ var pFile uintptr = id var zLockFile uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext var rc int32 @@ -23394,7 +23313,7 @@ func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite // To downgrade to shared, simply update our internal notion of the // lock state. No need to mess with the file on disk. if eFileLock == SHARED_LOCK { - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) return SQLITE_OK } @@ -23411,12 +23330,12 @@ func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite } return rc } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = NO_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(NO_LOCK) return SQLITE_OK } // Close a file. Make sure the lock has been released before closing. -func dotlockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35916:12: */ +func dotlockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36228:12: */ var pFile uintptr = id dotlockUnlock(tls, id, NO_LOCK) @@ -23515,7 +23434,7 @@ func dotlockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35916:12: */ // // To avoid stomping the errno value on a failed read the lastErrno value // is set before returning. -func seekAndRead(tls *libc.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:36830:12: */ +func seekAndRead(tls *libc.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:37142:12: */ var got int32 var prior int32 = 0 var newOffset I64 @@ -23553,7 +23472,7 @@ func seekAndRead(tls *libc.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, // 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 *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:36879:12: */ +func unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:37191:12: */ var pFile uintptr = id var got int32 @@ -23579,7 +23498,20 @@ func unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3 if got == amt { return SQLITE_OK } else if got < 0 { - // lastErrno set by seekAndRead + // pFile->lastErrno has been set by seekAndRead(). + // Usually we return SQLITE_IOERR_READ here, though for some + // kinds of errors we return SQLITE_IOERR_CORRUPTFS. The + // SQLITE_IOERR_CORRUPTFS will be converted into SQLITE_CORRUPT + // prior to returning to the application by the sqlite3ApiExit() + // routine. + switch (*UnixFile)(unsafe.Pointer(pFile)).FlastErrno { + case ERANGE: + fallthrough + case EIO: + fallthrough + case ENXIO: + return (SQLITE_IOERR | (int32(33) << 8)) + } return (SQLITE_IOERR | (int32(1) << 8)) } else { storeLastErrno(tls, pFile, 0) // not a system error @@ -23595,7 +23527,7 @@ func unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3 // 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 *libc.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32, piErrno uintptr) int32 { /* sqlite3.c:36938:12: */ +func seekAndWriteFd(tls *libc.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32, piErrno uintptr) int32 { /* sqlite3.c:37267:12: */ var rc int32 = 0 // Value returned by system call nBuf = nBuf & (0x1ffff) @@ -23621,13 +23553,13 @@ func seekAndWriteFd(tls *libc.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32, // // To avoid stomping the errno value on a failed write the lastErrno value // is set before returning. -func seekAndWrite(tls *libc.TLS, id uintptr, offset I64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:36984:12: */ +func seekAndWrite(tls *libc.TLS, id uintptr, offset I64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:37313:12: */ return seekAndWriteFd(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, offset, pBuf, cnt, (id + 32 /* &.lastErrno */)) } // Write data from a buffer into a file. Return SQLITE_OK on success // or some other error code on failure. -func unixWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:36993:12: */ +func unixWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:37322:12: */ var pFile uintptr = id var wrote int32 = 0 @@ -23684,7 +23616,7 @@ func unixWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite // 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 *libc.TLS, fd int32, fullSync int32, dataOnly int32) int32 { /* sqlite3.c:37128:12: */ +func full_fsync(tls *libc.TLS, fd int32, fullSync int32, dataOnly int32) int32 { /* sqlite3.c:37457:12: */ var rc int32 // The following "ifdef/elif/else/" block has the same structure as @@ -23730,7 +23662,7 @@ func full_fsync(tls *libc.TLS, fd int32, fullSync int32, dataOnly int32) int32 { // // If SQLITE_OK is returned, the caller is responsible for closing // the file descriptor *pFd using close(). -func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sqlite3.c:37224:12: */ +func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sqlite3.c:37553:12: */ bp := tls.Alloc(521) defer tls.Free(521) @@ -23738,7 +23670,7 @@ func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sql var fd int32 = -1 // var zDirname [513]int8 at bp+8, 513 - Xsqlite3_snprintf(tls, MAX_PATHNAME, bp+8 /* &zDirname[0] */, ts+2690 /* "%s" */, libc.VaList(bp, zFilename)) + Xsqlite3_snprintf(tls, MAX_PATHNAME, bp+8 /* &zDirname[0] */, ts+2718 /* "%s" */, libc.VaList(bp, zFilename)) for ii = int32(libc.Xstrlen(tls, bp+8 /* &zDirname[0] */)); (ii > 0) && (int32(*(*int8)(unsafe.Pointer(bp + 8 /* &zDirname[0] */ + uintptr(ii)))) != '/'); ii-- { } if ii > 0 { @@ -23757,7 +23689,7 @@ func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sql if fd >= 0 { return SQLITE_OK } - return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 37243), ts+2405 /* "openDirectory" */, bp+8 /* &zDirname[0] */, 37243) + return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 37572), ts+2433 /* "openDirectory" */, bp+8 /* &zDirname[0] */, 37572) } // Make sure all writes to a particular file are committed to disk. @@ -23773,7 +23705,7 @@ func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sql // 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 *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37261:12: */ +func unixSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37590:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -23792,7 +23724,7 @@ func unixSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37261 if rc != 0 { storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(4) << 8)), ts+2693 /* "full_fsync" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37284) + return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(4) << 8)), ts+2721 /* "full_fsync" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37613) } // Also fsync the directory containing the file if the DIRSYNC flag @@ -23804,7 +23736,7 @@ func unixSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37261 rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 17*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, bp /* &dirfd */) if rc == SQLITE_OK { full_fsync(tls, *(*int32)(unsafe.Pointer(bp /* dirfd */)), 0, 0) - robust_close(tls, pFile, *(*int32)(unsafe.Pointer(bp /* dirfd */)), 37298) + robust_close(tls, pFile, *(*int32)(unsafe.Pointer(bp /* dirfd */)), 37627) } else { rc = SQLITE_OK @@ -23815,7 +23747,7 @@ func unixSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37261 } // Truncate an open file to a specified size -func unixTruncate(tls *libc.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:37311:12: */ +func unixTruncate(tls *libc.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:37640:12: */ var pFile uintptr = id var rc int32 @@ -23830,7 +23762,7 @@ func unixTruncate(tls *libc.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:373 rc = robust_ftruncate(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, nByte) if rc != 0 { storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(6) << 8)), ts+2324 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37329) + return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(6) << 8)), ts+2352 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37658) } else { // If the file was just truncated to a size smaller than the currently @@ -23846,7 +23778,7 @@ func unixTruncate(tls *libc.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:373 } // Determine the current size of a file in bytes -func unixFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:37361:12: */ +func unixFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:37690:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -23877,7 +23809,7 @@ func unixFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c // 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 *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c:37399:12: */ +func fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c:37728:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -23922,7 +23854,7 @@ func fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c if (*UnixFile)(unsafe.Pointer(pFile)).FszChunk <= 0 { if robust_ftruncate(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, nByte) != 0 { storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(6) << 8)), ts+2324 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37450) + return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(6) << 8)), ts+2352 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37779) } } @@ -23937,7 +23869,7 @@ func fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c // 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 *libc.TLS, pFile uintptr, mask uint8, pArg uintptr) { /* sqlite3.c:37468:13: */ +func unixModeBit(tls *libc.TLS, pFile uintptr, mask uint8, pArg uintptr) { /* sqlite3.c:37797:13: */ if *(*int32)(unsafe.Pointer(pArg)) < 0 { *(*int32)(unsafe.Pointer(pArg)) = (libc.Bool32((int32((*UnixFile)(unsafe.Pointer(pFile)).FctrlFlags) & int32(mask)) != 0)) } else if (*(*int32)(unsafe.Pointer(pArg))) == 0 { @@ -23948,7 +23880,7 @@ func unixModeBit(tls *libc.TLS, pFile uintptr, mask uint8, pArg uintptr) { /* sq } // Information and control of an open file handle. -func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:37484:12: */ +func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:37813:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -23984,19 +23916,19 @@ func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { } case SQLITE_FCNTL_PERSIST_WAL: { - unixModeBit(tls, pFile, UNIXFILE_PERSIST_WAL, pArg) + unixModeBit(tls, pFile, uint8(UNIXFILE_PERSIST_WAL), pArg) return SQLITE_OK } case SQLITE_FCNTL_POWERSAFE_OVERWRITE: { - unixModeBit(tls, pFile, UNIXFILE_PSOW, pArg) + unixModeBit(tls, pFile, uint8(UNIXFILE_PSOW), pArg) return SQLITE_OK } case SQLITE_FCNTL_VFSNAME: { - *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp, (*Sqlite3_vfs)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpVfs)).FzName)) + *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp, (*Sqlite3_vfs)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpVfs)).FzName)) return SQLITE_OK } @@ -24053,7 +23985,7 @@ func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { // // There are two versions of this function. One for QNX and one for all // other systems. -func setDeviceCharacteristics(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37610:13: */ +func setDeviceCharacteristics(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37939:13: */ if (*UnixFile)(unsafe.Pointer(pFd)).FsectorSize == 0 { @@ -24074,7 +24006,7 @@ func setDeviceCharacteristics(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37610:1 // if two files are created in the same file-system directory (i.e. // a database and its journal file) that the sector size will be the // same for both. -func unixSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:37717:12: */ +func unixSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:38046:12: */ var pFd uintptr = id setDeviceCharacteristics(tls, pFd) return (*UnixFile)(unsafe.Pointer(pFd)).FsectorSize @@ -24091,7 +24023,7 @@ func unixSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:37717:12: */ // 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 *libc.TLS, id uintptr) int32 { /* sqlite3.c:37736:12: */ +func unixDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:38065:12: */ var pFd uintptr = id setDeviceCharacteristics(tls, pFd) return (*UnixFile)(unsafe.Pointer(pFd)).FdeviceCharacteristics @@ -24101,7 +24033,7 @@ func unixDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:3 // // This function should not be called directly by other code in this file. // Instead, it should be called via macro osGetpagesize(). -func unixGetpagesize(tls *libc.TLS) int32 { /* sqlite3.c:37750:12: */ +func unixGetpagesize(tls *libc.TLS) int32 { /* sqlite3.c:38079:12: */ return int32(libc.Xsysconf(tls, X_SC_PAGESIZE)) } @@ -24111,7 +24043,7 @@ func unixGetpagesize(tls *libc.TLS) int32 { /* sqlite3.c:37750:12: */ // // Locks block if the mask is exactly UNIX_SHM_C and are non-blocking // otherwise. -func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, n int32) int32 { /* sqlite3.c:37846:12: */ +func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, n int32) int32 { /* sqlite3.c:38176:12: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -24131,7 +24063,7 @@ func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, var res int32 // Initialize the locking parameters (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_type = int16(lockType) - (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_start = X__off64_t(ofst) (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_len = X__off64_t(n) res = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_SETLK64, libc.VaList(bp, bp+8 /* &f */)) @@ -24152,7 +24084,7 @@ func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, // 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 *libc.TLS) int32 { /* sqlite3.c:37931:12: */ +func unixShmRegionPerMap(tls *libc.TLS) int32 { /* sqlite3.c:38261:12: */ var shmsz int32 = (32 * 1024) // SHM region size var pgsz int32 = (*(*func(*libc.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 25*24 + 8 /* &.pCurrent */))))(tls) // System page size // Page size must be a power of 2 @@ -24166,7 +24098,7 @@ func unixShmRegionPerMap(tls *libc.TLS) int32 { /* sqlite3.c:37931:12: */ // // This is not a VFS shared-memory method; it is a utility function called // by VFS shared-memory methods. -func unixShmPurge(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37945:13: */ +func unixShmPurge(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38275:13: */ var p uintptr = (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFd)).FpInode)).FpShmNode if (p != 0) && ((*UnixShmNode)(unsafe.Pointer(p)).FnRef == 0) { @@ -24183,7 +24115,7 @@ func unixShmPurge(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37945:13: */ } Xsqlite3_free(tls, (*UnixShmNode)(unsafe.Pointer(p)).FapRegion) if (*UnixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - robust_close(tls, pFd, (*UnixShmNode)(unsafe.Pointer(p)).FhShm, 37962) + robust_close(tls, pFd, (*UnixShmNode)(unsafe.Pointer(p)).FhShm, 38292) (*UnixShmNode)(unsafe.Pointer(p)).FhShm = -1 } (*UnixInodeInfo)(unsafe.Pointer((*UnixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -24198,7 +24130,7 @@ func unixShmPurge(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37945:13: */ // If the DMS cannot be locked because this is a readonly_shm=1 // connection and no other process already holds a lock, return // SQLITE_READONLY_CANTINIT and set pShmNode->isUnlocked=1. -func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 { /* sqlite3.c:37979:12: */ +func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 { /* sqlite3.c:38309:12: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -24224,10 +24156,10 @@ func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 // process might open and use the *-shm file without truncating it. // And if the *-shm file has been corrupted by a power failure or // system crash, the database itself may also become corrupt. - (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_start = (int64(((22 + SQLITE_SHM_NLOCK) * 4) + SQLITE_SHM_NLOCK)) (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_len = int64(1) - (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = int16(F_WRLCK) if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_GETLK64, libc.VaList(bp, bp+8 /* &lock */)) != 0 { rc = (SQLITE_IOERR | (int32(15) << 8)) } else if int32((*flock)(unsafe.Pointer(bp+8 /* &lock */)).Fl_type) == F_UNLCK { @@ -24242,7 +24174,7 @@ func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 // help detect if a -shm file truncation is legitimate or is the work // or a rogue process. if (rc == SQLITE_OK) && (robust_ftruncate(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0) { - rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(18) << 8)), ts+2324 /* "ftruncate" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38019) + rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(18) << 8)), ts+2352 /* "ftruncate" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38349) } } } else if int32((*flock)(unsafe.Pointer(bp+8 /* &lock */)).Fl_type) == F_WRLCK { @@ -24289,7 +24221,7 @@ func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 // 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 *libc.TLS, pDbFd uintptr) int32 { /* sqlite3.c:38068:12: */ +func unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) int32 { /* sqlite3.c:38398:12: */ bp := tls.Alloc(152) defer tls.Free(152) @@ -24347,8 +24279,8 @@ __3: __4: ; libc.Xmemset(tls, pShmNode, 0, (uint64(unsafe.Sizeof(unixShmNode{})) + uint64(nShmFilename))) - zShm = libc.AssignPtrUintptr(pShmNode+16 /* &.zFilename */, (pShmNode + 1*64)) - Xsqlite3_snprintf(tls, nShmFilename, zShm, ts+2704 /* "%s-shm" */, libc.VaList(bp, zBasePath)) + zShm = libc.AssignPtrUintptr(pShmNode+16 /* &.zFilename */, (pShmNode + 1*96)) + Xsqlite3_snprintf(tls, nShmFilename, zShm, ts+2732 /* "%s-shm" */, libc.VaList(bp, zBasePath)) (*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm = -1 (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pDbFd)).FpInode)).FpShmNode = pShmNode @@ -24370,7 +24302,7 @@ __5: if !(int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0) { goto __7 } - if !(0 == Xsqlite3_uri_boolean(tls, (*UnixFile)(unsafe.Pointer(pDbFd)).FzPath, ts+2711 /* "readonly_shm" */, 0)) { + if !(0 == Xsqlite3_uri_boolean(tls, (*UnixFile)(unsafe.Pointer(pDbFd)).FzPath, ts+2739 /* "readonly_shm" */, 0)) { goto __8 } (*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm = robust_open(tls, zShm, ((O_RDWR | O_CREAT) | 0400000), @@ -24385,7 +24317,7 @@ __8: if !((*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm < 0) { goto __10 } - rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 38144), ts+2288 /* "open" */, zShm, 38144) + rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 38474), ts+2316 /* "open" */, zShm, 38474) goto shm_open_err __10: ; @@ -24453,7 +24385,7 @@ shm_open_err: // 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 *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:38210:12: */ +func unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:38540:12: */ bp := tls.Alloc(148) defer tls.Free(148) @@ -24556,7 +24488,7 @@ __11: goto __14 } zFile = (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(19) << 8)), ts+2359 /* "write" */, zFile, 38288) + rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(19) << 8)), ts+2387 /* "write" */, zFile, 38618) goto shmpage_out __14: ; @@ -24604,7 +24536,7 @@ __16: if !(pMem == (libc.UintptrFromInt32(-1))) { goto __20 } - rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(21) << 8)), ts+2446 /* "mmap" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38315) + rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(21) << 8)), ts+2474 /* "mmap" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38645) goto shmpage_out __20: ; @@ -24662,7 +24594,13 @@ __27: return rc } -var pgsz int32 = 4096 /* sqlite3.c:38279:28 */ +var pgsz int32 = 4096 /* sqlite3.c:38609:28 */ + +// Check that the pShmNode->aLock[] array comports with the locking bitmasks +// held by each client. Return true if it does, or false otherwise. This +// is to be used in an assert(). e.g. +// +// assert( assertLockingArrayOk(pShmNode) ); // Change the lock state for a shared-memory segment. // @@ -24670,13 +24608,13 @@ var pgsz int32 = 4096 /* sqlite3.c:38279:28 */ // 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 *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:38353:12: */ +func unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:38715:12: */ var pDbFd uintptr = fd // Connection holding shared memory var p uintptr = (*UnixFile)(unsafe.Pointer(pDbFd)).FpShm // The shared memory being locked - var pX uintptr // For looping over all siblings var pShmNode uintptr = (*UnixShm)(unsafe.Pointer(p)).FpShmNode // The underlying file iNode var rc int32 = SQLITE_OK // Result code var mask U16 // Mask of locks to take or release + var aLock uintptr = pShmNode + 64 /* &.aLock */ // Check that, if this to be a blocking lock, no locks that occur later // in the following list than the lock being obtained are already held: @@ -24694,77 +24632,80 @@ func unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) in mask = (U16((int32(1) << (ofst + n)) - (int32(1) << ofst))) Xsqlite3_mutex_enter(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) - if (flags & SQLITE_SHM_UNLOCK) != 0 { - var allMask U16 = U16(0) // Mask of locks held by siblings - // See if any siblings hold this same lock - for pX = (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpFirst; pX != 0; pX = (*UnixShm)(unsafe.Pointer(pX)).FpNext { - if pX == p { - continue + if (flags & SQLITE_SHM_UNLOCK) != 0 { + if ((int32((*UnixShm)(unsafe.Pointer(p)).FexclMask) | int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask)) & int32(mask)) != 0 { + var ii int32 + var bUnlock int32 = 1 + + for ii = ofst; ii < (ofst + n); ii++ { + if *(*int32)(unsafe.Pointer(aLock + uintptr(ii)*4)) > (func() int32 { + if (int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask) & (int32(1) << ii)) != 0 { + return 1 + } + return 0 + }()) { + bUnlock = 0 + } } - allMask = U16(int32(allMask) | (int32((*UnixShm)(unsafe.Pointer(pX)).FsharedMask))) - } + if bUnlock != 0 { + rc = unixShmSystemLock(tls, pDbFd, F_UNLCK, (ofst + ((22 + SQLITE_SHM_NLOCK) * 4)), n) + if rc == SQLITE_OK { + libc.Xmemset(tls, (aLock + uintptr(ofst)*4), 0, (uint64(unsafe.Sizeof(int32(0))) * uint64(n))) + } + } else if (int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask) & (int32(1) << ofst)) != 0 { - // Unlock the system-level locks - if (int32(mask) & int32(allMask)) == 0 { - rc = unixShmSystemLock(tls, pDbFd, F_UNLCK, (ofst + ((22 + SQLITE_SHM_NLOCK) * 4)), n) - } else { - rc = SQLITE_OK - } + *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4))-- + } - // Undo the local locks - if rc == SQLITE_OK { - *(*U16)(unsafe.Pointer(p + 20 /* &.exclMask */)) &= U16((^int32(mask))) - *(*U16)(unsafe.Pointer(p + 18 /* &.sharedMask */)) &= U16((^int32(mask))) + // Undo the local locks + if rc == SQLITE_OK { + *(*U16)(unsafe.Pointer(p + 20 /* &.exclMask */)) &= U16((^int32(mask))) + *(*U16)(unsafe.Pointer(p + 18 /* &.sharedMask */)) &= U16((^int32(mask))) + } } } else if (flags & SQLITE_SHM_SHARED) != 0 { - var allShared U16 = U16(0) // Union of locks held by connections other than "p" - // Find out which shared locks are already held by sibling connections. - // If any sibling already holds an exclusive lock, go ahead and return - // SQLITE_BUSY. - for pX = (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpFirst; pX != 0; pX = (*UnixShm)(unsafe.Pointer(pX)).FpNext { - if (int32((*UnixShm)(unsafe.Pointer(pX)).FexclMask) & int32(mask)) != 0 { + if (int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask) & int32(mask)) == 0 { + if *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4)) < 0 { rc = SQLITE_BUSY - break - } - allShared = U16(int32(allShared) | (int32((*UnixShm)(unsafe.Pointer(pX)).FsharedMask))) - } - - // Get shared locks at the system level, if necessary - if rc == SQLITE_OK { - if (int32(allShared) & int32(mask)) == 0 { + } else if *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4)) == 0 { rc = unixShmSystemLock(tls, pDbFd, F_RDLCK, (ofst + ((22 + SQLITE_SHM_NLOCK) * 4)), n) - } else { - rc = SQLITE_OK } - } - // Get the local shared locks - if rc == SQLITE_OK { - *(*U16)(unsafe.Pointer(p + 18 /* &.sharedMask */)) |= U16((int32(mask))) + // Get the local shared locks + if rc == SQLITE_OK { + *(*U16)(unsafe.Pointer(p + 18 /* &.sharedMask */)) |= U16((int32(mask))) + *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4))++ + } } } else { // Make sure no sibling connections hold locks that will block this // lock. If any do, return SQLITE_BUSY right away. - for pX = (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpFirst; pX != 0; pX = (*UnixShm)(unsafe.Pointer(pX)).FpNext { - if ((int32((*UnixShm)(unsafe.Pointer(pX)).FexclMask) & int32(mask)) != 0) || ((int32((*UnixShm)(unsafe.Pointer(pX)).FsharedMask) & int32(mask)) != 0) { + var ii int32 + for ii = ofst; ii < (ofst + n); ii++ { + + if ((int32((*UnixShm)(unsafe.Pointer(p)).FexclMask) & (int32(1) << ii)) == 0) && (*(*int32)(unsafe.Pointer(aLock + uintptr(ii)*4)) != 0) { rc = SQLITE_BUSY break } } - // Get the exclusive locks at the system level. Then if successful - // also mark the local connection as being locked. + // Get the exclusive locks at the system level. Then if successful + // also update the in-memory values. if rc == SQLITE_OK { rc = unixShmSystemLock(tls, pDbFd, F_WRLCK, (ofst + ((22 + SQLITE_SHM_NLOCK) * 4)), n) if rc == SQLITE_OK { *(*U16)(unsafe.Pointer(p + 20 /* &.exclMask */)) |= U16((int32(mask))) + for ii = ofst; ii < (ofst + n); ii++ { + *(*int32)(unsafe.Pointer(aLock + uintptr(ii)*4)) = -1 + } } } } + Xsqlite3_mutex_leave(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc @@ -24774,7 +24715,7 @@ func unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) in // // All loads and stores begun before the barrier must complete before // any load or store begun after the barrier. -func unixShmBarrier(tls *libc.TLS, fd uintptr) { /* sqlite3.c:38487:13: */ +func unixShmBarrier(tls *libc.TLS, fd uintptr) { /* sqlite3.c:38847:13: */ _ = fd // compiler-defined memory barrier @@ -24787,7 +24728,7 @@ func unixShmBarrier(tls *libc.TLS, fd uintptr) { /* sqlite3.c:38487:13: */ // // If there is no shared memory associated with the connection then this // routine is a harmless no-op. -func unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite3.c:38506:12: */ +func unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite3.c:38866:12: */ var p uintptr // The connection to be closed var pShmNode uintptr // The underlying shared-memory file var pp uintptr // For looping over sibling connections @@ -24830,7 +24771,7 @@ func unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite } // If it is currently memory mapped, unmap file pFd. -func unixUnmapfile(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38563:13: */ +func unixUnmapfile(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38923:13: */ if (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion != 0 { (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 23*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion, uint64((*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeActual)) @@ -24853,8 +24794,8 @@ func unixUnmapfile(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38563:13: */ // the three variables above are zeroed. In this case SQLite should // continue accessing the database using the xRead() and xWrite() // methods. -func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38588:13: */ - var zErr uintptr = ts + 2446 /* "mmap" */ +func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38948:13: */ + var zErr uintptr = ts + 2474 /* "mmap" */ var h int32 = (*UnixFile)(unsafe.Pointer(pFd)).Fh // File descriptor open on db file var pOrig uintptr = (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion // Pointer to current file mapping var nOrig I64 = (*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeActual // Size of pOrig region in bytes @@ -24871,7 +24812,7 @@ func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38588:13 } pNew = (*(*func(*libc.TLS, uintptr, Size_t, Size_t, int32, uintptr) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 24*24 + 8 /* &.pCurrent */))))(tls, pOrig, uint64(nReuse), uint64(nNew), MREMAP_MAYMOVE, 0) - zErr = ts + 2458 /* "mremap" */ + zErr = ts + 2486 /* "mremap" */ // The attempt to extend the existing mapping failed. Free it. if (pNew == (libc.UintptrFromInt32(-1))) || (pNew == uintptr(0)) { @@ -24887,7 +24828,7 @@ func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38588:13 if pNew == (libc.UintptrFromInt32(-1)) { pNew = uintptr(0) nNew = int64(0) - unixLogErrorAtLine(tls, SQLITE_OK, zErr, (*UnixFile)(unsafe.Pointer(pFd)).FzPath, 38653) + unixLogErrorAtLine(tls, SQLITE_OK, zErr, (*UnixFile)(unsafe.Pointer(pFd)).FzPath, 39013) // If the mmap() above failed, assume that all subsequent mmap() calls // will probably fail too. Fall back to using xRead/xWrite exclusively @@ -24912,7 +24853,7 @@ func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38588:13 // 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 *libc.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:38680:12: */ +func unixMapfile(tls *libc.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:39040:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -24949,7 +24890,7 @@ func unixMapfile(tls *libc.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:3868 // // If this function does return a pointer, the caller must eventually // release the reference by calling unixUnfetch(). -func unixFetch(tls *libc.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int32 { /* sqlite3.c:38717:12: */ +func unixFetch(tls *libc.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int32 { /* sqlite3.c:39077:12: */ var pFd uintptr = fd // The underlying database file *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0) @@ -24976,7 +24917,7 @@ func unixFetch(tls *libc.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int3 // 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 *libc.TLS, fd uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:38748:12: */ +func unixUnfetch(tls *libc.TLS, fd uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:39108:12: */ var pFd uintptr = fd // The underlying database file _ = iOff @@ -25037,33 +24978,33 @@ func unixUnfetch(tls *libc.TLS, fd uintptr, iOff I64, p uintptr) int32 { /* sqli // 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. -var posixIoMethods = Sqlite3_io_methods{FiVersion: 3 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xDeviceCapabilities */, FxShmMap: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:38850:1 */ +var posixIoMethods = Sqlite3_io_methods{FiVersion: 3 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xDeviceCapabilities */, FxShmMap: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:39210:1 */ -func posixIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:38850:1: */ +func posixIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:39210:1: */ _ = z _ = p return uintptr(unsafe.Pointer(&posixIoMethods)) } -var posixIoFinder uintptr = 0 /* sqlite3.c:38850:1 */ -var nolockIoMethods = Sqlite3_io_methods{FiVersion: 3 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:38860:1 */ +var posixIoFinder uintptr = 0 /* sqlite3.c:39210:1 */ +var nolockIoMethods = Sqlite3_io_methods{FiVersion: 3 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:39220:1 */ -func nolockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:38860:1: */ +func nolockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:39220:1: */ _ = z _ = p return uintptr(unsafe.Pointer(&nolockIoMethods)) } -var nolockIoFinder uintptr = 0 /* sqlite3.c:38860:1 */ -var dotlockIoMethods = Sqlite3_io_methods{FiVersion: 1 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:38870:1 */ +var nolockIoFinder uintptr = 0 /* sqlite3.c:39220:1 */ +var dotlockIoMethods = Sqlite3_io_methods{FiVersion: 1 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:39230:1 */ -func dotlockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:38870:1: */ +func dotlockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:39230:1: */ _ = z _ = p return uintptr(unsafe.Pointer(&dotlockIoMethods)) } -var dotlockIoFinder uintptr = 0 /* sqlite3.c:38870:1 */ +var dotlockIoFinder uintptr = 0 /* sqlite3.c:39230:1 */ // The proxy locking method is a "super-method" in the sense that it // opens secondary file descriptors for the conch and lock files and @@ -25076,7 +25017,7 @@ var dotlockIoFinder uintptr = 0 /* sqlite3.c:38870:1 */ // nfs lockd on OSX 10.3+ doesn't clear write locks when a read lock is set // An abstract type for a pointer to an IO method finder function: -type Finder_type = uintptr /* sqlite3.c:39065:34 */ +type Finder_type = uintptr /* sqlite3.c:39425:34 */ // *************************************************************************** // @@ -25086,7 +25027,7 @@ type Finder_type = uintptr /* sqlite3.c:39065:34 */ // sqlite3_vfs object. // Initialize the contents of the unixFile structure pointed to by pId. -func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename uintptr, ctrlFlags int32) int32 { /* sqlite3.c:39078:12: */ +func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename uintptr, ctrlFlags int32) int32 { /* sqlite3.c:39438:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -25107,10 +25048,10 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename } return uintptr(0) }(), - ts+2724 /* "psow" */, SQLITE_POWERSAFE_OVERWRITE) != 0 { + ts+2752 /* "psow" */, SQLITE_POWERSAFE_OVERWRITE) != 0 { *(*uint16)(unsafe.Pointer(pNew + 30 /* &.ctrlFlags */)) |= uint16((UNIXFILE_PSOW)) } - if libc.Xstrcmp(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName, ts+2729 /* "unix-excl" */) == 0 { + if libc.Xstrcmp(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName, ts+2757 /* "unix-excl" */) == 0 { *(*uint16)(unsafe.Pointer(pNew + 30 /* &.ctrlFlags */)) |= uint16((UNIXFILE_EXCL)) } @@ -25141,7 +25082,7 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename // If scenario (a) caused the error then things are not so safe. The // implicit assumption here is that if fstat() fails, things are in // such bad shape that dropping a lock or two doesn't matter much. - robust_close(tls, pNew, h, 39156) + robust_close(tls, pNew, h, 39516) h = -1 } unixLeaveMutex(tls) @@ -25156,7 +25097,7 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename if zLockFile == uintptr(0) { rc = SQLITE_NOMEM } else { - Xsqlite3_snprintf(tls, nFilename, zLockFile, ts+2739 /* "%s.lock" */, libc.VaList(bp, zFilename)) + Xsqlite3_snprintf(tls, nFilename, zLockFile, ts+2767 /* "%s.lock" */, libc.VaList(bp, zFilename)) } (*UnixFile)(unsafe.Pointer(pNew)).FlockingContext = zLockFile } @@ -25164,7 +25105,7 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename storeLastErrno(tls, pNew, 0) if rc != SQLITE_OK { if h >= 0 { - robust_close(tls, pNew, h, 39241) + robust_close(tls, pNew, h, 39601) } } else { (*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -25176,7 +25117,7 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename // 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 *libc.TLS) uintptr { /* sqlite3.c:39254:19: */ +func unixTempFileDir(tls *libc.TLS) uintptr { /* sqlite3.c:39614:19: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -25186,10 +25127,10 @@ func unixTempFileDir(tls *libc.TLS) uintptr { /* sqlite3.c:39254:19: */ var zDir uintptr = Xsqlite3_temp_directory if !(int32(azDirs[0]) != 0) { - azDirs[0] = libc.Xgetenv(tls, ts+2747 /* "SQLITE_TMPDIR" */) + azDirs[0] = libc.Xgetenv(tls, ts+2775 /* "SQLITE_TMPDIR" */) } if !(int32(azDirs[1]) != 0) { - azDirs[1] = libc.Xgetenv(tls, ts+2761 /* "TMPDIR" */) + azDirs[1] = libc.Xgetenv(tls, ts+2789 /* "TMPDIR" */) } for 1 != 0 { if (((zDir != uintptr(0)) && @@ -25209,16 +25150,16 @@ func unixTempFileDir(tls *libc.TLS) uintptr { /* sqlite3.c:39254:19: */ var azDirs = [6]uintptr{ uintptr(0), uintptr(0), - ts + 2768, /* "/var/tmp" */ - ts + 2777, /* "/usr/tmp" */ - ts + 2786, /* "/tmp" */ + ts + 2796, /* "/var/tmp" */ + ts + 2805, /* "/usr/tmp" */ + ts + 2814, /* "/tmp" */ ts + 716, /* "." */ -} /* sqlite3.c:39255:21 */ +} /* sqlite3.c:39615:21 */ // 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 *libc.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:39288:12: */ +func unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:39648:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -25240,7 +25181,7 @@ func unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3 Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U64(0))), bp+24 /* &r */) *(*int8)(unsafe.Pointer(zBuf + uintptr((nBuf - 2)))) = int8(0) - Xsqlite3_snprintf(tls, nBuf, zBuf, ts+2791, /* "%s/etilqs_%llx%c" */ + Xsqlite3_snprintf(tls, nBuf, zBuf, ts+2819, /* "%s/etilqs_%llx%c" */ libc.VaList(bp, zDir, *(*U64)(unsafe.Pointer(bp + 24 /* r */)), 0)) if (int32(*(*int8)(unsafe.Pointer(zBuf + uintptr((nBuf - 2))))) != 0) || ((libc.PostIncInt32(&iLimit, 1)) > 10) { return SQLITE_ERROR @@ -25263,7 +25204,7 @@ func unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3 // // If a suitable file descriptor is found, then it is returned. If no // such file descriptor is located, -1 is returned. -func findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) uintptr { /* sqlite3.c:39338:21: */ +func findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) uintptr { /* sqlite3.c:39698:21: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -25314,7 +25255,7 @@ func findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) uintptr { /* sqli } // Find the mode, uid and gid of file zFile. -func getFileMode(tls *libc.TLS, zFile uintptr, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:39388:12: */ +func getFileMode(tls *libc.TLS, zFile uintptr, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:39748:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -25350,7 +25291,7 @@ func getFileMode(tls *libc.TLS, zFile uintptr, pMode uintptr, pUid uintptr, pGid // 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. In 8_3_NAMES mode, leave *pMode set to zero. -func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:39427:12: */ +func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:39787:12: */ bp := tls.Alloc(513) defer tls.Free(513) @@ -25396,7 +25337,7 @@ func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr // filename, check for the "modeof" parameter. If present, interpret // its value as a filename and try to copy the mode, uid and gid from // that file. - var z uintptr = Xsqlite3_uri_parameter(tls, zPath, ts+2808 /* "modeof" */) + var z uintptr = Xsqlite3_uri_parameter(tls, zPath, ts+2836 /* "modeof" */) if z != 0 { rc = getFileMode(tls, z, pMode, pUid, pGid) } @@ -25424,7 +25365,7 @@ func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr // 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 *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:39504:12: */ +func unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:39864:12: */ bp := tls.Alloc(528) defer tls.Free(528) @@ -25622,7 +25563,7 @@ __15: if !(fd < 0) { goto __19 } - rc2 = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39655), ts+2288 /* "open" */, zName, 39655) + rc2 = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40015), ts+2316 /* "open" */, zName, 40015) if !(rc == SQLITE_OK) { goto __20 } @@ -25722,7 +25663,7 @@ __30: // Delete the file at zPath. If the dirSync argument is true, fsync() // the directory after deleting the file. -func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:39778:12: */ +func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:40138:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -25733,7 +25674,7 @@ func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) in if (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == ENOENT { rc = (SQLITE_IOERR | (int32(23) << 8)) } else { - rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(10) << 8)), ts+2398 /* "unlink" */, zPath, 39794) + rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(10) << 8)), ts+2426 /* "unlink" */, zPath, 40154) } return rc } @@ -25743,9 +25684,9 @@ func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) in rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 17*24 + 8 /* &.pCurrent */))))(tls, zPath, bp /* &fd */) if rc == SQLITE_OK { if full_fsync(tls, *(*int32)(unsafe.Pointer(bp /* fd */)), 0, 0) != 0 { - rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(5) << 8)), ts+2815 /* "fsync" */, zPath, 39804) + rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(5) << 8)), ts+2843 /* "fsync" */, zPath, 40164) } - robust_close(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp /* fd */)), 39806) + robust_close(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp /* fd */)), 40166) } else { rc = SQLITE_OK @@ -25762,7 +25703,7 @@ func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) in // SQLITE_ACCESS_READONLY: Return 1 if the file is readable. // // Otherwise return 0. -func unixAccess(tls *libc.TLS, NotUsed uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:39826:12: */ +func unixAccess(tls *libc.TLS, NotUsed uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:40186:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -25781,16 +25722,41 @@ func unixAccess(tls *libc.TLS, NotUsed uintptr, zPath uintptr, flags int32, pRes return SQLITE_OK } +// If the last component of the pathname in z[0]..z[j-1] is something +// other than ".." then back it out and return true. If the last +// component is empty or if it is ".." then return false. +func unixBackupDir(tls *libc.TLS, z uintptr, pJ uintptr) int32 { /* sqlite3.c:40215:12: */ + var j int32 = *(*int32)(unsafe.Pointer(pJ)) + var i int32 + if j <= 0 { + return 0 + } + for i = (j - 1); (i > 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr((i - 1))))) != '/'); i-- { + } + if ((int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == '.') && (i == (j - 2))) && (int32(*(*int8)(unsafe.Pointer(z + uintptr((i + 1))))) == '.') { + return 0 + } + *(*int32)(unsafe.Pointer(pJ)) = (i - 1) + return 1 +} + +// Convert a relative pathname into a full pathname. Also +// simplify the pathname as follows: // -func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int32 { /* sqlite3.c:39853:12: */ - bp := tls.Alloc(8) - defer tls.Free(8) +// Remove all instances of /./ +// Remove all isntances of /X/../ for any X +func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int32 { /* sqlite3.c:40232:12: */ + bp := tls.Alloc(12) + defer tls.Free(12) var nPath int32 = Xsqlite3Strlen30(tls, zPath) var iOff int32 = 0 + var i int32 + // var j int32 at bp+8, 4 + if int32(*(*int8)(unsafe.Pointer(zPath))) != '/' { if (*(*func(*libc.TLS, uintptr, Size_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 3*24 + 8 /* &.pCurrent */))))(tls, zOut, (uint64(nOut-2))) == uintptr(0) { - return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39862), ts+2306 /* "getcwd" */, zPath, 39862) + return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40242), ts+2334 /* "getcwd" */, zPath, 40242) } iOff = Xsqlite3Strlen30(tls, zOut) *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&iOff, 1)))) = int8('/') @@ -25799,9 +25765,47 @@ func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int3 // SQLite assumes that xFullPathname() nul-terminates the output buffer // even if it returns an error. *(*int8)(unsafe.Pointer(zOut + uintptr(iOff))) = int8(0) - return Xsqlite3CantopenError(tls, 39871) + return Xsqlite3CantopenError(tls, 40251) } - Xsqlite3_snprintf(tls, (nOut - iOff), (zOut + uintptr(iOff)), ts+2690 /* "%s" */, libc.VaList(bp, zPath)) + Xsqlite3_snprintf(tls, (nOut - iOff), (zOut + uintptr(iOff)), ts+2718 /* "%s" */, libc.VaList(bp, zPath)) + + // Remove duplicate '/' characters. Except, two // at the beginning + // of a pathname is allowed since this is important on windows. + for i = libc.AssignPtrInt32(bp+8 /* j */, 1); *(*int8)(unsafe.Pointer(zOut + uintptr(i))) != 0; i++ { + *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 8 /* j */)), 1)))) = *(*int8)(unsafe.Pointer(zOut + uintptr(i))) + for (int32(*(*int8)(unsafe.Pointer(zOut + uintptr(i)))) == '/') && (int32(*(*int8)(unsafe.Pointer(zOut + uintptr((i + 1))))) == '/') { + i++ + } + } + *(*int8)(unsafe.Pointer(zOut + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* j */))))) = int8(0) + + for i = libc.AssignPtrInt32(bp+8 /* j */, 0); *(*int8)(unsafe.Pointer(zOut + uintptr(i))) != 0; i++ { + if int32(*(*int8)(unsafe.Pointer(zOut + uintptr(i)))) == '/' { + // Skip over internal "/." directory components + if (int32(*(*int8)(unsafe.Pointer(zOut + uintptr((i + 1))))) == '.') && (int32(*(*int8)(unsafe.Pointer(zOut + uintptr((i + 2))))) == '/') { + i = i + (1) + continue + } + + // If this is a "/.." directory component then back out the + // previous term of the directory if it is something other than "..". + if (((int32(*(*int8)(unsafe.Pointer(zOut + uintptr((i + 1))))) == '.') && + (int32(*(*int8)(unsafe.Pointer(zOut + uintptr((i + 2))))) == '.')) && + (int32(*(*int8)(unsafe.Pointer(zOut + uintptr((i + 3))))) == '/')) && + (unixBackupDir(tls, zOut, bp+8 /* &j */) != 0) { + i = i + (2) + continue + } + } + if *(*int32)(unsafe.Pointer(bp + 8 /* j */)) >= 0 { + *(*int8)(unsafe.Pointer(zOut + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* j */))))) = *(*int8)(unsafe.Pointer(zOut + uintptr(i))) + } + *(*int32)(unsafe.Pointer(bp + 8 /* j */))++ + } + if *(*int32)(unsafe.Pointer(bp + 8 /* j */)) == 0 { + *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 8 /* j */)), 1)))) = int8('/') + } + *(*int8)(unsafe.Pointer(zOut + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* j */))))) = int8(0) return SQLITE_OK } @@ -25812,7 +25816,7 @@ func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int3 // 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 *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:39886:12: */ +func unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:40301:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -25838,7 +25842,7 @@ func unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zO if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 27*24 + 8 /* &.pCurrent */))))(tls, zIn, bp /* &buf */) != 0 { if (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) != ENOENT { - rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39919), ts+2486 /* "lstat" */, zIn, 39919) + rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40334), ts+2514 /* "lstat" */, zIn, 40334) } } else { bLink = (libc.Bool32((((*stat)(unsafe.Pointer(bp /* &buf */)).Fst_mode) & X__mode_t(0170000)) == (X__mode_t(0120000)))) @@ -25852,20 +25856,20 @@ func unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zO rc = SQLITE_NOMEM } } else if nLink >= SQLITE_MAX_SYMLINKS { - rc = Xsqlite3CantopenError(tls, 39931) + rc = Xsqlite3CantopenError(tls, 40346) } if rc == SQLITE_OK { nByte = int32((*(*func(*libc.TLS, uintptr, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8 /* &.pCurrent */))))(tls, zIn, zDel, (uint64(nOut - 1)))) if nByte < 0 { - rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39937), ts+2477 /* "readlink" */, zIn, 39937) + rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40352), ts+2505 /* "readlink" */, zIn, 40352) } else { if int32(*(*int8)(unsafe.Pointer(zDel))) != '/' { var n int32 for n = Xsqlite3Strlen30(tls, zIn); (n > 0) && (int32(*(*int8)(unsafe.Pointer(zIn + uintptr((n - 1))))) != '/'); n-- { } if ((nByte + n) + 1) > nOut { - rc = Xsqlite3CantopenError(tls, 39943) + rc = Xsqlite3CantopenError(tls, 40358) } else { libc.Xmemmove(tls, (zDel + uintptr(n)), zDel, (uint64(nByte + 1))) libc.Xmemcpy(tls, zDel, zIn, uint64(n)) @@ -25933,7 +25937,7 @@ type Dl_serinfo = struct { Fdls_serpath [1]Dl_serpath } /* dlfcn.h:184:3 */ -func unixDlOpen(tls *libc.TLS, NotUsed uintptr, zFilename uintptr) uintptr { /* sqlite3.c:39978:13: */ +func unixDlOpen(tls *libc.TLS, NotUsed uintptr, zFilename uintptr) uintptr { /* sqlite3.c:40393:13: */ _ = NotUsed return libc.Xdlopen(tls, zFilename, (RTLD_NOW | RTLD_GLOBAL)) } @@ -25943,7 +25947,7 @@ func unixDlOpen(tls *libc.TLS, NotUsed uintptr, zFilename uintptr) uintptr { /* // 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 *libc.TLS, NotUsed uintptr, nBuf int32, zBufOut uintptr) { /* sqlite3.c:39990:13: */ +func unixDlError(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBufOut uintptr) { /* sqlite3.c:40405:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -25952,12 +25956,12 @@ func unixDlError(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBufOut uintptr) { unixEnterMutex(tls) zErr = libc.Xdlerror(tls) if zErr != 0 { - Xsqlite3_snprintf(tls, nBuf, zBufOut, ts+2690 /* "%s" */, libc.VaList(bp, zErr)) + Xsqlite3_snprintf(tls, nBuf, zBufOut, ts+2718 /* "%s" */, libc.VaList(bp, zErr)) } unixLeaveMutex(tls) } -func unixDlSym(tls *libc.TLS, NotUsed uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:40000:13: */ +func unixDlSym(tls *libc.TLS, NotUsed uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:40415:13: */ // GCC with -pedantic-errors says that C90 does not allow a void* to be // cast into a pointer to a function. And yet the library dlsym() routine // returns a void* which is really a pointer to a function. So how do we @@ -25981,13 +25985,13 @@ func unixDlSym(tls *libc.TLS, NotUsed uintptr, p uintptr, zSym uintptr) uintptr return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&x)))(tls, p, zSym) } -func unixDlClose(tls *libc.TLS, NotUsed uintptr, pHandle uintptr) { /* sqlite3.c:40023:13: */ +func unixDlClose(tls *libc.TLS, NotUsed uintptr, pHandle uintptr) { /* sqlite3.c:40438:13: */ _ = NotUsed libc.Xdlclose(tls, pHandle) } // Write nBuf bytes of random data to the supplied buffer zBuf. -func unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:40037:12: */ +func unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:40452:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -26009,7 +26013,7 @@ func unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) in { var fd int32 var got int32 - fd = robust_open(tls, ts+2821 /* "/dev/urandom" */, O_RDONLY, uint32(0)) + fd = robust_open(tls, ts+2849 /* "/dev/urandom" */, O_RDONLY, uint32(0)) if fd < 0 { // var t Time_t at bp, 8 @@ -26022,7 +26026,7 @@ func unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) in for ok := true; ok; ok = ((got < 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == EINTR)) { got = int32((*(*func(*libc.TLS, int32, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 8*24 + 8 /* &.pCurrent */))))(tls, fd, zBuf, uint64(nBuf))) } - robust_close(tls, uintptr(0), fd, 40068) + robust_close(tls, uintptr(0), fd, 40483) } } @@ -26035,8 +26039,13 @@ func unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) in // 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 *libc.TLS, NotUsed uintptr, microseconds int32) int32 { /* sqlite3.c:40084:12: */ - libc.Xusleep(tls, uint32(microseconds)) +func unixSleep(tls *libc.TLS, NotUsed uintptr, microseconds int32) int32 { /* sqlite3.c:40499:12: */ + if microseconds >= 1000000 { + libc.Xsleep(tls, (uint32(microseconds / 1000000))) + } + if (microseconds % 1000000) != 0 { + libc.Xusleep(tls, (uint32(microseconds % 1000000))) + } _ = NotUsed return microseconds } @@ -26053,7 +26062,7 @@ func unixSleep(tls *libc.TLS, NotUsed uintptr, microseconds int32) int32 { /* sq // // On success, return SQLITE_OK. Return SQLITE_ERROR if the time and date // cannot be found. -func unixCurrentTimeInt64(tls *libc.TLS, NotUsed uintptr, piNow uintptr) int32 { /* sqlite3.c:40124:12: */ +func unixCurrentTimeInt64(tls *libc.TLS, NotUsed uintptr, piNow uintptr) int32 { /* sqlite3.c:40540:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -26067,12 +26076,12 @@ func unixCurrentTimeInt64(tls *libc.TLS, NotUsed uintptr, piNow uintptr) int32 { return rc } -var unixEpoch Sqlite3_int64 = (int64(24405875) * int64(8640000)) /* sqlite3.c:40125:30 */ +var unixEpoch Sqlite3_int64 = (int64(24405875) * int64(8640000)) /* sqlite3.c:40541:30 */ // 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 *libc.TLS, NotUsed uintptr, prNow uintptr) int32 { /* sqlite3.c:40156:12: */ +func unixCurrentTime(tls *libc.TLS, NotUsed uintptr, prNow uintptr) int32 { /* sqlite3.c:40572:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -26088,7 +26097,7 @@ func unixCurrentTime(tls *libc.TLS, NotUsed uintptr, prNow uintptr) int32 { /* s // low-level error message when operating-system problems come up // during SQLite operation. Only the integer return code is currently // used. -func unixGetLastError(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32, NotUsed3 uintptr) int32 { /* sqlite3.c:40174:12: */ +func unixGetLastError(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32, NotUsed3 uintptr) int32 { /* sqlite3.c:40590:12: */ _ = NotUsed _ = NotUsed2 _ = NotUsed3 @@ -26270,7 +26279,7 @@ func unixGetLastError(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32, NotUsed3 u // 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 *libc.TLS) int32 { /* sqlite3.c:41379:16: */ +func Xsqlite3_os_init(tls *libc.TLS) int32 { /* sqlite3.c:41795:16: */ var i uint32 // Loop counter // Double-check that the aSyscall[] array has been constructed @@ -26285,18 +26294,18 @@ func Xsqlite3_os_init(tls *libc.TLS) int32 { /* sqlite3.c:41379:16: */ } var aVfs = [4]Sqlite3_vfs{ - {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 2834 /* "unix" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, - {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 2839 /* "unix-none" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, - {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 2849 /* "unix-dotfile" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, - {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 2729 /* "unix-excl" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, -} /* sqlite3.c:41432:22 */ + {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 2862 /* "unix" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, + {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 2867 /* "unix-none" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, + {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 2877 /* "unix-dotfile" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, + {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 2757 /* "unix-excl" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, +} /* sqlite3.c:41848:22 */ // Shutdown the operating system interface. // // Some operating systems might need to do some cleanup in this routine, // to release dynamically allocated objects. But not on unix. // This routine is a no-op for unix. -func Xsqlite3_os_end(tls *libc.TLS) int32 { /* sqlite3.c:41479:16: */ +func Xsqlite3_os_end(tls *libc.TLS) int32 { /* sqlite3.c:41895:16: */ unixBigLock = uintptr(0) return SQLITE_OK } @@ -26304,7 +26313,7 @@ func Xsqlite3_os_end(tls *libc.TLS) int32 { /* sqlite3.c:41479:16: */ // 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 Xsqlite3BitvecCreate(tls *libc.TLS, iSize U32) uintptr { /* sqlite3.c:48580:23: */ +func Xsqlite3BitvecCreate(tls *libc.TLS, iSize U32) uintptr { /* sqlite3.c:49011:23: */ var p uintptr p = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Bitvec{}))) @@ -26317,7 +26326,7 @@ func Xsqlite3BitvecCreate(tls *libc.TLS, iSize U32) uintptr { /* sqlite3.c:48580 // 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 Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48595:20: */ +func Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:49026:20: */ i-- if i >= (*Bitvec)(unsafe.Pointer(p)).FiSize { @@ -26331,22 +26340,22 @@ func Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlit return 0 } } - if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM) { - return (libc.Bool32((int32(*(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / BITVEC_SZELEM))))) & (int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) != 0)) + if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM)) { + return (libc.Bool32((int32(*(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM)))))) & (int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) != 0)) } else { - var h U32 = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + var h U32 = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) for *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) != 0 { if *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) == i { return 1 } - h = (U32((uint64(h + U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + h = (U32((uint64(h + U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) } return 0 } return int32(0) } -func Xsqlite3BitvecTest(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48618:20: */ +func Xsqlite3BitvecTest(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:49049:20: */ return (libc.Bool32((p != uintptr(0)) && (Xsqlite3BitvecTestNotNull(tls, p, i) != 0))) } @@ -26360,7 +26369,7 @@ func Xsqlite3BitvecTest(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48 // 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 Xsqlite3BitvecSet(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48634:20: */ +func Xsqlite3BitvecSet(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:49065:20: */ var h U32 var bin U32 var j uint32 @@ -26375,7 +26384,7 @@ __1: i-- __2: - if !((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) > (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM)) && ((*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0)) { + if !((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) > (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM))) && ((*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0)) { goto __3 } bin = (i / (*Bitvec)(unsafe.Pointer(p)).FiDivisor) @@ -26396,21 +26405,21 @@ __4: goto __2 __3: ; - if !(uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM)) { + if !(uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM))) { goto __6 } - *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / BITVEC_SZELEM)))) |= U8((int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) + *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM))))) |= U8((int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) return SQLITE_OK __6: ; - h = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + h = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) // if there wasn't a hash collision, and this doesn't // completely fill the hash, then just add it without // worring about sub-dividing and re-hashing. if !(!(int32(*(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4))) != 0)) { goto __7 } - if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) < (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) - uint64(1))) { + if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) < (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) - uint64(1))) { goto __8 } goto bitvec_set_end @@ -26431,7 +26440,7 @@ __10: __13: ; h++ - if !(uint64(h) >= ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { + if !(uint64(h) >= ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { goto __14 } h = U32(0) @@ -26449,7 +26458,7 @@ __12: // available free spot. check to see if this is going to // make our hash too "full". bitvec_set_rehash: - if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) >= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) / uint64(2))) { + if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) >= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) / uint64(2))) { goto __15 } aiValues = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(unsafe.Sizeof([124]U32{}))) @@ -26461,11 +26470,11 @@ bitvec_set_rehash: __16: libc.Xmemcpy(tls, aiValues, p+16 /* &.u */ /* &.aHash */, uint64(unsafe.Sizeof([124]U32{}))) libc.Xmemset(tls, p+16 /* &.u */ /* &.apSub */, 0, uint64(unsafe.Sizeof([62]uintptr{}))) - (*Bitvec)(unsafe.Pointer(p)).FiDivisor = (U32(((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) + ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0))))) - uint64(1)) / ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))))) + (*Bitvec)(unsafe.Pointer(p)).FiDivisor = (U32(((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) + ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0))))) - uint64(1)) / ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))))) rc = Xsqlite3BitvecSet(tls, p, i) j = uint32(0) __18: - if !(uint64(j) < ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { + if !(uint64(j) < ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { goto __20 } if !(*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0) { @@ -26497,7 +26506,7 @@ bitvec_set_end: // // pBuf must be a pointer to at least BITVEC_SZ bytes of temporary storage // that BitvecClear can use to rebuilt its hash table. -func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) { /* sqlite3.c:48705:21: */ +func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) { /* sqlite3.c:49136:21: */ if p == uintptr(0) { return } @@ -26511,21 +26520,21 @@ func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) { /* sql return } } - if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM) { - *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / BITVEC_SZELEM)))) &= U8((^(int32(1) << (i & (U32(BITVEC_SZELEM - 1)))))) + if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM)) { + *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM))))) &= U8((^(int32(1) << (i & (U32(BITVEC_SZELEM - 1)))))) } else { var j uint32 var aiValues uintptr = pBuf libc.Xmemcpy(tls, aiValues, p+16 /* &.u */ /* &.aHash */, uint64(unsafe.Sizeof([124]U32{}))) libc.Xmemset(tls, p+16 /* &.u */ /* &.aHash */, 0, uint64(unsafe.Sizeof([124]U32{}))) (*Bitvec)(unsafe.Pointer(p)).FnSet = U32(0) - for j = uint32(0); uint64(j) < ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))); j++ { + for j = uint32(0); uint64(j) < ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))); j++ { if (*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0) && (*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != (i + U32(1))) { - var h U32 = (U32((uint64((*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) - U32(1)) * U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + var h U32 = (U32((uint64((*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) - U32(1)) * U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) (*Bitvec)(unsafe.Pointer(p)).FnSet++ for *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) != 0 { h++ - if uint64(h) >= ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) { + if uint64(h) >= ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) { h = U32(0) } } @@ -26536,13 +26545,13 @@ func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) { /* sql } // Destroy a bitmap object. Reclaim all memory used. -func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:48742:21: */ +func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:49173:21: */ if p == uintptr(0) { return } if (*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0 { var i uint32 - for i = uint32(0); uint64(i) < ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { + for i = uint32(0); uint64(i) < ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { Xsqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer((p + 16 /* &.u */ /* &.apSub */) + uintptr(i)*8))) } } @@ -26551,7 +26560,7 @@ func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:48742:21: */ // Return the value of the iSize parameter specified when Bitvec *p // was created. -func Xsqlite3BitvecSize(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:48757:20: */ +func Xsqlite3BitvecSize(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:49188:20: */ return (*Bitvec)(unsafe.Pointer(p)).FiSize } @@ -26588,7 +26597,7 @@ func Xsqlite3BitvecSize(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:48757:20: * // an error is returned. If they are the same, zero is returned. // // If a memory allocation error occurs, return -1. -func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32 { /* sqlite3.c:48802:20: */ +func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32 { /* sqlite3.c:49233:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -26609,7 +26618,7 @@ func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32 { /* // bits to act as the reference pBitvec = Xsqlite3BitvecCreate(tls, uint32(sz)) pV = Xsqlite3MallocZero(tls, (uint64(((sz + 7) / 8) + 1))) - pTmpSpace = Xsqlite3_malloc64(tls, BITVEC_SZ) + pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if !(((pBitvec == uintptr(0)) || (pV == uintptr(0))) || (pTmpSpace == uintptr(0))) { goto __1 } @@ -26751,7 +26760,7 @@ bitvec_end: // 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 *libc.TLS, pPage uintptr, addRemove U8) { /* sqlite3.c:49037:13: */ +func pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove U8) { /* sqlite3.c:49468:13: */ var p uintptr = (*PgHdr)(unsafe.Pointer(pPage)).FpCache if (int32(addRemove) & PCACHE_DIRTYLIST_REMOVE) != 0 { @@ -26813,7 +26822,7 @@ func pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove U8) { /* sqli // 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 *libc.TLS, p uintptr) { /* sqlite3.c:49107:13: */ +func pcacheUnpin(tls *libc.TLS, p uintptr) { /* sqlite3.c:49538:13: */ if (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FbPurgeable != 0 { (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 64 /* &.xUnpin */))))(tls, (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, 0) @@ -26823,7 +26832,7 @@ func pcacheUnpin(tls *libc.TLS, p uintptr) { /* sqlite3.c:49107:13: */ // Compute the number of pages of cache requested. p->szCache is the // cache size requested by the "PRAGMA cache_size" statement. -func numberOfCachePages(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:49119:12: */ +func numberOfCachePages(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:49550:12: */ if (*PCache)(unsafe.Pointer(p)).FszCache >= 0 { // IMPLEMENTATION-OF: R-42059-47211 If the argument N is positive then the // suggested cache size is set to N. @@ -26843,7 +26852,7 @@ func numberOfCachePages(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:49119:12: // // Initialize and shutdown the page cache subsystem. Neither of these // functions are threadsafe. -func Xsqlite3PcacheInitialize(tls *libc.TLS) int32 { /* sqlite3.c:49138:20: */ +func Xsqlite3PcacheInitialize(tls *libc.TLS) int32 { /* sqlite3.c:49569:20: */ if Xsqlite3Config.Fpcache2.FxInit == uintptr(0) { // IMPLEMENTATION-OF: R-26801-64137 If the xInit() method is NULL, then the // built-in default page cache is used instead of the application defined @@ -26854,7 +26863,7 @@ func Xsqlite3PcacheInitialize(tls *libc.TLS) int32 { /* sqlite3.c:49138:20: */ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 16 /* &.xInit */))))(tls, Xsqlite3Config.Fpcache2.FpArg) } -func Xsqlite3PcacheShutdown(tls *libc.TLS) { /* sqlite3.c:49148:21: */ +func Xsqlite3PcacheShutdown(tls *libc.TLS) { /* sqlite3.c:49579:21: */ if Xsqlite3Config.Fpcache2.FxShutdown != 0 { // IMPLEMENTATION-OF: R-26000-56589 The xShutdown() method may be NULL. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 24 /* &.xShutdown */))))(tls, Xsqlite3Config.Fpcache2.FpArg) @@ -26862,7 +26871,7 @@ func Xsqlite3PcacheShutdown(tls *libc.TLS) { /* sqlite3.c:49148:21: */ } // Return the size in bytes of a PCache object. -func Xsqlite3PcacheSize(tls *libc.TLS) int32 { /* sqlite3.c:49158:20: */ +func Xsqlite3PcacheSize(tls *libc.TLS) int32 { /* sqlite3.c:49589:20: */ return int32(unsafe.Sizeof(PCache{})) } @@ -26876,7 +26885,7 @@ func Xsqlite3PcacheSize(tls *libc.TLS) int32 { /* sqlite3.c:49158:20: */ // 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 Xsqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) int32 { /* sqlite3.c:49172:20: */ +func Xsqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) int32 { /* sqlite3.c:49603:20: */ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(PCache{}))) (*PCache)(unsafe.Pointer(p)).FszPage = 1 (*PCache)(unsafe.Pointer(p)).FszExtra = szExtra @@ -26893,7 +26902,7 @@ func Xsqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable i // Change the page size for PCache object. The caller must ensure that there // are no outstanding page references when this function is called. -func Xsqlite3PcacheSetPageSize(tls *libc.TLS, pCache uintptr, szPage int32) int32 { /* sqlite3.c:49198:20: */ +func Xsqlite3PcacheSetPageSize(tls *libc.TLS, pCache uintptr, szPage int32) int32 { /* sqlite3.c:49629:20: */ if (*PCache)(unsafe.Pointer(pCache)).FszPage != 0 { var pNew uintptr @@ -26936,7 +26945,7 @@ func Xsqlite3PcacheSetPageSize(tls *libc.TLS, pCache uintptr, szPage int32) int3 // 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 Xsqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno Pgno, createFlag int32) uintptr { /* sqlite3.c:49242:36: */ +func Xsqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno Pgno, createFlag int32) uintptr { /* sqlite3.c:49673:36: */ var eCreate int32 var pRes uintptr @@ -26962,7 +26971,7 @@ func Xsqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno Pgno, createFlag in // an OOM error. // // This routine should be invoked only after sqlite3PcacheFetch() fails. -func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage uintptr) int32 { /* sqlite3.c:49283:20: */ +func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage uintptr) int32 { /* sqlite3.c:49714:20: */ var pPg uintptr if int32((*PCache)(unsafe.Pointer(pCache)).FeCreate) == 2 { return 0 @@ -27009,7 +27018,7 @@ func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage // 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 *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:49339:30: */ +func pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:49770:30: */ var pPgHdr uintptr pPgHdr = (*Sqlite3_pcache_page)(unsafe.Pointer(pPage)).FpExtra @@ -27021,7 +27030,7 @@ func pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage u libc.Xmemset(tls, (*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra, 0, uint64(8)) (*PgHdr)(unsafe.Pointer(pPgHdr)).FpCache = pCache (*PgHdr)(unsafe.Pointer(pPgHdr)).Fpgno = pgno - (*PgHdr)(unsafe.Pointer(pPgHdr)).Fflags = PGHDR_CLEAN + (*PgHdr)(unsafe.Pointer(pPgHdr)).Fflags = U16(PGHDR_CLEAN) return Xsqlite3PcacheFetchFinish(tls, pCache, pgno, pPage) } @@ -27029,7 +27038,7 @@ func pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage u // sqlite3PcacheFetch() into an initialized PgHdr object. This routine // must be called after sqlite3PcacheFetch() in order to get a usable // result. -func Xsqlite3PcacheFetchFinish(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:49365:22: */ +func Xsqlite3PcacheFetchFinish(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:49796:22: */ var pPgHdr uintptr pPgHdr = (*Sqlite3_pcache_page)(unsafe.Pointer(pPage)).FpExtra @@ -27045,20 +27054,20 @@ func Xsqlite3PcacheFetchFinish(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage u // 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 Xsqlite3PcacheRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:49388:37: */ +func Xsqlite3PcacheRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:49819:37: */ (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum-- if (int32(libc.PreDecInt16(&(*PgHdr)(unsafe.Pointer(p)).FnRef, 1))) == 0 { if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_CLEAN) != 0 { pcacheUnpin(tls, p) } else { - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_FRONT) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT)) } } } // Increase the reference count of a supplied page by 1. -func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr) { /* sqlite3.c:49403:21: */ +func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr) { /* sqlite3.c:49834:21: */ (*PgHdr)(unsafe.Pointer(p)).FnRef++ (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum++ @@ -27067,10 +27076,10 @@ func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr) { /* sqlite3.c:49403:21: */ // 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 Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr) { /* sqlite3.c:49415:21: */ +func Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr) { /* sqlite3.c:49846:21: */ if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_DIRTY) != 0 { - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_REMOVE) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE)) } (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum-- (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 64 /* &.xUnpin */))))(tls, (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, 1) @@ -27078,14 +27087,14 @@ func Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr) { /* sqlite3.c:49415:21: */ // Make sure the page is marked as dirty. If it isn't dirty already, // make it so. -func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:49429:21: */ +func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:49860:21: */ if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & (PGHDR_CLEAN | PGHDR_DONT_WRITE)) != 0 { //OPTIMIZATION-IF-FALSE *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(PGHDR_DONT_WRITE))) if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_CLEAN) != 0 { *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) ^= U16((PGHDR_DIRTY | PGHDR_CLEAN)) - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_ADD) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_ADD)) } } @@ -27093,9 +27102,9 @@ func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:49429:21: // Make sure the page is marked as clean. If it isn't clean already, // make it so. -func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) { /* sqlite3.c:49448:21: */ +func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) { /* sqlite3.c:49879:21: */ - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_REMOVE) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE)) *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((PGHDR_DIRTY | PGHDR_NEED_SYNC) | PGHDR_WRITEABLE)))) *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) |= U16((PGHDR_CLEAN)) @@ -27105,7 +27114,7 @@ func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) { /* sqlite3.c:49448:21: } // Make every page in the cache clean. -func Xsqlite3PcacheCleanAll(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49465:21: */ +func Xsqlite3PcacheCleanAll(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49896:21: */ var p uintptr for (libc.AssignUintptr(&p, (*PCache)(unsafe.Pointer(pCache)).FpDirty)) != uintptr(0) { @@ -27114,7 +27123,7 @@ func Xsqlite3PcacheCleanAll(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49465: } // Clear the PGHDR_NEED_SYNC and PGHDR_WRITEABLE flag from all dirty pages. -func Xsqlite3PcacheClearWritable(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49476:21: */ +func Xsqlite3PcacheClearWritable(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49907:21: */ var p uintptr for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext { @@ -27124,7 +27133,7 @@ func Xsqlite3PcacheClearWritable(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:4 } // Clear the PGHDR_NEED_SYNC flag from all dirty pages. -func Xsqlite3PcacheClearSyncFlags(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49488:21: */ +func Xsqlite3PcacheClearSyncFlags(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49919:21: */ var p uintptr for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext { *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(PGHDR_NEED_SYNC))) @@ -27133,13 +27142,13 @@ func Xsqlite3PcacheClearSyncFlags(tls *libc.TLS, pCache uintptr) { /* sqlite3.c: } // Change the page number of page p to newPgno. -func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:49499:21: */ +func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:49930:21: */ var pCache uintptr = (*PgHdr)(unsafe.Pointer(p)).FpCache (*(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 72 /* &.xRekey */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, (*PgHdr)(unsafe.Pointer(p)).Fpgno, newPgno) (*PgHdr)(unsafe.Pointer(p)).Fpgno = newPgno if ((int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_DIRTY) != 0) && ((int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_NEED_SYNC) != 0) { - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_FRONT) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT)) } } @@ -27150,7 +27159,7 @@ func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:4 // 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 Xsqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno Pgno) { /* sqlite3.c:49521:21: */ +func Xsqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno Pgno) { /* sqlite3.c:49952:21: */ if (*PCache)(unsafe.Pointer(pCache)).FpCache != 0 { var p uintptr var pNext uintptr @@ -27180,19 +27189,19 @@ func Xsqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno Pgno) { /* sqlit } // Close a cache. -func Xsqlite3PcacheClose(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49554:21: */ +func Xsqlite3PcacheClose(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49985:21: */ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 88 /* &.xDestroy */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache) } // Discard the contents of the cache. -func Xsqlite3PcacheClear(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49563:21: */ +func Xsqlite3PcacheClear(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49994:21: */ Xsqlite3PcacheTruncate(tls, pCache, uint32(0)) } // Merge two lists of pages connected by pDirty and in pgno order. // Do not bother fixing the pDirtyPrev pointers. -func pcacheMergeDirtyList(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:49571:14: */ +func pcacheMergeDirtyList(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:50002:14: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -27231,7 +27240,7 @@ func pcacheMergeDirtyList(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sq // there cannot be more than 31 buckets required by the merge sorter. // One extra bucket is added to catch overflow in case something // ever changes to make the previous sentence incorrect. -func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:49608:14: */ +func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:50039:14: */ bp := tls.Alloc(256) defer tls.Free(256) @@ -27274,7 +27283,7 @@ func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:4960 } // Return a list of all dirty pages in the cache, sorted by page number. -func Xsqlite3PcacheDirtyList(tls *libc.TLS, pCache uintptr) uintptr { /* sqlite3.c:49643:22: */ +func Xsqlite3PcacheDirtyList(tls *libc.TLS, pCache uintptr) uintptr { /* sqlite3.c:50074:22: */ var p uintptr for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext { (*PgHdr)(unsafe.Pointer(p)).FpDirty = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext @@ -27286,23 +27295,23 @@ func Xsqlite3PcacheDirtyList(tls *libc.TLS, pCache uintptr) uintptr { /* sqlite3 // // This is not the total number of pages referenced, but the sum of the // reference count for all pages. -func Xsqlite3PcacheRefCount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:49657:20: */ +func Xsqlite3PcacheRefCount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50088:20: */ return (*PCache)(unsafe.Pointer(pCache)).FnRefSum } // Return the number of references to the page supplied as an argument. -func Xsqlite3PcachePageRefcount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:49664:20: */ +func Xsqlite3PcachePageRefcount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50095:20: */ return int32((*PgHdr)(unsafe.Pointer(p)).FnRef) } // Return the total number of pages in the cache. -func Xsqlite3PcachePagecount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:49671:20: */ +func Xsqlite3PcachePagecount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50102:20: */ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 48 /* &.xPagecount */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache) } // Set the suggested cache-size value. -func Xsqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32) { /* sqlite3.c:49688:21: */ +func Xsqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32) { /* sqlite3.c:50119:21: */ (*PCache)(unsafe.Pointer(pCache)).FszCache = mxPage (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 40 /* &.xCachesize */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, @@ -27312,7 +27321,7 @@ func Xsqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32) { / // 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 Xsqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:49700:20: */ +func Xsqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:50131:20: */ var res int32 if mxPage != 0 { @@ -27329,20 +27338,20 @@ func Xsqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) int32 { } // Free up as much memory as possible from the page cache. -func Xsqlite3PcacheShrink(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49717:21: */ +func Xsqlite3PcacheShrink(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50148:21: */ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 96 /* &.xShrink */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache) } // Return the size of the header added by this middleware layer // in the page-cache hierarchy. -func Xsqlite3HeaderSizePcache(tls *libc.TLS) int32 { /* sqlite3.c:49726:20: */ +func Xsqlite3HeaderSizePcache(tls *libc.TLS) int32 { /* sqlite3.c:50157:20: */ return (int32(((uint64(unsafe.Sizeof(PgHdr{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) } // Return the number of dirty pages currently in the cache, as a percentage // of the configured cache size. -func Xsqlite3PCachePercentDirty(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:49732:20: */ +func Xsqlite3PCachePercentDirty(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50163:20: */ var pDirty uintptr var nDirty int32 = 0 var nCache int32 = numberOfCachePages(tls, pCache) @@ -27457,7 +27466,7 @@ type PCache11 = struct { FapHash uintptr FpFree uintptr FpBulk uintptr -} /* sqlite3.c:49849:9 */ +} /* sqlite3.c:50280:9 */ //************* End of pcache.c ********************************************* //************* Begin file pcache1.c **************************************** @@ -27543,7 +27552,7 @@ type PCache11 = struct { // common workloads. // #include "sqliteInt.h" -type PCache1 = PCache11 /* sqlite3.c:49849:24 */ +type PCache1 = PCache11 /* sqlite3.c:50280:24 */ type PgHdr11 = struct { Fpage Sqlite3_pcache_page FiKey uint32 @@ -27553,12 +27562,12 @@ type PgHdr11 = struct { FpCache uintptr FpLruNext uintptr FpLruPrev uintptr -} /* sqlite3.c:49849:9 */ +} /* sqlite3.c:50280:9 */ -type PgHdr1 = PgHdr11 /* sqlite3.c:49850:23 */ -type PgFreeslot1 = struct{ FpNext uintptr } /* sqlite3.c:49851:9 */ +type PgHdr1 = PgHdr11 /* sqlite3.c:50281:23 */ +type PgFreeslot1 = struct{ FpNext uintptr } /* sqlite3.c:50282:9 */ -type PgFreeslot = PgFreeslot1 /* sqlite3.c:49851:27 */ +type PgFreeslot = PgFreeslot1 /* sqlite3.c:50282:27 */ type PGroup1 = struct { Fmutex uintptr FnMaxPage uint32 @@ -27566,9 +27575,9 @@ type PGroup1 = struct { FmxPinned uint32 FnPurgeable uint32 Flru PgHdr1 -} /* sqlite3.c:49849:9 */ +} /* sqlite3.c:50280:9 */ -type PGroup = PGroup1 /* sqlite3.c:49852:23 */ +type PGroup = PGroup1 /* sqlite3.c:50283:23 */ // Global data used by this cache. type PCacheGlobal = struct { @@ -27585,10 +27594,10 @@ type PCacheGlobal = struct { FpFree uintptr FnFreeSlot int32 FbUnderPressure int32 -} /* sqlite3.c:49969:19 */ +} /* sqlite3.c:50400:19 */ // Global data used by this cache. -var pcache1_g PCacheGlobal /* sqlite3.c:49993:3: */ +var pcache1_g PCacheGlobal /* sqlite3.c:50424:3: */ // All code in this file should access the global structure above via the // alias "pcache1". This ensures that the WSD emulation is used when @@ -27606,7 +27615,7 @@ var pcache1_g PCacheGlobal /* sqlite3.c:49993:3: */ // // This routine is called from sqlite3_initialize() and so it is guaranteed // to be serialized already. There is no need for further mutexing. -func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { /* sqlite3.c:50028:21: */ +func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { /* sqlite3.c:50459:21: */ if pcache1_g.FisInit != 0 { var p uintptr if pBuf == uintptr(0) { @@ -27639,7 +27648,7 @@ func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { // 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 *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50054:12: */ +func pcache1InitBulk(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50485:12: */ var szBulk I64 var zBulk uintptr if pcache1_g.FnInitPage == 0 { @@ -27684,7 +27693,7 @@ func pcache1InitBulk(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50054:1 // // Multiple threads can run this routine at the same time. Global variables // in pcache1 need to be protected via mutex. -func pcache1Alloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:50097:13: */ +func pcache1Alloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:50528:13: */ var p uintptr = uintptr(0) if nByte <= pcache1_g.FszSlot { @@ -27717,7 +27726,7 @@ func pcache1Alloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:50097:13: * } // Free an allocated buffer obtained from pcache1Alloc(). -func pcache1Free(tls *libc.TLS, p uintptr) { /* sqlite3.c:50135:13: */ +func pcache1Free(tls *libc.TLS, p uintptr) { /* sqlite3.c:50566:13: */ if p == uintptr(0) { return } @@ -27747,7 +27756,7 @@ func pcache1Free(tls *libc.TLS, p uintptr) { /* sqlite3.c:50135:13: */ } // Return the size of a pcache allocation -func pcache1MemSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50168:12: */ +func pcache1MemSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50599:12: */ if (p >= pcache1_g.FpStart) && (p < pcache1_g.FpEnd) { return pcache1_g.FszSlot } else { @@ -27761,7 +27770,7 @@ func pcache1MemSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50168:12: */ } // Allocate a new page object initially associated with cache pCache. -func pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) uintptr { /* sqlite3.c:50185:15: */ +func pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) uintptr { /* sqlite3.c:50616:15: */ var p uintptr = uintptr(0) var pPg uintptr @@ -27792,13 +27801,14 @@ func pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) uintptr (*PgHdr1)(unsafe.Pointer(p)).Fpage.FpExtra = (p + 1*56) (*PgHdr1)(unsafe.Pointer(p)).FisBulkLocal = U16(0) (*PgHdr1)(unsafe.Pointer(p)).FisAnchor = U16(0) + (*PgHdr1)(unsafe.Pointer(p)).FpLruPrev = uintptr(0) // Initializing this saves a valgrind error } (*(*uint32)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable)))++ return p } // Free a page object allocated by pcache1AllocPage(). -func pcache1FreePage(tls *libc.TLS, p uintptr) { /* sqlite3.c:50236:13: */ +func pcache1FreePage(tls *libc.TLS, p uintptr) { /* sqlite3.c:50668:13: */ var pCache uintptr pCache = (*PgHdr1)(unsafe.Pointer(p)).FpCache @@ -27815,13 +27825,13 @@ func pcache1FreePage(tls *libc.TLS, p uintptr) { /* sqlite3.c:50236:13: */ // 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 Xsqlite3PageMalloc(tls *libc.TLS, sz int32) uintptr { /* sqlite3.c:50258:21: */ +func Xsqlite3PageMalloc(tls *libc.TLS, sz int32) uintptr { /* sqlite3.c:50690:21: */ // These allocations are never very large return pcache1Alloc(tls, sz) } // Free an allocated buffer obtained from sqlite3PageMalloc(). -func Xsqlite3PageFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:50266:21: */ +func Xsqlite3PageFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:50698:21: */ pcache1Free(tls, p) } @@ -27839,7 +27849,7 @@ func Xsqlite3PageFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:50266:21: */ // 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 *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50287:12: */ +func pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50719:12: */ if (pcache1_g.FnSlot != 0) && (((*PCache1)(unsafe.Pointer(pCache)).FszPage + (*PCache1)(unsafe.Pointer(pCache)).FszExtra) <= pcache1_g.FszSlot) { return pcache1_g.FbUnderPressure } else { @@ -27855,7 +27865,7 @@ func pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) int32 { /* sqlite // as the first argument. // // The PCache mutex must be held when this function is called. -func pcache1ResizeHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:50304:13: */ +func pcache1ResizeHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:50736:13: */ var apNew uintptr var nNew uint32 var i uint32 @@ -27896,7 +27906,7 @@ func pcache1ResizeHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:50304:13: */ // LRU list, then this function is a no-op. // // The PGroup mutex must be held when this function is called. -func pcache1PinPage(tls *libc.TLS, pPage uintptr) uintptr { /* sqlite3.c:50345:15: */ +func pcache1PinPage(tls *libc.TLS, pPage uintptr) uintptr { /* sqlite3.c:50777:15: */ (*PgHdr1)(unsafe.Pointer((*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev)).FpLruNext = (*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext (*PgHdr1)(unsafe.Pointer((*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext)).FpLruPrev = (*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev @@ -27913,7 +27923,7 @@ func pcache1PinPage(tls *libc.TLS, pPage uintptr) uintptr { /* sqlite3.c:50345:1 // Also free the page if freePage is true. // // The PGroup mutex must be held when this function is called. -func pcache1RemoveFromHash(tls *libc.TLS, pPage uintptr, freeFlag int32) { /* sqlite3.c:50370:13: */ +func pcache1RemoveFromHash(tls *libc.TLS, pPage uintptr, freeFlag int32) { /* sqlite3.c:50802:13: */ var h uint32 var pCache uintptr = (*PgHdr1)(unsafe.Pointer(pPage)).FpCache var pp uintptr @@ -27931,7 +27941,7 @@ func pcache1RemoveFromHash(tls *libc.TLS, pPage uintptr, freeFlag int32) { /* sq // If there are currently more than nMaxPage pages allocated, try // to recycle pages to reduce the number allocated to nMaxPage. -func pcache1EnforceMaxPage(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50388:13: */ +func pcache1EnforceMaxPage(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50820:13: */ var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup var p uintptr @@ -27952,7 +27962,7 @@ func pcache1EnforceMaxPage(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50388:1 // criteria are unpinned before they are discarded. // // The PCache mutex must be held when this function is called. -func pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { /* sqlite3.c:50413:13: */ +func pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { /* sqlite3.c:50845:13: */ var h uint32 var iStop uint32 @@ -28000,7 +28010,7 @@ func pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { /* sq //******* sqlite3_pcache Methods ********************************************* // Implementation of the sqlite3_pcache.xInit method. -func pcache1Init(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:50464:12: */ +func pcache1Init(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:50896:12: */ _ = NotUsed libc.Xmemset(tls, uintptr(unsafe.Pointer(&pcache1_g)), 0, uint64(unsafe.Sizeof(pcache1_g))) @@ -28038,7 +28048,7 @@ func pcache1Init(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:50464: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 *libc.TLS, NotUsed uintptr) { /* sqlite3.c:50517:13: */ +func pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:50949:13: */ _ = NotUsed libc.Xmemset(tls, uintptr(unsafe.Pointer(&pcache1_g)), 0, uint64(unsafe.Sizeof(pcache1_g))) @@ -28047,7 +28057,7 @@ func pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:50517:13: */ // Implementation of the sqlite3_pcache.xCreate method. // // Allocate a new cache. -func pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) uintptr { /* sqlite3.c:50531:23: */ +func pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) uintptr { /* sqlite3.c:50963:23: */ var pCache uintptr // The newly created page cache var pGroup uintptr // The group the new page cache will belong to var sz int32 // Bytes of memory required to allocate the new cache @@ -28097,7 +28107,7 @@ func pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) // Implementation of the sqlite3_pcache.xCachesize method. // // Configure the cache_size limit for a cache. -func pcache1Cachesize(tls *libc.TLS, p uintptr, nMax int32) { /* sqlite3.c:50581:13: */ +func pcache1Cachesize(tls *libc.TLS, p uintptr, nMax int32) { /* sqlite3.c:51013:13: */ var pCache uintptr = p if (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 { var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup @@ -28114,7 +28124,7 @@ func pcache1Cachesize(tls *libc.TLS, p uintptr, nMax int32) { /* sqlite3.c:50581 // Implementation of the sqlite3_pcache.xShrink method. // // Free up as much memory as possible. -func pcache1Shrink(tls *libc.TLS, p uintptr) { /* sqlite3.c:50600:13: */ +func pcache1Shrink(tls *libc.TLS, p uintptr) { /* sqlite3.c:51032:13: */ var pCache uintptr = p if (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 { var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup @@ -28129,7 +28139,7 @@ func pcache1Shrink(tls *libc.TLS, p uintptr) { /* sqlite3.c:50600:13: */ } // Implementation of the sqlite3_pcache.xPagecount method. -func pcache1Pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50617:12: */ +func pcache1Pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:51049:12: */ var n int32 var pCache uintptr = p Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex) @@ -28144,7 +28154,7 @@ func pcache1Pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50617:12: * // 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 *libc.TLS, pCache uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50635:31: */ +func pcache1FetchStage2(tls *libc.TLS, pCache uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51067:31: */ var nPinned uint32 var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup var pPage uintptr = uintptr(0) @@ -28262,7 +28272,7 @@ func pcache1FetchStage2(tls *libc.TLS, pCache uintptr, iKey uint32, createFlag i // 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 *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50763:15: */ +func pcache1FetchNoMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51195:15: */ var pCache uintptr = p var pPage uintptr = uintptr(0) @@ -28291,7 +28301,7 @@ func pcache1FetchNoMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32 return uintptr(0) } -func pcache1FetchWithMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50793:15: */ +func pcache1FetchWithMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51225:15: */ var pCache uintptr = p var pPage uintptr @@ -28302,7 +28312,7 @@ func pcache1FetchWithMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int return pPage } -func pcache1Fetch(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50808:28: */ +func pcache1Fetch(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51240:28: */ var pCache uintptr = p if (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex != 0 { @@ -28316,7 +28326,7 @@ func pcache1Fetch(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintp // Implementation of the sqlite3_pcache.xUnpin method. // // Mark a page as unpinned (eligible for asynchronous recycling). -func pcache1Unpin(tls *libc.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) { /* sqlite3.c:50839:13: */ +func pcache1Unpin(tls *libc.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) { /* sqlite3.c:51271:13: */ var pCache uintptr = p var pPage uintptr = pPg var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup @@ -28341,7 +28351,7 @@ func pcache1Unpin(tls *libc.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) { } // Implementation of the sqlite3_pcache.xRekey method. -func pcache1Rekey(tls *libc.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint32) { /* sqlite3.c:50874:13: */ +func pcache1Rekey(tls *libc.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint32) { /* sqlite3.c:51306:13: */ var pCache uintptr = p var pPage uintptr = pPg var pp uintptr @@ -28372,7 +28382,7 @@ func pcache1Rekey(tls *libc.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint3 // 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 *libc.TLS, p uintptr, iLimit uint32) { /* sqlite3.c:50914:13: */ +func pcache1Truncate(tls *libc.TLS, p uintptr, iLimit uint32) { /* sqlite3.c:51346:13: */ var pCache uintptr = p Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex) if iLimit <= (*PCache1)(unsafe.Pointer(pCache)).FiMaxKey { @@ -28385,7 +28395,7 @@ func pcache1Truncate(tls *libc.TLS, p uintptr, iLimit uint32) { /* sqlite3.c:509 // Implementation of the sqlite3_pcache.xDestroy method. // // Destroy a cache allocated using pcache1Create(). -func pcache1Destroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:50929:13: */ +func pcache1Destroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:51361:13: */ var pCache uintptr = p var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup @@ -28408,7 +28418,7 @@ func pcache1Destroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:50929:13: */ // 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 Xsqlite3PCacheSetDefault(tls *libc.TLS) { /* sqlite3.c:50952:21: */ +func Xsqlite3PCacheSetDefault(tls *libc.TLS) { /* sqlite3.c:51384:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -28428,16 +28438,16 @@ var defaultMethods1 = Sqlite3_pcache_methods2{ FxTruncate: 0, // xTruncate FxDestroy: 0, // xDestroy FxShrink: 0, // xShrink -} /* sqlite3.c:50953:40 */ +} /* sqlite3.c:51385:40 */ // Return the size of the header on each page of this PCACHE implementation. -func Xsqlite3HeaderSizePcache1(tls *libc.TLS) int32 { /* sqlite3.c:50974:20: */ +func Xsqlite3HeaderSizePcache1(tls *libc.TLS) int32 { /* sqlite3.c:51406:20: */ return (int32(((uint64(unsafe.Sizeof(PgHdr1{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) } // Return the global mutex used by this PCACHE implementation. The // sqlite3_status() routine needs access to this mutex. -func Xsqlite3Pcache1Mutex(tls *libc.TLS) uintptr { /* sqlite3.c:50980:30: */ +func Xsqlite3Pcache1Mutex(tls *libc.TLS) uintptr { /* sqlite3.c:51412:30: */ return pcache1_g.Fmutex } @@ -28448,7 +28458,7 @@ func Xsqlite3Pcache1Mutex(tls *libc.TLS) uintptr { /* sqlite3.c:50980:30: */ // nReq is the number of bytes of memory required. Once this much has // been released, the function returns. The return value is the total number // of bytes of memory released. -func Xsqlite3PcacheReleaseMemory(tls *libc.TLS, nReq int32) int32 { /* sqlite3.c:50994:20: */ +func Xsqlite3PcacheReleaseMemory(tls *libc.TLS, nReq int32) int32 { /* sqlite3.c:51426:20: */ var nFree int32 = 0 if Xsqlite3Config.FpPage == uintptr(0) { @@ -28546,7 +28556,7 @@ type RowSetEntry = struct { Fv I64 FpRight uintptr FpLeft uintptr -} /* sqlite3.c:14686:9 */ +} /* sqlite3.c:14807:9 */ // RowSetEntry objects are allocated in large chunks (instances of the // following structure) to reduce memory allocation overhead. The @@ -28559,13 +28569,13 @@ type RowSetChunk = struct { FpRight uintptr FpLeft uintptr } -} /* sqlite3.c:14686:9 */ +} /* sqlite3.c:14807:9 */ // Allowed values for RowSet.rsFlags // Allocate a RowSet object. Return NULL if a memory allocation // error occurs. -func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:51174:23: */ +func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:51606:23: */ var p uintptr = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(RowSet{}))) if p != 0 { var N int32 = Xsqlite3DbMallocSize(tls, db, p) @@ -28576,7 +28586,7 @@ func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:51174: (*RowSet)(unsafe.Pointer(p)).FpForest = uintptr(0) (*RowSet)(unsafe.Pointer(p)).FpFresh = (uintptr((((uint64(unsafe.Sizeof(RowSet{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) + p) (*RowSet)(unsafe.Pointer(p)).FnFresh = (U16((uint64(N) - (((uint64(unsafe.Sizeof(RowSet{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) / uint64(unsafe.Sizeof(RowSetEntry{})))) - (*RowSet)(unsafe.Pointer(p)).FrsFlags = ROWSET_SORTED + (*RowSet)(unsafe.Pointer(p)).FrsFlags = U16(ROWSET_SORTED) (*RowSet)(unsafe.Pointer(p)).FiBatch = 0 } return p @@ -28585,7 +28595,7 @@ func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:51174: // 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 Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51196:21: */ +func Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51628:21: */ var p uintptr = pArg var pChunk uintptr var pNextChunk uintptr @@ -28598,13 +28608,13 @@ func Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51196:21: * (*RowSet)(unsafe.Pointer(p)).FpEntry = uintptr(0) (*RowSet)(unsafe.Pointer(p)).FpLast = uintptr(0) (*RowSet)(unsafe.Pointer(p)).FpForest = uintptr(0) - (*RowSet)(unsafe.Pointer(p)).FrsFlags = ROWSET_SORTED + (*RowSet)(unsafe.Pointer(p)).FrsFlags = U16(ROWSET_SORTED) } // 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 Xsqlite3RowSetDelete(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51216:21: */ +func Xsqlite3RowSetDelete(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51648:21: */ Xsqlite3RowSetClear(tls, pArg) Xsqlite3DbFree(tls, (*RowSet)(unsafe.Pointer(pArg)).Fdb, pArg) } @@ -28615,7 +28625,7 @@ func Xsqlite3RowSetDelete(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51216:21: // // In an OOM situation, the RowSet.db->mallocFailed flag is set and this // routine returns NULL. -func rowSetEntryAlloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:51229:27: */ +func rowSetEntryAlloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:51661:27: */ if int32((*RowSet)(unsafe.Pointer(p)).FnFresh) == 0 { //OPTIMIZATION-IF-FALSE // We could allocate a fresh RowSetEntry each time one is needed, but it @@ -28638,7 +28648,7 @@ func rowSetEntryAlloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:51229:27: // // The mallocFailed flag of the database connection is set if a // memory allocation fails. -func Xsqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid I64) { /* sqlite3.c:51254:21: */ +func Xsqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid I64) { /* sqlite3.c:51686:21: */ var pEntry uintptr // The new entry var pLast uintptr // The last prior entry @@ -28668,7 +28678,7 @@ func Xsqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid I64) { /* sqlite3.c:51 // // The input lists are connected via pRight pointers and are // assumed to each already be in sorted order. -func rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:51285:27: */ +func rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:51717:27: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -28703,7 +28713,7 @@ func rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite // Sort all elements on the list of RowSetEntry objects into order of // increasing v. -func rowSetEntrySort(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:51320:27: */ +func rowSetEntrySort(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:51752:27: */ bp := tls.Alloc(320) defer tls.Free(320) @@ -28739,7 +28749,7 @@ func rowSetEntrySort(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:51320:27 // 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 *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintptr) { /* sqlite3.c:51349:13: */ +func rowSetTreeToList(tls *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintptr) { /* sqlite3.c:51781:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -28770,7 +28780,7 @@ func rowSetTreeToList(tls *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintpt // and leave *ppList set to NULL. // // Return a pointer to the root of the constructed binary tree. -func rowSetNDeepTree(tls *libc.TLS, ppList uintptr, iDepth int32) uintptr { /* sqlite3.c:51384:27: */ +func rowSetNDeepTree(tls *libc.TLS, ppList uintptr, iDepth int32) uintptr { /* sqlite3.c:51816:27: */ var p uintptr // Root of the new tree var pLeft uintptr // Left subtree if *(*uintptr)(unsafe.Pointer(ppList)) == uintptr(0) { //OPTIMIZATION-IF-TRUE @@ -28801,7 +28811,7 @@ func rowSetNDeepTree(tls *libc.TLS, ppList uintptr, iDepth int32) uintptr { /* s // 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 *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:51420:27: */ +func rowSetListToTree(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:51852:27: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = pList @@ -28834,7 +28844,7 @@ func rowSetListToTree(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:51420 // 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 Xsqlite3RowSetNext(tls *libc.TLS, p uintptr, pRowid uintptr) int32 { /* sqlite3.c:51452:20: */ +func Xsqlite3RowSetNext(tls *libc.TLS, p uintptr, pRowid uintptr) int32 { /* sqlite3.c:51884:20: */ // Cannot be used with sqlite3RowSetText() @@ -28867,7 +28877,7 @@ func Xsqlite3RowSetNext(tls *libc.TLS, p uintptr, pRowid uintptr) int32 { /* sql // 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 Xsqlite3RowSetTest(tls *libc.TLS, pRowSet uintptr, iBatch int32, iRowid Sqlite3_int64) int32 { /* sqlite3.c:51486:20: */ +func Xsqlite3RowSetTest(tls *libc.TLS, pRowSet uintptr, iBatch int32, iRowid Sqlite3_int64) int32 { /* sqlite3.c:51918:20: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -29006,7 +29016,7 @@ type Wal1 = struct { FnCkpt U32 _ [4]byte FpSnapshot uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ //************* End of rowset.c ********************************************* //************* Begin file pager.c ****************************************** @@ -29052,7 +29062,7 @@ type Wal1 = struct { // Connection to a write-ahead log (WAL) file. // There is one object of this type for each pager. -type Wal = Wal1 /* sqlite3.c:51628:20 */ +type Wal = Wal1 /* sqlite3.c:52060:20 */ //************* End of wal.h ************************************************ //************* Continuing where we left off in pager.c ********************* @@ -29433,13 +29443,15 @@ type Wal = Wal1 /* sqlite3.c:51628:20 */ // journal before the journal-header. This is required during savepoint // rollback (see pagerPlaybackSavepoint()). type PagerSavepoint1 = struct { - FiOffset I64 - FiHdrOffset I64 - FpInSavepoint uintptr - FnOrig Pgno - FiSubRec Pgno - FaWalData [4]U32 -} /* sqlite3.c:1297:9 */ + FiOffset I64 + FiHdrOffset I64 + FpInSavepoint uintptr + FnOrig Pgno + FiSubRec Pgno + FbTruncateOnRelease int32 + FaWalData [4]U32 + _ [4]byte +} /* sqlite3.c:1312:9 */ //************* End of wal.h ************************************************ //************* Continuing where we left off in pager.c ********************* @@ -29819,7 +29831,7 @@ type PagerSavepoint1 = struct { // immediately following the last journal record written into the main // journal before the journal-header. This is required during savepoint // rollback (see pagerPlaybackSavepoint()). -type PagerSavepoint = PagerSavepoint1 /* sqlite3.c:52139:31 */ +type PagerSavepoint = PagerSavepoint1 /* sqlite3.c:52571:31 */ // Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains // the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -29852,11 +29864,11 @@ type PagerSavepoint = PagerSavepoint1 /* sqlite3.c:52139:31 */ // is different for every journal, we minimize that risk. var aJournalMagic = [8]uint8{ uint8(0xd9), uint8(0xd5), uint8(0x05), uint8(0xf9), uint8(0x20), uint8(0xa1), uint8(0x63), uint8(0xd7), -} /* sqlite3.c:52459:28 */ +} /* sqlite3.c:52892:28 */ // Set the Pager.xGet method for the appropriate routine used to fetch // content from the pager. -func setGetterMethod(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:52752:13: */ +func setGetterMethod(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53185:13: */ if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 { (*Pager)(unsafe.Pointer(pPager)).FxGet = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32 @@ -29879,14 +29891,17 @@ func setGetterMethod(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:52752:13: */ // * 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 *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:52773:12: */ +func subjRequiresPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:53206:12: */ var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager var p uintptr var pgno Pgno = (*PgHdr)(unsafe.Pointer(pPg)).Fpgno var i int32 for i = 0; i < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; i++ { - p = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(i)*48) + p = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(i)*56) if ((*PagerSavepoint)(unsafe.Pointer(p)).FnOrig >= pgno) && (0 == Xsqlite3BitvecTestNotNull(tls, (*PagerSavepoint)(unsafe.Pointer(p)).FpInSavepoint, pgno)) { + for i = (i + 1); i < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; i++ { + (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(i)*56)).FbTruncateOnRelease = 0 + } return 1 } } @@ -29898,7 +29913,7 @@ func subjRequiresPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:52773:12: // error code is something goes wrong. // // All values are stored on disk as big-endian. -func read32bits(tls *libc.TLS, fd uintptr, offset I64, pRes uintptr) int32 { /* sqlite3.c:52803:12: */ +func read32bits(tls *libc.TLS, fd uintptr, offset I64, pRes uintptr) int32 { /* sqlite3.c:53239:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -29915,7 +29930,7 @@ func read32bits(tls *libc.TLS, fd uintptr, offset I64, pRes uintptr) int32 { /* // 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 *libc.TLS, fd uintptr, offset I64, val U32) int32 { /* sqlite3.c:52822:12: */ +func write32bits(tls *libc.TLS, fd uintptr, offset I64, val U32) int32 { /* sqlite3.c:53258:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -29932,7 +29947,7 @@ func write32bits(tls *libc.TLS, fd uintptr, offset I64, val U32) int32 { /* sqli // 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 *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:52837:12: */ +func pagerUnlockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:53273:12: */ var rc int32 = SQLITE_OK if (*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0) { @@ -29959,7 +29974,7 @@ func pagerUnlockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite // 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 *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:52865:12: */ +func pagerLockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:53301:12: */ var rc int32 = SQLITE_OK if (int32((*Pager)(unsafe.Pointer(pPager)).FeLock) < eLock) || (int32((*Pager)(unsafe.Pointer(pPager)).FeLock) == (EXCLUSIVE_LOCK + 1)) { @@ -29993,7 +30008,7 @@ func pagerLockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3. // returned in this case. // // If neither optimization can be used, 0 is returned. -func jrnlBufferSize(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:52898:12: */ +func jrnlBufferSize(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53334:12: */ _ = pPager @@ -30027,7 +30042,7 @@ func jrnlBufferSize(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:52898:12 // // If an error occurs while reading from the journal file, an SQLite // error code is returned. -func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32) int32 { /* sqlite3.c:53003:12: */ +func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32) int32 { /* sqlite3.c:53439:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -30086,7 +30101,7 @@ func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32) // 100 512 // 2000 2048 // -func journalHdrOffset(tls *libc.TLS, pPager uintptr) I64 { /* sqlite3.c:53059:12: */ +func journalHdrOffset(tls *libc.TLS, pPager uintptr) I64 { /* sqlite3.c:53495:12: */ var offset I64 = int64(0) var c I64 = (*Pager)(unsafe.Pointer(pPager)).FjournalOff if c != 0 { @@ -30115,7 +30130,7 @@ func journalHdrOffset(tls *libc.TLS, pPager uintptr) I64 { /* sqlite3.c:53059:12 // // If an IO error occurs, abandon processing and return the IO error code. // Otherwise, return SQLITE_OK. -func zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) int32 { /* sqlite3.c:53092:12: */ +func zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) int32 { /* sqlite3.c:53528:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -30150,7 +30165,7 @@ func zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) int32 { /* return rc } -var zeroHdr = [28]int8{0: int8(0)} /* sqlite3.c:53103:25 */ +var zeroHdr = [28]int8{0: int8(0)} /* sqlite3.c:53539:25 */ // 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 @@ -30165,7 +30180,7 @@ var zeroHdr = [28]int8{0: int8(0)} /* sqlite3.c:53103:25 */ // - 4 bytes: Database page size. // // Followed by (JOURNAL_HDR_SZ - 28) bytes of unused space. -func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53142:12: */ +func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53578:12: */ var rc int32 = SQLITE_OK // Return code var zHeader uintptr = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace // Temporary space used to build header var nHeader U32 = U32((*Pager)(unsafe.Pointer(pPager)).FpageSize) // Size of buffer pointed to by zHeader @@ -30182,8 +30197,8 @@ func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53142:1 // since the most recent journal header was written, update the // PagerSavepoint.iHdrOffset fields now. for ii = 0; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ { - if (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*48)).FiHdrOffset == int64(0) { - (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(ii)*48)).FiHdrOffset = (*Pager)(unsafe.Pointer(pPager)).FjournalOff + if (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*56)).FiHdrOffset == int64(0) { + (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(ii)*56)).FiHdrOffset = (*Pager)(unsafe.Pointer(pPager)).FjournalOff } } @@ -30275,7 +30290,7 @@ func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53142:1 // 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 *libc.TLS, pPager uintptr, isHot int32, journalSize I64, pNRec uintptr, pDbSize uintptr) int32 { /* sqlite3.c:53260:12: */ +func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64, pNRec uintptr, pDbSize uintptr) int32 { /* sqlite3.c:53696:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -30342,7 +30357,7 @@ func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64, // of two greater than or equal to 512 or 32, and not greater than their // respective compile time maximum limits. if (((((*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) < U32(512)) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) < U32(32))) || - (*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) > SQLITE_MAX_PAGE_SIZE)) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) > MAX_SECTOR_SIZE)) || + (*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) > U32(SQLITE_MAX_PAGE_SIZE))) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) > U32(MAX_SECTOR_SIZE))) || (((*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) - U32(1)) & *(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */))) != U32(0))) || (((*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) - U32(1)) & *(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */))) != U32(0)) { // If the either the page-size or sector-size in the journal-header is // invalid, then the process that wrote the journal-header must have @@ -30385,7 +30400,7 @@ func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64, // // If zSuper is a NULL pointer (occurs for a single database transaction), // this call is a no-op. -func writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:53385:12: */ +func writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:53821:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -30445,24 +30460,24 @@ func writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* } // Discard the entire contents of the in-memory page-cache. -func pager_reset(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53453:13: */ +func pager_reset(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53889:13: */ (*Pager)(unsafe.Pointer(pPager)).FiDataVersion++ Xsqlite3BackupRestart(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup) Xsqlite3PcacheClear(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) } // Return the pPager->iDataVersion value -func Xsqlite3PagerDataVersion(tls *libc.TLS, pPager uintptr) U32 { /* sqlite3.c:53462:20: */ +func Xsqlite3PagerDataVersion(tls *libc.TLS, pPager uintptr) U32 { /* sqlite3.c:53898:20: */ return (*Pager)(unsafe.Pointer(pPager)).FiDataVersion } // 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 *libc.TLS, pPager uintptr) { /* sqlite3.c:53471:13: */ +func releaseAllSavepoints(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53907:13: */ var ii int32 // Iterator for looping through Pager.aSavepoint for ii = 0; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ { - Xsqlite3BitvecDestroy(tls, (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*48)).FpInSavepoint) + Xsqlite3BitvecDestroy(tls, (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*56)).FpInSavepoint) } if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) || (Xsqlite3JournalIsInMemory(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd) != 0) { Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd) @@ -30476,12 +30491,12 @@ func releaseAllSavepoints(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53471:13 // 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 *libc.TLS, pPager uintptr, pgno Pgno) int32 { /* sqlite3.c:53490:12: */ +func addToSavepointBitvecs(tls *libc.TLS, pPager uintptr, pgno Pgno) int32 { /* sqlite3.c:53926:12: */ var ii int32 // Loop counter var rc int32 = SQLITE_OK // Result code for ii = 0; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ { - var p uintptr = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(ii)*48) + var p uintptr = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(ii)*56) if pgno <= (*PagerSavepoint)(unsafe.Pointer(p)).FnOrig { rc = rc | (Xsqlite3BitvecSet(tls, (*PagerSavepoint)(unsafe.Pointer(p)).FpInSavepoint, pgno)) @@ -30505,7 +30520,7 @@ func addToSavepointBitvecs(tls *libc.TLS, pPager uintptr, pgno Pgno) int32 { /* // 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 *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ +func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53958:13: */ Xsqlite3BitvecDestroy(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal) (*Pager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) @@ -30514,7 +30529,7 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) { Xsqlite3WalEndReadTransaction(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } else if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) { var rc int32 // Error code returned by pagerUnlockDb() var iDc int32 @@ -30547,7 +30562,7 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ // without clearing the error code. This is intentional - the error // code is cleared and the cache reset in the block below. - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } // If Pager.errCode is set, the contents of the pager cache cannot be @@ -30559,13 +30574,13 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 { pager_reset(tls, pPager) (*Pager)(unsafe.Pointer(pPager)).FchangeCountDone = U8(0) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } else { (*Pager)(unsafe.Pointer(pPager)).FeState = func() uint8 { if (*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0) { - return PAGER_OPEN + return uint8(PAGER_OPEN) } - return PAGER_READER + return uint8(PAGER_READER) }() } if (*Pager)(unsafe.Pointer(pPager)).FbUseFetch != 0 { @@ -30597,12 +30612,12 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ // 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 *libc.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:53619:12: */ +func pager_error(tls *libc.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:54055:12: */ var rc2 int32 = (rc & 0xff) if (rc2 == SQLITE_FULL) || (rc2 == SQLITE_IOERR) { (*Pager)(unsafe.Pointer(pPager)).FerrCode = rc - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_ERROR + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_ERROR) setGetterMethod(tls, pPager) } return rc @@ -30622,7 +30637,7 @@ func pager_error(tls *libc.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:5 // 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 *libc.TLS, pPager uintptr, bCommit int32) int32 { /* sqlite3.c:53653:12: */ +func pagerFlushOnCommit(tls *libc.TLS, pPager uintptr, bCommit int32) int32 { /* sqlite3.c:54089:12: */ if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 { return 1 } @@ -30686,7 +30701,7 @@ func pagerFlushOnCommit(tls *libc.TLS, pPager uintptr, bCommit int32) int32 { /* // 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 *libc.TLS, pPager uintptr, hasSuper int32, bCommit int32) int32 { /* sqlite3.c:53713:12: */ +func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommit int32) int32 { /* sqlite3.c:54149:12: */ var rc int32 = SQLITE_OK // Error code from journal finalization operation var rc2 int32 = SQLITE_OK // Error code from db file unlock operation @@ -30787,7 +30802,7 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi (!((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) || (Xsqlite3WalExclusiveMode(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, 0) != 0)) { rc2 = pagerUnlockDb(tls, pPager, SHARED_LOCK) } - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_READER + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER) (*Pager)(unsafe.Pointer(pPager)).FsetSuper = U8(0) return func() int32 { @@ -30813,7 +30828,7 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi // 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 *libc.TLS, pPager uintptr) { /* sqlite3.c:53860:13: */ +func pagerUnlockAndRollback(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54296:13: */ if (int32((*Pager)(unsafe.Pointer(pPager)).FeState) != PAGER_ERROR) && (int32((*Pager)(unsafe.Pointer(pPager)).FeState) != PAGER_OPEN) { if int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_LOCKED { @@ -30845,7 +30860,7 @@ func pagerUnlockAndRollback(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53860: // 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 *libc.TLS, pPager uintptr, aData uintptr) U32 { /* sqlite3.c:53894:12: */ +func pager_cksum(tls *libc.TLS, pPager uintptr, aData uintptr) U32 { /* sqlite3.c:54330:12: */ var cksum U32 = (*Pager)(unsafe.Pointer(pPager)).FcksumInit // Checksum value to return var i int32 = ((*Pager)(unsafe.Pointer(pPager)).FpageSize - 200) // Loop counter for i > 0 { @@ -30890,7 +30905,7 @@ func pager_cksum(tls *libc.TLS, pPager uintptr, aData uintptr) U32 { /* sqlite3. // 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 *libc.TLS, pPager uintptr, pOffset uintptr, pDone uintptr, isMainJrnl int32, isSavepnt int32) int32 { /* sqlite3.c:53941:12: */ +func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDone uintptr, isMainJrnl int32, isSavepnt int32) int32 { /* sqlite3.c:54377:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -31124,7 +31139,7 @@ func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDo // the entire contents of the super-journal file. This could be // a couple of kilobytes or so - potentially larger than the page // size. -func pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:54188:12: */ +func pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:54624:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -31137,6 +31152,7 @@ func pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sq // Size of super-journal file var zJournal uintptr // Pointer to one journal within MJ file var zSuperPtr uintptr // Space to hold super-journal filename + var zFree uintptr // Free this buffer var nSuperPtr int32 var flags int32 // One of the journals pointed to by the super-journal exists. @@ -31149,7 +31165,8 @@ func pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sq var flags1 int32 // var exists int32 at bp+8, 4 pVfs = (*Pager)(unsafe.Pointer(pPager)).FpVfs - zSuperJournal = uintptr(0) // Amount of space allocated to zSuperPtr[] + zSuperJournal = uintptr(0) + zFree = uintptr(0) // Amount of space allocated to zSuperPtr[] // Allocate space for both the pJournal and pSuper file descriptors. // If successful, open the super-journal file for reading. @@ -31185,14 +31202,16 @@ __3: __4: ; nSuperPtr = ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + 1) - zSuperJournal = Xsqlite3Malloc(tls, (uint64((*(*I64)(unsafe.Pointer(bp /* nSuperJournal */)) + I64(nSuperPtr)) + int64(2)))) - if !(!(zSuperJournal != 0)) { + zFree = Xsqlite3Malloc(tls, (uint64(((int64(4) + *(*I64)(unsafe.Pointer(bp /* nSuperJournal */))) + I64(nSuperPtr)) + int64(2)))) + if !(!(zFree != 0)) { goto __5 } rc = SQLITE_NOMEM goto delsuper_out __5: ; + *(*int8)(unsafe.Pointer(zFree)) = libc.AssignPtrInt8(zFree+1, libc.AssignPtrInt8(zFree+2, libc.AssignPtrInt8(zFree+3, int8(0)))) + zSuperJournal = (zFree + 4) zSuperPtr = (zSuperJournal + uintptr((*(*I64)(unsafe.Pointer(bp /* nSuperJournal */)) + int64(2)))) rc = Xsqlite3OsRead(tls, pSuper, zSuperJournal, int32(*(*I64)(unsafe.Pointer(bp /* nSuperJournal */))), int64(0)) if !(rc != SQLITE_OK) { @@ -31256,7 +31275,7 @@ __8: rc = Xsqlite3OsDelete(tls, pVfs, zSuper, 0) delsuper_out: - Xsqlite3_free(tls, zSuperJournal) + Xsqlite3_free(tls, zFree) if !(pSuper != 0) { goto __14 } @@ -31286,7 +31305,7 @@ __14: // // 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 *libc.TLS, pPager uintptr, nPage Pgno) int32 { /* sqlite3.c:54303:12: */ +func pager_truncate(tls *libc.TLS, pPager uintptr, nPage Pgno) int32 { /* sqlite3.c:54742:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -31321,7 +31340,7 @@ func pager_truncate(tls *libc.TLS, pPager uintptr, nPage Pgno) int32 { /* sqlite // 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 Xsqlite3SectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:54339:20: */ +func Xsqlite3SectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:54778:20: */ var iRet int32 = Xsqlite3OsSectorSize(tls, pFile) if iRet < 32 { iRet = 512 @@ -31353,7 +31372,7 @@ func Xsqlite3SectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:54339 // (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 *libc.TLS, pPager uintptr) { /* sqlite3.c:54373:13: */ +func setSectorSize(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54812:13: */ if ((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0) || ((Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd) & SQLITE_IOCAP_POWERSAFE_OVERWRITE) != 0) { @@ -31421,7 +31440,7 @@ func setSectorSize(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54373:13: */ // 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 *libc.TLS, pPager uintptr, isHot int32) int32 { /* sqlite3.c:54446:12: */ +func pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) int32 { /* sqlite3.c:54885:12: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -31647,7 +31666,11 @@ __22: if !(rc == SQLITE_OK) { goto __23 } - zSuper = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace + // Leave 4 bytes of space before the super-journal filename in memory. + // This is because it may end up being passed to sqlite3OsOpen(), in + // which case it requires 4 0x00 bytes in memory immediately before + // the filename. + zSuper = ((*Pager)(unsafe.Pointer(pPager)).FpTmpSpace + 4) rc = readSuperJournal(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, (uint32((*Sqlite3_vfs)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname + 1))) __23: @@ -31671,6 +31694,8 @@ __25: } // If there was a super-journal and this routine will return success, // see if it is possible to delete the super-journal. + + libc.Xmemset(tls, (zSuper + libc.UintptrFromInt32(-4)), 0, uint64(4)) rc = pager_delsuper(tls, pPager, zSuper) __26: @@ -31678,7 +31703,7 @@ __26: if !((isHot != 0) && (nPlayback != 0)) { goto __27 } - Xsqlite3_log(tls, (SQLITE_NOTICE | (int32(2) << 8)), ts+2862, /* "recovered %d pag..." */ + Xsqlite3_log(tls, (SQLITE_NOTICE | (int32(2) << 8)), ts+2890, /* "recovered %d pag..." */ libc.VaList(bp, nPlayback, (*Pager)(unsafe.Pointer(pPager)).FzJournal)) __27: ; @@ -31700,7 +31725,7 @@ __27: // // If an IO error occurs, then the IO error is returned to the caller. // Otherwise, SQLITE_OK is returned. -func readDbPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:54657:12: */ +func readDbPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:55102:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -31754,7 +31779,7 @@ func readDbPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:54657:12: */ // 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 *libc.TLS, pPg uintptr) { /* sqlite3.c:54720:13: */ +func pager_write_changecounter(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55165:13: */ var change_counter U32 // Increment the value just read and write it back to byte 24. @@ -31765,7 +31790,7 @@ func pager_write_changecounter(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:54720: // bytes 92..95 store the change counter for which the version number // is valid. Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(92)), change_counter) - Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(96)), SQLITE_VERSION_NUMBER) + Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(96)), uint32(SQLITE_VERSION_NUMBER)) } // This function is invoked once for each page that has already been @@ -31778,7 +31803,7 @@ func pager_write_changecounter(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:54720: // 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 *libc.TLS, pCtx uintptr, iPg Pgno) int32 { /* sqlite3.c:54747:12: */ +func pagerUndoCallback(tls *libc.TLS, pCtx uintptr, iPg Pgno) int32 { /* sqlite3.c:55192:12: */ var rc int32 = SQLITE_OK var pPager uintptr = pCtx var pPg uintptr @@ -31809,7 +31834,7 @@ func pagerUndoCallback(tls *libc.TLS, pCtx uintptr, iPg Pgno) int32 { /* sqlite3 } // This function is called to rollback a transaction on a WAL database. -func pagerRollbackWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54782:12: */ +func pagerRollbackWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55227:12: */ var rc int32 // Return Code var pList uintptr // List of dirty pages to revert @@ -31840,7 +31865,7 @@ func pagerRollbackWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54782: // // The list of pages passed into this routine is always sorted by page number. // Hence, if page 1 appears anywhere on the list, it will be the first page. -func pagerWalFrames(tls *libc.TLS, pPager uintptr, pList uintptr, nTruncate Pgno, isCommit int32) int32 { /* sqlite3.c:54814:12: */ +func pagerWalFrames(tls *libc.TLS, pPager uintptr, pList uintptr, nTruncate Pgno, isCommit int32) int32 { /* sqlite3.c:55259:12: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = pList @@ -31888,7 +31913,7 @@ func pagerWalFrames(tls *libc.TLS, pPager uintptr, pList uintptr, nTruncate Pgno // 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 *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54881:12: */ +func pagerBeginReadTransaction(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55326:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -31919,7 +31944,7 @@ func pagerBeginReadTransaction(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3 // 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 *libc.TLS, pPager uintptr, pnPage uintptr) int32 { /* sqlite3.c:54914:12: */ +func pagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) int32 { /* sqlite3.c:55359:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -31973,7 +31998,7 @@ func pagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) int32 { /* sq // 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 *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54974:12: */ +func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55419:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -32000,7 +32025,7 @@ func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5 rc = Xsqlite3PagerOpenWal(tls, pPager, uintptr(0)) } } else if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_WAL { - (*Pager)(unsafe.Pointer(pPager)).FjournalMode = PAGER_JOURNALMODE_DELETE + (*Pager)(unsafe.Pointer(pPager)).FjournalMode = U8(PAGER_JOURNALMODE_DELETE) } } } @@ -32041,7 +32066,7 @@ func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5 // 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 *libc.TLS, pPager uintptr, pSavepoint uintptr) int32 { /* sqlite3.c:55041:12: */ +func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) int32 { /* sqlite3.c:55486:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -32131,7 +32156,7 @@ func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) i *(*I64)(unsafe.Pointer(bp + 8 /* offset */)) = (I64((*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiSubRec) * (I64(4 + (*Pager)(unsafe.Pointer(pPager)).FpageSize))) if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) { - rc = Xsqlite3WalSavepointUndo(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSavepoint+32 /* &.aWalData */) + rc = Xsqlite3WalSavepointUndo(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSavepoint+36 /* &.aWalData */) } for ii = (*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiSubRec; (rc == SQLITE_OK) && (ii < (*Pager)(unsafe.Pointer(pPager)).FnSubRec); ii++ { @@ -32150,18 +32175,18 @@ func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) i // Change the maximum number of in-memory pages that are allowed // before attempting to recycle clean and unused pages. -func Xsqlite3PagerSetCachesize(tls *libc.TLS, pPager uintptr, mxPage int32) { /* sqlite3.c:55153:21: */ +func Xsqlite3PagerSetCachesize(tls *libc.TLS, pPager uintptr, mxPage int32) { /* sqlite3.c:55598:21: */ Xsqlite3PcacheSetCachesize(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, mxPage) } // Change the maximum number of in-memory pages that are allowed // before attempting to spill pages to journal. -func Xsqlite3PagerSetSpillsize(tls *libc.TLS, pPager uintptr, mxPage int32) int32 { /* sqlite3.c:55161:20: */ +func Xsqlite3PagerSetSpillsize(tls *libc.TLS, pPager uintptr, mxPage int32) int32 { /* sqlite3.c:55606:20: */ return Xsqlite3PcacheSetSpillsize(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, mxPage) } // Invoke SQLITE_FCNTL_MMAP_SIZE based on the current value of szMmap. -func pagerFixMaplimit(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55168:13: */ +func pagerFixMaplimit(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55613:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -32177,13 +32202,13 @@ func pagerFixMaplimit(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55168:13: */ } // Change the maximum size of any memory mapping made of the database file. -func Xsqlite3PagerSetMmapLimit(tls *libc.TLS, pPager uintptr, szMmap Sqlite3_int64) { /* sqlite3.c:55184:21: */ +func Xsqlite3PagerSetMmapLimit(tls *libc.TLS, pPager uintptr, szMmap Sqlite3_int64) { /* sqlite3.c:55629:21: */ (*Pager)(unsafe.Pointer(pPager)).FszMmap = szMmap pagerFixMaplimit(tls, pPager) } // Free as much memory as possible from the pager. -func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55192:21: */ +func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55637:21: */ Xsqlite3PcacheShrink(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) } @@ -32236,27 +32261,27 @@ func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55192:21: // // Numeric values associated with these states are OFF==1, NORMAL=2, // and FULL=3. -func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* sqlite3.c:55248:21: */ - var level uint32 = (pgFlags & PAGER_SYNCHRONOUS_MASK) +func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* sqlite3.c:55693:21: */ + var level uint32 = (pgFlags & uint32(PAGER_SYNCHRONOUS_MASK)) if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 { (*Pager)(unsafe.Pointer(pPager)).FnoSync = U8(1) (*Pager)(unsafe.Pointer(pPager)).FfullSync = U8(0) (*Pager)(unsafe.Pointer(pPager)).FextraSync = U8(0) } else { (*Pager)(unsafe.Pointer(pPager)).FnoSync = func() uint8 { - if level == PAGER_SYNCHRONOUS_OFF { + if level == uint32(PAGER_SYNCHRONOUS_OFF) { return uint8(1) } return uint8(0) }() (*Pager)(unsafe.Pointer(pPager)).FfullSync = func() uint8 { - if level >= PAGER_SYNCHRONOUS_FULL { + if level >= uint32(PAGER_SYNCHRONOUS_FULL) { return uint8(1) } return uint8(0) }() (*Pager)(unsafe.Pointer(pPager)).FextraSync = func() uint8 { - if level == PAGER_SYNCHRONOUS_EXTRA { + if level == uint32(PAGER_SYNCHRONOUS_EXTRA) { return uint8(1) } return uint8(0) @@ -32264,19 +32289,19 @@ func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* s } if (*Pager)(unsafe.Pointer(pPager)).FnoSync != 0 { (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(0) - } else if (pgFlags & PAGER_FULLFSYNC) != 0 { - (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = SQLITE_SYNC_FULL + } else if (pgFlags & uint32(PAGER_FULLFSYNC)) != 0 { + (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(SQLITE_SYNC_FULL) } else { - (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = SQLITE_SYNC_NORMAL + (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(SQLITE_SYNC_NORMAL) } (*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags = (U8(int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags) << 2)) if (*Pager)(unsafe.Pointer(pPager)).FfullSync != 0 { *(*U8)(unsafe.Pointer(pPager + 15 /* &.walSyncFlags */)) |= U8((int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags))) } - if ((pgFlags & PAGER_CKPT_FULLFSYNC) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) { + if ((pgFlags & uint32(PAGER_CKPT_FULLFSYNC)) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) { *(*U8)(unsafe.Pointer(pPager + 15 /* &.walSyncFlags */)) |= U8((int32(SQLITE_SYNC_FULL) << 2)) } - if (pgFlags & PAGER_CACHESPILL) != 0 { + if (pgFlags & uint32(PAGER_CACHESPILL)) != 0 { *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) &= libc.Uint8FromInt32((libc.CplInt32(SPILLFLAG_OFF))) } else { *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) |= U8((SPILLFLAG_OFF)) @@ -32300,7 +32325,7 @@ func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* s // SQLITE_OPEN_CREATE // SQLITE_OPEN_EXCLUSIVE // SQLITE_OPEN_DELETEONCLOSE -func pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32) int32 { /* sqlite3.c:55308:12: */ +func pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32) int32 { /* sqlite3.c:55753:12: */ var rc int32 // Return code vfsFlags = vfsFlags | (((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) @@ -32328,7 +32353,7 @@ func pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32) // 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 Xsqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { /* sqlite3.c:55347:21: */ +func Xsqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { /* sqlite3.c:55792:21: */ var ap uintptr (*Pager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler (*Pager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg @@ -32365,7 +32390,7 @@ func Xsqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uin // 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 Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, nReserve int32) int32 { /* sqlite3.c:55391:20: */ +func Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, nReserve int32) int32 { /* sqlite3.c:55836:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -32434,7 +32459,7 @@ func Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, // 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 Xsqlite3PagerTempSpace(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:55459:21: */ +func Xsqlite3PagerTempSpace(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:55904:21: */ return (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace } @@ -32443,7 +32468,7 @@ func Xsqlite3PagerTempSpace(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3. // maximum page count below the current size of the database. // // Regardless of mxPage, return the current maximum page count. -func Xsqlite3PagerMaxPageCount(tls *libc.TLS, pPager uintptr, mxPage Pgno) Pgno { /* sqlite3.c:55470:21: */ +func Xsqlite3PagerMaxPageCount(tls *libc.TLS, pPager uintptr, mxPage Pgno) Pgno { /* sqlite3.c:55915:21: */ if mxPage > Pgno(0) { (*Pager)(unsafe.Pointer(pPager)).FmxPgno = mxPage } @@ -32474,7 +32499,7 @@ func Xsqlite3PagerMaxPageCount(tls *libc.TLS, pPager uintptr, mxPage Pgno) Pgno // 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 Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest uintptr) int32 { /* sqlite3.c:55520:20: */ +func Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest uintptr) int32 { /* sqlite3.c:55965:20: */ var rc int32 = SQLITE_OK libc.Xmemset(tls, pDest, 0, uint64(N)) @@ -32497,7 +32522,7 @@ func Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest u // // However, if the file is between 1 and bytes in size, then // this is considered a 1 page file. -func Xsqlite3PagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) { /* sqlite3.c:55548:21: */ +func Xsqlite3PagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) { /* sqlite3.c:55993:21: */ *(*int32)(unsafe.Pointer(pnPage)) = int32((*Pager)(unsafe.Pointer(pPager)).FdbSize) } @@ -32514,7 +32539,7 @@ func Xsqlite3PagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) { /* // 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 *libc.TLS, pPager uintptr, locktype int32) int32 { /* sqlite3.c:55569:12: */ +func pager_wait_on_lock(tls *libc.TLS, pPager uintptr, locktype int32) int32 { /* sqlite3.c:56014:12: */ var rc int32 // Return code // Check that this is either a no-op (because the requested lock is @@ -32558,7 +32583,7 @@ func pager_wait_on_lock(tls *libc.TLS, pPager uintptr, locktype int32) int32 { / // 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 Xsqlite3PagerTruncateImage(tls *libc.TLS, pPager uintptr, nPage Pgno) { /* sqlite3.c:55633:21: */ +func Xsqlite3PagerTruncateImage(tls *libc.TLS, pPager uintptr, nPage Pgno) { /* sqlite3.c:56078:21: */ (*Pager)(unsafe.Pointer(pPager)).FdbSize = nPage @@ -32585,7 +32610,7 @@ func Xsqlite3PagerTruncateImage(tls *libc.TLS, pPager uintptr, nPage Pgno) { /* // // If everything goes as planned, SQLITE_OK is returned. Otherwise, // an SQLite error code. -func pagerSyncHotJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55664:12: */ +func pagerSyncHotJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56109:12: */ var rc int32 = SQLITE_OK if !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) { rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, SQLITE_SYNC_NORMAL) @@ -32604,7 +32629,7 @@ func pagerSyncHotJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:556 // // Page references obtained by calling this function should be released // by calling pagerReleaseMapPage(). -func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr, ppPage uintptr) int32 { /* sqlite3.c:55686:12: */ +func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr, ppPage uintptr) int32 { /* sqlite3.c:56131:12: */ var p uintptr // Memory mapped page to return if (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist != 0 { @@ -32620,7 +32645,7 @@ func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr return SQLITE_NOMEM } (*PgHdr)(unsafe.Pointer(p)).FpExtra = (p + 1*72) - (*PgHdr)(unsafe.Pointer(p)).Fflags = PGHDR_MMAP + (*PgHdr)(unsafe.Pointer(p)).Fflags = U16(PGHDR_MMAP) (*PgHdr)(unsafe.Pointer(p)).FnRef = int16(1) (*PgHdr)(unsafe.Pointer(p)).FpPager = pPager } @@ -32634,7 +32659,7 @@ func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr // Release a reference to page pPg. pPg must have been returned by an // earlier call to pagerAcquireMapPage(). -func pagerReleaseMapPage(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55730:13: */ +func pagerReleaseMapPage(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:56175:13: */ var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager (*Pager)(unsafe.Pointer(pPager)).FnMmapOut-- (*PgHdr)(unsafe.Pointer(pPg)).FpDirty = (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist @@ -32644,7 +32669,7 @@ func pagerReleaseMapPage(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55730:13: */ } // Free all PgHdr objects stored in the Pager.pMmapFreelist list. -func pagerFreeMapHdrs(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55743:13: */ +func pagerFreeMapHdrs(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:56188:13: */ var p uintptr var pNext uintptr for p = (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist; p != 0; p = pNext { @@ -32657,7 +32682,7 @@ func pagerFreeMapHdrs(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55743:13: */ // under the pager. Return SQLITE_OK if the database is still where 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 *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55757:12: */ +func databaseIsUnmoved(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56202:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -32695,7 +32720,7 @@ func databaseIsUnmoved(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55757 // 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 Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:55791:20: */ +func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:56236:20: */ var pTmp uintptr = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace Xsqlite3BeginBenignMalloc(tls) @@ -32705,7 +32730,7 @@ func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sq { var a uintptr = uintptr(0) - if ((db != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_NoCkptOnClose))) && + if ((db != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NoCkptOnClose)))) && (SQLITE_OK == databaseIsUnmoved(tls, pPager)) { a = pTmp } @@ -32744,7 +32769,7 @@ func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sq } // Increment the reference count for page pPg. -func Xsqlite3PagerRef(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55860:21: */ +func Xsqlite3PagerRef(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:56305:21: */ Xsqlite3PcacheRef(tls, pPg) } @@ -32781,7 +32806,7 @@ func Xsqlite3PagerRef(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55860:21: */ // 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 *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3.c:55899:12: */ +func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3.c:56344:12: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -32890,12 +32915,12 @@ func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3 // successfully synced. Either way, clear the PGHDR_NEED_SYNC flag on // all pages. Xsqlite3PcacheClearSyncFlags(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_DBMOD + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_DBMOD) return SQLITE_OK } -var zerobyte U8 = U8(0) /* sqlite3.c:55950:27 */ +var zerobyte U8 = U8(0) /* sqlite3.c:56395:27 */ // 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 @@ -32927,7 +32952,7 @@ var zerobyte U8 = U8(0) /* sqlite3.c:55950:27 */ // 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 *libc.TLS, pPager uintptr, pList uintptr) int32 { /* sqlite3.c:56042:12: */ +func pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) int32 { /* sqlite3.c:56487:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -33007,7 +33032,7 @@ func pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) int32 { // 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 *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56133:12: */ +func openSubJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56578:12: */ var rc int32 = SQLITE_OK if !((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fsjfd))).FpMethods != uintptr(0)) { var flags int32 = ((((SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_READWRITE) | @@ -33031,7 +33056,7 @@ func openSubJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56133:12 // 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 *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:56159:12: */ +func subjournalPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:56604:12: */ var rc int32 = SQLITE_OK var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_OFF { @@ -33062,7 +33087,7 @@ func subjournalPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:56159:12: * return rc } -func subjournalPageIfRequired(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:56195:12: */ +func subjournalPageIfRequired(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:56640:12: */ if subjRequiresPage(tls, pPg) != 0 { return subjournalPage(tls, pPg) } else { @@ -33088,7 +33113,7 @@ func subjournalPageIfRequired(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:5 // 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 *libc.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:56222:12: */ +func pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:56667:12: */ var pPager uintptr = p var rc int32 = SQLITE_OK @@ -33150,7 +33175,7 @@ func pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:562 } // Flush all unreferenced dirty pages to disk. -func Xsqlite3PagerFlush(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56299:20: */ +func Xsqlite3PagerFlush(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56744:20: */ var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode if !(int32((*Pager)(unsafe.Pointer(pPager)).FmemDb) != 0) { var pList uintptr = Xsqlite3PcacheDirtyList(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) @@ -33197,7 +33222,7 @@ func Xsqlite3PagerFlush(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5629 // 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 Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) int32 { /* sqlite3.c:56348:20: */ +func Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) int32 { /* sqlite3.c:56793:20: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -33230,7 +33255,7 @@ func Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u nPathname = 0 useJournal = (libc.Bool32((flags & PAGER_OMIT_JOURNAL) == 0)) pcacheSize = Xsqlite3PcacheSize(tls) - *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = SQLITE_DEFAULT_PAGE_SIZE + *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = U32(SQLITE_DEFAULT_PAGE_SIZE) zUri = uintptr(0) nUriByte = 1 nUri = 0 // Number of URI parameters @@ -33320,7 +33345,7 @@ __11: // bytes in length. This means the database cannot be opened, // as it will not be possible to open the journal file or even // check for a hot-journal before reading. - rc = Xsqlite3CantopenError(tls, 56435) + rc = Xsqlite3CantopenError(tls, 56880) __12: ; if !(rc != SQLITE_OK) { @@ -33428,7 +33453,7 @@ __15: (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, ts+2889 /* "-journal" */, uint64(8)) + libc.Xmemcpy(tls, pPtr, ts+2917 /* "-journal" */, uint64(8)) pPtr += (uintptr(8 + 1)) goto __19 __18: @@ -33443,7 +33468,7 @@ __19: (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, ts+2898 /* "-wal" */, uint64(4)) + libc.Xmemcpy(tls, pPtr, ts+2926 /* "-wal" */, uint64(4)) pPtr += (uintptr(4 + 1)) goto __21 __20: @@ -33488,10 +33513,10 @@ __22: if !(*(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) < (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize) { goto __27 } - if !((*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize > SQLITE_MAX_DEFAULT_PAGE_SIZE) { + if !((*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize > U32(SQLITE_MAX_DEFAULT_PAGE_SIZE)) { goto __28 } - *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = SQLITE_MAX_DEFAULT_PAGE_SIZE + *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = U32(SQLITE_MAX_DEFAULT_PAGE_SIZE) goto __29 __28: *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize @@ -33501,9 +33526,9 @@ __27: ; __26: ; - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+2903 /* "nolock" */, 0)) + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+2931 /* "nolock" */, 0)) if !(((iDc & SQLITE_IOCAP_IMMUTABLE) != 0) || - (Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+2910 /* "immutable" */, 0) != 0)) { + (Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+2938 /* "immutable" */, 0) != 0)) { goto __30 } vfsFlags = vfsFlags | (SQLITE_OPEN_READONLY) @@ -33525,9 +33550,9 @@ __23: // This branch also runs for files marked as immutable. act_like_temp_file: tempFile = 1 - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeState = PAGER_READER // Pretend we already have a lock - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeLock = EXCLUSIVE_LOCK // Pretend we are in EXCLUSIVE mode - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(1) // Do no locking + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeState = U8(PAGER_READER) // Pretend we already have a lock + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeLock = U8(EXCLUSIVE_LOCK) // Pretend we are in EXCLUSIVE mode + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(1) // Do no locking readOnly = (vfsFlags & SQLITE_OPEN_READONLY) __24: ; @@ -33579,7 +33604,7 @@ __33: // pPager->stmtSize = 0; // pPager->stmtJSize = 0; // pPager->nPage = 0; - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FmxPgno = SQLITE_MAX_PAGE_COUNT + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FmxPgno = Pgno(SQLITE_MAX_PAGE_COUNT) // pPager->state = PAGER_UNLOCK; // pPager->errMask = 0; (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FtempFile = U8(tempFile) @@ -33598,7 +33623,7 @@ __33: __34: (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FfullSync = U8(1) (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FextraSync = U8(0) - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsyncFlags = SQLITE_SYNC_NORMAL + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsyncFlags = U8(SQLITE_SYNC_NORMAL) (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FwalSyncFlags = (U8(SQLITE_SYNC_NORMAL | (int32(SQLITE_SYNC_NORMAL) << 2))) __35: ; @@ -33612,13 +33637,13 @@ __35: if !(!(useJournal != 0)) { goto __36 } - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = PAGER_JOURNALMODE_OFF + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = U8(PAGER_JOURNALMODE_OFF) goto __37 __36: if !((memDb != 0) || (0 != 0)) { goto __38 } - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = PAGER_JOURNALMODE_MEMORY + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = U8(PAGER_JOURNALMODE_MEMORY) __38: ; __37: @@ -33637,7 +33662,7 @@ __37: // Return the sqlite3_file for the main database given the name // of the corresonding WAL or Journal name as passed into // xOpen. -func Xsqlite3_database_file_object(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:56719:25: */ +func Xsqlite3_database_file_object(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:57164:25: */ var pPager uintptr for (((int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-1)))) != 0) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-2)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-3)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-4)))) != 0) { zName-- @@ -33675,7 +33700,7 @@ func Xsqlite3_database_file_object(tls *libc.TLS, zName uintptr) uintptr { /* sq // 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 *libc.TLS, pPager uintptr, pExists uintptr) int32 { /* sqlite3.c:56760:12: */ +func hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) int32 { /* sqlite3.c:57205:12: */ bp := tls.Alloc(17) defer tls.Free(17) @@ -33786,7 +33811,7 @@ func hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) int32 { /* sq // 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 Xsqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56880:20: */ +func Xsqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57325:20: */ bp := tls.Alloc(28) defer tls.Free(28) @@ -33912,7 +33937,7 @@ __7: if !((rc == SQLITE_OK) && ((*(*int32)(unsafe.Pointer(bp + 8 /* fout */)) & SQLITE_OPEN_READONLY) != 0)) { goto __10 } - rc = Xsqlite3CantopenError(tls, 56964) + rc = Xsqlite3CantopenError(tls, 57409) Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd) __10: ; @@ -33937,7 +33962,7 @@ __8: goto __13 } rc = pager_playback(tls, pPager, libc.BoolInt32(!((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0))) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) __13: ; goto __12 @@ -34048,7 +34073,7 @@ failed: goto __24 __23: - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_READER + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER) (*Pager)(unsafe.Pointer(pPager)).FhasHeldSharedLock = U8(1) __24: ; @@ -34061,7 +34086,7 @@ __24: // Except, in locking_mode=EXCLUSIVE when there is nothing to in // the rollback journal, the unlock is not performed and there is // nothing to rollback, so this routine is a no-op. -func pagerUnlockIfUnused(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:57097:13: */ +func pagerUnlockIfUnused(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:57542:13: */ if Xsqlite3PcacheRefCount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) == 0 { // because page1 is never memory mapped pagerUnlockAndRollback(tls, pPager) @@ -34123,7 +34148,7 @@ func pagerUnlockIfUnused(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:57097:13: // 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 *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57161:12: */ +func getPageNormal(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57606:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -34136,7 +34161,7 @@ func getPageNormal(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, fla if !(pgno == Pgno(0)) { goto __1 } - return Xsqlite3CorruptError(tls, 57177) + return Xsqlite3CorruptError(tls, 57622) __1: ; *(*uintptr)(unsafe.Pointer(bp /* pBase */)) = Xsqlite3PcacheFetch(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, 3) @@ -34182,7 +34207,7 @@ __5: if !(pgno == (Pgno((Xsqlite3PendingByte / ((*Pager)(unsafe.Pointer(pPager)).FpageSize)) + 1))) { goto __7 } - rc = Xsqlite3CorruptError(tls, 57209) + rc = Xsqlite3CorruptError(tls, 57654) goto pager_acquire_err __7: ; @@ -34254,7 +34279,7 @@ __14: } // The page getter for when memory-mapped I/O is enabled -func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57263:12: */ +func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57708:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -34274,7 +34299,7 @@ func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags // test in the previous statement, and avoid testing pgno==0 in the // common case where pgno is large. if (pgno <= Pgno(1)) && (pgno == Pgno(0)) { - return Xsqlite3CorruptError(tls, 57288) + return Xsqlite3CorruptError(tls, 57733) } if (bMmapOk != 0) && ((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) { @@ -34312,7 +34337,7 @@ func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags } // The page getter method for when the pager is an error state -func getPageError(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57332:12: */ +func getPageError(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57777:12: */ _ = pgno _ = flags @@ -34321,7 +34346,7 @@ func getPageError(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flag } // Dispatch all page fetch requests to the appropriate getter method. -func Xsqlite3PagerGet(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57348:20: */ +func Xsqlite3PagerGet(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57793:20: */ return (*(*func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32)(unsafe.Pointer((pPager + 264 /* &.xGet */))))(tls, pPager, pgno, ppPage, flags) } @@ -34334,7 +34359,7 @@ func Xsqlite3PagerGet(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, // 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 Xsqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno Pgno) uintptr { /* sqlite3.c:57368:23: */ +func Xsqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno Pgno) uintptr { /* sqlite3.c:57813:23: */ var pPage uintptr pPage = Xsqlite3PcacheFetch(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, 0) @@ -34355,7 +34380,7 @@ func Xsqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno Pgno) uintptr { /* // Use sqlite3PagerUnrefPageOne() to release page1. This latter routine // checks the total number of outstanding pages and if the number of // pages reaches zero it drops the database lock. -func Xsqlite3PagerUnrefNotNull(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57391:21: */ +func Xsqlite3PagerUnrefNotNull(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57836:21: */ if (int32((*DbPage)(unsafe.Pointer(pPg)).Fflags) & PGHDR_MMAP) != 0 { // Page1 is never memory mapped @@ -34367,13 +34392,13 @@ func Xsqlite3PagerUnrefNotNull(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57391: } -func Xsqlite3PagerUnref(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57403:21: */ +func Xsqlite3PagerUnref(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57848:21: */ if pPg != 0 { Xsqlite3PagerUnrefNotNull(tls, pPg) } } -func Xsqlite3PagerUnrefPageOne(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57406:21: */ +func Xsqlite3PagerUnrefPageOne(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57851:21: */ var pPager uintptr // Page1 is never memory mapped @@ -34402,7 +34427,7 @@ func Xsqlite3PagerUnrefPageOne(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57406: // 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 *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57438:12: */ +func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57883:12: */ var rc int32 = SQLITE_OK // Return code var pVfs uintptr = (*Pager)(unsafe.Pointer(pPager)).FpVfs // Local cache of vfs pointer @@ -34463,7 +34488,7 @@ func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5743 (*Pager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) } else { - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_CACHEMOD + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_CACHEMOD) } return rc @@ -34484,7 +34509,7 @@ func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5743 // 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 Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemory int32) int32 { /* sqlite3.c:57527:20: */ +func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemory int32) int32 { /* sqlite3.c:57972:20: */ var rc int32 = SQLITE_OK if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 { @@ -34531,7 +34556,7 @@ func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemor // transactions may copy data from the sub-journal into the database // file as well as into the page cache. Which would be incorrect in // WAL mode. - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_LOCKED + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_LOCKED) (*Pager)(unsafe.Pointer(pPager)).FdbHintSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize (*Pager)(unsafe.Pointer(pPager)).FdbFileSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize @@ -34544,7 +34569,7 @@ func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemor } // Write page pPg onto the end of the rollback journal. -func pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57596:28: */ +func pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58041:28: */ var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager var rc int32 var cksum U32 @@ -34594,7 +34619,7 @@ func pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) int32 { /* sqlite // 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 *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57653:12: */ +func pager_write(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58098:12: */ var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager var rc int32 = SQLITE_OK @@ -34668,7 +34693,7 @@ func pager_write(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57653:12: */ // 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 *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57745:28: */ +func pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58190:28: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -34756,7 +34781,7 @@ func pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:5774 // // If an error occurs, SQLITE_NOMEM or an IO error code is returned // as appropriate. Otherwise, SQLITE_OK. -func Xsqlite3PagerWrite(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57839:20: */ +func Xsqlite3PagerWrite(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58284:20: */ var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager if ((int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags) & PGHDR_WRITEABLE) != 0) && ((*Pager)(unsafe.Pointer(pPager)).FdbSize >= (*PgHdr)(unsafe.Pointer(pPg)).Fpgno) { @@ -34797,7 +34822,7 @@ func Xsqlite3PagerWrite(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57839:2 // 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 Xsqlite3PagerDontWrite(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57888:21: */ +func Xsqlite3PagerDontWrite(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:58333:21: */ var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager if (!(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && ((int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags) & PGHDR_DIRTY) != 0)) && ((*Pager)(unsafe.Pointer(pPager)).FnSavepoint == 0) { @@ -34827,7 +34852,7 @@ func Xsqlite3PagerDontWrite(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57888:21: // 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 *libc.TLS, pPager uintptr, isDirectMode int32) int32 { /* sqlite3.c:57922:12: */ +func pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32) int32 { /* sqlite3.c:58367:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -34897,7 +34922,7 @@ func pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32) // // 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 Xsqlite3PagerSync(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:58005:20: */ +func Xsqlite3PagerSync(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:58450:20: */ var rc int32 = SQLITE_OK var pArg uintptr = zSuper rc = Xsqlite3OsFileControl(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_SYNC, pArg) @@ -34920,7 +34945,7 @@ func Xsqlite3PagerSync(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* // 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 Xsqlite3PagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58028:20: */ +func Xsqlite3PagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58473:20: */ var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode if rc == SQLITE_OK { @@ -34956,7 +34981,7 @@ func Xsqlite3PagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite // 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 Xsqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, noSync int32) int32 { /* sqlite3.c:58070:20: */ +func Xsqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, noSync int32) int32 { /* sqlite3.c:58515:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -35127,7 +35152,7 @@ commit_phase_one_exit: if !((rc == SQLITE_OK) && !((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0))) { goto __19 } - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_FINISHED + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_FINISHED) __19: ; return rc @@ -35146,7 +35171,7 @@ __19: // // If an error occurs, an IO error code is returned and the pager // moves into the error state. Otherwise, SQLITE_OK is returned. -func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58300:20: */ +func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58745:20: */ var rc int32 = SQLITE_OK // Return code // This routine should not be called if a prior error has occurred. @@ -35171,7 +35196,7 @@ func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlit ((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0)) && (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_PERSIST) { - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_READER + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER) return SQLITE_OK } @@ -35203,7 +35228,7 @@ func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlit // 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 Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58366:20: */ +func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58811:20: */ var rc int32 = SQLITE_OK // Return code // PagerRollback() is a no-op if called in READER or OPEN state. If @@ -35232,7 +35257,7 @@ func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5 // state to indicate that the contents of the cache may not be trusted. // Any active readers will get SQLITE_ABORT. (*Pager)(unsafe.Pointer(pPager)).FerrCode = SQLITE_ABORT - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_ERROR + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_ERROR) setGetterMethod(tls, pPager) return rc } @@ -35247,13 +35272,13 @@ func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5 // Return TRUE if the database file is opened read-only. Return FALSE // if the database is (in theory) writable. -func Xsqlite3PagerIsreadonly(tls *libc.TLS, pPager uintptr) U8 { /* sqlite3.c:58416:19: */ +func Xsqlite3PagerIsreadonly(tls *libc.TLS, pPager uintptr) U8 { /* sqlite3.c:58861:19: */ return (*Pager)(unsafe.Pointer(pPager)).FreadOnly } // Return the approximate number of bytes of memory currently // used by the pager and its associated cache. -func Xsqlite3PagerMemUsed(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58433:20: */ +func Xsqlite3PagerMemUsed(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58878:20: */ var perPageSize int32 = (int32(((uint64((*Pager)(unsafe.Pointer(pPager)).FpageSize + int32((*Pager)(unsafe.Pointer(pPager)).FnExtra))) + uint64(unsafe.Sizeof(PgHdr{}))) + (uint64(5) * uint64(unsafe.Sizeof(uintptr(0)))))) return (((perPageSize * Xsqlite3PcachePagecount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)) + @@ -35262,7 +35287,7 @@ func Xsqlite3PagerMemUsed(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58 } // Return the number of references to the specified page. -func Xsqlite3PagerPageRefcount(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:58444:20: */ +func Xsqlite3PagerPageRefcount(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:58889:20: */ return Xsqlite3PcachePageRefcount(tls, pPage) } @@ -35275,7 +35300,7 @@ func Xsqlite3PagerPageRefcount(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3. // 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 Xsqlite3PagerCacheStat(tls *libc.TLS, pPager uintptr, eStat int32, reset int32, pnVal uintptr) { /* sqlite3.c:58480:21: */ +func Xsqlite3PagerCacheStat(tls *libc.TLS, pPager uintptr, eStat int32, reset int32, pnVal uintptr) { /* sqlite3.c:58925:21: */ eStat = eStat - (SQLITE_DBSTATUS_CACHE_HIT) *(*int32)(unsafe.Pointer(pnVal)) += (*(*int32)(unsafe.Pointer((pPager + 240 /* &.aStat */) + uintptr(eStat)*4))) @@ -35285,7 +35310,7 @@ func Xsqlite3PagerCacheStat(tls *libc.TLS, pPager uintptr, eStat int32, reset in } // Return true if this is an in-memory or temp-file backed pager. -func Xsqlite3PagerIsMemdb(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58503:20: */ +func Xsqlite3PagerIsMemdb(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58948:20: */ return int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) } @@ -35297,7 +35322,7 @@ func Xsqlite3PagerIsMemdb(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58 // 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 *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:58517:28: */ +func pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:58962:28: */ var rc int32 = SQLITE_OK // Return code var nCurrent int32 = (*Pager)(unsafe.Pointer(pPager)).FnSavepoint // Current number of savepoints var ii int32 // Iterator variable @@ -35311,24 +35336,25 @@ func pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { if !(aNew != 0) { return SQLITE_NOMEM } - libc.Xmemset(tls, (aNew + uintptr(nCurrent)*48), 0, ((uint64(nSavepoint - nCurrent)) * uint64(unsafe.Sizeof(PagerSavepoint{})))) + libc.Xmemset(tls, (aNew + uintptr(nCurrent)*56), 0, ((uint64(nSavepoint - nCurrent)) * uint64(unsafe.Sizeof(PagerSavepoint{})))) (*Pager)(unsafe.Pointer(pPager)).FaSavepoint = aNew // Populate the PagerSavepoint structures just allocated. for ii = nCurrent; ii < nSavepoint; ii++ { - (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48)).FnOrig = (*Pager)(unsafe.Pointer(pPager)).FdbSize + (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FnOrig = (*Pager)(unsafe.Pointer(pPager)).FdbSize if ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0)) && ((*Pager)(unsafe.Pointer(pPager)).FjournalOff > int64(0)) { - (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48)).FiOffset = (*Pager)(unsafe.Pointer(pPager)).FjournalOff + (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FiOffset = (*Pager)(unsafe.Pointer(pPager)).FjournalOff } else { - (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48)).FiOffset = I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) + (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FiOffset = I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) } - (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48)).FiSubRec = (*Pager)(unsafe.Pointer(pPager)).FnSubRec - (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48)).FpInSavepoint = Xsqlite3BitvecCreate(tls, (*Pager)(unsafe.Pointer(pPager)).FdbSize) - if !(int32((*PagerSavepoint)(unsafe.Pointer(aNew+uintptr(ii)*48)).FpInSavepoint) != 0) { + (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FiSubRec = (*Pager)(unsafe.Pointer(pPager)).FnSubRec + (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FpInSavepoint = Xsqlite3BitvecCreate(tls, (*Pager)(unsafe.Pointer(pPager)).FdbSize) + (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FbTruncateOnRelease = 1 + if !(int32((*PagerSavepoint)(unsafe.Pointer(aNew+uintptr(ii)*56)).FpInSavepoint) != 0) { return SQLITE_NOMEM } if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) { - Xsqlite3WalSavepoint(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, aNew+uintptr(ii)*48+32 /* &.aWalData */) + Xsqlite3WalSavepoint(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, aNew+uintptr(ii)*56+36 /* &.aWalData */) } (*Pager)(unsafe.Pointer(pPager)).FnSavepoint = (ii + 1) } @@ -35336,7 +35362,7 @@ func pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { return rc } -func Xsqlite3PagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:58562:20: */ +func Xsqlite3PagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:59008:20: */ if (nSavepoint > (*Pager)(unsafe.Pointer(pPager)).FnSavepoint) && ((*Pager)(unsafe.Pointer(pPager)).FuseJournal != 0) { return pagerOpenSavepoint(tls, pPager, nSavepoint) @@ -35374,7 +35400,7 @@ func Xsqlite3PagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) // This function may return SQLITE_NOMEM if a memory allocation fails, // or an IO error code if an IO error occurs while rolling back a // savepoint. If no errors occur, SQLITE_OK is returned. -func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:58604:20: */ +func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:59050:20: */ var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode if (rc == SQLITE_OK) && (iSavepoint < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint) { @@ -35391,27 +35417,29 @@ func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint return 1 }())) for ii = nNew; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ { - Xsqlite3BitvecDestroy(tls, (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*48)).FpInSavepoint) + Xsqlite3BitvecDestroy(tls, (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*56)).FpInSavepoint) } (*Pager)(unsafe.Pointer(pPager)).FnSavepoint = nNew // If this is a release of the outermost savepoint, truncate // the sub-journal to zero bytes in size. if op == SAVEPOINT_RELEASE { - if (nNew == 0) && ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fsjfd))).FpMethods != uintptr(0)) { + var pRel uintptr = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(nNew)*56) + if ((*PagerSavepoint)(unsafe.Pointer(pRel)).FbTruncateOnRelease != 0) && ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fsjfd))).FpMethods != uintptr(0)) { // Only truncate if it is an in-memory sub-journal. if Xsqlite3JournalIsInMemory(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd) != 0 { - rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd, int64(0)) + var sz I64 = (I64((Pgno((*Pager)(unsafe.Pointer(pPager)).FpageSize + 4)) * (*PagerSavepoint)(unsafe.Pointer(pRel)).FiSubRec)) + rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd, sz) } - (*Pager)(unsafe.Pointer(pPager)).FnSubRec = U32(0) + (*Pager)(unsafe.Pointer(pPager)).FnSubRec = (*PagerSavepoint)(unsafe.Pointer(pRel)).FiSubRec } } else if ((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) || ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0)) { var pSavepoint uintptr if nNew == 0 { pSavepoint = uintptr(0) } else { - pSavepoint = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr((nNew-1))*48) + pSavepoint = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr((nNew-1))*56) } rc = pagerPlaybackSavepoint(tls, pPager, pSavepoint) @@ -35433,30 +35461,30 @@ func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint // // The return value to this routine is always safe to use with // sqlite3_uri_parameter() and sqlite3_filename_database() and friends. -func Xsqlite3PagerFilename(tls *libc.TLS, pPager uintptr, nullIfMemDb int32) uintptr { /* sqlite3.c:58683:27: */ +func Xsqlite3PagerFilename(tls *libc.TLS, pPager uintptr, nullIfMemDb int32) uintptr { /* sqlite3.c:59131:27: */ if (nullIfMemDb != 0) && ((*Pager)(unsafe.Pointer(pPager)).FmemDb != 0) { return (uintptr(unsafe.Pointer(&zFake)) + 4) } return (*Pager)(unsafe.Pointer(pPager)).FzFilename } -var zFake = [8]int8{int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:58684:21 */ +var zFake = [8]int8{int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:59132:21 */ // Return the VFS structure for the pager. -func Xsqlite3PagerVfs(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58691:28: */ +func Xsqlite3PagerVfs(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59139:28: */ return (*Pager)(unsafe.Pointer(pPager)).FpVfs } // 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 Xsqlite3PagerFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58700:29: */ +func Xsqlite3PagerFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59148:29: */ return (*Pager)(unsafe.Pointer(pPager)).Ffd } // Return the file handle for the journal file (if it exists). // This will be either the rollback journal or the WAL file. -func Xsqlite3PagerJrnlFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58708:29: */ +func Xsqlite3PagerJrnlFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59156:29: */ if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 { return Xsqlite3WalFile(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) } @@ -35464,7 +35492,7 @@ func Xsqlite3PagerJrnlFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c } // Return the full pathname of the journal file. -func Xsqlite3PagerJournalname(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58719:27: */ +func Xsqlite3PagerJournalname(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59167:27: */ return (*Pager)(unsafe.Pointer(pPager)).FzJournal } @@ -35491,7 +35519,7 @@ func Xsqlite3PagerJournalname(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite // // This function may return SQLITE_NOMEM or an IO error code if an error // occurs. Otherwise, it returns SQLITE_OK. -func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno, isCommit int32) int32 { /* sqlite3.c:58749:20: */ +func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno, isCommit int32) int32 { /* sqlite3.c:59197:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -35553,7 +35581,7 @@ func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno if pPgOld != 0 { if int32((*PgHdr)(unsafe.Pointer(pPgOld)).FnRef) > 1 { Xsqlite3PagerUnrefNotNull(tls, pPgOld) - return Xsqlite3CorruptError(tls, 58823) + return Xsqlite3CorruptError(tls, 59271) } *(*U16)(unsafe.Pointer(pPg + 52 /* &.flags */)) |= U16((int32((*PgHdr)(unsafe.Pointer(pPgOld)).Fflags) & PGHDR_NEED_SYNC)) if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 { @@ -35613,21 +35641,21 @@ func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno // 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 Xsqlite3PagerRekey(tls *libc.TLS, pPg uintptr, iNew Pgno, flags U16) { /* sqlite3.c:58887:21: */ +func Xsqlite3PagerRekey(tls *libc.TLS, pPg uintptr, iNew Pgno, flags U16) { /* sqlite3.c:59335:21: */ (*DbPage)(unsafe.Pointer(pPg)).Fflags = flags Xsqlite3PcacheMove(tls, pPg, iNew) } // Return a pointer to the data for the specified page. -func Xsqlite3PagerGetData(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:58896:21: */ +func Xsqlite3PagerGetData(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:59344:21: */ return (*DbPage)(unsafe.Pointer(pPg)).FpData } // Return a pointer to the Pager.nExtra bytes of "extra" space // allocated along with the specified page. -func Xsqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:58905:21: */ +func Xsqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:59353:21: */ return (*DbPage)(unsafe.Pointer(pPg)).FpExtra } @@ -35639,7 +35667,7 @@ func Xsqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:58 // The returned value is either PAGER_LOCKINGMODE_NORMAL or // PAGER_LOCKINGMODE_EXCLUSIVE, indicating the current (possibly updated) // locking-mode. -func Xsqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:58919:20: */ +func Xsqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:59367:20: */ if ((eMode >= 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0)) && !(Xsqlite3WalHeapMemory(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) != 0) { (*Pager)(unsafe.Pointer(pPager)).FexclusiveMode = U8(eMode) @@ -35665,7 +35693,7 @@ func Xsqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 // * Temporary databases cannot have _WAL journalmode. // // The returned indicate the current (possibly updated) journal-mode. -func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:58952:20: */ +func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:59400:20: */ var eOld U8 = (*Pager)(unsafe.Pointer(pPager)).FjournalMode // Prior journalmode // The eMode parameter is always valid @@ -35736,14 +35764,14 @@ func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int } // Return the current journal mode. -func Xsqlite3PagerGetJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59043:20: */ +func Xsqlite3PagerGetJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59491:20: */ return int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) } // 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 Xsqlite3PagerOkToChangeJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59052:20: */ +func Xsqlite3PagerOkToChangeJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59500:20: */ if int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_CACHEMOD { return 0 @@ -35758,7 +35786,7 @@ func Xsqlite3PagerOkToChangeJournalMode(tls *libc.TLS, pPager uintptr) int32 { / // // 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 Xsqlite3PagerJournalSizeLimit(tls *libc.TLS, pPager uintptr, iLimit I64) I64 { /* sqlite3.c:59065:20: */ +func Xsqlite3PagerJournalSizeLimit(tls *libc.TLS, pPager uintptr, iLimit I64) I64 { /* sqlite3.c:59513:20: */ if iLimit >= int64(-1) { (*Pager)(unsafe.Pointer(pPager)).FjournalSizeLimit = iLimit Xsqlite3WalLimit(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, iLimit) @@ -35770,12 +35798,12 @@ func Xsqlite3PagerJournalSizeLimit(tls *libc.TLS, pPager uintptr, iLimit I64) I6 // in backup.c maintains the content of this variable. This module // uses it opaquely as an argument to sqlite3BackupRestart() and // sqlite3BackupUpdate() only. -func Xsqlite3PagerBackupPtr(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59079:31: */ +func Xsqlite3PagerBackupPtr(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59527:31: */ return (pPager + 112 /* &.pBackup */) } // Unless this is an in-memory or temporary database, clear the pager cache. -func Xsqlite3PagerClearCache(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:59087:21: */ +func Xsqlite3PagerClearCache(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:59535:21: */ if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 { pager_reset(tls, pPager) @@ -35787,7 +35815,7 @@ func Xsqlite3PagerClearCache(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:59087 // or wal_blocking_checkpoint() API functions. // // Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART. -func Xsqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:59102:20: */ +func Xsqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:59550:20: */ var rc int32 = SQLITE_OK if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 { rc = Xsqlite3WalCheckpoint(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, db, eMode, @@ -35804,13 +35832,13 @@ func Xsqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in return rc } -func Xsqlite3PagerWalCallback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59121:20: */ +func Xsqlite3PagerWalCallback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59569:20: */ return Xsqlite3WalCallback(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) } // Return true if the underlying VFS for the given pager supports the // primitives necessary for write-ahead logging. -func Xsqlite3PagerWalSupported(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59129:20: */ +func Xsqlite3PagerWalSupported(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59577:20: */ var pMethods uintptr = (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods if (*Pager)(unsafe.Pointer(pPager)).FnoLock != 0 { return 0 @@ -35820,7 +35848,7 @@ func Xsqlite3PagerWalSupported(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3 // Attempt to take an exclusive lock on the database file. If a PENDING lock // is obtained instead, immediately release it. -func pagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59139:12: */ +func pagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59587:12: */ var rc int32 // Return code rc = pagerLockDb(tls, pPager, EXCLUSIVE_LOCK) @@ -35837,7 +35865,7 @@ func pagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5913 // 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 *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59159:12: */ +func pagerOpenWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59607:12: */ var rc int32 = SQLITE_OK // If the pager is already in exclusive-mode, the WAL module will use @@ -35873,7 +35901,7 @@ func pagerOpenWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59159:12: // 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 Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 { /* sqlite3.c:59204:20: */ +func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 { /* sqlite3.c:59652:20: */ var rc int32 = SQLITE_OK // Return code if !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FpWal) != 0) { @@ -35886,8 +35914,8 @@ func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 { rc = pagerOpenWal(tls, pPager) if rc == SQLITE_OK { - (*Pager)(unsafe.Pointer(pPager)).FjournalMode = PAGER_JOURNALMODE_WAL - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FjournalMode = U8(PAGER_JOURNALMODE_WAL) + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } } else { *(*int32)(unsafe.Pointer(pbOpen)) = 1 @@ -35903,7 +35931,7 @@ func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 { // 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 Xsqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:59243:20: */ +func Xsqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:59691:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -35943,7 +35971,7 @@ func Xsqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* // If this is a WAL database, obtain a snapshot handle for the snapshot // currently open. Otherwise, return an error. -func Xsqlite3PagerSnapshotGet(tls *libc.TLS, pPager uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:59312:20: */ +func Xsqlite3PagerSnapshotGet(tls *libc.TLS, pPager uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:59760:20: */ var rc int32 = SQLITE_ERROR if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 { rc = Xsqlite3WalSnapshotGet(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, ppSnapshot) @@ -35954,7 +35982,7 @@ func Xsqlite3PagerSnapshotGet(tls *libc.TLS, pPager uintptr, ppSnapshot uintptr) // If this is a WAL database, store a pointer to pSnapshot. Next time a // read transaction is opened, attempt to read from the snapshot it // identifies. If this is not a WAL database, return an error. -func Xsqlite3PagerSnapshotOpen(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:59325:20: */ +func Xsqlite3PagerSnapshotOpen(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:59773:20: */ var rc int32 = SQLITE_OK if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 { Xsqlite3WalSnapshotOpen(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSnapshot) @@ -35966,7 +35994,7 @@ func Xsqlite3PagerSnapshotOpen(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) // If this is a WAL database, call sqlite3WalSnapshotRecover(). If this // is not a WAL database, return an error. -func Xsqlite3PagerSnapshotRecover(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59342:20: */ +func Xsqlite3PagerSnapshotRecover(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59790:20: */ var rc int32 if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 { rc = Xsqlite3WalSnapshotRecover(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) @@ -35986,7 +36014,7 @@ func Xsqlite3PagerSnapshotRecover(tls *libc.TLS, pPager uintptr) int32 { /* sqli // the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error // occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER // lock is released before returning. -func Xsqlite3PagerSnapshotCheck(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:59364:20: */ +func Xsqlite3PagerSnapshotCheck(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:59812:20: */ var rc int32 if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 { rc = Xsqlite3WalSnapshotCheck(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSnapshot) @@ -35998,7 +36026,7 @@ func Xsqlite3PagerSnapshotCheck(tls *libc.TLS, pPager uintptr, pSnapshot uintptr // Release a lock obtained by an earlier successful call to // sqlite3PagerSnapshotCheck(). -func Xsqlite3PagerSnapshotUnlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:59378:21: */ +func Xsqlite3PagerSnapshotUnlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:59826:21: */ Xsqlite3WalSnapshotUnlock(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) } @@ -36292,7 +36320,7 @@ type WalIndexHdr1 = struct { FaFrameCksum [2]U32 FaSalt [2]U32 FaCksum [2]U32 -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ //************* End of pager.c ********************************************** //************* Begin file wal.c ******************************************** @@ -36571,7 +36599,7 @@ type WalIndexHdr1 = struct { // byte. // Object declarations -type WalIndexHdr = WalIndexHdr1 /* sqlite3.c:59703:28 */ +type WalIndexHdr = WalIndexHdr1 /* sqlite3.c:60151:28 */ type WalIterator1 = struct { FiPrior U32 FnSegment int32 @@ -36583,18 +36611,18 @@ type WalIterator1 = struct { FnEntry int32 FiZero int32 } -} /* sqlite3.c:59704:9 */ +} /* sqlite3.c:60152:9 */ -type WalIterator = WalIterator1 /* sqlite3.c:59704:28 */ +type WalIterator = WalIterator1 /* sqlite3.c:60152:28 */ type WalCkptInfo1 = struct { FnBackfill U32 FaReadMark [5]U32 FaLock [8]U8 FnBackfillAttempted U32 FnotUsed0 U32 -} /* sqlite3.c:59705:9 */ +} /* sqlite3.c:60153:9 */ -type WalCkptInfo = WalCkptInfo1 /* sqlite3.c:59705:28 */ +type WalCkptInfo = WalCkptInfo1 /* sqlite3.c:60153:28 */ // Candidate values for Wal.exclusiveMode. @@ -36602,7 +36630,7 @@ type WalCkptInfo = WalCkptInfo1 /* sqlite3.c:59705:28 */ // Each page of the wal-index mapping contains a hash-table made up of // an array of HASHTABLE_NSLOT elements of the following type. -type Ht_slot = U16 /* sqlite3.c:59896:13 */ +type Ht_slot = U16 /* sqlite3.c:60344:13 */ // This structure is used to implement an iterator that loops through // all frames in the WAL in database page order. Where two or more frames @@ -36624,7 +36652,7 @@ type WalSegment = struct { FaPgno uintptr FnEntry int32 FiZero int32 -} /* sqlite3.c:59704:9 */ +} /* sqlite3.c:60152:9 */ // Define the parameters of the hash tables in the wal-index file. There // is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -36651,7 +36679,7 @@ type WalSegment = struct { // 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 walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:59963:28: */ +func walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:60411:28: */ var rc int32 = SQLITE_OK // Enlarge the pWal->apWiData[] array if required @@ -36672,12 +36700,12 @@ func walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintpt // Request a pointer to the required page from the VFS if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE { - *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = Xsqlite3MallocZero(tls, ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))) + *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = Xsqlite3MallocZero(tls, ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))) if !(int32(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8))) != 0) { rc = SQLITE_NOMEM } } else { - rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, iPage, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))), + rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, iPage, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))), int32((*Wal)(unsafe.Pointer(pWal)).FwriteLock), ((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) if rc == SQLITE_OK { @@ -36697,7 +36725,7 @@ func walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintpt return rc } -func walIndexPage(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:60010:12: */ +func walIndexPage(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:60458:12: */ if ((*Wal)(unsafe.Pointer(pWal)).FnWiData <= iPage) || ((libc.AssignPtrUintptr(libc.AtomicLoadUintptr(&ppPage), *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)))) == uintptr(0)) { return walIndexPageRealloc(tls, pWal, iPage, libc.AtomicLoadUintptr(&ppPage)) } @@ -36705,13 +36733,13 @@ func walIndexPage(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int3 } // Return a pointer to the WalCkptInfo structure in the wal-index. -func walCkptInfo(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60024:29: */ +func walCkptInfo(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60472:29: */ return (*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) + 24*4) } // Return a pointer to the WalIndexHdr structure in the wal-index. -func walIndexHdr(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60032:29: */ +func walIndexHdr(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60480:29: */ return *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) } @@ -36729,7 +36757,7 @@ func walIndexHdr(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60032:29: * // The checksum is written back into aOut[] before returning. // // nByte must be a positive multiple of 8. -func walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, aIn uintptr, aOut uintptr) { /* sqlite3.c:60058:13: */ +func walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, aIn uintptr, aOut uintptr) { /* sqlite3.c:60506:13: */ var s1 U32 var s2 U32 var aData uintptr = a @@ -36761,7 +36789,7 @@ func walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, // If there is the possibility of concurrent access to the SHM file // from multiple threads and/or processes, then do a memory barrier. -func walShmBarrier(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60101:13: */ +func walShmBarrier(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60549:13: */ if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) != WAL_HEAPMEMORY_MODE { Xsqlite3OsShmBarrier(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd) } @@ -36776,12 +36804,12 @@ func walShmBarrier(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60101:13: */ // 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 *libc.TLS, pWal uintptr) { /* sqlite3.c:60125:28: */ +func walIndexWriteHdr(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60573:28: */ var aHdr uintptr = walIndexHdr(tls, pWal) var nCksum int32 = int32((uintptr(0) + 40 /* &.aCksum */)) (*Wal)(unsafe.Pointer(pWal)).Fhdr.FisInit = U8(1) - (*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion = WALINDEX_MAX_VERSION + (*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion = U32(WALINDEX_MAX_VERSION) walChecksumBytes(tls, 1, (pWal + 72 /* &.hdr */), nCksum, uintptr(0), pWal+72 /* &.hdr */ +40 /* &.aCksum */) // Possible TSAN false-positive. See tag-20200519-1 libc.Xmemcpy(tls, (libc.AtomicLoadUintptr(&aHdr) + 1*48), (pWal + 72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{}))) @@ -36800,7 +36828,7 @@ func walIndexWriteHdr(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60125:28: */ // 12: Salt-2 (copied from the wal-header) // 16: Checksum-1. // 20: Checksum-2. -func walEncodeFrame(tls *libc.TLS, pWal uintptr, iPage U32, nTruncate U32, aData uintptr, aFrame uintptr) { /* sqlite3.c:60152:13: */ +func walEncodeFrame(tls *libc.TLS, pWal uintptr, iPage U32, nTruncate U32, aData uintptr, aFrame uintptr) { /* sqlite3.c:60600:13: */ var nativeCksum int32 // True for native byte-order checksums var aCksum uintptr = pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */ @@ -36823,7 +36851,7 @@ func walEncodeFrame(tls *libc.TLS, pWal uintptr, iPage U32, nTruncate U32, aData // 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 *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uintptr, aData uintptr, aFrame uintptr) int32 { /* sqlite3.c:60183:12: */ +func walDecodeFrame(tls *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uintptr, aData uintptr, aFrame uintptr) int32 { /* sqlite3.c:60631:12: */ var nativeCksum int32 // True for native byte-order checksums var aCksum uintptr = pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */ var pgno U32 // Page number of the frame @@ -36865,7 +36893,7 @@ func walDecodeFrame(tls *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uint // through the unlocked state first. // // In locking_mode=EXCLUSIVE, all of these routines become no-ops. -func walLockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) int32 { /* sqlite3.c:60262:12: */ +func walLockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) int32 { /* sqlite3.c:60710:12: */ var rc int32 if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 { return SQLITE_OK @@ -36876,7 +36904,7 @@ func walLockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) int32 { /* sqlite return rc } -func walUnlockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) { /* sqlite3.c:60272:13: */ +func walUnlockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) { /* sqlite3.c:60720:13: */ if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 { return } @@ -36885,7 +36913,7 @@ func walUnlockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) { /* sqlite3.c: } -func walLockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:60278:12: */ +func walLockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:60726:12: */ var rc int32 if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 { return SQLITE_OK @@ -36896,7 +36924,7 @@ func walLockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) int32 return rc } -func walUnlockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) { /* sqlite3.c:60288:13: */ +func walUnlockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) { /* sqlite3.c:60736:13: */ if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 { return } @@ -36908,12 +36936,12 @@ func walUnlockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) { / // 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 *libc.TLS, iPage U32) int32 { /* sqlite3.c:60301:12: */ +func walHash(tls *libc.TLS, iPage U32) int32 { /* sqlite3.c:60749:12: */ - return (int32((iPage * HASHTABLE_HASH_1) & (U32((HASHTABLE_NPAGE * 2) - 1)))) + return (int32((iPage * U32(HASHTABLE_HASH_1)) & (U32((HASHTABLE_NPAGE * 2) - 1)))) } -func walNextHash(tls *libc.TLS, iPriorHash int32) int32 { /* sqlite3.c:60306:12: */ +func walNextHash(tls *libc.TLS, iPriorHash int32) int32 { /* sqlite3.c:60754:12: */ return ((iPriorHash + 1) & ((HASHTABLE_NPAGE * 2) - 1)) } @@ -36925,12 +36953,12 @@ type WalHashLoc1 = struct { FaPgno uintptr FiZero U32 _ [4]byte -} /* sqlite3.c:60315:9 */ +} /* sqlite3.c:60763:9 */ // An instance of the WalHashLoc object is used to describe the location // of a page hash table in the wal-index. This becomes the return value // from walHashGet(). -type WalHashLoc = WalHashLoc1 /* sqlite3.c:60315:27 */ +type WalHashLoc = WalHashLoc1 /* sqlite3.c:60763:27 */ // 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 @@ -36944,7 +36972,7 @@ type WalHashLoc = WalHashLoc1 /* sqlite3.c:60315:27 */ // // Finally, set pLoc->aPgno so that pLoc->aPgno[1] is the page number of the // first frame indexed by the hash table, frame (pLoc->iZero+1). -func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { /* sqlite3.c:60336:12: */ +func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { /* sqlite3.c:60784:12: */ var rc int32 // Return code rc = walIndexPage(tls, pWal, iHash, (pLoc + 8 /* &.aPgno */)) @@ -36955,7 +36983,7 @@ func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = ((*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + 34*4) (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = U32(0) } else { - (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = (U32((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iHash - 1) * HASHTABLE_NPAGE)))) + (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = (U32((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iHash - 1) * HASHTABLE_NPAGE)))) } (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = ((*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + libc.UintptrFromInt32(-1)*4) } @@ -36966,19 +36994,19 @@ func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { // 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 *libc.TLS, iFrame U32) int32 { /* sqlite3.c:60365:12: */ - var iHash int32 = (int32((((uint64(iFrame + HASHTABLE_NPAGE)) - (HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0)))))) - uint64(1)) / HASHTABLE_NPAGE)) +func walFramePage(tls *libc.TLS, iFrame U32) int32 { /* sqlite3.c:60813:12: */ + var iHash int32 = (int32((((uint64(iFrame + U32(HASHTABLE_NPAGE))) - (uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0)))))) - uint64(1)) / uint64(HASHTABLE_NPAGE))) return iHash } // Return the page number associated with frame iFrame in this WAL. -func walFramePgno(tls *libc.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:60380:12: */ +func walFramePgno(tls *libc.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:60828:12: */ var iHash int32 = walFramePage(tls, iFrame) if iHash == 0 { return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) + uintptr((((((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2))+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))))+uint64(iFrame))-uint64(1)))*4)) } - return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iHash)*8)) + uintptr((((uint64(iFrame-U32(1)))-(HASHTABLE_NPAGE-(((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2))+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))))))%HASHTABLE_NPAGE))*4)) + return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iHash)*8)) + uintptr((((uint64(iFrame-U32(1)))-(uint64(HASHTABLE_NPAGE)-(((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2))+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))))))%uint64(HASHTABLE_NPAGE)))*4)) } // Remove entries from the hash table that point to WAL slots greater @@ -36991,7 +37019,7 @@ func walFramePgno(tls *libc.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:60 // 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 *libc.TLS, pWal uintptr) { /* sqlite3.c:60400:13: */ +func walCleanupHash(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60848:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -37034,7 +37062,7 @@ func walCleanupHash(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60400:13: */ // Set an entry in the wal-index that will map database page number // pPage into WAL frame iFrame. -func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { /* sqlite3.c:60462:12: */ +func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { /* sqlite3.c:60910:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -37075,7 +37103,7 @@ func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { nCollide = idx for iKey = walHash(tls, iPage); *(*Ht_slot)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash + uintptr(iKey)*2)) != 0; iKey = walNextHash(tls, iKey) { if (libc.PostDecInt32(&nCollide, 1)) == 0 { - return Xsqlite3CorruptError(tls, 60502) + return Xsqlite3CorruptError(tls, 60950) } } *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr(idx)*4)) = iPage @@ -37094,7 +37122,7 @@ func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { // 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 *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:60552:12: */ +func walIndexRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:61000:12: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -37157,7 +37185,7 @@ __1: __2: ; - if !(*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) > WAL_HDRSIZE) { + if !(*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) > int64(WAL_HDRSIZE)) { goto __3 } // Buffer to load WAL header into aPrivate = uintptr(0) // Heap copy of *-shm hash being populated @@ -37178,7 +37206,7 @@ __4: // WAL file. magic = Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */)) szPage = int32(Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */ + 8))) - if !(((((magic & 0xFFFFFFFE) != WAL_MAGIC) || + if !(((((magic & 0xFFFFFFFE) != U32(WAL_MAGIC)) || ((szPage & (szPage - 1)) != 0)) || (szPage > SQLITE_MAX_PAGE_SIZE)) || (szPage < 512)) { @@ -37206,17 +37234,17 @@ __6: // Verify that the version number on the WAL format is one that // are able to understand version = Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */ + 4)) - if !(version != WAL_MAX_VERSION) { + if !(version != U32(WAL_MAX_VERSION)) { goto __7 } - rc = Xsqlite3CantopenError(tls, 60635) + rc = Xsqlite3CantopenError(tls, 61083) goto finished __7: ; // Malloc a buffer to read frames into. szFrame = (szPage + WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, (uint64(uint64(szFrame) + ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))))) + aFrame = Xsqlite3_malloc64(tls, (uint64(uint64(szFrame) + ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))))) if !(!(aFrame != 0)) { goto __8 } @@ -37228,23 +37256,23 @@ __8: aPrivate = (aData + uintptr(szPage)) // Read all frames from the log file. - iLastFrame = (U32((*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) - WAL_HDRSIZE) / I64(szFrame))) + iLastFrame = (U32((*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) - int64(WAL_HDRSIZE)) / I64(szFrame))) iPg = U32(0) __9: if !(iPg <= U32(walFramePage(tls, iLastFrame))) { goto __11 } // Index of last frame read iLast = func() uint32 { - if (uint64(iLastFrame)) < ((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * HASHTABLE_NPAGE))) { + if (uint64(iLastFrame)) < ((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * U32(HASHTABLE_NPAGE)))) { return iLastFrame } - return (uint32((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * HASHTABLE_NPAGE)))) + return (uint32((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * U32(HASHTABLE_NPAGE))))) }() iFirst = (U32(uint64(1) + (func() uint64 { if iPg == U32(0) { return uint64(0) } - return ((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iPg - U32(1)) * HASHTABLE_NPAGE))) + return ((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iPg - U32(1)) * U32(HASHTABLE_NPAGE)))) }()))) rc = walIndexPage(tls, pWal, int32(iPg), bp+56 /* &aShare */) if !(rc != 0) { @@ -37260,7 +37288,7 @@ __13: if !(iFrame <= iLast) { goto __15 } - iOffset = (WAL_HDRSIZE + ((I64((iFrame) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) // dbsize field from frame header + iOffset = (int64(WAL_HDRSIZE) + ((I64((iFrame) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) // dbsize field from frame header // Read and decode the next log frame. rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aFrame, szFrame, iOffset) @@ -37319,7 +37347,7 @@ __15: // do that, according to the spec, but no memcpy() implementation that // we know of actually does that, which is why we say that memcpy() // is safe for this. Memcpy() is certainly a lot faster. - libc.Xmemcpy(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */)) + uintptr(nHdr32)*4), (aPrivate + uintptr(nHdr32)*4), (((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0))))) - uint64(nHdr))) + libc.Xmemcpy(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */)) + uintptr(nHdr32)*4), (aPrivate + uintptr(nHdr32)*4), (((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0))))) - uint64(nHdr))) if !(iFrame <= iLast) { goto __20 } @@ -37398,7 +37426,7 @@ __24: goto __30 } Xsqlite3_log(tls, (SQLITE_NOTICE | (int32(1) << 8)), - ts+2920, /* "recovered %d fra..." */ + ts+2948, /* "recovered %d fra..." */ libc.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame, (*Wal)(unsafe.Pointer(pWal)).FzWalName)) __30: ; @@ -37412,7 +37440,7 @@ recovery_error: } // Close an open wal-index. -func walIndexClose(tls *libc.TLS, pWal uintptr, isDelete int32) { /* sqlite3.c:60774:13: */ +func walIndexClose(tls *libc.TLS, pWal uintptr, isDelete int32) { /* sqlite3.c:61222:13: */ if (int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE) || ((*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0) { var i int32 for i = 0; i < (*Wal)(unsafe.Pointer(pWal)).FnWiData; i++ { @@ -37438,7 +37466,7 @@ func walIndexClose(tls *libc.TLS, pWal uintptr, isDelete int32) { /* sqlite3.c:6 // 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 Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintptr, bNoShm int32, mxWalSize I64, ppWal uintptr) int32 { /* sqlite3.c:60802:20: */ +func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintptr, bNoShm int32, mxWalSize I64, ppWal uintptr) int32 { /* sqlite3.c:61250:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -37470,16 +37498,16 @@ func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt (*Wal)(unsafe.Pointer(pRet)).FpadToSectorBoundary = U8(1) (*Wal)(unsafe.Pointer(pRet)).FexclusiveMode = func() uint8 { if bNoShm != 0 { - return WAL_HEAPMEMORY_MODE + return uint8(WAL_HEAPMEMORY_MODE) } - return WAL_NORMAL_MODE + return uint8(WAL_NORMAL_MODE) }() // Open file handle on the write-ahead log file. *(*int32)(unsafe.Pointer(bp /* flags */)) = ((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_WAL) rc = Xsqlite3OsOpen(tls, pVfs, zWalName, (*Wal)(unsafe.Pointer(pRet)).FpWalFd, *(*int32)(unsafe.Pointer(bp /* flags */)), bp /* &flags */) if (rc == SQLITE_OK) && ((*(*int32)(unsafe.Pointer(bp /* flags */)) & SQLITE_OPEN_READONLY) != 0) { - (*Wal)(unsafe.Pointer(pRet)).FreadOnly = WAL_RDONLY + (*Wal)(unsafe.Pointer(pRet)).FreadOnly = U8(WAL_RDONLY) } if rc != SQLITE_OK { @@ -37501,7 +37529,7 @@ func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt } // Change the size to which the WAL file is trucated on each reset. -func Xsqlite3WalLimit(tls *libc.TLS, pWal uintptr, iLimit I64) { /* sqlite3.c:60876:21: */ +func Xsqlite3WalLimit(tls *libc.TLS, pWal uintptr, iLimit I64) { /* sqlite3.c:61324:21: */ if pWal != 0 { (*Wal)(unsafe.Pointer(pWal)).FmxWalSize = iLimit } @@ -37515,7 +37543,7 @@ func Xsqlite3WalLimit(tls *libc.TLS, pWal uintptr, iLimit I64) { /* sqlite3.c:60 // // 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 *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr) int32 { /* sqlite3.c:60890:12: */ +func walIteratorNext(tls *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr) int32 { /* sqlite3.c:61338:12: */ var iMin U32 // Result pgno must be greater than iMin var iRet U32 = 0xFFFFFFFF // 0xffffffff is never a valid page number var i int32 // For looping through segments @@ -37562,7 +37590,7 @@ func walIteratorNext(tls *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr) // aLeft[X]!=aRight[Y] && aContent[aLeft[X]] == aContent[aRight[Y]] // // When that happens, omit the aLeft[X] and use the aRight[Y] index. -func walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRight uintptr, pnRight uintptr, aTmp uintptr) { /* sqlite3.c:60943:13: */ +func walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRight uintptr, pnRight uintptr, aTmp uintptr) { /* sqlite3.c:61391:13: */ var iLeft int32 = 0 // Current index in aLeft var iRight int32 = 0 // Current index in aRight var iOut int32 = 0 // Current index in output buffer @@ -37608,7 +37636,7 @@ func walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRig // // Keep the larger of the two values aList[X] and aList[Y] and discard // the smaller. -func walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintptr, pnList uintptr) { /* sqlite3.c:61000:13: */ +func walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintptr, pnList uintptr) { /* sqlite3.c:61448:13: */ bp := tls.Alloc(220) defer tls.Free(220) @@ -37654,10 +37682,10 @@ type Sublist = struct { FnList int32 _ [4]byte FaList uintptr -} /* sqlite3.c:61006:3 */ +} /* sqlite3.c:61454:3 */ // Free an iterator allocated by walIteratorInit(). -func walIteratorFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:61063:13: */ +func walIteratorFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:61511:13: */ Xsqlite3_free(tls, p) } @@ -37672,7 +37700,7 @@ func walIteratorFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:61063:13: */ // // The calling routine should invoke walIteratorFree() to destroy the // WalIterator object when it has finished with it. -func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int32 { /* sqlite3.c:61080:12: */ +func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int32 { /* sqlite3.c:61528:12: */ bp := tls.Alloc(28) defer tls.Free(28) @@ -37705,8 +37733,8 @@ func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int // of memory will be freed before this function returns. aTmp = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(Ht_slot(0))) * (func() uint64 { - if iLast > HASHTABLE_NPAGE { - return HASHTABLE_NPAGE + if iLast > U32(HASHTABLE_NPAGE) { + return uint64(HASHTABLE_NPAGE) } return uint64(iLast) }())))) @@ -37757,7 +37785,7 @@ func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int // 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 *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:61244:12: */ +func walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:61692:12: */ var rc int32 for ok := true; ok; ok = (((xBusy != 0) && (rc == SQLITE_BUSY)) && ((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&xBusy)))(tls, pBusyArg) != 0)) { rc = walLockExclusive(tls, pWal, lockIdx, n) @@ -37767,7 +37795,7 @@ func walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, l // 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 *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:61268:12: */ +func walPagesize(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:61716:12: */ return ((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) & 0xfe00) + ((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) & 0x0001) << 16)) } @@ -37786,7 +37814,7 @@ func walPagesize(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:61268:12: */ // 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 *libc.TLS, pWal uintptr, salt1 U32) { /* sqlite3.c:61289:13: */ +func walRestartHdr(tls *libc.TLS, pWal uintptr, salt1 U32) { /* sqlite3.c:61737:13: */ bp := tls.Alloc(4) defer tls.Free(4) *(*U32)(unsafe.Pointer(bp)) = salt1 @@ -37837,7 +37865,7 @@ func walRestartHdr(tls *libc.TLS, pWal uintptr, salt1 U32) { /* sqlite3.c:61289: // 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 *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) int32 { /* sqlite3.c:61336:12: */ +func walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) int32 { /* sqlite3.c:61784:12: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -37968,7 +37996,7 @@ __10: // database plus the amount of data in the wal file, plus the // maximum size of the pending-byte page (65536 bytes), then // must be corruption somewhere. - rc = Xsqlite3CorruptError(tls, 61420) + rc = Xsqlite3CorruptError(tls, 61868) goto __15 __14: Xsqlite3OsFileControlHint(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_FCNTL_SIZE_HINT, bp+16 /* &nReq */) @@ -37986,7 +38014,7 @@ __16: goto __17 } - if !(libc.AtomicLoadNInt32((db+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { + if !(libc.AtomicLoadNInt32((db+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { goto __18 } if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -38003,7 +38031,7 @@ __18: goto __16 __19: ; - iOffset = ((WAL_HDRSIZE + ((I64((*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + iOffset = ((int64(WAL_HDRSIZE) + ((I64((*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) // testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL file rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, zBuf, szPage, iOffset) if !(rc != SQLITE_OK) { @@ -38129,7 +38157,7 @@ walcheckpoint_out: // 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 *libc.TLS, pWal uintptr, nMax I64) { /* sqlite3.c:61522:13: */ +func walLimitSize(tls *libc.TLS, pWal uintptr, nMax I64) { /* sqlite3.c:61970:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -38143,12 +38171,12 @@ func walLimitSize(tls *libc.TLS, pWal uintptr, nMax I64) { /* sqlite3.c:61522:13 } Xsqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, ts+2957 /* "cannot limit WAL..." */, libc.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, ts+2985 /* "cannot limit WAL..." */, libc.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).FzWalName)) } } // Close a connection to a log file. -func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:61539:20: */ +func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:61987:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -38166,7 +38194,7 @@ func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, if (zBuf != uintptr(0)) && (SQLITE_OK == (libc.AssignInt32(&rc, Xsqlite3OsLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_LOCK_EXCLUSIVE)))) { if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE { - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_EXCLUSIVE_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE) } rc = Xsqlite3WalCheckpoint(tls, pWal, db, SQLITE_CHECKPOINT_PASSIVE, uintptr(0), uintptr(0), sync_flags, nBuf, zBuf, uintptr(0), uintptr(0)) @@ -38220,7 +38248,7 @@ func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, // // If the checksum cannot be verified return non-zero. If the header // is read successfully and the checksum verified, return zero. -func walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:61620:27: */ +func walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62068:27: */ bp := tls.Alloc(104) defer tls.Free(104) @@ -38289,7 +38317,7 @@ func walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sq // // If the wal-index header is successfully read, return SQLITE_OK. // Otherwise an SQLite error code. -func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:61690:12: */ +func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62138:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -38313,7 +38341,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s // and there is no writer on hand to fix it. (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable = U8(1) - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_HEAPMEMORY_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_HEAPMEMORY_MODE) *(*int32)(unsafe.Pointer(pChanged)) = 1 } else { return rc // Any other non-OK return is just an error @@ -38368,8 +38396,8 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s // If the header is read successfully, check the version number to make // sure the wal-index was not constructed with some future format that // this version of SQLite cannot understand. - if (badHdr == 0) && ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != WALINDEX_MAX_VERSION) { - rc = Xsqlite3CantopenError(tls, 61769) + if (badHdr == 0) && ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != U32(WALINDEX_MAX_VERSION)) { + rc = Xsqlite3CantopenError(tls, 62217) } if (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -38383,7 +38411,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s rc = -1 } } - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_NORMAL_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_NORMAL_MODE) } return rc @@ -38414,7 +38442,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s // beginning (including attempting to map the *-shm file). // // If an error occurs, an SQLite error code is returned. -func walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:61814:12: */ +func walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62262:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -38477,7 +38505,7 @@ __1: // even if some external agent does a "chmod" to make the shared-memory // writable by us, until sqlite3OsShmUnmap() has been called. // This is a requirement on the VFS implementation. - rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 0, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))), 0, bp /* &pDummy */) + rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 0, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))), 0, bp /* &pDummy */) // SQLITE_OK not possible for read-only connection if !(rc != (SQLITE_READONLY | (int32(5) << 8))) { goto __3 @@ -38506,7 +38534,7 @@ __3: goto begin_unreliable_shm_out __4: ; - if !(*(*I64)(unsafe.Pointer(bp + 8 /* szWal */)) < WAL_HDRSIZE) { + if !(*(*I64)(unsafe.Pointer(bp + 8 /* szWal */)) < int64(WAL_HDRSIZE)) { goto __5 } // If the wal file is too small to contain a wal-header and the @@ -38563,7 +38591,7 @@ __8: // the caller. *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */ + 1*4)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) - iOffset = (WAL_HDRSIZE + ((I64(((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame + U32(1)) - U32(1))) * (I64((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)) + WAL_FRAME_HDRSIZE)))) + iOffset = (int64(WAL_HDRSIZE) + ((I64(((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame + U32(1)) - U32(1))) * (I64((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)) + WAL_FRAME_HDRSIZE)))) __9: if !((iOffset + I64(szFrame)) <= *(*I64)(unsafe.Pointer(bp + 8 /* szWal */))) { goto __11 @@ -38679,7 +38707,7 @@ __15: // 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 *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32, cnt int32) int32 { /* sqlite3.c:62009:12: */ +func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32, cnt int32) int32 { /* sqlite3.c:62457:12: */ var pInfo uintptr // Checkpoint information in wal-index var mxReadMark U32 // Largest aReadMark[] value var mxI int32 // Index of largest aReadMark[] value @@ -38896,7 +38924,7 @@ func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32 // SQLITE_OK is returned if successful, or an SQLite error code if an // error occurs. It is not an error if nBackfillAttempted cannot be // decreased at all. -func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62239:20: */ +func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62687:20: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -38932,7 +38960,7 @@ func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3. iDbOff = ((I64(pgno - U32(1))) * I64(szPage)) if (iDbOff + I64(szPage)) <= *(*I64)(unsafe.Pointer(bp /* szDb */)) { - iWalOff = ((WAL_HDRSIZE + ((I64((i) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + iWalOff = ((int64(WAL_HDRSIZE) + ((I64((i) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pBuf1, szPage, iWalOff) if rc == SQLITE_OK { @@ -38969,7 +38997,7 @@ func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3. // transaction, then *pChanged is set to 1 before returning. The // Pager layer will use this to know that its cache is stale and // needs to be flushed. -func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62309:20: */ +func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62757:20: */ var rc int32 // Return code var cnt int32 = 0 // Number of TryBeginRead attempts var bChanged int32 = 0 @@ -39057,7 +39085,7 @@ func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // Finish with a read transaction. All this does is release the // read-lock. -func Xsqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:62417:21: */ +func Xsqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:62865:21: */ Xsqlite3WalEndWriteTransaction(tls, pWal) if int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { walUnlockShared(tls, pWal, (3 + (int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)))) @@ -39071,7 +39099,7 @@ func Xsqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:6 // // 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 Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr) int32 { /* sqlite3.c:62433:20: */ +func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr) int32 { /* sqlite3.c:62881:20: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -39138,7 +39166,7 @@ func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr iRead = iFrame } if (libc.PostDecInt32(&nCollide, 1)) == 0 { - return Xsqlite3CorruptError(tls, 62503) + return Xsqlite3CorruptError(tls, 62951) } iKey = walNextHash(tls, iKey) } @@ -39154,13 +39182,13 @@ func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr // 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 Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 { /* sqlite3.c:62537:20: */ +func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 { /* sqlite3.c:62985:20: */ var sz int32 var iOffset I64 sz = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) sz = ((sz & 0xfe00) + ((sz & 0x0001) << 16)) - iOffset = ((WAL_HDRSIZE + ((I64((iRead) - U32(1))) * (I64((sz) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + iOffset = ((int64(WAL_HDRSIZE) + ((I64((iRead) - U32(1))) * (I64((sz) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) // testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL return Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pOut, func() int32 { if nOut > sz { @@ -39171,7 +39199,7 @@ func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pO } // Return the size of the database in pages (or zero, if unknown). -func Xsqlite3WalDbsize(tls *libc.TLS, pWal uintptr) Pgno { /* sqlite3.c:62557:21: */ +func Xsqlite3WalDbsize(tls *libc.TLS, pWal uintptr) Pgno { /* sqlite3.c:63005:21: */ if (pWal != 0) && (int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) >= 0) { return (*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage } @@ -39189,7 +39217,7 @@ func Xsqlite3WalDbsize(tls *libc.TLS, pWal uintptr) Pgno { /* sqlite3.c:62557:21 // returns SQLITE_BUSY in that case and no write transaction is started. // // There can only be a single writer active at a time. -func Xsqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62578:20: */ +func Xsqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63026:20: */ var rc int32 // Cannot start a write transaction without first holding a read @@ -39221,7 +39249,7 @@ func Xsqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sq // End a write transaction. The commit has already been done. This // routine merely releases the lock. -func Xsqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62626:20: */ +func Xsqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63074:20: */ if (*Wal)(unsafe.Pointer(pWal)).FwriteLock != 0 { walUnlockExclusive(tls, pWal, WAL_WRITE_LOCK, 1) (*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(0) @@ -39241,7 +39269,7 @@ func Xsqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqli // // Otherwise, if the callback function does not return an error, this // function returns SQLITE_OK. -func Xsqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) int32 { /* sqlite3.c:62648:20: */ +func Xsqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) int32 { /* sqlite3.c:63096:20: */ var rc int32 = SQLITE_OK if (*Wal)(unsafe.Pointer(pWal)).FwriteLock != 0 { var iMax Pgno = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame @@ -39276,7 +39304,7 @@ func Xsqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt // 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 Xsqlite3WalSavepoint(tls *libc.TLS, pWal uintptr, aWalData uintptr) { /* sqlite3.c:62688:21: */ +func Xsqlite3WalSavepoint(tls *libc.TLS, pWal uintptr, aWalData uintptr) { /* sqlite3.c:63136:21: */ *(*U32)(unsafe.Pointer(aWalData)) = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame *(*U32)(unsafe.Pointer(aWalData + 1*4)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) @@ -39288,7 +39316,7 @@ func Xsqlite3WalSavepoint(tls *libc.TLS, pWal uintptr, aWalData uintptr) { /* sq // 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 Xsqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) int32 { /* sqlite3.c:62702:20: */ +func Xsqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) int32 { /* sqlite3.c:63150:20: */ var rc int32 = SQLITE_OK if *(*U32)(unsafe.Pointer(aWalData + 3*4)) != (*Wal)(unsafe.Pointer(pWal)).FnCkpt { @@ -39319,7 +39347,7 @@ func Xsqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) int // 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 *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62739:12: */ +func walRestartLog(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63187:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -39373,12 +39401,12 @@ type WalWriter1 = struct { FiSyncPoint Sqlite3_int64 FsyncFlags int32 FszPage int32 -} /* sqlite3.c:62786:9 */ +} /* sqlite3.c:63234:9 */ // Information about the current state of the WAL file and where // the next fsync should occur - passed from sqlite3WalFrames() into // walWriteToLog(). -type WalWriter = WalWriter1 /* sqlite3.c:62792:3 */ +type WalWriter = WalWriter1 /* sqlite3.c:63240:3 */ // Write iAmt bytes of content into the WAL file beginning at iOffset. // Do a sync when crossing the p->iSyncPoint boundary. @@ -39386,7 +39414,7 @@ type WalWriter = WalWriter1 /* sqlite3.c:62792:3 */ // 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 *libc.TLS, p uintptr, pContent uintptr, iAmt int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:62802:12: */ +func walWriteToLog(tls *libc.TLS, p uintptr, pContent uintptr, iAmt int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:63250:12: */ var rc int32 if (iOffset < (*WalWriter)(unsafe.Pointer(p)).FiSyncPoint) && ((iOffset + Sqlite3_int64(iAmt)) >= (*WalWriter)(unsafe.Pointer(p)).FiSyncPoint) { var iFirstAmt int32 = (int32((*WalWriter)(unsafe.Pointer(p)).FiSyncPoint - iOffset)) @@ -39408,7 +39436,7 @@ func walWriteToLog(tls *libc.TLS, p uintptr, pContent uintptr, iAmt int32, iOffs } // Write out a single frame of the WAL -func walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:62827:12: */ +func walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:63275:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -39433,7 +39461,7 @@ func walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32, // with the earliest to have been overwritten. // // SQLITE_OK is returned if successful, or an SQLite error code otherwise. -func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqlite3.c:62853:12: */ +func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqlite3.c:63301:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -39459,7 +39487,7 @@ func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqli if (*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(1) { iCksumOff = int64(24) } else { - iCksumOff = ((WAL_HDRSIZE + ((I64(((*Wal)(unsafe.Pointer(pWal)).FiReCksum - U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(16)) + iCksumOff = ((int64(WAL_HDRSIZE) + ((I64(((*Wal)(unsafe.Pointer(pWal)).FiReCksum - U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(16)) } rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, (int32(uint64(unsafe.Sizeof(U32(0))) * uint64(2))), iCksumOff) *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) = Xsqlite3Get4byte(tls, aBuf) @@ -39468,7 +39496,7 @@ func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqli iRead = (*Wal)(unsafe.Pointer(pWal)).FiReCksum (*Wal)(unsafe.Pointer(pWal)).FiReCksum = U32(0) for ; (rc == SQLITE_OK) && (iRead <= iLast); iRead++ { - var iOff I64 = (WAL_HDRSIZE + ((I64((iRead) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + var iOff I64 = (int64(WAL_HDRSIZE) + ((I64((iRead) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, (szPage + WAL_FRAME_HDRSIZE), iOff) if rc == SQLITE_OK { var iPgno U32 @@ -39487,7 +39515,7 @@ func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqli // Write a set of frames to the log. The caller must hold the write-lock // on the log file (obtained using sqlite3WalBeginWriteTransaction()). -func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTruncate Pgno, isCommit int32, sync_flags int32) int32 { /* sqlite3.c:62902:20: */ +func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTruncate Pgno, isCommit int32, sync_flags int32) int32 { /* sqlite3.c:63350:20: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -39528,7 +39556,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // Checksum for wal-header Xsqlite3Put4byte(tls, (bp /* &aWalHdr */), (uint32(WAL_MAGIC | SQLITE_BIGENDIAN))) - Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 4), WAL_MAX_VERSION) + Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 4), uint32(WAL_MAX_VERSION)) Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 8), uint32(szPage)) Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 12), (*Wal)(unsafe.Pointer(pWal)).FnCkpt) if (*Wal)(unsafe.Pointer(pWal)).FnCkpt == U32(0) { @@ -39540,7 +39568,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 28), *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + 1*4))) (*Wal)(unsafe.Pointer(pWal)).FszPage = U32(szPage) - (*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = SQLITE_BIGENDIAN + (*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = U8(SQLITE_BIGENDIAN) *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) = *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */)) *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) = *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + 1*4)) (*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit = U8(1) @@ -39571,7 +39599,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FiSyncPoint = int64(0) (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FsyncFlags = sync_flags (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FszPage = szPage - iOffset = (WAL_HDRSIZE + ((I64((iFrame + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + iOffset = (int64(WAL_HDRSIZE) + ((I64((iFrame + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) szFrame = (szPage + WAL_FRAME_HDRSIZE) // Write all frames into the log file exactly once @@ -39587,7 +39615,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, Xsqlite3WalFindFrame(tls, pWal, (*PgHdr)(unsafe.Pointer(p)).Fpgno, bp+40 /* &iWrite */) if *(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) >= iFirst { - var iOff I64 = ((WAL_HDRSIZE + ((I64((*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + var iOff I64 = ((int64(WAL_HDRSIZE) + ((I64((*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) var pData uintptr if ((*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(0)) || (*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) < (*Wal)(unsafe.Pointer(pWal)).FiReCksum) { (*Wal)(unsafe.Pointer(pWal)).FiReCksum = *(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) @@ -39667,8 +39695,8 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // journal size limit, if possible. if ((isCommit != 0) && ((*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit != 0)) && ((*Wal)(unsafe.Pointer(pWal)).FmxWalSize >= int64(0)) { var sz I64 = (*Wal)(unsafe.Pointer(pWal)).FmxWalSize - if (WAL_HDRSIZE + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) > (*Wal)(unsafe.Pointer(pWal)).FmxWalSize { - sz = (WAL_HDRSIZE + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + if (int64(WAL_HDRSIZE) + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) > (*Wal)(unsafe.Pointer(pWal)).FmxWalSize { + sz = (int64(WAL_HDRSIZE) + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) } walLimitSize(tls, pWal, sz) (*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit = U8(0) @@ -39720,7 +39748,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // // 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 Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:63140:20: */ +func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:63588:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -39785,7 +39813,7 @@ func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, if rc == SQLITE_OK { if ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0) && (walPagesize(tls, pWal) != nBuf) { - rc = Xsqlite3CorruptError(tls, 63222) + rc = Xsqlite3CorruptError(tls, 63670) } else { rc = walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -39829,7 +39857,7 @@ func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, // 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 Xsqlite3WalCallback(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63265:20: */ +func Xsqlite3WalCallback(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63713:20: */ var ret U32 = U32(0) if pWal != 0 { ret = (*Wal)(unsafe.Pointer(pWal)).FiCallback @@ -39860,7 +39888,7 @@ func Xsqlite3WalCallback(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63265 // 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 Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* sqlite3.c:63298:20: */ +func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* sqlite3.c:63746:20: */ var rc int32 // pWal->readLock is usually set, but might be -1 if there was a @@ -39871,9 +39899,9 @@ func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* if op == 0 { if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) != WAL_NORMAL_MODE { - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_NORMAL_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_NORMAL_MODE) if walLockShared(tls, pWal, (3+(int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)))) != SQLITE_OK { - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_EXCLUSIVE_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE) } rc = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE)) } else { @@ -39883,7 +39911,7 @@ func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* } else if op > 0 { walUnlockShared(tls, pWal, (3 + (int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)))) - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_EXCLUSIVE_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE) rc = 1 } else { rc = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE)) @@ -39894,14 +39922,14 @@ func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* // 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 Xsqlite3WalHeapMemory(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63340:20: */ +func Xsqlite3WalHeapMemory(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63788:20: */ return (libc.Bool32((pWal != 0) && (int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE))) } // Create a snapshot object. The content of a snapshot is opaque to // every other subsystem, so the WAL module can put whatever it needs // in the object. -func Xsqlite3WalSnapshotGet(tls *libc.TLS, pWal uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:63349:20: */ +func Xsqlite3WalSnapshotGet(tls *libc.TLS, pWal uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:63797:20: */ var rc int32 = SQLITE_OK var pRet uintptr @@ -39920,16 +39948,16 @@ func Xsqlite3WalSnapshotGet(tls *libc.TLS, pWal uintptr, ppSnapshot uintptr) int return rc } -var aZero = [4]U32{U32(0), U32(0), U32(0), U32(0)} /* sqlite3.c:63352:20 */ +var aZero = [4]U32{U32(0), U32(0), U32(0), U32(0)} /* sqlite3.c:63800:20 */ // Try to open on pSnapshot when the next read-transaction starts -func Xsqlite3WalSnapshotOpen(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) { /* sqlite3.c:63373:21: */ +func Xsqlite3WalSnapshotOpen(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) { /* sqlite3.c:63821:21: */ (*Wal)(unsafe.Pointer(pWal)).FpSnapshot = pSnapshot } // Return a +ve value if snapshot p1 is newer than p2. A -ve value if // p1 is older than p2 and zero if p1 and p2 are the same snapshot. -func Xsqlite3_snapshot_cmp(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:63384:16: */ +func Xsqlite3_snapshot_cmp(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:63832:16: */ var pHdr1 uintptr = p1 var pHdr2 uintptr = p2 @@ -39959,7 +39987,7 @@ func Xsqlite3_snapshot_cmp(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sql // the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error // occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER // lock is released before returning. -func Xsqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:63408:20: */ +func Xsqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:63856:20: */ var rc int32 rc = walLockShared(tls, pWal, WAL_CKPT_LOCK) if rc == SQLITE_OK { @@ -39975,13 +40003,13 @@ func Xsqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) in // Release a lock obtained by an earlier successful call to // sqlite3WalSnapshotCheck(). -func Xsqlite3WalSnapshotUnlock(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:63427:21: */ +func Xsqlite3WalSnapshotUnlock(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:63875:21: */ walUnlockShared(tls, pWal, WAL_CKPT_LOCK) } // Return the sqlite3_file object for the WAL file -func Xsqlite3WalFile(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:63449:29: */ +func Xsqlite3WalFile(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:63897:29: */ return (*Wal)(unsafe.Pointer(pWal)).FpWalFd } @@ -40257,7 +40285,7 @@ type MemPage1 = struct { FpDbPage uintptr FxCellSize uintptr FxParseCell uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ //************* End of wal.c ************************************************ //************* Begin file btmutex.c **************************************** @@ -40502,25 +40530,25 @@ type MemPage1 = struct { // small cells will be rare, but they are possible. // Forward declarations -type MemPage = MemPage1 /* sqlite3.c:63707:24 */ +type MemPage = MemPage1 /* sqlite3.c:64155:24 */ type BtLock1 = struct { FpBtree uintptr FiTable Pgno FeLock U8 _ [3]byte FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type BtLock = BtLock1 /* sqlite3.c:63708:23 */ +type BtLock = BtLock1 /* sqlite3.c:64156:23 */ type CellInfo1 = struct { FnKey I64 FpPayload uintptr FnPayload U32 FnLocal U16 FnSize U16 -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type CellInfo = CellInfo1 /* sqlite3.c:63709:25 */ +type CellInfo = CellInfo1 /* sqlite3.c:64157:25 */ // Legal values for BtCursor.curFlags @@ -40630,7 +40658,7 @@ type IntegrityCk1 = struct { FerrMsg StrAccum Fheap uintptr Fdb uintptr -} /* sqlite3.c:64149:9 */ +} /* sqlite3.c:64615:9 */ // Legal values for BtCursor.curFlags @@ -40726,7 +40754,7 @@ type IntegrityCk1 = struct { // the database the corresponding bit is set. This allows integrity-check to // detect pages that are used twice and orphaned pages (both of which // indicate corruption). -type IntegrityCk = IntegrityCk1 /* sqlite3.c:64149:28 */ +type IntegrityCk = IntegrityCk1 /* sqlite3.c:64615:28 */ // Routines to read or write a two- and four-byte big-endian integer values. @@ -40740,7 +40768,7 @@ type IntegrityCk = IntegrityCk1 /* sqlite3.c:64149:28 */ // 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 *libc.TLS, p uintptr) { /* sqlite3.c:64199:13: */ +func lockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:64665:13: */ Xsqlite3_mutex_enter(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).Fmutex) (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).Fdb = (*Btree)(unsafe.Pointer(p)).Fdb @@ -40749,7 +40777,7 @@ func lockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:64199:13: */ // Release the BtShared mutex associated with B-Tree handle p and // clear the p->locked boolean. -func unlockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:64213:29: */ +func unlockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:64679:29: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3_mutex_leave(tls, (*BtShared)(unsafe.Pointer(pBt)).Fmutex) @@ -40770,7 +40798,7 @@ func unlockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:64213:29: */ // 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 Xsqlite3BtreeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:64243:21: */ +func Xsqlite3BtreeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:64709:21: */ // Some basic sanity checking on the Btree. The list of Btrees // connected by pNext and pPrev should be in sorted order by // Btree.pBt value. All elements of the list should belong to @@ -40798,7 +40826,7 @@ func Xsqlite3BtreeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:64243:21: */ // 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 *libc.TLS, p uintptr) { /* sqlite3.c:64277:29: */ +func btreeLockCarefully(tls *libc.TLS, p uintptr) { /* sqlite3.c:64743:29: */ var pLater uintptr // In most cases, we should be able to acquire the lock we @@ -40829,7 +40857,7 @@ func btreeLockCarefully(tls *libc.TLS, p uintptr) { /* sqlite3.c:64277:29: */ } // Exit the recursive mutex on a Btree. -func Xsqlite3BtreeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:64315:21: */ +func Xsqlite3BtreeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:64781:21: */ if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 { @@ -40852,7 +40880,7 @@ func Xsqlite3BtreeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:64315:21: */ // 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 *libc.TLS, db uintptr) { /* sqlite3.c:64358:29: */ +func btreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64824:29: */ var i int32 var skipOk int32 = 1 var p uintptr @@ -40867,13 +40895,13 @@ func btreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64358:29: */ (*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache = U8(skipOk) } -func Xsqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64372:21: */ +func Xsqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64838:21: */ if int32((*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 { btreeEnterAll(tls, db) } } -func btreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64375:29: */ +func btreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64841:29: */ var i int32 var p uintptr @@ -40885,7 +40913,7 @@ func btreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64375:29: */ } } -func Xsqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64384:21: */ +func Xsqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64850:21: */ if int32((*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 { btreeLeaveAll(tls, db) } @@ -40896,11 +40924,11 @@ func Xsqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64384:21: * // 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 Xsqlite3BtreeEnterCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:64470:21: */ +func Xsqlite3BtreeEnterCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:64936:21: */ Xsqlite3BtreeEnter(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree) } -func Xsqlite3BtreeLeaveCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:64474:21: */ +func Xsqlite3BtreeLeaveCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:64940:21: */ Xsqlite3BtreeLeave(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree) } @@ -40923,7 +40951,7 @@ func Xsqlite3BtreeLeaveCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:64474: // The header string that appears at the beginning of every // SQLite database. -var zMagicHeader = *(*[16]int8)(unsafe.Pointer(ts + 2983 /* "SQLite format 3" */)) /* sqlite3.c:64505:19 */ +var zMagicHeader = *(*[16]int8)(unsafe.Pointer(ts + 3011 /* "SQLite format 3" */)) /* sqlite3.c:64971:19 */ // Set this global variable to 1 to enable tracing using the TRACE // macro. @@ -40949,14 +40977,14 @@ var zMagicHeader = *(*[16]int8)(unsafe.Pointer(ts + 2983 /* "SQLite format 3" */ // test builds. // // Access to this variable is protected by SQLITE_MUTEX_STATIC_MAIN. -var sqlite3SharedCacheList uintptr = uintptr(0) /* sqlite3.c:64560:17 */ +var sqlite3SharedCacheList uintptr = uintptr(0) /* sqlite3.c:65026:17 */ // 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 *libc.TLS, enable int32) int32 { /* sqlite3.c:64572:16: */ +func Xsqlite3_enable_shared_cache(tls *libc.TLS, enable int32) int32 { /* sqlite3.c:65038:16: */ Xsqlite3Config.FsharedCacheEnabled = enable return SQLITE_OK } @@ -40973,7 +41001,7 @@ func Xsqlite3_enable_shared_cache(tls *libc.TLS, enable int32) int32 { /* sqlite // (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 *libc.TLS, p uintptr, iTab Pgno, eLock U8) int32 { /* sqlite3.c:64760:12: */ +func querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab Pgno, eLock U8) int32 { /* sqlite3.c:65237:12: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var pIter uintptr @@ -41030,7 +41058,7 @@ func querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab Pgno, eLock U8) in // // SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM // is returned if a malloc attempt fails. -func setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable Pgno, eLock U8) int32 { /* sqlite3.c:64832:12: */ +func setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable Pgno, eLock U8) int32 { /* sqlite3.c:65309:12: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var pLock uintptr = uintptr(0) var pIter uintptr @@ -41081,7 +41109,7 @@ func setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable Pgno, eLock U8) in // 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 *libc.TLS, p uintptr) { /* sqlite3.c:64896:13: */ +func clearAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:65373:13: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var ppIter uintptr = (pBt + 120 /* &.pLock */) @@ -41116,7 +41144,7 @@ func clearAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:6489 } // This function changes all write-locks held by Btree p into read-locks. -func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:64940:13: */ +func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:65417:13: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt if (*BtShared)(unsafe.Pointer(pBt)).FpWriter == p { var pLock uintptr @@ -41124,7 +41152,7 @@ func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c: *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32((BTS_EXCLUSIVE | BTS_PENDING)))) for pLock = (*BtShared)(unsafe.Pointer(pBt)).FpLock; pLock != 0; pLock = (*BtLock)(unsafe.Pointer(pLock)).FpNext { - (*BtLock)(unsafe.Pointer(pLock)).FeLock = READ_LOCK + (*BtLock)(unsafe.Pointer(pLock)).FeLock = U8(READ_LOCK) } } } @@ -41140,7 +41168,7 @@ func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c: // Invalidate the overflow page-list cache for all cursors opened // on the shared btree structure pBt. -func invalidateAllOverflowCache(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:64993:13: */ +func invalidateAllOverflowCache(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:65470:13: */ var p uintptr for p = (*BtShared)(unsafe.Pointer(pBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext { @@ -41159,7 +41187,7 @@ func invalidateAllOverflowCache(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:64993 // 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 *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRow I64, isClearTable int32) { /* sqlite3.c:65015:13: */ +func invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRow I64, isClearTable int32) { /* sqlite3.c:65492:13: */ var p uintptr if int32((*Btree)(unsafe.Pointer(pBtree)).FhasIncrblobCur) == 0 { return @@ -41170,7 +41198,7 @@ func invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRo if (int32((*BtCursor)(unsafe.Pointer(p)).FcurFlags) & BTCF_Incrblob) != 0 { (*Btree)(unsafe.Pointer(pBtree)).FhasIncrblobCur = U8(1) if ((*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == pgnoRoot) && ((isClearTable != 0) || ((*BtCursor)(unsafe.Pointer(p)).Finfo.FnKey == iRow)) { - (*BtCursor)(unsafe.Pointer(p)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(p)).FeState = U8(CURSOR_INVALID) } } } @@ -41209,7 +41237,7 @@ func invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRo // 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 *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:65075:12: */ +func btreeSetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:65552:12: */ var rc int32 = SQLITE_OK if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpHasContent) != 0) { @@ -41229,20 +41257,20 @@ func btreeSetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite // 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 *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:65097:12: */ +func btreeGetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:65574:12: */ var p uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpHasContent return (libc.Bool32((p != 0) && ((pgno > Xsqlite3BitvecSize(tls, p)) || (Xsqlite3BitvecTestNotNull(tls, p, pgno) != 0)))) } // Clear (destroy) the BtShared.pHasContent bitvec. This should be // invoked at the conclusion of each write-transaction. -func btreeClearHasContent(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:65106:13: */ +func btreeClearHasContent(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:65583:13: */ Xsqlite3BitvecDestroy(tls, (*BtShared)(unsafe.Pointer(pBt)).FpHasContent) (*BtShared)(unsafe.Pointer(pBt)).FpHasContent = uintptr(0) } // Release all of the apPage[] pages for a cursor. -func btreeReleaseAllCursorPages(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65114:13: */ +func btreeReleaseAllCursorPages(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65591:13: */ var i int32 if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) >= 0 { for i = 0; i < int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage); i++ { @@ -41264,7 +41292,7 @@ func btreeReleaseAllCursorPages(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:6511 // 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 *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65138:12: */ +func saveCursorKey(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65615:12: */ var rc int32 = SQLITE_OK if (*BtCursor)(unsafe.Pointer(pCur)).FcurIntKey != 0 { @@ -41301,14 +41329,14 @@ func saveCursorKey(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65138:12: * // // The caller must ensure that the cursor is valid (has eState==CURSOR_VALID) // prior to calling this routine. -func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65180:12: */ +func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65657:12: */ var rc int32 if (int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags) & BTCF_Pinned) != 0 { return (SQLITE_CONSTRAINT | (int32(11) << 8)) } if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_SKIPNEXT { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) } else { (*BtCursor)(unsafe.Pointer(pCur)).FskipNext = 0 } @@ -41316,7 +41344,7 @@ func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65180: rc = saveCursorKey(tls, pCur) if rc == SQLITE_OK { btreeReleaseAllCursorPages(tls, pCur) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_REQUIRESEEK + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK) } *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(((BTCF_ValidNKey | BTCF_ValidOvfl) | BTCF_AtLast)))) @@ -41342,7 +41370,7 @@ func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65180: // 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 *libc.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:65230:12: */ +func saveAllCursors(tls *libc.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:65707:12: */ var p uintptr for p = (*BtShared)(unsafe.Pointer(pBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext { @@ -41363,7 +41391,7 @@ func saveAllCursors(tls *libc.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int // 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 *libc.TLS, p uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:65247:28: */ +func saveCursorsOnList(tls *libc.TLS, p uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:65724:28: */ for ok := true; ok; ok = p != 0 { if (p != pExcept) && ((Pgno(0) == iRoot) || ((*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == iRoot)) { if (int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_VALID) || (int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_SKIPNEXT) { @@ -41382,17 +41410,17 @@ func saveCursorsOnList(tls *libc.TLS, p uintptr, iRoot Pgno, pExcept uintptr) in } // Clear the current cursor position. -func Xsqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65272:21: */ +func Xsqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65749:21: */ Xsqlite3_free(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey) (*BtCursor)(unsafe.Pointer(pCur)).FpKey = uintptr(0) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) } // 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 *libc.TLS, pCur uintptr, pKey uintptr, nKey I64, bias int32, pRes uintptr) int32 { /* sqlite3.c:65284:12: */ +func btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey I64, bias int32, pRes uintptr) int32 { /* sqlite3.c:65761:12: */ var rc int32 // Status code var pIdxKey uintptr var pKeyInfo uintptr // Unpacked index key @@ -41413,7 +41441,7 @@ __3: if !((int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0) || (int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField))) { goto __4 } - rc = Xsqlite3CorruptError(tls, 65301) + rc = Xsqlite3CorruptError(tls, 65778) goto moveto_done __4: ; @@ -41438,7 +41466,7 @@ __5: // saved position info stored by saveCursorPosition(), so there can be // at most one effective restoreCursorPosition() call after each // saveCursorPosition(). -func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65322:12: */ +func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65799:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -41448,7 +41476,7 @@ func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3. if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_FAULT { return (*BtCursor)(unsafe.Pointer(pCur)).FskipNext } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) if Xsqlite3FaultSim(tls, 410) != 0 { rc = SQLITE_IOERR } else { @@ -41462,7 +41490,7 @@ func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3. (*BtCursor)(unsafe.Pointer(pCur)).FskipNext = *(*int32)(unsafe.Pointer(bp /* skipNext */)) } if ((*BtCursor)(unsafe.Pointer(pCur)).FskipNext != 0) && (int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID) { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_SKIPNEXT + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_SKIPNEXT) } } return rc @@ -41478,7 +41506,7 @@ func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3. // // Use the separate sqlite3BtreeCursorRestore() routine to restore a cursor // back to where it ought to be if this routine returns true. -func Xsqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65365:20: */ +func Xsqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65842:20: */ return (libc.Bool32(CURSOR_VALID != int32(*(*U8)(unsafe.Pointer(pCur))))) } @@ -41486,12 +41514,12 @@ func Xsqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3 // Return a pointer to a fake BtCursor object that will always answer // false to the sqlite3BtreeCursorHasMoved() routine above. The fake // cursor returned must not be used with any other Btree interface. -func Xsqlite3BtreeFakeValidCursor(tls *libc.TLS) uintptr { /* sqlite3.c:65378:25: */ +func Xsqlite3BtreeFakeValidCursor(tls *libc.TLS) uintptr { /* sqlite3.c:65855:25: */ return uintptr(unsafe.Pointer(&fakeCursor)) } -var fakeCursor U8 = CURSOR_VALID /* sqlite3.c:65379:13 */ +var fakeCursor U8 = U8(CURSOR_VALID) /* sqlite3.c:65856:13 */ // 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 @@ -41504,7 +41532,7 @@ var fakeCursor U8 = CURSOR_VALID /* sqlite3.c:65379:13 */ // // This routine should only be called for a cursor that just returned // TRUE from sqlite3BtreeCursorHasMoved(). -func Xsqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintptr) int32 { /* sqlite3.c:65397:20: */ +func Xsqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintptr) int32 { /* sqlite3.c:65874:20: */ var rc int32 rc = func() int32 { @@ -41526,7 +41554,7 @@ func Xsqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintp } // Provide flag hints to the cursor. -func Xsqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32) { /* sqlite3.c:65429:21: */ +func Xsqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32) { /* sqlite3.c:65906:21: */ (*BtCursor)(unsafe.Pointer(pCur)).Fhints = U8(x) } @@ -41538,7 +41566,7 @@ func Xsqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32) { /* sq // 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 *libc.TLS, pBt uintptr, pgno Pgno) Pgno { /* sqlite3.c:65445:13: */ +func ptrmapPageno(tls *libc.TLS, pBt uintptr, pgno Pgno) Pgno { /* sqlite3.c:65922:13: */ var nPagesPerMapPage int32 var iPtrMap Pgno var ret Pgno @@ -41563,7 +41591,7 @@ func ptrmapPageno(tls *libc.TLS, pBt uintptr, pgno Pgno) Pgno { /* sqlite3.c:654 // 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 *libc.TLS, pBt uintptr, key Pgno, eType U8, parent Pgno, pRC uintptr) { /* sqlite3.c:65469:13: */ +func ptrmapPut(tls *libc.TLS, pBt uintptr, key Pgno, eType U8, parent Pgno, pRC uintptr) { /* sqlite3.c:65946:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -41586,7 +41614,7 @@ __1: if !(key == Pgno(0)) { goto __2 } - *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65484) + *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65961) return __2: ; @@ -41605,7 +41633,7 @@ __3: // The first byte of the extra data is the MemPage.isInit byte. // If that byte is set, it means this page is also being used // as a btree page. - *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65497) + *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65974) goto ptrmap_exit __4: ; @@ -41613,7 +41641,7 @@ __4: if !(offset < 0) { goto __5 } - *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65502) + *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65979) goto ptrmap_exit __5: ; @@ -41644,7 +41672,7 @@ ptrmap_exit: // 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 *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintptr) int32 { /* sqlite3.c:65528:12: */ +func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintptr) int32 { /* sqlite3.c:66005:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -41665,7 +41693,7 @@ func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintp offset = (int32(Pgno(5) * ((key - Pgno(iPtrmap)) - Pgno(1)))) if offset < 0 { Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */))) - return Xsqlite3CorruptError(tls, 65547) + return Xsqlite3CorruptError(tls, 66024) } *(*U8)(unsafe.Pointer(pEType)) = *(*U8)(unsafe.Pointer(pPtrmap + uintptr(offset))) @@ -41675,7 +41703,7 @@ func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintp Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */))) if (int32(*(*U8)(unsafe.Pointer(pEType))) < 1) || (int32(*(*U8)(unsafe.Pointer(pEType))) > 5) { - return Xsqlite3CorruptError(tls, 65555) + return Xsqlite3CorruptError(tls, 66032) } return SQLITE_OK } @@ -41693,7 +41721,7 @@ func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintp // 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 *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65587:29: */ +func btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66064:29: */ // If the payload will not fit completely on the local page, we have // to decide how much to store locally and how much to spill onto // overflow pages. The strategy is to minimize the amount of unused @@ -41718,6 +41746,26 @@ func btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell uin (*CellInfo)(unsafe.Pointer(pInfo)).FnSize = (U16(int32((U16((int64(((*CellInfo)(unsafe.Pointer(pInfo)).FpPayload + uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnLocal))) - int64(pCell)) / 1))) + 4)) } +// Given a record with nPayload bytes of payload stored within btree +// page pPage, return the number of bytes of payload stored locally. +func btreePayloadToLocal(tls *libc.TLS, pPage uintptr, nPayload I64) int32 { /* sqlite3.c:66099:12: */ + var maxLocal int32 // Maximum amount of payload held locally + maxLocal = int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) + if nPayload <= I64(maxLocal) { + return int32(nPayload) + } else { + var minLocal int32 // Minimum amount of payload held locally + var surplus int32 // Overflow payload available for local storage + minLocal = int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal) + surplus = (int32(I64(minLocal) + ((nPayload - I64(minLocal)) % (I64((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32(4)))))) + if surplus <= maxLocal { + return surplus + } + return minLocal + } + return int32(0) +} + // The following routines are implementations of the MemPage.xParseCell() // method. // @@ -41730,7 +41778,7 @@ func btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell uin // 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 *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65632:13: */ +func btreeParseCellPtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66127:13: */ _ = pPage (*CellInfo)(unsafe.Pointer(pInfo)).FnSize = (U16(4 + int32(Xsqlite3GetVarint(tls, (pCell+4), (pInfo /* &.nKey */))))) @@ -41740,7 +41788,7 @@ func btreeParseCellPtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr, pIn return } -func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65649:13: */ +func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66144:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -41805,7 +41853,7 @@ func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintpt } } -func btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65717:13: */ +func btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66212:13: */ var pIter uintptr // For scanning through pCell var nPayload U32 // Number of bytes of cell payload @@ -41836,7 +41884,7 @@ func btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo u } } -func btreeParseCell(tls *libc.TLS, pPage uintptr, iCell int32, pInfo uintptr) { /* sqlite3.c:65754:13: */ +func btreeParseCell(tls *libc.TLS, pPage uintptr, iCell int32, pInfo uintptr) { /* sqlite3.c:66249:13: */ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (iCell))))))))))), pInfo) } @@ -41850,7 +41898,7 @@ func btreeParseCell(tls *libc.TLS, pPage uintptr, iCell int32, pInfo uintptr) { // // cellSizePtrNoPayload() => table internal nodes // cellSizePtr() => all index nodes & table leaf nodes -func cellSizePtr(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:65774:12: */ +func cellSizePtr(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:66269:12: */ var pIter uintptr = (pCell + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) // For looping over bytes of pCell var pEnd uintptr // End mark for a varint var nSize U32 // Size value to return @@ -41891,7 +41939,7 @@ func cellSizePtr(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c return U16(nSize) } -func cellSizePtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:65822:12: */ +func cellSizePtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:66317:12: */ var pIter uintptr = (pCell + uintptr(4)) // For looping over bytes of pCell var pEnd uintptr // End mark for a varint @@ -41908,7 +41956,7 @@ func cellSizePtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* // of pPage. (pSrc and pPager are often the same.) If pCell contains a // pointer to an overflow page, insert an entry into the pointer-map for // the overflow page that will be valid after pCell has been moved to pPage. -func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, pRC uintptr) { /* sqlite3.c:65860:13: */ +func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, pRC uintptr) { /* sqlite3.c:66355:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -41923,11 +41971,11 @@ func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, var ovfl Pgno if (Uptr(((*MemPage)(unsafe.Pointer(pSrc)).FaDataEnd)) >= Uptr((pCell))) && (Uptr(((*MemPage)(unsafe.Pointer(pSrc)).FaDataEnd)) < Uptr((pCell + uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnLocal)))) { - *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65869) + *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 66364) return } ovfl = Xsqlite3Get4byte(tls, (pCell + uintptr((int32((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize) - 4)))) - ptrmapPut(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, ovfl, PTRMAP_OVERFLOW1, (*MemPage)(unsafe.Pointer(pPage)).Fpgno, pRC) + ptrmapPut(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, ovfl, uint8(PTRMAP_OVERFLOW1), (*MemPage)(unsafe.Pointer(pPage)).Fpgno, pRC) } } @@ -41941,7 +41989,7 @@ func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, // 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 *libc.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sqlite3.c:65891:12: */ +func defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sqlite3.c:66386:12: */ var i int32 // Loop counter var pc int32 // Address of the i-th cell var hdr int32 // Offset to the page header @@ -41986,7 +42034,7 @@ func defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sql if !(iFree > (usableSize - 4)) { goto __2 } - return Xsqlite3CorruptError(tls, 65927) + return Xsqlite3CorruptError(tls, 66422) __2: ; if !(iFree != 0) { @@ -41996,7 +42044,7 @@ __2: if !(iFree2 > (usableSize - 4)) { goto __4 } - return Xsqlite3CorruptError(tls, 65930) + return Xsqlite3CorruptError(tls, 66425) __4: ; if !((0 == iFree2) || ((int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0) && (int32(*(*uint8)(unsafe.Pointer(data + uintptr((iFree2 + 1))))) == 0))) { @@ -42009,7 +42057,7 @@ __4: if !(top >= iFree) { goto __6 } - return Xsqlite3CorruptError(tls, 65938) + return Xsqlite3CorruptError(tls, 66433) __6: ; if !(iFree2 != 0) { @@ -42018,14 +42066,14 @@ __6: if !((iFree + sz) > iFree2) { goto __9 } - return Xsqlite3CorruptError(tls, 65941) + return Xsqlite3CorruptError(tls, 66436) __9: ; sz2 = ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((iFree2 + 2)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((iFree2 + 2))) + 1)))) if !((iFree2 + sz2) > usableSize) { goto __10 } - return Xsqlite3CorruptError(tls, 65943) + return Xsqlite3CorruptError(tls, 66438) __10: ; libc.Xmemmove(tls, (data + uintptr(((iFree + sz) + sz2))), (data + uintptr((iFree + sz))), (uint64(iFree2 - (iFree + sz)))) @@ -42035,7 +42083,7 @@ __7: if !((iFree + sz) > usableSize) { goto __11 } - return Xsqlite3CorruptError(tls, 65947) + return Xsqlite3CorruptError(tls, 66442) __11: ; __8: @@ -42096,7 +42144,7 @@ __18: if !((pc < iCellFirst) || (pc > iCellLast)) { goto __21 } - return Xsqlite3CorruptError(tls, 65975) + return Xsqlite3CorruptError(tls, 66470) __21: ; @@ -42105,7 +42153,7 @@ __21: if !((cbrk < iCellFirst) || ((pc + size) > usableSize)) { goto __22 } - return Xsqlite3CorruptError(tls, 65981) + return Xsqlite3CorruptError(tls, 66476) __22: ; @@ -42141,7 +42189,7 @@ defragment_out: if !(((int32(*(*uint8)(unsafe.Pointer(data + uintptr((hdr + 7))))) + cbrk) - iCellFirst) != (*MemPage)(unsafe.Pointer(pPage)).FnFree) { goto __25 } - return Xsqlite3CorruptError(tls, 66002) + return Xsqlite3CorruptError(tls, 66497) __25: ; @@ -42166,7 +42214,7 @@ __25: // 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 *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr { /* sqlite3.c:66027:11: */ +func pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr { /* sqlite3.c:66522:11: */ var hdr int32 = int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset) // Offset to page header var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData // Page data var iAddr int32 = (hdr + 1) // Address of ptr to pc @@ -42195,7 +42243,7 @@ func pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr *(*U8)(unsafe.Pointer(aData + uintptr((hdr + 7)))) += U8((int32(U8(x)))) } else if (x + pc) > maxPC { // This slot extends off the end of the usable part of the page - *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66056) + *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66551) return uintptr(0) } else { // The slot remains on the free-list. Reduce its size to account @@ -42210,14 +42258,14 @@ func pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr if pc <= (iAddr + size) { if pc != 0 { // The next slot in the chain is not past the end of the current slot - *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66070) + *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66565) } return uintptr(0) } } if pc > ((maxPC + nByte) - 4) { // The free slot chain extends off the end of the page - *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66077) + *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66572) } return uintptr(0) } @@ -42233,7 +42281,7 @@ func pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr // 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 *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int32 { /* sqlite3.c:66095:12: */ +func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int32 { /* sqlite3.c:66590:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -42258,7 +42306,7 @@ func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int3 if (top == 0) && ((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == U32(65536)) { top = 65536 } else { - return Xsqlite3CorruptError(tls, 66124) + return Xsqlite3CorruptError(tls, 66619) } } @@ -42273,7 +42321,7 @@ func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int3 *(*int32)(unsafe.Pointer(pIdx)) = libc.AssignInt32(&g2, (int32((int64(pSpace) - int64(data)) / 1))) if g2 <= gap { - return Xsqlite3CorruptError(tls, 66142) + return Xsqlite3CorruptError(tls, 66637) } else { return SQLITE_OK } @@ -42324,7 +42372,7 @@ func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int3 // 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 *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sqlite3.c:66191:12: */ +func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sqlite3.c:66686:12: */ var iPtr U16 // Address of ptr to next freeblock var iFreeBlk U16 // Address of the next freeblock var hdr U8 // Page header size. 0 or 100 @@ -42348,12 +42396,12 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s if int32(iFreeBlk) == 0 { break } // TH3: corrupt082.100 - return Xsqlite3CorruptError(tls, 66220) + return Xsqlite3CorruptError(tls, 66715) } iPtr = iFreeBlk } if U32(iFreeBlk) > ((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32(4)) { // TH3: corrupt081.100 - return Xsqlite3CorruptError(tls, 66225) + return Xsqlite3CorruptError(tls, 66720) } // At this point: @@ -42364,11 +42412,11 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s if (iFreeBlk != 0) && ((iEnd + U32(3)) >= U32(iFreeBlk)) { nFrag = (U8(U32(iFreeBlk) - iEnd)) if iEnd > U32(iFreeBlk) { - return Xsqlite3CorruptError(tls, 66237) + return Xsqlite3CorruptError(tls, 66732) } iEnd = (U32(int32(iFreeBlk) + ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iFreeBlk) + 2)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iFreeBlk) + 2))) + 1)))))) if iEnd > (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return Xsqlite3CorruptError(tls, 66240) + return Xsqlite3CorruptError(tls, 66735) } iSize = (U16(iEnd - U32(iStart))) iFreeBlk = (U16((int32(*(*uint8)(unsafe.Pointer((data + uintptr(iFreeBlk))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr(iFreeBlk)) + 1))))) @@ -42381,7 +42429,7 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s var iPtrEnd int32 = (int32(iPtr) + ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iPtr) + 2)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iPtr) + 2))) + 1))))) if (iPtrEnd + 3) >= int32(iStart) { if iPtrEnd > int32(iStart) { - return Xsqlite3CorruptError(tls, 66253) + return Xsqlite3CorruptError(tls, 66748) } nFrag = U8(int32(nFrag) + (int32(iStart) - iPtrEnd)) iSize = (U16(iEnd - U32(iPtr))) @@ -42389,7 +42437,7 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s } } if int32(nFrag) > int32(*(*uint8)(unsafe.Pointer(data + uintptr((int32(hdr) + 7))))) { - return Xsqlite3CorruptError(tls, 66259) + return Xsqlite3CorruptError(tls, 66754) } *(*uint8)(unsafe.Pointer(data + uintptr((int32(hdr) + 7)))) -= uint8((int32(nFrag))) } @@ -42399,10 +42447,10 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s // so just extend the cell content area rather than create another // freelist entry if int32(iStart) < int32(x) { - return Xsqlite3CorruptError(tls, 66267) + return Xsqlite3CorruptError(tls, 66762) } if int32(iPtr) != (int32(hdr) + 1) { - return Xsqlite3CorruptError(tls, 66268) + return Xsqlite3CorruptError(tls, 66763) } *(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 1))))) = (U8((int32(iFreeBlk)) >> 8)) *(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 1))) + 1)) = U8(iFreeBlk) @@ -42436,7 +42484,7 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s // PTF_ZERODATA | PTF_LEAF // PTF_LEAFDATA | PTF_INTKEY // PTF_LEAFDATA | PTF_INTKEY | PTF_LEAF -func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite3.c:66298:12: */ +func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite3.c:66793:12: */ var pBt uintptr // A copy of pPage->pBt (*MemPage)(unsafe.Pointer(pPage)).Fleaf = (U8(flagByte >> 3)) @@ -42487,7 +42535,7 @@ func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite } else { // EVIDENCE-OF: R-47608-56469 Any other value for the b-tree page type is // an error. - return Xsqlite3CorruptError(tls, 66341) + return Xsqlite3CorruptError(tls, 66836) } (*MemPage)(unsafe.Pointer(pPage)).Fmax1bytePayload = (*BtShared)(unsafe.Pointer(pBt)).Fmax1bytePayload return SQLITE_OK @@ -42495,7 +42543,7 @@ func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite // Compute the amount of freespace on the page. In other words, fill // in the pPage->nFree field. -func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66351:12: */ +func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66846:12: */ var pc int32 // Address of a freeblock within pPage->aData[] var hdr U8 // Offset to beginning of page header var data uintptr // Equal to pPage->aData @@ -42527,12 +42575,12 @@ func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66 if pc < top { // EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will // always be at least one cell before the first freeblock. - return Xsqlite3CorruptError(tls, 66392) + return Xsqlite3CorruptError(tls, 66887) } for 1 != 0 { if pc > iCellLast { // Freeblock off the end of the page - return Xsqlite3CorruptError(tls, 66397) + return Xsqlite3CorruptError(tls, 66892) } next = (U32((int32(*(*U8)(unsafe.Pointer((data + uintptr(pc))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr(pc)) + 1))))) size = (U32((int32(*(*U8)(unsafe.Pointer((data + uintptr((pc + 2)))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((pc + 2))) + 1))))) @@ -42544,11 +42592,11 @@ func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66 } if next > U32(0) { // Freeblock not in ascending order - return Xsqlite3CorruptError(tls, 66407) + return Xsqlite3CorruptError(tls, 66902) } if (U32(pc) + size) > uint32(usableSize) { // Last freeblock extends past page end - return Xsqlite3CorruptError(tls, 66411) + return Xsqlite3CorruptError(tls, 66906) } } @@ -42559,7 +42607,7 @@ func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66 // serves to verify that the offset to the start of the cell-content // area, according to the page header, lies within the page. if (nFree > usableSize) || (nFree < iCellFirst) { - return Xsqlite3CorruptError(tls, 66423) + return Xsqlite3CorruptError(tls, 66918) } (*MemPage)(unsafe.Pointer(pPage)).FnFree = int32((U16(nFree - iCellFirst))) return SQLITE_OK @@ -42567,7 +42615,7 @@ func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66 // Do additional sanity check after btreeInitPage() if // PRAGMA cell_size_check=ON -func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66433:28: */ +func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66928:28: */ var iCellFirst int32 // First allowable cell or freeblock offset var iCellLast int32 // Last possible cell or freeblock offset var i int32 // Index into the cell pointer array @@ -42589,12 +42637,12 @@ func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66433 pc = int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((data + uintptr((cellOffset + (i * 2)))))))) if (pc < iCellFirst) || (pc > iCellLast) { - return Xsqlite3CorruptError(tls, 66454) + return Xsqlite3CorruptError(tls, 66949) } sz = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pPage + 120 /* &.xCellSize */))))(tls, pPage, (data + uintptr(pc)))) if (pc + sz) > usableSize { - return Xsqlite3CorruptError(tls, 66459) + return Xsqlite3CorruptError(tls, 66954) } } return SQLITE_OK @@ -42607,7 +42655,7 @@ func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66433 // SQLITE_CORRUPT. Note that a return of SQLITE_OK does not // guarantee that the page is well-formed. It only shows that // we failed to detect any corruption. -func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66474:12: */ +func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66969:12: */ var data uintptr // Equal to pPage->aData var pBt uintptr // The main btree structure @@ -42616,7 +42664,7 @@ func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66474:12: // EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating // the b-tree page type. if decodeFlags(tls, pPage, int32(*(*U8)(unsafe.Pointer(data)))) != 0 { - return Xsqlite3CorruptError(tls, 66491) + return Xsqlite3CorruptError(tls, 66986) } (*MemPage)(unsafe.Pointer(pPage)).FmaskPage = (U16((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1))) @@ -42630,7 +42678,7 @@ func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66474:12: (*MemPage)(unsafe.Pointer(pPage)).FnCell = (U16((int32(*(*U8)(unsafe.Pointer((data + 3)))) << 8) | int32(*(*U8)(unsafe.Pointer((data + 3) + 1))))) if U32((*MemPage)(unsafe.Pointer(pPage)).FnCell) > (((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(8)) / U32(6)) { // To many cells for a single page. The page must be corrupt - return Xsqlite3CorruptError(tls, 66505) + return Xsqlite3CorruptError(tls, 67000) } // EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only @@ -42640,7 +42688,7 @@ func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66474:12: (*MemPage)(unsafe.Pointer(pPage)).FnFree = -1 // Indicate that this value is yet uncomputed (*MemPage)(unsafe.Pointer(pPage)).FisInit = U8(1) - if ((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & SQLITE_CellSizeCk) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & uint64(SQLITE_CellSizeCk)) != 0 { return btreeCellSizeCheck(tls, pPage) } return SQLITE_OK @@ -42648,7 +42696,7 @@ func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66474:12: // Set up a raw page so that it looks like a database page holding // no entries. -func zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { /* sqlite3.c:66527:13: */ +func zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { /* sqlite3.c:67022:13: */ var data uintptr = (*MemPage)(unsafe.Pointer(pPage)).FaData var pBt uintptr = (*MemPage)(unsafe.Pointer(pPage)).FpBt var hdr U8 = (*MemPage)(unsafe.Pointer(pPage)).FhdrOffset @@ -42683,7 +42731,7 @@ func zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { /* sqlite3.c:66527:13 // Convert a DbPage obtained from the pager into a MemPage used by // the btree layer. -func btreePageFromDbPage(tls *libc.TLS, pDbPage uintptr, pgno Pgno, pBt uintptr) uintptr { /* sqlite3.c:66564:16: */ +func btreePageFromDbPage(tls *libc.TLS, pDbPage uintptr, pgno Pgno, pBt uintptr) uintptr { /* sqlite3.c:67059:16: */ var pPage uintptr = Xsqlite3PagerGetExtra(tls, pDbPage) if pgno != (*MemPage)(unsafe.Pointer(pPage)).Fpgno { (*MemPage)(unsafe.Pointer(pPage)).FaData = Xsqlite3PagerGetData(tls, pDbPage) @@ -42710,7 +42758,7 @@ func btreePageFromDbPage(tls *libc.TLS, pDbPage uintptr, pgno Pgno, pBt uintptr) // 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 *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:66588:12: */ +func btreeGetPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:67083:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -42728,7 +42776,7 @@ func btreeGetPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags i // 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 *libc.TLS, pBt uintptr, pgno Pgno) uintptr { /* sqlite3.c:66610:16: */ +func btreePageLookup(tls *libc.TLS, pBt uintptr, pgno Pgno) uintptr { /* sqlite3.c:67105:16: */ var pDbPage uintptr pDbPage = Xsqlite3PagerLookup(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pgno) @@ -42740,11 +42788,11 @@ func btreePageLookup(tls *libc.TLS, pBt uintptr, pgno Pgno) uintptr { /* sqlite3 // Return the size of the database file in pages. If there is any kind of // error, return ((unsigned int)-1). -func btreePagecount(tls *libc.TLS, pBt uintptr) Pgno { /* sqlite3.c:66624:13: */ +func btreePagecount(tls *libc.TLS, pBt uintptr) Pgno { /* sqlite3.c:67119:13: */ return (*BtShared)(unsafe.Pointer(pBt)).FnPage } -func Xsqlite3BtreeLastPage(tls *libc.TLS, p uintptr) Pgno { /* sqlite3.c:66627:21: */ +func Xsqlite3BtreeLastPage(tls *libc.TLS, p uintptr) Pgno { /* sqlite3.c:67122:21: */ return btreePagecount(tls, (*Btree)(unsafe.Pointer(p)).FpBt) } @@ -42760,7 +42808,7 @@ func Xsqlite3BtreeLastPage(tls *libc.TLS, p uintptr) Pgno { /* sqlite3.c:66627:2 // // If an error occurs, then *ppPage is undefined. It // may remain unchanged, or it may be set to an invalid value. -func getAndInitPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, pCur uintptr, bReadOnly int32) int32 { /* sqlite3.c:66645:12: */ +func getAndInitPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, pCur uintptr, bReadOnly int32) int32 { /* sqlite3.c:67140:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -42770,7 +42818,7 @@ func getAndInitPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, pCur if !(pgno > btreePagecount(tls, pBt)) { goto __1 } - rc = Xsqlite3CorruptError(tls, 66660) + rc = Xsqlite3CorruptError(tls, 67155) goto getAndInitPage_error1 __1: ; @@ -42801,7 +42849,7 @@ __3: if !((pCur != 0) && ((int32((*MemPage)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppPage))))).FnCell) < 1) || (int32((*MemPage)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppPage))))).FintKey) != int32((*BtCursor)(unsafe.Pointer(pCur)).FcurIntKey)))) { goto __5 } - rc = Xsqlite3CorruptError(tls, 66681) + rc = Xsqlite3CorruptError(tls, 67176) goto getAndInitPage_error2 __5: ; @@ -42825,18 +42873,18 @@ __6: // call to btreeGetPage. // // Page1 is a special case and must be released using releasePageOne(). -func releasePageNotNull(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:66704:13: */ +func releasePageNotNull(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:67199:13: */ Xsqlite3PagerUnrefNotNull(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage) } -func releasePage(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:66713:13: */ +func releasePage(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:67208:13: */ if pPage != 0 { releasePageNotNull(tls, pPage) } } -func releasePageOne(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:66716:13: */ +func releasePageOne(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:67211:13: */ Xsqlite3PagerUnrefPageOne(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage) } @@ -42848,13 +42896,13 @@ func releasePageOne(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:66716:13: */ // * 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 *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:66736:12: */ +func btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:67231:12: */ var rc int32 = btreeGetPage(tls, pBt, pgno, ppPage, flags) if rc == SQLITE_OK { if Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > 1 { releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return Xsqlite3CorruptError(tls, 66747) + return Xsqlite3CorruptError(tls, 67242) } (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = U8(0) } else { @@ -42869,7 +42917,7 @@ func btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, f // // This routine needs to reset the extra data section at the end of the // page to agree with the restored data. -func pageReinit(tls *libc.TLS, pData uintptr) { /* sqlite3.c:66765:13: */ +func pageReinit(tls *libc.TLS, pData uintptr) { /* sqlite3.c:67260:13: */ var pPage uintptr pPage = Xsqlite3PagerGetExtra(tls, pData) @@ -42889,10 +42937,10 @@ func pageReinit(tls *libc.TLS, pData uintptr) { /* sqlite3.c:66765:13: */ } // Invoke the busy handler for a btree. -func btreeInvokeBusyHandler(tls *libc.TLS, pArg uintptr) int32 { /* sqlite3.c:66787:12: */ +func btreeInvokeBusyHandler(tls *libc.TLS, pArg uintptr) int32 { /* sqlite3.c:67282:12: */ var pBt uintptr = pArg - return Xsqlite3InvokeBusyHandler(tls, ((*BtShared)(unsafe.Pointer(pBt)).Fdb + 624 /* &.busyHandler */)) + return Xsqlite3InvokeBusyHandler(tls, ((*BtShared)(unsafe.Pointer(pBt)).Fdb + 632 /* &.busyHandler */)) } // Open a database file. @@ -42914,7 +42962,7 @@ func btreeInvokeBusyHandler(tls *libc.TLS, pArg uintptr) int32 { /* sqlite3.c:66 // 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 Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintptr, ppBtree uintptr, flags int32, vfsFlags int32) int32 { /* sqlite3.c:66815:20: */ +func Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintptr, ppBtree uintptr, flags int32, vfsFlags int32) int32 { /* sqlite3.c:67310:20: */ bp := tls.Alloc(100) defer tls.Free(100) @@ -42946,7 +42994,7 @@ func Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt mutexOpen = uintptr(0) rc = SQLITE_OK isTempDb = (libc.Bool32((zFilename == uintptr(0)) || (int32(*(*int8)(unsafe.Pointer(zFilename))) == 0))) - isMemdb = (libc.Bool32((((zFilename != 0) && (libc.Xstrcmp(tls, zFilename, ts+2999 /* ":memory:" */) == 0)) || + isMemdb = (libc.Bool32((((zFilename != 0) && (libc.Xstrcmp(tls, zFilename, ts+3027 /* ":memory:" */) == 0)) || ((isTempDb != 0) && (Xsqlite3TempInMemory(tls, db) != 0))) || ((vfsFlags & SQLITE_OPEN_MEMORY) != 0))) @@ -42975,7 +43023,7 @@ __2: return SQLITE_NOMEM __3: ; - (*Btree)(unsafe.Pointer(p)).FinTrans = TRANS_NONE + (*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_NONE) (*Btree)(unsafe.Pointer(p)).Fdb = db (*Btree)(unsafe.Pointer(p)).Flock.FpBtree = p (*Btree)(unsafe.Pointer(p)).Flock.FiTable = Pgno(1) @@ -43135,7 +43183,7 @@ __24: // determined by the 2-byte integer located at an offset of 16 bytes from // the beginning of the database file. (*BtShared)(unsafe.Pointer(pBt)).FpageSize = (U32((int32(*(*uint8)(unsafe.Pointer(bp /* &zDbHeader[0] */ + 16))) << 8) | (int32(*(*uint8)(unsafe.Pointer(bp /* &zDbHeader[0] */ + 17))) << 16))) - if !((((*BtShared)(unsafe.Pointer(pBt)).FpageSize < U32(512)) || ((*BtShared)(unsafe.Pointer(pBt)).FpageSize > SQLITE_MAX_PAGE_SIZE)) || + if !((((*BtShared)(unsafe.Pointer(pBt)).FpageSize < U32(512)) || ((*BtShared)(unsafe.Pointer(pBt)).FpageSize > U32(SQLITE_MAX_PAGE_SIZE))) || ((((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1)) & (*BtShared)(unsafe.Pointer(pBt)).FpageSize) != U32(0))) { goto __25 } @@ -43307,7 +43355,7 @@ __44: if !(Xsqlite3BtreeSchema(tls, p, 0, uintptr(0)) == uintptr(0)) { goto __47 } - Xsqlite3PagerSetCachesize(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager, -2000) + Xsqlite3BtreeSetCacheSize(tls, p, -2000) __47: ; @@ -43335,7 +43383,7 @@ __49: // 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 *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:67113:12: */ +func removeFromSharingList(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:67608:12: */ var pMainMtx uintptr var pList uintptr var removed int32 = 0 @@ -43367,7 +43415,7 @@ func removeFromSharingList(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:6711 // 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 *libc.TLS, pBt uintptr) { /* sqlite3.c:67152:13: */ +func allocateTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67647:13: */ if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace) != 0) { (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace = Xsqlite3PageMalloc(tls, int32((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) @@ -43393,7 +43441,7 @@ func allocateTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67152:13: */ } // Free the pBt->pTmpSpace allocation -func freeTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67181:13: */ +func freeTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67676:13: */ if (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace != 0 { *(*uintptr)(unsafe.Pointer(pBt + 136 /* &.pTmpSpace */)) -= (uintptr(4)) Xsqlite3PageFree(tls, (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace) @@ -43402,7 +43450,7 @@ func freeTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67181:13: */ } // Close an open database and invalidate all cursors. -func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67192:20: */ +func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67687:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var pCur uintptr @@ -43459,7 +43507,7 @@ func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67192:20: // 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 Xsqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:67254:20: */ +func Xsqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:67749:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) @@ -43476,7 +43524,7 @@ func Xsqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { / // 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 Xsqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:67273:20: */ +func Xsqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:67768:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var res int32 @@ -43488,7 +43536,7 @@ func Xsqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { / // Change the limit on the amount of the database file that may be // memory mapped. -func Xsqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Sqlite3_int64) int32 { /* sqlite3.c:67288:20: */ +func Xsqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Sqlite3_int64) int32 { /* sqlite3.c:67783:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) @@ -43503,7 +43551,7 @@ func Xsqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Sqlite3_int64) i // there is a high probability of damage) Level 2 is the default. There // is a very low but non-zero probability of damage. Level 3 reduces the // probability of damage to near zero but with a write performance reduction. -func Xsqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) int32 { /* sqlite3.c:67307:20: */ +func Xsqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) int32 { /* sqlite3.c:67802:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) @@ -43530,7 +43578,7 @@ func Xsqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) int32 // // 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 Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve int32, iFix int32) int32 { /* sqlite3.c:67340:20: */ +func Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve int32, iFix int32) int32 { /* sqlite3.c:67835:20: */ var rc int32 = SQLITE_OK var x int32 var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt @@ -43548,6 +43596,9 @@ func Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve if ((pageSize >= 512) && (pageSize <= SQLITE_MAX_PAGE_SIZE)) && (((pageSize - 1) & pageSize) == 0) { + if (nReserve > 32) && (pageSize == 512) { + pageSize = 1024 + } (*BtShared)(unsafe.Pointer(pBt)).FpageSize = U32(pageSize) freeTempSpace(tls, pBt) } @@ -43561,7 +43612,7 @@ func Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve } // Return the currently defined page size -func Xsqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67371:20: */ +func Xsqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67867:20: */ return int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpageSize) } @@ -43574,7 +43625,7 @@ func Xsqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:673 // 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 Xsqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67386:20: */ +func Xsqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67882:20: */ var n int32 n = (int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpageSize - (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FusableSize)) @@ -43588,7 +43639,7 @@ func Xsqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) int32 { /* sqlite3 // The value returned is the larger of the current reserve size and // the latest reserve size requested by SQLITE_FILECTRL_RESERVE_BYTES. // The amount of reserve can only grow - never shrink. -func Xsqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67402:20: */ +func Xsqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67898:20: */ var n1 int32 var n2 int32 Xsqlite3BtreeEnter(tls, p) @@ -43604,7 +43655,7 @@ func Xsqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) int32 { /* sqlit // 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 Xsqlite3BtreeMaxPageCount(tls *libc.TLS, p uintptr, mxPage Pgno) Pgno { /* sqlite3.c:67417:21: */ +func Xsqlite3BtreeMaxPageCount(tls *libc.TLS, p uintptr, mxPage Pgno) Pgno { /* sqlite3.c:67913:21: */ var n Pgno Xsqlite3BtreeEnter(tls, p) n = Xsqlite3PagerMaxPageCount(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager, mxPage) @@ -43628,7 +43679,7 @@ func Xsqlite3BtreeMaxPageCount(tls *libc.TLS, p uintptr, mxPage Pgno) Pgno { /* // With BTS_SECURE_DELETE, operation is like BTS_OVERWRITE with the addition // that freelist leaf pages are written back into the database, increasing // the amount of disk I/O. -func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32 { /* sqlite3.c:67443:20: */ +func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32 { /* sqlite3.c:67939:20: */ var b int32 if p == uintptr(0) { return 0 @@ -43648,7 +43699,7 @@ func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32 { // 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 Xsqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) int32 { /* sqlite3.c:67464:20: */ +func Xsqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) int32 { /* sqlite3.c:67960:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var rc int32 = SQLITE_OK var av U8 = U8(autoVacuum) @@ -43681,7 +43732,7 @@ func Xsqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) int3 // Return the value of the 'auto-vacuum' property. If auto-vacuum is // enabled 1 is returned. Otherwise 0. -func Xsqlite3BtreeGetAutoVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67488:20: */ +func Xsqlite3BtreeGetAutoVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67984:20: */ var rc int32 Xsqlite3BtreeEnter(tls, p) rc = func() int32 { @@ -43706,7 +43757,7 @@ func Xsqlite3BtreeGetAutoVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:6 // 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 *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:67544:12: */ +func lockBtree(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68040:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -43750,7 +43801,7 @@ __2: nPage = *(*U32)(unsafe.Pointer(bp + 8 /* nPageFile */)) __3: ; - if !(((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & SQLITE_ResetDatabase) != uint64(0)) { + if !(((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & uint64(SQLITE_ResetDatabase)) != uint64(0)) { goto __4 } nPage = U32(0) @@ -43824,7 +43875,7 @@ __10: // // The original design allowed these amounts to vary, but as of // version 3.6.0, we require them to be fixed. - if !(libc.Xmemcmp(tls, (page1+21), ts+3008 /* "@ " */, uint64(3)) != 0) { + if !(libc.Xmemcmp(tls, (page1+21), ts+3036 /* "@ " */, uint64(3)) != 0) { goto __14 } goto page1_init_failed @@ -43837,7 +43888,7 @@ __14: // EVIDENCE-OF: R-25008-21688 The size of a page is a power of two // between 512 and 65536 inclusive. if !(((((pageSize - U32(1)) & pageSize) != U32(0)) || - (pageSize > SQLITE_MAX_PAGE_SIZE)) || + (pageSize > U32(SQLITE_MAX_PAGE_SIZE))) || (pageSize <= U32(256))) { goto __15 } @@ -43874,7 +43925,7 @@ __16: if !((Xsqlite3WritableSchema(tls, (*BtShared)(unsafe.Pointer(pBt)).Fdb) == 0) && (nPage > *(*U32)(unsafe.Pointer(bp + 8 /* nPageFile */)))) { goto __17 } - rc = Xsqlite3CorruptError(tls, 67669) + rc = Xsqlite3CorruptError(tls, 68165) goto page1_init_failed __17: ; @@ -43946,7 +43997,7 @@ page1_init_failed: // has the effect of releasing the read lock. // // If there is a transaction in progress, this routine is a no-op. -func unlockBtreeIfUnused(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67751:13: */ +func unlockBtreeIfUnused(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:68247:13: */ if (int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE) && ((*BtShared)(unsafe.Pointer(pBt)).FpPage1 != uintptr(0)) { var pPage1 uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpPage1 @@ -43959,7 +44010,7 @@ func unlockBtreeIfUnused(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67751:13: */ // 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 *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:67768:12: */ +func newDatabase(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68264:12: */ var pP1 uintptr var data uintptr var rc int32 @@ -43999,7 +44050,7 @@ func newDatabase(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:67768:12: */ // 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 Xsqlite3BtreeNewDb(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67812:20: */ +func Xsqlite3BtreeNewDb(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68308:20: */ var rc int32 Xsqlite3BtreeEnter(tls, p) (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FnPage = U32(0) @@ -44041,7 +44092,7 @@ func Xsqlite3BtreeNewDb(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67812:20: // 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 Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uintptr) int32 { /* sqlite3.c:67856:20: */ +func Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uintptr) int32 { /* sqlite3.c:68352:20: */ var pBt uintptr var pPager uintptr var rc int32 @@ -44064,7 +44115,7 @@ func Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVers __1: ; - if !((((*Sqlite3)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).Fdb)).Fflags & SQLITE_ResetDatabase) != 0) && + if !((((*Sqlite3)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).Fdb)).Fflags & uint64(SQLITE_ResetDatabase)) != 0) && (int32(Xsqlite3PagerIsreadonly(tls, pPager)) == 0)) { goto __2 } @@ -44130,7 +44181,7 @@ __11: // Any read-only or read-write transaction implies a read-lock on // page 1. So if some other shared-cache client already has a write-lock // on page 1, the transaction cannot be opened. - rc = querySharedCacheTableLock(tls, p, SCHEMA_ROOT, READ_LOCK) + rc = querySharedCacheTableLock(tls, p, uint32(SCHEMA_ROOT), uint8(READ_LOCK)) if !(SQLITE_OK != rc) { goto __12 } @@ -44221,7 +44272,7 @@ __16: goto __28 } - (*Btree)(unsafe.Pointer(p)).Flock.FeLock = READ_LOCK + (*Btree)(unsafe.Pointer(p)).Flock.FeLock = U8(READ_LOCK) (*Btree)(unsafe.Pointer(p)).Flock.FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpLock (*BtShared)(unsafe.Pointer(pBt)).FpLock = (p + 48 /* &.lock */) __28: @@ -44230,9 +44281,9 @@ __27: ; (*Btree)(unsafe.Pointer(p)).FinTrans = func() uint8 { if wrflag != 0 { - return TRANS_WRITE + return uint8(TRANS_WRITE) } - return TRANS_READ + return uint8(TRANS_READ) }() if !(int32((*Btree)(unsafe.Pointer(p)).FinTrans) > int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction)) { goto __29 @@ -44305,7 +44356,7 @@ __34: // 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 *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:68036:12: */ +func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:68532:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -44333,13 +44384,13 @@ func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:68036:12 if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) { var childPgno Pgno = Xsqlite3Get4byte(tls, pCell) - ptrmapPut(tls, pBt, childPgno, PTRMAP_BTREE, pgno, bp /* &rc */) + ptrmapPut(tls, pBt, childPgno, uint8(PTRMAP_BTREE), pgno, bp /* &rc */) } } if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) { var childPgno Pgno = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8)))) - ptrmapPut(tls, pBt, childPgno, PTRMAP_BTREE, pgno, bp /* &rc */) + ptrmapPut(tls, pBt, childPgno, uint8(PTRMAP_BTREE), pgno, bp /* &rc */) } return *(*int32)(unsafe.Pointer(bp /* rc */)) @@ -44357,14 +44408,14 @@ func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:68036:12 // // PTRMAP_OVERFLOW2: pPage is an overflow-page. The pointer points at the next // overflow page in the list. -func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType U8) int32 { /* sqlite3.c:68081:12: */ +func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType U8) int32 { /* sqlite3.c:68577:12: */ bp := tls.Alloc(24) defer tls.Free(24) if int32(eType) == PTRMAP_OVERFLOW2 { // The pointer is always the first 4 bytes of the page in this case. if Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return Xsqlite3CorruptError(tls, 68087) + return Xsqlite3CorruptError(tls, 68583) } Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -44390,7 +44441,7 @@ func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, pCell, bp /* &info */) if U32((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnLocal) < (*CellInfo)(unsafe.Pointer(bp /* &info */)).FnPayload { if (pCell + uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize)) > ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)) { - return Xsqlite3CorruptError(tls, 68106) + return Xsqlite3CorruptError(tls, 68602) } if iFrom == Xsqlite3Get4byte(tls, ((pCell+uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize))-uintptr(4))) { Xsqlite3Put4byte(tls, ((pCell + uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize)) - uintptr(4)), iTo) @@ -44407,7 +44458,7 @@ func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType if i == nCell { if (int32(eType) != PTRMAP_BTREE) || (Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8)))) != iFrom) { - return Xsqlite3CorruptError(tls, 68124) + return Xsqlite3CorruptError(tls, 68620) } Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8))), iTo) } @@ -44422,7 +44473,7 @@ func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType // 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 *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPage Pgno, iFreePage Pgno, isCommit int32) int32 { /* sqlite3.c:68142:12: */ +func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPage Pgno, iFreePage Pgno, isCommit int32) int32 { /* sqlite3.c:68638:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -44433,7 +44484,7 @@ func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPag // var rc int32 at bp, 4 if iDbPage < Pgno(3) { - return Xsqlite3CorruptError(tls, 68159) + return Xsqlite3CorruptError(tls, 68655) } // Move page iDbPage from its current location to page number iFreePage @@ -44459,7 +44510,7 @@ func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPag } else { var nextOvfl Pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pDbPage)).FaData) if nextOvfl != Pgno(0) { - ptrmapPut(tls, pBt, nextOvfl, PTRMAP_OVERFLOW2, iFreePage, bp /* &rc */) + ptrmapPut(tls, pBt, nextOvfl, uint8(PTRMAP_OVERFLOW2), iFreePage, bp /* &rc */) if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp /* rc */)) } @@ -44503,7 +44554,7 @@ func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPag // 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 *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit int32) int32 { /* sqlite3.c:68236:12: */ +func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit int32) int32 { /* sqlite3.c:68732:12: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -44525,7 +44576,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit return rc } if int32(*(*U8)(unsafe.Pointer(bp /* eType */))) == PTRMAP_ROOTPAGE { - return Xsqlite3CorruptError(tls, 68257) + return Xsqlite3CorruptError(tls, 68753) } if int32(*(*U8)(unsafe.Pointer(bp /* eType */))) == PTRMAP_FREEPAGE { @@ -44538,7 +44589,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // var pFreePg uintptr at bp+8, 8 - rc = allocateBtreePage(tls, pBt, bp+8 /* &pFreePg */, bp+16 /* &iFreePg */, iLastPg, BTALLOC_EXACT) + rc = allocateBtreePage(tls, pBt, bp+8 /* &pFreePg */, bp+16 /* &iFreePg */, iLastPg, uint8(BTALLOC_EXACT)) if rc != SQLITE_OK { return rc } @@ -44550,8 +44601,8 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // Index of free page to move pLastPg to // var pLastPg uintptr at bp+24, 8 - var eMode U8 = BTALLOC_ANY // Mode parameter for allocateBtreePage() - var iNear Pgno = Pgno(0) // nearby parameter for allocateBtreePage() + var eMode U8 = U8(BTALLOC_ANY) // Mode parameter for allocateBtreePage() + var iNear Pgno = Pgno(0) // nearby parameter for allocateBtreePage() rc = btreeGetPage(tls, pBt, iLastPg, bp+24 /* &pLastPg */, 0) if rc != SQLITE_OK { @@ -44565,7 +44616,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // looping until a free-page located within the first nFin pages // of the file is found. if bCommit == 0 { - eMode = BTALLOC_LE + eMode = U8(BTALLOC_LE) iNear = nFin } for ok := true; ok; ok = ((bCommit != 0) && (*(*Pgno)(unsafe.Pointer(bp + 40 /* iFreePg */)) > nFin)) { @@ -44600,7 +44651,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // 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 *libc.TLS, pBt uintptr, nOrig Pgno, nFree Pgno) Pgno { /* sqlite3.c:68332:13: */ +func finalDbSize(tls *libc.TLS, pBt uintptr, nOrig Pgno, nFree Pgno) Pgno { /* sqlite3.c:68828:13: */ var nEntry int32 // Number of entries on one ptrmap page var nPtrmap Pgno // Number of PtrMap pages to be freed var nFin Pgno // Return value @@ -44624,7 +44675,7 @@ func finalDbSize(tls *libc.TLS, pBt uintptr, nOrig Pgno, nFree Pgno) Pgno { /* s // 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 Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68358:20: */ +func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68854:20: */ var rc int32 var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt @@ -44638,7 +44689,7 @@ func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:6835 var nFin Pgno = finalDbSize(tls, pBt, nOrig, nFree) if (nOrig < nFin) || (nFree >= nOrig) { - rc = Xsqlite3CorruptError(tls, 68372) + rc = Xsqlite3CorruptError(tls, 68868) } else if nFree > Pgno(0) { rc = saveAllCursors(tls, pBt, uint32(0), uintptr(0)) if rc == SQLITE_OK { @@ -44664,7 +44715,7 @@ func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:6835 // 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 *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68400:12: */ +func autoVacuumCommit(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68896:12: */ var rc int32 = SQLITE_OK var pPager uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpPager @@ -44681,13 +44732,13 @@ func autoVacuumCommit(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68400:12: // It is not possible to create a database for which the final page // is either a pointer-map page or the pending-byte page. If one // is encountered, this indicates corruption. - return Xsqlite3CorruptError(tls, 68420) + return Xsqlite3CorruptError(tls, 68916) } nFree = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + 36)) nFin = finalDbSize(tls, pBt, nOrig, nFree) if nFin > nOrig { - return Xsqlite3CorruptError(tls, 68425) + return Xsqlite3CorruptError(tls, 68921) } if nFin < nOrig { rc = saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -44735,7 +44786,7 @@ func autoVacuumCommit(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68400:12: // // 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 Xsqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) int32 { /* sqlite3.c:68479:20: */ +func Xsqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) int32 { /* sqlite3.c:68975:20: */ var rc int32 = SQLITE_OK if int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE { var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt @@ -44758,7 +44809,7 @@ func Xsqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) i // This function is called from both BtreeCommitPhaseTwo() and BtreeRollback() // at the conclusion of a transaction. -func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:68506:13: */ +func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:69002:13: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var db uintptr = (*Btree)(unsafe.Pointer(p)).Fdb @@ -44768,7 +44819,7 @@ func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:68506:13: */ // handle, downgrade to a read-only transaction. The other statements // may still be reading from the database. downgradeAllSharedCacheTableLocks(tls, p) - (*Btree)(unsafe.Pointer(p)).FinTrans = TRANS_READ + (*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_READ) } else { // If the handle had any kind of transaction open, decrement the // transaction count of the shared btree. If the transaction count @@ -44778,13 +44829,13 @@ func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:68506:13: */ clearAllSharedCacheTableLocks(tls, p) (*BtShared)(unsafe.Pointer(pBt)).FnTransaction-- if 0 == (*BtShared)(unsafe.Pointer(pBt)).FnTransaction { - (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = TRANS_NONE + (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_NONE) } } // Set the current transaction state to TRANS_NONE and unlock the // pager if this call closed the only read or write transaction. - (*Btree)(unsafe.Pointer(p)).FinTrans = TRANS_NONE + (*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_NONE) unlockBtreeIfUnused(tls, pBt) } @@ -44814,7 +44865,7 @@ func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:68506:13: */ // // This will release the write lock on the database file. If there // are no active cursors, it also releases the read lock. -func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 { /* sqlite3.c:68568:20: */ +func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 { /* sqlite3.c:69064:20: */ if int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_NONE { return SQLITE_OK @@ -44833,7 +44884,7 @@ func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 return rc } (*Btree)(unsafe.Pointer(p)).FiDataVersion-- // Compensate for pPager->iDataVersion++; - (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = TRANS_READ + (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_READ) btreeClearHasContent(tls, pBt) } @@ -44843,7 +44894,7 @@ func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 } // Do both phases of a commit. -func Xsqlite3BtreeCommit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68600:20: */ +func Xsqlite3BtreeCommit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:69096:20: */ var rc int32 Xsqlite3BtreeEnter(tls, p) rc = Xsqlite3BtreeCommitPhaseOne(tls, p, uintptr(0)) @@ -44878,7 +44929,7 @@ func Xsqlite3BtreeCommit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68600:20 // // SQLITE_OK is returned if successful, or if an error occurs while // saving a cursor position, an SQLite error code. -func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, writeOnly int32) int32 { /* sqlite3.c:68637:20: */ +func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, writeOnly int32) int32 { /* sqlite3.c:69133:20: */ var p uintptr var rc int32 = SQLITE_OK @@ -44895,7 +44946,7 @@ func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, w } } else { Xsqlite3BtreeClearCursor(tls, p) - (*BtCursor)(unsafe.Pointer(p)).FeState = CURSOR_FAULT + (*BtCursor)(unsafe.Pointer(p)).FeState = U8(CURSOR_FAULT) (*BtCursor)(unsafe.Pointer(p)).FskipNext = errCode } btreeReleaseAllCursorPages(tls, p) @@ -44907,7 +44958,7 @@ func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, w // Set the pBt->nPage field correctly, according to the current // state of the database. Assume pBt->pPage1 is valid. -func btreeSetNPage(tls *libc.TLS, pBt uintptr, pPage1 uintptr) { /* sqlite3.c:68669:13: */ +func btreeSetNPage(tls *libc.TLS, pBt uintptr, pPage1 uintptr) { /* sqlite3.c:69165:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -44929,7 +44980,7 @@ func btreeSetNPage(tls *libc.TLS, pBt uintptr, pPage1 uintptr) { /* sqlite3.c:68 // // This will release the write lock on the database file. If there // are no active cursors, it also releases the read lock. -func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly int32) int32 { /* sqlite3.c:68688:20: */ +func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly int32) int32 { /* sqlite3.c:69184:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -44970,7 +45021,7 @@ func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly i releasePageOne(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage1 */))) } - (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = TRANS_READ + (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_READ) btreeClearHasContent(tls, pBt) } @@ -44995,7 +45046,7 @@ func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly i // are no active savepoints and no other statement-transactions open, // iStatement is 1. This anonymous savepoint can be released or rolled back // using the sqlite3BtreeSavepoint() function. -func Xsqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) int32 { /* sqlite3.c:68753:20: */ +func Xsqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) int32 { /* sqlite3.c:69249:20: */ var rc int32 var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) @@ -45019,7 +45070,7 @@ func Xsqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) int32 { // 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 Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:68784:20: */ +func Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:69280:20: */ var rc int32 = SQLITE_OK if (p != 0) && (int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE) { var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt @@ -45087,7 +45138,7 @@ func Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32 // // It is assumed that the sqlite3BtreeCursorZero() has been called // on pCur to initialize the memory space prior to invoking this routine. -func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:68855:12: */ +func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:69351:12: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt // Shared b-tree handle var pX uintptr // Looping over other all cursors @@ -45106,7 +45157,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u } if iTable <= Pgno(1) { if iTable < Pgno(1) { - return Xsqlite3CorruptError(tls, 68891) + return Xsqlite3CorruptError(tls, 69387) } else if btreePagecount(tls, pBt) == Pgno(0) { iTable = Pgno(0) @@ -45122,7 +45173,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u (*BtCursor)(unsafe.Pointer(pCur)).FpBt = pBt (*BtCursor)(unsafe.Pointer(pCur)).FcurFlags = func() uint8 { if wrFlag != 0 { - return BTCF_WriteFlag + return uint8(BTCF_WriteFlag) } return uint8(0) }() @@ -45130,7 +45181,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u if wrFlag != 0 { return uint8(0) } - return PAGER_GET_READONLY + return uint8(PAGER_GET_READONLY) }() // If there are two or more cursors on the same btree, then all such // cursors *must* have the BTCF_Multiple flag set. @@ -45142,11 +45193,11 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u } (*BtCursor)(unsafe.Pointer(pCur)).FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpCursor (*BtShared)(unsafe.Pointer(pBt)).FpCursor = pCur - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_OK } -func btreeCursorWithLock(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:68920:12: */ +func btreeCursorWithLock(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:69416:12: */ var rc int32 Xsqlite3BtreeEnter(tls, p) rc = btreeCursor(tls, p, iTable, wrFlag, pKeyInfo, pCur) @@ -45154,7 +45205,7 @@ func btreeCursorWithLock(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pK return rc } -func Xsqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:68933:20: */ +func Xsqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:69429:20: */ if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 { return btreeCursorWithLock(tls, p, iTable, wrFlag, pKeyInfo, pCur) } else { @@ -45169,7 +45220,7 @@ func Xsqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pK // 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 Xsqlite3BtreeCursorSize(tls *libc.TLS) int32 { /* sqlite3.c:68955:20: */ +func Xsqlite3BtreeCursorSize(tls *libc.TLS) int32 { /* sqlite3.c:69451:20: */ return (int32(((uint64(unsafe.Sizeof(BtCursor{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) } @@ -45179,13 +45230,13 @@ func Xsqlite3BtreeCursorSize(tls *libc.TLS) int32 { /* sqlite3.c:68955:20: */ // 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 Xsqlite3BtreeCursorZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:68967:21: */ +func Xsqlite3BtreeCursorZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:69463:21: */ libc.Xmemset(tls, p, 0, uint64((uintptr(0) + 32 /* &.pBt */))) } // Close a cursor. The read lock on the database file is released // when the last cursor is closed. -func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:68975:20: */ +func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69471:20: */ var pBtree uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBtree if pBtree != 0 { var pBt uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBt @@ -45219,7 +45270,7 @@ func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c: // // BtCursor.info is a cache of the information in the current cell. // Using this cache reduces the number of calls to btreeParseCell(). -func getCellInfo(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69029:29: */ +func getCellInfo(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69525:29: */ if int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize) == 0 { *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((BTCF_ValidNKey)) btreeParseCell(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpPage, int32((*BtCursor)(unsafe.Pointer(pCur)).Fix), (pCur + 48 /* &.info */)) @@ -45228,7 +45279,7 @@ func getCellInfo(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69029:29: */ } } -func Xsqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69048:20: */ +func Xsqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69544:20: */ return (libc.Bool32(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID)) } @@ -45237,26 +45288,26 @@ func Xsqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) int32 { /* sqlite // 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 Xsqlite3BtreeIntegerKey(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:69059:20: */ +func Xsqlite3BtreeIntegerKey(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:69555:20: */ getCellInfo(tls, pCur) return (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey } // Pin or unpin a cursor. -func Xsqlite3BtreeCursorPin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69070:21: */ +func Xsqlite3BtreeCursorPin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69566:21: */ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((BTCF_Pinned)) } -func Xsqlite3BtreeCursorUnpin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69074:21: */ +func Xsqlite3BtreeCursorUnpin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69570:21: */ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_Pinned))) } // Return the offset into the database file for the start of the // payload to which the cursor is pointing. -func Xsqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:69084:20: */ +func Xsqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:69580:20: */ getCellInfo(tls, pCur) return ((I64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize) * (I64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).Fpgno) - int64(1))) + (I64((int64((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload) - int64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaData)) / 1))) @@ -45269,7 +45320,7 @@ func Xsqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:69084:2 // The caller must guarantee that the cursor is pointing to a non-NULL // valid entry. In other words, the calling procedure must guarantee // that the cursor has Cursor.eState==CURSOR_VALID. -func Xsqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) U32 { /* sqlite3.c:69102:20: */ +func Xsqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) U32 { /* sqlite3.c:69598:20: */ getCellInfo(tls, pCur) return (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload @@ -45286,7 +45337,7 @@ func Xsqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) U32 { /* sqlite3.c:69 // // The current implementation merely returns the size of the underlying // database file. -func Xsqlite3BtreeMaxRecordSize(tls *libc.TLS, pCur uintptr) Sqlite3_int64 { /* sqlite3.c:69122:30: */ +func Xsqlite3BtreeMaxRecordSize(tls *libc.TLS, pCur uintptr) Sqlite3_int64 { /* sqlite3.c:69618:30: */ return (Sqlite3_int64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize) * Sqlite3_int64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage)) } @@ -45308,7 +45359,7 @@ func Xsqlite3BtreeMaxRecordSize(tls *libc.TLS, pCur uintptr) Sqlite3_int64 { /* // 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 *libc.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgnoNext uintptr) int32 { /* sqlite3.c:69147:12: */ +func getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgnoNext uintptr) int32 { /* sqlite3.c:69643:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -45376,7 +45427,7 @@ func getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgn // of data are copied from the buffer pBuf to pPayload. // // SQLITE_OK is returned on success, otherwise an error code. -func copyPayload(tls *libc.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eOp int32, pDbPage uintptr) int32 { /* sqlite3.c:69215:12: */ +func copyPayload(tls *libc.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eOp int32, pDbPage uintptr) int32 { /* sqlite3.c:69711:12: */ if eOp != 0 { // Copy data from buffer to page (a write operation) var rc int32 = Xsqlite3PagerWrite(tls, pDbPage) @@ -45418,7 +45469,7 @@ func copyPayload(tls *libc.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eOp // * An incremental vacuum, // * A commit in auto_vacuum="full" mode, // * Creating a table (may require moving an overflow page). -func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr, eOp int32) int32 { /* sqlite3.c:69265:12: */ +func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr, eOp int32) int32 { /* sqlite3.c:69761:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -45436,7 +45487,7 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt // conditional above is really: // &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] // but is recast into its current form to avoid integer overflow problems - return Xsqlite3CorruptError(tls, 69298) + return Xsqlite3CorruptError(tls, 69794) } // Check if data must be read/written to/from the btree page itself. @@ -45493,7 +45544,7 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt for *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) != 0 { // If required, populate the overflow page-list cache. if *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) > (*BtShared)(unsafe.Pointer(pBt)).FnPage { - return Xsqlite3CorruptError(tls, 69360) + return Xsqlite3CorruptError(tls, 69856) } *(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) @@ -45553,7 +45604,7 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt if (rc == SQLITE_OK) && (amt > U32(0)) { // Overflow chain ends prematurely - return Xsqlite3CorruptError(tls, 69445) + return Xsqlite3CorruptError(tls, 69941) } return rc } @@ -45573,7 +45624,7 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt // Return SQLITE_OK on success or an error code if anything goes // wrong. An error is returned if "offset+amt" is larger than // the available payload. -func Xsqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69467:20: */ +func Xsqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69963:20: */ return accessPayload(tls, pCur, offset, amt, pBuf, 0) } @@ -45581,7 +45632,7 @@ func Xsqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf // This variant of sqlite3BtreePayload() works even if the cursor has not // in the CURSOR_VALID state. It is only used by the sqlite3_blob_read() // interface. -func accessPayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69481:28: */ +func accessPayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69977:28: */ var rc int32 if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_INVALID { return SQLITE_ABORT @@ -45594,7 +45645,7 @@ func accessPayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf return accessPayload(tls, pCur, offset, amt, pBuf, 0) } -func Xsqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69495:20: */ +func Xsqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69991:20: */ if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID { return accessPayload(tls, pCur, offset, amt, pBuf, 0) @@ -45621,7 +45672,7 @@ func Xsqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U3 // 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 *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:69524:19: */ +func fetchPayload(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:70020:19: */ var amt int32 amt = int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) @@ -45652,7 +45703,7 @@ func fetchPayload(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite // // These routines is used to get quick access to key and data // in the common case where no overflow pages are used. -func Xsqlite3BtreePayloadFetch(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:69563:27: */ +func Xsqlite3BtreePayloadFetch(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:70059:27: */ return fetchPayload(tls, pCur, pAmt) } @@ -45663,11 +45714,11 @@ func Xsqlite3BtreePayloadFetch(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintpt // the new child page does not match the flags field of the parent (i.e. // if an intkey page appears to be the parent of a non-intkey page, or // vice-versa). -func moveToChild(tls *libc.TLS, pCur uintptr, newPgno U32) int32 { /* sqlite3.c:69577:12: */ +func moveToChild(tls *libc.TLS, pCur uintptr, newPgno U32) int32 { /* sqlite3.c:70073:12: */ var pBt uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBt if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) >= (BTCURSOR_MAX_DEPTH - 1) { - return Xsqlite3CorruptError(tls, 69585) + return Xsqlite3CorruptError(tls, 70081) } (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0) *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32((BTCF_ValidNKey | BTCF_ValidOvfl)))) @@ -45684,7 +45735,7 @@ func moveToChild(tls *libc.TLS, pCur uintptr, newPgno U32) int32 { /* sqlite3.c: // 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 *libc.TLS, pCur uintptr) { /* sqlite3.c:69626:13: */ +func moveToParent(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:70122:13: */ var pLeaf uintptr (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0) @@ -45714,7 +45765,7 @@ func moveToParent(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69626:13: */ // 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 *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69667:12: */ +func moveToRoot(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70163:12: */ var pRoot uintptr var rc int32 var subpage Pgno @@ -45744,7 +45795,7 @@ __1: if !((*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot == Pgno(0)) { goto __6 } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_EMPTY goto __7 __6: @@ -45767,7 +45818,7 @@ __8: if !(rc != SQLITE_OK) { goto __10 } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return rc __10: ; @@ -45793,7 +45844,7 @@ __2: if !((int32((*MemPage)(unsafe.Pointer(pRoot)).FisInit) == 0) || ((libc.Bool32((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0))) != int32((*MemPage)(unsafe.Pointer(pRoot)).FintKey))) { goto __11 } - return Xsqlite3CorruptError(tls, 69723) + return Xsqlite3CorruptError(tls, 70219) __11: ; @@ -45806,7 +45857,7 @@ skip_init: if !(int32((*MemPage)(unsafe.Pointer(pRoot)).FnCell) > 0) { goto __12 } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) goto __13 __12: if !(!(int32((*MemPage)(unsafe.Pointer(pRoot)).Fleaf) != 0)) { @@ -45815,15 +45866,15 @@ __12: if !((*MemPage)(unsafe.Pointer(pRoot)).Fpgno != Pgno(1)) { goto __16 } - return Xsqlite3CorruptError(tls, 69736) + return Xsqlite3CorruptError(tls, 70232) __16: ; subpage = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pRoot)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pRoot)).FhdrOffset) + 8)))) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) rc = moveToChild(tls, pCur, subpage) goto __15 __14: - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) rc = SQLITE_EMPTY __15: ; @@ -45837,7 +45888,7 @@ __13: // // The left-most leaf is the one with the smallest key - the first // in ascending order. -func moveToLeftmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69754:12: */ +func moveToLeftmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70250:12: */ var pgno Pgno var rc int32 = SQLITE_OK var pPage uintptr @@ -45858,7 +45909,7 @@ func moveToLeftmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69754:12: // // The right-most entry is the one with the largest key - the last // key in ascending order. -func moveToRightmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69779:12: */ +func moveToRightmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70275:12: */ var pgno Pgno var rc int32 = SQLITE_OK var pPage uintptr = uintptr(0) @@ -45879,7 +45930,7 @@ func moveToRightmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69779:12: // 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 Xsqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:69802:20: */ +func Xsqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:70298:20: */ var rc int32 rc = moveToRoot(tls, pCur) @@ -45898,7 +45949,7 @@ func Xsqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sq // Move the cursor to the last entry in the table. Return SQLITE_OK // on success. Set *pRes to 0 if the cursor actually points to something // or set *pRes to 1 if the table is empty. -func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:69824:20: */ +func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:70320:20: */ var rc int32 // If the cursor already points to the last entry, this is a no-op. @@ -45954,7 +46005,7 @@ func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sql // // For index tables, the pIdxKey->eqSeen field is set to 1 if there // exists an entry in the table that exactly matches pIdxKey. -func Xsqlite3BtreeMovetoUnpacked(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, intKey I64, biasRight int32, pRes uintptr) int32 { /* sqlite3.c:69894:20: */ +func Xsqlite3BtreeMovetoUnpacked(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, intKey I64, biasRight int32, pRes uintptr) int32 { /* sqlite3.c:70390:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -46103,7 +46154,7 @@ __24: if !(pCell >= (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd) { goto __26 } - return Xsqlite3CorruptError(tls, 69997) + return Xsqlite3CorruptError(tls, 70497) __26: ; goto __24 @@ -46210,7 +46261,7 @@ __40: if !((nCell < 2) || ((U32(nCell) / (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize) > (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage)) { goto __42 } - rc = Xsqlite3CorruptError(tls, 70072) + rc = Xsqlite3CorruptError(tls, 70572) goto moveto_finish __42: ; @@ -46259,7 +46310,7 @@ __47: if !((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0) { goto __49 } - rc = Xsqlite3CorruptError(tls, 70104) + rc = Xsqlite3CorruptError(tls, 70604) __49: ; goto moveto_finish @@ -46329,7 +46380,7 @@ moveto_finish: // TRUE will be returned after a call to sqlite3BtreeNext() moves // past the last entry in the table or sqlite3BtreePrev() moves past // the first entry. TRUE is also returned if the table is empty. -func Xsqlite3BtreeEof(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70145:20: */ +func Xsqlite3BtreeEof(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70645:20: */ // TODO: What if the cursor is in CURSOR_REQUIRESEEK but all table entries // have been deleted? This API will need to change to return an error code // as well as the boolean result value. @@ -46339,7 +46390,7 @@ func Xsqlite3BtreeEof(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70145:20 // 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 Xsqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:70158:20: */ +func Xsqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:70658:20: */ var n I64 var i U8 @@ -46378,7 +46429,7 @@ func Xsqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:70 // skipped if the SQL index had been a unique index. The F argument // is a hint to the implement. SQLite btree implementation does not use // this hint, but COMDB2 does. -func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ +func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70698:28: */ var rc int32 var idx int32 var pPage uintptr @@ -46398,7 +46449,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ return SQLITE_DONE } if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_SKIPNEXT { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) if (*BtCursor)(unsafe.Pointer(pCur)).FskipNext > 0 { return SQLITE_OK } @@ -46407,7 +46458,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage idx = int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1)) - if !(int32((*MemPage)(unsafe.Pointer(pPage)).FisInit) != 0) { + if !(int32((*MemPage)(unsafe.Pointer(pPage)).FisInit) != 0) || (Xsqlite3FaultSim(tls, 412) != 0) { // The only known way for this to happen is for there to be a // recursive SQL function that does a DELETE operation as part of a // SELECT which deletes content out from under an active cursor @@ -46415,7 +46466,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ // has pages in common with the table being queried. See TH3 // module cov1/btree78.test testcase 220 (2018-06-08) for an // example. - return Xsqlite3CorruptError(tls, 70229) + return Xsqlite3CorruptError(tls, 70729) } // If the database file is corrupt, it is possible for the value of idx @@ -46437,7 +46488,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ } for ok := true; ok; ok = (int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)) { if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_DONE } moveToParent(tls, pCur) @@ -46457,7 +46508,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ return int32(0) } -func Xsqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:70268:20: */ +func Xsqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:70768:20: */ var pPage uintptr _ = flags // Used in COMDB2 but not native SQLite @@ -46497,7 +46548,7 @@ func Xsqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqli // skipped if the SQL index had been a unique index. The F argument is a // hint to the implement. The native SQLite btree implementation does not // use this hint, but COMDB2 does. -func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70308:28: */ +func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70808:28: */ var rc int32 var pPage uintptr @@ -46515,7 +46566,7 @@ func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70308:28: * return SQLITE_DONE } if CURSOR_SKIPNEXT == int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) if (*BtCursor)(unsafe.Pointer(pCur)).FskipNext < 0 { return SQLITE_OK } @@ -46534,7 +46585,7 @@ func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70308:28: * } else { for int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) == 0 { if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_DONE } moveToParent(tls, pCur) @@ -46551,7 +46602,7 @@ func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70308:28: * return rc } -func Xsqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:70357:20: */ +func Xsqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:70857:20: */ _ = flags // Used in COMDB2 but not native SQLite *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(((BTCF_AtLast | BTCF_ValidOvfl) | BTCF_ValidNKey)))) @@ -46585,7 +46636,7 @@ func Xsqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* // 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 *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintptr, nearby Pgno, eMode U8) int32 { /* sqlite3.c:70395:12: */ +func allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintptr, nearby Pgno, eMode U8) int32 { /* sqlite3.c:70895:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -46652,7 +46703,7 @@ func allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintptr if !(n >= mxPage) { goto __1 } - return Xsqlite3CorruptError(tls, 70419) + return Xsqlite3CorruptError(tls, 70919) __1: ; if !(n > U32(0)) { @@ -46733,7 +46784,7 @@ __15: if !((iTrunk > mxPage) || (libc.PostIncUint32(&nSearch, 1) > n)) { goto __16 } - rc = Xsqlite3CorruptError(tls, 70475) + rc = Xsqlite3CorruptError(tls, 70975) goto __17 __16: rc = btreeGetUnusedPage(tls, pBt, iTrunk, bp+8 /* &pTrunk */, 0) @@ -46775,7 +46826,7 @@ __19: goto __22 } // Value of k is out of range. Database corruption - rc = Xsqlite3CorruptError(tls, 70504) + rc = Xsqlite3CorruptError(tls, 71004) goto end_allocate_page goto __23 __22: @@ -46820,7 +46871,7 @@ __27: if !(iNewTrunk > mxPage) { goto __32 } - rc = Xsqlite3CorruptError(tls, 70538) + rc = Xsqlite3CorruptError(tls, 71038) goto end_allocate_page __32: ; @@ -46934,7 +46985,7 @@ __40: if !(iPage > mxPage) { goto __51 } - rc = Xsqlite3CorruptError(tls, 70603) + rc = Xsqlite3CorruptError(tls, 71103) goto end_allocate_page __51: ; @@ -47109,7 +47160,7 @@ end_allocate_page: // // 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 *libc.TLS, pBt uintptr, pMemPage uintptr, iPage Pgno) int32 { /* sqlite3.c:70717:12: */ +func freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage Pgno) int32 { /* sqlite3.c:71217:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -47130,7 +47181,7 @@ func freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage Pgno) int32 { if !((iPage < Pgno(2)) || (iPage > (*BtShared)(unsafe.Pointer(pBt)).FnPage)) { goto __1 } - return Xsqlite3CorruptError(tls, 70730) + return Xsqlite3CorruptError(tls, 71230) __1: ; if !(pMemPage != 0) { @@ -47176,7 +47227,7 @@ __5: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __7 } - ptrmapPut(tls, pBt, iPage, PTRMAP_FREEPAGE, uint32(0), bp+8 /* &rc */) + ptrmapPut(tls, pBt, iPage, uint8(PTRMAP_FREEPAGE), uint32(0), bp+8 /* &rc */) if !(*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0) { goto __8 } @@ -47200,7 +47251,7 @@ __7: if !(iTrunk > btreePagecount(tls, pBt)) { goto __10 } - *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3CorruptError(tls, 70777) + *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3CorruptError(tls, 71277) goto freepage_out __10: ; @@ -47217,7 +47268,7 @@ __11: if !(nLeaf > (((*BtShared)(unsafe.Pointer(pBt)).FusableSize / U32(4)) - U32(2))) { goto __12 } - *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3CorruptError(tls, 70788) + *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3CorruptError(tls, 71288) goto freepage_out __12: ; @@ -47298,7 +47349,7 @@ __18: return *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) } -func freePage(tls *libc.TLS, pPage uintptr, pRC uintptr) { /* sqlite3.c:70851:13: */ +func freePage(tls *libc.TLS, pPage uintptr, pRC uintptr) { /* sqlite3.c:71351:13: */ if (*(*int32)(unsafe.Pointer(pRC))) == SQLITE_OK { *(*int32)(unsafe.Pointer(pRC)) = freePage2(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, pPage, (*MemPage)(unsafe.Pointer(pPage)).Fpgno) } @@ -47306,7 +47357,7 @@ func freePage(tls *libc.TLS, pPage uintptr, pRC uintptr) { /* sqlite3.c:70851:13 // Free any overflow pages associated with the given Cell. Store // size information about the cell in pInfo. -func clearCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 { /* sqlite3.c:70861:12: */ +func clearCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 { /* sqlite3.c:71361:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -47323,7 +47374,7 @@ func clearCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 if (pCell + uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnSize)) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd { // Cell extends past end of page - return Xsqlite3CorruptError(tls, 70881) + return Xsqlite3CorruptError(tls, 71381) } ovflPgno = Xsqlite3Get4byte(tls, ((pCell + uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnSize)) - uintptr(4))) pBt = (*MemPage)(unsafe.Pointer(pPage)).FpBt @@ -47338,7 +47389,7 @@ func clearCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 // 0 is not a legal page number and page 1 cannot be an // overflow page. Therefore if ovflPgno<2 or past the end of the // file the database must be corrupt. - return Xsqlite3CorruptError(tls, 70898) + return Xsqlite3CorruptError(tls, 71398) } if nOvfl != 0 { rc = getOverflowPage(tls, pBt, ovflPgno, bp /* &pOvfl */, bp+8 /* &iNext */) @@ -47358,7 +47409,7 @@ func clearCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 // enabled. If this 'overflow' page happens to be a page that the // caller is iterating through or using in some other way, this // can be problematic. - rc = Xsqlite3CorruptError(tls, 70918) + rc = Xsqlite3CorruptError(tls, 71418) } else { rc = freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp /* pOvfl */)), ovflPgno) } @@ -47384,7 +47435,7 @@ func clearCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 // 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 *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize uintptr) int32 { /* sqlite3.c:70944:12: */ +func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize uintptr) int32 { /* sqlite3.c:71444:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -47527,9 +47578,9 @@ func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize if ((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK) { var eType U8 = func() uint8 { if pgnoPtrmap != 0 { - return PTRMAP_OVERFLOW2 + return uint8(PTRMAP_OVERFLOW2) } - return PTRMAP_OVERFLOW1 + return uint8(PTRMAP_OVERFLOW1) }() ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoOvfl */)), eType, pgnoPtrmap, bp+12 /* &rc */) if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != 0 { @@ -47566,7 +47617,7 @@ func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize // removes the reference to the cell from pPage. // // "sz" must be the number of bytes in the cell. -func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { /* sqlite3.c:71134:13: */ +func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { /* sqlite3.c:71634:13: */ var pc U32 // Offset to cell content of cell being deleted var data uintptr // pPage->aData var ptr uintptr // Used to move bytes around within data[] @@ -47583,7 +47634,7 @@ func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { hdr = int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) if (pc + U32(sz)) > (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 71154) + *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 71654) return } rc = freeSpace(tls, pPage, uint16(pc), uint16(sz)) @@ -47619,7 +47670,7 @@ func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { // pPage->nOverflow is incremented. // // *pRC must be SQLITE_OK when this routine is called. -func insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, pTemp uintptr, iChild Pgno, pRC uintptr) { /* sqlite3.c:71190:13: */ +func insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, pTemp uintptr, iChild Pgno, pRC uintptr) { /* sqlite3.c:71690:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -47780,7 +47831,7 @@ type CellArray1 = struct { FszCell uintptr FapEnd [6]uintptr FixNx [6]int32 -} /* sqlite3.c:71365:9 */ +} /* sqlite3.c:71865:9 */ // The following parameters determine how many adjacent pages get involved // in a balancing operation. NN is the number of neighbors on either side @@ -47857,11 +47908,11 @@ type CellArray1 = struct { // cases, ixNx[] entries with higher indexes, and the corresponding apEnd[] // entries, shift down. The end result is that each ixNx[] entry should // be larger than the previous -type CellArray = CellArray1 /* sqlite3.c:71365:26 */ +type CellArray = CellArray1 /* sqlite3.c:71865:26 */ // Make sure the cell sizes at idx, idx+1, ..., idx+N-1 have been // computed. -func populateCellCache(tls *libc.TLS, p uintptr, idx int32, N int32) { /* sqlite3.c:71379:13: */ +func populateCellCache(tls *libc.TLS, p uintptr, idx int32, N int32) { /* sqlite3.c:71879:13: */ for N > 0 { @@ -47876,13 +47927,13 @@ func populateCellCache(tls *libc.TLS, p uintptr, idx int32, N int32) { /* sqlite } // Return the size of the Nth element of the cell array -func computeCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71397:28: */ +func computeCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71897:28: */ *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) = (*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer(((*CellArray)(unsafe.Pointer(p)).FpRef + 120 /* &.xCellSize */))))(tls, (*CellArray)(unsafe.Pointer(p)).FpRef, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FapCell + uintptr(N)*8))) return *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) } -func cachedCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71403:12: */ +func cachedCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71903:12: */ if *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) != 0 { return *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) @@ -47901,7 +47952,7 @@ func cachedCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71403: // // The MemPage.nFree field is invalidated by this function. It is the // responsibility of the caller to set it correctly. -func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg uintptr) int32 { /* sqlite3.c:71422:12: */ +func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg uintptr) int32 { /* sqlite3.c:71922:12: */ var hdr int32 = int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset) // Offset of header on pPg var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData // Pointer to data for pPg var usableSize int32 = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize) @@ -47932,12 +47983,12 @@ func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg if (Uptr((pCell)) >= Uptr((aData))) && (Uptr((pCell)) < Uptr((pEnd))) { if (Uptr((pCell + uintptr(sz)))) > Uptr(pEnd) { - return Xsqlite3CorruptError(tls, 71455) + return Xsqlite3CorruptError(tls, 71955) } pCell = (pTmp + uintptr(((int64(pCell) - int64(aData)) / 1))) } else if (Uptr((pCell + uintptr(sz))) > Uptr(pSrcEnd)) && (Uptr((pCell)) < Uptr(pSrcEnd)) { - return Xsqlite3CorruptError(tls, 71460) + return Xsqlite3CorruptError(tls, 71960) } pData -= uintptr(sz) @@ -47945,7 +47996,7 @@ func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*U8)(unsafe.Pointer((pCellptr) + 1)) = (U8((int64(pData) - int64(aData)) / 1)) pCellptr += uintptr(2) if pData < pCellptr { - return Xsqlite3CorruptError(tls, 71466) + return Xsqlite3CorruptError(tls, 71966) } libc.Xmemcpy(tls, pData, pCell, uint64(sz)) @@ -47995,7 +48046,7 @@ func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg // 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 *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr, pCellptr uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:71513:12: */ +func pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr, pCellptr uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:72013:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -48033,7 +48084,7 @@ func pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr, if (Uptr((*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)) + uintptr(sz))) > Uptr(pEnd)) && (Uptr((*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)))) < Uptr(pEnd)) { - Xsqlite3CorruptError(tls, 71552) + Xsqlite3CorruptError(tls, 72052) return 1 } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), uint64(sz)) @@ -48060,7 +48111,7 @@ func pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr, // 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 *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:71578:12: */ +func pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:72078:12: */ var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData var pEnd uintptr = (aData + uintptr((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize)) var pStart uintptr = (aData + uintptr(((int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset) + 8) + int32((*MemPage)(unsafe.Pointer(pPg)).FchildPtrSize)))) @@ -48112,7 +48163,7 @@ func pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArra // // The pPg->nFree field is invalid when this function returns. It is the // responsibility of the caller to set it correctly. -func editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, pCArray uintptr) int32 { /* sqlite3.c:71635:12: */ +func editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, pCArray uintptr) int32 { /* sqlite3.c:72135:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -48146,7 +48197,7 @@ func editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, pC if !(nShift > nCell) { goto __2 } - return Xsqlite3CorruptError(tls, 71661) + return Xsqlite3CorruptError(tls, 72161) __2: ; libc.Xmemmove(tls, (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx, ((*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr((nShift * 2))), (uint64(nCell * 2))) @@ -48280,7 +48331,7 @@ editpage_fail: // 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 *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr) int32 { /* sqlite3.c:71763:12: */ +func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr) int32 { /* sqlite3.c:72263:12: */ bp := tls.Alloc(140) defer tls.Free(140) @@ -48293,7 +48344,7 @@ func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr // Page number of pNew if int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return Xsqlite3CorruptError(tls, 71773) + return Xsqlite3CorruptError(tls, 72273) } // dbfuzz001.test // Allocate a new page. This page will become the right-sibling of @@ -48332,7 +48383,7 @@ func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr // be marked as dirty. Returning an error code will cause a // rollback, undoing any changes made to the parent page. if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { - ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoNew */)), PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+136 /* &rc */) + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoNew */)), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+136 /* &rc */) if int32(*(*U16)(unsafe.Pointer(bp + 24 /* szCell */))) > int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FminLocal) { ptrmapPutOvflPtr(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */)), *(*uintptr)(unsafe.Pointer(bp /* pNew */)), *(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)), bp+136 /* &rc */) } @@ -48389,7 +48440,7 @@ func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr // 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 *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { /* sqlite3.c:71918:13: */ +func copyNodeContent(tls *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { /* sqlite3.c:72418:13: */ if (*(*int32)(unsafe.Pointer(pRC))) == SQLITE_OK { var pBt uintptr = (*MemPage)(unsafe.Pointer(pFrom)).FpBt var aFrom uintptr = (*MemPage)(unsafe.Pointer(pFrom)).FaData @@ -48469,7 +48520,7 @@ func copyNodeContent(tls *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { / // // If aOvflSpace is set to a null pointer, this function returns // SQLITE_NOMEM. -func balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpace uintptr, isRoot int32, bBulk int32) int32 { /* sqlite3.c:72000:12: */ +func balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpace uintptr, isRoot int32, bBulk int32) int32 { /* sqlite3.c:72500:12: */ bp := tls.Alloc(352) defer tls.Free(352) @@ -48632,43 +48683,48 @@ __10: if !(1 != 0) { goto __11 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = getAndInitPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)), (bp + 8 /* &apOld */ + uintptr(i)*8), uintptr(0), 0) - if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { + if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) == SQLITE_OK) { goto __12 } + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = getAndInitPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)), (bp + 8 /* &apOld */ + uintptr(i)*8), uintptr(0), 0) +__12: + ; + if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { + goto __13 + } libc.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint64(i + 1)) * uint64(unsafe.Sizeof(uintptr(0))))) goto balance_cleanup -__12: +__13: ; if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*8)))).FnFree < 0) { - goto __13 + goto __14 } *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = btreeComputeFreeSpace(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*8))) if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { - goto __14 + goto __15 } libc.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint64(i)) * uint64(unsafe.Sizeof(uintptr(0))))) goto balance_cleanup +__15: + ; __14: ; -__13: - ; if !((libc.PostDecInt32(&i, 1)) == 0) { - goto __15 + goto __16 } goto __11 -__15: +__16: ; if !(((*MemPage)(unsafe.Pointer(pParent)).FnOverflow != 0) && ((i + nxDiv) == int32(*(*U16)(unsafe.Pointer((pParent + 28 /* &.aiOvfl */)))))) { - goto __16 + goto __17 } *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((pParent + 40 /* &.apOvfl */))) *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)) = Xsqlite3Get4byte(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8))) *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4)) = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pParent + 120 /* &.xCellSize */))))(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)))) (*MemPage)(unsafe.Pointer(pParent)).FnOverflow = U8(0) - goto __17 -__16: + goto __18 +__17: *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)) = ((*MemPage)(unsafe.Pointer((pParent))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pParent))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pParent))).FaCellIdx + uintptr((2 * ((i + nxDiv) - int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow)))))))))))) *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)) = Xsqlite3Get4byte(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8))) *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4)) = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pParent + 120 /* &.xCellSize */))))(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)))) @@ -48686,26 +48742,23 @@ __16: // buffer. It will be copied out again as soon as the aSpace[] buffer // is allocated. if !((int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_FAST_SECURE) != 0) { - goto __18 - } - - iOff = ((int32(*(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)))) - (int32((*MemPage)(unsafe.Pointer(pParent)).FaData))) - if !((iOff + *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4))) > int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize)) { goto __19 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72130) - libc.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint64(i + 1)) * uint64(unsafe.Sizeof(uintptr(0))))) - goto balance_cleanup - goto __20 -__19: + + // If the following if() condition is not true, the db is corrupted. + // The call to dropCell() below will detect this. + iOff = ((int32(*(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)))) - (int32((*MemPage)(unsafe.Pointer(pParent)).FaData))) + if !((iOff + *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4))) <= int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize)) { + goto __20 + } libc.Xmemcpy(tls, (aOvflSpace + uintptr(iOff)), *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)), uint64(*(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4)))) *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)) = (aOvflSpace + uintptr(((int64(*(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8))) - int64((*MemPage)(unsafe.Pointer(pParent)).FaData)) / 1))) __20: ; -__18: +__19: ; dropCell(tls, pParent, ((i + nxDiv) - int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow)), *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4)), bp+68 /* &rc */) -__17: +__18: ; goto __10 __11: @@ -48765,7 +48818,7 @@ __22: if !(int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pOld)).FaData))) != int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */)))).FaData)))) { goto __25 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72197) + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72697) goto balance_cleanup __25: ; @@ -48793,7 +48846,7 @@ __25: if !(limit < int32(*(*U16)(unsafe.Pointer((pOld + 28 /* &.aiOvfl */))))) { goto __27 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72221) + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72721) goto balance_cleanup __27: ; @@ -48970,7 +49023,7 @@ __52: if !(k > (NB + 2)) { goto __55 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72322) + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72822) goto balance_cleanup __55: ; @@ -49044,7 +49097,7 @@ __65: }())) { goto __67 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72355) + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72855) goto balance_cleanup __67: ; @@ -49117,7 +49170,7 @@ __73: }())) { goto __75 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72397) + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72897) goto balance_cleanup __75: ; @@ -49150,11 +49203,17 @@ __76: *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)))).FpDbPage) nNew++ - if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { + if !(Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)))).FpDbPage) != (1 + (libc.Bool32(i == (iParentIdx - nxDiv))))) { goto __81 } - goto balance_cleanup + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72928) __81: + ; + if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { + goto __82 + } + goto balance_cleanup +__82: ; goto __80 __79: @@ -49166,10 +49225,10 @@ __79: return *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)) }(), uint8(0)) if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { - goto __82 + goto __83 } goto balance_cleanup -__82: +__83: ; zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)), pageFlags) *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)) @@ -49178,16 +49237,16 @@ __82: // Set the pointer-map entry for the new sibling page. if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - goto __83 - } - ptrmapPut(tls, pBt, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)))).Fpgno, PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+68 /* &rc */) - if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != SQLITE_OK) { goto __84 } + ptrmapPut(tls, pBt, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)))).Fpgno, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+68 /* &rc */) + if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != SQLITE_OK) { + goto __85 + } goto balance_cleanup -__84: +__85: ; -__83: +__84: ; __80: ; @@ -49210,19 +49269,19 @@ __78: // When NB==3, this one optimization makes the database about 25% faster // for large insertions and deletions. i = 0 -__85: +__86: if !(i < nNew) { - goto __87 + goto __88 } *(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(i)*4)) = libc.AssignPtrUint32(bp+296 /* &aPgno */ +uintptr(i)*4, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno) *(*U16)(unsafe.Pointer(bp + 316 /* &aPgFlags[0] */ + uintptr(i)*2)) = (*DbPage)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).FpDbPage)).Fflags j = 0 -__88: +__89: if !(j < i) { - goto __90 + goto __91 } if !(*(*Pgno)(unsafe.Pointer(bp + 296 /* &aPgno[0] */ + uintptr(j)*4)) == *(*Pgno)(unsafe.Pointer(bp + 296 /* &aPgno[0] */ + uintptr(i)*4))) { - goto __91 + goto __92 } // This branch is taken if the set of sibling pages somehow contains // duplicate entries. This can happen if the database is corrupt. @@ -49231,69 +49290,69 @@ __88: // cache with two separate objects associated with the same // page number. - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72471) + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72974) goto balance_cleanup -__91: +__92: ; - goto __89 -__89: - j++ - goto __88 goto __90 __90: + j++ + goto __89 + goto __91 +__91: ; - goto __86 -__86: - i++ - goto __85 goto __87 __87: + i++ + goto __86 + goto __88 +__88: ; i = 0 -__92: +__93: if !(i < nNew) { - goto __94 + goto __95 } iBest = 0 // aPgno[] index of page number to use j = 1 -__95: +__96: if !(j < nNew) { - goto __97 - } - if !(*(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(j)*4)) < *(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(iBest)*4))) { goto __98 } + if !(*(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(j)*4)) < *(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(iBest)*4))) { + goto __99 + } iBest = j -__98: +__99: ; - goto __96 -__96: - j++ - goto __95 goto __97 __97: + j++ + goto __96 + goto __98 +__98: ; *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)) = *(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(iBest)*4)) *(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(iBest)*4)) = 0xffffffff if !(iBest != i) { - goto __99 - } - if !(iBest > i) { goto __100 } + if !(iBest > i) { + goto __101 + } Xsqlite3PagerRekey(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(iBest)*8)))).FpDbPage, (((*BtShared)(unsafe.Pointer(pBt)).FnPage + U32(iBest)) + U32(1)), uint16(0)) -__100: +__101: ; Xsqlite3PagerRekey(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).FpDbPage, *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)), *(*U16)(unsafe.Pointer(bp + 316 /* &aPgFlags[0] */ + uintptr(iBest)*2))) (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno = *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)) -__99: +__100: ; - goto __93 -__93: - i++ - goto __92 goto __94 __94: + i++ + goto __93 + goto __95 +__95: ; Xsqlite3Put4byte(tls, pRight, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr((nNew-1))*8)))).Fpgno) @@ -49302,7 +49361,7 @@ __94: // of the right-most new sibling page is set to the value that was // originally in the same field of the right-most old sibling page. if !(((pageFlags & PTF_LEAF) == 0) && (nOld != nNew)) { - goto __101 + goto __102 } pOld1 = *(*uintptr)(unsafe.Pointer(func() uintptr { if nNew > nOld { @@ -49311,7 +49370,7 @@ __94: return bp + 8 /* &apOld[0] */ }() + uintptr((nOld-1))*8)) libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr((nNew-1))*8)))).FaData + 8), ((*MemPage)(unsafe.Pointer(pOld1)).FaData + 8), uint64(4)) -__101: +__102: ; // Make any required updates to pointer map entries associated with @@ -49330,7 +49389,7 @@ __101: // updated. This happens below, after the sibling pages have been // populated, not here. if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - goto __102 + goto __103 } pNew1 = libc.AssignUintptr(&pOld2, *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */))) cntOldNext = (int32((*MemPage)(unsafe.Pointer(pNew1)).FnCell) + int32((*MemPage)(unsafe.Pointer(pNew1)).FnOverflow)) @@ -49338,14 +49397,14 @@ __101: iOld = 0 i = 0 -__103: +__104: if !(i < (*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FnCell) { - goto __105 + goto __106 } pCell = *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FapCell + uintptr(i)*8)) -__106: +__107: if !(i == cntOldNext) { - goto __107 + goto __108 } iOld++ @@ -49355,20 +49414,20 @@ __106: pOld2 = *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(iOld)*8)) } cntOldNext = cntOldNext + ((int32((*MemPage)(unsafe.Pointer(pOld2)).FnCell) + int32((*MemPage)(unsafe.Pointer(pOld2)).FnOverflow)) + libc.BoolInt32(!(leafData != 0))) - goto __106 -__107: + goto __107 +__108: ; if !(i == *(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr(iNew)*4))) { - goto __108 + goto __109 } pNew1 = *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(libc.PreIncInt32(&iNew, 1))*8)) if !(!(leafData != 0)) { - goto __109 + goto __110 } - goto __104 -__109: + goto __105 +__110: ; -__108: +__109: ; // Cell pCell is destined for new sibling page pNew. Originally, it @@ -49380,43 +49439,43 @@ __108: if !(((iOld >= nNew) || ((*MemPage)(unsafe.Pointer(pNew1)).Fpgno != *(*Pgno)(unsafe.Pointer(bp + 296 /* &aPgno[0] */ + uintptr(iOld)*4)))) || !((Uptr((pCell)) >= Uptr(((*MemPage)(unsafe.Pointer(pOld2)).FaData))) && (Uptr((pCell)) < Uptr(((*MemPage)(unsafe.Pointer(pOld2)).FaDataEnd))))) { - goto __110 - } - if !(!(leafCorrection != 0)) { goto __111 } - ptrmapPut(tls, pBt, Xsqlite3Get4byte(tls, pCell), PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pNew1)).Fpgno, bp+68 /* &rc */) -__111: - ; - if !(int32(cachedCellSize(tls, bp+96 /* &b */, i)) > int32((*MemPage)(unsafe.Pointer(pNew1)).FminLocal)) { + if !(!(leafCorrection != 0)) { goto __112 } - ptrmapPutOvflPtr(tls, pNew1, pOld2, pCell, bp+68 /* &rc */) + ptrmapPut(tls, pBt, Xsqlite3Get4byte(tls, pCell), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pNew1)).Fpgno, bp+68 /* &rc */) __112: ; - if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { + if !(int32(cachedCellSize(tls, bp+96 /* &b */, i)) > int32((*MemPage)(unsafe.Pointer(pNew1)).FminLocal)) { goto __113 } - goto balance_cleanup + ptrmapPutOvflPtr(tls, pNew1, pOld2, pCell, bp+68 /* &rc */) __113: ; -__110: + if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { + goto __114 + } + goto balance_cleanup +__114: + ; +__111: ; - goto __104 -__104: - i++ - goto __103 goto __105 __105: + i++ + goto __104 + goto __106 +__106: ; -__102: +__103: ; // Insert new divider cells into pParent. i = 0 -__114: +__115: if !(i < (nNew - 1)) { - goto __116 + goto __117 } pNew2 = *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)) j = *(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr(i)*4)) @@ -49425,21 +49484,21 @@ __114: sz2 = (int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FszCell + uintptr(j)*2))) + int32(leafCorrection)) pTemp1 = (aOvflSpace + uintptr(iOvflSpace)) if !(!(int32((*MemPage)(unsafe.Pointer(pNew2)).Fleaf) != 0)) { - goto __117 + goto __118 } libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pNew2)).FaData + 8), pCell1, uint64(4)) - goto __118 -__117: + goto __119 +__118: if !(leafData != 0) { - goto __119 + goto __120 } j-- (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pNew2 + 128 /* &.xParseCell */))))(tls, pNew2, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FapCell + uintptr(j)*8)), bp+328 /* &info */) pCell1 = pTemp1 sz2 = (4 + Xsqlite3PutVarint(tls, (pCell1+4), uint64((*CellInfo)(unsafe.Pointer(bp+328 /* &info */)).FnKey))) pTemp1 = uintptr(0) - goto __120 -__119: + goto __121 +__120: pCell1 -= uintptr(4) // Obscure case for non-leaf-data trees: If the cell at pCell was // previously stored on a leaf node, and its reported size was 4 @@ -49452,32 +49511,32 @@ __119: // and WITHOUT ROWID tables with exactly one column which is the // primary key. if !(int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FszCell + uintptr(j)*2))) == 4) { - goto __121 + goto __122 } sz2 = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pParent + 120 /* &.xCellSize */))))(tls, pParent, pCell1)) +__122: + ; __121: ; -__120: - ; -__118: +__119: ; iOvflSpace = iOvflSpace + (sz2) insertCell(tls, pParent, (nxDiv + i), pCell1, sz2, pTemp1, (*MemPage)(unsafe.Pointer(pNew2)).Fpgno, bp+68 /* &rc */) if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != SQLITE_OK) { - goto __122 + goto __123 } goto balance_cleanup -__122: +__123: ; - goto __115 -__115: - i++ - goto __114 goto __116 __116: + i++ + goto __115 + goto __117 +__117: ; // Now update the actual sibling pages. The order in which they are updated @@ -49502,9 +49561,9 @@ __116: // upwards pass simply processes pages that were missed on the downward // pass. i = (1 - nNew) -__123: +__124: if !(i < nNew) { - goto __125 + goto __126 } if i < 0 { iPg = -i @@ -49513,14 +49572,14 @@ __123: } if !(*(*U8)(unsafe.Pointer(bp /* &abDone[0] */ + uintptr(iPg))) != 0) { - goto __126 + goto __127 } - goto __124 -__126: + goto __125 +__127: ; // Skip pages already processed if !((i >= 0) || // On the upwards pass, or... (*(*int32)(unsafe.Pointer(bp + 72 /* &cntOld[0] */ + uintptr((iPg-1))*4)) >= *(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr((iPg-1))*4)))) { - goto __127 + goto __128 } // Verify condition (1): If cells are moving left, update iPg @@ -49530,12 +49589,12 @@ __126: // only after iPg+1 has already been updated. if !(iPg == 0) { - goto __128 + goto __129 } iNew1 = libc.AssignInt32(&iOld1, 0) nNewCell = *(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */)) - goto __129 -__128: + goto __130 +__129: if iPg < nOld { iOld1 = (*(*int32)(unsafe.Pointer(bp + 72 /* &cntOld[0] */ + uintptr((iPg-1))*4)) + libc.BoolInt32(!(leafData != 0))) } else { @@ -49543,33 +49602,33 @@ __128: } iNew1 = (*(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr((iPg-1))*4)) + libc.BoolInt32(!(leafData != 0))) nNewCell = (*(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr(iPg)*4)) - iNew1) -__129: +__130: ; *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = editPage(tls, *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(iPg)*8)), iOld1, iNew1, nNewCell, bp+96 /* &b */) if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { - goto __130 + goto __131 } goto balance_cleanup -__130: +__131: ; *(*U8)(unsafe.Pointer(bp /* &abDone[0] */ + uintptr(iPg)))++ (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(iPg)*8)))).FnFree = (usableSpace - *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(iPg)*4))) -__127: +__128: ; - goto __124 -__124: - i++ - goto __123 goto __125 __125: + i++ + goto __124 + goto __126 +__126: ; // All pages have been processed exactly once if !(((isRoot != 0) && (int32((*MemPage)(unsafe.Pointer(pParent)).FnCell) == 0)) && (int32((*MemPage)(unsafe.Pointer(pParent)).FhdrOffset) <= (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */)))).FnFree)) { - goto __131 + goto __132 } // The root page of the b-tree now contains no cells. The only sibling // page is the right-child of the parent. Copy the contents of the @@ -49590,76 +49649,76 @@ __125: copyNodeContent(tls, *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */)), pParent, bp+68 /* &rc */) freePage(tls, *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */)), bp+68 /* &rc */) - goto __132 -__131: + goto __133 +__132: if !(((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && !(leafCorrection != 0)) { - goto __133 + goto __134 } // Fix the pointer map entries associated with the right-child of each // sibling page. All other pointer map entries have already been taken // care of. i = 0 -__134: +__135: if !(i < nNew) { - goto __136 + goto __137 } key = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).FaData + 8)) - ptrmapPut(tls, pBt, key, PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno, bp+68 /* &rc */) - goto __135 -__135: - i++ - goto __134 + ptrmapPut(tls, pBt, key, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno, bp+68 /* &rc */) goto __136 __136: + i++ + goto __135 + goto __137 +__137: + ; +__134: ; __133: ; -__132: - ; // Free any old pages that were not reused as new pages. i = nNew -__137: +__138: if !(i < nOld) { - goto __139 + goto __140 } freePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*8)), bp+68 /* &rc */) - goto __138 -__138: - i++ - goto __137 goto __139 __139: + i++ + goto __138 + goto __140 +__140: ; // Cleanup before returning. balance_cleanup: Xsqlite3DbFree(tls, uintptr(0), (*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FapCell) i = 0 -__140: +__141: if !(i < nOld) { - goto __142 + goto __143 } releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*8))) - goto __141 -__141: - i++ - goto __140 goto __142 __142: + i++ + goto __141 + goto __143 +__143: ; i = 0 -__143: +__144: if !(i < nNew) { - goto __145 + goto __146 } releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8))) - goto __144 -__144: - i++ - goto __143 goto __145 __145: + i++ + goto __144 + goto __146 +__146: ; return *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) @@ -49682,7 +49741,7 @@ __145: // 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 *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sqlite3.c:72786:12: */ +func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sqlite3.c:73289:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -49700,7 +49759,7 @@ func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sq *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = allocateBtreePage(tls, pBt, bp /* &pChild */, bp+8 /* &pgnoChild */, (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, uint8(0)) copyNodeContent(tls, pRoot, *(*uintptr)(unsafe.Pointer(bp /* pChild */)), bp+12 /* &rc */) if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { - ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoChild */)), PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, bp+12 /* &rc */) + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoChild */)), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, bp+12 /* &rc */) } } if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != 0 { @@ -49733,13 +49792,13 @@ func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sq // table linked to the same b-tree. If the secondary insert causes a // rebalance, that can change content out from under the cursor on the // first SQL table, violating invariants on the first insert. -func anotherValidCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:72844:12: */ +func anotherValidCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:73347:12: */ var pOther uintptr for pOther = (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpCursor; pOther != 0; pOther = (*BtCursor)(unsafe.Pointer(pOther)).FpNext { if ((pOther != pCur) && (int32((*BtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID)) && ((*BtCursor)(unsafe.Pointer(pOther)).FpPage == (*BtCursor)(unsafe.Pointer(pCur)).FpPage) { - return Xsqlite3CorruptError(tls, 72851) + return Xsqlite3CorruptError(tls, 73354) } } return SQLITE_OK @@ -49753,7 +49812,7 @@ func anotherValidCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:72844: // balance_quick() // balance_deeper() // balance_nonroot() -func balance(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:72867:12: */ +func balance(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:73370:12: */ bp := tls.Alloc(13) defer tls.Free(13) @@ -49872,7 +49931,7 @@ func balance(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:72867:12: */ // Overwrite content from pX into pDest. Only do the write if the // content is different from what is already there. -func btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uintptr, iOffset int32, iAmt int32) int32 { /* sqlite3.c:72993:12: */ +func btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uintptr, iOffset int32, iAmt int32) int32 { /* sqlite3.c:73496:12: */ var nData int32 = ((*BtreePayload)(unsafe.Pointer(pX)).FnData - iOffset) if nData <= 0 { // Overwritting with zeros @@ -49914,7 +49973,7 @@ func btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uintp // Overwrite the cell that cursor pCur is pointing to with fresh content // contained in pX. -func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqlite3.c:73036:12: */ +func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqlite3.c:73539:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -49928,7 +49987,7 @@ func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqli if (((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload + uintptr((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)) > (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaDataEnd) || ((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData + uintptr((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FcellOffset))) { - return Xsqlite3CorruptError(tls, 73048) + return Xsqlite3CorruptError(tls, 73551) } // Overwrite the local portion first rc = btreeOverwriteContent(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)), (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload, pX, @@ -49952,7 +50011,7 @@ func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqli return rc } if Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage) != 1 { - rc = Xsqlite3CorruptError(tls, 73067) + rc = Xsqlite3CorruptError(tls, 73570) } else { if (U32(iOffset) + ovflPageSize) < U32(nTotal) { ovflPgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData) @@ -49999,15 +50058,15 @@ func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqli // 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 Xsqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, seekResult int32) int32 { /* sqlite3.c:73115:20: */ - bp := tls.Alloc(116) - defer tls.Free(116) +func Xsqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, seekResult int32) int32 { /* sqlite3.c:73618:20: */ + bp := tls.Alloc(136) + defer tls.Free(136) - // var rc int32 at bp+112, 4 + // var rc int32 at bp+104, 4 // var loc int32 at bp, 4 // -1: before desired location +1: after - // var szNew int32 at bp+80, 4 + // var szNew int32 at bp+108, 4 var idx int32 var pPage uintptr @@ -50019,9 +50078,12 @@ func Xsqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s // var x2 BtreePayload at bp+32, 48 - // var info CellInfo at bp+88, 24 + var ovfl Pgno + // var info CellInfo at bp+80, 24 + + // var info1 CellInfo at bp+112, 24 *(*int32)(unsafe.Pointer(bp /* loc */)) = seekResult - *(*int32)(unsafe.Pointer(bp + 80 /* szNew */)) = 0 + *(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) = 0 p = (*BtCursor)(unsafe.Pointer(pCur)).FpBtree pBt = (*Btree)(unsafe.Pointer(p)).FpBt newCell = uintptr(0) @@ -50053,11 +50115,11 @@ __1: if !((int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags) & BTCF_Multiple) != 0) { goto __2 } - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = saveAllCursors(tls, pBt, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur) - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = saveAllCursors(tls, pBt, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur) + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { goto __3 } - return *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) + return *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) __3: ; __2: @@ -50100,11 +50162,11 @@ __6: // The cursor is *not* pointing to the cell to be overwritten, nor // to an adjacent cell. Move the cursor so that it is pointing either // to the cell to be overwritten or an adjacent cell. - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, uintptr(0), (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (libc.Bool32(flags != 0)), bp /* &loc */) - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, uintptr(0), (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (libc.Bool32(flags != 0)), bp /* &loc */) + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { goto __10 } - return *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) + return *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) __10: ; __9: @@ -50137,16 +50199,16 @@ __4: (*UnpackedRecord)(unsafe.Pointer(bp + 8 /* &r */)).Fr1 = int8(0) (*UnpackedRecord)(unsafe.Pointer(bp + 8 /* &r */)).Fr2 = int8(0) (*UnpackedRecord)(unsafe.Pointer(bp + 8 /* &r */)).FeqSeen = U8(0) - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, bp+8 /* &r */, int64(0), (libc.Bool32(flags != 0)), bp /* &loc */) + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, bp+8 /* &r */, int64(0), (libc.Bool32(flags != 0)), bp /* &loc */) goto __13 __12: - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = btreeMoveto(tls, pCur, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (libc.Bool32(flags != 0)), bp /* &loc */) + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = btreeMoveto(tls, pCur, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (libc.Bool32(flags != 0)), bp /* &loc */) __13: ; - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { goto __14 } - return *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) + return *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) __14: ; __11: @@ -50182,16 +50244,16 @@ __5: if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) > CURSOR_INVALID) { goto __18 } - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3CorruptError(tls, 73263) + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = Xsqlite3CorruptError(tls, 73767) goto __19 __18: - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = btreeComputeFreeSpace(tls, pPage) + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = btreeComputeFreeSpace(tls, pPage) __19: ; - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { goto __20 } - return *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) + return *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) __20: ; __17: @@ -50199,39 +50261,67 @@ __17: newCell = (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = fillInCell(tls, pPage, newCell, pX, bp+80 /* &szNew */) - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { + if !((flags & BTREE_PREFORMAT) != 0) { goto __21 } - goto end_insert + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) = (*BtShared)(unsafe.Pointer(pBt)).FnPreformatSize + if !(*(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) < 4) { + goto __23 + } + *(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) = 4 +__23: + ; + if !(((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) > int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal))) { + goto __24 + } + (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, newCell, bp+80 /* &info */) + if !((*CellInfo)(unsafe.Pointer(bp+80 /* &info */)).FnPayload != U32((*CellInfo)(unsafe.Pointer(bp+80 /* &info */)).FnLocal)) { + goto __25 + } + ovfl = Xsqlite3Get4byte(tls, (newCell + uintptr((*(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) - 4)))) + ptrmapPut(tls, pBt, ovfl, uint8(PTRMAP_OVERFLOW1), (*MemPage)(unsafe.Pointer(pPage)).Fpgno, bp+104 /* &rc */) +__25: + ; +__24: + ; + goto __22 __21: + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = fillInCell(tls, pPage, newCell, pX, bp+108 /* &szNew */) +__22: + ; + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { + goto __26 + } + goto end_insert +__26: ; idx = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) if !(*(*int32)(unsafe.Pointer(bp /* loc */)) == 0) { - goto __22 + goto __27 } - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage) - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { - goto __24 + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage) + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { + goto __29 } goto end_insert -__24: +__29: ; oldCell = ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (idx))))))))))) if !(!(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0)) { - goto __25 + goto __30 } libc.Xmemcpy(tls, newCell, oldCell, uint64(4)) -__25: +__30: ; - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = clearCell(tls, pPage, oldCell, bp+88 /* &info */) + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = clearCell(tls, pPage, oldCell, bp+112 /* &info1 */) *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_ValidOvfl))) - if !(((int32((*CellInfo)(unsafe.Pointer(bp+88 /* &info */)).FnSize) == *(*int32)(unsafe.Pointer(bp + 80 /* szNew */))) && (U32((*CellInfo)(unsafe.Pointer(bp+88 /* &info */)).FnLocal) == (*CellInfo)(unsafe.Pointer(bp+88 /* &info */)).FnPayload)) && - (!(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0) || (*(*int32)(unsafe.Pointer(bp + 80 /* szNew */)) < int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)))) { - goto __26 + if !(((int32((*CellInfo)(unsafe.Pointer(bp+112 /* &info1 */)).FnSize) == *(*int32)(unsafe.Pointer(bp + 108 /* szNew */))) && (U32((*CellInfo)(unsafe.Pointer(bp+112 /* &info1 */)).FnLocal) == (*CellInfo)(unsafe.Pointer(bp+112 /* &info1 */)).FnPayload)) && + (!(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0) || (*(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) < int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)))) { + goto __31 } // Overwrite the old cell with the new if they are the same size. // We could also try to do this if the old cell is smaller, then add @@ -50244,44 +50334,44 @@ __25: // necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. // clearCell never fails when nLocal==nPayload if !(oldCell < (((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)) + uintptr(10))) { - goto __27 + goto __32 } - return Xsqlite3CorruptError(tls, 73309) -__27: + return Xsqlite3CorruptError(tls, 73827) +__32: ; - if !((oldCell + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* szNew */)))) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd) { - goto __28 + if !((oldCell + uintptr(*(*int32)(unsafe.Pointer(bp + 108 /* szNew */)))) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd) { + goto __33 } - return Xsqlite3CorruptError(tls, 73312) -__28: + return Xsqlite3CorruptError(tls, 73830) +__33: ; - libc.Xmemcpy(tls, oldCell, newCell, uint64(*(*int32)(unsafe.Pointer(bp + 80 /* szNew */)))) + libc.Xmemcpy(tls, oldCell, newCell, uint64(*(*int32)(unsafe.Pointer(bp + 108 /* szNew */)))) return SQLITE_OK -__26: +__31: ; - dropCell(tls, pPage, idx, int32((*CellInfo)(unsafe.Pointer(bp+88 /* &info */)).FnSize), bp+112 /* &rc */) - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { - goto __29 + dropCell(tls, pPage, idx, int32((*CellInfo)(unsafe.Pointer(bp+112 /* &info1 */)).FnSize), bp+104 /* &rc */) + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { + goto __34 } goto end_insert -__29: +__34: ; - goto __23 -__22: + goto __28 +__27: if !((*(*int32)(unsafe.Pointer(bp /* loc */)) < 0) && (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) > 0)) { - goto __30 + goto __35 } idx = int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1)) *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_ValidNKey))) - goto __31 -__30: + goto __36 +__35: ; -__31: +__36: ; -__23: +__28: ; - insertCell(tls, pPage, idx, newCell, *(*int32)(unsafe.Pointer(bp + 80 /* szNew */)), uintptr(0), uint32(0), bp+112 /* &rc */) + insertCell(tls, pPage, idx, newCell, *(*int32)(unsafe.Pointer(bp + 108 /* szNew */)), uintptr(0), uint32(0), bp+104 /* &rc */) // If no error has occurred and pPage has an overflow cell, call balance() // to redistribute the cells within the tree. Since balance() may move @@ -50304,47 +50394,177 @@ __23: // row without seeking the cursor. This can be a big performance boost. (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0) if !((*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0) { - goto __32 + goto __37 } *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_ValidNKey))) - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = balance(tls, pCur) + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = balance(tls, pCur) // Must make sure nOverflow is reset to zero even if the balance() // fails. Internal data structure corruption will result otherwise. // Also, set the cursor state to invalid. This stops saveCursorPosition() // from trying to save the current position of the cursor. (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnOverflow = U8(0) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID - if !(((flags & BTREE_SAVEPOSITION) != 0) && (*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) == SQLITE_OK)) { - goto __33 + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) + if !(((flags & BTREE_SAVEPOSITION) != 0) && (*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) == SQLITE_OK)) { + goto __38 } btreeReleaseAllCursorPages(tls, pCur) if !((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo != 0) { - goto __34 + goto __39 } (*BtCursor)(unsafe.Pointer(pCur)).FpKey = Xsqlite3Malloc(tls, uint64((*BtreePayload)(unsafe.Pointer(pX)).FnKey)) if !((*BtCursor)(unsafe.Pointer(pCur)).FpKey == uintptr(0)) { - goto __35 + goto __40 } - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = SQLITE_NOMEM - goto __36 -__35: + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = SQLITE_NOMEM + goto __41 +__40: libc.Xmemcpy(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, uint64((*BtreePayload)(unsafe.Pointer(pX)).FnKey)) -__36: +__41: ; -__34: +__39: ; - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_REQUIRESEEK + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK) (*BtCursor)(unsafe.Pointer(pCur)).FnKey = (*BtreePayload)(unsafe.Pointer(pX)).FnKey -__33: +__38: ; -__32: +__37: ; end_insert: - return *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) + return *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) +} + +// This function is used as part of copying the current row from cursor +// pSrc into cursor pDest. If the cursors are open on intkey tables, then +// parameter iKey is used as the rowid value when the record is copied +// into pDest. Otherwise, the record is copied verbatim. +// +// This function does not actually write the new value to cursor pDest. +// Instead, it creates and populates any required overflow pages and +// writes the data for the new cell into the BtShared.pTmpSpace buffer +// for the destination database. The size of the cell, in bytes, is left +// in BtShared.nPreformatSize. The caller completes the insertion by +// calling sqlite3BtreeInsert() with the BTREE_PREFORMAT flag specified. +// +// SQLITE_OK is returned if successful, or an SQLite error code otherwise. +func Xsqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey I64) int32 { /* sqlite3.c:73916:20: */ + bp := tls.Alloc(24) + defer tls.Free(24) + + *(*int32)(unsafe.Pointer(bp + 20 /* rc */)) = SQLITE_OK + var pBt uintptr = (*BtCursor)(unsafe.Pointer(pDest)).FpBt + var aOut uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace // Pointer to next output buffer + var aIn uintptr // Pointer to next input buffer + var nIn U32 // Size of input buffer aIn[] + var nRem U32 // Bytes of data still to copy + + getCellInfo(tls, pSrc) + aOut += uintptr(func() uint8 { + if ((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload) < U32(0x80) { + return uint8(func() int32 { + *(*U8)(unsafe.Pointer(aOut)) = uint8((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload) + return 1 + }()) + } + return uint8(Xsqlite3PutVarint(tls, aOut, uint64((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) + }()) + if (*BtCursor)(unsafe.Pointer(pDest)).FpKeyInfo == uintptr(0) { + aOut += uintptr(Xsqlite3PutVarint(tls, aOut, uint64(iKey))) + } + nIn = U32((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) + aIn = (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload + if (aIn + uintptr(nIn)) > (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { + return Xsqlite3CorruptError(tls, 73930) + } + nRem = (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload + if (nIn == nRem) && (nIn < U32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal)) { + libc.Xmemcpy(tls, aOut, aIn, uint64(nIn)) + (*BtShared)(unsafe.Pointer(pBt)).FnPreformatSize = (int32(int64(nIn) + ((int64(aOut) - int64((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) / 1))) + } else { + var pSrcPager uintptr = (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpBt)).FpPager + var pPgnoOut uintptr = uintptr(0) + var ovflIn Pgno = Pgno(0) + *(*uintptr)(unsafe.Pointer(bp /* pPageIn */)) = uintptr(0) + var pPageOut uintptr = uintptr(0) + var nOut U32 // Size of output buffer aOut[] + + nOut = U32(btreePayloadToLocal(tls, (*BtCursor)(unsafe.Pointer(pDest)).FpPage, int64((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) + (*BtShared)(unsafe.Pointer(pBt)).FnPreformatSize = (int32(int64(nOut) + ((int64(aOut) - int64((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) / 1))) + if nOut < (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { + pPgnoOut = (aOut + uintptr(nOut)) + *(*int32)(unsafe.Pointer(pBt + 144 /* &.nPreformatSize */)) += (4) + } + + if nRem > nIn { + if ((aIn + uintptr(nIn)) + uintptr(4)) > (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { + return Xsqlite3CorruptError(tls, 73953) + } + ovflIn = Xsqlite3Get4byte(tls, ((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload + uintptr(nIn))) + } + + for ok := true; ok; ok = ((nRem > U32(0)) && (*(*int32)(unsafe.Pointer(bp + 20 /* rc */)) == SQLITE_OK)) { + nRem = nRem - (nOut) + for ok1 := true; ok1; ok1 = ((*(*int32)(unsafe.Pointer(bp + 20 /* rc */)) == SQLITE_OK) && (nOut > U32(0))) { + + if nIn > U32(0) { + var nCopy int32 = func() int32 { + if (nOut) < (nIn) { + return int32(nOut) + } + return int32(nIn) + }() + libc.Xmemcpy(tls, aOut, aIn, uint64(nCopy)) + nOut = nOut - (U32(nCopy)) + nIn = nIn - (U32(nCopy)) + aOut += uintptr(nCopy) + aIn += uintptr(nCopy) + } + if nOut > U32(0) { + Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pPageIn */))) + *(*uintptr)(unsafe.Pointer(bp /* pPageIn */)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 20 /* rc */)) = Xsqlite3PagerGet(tls, pSrcPager, ovflIn, bp /* &pPageIn */, PAGER_GET_READONLY) + if *(*int32)(unsafe.Pointer(bp + 20 /* rc */)) == SQLITE_OK { + aIn = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp /* pPageIn */))) + ovflIn = Xsqlite3Get4byte(tls, aIn) + aIn += uintptr(4) + nIn = ((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpBt)).FusableSize - U32(4)) + } + } + } + + if (*(*int32)(unsafe.Pointer(bp + 20 /* rc */)) == SQLITE_OK) && (nRem > U32(0)) { + // var pgnoNew Pgno at bp+16, 4 + + *(*uintptr)(unsafe.Pointer(bp + 8 /* pNew */)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 20 /* rc */)) = allocateBtreePage(tls, pBt, bp+8 /* &pNew */, bp+16 /* &pgnoNew */, uint32(0), uint8(0)) + Xsqlite3Put4byte(tls, pPgnoOut, *(*Pgno)(unsafe.Pointer(bp + 16 /* pgnoNew */))) + if ((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (pPageOut != 0) { + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 16 /* pgnoNew */)), uint8(PTRMAP_OVERFLOW2), (*MemPage)(unsafe.Pointer(pPageOut)).Fpgno, bp+20 /* &rc */) + } + releasePage(tls, pPageOut) + pPageOut = *(*uintptr)(unsafe.Pointer(bp + 8 /* pNew */)) + if pPageOut != 0 { + pPgnoOut = (*MemPage)(unsafe.Pointer(pPageOut)).FaData + Xsqlite3Put4byte(tls, pPgnoOut, uint32(0)) + aOut = (pPgnoOut + 4) + nOut = func() uint32 { + if ((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)) < (nRem) { + return ((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)) + } + return nRem + }() + } + } + } + + releasePage(tls, pPageOut) + Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pPageIn */))) + } + + return *(*int32)(unsafe.Pointer(bp + 20 /* rc */)) } // Delete the entry that the cursor is pointing to. @@ -50362,7 +50582,7 @@ end_insert: // 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 Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlite3.c:73400:20: */ +func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlite3.c:74026:20: */ bp := tls.Alloc(28) defer tls.Free(28) @@ -50485,7 +50705,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit } pCell = ((*MemPage)(unsafe.Pointer((pLeaf))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pLeaf))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pLeaf))).FaCellIdx + uintptr((2 * (int32((*MemPage)(unsafe.Pointer(pLeaf)).FnCell) - 1))))))))))) if pCell < ((*MemPage)(unsafe.Pointer(pLeaf)).FaData + 4) { - return Xsqlite3CorruptError(tls, 73510) + return Xsqlite3CorruptError(tls, 74136) } nCell = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pLeaf + 120 /* &.xCellSize */))))(tls, pLeaf, pCell)) @@ -50530,7 +50750,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK { if bSkipnext != 0 { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_SKIPNEXT + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_SKIPNEXT) if iCellIdx >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) { (*BtCursor)(unsafe.Pointer(pCur)).FskipNext = -1 (*BtCursor)(unsafe.Pointer(pCur)).Fix = (U16(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1)) @@ -50541,7 +50761,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = moveToRoot(tls, pCur) if bPreserve != 0 { btreeReleaseAllCursorPages(tls, pCur) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_REQUIRESEEK + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK) } if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_EMPTY { *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = SQLITE_OK @@ -50560,7 +50780,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit // // BTREE_INTKEY|BTREE_LEAFDATA Used for SQL tables with rowid keys // BTREE_ZERODATA Used for SQL indices -func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags int32) int32 { /* sqlite3.c:73584:12: */ +func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags int32) int32 { /* sqlite3.c:74210:12: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -50590,7 +50810,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags // created so far, so the new root-page is (meta[3]+1). Xsqlite3BtreeGetMeta(tls, p, BTREE_LARGEST_ROOT_PAGE, bp /* &pgnoRoot */) if *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)) > btreePagecount(tls, pBt) { - return Xsqlite3CorruptError(tls, 73618) + return Xsqlite3CorruptError(tls, 74244) } *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */))++ @@ -50603,7 +50823,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags // Allocate a page. The page that currently resides at pgnoRoot will // be moved to the allocated page (unless the allocated page happens // to reside at pgnoRoot). - *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = allocateBtreePage(tls, pBt, bp+8 /* &pPageMove */, bp+16 /* &pgnoMove */, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), BTALLOC_EXACT) + *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = allocateBtreePage(tls, pBt, bp+8 /* &pPageMove */, bp+16 /* &pgnoMove */, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), uint8(BTALLOC_EXACT)) if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } @@ -50633,7 +50853,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = ptrmapGet(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), bp+32 /* &eType */, bp+36 /* &iPtrPage */) if (int32(*(*U8)(unsafe.Pointer(bp + 32 /* eType */))) == PTRMAP_ROOTPAGE) || (int32(*(*U8)(unsafe.Pointer(bp + 32 /* eType */))) == PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = Xsqlite3CorruptError(tls, 73666) + *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = Xsqlite3CorruptError(tls, 74292) } if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != SQLITE_OK { releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */))) @@ -50661,7 +50881,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } // Update the pointer-map and meta-data with the new root-page number. - ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), PTRMAP_ROOTPAGE, uint32(0), bp+40 /* &rc */) + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), uint8(PTRMAP_ROOTPAGE), uint32(0), bp+40 /* &rc */) if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != 0 { releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */))) return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) @@ -50696,7 +50916,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags return SQLITE_OK } -func Xsqlite3BtreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, flags int32) int32 { /* sqlite3.c:73729:20: */ +func Xsqlite3BtreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, flags int32) int32 { /* sqlite3.c:74355:20: */ var rc int32 Xsqlite3BtreeEnter(tls, p) rc = btreeCreateTable(tls, p, piTable, flags) @@ -50706,7 +50926,7 @@ func Xsqlite3BtreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, flags i // Erase the given database page and all its children. Return // the page to the freelist. -func clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno Pgno, freePageFlag int32, pnChange uintptr) int32 { /* sqlite3.c:73741:12: */ +func clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno Pgno, freePageFlag int32, pnChange uintptr) int32 { /* sqlite3.c:74367:12: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -50722,7 +50942,7 @@ func clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno Pgno, freePageFlag int32 if !(pgno > btreePagecount(tls, pBt)) { goto __1 } - return Xsqlite3CorruptError(tls, 73756) + return Xsqlite3CorruptError(tls, 74382) __1: ; *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = getAndInitPage(tls, pBt, pgno, bp /* &pPage */, uintptr(0), 0) @@ -50735,7 +50955,7 @@ __2: if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FbBusy != 0) { goto __3 } - *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3CorruptError(tls, 73761) + *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3CorruptError(tls, 74387) goto cleardatabasepage_out __3: ; @@ -50826,7 +51046,7 @@ cleardatabasepage_out: // 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 Xsqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange uintptr) int32 { /* sqlite3.c:73808:20: */ +func Xsqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange uintptr) int32 { /* sqlite3.c:74434:20: */ var rc int32 var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) @@ -50847,7 +51067,7 @@ func Xsqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange ui // Delete all information from the single table that pCur is open on. // // This routine only work for pCur on an ephemeral table. -func Xsqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:73832:20: */ +func Xsqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:74458:20: */ return Xsqlite3BtreeClearTable(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree, int32((*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot), uintptr(0)) } @@ -50869,7 +51089,7 @@ func Xsqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) int32 { /* sql // 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 *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int32 { /* sqlite3.c:73856:12: */ +func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int32 { /* sqlite3.c:74482:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -50879,7 +51099,7 @@ func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int3 var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt if iTable > btreePagecount(tls, pBt) { - return Xsqlite3CorruptError(tls, 73865) + return Xsqlite3CorruptError(tls, 74491) } *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = btreeGetPage(tls, pBt, iTable, bp /* &pPage */, 0) @@ -50918,7 +51138,7 @@ func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int3 if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) } - *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 16 /* pMove */)), PTRMAP_ROOTPAGE, uint32(0), iTable, 0) + *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 16 /* pMove */)), uint8(PTRMAP_ROOTPAGE), uint32(0), iTable, 0) releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pMove */))) if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) @@ -50951,7 +51171,7 @@ func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int3 return *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) } -func Xsqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uintptr) int32 { /* sqlite3.c:73941:20: */ +func Xsqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uintptr) int32 { /* sqlite3.c:74567:20: */ var rc int32 Xsqlite3BtreeEnter(tls, p) rc = btreeDropTable(tls, p, uint32(iTable), piMoved) @@ -50977,7 +51197,7 @@ func Xsqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uint // 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 Xsqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr) { /* sqlite3.c:73970:21: */ +func Xsqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr) { /* sqlite3.c:74596:21: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) @@ -50996,7 +51216,7 @@ func Xsqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr) { // Write meta-information back into the database. Meta[0] is // read-only and may not be written. -func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int32 { /* sqlite3.c:74000:20: */ +func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int32 { /* sqlite3.c:74626:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var pP1 uintptr var rc int32 @@ -51022,7 +51242,7 @@ func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int // 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 Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr) int32 { /* sqlite3.c:74032:20: */ +func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr) int32 { /* sqlite3.c:74658:20: */ var nEntry I64 = int64(0) // Value to return in *pnEntry var rc int32 // Return code @@ -51034,7 +51254,7 @@ func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr // Unless an error occurs, the following loop runs one iteration for each // page in the B-Tree structure (not including overflow pages). - for (rc == SQLITE_OK) && !(libc.AtomicLoadNInt32((db+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { + for (rc == SQLITE_OK) && !(libc.AtomicLoadNInt32((db+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { var iIdx int32 // Index of child node in parent var pPage uintptr // Current page of the b-tree @@ -51085,12 +51305,12 @@ func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr // Return the pager associated with a BTree. This routine is used for // testing and debugging only. -func Xsqlite3BtreePager(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:74101:22: */ +func Xsqlite3BtreePager(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:74727:22: */ return (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager } // Append a message to the error message string. -func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:74109:13: */ +func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:74735:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -51103,7 +51323,7 @@ func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*IntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, (pCheck + 56 /* &.errMsg */), ts+3012 /* "\n" */, 1) + Xsqlite3_str_append(tls, (pCheck + 56 /* &.errMsg */), ts+3040 /* "\n" */, 1) } if (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, (pCheck + 56 /* &.errMsg */), (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -51117,13 +51337,13 @@ func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) // Return non-zero if the bit in the IntegrityCk.aPgRef[] array that // corresponds to page iPg is already set. -func getPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) int32 { /* sqlite3.c:74139:12: */ +func getPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) int32 { /* sqlite3.c:74765:12: */ return (int32(*(*U8)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr((iPg / Pgno(8)))))) & (int32(1) << (iPg & Pgno(0x07)))) } // Set the bit in the IntegrityCk.aPgRef[] array that corresponds to page iPg. -func setPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) { /* sqlite3.c:74147:13: */ +func setPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) { /* sqlite3.c:74773:13: */ *(*U8)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr((iPg / Pgno(8))))) |= U8((int32(1) << (iPg & Pgno(0x07)))) } @@ -51134,19 +51354,19 @@ func setPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) { /* sqlite3.c:7 // if this is the first reference to the page. // // Also check that the page number is in bounds. -func checkRef(tls *libc.TLS, pCheck uintptr, iPage Pgno) int32 { /* sqlite3.c:74161:12: */ +func checkRef(tls *libc.TLS, pCheck uintptr, iPage Pgno) int32 { /* sqlite3.c:74787:12: */ bp := tls.Alloc(16) defer tls.Free(16) if (iPage > (*IntegrityCk)(unsafe.Pointer(pCheck)).FnPage) || (iPage == Pgno(0)) { - checkAppendMsg(tls, pCheck, ts+3014 /* "invalid page num..." */, libc.VaList(bp, iPage)) + checkAppendMsg(tls, pCheck, ts+3042 /* "invalid page num..." */, libc.VaList(bp, iPage)) return 1 } if getPageReferenced(tls, pCheck, iPage) != 0 { - checkAppendMsg(tls, pCheck, ts+3037 /* "2nd reference to..." */, libc.VaList(bp+8, iPage)) + checkAppendMsg(tls, pCheck, ts+3065 /* "2nd reference to..." */, libc.VaList(bp+8, iPage)) return 1 } - if libc.AtomicLoadNInt32(((*IntegrityCk)(unsafe.Pointer(pCheck)).Fdb+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0 { + if libc.AtomicLoadNInt32(((*IntegrityCk)(unsafe.Pointer(pCheck)).Fdb+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0 { return 1 } setPageReferenced(tls, pCheck, iPage) @@ -51156,7 +51376,7 @@ func checkRef(tls *libc.TLS, pCheck uintptr, iPage Pgno) int32 { /* sqlite3.c:74 // 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 *libc.TLS, pCheck uintptr, iChild Pgno, eType U8, iParent Pgno) { /* sqlite3.c:74181:13: */ +func checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild Pgno, eType U8, iParent Pgno) { /* sqlite3.c:74807:13: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -51170,20 +51390,20 @@ func checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild Pgno, eType U8, iParent P if (rc == SQLITE_NOMEM) || (rc == (SQLITE_IOERR | (int32(12) << 8))) { (*IntegrityCk)(unsafe.Pointer(pCheck)).FbOomFault = 1 } - checkAppendMsg(tls, pCheck, ts+3062 /* "Failed to read p..." */, libc.VaList(bp, iChild)) + checkAppendMsg(tls, pCheck, ts+3090 /* "Failed to read p..." */, libc.VaList(bp, iChild)) return } if (int32(*(*U8)(unsafe.Pointer(bp + 48 /* ePtrmapType */))) != int32(eType)) || (*(*Pgno)(unsafe.Pointer(bp + 52 /* iPtrmapParent */)) != iParent) { checkAppendMsg(tls, pCheck, - ts+3091, /* "Bad ptr map entr..." */ + ts+3119, /* "Bad ptr map entr..." */ libc.VaList(bp+8, iChild, int32(eType), iParent, int32(*(*U8)(unsafe.Pointer(bp + 48 /* ePtrmapType */))), *(*Pgno)(unsafe.Pointer(bp + 52 /* iPtrmapParent */)))) } } // 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 *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U32) { /* sqlite3.c:74210:13: */ +func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U32) { /* sqlite3.c:74836:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -51199,24 +51419,24 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 } N-- if Xsqlite3PagerGet(tls, (*IntegrityCk)(unsafe.Pointer(pCheck)).FpPager, iPage, bp+40 /* &pOvflPage */, 0) != 0 { - checkAppendMsg(tls, pCheck, ts+3145 /* "failed to get pa..." */, libc.VaList(bp, iPage)) + checkAppendMsg(tls, pCheck, ts+3173 /* "failed to get pa..." */, libc.VaList(bp, iPage)) break } pOvflData = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pOvflPage */))) if isFreeList != 0 { var n U32 = Xsqlite3Get4byte(tls, (pOvflData + 4)) if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 { - checkPtrmap(tls, pCheck, iPage, PTRMAP_FREEPAGE, uint32(0)) + checkPtrmap(tls, pCheck, iPage, uint8(PTRMAP_FREEPAGE), uint32(0)) } if n > (((*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize / U32(4)) - U32(2)) { checkAppendMsg(tls, pCheck, - ts+3167 /* "freelist leaf co..." */, libc.VaList(bp+8, iPage)) + ts+3195 /* "freelist leaf co..." */, libc.VaList(bp+8, iPage)) N-- } else { for i = 0; i < int32(n); i++ { var iFreePage Pgno = Xsqlite3Get4byte(tls, (pOvflData + uintptr((8 + (i * 4))))) if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 { - checkPtrmap(tls, pCheck, iFreePage, PTRMAP_FREEPAGE, uint32(0)) + checkPtrmap(tls, pCheck, iFreePage, uint8(PTRMAP_FREEPAGE), uint32(0)) } checkRef(tls, pCheck, iFreePage) } @@ -51228,7 +51448,7 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 // the following page matches iPage. if ((*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0) && (N > U32(0)) { i = int32(Xsqlite3Get4byte(tls, pOvflData)) - checkPtrmap(tls, pCheck, uint32(i), PTRMAP_OVERFLOW2, iPage) + checkPtrmap(tls, pCheck, uint32(i), uint8(PTRMAP_OVERFLOW2), iPage) } } iPage = Xsqlite3Get4byte(tls, pOvflData) @@ -51236,12 +51456,12 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 } if (N != 0) && (nErrAtStart == (*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr) { checkAppendMsg(tls, pCheck, - ts+3206, /* "%s is %d but sho..." */ + ts+3234, /* "%s is %d but sho..." */ libc.VaList(bp+16, func() uintptr { if isFreeList != 0 { - return ts + 3232 /* "size" */ + return ts + 3260 /* "size" */ } - return ts + 3237 /* "overflow list le..." */ + return ts + 3265 /* "overflow list le..." */ }(), (expected-N), expected)) } @@ -51267,7 +51487,7 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 // 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 *libc.TLS, aHeap uintptr, x U32) { /* sqlite3.c:74299:13: */ +func btreeHeapInsert(tls *libc.TLS, aHeap uintptr, x U32) { /* sqlite3.c:74925:13: */ var j U32 var i U32 = libc.PreIncUint32(&*(*U32)(unsafe.Pointer(aHeap)), 1) *(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4)) = x @@ -51279,7 +51499,7 @@ func btreeHeapInsert(tls *libc.TLS, aHeap uintptr, x U32) { /* sqlite3.c:74299:1 } } -func btreeHeapPull(tls *libc.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite3.c:74309:12: */ +func btreeHeapPull(tls *libc.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite3.c:74935:12: */ var j U32 var i U32 var x U32 @@ -51318,7 +51538,7 @@ func btreeHeapPull(tls *libc.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite // 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 *libc.TLS, pCheck uintptr, iPage Pgno, piMinKey uintptr, maxKey I64) int32 { /* sqlite3.c:74343:12: */ +func checkTreePage(tls *libc.TLS, pCheck uintptr, iPage Pgno, piMinKey uintptr, maxKey I64) int32 { /* sqlite3.c:74969:12: */ bp := tls.Alloc(140) defer tls.Free(140) *(*I64)(unsafe.Pointer(bp + 104)) = maxKey @@ -51385,13 +51605,13 @@ __1: return 0 __2: ; - (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 3258 /* "Page %u: " */ + (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 3286 /* "Page %u: " */ (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage if !((libc.AssignInt32(&rc, btreeGetPage(tls, pBt, iPage, bp+96 /* &pPage */, 0))) != 0) { goto __3 } checkAppendMsg(tls, pCheck, - ts+3268 /* "unable to get th..." */, libc.VaList(bp, rc)) + ts+3296 /* "unable to get th..." */, libc.VaList(bp, rc)) goto end_of_check __3: ; @@ -51405,7 +51625,7 @@ __3: } // The only possible error from InitPage checkAppendMsg(tls, pCheck, - ts+3306 /* "btreeInitPage() ..." */, libc.VaList(bp+8, rc)) + ts+3334 /* "btreeInitPage() ..." */, libc.VaList(bp+8, rc)) goto end_of_check __4: ; @@ -51413,7 +51633,7 @@ __4: goto __5 } - checkAppendMsg(tls, pCheck, ts+3344 /* "free space corru..." */, libc.VaList(bp+16, rc)) + checkAppendMsg(tls, pCheck, ts+3372 /* "free space corru..." */, libc.VaList(bp+16, rc)) goto end_of_check __5: ; @@ -51421,7 +51641,7 @@ __5: hdr = int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).FhdrOffset) // Set up for cell analysis - (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 3366 /* "On tree page %u ..." */ + (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 3394 /* "On tree page %u ..." */ contentOffset = (U32(((((int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5)))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5))) + 1)))) - 1) & 0xffff) + 1)) // Enforced by btreeInitPage() @@ -51443,8 +51663,8 @@ __5: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __8 } - (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 3392 /* "On page %u at ri..." */ - checkPtrmap(tls, pCheck, uint32(pgno), PTRMAP_BTREE, iPage) + (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 3420 /* "On page %u at ri..." */ + checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage) __8: ; depth = checkTreePage(tls, pCheck, uint32(pgno), bp+104 /* &maxKey */, *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))) @@ -51474,7 +51694,7 @@ __9: if !((pc < contentOffset) || (pc > (usableSize - U32(4)))) { goto __12 } - checkAppendMsg(tls, pCheck, ts+3420, /* "Offset %d out of..." */ + checkAppendMsg(tls, pCheck, ts+3448, /* "Offset %d out of..." */ libc.VaList(bp+24, pc, contentOffset, (usableSize-U32(4)))) doCoverageCheck = 0 goto __10 @@ -51485,7 +51705,7 @@ __12: if !((pc + U32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnSize)) > usableSize) { goto __13 } - checkAppendMsg(tls, pCheck, ts+3450 /* "Extends off end ..." */, 0) + checkAppendMsg(tls, pCheck, ts+3478 /* "Extends off end ..." */, 0) doCoverageCheck = 0 goto __10 __13: @@ -51503,7 +51723,7 @@ __13: }() != 0) { goto __15 } - checkAppendMsg(tls, pCheck, ts+3474 /* "Rowid %lld out o..." */, libc.VaList(bp+48, (*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey)) + checkAppendMsg(tls, pCheck, ts+3502 /* "Rowid %lld out o..." */, libc.VaList(bp+48, (*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey)) __15: ; *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */)) = (*CellInfo)(unsafe.Pointer(bp + 112 /* &info */)).FnKey @@ -51521,7 +51741,7 @@ __14: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __17 } - checkPtrmap(tls, pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage) + checkPtrmap(tls, pCheck, pgnoOvfl, uint8(PTRMAP_OVERFLOW1), iPage) __17: ; checkList(tls, pCheck, 0, pgnoOvfl, nPage) @@ -51536,7 +51756,7 @@ __16: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __20 } - checkPtrmap(tls, pCheck, uint32(pgno), PTRMAP_BTREE, iPage) + checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage) __20: ; d2 = checkTreePage(tls, pCheck, uint32(pgno), bp+104 /* &maxKey */, *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))) @@ -51544,7 +51764,7 @@ __20: if !(d2 != depth) { goto __21 } - checkAppendMsg(tls, pCheck, ts+3498 /* "Child page depth..." */, 0) + checkAppendMsg(tls, pCheck, ts+3526 /* "Child page depth..." */, 0) depth = d2 __21: ; @@ -51642,7 +51862,7 @@ __29: goto __31 } checkAppendMsg(tls, pCheck, - ts+3523 /* "Multiple uses fo..." */, libc.VaList(bp+56, (*(*U32)(unsafe.Pointer(bp + 136 /* x */))>>16), iPage)) + ts+3551 /* "Multiple uses fo..." */, libc.VaList(bp+56, (*(*U32)(unsafe.Pointer(bp + 136 /* x */))>>16), iPage)) goto __30 goto __32 __31: @@ -51662,7 +51882,7 @@ __30: goto __33 } checkAppendMsg(tls, pCheck, - ts+3560, /* "Fragmentation of..." */ + ts+3588, /* "Fragmentation of..." */ libc.VaList(bp+72, nFrag, int32(*(*U8)(unsafe.Pointer(data + uintptr((hdr + 7))))), iPage)) __33: ; @@ -51703,7 +51923,7 @@ __34: // since obviously it is not possible to know which pages are covered by // the unverified btrees. Except, if aRoot[1] is 1, then the freelist // checks are still performed. -func Xsqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uintptr, nRoot int32, mxErr int32, pnErr uintptr) uintptr { /* sqlite3.c:74622:21: */ +func Xsqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uintptr, nRoot int32, mxErr int32, pnErr uintptr) uintptr { /* sqlite3.c:75248:21: */ bp := tls.Alloc(248) defer tls.Free(248) @@ -51754,7 +51974,7 @@ __1: (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FaPgRef = uintptr(0) (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).Fheap = uintptr(0) Xsqlite3StrAccumInit(tls, (bp + 32 /* &sCheck */ + 56 /* &.errMsg */), uintptr(0), bp+136 /* &zErr[0] */, int32(unsafe.Sizeof([100]int8{})), SQLITE_MAX_LENGTH) - (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FerrMsg.FprintfFlags = SQLITE_PRINTF_INTERNAL + (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FerrMsg.FprintfFlags = U8(SQLITE_PRINTF_INTERNAL) if !((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnPage == Pgno(0)) { goto __3 } @@ -51791,7 +52011,7 @@ __6: if !(bCkFreelist != 0) { goto __7 } - (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FzPfx = ts + 3612 /* "Main freelist: " */ + (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FzPfx = ts + 3640 /* "Main freelist: " */ checkList(tls, bp+32 /* &sCheck */, 1, Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32)), Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36))) (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FzPfx = uintptr(0) @@ -51829,7 +52049,7 @@ __13: goto __15 } checkAppendMsg(tls, bp+32, /* &sCheck */ - ts+3628, /* "max rootpage (%d..." */ + ts+3656, /* "max rootpage (%d..." */ libc.VaList(bp, mx, mxInHdr)) __15: ; @@ -51839,7 +52059,7 @@ __9: goto __16 } checkAppendMsg(tls, bp+32, /* &sCheck */ - ts+3673 /* "incremental_vacu..." */, 0) + ts+3701 /* "incremental_vacu..." */, 0) __16: ; __10: @@ -51847,7 +52067,7 @@ __10: __8: ; - *(*U64)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_CellSizeCk)) + *(*U64)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_CellSizeCk))) i = Pgno(0) __17: if !((int32(i) < nRoot) && ((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FmxErr != 0)) { @@ -51862,7 +52082,7 @@ __20: if !((((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)) > Pgno(1))) && !(bPartial != 0)) { goto __21 } - checkPtrmap(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), PTRMAP_ROOTPAGE, uint32(0)) + checkPtrmap(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), uint8(PTRMAP_ROOTPAGE), uint32(0)) __21: ; checkTreePage(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), bp+240 /* ¬Used */, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) @@ -51889,13 +52109,13 @@ __23: if !((getPageReferenced(tls, bp+32 /* &sCheck */, i) == 0) && ((ptrmapPageno(tls, pBt, i) != i) || !(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0))) { goto __26 } - checkAppendMsg(tls, bp+32 /* &sCheck */, ts+3728 /* "Page %d is never..." */, libc.VaList(bp+16, i)) + checkAppendMsg(tls, bp+32 /* &sCheck */, ts+3756 /* "Page %d is never..." */, libc.VaList(bp+16, i)) __26: ; if !((getPageReferenced(tls, bp+32 /* &sCheck */, i) != 0) && ((ptrmapPageno(tls, pBt, i) == i) && ((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0))) { goto __27 } - checkAppendMsg(tls, bp+32 /* &sCheck */, ts+3750 /* "Pointer map page..." */, libc.VaList(bp+24, i)) + checkAppendMsg(tls, bp+32 /* &sCheck */, ts+3778 /* "Pointer map page..." */, libc.VaList(bp+24, i)) __27: ; goto __24 @@ -51937,7 +52157,7 @@ __29: // // The pager filename is invariant as long as the pager is // open so it is safe to access without the BtShared mutex. -func Xsqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:74777:27: */ +func Xsqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:75403:27: */ return Xsqlite3PagerFilename(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager, 1) } @@ -51948,15 +52168,19 @@ func Xsqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:7 // // The pager journal filename is invariant as long as the pager is // open so it is safe to access without the BtShared mutex. -func Xsqlite3BtreeGetJournalname(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:74790:27: */ +func Xsqlite3BtreeGetJournalname(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:75416:27: */ return Xsqlite3PagerJournalname(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager) } -// Return non-zero if a transaction is active. -func Xsqlite3BtreeIsInTrans(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74798:20: */ +// Return one of SQLITE_TXN_NONE, SQLITE_TXN_READ, or SQLITE_TXN_WRITE +// to describe the current transaction state of Btree p. +func Xsqlite3BtreeTxnState(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75425:20: */ - return (libc.Bool32((p != 0) && (int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE))) + if p != 0 { + return int32((*Btree)(unsafe.Pointer(p)).FinTrans) + } + return 0 } // Run a checkpoint on the Btree passed as the first argument. @@ -51965,7 +52189,7 @@ func Xsqlite3BtreeIsInTrans(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74798 // transaction on the shared-cache the argument Btree is connected to. // // Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART. -func Xsqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:74812:20: */ +func Xsqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:75439:20: */ var rc int32 = SQLITE_OK if p != 0 { var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt @@ -51980,13 +52204,8 @@ func Xsqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintpt return rc } -// Return non-zero if a read (or write) transaction is active. -func Xsqlite3BtreeIsInReadTrans(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74831:20: */ - - return (libc.Bool32(int32((*Btree)(unsafe.Pointer(p)).FinTrans) != TRANS_NONE)) -} - -func Xsqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74837:20: */ +// Return true if there is currently a backup running on Btree p. +func Xsqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75458:20: */ return (libc.Bool32((*Btree)(unsafe.Pointer(p)).FnBackup != 0)) } @@ -52009,7 +52228,7 @@ func Xsqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:7483 // 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 Xsqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) uintptr { /* sqlite3.c:74863:21: */ +func Xsqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) uintptr { /* sqlite3.c:75484:21: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpSchema) != 0) && (nBytes != 0) { @@ -52023,11 +52242,11 @@ func Xsqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) // Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared // btree as the argument handle holds an exclusive lock on the // sqlite_schema table. Otherwise SQLITE_OK. -func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74879:20: */ +func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75500:20: */ var rc int32 Xsqlite3BtreeEnter(tls, p) - rc = querySharedCacheTableLock(tls, p, SCHEMA_ROOT, READ_LOCK) + rc = querySharedCacheTableLock(tls, p, uint32(SCHEMA_ROOT), uint8(READ_LOCK)) Xsqlite3BtreeLeave(tls, p) return rc @@ -52036,7 +52255,7 @@ func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74 // 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 Xsqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock U8) int32 { /* sqlite3.c:74896:20: */ +func Xsqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock U8) int32 { /* sqlite3.c:75517:20: */ var rc int32 = SQLITE_OK if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 { @@ -52060,7 +52279,7 @@ func Xsqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock U8 // 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 Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z uintptr) int32 { /* sqlite3.c:74926:20: */ +func Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z uintptr) int32 { /* sqlite3.c:75547:20: */ var rc int32 rc = func() int32 { @@ -52100,7 +52319,7 @@ func Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z ui } // Mark this cursor as an incremental blob cursor. -func Xsqlite3BtreeIncrblobCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:74974:21: */ +func Xsqlite3BtreeIncrblobCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:75595:21: */ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((BTCF_Incrblob)) (*Btree)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBtree)).FhasIncrblobCur = U8(1) } @@ -52108,7 +52327,7 @@ func Xsqlite3BtreeIncrblobCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:749 // 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 Xsqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) int32 { /* sqlite3.c:74985:20: */ +func Xsqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) int32 { /* sqlite3.c:75606:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(pBtree)).FpBt var rc int32 // Return code @@ -52140,29 +52359,29 @@ func Xsqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) int3 // Return true if the cursor has a hint specified. This routine is // only used from within assert() statements -func Xsqlite3BtreeCursorHasHint(tls *libc.TLS, pCsr uintptr, mask uint32) int32 { /* sqlite3.c:75020:20: */ +func Xsqlite3BtreeCursorHasHint(tls *libc.TLS, pCsr uintptr, mask uint32) int32 { /* sqlite3.c:75641:20: */ return (libc.Bool32((uint32((*BtCursor)(unsafe.Pointer(pCsr)).Fhints) & mask) != uint32(0))) } // Return true if the given Btree is read-only. -func Xsqlite3BtreeIsReadonly(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75027:20: */ +func Xsqlite3BtreeIsReadonly(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75648:20: */ return (libc.Bool32((int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & BTS_READ_ONLY) != 0)) } // Return the size of the header added to each page by this module. -func Xsqlite3HeaderSizeBtree(tls *libc.TLS) int32 { /* sqlite3.c:75034:20: */ +func Xsqlite3HeaderSizeBtree(tls *libc.TLS) int32 { /* sqlite3.c:75655:20: */ return (int32(((uint64(unsafe.Sizeof(MemPage{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) } // Return true if the Btree passed as the only argument is sharable. -func Xsqlite3BtreeSharable(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75040:20: */ +func Xsqlite3BtreeSharable(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75661:20: */ return int32((*Btree)(unsafe.Pointer(p)).Fsharable) } // 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 Xsqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75049:20: */ +func Xsqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75670:20: */ return (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FnRef } @@ -52202,20 +52421,20 @@ func Xsqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c // If the "temp" database is requested, it may need to be opened by this // function. If an error occurs while doing so, return 0 and write an // error message to pErrorDb. -func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintptr { /* sqlite3.c:75138:14: */ - bp := tls.Alloc(440) - defer tls.Free(440) +func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintptr { /* sqlite3.c:75759:14: */ + bp := tls.Alloc(424) + defer tls.Free(424) var i int32 = Xsqlite3FindDbName(tls, pDb, zDb) if i == 1 { - // var sParse Parse at bp+16, 424 + // var sParse Parse at bp+16, 408 var rc int32 = 0 libc.Xmemset(tls, bp+16 /* &sParse */, 0, uint64(unsafe.Sizeof(Parse{}))) (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).Fdb = pDb if Xsqlite3OpenTempDatabase(tls, bp+16 /* &sParse */) != 0 { - Xsqlite3ErrorWithMsg(tls, pErrorDb, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc, ts+2690 /* "%s" */, libc.VaList(bp, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzErrMsg)) + Xsqlite3ErrorWithMsg(tls, pErrorDb, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc, ts+2718 /* "%s" */, libc.VaList(bp, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzErrMsg)) rc = SQLITE_ERROR } Xsqlite3DbFree(tls, pErrorDb, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzErrMsg) @@ -52226,7 +52445,7 @@ func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintpt } if i < 0 { - Xsqlite3ErrorWithMsg(tls, pErrorDb, SQLITE_ERROR, ts+3784 /* "unknown database..." */, libc.VaList(bp+8, zDb)) + Xsqlite3ErrorWithMsg(tls, pErrorDb, SQLITE_ERROR, ts+3812 /* "unknown database..." */, libc.VaList(bp+8, zDb)) return uintptr(0) } @@ -52235,7 +52454,7 @@ func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintpt // Attempt to set the page size of the destination to match the page size // of the source. -func setDestPgsz(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75169:12: */ +func setDestPgsz(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75790:12: */ var rc int32 rc = Xsqlite3BtreeSetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, Xsqlite3BtreeGetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc), 0, 0) return rc @@ -52245,9 +52464,9 @@ func setDestPgsz(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75169:12: */ // second argument. If there is not, return SQLITE_OK. Otherwise, if there // is an open read-transaction, return SQLITE_ERROR and leave an error // message in database handle db. -func checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:75181:12: */ - if Xsqlite3BtreeIsInReadTrans(tls, p) != 0 { - Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+3804 /* "destination data..." */, 0) +func checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:75802:12: */ + if Xsqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { + Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+3832 /* "destination data..." */, 0) return SQLITE_ERROR } return SQLITE_OK @@ -52259,7 +52478,7 @@ func checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlit // // If an error occurs, NULL is returned and an error code and error message // stored in database handle pDestDb. -func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcDb uintptr, zSrcDb uintptr) uintptr { /* sqlite3.c:75197:27: */ +func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcDb uintptr, zSrcDb uintptr) uintptr { /* sqlite3.c:75818:27: */ var p uintptr // Value to return // Lock the source database handle. The destination database @@ -52274,7 +52493,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD if pSrcDb == pDestDb { Xsqlite3ErrorWithMsg(tls, - pDestDb, SQLITE_ERROR, ts+3835 /* "source and desti..." */, 0) + pDestDb, SQLITE_ERROR, ts+3863 /* "source and desti..." */, 0) p = uintptr(0) } else { // Allocate space for a new sqlite3_backup object... @@ -52319,14 +52538,14 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD // 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 *libc.TLS, rc int32) int32 { /* sqlite3.c:75274:12: */ +func isFatalError(tls *libc.TLS, rc int32) int32 { /* sqlite3.c:75895:12: */ return (libc.Bool32(((rc != SQLITE_OK) && (rc != SQLITE_BUSY)) && (rc != SQLITE_LOCKED))) } // 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 *libc.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpdate int32) int32 { /* sqlite3.c:75283:12: */ +func backupOnePage(tls *libc.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpdate int32) int32 { /* sqlite3.c:75904:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -52388,7 +52607,7 @@ func backupOnePage(tls *libc.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpd // // Return SQLITE_OK if everything is successful, or an SQLite error // code if an error occurs. -func backupTruncateFile(tls *libc.TLS, pFile uintptr, iSize I64) int32 { /* sqlite3.c:75352:12: */ +func backupTruncateFile(tls *libc.TLS, pFile uintptr, iSize I64) int32 { /* sqlite3.c:75973:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -52403,7 +52622,7 @@ func backupTruncateFile(tls *libc.TLS, pFile uintptr, iSize I64) int32 { /* sqli // Register this backup object with the associated source pager for // callbacks when pages are changed or the cache invalidated. -func attachBackupObject(tls *libc.TLS, p uintptr) { /* sqlite3.c:75365:13: */ +func attachBackupObject(tls *libc.TLS, p uintptr) { /* sqlite3.c:75986:13: */ var pp uintptr pp = Xsqlite3PagerBackupPtr(tls, Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)) @@ -52413,7 +52632,7 @@ func attachBackupObject(tls *libc.TLS, p uintptr) { /* sqlite3.c:75365:13: */ } // Copy nPage pages from the source b-tree to the destination. -func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqlite3.c:75377:16: */ +func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqlite3.c:75998:16: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -52447,7 +52666,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli // If there is no open read-transaction on the source database, open // one now. If a transaction is opened here, then it will be closed // before this function exits. - if (rc == SQLITE_OK) && (0 == Xsqlite3BtreeIsInReadTrans(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)) { + if (rc == SQLITE_OK) && (SQLITE_TXN_NONE == Xsqlite3BtreeTxnState(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)) { rc = Xsqlite3BtreeBeginTrans(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc, 0, uintptr(0)) bCloseTrans = 1 } @@ -52651,7 +52870,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli } // Release all resources associated with an sqlite3_backup* handle. -func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75631:16: */ +func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76252:16: */ var pp uintptr // Ptr to head of pagers backup list var pSrcDb uintptr // Source database connection var rc int32 // Value to return @@ -52709,13 +52928,13 @@ func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75631 // Return the number of pages still to be backed up as of the most recent // call to sqlite3_backup_step(). -func Xsqlite3_backup_remaining(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75685:16: */ +func Xsqlite3_backup_remaining(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76306:16: */ return int32((*Sqlite3_backup)(unsafe.Pointer(p)).FnRemaining) } // Return the total number of pages in the source database as of the most // recent call to sqlite3_backup_step(). -func Xsqlite3_backup_pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75699:16: */ +func Xsqlite3_backup_pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76320:16: */ return int32((*Sqlite3_backup)(unsafe.Pointer(p)).FnPagecount) } @@ -52729,7 +52948,7 @@ func Xsqlite3_backup_pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75 // It is assumed that the mutex associated with the BtShared object // corresponding to the source database is held when this function is // called. -func backupUpdate(tls *libc.TLS, p uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:75721:29: */ +func backupUpdate(tls *libc.TLS, p uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:76342:29: */ for ok := true; ok; ok = ((libc.AssignUintptr(&p, (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext)) != uintptr(0)) { @@ -52750,7 +52969,7 @@ func backupUpdate(tls *libc.TLS, p uintptr, iPage Pgno, aData uintptr) { /* sqli } } -func Xsqlite3BackupUpdate(tls *libc.TLS, pBackup uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:75746:21: */ +func Xsqlite3BackupUpdate(tls *libc.TLS, pBackup uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:76367:21: */ if pBackup != 0 { backupUpdate(tls, pBackup, iPage, aData) } @@ -52765,7 +52984,7 @@ func Xsqlite3BackupUpdate(tls *libc.TLS, pBackup uintptr, iPage Pgno, aData uint // It is assumed that the mutex associated with the BtShared object // corresponding to the source database is held when this function is // called. -func Xsqlite3BackupRestart(tls *libc.TLS, pBackup uintptr) { /* sqlite3.c:75761:21: */ +func Xsqlite3BackupRestart(tls *libc.TLS, pBackup uintptr) { /* sqlite3.c:76382:21: */ var p uintptr // Iterator variable for p = pBackup; p != 0; p = (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext { @@ -52779,7 +52998,7 @@ func Xsqlite3BackupRestart(tls *libc.TLS, pBackup uintptr) { /* sqlite3.c:75761: // 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 Xsqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:75778:20: */ +func Xsqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:76399:20: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -52873,7 +53092,7 @@ copy_finished: // Render a Mem object which is one of MEM_Int, MEM_Real, or MEM_IntReal // into a buffer. -func vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { /* sqlite3.c:75934:13: */ +func vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { /* sqlite3.c:76555:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -52888,7 +53107,7 @@ func vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { /* sql Xsqlite3Int64ToText(tls, *(*I64)(unsafe.Pointer(bp + 8 /* x */)), zBuf) } else { Xsqlite3StrAccumInit(tls, bp+16 /* &acc */, uintptr(0), zBuf, sz, 0) - Xsqlite3_str_appendf(tls, bp+16 /* &acc */, ts+3875, /* "%!.15g" */ + Xsqlite3_str_appendf(tls, bp+16 /* &acc */, ts+3903, /* "%!.15g" */ libc.VaList(bp, func() float64 { if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_IntReal) != 0 { return float64(*(*I64)(unsafe.Pointer(p /* &.u */))) @@ -52911,7 +53130,7 @@ func vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { /* sql // 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 Xsqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) int32 { /* sqlite3.c:76027:20: */ +func Xsqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) int32 { /* sqlite3.c:76648:20: */ var rc int32 if !((int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Str) != 0) || (int32((*Mem)(unsafe.Pointer(pMem)).Fenc) == desiredEnc) { @@ -52931,7 +53150,7 @@ func Xsqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) i // 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 Xsqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) int32 { /* sqlite3.c:76061:36: */ +func Xsqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) int32 { /* sqlite3.c:76682:36: */ // If the bPreserve flag is set to true, then the memory cell must already // contain a valid string or blob value. @@ -52987,7 +53206,7 @@ func Xsqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) // // Return SQLITE_OK on success or an error code (probably SQLITE_NOMEM) // if unable to complete the resizing. -func Xsqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) int32 { /* sqlite3.c:76122:20: */ +func Xsqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) int32 { /* sqlite3.c:76743:20: */ if (*Mem)(unsafe.Pointer(pMem)).FszMalloc < szNew { return Xsqlite3VdbeMemGrow(tls, pMem, szNew, 0) @@ -53005,7 +53224,7 @@ func Xsqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) int // to be a double-zero byte at an even byte boundary in order to // terminate a UTF16 string, even if the initial size of the buffer // is an odd number of bytes. -func vdbeMemAddTerminator(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76143:28: */ +func vdbeMemAddTerminator(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76764:28: */ if Xsqlite3VdbeMemGrow(tls, pMem, ((*Mem)(unsafe.Pointer(pMem)).Fn+3), 1) != 0 { return SQLITE_NOMEM } @@ -53020,7 +53239,7 @@ func vdbeMemAddTerminator(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:7614 // MEM.zMalloc, where it can be safely written. // // Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails. -func Xsqlite3VdbeMemMakeWriteable(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76160:20: */ +func Xsqlite3VdbeMemMakeWriteable(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76781:20: */ if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Str | MEM_Blob)) != 0 { if func() int32 { @@ -53045,7 +53264,7 @@ func Xsqlite3VdbeMemMakeWriteable(tls *libc.TLS, pMem uintptr) int32 { /* sqlite // If the given Mem* has a zero-filled tail, turn it into an ordinary // blob stored in dynamically allocated space. -func Xsqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76183:20: */ +func Xsqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76804:20: */ var nByte int32 // Set nByte to the number of bytes required to store the expanded blob. @@ -53067,7 +53286,7 @@ func Xsqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c } // Make sure the given Mem is \u0000 terminated. -func Xsqlite3VdbeMemNulTerminate(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76211:20: */ +func Xsqlite3VdbeMemNulTerminate(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76832:20: */ if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Term | MEM_Str)) != MEM_Str { return SQLITE_OK // Nothing to do @@ -53089,7 +53308,7 @@ func Xsqlite3VdbeMemNulTerminate(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3 // 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 Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) int32 { /* sqlite3.c:76236:20: */ +func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) int32 { /* sqlite3.c:76857:20: */ var nByte int32 = 32 if Xsqlite3VdbeMemClearAndResize(tls, pMem, nByte) != 0 { @@ -53100,7 +53319,7 @@ func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) in vdbeMemRenderNum(tls, nByte, (*Mem)(unsafe.Pointer(pMem)).Fz, pMem) (*Mem)(unsafe.Pointer(pMem)).Fn = (int32(libc.Xstrlen(tls, (*Mem)(unsafe.Pointer(pMem)).Fz) & uint64(0x3fffffff))) - (*Mem)(unsafe.Pointer(pMem)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(pMem)).Fenc = U8(SQLITE_UTF8) *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16((MEM_Str | MEM_Term)) if bForce != 0 { *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((MEM_Int | MEM_Real) | MEM_IntReal)))) @@ -53115,7 +53334,7 @@ func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) in // // Return SQLITE_ERROR if the finalizer reports an error. SQLITE_OK // otherwise. -func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 { /* sqlite3.c:76270:20: */ +func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 { /* sqlite3.c:76891:20: */ bp := tls.Alloc(112) defer tls.Free(112) @@ -53125,7 +53344,7 @@ func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 { libc.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(Sqlite3_context{}))) libc.Xmemset(tls, bp+56 /* &t */, 0, uint64(unsafe.Sizeof(Mem{}))) - (*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fdb = (*Mem)(unsafe.Pointer(pMem)).Fdb (*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpOut = bp + 56 /* &t */ (*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpMem = pMem @@ -53145,7 +53364,7 @@ func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 { // // SQLITE_ERROR is returned if xValue() reports an error. SQLITE_OK // otherwise. -func Xsqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) int32 { /* sqlite3.c:76300:20: */ +func Xsqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) int32 { /* sqlite3.c:76921:20: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -53167,7 +53386,7 @@ func Xsqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc // 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 *libc.TLS, p uintptr) { /* sqlite3.c:76325:29: */ +func vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:76946:29: */ if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Agg) != 0 { Xsqlite3VdbeMemFinalize(tls, p, *(*uintptr)(unsafe.Pointer(p /* &.u */))) @@ -53177,7 +53396,7 @@ func vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:76325 (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((p + 48 /* &.xDel */))))(tls, (*Mem)(unsafe.Pointer(p)).Fz) } - (*Mem)(unsafe.Pointer(p)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Null) } // Release memory held by the Mem p, both external memory cleared @@ -53186,7 +53405,7 @@ func vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:76325 // 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 *libc.TLS, p uintptr) { /* sqlite3.c:76348:29: */ +func vdbeMemClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:76969:29: */ if (int32((*Mem)(unsafe.Pointer((p))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { vdbeMemClearExternAndSetNull(tls, p) } @@ -53205,7 +53424,7 @@ func vdbeMemClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:76348:29: */ // // Use sqlite3VdbeMemSetNull() to release just the Mem.xDel space // prior to inserting new content into the Mem. -func Xsqlite3VdbeMemRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:76369:21: */ +func Xsqlite3VdbeMemRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:76990:21: */ if ((int32((*Mem)(unsafe.Pointer((p))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0) || ((*Mem)(unsafe.Pointer(p)).FszMalloc != 0) { vdbeMemClear(tls, p) @@ -53215,7 +53434,7 @@ func Xsqlite3VdbeMemRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:76369:21: * // 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 *libc.TLS, r float64) I64 { /* sqlite3.c:76381:28: */ +func doubleToInt64(tls *libc.TLS, r float64) I64 { /* sqlite3.c:77002:28: */ if r <= float64(minInt) { return minInt @@ -53227,8 +53446,8 @@ func doubleToInt64(tls *libc.TLS, r float64) I64 { /* sqlite3.c:76381:28: */ return I64(0) } -var maxInt I64 = (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) /* sqlite3.c:76393:20 */ -var minInt I64 = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) /* sqlite3.c:76394:20 */ +var maxInt I64 = (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) /* sqlite3.c:77014:20 */ +var minInt I64 = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) /* sqlite3.c:77015:20 */ // Return some kind of integer value which is the best we can do // at representing the value that *pMem describes as an integer. @@ -53239,7 +53458,7 @@ var minInt I64 = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) < // an SQL-NULL value, return 0. // // If pMem represents a string value, its encoding might be changed. -func memIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:76417:28: */ +func memIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:77038:28: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -53248,7 +53467,7 @@ func memIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:76417:28: */ return *(*I64)(unsafe.Pointer(bp /* value */)) } -func Xsqlite3VdbeIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:76422:20: */ +func Xsqlite3VdbeIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:77043:20: */ var flags int32 flags = int32((*Mem)(unsafe.Pointer(pMem)).Fflags) @@ -53269,7 +53488,7 @@ func Xsqlite3VdbeIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:76422: // 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 *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:76445:31: */ +func memRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:77066:31: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -53279,7 +53498,7 @@ func memRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:76445:31: return *(*float64)(unsafe.Pointer(bp /* val */)) } -func Xsqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:76451:23: */ +func Xsqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:77072:23: */ if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Real) != 0 { return *(*float64)(unsafe.Pointer(pMem /* &.u */)) @@ -53297,7 +53516,7 @@ func Xsqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:7 // Return 1 if pMem represents true, and return 0 if pMem represents false. // Return the value ifNull if pMem is NULL. -func Xsqlite3VdbeBooleanValue(tls *libc.TLS, pMem uintptr, ifNull int32) int32 { /* sqlite3.c:76471:20: */ +func Xsqlite3VdbeBooleanValue(tls *libc.TLS, pMem uintptr, ifNull int32) int32 { /* sqlite3.c:77092:20: */ if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Int | MEM_IntReal)) != 0 { return (libc.Bool32(*(*I64)(unsafe.Pointer(pMem /* &.u */)) != int64(0))) @@ -53310,7 +53529,7 @@ func Xsqlite3VdbeBooleanValue(tls *libc.TLS, pMem uintptr, ifNull int32) int32 { // The MEM structure is already a MEM_Real. Try to also make it a // MEM_Int if we can. -func Xsqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:76482:21: */ +func Xsqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:77103:21: */ var ix I64 ix = doubleToInt64(tls, *(*float64)(unsafe.Pointer(pMem /* &.u */))) @@ -53331,7 +53550,7 @@ func Xsqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:764 } // Convert pMem to type integer. Invalidate any prior representations. -func Xsqlite3VdbeMemIntegerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76510:20: */ +func Xsqlite3VdbeMemIntegerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77131:20: */ *(*I64)(unsafe.Pointer(pMem /* &.u */)) = Xsqlite3VdbeIntValue(tls, pMem) (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int)) @@ -53340,7 +53559,7 @@ func Xsqlite3VdbeMemIntegerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c // Convert pMem so that it is of type MEM_Real. // Invalidate any prior representations. -func Xsqlite3VdbeMemRealify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76524:20: */ +func Xsqlite3VdbeMemRealify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77145:20: */ *(*float64)(unsafe.Pointer(pMem /* &.u */)) = Xsqlite3VdbeRealValue(tls, pMem) (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Real)) @@ -53355,7 +53574,7 @@ func Xsqlite3VdbeMemRealify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76 // For some versions of GCC on 32-bit machines, if you do the more obvious // comparison of "r1==(double)i" you sometimes get an answer of false even // though the r1 and (double)i values are bit-for-bit the same. -func Xsqlite3RealSameAsInt(tls *libc.TLS, r1 float64, i Sqlite3_int64) int32 { /* sqlite3.c:76542:20: */ +func Xsqlite3RealSameAsInt(tls *libc.TLS, r1 float64, i Sqlite3_int64) int32 { /* sqlite3.c:77163:20: */ bp := tls.Alloc(16) defer tls.Free(16) *(*float64)(unsafe.Pointer(bp)) = r1 @@ -53372,7 +53591,7 @@ func Xsqlite3RealSameAsInt(tls *libc.TLS, r1 float64, i Sqlite3_int64) int32 { / // 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 Xsqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76557:20: */ +func Xsqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77178:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -53399,7 +53618,7 @@ func Xsqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:7 // 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 Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 { /* sqlite3.c:76589:20: */ +func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 { /* sqlite3.c:77210:20: */ if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Null) != 0 { return SQLITE_OK } @@ -53407,7 +53626,7 @@ func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 case SQLITE_AFF_BLOB: { // Really a cast to BLOB if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Blob) == 0 { - Xsqlite3ValueApplyAffinity(tls, pMem, SQLITE_AFF_TEXT, encoding) + Xsqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding) if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Str) != 0 { (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Blob)) @@ -53440,7 +53659,7 @@ func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 { *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16(((int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Blob) >> 3)) - Xsqlite3ValueApplyAffinity(tls, pMem, SQLITE_AFF_TEXT, encoding) + Xsqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding) *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((((MEM_Int | MEM_Real) | MEM_IntReal) | MEM_Blob) | MEM_Zero)))) return Xsqlite3VdbeChangeEncoding(tls, pMem, int32(encoding)) @@ -53453,7 +53672,7 @@ func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 // Initialize bulk memory to be a consistent Mem object. // // The minimum amount of initialization feasible is performed. -func Xsqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags U16) { /* sqlite3.c:76632:21: */ +func Xsqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags U16) { /* sqlite3.c:77253:21: */ (*Mem)(unsafe.Pointer(pMem)).Fflags = flags (*Mem)(unsafe.Pointer(pMem)).Fdb = db @@ -53470,21 +53689,21 @@ func Xsqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags U16) { / // 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 Xsqlite3VdbeMemSetNull(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:76652:21: */ +func Xsqlite3VdbeMemSetNull(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:77273:21: */ if (int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { vdbeMemClearExternAndSetNull(tls, pMem) } else { - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null) } } -func Xsqlite3ValueSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:76659:21: */ +func Xsqlite3ValueSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:77280:21: */ Xsqlite3VdbeMemSetNull(tls, p) } // Delete any previous value and set the value to be a BLOB of length // n containing all zeros. -func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlite3.c:76667:21: */ +func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlite3.c:77288:21: */ Xsqlite3VdbeMemRelease(tls, pMem) (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16(MEM_Blob | MEM_Zero)) (*Mem)(unsafe.Pointer(pMem)).Fn = 0 @@ -53492,38 +53711,38 @@ func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlit n = 0 } *(*int32)(unsafe.Pointer(pMem /* &.u */)) = n - (*Mem)(unsafe.Pointer(pMem)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(pMem)).Fenc = U8(SQLITE_UTF8) (*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0) } // 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 *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:76682:29: */ +func vdbeReleaseAndSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:77303:29: */ Xsqlite3VdbeMemSetNull(tls, pMem) *(*I64)(unsafe.Pointer(pMem /* &.u */)) = val - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) } // Delete any previous value and set the value stored in *pMem to val, // manifest type INTEGER. -func Xsqlite3VdbeMemSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:76692:21: */ +func Xsqlite3VdbeMemSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:77313:21: */ if (int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { vdbeReleaseAndSetInt64(tls, pMem, val) } else { *(*I64)(unsafe.Pointer(pMem /* &.u */)) = val - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) } } // A no-op destructor -func Xsqlite3NoopDestructor(tls *libc.TLS, p uintptr) { /* sqlite3.c:76702:21: */ +func Xsqlite3NoopDestructor(tls *libc.TLS, p uintptr) { /* sqlite3.c:77323:21: */ _ = p } // Set the value stored in *pMem should already be a NULL. // Also store a pointer to go with it. -func Xsqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:76708:21: */ +func Xsqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:77329:21: */ *(*uintptr)(unsafe.Pointer(pMem /* &.u */)) = func() uintptr { if zPType != 0 { @@ -53544,11 +53763,11 @@ func Xsqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType // Delete any previous value and set the value stored in *pMem to val, // manifest type REAL. -func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64) { /* sqlite3.c:76727:21: */ +func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64) { /* sqlite3.c:77348:21: */ Xsqlite3VdbeMemSetNull(tls, pMem) if !(Xsqlite3IsNaN(tls, val) != 0) { *(*float64)(unsafe.Pointer(pMem /* &.u */)) = val - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Real + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Real) } } @@ -53557,7 +53776,7 @@ func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64) { /* sql // // Return SQLITE_OK on success and SQLITE_NOMEM if a memory allocation // error occurs. -func Xsqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76754:20: */ +func Xsqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77375:20: */ var db uintptr = (*Mem)(unsafe.Pointer(pMem)).Fdb var p uintptr @@ -53574,14 +53793,14 @@ func Xsqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c: // Return true if the Mem object contains a TEXT or BLOB that is // too large - whose size exceeds SQLITE_MAX_LENGTH. -func Xsqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76772:20: */ +func Xsqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:77393:20: */ if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & (MEM_Str | MEM_Blob)) != 0 { var n int32 = (*Mem)(unsafe.Pointer(p)).Fn if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Zero) != 0 { n = n + (*(*int32)(unsafe.Pointer(p /* &.u */))) } - return (libc.Bool32(n > *(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(p)).Fdb + 124 /* &.aLimit */))))) + return (libc.Bool32(n > *(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(p)).Fdb + 128 /* &.aLimit */))))) } return 0 } @@ -53590,13 +53809,13 @@ func Xsqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76772: // 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 *libc.TLS, pTo uintptr, pFrom uintptr, eType int32) { /* sqlite3.c:76828:29: */ +func vdbeClrCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, eType int32) { /* sqlite3.c:77449:29: */ vdbeMemClearExternAndSetNull(tls, pTo) Xsqlite3VdbeMemShallowCopy(tls, pTo, pFrom, eType) } -func Xsqlite3VdbeMemShallowCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, srcType int32) { /* sqlite3.c:76833:21: */ +func Xsqlite3VdbeMemShallowCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, srcType int32) { /* sqlite3.c:77454:21: */ if (int32((*Mem)(unsafe.Pointer((pTo))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { vdbeClrCopy(tls, pTo, pFrom, srcType) @@ -53612,7 +53831,7 @@ func Xsqlite3VdbeMemShallowCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, srcTy // Make a full copy of pFrom into pTo. Prior contents of pTo are // freed before the copy is made. -func Xsqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:76849:20: */ +func Xsqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:77470:20: */ var rc int32 = SQLITE_OK if (int32((*Mem)(unsafe.Pointer((pTo))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { @@ -53634,11 +53853,11 @@ func Xsqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* s // freed. If pFrom contains ephemeral data, a copy is made. // // pFrom contains an SQL NULL when this routine returns. -func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:76872:21: */ +func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:77493:21: */ Xsqlite3VdbeMemRelease(tls, pTo) libc.Xmemcpy(tls, pTo, pFrom, uint64(unsafe.Sizeof(Mem{}))) - (*Mem)(unsafe.Pointer(pFrom)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pFrom)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer(pFrom)).FszMalloc = 0 } @@ -53655,7 +53874,7 @@ func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3 // 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 Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n int32, enc U8, xDel uintptr) int32 { /* sqlite3.c:76898:20: */ +func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n int32, enc U8, xDel uintptr) int32 { /* sqlite3.c:77519:20: */ var nByte int32 = n // New value for pMem->n var iLimit int32 // Maximum allowed string or blob size var flags U16 = U16(0) // New value for pMem->flags @@ -53667,15 +53886,15 @@ func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n int32, enc } if (*Mem)(unsafe.Pointer(pMem)).Fdb != 0 { - iLimit = *(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(pMem)).Fdb + 124 /* &.aLimit */))) + iLimit = *(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(pMem)).Fdb + 128 /* &.aLimit */))) } else { iLimit = SQLITE_MAX_LENGTH } flags = func() uint16 { if int32(enc) == 0 { - return MEM_Blob + return uint16(MEM_Blob) } - return MEM_Str + return uint16(MEM_Str) }() if nByte < 0 { @@ -53764,17 +53983,17 @@ func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n int32, enc // // 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 Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pMem uintptr) int32 { /* sqlite3.c:77006:20: */ +func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pMem uintptr) int32 { /* sqlite3.c:77627:20: */ var rc int32 - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null) if Xsqlite3BtreeMaxRecordSize(tls, pCur) < (Sqlite3_int64(offset + amt)) { - return Xsqlite3CorruptError(tls, 77015) + return Xsqlite3CorruptError(tls, 77636) } if SQLITE_OK == (libc.AssignInt32(&rc, Xsqlite3VdbeMemClearAndResize(tls, pMem, (int32(amt+U32(1)))))) { rc = Xsqlite3BtreePayload(tls, pCur, offset, amt, (*Mem)(unsafe.Pointer(pMem)).Fz) if rc == SQLITE_OK { *(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(amt))) = int8(0) // Overrun area used when reading malformed records - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Blob + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Blob) (*Mem)(unsafe.Pointer(pMem)).Fn = int32(amt) } else { Xsqlite3VdbeMemRelease(tls, pMem) @@ -53783,7 +54002,7 @@ func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, return rc } -func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt U32, pMem uintptr) int32 { /* sqlite3.c:77029:20: */ +func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt U32, pMem uintptr) int32 { /* sqlite3.c:77650:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -53808,7 +54027,7 @@ func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt U32, pM // 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 *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:77061:35: */ +func valueToText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:77682:35: */ if (int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & (MEM_Blob | MEM_Str)) != 0 { if func() int32 { @@ -53853,7 +54072,7 @@ func valueToText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:770 // (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 Xsqlite3ValueText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:77104:27: */ +func Xsqlite3ValueText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:77725:27: */ if !(pVal != 0) { return uintptr(0) } @@ -53869,10 +54088,10 @@ func Xsqlite3ValueText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3 } // Create a new sqlite3_value object. -func Xsqlite3ValueNew(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:77122:30: */ +func Xsqlite3ValueNew(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:77743:30: */ var p uintptr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Mem{}))) if p != 0 { - (*Mem)(unsafe.Pointer(p)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer(p)).Fdb = db } return p @@ -53886,7 +54105,7 @@ type ValueNewStat4Ctx = struct { FppRec uintptr FiVal int32 _ [4]byte -} /* sqlite3.c:77135:1 */ +} /* sqlite3.c:77756:1 */ // Allocate and return a pointer to a new sqlite3_value object. If // the second argument to this function is NULL, the object is allocated @@ -53897,7 +54116,7 @@ type ValueNewStat4Ctx = struct { // 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 *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:77153:22: */ +func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:77774:22: */ if p != 0 { var pRec uintptr = *(*uintptr)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FppRec)) @@ -53915,7 +54134,7 @@ func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:77153 (*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem = (pRec + uintptr((((uint64(unsafe.Sizeof(UnpackedRecord{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7))))) for i = 0; i < nCol; i++ { - (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fdb = db } } else { @@ -53953,7 +54172,7 @@ func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:77153 // If the conditions above are not met, this function returns SQLITE_OK // and sets (*ppVal) to NULL. Or, if an error occurs, (*ppVal) is set to // NULL and an SQLite error code returned. -func valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc U8, aff U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:77215:12: */ +func valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc U8, aff U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:77836:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -53983,7 +54202,7 @@ __1: pFunc = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), nVal, enc, uint8(0)) if !((((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & (U32(SQLITE_FUNC_CONSTANT | SQLITE_FUNC_SLOCHNG))) == U32(0)) || - (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0)) { + (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0)) { goto __2 } return SQLITE_OK @@ -54040,10 +54259,10 @@ __9: goto __10 } rc = (*Sqlite3_context)(unsafe.Pointer(bp + 8 /* &ctx */)).FisError - Xsqlite3ErrorMsg(tls, (*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, ts+2690 /* "%s" */, libc.VaList(bp, Xsqlite3_value_text(tls, pVal))) + Xsqlite3ErrorMsg(tls, (*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, ts+2718 /* "%s" */, libc.VaList(bp, Xsqlite3_value_text(tls, pVal))) goto __11 __10: - Xsqlite3ValueApplyAffinity(tls, pVal, aff, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = Xsqlite3VdbeChangeEncoding(tls, pVal, int32(enc)) if !((rc == SQLITE_OK) && (Xsqlite3VdbeMemTooBig(tls, pVal) != 0)) { @@ -54096,7 +54315,7 @@ __14: // 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 *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:77309:12: */ +func valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:77930:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -54144,8 +54363,8 @@ __3: if !(*(*uintptr)(unsafe.Pointer(ppVal)) != 0) { goto __5 } - Xsqlite3VdbeMemCast(tls, *(*uintptr)(unsafe.Pointer(ppVal)), aff, SQLITE_UTF8) - Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(ppVal)), affinity, SQLITE_UTF8) + Xsqlite3VdbeMemCast(tls, *(*uintptr)(unsafe.Pointer(ppVal)), aff, uint8(SQLITE_UTF8)) + Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(ppVal)), affinity, uint8(SQLITE_UTF8)) __5: ; return rc @@ -54161,7 +54380,7 @@ __4: pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop) negInt = -1 - zNeg = ts + 3882 /* "-" */ + zNeg = ts + 3910 /* "-" */ __6: ; @@ -54175,29 +54394,29 @@ __6: goto no_mem __9: ; - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_IntValue)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_IntValue))) != U32(0)) { goto __10 } Xsqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), (I64(*(*int32)(unsafe.Pointer(pExpr + 8 /* &.u */))) * I64(negInt))) goto __11 __10: - zVal = Xsqlite3MPrintf(tls, db, ts+3884 /* "%s%s" */, libc.VaList(bp, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)))) + zVal = Xsqlite3MPrintf(tls, db, ts+3912 /* "%s%s" */, libc.VaList(bp, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)))) if !(zVal == uintptr(0)) { goto __12 } goto no_mem __12: ; - Xsqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), -1, zVal, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) + Xsqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), -1, zVal, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) __11: ; if !(((op == TK_INTEGER) || (op == TK_FLOAT)) && (int32(affinity) == SQLITE_AFF_BLOB)) { goto __13 } - Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), SQLITE_AFF_NUMERIC, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), uint8(SQLITE_AFF_NUMERIC), uint8(SQLITE_UTF8)) goto __14 __13: - Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), affinity, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), affinity, uint8(SQLITE_UTF8)) __14: ; @@ -54292,7 +54511,7 @@ __30: if !(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) != 0) { goto __33 } - (*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags = MEM_Int + (*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */)) = (I64(libc.Bool32(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + 4))) == 0))) __33: ; @@ -54338,7 +54557,7 @@ __35: // 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 Xsqlite3ValueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:77464:20: */ +func Xsqlite3ValueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:78085:20: */ if pExpr != 0 { return valueFromExpr(tls, db, pExpr, enc, affinity, ppVal, uintptr(0)) } @@ -54361,7 +54580,7 @@ func Xsqlite3ValueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, aff // // On success, *ppVal is made to point to the extracted value. The caller // is responsible for ensuring that the value is eventually freed. -func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, pAlloc uintptr, ppVal uintptr) int32 { /* sqlite3.c:77493:12: */ +func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, pAlloc uintptr, ppVal uintptr) int32 { /* sqlite3.c:78114:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -54377,7 +54596,7 @@ func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U if *(*uintptr)(unsafe.Pointer(bp /* pVal */)) != 0 { Xsqlite3VdbeMemSetNull(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) } - } else if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_EnableQPSG) == uint64(0)) { + } else if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableQPSG)) == uint64(0)) { var v uintptr var iBindVar int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iBindVar) @@ -54429,7 +54648,7 @@ func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U // Unless an error is encountered, SQLITE_OK is returned. It is not an // error if a value cannot be extracted from pExpr. If an error does // occur, an SQLite error code is returned. -func Xsqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppRec uintptr, pExpr uintptr, nElem int32, iVal int32, pnExtract uintptr) int32 { /* sqlite3.c:77568:20: */ +func Xsqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppRec uintptr, pExpr uintptr, nElem int32, iVal int32, pnExtract uintptr) int32 { /* sqlite3.c:78189:20: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -54474,7 +54693,7 @@ func Xsqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppR // (e.g. OOM), return SQLITE_OK and set *ppVal to NULL. Or, if an error // does occur, return an SQLite error code. The final value of *ppVal // is undefined in this case. -func Xsqlite3Stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:77613:20: */ +func Xsqlite3Stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:78234:20: */ return stat4ValueFromExpr(tls, pParse, pExpr, affinity, uintptr(0), ppVal) } @@ -54484,7 +54703,7 @@ func Xsqlite3Stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, af // // If *ppVal is initially NULL then the caller is responsible for // ensuring that the value written into *ppVal is eventually freed. -func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iCol int32, ppVal uintptr) int32 { /* sqlite3.c:77630:20: */ +func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iCol int32, ppVal uintptr) int32 { /* sqlite3.c:78251:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -54508,7 +54727,7 @@ func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC return Xsqlite3GetVarint32(tls, a, bp /* &nHdr */) }()) if (*(*int32)(unsafe.Pointer(bp /* nHdr */)) > nRec) || (iHdr >= *(*int32)(unsafe.Pointer(bp /* nHdr */))) { - return Xsqlite3CorruptError(tls, 77648) + return Xsqlite3CorruptError(tls, 78269) } iField = *(*int32)(unsafe.Pointer(bp /* nHdr */)) for i = 0; i <= iCol; i++ { @@ -54523,14 +54742,14 @@ func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC }())) if iHdr > *(*int32)(unsafe.Pointer(bp /* nHdr */)) { - return Xsqlite3CorruptError(tls, 77654) + return Xsqlite3CorruptError(tls, 78275) } szField = int32(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 4 /* t */)))) iField = iField + (szField) } if iField > nRec { - return Xsqlite3CorruptError(tls, 77660) + return Xsqlite3CorruptError(tls, 78281) } if pMem == uintptr(0) { pMem = libc.AssignPtrUintptr(ppVal, Xsqlite3ValueNew(tls, db)) @@ -54546,7 +54765,7 @@ func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC // Unless it is NULL, the argument must be an UnpackedRecord object returned // by an earlier call to sqlite3Stat4ProbeSetValue(). This call deletes // the object. -func Xsqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { /* sqlite3.c:77675:21: */ +func Xsqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { /* sqlite3.c:78296:21: */ if pRec != 0 { var i int32 var nCol int32 = int32((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo)).FnAllField) @@ -54561,14 +54780,14 @@ func Xsqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { /* sqlite3.c:77675:21 } // Change the string value of an sqlite3_value object -func Xsqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc U8, xDel uintptr) { /* sqlite3.c:77693:21: */ +func Xsqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc U8, xDel uintptr) { /* sqlite3.c:78314:21: */ if v != 0 { Xsqlite3VdbeMemSetStr(tls, v, z, n, enc, xDel) } } // Free an sqlite3_value object -func Xsqlite3ValueFree(tls *libc.TLS, v uintptr) { /* sqlite3.c:77706:21: */ +func Xsqlite3ValueFree(tls *libc.TLS, v uintptr) { /* sqlite3.c:78327:21: */ if !(v != 0) { return } @@ -54579,14 +54798,14 @@ func Xsqlite3ValueFree(tls *libc.TLS, v uintptr) { /* sqlite3.c:77706:21: */ // 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 *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:77717:28: */ +func valueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:78338:28: */ if valueToText(tls, pVal, enc) != uintptr(0) { return (*Sqlite3_value)(unsafe.Pointer(pVal)).Fn } return 0 } -func Xsqlite3ValueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:77720:20: */ +func Xsqlite3ValueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:78341:20: */ var p uintptr = pVal if ((int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Str) != 0) && (int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc)) { @@ -54606,7 +54825,7 @@ func Xsqlite3ValueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3. } // Create a new virtual database engine. -func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:77763:21: */ +func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:78384:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var p uintptr p = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(Vdbe{}))) @@ -54621,7 +54840,7 @@ func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:77 (*Vdbe)(unsafe.Pointer(p)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).FpVdbe (*Vdbe)(unsafe.Pointer(p)).FpPrev = uintptr(0) (*Sqlite3)(unsafe.Pointer(db)).FpVdbe = p - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_INIT + (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic = U32(VDBE_MAGIC_INIT) (*Vdbe)(unsafe.Pointer(p)).FpParse = pParse (*Parse)(unsafe.Pointer(pParse)).FpVdbe = p @@ -54630,12 +54849,12 @@ func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:77 } // Return the Parse object that owns a Vdbe object. -func Xsqlite3VdbeParser(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:77790:22: */ +func Xsqlite3VdbeParser(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:78411:22: */ return (*Vdbe)(unsafe.Pointer(p)).FpParse } // Change the error string stored in Vdbe.zErrMsg -func Xsqlite3VdbeError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:77797:21: */ +func Xsqlite3VdbeError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:78418:21: */ var ap Va_list _ = ap Xsqlite3DbFree(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg) @@ -54645,7 +54864,7 @@ func Xsqlite3VdbeError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { } // Remember the SQL string for a prepared statement. -func Xsqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags U8) { /* sqlite3.c:77808:21: */ +func Xsqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags U8) { /* sqlite3.c:78429:21: */ if p == uintptr(0) { return } @@ -54658,7 +54877,7 @@ func Xsqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags } // Swap all content between two VDBE structures. -func Xsqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:77858:21: */ +func Xsqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:78479:21: */ var tmp Vdbe var pTmp uintptr var zTmp uintptr @@ -54689,7 +54908,7 @@ func Xsqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:7785 // SQLITE_NOMEM. In this case Vdbe.aOp and Vdbe.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 *libc.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:77895:12: */ +func growOpArray(tls *libc.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:78516:12: */ var pNew uintptr var p uintptr = (*Vdbe)(unsafe.Pointer(v)).FpParse @@ -54709,7 +54928,7 @@ func growOpArray(tls *libc.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:77895 _ = nOp // Ensure that the size of a VDBE does not grow too large - if nNew > Sqlite3_int64(*(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(p)).Fdb + 124 /* &.aLimit */) + 5*4))) { + if nNew > Sqlite3_int64(*(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(p)).Fdb + 128 /* &.aLimit */) + 5*4))) { Xsqlite3OomFault(tls, (*Parse)(unsafe.Pointer(p)).Fdb) return SQLITE_NOMEM } @@ -54742,7 +54961,7 @@ func growOpArray(tls *libc.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:77895 // Use the sqlite3VdbeResolveLabel() function to fix an address and // the sqlite3VdbeChangeP4() function to change the value of the P4 // operand. -func growOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:77966:28: */ +func growOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:78587:28: */ if growOpArray(tls, p, 1) != 0 { return 1 @@ -54751,7 +54970,7 @@ func growOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) i return Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3) } -func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:77972:20: */ +func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:78593:20: */ var i int32 var pOp uintptr @@ -54768,30 +54987,30 @@ func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = p2 (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = p3 *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0) - (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = P4_NOTUSED + (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(P4_NOTUSED) return i } -func Xsqlite3VdbeAddOp0(tls *libc.TLS, p uintptr, op int32) int32 { /* sqlite3.c:78009:20: */ +func Xsqlite3VdbeAddOp0(tls *libc.TLS, p uintptr, op int32) int32 { /* sqlite3.c:78630:20: */ return Xsqlite3VdbeAddOp3(tls, p, op, 0, 0, 0) } -func Xsqlite3VdbeAddOp1(tls *libc.TLS, p uintptr, op int32, p1 int32) int32 { /* sqlite3.c:78012:20: */ +func Xsqlite3VdbeAddOp1(tls *libc.TLS, p uintptr, op int32, p1 int32) int32 { /* sqlite3.c:78633:20: */ return Xsqlite3VdbeAddOp3(tls, p, op, p1, 0, 0) } -func Xsqlite3VdbeAddOp2(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32) int32 { /* sqlite3.c:78015:20: */ +func Xsqlite3VdbeAddOp2(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32) int32 { /* sqlite3.c:78636:20: */ return Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, 0) } // Generate code for an unconditional jump to instruction iDest -func Xsqlite3VdbeGoto(tls *libc.TLS, p uintptr, iDest int32) int32 { /* sqlite3.c:78021:20: */ +func Xsqlite3VdbeGoto(tls *libc.TLS, p uintptr, iDest int32) int32 { /* sqlite3.c:78642:20: */ return Xsqlite3VdbeAddOp3(tls, p, OP_Goto, 0, iDest, 0) } // Generate code to cause the string zStr to be loaded into // register iDest -func Xsqlite3VdbeLoadString(tls *libc.TLS, p uintptr, iDest int32, zStr uintptr) int32 { /* sqlite3.c:78028:20: */ +func Xsqlite3VdbeLoadString(tls *libc.TLS, p uintptr, iDest int32, zStr uintptr) int32 { /* sqlite3.c:78649:20: */ return Xsqlite3VdbeAddOp4(tls, p, OP_String8, 0, iDest, 0, zStr, 0) } @@ -54804,7 +55023,7 @@ func Xsqlite3VdbeLoadString(tls *libc.TLS, p uintptr, iDest int32, zStr uintptr) // // If the input string does not end with "X" then an OP_ResultRow instruction // is generated for the values inserted. -func Xsqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr, va uintptr) { /* sqlite3.c:78043:21: */ +func Xsqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr, va uintptr) { /* sqlite3.c:78664:21: */ var ap Va_list _ = ap var i int32 @@ -54852,7 +55071,7 @@ skip_op_resultrow: } // Add an opcode that includes the p4 value as a pointer. -func Xsqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:78066:20: */ +func Xsqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:78687:20: */ var addr int32 = Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3) Xsqlite3VdbeChangeP4(tls, p, addr, zP4, p4type) return addr @@ -54866,7 +55085,7 @@ func Xsqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // NC_IdxExpr means called as part of an index expression. NC_PartIdx // means in the WHERE clause of a partial index. NC_GenCol means called // while computing a generated column value. 0 is the usual case. -func Xsqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) int32 { /* sqlite3.c:78090:20: */ +func Xsqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) int32 { /* sqlite3.c:78711:20: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var nByte int32 var addr int32 @@ -54898,7 +55117,7 @@ func Xsqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int // Add an opcode that includes the p4 value with a P4_INT64 or // P4_REAL type. -func Xsqlite3VdbeAddOp4Dup8(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:78127:20: */ +func Xsqlite3VdbeAddOp4Dup8(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:78748:20: */ var p4copy uintptr = Xsqlite3DbMallocRawNN(tls, Xsqlite3VdbeDb(tls, p), uint64(8)) if p4copy != 0 { libc.Xmemcpy(tls, p4copy, zP4, uint64(8)) @@ -54908,7 +55127,7 @@ func Xsqlite3VdbeAddOp4Dup8(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int // Return the address of the current EXPLAIN QUERY PLAN baseline. // 0 means "none". -func Xsqlite3VdbeExplainParent(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:78146:20: */ +func Xsqlite3VdbeExplainParent(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:78767:20: */ var pOp uintptr if (*Parse)(unsafe.Pointer(pParse)).FaddrExplain == 0 { return 0 @@ -54924,7 +55143,7 @@ func Xsqlite3VdbeExplainParent(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3 // // If the bPush flag is true, then make this opcode the parent for // subsequent Explains until sqlite3VdbeExplainPop() is called. -func Xsqlite3VdbeExplain(tls *libc.TLS, pParse uintptr, bPush U8, zFmt uintptr, va uintptr) { /* sqlite3.c:78170:21: */ +func Xsqlite3VdbeExplain(tls *libc.TLS, pParse uintptr, bPush U8, zFmt uintptr, va uintptr) { /* sqlite3.c:78791:21: */ // Always include the OP_Explain opcodes if SQLITE_DEBUG is defined. // But omit them (for performance) during production builds if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 { @@ -54948,7 +55167,7 @@ func Xsqlite3VdbeExplain(tls *libc.TLS, pParse uintptr, bPush U8, zFmt uintptr, } // Pop the EXPLAIN QUERY PLAN stack one level. -func Xsqlite3VdbeExplainPop(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:78198:21: */ +func Xsqlite3VdbeExplainPop(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:78819:21: */ (*Parse)(unsafe.Pointer(pParse)).FaddrExplain = Xsqlite3VdbeExplainParent(tls, pParse) } @@ -54959,16 +55178,18 @@ func Xsqlite3VdbeExplainPop(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:78198: // // The zWhere string must have been obtained from sqlite3_malloc(). // This routine will take ownership of the allocated memory. -func Xsqlite3VdbeAddParseSchemaOp(tls *libc.TLS, p uintptr, iDb int32, zWhere uintptr) { /* sqlite3.c:78212:21: */ +func Xsqlite3VdbeAddParseSchemaOp(tls *libc.TLS, p uintptr, iDb int32, zWhere uintptr, p5 U16) { /* sqlite3.c:78833:21: */ var j int32 Xsqlite3VdbeAddOp4(tls, p, OP_ParseSchema, iDb, 0, 0, zWhere, -7) + Xsqlite3VdbeChangeP5(tls, p, p5) for j = 0; j < (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FnDb; j++ { Xsqlite3VdbeUsesBtree(tls, p, j) } + Xsqlite3MayAbort(tls, (*Vdbe)(unsafe.Pointer(p)).FpParse) } // Add an opcode that includes the p4 value as an integer. -func Xsqlite3VdbeAddOp4Int(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, p4 int32) int32 { /* sqlite3.c:78221:20: */ +func Xsqlite3VdbeAddOp4Int(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, p4 int32) int32 { /* sqlite3.c:78844:20: */ var addr int32 = Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3) if int32((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed) == 0 { var pOp uintptr = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*24) @@ -54979,7 +55200,7 @@ func Xsqlite3VdbeAddOp4Int(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int3 } // Insert the end of a co-routine -func Xsqlite3VdbeEndCoroutine(tls *libc.TLS, v uintptr, regYield int32) { /* sqlite3.c:78240:21: */ +func Xsqlite3VdbeEndCoroutine(tls *libc.TLS, v uintptr, regYield int32) { /* sqlite3.c:78863:21: */ Xsqlite3VdbeAddOp1(tls, v, OP_EndCoroutine, regYield) // Clear the temporary register cache, thereby ensuring that each @@ -55014,14 +55235,14 @@ func Xsqlite3VdbeEndCoroutine(tls *libc.TLS, v uintptr, regYield int32) { /* sql // been issued. The negative is stored because // that gives a performance improvement over storing // the equivalent positive value. -func Xsqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:78278:20: */ +func Xsqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:78901:20: */ return libc.PreDecInt32(&(*Parse)(unsafe.Pointer(pParse)).FnLabel, 1) } // 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 resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { /* sqlite3.c:78287:29: */ +func resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { /* sqlite3.c:78910:29: */ var nNewSize int32 = (10 - (*Parse)(unsafe.Pointer(p)).FnLabel) (*Parse)(unsafe.Pointer(p)).FaLabel = Xsqlite3DbReallocOrFree(tls, (*Parse)(unsafe.Pointer(p)).Fdb, (*Parse)(unsafe.Pointer(p)).FaLabel, (uint64(uint64(nNewSize) * uint64(unsafe.Sizeof(int32(0)))))) @@ -55033,7 +55254,7 @@ func resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { /* sqlit } } -func Xsqlite3VdbeResolveLabel(tls *libc.TLS, v uintptr, x int32) { /* sqlite3.c:78302:21: */ +func Xsqlite3VdbeResolveLabel(tls *libc.TLS, v uintptr, x int32) { /* sqlite3.c:78925:21: */ var p uintptr = (*Vdbe)(unsafe.Pointer(v)).FpParse var j int32 = ^x @@ -55046,12 +55267,12 @@ func Xsqlite3VdbeResolveLabel(tls *libc.TLS, v uintptr, x int32) { /* sqlite3.c: } // Mark the VDBE as one that can only be run one time. -func Xsqlite3VdbeRunOnlyOnce(tls *libc.TLS, p uintptr) { /* sqlite3.c:78324:21: */ +func Xsqlite3VdbeRunOnlyOnce(tls *libc.TLS, p uintptr) { /* sqlite3.c:78947:21: */ libc.SetBitFieldPtr16Uint32(p+200 /* &.runOnlyOnce */, Bft(1), 5, 0x20) } // Mark the VDBE as one that can only be run multiple times. -func Xsqlite3VdbeReusable(tls *libc.TLS, p uintptr) { /* sqlite3.c:78331:21: */ +func Xsqlite3VdbeReusable(tls *libc.TLS, p uintptr) { /* sqlite3.c:78954:21: */ libc.SetBitFieldPtr16Uint32(p+200 /* &.runOnlyOnce */, Bft(0), 5, 0x20) } @@ -55074,7 +55295,7 @@ func Xsqlite3VdbeReusable(tls *libc.TLS, p uintptr) { /* sqlite3.c:78331:21: */ // 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 *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3.c:78527:13: */ +func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3.c:79150:13: */ var nMaxArgs int32 = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) var pOp uintptr var pParse uintptr = (*Vdbe)(unsafe.Pointer(p)).FpParse @@ -55203,7 +55424,7 @@ func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite } // Return the address of the next instruction to be inserted. -func Xsqlite3VdbeCurrentAddr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:78629:20: */ +func Xsqlite3VdbeCurrentAddr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79252:20: */ return (*Vdbe)(unsafe.Pointer(p)).FnOp } @@ -55234,7 +55455,7 @@ func Xsqlite3VdbeCurrentAddr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:7862 // 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 Xsqlite3VdbeTakeOpArray(tls *libc.TLS, p uintptr, pnOp uintptr, pnMaxArg uintptr) uintptr { /* sqlite3.c:78686:23: */ +func Xsqlite3VdbeTakeOpArray(tls *libc.TLS, p uintptr, pnOp uintptr, pnMaxArg uintptr) uintptr { /* sqlite3.c:79309:23: */ var aOp uintptr = (*Vdbe)(unsafe.Pointer(p)).FaOp // Check that sqlite3VdbeUsesBtree() was not called on this VM @@ -55250,7 +55471,7 @@ func Xsqlite3VdbeTakeOpArray(tls *libc.TLS, p uintptr, pnOp uintptr, pnMaxArg ui // // Non-zero P2 arguments to jump instructions are automatically adjusted // so that the jump target is relative to the first operation inserted. -func Xsqlite3VdbeAddOpList(tls *libc.TLS, p uintptr, nOp int32, aOp uintptr, iLineno int32) uintptr { /* sqlite3.c:78706:23: */ +func Xsqlite3VdbeAddOpList(tls *libc.TLS, p uintptr, nOp int32, aOp uintptr, iLineno int32) uintptr { /* sqlite3.c:79329:23: */ var i int32 var pOut uintptr var pFirst uintptr @@ -55273,7 +55494,7 @@ __1: *(*int32)(unsafe.Pointer(pOut + 8 /* &.p2 */)) += ((*Vdbe)(unsafe.Pointer(p)).FnOp) } (*VdbeOp)(unsafe.Pointer(pOut)).Fp3 = int32((*VdbeOpList)(unsafe.Pointer(aOp)).Fp3) - (*VdbeOp)(unsafe.Pointer(pOut)).Fp4type = P4_NOTUSED + (*VdbeOp)(unsafe.Pointer(pOut)).Fp4type = int8(P4_NOTUSED) *(*uintptr)(unsafe.Pointer(pOut + 16 /* &.p4 */)) = uintptr(0) (*VdbeOp)(unsafe.Pointer(pOut)).Fp5 = U16(0) _ = iLineno @@ -55294,23 +55515,23 @@ __3: // Change the value of the opcode, or P1, P2, P3, or P5 operands // for a specific instruction. -func Xsqlite3VdbeChangeOpcode(tls *libc.TLS, p uintptr, addr int32, iNewOpcode U8) { /* sqlite3.c:78782:21: */ +func Xsqlite3VdbeChangeOpcode(tls *libc.TLS, p uintptr, addr int32, iNewOpcode U8) { /* sqlite3.c:79405:21: */ (*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fopcode = iNewOpcode } -func Xsqlite3VdbeChangeP1(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:78785:21: */ +func Xsqlite3VdbeChangeP1(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:79408:21: */ (*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp1 = val } -func Xsqlite3VdbeChangeP2(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:78788:21: */ +func Xsqlite3VdbeChangeP2(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:79411:21: */ (*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp2 = val } -func Xsqlite3VdbeChangeP3(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:78791:21: */ +func Xsqlite3VdbeChangeP3(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:79414:21: */ (*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp3 = val } -func Xsqlite3VdbeChangeP5(tls *libc.TLS, p uintptr, p5 U16) { /* sqlite3.c:78794:21: */ +func Xsqlite3VdbeChangeP5(tls *libc.TLS, p uintptr, p5 U16) { /* sqlite3.c:79417:21: */ if (*Vdbe)(unsafe.Pointer(p)).FnOp > 0 { (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*24)).Fp5 = p5 @@ -55319,7 +55540,7 @@ func Xsqlite3VdbeChangeP5(tls *libc.TLS, p uintptr, p5 U16) { /* sqlite3.c:78794 // Change the P2 operand of instruction addr so that it points to // the address of the next instruction to be coded. -func Xsqlite3VdbeJumpHere(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:78803:21: */ +func Xsqlite3VdbeJumpHere(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:79426:21: */ Xsqlite3VdbeChangeP2(tls, p, addr, (*Vdbe)(unsafe.Pointer(p)).FnOp) } @@ -55334,7 +55555,7 @@ func Xsqlite3VdbeJumpHere(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:7 // // 7 Once 0 8 0 // 8 ... -func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:78820:21: */ +func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:79443:21: */ if addr == ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1) { (*Vdbe)(unsafe.Pointer(p)).FnOp-- @@ -55345,26 +55566,26 @@ func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { /* sq // If the input FuncDef structure is ephemeral, then free it. If // the FuncDef is not ephermal, then do nothing. -func freeEphemeralFunction(tls *libc.TLS, db uintptr, pDef uintptr) { /* sqlite3.c:78840:13: */ - if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_EPHEM) != U32(0) { +func freeEphemeralFunction(tls *libc.TLS, db uintptr, pDef uintptr) { /* sqlite3.c:79463:13: */ + if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_EPHEM)) != U32(0) { Xsqlite3DbFreeNN(tls, db, pDef) } } // Delete a P4 value if necessary. -func freeP4Mem(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:78849:29: */ +func freeP4Mem(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:79472:29: */ if (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 { Xsqlite3DbFree(tls, db, (*Mem)(unsafe.Pointer(p)).FzMalloc) } Xsqlite3DbFreeNN(tls, db, p) } -func freeP4FuncCtx(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:78853:29: */ +func freeP4FuncCtx(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:79476:29: */ freeEphemeralFunction(tls, db, (*Sqlite3_context)(unsafe.Pointer(p)).FpFunc) Xsqlite3DbFreeNN(tls, db, p) } -func freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { /* sqlite3.c:78857:13: */ +func freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { /* sqlite3.c:79480:13: */ switch p4type { case -16: @@ -55425,7 +55646,7 @@ func freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { /* sqlite3.c: // 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 *libc.TLS, db uintptr, aOp uintptr, nOp int32) { /* sqlite3.c:78906:13: */ +func vdbeFreeOpArray(tls *libc.TLS, db uintptr, aOp uintptr, nOp int32) { /* sqlite3.c:79529:13: */ if aOp != 0 { var pOp uintptr for pOp = (aOp + uintptr((nOp-1))*24); pOp >= aOp; pOp -= 24 { @@ -55440,18 +55661,18 @@ func vdbeFreeOpArray(tls *libc.TLS, db uintptr, aOp uintptr, nOp int32) { /* sql // 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 Xsqlite3VdbeLinkSubProgram(tls *libc.TLS, pVdbe uintptr, p uintptr) { /* sqlite3.c:78924:21: */ +func Xsqlite3VdbeLinkSubProgram(tls *libc.TLS, pVdbe uintptr, p uintptr) { /* sqlite3.c:79547:21: */ (*SubProgram)(unsafe.Pointer(p)).FpNext = (*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram (*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram = p } // Return true if the given Vdbe has any SubPrograms. -func Xsqlite3VdbeHasSubProgram(tls *libc.TLS, pVdbe uintptr) int32 { /* sqlite3.c:78932:20: */ +func Xsqlite3VdbeHasSubProgram(tls *libc.TLS, pVdbe uintptr) int32 { /* sqlite3.c:79555:20: */ return (libc.Bool32((*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram != uintptr(0))) } // Change the opcode at addr into OP_Noop -func Xsqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) int32 { /* sqlite3.c:78939:20: */ +func Xsqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) int32 { /* sqlite3.c:79562:20: */ var pOp uintptr if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 { return 0 @@ -55459,15 +55680,15 @@ func Xsqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) int32 { /* s pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*24) freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) - (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = P4_NOTUSED + (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(P4_NOTUSED) *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0) - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Noop + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Noop) return 1 } // 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 Xsqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op U8) int32 { /* sqlite3.c:78955:20: */ +func Xsqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op U8) int32 { /* sqlite3.c:79578:20: */ if ((*Vdbe)(unsafe.Pointer(p)).FnOp > 0) && (int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*24)).Fopcode) == int32(op)) { return Xsqlite3VdbeChangeToNoop(tls, p, ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1)) } else { @@ -55491,7 +55712,7 @@ func Xsqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op U8) int32 { /* s // 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 *libc.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int32) { /* sqlite3.c:79015:29: */ +func vdbeChangeP4Full(tls *libc.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int32) { /* sqlite3.c:79638:29: */ if (*Op)(unsafe.Pointer(pOp)).Fp4type != 0 { freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*Op)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) (*Op)(unsafe.Pointer(pOp)).Fp4type = int8(0) @@ -55508,7 +55729,7 @@ func vdbeChangeP4Full(tls *libc.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int3 } } -func Xsqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, zP4 uintptr, n int32) { /* sqlite3.c:79034:21: */ +func Xsqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, zP4 uintptr, n int32) { /* sqlite3.c:79657:21: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = zP4 @@ -55555,7 +55776,7 @@ func Xsqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, zP4 uintptr, n i // 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 Xsqlite3VdbeAppendP4(tls *libc.TLS, p uintptr, pP4 uintptr, n int32) { /* sqlite3.c:79077:21: */ +func Xsqlite3VdbeAppendP4(tls *libc.TLS, p uintptr, pP4 uintptr, n int32) { /* sqlite3.c:79700:21: */ var pOp uintptr if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 { @@ -55571,7 +55792,7 @@ func Xsqlite3VdbeAppendP4(tls *libc.TLS, p uintptr, pP4 uintptr, n int32) { /* s // Set the P4 on the most recently added opcode to the KeyInfo for the // index given. -func Xsqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr) { /* sqlite3.c:79097:21: */ +func Xsqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr) { /* sqlite3.c:79720:21: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var pKeyInfo uintptr @@ -55592,7 +55813,7 @@ func Xsqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr) { /* // 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 Xsqlite3VdbeGetOp(tls *libc.TLS, p uintptr, addr int32) uintptr { /* sqlite3.c:79164:23: */ // Ignore the MSVC warning about no initializer +func Xsqlite3VdbeGetOp(tls *libc.TLS, p uintptr, addr int32) uintptr { /* sqlite3.c:79787:23: */ // Ignore the MSVC warning about no initializer if addr < 0 { addr = ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1) @@ -55606,11 +55827,11 @@ func Xsqlite3VdbeGetOp(tls *libc.TLS, p uintptr, addr int32) uintptr { /* sqlite return uintptr(0) } -var dummy VdbeOp /* sqlite3.c:79167:17: */ +var dummy VdbeOp /* sqlite3.c:79790:17: */ // Compute a string that describes the P4 parameter for an opcode. // Use zTemp for any required temporary buffer space. -func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* sqlite3.c:79371:21: */ +func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* sqlite3.c:79994:21: */ bp := tls.Alloc(176) defer tls.Free(176) @@ -55624,7 +55845,7 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* var j int32 var pKeyInfo uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3889 /* "k(%d" */, libc.VaList(bp, int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3917 /* "k(%d" */, libc.VaList(bp, int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) for j = 0; j < int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField); j++ { var pColl uintptr = *(*uintptr)(unsafe.Pointer((pKeyInfo + 32 /* &.aColl */) + uintptr(j)*8)) var zColl uintptr @@ -55634,24 +55855,24 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* zColl = ts + 703 /* "" */ } if libc.Xstrcmp(tls, zColl, ts+266 /* "BINARY" */) == 0 { - zColl = ts + 3894 /* "B" */ + zColl = ts + 3922 /* "B" */ } - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3896, /* ",%s%s%s" */ + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3924, /* ",%s%s%s" */ libc.VaList(bp+8, func() uintptr { if (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j)))) & KEYINFO_ORDER_DESC) != 0 { - return ts + 3882 /* "-" */ + return ts + 3910 /* "-" */ } return ts + 703 /* "" */ }(), func() uintptr { if (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j)))) & KEYINFO_ORDER_BIGNULL) != 0 { - return ts + 3904 /* "N." */ + return ts + 3932 /* "N." */ } return ts + 703 /* "" */ }(), zColl)) } - Xsqlite3_str_append(tls, bp+144 /* &x */, ts+3907 /* ")" */, 1) + Xsqlite3_str_append(tls, bp+144 /* &x */, ts+3935 /* ")" */, 1) break } @@ -55659,7 +55880,7 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* { var pColl uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3909 /* "%.18s-%s" */, libc.VaList(bp+32, (*CollSeq)(unsafe.Pointer(pColl)).FzName, + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3937 /* "%.18s-%s" */, libc.VaList(bp+32, (*CollSeq)(unsafe.Pointer(pColl)).FzName, encnames[(*CollSeq)(unsafe.Pointer(pColl)).Fenc])) break @@ -55667,26 +55888,26 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* case -8: { var pDef uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3918 /* "%s(%d)" */, libc.VaList(bp+48, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3946 /* "%s(%d)" */, libc.VaList(bp+48, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg))) break } case -16: { var pDef uintptr = (*Sqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpFunc - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3918 /* "%s(%d)" */, libc.VaList(bp+64, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3946 /* "%s(%d)" */, libc.VaList(bp+64, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg))) break } case -14: { - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3925 /* "%lld" */, libc.VaList(bp+80, *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))))) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3953 /* "%lld" */, libc.VaList(bp+80, *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))))) break } case -3: { - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3930 /* "%d" */, libc.VaList(bp+88, *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3958 /* "%d" */, libc.VaList(bp+88, *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) break } @@ -55702,14 +55923,14 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Str) != 0 { zP4 = (*Mem)(unsafe.Pointer(pMem)).Fz } else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Int | MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3925 /* "%lld" */, libc.VaList(bp+104, *(*I64)(unsafe.Pointer(pMem /* &.u */)))) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3953 /* "%lld" */, libc.VaList(bp+104, *(*I64)(unsafe.Pointer(pMem /* &.u */)))) } else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Real) != 0 { Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+486 /* "%.16g" */, libc.VaList(bp+112, *(*float64)(unsafe.Pointer(pMem /* &.u */)))) } else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Null) != 0 { zP4 = ts + 704 /* "NULL" */ } else { - zP4 = ts + 3933 /* "(blob)" */ + zP4 = ts + 3961 /* "(blob)" */ } break @@ -55717,7 +55938,7 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* case -12: { var pVtab uintptr = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3940 /* "vtab:%p" */, libc.VaList(bp+120, pVtab)) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3968 /* "vtab:%p" */, libc.VaList(bp+120, pVtab)) break } @@ -55728,20 +55949,20 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* var n U32 = *(*U32)(unsafe.Pointer(ai)) // The first element of an INTARRAY is always the // count of the number of elements to follow for i = U32(1); i <= n; i++ { - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3948 /* "%c%u" */, libc.VaList(bp+128, func() int32 { + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+3976 /* "%c%u" */, libc.VaList(bp+128, func() int32 { if i == U32(1) { return '[' } return ',' }(), *(*U32)(unsafe.Pointer(ai + uintptr(i)*4)))) } - Xsqlite3_str_append(tls, bp+144 /* &x */, ts+3953 /* "]" */, 1) + Xsqlite3_str_append(tls, bp+144 /* &x */, ts+3981 /* "]" */, 1) break } case -4: { - zP4 = ts + 3955 /* "program" */ + zP4 = ts + 3983 /* "program" */ break } @@ -55773,7 +55994,7 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* return Xsqlite3StrAccumFinish(tls, bp+144 /* &x */) } -var encnames = [4]uintptr{ts + 3963 /* "?" */, ts + 3965 /* "8" */, ts + 3967 /* "16LE" */, ts + 3972 /* "16BE" */} /* sqlite3.c:79401:25 */ +var encnames = [4]uintptr{ts + 3991 /* "?" */, ts + 3993 /* "8" */, ts + 3995 /* "16LE" */, ts + 4000 /* "16BE" */} /* sqlite3.c:80024:25 */ // Declare to the Vdbe that the BTree object at db->aDb[i] is used. // @@ -55781,7 +56002,7 @@ var encnames = [4]uintptr{ts + 3963 /* "?" */, ts + 3965 /* "8" */, ts + 3967 /* // 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 Xsqlite3VdbeUsesBtree(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:79496:21: */ +func Xsqlite3VdbeUsesBtree(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:80119:21: */ *(*YDbMask)(unsafe.Pointer(p + 204 /* &.btreeMask */)) |= (YDbMask((YDbMask(1))) << (i)) if (i != 1) && (Xsqlite3BtreeSharable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FaDb+uintptr(i)*32)).FpBt) != 0) { @@ -55808,7 +56029,7 @@ func Xsqlite3VdbeUsesBtree(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:794 // 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 Xsqlite3VdbeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:79527:21: */ +func Xsqlite3VdbeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:80150:21: */ var i int32 var db uintptr var aDb uintptr @@ -55827,7 +56048,7 @@ func Xsqlite3VdbeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:79527:21: */ } // Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter(). -func vdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:79548:29: */ +func vdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:80171:29: */ var i int32 var db uintptr var aDb uintptr @@ -55842,7 +56063,7 @@ func vdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:79548:29: */ } } -func Xsqlite3VdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:79562:21: */ +func Xsqlite3VdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:80185:21: */ if ((*Vdbe)(unsafe.Pointer(p)).FlockMask) == YDbMask(0) { return } // The common case @@ -55850,7 +56071,7 @@ func Xsqlite3VdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:79562:21: */ } // Initialize an array of N Mem element. -func initMemArray(tls *libc.TLS, p uintptr, N int32, db uintptr, flags U16) { /* sqlite3.c:79604:13: */ +func initMemArray(tls *libc.TLS, p uintptr, N int32, db uintptr, flags U16) { /* sqlite3.c:80227:13: */ for (libc.PostDecInt32(&N, 1)) > 0 { (*Mem)(unsafe.Pointer(p)).Fdb = db (*Mem)(unsafe.Pointer(p)).Fflags = flags @@ -55860,7 +56081,7 @@ func initMemArray(tls *libc.TLS, p uintptr, N int32, db uintptr, flags U16) { /* } // Release an array of N Mem elements -func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:79619:13: */ +func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:80242:13: */ if (p != 0) && (N != 0) { var pEnd uintptr = (p + uintptr(N)*56) var db uintptr = (*Mem)(unsafe.Pointer(p)).Fdb @@ -55893,7 +56114,7 @@ func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:79619:13: (*Mem)(unsafe.Pointer(p)).FszMalloc = 0 } - (*Mem)(unsafe.Pointer(p)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Undefined) } } } @@ -55903,7 +56124,7 @@ func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:79619:13: // // This routine does not delete the Frame right away. It merely adds the // frame to a list of frames to be deleted when the Vdbe halts. -func Xsqlite3VdbeFrameMemDel(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:79681:21: */ +func Xsqlite3VdbeFrameMemDel(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:80304:21: */ var pFrame uintptr = pArg (*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent = (*Vdbe)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(pFrame)).Fv)).FpDelFrame @@ -55915,7 +56136,7 @@ func Xsqlite3VdbeFrameMemDel(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:79681:2 // // Return SQLITE_ROW on success. Return SQLITE_DONE if there are no // more opcodes to be displayed. -func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, piPc uintptr, piAddr uintptr, paOp uintptr) int32 { /* sqlite3.c:79696:20: */ +func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, piPc uintptr, piAddr uintptr, paOp uintptr) int32 { /* sqlite3.c:80319:20: */ var nRow int32 // Stop when row count reaches this var nSub int32 = 0 // Number of sub-vdbes seen so far var apSub uintptr = uintptr(0) // Array of sub-vdbes @@ -56014,7 +56235,7 @@ func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, // Delete a VdbeFrame object and its contents. VdbeFrame objects are // allocated by the OP_Program opcode in sqlite3VdbeExec(). -func Xsqlite3VdbeFrameDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:79808:21: */ +func Xsqlite3VdbeFrameDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:80431:21: */ var i int32 var aMem uintptr = ((p) + 112) var apCsr uintptr = (aMem + uintptr((*VdbeFrame)(unsafe.Pointer(p)).FnChildMem)*56) @@ -56043,7 +56264,7 @@ func Xsqlite3VdbeFrameDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:79808:21: // // When p->explain==1, first the main program is listed, then each of // the trigger subprograms are listed one by one. -func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: */ +func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80463:20: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -56053,7 +56274,7 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: * // Loop counter var rc int32 = SQLITE_OK // Return code var pMem uintptr = ((*Vdbe)(unsafe.Pointer(p)).FaMem + 1*56) // First Mem of result set - var bListSubprogs int32 = (libc.Bool32(((int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.explain */)) & 0xc >> 2)) == 1) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_TriggerEQP) != uint64(0)))) + var bListSubprogs int32 = (libc.Bool32(((int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.explain */)) & 0xc >> 2)) == 1) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_TriggerEQP)) != uint64(0)))) // var aOp uintptr at bp+8, 8 // Array of opcodes var pOp uintptr // Current opcode @@ -56087,7 +56308,7 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: * if rc == SQLITE_OK { pOp = (*(*uintptr)(unsafe.Pointer(bp + 8 /* aOp */)) + uintptr(*(*int32)(unsafe.Pointer(bp /* i */)))*24) - if libc.AtomicLoadNInt32((db+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0 { + if libc.AtomicLoadNInt32((db+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0 { (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_INTERRUPT rc = SQLITE_ERROR Xsqlite3VdbeError(tls, p, Xsqlite3ErrStr(tls, (*Vdbe)(unsafe.Pointer(p)).Frc), 0) @@ -56097,19 +56318,19 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: * Xsqlite3VdbeMemSetInt64(tls, pMem, int64((*Op)(unsafe.Pointer(pOp)).Fp1)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(1)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp2)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(2)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp3)) - Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(3)*56), zP4, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) + Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(3)*56), zP4, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) (*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(4) } else { Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(0)*56), int64(*(*int32)(unsafe.Pointer(bp /* i */)))) Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(1)*56), Xsqlite3OpcodeName(tls, int32((*Op)(unsafe.Pointer(pOp)).Fopcode)), - -1, SQLITE_UTF8, uintptr(0)) + -1, uint8(SQLITE_UTF8), uintptr(0)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(2)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp1)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(3)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp2)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(4)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp3)) // pMem+5 for p4 is done last Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(6)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp5)) Xsqlite3VdbeMemSetNull(tls, (pMem + uintptr(7)*56)) - Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(5)*56), zP4, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) + Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(5)*56), zP4, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) (*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(8) } (*Vdbe)(unsafe.Pointer(p)).FpResultSet = pMem @@ -56132,7 +56353,7 @@ type ReusableSpace = struct { FpSpace uintptr FnFree Sqlite3_int64 FnNeeded Sqlite3_int64 -} /* sqlite3.c:79985:1 */ +} /* sqlite3.c:80608:1 */ // Try to allocate nByte bytes of 8-byte aligned bulk memory for pBuf // from the ReusableSpace object. Return a pointer to the allocated @@ -56147,7 +56368,7 @@ type ReusableSpace = struct { // 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 *libc.TLS, p uintptr, pBuf uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:80005:13: */ +func allocSpace(tls *libc.TLS, p uintptr, pBuf uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:80628:13: */ if pBuf == uintptr(0) { nByte = (((nByte) + int64(7)) & int64(libc.CplInt32(7))) @@ -56164,16 +56385,16 @@ func allocSpace(tls *libc.TLS, p uintptr, pBuf uintptr, nByte Sqlite3_int64) uin // Rewind the VDBE back to the beginning in preparation for // running it. -func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) { /* sqlite3.c:80028:21: */ +func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) { /* sqlite3.c:80651:21: */ // There should be at least one opcode. // Set the magic to VDBE_MAGIC_RUN sooner rather than later. - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_RUN + (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic = U32(VDBE_MAGIC_RUN) (*Vdbe)(unsafe.Pointer(p)).Fpc = -1 (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK - (*Vdbe)(unsafe.Pointer(p)).FerrorAction = OE_Abort + (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort) (*Vdbe)(unsafe.Pointer(p)).FnChange = 0 (*Vdbe)(unsafe.Pointer(p)).FcacheCtr = U32(1) (*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat = U8(255) @@ -56197,7 +56418,7 @@ func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) { /* sqlite3.c:80028:21: */ // // Use the sqlite3VdbeRewind() procedure to restore a virtual machine back // to its initial state after it has been run. -func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite3.c:80081:21: */ +func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite3.c:80704:21: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -56211,6 +56432,8 @@ func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite // var x ReusableSpace at bp+8, 24 // Reusable bulk memory + (*Vdbe)(unsafe.Pointer(p)).FpVList = (*Parse)(unsafe.Pointer(pParse)).FpVList + (*Parse)(unsafe.Pointer(pParse)).FpVList = uintptr(0) db = (*Vdbe)(unsafe.Pointer(p)).Fdb nVar = int32((*Parse)(unsafe.Pointer(pParse)).FnVar) @@ -56286,8 +56509,6 @@ func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite } } - (*Vdbe)(unsafe.Pointer(p)).FpVList = (*Parse)(unsafe.Pointer(pParse)).FpVList - (*Parse)(unsafe.Pointer(pParse)).FpVList = uintptr(0) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*Vdbe)(unsafe.Pointer(p)).FnVar = int16(0) (*Vdbe)(unsafe.Pointer(p)).FnCursor = 0 @@ -56295,22 +56516,22 @@ func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite } else { (*Vdbe)(unsafe.Pointer(p)).FnCursor = nCursor (*Vdbe)(unsafe.Pointer(p)).FnVar = YnVar(nVar) - initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, nVar, db, MEM_Null) + initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, nVar, db, uint16(MEM_Null)) (*Vdbe)(unsafe.Pointer(p)).FnMem = nMem - initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaMem, nMem, db, MEM_Undefined) + initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaMem, nMem, db, uint16(MEM_Undefined)) libc.Xmemset(tls, (*Vdbe)(unsafe.Pointer(p)).FapCsr, 0, (uint64(nCursor) * uint64(unsafe.Sizeof(uintptr(0))))) } Xsqlite3VdbeRewind(tls, p) } var azColName = [12]uintptr{ - ts + 3977 /* "addr" */, ts + 3982 /* "opcode" */, ts + 3989 /* "p1" */, ts + 3992 /* "p2" */, ts + 3995 /* "p3" */, ts + 3998 /* "p4" */, ts + 4001 /* "p5" */, ts + 4004, /* "comment" */ - ts + 4012 /* "id" */, ts + 4015 /* "parent" */, ts + 4022 /* "notused" */, ts + 4030, /* "detail" */ -} /* sqlite3.c:80127:23 */ + ts + 4005 /* "addr" */, ts + 4010 /* "opcode" */, ts + 4017 /* "p1" */, ts + 4020 /* "p2" */, ts + 4023 /* "p3" */, ts + 4026 /* "p4" */, ts + 4029 /* "p5" */, ts + 4032, /* "comment" */ + ts + 4040 /* "id" */, ts + 4043 /* "parent" */, ts + 4050 /* "notused" */, ts + 4058, /* "detail" */ +} /* sqlite3.c:80752:23 */ // Close a VDBE cursor and release all the resources that cursor // happens to hold. -func Xsqlite3VdbeFreeCursor(tls *libc.TLS, p uintptr, pCx uintptr) { /* sqlite3.c:80206:21: */ +func Xsqlite3VdbeFreeCursor(tls *libc.TLS, p uintptr, pCx uintptr) { /* sqlite3.c:80829:21: */ if pCx == uintptr(0) { return } @@ -56351,7 +56572,7 @@ func Xsqlite3VdbeFreeCursor(tls *libc.TLS, p uintptr, pCx uintptr) { /* sqlite3. } // Close all cursors in the current frame. -func closeCursorsInFrame(tls *libc.TLS, p uintptr) { /* sqlite3.c:80243:13: */ +func closeCursorsInFrame(tls *libc.TLS, p uintptr) { /* sqlite3.c:80866:13: */ if (*Vdbe)(unsafe.Pointer(p)).FapCsr != 0 { var i int32 for i = 0; i < (*Vdbe)(unsafe.Pointer(p)).FnCursor; i++ { @@ -56367,7 +56588,7 @@ func closeCursorsInFrame(tls *libc.TLS, p uintptr) { /* sqlite3.c:80243:13: */ // 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 Xsqlite3VdbeFrameRestore(tls *libc.TLS, pFrame uintptr) int32 { /* sqlite3.c:80261:20: */ +func Xsqlite3VdbeFrameRestore(tls *libc.TLS, pFrame uintptr) int32 { /* sqlite3.c:80884:20: */ var v uintptr = (*VdbeFrame)(unsafe.Pointer(pFrame)).Fv closeCursorsInFrame(tls, v) (*Vdbe)(unsafe.Pointer(v)).FaOp = (*VdbeFrame)(unsafe.Pointer(pFrame)).FaOp @@ -56391,7 +56612,7 @@ func Xsqlite3VdbeFrameRestore(tls *libc.TLS, pFrame uintptr) int32 { /* sqlite3. // 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 *libc.TLS, p uintptr) { /* sqlite3.c:80290:13: */ +func closeAllCursors(tls *libc.TLS, p uintptr) { /* sqlite3.c:80913:13: */ if (*Vdbe)(unsafe.Pointer(p)).FpFrame != 0 { var pFrame uintptr for pFrame = (*Vdbe)(unsafe.Pointer(p)).FpFrame; (*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent != 0; pFrame = (*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent { @@ -56422,7 +56643,7 @@ func closeAllCursors(tls *libc.TLS, p uintptr) { /* sqlite3.c:80290:13: */ // 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 Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sqlite3.c:80320:21: */ +func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sqlite3.c:80943:21: */ var n int32 var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb @@ -56436,7 +56657,7 @@ func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sql if (*Vdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } - initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, n, db, MEM_Null) + initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, n, db, uint16(MEM_Null)) } // Set the name of the idx'th column to be returned by the SQL statement. @@ -56447,7 +56668,7 @@ func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sql // 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 Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) int32 { /* sqlite3.c:80345:20: */ +func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) int32 { /* sqlite3.c:80968:20: */ var rc int32 var pColName uintptr @@ -56457,7 +56678,7 @@ func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa } pColName = ((*Vdbe)(unsafe.Pointer(p)).FaColName + uintptr((idx+(var1*int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn))))*56) - rc = Xsqlite3VdbeMemSetStr(tls, pColName, zName, -1, SQLITE_UTF8, xDel) + rc = Xsqlite3VdbeMemSetStr(tls, pColName, zName, -1, uint8(SQLITE_UTF8), xDel) return rc } @@ -56466,7 +56687,7 @@ func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa // 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 super-journal trickery. -func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80373:12: */ +func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80996:12: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -56491,7 +56712,7 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80373 // file is required for an atomic commit. for i = 0; (rc == SQLITE_OK) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb); i++ { var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt - if Xsqlite3BtreeIsInTrans(tls, pBt) != 0 { + if Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_WRITE { var pPager uintptr // Pager associated with pBt needXcommit = 1 Xsqlite3BtreeEnter(tls, pBt) @@ -56512,7 +56733,7 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80373 // If there are any write-transactions at all, invoke the commit hook if (needXcommit != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FxCommitCallback != 0) { - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 272 /* &.xCommitCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCommitArg) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 280 /* &.xCommitCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCommitArg) if rc != 0 { return (SQLITE_CONSTRAINT | (int32(2) << 8)) } @@ -56561,7 +56782,7 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80373 // Select a super-journal file name nMainFile = Xsqlite3Strlen30(tls, zMainFile) - zSuper = Xsqlite3MPrintf(tls, db, ts+4037 /* "%.4c%s%.16c" */, libc.VaList(bp, 0, zMainFile, 0)) + zSuper = Xsqlite3MPrintf(tls, db, ts+4065 /* "%.4c%s%.16c" */, libc.VaList(bp, 0, zMainFile, 0)) if zSuper == uintptr(0) { return SQLITE_NOMEM } @@ -56571,16 +56792,16 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80373 if retryCount != 0 { if retryCount > 100 { - Xsqlite3_log(tls, SQLITE_FULL, ts+4049 /* "MJ delete: %s" */, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, SQLITE_FULL, ts+4077 /* "MJ delete: %s" */, libc.VaList(bp+24, zSuper)) Xsqlite3OsDelete(tls, pVfs, zSuper, 0) break } else if retryCount == 1 { - Xsqlite3_log(tls, SQLITE_FULL, ts+4063 /* "MJ collide: %s" */, libc.VaList(bp+32, zSuper)) + Xsqlite3_log(tls, SQLITE_FULL, ts+4091 /* "MJ collide: %s" */, libc.VaList(bp+32, zSuper)) } } retryCount++ Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), bp+56 /* &iRandom */) - Xsqlite3_snprintf(tls, 13, (zSuper + uintptr(nMainFile)), ts+4078, /* "-mj%06X9%02X" */ + Xsqlite3_snprintf(tls, 13, (zSuper + uintptr(nMainFile)), ts+4106, /* "-mj%06X9%02X" */ libc.VaList(bp+40, ((*(*U32)(unsafe.Pointer(bp + 56 /* iRandom */))>>8)&U32(0xffffff)), (*(*U32)(unsafe.Pointer(bp + 56 /* iRandom */))&U32(0xff)))) // The antipenultimate character of the super-journal name must // be "9" to avoid name collisions when using 8+3 filenames. @@ -56604,7 +56825,7 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80373 // back independently if a failure occurs. for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt - if Xsqlite3BtreeIsInTrans(tls, pBt) != 0 { + if Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_WRITE { var zFile uintptr = Xsqlite3BtreeGetJournalname(tls, pBt) if zFile == uintptr(0) { continue // Ignore TEMP and :memory: databases @@ -56692,7 +56913,7 @@ var aMJNeeded = [6]U8{ /* TRUNCATE */ U8(1), /* MEMORY */ U8(0), /* WAL */ U8(0), -} /* sqlite3.c:80408:23 */ +} /* sqlite3.c:81031:23 */ // This routine checks that the sqlite3.nVdbeActive count variable // matches the number of vdbe's in the list sqlite3.pVdbe that are @@ -56710,7 +56931,7 @@ var aMJNeeded = [6]U8{ // // If an IO error occurs, an SQLITE_IOERR_XXX error code is returned. // Otherwise SQLITE_OK. -func vdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:80669:28: */ +func vdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:81292:28: */ var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb var rc int32 = SQLITE_OK var i int32 @@ -56753,7 +56974,7 @@ func vdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3. return rc } -func Xsqlite3VdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:80715:20: */ +func Xsqlite3VdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:81338:20: */ if ((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FnStatement != 0) && ((*Vdbe)(unsafe.Pointer(p)).FiStatement != 0) { return vdbeCloseStatement(tls, p, eOp) } @@ -56768,13 +56989,13 @@ func Xsqlite3VdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* // If there are outstanding FK violations and this function returns // SQLITE_ERROR, set the result of the VM to SQLITE_CONSTRAINT_FOREIGNKEY // and write an error message to it. Then return SQLITE_ERROR. -func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32 { /* sqlite3.c:80734:20: */ +func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32 { /* sqlite3.c:81357:20: */ var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb if ((deferred != 0) && (((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons + (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons) > int64(0))) || (!(deferred != 0) && ((*Vdbe)(unsafe.Pointer(p)).FnFkConstraint > int64(0))) { (*Vdbe)(unsafe.Pointer(p)).Frc = (SQLITE_CONSTRAINT | (int32(3) << 8)) - (*Vdbe)(unsafe.Pointer(p)).FerrorAction = OE_Abort - Xsqlite3VdbeError(tls, p, ts+4091 /* "FOREIGN KEY cons..." */, 0) + (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort) + Xsqlite3VdbeError(tls, p, ts+4119 /* "FOREIGN KEY cons..." */, 0) return SQLITE_ERROR } return SQLITE_OK @@ -56791,7 +57012,7 @@ func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32 { /* sq // 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 Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: */ +func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81384:20: */ var rc int32 // Used to store transient return codes var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb @@ -56810,7 +57031,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * // state. We need to rollback the statement transaction, if there is // one, or the complete transaction if there is no statement transaction. - if (*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_RUN { + if (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic != U32(VDBE_MAGIC_RUN) { return SQLITE_OK } if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -56896,7 +57117,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * } else { (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0) (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_DeferFKs)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_DeferFKs))) Xsqlite3CommitInternalChanges(tls, db) } } else { @@ -56963,7 +57184,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * } } - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_HALT + (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic = U32(VDBE_MAGIC_HALT) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM @@ -56986,7 +57207,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * // 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 Xsqlite3VdbeResetStepResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:80962:21: */ +func Xsqlite3VdbeResetStepResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:81585:21: */ (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK } @@ -56996,7 +57217,7 @@ func Xsqlite3VdbeResetStepResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:80962: // // This function does not clear the VDBE error code or message, just // copies them to the database handle. -func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80974:20: */ +func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81597:20: */ var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb var rc int32 = (*Vdbe)(unsafe.Pointer(p)).Frc if (*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0 { @@ -57005,7 +57226,7 @@ func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80 if (*Sqlite3)(unsafe.Pointer(db)).FpErr == uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).FpErr = Xsqlite3ValueNew(tls, db) } - Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, SQLITE_UTF8, libc.UintptrFromInt32(-1)) + Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, uint8(SQLITE_UTF8), libc.UintptrFromInt32(-1)) Xsqlite3EndBenignMalloc(tls) (*Sqlite3)(unsafe.Pointer(db)).FbBenignMalloc-- } else if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 { @@ -57024,7 +57245,7 @@ func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80 // 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 Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81023:20: */ +func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81646:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -57056,7 +57277,7 @@ func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81023:20: // called), set the database error in this case as well. Xsqlite3ErrorWithMsg(tls, db, (*Vdbe)(unsafe.Pointer(p)).Frc, func() uintptr { if (*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0 { - return ts + 2690 /* "%s" */ + return ts + 2718 /* "%s" */ } return uintptr(0) }(), libc.VaList(bp, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)) @@ -57070,15 +57291,15 @@ func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81023:20: (*Vdbe)(unsafe.Pointer(p)).FpResultSet = uintptr(0) // Save profiling information from this VDBE run. - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_RESET + (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic = U32(VDBE_MAGIC_RESET) return ((*Vdbe)(unsafe.Pointer(p)).Frc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask) } // Clean up and delete a VDBE after execution. Return an integer which is // the result code. Write any error message text into *pzErrMsg. -func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81120:20: */ +func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81743:20: */ var rc int32 = SQLITE_OK - if ((*Vdbe)(unsafe.Pointer(p)).Fmagic == VDBE_MAGIC_RUN) || ((*Vdbe)(unsafe.Pointer(p)).Fmagic == VDBE_MAGIC_HALT) { + if ((*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic == U32(VDBE_MAGIC_RUN)) || ((*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic == U32(VDBE_MAGIC_HALT)) { rc = Xsqlite3VdbeReset(tls, p) } @@ -57100,7 +57321,7 @@ func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81120:2 // // * the corresponding bit in argument mask is clear (where the first // function parameter corresponds to bit 0 etc.). -func Xsqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, mask int32) { /* sqlite3.c:81146:21: */ +func Xsqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, mask int32) { /* sqlite3.c:81769:21: */ for *(*uintptr)(unsafe.Pointer(pp)) != 0 { var pAux uintptr = *(*uintptr)(unsafe.Pointer(pp)) if (iOp < 0) || @@ -57125,7 +57346,7 @@ func Xsqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, // 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 Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:81174:21: */ +func Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:81797:21: */ var pSub uintptr var pNext uintptr @@ -57135,7 +57356,7 @@ func Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3. vdbeFreeOpArray(tls, db, (*SubProgram)(unsafe.Pointer(pSub)).FaOp, (*SubProgram)(unsafe.Pointer(pSub)).FnOp) Xsqlite3DbFree(tls, db, pSub) } - if (*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_INIT { + if (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic != U32(VDBE_MAGIC_INIT) { releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, int32((*Vdbe)(unsafe.Pointer(p)).FnVar)) Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FpVList) Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FpFree) @@ -57146,7 +57367,7 @@ func Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3. } // Delete an entire VDBE. -func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:81215:21: */ +func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:81838:21: */ var db uintptr db = (*Vdbe)(unsafe.Pointer(p)).Fdb @@ -57161,7 +57382,7 @@ func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:81215:21: */ if (*Vdbe)(unsafe.Pointer(p)).FpNext != 0 { (*Vdbe)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpNext)).FpPrev = (*Vdbe)(unsafe.Pointer(p)).FpPrev } - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_DEAD + (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic = U32(VDBE_MAGIC_DEAD) (*Vdbe)(unsafe.Pointer(p)).Fdb = uintptr(0) Xsqlite3DbFreeNN(tls, db, p) } @@ -57169,7 +57390,7 @@ func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:81215:21: */ // 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 Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81241:36: */ +func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81864:36: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -57182,10 +57403,10 @@ func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:812 return rc } if *(*int32)(unsafe.Pointer(bp /* res */)) != 0 { - return Xsqlite3CorruptError(tls, 81251) + return Xsqlite3CorruptError(tls, 81874) } (*VdbeCursor)(unsafe.Pointer(p)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = U32(CACHE_STALE) return SQLITE_OK } @@ -57194,7 +57415,7 @@ func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:812 // 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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:81267:28: */ +func handleMovedCursor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81890:28: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -57203,7 +57424,7 @@ func handleMovedCursor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81267:28: var rc int32 rc = Xsqlite3BtreeCursorRestore(tls, *(*uintptr)(unsafe.Pointer(p + 56 /* &.uc */)), bp /* &isDifferentRow */) - (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = U32(CACHE_STALE) if *(*int32)(unsafe.Pointer(bp /* isDifferentRow */)) != 0 { (*VdbeCursor)(unsafe.Pointer(p)).FnullRow = U8(1) } @@ -57212,7 +57433,7 @@ func handleMovedCursor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81267:28: // Check to ensure that the cursor is valid. Restore the cursor // if need be. Return any I/O error from the restore operation. -func Xsqlite3VdbeCursorRestore(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81282:20: */ +func Xsqlite3VdbeCursorRestore(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81905:20: */ if Xsqlite3BtreeCursorHasMoved(tls, *(*uintptr)(unsafe.Pointer(p + 56 /* &.uc */))) != 0 { return handleMovedCursor(tls, p) @@ -57231,7 +57452,7 @@ func Xsqlite3VdbeCursorRestore(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81 // // 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 Xsqlite3VdbeCursorMoveto(tls *libc.TLS, pp uintptr, piCol uintptr) int32 { /* sqlite3.c:81303:20: */ +func Xsqlite3VdbeCursorMoveto(tls *libc.TLS, pp uintptr, piCol uintptr) int32 { /* sqlite3.c:81926:20: */ var p uintptr = *(*uintptr)(unsafe.Pointer(pp)) if (*VdbeCursor)(unsafe.Pointer(p)).FdeferredMoveto != 0 { @@ -57305,10 +57526,10 @@ var sqlite3SmallTypeSizes = [128]U8{ /* 100 */ U8(44), U8(44), U8(45), U8(45), U8(46), U8(46), U8(47), U8(47), U8(48), U8(48), /* 110 */ U8(49), U8(49), U8(50), U8(50), U8(51), U8(51), U8(52), U8(52), U8(53), U8(53), /* 120 */ U8(54), U8(54), U8(55), U8(55), U8(56), U8(56), U8(57), U8(57), -} /* sqlite3.c:81439:17 */ +} /* sqlite3.c:82062:17 */ // Return the length of the data corresponding to the supplied serial-type. -func Xsqlite3VdbeSerialTypeLen(tls *libc.TLS, serial_type U32) U32 { /* sqlite3.c:81459:20: */ +func Xsqlite3VdbeSerialTypeLen(tls *libc.TLS, serial_type U32) U32 { /* sqlite3.c:82082:20: */ if serial_type >= U32(128) { return ((serial_type - U32(12)) / U32(2)) } else { @@ -57318,7 +57539,7 @@ func Xsqlite3VdbeSerialTypeLen(tls *libc.TLS, serial_type U32) U32 { /* sqlite3. return U32(0) } -func Xsqlite3VdbeOneByteSerialTypeLen(tls *libc.TLS, serial_type U8) U8 { /* sqlite3.c:81468:19: */ +func Xsqlite3VdbeOneByteSerialTypeLen(tls *libc.TLS, serial_type U8) U8 { /* sqlite3.c:82091:19: */ return sqlite3SmallTypeSizes[serial_type] } @@ -57367,7 +57588,7 @@ func Xsqlite3VdbeOneByteSerialTypeLen(tls *libc.TLS, serial_type U8) U8 { /* sql // Return the number of bytes actually written into buf[]. The number // of bytes in the zero-filled tail is included in the return value only // if those bytes were zeroed in buf[]. -func Xsqlite3VdbeSerialPut(tls *libc.TLS, buf uintptr, pMem uintptr, serial_type U32) U32 { /* sqlite3.c:81539:20: */ +func Xsqlite3VdbeSerialPut(tls *libc.TLS, buf uintptr, pMem uintptr, serial_type U32) U32 { /* sqlite3.c:82162:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -57418,7 +57639,7 @@ func Xsqlite3VdbeSerialPut(tls *libc.TLS, buf uintptr, pMem uintptr, serial_type // The few cases that require local variables are broken out into a separate // routine so that in most cases the overhead of moving the stack pointer // is avoided. -func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:81593:12: */ +func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:82216:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -57429,7 +57650,7 @@ func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { // EVIDENCE-OF: R-29851-52272 Value is a big-endian 64-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*I64)(unsafe.Pointer(bp /* &x */)) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) } else { // EVIDENCE-OF: R-57343-49114 Value is a big-endian IEEE 754-2008 64-bit @@ -57438,15 +57659,15 @@ func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { libc.Xmemcpy(tls, (pMem /* &.u */ /* &.r */), bp /* &x */, uint64(unsafe.Sizeof(U64(0)))) (*Mem)(unsafe.Pointer(pMem)).Fflags = func() uint16 { if (((*(*U64)(unsafe.Pointer(bp /* x */))) & (U64((uint64(0x7ff))) << 52)) == (U64((uint64(0x7ff))) << 52)) && (((*(*U64)(unsafe.Pointer(bp /* x */))) & ((U64((uint64(1))) << 52) - uint64(1))) != uint64(0)) { - return MEM_Null + return uint16(MEM_Null) } - return MEM_Real + return uint16(MEM_Real) }() } return U32(8) } -func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:81629:20: */ +func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:82252:20: */ switch serial_type { case U32(10): { // Internal use only: NULL with virtual table @@ -57462,7 +57683,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin case U32(0): { // Null // EVIDENCE-OF: R-24078-09375 Value is a NULL. - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null) break } @@ -57471,7 +57692,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-44885-25196 Value is an 8-bit twos-complement // integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = I64(I8(*(*uint8)(unsafe.Pointer((buf))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(1) @@ -57481,7 +57702,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-49794-35026 Value is a big-endian 16-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64((256 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | int32(*(*uint8)(unsafe.Pointer((buf) + 1))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(2) @@ -57491,7 +57712,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-37839-54301 Value is a big-endian 24-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64(((65536 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | (int32(*(*uint8)(unsafe.Pointer((buf) + 1))) << 8)) | int32(*(*uint8)(unsafe.Pointer((buf) + 2))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(3) @@ -57501,7 +57722,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-01849-26079 Value is a big-endian 32-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64((((16777216 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | (int32(*(*uint8)(unsafe.Pointer((buf) + 1))) << 16)) | (int32(*(*uint8)(unsafe.Pointer((buf) + 2))) << 8)) | int32(*(*uint8)(unsafe.Pointer((buf) + 3))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(4) @@ -57511,7 +57732,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-50385-09674 Value is a big-endian 48-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = ((I64((((U32(*(*uint8)(unsafe.Pointer((buf + uintptr(2))))) << 24) | (U32(int32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 1))) << 16))) | (U32(int32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 2))) << 8))) | U32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 3))))) + ((I64((int64(1))) << 32) * (I64((256 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | int32(*(*uint8)(unsafe.Pointer((buf) + 1))))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(6) @@ -57532,7 +57753,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-12976-22893 Value is the integer 0. // EVIDENCE-OF: R-18143-12121 Value is the integer 1. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64(serial_type - U32(8))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(0) } @@ -57548,7 +57769,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin return U32(0) } -var aFlag = [2]U16{(U16(MEM_Blob | MEM_Ephem)), (U16(MEM_Str | MEM_Ephem))} /* sqlite3.c:81711:24 */ +var aFlag = [2]U16{(U16(MEM_Blob | MEM_Ephem)), (U16(MEM_Str | MEM_Ephem))} /* sqlite3.c:82334:24 */ // This routine is used to allocate sufficient space for an UnpackedRecord // structure large enough to be used with sqlite3VdbeRecordUnpack() if @@ -57562,7 +57783,7 @@ var aFlag = [2]U16{(U16(MEM_Blob | MEM_Ephem)), (U16(MEM_Str | MEM_Ephem))} /* s // before returning. // // If an OOM error occurs, NULL is returned. -func Xsqlite3VdbeAllocUnpackedRecord(tls *libc.TLS, pKeyInfo uintptr) uintptr { /* sqlite3.c:81734:31: */ +func Xsqlite3VdbeAllocUnpackedRecord(tls *libc.TLS, pKeyInfo uintptr) uintptr { /* sqlite3.c:82357:31: */ var p uintptr // Unpacked record to return var nByte int32 // Number of bytes required for *p nByte = (int32((((uint64(unsafe.Sizeof(UnpackedRecord{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7))) + (uint64(unsafe.Sizeof(Mem{})) * (uint64(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField) + 1))))) @@ -57580,7 +57801,7 @@ func Xsqlite3VdbeAllocUnpackedRecord(tls *libc.TLS, pKeyInfo uintptr) uintptr { // Given the nKey-byte encoding of a record in pKey[], populate the // UnpackedRecord structure indicated by the fourth argument with the // contents of the decoded record. -func Xsqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr, p uintptr) { /* sqlite3.c:81754:21: */ +func Xsqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr, p uintptr) { /* sqlite3.c:82377:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -57643,7 +57864,7 @@ func Xsqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey // 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 *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr, prcErr uintptr) int32 { /* sqlite3.c:81949:12: */ +func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr, prcErr uintptr) int32 { /* sqlite3.c:82572:12: */ bp := tls.Alloc(112) defer tls.Free(112) @@ -57659,15 +57880,15 @@ func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uin // var c2 Mem at bp+56, 56 - Xsqlite3VdbeMemInit(tls, bp /* &c1 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, MEM_Null) - Xsqlite3VdbeMemInit(tls, bp+56 /* &c2 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, MEM_Null) + Xsqlite3VdbeMemInit(tls, bp /* &c1 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, uint16(MEM_Null)) + Xsqlite3VdbeMemInit(tls, bp+56 /* &c2 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, uint16(MEM_Null)) Xsqlite3VdbeMemShallowCopy(tls, bp /* &c1 */, pMem1, MEM_Ephem) Xsqlite3VdbeMemShallowCopy(tls, bp+56 /* &c2 */, pMem2, MEM_Ephem) v1 = Xsqlite3ValueText(tls, bp /* &c1 */, (*CollSeq)(unsafe.Pointer(pColl)).Fenc) v2 = Xsqlite3ValueText(tls, bp+56 /* &c2 */, (*CollSeq)(unsafe.Pointer(pColl)).Fenc) if (v1 == uintptr(0)) || (v2 == uintptr(0)) { if prcErr != 0 { - *(*U8)(unsafe.Pointer(prcErr)) = SQLITE_NOMEM + *(*U8)(unsafe.Pointer(prcErr)) = U8(SQLITE_NOMEM) } rc = 0 } else { @@ -57682,7 +57903,7 @@ func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uin // 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 *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:81986:12: */ +func isAllZero(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:82609:12: */ var i int32 for i = 0; i < n; i++ { if *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 { @@ -57695,7 +57916,7 @@ func isAllZero(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:81986:12: // 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 Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sqlite3.c:81999:36: */ +func Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sqlite3.c:82622:36: */ var c int32 var n1 int32 = (*Mem)(unsafe.Pointer(pB1)).Fn var n2 int32 = (*Mem)(unsafe.Pointer(pB2)).Fn @@ -57735,16 +57956,17 @@ func Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sql // 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 *libc.TLS, i I64, r float64) int32 { /* sqlite3.c:82032:12: */ +func sqlite3IntFloatCompare(tls *libc.TLS, i I64, r float64) int32 { /* sqlite3.c:82655:12: */ if uint64(unsafe.Sizeof(float64(0))) > uint64(8) { var x float64 = float64(i) + if x < r { return -1 } if x > r { return +1 - } - return 0 + } /*NO_TEST*/ // work around bugs in gcov + return 0 /*NO_TEST*/ // work around bugs in gcov } else { var y I64 var s float64 @@ -57780,7 +58002,7 @@ func sqlite3IntFloatCompare(tls *libc.TLS, i I64, r float64) int32 { /* sqlite3. // sequence pColl and finally blob's ordered by memcmp(). // // Two NULL values are considered equal by this function. -func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr) int32 { /* sqlite3.c:82062:20: */ +func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr) int32 { /* sqlite3.c:82688:20: */ var f1 int32 var f2 int32 var combined_flags int32 @@ -57874,7 +58096,7 @@ func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintp // 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 *libc.TLS, serial_type U32, aKey uintptr) I64 { /* sqlite3.c:82161:12: */ +func vdbeRecordDecodeInt(tls *libc.TLS, serial_type U32, aKey uintptr) I64 { /* sqlite3.c:82787:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -57937,7 +58159,7 @@ func vdbeRecordDecodeInt(tls *libc.TLS, serial_type U32, aKey uintptr) I64 { /* // 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 Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr, bSkip int32) int32 { /* sqlite3.c:82216:20: */ +func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr, bSkip int32) int32 { /* sqlite3.c:82842:20: */ bp := tls.Alloc(68) defer tls.Free(68) @@ -57985,7 +58207,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr i = 0 } if d1 > uint32(nKey1) { - (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82247)) + (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82873)) return 0 // Corruption } @@ -58050,12 +58272,12 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr if ((d1 + U32((*Mem)(unsafe.Pointer(bp+8 /* &mem1 */)).Fn)) > uint32(nKey1)) || (int32((*KeyInfo)(unsafe.Pointer((libc.AssignUintptr(&pKeyInfo, (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FpKeyInfo)))).FnAllField) <= i) { - (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82324)) + (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82950)) return 0 // Corruption } else if *(*uintptr)(unsafe.Pointer((pKeyInfo + 32 /* &.aColl */) + uintptr(i)*8)) != 0 { (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fenc = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fenc (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fdb = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb - (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fflags = MEM_Str + (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fflags = U16(MEM_Str) (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fz = (aKey1 + uintptr(d1)) rc = vdbeCompareMemString(tls, bp+8 /* &mem1 */, pRhs, *(*uintptr)(unsafe.Pointer((pKeyInfo + 32 /* &.aColl */) + uintptr(i)*8)), (pPKey2 + 19 /* &.errCode */)) @@ -58085,7 +58307,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr var nStr int32 = (int32((*(*U32)(unsafe.Pointer(bp + 64 /* serial_type */)) - U32(12)) / U32(2))) if (d1 + U32(nStr)) > uint32(nKey1) { - (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82354)) + (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82980)) return 0 // Corruption } else if (int32((*Mem)(unsafe.Pointer(pRhs)).Fflags) & MEM_Zero) != 0 { if !(isAllZero(tls, (aKey1+uintptr(d1)), nStr) != 0) { @@ -58146,7 +58368,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr return int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fdefault_rc) } -func Xsqlite3VdbeRecordCompare(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:82413:20: */ +func Xsqlite3VdbeRecordCompare(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:83039:20: */ return Xsqlite3VdbeRecordCompareWithSkip(tls, nKey1, pKey1, pPKey2, 0) } @@ -58157,7 +58379,7 @@ func Xsqlite3VdbeRecordCompare(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 // // 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 *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:82430:12: */ +func vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:83056:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -58262,7 +58484,7 @@ func vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uint // 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 *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:82524:12: */ +func vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:83150:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -58286,7 +58508,7 @@ func vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 u nStr = ((*(*int32)(unsafe.Pointer(bp /* serial_type */)) - 12) / 2) if (szHdr + nStr) > nKey1 { - (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82549)) + (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 83175)) return 0 // Corruption } nCmp = func() int32 { @@ -58324,7 +58546,7 @@ func vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 u // Return a pointer to an sqlite3VdbeRecordCompare() compatible function // suitable for comparing serialized records to the unpacked record passed // as the only argument. -func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare { /* sqlite3.c:82588:30: */ +func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare { /* sqlite3.c:83214:30: */ // varintRecordCompareInt() and varintRecordCompareString() both assume // that the size-of-header varint that occurs at the start of each record // fits in a single byte (i.e. is 127 or less). varintRecordCompareInt() @@ -58378,7 +58600,7 @@ func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare { /* sqlite // // 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 Xsqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr) int32 { /* sqlite3.c:82639:20: */ +func Xsqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr) int32 { /* sqlite3.c:83265:20: */ bp := tls.Alloc(120) defer tls.Free(120) @@ -58463,7 +58685,7 @@ __6: idx_rowid_corruption: ; Xsqlite3VdbeMemRelease(tls, bp /* &m */) - return Xsqlite3CorruptError(tls, 82704) + return Xsqlite3CorruptError(tls, 83330) } // Compare the key of the index entry that cursor pC is pointing to against @@ -58475,7 +58697,7 @@ idx_rowid_corruption: // 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 Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked uintptr, res uintptr) int32 { /* sqlite3.c:82718:20: */ +func Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked uintptr, res uintptr) int32 { /* sqlite3.c:83344:20: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -58491,7 +58713,7 @@ func Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked // that btreeParseCellPtr() and sqlite3GetVarint32() are implemented if (nCellKey <= int64(0)) || (nCellKey > int64(0x7fffffff)) { *(*int32)(unsafe.Pointer(res)) = 0 - return Xsqlite3CorruptError(tls, 82737) + return Xsqlite3CorruptError(tls, 83363) } Xsqlite3VdbeMemInit(tls, bp /* &m */, db, uint16(0)) rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, U32(nCellKey), bp /* &m */) @@ -58505,15 +58727,15 @@ func Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked // This routine sets the value to be returned by subsequent calls to // sqlite3_changes() on the database handle 'db'. -func Xsqlite3VdbeSetChanges(tls *libc.TLS, db uintptr, nChange int32) { /* sqlite3.c:82753:21: */ +func Xsqlite3VdbeSetChanges(tls *libc.TLS, db uintptr, nChange int32) { /* sqlite3.c:83379:21: */ (*Sqlite3)(unsafe.Pointer(db)).FnChange = nChange - *(*int32)(unsafe.Pointer(db + 120 /* &.nTotalChange */)) += (nChange) + *(*int32)(unsafe.Pointer(db + 124 /* &.nTotalChange */)) += (nChange) } // Set a flag in the vdbe to update the change counter when it is finalised // or reset. -func Xsqlite3VdbeCountChanges(tls *libc.TLS, v uintptr) { /* sqlite3.c:82763:21: */ +func Xsqlite3VdbeCountChanges(tls *libc.TLS, v uintptr) { /* sqlite3.c:83389:21: */ libc.SetBitFieldPtr16Uint32(v+200 /* &.changeCntOn */, Bft(1), 4, 0x10) } @@ -58533,7 +58755,7 @@ func Xsqlite3VdbeCountChanges(tls *libc.TLS, v uintptr) { /* sqlite3.c:82763:21: // Internally, this function just sets the Vdbe.expired flag on all // prepared statements. The flag is set to 1 for an immediate expiration // and set to 2 for an advisory expiration. -func Xsqlite3ExpirePreparedStatements(tls *libc.TLS, db uintptr, iCode int32) { /* sqlite3.c:82785:21: */ +func Xsqlite3ExpirePreparedStatements(tls *libc.TLS, db uintptr, iCode int32) { /* sqlite3.c:83411:21: */ var p uintptr for p = (*Sqlite3)(unsafe.Pointer(db)).FpVdbe; p != 0; p = (*Vdbe)(unsafe.Pointer(p)).FpNext { libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, (Bft(iCode + 1)), 0, 0x3) @@ -58541,12 +58763,12 @@ func Xsqlite3ExpirePreparedStatements(tls *libc.TLS, db uintptr, iCode int32) { } // Return the database associated with the Vdbe. -func Xsqlite3VdbeDb(tls *libc.TLS, v uintptr) uintptr { /* sqlite3.c:82795:24: */ +func Xsqlite3VdbeDb(tls *libc.TLS, v uintptr) uintptr { /* sqlite3.c:83421:24: */ return (*Vdbe)(unsafe.Pointer(v)).Fdb } // Return the SQLITE_PREPARE flags for a Vdbe. -func Xsqlite3VdbePrepareFlags(tls *libc.TLS, v uintptr) U8 { /* sqlite3.c:82802:19: */ +func Xsqlite3VdbePrepareFlags(tls *libc.TLS, v uintptr) U8 { /* sqlite3.c:83428:19: */ return (*Vdbe)(unsafe.Pointer(v)).FprepFlags } @@ -58556,7 +58778,7 @@ func Xsqlite3VdbePrepareFlags(tls *libc.TLS, v uintptr) U8 { /* sqlite3.c:82802: // constants) to the value before returning it. // // The returned value must be freed by the caller using sqlite3ValueFree(). -func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uintptr { /* sqlite3.c:82814:30: */ +func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uintptr { /* sqlite3.c:83440:30: */ if v != 0 { var pMem uintptr = ((*Vdbe)(unsafe.Pointer(v)).FaVar + uintptr((iVar-1))*56) @@ -58565,7 +58787,7 @@ func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uin var pRet uintptr = Xsqlite3ValueNew(tls, (*Vdbe)(unsafe.Pointer(v)).Fdb) if pRet != 0 { Xsqlite3VdbeMemCopy(tls, pRet, pMem) - Xsqlite3ValueApplyAffinity(tls, pRet, aff, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, pRet, aff, uint8(SQLITE_UTF8)) } return pRet } @@ -58576,7 +58798,7 @@ func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uin // 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 Xsqlite3VdbeSetVarmask(tls *libc.TLS, v uintptr, iVar int32) { /* sqlite3.c:82836:21: */ +func Xsqlite3VdbeSetVarmask(tls *libc.TLS, v uintptr, iVar int32) { /* sqlite3.c:83462:21: */ if iVar >= 32 { *(*U32)(unsafe.Pointer(v + 276 /* &.expmask */)) |= (0x80000000) @@ -58592,7 +58814,7 @@ func Xsqlite3VdbeSetVarmask(tls *libc.TLS, v uintptr, iVar int32) { /* sqlite3.c // throw an error if it is given inputs that would make it non-deterministic. // This routine is invoked by date/time functions that use non-deterministic // features such as 'now'. -func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:82855:20: */ +func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:83481:20: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -58605,13 +58827,13 @@ func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:82855 var zContext uintptr var zMsg uintptr if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5) & NC_IsCheck) != 0 { - zContext = ts + 4121 /* "a CHECK constrai..." */ + zContext = ts + 4149 /* "a CHECK constrai..." */ } else if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5) & NC_GenCol) != 0 { - zContext = ts + 4140 /* "a generated colu..." */ + zContext = ts + 4168 /* "a generated colu..." */ } else { - zContext = ts + 4159 /* "an index" */ + zContext = ts + 4187 /* "an index" */ } - zMsg = Xsqlite3_mprintf(tls, ts+4168, /* "non-deterministi..." */ + zMsg = Xsqlite3_mprintf(tls, ts+4196, /* "non-deterministi..." */ libc.VaList(bp, (*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -1) Xsqlite3_free(tls, zMsg) @@ -58623,7 +58845,7 @@ func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:82855 // 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 Xsqlite3VtabImportErrmsg(tls *libc.TLS, p uintptr, pVtab uintptr) { /* sqlite3.c:82886:21: */ +func Xsqlite3VtabImportErrmsg(tls *libc.TLS, p uintptr, pVtab uintptr) { /* sqlite3.c:83512:21: */ if (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg != 0 { var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg) @@ -58639,7 +58861,7 @@ func Xsqlite3VtabImportErrmsg(tls *libc.TLS, p uintptr, pVtab uintptr) { /* sqli // // This function is used to free UnpackedRecord structures allocated by // the vdbeUnpackRecord() function found in vdbeapi.c. -func vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { /* sqlite3.c:82907:13: */ +func vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { /* sqlite3.c:83533:13: */ if p != 0 { var i int32 for i = 0; i < nField; i++ { @@ -58656,7 +58878,7 @@ func vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { /* s // then cursor passed as the second argument should point to the row about // to be update or deleted. If the application calls sqlite3_preupdate_old(), // the required value will be read from the row the cursor points to. -func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, zDb uintptr, pTab uintptr, iKey1 I64, iReg int32) { /* sqlite3.c:82926:21: */ +func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, zDb uintptr, pTab uintptr, iKey1 I64, iReg int32) { /* sqlite3.c:83552:21: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -58667,7 +58889,7 @@ func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, var zTbl uintptr = (*Table)(unsafe.Pointer(pTab)).FzName libc.Xmemset(tls, bp /* &preupdate */, 0, uint64(unsafe.Sizeof(PreUpdate{}))) - if (libc.Bool32(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) == 0 { + if (libc.Bool32(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) == 0 { iKey1 = libc.AssignInt64(&iKey2, int64(0)) (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpPk = Xsqlite3PrimaryKeyIndex(tls, pTab) } else { @@ -58691,7 +58913,7 @@ func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpTab = pTab (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate = bp /* &preupdate */ - (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Sqlite3_int64, Sqlite3_int64))(unsafe.Pointer((db + 328 /* &.xPreUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) + (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Sqlite3_int64, Sqlite3_int64))(unsafe.Pointer((db + 336 /* &.xPreUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) Xsqlite3DbFree(tls, db, (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FaRecord) vdbeFreeUnpacked(tls, db, (int32((*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).Fkeyinfo.FnKeyField) + 1), (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpUnpacked) @@ -58705,7 +58927,7 @@ func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, } } -var fakeSortOrder U8 = U8(0) /* sqlite3.c:82939:19 */ +var fakeSortOrder U8 = U8(0) /* sqlite3.c:83565:19 */ //************* End of vdbeaux.c ******************************************** //************* Begin file vdbeapi.c **************************************** @@ -58731,7 +58953,7 @@ var fakeSortOrder U8 = U8(0) /* sqlite3.c:82939:19 */ // 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 *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83015:16: */ +func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83641:16: */ var p uintptr = pStmt return (libc.Bool32((p == uintptr(0)) || ((Bft(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.expired */)) & 0x3 >> 0))) != 0))) } @@ -58739,9 +58961,9 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83015:1 // 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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:83026:12: */ +func vdbeSafety(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83652:12: */ if (*Vdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, SQLITE_MISUSE, ts+4204 /* "API called with ..." */, 0) + Xsqlite3_log(tls, SQLITE_MISUSE, ts+4232 /* "API called with ..." */, 0) return 1 } else { return 0 @@ -58749,9 +58971,9 @@ func vdbeSafety(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83026:12: */ return int32(0) } -func vdbeSafetyNotNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83034:12: */ +func vdbeSafetyNotNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83660:12: */ if p == uintptr(0) { - Xsqlite3_log(tls, SQLITE_MISUSE, ts+4249 /* "API called with ..." */, 0) + Xsqlite3_log(tls, SQLITE_MISUSE, ts+4277 /* "API called with ..." */, 0) return 1 } else { return vdbeSafety(tls, p) @@ -58761,7 +58983,7 @@ func vdbeSafetyNotNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83034:12: // 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 *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:83048:29: */ +func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:83674:29: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -58772,10 +58994,10 @@ func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c: Xsqlite3OsCurrentTimeInt64(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, bp /* &iNow */) *(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */)) = ((*(*Sqlite3_int64)(unsafe.Pointer(bp /* iNow */)) - (*Vdbe)(unsafe.Pointer(p)).FstartTime) * int64(1000000)) if (*Sqlite3)(unsafe.Pointer(db)).FxProfile != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, U64))(unsafe.Pointer((db + 248 /* &.xProfile */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg, (*Vdbe)(unsafe.Pointer(p)).FzSql, uint64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */)))) + (*(*func(*libc.TLS, uintptr, uintptr, U64))(unsafe.Pointer((db + 256 /* &.xProfile */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg, (*Vdbe)(unsafe.Pointer(p)).FzSql, uint64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */)))) } if (int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_PROFILE) != 0 { - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_PROFILE, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8 /* &iElapse */) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 240 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_PROFILE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8 /* &iElapse */) } (*Vdbe)(unsafe.Pointer(p)).FstartTime = int64(0) } @@ -58790,7 +59012,7 @@ func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c: // // This routine sets the error code and string returned by // sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). -func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83086:16: */ +func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83712:16: */ var rc int32 if pStmt == uintptr(0) { // IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL @@ -58800,7 +59022,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83086: var v uintptr = pStmt var db uintptr = (*Vdbe)(unsafe.Pointer(v)).Fdb if vdbeSafety(tls, v) != 0 { - return Xsqlite3MisuseError(tls, 83095) + return Xsqlite3MisuseError(tls, 83721) } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if ((*Vdbe)(unsafe.Pointer(v)).FstartTime) > int64(0) { @@ -58820,7 +59042,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83086: // // This routine sets the error code and string returned by // sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). -func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83113:16: */ +func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83739:16: */ var rc int32 if pStmt == uintptr(0) { rc = SQLITE_OK @@ -58842,7 +59064,7 @@ func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83113:16: } // Set all the parameters in the compiled SQL statement to NULL. -func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83134:16: */ +func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83760:16: */ var i int32 var rc int32 = SQLITE_OK var p uintptr = pStmt @@ -58850,7 +59072,7 @@ func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c: Xsqlite3_mutex_enter(tls, mutex) for i = 0; i < int32((*Vdbe)(unsafe.Pointer(p)).FnVar); i++ { Xsqlite3VdbeMemRelease(tls, ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56)) - (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56)).Fflags = U16(MEM_Null) } if (*Vdbe)(unsafe.Pointer(p)).Fexpmask != 0 { @@ -58864,7 +59086,7 @@ func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c: // // The following routines extract information from a Mem or sqlite3_value // structure. -func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83159:23: */ +func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83785:23: */ var p uintptr = pVal if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & (MEM_Blob | MEM_Str)) != 0 { if (func() int32 { @@ -58887,27 +59109,27 @@ func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:831 return uintptr(0) } -func Xsqlite3_value_bytes(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83172:16: */ - return Xsqlite3ValueBytes(tls, pVal, SQLITE_UTF8) +func Xsqlite3_value_bytes(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83798:16: */ + return Xsqlite3ValueBytes(tls, pVal, uint8(SQLITE_UTF8)) } -func Xsqlite3_value_bytes16(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83175:16: */ - return Xsqlite3ValueBytes(tls, pVal, SQLITE_UTF16LE) +func Xsqlite3_value_bytes16(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83801:16: */ + return Xsqlite3ValueBytes(tls, pVal, uint8(SQLITE_UTF16LE)) } -func Xsqlite3_value_double(tls *libc.TLS, pVal uintptr) float64 { /* sqlite3.c:83178:19: */ +func Xsqlite3_value_double(tls *libc.TLS, pVal uintptr) float64 { /* sqlite3.c:83804:19: */ return Xsqlite3VdbeRealValue(tls, pVal) } -func Xsqlite3_value_int(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83181:16: */ +func Xsqlite3_value_int(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83807:16: */ return int32(Xsqlite3VdbeIntValue(tls, pVal)) } -func Xsqlite3_value_int64(tls *libc.TLS, pVal uintptr) Sqlite_int64 { /* sqlite3.c:83184:25: */ +func Xsqlite3_value_int64(tls *libc.TLS, pVal uintptr) Sqlite_int64 { /* sqlite3.c:83810:25: */ return Xsqlite3VdbeIntValue(tls, pVal) } -func Xsqlite3_value_subtype(tls *libc.TLS, pVal uintptr) uint32 { /* sqlite3.c:83187:25: */ +func Xsqlite3_value_subtype(tls *libc.TLS, pVal uintptr) uint32 { /* sqlite3.c:83813:25: */ var pMem uintptr = pVal return func() uint32 { if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Subtype) != 0 { @@ -58917,7 +59139,7 @@ func Xsqlite3_value_subtype(tls *libc.TLS, pVal uintptr) uint32 { /* sqlite3.c:8 }() } -func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr { /* sqlite3.c:83191:17: */ +func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr { /* sqlite3.c:83817:17: */ var p uintptr = pVal if ((((int32((*Mem)(unsafe.Pointer(p)).Fflags) & ((MEM_TypeMask | MEM_Term) | MEM_Subtype)) == ((MEM_Null | MEM_Term) | MEM_Subtype)) && (zPType != uintptr(0))) && @@ -58930,108 +59152,108 @@ func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr return uintptr(0) } -func Xsqlite3_value_text(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83204:32: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF8) +func Xsqlite3_value_text(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83830:32: */ + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) } -func Xsqlite3_value_text16(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83208:23: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF16LE) +func Xsqlite3_value_text16(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83834:23: */ + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE)) } -func Xsqlite3_value_text16be(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83211:23: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF16BE) +func Xsqlite3_value_text16be(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83837:23: */ + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16BE)) } -func Xsqlite3_value_text16le(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83214:23: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF16LE) +func Xsqlite3_value_text16le(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83840:23: */ + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE)) } // 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 *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83222:16: */ +func Xsqlite3_value_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83848:16: */ return int32(aType[(int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & MEM_AffMask)]) } var aType = [64]U8{ - SQLITE_BLOB, // 0x00 (not possible) - SQLITE_NULL, // 0x01 NULL - SQLITE_TEXT, // 0x02 TEXT - SQLITE_NULL, // 0x03 (not possible) - SQLITE_INTEGER, // 0x04 INTEGER - SQLITE_NULL, // 0x05 (not possible) - SQLITE_INTEGER, // 0x06 INTEGER + TEXT - SQLITE_NULL, // 0x07 (not possible) - SQLITE_FLOAT, // 0x08 FLOAT - SQLITE_NULL, // 0x09 (not possible) - SQLITE_FLOAT, // 0x0a FLOAT + TEXT - SQLITE_NULL, // 0x0b (not possible) - SQLITE_INTEGER, // 0x0c (not possible) - SQLITE_NULL, // 0x0d (not possible) - SQLITE_INTEGER, // 0x0e (not possible) - SQLITE_NULL, // 0x0f (not possible) - SQLITE_BLOB, // 0x10 BLOB - SQLITE_NULL, // 0x11 (not possible) - SQLITE_TEXT, // 0x12 (not possible) - SQLITE_NULL, // 0x13 (not possible) - SQLITE_INTEGER, // 0x14 INTEGER + BLOB - SQLITE_NULL, // 0x15 (not possible) - SQLITE_INTEGER, // 0x16 (not possible) - SQLITE_NULL, // 0x17 (not possible) - SQLITE_FLOAT, // 0x18 FLOAT + BLOB - SQLITE_NULL, // 0x19 (not possible) - SQLITE_FLOAT, // 0x1a (not possible) - SQLITE_NULL, // 0x1b (not possible) - SQLITE_INTEGER, // 0x1c (not possible) - SQLITE_NULL, // 0x1d (not possible) - SQLITE_INTEGER, // 0x1e (not possible) - SQLITE_NULL, // 0x1f (not possible) - SQLITE_FLOAT, // 0x20 INTREAL - SQLITE_NULL, // 0x21 (not possible) - SQLITE_TEXT, // 0x22 INTREAL + TEXT - SQLITE_NULL, // 0x23 (not possible) - SQLITE_FLOAT, // 0x24 (not possible) - SQLITE_NULL, // 0x25 (not possible) - SQLITE_FLOAT, // 0x26 (not possible) - SQLITE_NULL, // 0x27 (not possible) - SQLITE_FLOAT, // 0x28 (not possible) - SQLITE_NULL, // 0x29 (not possible) - SQLITE_FLOAT, // 0x2a (not possible) - SQLITE_NULL, // 0x2b (not possible) - SQLITE_FLOAT, // 0x2c (not possible) - SQLITE_NULL, // 0x2d (not possible) - SQLITE_FLOAT, // 0x2e (not possible) - SQLITE_NULL, // 0x2f (not possible) - SQLITE_BLOB, // 0x30 (not possible) - SQLITE_NULL, // 0x31 (not possible) - SQLITE_TEXT, // 0x32 (not possible) - SQLITE_NULL, // 0x33 (not possible) - SQLITE_FLOAT, // 0x34 (not possible) - SQLITE_NULL, // 0x35 (not possible) - SQLITE_FLOAT, // 0x36 (not possible) - SQLITE_NULL, // 0x37 (not possible) - SQLITE_FLOAT, // 0x38 (not possible) - SQLITE_NULL, // 0x39 (not possible) - SQLITE_FLOAT, // 0x3a (not possible) - SQLITE_NULL, // 0x3b (not possible) - SQLITE_FLOAT, // 0x3c (not possible) - SQLITE_NULL, // 0x3d (not possible) - SQLITE_FLOAT, // 0x3e (not possible) - SQLITE_NULL, // 0x3f (not possible) -} /* sqlite3.c:83223:19 */ + U8(SQLITE_BLOB), // 0x00 (not possible) + U8(SQLITE_NULL), // 0x01 NULL + U8(SQLITE_TEXT), // 0x02 TEXT + U8(SQLITE_NULL), // 0x03 (not possible) + U8(SQLITE_INTEGER), // 0x04 INTEGER + U8(SQLITE_NULL), // 0x05 (not possible) + U8(SQLITE_INTEGER), // 0x06 INTEGER + TEXT + U8(SQLITE_NULL), // 0x07 (not possible) + U8(SQLITE_FLOAT), // 0x08 FLOAT + U8(SQLITE_NULL), // 0x09 (not possible) + U8(SQLITE_FLOAT), // 0x0a FLOAT + TEXT + U8(SQLITE_NULL), // 0x0b (not possible) + U8(SQLITE_INTEGER), // 0x0c (not possible) + U8(SQLITE_NULL), // 0x0d (not possible) + U8(SQLITE_INTEGER), // 0x0e (not possible) + U8(SQLITE_NULL), // 0x0f (not possible) + U8(SQLITE_BLOB), // 0x10 BLOB + U8(SQLITE_NULL), // 0x11 (not possible) + U8(SQLITE_TEXT), // 0x12 (not possible) + U8(SQLITE_NULL), // 0x13 (not possible) + U8(SQLITE_INTEGER), // 0x14 INTEGER + BLOB + U8(SQLITE_NULL), // 0x15 (not possible) + U8(SQLITE_INTEGER), // 0x16 (not possible) + U8(SQLITE_NULL), // 0x17 (not possible) + U8(SQLITE_FLOAT), // 0x18 FLOAT + BLOB + U8(SQLITE_NULL), // 0x19 (not possible) + U8(SQLITE_FLOAT), // 0x1a (not possible) + U8(SQLITE_NULL), // 0x1b (not possible) + U8(SQLITE_INTEGER), // 0x1c (not possible) + U8(SQLITE_NULL), // 0x1d (not possible) + U8(SQLITE_INTEGER), // 0x1e (not possible) + U8(SQLITE_NULL), // 0x1f (not possible) + U8(SQLITE_FLOAT), // 0x20 INTREAL + U8(SQLITE_NULL), // 0x21 (not possible) + U8(SQLITE_TEXT), // 0x22 INTREAL + TEXT + U8(SQLITE_NULL), // 0x23 (not possible) + U8(SQLITE_FLOAT), // 0x24 (not possible) + U8(SQLITE_NULL), // 0x25 (not possible) + U8(SQLITE_FLOAT), // 0x26 (not possible) + U8(SQLITE_NULL), // 0x27 (not possible) + U8(SQLITE_FLOAT), // 0x28 (not possible) + U8(SQLITE_NULL), // 0x29 (not possible) + U8(SQLITE_FLOAT), // 0x2a (not possible) + U8(SQLITE_NULL), // 0x2b (not possible) + U8(SQLITE_FLOAT), // 0x2c (not possible) + U8(SQLITE_NULL), // 0x2d (not possible) + U8(SQLITE_FLOAT), // 0x2e (not possible) + U8(SQLITE_NULL), // 0x2f (not possible) + U8(SQLITE_BLOB), // 0x30 (not possible) + U8(SQLITE_NULL), // 0x31 (not possible) + U8(SQLITE_TEXT), // 0x32 (not possible) + U8(SQLITE_NULL), // 0x33 (not possible) + U8(SQLITE_FLOAT), // 0x34 (not possible) + U8(SQLITE_NULL), // 0x35 (not possible) + U8(SQLITE_FLOAT), // 0x36 (not possible) + U8(SQLITE_NULL), // 0x37 (not possible) + U8(SQLITE_FLOAT), // 0x38 (not possible) + U8(SQLITE_NULL), // 0x39 (not possible) + U8(SQLITE_FLOAT), // 0x3a (not possible) + U8(SQLITE_NULL), // 0x3b (not possible) + U8(SQLITE_FLOAT), // 0x3c (not possible) + U8(SQLITE_NULL), // 0x3d (not possible) + U8(SQLITE_FLOAT), // 0x3e (not possible) + U8(SQLITE_NULL), // 0x3f (not possible) +} /* sqlite3.c:83849:19 */ // Return true if a parameter to xUpdate represents an unchanged column -func Xsqlite3_value_nochange(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83308:16: */ +func Xsqlite3_value_nochange(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83934:16: */ return (libc.Bool32((int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & (MEM_Null | MEM_Zero)) == (MEM_Null | MEM_Zero))) } // Return true if a parameter value originated from an sqlite3_bind() -func Xsqlite3_value_frombind(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83313:16: */ +func Xsqlite3_value_frombind(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83939:16: */ return (libc.Bool32((int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & MEM_FromBind) != 0)) } // Make a copy of an sqlite3_value object -func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) uintptr { /* sqlite3.c:83319:26: */ +func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) uintptr { /* sqlite3.c:83945:26: */ var pNew uintptr if pOrig == uintptr(0) { return uintptr(0) @@ -59057,7 +59279,7 @@ func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) uintptr { /* sqlite3.c:833 // Destroy an sqlite3_value object previously obtained from // sqlite3_value_dup(). -func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:83342:17: */ +func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:83968:17: */ Xsqlite3ValueFree(tls, pOld) } @@ -59072,13 +59294,13 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:83342:17: * // // 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 *libc.TLS, pCtx uintptr, z uintptr, n int32, enc U8, xDel uintptr) { /* sqlite3.c:83358:13: */ +func setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc U8, xDel uintptr) { /* sqlite3.c:83984:13: */ if Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, enc, xDel) == SQLITE_TOOBIG { Xsqlite3_result_error_toobig(tls, pCtx) } } -func invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) int32 { /* sqlite3.c:83369:12: */ +func invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) int32 { /* sqlite3.c:83995:12: */ if xDel == uintptr(0) { // noop @@ -59093,12 +59315,12 @@ func invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) return SQLITE_TOOBIG } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83385:17: */ +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84011:17: */ setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr) { /* sqlite3.c:83395:17: */ +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr) { /* sqlite3.c:84021:17: */ if n > uint64(0x7fffffff) { invokeValueDestructor(tls, z, xDel, pCtx) @@ -59107,62 +59329,62 @@ func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_ui } } -func Xsqlite3_result_double(tls *libc.TLS, pCtx uintptr, rVal float64) { /* sqlite3.c:83409:17: */ +func Xsqlite3_result_double(tls *libc.TLS, pCtx uintptr, rVal float64) { /* sqlite3.c:84035:17: */ Xsqlite3VdbeMemSetDouble(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, rVal) } -func Xsqlite3_result_error(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:83413:17: */ +func Xsqlite3_result_error(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:84039:17: */ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_ERROR - Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, SQLITE_UTF8, libc.UintptrFromInt32(-1)) + Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, uint8(SQLITE_UTF8), libc.UintptrFromInt32(-1)) } -func Xsqlite3_result_error16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:83419:17: */ +func Xsqlite3_result_error16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:84045:17: */ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_ERROR - Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, SQLITE_UTF16LE, libc.UintptrFromInt32(-1)) + Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(-1)) } -func Xsqlite3_result_int(tls *libc.TLS, pCtx uintptr, iVal int32) { /* sqlite3.c:83425:17: */ +func Xsqlite3_result_int(tls *libc.TLS, pCtx uintptr, iVal int32) { /* sqlite3.c:84051:17: */ Xsqlite3VdbeMemSetInt64(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, I64(iVal)) } -func Xsqlite3_result_int64(tls *libc.TLS, pCtx uintptr, iVal I64) { /* sqlite3.c:83429:17: */ +func Xsqlite3_result_int64(tls *libc.TLS, pCtx uintptr, iVal I64) { /* sqlite3.c:84055:17: */ Xsqlite3VdbeMemSetInt64(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, iVal) } -func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83433:17: */ +func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84059:17: */ Xsqlite3VdbeMemSetNull(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:83437:17: */ +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:84063:17: */ var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut Xsqlite3VdbeMemRelease(tls, pOut) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) Xsqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) } -func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { /* sqlite3.c:83449:17: */ +func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { /* sqlite3.c:84075:17: */ var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut (*Mem)(unsafe.Pointer(pOut)).FeSubtype = (U8(eSubtype & uint32(0xff))) *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83455:17: */ +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84081:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF8, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr, enc uint8) { /* sqlite3.c:83464:17: */ +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr, enc uint8) { /* sqlite3.c:84090:17: */ if int32(enc) == SQLITE_UTF16 { - enc = SQLITE_UTF16LE + enc = uint8(SQLITE_UTF16LE) } if n > uint64(0x7fffffff) { invokeValueDestructor(tls, z, xDel, pCtx) @@ -59171,42 +59393,42 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_ui } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83481:17: */ +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84107:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF16LE, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16LE), xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83490:17: */ +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84116:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF16BE, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16BE), xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83499:17: */ +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84125:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF16LE, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16LE), xDel) } -func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { /* sqlite3.c:83509:17: */ +func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { /* sqlite3.c:84135:17: */ Xsqlite3VdbeMemCopy(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, pValue) } -func Xsqlite3_result_zeroblob(tls *libc.TLS, pCtx uintptr, n int32) { /* sqlite3.c:83513:17: */ +func Xsqlite3_result_zeroblob(tls *libc.TLS, pCtx uintptr, n int32) { /* sqlite3.c:84139:17: */ Xsqlite3VdbeMemSetZeroBlob(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, n) } -func Xsqlite3_result_zeroblob64(tls *libc.TLS, pCtx uintptr, n U64) int32 { /* sqlite3.c:83517:16: */ +func Xsqlite3_result_zeroblob64(tls *libc.TLS, pCtx uintptr, n U64) int32 { /* sqlite3.c:84143:16: */ var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut - if n > U64(*(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(pOut)).Fdb + 124 /* &.aLimit */)))) { + if n > U64(*(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(pOut)).Fdb + 128 /* &.aLimit */)))) { return SQLITE_TOOBIG } Xsqlite3VdbeMemSetZeroBlob(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, int32(n)) return SQLITE_OK } -func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { /* sqlite3.c:83526:17: */ +func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { /* sqlite3.c:84152:17: */ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = func() int32 { if errCode != 0 { return errCode @@ -59215,20 +59437,20 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { /* }() if (int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags) & MEM_Null) != 0 { Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, Xsqlite3ErrStr(tls, errCode), -1, - SQLITE_UTF8, uintptr(0)) + uint8(SQLITE_UTF8), uintptr(0)) } } // Force an SQLITE_TOOBIG error. -func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83538:17: */ +func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84164:17: */ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_TOOBIG - Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, ts+4289 /* "string or blob t..." */, -1, - SQLITE_UTF8, uintptr(0)) + Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, ts+4317 /* "string or blob t..." */, -1, + uint8(SQLITE_UTF8), uintptr(0)) } // An SQLITE_NOMEM error. -func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83546:17: */ +func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84172:17: */ Xsqlite3VdbeMemSetNull(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_NOMEM @@ -59238,7 +59460,7 @@ func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:835 // Force the INT64 value currently stored as the result to be // a MEM_IntReal value. See the SQLITE_TESTCTRL_RESULT_INTREAL // test-control. -func Xsqlite3ResultIntReal(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83558:21: */ +func Xsqlite3ResultIntReal(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84184:21: */ if (int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags) & MEM_Int) != 0 { *(*U16)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Int))) @@ -59248,7 +59470,7 @@ func Xsqlite3ResultIntReal(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83558:21: // This function is called after a transaction has been committed. It // invokes callbacks registered with sqlite3_wal_hook() as required. -func doWalCallbacks(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:83572:12: */ +func doWalCallbacks(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84198:12: */ var rc int32 = SQLITE_OK var i int32 for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { @@ -59259,7 +59481,7 @@ func doWalCallbacks(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:83572:12: */ nEntry = Xsqlite3PagerWalCallback(tls, Xsqlite3BtreePager(tls, pBt)) Xsqlite3BtreeLeave(tls, pBt) if ((nEntry > 0) && ((*Sqlite3)(unsafe.Pointer(db)).FxWalCallback != 0)) && (rc == SQLITE_OK) { - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer((db + 344 /* &.xWalCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpWalArg, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FzDbSName, nEntry) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer((db + 352 /* &.xWalCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpWalArg, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FzDbSName, nEntry) } } } @@ -59273,11 +59495,11 @@ func doWalCallbacks(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:83572:12: */ // 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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:83602:12: */ +func sqlite3Step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84228:12: */ var db uintptr var rc int32 - if !((*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_RUN) { + if !((*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic != U32(VDBE_MAGIC_RUN)) { goto __1 } // We used to require that sqlite3_reset() be called before retrying @@ -59335,7 +59557,7 @@ __3: if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0) { goto __6 } - libc.AtomicStoreNInt32((db + 392 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) + libc.AtomicStoreNInt32((db + 400 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) __6: ; @@ -59440,14 +59662,14 @@ end_of_step: // 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 *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83736:16: */ +func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84362:16: */ var rc int32 = SQLITE_OK // Result from sqlite3Step() var v uintptr = pStmt // the prepared statement var cnt int32 = 0 // Counter to prevent infinite loop of reprepares var db uintptr // The database connection if vdbeSafetyNotNull(tls, v) != 0 { - return Xsqlite3MisuseError(tls, 83743) + return Xsqlite3MisuseError(tls, 84369) } db = (*Vdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -59487,7 +59709,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83736:16: // Extract the user data from a sqlite3_context structure and return a // pointer to it. -func Xsqlite3_user_data(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:83785:17: */ +func Xsqlite3_user_data(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:84411:17: */ return (*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpFunc)).FpUserData } @@ -59500,7 +59722,7 @@ func Xsqlite3_user_data(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:83785:1 // parameter) of the sqlite3_create_function() and // sqlite3_create_function16() routines that originally registered the // application defined function. -func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:83800:20: */ +func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:84426:20: */ return (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpOut)).Fdb } @@ -59517,7 +59739,7 @@ func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c // Virtual table implements might use this routine to optimize their // performance by substituting a NULL result, or some other light-weight // value, as a signal to the xUpdate routine that the column is unchanged. -func Xsqlite3_vtab_nochange(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83819:16: */ +func Xsqlite3_vtab_nochange(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84445:16: */ return Xsqlite3_value_nochange(tls, (*Sqlite3_context)(unsafe.Pointer(p)).FpOut) } @@ -59527,7 +59749,7 @@ func Xsqlite3_vtab_nochange(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83819 // 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 Xsqlite3StmtCurrentTime(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:83831:30: */ +func Xsqlite3StmtCurrentTime(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:84457:30: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -59550,7 +59772,7 @@ func Xsqlite3StmtCurrentTime(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite // Create a new aggregate context for p and return a pointer to // its pMem->z element. -func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:83851:29: */ +func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:84477:29: */ var pMem uintptr = (*Sqlite3_context)(unsafe.Pointer(p)).FpMem if nByte <= 0 { @@ -59558,7 +59780,7 @@ func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite (*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0) } else { Xsqlite3VdbeMemClearAndResize(tls, pMem, nByte) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Agg + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Agg) *(*uintptr)(unsafe.Pointer(pMem /* &.u */)) = (*Sqlite3_context)(unsafe.Pointer(p)).FpFunc if (*Mem)(unsafe.Pointer(pMem)).Fz != 0 { libc.Xmemset(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, 0, uint64(nByte)) @@ -59570,7 +59792,7 @@ func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite // 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 *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:83873:17: */ +func Xsqlite3_aggregate_context(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:84499:17: */ if (int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpMem)).Fflags) & MEM_Agg) == 0 { return createAggContext(tls, p, nByte) @@ -59588,7 +59810,7 @@ func Xsqlite3_aggregate_context(tls *libc.TLS, p uintptr, nByte int32) uintptr { // 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 *libc.TLS, pCtx uintptr, iArg int32) uintptr { /* sqlite3.c:83894:17: */ +func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) uintptr { /* sqlite3.c:84520:17: */ var pAuxData uintptr if (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe == uintptr(0) { @@ -59611,7 +59833,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) uintptr { /* // 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 *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { /* sqlite3.c:83922:17: */ +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { /* sqlite3.c:84548:17: */ var pAuxData uintptr var pVdbe uintptr pVdbe = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -59691,13 +59913,13 @@ __11: // 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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:83975:16: */ +func Xsqlite3_aggregate_count(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84601:16: */ return (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpMem)).Fn } // Return the number of columns in the result set for the statement pStmt. -func Xsqlite3_column_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83984:16: */ +func Xsqlite3_column_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84610:16: */ var pVm uintptr = pStmt if pVm != 0 { return int32((*Vdbe)(unsafe.Pointer(pVm)).FnResColumn) @@ -59707,7 +59929,7 @@ func Xsqlite3_column_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83 // Return the number of values available from the current row of the // currently executing statement pStmt. -func Xsqlite3_data_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83993:16: */ +func Xsqlite3_data_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84619:16: */ var pVm uintptr = pStmt if (pVm == uintptr(0)) || ((*Vdbe)(unsafe.Pointer(pVm)).FpResultSet == uintptr(0)) { return 0 @@ -59716,19 +59938,19 @@ func Xsqlite3_data_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:8399 } // Return a pointer to static memory containing an SQL NULL value. -func columnNullValue(tls *libc.TLS) uintptr { /* sqlite3.c:84002:18: */ +func columnNullValue(tls *libc.TLS) uintptr { /* sqlite3.c:84628:18: */ return uintptr(unsafe.Pointer(&nullMem)) } var nullMem = Mem{ - /* .flags = */ Fflags: MEM_Null, -} /* sqlite3.c:84012:20 */ + /* .flags = */ Fflags: U16(MEM_Null), +} /* sqlite3.c:84638:20 */ // 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 *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84042:12: */ +func columnMem(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84668:12: */ var pVm uintptr var pOut uintptr @@ -59763,7 +59985,7 @@ func columnMem(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:840 // sqlite3_column_bytes() // sqlite3_column_bytes16() // sqiite3_column_blob() -func columnMallocFailure(tls *libc.TLS, pStmt uintptr) { /* sqlite3.c:84077:13: */ +func columnMallocFailure(tls *libc.TLS, pStmt uintptr) { /* sqlite3.c:84703:13: */ // If malloc() failed during an encoding conversion within an // sqlite3_column_XXX API, then set the return code of the statement to // SQLITE_NOMEM. The next call to _step() (if any) will return SQLITE_ERROR @@ -59780,7 +60002,7 @@ func columnMallocFailure(tls *libc.TLS, pStmt uintptr) { /* sqlite3.c:84077:13: // // The following routines are used to access elements of the current row // in the result set. -func Xsqlite3_column_blob(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84097:23: */ +func Xsqlite3_column_blob(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84723:23: */ var val uintptr val = Xsqlite3_value_blob(tls, columnMem(tls, pStmt, i)) // Even though there is no encoding conversion, value_blob() might @@ -59790,43 +60012,43 @@ func Xsqlite3_column_blob(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sq return val } -func Xsqlite3_column_bytes(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84107:16: */ +func Xsqlite3_column_bytes(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84733:16: */ var val int32 = Xsqlite3_value_bytes(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_bytes16(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84112:16: */ +func Xsqlite3_column_bytes16(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84738:16: */ var val int32 = Xsqlite3_value_bytes16(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_double(tls *libc.TLS, pStmt uintptr, i int32) float64 { /* sqlite3.c:84117:19: */ +func Xsqlite3_column_double(tls *libc.TLS, pStmt uintptr, i int32) float64 { /* sqlite3.c:84743:19: */ var val float64 = Xsqlite3_value_double(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_int(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84122:16: */ +func Xsqlite3_column_int(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84748:16: */ var val int32 = Xsqlite3_value_int(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_int64(tls *libc.TLS, pStmt uintptr, i int32) Sqlite_int64 { /* sqlite3.c:84127:25: */ +func Xsqlite3_column_int64(tls *libc.TLS, pStmt uintptr, i int32) Sqlite_int64 { /* sqlite3.c:84753:25: */ var val Sqlite_int64 = Xsqlite3_value_int64(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_text(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84132:32: */ +func Xsqlite3_column_text(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84758:32: */ var val uintptr = Xsqlite3_value_text(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_value(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84137:26: */ +func Xsqlite3_column_value(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84763:26: */ var pOut uintptr = columnMem(tls, pStmt, i) if (int32((*Mem)(unsafe.Pointer(pOut)).Fflags) & MEM_Static) != 0 { *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Static))) @@ -59836,13 +60058,13 @@ func Xsqlite3_column_value(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* s return pOut } -func Xsqlite3_column_text16(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84147:23: */ +func Xsqlite3_column_text16(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84773:23: */ var val uintptr = Xsqlite3_value_text16(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84153:16: */ +func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84779:16: */ var iType int32 = Xsqlite3_value_type(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return iType @@ -59862,7 +60084,7 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqli // // 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 *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType int32) uintptr { /* sqlite3.c:84175:19: */ +func columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType int32) uintptr { /* sqlite3.c:84801:19: */ var ret uintptr var p uintptr var n int32 @@ -59894,11 +60116,11 @@ func columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType i // Return the name of the Nth column of the result set returned by SQL // statement pStmt. -func Xsqlite3_column_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84224:23: */ +func Xsqlite3_column_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84850:23: */ return columnName(tls, pStmt, N, 0, COLNAME_NAME) } -func Xsqlite3_column_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84228:23: */ +func Xsqlite3_column_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84854:23: */ return columnName(tls, pStmt, N, 1, COLNAME_NAME) } @@ -59907,44 +60129,44 @@ func Xsqlite3_column_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* // 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 *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84247:23: */ +func Xsqlite3_column_decltype(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84873:23: */ return columnName(tls, pStmt, N, 0, COLNAME_DECLTYPE) } -func Xsqlite3_column_decltype16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84251:23: */ +func Xsqlite3_column_decltype16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84877:23: */ return columnName(tls, pStmt, N, 1, COLNAME_DECLTYPE) } // Return the name of the database from which a result column derives. // NULL is returned if the result column is an expression or constant or // anything else which is not an unambiguous reference to a database column. -func Xsqlite3_column_database_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84263:23: */ +func Xsqlite3_column_database_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84889:23: */ return columnName(tls, pStmt, N, 0, COLNAME_DATABASE) } -func Xsqlite3_column_database_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84267:23: */ +func Xsqlite3_column_database_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84893:23: */ return columnName(tls, pStmt, N, 1, COLNAME_DATABASE) } // Return the name of the table from which a result column derives. // NULL is returned if the result column is an expression or constant or // anything else which is not an unambiguous reference to a database column. -func Xsqlite3_column_table_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84277:23: */ +func Xsqlite3_column_table_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84903:23: */ return columnName(tls, pStmt, N, 0, COLNAME_TABLE) } -func Xsqlite3_column_table_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84281:23: */ +func Xsqlite3_column_table_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84907:23: */ return columnName(tls, pStmt, N, 1, COLNAME_TABLE) } // Return the name of the table column from which a result column derives. // NULL is returned if the result column is an expression or constant or // anything else which is not an unambiguous reference to a database column. -func Xsqlite3_column_origin_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84291:23: */ +func Xsqlite3_column_origin_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84917:23: */ return columnName(tls, pStmt, N, 0, COLNAME_COLUMN) } -func Xsqlite3_column_origin_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84295:23: */ +func Xsqlite3_column_origin_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84921:23: */ return columnName(tls, pStmt, N, 1, COLNAME_COLUMN) } @@ -59961,21 +60183,21 @@ func Xsqlite3_column_origin_name16(tls *libc.TLS, pStmt uintptr, N int32) uintpt // // The error code stored in database p->db is overwritten with the return // value in any case. -func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84317:12: */ +func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84943:12: */ bp := tls.Alloc(8) defer tls.Free(8) var pVar uintptr if vdbeSafetyNotNull(tls, p) != 0 { - return Xsqlite3MisuseError(tls, 84320) + return Xsqlite3MisuseError(tls, 84946) } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - if ((*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_RUN) || ((*Vdbe)(unsafe.Pointer(p)).Fpc >= 0) { + if ((*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic != U32(VDBE_MAGIC_RUN)) || ((*Vdbe)(unsafe.Pointer(p)).Fpc >= 0) { Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, SQLITE_MISUSE) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) Xsqlite3_log(tls, SQLITE_MISUSE, - ts+4312 /* "bind on a busy p..." */, libc.VaList(bp, (*Vdbe)(unsafe.Pointer(p)).FzSql)) - return Xsqlite3MisuseError(tls, 84328) + ts+4340 /* "bind on a busy p..." */, libc.VaList(bp, (*Vdbe)(unsafe.Pointer(p)).FzSql)) + return Xsqlite3MisuseError(tls, 84954) } if (i < 1) || (i > int32((*Vdbe)(unsafe.Pointer(p)).FnVar)) { Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, SQLITE_RANGE) @@ -59985,7 +60207,7 @@ func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84317:12 i-- pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56) Xsqlite3VdbeMemRelease(tls, pVar) - (*Mem)(unsafe.Pointer(pVar)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pVar)).Fflags = U16(MEM_Null) (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FerrCode = SQLITE_OK // If the bit corresponding to this variable in Vdbe.expmask is set, then @@ -60009,7 +60231,7 @@ func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84317:12 } // Bind a text or BLOB value. -func bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr, encoding U8) int32 { /* sqlite3.c:84360:12: */ +func bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr, encoding U8) int32 { /* sqlite3.c:84986:12: */ var p uintptr = pStmt var pVar uintptr var rc int32 @@ -60035,11 +60257,11 @@ func bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, } // Bind a blob value to an SQL statement variable. -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84396:16: */ +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:85022:16: */ return bindText(tls, pStmt, i, zData, nData, xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr) int32 { /* sqlite3.c:84408:16: */ +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr) int32 { /* sqlite3.c:85034:16: */ if nData > uint64(0x7fffffff) { return invokeValueDestructor(tls, zData, xDel, uintptr(0)) @@ -60049,7 +60271,7 @@ func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, return int32(0) } -func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) int32 { /* sqlite3.c:84422:16: */ +func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) int32 { /* sqlite3.c:85048:16: */ var rc int32 var p uintptr = pStmt rc = vdbeUnbind(tls, p, i) @@ -60060,11 +60282,11 @@ func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) return rc } -func Xsqlite3_bind_int(tls *libc.TLS, p uintptr, i int32, iValue int32) int32 { /* sqlite3.c:84432:16: */ +func Xsqlite3_bind_int(tls *libc.TLS, p uintptr, i int32, iValue int32) int32 { /* sqlite3.c:85058:16: */ return Xsqlite3_bind_int64(tls, p, i, I64(iValue)) } -func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Sqlite_int64) int32 { /* sqlite3.c:84435:16: */ +func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Sqlite_int64) int32 { /* sqlite3.c:85061:16: */ var rc int32 var p uintptr = pStmt rc = vdbeUnbind(tls, p, i) @@ -60075,7 +60297,7 @@ func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Sqlite_in return rc } -func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84445:16: */ +func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:85071:16: */ var rc int32 var p uintptr = pStmt rc = vdbeUnbind(tls, p, i) @@ -60085,7 +60307,7 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) int32 { /* sqlite3.c:84454:16: */ +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) int32 { /* sqlite3.c:85080:16: */ var rc int32 var p uintptr = pStmt rc = vdbeUnbind(tls, p, i) @@ -60098,28 +60320,28 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84472:16: */ - return bindText(tls, pStmt, i, zData, nData, xDel, SQLITE_UTF8) +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:85098:16: */ + return bindText(tls, pStmt, i, zData, nData, xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr, enc uint8) int32 { /* sqlite3.c:84481:16: */ +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr, enc uint8) int32 { /* sqlite3.c:85107:16: */ if nData > uint64(0x7fffffff) { return invokeValueDestructor(tls, zData, xDel, uintptr(0)) } else { if int32(enc) == SQLITE_UTF16 { - enc = SQLITE_UTF16LE + enc = uint8(SQLITE_UTF16LE) } return bindText(tls, pStmt, i, zData, int32(nData), xDel, enc) } return int32(0) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84498:16: */ - return bindText(tls, pStmt, i, zData, nData, xDel, SQLITE_UTF16LE) +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:85124:16: */ + return bindText(tls, pStmt, i, zData, nData, xDel, uint8(SQLITE_UTF16LE)) } -func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) int32 { /* sqlite3.c:84508:16: */ +func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) int32 { /* sqlite3.c:85134:16: */ var rc int32 switch Xsqlite3_value_type(tls, pValue) { case SQLITE_INTEGER: @@ -60161,7 +60383,7 @@ func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) return rc } -func Xsqlite3_bind_zeroblob(tls *libc.TLS, pStmt uintptr, i int32, n int32) int32 { /* sqlite3.c:84539:16: */ +func Xsqlite3_bind_zeroblob(tls *libc.TLS, pStmt uintptr, i int32, n int32) int32 { /* sqlite3.c:85165:16: */ var rc int32 var p uintptr = pStmt rc = vdbeUnbind(tls, p, i) @@ -60172,11 +60394,11 @@ func Xsqlite3_bind_zeroblob(tls *libc.TLS, pStmt uintptr, i int32, n int32) int3 return rc } -func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Sqlite3_uint64) int32 { /* sqlite3.c:84549:16: */ +func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Sqlite3_uint64) int32 { /* sqlite3.c:85175:16: */ var rc int32 var p uintptr = pStmt Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - if n > U64(*(*int32)(unsafe.Pointer(((*Vdbe)(unsafe.Pointer(p)).Fdb + 124 /* &.aLimit */)))) { + if n > U64(*(*int32)(unsafe.Pointer(((*Vdbe)(unsafe.Pointer(p)).Fdb + 128 /* &.aLimit */)))) { rc = SQLITE_TOOBIG } else { @@ -60189,7 +60411,7 @@ func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Sqlite3_u // 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 *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84568:16: */ +func Xsqlite3_bind_parameter_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85194:16: */ var p uintptr = pStmt if p != 0 { return int32((*Vdbe)(unsafe.Pointer(p)).FnVar) @@ -60201,7 +60423,7 @@ func Xsqlite3_bind_parameter_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqli // is out of range or if the wildcard is unnamed. // // The result is always UTF-8. -func Xsqlite3_bind_parameter_name(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84579:23: */ +func Xsqlite3_bind_parameter_name(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:85205:23: */ var p uintptr = pStmt if p == uintptr(0) { return uintptr(0) @@ -60212,19 +60434,19 @@ func Xsqlite3_bind_parameter_name(tls *libc.TLS, pStmt uintptr, i int32) uintptr // 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 Xsqlite3VdbeParameterIndex(tls *libc.TLS, p uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:84590:20: */ +func Xsqlite3VdbeParameterIndex(tls *libc.TLS, p uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:85216:20: */ if (p == uintptr(0)) || (zName == uintptr(0)) { return 0 } return Xsqlite3VListNameToNum(tls, (*Vdbe)(unsafe.Pointer(p)).FpVList, zName, nName) } -func Xsqlite3_bind_parameter_index(tls *libc.TLS, pStmt uintptr, zName uintptr) int32 { /* sqlite3.c:84594:16: */ +func Xsqlite3_bind_parameter_index(tls *libc.TLS, pStmt uintptr, zName uintptr) int32 { /* sqlite3.c:85220:16: */ return Xsqlite3VdbeParameterIndex(tls, pStmt, zName, Xsqlite3Strlen30(tls, zName)) } // Transfer all bindings from the first statement over to the second. -func Xsqlite3TransferBindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:84601:20: */ +func Xsqlite3TransferBindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:85227:20: */ var pFrom uintptr = pFromStmt var pTo uintptr = pToStmt var i int32 @@ -60247,7 +60469,7 @@ func Xsqlite3TransferBindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) // 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 *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:84628:16: */ +func Xsqlite3_transfer_bindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:85254:16: */ var pFrom uintptr = pFromStmt var pTo uintptr = pToStmt if int32((*Vdbe)(unsafe.Pointer(pFrom)).FnVar) != int32((*Vdbe)(unsafe.Pointer(pTo)).FnVar) { @@ -60268,7 +60490,7 @@ func Xsqlite3_transfer_bindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintpt // 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 *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84652:20: */ +func Xsqlite3_db_handle(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:85278:20: */ if pStmt != 0 { return (*Vdbe)(unsafe.Pointer(pStmt)).Fdb } @@ -60277,7 +60499,7 @@ func Xsqlite3_db_handle(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:846 // Return true if the prepared statement is guaranteed to not modify the // database. -func Xsqlite3_stmt_readonly(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84660:16: */ +func Xsqlite3_stmt_readonly(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85286:16: */ if pStmt != 0 { return (int32(*(*uint16)(unsafe.Pointer(pStmt + 200 /* &.readOnly */)) & 0x80 >> 7)) } @@ -60286,7 +60508,7 @@ func Xsqlite3_stmt_readonly(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:8 // Return 1 if the statement is an EXPLAIN and return 2 if the // statement is an EXPLAIN QUERY PLAN -func Xsqlite3_stmt_isexplain(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84668:16: */ +func Xsqlite3_stmt_isexplain(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85294:16: */ if pStmt != 0 { return (int32(*(*uint16)(unsafe.Pointer(pStmt + 200 /* &.explain */)) & 0xc >> 2)) } @@ -60294,16 +60516,16 @@ func Xsqlite3_stmt_isexplain(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c: } // Return true if the prepared statement is in need of being reset. -func Xsqlite3_stmt_busy(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84675:16: */ +func Xsqlite3_stmt_busy(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85301:16: */ var v uintptr = pStmt - return (libc.Bool32(((v != uintptr(0)) && ((*Vdbe)(unsafe.Pointer(v)).Fmagic == VDBE_MAGIC_RUN)) && ((*Vdbe)(unsafe.Pointer(v)).Fpc >= 0))) + return (libc.Bool32(((v != uintptr(0)) && ((*Vdbe)(unsafe.Pointer(v)).FiVdbeMagic == U32(VDBE_MAGIC_RUN))) && ((*Vdbe)(unsafe.Pointer(v)).Fpc >= 0))) } // Return a pointer to the next prepared statement after pStmt associated // with database connection pDb. If pStmt is NULL, return the first // prepared statement for the database connection. Return NULL if there // are no more. -func Xsqlite3_next_stmt(tls *libc.TLS, pDb uintptr, pStmt uintptr) uintptr { /* sqlite3.c:84686:25: */ +func Xsqlite3_next_stmt(tls *libc.TLS, pDb uintptr, pStmt uintptr) uintptr { /* sqlite3.c:85312:25: */ var pNext uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(pDb)).Fmutex) if pStmt == uintptr(0) { @@ -60316,7 +60538,7 @@ func Xsqlite3_next_stmt(tls *libc.TLS, pDb uintptr, pStmt uintptr) uintptr { /* } // Return the value of a status counter for a prepared statement -func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int32) int32 { /* sqlite3.c:84707:16: */ +func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int32) int32 { /* sqlite3.c:85333:16: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -60342,7 +60564,7 @@ func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int3 } // Return the SQL associated with a prepared statement -func Xsqlite3_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84737:23: */ +func Xsqlite3_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:85363:23: */ var p uintptr = pStmt if p != 0 { return (*Vdbe)(unsafe.Pointer(p)).FzSql @@ -60357,7 +60579,7 @@ func Xsqlite3_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84737:23: // // The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of // expanded bound parameters. -func Xsqlite3_expanded_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84751:17: */ +func Xsqlite3_expanded_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:85377:17: */ var z uintptr = uintptr(0) var zSql uintptr = Xsqlite3_sql(tls, pStmt) if zSql != 0 { @@ -60372,7 +60594,7 @@ func Xsqlite3_expanded_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c: // Allocate and populate an UnpackedRecord structure based on the serialized // record in nKey/pKey. Return a pointer to the new UnpackedRecord structure // if successful, or a NULL pointer if an OOM error is encountered. -func vdbeUnpackRecord(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr) uintptr { /* sqlite3.c:84789:23: */ +func vdbeUnpackRecord(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr) uintptr { /* sqlite3.c:85415:23: */ var pRet uintptr // Return value pRet = Xsqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo) @@ -60385,7 +60607,7 @@ func vdbeUnpackRecord(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr) // This function is called from within a pre-update callback to retrieve // a field of the row currently being updated or deleted. -func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:84808:16: */ +func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:85434:16: */ var p uintptr var pMem uintptr var rc int32 @@ -60399,7 +60621,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if !(!(p != 0) || ((*PreUpdate)(unsafe.Pointer(p)).Fop == SQLITE_INSERT)) { goto __1 } - rc = Xsqlite3MisuseError(tls, 84816) + rc = Xsqlite3MisuseError(tls, 85442) goto preupdate_old_out __1: ; @@ -60491,7 +60713,7 @@ preupdate_old_out: // This function is called from within a pre-update callback to retrieve // the number of columns in the row being updated, deleted or inserted. -func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84871:16: */ +func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:85497:16: */ var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate return func() int32 { if p != 0 { @@ -60510,7 +60732,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84 // // For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL // or SET DEFAULT action is considered a trigger. -func Xsqlite3_preupdate_depth(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84889:16: */ +func Xsqlite3_preupdate_depth(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:85515:16: */ var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate return func() int32 { if p != 0 { @@ -60522,7 +60744,7 @@ func Xsqlite3_preupdate_depth(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84 // This function is called from within a pre-update callback to retrieve // a field of the row currently being updated or inserted. -func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:84900:16: */ +func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:85526:16: */ var p uintptr var rc int32 var pMem uintptr @@ -60536,7 +60758,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if !(!(p != 0) || ((*PreUpdate)(unsafe.Pointer(p)).Fop == SQLITE_DELETE)) { goto __1 } - rc = Xsqlite3MisuseError(tls, 84906) + rc = Xsqlite3MisuseError(tls, 85532) goto preupdate_new_out __1: ; @@ -60677,7 +60899,7 @@ preupdate_new_out: // 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 *libc.TLS, zSql uintptr, pnToken uintptr) int32 { /* sqlite3.c:85070:12: */ +func findNextHostParameter(tls *libc.TLS, zSql uintptr, pnToken uintptr) int32 { /* sqlite3.c:85696:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -60722,7 +60944,7 @@ func findNextHostParameter(tls *libc.TLS, zSql uintptr, pnToken uintptr) int32 { // 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 Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { /* sqlite3.c:85113:21: */ +func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { /* sqlite3.c:85739:21: */ bp := tls.Alloc(248) defer tls.Free(248) @@ -60743,13 +60965,13 @@ func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { db = (*Vdbe)(unsafe.Pointer(p)).Fdb Xsqlite3StrAccumInit(tls, bp+48 /* &out */, uintptr(0), bp+80 /* &zBase[0] */, int32(unsafe.Sizeof([100]int8{})), - *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) + *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 1 { for *(*int8)(unsafe.Pointer(zRawSql)) != 0 { var zStart uintptr = zRawSql for (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zRawSql, 1)))) != '\n') && (*(*int8)(unsafe.Pointer(zRawSql)) != 0) { } - Xsqlite3_str_append(tls, bp+48 /* &out */, ts+4352 /* "-- " */, 3) + Xsqlite3_str_append(tls, bp+48 /* &out */, ts+4380 /* "-- " */, 3) Xsqlite3_str_append(tls, bp+48 /* &out */, zStart, (int32((int64(zRawSql) - int64(zStart)) / 1))) } @@ -60778,15 +61000,20 @@ func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { } zRawSql += uintptr(*(*int32)(unsafe.Pointer(bp + 180 /* nToken */))) - nextIndex = (*(*int32)(unsafe.Pointer(bp + 184 /* idx */)) + 1) + nextIndex = func() int32 { + if (*(*int32)(unsafe.Pointer(bp + 184 /* idx */)) + 1) > (nextIndex) { + return (*(*int32)(unsafe.Pointer(bp + 184 /* idx */)) + 1) + } + return nextIndex + }() pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr((*(*int32)(unsafe.Pointer(bp + 184 /* idx */))-1))*56) if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & MEM_Null) != 0 { Xsqlite3_str_append(tls, bp+48 /* &out */, ts+704 /* "NULL" */, 4) } else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & (MEM_Int | MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+3925 /* "%lld" */, libc.VaList(bp, *(*I64)(unsafe.Pointer(pVar /* &.u */)))) + Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+3953 /* "%lld" */, libc.VaList(bp, *(*I64)(unsafe.Pointer(pVar /* &.u */)))) } else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+3875 /* "%!.15g" */, libc.VaList(bp+8, *(*float64)(unsafe.Pointer(pVar /* &.u */)))) + Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+3903 /* "%!.15g" */, libc.VaList(bp+8, *(*float64)(unsafe.Pointer(pVar /* &.u */)))) } else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & MEM_Str) != 0 { var nOut int32 // Number of bytes of the string text to include in output var enc U8 = (*Sqlite3)(unsafe.Pointer(db)).Fenc @@ -60795,27 +61022,27 @@ func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { (*Mem)(unsafe.Pointer(bp + 192 /* &utf8 */)).Fdb = db Xsqlite3VdbeMemSetStr(tls, bp+192 /* &utf8 */, (*Mem)(unsafe.Pointer(pVar)).Fz, (*Mem)(unsafe.Pointer(pVar)).Fn, enc, uintptr(0)) if SQLITE_NOMEM == Xsqlite3VdbeChangeEncoding(tls, bp+192 /* &utf8 */, SQLITE_UTF8) { - (*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FaccError = SQLITE_NOMEM + (*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FaccError = U8(SQLITE_NOMEM) (*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FnAlloc = U32(0) } pVar = bp + 192 /* &utf8 */ } nOut = (*Mem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4356 /* "'%.*q'" */, libc.VaList(bp+16, nOut, (*Mem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4384 /* "'%.*q'" */, libc.VaList(bp+16, nOut, (*Mem)(unsafe.Pointer(pVar)).Fz)) if int32(enc) != SQLITE_UTF8 { Xsqlite3VdbeMemRelease(tls, bp+192 /* &utf8 */) } } else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4363 /* "zeroblob(%d)" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pVar /* &.u */)))) + Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4391 /* "zeroblob(%d)" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pVar /* &.u */)))) } else { var nOut int32 // Number of bytes of the blob to include in output - Xsqlite3_str_append(tls, bp+48 /* &out */, ts+4376 /* "x'" */, 2) + Xsqlite3_str_append(tls, bp+48 /* &out */, ts+4404 /* "x'" */, 2) nOut = (*Mem)(unsafe.Pointer(pVar)).Fn for i = 0; i < nOut; i++ { - Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4379 /* "%02x" */, libc.VaList(bp+40, (int32(*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&0xff))) + Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4407 /* "%02x" */, libc.VaList(bp+40, (int32(*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&0xff))) } - Xsqlite3_str_append(tls, bp+48 /* &out */, ts+4384 /* "'" */, 1) + Xsqlite3_str_append(tls, bp+48 /* &out */, ts+4412 /* "'" */, 1) } } } @@ -60943,7 +61170,7 @@ func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { // Allocate VdbeCursor number iCur. Return a pointer to it. Return NULL // if we run out of memory. -func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, iDb int32, eCurType U8) uintptr { /* sqlite3.c:85478:19: */ +func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, iDb int32, eCurType U8) uintptr { /* sqlite3.c:86104:19: */ // Find the memory cell that will be used to store the blob of memory // required for this VdbeCursor structure. It is convenient to use a // vdbe memory cell to manage the memory allocation required for a @@ -61006,7 +61233,7 @@ func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, iDb int3 // floating point value of rValue. Return true and set *piValue to the // integer value if the string is in range to be an integer. Otherwise, // return false. -func alsoAnInt(tls *libc.TLS, pRec uintptr, rValue float64, piValue uintptr) int32 { /* sqlite3.c:85543:12: */ +func alsoAnInt(tls *libc.TLS, pRec uintptr, rValue float64, piValue uintptr) int32 { /* sqlite3.c:86169:12: */ var iValue I64 = I64(rValue) if Xsqlite3RealSameAsInt(tls, rValue, iValue) != 0 { *(*I64)(unsafe.Pointer(piValue)) = iValue @@ -61028,7 +61255,7 @@ func alsoAnInt(tls *libc.TLS, pRec uintptr, rValue float64, piValue uintptr) int // 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 *libc.TLS, pRec uintptr, bTryForInt int32) { /* sqlite3.c:85567:13: */ +func applyNumericAffinity(tls *libc.TLS, pRec uintptr, bTryForInt int32) { /* sqlite3.c:86193:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -61074,7 +61301,7 @@ func applyNumericAffinity(tls *libc.TLS, pRec uintptr, bTryForInt int32) { /* sq // SQLITE_AFF_BLOB: // SQLITE_AFF_NONE: // No-op. pRec is unchanged. -func applyAffinity(tls *libc.TLS, pRec uintptr, affinity int8, enc U8) { /* sqlite3.c:85607:13: */ +func applyAffinity(tls *libc.TLS, pRec uintptr, affinity int8, enc U8) { /* sqlite3.c:86233:13: */ if int32(affinity) >= SQLITE_AFF_NUMERIC { if (int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Int) == 0 { //OPTIMIZATION-IF-FALSE @@ -61106,7 +61333,7 @@ func applyAffinity(tls *libc.TLS, pRec uintptr, affinity int8, enc U8) { /* sqli // 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 *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:85646:16: */ +func Xsqlite3_value_numeric_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:86272:16: */ var eType int32 = Xsqlite3_value_type(tls, pVal) if eType == SQLITE_TEXT { var pMem uintptr = pVal @@ -61118,7 +61345,7 @@ func Xsqlite3_value_numeric_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3 // Exported version of applyAffinity(). This one works on sqlite3_value*, // not the internal Mem* type. -func Xsqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity U8, enc U8) { /* sqlite3.c:85660:21: */ +func Xsqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity U8, enc U8) { /* sqlite3.c:86286:21: */ applyAffinity(tls, pVal, int8(affinity), enc) } @@ -61126,7 +61353,7 @@ func Xsqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity U8, enc U8 // 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 *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85674:28: */ +func computeNumericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:86300:28: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -61141,15 +61368,15 @@ func computeNumericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85674:28 if rc <= 0 { if (rc == 0) && (Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &ix */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) <= 1) { *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */)) - return MEM_Int + return U16(MEM_Int) } else { - return MEM_Real + return U16(MEM_Real) } } else if (rc == 1) && (Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &ix */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) == 0) { *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */)) - return MEM_Int + return U16(MEM_Int) } - return MEM_Real + return U16(MEM_Real) } // Return the numeric type for pMem, either MEM_Int or MEM_Real or both or @@ -61157,7 +61384,7 @@ func computeNumericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85674:28 // // Unlike applyNumericAffinity(), this routine does not modify pMem->flags. // But it does set pMem->u.r and pMem->u.i appropriately. -func numericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85702:12: */ +func numericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:86328:12: */ if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & ((MEM_Int | MEM_Real) | MEM_IntReal)) != 0 { return (U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & ((MEM_Int | MEM_Real) | MEM_IntReal))) @@ -61171,13 +61398,13 @@ func numericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85702:12: */ // Return the register of pOp->p2 after first preparing it to be // overwritten with an integer value. -func out2PrereleaseWithClear(tls *libc.TLS, pOut uintptr) uintptr { /* sqlite3.c:85961:28: */ +func out2PrereleaseWithClear(tls *libc.TLS, pOut uintptr) uintptr { /* sqlite3.c:86587:28: */ Xsqlite3VdbeMemSetNull(tls, pOut) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) return pOut } -func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3.c:85966:12: */ +func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3.c:86592:12: */ var pOut uintptr pOut = ((*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*VdbeOp)(unsafe.Pointer(pOp)).Fp2)*56) @@ -61185,7 +61412,7 @@ func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3. if (int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { //OPTIMIZATION-IF-FALSE return out2PrereleaseWithClear(tls, pOut) } else { - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) return pOut } return uintptr(0) @@ -61193,9 +61420,9 @@ func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3. // Execute as much of a VDBE program as we can. // This is the core of sqlite3_step(). -func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: */ - bp := tls.Alloc(848) - defer tls.Free(848) +func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:86611:20: */ + bp := tls.Alloc(936) + defer tls.Free(936) var aOp uintptr // Copy of p->aOp var pOp uintptr // Current operation @@ -61352,119 +61579,131 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: * var nField2 int32 // Number of columns or fields in the key var iKey I64 // The rowid we are to seek to var eqOnly int32 - var pC4 uintptr // jump, in3 + var pC4 uintptr + // var res3 int32 at bp+352, 4 + + var nStep int32 + // var r1 UnpackedRecord at bp+328, 24 + var pC5 uintptr // jump, in3 + var pC6 uintptr // jump, in3 var alreadyExists int32 var takeJump int32 var ii1 int32 - var pC6 uintptr - // var res3 int32 at bp+352, 4 + var pC7 uintptr + // var res4 int32 at bp+384, 4 var pFree uintptr var pIdxKey uintptr - // var r1 UnpackedRecord at bp+328, 24 + // var r2 UnpackedRecord at bp+360, 24 // If pIn3->u.i does not contain an integer, compute iKey as the // integer value of pIn3. Jump to P2 if pIn3 cannot be converted // into an integer without loss of information. Take care to avoid // changing the datatype of pIn3, however, as it is used by other // parts of the prepared statement. - // var x Mem at bp+360, 56 + // var x Mem at bp+392, 56 // jump, in3 - var pC7 uintptr + var pC8 uintptr var pCrsr2 uintptr - // var res4 int32 at bp+416, 4 + // var res5 int32 at bp+448, 4 var iKey1 U64 // out2 - // var v I64 at bp+424, 8 + // var v I64 at bp+456, 8 // The new rowid - var pC8 uintptr // Cursor of table to get the new rowid - // var res5 int32 at bp+420, 4 + var pC9 uintptr // Cursor of table to get the new rowid + // var res6 int32 at bp+452, 4 // Result of an sqlite3BtreeLast() var cnt1 int32 // Counter to limit the number of searches var pMem1 uintptr // Register holding largest rowid for AUTOINCREMENT var pFrame1 uintptr var pData uintptr // MEM cell holding data for the record to be inserted var pKey uintptr // MEM cell holding key for the record - var pC9 uintptr // Cursor to table into which insert is written + var pC10 uintptr // Cursor to table into which insert is written var seekResult int32 // Result of prior seek or 0 if no USESEEKRESULT flag var zDb uintptr // database name - used by the update hook var pTab uintptr // Table structure - used by update and pre-update hooks - // var x1 BtreePayload at bp+432, 48 + // var x1 BtreePayload at bp+464, 48 - var pC10 uintptr + var pDest1 uintptr // Cursor to write to + var pSrc uintptr // Cursor to read from + var iKey2 I64 + var pC11 uintptr var zDb1 uintptr var pTab1 uintptr var opflags int32 - var pC11 uintptr - // var res6 int32 at bp+480, 4 + var pC12 uintptr + // var res7 int32 at bp+512, 4 var nKeyCol int32 - var pC12 uintptr var pC13 uintptr + var pC14 uintptr var pCrsr3 uintptr var n3 U32 // out2 - var pC14 uintptr - // var v3 I64 at bp+488, 8 + var pC15 uintptr + // var v3 I64 at bp+520, 8 var pVtab uintptr var pModule uintptr - var pC15 uintptr // jump - var pC16 uintptr - var pCrsr4 uintptr - // var res7 int32 at bp+496, 4 - // jump + var pC16 uintptr // jump var pC17 uintptr + var pCrsr4 uintptr + // var res8 int32 at bp+528, 4 + // jump + var pC18 uintptr var pCrsr5 uintptr - // var res8 int32 at bp+500, 4 + // var res9 int32 at bp+532, 4 var sz I64 // jump - var pC18 uintptr + var pC19 uintptr var pCrsr6 uintptr - // var res9 int32 at bp+504, 4 + // var res10 int32 at bp+536, 4 // jump - var pC19 uintptr // in2 - var pC20 uintptr - // var x2 BtreePayload at bp+512, 48 - // in2 + var pC20 uintptr // in2 var pC21 uintptr + // var x2 BtreePayload at bp+544, 48 + // in2 var pC22 uintptr + var pC23 uintptr var pCrsr7 uintptr - // var res10 int32 at bp+584, 4 + // var res11 int32 at bp+616, 4 - // var r2 UnpackedRecord at bp+560, 24 + // var r3 UnpackedRecord at bp+592, 24 // out2 - var pC23 uintptr // The P1 index cursor + var pC24 uintptr // The P1 index cursor var pTabCur uintptr // The P2 table cursor (OP_DeferredSeek only) - // var rowid I64 at bp+592, 8 + // var rowid I64 at bp+624, 8 - var pC24 uintptr // jump var pC25 uintptr - // var res11 int32 at bp+624, 4 - - // var r3 UnpackedRecord at bp+600, 24 + var nCellKey I64 + var pCur1 uintptr + // var m Mem at bp+632, 56 + // jump + var pC26 uintptr + var res12 int32 + // var r4 UnpackedRecord at bp+688, 24 // out2 - // var iMoved int32 at bp+628, 4 + // var iMoved int32 at bp+712, 4 var iDb2 int32 - // var nChange int32 at bp+632, 4 + // var nChange int32 at bp+716, 4 - var pC26 uintptr // out2 - // var pgno Pgno at bp+636, 4 + var pC27 uintptr // out2 + // var pgno Pgno at bp+720, 4 var pDb2 uintptr var iDb3 int32 var zSchema uintptr var zSql uintptr - // var initData InitData at bp+640, 40 + // var initData InitData at bp+728, 40 var nRoot int32 // Number of tables to check. (Number of root pages.) var aRoot uintptr // Array of rootpage numbers for tables to be checked - // var nErr int32 at bp+680, 4 + // var nErr int32 at bp+768, 4 // Number of errors reported var z uintptr // Text of the error report var pnErr uintptr // jump, in1, out3 - // var val I64 at bp+688, 8 + // var val I64 at bp+776, 8 // jump, in1, in3 var iSet int32 var exists int32 // jump @@ -61479,7 +61718,7 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: * var pFrame3 uintptr var pIn uintptr // in2 var pFrame4 uintptr // in1, out2, in3 - // var x3 I64 at bp+696, 8 + // var x3 I64 at bp+784, 8 var n4 int32 var pCtx uintptr @@ -61488,7 +61727,7 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: * var pMem3 uintptr var pMem4 uintptr var i5 int32 // Loop counter - // var aRes [3]int32 at bp+704, 12 + // var aRes [3]int32 at bp+792, 12 // Results var pMem5 uintptr // out2 var pBt1 uintptr // Btree to change journal mode of @@ -61497,17 +61736,17 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: * var eOld int32 // The old journal mode var zFilename uintptr // jump var pBt2 uintptr - var pC27 uintptr var pC28 uintptr + var pC29 uintptr var z1 uintptr var p13 int32 var isWriteLock U8 var pVTab uintptr - // var sMem1 Mem at bp+720, 56 + // var sMem1 Mem at bp+808, 56 // For storing the record being decoded var zTab uintptr - var pCur1 uintptr - // var pVCur uintptr at bp+776, 8 + var pCur2 uintptr + // var pVCur uintptr at bp+864, 8 var pVtab1 uintptr var pModule1 uintptr // jump @@ -61518,20 +61757,20 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: * var pArgc uintptr var pVCur1 uintptr var pVtab2 uintptr - var pCur2 uintptr - var res12 int32 + var pCur3 uintptr + var res13 int32 var i6 int32 var apArg uintptr var pVtab3 uintptr var pModule3 uintptr - var pDest1 uintptr - // var sContext Sqlite3_context at bp+784, 56 + var pDest2 uintptr + // var sContext Sqlite3_context at bp+872, 56 - var pCur3 uintptr // jump + var pCur4 uintptr // jump var pVtab4 uintptr var pModule4 uintptr - var res13 int32 - var pCur4 uintptr + var res14 int32 + var pCur5 uintptr var pVtab5 uintptr var pName uintptr var isLegacy int32 @@ -61540,7 +61779,7 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: * var pModule5 uintptr var nArg1 int32 var i7 int32 - // var rowid1 Sqlite_int64 at bp+840, 8 + // var rowid1 Sqlite_int64 at bp+928, 8 var apArg1 uintptr var pX1 uintptr // out2 @@ -61595,7 +61834,7 @@ __3: (*Vdbe)(unsafe.Pointer(p)).FpResultSet = uintptr(0) (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 - if !(libc.AtomicLoadNInt32((db+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { + if !(libc.AtomicLoadNInt32((db+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { goto __4 } goto abort_due_to_interrupt @@ -61900,6 +62139,19 @@ __5: case OP_IntCopy: goto __29 + // Opcode: ChngCntRow P1 P2 * * * + // Synopsis: output=r[P1] + // + // Output value in register P1 as the chance count for a DML statement, + // due to the "PRAGMA count_changes=ON" setting. Or, if there was a + // foreign key error in the statement, trigger the error now. + // + // This opcode is a variant of OP_ResultRow that checks the foreign key + // immediate constraint count and throws an error if the count is + // non-zero. The P2 opcode must be 1. + case OP_ChngCntRow: + goto __30 + // Opcode: ResultRow P1 P2 * * * // Synopsis: output=r[P1@P2] // @@ -61909,7 +62161,7 @@ __5: // structure to provide access to the r(P1)..r(P1+P2-1) values as // the result row. case OP_ResultRow: - goto __30 + goto __31 // Opcode: Concat P1 P2 P3 * * // Synopsis: r[P3]=r[P2]+r[P1] @@ -61924,7 +62176,7 @@ __5: // if P3 is the same register as P2, the implementation is able // to avoid a memcpy(). case OP_Concat: - goto __31 + goto __32 // Opcode: Add P1 P2 P3 * * // Synopsis: r[P3]=r[P1]+r[P2] @@ -61960,15 +62212,15 @@ __5: // If the value in register P1 is zero the result is NULL. // If either operand is NULL, the result is NULL. case OP_Add: - goto __32 // same as TK_PLUS, in1, in2, out3 + goto __33 // same as TK_PLUS, in1, in2, out3 case OP_Subtract: - goto __33 // same as TK_MINUS, in1, in2, out3 + goto __34 // same as TK_MINUS, in1, in2, out3 case OP_Multiply: - goto __34 // same as TK_STAR, in1, in2, out3 + goto __35 // same as TK_STAR, in1, in2, out3 case OP_Divide: - goto __35 // same as TK_SLASH, in1, in2, out3 + goto __36 // same as TK_SLASH, in1, in2, out3 case OP_Remainder: - goto __36 + goto __37 // Opcode: CollSeq P1 * * P4 // @@ -61985,7 +62237,7 @@ __5: // to retrieve the collation sequence set by this opcode is not available // publicly. Only built-in functions have access to this feature. case OP_CollSeq: - goto __37 + goto __38 // Opcode: BitAnd P1 P2 P3 * * // Synopsis: r[P3]=r[P1]&r[P2] @@ -62014,13 +62266,13 @@ __5: // Store the result in register P3. // If either input is NULL, the result is NULL. case OP_BitAnd: - goto __38 // same as TK_BITAND, in1, in2, out3 + goto __39 // same as TK_BITAND, in1, in2, out3 case OP_BitOr: - goto __39 // same as TK_BITOR, in1, in2, out3 + goto __40 // same as TK_BITOR, in1, in2, out3 case OP_ShiftLeft: - goto __40 // same as TK_LSHIFT, in1, in2, out3 + goto __41 // same as TK_LSHIFT, in1, in2, out3 case OP_ShiftRight: - goto __41 + goto __42 // Opcode: AddImm P1 P2 * * * // Synopsis: r[P1]=r[P1]+P2 @@ -62030,7 +62282,7 @@ __5: // // To force any register to be an integer, just add 0. case OP_AddImm: - goto __42 + goto __43 // Opcode: MustBeInt P1 P2 * * * // @@ -62039,7 +62291,7 @@ __5: // without data loss, then jump immediately to P2, or if P2==0 // raise an SQLITE_MISMATCH exception. case OP_MustBeInt: - goto __43 + goto __44 // Opcode: RealAffinity P1 * * * * // @@ -62050,7 +62302,7 @@ __5: // integers, for space efficiency, but after extraction we want them // to have only a real value. case OP_RealAffinity: - goto __44 + goto __45 // Opcode: Cast P1 P2 * * * // Synopsis: affinity(r[P1]) @@ -62067,7 +62319,7 @@ __5: // // A NULL value is not changed by this routine. It remains NULL. case OP_Cast: - goto __45 + goto __46 // Opcode: Eq P1 P2 P3 P4 P5 // Synopsis: IF r[P3]==r[P1] @@ -62160,17 +62412,17 @@ __5: // the content of register P3 is greater than or equal to the content of // register P1. See the Lt opcode for additional information. case OP_Eq: - goto __46 // same as TK_EQ, jump, in1, in3 + goto __47 // same as TK_EQ, jump, in1, in3 case OP_Ne: - goto __47 // same as TK_NE, jump, in1, in3 + goto __48 // same as TK_NE, jump, in1, in3 case OP_Lt: - goto __48 // same as TK_LT, jump, in1, in3 + goto __49 // same as TK_LT, jump, in1, in3 case OP_Le: - goto __49 // same as TK_LE, jump, in1, in3 + goto __50 // same as TK_LE, jump, in1, in3 case OP_Gt: - goto __50 // same as TK_GT, jump, in1, in3 + goto __51 // same as TK_GT, jump, in1, in3 case OP_Ge: - goto __51 + goto __52 // Opcode: ElseNotEq * P2 * * * // @@ -62185,7 +62437,7 @@ __5: // jump to P2. If the result of an OP_Eq comparison on the two previous // operands would have been true (1), then fall through. case OP_ElseNotEq: - goto __52 + goto __53 // Opcode: Permutation * * * P4 * // @@ -62199,7 +62451,7 @@ __5: // The first integer in the P4 integer array is the length of the array // and does not become part of the permutation. case OP_Permutation: - goto __53 + goto __54 // Opcode: Compare P1 P2 P3 P4 P5 // Synopsis: r[P1@P3] <-> r[P2@P3] @@ -62221,7 +62473,7 @@ __5: // NULLs are less than numbers, numbers are less than strings, // and strings are less than blobs. case OP_Compare: - goto __54 + goto __55 // Opcode: Jump P1 P2 P3 * * // @@ -62229,7 +62481,7 @@ __5: // in the most recent OP_Compare instruction the P1 vector was less than // equal to, or greater than the P2 vector, respectively. case OP_Jump: - goto __55 + goto __56 // Opcode: And P1 P2 P3 * * // Synopsis: r[P3]=(r[P1] && r[P2]) @@ -62250,9 +62502,9 @@ __5: // even if the other input is NULL. A NULL and false or two NULLs // give a NULL output. case OP_And: - goto __56 // same as TK_AND, in1, in2, out3 + goto __57 // same as TK_AND, in1, in2, out3 case OP_Or: - goto __57 + goto __58 // Opcode: IsTrue P1 P2 P3 P4 * // Synopsis: r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4 @@ -62274,7 +62526,7 @@ __5: //
  • If P3==1 and P4==0 then r[P2] := r[P1] IS NOT FALSE // case OP_IsTrue: - goto __58 + goto __59 // Opcode: Not P1 P2 * * * // Synopsis: r[P2]= !r[P1] @@ -62283,7 +62535,7 @@ __5: // boolean complement in register P2. If the value in register P1 is // NULL, then a NULL is stored in P2. case OP_Not: - goto __59 + goto __60 // Opcode: BitNot P1 P2 * * * // Synopsis: r[P2]= ~r[P1] @@ -62292,7 +62544,7 @@ __5: // ones-complement of the P1 value into register P2. If P1 holds // a NULL then store a NULL in P2. case OP_BitNot: - goto __60 + goto __61 // Opcode: Once P1 P2 * * * // @@ -62311,7 +62563,7 @@ __5: // because the self-altering code trick does not work for recursive // triggers. case OP_Once: - goto __61 + goto __62 // Opcode: If P1 P2 P3 * * // @@ -62319,7 +62571,7 @@ __5: // is considered true if it is numeric and non-zero. If the value // in P1 is NULL then take the jump if and only if P3 is non-zero. case OP_If: - goto __62 + goto __63 // Opcode: IfNot P1 P2 P3 * * // @@ -62327,21 +62579,21 @@ __5: // is considered false if it has a numeric value of zero. If the value // in P1 is NULL then take the jump if and only if P3 is non-zero. case OP_IfNot: - goto __63 + goto __64 // Opcode: IsNull P1 P2 * * * // Synopsis: if r[P1]==NULL goto P2 // // Jump to P2 if the value in register P1 is NULL. case OP_IsNull: - goto __64 + goto __65 // Opcode: NotNull P1 P2 * * * // Synopsis: if r[P1]!=NULL goto P2 // // Jump to P2 if the value in register P1 is not NULL. case OP_NotNull: - goto __65 + goto __66 // Opcode: IfNullRow P1 P2 P3 * * // Synopsis: if P1.nullRow then r[P3]=NULL, goto P2 @@ -62351,7 +62603,7 @@ __5: // If P1 is not on a NULL row, then fall through without making any // changes. case OP_IfNullRow: - goto __66 + goto __67 // Opcode: Offset P1 P2 P3 * * // Synopsis: r[P3] = sqlite_offset(P1) @@ -62368,7 +62620,7 @@ __5: // This opcode is only available if SQLite is compiled with the // -DSQLITE_ENABLE_OFFSET_SQL_FUNC option. case OP_Offset: - goto __67 + goto __68 // Opcode: Column P1 P2 P3 P4 P5 // Synopsis: r[P3]=PX @@ -62390,7 +62642,7 @@ __5: // or typeof() function, respectively. The loading of large blobs can be // skipped for length() and all content loading can be skipped for typeof(). case OP_Column: - goto __68 + goto __69 // Opcode: Affinity P1 P2 * P4 * // Synopsis: affinity(r[P1@P2]) @@ -62401,7 +62653,7 @@ __5: // string indicates the column affinity that should be used for the N-th // memory cell in the range. case OP_Affinity: - goto __69 + goto __70 // Opcode: MakeRecord P1 P2 P3 P4 * // Synopsis: r[P3]=mkrec(r[P1@P2]) @@ -62430,7 +62682,7 @@ __5: // accept no-change records with serial_type 10. This value is // only used inside an assert() and does not affect the end result. case OP_MakeRecord: - goto __70 + goto __71 // Opcode: Count P1 P2 p3 * * // Synopsis: r[P2]=count() @@ -62442,7 +62694,7 @@ __5: // every btree page of the table. But if P3 is non-zero, an estimate // is returned based on the current cursor position. case OP_Count: - goto __71 + goto __72 // Opcode: Savepoint P1 * * P4 * // @@ -62451,7 +62703,7 @@ __5: // To release (commit) an existing savepoint set P1==1 (SAVEPOINT_RELEASE). // To rollback an existing savepoint set P1==2 (SAVEPOINT_ROLLBACK). case OP_Savepoint: - goto __72 + goto __73 // Opcode: AutoCommit P1 P2 * * * // @@ -62462,7 +62714,7 @@ __5: // // This instruction causes the VM to halt. case OP_AutoCommit: - goto __73 + goto __74 // Opcode: Transaction P1 P2 P3 P4 P5 // @@ -62470,7 +62722,8 @@ __5: // active. // If P2 is non-zero, then a write-transaction is started, or if a // read-transaction is already active, it is upgraded to a write-transaction. - // If P2 is zero, then a read-transaction is started. + // If P2 is zero, then a read-transaction is started. If P2 is 2 or more + // then an exclusive transaction is started. // // P1 is the index of the database file on which the transaction is // started. Index 0 is the main database file and index 1 is the @@ -62498,7 +62751,7 @@ __5: // halts. The sqlite3_step() wrapper function might then reprepare the // statement and rerun it from the beginning. case OP_Transaction: - goto __74 + goto __75 // Opcode: ReadCookie P1 P2 P3 * * // @@ -62512,7 +62765,7 @@ __5: // must be started or there must be an open cursor) before // executing this instruction. case OP_ReadCookie: - goto __75 + goto __76 // Opcode: SetCookie P1 P2 P3 * P5 // @@ -62529,7 +62782,7 @@ __5: // has P5 set to 1, so that the internal schema version will be different // from the database schema version, resulting in a schema reset. case OP_SetCookie: - goto __76 + goto __77 // Opcode: OpenRead P1 P2 P3 P4 P5 // Synopsis: root=P2 iDb=P3 @@ -62613,13 +62866,13 @@ __5: // // See also: OP_OpenRead, OP_ReopenIdx case OP_ReopenIdx: - goto __77 + goto __78 // If the cursor is not currently open or is open on a different // index, then fall through into OP_OpenRead to force a reopen case OP_OpenRead: - goto __78 - case OP_OpenWrite: goto __79 + case OP_OpenWrite: + goto __80 // Opcode: OpenDup P1 P2 * * * // @@ -62629,9 +62882,9 @@ __5: // // Duplicate ephemeral cursors are used for self-joins of materialized views. case OP_OpenDup: - goto __80 + goto __81 - // Opcode: OpenEphemeral P1 P2 * P4 P5 + // Opcode: OpenEphemeral P1 P2 P3 P4 P5 // Synopsis: nColumn=P2 // // Open a new cursor P1 to a transient table. @@ -62651,6 +62904,10 @@ __5: // in btree.h. These flags control aspects of the operation of // the btree. The BTREE_OMIT_JOURNAL and BTREE_SINGLE flags are // added automatically. + // + // If P3 is positive, then reg[P3] is modified slightly so that it + // can be used as zero-length data for OP_Insert. This is an optimization + // that avoids an extra OP_Blob opcode to initialize that register. // Opcode: OpenAutoindex P1 P2 * P4 * // Synopsis: nColumn=P2 // @@ -62659,9 +62916,9 @@ __5: // by this opcode will be used for automatically created transient // indices in joins. case OP_OpenAutoindex: - goto __81 - case OP_OpenEphemeral: goto __82 + case OP_OpenEphemeral: + goto __83 // Opcode: SorterOpen P1 P2 P3 P4 * // @@ -62673,7 +62930,7 @@ __5: // assume that a stable sort considering the first P3 fields of each // key is sufficient to produce the required results. case OP_SorterOpen: - goto __83 + goto __84 // Opcode: SequenceTest P1 P2 * * * // Synopsis: if( cursor[P1].ctr++ ) pc = P2 @@ -62682,7 +62939,7 @@ __5: // to P2. Regardless of whether or not the jump is taken, increment the // the sequence value. case OP_SequenceTest: - goto __84 + goto __85 // Opcode: OpenPseudo P1 P2 P3 * * // Synopsis: P3 columns in r[P2] @@ -62700,14 +62957,14 @@ __5: // P3 is the number of fields in the records that will be stored by // the pseudo-table. case OP_OpenPseudo: - goto __85 + goto __86 // Opcode: Close P1 * * * * // // Close a cursor previously opened as P1. If P1 is not // currently open, this instruction is a no-op. case OP_Close: - goto __86 + goto __87 // Opcode: SeekGE P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] @@ -62796,31 +63053,84 @@ __5: // // See also: Found, NotFound, SeekGt, SeekGe, SeekLt case OP_SeekLT: - goto __87 // jump, in3, group - case OP_SeekLE: goto __88 // jump, in3, group - case OP_SeekGE: + case OP_SeekLE: goto __89 // jump, in3, group + case OP_SeekGE: + goto __90 // jump, in3, group case OP_SeekGT: - goto __90 - - // Opcode: SeekHit P1 P2 * * * - // Synopsis: seekHit=P2 - // - // Set the seekHit flag on cursor P1 to the value in P2. - // The seekHit flag is used by the IfNoHope opcode. - // - // P1 must be a valid b-tree cursor. P2 must be a boolean value, - // either 0 or 1. - case OP_SeekHit: goto __91 + // Opcode: SeekScan P1 P2 * * * + // Synopsis: Scan-ahead up to P1 rows + // + // This opcode is a prefix opcode to OP_SeekGE. In other words, this + // opcode must be immediately followed by OP_SeekGE. This constraint is + // checked by assert() statements. + // + // This opcode uses the P1 through P4 operands of the subsequent + // OP_SeekGE. In the text that follows, the operands of the subsequent + // OP_SeekGE opcode are denoted as SeekOP.P1 through SeekOP.P4. Only + // the P1 and P2 operands of this opcode are also used, and are called + // This.P1 and This.P2. + // + // This opcode helps to optimize IN operators on a multi-column index + // where the IN operator is on the later terms of the index by avoiding + // unnecessary seeks on the btree, substituting steps to the next row + // of the b-tree instead. A correct answer is obtained if this opcode + // is omitted or is a no-op. + // + // The SeekGE.P3 and SeekGE.P4 operands identify an unpacked key which + // is the desired entry that we want the cursor SeekGE.P1 to be pointing + // to. Call this SeekGE.P4/P5 row the "target". + // + // If the SeekGE.P1 cursor is not currently pointing to a valid row, + // then this opcode is a no-op and control passes through into the OP_SeekGE. + // + // If the SeekGE.P1 cursor is pointing to a valid row, then that row + // might be the target row, or it might be near and slightly before the + // target row. This opcode attempts to position the cursor on the target + // row by, perhaps by invoking sqlite3BtreeStep() on the cursor + // between 0 and This.P1 times. + // + // There are three possible outcomes from this opcode:
      + // + //
    1. If after This.P1 steps, the cursor is still point to a place that + // is earlier in the btree than the target row, + // then fall through into the subsquence OP_SeekGE opcode. + // + //
    2. If the cursor is successfully moved to the target row by 0 or more + // sqlite3BtreeNext() calls, then jump to This.P2, which will land just + // past the OP_IdxGT opcode that follows the OP_SeekGE. + // + //
    3. If the cursor ends up past the target row (indicating the the target + // row does not exist in the btree) then jump to SeekOP.P2. + //
    + case OP_SeekScan: + goto __92 + + // Opcode: SeekHit P1 P2 P3 * * + // Synopsis: set P2<=seekHit<=P3 + // + // Increase or decrease the seekHit value for cursor P1, if necessary, + // so that it is no less than P2 and no greater than P3. + // + // The seekHit integer represents the maximum of terms in an index for which + // there is known to be at least one match. If the seekHit value is smaller + // than the total number of equality terms in an index lookup, then the + // OP_IfNoHope opcode might run to see if the IN loop can be abandoned + // early, thus saving work. This is part of the IN-early-out optimization. + // + // P1 must be a valid b-tree cursor. + case OP_SeekHit: + goto __93 + // Opcode: IfNotOpen P1 P2 * * * // Synopsis: if( !csr[P1] ) goto P2 // // If cursor P1 is not open, jump to instruction P2. Otherwise, fall through. case OP_IfNotOpen: - goto __92 + goto __94 // Opcode: Found P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] @@ -62860,16 +63170,20 @@ __5: // Synopsis: key=r[P3@P4] // // Register P3 is the first of P4 registers that form an unpacked - // record. + // record. Cursor P1 is an index btree. P2 is a jump destination. + // In other words, the operands to this opcode are the same as the + // operands to OP_NotFound and OP_IdxGT. // - // Cursor P1 is on an index btree. If the seekHit flag is set on P1, then - // this opcode is a no-op. But if the seekHit flag of P1 is clear, then - // check to see if there is any entry in P1 that matches the - // prefix identified by P3 and P4. If no entry matches the prefix, - // jump to P2. Otherwise fall through. + // This opcode is an optimization attempt only. If this opcode always + // falls through, the correct answer is still obtained, but extra works + // is performed. // - // This opcode behaves like OP_NotFound if the seekHit - // flag is clear and it behaves like OP_Noop if the seekHit flag is set. + // A value of N in the seekHit flag of cursor P1 means that there exists + // a key P3:N that will match some record in the index. We want to know + // if it is possible for a record P3:P4 to match some record in the + // index. If it is not possible, we can skips some work. So if seekHit + // is less than P4, attempt to find out if a match is possible by running + // OP_NotFound. // // This opcode is used in IN clause processing for a multi-column key. // If an IN clause is attached to an element of the key other than the @@ -62905,13 +63219,13 @@ __5: // // See also: NotFound, Found, NotExists case OP_IfNoHope: - goto __93 + goto __95 case OP_NoConflict: - goto __94 // jump, in3 + goto __96 // jump, in3 case OP_NotFound: - goto __95 // jump, in3 + goto __97 // jump, in3 case OP_Found: - goto __96 + goto __98 // Opcode: SeekRowid P1 P2 P3 * * // Synopsis: intkey=r[P3] @@ -62959,9 +63273,9 @@ __5: // // See also: Found, NotFound, NoConflict, SeekRowid case OP_SeekRowid: - goto __97 + goto __99 case OP_NotExists: - goto __98 + goto __100 // Opcode: Sequence P1 P2 * * * // Synopsis: r[P2]=cursor[P1].ctr++ @@ -62971,7 +63285,7 @@ __5: // The sequence number on the cursor is incremented after this // instruction. case OP_Sequence: - goto __99 + goto __101 // Opcode: NewRowid P1 P2 P3 * * // Synopsis: r[P2]=rowid @@ -62988,7 +63302,7 @@ __5: // generated record number. This P3 mechanism is used to help implement the // AUTOINCREMENT feature. case OP_NewRowid: - goto __100 + goto __102 // Opcode: Insert P1 P2 P3 P4 P5 // Synopsis: intkey=r[P3] data=r[P2] @@ -63027,7 +63341,20 @@ __5: // This instruction only works on tables. The equivalent instruction // for indices is OP_IdxInsert. case OP_Insert: - goto __101 + goto __103 + + // Opcode: RowCell P1 P2 P3 * * + // + // P1 and P2 are both open cursors. Both must be opened on the same type + // of table - intkey or index. This opcode is used as part of copying + // the current row from P2 into P1. If the cursors are opened on intkey + // tables, register P3 contains the rowid to use with the new record in + // P1. If they are opened on index tables, P3 is not used. + // + // This opcode must be followed by either an Insert or InsertIdx opcode + // with the OPFLAG_PREFORMAT flag set to complete the insert operation. + case OP_RowCell: + goto __104 // Opcode: Delete P1 P2 P3 P4 P5 // @@ -63064,7 +63391,7 @@ __5: // of the memory cell that contains the value that the rowid of the row will // be set to by the update. case OP_Delete: - goto __102 + goto __105 // Opcode: ResetCount * * * * * // // The value of the change counter is copied to the database handle @@ -63072,7 +63399,7 @@ __5: // Then the VMs internal change counter resets to 0. // This is used by trigger programs. case OP_ResetCount: - goto __103 + goto __106 // Opcode: SorterCompare P1 P2 P3 P4 // Synopsis: if key(P1)!=trim(r[P3],P4) goto P2 @@ -63089,7 +63416,7 @@ __5: // Fall through to next instruction if the two records compare equal to // each other. Jump to P2 if they are different. case OP_SorterCompare: - goto __104 + goto __107 // Opcode: SorterData P1 P2 P3 * * // Synopsis: r[P2]=data @@ -63103,7 +63430,7 @@ __5: // parameter P3. Clearing the P3 column cache as part of this opcode saves // us from having to issue a separate NullRow instruction to clear that cache. case OP_SorterData: - goto __105 + goto __108 // Opcode: RowData P1 P2 P3 * * // Synopsis: r[P2]=data @@ -63133,7 +63460,7 @@ __5: // The P2 register content is invalidated by opcodes like OP_Function or // by any use of another cursor pointing to the same table. case OP_RowData: - goto __106 + goto __109 // Opcode: Rowid P1 P2 * * * // Synopsis: r[P2]=rowid @@ -63145,7 +63472,7 @@ __5: // be a separate OP_VRowid opcode for use with virtual tables, but this // one opcode now works for both table types. case OP_Rowid: - goto __107 + goto __110 // Opcode: NullRow P1 * * * * // @@ -63153,7 +63480,7 @@ __5: // that occur while the cursor is on the null row will always // write a NULL. case OP_NullRow: - goto __108 + goto __111 // Opcode: SeekEnd P1 * * * * // @@ -63176,16 +63503,16 @@ __5: // from the end toward the beginning. In other words, the cursor is // configured to use Prev, not Next. case OP_SeekEnd: - goto __109 + goto __112 case OP_Last: - goto __110 + goto __113 // Opcode: IfSmaller P1 P2 P3 * * // // Estimate the number of rows in the table P1. Jump to P2 if that // estimate is less than approximately 2**(0.1*P3). case OP_IfSmaller: - goto __111 + goto __114 // Opcode: SorterSort P1 P2 * * * // @@ -63207,9 +63534,9 @@ __5: // regression tests can determine whether or not the optimizer is // correctly optimizing out sorts. case OP_SorterSort: - goto __112 // jump + goto __115 // jump case OP_Sort: - goto __113 + goto __116 // Opcode: Rewind P1 P2 * * * // // The next use of the Rowid or Column or Next instruction for P1 @@ -63222,7 +63549,7 @@ __5: // from the beginning toward the end. In other words, the cursor is // configured to use Next, not Prev. case OP_Rewind: - goto __114 + goto __117 // Opcode: Next P1 P2 P3 P4 P5 // @@ -63282,11 +63609,11 @@ __5: // invoked. This opcode advances the cursor to the next sorted // record, or jumps to P2 if there are no more sorted records. case OP_SorterNext: - goto __115 + goto __118 case OP_Prev: - goto __116 // jump + goto __119 // jump case OP_Next: - goto __117 + goto __120 // Opcode: IdxInsert P1 P2 P3 P4 P5 // Synopsis: key=r[P2] @@ -63316,7 +63643,7 @@ __5: // This instruction only works for indices. The equivalent instruction // for tables is OP_Insert. case OP_IdxInsert: - goto __118 + goto __121 // Opcode: SorterInsert P1 P2 * * * // Synopsis: key=r[P2] @@ -63325,7 +63652,7 @@ __5: // MakeRecord instructions. This opcode writes that key // into the sorter P1. Data for the entry is nil. case OP_SorterInsert: - goto __119 + goto __122 // Opcode: IdxDelete P1 P2 P3 * P5 // Synopsis: key=r[P2@P3] @@ -63341,7 +63668,7 @@ __5: // (example: the EXCEPT operator) it does not matter that no matching // entry is found. For those cases, P5 is zero. case OP_IdxDelete: - goto __120 + goto __123 // Opcode: DeferredSeek P1 * P3 P4 * // Synopsis: Move P3 to P1.rowid if needed @@ -63370,9 +63697,9 @@ __5: // // See also: Rowid, MakeRecord. case OP_DeferredSeek: - goto __121 + goto __124 case OP_IdxRowid: - goto __122 + goto __125 // Opcode: FinishSeek P1 * * * * // @@ -63380,9 +63707,9 @@ __5: // seek operation now, without further delay. If the cursor seek has // already occurred, this instruction is a no-op. case OP_FinishSeek: - goto __123 + goto __126 - // Opcode: IdxGE P1 P2 P3 P4 P5 + // Opcode: IdxGE P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -63392,7 +63719,7 @@ __5: // // If the P1 index entry is greater than or equal to the key value // then jump to P2. Otherwise fall through to the next instruction. - // Opcode: IdxGT P1 P2 P3 P4 P5 + // Opcode: IdxGT P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -63402,7 +63729,7 @@ __5: // // If the P1 index entry is greater than the key value // then jump to P2. Otherwise fall through to the next instruction. - // Opcode: IdxLT P1 P2 P3 P4 P5 + // Opcode: IdxLT P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -63412,7 +63739,7 @@ __5: // // If the P1 index entry is less than the key value then jump to P2. // Otherwise fall through to the next instruction. - // Opcode: IdxLE P1 P2 P3 P4 P5 + // Opcode: IdxLE P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -63423,13 +63750,13 @@ __5: // If the P1 index entry is less than or equal to the key value then jump // to P2. Otherwise fall through to the next instruction. case OP_IdxLE: - goto __124 // jump + goto __127 // jump case OP_IdxGT: - goto __125 // jump + goto __128 // jump case OP_IdxLT: - goto __126 // jump + goto __129 // jump case OP_IdxGE: - goto __127 + goto __130 // Opcode: Destroy P1 P2 P3 * * // @@ -63458,7 +63785,7 @@ __5: // // See also: Clear case OP_Destroy: - goto __128 + goto __131 // Opcode: Clear P1 P2 P3 // @@ -63478,7 +63805,7 @@ __5: // // See also: Destroy case OP_Clear: - goto __129 + goto __132 // Opcode: ResetSorter P1 * * * * // @@ -63488,7 +63815,7 @@ __5: // This opcode only works for cursors used for sorting and // opened with OP_OpenEphemeral or OP_SorterOpen. case OP_ResetSorter: - goto __130 + goto __133 // Opcode: CreateBtree P1 P2 P3 * * // Synopsis: r[P2]=root iDb=P1 flags=P3 @@ -63499,13 +63826,13 @@ __5: // it must be 2 (BTREE_BLOBKEY) for an index or WITHOUT ROWID table. // The root page number of the new b-tree is stored in register P2. case OP_CreateBtree: - goto __131 + goto __134 // Opcode: SqlExec * * * P4 * // // Run the SQL statement or statements specified in the P4 string. case OP_SqlExec: - goto __132 + goto __135 // Opcode: ParseSchema P1 * * P4 * // @@ -63516,7 +63843,7 @@ __5: // This opcode invokes the parser to create a new virtual machine, // then runs the new virtual machine. It is thus a re-entrant opcode. case OP_ParseSchema: - goto __133 + goto __136 // Opcode: LoadAnalysis P1 * * * * // @@ -63524,7 +63851,7 @@ __5: // of that table into the internal index hash table. This will cause // the analysis to be used when preparing all subsequent queries. case OP_LoadAnalysis: - goto __134 + goto __137 // Opcode: DropTable P1 * * P4 * // @@ -63534,7 +63861,7 @@ __5: // the internal representation of the // schema consistent with what is on disk. case OP_DropTable: - goto __135 + goto __138 // Opcode: DropIndex P1 * * P4 * // @@ -63544,7 +63871,7 @@ __5: // in order to keep the internal representation of the // schema consistent with what is on disk. case OP_DropIndex: - goto __136 + goto __139 // Opcode: DropTrigger P1 * * P4 * // @@ -63554,7 +63881,7 @@ __5: // the internal representation of the // schema consistent with what is on disk. case OP_DropTrigger: - goto __137 + goto __140 // Opcode: IntegrityCk P1 P2 P3 P4 P5 // @@ -63575,7 +63902,7 @@ __5: // // This opcode is used to implement the integrity_check pragma. case OP_IntegrityCk: - goto __138 + goto __141 // Opcode: RowSetAdd P1 P2 * * * // Synopsis: rowset(P1)=r[P2] @@ -63585,7 +63912,7 @@ __5: // // An assertion fails if P2 is not an integer. case OP_RowSetAdd: - goto __139 + goto __142 // Opcode: RowSetRead P1 P2 P3 * * // Synopsis: r[P3]=rowset(P1) @@ -63595,7 +63922,7 @@ __5: // Or, if RowSet object P1 is initially empty, leave P3 // unchanged and jump to instruction P2. case OP_RowSetRead: - goto __140 + goto __143 // Opcode: RowSetTest P1 P2 P3 P4 // Synopsis: if r[P3] in rowset(P1) goto P2 @@ -63620,7 +63947,7 @@ __5: // previously inserted as part of set X (only if it was previously // inserted as part of some other set). case OP_RowSetTest: - goto __141 + goto __144 // Opcode: Program P1 P2 P3 P4 P5 // @@ -63637,7 +63964,7 @@ __5: // // If P5 is non-zero, then recursive program invocation is enabled. case OP_Program: - goto __142 + goto __145 // Opcode: Param P1 P2 * * * // @@ -63651,7 +63978,7 @@ __5: // the value of the P1 argument to the value of the P1 argument to the // calling OP_Program instruction. case OP_Param: - goto __143 + goto __146 // Opcode: FkCounter P1 P2 * * * // Synopsis: fkctr[P1]+=P2 @@ -63661,7 +63988,7 @@ __5: // (deferred foreign key constraints). Otherwise, if P1 is zero, the // statement counter is incremented (immediate foreign key constraints). case OP_FkCounter: - goto __144 + goto __147 // Opcode: FkIfZero P1 P2 * * * // Synopsis: if fkctr[P1]==0 goto P2 @@ -63675,7 +64002,7 @@ __5: // zero, the jump is taken if the statement constraint-counter is zero // (immediate foreign key constraint violations). case OP_FkIfZero: - goto __145 + goto __148 // Opcode: MemMax P1 P2 * * * // Synopsis: r[P1]=max(r[P1],r[P2]) @@ -63688,7 +64015,7 @@ __5: // This instruction throws an error if the memory cell is not initially // an integer. case OP_MemMax: - goto __146 + goto __149 // Opcode: IfPos P1 P2 P3 * * // Synopsis: if r[P1]>0 then r[P1]-=P3, goto P2 @@ -63700,7 +64027,7 @@ __5: // If the initial value of register P1 is less than 1, then the // value is unchanged and control passes through to the next instruction. case OP_IfPos: - goto __147 + goto __150 // Opcode: OffsetLimit P1 P2 P3 * * // Synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) @@ -63720,7 +64047,7 @@ __5: // // Otherwise, r[P2] is set to the sum of r[P1] and r[P3]. case OP_OffsetLimit: - goto __148 + goto __151 // Opcode: IfNotZero P1 P2 * * * // Synopsis: if r[P1]!=0 then r[P1]--, goto P2 @@ -63730,7 +64057,7 @@ __5: // If it is non-zero (negative or positive) and then also jump to P2. // If register P1 is initially zero, leave it unchanged and fall through. case OP_IfNotZero: - goto __149 + goto __152 // Opcode: DecrJumpZero P1 P2 * * * // Synopsis: if (--r[P1])==0 goto P2 @@ -63738,7 +64065,7 @@ __5: // Register P1 must hold an integer. Decrement the value in P1 // and jump to P2 if the new value is exactly zero. case OP_DecrJumpZero: - goto __150 + goto __153 // Opcode: AggStep * P2 P3 P4 P5 // Synopsis: accum=r[P3] step(r[P2@P5]) @@ -63777,11 +64104,11 @@ __5: // sqlite3_context only happens once, instead of on each call to the // step function. case OP_AggInverse: - goto __151 + goto __154 case OP_AggStep: - goto __152 + goto __155 case OP_AggStep1: - goto __153 + goto __156 // Opcode: AggFinal P1 P2 * P4 * // Synopsis: accum=r[P1] N=P2 @@ -63808,9 +64135,9 @@ __5: // P4 argument is only needed for the case where // the step function was not previously called. case OP_AggValue: - goto __154 + goto __157 case OP_AggFinal: - goto __155 + goto __158 // Opcode: Checkpoint P1 P2 P3 * * // @@ -63823,7 +64150,7 @@ __5: // completes into mem[P3+2]. However on an error, mem[P3+1] and // mem[P3+2] are initialized to -1. case OP_Checkpoint: - goto __156 + goto __159 // Opcode: JournalMode P1 P2 P3 * * // @@ -63836,7 +64163,7 @@ __5: // // Write a string containing the final journal-mode to register P2. case OP_JournalMode: - goto __157 + goto __160 // Opcode: Vacuum P1 P2 * * * // @@ -63847,7 +64174,7 @@ __5: // the file into which the result of vacuum should be written. When // P2 is zero, the vacuum overwrites the original database. case OP_Vacuum: - goto __158 + goto __161 // Opcode: IncrVacuum P1 P2 * * * // @@ -63855,7 +64182,7 @@ __5: // the P1 database. If the vacuum has finished, jump to instruction // P2. Otherwise, fall through to the next instruction. case OP_IncrVacuum: - goto __159 + goto __162 // Opcode: Expire P1 P2 * * * // @@ -63873,21 +64200,21 @@ __5: // that might help the statement run faster but which does not affect the // correctness of operation. case OP_Expire: - goto __160 + goto __163 // Opcode: CursorLock P1 * * * * // // Lock the btree to which cursor P1 is pointing so that the btree cannot be // written by an other cursor. case OP_CursorLock: - goto __161 + goto __164 // Opcode: CursorUnlock P1 * * * * // // Unlock the btree to which cursor P1 is pointing so that it can be // written by other cursors. case OP_CursorUnlock: - goto __162 + goto __165 // Opcode: TableLock P1 P2 P3 P4 * // Synopsis: iDb=P1 root=P2 write=P3 @@ -63904,7 +64231,7 @@ __5: // P4 contains a pointer to the name of the table being locked. This is only // used to generate an error message if the lock cannot be obtained. case OP_TableLock: - goto __163 + goto __166 // Opcode: VBegin * * * P4 * // @@ -63915,21 +64242,21 @@ __5: // within a callback to a virtual table xSync() method. If it is, the error // code will be set to SQLITE_LOCKED. case OP_VBegin: - goto __164 + goto __167 // Opcode: VCreate P1 P2 * * * // // P2 is a register that holds the name of a virtual table in database // P1. Call the xCreate method for that table. case OP_VCreate: - goto __165 + goto __168 // Opcode: VDestroy P1 * * P4 * // // P4 is the name of a virtual table in database P1. Call the xDestroy method // of that table. case OP_VDestroy: - goto __166 + goto __169 // Opcode: VOpen P1 * * P4 * // @@ -63937,7 +64264,7 @@ __5: // P1 is a cursor number. This opcode opens a cursor to the virtual // table and stores that cursor in P1. case OP_VOpen: - goto __167 + goto __170 // Opcode: VFilter P1 P2 P3 P4 * // Synopsis: iplan=r[P3] zplan='P4' @@ -63958,7 +64285,7 @@ __5: // // A jump is made to P2 if the result set after filtering would be empty. case OP_VFilter: - goto __168 + goto __171 // Opcode: VColumn P1 P2 P3 * P5 // Synopsis: r[P3]=vcolumn(P2) @@ -63974,7 +64301,7 @@ __5: // bits (OPFLAG_LENGTHARG or OPFLAG_TYPEOFARG) but those bits are // unused by OP_VColumn. case OP_VColumn: - goto __169 + goto __172 // Opcode: VNext P1 P2 * * * // @@ -63982,7 +64309,7 @@ __5: // jump to instruction P2. Or, if the virtual table has reached // the end of its result set, then fall through to the next instruction. case OP_VNext: - goto __170 + goto __173 // Opcode: VRename P1 * * P4 * // @@ -63990,7 +64317,7 @@ __5: // This opcode invokes the corresponding xRename method. The value // in register P1 is passed as the zName argument to the xRename method. case OP_VRename: - goto __171 + goto __174 // Opcode: VUpdate P1 P2 P3 P4 P5 // Synopsis: data=r[P3@P2] @@ -64019,13 +64346,13 @@ __5: // P5 is the error actions (OE_Replace, OE_Fail, OE_Ignore, etc) to // apply in the case of a constraint failure on an insert or update. case OP_VUpdate: - goto __172 + goto __175 // Opcode: Pagecount P1 P2 * * * // // Write the current number of pages in database P1 to memory cell P2. case OP_Pagecount: - goto __173 + goto __176 // Opcode: MaxPgcnt P1 P2 P3 * * // @@ -64035,7 +64362,7 @@ __5: // // Store the maximum page count after the change in register P2. case OP_MaxPgcnt: - goto __174 + goto __177 // Opcode: Function P1 P2 P3 P4 * // Synopsis: r[P3]=func(r[P2@NP]) @@ -64082,9 +64409,9 @@ __5: // // See also: AggStep, AggFinal, Function case OP_PureFunc: - goto __175 // group + goto __178 // group case OP_Function: - goto __176 + goto __179 // Opcode: Trace P1 P2 * P4 * // @@ -64110,9 +64437,9 @@ __5: // If P3 is not zero, then it is an address to jump to if an SQLITE_CORRUPT // error is encountered. case OP_Trace: - goto __177 + goto __180 case OP_Init: - goto __178 + goto __181 // Opcode: Noop * * * * * // @@ -64123,7 +64450,7 @@ __5: // This opcode records information from the optimizer. It is the // the same as a no-op. This opcodesnever appears in a real VM program. default: - goto __179 + goto __182 } goto __8 @@ -64190,33 +64517,33 @@ jump_to_p2_and_check_for_interrupt: // checks on every opcode. This helps sqlite3_step() to run about 1.5% // faster according to "valgrind --tool=cachegrind" check_for_interrupt: - if !(libc.AtomicLoadNInt32((db+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { - goto __180 + if !(libc.AtomicLoadNInt32((db+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { + goto __183 } goto abort_due_to_interrupt -__180: +__183: ; // Call the progress callback if it is configured and the required number // of VDBE ops have been executed (either since this invocation of // sqlite3VdbeExec() or since last time the progress callback was called). // If the progress callback returns non-zero, exit the virtual machine with // a return code SQLITE_ABORT. -__181: +__184: if !((nVmStep >= nProgressLimit) && ((*Sqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0))) { - goto __182 + goto __185 } nProgressLimit = nProgressLimit + (U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)) - if !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 504 /* &.xProgress */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) { - goto __183 + if !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 512 /* &.xProgress */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) { + goto __186 } nProgressLimit = (uint64(0xffffffff) | (U64((uint64(0xffffffff))) << 32)) rc = SQLITE_INTERRUPT goto abort_due_to_error -__183: +__186: ; - goto __181 -__182: + goto __184 +__185: ; goto __8 @@ -64229,7 +64556,7 @@ __10: // jump ; pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64((int32((int64(pOp) - int64(aOp)) / 24))) // Most jump operations do a goto to this spot in order to update @@ -64246,7 +64573,7 @@ __11: // in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pOp = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*24) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Undefined) goto __8 // Opcode: InitCoroutine P1 P2 P3 * * @@ -64265,12 +64592,12 @@ __12: // jump pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = (I64((*Op)(unsafe.Pointer(pOp)).Fp3 - 1)) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) if !((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) { - goto __184 + goto __187 } goto jump_to_p2 -__184: +__187: ; goto __8 @@ -64287,7 +64614,7 @@ __13: pCaller = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*24) pOp = (aOp + uintptr(((*VdbeOp)(unsafe.Pointer(pCaller)).Fp2-1))*24) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Undefined) goto __8 // Opcode: Yield P1 P2 * * * @@ -64305,7 +64632,7 @@ __13: __14: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Int) pcDest = int32(*(*I64)(unsafe.Pointer(pIn1 /* &.u */))) *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64((int32((int64(pOp) - int64(aOp)) / 24))) @@ -64322,10 +64649,10 @@ __14: __15: // in3 pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !((int32((*Mem)(unsafe.Pointer(pIn3)).Fflags) & MEM_Null) == 0) { - goto __185 + goto __188 } goto __8 -__185: +__188: ; // Opcode: Halt P1 P2 * P4 P5 @@ -64361,7 +64688,7 @@ __16: pcx = (int32((int64(pOp) - int64(aOp)) / 24)) if !(((*Op)(unsafe.Pointer(pOp)).Fp1 == SQLITE_OK) && ((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0)) { - goto __186 + goto __189 } // Halt the sub-program. Return control to the parent frame. pFrame = (*Vdbe)(unsafe.Pointer(p)).FpFrame @@ -64370,7 +64697,7 @@ __16: Xsqlite3VdbeSetChanges(tls, db, (*Vdbe)(unsafe.Pointer(p)).FnChange) pcx = Xsqlite3VdbeFrameRestore(tls, pFrame) if !((*Op)(unsafe.Pointer(pOp)).Fp2 == OE_Ignore) { - goto __187 + goto __190 } // Instruction pcx is the OP_Program that invoked the sub-program // currently being halted. If the p2 instruction of this OP_Halt @@ -64378,48 +64705,48 @@ __16: // an IGNORE exception. In this case jump to the address specified // as the p2 of the calling OP_Program. pcx = ((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(pcx)*24)).Fp2 - 1) -__187: +__190: ; aOp = (*Vdbe)(unsafe.Pointer(p)).FaOp aMem = (*Vdbe)(unsafe.Pointer(p)).FaMem pOp = (aOp + uintptr(pcx)*24) goto __8 -__186: +__189: ; (*Vdbe)(unsafe.Pointer(p)).Frc = (*Op)(unsafe.Pointer(pOp)).Fp1 (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8((*Op)(unsafe.Pointer(pOp)).Fp2) (*Vdbe)(unsafe.Pointer(p)).Fpc = pcx if !((*Vdbe)(unsafe.Pointer(p)).Frc != 0) { - goto __188 - } - if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) { - goto __189 - } - - Xsqlite3VdbeError(tls, p, ts+4386 /* "%s constraint fa..." */, libc.VaList(bp, azType[(int32((*Op)(unsafe.Pointer(pOp)).Fp5)-1)])) - if !(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) != 0) { goto __191 } - (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+4407 /* "%z: %s" */, libc.VaList(bp+8, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) + if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) { + goto __192 + } + + Xsqlite3VdbeError(tls, p, ts+4414 /* "%s constraint fa..." */, libc.VaList(bp, azType[(int32((*Op)(unsafe.Pointer(pOp)).Fp5)-1)])) + if !(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) != 0) { + goto __194 + } + (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+4435 /* "%z: %s" */, libc.VaList(bp+8, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) +__194: + ; + goto __193 +__192: + Xsqlite3VdbeError(tls, p, ts+2718 /* "%s" */, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) +__193: + ; + Xsqlite3_log(tls, (*Op)(unsafe.Pointer(pOp)).Fp1, ts+4442 /* "abort at %d in [..." */, libc.VaList(bp+32, pcx, (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)) __191: - ; - goto __190 -__189: - Xsqlite3VdbeError(tls, p, ts+2690 /* "%s" */, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) -__190: - ; - Xsqlite3_log(tls, (*Op)(unsafe.Pointer(pOp)).Fp1, ts+4414 /* "abort at %d in [..." */, libc.VaList(bp+32, pcx, (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)) -__188: ; rc = Xsqlite3VdbeHalt(tls, p) if !(rc == SQLITE_BUSY) { - goto __192 + goto __195 } (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_BUSY - goto __193 -__192: + goto __196 +__195: ; if (*Vdbe)(unsafe.Pointer(p)).Frc != 0 { @@ -64427,7 +64754,7 @@ __192: } else { rc = SQLITE_DONE } -__193: +__196: ; goto vdbe_return @@ -64458,7 +64785,7 @@ __18: // out2 // Write that value into register P2. __19: // same as TK_FLOAT, out2 pOut = out2Prerelease(tls, p, pOp) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Real + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Real) *(*float64)(unsafe.Pointer(pOut /* &.u */)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) goto __8 @@ -64476,43 +64803,43 @@ __20: // same as TK_STRING, out2 (*Op)(unsafe.Pointer(pOp)).Fp1 = Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) if !(int32(encoding) != SQLITE_UTF8) { - goto __194 - } - rc = Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), -1, SQLITE_UTF8, uintptr(0)) - - if !(rc != 0) { - goto __195 - } - goto too_big -__195: - ; - if !(SQLITE_OK != Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding))) { - goto __196 - } - goto no_mem -__196: - ; - - (*Mem)(unsafe.Pointer(pOut)).FszMalloc = 0 - *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Static)) - if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-7)) { goto __197 } - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) -__197: - ; - (*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-7) - *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = (*Mem)(unsafe.Pointer(pOut)).Fz - (*Op)(unsafe.Pointer(pOp)).Fp1 = (*Mem)(unsafe.Pointer(pOut)).Fn -__194: - ; - if !((*Op)(unsafe.Pointer(pOp)).Fp1 > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) { + rc = Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), -1, uint8(SQLITE_UTF8), uintptr(0)) + + if !(rc != 0) { goto __198 } goto too_big __198: ; - (*Op)(unsafe.Pointer(pOp)).Fopcode = OP_String + if !(SQLITE_OK != Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding))) { + goto __199 + } + goto no_mem +__199: + ; + + (*Mem)(unsafe.Pointer(pOut)).FszMalloc = 0 + *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Static)) + if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-7)) { + goto __200 + } + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) +__200: + ; + (*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-7) + *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = (*Mem)(unsafe.Pointer(pOut)).Fz + (*Op)(unsafe.Pointer(pOp)).Fp1 = (*Mem)(unsafe.Pointer(pOut)).Fn +__197: + ; + if !((*Op)(unsafe.Pointer(pOp)).Fp1 > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) { + goto __201 + } + goto too_big +__201: + ; + (*Op)(unsafe.Pointer(pOp)).Fopcode = U8(OP_String) // Opcode: String P1 P2 P3 P4 P5 // Synopsis: r[P2]='P4' (len=P1) @@ -64554,12 +64881,12 @@ __22: if (*Op)(unsafe.Pointer(pOp)).Fp1 != 0 { return (uint16(MEM_Null | MEM_Cleared)) } - return MEM_Null + return uint16(MEM_Null) }()) (*Mem)(unsafe.Pointer(pOut)).Fn = 0 -__199: +__202: if !(cnt > 0) { - goto __200 + goto __203 } pOut += 56 @@ -64567,8 +64894,8 @@ __199: (*Mem)(unsafe.Pointer(pOut)).Fflags = nullFlag (*Mem)(unsafe.Pointer(pOut)).Fn = 0 cnt-- - goto __199 -__200: + goto __202 +__203: ; goto __8 @@ -64611,17 +64938,17 @@ __25: // Value being transferred pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1-1))*56) if !(Xsqlite3VdbeMemTooBig(tls, pVar) != 0) { - goto __201 + goto __204 } goto too_big -__201: +__204: ; pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) if !((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0) { - goto __202 + goto __205 } Xsqlite3VdbeMemSetNull(tls, pOut) -__202: +__205: ; libc.Xmemcpy(tls, pOut, pVar, uint64((uintptr(0) + 24 /* &.zMalloc */))) *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32((MEM_Dyn | MEM_Ephem)))) @@ -64645,26 +64972,26 @@ __26: // Register to copy to pIn1 = (aMem + uintptr(p1)*56) pOut = (aMem + uintptr(p2)*56) -__203: +__206: ; Xsqlite3VdbeMemMove(tls, pOut, pIn1) if !(((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & MEM_Ephem) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0)) { - goto __206 + goto __209 } goto no_mem -__206: +__209: ; pIn1 += 56 pOut += 56 - goto __204 -__204: + goto __207 +__207: if libc.PreDecInt32(&n, 1) != 0 { - goto __203 + goto __206 } - goto __205 -__205: + goto __208 +__208: ; goto __8 @@ -64681,29 +65008,29 @@ __27: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) -__207: +__210: if !(1 != 0) { - goto __208 + goto __211 } Xsqlite3VdbeMemShallowCopy(tls, pOut, pIn1, MEM_Ephem) if !(((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & MEM_Ephem) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0)) { - goto __209 + goto __212 } goto no_mem -__209: +__212: ; if !((libc.PostDecInt32(&n1, 1)) == 0) { - goto __210 + goto __213 } - goto __208 -__210: + goto __211 +__213: ; pOut += 56 pIn1 += 56 - goto __207 -__208: + goto __210 +__211: ; goto __8 @@ -64740,6 +65067,25 @@ __29: // out2 Xsqlite3VdbeMemSetInt64(tls, pOut, *(*I64)(unsafe.Pointer(pIn1 /* &.u */))) goto __8 + // Opcode: ChngCntRow P1 P2 * * * + // Synopsis: output=r[P1] + // + // Output value in register P1 as the chance count for a DML statement, + // due to the "PRAGMA count_changes=ON" setting. Or, if there was a + // foreign key error in the statement, trigger the error now. + // + // This opcode is a variant of OP_ResultRow that checks the foreign key + // immediate constraint count and throws an error if the count is + // non-zero. The P2 opcode must be 1. +__30: + ; + if !((libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 0))) != SQLITE_OK) { + goto __214 + } + goto abort_due_to_error +__214: + ; + // Opcode: ResultRow P1 P2 * * * // Synopsis: output=r[P1@P2] // @@ -64748,37 +65094,9 @@ __29: // out2 // with an SQLITE_ROW return code and it sets up the sqlite3_stmt // structure to provide access to the r(P1)..r(P1+P2-1) values as // the result row. -__30: +__31: ; - // If this statement has violated immediate foreign key constraints, do - // not return the number of rows modified. And do not RELEASE the statement - // transaction. It needs to be rolled back. - if !(SQLITE_OK != (libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 0)))) { - goto __211 - } - - goto abort_due_to_error -__211: - ; - - // If the SQLITE_CountRows flag is set in sqlite3.flags mask, then - // DML statements invoke this opcode to return the number of rows - // modified to the user. This is the only way that a VM that - // opens a statement transaction may invoke this opcode. - // - // In case this is such a statement, close any statement transaction - // opened by this VM before returning control to the user. This is to - // ensure that statement-transactions are always nested, not overlapping. - // If the open statement-transaction is not closed here, then the user - // may step another VM that opens its own statement transaction. This - // may lead to overlapping statement transactions. - // - // The statement transaction is never a top-level transaction. Hence - // the RELEASE call below can never fail. - - rc = Xsqlite3VdbeCloseStatement(tls, p, SAVEPOINT_RELEASE) - // Invalidate all ephemeral cursor row caches (*Vdbe)(unsafe.Pointer(p)).FcacheCtr = (((*Vdbe)(unsafe.Pointer(p)).FcacheCtr + U32(2)) | U32(1)) @@ -64787,39 +65105,39 @@ __211: // a side effect. pMem = libc.AssignPtrUintptr(p+160 /* &.pResultSet */, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)) i = 0 -__212: +__215: if !(i < (*Op)(unsafe.Pointer(pOp)).Fp2) { - goto __214 + goto __217 } if !(((int32((*Mem)(unsafe.Pointer((pMem + uintptr(i)*56))).Fflags) & MEM_Ephem) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, (pMem+uintptr(i)*56)) != 0)) { - goto __215 + goto __218 } goto no_mem -__215: +__218: ; Xsqlite3VdbeMemNulTerminate(tls, (pMem + uintptr(i)*56)) - goto __213 -__213: + goto __216 +__216: i++ - goto __212 - goto __214 -__214: + goto __215 + goto __217 +__217: ; if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - goto __216 + goto __219 } goto no_mem -__216: +__219: ; if !((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_ROW) != 0) { - goto __217 + goto __220 } - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_ROW, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0)) -__217: + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 240 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_ROW), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0)) +__220: ; // Return SQLITE_ROW @@ -64839,7 +65157,7 @@ __217: // It is illegal for P1 and P3 to be the same register. Sometimes, // if P3 is the same register as P2, the implementation is able // to avoid a memcpy(). -__31: // Initial flags for P2 +__32: // Initial flags for P2 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) @@ -64848,86 +65166,86 @@ __31: // Initial flags for P2 flags1 = (*Mem)(unsafe.Pointer(pIn1)).Fflags if !(((int32(flags1) | int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)) & MEM_Null) != 0) { - goto __218 + goto __221 } Xsqlite3VdbeMemSetNull(tls, pOut) goto __8 -__218: - ; - if !((int32(flags1) & (MEM_Str | MEM_Blob)) == 0) { - goto __219 - } - if !(Xsqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(0)) != 0) { - goto __221 - } - goto no_mem __221: ; - flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str))) - goto __220 -__219: - if !((int32(flags1) & MEM_Zero) != 0) { + if !((int32(flags1) & (MEM_Str | MEM_Blob)) == 0) { goto __222 } - if !(Xsqlite3VdbeMemExpandBlob(tls, pIn1) != 0) { - goto __223 - } - goto no_mem -__223: - ; - flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str))) -__222: - ; -__220: - ; - flags2 = (*Mem)(unsafe.Pointer(pIn2)).Fflags - if !((int32(flags2) & (MEM_Str | MEM_Blob)) == 0) { + if !(Xsqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(0)) != 0) { goto __224 } - if !(Xsqlite3VdbeMemStringify(tls, pIn2, encoding, uint8(0)) != 0) { + goto no_mem +__224: + ; + flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str))) + goto __223 +__222: + if !((int32(flags1) & MEM_Zero) != 0) { + goto __225 + } + if !(Xsqlite3VdbeMemExpandBlob(tls, pIn1) != 0) { goto __226 } goto no_mem __226: ; - flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str))) - goto __225 -__224: - if !((int32(flags2) & MEM_Zero) != 0) { - goto __227 - } - if !(Xsqlite3VdbeMemExpandBlob(tls, pIn2) != 0) { - goto __228 - } - goto no_mem -__228: - ; - flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str))) -__227: - ; + flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str))) __225: ; - nByte = (I64((*Mem)(unsafe.Pointer(pIn1)).Fn + (*Mem)(unsafe.Pointer(pIn2)).Fn)) - if !(nByte > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */))))) { +__223: + ; + flags2 = (*Mem)(unsafe.Pointer(pIn2)).Fflags + if !((int32(flags2) & (MEM_Str | MEM_Blob)) == 0) { + goto __227 + } + if !(Xsqlite3VdbeMemStringify(tls, pIn2, encoding, uint8(0)) != 0) { goto __229 } - goto too_big + goto no_mem __229: ; - if !(Xsqlite3VdbeMemGrow(tls, pOut, (int32(nByte)+3), (libc.Bool32(pOut == pIn2))) != 0) { + flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str))) + goto __228 +__227: + if !((int32(flags2) & MEM_Zero) != 0) { goto __230 } + if !(Xsqlite3VdbeMemExpandBlob(tls, pIn2) != 0) { + goto __231 + } goto no_mem +__231: + ; + flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str))) __230: ; +__228: + ; + nByte = (I64((*Mem)(unsafe.Pointer(pIn1)).Fn + (*Mem)(unsafe.Pointer(pIn2)).Fn)) + if !(nByte > I64(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */))))) { + goto __232 + } + goto too_big +__232: + ; + if !(Xsqlite3VdbeMemGrow(tls, pOut, (int32(nByte)+3), (libc.Bool32(pOut == pIn2))) != 0) { + goto __233 + } + goto no_mem +__233: + ; (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Str)) if !(pOut != pIn2) { - goto __231 + goto __234 } libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pOut)).Fz, (*Mem)(unsafe.Pointer(pIn2)).Fz, uint64((*Mem)(unsafe.Pointer(pIn2)).Fn)) (*Mem)(unsafe.Pointer(pIn2)).Fflags = flags2 -__231: +__234: ; libc.Xmemcpy(tls, ((*Mem)(unsafe.Pointer(pOut)).Fz + uintptr((*Mem)(unsafe.Pointer(pIn2)).Fn)), (*Mem)(unsafe.Pointer(pIn1)).Fz, uint64((*Mem)(unsafe.Pointer(pIn1)).Fn)) @@ -64974,11 +65292,11 @@ __231: // register P1 and store the result in register P3. // If the value in register P1 is zero the result is NULL. // If either operand is NULL, the result is NULL. -__32: // same as TK_PLUS, in1, in2, out3 -__33: // same as TK_MINUS, in1, in2, out3 -__34: // same as TK_STAR, in1, in2, out3 -__35: // same as TK_SLASH, in1, in2, out3 -__36: // Real value of right operand +__33: // same as TK_PLUS, in1, in2, out3 +__34: // same as TK_MINUS, in1, in2, out3 +__35: // same as TK_STAR, in1, in2, out3 +__36: // same as TK_SLASH, in1, in2, out3 +__37: // Real value of right operand pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) type1 = numericType(tls, pIn1) @@ -64987,158 +65305,158 @@ __36: // Real value of right operand pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) flags = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) | int32((*Mem)(unsafe.Pointer(pIn2)).Fflags))) if !(((int32(type1) & int32(type2)) & MEM_Int) != 0) { - goto __232 + goto __235 } iA = *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) = *(*I64)(unsafe.Pointer(pIn2 /* &.u */)) switch int32((*Op)(unsafe.Pointer(pOp)).Fopcode) { case OP_Add: - goto __235 - case OP_Subtract: - goto __236 - case OP_Multiply: - goto __237 - case OP_Divide: goto __238 - default: + case OP_Subtract: goto __239 - } - goto __234 -__235: - if !(Xsqlite3AddInt64(tls, bp+176 /* &iB */, iA) != 0) { + case OP_Multiply: goto __240 - } - goto fp_math -__240: - ; - goto __234 -__236: - if !(Xsqlite3SubInt64(tls, bp+176 /* &iB */, iA) != 0) { + case OP_Divide: goto __241 - } - goto fp_math -__241: - ; - goto __234 -__237: - if !(Xsqlite3MulInt64(tls, bp+176 /* &iB */, iA) != 0) { + default: goto __242 } - goto fp_math -__242: - ; - goto __234 + goto __237 __238: - if !(iA == int64(0)) { + if !(Xsqlite3AddInt64(tls, bp+176 /* &iB */, iA) != 0) { goto __243 } - goto arithmetic_result_is_null + goto fp_math __243: ; - if !((iA == int64(-1)) && (*(*I64)(unsafe.Pointer(bp + 176 /* iB */)) == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))) { + goto __237 +__239: + if !(Xsqlite3SubInt64(tls, bp+176 /* &iB */, iA) != 0) { goto __244 } goto fp_math __244: ; - *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) /= iA - goto __234 - -__239: - if !(iA == int64(0)) { + goto __237 +__240: + if !(Xsqlite3MulInt64(tls, bp+176 /* &iB */, iA) != 0) { goto __245 } - goto arithmetic_result_is_null + goto fp_math __245: ; - if !(iA == int64(-1)) { + goto __237 +__241: + if !(iA == int64(0)) { goto __246 } - iA = int64(1) + goto arithmetic_result_is_null __246: ; - *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) %= iA - goto __234 + if !((iA == int64(-1)) && (*(*I64)(unsafe.Pointer(bp + 176 /* iB */)) == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))) { + goto __247 + } + goto fp_math +__247: + ; + *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) /= iA + goto __237 -__234: +__242: + if !(iA == int64(0)) { + goto __248 + } + goto arithmetic_result_is_null +__248: + ; + if !(iA == int64(-1)) { + goto __249 + } + iA = int64(1) +__249: + ; + *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) %= iA + goto __237 + +__237: ; *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int)) - goto __233 -__232: + goto __236 +__235: if !((int32(flags) & MEM_Null) != 0) { - goto __247 + goto __250 } goto arithmetic_result_is_null - goto __248 -__247: + goto __251 +__250: fp_math: rA = Xsqlite3VdbeRealValue(tls, pIn1) rB = Xsqlite3VdbeRealValue(tls, pIn2) switch int32((*Op)(unsafe.Pointer(pOp)).Fopcode) { case OP_Add: - goto __250 - case OP_Subtract: - goto __251 - case OP_Multiply: - goto __252 - case OP_Divide: goto __253 - default: + case OP_Subtract: goto __254 - } - goto __249 -__250: - rB = rB + (rA) - goto __249 -__251: - rB = rB - (rA) - goto __249 -__252: - rB = rB * (rA) - goto __249 -__253: - // (double)0 In case of SQLITE_OMIT_FLOATING_POINT... - if !(rA == float64(0)) { + case OP_Multiply: goto __255 - } - goto arithmetic_result_is_null -__255: - ; - rB = rB / (rA) - goto __249 - -__254: - iA = Xsqlite3VdbeIntValue(tls, pIn1) - *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) = Xsqlite3VdbeIntValue(tls, pIn2) - if !(iA == int64(0)) { + case OP_Divide: goto __256 - } - goto arithmetic_result_is_null -__256: - ; - if !(iA == int64(-1)) { + default: goto __257 } - iA = int64(1) -__257: - ; - rB = (float64(*(*I64)(unsafe.Pointer(bp + 176 /* iB */)) % iA)) - goto __249 - -__249: - ; - if !(Xsqlite3IsNaN(tls, rB) != 0) { + goto __252 +__253: + rB = rB + (rA) + goto __252 +__254: + rB = rB - (rA) + goto __252 +__255: + rB = rB * (rA) + goto __252 +__256: + // (double)0 In case of SQLITE_OMIT_FLOATING_POINT... + if !(rA == float64(0)) { goto __258 } goto arithmetic_result_is_null __258: + ; + rB = rB / (rA) + goto __252 + +__257: + iA = Xsqlite3VdbeIntValue(tls, pIn1) + *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) = Xsqlite3VdbeIntValue(tls, pIn2) + if !(iA == int64(0)) { + goto __259 + } + goto arithmetic_result_is_null +__259: + ; + if !(iA == int64(-1)) { + goto __260 + } + iA = int64(1) +__260: + ; + rB = (float64(*(*I64)(unsafe.Pointer(bp + 176 /* iB */)) % iA)) + goto __252 + +__252: + ; + if !(Xsqlite3IsNaN(tls, rB) != 0) { + goto __261 + } + goto arithmetic_result_is_null +__261: ; *(*float64)(unsafe.Pointer(pOut /* &.u */)) = rB (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Real)) -__248: +__251: ; -__233: +__236: ; goto __8 @@ -65160,13 +65478,13 @@ arithmetic_result_is_null: // The interface used by the implementation of the aforementioned functions // to retrieve the collation sequence set by this opcode is not available // publicly. Only built-in functions have access to this feature. -__37: +__38: ; if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) { - goto __259 + goto __262 } Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56), int64(0)) -__259: +__262: ; goto __8 @@ -65196,43 +65514,43 @@ __259: // number of bits specified by the integer in register P1. // Store the result in register P3. // If either input is NULL, the result is NULL. -__38: // same as TK_BITAND, in1, in2, out3 -__39: // same as TK_BITOR, in1, in2, out3 -__40: // same as TK_LSHIFT, in1, in2, out3 -__41: +__39: // same as TK_BITAND, in1, in2, out3 +__40: // same as TK_BITOR, in1, in2, out3 +__41: // same as TK_LSHIFT, in1, in2, out3 +__42: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !(((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) | int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)) & MEM_Null) != 0) { - goto __260 + goto __263 } Xsqlite3VdbeMemSetNull(tls, pOut) goto __8 -__260: +__263: ; *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) = Xsqlite3VdbeIntValue(tls, pIn2) iB1 = Xsqlite3VdbeIntValue(tls, pIn1) op = (*Op)(unsafe.Pointer(pOp)).Fopcode if !(int32(op) == OP_BitAnd) { - goto __261 + goto __264 } *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) &= iB1 - goto __262 -__261: + goto __265 +__264: if !(int32(op) == OP_BitOr) { - goto __263 + goto __266 } *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) |= iB1 - goto __264 -__263: + goto __267 +__266: if !(iB1 != int64(0)) { - goto __265 + goto __268 } // If shifting by a negative amount, shift in the other direction if !(iB1 < int64(0)) { - goto __266 + goto __269 } op = (U8(((2 * OP_ShiftLeft) + 1) - int32(op))) @@ -65241,45 +65559,45 @@ __263: } else { iB1 = int64(64) } -__266: +__269: ; if !(iB1 >= int64(64)) { - goto __267 + goto __270 } if (*(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) >= int64(0)) || (int32(op) == OP_ShiftLeft) { *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) = int64(0) } else { *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) = int64(-1) } - goto __268 -__267: + goto __271 +__270: libc.Xmemcpy(tls, bp+184 /* &uA */, bp+192 /* &iA1 */, uint64(unsafe.Sizeof(U64(0)))) if !(int32(op) == OP_ShiftLeft) { - goto __269 + goto __272 } *(*U64)(unsafe.Pointer(bp + 184 /* uA */)) <<= iB1 - goto __270 -__269: + goto __273 +__272: *(*U64)(unsafe.Pointer(bp + 184 /* uA */)) >>= iB1 // Sign-extend on a right shift of a negative number if !(*(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) < int64(0)) { - goto __271 + goto __274 } *(*U64)(unsafe.Pointer(bp + 184 /* uA */)) |= (U64(((U64((uint64(0xffffffff))) << 32) | uint64(0xffffffff))) << (int64(64) - iB1)) -__271: +__274: ; -__270: +__273: ; libc.Xmemcpy(tls, bp+192 /* &iA1 */, bp+184 /* &uA */, uint64(unsafe.Sizeof(I64(0)))) +__271: + ; __268: ; +__267: + ; __265: ; -__264: - ; -__262: - ; *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int)) goto __8 @@ -65291,7 +65609,7 @@ __262: // The result is always an integer. // // To force any register to be an integer, just add 0. -__42: // in1 +__43: // in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) Xsqlite3VdbeMemIntegerify(tls, pIn1) @@ -65304,30 +65622,30 @@ __42: // in1 // in P1 is not an integer and cannot be converted into an integer // without data loss, then jump immediately to P2, or if P2==0 // raise an SQLITE_MISMATCH exception. -__43: // jump, in1 +__44: // jump, in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Int) == 0) { - goto __272 + goto __275 } - applyAffinity(tls, pIn1, SQLITE_AFF_NUMERIC, encoding) + applyAffinity(tls, pIn1, int8(SQLITE_AFF_NUMERIC), encoding) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Int) == 0) { - goto __273 + goto __276 } if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 0) { - goto __274 + goto __277 } rc = SQLITE_MISMATCH goto abort_due_to_error - goto __275 -__274: + goto __278 +__277: goto jump_to_p2 +__278: + ; +__276: + ; __275: ; -__273: - ; -__272: - ; (*Mem)(unsafe.Pointer(pIn1)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pIn1))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int)) goto __8 @@ -65340,15 +65658,15 @@ __272: // has REAL affinity. Such column values may still be stored as // integers, for space efficiency, but after extraction we want them // to have only a real value. -__44: // in1 +__45: // in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & (MEM_Int | MEM_IntReal)) != 0) { - goto __276 + goto __279 } Xsqlite3VdbeMemRealify(tls, pIn1) -__276: +__279: ; goto __8 @@ -65366,7 +65684,7 @@ __276: // // // A NULL value is not changed by this routine. It remains NULL. -__45: // in1 +__46: // in1 ; pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) @@ -65378,17 +65696,17 @@ __45: // in1 return 0 }() if !(rc != 0) { - goto __277 + goto __280 } goto abort_due_to_error -__277: +__280: ; rc = Xsqlite3VdbeMemCast(tls, pIn1, uint8((*Op)(unsafe.Pointer(pOp)).Fp2), encoding) if !(rc != 0) { - goto __278 + goto __281 } goto abort_due_to_error -__278: +__281: ; goto __8 @@ -65483,23 +65801,23 @@ __278: // This works just like the Lt opcode except that the jump is taken if // the content of register P3 is greater than or equal to the content of // register P1. See the Lt opcode for additional information. -__46: // same as TK_EQ, jump, in1, in3 -__47: // same as TK_NE, jump, in1, in3 -__48: // same as TK_LT, jump, in1, in3 -__49: // same as TK_LE, jump, in1, in3 -__50: // same as TK_GT, jump, in1, in3 -__51: // Copy of initial value of pIn3->flags +__47: // same as TK_EQ, jump, in1, in3 +__48: // same as TK_NE, jump, in1, in3 +__49: // same as TK_LT, jump, in1, in3 +__50: // same as TK_LE, jump, in1, in3 +__51: // same as TK_GT, jump, in1, in3 +__52: // Copy of initial value of pIn3->flags pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) flags11 = (*Mem)(unsafe.Pointer(pIn1)).Fflags flags3 = (*Mem)(unsafe.Pointer(pIn3)).Fflags if !(((int32(flags11) | int32(flags3)) & MEM_Null) != 0) { - goto __279 + goto __282 } // One or both operands are NULL if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_NULLEQ) != 0) { - goto __281 + goto __284 } // If SQLITE_NULLEQ is set (which will only happen if the operator is // OP_Eq or OP_Ne) then take the jump or not depending on whether @@ -65507,131 +65825,131 @@ __51: // Copy of initial value of pIn3->flags if !((((int32(flags11) & int32(flags3)) & MEM_Null) != 0) && ((int32(flags3) & MEM_Cleared) == 0)) { - goto __283 + goto __286 } res = 0 // Operands are equal - goto __284 -__283: + goto __287 +__286: res = func() int32 { if (int32(flags3) & MEM_Null) != 0 { return -1 } return +1 }() // Operands are not equal -__284: +__287: ; - goto __282 -__281: + goto __285 +__284: // SQLITE_NULLEQ is clear and at least one operand is NULL, // then the result is always NULL. // The jump is taken if the SQLITE_JUMPIFNULL bit is set. if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_STOREP2) != 0) { - goto __285 + goto __288 } pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) iCompare = 1 // Operands are not equal (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Null)) - goto __286 -__285: + goto __289 +__288: ; if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_JUMPIFNULL) != 0) { - goto __287 + goto __290 } goto jump_to_p2 -__287: +__290: ; -__286: +__289: ; goto __8 -__282: +__285: ; - goto __280 -__279: + goto __283 +__282: // Neither operand is NULL. Do a comparison. affinity = (int8(int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_AFF_MASK)) if !(int32(affinity) >= SQLITE_AFF_NUMERIC) { - goto __288 + goto __291 } if !(((int32(flags11) | int32(flags3)) & MEM_Str) != 0) { - goto __290 + goto __293 } if !((int32(flags11) & (((MEM_Int | MEM_IntReal) | MEM_Real) | MEM_Str)) == MEM_Str) { - goto __291 + goto __294 } applyNumericAffinity(tls, pIn1, 0) flags3 = (*Mem)(unsafe.Pointer(pIn3)).Fflags -__291: +__294: ; if !((int32(flags3) & (((MEM_Int | MEM_IntReal) | MEM_Real) | MEM_Str)) == MEM_Str) { - goto __292 + goto __295 } applyNumericAffinity(tls, pIn3, 0) -__292: +__295: ; -__290: +__293: ; // Handle the common case of integer comparison here, as an // optimization, to avoid a call to sqlite3MemCompare() if !(((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & int32((*Mem)(unsafe.Pointer(pIn3)).Fflags)) & MEM_Int) != 0) { - goto __293 + goto __296 } if !(*(*I64)(unsafe.Pointer(pIn3 /* &.u */)) > *(*I64)(unsafe.Pointer(pIn1 /* &.u */))) { - goto __294 + goto __297 } res = +1 goto compare_op -__294: +__297: ; if !(*(*I64)(unsafe.Pointer(pIn3 /* &.u */)) < *(*I64)(unsafe.Pointer(pIn1 /* &.u */))) { - goto __295 + goto __298 } res = -1 goto compare_op -__295: +__298: ; res = 0 goto compare_op -__293: +__296: ; - goto __289 -__288: + goto __292 +__291: if !(int32(affinity) == SQLITE_AFF_TEXT) { - goto __296 + goto __299 } if !(((int32(flags11) & MEM_Str) == 0) && ((int32(flags11) & ((MEM_Int | MEM_Real) | MEM_IntReal)) != 0)) { - goto __297 + goto __300 } Xsqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(1)) flags11 = (U16((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_TypeMask)) | (int32(flags11) & MEM_TypeMask))) if !(pIn1 == pIn3) { - goto __298 + goto __301 } flags3 = (U16(int32(flags11) | MEM_Str)) -__298: +__301: ; -__297: +__300: ; if !(((int32(flags3) & MEM_Str) == 0) && ((int32(flags3) & ((MEM_Int | MEM_Real) | MEM_IntReal)) != 0)) { - goto __299 + goto __302 } Xsqlite3VdbeMemStringify(tls, pIn3, encoding, uint8(1)) flags3 = (U16((int32((*Mem)(unsafe.Pointer(pIn3)).Fflags) & libc.CplInt32(MEM_TypeMask)) | (int32(flags3) & MEM_TypeMask))) +__302: + ; __299: ; -__296: - ; -__289: +__292: ; res = Xsqlite3MemCompare(tls, pIn3, pIn1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) -__280: +__283: ; compare_op: // At this point, res is negative, zero, or positive if reg[P1] is @@ -65643,21 +65961,21 @@ compare_op: ; if !(res < 0) { - goto __300 + goto __303 } res2 = int32(aLTb[(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) - OP_Ne)]) - goto __301 -__300: + goto __304 +__303: if !(res == 0) { - goto __302 + goto __305 } res2 = int32(aEQb[(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) - OP_Ne)]) - goto __303 -__302: + goto __306 +__305: res2 = int32(aGTb[(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) - OP_Ne)]) -__303: +__306: ; -__301: +__304: ; // Undo any changes made by applyAffinity() to the input registers. @@ -65667,12 +65985,12 @@ __301: (*Mem)(unsafe.Pointer(pIn1)).Fflags = flags11 if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_STOREP2) != 0) { - goto __304 + goto __307 } pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) iCompare = res if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_KEEPNULL) != 0) { - goto __306 + goto __309 } // The KEEPNULL flag prevents OP_Eq from overwriting a NULL with 1 // and prevents OP_Ne from overwriting NULL with 0. This flag @@ -65683,27 +66001,27 @@ __301: // NULL. if !((libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_Eq)) == res2) { - goto __307 + goto __310 } goto __8 -__307: +__310: ; -__306: +__309: ; (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int)) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(res2) - goto __305 -__304: + goto __308 +__307: ; if !(res2 != 0) { - goto __308 + goto __311 } goto jump_to_p2 -__308: +__311: ; -__305: +__308: ; goto __8 @@ -65719,14 +66037,14 @@ __305: // prior OP_Lt or OP_Gt would have been NULL or false (0), then then // jump to P2. If the result of an OP_Eq comparison on the two previous // operands would have been true (1), then fall through. -__52: // same as TK_ESCAPE, jump +__53: // same as TK_ESCAPE, jump ; if !(iCompare != 0) { - goto __309 + goto __312 } goto jump_to_p2 -__309: +__312: ; goto __8 @@ -65741,7 +66059,7 @@ __309: // // The first integer in the P4 integer array is the length of the array // and does not become part of the permutation. -__53: +__54: ; goto __8 @@ -65765,19 +66083,19 @@ __53: // The comparison is a sort comparison, so NULLs compare equal, // NULLs are less than numbers, numbers are less than strings, // and strings are less than blobs. -__54: // The permutation +__55: // The permutation if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_PERMUTE) == 0) { - goto __310 + goto __313 } aPermute = uintptr(0) - goto __311 -__310: + goto __314 +__313: ; aPermute = (*(*uintptr)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*24 + 16 /* &.p4 */)) + uintptr(1)*4) -__311: +__314: ; n2 = (*Op)(unsafe.Pointer(pOp)).Fp3 pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) @@ -65785,9 +66103,9 @@ __311: p11 = (*Op)(unsafe.Pointer(pOp)).Fp1 p21 = (*Op)(unsafe.Pointer(pOp)).Fp2 i1 = 0 -__312: +__315: if !(i1 < n2) { - goto __314 + goto __317 } if aPermute != 0 { idx = *(*U32)(unsafe.Pointer(aPermute + uintptr(i1)*4)) @@ -65799,30 +66117,30 @@ __312: bRev = (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i1)))) & KEYINFO_ORDER_DESC) iCompare = Xsqlite3MemCompare(tls, (aMem + uintptr((U32(p11)+idx))*56), (aMem + uintptr((U32(p21)+idx))*56), pColl) if !(iCompare != 0) { - goto __315 + goto __318 } if !(((int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i1)))) & KEYINFO_ORDER_BIGNULL) != 0) && (((int32((*Mem)(unsafe.Pointer(aMem+uintptr((U32(p11)+idx))*56)).Fflags) & MEM_Null) != 0) || ((int32((*Mem)(unsafe.Pointer(aMem+uintptr((U32(p21)+idx))*56)).Fflags) & MEM_Null) != 0))) { - goto __316 + goto __319 } iCompare = -iCompare -__316: +__319: ; if !(bRev != 0) { - goto __317 + goto __320 } iCompare = -iCompare -__317: +__320: ; - goto __314 -__315: + goto __317 +__318: ; - goto __313 -__313: + goto __316 +__316: i1++ - goto __312 - goto __314 -__314: + goto __315 + goto __317 +__317: ; goto __8 @@ -65831,24 +66149,24 @@ __314: // Jump to the instruction at address P1, P2, or P3 depending on whether // in the most recent OP_Compare instruction the P1 vector was less than // equal to, or greater than the P2 vector, respectively. -__55: // jump +__56: // jump if !(iCompare < 0) { - goto __318 + goto __321 } pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1-1))*24) - goto __319 -__318: + goto __322 +__321: if !(iCompare == 0) { - goto __320 + goto __323 } pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2-1))*24) - goto __321 -__320: + goto __324 +__323: ; pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp3-1))*24) -__321: +__324: ; -__319: +__322: ; goto __8 @@ -65870,30 +66188,30 @@ __319: // If either P1 or P2 is nonzero (true) then the result is 1 (true) // even if the other input is NULL. A NULL and false or two NULLs // give a NULL output. -__56: // same as TK_AND, in1, in2, out3 -__57: // Right operand: 0==FALSE, 1==TRUE, 2==UNKNOWN or NULL +__57: // same as TK_AND, in1, in2, out3 +__58: // Right operand: 0==FALSE, 1==TRUE, 2==UNKNOWN or NULL v1 = Xsqlite3VdbeBooleanValue(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56), 2) v2 = Xsqlite3VdbeBooleanValue(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56), 2) if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_And) { - goto __322 + goto __325 } v1 = int32(and_logic[((v1 * 3) + v2)]) - goto __323 -__322: + goto __326 +__325: v1 = int32(or_logic[((v1 * 3) + v2)]) -__323: +__326: ; pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !(v1 == 2) { - goto __324 + goto __327 } (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Null)) - goto __325 -__324: + goto __328 +__327: *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(v1) (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int)) -__325: +__328: ; goto __8 @@ -65916,7 +66234,7 @@ __325: //
  • If P3==0 and P4==1 then r[P2] := r[P1] IS NOT TRUE //
  • If P3==1 and P4==0 then r[P2] := r[P1] IS NOT FALSE // -__58: // in1, out2 +__59: // in1, out2 ; Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56), @@ -65929,17 +66247,17 @@ __58: // in1, out2 // Interpret the value in register P1 as a boolean value. Store the // boolean complement in register P2. If the value in register P1 is // NULL, then a NULL is stored in P2. -__59: // same as TK_NOT, in1, out2 +__60: // same as TK_NOT, in1, out2 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) == 0) { - goto __326 + goto __329 } Xsqlite3VdbeMemSetInt64(tls, pOut, libc.BoolInt64(!(Xsqlite3VdbeBooleanValue(tls, pIn1, 0) != 0))) - goto __327 -__326: + goto __330 +__329: Xsqlite3VdbeMemSetNull(tls, pOut) -__327: +__330: ; goto __8 @@ -65949,16 +66267,16 @@ __327: // Interpret the content of register P1 as an integer. Store the // ones-complement of the P1 value into register P2. If P1 holds // a NULL then store a NULL in P2. -__60: // same as TK_BITNOT, in1, out2 +__61: // same as TK_BITNOT, in1, out2 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) Xsqlite3VdbeMemSetNull(tls, pOut) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) == 0) { - goto __328 + goto __331 } - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = ^Xsqlite3VdbeIntValue(tls, pIn1) -__328: +__331: ; goto __8 @@ -65978,30 +66296,30 @@ __328: // whether or not the jump should be taken. The bitmask is necessary // because the self-altering code trick does not work for recursive // triggers. -__61: // Address of this instruction +__62: // Address of this instruction ; if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) { - goto __329 + goto __332 } iAddr = U32((int32((int64(pOp) - int64((*Vdbe)(unsafe.Pointer(p)).FaOp)) / 24))) if !((int32(*(*U8)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr((iAddr / U32(8)))))) & (int32(1) << (iAddr & U32(7)))) != 0) { - goto __331 + goto __334 } goto jump_to_p2 -__331: +__334: ; *(*U8)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr((iAddr / U32(8))))) |= U8((int32(1) << (iAddr & U32(7)))) - goto __330 -__329: + goto __333 +__332: if !((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp)).Fp1 == (*Op)(unsafe.Pointer(pOp)).Fp1) { - goto __332 + goto __335 } goto jump_to_p2 -__332: +__335: ; -__330: +__333: ; (*Op)(unsafe.Pointer(pOp)).Fp1 = (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp)).Fp1 @@ -66012,14 +66330,14 @@ __330: // Jump to P2 if the value in register P1 is true. The value // is considered true if it is numeric and non-zero. If the value // in P1 is NULL then take the jump if and only if P3 is non-zero. -__62: +__63: c = Xsqlite3VdbeBooleanValue(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56), (*Op)(unsafe.Pointer(pOp)).Fp3) if !(c != 0) { - goto __333 + goto __336 } goto jump_to_p2 -__333: +__336: ; goto __8 @@ -66028,14 +66346,14 @@ __333: // Jump to P2 if the value in register P1 is False. The value // is considered false if it has a numeric value of zero. If the value // in P1 is NULL then take the jump if and only if P3 is non-zero. -__63: +__64: c1 = libc.BoolInt32(!(Xsqlite3VdbeBooleanValue(tls, (aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56), libc.BoolInt32(!((*Op)(unsafe.Pointer(pOp)).Fp3 != 0))) != 0)) if !(c1 != 0) { - goto __334 + goto __337 } goto jump_to_p2 -__334: +__337: ; goto __8 @@ -66043,14 +66361,14 @@ __334: // Synopsis: if r[P1]==NULL goto P2 // // Jump to P2 if the value in register P1 is NULL. -__64: // same as TK_ISNULL, jump, in1 +__65: // same as TK_ISNULL, jump, in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) != 0) { - goto __335 + goto __338 } goto jump_to_p2 -__335: +__338: ; goto __8 @@ -66058,14 +66376,14 @@ __335: // Synopsis: if r[P1]!=NULL goto P2 // // Jump to P2 if the value in register P1 is not NULL. -__65: // same as TK_NOTNULL, jump, in1 +__66: // same as TK_NOTNULL, jump, in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) == 0) { - goto __336 + goto __339 } goto jump_to_p2 -__336: +__339: ; goto __8 @@ -66076,15 +66394,15 @@ __336: // If it is, then set register P3 to NULL and jump immediately to P2. // If P1 is not on a NULL row, then fall through without making any // changes. -__66: // jump +__67: // jump ; if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)))).FnullRow != 0) { - goto __337 + goto __340 } Xsqlite3VdbeMemSetNull(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)) goto jump_to_p2 -__337: +__340: ; goto __8 @@ -66102,18 +66420,18 @@ __337: // // This opcode is only available if SQLite is compiled with the // -DSQLITE_ENABLE_OFFSET_SQL_FUNC option. -__67: // The VDBE cursor +__68: // The VDBE cursor ; pC = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) pOut = ((*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !((pC == uintptr(0)) || (int32((*VdbeCursor)(unsafe.Pointer(pC)).FeCurType) != CURTYPE_BTREE)) { - goto __338 + goto __341 } Xsqlite3VdbeMemSetNull(tls, pOut) - goto __339 -__338: + goto __342 +__341: Xsqlite3VdbeMemSetInt64(tls, pOut, Xsqlite3BtreeOffset(tls, *(*uintptr)(unsafe.Pointer(pC + 56 /* &.uc */)))) -__339: +__342: ; goto __8 @@ -66136,7 +66454,7 @@ __339: // the result is guaranteed to only be used as the argument of a length() // or typeof() function, respectively. The loading of large blobs can be // skipped for length() and all content loading can be skipped for typeof(). -__68: // PseudoTable input register +__69: // PseudoTable input register ; *(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) @@ -66148,10 +66466,10 @@ __68: // PseudoTable input register // B-Tree seek. rc = Xsqlite3VdbeCursorMoveto(tls, bp+200 /* &pC1 */, bp+208 /* &p22 */) if !(rc != 0) { - goto __340 + goto __343 } goto abort_due_to_error -__340: +__343: ; pDest = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) @@ -66159,13 +66477,13 @@ __340: aOffset = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaOffset if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FcacheStatus != (*Vdbe)(unsafe.Pointer(p)).FcacheCtr) { - goto __341 + goto __344 } //OPTIMIZATION-IF-FALSE if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnullRow != 0) { - goto __342 + goto __345 } if !(int32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FeCurType) == CURTYPE_PSEUDO) { - goto __344 + goto __347 } // For the special case of as pseudo-cursor, the seekResult field // identifies the register that holds the record @@ -66174,27 +66492,27 @@ __340: (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize = libc.AssignPtrUint32(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */))+116 /* &.szRow */, U32((*Mem)(unsafe.Pointer(pReg)).Fn)) (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow = (*Mem)(unsafe.Pointer(pReg)).Fz - goto __345 -__344: + goto __348 +__347: Xsqlite3VdbeMemSetNull(tls, pDest) goto op_column_out -__345: +__348: ; - goto __343 -__342: + goto __346 +__345: pCrsr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 56 /* &.uc */)) (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize = Xsqlite3BtreePayloadSize(tls, pCrsr) (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow = Xsqlite3BtreePayloadFetch(tls, pCrsr, (*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 116 /* &.szRow */)) // Maximum page size is 64KiB - if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize > U32(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */))))) { - goto __346 + if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize > U32(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */))))) { + goto __349 } goto too_big -__346: +__349: ; -__343: +__346: ; (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FcacheStatus = (*Vdbe)(unsafe.Pointer(p)).FcacheCtr (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset = U32(func() uint8 { @@ -66209,7 +66527,7 @@ __343: (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed = U16(0) if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FszRow < *(*U32)(unsafe.Pointer(aOffset))) { - goto __347 + goto __350 } //OPTIMIZATION-IF-FALSE // pC->aRow does not have to hold the entire row, but it does at least // need to cover the header of the record. If pC->aRow does not contain @@ -66227,13 +66545,13 @@ __343: // 3-byte type for each of the maximum of 32768 columns plus three // extra bytes for the header length itself. 32768*3 + 3 = 98307. if !((*(*U32)(unsafe.Pointer(aOffset)) > U32(98307)) || (*(*U32)(unsafe.Pointer(aOffset)) > (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize)) { - goto __349 + goto __352 } goto op_column_corrupt -__349: +__352: ; - goto __348 -__347: + goto __351 +__350: // This is an optimization. By skipping over the first few tests // (ex: pC->nHdrParsed<=p2) in the next section, we achieve a // measurable performance gain. @@ -66250,38 +66568,38 @@ __347: // Conditional skipped goto op_column_read_header -__348: +__351: ; -__341: +__344: ; // Make sure at least the first p2+1 entries of the header have been // parsed and valid information is in aOffset[] and pC->aType[]. if !(U32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed) <= *(*U32)(unsafe.Pointer(bp + 208 /* p22 */))) { - goto __350 + goto __353 } // If there is more header available for parsing in the record, try // to extract additional fields up through the p2+1-th field if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset < *(*U32)(unsafe.Pointer(aOffset))) { - goto __352 + goto __355 } // Make sure zData points to enough of the record to cover the header. if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow == uintptr(0)) { - goto __354 + goto __357 } libc.Xmemset(tls, bp+216 /* &sMem */, 0, uint64(unsafe.Sizeof(Mem{}))) rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 56 /* &.uc */)), *(*U32)(unsafe.Pointer(aOffset)), bp+216 /* &sMem */) if !(rc != SQLITE_OK) { - goto __356 + goto __359 } goto abort_due_to_error -__356: +__359: ; zData = (*Mem)(unsafe.Pointer(bp + 216 /* &sMem */)).Fz - goto __355 -__354: + goto __358 +__357: zData = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow -__355: +__358: ; // Fill in pC->aType[i] and aOffset[i] values through the p2-th field. @@ -66291,27 +66609,27 @@ op_column_read_header: zHdr = (zData + uintptr((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset)) zEndHdr = (zData + uintptr(*(*U32)(unsafe.Pointer(aOffset)))) -__357: +__360: if !((libc.AssignPtrUint32((*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */))+120 /* &.aType */)+uintptr(i2)*4, libc.AssignPtrUint32(bp+272 /* t */, U32(*(*U8)(unsafe.Pointer(zHdr)))))) < U32(0x80)) { - goto __360 + goto __363 } zHdr++ offset64 = offset64 + (U64(Xsqlite3VdbeOneByteSerialTypeLen(tls, uint8(*(*U32)(unsafe.Pointer(bp + 272 /* t */)))))) - goto __361 -__360: + goto __364 +__363: zHdr += uintptr(Xsqlite3GetVarint32(tls, zHdr, bp+272 /* &t */)) *(*U32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 120 /* &.aType */) + uintptr(i2)*4)) = *(*U32)(unsafe.Pointer(bp + 272 /* t */)) offset64 = offset64 + (U64(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 272 /* t */))))) -__361: +__364: ; *(*U32)(unsafe.Pointer(aOffset + uintptr(libc.PreIncInt32(&i2, 1))*4)) = (U32(offset64 & uint64(0xffffffff))) - goto __358 -__358: + goto __361 +__361: if (U32(i2) <= *(*U32)(unsafe.Pointer(bp + 208 /* p22 */))) && (zHdr < zEndHdr) { - goto __357 + goto __360 } - goto __359 -__359: + goto __362 +__362: ; // The record is corrupt if any of the following are true: @@ -66320,63 +66638,63 @@ __359: // (3) the end of the data extends beyond the end of the record. if !(((zHdr >= zEndHdr) && ((zHdr > zEndHdr) || (offset64 != U64((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize)))) || (offset64 > U64((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize))) { - goto __362 + goto __365 } if !(*(*U32)(unsafe.Pointer(aOffset)) == U32(0)) { - goto __363 + goto __366 } i2 = 0 zHdr = zEndHdr - goto __364 -__363: + goto __367 +__366: if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow == uintptr(0)) { - goto __365 + goto __368 } Xsqlite3VdbeMemRelease(tls, bp+216 /* &sMem */) -__365: +__368: ; goto op_column_corrupt -__364: +__367: ; -__362: +__365: ; (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed = U16(i2) (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset = (U32((int64(zHdr) - int64(zData)) / 1)) if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow == uintptr(0)) { - goto __366 + goto __369 } Xsqlite3VdbeMemRelease(tls, bp+216 /* &sMem */) -__366: +__369: ; - goto __353 -__352: + goto __356 +__355: *(*U32)(unsafe.Pointer(bp + 272 /* t */)) = U32(0) -__353: +__356: ; // If after trying to extract new entries from the header, nHdrParsed is // still not up to p2, that means that the record has fewer than p2 // columns. So the result will be either the default value or a NULL. if !(U32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed) <= *(*U32)(unsafe.Pointer(bp + 208 /* p22 */))) { - goto __367 + goto __370 } if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-11)) { - goto __368 + goto __371 } Xsqlite3VdbeMemShallowCopy(tls, pDest, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), MEM_Static) - goto __369 -__368: + goto __372 +__371: Xsqlite3VdbeMemSetNull(tls, pDest) -__369: +__372: ; goto op_column_out -__367: +__370: ; - goto __351 -__350: + goto __354 +__353: *(*U32)(unsafe.Pointer(bp + 272 /* t */)) = *(*U32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 120 /* &.aType */) + uintptr(*(*U32)(unsafe.Pointer(bp + 208 /* p22 */)))*4)) -__351: +__354: ; // Extract the content for the p2+1-th column. Control can only @@ -66384,55 +66702,55 @@ __351: // all valid. if !((int32((*Mem)(unsafe.Pointer((pDest))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0) { - goto __370 + goto __373 } Xsqlite3VdbeMemSetNull(tls, pDest) -__370: +__373: ; if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FszRow >= *(*U32)(unsafe.Pointer(aOffset + uintptr((*(*U32)(unsafe.Pointer(bp + 208 /* p22 */))+U32(1)))*4))) { - goto __371 + goto __374 } // This is the common case where the desired content fits on the original // page - where the content is not on an overflow page zData = ((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow + uintptr(*(*U32)(unsafe.Pointer(aOffset + uintptr(*(*U32)(unsafe.Pointer(bp + 208 /* p22 */)))*4)))) if !(*(*U32)(unsafe.Pointer(bp + 272 /* t */)) < U32(12)) { - goto __373 + goto __376 } Xsqlite3VdbeSerialGet(tls, zData, *(*U32)(unsafe.Pointer(bp + 272 /* t */)), pDest) - goto __374 -__373: + goto __377 +__376: (*Mem)(unsafe.Pointer(pDest)).Fn = libc.AssignInt32(&len, (int32((*(*U32)(unsafe.Pointer(bp + 272 /* t */)) - U32(12)) / U32(2)))) (*Mem)(unsafe.Pointer(pDest)).Fenc = encoding if !((*Mem)(unsafe.Pointer(pDest)).FszMalloc < (len + 2)) { - goto __375 + goto __378 } - (*Mem)(unsafe.Pointer(pDest)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pDest)).Fflags = U16(MEM_Null) if !(Xsqlite3VdbeMemGrow(tls, pDest, (len+2), 0) != 0) { - goto __377 + goto __380 } goto no_mem -__377: +__380: ; - goto __376 -__375: + goto __379 +__378: (*Mem)(unsafe.Pointer(pDest)).Fz = (*Mem)(unsafe.Pointer(pDest)).FzMalloc -__376: +__379: ; libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pDest)).Fz, zData, uint64(len)) *(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pDest)).Fz + uintptr(len))) = int8(0) *(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pDest)).Fz + uintptr((len + 1)))) = int8(0) (*Mem)(unsafe.Pointer(pDest)).Fflags = aFlag1[(*(*U32)(unsafe.Pointer(bp + 272 /* t */)) & U32(1))] -__374: +__377: ; - goto __372 -__371: + goto __375 +__374: (*Mem)(unsafe.Pointer(pDest)).Fenc = encoding // This branch happens only when content is on overflow pages if !((((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (OPFLAG_LENGTHARG | OPFLAG_TYPEOFARG)) != 0) && (((*(*U32)(unsafe.Pointer(bp + 272 /* t */)) >= U32(12)) && ((*(*U32)(unsafe.Pointer(bp + 272 /* t */)) & U32(1)) == U32(0))) || ((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_TYPEOFARG) != 0))) || ((libc.AssignInt32(&len, int32(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 272 /* t */)))))) == 0)) { - goto __378 + goto __381 } // Content is irrelevant for // 1. the typeof() function, @@ -66447,20 +66765,20 @@ __371: // as that array is 256 bytes long (plenty for VdbeMemPrettyPrint()) // and it begins with a bunch of zeros. Xsqlite3VdbeSerialGet(tls, uintptr(uintptr(unsafe.Pointer(&Xsqlite3CtypeMap))), *(*U32)(unsafe.Pointer(bp + 272 /* t */)), pDest) - goto __379 -__378: + goto __382 +__381: rc = Xsqlite3VdbeMemFromBtree(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 56 /* &.uc */)), *(*U32)(unsafe.Pointer(aOffset + uintptr(*(*U32)(unsafe.Pointer(bp + 208 /* p22 */)))*4)), uint32(len), pDest) if !(rc != SQLITE_OK) { - goto __380 + goto __383 } goto abort_due_to_error -__380: +__383: ; Xsqlite3VdbeSerialGet(tls, (*Mem)(unsafe.Pointer(pDest)).Fz, *(*U32)(unsafe.Pointer(bp + 272 /* t */)), pDest) *(*U16)(unsafe.Pointer(pDest + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Ephem))) -__379: +__382: ; -__372: +__375: ; op_column_out: @@ -66470,15 +66788,15 @@ op_column_out: op_column_corrupt: if !((*Op)(unsafe.Pointer(aOp)).Fp3 > 0) { - goto __381 + goto __384 } pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(aOp)).Fp3-1))*24) goto __8 - goto __382 -__381: - rc = Xsqlite3CorruptError(tls, 88187) + goto __385 +__384: + rc = Xsqlite3CorruptError(tls, 88805) goto abort_due_to_error -__382: +__385: ; // Opcode: Affinity P1 P2 * P4 * @@ -66489,19 +66807,19 @@ __382: // P4 is a string that is P2 characters long. The N-th character of the // string indicates the column affinity that should be used for the N-th // memory cell in the range. -__69: // The affinity to be applied +__70: // The affinity to be applied zAffinity = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) -__383: +__386: if !(1 != 0) { - goto __384 + goto __387 } applyAffinity(tls, pIn1, *(*int8)(unsafe.Pointer(zAffinity)), encoding) if !((int32(*(*int8)(unsafe.Pointer(zAffinity))) == SQLITE_AFF_REAL) && ((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Int) != 0)) { - goto __385 + goto __388 } // When applying REAL affinity, if the result is still an MEM_Int // that will fit in 6 bytes, then change the type to MEM_IntReal @@ -66509,30 +66827,30 @@ __383: // the type really wants to be REAL. if !((*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) <= 140737488355327) && (*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) >= -140737488355328)) { - goto __386 + goto __389 } *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) |= U16((MEM_IntReal)) *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Int))) - goto __387 -__386: + goto __390 +__389: *(*float64)(unsafe.Pointer(pIn1 /* &.u */)) = float64(*(*I64)(unsafe.Pointer(pIn1 /* &.u */))) *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) |= U16((MEM_Real)) *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Int))) -__387: +__390: ; -__385: +__388: ; zAffinity++ if !(int32(*(*int8)(unsafe.Pointer(zAffinity))) == 0) { - goto __388 + goto __391 } - goto __384 -__388: + goto __387 +__391: ; pIn1 += 56 - goto __383 -__384: + goto __386 +__387: ; goto __8 @@ -66562,7 +66880,7 @@ __384: // OPFLAG_NOCHNG_MAGIC if the OP_MakeRecord opcode is allowed to // accept no-change records with serial_type 10. This value is // only used inside an assert() and does not affect the end result. -__70: // Where to write next byte of the payload +__71: // Where to write next byte of the payload // Assuming the record contains N fields, the record format looks // like this: @@ -66596,31 +66914,31 @@ __70: // Where to write next byte of the payload // Apply the requested affinity to all inputs if !(zAffinity1 != 0) { - goto __389 + goto __392 } pRec = pData0 -__390: +__393: applyAffinity(tls, pRec, *(*int8)(unsafe.Pointer(zAffinity1)), encoding) if !((int32(*(*int8)(unsafe.Pointer(zAffinity1))) == SQLITE_AFF_REAL) && ((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Int) != 0)) { - goto __393 + goto __396 } *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) |= U16((MEM_IntReal)) *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Int))) -__393: +__396: ; zAffinity1++ pRec += 56 - goto __391 -__391: + goto __394 +__394: if *(*int8)(unsafe.Pointer(zAffinity1)) != 0 { - goto __390 + goto __393 } - goto __392 -__392: + goto __395 +__395: ; -__389: +__392: ; // Loop through the elements that will make up the record to figure @@ -66649,13 +66967,13 @@ __389: // nData Number of bytes of data space needed for the record // nZero Zero bytes at the end of the record pRec = pLast -__394: +__397: ; if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Null) != 0) { - goto __397 + goto __400 } if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Zero) != 0) { - goto __399 + goto __402 } // Values with MEM_Null and MEM_Zero are created by xColumn virtual // table methods that never invoke sqlite3_result_xxxxx() while @@ -66665,77 +66983,77 @@ __394: // a true sqlite3_value_nochange(). (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(10) - goto __400 -__399: + goto __403 +__402: (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(0) -__400: +__403: ; nHdr++ - goto __398 -__397: + goto __401 +__400: if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & (MEM_Int | MEM_IntReal)) != 0) { - goto __401 + goto __404 } // Figure out whether to use 1, 2, 4, 6 or 8 bytes. i3 = *(*I64)(unsafe.Pointer(pRec /* &.u */)) if !(i3 < int64(0)) { - goto __403 + goto __406 } uu = U64(^i3) - goto __404 -__403: + goto __407 +__406: uu = U64(i3) -__404: +__407: ; nHdr++ if !(uu <= uint64(127)) { - goto __405 + goto __408 } if !(((i3 & int64(1)) == i3) && (file_format >= 4)) { - goto __407 + goto __410 } (*Mem)(unsafe.Pointer(pRec)).FuTemp = (U32(8) + U32(uu)) - goto __408 -__407: + goto __411 +__410: nData++ (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(1) -__408: +__411: ; - goto __406 -__405: + goto __409 +__408: if !(uu <= uint64(32767)) { - goto __409 + goto __412 } nData = nData + (uint64(2)) (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(2) - goto __410 -__409: + goto __413 +__412: if !(uu <= uint64(8388607)) { - goto __411 + goto __414 } nData = nData + (uint64(3)) (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(3) - goto __412 -__411: + goto __415 +__414: if !(uu <= uint64(2147483647)) { - goto __413 + goto __416 } nData = nData + (uint64(4)) (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(4) - goto __414 -__413: + goto __417 +__416: if !(uu <= uint64(140737488355327)) { - goto __415 + goto __418 } nData = nData + (uint64(6)) (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(5) - goto __416 -__415: + goto __419 +__418: nData = nData + (uint64(8)) if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_IntReal) != 0) { - goto __417 + goto __420 } // If the value is IntReal and is going to take up 8 bytes to store // as an integer, then we might as well make it an 8-byte floating @@ -66744,79 +67062,79 @@ __415: *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_IntReal))) *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) |= U16((MEM_Real)) (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(7) - goto __418 -__417: + goto __421 +__420: (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(6) -__418: +__421: ; -__416: +__419: ; -__414: +__417: ; -__412: +__415: ; -__410: +__413: ; -__406: +__409: ; - goto __402 -__401: + goto __405 +__404: if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Real) != 0) { - goto __419 + goto __422 } nHdr++ nData = nData + (uint64(8)) (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(7) - goto __420 -__419: + goto __423 +__422: ; len1 = U32((*Mem)(unsafe.Pointer(pRec)).Fn) serial_type = (((len1 * U32(2)) + U32(12)) + (U32(libc.Bool32((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Str) != 0)))) if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Zero) != 0) { - goto __421 + goto __424 } serial_type = serial_type + (U32(*(*int32)(unsafe.Pointer(pRec /* &.u */)) * 2)) if !(nData != 0) { - goto __422 + goto __425 } if !(Xsqlite3VdbeMemExpandBlob(tls, pRec) != 0) { - goto __424 + goto __427 } goto no_mem -__424: +__427: ; len1 = len1 + (U32(*(*int32)(unsafe.Pointer(pRec /* &.u */)))) - goto __423 -__422: + goto __426 +__425: nZero = nZero + (I64(*(*int32)(unsafe.Pointer(pRec /* &.u */)))) -__423: +__426: ; -__421: +__424: ; nData = nData + (U64(len1)) nHdr = nHdr + (Xsqlite3VarintLen(tls, uint64(serial_type))) (*Mem)(unsafe.Pointer(pRec)).FuTemp = serial_type -__420: +__423: ; -__402: +__405: ; -__398: +__401: ; if !(pRec == pData0) { - goto __425 + goto __428 } - goto __396 -__425: + goto __399 +__428: ; pRec -= 56 - goto __395 -__395: + goto __398 +__398: if 1 != 0 { - goto __394 + goto __397 } - goto __396 -__396: + goto __399 +__399: ; // EVIDENCE-OF: R-22564-11647 The header begins with a single varint @@ -66825,22 +67143,22 @@ __396: // itself. if !(nHdr <= 126) { - goto __426 + goto __429 } // The common case nHdr = nHdr + (1) - goto __427 -__426: + goto __430 +__429: // Rare case of a really large header nVarint = Xsqlite3VarintLen(tls, uint64(nHdr)) nHdr = nHdr + (nVarint) if !(nVarint < Xsqlite3VarintLen(tls, uint64(nHdr))) { - goto __428 + goto __431 } nHdr++ -__428: +__431: ; -__427: +__430: ; nByte1 = (I64(U64(nHdr) + nData)) @@ -66849,37 +67167,37 @@ __427: // be one of the input registers (because the following call to // sqlite3VdbeMemClearAndResize() could clobber the value before it is used). if !((nByte1 + nZero) <= I64((*Mem)(unsafe.Pointer(pOut)).FszMalloc)) { - goto __429 + goto __432 } // The output register is already large enough to hold the record. // No error checks or buffer enlargement is required (*Mem)(unsafe.Pointer(pOut)).Fz = (*Mem)(unsafe.Pointer(pOut)).FzMalloc - goto __430 -__429: + goto __433 +__432: // Need to make sure that the output is not too big and then enlarge // the output register to hold the full result - if !((nByte1 + nZero) > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */))))) { - goto __431 + if !((nByte1 + nZero) > I64(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */))))) { + goto __434 } goto too_big -__431: +__434: ; if !(Xsqlite3VdbeMemClearAndResize(tls, pOut, int32(nByte1)) != 0) { - goto __432 + goto __435 } goto no_mem -__432: +__435: ; -__430: +__433: ; (*Mem)(unsafe.Pointer(pOut)).Fn = int32(nByte1) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Blob + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Blob) if !(nZero != 0) { - goto __433 + goto __436 } *(*int32)(unsafe.Pointer(pOut /* &.u */)) = int32(nZero) *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Zero)) -__433: +__436: ; zHdr1 = (*Mem)(unsafe.Pointer(pOut)).Fz @@ -66894,7 +67212,7 @@ __433: }()) pRec = pData0 -__434: +__437: serial_type = (*Mem)(unsafe.Pointer(pRec)).FuTemp // EVIDENCE-OF: R-06529-47362 Following the size varint are one or more // additional varints, one per column. @@ -66907,13 +67225,13 @@ __434: // EVIDENCE-OF: R-64536-51728 The values for each column in the record // immediately follow the header. zPayload += uintptr(Xsqlite3VdbeSerialPut(tls, zPayload, pRec, serial_type)) // content - goto __435 -__435: + goto __438 +__438: if (libc.PreIncUintptr(&pRec, 56)) <= pLast { - goto __434 + goto __437 } - goto __436 -__436: + goto __439 +__439: ; goto __8 @@ -66927,25 +67245,25 @@ __436: // If P3==0, then an exact count is obtained, which involves visiting // every btree page of the table. But if P3 is non-zero, an estimate // is returned based on the current cursor position. -__71: +__72: ; pCrsr1 = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + 56 /* &.uc */)) if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) { - goto __437 + goto __440 } *(*I64)(unsafe.Pointer(bp + 280 /* nEntry */)) = Xsqlite3BtreeRowCountEst(tls, pCrsr1) - goto __438 -__437: + goto __441 +__440: *(*I64)(unsafe.Pointer(bp + 280 /* nEntry */)) = int64(0) // Not needed. Only used to silence a warning. rc = Xsqlite3BtreeCount(tls, db, pCrsr1, bp+280 /* &nEntry */) if !(rc != 0) { - goto __439 + goto __442 } goto abort_due_to_error -__439: +__442: ; -__438: +__441: ; pOut = out2Prerelease(tls, p, pOp) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 280 /* nEntry */)) @@ -66957,7 +67275,7 @@ __438: // on the value of P1. To open a new savepoint set P1==0 (SAVEPOINT_BEGIN). // To release (commit) an existing savepoint set P1==1 (SAVEPOINT_RELEASE). // To rollback an existing savepoint set P1==2 (SAVEPOINT_ROLLBACK). -__72: +__73: p12 = (*Op)(unsafe.Pointer(pOp)).Fp1 zName = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) @@ -66966,17 +67284,17 @@ __72: // transaction, then there cannot be any savepoints. if !(p12 == SAVEPOINT_BEGIN) { - goto __440 + goto __443 } if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0) { - goto __442 + goto __445 } // A new savepoint cannot be created if there are active write // statements (i.e. open read/write incremental blob handles). - Xsqlite3VdbeError(tls, p, ts+4438 /* "cannot open save..." */, 0) + Xsqlite3VdbeError(tls, p, ts+4466 /* "cannot open save..." */, 0) rc = SQLITE_BUSY - goto __443 -__442: + goto __446 +__445: nName = Xsqlite3Strlen30(tls, zName) // This call is Ok even if this savepoint is actually a transaction @@ -66987,16 +67305,16 @@ __442: rc = Xsqlite3VtabSavepoint(tls, db, SAVEPOINT_BEGIN, ((*Sqlite3)(unsafe.Pointer(db)).FnStatement + (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint)) if !(rc != SQLITE_OK) { - goto __444 + goto __447 } goto abort_due_to_error -__444: +__447: ; // Create a new savepoint structure. pNew = Xsqlite3DbMallocRawNN(tls, db, (uint64((uint64(unsafe.Sizeof(Savepoint{})) + uint64(nName)) + uint64(1)))) if !(pNew != 0) { - goto __445 + goto __448 } (*Savepoint)(unsafe.Pointer(pNew)).FzName = (pNew + 1*32) libc.Xmemcpy(tls, (*Savepoint)(unsafe.Pointer(pNew)).FzName, zName, (uint64(nName + 1))) @@ -67004,14 +67322,14 @@ __444: // If there is no open transaction, then mark this as a special // "transaction savepoint". if !((*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - goto __446 + goto __449 } (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0) (*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint = U8(1) - goto __447 -__446: + goto __450 +__449: (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint++ -__447: +__450: ; // Link the new savepoint into the database handle's list. @@ -67019,163 +67337,163 @@ __447: (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = pNew (*Savepoint)(unsafe.Pointer(pNew)).FnDeferredCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons (*Savepoint)(unsafe.Pointer(pNew)).FnDeferredImmCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons -__445: +__448: ; +__446: + ; + goto __444 __443: - ; - goto __441 -__440: ; iSavepoint = 0 // Find the named savepoint. If there is no such savepoint, then an // an error is returned to the user. pSavepoint = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint -__448: +__451: if !((pSavepoint != 0) && (Xsqlite3StrICmp(tls, (*Savepoint)(unsafe.Pointer(pSavepoint)).FzName, zName) != 0)) { - goto __450 + goto __453 } iSavepoint++ - goto __449 -__449: + goto __452 +__452: pSavepoint = (*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext - goto __448 - goto __450 -__450: + goto __451 + goto __453 +__453: ; if !(!(pSavepoint != 0)) { - goto __451 + goto __454 } - Xsqlite3VdbeError(tls, p, ts+4489 /* "no such savepoin..." */, libc.VaList(bp+56, zName)) + Xsqlite3VdbeError(tls, p, ts+4517 /* "no such savepoin..." */, libc.VaList(bp+56, zName)) rc = SQLITE_ERROR - goto __452 -__451: + goto __455 +__454: if !(((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0) && (p12 == SAVEPOINT_RELEASE)) { - goto __453 + goto __456 } // It is not possible to release (commit) a savepoint if there are // active write statements. Xsqlite3VdbeError(tls, p, - ts+4511 /* "cannot release s..." */, 0) + ts+4539 /* "cannot release s..." */, 0) rc = SQLITE_BUSY - goto __454 -__453: + goto __457 +__456: // Determine whether or not this is a transaction savepoint. If so, // and this is a RELEASE command, then the current transaction // is committed. isTransaction = (libc.Bool32(((*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext == uintptr(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint != 0))) if !((isTransaction != 0) && (p12 == SAVEPOINT_RELEASE)) { - goto __455 + goto __458 } if !((libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1))) != SQLITE_OK) { - goto __457 + goto __460 } goto vdbe_return -__457: +__460: ; (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1) if !(Xsqlite3VdbeHalt(tls, p) == SQLITE_BUSY) { - goto __458 + goto __461 } (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32((int64(pOp) - int64(aOp)) / 24)) (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0) (*Vdbe)(unsafe.Pointer(p)).Frc = libc.AssignInt32(&rc, SQLITE_BUSY) goto vdbe_return -__458: +__461: ; rc = (*Vdbe)(unsafe.Pointer(p)).Frc if !(rc != 0) { - goto __459 + goto __462 } (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0) - goto __460 -__459: + goto __463 +__462: (*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint = U8(0) -__460: +__463: ; - goto __456 -__455: + goto __459 +__458: iSavepoint = (((*Sqlite3)(unsafe.Pointer(db)).FnSavepoint - iSavepoint) - 1) if !(p12 == SAVEPOINT_ROLLBACK) { - goto __461 + goto __464 } - isSchemaChange = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaChange) != U32(0))) + isSchemaChange = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != U32(0))) ii = 0 -__463: +__466: if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) { - goto __465 + goto __468 } rc = Xsqlite3BtreeTripAllCursors(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii)*32)).FpBt, (SQLITE_ABORT | (int32(2) << 8)), (libc.Bool32(isSchemaChange == 0))) if !(rc != SQLITE_OK) { - goto __466 + goto __469 } goto abort_due_to_error -__466: +__469: ; - goto __464 -__464: + goto __467 +__467: ii++ - goto __463 - goto __465 -__465: + goto __466 + goto __468 +__468: ; - goto __462 -__461: + goto __465 +__464: ; isSchemaChange = 0 -__462: +__465: ; ii = 0 -__467: +__470: if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) { - goto __469 + goto __472 } rc = Xsqlite3BtreeSavepoint(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii)*32)).FpBt, p12, iSavepoint) if !(rc != SQLITE_OK) { - goto __470 + goto __473 } goto abort_due_to_error -__470: +__473: ; - goto __468 -__468: + goto __471 +__471: ii++ - goto __467 - goto __469 -__469: + goto __470 + goto __472 +__472: ; if !(isSchemaChange != 0) { - goto __471 + goto __474 } Xsqlite3ExpirePreparedStatements(tls, db, 0) Xsqlite3ResetAllSchemasOfConnection(tls, db) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) -__471: + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) +__474: ; -__456: +__459: ; if !(rc != 0) { - goto __472 + goto __475 } goto abort_due_to_error -__472: +__475: ; // Regardless of whether this is a RELEASE or ROLLBACK, destroy all // savepoints nested inside of the savepoint being operated on. -__473: +__476: if !((*Sqlite3)(unsafe.Pointer(db)).FpSavepoint != pSavepoint) { - goto __474 + goto __477 } pTmp = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pTmp)).FpNext Xsqlite3DbFree(tls, db, pTmp) (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint-- - goto __473 -__474: + goto __476 +__477: ; // If it is a RELEASE, then destroy the savepoint being operated on @@ -67183,48 +67501,48 @@ __474: // constraint violations present in the database to the value stored // when the savepoint was created. if !(p12 == SAVEPOINT_RELEASE) { - goto __475 + goto __478 } (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext Xsqlite3DbFree(tls, db, pSavepoint) if !(!(isTransaction != 0)) { - goto __477 + goto __480 } (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint-- -__477: +__480: ; - goto __476 -__475: + goto __479 +__478: ; (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = (*Savepoint)(unsafe.Pointer(pSavepoint)).FnDeferredCons (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = (*Savepoint)(unsafe.Pointer(pSavepoint)).FnDeferredImmCons -__476: +__479: ; if !(!(isTransaction != 0) || (p12 == SAVEPOINT_ROLLBACK)) { - goto __478 + goto __481 } rc = Xsqlite3VtabSavepoint(tls, db, p12, iSavepoint) if !(rc != SQLITE_OK) { - goto __479 + goto __482 } goto abort_due_to_error -__479: +__482: ; -__478: +__481: ; -__454: +__457: ; -__452: +__455: ; -__441: +__444: ; if !(rc != 0) { - goto __480 + goto __483 } goto abort_due_to_error -__480: +__483: ; goto __8 @@ -67237,7 +67555,7 @@ __480: // there are active writing VMs or active VMs that use shared cache. // // This instruction causes the VM to halt. -__73: +__74: desiredAutoCommit = (*Op)(unsafe.Pointer(pOp)).Fp1 iRollback = (*Op)(unsafe.Pointer(pOp)).Fp2 @@ -67245,78 +67563,78 @@ __73: // At least this one VM is active if !(desiredAutoCommit != int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit)) { - goto __481 + goto __484 } if !(iRollback != 0) { - goto __483 + goto __486 } Xsqlite3RollbackAll(tls, db, (SQLITE_ABORT | (int32(2) << 8))) (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1) - goto __484 -__483: + goto __487 +__486: if !((desiredAutoCommit != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0)) { - goto __485 + goto __488 } // If this instruction implements a COMMIT and other VMs are writing // return an error indicating that the other VMs must complete first. Xsqlite3VdbeError(tls, p, - ts+4565 /* "cannot commit tr..." */, 0) + ts+4593 /* "cannot commit tr..." */, 0) rc = SQLITE_BUSY goto abort_due_to_error - goto __486 -__485: + goto __489 +__488: if !((libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1))) != SQLITE_OK) { - goto __487 + goto __490 } goto vdbe_return - goto __488 -__487: + goto __491 +__490: (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(desiredAutoCommit) -__488: +__491: ; -__486: +__489: ; -__484: +__487: ; if !(Xsqlite3VdbeHalt(tls, p) == SQLITE_BUSY) { - goto __489 + goto __492 } (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32((int64(pOp) - int64(aOp)) / 24)) (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = (U8(1 - desiredAutoCommit)) (*Vdbe)(unsafe.Pointer(p)).Frc = libc.AssignInt32(&rc, SQLITE_BUSY) goto vdbe_return -__489: +__492: ; Xsqlite3CloseSavepoints(tls, db) if !((*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK) { - goto __490 + goto __493 } rc = SQLITE_DONE - goto __491 -__490: + goto __494 +__493: rc = SQLITE_ERROR -__491: +__494: ; goto vdbe_return - goto __482 -__481: + goto __485 +__484: Xsqlite3VdbeError(tls, p, func() uintptr { if !(desiredAutoCommit != 0) { - return ts + 4620 /* "cannot start a t..." */ + return ts + 4648 /* "cannot start a t..." */ } return func() uintptr { if iRollback != 0 { - return ts + 4668 /* "cannot rollback ..." */ + return ts + 4696 /* "cannot rollback ..." */ } - return ts + 4711 /* "cannot commit - ..." */ + return ts + 4739 /* "cannot commit - ..." */ }() }(), 0) rc = SQLITE_ERROR goto abort_due_to_error -__482: +__485: ; /*NOTREACHED*/ @@ -67326,7 +67644,8 @@ __482: // active. // If P2 is non-zero, then a write-transaction is started, or if a // read-transaction is already active, it is upgraded to a write-transaction. - // If P2 is zero, then a read-transaction is started. + // If P2 is zero, then a read-transaction is started. If P2 is 2 or more + // then an exclusive transaction is started. // // P1 is the index of the database file on which the transaction is // started. Index 0 is the main database file and index 1 is the @@ -67353,59 +67672,59 @@ __482: // generation counter, then an SQLITE_SCHEMA error is raised and execution // halts. The sqlite3_step() wrapper function might then reprepare the // statement and rerun it from the beginning. -__74: +__75: *(*int32)(unsafe.Pointer(bp + 288 /* iMeta */)) = 0 - if !(((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_QueryOnly) != uint64(0))) { - goto __492 + if !(((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_QueryOnly)) != uint64(0))) { + goto __495 } rc = SQLITE_READONLY goto abort_due_to_error -__492: +__495: ; pBt = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt if !(pBt != 0) { - goto __493 + goto __496 } rc = Xsqlite3BtreeBeginTrans(tls, pBt, (*Op)(unsafe.Pointer(pOp)).Fp2, bp+288 /* &iMeta */) if !(rc != SQLITE_OK) { - goto __494 + goto __497 } if !((rc & 0xff) == SQLITE_BUSY) { - goto __495 + goto __498 } (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32((int64(pOp) - int64(aOp)) / 24)) (*Vdbe)(unsafe.Pointer(p)).Frc = rc goto vdbe_return -__495: +__498: ; goto abort_due_to_error -__494: +__497: ; if !((((Bft(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.usesStmtJournal */)) & 0x40 >> 6))) != 0) && ((*Op)(unsafe.Pointer(pOp)).Fp2 != 0)) && ((int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0) || ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1))) { - goto __496 + goto __499 } if !((*Vdbe)(unsafe.Pointer(p)).FiStatement == 0) { - goto __497 + goto __500 } (*Sqlite3)(unsafe.Pointer(db)).FnStatement++ (*Vdbe)(unsafe.Pointer(p)).FiStatement = ((*Sqlite3)(unsafe.Pointer(db)).FnSavepoint + (*Sqlite3)(unsafe.Pointer(db)).FnStatement) -__497: +__500: ; rc = Xsqlite3VtabSavepoint(tls, db, SAVEPOINT_BEGIN, ((*Vdbe)(unsafe.Pointer(p)).FiStatement - 1)) if !(rc == SQLITE_OK) { - goto __498 + goto __501 } rc = Xsqlite3BtreeBeginStmt(tls, pBt, (*Vdbe)(unsafe.Pointer(p)).FiStatement) -__498: +__501: ; // Store the current value of the database handles deferred constraint @@ -67413,21 +67732,21 @@ __498: // the value of this counter needs to be restored too. (*Vdbe)(unsafe.Pointer(p)).FnStmtDefCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons (*Vdbe)(unsafe.Pointer(p)).FnStmtDefImmCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons -__496: +__499: ; -__493: +__496: ; if !(((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) && ((*(*int32)(unsafe.Pointer(bp + 288 /* iMeta */)) != (*Op)(unsafe.Pointer(pOp)).Fp3) || ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpSchema)).FiGeneration != *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))))) { - goto __499 + goto __502 } // IMPLEMENTATION-OF: R-03189-51135 As each SQL statement runs, the schema // version is checked to ensure that the schema has not changed since the // SQL statement was prepared. Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg) - (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3DbStrDup(tls, db, ts+4752 /* "database schema ..." */) + (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3DbStrDup(tls, db, ts+4780 /* "database schema ..." */) // If the schema-cookie from the database file matches the cookie // stored with the in-memory representation of the schema, do // not reload the schema from the database file. @@ -67441,20 +67760,20 @@ __493: // to be invalidated whenever sqlite3_step() is called from within // a v-table method. if !((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpSchema)).Fschema_cookie != *(*int32)(unsafe.Pointer(bp + 288 /* iMeta */))) { - goto __500 + goto __503 } Xsqlite3ResetOneSchema(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1) -__500: +__503: ; libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(1), 0, 0x3) rc = SQLITE_SCHEMA -__499: +__502: ; if !(rc != 0) { - goto __501 + goto __504 } goto abort_due_to_error -__501: +__504: ; goto __8 @@ -67469,7 +67788,7 @@ __501: // There must be a read-lock on the database (either a transaction // must be started or there must be an open cursor) before // executing this instruction. -__75: +__76: ; iDb = (*Op)(unsafe.Pointer(pOp)).Fp1 iCookie = (*Op)(unsafe.Pointer(pOp)).Fp3 @@ -67493,7 +67812,7 @@ __75: // schema version is set to P3-P5. The "PRAGMA schema_version=N" statement // has P5 set to 1, so that the internal schema version will be different // from the database schema version, resulting in a schema reset. -__76: +__77: ; pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32) @@ -67501,36 +67820,36 @@ __76: // See note about index shifting on OP_ReadCookie rc = Xsqlite3BtreeUpdateMeta(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp2, uint32((*Op)(unsafe.Pointer(pOp)).Fp3)) if !((*Op)(unsafe.Pointer(pOp)).Fp2 == BTREE_SCHEMA_VERSION) { - goto __502 + goto __505 } // When the schema cookie changes, record the new cookie internally (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fschema_cookie = ((*Op)(unsafe.Pointer(pOp)).Fp3 - int32((*Op)(unsafe.Pointer(pOp)).Fp5)) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) - goto __503 -__502: + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) + goto __506 +__505: if !((*Op)(unsafe.Pointer(pOp)).Fp2 == BTREE_FILE_FORMAT) { - goto __504 + goto __507 } // Record changes in the file format (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = U8((*Op)(unsafe.Pointer(pOp)).Fp3) -__504: +__507: ; -__503: +__506: ; if !((*Op)(unsafe.Pointer(pOp)).Fp1 == 1) { - goto __505 + goto __508 } // Invalidate all prepared statements whenever the TEMP database // schema is changed. Ticket #1644 Xsqlite3ExpirePreparedStatements(tls, db, 0) libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3) -__505: +__508: ; if !(rc != 0) { - goto __506 + goto __509 } goto abort_due_to_error -__506: +__509: ; goto __8 @@ -67615,29 +67934,29 @@ __506: // in read/write mode. // // See also: OP_OpenRead, OP_ReopenIdx -__77: +__78: ; pCur = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) if !((pCur != 0) && ((*VdbeCursor)(unsafe.Pointer(pCur)).FpgnoRoot == U32((*Op)(unsafe.Pointer(pOp)).Fp2))) { - goto __507 + goto __510 } // Guaranteed by the code generator goto open_cursor_set_hints -__507: +__510: ; // If the cursor is not currently open or is open on a different // index, then fall through into OP_OpenRead to force a reopen -__78: __79: +__80: ; if !((int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.expired */)) & 0x3 >> 0)) == 1) { - goto __508 + goto __511 } rc = (SQLITE_ABORT | (int32(2) << 8)) goto abort_due_to_error -__508: +__511: ; nField1 = 0 @@ -67649,24 +67968,24 @@ __508: pX = (*Db)(unsafe.Pointer(pDb1)).FpBt if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_OpenWrite) { - goto __509 + goto __512 } wrFlag = (BTREE_WRCSR | (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_FORDELETE)) if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb1)).FpSchema)).Ffile_format) < int32((*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat)) { - goto __511 + goto __514 } (*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb1)).FpSchema)).Ffile_format -__511: +__514: ; - goto __510 -__509: + goto __513 +__512: wrFlag = 0 -__510: +__513: ; if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_P2ISREG) != 0) { - goto __512 + goto __515 } pIn2 = (aMem + uintptr(p23)*56) @@ -67678,32 +67997,32 @@ __510: // If there were a failure, the prepared statement would have halted // before reaching this instruction. -__512: +__515: ; if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-9)) { - goto __513 + goto __516 } pKeyInfo1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) nField1 = int32((*KeyInfo)(unsafe.Pointer(pKeyInfo1)).FnAllField) - goto __514 -__513: + goto __517 +__516: if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-3)) { - goto __515 + goto __518 } nField1 = *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)) -__515: +__518: ; -__514: +__517: ; // Table with INTEGER PRIMARY KEY and nothing else - pCur = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, nField1, iDb1, CURTYPE_BTREE) + pCur = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, nField1, iDb1, uint8(CURTYPE_BTREE)) if !(pCur == uintptr(0)) { - goto __516 + goto __519 } goto no_mem -__516: +__519: ; (*VdbeCursor)(unsafe.Pointer(pCur)).FnullRow = U8(1) libc.SetBitFieldPtr8Uint32(pCur+8 /* &.isOrdered */, Bool(1), 2, 0x4) @@ -67722,10 +68041,10 @@ open_cursor_set_hints: Xsqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 56 /* &.uc */)), (uint32(int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (OPFLAG_BULKCSR | OPFLAG_SEEKEQ)))) if !(rc != 0) { - goto __517 + goto __520 } goto abort_due_to_error -__517: +__520: ; goto __8 @@ -67736,18 +68055,18 @@ __517: // opcode. Only ephemeral cursors may be duplicated. // // Duplicate ephemeral cursors are used for self-joins of materialized views. -__80: // The new cursor +__81: // The new cursor pOrig = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*8)) // Only ephemeral cursors can be duplicated - pCx = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, int32((*VdbeCursor)(unsafe.Pointer(pOrig)).FnField), -1, CURTYPE_BTREE) + pCx = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, int32((*VdbeCursor)(unsafe.Pointer(pOrig)).FnField), -1, uint8(CURTYPE_BTREE)) if !(pCx == uintptr(0)) { - goto __518 + goto __521 } goto no_mem -__518: +__521: ; (*VdbeCursor)(unsafe.Pointer(pCx)).FnullRow = U8(1) libc.SetBitFieldPtr8Uint32(pCx+8 /* &.isEphemeral */, Bool(1), 0, 0x1) @@ -67763,7 +68082,7 @@ __518: goto __8 - // Opcode: OpenEphemeral P1 P2 * P4 P5 + // Opcode: OpenEphemeral P1 P2 P3 P4 P5 // Synopsis: nColumn=P2 // // Open a new cursor P1 to a transient table. @@ -67783,6 +68102,10 @@ __518: // in btree.h. These flags control aspects of the operation of // the btree. The BTREE_OMIT_JOURNAL and BTREE_SINGLE flags are // added automatically. + // + // If P3 is positive, then reg[P3] is modified slightly so that it + // can be used as zero-length data for OP_Insert. This is an optimization + // that avoids an extra OP_Blob opcode to initialize that register. // Opcode: OpenAutoindex P1 P2 * P4 * // Synopsis: nColumn=P2 // @@ -67790,79 +68113,90 @@ __518: // different name to distinguish its use. Tables created using // by this opcode will be used for automatically created transient // indices in joins. -__81: __82: +__83: ; + if !((*Op)(unsafe.Pointer(pOp)).Fp3 > 0) { + goto __522 + } + // Make register reg[P3] into a value that can be used as the data + // form sqlite3BtreeInsert() where the length of the data is zero. + // Only used when number of columns is zero + + (*Mem)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)).Fn = 0 + (*Mem)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)).Fz = ts + 703 /* "" */ +__522: + ; pCx1 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) if !((pCx1 != 0) && ((*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx != 0)) { - goto __519 + goto __523 } // If the ephermeral table is already open, erase all existing content // so that the table is empty again, rather than creating a new table. (*VdbeCursor)(unsafe.Pointer(pCx1)).FseqCount = int64(0) - (*VdbeCursor)(unsafe.Pointer(pCx1)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pCx1)).FcacheStatus = U32(CACHE_STALE) rc = Xsqlite3BtreeClearTable(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, int32((*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot), uintptr(0)) - goto __520 -__519: - pCx1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, CURTYPE_BTREE) + goto __524 +__523: + pCx1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, uint8(CURTYPE_BTREE)) if !(pCx1 == uintptr(0)) { - goto __521 + goto __525 } goto no_mem -__521: +__525: ; libc.SetBitFieldPtr8Uint32(pCx1+8 /* &.isEphemeral */, Bool(1), 0, 0x1) rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, (pCx1 + 16 /* &.pBtx */), ((BTREE_OMIT_JOURNAL | BTREE_SINGLE) | int32((*Op)(unsafe.Pointer(pOp)).Fp5)), vfsFlags) if !(rc == SQLITE_OK) { - goto __522 + goto __526 } rc = Xsqlite3BtreeBeginTrans(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, 1, uintptr(0)) -__522: +__526: ; if !(rc == SQLITE_OK) { - goto __523 + goto __527 } // If a transient index is required, create it by calling // sqlite3BtreeCreateTable() with the BTREE_BLOBKEY flag before // opening it. If a transient table is required, just use the // automatically created table with root-page 1 (an BLOB_INTKEY table). if !((libc.AssignPtrUintptr(pCx1+64 /* &.pKeyInfo */, libc.AssignUintptr(&pKeyInfo2, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))) != uintptr(0)) { - goto __524 + goto __528 } rc = Xsqlite3BtreeCreateTable(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, (pCx1 + 76 /* &.pgnoRoot */), (BTREE_BLOBKEY | int32((*Op)(unsafe.Pointer(pOp)).Fp5))) if !(rc == SQLITE_OK) { - goto __526 + goto __530 } rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot, BTREE_WRCSR, pKeyInfo2, *(*uintptr)(unsafe.Pointer(pCx1 + 56 /* &.uc */))) -__526: +__530: ; (*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(0) - goto __525 -__524: - (*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot = SCHEMA_ROOT - rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, SCHEMA_ROOT, BTREE_WRCSR, + goto __529 +__528: + (*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot = Pgno(SCHEMA_ROOT) + rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, uint32(SCHEMA_ROOT), BTREE_WRCSR, uintptr(0), *(*uintptr)(unsafe.Pointer(pCx1 + 56 /* &.uc */))) (*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(1) -__525: +__529: ; -__523: +__527: ; libc.SetBitFieldPtr8Uint32(pCx1+8 /* &.isOrdered */, (Bool(libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fp5) != BTREE_UNORDERED))), 2, 0x4) -__520: +__524: ; if !(rc != 0) { - goto __527 + goto __531 } goto abort_due_to_error -__527: +__531: ; (*VdbeCursor)(unsafe.Pointer(pCx1)).FnullRow = U8(1) goto __8 @@ -67876,24 +68210,24 @@ __527: // If argument P3 is non-zero, then it indicates that the sorter may // assume that a stable sort considering the first P3 fields of each // key is sufficient to produce the required results. -__83: +__84: ; - pCx2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, CURTYPE_SORTER) + pCx2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, uint8(CURTYPE_SORTER)) if !(pCx2 == uintptr(0)) { - goto __528 + goto __532 } goto no_mem -__528: +__532: ; (*VdbeCursor)(unsafe.Pointer(pCx2)).FpKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) rc = Xsqlite3VdbeSorterInit(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp3, pCx2) if !(rc != 0) { - goto __529 + goto __533 } goto abort_due_to_error -__529: +__533: ; goto __8 @@ -67903,15 +68237,15 @@ __529: // P1 is a sorter cursor. If the sequence counter is currently zero, jump // to P2. Regardless of whether or not the jump is taken, increment the // the sequence value. -__84: +__85: ; pC2 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) if !((libc.PostIncInt64(&(*VdbeCursor)(unsafe.Pointer(pC2)).FseqCount, 1)) == int64(0)) { - goto __530 + goto __534 } goto jump_to_p2 -__530: +__534: ; goto __8 @@ -67930,15 +68264,15 @@ __530: // // P3 is the number of fields in the records that will be stored by // the pseudo-table. -__85: +__86: ; - pCx3 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp3, -1, CURTYPE_PSEUDO) + pCx3 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp3, -1, uint8(CURTYPE_PSEUDO)) if !(pCx3 == uintptr(0)) { - goto __531 + goto __535 } goto no_mem -__531: +__535: ; (*VdbeCursor)(unsafe.Pointer(pCx3)).FnullRow = U8(1) (*VdbeCursor)(unsafe.Pointer(pCx3)).FseekResult = (*Op)(unsafe.Pointer(pOp)).Fp2 @@ -67955,7 +68289,7 @@ __531: // // Close a cursor previously opened as P1. If P1 is not // currently open, this instruction is a no-op. -__86: +__87: ; Xsqlite3VdbeFreeCursor(tls, p, *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))) *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) = uintptr(0) @@ -68047,10 +68381,10 @@ __86: // is an equality search. // // See also: Found, NotFound, SeekGt, SeekGe, SeekLt -__87: // jump, in3, group __88: // jump, in3, group __89: // jump, in3, group -__90: // Only interested in == results +__90: // jump, in3, group +__91: // Only interested in == results ; @@ -68061,9 +68395,9 @@ __90: // Only interested in == results (*VdbeCursor)(unsafe.Pointer(pC3)).FnullRow = U8(0) (*VdbeCursor)(unsafe.Pointer(pC3)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus = U32(CACHE_STALE) if !((*VdbeCursor)(unsafe.Pointer(pC3)).FisTable != 0) { - goto __532 + goto __536 } // The OPFLAG_SEEKEQ/BTREE_SEEK_EQ flag is only set on index cursors @@ -68073,10 +68407,10 @@ __90: // Only interested in == results pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) flags31 = (*Mem)(unsafe.Pointer(pIn3)).Fflags if !((int32(flags31) & (((MEM_Int | MEM_Real) | MEM_IntReal) | MEM_Str)) == MEM_Str) { - goto __534 + goto __538 } applyNumericAffinity(tls, pIn3, 0) -__534: +__538: ; iKey = Xsqlite3VdbeIntValue(tls, pIn3) // Get the integer key value newType = (*Mem)(unsafe.Pointer(pIn3)).Fflags // Record the type after applying numeric affinity @@ -68085,30 +68419,30 @@ __534: // If the P3 value could not be converted into an integer without // loss of information, then special processing is required... if !((int32(newType) & (MEM_Int | MEM_IntReal)) == 0) { - goto __535 + goto __539 } if !((int32(newType) & MEM_Real) == 0) { - goto __536 + goto __540 } if !(((int32(newType) & MEM_Null) != 0) || (oc >= OP_SeekGE)) { - goto __538 + goto __542 } goto jump_to_p2 - goto __539 -__538: + goto __543 +__542: rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), bp+296 /* &res1 */) if !(rc != SQLITE_OK) { - goto __540 + goto __544 } goto abort_due_to_error -__540: +__544: ; goto seek_not_found -__539: +__543: ; - goto __537 -__536: + goto __541 +__540: // If the approximation iKey is larger than the actual real search // term, substitute >= for > and < for <=. e.g. if the search term @@ -68117,55 +68451,55 @@ __536: // (x > 4.9) -> (x >= 5) // (x <= 4.9) -> (x < 5) if !(*(*float64)(unsafe.Pointer(pIn3 /* &.u */)) < float64(iKey)) { - goto __541 + goto __545 } if !((oc & 0x0001) == (OP_SeekGT & 0x0001)) { - goto __543 + goto __547 } oc-- -__543: +__547: ; - goto __542 -__541: + goto __546 +__545: if !(*(*float64)(unsafe.Pointer(pIn3 /* &.u */)) > float64(iKey)) { - goto __544 + goto __548 } if !((oc & 0x0001) == (OP_SeekLT & 0x0001)) { - goto __545 + goto __549 } oc++ -__545: +__549: ; -__544: +__548: ; -__542: +__546: ; -__537: +__541: ; -__535: +__539: ; rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), uintptr(0), int64(U64(iKey)), 0, bp+296 /* &res1 */) (*VdbeCursor)(unsafe.Pointer(pC3)).FmovetoTarget = iKey // Used by OP_Delete if !(rc != SQLITE_OK) { - goto __546 + goto __550 } goto abort_due_to_error -__546: +__550: ; - goto __533 -__532: + goto __537 +__536: // For a cursor with the OPFLAG_SEEKEQ/BTREE_SEEK_EQ hint, only the // OP_SeekGE and OP_SeekLE opcodes are allowed, and these must be // immediately followed by an OP_IdxGT or OP_IdxLT opcode, respectively, // with the same key. - if !(Xsqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), BTREE_SEEK_EQ) != 0) { - goto __547 + if !(Xsqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), uint32(BTREE_SEEK_EQ)) != 0) { + goto __551 } eqOnly = 1 -__547: +__551: ; nField2 = *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)) @@ -68190,127 +68524,269 @@ __547: (*UnpackedRecord)(unsafe.Pointer(bp + 304 /* &r */)).FeqSeen = U8(0) rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), bp+304 /* &r */, int64(0), 0, bp+296 /* &res1 */) if !(rc != SQLITE_OK) { - goto __548 + goto __552 } goto abort_due_to_error -__548: +__552: ; if !((eqOnly != 0) && (int32((*UnpackedRecord)(unsafe.Pointer(bp+304 /* &r */)).FeqSeen) == 0)) { - goto __549 + goto __553 } goto seek_not_found -__549: +__553: ; -__533: +__537: ; if !(oc >= OP_SeekGE) { - goto __550 + goto __554 } if !((*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) < 0) || ((*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) == 0) && (oc == OP_SeekGT))) { - goto __552 + goto __556 } *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 0 rc = Xsqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), 0) if !(rc != SQLITE_OK) { - goto __554 + goto __558 } if !(rc == SQLITE_DONE) { - goto __555 + goto __559 } rc = SQLITE_OK *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 1 - goto __556 -__555: + goto __560 +__559: goto abort_due_to_error -__556: +__560: ; +__558: + ; + goto __557 +__556: + *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 0 +__557: + ; + goto __555 __554: - ; - goto __553 -__552: - *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 0 -__553: - ; - goto __551 -__550: ; if !((*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) > 0) || ((*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) == 0) && (oc == OP_SeekLT))) { - goto __557 + goto __561 } *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 0 rc = Xsqlite3BtreePrevious(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), 0) if !(rc != SQLITE_OK) { - goto __559 + goto __563 } if !(rc == SQLITE_DONE) { - goto __560 + goto __564 } rc = SQLITE_OK *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 1 - goto __561 -__560: + goto __565 +__564: goto abort_due_to_error +__565: + ; +__563: + ; + goto __562 __561: - ; -__559: - ; - goto __558 -__557: // res might be negative because the table is empty. Check to // see if this is the case. *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = Xsqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */))) -__558: +__562: ; -__551: +__555: ; seek_not_found: ; if !(*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) != 0) { - goto __562 + goto __566 } goto jump_to_p2 - goto __563 -__562: + goto __567 +__566: if !(eqOnly != 0) { - goto __564 + goto __568 } pOp += 24 // Skip the OP_IdxLt or OP_IdxGT that follows -__564: +__568: ; -__563: +__567: ; goto __8 - // Opcode: SeekHit P1 P2 * * * - // Synopsis: seekHit=P2 + // Opcode: SeekScan P1 P2 * * * + // Synopsis: Scan-ahead up to P1 rows // - // Set the seekHit flag on cursor P1 to the value in P2. - // The seekHit flag is used by the IfNoHope opcode. + // This opcode is a prefix opcode to OP_SeekGE. In other words, this + // opcode must be immediately followed by OP_SeekGE. This constraint is + // checked by assert() statements. // - // P1 must be a valid b-tree cursor. P2 must be a boolean value, - // either 0 or 1. -__91: + // This opcode uses the P1 through P4 operands of the subsequent + // OP_SeekGE. In the text that follows, the operands of the subsequent + // OP_SeekGE opcode are denoted as SeekOP.P1 through SeekOP.P4. Only + // the P1 and P2 operands of this opcode are also used, and are called + // This.P1 and This.P2. + // + // This opcode helps to optimize IN operators on a multi-column index + // where the IN operator is on the later terms of the index by avoiding + // unnecessary seeks on the btree, substituting steps to the next row + // of the b-tree instead. A correct answer is obtained if this opcode + // is omitted or is a no-op. + // + // The SeekGE.P3 and SeekGE.P4 operands identify an unpacked key which + // is the desired entry that we want the cursor SeekGE.P1 to be pointing + // to. Call this SeekGE.P4/P5 row the "target". + // + // If the SeekGE.P1 cursor is not currently pointing to a valid row, + // then this opcode is a no-op and control passes through into the OP_SeekGE. + // + // If the SeekGE.P1 cursor is pointing to a valid row, then that row + // might be the target row, or it might be near and slightly before the + // target row. This opcode attempts to position the cursor on the target + // row by, perhaps by invoking sqlite3BtreeStep() on the cursor + // between 0 and This.P1 times. + // + // There are three possible outcomes from this opcode:
      + // + //
    1. If after This.P1 steps, the cursor is still point to a place that + // is earlier in the btree than the target row, + // then fall through into the subsquence OP_SeekGE opcode. + // + //
    2. If the cursor is successfully moved to the target row by 0 or more + // sqlite3BtreeNext() calls, then jump to This.P2, which will land just + // past the OP_IdxGT opcode that follows the OP_SeekGE. + // + //
    3. If the cursor ends up past the target row (indicating the the target + // row does not exist in the btree) then jump to SeekOP.P2. + //
    +__92: ; - pC4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - libc.SetBitFieldPtr8Uint32(pC4+8 /* &.seekHit */, (Bool((*Op)(unsafe.Pointer(pOp)).Fp2 & 1)), 3, 0x8) + // pOp->p2 points to the first instruction past the OP_IdxGT that + // follows the OP_SeekGE. + + pC4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp+1*24)).Fp1)*8)) + + if !(!(Xsqlite3BtreeCursorIsValidNN(tls, *(*uintptr)(unsafe.Pointer(pC4 + 56 /* &.uc */))) != 0)) { + goto __569 + } + goto __8 +__569: + ; + nStep = (*Op)(unsafe.Pointer(pOp)).Fp1 + + (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC4)).FpKeyInfo + (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 1*24 + 16 /* &.p4 */))) + (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).Fdefault_rc = int8(0) + (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp+1*24)).Fp3)*56) + *(*int32)(unsafe.Pointer(bp + 352 /* res3 */)) = 0 // Not needed. Only used to silence a warning. +__570: + if !(1 != 0) { + goto __571 + } + rc = Xsqlite3VdbeIdxKeyCompare(tls, db, pC4, bp+328 /* &r1 */, bp+352 /* &res3 */) + if !(rc != 0) { + goto __572 + } + goto abort_due_to_error +__572: + ; + if !(*(*int32)(unsafe.Pointer(bp + 352 /* res3 */)) > 0) { + goto __573 + } +seekscan_search_fail: + ; + pOp += 24 + goto jump_to_p2 +__573: + ; + if !(*(*int32)(unsafe.Pointer(bp + 352 /* res3 */)) == 0) { + goto __574 + } + + goto jump_to_p2 + goto __571 +__574: + ; + if !(nStep <= 0) { + goto __575 + } + + goto __571 +__575: + ; + nStep-- + rc = Xsqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC4 + 56 /* &.uc */)), 0) + if !(rc != 0) { + goto __576 + } + if !(rc == SQLITE_DONE) { + goto __577 + } + rc = SQLITE_OK + goto seekscan_search_fail + goto __578 +__577: + goto abort_due_to_error +__578: + ; +__576: + ; + goto __570 +__571: + ; + + goto __8 + + // Opcode: SeekHit P1 P2 P3 * * + // Synopsis: set P2<=seekHit<=P3 + // + // Increase or decrease the seekHit value for cursor P1, if necessary, + // so that it is no less than P2 and no greater than P3. + // + // The seekHit integer represents the maximum of terms in an index for which + // there is known to be at least one match. If the seekHit value is smaller + // than the total number of equality terms in an index lookup, then the + // OP_IfNoHope opcode might run to see if the IN loop can be abandoned + // early, thus saving work. This is part of the IN-early-out optimization. + // + // P1 must be a valid b-tree cursor. +__93: + ; + pC5 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + + if !(int32((*VdbeCursor)(unsafe.Pointer(pC5)).FseekHit) < (*Op)(unsafe.Pointer(pOp)).Fp2) { + goto __579 + } + (*VdbeCursor)(unsafe.Pointer(pC5)).FseekHit = U16((*Op)(unsafe.Pointer(pOp)).Fp2) + goto __580 +__579: + if !(int32((*VdbeCursor)(unsafe.Pointer(pC5)).FseekHit) > (*Op)(unsafe.Pointer(pOp)).Fp3) { + goto __581 + } + (*VdbeCursor)(unsafe.Pointer(pC5)).FseekHit = U16((*Op)(unsafe.Pointer(pOp)).Fp3) +__581: + ; +__580: + ; goto __8 // Opcode: IfNotOpen P1 P2 * * * // Synopsis: if( !csr[P1] ) goto P2 // // If cursor P1 is not open, jump to instruction P2. Otherwise, fall through. -__92: // jump +__94: // jump ; if !(!(int32(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))) != 0)) { - goto __565 + goto __582 } goto jump_to_p2_and_check_for_interrupt -__565: +__582: ; goto __8 @@ -68352,16 +68828,20 @@ __565: // Synopsis: key=r[P3@P4] // // Register P3 is the first of P4 registers that form an unpacked - // record. + // record. Cursor P1 is an index btree. P2 is a jump destination. + // In other words, the operands to this opcode are the same as the + // operands to OP_NotFound and OP_IdxGT. // - // Cursor P1 is on an index btree. If the seekHit flag is set on P1, then - // this opcode is a no-op. But if the seekHit flag of P1 is clear, then - // check to see if there is any entry in P1 that matches the - // prefix identified by P3 and P4. If no entry matches the prefix, - // jump to P2. Otherwise fall through. + // This opcode is an optimization attempt only. If this opcode always + // falls through, the correct answer is still obtained, but extra works + // is performed. // - // This opcode behaves like OP_NotFound if the seekHit - // flag is clear and it behaves like OP_Noop if the seekHit flag is set. + // A value of N in the seekHit flag of cursor P1 means that there exists + // a key P3:N that will match some record in the index. We want to know + // if it is possible for a record P3:P4 to match some record in the + // index. If it is not possible, we can skips some work. So if seekHit + // is less than P4, attempt to find out if a match is possible by running + // OP_NotFound. // // This opcode is used in IN clause processing for a multi-column key. // If an IN clause is attached to an element of the key other than the @@ -68396,36 +68876,36 @@ __565: // opcodes do not work after this operation. // // See also: NotFound, Found, NotExists -__93: +__95: ; - pC5 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC6 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - if !((Bool(int32(*(*uint8)(unsafe.Pointer(pC5 + 8 /* &.seekHit */)) & 0x8 >> 3))) != 0) { - goto __566 + if !(int32((*VdbeCursor)(unsafe.Pointer(pC6)).FseekHit) >= *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) { + goto __583 } goto __8 -__566: +__583: ; -__94: // jump, in3 -__95: // jump, in3 -__96: +__96: // jump, in3 +__97: // jump, in3 +__98: ; - pC6 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC7 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)) > 0) { - goto __567 + goto __584 } - (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC6)).FpKeyInfo - (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) - (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FaMem = pIn3 - pIdxKey = bp + 328 /* &r1 */ + (*UnpackedRecord)(unsafe.Pointer(bp + 360 /* &r2 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC7)).FpKeyInfo + (*UnpackedRecord)(unsafe.Pointer(bp + 360 /* &r2 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) + (*UnpackedRecord)(unsafe.Pointer(bp + 360 /* &r2 */)).FaMem = pIn3 + pIdxKey = bp + 360 /* &r2 */ pFree = uintptr(0) - goto __568 -__567: + goto __585 +__584: ; rc = func() int32 { if (int32((*Mem)(unsafe.Pointer((pIn3))).Fflags) & MEM_Zero) != 0 { @@ -68435,88 +68915,94 @@ __567: }() if !(rc != 0) { - goto __569 + goto __586 } goto no_mem -__569: +__586: ; - pFree = libc.AssignUintptr(&pIdxKey, Xsqlite3VdbeAllocUnpackedRecord(tls, (*VdbeCursor)(unsafe.Pointer(pC6)).FpKeyInfo)) + pFree = libc.AssignUintptr(&pIdxKey, Xsqlite3VdbeAllocUnpackedRecord(tls, (*VdbeCursor)(unsafe.Pointer(pC7)).FpKeyInfo)) if !(pIdxKey == uintptr(0)) { - goto __570 + goto __587 } goto no_mem -__570: +__587: ; - Xsqlite3VdbeRecordUnpack(tls, (*VdbeCursor)(unsafe.Pointer(pC6)).FpKeyInfo, (*Mem)(unsafe.Pointer(pIn3)).Fn, (*Mem)(unsafe.Pointer(pIn3)).Fz, pIdxKey) -__568: + Xsqlite3VdbeRecordUnpack(tls, (*VdbeCursor)(unsafe.Pointer(pC7)).FpKeyInfo, (*Mem)(unsafe.Pointer(pIn3)).Fn, (*Mem)(unsafe.Pointer(pIn3)).Fz, pIdxKey) +__585: ; (*UnpackedRecord)(unsafe.Pointer(pIdxKey)).Fdefault_rc = int8(0) takeJump = 0 if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_NoConflict) { - goto __571 + goto __588 } // For the OP_NoConflict opcode, take the jump if any of the // input fields are NULL, since any key with a NULL will not // conflict ii1 = 0 -__572: +__589: if !(ii1 < int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField)) { - goto __574 + goto __591 } if !((int32((*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FaMem+uintptr(ii1)*56)).Fflags) & MEM_Null) != 0) { - goto __575 + goto __592 } takeJump = 1 - goto __574 -__575: + goto __591 +__592: ; - goto __573 -__573: + goto __590 +__590: ii1++ - goto __572 - goto __574 -__574: + goto __589 + goto __591 +__591: ; -__571: +__588: ; - rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC6 + 56 /* &.uc */)), pIdxKey, int64(0), 0, bp+352 /* &res3 */) + rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC7 + 56 /* &.uc */)), pIdxKey, int64(0), 0, bp+384 /* &res4 */) if !(pFree != 0) { - goto __576 + goto __593 } Xsqlite3DbFreeNN(tls, db, pFree) -__576: +__593: ; if !(rc != SQLITE_OK) { - goto __577 + goto __594 } goto abort_due_to_error -__577: +__594: ; - (*VdbeCursor)(unsafe.Pointer(pC6)).FseekResult = *(*int32)(unsafe.Pointer(bp + 352 /* res3 */)) - alreadyExists = (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 352 /* res3 */)) == 0)) - (*VdbeCursor)(unsafe.Pointer(pC6)).FnullRow = (U8(1 - alreadyExists)) - (*VdbeCursor)(unsafe.Pointer(pC6)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC6)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC7)).FseekResult = *(*int32)(unsafe.Pointer(bp + 384 /* res4 */)) + alreadyExists = (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 384 /* res4 */)) == 0)) + (*VdbeCursor)(unsafe.Pointer(pC7)).FnullRow = (U8(1 - alreadyExists)) + (*VdbeCursor)(unsafe.Pointer(pC7)).FdeferredMoveto = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC7)).FcacheStatus = U32(CACHE_STALE) if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_Found) { - goto __578 + goto __595 } if !(alreadyExists != 0) { - goto __580 + goto __597 } goto jump_to_p2 -__580: +__597: ; - goto __579 -__578: + goto __596 +__595: ; if !((takeJump != 0) || !(alreadyExists != 0)) { - goto __581 + goto __598 } goto jump_to_p2 -__581: +__598: ; -__579: + if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_IfNoHope) { + goto __599 + } + (*VdbeCursor)(unsafe.Pointer(pC7)).FseekHit = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) +__599: + ; +__596: ; goto __8 @@ -68565,68 +69051,68 @@ __579: // not work following this opcode. // // See also: Found, NotFound, NoConflict, SeekRowid -__97: +__99: pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !((int32((*Mem)(unsafe.Pointer(pIn3)).Fflags) & (MEM_Int | MEM_IntReal)) == 0) { - goto __582 + goto __600 } // If pIn3->u.i does not contain an integer, compute iKey as the // integer value of pIn3. Jump to P2 if pIn3 cannot be converted // into an integer without loss of information. Take care to avoid // changing the datatype of pIn3, however, as it is used by other // parts of the prepared statement. - *(*Mem)(unsafe.Pointer(bp + 360 /* x */)) = *(*Mem)(unsafe.Pointer(pIn3)) - applyAffinity(tls, bp+360 /* &x */, SQLITE_AFF_NUMERIC, encoding) - if !((int32((*Mem)(unsafe.Pointer(bp+360 /* &x */)).Fflags) & MEM_Int) == 0) { - goto __583 + *(*Mem)(unsafe.Pointer(bp + 392 /* x */)) = *(*Mem)(unsafe.Pointer(pIn3)) + applyAffinity(tls, bp+392 /* &x */, int8(SQLITE_AFF_NUMERIC), encoding) + if !((int32((*Mem)(unsafe.Pointer(bp+392 /* &x */)).Fflags) & MEM_Int) == 0) { + goto __601 } goto jump_to_p2 -__583: +__601: ; - iKey1 = U64(*(*I64)(unsafe.Pointer(bp + 360 /* &x */ /* &.u */))) + iKey1 = U64(*(*I64)(unsafe.Pointer(bp + 392 /* &x */ /* &.u */))) goto notExistsWithKey -__582: +__600: ; -__98: // jump, in3 +__100: // jump, in3 pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) iKey1 = U64(*(*I64)(unsafe.Pointer(pIn3 /* &.u */))) notExistsWithKey: - pC7 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC8 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pCrsr2 = *(*uintptr)(unsafe.Pointer(pC7 + 56 /* &.uc */)) + pCrsr2 = *(*uintptr)(unsafe.Pointer(pC8 + 56 /* &.uc */)) - *(*int32)(unsafe.Pointer(bp + 416 /* res4 */)) = 0 - rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr2, uintptr(0), int64(iKey1), 0, bp+416 /* &res4 */) + *(*int32)(unsafe.Pointer(bp + 448 /* res5 */)) = 0 + rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr2, uintptr(0), int64(iKey1), 0, bp+448 /* &res5 */) - (*VdbeCursor)(unsafe.Pointer(pC7)).FmovetoTarget = I64(iKey1) // Used by OP_Delete - (*VdbeCursor)(unsafe.Pointer(pC7)).FnullRow = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC7)).FcacheStatus = CACHE_STALE - (*VdbeCursor)(unsafe.Pointer(pC7)).FdeferredMoveto = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC8)).FmovetoTarget = I64(iKey1) // Used by OP_Delete + (*VdbeCursor)(unsafe.Pointer(pC8)).FnullRow = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC8)).FcacheStatus = U32(CACHE_STALE) + (*VdbeCursor)(unsafe.Pointer(pC8)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC7)).FseekResult = *(*int32)(unsafe.Pointer(bp + 416 /* res4 */)) - if !(*(*int32)(unsafe.Pointer(bp + 416 /* res4 */)) != 0) { - goto __584 + (*VdbeCursor)(unsafe.Pointer(pC8)).FseekResult = *(*int32)(unsafe.Pointer(bp + 448 /* res5 */)) + if !(*(*int32)(unsafe.Pointer(bp + 448 /* res5 */)) != 0) { + goto __602 } if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 0) { - goto __585 + goto __603 } - rc = Xsqlite3CorruptError(tls, 90022) - goto __586 -__585: + rc = Xsqlite3CorruptError(tls, 90810) + goto __604 +__603: goto jump_to_p2 -__586: +__604: ; -__584: +__602: ; if !(rc != 0) { - goto __587 + goto __605 } goto abort_due_to_error -__587: +__605: ; goto __8 @@ -68637,7 +69123,7 @@ __587: // Write the sequence number into register P2. // The sequence number on the cursor is incremented after this // instruction. -__99: // out2 +__101: // out2 ; pOut = out2Prerelease(tls, p, pOp) @@ -68658,13 +69144,13 @@ __99: // out2 // an SQLITE_FULL error is generated. The P3 register is updated with the ' // generated record number. This P3 mechanism is used to help implement the // AUTOINCREMENT feature. -__100: // Root frame of VDBE +__102: // Root frame of VDBE - *(*I64)(unsafe.Pointer(bp + 424 /* v */)) = int64(0) - *(*int32)(unsafe.Pointer(bp + 420 /* res5 */)) = 0 + *(*I64)(unsafe.Pointer(bp + 456 /* v */)) = int64(0) + *(*int32)(unsafe.Pointer(bp + 452 /* res6 */)) = 0 pOut = out2Prerelease(tls, p, pOp) - pC8 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC9 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) // The next rowid or record number (different terms for the same // thing) is obtained in a two-step algorithm. @@ -68683,90 +69169,90 @@ __100: // Root frame of VDBE // Others complain about 0x7ffffffffffffffffLL. The following macro seems // to provide the constant while making all compilers happy. - if !(!((int32(*(*uint8)(unsafe.Pointer(pC8 + 8 /* &.useRandomRowid */)) & 0x2 >> 1)) != 0)) { - goto __588 + if !(!((int32(*(*uint8)(unsafe.Pointer(pC9 + 8 /* &.useRandomRowid */)) & 0x2 >> 1)) != 0)) { + goto __606 } - rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC8 + 56 /* &.uc */)), bp+420 /* &res5 */) + rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC9 + 56 /* &.uc */)), bp+452 /* &res6 */) if !(rc != SQLITE_OK) { - goto __589 + goto __607 } goto abort_due_to_error -__589: +__607: ; - if !(*(*int32)(unsafe.Pointer(bp + 420 /* res5 */)) != 0) { - goto __590 + if !(*(*int32)(unsafe.Pointer(bp + 452 /* res6 */)) != 0) { + goto __608 } - *(*I64)(unsafe.Pointer(bp + 424 /* v */)) = int64(1) // IMP: R-61914-48074 - goto __591 -__590: + *(*I64)(unsafe.Pointer(bp + 456 /* v */)) = int64(1) // IMP: R-61914-48074 + goto __609 +__608: ; - *(*I64)(unsafe.Pointer(bp + 424 /* v */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC8 + 56 /* &.uc */))) - if !(*(*I64)(unsafe.Pointer(bp + 424 /* v */)) >= (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) { - goto __592 + *(*I64)(unsafe.Pointer(bp + 456 /* v */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC9 + 56 /* &.uc */))) + if !(*(*I64)(unsafe.Pointer(bp + 456 /* v */)) >= (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) { + goto __610 } - libc.SetBitFieldPtr8Uint32(pC8+8 /* &.useRandomRowid */, Bool(1), 1, 0x2) - goto __593 -__592: - *(*I64)(unsafe.Pointer(bp + 424 /* v */))++ // IMP: R-29538-34987 -__593: + libc.SetBitFieldPtr8Uint32(pC9+8 /* &.useRandomRowid */, Bool(1), 1, 0x2) + goto __611 +__610: + *(*I64)(unsafe.Pointer(bp + 456 /* v */))++ // IMP: R-29538-34987 +__611: ; -__591: +__609: ; -__588: +__606: ; if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) { - goto __594 + goto __612 } // Assert that P3 is a valid memory cell. if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) { - goto __595 + goto __613 } pFrame1 = (*Vdbe)(unsafe.Pointer(p)).FpFrame -__597: +__615: if !((*VdbeFrame)(unsafe.Pointer(pFrame1)).FpParent != 0) { - goto __599 + goto __617 } - goto __598 -__598: + goto __616 +__616: pFrame1 = (*VdbeFrame)(unsafe.Pointer(pFrame1)).FpParent - goto __597 - goto __599 -__599: + goto __615 + goto __617 +__617: ; // Assert that P3 is a valid memory cell. pMem1 = ((*VdbeFrame)(unsafe.Pointer(pFrame1)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - goto __596 -__595: + goto __614 +__613: // Assert that P3 is a valid memory cell. ; pMem1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) -__596: +__614: ; Xsqlite3VdbeMemIntegerify(tls, pMem1) // mem(P3) holds an integer - if !((*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) == (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) || ((Bool(int32(*(*uint8)(unsafe.Pointer(pC8 + 8 /* &.useRandomRowid */)) & 0x2 >> 1))) != 0)) { - goto __600 + if !((*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) == (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) || ((Bool(int32(*(*uint8)(unsafe.Pointer(pC9 + 8 /* &.useRandomRowid */)) & 0x2 >> 1))) != 0)) { + goto __618 } rc = SQLITE_FULL // IMP: R-17817-00630 goto abort_due_to_error -__600: +__618: ; - if !(*(*I64)(unsafe.Pointer(bp + 424 /* v */)) < (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1))) { - goto __601 + if !(*(*I64)(unsafe.Pointer(bp + 456 /* v */)) < (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1))) { + goto __619 } - *(*I64)(unsafe.Pointer(bp + 424 /* v */)) = (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1)) -__601: + *(*I64)(unsafe.Pointer(bp + 456 /* v */)) = (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1)) +__619: ; - *(*I64)(unsafe.Pointer(pMem1 /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 424 /* v */)) -__594: + *(*I64)(unsafe.Pointer(pMem1 /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 456 /* v */)) +__612: ; - if !((Bool(int32(*(*uint8)(unsafe.Pointer(pC8 + 8 /* &.useRandomRowid */)) & 0x2 >> 1))) != 0) { - goto __602 + if !((Bool(int32(*(*uint8)(unsafe.Pointer(pC9 + 8 /* &.useRandomRowid */)) & 0x2 >> 1))) != 0) { + goto __620 } // IMPLEMENTATION-OF: R-07677-41881 If the largest ROWID is equal to the // largest possible integer (9223372036854775807) then the database @@ -68775,41 +69261,41 @@ __594: // We cannot be in random rowid mode if this is // an AUTOINCREMENT table. cnt1 = 0 -__603: - Xsqlite3_randomness(tls, int32(unsafe.Sizeof(I64(0))), bp+424 /* &v */) - *(*I64)(unsafe.Pointer(bp + 424 /* v */)) &= (I64((int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) >> 1) - *(*I64)(unsafe.Pointer(bp + 424 /* v */))++ // Ensure that v is greater than zero - goto __604 -__604: - if (((libc.AssignInt32(&rc, Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC8 + 56 /* &.uc */)), uintptr(0), int64(U64(*(*I64)(unsafe.Pointer(bp + 424 /* v */)))), - 0, bp+420 /* &res5 */))) == SQLITE_OK) && - (*(*int32)(unsafe.Pointer(bp + 420 /* res5 */)) == 0)) && +__621: + Xsqlite3_randomness(tls, int32(unsafe.Sizeof(I64(0))), bp+456 /* &v */) + *(*I64)(unsafe.Pointer(bp + 456 /* v */)) &= (I64((int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) >> 1) + *(*I64)(unsafe.Pointer(bp + 456 /* v */))++ // Ensure that v is greater than zero + goto __622 +__622: + if (((libc.AssignInt32(&rc, Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC9 + 56 /* &.uc */)), uintptr(0), int64(U64(*(*I64)(unsafe.Pointer(bp + 456 /* v */)))), + 0, bp+452 /* &res6 */))) == SQLITE_OK) && + (*(*int32)(unsafe.Pointer(bp + 452 /* res6 */)) == 0)) && (libc.PreIncInt32(&cnt1, 1) < 100) { - goto __603 + goto __621 } - goto __605 -__605: + goto __623 +__623: ; if !(rc != 0) { - goto __606 + goto __624 } goto abort_due_to_error -__606: +__624: ; - if !(*(*int32)(unsafe.Pointer(bp + 420 /* res5 */)) == 0) { - goto __607 + if !(*(*int32)(unsafe.Pointer(bp + 452 /* res6 */)) == 0) { + goto __625 } rc = SQLITE_FULL // IMP: R-38219-53002 goto abort_due_to_error -__607: +__625: ; // EV: R-40812-03570 -__602: +__620: ; - (*VdbeCursor)(unsafe.Pointer(pC8)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC8)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC9)).FdeferredMoveto = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC9)).FcacheStatus = U32(CACHE_STALE) - *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 424 /* v */)) + *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 456 /* v */)) goto __8 // Opcode: Insert P1 P2 P3 P4 P5 @@ -68848,112 +69334,142 @@ __602: // // This instruction only works on tables. The equivalent instruction // for indices is OP_IdxInsert. -__101: // Payload to be inserted +__103: // Payload to be inserted pData = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) - pC9 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC10 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) pKey = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnKey = *(*I64)(unsafe.Pointer(pKey /* &.u */)) + (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FnKey = *(*I64)(unsafe.Pointer(pKey /* &.u */)) if !((int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-6)) && (((*Sqlite3)(unsafe.Pointer((db))).FxPreUpdateCallback != 0) || ((*Sqlite3)(unsafe.Pointer((db))).FxUpdateCallback != 0))) { - goto __608 + goto __626 } - zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC9)).FiDb)*32)).FzDbSName + zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC10)).FiDb)*32)).FzDbSName pTab = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - goto __609 -__608: + goto __627 +__626: pTab = uintptr(0) zDb = uintptr(0) // Not needed. Silence a compiler warning. -__609: +__627: ; // Invoke the pre-update hook, if any if !(pTab != 0) { - goto __610 + goto __628 } if !(((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0) && !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_ISUPDATE) != 0)) { - goto __611 + goto __629 } - Xsqlite3VdbePreUpdateHook(tls, p, pC9, SQLITE_INSERT, zDb, pTab, (*BtreePayload)(unsafe.Pointer(bp+432 /* &x1 */)).FnKey, (*Op)(unsafe.Pointer(pOp)).Fp2) -__611: + Xsqlite3VdbePreUpdateHook(tls, p, pC10, SQLITE_INSERT, zDb, pTab, (*BtreePayload)(unsafe.Pointer(bp+464 /* &x1 */)).FnKey, (*Op)(unsafe.Pointer(pOp)).Fp2) +__629: ; if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback == uintptr(0)) || ((*Table)(unsafe.Pointer(pTab)).FaCol == uintptr(0))) { - goto __612 + goto __630 } // Prevent post-update hook from running in cases when it should not pTab = uintptr(0) -__612: +__630: ; -__610: +__628: ; if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_ISNOOP) != 0) { - goto __613 + goto __631 } goto __8 -__613: +__631: ; if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_NCHANGE) != 0) { - goto __614 + goto __632 } (*Vdbe)(unsafe.Pointer(p)).FnChange++ -__614: +__632: ; if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_LASTROWID) != 0) { - goto __615 + goto __633 } - (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnKey -__615: + (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FnKey +__633: ; - (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FpData = (*Mem)(unsafe.Pointer(pData)).Fz - (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnData = (*Mem)(unsafe.Pointer(pData)).Fn + (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FpData = (*Mem)(unsafe.Pointer(pData)).Fz + (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FnData = (*Mem)(unsafe.Pointer(pData)).Fn seekResult = func() int32 { if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_USESEEKRESULT) != 0 { - return (*VdbeCursor)(unsafe.Pointer(pC9)).FseekResult + return (*VdbeCursor)(unsafe.Pointer(pC10)).FseekResult } return 0 }() if !((int32((*Mem)(unsafe.Pointer(pData)).Fflags) & MEM_Zero) != 0) { - goto __616 + goto __634 } - (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnZero = *(*int32)(unsafe.Pointer(pData /* &.u */)) - goto __617 -__616: - (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnZero = 0 -__617: + (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FnZero = *(*int32)(unsafe.Pointer(pData /* &.u */)) + goto __635 +__634: + (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FnZero = 0 +__635: ; - (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FpKey = uintptr(0) - rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC9 + 56 /* &.uc */)), bp+432, /* &x1 */ - (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (OPFLAG_APPEND | OPFLAG_SAVEPOSITION)), seekResult) - (*VdbeCursor)(unsafe.Pointer(pC9)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC9)).FcacheStatus = CACHE_STALE + (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FpKey = uintptr(0) + rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC10 + 56 /* &.uc */)), bp+464, /* &x1 */ + (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & ((OPFLAG_APPEND | OPFLAG_SAVEPOSITION) | OPFLAG_PREFORMAT)), + seekResult) + (*VdbeCursor)(unsafe.Pointer(pC10)).FdeferredMoveto = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC10)).FcacheStatus = U32(CACHE_STALE) // Invoke the update-hook if required. if !(rc != 0) { - goto __618 + goto __636 } goto abort_due_to_error -__618: +__636: ; if !(pTab != 0) { - goto __619 + goto __637 } - (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 304 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, + (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 312 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, func() int32 { if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_ISUPDATE) != 0 { return SQLITE_UPDATE } return SQLITE_INSERT }(), - zDb, (*Table)(unsafe.Pointer(pTab)).FzName, (*BtreePayload)(unsafe.Pointer(bp+432 /* &x1 */)).FnKey) -__619: + zDb, (*Table)(unsafe.Pointer(pTab)).FzName, (*BtreePayload)(unsafe.Pointer(bp+464 /* &x1 */)).FnKey) +__637: + ; + goto __8 + + // Opcode: RowCell P1 P2 P3 * * + // + // P1 and P2 are both open cursors. Both must be opened on the same type + // of table - intkey or index. This opcode is used as part of copying + // the current row from P2 into P1. If the cursors are opened on intkey + // tables, register P3 contains the rowid to use with the new record in + // P1. If they are opened on index tables, P3 is not used. + // + // This opcode must be followed by either an Insert or InsertIdx opcode + // with the OPFLAG_PREFORMAT flag set to complete the insert operation. +__104: // Rowid value to insert with + ; + + pDest1 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pSrc = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*8)) + if (*Op)(unsafe.Pointer(pOp)).Fp3 != 0 { + iKey2 = *(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56 /* &.u */)) + } else { + iKey2 = int64(0) + } + rc = Xsqlite3BtreeTransferRow(tls, *(*uintptr)(unsafe.Pointer(pDest1 + 56 /* &.uc */)), *(*uintptr)(unsafe.Pointer(pSrc + 56 /* &.uc */)), iKey2) + if !(rc != SQLITE_OK) { + goto __638 + } + goto abort_due_to_error +__638: ; goto __8 @@ -68991,11 +69507,11 @@ __619: // If the OPFLAG_ISUPDATE flag is set in P2, then P3 contains the address // of the memory cell that contains the value that the rowid of the row will // be set to by the update. -__102: +__105: opflags = (*Op)(unsafe.Pointer(pOp)).Fp2 - pC10 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC11 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) // If the update-hook or pre-update-hook will be invoked, set zDb to // the name of the db to pass as to it. Also set local pTab to a copy @@ -69003,73 +69519,73 @@ __102: // last moved with OP_Next or OP_Prev, not Seek or NotFound, set // VdbeCursor.movetoTarget to the current rowid. if !((int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-6)) && (((*Sqlite3)(unsafe.Pointer((db))).FxPreUpdateCallback != 0) || ((*Sqlite3)(unsafe.Pointer((db))).FxUpdateCallback != 0))) { - goto __620 + goto __639 } - zDb1 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC10)).FiDb)*32)).FzDbSName + zDb1 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC11)).FiDb)*32)).FzDbSName pTab1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - if !(((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_SAVEPOSITION) != 0) && ((*VdbeCursor)(unsafe.Pointer(pC10)).FisTable != 0)) { - goto __622 + if !(((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_SAVEPOSITION) != 0) && ((*VdbeCursor)(unsafe.Pointer(pC11)).FisTable != 0)) { + goto __641 } - (*VdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC10 + 56 /* &.uc */))) -__622: + (*VdbeCursor)(unsafe.Pointer(pC11)).FmovetoTarget = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC11 + 56 /* &.uc */))) +__641: ; - goto __621 -__620: + goto __640 +__639: zDb1 = uintptr(0) // Not needed. Silence a compiler warning. pTab1 = uintptr(0) // Not needed. Silence a compiler warning. -__621: +__640: ; // Invoke the pre-update-hook if required. if !(((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0) && (*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) != 0)) { - goto __623 + goto __642 } - Xsqlite3VdbePreUpdateHook(tls, p, pC10, + Xsqlite3VdbePreUpdateHook(tls, p, pC11, func() int32 { if (opflags & OPFLAG_ISUPDATE) != 0 { return SQLITE_UPDATE } return SQLITE_DELETE }(), - zDb1, pTab1, (*VdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget, + zDb1, pTab1, (*VdbeCursor)(unsafe.Pointer(pC11)).FmovetoTarget, (*Op)(unsafe.Pointer(pOp)).Fp3) -__623: +__642: ; if !((opflags & OPFLAG_ISNOOP) != 0) { - goto __624 + goto __643 } goto __8 -__624: +__643: ; // Only flags that can be set are SAVEPOISTION and AUXDELETE - rc = Xsqlite3BtreeDelete(tls, *(*uintptr)(unsafe.Pointer(pC10 + 56 /* &.uc */)), uint8((*Op)(unsafe.Pointer(pOp)).Fp5)) - (*VdbeCursor)(unsafe.Pointer(pC10)).FcacheStatus = CACHE_STALE - (*VdbeCursor)(unsafe.Pointer(pC10)).FseekResult = 0 + rc = Xsqlite3BtreeDelete(tls, *(*uintptr)(unsafe.Pointer(pC11 + 56 /* &.uc */)), uint8((*Op)(unsafe.Pointer(pOp)).Fp5)) + (*VdbeCursor)(unsafe.Pointer(pC11)).FcacheStatus = U32(CACHE_STALE) + (*VdbeCursor)(unsafe.Pointer(pC11)).FseekResult = 0 if !(rc != 0) { - goto __625 + goto __644 } goto abort_due_to_error -__625: +__644: ; // Invoke the update-hook if required. if !((opflags & OPFLAG_NCHANGE) != 0) { - goto __626 + goto __645 } (*Vdbe)(unsafe.Pointer(p)).FnChange++ - if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0) && (((*Table)(unsafe.Pointer((pTab1))).FtabFlags & TF_WithoutRowid) == U32(0))) { - goto __627 + if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0) && (((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { + goto __646 } - (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 304 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, SQLITE_DELETE, zDb1, (*Table)(unsafe.Pointer(pTab1)).FzName, - (*VdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget) + (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 312 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, SQLITE_DELETE, zDb1, (*Table)(unsafe.Pointer(pTab1)).FzName, + (*VdbeCursor)(unsafe.Pointer(pC11)).FmovetoTarget) -__627: +__646: ; -__626: +__645: ; goto __8 @@ -69080,7 +69596,7 @@ __626: // change counter (returned by subsequent calls to sqlite3_changes()). // Then the VMs internal change counter resets to 0. // This is used by trigger programs. -__103: +__106: Xsqlite3VdbeSetChanges(tls, db, (*Vdbe)(unsafe.Pointer(p)).FnChange) (*Vdbe)(unsafe.Pointer(p)).FnChange = 0 goto __8 @@ -69099,26 +69615,26 @@ __103: // // Fall through to next instruction if the two records compare equal to // each other. Jump to P2 if they are different. -__104: +__107: - pC11 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC12 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) nKeyCol = *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - *(*int32)(unsafe.Pointer(bp + 480 /* res6 */)) = 0 - rc = Xsqlite3VdbeSorterCompare(tls, pC11, pIn3, nKeyCol, bp+480 /* &res6 */) + *(*int32)(unsafe.Pointer(bp + 512 /* res7 */)) = 0 + rc = Xsqlite3VdbeSorterCompare(tls, pC12, pIn3, nKeyCol, bp+512 /* &res7 */) if !(rc != 0) { - goto __628 + goto __647 } goto abort_due_to_error -__628: +__647: ; - if !(*(*int32)(unsafe.Pointer(bp + 480 /* res6 */)) != 0) { - goto __629 + if !(*(*int32)(unsafe.Pointer(bp + 512 /* res7 */)) != 0) { + goto __648 } goto jump_to_p2 -__629: +__648: ; goto __8 @@ -69133,20 +69649,20 @@ __629: // OpenPseudo. That pseudo-table cursor is the one that is identified by // parameter P3. Clearing the P3 column cache as part of this opcode saves // us from having to issue a separate NullRow instruction to clear that cache. -__105: +__108: pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) - pC12 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC13 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - rc = Xsqlite3VdbeSorterRowkey(tls, pC12, pOut) + rc = Xsqlite3VdbeSorterRowkey(tls, pC13, pOut) if !(rc != 0) { - goto __630 + goto __649 } goto abort_due_to_error -__630: +__649: ; - (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8)))).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8)))).FcacheStatus = U32(CACHE_STALE) goto __8 // Opcode: RowData P1 P2 P3 * * @@ -69176,13 +69692,13 @@ __630: // in OP_Result and any OP_Result will invalidate the P2 register content. // The P2 register content is invalidated by opcodes like OP_Function or // by any use of another cursor pointing to the same table. -__106: +__109: pOut = out2Prerelease(tls, p, pOp) - pC13 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC14 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pCrsr3 = *(*uintptr)(unsafe.Pointer(pC13 + 56 /* &.uc */)) + pCrsr3 = *(*uintptr)(unsafe.Pointer(pC14 + 56 /* &.uc */)) // The OP_RowData opcodes always follow OP_NotExists or // OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions @@ -69193,30 +69709,30 @@ __106: // sqlite3VdbeCursorMoveto(). n3 = Xsqlite3BtreePayloadSize(tls, pCrsr3) - if !(n3 > U32(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */))))) { - goto __631 + if !(n3 > U32(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */))))) { + goto __650 } goto too_big -__631: +__650: ; rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCrsr3, n3, pOut) if !(rc != 0) { - goto __632 + goto __651 } goto abort_due_to_error -__632: +__651: ; if !(!((*Op)(unsafe.Pointer(pOp)).Fp3 != 0)) { - goto __633 + goto __652 } if !(((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & MEM_Ephem) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0)) { - goto __634 + goto __653 } goto no_mem -__634: +__653: ; -__633: +__652: ; goto __8 @@ -69230,66 +69746,66 @@ __633: // P1 can be either an ordinary table or a virtual table. There used to // be a separate OP_VRowid opcode for use with virtual tables, but this // one opcode now works for both table types. -__107: +__110: pOut = out2Prerelease(tls, p, pOp) - pC14 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC15 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - if !((*VdbeCursor)(unsafe.Pointer(pC14)).FnullRow != 0) { - goto __635 + if !((*VdbeCursor)(unsafe.Pointer(pC15)).FnullRow != 0) { + goto __654 } - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) goto __8 - goto __636 -__635: - if !((*VdbeCursor)(unsafe.Pointer(pC14)).FdeferredMoveto != 0) { - goto __637 + goto __655 +__654: + if !((*VdbeCursor)(unsafe.Pointer(pC15)).FdeferredMoveto != 0) { + goto __656 } - *(*I64)(unsafe.Pointer(bp + 488 /* v3 */)) = (*VdbeCursor)(unsafe.Pointer(pC14)).FmovetoTarget - goto __638 -__637: - if !(int32((*VdbeCursor)(unsafe.Pointer(pC14)).FeCurType) == CURTYPE_VTAB) { - goto __639 + *(*I64)(unsafe.Pointer(bp + 520 /* v3 */)) = (*VdbeCursor)(unsafe.Pointer(pC15)).FmovetoTarget + goto __657 +__656: + if !(int32((*VdbeCursor)(unsafe.Pointer(pC15)).FeCurType) == CURTYPE_VTAB) { + goto __658 } - pVtab = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pC14 + 56 /* &.uc */)))).FpVtab + pVtab = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pC15 + 56 /* &.uc */)))).FpVtab pModule = (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule - rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pModule + 96 /* &.xRowid */))))(tls, *(*uintptr)(unsafe.Pointer(pC14 + 56 /* &.uc */)), bp+488 /* &v3 */) + rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pModule + 96 /* &.xRowid */))))(tls, *(*uintptr)(unsafe.Pointer(pC15 + 56 /* &.uc */)), bp+520 /* &v3 */) Xsqlite3VtabImportErrmsg(tls, p, pVtab) if !(rc != 0) { - goto __641 + goto __660 } goto abort_due_to_error -__641: +__660: ; - goto __640 -__639: + goto __659 +__658: ; - rc = Xsqlite3VdbeCursorRestore(tls, pC14) + rc = Xsqlite3VdbeCursorRestore(tls, pC15) if !(rc != 0) { - goto __642 + goto __661 } goto abort_due_to_error -__642: +__661: ; - if !((*VdbeCursor)(unsafe.Pointer(pC14)).FnullRow != 0) { - goto __643 + if !((*VdbeCursor)(unsafe.Pointer(pC15)).FnullRow != 0) { + goto __662 } - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) goto __8 -__643: +__662: ; - *(*I64)(unsafe.Pointer(bp + 488 /* v3 */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC14 + 56 /* &.uc */))) -__640: + *(*I64)(unsafe.Pointer(bp + 520 /* v3 */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC15 + 56 /* &.uc */))) +__659: ; -__638: +__657: ; -__636: +__655: ; - *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 488 /* v3 */)) + *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 520 /* v3 */)) goto __8 // Opcode: NullRow P1 * * * * @@ -69297,18 +69813,18 @@ __636: // Move the cursor P1 to a null row. Any OP_Column operations // that occur while the cursor is on the null row will always // write a NULL. -__108: +__111: ; - pC15 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC16 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - (*VdbeCursor)(unsafe.Pointer(pC15)).FnullRow = U8(1) - (*VdbeCursor)(unsafe.Pointer(pC15)).FcacheStatus = CACHE_STALE - if !(int32((*VdbeCursor)(unsafe.Pointer(pC15)).FeCurType) == CURTYPE_BTREE) { - goto __644 + (*VdbeCursor)(unsafe.Pointer(pC16)).FnullRow = U8(1) + (*VdbeCursor)(unsafe.Pointer(pC16)).FcacheStatus = U32(CACHE_STALE) + if !(int32((*VdbeCursor)(unsafe.Pointer(pC16)).FeCurType) == CURTYPE_BTREE) { + goto __663 } - Xsqlite3BtreeClearCursor(tls, *(*uintptr)(unsafe.Pointer(pC15 + 56 /* &.uc */))) -__644: + Xsqlite3BtreeClearCursor(tls, *(*uintptr)(unsafe.Pointer(pC16 + 56 /* &.uc */))) +__663: ; goto __8 @@ -69332,48 +69848,48 @@ __644: // This opcode leaves the cursor configured to move in reverse order, // from the end toward the beginning. In other words, the cursor is // configured to use Prev, not Next. -__109: -__110: +__112: +__113: ; - pC16 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC17 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pCrsr4 = *(*uintptr)(unsafe.Pointer(pC16 + 56 /* &.uc */)) - *(*int32)(unsafe.Pointer(bp + 496 /* res7 */)) = 0 + pCrsr4 = *(*uintptr)(unsafe.Pointer(pC17 + 56 /* &.uc */)) + *(*int32)(unsafe.Pointer(bp + 528 /* res8 */)) = 0 if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_SeekEnd) { - goto __645 + goto __664 } - (*VdbeCursor)(unsafe.Pointer(pC16)).FseekResult = -1 + (*VdbeCursor)(unsafe.Pointer(pC17)).FseekResult = -1 if !(Xsqlite3BtreeCursorIsValidNN(tls, pCrsr4) != 0) { - goto __646 + goto __665 } goto __8 -__646: +__665: ; -__645: +__664: ; - rc = Xsqlite3BtreeLast(tls, pCrsr4, bp+496 /* &res7 */) - (*VdbeCursor)(unsafe.Pointer(pC16)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 496 /* res7 */))) - (*VdbeCursor)(unsafe.Pointer(pC16)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC16)).FcacheStatus = CACHE_STALE + rc = Xsqlite3BtreeLast(tls, pCrsr4, bp+528 /* &res8 */) + (*VdbeCursor)(unsafe.Pointer(pC17)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 528 /* res8 */))) + (*VdbeCursor)(unsafe.Pointer(pC17)).FdeferredMoveto = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC17)).FcacheStatus = U32(CACHE_STALE) if !(rc != 0) { - goto __647 + goto __666 } goto abort_due_to_error -__647: +__666: ; if !((*Op)(unsafe.Pointer(pOp)).Fp2 > 0) { - goto __648 + goto __667 } - if !(*(*int32)(unsafe.Pointer(bp + 496 /* res7 */)) != 0) { - goto __649 + if !(*(*int32)(unsafe.Pointer(bp + 528 /* res8 */)) != 0) { + goto __668 } goto jump_to_p2 -__649: +__668: ; -__648: +__667: ; goto __8 @@ -69381,37 +69897,37 @@ __648: // // Estimate the number of rows in the table P1. Jump to P2 if that // estimate is less than approximately 2**(0.1*P3). -__111: +__114: ; - pC17 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC18 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pCrsr5 = *(*uintptr)(unsafe.Pointer(pC17 + 56 /* &.uc */)) + pCrsr5 = *(*uintptr)(unsafe.Pointer(pC18 + 56 /* &.uc */)) - rc = Xsqlite3BtreeFirst(tls, pCrsr5, bp+500 /* &res8 */) + rc = Xsqlite3BtreeFirst(tls, pCrsr5, bp+532 /* &res9 */) if !(rc != 0) { - goto __650 + goto __669 } goto abort_due_to_error -__650: +__669: ; - if !(*(*int32)(unsafe.Pointer(bp + 500 /* res8 */)) == 0) { - goto __651 + if !(*(*int32)(unsafe.Pointer(bp + 532 /* res9 */)) == 0) { + goto __670 } sz = Xsqlite3BtreeRowCountEst(tls, pCrsr5) if !((sz >= int64(0)) && (int32(Xsqlite3LogEst(tls, U64(sz))) < (*Op)(unsafe.Pointer(pOp)).Fp3)) { - goto __652 + goto __671 } - *(*int32)(unsafe.Pointer(bp + 500 /* res8 */)) = 1 -__652: + *(*int32)(unsafe.Pointer(bp + 532 /* res9 */)) = 1 +__671: ; -__651: +__670: ; - if !(*(*int32)(unsafe.Pointer(bp + 500 /* res8 */)) != 0) { - goto __653 + if !(*(*int32)(unsafe.Pointer(bp + 532 /* res9 */)) != 0) { + goto __672 } goto jump_to_p2 -__653: +__672: ; goto __8 @@ -69434,8 +69950,8 @@ __653: // rewinding so that the global variable will be incremented and // regression tests can determine whether or not the optimizer is // correctly optimizing out sorts. -__112: // jump -__113: // jump +__115: // jump +__116: // jump *(*U32)(unsafe.Pointer((p + 212 /* &.aCounter */) + 2*4))++ // Opcode: Rewind P1 P2 * * * @@ -69449,39 +69965,39 @@ __113: // jump // This opcode leaves the cursor configured to move in forward order, // from the beginning toward the end. In other words, the cursor is // configured to use Next, not Prev. -__114: +__117: ; - pC18 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC19 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - *(*int32)(unsafe.Pointer(bp + 504 /* res9 */)) = 1 - if !(int32((*VdbeCursor)(unsafe.Pointer((pC18))).FeCurType) == CURTYPE_SORTER) { - goto __654 + *(*int32)(unsafe.Pointer(bp + 536 /* res10 */)) = 1 + if !(int32((*VdbeCursor)(unsafe.Pointer((pC19))).FeCurType) == CURTYPE_SORTER) { + goto __673 } - rc = Xsqlite3VdbeSorterRewind(tls, pC18, bp+504 /* &res9 */) - goto __655 -__654: + rc = Xsqlite3VdbeSorterRewind(tls, pC19, bp+536 /* &res10 */) + goto __674 +__673: ; - pCrsr6 = *(*uintptr)(unsafe.Pointer(pC18 + 56 /* &.uc */)) + pCrsr6 = *(*uintptr)(unsafe.Pointer(pC19 + 56 /* &.uc */)) - rc = Xsqlite3BtreeFirst(tls, pCrsr6, bp+504 /* &res9 */) - (*VdbeCursor)(unsafe.Pointer(pC18)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC18)).FcacheStatus = CACHE_STALE -__655: + rc = Xsqlite3BtreeFirst(tls, pCrsr6, bp+536 /* &res10 */) + (*VdbeCursor)(unsafe.Pointer(pC19)).FdeferredMoveto = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC19)).FcacheStatus = U32(CACHE_STALE) +__674: ; if !(rc != 0) { - goto __656 + goto __675 } goto abort_due_to_error -__656: +__675: ; - (*VdbeCursor)(unsafe.Pointer(pC18)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 504 /* res9 */))) + (*VdbeCursor)(unsafe.Pointer(pC19)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 536 /* res10 */))) - if !(*(*int32)(unsafe.Pointer(bp + 504 /* res9 */)) != 0) { - goto __657 + if !(*(*int32)(unsafe.Pointer(bp + 536 /* res10 */)) != 0) { + goto __676 } goto jump_to_p2 -__657: +__676: ; goto __8 @@ -69542,41 +70058,41 @@ __657: // sorter object for which the OP_SorterSort opcode has been // invoked. This opcode advances the cursor to the next sorted // record, or jumps to P2 if there are no more sorted records. -__115: +__118: - pC19 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC20 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - rc = Xsqlite3VdbeSorterNext(tls, db, pC19) + rc = Xsqlite3VdbeSorterNext(tls, db, pC20) goto next_tail -__116: // jump -__117: // jump +__119: // jump +__120: // jump ; - pC19 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC20 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) // The Next opcode is only used after SeekGT, SeekGE, Rewind, and Found. // The Prev opcode is only used after SeekLT, SeekLE, and Last. - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pOp + 16 /* &.p4 */ /* &.xAdvance */))))(tls, *(*uintptr)(unsafe.Pointer(pC19 + 56 /* &.uc */)), (*Op)(unsafe.Pointer(pOp)).Fp3) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pOp + 16 /* &.p4 */ /* &.xAdvance */))))(tls, *(*uintptr)(unsafe.Pointer(pC20 + 56 /* &.uc */)), (*Op)(unsafe.Pointer(pOp)).Fp3) next_tail: - (*VdbeCursor)(unsafe.Pointer(pC19)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC20)).FcacheStatus = U32(CACHE_STALE) if !(rc == SQLITE_OK) { - goto __658 + goto __677 } - (*VdbeCursor)(unsafe.Pointer(pC19)).FnullRow = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC20)).FnullRow = U8(0) *(*U32)(unsafe.Pointer((p + 212 /* &.aCounter */) + uintptr((*Op)(unsafe.Pointer(pOp)).Fp5)*4))++ goto jump_to_p2_and_check_for_interrupt -__658: +__677: ; if !(rc != SQLITE_DONE) { - goto __659 + goto __678 } goto abort_due_to_error -__659: +__678: ; rc = SQLITE_OK - (*VdbeCursor)(unsafe.Pointer(pC19)).FnullRow = U8(1) + (*VdbeCursor)(unsafe.Pointer(pC20)).FnullRow = U8(1) goto check_for_interrupt // Opcode: IdxInsert P1 P2 P3 P4 P5 @@ -69606,17 +70122,17 @@ __659: // // This instruction only works for indices. The equivalent instruction // for tables is OP_Insert. -__118: +__121: ; - pC20 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC21 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_NCHANGE) != 0) { - goto __660 + goto __679 } (*Vdbe)(unsafe.Pointer(p)).FnChange++ -__660: +__679: ; rc = func() int32 { @@ -69626,30 +70142,30 @@ __660: return 0 }() if !(rc != 0) { - goto __661 + goto __680 } goto abort_due_to_error -__661: +__680: ; - (*BtreePayload)(unsafe.Pointer(bp + 512 /* &x2 */)).FnKey = Sqlite3_int64((*Mem)(unsafe.Pointer(pIn2)).Fn) - (*BtreePayload)(unsafe.Pointer(bp + 512 /* &x2 */)).FpKey = (*Mem)(unsafe.Pointer(pIn2)).Fz - (*BtreePayload)(unsafe.Pointer(bp + 512 /* &x2 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - (*BtreePayload)(unsafe.Pointer(bp + 512 /* &x2 */)).FnMem = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) - rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC20 + 56 /* &.uc */)), bp+512, /* &x2 */ - (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (OPFLAG_APPEND | OPFLAG_SAVEPOSITION)), + (*BtreePayload)(unsafe.Pointer(bp + 544 /* &x2 */)).FnKey = Sqlite3_int64((*Mem)(unsafe.Pointer(pIn2)).Fn) + (*BtreePayload)(unsafe.Pointer(bp + 544 /* &x2 */)).FpKey = (*Mem)(unsafe.Pointer(pIn2)).Fz + (*BtreePayload)(unsafe.Pointer(bp + 544 /* &x2 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) + (*BtreePayload)(unsafe.Pointer(bp + 544 /* &x2 */)).FnMem = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) + rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC21 + 56 /* &.uc */)), bp+544, /* &x2 */ + (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & ((OPFLAG_APPEND | OPFLAG_SAVEPOSITION) | OPFLAG_PREFORMAT)), func() int32 { if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_USESEEKRESULT) != 0 { - return (*VdbeCursor)(unsafe.Pointer(pC20)).FseekResult + return (*VdbeCursor)(unsafe.Pointer(pC21)).FseekResult } return 0 }()) - (*VdbeCursor)(unsafe.Pointer(pC20)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC21)).FcacheStatus = U32(CACHE_STALE) if !(rc != 0) { - goto __662 + goto __681 } goto abort_due_to_error -__662: +__681: ; goto __8 @@ -69659,9 +70175,9 @@ __662: // Register P2 holds an SQL index key made using the // MakeRecord instructions. This opcode writes that key // into the sorter P1. Data for the entry is nil. -__119: +__122: ; - pC21 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC22 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) @@ -69672,17 +70188,17 @@ __119: return 0 }() if !(rc != 0) { - goto __663 + goto __682 } goto abort_due_to_error -__663: +__682: ; - rc = Xsqlite3VdbeSorterWrite(tls, pC21, pIn2) + rc = Xsqlite3VdbeSorterWrite(tls, pC22, pIn2) if !(rc != 0) { - goto __664 + goto __683 } goto abort_due_to_error -__664: +__683: ; goto __8 @@ -69699,48 +70215,48 @@ __664: // or deleted is not found. For some uses of IdxDelete // (example: the EXCEPT operator) it does not matter that no matching // entry is found. For those cases, P5 is zero. -__120: +__123: ; - pC22 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC23 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pCrsr7 = *(*uintptr)(unsafe.Pointer(pC22 + 56 /* &.uc */)) + pCrsr7 = *(*uintptr)(unsafe.Pointer(pC23 + 56 /* &.uc */)) - (*UnpackedRecord)(unsafe.Pointer(bp + 560 /* &r2 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC22)).FpKeyInfo - (*UnpackedRecord)(unsafe.Pointer(bp + 560 /* &r2 */)).FnField = U16((*Op)(unsafe.Pointer(pOp)).Fp3) - (*UnpackedRecord)(unsafe.Pointer(bp + 560 /* &r2 */)).Fdefault_rc = int8(0) - (*UnpackedRecord)(unsafe.Pointer(bp + 560 /* &r2 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) - rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr7, bp+560 /* &r2 */, int64(0), 0, bp+584 /* &res10 */) + (*UnpackedRecord)(unsafe.Pointer(bp + 592 /* &r3 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC23)).FpKeyInfo + (*UnpackedRecord)(unsafe.Pointer(bp + 592 /* &r3 */)).FnField = U16((*Op)(unsafe.Pointer(pOp)).Fp3) + (*UnpackedRecord)(unsafe.Pointer(bp + 592 /* &r3 */)).Fdefault_rc = int8(0) + (*UnpackedRecord)(unsafe.Pointer(bp + 592 /* &r3 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) + rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr7, bp+592 /* &r3 */, int64(0), 0, bp+616 /* &res11 */) if !(rc != 0) { - goto __665 + goto __684 } goto abort_due_to_error -__665: +__684: ; - if !(*(*int32)(unsafe.Pointer(bp + 584 /* res10 */)) == 0) { - goto __666 + if !(*(*int32)(unsafe.Pointer(bp + 616 /* res11 */)) == 0) { + goto __685 } - rc = Xsqlite3BtreeDelete(tls, pCrsr7, BTREE_AUXDELETE) + rc = Xsqlite3BtreeDelete(tls, pCrsr7, uint8(BTREE_AUXDELETE)) if !(rc != 0) { - goto __668 + goto __687 } goto abort_due_to_error -__668: +__687: ; - goto __667 -__666: + goto __686 +__685: if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) { - goto __669 + goto __688 } - rc = (SQLITE_CORRUPT | (int32(3) << 8)) + rc = Xsqlite3ReportError(tls, (SQLITE_CORRUPT | (int32(3) << 8)), 91860, ts+4808 /* "index corruption" */) goto abort_due_to_error -__669: +__688: ; -__667: +__686: ; - (*VdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = CACHE_STALE - (*VdbeCursor)(unsafe.Pointer(pC22)).FseekResult = 0 + (*VdbeCursor)(unsafe.Pointer(pC23)).FcacheStatus = U32(CACHE_STALE) + (*VdbeCursor)(unsafe.Pointer(pC23)).FseekResult = 0 goto __8 // Opcode: DeferredSeek P1 * P3 P4 * @@ -69769,60 +70285,60 @@ __667: // the rowid of the table entry to which this index entry points. // // See also: Rowid, MakeRecord. -__121: -__122: // Rowid that P1 current points to +__124: +__125: // Rowid that P1 current points to ; - pC23 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC24 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) // The IdxRowid and Seek opcodes are combined because of the commonality // of sqlite3VdbeCursorRestore() and sqlite3VdbeIdxRowid(). - rc = Xsqlite3VdbeCursorRestore(tls, pC23) + rc = Xsqlite3VdbeCursorRestore(tls, pC24) // sqlite3VbeCursorRestore() can only fail if the record has been deleted // out from under the cursor. That will never happens for an IdxRowid // or Seek opcode if !(rc != SQLITE_OK) { - goto __670 + goto __689 } goto abort_due_to_error -__670: +__689: ; - if !(!(int32((*VdbeCursor)(unsafe.Pointer(pC23)).FnullRow) != 0)) { - goto __671 + if !(!(int32((*VdbeCursor)(unsafe.Pointer(pC24)).FnullRow) != 0)) { + goto __690 } - *(*I64)(unsafe.Pointer(bp + 592 /* rowid */)) = int64(0) // Not needed. Only used to silence a warning. - rc = Xsqlite3VdbeIdxRowid(tls, db, *(*uintptr)(unsafe.Pointer(pC23 + 56 /* &.uc */)), bp+592 /* &rowid */) + *(*I64)(unsafe.Pointer(bp + 624 /* rowid */)) = int64(0) // Not needed. Only used to silence a warning. + rc = Xsqlite3VdbeIdxRowid(tls, db, *(*uintptr)(unsafe.Pointer(pC24 + 56 /* &.uc */)), bp+624 /* &rowid */) if !(rc != SQLITE_OK) { - goto __673 + goto __692 } goto abort_due_to_error -__673: +__692: ; if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_DeferredSeek) { - goto __674 + goto __693 } pTabCur = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8)) (*VdbeCursor)(unsafe.Pointer(pTabCur)).FnullRow = U8(0) - (*VdbeCursor)(unsafe.Pointer(pTabCur)).FmovetoTarget = *(*I64)(unsafe.Pointer(bp + 592 /* rowid */)) + (*VdbeCursor)(unsafe.Pointer(pTabCur)).FmovetoTarget = *(*I64)(unsafe.Pointer(bp + 624 /* rowid */)) (*VdbeCursor)(unsafe.Pointer(pTabCur)).FdeferredMoveto = U8(1) (*VdbeCursor)(unsafe.Pointer(pTabCur)).FaAltMap = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - (*VdbeCursor)(unsafe.Pointer(pTabCur)).FpAltCursor = pC23 - goto __675 -__674: + (*VdbeCursor)(unsafe.Pointer(pTabCur)).FpAltCursor = pC24 + goto __694 +__693: pOut = out2Prerelease(tls, p, pOp) - *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 592 /* rowid */)) -__675: + *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 624 /* rowid */)) +__694: ; - goto __672 -__671: + goto __691 +__690: ; Xsqlite3VdbeMemSetNull(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)) -__672: +__691: ; goto __8 @@ -69831,25 +70347,25 @@ __672: // If cursor P1 was previously moved via OP_DeferredSeek, complete that // seek operation now, without further delay. If the cursor seek has // already occurred, this instruction is a no-op. -__123: // The P1 index cursor +__126: // The P1 index cursor ; - pC24 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - if !((*VdbeCursor)(unsafe.Pointer(pC24)).FdeferredMoveto != 0) { - goto __676 + pC25 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + if !((*VdbeCursor)(unsafe.Pointer(pC25)).FdeferredMoveto != 0) { + goto __695 } - rc = Xsqlite3VdbeFinishMoveto(tls, pC24) + rc = Xsqlite3VdbeFinishMoveto(tls, pC25) if !(rc != 0) { - goto __677 + goto __696 } goto abort_due_to_error -__677: +__696: ; -__676: +__695: ; goto __8 - // Opcode: IdxGE P1 P2 P3 P4 P5 + // Opcode: IdxGE P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -69859,7 +70375,7 @@ __676: // // If the P1 index entry is greater than or equal to the key value // then jump to P2. Otherwise fall through to the next instruction. - // Opcode: IdxGT P1 P2 P3 P4 P5 + // Opcode: IdxGT P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -69869,7 +70385,7 @@ __676: // // If the P1 index entry is greater than the key value // then jump to P2. Otherwise fall through to the next instruction. - // Opcode: IdxLT P1 P2 P3 P4 P5 + // Opcode: IdxLT P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -69879,7 +70395,7 @@ __676: // // If the P1 index entry is less than the key value then jump to P2. // Otherwise fall through to the next instruction. - // Opcode: IdxLE P1 P2 P3 P4 P5 + // Opcode: IdxLE P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -69889,53 +70405,74 @@ __676: // // If the P1 index entry is less than or equal to the key value then jump // to P2. Otherwise fall through to the next instruction. -__124: // jump -__125: // jump -__126: // jump -__127: +__127: // jump +__128: // jump +__129: // jump +__130: ; - pC25 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC26 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC25)).FpKeyInfo - (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) + (*UnpackedRecord)(unsafe.Pointer(bp + 688 /* &r4 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC26)).FpKeyInfo + (*UnpackedRecord)(unsafe.Pointer(bp + 688 /* &r4 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) < OP_IdxLT) { - goto __678 + goto __697 } - (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).Fdefault_rc = int8(-1) - goto __679 -__678: + (*UnpackedRecord)(unsafe.Pointer(bp + 688 /* &r4 */)).Fdefault_rc = int8(-1) + goto __698 +__697: ; - (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).Fdefault_rc = int8(0) -__679: + (*UnpackedRecord)(unsafe.Pointer(bp + 688 /* &r4 */)).Fdefault_rc = int8(0) +__698: ; - (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - *(*int32)(unsafe.Pointer(bp + 624 /* res11 */)) = 0 // Not needed. Only used to silence a warning. - rc = Xsqlite3VdbeIdxKeyCompare(tls, db, pC25, bp+600 /* &r3 */, bp+624 /* &res11 */) + (*UnpackedRecord)(unsafe.Pointer(bp + 688 /* &r4 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - if !((int32((*Op)(unsafe.Pointer(pOp)).Fopcode) & 1) == (OP_IdxLT & 1)) { - goto __680 + /* Inlined version of sqlite3VdbeIdxKeyCompare() */ + + nCellKey = int64(0) + + pCur1 = *(*uintptr)(unsafe.Pointer(pC26 + 56 /* &.uc */)) + + nCellKey = I64(Xsqlite3BtreePayloadSize(tls, pCur1)) + // nCellKey will always be between 0 and 0xffffffff because of the way + // that btreeParseCellPtr() and sqlite3GetVarint32() are implemented + if !((nCellKey <= int64(0)) || (nCellKey > int64(0x7fffffff))) { + goto __699 } - - *(*int32)(unsafe.Pointer(bp + 624 /* res11 */)) = -*(*int32)(unsafe.Pointer(bp + 624 /* res11 */)) - goto __681 -__680: + rc = Xsqlite3CorruptError(tls, 92062) + goto abort_due_to_error +__699: ; - *(*int32)(unsafe.Pointer(bp + 624 /* res11 */))++ -__681: - ; - + Xsqlite3VdbeMemInit(tls, bp+632 /* &m */, db, uint16(0)) + rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCur1, U32(nCellKey), bp+632 /* &m */) if !(rc != 0) { - goto __682 + goto __700 } goto abort_due_to_error -__682: +__700: ; - if !(*(*int32)(unsafe.Pointer(bp + 624 /* res11 */)) > 0) { - goto __683 + res12 = Xsqlite3VdbeRecordCompareWithSkip(tls, (*Mem)(unsafe.Pointer(bp+632 /* &m */)).Fn, (*Mem)(unsafe.Pointer(bp+632 /* &m */)).Fz, bp+688 /* &r4 */, 0) + Xsqlite3VdbeMemRelease(tls, bp+632 /* &m */) + + // End of inlined sqlite3VdbeIdxKeyCompare() + + if !((int32((*Op)(unsafe.Pointer(pOp)).Fopcode) & 1) == (OP_IdxLT & 1)) { + goto __701 + } + + res12 = -res12 + goto __702 +__701: + ; + res12++ +__702: + ; + + if !(res12 > 0) { + goto __703 } goto jump_to_p2 -__683: +__703: ; goto __8 @@ -69965,41 +70502,41 @@ __683: // and non-autovacuum modes. // // See also: Clear -__128: +__131: ; pOut = out2Prerelease(tls, p, pOp) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > ((*Sqlite3)(unsafe.Pointer(db)).FnVDestroy + 1)) { - goto __684 + goto __704 } rc = SQLITE_LOCKED - (*Vdbe)(unsafe.Pointer(p)).FerrorAction = OE_Abort + (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort) goto abort_due_to_error - goto __685 -__684: + goto __705 +__704: iDb2 = (*Op)(unsafe.Pointer(pOp)).Fp3 - *(*int32)(unsafe.Pointer(bp + 628 /* iMoved */)) = 0 // Not needed. Only to silence a warning. - rc = Xsqlite3BtreeDropTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb2)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp1, bp+628 /* &iMoved */) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int - *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*int32)(unsafe.Pointer(bp + 628 /* iMoved */))) + *(*int32)(unsafe.Pointer(bp + 712 /* iMoved */)) = 0 // Not needed. Only to silence a warning. + rc = Xsqlite3BtreeDropTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb2)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp1, bp+712 /* &iMoved */) + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) + *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*int32)(unsafe.Pointer(bp + 712 /* iMoved */))) if !(rc != 0) { - goto __686 + goto __706 } goto abort_due_to_error -__686: +__706: ; - if !(*(*int32)(unsafe.Pointer(bp + 628 /* iMoved */)) != 0) { - goto __687 + if !(*(*int32)(unsafe.Pointer(bp + 712 /* iMoved */)) != 0) { + goto __707 } - Xsqlite3RootPageMoved(tls, db, iDb2, uint32(*(*int32)(unsafe.Pointer(bp + 628 /* iMoved */))), uint32((*Op)(unsafe.Pointer(pOp)).Fp1)) + Xsqlite3RootPageMoved(tls, db, iDb2, uint32(*(*int32)(unsafe.Pointer(bp + 712 /* iMoved */))), uint32((*Op)(unsafe.Pointer(pOp)).Fp1)) // All OP_Destroy operations occur on the same btree resetSchemaOnFault = (U8(iDb2 + 1)) -__687: +__707: ; -__685: +__705: ; goto __8 @@ -70020,35 +70557,35 @@ __685: // also incremented by the number of rows in the table being cleared. // // See also: Destroy -__129: +__132: ; - *(*int32)(unsafe.Pointer(bp + 632 /* nChange */)) = 0 + *(*int32)(unsafe.Pointer(bp + 716 /* nChange */)) = 0 rc = Xsqlite3BtreeClearTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*32)).FpBt, int32(U32((*Op)(unsafe.Pointer(pOp)).Fp1)), func() uintptr { if (*Op)(unsafe.Pointer(pOp)).Fp3 != 0 { - return bp + 632 /* &nChange */ + return bp + 716 /* &nChange */ } return uintptr(0) }()) if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) { - goto __688 + goto __708 } - *(*int32)(unsafe.Pointer(p + 60 /* &.nChange */)) += (*(*int32)(unsafe.Pointer(bp + 632 /* nChange */))) + *(*int32)(unsafe.Pointer(p + 60 /* &.nChange */)) += (*(*int32)(unsafe.Pointer(bp + 716 /* nChange */))) if !((*Op)(unsafe.Pointer(pOp)).Fp3 > 0) { - goto __689 + goto __709 } - *(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56 /* &.u */ /* &.i */)) += (I64(*(*int32)(unsafe.Pointer(bp + 632 /* nChange */)))) -__689: + *(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56 /* &.u */ /* &.i */)) += (I64(*(*int32)(unsafe.Pointer(bp + 716 /* nChange */)))) +__709: ; -__688: +__708: ; if !(rc != 0) { - goto __690 + goto __710 } goto abort_due_to_error -__690: +__710: ; goto __8 @@ -70059,26 +70596,26 @@ __690: // // This opcode only works for cursors used for sorting and // opened with OP_OpenEphemeral or OP_SorterOpen. -__130: +__133: ; - pC26 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC27 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - if !(int32((*VdbeCursor)(unsafe.Pointer((pC26))).FeCurType) == CURTYPE_SORTER) { - goto __691 + if !(int32((*VdbeCursor)(unsafe.Pointer((pC27))).FeCurType) == CURTYPE_SORTER) { + goto __711 } - Xsqlite3VdbeSorterReset(tls, db, *(*uintptr)(unsafe.Pointer(pC26 + 56 /* &.uc */))) - goto __692 -__691: + Xsqlite3VdbeSorterReset(tls, db, *(*uintptr)(unsafe.Pointer(pC27 + 56 /* &.uc */))) + goto __712 +__711: ; - rc = Xsqlite3BtreeClearTableOfCursor(tls, *(*uintptr)(unsafe.Pointer(pC26 + 56 /* &.uc */))) + rc = Xsqlite3BtreeClearTableOfCursor(tls, *(*uintptr)(unsafe.Pointer(pC27 + 56 /* &.uc */))) if !(rc != 0) { - goto __693 + goto __713 } goto abort_due_to_error -__693: +__713: ; -__692: +__712: ; goto __8 @@ -70090,36 +70627,36 @@ __692: // P1>1. The P3 argument must be 1 (BTREE_INTKEY) for a rowid table // it must be 2 (BTREE_BLOBKEY) for an index or WITHOUT ROWID table. // The root page number of the new b-tree is stored in register P2. -__131: +__134: ; pOut = out2Prerelease(tls, p, pOp) - *(*Pgno)(unsafe.Pointer(bp + 636 /* pgno */)) = Pgno(0) + *(*Pgno)(unsafe.Pointer(bp + 720 /* pgno */)) = Pgno(0) pDb2 = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32) - rc = Xsqlite3BtreeCreateTable(tls, (*Db)(unsafe.Pointer(pDb2)).FpBt, bp+636 /* &pgno */, (*Op)(unsafe.Pointer(pOp)).Fp3) + rc = Xsqlite3BtreeCreateTable(tls, (*Db)(unsafe.Pointer(pDb2)).FpBt, bp+720 /* &pgno */, (*Op)(unsafe.Pointer(pOp)).Fp3) if !(rc != 0) { - goto __694 + goto __714 } goto abort_due_to_error -__694: +__714: ; - *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*Pgno)(unsafe.Pointer(bp + 636 /* pgno */))) + *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*Pgno)(unsafe.Pointer(bp + 720 /* pgno */))) goto __8 // Opcode: SqlExec * * * P4 * // // Run the SQL statement or statements specified in the P4 string. -__132: +__135: ; (*Sqlite3)(unsafe.Pointer(db)).FnSqlExec++ rc = Xsqlite3_exec(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), uintptr(0), uintptr(0), uintptr(0)) (*Sqlite3)(unsafe.Pointer(db)).FnSqlExec-- if !(rc != 0) { - goto __695 + goto __715 } goto abort_due_to_error -__695: +__715: ; goto __8 @@ -70131,7 +70668,7 @@ __695: // // This opcode invokes the parser to create a new virtual machine, // then runs the new virtual machine. It is thus a re-entrant opcode. -__133: +__136: // Any prepared statement that invokes this opcode will hold mutexes // on every btree. This is a prerequisite for invoking @@ -70140,72 +70677,72 @@ __133: iDb3 = (*Op)(unsafe.Pointer(pOp)).Fp1 if !(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) == uintptr(0)) { - goto __696 + goto __716 } Xsqlite3SchemaClear(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FpSchema) *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk))) - rc = Xsqlite3InitOne(tls, db, iDb3, (p + 168 /* &.zErrMsg */), INITFLAG_AlterTable) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + rc = Xsqlite3InitOne(tls, db, iDb3, (p + 168 /* &.zErrMsg */), uint32((*Op)(unsafe.Pointer(pOp)).Fp5)) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3) - goto __697 -__696: + goto __717 +__716: - zSchema = ts + 4780 /* "sqlite_master" */ - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).Fdb = db - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FiDb = iDb3 - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FpzErrMsg = (p + 168 /* &.zErrMsg */) - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FmInitFlags = U32(0) - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FmxPage = Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FpBt) + zSchema = ts + 4825 /* "sqlite_master" */ + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).Fdb = db + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).FiDb = iDb3 + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).FpzErrMsg = (p + 168 /* &.zErrMsg */) + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).FmInitFlags = U32(0) + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).FmxPage = Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FpBt) zSql = Xsqlite3MPrintf(tls, db, - ts+4794, /* "SELECT*FROM\"%w\"...." */ + ts+4839, /* "SELECT*FROM\"%w\"...." */ libc.VaList(bp+64, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) if !(zSql == uintptr(0)) { - goto __698 + goto __718 } rc = SQLITE_NOMEM - goto __699 -__698: + goto __719 +__718: ; (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(1) - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).Frc = SQLITE_OK - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FnInitRow = U32(0) + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).Frc = SQLITE_OK + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).FnInitRow = U32(0) rc = Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 - }{Xsqlite3InitCallback})), bp+640 /* &initData */, uintptr(0)) + }{Xsqlite3InitCallback})), bp+728 /* &initData */, uintptr(0)) if !(rc == SQLITE_OK) { - goto __700 + goto __720 } - rc = (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).Frc -__700: + rc = (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).Frc +__720: ; - if !((rc == SQLITE_OK) && ((*InitData)(unsafe.Pointer(bp+640 /* &initData */)).FnInitRow == U32(0))) { - goto __701 + if !((rc == SQLITE_OK) && ((*InitData)(unsafe.Pointer(bp+728 /* &initData */)).FnInitRow == U32(0))) { + goto __721 } // The OP_ParseSchema opcode with a non-NULL P4 argument should parse // at least one SQL statement. Any less than that indicates that // the sqlite_schema table is corrupt. - rc = Xsqlite3CorruptError(tls, 91475) -__701: + rc = Xsqlite3CorruptError(tls, 92315) +__721: ; Xsqlite3DbFreeNN(tls, db, zSql) (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(0) -__699: +__719: ; -__697: +__717: ; if !(rc != 0) { - goto __702 + goto __722 } Xsqlite3ResetAllSchemasOfConnection(tls, db) if !(rc == SQLITE_NOMEM) { - goto __703 + goto __723 } goto no_mem -__703: +__723: ; goto abort_due_to_error -__702: +__722: ; goto __8 @@ -70214,14 +70751,14 @@ __702: // Read the sqlite_stat1 table for database P1 and load the content // of that table into the internal index hash table. This will cause // the analysis to be used when preparing all subsequent queries. -__134: +__137: ; rc = Xsqlite3AnalysisLoad(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1) if !(rc != 0) { - goto __704 + goto __724 } goto abort_due_to_error -__704: +__724: ; goto __8 @@ -70232,7 +70769,7 @@ __704: // is dropped from disk (using the Destroy opcode) in order to keep // the internal representation of the // schema consistent with what is on disk. -__135: +__138: ; Xsqlite3UnlinkAndDeleteTable(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) goto __8 @@ -70244,7 +70781,7 @@ __135: // is dropped from disk (using the Destroy opcode) // in order to keep the internal representation of the // schema consistent with what is on disk. -__136: +__139: ; Xsqlite3UnlinkAndDeleteIndex(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) goto __8 @@ -70256,7 +70793,7 @@ __136: // is dropped from disk (using the Destroy opcode) in order to keep // the internal representation of the // schema consistent with what is on disk. -__137: +__140: ; Xsqlite3UnlinkAndDeleteTrigger(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) goto __8 @@ -70279,7 +70816,7 @@ __137: // file, not the main database file. // // This opcode is used to implement the integrity_check pragma. -__138: // Register keeping track of errors remaining +__141: // Register keeping track of errors remaining ; nRoot = (*Op)(unsafe.Pointer(pOp)).Fp2 @@ -70290,25 +70827,25 @@ __138: // Register keeping track of errors remaining pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) z = Xsqlite3BtreeIntegrityCheck(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp5)*32)).FpBt, (aRoot + 1*4), nRoot, - (int32(*(*I64)(unsafe.Pointer(pnErr /* &.u */))) + 1), bp+680 /* &nErr */) + (int32(*(*I64)(unsafe.Pointer(pnErr /* &.u */))) + 1), bp+768 /* &nErr */) Xsqlite3VdbeMemSetNull(tls, pIn1) - if !(*(*int32)(unsafe.Pointer(bp + 680 /* nErr */)) == 0) { - goto __705 + if !(*(*int32)(unsafe.Pointer(bp + 768 /* nErr */)) == 0) { + goto __725 } - goto __706 -__705: + goto __726 +__725: if !(z == uintptr(0)) { - goto __707 + goto __727 } goto no_mem - goto __708 -__707: - *(*I64)(unsafe.Pointer(pnErr /* &.u */ /* &.i */)) -= (I64(*(*int32)(unsafe.Pointer(bp + 680 /* nErr */)) - 1)) - Xsqlite3VdbeMemSetStr(tls, pIn1, z, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) -__708: + goto __728 +__727: + *(*I64)(unsafe.Pointer(pnErr /* &.u */ /* &.i */)) -= (I64(*(*int32)(unsafe.Pointer(bp + 768 /* nErr */)) - 1)) + Xsqlite3VdbeMemSetStr(tls, pIn1, z, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) +__728: ; -__706: +__726: ; Xsqlite3VdbeChangeEncoding(tls, pIn1, int32(encoding)) @@ -70321,20 +70858,20 @@ __706: // held in register P1. // // An assertion fails if P2 is not an integer. -__139: // in1, in2 +__142: // in1, in2 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Blob) == 0) { - goto __709 + goto __729 } if !(Xsqlite3VdbeMemSetRowSet(tls, pIn1) != 0) { - goto __710 + goto __730 } goto no_mem -__710: +__730: ; -__709: +__729: ; Xsqlite3RowSetInsert(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, *(*I64)(unsafe.Pointer(pIn2 /* &.u */))) @@ -70347,24 +70884,24 @@ __709: // and put that value into register P3. // Or, if RowSet object P1 is initially empty, leave P3 // unchanged and jump to instruction P2. -__140: +__143: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !(((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Blob) == 0) || - (Xsqlite3RowSetNext(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, bp+688 /* &val */) == 0)) { - goto __711 + (Xsqlite3RowSetNext(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, bp+776 /* &val */) == 0)) { + goto __731 } // The boolean index is empty Xsqlite3VdbeMemSetNull(tls, pIn1) goto jump_to_p2_and_check_for_interrupt - goto __712 -__711: + goto __732 +__731: // A value was pulled from the index ; - Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56), *(*I64)(unsafe.Pointer(bp + 688 /* val */))) -__712: + Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56), *(*I64)(unsafe.Pointer(bp + 776 /* val */))) +__732: ; goto check_for_interrupt @@ -70390,7 +70927,7 @@ __712: // inserted, there is no need to search to see if the same value was // previously inserted as part of set X (only if it was previously // inserted as part of some other set). -__141: +__144: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) @@ -70399,35 +70936,35 @@ __141: // If there is anything other than a rowset object in memory cell P1, // delete it now and initialize P1 with an empty rowset if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Blob) == 0) { - goto __713 + goto __733 } if !(Xsqlite3VdbeMemSetRowSet(tls, pIn1) != 0) { - goto __714 + goto __734 } goto no_mem -__714: +__734: ; -__713: +__733: ; if !(iSet != 0) { - goto __715 + goto __735 } exists = Xsqlite3RowSetTest(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, iSet, *(*I64)(unsafe.Pointer(pIn3 /* &.u */))) if !(exists != 0) { - goto __716 + goto __736 } goto jump_to_p2 -__716: +__736: ; -__715: +__735: ; if !(iSet >= 0) { - goto __717 + goto __737 } Xsqlite3RowSetInsert(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, *(*I64)(unsafe.Pointer(pIn3 /* &.u */))) -__717: +__737: ; goto __8 @@ -70445,7 +70982,7 @@ __717: // P4 is a pointer to the VM containing the trigger program. // // If P5 is non-zero, then recursive program invocation is enabled. -__142: // Token identifying trigger +__145: // Token identifying trigger pProgram = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) pRt = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) @@ -70462,37 +70999,37 @@ __142: // Token identifying trigger // single trigger all have the same value for the SubProgram.token // variable. if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) { - goto __718 + goto __738 } t1 = (*SubProgram)(unsafe.Pointer(pProgram)).Ftoken pFrame2 = (*Vdbe)(unsafe.Pointer(p)).FpFrame -__719: +__739: if !((pFrame2 != 0) && ((*VdbeFrame)(unsafe.Pointer(pFrame2)).Ftoken != t1)) { - goto __721 + goto __741 } - goto __720 -__720: + goto __740 +__740: pFrame2 = (*VdbeFrame)(unsafe.Pointer(pFrame2)).FpParent - goto __719 - goto __721 -__721: + goto __739 + goto __741 +__741: ; if !(pFrame2 != 0) { - goto __722 + goto __742 } goto __8 -__722: +__742: ; -__718: +__738: ; - if !((*Vdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 10*4))) { - goto __723 + if !((*Vdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 10*4))) { + goto __743 } rc = SQLITE_ERROR - Xsqlite3VdbeError(tls, p, ts+4837 /* "too many levels ..." */, 0) + Xsqlite3VdbeError(tls, p, ts+4882 /* "too many levels ..." */, 0) goto abort_due_to_error -__723: +__743: ; // Register pRt is used to store the memory required to save the state @@ -70500,7 +71037,7 @@ __723: // the trigger program. If this trigger has been fired before, then pRt // is already allocated. Otherwise, it must be initialized. if !((int32((*Mem)(unsafe.Pointer(pRt)).Fflags) & MEM_Blob) == 0) { - goto __724 + goto __744 } // SubProgram.nMem is set to the number of memory cells used by the // program stored in SubProgram.aOp. As well as these, one memory @@ -70509,10 +71046,10 @@ __723: nMem = ((*SubProgram)(unsafe.Pointer(pProgram)).FnMem + (*SubProgram)(unsafe.Pointer(pProgram)).FnCsr) if !((*SubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0) { - goto __726 + goto __746 } nMem++ -__726: +__746: ; nByte2 = (int32((((((uint64(unsafe.Sizeof(VdbeFrame{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7))) + (uint64(nMem) * uint64(unsafe.Sizeof(Mem{})))) + @@ -70520,10 +71057,10 @@ __726: (uint64(((*SubProgram)(unsafe.Pointer(pProgram)).FnOp + 7) / 8)))) pFrame2 = Xsqlite3DbMallocZero(tls, db, uint64(nByte2)) if !(!(pFrame2 != 0)) { - goto __727 + goto __747 } goto no_mem -__727: +__747: ; Xsqlite3VdbeMemRelease(tls, pRt) (*Mem)(unsafe.Pointer(pRt)).Fflags = (U16(MEM_Blob | MEM_Dyn)) @@ -70545,24 +71082,24 @@ __727: pEnd = (((pFrame2) + 112) + uintptr((*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem)*56) pMem2 = ((pFrame2) + 112) -__728: +__748: if !(pMem2 != pEnd) { - goto __730 + goto __750 } - (*Mem)(unsafe.Pointer(pMem2)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(pMem2)).Fflags = U16(MEM_Undefined) (*Mem)(unsafe.Pointer(pMem2)).Fdb = db - goto __729 -__729: + goto __749 +__749: pMem2 += 56 - goto __728 - goto __730 -__730: + goto __748 + goto __750 +__750: ; - goto __725 -__724: + goto __745 +__744: pFrame2 = (*Mem)(unsafe.Pointer(pRt)).Fz -__725: +__745: ; (*Vdbe)(unsafe.Pointer(p)).FnFrame++ @@ -70597,7 +71134,7 @@ __725: // The address of the cell in the parent frame is determined by adding // the value of the P1 argument to the value of the P1 argument to the // calling OP_Program instruction. -__143: +__146: pOut = out2Prerelease(tls, p, pOp) pFrame3 = (*Vdbe)(unsafe.Pointer(p)).FpFrame pIn = ((*VdbeFrame)(unsafe.Pointer(pFrame3)).FaMem + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1+(*Op)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(pFrame3)).FaOp+uintptr((*VdbeFrame)(unsafe.Pointer(pFrame3)).Fpc)*24)).Fp1))*56) @@ -70611,23 +71148,23 @@ __143: // If P1 is non-zero, the database constraint counter is incremented // (deferred foreign key constraints). Otherwise, if P1 is zero, the // statement counter is incremented (immediate foreign key constraints). -__144: - if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0) { - goto __731 +__147: + if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) { + goto __751 } - *(*I64)(unsafe.Pointer(db + 744 /* &.nDeferredImmCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2)) - goto __732 -__731: + *(*I64)(unsafe.Pointer(db + 752 /* &.nDeferredImmCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2)) + goto __752 +__751: if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) { - goto __733 + goto __753 } - *(*I64)(unsafe.Pointer(db + 736 /* &.nDeferredCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2)) - goto __734 -__733: + *(*I64)(unsafe.Pointer(db + 744 /* &.nDeferredCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2)) + goto __754 +__753: *(*I64)(unsafe.Pointer(p + 80 /* &.nFkConstraint */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2)) -__734: +__754: ; -__732: +__752: ; goto __8 @@ -70642,27 +71179,27 @@ __732: // is zero (the one that counts deferred constraint violations). If P1 is // zero, the jump is taken if the statement constraint-counter is zero // (immediate foreign key constraint violations). -__145: // jump +__148: // jump if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) { - goto __735 + goto __755 } if !(((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons == int64(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons == int64(0))) { - goto __737 + goto __757 } goto jump_to_p2 -__737: +__757: ; - goto __736 -__735: + goto __756 +__755: ; if !(((*Vdbe)(unsafe.Pointer(p)).FnFkConstraint == int64(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons == int64(0))) { - goto __738 + goto __758 } goto jump_to_p2 -__738: +__758: ; -__736: +__756: ; goto __8 @@ -70676,37 +71213,37 @@ __736: // // This instruction throws an error if the memory cell is not initially // an integer. -__146: +__149: if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) { - goto __739 + goto __759 } pFrame4 = (*Vdbe)(unsafe.Pointer(p)).FpFrame -__741: +__761: if !((*VdbeFrame)(unsafe.Pointer(pFrame4)).FpParent != 0) { - goto __743 + goto __763 } - goto __742 -__742: + goto __762 +__762: pFrame4 = (*VdbeFrame)(unsafe.Pointer(pFrame4)).FpParent - goto __741 - goto __743 -__743: + goto __761 + goto __763 +__763: ; pIn1 = ((*VdbeFrame)(unsafe.Pointer(pFrame4)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) - goto __740 -__739: + goto __760 +__759: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) -__740: +__760: ; Xsqlite3VdbeMemIntegerify(tls, pIn1) pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) Xsqlite3VdbeMemIntegerify(tls, pIn2) if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) < *(*I64)(unsafe.Pointer(pIn2 /* &.u */))) { - goto __744 + goto __764 } *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = *(*I64)(unsafe.Pointer(pIn2 /* &.u */)) -__744: +__764: ; goto __8 @@ -70719,15 +71256,15 @@ __744: // // If the initial value of register P1 is less than 1, then the // value is unchanged and control passes through to the next instruction. -__147: // jump, in1 +__150: // jump, in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) > int64(0)) { - goto __745 + goto __765 } *(*I64)(unsafe.Pointer(pIn1 /* &.u */ /* &.i */)) -= (I64((*Op)(unsafe.Pointer(pOp)).Fp3)) goto jump_to_p2 -__745: +__765: ; goto __8 @@ -70748,19 +71285,19 @@ __745: // and r[P2] is set to -1. // // Otherwise, r[P2] is set to the sum of r[P1] and r[P3]. -__148: +__151: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) pOut = out2Prerelease(tls, p, pOp) - *(*I64)(unsafe.Pointer(bp + 696 /* x3 */)) = *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) - if !((*(*I64)(unsafe.Pointer(bp + 696 /* x3 */)) <= int64(0)) || (Xsqlite3AddInt64(tls, bp+696 /* &x3 */, func() int64 { + *(*I64)(unsafe.Pointer(bp + 784 /* x3 */)) = *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) + if !((*(*I64)(unsafe.Pointer(bp + 784 /* x3 */)) <= int64(0)) || (Xsqlite3AddInt64(tls, bp+784 /* &x3 */, func() int64 { if *(*I64)(unsafe.Pointer(pIn3 /* &.u */)) > int64(0) { return *(*I64)(unsafe.Pointer(pIn3 /* &.u */)) } return int64(0) }()) != 0)) { - goto __746 + goto __766 } // If the LIMIT is less than or equal to zero, loop forever. This // is documented. But also, if the LIMIT+OFFSET exceeds 2^63 then @@ -70770,10 +71307,10 @@ __148: // it would take nearly 300 years to actually reach the limit. So // looping forever is a reasonable approximation. *(*I64)(unsafe.Pointer(pOut /* &.u */)) = int64(-1) - goto __747 -__746: - *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 696 /* x3 */)) -__747: + goto __767 +__766: + *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 784 /* x3 */)) +__767: ; goto __8 @@ -70784,20 +71321,20 @@ __747: // initially greater than zero, then decrement the value in register P1. // If it is non-zero (negative or positive) and then also jump to P2. // If register P1 is initially zero, leave it unchanged and fall through. -__149: // jump, in1 +__152: // jump, in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) != 0) { - goto __748 + goto __768 } if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) > int64(0)) { - goto __749 + goto __769 } *(*I64)(unsafe.Pointer(pIn1 /* &.u */))-- -__749: +__769: ; goto jump_to_p2 -__748: +__768: ; goto __8 @@ -70806,21 +71343,21 @@ __748: // // Register P1 must hold an integer. Decrement the value in P1 // and jump to P2 if the new value is exactly zero. -__150: // jump, in1 +__153: // jump, in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) > ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))) { - goto __750 + goto __770 } *(*I64)(unsafe.Pointer(pIn1 /* &.u */))-- -__750: +__770: ; if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) == int64(0)) { - goto __751 + goto __771 } goto jump_to_p2 -__751: +__771: ; goto __8 @@ -70860,21 +71397,21 @@ __751: // the opcode is changed. In this way, the initialization of the // sqlite3_context only happens once, instead of on each call to the // step function. -__151: -__152: +__154: +__155: ; n4 = int32((*Op)(unsafe.Pointer(pOp)).Fp5) pCtx = Xsqlite3DbMallocRawNN(tls, db, (uint64((uint64(n4) * uint64(unsafe.Sizeof(uintptr(0)))) + ((uint64(unsafe.Sizeof(Sqlite3_context{})) + uint64(unsafe.Sizeof(Mem{}))) - uint64(unsafe.Sizeof(uintptr(0))))))) if !(pCtx == uintptr(0)) { - goto __752 + goto __772 } goto no_mem -__752: +__772: ; (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpMem = uintptr(0) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut = ((pCtx + 48 /* &.argv */) + uintptr(n4)*8) - Xsqlite3VdbeMemInit(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, db, MEM_Null) + Xsqlite3VdbeMemInit(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, db, uint16(MEM_Null)) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp = (int32((int64(pOp) - int64(aOp)) / 24)) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe = p @@ -70886,9 +71423,9 @@ __752: // OP_AggInverse must have P1==1 and OP_AggStep must have P1==0 - (*Op)(unsafe.Pointer(pOp)).Fopcode = OP_AggStep1 + (*Op)(unsafe.Pointer(pOp)).Fopcode = U8(OP_AggStep1) -__153: +__156: ; pCtx1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) pMem3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) @@ -70898,71 +71435,71 @@ __153: // checks to see if the register array has changed, and if so it // reinitializes the relavant parts of the sqlite3_context object if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpMem != pMem3) { - goto __753 + goto __773 } (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpMem = pMem3 i4 = (int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc) - 1) -__754: +__774: if !(i4 >= 0) { - goto __756 + goto __776 } *(*uintptr)(unsafe.Pointer((pCtx1 + 48 /* &.argv */) + uintptr(i4)*8)) = (aMem + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2+i4))*56) - goto __755 -__755: + goto __775 +__775: i4-- - goto __754 - goto __756 -__756: + goto __774 + goto __776 +__776: ; -__753: +__773: ; (*Mem)(unsafe.Pointer(pMem3)).Fn++ if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) { - goto __757 + goto __777 } (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc + 48 /* &.xInverse */))))(tls, pCtx1, int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48 /* &.argv */) - goto __758 -__757: + goto __778 +__777: (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc + 24 /* &.xSFunc */))))(tls, pCtx1, int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48 /* &.argv */) -__758: +__778: ; // IMP: R-24505-23230 if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0) { - goto __759 + goto __779 } if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0) { - goto __760 + goto __780 } - Xsqlite3VdbeError(tls, p, ts+2690 /* "%s" */, libc.VaList(bp+88, Xsqlite3_value_text(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + Xsqlite3VdbeError(tls, p, ts+2718 /* "%s" */, libc.VaList(bp+88, Xsqlite3_value_text(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError -__760: +__780: ; if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0) { - goto __761 + goto __781 } i4 = (*Op)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*24)).Fp1 if !(i4 != 0) { - goto __762 + goto __782 } Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr(i4)*56), int64(1)) -__762: +__782: ; (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag = U8(0) -__761: +__781: ; Xsqlite3VdbeMemRelease(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut) - (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)).Fflags = U16(MEM_Null) (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError = 0 if !(rc != 0) { - goto __763 + goto __783 } goto abort_due_to_error -__763: +__783: ; -__759: +__779: ; goto __8 @@ -70991,39 +71528,39 @@ __759: // functions that can take varying numbers of arguments. The // P4 argument is only needed for the case where // the step function was not previously called. -__154: -__155: +__157: +__158: ; pMem4 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) { - goto __764 + goto __784 } rc = Xsqlite3VdbeMemAggValue(tls, pMem4, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) pMem4 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - goto __765 -__764: + goto __785 +__784: rc = Xsqlite3VdbeMemFinalize(tls, pMem4, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) -__765: +__785: ; if !(rc != 0) { - goto __766 + goto __786 } - Xsqlite3VdbeError(tls, p, ts+2690 /* "%s" */, libc.VaList(bp+96, Xsqlite3_value_text(tls, pMem4))) + Xsqlite3VdbeError(tls, p, ts+2718 /* "%s" */, libc.VaList(bp+96, Xsqlite3_value_text(tls, pMem4))) goto abort_due_to_error -__766: +__786: ; Xsqlite3VdbeChangeEncoding(tls, pMem4, int32(encoding)) if !(Xsqlite3VdbeMemTooBig(tls, pMem4) != 0) { - goto __767 + goto __787 } goto too_big -__767: +__787: ; goto __8 @@ -71037,40 +71574,40 @@ __767: // in the WAL that have been checkpointed after the checkpoint // completes into mem[P3+2]. However on an error, mem[P3+1] and // mem[P3+2] are initialized to -1. -__156: // Write results here +__159: // Write results here ; - *(*int32)(unsafe.Pointer(bp + 704 /* &aRes[0] */)) = 0 - *(*int32)(unsafe.Pointer(bp + 704 /* &aRes[0] */ + 1*4)) = libc.AssignPtrInt32(bp+704 /* &aRes */ +2*4, -1) + *(*int32)(unsafe.Pointer(bp + 792 /* &aRes[0] */)) = 0 + *(*int32)(unsafe.Pointer(bp + 792 /* &aRes[0] */ + 1*4)) = libc.AssignPtrInt32(bp+792 /* &aRes */ +2*4, -1) - rc = Xsqlite3Checkpoint(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, (bp + 704 /* &aRes */ + 1*4), (bp + 704 /* &aRes */ + 2*4)) + rc = Xsqlite3Checkpoint(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, (bp + 792 /* &aRes */ + 1*4), (bp + 792 /* &aRes */ + 2*4)) if !(rc != 0) { - goto __768 + goto __788 } if !(rc != SQLITE_BUSY) { - goto __769 + goto __789 } goto abort_due_to_error -__769: +__789: ; rc = SQLITE_OK - *(*int32)(unsafe.Pointer(bp + 704 /* &aRes[0] */)) = 1 -__768: + *(*int32)(unsafe.Pointer(bp + 792 /* &aRes[0] */)) = 1 +__788: ; i5 = 0 pMem5 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) -__770: +__790: if !(i5 < 3) { - goto __772 + goto __792 } - Xsqlite3VdbeMemSetInt64(tls, pMem5, I64(*(*int32)(unsafe.Pointer(bp + 704 /* &aRes[0] */ + uintptr(i5)*4)))) - goto __771 -__771: + Xsqlite3VdbeMemSetInt64(tls, pMem5, I64(*(*int32)(unsafe.Pointer(bp + 792 /* &aRes[0] */ + uintptr(i5)*4)))) + goto __791 +__791: i5++ pMem5 += 56 - goto __770 - goto __772 -__772: + goto __790 + goto __792 +__792: ; goto __8 @@ -71084,7 +71621,7 @@ __772: // If changing into or out of WAL mode the procedure is more complicated. // // Write a string containing the final journal-mode to register P2. -__157: // Name of database file for pPager +__160: // Name of database file for pPager pOut = out2Prerelease(tls, p, pOp) eNew = (*Op)(unsafe.Pointer(pOp)).Fp3 @@ -71093,16 +71630,16 @@ __157: // Name of database file for pPager pPager = Xsqlite3BtreePager(tls, pBt1) eOld = Xsqlite3PagerGetJournalMode(tls, pPager) if !(eNew == (-1)) { - goto __773 + goto __793 } eNew = eOld -__773: +__793: ; if !(!(Xsqlite3PagerOkToChangeJournalMode(tls, pPager) != 0)) { - goto __774 + goto __794 } eNew = eOld -__774: +__794: ; zFilename = Xsqlite3PagerFilename(tls, pPager, 1) @@ -71112,34 +71649,34 @@ __774: if !((eNew == PAGER_JOURNALMODE_WAL) && ((Xsqlite3Strlen30(tls, zFilename) == 0) || // Temp file !(Xsqlite3PagerWalSupported(tls, pPager) != 0))) { - goto __775 + goto __795 } eNew = eOld -__775: +__795: ; if !((eNew != eOld) && ((eOld == PAGER_JOURNALMODE_WAL) || (eNew == PAGER_JOURNALMODE_WAL))) { - goto __776 + goto __796 } if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1)) { - goto __777 + goto __797 } rc = SQLITE_ERROR Xsqlite3VdbeError(tls, p, - ts+4874, /* "cannot change %s..." */ + ts+4919, /* "cannot change %s..." */ libc.VaList(bp+104, func() uintptr { if eNew == PAGER_JOURNALMODE_WAL { - return ts + 4926 /* "into" */ + return ts + 4971 /* "into" */ } - return ts + 4931 /* "out of" */ + return ts + 4976 /* "out of" */ }())) goto abort_due_to_error - goto __778 -__777: + goto __798 +__797: if !(eOld == PAGER_JOURNALMODE_WAL) { - goto __779 + goto __799 } // If leaving WAL mode, close the log file. If successful, the call // to PagerCloseWal() checkpoints and deletes the write-ahead-log @@ -71147,29 +71684,29 @@ __777: // after a successful return. rc = Xsqlite3PagerCloseWal(tls, pPager, db) if !(rc == SQLITE_OK) { - goto __781 + goto __801 } Xsqlite3PagerSetJournalMode(tls, pPager, eNew) -__781: +__801: ; - goto __780 -__779: + goto __800 +__799: if !(eOld == PAGER_JOURNALMODE_MEMORY) { - goto __782 + goto __802 } // Cannot transition directly from MEMORY to WAL. Use mode OFF // as an intermediate Xsqlite3PagerSetJournalMode(tls, pPager, PAGER_JOURNALMODE_OFF) -__782: +__802: ; -__780: +__800: ; // Open a transaction on the database file. Regardless of the journal // mode, this transaction always uses a rollback journal. if !(rc == SQLITE_OK) { - goto __783 + goto __803 } rc = Xsqlite3BtreeSetVersion(tls, pBt1, func() int32 { if eNew == PAGER_JOURNALMODE_WAL { @@ -71177,31 +71714,31 @@ __780: } return 1 }()) -__783: +__803: ; -__778: +__798: ; -__776: +__796: ; if !(rc != 0) { - goto __784 + goto __804 } eNew = eOld -__784: +__804: ; eNew = Xsqlite3PagerSetJournalMode(tls, pPager, eNew) (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((MEM_Str | MEM_Static) | MEM_Term)) (*Mem)(unsafe.Pointer(pOut)).Fz = Xsqlite3JournalModename(tls, eNew) (*Mem)(unsafe.Pointer(pOut)).Fn = Xsqlite3Strlen30(tls, (*Mem)(unsafe.Pointer(pOut)).Fz) - (*Mem)(unsafe.Pointer(pOut)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(pOut)).Fenc = U8(SQLITE_UTF8) Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding)) if !(rc != 0) { - goto __785 + goto __805 } goto abort_due_to_error -__785: +__805: ; goto __8 @@ -71213,7 +71750,7 @@ __785: // If P2 is not zero, then it is a register holding a string which is // the file into which the result of vacuum should be written. When // P2 is zero, the vacuum overwrites the original database. -__158: +__161: ; rc = Xsqlite3RunVacuum(tls, (p + 168 /* &.zErrMsg */), db, (*Op)(unsafe.Pointer(pOp)).Fp1, func() uintptr { @@ -71223,10 +71760,10 @@ __158: return uintptr(0) }()) if !(rc != 0) { - goto __786 + goto __806 } goto abort_due_to_error -__786: +__806: ; goto __8 @@ -71235,24 +71772,24 @@ __786: // Perform a single step of the incremental vacuum procedure on // the P1 database. If the vacuum has finished, jump to instruction // P2. Otherwise, fall through to the next instruction. -__159: +__162: ; pBt2 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt rc = Xsqlite3BtreeIncrVacuum(tls, pBt2) if !(rc != 0) { - goto __787 + goto __807 } if !(rc != SQLITE_DONE) { - goto __788 + goto __808 } goto abort_due_to_error -__788: +__808: ; rc = SQLITE_OK goto jump_to_p2 -__787: +__807: ; goto __8 @@ -71271,16 +71808,16 @@ __787: // The P2==1 case occurs when a CREATE INDEX or similar schema change happens // that might help the statement run faster but which does not affect the // correctness of operation. -__160: +__163: ; if !(!((*Op)(unsafe.Pointer(pOp)).Fp1 != 0)) { - goto __789 + goto __809 } Xsqlite3ExpirePreparedStatements(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp2) - goto __790 -__789: + goto __810 +__809: libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, (Bft((*Op)(unsafe.Pointer(pOp)).Fp2 + 1)), 0, 0x3) -__790: +__810: ; goto __8 @@ -71288,22 +71825,22 @@ __790: // // Lock the btree to which cursor P1 is pointing so that the btree cannot be // written by an other cursor. -__161: +__164: ; - pC27 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC28 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - Xsqlite3BtreeCursorPin(tls, *(*uintptr)(unsafe.Pointer(pC27 + 56 /* &.uc */))) + Xsqlite3BtreeCursorPin(tls, *(*uintptr)(unsafe.Pointer(pC28 + 56 /* &.uc */))) goto __8 // Opcode: CursorUnlock P1 * * * * // // Unlock the btree to which cursor P1 is pointing so that it can be // written by other cursors. -__162: +__165: ; - pC28 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC29 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - Xsqlite3BtreeCursorUnpin(tls, *(*uintptr)(unsafe.Pointer(pC28 + 56 /* &.uc */))) + Xsqlite3BtreeCursorUnpin(tls, *(*uintptr)(unsafe.Pointer(pC29 + 56 /* &.uc */))) goto __8 // Opcode: TableLock P1 P2 P3 P4 * @@ -71320,28 +71857,28 @@ __162: // // P4 contains a pointer to the name of the table being locked. This is only // used to generate an error message if the lock cannot be obtained. -__163: +__166: isWriteLock = U8((*Op)(unsafe.Pointer(pOp)).Fp3) - if !((isWriteLock != 0) || (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ReadUncommit))) { - goto __791 + if !((isWriteLock != 0) || (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ReadUncommit)))) { + goto __811 } p13 = (*Op)(unsafe.Pointer(pOp)).Fp1 rc = Xsqlite3BtreeLockTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(p13)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp2, isWriteLock) if !(rc != 0) { - goto __792 + goto __812 } if !((rc & 0xFF) == SQLITE_LOCKED) { - goto __793 + goto __813 } z1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - Xsqlite3VdbeError(tls, p, ts+4938 /* "database table i..." */, libc.VaList(bp+112, z1)) -__793: + Xsqlite3VdbeError(tls, p, ts+4983 /* "database table i..." */, libc.VaList(bp+112, z1)) +__813: ; goto abort_due_to_error -__792: +__812: ; -__791: +__811: ; goto __8 @@ -71353,20 +71890,20 @@ __791: // Also, whether or not P4 is set, check that this is not being called from // within a callback to a virtual table xSync() method. If it is, the error // code will be set to SQLITE_LOCKED. -__164: +__167: pVTab = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) rc = Xsqlite3VtabBegin(tls, db, pVTab) if !(pVTab != 0) { - goto __794 + goto __814 } Xsqlite3VtabImportErrmsg(tls, p, (*VTable)(unsafe.Pointer(pVTab)).FpVtab) -__794: +__814: ; if !(rc != 0) { - goto __795 + goto __815 } goto abort_due_to_error -__795: +__815: ; goto __8 @@ -71374,29 +71911,29 @@ __795: // // P2 is a register that holds the name of a virtual table in database // P1. Call the xCreate method for that table. -__165: // Name of the virtual table +__168: // Name of the virtual table - libc.Xmemset(tls, bp+720 /* &sMem1 */, 0, uint64(unsafe.Sizeof(Mem{}))) - (*Mem)(unsafe.Pointer(bp + 720 /* &sMem1 */)).Fdb = db + libc.Xmemset(tls, bp+808 /* &sMem1 */, 0, uint64(unsafe.Sizeof(Mem{}))) + (*Mem)(unsafe.Pointer(bp + 808 /* &sMem1 */)).Fdb = db // Because P2 is always a static string, it is impossible for the // sqlite3VdbeMemCopy() to fail - rc = Xsqlite3VdbeMemCopy(tls, bp+720 /* &sMem1 */, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)) + rc = Xsqlite3VdbeMemCopy(tls, bp+808 /* &sMem1 */, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)) - zTab = Xsqlite3_value_text(tls, bp+720 /* &sMem1 */) + zTab = Xsqlite3_value_text(tls, bp+808 /* &sMem1 */) if !(zTab != 0) { - goto __796 + goto __816 } rc = Xsqlite3VtabCallCreate(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, zTab, (p + 168 /* &.zErrMsg */)) -__796: +__816: ; - Xsqlite3VdbeMemRelease(tls, bp+720 /* &sMem1 */) + Xsqlite3VdbeMemRelease(tls, bp+808 /* &sMem1 */) if !(rc != 0) { - goto __797 + goto __817 } goto abort_due_to_error -__797: +__817: ; goto __8 @@ -71404,16 +71941,16 @@ __797: // // P4 is the name of a virtual table in database P1. Call the xDestroy method // of that table. -__166: +__169: (*Sqlite3)(unsafe.Pointer(db)).FnVDestroy++ rc = Xsqlite3VtabCallDestroy(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) (*Sqlite3)(unsafe.Pointer(db)).FnVDestroy-- if !(rc != 0) { - goto __798 + goto __818 } goto abort_due_to_error -__798: +__818: ; goto __8 @@ -71422,44 +71959,44 @@ __798: // P4 is a pointer to a virtual table object, an sqlite3_vtab structure. // P1 is a cursor number. This opcode opens a cursor to the virtual // table and stores that cursor in P1. -__167: +__170: ; - pCur1 = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */)) = uintptr(0) + pCur2 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 864 /* pVCur */)) = uintptr(0) pVtab1 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab if !((pVtab1 == uintptr(0)) || ((*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FpModule == uintptr(0))) { - goto __799 + goto __819 } rc = SQLITE_LOCKED goto abort_due_to_error -__799: +__819: ; pModule1 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FpModule - rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pModule1 + 48 /* &.xOpen */))))(tls, pVtab1, bp+776 /* &pVCur */) + rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pModule1 + 48 /* &.xOpen */))))(tls, pVtab1, bp+864 /* &pVCur */) Xsqlite3VtabImportErrmsg(tls, p, pVtab1) if !(rc != 0) { - goto __800 + goto __820 } goto abort_due_to_error -__800: +__820: ; // Initialize sqlite3_vtab_cursor base class - (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */)))).FpVtab = pVtab1 + (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 864 /* pVCur */)))).FpVtab = pVtab1 // Initialize vdbe cursor object - pCur1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, 0, -1, CURTYPE_VTAB) - if !(pCur1 != 0) { - goto __801 + pCur2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, 0, -1, uint8(CURTYPE_VTAB)) + if !(pCur2 != 0) { + goto __821 } - *(*uintptr)(unsafe.Pointer(pCur1 + 56 /* &.uc */)) = *(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */)) + *(*uintptr)(unsafe.Pointer(pCur2 + 56 /* &.uc */)) = *(*uintptr)(unsafe.Pointer(bp + 864 /* pVCur */)) (*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FnRef++ - goto __802 -__801: + goto __822 +__821: ; - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule1 + 56 /* &.xClose */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */))) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule1 + 56 /* &.xClose */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 864 /* pVCur */))) goto no_mem -__802: +__822: ; goto __8 @@ -71481,13 +72018,13 @@ __802: // xFilter as argv. Register P3+2 becomes argv[0] when passed to xFilter. // // A jump is made to P2 if the result set after filtering would be empty. -__168: +__171: pQuery = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) pArgc = (pQuery + 1*56) - pCur2 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pCur3 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pVCur1 = *(*uintptr)(unsafe.Pointer(pCur2 + 56 /* &.uc */)) + pVCur1 = *(*uintptr)(unsafe.Pointer(pCur3 + 56 /* &.uc */)) pVtab2 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVCur1)).FpVtab pModule2 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab2)).FpModule @@ -71497,37 +72034,37 @@ __168: iQuery = int32(*(*I64)(unsafe.Pointer(pQuery /* &.u */))) // Invoke the xFilter method - res12 = 0 + res13 = 0 apArg = (*Vdbe)(unsafe.Pointer(p)).FapArg i6 = 0 -__803: +__823: if !(i6 < nArg) { - goto __805 + goto __825 } *(*uintptr)(unsafe.Pointer(apArg + uintptr(i6)*8)) = (pArgc + uintptr((i6+1))*56) - goto __804 -__804: + goto __824 +__824: i6++ - goto __803 - goto __805 -__805: + goto __823 + goto __825 +__825: ; rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer((pModule2 + 64 /* &.xFilter */))))(tls, pVCur1, iQuery, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), nArg, apArg) Xsqlite3VtabImportErrmsg(tls, p, pVtab2) if !(rc != 0) { - goto __806 + goto __826 } goto abort_due_to_error -__806: +__826: ; - res12 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule2 + 80 /* &.xEof */))))(tls, pVCur1) - (*VdbeCursor)(unsafe.Pointer(pCur2)).FnullRow = U8(0) + res13 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule2 + 80 /* &.xEof */))))(tls, pVCur1) + (*VdbeCursor)(unsafe.Pointer(pCur3)).FnullRow = U8(0) - if !(res12 != 0) { - goto __807 + if !(res13 != 0) { + goto __827 } goto jump_to_p2 -__807: +__827: ; goto __8 @@ -71544,58 +72081,58 @@ __807: // table implementation. The P5 column might also contain other // bits (OPFLAG_LENGTHARG or OPFLAG_TYPEOFARG) but those bits are // unused by OP_VColumn. -__169: +__172: - pCur3 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pCur4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pDest1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) + pDest2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - if !((*VdbeCursor)(unsafe.Pointer(pCur3)).FnullRow != 0) { - goto __808 + if !((*VdbeCursor)(unsafe.Pointer(pCur4)).FnullRow != 0) { + goto __828 } - Xsqlite3VdbeMemSetNull(tls, pDest1) + Xsqlite3VdbeMemSetNull(tls, pDest2) goto __8 -__808: +__828: ; - pVtab3 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur3 + 56 /* &.uc */)))).FpVtab + pVtab3 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */)))).FpVtab pModule3 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab3)).FpModule - libc.Xmemset(tls, bp+784 /* &sContext */, 0, uint64(unsafe.Sizeof(Sqlite3_context{}))) - (*Sqlite3_context)(unsafe.Pointer(bp + 784 /* &sContext */)).FpOut = pDest1 + libc.Xmemset(tls, bp+872 /* &sContext */, 0, uint64(unsafe.Sizeof(Sqlite3_context{}))) + (*Sqlite3_context)(unsafe.Pointer(bp + 872 /* &sContext */)).FpOut = pDest2 if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_NOCHNG) != 0) { - goto __809 + goto __829 } - Xsqlite3VdbeMemSetNull(tls, pDest1) - (*Mem)(unsafe.Pointer(pDest1)).Fflags = (U16(MEM_Null | MEM_Zero)) - *(*int32)(unsafe.Pointer(pDest1 /* &.u */)) = 0 - goto __810 -__809: - (*Mem)(unsafe.Pointer(pDest1)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pDest1))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Null)) -__810: + Xsqlite3VdbeMemSetNull(tls, pDest2) + (*Mem)(unsafe.Pointer(pDest2)).Fflags = (U16(MEM_Null | MEM_Zero)) + *(*int32)(unsafe.Pointer(pDest2 /* &.u */)) = 0 + goto __830 +__829: + (*Mem)(unsafe.Pointer(pDest2)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pDest2))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Null)) +__830: ; - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pModule3 + 88 /* &.xColumn */))))(tls, *(*uintptr)(unsafe.Pointer(pCur3 + 56 /* &.uc */)), bp+784 /* &sContext */, (*Op)(unsafe.Pointer(pOp)).Fp2) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pModule3 + 88 /* &.xColumn */))))(tls, *(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */)), bp+872 /* &sContext */, (*Op)(unsafe.Pointer(pOp)).Fp2) Xsqlite3VtabImportErrmsg(tls, p, pVtab3) - if !((*Sqlite3_context)(unsafe.Pointer(bp+784 /* &sContext */)).FisError > 0) { - goto __811 + if !((*Sqlite3_context)(unsafe.Pointer(bp+872 /* &sContext */)).FisError > 0) { + goto __831 } - Xsqlite3VdbeError(tls, p, ts+2690 /* "%s" */, libc.VaList(bp+120, Xsqlite3_value_text(tls, pDest1))) - rc = (*Sqlite3_context)(unsafe.Pointer(bp + 784 /* &sContext */)).FisError -__811: + Xsqlite3VdbeError(tls, p, ts+2718 /* "%s" */, libc.VaList(bp+120, Xsqlite3_value_text(tls, pDest2))) + rc = (*Sqlite3_context)(unsafe.Pointer(bp + 872 /* &sContext */)).FisError +__831: ; - Xsqlite3VdbeChangeEncoding(tls, pDest1, int32(encoding)) + Xsqlite3VdbeChangeEncoding(tls, pDest2, int32(encoding)) - if !(Xsqlite3VdbeMemTooBig(tls, pDest1) != 0) { - goto __812 + if !(Xsqlite3VdbeMemTooBig(tls, pDest2) != 0) { + goto __832 } goto too_big -__812: +__832: ; if !(rc != 0) { - goto __813 + goto __833 } goto abort_due_to_error -__813: +__833: ; goto __8 @@ -71604,18 +72141,18 @@ __813: // Advance virtual table P1 to the next row in its result set and // jump to instruction P2. Or, if the virtual table has reached // the end of its result set, then fall through to the next instruction. -__170: +__173: - res13 = 0 - pCur4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + res14 = 0 + pCur5 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - if !((*VdbeCursor)(unsafe.Pointer(pCur4)).FnullRow != 0) { - goto __814 + if !((*VdbeCursor)(unsafe.Pointer(pCur5)).FnullRow != 0) { + goto __834 } goto __8 -__814: +__834: ; - pVtab4 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */)))).FpVtab + pVtab4 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 56 /* &.uc */)))).FpVtab pModule4 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule // Invoke the xNext() method of the module. There is no way for the @@ -71623,22 +72160,22 @@ __814: // xNext(). Instead, if an error occurs, true is returned (indicating that // data is available) and the error code returned when xColumn or // some other method is next invoked on the save virtual table cursor. - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule4 + 72 /* &.xNext */))))(tls, *(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */))) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule4 + 72 /* &.xNext */))))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 56 /* &.uc */))) Xsqlite3VtabImportErrmsg(tls, p, pVtab4) if !(rc != 0) { - goto __815 + goto __835 } goto abort_due_to_error -__815: +__835: ; - res13 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule4 + 80 /* &.xEof */))))(tls, *(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */))) + res14 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule4 + 80 /* &.xEof */))))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 56 /* &.uc */))) - if !(!(res13 != 0)) { - goto __816 + if !(!(res14 != 0)) { + goto __836 } // If there is data, jump to P2 goto jump_to_p2_and_check_for_interrupt -__816: +__836: ; goto check_for_interrupt @@ -71647,34 +72184,34 @@ __816: // P4 is a pointer to a virtual table object, an sqlite3_vtab structure. // This opcode invokes the corresponding xRename method. The value // in register P1 is passed as the zName argument to the xRename method. -__171: +__174: - isLegacy = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyAlter)) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (SQLITE_LegacyAlter) + isLegacy = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_LegacyAlter)) pVtab5 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab pName = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) rc = Xsqlite3VdbeChangeEncoding(tls, pName, SQLITE_UTF8) if !(rc != 0) { - goto __817 + goto __837 } goto abort_due_to_error -__817: +__837: ; rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vtab)(unsafe.Pointer(pVtab5)).FpModule + 152 /* &.xRename */))))(tls, pVtab5, (*Mem)(unsafe.Pointer(pName)).Fz) if !(isLegacy == 0) { - goto __818 + goto __838 } - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_LegacyAlter)) -__818: + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_LegacyAlter))) +__838: ; Xsqlite3VtabImportErrmsg(tls, p, pVtab5) libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3) if !(rc != 0) { - goto __819 + goto __839 } goto abort_due_to_error -__819: +__839: ; goto __8 @@ -71704,95 +72241,95 @@ __819: // // P5 is the error actions (OE_Replace, OE_Fail, OE_Ignore, etc) to // apply in the case of a constraint failure on an insert or update. -__172: +__175: ; if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - goto __820 + goto __840 } goto no_mem -__820: +__840: ; pVtab6 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab if !((pVtab6 == uintptr(0)) || ((*Sqlite3_vtab)(unsafe.Pointer(pVtab6)).FpModule == uintptr(0))) { - goto __821 + goto __841 } rc = SQLITE_LOCKED goto abort_due_to_error -__821: +__841: ; pModule5 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab6)).FpModule nArg1 = (*Op)(unsafe.Pointer(pOp)).Fp2 if !((*Sqlite3_module)(unsafe.Pointer(pModule5)).FxUpdate != 0) { - goto __822 + goto __842 } vtabOnConflict = (*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict apArg1 = (*Vdbe)(unsafe.Pointer(p)).FapArg pX1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) i7 = 0 -__823: +__843: if !(i7 < nArg1) { - goto __825 + goto __845 } *(*uintptr)(unsafe.Pointer(apArg1 + uintptr(i7)*8)) = pX1 pX1 += 56 - goto __824 -__824: + goto __844 +__844: i7++ - goto __823 - goto __825 -__825: + goto __843 + goto __845 +__845: ; (*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict = U8((*Op)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pModule5 + 104 /* &.xUpdate */))))(tls, pVtab6, nArg1, apArg1, bp+840 /* &rowid1 */) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pModule5 + 104 /* &.xUpdate */))))(tls, pVtab6, nArg1, apArg1, bp+928 /* &rowid1 */) (*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict Xsqlite3VtabImportErrmsg(tls, p, pVtab6) if !((rc == SQLITE_OK) && ((*Op)(unsafe.Pointer(pOp)).Fp1 != 0)) { - goto __826 + goto __846 } - (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Sqlite_int64)(unsafe.Pointer(bp + 840 /* rowid1 */)) -__826: + (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Sqlite_int64)(unsafe.Pointer(bp + 928 /* rowid1 */)) +__846: ; if !(((rc & 0xff) == SQLITE_CONSTRAINT) && ((*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FbConstraint != 0)) { - goto __827 + goto __847 } if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5) == OE_Ignore) { - goto __829 + goto __849 } rc = SQLITE_OK - goto __830 -__829: + goto __850 +__849: (*Vdbe)(unsafe.Pointer(p)).FerrorAction = func() uint8 { if int32((*Op)(unsafe.Pointer(pOp)).Fp5) == OE_Replace { - return OE_Abort + return uint8(OE_Abort) } return uint8((*Op)(unsafe.Pointer(pOp)).Fp5) }() -__830: +__850: ; - goto __828 -__827: + goto __848 +__847: (*Vdbe)(unsafe.Pointer(p)).FnChange++ -__828: +__848: ; if !(rc != 0) { - goto __831 + goto __851 } goto abort_due_to_error -__831: +__851: ; -__822: +__842: ; goto __8 // Opcode: Pagecount P1 P2 * * * // // Write the current number of pages in database P1 to memory cell P2. -__173: // out2 +__176: // out2 pOut = out2Prerelease(tls, p, pOp) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt)) goto __8 @@ -71804,22 +72341,22 @@ __173: // out2 // do not change the maximum page count value if P3==0. // // Store the maximum page count after the change in register P2. -__174: +__177: pOut = out2Prerelease(tls, p, pOp) pBt3 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt newMax = uint32(0) if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) { - goto __832 + goto __852 } newMax = Xsqlite3BtreeLastPage(tls, pBt3) if !(newMax < uint32((*Op)(unsafe.Pointer(pOp)).Fp3)) { - goto __833 + goto __853 } newMax = uint32((*Op)(unsafe.Pointer(pOp)).Fp3) -__833: +__853: ; -__832: +__852: ; *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(Xsqlite3BtreeMaxPageCount(tls, pBt3, newMax)) goto __8 @@ -71868,8 +72405,8 @@ __832: // if they were, they throw an error. // // See also: AggStep, AggFinal, Function -__175: // group -__176: +__178: // group +__179: ; pCtx2 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) @@ -71879,24 +72416,24 @@ __176: // reinitializes the relavant parts of the sqlite3_context object pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpOut != pOut) { - goto __834 + goto __854 } (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpVdbe = p (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpOut = pOut i8 = (int32((*Sqlite3_context)(unsafe.Pointer(pCtx2)).Fargc) - 1) -__835: +__855: if !(i8 >= 0) { - goto __837 + goto __857 } *(*uintptr)(unsafe.Pointer((pCtx2 + 48 /* &.argv */) + uintptr(i8)*8)) = (aMem + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2+i8))*56) - goto __836 -__836: + goto __856 +__856: i8-- - goto __835 - goto __837 -__837: + goto __855 + goto __857 +__857: ; -__834: +__854: ; (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Null)) @@ -71905,38 +72442,38 @@ __834: // If the function returned an error, throw an exception if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0) { - goto __838 + goto __858 } if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0) { - goto __839 + goto __859 } - Xsqlite3VdbeError(tls, p, ts+2690 /* "%s" */, libc.VaList(bp+128, Xsqlite3_value_text(tls, pOut))) + Xsqlite3VdbeError(tls, p, ts+2718 /* "%s" */, libc.VaList(bp+128, Xsqlite3_value_text(tls, pOut))) rc = (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError -__839: +__859: ; Xsqlite3VdbeDeleteAuxData(tls, db, (p + 288 /* &.pAuxData */), (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*Op)(unsafe.Pointer(pOp)).Fp1) (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError = 0 if !(rc != 0) { - goto __840 + goto __860 } goto abort_due_to_error -__840: +__860: ; -__838: +__858: ; // Copy the result of the function into register P3 if !((int32((*Mem)(unsafe.Pointer(pOut)).Fflags) & (MEM_Str | MEM_Blob)) != 0) { - goto __841 + goto __861 } Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding)) if !(Xsqlite3VdbeMemTooBig(tls, pOut) != 0) { - goto __842 + goto __862 } goto too_big -__842: +__862: ; -__841: +__861: ; goto __8 @@ -71964,8 +72501,8 @@ __841: // // If P3 is not zero, then it is an address to jump to if an SQLITE_CORRUPT // error is encountered. -__177: -__178: +__180: +__181: // If the P4 argument is not NULL, then it must be an SQL comment string. // The "--" string is broken up to prevent false-positives with srcck1.c. @@ -71987,61 +72524,61 @@ __178: } return (*Vdbe)(unsafe.Pointer(p)).FzSql }())) != uintptr(0))) { - goto __843 + goto __863 } if !((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_LEGACY) != 0) { - goto __844 + goto __864 } z2 = Xsqlite3VdbeExpandSql(tls, p, zTrace) - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((db + 232 /* &.trace */ /* &.xLegacy */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, z2) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((db + 240 /* &.trace */ /* &.xLegacy */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, z2) Xsqlite3_free(tls, z2) - goto __845 -__844: + goto __865 +__864: if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 1) { - goto __846 + goto __866 } - z3 = Xsqlite3MPrintf(tls, db, ts+4967 /* "-- %s" */, libc.VaList(bp+136, zTrace)) - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_STMT, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) + z3 = Xsqlite3MPrintf(tls, db, ts+5012 /* "-- %s" */, libc.VaList(bp+136, zTrace)) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 240 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) Xsqlite3DbFree(tls, db, z3) - goto __847 -__846: - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_STMT, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, zTrace) -__847: + goto __867 +__866: + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 240 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, zTrace) +__867: ; -__845: +__865: ; -__843: +__863: ; if !((*Op)(unsafe.Pointer(pOp)).Fp1 >= Xsqlite3Config.FiOnceResetThreshold) { - goto __848 + goto __868 } if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_Trace) { - goto __849 + goto __869 } goto __8 -__849: +__869: ; i9 = 1 -__850: +__870: if !(i9 < (*Vdbe)(unsafe.Pointer(p)).FnOp) { - goto __852 + goto __872 } if !(int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(i9)*24)).Fopcode) == OP_Once) { - goto __853 + goto __873 } (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(i9)*24)).Fp1 = 0 -__853: +__873: ; - goto __851 -__851: + goto __871 +__871: i9++ - goto __850 - goto __852 -__852: + goto __870 + goto __872 +__872: ; (*Op)(unsafe.Pointer(pOp)).Fp1 = 0 -__848: +__868: ; (*Op)(unsafe.Pointer(pOp)).Fp1++ *(*U32)(unsafe.Pointer((p + 212 /* &.aCounter */) + 6*4))++ @@ -72055,7 +72592,7 @@ __848: // is to say when the EXPLAIN QUERY PLAN syntax is used.) // This opcode records information from the optimizer. It is the // the same as a no-op. This opcodesnever appears in a real VM program. -__179: // This is really OP_Noop, OP_Explain +__182: // This is really OP_Noop, OP_Explain ; goto __8 @@ -72086,57 +72623,65 @@ __7: // an error of some kind. abort_due_to_error: if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - goto __854 + goto __874 } rc = SQLITE_NOMEM -__854: + goto __875 +__874: + if !(rc == (SQLITE_IOERR | (int32(33) << 8))) { + goto __876 + } + rc = Xsqlite3CorruptError(tls, 94151) +__876: + ; +__875: ; if !(((*Vdbe)(unsafe.Pointer(p)).FzErrMsg == uintptr(0)) && (rc != (SQLITE_IOERR | (int32(12) << 8)))) { - goto __855 + goto __877 } - Xsqlite3VdbeError(tls, p, ts+2690 /* "%s" */, libc.VaList(bp+144, Xsqlite3ErrStr(tls, rc))) -__855: + Xsqlite3VdbeError(tls, p, ts+2718 /* "%s" */, libc.VaList(bp+144, Xsqlite3ErrStr(tls, rc))) +__877: ; (*Vdbe)(unsafe.Pointer(p)).Frc = rc Xsqlite3SystemError(tls, db, rc) - Xsqlite3_log(tls, rc, ts+4973, /* "statement aborts..." */ + Xsqlite3_log(tls, rc, ts+5018, /* "statement aborts..." */ libc.VaList(bp+152, (int32((int64(pOp)-int64(aOp))/24)), (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)) Xsqlite3VdbeHalt(tls, p) if !(rc == (SQLITE_IOERR | (int32(12) << 8))) { - goto __856 + goto __878 } Xsqlite3OomFault(tls, db) -__856: +__878: ; rc = SQLITE_ERROR if !(int32(resetSchemaOnFault) > 0) { - goto __857 + goto __879 } Xsqlite3ResetOneSchema(tls, db, (int32(resetSchemaOnFault) - 1)) -__857: +__879: ; // This is the only way out of this procedure. We have to // release the mutexes on btrees that were acquired at the // top. vdbe_return: -__858: +__880: if !((nVmStep >= nProgressLimit) && ((*Sqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0))) { - goto __859 + goto __881 } nProgressLimit = nProgressLimit + (U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)) - if !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 504 /* &.xProgress */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) { - goto __860 + if !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 512 /* &.xProgress */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) { + goto __882 } nProgressLimit = (uint64(0xffffffff) | (U64((uint64(0xffffffff))) << 32)) rc = SQLITE_INTERRUPT goto abort_due_to_error -__860: +__882: ; - goto __858 -__859: + goto __880 +__881: ; *(*U32)(unsafe.Pointer((p + 212 /* &.aCounter */) + 4*4)) += (U32(int32(nVmStep))) Xsqlite3VdbeLeave(tls, p) @@ -72146,14 +72691,14 @@ __859: // Jump to here if a string or blob larger than SQLITE_MAX_LENGTH // is encountered. too_big: - Xsqlite3VdbeError(tls, p, ts+4289 /* "string or blob t..." */, 0) + Xsqlite3VdbeError(tls, p, ts+4317 /* "string or blob t..." */, 0) rc = SQLITE_TOOBIG goto abort_due_to_error // Jump to here if a malloc() fails. no_mem: Xsqlite3OomFault(tls, db) - Xsqlite3VdbeError(tls, p, ts+5005 /* "out of memory" */, 0) + Xsqlite3VdbeError(tls, p, ts+5050 /* "out of memory" */, 0) rc = SQLITE_NOMEM goto abort_due_to_error @@ -72166,15 +72711,15 @@ abort_due_to_interrupt: return int32(0) } -var azType = [4]uintptr{ts + 5019 /* "NOT NULL" */, ts + 5028 /* "UNIQUE" */, ts + 5035, /* "CHECK" */ - ts + 5041 /* "FOREIGN KEY" */} /* sqlite3.c:86430:25 */ -var aLTb = [6]uint8{uint8(1), uint8(0), uint8(0), uint8(1), uint8(1), uint8(0)} /* sqlite3.c:87455:32 */ -var aEQb = [6]uint8{uint8(0), uint8(1), uint8(0), uint8(1), uint8(0), uint8(1)} /* sqlite3.c:87458:32 */ -var aGTb = [6]uint8{uint8(1), uint8(0), uint8(1), uint8(0), uint8(0), uint8(1)} /* sqlite3.c:87461:32 */ -var and_logic = [9]uint8{uint8(0), uint8(0), uint8(0), uint8(0), uint8(1), uint8(2), uint8(0), uint8(2), uint8(2)} /* sqlite3.c:87681:32 */ -var or_logic = [9]uint8{uint8(0), uint8(1), uint8(2), uint8(1), uint8(1), uint8(1), uint8(2), uint8(1), uint8(2)} /* sqlite3.c:87684:32 */ -var aFlag1 = [2]U16{MEM_Blob, (U16(MEM_Str | MEM_Term))} /* sqlite3.c:88134:24 */ -var vfsFlags int32 = ((((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) | SQLITE_OPEN_TRANSIENT_DB) /* sqlite3.c:89263:20 */ +var azType = [4]uintptr{ts + 5064 /* "NOT NULL" */, ts + 5073 /* "UNIQUE" */, ts + 5080, /* "CHECK" */ + ts + 5086 /* "FOREIGN KEY" */} /* sqlite3.c:87056:25 */ +var aLTb = [6]uint8{uint8(1), uint8(0), uint8(0), uint8(1), uint8(1), uint8(0)} /* sqlite3.c:88073:32 */ +var aEQb = [6]uint8{uint8(0), uint8(1), uint8(0), uint8(1), uint8(0), uint8(1)} /* sqlite3.c:88076:32 */ +var aGTb = [6]uint8{uint8(1), uint8(0), uint8(1), uint8(0), uint8(0), uint8(1)} /* sqlite3.c:88079:32 */ +var and_logic = [9]uint8{uint8(0), uint8(0), uint8(0), uint8(0), uint8(1), uint8(2), uint8(0), uint8(2), uint8(2)} /* sqlite3.c:88299:32 */ +var or_logic = [9]uint8{uint8(0), uint8(1), uint8(2), uint8(1), uint8(1), uint8(1), uint8(2), uint8(1), uint8(2)} /* sqlite3.c:88302:32 */ +var aFlag1 = [2]U16{U16(MEM_Blob), (U16(MEM_Str | MEM_Term))} /* sqlite3.c:88752:24 */ +var vfsFlags int32 = ((((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) | SQLITE_OPEN_TRANSIENT_DB) /* sqlite3.c:89887:20 */ //************* End of vdbe.c *********************************************** //************* Begin file vdbeblob.c *************************************** @@ -72205,7 +72750,7 @@ type Incrblob1 = struct { Fdb uintptr FzDb uintptr FpTab uintptr -} /* sqlite3.c:93397:9 */ +} /* sqlite3.c:94241:9 */ //************* End of vdbe.c *********************************************** //************* Begin file vdbeblob.c *************************************** @@ -72226,7 +72771,7 @@ type Incrblob1 = struct { // #include "vdbeInt.h" // Valid sqlite3_blob* handles point to Incrblob structures. -type Incrblob = Incrblob1 /* sqlite3.c:93397:25 */ +type Incrblob = Incrblob1 /* sqlite3.c:94241:25 */ // 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. @@ -72243,7 +72788,7 @@ type Incrblob = Incrblob1 /* sqlite3.c:93397:25 */ // 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 *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) int32 { /* sqlite3.c:93427:12: */ +func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) int32 { /* sqlite3.c:94271:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -72253,7 +72798,7 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) // Set the value of register r[1] in the SQL statement to integer iRow. // This is done directly as a performance optimization - (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56 /* &.u */)) = iRow // If the statement has been run before (and is paused at the OP_ResultRow) @@ -72277,16 +72822,16 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) } if type1 < U32(12) { - zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+5053, /* "cannot open valu..." */ + zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+5098, /* "cannot open valu..." */ libc.VaList(bp, func() uintptr { if type1 == U32(0) { - return ts + 5082 /* "null" */ + return ts + 5127 /* "null" */ } return func() uintptr { if type1 == U32(7) { - return ts + 5087 /* "real" */ + return ts + 5132 /* "real" */ } - return ts + 5092 /* "integer" */ + return ts + 5137 /* "integer" */ }() }())) rc = SQLITE_ERROR @@ -72306,10 +72851,10 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) rc = Xsqlite3_finalize(tls, (*Incrblob)(unsafe.Pointer(p)).FpStmt) (*Incrblob)(unsafe.Pointer(p)).FpStmt = uintptr(0) if rc == SQLITE_OK { - zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+5100 /* "no such rowid: %..." */, libc.VaList(bp+8, iRow)) + zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+5145 /* "no such rowid: %..." */, libc.VaList(bp+8, iRow)) rc = SQLITE_ERROR } else { - zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+2690 /* "%s" */, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb))) + zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+2718 /* "%s" */, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb))) } } @@ -72318,18 +72863,18 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) } // Open a blob handle. -func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, zColumn uintptr, iRow Sqlite_int64, wrFlag int32, ppBlob uintptr) int32 { /* sqlite3.c:93492:16: */ - bp := tls.Alloc(480) - defer tls.Free(480) +func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, zColumn uintptr, iRow Sqlite_int64, wrFlag int32, ppBlob uintptr) int32 { /* sqlite3.c:94336:16: */ + bp := tls.Alloc(464) + defer tls.Free(464) var nAttempt int32 var iCol int32 // Index of zColumn in row-record var rc int32 - // var zErr uintptr at bp+472, 8 + // var zErr uintptr at bp+456, 8 var pTab uintptr var pBlob uintptr - // var sParse Parse at bp+48, 424 + // var sParse Parse at bp+48, 408 var j int32 // Check that the column is not part of an FK child key definition. It @@ -72345,7 +72890,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, var aOp uintptr nAttempt = 0 rc = SQLITE_OK - *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)) = uintptr(0) pBlob = uintptr(0) *(*uintptr)(unsafe.Pointer(ppBlob)) = uintptr(0) @@ -72363,8 +72908,8 @@ __1: __4: ; (*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).Fdb = db - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */))) - *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = uintptr(0) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */))) + *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)) = uintptr(0) Xsqlite3BtreeEnterAll(tls, db) pTab = Xsqlite3LocateTable(tls, bp+48 /* &sParse */, uint32(0), zTable, zDb) @@ -72372,21 +72917,21 @@ __4: goto __5 } pTab = uintptr(0) - Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+5120 /* "cannot open virt..." */, libc.VaList(bp, zTable)) + Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+5165 /* "cannot open virt..." */, libc.VaList(bp, zTable)) __5: ; - if !((pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !((pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __6 } pTab = uintptr(0) - Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+5150 /* "cannot open tabl..." */, libc.VaList(bp+8, zTable)) + Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+5195 /* "cannot open tabl..." */, libc.VaList(bp+8, zTable)) __6: ; if !((pTab != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) { goto __7 } pTab = uintptr(0) - Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+5186 /* "cannot open view..." */, libc.VaList(bp+16, zTable)) + Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+5231 /* "cannot open view..." */, libc.VaList(bp+16, zTable)) __7: ; if !(!(pTab != 0)) { @@ -72395,8 +72940,8 @@ __7: if !((*Parse)(unsafe.Pointer(bp+48 /* &sParse */)).FzErrMsg != 0) { goto __9 } - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */))) - *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = (*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FzErrMsg + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */))) + *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)) = (*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FzErrMsg (*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FzErrMsg = uintptr(0) __9: ; @@ -72430,8 +72975,8 @@ __12: if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { goto __14 } - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */))) - *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+5207 /* "no such column: ..." */, libc.VaList(bp+24, zColumn)) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */))) + *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+5252 /* "no such column: ..." */, libc.VaList(bp+24, zColumn)) rc = SQLITE_ERROR Xsqlite3BtreeLeaveAll(tls, db) goto blob_open_out @@ -72444,7 +72989,7 @@ __14: goto __15 } zFault = uintptr(0) - if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) { + if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) { goto __16 } pFKey = (*Table)(unsafe.Pointer(pTab)).FpFKey @@ -72460,7 +73005,7 @@ __20: if !((*sColMap)(unsafe.Pointer((pFKey+64 /* &.aCol */)+uintptr(j)*16)).FiFrom == iCol) { goto __23 } - zFault = ts + 5228 /* "foreign key" */ + zFault = ts + 5273 /* "foreign key" */ __23: ; goto __21 @@ -72493,7 +73038,7 @@ __27: if !((int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == iCol) || (int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == (-2))) { goto __30 } - zFault = ts + 5240 /* "indexed" */ + zFault = ts + 5285 /* "indexed" */ __30: ; goto __28 @@ -72513,8 +73058,8 @@ __26: if !(zFault != 0) { goto __31 } - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */))) - *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+5248 /* "cannot open %s c..." */, libc.VaList(bp+32, zFault)) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */))) + *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+5293 /* "cannot open %s c..." */, libc.VaList(bp+32, zFault)) rc = SQLITE_ERROR Xsqlite3BtreeLeaveAll(tls, db) goto blob_open_out @@ -72561,7 +73106,7 @@ __33: if !(wrFlag != 0) { goto __35 } - (*VdbeOp)(unsafe.Pointer(aOp + 1*24)).Fopcode = OP_OpenWrite + (*VdbeOp)(unsafe.Pointer(aOp + 1*24)).Fopcode = U8(OP_OpenWrite) __35: ; (*VdbeOp)(unsafe.Pointer(aOp + 1*24)).Fp2 = int32((*Table)(unsafe.Pointer(pTab)).Ftnum) @@ -72595,7 +73140,7 @@ __32: goto blob_open_out __36: ; - rc = blobSeekToRow(tls, pBlob, iRow, bp+472 /* &zErr */) + rc = blobSeekToRow(tls, pBlob, iRow, bp+456 /* &zErr */) goto __2 __2: if ((libc.PreIncInt32(&nAttempt, 1)) < SQLITE_MAX_SCHEMA_RETRY) && (rc == SQLITE_SCHEMA) { @@ -72622,32 +73167,32 @@ __39: __38: ; Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr { - if *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) != 0 { - return ts + 2690 /* "%s" */ + if *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)) != 0 { + return ts + 2718 /* "%s" */ } return uintptr(0) - }(), libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)))) - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */))) + }(), libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)))) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */))) Xsqlite3ParserReset(tls, bp+48 /* &sParse */) rc = Xsqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return rc } -var iLn int32 = 0 /* sqlite3.c:93635:24 */ +var iLn int32 = 0 /* sqlite3.c:94479:24 */ var openBlob = [6]VdbeOpList{ - {Fopcode: OP_TableLock}, // 0: Acquire a read or write lock - {Fopcode: OP_OpenRead}, // 1: Open a cursor + {Fopcode: U8(OP_TableLock)}, // 0: Acquire a read or write lock + {Fopcode: U8(OP_OpenRead)}, // 1: Open a cursor // blobSeekToRow() will initialize r[1] to the desired rowid - {Fopcode: OP_NotExists, Fp2: int8(5), Fp3: int8(1)}, // 2: Seek the cursor to rowid=r[1] - {Fopcode: OP_Column, Fp3: int8(1)}, // 3 - {Fopcode: OP_ResultRow, Fp1: int8(1)}, // 4 - {Fopcode: OP_Halt}, // 5 -} /* sqlite3.c:93636:31 */ + {Fopcode: U8(OP_NotExists), Fp2: int8(5), Fp3: int8(1)}, // 2: Seek the cursor to rowid=r[1] + {Fopcode: U8(OP_Column), Fp3: int8(1)}, // 3 + {Fopcode: U8(OP_ResultRow), Fp1: int8(1)}, // 4 + {Fopcode: U8(OP_Halt)}, // 5 +} /* sqlite3.c:94480:31 */ // Close a blob handle that was previously created using // sqlite3_blob_open(). -func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:93725:16: */ +func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:94569:16: */ var p uintptr = pBlob var rc int32 var db uintptr @@ -72666,14 +73211,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:9372 } // Perform a read or write operation on a blob -func blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) int32 { /* sqlite3.c:93746:12: */ +func blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) int32 { /* sqlite3.c:94590:12: */ var rc int32 var p uintptr = pBlob var v uintptr var db uintptr if p == uintptr(0) { - return Xsqlite3MisuseError(tls, 93758) + return Xsqlite3MisuseError(tls, 94602) } db = (*Incrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -72729,14 +73274,14 @@ func blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int } // Read data from a blob handle. -func Xsqlite3_blob_read(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:93819:16: */ +func Xsqlite3_blob_read(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:94663:16: */ return blobReadWrite(tls, pBlob, z, n, iOffset, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, U32, U32, uintptr) int32 }{Xsqlite3BtreePayloadChecked}))) } // Write data to a blob handle. -func Xsqlite3_blob_write(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:93826:16: */ +func Xsqlite3_blob_write(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:94670:16: */ return blobReadWrite(tls, pBlob, z, n, iOffset, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, U32, U32, uintptr) int32 }{Xsqlite3BtreePutData}))) @@ -72746,7 +73291,7 @@ func Xsqlite3_blob_write(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffs // // The Incrblob.nByte field is fixed for the lifetime of the Incrblob // so no mutex is required for access. -func Xsqlite3_blob_bytes(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:93836:16: */ +func Xsqlite3_blob_bytes(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:94680:16: */ var p uintptr = pBlob if (p != 0) && ((*Incrblob)(unsafe.Pointer(p)).FpStmt != 0) { return (*Incrblob)(unsafe.Pointer(p)).FnByte @@ -72762,7 +73307,7 @@ func Xsqlite3_blob_bytes(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:9383 // 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 *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int32 { /* sqlite3.c:93851:16: */ +func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int32 { /* sqlite3.c:94695:16: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -72771,7 +73316,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int3 var db uintptr if p == uintptr(0) { - return Xsqlite3MisuseError(tls, 93856) + return Xsqlite3MisuseError(tls, 94700) } db = (*Incrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -72787,7 +73332,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int3 if rc != SQLITE_OK { Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr { if *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */)) != 0 { - return ts + 2690 /* "%s" */ + return ts + 2718 /* "%s" */ } return uintptr(0) }(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */)))) @@ -72957,7 +73502,7 @@ type MergeEngine1 = struct { FpTask uintptr FaTree uintptr FaReadr uintptr -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ //************* End of vdbeblob.c ******************************************* //************* Begin file vdbesort.c *************************************** @@ -73108,7 +73653,7 @@ type MergeEngine1 = struct { // overflows. 512MiB. // Private objects used by the sorter -type MergeEngine = MergeEngine1 /* sqlite3.c:94044:28 */ // Merge PMAs together +type MergeEngine = MergeEngine1 /* sqlite3.c:94888:28 */ // Merge PMAs together type PmaReader1 = struct { FiReadOff I64 FiEof I64 @@ -73122,10 +73667,10 @@ type PmaReader1 = struct { _ [4]byte FaMap uintptr FpIncr uintptr -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // Merge PMAs together -type PmaReader = PmaReader1 /* sqlite3.c:94045:26 */ // Incrementally read one PMA +type PmaReader = PmaReader1 /* sqlite3.c:94889:26 */ // Incrementally read one PMA type PmaWriter1 = struct { FeFWErr int32 _ [4]byte @@ -73136,18 +73681,18 @@ type PmaWriter1 = struct { _ [4]byte FiWriteOff I64 FpFd uintptr -} /* sqlite3.c:94046:9 */ +} /* sqlite3.c:94890:9 */ // Incrementally read one PMA -type PmaWriter = PmaWriter1 /* sqlite3.c:94046:26 */ // Incrementally write one PMA +type PmaWriter = PmaWriter1 /* sqlite3.c:94890:26 */ // Incrementally write one PMA type SorterRecord1 = struct { FnVal int32 _ [4]byte Fu struct{ FpNext uintptr } -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // Incrementally write one PMA -type SorterRecord = SorterRecord1 /* sqlite3.c:94047:29 */ // A record being sorted +type SorterRecord = SorterRecord1 /* sqlite3.c:94891:29 */ // A record being sorted type SortSubtask1 = struct { FpThread uintptr FbDone int32 @@ -73160,26 +73705,26 @@ type SortSubtask1 = struct { FxCompare SorterCompare Ffile SorterFile Ffile2 SorterFile -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // A record being sorted -type SortSubtask = SortSubtask1 /* sqlite3.c:94048:28 */ // A sub-task in the sort process +type SortSubtask = SortSubtask1 /* sqlite3.c:94892:28 */ // A sub-task in the sort process type SorterFile1 = struct { FpFd uintptr FiEof I64 -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // A sub-task in the sort process -type SorterFile = SorterFile1 /* sqlite3.c:94049:27 */ // Temporary file object wrapper +type SorterFile = SorterFile1 /* sqlite3.c:94893:27 */ // Temporary file object wrapper type SorterList1 = struct { FpList uintptr FaMemory uintptr FszPMA int32 _ [4]byte -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // Temporary file object wrapper -type SorterList = SorterList1 /* sqlite3.c:94050:27 */ // In-memory list of records +type SorterList = SorterList1 /* sqlite3.c:94894:27 */ // In-memory list of records type IncrMerger1 = struct { FpTask uintptr FpMerger uintptr @@ -73189,10 +73734,10 @@ type IncrMerger1 = struct { FbUseThread int32 _ [4]byte FaFile [2]SorterFile -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // In-memory list of records -type IncrMerger = IncrMerger1 /* sqlite3.c:94051:27 */ +type IncrMerger = IncrMerger1 /* sqlite3.c:94895:27 */ // This object represents a single thread of control in a sort operation. // Exactly VdbeSorter.nTask instances of this object are allocated @@ -73223,11 +73768,11 @@ type IncrMerger = IncrMerger1 /* sqlite3.c:94051:27 */ // In both cases, the effects of the main thread seeing (bDone==0) even // after the thread has finished are not dire. So we don't worry about // memory barriers and such here. -type SorterCompare = uintptr /* sqlite3.c:94178:13 */ +type SorterCompare = uintptr /* sqlite3.c:95022:13 */ // Free all memory belonging to the PmaReader object passed as the // argument. All structure fields are set to zero before returning. -func vdbePmaReaderClear(tls *libc.TLS, pReadr uintptr) { /* sqlite3.c:94353:13: */ +func vdbePmaReaderClear(tls *libc.TLS, pReadr uintptr) { /* sqlite3.c:95197:13: */ Xsqlite3_free(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FaAlloc) Xsqlite3_free(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer) if (*PmaReader)(unsafe.Pointer(pReadr)).FaMap != 0 { @@ -73244,7 +73789,7 @@ func vdbePmaReaderClear(tls *libc.TLS, pReadr uintptr) { /* sqlite3.c:94353:13: // // The buffer returned in *ppOut is only valid until the // next call to this function. -func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32 { /* sqlite3.c:94370:12: */ +func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32 { /* sqlite3.c:95214:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -73348,7 +73893,7 @@ func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32 // Read a varint from the stream of data accessed by p. Set *pnOut to // the value read. -func vdbePmaReadVarint(tls *libc.TLS, p uintptr, pnOut uintptr) int32 { /* sqlite3.c:94464:12: */ +func vdbePmaReadVarint(tls *libc.TLS, p uintptr, pnOut uintptr) int32 { /* sqlite3.c:95308:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -73388,7 +73933,7 @@ func vdbePmaReadVarint(tls *libc.TLS, p uintptr, pnOut uintptr) int32 { /* sqlit // // Or, if an error occurs, return an SQLite error code. The final value of // *pp is undefined in this case. -func vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) int32 { /* sqlite3.c:94497:12: */ +func vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) int32 { /* sqlite3.c:95341:12: */ var rc int32 = SQLITE_OK if (*SorterFile)(unsafe.Pointer(pFile)).FiEof <= (I64((*Sqlite3)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap)) { var pFd uintptr = (*SorterFile)(unsafe.Pointer(pFile)).FpFd @@ -73403,7 +73948,7 @@ func vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) // 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 *libc.TLS, pTask uintptr, pReadr uintptr, pFile uintptr, iOff I64) int32 { /* sqlite3.c:94514:12: */ +func vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uintptr, iOff I64) int32 { /* sqlite3.c:95358:12: */ var rc int32 = SQLITE_OK if Xsqlite3FaultSim(tls, 201) != 0 { @@ -73444,7 +73989,7 @@ func vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uintp // 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 *libc.TLS, pReadr uintptr) int32 { /* sqlite3.c:94561:12: */ +func vdbePmaReaderNext(tls *libc.TLS, pReadr uintptr) int32 { /* sqlite3.c:95405:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -73490,7 +74035,7 @@ func vdbePmaReaderNext(tls *libc.TLS, pReadr uintptr) int32 { /* sqlite3.c:94561 // // 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 *libc.TLS, pTask uintptr, pFile uintptr, iStart I64, pReadr uintptr, pnByte uintptr) int32 { /* sqlite3.c:94608:12: */ +func vdbePmaReaderInit(tls *libc.TLS, pTask uintptr, pFile uintptr, iStart I64, pReadr uintptr, pnByte uintptr) int32 { /* sqlite3.c:95452:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -73513,7 +74058,7 @@ func vdbePmaReaderInit(tls *libc.TLS, pTask uintptr, pFile uintptr, iStart I64, // 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 *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94641:12: */ +func vdbeSorterCompareTail(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:95485:12: */ var r2 uintptr = (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked if *(*int32)(unsafe.Pointer(pbKey2Cached)) == 0 { Xsqlite3VdbeRecordUnpack(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo, nKey2, pKey2, r2) @@ -73533,7 +74078,7 @@ func vdbeSorterCompareTail(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, p // // If an OOM error is encountered, (pTask->pUnpacked->error_rc) is set // to SQLITE_NOMEM. -func vdbeSorterCompare(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94668:12: */ +func vdbeSorterCompare(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:95512:12: */ var r2 uintptr = (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked if !(*(*int32)(unsafe.Pointer(pbKey2Cached)) != 0) { Xsqlite3VdbeRecordUnpack(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo, nKey2, pKey2, r2) @@ -73545,7 +74090,7 @@ func vdbeSorterCompare(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 // 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 *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94687:12: */ +func vdbeSorterCompareText(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:95531:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -73595,7 +74140,7 @@ func vdbeSorterCompareText(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, p // A specially optimized version of vdbeSorterCompare() that assumes that // the first field of each key is an INTEGER value. -func vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94729:12: */ +func vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:95573:12: */ var p1 uintptr = pKey1 var p2 uintptr = pKey2 var s1 int32 = int32(*(*U8)(unsafe.Pointer(p1 + 1))) // Left hand serial type @@ -73655,7 +74200,7 @@ func vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pK return res } -var aLen = [10]U8{U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(0), U8(0), U8(0)} /* sqlite3.c:94748:21 */ +var aLen = [10]U8{U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(0), U8(0), U8(0)} /* sqlite3.c:95592:21 */ // Initialize the temporary index cursor just opened as a sorter cursor. // @@ -73674,7 +74219,7 @@ var aLen = [10]U8{U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(0), U8(0), // mode, but not in multi-threaded mode. // // SQLITE_OK is returned if successful, or an SQLite error code otherwise. -func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) int32 { /* sqlite3.c:94812:20: */ +func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) int32 { /* sqlite3.c:95656:20: */ var pgsz int32 // Page size of main database var i int32 // Used to iterate through aTask[] var pSorter uintptr // The new sorter @@ -73688,7 +74233,7 @@ func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt if (Xsqlite3TempInMemory(tls, db) != 0) || (int32(Xsqlite3Config.FbCoreMutex) == 0) { nWorker = 0 } else { - nWorker = *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 11*4)) + nWorker = *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 11*4)) } // Do not allow the total number of threads (main thread + all workers) @@ -73702,13 +74247,16 @@ func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt if pSorter == uintptr(0) { rc = SQLITE_NOMEM } else { + var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt (*VdbeSorter)(unsafe.Pointer(pSorter)).FpKeyInfo = libc.AssignUintptr(&pKeyInfo, (pSorter + uintptr(sz))) libc.Xmemcpy(tls, pKeyInfo, (*VdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo, uint64(szKeyInfo)) (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb = uintptr(0) if (nField != 0) && (nWorker == 0) { (*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField = U16(nField) } - (*VdbeSorter)(unsafe.Pointer(pSorter)).Fpgsz = libc.AssignInt32(&pgsz, Xsqlite3BtreeGetPageSize(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt)) + Xsqlite3BtreeEnter(tls, pBt) + (*VdbeSorter)(unsafe.Pointer(pSorter)).Fpgsz = libc.AssignInt32(&pgsz, Xsqlite3BtreeGetPageSize(tls, pBt)) + Xsqlite3BtreeLeave(tls, pBt) (*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask = (U8(nWorker + 1)) (*VdbeSorter)(unsafe.Pointer(pSorter)).FiPrev = (U8(nWorker - 1)) (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads = (U8(libc.Bool32(int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) > 1))) @@ -73767,7 +74315,7 @@ func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } // Free the list of sorted records starting at pRecord. -func vdbeSorterRecordFree(tls *libc.TLS, db uintptr, pRecord uintptr) { /* sqlite3.c:94914:13: */ +func vdbeSorterRecordFree(tls *libc.TLS, db uintptr, pRecord uintptr) { /* sqlite3.c:95761:13: */ var p uintptr var pNext uintptr for p = pRecord; p != 0; p = pNext { @@ -73778,7 +74326,7 @@ func vdbeSorterRecordFree(tls *libc.TLS, db uintptr, pRecord uintptr) { /* sqlit // Free all resources owned by the object indicated by argument pTask. All // fields of *pTask are zeroed before returning. -func vdbeSortSubtaskCleanup(tls *libc.TLS, db uintptr, pTask uintptr) { /* sqlite3.c:94927:13: */ +func vdbeSortSubtaskCleanup(tls *libc.TLS, db uintptr, pTask uintptr) { /* sqlite3.c:95774:13: */ Xsqlite3DbFree(tls, db, (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked) // pTask->list.aMemory can only be non-zero if it was handed memory // from the main thread. That only occurs SQLITE_MAX_WORKER_THREADS>0 @@ -73798,13 +74346,13 @@ func vdbeSortSubtaskCleanup(tls *libc.TLS, db uintptr, pTask uintptr) { /* sqlit } // Join thread pTask->thread. -func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:94992:12: */ +func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:95839:12: */ bp := tls.Alloc(8) defer tls.Free(8) var rc int32 = SQLITE_OK if (*SortSubtask)(unsafe.Pointer(pTask)).FpThread != 0 { - *(*uintptr)(unsafe.Pointer(bp /* pRet */)) = uintptr(SQLITE_ERROR) + *(*uintptr)(unsafe.Pointer(bp /* pRet */)) = uintptr(int64(SQLITE_ERROR)) Xsqlite3ThreadJoin(tls, (*SortSubtask)(unsafe.Pointer(pTask)).FpThread, bp /* &pRet */) @@ -73817,14 +74365,14 @@ func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:949 } // Launch a background thread to run xTask(pIn). -func vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:95013:12: */ +func vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:95860:12: */ return Xsqlite3ThreadCreate(tls, (pTask /* &.pThread */), xTask, pIn) } // Join all outstanding threads launched by SorterWrite() to create // level-0 PMAs. -func vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) int32 { /* sqlite3.c:95026:12: */ +func vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) int32 { /* sqlite3.c:95873:12: */ var rc int32 = rcin var i int32 @@ -73850,7 +74398,7 @@ func vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) int32 { /* sq // // 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 *libc.TLS, nReader int32) uintptr { /* sqlite3.c:95056:20: */ +func vdbeMergeEngineNew(tls *libc.TLS, nReader int32) uintptr { /* sqlite3.c:95903:20: */ var N int32 = 2 // Smallest power of two >= nReader var nByte int32 // Total bytes of space to allocate var pNew uintptr // Pointer to allocated object to return @@ -73875,7 +74423,7 @@ func vdbeMergeEngineNew(tls *libc.TLS, nReader int32) uintptr { /* sqlite3.c:950 } // Free the MergeEngine object passed as the only argument. -func vdbeMergeEngineFree(tls *libc.TLS, pMerger uintptr) { /* sqlite3.c:95079:13: */ +func vdbeMergeEngineFree(tls *libc.TLS, pMerger uintptr) { /* sqlite3.c:95926:13: */ var i int32 if pMerger != 0 { for i = 0; i < (*MergeEngine)(unsafe.Pointer(pMerger)).FnTree; i++ { @@ -73887,7 +74435,7 @@ func vdbeMergeEngineFree(tls *libc.TLS, pMerger uintptr) { /* sqlite3.c:95079:13 // Free all resources associated with the IncrMerger object indicated by // the first argument. -func vdbeIncrFree(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:95093:13: */ +func vdbeIncrFree(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:95940:13: */ if pIncr != 0 { if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 { vdbeSorterJoinThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask) @@ -73904,7 +74452,7 @@ func vdbeIncrFree(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:95093:13: */ } // Reset a sorting cursor back to its original empty state. -func Xsqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { /* sqlite3.c:95110:21: */ +func Xsqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { /* sqlite3.c:95957:21: */ var i int32 vdbeSorterJoinAll(tls, pSorter, SQLITE_OK) @@ -73933,7 +74481,7 @@ func Xsqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { /* sq } // Free any cursor components allocated by sqlite3VdbeSorterXXX routines. -func Xsqlite3VdbeSorterClose(tls *libc.TLS, db uintptr, pCsr uintptr) { /* sqlite3.c:95143:21: */ +func Xsqlite3VdbeSorterClose(tls *libc.TLS, db uintptr, pCsr uintptr) { /* sqlite3.c:95990:21: */ var pSorter uintptr pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 56 /* &.uc */)) @@ -73952,7 +74500,7 @@ func Xsqlite3VdbeSorterClose(tls *libc.TLS, db uintptr, pCsr uintptr) { /* sqlit // // Whether or not the file does end up memory mapped of course depends on // the specific VFS implementation. -func vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, nByte I64) { /* sqlite3.c:95165:13: */ +func vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, nByte I64) { /* sqlite3.c:96012:13: */ bp := tls.Alloc(24) defer tls.Free(24) *(*I64)(unsafe.Pointer(bp + 8)) = nByte @@ -73970,7 +74518,7 @@ func vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, nByte I64) { / // 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 *libc.TLS, db uintptr, nExtend I64, ppFd uintptr) int32 { /* sqlite3.c:95184:12: */ +func vdbeSorterOpenTempFile(tls *libc.TLS, db uintptr, nExtend I64, ppFd uintptr) int32 { /* sqlite3.c:96031:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -73982,7 +74530,7 @@ func vdbeSorterOpenTempFile(tls *libc.TLS, db uintptr, nExtend I64, ppFd uintptr *(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3OsOpenMalloc(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), ppFd, ((((SQLITE_OPEN_TEMP_JOURNAL | SQLITE_OPEN_READWRITE) | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE), bp /* &rc */) if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK { - *(*I64)(unsafe.Pointer(bp + 8 /* max */)) = SQLITE_MAX_MMAP_SIZE + *(*I64)(unsafe.Pointer(bp + 8 /* max */)) = int64(SQLITE_MAX_MMAP_SIZE) Xsqlite3OsFileControlHint(tls, *(*uintptr)(unsafe.Pointer(ppFd)), SQLITE_FCNTL_MMAP_SIZE, bp+8 /* &max */) if nExtend > int64(0) { vdbeSorterExtendFile(tls, db, *(*uintptr)(unsafe.Pointer(ppFd)), nExtend) @@ -73994,7 +74542,7 @@ func vdbeSorterOpenTempFile(tls *libc.TLS, db uintptr, nExtend I64, ppFd uintptr // 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 *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:95211:12: */ +func vdbeSortAllocUnpacked(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:96058:12: */ if (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked == uintptr(0) { (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked = Xsqlite3VdbeAllocUnpackedRecord(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo) if (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked == uintptr(0) { @@ -74007,7 +74555,7 @@ func vdbeSortAllocUnpacked(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:95 } // Merge the two sorted lists p1 and p2 into a single list. -func vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:95225:21: */ +func vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:96072:21: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -74044,7 +74592,7 @@ func vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintp // Return the SorterCompare function to compare values collected by the // sorter object passed as the only argument. -func vdbeSorterGetCompare(tls *libc.TLS, p uintptr) SorterCompare { /* sqlite3.c:95267:22: */ +func vdbeSorterGetCompare(tls *libc.TLS, p uintptr) SorterCompare { /* sqlite3.c:96114:22: */ if int32((*VdbeSorter)(unsafe.Pointer(p)).FtypeMask) == SORTER_TYPE_INTEGER { return *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32 @@ -74062,7 +74610,7 @@ func vdbeSorterGetCompare(tls *libc.TLS, p uintptr) SorterCompare { /* sqlite3.c // 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 *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:95281:12: */ +func vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:96128:12: */ bp := tls.Alloc(512) defer tls.Free(512) @@ -74119,7 +74667,7 @@ func vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqli } // Initialize a PMA-writer object. -func vdbePmaWriterInit(tls *libc.TLS, pFd uintptr, p uintptr, nBuf int32, iStart I64) { /* sqlite3.c:95332:13: */ +func vdbePmaWriterInit(tls *libc.TLS, pFd uintptr, p uintptr, nBuf int32, iStart I64) { /* sqlite3.c:96179:13: */ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(PmaWriter{}))) (*PmaWriter)(unsafe.Pointer(p)).FaBuffer = Xsqlite3Malloc(tls, uint64(nBuf)) if !(int32((*PmaWriter)(unsafe.Pointer(p)).FaBuffer) != 0) { @@ -74134,7 +74682,7 @@ func vdbePmaWriterInit(tls *libc.TLS, pFd uintptr, p uintptr, nBuf int32, iStart // 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 *libc.TLS, p uintptr, pData uintptr, nData int32) { /* sqlite3.c:95354:13: */ +func vdbePmaWriteBlob(tls *libc.TLS, p uintptr, pData uintptr, nData int32) { /* sqlite3.c:96201:13: */ var nRem int32 = nData for (nRem > 0) && ((*PmaWriter)(unsafe.Pointer(p)).FeFWErr == 0) { var nCopy int32 = nRem @@ -74163,7 +74711,7 @@ func vdbePmaWriteBlob(tls *libc.TLS, p uintptr, pData uintptr, nData int32) { /* // // Before returning, set *piEof to the offset immediately following the // last byte written to the file. -func vdbePmaWriterFinish(tls *libc.TLS, p uintptr, piEof uintptr) int32 { /* sqlite3.c:95387:12: */ +func vdbePmaWriterFinish(tls *libc.TLS, p uintptr, piEof uintptr) int32 { /* sqlite3.c:96234:12: */ var rc int32 if (((*PmaWriter)(unsafe.Pointer(p)).FeFWErr == 0) && ((*PmaWriter)(unsafe.Pointer(p)).FaBuffer != 0)) && ((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd > (*PmaWriter)(unsafe.Pointer(p)).FiBufStart) { (*PmaWriter)(unsafe.Pointer(p)).FeFWErr = Xsqlite3OsWrite(tls, (*PmaWriter)(unsafe.Pointer(p)).FpFd, @@ -74179,7 +74727,7 @@ func vdbePmaWriterFinish(tls *libc.TLS, p uintptr, piEof uintptr) int32 { /* sql // 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 *libc.TLS, p uintptr, iVal U64) { /* sqlite3.c:95406:13: */ +func vdbePmaWriteVarint(tls *libc.TLS, p uintptr, iVal U64) { /* sqlite3.c:96253:13: */ bp := tls.Alloc(10) defer tls.Free(10) @@ -74202,7 +74750,7 @@ func vdbePmaWriteVarint(tls *libc.TLS, p uintptr, iVal U64) { /* sqlite3.c:95406 // * 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 *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:95427:12: */ +func vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:96274:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -74257,7 +74805,7 @@ func vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* // 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 *libc.TLS, pMerger uintptr, pbEof uintptr) int32 { /* sqlite3.c:95491:12: */ +func vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) int32 { /* sqlite3.c:96338:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -74331,7 +74879,7 @@ func vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) int32 { } // The main routine for background threads that write level-0 PMAs. -func vdbeSorterFlushThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:95562:13: */ +func vdbeSorterFlushThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:96409:13: */ var pTask uintptr = pCtx var rc int32 // Return code @@ -74342,7 +74890,7 @@ func vdbeSorterFlushThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:9 // Flush the current contents of VdbeSorter.list to a new PMA, possibly // using a background thread. -func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:95576:12: */ +func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:96423:12: */ var rc int32 = SQLITE_OK var i int32 var pTask uintptr = uintptr(0) // Thread context used to create new PMA @@ -74406,7 +74954,7 @@ func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:955 } // Add a record to the sorter. -func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 { /* sqlite3.c:95646:20: */ +func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 { /* sqlite3.c:96493:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -74522,7 +75070,7 @@ func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 { // 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 *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95758:12: */ +func vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:96605:12: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -74568,7 +75116,7 @@ func vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95758:1 // The main routine for background threads that populate aFile[1] of // multi-threaded IncrMerger objects. -func vdbeIncrPopulateThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:95800:13: */ +func vdbeIncrPopulateThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:96647:13: */ var pIncr uintptr = pCtx var pRet uintptr = uintptr(int64(vdbeIncrPopulate(tls, pIncr))) (*SortSubtask)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer(pIncr)).FpTask)).FbDone = 1 @@ -74576,7 +75124,7 @@ func vdbeIncrPopulateThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c: } // Launch a background thread to populate aFile[1] of pIncr. -func vdbeIncrBgPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95810:12: */ +func vdbeIncrBgPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:96657:12: */ var p uintptr = pIncr return vdbeSorterCreateThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask, *(*uintptr)(unsafe.Pointer(&struct { @@ -74599,7 +75147,7 @@ func vdbeIncrBgPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95810 // to populate the new aFile[1]. // // SQLITE_OK is returned on success, or an SQLite error code otherwise. -func vdbeIncrSwap(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95834:12: */ +func vdbeIncrSwap(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:96681:12: */ var rc int32 = SQLITE_OK if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 { @@ -74633,7 +75181,7 @@ func vdbeIncrSwap(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95834:12: * // // If an OOM condition is encountered, return NULL. In this case free the // pMerger argument before returning. -func vdbeIncrMergerNew(tls *libc.TLS, pTask uintptr, pMerger uintptr, ppOut uintptr) int32 { /* sqlite3.c:95873:12: */ +func vdbeIncrMergerNew(tls *libc.TLS, pTask uintptr, pMerger uintptr, ppOut uintptr) int32 { /* sqlite3.c:96720:12: */ var rc int32 = SQLITE_OK var pIncr uintptr = libc.AssignPtrUintptr(ppOut, func() uintptr { if Xsqlite3FaultSim(tls, 100) != 0 { @@ -74659,7 +75207,7 @@ func vdbeIncrMergerNew(tls *libc.TLS, pTask uintptr, pMerger uintptr, ppOut uint } // Set the "use-threads" flag on object pIncr. -func vdbeIncrMergerSetThreads(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:95897:13: */ +func vdbeIncrMergerSetThreads(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:96744:13: */ (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread = 1 *(*I64)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer(pIncr)).FpTask + 88 /* &.file2 */ + 8 /* &.iEof */)) -= (I64((*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz)) } @@ -74667,7 +75215,7 @@ func vdbeIncrMergerSetThreads(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:95897 // 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 *libc.TLS, pMerger uintptr, iOut int32) { /* sqlite3.c:95910:13: */ +func vdbeMergeEngineCompare(tls *libc.TLS, pMerger uintptr, iOut int32) { /* sqlite3.c:96757:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -74725,7 +75273,7 @@ func vdbeMergeEngineCompare(tls *libc.TLS, pMerger uintptr, iOut int32) { /* sql // to pMerger. // // SQLITE_OK is returned if successful, or an SQLite error code otherwise. -func vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode int32) int32 { /* sqlite3.c:95992:12: */ +func vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode int32) int32 { /* sqlite3.c:96839:12: */ var rc int32 = SQLITE_OK // Return code var i int32 // For looping over PmaReader objects var nTree int32 // Number of subtrees to merge @@ -74795,7 +75343,7 @@ func vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode in // 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 *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:96068:12: */ +func vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:96915:12: */ var rc int32 = SQLITE_OK var pIncr uintptr = (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr var pTask uintptr = (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask @@ -74852,7 +75400,7 @@ func vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) int3 // The main routine for vdbePmaReaderIncrMergeInit() operations run in // background threads. -func vdbePmaReaderBgIncrInit(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:96135:13: */ +func vdbePmaReaderBgIncrInit(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:96982:13: */ var pReader uintptr = pCtx var pRet uintptr = uintptr(int64(vdbePmaReaderIncrMergeInit(tls, pReader, INCRINIT_TASK))) (*SortSubtask)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer((*PmaReader)(unsafe.Pointer(pReader)).FpIncr)).FpTask)).FbDone = 1 @@ -74868,7 +75416,7 @@ func vdbePmaReaderBgIncrInit(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c // 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 *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:96156:12: */ +func vdbePmaReaderIncrInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:97003:12: */ var pIncr uintptr = (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr // Incremental merger var rc int32 = SQLITE_OK // Return code if pIncr != 0 { @@ -74895,7 +75443,7 @@ func vdbePmaReaderIncrInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 { / // 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 *libc.TLS, pTask uintptr, nPMA int32, piOffset uintptr, ppOut uintptr) int32 { /* sqlite3.c:96186:12: */ +func vdbeMergeEngineLevel0(tls *libc.TLS, pTask uintptr, nPMA int32, piOffset uintptr, ppOut uintptr) int32 { /* sqlite3.c:97033:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -74932,11 +75480,11 @@ func vdbeMergeEngineLevel0(tls *libc.TLS, pTask uintptr, nPMA int32, piOffset ui // nPMA<=16 -> TreeDepth() == 0 // nPMA<=256 -> TreeDepth() == 1 // nPMA<=65536 -> TreeDepth() == 2 -func vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) int32 { /* sqlite3.c:96225:12: */ +func vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) int32 { /* sqlite3.c:97072:12: */ var nDepth int32 = 0 - var nDiv I64 = SORTER_MAX_MERGE_COUNT + var nDiv I64 = int64(SORTER_MAX_MERGE_COUNT) for nDiv < I64(nPMA) { - nDiv = (nDiv * SORTER_MAX_MERGE_COUNT) + nDiv = (nDiv * int64(SORTER_MAX_MERGE_COUNT)) nDepth++ } return nDepth @@ -74948,7 +75496,7 @@ func vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) int32 { /* sqlite3.c:96225:1 // // If successful, SQLITE_OK is returned. If an error occurs, an SQLite error // code is returned and pLeaf is freed. -func vdbeSorterAddToTree(tls *libc.TLS, pTask uintptr, nDepth int32, iSeq int32, pRoot uintptr, pLeaf uintptr) int32 { /* sqlite3.c:96243:12: */ +func vdbeSorterAddToTree(tls *libc.TLS, pTask uintptr, nDepth int32, iSeq int32, pRoot uintptr, pLeaf uintptr) int32 { /* sqlite3.c:97090:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -74999,7 +75547,7 @@ func vdbeSorterAddToTree(tls *libc.TLS, pTask uintptr, nDepth int32, iSeq int32, // 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 *libc.TLS, pSorter uintptr, ppOut uintptr) int32 { /* sqlite3.c:96299:12: */ +func vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) int32 { /* sqlite3.c:97146:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -75080,7 +75628,7 @@ func vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) int // all records stored in the sorter. // // SQLITE_OK is returned if successful, or an SQLite error code otherwise. -func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:96378:12: */ +func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:97225:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -75155,7 +75703,7 @@ func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:9 // 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 Xsqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) int32 { /* sqlite3.c:96460:20: */ +func Xsqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) int32 { /* sqlite3.c:97307:20: */ var pSorter uintptr var rc int32 = SQLITE_OK // Return code @@ -75200,7 +75748,7 @@ func Xsqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) int32 // SQLITE_OK success // SQLITE_DONE end of data // otherwise some kind of error. -func Xsqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) int32 { /* sqlite3.c:96512:20: */ +func Xsqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) int32 { /* sqlite3.c:97359:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -75242,7 +75790,7 @@ func Xsqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) int32 { /* // Return a pointer to a buffer owned by the sorter that contains the // current key. -func vdbeSorterRowkey(tls *libc.TLS, pSorter uintptr, pnKey uintptr) uintptr { /* sqlite3.c:96550:13: */ +func vdbeSorterRowkey(tls *libc.TLS, pSorter uintptr, pnKey uintptr) uintptr { /* sqlite3.c:97397:13: */ var pKey uintptr if (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA != 0 { var pReader uintptr @@ -75261,7 +75809,7 @@ func vdbeSorterRowkey(tls *libc.TLS, pSorter uintptr, pnKey uintptr) uintptr { / } // Copy the current sorter key into the memory cell pOut. -func Xsqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) int32 { /* sqlite3.c:96577:20: */ +func Xsqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) int32 { /* sqlite3.c:97424:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -75296,7 +75844,7 @@ func Xsqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) int32 { // // This routine forms the core of the OP_SorterCompare opcode, which in // turn is used to verify uniqueness when constructing a UNIQUE INDEX. -func Xsqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCol int32, pRes uintptr) int32 { /* sqlite3.c:96610:20: */ +func Xsqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCol int32, pRes uintptr) int32 { /* sqlite3.c:97457:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -75381,8 +75929,6 @@ type MemJournal1 = struct { FpMethod uintptr FnChunkSize int32 FnSpill int32 - FnSize int32 - _ [4]byte FpFirst uintptr Fendpoint FilePoint Freadpoint FilePoint @@ -75390,7 +75936,7 @@ type MemJournal1 = struct { _ [4]byte FpVfs uintptr FzJournal uintptr -} /* sqlite3.c:97103:9 */ +} /* sqlite3.c:97950:9 */ //************* End of vdbesort.c ******************************************* //************* Begin file vdbevtab.c *************************************** @@ -75437,23 +75983,23 @@ type MemJournal1 = struct { // #include "sqliteInt.h" // Forward references to internal structures -type MemJournal = MemJournal1 /* sqlite3.c:97103:27 */ +type MemJournal = MemJournal1 /* sqlite3.c:97950:27 */ type FilePoint1 = struct { FiOffset Sqlite3_int64 FpChunk uintptr -} /* sqlite3.c:97103:9 */ +} /* sqlite3.c:97950:9 */ -type FilePoint = FilePoint1 /* sqlite3.c:97104:26 */ +type FilePoint = FilePoint1 /* sqlite3.c:97951:26 */ type FileChunk1 = struct { FpNext uintptr FzChunk [8]U8 -} /* sqlite3.c:97103:9 */ +} /* sqlite3.c:97950:9 */ -type FileChunk = FileChunk1 /* sqlite3.c:97105:26 */ +type FileChunk = FileChunk1 /* sqlite3.c:97952:26 */ // Read data from the in-memory journal file. This is the implementation // of the sqlite3_vfs.xRead method. -func memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:97161:12: */ +func memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:98007:12: */ var p uintptr = pJfd var zOut uintptr = zBuf var nRead int32 = iAmt @@ -75500,34 +76046,30 @@ func memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sq } // Free the list of FileChunk structures headed at MemJournal.pFirst. -func memjrnlFreeChunks(tls *libc.TLS, p uintptr) { /* sqlite3.c:97208:13: */ +func memjrnlFreeChunks(tls *libc.TLS, pFirst uintptr) { /* sqlite3.c:98054:13: */ var pIter uintptr var pNext uintptr - for pIter = (*MemJournal)(unsafe.Pointer(p)).FpFirst; pIter != 0; pIter = pNext { + for pIter = pFirst; pIter != 0; pIter = pNext { pNext = (*FileChunk)(unsafe.Pointer(pIter)).FpNext Xsqlite3_free(tls, pIter) } - (*MemJournal)(unsafe.Pointer(p)).FpFirst = uintptr(0) } // Flush the contents of memory to a real file on disk. -func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:97221:12: */ - bp := tls.Alloc(88) - defer tls.Free(88) - +func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98066:12: */ var rc int32 var pReal uintptr = p - *(*MemJournal)(unsafe.Pointer(bp /* copy */)) = *(*MemJournal)(unsafe.Pointer(p)) + var copy = *(*MemJournal)(unsafe.Pointer(p)) libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(MemJournal{}))) - rc = Xsqlite3OsOpen(tls, (*MemJournal)(unsafe.Pointer(bp /* © */)).FpVfs, (*MemJournal)(unsafe.Pointer(bp /* © */)).FzJournal, pReal, (*MemJournal)(unsafe.Pointer(bp /* © */)).Fflags, uintptr(0)) + rc = Xsqlite3OsOpen(tls, copy.FpVfs, copy.FzJournal, pReal, copy.Fflags, uintptr(0)) if rc == SQLITE_OK { - var nChunk int32 = (*MemJournal)(unsafe.Pointer(bp /* © */)).FnChunkSize + var nChunk int32 = copy.FnChunkSize var iOff I64 = int64(0) var pIter uintptr - for pIter = (*MemJournal)(unsafe.Pointer(bp /* © */)).FpFirst; pIter != 0; pIter = (*FileChunk)(unsafe.Pointer(pIter)).FpNext { - if (iOff + I64(nChunk)) > (*MemJournal)(unsafe.Pointer(bp /* © */)).Fendpoint.FiOffset { - nChunk = (int32((*MemJournal)(unsafe.Pointer(bp /* © */)).Fendpoint.FiOffset - iOff)) + for pIter = copy.FpFirst; pIter != 0; pIter = (*FileChunk)(unsafe.Pointer(pIter)).FpNext { + if (iOff + I64(nChunk)) > copy.Fendpoint.FiOffset { + nChunk = (int32(copy.Fendpoint.FiOffset - iOff)) } rc = Xsqlite3OsWrite(tls, pReal, pIter+8 /* &.zChunk */, nChunk, iOff) if rc != 0 { @@ -75537,7 +76079,7 @@ func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:97221:12: } if rc == SQLITE_OK { // No error has occurred. Free the in-memory buffers. - memjrnlFreeChunks(tls, bp /* © */) + memjrnlFreeChunks(tls, copy.FpFirst) } } if rc != SQLITE_OK { @@ -75546,13 +76088,13 @@ func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:97221:12: // journal data to roll back changes made to the internal page-cache // before this function was called. Xsqlite3OsClose(tls, pReal) - *(*MemJournal)(unsafe.Pointer(p)) = *(*MemJournal)(unsafe.Pointer(bp /* copy */)) + *(*MemJournal)(unsafe.Pointer(p)) = copy } return rc } // Write data to the file. -func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:97260:12: */ +func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:98105:12: */ var p uintptr = pJfd var nWrite int32 = iAmt var zWrite uintptr = zBuf @@ -75603,9 +76145,8 @@ func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst S libc.Xmemcpy(tls, ((*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk + 8 /* &.zChunk */ + uintptr(iChunkOffset)), zWrite, uint64(iSpace)) zWrite += uintptr(iSpace) nWrite = nWrite - (iSpace) - *(*Sqlite3_int64)(unsafe.Pointer(p + 32 /* &.endpoint */ /* &.iOffset */)) += (Sqlite3_int64(iSpace)) + *(*Sqlite3_int64)(unsafe.Pointer(p + 24 /* &.endpoint */ /* &.iOffset */)) += (Sqlite3_int64(iSpace)) } - (*MemJournal)(unsafe.Pointer(p)).FnSize = (int32(Sqlite_int64(iAmt) + iOfst)) } } @@ -75613,28 +76154,36 @@ func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst S return SQLITE_OK } -// 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 *libc.TLS, pJfd uintptr, size Sqlite_int64) int32 { /* sqlite3.c:97339:12: */ +// Truncate the in-memory file. +func memjrnlTruncate(tls *libc.TLS, pJfd uintptr, size Sqlite_int64) int32 { /* sqlite3.c:98179:12: */ var p uintptr = pJfd + var pIter uintptr = uintptr(0) + if size == int64(0) { - memjrnlFreeChunks(tls, p) - (*MemJournal)(unsafe.Pointer(p)).FnSize = 0 - (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk = uintptr(0) - (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset = int64(0) - (*MemJournal)(unsafe.Pointer(p)).Freadpoint.FpChunk = uintptr(0) - (*MemJournal)(unsafe.Pointer(p)).Freadpoint.FiOffset = int64(0) + memjrnlFreeChunks(tls, (*MemJournal)(unsafe.Pointer(p)).FpFirst) + (*MemJournal)(unsafe.Pointer(p)).FpFirst = uintptr(0) + } else { + var iOff I64 = I64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize) + for pIter = (*MemJournal)(unsafe.Pointer(p)).FpFirst; (pIter != 0) && (iOff <= size); pIter = (*FileChunk)(unsafe.Pointer(pIter)).FpNext { + iOff = iOff + (I64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize)) + } + if pIter != 0 { + memjrnlFreeChunks(tls, (*FileChunk)(unsafe.Pointer(pIter)).FpNext) + (*FileChunk)(unsafe.Pointer(pIter)).FpNext = uintptr(0) + } } + + (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk = pIter + (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset = size + (*MemJournal)(unsafe.Pointer(p)).Freadpoint.FpChunk = uintptr(0) + (*MemJournal)(unsafe.Pointer(p)).Freadpoint.FiOffset = int64(0) return SQLITE_OK } // Close the file. -func memjrnlClose(tls *libc.TLS, pJfd uintptr) int32 { /* sqlite3.c:97355:12: */ +func memjrnlClose(tls *libc.TLS, pJfd uintptr) int32 { /* sqlite3.c:98207:12: */ var p uintptr = pJfd - memjrnlFreeChunks(tls, p) + memjrnlFreeChunks(tls, (*MemJournal)(unsafe.Pointer(p)).FpFirst) return SQLITE_OK } @@ -75642,14 +76191,14 @@ func memjrnlClose(tls *libc.TLS, pJfd uintptr) int32 { /* sqlite3.c:97355:12: */ // // If the real file has been created, call its xSync method. Otherwise, // syncing an in-memory journal is a no-op. -func memjrnlSync(tls *libc.TLS, pJfd uintptr, flags int32) int32 { /* sqlite3.c:97367:12: */ +func memjrnlSync(tls *libc.TLS, pJfd uintptr, flags int32) int32 { /* sqlite3.c:98219:12: */ _ = pJfd _ = flags return SQLITE_OK } // Query the size of the file in bytes. -func memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) int32 { /* sqlite3.c:97375:12: */ +func memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) int32 { /* sqlite3.c:98227:12: */ var p uintptr = pJfd *(*Sqlite_int64)(unsafe.Pointer(pSize)) = (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset return SQLITE_OK @@ -75664,7 +76213,7 @@ var sMemJournalMethods = sqlite3_io_methods{ FxTruncate: 0, // xTruncate FxSync: 0, // xSync FxFileSize: 0, // xUnfetch -} /* sqlite3.c:97384:40 */ +} /* sqlite3.c:98236:40 */ // Open a journal file. // @@ -75676,7 +76225,7 @@ var sMemJournalMethods = sqlite3_io_methods{ // 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 Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintptr, flags int32, nSpill int32) int32 { /* sqlite3.c:97418:20: */ +func Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintptr, flags int32, nSpill int32) int32 { /* sqlite3.c:98270:20: */ var p uintptr = pJfd // Zero the file-handle object. If nSpill was passed zero, initialize @@ -75704,20 +76253,20 @@ func Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintpt } // Open an in-memory journal file. -func Xsqlite3MemJournalOpen(tls *libc.TLS, pJfd uintptr) { /* sqlite3.c:97454:21: */ +func Xsqlite3MemJournalOpen(tls *libc.TLS, pJfd uintptr) { /* sqlite3.c:98306:21: */ Xsqlite3JournalOpen(tls, uintptr(0), uintptr(0), pJfd, 0, -1) } // 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 Xsqlite3JournalIsInMemory(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:97493:20: */ +func Xsqlite3JournalIsInMemory(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98345:20: */ return (libc.Bool32((*Sqlite3_file)(unsafe.Pointer(p)).FpMethods == uintptr(unsafe.Pointer(&sMemJournalMethods)))) } // Return the number of bytes required to store a JournalFile that uses vfs // pVfs to create the underlying on-disk files. -func Xsqlite3JournalSize(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:97501:20: */ +func Xsqlite3JournalSize(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:98353:20: */ return func() int32 { if ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile) > (int32(unsafe.Sizeof(MemJournal{}))) { return (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile @@ -75746,7 +76295,7 @@ func Xsqlite3JournalSize(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:97501 // Walk all expressions linked into the list of Window objects passed // as the second argument. -func walkWindowList(tls *libc.TLS, pWalker uintptr, pList uintptr) int32 { /* sqlite3.c:97531:12: */ +func walkWindowList(tls *libc.TLS, pWalker uintptr, pList uintptr, bOneOnly int32) int32 { /* sqlite3.c:98383:12: */ var pWin uintptr for pWin = pList; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { var rc int32 @@ -75775,6 +76324,9 @@ func walkWindowList(tls *libc.TLS, pWalker uintptr, pList uintptr) int32 { /* sq if rc != 0 { return WRC_Abort } + if bOneOnly != 0 { + break + } } return WRC_Continue } @@ -75796,7 +76348,7 @@ func walkWindowList(tls *libc.TLS, pWalker uintptr, pList uintptr) int32 { /* sq // // The return value from this routine is WRC_Abort to abandon the tree walk // and WRC_Continue to continue. -func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:97574:28: */ +func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:98427:28: */ var rc int32 for 1 != 0 { @@ -75813,7 +76365,7 @@ func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3. pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpRight continue - } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { if Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0 { return WRC_Abort @@ -75824,8 +76376,8 @@ func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3. return WRC_Abort } } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { - if walkWindowList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */))) != 0 { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { + if walkWindowList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)), 1) != 0 { return WRC_Abort } } @@ -75836,7 +76388,7 @@ func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3. return WRC_Continue } -func Xsqlite3WalkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:97606:20: */ +func Xsqlite3WalkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:98459:20: */ if pExpr != 0 { return walkExpr(tls, pWalker, pExpr) } @@ -75845,7 +76397,7 @@ func Xsqlite3WalkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* // Call sqlite3WalkExpr() for every expression in list p or until // an abort request is seen. -func Xsqlite3WalkExprList(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97614:20: */ +func Xsqlite3WalkExprList(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:98467:20: */ var i int32 var pItem uintptr if p != 0 { @@ -75876,7 +76428,7 @@ func Xsqlite3WalkExprList(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* // 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 Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97631:20: */ +func Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:98484:20: */ if Xsqlite3WalkExprList(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpEList) != 0 { return WRC_Abort } @@ -75900,7 +76452,7 @@ func Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { / if (pParse != 0) && (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { // The following may return WRC_Abort if there are unresolvable // symbols (e.g. a table that does not exist) in a window definition. - var rc int32 = walkWindowList(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpWinDefn) + var rc int32 = walkWindowList(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpWinDefn, 0) return rc } @@ -75913,7 +76465,7 @@ func Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { / // 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 Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97659:20: */ +func Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:98512:20: */ var pSrc uintptr var i int32 var pItem uintptr @@ -75927,7 +76479,7 @@ func Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { / goto __3 } { - if ((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (Xsqlite3WalkSelect(tls, pWalker, (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect) != 0) { + if ((*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0) && (Xsqlite3WalkSelect(tls, pWalker, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect) != 0) { return WRC_Abort } if ((uint32(int32(*(*uint8)(unsafe.Pointer((pItem + 60 /* &.fg */) + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0) && @@ -75962,7 +76514,7 @@ func Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { / // // If the Walker does not have an xSelectCallback() then this routine // is a no-op returning WRC_Continue. -func Xsqlite3WalkSelect(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97697:20: */ +func Xsqlite3WalkSelect(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:98550:20: */ var rc int32 if p == uintptr(0) { return WRC_Continue @@ -75989,13 +76541,13 @@ func Xsqlite3WalkSelect(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sq // Increase the walkerDepth when entering a subquery, and // descrease when leaving the subquery. -func Xsqlite3WalkerDepthIncrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:97720:20: */ +func Xsqlite3WalkerDepthIncrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:98573:20: */ _ = pSelect (*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth++ return WRC_Continue } -func Xsqlite3WalkerDepthDecrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:97725:21: */ +func Xsqlite3WalkerDepthDecrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:98578:21: */ _ = pSelect (*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth-- } @@ -76007,7 +76559,7 @@ func Xsqlite3WalkerDepthDecrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr // 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 Xsqlite3ExprWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:97740:20: */ +func Xsqlite3ExprWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:98593:20: */ _ = NotUsed _ = NotUsed2 return WRC_Continue @@ -76015,7 +76567,7 @@ func Xsqlite3ExprWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int3 // No-op routine for the parse-tree walker for SELECT statements. // subquery in the parser tree. -func Xsqlite3SelectWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:97749:20: */ +func Xsqlite3SelectWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:98602:20: */ _ = NotUsed _ = NotUsed2 return WRC_Continue @@ -76050,14 +76602,14 @@ func Xsqlite3SelectWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) in // is a helper function - a callback for the tree walker. // // See also the sqlite3WindowExtraAggFuncDepth() routine in window.c -func incrAggDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:97790:12: */ +func incrAggDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:98643:12: */ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_FUNCTION { *(*U8)(unsafe.Pointer(pExpr + 2 /* &.op2 */)) += U8((*(*int32)(unsafe.Pointer(pWalker + 40 /* &.u */)))) } return WRC_Continue } -func incrAggFunctionDepth(tls *libc.TLS, pExpr uintptr, N int32) { /* sqlite3.c:97794:13: */ +func incrAggFunctionDepth(tls *libc.TLS, pExpr uintptr, N int32) { /* sqlite3.c:98647:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -76090,7 +76642,7 @@ func incrAggFunctionDepth(tls *libc.TLS, pExpr uintptr, N int32) { /* sqlite3.c: // 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 *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pExpr uintptr, zType uintptr, nSubquery int32) { /* sqlite3.c:97823:13: */ +func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pExpr uintptr, nSubquery int32) { /* sqlite3.c:98676:13: */ var pOrig uintptr // The iCol-th column of the result set var pDup uintptr // Copy of pOrig var db uintptr // The database connection @@ -76100,9 +76652,7 @@ func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pEx db = (*Parse)(unsafe.Pointer(pParse)).Fdb pDup = Xsqlite3ExprDup(tls, db, pOrig, 0) if pDup != uintptr(0) { - if int32(*(*int8)(unsafe.Pointer(zType))) != 'G' { - incrAggFunctionDepth(tls, pDup, nSubquery) - } + incrAggFunctionDepth(tls, pDup, nSubquery) if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLLATE { pDup = Xsqlite3ExprAddCollateString(tls, pParse, pDup, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))) } @@ -76113,15 +76663,15 @@ func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pEx // The pExpr->u.zToken might point into memory that will be freed by the // sqlite3DbFree(db, pDup) on the last line of this block, so be sure to // make a copy of the token before doing the sqlite3DbFree(). - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Static) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Static)) Xsqlite3ExprDelete(tls, db, pExpr) libc.Xmemcpy(tls, pExpr, pDup, uint64(unsafe.Sizeof(Expr{}))) - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_IntValue)) != U32(0)) && (*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) != uintptr(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) != uintptr(0)) { *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_MemToken) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_MemToken)) } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { if *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) != uintptr(0) { (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpOwner = pExpr } else { @@ -76130,14 +76680,13 @@ func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pEx } Xsqlite3DbFree(tls, db, pDup) } - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Alias) } // 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 *libc.TLS, pUsing uintptr, zCol uintptr) int32 { /* sqlite3.c:97880:12: */ +func nameInUsingClause(tls *libc.TLS, pUsing uintptr, zCol uintptr) int32 { /* sqlite3.c:98731:12: */ if pUsing != 0 { var k int32 for k = 0; k < (*IdList)(unsafe.Pointer(pUsing)).FnId; k++ { @@ -76154,7 +76703,7 @@ func nameInUsingClause(tls *libc.TLS, pUsing uintptr, zCol uintptr) int32 { /* s // 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 Xsqlite3MatchEName(tls *libc.TLS, pItem uintptr, zCol uintptr, zTab uintptr, zDb uintptr) int32 { /* sqlite3.c:97897:20: */ +func Xsqlite3MatchEName(tls *libc.TLS, pItem uintptr, zCol uintptr, zTab uintptr, zDb uintptr) int32 { /* sqlite3.c:98748:20: */ var n int32 var zSpan uintptr if (int32(*(*uint8)(unsafe.Pointer(pItem + 20 /* &.eEName */)) & 0x3 >> 0)) != ENAME_TAB { @@ -76180,33 +76729,33 @@ func Xsqlite3MatchEName(tls *libc.TLS, pItem uintptr, zCol uintptr, zTab uintptr } // Return TRUE if the double-quoted string mis-feature should be supported. -func areDoubleQuotedStringsEnabled(tls *libc.TLS, db uintptr, pTopNC uintptr) int32 { /* sqlite3.c:97926:12: */ +func areDoubleQuotedStringsEnabled(tls *libc.TLS, db uintptr, pTopNC uintptr) int32 { /* sqlite3.c:98777:12: */ if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 { return 1 } // Always support for legacy schemas if ((*NameContext)(unsafe.Pointer(pTopNC)).FncFlags & NC_IsDDL) != 0 { // Currently parsing a DDL statement - if (Xsqlite3WritableSchema(tls, db) != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DqsDML) != uint64(0)) { + if (Xsqlite3WritableSchema(tls, db) != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDML)) != uint64(0)) { return 1 } - return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DqsDDL) != uint64(0))) + return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDDL)) != uint64(0))) } else { // Currently parsing a DML statement - return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DqsDML) != uint64(0))) + return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDML)) != uint64(0))) } return int32(0) } // The argument is guaranteed to be a non-NULL Expr node of type TK_COLUMN. // return the appropriate colUsed mask. -func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:97944:24: */ +func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:98795:24: */ var n int32 var pExTab uintptr n = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) pExTab = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) - if (((*Table)(unsafe.Pointer(pExTab)).FtabFlags & TF_HasGenerated) != U32(0)) && + if (((*Table)(unsafe.Pointer(pExTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pExTab)).FaCol+uintptr(n)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { if int32((*Table)(unsafe.Pointer(pExTab)).FnCol) >= (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) { @@ -76248,7 +76797,7 @@ func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:97 // // 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 *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol uintptr, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:97992:12: */ +func lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol uintptr, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:98843:12: */ bp := tls.Alloc(96) defer tls.Free(96) @@ -76330,7 +76879,7 @@ __5: goto __6 __6: ; - if !((i == (*Sqlite3)(unsafe.Pointer(db)).FnDb) && (Xsqlite3StrICmp(tls, ts+5282 /* "main" */, zDb) == 0)) { + if !((i == (*Sqlite3)(unsafe.Pointer(db)).FnDb) && (Xsqlite3StrICmp(tls, ts+5327 /* "main" */, zDb) == 0)) { goto __8 } // This branch is taken when the main database has been renamed @@ -76358,13 +76907,13 @@ __13: if !(i < (*SrcList)(unsafe.Pointer(pSrcList)).FnSrc) { goto __15 } - pTab = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab + pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab - if !(((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & SF_NestedFrom) != U32(0))) { + if !(((*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & U32(SF_NestedFrom)) != U32(0))) { goto __16 } hit = 0 - pEList = (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FpEList + pEList = (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpEList j = 0 __17: if !(j < (*ExprList)(unsafe.Pointer(pEList)).FnExpr) { @@ -76404,8 +76953,8 @@ __22: if !(zTab != 0) { goto __23 } - if (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias != 0 { - zTabName = (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias + if (*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 { + zTabName = (*SrcItem)(unsafe.Pointer(pItem)).FzAlias } else { zTabName = (*Table)(unsafe.Pointer(pTab)).FzName } @@ -76416,7 +76965,7 @@ __22: goto __14 __24: ; - if !((int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*SrcList_item)(unsafe.Pointer(pItem)).FzAlias != 0)) { + if !((int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0)) { goto __25 } Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (pExpr + 64 /* &.y */ /* &.pTab */)) @@ -76446,13 +76995,13 @@ __27: if !(cnt == 1) { goto __31 } - if !((int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_NATURAL) != 0) { + if !((int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_NATURAL) != 0) { goto __32 } goto __28 __32: ; - if !(nameInUsingClause(tls, (*SrcList_item)(unsafe.Pointer(pItem)).FpUsing, zCol) != 0) { + if !(nameInUsingClause(tls, (*SrcItem)(unsafe.Pointer(pItem)).FpUsing, zCol) != 0) { goto __33 } goto __28 @@ -76491,14 +77040,14 @@ __15: if !(pMatch != 0) { goto __34 } - (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcList_item)(unsafe.Pointer(pMatch)).FiCursor - *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = (*SrcList_item)(unsafe.Pointer(pMatch)).FpTab + (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcItem)(unsafe.Pointer(pMatch)).FiCursor + *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = (*SrcItem)(unsafe.Pointer(pMatch)).FpTab // RIGHT JOIN not (yet) supported - if !((int32((*SrcList_item)(unsafe.Pointer(pMatch)).Ffg.Fjointype) & JT_LEFT) != 0) { + if !((int32((*SrcItem)(unsafe.Pointer(pMatch)).Ffg.Fjointype) & JT_LEFT) != 0) { goto __35 } - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_CanBeNull) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_CanBeNull)) __35: ; pSchema = (*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpSchema @@ -76509,8 +77058,9 @@ __12: // If we have not already resolved the name, then maybe // it is a new.* or old.* trigger argument reference. Or - // maybe it is an excluded.* from an upsert. - if !(((zDb == uintptr(0)) && (zTab != uintptr(0))) && (cntTab == 0)) { + // maybe it is an excluded.* from an upsert. Or maybe it is + // a reference in the RETURNING clause to a table being modified. + if !((cnt == 0) && (zDb == uintptr(0))) { goto __36 } pTab = uintptr(0) @@ -76519,139 +77069,157 @@ __12: } op = int32((*Parse)(unsafe.Pointer(pParse)).FeTriggerOp) - if !((op != TK_DELETE) && (Xsqlite3StrICmp(tls, ts+5287 /* "new" */, zTab) == 0)) { + if !(((op != TK_DELETE) && (zTab != 0)) && (Xsqlite3StrICmp(tls, ts+5332 /* "new" */, zTab) == 0)) { goto __38 } (*Expr)(unsafe.Pointer(pExpr)).FiTable = 1 pTab = (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab goto __39 __38: - if !((op != TK_INSERT) && (Xsqlite3StrICmp(tls, ts+5291 /* "old" */, zTab) == 0)) { + if !(((op != TK_INSERT) && (zTab != 0)) && (Xsqlite3StrICmp(tls, ts+5336 /* "old" */, zTab) == 0)) { goto __40 } (*Expr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab + goto __41 __40: + if !(((*Parse)(unsafe.Pointer(pParse)).FbReturning != 0) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_UBaseReg) != 0)) { + goto __42 + } + (*Expr)(unsafe.Pointer(pExpr)).FiTable = (libc.Bool32(op != TK_DELETE)) + pTab = (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab +__42: + ; +__41: ; __39: ; __37: ; - if !(((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_UUpsert) != 0) { - goto __41 + if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_UUpsert) != 0) && (zTab != uintptr(0))) { + goto __43 } pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16 /* &.uNC */)) - if !((pUpsert != 0) && (Xsqlite3StrICmp(tls, ts+5295 /* "excluded" */, zTab) == 0)) { - goto __42 + if !((pUpsert != 0) && (Xsqlite3StrICmp(tls, ts+5340 /* "excluded" */, zTab) == 0)) { + goto __44 } - pTab = (*SrcList_item)(unsafe.Pointer(((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8 /* &.a */))).FpTab + pTab = (*SrcItem)(unsafe.Pointer(((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8 /* &.a */))).FpTab (*Expr)(unsafe.Pointer(pExpr)).FiTable = EXCLUDED_TABLE_NUMBER -__42: +__44: ; -__41: +__43: ; if !(pTab != 0) { - goto __43 + goto __45 } hCol1 = Xsqlite3StrIHash(tls, zCol) pSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema cntTab++ iCol = 0 pCol = (*Table)(unsafe.Pointer(pTab)).FaCol -__44: +__46: if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __46 - } - if !((int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(hCol1)) && (Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzName, zCol) == 0)) { - goto __47 - } - if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) { goto __48 } + if !((int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(hCol1)) && (Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzName, zCol) == 0)) { + goto __49 + } + if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) { + goto __50 + } iCol = -1 -__48: +__50: ; - goto __46 + goto __48 +__49: + ; + goto __47 __47: - ; - goto __45 -__45: iCol++ pCol += 32 - goto __44 goto __46 -__46: + goto __48 +__48: ; - if !(((iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) && (Xsqlite3IsRowid(tls, zCol) != 0)) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_NoVisibleRowid) == U32(0))) { - goto __49 + if !(((iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) && (Xsqlite3IsRowid(tls, zCol) != 0)) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_NoVisibleRowid)) == U32(0))) { + goto __51 } // IMP: R-51414-32910 iCol = -1 -__49: +__51: ; if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __50 + goto __52 } cnt++ + pMatch = uintptr(0) if !((*Expr)(unsafe.Pointer(pExpr)).FiTable == EXCLUDED_TABLE_NUMBER) { - goto __51 + goto __53 } if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { - goto __53 + goto __55 } (*Expr)(unsafe.Pointer(pExpr)).FiColumn = YnVar(iCol) *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = pTab eNewExprOp = TK_COLUMN - goto __54 -__53: - (*Expr)(unsafe.Pointer(pExpr)).FiTable = ((*Upsert)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNC + 16 /* &.uNC */)))).FregData + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))) - eNewExprOp = TK_REGISTER - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Alias) -__54: - ; - goto __52 -__51: - - if !(iCol < 0) { - goto __55 - } - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER goto __56 __55: - if !((*Expr)(unsafe.Pointer(pExpr)).FiTable == 0) { - goto __57 - } - - *(*U32)(unsafe.Pointer(pParse + 200 /* &.oldmask */)) |= (func() uint32 { - if iCol >= 32 { - return 0xffffffff - } - return (U32((U32(1))) << iCol) - }()) - goto __58 -__57: - ; - - *(*U32)(unsafe.Pointer(pParse + 204 /* &.newmask */)) |= (func() uint32 { - if iCol >= 32 { - return 0xffffffff - } - return (U32((U32(1))) << iCol) - }()) -__58: - ; + (*Expr)(unsafe.Pointer(pExpr)).FiTable = ((*Upsert)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNC + 16 /* &.uNC */)))).FregData + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))) + eNewExprOp = TK_REGISTER __56: ; + goto __54 +__53: + *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = pTab + if !((*Parse)(unsafe.Pointer(pParse)).FbReturning != 0) { + goto __57 + } + eNewExprOp = TK_REGISTER + (*Expr)(unsafe.Pointer(pExpr)).FiTable = (((*(*int32)(unsafe.Pointer(pNC + 16 /* &.uNC */)) + ((int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1) * (*Expr)(unsafe.Pointer(pExpr)).FiTable)) + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))) + 1) + goto __58 +__57: (*Expr)(unsafe.Pointer(pExpr)).FiColumn = I16(iCol) eNewExprOp = TK_TRIGGER + if !(iCol < 0) { + goto __59 + } + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) + goto __60 +__59: + if !((*Expr)(unsafe.Pointer(pExpr)).FiTable == 0) { + goto __61 + } + + *(*U32)(unsafe.Pointer(pParse + 196 /* &.oldmask */)) |= (func() uint32 { + if iCol >= 32 { + return 0xffffffff + } + return (U32((U32(1))) << iCol) + }()) + goto __62 +__61: + ; + + *(*U32)(unsafe.Pointer(pParse + 200 /* &.newmask */)) |= (func() uint32 { + if iCol >= 32 { + return 0xffffffff + } + return (U32((U32(1))) << iCol) + }()) +__62: + ; +__60: + ; +__58: + ; +__54: + ; __52: ; -__50: - ; -__43: +__45: ; __36: ; @@ -76662,13 +77230,13 @@ __36: (pMatch != 0)) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_IdxExpr | NC_GenCol)) == 0)) && (Xsqlite3IsRowid(tls, zCol) != 0)) && - (((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer(pMatch)).FpTab))).FtabFlags & TF_NoVisibleRowid) == U32(0))) { - goto __59 + (((*Table)(unsafe.Pointer(((*SrcItem)(unsafe.Pointer(pMatch)).FpTab))).FtabFlags & U32(TF_NoVisibleRowid)) == U32(0))) { + goto __63 } cnt = 1 (*Expr)(unsafe.Pointer(pExpr)).FiColumn = int16(-1) - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER -__59: + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) +__63: ; // If the input is of the form Z (not Y.Z or X.Y.Z) then the name Z @@ -76690,74 +77258,74 @@ __59: if !(((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_UEList) != 0) && (cnt == 0)) && (zTab == uintptr(0))) { - goto __60 + goto __64 } pEList = *(*uintptr)(unsafe.Pointer(pNC + 16 /* &.uNC */)) j = 0 -__61: +__65: if !(j < (*ExprList)(unsafe.Pointer(pEList)).FnExpr) { - goto __63 + goto __67 } zAs = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(j)*32)).FzEName if !(((int32(*(*uint8)(unsafe.Pointer(((pEList + 8 /* &.a */) + uintptr(j)*32) + 20 /* &.eEName */)) & 0x3 >> 0)) == ENAME_NAME) && (Xsqlite3_stricmp(tls, zAs, zCol) == 0)) { - goto __64 + goto __68 } pOrig = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(j)*32)).FpExpr - if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0) && (((*Expr)(unsafe.Pointer((pOrig))).Fflags & (EP_Agg)) != U32(0))) { - goto __65 + if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0) && (((*Expr)(unsafe.Pointer((pOrig))).Fflags & (U32(EP_Agg))) != U32(0))) { + goto __69 } - Xsqlite3ErrorMsg(tls, pParse, ts+5304 /* "misuse of aliase..." */, libc.VaList(bp, zAs)) + Xsqlite3ErrorMsg(tls, pParse, ts+5349 /* "misuse of aliase..." */, libc.VaList(bp, zAs)) return WRC_Abort -__65: +__69: ; - if !((((*Expr)(unsafe.Pointer((pOrig))).Fflags & (EP_Win)) != U32(0)) && + if !((((*Expr)(unsafe.Pointer((pOrig))).Fflags & (U32(EP_Win))) != U32(0)) && ((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowWin) == 0) || (pNC != pTopNC))) { - goto __66 + goto __70 } - Xsqlite3ErrorMsg(tls, pParse, ts+5335 /* "misuse of aliase..." */, libc.VaList(bp+8, zAs)) + Xsqlite3ErrorMsg(tls, pParse, ts+5380 /* "misuse of aliase..." */, libc.VaList(bp+8, zAs)) return WRC_Abort -__66: +__70: ; if !(Xsqlite3ExprVectorSize(tls, pOrig) != 1) { - goto __67 + goto __71 } - Xsqlite3ErrorMsg(tls, pParse, ts+5372 /* "row value misuse..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+5417 /* "row value misuse..." */, 0) return WRC_Abort -__67: +__71: ; - resolveAlias(tls, pParse, pEList, j, pExpr, ts+703 /* "" */, nSubquery) + resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) cnt = 1 pMatch = uintptr(0) if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { - goto __68 + goto __72 } Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr) -__68: +__72: ; goto lookupname_end -__64: +__68: ; - goto __62 -__62: + goto __66 +__66: j++ - goto __61 - goto __63 -__63: + goto __65 + goto __67 +__67: ; -__60: +__64: ; // Advance to the next name context. The loop will exit when either // we have a match (cnt>0) or when we run out of name contexts. if !(cnt != 0) { - goto __69 + goto __73 } goto __11 -__69: +__73: ; pNC = (*NameContext)(unsafe.Pointer(pNC)).FpNext nSubquery++ @@ -76779,12 +77347,12 @@ __11: // Because no reference was made to outer contexts, the pNC->nRef // fields are not changed in any context. if !((cnt == 0) && (zTab == uintptr(0))) { - goto __70 + goto __74 } - if !((((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_DblQuoted)) != U32(0)) && + if !((((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_DblQuoted))) != U32(0)) && (areDoubleQuotedStringsEnabled(tls, db, pTopNC) != 0)) { - goto __71 + goto __75 } // If a double-quoted identifier does not match any known column name, // then treat it as a string. @@ -76800,51 +77368,51 @@ __11: // a huge amount of legacy SQL that uses it. So for now, we just // issue a warning. Xsqlite3_log(tls, SQLITE_WARNING, - ts+5390 /* "double-quoted st..." */, libc.VaList(bp+16, zCol)) - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_STRING + ts+5435 /* "double-quoted st..." */, libc.VaList(bp+16, zCol)) + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_STRING) *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = uintptr(0) return WRC_Prune -__71: +__75: ; if !(Xsqlite3ExprIdToTrueFalse(tls, pExpr) != 0) { - goto __72 + goto __76 } return WRC_Prune -__72: +__76: ; -__70: +__74: ; // cnt==0 means there was not match. cnt>1 means there were two or // more matches. Either way, we have an error. if !(cnt != 1) { - goto __73 + goto __77 } if cnt == 0 { - zErr = ts + 5425 /* "no such column" */ + zErr = ts + 5470 /* "no such column" */ } else { - zErr = ts + 5440 /* "ambiguous column..." */ + zErr = ts + 5485 /* "ambiguous column..." */ } if !(zDb != 0) { - goto __74 + goto __78 } - Xsqlite3ErrorMsg(tls, pParse, ts+5462 /* "%s: %s.%s.%s" */, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) - goto __75 -__74: + Xsqlite3ErrorMsg(tls, pParse, ts+5507 /* "%s: %s.%s.%s" */, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + goto __79 +__78: if !(zTab != 0) { - goto __76 + goto __80 } - Xsqlite3ErrorMsg(tls, pParse, ts+5475 /* "%s: %s.%s" */, libc.VaList(bp+56, zErr, zTab, zCol)) - goto __77 -__76: - Xsqlite3ErrorMsg(tls, pParse, ts+5485 /* "%s: %s" */, libc.VaList(bp+80, zErr, zCol)) -__77: + Xsqlite3ErrorMsg(tls, pParse, ts+5520 /* "%s: %s.%s" */, libc.VaList(bp+56, zErr, zTab, zCol)) + goto __81 +__80: + Xsqlite3ErrorMsg(tls, pParse, ts+5530 /* "%s: %s" */, libc.VaList(bp+80, zErr, zCol)) +__81: ; -__75: +__79: ; (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) (*NameContext)(unsafe.Pointer(pTopNC)).FnErr++ -__73: +__77: ; // If a column from a table in pSrcList is referenced, then record @@ -76861,73 +77429,79 @@ __73: // If a generated column is referenced, set bits for every column // of the table. if !((int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0) && (pMatch != uintptr(0))) { - goto __78 + goto __82 } *(*Bitmask)(unsafe.Pointer(pMatch + 88 /* &.colUsed */)) |= (Xsqlite3ExprColUsed(tls, pExpr)) -__78: +__82: ; // Clean up and return + if !(!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0))) { + goto __83 + } Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) (*Expr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpRight) (*Expr)(unsafe.Pointer(pExpr)).FpRight = uintptr(0) +__83: + ; (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(eNewExprOp) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Leaf) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Leaf)) lookupname_end: if !(cnt == 1) { - goto __79 + goto __84 } - if !(!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Alias)) != U32(0))) { - goto __81 + if !(((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FxAuth != 0) && + ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_TRIGGER))) { + goto __86 } Xsqlite3AuthRead(tls, pParse, pExpr, pSchema, (*NameContext)(unsafe.Pointer(pNC)).FpSrcList) -__81: +__86: ; // Increment the nRef value on all name contexts from TopNC up to // the point where the name matched. -__82: +__87: ; (*NameContext)(unsafe.Pointer(pTopNC)).FnRef++ if !(pTopNC == pNC) { - goto __85 + goto __90 } - goto __84 -__85: + goto __89 +__90: ; pTopNC = (*NameContext)(unsafe.Pointer(pTopNC)).FpNext - goto __83 -__83: - goto __82 - goto __84 -__84: + goto __88 +__88: + goto __87 + goto __89 +__89: ; return WRC_Prune - goto __80 -__79: + goto __85 +__84: return WRC_Abort -__80: +__85: ; return int32(0) } // Allocate and return a pointer to an expression to load the column iCol // from datasource iSrc in SrcList pSrc. -func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int32, iCol int32) uintptr { /* sqlite3.c:98406:21: */ +func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int32, iCol int32) uintptr { /* sqlite3.c:99273:21: */ var p uintptr = Xsqlite3ExprAlloc(tls, db, TK_COLUMN, uintptr(0), 0) if p != 0 { var pItem uintptr = ((pSrc + 8 /* &.a */) + uintptr(iSrc)*112) - var pTab uintptr = libc.AssignPtrUintptr(p+64 /* &.y */ /* &.pTab */, (*SrcList_item)(unsafe.Pointer(pItem)).FpTab) - (*Expr)(unsafe.Pointer(p)).FiTable = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor + var pTab uintptr = libc.AssignPtrUintptr(p+64 /* &.y */ /* &.pTab */, (*SrcItem)(unsafe.Pointer(pItem)).FpTab) + (*Expr)(unsafe.Pointer(p)).FiTable = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor if int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)))).FiPKey) == iCol { (*Expr)(unsafe.Pointer(p)).FiColumn = int16(-1) } else { (*Expr)(unsafe.Pointer(p)).FiColumn = YnVar(iCol) - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != U32(0)) && + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { - (*SrcList_item)(unsafe.Pointer(pItem)).FcolUsed = func() uint64 { + (*SrcItem)(unsafe.Pointer(pItem)).FcolUsed = func() uint64 { if int32((*Table)(unsafe.Pointer(pTab)).FnCol) >= 64 { return libc.Uint64(libc.Uint64FromInt32(-1)) } @@ -76961,28 +77535,28 @@ func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int3 // As an optimization, since the conditional is almost always false // (because errors are rare), the conditional is moved outside of the // function call using a macro. -func notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pExpr uintptr) { /* sqlite3.c:98448:13: */ +func notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pExpr uintptr) { /* sqlite3.c:99315:13: */ bp := tls.Alloc(16) defer tls.Free(16) - var zIn uintptr = ts + 5492 /* "partial index WH..." */ + var zIn uintptr = ts + 5537 /* "partial index WH..." */ if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_IdxExpr) != 0 { - zIn = ts + 5520 /* "index expression..." */ + zIn = ts + 5565 /* "index expression..." */ } else if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_IsCheck) != 0 { - zIn = ts + 5538 /* "CHECK constraint..." */ + zIn = ts + 5583 /* "CHECK constraint..." */ } else if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_GenCol) != 0 { - zIn = ts + 5556 /* "generated column..." */ + zIn = ts + 5601 /* "generated column..." */ } - Xsqlite3ErrorMsg(tls, pParse, ts+5574 /* "%s prohibited in..." */, libc.VaList(bp, zMsg, zIn)) + Xsqlite3ErrorMsg(tls, pParse, ts+5619 /* "%s prohibited in..." */, libc.VaList(bp, zMsg, zIn)) if pExpr != 0 { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } } // 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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:98474:12: */ +func exprProbability(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:99341:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -76990,7 +77564,7 @@ func exprProbability(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98474:12: */ if int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_FLOAT { return -1 } - Xsqlite3AtoF(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), bp /* &r */, Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))), SQLITE_UTF8) + Xsqlite3AtoF(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), bp /* &r */, Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))), uint8(SQLITE_UTF8)) if *(*float64)(unsafe.Pointer(bp /* r */)) > 1.0 { return -1 @@ -77007,9 +77581,9 @@ func exprProbability(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98474:12: */ // 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 *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:98494:12: */ - bp := tls.Alloc(96) - defer tls.Free(96) +func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99361:12: */ + bp := tls.Alloc(128) + defer tls.Free(128) var pNC uintptr var pParse uintptr @@ -77030,15 +77604,89 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s var pItem uintptr pItem = pSrcList + 8 /* &.a */ - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_COLUMN - *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab - (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN) + *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = (*SrcItem)(unsafe.Pointer(pItem)).FpTab + (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor (*Expr)(unsafe.Pointer(pExpr)).FiColumn-- - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) break } + // An optimization: Attempt to convert + // + // "expr IS NOT NULL" --> "TRUE" + // "expr IS NULL" --> "FALSE" + // + // if we can prove that "expr" is never NULL. Call this the + // "NOT NULL strength reduction optimization". + // + // If this optimization occurs, also restore the NameContext ref-counts + // to the state they where in before the "column" LHS expression was + // resolved. This prevents "column" from being counted as having been + // referenced, which might prevent a SELECT from being erroneously + // marked as correlated. + case TK_NOTNULL: + fallthrough + case TK_ISNULL: + { + // var anRef [8]int32 at bp+96, 32 + + var p uintptr + var i int32 + i = 0 + p = pNC + __1: + if !((p != 0) && (i < (int32(uint64(unsafe.Sizeof([8]int32{})) / uint64(unsafe.Sizeof(int32(0))))))) { + goto __3 + } + { + *(*int32)(unsafe.Pointer(bp + 96 /* &anRef[0] */ + uintptr(i)*4)) = (*NameContext)(unsafe.Pointer(p)).FnRef + + } + goto __2 + __2: + p = (*NameContext)(unsafe.Pointer(p)).FpNext + i++ + goto __1 + goto __3 + __3: + ; + Xsqlite3WalkExpr(tls, pWalker, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) + if (0 == Xsqlite3ExprCanBeNull(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { + if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL { + *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = ts + 5639 /* "true" */ + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_IsTrue)) + } else { + *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = ts + 5644 /* "false" */ + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_IsFalse)) + } + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUEFALSE) + i = 0 + p = pNC + __4: + if !((p != 0) && (i < (int32(uint64(unsafe.Sizeof([8]int32{})) / uint64(unsafe.Sizeof(int32(0))))))) { + goto __6 + } + { + (*NameContext)(unsafe.Pointer(p)).FnRef = *(*int32)(unsafe.Pointer(bp + 96 /* &anRef[0] */ + uintptr(i)*4)) + + } + goto __5 + __5: + p = (*NameContext)(unsafe.Pointer(p)).FpNext + i++ + goto __4 + goto __6 + __6: + ; + Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) + (*Expr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) + } + return WRC_Prune + + } + // A column name: ID // Or table name and column name: ID.ID // Or a database, table and column: ID.ID.ID @@ -77063,7 +77711,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (NC_IdxExpr | NC_GenCol)) != 0 { - notValidImpl(tls, pParse, pNC, ts+5594 /* "the \".\" operator" */, uintptr(0)) + notValidImpl(tls, pParse, pNC, ts+5650 /* "the \".\" operator" */, uintptr(0)) } pRight = (*Expr)(unsafe.Pointer(pExpr)).FpRight @@ -77105,7 +77753,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s var enc U8 = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fenc // The database encoding var savedAllowFlags int32 = ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_AllowAgg | NC_AllowWin)) var pWin uintptr = func() uintptr { - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) && (int32((*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FeFrmType) != TK_FILTER) { + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) && (int32((*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FeFrmType) != TK_FILTER) { return *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) } return uintptr(0) @@ -77123,14 +77771,14 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s } } else { is_agg = (libc.Bool32((*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0))) - if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_UNLIKELY) != 0 { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Unlikely) + if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_UNLIKELY)) != 0 { + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Unlikely)) if n == 2 { (*Expr)(unsafe.Pointer(pExpr)).FiTable = exprProbability(tls, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+1*32)).FpExpr) if (*Expr)(unsafe.Pointer(pExpr)).FiTable < 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+5611 /* "second argument ..." */, 0) + ts+5667 /* "second argument ..." */, 0) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } } else { @@ -77155,11 +77803,11 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s var auth int32 = Xsqlite3AuthCheck(tls, pParse, SQLITE_FUNCTION, uintptr(0), (*FuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == SQLITE_DENY { - Xsqlite3ErrorMsg(tls, pParse, ts+5682, /* "not authorized t..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+5738, /* "not authorized t..." */ libc.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) return WRC_Prune } @@ -77169,9 +77817,9 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s // functions and other functions that change slowly are considered // constant because they are constant for the duration of one query. // This allows them to be factored out of inner loops. - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_ConstFunc) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_ConstFunc)) } - if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_CONSTANT) == U32(0) { + if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_CONSTANT)) == U32(0) { // Clearly non-deterministic functions like random(), but also // date/time functions that use 'now', and other functions like // sqlite_version() that might change over time cannot be used @@ -77179,19 +77827,19 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s // in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all // all this. if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & ((NC_IdxExpr | NC_PartIdx) | NC_GenCol)) != 0 { - notValidImpl(tls, pParse, pNC, ts+5717 /* "non-deterministi..." */, uintptr(0)) + notValidImpl(tls, pParse, pNC, ts+5773 /* "non-deterministi..." */, uintptr(0)) } } else { // Must fit in 8 bits (*Expr)(unsafe.Pointer(pExpr)).Fop2 = (U8((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_SelfRef)) if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_FromDDL) != 0 { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FromDDL) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL)) } } - if ((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_INTERNAL) != U32(0)) && + if ((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_INTERNAL)) != U32(0)) && (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)) && - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & DBFLAG_InternalFunc) == U32(0)) { + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & U32(DBFLAG_InternalFunc)) == U32(0)) { // Internal-use-only functions are disallowed unless the // SQL is being compiled using sqlite3NestedParse() or // the SQLITE_TESTCTRL_INTERNAL_FUNCTIONS test-control has be @@ -77208,30 +77856,30 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s if ((pDef != 0) && ((*FuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0))) && (pWin != 0) { Xsqlite3ErrorMsg(tls, pParse, - ts+5745 /* "%.*s() may not b..." */, libc.VaList(bp+8, nId, zId)) + ts+5801 /* "%.*s() may not b..." */, libc.VaList(bp+8, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } else if (((is_agg != 0) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0)) || - (((is_agg != 0) && (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_WINDOW) != 0)) && !(pWin != 0))) || + (((is_agg != 0) && (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0)) && !(pWin != 0))) || (((is_agg != 0) && (pWin != 0)) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowWin) == 0)) { var zType uintptr - if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_WINDOW) != 0) || (pWin != 0) { - zType = ts + 5789 /* "window" */ + if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0) || (pWin != 0) { + zType = ts + 5845 /* "window" */ } else { - zType = ts + 5796 /* "aggregate" */ + zType = ts + 5852 /* "aggregate" */ } - Xsqlite3ErrorMsg(tls, pParse, ts+5806 /* "misuse of %s fun..." */, libc.VaList(bp+24, zType, nId, zId)) + Xsqlite3ErrorMsg(tls, pParse, ts+5862 /* "misuse of %s fun..." */, libc.VaList(bp+24, zType, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ is_agg = 0 } else if (no_such_func != 0) && (int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+5835 /* "no such function..." */, libc.VaList(bp+48, nId, zId)) + Xsqlite3ErrorMsg(tls, pParse, ts+5891 /* "no such function..." */, libc.VaList(bp+48, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } else if wrong_num_args != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+5858, /* "wrong number of ..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+5914, /* "wrong number of ..." */ libc.VaList(bp+64, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ - } else if (is_agg == 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + } else if (is_agg == 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { Xsqlite3ErrorMsg(tls, pParse, - ts+5903, /* "FILTER may not b..." */ + ts+5959, /* "FILTER may not b..." */ libc.VaList(bp+80, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } @@ -77246,7 +77894,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s return 0 }()))) } - } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { is_agg = 1 } Xsqlite3WalkExprList(tls, pWalker, pList) @@ -77261,6 +77909,9 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s } return uintptr(0) }(), pWin, pDef) + if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { + break + } } Xsqlite3WalkExprList(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpPartition) Xsqlite3WalkExprList(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpOrderBy) @@ -77269,9 +77920,9 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) |= (NC_HasWin) } else { var pNC2 uintptr = pNC - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_AGG_FUNCTION + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_AGG_FUNCTION) (*Expr)(unsafe.Pointer(pExpr)).Fop2 = U8(0) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { Xsqlite3WalkExpr(tls, pWalker, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter) } for (pNC2 != 0) && !(Xsqlite3FunctionUsesThisSrc(tls, pExpr, (*NameContext)(unsafe.Pointer(pNC2)).FpSrcList) != 0) { @@ -77281,7 +77932,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s if (pNC2 != 0) && (pDef != 0) { - *(*int32)(unsafe.Pointer(pNC2 + 40 /* &.ncFlags */)) |= int32((NC_HasAgg | ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_MINMAX))) + *(*int32)(unsafe.Pointer(pNC2 + 40 /* &.ncFlags */)) |= int32((U32(NC_HasAgg) | ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)))) } } @@ -77299,17 +77950,17 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s case TK_IN: { - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { var nRef int32 = (*NameContext)(unsafe.Pointer(pNC)).FnRef if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (((NC_IsCheck | NC_PartIdx) | NC_IdxExpr) | NC_GenCol)) != 0 { - notValidImpl(tls, pParse, pNC, ts+5952 /* "subqueries" */, pExpr) + notValidImpl(tls, pParse, pNC, ts+6008 /* "subqueries" */, pExpr) } Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) if nRef != (*NameContext)(unsafe.Pointer(pNC)).FnRef { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_VarSelect) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_VarSelect)) *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) |= (NC_VarSelect) } } @@ -77320,7 +77971,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s { if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (((NC_IsCheck | NC_PartIdx) | NC_IdxExpr) | NC_GenCol)) != 0 { - notValidImpl(tls, pParse, pNC, ts+5963 /* "parameters" */, pExpr) + notValidImpl(tls, pParse, pNC, ts+6019 /* "parameters" */, pExpr) } break @@ -77334,14 +77985,14 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s // Handle special cases of "x IS TRUE", "x IS FALSE", "x IS NOT TRUE", // and "x IS NOT FALSE". - if (pRight != 0) && (int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_ID) { + if (pRight != 0) && ((int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_ID) || (int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_TRUEFALSE)) { var rc int32 = resolveExprStep(tls, pWalker, pRight) if rc == WRC_Abort { return WRC_Abort } if int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_TRUEFALSE { (*Expr)(unsafe.Pointer(pExpr)).Fop2 = (*Expr)(unsafe.Pointer(pExpr)).Fop - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_TRUTH + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUTH) return WRC_Continue } } @@ -77380,7 +78031,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s } if nLeft != nRight { - Xsqlite3ErrorMsg(tls, pParse, ts+5372 /* "row value misuse..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+5417 /* "row value misuse..." */, 0) } break @@ -77402,7 +78053,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s // return 0. // // pEList has been resolved. pE has not. -func resolveAsName(tls *libc.TLS, pParse uintptr, pEList uintptr, pE uintptr) int32 { /* sqlite3.c:98894:12: */ +func resolveAsName(tls *libc.TLS, pParse uintptr, pEList uintptr, pE uintptr) int32 { /* sqlite3.c:99803:12: */ var i int32 // Loop counter _ = pParse @@ -77435,7 +78086,7 @@ func resolveAsName(tls *libc.TLS, pParse uintptr, pEList uintptr, pE uintptr) in // the column. // // If there is no match, return 0. Return -1 if an error occurs. -func resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintptr, pE uintptr) int32 { /* sqlite3.c:98934:12: */ +func resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintptr, pE uintptr) int32 { /* sqlite3.c:99843:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -77481,13 +78132,13 @@ func resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintptr } // Generate an ORDER BY or GROUP BY term out-of-range error. -func resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32) { /* sqlite3.c:98981:13: */ +func resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32) { /* sqlite3.c:99890:13: */ bp := tls.Alloc(24) defer tls.Free(24) Xsqlite3ErrorMsg(tls, pParse, - ts+5974 /* "%r %s BY term ou..." */, libc.VaList(bp, i, zType, mx)) + ts+6030 /* "%r %s BY term ou..." */, libc.VaList(bp, i, zType, mx)) } // Analyze the ORDER BY clause in a compound SELECT statement. Modify @@ -77503,7 +78154,7 @@ func resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int3 // the integer column number. // // Return the number of errors seen. -func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int32 { /* sqlite3.c:99007:12: */ +func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int32 { /* sqlite3.c:99916:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -77518,8 +78169,8 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3 return 0 } db = (*Parse)(unsafe.Pointer(pParse)).Fdb - if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 2*4)) { - Xsqlite3ErrorMsg(tls, pParse, ts+6030 /* "too many terms i..." */, 0) + if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 2*4)) { + Xsqlite3ErrorMsg(tls, pParse, ts+6086 /* "too many terms i..." */, 0) return 1 } for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ { @@ -77549,9 +78200,12 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3 goto __2 } pE = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr) + if pE == uintptr(0) { + goto __2 + } if Xsqlite3ExprIsInteger(tls, pE, bp+8 /* &iCol */) != 0 { if (*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) <= 0) || (*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) > (*ExprList)(unsafe.Pointer(pEList)).FnExpr) { - resolveOutOfRangeError(tls, pParse, ts+6064 /* "ORDER" */, (i + 1), (*ExprList)(unsafe.Pointer(pEList)).FnExpr) + resolveOutOfRangeError(tls, pParse, ts+6120 /* "ORDER" */, (i + 1), (*ExprList)(unsafe.Pointer(pEList)).FnExpr) return 1 } } else { @@ -77592,7 +78246,7 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3 if pNew == uintptr(0) { return 1 } - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_IntValue) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_IntValue)) *(*int32)(unsafe.Pointer(pNew + 8 /* &.u */)) = *(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) if (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr == pE { (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = pNew @@ -77627,7 +78281,7 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3 for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ { if (int32(*(*uint8)(unsafe.Pointer(((pOrderBy + 8 /* &.a */) + uintptr(i)*32) + 20 /* &.done */)) & 0x4 >> 2)) == 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+6070 /* "%r ORDER BY term..." */, libc.VaList(bp, (i+1))) + ts+6126 /* "%r ORDER BY term..." */, libc.VaList(bp, (i+1))) return 1 } } @@ -77642,7 +78296,7 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3 // // If any errors are detected, add an error message to pParse and // return non-zero. Return zero if no errors are seen. -func Xsqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:99124:20: */ +func Xsqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:100034:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -77654,8 +78308,8 @@ func Xsqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, if ((pOrderBy == uintptr(0)) || ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0)) || (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { return 0 } - if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 2*4)) { - Xsqlite3ErrorMsg(tls, pParse, ts+6131 /* "too many terms i..." */, libc.VaList(bp, zType)) + if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 2*4)) { + Xsqlite3ErrorMsg(tls, pParse, ts+6187 /* "too many terms i..." */, libc.VaList(bp, zType)) return 1 } pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList @@ -77672,8 +78326,7 @@ __1: resolveOutOfRangeError(tls, pParse, zType, (i + 1), (*ExprList)(unsafe.Pointer(pEList)).FnExpr) return 1 } - resolveAlias(tls, pParse, pEList, (int32(*(*U16)(unsafe.Pointer((pItem + 24 /* &.u */ /* &.x */) /* &.iOrderByCol */))) - 1), (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr, - zType, 0) + resolveAlias(tls, pParse, pEList, (int32(*(*U16)(unsafe.Pointer((pItem + 24 /* &.u */ /* &.x */) /* &.iOrderByCol */))) - 1), (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr, 0) } } @@ -77689,9 +78342,9 @@ __3: } // Walker callback for windowRemoveExprFromSelect(). -func resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99159:12: */ +func resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:100068:12: */ _ = pWalker - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) Xsqlite3WindowUnlinkFromSelect(tls, pWin) } @@ -77700,7 +78353,7 @@ func resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 // Remove any Window objects owned by the expression pExpr from the // Select.pWin list of Select object pSelect. -func windowRemoveExprFromSelect(tls *libc.TLS, pSelect uintptr, pExpr uintptr) { /* sqlite3.c:99172:13: */ +func windowRemoveExprFromSelect(tls *libc.TLS, pSelect uintptr, pExpr uintptr) { /* sqlite3.c:100081:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -77732,7 +78385,7 @@ func windowRemoveExprFromSelect(tls *libc.TLS, pSelect uintptr, pExpr uintptr) { // 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 *libc.TLS, pNC uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:99203:12: */ +func resolveOrderGroupBy(tls *libc.TLS, pNC uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:100112:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -77758,6 +78411,9 @@ __1: { var pE uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr var pE2 uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pE) + if pE2 == uintptr(0) { + goto __2 + } if int32(*(*int8)(unsafe.Pointer(zType))) != 'G' { *(*int32)(unsafe.Pointer(bp /* iCol */)) = resolveAsName(tls, pParse, (*Select)(unsafe.Pointer(pSelect)).FpEList, pE2) if *(*int32)(unsafe.Pointer(bp /* iCol */)) > 0 { @@ -77809,7 +78465,7 @@ __3: } // Resolve names in the SELECT statement p and all of its descendants. -func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:99265:12: */ +func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:100175:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -77824,7 +78480,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql var pLeftmost uintptr // Left-most of SELECT of a compound var db uintptr // Database connection - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Resolved) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Resolved)) != 0 { return WRC_Prune } pOuterNC = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) @@ -77838,7 +78494,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // sqlite3SelectPrep() do all of the processing for this SELECT. // sqlite3SelectPrep() will invoke both sqlite3SelectExpand() and // this routine in the correct order. - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Expanded) == U32(0) { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Expanded)) == U32(0) { Xsqlite3SelectPrep(tls, pParse, p, pOuterNC) if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { return WRC_Abort @@ -77851,7 +78507,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql pLeftmost = p for p != 0 { - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Resolved) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Resolved)) // Resolve the expressions in the LIMIT and OFFSET clauses. These // are not allowed to refer to any names, so pass an empty NameContext. @@ -77868,8 +78524,8 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // as if it were part of the sub-query, not the parent. This block // moves the pOrderBy down to the sub-query. It will be moved back // after the names have been resolved. - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Converted) != 0 { - var pSub uintptr = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Converted)) != 0 { + var pSub uintptr = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect (*Select)(unsafe.Pointer(pSub)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy (*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) @@ -77878,34 +78534,34 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // Recursively resolve names in all subqueries for i = 0; i < (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc; i++ { var pItem uintptr = (((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(i)*112) - if ((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & SF_Resolved) == U32(0)) { - var pNC uintptr // Used to iterate name contexts - var nRef int32 = 0 // Refcount for pOuterNC and outer contexts + if ((*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & U32(SF_Resolved)) == U32(0)) { + var nRef int32 + if pOuterNC != 0 { + nRef = (*NameContext)(unsafe.Pointer(pOuterNC)).FnRef + } else { + nRef = 0 + } var zSavedContext uintptr = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext - // Count the total number of references to pOuterNC and all of its - // parent contexts. After resolving references to expressions in - // pItem->pSelect, check if this value has changed. If so, then - // SELECT statement pItem->pSelect must be correlated. Set the - // pItem->fg.isCorrelated flag if this is the case. - for pNC = pOuterNC; pNC != 0; pNC = (*NameContext)(unsafe.Pointer(pNC)).FpNext { - nRef = nRef + ((*NameContext)(unsafe.Pointer(pNC)).FnRef) + if (*SrcItem)(unsafe.Pointer(pItem)).FzName != 0 { + (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcItem)(unsafe.Pointer(pItem)).FzName } - - if (*SrcList_item)(unsafe.Pointer(pItem)).FzName != 0 { - (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcList_item)(unsafe.Pointer(pItem)).FzName - } - Xsqlite3ResolveSelectNames(tls, pParse, (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect, pOuterNC) + Xsqlite3ResolveSelectNames(tls, pParse, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect, pOuterNC) (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedContext if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { return WRC_Abort } - for pNC = pOuterNC; pNC != 0; pNC = (*NameContext)(unsafe.Pointer(pNC)).FpNext { - nRef = nRef - ((*NameContext)(unsafe.Pointer(pNC)).FnRef) - } + // If the number of references to the outer context changed when + // expressions in the sub-select were resolved, the sub-select + // is correlated. It is not required to check the refcount on any + // but the innermost outer context object, as lookupName() increments + // the refcount on all contexts between the current one and the + // context containing the column when it resolves a name. + if pOuterNC != 0 { - libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isCorrelated */, (uint32(libc.Bool32(nRef != 0))), 3, 0x8) + libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isCorrelated */, (uint32(libc.Bool32((*NameContext)(unsafe.Pointer(pOuterNC)).FnRef > nRef))), 3, 0x8) + } } } @@ -77934,7 +78590,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // If a HAVING clause is present, then there must be a GROUP BY clause. if ((*Select)(unsafe.Pointer(p)).FpHaving != 0) && !(pGroupBy != 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+6162 /* "a GROUP BY claus..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+6218 /* "a GROUP BY claus..." */, 0) return WRC_Abort } @@ -77974,8 +78630,8 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // within the ORDER BY clause has been transformed to an integer value. // These integers will be replaced by copies of the corresponding result // set expressions by the call to resolveOrderGroupBy() below. - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Converted) != 0 { - var pSub uintptr = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Converted)) != 0 { + var pSub uintptr = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect (*Select)(unsafe.Pointer(p)).FpOrderBy = (*Select)(unsafe.Pointer(pSub)).FpOrderBy (*Select)(unsafe.Pointer(pSub)).FpOrderBy = uintptr(0) } @@ -77990,7 +78646,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // is not detected until much later, and so we need to go ahead and // resolve those symbols on the incorrect ORDER BY for consistency. if (isCompound <= nCompound) && // Defer right-most ORDER BY of a compound - (resolveOrderGroupBy(tls, bp /* &sNC */, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+6064 /* "ORDER" */) != 0) { + (resolveOrderGroupBy(tls, bp /* &sNC */, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+6120 /* "ORDER" */) != 0) { return WRC_Abort } if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -78003,7 +78659,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql if pGroupBy != 0 { var pItem uintptr - if (resolveOrderGroupBy(tls, bp /* &sNC */, p, pGroupBy, ts+6206 /* "GROUP" */) != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + if (resolveOrderGroupBy(tls, bp /* &sNC */, p, pGroupBy, ts+6262 /* "GROUP" */) != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { return WRC_Abort } i = 0 @@ -78013,9 +78669,9 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql goto __3 } { - if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer(pItem)).FpExpr))).Fflags & (EP_Agg)) != U32(0) { + if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer(pItem)).FpExpr))).Fflags & (U32(EP_Agg))) != U32(0) { Xsqlite3ErrorMsg(tls, pParse, - ts+6212 /* "aggregate functi..." */, 0) + ts+6268 /* "aggregate functi..." */, 0) return WRC_Abort } @@ -78106,7 +78762,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // // An error message is left in pParse if anything is amiss. The number // if errors is returned. -func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:99550:20: */ +func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:100459:20: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -78127,12 +78783,12 @@ func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 { }{resolveSelectStep})) (*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = uintptr(0) *(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = pNC - *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 292 /* &.nHeight */)) += ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) + *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 284 /* &.nHeight */)) += ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) if Xsqlite3ExprCheckHeight(tls, (*Walker)(unsafe.Pointer(bp /* &w */)).FpParse, (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse)).FnHeight) != 0 { return SQLITE_ERROR } Xsqlite3WalkExpr(tls, bp /* &w */, pExpr) - *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 292 /* &.nHeight */)) -= ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) + *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 284 /* &.nHeight */)) -= ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_HasWin))) *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) |= (savedHasAgg) @@ -78142,7 +78798,7 @@ func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 { // 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 Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int32 { /* sqlite3.c:99589:20: */ +func Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int32 { /* sqlite3.c:100498:20: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -78169,12 +78825,12 @@ func Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int if pExpr == uintptr(0) { continue } - *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 292 /* &.nHeight */)) += ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) + *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 284 /* &.nHeight */)) += ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) if Xsqlite3ExprCheckHeight(tls, (*Walker)(unsafe.Pointer(bp /* &w */)).FpParse, (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse)).FnHeight) != 0 { return WRC_Abort } Xsqlite3WalkExpr(tls, bp /* &w */, pExpr) - *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 292 /* &.nHeight */)) -= ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) + *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 284 /* &.nHeight */)) -= ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & ((NC_HasAgg | NC_MinMaxAgg) | NC_HasWin)) != 0 { *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_HasWin))) @@ -78199,7 +78855,7 @@ func Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int // // All SELECT statements should have been expanded using // sqlite3SelectExpand() prior to invoking this routine. -func Xsqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:99644:21: */ +func Xsqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:100553:21: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -78233,7 +78889,7 @@ func Xsqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter // set to the column number. In case (4), TK_COLUMN nodes cause an error. // // Any errors cause an error message to be set in pParse. -func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) int32 { /* sqlite3.c:99678:20: */ +func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) int32 { /* sqlite3.c:100587:20: */ bp := tls.Alloc(176) defer tls.Free(176) @@ -78247,9 +78903,9 @@ func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, t libc.Xmemset(tls, bp+56 /* &sSrc */, 0, uint64(unsafe.Sizeof(SrcList{}))) if pTab != 0 { (*SrcList)(unsafe.Pointer(bp + 56 /* &sSrc */)).FnSrc = 1 - (*SrcList_item)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */))).FzName = (*Table)(unsafe.Pointer(pTab)).FzName - (*SrcList_item)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */))).FpTab = pTab - (*SrcList_item)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */))).FiCursor = -1 + (*SrcItem)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */))).FzName = (*Table)(unsafe.Pointer(pTab)).FzName + (*SrcItem)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */))).FpTab = pTab + (*SrcItem)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */))).FiCursor = -1 if (*Table)(unsafe.Pointer(pTab)).FpSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+1*32)).FpSchema { // Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP // schema elements @@ -78269,12 +78925,12 @@ func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, t } // Return the affinity character for a single column of a table. -func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) int8 { /* sqlite3.c:99738:21: */ +func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) int8 { /* sqlite3.c:100647:21: */ if iCol >= 0 { return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).Faffinity } - return SQLITE_AFF_INTEGER + return int8(SQLITE_AFF_INTEGER) } // Return the 'affinity' of the expression pExpr if any. @@ -78291,9 +78947,9 @@ func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) int8 { // SELECT * FROM t1 WHERE a; // SELECT a AS b FROM t1 WHERE b; // SELECT * FROM t1 WHERE (select a from t1); -func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:99759:21: */ +func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:100668:21: */ var op int32 - for ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Skip)) != U32(0) { + for ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip | EP_IfNullRow))) != U32(0) { pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft @@ -78330,8 +78986,21 @@ func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:9975 // // If a memory allocation error occurs, that fact is recorded in pParse->db // and the pExpr parameter is returned unchanged. -func Xsqlite3ExprAddCollateToken(tls *libc.TLS, pParse uintptr, pExpr uintptr, pCollName uintptr, dequote int32) uintptr { /* sqlite3.c:99804:21: */ - if (*Token)(unsafe.Pointer(pCollName)).Fn > uint32(0) { +func Xsqlite3ExprAddCollateToken(tls *libc.TLS, pParse uintptr, pExpr uintptr, pCollName uintptr, dequote int32) uintptr { /* sqlite3.c:100715:21: */ + + if pExpr == uintptr(0) { + return uintptr(0) + } + if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VECTOR { + var pList uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + if pList != uintptr(0) { + var i int32 + for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ { + (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32)).FpExpr = Xsqlite3ExprAddCollateToken(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*32)).FpExpr, + pCollName, dequote) + } + } + } else if (*Token)(unsafe.Pointer(pCollName)).Fn > uint32(0) { var pNew uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_COLLATE, pCollName, dequote) if pNew != 0 { (*Expr)(unsafe.Pointer(pNew)).FpLeft = pExpr @@ -78342,7 +79011,7 @@ func Xsqlite3ExprAddCollateToken(tls *libc.TLS, pParse uintptr, pExpr uintptr, p return pExpr } -func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, zC uintptr) uintptr { /* sqlite3.c:99820:21: */ +func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, zC uintptr) uintptr { /* sqlite3.c:100742:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -78353,8 +79022,8 @@ func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, } // Skip over any TK_COLLATE operators. -func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:99830:21: */ - for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Skip)) != U32(0)) { +func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:100752:21: */ + for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip))) != U32(0)) { pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft } @@ -78364,9 +79033,9 @@ func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3. // Skip over any TK_COLLATE operators and/or any unlikely() // or likelihood() or likely() functions at the root of an // expression. -func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:99843:21: */ +func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:100765:21: */ for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip | EP_Unlikely))) != U32(0)) { - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Unlikely)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Unlikely))) != U32(0) { pExpr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + 8 /* &.a */))).FpExpr } else { @@ -78389,7 +79058,7 @@ func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr { /* // 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 Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:99872:24: */ +func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:100794:24: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pColl uintptr = uintptr(0) var p uintptr = pExpr @@ -78421,8 +79090,8 @@ func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { pColl = Xsqlite3GetCollSeq(tls, pParse, (*Sqlite3)(unsafe.Pointer(db)).Fenc, uintptr(0), *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) break } - if ((*Expr)(unsafe.Pointer(p)).Fflags & EP_Collate) != 0 { - if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) && (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fflags & EP_Collate) != U32(0)) { + if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_Collate)) != 0 { + if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) && (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fflags & U32(EP_Collate)) != U32(0)) { p = (*Expr)(unsafe.Pointer(p)).FpLeft } else { var pNext uintptr = (*Expr)(unsafe.Pointer(p)).FpRight @@ -78430,10 +79099,10 @@ func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { if ((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != uintptr(0)) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0)) && - (!(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0))) { + (!(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0))) { var i int32 for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)))).FnExpr; i++ { - if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr))).Fflags & (EP_Collate)) != U32(0) { + if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr))).Fflags & (U32(EP_Collate))) != U32(0) { pNext = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr break } @@ -78459,7 +79128,7 @@ func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { // // The sqlite3ExprCollSeq() routine works the same except that it // returns NULL if there is no defined collation. -func Xsqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:99944:24: */ +func Xsqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:100866:24: */ var p uintptr = Xsqlite3ExprCollSeq(tls, pParse, pExpr) if p == uintptr(0) { p = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl @@ -78469,7 +79138,7 @@ func Xsqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr } // Return TRUE if the two expressions have equivalent collating sequences. -func Xsqlite3ExprCollSeqMatch(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr) int32 { /* sqlite3.c:99954:20: */ +func Xsqlite3ExprCollSeqMatch(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr) int32 { /* sqlite3.c:100876:20: */ var pColl1 uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, pE1) var pColl2 uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, pE2) return (libc.Bool32(Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl1)).FzName, (*CollSeq)(unsafe.Pointer(pColl2)).FzName) == 0)) @@ -78478,15 +79147,15 @@ func Xsqlite3ExprCollSeqMatch(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 ui // 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 Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) int8 { /* sqlite3.c:99965:21: */ +func Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) int8 { /* sqlite3.c:100887:21: */ var aff1 int8 = Xsqlite3ExprAffinity(tls, pExpr) if (int32(aff1) > SQLITE_AFF_NONE) && (int32(aff2) > SQLITE_AFF_NONE) { // Both sides of the comparison are columns. If one has numeric // affinity, use that. Otherwise use no affinity. if ((int32(aff1)) >= SQLITE_AFF_NUMERIC) || ((int32(aff2)) >= SQLITE_AFF_NUMERIC) { - return SQLITE_AFF_NUMERIC + return int8(SQLITE_AFF_NUMERIC) } else { - return SQLITE_AFF_BLOB + return int8(SQLITE_AFF_BLOB) } } else { // One side is a column, the other is not. Use the columns affinity. @@ -78503,16 +79172,16 @@ func Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) int8 { /* // pExpr is a comparison operator. Return the type affinity that should // be applied to both operands prior to doing the comparison. -func comparisonAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:99987:13: */ +func comparisonAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:100909:13: */ var aff int8 aff = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) if (*Expr)(unsafe.Pointer(pExpr)).FpRight != 0 { aff = Xsqlite3CompareAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight, aff) - } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { aff = Xsqlite3CompareAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList + 8 /* &.a */))).FpExpr, aff) } else if int32(aff) == 0 { - aff = SQLITE_AFF_BLOB + aff = int8(SQLITE_AFF_BLOB) } return aff } @@ -78521,7 +79190,7 @@ func comparisonAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:99987: // 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 Xsqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity int8) int32 { /* sqlite3.c:100010:20: */ +func Xsqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity int8) int32 { /* sqlite3.c:100932:20: */ var aff int8 = comparisonAffinity(tls, pExpr) if int32(aff) < SQLITE_AFF_TEXT { return 1 @@ -78534,7 +79203,7 @@ func Xsqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity int8) in // 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 *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull int32) U8 { /* sqlite3.c:100025:11: */ +func binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull int32) U8 { /* sqlite3.c:100947:11: */ var aff U8 = U8(Xsqlite3ExprAffinity(tls, pExpr2)) aff = (U8(int32(U8(Xsqlite3CompareAffinity(tls, pExpr1, int8(aff)))) | int32(U8(jumpIfNull)))) return aff @@ -78550,12 +79219,12 @@ func binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull i // // Argument pRight (but not pLeft) may be a null pointer. In this case, // it is not considered. -func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100047:24: */ +func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100969:24: */ var pColl uintptr - if ((*Expr)(unsafe.Pointer(pLeft)).Fflags & EP_Collate) != 0 { + if ((*Expr)(unsafe.Pointer(pLeft)).Fflags & U32(EP_Collate)) != 0 { pColl = Xsqlite3ExprCollSeq(tls, pParse, pLeft) - } else if (pRight != 0) && (((*Expr)(unsafe.Pointer(pRight)).Fflags & EP_Collate) != U32(0)) { + } else if (pRight != 0) && (((*Expr)(unsafe.Pointer(pRight)).Fflags & U32(EP_Collate)) != U32(0)) { pColl = Xsqlite3ExprCollSeq(tls, pParse, pRight) } else { pColl = Xsqlite3ExprCollSeq(tls, pParse, pLeft) @@ -78573,8 +79242,8 @@ func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, // However, if the OP_Commuted flag is set, then the order of the operands // is reversed in the sqlite3BinaryCompareCollSeq() call so that the // correct collating sequence is found. -func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:100075:24: */ - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Commuted)) != U32(0) { +func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:100997:24: */ + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Commuted))) != U32(0) { return Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpRight, (*Expr)(unsafe.Pointer(p)).FpLeft) } else { return Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpLeft, (*Expr)(unsafe.Pointer(p)).FpRight) @@ -78583,7 +79252,7 @@ func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintpt } // Generate code for a comparison operator. -func codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, opcode int32, in1 int32, in2 int32, dest int32, jumpIfNull int32, isCommuted int32) int32 { /* sqlite3.c:100086:12: */ +func codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, opcode int32, in1 int32, in2 int32, dest int32, jumpIfNull int32, isCommuted int32) int32 { /* sqlite3.c:101008:12: */ var p5 int32 var addr int32 var p4 uintptr @@ -78610,7 +79279,7 @@ func codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, o // 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 Xsqlite3ExprIsVector(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:100122:20: */ +func Xsqlite3ExprIsVector(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101044:20: */ return (libc.Bool32(Xsqlite3ExprVectorSize(tls, pExpr) > 1)) } @@ -78618,7 +79287,7 @@ func Xsqlite3ExprIsVector(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:100 // 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 Xsqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:100132:20: */ +func Xsqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101054:20: */ var op U8 = (*Expr)(unsafe.Pointer(pExpr)).Fop if int32(op) == TK_REGISTER { op = (*Expr)(unsafe.Pointer(pExpr)).Fop2 @@ -78646,7 +79315,7 @@ func Xsqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:1 // 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 Xsqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) uintptr { /* sqlite3.c:100159:21: */ +func Xsqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) uintptr { /* sqlite3.c:101081:21: */ if Xsqlite3ExprIsVector(tls, pVector) != 0 { @@ -78678,7 +79347,7 @@ func Xsqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) uintptr // 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 Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32) uintptr { /* sqlite3.c:100193:21: */ +func Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32) uintptr { /* sqlite3.c:101115:21: */ var pRet uintptr if int32((*Expr)(unsafe.Pointer(pVector)).Fop) == TK_SELECT { @@ -78719,7 +79388,7 @@ func Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, // of registers in which the result is stored). // // If pExpr is not a TK_SELECT expression, return 0. -func exprCodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:100239:12: */ +func exprCodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:101161:12: */ var reg int32 = 0 if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT { reg = Xsqlite3CodeSubselect(tls, pParse, pExpr) @@ -78743,7 +79412,7 @@ func exprCodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* // // Before returning, output parameter (*ppExpr) is set to point to the // Expr object corresponding to element iElem of the vector. -func exprVectorRegister(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32, regSelect int32, ppExpr uintptr, pRegFree uintptr) int32 { /* sqlite3.c:100267:12: */ +func exprVectorRegister(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32, regSelect int32, ppExpr uintptr, pRegFree uintptr) int32 { /* sqlite3.c:101189:12: */ var op U8 = (*Expr)(unsafe.Pointer(pVector)).Fop if int32(op) == TK_REGISTER { @@ -78767,7 +79436,7 @@ func exprVectorRegister(tls *libc.TLS, pParse uintptr, pVector uintptr, iField i // 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 *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, op U8, p5 U8) { /* sqlite3.c:100300:13: */ +func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, op U8, p5 U8) { /* sqlite3.c:101222:13: */ bp := tls.Alloc(28) defer tls.Free(28) @@ -78780,22 +79449,22 @@ func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, var regRight int32 = 0 var opx U8 = op var addrDone int32 = Xsqlite3VdbeMakeLabel(tls, pParse) - var isCommuted int32 = (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0))) + var isCommuted int32 = (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0))) if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return } if nLeft != Xsqlite3ExprVectorSize(tls, pRight) { - Xsqlite3ErrorMsg(tls, pParse, ts+5372 /* "row value misuse..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+5417 /* "row value misuse..." */, 0) return } p5 = U8(int32(p5) | (SQLITE_STOREP2)) if int32(opx) == TK_LE { - opx = TK_LT + opx = U8(TK_LT) } if int32(opx) == TK_GE { - opx = TK_GT + opx = U8(TK_GT) } regLeft = exprCodeSubselect(tls, pParse, pLeft) @@ -78841,15 +79510,15 @@ func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, // Check that argument nHeight is less than or equal to the maximum // expression depth allowed. If it is not, leave an error message in // pParse. -func Xsqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) int32 { /* sqlite3.c:100385:20: */ +func Xsqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) int32 { /* sqlite3.c:101307:20: */ bp := tls.Alloc(8) defer tls.Free(8) var rc int32 = SQLITE_OK - var mxHeight int32 = *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + 3*4)) + var mxHeight int32 = *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 128 /* &.aLimit */) + 3*4)) if nHeight > mxHeight { Xsqlite3ErrorMsg(tls, pParse, - ts+6271 /* "Expression tree ..." */, libc.VaList(bp, mxHeight)) + ts+6327 /* "Expression tree ..." */, libc.VaList(bp, mxHeight)) rc = SQLITE_ERROR } return rc @@ -78863,7 +79532,7 @@ func Xsqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) int32 // 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 *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:100406:13: */ +func heightOfExpr(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:101328:13: */ if p != 0 { if (*Expr)(unsafe.Pointer(p)).FnHeight > *(*int32)(unsafe.Pointer(pnHeight)) { *(*int32)(unsafe.Pointer(pnHeight)) = (*Expr)(unsafe.Pointer(p)).FnHeight @@ -78871,7 +79540,7 @@ func heightOfExpr(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:100 } } -func heightOfExprList(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:100413:13: */ +func heightOfExprList(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:101335:13: */ if p != 0 { var i int32 for i = 0; i < (*ExprList)(unsafe.Pointer(p)).FnExpr; i++ { @@ -78880,7 +79549,7 @@ func heightOfExprList(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c } } -func heightOfSelect(tls *libc.TLS, pSelect uintptr, pnHeight uintptr) { /* sqlite3.c:100421:13: */ +func heightOfSelect(tls *libc.TLS, pSelect uintptr, pnHeight uintptr) { /* sqlite3.c:101343:13: */ var p uintptr for p = pSelect; p != 0; p = (*Select)(unsafe.Pointer(p)).FpPrior { heightOfExpr(tls, (*Select)(unsafe.Pointer(p)).FpWhere, pnHeight) @@ -78900,14 +79569,14 @@ func heightOfSelect(tls *libc.TLS, pSelect uintptr, pnHeight uintptr) { /* sqlit // // Also propagate EP_Propagate flags up from Expr.x.pList to Expr.flags, // if appropriate. -func exprSetHeight(tls *libc.TLS, p uintptr) { /* sqlite3.c:100443:13: */ +func exprSetHeight(tls *libc.TLS, p uintptr) { /* sqlite3.c:101365:13: */ bp := tls.Alloc(4) defer tls.Free(4) *(*int32)(unsafe.Pointer(bp /* nHeight */)) = 0 heightOfExpr(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, bp /* &nHeight */) heightOfExpr(tls, (*Expr)(unsafe.Pointer(p)).FpRight, bp /* &nHeight */) - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { heightOfSelect(tls, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), bp /* &nHeight */) } else if *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0 { heightOfExprList(tls, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), bp /* &nHeight */) @@ -78922,7 +79591,7 @@ func exprSetHeight(tls *libc.TLS, p uintptr) { /* sqlite3.c:100443:13: */ // // Also propagate all EP_Propagate flags from the Expr.x.pList into // Expr.flags. -func Xsqlite3ExprSetHeightAndFlags(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:100464:21: */ +func Xsqlite3ExprSetHeightAndFlags(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:101386:21: */ if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return } @@ -78932,7 +79601,7 @@ func Xsqlite3ExprSetHeightAndFlags(tls *libc.TLS, pParse uintptr, p uintptr) { / // Return the maximum height of any expression tree referenced // by the select statement passed as an argument. -func Xsqlite3SelectExprHeight(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:100474:20: */ +func Xsqlite3SelectExprHeight(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101396:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -78959,7 +79628,7 @@ func Xsqlite3SelectExprHeight(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:100 // 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 Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequote int32) uintptr { /* sqlite3.c:100512:21: */ +func Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequote int32) uintptr { /* sqlite3.c:101435:21: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -79007,7 +79676,7 @@ func Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ // Allocate a new expression node from a zero-terminated token that has // already been dequoted. -func Xsqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) uintptr { /* sqlite3.c:100560:21: */ +func Xsqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) uintptr { /* sqlite3.c:101483:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -79022,7 +79691,7 @@ func Xsqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) uintptr { // // If pRoot==NULL that means that a memory allocation error has occurred. // In that case, delete the subtrees pLeft and pRight. -func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft uintptr, pRight uintptr) { /* sqlite3.c:100577:21: */ +func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft uintptr, pRight uintptr) { /* sqlite3.c:101500:21: */ if pRoot == uintptr(0) { Xsqlite3ExprDelete(tls, db, pLeft) @@ -79045,7 +79714,7 @@ func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft // 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 Xsqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100607:21: */ +func Xsqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:101530:21: */ var p uintptr p = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Expr{}))) if p != 0 { @@ -79063,7 +79732,7 @@ func Xsqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRigh // 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 Xsqlite3PExprAddSelect(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSelect uintptr) { /* sqlite3.c:100632:21: */ +func Xsqlite3PExprAddSelect(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSelect uintptr) { /* sqlite3.c:101555:21: */ if pExpr != 0 { *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) = pSelect *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_xIsSelect | EP_Subquery)) @@ -79080,17 +79749,17 @@ func Xsqlite3PExprAddSelect(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSelec // 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 Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100652:21: */ +func Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:101575:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if pLeft == uintptr(0) { return pRight } else if pRight == uintptr(0) { return pLeft - } else if ((((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse)) && + } else if ((((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse))) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { Xsqlite3ExprDelete(tls, db, pLeft) Xsqlite3ExprDelete(tls, db, pRight) - return Xsqlite3Expr(tls, db, TK_INTEGER, ts+6319 /* "0" */) + return Xsqlite3Expr(tls, db, TK_INTEGER, ts+6375 /* "0" */) } else { return Xsqlite3PExpr(tls, pParse, TK_AND, pLeft, pRight) } @@ -79099,7 +79768,7 @@ func Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt // Construct a new expression node for a function with multiple // arguments. -func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr, eDistinct int32) uintptr { /* sqlite3.c:100673:21: */ +func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr, eDistinct int32) uintptr { /* sqlite3.c:101596:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -79111,15 +79780,15 @@ func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u Xsqlite3ExprListDelete(tls, db, pList) // Avoid memory leak when malloc fails return uintptr(0) } - if (pList != 0) && ((*ExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + 6*4))) { - Xsqlite3ErrorMsg(tls, pParse, ts+6321 /* "too many argumen..." */, libc.VaList(bp, pToken)) + if (pList != 0) && ((*ExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 128 /* &.aLimit */) + 6*4))) { + Xsqlite3ErrorMsg(tls, pParse, ts+6377 /* "too many argumen..." */, libc.VaList(bp, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32 /* &.x */)) = pList - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_HasFunc) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_HasFunc)) Xsqlite3ExprSetHeightAndFlags(tls, pParse, pNew) if eDistinct == SF_Distinct { - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_Distinct) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_Distinct)) } return pNew } @@ -79133,20 +79802,20 @@ func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u // top-level SQL // // If the function is not usable, create an error. -func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pDef uintptr) { /* sqlite3.c:100709:21: */ +func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pDef uintptr) { /* sqlite3.c:101632:21: */ bp := tls.Alloc(8) defer tls.Free(8) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromDDL)) != U32(0) { - if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_DIRECT) != U32(0)) || - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_TrustedSchema) == uint64(0)) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromDDL))) != U32(0) { + if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_DIRECT)) != U32(0)) || + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_TrustedSchema)) == uint64(0)) { // Functions prohibited in triggers and views if: // (1) tagged with SQLITE_DIRECTONLY // (2) not tagged with SQLITE_INNOCUOUS (which means it // is tagged with SQLITE_FUNC_UNSAFE) and // SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning // that the schema is possibly tainted). - Xsqlite3ErrorMsg(tls, pParse, ts+6355 /* "unsafe use of %s..." */, libc.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+6411 /* "unsafe use of %s..." */, libc.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName)) } } } @@ -79165,7 +79834,7 @@ func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD // 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 Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n U32) { /* sqlite3.c:100748:21: */ +func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n U32) { /* sqlite3.c:101671:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -79195,12 +79864,12 @@ func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n *(*I64)(unsafe.Pointer(bp + 8 /* i */)) = (I64(int32(*(*int8)(unsafe.Pointer(z + 1))) - '0')) // The common case of ?N for a single digit N bOk = 1 } else { - bOk = (libc.Bool32(0 == Xsqlite3Atoi64(tls, (z+1), bp+8 /* &i */, (int32(n-U32(1))), SQLITE_UTF8))) + bOk = (libc.Bool32(0 == Xsqlite3Atoi64(tls, (z+1), bp+8 /* &i */, (int32(n-U32(1))), uint8(SQLITE_UTF8)))) } - if ((bOk == 0) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) < int64(1))) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 9*4)))) { - Xsqlite3ErrorMsg(tls, pParse, ts+6374, /* "variable number ..." */ - libc.VaList(bp, *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 9*4)))) + if ((bOk == 0) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) < int64(1))) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) > I64(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 9*4)))) { + Xsqlite3ErrorMsg(tls, pParse, ts+6430, /* "variable number ..." */ + libc.VaList(bp, *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 9*4)))) return } x = YnVar(*(*I64)(unsafe.Pointer(bp + 8 /* i */))) @@ -79225,13 +79894,13 @@ func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } } (*Expr)(unsafe.Pointer(pExpr)).FiColumn = x - if int32(x) > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 9*4)) { - Xsqlite3ErrorMsg(tls, pParse, ts+6417 /* "too many SQL var..." */, 0) + if int32(x) > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 9*4)) { + Xsqlite3ErrorMsg(tls, pParse, ts+6473 /* "too many SQL var..." */, 0) } } // Recursively delete an expression tree. -func sqlite3ExprDeleteNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:100816:29: */ +func sqlite3ExprDeleteNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:101739:29: */ // Sanity check: Assert that the IntValue is non-negative if it exists @@ -79244,25 +79913,25 @@ func sqlite3ExprDeleteNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:10 if (*Expr)(unsafe.Pointer(p)).FpRight != 0 { sqlite3ExprDeleteNN(tls, db, (*Expr)(unsafe.Pointer(p)).FpRight) - } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { Xsqlite3SelectDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */))) } else { Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */))) - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0) { Xsqlite3WindowDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 64 /* &.y */))) } } } - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_MemToken)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_MemToken))) != U32(0) { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) } - if !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Static)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Static))) != U32(0)) { Xsqlite3DbFreeNN(tls, db, p) } } -func Xsqlite3ExprDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:100855:21: */ +func Xsqlite3ExprDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:101778:21: */ if p != 0 { sqlite3ExprDeleteNN(tls, db, p) } @@ -79270,7 +79939,7 @@ func Xsqlite3ExprDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:100 // Invoke sqlite3RenameExprUnmap() and sqlite3ExprDelete() on the // expression. -func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:100862:21: */ +func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:101785:21: */ if p != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { Xsqlite3RenameExprUnmap(tls, pParse, p) @@ -79282,11 +79951,11 @@ func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { /* s // 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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:100876:12: */ - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_TokenOnly)) != U32(0) { +func exprStructSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101799:12: */ + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_TokenOnly))) != U32(0) { return int32((uintptr(0) + 16 /* &.pLeft */)) } - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Reduced)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Reduced))) != U32(0) { return int32((uintptr(0) + 44 /* &.iTable */)) } return int32(unsafe.Sizeof(Expr{})) @@ -79324,20 +79993,20 @@ func exprStructSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:100876:12: */ // 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 *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100916:12: */ +func dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:101839:12: */ var nSize int32 // Only one flag value allowed if ((0 == flags) || (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_SELECT_COLUMN)) || - (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_WinFunc)) != U32(0)) { + (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0)) { nSize = int32(unsafe.Sizeof(Expr{})) } else { if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) || (*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0) { - nSize = (int32((uint64((uintptr(0) + 44 /* &.iTable */))) | EP_Reduced)) + nSize = (int32((uint64((uintptr(0) + 44 /* &.iTable */))) | uint64(EP_Reduced))) } else { - nSize = (int32((uint64((uintptr(0) + 16 /* &.pLeft */))) | EP_TokenOnly)) + nSize = (int32((uint64((uintptr(0) + 16 /* &.pLeft */))) | uint64(EP_TokenOnly))) } } return nSize @@ -79346,9 +80015,9 @@ func dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlit // 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 *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100947:12: */ +func dupedExprNodeSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:101870:12: */ var nByte int32 = (dupedExprStructSize(tls, p, flags) & 0xfff) - if !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_IntValue)) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { + if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { nByte = int32(Size_t(nByte) + ((libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) & uint64(0x3fffffff)) + uint64(1))) } return (((nByte) + 7) & libc.CplInt32(7)) @@ -79365,7 +80034,7 @@ func dupedExprNodeSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3 // 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 *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100968:12: */ +func dupedExprSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:101891:12: */ var nByte int32 = 0 if p != 0 { nByte = dupedExprNodeSize(tls, p, flags) @@ -79382,7 +80051,7 @@ func dupedExprSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:1 // (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 *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uintptr) uintptr { /* sqlite3.c:100987:13: */ +func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uintptr) uintptr { /* sqlite3.c:101910:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -79394,7 +80063,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint // Figure out where to write the new Expr structure. if pzBuffer != 0 { *(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) = *(*uintptr)(unsafe.Pointer(pzBuffer)) - staticFlag = EP_Static + staticFlag = U32(EP_Static) } else { *(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) = Xsqlite3DbMallocRawNN(tls, db, uint64(dupedExprSize(tls, p, dupFlags))) staticFlag = U32(0) @@ -79409,7 +80078,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint var nStructSize uint32 = uint32(dupedExprStructSize(tls, p, dupFlags)) var nNewSize int32 = (int32(nStructSize & uint32(0xfff))) var nToken int32 - if !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_IntValue)) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { + if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { nToken = (Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) + 1) } else { nToken = 0 @@ -79442,7 +80111,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint if U32(0) == (((*Expr)(unsafe.Pointer(p)).Fflags | (*Expr)(unsafe.Pointer(pNew)).Fflags) & (U32(EP_TokenOnly | EP_Leaf))) { // Fill in the pNew->x.pSelect or pNew->x.pList member. - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { *(*uintptr)(unsafe.Pointer(pNew + 32 /* &.x */)) = Xsqlite3SelectDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), dupFlags) } else { *(*uintptr)(unsafe.Pointer(pNew + 32 /* &.x */)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), dupFlags) @@ -79466,7 +80135,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint return uintptr(0) }() } - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0) { *(*uintptr)(unsafe.Pointer(pNew + 64 /* &.y */)) = Xsqlite3WindowDup(tls, db, pNew, *(*uintptr)(unsafe.Pointer(p + 64 /* &.y */))) } @@ -79491,7 +80160,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint // Create and return a deep copy of the object passed as the second // argument. If an OOM condition is encountered, NULL is returned // and the db->mallocFailed flag set. -func withDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:101096:13: */ +func withDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:102019:13: */ var pRet uintptr = uintptr(0) if p != 0 { var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(With{})) + (uint64(unsafe.Sizeof(Cte{})) * (uint64((*With)(unsafe.Pointer(p)).FnCte - 1))))) @@ -79500,9 +80169,9 @@ func withDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:101096 var i int32 (*With)(unsafe.Pointer(pRet)).FnCte = (*With)(unsafe.Pointer(p)).FnCte for i = 0; i < (*With)(unsafe.Pointer(p)).FnCte; i++ { - (*Cte)(unsafe.Pointer((pRet + 16 /* &.a */) + uintptr(i)*32)).FpSelect = Xsqlite3SelectDup(tls, db, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*32)).FpSelect, 0) - (*Cte)(unsafe.Pointer((pRet + 16 /* &.a */) + uintptr(i)*32)).FpCols = Xsqlite3ExprListDup(tls, db, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*32)).FpCols, 0) - (*Cte)(unsafe.Pointer((pRet + 16 /* &.a */) + uintptr(i)*32)).FzName = Xsqlite3DbStrDup(tls, db, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*32)).FzName) + (*Cte)(unsafe.Pointer((pRet + 16 /* &.a */) + uintptr(i)*48)).FpSelect = Xsqlite3SelectDup(tls, db, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*48)).FpSelect, 0) + (*Cte)(unsafe.Pointer((pRet + 16 /* &.a */) + uintptr(i)*48)).FpCols = Xsqlite3ExprListDup(tls, db, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*48)).FpCols, 0) + (*Cte)(unsafe.Pointer((pRet + 16 /* &.a */) + uintptr(i)*48)).FzName = Xsqlite3DbStrDup(tls, db, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*48)).FzName) } } } @@ -79513,8 +80182,8 @@ func withDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:101096 // gatherSelectWindowsCallback() are used to scan all the expressions // an a newly duplicated SELECT statement and gather all of the Window // objects found there, assembling them onto the linked list at Select->pWin. -func gatherSelectWindowsCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101124:12: */ - if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { +func gatherSelectWindowsCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:102047:12: */ + if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) @@ -79523,14 +80192,14 @@ func gatherSelectWindowsCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) return WRC_Continue } -func gatherSelectWindowsSelectCallback(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:101135:12: */ +func gatherSelectWindowsSelectCallback(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:102058:12: */ if p == *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) { return WRC_Continue } return WRC_Prune } -func gatherSelectWindows(tls *libc.TLS, p uintptr) { /* sqlite3.c:101138:13: */ +func gatherSelectWindows(tls *libc.TLS, p uintptr) { /* sqlite3.c:102061:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -79563,7 +80232,7 @@ func gatherSelectWindows(tls *libc.TLS, p uintptr) { /* sqlite3.c:101138:13: */ // 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 Xsqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:101167:21: */ +func Xsqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:102090:21: */ if p != 0 { return exprDup(tls, db, p, flags, uintptr(0)) @@ -79571,7 +80240,7 @@ func Xsqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr return uintptr(0) } -func Xsqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:101171:25: */ +func Xsqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:102094:25: */ var pNew uintptr var pItem uintptr var pOldItem uintptr @@ -79634,7 +80303,7 @@ __3: // the build, then none of the following routines, except for // sqlite3SelectDup(), can be called. sqlite3SelectDup() is sometimes // called with a NULL argument. -func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:101222:24: */ +func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:102145:24: */ var pNew uintptr var i int32 var nByte int32 @@ -79644,7 +80313,7 @@ func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintp } nByte = (int32(uint64(unsafe.Sizeof(SrcList{})) + (func() uint64 { if (*SrcList)(unsafe.Pointer(p)).FnSrc > 0 { - return (uint64(unsafe.Sizeof(SrcList_item{})) * (uint64((*SrcList)(unsafe.Pointer(p)).FnSrc - 1))) + return (uint64(unsafe.Sizeof(SrcItem{})) * (uint64((*SrcList)(unsafe.Pointer(p)).FnSrc - 1))) } return uint64(0) }()))) @@ -79657,34 +80326,37 @@ func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintp var pNewItem uintptr = ((pNew + 8 /* &.a */) + uintptr(i)*112) var pOldItem uintptr = ((p + 8 /* &.a */) + uintptr(i)*112) var pTab uintptr - (*SrcList_item)(unsafe.Pointer(pNewItem)).FpSchema = (*SrcList_item)(unsafe.Pointer(pOldItem)).FpSchema - (*SrcList_item)(unsafe.Pointer(pNewItem)).FzDatabase = Xsqlite3DbStrDup(tls, db, (*SrcList_item)(unsafe.Pointer(pOldItem)).FzDatabase) - (*SrcList_item)(unsafe.Pointer(pNewItem)).FzName = Xsqlite3DbStrDup(tls, db, (*SrcList_item)(unsafe.Pointer(pOldItem)).FzName) - (*SrcList_item)(unsafe.Pointer(pNewItem)).FzAlias = Xsqlite3DbStrDup(tls, db, (*SrcList_item)(unsafe.Pointer(pOldItem)).FzAlias) - (*SrcList_item)(unsafe.Pointer(pNewItem)).Ffg = (*SrcList_item)(unsafe.Pointer(pOldItem)).Ffg - (*SrcList_item)(unsafe.Pointer(pNewItem)).FiCursor = (*SrcList_item)(unsafe.Pointer(pOldItem)).FiCursor - (*SrcList_item)(unsafe.Pointer(pNewItem)).FaddrFillSub = (*SrcList_item)(unsafe.Pointer(pOldItem)).FaddrFillSub - (*SrcList_item)(unsafe.Pointer(pNewItem)).FregReturn = (*SrcList_item)(unsafe.Pointer(pOldItem)).FregReturn + (*SrcItem)(unsafe.Pointer(pNewItem)).FpSchema = (*SrcItem)(unsafe.Pointer(pOldItem)).FpSchema + (*SrcItem)(unsafe.Pointer(pNewItem)).FzDatabase = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FzDatabase) + (*SrcItem)(unsafe.Pointer(pNewItem)).FzName = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FzName) + (*SrcItem)(unsafe.Pointer(pNewItem)).FzAlias = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FzAlias) + (*SrcItem)(unsafe.Pointer(pNewItem)).Ffg = (*SrcItem)(unsafe.Pointer(pOldItem)).Ffg + (*SrcItem)(unsafe.Pointer(pNewItem)).FiCursor = (*SrcItem)(unsafe.Pointer(pOldItem)).FiCursor + (*SrcItem)(unsafe.Pointer(pNewItem)).FaddrFillSub = (*SrcItem)(unsafe.Pointer(pOldItem)).FaddrFillSub + (*SrcItem)(unsafe.Pointer(pNewItem)).FregReturn = (*SrcItem)(unsafe.Pointer(pOldItem)).FregReturn if (uint32(int32(*(*uint8)(unsafe.Pointer(pNewItem + 60 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 { *(*uintptr)(unsafe.Pointer(pNewItem + 96 /* &.u1 */)) = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 96 /* &.u1 */))) } - (*SrcList_item)(unsafe.Pointer(pNewItem)).FpIBIndex = (*SrcList_item)(unsafe.Pointer(pOldItem)).FpIBIndex + (*SrcItem)(unsafe.Pointer(pNewItem)).Fu2 = (*SrcItem)(unsafe.Pointer(pOldItem)).Fu2 + if (uint32(int32(*(*uint8)(unsafe.Pointer(pNewItem + 60 /* &.fg */ + 4 /* &.isCte */)) & 0x80 >> 7))) != 0 { + (*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 104 /* &.u2 */)))).FnUse++ + } if (uint32(int32(*(*uint8)(unsafe.Pointer(pNewItem + 60 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 { *(*uintptr)(unsafe.Pointer(pNewItem + 96 /* &.u1 */)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 96 /* &.u1 */)), flags) } - pTab = libc.AssignPtrUintptr(pNewItem+32 /* &.pTab */, (*SrcList_item)(unsafe.Pointer(pOldItem)).FpTab) + pTab = libc.AssignPtrUintptr(pNewItem+32 /* &.pTab */, (*SrcItem)(unsafe.Pointer(pOldItem)).FpTab) if pTab != 0 { (*Table)(unsafe.Pointer(pTab)).FnTabRef++ } - (*SrcList_item)(unsafe.Pointer(pNewItem)).FpSelect = Xsqlite3SelectDup(tls, db, (*SrcList_item)(unsafe.Pointer(pOldItem)).FpSelect, flags) - (*SrcList_item)(unsafe.Pointer(pNewItem)).FpOn = Xsqlite3ExprDup(tls, db, (*SrcList_item)(unsafe.Pointer(pOldItem)).FpOn, flags) - (*SrcList_item)(unsafe.Pointer(pNewItem)).FpUsing = Xsqlite3IdListDup(tls, db, (*SrcList_item)(unsafe.Pointer(pOldItem)).FpUsing) - (*SrcList_item)(unsafe.Pointer(pNewItem)).FcolUsed = (*SrcList_item)(unsafe.Pointer(pOldItem)).FcolUsed + (*SrcItem)(unsafe.Pointer(pNewItem)).FpSelect = Xsqlite3SelectDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FpSelect, flags) + (*SrcItem)(unsafe.Pointer(pNewItem)).FpOn = Xsqlite3ExprDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FpOn, flags) + (*SrcItem)(unsafe.Pointer(pNewItem)).FpUsing = Xsqlite3IdListDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FpUsing) + (*SrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*SrcItem)(unsafe.Pointer(pOldItem)).FcolUsed } return pNew } -func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:101263:23: */ +func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:102189:23: */ var pNew uintptr var i int32 @@ -79713,7 +80385,7 @@ func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite return pNew } -func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uintptr { /* sqlite3.c:101287:23: */ +func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uintptr { /* sqlite3.c:102213:23: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -79771,7 +80443,7 @@ func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uin // 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 Xsqlite3ExprListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pExpr uintptr) uintptr { /* sqlite3.c:101350:25: */ +func Xsqlite3ExprListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pExpr uintptr) uintptr { /* sqlite3.c:102276:25: */ var pItem uintptr var db uintptr var pNew uintptr @@ -79828,7 +80500,7 @@ no_mem: // 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 Xsqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, pColumns uintptr, pExpr uintptr) uintptr { /* sqlite3.c:101398:25: */ +func Xsqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, pColumns uintptr, pExpr uintptr) uintptr { /* sqlite3.c:102324:25: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -79866,7 +80538,7 @@ __2: if !((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_SELECT) && ((*IdList)(unsafe.Pointer(pColumns)).FnId != (libc.AssignInt32(&n, Xsqlite3ExprVectorSize(tls, pExpr))))) { goto __3 } - Xsqlite3ErrorMsg(tls, pParse, ts+6440, /* "%d columns assig..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+6496, /* "%d columns assig..." */ libc.VaList(bp, (*IdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error __3: @@ -79926,7 +80598,7 @@ vector_append_error: } // Set the sort order for the last element on the given ExprList. -func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eNulls int32) { /* sqlite3.c:101462:21: */ +func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eNulls int32) { /* sqlite3.c:102388:21: */ var pItem uintptr if p == uintptr(0) { return @@ -79953,7 +80625,7 @@ func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eN // 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 Xsqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName uintptr, dequote int32) { /* sqlite3.c:101500:21: */ +func Xsqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName uintptr, dequote int32) { /* sqlite3.c:102426:21: */ if pList != 0 { var pItem uintptr @@ -79979,7 +80651,7 @@ func Xsqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName // 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 Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:101535:21: */ +func Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:102461:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if pList != 0 { @@ -79987,26 +80659,26 @@ func Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStar if (*ExprList_item)(unsafe.Pointer(pItem)).FzEName == uintptr(0) { (*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbSpanDup(tls, db, zStart, zEnd) - libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, ENAME_SPAN, 0, 0x3) + libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, uint32(ENAME_SPAN), 0, 0x3) } } } // If the expression list pEList contains more than iLimit elements, // leave an error message in pParse. -func Xsqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, zObject uintptr) { /* sqlite3.c:101557:21: */ +func Xsqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, zObject uintptr) { /* sqlite3.c:102483:21: */ bp := tls.Alloc(8) defer tls.Free(8) - var mx int32 = *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + 2*4)) + var mx int32 = *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 128 /* &.aLimit */) + 2*4)) if (pEList != 0) && ((*ExprList)(unsafe.Pointer(pEList)).FnExpr > mx) { - Xsqlite3ErrorMsg(tls, pParse, ts+6470 /* "too many columns..." */, libc.VaList(bp, zObject)) + Xsqlite3ErrorMsg(tls, pParse, ts+6526 /* "too many columns..." */, libc.VaList(bp, zObject)) } } // Delete an entire expression list. -func exprListDeleteNN(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:101573:29: */ +func exprListDeleteNN(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:102499:29: */ var i int32 = (*ExprList)(unsafe.Pointer(pList)).FnExpr var pItem uintptr = pList + 8 /* &.a */ @@ -80018,7 +80690,7 @@ func exprListDeleteNN(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:1 Xsqlite3DbFreeNN(tls, db, pList) } -func Xsqlite3ExprListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:101584:21: */ +func Xsqlite3ExprListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:102510:21: */ if pList != 0 { exprListDeleteNN(tls, db, pList) } @@ -80026,7 +80698,7 @@ func Xsqlite3ExprListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlit // Return the bitwise-OR of all Expr.flags fields in the given // ExprList. -func Xsqlite3ExprListFlags(tls *libc.TLS, pList uintptr) U32 { /* sqlite3.c:101592:20: */ +func Xsqlite3ExprListFlags(tls *libc.TLS, pList uintptr) U32 { /* sqlite3.c:102518:20: */ var i int32 var m U32 = U32(0) @@ -80043,7 +80715,7 @@ func Xsqlite3ExprListFlags(tls *libc.TLS, pList uintptr) U32 { /* sqlite3.c:1015 // pWalker->eCode to zero and abort. // // This callback is used by multiple expression walkers. -func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int32 { /* sqlite3.c:101611:20: */ +func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int32 { /* sqlite3.c:102537:20: */ _ = NotUsed (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort @@ -80055,12 +80727,12 @@ func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int // "true" EP_IsTrue // "false" EP_IsFalse // anything else 0 -func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:101625:20: */ - if Xsqlite3StrICmp(tls, zIn, ts+6493 /* "true" */) == 0 { - return EP_IsTrue +func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:102551:20: */ + if Xsqlite3StrICmp(tls, zIn, ts+5639 /* "true" */) == 0 { + return U32(EP_IsTrue) } - if Xsqlite3StrICmp(tls, zIn, ts+6498 /* "false" */) == 0 { - return EP_IsFalse + if Xsqlite3StrICmp(tls, zIn, ts+5644 /* "false" */) == 0 { + return U32(EP_IsFalse) } return U32(0) } @@ -80068,12 +80740,12 @@ func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:101625 // If the input expression is an ID with the name "true" or "false" // then convert it into an TK_TRUEFALSE term. Return non-zero if // the conversion happened, and zero if the expression is unaltered. -func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101637:20: */ +func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:102563:20: */ var v U32 - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Quoted)) != U32(0)) && + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Quoted))) != U32(0)) && ((libc.AssignUint32(&v, Xsqlite3IsTrueOrFalse(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))) != U32(0)) { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_TRUEFALSE + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUEFALSE) *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (v) return 1 } @@ -80082,7 +80754,7 @@ func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3. // The argument must be a TK_TRUEFALSE Expr node. Return 1 if it is TRUE // and 0 if it is FALSE. -func Xsqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101654:20: */ +func Xsqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:102580:20: */ pExpr = Xsqlite3ExprSkipCollate(tls, pExpr) return (libc.Bool32(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + 4))) == 0)) @@ -80099,18 +80771,18 @@ func Xsqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:1 // (x<10) AND (y=22 OR false) => (x<10) AND (y=22) // (x<10) AND (y=22 OR true) => (x<10) // (y=22) OR true => true -func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:101675:21: */ +func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:102601:21: */ if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_OR) { var pRight uintptr = Xsqlite3ExprSimplifiedAndOr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) var pLeft uintptr = Xsqlite3ExprSimplifiedAndOr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) - if (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + if (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND { pExpr = pRight } else { pExpr = pLeft } - } else if (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) || (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + } else if (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) || (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND { pExpr = pLeft } else { @@ -80145,12 +80817,12 @@ func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr { /* sqli // 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 *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101716:12: */ +func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:102642:12: */ // If pWalker->eCode is 2 then any term of the expression that comes from // the ON or USING clauses of a left join disqualifies the expression // from being considered constant. - if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort } @@ -80160,10 +80832,10 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / // and either pWalker->eCode==4 or 5 or the function has the // SQLITE_FUNC_CONST flag. case TK_FUNCTION: - if ((int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) >= 4) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_ConstFunc)) != U32(0))) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if ((int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) >= 4) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_ConstFunc))) != U32(0))) && + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 5 { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FromDDL) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL)) } return WRC_Continue } else { @@ -80184,7 +80856,7 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / fallthrough case TK_AGG_COLUMN: - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FixedCol)) != U32(0)) && (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) != 2) { + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) && (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) != 2) { return WRC_Continue } if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 3) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == *(*int32)(unsafe.Pointer(pWalker + 40 /* &.u */))) { @@ -80204,7 +80876,7 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / // Silently convert bound parameters that appear inside of CREATE // statements into a NULL when parsing the CREATE statement text out // of the sqlite_schema table - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } else if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 4 { // A bound parameter in a CREATE statement that originates from // sqlite3_prepare() causes an error @@ -80220,7 +80892,7 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / return int32(0) } -func exprIsConst(tls *libc.TLS, p uintptr, initFlag int32, iCur int32) int32 { /* sqlite3.c:101788:12: */ +func exprIsConst(tls *libc.TLS, p uintptr, initFlag int32, iCur int32) int32 { /* sqlite3.c:102714:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -80244,7 +80916,7 @@ func exprIsConst(tls *libc.TLS, p uintptr, initFlag int32, iCur int32) int32 { / // 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 Xsqlite3ExprIsConstant(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101809:20: */ +func Xsqlite3ExprIsConstant(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:102735:20: */ return exprIsConst(tls, p, 1, 0) } @@ -80259,7 +80931,7 @@ func Xsqlite3ExprIsConstant(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:10180 // When this routine returns true, it indicates that the expression // can be added to the pParse->pConstExpr list and evaluated once when // the prepared statement starts up. See sqlite3ExprCodeRunJustOnce(). -func Xsqlite3ExprIsConstantNotJoin(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101826:20: */ +func Xsqlite3ExprIsConstantNotJoin(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:102752:20: */ return exprIsConst(tls, p, 2, 0) } @@ -80267,12 +80939,12 @@ func Xsqlite3ExprIsConstantNotJoin(tls *libc.TLS, p uintptr) int32 { /* sqlite3. // 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 Xsqlite3ExprIsTableConstant(tls *libc.TLS, p uintptr, iCur int32) int32 { /* sqlite3.c:101836:20: */ +func Xsqlite3ExprIsTableConstant(tls *libc.TLS, p uintptr, iCur int32) int32 { /* sqlite3.c:102762:20: */ return exprIsConst(tls, p, 3, iCur) } // sqlite3WalkExpr() callback used by sqlite3ExprIsConstantOrGroupBy(). -func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101844:12: */ +func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:102770:12: */ var pGroupBy uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var i int32 @@ -80289,7 +80961,7 @@ func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) } // Check if pExpr is a sub-select. If so, consider it variable. - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort } @@ -80314,7 +80986,7 @@ func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) // 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 Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, pGroupBy uintptr) int32 { /* sqlite3.c:101888:20: */ +func Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, pGroupBy uintptr) int32 { /* sqlite3.c:102814:20: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -80350,7 +81022,7 @@ func Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, p // 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 Xsqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit U8) int32 { /* sqlite3.c:101920:20: */ +func Xsqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit U8) int32 { /* sqlite3.c:102846:20: */ return exprIsConst(tls, p, (4 + int32(isInit)), 0) } @@ -80359,7 +81031,7 @@ func Xsqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit U8) int32 // 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 Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /* sqlite3.c:101949:20: */ +func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /* sqlite3.c:102875:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -80371,7 +81043,7 @@ func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /* // If an expression is an integer literal that fits in a signed 32-bit // integer, then the EP_IntValue flag will have already been set - if ((*Expr)(unsafe.Pointer(p)).Fflags & EP_IntValue) != 0 { + if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_IntValue)) != 0 { *(*int32)(unsafe.Pointer(pValue)) = *(*int32)(unsafe.Pointer(p + 8 /* &.u */)) return 1 } @@ -80412,7 +81084,7 @@ func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /* // 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 Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101995:20: */ +func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:102921:20: */ var op U8 for (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UPLUS) || (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UMINUS) { p = (*Expr)(unsafe.Pointer(p)).FpLeft @@ -80431,7 +81103,7 @@ func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101995 case TK_BLOB: return 0 case TK_COLUMN: - return (libc.Bool32(((((*Expr)(unsafe.Pointer((p))).Fflags & (EP_CanBeNull)) != U32(0)) || (*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) == uintptr(0))) || (((int32((*Expr)(unsafe.Pointer(p)).FiColumn) >= 0) && + return (libc.Bool32(((((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_CanBeNull))) != U32(0)) || (*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) == uintptr(0))) || (((int32((*Expr)(unsafe.Pointer(p)).FiColumn) >= 0) && ((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)))).FaCol != uintptr(0))) && // Defense against OOM problems (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)))).FaCol+uintptr((*Expr)(unsafe.Pointer(p)).FiColumn)*32)).FnotNull) == 0)))) default: @@ -80448,7 +81120,7 @@ func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101995 // can be omitted. When in doubt return FALSE. A false negative // is harmless. A false positive, however, can result in the wrong // answer. -func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) int32 { /* sqlite3.c:102029:20: */ +func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) int32 { /* sqlite3.c:102955:20: */ var op U8 var unaryMinus int32 = 0 if int32(aff) == SQLITE_AFF_BLOB { @@ -80501,14 +81173,14 @@ func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) int32 } // Return TRUE if the given string is a row-id column name. -func Xsqlite3IsRowid(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:102065:20: */ - if Xsqlite3StrICmp(tls, z, ts+6504 /* "_ROWID_" */) == 0 { +func Xsqlite3IsRowid(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:102991:20: */ + if Xsqlite3StrICmp(tls, z, ts+6549 /* "_ROWID_" */) == 0 { return 1 } - if Xsqlite3StrICmp(tls, z, ts+6512 /* "ROWID" */) == 0 { + if Xsqlite3StrICmp(tls, z, ts+6557 /* "ROWID" */) == 0 { return 1 } - if Xsqlite3StrICmp(tls, z, ts+6518 /* "OID" */) == 0 { + if Xsqlite3StrICmp(tls, z, ts+6563 /* "OID" */) == 0 { return 1 } return 0 @@ -80519,16 +81191,16 @@ func Xsqlite3IsRowid(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:102065:20: * // a pointer to the SELECT statement. If pX is not a SELECT statement, // or if the SELECT statement needs to be manifested into a transient // table, then return NULL. -func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:102080:15: */ +func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:103006:15: */ var p uintptr var pSrc uintptr var pEList uintptr var pTab uintptr var i int32 - if !(((*Expr)(unsafe.Pointer((pX))).Fflags & (EP_xIsSelect)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_xIsSelect))) != U32(0)) { return uintptr(0) } // Not a subquery - if ((*Expr)(unsafe.Pointer((pX))).Fflags & (EP_VarSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_VarSelect))) != U32(0) { return uintptr(0) } // Correlated subq p = *(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)) @@ -80551,10 +81223,10 @@ func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:10208 if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc != 1 { return uintptr(0) } // Single term in FROM clause - if (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpSelect != 0 { + if (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpSelect != 0 { return uintptr(0) } // FROM is not a subquery or view - pTab = (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab + pTab = (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab // FROM clause is not a view if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { @@ -80577,19 +81249,19 @@ func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:10208 // it contains any NULL entries. Cause the register at regHasNull to be set // to a non-NULL value if iCur contains no NULLs. Cause register regHasNull // to be set to NULL if iCur contains one or more NULL values. -func sqlite3SetHasNullFlag(tls *libc.TLS, v uintptr, iCur int32, regHasNull int32) { /* sqlite3.c:102125:13: */ +func sqlite3SetHasNullFlag(tls *libc.TLS, v uintptr, iCur int32, regHasNull int32) { /* sqlite3.c:103051:13: */ var addr1 int32 Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regHasNull) addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iCur) Xsqlite3VdbeAddOp3(tls, v, OP_Column, iCur, 0, regHasNull) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_TYPEOFARG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG)) Xsqlite3VdbeJumpHere(tls, v, addr1) } // The argument is an IN operator with a list (not a subquery) on the // right-hand side. Return TRUE if that list is constant. -func sqlite3InRhsIsConstant(tls *libc.TLS, pIn uintptr) int32 { /* sqlite3.c:102142:12: */ +func sqlite3InRhsIsConstant(tls *libc.TLS, pIn uintptr) int32 { /* sqlite3.c:103068:12: */ var pLHS uintptr var res int32 @@ -80678,7 +81350,7 @@ func sqlite3InRhsIsConstant(tls *libc.TLS, pIn uintptr) int32 { /* sqlite3.c:102 // CREATE INDEX i1 ON t1(b, c, a); // // then aiMap[] is populated with {2, 0, 1}. -func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, prRhsHasNull uintptr, aiMap uintptr, piTab uintptr) int32 { /* sqlite3.c:102235:20: */ +func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, prRhsHasNull uintptr, aiMap uintptr, piTab uintptr) int32 { /* sqlite3.c:103161:20: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -80688,14 +81360,14 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, var mustBeUnique int32 // True if RHS must be unique var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Virtual machine being coded - mustBeUnique = (libc.Bool32((inFlags & IN_INDEX_LOOP) != U32(0))) + mustBeUnique = (libc.Bool32((inFlags & U32(IN_INDEX_LOOP)) != U32(0))) // If the RHS of this IN(...) operator is a SELECT, and if it matters // whether or not the SELECT result contains NULL values, check whether // or not NULL is actually possible (it may not be, for example, due // to NOT NULL constraints in the schema). If no NULL values are possible, // set prRhsHasNull to 0 before continuing. - if (prRhsHasNull != 0) && (((*Expr)(unsafe.Pointer(pX)).Fflags & EP_xIsSelect) != 0) { + if (prRhsHasNull != 0) && (((*Expr)(unsafe.Pointer(pX)).Fflags & U32(EP_xIsSelect)) != 0) { var i int32 var pEList uintptr = (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FpEList for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ { @@ -80721,7 +81393,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, // Because of isCandidateForInOpt(p) // Because of isCandidateForInOpt(p) // Because of isCandidateForInOpt(p) - pTab = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab + pTab = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab // Code an OP_Transaction and OP_TableLock for . iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) @@ -80736,7 +81408,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, Xsqlite3OpenTable(tls, pParse, iTab, iDb, pTab, OP_OpenRead) eType = IN_INDEX_ROWID - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+6522 /* "USING ROWID SEAR..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+6567 /* "USING ROWID SEAR..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) Xsqlite3VdbeJumpHere(tls, v, iAddr) } else { var pIdx uintptr // Iterator variable @@ -80827,7 +81499,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, if colUsed == ((Bitmask((uint64(1))) << (nExpr)) - uint64(1)) { // If we reach this point, that means the index pIdx is usable var iAddr int32 = Xsqlite3VdbeAddOp0(tls, v, OP_Once) - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+6569 /* "USING INDEX %s F..." */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIdx)).FzName)) + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+6614 /* "USING INDEX %s F..." */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIdx)).FzName)) Xsqlite3VdbeAddOp3(tls, v, OP_OpenRead, iTab, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb) Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx) @@ -80853,8 +81525,8 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, // then it is not worth creating an ephemeral table to evaluate // the IN operator so return IN_INDEX_NOOP. if (((eType == 0) && - ((inFlags & IN_INDEX_NOOP_OK) != 0)) && - !(((*Expr)(unsafe.Pointer((pX))).Fflags & (EP_xIsSelect)) != U32(0))) && + ((inFlags & U32(IN_INDEX_NOOP_OK)) != 0)) && + !(((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_xIsSelect))) != U32(0))) && (!(sqlite3InRhsIsConstant(tls, pX) != 0) || ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FnExpr <= 2)) { eType = IN_INDEX_NOOP } @@ -80865,7 +81537,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, var savedNQueryLoop U32 = (*Parse)(unsafe.Pointer(pParse)).FnQueryLoop var rMayHaveNull int32 = 0 eType = IN_INDEX_EPH - if (inFlags & IN_INDEX_LOOP) != 0 { + if (inFlags & U32(IN_INDEX_LOOP)) != 0 { (*Parse)(unsafe.Pointer(pParse)).FnQueryLoop = U32(0) } else if prRhsHasNull != 0 { *(*int32)(unsafe.Pointer(prRhsHasNull)) = libc.AssignInt32(&rMayHaveNull, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)) @@ -80896,11 +81568,11 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, // // It is the responsibility of the caller to ensure that the returned // string is eventually freed using sqlite3DbFree(). -func exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:102458:13: */ +func exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:103384:13: */ var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft var nVal int32 = Xsqlite3ExprVectorSize(tls, pLeft) var pSelect uintptr - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_xIsSelect)) != 0 { pSelect = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) } else { pSelect = uintptr(0) @@ -80928,12 +81600,12 @@ func exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* s // message of the form: // // "sub-select returns N columns - expected M" -func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpect int32) { /* sqlite3.c:102490:21: */ +func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpect int32) { /* sqlite3.c:103416:21: */ bp := tls.Alloc(16) defer tls.Free(16) if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 { - var zFmt uintptr = ts + 6600 /* "sub-select retur..." */ + var zFmt uintptr = ts + 6645 /* "sub-select retur..." */ Xsqlite3ErrorMsg(tls, pParse, zFmt, libc.VaList(bp, nActual, nExpect)) } } @@ -80947,11 +81619,11 @@ func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpec // Or, if it is a regular scalar vector: // // "row value misused" -func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:102509:21: */ - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_xIsSelect) != 0 { +func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:103435:21: */ + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_xIsSelect)) != 0 { Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList)).FnExpr, 1) } else { - Xsqlite3ErrorMsg(tls, pParse, ts+5372 /* "row value misuse..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+5417 /* "row value misuse..." */, 0) } } @@ -80975,7 +81647,7 @@ func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* s // if either column has NUMERIC or INTEGER affinity. If neither // 'x' nor the SELECT... statement are columns, then numeric affinity // is used. -func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int32) { /* sqlite3.c:102543:21: */ +func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int32) { /* sqlite3.c:103469:21: */ bp := tls.Alloc(65) defer tls.Free(65) @@ -80997,14 +81669,14 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 // // If all of the above are false, then we can compute the RHS just once // and reuse it many names. - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_VarSelect)) != U32(0)) && ((*Parse)(unsafe.Pointer(pParse)).FiSelfTab == 0) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_VarSelect))) != U32(0)) && ((*Parse)(unsafe.Pointer(pParse)).FiSelfTab == 0) { // Reuse of the RHS is allowed // If this routine has already been coded, but the previous code // might not have been invoked yet, so invoke it now as a subroutine. - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Subrtn)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subrtn))) != U32(0) { addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+6644 /* "REUSE LIST SUBQU..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FselId)) + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+6689 /* "REUSE LIST SUBQU..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FselId)) } Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)), *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */))) @@ -81014,7 +81686,7 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 } // Begin coding the subroutine - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Subrtn) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Subrtn)) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */)) = (Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */))) + 1) @@ -81032,7 +81704,7 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 addr = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Expr)(unsafe.Pointer(pExpr)).FiTable, nVal) pKeyInfo = Xsqlite3KeyInfoAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, nVal, 1) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { // Case 1: expr IN (SELECT ...) // // Generate code to write the results of the select into the temporary @@ -81040,11 +81712,11 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) var pEList uintptr = (*Select)(unsafe.Pointer(pSelect)).FpEList - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+6667 /* "%sLIST SUBQUERY ..." */, libc.VaList(bp+8, func() uintptr { + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+6712 /* "%sLIST SUBQUERY ..." */, libc.VaList(bp+8, func() uintptr { if addrOnce != 0 { return ts + 703 /* "" */ } - return ts + 6686 /* "CORRELATED " */ + return ts + 6731 /* "CORRELATED " */ }(), (*Select)(unsafe.Pointer(pSelect)).FselId)) // If the LHS and RHS of the IN operator do not match, that // error will have been caught long before we reach this point. @@ -81087,9 +81759,9 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 var r2 int32 *(*int8)(unsafe.Pointer(bp + 64 /* affinity */)) = Xsqlite3ExprAffinity(tls, pLeft) if int32(*(*int8)(unsafe.Pointer(bp + 64 /* affinity */))) <= SQLITE_AFF_NONE { - *(*int8)(unsafe.Pointer(bp + 64 /* affinity */)) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(bp + 64 /* affinity */)) = int8(SQLITE_AFF_BLOB) } else if int32(*(*int8)(unsafe.Pointer(bp + 64 /* affinity */))) == SQLITE_AFF_REAL { - *(*int8)(unsafe.Pointer(bp + 64 /* affinity */)) = SQLITE_AFF_NUMERIC + *(*int8)(unsafe.Pointer(bp + 64 /* affinity */)) = int8(SQLITE_AFF_NUMERIC) } if pKeyInfo != 0 { @@ -81159,7 +81831,7 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 // the result is stored in a contiguous array of registers and the // return value is the register of the left-most result column. // Return 0 if an error occurs. -func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:102731:20: */ +func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:103657:20: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -81184,18 +81856,18 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { // // If all of the above are false, then we can run this code just once // save the results, and reuse the same result on subsequent invocations. - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_VarSelect)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_VarSelect))) != U32(0)) { // If this routine has already been coded, then invoke it as a // subroutine. - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Subrtn)) != U32(0) { - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+6698 /* "REUSE SUBQUERY %..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId)) + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subrtn))) != U32(0) { + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+6743 /* "REUSE SUBQUERY %..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId)) Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)), *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */))) return (*Expr)(unsafe.Pointer(pExpr)).FiTable } // Begin coding the subroutine - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Subrtn) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Subrtn)) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */)) = (Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */))) + 1) @@ -81211,11 +81883,11 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { // // In both cases, the query is augmented with "LIMIT 1". Any // preexisting limit is discarded in place of the new LIMIT 1. - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+6716 /* "%sSCALAR SUBQUER..." */, libc.VaList(bp+8, func() uintptr { + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+6761 /* "%sSCALAR SUBQUER..." */, libc.VaList(bp+8, func() uintptr { if addrOnce != 0 { return ts + 703 /* "" */ } - return ts + 6686 /* "CORRELATED " */ + return ts + 6731 /* "CORRELATED " */ }(), (*Select)(unsafe.Pointer(pSel)).FselId)) if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT { nReg = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpEList)).FnExpr @@ -81225,13 +81897,13 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { Xsqlite3SelectDestInit(tls, bp+24 /* &dest */, 0, ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)) *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (nReg) if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT { - (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = SRT_Mem + (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = U8(SRT_Mem) (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FiSdst = (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FiSDParm (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FnSdst = nReg Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm, (((*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm + nReg) - 1)) } else { - (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = SRT_Exists + (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = U8(SRT_Exists) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm) } @@ -81239,9 +81911,9 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { // The subquery already has a limit. If the pre-existing limit is X // then make the new limit X<>0 so that the new limit is either 1 or 0 var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - pLimit = Xsqlite3Expr(tls, db, TK_INTEGER, ts+6319 /* "0" */) + pLimit = Xsqlite3Expr(tls, db, TK_INTEGER, ts+6375 /* "0" */) if pLimit != 0 { - (*Expr)(unsafe.Pointer(pLimit)).FaffExpr = SQLITE_AFF_NUMERIC + (*Expr)(unsafe.Pointer(pLimit)).FaffExpr = int8(SQLITE_AFF_NUMERIC) pLimit = Xsqlite3PExpr(tls, pParse, TK_NE, Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) } @@ -81249,7 +81921,7 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { // If there is no pre-existing limit add a limit of 1 - pLimit = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, ts+6737 /* "1" */) + pLimit = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, ts+6782 /* "1" */) (*Select)(unsafe.Pointer(pSel)).FpLimit = Xsqlite3PExpr(tls, pParse, TK_LIMIT, pLimit, uintptr(0)) } (*Select)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -81274,9 +81946,9 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { // 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 Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32 { /* sqlite3.c:102846:20: */ +func Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32 { /* sqlite3.c:103772:20: */ var nVector int32 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pIn)).FpLeft) - if ((*Expr)(unsafe.Pointer(pIn)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pIn)).Fflags & U32(EP_xIsSelect)) != 0 { if nVector != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 32 /* &.x */)))).FpEList)).FnExpr { Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 32 /* &.x */)))).FpEList)).FnExpr, nVector) return 1 @@ -81311,7 +81983,7 @@ func Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32 { /* // // See the separate in-operator.md documentation file in the canonical // SQLite source tree for additional information. -func sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFalse int32, destIfNull int32) { /* sqlite3.c:102887:13: */ +func sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFalse int32, destIfNull int32) { /* sqlite3.c:103813:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -81692,14 +82364,14 @@ sqlite3ExprCodeIN_oom_error: // 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 *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32) { /* sqlite3.c:103143:13: */ +func codeReal(tls *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32) { /* sqlite3.c:104069:13: */ bp := tls.Alloc(8) defer tls.Free(8) if z != uintptr(0) { // var value float64 at bp, 8 - Xsqlite3AtoF(tls, z, bp /* &value */, Xsqlite3Strlen30(tls, z), SQLITE_UTF8) + Xsqlite3AtoF(tls, z, bp /* &value */, Xsqlite3Strlen30(tls, z), uint8(SQLITE_UTF8)) // The new AtoF never returns NaN if negateFlag != 0 { *(*float64)(unsafe.Pointer(bp /* value */)) = -*(*float64)(unsafe.Pointer(bp /* value */)) @@ -81712,12 +82384,12 @@ func codeReal(tls *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32) // text z[0..n-1] into register iMem. // // Expr.u.zToken is always UTF8 and zero-terminated. -func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iMem int32) { /* sqlite3.c:103161:13: */ +func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iMem int32) { /* sqlite3.c:104087:13: */ bp := tls.Alloc(24) defer tls.Free(24) var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_IntValue) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_IntValue)) != 0 { var i int32 = *(*int32)(unsafe.Pointer(pExpr + 8 /* &.u */)) if negFlag != 0 { @@ -81732,10 +82404,10 @@ func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iM c = Xsqlite3DecOrHexToI64(tls, z, bp+16 /* &value */) if (((c == 3) && !(negFlag != 0)) || (c == 2)) || ((negFlag != 0) && (*(*I64)(unsafe.Pointer(bp + 16 /* value */)) == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))) { - if Xsqlite3_strnicmp(tls, z, ts+6739 /* "0x" */, 2) == 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+6742 /* "hex literal too ..." */, libc.VaList(bp, func() uintptr { + if Xsqlite3_strnicmp(tls, z, ts+6784 /* "0x" */, 2) == 0 { + Xsqlite3ErrorMsg(tls, pParse, ts+6787 /* "hex literal too ..." */, libc.VaList(bp, func() uintptr { if negFlag != 0 { - return ts + 3882 /* "-" */ + return ts + 3910 /* "-" */ } return ts + 703 /* "" */ }(), z)) @@ -81757,7 +82429,7 @@ func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iM // Generate code that will load into register regOut a value that is // appropriate for the iIdxCol-th column of index pIdx. -func Xsqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr, iTabCur int32, iIdxCol int32, regOut int32) { /* sqlite3.c:103198:21: */ +func Xsqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr, iTabCur int32, iIdxCol int32, regOut int32) { /* sqlite3.c:104124:21: */ var iTabCol I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iIdxCol)*2)) if int32(iTabCol) == (-2) { @@ -81772,7 +82444,7 @@ func Xsqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr // Generate code that will compute the value of generated column pCol // and store the result in register regOut -func Xsqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pCol uintptr, regOut int32) { /* sqlite3.c:103223:21: */ +func Xsqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pCol uintptr, regOut int32) { /* sqlite3.c:104149:21: */ var iAddr int32 var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe @@ -81791,7 +82463,7 @@ func Xsqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pCol uintptr } // Generate code to extract the value of the iCol-th column of a table. -func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iTabCur int32, iCol int32, regOut int32) { /* sqlite3.c:103248:21: */ +func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iTabCur int32, iCol int32, regOut int32) { /* sqlite3.c:104174:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -81812,7 +82484,7 @@ func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT } else if (int32((*Column)(unsafe.Pointer((libc.AssignUintptr(&pCol, ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32))))).FcolFlags) & COLFLAG_VIRTUAL) != 0 { var pParse uintptr = Xsqlite3VdbeParser(tls, v) if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_BUSY) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+6768 /* "generated column..." */, libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+6813 /* "generated column..." */, libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName)) } else { var savedSelfTab int32 = (*Parse)(unsafe.Pointer(pParse)).FiSelfTab *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) |= U16((COLFLAG_BUSY)) @@ -81822,7 +82494,7 @@ func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(COLFLAG_BUSY))) } return - } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { x = int32(Xsqlite3TableColumnToIndex(tls, Xsqlite3PrimaryKeyIndex(tls, pTab), int16(iCol))) op = OP_Column @@ -81841,7 +82513,7 @@ func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT // // 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 Xsqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iColumn int32, iTable int32, iReg int32, p5 U8) int32 { /* sqlite3.c:103305:20: */ +func Xsqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iColumn int32, iTable int32, iReg int32, p5 U8) int32 { /* sqlite3.c:104231:20: */ Xsqlite3ExprCodeGetColumnOfTable(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iTable, iColumn, iReg) if p5 != 0 { @@ -81855,17 +82527,20 @@ func Xsqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iCol // Generate code to move content from registers iFrom...iFrom+nReg-1 // over to iTo..iTo+nReg-1. -func Xsqlite3ExprCodeMove(tls *libc.TLS, pParse uintptr, iFrom int32, iTo int32, nReg int32) { /* sqlite3.c:103326:21: */ +func Xsqlite3ExprCodeMove(tls *libc.TLS, pParse uintptr, iFrom int32, iTo int32, nReg int32) { /* sqlite3.c:104252:21: */ Xsqlite3VdbeAddOp3(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Move, iFrom, iTo, nReg) } // 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 *libc.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:103335:13: */ +func exprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:104261:13: */ var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr) + if p == uintptr(0) { + return + } (*Expr)(unsafe.Pointer(p)).Fop2 = (*Expr)(unsafe.Pointer(p)).Fop - (*Expr)(unsafe.Pointer(p)).Fop = TK_REGISTER + (*Expr)(unsafe.Pointer(p)).Fop = U8(TK_REGISTER) (*Expr)(unsafe.Pointer(p)).FiTable = iReg *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Skip))) } @@ -81878,7 +82553,7 @@ func exprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:103 // 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 *libc.TLS, pParse uintptr, p uintptr, piFreeable uintptr) int32 { /* sqlite3.c:103353:12: */ +func exprCodeVector(tls *libc.TLS, pParse uintptr, p uintptr, piFreeable uintptr) int32 { /* sqlite3.c:104280:12: */ var iResult int32 var nResult int32 = Xsqlite3ExprVectorSize(tls, p) if nResult == 1 { @@ -81901,7 +82576,7 @@ func exprCodeVector(tls *libc.TLS, pParse uintptr, p uintptr, piFreeable uintptr // If the last opcode is a OP_Copy, then set the do-not-merge flag (p5) // so that a subsequent copy will not be merged into this one. -func setDoNotMergeFlagOnCopy(tls *libc.TLS, v uintptr) { /* sqlite3.c:103382:13: */ +func setDoNotMergeFlagOnCopy(tls *libc.TLS, v uintptr) { /* sqlite3.c:104309:13: */ if int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, -1))).Fopcode) == OP_Copy { Xsqlite3VdbeChangeP5(tls, v, uint16(1)) // Tag trailing OP_Copy as not mergable } @@ -81909,7 +82584,7 @@ func setDoNotMergeFlagOnCopy(tls *libc.TLS, v uintptr) { /* sqlite3.c:103382:13: // Generate code to implement special SQL functions that are implemented // in-line rather than by using the usual callbacks. -func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncId int32, target int32) int32 { /* sqlite3.c:103392:12: */ +func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncId int32, target int32) int32 { /* sqlite3.c:104319:12: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -81943,7 +82618,7 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI // var caseExpr Expr at bp, 72 libc.Xmemset(tls, bp /* &caseExpr */, 0, uint64(unsafe.Sizeof(Expr{}))) - (*Expr)(unsafe.Pointer(bp /* &caseExpr */)).Fop = TK_CASE + (*Expr)(unsafe.Pointer(bp /* &caseExpr */)).Fop = U8(TK_CASE) *(*uintptr)(unsafe.Pointer(bp /* &caseExpr */ + 32 /* &.x */)) = pFarg return Xsqlite3ExprCodeTarget(tls, pParse, bp /* &caseExpr */, target) @@ -82015,7 +82690,7 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI // 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 Xsqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) int32 { /* sqlite3.c:103508:20: */ +func Xsqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) int32 { /* sqlite3.c:104435:20: */ bp := tls.Alloc(192) defer tls.Free(192) @@ -82320,7 +82995,7 @@ __57: __5: iTab = (*Expr)(unsafe.Pointer(pExpr)).FiTable - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FixedCol)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) { goto __62 } iReg = Xsqlite3ExprCodeTarget(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, target) @@ -82368,7 +83043,7 @@ __69: if !((int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags) & COLFLAG_BUSY) != 0) { goto __72 } - Xsqlite3ErrorMsg(tls, pParse, ts+6768, /* "generated column..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+6813, /* "generated column..." */ libc.VaList(bp, (*Column)(unsafe.Pointer(pCol1)).FzName)) return 0 __72: @@ -82512,7 +83187,7 @@ __79: r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+44 /* ®Free2 */) codeCompare(tls, pParse, pLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, r1, r2, inReg, (SQLITE_STOREP2 | p5), - (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0)))) + (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0)))) __80: ; @@ -82556,7 +83231,7 @@ __81: return target goto __84 __83: - (*Expr)(unsafe.Pointer(bp + 48 /* &tempX */)).Fop = TK_INTEGER + (*Expr)(unsafe.Pointer(bp + 48 /* &tempX */)).Fop = U8(TK_INTEGER) (*Expr)(unsafe.Pointer(bp + 48 /* &tempX */)).Fflags = (U32(EP_IntValue | EP_TokenOnly)) *(*int32)(unsafe.Pointer(bp + 48 /* &tempX */ + 8 /* &.u */)) = 0 @@ -82609,7 +83284,7 @@ __41: goto __85 } - Xsqlite3ErrorMsg(tls, pParse, ts+6798 /* "misuse of aggreg..." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)))) + Xsqlite3ErrorMsg(tls, pParse, ts+6843 /* "misuse of aggreg..." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)))) goto __86 __85: return (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pInfo)).FaFunc + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiAgg)*24)).FiMem @@ -82623,7 +83298,7 @@ __42: // The function name enc = (*Sqlite3)(unsafe.Pointer(db)).Fenc // The text encoding used by this database pColl = uintptr(0) // A collating sequence - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { goto __87 } return (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FregResult @@ -82651,11 +83326,11 @@ __88: if !((pDef == uintptr(0)) || ((*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0))) { goto __89 } - Xsqlite3ErrorMsg(tls, pParse, ts+6824 /* "unknown function..." */, libc.VaList(bp+16, zId)) + Xsqlite3ErrorMsg(tls, pParse, ts+6869 /* "unknown function..." */, libc.VaList(bp+16, zId)) goto __3 __89: ; - if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_INLINE) != 0) { + if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_INLINE)) != 0) { goto __90 } @@ -82684,7 +83359,7 @@ __93: constMask = constMask | (uint32((uint32(1))) << (i)) __96: ; - if !((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != U32(0)) && !(pColl != 0)) { + if !((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != U32(0)) && !(pColl != 0)) { goto __97 } pColl = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+uintptr(i)*32)).FpExpr) @@ -82748,7 +83423,7 @@ __99: // function. The expression "A glob B" is equivalent to // "glob(B,A). We want to use the A in "A glob B" to test // for function overloading. But we use the B term in "glob(B,A)". - if !((nFarg >= 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_InfixFunc)) != U32(0))) { + if !((nFarg >= 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_InfixFunc))) != U32(0))) { goto __104 } pDef = Xsqlite3VtabOverloadFunction(tls, db, pDef, nFarg, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+1*32)).FpExpr) @@ -82762,7 +83437,7 @@ __106: ; __105: ; - if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0) { + if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0) { goto __107 } if !(!(pColl != 0)) { @@ -82774,7 +83449,7 @@ __108: Xsqlite3VdbeAddOp4(tls, v, OP_CollSeq, 0, 0, 0, pColl, -2) __107: ; - if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_OFFSET) != 0) { + if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_OFFSET)) != 0) { goto __109 } pArg = (*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */))).FpExpr @@ -82845,7 +83520,7 @@ __120: ((*Expr)(unsafe.Pointer(pExpr)).FiTable != (libc.AssignInt32(&n1, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))))) { goto __121 } - Xsqlite3ErrorMsg(tls, pParse, ts+6440, /* "%d columns assig..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+6496, /* "%d columns assig..." */ libc.VaList(bp+24, (*Expr)(unsafe.Pointer(pExpr)).FiTable, n1)) __121: ; @@ -82927,7 +83602,7 @@ __122: goto __3 __52: - Xsqlite3ErrorMsg(tls, pParse, ts+5372 /* "row value misuse..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+5417 /* "row value misuse..." */, 0) goto __3 // TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions @@ -82992,7 +83667,7 @@ __124: exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+40 /* ®Free1 */)) libc.Xmemset(tls, bp+120 /* &opCompare */, 0, uint64(unsafe.Sizeof(Expr{}))) - (*Expr)(unsafe.Pointer(bp + 120 /* &opCompare */)).Fop = TK_EQ + (*Expr)(unsafe.Pointer(bp + 120 /* &opCompare */)).Fop = U8(TK_EQ) (*Expr)(unsafe.Pointer(bp + 120 /* &opCompare */)).FpLeft = pDel pTest = bp + 120 /* &opCompare */ // Ticket b351d95f9cd5ef17e9d9dbae18f5ca8611190001: @@ -83051,7 +83726,7 @@ __55: goto __132 } Xsqlite3ErrorMsg(tls, pParse, - ts+6847 /* "RAISE() may only..." */, 0) + ts+6892 /* "RAISE() may only..." */, 0) return 0 __132: ; @@ -83090,7 +83765,7 @@ __3: return inReg } -var zAff = *(*[8]int8)(unsafe.Pointer(ts + 6897 /* "B\x00C\x00D\x00E" */)) /* sqlite3.c:103573:29 */ +var zAff = *(*[8]int8)(unsafe.Pointer(ts + 6942 /* "B\x00C\x00D\x00E" */)) /* sqlite3.c:104500:29 */ // Generate code that will evaluate expression pExpr just one time // per prepared statement execution. @@ -83107,7 +83782,7 @@ var zAff = *(*[8]int8)(unsafe.Pointer(ts + 6897 /* "B\x00C\x00D\x00E" */)) /* sq // code to the same register, if they do not contain function calls and hence // are factored out into the initialization section at the end of the // prepared statement. -func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, regDest int32) int32 { /* sqlite3.c:104263:20: */ +func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, regDest int32) int32 { /* sqlite3.c:105190:20: */ var p uintptr p = (*Parse)(unsafe.Pointer(pParse)).FpConstExpr @@ -83135,7 +83810,7 @@ func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r __3: } pExpr = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0) - if (pExpr != uintptr(0)) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_HasFunc)) != U32(0)) { + if (pExpr != uintptr(0)) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_HasFunc))) != U32(0)) { var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var addr int32 @@ -83176,10 +83851,11 @@ func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r // 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 Xsqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uintptr) int32 { /* sqlite3.c:104320:20: */ +func Xsqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uintptr) int32 { /* sqlite3.c:105247:20: */ var r2 int32 pExpr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0) && + if ((((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0) && + (pExpr != uintptr(0))) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_REGISTER)) && (Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0) { *(*int32)(unsafe.Pointer(pReg)) = 0 @@ -83200,7 +83876,7 @@ func Xsqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin // Generate code that will evaluate expression pExpr and store the // results in register target. The results are guaranteed to appear // in register target. -func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:104347:21: */ +func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:105275:21: */ var inReg int32 if (*Parse)(unsafe.Pointer(pParse)).FpVdbe == uintptr(0) { @@ -83209,10 +83885,10 @@ func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32 inReg = Xsqlite3ExprCodeTarget(tls, pParse, pExpr, target) if inReg != target { var op U8 - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Subquery)) != U32(0) { - op = OP_Copy + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subquery))) != U32(0) { + op = U8(OP_Copy) } else { - op = OP_SCopy + op = U8(OP_SCopy) } Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, int32(op), inReg, target) } @@ -83221,7 +83897,7 @@ func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32 // Make a transient copy of expression pExpr and then code it using // sqlite3ExprCode(). This routine works just like sqlite3ExprCode() // except that the input expression is guaranteed to be unchanged. -func Xsqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:104371:21: */ +func Xsqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:105299:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb pExpr = Xsqlite3ExprDup(tls, db, pExpr, 0) if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { @@ -83234,7 +83910,7 @@ func Xsqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // 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 Xsqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:104384:21: */ +func Xsqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:105312:21: */ if ((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0) && (Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0) { Xsqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { @@ -83260,16 +83936,16 @@ func Xsqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, ta // in registers at srcReg, and so the value can be copied from there. // If SQLITE_ECEL_OMITREF is also set, then the values with u.x.iOrderByCol>0 // are simply omitted rather than being copied from srcReg. -func Xsqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, target int32, srcReg int32, flags U8) int32 { /* sqlite3.c:104412:20: */ +func Xsqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, target int32, srcReg int32, flags U8) int32 { /* sqlite3.c:105340:20: */ var pItem uintptr var i int32 var j int32 var n int32 var copyOp U8 if (int32(flags) & SQLITE_ECEL_DUP) != 0 { - copyOp = OP_Copy + copyOp = uint8(OP_Copy) } else { - copyOp = OP_SCopy + copyOp = uint8(OP_SCopy) } var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe @@ -83342,7 +84018,7 @@ __3: // sqlite3ExprIfFalse: Jump to dest if false // // The jumpIfNull parameter is ignored if xJumpIf is NULL. -func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { /* sqlite3.c:104487:13: */ +func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { /* sqlite3.c:105415:13: */ bp := tls.Alloc(220) defer tls.Free(220) @@ -83362,13 +84038,13 @@ func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, x pDel = Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, 0) if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { - (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).Fop = TK_AND + (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).Fop = U8(TK_AND) (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).FpLeft = bp /* &compLeft */ (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).FpRight = bp + 72 /* &compRight */ - (*Expr)(unsafe.Pointer(bp /* &compLeft */)).Fop = TK_GE + (*Expr)(unsafe.Pointer(bp /* &compLeft */)).Fop = U8(TK_GE) (*Expr)(unsafe.Pointer(bp /* &compLeft */)).FpLeft = pDel (*Expr)(unsafe.Pointer(bp /* &compLeft */)).FpRight = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + 8 /* &.a */))).FpExpr - (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).Fop = TK_LE + (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).Fop = U8(TK_LE) (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).FpLeft = pDel (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).FpRight = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + 8 /* &.a */) + 1*32)).FpExpr exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+216 /* ®Free1 */)) @@ -83380,7 +84056,7 @@ func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, x // it into the Parse.pConstExpr list. We should use a new bit for this, // for clarity, but we are out of bits in the Expr.flags field so we // have to reuse the EP_FromJoin bit. Bummer. - *(*U32)(unsafe.Pointer(pDel + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(pDel + 4 /* &.flags */)) |= (U32(EP_FromJoin)) Xsqlite3ExprCodeTarget(tls, pParse, bp+144 /* &exprAnd */, dest) } Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 216 /* regFree1 */))) @@ -83403,7 +84079,7 @@ func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, x // 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 Xsqlite3ExprIfTrue(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:104559:21: */ +func Xsqlite3ExprIfTrue(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:105487:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -83565,7 +84241,7 @@ __27: r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp /* ®Free1 */) r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4 /* ®Free2 */) codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, - r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0)))) + r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0)))) goto __3 @@ -83599,13 +84275,13 @@ __19: __20: default_expr: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) { goto __28 } Xsqlite3VdbeGoto(tls, v, dest) goto __29 __28: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { goto __30 } // No-op @@ -83633,7 +84309,7 @@ __3: // 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 Xsqlite3ExprIfFalse(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:104701:21: */ +func Xsqlite3ExprIfFalse(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:105629:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -83817,7 +84493,7 @@ __27: r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp /* ®Free1 */) r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4 /* ®Free2 */) codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, - r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0)))) + r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0)))) goto __3 @@ -83851,13 +84527,13 @@ __29: __20: default_expr: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { goto __30 } Xsqlite3VdbeGoto(tls, v, dest) goto __31 __30: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) { goto __32 } // no-op @@ -83881,7 +84557,7 @@ __3: // 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 Xsqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:104873:21: */ +func Xsqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:105801:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pCopy uintptr = Xsqlite3ExprDup(tls, db, pExpr, 0) if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -83901,7 +84577,7 @@ func Xsqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest i // same as that currently bound to variable pVar, non-zero is returned. // Otherwise, if the values are not the same or if pExpr is not a simple // SQL value, zero is returned. -func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uintptr) int32 { /* sqlite3.c:104895:12: */ +func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uintptr) int32 { /* sqlite3.c:105823:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -83910,11 +84586,11 @@ func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uint var pL uintptr *(*uintptr)(unsafe.Pointer(bp /* pR */)) = uintptr(0) - Xsqlite3ValueFromExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, SQLITE_UTF8, SQLITE_AFF_BLOB, bp /* &pR */) + Xsqlite3ValueFromExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp /* &pR */) if *(*uintptr)(unsafe.Pointer(bp /* pR */)) != 0 { iVar = int32((*Expr)(unsafe.Pointer(pVar)).FiColumn) Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iVar) - pL = Xsqlite3VdbeGetBoundValue(tls, (*Parse)(unsafe.Pointer(pParse)).FpReprepare, iVar, SQLITE_AFF_BLOB) + pL = Xsqlite3VdbeGetBoundValue(tls, (*Parse)(unsafe.Pointer(pParse)).FpReprepare, iVar, uint8(SQLITE_AFF_BLOB)) if pL != 0 { if Xsqlite3_value_type(tls, pL) == SQLITE_TEXT { Xsqlite3_value_text(tls, pL) // Make sure the encoding is UTF-8 @@ -83955,7 +84631,7 @@ func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uint // If pParse is NULL (the normal case) then any TK_VARIABLE term in // Argument pParse should normally be NULL. If it is not NULL and pA or // pB causes a return value of 2. -func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:104947:20: */ +func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:105875:20: */ var combinedFlags U32 if (pA == uintptr(0)) || (pB == uintptr(0)) { if pB == pA { @@ -83967,8 +84643,8 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, return 0 } combinedFlags = ((*Expr)(unsafe.Pointer(pA)).Fflags | (*Expr)(unsafe.Pointer(pB)).Fflags) - if (combinedFlags & EP_IntValue) != 0 { - if ((((*Expr)(unsafe.Pointer(pA)).Fflags & (*Expr)(unsafe.Pointer(pB)).Fflags) & EP_IntValue) != U32(0)) && (*(*int32)(unsafe.Pointer(pA + 8 /* &.u */)) == *(*int32)(unsafe.Pointer(pB + 8 /* &.u */))) { + if (combinedFlags & U32(EP_IntValue)) != 0 { + if ((((*Expr)(unsafe.Pointer(pA)).Fflags & (*Expr)(unsafe.Pointer(pB)).Fflags) & U32(EP_IntValue)) != U32(0)) && (*(*int32)(unsafe.Pointer(pA + 8 /* &.u */)) == *(*int32)(unsafe.Pointer(pB + 8 /* &.u */))) { return 0 } return 2 @@ -83988,10 +84664,10 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, return 2 } - if (libc.Bool32(((*Expr)(unsafe.Pointer((pA))).Fflags & (EP_WinFunc)) != U32(0))) != (libc.Bool32(((*Expr)(unsafe.Pointer((pB))).Fflags & (EP_WinFunc)) != U32(0))) { + if (libc.Bool32(((*Expr)(unsafe.Pointer((pA))).Fflags & (U32(EP_WinFunc))) != U32(0))) != (libc.Bool32(((*Expr)(unsafe.Pointer((pB))).Fflags & (U32(EP_WinFunc))) != U32(0))) { return 2 } - if ((*Expr)(unsafe.Pointer((pA))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pA))).Fflags & (U32(EP_WinFunc))) != U32(0) { if Xsqlite3WindowCompare(tls, pParse, *(*uintptr)(unsafe.Pointer(pA + 64 /* &.y */)), *(*uintptr)(unsafe.Pointer(pB + 64 /* &.y */)), 1) != 0 { return 2 } @@ -84010,11 +84686,11 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, ((*Expr)(unsafe.Pointer(pB)).Fflags & (U32(EP_Distinct | EP_Commuted))) { return 2 } - if (combinedFlags & EP_TokenOnly) == U32(0) { - if (combinedFlags & EP_xIsSelect) != 0 { + if (combinedFlags & U32(EP_TokenOnly)) == U32(0) { + if (combinedFlags & U32(EP_xIsSelect)) != 0 { return 2 } - if ((combinedFlags & EP_FixedCol) == U32(0)) && + if ((combinedFlags & U32(EP_FixedCol)) == U32(0)) && (Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer(pA)).FpLeft, (*Expr)(unsafe.Pointer(pB)).FpLeft, iTab) != 0) { return 2 } @@ -84026,7 +84702,7 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, } if ((int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_STRING) && (int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_TRUEFALSE)) && - ((combinedFlags & EP_Reduced) == U32(0)) { + ((combinedFlags & U32(EP_Reduced)) == U32(0)) { if int32((*Expr)(unsafe.Pointer(pA)).FiColumn) != int32((*Expr)(unsafe.Pointer(pB)).FiColumn) { return 2 } @@ -84055,7 +84731,7 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, // // Two NULL pointers are considered to be the same. But a NULL pointer // always differs from a non-NULL pointer. -func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:105031:20: */ +func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:105959:20: */ var i int32 if (pA == uintptr(0)) && (pB == uintptr(0)) { return 0 @@ -84082,7 +84758,7 @@ func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) // Like sqlite3ExprCompare() except COLLATE operators at the top-level // are ignored. -func Xsqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:105050:20: */ +func Xsqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:105978:20: */ return Xsqlite3ExprCompare(tls, uintptr(0), Xsqlite3ExprSkipCollateAndLikely(tls, pA), Xsqlite3ExprSkipCollateAndLikely(tls, pB), @@ -84093,7 +84769,7 @@ func Xsqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) // // Or if seenNot is true, return non-zero if Expr p can only be // non-NULL if pNN is not NULL -func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, iTab int32, seenNot int32) int32 { /* sqlite3.c:105063:12: */ +func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, iTab int32, seenNot int32) int32 { /* sqlite3.c:105991:12: */ if Xsqlite3ExprCompare(tls, pParse, p, pNN, iTab) == 0 { return (libc.Bool32(int32((*Expr)(unsafe.Pointer(pNN)).Fop) != TK_NULL)) @@ -84101,7 +84777,7 @@ func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, i switch int32((*Expr)(unsafe.Pointer(p)).Fop) { case TK_IN: { - if (seenNot != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0)) { + if (seenNot != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0)) { return 0 } @@ -84217,7 +84893,7 @@ func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, i // 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 Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr, iTab int32) int32 { /* sqlite3.c:105159:20: */ +func Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr, iTab int32) int32 { /* sqlite3.c:106087:20: */ if Xsqlite3ExprCompare(tls, pParse, pE1, pE2, iTab) == 0 { return 1 } @@ -84240,9 +84916,9 @@ func Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uin // This routine controls an optimization. False positives (setting // pWalker->eCode to 1 when it should not be) are deadly, but false-negatives // (never setting pWalker->eCode) is a harmless missed optimization. -func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105186:12: */ +func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106114:12: */ - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { return WRC_Prune } switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) { @@ -84346,7 +85022,7 @@ func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* // clause requires that some column of the right table of the LEFT JOIN // be non-NULL, then the LEFT JOIN can be safely converted into an // ordinary join. -func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32 { /* sqlite3.c:105291:20: */ +func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32 { /* sqlite3.c:106219:20: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -84380,7 +85056,7 @@ func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32 { // 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 *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105329:12: */ +func exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106257:12: */ if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*IdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FiCur)) && (int32(Xsqlite3TableColumnToIndex(tls, (*IdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FpIdx, (*Expr)(unsafe.Pointer(pExpr)).FiColumn)) < 0) { @@ -84398,7 +85074,7 @@ func exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqli // 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 Xsqlite3ExprCoveredByIndex(tls *libc.TLS, pExpr uintptr, iCur int32, pIdx uintptr) int32 { /* sqlite3.c:105350:20: */ +func Xsqlite3ExprCoveredByIndex(tls *libc.TLS, pExpr uintptr, iCur int32, pIdx uintptr) int32 { /* sqlite3.c:106278:20: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -84421,16 +85097,16 @@ func Xsqlite3ExprCoveredByIndex(tls *libc.TLS, pExpr uintptr, iCur int32, pIdx u // SELECT with a FROM clause encountered during this iteration, set // SrcCount.iSrcInner to the cursor number of the leftmost object in // the FROM cause. -func selectSrcCount(tls *libc.TLS, pWalker uintptr, pSel uintptr) int32 { /* sqlite3.c:105386:12: */ +func selectSrcCount(tls *libc.TLS, pWalker uintptr, pSel uintptr) int32 { /* sqlite3.c:106314:12: */ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) if (((*SrcCount)(unsafe.Pointer(p)).FiSrcInner == 0x7FFFFFFF) && ((*Select)(unsafe.Pointer(pSel)).FpSrc != 0)) && ((*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpSrc)).FnSrc != 0) { - (*SrcCount)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FiSrcInner = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSel)).FpSrc + 8 /* &.a */))).FiCursor + (*SrcCount)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FiSrcInner = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSel)).FpSrc + 8 /* &.a */))).FiCursor } return WRC_Continue } // Count the number of references to columns. -func exprSrcCount(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105397:12: */ +func exprSrcCount(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106325:12: */ // There was once a NEVER() on the second term on the grounds that // sqlite3FunctionUsesThisSrc() was always called before // sqlite3ExprAnalyzeAggregates() and so the TK_COLUMNs have not yet @@ -84448,7 +85124,7 @@ func exprSrcCount(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqli nSrc = 0 } for i = 0; i < nSrc; i++ { - if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FiCursor { + if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FiCursor { break } } @@ -84468,7 +85144,7 @@ func exprSrcCount(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqli // 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 Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) int32 { /* sqlite3.c:105430:20: */ +func Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) int32 { /* sqlite3.c:106358:20: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -84487,14 +85163,14 @@ func Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) (*SrcCount)(unsafe.Pointer(bp + 48 /* &cnt */)).FpSrc = pSrcList (*SrcCount)(unsafe.Pointer(bp + 48 /* &cnt */)).FiSrcInner = func() int32 { if (pSrcList != 0) && ((*SrcList)(unsafe.Pointer(pSrcList)).FnSrc != 0) { - return (*SrcList_item)(unsafe.Pointer((pSrcList + 8 /* &.a */))).FiCursor + return (*SrcItem)(unsafe.Pointer((pSrcList + 8 /* &.a */))).FiCursor } return 0x7FFFFFFF }() (*SrcCount)(unsafe.Pointer(bp + 48 /* &cnt */)).FnThis = 0 (*SrcCount)(unsafe.Pointer(bp + 48 /* &cnt */)).FnOther = 0 Xsqlite3WalkExprList(tls, bp /* &w */, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { Xsqlite3WalkExpr(tls, bp /* &w */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter) } return (libc.Bool32(((*SrcCount)(unsafe.Pointer(bp+48 /* &cnt */)).FnThis > 0) || ((*SrcCount)(unsafe.Pointer(bp+48 /* &cnt */)).FnOther == 0))) @@ -84511,7 +85187,7 @@ func Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) // This will cause the expression to be deleted automatically when the // Parse object is destroyed, but the zero register number means that it // will not generate any code in the preamble. -func agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105464:12: */ +func agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106392:12: */ if (!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_TokenOnly | EP_Reduced))) != U32(0))) && ((*Expr)(unsafe.Pointer(pExpr)).FpAggInfo != uintptr(0)) { var pAggInfo uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo @@ -84544,7 +85220,7 @@ func agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { // Initialize a Walker object so that will persist AggInfo entries referenced // by the tree that is walked. -func Xsqlite3AggInfoPersistWalkerInit(tls *libc.TLS, pWalker uintptr, pParse uintptr) { /* sqlite3.c:105502:21: */ +func Xsqlite3AggInfoPersistWalkerInit(tls *libc.TLS, pWalker uintptr, pParse uintptr) { /* sqlite3.c:106430:21: */ libc.Xmemset(tls, pWalker, 0, uint64(unsafe.Sizeof(Walker{}))) (*Walker)(unsafe.Pointer(pWalker)).FpParse = pParse (*Walker)(unsafe.Pointer(pWalker)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { @@ -84557,7 +85233,7 @@ func Xsqlite3AggInfoPersistWalkerInit(tls *libc.TLS, pWalker uintptr, pParse uin // 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 *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:105513:12: */ +func addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:106441:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -84574,7 +85250,7 @@ func addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlit // 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 *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:105529:12: */ +func addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:106457:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -84592,7 +85268,7 @@ func addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3 // This is the xExprCallback for a tree walker. It is used to // implement sqlite3ExprAnalyzeAggregates(). See sqlite3ExprAnalyzeAggregates // for additional information. -func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105546:12: */ +func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106474:12: */ var i int32 var pNC uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pParse uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpParse @@ -84617,7 +85293,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* { var pCol uintptr - if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor { + if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer(pItem)).FiCursor { // If we reach this point, it means that pExpr refers to a table // that is in the FROM clause of the aggregate query. // @@ -84690,7 +85366,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* // pAggInfo->aCol[] entry. (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_AGG_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_AGG_COLUMN) (*Expr)(unsafe.Pointer(pExpr)).FiAgg = I16(k) goto __3 } // endif pExpr->iTable==pItem->iCursor @@ -84751,7 +85427,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* } return 0 }(), enc, uint8(0)) - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_Distinct) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_Distinct)) != 0 { (*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) } else { (*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = -1 @@ -84779,7 +85455,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* // // This routine should only be called after the expression has been // analyzed by sqlite3ResolveExprNames(). -func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr) { /* sqlite3.c:105682:21: */ +func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr) { /* sqlite3.c:106610:21: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -84805,7 +85481,7 @@ func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr) { // expression list. Return the number of errors. // // If an error is found, the analysis is cut short. -func Xsqlite3ExprAnalyzeAggList(tls *libc.TLS, pNC uintptr, pList uintptr) { /* sqlite3.c:105700:21: */ +func Xsqlite3ExprAnalyzeAggList(tls *libc.TLS, pNC uintptr, pList uintptr) { /* sqlite3.c:106628:21: */ var pItem uintptr var i int32 if pList != 0 { @@ -84830,26 +85506,26 @@ func Xsqlite3ExprAnalyzeAggList(tls *libc.TLS, pNC uintptr, pList uintptr) { /* } // Allocate a single new register for use to hold some intermediate result. -func Xsqlite3GetTempReg(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:105713:20: */ +func Xsqlite3GetTempReg(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:106641:20: */ if int32((*Parse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { return libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) } - return *(*int32)(unsafe.Pointer((pParse + 212 /* &.aTempReg */) + uintptr(libc.PreDecUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4)) + return *(*int32)(unsafe.Pointer((pParse + 208 /* &.aTempReg */) + uintptr(libc.PreDecUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4)) } // Deallocate a register, making available for reuse for some other // purpose. -func Xsqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { /* sqlite3.c:105724:21: */ +func Xsqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { /* sqlite3.c:106652:21: */ if iReg != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FnTempReg) < (int32(uint64(unsafe.Sizeof([8]int32{})) / uint64(unsafe.Sizeof(int32(0))))) { - *(*int32)(unsafe.Pointer((pParse + 212 /* &.aTempReg */) + uintptr(libc.PostIncUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4)) = iReg + *(*int32)(unsafe.Pointer((pParse + 208 /* &.aTempReg */) + uintptr(libc.PostIncUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4)) = iReg } } } // Allocate or deallocate a block of nReg consecutive registers. -func Xsqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) int32 { /* sqlite3.c:105736:20: */ +func Xsqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) int32 { /* sqlite3.c:106664:20: */ var i int32 var n int32 if nReg == 1 { @@ -84867,7 +85543,7 @@ func Xsqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) int32 { /* return i } -func Xsqlite3ReleaseTempRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { /* sqlite3.c:105750:21: */ +func Xsqlite3ReleaseTempRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { /* sqlite3.c:106678:21: */ if nReg == 1 { Xsqlite3ReleaseTempReg(tls, pParse, iReg) return @@ -84885,7 +85561,7 @@ func Xsqlite3ReleaseTempRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg in // that might be invoked from other parts of the code, to ensure that // the sub/co-routine does not use registers in common with the code that // invokes the sub/co-routine. -func Xsqlite3ClearTempRegCache(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:105770:21: */ +func Xsqlite3ClearTempRegCache(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:106698:21: */ (*Parse)(unsafe.Pointer(pParse)).FnTempReg = U8(0) (*Parse)(unsafe.Pointer(pParse)).FnRangeReg = 0 } @@ -84919,14 +85595,14 @@ func Xsqlite3ClearTempRegCache(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:105 // 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 isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:105830:12: */ +func isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:106758:12: */ bp := tls.Alloc(8) defer tls.Free(8) - if (0 == Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+6905 /* "sqlite_" */, 7)) || - ((((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Shadow) != U32(0)) && + if (0 == Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+6950 /* "sqlite_" */, 7)) || + ((((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Shadow)) != U32(0)) && (Xsqlite3ReadOnlyShadowTables(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb) != 0)) { - Xsqlite3ErrorMsg(tls, pParse, ts+6913 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+6958 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) return 1 } return 0 @@ -84937,40 +85613,41 @@ func isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sq // called at the end of the generation of an ALTER TABLE ... RENAME ... // statement to ensure that the operation has not rendered any schema // objects unusable. -func renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { /* sqlite3.c:105851:13: */ - bp := tls.Alloc(32) - defer tls.Free(32) +func renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr) { /* sqlite3.c:106779:13: */ + bp := tls.Alloc(48) + defer tls.Free(48) + (*Parse)(unsafe.Pointer(pParse)).FcolNamesSet = U8(1) Xsqlite3NestedParse(tls, pParse, - ts+6941, /* "SELECT 1 FROM \"%..." */ + ts+6986, /* "SELECT 1 FROM \"%..." */ libc.VaList(bp, zDb, - zDb, bTemp)) + zDb, bTemp, zWhen)) if bTemp == 0 { Xsqlite3NestedParse(tls, pParse, - ts+7108, /* "SELECT 1 FROM te..." */ - libc.VaList(bp+24, zDb)) + ts+7157, /* "SELECT 1 FROM te..." */ + libc.VaList(bp+32, zDb, zWhen)) } } // Generate code to reload the schema for database iDb. And, if iDb!=1, for // the temp database as well. -func renameReloadSchema(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:105878:13: */ +func renameReloadSchema(tls *libc.TLS, pParse uintptr, iDb int32, p5 U16) { /* sqlite3.c:106812:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe if v != 0 { Xsqlite3ChangeCookie(tls, pParse, iDb) - Xsqlite3VdbeAddParseSchemaOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iDb, uintptr(0)) + Xsqlite3VdbeAddParseSchemaOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iDb, uintptr(0), p5) if iDb != 1 { - Xsqlite3VdbeAddParseSchemaOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, 1, uintptr(0)) + Xsqlite3VdbeAddParseSchemaOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, 1, uintptr(0), p5) } } } // Generate code to implement the "ALTER TABLE xxx RENAME TO yyy" // command. -func Xsqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr) { /* sqlite3.c:105891:21: */ +func Xsqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr) { /* sqlite3.c:106825:21: */ bp := tls.Alloc(184) defer tls.Free(184) @@ -85006,7 +85683,7 @@ __2: ; iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema) zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_PreferBuiltin) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_PreferBuiltin)) // Get a NULL terminated version of the new table name. zName = Xsqlite3NameFromToken(tls, db, pName) @@ -85025,7 +85702,7 @@ __3: goto __4 } Xsqlite3ErrorMsg(tls, pParse, - ts+7274 /* "there is already..." */, libc.VaList(bp, zName)) + ts+7327 /* "there is already..." */, libc.VaList(bp, zName)) goto exit_rename_table __4: ; @@ -85038,7 +85715,7 @@ __4: goto exit_rename_table __5: ; - if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+7333 /* "table" */, zName)) { + if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+7386 /* "table" */, zName)) { goto __6 } goto exit_rename_table @@ -85048,7 +85725,7 @@ __6: if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) { goto __7 } - Xsqlite3ErrorMsg(tls, pParse, ts+7339 /* "view %s may not ..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+7392 /* "view %s may not ..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table __7: ; @@ -85101,24 +85778,24 @@ __12: // the schema to use the new table name. Xsqlite3NestedParse(tls, pParse, - ts+7366 /* "UPDATE \"%w\".sqli..." */, libc.VaList(bp+16, zDb, zDb, zTabName, zName, (libc.Bool32(iDb == 1)), zTabName)) + ts+7419 /* "UPDATE \"%w\".sqli..." */, libc.VaList(bp+16, zDb, zDb, zTabName, zName, (libc.Bool32(iDb == 1)), zTabName)) // Update the tbl_name and name columns of the sqlite_schema table // as required. Xsqlite3NestedParse(tls, pParse, - ts+7550, /* "UPDATE %Q.sqlite..." */ + ts+7603, /* "UPDATE %Q.sqlite..." */ libc.VaList(bp+64, zDb, zName, zName, zName, nTabName, zTabName)) // If the sqlite_sequence table exists in this database, then update // it with the new table name. - if !(Xsqlite3FindTable(tls, db, ts+7855 /* "sqlite_sequence" */, zDb) != 0) { + if !(Xsqlite3FindTable(tls, db, ts+7908 /* "sqlite_sequence" */, zDb) != 0) { goto __13 } Xsqlite3NestedParse(tls, pParse, - ts+7871, /* "UPDATE \"%w\".sqli..." */ + ts+7924, /* "UPDATE \"%w\".sqli..." */ libc.VaList(bp+112, zDb, zName, (*Table)(unsafe.Pointer(pTab)).FzName)) __13: ; @@ -85131,7 +85808,7 @@ __13: } Xsqlite3NestedParse(tls, pParse, - ts+7929 /* "UPDATE sqlite_te..." */, libc.VaList(bp+136, zDb, zTabName, zName, zTabName, zDb, zName)) + ts+7982 /* "UPDATE sqlite_te..." */, libc.VaList(bp+136, zDb, zTabName, zName, zTabName, zDb, zName)) __14: ; @@ -85148,8 +85825,8 @@ __14: __15: ; - renameReloadSchema(tls, pParse, iDb) - renameTestSchema(tls, pParse, zDb, (libc.Bool32(iDb == 1))) + renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) + renameTestSchema(tls, pParse, zDb, (libc.Bool32(iDb == 1)), ts+8246 /* "after rename" */) exit_rename_table: Xsqlite3SrcListDelete(tls, db, pSrc) @@ -85159,12 +85836,12 @@ exit_rename_table: // Write code that will raise an error if the table described by // zDb and zTab is not empty. -func sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { /* sqlite3.c:106064:13: */ +func sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { /* sqlite3.c:106998:13: */ bp := tls.Alloc(24) defer tls.Free(24) Xsqlite3NestedParse(tls, pParse, - ts+8183, /* "SELECT raise(ABO..." */ + ts+8259, /* "SELECT raise(ABO..." */ libc.VaList(bp, zErr, zDb, zTab)) } @@ -85174,7 +85851,7 @@ func sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uin // // The Table structure pParse->pNewTable was extended to include // the new column during parsing. -func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr) { /* sqlite3.c:106084:21: */ +func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr) { /* sqlite3.c:107018:21: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -85212,12 +85889,12 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr // If there is a NOT NULL constraint, then the default value for the // column must not be NULL. if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_PRIMKEY) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+8221 /* "Cannot add a PRI..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+8297 /* "Cannot add a PRI..." */, 0) return } if (*Table)(unsafe.Pointer(pNew)).FpIndex != 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+8253 /* "Cannot add a UNI..." */, 0) + ts+8329 /* "Cannot add a UNI..." */, 0) return } if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_GENERATED) == 0 { @@ -85228,13 +85905,13 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr if (pDflt != 0) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pDflt)).FpLeft)).Fop) == TK_NULL) { pDflt = uintptr(0) } - if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) && ((*Table)(unsafe.Pointer(pNew)).FpFKey != 0)) && (pDflt != 0) { + if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) && ((*Table)(unsafe.Pointer(pNew)).FpFKey != 0)) && (pDflt != 0) { sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, - ts+8280 /* "Cannot add a REF..." */) + ts+8356 /* "Cannot add a REF..." */) } if ((*Column)(unsafe.Pointer(pCol)).FnotNull != 0) && !(pDflt != 0) { sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, - ts+8339 /* "Cannot add a NOT..." */) + ts+8415 /* "Cannot add a NOT..." */) } // Ensure the default expression is something that sqlite3ValueFromExpr() @@ -85242,7 +85919,7 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr if pDflt != 0 { *(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */)) = uintptr(0) var rc int32 - rc = Xsqlite3ValueFromExpr(tls, db, pDflt, SQLITE_UTF8, SQLITE_AFF_BLOB, bp+40 /* &pVal */) + rc = Xsqlite3ValueFromExpr(tls, db, pDflt, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp+40 /* &pVal */) if rc != SQLITE_OK { @@ -85250,12 +85927,12 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } if !(*(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */)) != 0) { sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, - ts+8392 /* "Cannot add a col..." */) + ts+8468 /* "Cannot add a col..." */) } Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */))) } } else if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_STORED) != 0 { - sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, ts+8438 /* "cannot add a STO..." */) + sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, ts+8514 /* "cannot add a STO..." */) } // Modify the CREATE TABLE statement. @@ -85266,11 +85943,13 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr for (zEnd > zCol) && ((int32(*(*int8)(unsafe.Pointer(zEnd))) == ';') || ((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zEnd)))]) & 0x01) != 0)) { *(*int8)(unsafe.Pointer(libc.PostDecUintptr(&zEnd, 1))) = int8(0) } - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_PreferBuiltin) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_PreferBuiltin)) + // substr() operations on characters, but addColOffset is in bytes. So we + // have to use printf() to translate between these units: Xsqlite3NestedParse(tls, pParse, - ts+8465, /* "UPDATE \"%w\".sqli..." */ - libc.VaList(bp, zDb, (*Table)(unsafe.Pointer(pNew)).FaddColOffset, zCol, ((*Table)(unsafe.Pointer(pNew)).FaddColOffset+1), + ts+8541, /* "UPDATE \"%w\".sqli..." */ + libc.VaList(bp, zDb, (*Table)(unsafe.Pointer(pNew)).FaddColOffset, zCol, (*Table)(unsafe.Pointer(pNew)).FaddColOffset, zTab)) Xsqlite3DbFree(tls, db, zCol) (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags = savedDbFlags @@ -85292,7 +85971,7 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } // Reload the table definition - renameReloadSchema(tls, pParse, iDb) + renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) } // This function is called by the parser after the table-name in @@ -85308,7 +85987,7 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr // // Routine sqlite3AlterFinishAddColumn() will be called to complete // coding the "ALTER TABLE ... ADD" statement. -func Xsqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { /* sqlite3.c:106229:21: */ +func Xsqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { /* sqlite3.c:107166:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -85340,7 +86019,7 @@ __2: if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { goto __3 } - Xsqlite3ErrorMsg(tls, pParse, ts+8585 /* "virtual tables m..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+8687 /* "virtual tables m..." */, 0) goto exit_begin_add_column __3: ; @@ -85349,7 +86028,7 @@ __3: if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) { goto __4 } - Xsqlite3ErrorMsg(tls, pParse, ts+8619 /* "Cannot add a col..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+8721 /* "Cannot add a col..." */, 0) goto exit_begin_add_column __4: ; @@ -85384,7 +86063,7 @@ __6: nAlloc = ((((int32((*Table)(unsafe.Pointer(pNew)).FnCol) - 1) / 8) * 8) + 8) (*Table)(unsafe.Pointer(pNew)).FaCol = Xsqlite3DbMallocZero(tls, db, (uint64(uint64(unsafe.Sizeof(Column{})) * uint64(nAlloc)))) - (*Table)(unsafe.Pointer(pNew)).FzName = Xsqlite3MPrintf(tls, db, ts+8649 /* "sqlite_altertab_..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + (*Table)(unsafe.Pointer(pNew)).FzName = Xsqlite3MPrintf(tls, db, ts+8751 /* "sqlite_altertab_..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) if !(!(int32((*Table)(unsafe.Pointer(pNew)).FaCol) != 0) || !(int32((*Table)(unsafe.Pointer(pNew)).FzName) != 0)) { goto __7 } @@ -85425,20 +86104,26 @@ exit_begin_add_column: // it loads an error message into pParse and returns non-zero. // // Or, if pTab is not a view or virtual table, zero is returned. -func isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:106311:12: */ - bp := tls.Alloc(16) - defer tls.Free(16) +func isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) int32 { /* sqlite3.c:107248:12: */ + bp := tls.Alloc(24) + defer tls.Free(24) var zType uintptr = uintptr(0) if (*Table)(unsafe.Pointer(pTab)).FpSelect != 0 { - zType = ts + 8668 /* "view" */ + zType = ts + 8770 /* "view" */ } if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { - zType = ts + 8673 /* "virtual table" */ + zType = ts + 8775 /* "virtual table" */ } if zType != 0 { - Xsqlite3ErrorMsg(tls, - pParse, ts+8687 /* "cannot rename co..." */, libc.VaList(bp, zType, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+8789, /* "cannot %s %s \"%s..." */ + libc.VaList(bp, func() uintptr { + if bDrop != 0 { + return ts + 8807 /* "drop column from" */ + } + return ts + 8824 /* "rename columns o..." */ + }(), + zType, (*Table)(unsafe.Pointer(pTab)).FzName)) return 1 } return 0 @@ -85447,7 +86132,7 @@ func isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3 // Handles the following parser reduction: // // cmd ::= ALTER TABLE pSrc RENAME COLUMN pOld TO pNew -func Xsqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld uintptr, pNew uintptr) { /* sqlite3.c:106340:21: */ +func Xsqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld uintptr, pNew uintptr) { /* sqlite3.c:107278:21: */ bp := tls.Alloc(112) defer tls.Free(112) @@ -85479,7 +86164,7 @@ __1: goto exit_rename_column __2: ; - if !(SQLITE_OK != isRealTable(tls, pParse, pTab)) { + if !(SQLITE_OK != isRealTable(tls, pParse, pTab, 0)) { goto __3 } goto exit_rename_column @@ -85529,7 +86214,7 @@ __8: if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { goto __10 } - Xsqlite3ErrorMsg(tls, pParse, ts+5207 /* "no such column: ..." */, libc.VaList(bp, zOld)) + Xsqlite3ErrorMsg(tls, pParse, ts+5252 /* "no such column: ..." */, libc.VaList(bp, zOld)) goto exit_rename_column __10: ; @@ -85549,19 +86234,19 @@ __11: bQuote = (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(pNew)).Fz)))]) & 0x80) Xsqlite3NestedParse(tls, pParse, - ts+8720, /* "UPDATE \"%w\".sqli..." */ + ts+8842, /* "UPDATE \"%w\".sqli..." */ libc.VaList(bp+8, zDb, zDb, (*Table)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, (libc.Bool32(iSchema == 1)), (*Table)(unsafe.Pointer(pTab)).FzName)) Xsqlite3NestedParse(tls, pParse, - ts+8938, /* "UPDATE temp.sqli..." */ + ts+9060, /* "UPDATE temp.sqli..." */ libc.VaList(bp+72, zDb, (*Table)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) // Drop and reload the database schema. - renameReloadSchema(tls, pParse, iSchema) - renameTestSchema(tls, pParse, zDb, (libc.Bool32(iSchema == 1))) + renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) + renameTestSchema(tls, pParse, zDb, (libc.Bool32(iSchema == 1)), ts+8246 /* "after rename" */) exit_rename_column: Xsqlite3SrcListDelete(tls, db, pSrc) @@ -85572,7 +86257,7 @@ exit_rename_column: // The context of an ALTER TABLE RENAME COLUMN operation that gets passed // down into the Walker. -type RenameCtx = RenameCtx1 /* sqlite3.c:106452:26 */ +type RenameCtx = RenameCtx1 /* sqlite3.c:107390:26 */ // Remember that the parser tree element pPtr was created using // the token pToken. @@ -85584,7 +86269,7 @@ type RenameCtx = RenameCtx1 /* sqlite3.c:106452:26 */ // The pPtr argument is returned so that this routine can be used // with tail recursion in tokenExpr() routine, for a small performance // improvement. -func Xsqlite3RenameTokenMap(tls *libc.TLS, pParse uintptr, pPtr uintptr, pToken uintptr) uintptr { /* sqlite3.c:106513:21: */ +func Xsqlite3RenameTokenMap(tls *libc.TLS, pParse uintptr, pPtr uintptr, pToken uintptr) uintptr { /* sqlite3.c:107451:21: */ var pNew uintptr if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_UNMAP { @@ -85603,7 +86288,7 @@ func Xsqlite3RenameTokenMap(tls *libc.TLS, pParse uintptr, pPtr uintptr, pToken // It is assumed that there is already a RenameToken object associated // with parse tree element pFrom. This function remaps the associated token // to parse tree element pTo. -func Xsqlite3RenameTokenRemap(tls *libc.TLS, pParse uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:106535:21: */ +func Xsqlite3RenameTokenRemap(tls *libc.TLS, pParse uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:107473:21: */ var p uintptr for p = (*Parse)(unsafe.Pointer(pParse)).FpRename; p != 0; p = (*RenameToken)(unsafe.Pointer(p)).FpNext { @@ -85615,7 +86300,7 @@ func Xsqlite3RenameTokenRemap(tls *libc.TLS, pParse uintptr, pTo uintptr, pFrom } // Walker callback used by sqlite3RenameExprUnmap(). -func renameUnmapExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106549:12: */ +func renameUnmapExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107487:12: */ var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr) return WRC_Continue @@ -85623,7 +86308,7 @@ func renameUnmapExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* // Iterate through the Select objects that are part of WITH clauses attached // to select statement pSelect. -func renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:106559:13: */ +func renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:107497:13: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -85631,20 +86316,20 @@ func renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite if pWith != 0 { var i int32 for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ { - var p uintptr = (*Cte)(unsafe.Pointer((pWith + 16 /* &.a */) + uintptr(i)*32)).FpSelect + var p uintptr = (*Cte)(unsafe.Pointer((pWith + 16 /* &.a */) + uintptr(i)*48)).FpSelect // var sNC NameContext at bp, 56 libc.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = (*Walker)(unsafe.Pointer(pWalker)).FpParse Xsqlite3SelectPrep(tls, (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse, p, bp /* &sNC */) Xsqlite3WalkSelect(tls, pWalker, p) - Xsqlite3RenameExprlistUnmap(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, (*Cte)(unsafe.Pointer((pWith+16 /* &.a */)+uintptr(i)*32)).FpCols) + Xsqlite3RenameExprlistUnmap(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, (*Cte)(unsafe.Pointer((pWith+16 /* &.a */)+uintptr(i)*48)).FpCols) } } } // Unmap all tokens in the IdList object passed as the second argument. -func unmapColumnIdlistNames(tls *libc.TLS, pParse uintptr, pIdList uintptr) { /* sqlite3.c:106578:13: */ +func unmapColumnIdlistNames(tls *libc.TLS, pParse uintptr, pIdList uintptr) { /* sqlite3.c:107516:13: */ if pIdList != 0 { var ii int32 for ii = 0; ii < (*IdList)(unsafe.Pointer(pIdList)).FnId; ii++ { @@ -85654,13 +86339,13 @@ func unmapColumnIdlistNames(tls *libc.TLS, pParse uintptr, pIdList uintptr) { /* } // Walker callback used by sqlite3RenameExprUnmap(). -func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:106593:12: */ +func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:107531:12: */ var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse var i int32 if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return WRC_Abort } - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_View) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_View)) != 0 { return WRC_Prune } if (*Select)(unsafe.Pointer(p)).FpEList != 0 { @@ -85674,11 +86359,11 @@ func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* s if (*Select)(unsafe.Pointer(p)).FpSrc != 0 { // Every Select as a SrcList, even if it is empty var pSrc uintptr = (*Select)(unsafe.Pointer(p)).FpSrc for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ { - Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FzName) - if Xsqlite3WalkExpr(tls, pWalker, (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpOn) != 0 { + Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FzName) + if Xsqlite3WalkExpr(tls, pWalker, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpOn) != 0 { return WRC_Abort } - unmapColumnIdlistNames(tls, pParse, (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpUsing) + unmapColumnIdlistNames(tls, pParse, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpUsing) } } @@ -85687,7 +86372,7 @@ func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* s } // Remove all nodes that are part of expression pExpr from the rename list. -func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:106622:21: */ +func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:107560:21: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -85702,14 +86387,14 @@ func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* (*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 }{renameUnmapSelectCb})) - (*Parse)(unsafe.Pointer(pParse)).FeParseMode = PARSE_MODE_UNMAP + (*Parse)(unsafe.Pointer(pParse)).FeParseMode = U8(PARSE_MODE_UNMAP) Xsqlite3WalkExpr(tls, bp /* &sWalker */, pExpr) (*Parse)(unsafe.Pointer(pParse)).FeParseMode = eMode } // Remove all nodes that are part of expression-list pEList from the // rename list. -func Xsqlite3RenameExprlistUnmap(tls *libc.TLS, pParse uintptr, pEList uintptr) { /* sqlite3.c:106638:21: */ +func Xsqlite3RenameExprlistUnmap(tls *libc.TLS, pParse uintptr, pEList uintptr) { /* sqlite3.c:107576:21: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -85732,7 +86417,7 @@ func Xsqlite3RenameExprlistUnmap(tls *libc.TLS, pParse uintptr, pEList uintptr) } // Free the list of RenameToken objects given in the second argument -func renameTokenFree(tls *libc.TLS, db uintptr, pToken uintptr) { /* sqlite3.c:106657:13: */ +func renameTokenFree(tls *libc.TLS, db uintptr, pToken uintptr) { /* sqlite3.c:107595:13: */ var pNext uintptr var p uintptr for p = pToken; p != 0; p = pNext { @@ -85742,29 +86427,35 @@ func renameTokenFree(tls *libc.TLS, db uintptr, pToken uintptr) { /* sqlite3.c:1 } // Search the Parse object passed as the first argument for a RenameToken -// object associated with parse tree element pPtr. If found, remove it -// from the Parse object and add it to the list maintained by the -// RenameCtx object passed as the second argument. -func renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) { /* sqlite3.c:106672:13: */ +// object associated with parse tree element pPtr. If found, return a pointer +// to it. Otherwise, return NULL. +// +// If the second argument passed to this function is not NULL and a matching +// RenameToken object is found, remove it from the Parse object and add it to +// the list maintained by the RenameCtx object. +func renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) uintptr { /* sqlite3.c:107613:20: */ var pp uintptr - for pp = (pParse + 416 /* &.pRename */); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 24 /* &.pNext */) { + for pp = (pParse + 400 /* &.pRename */); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 24 /* &.pNext */) { if (*RenameToken)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).Fp == pPtr { var pToken uintptr = *(*uintptr)(unsafe.Pointer(pp)) - *(*uintptr)(unsafe.Pointer(pp)) = (*RenameToken)(unsafe.Pointer(pToken)).FpNext - (*RenameToken)(unsafe.Pointer(pToken)).FpNext = (*RenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*RenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*RenameCtx1)(unsafe.Pointer(pCtx)).FnList++ - break + if pCtx != 0 { + *(*uintptr)(unsafe.Pointer(pp)) = (*RenameToken)(unsafe.Pointer(pToken)).FpNext + (*RenameToken)(unsafe.Pointer(pToken)).FpNext = (*RenameCtx1)(unsafe.Pointer(pCtx)).FpList + (*RenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken + (*RenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + } + return pToken } } + return uintptr(0) } // This is a Walker select callback. It does nothing. It is only required // because without a dummy callback, sqlite3WalkExpr() and similar do not // descend into sub-select statements. -func renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:106692:12: */ - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_View) != 0 { +func renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:107640:12: */ + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_View)) != 0 { return WRC_Prune } renameWalkWith(tls, pWalker, p) @@ -85778,7 +86469,7 @@ func renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* // ALTER TABLE statement. If it is, then attach its associated // RenameToken object to the list of RenameToken objects being // constructed in RenameCtx object at pWalker->u.pRename. -func renameColumnExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106707:12: */ +func renameColumnExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107655:12: */ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_TRIGGER) && (int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*RenameCtx)(unsafe.Pointer(p)).FiCol)) && @@ -85799,7 +86490,7 @@ func renameColumnExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / // the input SQL is parsed from left to right. Repeated calls to this routine // return all column name tokens in the order that they are encountered // in the SQL statement. -func renameColumnTokenNext(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:106732:20: */ +func renameColumnTokenNext(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:107680:20: */ var pBest uintptr = (*RenameCtx)(unsafe.Pointer(pCtx)).FpList var pToken uintptr var pp uintptr @@ -85821,21 +86512,21 @@ func renameColumnTokenNext(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:1 // ALTER TABLE RENAME COLUMN program. The error message emitted by the // sub-routine is currently stored in pParse->zErrMsg. This function // adds context to the error message and then stores it in pCtx. -func renameColumnParseError(tls *libc.TLS, pCtx uintptr, bPost int32, pType uintptr, pObject uintptr, pParse uintptr) { /* sqlite3.c:106753:13: */ - bp := tls.Alloc(32) - defer tls.Free(32) +func renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType uintptr, pObject uintptr, pParse uintptr) { /* sqlite3.c:107701:13: */ + bp := tls.Alloc(40) + defer tls.Free(40) var zT uintptr = Xsqlite3_value_text(tls, pType) var zN uintptr = Xsqlite3_value_text(tls, pObject) var zErr uintptr - zErr = Xsqlite3_mprintf(tls, ts+9069, /* "error in %s %s%s..." */ + zErr = Xsqlite3_mprintf(tls, ts+9191, /* "error in %s %s%s..." */ libc.VaList(bp, zT, zN, func() uintptr { - if bPost != 0 { - return ts + 9090 /* " after rename" */ + if *(*int8)(unsafe.Pointer(zWhen)) != 0 { + return ts + 9214 /* " " */ } return ts + 703 /* "" */ - }(), + }(), zWhen, (*Parse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -1) Xsqlite3_free(tls, zErr) @@ -85845,7 +86536,7 @@ func renameColumnParseError(tls *libc.TLS, pCtx uintptr, bPost int32, pType uint // pEList->a[i].zName) that matches the string in zOld, extract the // corresponding rename-token from Parse object pParse and add it // to the RenameCtx pCtx. -func renameColumnElistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pEList uintptr, zOld uintptr) { /* sqlite3.c:106778:13: */ +func renameColumnElistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pEList uintptr, zOld uintptr) { /* sqlite3.c:107726:13: */ if pEList != 0 { var i int32 for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ { @@ -85862,7 +86553,7 @@ func renameColumnElistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pEList // For each name in the the id-list pIdList (i.e. each pIdList->a[i].zName) // that matches the string in zOld, extract the corresponding rename-token // from Parse object pParse and add it to the RenameCtx pCtx. -func renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdList uintptr, zOld uintptr) { /* sqlite3.c:106803:13: */ +func renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdList uintptr, zOld uintptr) { /* sqlite3.c:107751:13: */ if pIdList != 0 { var i int32 for i = 0; i < (*IdList)(unsafe.Pointer(pIdList)).FnId; i++ { @@ -85876,7 +86567,7 @@ func renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLis // Parse the SQL statement zSql using Parse object (*p). The Parse object // is initialized by this function before it is used. -func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) int32 { /* sqlite3.c:106825:12: */ +func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) int32 { /* sqlite3.c:107773:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -85894,10 +86585,14 @@ func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uint // occurs and the parse does not result in a new table, index or // trigger object, the database must be corrupt. libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Parse{}))) - (*Parse)(unsafe.Pointer(p)).FeParseMode = PARSE_MODE_RENAME + (*Parse)(unsafe.Pointer(p)).FeParseMode = U8(PARSE_MODE_RENAME) (*Parse)(unsafe.Pointer(p)).Fdb = db (*Parse)(unsafe.Pointer(p)).FnQueryLoop = U32(1) - rc = Xsqlite3RunParser(tls, p, zSql, bp /* &zErr */) + if zSql != 0 { + rc = Xsqlite3RunParser(tls, p, zSql, bp /* &zErr */) + } else { + rc = SQLITE_NOMEM + } (*Parse)(unsafe.Pointer(p)).FzErrMsg = *(*uintptr)(unsafe.Pointer(bp /* zErr */)) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -85905,7 +86600,7 @@ func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uint } if (((rc == SQLITE_OK) && ((*Parse)(unsafe.Pointer(p)).FpNewTable == uintptr(0))) && ((*Parse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0))) && ((*Parse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = Xsqlite3CorruptError(tls, 106852) + rc = Xsqlite3CorruptError(tls, 107800) } (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(0) @@ -85919,7 +86614,7 @@ func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uint // // Or, if an error occurs (i.e. an OOM condition), an error is left in // pCtx and an SQLite error code returned. -func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zNew uintptr, bQuote int32) int32 { /* sqlite3.c:106880:12: */ +func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zNew uintptr, bQuote int32) int32 { /* sqlite3.c:107828:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -85936,7 +86631,7 @@ func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, z // ALTER TABLE statement was quoted (bQuote==1), then set zNew to // point to zQuot so that all substitutions are made using the // quoted version of the new column name. - zQuot = Xsqlite3MPrintf(tls, db, ts+9104 /* "\"%w\"" */, libc.VaList(bp, zNew)) + zQuot = Xsqlite3MPrintf(tls, db, ts+9216 /* "\"%w\"" */, libc.VaList(bp, zNew)) if zQuot == uintptr(0) { return SQLITE_NOMEM } else { @@ -85994,7 +86689,7 @@ func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, z // it was read from the schema of database zDb. Return SQLITE_OK if // successful. Otherwise, return an SQLite error code and leave an error // message in the Parse object. -func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:106962:12: */ +func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:107910:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -86035,13 +86730,20 @@ func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:10 var i int32 for i = 0; (i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc) && (rc == SQLITE_OK); i++ { var p uintptr = ((pSrc + 8 /* &.a */) + uintptr(i)*112) - (*SrcList_item)(unsafe.Pointer(p)).FpTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), p) - (*SrcList_item)(unsafe.Pointer(p)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) - if (*SrcList_item)(unsafe.Pointer(p)).FpTab == uintptr(0) { - rc = SQLITE_ERROR + (*SrcItem)(unsafe.Pointer(p)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + if (*SrcItem)(unsafe.Pointer(p)).FpSelect != 0 { + Xsqlite3SelectPrep(tls, pParse, (*SrcItem)(unsafe.Pointer(p)).FpSelect, uintptr(0)) + Xsqlite3ExpandSubquery(tls, pParse, p) + + Xsqlite3SelectPrep(tls, pParse, (*SrcItem)(unsafe.Pointer(((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom+8 /* &.a */)+uintptr((i-1))*112)).FpSelect, uintptr(0)) } else { - (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(p)).FpTab)).FnTabRef++ - rc = Xsqlite3ViewGetColumnNames(tls, pParse, (*SrcList_item)(unsafe.Pointer(p)).FpTab) + (*SrcItem)(unsafe.Pointer(p)).FpTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), p) + if (*SrcItem)(unsafe.Pointer(p)).FpTab == uintptr(0) { + rc = SQLITE_ERROR + } else { + (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(p)).FpTab)).FnTabRef++ + rc = Xsqlite3ViewGetColumnNames(tls, pParse, (*SrcItem)(unsafe.Pointer(p)).FpTab) + } } } (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = pSrc @@ -86052,9 +86754,8 @@ func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:10 rc = Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList) } - if (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0 { + if ((*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0) && (rc == SQLITE_OK) { var pUpsert uintptr = (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert - (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc = pSrc *(*uintptr)(unsafe.Pointer(bp /* &sNC */ + 16 /* &.uNC */)) = pUpsert (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags = NC_UUpsert @@ -86083,7 +86784,7 @@ func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:10 // Invoke sqlite3WalkExpr() or sqlite3WalkSelect() on all Select or Expr // objects that are part of the trigger passed as the second argument. -func renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) { /* sqlite3.c:107048:13: */ +func renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) { /* sqlite3.c:108003:13: */ var pStep uintptr // Find tokens to edit in WHEN clause @@ -86101,12 +86802,18 @@ func renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) { /* sq Xsqlite3WalkExpr(tls, pWalker, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertWhere) Xsqlite3WalkExpr(tls, pWalker, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere) } + if (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 { + var i int32 + for i = 0; i < (*SrcList)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom)).FnSrc; i++ { + Xsqlite3WalkSelect(tls, pWalker, (*SrcItem)(unsafe.Pointer(((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom+8 /* &.a */)+uintptr(i)*112)).FpSelect) + } + } } } // Free the contents of Parse object (*pParse). Do not free the memory // occupied by the Parse object itself. -func renameParseCleanup(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:107073:13: */ +func renameParseCleanup(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:108034:13: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pIdx uintptr if (*Parse)(unsafe.Pointer(pParse)).FpVdbe != 0 { @@ -86144,9 +86851,9 @@ func renameParseCleanup(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:107073:13: // This function is used internally by the ALTER TABLE RENAME COLUMN command. // It is only accessible to SQL created using sqlite3NestedParse(). It is // not reachable from ordinary SQL passed into sqlite3_prepare(). -func renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:107113:13: */ - bp := tls.Alloc(504) - defer tls.Free(504) +func renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:108074:13: */ + bp := tls.Alloc(488) + defer tls.Free(488) var db uintptr // var sCtx RenameCtx at bp, 32 @@ -86160,9 +86867,9 @@ func renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt var bTemp int32 var zOld uintptr var rc int32 - // var sParse Parse at bp+32, 424 + // var sParse Parse at bp+32, 408 - // var sWalker Walker at bp+456, 48 + // var sWalker Walker at bp+440, 48 var pIdx uintptr var i int32 @@ -86233,15 +86940,15 @@ __5: rc = renameParseSql(tls, bp+32 /* &sParse */, zDb, db, zSql, bTemp) // Find tokens that need to be replaced. - libc.Xmemset(tls, bp+456 /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{}))) - (*Walker)(unsafe.Pointer(bp + 456 /* &sWalker */)).FpParse = bp + 32 /* &sParse */ - (*Walker)(unsafe.Pointer(bp + 456 /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { + libc.Xmemset(tls, bp+440 /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{}))) + (*Walker)(unsafe.Pointer(bp + 440 /* &sWalker */)).FpParse = bp + 32 /* &sParse */ + (*Walker)(unsafe.Pointer(bp + 440 /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 }{renameColumnExprCb})) - (*Walker)(unsafe.Pointer(bp + 456 /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { + (*Walker)(unsafe.Pointer(bp + 440 /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 }{renameColumnSelectCb})) - *(*uintptr)(unsafe.Pointer(bp + 456 /* &sWalker */ + 40 /* &.u */)) = bp /* &sCtx */ + *(*uintptr)(unsafe.Pointer(bp + 440 /* &sWalker */ + 40 /* &.u */)) = bp /* &sCtx */ (*RenameCtx)(unsafe.Pointer(bp /* &sCtx */)).FpTab = pTab if !(rc != SQLITE_OK) { @@ -86269,7 +86976,7 @@ __6: if !(rc == SQLITE_OK) { goto __11 } - Xsqlite3WalkSelect(tls, bp+456 /* &sWalker */, pSelect) + Xsqlite3WalkSelect(tls, bp+440 /* &sWalker */, pSelect) __11: ; if !(rc != SQLITE_OK) { @@ -86295,13 +87002,13 @@ __9: renameTokenFind(tls, bp+32 /* &sParse */, bp /* &sCtx */, ((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTable + 68 /* &.iPKey */)) __14: ; - Xsqlite3WalkExprList(tls, bp+456 /* &sWalker */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTable)).FpCheck) + Xsqlite3WalkExprList(tls, bp+440 /* &sWalker */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTable)).FpCheck) pIdx = (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp + 32 /* &sParse */)).FpNewTable)).FpIndex __15: if !(pIdx != 0) { goto __17 } - Xsqlite3WalkExprList(tls, bp+456 /* &sWalker */, (*Index)(unsafe.Pointer(pIdx)).FaColExpr) + Xsqlite3WalkExprList(tls, bp+440 /* &sWalker */, (*Index)(unsafe.Pointer(pIdx)).FaColExpr) goto __16 __16: pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext @@ -86314,7 +87021,7 @@ __18: if !(pIdx != 0) { goto __20 } - Xsqlite3WalkExprList(tls, bp+456 /* &sWalker */, (*Index)(unsafe.Pointer(pIdx)).FaColExpr) + Xsqlite3WalkExprList(tls, bp+440 /* &sWalker */, (*Index)(unsafe.Pointer(pIdx)).FaColExpr) goto __19 __19: pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext @@ -86329,7 +87036,7 @@ __21: if !(i < int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTable)).FnCol)) { goto __23 } - Xsqlite3WalkExpr(tls, bp+456 /* &sWalker */, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTable)).FaCol+uintptr(i)*32)).FpDflt) + Xsqlite3WalkExpr(tls, bp+440 /* &sWalker */, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTable)).FaCol+uintptr(i)*32)).FpDflt) goto __22 __22: i++ @@ -86382,8 +87089,8 @@ __7: if !((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewIndex != 0) { goto __32 } - Xsqlite3WalkExprList(tls, bp+456 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewIndex)).FaColExpr) - Xsqlite3WalkExpr(tls, bp+456 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewIndex)).FpPartIdxWhere) + Xsqlite3WalkExprList(tls, bp+440 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewIndex)).FaColExpr) + Xsqlite3WalkExpr(tls, bp+440 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewIndex)).FpPartIdxWhere) goto __33 __32: rc = renameResolveTrigger(tls, bp+32 /* &sParse */) @@ -86436,7 +87143,7 @@ __41: ; // Find tokens to edit in various expressions and selects - renameWalkTrigger(tls, bp+456 /* &sWalker */, (*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTrigger) + renameWalkTrigger(tls, bp+440 /* &sWalker */, (*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTrigger) __33: ; __8: @@ -86451,7 +87158,7 @@ renameColumnFunc_done: if !((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FzErrMsg != 0) { goto __43 } - renameColumnParseError(tls, context, 0, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32 /* &sParse */) + renameColumnParseError(tls, context, ts+703 /* "" */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32 /* &sParse */) goto __44 __43: Xsqlite3_result_error_code(tls, context, rc) @@ -86467,7 +87174,7 @@ __42: } // Walker expression callback used by "RENAME TABLE". -func renameTableExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107274:12: */ +func renameTableExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:108235:12: */ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && ((*RenameCtx)(unsafe.Pointer(p)).FpTab == *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */))) { renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, (pExpr + 64 /* &.y */ /* &.pTab */)) @@ -86476,11 +87183,11 @@ func renameTableExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* } // Walker select callback used by "RENAME TABLE". -func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:107285:12: */ +func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:108246:12: */ var i int32 var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pSrc uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc - if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & SF_View) != 0 { + if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_View)) != 0 { return WRC_Prune } if pSrc == uintptr(0) { @@ -86489,8 +87196,8 @@ func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 } for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ { var pItem uintptr = ((pSrc + 8 /* &.a */) + uintptr(i)*112) - if (*SrcList_item)(unsafe.Pointer(pItem)).FpTab == (*RenameCtx)(unsafe.Pointer(p)).FpTab { - renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, (*SrcList_item)(unsafe.Pointer(pItem)).FzName) + if (*SrcItem)(unsafe.Pointer(pItem)).FpTab == (*RenameCtx)(unsafe.Pointer(p)).FpTab { + renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, (*SrcItem)(unsafe.Pointer(pItem)).FzName) } } renameWalkWith(tls, pWalker, pSelect) @@ -86515,9 +87222,9 @@ func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 // // sqlite_rename_table('main', 'CREATE TABLE t1(a REFERENCES t2)','t2','t3',0) // -> 'CREATE TABLE t1(a REFERENCES t3)' -func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:107325:13: */ - bp := tls.Alloc(560) - defer tls.Free(560) +func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:108286:13: */ + bp := tls.Alloc(544) + defer tls.Free(544) var db uintptr = Xsqlite3_context_db_handle(tls, context) var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -86528,7 +87235,7 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr _ = NotUsed if ((zInput != 0) && (zOld != 0)) && (zNew != 0) { - // var sParse Parse at bp+80, 424 + // var sParse Parse at bp+80, 408 var rc int32 var bQuote int32 = 1 @@ -86556,20 +87263,20 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr rc = renameParseSql(tls, bp+80 /* &sParse */, zDb, db, zInput, bTemp) if rc == SQLITE_OK { - var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyAlter)) + var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))) if (*Parse)(unsafe.Pointer(bp+80 /* &sParse */)).FpNewTable != 0 { var pTab uintptr = (*Parse)(unsafe.Pointer(bp + 80 /* &sParse */)).FpNewTable if (*Table)(unsafe.Pointer(pTab)).FpSelect != 0 { if isLegacy == 0 { var pSelect uintptr = (*Table)(unsafe.Pointer(pTab)).FpSelect - // var sNC NameContext at bp+504, 56 + // var sNC NameContext at bp+488, 56 - libc.Xmemset(tls, bp+504 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) - (*NameContext)(unsafe.Pointer(bp + 504 /* &sNC */)).FpParse = bp + 80 /* &sParse */ + libc.Xmemset(tls, bp+488 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) + (*NameContext)(unsafe.Pointer(bp + 488 /* &sNC */)).FpParse = bp + 80 /* &sParse */ *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_View))) - Xsqlite3SelectPrep(tls, bp+80 /* &sParse */, (*Table)(unsafe.Pointer(pTab)).FpSelect, bp+504 /* &sNC */) + Xsqlite3SelectPrep(tls, bp+80 /* &sParse */, (*Table)(unsafe.Pointer(pTab)).FpSelect, bp+488 /* &sNC */) if (*Parse)(unsafe.Pointer(bp+80 /* &sParse */)).FnErr != 0 { rc = (*Parse)(unsafe.Pointer(bp + 80 /* &sParse */)).Frc } else { @@ -86578,7 +87285,7 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr } } else { // Modify any FK definitions to point to the new table. - if (isLegacy == 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) { + if (isLegacy == 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) { var pFKey uintptr for pFKey = (*Table)(unsafe.Pointer(pTab)).FpFKey; pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom { if Xsqlite3_stricmp(tls, (*FKey)(unsafe.Pointer(pFKey)).FzTo, zOld) == 0 { @@ -86630,7 +87337,7 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr } if rc != SQLITE_OK { if (*Parse)(unsafe.Pointer(bp+80 /* &sParse */)).FzErrMsg != 0 { - renameColumnParseError(tls, context, 0, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+80 /* &sParse */) + renameColumnParseError(tls, context, ts+703 /* "" */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+80 /* &sParse */) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -86656,21 +87363,23 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr // 2: Object type ("view", "table", "trigger" or "index"). // 3: Object name. // 4: True if object is from temp schema. +// 5: "when" part of error message. // // Unless it finds an error, this function normally returns NULL. However, it // returns integer value 1 if: // // * the SQL argument creates a trigger, and // * the table that the trigger is attached to is in database zDb. -func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:107482:13: */ - bp := tls.Alloc(480) - defer tls.Free(480) +func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:108444:13: */ + bp := tls.Alloc(464) + defer tls.Free(464) var db uintptr = Xsqlite3_context_db_handle(tls, context) var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) var zInput uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) var bTemp int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8))) - var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyAlter)) + var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))) + var zWhen uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 5*8))) var xAuth Sqlite3_xauth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth (*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) @@ -86678,16 +87387,16 @@ func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr _ = NotUsed if (zDb != 0) && (zInput != 0) { var rc int32 - // var sParse Parse at bp, 424 + // var sParse Parse at bp, 408 rc = renameParseSql(tls, bp /* &sParse */, zDb, db, zInput, bTemp) if rc == SQLITE_OK { if ((isLegacy == 0) && ((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable != 0)) && ((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FpSelect != 0) { - // var sNC NameContext at bp+424, 56 + // var sNC NameContext at bp+408, 56 - libc.Xmemset(tls, bp+424 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) - (*NameContext)(unsafe.Pointer(bp + 424 /* &sNC */)).FpParse = bp /* &sParse */ - Xsqlite3SelectPrep(tls, bp /* &sParse */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FpSelect, bp+424 /* &sNC */) + libc.Xmemset(tls, bp+408 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) + (*NameContext)(unsafe.Pointer(bp + 408 /* &sNC */)).FpParse = bp /* &sParse */ + Xsqlite3SelectPrep(tls, bp /* &sParse */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FpSelect, bp+408 /* &sNC */) if (*Parse)(unsafe.Pointer(bp /* &sParse */)).FnErr != 0 { rc = (*Parse)(unsafe.Pointer(bp /* &sParse */)).Frc } @@ -86705,8 +87414,8 @@ func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr } } - if rc != SQLITE_OK { - renameColumnParseError(tls, context, 1, *(*uintptr)(unsafe.Pointer(argv + 2*8)), *(*uintptr)(unsafe.Pointer(argv + 3*8)), bp /* &sParse */) + if (rc != SQLITE_OK) && (zWhen != 0) { + renameColumnParseError(tls, context, zWhen, *(*uintptr)(unsafe.Pointer(argv + 2*8)), *(*uintptr)(unsafe.Pointer(argv + 3*8)), bp /* &sParse */) } renameParseCleanup(tls, bp /* &sParse */) } @@ -86714,15 +87423,296 @@ func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth } +// The implementation of internal UDF sqlite_drop_column(). +// +// Arguments: +// +// argv[0]: An integer - the index of the schema containing the table +// argv[1]: CREATE TABLE statement to modify. +// argv[2]: An integer - the index of the column to remove. +// +// The value returned is a string containing the CREATE TABLE statement +// with column argv[2] removed. +func dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:108510:13: */ + bp := tls.Alloc(432) + defer tls.Free(432) + + var db uintptr + var iSchema int32 + var zSql uintptr + var iCol int32 + var zDb uintptr + var rc int32 + // var sParse Parse at bp+24, 408 + + var pCol uintptr + var pTab uintptr + var zEnd uintptr + var zNew uintptr + var xAuth Sqlite3_xauth + var pEnd uintptr + db = Xsqlite3_context_db_handle(tls, context) + iSchema = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))) + zSql = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + iCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) + zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iSchema)*32)).FzDbSName + zNew = uintptr(0) + xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth + (*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) + + _ = NotUsed + rc = renameParseSql(tls, bp+24 /* &sParse */, zDb, db, zSql, (libc.Bool32(iSchema == 1))) + if !(rc != SQLITE_OK) { + goto __1 + } + goto drop_column_done +__1: + ; + pTab = (*Parse)(unsafe.Pointer(bp + 24 /* &sParse */)).FpNewTable + if !(((pTab == uintptr(0)) || (int32((*Table)(unsafe.Pointer(pTab)).FnCol) == 1)) || (iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol))) { + goto __2 + } + // This can happen if the sqlite_schema table is corrupt + rc = Xsqlite3CorruptError(tls, 108538) + goto drop_column_done +__2: + ; + + pCol = renameTokenFind(tls, bp+24 /* &sParse */, uintptr(0), (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*32)).FzName) + if !(iCol < (int32((*Table)(unsafe.Pointer(pTab)).FnCol) - 1)) { + goto __3 + } + pEnd = renameTokenFind(tls, bp+24 /* &sParse */, uintptr(0), (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((iCol+1))*32)).FzName) + zEnd = (*RenameToken)(unsafe.Pointer(pEnd)).Ft.Fz + goto __4 +__3: + zEnd = (zSql + uintptr((*Table)(unsafe.Pointer(pTab)).FaddColOffset)) +__5: + if !((int32(*(*int8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz))) != 0) && (int32(*(*int8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz))) != ',')) { + goto __6 + } + (*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- + goto __5 +__6: + ; +__4: + ; + + zNew = Xsqlite3MPrintf(tls, db, ts+9221 /* "%.*s%s" */, libc.VaList(bp, ((int64((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql))/1), zSql, zEnd)) + Xsqlite3_result_text(tls, context, zNew, -1, libc.UintptrFromInt32(-1)) + Xsqlite3_free(tls, zNew) + +drop_column_done: + renameParseCleanup(tls, bp+24 /* &sParse */) + (*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + if !(rc != SQLITE_OK) { + goto __7 + } + Xsqlite3_result_error_code(tls, context, rc) +__7: +} + +// This function is called by the parser upon parsing an +// +// ALTER TABLE pSrc DROP COLUMN pName +// +// statement. Argument pSrc contains the possibly qualified name of the +// table being edited, and token pName the name of the column to drop. +func Xsqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr) { /* sqlite3.c:108574:21: */ + bp := tls.Alloc(64) + defer tls.Free(64) + + var db uintptr // Database handle + var pTab uintptr // Table to modify + var iDb int32 // Index of db containing pTab in aDb[] + var zDb uintptr // Database containing pTab ("main" etc.) + var zCol uintptr // Name of column to drop + var iCol int32 + var iPos int32 + var iColPos int32 + var regOut int32 + var i int32 + var addr int32 + var reg int32 + var regRec int32 + var pPk uintptr + var nField int32 // Number of non-virtual columns after drop + var iCur int32 + var v uintptr + db = (*Parse)(unsafe.Pointer(pParse)).Fdb + zCol = uintptr(0) // Index of column zCol in pTab->aCol[] + + // Look up the table being altered. + + if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + goto __1 + } + goto exit_drop_column +__1: + ; + pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), (pSrc + 8 /* &.a */)) + if !(!(pTab != 0)) { + goto __2 + } + goto exit_drop_column +__2: + ; + + // Make sure this is not an attempt to ALTER a view, virtual table or + // system table. + if !(SQLITE_OK != isAlterableTable(tls, pParse, pTab)) { + goto __3 + } + goto exit_drop_column +__3: + ; + if !(SQLITE_OK != isRealTable(tls, pParse, pTab, 1)) { + goto __4 + } + goto exit_drop_column +__4: + ; + + // Find the index of the column being dropped. + zCol = Xsqlite3NameFromToken(tls, db, pName) + if !(zCol == uintptr(0)) { + goto __5 + } + + goto exit_drop_column +__5: + ; + iCol = Xsqlite3ColumnIndex(tls, pTab, zCol) + if !(iCol < 0) { + goto __6 + } + Xsqlite3ErrorMsg(tls, pParse, ts+5252 /* "no such column: ..." */, libc.VaList(bp, zCol)) + goto exit_drop_column +__6: + ; + + // Do not allow the user to drop a PRIMARY KEY column or a column + // constrained by a UNIQUE constraint. + if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*32)).FcolFlags) & (COLFLAG_PRIMKEY | COLFLAG_UNIQUE)) != 0) { + goto __7 + } + Xsqlite3ErrorMsg(tls, pParse, ts+9228, /* "cannot drop %s c..." */ + libc.VaList(bp+8, func() uintptr { + if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*32)).FcolFlags) & COLFLAG_PRIMKEY) != 0 { + return ts + 9256 /* "PRIMARY KEY" */ + } + return ts + 5073 /* "UNIQUE" */ + }(), + zCol)) + goto exit_drop_column +__7: + ; + + // Do not allow the number of columns to go to zero + if !(int32((*Table)(unsafe.Pointer(pTab)).FnCol) <= 1) { + goto __8 + } + Xsqlite3ErrorMsg(tls, pParse, ts+9268 /* "cannot drop colu..." */, libc.VaList(bp+24, zCol)) + goto exit_drop_column +__8: + ; + + // Edit the sqlite_schema table + iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) + + zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName + renameTestSchema(tls, pParse, zDb, (libc.Bool32(iDb == 1)), ts+703 /* "" */) + Xsqlite3NestedParse(tls, pParse, + + ts+9316 /* "UPDATE \"%w\".sqli..." */, libc.VaList(bp+32, zDb, iDb, iCol, (*Table)(unsafe.Pointer(pTab)).FzName)) + + // Drop and reload the database schema. + renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) + renameTestSchema(tls, pParse, zDb, (libc.Bool32(iDb == 1)), ts+9437 /* "after drop colum..." */) + + // Edit rows of table on disk + if !(((*Parse)(unsafe.Pointer(pParse)).FnErr == 0) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*32)).FcolFlags) & COLFLAG_VIRTUAL) == 0)) { + goto __9 + } + pPk = uintptr(0) + nField = 0 + v = Xsqlite3GetVdbe(tls, pParse) + iCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + Xsqlite3OpenTable(tls, pParse, iCur, iDb, pTab, OP_OpenWrite) + addr = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iCur) + reg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) + *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (int32((*Table)(unsafe.Pointer(pTab)).FnCol)) + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { + goto __10 + } + Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCur, reg) + goto __11 +__10: + pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) +__11: + ; + i = 0 +__12: + if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { + goto __14 + } + if !((i != iCol) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) == 0)) { + goto __15 + } + if !(pPk != 0) { + goto __16 + } + iPos = int32(Xsqlite3TableColumnToIndex(tls, pPk, int16(i))) + iColPos = int32(Xsqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + regOut = (((reg + 1) + iPos) - (libc.Bool32(iPos > iColPos))) + goto __17 +__16: + regOut = ((reg + 1) + nField) +__17: + ; + Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, i, regOut) + nField++ +__15: + ; + goto __13 +__13: + i++ + goto __12 + goto __14 +__14: + ; + regRec = (reg + int32((*Table)(unsafe.Pointer(pTab)).FnCol)) + Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (reg + 1), nField, regRec) + if !(pPk != 0) { + goto __18 + } + Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iCur, regRec, (reg + 1), int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)) + goto __19 +__18: + Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iCur, regRec, reg) +__19: + ; + + Xsqlite3VdbeAddOp2(tls, v, OP_Next, iCur, (addr + 1)) + Xsqlite3VdbeJumpHere(tls, v, addr) +__9: + ; + +exit_drop_column: + Xsqlite3DbFree(tls, db, zCol) + Xsqlite3SrcListDelete(tls, db, pSrc) +} + // Register built-in functions used to help implement ALTER TABLE -func Xsqlite3AlterFunctions(tls *libc.TLS) { /* sqlite3.c:107538:21: */ +func Xsqlite3AlterFunctions(tls *libc.TLS) { /* sqlite3.c:108692:21: */ Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aAlterTableFuncs)), (int32(uint64(unsafe.Sizeof(aAlterTableFuncs)) / uint64(unsafe.Sizeof(FuncDef{}))))) } -var aAlterTableFuncs = [3]FuncDef{ - {FnArg: int8(9), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 9109 /* "sqlite_rename_co..." */}, - {FnArg: int8(7), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 9130 /* "sqlite_rename_ta..." */}, - {FnArg: int8(5), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 9150 /* "sqlite_rename_te..." */}} /* sqlite3.c:107539:18 */ +var aAlterTableFuncs = [4]FuncDef{ + {FnArg: int8(9), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 9455 /* "sqlite_rename_co..." */}, + {FnArg: int8(7), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 9476 /* "sqlite_rename_ta..." */}, + {FnArg: int8(6), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 9496 /* "sqlite_rename_te..." */}, + {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 9515 /* "sqlite_drop_colu..." */}} /* sqlite3.c:108693:18 */ //************* End of alter.c ********************************************** //************* Begin file analyze.c **************************************** @@ -86878,7 +87868,7 @@ var aAlterTableFuncs = [3]FuncDef{ // 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 *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWhere uintptr, zWhereType uintptr) { /* sqlite3.c:107715:13: */ +func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWhere uintptr, zWhereType uintptr) { /* sqlite3.c:108870:13: */ bp := tls.Alloc(88) defer tls.Free(88) @@ -86891,7 +87881,7 @@ func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWh // var aCreateTbl [3]U8 at bp+72, 3 var nToOpen int32 - if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0 { + if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0) { nToOpen = 2 } else { nToOpen = 1 @@ -86919,9 +87909,9 @@ func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWh // of the new table in register pParse->regRoot. This is important // because the OpenWrite opcode below will be needing it. Xsqlite3NestedParse(tls, pParse, - ts+9169 /* "CREATE TABLE %Q...." */, libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, aTable[i].FzCols)) + ts+9534 /* "CREATE TABLE %Q...." */, libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, aTable[i].FzCols)) *(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4)) = U32((*Parse)(unsafe.Pointer(pParse)).FregRoot) - *(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i))) = OPFLAG_P2ISREG + *(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i))) = U8(OPFLAG_P2ISREG) } } else { // The table already exists. If zWhere is not NULL, delete all entries @@ -86931,10 +87921,10 @@ func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWh Xsqlite3TableLock(tls, pParse, iDb, *(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4)), uint8(1), zTab) if zWhere != 0 { Xsqlite3NestedParse(tls, pParse, - ts+9192, /* "DELETE FROM %Q.%..." */ + ts+9557, /* "DELETE FROM %Q.%..." */ libc.VaList(bp+24, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else if (*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - Xsqlite3NestedParse(tls, pParse, ts+9222 /* "DELETE FROM %Q.%..." */, libc.VaList(bp+56, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + Xsqlite3NestedParse(tls, pParse, ts+9587 /* "DELETE FROM %Q.%..." */, libc.VaList(bp+56, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { // The sqlite_stat[134] table already exists. Delete all rows. Xsqlite3VdbeAddOp2(tls, v, OP_Clear, int32(*(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4))), iDb) @@ -86955,10 +87945,10 @@ var aTable = [3]struct { FzName uintptr FzCols uintptr }{ - {FzName: ts + 9240 /* "sqlite_stat1" */, FzCols: ts + 9253 /* "tbl,idx,stat" */}, - {FzName: ts + 9266 /* "sqlite_stat4" */, FzCols: ts + 9279 /* "tbl,idx,neq,nlt,..." */}, - {FzName: ts + 9307 /* "sqlite_stat3" */}, -} /* sqlite3.c:107725:5 */ + {FzName: ts + 9605 /* "sqlite_stat1" */, FzCols: ts + 9618 /* "tbl,idx,stat" */}, + {FzName: ts + 9631 /* "sqlite_stat4" */, FzCols: ts + 9644 /* "tbl,idx,neq,nlt,..." */}, + {FzName: ts + 9672 /* "sqlite_stat3" */}, +} /* sqlite3.c:108880:5 */ // Recommended number of samples for sqlite_stat4 @@ -86985,14 +87975,14 @@ type StatAccum1 = struct { FnMaxEqZero int32 FiGet int32 Fa uintptr -} /* sqlite3.c:107813:9 */ +} /* sqlite3.c:108968:9 */ // Recommended number of samples for sqlite_stat4 // Three SQL functions - stat_init(), stat_push(), and stat_get() - // share an instance of the following structure to hold their state // information. -type StatAccum = StatAccum1 /* sqlite3.c:107813:26 */ +type StatAccum = StatAccum1 /* sqlite3.c:108968:26 */ type StatSample1 = struct { FanEq uintptr FanDLt uintptr @@ -87003,12 +87993,12 @@ type StatSample1 = struct { _ [3]byte FiCol int32 FiHash U32 -} /* sqlite3.c:107813:9 */ +} /* sqlite3.c:108968:9 */ -type StatSample = StatSample1 /* sqlite3.c:107814:27 */ +type StatSample = StatSample1 /* sqlite3.c:108969:27 */ // Reclaim memory used by a StatSample -func sampleClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:107855:13: */ +func sampleClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:109010:13: */ if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */))) @@ -87017,7 +88007,7 @@ func sampleClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:107855:13: } // Initialize the BLOB value of a ROWID -func sampleSetRowid(tls *libc.TLS, db uintptr, p uintptr, n int32, pData uintptr) { /* sqlite3.c:107867:13: */ +func sampleSetRowid(tls *libc.TLS, db uintptr, p uintptr, n int32, pData uintptr) { /* sqlite3.c:109022:13: */ if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */))) @@ -87032,7 +88022,7 @@ func sampleSetRowid(tls *libc.TLS, db uintptr, p uintptr, n int32, pData uintptr } // Initialize the INTEGER value of a ROWID. -func sampleSetRowidInt64(tls *libc.TLS, db uintptr, p uintptr, iRowid I64) { /* sqlite3.c:107883:13: */ +func sampleSetRowidInt64(tls *libc.TLS, db uintptr, p uintptr, iRowid I64) { /* sqlite3.c:109038:13: */ if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */))) @@ -87042,7 +88032,7 @@ func sampleSetRowidInt64(tls *libc.TLS, db uintptr, p uintptr, iRowid I64) { /* } // Copy the contents of object (*pFrom) into (*pTo). -func sampleCopy(tls *libc.TLS, p uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:107896:13: */ +func sampleCopy(tls *libc.TLS, p uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:109051:13: */ (*StatSample)(unsafe.Pointer(pTo)).FisPSample = (*StatSample)(unsafe.Pointer(pFrom)).FisPSample (*StatSample)(unsafe.Pointer(pTo)).FiCol = (*StatSample)(unsafe.Pointer(pFrom)).FiCol (*StatSample)(unsafe.Pointer(pTo)).FiHash = (*StatSample)(unsafe.Pointer(pFrom)).FiHash @@ -87057,7 +88047,7 @@ func sampleCopy(tls *libc.TLS, p uintptr, pTo uintptr, pFrom uintptr) { /* sqlit } // Reclaim all memory of a StatAccum structure. -func statAccumDestructor(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:107914:13: */ +func statAccumDestructor(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:109069:13: */ var p uintptr = pOld if (*StatAccum)(unsafe.Pointer(p)).FmxSample != 0 { var i int32 @@ -87092,7 +88082,7 @@ func statAccumDestructor(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:107914:13: // value is a pointer to the StatAccum object. The datatype of the // return value is BLOB, but it is really just a pointer to the StatAccum // object. -func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:107949:13: */ +func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:109104:13: */ var p uintptr var nCol int32 // Number of columns in index being sampled var nKeyCol int32 // Number of key columns @@ -87101,7 +88091,7 @@ func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql var db uintptr = Xsqlite3_context_db_handle(tls, context) // Database connection // Maximum number of samples. 0 if STAT4 data is not collected var mxSample int32 - if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0 { + if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0) { mxSample = SQLITE_STAT4_SAMPLES } else { mxSample = 0 @@ -87186,9 +88176,9 @@ func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql var statInitFuncdef = FuncDef{ FnArg: int8(4), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse - FzName: ts + 9320 /* "stat_init" */} /* sqlite3.c:108036:22 */ + FzName: ts + 9685 /* "stat_init" */} /* sqlite3.c:109191:22 */ // pNew and pOld are both candidate non-periodic samples selected for // the same column (pNew->iCol==pOld->iCol). Ignoring this column and @@ -87199,7 +88189,7 @@ var statInitFuncdef = FuncDef{ // // This function assumes that for each argument sample, the contents of // the anEq[] array from pSample->anEq[pSample->iCol+1] onwards are valid. -func sampleIsBetterPost(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:108060:12: */ +func sampleIsBetterPost(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:109215:12: */ var nCol int32 = (*StatAccum)(unsafe.Pointer(pAccum)).FnCol var i int32 @@ -87221,7 +88211,7 @@ func sampleIsBetterPost(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintpt // // This function assumes that for each argument sample, the contents of // the anEq[] array from pSample->anEq[pSample->iCol] onwards are valid. -func sampleIsBetter(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:108084:12: */ +func sampleIsBetter(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:109239:12: */ var nEqNew TRowcnt = *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pNew)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pNew)).FiCol)*4)) var nEqOld TRowcnt = *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pOld)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pOld)).FiCol)*4)) @@ -87239,7 +88229,7 @@ func sampleIsBetter(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) i // Copy the contents of sample *pNew into the p->a[] array. If necessary, // remove the least desirable sample from p->a[] to make room. -func sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { /* sqlite3.c:108107:13: */ +func sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { /* sqlite3.c:109262:13: */ var pSample uintptr var i int32 var pOld uintptr @@ -87382,7 +88372,7 @@ __11: // 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 *libc.TLS, p uintptr, iChng int32) { /* sqlite3.c:108199:13: */ +func samplePushPrevious(tls *libc.TLS, p uintptr, iChng int32) { /* sqlite3.c:109354:13: */ var i int32 // Check if any samples from the aBest[] array should be pushed @@ -87434,7 +88424,7 @@ func samplePushPrevious(tls *libc.TLS, p uintptr, iChng int32) { /* sqlite3.c:10 // if it wants the byte-code to do special processing. // // The R parameter is only used for STAT4 -func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:108251:13: */ +func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:109406:13: */ var i int32 // The three function arguments @@ -87504,9 +88494,9 @@ func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql var statPushFuncdef = FuncDef{ FnArg: (int8(2 + IsStat4)), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse - FzName: ts + 9330 /* "stat_push" */} /* sqlite3.c:108326:22 */ + FzName: ts + 9695 /* "stat_push" */} /* sqlite3.c:109481:22 */ // Implementation of the stat_get(P,J) SQL function. This routine is // used to query statistical information that has been gathered into @@ -87525,7 +88515,7 @@ var statPushFuncdef = FuncDef{ // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:108363:13: */ +func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:109518:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -87563,7 +88553,7 @@ func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli return } - Xsqlite3_snprintf(tls, 24, zRet, ts+9340, /* "%llu" */ + Xsqlite3_snprintf(tls, 24, zRet, ts+9705, /* "%llu" */ libc.VaList(bp, func() uint64 { if (*StatAccum)(unsafe.Pointer(p)).FnSkipAhead != 0 { return U64((*StatAccum)(unsafe.Pointer(p)).FnEst) @@ -87574,7 +88564,7 @@ func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnKeyCol; i++ { var nDistinct U64 = (U64(*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(i)*4)) + TRowcnt(1))) var iVal U64 = (((U64((*StatAccum)(unsafe.Pointer(p)).FnRow) + nDistinct) - uint64(1)) / nDistinct) - Xsqlite3_snprintf(tls, 24, z, ts+9345 /* " %llu" */, libc.VaList(bp+8, iVal)) + Xsqlite3_snprintf(tls, 24, z, ts+9710 /* " %llu" */, libc.VaList(bp+8, iVal)) z += uintptr(Xsqlite3Strlen30(tls, z)) } @@ -87623,7 +88613,7 @@ func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli var i int32 var z uintptr = zRet for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnCol; i++ { - Xsqlite3_snprintf(tls, 24, z, ts+9351 /* "%llu " */, libc.VaList(bp+16, U64(*(*TRowcnt)(unsafe.Pointer(aCnt + uintptr(i)*4))))) + Xsqlite3_snprintf(tls, 24, z, ts+9716 /* "%llu " */, libc.VaList(bp+16, U64(*(*TRowcnt)(unsafe.Pointer(aCnt + uintptr(i)*4))))) z += uintptr(Xsqlite3Strlen30(tls, z)) } @@ -87638,11 +88628,11 @@ func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli var statGetFuncdef = FuncDef{ FnArg: (int8(1 + IsStat4)), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse - FzName: ts + 9357 /* "stat_get" */} /* sqlite3.c:108478:22 */ + FzName: ts + 9722 /* "stat_get" */} /* sqlite3.c:109633:22 */ -func callStatGet(tls *libc.TLS, pParse uintptr, regStat int32, iParam int32, regOut int32) { /* sqlite3.c:108490:13: */ +func callStatGet(tls *libc.TLS, pParse uintptr, regStat int32, iParam int32, regOut int32) { /* sqlite3.c:109645:13: */ Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Integer, iParam, (regStat + 1)) Xsqlite3VdbeAddFunctionCall(tls, pParse, 0, regStat, regOut, (1 + IsStat4), @@ -87651,7 +88641,7 @@ func callStatGet(tls *libc.TLS, pParse uintptr, regStat int32, iParam int32, reg // Generate code to do an analysis of all indices associated with // a single table. -func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr, iStatCur int32, iMem int32, iTab int32) { /* sqlite3.c:108531:13: */ +func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr, iStatCur int32, iMem int32, iTab int32) { /* sqlite3.c:109686:13: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database handle var pIdx uintptr // An index to being analyzed var iIdxCur int32 // Cursor open on index being analyzed @@ -87687,7 +88677,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp // Do not gather statistics on views or virtual tables return } - if Xsqlite3_strlike(tls, ts+9366 /* "sqlite\\_%" */, (*Table)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, ts+9731 /* "sqlite\\_%" */, (*Table)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { // Do not gather statistics on system tables return } @@ -87704,8 +88694,8 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp if pStat1 == uintptr(0) { return } - (*Table)(unsafe.Pointer(pStat1)).FzName = (pStat1 + 1*128) - libc.Xmemcpy(tls, (*Table)(unsafe.Pointer(pStat1)).FzName, ts+9240 /* "sqlite_stat1" */, uint64(13)) + (*Table)(unsafe.Pointer(pStat1)).FzName = (pStat1 + 1*120) + libc.Xmemcpy(tls, (*Table)(unsafe.Pointer(pStat1)).FzName, ts+9605 /* "sqlite_stat1" */, uint64(13)) (*Table)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*Table)(unsafe.Pointer(pStat1)).FiPKey = int16(-1) Xsqlite3VdbeAddOp4(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Noop, 0, 0, 0, pStat1, -17) @@ -87740,7 +88730,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) { needTableCnt = U8(0) } - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { nCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) zIdxName = (*Table)(unsafe.Pointer(pTab)).FzName nColTest = (nCol - 1) @@ -87812,7 +88802,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp Xsqlite3VdbeAddOp2(tls, v, OP_Integer, nCol, (regStat + 1)) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol), regRowid) - if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0 { + if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_Count, iIdxCur, regTemp) addrRewind = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iIdxCur) @@ -87867,7 +88857,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, i, regTemp) *(*int32)(unsafe.Pointer(aGotoChng + uintptr(i)*4)) = Xsqlite3VdbeAddOp4(tls, v, OP_Ne, regTemp, 0, (regPrev + i), pColl, -2) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NULLEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ)) } Xsqlite3VdbeAddOp2(tls, v, OP_Integer, nColTest, regChng) @@ -87893,9 +88883,9 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp // stat_push(P, regChng, regRowid) // 3rd parameter STAT4 only // Next csr // if !eof(csr) goto next_row; - if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0 { + if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0) { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iIdxCur, regRowid) } else { var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable) @@ -87938,14 +88928,14 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp // Add the entry to the stat1 table. callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+9376 /* "BBB" */, 0) + Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+9741 /* "BBB" */, 0) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur, regNewRowid) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur, regTemp, regNewRowid) Xsqlite3VdbeChangeP4(tls, v, -1, pStat1, -6) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) // Add the entries to the stat4 table. - if ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0) && ((*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit == 0) { + if (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit == 0) { var regEq int32 = regStat1 var regLt int32 = (regStat1 + 1) var regDLt int32 = (regStat1 + 2) @@ -87955,10 +88945,10 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp var addrNext int32 var addrIsNull int32 var seekOp U8 - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { - seekOp = OP_NotExists + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + seekOp = uint8(OP_NotExists) } else { - seekOp = OP_NotFound + seekOp = uint8(OP_NotFound) } (*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 { @@ -88000,10 +88990,10 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp jZeroRows = Xsqlite3VdbeAddOp1(tls, v, OP_IfNot, regStat1) Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regIdxname) - Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+9376 /* "BBB" */, 0) + Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+9741 /* "BBB" */, 0) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur, regNewRowid) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur, regTemp, regNewRowid) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3VdbeChangeP4(tls, v, -1, pStat1, -6) Xsqlite3VdbeJumpHere(tls, v, jZeroRows) } @@ -88011,7 +89001,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp // 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 *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:108893:13: */ +func loadAnalysis(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:110048:13: */ var v uintptr = Xsqlite3GetVdbe(tls, pParse) if v != 0 { Xsqlite3VdbeAddOp1(tls, v, OP_LoadAnalysis, iDb) @@ -88019,7 +89009,7 @@ func loadAnalysis(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:10889 } // Generate code that will do an analysis of an entire database -func analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:108903:13: */ +func analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:110058:13: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema // Schema of database iDb var k uintptr @@ -88044,7 +89034,7 @@ func analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:10 // 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 *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) { /* sqlite3.c:108930:13: */ +func analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) { /* sqlite3.c:110085:13: */ var iDb int32 var iStatCur int32 @@ -88053,9 +89043,9 @@ func analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) iStatCur = (*Parse)(unsafe.Pointer(pParse)).FnTab *(*int32)(unsafe.Pointer(pParse + 52 /* &.nTab */)) += (3) if pOnlyIdx != 0 { - openStatTable(tls, pParse, iDb, iStatCur, (*Index)(unsafe.Pointer(pOnlyIdx)).FzName, ts+9380 /* "idx" */) + openStatTable(tls, pParse, iDb, iStatCur, (*Index)(unsafe.Pointer(pOnlyIdx)).FzName, ts+9745 /* "idx" */) } else { - openStatTable(tls, pParse, iDb, iStatCur, (*Table)(unsafe.Pointer(pTab)).FzName, ts+9384 /* "tbl" */) + openStatTable(tls, pParse, iDb, iStatCur, (*Table)(unsafe.Pointer(pTab)).FzName, ts+9749 /* "tbl" */) } analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1), (*Parse)(unsafe.Pointer(pParse)).FnTab) loadAnalysis(tls, pParse, iDb) @@ -88071,7 +89061,7 @@ func analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) // 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 Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:108961:21: */ +func Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:110116:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -88134,16 +89124,16 @@ func Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintp type analysisInfo = struct { Fdb uintptr FzDatabase uintptr -} /* sqlite3.c:109013:9 */ +} /* sqlite3.c:110168:9 */ // Used to pass information from the analyzer reader through to the // callback routine. -type AnalysisInfo = analysisInfo /* sqlite3.c:109013:29 */ +type AnalysisInfo = analysisInfo /* sqlite3.c:110168:29 */ // 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 *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, aLog uintptr, pIndex uintptr) { /* sqlite3.c:109024:13: */ +func decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, aLog uintptr, pIndex uintptr) { /* sqlite3.c:110179:13: */ var z uintptr = zIntArray var c int32 var i int32 @@ -88172,15 +89162,15 @@ func decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.bUnordered */, uint32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.noSkipScan */, uint32(0), 6, 0x40) for *(*int8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, ts+9388 /* "unordered*" */, z) == 0 { + if Xsqlite3_strglob(tls, ts+9753 /* "unordered*" */, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.bUnordered */, uint32(1), 2, 0x4) - } else if Xsqlite3_strglob(tls, ts+9399 /* "sz=[0-9]*" */, z) == 0 { + } else if Xsqlite3_strglob(tls, ts+9764 /* "sz=[0-9]*" */, z) == 0 { var sz int32 = Xsqlite3Atoi(tls, (z + uintptr(3))) if sz < 2 { sz = 2 } (*Index)(unsafe.Pointer(pIndex)).FszIdxRow = Xsqlite3LogEst(tls, uint64(sz)) - } else if Xsqlite3_strglob(tls, ts+9409 /* "noskipscan*" */, z) == 0 { + } else if Xsqlite3_strglob(tls, ts+9774 /* "noskipscan*" */, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.noSkipScan */, uint32(1), 6, 0x40) } for (int32(*(*int8)(unsafe.Pointer(z))) != 0) && (int32(*(*int8)(unsafe.Pointer(z))) != ' ') { @@ -88202,7 +89192,7 @@ func decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, // // Entries for which argv[1]==NULL simply record the number of rows in // the table. -func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:109097:12: */ +func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:110252:12: */ bp := tls.Alloc(152) defer tls.Free(152) @@ -88248,7 +89238,7 @@ func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotU libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.hasStat1 */, uint32(1), 7, 0x80) if (*Index)(unsafe.Pointer(pIndex)).FpPartIdxWhere == uintptr(0) { (*Table)(unsafe.Pointer(pTable)).FnRowLogEst = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiRowLogEst)) - *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (TF_HasStat1) + *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (U32(TF_HasStat1)) } } else { // var fakeIdx Index at bp, 152 @@ -88256,7 +89246,7 @@ func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotU (*Index)(unsafe.Pointer(bp /* &fakeIdx */)).FszIdxRow = (*Table)(unsafe.Pointer(pTable)).FszTabRow decodeIntArray(tls, z, 1, uintptr(0), (pTable + 74 /* &.nRowLogEst */), bp /* &fakeIdx */) (*Table)(unsafe.Pointer(pTable)).FszTabRow = (*Index)(unsafe.Pointer(bp /* &fakeIdx */)).FszIdxRow - *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (TF_HasStat1) + *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (U32(TF_HasStat1)) } return 0 @@ -88264,7 +89254,7 @@ func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotU // If the Index.aSample variable is not NULL, delete the aSample[] array // and its contents. -func Xsqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr) { /* sqlite3.c:109160:21: */ +func Xsqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr) { /* sqlite3.c:110315:21: */ if (*Index)(unsafe.Pointer(pIdx)).FaSample != 0 { var j int32 for j = 0; j < (*Index)(unsafe.Pointer(pIdx)).FnSample; j++ { @@ -88281,7 +89271,7 @@ func Xsqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr) { /* sq // Populate the pIdx->aAvgEq[] array based on the samples currently // stored in pIdx->aSample[]. -func initAvgEq(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:109185:13: */ +func initAvgEq(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:110340:13: */ if pIdx != 0 { var aSample uintptr = (*Index)(unsafe.Pointer(pIdx)).FaSample var pFinal uintptr = (aSample + uintptr(((*Index)(unsafe.Pointer(pIdx)).FnSample-1))*40) @@ -88339,11 +89329,11 @@ func initAvgEq(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:109185:13: */ // Look up an index by name. Or, if the name of a WITHOUT ROWID table // is supplied instead, find the PRIMARY KEY index for that table. -func findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:109244:14: */ +func findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:110399:14: */ var pIdx uintptr = Xsqlite3FindIndex(tls, db, zName, zDb) if pIdx == uintptr(0) { var pTab uintptr = Xsqlite3FindTable(tls, db, zName, zDb) - if (pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if (pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab) } } @@ -88360,7 +89350,7 @@ func findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr // zSql2: SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4 // // where %Q is replaced with the database name before the SQL is executed. -func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb uintptr) int32 { /* sqlite3.c:109269:12: */ +func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb uintptr) int32 { /* sqlite3.c:110424:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -88401,7 +89391,7 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui continue } - if !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + if !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) } else { nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) @@ -88419,6 +89409,7 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui pSpace = ((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(nSample)*40) (*Index)(unsafe.Pointer(pIdx)).FaAvgEq = pSpace pSpace += 4 * (uintptr(nIdxCol)) + *(*U32)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable + 64 /* &.tabFlags */)) |= (U32(TF_HasStat4)) for i = 0; i < nSample; i++ { (*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(i)*40)).FanEq = pSpace pSpace += 4 * (uintptr(nIdxCol)) @@ -88495,13 +89486,13 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui // Load content from the sqlite_stat4 table into // the Index.aSample[] arrays of all indices. -func loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:109389:12: */ +func loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:110545:12: */ var rc int32 = SQLITE_OK // Result codes from subroutines - if Xsqlite3FindTable(tls, db, ts+9266 /* "sqlite_stat4" */, zDb) != 0 { + if Xsqlite3FindTable(tls, db, ts+9631 /* "sqlite_stat4" */, zDb) != 0 { rc = loadStatTbl(tls, db, - ts+9421, /* "SELECT idx,count..." */ - ts+9475, /* "SELECT idx,neq,n..." */ + ts+9786, /* "SELECT idx,count..." */ + ts+9840, /* "SELECT idx,neq,n..." */ zDb) } return rc @@ -88525,7 +89516,7 @@ func loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:1093 // 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 Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlite3.c:109424:20: */ +func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlite3.c:110580:20: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -88552,9 +89543,9 @@ func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlit // Load new statistics out of the sqlite_stat1 table (*AnalysisInfo)(unsafe.Pointer(bp + 8 /* &sInfo */)).Fdb = db (*AnalysisInfo)(unsafe.Pointer(bp + 8 /* &sInfo */)).FzDatabase = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName - if Xsqlite3FindTable(tls, db, ts+9240 /* "sqlite_stat1" */, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase) != uintptr(0) { + if Xsqlite3FindTable(tls, db, ts+9605 /* "sqlite_stat1" */, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase) != uintptr(0) { zSql = Xsqlite3MPrintf(tls, db, - ts+9527 /* "SELECT tbl,idx,s..." */, libc.VaList(bp, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase)) + ts+9892 /* "SELECT tbl,idx,s..." */, libc.VaList(bp, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase)) if zSql == uintptr(0) { rc = SQLITE_NOMEM } else { @@ -88630,13 +89621,13 @@ func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlit // ATTACH DATABASE abc||def AS 'db2' // // will fail because neither abc or def can be resolved. -func resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) int32 { /* sqlite3.c:109529:12: */ +func resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) int32 { /* sqlite3.c:110685:12: */ var rc int32 = SQLITE_OK if pExpr != 0 { if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_ID { rc = Xsqlite3ResolveExprNames(tls, pName, pExpr) } else { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_STRING + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_STRING) } } return rc @@ -88644,9 +89635,9 @@ func resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) int32 { /* s // Return true if zName points to a name that may be used to refer to // database iDb attached to handle db. -func Xsqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) int32 { /* sqlite3.c:109546:20: */ +func Xsqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) int32 { /* sqlite3.c:110702:20: */ return (libc.Bool32((Xsqlite3StrICmp(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zName) == 0) || - ((iDb == 0) && (Xsqlite3StrICmp(tls, ts+5282 /* "main" */, zName) == 0)))) + ((iDb == 0) && (Xsqlite3StrICmp(tls, ts+5327 /* "main" */, zName) == 0)))) } // An SQL user-function registered to do the work of an ATTACH statement. The @@ -88662,7 +89653,7 @@ func Xsqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) int3 // If the db->init.reopenMemdb flags is set, then instead of attaching a // new database, close the database on db->init.iDb and reopen it as an // empty MemDB. -func attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109568:13: */ +func attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:110724:13: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -88713,7 +89704,7 @@ __2: // This is not a real ATTACH. Instead, this routine is being called // from sqlite3_deserialize() to close database db->init.iDb and // reopen it as a MemDB - *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)) = Xsqlite3_vfs_find(tls, ts+9568 /* "memdb" */) + *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)) = Xsqlite3_vfs_find(tls, ts+9933 /* "memdb" */) if !(*(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)) == uintptr(0)) { goto __5 } @@ -88729,7 +89720,7 @@ __6: ; (*Db)(unsafe.Pointer(pNew)).FpBt = uintptr(0) (*Db)(unsafe.Pointer(pNew)).FpSchema = uintptr(0) - rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)), ts+9574 /* "x\x00" */, db, (pNew + 8 /* &.pBt */), 0, SQLITE_OPEN_MAIN_DB) + rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)), ts+9939 /* "x\x00" */, db, (pNew + 8 /* &.pBt */), 0, SQLITE_OPEN_MAIN_DB) goto __4 __3: // This is a real ATTACH @@ -88739,11 +89730,11 @@ __3: // * Too many attached databases, // * Transaction currently open // * Specified database name already being used. - if !((*Sqlite3)(unsafe.Pointer(db)).FnDb >= (*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 7*4)) + 2)) { + if !((*Sqlite3)(unsafe.Pointer(db)).FnDb >= (*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 7*4)) + 2)) { goto __7 } - *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+9577, /* "too many attache..." */ - libc.VaList(bp, *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+9942, /* "too many attache..." */ + libc.VaList(bp, *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 7*4)))) goto attach_error __7: ; @@ -88756,7 +89747,7 @@ __8: if !(Xsqlite3DbIsNamed(tls, db, i, zName) != 0) { goto __11 } - *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+9614 /* "database %s is a..." */, libc.VaList(bp+8, zName)) + *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+9979 /* "database %s is a..." */, libc.VaList(bp+8, zName)) goto attach_error __11: ; @@ -88770,7 +89761,7 @@ __10: // Allocate the new entry in the db->aDb[] array and initialize the schema // hash tables. - if !((*Sqlite3)(unsafe.Pointer(db)).FaDb == db+648 /* &.aDbStatic */) { + if !((*Sqlite3)(unsafe.Pointer(db)).FaDb == db+656 /* &.aDbStatic */) { goto __12 } aNew = Xsqlite3DbMallocRawNN(tls, db, (uint64(unsafe.Sizeof(Db{})) * uint64(3))) @@ -88816,7 +89807,7 @@ __17: __16: ; - *(*uint32)(unsafe.Pointer(bp + 24 /* flags */)) |= SQLITE_OPEN_MAIN_DB + *(*uint32)(unsafe.Pointer(bp + 24 /* flags */)) |= uint32(SQLITE_OPEN_MAIN_DB) rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)), *(*uintptr)(unsafe.Pointer(bp + 40 /* zPath */)), db, (pNew + 8 /* &.pBt */), 0, int32(*(*uint32)(unsafe.Pointer(bp + 24 /* flags */)))) (*Sqlite3)(unsafe.Pointer(db)).FnDb++ (*Db)(unsafe.Pointer(pNew)).FzDbSName = Xsqlite3DbStrDup(tls, db, zName) @@ -88827,7 +89818,7 @@ __4: goto __18 } rc = SQLITE_ERROR - *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+9644 /* "database is alre..." */, 0) + *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+10009 /* "database is alre..." */, 0) goto __19 __18: if !(rc == SQLITE_OK) { @@ -88844,7 +89835,7 @@ __21: goto __23 } *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, - ts+9673 /* "attached databas..." */, 0) + ts+10038 /* "attached databas..." */, 0) rc = SQLITE_ERROR __23: ; @@ -88856,7 +89847,7 @@ __22: Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer(pNew)).FpBt, Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt, -1)) Xsqlite3BtreeSetPagerFlags(tls, (*Db)(unsafe.Pointer(pNew)).FpBt, - (uint32(PAGER_SYNCHRONOUS_FULL | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & PAGER_FLAGS_MASK)))) + (uint32(uint64(PAGER_SYNCHRONOUS_FULL) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(PAGER_FLAGS_MASK))))) Xsqlite3BtreeLeave(tls, (*Db)(unsafe.Pointer(pNew)).FpBt) __20: ; @@ -88914,13 +89905,13 @@ __29: } Xsqlite3OomFault(tls, db) Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */))) - *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+5005 /* "out of memory" */, 0) + *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+5050 /* "out of memory" */, 0) goto __31 __30: if !(*(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) == uintptr(0)) { goto __32 } - *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+9741 /* "unable to open d..." */, libc.VaList(bp+16, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+10106 /* "unable to open d..." */, libc.VaList(bp+16, zFile)) __32: ; __31: @@ -88955,7 +89946,7 @@ __34: // DETACH DATABASE x // // SELECT sqlite_detach(x) -func detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109761:13: */ +func detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:110917:13: */ bp := tls.Alloc(152) defer tls.Free(152) @@ -89008,21 +89999,22 @@ __4: if !(i >= (*Sqlite3)(unsafe.Pointer(db)).FnDb) { goto __7 } - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+9769 /* "no such database..." */, libc.VaList(bp, zName)) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+10134 /* "no such database..." */, libc.VaList(bp, zName)) goto detach_error __7: ; if !(i < 2) { goto __8 } - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+9790 /* "cannot detach da..." */, libc.VaList(bp+8, zName)) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+10155 /* "cannot detach da..." */, libc.VaList(bp+8, zName)) goto detach_error __8: ; - if !((Xsqlite3BtreeIsInReadTrans(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != 0) || (Xsqlite3BtreeIsInBackup(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != 0)) { + if !((Xsqlite3BtreeTxnState(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE) || + (Xsqlite3BtreeIsInBackup(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != 0)) { goto __9 } - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+9816 /* "database %s is l..." */, libc.VaList(bp+16, zName)) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+10181 /* "database %s is l..." */, libc.VaList(bp+16, zName)) goto detach_error __9: ; @@ -89059,7 +90051,7 @@ detach_error: // This procedure generates VDBE code for a single invocation of either the // sqlite_detach() or sqlite_attach() SQL user functions. -func codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAuthArg uintptr, pFilename uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:109821:13: */ +func codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAuthArg uintptr, pFilename uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:110979:13: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -89137,35 +90129,110 @@ attach_end: // Called by the parser to compile a DETACH statement. // // DETACH pDbname -func Xsqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { /* sqlite3.c:109892:21: */ +func Xsqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { /* sqlite3.c:111050:21: */ codeAttach(tls, pParse, SQLITE_DETACH, uintptr(unsafe.Pointer(&detach_func)), pDbname, uintptr(0), uintptr(0), pDbname) } var detach_func = FuncDef{ - FnArg: int8(1), // nArg - FfuncFlags: SQLITE_UTF8, // pNext - FxSFunc: 0, // xValue, xInverse - FzName: ts + 9838 /* "sqlite_detach" */} /* sqlite3.c:109893:24 */ + FnArg: int8(1), // nArg + FfuncFlags: U32(SQLITE_UTF8), // pNext + FxSFunc: 0, // xValue, xInverse + FzName: ts + 10203 /* "sqlite_detach" */} /* sqlite3.c:111051:24 */ // Called by the parser to compile an ATTACH statement. // // ATTACH p AS pDbname KEY pKey -func Xsqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:109912:21: */ +func Xsqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:111070:21: */ codeAttach(tls, pParse, SQLITE_ATTACH, uintptr(unsafe.Pointer(&attach_func)), p, p, pDbname, pKey) } var attach_func = FuncDef{ - FnArg: int8(3), // nArg - FfuncFlags: SQLITE_UTF8, // pNext - FxSFunc: 0, // xValue, xInverse - FzName: ts + 9852 /* "sqlite_attach" */} /* sqlite3.c:109913:24 */ + FnArg: int8(3), // nArg + FfuncFlags: U32(SQLITE_UTF8), // pNext + FxSFunc: 0, // xValue, xInverse + FzName: ts + 10217 /* "sqlite_attach" */} /* sqlite3.c:111071:24 */ + +// Expression callback used by sqlite3FixAAAA() routines. +func fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:111089:12: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + var pFix uintptr = *(*uintptr)(unsafe.Pointer(p + 40 /* &.u */)) + if !(int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) != 0) { + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL)) + } + if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE { + if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit.Fbusy != 0 { + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) + } else { + Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, ts+10231 /* "%s cannot use va..." */, libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType)) + return WRC_Abort + } + } + return WRC_Continue +} + +// Select callback used by sqlite3FixAAAA() routines. +func fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) int32 { /* sqlite3.c:111106:12: */ + bp := tls.Alloc(24) + defer tls.Free(24) + + var pFix uintptr = *(*uintptr)(unsafe.Pointer(p + 40 /* &.u */)) + var i int32 + var pItem uintptr + var db uintptr = (*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb + var iDb int32 = Xsqlite3FindDbName(tls, db, (*DbFixer)(unsafe.Pointer(pFix)).FzDb) + var pList uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc + + if pList == uintptr(0) { + return WRC_Continue + } + i = 0 + pItem = pList + 8 /* &.a */ +__1: + if !(i < (*SrcList)(unsafe.Pointer(pList)).FnSrc) { + goto __3 + } + { + if int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 { + if ((*SrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0) && (iDb != Xsqlite3FindDbName(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase)) { + Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, + ts+10255, /* "%s %T cannot ref..." */ + libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType, (*DbFixer)(unsafe.Pointer(pFix)).FpName, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase)) + return WRC_Abort + } + Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase) + (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0) + (*SrcItem)(unsafe.Pointer(pItem)).FpSchema = (*DbFixer)(unsafe.Pointer(pFix)).FpSchema + libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.fromDDL */, uint32(1), 6, 0x40) + } + if Xsqlite3WalkExpr(tls, (pFix+8 /* &.w */), (*SrcItem)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*112)).FpOn) != 0 { + return WRC_Abort + } + + } + goto __2 +__2: + i++ + pItem += 112 + goto __1 + goto __3 +__3: + ; + if (*Select)(unsafe.Pointer(pSelect)).FpWith != 0 { + for i = 0; i < (*With)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpWith)).FnCte; i++ { + if Xsqlite3WalkSelect(tls, p, (*Cte)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpWith+16 /* &.a */)+uintptr(i)*48)).FpSelect) != 0 { + return WRC_Abort + } + } + } + return WRC_Continue +} // Initialize a DbFixer structure. This routine must be called prior // to passing the structure to one of the sqliteFixAAAA() routines below. -func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zType uintptr, pName uintptr) { /* sqlite3.c:109932:21: */ - var db uintptr - - db = (*Parse)(unsafe.Pointer(pParse)).Fdb +func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zType uintptr, pName uintptr) { /* sqlite3.c:111146:21: */ + var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb (*DbFixer)(unsafe.Pointer(pFix)).FpParse = pParse (*DbFixer)(unsafe.Pointer(pFix)).FzDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName @@ -89173,6 +90240,17 @@ func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zTy (*DbFixer)(unsafe.Pointer(pFix)).FzType = zType (*DbFixer)(unsafe.Pointer(pFix)).FpName = pName (*DbFixer)(unsafe.Pointer(pFix)).FbTemp = (U8(libc.Bool32(iDb == 1))) + (*DbFixer)(unsafe.Pointer(pFix)).Fw.FpParse = pParse + (*DbFixer)(unsafe.Pointer(pFix)).Fw.FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) int32 + }{fixExprCb})) + (*DbFixer)(unsafe.Pointer(pFix)).Fw.FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) int32 + }{fixSelectCb})) + (*DbFixer)(unsafe.Pointer(pFix)).Fw.FxSelectCallback2 = uintptr(0) + (*DbFixer)(unsafe.Pointer(pFix)).Fw.FwalkerDepth = 0 + (*DbFixer)(unsafe.Pointer(pFix)).Fw.FeCode = U16(0) + *(*uintptr)(unsafe.Pointer(pFix + 8 /* &.w */ + 40 /* &.u */)) = pFix } // The following set of routines walk through the parse tree and assign @@ -89187,186 +90265,49 @@ func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zTy // 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 Xsqlite3FixSrcList(tls *libc.TLS, pFix uintptr, pList uintptr) int32 { /* sqlite3.c:109965:20: */ - bp := tls.Alloc(24) - defer tls.Free(24) +func Xsqlite3FixSrcList(tls *libc.TLS, pFix uintptr, pList uintptr) int32 { /* sqlite3.c:111184:20: */ + bp := tls.Alloc(128) + defer tls.Free(128) - var i int32 - var pItem uintptr - var db uintptr = (*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb - var iDb int32 = Xsqlite3FindDbName(tls, db, (*DbFixer)(unsafe.Pointer(pFix)).FzDb) + var res int32 = 0 + if pList != 0 { + // var s Select at bp, 128 - if pList == uintptr(0) { - return 0 + libc.Xmemset(tls, bp /* &s */, 0, uint64(unsafe.Sizeof(Select{}))) + (*Select)(unsafe.Pointer(bp /* &s */)).FpSrc = pList + res = Xsqlite3WalkSelect(tls, (pFix + 8 /* &.w */), bp /* &s */) } - - i = 0 - pItem = pList + 8 /* &.a */ -__1: - if !(i < (*SrcList)(unsafe.Pointer(pList)).FnSrc) { - goto __3 - } - { - if int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 { - if ((*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase != 0) && (iDb != Xsqlite3FindDbName(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase)) { - Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, - ts+9866, /* "%s %T cannot ref..." */ - libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType, (*DbFixer)(unsafe.Pointer(pFix)).FpName, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase)) - return 1 - } - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase) - (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0) - (*SrcList_item)(unsafe.Pointer(pItem)).FpSchema = (*DbFixer)(unsafe.Pointer(pFix)).FpSchema - libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.fromDDL */, uint32(1), 6, 0x40) - } - if Xsqlite3FixSelect(tls, pFix, (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect) != 0 { - return 1 - } - if Xsqlite3FixExpr(tls, pFix, (*SrcList_item)(unsafe.Pointer(pItem)).FpOn) != 0 { - return 1 - } - if ((uint32(int32(*(*uint8)(unsafe.Pointer((pItem + 60 /* &.fg */) + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0) && (Xsqlite3FixExprList(tls, pFix, *(*uintptr)(unsafe.Pointer(pItem + 96 /* &.u1 */))) != 0) { - return 1 - } - - } - goto __2 -__2: - i++ - pItem += 112 - goto __1 - goto __3 -__3: - ; - return 0 + return res } -func Xsqlite3FixSelect(tls *libc.TLS, pFix uintptr, pSelect uintptr) int32 { /* sqlite3.c:110000:20: */ - for pSelect != 0 { - if Xsqlite3FixExprList(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpEList) != 0 { - return 1 - } - if Xsqlite3FixSrcList(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpSrc) != 0 { - return 1 - } - if Xsqlite3FixExpr(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpWhere) != 0 { - return 1 - } - if Xsqlite3FixExprList(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpGroupBy) != 0 { - return 1 - } - if Xsqlite3FixExpr(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpHaving) != 0 { - return 1 - } - if Xsqlite3FixExprList(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpOrderBy) != 0 { - return 1 - } - if Xsqlite3FixExpr(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpLimit) != 0 { - return 1 - } - if (*Select)(unsafe.Pointer(pSelect)).FpWith != 0 { - var i int32 - for i = 0; i < (*With)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpWith)).FnCte; i++ { - if Xsqlite3FixSelect(tls, pFix, (*Cte)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpWith+16 /* &.a */)+uintptr(i)*32)).FpSelect) != 0 { - return 1 - } - } - } - pSelect = (*Select)(unsafe.Pointer(pSelect)).FpPrior - } - return 0 +func Xsqlite3FixSelect(tls *libc.TLS, pFix uintptr, pSelect uintptr) int32 { /* sqlite3.c:111198:20: */ + return Xsqlite3WalkSelect(tls, (pFix + 8 /* &.w */), pSelect) } -func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqlite3.c:110038:20: */ - bp := tls.Alloc(8) - defer tls.Free(8) - - for pExpr != 0 { - if !(int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) != 0) { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FromDDL) - } - if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE { - if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit.Fbusy != 0 { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL - } else { - Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, ts+9912 /* "%s cannot use va..." */, libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType)) - return 1 - } - } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0) { - break - } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { - if Xsqlite3FixSelect(tls, pFix, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0 { - return 1 - } - } else { - if Xsqlite3FixExprList(tls, pFix, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0 { - return 1 - } - } - if Xsqlite3FixExpr(tls, pFix, (*Expr)(unsafe.Pointer(pExpr)).FpRight) != 0 { - return 1 - } - pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft - } - return 0 +func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqlite3.c:111204:20: */ + return Xsqlite3WalkExpr(tls, (pFix + 8 /* &.w */), pExpr) } -func Xsqlite3FixExprList(tls *libc.TLS, pFix uintptr, pList uintptr) int32 { /* sqlite3.c:110065:20: */ - var i int32 - var pItem uintptr - if pList == uintptr(0) { - return 0 - } - i = 0 - pItem = pList + 8 /* &.a */ -__1: - if !(i < (*ExprList)(unsafe.Pointer(pList)).FnExpr) { - goto __3 - } - { - if Xsqlite3FixExpr(tls, pFix, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr) != 0 { - return 1 - } - - } - goto __2 -__2: - i++ - pItem += 32 - goto __1 - goto __3 -__3: - ; - return 0 -} - -func Xsqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) int32 { /* sqlite3.c:110082:20: */ +func Xsqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) int32 { /* sqlite3.c:111213:20: */ for pStep != 0 { - if Xsqlite3FixSelect(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect) != 0 { - return 1 - } - if Xsqlite3FixExpr(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere) != 0 { - return 1 - } - if Xsqlite3FixExprList(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList) != 0 { - return 1 - } - if ((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0) && (Xsqlite3FixSrcList(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom) != 0) { + if (((Xsqlite3WalkSelect(tls, (pFix+8 /* &.w */), (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect) != 0) || + (Xsqlite3WalkExpr(tls, (pFix+8 /* &.w */), (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere) != 0)) || + (Xsqlite3WalkExprList(tls, (pFix+8 /* &.w */), (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList) != 0)) || + (Xsqlite3FixSrcList(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom) != 0) { return 1 } if (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0 { var pUp uintptr = (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert - if (((Xsqlite3FixExprList(tls, pFix, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTarget) != 0) || - (Xsqlite3FixExpr(tls, pFix, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTargetWhere) != 0)) || - (Xsqlite3FixExprList(tls, pFix, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertSet) != 0)) || - (Xsqlite3FixExpr(tls, pFix, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertWhere) != 0) { + if (((Xsqlite3WalkExprList(tls, (pFix+8 /* &.w */), (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTarget) != 0) || + (Xsqlite3WalkExpr(tls, (pFix+8 /* &.w */), (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTargetWhere) != 0)) || + (Xsqlite3WalkExprList(tls, (pFix+8 /* &.w */), (*Upsert)(unsafe.Pointer(pUp)).FpUpsertSet) != 0)) || + (Xsqlite3WalkExpr(tls, (pFix+8 /* &.w */), (*Upsert)(unsafe.Pointer(pUp)).FpUpsertWhere) != 0) { return 1 } } pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext } + return 0 } @@ -89434,7 +90375,7 @@ func Xsqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) int32 { // // Setting the auth function to NULL disables this hook. The default // setting of the auth function is NULL. -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) int32 { /* sqlite3.c:110188:16: */ +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) int32 { /* sqlite3.c:111315:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg @@ -89447,8 +90388,8 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // Write an error message into pParse->zErrMsg that explains that the // user-supplied authorization function returned an illegal value. -func sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110208:13: */ - Xsqlite3ErrorMsg(tls, pParse, ts+9936 /* "authorizer malfu..." */, 0) +func sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:111335:13: */ + Xsqlite3ErrorMsg(tls, pParse, ts+10301 /* "authorizer malfu..." */, 0) (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR } @@ -89459,7 +90400,7 @@ func sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:11020 // 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 Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintptr, iDb int32) int32 { /* sqlite3.c:110222:20: */ +func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintptr, iDb int32) int32 { /* sqlite3.c:111349:20: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -89470,13 +90411,13 @@ func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 { return SQLITE_OK } - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 488 /* &.xAuth */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, SQLITE_READ, zTab, zCol, zDb, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 496 /* &.xAuth */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, SQLITE_READ, zTab, zCol, zDb, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == SQLITE_DENY { - var z uintptr = Xsqlite3_mprintf(tls, ts+9959 /* "%s.%s" */, libc.VaList(bp, zTab, zCol)) + var z uintptr = Xsqlite3_mprintf(tls, ts+10324 /* "%s.%s" */, libc.VaList(bp, zTab, zCol)) if ((*Sqlite3)(unsafe.Pointer(db)).FnDb > 2) || (iDb != 0) { - z = Xsqlite3_mprintf(tls, ts+9965 /* "%s.%z" */, libc.VaList(bp+16, zDb, z)) + z = Xsqlite3_mprintf(tls, ts+10330 /* "%s.%z" */, libc.VaList(bp+16, zDb, z)) } - Xsqlite3ErrorMsg(tls, pParse, ts+9971 /* "access to %z is ..." */, libc.VaList(bp+32, z)) + Xsqlite3ErrorMsg(tls, pParse, ts+10336 /* "access to %z is ..." */, libc.VaList(bp+32, z)) (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_AUTH } else if (rc != SQLITE_IGNORE) && (rc != SQLITE_OK) { sqliteAuthBadReturnCode(tls, pParse) @@ -89491,17 +90432,13 @@ func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp // 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 Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uintptr, pTabList uintptr) { /* sqlite3.c:110258:21: */ - var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb +func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uintptr, pTabList uintptr) { /* sqlite3.c:111385:21: */ var pTab uintptr = uintptr(0) // The table being read var zCol uintptr // Name of the column of the table var iSrc int32 // Index in pTabList->a[] of table being read var iDb int32 // The index of the database the expression refers to var iCol int32 // Index of column in table - if (*Sqlite3)(unsafe.Pointer(db)).FxAuth == uintptr(0) { - return - } iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pSchema) if iDb < 0 { // An attempt to read a column out of a subquery or other @@ -89514,8 +90451,8 @@ func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint } else { for iSrc = 0; iSrc < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc; iSrc++ { - if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(iSrc)*112)).FiCursor { - pTab = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(iSrc)*112)).FpTab + if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(iSrc)*112)).FiCursor { + pTab = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(iSrc)*112)).FpTab break } } @@ -89532,11 +90469,11 @@ func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*32)).FzName } else { - zCol = ts + 6512 /* "ROWID" */ + zCol = ts + 6557 /* "ROWID" */ } if SQLITE_IGNORE == Xsqlite3AuthReadCol(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } } @@ -89544,18 +90481,14 @@ func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint // 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 Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, zArg2 uintptr, zArg3 uintptr) int32 { /* sqlite3.c:110316:20: */ +func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, zArg2 uintptr, zArg3 uintptr) int32 { /* sqlite3.c:111442:20: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var rc int32 // Don't do any authorization checks if the database is initialising // or if the parser is being invoked from within sqlite3_declare_vtab. - if ((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) || (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL) { - return SQLITE_OK - } - - if (*Sqlite3)(unsafe.Pointer(db)).FxAuth == uintptr(0) { + if (((*Sqlite3)(unsafe.Pointer(db)).FxAuth == uintptr(0)) || ((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0)) || (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL) { return SQLITE_OK } @@ -89566,9 +90499,9 @@ func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, // The following testcase() macros show that any of the 3rd through 6th // parameters can be either NULL or a string. - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 488 /* &.xAuth */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 496 /* &.xAuth */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == SQLITE_DENY { - Xsqlite3ErrorMsg(tls, pParse, ts+9998 /* "not authorized" */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+10363 /* "not authorized" */, 0) (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_AUTH } else if (rc != SQLITE_OK) && (rc != SQLITE_IGNORE) { rc = SQLITE_DENY @@ -89580,7 +90513,7 @@ func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, // Push an authorization context. After this routine is called, the // zArg3 argument to authorization callbacks will be zContext until // popped. Or if pParse==0, this routine is a no-op. -func Xsqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zContext uintptr) { /* sqlite3.c:110369:21: */ +func Xsqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zContext uintptr) { /* sqlite3.c:111491:21: */ (*AuthContext)(unsafe.Pointer(pContext)).FpParse = pParse (*AuthContext)(unsafe.Pointer(pContext)).FzAuthContext = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext @@ -89589,7 +90522,7 @@ func Xsqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zC // Pop an authorization context that was previously pushed // by sqlite3AuthContextPush -func Xsqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { /* sqlite3.c:110384:21: */ +func Xsqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { /* sqlite3.c:111506:21: */ if (*AuthContext)(unsafe.Pointer(pContext)).FpParse != 0 { (*Parse)(unsafe.Pointer((*AuthContext)(unsafe.Pointer(pContext)).FpParse)).FzAuthContext = (*AuthContext)(unsafe.Pointer(pContext)).FzAuthContext (*AuthContext)(unsafe.Pointer(pContext)).FpParse = uintptr(0) @@ -89604,13 +90537,8 @@ func Xsqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { /* sqlite3.c:1103 // 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 Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock U8, zName uintptr) { /* sqlite3.c:110443:21: */ - var pToplevel uintptr = func() uintptr { - if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { - return (*Parse)(unsafe.Pointer(pParse)).FpToplevel - } - return pParse - }() +func Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock U8, zName uintptr) { /* sqlite3.c:111565:21: */ + var pToplevel uintptr var i int32 var nBytes int32 var p uintptr @@ -89621,6 +90549,12 @@ func Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWr if !(Xsqlite3BtreeSharable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+uintptr(iDb)*32)).FpBt) != 0) { return } + pToplevel = func() uintptr { + if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { + return (*Parse)(unsafe.Pointer(pParse)).FpToplevel + } + return pParse + }() for i = 0; i < (*Parse)(unsafe.Pointer(pToplevel)).FnTableLock; i++ { p = ((*Parse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(i)*24) if ((*TableLock)(unsafe.Pointer(p)).FiDb == iDb) && ((*TableLock)(unsafe.Pointer(p)).FiTab == iTab) { @@ -89645,12 +90579,9 @@ func Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWr // Code an OP_TableLock instruction for each table locked by the // statement (configured by calls to sqlite3TableLock()). -func codeTableLocks(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110485:13: */ +func codeTableLocks(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:111608:13: */ var i int32 - var pVdbe uintptr - - pVdbe = Xsqlite3GetVdbe(tls, pParse) - // sqlite3GetVdbe cannot fail: VDBE already allocated + var pVdbe uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe for i = 0; i < (*Parse)(unsafe.Pointer(pParse)).FnTableLock; i++ { var p uintptr = ((*Parse)(unsafe.Pointer(pParse)).FaTableLock + uintptr(i)*24) @@ -89672,7 +90603,7 @@ func codeTableLocks(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110485:13: */ // // Note that if an error occurred, it might be the case that // no VDBE code was generated. -func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110526:21: */ +func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:111647:21: */ var db uintptr var v uintptr @@ -89689,9 +90620,36 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110526:2 // Begin by generating some termination code at the end of the // vdbe program - v = Xsqlite3GetVdbe(tls, pParse) + v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe + if v == uintptr(0) { + if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 { + (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_DONE + return + } + v = Xsqlite3GetVdbe(tls, pParse) + if v == uintptr(0) { + (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR + } + } if v != 0 { + if (*Parse)(unsafe.Pointer(pParse)).FbReturning != 0 { + var pReturning uintptr = *(*uintptr)(unsafe.Pointer(pParse + 184 /* &.u1 */)) + var addrRewind int32 + var i int32 + var reg int32 + + addrRewind = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur) + + reg = (*Returning)(unsafe.Pointer(pReturning)).FiRetReg + for i = 0; i < (*Returning)(unsafe.Pointer(pReturning)).FnRetCol; i++ { + Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, i, (reg + i)) + } + Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, reg, i) + Xsqlite3VdbeAddOp2(tls, v, OP_Next, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, (addrRewind + 1)) + + Xsqlite3VdbeJumpHere(tls, v, addrRewind) + } Xsqlite3VdbeAddOp0(tls, v, OP_Halt) // The cookie mask contains one bit for each database file open. @@ -89754,6 +90712,11 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110526:2 } } + if (*Parse)(unsafe.Pointer(pParse)).FbReturning != 0 { + var pRet uintptr = *(*uintptr)(unsafe.Pointer(pParse + 184 /* &.u1 */)) + Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Returning)(unsafe.Pointer(pRet)).FiRetCur, (*Returning)(unsafe.Pointer(pRet)).FnRetCol) + } + // Finally, jump back to the beginning of the executable code. Xsqlite3VdbeGoto(tls, v, 1) } @@ -89781,16 +90744,16 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110526:2 // Not everything is nestable. This facility is designed to permit // INSERT, UPDATE, and DELETE operations against the schema table. Use // care if you decide to try to use this routine for some other purposes. -func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:110653:21: */ - bp := tls.Alloc(168) - defer tls.Free(168) +func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:111804:21: */ + bp := tls.Alloc(160) + defer tls.Free(160) var ap Va_list _ = ap var zSql uintptr - *(*uintptr)(unsafe.Pointer(bp + 160 /* zErrMsg */)) = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 152 /* zErrMsg */)) = uintptr(0) var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - // var saveBuf [160]int8 at bp, 160 + // var saveBuf [152]int8 at bp, 152 if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return @@ -89810,12 +90773,12 @@ func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uint return } (*Parse)(unsafe.Pointer(pParse)).Fnested++ - libc.Xmemcpy(tls, bp /* &saveBuf[0] */, ((pParse) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */))))) - libc.Xmemset(tls, ((pParse) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), 0, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */))))) - Xsqlite3RunParser(tls, pParse, zSql, bp+160 /* &zErrMsg */) - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 160 /* zErrMsg */))) + libc.Xmemcpy(tls, bp /* &saveBuf[0] */, ((pParse) + uintptr((uint64((uintptr(0) + 256 /* &.sLastToken */))))), (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 256 /* &.sLastToken */))))) + libc.Xmemset(tls, ((pParse) + uintptr((uint64((uintptr(0) + 256 /* &.sLastToken */))))), 0, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 256 /* &.sLastToken */))))) + Xsqlite3RunParser(tls, pParse, zSql, bp+152 /* &zErrMsg */) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 152 /* zErrMsg */))) Xsqlite3DbFree(tls, db, zSql) - libc.Xmemcpy(tls, ((pParse) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), bp /* &saveBuf[0] */, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */))))) + libc.Xmemcpy(tls, ((pParse) + uintptr((uint64((uintptr(0) + 256 /* &.sLastToken */))))), bp /* &saveBuf[0] */, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 256 /* &.sLastToken */))))) (*Parse)(unsafe.Pointer(pParse)).Fnested-- } @@ -89829,7 +90792,7 @@ func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uint // auxiliary databases added using the ATTACH command. // // See also sqlite3LocateTable(). -func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintptr) uintptr { /* sqlite3.c:110705:22: */ +func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintptr) uintptr { /* sqlite3.c:111856:22: */ var p uintptr = uintptr(0) var i int32 @@ -89844,25 +90807,25 @@ func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Sqlite3)(unsafe.Pointer(db)).FnDb { // No match against the official names. But always match "main" // to schema 0 as a legacy fallback. - if Xsqlite3StrICmp(tls, zDatabase, ts+5282 /* "main" */) == 0 { + if Xsqlite3StrICmp(tls, zDatabase, ts+5327 /* "main" */) == 0 { i = 0 } else { return uintptr(0) } } p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema + 8 /* &.tblHash */), zName) - if (p == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+6905 /* "sqlite_" */, 7) == 0) { + if (p == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+6950 /* "sqlite_" */, 7) == 0) { if i == 1 { - if ((Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10013 /* "sqlite_temp_sche..." */ +7)) == 0) || - (Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10032 /* "sqlite_schema" */ +7)) == 0)) || - (Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+4780 /* "sqlite_master" */ +7)) == 0) { + if ((Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10378 /* "sqlite_temp_sche..." */ +7)) == 0) || + (Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10397 /* "sqlite_schema" */ +7)) == 0)) || + (Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+4825 /* "sqlite_master" */ +7)) == 0) { p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema + 8 /* &.tblHash */), - ts+10046 /* "sqlite_temp_mast..." */) + ts+10411 /* "sqlite_temp_mast..." */) } } else { - if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10032 /* "sqlite_schema" */ +7)) == 0 { + if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10397 /* "sqlite_schema" */ +7)) == 0 { p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema + 8 /* &.tblHash */), - ts+4780 /* "sqlite_master" */) + ts+4825 /* "sqlite_master" */) } } } @@ -89885,12 +90848,12 @@ func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp break } } - if (p == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+6905 /* "sqlite_" */, 7) == 0) { - if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10032 /* "sqlite_schema" */ +7)) == 0 { - p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema + 8 /* &.tblHash */), ts+4780 /* "sqlite_master" */) - } else if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10013 /* "sqlite_temp_sche..." */ +7)) == 0 { + if (p == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+6950 /* "sqlite_" */, 7) == 0) { + if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10397 /* "sqlite_schema" */ +7)) == 0 { + p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema + 8 /* &.tblHash */), ts+4825 /* "sqlite_master" */) + } else if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+10378 /* "sqlite_temp_sche..." */ +7)) == 0 { p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema + 8 /* &.tblHash */), - ts+10046 /* "sqlite_temp_mast..." */) + ts+10411 /* "sqlite_temp_mast..." */) } } } @@ -89905,7 +90868,7 @@ func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp // The difference between this routine and sqlite3FindTable() is that this // routine leaves an error message in pParse->zErrMsg where // sqlite3FindTable() does not. -func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr, zDbase uintptr) uintptr { /* sqlite3.c:110783:22: */ +func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr, zDbase uintptr) uintptr { /* sqlite3.c:111934:22: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -89914,7 +90877,7 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr // Read the database schema. If an error occurs, leave an error message // and code in pParse and return NULL. - if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaKnownOk) == U32(0)) && + if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaKnownOk)) == U32(0)) && (SQLITE_OK != Xsqlite3ReadSchema(tls, pParse)) { return uintptr(0) } @@ -89925,15 +90888,15 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr // CREATE, then check to see if it is the name of an virtual table that // can be an eponymous virtual table. if int32((*Parse)(unsafe.Pointer(pParse)).FdisableVtab) == 0 { - var pMod uintptr = Xsqlite3HashFind(tls, (db + 528 /* &.aModule */), zName) - if (pMod == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+10065 /* "pragma_" */, 7) == 0) { + var pMod uintptr = Xsqlite3HashFind(tls, (db + 536 /* &.aModule */), zName) + if (pMod == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+10430 /* "pragma_" */, 7) == 0) { pMod = Xsqlite3PragmaVtabRegister(tls, db, zName) } if (pMod != 0) && (Xsqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0) { return (*Module)(unsafe.Pointer(pMod)).FpEpoTab } } - if (flags & LOCATE_NOERR) != 0 { + if (flags & U32(LOCATE_NOERR)) != 0 { return uintptr(0) } (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) @@ -89943,15 +90906,15 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr if p == uintptr(0) { var zMsg uintptr - if (flags & LOCATE_VIEW) != 0 { - zMsg = ts + 10073 /* "no such view" */ + if (flags & U32(LOCATE_VIEW)) != 0 { + zMsg = ts + 10438 /* "no such view" */ } else { - zMsg = ts + 10086 /* "no such table" */ + zMsg = ts + 10451 /* "no such table" */ } if zDbase != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+5475 /* "%s: %s.%s" */, libc.VaList(bp, zMsg, zDbase, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+5520 /* "%s: %s.%s" */, libc.VaList(bp, zMsg, zDbase, zName)) } else { - Xsqlite3ErrorMsg(tls, pParse, ts+5485 /* "%s: %s" */, libc.VaList(bp+24, zMsg, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+5530 /* "%s: %s" */, libc.VaList(bp+24, zMsg, zName)) } } @@ -89965,16 +90928,16 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr // 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 Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr) uintptr { /* sqlite3.c:110843:22: */ +func Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr) uintptr { /* sqlite3.c:111994:22: */ var zDb uintptr - if (*SrcList_item)(unsafe.Pointer(p)).FpSchema != 0 { - var iDb int32 = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcList_item)(unsafe.Pointer(p)).FpSchema) + if (*SrcItem)(unsafe.Pointer(p)).FpSchema != 0 { + var iDb int32 = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcItem)(unsafe.Pointer(p)).FpSchema) zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32)).FzDbSName } else { - zDb = (*SrcList_item)(unsafe.Pointer(p)).FzDatabase + zDb = (*SrcItem)(unsafe.Pointer(p)).FzDatabase } - return Xsqlite3LocateTable(tls, pParse, flags, (*SrcList_item)(unsafe.Pointer(p)).FzName, zDb) + return Xsqlite3LocateTable(tls, pParse, flags, (*SrcItem)(unsafe.Pointer(p)).FzName, zDb) } // Locate the in-memory structure that describes @@ -89987,7 +90950,7 @@ func Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr // for duplicate index names is done.) The search order is // TEMP first, then MAIN, then any auxiliary databases added // using the ATTACH command. -func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:110871:22: */ +func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:112022:22: */ var p uintptr = uintptr(0) var i int32 // All mutexes are required for schema access. Make sure we hold them. @@ -90014,7 +90977,7 @@ func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) ui } // Reclaim the memory used by an index -func Xsqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:110891:21: */ +func Xsqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:112042:21: */ Xsqlite3DeleteIndexSamples(tls, db, p) Xsqlite3ExprDelete(tls, db, (*Index)(unsafe.Pointer(p)).FpPartIdxWhere) Xsqlite3ExprListDelete(tls, db, (*Index)(unsafe.Pointer(p)).FaColExpr) @@ -90030,7 +90993,7 @@ func Xsqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:1108 // 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 Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName uintptr) { /* sqlite3.c:110911:21: */ +func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName uintptr) { /* sqlite3.c:112062:21: */ var pIndex uintptr var pHash uintptr @@ -90053,7 +91016,7 @@ func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName } Xsqlite3FreeIndex(tls, db, pIndex) } - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) } // Look through the list of open database files in db->aDb[] and if @@ -90062,7 +91025,7 @@ func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName // // Entry 0 (the "main" database) and entry 1 (the "temp" database) // are never candidates for being collapsed. -func Xsqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { /* sqlite3.c:110944:21: */ +func Xsqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { /* sqlite3.c:112095:21: */ var i int32 var j int32 for i = libc.AssignInt32(&j, 2); i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { @@ -90078,17 +91041,17 @@ func Xsqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { /* sqlite3.c:110 j++ } (*Sqlite3)(unsafe.Pointer(db)).FnDb = j - if ((*Sqlite3)(unsafe.Pointer(db)).FnDb <= 2) && ((*Sqlite3)(unsafe.Pointer(db)).FaDb != db+648 /* &.aDbStatic */) { - libc.Xmemcpy(tls, db+648 /* &.aDbStatic */, (*Sqlite3)(unsafe.Pointer(db)).FaDb, (uint64(2) * uint64(unsafe.Sizeof(Db{})))) + if ((*Sqlite3)(unsafe.Pointer(db)).FnDb <= 2) && ((*Sqlite3)(unsafe.Pointer(db)).FaDb != db+656 /* &.aDbStatic */) { + libc.Xmemcpy(tls, db+656 /* &.aDbStatic */, (*Sqlite3)(unsafe.Pointer(db)).FaDb, (uint64(2) * uint64(unsafe.Sizeof(Db{})))) Xsqlite3DbFree(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaDb) - (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 648 /* &.aDbStatic */ + (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 656 /* &.aDbStatic */ } } // Reset the schema for the database at index iDb. Also reset the // TEMP schema. The reset is deferred if db->nSchemaLock is not zero. // Deferred resets may be run by calling with iDb<0. -func Xsqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32) { /* sqlite3.c:110971:21: */ +func Xsqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32) { /* sqlite3.c:112122:21: */ var i int32 if iDb >= 0 { @@ -90109,7 +91072,7 @@ func Xsqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32) { /* sqlite3.c // Erase all schema information from all attached databases (including // "main" and "temp") for a single database connection. -func Xsqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr) { /* sqlite3.c:110995:21: */ +func Xsqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr) { /* sqlite3.c:112146:21: */ var i int32 Xsqlite3BtreeEnterAll(tls, db) for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { @@ -90131,13 +91094,13 @@ func Xsqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr) { /* sqlite3 } // This routine is called when a commit occurs. -func Xsqlite3CommitInternalChanges(tls *libc.TLS, db uintptr) { /* sqlite3.c:111019:21: */ +func Xsqlite3CommitInternalChanges(tls *libc.TLS, db uintptr) { /* sqlite3.c:112170:21: */ *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaChange))) } // Delete memory allocated for the column names of a table or view (the // Table.aCol[] array). -func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:111027:21: */ +func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:112178:21: */ var i int32 var pCol uintptr @@ -90179,7 +91142,7 @@ func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { /* s // 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 *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:111057:29: */ +func deleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:112208:29: */ var pIndex uintptr var pNext uintptr @@ -90212,7 +91175,7 @@ func deleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:11105 } -func Xsqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:111108:21: */ +func Xsqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:112259:21: */ // Do not delete the table until the reference count reaches zero. if !(pTable != 0) { return @@ -90225,7 +91188,7 @@ func Xsqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3 // Unlink the given table from the hash tables and the delete the // table structure with all its indices and foreign keys. -func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName uintptr) { /* sqlite3.c:111120:21: */ +func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName uintptr) { /* sqlite3.c:112271:21: */ var p uintptr var pDb uintptr @@ -90233,7 +91196,7 @@ func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32) p = Xsqlite3HashInsert(tls, ((*Db)(unsafe.Pointer(pDb)).FpSchema + 8 /* &.tblHash */), zTabName, uintptr(0)) Xsqlite3DeleteTable(tls, db, p) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) } // Given a token, return a string that consists of the text of that @@ -90247,7 +91210,7 @@ func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName // 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 Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr { /* sqlite3.c:111148:21: */ +func Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr { /* sqlite3.c:112299:21: */ var zName uintptr if pName != 0 { zName = Xsqlite3DbStrNDup(tls, db, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn)) @@ -90260,9 +91223,9 @@ func Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr { / // Open the sqlite_schema table stored in database number iDb for // writing. The table is opened using cursor 0. -func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { /* sqlite3.c:111163:21: */ +func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { /* sqlite3.c:112314:21: */ var v uintptr = Xsqlite3GetVdbe(tls, p) - Xsqlite3TableLock(tls, p, iDb, SCHEMA_ROOT, uint8(1), ts+4780 /* "sqlite_master" */) + Xsqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), ts+4825 /* "sqlite_master" */) Xsqlite3VdbeAddOp4Int(tls, v, OP_OpenWrite, 0, SCHEMA_ROOT, iDb, 5) if (*Parse)(unsafe.Pointer(p)).FnTab == 0 { (*Parse)(unsafe.Pointer(p)).FnTab = 1 @@ -90273,7 +91236,7 @@ func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { /* sqlite3.c // 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 Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:111178:20: */ +func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:112329:20: */ var i int32 = -1 // Database number if zName != 0 { var pDb uintptr @@ -90289,7 +91252,7 @@ func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sql } // "main" is always an acceptable alias for the primary database // even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. - if (i == 0) && (0 == Xsqlite3_stricmp(tls, ts+5282 /* "main" */, zName)) { + if (i == 0) && (0 == Xsqlite3_stricmp(tls, ts+5327 /* "main" */, zName)) { goto __3 } @@ -90309,7 +91272,7 @@ func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sql // "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 Xsqlite3FindDb(tls *libc.TLS, db uintptr, pName uintptr) int32 { /* sqlite3.c:111198:20: */ +func Xsqlite3FindDb(tls *libc.TLS, db uintptr, pName uintptr) int32 { /* sqlite3.c:112349:20: */ var i int32 // Database number var zName uintptr // Name we are searching for zName = Xsqlite3NameFromToken(tls, db, pName) @@ -90333,7 +91296,7 @@ func Xsqlite3FindDb(tls *libc.TLS, db uintptr, pName uintptr) int32 { /* sqlite3 // 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 Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pUnqual uintptr) int32 { /* sqlite3.c:111223:20: */ +func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pUnqual uintptr) int32 { /* sqlite3.c:112374:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -90342,13 +91305,13 @@ func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if (*Token)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+10100 /* "corrupt database" */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+10465 /* "corrupt database" */, 0) return -1 } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = Xsqlite3FindDb(tls, db, pName1) if iDb < 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+10117 /* "unknown database..." */, libc.VaList(bp, pName1)) + Xsqlite3ErrorMsg(tls, pParse, ts+10482 /* "unknown database..." */, libc.VaList(bp, pName1)) return -1 } } else { @@ -90360,9 +91323,9 @@ func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } // True if PRAGMA writable_schema is ON -func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:111256:20: */ +func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:112407:20: */ - return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (uint64(SQLITE_WriteSchema | SQLITE_Defensive))) == SQLITE_WriteSchema)) + return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (uint64(SQLITE_WriteSchema | SQLITE_Defensive))) == uint64(SQLITE_WriteSchema))) } // This routine is used to check if the UTF-8 string zName is a legal @@ -90374,13 +91337,13 @@ func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:1112 // When parsing the sqlite_schema table, this routine also checks to // make sure the "type", "name", and "tbl_name" columns are consistent // with the SQL. -func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType uintptr, zTblName uintptr) int32 { /* sqlite3.c:111278:20: */ +func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType uintptr, zTblName uintptr) int32 { /* sqlite3.c:112429:20: */ bp := tls.Alloc(8) defer tls.Free(8) var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if ((Xsqlite3WritableSchema(tls, db) != 0) || - ((uint32(int32(*(*uint8)(unsafe.Pointer((db + 176 /* &.init */) + 8 /* &.imposterTable */)) & 0x2 >> 1))) != 0)) || + ((uint32(int32(*(*uint8)(unsafe.Pointer((db + 184 /* &.init */) + 8 /* &.imposterTable */)) & 0x2 >> 1))) != 0)) || !(int32(Xsqlite3Config.FbExtraSchemaChecks) != 0) { // Skip these error checks for writable_schema=ON return SQLITE_OK @@ -90393,9 +91356,9 @@ func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType return SQLITE_ERROR } } else { - if ((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && (0 == Xsqlite3_strnicmp(tls, zName, ts+6905 /* "sqlite_" */, 7))) || + if ((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && (0 == Xsqlite3_strnicmp(tls, zName, ts+6950 /* "sqlite_" */, 7))) || ((Xsqlite3ReadOnlyShadowTables(tls, db) != 0) && (Xsqlite3ShadowTableName(tls, db, zName) != 0)) { - Xsqlite3ErrorMsg(tls, pParse, ts+10137, /* "object name rese..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+10502, /* "object name rese..." */ libc.VaList(bp, zName)) return SQLITE_ERROR } @@ -90405,7 +91368,7 @@ func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType } // Return the PRIMARY KEY index of a table -func Xsqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:111316:22: */ +func Xsqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:112467:22: */ var p uintptr for p = (*Table)(unsafe.Pointer(pTab)).FpIndex; (p != 0) && !((int32(*(*uint16)(unsafe.Pointer((p) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY); p = (*Index)(unsafe.Pointer(p)).FpNext { } @@ -90416,7 +91379,7 @@ func Xsqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c // for the column iCol in the table (as defined by the CREATE TABLE statement) // find the (first) offset of that column in index pIdx. Or return -1 // if column iCol is not used in index pIdx. -func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16 { /* sqlite3.c:111328:20: */ +func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16 { /* sqlite3.c:112479:20: */ var i int32 for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ { if int32(iCol) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { @@ -90436,8 +91399,8 @@ func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16 { /* // and only there are VIRTUAL columns to the left. // // If SQLITE_OMIT_GENERATED_COLUMNS, this routine is a no-op macro. -func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:111348:20: */ - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasVirtual) != 0 { +func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:112499:20: */ + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasVirtual)) != 0 { var i int32 for i = 0; i <= int32(iCol); i++ { if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) != 0 { @@ -90483,11 +91446,11 @@ func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16 { / // this routine is a no-op macro. If the pTab does not have any virtual // columns, then this routine is no-op that always return iCol. If iCol // is negative (indicating the ROWID column) then this routine return iCol. -func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:111396:20: */ +func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:112547:20: */ var i int32 var n I16 - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasVirtual) == U32(0)) || (int32(iCol) < 0) { + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasVirtual)) == U32(0)) || (int32(iCol) < 0) { return iCol } i = 0 @@ -90521,7 +91484,7 @@ func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16 { / // 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 Xsqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, isTemp int32, isView int32, isVirtual int32, noErr int32) { /* sqlite3.c:111430:21: */ +func Xsqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, isTemp int32, isView int32, isVirtual int32, noErr int32) { /* sqlite3.c:112581:21: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -90549,9 +91512,9 @@ func Xsqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui iDb = int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) zName = Xsqlite3DbStrDup(tls, db, func() uintptr { if (!(0 != 0)) && (iDb == 1) { - return ts + 10046 /* "sqlite_temp_mast..." */ + return ts + 10411 /* "sqlite_temp_mast..." */ } - return ts + 4780 /* "sqlite_master" */ + return ts + 4825 /* "sqlite_master" */ }()) *(*uintptr)(unsafe.Pointer(bp + 16 /* pName */)) = pName1 goto __2 @@ -90569,7 +91532,7 @@ __3: } // If creating a temp table, the name may not be qualified. Unless // the database name is "temp" anyway. - Xsqlite3ErrorMsg(tls, pParse, ts+10179 /* "temporary table ..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+10544 /* "temporary table ..." */, 0) return __4: ; @@ -90597,9 +91560,9 @@ __7: ; if !(Xsqlite3CheckObjectName(tls, pParse, zName, func() uintptr { if isView != 0 { - return ts + 8668 /* "view" */ + return ts + 8770 /* "view" */ } - return ts + 7333 /* "table" */ + return ts + 7386 /* "table" */ }(), zName) != 0) { goto __8 } @@ -90616,9 +91579,9 @@ __9: zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr { if (!(0 != 0)) && (isTemp == 1) { - return ts + 10046 /* "sqlite_temp_mast..." */ + return ts + 10411 /* "sqlite_temp_mast..." */ } - return ts + 4780 /* "sqlite_master" */ + return ts + 4825 /* "sqlite_master" */ }(), uintptr(0), zDb) != 0) { goto __10 } @@ -90656,7 +91619,7 @@ __13: if !(!(noErr != 0)) { goto __15 } - Xsqlite3ErrorMsg(tls, pParse, ts+10220 /* "table %T already..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 16 /* pName */)))) + Xsqlite3ErrorMsg(tls, pParse, ts+10585 /* "table %T already..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 16 /* pName */)))) goto __16 __15: ; @@ -90669,7 +91632,7 @@ __14: if !(Xsqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0)) { goto __17 } - Xsqlite3ErrorMsg(tls, pParse, ts+10244 /* "there is already..." */, libc.VaList(bp+8, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+10609 /* "there is already..." */, libc.VaList(bp+8, zName)) goto begin_table_error __17: ; @@ -90697,7 +91660,7 @@ __18: // If this is the magic sqlite_sequence table used by autoincrement, // then record a pointer to this table in the main database structure // so that INSERT can find the table easily. - if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) && (libc.Xstrcmp(tls, zName, ts+7855 /* "sqlite_sequence" */) == 0)) { + if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) && (libc.Xstrcmp(tls, zName, ts+7908 /* "sqlite_sequence" */) == 0)) { goto __19 } @@ -90732,7 +91695,7 @@ __21: Xsqlite3VdbeAddOp3(tls, v, OP_ReadCookie, iDb, reg3, BTREE_FILE_FORMAT) Xsqlite3VdbeUsesBtree(tls, v, iDb) addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_If, reg3) - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyFileFmt) != uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyFileFmt)) != uint64(0) { fileFormat = 1 } else { fileFormat = SQLITE_MAX_FILE_FORMAT @@ -90755,15 +91718,15 @@ __21: Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, reg2) goto __23 __22: - - (*Parse)(unsafe.Pointer(pParse)).FaddrCrTab = Xsqlite3VdbeAddOp3(tls, v, OP_CreateBtree, iDb, reg2, BTREE_INTKEY) + ; + *(*int32)(unsafe.Pointer(pParse + 184 /* &.u1 */)) = Xsqlite3VdbeAddOp3(tls, v, OP_CreateBtree, iDb, reg2, BTREE_INTKEY) __23: ; Xsqlite3OpenSchemaTable(tls, pParse, iDb) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, 0, reg1) Xsqlite3VdbeAddOp4(tls, v, OP_Blob, 6, reg3, 0, uintptr(unsafe.Pointer(&nullRow)), -1) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, 0, reg3, reg1) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3VdbeAddOp0(tls, v, OP_Close) __20: ; @@ -90778,23 +91741,93 @@ begin_table_error: } var aCode = [4]U8{ - SQLITE_CREATE_TABLE, - SQLITE_CREATE_TEMP_TABLE, - SQLITE_CREATE_VIEW, - SQLITE_CREATE_TEMP_VIEW, -} /* sqlite3.c:111477:21 */ -var nullRow = [6]int8{int8(6), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:111565:23 */ + U8(SQLITE_CREATE_TABLE), + U8(SQLITE_CREATE_TEMP_TABLE), + U8(SQLITE_CREATE_VIEW), + U8(SQLITE_CREATE_TEMP_VIEW), +} /* sqlite3.c:112628:21 */ +var nullRow = [6]int8{int8(6), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:112716:23 */ // Set properties of a table column based on the (magical) // name of the column. +// Name of the special TEMP trigger used to implement RETURNING. The +// name begins with "sqlite_" so that it is guaranteed not to collide +// with any application-generated triggers. + +// Clean up the data structures associated with the RETURNING clause. +func sqlite3DeleteReturning(tls *libc.TLS, db uintptr, pRet uintptr) { /* sqlite3.c:112800:13: */ + var pHash uintptr + pHash = ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema + 56 /* &.trigHash */) + Xsqlite3HashInsert(tls, pHash, ts+10644 /* "sqlite_returning" */, uintptr(0)) + Xsqlite3ExprListDelete(tls, db, (*Returning)(unsafe.Pointer(pRet)).FpReturnEL) + Xsqlite3DbFree(tls, db, pRet) +} + +// Add the RETURNING clause to the parse currently underway. +// +// This routine creates a special TEMP trigger that will fire for each row +// of the DML statement. That TEMP trigger contains a single SELECT +// statement with a result set that is the argument of the RETURNING clause. +// The trigger has the Trigger.bReturning flag and an opcode of +// TK_RETURNING instead of TK_SELECT, so that the trigger code generator +// knows to handle it specially. The TEMP trigger is automatically +// removed at the end of the parse. +// +// When this routine is called, we do not yet know if the RETURNING clause +// is attached to a DELETE, INSERT, or UPDATE, so construct it as a +// RETURNING trigger instead. It will then be converted into the appropriate +// type on the first call to sqlite3TriggersExist(). +func Xsqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sqlite3.c:112824:21: */ + var pRet uintptr + var pHash uintptr + var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb + if (*Parse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { + Xsqlite3ErrorMsg(tls, pParse, ts+10661 /* "cannot use RETUR..." */, 0) + } else { + + } + (*Parse)(unsafe.Pointer(pParse)).FbReturning = U8(1) + pRet = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Returning{}))) + if pRet == uintptr(0) { + Xsqlite3ExprListDelete(tls, db, pList) + return + } + *(*uintptr)(unsafe.Pointer(pParse + 184 /* &.u1 */)) = pRet + (*Returning)(unsafe.Pointer(pRet)).FpParse = pParse + (*Returning)(unsafe.Pointer(pRet)).FpReturnEL = pList + Xsqlite3ParserAddCleanup(tls, pParse, + *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{sqlite3DeleteReturning})), pRet) + + if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + return + } + (*Returning)(unsafe.Pointer(pRet)).FretTrig.FzName = ts + 10644 /* "sqlite_returning" */ + (*Returning)(unsafe.Pointer(pRet)).FretTrig.Fop = U8(TK_RETURNING) + (*Returning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = U8(TRIGGER_AFTER) + (*Returning)(unsafe.Pointer(pRet)).FretTrig.FbReturning = U8(1) + (*Returning)(unsafe.Pointer(pRet)).FretTrig.FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FpSchema + (*Returning)(unsafe.Pointer(pRet)).FretTrig.Fstep_list = (pRet + 88 /* &.retTStep */) + (*Returning)(unsafe.Pointer(pRet)).FretTStep.Fop = U8(TK_RETURNING) + (*Returning)(unsafe.Pointer(pRet)).FretTStep.FpTrig = (pRet + 16 /* &.retTrig */) + (*Returning)(unsafe.Pointer(pRet)).FretTStep.FpExprList = pList + pHash = ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema + 56 /* &.trigHash */) + + if Xsqlite3HashInsert(tls, pHash, ts+10644 /* "sqlite_returning" */, (pRet+16 /* &.retTrig */)) == + (pRet + 16 /* &.retTrig */) { + Xsqlite3OomFault(tls, db) + } +} + // 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 Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintptr) { /* sqlite3.c:111646:21: */ +func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintptr) { /* sqlite3.c:112871:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -90804,11 +91837,13 @@ func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintp var zType uintptr var pCol uintptr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb + var hName U8 + if (libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0) { return } - if (int32((*Table)(unsafe.Pointer(p)).FnCol) + 1) > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 2*4)) { - Xsqlite3ErrorMsg(tls, pParse, ts+10279 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName)) + if (int32((*Table)(unsafe.Pointer(p)).FnCol) + 1) > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 2*4)) { + Xsqlite3ErrorMsg(tls, pParse, ts+10695 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName)) return } z = Xsqlite3DbMallocRaw(tls, db, (uint64(((*Token)(unsafe.Pointer(pName)).Fn + (*Token)(unsafe.Pointer(pType)).Fn) + uint32(2)))) @@ -90821,9 +91856,10 @@ func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintp libc.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn)) *(*int8)(unsafe.Pointer(z + uintptr((*Token)(unsafe.Pointer(pName)).Fn))) = int8(0) Xsqlite3Dequote(tls, z) + hName = Xsqlite3StrIHash(tls, z) for i = 0; i < int32((*Table)(unsafe.Pointer(p)).FnCol); i++ { - if Xsqlite3_stricmp(tls, z, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*32)).FzName) == 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+10302 /* "duplicate column..." */, libc.VaList(bp+8, z)) + if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*32)).FhName) == int32(hName)) && (Xsqlite3StrICmp(tls, z, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*32)).FzName) == 0) { + Xsqlite3ErrorMsg(tls, pParse, ts+10718 /* "duplicate column..." */, libc.VaList(bp+8, z)) Xsqlite3DbFree(tls, db, z) return } @@ -90840,12 +91876,12 @@ func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintp pCol = ((*Table)(unsafe.Pointer(p)).FaCol + uintptr((*Table)(unsafe.Pointer(p)).FnCol)*32) libc.Xmemset(tls, pCol, 0, uint64(unsafe.Sizeof(Column{}))) (*Column)(unsafe.Pointer(pCol)).FzName = z - (*Column)(unsafe.Pointer(pCol)).FhName = Xsqlite3StrIHash(tls, z) + (*Column)(unsafe.Pointer(pCol)).FhName = hName if (*Token)(unsafe.Pointer(pType)).Fn == uint32(0) { // If there is no type specified, columns have the default affinity // 'BLOB' with a default size of 4 bytes. - (*Column)(unsafe.Pointer(pCol)).Faffinity = SQLITE_AFF_BLOB + (*Column)(unsafe.Pointer(pCol)).Faffinity = int8(SQLITE_AFF_BLOB) (*Column)(unsafe.Pointer(pCol)).FszEst = U8(1) } else { zType = ((z + uintptr(Xsqlite3Strlen30(tls, z))) + uintptr(1)) @@ -90864,7 +91900,7 @@ func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintp // 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 Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlite3.c:111715:21: */ +func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlite3.c:112943:21: */ var p uintptr var pCol uintptr p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable @@ -90873,7 +91909,7 @@ func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlit } pCol = ((*Table)(unsafe.Pointer(p)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(p)).FnCol)-1))*32) (*Column)(unsafe.Pointer(pCol)).FnotNull = U8(onError) - *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (TF_HasNotNull) + *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_HasNotNull)) // Set the uniqNotNull flag on any UNIQUE or PK indexes already created // on this column. @@ -90911,41 +91947,41 @@ func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlit // // If none of the substrings in the above table are found, // SQLITE_AFF_NUMERIC is returned. -func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) int8 { /* sqlite3.c:111762:21: */ +func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) int8 { /* sqlite3.c:112990:21: */ bp := tls.Alloc(4) defer tls.Free(4) var h U32 = U32(0) - var aff int8 = SQLITE_AFF_NUMERIC + var aff int8 = int8(SQLITE_AFF_NUMERIC) var zChar uintptr = uintptr(0) for *(*int8)(unsafe.Pointer(zIn)) != 0 { h = ((h << 8) + U32(Xsqlite3UpperToLower[((int32(*(*int8)(unsafe.Pointer(zIn))))&0xff)])) zIn++ if h == (U32((((int32('c') << 24) + (int32('h') << 16)) + (int32('a') << 8)) + 'r')) { // CHAR - aff = SQLITE_AFF_TEXT + aff = int8(SQLITE_AFF_TEXT) zChar = zIn } else if h == (U32((((int32('c') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'b')) { // CLOB - aff = SQLITE_AFF_TEXT + aff = int8(SQLITE_AFF_TEXT) } else if h == (U32((((int32('t') << 24) + (int32('e') << 16)) + (int32('x') << 8)) + 't')) { // TEXT - aff = SQLITE_AFF_TEXT + aff = int8(SQLITE_AFF_TEXT) } else if (h == (U32((((int32('b') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'b'))) && // BLOB ((int32(aff) == SQLITE_AFF_NUMERIC) || (int32(aff) == SQLITE_AFF_REAL)) { - aff = SQLITE_AFF_BLOB + aff = int8(SQLITE_AFF_BLOB) if int32(*(*int8)(unsafe.Pointer(zIn))) == '(' { zChar = zIn } } else if (h == (U32((((int32('r') << 24) + (int32('e') << 16)) + (int32('a') << 8)) + 'l'))) && // REAL (int32(aff) == SQLITE_AFF_NUMERIC) { - aff = SQLITE_AFF_REAL + aff = int8(SQLITE_AFF_REAL) } else if (h == (U32((((int32('f') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'a'))) && // FLOA (int32(aff) == SQLITE_AFF_NUMERIC) { - aff = SQLITE_AFF_REAL + aff = int8(SQLITE_AFF_REAL) } else if (h == (U32((((int32('d') << 24) + (int32('o') << 16)) + (int32('u') << 8)) + 'b'))) && // DOUB (int32(aff) == SQLITE_AFF_NUMERIC) { - aff = SQLITE_AFF_REAL + aff = int8(SQLITE_AFF_REAL) } else if (h & U32(0x00FFFFFF)) == (U32(((int32('i') << 16) + (int32('n') << 8)) + 't')) { // INT - aff = SQLITE_AFF_INTEGER + aff = int8(SQLITE_AFF_INTEGER) break } } @@ -90985,7 +92021,7 @@ func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) int8 { /* sq // // This routine is called by the parser while in the middle of // parsing a CREATE TABLE statement. -func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:111839:21: */ +func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:113067:21: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -90997,11 +92033,11 @@ func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar var isInit int32 = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) != 1))) pCol = ((*Table)(unsafe.Pointer(p)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(p)).FnCol)-1))*32) if !(Xsqlite3ExprIsConstantOrFunction(tls, pExpr, uint8(isInit)) != 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+10328, /* "default value of..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+10744, /* "default value of..." */ libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName)) } else if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_GENERATED) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+10373 /* "cannot use DEFAU..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+10789 /* "cannot use DEFAU..." */, 0) } else { // A copy of pExpr is used instead of the original, as pExpr contains // tokens that point to volatile memory. @@ -91009,10 +92045,10 @@ func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar Xsqlite3ExprDelete(tls, db, (*Column)(unsafe.Pointer(pCol)).FpDflt) libc.Xmemset(tls, bp+8 /* &x */, 0, uint64(unsafe.Sizeof(Expr{}))) - (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fop = TK_SPAN + (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fop = U8(TK_SPAN) *(*uintptr)(unsafe.Pointer(bp + 8 /* &x */ + 8 /* &.u */)) = Xsqlite3DbSpanDup(tls, db, zStart, zEnd) (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).FpLeft = pExpr - (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fflags = EP_Skip + (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fflags = U32(EP_Skip) (*Column)(unsafe.Pointer(pCol)).FpDflt = Xsqlite3ExprDup(tls, db, bp+8 /* &x */, EXPRDUP_REDUCE) Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 /* &x */ + 8 /* &.u */))) } @@ -91037,21 +92073,21 @@ func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar // if the expression is just a TK_STRING with an optional COLLATE clause. // If the expression is anything other than TK_STRING, the expression is // unchanged. -func sqlite3StringToId(tls *libc.TLS, p uintptr) { /* sqlite3.c:111898:13: */ +func sqlite3StringToId(tls *libc.TLS, p uintptr) { /* sqlite3.c:113126:13: */ if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_STRING { - (*Expr)(unsafe.Pointer(p)).Fop = TK_ID + (*Expr)(unsafe.Pointer(p)).Fop = U8(TK_ID) } else if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLLATE) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop) == TK_STRING) { - (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop = TK_ID + (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop = U8(TK_ID) } } // Tag the given column as being part of the PRIMARY KEY -func makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { /* sqlite3.c:111909:13: */ +func makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { /* sqlite3.c:113137:13: */ *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) |= U16((COLFLAG_PRIMKEY)) if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_GENERATED) != 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+10414 /* "generated column..." */, 0) + ts+10830 /* "generated column..." */, 0) } } @@ -91071,7 +92107,7 @@ func makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { / // // 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 Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError int32, autoInc int32, sortOrder int32) { /* sqlite3.c:111939:21: */ +func Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError int32, autoInc int32, sortOrder int32) { /* sqlite3.c:113167:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -91092,15 +92128,15 @@ func Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit __1: ; - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasPrimaryKey) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasPrimaryKey)) != 0) { goto __2 } Xsqlite3ErrorMsg(tls, pParse, - ts+10466 /* "table \"%s\" has m..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + ts+10882 /* "table \"%s\" has m..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit __2: ; - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_HasPrimaryKey) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_HasPrimaryKey)) if !(pList == uintptr(0)) { goto __3 } @@ -91156,7 +92192,7 @@ __4: ; if !((((nTerm == 1) && (pCol != 0)) && - (Xsqlite3StrICmp(tls, Xsqlite3ColumnType(tls, pCol, ts+703 /* "" */), ts+10507 /* "INTEGER" */) == 0)) && + (Xsqlite3StrICmp(tls, Xsqlite3ColumnType(tls, pCol, ts+703 /* "" */), ts+10923 /* "INTEGER" */) == 0)) && (sortOrder != SQLITE_SO_DESC)) { goto __13 } @@ -91184,11 +92220,11 @@ __13: goto __17 } Xsqlite3ErrorMsg(tls, pParse, - ts+10515 /* "AUTOINCREMENT is..." */, 0) + ts+10931 /* "AUTOINCREMENT is..." */, 0) goto __18 __17: Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), - uintptr(0), sortOrder, 0, SQLITE_IDXTYPE_PRIMARYKEY) + uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) __18: ; @@ -91201,7 +92237,10 @@ primary_key_exit: } // Add a new CHECK constraint to the table currently under construction. -func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintptr) { /* sqlite3.c:112014:21: */ +func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:113242:21: */ + bp := tls.Alloc(16) + defer tls.Free(16) + var pTab uintptr = (*Parse)(unsafe.Pointer(pParse)).FpNewTable var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if ((pTab != 0) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB)) && @@ -91209,6 +92248,17 @@ func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt (*Table)(unsafe.Pointer(pTab)).FpCheck = Xsqlite3ExprListAppend(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) if (*Parse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { Xsqlite3ExprListSetName(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FpCheck, (pParse + 96 /* &.constraintName */), 1) + } else { + // var t Token at bp, 16 + + for zStart++; (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zStart)))]) & 0x01) != 0; zStart++ { + } + for (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zEnd + libc.UintptrFromInt32(-1))))]) & 0x01) != 0 { + zEnd-- + } + (*Token)(unsafe.Pointer(bp /* &t */)).Fz = zStart + (*Token)(unsafe.Pointer(bp /* &t */)).Fn = uint32((int32((int64(zEnd) - int64((*Token)(unsafe.Pointer(bp /* &t */)).Fz)) / 1))) + Xsqlite3ExprListSetName(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FpCheck, bp /* &t */, 1) } } else { Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pCheckExpr) @@ -91217,13 +92267,13 @@ func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt // Set the collation function of the most recently parsed table column // to the CollSeq given. -func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) { /* sqlite3.c:112039:21: */ +func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) { /* sqlite3.c:113276:21: */ var p uintptr var i int32 var zColl uintptr // Dequoted name of collation sequence var db uintptr - if (libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0) { + if ((libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0)) || (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { return } i = (int32((*Table)(unsafe.Pointer(p)).FnCol) - 1) @@ -91254,14 +92304,14 @@ func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) { /* // Change the most recently parsed column to be a GENERATED ALWAYS AS // column. -func Xsqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType uintptr) { /* sqlite3.c:112074:21: */ +func Xsqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType uintptr) { /* sqlite3.c:113311:21: */ bp := tls.Alloc(8) defer tls.Free(8) var eType U8 var pTab uintptr var pCol uintptr - eType = COLFLAG_VIRTUAL + eType = U8(COLFLAG_VIRTUAL) pTab = (*Parse)(unsafe.Pointer(pParse)).FpNewTable if !(pTab == uintptr(0)) { goto __1 @@ -91274,7 +92324,7 @@ __1: if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB) { goto __2 } - Xsqlite3ErrorMsg(tls, pParse, ts+10571 /* "virtual tables c..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+10987 /* "virtual tables c..." */, 0) goto generated_done __2: ; @@ -91287,16 +92337,16 @@ __3: if !(pType != 0) { goto __4 } - if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(7)) && (Xsqlite3_strnicmp(tls, ts+10614 /* "virtual" */, (*Token)(unsafe.Pointer(pType)).Fz, 7) == 0)) { + if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(7)) && (Xsqlite3_strnicmp(tls, ts+11030 /* "virtual" */, (*Token)(unsafe.Pointer(pType)).Fz, 7) == 0)) { goto __5 } // no-op goto __6 __5: - if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(6)) && (Xsqlite3_strnicmp(tls, ts+10622 /* "stored" */, (*Token)(unsafe.Pointer(pType)).Fz, 6) == 0)) { + if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(6)) && (Xsqlite3_strnicmp(tls, ts+11038 /* "stored" */, (*Token)(unsafe.Pointer(pType)).Fz, 6) == 0)) { goto __7 } - eType = COLFLAG_STORED + eType = U8(COLFLAG_STORED) goto __8 __7: goto generated_error @@ -91326,7 +92376,7 @@ __10: goto generated_done generated_error: - Xsqlite3ErrorMsg(tls, pParse, ts+10629, /* "error in generat..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+11045, /* "error in generat..." */ libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName)) generated_done: Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -91349,7 +92399,7 @@ generated_done: // // IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments // the schema-version whenever the schema changes. -func Xsqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:112142:21: */ +func Xsqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:113379:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe @@ -91363,7 +92413,7 @@ func Xsqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3 // // The estimate is conservative. It might be larger that what is // really needed. -func identLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:112158:12: */ +func identLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:113395:12: */ var n int32 n = 0 __1: @@ -91398,7 +92448,7 @@ __3: // 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 *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /* sqlite3.c:112179:13: */ +func identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /* sqlite3.c:113416:13: */ var zIdent uintptr = zSignedIdent var i int32 var j int32 @@ -91434,7 +92484,7 @@ func identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /* // 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 *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:112207:13: */ +func createTableStmt(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:113444:13: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -91469,12 +92519,12 @@ __3: n = n + (identLength(tls, (*Table)(unsafe.Pointer(p)).FzName)) if n < 50 { zSep = ts + 703 /* "" */ - zSep2 = ts + 10660 /* "," */ - zEnd = ts + 3907 /* ")" */ + zSep2 = ts + 11076 /* "," */ + zEnd = ts + 3935 /* ")" */ } else { - zSep = ts + 10662 /* "\n " */ - zSep2 = ts + 10666 /* ",\n " */ - zEnd = ts + 10671 /* "\n)" */ + zSep = ts + 11078 /* "\n " */ + zSep2 = ts + 11082 /* ",\n " */ + zEnd = ts + 11087 /* "\n)" */ } n = n + (35 + (6 * int32((*Table)(unsafe.Pointer(p)).FnCol))) zStmt = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(n)) @@ -91482,7 +92532,7 @@ __3: Xsqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, ts+10674 /* "CREATE TABLE " */, 0) + Xsqlite3_snprintf(tls, n, zStmt, ts+11090 /* "CREATE TABLE " */, 0) *(*int32)(unsafe.Pointer(bp + 8 /* k */)) = Xsqlite3Strlen30(tls, zStmt) identPut(tls, zStmt, bp+8 /* &k */, (*Table)(unsafe.Pointer(p)).FzName) *(*int8)(unsafe.Pointer(zStmt + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 8 /* k */)), 1)))) = int8('(') @@ -91516,28 +92566,28 @@ __5: goto __6 __6: ; - Xsqlite3_snprintf(tls, (n - *(*int32)(unsafe.Pointer(bp + 8 /* k */))), (zStmt + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* k */)))), ts+2690 /* "%s" */, libc.VaList(bp, zEnd)) + Xsqlite3_snprintf(tls, (n - *(*int32)(unsafe.Pointer(bp + 8 /* k */))), (zStmt + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* k */)))), ts+2718 /* "%s" */, libc.VaList(bp, zEnd)) return zStmt } var azType1 = [5]uintptr{ /* SQLITE_AFF_BLOB */ ts + 703, /* "" */ - /* SQLITE_AFF_TEXT */ ts + 10688, /* " TEXT" */ - /* SQLITE_AFF_NUMERIC */ ts + 10694, /* " NUM" */ - /* SQLITE_AFF_INTEGER */ ts + 10699, /* " INT" */ - /* SQLITE_AFF_REAL */ ts + 10704, /* " REAL" */ -} /* sqlite3.c:112237:23 */ + /* SQLITE_AFF_TEXT */ ts + 11104, /* " TEXT" */ + /* SQLITE_AFF_NUMERIC */ ts + 11110, /* " NUM" */ + /* SQLITE_AFF_INTEGER */ ts + 11115, /* " INT" */ + /* SQLITE_AFF_REAL */ ts + 11120, /* " REAL" */ +} /* sqlite3.c:113474:23 */ // Resize an Index object to hold N columns total. Return SQLITE_OK // on success and SQLITE_NOMEM on an OOM error. -func resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) int32 { /* sqlite3.c:112275:12: */ +func resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) int32 { /* sqlite3.c:113512:12: */ var zExtra uintptr var nByte int32 if int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = (int32(((uint64(unsafe.Sizeof(uintptr(0))) + uint64(unsafe.Sizeof(I16(0)))) + uint64(1)) * uint64(N))) + nByte = (int32((((uint64(unsafe.Sizeof(uintptr(0))) + uint64(unsafe.Sizeof(LogEst(0)))) + uint64(unsafe.Sizeof(I16(0)))) + uint64(1)) * uint64(N))) zExtra = Xsqlite3DbMallocZero(tls, db, uint64(nByte)) if zExtra == uintptr(0) { return SQLITE_NOMEM @@ -91545,6 +92595,9 @@ func resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) int32 { libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FazColl, (uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Index)(unsafe.Pointer(pIdx)).FnColumn))) (*Index)(unsafe.Pointer(pIdx)).FazColl = zExtra zExtra += (uintptr(uint64(unsafe.Sizeof(uintptr(0))) * uint64(N))) + libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst, (uint64(unsafe.Sizeof(LogEst(0))) * (uint64(int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) + 1)))) + (*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst = zExtra + zExtra += (uintptr(uint64(unsafe.Sizeof(LogEst(0))) * uint64(N))) libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaiColumn, (uint64(unsafe.Sizeof(I16(0))) * uint64((*Index)(unsafe.Pointer(pIdx)).FnColumn))) (*Index)(unsafe.Pointer(pIdx)).FaiColumn = zExtra zExtra += (uintptr(uint64(unsafe.Sizeof(I16(0))) * uint64(N))) @@ -91556,7 +92609,7 @@ func resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) int32 { } // Estimate the total row width for a table. -func estimateTableWidth(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:112299:13: */ +func estimateTableWidth(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:113539:13: */ var wTable uint32 = uint32(0) var pTabCol uintptr var i int32 @@ -91585,7 +92638,7 @@ __3: } // Estimate the average size of a row for an index. -func estimateIndexWidth(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:112313:13: */ +func estimateIndexWidth(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:113553:13: */ var wIndex uint32 = uint32(0) var i int32 var aCol uintptr = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol @@ -91605,7 +92658,7 @@ func estimateIndexWidth(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:112313:13: * // Return true if column number x is any of the first nCol entries of aiCol[]. // This is used to determine if the column number x appears in any of the // first nCol entries of an index. -func hasColumn(tls *libc.TLS, aiCol uintptr, nCol int32, x int32) int32 { /* sqlite3.c:112329:12: */ +func hasColumn(tls *libc.TLS, aiCol uintptr, nCol int32, x int32) int32 { /* sqlite3.c:113569:12: */ for libc.PostDecInt32(&nCol, 1) > 0 { if x == int32(*(*I16)(unsafe.Pointer(libc.PostIncUintptr(&aiCol, 2)))) { @@ -91626,7 +92679,7 @@ func hasColumn(tls *libc.TLS, aiCol uintptr, nCol int32, x int32) int32 { /* sql // This routine differs from hasColumn() in that both the column and the // collating sequence must match for this routine, but for hasColumn() only // the column name must match. -func isDupColumn(tls *libc.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int32) int32 { /* sqlite3.c:112352:12: */ +func isDupColumn(tls *libc.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int32) int32 { /* sqlite3.c:113592:12: */ var i int32 var j int32 @@ -91659,7 +92712,7 @@ func isDupColumn(tls *libc.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int3 // // The colNotIdxed mask is AND-ed with the SrcList.a[].colUsed mask // to determine if the index is covering index. -func recomputeColumnsNotIndexed(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:112391:13: */ +func recomputeColumnsNotIndexed(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:113631:13: */ var m Bitmask = uint64(0) var j int32 var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable @@ -91698,7 +92751,7 @@ func recomputeColumnsNotIndexed(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:1123 // indices with the PRIMARY KEY columns. // // For virtual tables, only (1) is performed. -func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:112431:13: */ +func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:113671:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -91712,20 +92765,21 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Mark every PRIMARY KEY column as NOT NULL (except for imposter tables) - if !((int32(*(*uint8)(unsafe.Pointer(db + 176 /* &.init */ + 8 /* &.imposterTable */)) & 0x2 >> 1)) != 0) { + if !((int32(*(*uint8)(unsafe.Pointer(db + 184 /* &.init */ + 8 /* &.imposterTable */)) & 0x2 >> 1)) != 0) { for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ { if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_PRIMKEY) != 0 { - (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)).FnotNull = OE_Abort + (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)).FnotNull = U8(OE_Abort) } } - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_HasNotNull) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_HasNotNull)) } // Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY // into BTREE_BLOBKEY. - if (*Parse)(unsafe.Pointer(pParse)).FaddrCrTab != 0 { - Xsqlite3VdbeChangeP3(tls, v, (*Parse)(unsafe.Pointer(pParse)).FaddrCrTab, BTREE_BLOBKEY) + if *(*int32)(unsafe.Pointer(pParse + 184 /* &.u1 */)) != 0 { + + Xsqlite3VdbeChangeP3(tls, v, *(*int32)(unsafe.Pointer(pParse + 184 /* &.u1 */)), BTREE_BLOBKEY) } // Locate the PRIMARY KEY index. Or, if this table was originally @@ -91747,7 +92801,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / (*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1) Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, int32((*Table)(unsafe.Pointer(pTab)).FkeyConf), uintptr(0), uintptr(0), 0, 0, - SQLITE_IDXTYPE_PRIMARYKEY) + uint8(SQLITE_IDXTYPE_PRIMARYKEY)) if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) { return } @@ -91773,7 +92827,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / } libc.SetBitFieldPtr16Uint32(pPk+100 /* &.isCovering */, uint32(1), 5, 0x20) - if !((int32(*(*uint8)(unsafe.Pointer(db + 176 /* &.init */ + 8 /* &.imposterTable */)) & 0x2 >> 1)) != 0) { + if !((int32(*(*uint8)(unsafe.Pointer(db + 184 /* &.init */ + 8 /* &.imposterTable */)) & 0x2 >> 1)) != 0) { libc.SetBitFieldPtr16Uint32(pPk+100 /* &.uniqNotNull */, uint32(1), 3, 0x8) } nPk = int32(libc.AssignPtrUint16(pPk+96 /* &.nColumn */, (*Index)(unsafe.Pointer(pPk)).FnKeyCol)) @@ -91784,7 +92838,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / // a database schema). if (v != 0) && ((*Index)(unsafe.Pointer(pPk)).Ftnum > Pgno(0)) { - Xsqlite3VdbeChangeOpcode(tls, v, int32((*Index)(unsafe.Pointer(pPk)).Ftnum), OP_Goto) + Xsqlite3VdbeChangeOpcode(tls, v, int32((*Index)(unsafe.Pointer(pPk)).Ftnum), uint8(OP_Goto)) } // The root page of the PRIMARY KEY is the table root page @@ -91856,7 +92910,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / // Return true if pTab is a virtual table and zName is a shadow table name // for that virtual table. -func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uintptr) int32 { /* sqlite3.c:112581:20: */ +func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uintptr) int32 { /* sqlite3.c:113822:20: */ var nName int32 // Length of zName var pMod uintptr // Module for the virtual table @@ -91870,7 +92924,7 @@ func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uint if int32(*(*int8)(unsafe.Pointer(zName + uintptr(nName)))) != '_' { return 0 } - pMod = Xsqlite3HashFind(tls, (db + 528 /* &.aModule */), *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg))) + pMod = Xsqlite3HashFind(tls, (db + 536 /* &.aModule */), *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg))) if pMod == uintptr(0) { return 0 } @@ -91888,7 +92942,7 @@ func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uint // // zName is temporarily modified while this routine is running, but is // restored to its original value prior to this routine returning. -func Xsqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:112605:20: */ +func Xsqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:113846:20: */ var zTail uintptr // Pointer to the last "_" in zName var pTab uintptr // Table that zName is a shadow of zTail = libc.Xstrrchr(tls, zName, '_') @@ -91925,7 +92979,7 @@ func Xsqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) int32 { / // 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 Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr, tabOpts U8, pSelect uintptr) { /* sqlite3.c:112666:21: */ +func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr, tabOpts U8, pSelect uintptr) { /* sqlite3.c:113907:21: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -91944,7 +92998,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } if (pSelect == uintptr(0)) && (Xsqlite3ShadowTableName(tls, db, (*Table)(unsafe.Pointer(p)).FzName) != 0) { - *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (TF_Shadow) + *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_Shadow)) } // If the db->init.busy is 1 it means we are reading the SQL off the @@ -91962,19 +93016,19 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } (*Table)(unsafe.Pointer(p)).Ftnum = (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum if (*Table)(unsafe.Pointer(p)).Ftnum == Pgno(1) { - *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (TF_Readonly) + *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_Readonly)) } } // Special processing for WITHOUT ROWID Tables if (int32(tabOpts) & TF_WithoutRowid) != 0 { - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_Autoincrement) != 0 { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_Autoincrement)) != 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+10710 /* "AUTOINCREMENT no..." */, 0) + ts+11126 /* "AUTOINCREMENT no..." */, 0) return } - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_HasPrimaryKey) == U32(0) { - Xsqlite3ErrorMsg(tls, pParse, ts+10760 /* "PRIMARY KEY miss..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName)) + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_HasPrimaryKey)) == U32(0) { + Xsqlite3ErrorMsg(tls, pParse, ts+11176 /* "PRIMARY KEY miss..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName)) return } *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_WithoutRowid | TF_NoVisibleRowid)) @@ -91994,13 +93048,13 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } } - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_HasGenerated) != 0 { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_HasGenerated)) != 0 { var ii int32 var nNG int32 = 0 for ii = 0; ii < int32((*Table)(unsafe.Pointer(p)).FnCol); ii++ { var colFlags U32 = U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*32)).FcolFlags) - if (colFlags & COLFLAG_GENERATED) != U32(0) { + if (colFlags & U32(COLFLAG_GENERATED)) != U32(0) { var pX uintptr = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*32)).FpDflt if Xsqlite3ResolveSelfReference(tls, pParse, p, NC_GenCol, pX, uintptr(0)) != 0 { @@ -92018,7 +93072,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } } if nNG == 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+10792 /* "must have at lea..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+11208 /* "must have at lea..." */, 0) return } } @@ -92051,12 +93105,12 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr // Initialize zType for the new view or table. if (*Table)(unsafe.Pointer(p)).FpSelect == uintptr(0) { // A regular table - zType = ts + 7333 /* "table" */ - zType2 = ts + 10836 /* "TABLE" */ + zType = ts + 7386 /* "table" */ + zType2 = ts + 11252 /* "TABLE" */ } else { // A view - zType = ts + 8668 /* "view" */ - zType2 = ts + 10842 /* "VIEW" */ + zType = ts + 8770 /* "view" */ + zType2 = ts + 11258 /* "VIEW" */ } // If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT @@ -92087,14 +93141,14 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr Xsqlite3MayAbort(tls, pParse) Xsqlite3VdbeAddOp3(tls, v, OP_OpenWrite, 1, (*Parse)(unsafe.Pointer(pParse)).FregRoot, iDb) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_P2ISREG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) (*Parse)(unsafe.Pointer(pParse)).FnTab = 2 addrTop = (Xsqlite3VdbeCurrentAddr(tls, v) + 1) Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, addrTop) if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return } - pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSelect, SQLITE_AFF_BLOB) + pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSelect, int8(SQLITE_AFF_BLOB)) if pSelTab == uintptr(0) { return } @@ -92128,7 +93182,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } else { var pEnd2 uintptr if tabOpts != 0 { - pEnd2 = (pParse + 264 /* &.sLastToken */) + pEnd2 = (pParse + 256 /* &.sLastToken */) } else { pEnd2 = pEnd } @@ -92137,7 +93191,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr n = int32(uint32(n) + ((*Token)(unsafe.Pointer(pEnd2)).Fn)) } zStmt = Xsqlite3MPrintf(tls, db, - ts+10847 /* "CREATE %s %.*s" */, libc.VaList(bp+8, zType2, n, (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + ts+11263 /* "CREATE %s %.*s" */, libc.VaList(bp+8, zType2, n, (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } // A slot for the record has already been allocated in the @@ -92145,7 +93199,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr // the information we've collected. Xsqlite3NestedParse(tls, pParse, - ts+10862, /* "UPDATE %Q.sqlite..." */ + ts+11278, /* "UPDATE %Q.sqlite..." */ libc.VaList(bp+32, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zType, (*Table)(unsafe.Pointer(p)).FzName, @@ -92158,19 +93212,19 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr // Check to see if we need to create an sqlite_sequence table for // keeping track of autoincrement keys. - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_Autoincrement) != U32(0) { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_Autoincrement)) != U32(0) { var pDb uintptr = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32) if (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { Xsqlite3NestedParse(tls, pParse, - ts+10960, /* "CREATE TABLE %Q...." */ + ts+11376, /* "CREATE TABLE %Q...." */ libc.VaList(bp+88, (*Db)(unsafe.Pointer(pDb)).FzDbSName)) } } // Reparse everything to update our internal data structures Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb, - Xsqlite3MPrintf(tls, db, ts+11002 /* "tbl_name='%q' AN..." */, libc.VaList(bp+96, (*Table)(unsafe.Pointer(p)).FzName))) + Xsqlite3MPrintf(tls, db, ts+11418 /* "tbl_name='%q' AN..." */, libc.VaList(bp+96, (*Table)(unsafe.Pointer(p)).FzName)), uint16(0)) } // Add the table to the in-memory representation of the database. @@ -92185,32 +93239,29 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr return } (*Parse)(unsafe.Pointer(pParse)).FpNewTable = uintptr(0) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) + } - if !(int32((*Table)(unsafe.Pointer(p)).FpSelect) != 0) { - var zName uintptr = (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz - var nName int32 + if !(pSelect != 0) && !(int32((*Table)(unsafe.Pointer(p)).FpSelect) != 0) { - if (*Token)(unsafe.Pointer(pCons)).Fz == uintptr(0) { - pCons = pEnd - } - nName = (int32((int64((*Token)(unsafe.Pointer(pCons)).Fz) - int64(zName)) / 1)) - (*Table)(unsafe.Pointer(p)).FaddColOffset = (13 + Xsqlite3Utf8CharLen(tls, zName, nName)) + if (*Token)(unsafe.Pointer(pCons)).Fz == uintptr(0) { + pCons = pEnd } + (*Table)(unsafe.Pointer(p)).FaddColOffset = (13 + (int32((int64((*Token)(unsafe.Pointer(pCons)).Fz) - int64((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) / 1))) } } // The parser calls this routine in order to create a new VIEW -func Xsqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 uintptr, pName2 uintptr, pCNames uintptr, pSelect uintptr, isTemp int32, noErr int32) { /* sqlite3.c:112957:21: */ - bp := tls.Alloc(72) - defer tls.Free(72) +func Xsqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 uintptr, pName2 uintptr, pCNames uintptr, pSelect uintptr, isTemp int32, noErr int32) { /* sqlite3.c:114195:21: */ + bp := tls.Alloc(120) + defer tls.Free(120) var p uintptr var n int32 var z uintptr - // var sEnd Token at bp+56, 16 + // var sEnd Token at bp+104, 16 - // var sFix DbFixer at bp+8, 48 + // var sFix DbFixer at bp+8, 96 // var pName uintptr at bp, 8 @@ -92222,7 +93273,7 @@ func Xsqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui if !(int32((*Parse)(unsafe.Pointer(pParse)).FnVar) > 0) { goto __1 } - Xsqlite3ErrorMsg(tls, pParse, ts+11036 /* "parameters are n..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+11452 /* "parameters are n..." */, 0) goto create_view_fail __1: ; @@ -92236,7 +93287,7 @@ __2: ; Xsqlite3TwoPartName(tls, pParse, pName1, pName2, bp /* &pName */) iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(p)).FpSchema) - Xsqlite3FixInit(tls, bp+8 /* &sFix */, pParse, iDb, ts+8668 /* "view" */, *(*uintptr)(unsafe.Pointer(bp /* pName */))) + Xsqlite3FixInit(tls, bp+8 /* &sFix */, pParse, iDb, ts+8770 /* "view" */, *(*uintptr)(unsafe.Pointer(bp /* pName */))) if !(Xsqlite3FixSelect(tls, bp+8 /* &sFix */, pSelect) != 0) { goto __3 } @@ -92248,7 +93299,7 @@ __3: // This will force all the Expr.token.z values to be dynamically // allocated rather than point to the input string - which means that // they will persist after the current sqlite3_exec() call returns. - *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) |= (SF_View) + *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) |= (U32(SF_View)) if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { goto __4 } @@ -92269,16 +93320,16 @@ __6: // Locate the end of the CREATE VIEW statement. Make sEnd point to // the end. - *(*Token)(unsafe.Pointer(bp + 56 /* sEnd */)) = (*Parse)(unsafe.Pointer(pParse)).FsLastToken + *(*Token)(unsafe.Pointer(bp + 104 /* sEnd */)) = (*Parse)(unsafe.Pointer(pParse)).FsLastToken - if !(int32(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fz))) != ';') { + if !(int32(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp + 104 /* &sEnd */)).Fz))) != ';') { goto __7 } - *(*uintptr)(unsafe.Pointer(bp + 56 /* &sEnd */ /* &.z */)) += (uintptr((*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fn)) + *(*uintptr)(unsafe.Pointer(bp + 104 /* &sEnd */ /* &.z */)) += (uintptr((*Token)(unsafe.Pointer(bp + 104 /* &sEnd */)).Fn)) __7: ; - (*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fn = uint32(0) - n = (int32((int64((*Token)(unsafe.Pointer(bp+56 /* &sEnd */)).Fz) - int64((*Token)(unsafe.Pointer(pBegin)).Fz)) / 1)) + (*Token)(unsafe.Pointer(bp + 104 /* &sEnd */)).Fn = uint32(0) + n = (int32((int64((*Token)(unsafe.Pointer(bp+104 /* &sEnd */)).Fz) - int64((*Token)(unsafe.Pointer(pBegin)).Fz)) / 1)) z = (*Token)(unsafe.Pointer(pBegin)).Fz __8: @@ -92289,11 +93340,11 @@ __8: goto __8 __9: ; - (*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fz = (z + uintptr((n - 1))) - (*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fn = uint32(1) + (*Token)(unsafe.Pointer(bp + 104 /* &sEnd */)).Fz = (z + uintptr((n - 1))) + (*Token)(unsafe.Pointer(bp + 104 /* &sEnd */)).Fn = uint32(1) // Use sqlite3EndTable() to add the view to the schema table - Xsqlite3EndTable(tls, pParse, uintptr(0), bp+56 /* &sEnd */, uint8(0), uintptr(0)) + Xsqlite3EndTable(tls, pParse, uintptr(0), bp+104 /* &sEnd */, uint8(0), uintptr(0)) create_view_fail: Xsqlite3SelectDelete(tls, db, pSelect) @@ -92310,7 +93361,7 @@ __10: // 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 Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) int32 { /* sqlite3.c:113038:20: */ +func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) int32 { /* sqlite3.c:114276:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -92353,7 +93404,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i // CREATE TEMP VIEW ex1 AS SELECT a FROM ex1; // SELECT * FROM temp.ex1; if int32((*Table)(unsafe.Pointer(pTable)).FnCol) < 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+11072 /* "view %s is circu..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+11488 /* "view %s is circu..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName)) return 1 } @@ -92367,7 +93418,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i pSel = Xsqlite3SelectDup(tls, db, (*Table)(unsafe.Pointer(pTable)).FpSelect, 0) if pSel != 0 { var eParseMode U8 = (*Parse)(unsafe.Pointer(pParse)).FeParseMode - (*Parse)(unsafe.Pointer(pParse)).FeParseMode = PARSE_MODE_NORMAL + (*Parse)(unsafe.Pointer(pParse)).FeParseMode = U8(PARSE_MODE_NORMAL) n = (*Parse)(unsafe.Pointer(pParse)).FnTab Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer(pSel)).FpSrc) (*Table)(unsafe.Pointer(pTable)).FnCol = int16(-1) @@ -92375,7 +93426,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0) xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth (*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) - pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSel, SQLITE_AFF_NONE) + pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSel, int8(SQLITE_AFF_NONE)) (*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth (*Parse)(unsafe.Pointer(pParse)).FnTab = n if pSelTab == uintptr(0) { @@ -92393,7 +93444,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0)) && (int32((*Table)(unsafe.Pointer(pTable)).FnCol) == (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpEList)).FnExpr) { Xsqlite3SelectAddColumnTypeAndCollation(tls, pParse, pTable, pSel, - SQLITE_AFF_NONE) + int8(SQLITE_AFF_NONE)) } } else { // CREATE VIEW name AS... without an argument list. Construct @@ -92401,6 +93452,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i (*Table)(unsafe.Pointer(pTable)).FnCol = (*Table)(unsafe.Pointer(pSelTab)).FnCol (*Table)(unsafe.Pointer(pTable)).FaCol = (*Table)(unsafe.Pointer(pSelTab)).FaCol + *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= ((*Table)(unsafe.Pointer(pSelTab)).FtabFlags & U32(COLFLAG_NOINSERT)) (*Table)(unsafe.Pointer(pSelTab)).FnCol = int16(0) (*Table)(unsafe.Pointer(pSelTab)).FaCol = uintptr(0) @@ -92429,7 +93481,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i } // Clear the column names from every VIEW in database idx. -func sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) { /* sqlite3.c:113168:13: */ +func sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) { /* sqlite3.c:114407:13: */ var i uintptr if !((int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(idx)*32)).FpSchema)).FschemaFlags) & (DB_UnresetViews)) == (DB_UnresetViews)) { @@ -92461,7 +93513,7 @@ func sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) { /* sqlite3.c:113 // We must continue looping until all tables and indices with // rootpage==iFrom have been converted to have a rootpage of iTo // in order to be certain that we got the right one. -func Xsqlite3RootPageMoved(tls *libc.TLS, db uintptr, iDb int32, iFrom Pgno, iTo Pgno) { /* sqlite3.c:113204:21: */ +func Xsqlite3RootPageMoved(tls *libc.TLS, db uintptr, iDb int32, iFrom Pgno, iTo Pgno) { /* sqlite3.c:114443:21: */ var pElem uintptr var pHash uintptr var pDb uintptr @@ -92487,14 +93539,14 @@ func Xsqlite3RootPageMoved(tls *libc.TLS, db uintptr, iDb int32, iFrom Pgno, iTo // Also write code to modify the sqlite_schema table and internal schema // if a root-page of another table is moved by the btree-layer whilst // erasing iTable (this can happen with an auto-vacuum database). -func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { /* sqlite3.c:113234:13: */ +func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { /* sqlite3.c:114473:13: */ bp := tls.Alloc(32) defer tls.Free(32) var v uintptr = Xsqlite3GetVdbe(tls, pParse) var r1 int32 = Xsqlite3GetTempReg(tls, pParse) if iTable < 2 { - Xsqlite3ErrorMsg(tls, pParse, ts+11102 /* "corrupt schema" */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+11518 /* "corrupt schema" */, 0) } Xsqlite3VdbeAddOp3(tls, v, OP_Destroy, iTable, r1, iDb) Xsqlite3MayAbort(tls, pParse) @@ -92508,7 +93560,7 @@ func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { / // token for additional information. Xsqlite3NestedParse(tls, pParse, - ts+11117, /* "UPDATE %Q.sqlite..." */ + ts+11533, /* "UPDATE %Q.sqlite..." */ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+uintptr(iDb)*32)).FzDbSName, iTable, r1, r1)) Xsqlite3ReleaseTempReg(tls, pParse, r1) } @@ -92517,7 +93569,7 @@ func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { / // Code to update the sqlite_schema 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 *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:113264:13: */ +func destroyTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:114503:13: */ // If the database may be auto-vacuum capable (if SQLITE_OMIT_AUTOVACUUM // is not defined), then it is important to call OP_Destroy on the // table and index root-pages in order, starting with the numerically @@ -92563,7 +93615,7 @@ func destroyTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:11 // Remove entries from the sqlite_statN tables (for N in (1,2,3)) // after a DROP INDEX or DROP TABLE command. -func sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uintptr, zName uintptr) { /* sqlite3.c:113313:13: */ +func sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uintptr, zName uintptr) { /* sqlite3.c:114552:13: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -92572,17 +93624,17 @@ func sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uint for i = 1; i <= 4; i++ { // var zTab [24]int8 at bp+40, 24 - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([24]int8{})), bp+40 /* &zTab[0] */, ts+11184 /* "sqlite_stat%d" */, libc.VaList(bp, i)) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([24]int8{})), bp+40 /* &zTab[0] */, ts+11600 /* "sqlite_stat%d" */, libc.VaList(bp, i)) if Xsqlite3FindTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, bp+40 /* &zTab[0] */, zDbName) != 0 { Xsqlite3NestedParse(tls, pParse, - ts+9192, /* "DELETE FROM %Q.%..." */ + ts+9557, /* "DELETE FROM %Q.%..." */ libc.VaList(bp+8, zDbName, bp+40 /* &zTab[0] */, zType, zName)) } } } // Generate code to drop a table. -func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int32, isView int32) { /* sqlite3.c:113336:21: */ +func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int32, isView int32) { /* sqlite3.c:114575:21: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -92613,9 +93665,9 @@ func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 // the table being dropped. This is done before the table is dropped // at the btree level, in case the sqlite_sequence table needs to // move as a result of the drop (can happen in auto-vacuum mode). - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Autoincrement) != 0 { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != 0 { Xsqlite3NestedParse(tls, pParse, - ts+11198, /* "DELETE FROM %Q.s..." */ + ts+11614, /* "DELETE FROM %Q.s..." */ libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName)) } @@ -92627,7 +93679,7 @@ func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 // database. Xsqlite3NestedParse(tls, pParse, - ts+11243, /* "DELETE FROM %Q.s..." */ + ts+11659, /* "DELETE FROM %Q.s..." */ libc.VaList(bp+16, (*Db)(unsafe.Pointer(pDb)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { destroyTable(tls, pParse, pTab) @@ -92646,8 +93698,8 @@ func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 // Return TRUE if shadow tables should be read-only in the current // context. -func Xsqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:113409:20: */ - if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_Defensive) != uint64(0)) && +func Xsqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:114648:20: */ + if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_Defensive)) != uint64(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx == uintptr(0))) && ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0) { return 1 @@ -92656,17 +93708,17 @@ func Xsqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) int32 { /* sqlite3. } // Return true if it is not allowed to drop the given table -func tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) int32 { /* sqlite3.c:113424:12: */ - if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+6905 /* "sqlite_" */, 7) == 0 { - if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+2313 /* "stat" */, 4) == 0 { +func tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) int32 { /* sqlite3.c:114663:12: */ + if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+6950 /* "sqlite_" */, 7) == 0 { + if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+2341 /* "stat" */, 4) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+5963 /* "parameters" */, 10) == 0 { + if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+6019 /* "parameters" */, 10) == 0 { return 0 } return 1 } - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Shadow) != U32(0)) && (Xsqlite3ReadOnlyShadowTables(tls, db) != 0) { + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Shadow)) != U32(0)) && (Xsqlite3ReadOnlyShadowTables(tls, db) != 0) { return 1 } return 0 @@ -92674,7 +93726,7 @@ func tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) int32 { /* sq // This routine is called to do the work of a DROP TABLE statement. // pName is the name of the table to be dropped. -func Xsqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int32, noErr int32) { /* sqlite3.c:113440:21: */ +func Xsqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int32, noErr int32) { /* sqlite3.c:114679:21: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -92722,7 +93774,7 @@ __4: if !(noErr != 0) { goto __6 } - Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcList_item)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase) + Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase) __6: ; goto exit_drop_table @@ -92741,9 +93793,9 @@ __7: zTab = func() uintptr { if (!(0 != 0)) && (iDb == 1) { - return ts + 10046 /* "sqlite_temp_mast..." */ + return ts + 10411 /* "sqlite_temp_mast..." */ } - return ts + 4780 /* "sqlite_master" */ + return ts + 4825 /* "sqlite_master" */ }() zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName zArg2 = uintptr(0) @@ -92803,7 +93855,7 @@ __18: if !(tableMayNotBeDropped(tls, db, pTab) != 0) { goto __19 } - Xsqlite3ErrorMsg(tls, pParse, ts+11310 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+11726 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table __19: ; @@ -92813,14 +93865,14 @@ __19: if !((isView != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0))) { goto __20 } - Xsqlite3ErrorMsg(tls, pParse, ts+11338 /* "use DROP TABLE t..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+11754 /* "use DROP TABLE t..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table __20: ; if !(!(isView != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) { goto __21 } - Xsqlite3ErrorMsg(tls, pParse, ts+11372 /* "use DROP VIEW to..." */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+11788 /* "use DROP VIEW to..." */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table __21: ; @@ -92835,7 +93887,7 @@ __21: if !(!(isView != 0)) { goto __23 } - sqlite3ClearStatTables(tls, pParse, iDb, ts+9384 /* "tbl" */, (*Table)(unsafe.Pointer(pTab)).FzName) + sqlite3ClearStatTables(tls, pParse, iDb, ts+9749 /* "tbl" */, (*Table)(unsafe.Pointer(pTab)).FzName) Xsqlite3FkDropTable(tls, pParse, pName, pTab) __23: ; @@ -92861,7 +93913,7 @@ exit_drop_table: // // The foreign key is set for IMMEDIATE processing. A subsequent call // to sqlite3DeferForeignKey() might change this to DEFERRED. -func Xsqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, pTo uintptr, pToCol uintptr, flags int32) { /* sqlite3.c:113557:21: */ +func Xsqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, pTo uintptr, pToCol uintptr, flags int32) { /* sqlite3.c:114796:21: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -92900,7 +93952,7 @@ __4: goto __5 } Xsqlite3ErrorMsg(tls, pParse, - ts+11404, /* "foreign key on %..." */ + ts+11820, /* "foreign key on %..." */ libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(iCol)*32)).FzName, pTo)) goto fk_end __5: @@ -92913,7 +93965,7 @@ __2: } Xsqlite3ErrorMsg(tls, pParse, - ts+11467 /* "number of column..." */, 0) + ts+11883 /* "number of column..." */, 0) goto fk_end goto __7 __6: @@ -92997,7 +94049,7 @@ __21: goto __23 } Xsqlite3ErrorMsg(tls, pParse, - ts+11561, /* "unknown column \"..." */ + ts+11977, /* "unknown column \"..." */ libc.VaList(bp+16, (*ExprList_item)(unsafe.Pointer((pFromCol+8 /* &.a */)+uintptr(i)*32)).FzEName)) goto fk_end __23: @@ -93082,7 +94134,7 @@ fk_end: // parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE. // The behavior of the most recently created foreign key is adjusted // accordingly. -func Xsqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) { /* sqlite3.c:113687:21: */ +func Xsqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) { /* sqlite3.c:114926:21: */ var pTab uintptr var pFKey uintptr if ((libc.AssignUintptr(&pTab, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0)) || ((libc.AssignUintptr(&pFKey, (*Table)(unsafe.Pointer(pTab)).FpFKey)) == uintptr(0)) { @@ -93101,7 +94153,7 @@ func Xsqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) { // 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 *libc.TLS, pParse uintptr, pIndex uintptr, memRootPage int32) { /* sqlite3.c:113708:13: */ +func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPage int32) { /* sqlite3.c:114947:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -93198,7 +94250,7 @@ func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPa Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iIdx) } Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, iIdx, regRecord) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) Xsqlite3ReleaseTempReg(tls, pParse, regRecord) Xsqlite3VdbeAddOp2(tls, v, OP_SorterNext, iSorter, addr2) Xsqlite3VdbeJumpHere(tls, v, addr1) @@ -93213,7 +94265,7 @@ func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPa // 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 Xsqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol I16, nExtra int32, ppExtra uintptr) uintptr { /* sqlite3.c:113814:22: */ +func Xsqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol I16, nExtra int32, ppExtra uintptr) uintptr { /* sqlite3.c:115053:22: */ var p uintptr // Allocated index object var nByte int32 // Bytes of space for Index object + arrays @@ -93238,7 +94290,7 @@ func Xsqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol I16, nExtra int // If expression list pList contains an expression that was parsed with // an explicit "NULLS FIRST" or "NULLS LAST" clause, leave an error in // pParse and return non-zero. Otherwise, return zero. -func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int32 { /* sqlite3.c:113847:20: */ +func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int32 { /* sqlite3.c:115086:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -93247,12 +94299,12 @@ func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int3 for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ { if (uint32(int32(*(*uint8)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32 + 20 /* &.bNulls */)) & 0x20 >> 5))) != 0 { var sf U8 = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32)).FsortFlags - Xsqlite3ErrorMsg(tls, pParse, ts+11607, /* "unsupported use ..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+12023, /* "unsupported use ..." */ libc.VaList(bp, func() uintptr { if (int32(sf) == 0) || (int32(sf) == 3) { - return ts + 11635 /* "FIRST" */ + return ts + 12051 /* "FIRST" */ } - return ts + 11641 /* "LAST" */ + return ts + 12057 /* "LAST" */ }())) return 1 } @@ -93271,9 +94323,9 @@ func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int3 // 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 Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pTblName uintptr, pList uintptr, onError int32, pStart uintptr, pPIWhere uintptr, sortOrder int32, ifNotExist int32, idxType U8) { /* sqlite3.c:113875:21: */ - bp := tls.Alloc(208) - defer tls.Free(208) +func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pTblName uintptr, pList uintptr, onError int32, pStart uintptr, pPIWhere uintptr, sortOrder int32, ifNotExist int32, idxType U8) { /* sqlite3.c:115114:21: */ + bp := tls.Alloc(256) + defer tls.Free(256) var pTab uintptr // Table to be indexed var pIndex uintptr // The index to be created @@ -93281,7 +94333,7 @@ func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u var nName int32 // Number of characters in zName var i int32 var j int32 - // var sFix DbFixer at bp+136, 48 + // var sFix DbFixer at bp+136, 96 // For assigning database names to pTable var sortOrderMask int32 // 1 to honor DESC in index. 0 to ignore. var db uintptr @@ -93292,13 +94344,13 @@ func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u var pListItem uintptr // For looping over pList var nExtra int32 // Space allocated for zExtra[] var nExtraCol int32 // Number of extra columns needed - // var zExtra uintptr at bp+200, 8 + // var zExtra uintptr at bp+248, 8 // Extra space after the Index object var pPk uintptr var n int32 var pLoop uintptr var zDb uintptr - // var prevCol Token at bp+184, 16 + // var prevCol Token at bp+232, 16 var pCol uintptr var pExpr uintptr @@ -93345,7 +94397,7 @@ func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*Parse)(unsafe.Pointer(pParse)).Fdb *(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)) = uintptr(0) nExtra = 0 - *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)) = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 248 /* zExtra */)) = uintptr(0) pPk = uintptr(0) // PRIMARY KEY index for WITHOUT ROWID tables if !(((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || ((*Parse)(unsafe.Pointer(pParse)).FnErr > 0)) { @@ -93406,7 +94458,7 @@ __9: __8: ; - Xsqlite3FixInit(tls, bp+136 /* &sFix */, pParse, iDb, ts+11646 /* "index" */, *(*uintptr)(unsafe.Pointer(bp + 128 /* pName */))) + Xsqlite3FixInit(tls, bp+136 /* &sFix */, pParse, iDb, ts+12062 /* "index" */, *(*uintptr)(unsafe.Pointer(bp + 128 /* pName */))) if !(Xsqlite3FixSrcList(tls, bp+136 /* &sFix */, pTblName) != 0) { goto __10 } @@ -93427,12 +94479,12 @@ __11: goto __12 } Xsqlite3ErrorMsg(tls, pParse, - ts+11652, /* "cannot create a ..." */ + ts+12068, /* "cannot create a ..." */ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index __12: ; - if !(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __13 } pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) @@ -93454,26 +94506,26 @@ __6: ; pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32) - if !(((Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+6905 /* "sqlite_" */, 7) == 0) && + if !(((Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+6950 /* "sqlite_" */, 7) == 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0)) && (pTblName != uintptr(0))) { goto __15 } - Xsqlite3ErrorMsg(tls, pParse, ts+11702 /* "table %s may not..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+12118 /* "table %s may not..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index __15: ; if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) { goto __16 } - Xsqlite3ErrorMsg(tls, pParse, ts+11730 /* "views may not be..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+12146 /* "views may not be..." */, 0) goto exit_create_index __16: ; if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { goto __17 } - Xsqlite3ErrorMsg(tls, pParse, ts+11755 /* "virtual tables m..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+12171 /* "virtual tables m..." */, 0) goto exit_create_index __17: ; @@ -93500,7 +94552,7 @@ __17: __20: ; - if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+11646 /* "index" */, (*Table)(unsafe.Pointer(pTab)).FzName)) { + if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+12062 /* "index" */, (*Table)(unsafe.Pointer(pTab)).FzName)) { goto __21 } goto exit_create_index @@ -93515,7 +94567,7 @@ __21: if !(Xsqlite3FindTable(tls, db, zName, uintptr(0)) != uintptr(0)) { goto __24 } - Xsqlite3ErrorMsg(tls, pParse, ts+11789 /* "there is already..." */, libc.VaList(bp+16, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+12205 /* "there is already..." */, libc.VaList(bp+16, zName)) goto exit_create_index __24: ; @@ -93527,7 +94579,7 @@ __23: if !(!(ifNotExist != 0)) { goto __26 } - Xsqlite3ErrorMsg(tls, pParse, ts+11823 /* "index %s already..." */, libc.VaList(bp+24, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+12239 /* "index %s already..." */, libc.VaList(bp+24, zName)) goto __27 __26: ; @@ -93555,7 +94607,7 @@ __29: goto __30 __30: ; - zName = Xsqlite3MPrintf(tls, db, ts+11847 /* "sqlite_autoindex..." */, libc.VaList(bp+32, (*Table)(unsafe.Pointer(pTab)).FzName, n)) + zName = Xsqlite3MPrintf(tls, db, ts+12263 /* "sqlite_autoindex..." */, libc.VaList(bp+32, (*Table)(unsafe.Pointer(pTab)).FzName, n)) if !(zName == uintptr(0)) { goto __31 } @@ -93584,9 +94636,9 @@ __19: zDb = (*Db)(unsafe.Pointer(pDb)).FzDbSName if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr { if (!(0 != 0)) && (iDb == 1) { - return ts + 10046 /* "sqlite_temp_mast..." */ + return ts + 10411 /* "sqlite_temp_mast..." */ } - return ts + 4780 /* "sqlite_master" */ + return ts + 4825 /* "sqlite_master" */ }(), uintptr(0), zDb) != 0) { goto __34 } @@ -93617,9 +94669,9 @@ __33: } pCol = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(pTab)).FnCol)-1))*32) *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) |= U16((COLFLAG_UNIQUE)) - Xsqlite3TokenInit(tls, bp+184 /* &prevCol */, (*Column)(unsafe.Pointer(pCol)).FzName) + Xsqlite3TokenInit(tls, bp+232 /* &prevCol */, (*Column)(unsafe.Pointer(pCol)).FzName) pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), - Xsqlite3ExprAlloc(tls, db, TK_ID, bp+184 /* &prevCol */, 0)) + Xsqlite3ExprAlloc(tls, db, TK_ID, bp+232 /* &prevCol */, 0)) if !(pList == uintptr(0)) { goto __39 } @@ -93630,7 +94682,7 @@ __39: Xsqlite3ExprListSetSortOrder(tls, pList, sortOrder, -1) goto __38 __37: - Xsqlite3ExprListCheckLength(tls, pParse, pList, ts+11646 /* "index" */) + Xsqlite3ExprListCheckLength(tls, pParse, pList, ts+12062 /* "index" */) if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) { goto __40 } @@ -93672,7 +94724,7 @@ __43: } pIndex = Xsqlite3AllocateIndexObject(tls, db, (int16((*ExprList)(unsafe.Pointer(pList)).FnExpr + nExtraCol)), - ((nName + nExtra) + 1), bp+200 /* &zExtra */) + ((nName + nExtra) + 1), bp+248 /* &zExtra */) if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { goto __45 } @@ -93680,8 +94732,8 @@ __43: __45: ; - (*Index)(unsafe.Pointer(pIndex)).FzName = *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)) - *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)) += (uintptr(nName + 1)) + (*Index)(unsafe.Pointer(pIndex)).FzName = *(*uintptr)(unsafe.Pointer(bp + 248 /* zExtra */)) + *(*uintptr)(unsafe.Pointer(bp + 248 /* zExtra */)) += (uintptr(nName + 1)) libc.Xmemcpy(tls, (*Index)(unsafe.Pointer(pIndex)).FzName, zName, (uint64(nName + 1))) (*Index)(unsafe.Pointer(pIndex)).FpTable = pTab (*Index)(unsafe.Pointer(pIndex)).FonError = U8(onError) @@ -93747,7 +94799,7 @@ __53: goto __56 } Xsqlite3ErrorMsg(tls, pParse, - ts+11870 /* "expressions proh..." */, 0) + ts+12286 /* "expressions proh..." */, 0) goto exit_create_index __56: ; @@ -93795,9 +94847,9 @@ __55: zColl = *(*uintptr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pListItem)).FpExpr + 8 /* &.u */)) nColl = (Xsqlite3Strlen30(tls, zColl) + 1) - libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)), zColl, uint64(nColl)) - zColl = *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)) - *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)) += uintptr(nColl) + libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 248 /* zExtra */)), zColl, uint64(nColl)) + zColl = *(*uintptr)(unsafe.Pointer(bp + 248 /* zExtra */)) + *(*uintptr)(unsafe.Pointer(bp + 248 /* zExtra */)) += uintptr(nColl) nExtra = nExtra - (nColl) goto __63 __62: @@ -93976,7 +95028,7 @@ __88: goto __93 } Xsqlite3ErrorMsg(tls, pParse, - ts+11931 /* "conflicting ON C..." */, libc.VaList(bp+48, 0)) + ts+12347 /* "conflicting ON C..." */, libc.VaList(bp+48, 0)) __93: ; if !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) == OE_Default) { @@ -94032,8 +95084,8 @@ __81: if !(Xsqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0) { goto __101 } - Xsqlite3ErrorMsg(tls, pParse, ts+11973 /* "invalid rootpage" */, 0) - (*Parse)(unsafe.Pointer(pParse)).Frc = Xsqlite3CorruptError(tls, 114327) + Xsqlite3ErrorMsg(tls, pParse, ts+12389 /* "invalid rootpage" */, 0) + (*Parse)(unsafe.Pointer(pParse)).Frc = Xsqlite3CorruptError(tls, 115566) goto exit_create_index __101: ; @@ -94049,10 +95101,10 @@ __100: goto exit_create_index __102: ; - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) goto __99 __98: - if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) || (pTblName != uintptr(0))) { + if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || (pTblName != uintptr(0))) { goto __103 } iMem = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) @@ -94090,12 +95142,12 @@ __104: __107: ; // A named index with an explicit CREATE INDEX statement - zStmt = Xsqlite3MPrintf(tls, db, ts+11990, /* "CREATE%s INDEX %..." */ + zStmt = Xsqlite3MPrintf(tls, db, ts+12406, /* "CREATE%s INDEX %..." */ libc.VaList(bp+56, func() uintptr { if onError == OE_None { return ts + 703 /* "" */ } - return ts + 12010 /* " UNIQUE" */ + return ts + 12426 /* " UNIQUE" */ }(), n1, (*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)))).Fz)) goto __106 __105: @@ -94107,7 +95159,7 @@ __106: // Add an entry in sqlite_schema for this index Xsqlite3NestedParse(tls, pParse, - ts+12018, /* "INSERT INTO %Q.s..." */ + ts+12434, /* "INSERT INTO %Q.s..." */ libc.VaList(bp+80, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Index)(unsafe.Pointer(pIndex)).FzName, (*Table)(unsafe.Pointer(pTab)).FzName, @@ -94123,7 +95175,7 @@ __106: sqlite3RefillIndex(tls, pParse, pIndex, iMem) Xsqlite3ChangeCookie(tls, pParse, iDb) Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb, - Xsqlite3MPrintf(tls, db, ts+12077 /* "name='%q' AND ty..." */, libc.VaList(bp+120, (*Index)(unsafe.Pointer(pIndex)).FzName))) + Xsqlite3MPrintf(tls, db, ts+12493 /* "name='%q' AND ty..." */, libc.VaList(bp+120, (*Index)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) Xsqlite3VdbeAddOp2(tls, v, OP_Expire, 0, 1) __108: ; @@ -94220,7 +95272,7 @@ __113: // 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 Xsqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:114468:21: */ +func Xsqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:115707:21: */ var a uintptr = (*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst var x LogEst var nCopy int32 = func() int32 { @@ -94264,11 +95316,11 @@ func Xsqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:114468:21 } } -var aVal = [5]LogEst{int16(33), int16(32), int16(30), int16(28), int16(26)} /* sqlite3.c:114470:23 */ +var aVal = [5]LogEst{int16(33), int16(32), int16(30), int16(28), int16(26)} /* sqlite3.c:115709:23 */ // This routine will drop an existing named index. This routine // implements the DROP INDEX statement. -func Xsqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists int32) { /* sqlite3.c:114512:21: */ +func Xsqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists int32) { /* sqlite3.c:115751:21: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -94296,17 +95348,17 @@ __1: goto exit_drop_index __2: ; - pIndex = Xsqlite3FindIndex(tls, db, (*SrcList_item)(unsafe.Pointer((pName + 8 /* &.a */))).FzName, (*SrcList_item)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase) + pIndex = Xsqlite3FindIndex(tls, db, (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzName, (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase) if !(pIndex == uintptr(0)) { goto __3 } if !(!(ifExists != 0)) { goto __4 } - Xsqlite3ErrorMsg(tls, pParse, ts+12104 /* "no such index: %..." */, libc.VaList(bp, pName, 0)) + Xsqlite3ErrorMsg(tls, pParse, ts+12520 /* "no such index: %..." */, libc.VaList(bp, pName, 0)) goto __5 __4: - Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcList_item)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase) + Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase) __5: ; (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) @@ -94317,7 +95369,7 @@ __3: goto __6 } Xsqlite3ErrorMsg(tls, pParse, - ts+12122 /* "index associated..." */, libc.VaList(bp+16, 0)) + ts+12538 /* "index associated..." */, libc.VaList(bp+16, 0)) goto exit_drop_index __6: ; @@ -94328,9 +95380,9 @@ __6: zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName zTab = func() uintptr { if (!(0 != 0)) && (iDb == 1) { - return ts + 10046 /* "sqlite_temp_mast..." */ + return ts + 10411 /* "sqlite_temp_mast..." */ } - return ts + 4780 /* "sqlite_master" */ + return ts + 4825 /* "sqlite_master" */ }() if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_DELETE, zTab, uintptr(0), zDb) != 0) { goto __7 @@ -94358,9 +95410,9 @@ __9: } Xsqlite3BeginWriteOperation(tls, pParse, 1, iDb) Xsqlite3NestedParse(tls, pParse, - ts+12195, /* "DELETE FROM %Q.s..." */ + ts+12611, /* "DELETE FROM %Q.s..." */ libc.VaList(bp+24, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Index)(unsafe.Pointer(pIndex)).FzName)) - sqlite3ClearStatTables(tls, pParse, iDb, ts+9380 /* "idx" */, (*Index)(unsafe.Pointer(pIndex)).FzName) + sqlite3ClearStatTables(tls, pParse, iDb, ts+9745 /* "idx" */, (*Index)(unsafe.Pointer(pIndex)).FzName) Xsqlite3ChangeCookie(tls, pParse, iDb) destroyRootPage(tls, pParse, int32((*Index)(unsafe.Pointer(pIndex)).Ftnum), iDb) Xsqlite3VdbeAddOp4(tls, v, OP_DropIndex, iDb, 0, 0, (*Index)(unsafe.Pointer(pIndex)).FzName, 0) @@ -94386,7 +95438,7 @@ exit_drop_index: // // Otherwise, if the realloc() fails, *pIdx is set to -1, *pnEntry remains // unchanged and a copy of pArray returned. -func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry int32, pnEntry uintptr, pIdx uintptr) uintptr { /* sqlite3.c:114593:21: */ +func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry int32, pnEntry uintptr, pIdx uintptr) uintptr { /* sqlite3.c:115832:21: */ var z uintptr var n Sqlite3_int64 = Sqlite3_int64(libc.AssignPtrInt32(pIdx, *(*int32)(unsafe.Pointer(pnEntry)))) if (n & (n - int64(1))) == int64(0) { @@ -94413,7 +95465,7 @@ func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry in // need be. // // A new IdList is returned, or NULL if malloc() fails. -func Xsqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr) uintptr { /* sqlite3.c:114623:23: */ +func Xsqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr) uintptr { /* sqlite3.c:115862:23: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -94444,7 +95496,7 @@ func Xsqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } // Delete an IdList. -func Xsqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:114651:21: */ +func Xsqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:115890:21: */ var i int32 if pList == uintptr(0) { return @@ -94458,7 +95510,7 @@ func Xsqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3 // Return the index in pList of the identifier named zId. Return -1 // if not found. -func Xsqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) int32 { /* sqlite3.c:114665:20: */ +func Xsqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) int32 { /* sqlite3.c:115904:20: */ var i int32 if pList == uintptr(0) { return -1 @@ -94496,7 +95548,7 @@ func Xsqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) int32 { /* // If a memory allocation fails or the SrcList becomes too large, leave // the original SrcList unchanged, return NULL, and leave an error message // in pParse. -func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra int32, iStart int32) uintptr { /* sqlite3.c:114706:24: */ +func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra int32, iStart int32) uintptr { /* sqlite3.c:115945:24: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -94511,15 +95563,15 @@ func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc + nExtra) >= SQLITE_MAX_SRCLIST { - Xsqlite3ErrorMsg(tls, pParse, ts+12255, /* "too many FROM cl..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+12671, /* "too many FROM cl..." */ libc.VaList(bp, SQLITE_MAX_SRCLIST)) return uintptr(0) } - if nAlloc > SQLITE_MAX_SRCLIST { - nAlloc = SQLITE_MAX_SRCLIST + if nAlloc > int64(SQLITE_MAX_SRCLIST) { + nAlloc = int64(SQLITE_MAX_SRCLIST) } pNew = Xsqlite3DbRealloc(tls, db, pSrc, - (uint64(unsafe.Sizeof(SrcList{})) + ((uint64(nAlloc - int64(1))) * uint64(unsafe.Sizeof(SrcList_item{}))))) + (uint64(unsafe.Sizeof(SrcList{})) + ((uint64(nAlloc - int64(1))) * uint64(unsafe.Sizeof(SrcItem{}))))) if pNew == uintptr(0) { return uintptr(0) @@ -94531,14 +95583,14 @@ func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra // Move existing slots that come after the newly inserted slots // out of the way for i = ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc - 1); i >= iStart; i-- { - *(*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr((i+nExtra))*112)) = *(*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112)) + *(*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr((i+nExtra))*112)) = *(*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112)) } *(*int32)(unsafe.Pointer(pSrc /* &.nSrc */)) += (nExtra) // Zero the newly allocated slots - libc.Xmemset(tls, ((pSrc + 8 /* &.a */) + uintptr(iStart)*112), 0, (uint64(unsafe.Sizeof(SrcList_item{})) * uint64(nExtra))) + libc.Xmemset(tls, ((pSrc + 8 /* &.a */) + uintptr(iStart)*112), 0, (uint64(unsafe.Sizeof(SrcItem{})) * uint64(nExtra))) for i = iStart; i < (iStart + nExtra); i++ { - (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor = -1 + (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor = -1 } // Return a pointer to the enlarged SrcList @@ -94578,7 +95630,7 @@ func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra // // Both pTable and pDatabase are assumed to be quoted. They are dequoted // before being added to the SrcList. -func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable uintptr, pDatabase uintptr) uintptr { /* sqlite3.c:114795:24: */ +func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable uintptr, pDatabase uintptr) uintptr { /* sqlite3.c:116034:24: */ var pItem uintptr var db uintptr // Cannot have C without B @@ -94591,8 +95643,8 @@ func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable } (*SrcList)(unsafe.Pointer(pList)).FnAlloc = U32(1) (*SrcList)(unsafe.Pointer(pList)).FnSrc = 1 - libc.Xmemset(tls, (pList + 8 /* &.a */), 0, uint64(unsafe.Sizeof(SrcList_item{}))) - (*SrcList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FiCursor = -1 + libc.Xmemset(tls, (pList + 8 /* &.a */), 0, uint64(unsafe.Sizeof(SrcItem{}))) + (*SrcItem)(unsafe.Pointer((pList + 8 /* &.a */))).FiCursor = -1 } else { var pNew uintptr = Xsqlite3SrcListEnlarge(tls, pParse, pList, 1, (*SrcList)(unsafe.Pointer(pList)).FnSrc) if pNew == uintptr(0) { @@ -94607,17 +95659,17 @@ func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable pDatabase = uintptr(0) } if pDatabase != 0 { - (*SrcList_item)(unsafe.Pointer(pItem)).FzName = Xsqlite3NameFromToken(tls, db, pDatabase) - (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase = Xsqlite3NameFromToken(tls, db, pTable) + (*SrcItem)(unsafe.Pointer(pItem)).FzName = Xsqlite3NameFromToken(tls, db, pDatabase) + (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase = Xsqlite3NameFromToken(tls, db, pTable) } else { - (*SrcList_item)(unsafe.Pointer(pItem)).FzName = Xsqlite3NameFromToken(tls, db, pTable) - (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0) + (*SrcItem)(unsafe.Pointer(pItem)).FzName = Xsqlite3NameFromToken(tls, db, pTable) + (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0) } return pList } // Assign VdbeCursor index numbers to all tables in a SrcList -func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sqlite3.c:114840:21: */ +func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sqlite3.c:116079:21: */ var i int32 var pItem uintptr @@ -94629,12 +95681,12 @@ func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) goto __3 } { - if (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor >= 0 { - goto __3 + if (*SrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { + goto __2 } - (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) - if (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0 { - Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FpSrc) + (*SrcItem)(unsafe.Pointer(pItem)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 { + Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpSrc) } } @@ -94649,7 +95701,7 @@ func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) } // Delete an entire SrcList including all its substructure. -func Xsqlite3SrcListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:114858:21: */ +func Xsqlite3SrcListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:116097:21: */ var i int32 var pItem uintptr if pList == uintptr(0) { @@ -94662,19 +95714,29 @@ __1: goto __3 } { - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase) - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FzName) - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias) + if (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0 { + Xsqlite3DbFreeNN(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase) + } + Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzName) + if (*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 { + Xsqlite3DbFreeNN(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzAlias) + } if (uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 60 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 96 /* &.u1 */))) } if (uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 60 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 { Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 96 /* &.u1 */))) } - Xsqlite3DeleteTable(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FpTab) - Xsqlite3SelectDelete(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect) - Xsqlite3ExprDelete(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FpOn) - Xsqlite3IdListDelete(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FpUsing) + Xsqlite3DeleteTable(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FpTab) + if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 { + Xsqlite3SelectDelete(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect) + } + if (*SrcItem)(unsafe.Pointer(pItem)).FpOn != 0 { + Xsqlite3ExprDelete(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FpOn) + } + if (*SrcItem)(unsafe.Pointer(pItem)).FpUsing != 0 { + Xsqlite3IdListDelete(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FpUsing) + } } goto __2 @@ -94702,7 +95764,7 @@ __3: // // Return a new SrcList which encodes is the FROM with the new // term added. -func Xsqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTable uintptr, pDatabase uintptr, pAlias uintptr, pSubquery uintptr, pOn uintptr, pUsing uintptr) uintptr { /* sqlite3.c:114892:24: */ +func Xsqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTable uintptr, pDatabase uintptr, pAlias uintptr, pSubquery uintptr, pOn uintptr, pUsing uintptr) uintptr { /* sqlite3.c:116131:24: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -94713,12 +95775,12 @@ func Xsqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa if !(!(p != 0) && ((pOn != 0) || (pUsing != 0))) { goto __1 } - Xsqlite3ErrorMsg(tls, pParse, ts+12291, /* "a JOIN clause is..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+12707, /* "a JOIN clause is..." */ libc.VaList(bp, func() uintptr { if pOn != 0 { - return ts + 12327 /* "ON" */ + return ts + 12743 /* "ON" */ } - return ts + 12330 /* "USING" */ + return ts + 12746 /* "USING" */ }())) goto append_from_error __1: @@ -94733,7 +95795,7 @@ __2: pItem = ((p + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(p)).FnSrc-1))*112) - if !((int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*SrcList_item)(unsafe.Pointer(pItem)).FzName != 0)) { + if !((int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*SrcItem)(unsafe.Pointer(pItem)).FzName != 0)) { goto __3 } if (pDatabase != 0) && ((*Token)(unsafe.Pointer(pDatabase)).Fz != 0) { @@ -94741,19 +95803,19 @@ __2: } else { pToken = pTable } - Xsqlite3RenameTokenMap(tls, pParse, (*SrcList_item)(unsafe.Pointer(pItem)).FzName, pToken) + Xsqlite3RenameTokenMap(tls, pParse, (*SrcItem)(unsafe.Pointer(pItem)).FzName, pToken) __3: ; if !((*Token)(unsafe.Pointer(pAlias)).Fn != 0) { goto __4 } - (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias = Xsqlite3NameFromToken(tls, db, pAlias) + (*SrcItem)(unsafe.Pointer(pItem)).FzAlias = Xsqlite3NameFromToken(tls, db, pAlias) __4: ; - (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect = pSubquery - (*SrcList_item)(unsafe.Pointer(pItem)).FpOn = pOn - (*SrcList_item)(unsafe.Pointer(pItem)).FpUsing = pUsing + (*SrcItem)(unsafe.Pointer(pItem)).FpSelect = pSubquery + (*SrcItem)(unsafe.Pointer(pItem)).FpOn = pOn + (*SrcItem)(unsafe.Pointer(pItem)).FpUsing = pUsing return p append_from_error: @@ -94766,7 +95828,7 @@ append_from_error: // Add an INDEXED BY or NOT INDEXED clause to the most recently added // element of the source-list passed as the second argument. -func Xsqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexedBy uintptr) { /* sqlite3.c:114943:21: */ +func Xsqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexedBy uintptr) { /* sqlite3.c:116182:21: */ if (p != 0) && ((*Token)(unsafe.Pointer(pIndexedBy)).Fn > uint32(0)) { var pItem uintptr @@ -94787,7 +95849,7 @@ func Xsqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexed // Append the contents of SrcList p2 to SrcList p1 and return the resulting // SrcList. Or, if an error occurs, return NULL. In all cases, p1 and p2 // are deleted by this function. -func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:114968:24: */ +func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:116207:24: */ if p2 != 0 { var pNew uintptr = Xsqlite3SrcListEnlarge(tls, pParse, p1, (*SrcList)(unsafe.Pointer(p2)).FnSrc, 1) @@ -94795,7 +95857,7 @@ func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uin Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p2) } else { p1 = pNew - libc.Xmemcpy(tls, ((p1 + 8 /* &.a */) + 1*112), p2+8 /* &.a */, (uint64((*SrcList)(unsafe.Pointer(p2)).FnSrc) * uint64(unsafe.Sizeof(SrcList_item{})))) + libc.Xmemcpy(tls, ((p1 + 8 /* &.a */) + 1*112), p2+8 /* &.a */, (uint64((*SrcList)(unsafe.Pointer(p2)).FnSrc) * uint64(unsafe.Sizeof(SrcItem{})))) Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p2) } } @@ -94804,7 +95866,7 @@ func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uin // Add the list of function arguments to the SrcList entry for a // table-valued-function. -func Xsqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uintptr) { /* sqlite3.c:114987:21: */ +func Xsqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uintptr) { /* sqlite3.c:116226:21: */ if p != 0 { var pItem uintptr = ((p + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(p)).FnSrc-1))*112) @@ -94828,25 +95890,25 @@ func Xsqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uin // 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 Xsqlite3SrcListShiftJoinType(tls *libc.TLS, p uintptr) { /* sqlite3.c:115015:21: */ +func Xsqlite3SrcListShiftJoinType(tls *libc.TLS, p uintptr) { /* sqlite3.c:116254:21: */ if p != 0 { var i int32 for i = ((*SrcList)(unsafe.Pointer(p)).FnSrc - 1); i > 0; i-- { - (*SrcList_item)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(i)*112)).Ffg.Fjointype = (*SrcList_item)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((i-1))*112)).Ffg.Fjointype + (*SrcItem)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(i)*112)).Ffg.Fjointype = (*SrcItem)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((i-1))*112)).Ffg.Fjointype } - (*SrcList_item)(unsafe.Pointer((p + 8 /* &.a */))).Ffg.Fjointype = U8(0) + (*SrcItem)(unsafe.Pointer((p + 8 /* &.a */))).Ffg.Fjointype = U8(0) } } // Generate VDBE code for a BEGIN statement. -func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { /* sqlite3.c:115028:21: */ +func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { /* sqlite3.c:116267:21: */ var db uintptr var v uintptr var i int32 db = (*Parse)(unsafe.Pointer(pParse)).Fdb - if Xsqlite3AuthCheck(tls, pParse, SQLITE_TRANSACTION, ts+12336 /* "BEGIN" */, uintptr(0), uintptr(0)) != 0 { + if Xsqlite3AuthCheck(tls, pParse, SQLITE_TRANSACTION, ts+12752 /* "BEGIN" */, uintptr(0), uintptr(0)) != 0 { return } v = Xsqlite3GetVdbe(tls, pParse) @@ -94855,7 +95917,16 @@ func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { /* s } if type1 != TK_DEFERRED { for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { - Xsqlite3VdbeAddOp2(tls, v, OP_Transaction, i, ((libc.Bool32(type1 == TK_EXCLUSIVE)) + 1)) + var eTxnType int32 + var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt + if (pBt != 0) && (Xsqlite3BtreeIsReadonly(tls, pBt) != 0) { + eTxnType = 0 // Read txn + } else if type1 == TK_EXCLUSIVE { + eTxnType = 2 // Exclusive txn + } else { + eTxnType = 1 // Write txn + } + Xsqlite3VdbeAddOp2(tls, v, OP_Transaction, i, eTxnType) Xsqlite3VdbeUsesBtree(tls, v, i) } } @@ -94865,7 +95936,7 @@ func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { /* s // Generate VDBE code for a COMMIT or ROLLBACK statement. // Code for ROLLBACK is generated if eType==TK_ROLLBACK. Otherwise // code is generated for a COMMIT. -func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { /* sqlite3.c:115055:21: */ +func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { /* sqlite3.c:116303:21: */ var v uintptr var isRollback int32 @@ -94873,9 +95944,9 @@ func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { /* sql if Xsqlite3AuthCheck(tls, pParse, SQLITE_TRANSACTION, func() uintptr { if isRollback != 0 { - return ts + 12342 /* "ROLLBACK" */ + return ts + 12758 /* "ROLLBACK" */ } - return ts + 12351 /* "COMMIT" */ + return ts + 12767 /* "COMMIT" */ }(), uintptr(0), uintptr(0)) != 0 { return } @@ -94887,7 +95958,7 @@ func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { /* sql // This function is called by the parser when it parses a command to create, // release or rollback an SQL savepoint. -func Xsqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { /* sqlite3.c:115077:21: */ +func Xsqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { /* sqlite3.c:116325:21: */ var zName uintptr = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pName) if zName != 0 { var v uintptr = Xsqlite3GetVdbe(tls, pParse) @@ -94900,11 +95971,11 @@ func Xsqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } } -var az = [3]uintptr{ts + 12336 /* "BEGIN" */, ts + 12358 /* "RELEASE" */, ts + 12342 /* "ROLLBACK" */} /* sqlite3.c:115082:23 */ +var az = [3]uintptr{ts + 12752 /* "BEGIN" */, ts + 12774 /* "RELEASE" */, ts + 12758 /* "ROLLBACK" */} /* sqlite3.c:116330:23 */ // Make sure the TEMP database is open and available for use. Return // the number of errors. Leave any error messages in the pParse structure. -func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:115097:20: */ +func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:116345:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -94916,7 +95987,7 @@ func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3. rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp /* &pBt */, 0, flags) if rc != SQLITE_OK { Xsqlite3ErrorMsg(tls, pParse, - ts+12366 /* "unable to open a..." */, 0) + ts+12782 /* "unable to open a..." */, 0) (*Parse)(unsafe.Pointer(pParse)).Frc = rc return 1 } @@ -94930,19 +96001,13 @@ func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3. return 0 } -var flags int32 = ((((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) | SQLITE_OPEN_TEMP_DB) /* sqlite3.c:115102:22 */ +var flags int32 = ((((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) | SQLITE_OPEN_TEMP_DB) /* sqlite3.c:116350:22 */ // 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 Xsqlite3CodeVerifySchema(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:115132:21: */ - var pToplevel uintptr = func() uintptr { - if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { - return (*Parse)(unsafe.Pointer(pParse)).FpToplevel - } - return pParse - }() +func sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { /* sqlite3.c:116380:13: */ if (libc.Bool32((((*Parse)(unsafe.Pointer(pToplevel)).FcookieMask) & (YDbMask((YDbMask(1))) << (iDb))) != YDbMask(0))) == 0 { *(*YDbMask)(unsafe.Pointer(pToplevel + 116 /* &.cookieMask */)) |= (YDbMask((YDbMask(1))) << (iDb)) @@ -94952,9 +96017,18 @@ func Xsqlite3CodeVerifySchema(tls *libc.TLS, pParse uintptr, iDb int32) { /* sql } } +func Xsqlite3CodeVerifySchema(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:116392:21: */ + sqlite3CodeVerifySchemaAtToplevel(tls, func() uintptr { + if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { + return (*Parse)(unsafe.Pointer(pParse)).FpToplevel + } + return pParse + }(), iDb) +} + // If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each // attached database. Otherwise, invoke it for the database named zDb only. -func Xsqlite3CodeVerifyNamedSchema(tls *libc.TLS, pParse uintptr, zDb uintptr) { /* sqlite3.c:115151:21: */ +func Xsqlite3CodeVerifyNamedSchema(tls *libc.TLS, pParse uintptr, zDb uintptr) { /* sqlite3.c:116401:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var i int32 for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { @@ -94976,14 +96050,14 @@ func Xsqlite3CodeVerifyNamedSchema(tls *libc.TLS, pParse uintptr, zDb uintptr) { // 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 Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int32, iDb int32) { /* sqlite3.c:115175:21: */ +func Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int32, iDb int32) { /* sqlite3.c:116425:21: */ var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel } return pParse }() - Xsqlite3CodeVerifySchema(tls, pParse, iDb) + sqlite3CodeVerifySchemaAtToplevel(tls, pToplevel, iDb) *(*YDbMask)(unsafe.Pointer(pToplevel + 112 /* &.writeMask */)) |= (YDbMask((YDbMask(1))) << (iDb)) *(*U8)(unsafe.Pointer(pToplevel + 32 /* &.isMultiWrite */)) |= U8((setStatement)) } @@ -94993,7 +96067,7 @@ func Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int // 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 Xsqlite3MultiWrite(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:115189:21: */ +func Xsqlite3MultiWrite(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:116439:21: */ var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -95017,7 +96091,7 @@ func Xsqlite3MultiWrite(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:115189:21: // 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 Xsqlite3MayAbort(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:115210:21: */ +func Xsqlite3MayAbort(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:116460:21: */ var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -95030,8 +96104,10 @@ func Xsqlite3MayAbort(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:115210:21: * // 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 Xsqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onError int32, p4 uintptr, p4type I8, p5Errmsg U8) { /* sqlite3.c:115220:21: */ - var v uintptr = Xsqlite3GetVdbe(tls, pParse) +func Xsqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onError int32, p4 uintptr, p4type I8, p5Errmsg U8) { /* sqlite3.c:116470:21: */ + var v uintptr + + v = Xsqlite3GetVdbe(tls, pParse) if onError == OE_Abort { Xsqlite3MayAbort(tls, pParse) @@ -95041,7 +96117,7 @@ func Xsqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onErro } // Code an OP_Halt due to UNIQUE or PRIMARY KEY constraint violation. -func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx uintptr) { /* sqlite3.c:115240:21: */ +func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx uintptr) { /* sqlite3.c:116492:21: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -95052,16 +96128,16 @@ func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable Xsqlite3StrAccumInit(tls, bp+8 /* &errMsg */, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), 0, - *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */)))) + *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 128 /* &.aLimit */)))) if (*Index)(unsafe.Pointer(pIdx)).FaColExpr != 0 { - Xsqlite3_str_appendf(tls, bp+8 /* &errMsg */, ts+12436 /* "index '%q'" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName)) + Xsqlite3_str_appendf(tls, bp+8 /* &errMsg */, ts+12852 /* "index '%q'" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName)) } else { for j = 0; j < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); j++ { var zCol uintptr zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)))*32)).FzName if j != 0 { - Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+12447 /* ", " */, 2) + Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+12863 /* ", " */, 2) } Xsqlite3_str_appendall(tls, bp+8 /* &errMsg */, (*Table)(unsafe.Pointer(pTab)).FzName) Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+716 /* "." */, 1) @@ -95076,31 +96152,31 @@ func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx } return (SQLITE_CONSTRAINT | (int32(8) << 8)) }(), - onError, zErr, int8(-7), P5_ConstraintUnique) + onError, zErr, int8(-7), uint8(P5_ConstraintUnique)) } // Code an OP_Halt due to non-unique rowid. -func Xsqlite3RowidConstraint(tls *libc.TLS, pParse uintptr, onError int32, pTab uintptr) { /* sqlite3.c:115276:21: */ +func Xsqlite3RowidConstraint(tls *libc.TLS, pParse uintptr, onError int32, pTab uintptr) { /* sqlite3.c:116528:21: */ bp := tls.Alloc(24) defer tls.Free(24) var zMsg uintptr var rc int32 if int32((*Table)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+9959 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, + zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+10324 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*32)).FzName)) rc = (SQLITE_CONSTRAINT | (int32(6) << 8)) } else { - zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+12450 /* "%s.rowid" */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName)) + zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+12866 /* "%s.rowid" */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName)) rc = (SQLITE_CONSTRAINT | (int32(10) << 8)) } Xsqlite3HaltConstraint(tls, pParse, rc, onError, zMsg, int8(-7), - P5_ConstraintUnique) + uint8(P5_ConstraintUnique)) } // Check to see if pIndex uses the collating sequence pColl. Return // true if it does and false if it does not. -func collationMatch(tls *libc.TLS, zColl uintptr, pIndex uintptr) int32 { /* sqlite3.c:115300:12: */ +func collationMatch(tls *libc.TLS, zColl uintptr, pIndex uintptr) int32 { /* sqlite3.c:116552:12: */ var i int32 for i = 0; i < int32((*Index)(unsafe.Pointer(pIndex)).FnColumn); i++ { @@ -95115,7 +96191,7 @@ func collationMatch(tls *libc.TLS, zColl uintptr, pIndex uintptr) int32 { /* sql // Recompute all indices of pTab that use the collating sequence pColl. // If pColl==0 then recompute all indices of pTab. -func reindexTable(tls *libc.TLS, pParse uintptr, pTab uintptr, zColl uintptr) { /* sqlite3.c:115319:13: */ +func reindexTable(tls *libc.TLS, pParse uintptr, pTab uintptr, zColl uintptr) { /* sqlite3.c:116571:13: */ if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { var pIndex uintptr // An index associated with pTab @@ -95132,7 +96208,7 @@ func reindexTable(tls *libc.TLS, pParse uintptr, pTab uintptr, zColl uintptr) { // Recompute all indices of all tables in all databases where the // indices use the collating sequence pColl. If pColl==0 then recompute // all indices everywhere. -func reindexDatabases(tls *libc.TLS, pParse uintptr, zColl uintptr) { /* sqlite3.c:115340:13: */ +func reindexDatabases(tls *libc.TLS, pParse uintptr, zColl uintptr) { /* sqlite3.c:116592:13: */ var pDb uintptr // A single database var iDb int32 // The database index number var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // The database connection @@ -95174,7 +96250,7 @@ __3: // Form 2 rebuilds all indices in all databases that use the named // collating function. Forms 3 and 4 rebuild the named index or all // indices associated with the named table. -func Xsqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:115372:21: */ +func Xsqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:116624:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -95234,14 +96310,14 @@ func Xsqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintp sqlite3RefillIndex(tls, pParse, pIndex, -1) return } - Xsqlite3ErrorMsg(tls, pParse, ts+12459 /* "unable to identi..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+12875 /* "unable to identi..." */, 0) } // 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 Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr { /* sqlite3.c:115432:24: */ +func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr { /* sqlite3.c:116684:24: */ var i int32 var nCol int32 = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) var nKey int32 = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) @@ -95286,9 +96362,46 @@ func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr return pKey } +// Create a new CTE object +func Xsqlite3CteNew(tls *libc.TLS, pParse uintptr, pName uintptr, pArglist uintptr, pQuery uintptr, eM10d U8) uintptr { /* sqlite3.c:116728:20: */ + var pNew uintptr + var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb + + pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Cte{}))) + + if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + Xsqlite3ExprListDelete(tls, db, pArglist) + Xsqlite3SelectDelete(tls, db, pQuery) + } else { + (*Cte)(unsafe.Pointer(pNew)).FpSelect = pQuery + (*Cte)(unsafe.Pointer(pNew)).FpCols = pArglist + (*Cte)(unsafe.Pointer(pNew)).FzName = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pName) + (*Cte)(unsafe.Pointer(pNew)).FeM10d = eM10d + } + return pNew +} + +// Clear information from a Cte object, but do not deallocate storage +// for the object itself. +func cteClear(tls *libc.TLS, db uintptr, pCte uintptr) { /* sqlite3.c:116757:13: */ + + Xsqlite3ExprListDelete(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpCols) + Xsqlite3SelectDelete(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpSelect) + Xsqlite3DbFree(tls, db, (*Cte)(unsafe.Pointer(pCte)).FzName) +} + +// Free the contents of the CTE object passed as the second argument. +func Xsqlite3CteDelete(tls *libc.TLS, db uintptr, pCte uintptr) { /* sqlite3.c:116767:21: */ + + cteClear(tls, db, pCte) + Xsqlite3DbFree(tls, db, pCte) +} + // This routine is invoked once per CTE by the parser while parsing a -// WITH clause. -func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pName uintptr, pArglist uintptr, pQuery uintptr) uintptr { /* sqlite3.c:115477:21: */ +// WITH clause. The CTE described by teh third argument is added to +// the WITH clause of the second argument. If the second argument is +// NULL, then a new WITH argument is created. +func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pCte uintptr) uintptr { /* sqlite3.c:116779:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -95296,14 +96409,18 @@ func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pName uintptr var pNew uintptr var zName uintptr + if pCte == uintptr(0) { + return pWith + } + // Check that the CTE name is unique within this WITH clause. If // not, store an error in the Parse structure. - zName = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pName) + zName = (*Cte)(unsafe.Pointer(pCte)).FzName if (zName != 0) && (pWith != 0) { var i int32 for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ { - if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer((pWith+16 /* &.a */)+uintptr(i)*32)).FzName) == 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+12505 /* "duplicate WITH t..." */, libc.VaList(bp, zName)) + if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer((pWith+16 /* &.a */)+uintptr(i)*48)).FzName) == 0 { + Xsqlite3ErrorMsg(tls, pParse, ts+12921 /* "duplicate WITH t..." */, libc.VaList(bp, zName)) } } } @@ -95316,30 +96433,22 @@ func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pName uintptr } if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - Xsqlite3ExprListDelete(tls, db, pArglist) - Xsqlite3SelectDelete(tls, db, pQuery) - Xsqlite3DbFree(tls, db, zName) + Xsqlite3CteDelete(tls, db, pCte) pNew = pWith } else { - (*Cte)(unsafe.Pointer((pNew + 16 /* &.a */) + uintptr((*With)(unsafe.Pointer(pNew)).FnCte)*32)).FpSelect = pQuery - (*Cte)(unsafe.Pointer((pNew + 16 /* &.a */) + uintptr((*With)(unsafe.Pointer(pNew)).FnCte)*32)).FpCols = pArglist - (*Cte)(unsafe.Pointer((pNew + 16 /* &.a */) + uintptr((*With)(unsafe.Pointer(pNew)).FnCte)*32)).FzName = zName - (*Cte)(unsafe.Pointer((pNew + 16 /* &.a */) + uintptr((*With)(unsafe.Pointer(pNew)).FnCte)*32)).FzCteErr = uintptr(0) - (*With)(unsafe.Pointer(pNew)).FnCte++ + *(*Cte)(unsafe.Pointer((pNew + 16 /* &.a */) + uintptr(libc.PostIncInt32(&(*With)(unsafe.Pointer(pNew)).FnCte, 1))*48)) = *(*Cte)(unsafe.Pointer(pCte)) + Xsqlite3DbFree(tls, db, pCte) } return pNew } // Free the contents of the With object passed as the second argument. -func Xsqlite3WithDelete(tls *libc.TLS, db uintptr, pWith uintptr) { /* sqlite3.c:115527:21: */ +func Xsqlite3WithDelete(tls *libc.TLS, db uintptr, pWith uintptr) { /* sqlite3.c:116826:21: */ if pWith != 0 { var i int32 for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ { - var pCte uintptr = ((pWith + 16 /* &.a */) + uintptr(i)*32) - Xsqlite3ExprListDelete(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpCols) - Xsqlite3SelectDelete(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpSelect) - Xsqlite3DbFree(tls, db, (*Cte)(unsafe.Pointer(pCte)).FzName) + cteClear(tls, db, ((pWith + 16 /* &.a */) + uintptr(i)*48)) } Xsqlite3DbFree(tls, db, pWith) } @@ -95365,23 +96474,23 @@ func Xsqlite3WithDelete(tls *libc.TLS, db uintptr, pWith uintptr) { /* sqlite3.c // Invoke the 'collation needed' callback to request a collation sequence // in the encoding enc of name zName, length nName. -func callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { /* sqlite3.c:115565:13: */ +func callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { /* sqlite3.c:116861:13: */ if (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded != 0 { var zExternal uintptr = Xsqlite3DbStrDup(tls, db, zName) if !(zExternal != 0) { return } - (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 360 /* &.xCollNeeded */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, enc, zExternal) + (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 368 /* &.xCollNeeded */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, enc, zExternal) Xsqlite3DbFree(tls, db, zExternal) } if (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 != 0 { var zExternal uintptr var pTmp uintptr = Xsqlite3ValueNew(tls, db) - Xsqlite3ValueSetStr(tls, pTmp, -1, zName, SQLITE_UTF8, uintptr(0)) - zExternal = Xsqlite3ValueText(tls, pTmp, SQLITE_UTF16LE) + Xsqlite3ValueSetStr(tls, pTmp, -1, zName, uint8(SQLITE_UTF8), uintptr(0)) + zExternal = Xsqlite3ValueText(tls, pTmp, uint8(SQLITE_UTF16LE)) if zExternal != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 368 /* &.xCollNeeded16 */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, int32((*Sqlite3)(unsafe.Pointer(db)).Fenc), zExternal) + (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 376 /* &.xCollNeeded16 */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, int32((*Sqlite3)(unsafe.Pointer(db)).Fenc), zExternal) } Xsqlite3ValueFree(tls, pTmp) } @@ -95392,7 +96501,7 @@ func callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { /* sq // 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 *libc.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c:115594:12: */ +func synthCollSeq(tls *libc.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c:116890:12: */ var pColl2 uintptr var z uintptr = (*CollSeq)(unsafe.Pointer(pColl)).FzName var i int32 @@ -95407,7 +96516,7 @@ func synthCollSeq(tls *libc.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c return SQLITE_ERROR } -var aEnc = [3]U8{SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8} /* sqlite3.c:115598:19 */ +var aEnc = [3]U8{U8(SQLITE_UTF16BE), U8(SQLITE_UTF16LE), U8(SQLITE_UTF8)} /* sqlite3.c:116894: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 @@ -95418,7 +96527,7 @@ var aEnc = [3]U8{SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8} /* sqlite3.c:11559 // 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 Xsqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) int32 { /* sqlite3.c:115621:20: */ +func Xsqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) int32 { /* sqlite3.c:116917:20: */ if (pColl != 0) && ((*CollSeq)(unsafe.Pointer(pColl)).FxCmp == uintptr(0)) { var zName uintptr = (*CollSeq)(unsafe.Pointer(pColl)).FzName var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb @@ -95442,9 +96551,9 @@ func Xsqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) int32 { // 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 *libc.TLS, db uintptr, zName uintptr, create int32) uintptr { /* sqlite3.c:115649:16: */ +func findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) uintptr { /* sqlite3.c:116945:16: */ var pColl uintptr - pColl = Xsqlite3HashFind(tls, (db + 600 /* &.aCollSeq */), zName) + pColl = Xsqlite3HashFind(tls, (db + 608 /* &.aCollSeq */), zName) if (uintptr(0) == pColl) && (create != 0) { var nName int32 = (Xsqlite3Strlen30(tls, zName) + 1) @@ -95452,13 +96561,13 @@ func findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) ui if pColl != 0 { var pDel uintptr = uintptr(0) (*CollSeq)(unsafe.Pointer(pColl)).FzName = (pColl + 3*40) - (*CollSeq)(unsafe.Pointer(pColl)).Fenc = SQLITE_UTF8 + (*CollSeq)(unsafe.Pointer(pColl)).Fenc = U8(SQLITE_UTF8) (*CollSeq)(unsafe.Pointer(pColl + 1*40)).FzName = (pColl + 3*40) - (*CollSeq)(unsafe.Pointer(pColl + 1*40)).Fenc = SQLITE_UTF16LE + (*CollSeq)(unsafe.Pointer(pColl + 1*40)).Fenc = U8(SQLITE_UTF16LE) (*CollSeq)(unsafe.Pointer(pColl + 2*40)).FzName = (pColl + 3*40) - (*CollSeq)(unsafe.Pointer(pColl + 2*40)).Fenc = SQLITE_UTF16BE + (*CollSeq)(unsafe.Pointer(pColl + 2*40)).Fenc = U8(SQLITE_UTF16BE) libc.Xmemcpy(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, zName, uint64(nName)) - pDel = Xsqlite3HashInsert(tls, (db + 600 /* &.aCollSeq */), (*CollSeq)(unsafe.Pointer(pColl)).FzName, pColl) + pDel = Xsqlite3HashInsert(tls, (db + 608 /* &.aCollSeq */), (*CollSeq)(unsafe.Pointer(pColl)).FzName, pColl) // If a malloc() failure occurred in sqlite3HashInsert(), it will // return the pColl pointer to be deleted (because it wasn't added @@ -95487,7 +96596,7 @@ func findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) ui // cannot be found. // // See also: sqlite3LocateCollSeq(), sqlite3GetCollSeq() -func Xsqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc U8, zName uintptr, create int32) uintptr { /* sqlite3.c:115701:24: */ +func Xsqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc U8, zName uintptr, create int32) uintptr { /* sqlite3.c:116997:24: */ var pColl uintptr if zName != 0 { @@ -95503,7 +96612,7 @@ func Xsqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc U8, zName uintptr, creat // Change the text encoding for a database connection. This means that // the pDfltColl must change as well. -func Xsqlite3SetTextEncoding(tls *libc.TLS, db uintptr, enc U8) { /* sqlite3.c:115723:21: */ +func Xsqlite3SetTextEncoding(tls *libc.TLS, db uintptr, enc U8) { /* sqlite3.c:117019:21: */ (*Sqlite3)(unsafe.Pointer(db)).Fenc = enc // EVIDENCE-OF: R-08308-17224 The default collating function for all @@ -95523,7 +96632,7 @@ func Xsqlite3SetTextEncoding(tls *libc.TLS, db uintptr, enc U8) { /* sqlite3.c:1 // sequence can be found. If no collation is found, leave an error message. // // See also: sqlite3LocateCollSeq(), sqlite3FindCollSeq() -func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zName uintptr) uintptr { /* sqlite3.c:115746:24: */ +func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zName uintptr) uintptr { /* sqlite3.c:117042:24: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -95545,7 +96654,7 @@ func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zN } if p == uintptr(0) { - Xsqlite3ErrorMsg(tls, pParse, ts+12535 /* "no such collatio..." */, libc.VaList(bp, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+12951 /* "no such collatio..." */, libc.VaList(bp, zName)) (*Parse)(unsafe.Pointer(pParse)).Frc = (SQLITE_ERROR | (int32(1) << 8)) } return p @@ -95569,7 +96678,7 @@ func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zN // and generates an error message. // // See also: sqlite3FindCollSeq(), sqlite3GetCollSeq() -func Xsqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) uintptr { /* sqlite3.c:115797:24: */ +func Xsqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) uintptr { /* sqlite3.c:117093:24: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var enc U8 = (*Sqlite3)(unsafe.Pointer(db)).Fenc var initbusy U8 = (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy @@ -95610,7 +96719,7 @@ func Xsqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) uintptr // If nArg==(-2) then any function with a non-null xSFunc is // a perfect match and any function with xSFunc NULL is // a non-match. -func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlite3.c:115840:12: */ +func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlite3.c:117136:12: */ var match int32 // Wrong number of arguments means "no match" @@ -95635,7 +96744,7 @@ func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlit } // Bonus points if the text encoding matches - if U32(enc) == ((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_ENCMASK) { + if U32(enc) == ((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) { match = match + (2) // Exact encoding match } else if ((U32(enc) & (*FuncDef)(unsafe.Pointer(p)).FfuncFlags) & U32(2)) != U32(0) { match = match + (1) // Both are UTF16, but with different byte orders @@ -95646,7 +96755,7 @@ func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlit // 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 Xsqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) uintptr { /* sqlite3.c:115876:24: */ +func Xsqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) uintptr { /* sqlite3.c:117172:24: */ var p uintptr for p = *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) /* &.a */) + uintptr(h)*8)); p != 0; p = *(*uintptr)(unsafe.Pointer(p + 64 /* &.u */)) { if Xsqlite3StrICmp(tls, (*FuncDef)(unsafe.Pointer(p)).FzName, zFunc) == 0 { @@ -95657,7 +96766,7 @@ func Xsqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) uintptr { /* } // Insert a new FuncDef into a FuncDefHash hash table. -func Xsqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32) { /* sqlite3.c:115892:21: */ +func Xsqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32) { /* sqlite3.c:117188:21: */ var i int32 for i = 0; i < nDef; i++ { var pOther uintptr @@ -95695,7 +96804,7 @@ func Xsqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32) { /* sq // 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 Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, enc U8, createFlag U8) uintptr { /* sqlite3.c:115937:24: */ +func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, enc U8, createFlag U8) uintptr { /* sqlite3.c:117233:24: */ var p uintptr // Iterator variable var pBest uintptr = uintptr(0) // Best match found so far var bestScore int32 = 0 // Score of best match @@ -95705,7 +96814,7 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, nName = Xsqlite3Strlen30(tls, zName) // First search for a match amongst the application-defined functions. - p = Xsqlite3HashFind(tls, (db + 576 /* &.aFunc */), zName) + p = Xsqlite3HashFind(tls, (db + 584 /* &.aFunc */), zName) for p != 0 { var score int32 = matchQuality(tls, p, nArg, enc) if score > bestScore { @@ -95726,7 +96835,7 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, // have fields overwritten with new information appropriate for the // new function. But the FuncDefs for built-in functions are read-only. // So we must not search for built-ins when creating a new function. - if !(createFlag != 0) && ((pBest == uintptr(0)) || (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_PreferBuiltin) != U32(0))) { + if !(createFlag != 0) && ((pBest == uintptr(0)) || (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_PreferBuiltin)) != U32(0))) { bestScore = 0 h = (((int32(Xsqlite3UpperToLower[U8(*(*int8)(unsafe.Pointer(zName)))])) + (nName)) % SQLITE_FUNC_HASH_SZ) p = Xsqlite3FunctionSearch(tls, h, zName) @@ -95753,7 +96862,7 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, for z = (*FuncDef)(unsafe.Pointer(pBest)).FzName; *(*U8)(unsafe.Pointer(z)) != 0; z++ { *(*U8)(unsafe.Pointer(z)) = Xsqlite3UpperToLower[*(*U8)(unsafe.Pointer(z))] } - pOther = Xsqlite3HashInsert(tls, (db + 576 /* &.aFunc */), (*FuncDef)(unsafe.Pointer(pBest)).FzName, pBest) + pOther = Xsqlite3HashInsert(tls, (db + 584 /* &.aFunc */), (*FuncDef)(unsafe.Pointer(pBest)).FzName, pBest) if pOther == pBest { Xsqlite3DbFree(tls, db, pBest) Xsqlite3OomFault(tls, db) @@ -95775,7 +96884,7 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, // of the schema hash tables). // // The Schema.cache_size variable is not cleared. -func Xsqlite3SchemaClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:116029:21: */ +func Xsqlite3SchemaClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:117325:21: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -95810,7 +96919,7 @@ func Xsqlite3SchemaClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:116029:21: */ // Find and return the schema associated with a BTree. Create // a new one if necessary. -func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqlite3.c:116061:23: */ +func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqlite3.c:117357:23: */ var p uintptr if pBt != 0 { p = Xsqlite3BtreeSchema(tls, pBt, int32(unsafe.Sizeof(Schema{})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3SchemaClear}))) @@ -95824,7 +96933,7 @@ func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqli Xsqlite3HashInit(tls, (p + 32 /* &.idxHash */)) Xsqlite3HashInit(tls, (p + 56 /* &.trigHash */)) Xsqlite3HashInit(tls, (p + 80 /* &.fkeyHash */)) - (*Schema)(unsafe.Pointer(p)).Fenc = SQLITE_UTF8 + (*Schema)(unsafe.Pointer(p)).Fenc = U8(SQLITE_UTF8) } return p } @@ -95857,18 +96966,18 @@ func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqli // pSrc->a[0].pTab Pointer to the Table object // pSrc->a[0].pIndex Pointer to the INDEXED BY index, if there is one // -func Xsqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) uintptr { /* sqlite3.c:116112:22: */ +func Xsqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) uintptr { /* sqlite3.c:117408:22: */ var pItem uintptr = pSrc + 8 /* &.a */ var pTab uintptr pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pItem) - Xsqlite3DeleteTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcList_item)(unsafe.Pointer(pItem)).FpTab) - (*SrcList_item)(unsafe.Pointer(pItem)).FpTab = pTab + Xsqlite3DeleteTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcItem)(unsafe.Pointer(pItem)).FpTab) + (*SrcItem)(unsafe.Pointer(pItem)).FpTab = pTab if pTab != 0 { (*Table)(unsafe.Pointer(pTab)).FnTabRef++ - } - if Xsqlite3IndexedByLookup(tls, pParse, pItem) != 0 { - pTab = uintptr(0) + if ((uint32(int32(*(*uint8)(unsafe.Pointer((pItem + 60 /* &.fg */) + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0) && (Xsqlite3IndexedByLookup(tls, pParse, pItem) != 0) { + pTab = uintptr(0) + } } return pTab } @@ -95887,7 +96996,7 @@ func Xsqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) uintptr // 3) The table is a shadow table, the database connection is in // defensive mode, and the current sqlite3_prepare() // is for a top-level SQL statement. -func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:116143:12: */ +func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:117439:12: */ var db uintptr if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { return (libc.Bool32((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pTab))).FpMod)).FpModule)).FxUpdate == uintptr(0))) @@ -95896,7 +97005,7 @@ func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlit return 0 } db = (*Parse)(unsafe.Pointer(pParse)).Fdb - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Readonly) != U32(0) { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Readonly)) != U32(0) { return (libc.Bool32((Xsqlite3WritableSchema(tls, db) == 0) && (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0))) } @@ -95906,16 +97015,16 @@ func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlit // 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 Xsqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, viewOk int32) int32 { /* sqlite3.c:116162:20: */ +func Xsqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, viewOk int32) int32 { /* sqlite3.c:117458:20: */ bp := tls.Alloc(16) defer tls.Free(16) if tabIsReadOnly(tls, pParse, pTab) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+12566 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+12982 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) return 1 } if !(viewOk != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+12595 /* "cannot modify %s..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+13011 /* "cannot modify %s..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) return 1 } return 0 @@ -95924,7 +97033,7 @@ func Xsqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, viewOk int3 // 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 Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr, iCur int32) { /* sqlite3.c:116183:21: */ +func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr, iCur int32) { /* sqlite3.c:117479:21: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -95938,12 +97047,12 @@ func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWher pFrom = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) if pFrom != 0 { - (*SrcList_item)(unsafe.Pointer((pFrom + 8 /* &.a */))).FzName = Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pView)).FzName) - (*SrcList_item)(unsafe.Pointer((pFrom + 8 /* &.a */))).FzDatabase = Xsqlite3DbStrDup(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName) + (*SrcItem)(unsafe.Pointer((pFrom + 8 /* &.a */))).FzName = Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pView)).FzName) + (*SrcItem)(unsafe.Pointer((pFrom + 8 /* &.a */))).FzDatabase = Xsqlite3DbStrDup(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName) } pSel = Xsqlite3SelectNew(tls, pParse, uintptr(0), pFrom, pWhere, uintptr(0), uintptr(0), pOrderBy, - SF_IncludeHidden, pLimit) + uint32(SF_IncludeHidden), pLimit) Xsqlite3SelectDestInit(tls, bp /* &dest */, SRT_EphemTab, iCur) Xsqlite3Select(tls, pParse, pSel, bp /* &dest */) Xsqlite3SelectDelete(tls, db, pSel) @@ -95956,7 +97065,7 @@ func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWher // DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL; // \________/ \________________/ // pTabList pWhere -func Xsqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:116315:21: */ +func Xsqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:117617:21: */ bp := tls.Alloc(88) defer tls.Free(88) @@ -96141,9 +97250,10 @@ __13: // Initialize the counter of the number of rows deleted, if // we are counting rows. - if !(((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) && + if !((((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) && - !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) { + !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) && + !(int32((*Parse)(unsafe.Pointer(pParse)).FbReturning) != 0)) { goto __14 } memCnt = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) @@ -96170,7 +97280,7 @@ __14: } Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(1), (*Table)(unsafe.Pointer(pTab)).FzName) - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __17 } Xsqlite3VdbeAddOp4(tls, v, OP_Clear, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, func() int32 { @@ -96199,7 +97309,7 @@ __20: goto __16 __15: - wcf = (U16((WHERE_ONEPASS_DESIRED | WHERE_DUPLICATES_OK) | WHERE_SEEK_TABLE)) + wcf = (U16(WHERE_ONEPASS_DESIRED | WHERE_DUPLICATES_OK)) if !(((*NameContext)(unsafe.Pointer(bp+16 /* &sNC */)).FncFlags & NC_VarSelect) != 0) { goto __21 } @@ -96212,7 +97322,7 @@ __21: } return WHERE_ONEPASS_MULTIROW }())) - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __22 } // For a rowid table, initialize the RowSet to an empty set @@ -96257,44 +97367,50 @@ __24: Xsqlite3MultiWrite(tls, pParse) __25: ; + if !(Xsqlite3WhereUsesDeferredSeek(tls, pWInfo) != 0) { + goto __26 + } + Xsqlite3VdbeAddOp1(tls, v, OP_FinishSeek, iTabCur) +__26: + ; // Keep track of the number of rows to be deleted if !(memCnt != 0) { - goto __26 + goto __27 } Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, memCnt, 1) -__26: +__27: ; // Extract the rowid or primary key for the current row if !(pPk != 0) { - goto __27 + goto __28 } i = 0 -__29: +__30: if !(i < int32(nPk)) { - goto __31 + goto __32 } Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iTabCur, int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), (iPk + i)) - goto __30 -__30: - i++ - goto __29 goto __31 __31: + i++ + goto __30 + goto __32 +__32: ; iKey = iPk - goto __28 -__27: + goto __29 +__28: iKey = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iTabCur, -1, iKey) -__28: +__29: ; if !(eOnePass != ONEPASS_OFF) { - goto __32 + goto __33 } // For ONEPASS, no need to store the rowid/primary-key. There is only // one, so just keep it in its register(s) and fall through to the @@ -96302,63 +97418,53 @@ __28: nKey = nPk // OP_Found will use an unpacked key aToOpen = Xsqlite3DbMallocRawNN(tls, db, (uint64(nIdx + 2))) if !(aToOpen == uintptr(0)) { - goto __34 + goto __35 } Xsqlite3WhereEnd(tls, pWInfo) goto delete_from_cleanup -__34: +__35: ; libc.Xmemset(tls, aToOpen, 1, (uint64(nIdx + 1))) *(*U8)(unsafe.Pointer(aToOpen + uintptr((nIdx + 1)))) = U8(0) if !(*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */)) >= 0) { - goto __35 - } - *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */)) - iTabCur)))) = U8(0) -__35: - ; - if !(*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4)) >= 0) { goto __36 } - *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4)) - iTabCur)))) = U8(0) + *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */)) - iTabCur)))) = U8(0) __36: ; - if !(addrEphOpen != 0) { + if !(*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4)) >= 0) { goto __37 } - Xsqlite3VdbeChangeToNoop(tls, v, addrEphOpen) + *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4)) - iTabCur)))) = U8(0) __37: ; - goto __33 -__32: - if !(pPk != 0) { + if !(addrEphOpen != 0) { goto __38 } + Xsqlite3VdbeChangeToNoop(tls, v, addrEphOpen) +__38: + ; + addrBypass = Xsqlite3VdbeMakeLabel(tls, pParse) + goto __34 +__33: + if !(pPk != 0) { + goto __39 + } // Add the PK key for this row to the temporary table iKey = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) nKey = int16(0) // Zero tells OP_Found to use a composite key Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, iPk, int32(nPk), iKey, Xsqlite3IndexAffinityStr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pPk), int32(nPk)) Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iEphCur, iKey, iPk, int32(nPk)) - goto __39 -__38: + goto __40 +__39: // Add the rowid of the row to be deleted to the RowSet nKey = int16(1) // OP_DeferredSeek always uses a single rowid Xsqlite3VdbeAddOp2(tls, v, OP_RowSetAdd, iRowSet, iKey) -__39: - ; -__33: - ; - - // If this DELETE cannot use the ONEPASS strategy, this is the - // end of the WHERE loop - if !(eOnePass != ONEPASS_OFF) { - goto __40 - } - addrBypass = Xsqlite3VdbeMakeLabel(tls, pParse) - goto __41 __40: + ; Xsqlite3WhereEnd(tls, pWInfo) -__41: +__34: ; // Unless this is a view, open cursors for the table we are @@ -96366,118 +97472,118 @@ __41: // only effect this statement has is to fire the INSTEAD OF // triggers. if !(!(isView != 0)) { - goto __42 + goto __41 } iAddrOnce = 0 if !(eOnePass == ONEPASS_MULTI) { - goto __43 + goto __42 } iAddrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once) -__43: +__42: ; - Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, OPFLAG_FORDELETE, + Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, uint8(OPFLAG_FORDELETE), iTabCur, aToOpen, bp+80 /* &iDataCur */, bp+84 /* &iIdxCur */) if !(eOnePass == ONEPASS_MULTI) { - goto __44 + goto __43 } Xsqlite3VdbeJumpHereOrPopInst(tls, v, iAddrOnce) -__44: +__43: ; -__42: +__41: ; // Set up a loop over the rowids/primary-keys that were found in the // where-clause loop above. if !(eOnePass != ONEPASS_OFF) { - goto __45 + goto __44 } // OP_Found will use an unpacked key if !(!((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) && (*(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 80 /* iDataCur */)) - iTabCur)))) != 0)) { - goto __47 + goto __46 } Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, *(*int32)(unsafe.Pointer(bp + 80 /* iDataCur */)), addrBypass, iKey, int32(nKey)) -__47: +__46: ; - goto __46 -__45: + goto __45 +__44: if !(pPk != 0) { - goto __48 + goto __47 } addrLoop = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iEphCur) if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { - goto __50 + goto __49 } Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEphCur, 0, iKey) - goto __51 -__50: + goto __50 +__49: Xsqlite3VdbeAddOp2(tls, v, OP_RowData, iEphCur, iKey) -__51: +__50: ; // OP_Found will use a composite key - goto __49 -__48: + goto __48 +__47: addrLoop = Xsqlite3VdbeAddOp3(tls, v, OP_RowSetRead, iRowSet, 0, iKey) -__49: +__48: ; -__46: +__45: ; // Delete the row if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { - goto __52 + goto __51 } pVTab = Xsqlite3GetVTable(tls, db, pTab) Xsqlite3VtabMakeWritable(tls, pParse, pTab) Xsqlite3MayAbort(tls, pParse) if !(eOnePass == ONEPASS_SINGLE) { - goto __54 + goto __53 } Xsqlite3VdbeAddOp1(tls, v, OP_Close, iTabCur) if !((*Parse)(unsafe.Pointer((pParse))).FpToplevel == uintptr(0)) { - goto __55 + goto __54 } (*Parse)(unsafe.Pointer(pParse)).FisMultiWrite = U8(0) -__55: - ; __54: ; +__53: + ; Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 0, 1, iKey, pVTab, -12) - Xsqlite3VdbeChangeP5(tls, v, OE_Abort) - goto __53 -__52: + Xsqlite3VdbeChangeP5(tls, v, uint16(OE_Abort)) + goto __52 +__51: count = (libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)) // True to count changes Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, *(*int32)(unsafe.Pointer(bp + 80 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 84 /* iIdxCur */)), - iKey, nKey, uint8(count), OE_Default, uint8(eOnePass), *(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4))) -__53: + iKey, nKey, uint8(count), uint8(OE_Default), uint8(eOnePass), *(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4))) +__52: ; // End of the loop over all rowids/primary-keys. if !(eOnePass != ONEPASS_OFF) { - goto __56 + goto __55 } Xsqlite3VdbeResolveLabel(tls, v, addrBypass) Xsqlite3WhereEnd(tls, pWInfo) - goto __57 -__56: + goto __56 +__55: if !(pPk != 0) { - goto __58 + goto __57 } Xsqlite3VdbeAddOp2(tls, v, OP_Next, iEphCur, (addrLoop + 1)) Xsqlite3VdbeJumpHere(tls, v, addrLoop) - goto __59 -__58: + goto __58 +__57: Xsqlite3VdbeGoto(tls, v, addrLoop) Xsqlite3VdbeJumpHere(tls, v, addrLoop) -__59: +__58: ; -__57: +__56: ; __16: ; // End non-truncate path @@ -96486,22 +97592,22 @@ __16: // maximum rowid counter values recorded while inserting into // autoincrement tables. if !((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && ((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0))) { - goto __60 + goto __59 } Xsqlite3AutoincrementEnd(tls, pParse) -__60: +__59: ; // Return the number of rows that were deleted. If this routine is // generating code because of a call to sqlite3NestedParse(), do not // invoke the callback function. if !(memCnt != 0) { - goto __61 + goto __60 } - Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, memCnt, 1) + Xsqlite3VdbeAddOp2(tls, v, OP_ChngCntRow, memCnt, 1) Xsqlite3VdbeSetNumCols(tls, v, 1) - Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+12633 /* "rows deleted" */, uintptr(0)) -__61: + Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+13049 /* "rows deleted" */, uintptr(0)) +__60: ; delete_from_cleanup: @@ -96555,7 +97661,7 @@ delete_from_cleanup: // 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 Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger uintptr, iDataCur int32, iIdxCur int32, iPk int32, nPk I16, count U8, onconf U8, eMode U8, iIdxNoSeek int32) { /* sqlite3.c:116762:21: */ +func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger uintptr, iDataCur int32, iIdxCur int32, iPk int32, nPk I16, count U8, onconf U8, eMode U8, iIdxNoSeek int32) { /* sqlite3.c:118062:21: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Vdbe var iOld int32 = 0 // First register in OLD.* array var iLabel int32 // Label resolved to end of generated code @@ -96567,10 +97673,10 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri // (this can happen if a trigger program has already deleted it), do // not attempt to delete it or fire any DELETE triggers. iLabel = Xsqlite3VdbeMakeLabel(tls, pParse) - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { - opSeek = OP_NotExists + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + opSeek = uint8(OP_NotExists) } else { - opSeek = OP_NotFound + opSeek = uint8(OP_NotFound) } if int32(eMode) == ONEPASS_OFF { Xsqlite3VdbeAddOp4Int(tls, v, int32(opSeek), iDataCur, iLabel, iPk, int32(nPk)) @@ -96645,11 +97751,11 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri } return 0 }()) - if (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) || (0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+9240 /* "sqlite_stat1" */)) { + if (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) || (0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+9605 /* "sqlite_stat1" */)) { Xsqlite3VdbeAppendP4(tls, v, pTab, -6) } if int32(eMode) != ONEPASS_OFF { - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_AUXDELETE) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_AUXDELETE)) } if (iIdxNoSeek >= 0) && (iIdxNoSeek != iDataCur) { Xsqlite3VdbeAddOp1(tls, v, OP_Delete, iIdxNoSeek) @@ -96692,7 +97798,7 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri // // 3. The "iDataCur" cursor must be already be positioned on the row // that is to be deleted. -func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, aRegIdx uintptr, iIdxNoSeek int32) { /* sqlite3.c:116914:21: */ +func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, aRegIdx uintptr, iIdxNoSeek int32) { /* sqlite3.c:118214:21: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -96706,7 +97812,7 @@ func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, var pPk uintptr // PRIMARY KEY index, or NULL for rowid tables v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk = uintptr(0) } else { pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) @@ -96781,7 +97887,7 @@ __3: // 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 Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iDataCur int32, regOut int32, prefixOnly int32, piPartIdxLabel uintptr, pPrior uintptr, regPrior int32) int32 { /* sqlite3.c:116979:20: */ +func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iDataCur int32, regOut int32, prefixOnly int32, piPartIdxLabel uintptr, pPrior uintptr, regPrior int32) int32 { /* sqlite3.c:118279:20: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var j int32 var regBase int32 @@ -96823,14 +97929,10 @@ func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iData // But we are getting ready to store this value back into an index, where // it should be converted by to INTEGER again. So omit the OP_RealAffinity // opcode if it is present - Xsqlite3VdbeDeletePriorOpcode(tls, v, OP_RealAffinity) + Xsqlite3VdbeDeletePriorOpcode(tls, v, uint8(OP_RealAffinity)) } if regOut != 0 { Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regBase, nCol, regOut) - if (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FpSelect != 0 { - var zAff uintptr = Xsqlite3IndexAffinityStr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIdx) - Xsqlite3VdbeChangeP4(tls, v, -1, zAff, P4_TRANSIENT) - } } Xsqlite3ReleaseTempRange(tls, pParse, regBase, nCol) return regBase @@ -96839,7 +97941,7 @@ func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iData // 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 Xsqlite3ResolvePartIdxLabel(tls *libc.TLS, pParse uintptr, iLabel int32) { /* sqlite3.c:117043:21: */ +func Xsqlite3ResolvePartIdxLabel(tls *libc.TLS, pParse uintptr, iLabel int32) { /* sqlite3.c:118339:21: */ if iLabel != 0 { Xsqlite3VdbeResolveLabel(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iLabel) } @@ -96867,7 +97969,7 @@ func Xsqlite3ResolvePartIdxLabel(tls *libc.TLS, pParse uintptr, iLabel int32) { // #include "vdbeInt.h" // Return the collating function associated with a function. -func sqlite3GetFuncCollSeq(tls *libc.TLS, context uintptr) uintptr { /* sqlite3.c:117077:16: */ +func sqlite3GetFuncCollSeq(tls *libc.TLS, context uintptr) uintptr { /* sqlite3.c:118373:16: */ var pOp uintptr pOp = ((*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(context)).FpVdbe)).FaOp + uintptr(((*Sqlite3_context)(unsafe.Pointer(context)).FiOp-1))*24) @@ -96877,14 +97979,14 @@ func sqlite3GetFuncCollSeq(tls *libc.TLS, context uintptr) uintptr { /* sqlite3. // Indicate that the accumulator load should be skipped on this // iteration of the aggregate loop. -func sqlite3SkipAccumulatorLoad(tls *libc.TLS, context uintptr) { /* sqlite3.c:117090:13: */ +func sqlite3SkipAccumulatorLoad(tls *libc.TLS, context uintptr) { /* sqlite3.c:118386:13: */ (*Sqlite3_context)(unsafe.Pointer(context)).FisError = -1 (*Sqlite3_context)(unsafe.Pointer(context)).FskipFlag = U8(1) } // Implementation of the non-aggregate min() and max() functions -func minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117099:13: */ +func minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118395:13: */ var i int32 var mask int32 // 0 for min() or 0xffffffff for max() var iBest int32 @@ -96914,7 +98016,7 @@ func minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s } // Return the type of the argument. -func typeofFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:117129:13: */ +func typeofFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:118425:13: */ var i int32 = (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) - 1) _ = NotUsed @@ -96925,10 +98027,10 @@ func typeofFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { / Xsqlite3_result_text(tls, context, azType2[i], -1, uintptr(0)) } -var azType2 = [5]uintptr{ts + 5092 /* "integer" */, ts + 5087 /* "real" */, ts + 12646 /* "text" */, ts + 12651 /* "blob" */, ts + 5082 /* "null" */} /* sqlite3.c:117134:21 */ +var azType2 = [5]uintptr{ts + 5137 /* "integer" */, ts + 5132 /* "real" */, ts + 13062 /* "text" */, ts + 13067 /* "blob" */, ts + 5127 /* "null" */} /* sqlite3.c:118430:21 */ // Implementation of the length() function -func lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117154:13: */ +func lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118450:13: */ _ = argc switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) { @@ -96977,7 +98079,7 @@ func lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s // // IMP: R-23979-26855 The abs(X) function returns the absolute value of // the numeric argument X. -func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117196:13: */ +func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118492:13: */ _ = argc switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) { @@ -96989,7 +98091,7 @@ func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli // IMP: R-31676-45509 If X is the integer -9223372036854775808 // then abs(X) throws an integer overflow error since there is no // equivalent positive 64-bit two complement value. - Xsqlite3_result_error(tls, context, ts+12656 /* "integer overflow" */, -1) + Xsqlite3_result_error(tls, context, ts+13072 /* "integer overflow" */, -1) return } iVal = -iVal @@ -97031,7 +98133,7 @@ func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117245:13: */ +func instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118541:13: */ var zHaystack uintptr var zNeedle uintptr var nHaystack int32 @@ -97146,7 +98248,7 @@ endInstrOOM: } // Implementation of the printf() function. -func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117313:13: */ +func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118609:13: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -97162,8 +98264,8 @@ func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s (*PrintfArguments)(unsafe.Pointer(bp + 40 /* &x */)).FnArg = (argc - 1) (*PrintfArguments)(unsafe.Pointer(bp + 40 /* &x */)).FnUsed = 0 (*PrintfArguments)(unsafe.Pointer(bp + 40 /* &x */)).FapArg = (argv + uintptr(1)*8) - Xsqlite3StrAccumInit(tls, bp+8 /* &str */, db, uintptr(0), 0, *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) - (*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FprintfFlags = SQLITE_PRINTF_SQLFUNC + Xsqlite3StrAccumInit(tls, bp+8 /* &str */, db, uintptr(0), 0, *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) + (*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FprintfFlags = U8(SQLITE_PRINTF_SQLFUNC) Xsqlite3_str_appendf(tls, bp+8 /* &str */, zFormat, libc.VaList(bp, bp+40 /* &x */)) n = int32((*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FnChar) Xsqlite3_result_text(tls, context, Xsqlite3StrAccumFinish(tls, bp+8 /* &str */), n, @@ -97181,7 +98283,7 @@ func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117349:13: */ +func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118645:13: */ var z uintptr var z2 uintptr var len int32 @@ -97229,7 +98331,7 @@ func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s negP2 = 1 } } else { - p2 = I64(*(*int32)(unsafe.Pointer((Xsqlite3_context_db_handle(tls, context) + 124 /* &.aLimit */)))) + p2 = I64(*(*int32)(unsafe.Pointer((Xsqlite3_context_db_handle(tls, context) + 128 /* &.aLimit */)))) } if p1 < int64(0) { p1 = p1 + (I64(len)) @@ -97276,7 +98378,7 @@ func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s } Xsqlite3_result_text64(tls, context, z, (uint64((int64(z2) - int64(z)) / 1)), libc.UintptrFromInt32(-1), - SQLITE_UTF8) + uint8(SQLITE_UTF8)) } else { if (p1 + p2) > I64(len) { p2 = (I64(len) - p1) @@ -97289,7 +98391,7 @@ func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s } // Implementation of the round() function -func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117444:13: */ +func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118740:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -97327,12 +98429,12 @@ func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq return +0.5 }())))) } else { - zBuf = Xsqlite3_mprintf(tls, ts+12673 /* "%.*f" */, libc.VaList(bp, n, *(*float64)(unsafe.Pointer(bp + 16 /* r */)))) + zBuf = Xsqlite3_mprintf(tls, ts+13089 /* "%.*f" */, libc.VaList(bp, n, *(*float64)(unsafe.Pointer(bp + 16 /* r */)))) if zBuf == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return } - Xsqlite3AtoF(tls, zBuf, bp+16 /* &r */, Xsqlite3Strlen30(tls, zBuf), SQLITE_UTF8) + Xsqlite3AtoF(tls, zBuf, bp+16 /* &r */, Xsqlite3Strlen30(tls, zBuf), uint8(SQLITE_UTF8)) Xsqlite3_free(tls, zBuf) } Xsqlite3_result_double(tls, context, *(*float64)(unsafe.Pointer(bp + 16 /* r */))) @@ -97343,11 +98445,11 @@ func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq // 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 *libc.TLS, context uintptr, nByte I64) uintptr { /* sqlite3.c:117485:13: */ +func contextMalloc(tls *libc.TLS, context uintptr, nByte I64) uintptr { /* sqlite3.c:118781:13: */ var z uintptr var db uintptr = Xsqlite3_context_db_handle(tls, context) - if nByte > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) { + if nByte > I64(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) { Xsqlite3_result_error_toobig(tls, context) z = uintptr(0) } else { @@ -97360,7 +98462,7 @@ func contextMalloc(tls *libc.TLS, context uintptr, nByte I64) uintptr { /* sqlit } // Implementation of the upper() and lower() SQL functions. -func upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117506:13: */ +func upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118802:13: */ var z1 uintptr var z2 uintptr var i int32 @@ -97381,7 +98483,7 @@ func upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq } } -func lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117525:13: */ +func lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118821:13: */ var z1 uintptr var z2 uintptr var i int32 @@ -97410,7 +98512,7 @@ func lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq // is. We might as well use the "version()" function as a substitute. // Implementation of random(). Return a random integer. -func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117558:13: */ +func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:118854:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -97434,7 +98536,7 @@ func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) // Implementation of randomblob(N). Return a random blob // that is N bytes long. -func randomBlob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117584:13: */ +func randomBlob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118880:13: */ var n Sqlite3_int64 var p uintptr @@ -97452,7 +98554,7 @@ func randomBlob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s // 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 *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117608:13: */ +func last_insert_rowid(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:118904:13: */ var db uintptr = Xsqlite3_context_db_handle(tls, context) _ = NotUsed _ = NotUsed2 @@ -97467,7 +98569,7 @@ func last_insert_rowid(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 u // 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 *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117628:13: */ +func changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:118924:13: */ var db uintptr = Xsqlite3_context_db_handle(tls, context) _ = NotUsed _ = NotUsed2 @@ -97476,7 +98578,7 @@ func changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { // Implementation of the total_changes() SQL function. The return value is // the same as the sqlite3_total_changes() API function. -func total_changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117642:13: */ +func total_changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:118938:13: */ var db uintptr = Xsqlite3_context_db_handle(tls, context) _ = NotUsed _ = NotUsed2 @@ -97491,20 +98593,20 @@ type compareInfo = struct { FmatchOne U8 FmatchSet U8 FnoCase U8 -} /* sqlite3.c:117657:1 */ +} /* sqlite3.c:118953:1 */ // For LIKE and GLOB matching on EBCDIC machines, assume that every // character is exactly one byte in size. Also, provde the Utf8Read() // macro for fast reading of the next character in the common case where // the next character is ASCII. -var globInfo = compareInfo{FmatchAll: U8('*'), FmatchOne: U8('?'), FmatchSet: U8('[')} /* sqlite3.c:117677:33 */ +var globInfo = compareInfo{FmatchAll: U8('*'), FmatchOne: U8('?'), FmatchSet: U8('[')} /* sqlite3.c:118973:33 */ // The correct SQL-92 behavior is for the LIKE operator to ignore // case. Thus 'a' LIKE 'A' would be true. -var likeInfoNorm = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_'), FnoCase: U8(1)} /* sqlite3.c:117680:33 */ +var likeInfoNorm = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_'), FnoCase: U8(1)} /* sqlite3.c:118976:33 */ // If SQLITE_CASE_SENSITIVE_LIKE is defined, then the LIKE operator // is case sensitive causing 'a' LIKE 'A' to be false -var likeInfoAlt = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_')} /* sqlite3.c:117683:33 */ +var likeInfoAlt = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_')} /* sqlite3.c:118979:33 */ // Possible error returns from patternMatch() @@ -97544,7 +98646,7 @@ var likeInfoAlt = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_')} /* sqlite3 // 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 *libc.TLS, zPattern uintptr, zString uintptr, pInfo uintptr, matchOther U32) int32 { /* sqlite3.c:117730:12: */ +func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uintptr, matchOther U32) int32 { /* sqlite3.c:119026:12: */ bp := tls.Alloc(19) defer tls.Free(19) *(*uintptr)(unsafe.Pointer(bp)) = zPattern @@ -97572,7 +98674,8 @@ func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uint return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp /* zPattern */)), 1)))) } return Xsqlite3Utf8Read(tls, bp /* &zPattern */) - }())) == matchAll) || (c == matchOne) { + }())) == matchAll) || + ((c == matchOne) && (matchOne != U32(0))) { if (c == matchOne) && (Xsqlite3Utf8Read(tls, bp+8 /* &zString */) == U32(0)) { return SQLITE_NOWILDCARDMATCH } @@ -97729,13 +98832,13 @@ func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uint // The sqlite3_strglob() interface. Return 0 on a match (like strcmp()) and // non-zero if there is no match. -func Xsqlite3_strglob(tls *libc.TLS, zGlobPattern uintptr, zString uintptr) int32 { /* sqlite3.c:117862:16: */ +func Xsqlite3_strglob(tls *libc.TLS, zGlobPattern uintptr, zString uintptr) int32 { /* sqlite3.c:119159:16: */ return patternCompare(tls, zGlobPattern, zString, uintptr(unsafe.Pointer(&globInfo)), uint32('[')) } // The sqlite3_strlike() interface. Return 0 on a match and non-zero for // a miss - like strcmp(). -func Xsqlite3_strlike(tls *libc.TLS, zPattern uintptr, zStr uintptr, esc uint32) int32 { /* sqlite3.c:117870:16: */ +func Xsqlite3_strlike(tls *libc.TLS, zPattern uintptr, zStr uintptr, esc uint32) int32 { /* sqlite3.c:119167:16: */ return patternCompare(tls, zPattern, zStr, uintptr(unsafe.Pointer(&likeInfoNorm)), esc) } @@ -97753,7 +98856,7 @@ func Xsqlite3_strlike(tls *libc.TLS, zPattern uintptr, zStr uintptr, esc uint32) // // This same function (with a different compareInfo structure) computes // the GLOB operator. -func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117896:13: */ +func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119193:13: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -97775,8 +98878,8 @@ func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql // of deep recursion and N*N behavior in patternCompare(). nPat = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) - if nPat > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 8*4)) { - Xsqlite3_result_error(tls, context, ts+12678 /* "LIKE or GLOB pat..." */, -1) + if nPat > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 8*4)) { + Xsqlite3_result_error(tls, context, ts+13094 /* "LIKE or GLOB pat..." */, -1) return } if argc == 3 { @@ -97788,7 +98891,7 @@ func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql } if Xsqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp /* zEsc */)), -1) != 1 { Xsqlite3_result_error(tls, context, - ts+12711 /* "ESCAPE expressio..." */, -1) + ts+13127 /* "ESCAPE expressio..." */, -1) return } escape = Xsqlite3Utf8Read(tls, bp /* &zEsc */) @@ -97816,7 +98919,7 @@ func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql // 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 *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:117967:13: */ +func nullifFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:119264:13: */ var pColl uintptr = sqlite3GetFuncCollSeq(tls, context) _ = NotUsed if Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*uintptr)(unsafe.Pointer(argv + 1*8)), pColl) != 0 { @@ -97826,7 +98929,7 @@ func nullifFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { / // Implementation of the sqlite_version() function. The result is the version // of the SQLite library that is running. -func versionFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117983:13: */ +func versionFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:119280:13: */ _ = NotUsed _ = NotUsed2 // IMP: R-48699-48617 This function is an SQL wrapper around the @@ -97837,7 +98940,7 @@ func versionFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr // 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 *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117999:13: */ +func sourceidFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:119296:13: */ _ = NotUsed _ = NotUsed2 // IMP: R-24470-31136 This function is an SQL wrapper around the @@ -97848,19 +98951,19 @@ func sourceidFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintpt // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118015:13: */ +func errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119312:13: */ bp := tls.Alloc(8) defer tls.Free(8) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), ts+2690 /* "%s" */, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), ts+2718 /* "%s" */, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // Implementation of the sqlite_compileoption_used() function. // The result is an integer that identifies if the compiler option // was used to build SQLite. -func compileoptionusedFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118031:13: */ +func compileoptionusedFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119328:13: */ var zOptName uintptr _ = argc @@ -97875,7 +98978,7 @@ func compileoptionusedFunc(tls *libc.TLS, context uintptr, argc int32, argv uint // Implementation of the sqlite_compileoption_get() function. // The result is a string that identifies the compiler options // used to build SQLite. -func compileoptiongetFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118055:13: */ +func compileoptiongetFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119352:13: */ var n int32 _ = argc @@ -97890,14 +98993,14 @@ func compileoptiongetFunc(tls *libc.TLS, context uintptr, argc int32, argv uintp var hexdigits = [16]int8{ int8('0'), int8('1'), int8('2'), int8('3'), int8('4'), int8('5'), int8('6'), int8('7'), int8('8'), int8('9'), int8('A'), int8('B'), int8('C'), int8('D'), int8('E'), int8('F'), -} /* sqlite3.c:118073:19 */ +} /* sqlite3.c:119370:19 */ // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118085:13: */ +func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119382:13: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -97911,10 +99014,10 @@ func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq // var zBuf [50]int8 at bp+16, 50 r1 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))) - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+3875 /* "%!.15g" */, libc.VaList(bp, r1)) - Xsqlite3AtoF(tls, bp+16 /* &zBuf[0] */, bp+72 /* &r2 */, 20, SQLITE_UTF8) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+3903 /* "%!.15g" */, libc.VaList(bp, r1)) + Xsqlite3AtoF(tls, bp+16 /* &zBuf[0] */, bp+72 /* &r2 */, 20, uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp + 72 /* r2 */)) { - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+12756 /* "%!.20e" */, libc.VaList(bp+8, r1)) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+13172 /* "%!.20e" */, libc.VaList(bp+8, r1)) } Xsqlite3_result_text(tls, context, bp+16 /* &zBuf[0] */, -1, libc.UintptrFromInt32(-1)) break @@ -97997,7 +99100,7 @@ func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq // The unicode() function. Return the integer unicode code-point value // for the first character of the input string. -func unicodeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118161:13: */ +func unicodeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119458:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -98011,7 +99114,7 @@ func unicodeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118176:13: */ +func charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119473:13: */ var z uintptr var zOut uintptr var i int32 @@ -98044,12 +99147,12 @@ func charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F)))))) } } - Xsqlite3_result_text64(tls, context, z, (uint64((int64(zOut) - int64(z)) / 1)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})), SQLITE_UTF8) + Xsqlite3_result_text64(tls, context, z, (uint64((int64(zOut) - int64(z)) / 1)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})), uint8(SQLITE_UTF8)) } // The hex() function. Interpret the argument as a blob. Return // a hexadecimal rendering as text. -func hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118217:13: */ +func hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119514:13: */ var i int32 var n int32 var pBlob uintptr @@ -98087,7 +99190,7 @@ func hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli } // The zeroblob(N) function returns a zero-filled blob of size N bytes. -func zeroblobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118245:13: */ +func zeroblobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119542:13: */ var n I64 var rc int32 @@ -98106,7 +99209,7 @@ func zeroblobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118268:13: */ +func replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119565:13: */ var zStr uintptr // The input string A var zPattern uintptr // The pattern string B var zRep uintptr // The replacement string C @@ -98161,7 +99264,7 @@ func replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* if nRep > nPattern { nOut = nOut + (I64(nRep - nPattern)) - if (nOut - int64(1)) > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) { + if (nOut - int64(1)) > I64(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) { Xsqlite3_result_error_toobig(tls, context) Xsqlite3_free(tls, zOut) return @@ -98195,7 +99298,7 @@ func replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118361:13: */ +func trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119658:13: */ var zIn uintptr // Input string var zCharSet uintptr // Set of characters to trim var nIn int32 // Number of bytes in input @@ -98297,8 +99400,8 @@ func trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql Xsqlite3_result_text(tls, context, zIn, nIn, libc.UintptrFromInt32(-1)) } -var lenOne = [1]uint8{uint8(1)} /* sqlite3.c:118383:32 */ -var azOne = [1]uintptr{uintptr(ts + 12763 /* " " */)} /* sqlite3.c:118384:26 */ +var lenOne = [1]uint8{uint8(1)} /* sqlite3.c:119680:32 */ +var azOne = [1]uintptr{uintptr(ts + 9214 /* " " */)} /* sqlite3.c:119681:26 */ // IMP: R-25361-16150 This function is omitted from SQLite by default. It // is only available if the SQLITE_SOUNDEX compile-time option is used @@ -98307,7 +99410,7 @@ var azOne = [1]uintptr{uintptr(ts + 12763 /* " " */)} /* sqlite3.c:118384:26 */ // // IMP: R-59782-00072 The soundex(X) function returns a string that is the // soundex encoding of the string X. -func soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118473:13: */ +func soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119770:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -98345,7 +99448,7 @@ func soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* } else { // IMP: R-64894-50321 The string "?000" is returned if the argument // is NULL or contains no ASCII alphabetic characters. - Xsqlite3_result_text(tls, context, ts+12765 /* "?000" */, 4, uintptr(0)) + Xsqlite3_result_text(tls, context, ts+13179 /* "?000" */, 4, uintptr(0)) } } @@ -98358,10 +99461,10 @@ var iCode = [128]uint8{ uint8(1), uint8(2), uint8(6), uint8(2), uint8(3), uint8(0), uint8(1), uint8(0), uint8(2), uint8(0), uint8(2), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(1), uint8(2), uint8(3), uint8(0), uint8(1), uint8(2), uint8(0), uint8(0), uint8(2), uint8(2), uint8(4), uint8(5), uint8(5), uint8(0), uint8(1), uint8(2), uint8(6), uint8(2), uint8(3), uint8(0), uint8(1), uint8(0), uint8(2), uint8(0), uint8(2), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), -} /* sqlite3.c:118481:30 */ +} /* sqlite3.c:119778:30 */ // A function that loads a shared-library extension then returns NULL. -func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118526:13: */ +func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119823:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -98372,8 +99475,8 @@ func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli // Disallow the load_extension() SQL function unless the SQLITE_LoadExtFunc // flag is set. See the sqlite3_enable_load_extension() API. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, ts+9998 /* "not authorized" */, -1) + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LoadExtFunc)) == uint64(0) { + Xsqlite3_result_error(tls, context, ts+10363 /* "not authorized" */, -1) return } @@ -98397,11 +99500,11 @@ type SumCtx1 = struct { Foverflow U8 Fapprox U8 _ [6]byte -} /* sqlite3.c:118557:9 */ +} /* sqlite3.c:119854:9 */ // An instance of the following structure holds the context of a // sum() or avg() aggregate computation. -type SumCtx = SumCtx1 /* sqlite3.c:118557:23 */ +type SumCtx = SumCtx1 /* sqlite3.c:119854:23 */ // Routines used to compute the sum, average, and total. // @@ -98411,7 +99514,7 @@ type SumCtx = SumCtx1 /* sqlite3.c:118557:23 */ // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118576:13: */ +func sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119873:13: */ var p uintptr var type1 int32 @@ -98433,7 +99536,7 @@ func sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli } } -func sumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118598:13: */ +func sumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119895:13: */ var p uintptr var type1 int32 @@ -98456,12 +99559,12 @@ func sumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s } } -func sumFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118623:13: */ +func sumFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:119920:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, context, 0) if (p != 0) && ((*SumCtx)(unsafe.Pointer(p)).Fcnt > int64(0)) { if (*SumCtx)(unsafe.Pointer(p)).Foverflow != 0 { - Xsqlite3_result_error(tls, context, ts+12656 /* "integer overflow" */, -1) + Xsqlite3_result_error(tls, context, ts+13072 /* "integer overflow" */, -1) } else if (*SumCtx)(unsafe.Pointer(p)).Fapprox != 0 { Xsqlite3_result_double(tls, context, (*SumCtx)(unsafe.Pointer(p)).FrSum) } else { @@ -98470,7 +99573,7 @@ func sumFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118623:13: */ } } -func avgFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118636:13: */ +func avgFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:119933:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, context, 0) if (p != 0) && ((*SumCtx)(unsafe.Pointer(p)).Fcnt > int64(0)) { @@ -98478,7 +99581,7 @@ func avgFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118636:13: */ } } -func totalFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118643:13: */ +func totalFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:119940:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, context, 0) // (double)0 In case of SQLITE_OMIT_FLOATING_POINT... @@ -98492,14 +99595,14 @@ func totalFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118643:13: */ // The following structure keeps track of state information for the // count() aggregate function. -type CountCtx1 = struct{ Fn I64 } /* sqlite3.c:118654:9 */ +type CountCtx1 = struct{ Fn I64 } /* sqlite3.c:119951:9 */ // The following structure keeps track of state information for the // count() aggregate function. -type CountCtx = CountCtx1 /* sqlite3.c:118654:25 */ +type CountCtx = CountCtx1 /* sqlite3.c:119951:25 */ // Routines to implement the count() aggregate function. -func countStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118665:13: */ +func countStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119962:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(CountCtx{}))) if ((argc == 0) || (SQLITE_NULL != Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))))) && (p != 0) { @@ -98513,7 +99616,7 @@ func countStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq } -func countFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118681:13: */ +func countFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:119978:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, context, 0) Xsqlite3_result_int64(tls, context, func() int64 { @@ -98524,7 +99627,7 @@ func countFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118681:13: */ }()) } -func countInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:118687:13: */ +func countInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:119984:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(CountCtx{}))) // p is always non-NULL since countStep() will have been called first @@ -98534,7 +99637,7 @@ func countInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sql } // Routines to implement min() and max() aggregate functions. -func minmaxStep(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:118705:13: */ +func minmaxStep(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:120002:13: */ var pArg uintptr = *(*uintptr)(unsafe.Pointer(argv)) var pBest uintptr _ = NotUsed @@ -98572,7 +99675,7 @@ func minmaxStep(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { / } } -func minMaxValueFinalize(tls *libc.TLS, context uintptr, bValue int32) { /* sqlite3.c:118743:13: */ +func minMaxValueFinalize(tls *libc.TLS, context uintptr, bValue int32) { /* sqlite3.c:120040:13: */ var pRes uintptr pRes = Xsqlite3_aggregate_context(tls, context, 0) if pRes != 0 { @@ -98585,16 +99688,16 @@ func minMaxValueFinalize(tls *libc.TLS, context uintptr, bValue int32) { /* sqli } } -func minMaxValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:118754:13: */ +func minMaxValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:120051:13: */ minMaxValueFinalize(tls, context, 1) } -func minMaxFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118760:13: */ +func minMaxFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:120057:13: */ minMaxValueFinalize(tls, context, 0) } // group_concat(EXPR, ?SEPARATOR?) -func groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118767:13: */ +func groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120064:13: */ var zVal uintptr var pAccum uintptr var zSep uintptr @@ -98609,13 +99712,13 @@ func groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if pAccum != 0 { var db uintptr = Xsqlite3_context_db_handle(tls, context) var firstTerm int32 = (libc.Bool32((*StrAccum)(unsafe.Pointer(pAccum)).FmxAlloc == U32(0))) - (*StrAccum)(unsafe.Pointer(pAccum)).FmxAlloc = U32(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) + (*StrAccum)(unsafe.Pointer(pAccum)).FmxAlloc = U32(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) if !(firstTerm != 0) { if argc == 2 { zSep = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) nSep = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) } else { - zSep = ts + 10660 /* "," */ + zSep = ts + 11076 /* "," */ nSep = 1 } if zSep != 0 { @@ -98630,7 +99733,7 @@ func groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } -func groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118800:13: */ +func groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120097:13: */ var n int32 var pAccum uintptr @@ -98659,7 +99762,7 @@ func groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr } } -func groupConcatFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118831:13: */ +func groupConcatFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:120128:13: */ var pAccum uintptr pAccum = Xsqlite3_aggregate_context(tls, context, 0) if pAccum != 0 { @@ -98674,7 +99777,7 @@ func groupConcatFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118831:1 } } -func groupConcatValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:118846:13: */ +func groupConcatValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:120143:13: */ var pAccum uintptr pAccum = Xsqlite3_aggregate_context(tls, context, 0) if pAccum != 0 { @@ -98692,8 +99795,8 @@ func groupConcatValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:118846: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 Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { /* sqlite3.c:118869:21: */ - var rc int32 = Xsqlite3_overload_function(tls, db, ts+12770 /* "MATCH" */, 2) +func Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { /* sqlite3.c:120166:21: */ + var rc int32 = Xsqlite3_overload_function(tls, db, ts+13184 /* "MATCH" */, 2) if rc == SQLITE_NOMEM { Xsqlite3OomFault(tls, db) @@ -98703,7 +99806,7 @@ func Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { // Re-register the built-in LIKE functions. The caseSensitive // parameter determines whether or not the LIKE operator is case // sensitive. -func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int32) { /* sqlite3.c:118882:21: */ +func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int32) { /* sqlite3.c:120179:21: */ var pInfo uintptr var flags int32 if caseSensitive != 0 { @@ -98713,14 +99816,14 @@ func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 pInfo = uintptr(unsafe.Pointer(&likeInfoNorm)) flags = SQLITE_FUNC_LIKE } - Xsqlite3CreateFunc(tls, db, ts+12776 /* "like" */, 2, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct { + Xsqlite3CreateFunc(tls, db, ts+13190 /* "like" */, 2, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{likeFunc})), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3CreateFunc(tls, db, ts+12776 /* "like" */, 3, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct { + Xsqlite3CreateFunc(tls, db, ts+13190 /* "like" */, 3, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{likeFunc})), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+12776 /* "like" */, 2, SQLITE_UTF8, uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) - *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+12776 /* "like" */, 3, SQLITE_UTF8, uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) + *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+13190 /* "like" */, 2, uint8(SQLITE_UTF8), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) + *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+13190 /* "like" */, 3, uint8(SQLITE_UTF8), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) } // pExpr points to an expression which implements a function. If @@ -98738,16 +99841,17 @@ func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 // 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 Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase uintptr, aWc uintptr) int32 { /* sqlite3.c:118915:20: */ +func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase uintptr, aWc uintptr) int32 { /* sqlite3.c:120212:20: */ var pDef uintptr var nExpr int32 - if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_FUNCTION) || !(int32(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0) { + + if !(int32(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0) { return 0 } nExpr = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FnExpr - pDef = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), nExpr, SQLITE_UTF8, uint8(0)) - if (pDef == uintptr(0)) || (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_LIKE) == U32(0)) { + pDef = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), nExpr, uint8(SQLITE_UTF8), uint8(0)) + if (pDef == uintptr(0)) || (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_LIKE)) == U32(0)) { return 0 } @@ -98777,16 +99881,44 @@ func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase *(*int8)(unsafe.Pointer(aWc + 3)) = *(*int8)(unsafe.Pointer(zEscape)) } - *(*int32)(unsafe.Pointer(pIsNocase)) = (libc.Bool32(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_CASE) == U32(0))) + *(*int32)(unsafe.Pointer(pIsNocase)) = (libc.Bool32(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_CASE)) == U32(0))) return 1 } +// Mathematical Constants + +// Extra math functions that require linking with -lm + +// Implementation of sign(X) function. +func signFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120438:13: */ + var type0 int32 + var x float64 + _ = argc + + type0 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv))) + if (type0 != SQLITE_INTEGER) && (type0 != SQLITE_FLOAT) { + return + } + x = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))) + Xsqlite3_result_int(tls, context, func() int32 { + if x < 0.0 { + return -1 + } + return func() int32 { + if x > 0.0 { + return +1 + } + return 0 + }() + }()) +} + // 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 Xsqlite3RegisterBuiltinFunctions(tls *libc.TLS) { /* sqlite3.c:118964:21: */ +func Xsqlite3RegisterBuiltinFunctions(tls *libc.TLS) { /* sqlite3.c:120460:21: */ Xsqlite3AlterFunctions(tls) Xsqlite3WindowFunctions(tls) Xsqlite3RegisterDateTimeFunctions(tls) @@ -98794,75 +99926,78 @@ func Xsqlite3RegisterBuiltinFunctions(tls *libc.TLS) { /* sqlite3.c:118964:21: * } -var aBuiltinFunc = [65]FuncDef{ +var aBuiltinFunc = [68]FuncDef{ //**** Functions only available with SQLITE_TESTCTRL_INTERNAL_FUNCTIONS **** - {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_implies_nonnull_row), FxSFunc: 0, FzName: ts + 12781 /* "implies_nonnull_..." */}, - {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_expr_compare), FxSFunc: 0, FzName: ts + 12801 /* "expr_compare" */}, - {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_expr_implies_expr), FxSFunc: 0, FzName: ts + 12814 /* "expr_implies_exp..." */}, + {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_implies_nonnull_row)), FxSFunc: 0, FzName: ts + 13195 /* "implies_nonnull_..." */}, + {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_expr_compare)), FxSFunc: 0, FzName: ts + 13215 /* "expr_compare" */}, + {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_expr_implies_expr)), FxSFunc: 0, FzName: ts + 13228 /* "expr_implies_exp..." */}, //**** Regular functions **** - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 12832 /* "soundex" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 12840 /* "load_extension" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 12840 /* "load_extension" */}, - {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 12855 /* "sqlite_compileop..." */}, - {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 12881 /* "sqlite_compileop..." */}, - {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 12906 /* "unlikely" */}, - {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 12915 /* "likelihood" */}, - {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 12926 /* "likely" */}, - {FnArg: int8(1), FfuncFlags: (U32((((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_OFFSET) | SQLITE_FUNC_TYPEOF)), FxSFunc: 0, FzName: ts + 12933 /* "sqlite_offset" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 12947 /* "ltrim" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 12947 /* "ltrim" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(2)), FxSFunc: 0, FzName: ts + 12953 /* "rtrim" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(2)), FxSFunc: 0, FzName: ts + 12953 /* "rtrim" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(3)), FxSFunc: 0, FzName: ts + 12959 /* "trim" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(3)), FxSFunc: 0, FzName: ts + 12959 /* "trim" */}, - {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 12964 /* "min" */}, - {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 12964 /* "min" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (1 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_MINMAX)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 12964 /* "min" */}, - {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 12968 /* "max" */}, - {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FzName: ts + 12968 /* "max" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (1 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_MINMAX)), FpUserData: uintptr(int64(1)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 12968 /* "max" */}, - {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_TYPEOF)), FxSFunc: 0, FzName: ts + 12972 /* "typeof" */}, - {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_LENGTH)), FxSFunc: 0, FzName: ts + 12979 /* "length" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 12986 /* "instr" */}, - {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 12992 /* "printf" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 12999 /* "unicode" */}, - {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13007 /* "char" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13012 /* "abs" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13016 /* "round" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13016 /* "round" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13022 /* "upper" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13028 /* "lower" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13034 /* "hex" */}, - {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FxSFunc: 0, FzName: ts + 13038 /* "ifnull" */}, - {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13045 /* "random" */}, - {FnArg: int8(1), FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13052 /* "randomblob" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13063 /* "nullif" */}, - {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 13070 /* "sqlite_version" */}, - {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 13085 /* "sqlite_source_id" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13102 /* "sqlite_log" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13113 /* "quote" */}, - {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13119 /* "last_insert_rowi..." */}, - {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13137 /* "changes" */}, - {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13145 /* "total_changes" */}, - {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13159 /* "replace" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13167 /* "zeroblob" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13176 /* "substr" */}, - {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13176 /* "substr" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13183 /* "sum" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13187 /* "total" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13193 /* "avg" */}, - {FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_COUNT)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13197 /* "count" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13197 /* "count" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13203 /* "group_concat" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13203 /* "group_concat" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13246 /* "soundex" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 13254 /* "load_extension" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 13254 /* "load_extension" */}, + {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 13269 /* "sqlite_compileop..." */}, + {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 13295 /* "sqlite_compileop..." */}, + {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 13320 /* "unlikely" */}, + {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 13329 /* "likelihood" */}, + {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 13340 /* "likely" */}, + {FnArg: int8(1), FfuncFlags: (U32((((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_OFFSET) | SQLITE_FUNC_TYPEOF)), FxSFunc: 0, FzName: ts + 13347 /* "sqlite_offset" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 13361 /* "ltrim" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 13361 /* "ltrim" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(2)), FxSFunc: 0, FzName: ts + 13367 /* "rtrim" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(2)), FxSFunc: 0, FzName: ts + 13367 /* "rtrim" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(3)), FxSFunc: 0, FzName: ts + 13373 /* "trim" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(3)), FxSFunc: 0, FzName: ts + 13373 /* "trim" */}, + {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13378 /* "min" */}, + {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 13378 /* "min" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (1 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_MINMAX)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 13378 /* "min" */}, + {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 13382 /* "max" */}, + {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FzName: ts + 13382 /* "max" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (1 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_MINMAX)), FpUserData: uintptr(int64(1)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 13382 /* "max" */}, + {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_TYPEOF)), FxSFunc: 0, FzName: ts + 13386 /* "typeof" */}, + {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_LENGTH)), FxSFunc: 0, FzName: ts + 13393 /* "length" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13400 /* "instr" */}, + {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13406 /* "printf" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13413 /* "unicode" */}, + {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13421 /* "char" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13426 /* "abs" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13430 /* "round" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13430 /* "round" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13436 /* "upper" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13442 /* "lower" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13448 /* "hex" */}, + {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FxSFunc: 0, FzName: ts + 13452 /* "ifnull" */}, + {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13459 /* "random" */}, + {FnArg: int8(1), FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13466 /* "randomblob" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13477 /* "nullif" */}, + {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 13484 /* "sqlite_version" */}, + {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 13499 /* "sqlite_source_id" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13516 /* "sqlite_log" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13527 /* "quote" */}, + {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13533 /* "last_insert_rowi..." */}, + {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13551 /* "changes" */}, + {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13559 /* "total_changes" */}, + {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13573 /* "replace" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13581 /* "zeroblob" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13590 /* "substr" */}, + {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13590 /* "substr" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13597 /* "substring" */}, + {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13597 /* "substring" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13607 /* "sum" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13611 /* "total" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13617 /* "avg" */}, + {FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_COUNT)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13621 /* "count" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13621 /* "count" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13627 /* "group_concat" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13627 /* "group_concat" */}, - {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE) | SQLITE_FUNC_CASE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 13216 /* "glob" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 12776 /* "like" */}, - {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 12776 /* "like" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 13221 /* "coalesce" */}, - {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 13221 /* "coalesce" */}, - {FnArg: int8(-1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FxSFunc: 0, FzName: ts + 13221 /* "coalesce" */}, - {FnArg: int8(3), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_iif), FxSFunc: 0, FzName: ts + 13230 /* "iif" */}} /* sqlite3.c:118975:18 */ + {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE) | SQLITE_FUNC_CASE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 13640 /* "glob" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 13190 /* "like" */}, + {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 13190 /* "like" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 13645 /* "coalesce" */}, + {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 13645 /* "coalesce" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 13654 /* "sign" */}, + {FnArg: int8(-1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FxSFunc: 0, FzName: ts + 13645 /* "coalesce" */}, + {FnArg: int8(3), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_iif)), FxSFunc: 0, FzName: ts + 13659 /* "iif" */}} /* sqlite3.c:120471:18 */ //************* End of func.c *********************************************** //************* Begin file fkey.c ******************************************* @@ -99037,7 +100172,7 @@ var aBuiltinFunc = [65]FuncDef{ // 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 Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey uintptr, ppIdx uintptr, paiCol uintptr) int32 { /* sqlite3.c:119284:20: */ +func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey uintptr, ppIdx uintptr, paiCol uintptr) int32 { /* sqlite3.c:120819:20: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -99148,7 +100283,7 @@ func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey if !(pIdx != 0) { if !(int32((*Parse)(unsafe.Pointer(pParse)).FdisableTriggers) != 0) { Xsqlite3ErrorMsg(tls, pParse, - ts+13234, /* "foreign key mism..." */ + ts+13663, /* "foreign key mism..." */ libc.VaList(bp, (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*FKey)(unsafe.Pointer(pFKey)).FzTo)) } Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, aiCol) @@ -99183,7 +100318,7 @@ func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey // // These operations are identified in the comment at the top of this file // (fkey.c) as "I.1" and "D.1". -func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32, isIgnore int32) { /* sqlite3.c:119419:13: */ +func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32, isIgnore int32) { /* sqlite3.c:120954:13: */ var i int32 // Iterator variable var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Vdbe to add code to var iCur int32 = ((*Parse)(unsafe.Pointer(pParse)).FnTab - 1) // Cursor number to use @@ -99227,7 +100362,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx // increment the constraint-counter. if (pTab == (*FKey)(unsafe.Pointer(pFKey)).FpFrom) && (nIncr == 1) { Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regData, iOk, regTemp) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } Xsqlite3OpenTable(tls, pParse, iCur, iDb, pTab, OP_OpenRead) @@ -99272,7 +100407,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx iParent = regData } Xsqlite3VdbeAddOp3(tls, v, OP_Ne, iChild, iJump, iParent) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_JUMPIFNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_JUMPIFNULL)) } Xsqlite3VdbeGoto(tls, v, iOk) } @@ -99286,7 +100421,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx } } - if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_DeferFKs) != 0)) && + if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_DeferFKs)) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite) != 0) { // Special case: If this is an INSERT statement that will insert exactly @@ -99295,7 +100430,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx // generated for will not open a statement transaction. Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(3) << 8)), - OE_Abort, uintptr(0), int8(-1), P5_ConstraintFK) + OE_Abort, uintptr(0), int8(-1), uint8(P5_ConstraintFK)) } else { if (nIncr > 0) && (int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) == 0) { Xsqlite3MayAbort(tls, pParse) @@ -99313,7 +100448,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx // 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 *libc.TLS, pParse uintptr, pTab uintptr, regBase int32, iCol I16) uintptr { /* sqlite3.c:119572:13: */ +func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int32, iCol I16) uintptr { /* sqlite3.c:121107:13: */ var pExpr uintptr var pCol uintptr var zColl uintptr @@ -99332,7 +100467,7 @@ func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int3 pExpr = Xsqlite3ExprAddCollateString(tls, pParse, pExpr, zColl) } else { (*Expr)(unsafe.Pointer(pExpr)).FiTable = regBase - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) } } return pExpr @@ -99340,7 +100475,7 @@ func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int3 // Return an Expr object that refers to column iCol of table pTab which // has cursor iCur. -func exprTableColumn(tls *libc.TLS, db uintptr, pTab uintptr, iCursor int32, iCol I16) uintptr { /* sqlite3.c:119604:13: */ +func exprTableColumn(tls *libc.TLS, db uintptr, pTab uintptr, iCursor int32, iCol I16) uintptr { /* sqlite3.c:121139:13: */ var pExpr uintptr = Xsqlite3Expr(tls, db, TK_COLUMN, uintptr(0)) if pExpr != 0 { *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = pTab @@ -99380,7 +100515,7 @@ func exprTableColumn(tls *libc.TLS, db uintptr, pTab uintptr, iCursor int32, iCo // // These operations are identified in the comment at the top of this file // (fkey.c) as "I.2" and "D.2". -func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32) { /* sqlite3.c:119651:13: */ +func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32) { /* sqlite3.c:121186:13: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -99447,9 +100582,9 @@ func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, p var pNe uintptr // Expression (pLeft != pRight) var pLeft uintptr // Value from parent table row var pRight uintptr // Column ref to child table - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pLeft = exprTableRegister(tls, pParse, pTab, regData, int16(-1)) - pRight = exprTableColumn(tls, db, pTab, (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor, int16(-1)) + pRight = exprTableColumn(tls, db, pTab, (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor, int16(-1)) pNe = Xsqlite3PExpr(tls, pParse, TK_NE, pLeft, pRight) } else { var pEq uintptr @@ -99504,7 +100639,7 @@ func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, p // "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 Xsqlite3FkReferences(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:119780:21: */ +func Xsqlite3FkReferences(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:121315:21: */ return Xsqlite3HashFind(tls, ((*Table)(unsafe.Pointer(pTab)).FpSchema + 80 /* &.fkeyHash */), (*Table)(unsafe.Pointer(pTab)).FzName) } @@ -99514,7 +100649,7 @@ func Xsqlite3FkReferences(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:11 // // The Trigger structure or any of its sub-components may be allocated from // the lookaside buffer belonging to database handle dbMem. -func fkTriggerDelete(tls *libc.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:119792:13: */ +func fkTriggerDelete(tls *libc.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:121327:13: */ if p != 0 { var pStep uintptr = (*Trigger)(unsafe.Pointer(p)).Fstep_list Xsqlite3ExprDelete(tls, dbMem, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere) @@ -99540,9 +100675,9 @@ func fkTriggerDelete(tls *libc.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:119 // 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 Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uintptr) { /* sqlite3.c:119820:21: */ +func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uintptr) { /* sqlite3.c:121355:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { + if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { var iSkip int32 = 0 var v uintptr = Xsqlite3GetVdbe(tls, pParse) @@ -99556,7 +100691,7 @@ func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint // when this statement is run. var p uintptr for p = (*Table)(unsafe.Pointer(pTab)).FpFKey; p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom { - if ((*FKey)(unsafe.Pointer(p)).FisDeferred != 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0) { + if ((*FKey)(unsafe.Pointer(p)).FisDeferred != 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) { break } } @@ -99579,12 +100714,12 @@ func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint // If the SQLITE_DeferFKs flag is set, then this is not required, as // the statement transaction will not be rolled back even if FK // constraints are violated. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) == uint64(0) { Xsqlite3VdbeAddOp2(tls, v, OP_FkIfZero, 0, (Xsqlite3VdbeCurrentAddr(tls, v) + 2)) Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(3) << 8)), - OE_Abort, uintptr(0), int8(-1), P5_ConstraintFK) + OE_Abort, uintptr(0), int8(-1), uint8(P5_ConstraintFK)) } if iSkip != 0 { @@ -99603,7 +100738,7 @@ func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint // // 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 *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:119883:12: */ +func fkChildIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:121418:12: */ var i int32 for i = 0; i < (*FKey)(unsafe.Pointer(p)).FnCol; i++ { var iChildKey int32 = (*sColMap)(unsafe.Pointer((p + 64 /* &.aCol */) + uintptr(i)*16)).FiFrom @@ -99627,7 +100762,7 @@ func fkChildIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, // // 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 *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:119910:12: */ +func fkParentIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:121445:12: */ var i int32 for i = 0; i < (*FKey)(unsafe.Pointer(p)).FnCol; i++ { var zKey uintptr = (*sColMap)(unsafe.Pointer((p + 64 /* &.aCol */) + uintptr(i)*16)).FzCol @@ -99651,7 +100786,7 @@ func fkParentIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, // 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 *libc.TLS, pParse uintptr, pFKey uintptr) int32 { /* sqlite3.c:119939:12: */ +func isSetNullAction(tls *libc.TLS, pParse uintptr, pFKey uintptr) int32 { /* sqlite3.c:121474:12: */ var pTop uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -99686,7 +100821,7 @@ func isSetNullAction(tls *libc.TLS, pParse uintptr, pFKey uintptr) int32 { /* sq // 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 Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, regNew int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:119972:21: */ +func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, regNew int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:121507:21: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -99699,7 +100834,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, // Exactly one of regOld and regNew should be non-zero. // If foreign-keys are disabled, this function is a no-op. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) == uint64(0) { return } @@ -99824,7 +100959,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, continue } - if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0)) && + if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite) != 0) { // Inserting a single row into a parent table cannot cause (or fix) @@ -99844,10 +100979,10 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, pSrc = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) if pSrc != 0 { var pItem uintptr = pSrc + 8 /* &.a */ - (*SrcList_item)(unsafe.Pointer(pItem)).FpTab = (*FKey)(unsafe.Pointer(pFKey)).FpFrom - (*SrcList_item)(unsafe.Pointer(pItem)).FzName = (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName - (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpTab)).FnTabRef++ - (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + (*SrcItem)(unsafe.Pointer(pItem)).FpTab = (*FKey)(unsafe.Pointer(pFKey)).FpFrom + (*SrcItem)(unsafe.Pointer(pItem)).FzName = (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName + (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FnTabRef++ + (*SrcItem)(unsafe.Pointer(pItem)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) if regNew != 0 { fkScanChildren(tls, pParse, pSrc, pTab, *(*uintptr)(unsafe.Pointer(bp + 24 /* pIdx */)), pFKey, *(*uintptr)(unsafe.Pointer(bp + 32 /* aiCol */)), regNew, -1) @@ -99876,7 +101011,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, Xsqlite3MayAbort(tls, pParse) } } - (*SrcList_item)(unsafe.Pointer(pItem)).FzName = uintptr(0) + (*SrcItem)(unsafe.Pointer(pItem)).FzName = uintptr(0) Xsqlite3SrcListDelete(tls, db, pSrc) } Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 32 /* aiCol */))) @@ -99885,12 +101020,12 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, // This function is called before generating code to update or delete a // row contained in table pTab. -func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sqlite3.c:120174:20: */ +func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sqlite3.c:121709:20: */ bp := tls.Alloc(8) defer tls.Free(8) var mask U32 = U32(0) - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_ForeignKeys) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 { var p uintptr var i int32 for p = (*Table)(unsafe.Pointer(pTab)).FpFKey; p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom { @@ -99937,19 +101072,22 @@ func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sql // // For an UPDATE, this function returns 2 if: // -// * There are any FKs for which pTab is the child and the parent table, or +// * There are any FKs for which pTab is the child and the parent table +// and any FK processing at all is required (even of a different FK), 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 Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uintptr, chngRowid int32) int32 { /* sqlite3.c:120222:20: */ - var eRet int32 = 0 - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_ForeignKeys) != 0 { +func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uintptr, chngRowid int32) int32 { /* sqlite3.c:121759:20: */ + var eRet int32 = 1 // Value to return if bHaveFK is true + var bHaveFK int32 = 0 // If FK processing is required + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 { if !(aChange != 0) { // A DELETE operation. Foreign key processing is required if the // table in question is either the child or parent table for any // foreign key constraint. - eRet = (libc.Bool32((Xsqlite3FkReferences(tls, pTab) != 0) || ((*Table)(unsafe.Pointer(pTab)).FpFKey != 0))) + bHaveFK = (libc.Bool32((Xsqlite3FkReferences(tls, pTab) != 0) || ((*Table)(unsafe.Pointer(pTab)).FpFKey != 0))) } else { // This is an UPDATE. Foreign key processing is only required if the // operation modifies one or more child or parent key columns. @@ -99957,11 +101095,11 @@ func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uin // Check if any child key columns are being modified. for p = (*Table)(unsafe.Pointer(pTab)).FpFKey; p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom { - if 0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, (*FKey)(unsafe.Pointer(p)).FzTo) { - return 2 - } if fkChildIsModified(tls, pTab, p, aChange, chngRowid) != 0 { - eRet = 1 + if 0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, (*FKey)(unsafe.Pointer(p)).FzTo) { + eRet = 2 + } + bHaveFK = 1 } } @@ -99971,12 +101109,15 @@ func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uin if int32(*(*U8)(unsafe.Pointer((p + 45 /* &.aAction */) + 1))) != OE_None { return 2 } - eRet = 1 + bHaveFK = 1 } } } } - return eRet + if bHaveFK != 0 { + return eRet + } + return 0 } // This function is called when an UPDATE or DELETE operation is being @@ -100006,7 +101147,7 @@ func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uin // 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 *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, pChanges uintptr) uintptr { /* sqlite3.c:120289:16: */ +func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, pChanges uintptr) uintptr { /* sqlite3.c:121827:16: */ bp := tls.Alloc(96) defer tls.Free(96) @@ -100016,7 +101157,7 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, var iAction int32 = (libc.Bool32(pChanges != uintptr(0))) // 1 for UPDATE, 0 for DELETE action = int32(*(*U8)(unsafe.Pointer((pFKey + 45 /* &.aAction */) + uintptr(iAction)))) - if (action == OE_Restrict) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0) { + if (action == OE_Restrict) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) { return uintptr(0) } pTrigger = *(*uintptr)(unsafe.Pointer((pFKey + 48 /* &.apTrigger */) + uintptr(iAction)*8)) @@ -100038,8 +101179,8 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, } for i = 0; i < (*FKey)(unsafe.Pointer(pFKey)).FnCol; i++ { - *(*Token)(unsafe.Pointer(bp + 48 /* tOld */)) = Token{Fz: ts + 5291 /* "old" */, Fn: uint32(3)} // Literal "old" token - *(*Token)(unsafe.Pointer(bp + 64 /* tNew */)) = Token{Fz: ts + 5287 /* "new" */, Fn: uint32(3)} // Literal "new" token + *(*Token)(unsafe.Pointer(bp + 48 /* tOld */)) = Token{Fz: ts + 5336 /* "old" */, Fn: uint32(3)} // Literal "old" token + *(*Token)(unsafe.Pointer(bp + 64 /* tNew */)) = Token{Fz: ts + 5332 /* "new" */, Fn: uint32(3)} // Literal "new" token // var tFromCol Token at bp+32, 16 // Name of column in child table // var tToCol Token at bp+16, 16 @@ -100127,9 +101268,9 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, (*Token)(unsafe.Pointer(bp + 80 /* &tFrom */)).Fz = zFrom (*Token)(unsafe.Pointer(bp + 80 /* &tFrom */)).Fn = uint32(nFrom) - pRaise = Xsqlite3Expr(tls, db, TK_RAISE, ts+4091 /* "FOREIGN KEY cons..." */) + pRaise = Xsqlite3Expr(tls, db, TK_RAISE, ts+4119 /* "FOREIGN KEY cons..." */) if pRaise != 0 { - (*Expr)(unsafe.Pointer(pRaise)).FaffExpr = OE_Abort + (*Expr)(unsafe.Pointer(pRaise)).FaffExpr = int8(OE_Abort) } pSelect = Xsqlite3SelectNew(tls, pParse, Xsqlite3ExprListAppend(tls, pParse, uintptr(0), pRaise), @@ -100179,17 +101320,17 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, switch action { case OE_Restrict: - (*TriggerStep)(unsafe.Pointer(pStep)).Fop = TK_SELECT + (*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_SELECT) break fallthrough case OE_Cascade: if !(pChanges != 0) { - (*TriggerStep)(unsafe.Pointer(pStep)).Fop = TK_DELETE + (*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_DELETE) break } fallthrough default: - (*TriggerStep)(unsafe.Pointer(pStep)).Fop = TK_UPDATE + (*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_UPDATE) } (*TriggerStep)(unsafe.Pointer(pStep)).FpTrig = pTrigger (*Trigger)(unsafe.Pointer(pTrigger)).FpSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema @@ -100197,9 +101338,9 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, *(*uintptr)(unsafe.Pointer((pFKey + 48 /* &.apTrigger */) + uintptr(iAction)*8)) = pTrigger (*Trigger)(unsafe.Pointer(pTrigger)).Fop = func() uint8 { if pChanges != 0 { - return TK_UPDATE + return uint8(TK_UPDATE) } - return TK_DELETE + return uint8(TK_DELETE) }() } @@ -100208,12 +101349,12 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, // This function is called when deleting or updating a row to implement // any required CASCADE, SET NULL or SET DEFAULT actions. -func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uintptr, regOld int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:120481:21: */ +func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uintptr, regOld int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:122019:21: */ // If foreign-key support is enabled, iterate through all FKs that // refer to table pTab. If there is an action associated with the FK // for this operation (either update or delete), invoke the associated // trigger sub-program. - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_ForeignKeys) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 { var pFKey uintptr // Iterator variable for pFKey = Xsqlite3FkReferences(tls, pTab); pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextTo { if (aChange == uintptr(0)) || (fkParentIsModified(tls, pTab, pFKey, aChange, bChngRowid) != 0) { @@ -100229,7 +101370,7 @@ func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uin // Free all memory associated with foreign key definitions attached to // table pTab. Remove the deleted foreign keys from the Schema.fkeyHash // hash table. -func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:120513:21: */ +func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:122051:21: */ var pFKey uintptr // Iterator variable var pNext uintptr // Copy of pFKey->pNextFrom @@ -100289,10 +101430,10 @@ func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:12 // // If pTab is a WITHOUT ROWID table, then it is the PRIMARY KEY index // for that table that is actually opened. -func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTab uintptr, opcode int32) { /* sqlite3.c:120579:21: */ +func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTab uintptr, opcode int32) { /* sqlite3.c:122117:21: */ var v uintptr - v = Xsqlite3GetVdbe(tls, pParse) + v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, func() uint8 { @@ -100301,7 +101442,7 @@ func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTa } return uint8(0) }(), (*Table)(unsafe.Pointer(pTab)).FzName) - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp4Int(tls, v, opcode, iCur, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol)) } else { @@ -100331,7 +101472,7 @@ func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTa // 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 Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr { /* sqlite3.c:120625:27: */ +func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr { /* sqlite3.c:122164:27: */ if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) { // The first time a column affinity string for a particular index is // required, it is allocated and populated here. It is then stored as @@ -100353,16 +101494,16 @@ func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr { if int32(x) >= 0 { aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(x)*32)).Faffinity } else if int32(x) == (-1) { - aff = SQLITE_AFF_INTEGER + aff = int8(SQLITE_AFF_INTEGER) } else { aff = Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8 /* &.a */)+uintptr(n)*32)).FpExpr) } if int32(aff) < SQLITE_AFF_BLOB { - aff = SQLITE_AFF_BLOB + aff = int8(SQLITE_AFF_BLOB) } if int32(aff) > SQLITE_AFF_NUMERIC { - aff = SQLITE_AFF_NUMERIC + aff = int8(SQLITE_AFF_NUMERIC) } *(*int8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FzColAff + uintptr(n))) = aff } @@ -100390,7 +101531,7 @@ func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr { // 'C' NUMERIC // 'D' INTEGER // 'E' REAL -func Xsqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) { /* sqlite3.c:120684:21: */ +func Xsqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) { /* sqlite3.c:122223:21: */ var i int32 var j int32 var zColAff uintptr = (*Table)(unsafe.Pointer(pTab)).FzColAff @@ -100428,7 +101569,7 @@ func Xsqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) { // 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 *libc.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:120723:12: */ +func readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:122262:12: */ var v uintptr = Xsqlite3GetVdbe(tls, p) var i int32 var iEnd int32 = Xsqlite3VdbeCurrentAddr(tls, v) @@ -100464,7 +101605,7 @@ func readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sq // This walker callback will compute the union of colFlags flags for all // referenced columns in a CHECK constraint or generated column expression. -func exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:120760:12: */ +func exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:122299:12: */ if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && (int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0) { *(*U16)(unsafe.Pointer(pWalker + 36 /* &.eCode */)) |= U16((int32((*Column)(unsafe.Pointer((*Table1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FaCol + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*32)).FcolFlags))) @@ -100477,7 +101618,7 @@ func exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { // or VIRTUAL columns have not yet been initialized. This routine goes // back and computes the values for those columns based on the previously // computed normal columns. -func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore int32, pTab uintptr) { /* sqlite3.c:120776:21: */ +func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore int32, pTab uintptr) { /* sqlite3.c:122315:21: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -100491,7 +101632,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in // Before computing generated columns, first go through and make sure // that appropriate affinity has been applied to the regular columns Xsqlite3TableAffinity(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iRegStore) - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasStored) != U32(0)) && + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasStored)) != U32(0)) && (int32((*VdbeOp)(unsafe.Pointer((libc.AssignUintptr(&pOp, Xsqlite3VdbeGetOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, -1))))).Fopcode) == OP_Affinity) { // Change the OP_Affinity argument to '@' (NONE) for all stored // columns. '@' is the no-op affinity and those columns have not @@ -100505,7 +101646,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in continue } if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(ii)*32)).FcolFlags) & COLFLAG_STORED) != 0 { - *(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) = SQLITE_AFF_NONE + *(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) = int8(SQLITE_AFF_NONE) } jj++ } @@ -100557,7 +101698,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+6768 /* "generated column..." */, libc.VaList(bp, (*Column)(unsafe.Pointer(pRedo)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+6813 /* "generated column..." */, libc.VaList(bp, (*Column)(unsafe.Pointer(pRedo)).FzName)) } (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -100583,11 +101724,11 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in // // The 2nd register is the one that is returned. That is all the // insert routine needs to know about. -func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:120894:12: */ +func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:122433:12: */ var memId int32 = 0 // Register holding maximum rowid - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Autoincrement) != U32(0)) && - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & DBFLAG_Vacuum) == U32(0)) { + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != U32(0)) && + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0)) { var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -100601,7 +101742,7 @@ func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 // rowid table with exactly two columns. // Ticket d8dc2b3a58cd5dc2918a1d4acb 2018-05-23 if (((pSeqTab == uintptr(0)) || - !(((*Table)(unsafe.Pointer((pSeqTab))).FtabFlags & TF_WithoutRowid) == U32(0))) || + !(((*Table)(unsafe.Pointer((pSeqTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) || ((*Table)(unsafe.Pointer(pSeqTab)).FnModuleArg != 0)) || (int32((*Table)(unsafe.Pointer(pSeqTab)).FnCol) != 2) { (*Parse)(unsafe.Pointer(pParse)).FnErr++ @@ -100615,7 +101756,11 @@ func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 } if pInfo == uintptr(0) { pInfo = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(AutoincInfo{}))) - if pInfo == uintptr(0) { + Xsqlite3ParserAddCleanup(tls, pToplevel, *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{Xsqlite3DbFree})), pInfo) + + if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return 0 } (*AutoincInfo)(unsafe.Pointer(pInfo)).FpNext = (*Parse)(unsafe.Pointer(pToplevel)).FpAinc @@ -100633,7 +101778,7 @@ func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 // This routine generates code that will initialize all of the // register used by the autoincrement tracker. -func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:120943:21: */ +func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:122484:21: */ var p uintptr // Information about an AUTOINCREMENT var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // The database connection var pDb uintptr // Database only autoinc table @@ -100660,7 +101805,7 @@ func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:12 (*VdbeOp)(unsafe.Pointer(aOp + 2*24)).Fp3 = memId (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp1 = (memId - 1) (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp3 = memId - (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp5 = SQLITE_JUMPIFNULL + (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp5 = U16(SQLITE_JUMPIFNULL) (*VdbeOp)(unsafe.Pointer(aOp + 4*24)).Fp2 = (memId + 1) (*VdbeOp)(unsafe.Pointer(aOp + 5*24)).Fp3 = memId (*VdbeOp)(unsafe.Pointer(aOp + 6*24)).Fp1 = memId @@ -100673,21 +101818,21 @@ func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:12 } } -var iLn1 int32 = 0 /* sqlite3.c:120957:22 */ +var iLn1 int32 = 0 /* sqlite3.c:122498:22 */ var autoInc = [12]VdbeOpList{ - /* 0 */ {Fopcode: OP_Null}, - /* 1 */ {Fopcode: OP_Rewind, Fp2: int8(10)}, - /* 2 */ {Fopcode: OP_Column}, - /* 3 */ {Fopcode: OP_Ne, Fp2: int8(9)}, - /* 4 */ {Fopcode: OP_Rowid}, - /* 5 */ {Fopcode: OP_Column, Fp2: int8(1)}, - /* 6 */ {Fopcode: OP_AddImm}, - /* 7 */ {Fopcode: OP_Copy}, - /* 8 */ {Fopcode: OP_Goto, Fp2: int8(11)}, - /* 9 */ {Fopcode: OP_Next, Fp2: int8(2)}, - /* 10 */ {Fopcode: OP_Integer}, - /* 11 */ {Fopcode: OP_Close}, -} /* sqlite3.c:120958:29 */ + /* 0 */ {Fopcode: U8(OP_Null)}, + /* 1 */ {Fopcode: U8(OP_Rewind), Fp2: int8(10)}, + /* 2 */ {Fopcode: U8(OP_Column)}, + /* 3 */ {Fopcode: U8(OP_Ne), Fp2: int8(9)}, + /* 4 */ {Fopcode: U8(OP_Rowid)}, + /* 5 */ {Fopcode: U8(OP_Column), Fp2: int8(1)}, + /* 6 */ {Fopcode: U8(OP_AddImm)}, + /* 7 */ {Fopcode: U8(OP_Copy)}, + /* 8 */ {Fopcode: U8(OP_Goto), Fp2: int8(11)}, + /* 9 */ {Fopcode: U8(OP_Next), Fp2: int8(2)}, + /* 10 */ {Fopcode: U8(OP_Integer)}, + /* 11 */ {Fopcode: U8(OP_Close)}, +} /* sqlite3.c:122499:29 */ // Update the maximum rowid for an autoincrement calculation. // @@ -100695,7 +101840,7 @@ var autoInc = [12]VdbeOpList{ // 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 *libc.TLS, pParse uintptr, memId int32, regRowid int32) { /* sqlite3.c:121004:13: */ +func autoIncStep(tls *libc.TLS, pParse uintptr, memId int32, regRowid int32) { /* sqlite3.c:122545:13: */ if memId > 0 { Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_MemMax, memId, regRowid) } @@ -100706,7 +101851,7 @@ func autoIncStep(tls *libc.TLS, pParse uintptr, memId int32, regRowid int32) { / // 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 *libc.TLS, pParse uintptr) { /* sqlite3.c:121017:29: */ +func autoIncrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:122558:29: */ var p uintptr var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb @@ -100732,21 +101877,21 @@ func autoIncrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:121017:29: * (*VdbeOp)(unsafe.Pointer(aOp + 2*24)).Fp3 = iRec (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp2 = iRec (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp3 = (memId + 1) - (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp5 = OPFLAG_APPEND + (*VdbeOp)(unsafe.Pointer(aOp + 3*24)).Fp5 = U16(OPFLAG_APPEND) Xsqlite3ReleaseTempReg(tls, pParse, iRec) } } -var iLn2 int32 = 0 /* sqlite3.c:121024:22 */ +var iLn2 int32 = 0 /* sqlite3.c:122565:22 */ var autoIncEnd = [5]VdbeOpList{ - /* 0 */ {Fopcode: OP_NotNull, Fp2: int8(2)}, - /* 1 */ {Fopcode: OP_NewRowid}, - /* 2 */ {Fopcode: OP_MakeRecord, Fp2: int8(2)}, - /* 3 */ {Fopcode: OP_Insert}, - /* 4 */ {Fopcode: OP_Close}, -} /* sqlite3.c:121025:29 */ + /* 0 */ {Fopcode: U8(OP_NotNull), Fp2: int8(2)}, + /* 1 */ {Fopcode: U8(OP_NewRowid)}, + /* 2 */ {Fopcode: U8(OP_MakeRecord), Fp2: int8(2)}, + /* 3 */ {Fopcode: U8(OP_Insert)}, + /* 4 */ {Fopcode: U8(OP_Close)}, +} /* sqlite3.c:122566:29 */ -func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:121054:21: */ +func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:122595:21: */ if (*Parse)(unsafe.Pointer(pParse)).FpAinc != 0 { autoIncrementEnd(tls, pParse) } @@ -100847,7 +101992,7 @@ func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:1210 // transfer values form intermediate table into
    // end loop // D: cleanup -func Xsqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { /* sqlite3.c:121173:21: */ +func Xsqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { /* sqlite3.c:122714:21: */ bp := tls.Alloc(204) defer tls.Free(204) @@ -100913,6 +102058,7 @@ func Xsqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin // var sNC NameContext at bp+136, 56 var nIdx int32 + var pNx uintptr var k int32 var colFlags U32 var addr1 int32 @@ -100950,7 +102096,7 @@ __1: // If the Select object is really just a simple VALUES() list with a // single row (the common case) then keep that one row of values // and discard the other (unused) parts of the pSelect object - if !(((pSelect != 0) && (((*Select)(unsafe.Pointer(pSelect)).FselFlags & SF_Values) != U32(0))) && ((*Select)(unsafe.Pointer(pSelect)).FpPrior == uintptr(0))) { + if !(((pSelect != 0) && (((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_Values)) != U32(0))) && ((*Select)(unsafe.Pointer(pSelect)).FpPrior == uintptr(0))) { goto __2 } pList = (*Select)(unsafe.Pointer(pSelect)).FpEList @@ -100978,7 +102124,7 @@ __3: goto insert_cleanup __4: ; - withoutRowid = libc.BoolUint8(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) + withoutRowid = libc.BoolUint8(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) // Figure out if we have any triggers and if the table being // inserted into is a view @@ -101116,7 +102262,7 @@ __23: goto __24 } Xsqlite3ErrorMsg(tls, pParse, - ts+13279, /* "cannot INSERT in..." */ + ts+13708, /* "cannot INSERT in..." */ libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*32)).FzName)) goto insert_cleanup __24: @@ -101141,7 +102287,7 @@ __20: bIdListInOrder = U8(0) goto __27 __26: - Xsqlite3ErrorMsg(tls, pParse, ts+13320, /* "table %S has no ..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+13749, /* "table %S has no ..." */ libc.VaList(bp+8, pTabList, 0, (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(i)*16)).FzName)) (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) goto insert_cleanup @@ -101255,7 +102401,7 @@ __29: goto __36 } ipkColumn = int32((*Table)(unsafe.Pointer(pTab)).FiPKey) - if !((ipkColumn >= 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != U32(0))) { + if !((ipkColumn >= 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0))) { goto __37 } @@ -101280,131 +102426,149 @@ __40: ; __37: ; -__36: - ; // Make sure the number of columns in the source data matches the number // of columns to be inserted into the table. - i = 0 -__42: - if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __44 + + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & (U32(TF_HasGenerated | TF_HasHidden))) != U32(0)) { + goto __42 } - if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_NOINSERT) != 0) { + i = 0 +__43: + if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { goto __45 } - nHidden++ -__45: - ; - goto __43 -__43: - i++ - goto __42 - goto __44 -__44: - ; - if !(((pColumn == uintptr(0)) && (nColumn != 0)) && (nColumn != (int32((*Table)(unsafe.Pointer(pTab)).FnCol) - nHidden))) { + if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_NOINSERT) != 0) { goto __46 } - Xsqlite3ErrorMsg(tls, pParse, - ts+13352, /* "table %S has %d ..." */ - libc.VaList(bp+32, pTabList, 0, (int32((*Table)(unsafe.Pointer(pTab)).FnCol)-nHidden), nColumn)) - goto insert_cleanup + nHidden++ __46: ; - if !((pColumn != uintptr(0)) && (nColumn != (*IdList)(unsafe.Pointer(pColumn)).FnId)) { + goto __44 +__44: + i++ + goto __43 + goto __45 +__45: + ; +__42: + ; + if !(nColumn != (int32((*Table)(unsafe.Pointer(pTab)).FnCol) - nHidden)) { goto __47 } - Xsqlite3ErrorMsg(tls, pParse, ts+13404 /* "%d values for %d..." */, libc.VaList(bp+64, nColumn, (*IdList)(unsafe.Pointer(pColumn)).FnId)) + Xsqlite3ErrorMsg(tls, pParse, + ts+13781, /* "table %S has %d ..." */ + libc.VaList(bp+32, pTabList, 0, (int32((*Table)(unsafe.Pointer(pTab)).FnCol)-nHidden), nColumn)) goto insert_cleanup __47: ; +__36: + ; + if !((pColumn != uintptr(0)) && (nColumn != (*IdList)(unsafe.Pointer(pColumn)).FnId)) { + goto __48 + } + Xsqlite3ErrorMsg(tls, pParse, ts+13833 /* "%d values for %d..." */, libc.VaList(bp+64, nColumn, (*IdList)(unsafe.Pointer(pColumn)).FnId)) + goto insert_cleanup +__48: + ; // Initialize the count of rows to be inserted - if !(((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) && + if !((((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) && - !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) { - goto __48 + !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) && + !(int32((*Parse)(unsafe.Pointer(pParse)).FbReturning) != 0)) { + goto __49 } regRowCount = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regRowCount) -__48: +__49: ; // If this is not a view, open the table and and all indices if !(!(isView != 0)) { - goto __49 + goto __50 } nIdx = Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, uint8(0), -1, uintptr(0), bp+192 /* &iDataCur */, bp+196 /* &iIdxCur */) aRegIdx = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint64(unsafe.Sizeof(int32(0))) * (uint64(nIdx + 2))))) if !(aRegIdx == uintptr(0)) { - goto __50 + goto __51 } goto insert_cleanup -__50: +__51: ; i = 0 pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex -__51: +__52: if !(i < nIdx) { - goto __53 + goto __54 } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)) - goto __52 -__52: - pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext - i++ - goto __51 goto __53 __53: + pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext + i++ + goto __52 + goto __54 +__54: ; *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Register to store the table record -__49: +__50: ; if !(pUpsert != 0) { - goto __54 - } - if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { goto __55 } - Xsqlite3ErrorMsg(tls, pParse, ts+13429, /* "UPSERT not imple..." */ - libc.VaList(bp+80, (*Table)(unsafe.Pointer(pTab)).FzName)) - goto insert_cleanup -__55: - ; - if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) { + if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { goto __56 } - Xsqlite3ErrorMsg(tls, pParse, ts+13475 /* "cannot UPSERT a ..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+13858, /* "UPSERT not imple..." */ + libc.VaList(bp+80, (*Table)(unsafe.Pointer(pTab)).FzName)) goto insert_cleanup __56: ; - if !(Xsqlite3HasExplicitNulls(tls, pParse, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget) != 0) { + if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) { goto __57 } + Xsqlite3ErrorMsg(tls, pParse, ts+13904 /* "cannot UPSERT a ..." */, 0) goto insert_cleanup __57: ; - (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor = *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)) - (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc = pTabList - (*Upsert)(unsafe.Pointer(pUpsert)).FregData = regData - (*Upsert)(unsafe.Pointer(pUpsert)).FiDataCur = *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)) - (*Upsert)(unsafe.Pointer(pUpsert)).FiIdxCur = *(*int32)(unsafe.Pointer(bp + 196 /* iIdxCur */)) - if !((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget != 0) { + if !(Xsqlite3HasExplicitNulls(tls, pParse, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget) != 0) { goto __58 } - Xsqlite3UpsertAnalyzeTarget(tls, pParse, pTabList, pUpsert) + goto insert_cleanup __58: ; -__54: + (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor = *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)) + pNx = pUpsert +__59: + (*Upsert)(unsafe.Pointer(pNx)).FpUpsertSrc = pTabList + (*Upsert)(unsafe.Pointer(pNx)).FregData = regData + (*Upsert)(unsafe.Pointer(pNx)).FiDataCur = *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)) + (*Upsert)(unsafe.Pointer(pNx)).FiIdxCur = *(*int32)(unsafe.Pointer(bp + 196 /* iIdxCur */)) + if !((*Upsert)(unsafe.Pointer(pNx)).FpUpsertTarget != 0) { + goto __62 + } + Xsqlite3UpsertAnalyzeTarget(tls, pParse, pTabList, pNx) +__62: + ; + pNx = (*Upsert)(unsafe.Pointer(pNx)).FpNextUpsert + goto __60 +__60: + if pNx != uintptr(0) { + goto __59 + } + goto __61 +__61: + ; +__55: ; // This is the top of the main insertion loop if !(useTempTable != 0) { - goto __59 + goto __63 } // This block codes the top of loop only. The complete loop is the // following pseudocode (template 4): @@ -101416,10 +102580,10 @@ __54: // D: ... addrInsTop = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, srcTab) addrCont = Xsqlite3VdbeCurrentAddr(tls, v) - goto __60 -__59: + goto __64 +__63: if !(pSelect != 0) { - goto __61 + goto __65 } // This block codes the top of loop only. The complete loop is the // following pseudocode (template 3): @@ -101432,17 +102596,17 @@ __59: addrInsTop = libc.AssignInt32(&addrCont, Xsqlite3VdbeAddOp1(tls, v, OP_Yield, (*SelectDest)(unsafe.Pointer(bp+96 /* &dest */)).FiSDParm)) if !(ipkColumn >= 0) { - goto __62 + goto __66 } // tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the // SELECT, go ahead and copy the value into the rowid slot now, so that // the value does not get overwritten by a NULL at tag-20191021-002. Xsqlite3VdbeAddOp2(tls, v, OP_Copy, (regFromSelect + ipkColumn), regRowid) -__62: +__66: ; -__61: +__65: ; -__60: +__64: ; // Compute data for ordinary columns of the new entry. Values @@ -101454,143 +102618,143 @@ __60: nHidden = 0 iRegStore = regData i = 0 -__63: +__67: if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __65 + goto __69 } if !(i == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) { - goto __66 + goto __70 } // tag-20191021-002: References to the INTEGER PRIMARY KEY are filled // using the rowid. So put a NULL in the IPK slot of the record to avoid // using excess space. The file format definition requires this extra // NULL - we cannot optimize further by skipping the column completely Xsqlite3VdbeAddOp1(tls, v, OP_SoftNull, iRegStore) - goto __64 -__66: + goto __68 +__70: ; - if !(((libc.AssignUint32(&colFlags, U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags))) & COLFLAG_NOINSERT) != U32(0)) { - goto __67 + if !(((libc.AssignUint32(&colFlags, U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags))) & U32(COLFLAG_NOINSERT)) != U32(0)) { + goto __71 } nHidden++ - if !((colFlags & COLFLAG_VIRTUAL) != U32(0)) { - goto __68 + if !((colFlags & U32(COLFLAG_VIRTUAL)) != U32(0)) { + goto __72 } // Virtual columns do not participate in OP_MakeRecord. So back up // iRegStore by one slot to compensate for the iRegStore++ in the // outer for() loop iRegStore-- - goto __64 - goto __69 -__68: - if !((colFlags & COLFLAG_STORED) != U32(0)) { - goto __70 + goto __68 + goto __73 +__72: + if !((colFlags & U32(COLFLAG_STORED)) != U32(0)) { + goto __74 } // Stored columns are computed later. But if there are BEFORE // triggers, the slots used for stored columns will be OP_Copy-ed // to a second block of registers, so the register needs to be // initialized to NULL to avoid an uninitialized register read if !((*(*int32)(unsafe.Pointer(bp + 88 /* tmask */)) & TRIGGER_BEFORE) != 0) { - goto __72 + goto __76 } Xsqlite3VdbeAddOp1(tls, v, OP_SoftNull, iRegStore) -__72: +__76: ; - goto __64 - goto __71 -__70: + goto __68 + goto __75 +__74: if !(pColumn == uintptr(0)) { - goto __73 + goto __77 } // Hidden columns that are not explicitly named in the INSERT // get there default value Xsqlite3ExprCodeFactorable(tls, pParse, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FpDflt, iRegStore) - goto __64 + goto __68 +__77: + ; +__75: + ; __73: ; __71: ; -__69: - ; -__67: - ; if !(pColumn != 0) { - goto __74 - } - j = 0 -__76: - if !((j < (*IdList)(unsafe.Pointer(pColumn)).FnId) && ((*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(j)*16)).Fidx != i)) { goto __78 } - goto __77 -__77: + j = 0 +__80: + if !((j < (*IdList)(unsafe.Pointer(pColumn)).FnId) && ((*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(j)*16)).Fidx != i)) { + goto __82 + } + goto __81 +__81: j++ - goto __76 - goto __78 -__78: + goto __80 + goto __82 +__82: ; if !(j >= (*IdList)(unsafe.Pointer(pColumn)).FnId) { - goto __79 + goto __83 } // A column not named in the insert column list gets its // default value Xsqlite3ExprCodeFactorable(tls, pParse, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FpDflt, iRegStore) - goto __64 -__79: + goto __68 +__83: ; k = j - goto __75 -__74: + goto __79 +__78: if !(nColumn == 0) { - goto __80 + goto __84 } // This is INSERT INTO ... DEFAULT VALUES. Load the default value. Xsqlite3ExprCodeFactorable(tls, pParse, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FpDflt, iRegStore) - goto __64 - goto __81 -__80: + goto __68 + goto __85 +__84: k = (i - nHidden) -__81: +__85: ; -__75: +__79: ; if !(useTempTable != 0) { - goto __82 - } - Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, k, iRegStore) - goto __83 -__82: - if !(pSelect != 0) { - goto __84 - } - if !(regFromSelect != regData) { goto __86 } - Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, (regFromSelect + k), iRegStore) + Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, k, iRegStore) + goto __87 __86: + if !(pSelect != 0) { + goto __88 + } + if !(regFromSelect != regData) { + goto __90 + } + Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, (regFromSelect + k), iRegStore) +__90: ; - goto __85 -__84: + goto __89 +__88: Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(k)*32)).FpExpr, iRegStore) -__85: +__89: ; -__83: +__87: ; - goto __64 -__64: + goto __68 +__68: i++ iRegStore++ - goto __63 - goto __65 -__65: + goto __67 + goto __69 +__69: ; // Run the BEFORE and INSTEAD OF triggers, if there are any endOfLoop = Xsqlite3VdbeMakeLabel(tls, pParse) if !((*(*int32)(unsafe.Pointer(bp + 88 /* tmask */)) & TRIGGER_BEFORE) != 0) { - goto __87 + goto __91 } regCols = Xsqlite3GetTempRange(tls, pParse, (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1)) @@ -101600,32 +102764,29 @@ __65: // we do not know what the unique ID will be (because the insert has // not happened yet) so we substitute a rowid of -1 if !(ipkColumn < 0) { - goto __88 + goto __92 } Xsqlite3VdbeAddOp2(tls, v, OP_Integer, -1, regCols) - goto __89 -__88: + goto __93 +__92: ; if !(useTempTable != 0) { - goto __90 + goto __94 } Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, ipkColumn, regCols) - goto __91 -__90: + goto __95 +__94: ; // Otherwise useTempTable is true Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(ipkColumn)*32)).FpExpr, regCols) -__91: +__95: ; addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, regCols) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, -1, regCols) Xsqlite3VdbeJumpHere(tls, v, addr1) Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, regCols) -__89: +__93: ; - // Cannot have triggers on a virtual table. If it were possible, - // this block would have to account for hidden column. - // Copy the new data already generated. Xsqlite3VdbeAddOp3(tls, v, OP_Copy, (regRowid + 1), (regCols + 1), (int32((*Table)(unsafe.Pointer(pTab)).FnNVCol) - 1)) @@ -101634,12 +102795,12 @@ __89: // columns have already been computed. This must be done after // computing the ROWID in case one of the generated columns // refers to the ROWID. - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { - goto __92 + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { + goto __96 } Xsqlite3ComputeGeneratedColumns(tls, pParse, (regCols + 1), pTab) -__92: +__96: ; // If this is an INSERT on a view with an INSTEAD OF INSERT trigger, @@ -101647,10 +102808,10 @@ __92: // If this is a real table, attempt conversions as required by the // table column affinities. if !(!(isView != 0)) { - goto __93 + goto __97 } Xsqlite3TableAffinity(tls, v, pTab, (regCols + 1)) -__93: +__97: ; // Fire BEFORE or INSTEAD OF triggers @@ -101658,83 +102819,83 @@ __93: pTab, ((regCols - int32((*Table)(unsafe.Pointer(pTab)).FnCol)) - 1), onError, endOfLoop) Xsqlite3ReleaseTempRange(tls, pParse, regCols, (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1)) -__87: +__91: ; if !(!(isView != 0)) { - goto __94 + goto __98 } if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { - goto __95 + goto __99 } // The row that the VUpdate opcode will delete: none Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regIns) -__95: +__99: ; if !(ipkColumn >= 0) { - goto __96 + goto __100 } // Compute the new rowid if !(useTempTable != 0) { - goto __98 + goto __102 } Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, ipkColumn, regRowid) - goto __99 -__98: + goto __103 +__102: if !(pSelect != 0) { - goto __100 + goto __104 } // Rowid already initialized at tag-20191021-001 - goto __101 -__100: + goto __105 +__104: pIpk = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(ipkColumn)*32)).FpExpr if !((int32((*Expr)(unsafe.Pointer(pIpk)).Fop) == TK_NULL) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0)) { - goto __102 + goto __106 } Xsqlite3VdbeAddOp3(tls, v, OP_NewRowid, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), regRowid, regAutoinc) appendFlag = U8(1) - goto __103 -__102: + goto __107 +__106: Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(ipkColumn)*32)).FpExpr, regRowid) +__107: + ; +__105: + ; __103: ; -__101: - ; -__99: - ; // If the PRIMARY KEY expression is NULL, then use OP_NewRowid // to generate a unique primary key value. if !(!(appendFlag != 0)) { - goto __104 + goto __108 } if !(!((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0)) { - goto __105 + goto __109 } addr11 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, regRowid) Xsqlite3VdbeAddOp3(tls, v, OP_NewRowid, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), regRowid, regAutoinc) Xsqlite3VdbeJumpHere(tls, v, addr11) - goto __106 -__105: + goto __110 +__109: addr11 = Xsqlite3VdbeCurrentAddr(tls, v) Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regRowid, (addr11 + 2)) -__106: +__110: ; Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, regRowid) -__104: - ; - goto __97 -__96: - if !(((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) || (withoutRowid != 0)) { - goto __107 - } - Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regRowid) - goto __108 -__107: - Xsqlite3VdbeAddOp3(tls, v, OP_NewRowid, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), regRowid, regAutoinc) - appendFlag = U8(1) __108: ; -__97: + goto __101 +__100: + if !(((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) || (withoutRowid != 0)) { + goto __111 + } + Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regRowid) + goto __112 +__111: + Xsqlite3VdbeAddOp3(tls, v, OP_NewRowid, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), regRowid, regAutoinc) + appendFlag = U8(1) +__112: + ; +__101: ; autoIncStep(tls, pParse, regAutoinc, regRowid) @@ -101742,30 +102903,30 @@ __97: // columns have already been computed. This must be done after // computing the ROWID in case one of the generated columns // is derived from the INTEGER PRIMARY KEY. - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { - goto __109 + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { + goto __113 } Xsqlite3ComputeGeneratedColumns(tls, pParse, (regRowid + 1), pTab) -__109: +__113: ; // Generate code to check constraints and generate index keys and // do the insertion. if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { - goto __110 + goto __114 } pVTab = Xsqlite3GetVTable(tls, db, pTab) Xsqlite3VtabMakeWritable(tls, pParse, pTab) Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 1, (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 2), regIns, pVTab, -12) Xsqlite3VdbeChangeP5(tls, v, func() uint16 { if onError == OE_Default { - return OE_Abort + return uint16(OE_Abort) } return uint16(onError) }()) Xsqlite3MayAbort(tls, pParse) - goto __111 -__110: + goto __115 +__114: // True to use OPFLAG_SEEKRESULT Xsqlite3GenerateConstraintChecks(tls, pParse, pTab, aRegIdx, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 196 /* iIdxCur */)), regIns, 0, (uint8(libc.Bool32(ipkColumn >= 0))), uint8(onError), endOfLoop, bp+200 /* &isReplace */, uintptr(0), pUpsert) @@ -101782,47 +102943,47 @@ __110: bUseSeek = (libc.Bool32((*(*int32)(unsafe.Pointer(bp + 200 /* isReplace */)) == 0) || !(Xsqlite3VdbeHasSubProgram(tls, v) != 0))) Xsqlite3CompleteInsertion(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 196 /* iIdxCur */)), regIns, aRegIdx, 0, int32(appendFlag), bUseSeek) -__111: +__115: ; -__94: +__98: ; // Update the count of rows that are inserted if !(regRowCount != 0) { - goto __112 + goto __116 } Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, regRowCount, 1) -__112: +__116: ; if !(pTrigger != 0) { - goto __113 + goto __117 } // Code AFTER triggers Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, TK_INSERT, uintptr(0), TRIGGER_AFTER, pTab, ((regData - 2) - int32((*Table)(unsafe.Pointer(pTab)).FnCol)), onError, endOfLoop) -__113: +__117: ; // The bottom of the main insertion loop, if the data source // is a SELECT statement. Xsqlite3VdbeResolveLabel(tls, v, endOfLoop) if !(useTempTable != 0) { - goto __114 + goto __118 } Xsqlite3VdbeAddOp2(tls, v, OP_Next, srcTab, addrCont) Xsqlite3VdbeJumpHere(tls, v, addrInsTop) Xsqlite3VdbeAddOp1(tls, v, OP_Close, srcTab) - goto __115 -__114: + goto __119 +__118: if !(pSelect != 0) { - goto __116 + goto __120 } Xsqlite3VdbeGoto(tls, v, addrCont) Xsqlite3VdbeJumpHere(tls, v, addrInsTop) -__116: +__120: ; -__115: +__119: ; insert_end: @@ -101830,22 +102991,22 @@ insert_end: // maximum rowid counter values recorded while inserting into // autoincrement tables. if !((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && ((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0))) { - goto __117 + goto __121 } Xsqlite3AutoincrementEnd(tls, pParse) -__117: +__121: ; // Return the number of rows inserted. If this routine is // generating code because of a call to sqlite3NestedParse(), do not // invoke the callback function. if !(regRowCount != 0) { - goto __118 + goto __122 } - Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, regRowCount, 1) + Xsqlite3VdbeAddOp2(tls, v, OP_ChngCntRow, regRowCount, 1) Xsqlite3VdbeSetNumCols(tls, v, 1) - Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+13496 /* "rows inserted" */, uintptr(0)) -__118: + Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+13925 /* "rows inserted" */, uintptr(0)) +__122: ; insert_cleanup: @@ -101868,7 +103029,7 @@ insert_cleanup: // Set bit 0x01 of pWalker->eCode if pWalker->eCode to 0 and if this // expression node references any of the // columns that are being modifed by an UPDATE statement. -func checkConstraintExprNode(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:121903:12: */ +func checkConstraintExprNode(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:123452:12: */ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN { if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { @@ -101895,7 +103056,7 @@ func checkConstraintExprNode(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int3 // The operation of this routine is the same - return true if an only if // the expression uses one or more of columns identified by the second and // third arguments. -func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng uintptr, chngRowid int32) int32 { /* sqlite3.c:121932:20: */ +func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng uintptr, chngRowid int32) int32 { /* sqlite3.c:123481:20: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -101916,6 +103077,73 @@ func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng ui return (libc.Bool32(int32((*Walker)(unsafe.Pointer(bp /* &w */)).FeCode) != 0)) } +// The sqlite3GenerateConstraintChecks() routine usually wants to visit +// the indexes of a table in the order provided in the Table->pIndex list. +// However, sometimes (rarely - when there is an upsert) it wants to visit +// the indexes in a different order. The following data structures accomplish +// this. +// +// The IndexIterator object is used to walk through all of the indexes +// of a table in either Index.pNext order, or in some other order established +// by an array of IndexListTerm objects. +type IndexListTerm1 = struct { + Fp uintptr + Fix int32 + _ [4]byte +} /* sqlite3.c:123514:9 */ + +// The sqlite3GenerateConstraintChecks() routine usually wants to visit +// the indexes of a table in the order provided in the Table->pIndex list. +// However, sometimes (rarely - when there is an upsert) it wants to visit +// the indexes in a different order. The following data structures accomplish +// this. +// +// The IndexIterator object is used to walk through all of the indexes +// of a table in either Index.pNext order, or in some other order established +// by an array of IndexListTerm objects. +type IndexListTerm = IndexListTerm1 /* sqlite3.c:123514:30 */ +type IndexIterator1 = struct { + FeType int32 + Fi int32 + Fu struct { + Flx struct{ FpIdx uintptr } + _ [8]byte + } +} /* sqlite3.c:123515:9 */ + +type IndexIterator = IndexIterator1 /* sqlite3.c:123515:30 */ + +// Return the first index on the list +func indexIteratorFirst(tls *libc.TLS, pIter uintptr, pIx uintptr) uintptr { /* sqlite3.c:123539:14: */ + + if (*IndexIterator)(unsafe.Pointer(pIter)).FeType != 0 { + *(*int32)(unsafe.Pointer(pIx)) = (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)))).Fix + return (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)))).Fp + } else { + *(*int32)(unsafe.Pointer(pIx)) = 0 + return *(*uintptr)(unsafe.Pointer(pIter + 8 /* &.u */ /* &.lx */ /* &.pIdx */)) + } + return uintptr(0) +} + +// Return the next index from the list. Return NULL when out of indexes +func indexIteratorNext(tls *libc.TLS, pIter uintptr, pIx uintptr) uintptr { /* sqlite3.c:123551:14: */ + if (*IndexIterator)(unsafe.Pointer(pIter)).FeType != 0 { + var i int32 = libc.PreIncInt32(&(*IndexIterator)(unsafe.Pointer(pIter)).Fi, 1) + if i >= *(*int32)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) /* &.nIdx */)) { + *(*int32)(unsafe.Pointer(pIx)) = i + return uintptr(0) + } + *(*int32)(unsafe.Pointer(pIx)) = (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(i)*16)).Fix + return (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(i)*16)).Fp + } else { + (*(*int32)(unsafe.Pointer(pIx)))++ + *(*uintptr)(unsafe.Pointer(pIter + 8 /* &.u */ /* &.lx */ /* &.pIdx */)) = (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIter + 8 /* &.u */ /* &.lx */ /* &.pIdx */)))).FpNext + return *(*uintptr)(unsafe.Pointer(pIter + 8 /* &.u */ /* &.lx */ /* &.pIdx */)) + } + return uintptr(0) +} + // Generate code to do constraint checks prior to an INSERT or an UPDATE // on table pTab. // @@ -102005,27 +103233,28 @@ func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng ui // 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 Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintptr, aRegIdx uintptr, iDataCur int32, iIdxCur int32, regNewData int32, regOldData int32, pkChng U8, overrideError U8, ignoreDest int32, pbMayReplace uintptr, aiChng uintptr, pUpsert uintptr) { /* sqlite3.c:122045:21: */ - bp := tls.Alloc(40) - defer tls.Free(40) +func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintptr, aRegIdx uintptr, iDataCur int32, iIdxCur int32, regNewData int32, regOldData int32, pkChng U8, overrideError U8, ignoreDest int32, pbMayReplace uintptr, aiChng uintptr, pUpsert uintptr) { /* sqlite3.c:123658:21: */ + bp := tls.Alloc(72) + defer tls.Free(72) - var v uintptr // VDBE under constrution - var pIdx uintptr // Pointer to one of the indices - var pPk uintptr = uintptr(0) // The PRIMARY KEY index - var db uintptr // Database connection - var i int32 // loop counter - var ix int32 // Index loop counter - var nCol int32 // Number of columns - var onError int32 // Conflict resolution strategy - var seenReplace int32 = 0 // True if REPLACE is used to resolve INT PK conflict - var nPkField int32 // Number of fields in PRIMARY KEY. 1 for ROWID tables - var pUpIdx uintptr = uintptr(0) // Index to which to apply the upsert - var isUpdate U8 // True if this is an UPDATE operation - var bAffinityDone U8 = U8(0) // True if the OP_Affinity operation has been run - var upsertBypass int32 = 0 // Address of Goto to bypass upsert subroutine - var upsertJump int32 = 0 // Address of Goto that jumps into upsert subroutine - var ipkTop int32 = 0 // Top of the IPK uniqueness check - var ipkBottom int32 = 0 // OP_Goto at the end of the IPK uniqueness check + var v uintptr // VDBE under constrution + var pIdx uintptr // Pointer to one of the indices + var pPk uintptr = uintptr(0) // The PRIMARY KEY index for WITHOUT ROWID tables + var db uintptr // Database connection + var i int32 // loop counter + // var ix int32 at bp+40, 4 + // Index loop counter + var nCol int32 // Number of columns + var onError int32 // Conflict resolution strategy + var seenReplace int32 = 0 // True if REPLACE is used to resolve INT PK conflict + var nPkField int32 // Number of fields in PRIMARY KEY. 1 for ROWID tables + var pUpsertClause uintptr = uintptr(0) // The specific ON CONFLICT clause for pIdx + var isUpdate U8 // True if this is an UPDATE operation + var bAffinityDone U8 = U8(0) // True if the OP_Affinity operation has been run + var upsertIpkReturn int32 = 0 // Address of Goto at end of IPK uniqueness check + var upsertIpkDelay int32 = 0 // Address of Goto to bypass initial IPK check + var ipkTop int32 = 0 // Top of the IPK uniqueness check + var ipkBottom int32 = 0 // OP_Goto at the end of the IPK uniqueness check // Variables associated with retesting uniqueness constraints after // replace triggers fire have run var regTrigCnt int32 // Register used to count replace trigger invocations @@ -102033,10 +103262,12 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt var lblRecheckOk int32 = 0 // Each recheck jumps to this label if it passes var pTrigger uintptr // List of DELETE triggers on the table pTab var nReplaceTrig int32 = 0 // Number of replace triggers coded + // var sIdxIter IndexIterator at bp+16, 24 + // Index iterator isUpdate = (U8(libc.Bool32(regOldData != 0))) db = (*Parse)(unsafe.Pointer(pParse)).Fdb - v = Xsqlite3GetVdbe(tls, pParse) + v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // This table is not a VIEW nCol = int32((*Table)(unsafe.Pointer(pTab)).FnCol) @@ -102045,7 +103276,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // normal rowid tables. nPkField is the number of key fields in the // pPk index or 1 for a rowid table. In other words, nPkField is the // number of fields in the true primary key of the table. - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk = uintptr(0) nPkField = 1 } else { @@ -102056,7 +103287,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // Record that this module has started // Test all NOT NULL constraints. - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasNotNull) != 0 { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasNotNull)) != 0 { var b2ndPass int32 = 0 // True if currently running 2nd pass var nSeenReplace int32 = 0 // Number of ON CONFLICT REPLACE operations var nGenerated int32 = 0 // Number of generated columns with NOT NULL @@ -102118,12 +103349,12 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt fallthrough case OE_Fail: { - var zMsg uintptr = Xsqlite3MPrintf(tls, db, ts+9959 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, + var zMsg uintptr = Xsqlite3MPrintf(tls, db, ts+10324 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer(pCol)).FzName)) Xsqlite3VdbeAddOp3(tls, v, OP_HaltIfNull, (SQLITE_CONSTRAINT | (int32(5) << 8)), onError, iReg) Xsqlite3VdbeAppendP4(tls, v, zMsg, -7) - Xsqlite3VdbeChangeP5(tls, v, P5_ConstraintNotNull) + Xsqlite3VdbeChangeP5(tls, v, uint16(P5_ConstraintNotNull)) break @@ -102149,7 +103380,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt break } // Never need more than 2 passes b2ndPass = 1 - if (nSeenReplace > 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != U32(0)) { + if (nSeenReplace > 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) { // If any NOT NULL ON CONFLICT REPLACE constraints fired on the // first pass, recomputed values for all generated columns, as // those values might depend on columns affected by the REPLACE. @@ -102159,7 +103390,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } // end if( has-not-null-constraints ) // Test all CHECK constraints - if ((*Table)(unsafe.Pointer(pTab)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_IgnoreChecks) == uint64(0)) { + if ((*Table)(unsafe.Pointer(pTab)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_IgnoreChecks)) == uint64(0)) { var pCheck uintptr = (*Table)(unsafe.Pointer(pTab)).FpCheck (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + 1) if int32(overrideError) != OE_Default { @@ -102192,15 +103423,13 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt Xsqlite3VdbeGoto(tls, v, ignoreDest) } else { var zName uintptr = (*ExprList_item)(unsafe.Pointer((pCheck + 8 /* &.a */) + uintptr(i)*32)).FzEName - if zName == uintptr(0) { - zName = (*Table)(unsafe.Pointer(pTab)).FzName - } + if onError == OE_Replace { onError = OE_Abort } // IMP: R-26383-51744 Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(1) << 8)), - onError, zName, P4_TRANSIENT, - P5_ConstraintCheck) + onError, zName, int8(P4_TRANSIENT), + uint8(P5_ConstraintCheck)) } Xsqlite3VdbeResolveLabel(tls, v, allOk) } @@ -102234,18 +103463,103 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // The ordering of (2) and (3) is accomplished by making sure the linked // list of indexes attached to a table puts all OE_Replace indexes last // in the list. See sqlite3CreateIndex() for where that happens. - + (*IndexIterator)(unsafe.Pointer(bp + 16 /* &sIdxIter */)).FeType = 0 + (*IndexIterator)(unsafe.Pointer(bp + 16 /* &sIdxIter */)).Fi = 0 + *(*uintptr)(unsafe.Pointer(bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */ + 8 /* &.aIdx */)) = uintptr(0) // Silence harmless compiler warning + *(*uintptr)(unsafe.Pointer(bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.lx */ /* &.pIdx */)) = (*Table)(unsafe.Pointer(pTab)).FpIndex if pUpsert != 0 { if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget == uintptr(0) { - // An ON CONFLICT DO NOTHING clause, without a constraint-target. - // Make all unique constraint resolution be OE_Ignore + // There is just on ON CONFLICT clause and it has no constraint-target - overrideError = OE_Ignore - pUpsert = uintptr(0) - } else if (libc.AssignUintptr(&pUpIdx, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx)) != uintptr(0) { - // If the constraint-target uniqueness check must be run first. - // Jump to that uniqueness check now - upsertJump = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) + if int32((*Upsert)(unsafe.Pointer(pUpsert)).FisDoUpdate) == 0 { + // A single ON CONFLICT DO NOTHING clause, without a constraint-target. + // Make all unique constraint resolution be OE_Ignore + overrideError = U8(OE_Ignore) + pUpsert = uintptr(0) + } else { + // A single ON CONFLICT DO UPDATE. Make all resolutions OE_Update + overrideError = U8(OE_Update) + } + } else if (*Table)(unsafe.Pointer(pTab)).FpIndex != uintptr(0) { + // Otherwise, we'll need to run the IndexListTerm array version of the + // iterator to ensure that all of the ON CONFLICT conditions are + // checked first and in order. + var nIdx int32 + var jj int32 + var nByte U64 + var pTerm uintptr + var bUsed uintptr + nIdx = 0 + pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex + __1: + if !(pIdx != 0) { + goto __3 + } + { + + } + goto __2 + __2: + pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext + nIdx++ + goto __1 + goto __3 + __3: + ; + (*IndexIterator)(unsafe.Pointer(bp + 16 /* &sIdxIter */)).FeType = 1 + *(*int32)(unsafe.Pointer(bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */ /* &.nIdx */)) = nIdx + nByte = (U64(((uint64(unsafe.Sizeof(IndexListTerm{})) + uint64(1)) * uint64(nIdx)) + uint64(nIdx))) + *(*uintptr)(unsafe.Pointer(bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */ + 8 /* &.aIdx */)) = Xsqlite3DbMallocZero(tls, db, nByte) + if *(*uintptr)(unsafe.Pointer((bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) == uintptr(0) { + return + } // OOM + bUsed = (*(*uintptr)(unsafe.Pointer((bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(nIdx)*16) + (*Upsert)(unsafe.Pointer(pUpsert)).FpToFree = *(*uintptr)(unsafe.Pointer(bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */ + 8 /* &.aIdx */)) + i = 0 + pTerm = pUpsert + for ; pTerm != 0; pTerm = (*Upsert)(unsafe.Pointer(pTerm)).FpNextUpsert { + if (*Upsert)(unsafe.Pointer(pTerm)).FpUpsertTarget == uintptr(0) { + break + } + if (*Upsert)(unsafe.Pointer(pTerm)).FpUpsertIdx == uintptr(0) { + continue + } // Skip ON CONFLICT for the IPK + jj = 0 + pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex + for (pIdx != uintptr(0)) && (pIdx != (*Upsert)(unsafe.Pointer(pTerm)).FpUpsertIdx) { + pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext + jj++ + } + if *(*U8)(unsafe.Pointer(bUsed + uintptr(jj))) != 0 { + continue + } // Duplicate ON CONFLICT clause ignored + *(*U8)(unsafe.Pointer(bUsed + uintptr(jj))) = U8(1) + (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(i)*16)).Fp = pIdx + (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(i)*16)).Fix = jj + i++ + } + jj = 0 + pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex + __4: + if !(pIdx != 0) { + goto __6 + } + { + if *(*U8)(unsafe.Pointer(bUsed + uintptr(jj))) != 0 { + goto __5 + } + (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(i)*16)).Fp = pIdx + (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((bp + 16 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(i)*16)).Fix = jj + i++ + + } + goto __5 + __5: + pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext + jj++ + goto __4 + goto __6 + __6: } } @@ -102275,7 +103589,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt pTrigger = uintptr(0) regTrigCnt = 0 } else { - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_RecTriggers) != 0 { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_RecTriggers)) != 0 { pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, TK_DELETE, uintptr(0), uintptr(0)) regTrigCnt = (libc.Bool32((pTrigger != uintptr(0)) || (Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0))) } else { @@ -102307,11 +103621,20 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } // figure out whether or not upsert applies in this case - if (pUpsert != 0) && ((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx == uintptr(0)) { - if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet == uintptr(0) { - onError = OE_Ignore // DO NOTHING is the same as INSERT OR IGNORE - } else { - onError = OE_Update // DO UPDATE + if pUpsert != 0 { + pUpsertClause = Xsqlite3UpsertOfIndex(tls, pUpsert, uintptr(0)) + if pUpsertClause != uintptr(0) { + if int32((*Upsert)(unsafe.Pointer(pUpsertClause)).FisDoUpdate) == 0 { + onError = OE_Ignore // DO NOTHING is the same as INSERT OR IGNORE + } else { + onError = OE_Update // DO UPDATE + } + } + if pUpsertClause != pUpsert { + // The first ON CONFLICT clause has a conflict target other than + // the IPK. We have to jump ahead to that first ON CONFLICT clause + // and then come back here and deal with the IPK afterwards + upsertIpkDelay = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) } } @@ -102320,7 +103643,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // to defer the running of the rowid conflict checking until after // the UNIQUE constraints have run. if ((onError == OE_Replace) && // IPK rule is REPLACE - (onError != int32(overrideError))) && // Rules for other contraints are different + (onError != int32(overrideError))) && // Rules for other constraints are different ((*Table)(unsafe.Pointer(pTab)).FpIndex != 0) { ipkTop = (Xsqlite3VdbeAddOp0(tls, v, OP_Goto) + 1) @@ -102331,7 +103654,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // it might have changed. Skip the conflict logic below if the rowid // is unchanged. Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regNewData, addrRowidOk, regOldData) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } @@ -102385,7 +103708,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt if regTrigCnt != 0 { Xsqlite3MultiWrite(tls, pParse) Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur, - regNewData, int16(1), uint8(0), OE_Replace, uint8(1), -1) + regNewData, int16(1), uint8(0), uint8(OE_Replace), uint8(1), -1) Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, regTrigCnt, 1) // incr trigger cnt nReplaceTrig++ } else { @@ -102421,7 +103744,9 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } } Xsqlite3VdbeResolveLabel(tls, v, addrRowidOk) - if ipkTop != 0 { + if (pUpsert != 0) && (pUpsertClause != pUpsert) { + upsertIpkReturn = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) + } else if ipkTop != 0 { ipkBottom = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) Xsqlite3VdbeJumpHere(tls, v, (ipkTop - 1)) } @@ -102433,40 +103758,33 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // // This loop also handles the case of the PRIMARY KEY index for a // WITHOUT ROWID table. - ix = 0 - pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex -__1: - if !(pIdx != 0) { - goto __3 - } - { + for pIdx = indexIteratorFirst(tls, bp+16 /* &sIdxIter */, bp+40 /* &ix */); pIdx != 0; pIdx = indexIteratorNext(tls, bp+16 /* &sIdxIter */, bp+40 /* &ix */) { var regIdx int32 // Range of registers hold conent for pIdx var regR int32 // Range of registers holding conflicting PK var iThisCur int32 // Cursor for this UNIQUE index var addrUniqueOk int32 // Jump here if the UNIQUE constraint is satisfied var addrConflictCk int32 // First opcode in the conflict check logic - if *(*int32)(unsafe.Pointer(aRegIdx + uintptr(ix)*4)) == 0 { - goto __2 + if *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 40 /* ix */)))*4)) == 0 { + continue } // Skip indices that do not change - if pUpIdx == pIdx { - addrUniqueOk = (upsertJump + 1) - upsertBypass = Xsqlite3VdbeGoto(tls, v, 0) - - Xsqlite3VdbeJumpHere(tls, v, upsertJump) - } else { - addrUniqueOk = Xsqlite3VdbeMakeLabel(tls, pParse) + if pUpsert != 0 { + pUpsertClause = Xsqlite3UpsertOfIndex(tls, pUpsert, pIdx) + if (upsertIpkDelay != 0) && (pUpsertClause == pUpsert) { + Xsqlite3VdbeJumpHere(tls, v, upsertIpkDelay) + } } - if (int32(bAffinityDone) == 0) && ((pUpIdx == uintptr(0)) || (pUpIdx == pIdx)) { + addrUniqueOk = Xsqlite3VdbeMakeLabel(tls, pParse) + if int32(bAffinityDone) == 0 { Xsqlite3TableAffinity(tls, v, pTab, (regNewData + 1)) bAffinityDone = U8(1) } - iThisCur = (iIdxCur + ix) + iThisCur = (iIdxCur + *(*int32)(unsafe.Pointer(bp + 40 /* ix */))) // Skip partial indices for which the WHERE clause is not true if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { - Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(ix)*4))) + Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 40 /* ix */)))*4))) (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + 1) Xsqlite3ExprIfFalseDup(tls, pParse, (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere, addrUniqueOk, SQLITE_JUMPIFNULL) @@ -102475,7 +103793,7 @@ __1: // Create a record for this index entry as it should appear after // the insert or update. Store that record in the aRegIdx[ix] register - regIdx = (*(*int32)(unsafe.Pointer(aRegIdx + uintptr(ix)*4)) + 1) + regIdx = (*(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 40 /* ix */)))*4)) + 1) for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ { var iField int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) var x int32 @@ -102495,7 +103813,7 @@ __1: } } - Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regIdx, int32((*Index)(unsafe.Pointer(pIdx)).FnColumn), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(ix)*4))) + Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regIdx, int32((*Index)(unsafe.Pointer(pIdx)).FnColumn), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 40 /* ix */)))*4))) // In an UPDATE operation, if this index is the PRIMARY KEY index // of a WITHOUT ROWID table and there has been no change the @@ -102503,14 +103821,14 @@ __1: // logic below can all be skipped. if ((isUpdate != 0) && (pPk == pIdx)) && (int32(pkChng) == 0) { Xsqlite3VdbeResolveLabel(tls, v, addrUniqueOk) - goto __2 + continue } // Find out what action to take in case there is a uniqueness conflict onError = int32((*Index)(unsafe.Pointer(pIdx)).FonError) if onError == OE_None { Xsqlite3VdbeResolveLabel(tls, v, addrUniqueOk) - goto __2 // pIdx is not a UNIQUE index + continue // pIdx is not a UNIQUE index } if int32(overrideError) != OE_Default { onError = int32(overrideError) @@ -102519,8 +103837,8 @@ __1: } // Figure out if the upsert clause applies to this index - if pUpIdx == pIdx { - if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet == uintptr(0) { + if pUpsertClause != 0 { + if int32((*Upsert)(unsafe.Pointer(pUpsertClause)).FisDoUpdate) == 0 { onError = OE_Ignore // DO NOTHING is the same as INSERT OR IGNORE } else { onError = OE_Update // DO UPDATE @@ -102550,13 +103868,13 @@ __1: regR = Xsqlite3GetTempRange(tls, pParse, nPkField) } if (isUpdate != 0) || (onError == OE_Replace) { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iThisCur, regR) // Conflict only if the rowid of the existing index entry // is different from old-rowid if isUpdate != 0 { Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regR, addrUniqueOk, regOldData) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } } else { @@ -102599,7 +103917,7 @@ __1: x = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(x))) Xsqlite3VdbeAddOp4(tls, v, op, ((regOldData + 1) + x), addrJump, (regCmp + i), p4, -2) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } } @@ -102622,7 +103940,7 @@ __1: } case OE_Update: { - Xsqlite3UpsertDoUpdate(tls, pParse, pUpsert, pTab, pIdx, (iIdxCur + ix)) + Xsqlite3UpsertDoUpdate(tls, pParse, pUpsert, pTab, pIdx, (iIdxCur + *(*int32)(unsafe.Pointer(bp + 40 /* ix */)))) } fallthrough @@ -102647,12 +103965,12 @@ __1: Xsqlite3VdbeAddOp1(tls, v, OP_CursorLock, iDataCur) } Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur, - regR, int16(nPkField), uint8(0), OE_Replace, + regR, int16(nPkField), uint8(0), uint8(OE_Replace), func() uint8 { if pIdx == pPk { - return ONEPASS_SINGLE + return uint8(ONEPASS_SINGLE) } - return ONEPASS_OFF + return uint8(ONEPASS_OFF) }(), iThisCur) if (pTrigger != 0) && (isUpdate != 0) { Xsqlite3VdbeAddOp1(tls, v, OP_CursorUnlock, iDataCur) @@ -102678,27 +103996,27 @@ __1: // the constraint-ok jump destination to be the address of // the next retest block for nConflictCk > 0 { - // var x VdbeOp at bp+16, 24 + // var x VdbeOp at bp+48, 24 // Conflict check opcode to copy // The sqlite3VdbeAddOp4() call might reallocate the opcode array. // Hence, make a complete copy of the opcode, rather than using // a pointer to the opcode. - *(*VdbeOp)(unsafe.Pointer(bp + 16 /* x */)) = *(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, addrConflictCk))) - if int32((*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fopcode) != OP_IdxRowid { + *(*VdbeOp)(unsafe.Pointer(bp + 48 /* x */)) = *(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, addrConflictCk))) + if int32((*VdbeOp)(unsafe.Pointer(bp+48 /* &x */)).Fopcode) != OP_IdxRowid { var p2 int32 // New P2 value for copied conflict check opcode var zP4 uintptr - if (int32(Xsqlite3OpcodeProperty[(*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fopcode]) & OPFLG_JUMP) != 0 { + if (int32(Xsqlite3OpcodeProperty[(*VdbeOp)(unsafe.Pointer(bp+48 /* &x */)).Fopcode]) & OPFLG_JUMP) != 0 { p2 = lblRecheckOk } else { - p2 = (*VdbeOp)(unsafe.Pointer(bp + 16 /* &x */)).Fp2 + p2 = (*VdbeOp)(unsafe.Pointer(bp + 48 /* &x */)).Fp2 } - if int32((*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fp4type) == (-3) { - zP4 = uintptr(int64(*(*int32)(unsafe.Pointer(bp + 16 /* &x */ + 16 /* &.p4 */)))) + if int32((*VdbeOp)(unsafe.Pointer(bp+48 /* &x */)).Fp4type) == (-3) { + zP4 = uintptr(int64(*(*int32)(unsafe.Pointer(bp + 48 /* &x */ + 16 /* &.p4 */)))) } else { - zP4 = *(*uintptr)(unsafe.Pointer(bp + 16 /* &x */ + 16 /* &.p4 */)) + zP4 = *(*uintptr)(unsafe.Pointer(bp + 48 /* &x */ + 16 /* &.p4 */)) } - Xsqlite3VdbeAddOp4(tls, v, int32((*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fopcode), (*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fp1, p2, (*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fp3, zP4, int32((*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fp4type)) - Xsqlite3VdbeChangeP5(tls, v, (*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fp5) + Xsqlite3VdbeAddOp4(tls, v, int32((*VdbeOp)(unsafe.Pointer(bp+48 /* &x */)).Fopcode), (*VdbeOp)(unsafe.Pointer(bp+48 /* &x */)).Fp1, p2, (*VdbeOp)(unsafe.Pointer(bp+48 /* &x */)).Fp3, zP4, int32((*VdbeOp)(unsafe.Pointer(bp+48 /* &x */)).Fp4type)) + Xsqlite3VdbeChangeP5(tls, v, (*VdbeOp)(unsafe.Pointer(bp+48 /* &x */)).Fp5) } nConflictCk-- @@ -102714,25 +104032,18 @@ __1: } } - if pUpIdx == pIdx { - Xsqlite3VdbeGoto(tls, v, (upsertJump + 1)) - Xsqlite3VdbeJumpHere(tls, v, upsertBypass) - } else { - Xsqlite3VdbeResolveLabel(tls, v, addrUniqueOk) - } + Xsqlite3VdbeResolveLabel(tls, v, addrUniqueOk) if regR != regIdx { Xsqlite3ReleaseTempRange(tls, pParse, regR, nPkField) } - + if ((pUpsertClause != 0) && + (upsertIpkReturn != 0)) && + (Xsqlite3UpsertNextIsIPK(tls, pUpsertClause) != 0) { + Xsqlite3VdbeGoto(tls, v, (upsertIpkDelay + 1)) + Xsqlite3VdbeJumpHere(tls, v, upsertIpkReturn) + upsertIpkReturn = 0 + } } - goto __2 -__2: - pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext - ix++ - goto __1 - goto __3 -__3: - ; // If the IPK constraint is a REPLACE, run it last if ipkTop != 0 { @@ -102749,7 +104060,7 @@ __3: if !(pPk != 0) { if isUpdate != 0 { Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regNewData, addrRecheck, regOldData) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, addrRecheck, regNewData) @@ -102762,8 +104073,8 @@ __3: } // Generate the table record - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { - var regRec int32 = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(ix)*4)) + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + var regRec int32 = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 40 /* ix */)))*4)) Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (regNewData + 1), int32((*Table)(unsafe.Pointer(pTab)).FnNVCol), regRec) if !(bAffinityDone != 0) { @@ -102775,6 +104086,20 @@ __3: } +// Table pTab is a WITHOUT ROWID table that is being written to. The cursor +// number is iCur, and register regData contains the new record for the +// PK index. This function adds code to invoke the pre-update hook, +// if one is registered. +func codeWithoutRowidPreupdate(tls *libc.TLS, pParse uintptr, pTab uintptr, iCur int32, regData int32) { /* sqlite3.c:124511:13: */ + var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe + var r int32 = Xsqlite3GetTempReg(tls, pParse) + + Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, r) + Xsqlite3VdbeAddOp4(tls, v, OP_Insert, iCur, regData, r, pTab, -6) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_ISNOOP)) + Xsqlite3ReleaseTempReg(tls, pParse, r) +} + // 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 @@ -102782,13 +104107,13 @@ __3: // // The arguments to this routine should be the same as the first six // arguments to sqlite3GenerateConstraintChecks. -func Xsqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, regNewData int32, aRegIdx uintptr, update_flags int32, appendBias int32, useSeekResult int32) { /* sqlite3.c:122839:21: */ +func Xsqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, regNewData int32, aRegIdx uintptr, update_flags int32, appendBias int32, useSeekResult int32) { /* sqlite3.c:124539:21: */ var v uintptr // Prepared statements under construction var pIdx uintptr // An index being inserted or updated var pik_flags U8 // flag values passed to the btree insert var i int32 // Loop counter - v = Xsqlite3GetVdbe(tls, pParse) + v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // This table is not a VIEW i = 0 @@ -102809,21 +104134,16 @@ __1: } pik_flags = func() uint8 { if useSeekResult != 0 { - return OPFLAG_USESEEKRESULT + return uint8(OPFLAG_USESEEKRESULT) } return uint8(0) }() - if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { pik_flags = U8(int32(pik_flags) | (OPFLAG_NCHANGE)) pik_flags = U8(int32(pik_flags) | (update_flags & OPFLAG_SAVEPOSITION)) if update_flags == 0 { - var r int32 = Xsqlite3GetTempReg(tls, pParse) - Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, r) - Xsqlite3VdbeAddOp4(tls, v, OP_Insert, - (iIdxCur + i), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), r, pTab, -6) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_ISNOOP) - Xsqlite3ReleaseTempReg(tls, pParse, r) + codeWithoutRowidPreupdate(tls, pParse, pTab, (iIdxCur + i), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4))) } } Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, (iIdxCur + i), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), @@ -102845,13 +104165,13 @@ __2: goto __3 __3: ; - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { return } if (*Parse)(unsafe.Pointer(pParse)).Fnested != 0 { pik_flags = U8(0) } else { - pik_flags = OPFLAG_NCHANGE + pik_flags = U8(OPFLAG_NCHANGE) pik_flags = U8(int32(pik_flags) | (func() int32 { if update_flags != 0 { return update_flags @@ -102891,7 +104211,7 @@ __3: // // If pTab is a virtual table, then this routine is a no-op and the // *piDataCur and *piIdxCur values are left uninitialized. -func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, p5 U8, iBase int32, aToOpen uintptr, piDataCur uintptr, piIdxCur uintptr) int32 { /* sqlite3.c:122936:20: */ +func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, p5 U8, iBase int32, aToOpen uintptr, piDataCur uintptr, piIdxCur uintptr) int32 { /* sqlite3.c:124628:20: */ var i int32 var iDb int32 var iDataCur int32 @@ -102905,7 +104225,7 @@ func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op return 0 } iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema) - v = Xsqlite3GetVdbe(tls, pParse) + v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe if iBase < 0 { iBase = (*Parse)(unsafe.Pointer(pParse)).FnTab @@ -102914,7 +104234,7 @@ func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op if piDataCur != 0 { *(*int32)(unsafe.Pointer(piDataCur)) = iDataCur } - if (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((aToOpen == uintptr(0)) || (*(*U8)(unsafe.Pointer(aToOpen)) != 0)) { + if (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((aToOpen == uintptr(0)) || (*(*U8)(unsafe.Pointer(aToOpen)) != 0)) { Xsqlite3OpenTable(tls, pParse, iDataCur, iDb, pTab, op) } else { Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, (uint8(libc.Bool32(op == OP_OpenWrite))), (*Table)(unsafe.Pointer(pTab)).FzName) @@ -102931,7 +104251,7 @@ __1: { var iIdxCur int32 = libc.PostIncInt32(&iBase, 1) - if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { if piDataCur != 0 { *(*int32)(unsafe.Pointer(piDataCur)) = iIdxCur } @@ -102968,7 +104288,7 @@ __3: // * 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 *libc.TLS, pDest uintptr, pSrc uintptr) int32 { /* sqlite3.c:123014:12: */ +func xferCompatibleIndex(tls *libc.TLS, pDest uintptr, pSrc uintptr) int32 { /* sqlite3.c:124706:12: */ var i int32 if (int32((*Index)(unsafe.Pointer(pDest)).FnKeyCol) != int32((*Index)(unsafe.Pointer(pSrc)).FnKeyCol)) || (int32((*Index)(unsafe.Pointer(pDest)).FnColumn) != int32((*Index)(unsafe.Pointer(pSrc)).FnColumn)) { @@ -103026,7 +104346,7 @@ func xferCompatibleIndex(tls *libc.TLS, pDest uintptr, pSrc uintptr) int32 { /* // is no chance that the xfer optimization can be applied. // // This optimization is particularly useful at making VACUUM run faster. -func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uintptr, onError int32, iDbDest int32) int32 { /* sqlite3.c:123075:12: */ +func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uintptr, onError int32, iDbDest int32) int32 { /* sqlite3.c:124767:12: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pEList uintptr // The result set of the SELECT var pSrc uintptr // The table in the FROM clause of SELECT @@ -103074,7 +104394,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint if (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpSrc)).FnSrc != 1 { return 0 // FROM clause must have exactly one term } - if (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpSrc + 8 /* &.a */))).FpSelect != 0 { + if (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpSrc + 8 /* &.a */))).FpSelect != 0 { return 0 // FROM clause cannot contain a subquery } if (*Select)(unsafe.Pointer(pSelect)).FpWhere != 0 { @@ -103094,7 +104414,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint if (*Select)(unsafe.Pointer(pSelect)).FpPrior != 0 { return 0 // SELECT may not be a compound query } - if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & SF_Distinct) != 0 { + if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_Distinct)) != 0 { return 0 // SELECT may not be DISTINCT } pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList @@ -103119,7 +104439,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint // Possible due to bad sqlite_schema.rootpage return 0 // tab1 and tab2 may not be the same table } - if (libc.Bool32(((*Table)(unsafe.Pointer((pDest))).FtabFlags & TF_WithoutRowid) == U32(0))) != (libc.Bool32(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if (libc.Bool32(((*Table)(unsafe.Pointer((pDest))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) != (libc.Bool32(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { return 0 // source and destination must both be WITHOUT ROWID or not } if (*Table)(unsafe.Pointer(pSrc)).FnModuleArg != 0 { @@ -103212,7 +104532,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint // command, and the VACUUM command disables foreign key constraints. So // the extra complication to make this rule less restrictive is probably // not worth the effort. Ticket [6284df89debdfa61db8073e062908af0c9b6118e] - if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != uint64(0)) && ((*Table)(unsafe.Pointer(pDest)).FpFKey != uintptr(0)) { + if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != uint64(0)) && ((*Table)(unsafe.Pointer(pDest)).FpFKey != uintptr(0)) { return 0 } if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0) { @@ -103229,10 +104549,11 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint iDest = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) regAutoinc = autoIncBegin(tls, pParse, iDbDest, pDest) regData = Xsqlite3GetTempReg(tls, pParse) + Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regData) regRowid = Xsqlite3GetTempReg(tls, pParse) Xsqlite3OpenTable(tls, pParse, iDest, iDbDest, pDest, OP_OpenWrite) - if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_Vacuum) == U32(0)) && ((((int32((*Table)(unsafe.Pointer(pDest)).FiPKey) < 0) && ((*Table)(unsafe.Pointer(pDest)).FpIndex != uintptr(0))) || // (1) + if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0)) && ((((int32((*Table)(unsafe.Pointer(pDest)).FiPKey) < 0) && ((*Table)(unsafe.Pointer(pDest)).FpIndex != uintptr(0))) || // (1) (destHasUniqueIdx != 0)) || // (2) ((onError != OE_Abort) && (onError != OE_Rollback))) { // In some circumstances, we are able to run the xfer optimization @@ -103255,34 +104576,45 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint emptyDestTest = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) Xsqlite3VdbeJumpHere(tls, v, addr1) } - if ((*Table)(unsafe.Pointer((pSrc))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { var insFlags U8 Xsqlite3OpenTable(tls, pParse, iSrc, iDbSrc, pSrc, OP_OpenRead) emptySrcTest = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iSrc, 0) if int32((*Table)(unsafe.Pointer(pDest)).FiPKey) >= 0 { addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iSrc, regRowid) + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0) { - addr2 = Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDest, 0, regRowid) + addr2 = Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDest, 0, regRowid) - Xsqlite3RowidConstraint(tls, pParse, onError, pDest) - Xsqlite3VdbeJumpHere(tls, v, addr2) + Xsqlite3RowidConstraint(tls, pParse, onError, pDest) + Xsqlite3VdbeJumpHere(tls, v, addr2) + } autoIncStep(tls, pParse, regAutoinc, regRowid) - } else if ((*Table)(unsafe.Pointer(pDest)).FpIndex == uintptr(0)) && !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_VacuumInto) != 0) { + } else if ((*Table)(unsafe.Pointer(pDest)).FpIndex == uintptr(0)) && !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_VacuumInto)) != 0) { addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iDest, regRowid) } else { addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iSrc, regRowid) } - if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_Vacuum) != 0 { + + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) != 0 { Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iDest) - insFlags = (U8(OPFLAG_APPEND | OPFLAG_USESEEKRESULT)) + insFlags = (U8((OPFLAG_APPEND | OPFLAG_USESEEKRESULT) | OPFLAG_PREFORMAT)) } else { - insFlags = (U8((OPFLAG_NCHANGE | OPFLAG_LASTROWID) | OPFLAG_APPEND)) + insFlags = (U8(((OPFLAG_NCHANGE | OPFLAG_LASTROWID) | OPFLAG_APPEND) | OPFLAG_PREFORMAT)) + } + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0) { + Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1) + insFlags = libc.Uint8FromInt32(int32(insFlags) & (libc.CplInt32(OPFLAG_PREFORMAT))) + } else { + Xsqlite3VdbeAddOp3(tls, v, OP_RowCell, iDest, iSrc, regRowid) + } + Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iDest, regData, regRowid) + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0) { + Xsqlite3VdbeChangeP4(tls, v, -1, pDest, -6) } - Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1) - Xsqlite3VdbeAddOp4(tls, v, OP_Insert, iDest, regData, regRowid, - pDest, -6) Xsqlite3VdbeChangeP5(tls, v, uint16(insFlags)) + Xsqlite3VdbeAddOp2(tls, v, OP_Next, iSrc, addr1) Xsqlite3VdbeAddOp2(tls, v, OP_Close, iSrc, 0) Xsqlite3VdbeAddOp2(tls, v, OP_Close, iDest, 0) @@ -103303,10 +104635,10 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint Xsqlite3VdbeAddOp3(tls, v, OP_OpenWrite, iDest, int32((*Index)(unsafe.Pointer(pDestIdx)).Ftnum), iDbDest) Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pDestIdx) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_BULKCSR) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_BULKCSR)) addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iSrc, 0) - if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_Vacuum) != 0 { + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) != 0 { // This INSERT command is part of a VACUUM operation, which guarantees // that the destination table is empty. If all indexed columns use // collation sequence BINARY, then it can also be assumed that the @@ -103328,13 +104660,21 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint } } if i == int32((*Index)(unsafe.Pointer(pSrcIdx)).FnColumn) { - idxInsFlags = OPFLAG_USESEEKRESULT + idxInsFlags = (U8(OPFLAG_USESEEKRESULT | OPFLAG_PREFORMAT)) Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iDest) + Xsqlite3VdbeAddOp2(tls, v, OP_RowCell, iDest, iSrc) } - } else if !(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer(pDestIdx + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + } else if !(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer(pDestIdx + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { idxInsFlags = U8(int32(idxInsFlags) | (OPFLAG_NCHANGE)) } - Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1) + if int32(idxInsFlags) != (OPFLAG_USESEEKRESULT | OPFLAG_PREFORMAT) { + Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1) + if ((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0)) && + !(((*Table)(unsafe.Pointer((pDest))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) && + ((int32(*(*uint16)(unsafe.Pointer((pDestIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + codeWithoutRowidPreupdate(tls, pParse, pDest, iDest, regData) + } + } Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, iDest, regData) Xsqlite3VdbeChangeP5(tls, v, (uint16(int32(idxInsFlags) | OPFLAG_APPEND))) Xsqlite3VdbeAddOp2(tls, v, OP_Next, iSrc, (addr1 + 1)) @@ -103386,7 +104726,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint // 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 *libc.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_callback, pArg uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:123461:16: */ +func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_callback, pArg uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:125177:16: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -103407,7 +104747,7 @@ func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_ca if !(!(Xsqlite3SafetyCheckOk(tls, db) != 0)) { goto __1 } - return Xsqlite3MisuseError(tls, 123474) + return Xsqlite3MisuseError(tls, 125190) __1: ; if !(zSql == uintptr(0)) { @@ -103453,7 +104793,7 @@ __7: // Invoke the callback function if required if !((xCallback != 0) && ((SQLITE_ROW == rc) || (((SQLITE_DONE == rc) && !(callbackIsInit != 0)) && - (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_NullCallback) != 0)))) { + (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NullCallback)) != 0)))) { goto __9 } if !(!(callbackIsInit != 0)) { @@ -103594,7 +104934,7 @@ __26: // This is the function signature used for all extension entry points. It // is also defined in the file "loadext.c". -type Sqlite3_loadext_entry = uintptr /* sqlite3.c:123939:13 */ +type Sqlite3_loadext_entry = uintptr /* sqlite3.c:125657:13 */ // The following macros redefine the API routines so that they are // redirected through the global sqlite3_api structure. @@ -103914,7 +105254,9 @@ var sqlite3Apis = Sqlite3_api_routines{ Fcreate_filename: 0, Ffree_filename: 0, Fdatabase_file_object: 0, -} /* sqlite3.c:124371:35 */ + // Version 3.34.0 and later + Ftxn_state: 0, +} /* sqlite3.c:126091:35 */ // True if x is the directory separator character @@ -103928,7 +105270,7 @@ var sqlite3Apis = Sqlite3_api_routines{ // 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 *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:124741:12: */ +func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:126463:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -103953,9 +105295,9 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt // must call either sqlite3_enable_load_extension(db) or // sqlite3_db_config(db, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, 0) // to turn on extension loading. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LoadExtension) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LoadExtension)) == uint64(0) { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+9998 /* "not authorized" */, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+10363 /* "not authorized" */, 0) } return SQLITE_ERROR } @@ -103963,12 +105305,12 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt if zProc != 0 { zEntry = zProc } else { - zEntry = ts + 13510 /* "sqlite3_extensio..." */ + zEntry = ts + 13939 /* "sqlite3_extensio..." */ } handle = Xsqlite3OsDlOpen(tls, pVfs, zFile) for ii = 0; (ii < (int32(uint64(unsafe.Sizeof(azEndings)) / uint64(unsafe.Sizeof(uintptr(0)))))) && (handle == uintptr(0)); ii++ { - var zAltFile uintptr = Xsqlite3_mprintf(tls, ts+9959 /* "%s.%s" */, libc.VaList(bp, zFile, azEndings[ii])) + var zAltFile uintptr = Xsqlite3_mprintf(tls, ts+10324 /* "%s.%s" */, libc.VaList(bp, zFile, azEndings[ii])) if zAltFile == uintptr(0) { return SQLITE_NOMEM } @@ -103980,7 +105322,7 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt *(*uintptr)(unsafe.Pointer(pzErrMsg)) = libc.AssignPtrUintptr(bp+48 /* zErrmsg */, Xsqlite3_malloc64(tls, nMsg)) if *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)) != 0 { Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)), - ts+13533 /* "unable to open s..." */, libc.VaList(bp+16, zFile)) + ts+13962 /* "unable to open s..." */, libc.VaList(bp+16, zFile)) Xsqlite3OsDlError(tls, pVfs, (int32(nMsg - uint64(1))), *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */))) } } @@ -104008,11 +105350,11 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt Xsqlite3OsDlClose(tls, pVfs, handle) return SQLITE_NOMEM } - libc.Xmemcpy(tls, zAltEntry, ts+13568 /* "sqlite3_" */, uint64(8)) + libc.Xmemcpy(tls, zAltEntry, ts+13997 /* "sqlite3_" */, uint64(8)) for iFile = (ncFile - 1); (iFile >= 0) && !((int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile))))) == '/'); iFile-- { } iFile++ - if Xsqlite3_strnicmp(tls, (zFile+uintptr(iFile)), ts+13577 /* "lib" */, 3) == 0 { + if Xsqlite3_strnicmp(tls, (zFile+uintptr(iFile)), ts+14006 /* "lib" */, 3) == 0 { iFile = iFile + (3) } for iEntry = 8; ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))))) != 0) && (c != '.'); iFile++ { @@ -104020,7 +105362,7 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt *(*int8)(unsafe.Pointer(zAltEntry + uintptr(libc.PostIncInt32(&iEntry, 1)))) = int8(Xsqlite3UpperToLower[uint32(c)]) } } - libc.Xmemcpy(tls, (zAltEntry + uintptr(iEntry)), ts+13581 /* "_init" */, uint64(6)) + libc.Xmemcpy(tls, (zAltEntry + uintptr(iEntry)), ts+14010 /* "_init" */, uint64(6)) zEntry = zAltEntry xInit = Xsqlite3OsDlSym(tls, pVfs, handle, zEntry) } @@ -104030,7 +105372,7 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt *(*uintptr)(unsafe.Pointer(pzErrMsg)) = libc.AssignPtrUintptr(bp+48 /* zErrmsg */, Xsqlite3_malloc64(tls, nMsg)) if *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)) != 0 { Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)), - ts+13587 /* "no entry point [..." */, libc.VaList(bp+24, zEntry, zFile)) + ts+14016 /* "no entry point [..." */, libc.VaList(bp+24, zEntry, zFile)) Xsqlite3OsDlError(tls, pVfs, (int32(nMsg - uint64(1))), *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */))) } } @@ -104045,7 +105387,7 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+13630 /* "error during ini..." */, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+14059 /* "error during ini..." */, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */))) Xsqlite3OsDlClose(tls, pVfs, handle) @@ -104068,10 +105410,10 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt } var azEndings = [1]uintptr{ - ts + 13662, /* "so" */ -} /* sqlite3.c:124759:21 */ + ts + 14091, /* "so" */ +} /* sqlite3.c:126481:21 */ -func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:124882:16: */ +func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:126604:16: */ var rc int32 Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) rc = sqlite3LoadExtension(tls, db, zFile, zProc, pzErrMsg) @@ -104082,7 +105424,7 @@ func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uin // Call this routine when the database connection is closing in order // to clean up loaded extensions -func Xsqlite3CloseExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:124900:21: */ +func Xsqlite3CloseExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:126622:21: */ var i int32 for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnExtension; i++ { @@ -104093,7 +105435,7 @@ func Xsqlite3CloseExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:124900:21 // 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 *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:124913:16: */ +func Xsqlite3_enable_load_extension(tls *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:126635:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if onoff != 0 { *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_LoadExtension | SQLITE_LoadExtFunc)) @@ -104113,15 +105455,15 @@ type sqlite3AutoExtList = struct { FnExt U32 _ [4]byte FaExt uintptr -} /* sqlite3.c:124933:9 */ +} /* sqlite3.c:126655:9 */ // The following object holds the list of automatically loaded // extensions. // // This list is shared across threads. The SQLITE_MUTEX_STATIC_MAIN // mutex must be held while accessing this list. -type Sqlite3AutoExtList = sqlite3AutoExtList /* sqlite3.c:124933:35 */ -var sqlite3Autoext = sqlite3AutoExtList{} /* sqlite3.c:124937:3 */ +type Sqlite3AutoExtList = sqlite3AutoExtList /* sqlite3.c:126655:35 */ +var sqlite3Autoext = sqlite3AutoExtList{} /* sqlite3.c:126659:3 */ // The "wsdAutoext" macro will resolve to the autoextension // state vector. If writable static data is unsupported on the target, @@ -104131,7 +105473,7 @@ var sqlite3Autoext = sqlite3AutoExtList{} /* sqlite3.c:124937:3 */ // Register a statically linked extension that is automatically // loaded by every new database connection. -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:124959:16: */ +func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:126681:16: */ var rc int32 = SQLITE_OK rc = Xsqlite3_initialize(tls) if rc != 0 { @@ -104172,7 +105514,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c: // // 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 *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:125006:16: */ +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:126728:16: */ var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN) var i int32 var n int32 = 0 @@ -104191,7 +105533,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sql } // Reset the automatic extension loading mechanism. -func Xsqlite3_reset_auto_extension(tls *libc.TLS) { /* sqlite3.c:125031:17: */ +func Xsqlite3_reset_auto_extension(tls *libc.TLS) { /* sqlite3.c:126753:17: */ if Xsqlite3_initialize(tls) == SQLITE_OK { var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN) @@ -104206,7 +105548,7 @@ func Xsqlite3_reset_auto_extension(tls *libc.TLS) { /* sqlite3.c:125031:17: */ // Load all automatic extensions. // // If anything goes wrong, set an error in the database connection. -func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:125053:21: */ +func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:126775:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -104235,7 +105577,7 @@ func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:125053 *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */)) = uintptr(0) if (xInit != 0) && ((libc.AssignInt32(&rc, (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&xInit)))(tls, db, bp+8 /* &zErrmsg */, pThunk))) != 0) { Xsqlite3ErrorWithMsg(tls, db, rc, - ts+13665 /* "automatic extens..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */)))) + ts+14094 /* "automatic extens..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */))) @@ -104280,62 +105622,62 @@ func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:125053 // or that return single-column results where the name of the // result column is different from the name of the pragma var pragCName = [51]uintptr{ - /* 0 */ ts + 4012, /* "id" */ // Used by: foreign_key_list - /* 1 */ ts + 13704, /* "seq" */ - /* 2 */ ts + 7333, /* "table" */ - /* 3 */ ts + 13708, /* "from" */ - /* 4 */ ts + 13713, /* "to" */ - /* 5 */ ts + 13716, /* "on_update" */ - /* 6 */ ts + 13726, /* "on_delete" */ - /* 7 */ ts + 13736, /* "match" */ - /* 8 */ ts + 13742, /* "cid" */ // Used by: table_xinfo - /* 9 */ ts + 13746, /* "name" */ - /* 10 */ ts + 13751, /* "type" */ - /* 11 */ ts + 13756, /* "notnull" */ - /* 12 */ ts + 13764, /* "dflt_value" */ - /* 13 */ ts + 13775, /* "pk" */ - /* 14 */ ts + 13778, /* "hidden" */ + /* 0 */ ts + 4040, /* "id" */ // Used by: foreign_key_list + /* 1 */ ts + 14133, /* "seq" */ + /* 2 */ ts + 7386, /* "table" */ + /* 3 */ ts + 14137, /* "from" */ + /* 4 */ ts + 14142, /* "to" */ + /* 5 */ ts + 14145, /* "on_update" */ + /* 6 */ ts + 14155, /* "on_delete" */ + /* 7 */ ts + 14165, /* "match" */ + /* 8 */ ts + 14171, /* "cid" */ // Used by: table_xinfo + /* 9 */ ts + 14175, /* "name" */ + /* 10 */ ts + 14180, /* "type" */ + /* 11 */ ts + 14185, /* "notnull" */ + /* 12 */ ts + 14193, /* "dflt_value" */ + /* 13 */ ts + 14204, /* "pk" */ + /* 14 */ ts + 14207, /* "hidden" */ // table_info reuses 8 - /* 15 */ ts + 13785, /* "seqno" */ // Used by: index_xinfo - /* 16 */ ts + 13742, /* "cid" */ - /* 17 */ ts + 13746, /* "name" */ - /* 18 */ ts + 13791, /* "desc" */ - /* 19 */ ts + 13796, /* "coll" */ - /* 20 */ ts + 13801, /* "key" */ - /* 21 */ ts + 13746, /* "name" */ // Used by: function_list - /* 22 */ ts + 13805, /* "builtin" */ - /* 23 */ ts + 13751, /* "type" */ - /* 24 */ ts + 13813, /* "enc" */ - /* 25 */ ts + 13817, /* "narg" */ - /* 26 */ ts + 13822, /* "flags" */ - /* 27 */ ts + 9384, /* "tbl" */ // Used by: stats - /* 28 */ ts + 9380, /* "idx" */ - /* 29 */ ts + 13828, /* "wdth" */ - /* 30 */ ts + 13833, /* "hght" */ - /* 31 */ ts + 13838, /* "flgs" */ - /* 32 */ ts + 13704, /* "seq" */ // Used by: index_list - /* 33 */ ts + 13746, /* "name" */ - /* 34 */ ts + 13843, /* "unique" */ - /* 35 */ ts + 13850, /* "origin" */ - /* 36 */ ts + 13857, /* "partial" */ - /* 37 */ ts + 7333, /* "table" */ // Used by: foreign_key_check - /* 38 */ ts + 13865, /* "rowid" */ - /* 39 */ ts + 4015, /* "parent" */ - /* 40 */ ts + 13871, /* "fkid" */ + /* 15 */ ts + 14214, /* "seqno" */ // Used by: index_xinfo + /* 16 */ ts + 14171, /* "cid" */ + /* 17 */ ts + 14175, /* "name" */ + /* 18 */ ts + 14220, /* "desc" */ + /* 19 */ ts + 14225, /* "coll" */ + /* 20 */ ts + 14230, /* "key" */ + /* 21 */ ts + 14175, /* "name" */ // Used by: function_list + /* 22 */ ts + 14234, /* "builtin" */ + /* 23 */ ts + 14180, /* "type" */ + /* 24 */ ts + 14242, /* "enc" */ + /* 25 */ ts + 14246, /* "narg" */ + /* 26 */ ts + 14251, /* "flags" */ + /* 27 */ ts + 9749, /* "tbl" */ // Used by: stats + /* 28 */ ts + 9745, /* "idx" */ + /* 29 */ ts + 14257, /* "wdth" */ + /* 30 */ ts + 14262, /* "hght" */ + /* 31 */ ts + 14267, /* "flgs" */ + /* 32 */ ts + 14133, /* "seq" */ // Used by: index_list + /* 33 */ ts + 14175, /* "name" */ + /* 34 */ ts + 14272, /* "unique" */ + /* 35 */ ts + 14279, /* "origin" */ + /* 36 */ ts + 14286, /* "partial" */ + /* 37 */ ts + 7386, /* "table" */ // Used by: foreign_key_check + /* 38 */ ts + 14294, /* "rowid" */ + /* 39 */ ts + 4043, /* "parent" */ + /* 40 */ ts + 14300, /* "fkid" */ // index_info reuses 15 - /* 41 */ ts + 13704, /* "seq" */ // Used by: database_list - /* 42 */ ts + 13746, /* "name" */ - /* 43 */ ts + 13876, /* "file" */ - /* 44 */ ts + 13881, /* "busy" */ // Used by: wal_checkpoint - /* 45 */ ts + 13886, /* "log" */ - /* 46 */ ts + 13890, /* "checkpointed" */ + /* 41 */ ts + 14133, /* "seq" */ // Used by: database_list + /* 42 */ ts + 14175, /* "name" */ + /* 43 */ ts + 14305, /* "file" */ + /* 44 */ ts + 14310, /* "busy" */ // Used by: wal_checkpoint + /* 45 */ ts + 14315, /* "log" */ + /* 46 */ ts + 14319, /* "checkpointed" */ // collation_list reuses 32 - /* 47 */ ts + 13903, /* "database" */ // Used by: lock_status - /* 48 */ ts + 13912, /* "status" */ - /* 49 */ ts + 13919, /* "cache_size" */ // Used by: default_cache_size + /* 47 */ ts + 14332, /* "database" */ // Used by: lock_status + /* 48 */ ts + 14341, /* "status" */ + /* 49 */ ts + 14348, /* "cache_size" */ // Used by: default_cache_size // module_list pragma_list reuses 9 - /* 50 */ ts + 13930, /* "timeout" */ // Used by: busy_timeout -} /* sqlite3.c:125193:19 */ + /* 50 */ ts + 14359, /* "timeout" */ // Used by: busy_timeout +} /* sqlite3.c:126915:19 */ // Definitions of all built-in pragmas type PragmaName1 = struct { @@ -104346,243 +105688,243 @@ type PragmaName1 = struct { FnPragCName U8 _ [4]byte FiArg U64 -} /* sqlite3.c:125252:9 */ +} /* sqlite3.c:126974:9 */ // Definitions of all built-in pragmas -type PragmaName = PragmaName1 /* sqlite3.c:125259:3 */ +type PragmaName = PragmaName1 /* sqlite3.c:126981:3 */ var aPragmaName = [65]PragmaName{ - { /* zName: */ FzName: ts + 13938, /* "analysis_limit" */ - /* ePragTyp: */ FePragTyp: PragTyp_ANALYSIS_LIMIT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, - { /* zName: */ FzName: ts + 13953, /* "application_id" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + { /* zName: */ FzName: ts + 14367, /* "analysis_limit" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_ANALYSIS_LIMIT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, + { /* zName: */ FzName: ts + 14382, /* "application_id" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_APPLICATION_ID}, - { /* zName: */ FzName: ts + 13968, /* "auto_vacuum" */ - /* ePragTyp: */ FePragTyp: PragTyp_AUTO_VACUUM, + /* iArg: */ FiArg: uint64(BTREE_APPLICATION_ID)}, + { /* zName: */ FzName: ts + 14397, /* "auto_vacuum" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_AUTO_VACUUM), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 13980, /* "automatic_index" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 14409, /* "automatic_index" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_AutoIndex}, - { /* zName: */ FzName: ts + 13996, /* "busy_timeout" */ - /* ePragTyp: */ FePragTyp: PragTyp_BUSY_TIMEOUT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* iArg: */ FiArg: uint64(SQLITE_AutoIndex)}, + { /* zName: */ FzName: ts + 14425, /* "busy_timeout" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_BUSY_TIMEOUT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(50), FnPragCName: U8(1)}, - { /* zName: */ FzName: ts + 13919, /* "cache_size" */ - /* ePragTyp: */ FePragTyp: PragTyp_CACHE_SIZE, + { /* zName: */ FzName: ts + 14348, /* "cache_size" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_CACHE_SIZE), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 14009, /* "cache_spill" */ - /* ePragTyp: */ FePragTyp: PragTyp_CACHE_SPILL, + { /* zName: */ FzName: ts + 14438, /* "cache_spill" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_CACHE_SPILL), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_Result0 | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 14021, /* "case_sensitive_l..." */ - /* ePragTyp: */ FePragTyp: PragTyp_CASE_SENSITIVE_LIKE, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns}, - { /* zName: */ FzName: ts + 14041, /* "cell_size_check" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 14450, /* "case_sensitive_l..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_CASE_SENSITIVE_LIKE), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns)}, + { /* zName: */ FzName: ts + 14470, /* "cell_size_check" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_CellSizeCk}, - { /* zName: */ FzName: ts + 14057, /* "checkpoint_fullf..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* iArg: */ FiArg: uint64(SQLITE_CellSizeCk)}, + { /* zName: */ FzName: ts + 14486, /* "checkpoint_fullf..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_CkptFullFSync}, - { /* zName: */ FzName: ts + 14078, /* "collation_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_COLLATION_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* iArg: */ FiArg: uint64(SQLITE_CkptFullFSync)}, + { /* zName: */ FzName: ts + 14507, /* "collation_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_COLLATION_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(32), FnPragCName: U8(2)}, - { /* zName: */ FzName: ts + 14093, /* "compile_options" */ - /* ePragTyp: */ FePragTyp: PragTyp_COMPILE_OPTIONS, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, - { /* zName: */ FzName: ts + 14109, /* "count_changes" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 14522, /* "compile_options" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_COMPILE_OPTIONS), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, + { /* zName: */ FzName: ts + 14538, /* "count_changes" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), /* iArg: */ FiArg: (U64((uint64(0x00001))) << 32)}, - { /* zName: */ FzName: ts + 14123, /* "data_version" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + { /* zName: */ FzName: ts + 14552, /* "data_version" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_ReadOnly | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_DATA_VERSION}, - { /* zName: */ FzName: ts + 14136, /* "database_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_DATABASE_LIST, + /* iArg: */ FiArg: uint64(BTREE_DATA_VERSION)}, + { /* zName: */ FzName: ts + 14565, /* "database_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_DATABASE_LIST), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NeedSchema | PragFlg_Result0)), /* ColNames: */ FiPragCName: U8(41), FnPragCName: U8(3)}, - { /* zName: */ FzName: ts + 14150, /* "default_cache_si..." */ - /* ePragTyp: */ FePragTyp: PragTyp_DEFAULT_CACHE_SIZE, + { /* zName: */ FzName: ts + 14579, /* "default_cache_si..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_DEFAULT_CACHE_SIZE), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1)), /* ColNames: */ FiPragCName: U8(49), FnPragCName: U8(1)}, - { /* zName: */ FzName: ts + 14169, /* "defer_foreign_ke..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 14598, /* "defer_foreign_ke..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_DeferFKs}, - { /* zName: */ FzName: ts + 14188, /* "empty_result_cal..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* iArg: */ FiArg: uint64(SQLITE_DeferFKs)}, + { /* zName: */ FzName: ts + 14617, /* "empty_result_cal..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_NullCallback}, - { /* zName: */ FzName: ts + 14211, /* "encoding" */ - /* ePragTyp: */ FePragTyp: PragTyp_ENCODING, + /* iArg: */ FiArg: uint64(SQLITE_NullCallback)}, + { /* zName: */ FzName: ts + 14640, /* "encoding" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_ENCODING), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 14220, /* "foreign_key_chec..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FOREIGN_KEY_CHECK, + { /* zName: */ FzName: ts + 14649, /* "foreign_key_chec..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FOREIGN_KEY_CHECK), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(37), FnPragCName: U8(4)}, - { /* zName: */ FzName: ts + 14238, /* "foreign_key_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_FOREIGN_KEY_LIST, + { /* zName: */ FzName: ts + 14667, /* "foreign_key_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FOREIGN_KEY_LIST), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), FnPragCName: U8(8)}, - { /* zName: */ FzName: ts + 14255, /* "foreign_keys" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 14684, /* "foreign_keys" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ForeignKeys}, - { /* zName: */ FzName: ts + 14268, /* "freelist_count" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* iArg: */ FiArg: uint64(SQLITE_ForeignKeys)}, + { /* zName: */ FzName: ts + 14697, /* "freelist_count" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_ReadOnly | PragFlg_Result0))}, - { /* zName: */ FzName: ts + 14283, /* "full_column_name..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 14712, /* "full_column_name..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_FullColNames}, - { /* zName: */ FzName: ts + 14301, /* "fullfsync" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* iArg: */ FiArg: uint64(SQLITE_FullColNames)}, + { /* zName: */ FzName: ts + 14730, /* "fullfsync" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_FullFSync}, - { /* zName: */ FzName: ts + 14311, /* "function_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_FUNCTION_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* iArg: */ FiArg: uint64(SQLITE_FullFSync)}, + { /* zName: */ FzName: ts + 14740, /* "function_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FUNCTION_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(21), FnPragCName: U8(6)}, - { /* zName: */ FzName: ts + 14325, /* "hard_heap_limit" */ - /* ePragTyp: */ FePragTyp: PragTyp_HARD_HEAP_LIMIT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, - { /* zName: */ FzName: ts + 14341, /* "ignore_check_con..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 14754, /* "hard_heap_limit" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_HARD_HEAP_LIMIT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, + { /* zName: */ FzName: ts + 14770, /* "ignore_check_con..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_IgnoreChecks}, - { /* zName: */ FzName: ts + 14366, /* "incremental_vacu..." */ - /* ePragTyp: */ FePragTyp: PragTyp_INCREMENTAL_VACUUM, + /* iArg: */ FiArg: uint64(SQLITE_IgnoreChecks)}, + { /* zName: */ FzName: ts + 14795, /* "incremental_vacu..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_INCREMENTAL_VACUUM), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NeedSchema | PragFlg_NoColumns))}, - { /* zName: */ FzName: ts + 14385, /* "index_info" */ - /* ePragTyp: */ FePragTyp: PragTyp_INDEX_INFO, + { /* zName: */ FzName: ts + 14814, /* "index_info" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(15), FnPragCName: U8(3)}, - { /* zName: */ FzName: ts + 14396, /* "index_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_INDEX_LIST, + { /* zName: */ FzName: ts + 14825, /* "index_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_LIST), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(32), FnPragCName: U8(5)}, - { /* zName: */ FzName: ts + 14407, /* "index_xinfo" */ - /* ePragTyp: */ FePragTyp: PragTyp_INDEX_INFO, + { /* zName: */ FzName: ts + 14836, /* "index_xinfo" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(15), FnPragCName: U8(6), /* iArg: */ FiArg: uint64(1)}, - { /* zName: */ FzName: ts + 14419, /* "integrity_check" */ - /* ePragTyp: */ FePragTyp: PragTyp_INTEGRITY_CHECK, + { /* zName: */ FzName: ts + 14848, /* "integrity_check" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_INTEGRITY_CHECK), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1))}, - { /* zName: */ FzName: ts + 14435, /* "journal_mode" */ - /* ePragTyp: */ FePragTyp: PragTyp_JOURNAL_MODE, + { /* zName: */ FzName: ts + 14864, /* "journal_mode" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_JOURNAL_MODE), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))}, - { /* zName: */ FzName: ts + 14448, /* "journal_size_lim..." */ - /* ePragTyp: */ FePragTyp: PragTyp_JOURNAL_SIZE_LIMIT, + { /* zName: */ FzName: ts + 14877, /* "journal_size_lim..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_JOURNAL_SIZE_LIMIT), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_SchemaReq))}, - { /* zName: */ FzName: ts + 14467, /* "legacy_alter_tab..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 14896, /* "legacy_alter_tab..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_LegacyAlter}, - { /* zName: */ FzName: ts + 14486, /* "locking_mode" */ - /* ePragTyp: */ FePragTyp: PragTyp_LOCKING_MODE, + /* iArg: */ FiArg: uint64(SQLITE_LegacyAlter)}, + { /* zName: */ FzName: ts + 14915, /* "locking_mode" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_LOCKING_MODE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_SchemaReq))}, - { /* zName: */ FzName: ts + 14499, /* "max_page_count" */ - /* ePragTyp: */ FePragTyp: PragTyp_PAGE_COUNT, + { /* zName: */ FzName: ts + 14928, /* "max_page_count" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_COUNT), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))}, - { /* zName: */ FzName: ts + 14514, /* "mmap_size" */ - /* ePragTyp: */ FePragTyp: PragTyp_MMAP_SIZE}, - { /* zName: */ FzName: ts + 14524, /* "module_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_MODULE_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + { /* zName: */ FzName: ts + 14943, /* "mmap_size" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_MMAP_SIZE)}, + { /* zName: */ FzName: ts + 14953, /* "module_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_MODULE_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(9), FnPragCName: U8(1)}, - { /* zName: */ FzName: ts + 14536, /* "optimize" */ - /* ePragTyp: */ FePragTyp: PragTyp_OPTIMIZE, + { /* zName: */ FzName: ts + 14965, /* "optimize" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_OPTIMIZE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result1 | PragFlg_NeedSchema))}, - { /* zName: */ FzName: ts + 14545, /* "page_count" */ - /* ePragTyp: */ FePragTyp: PragTyp_PAGE_COUNT, + { /* zName: */ FzName: ts + 14974, /* "page_count" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_COUNT), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))}, - { /* zName: */ FzName: ts + 14556, /* "page_size" */ - /* ePragTyp: */ FePragTyp: PragTyp_PAGE_SIZE, + { /* zName: */ FzName: ts + 14985, /* "page_size" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_SIZE), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_Result0 | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 14566, /* "pragma_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_PRAGMA_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + { /* zName: */ FzName: ts + 14995, /* "pragma_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_PRAGMA_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(9), FnPragCName: U8(1)}, - { /* zName: */ FzName: ts + 14578, /* "query_only" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 15007, /* "query_only" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_QueryOnly}, - { /* zName: */ FzName: ts + 14589, /* "quick_check" */ - /* ePragTyp: */ FePragTyp: PragTyp_INTEGRITY_CHECK, + /* iArg: */ FiArg: uint64(SQLITE_QueryOnly)}, + { /* zName: */ FzName: ts + 15018, /* "quick_check" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_INTEGRITY_CHECK), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1))}, - { /* zName: */ FzName: ts + 14601, /* "read_uncommitted" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 15030, /* "read_uncommitted" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ReadUncommit}, - { /* zName: */ FzName: ts + 14618, /* "recursive_trigge..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* iArg: */ FiArg: uint64(SQLITE_ReadUncommit)}, + { /* zName: */ FzName: ts + 15047, /* "recursive_trigge..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_RecTriggers}, - { /* zName: */ FzName: ts + 14637, /* "reverse_unordere..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* iArg: */ FiArg: uint64(SQLITE_RecTriggers)}, + { /* zName: */ FzName: ts + 15066, /* "reverse_unordere..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ReverseOrder}, - { /* zName: */ FzName: ts + 14663, /* "schema_version" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* iArg: */ FiArg: uint64(SQLITE_ReverseOrder)}, + { /* zName: */ FzName: ts + 15092, /* "schema_version" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_SCHEMA_VERSION}, - { /* zName: */ FzName: ts + 14678, /* "secure_delete" */ - /* ePragTyp: */ FePragTyp: PragTyp_SECURE_DELETE, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, - { /* zName: */ FzName: ts + 14692, /* "short_column_nam..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* iArg: */ FiArg: uint64(BTREE_SCHEMA_VERSION)}, + { /* zName: */ FzName: ts + 15107, /* "secure_delete" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_SECURE_DELETE), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, + { /* zName: */ FzName: ts + 15121, /* "short_column_nam..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ShortColNames}, - { /* zName: */ FzName: ts + 14711, /* "shrink_memory" */ - /* ePragTyp: */ FePragTyp: PragTyp_SHRINK_MEMORY, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns}, - { /* zName: */ FzName: ts + 14725, /* "soft_heap_limit" */ - /* ePragTyp: */ FePragTyp: PragTyp_SOFT_HEAP_LIMIT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, - { /* zName: */ FzName: ts + 14741, /* "synchronous" */ - /* ePragTyp: */ FePragTyp: PragTyp_SYNCHRONOUS, + /* iArg: */ FiArg: uint64(SQLITE_ShortColNames)}, + { /* zName: */ FzName: ts + 15140, /* "shrink_memory" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_SHRINK_MEMORY), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns)}, + { /* zName: */ FzName: ts + 15154, /* "soft_heap_limit" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_SOFT_HEAP_LIMIT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, + { /* zName: */ FzName: ts + 15170, /* "synchronous" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_SYNCHRONOUS), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 14753, /* "table_info" */ - /* ePragTyp: */ FePragTyp: PragTyp_TABLE_INFO, + { /* zName: */ FzName: ts + 15182, /* "table_info" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_TABLE_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(8), FnPragCName: U8(6)}, - { /* zName: */ FzName: ts + 14764, /* "table_xinfo" */ - /* ePragTyp: */ FePragTyp: PragTyp_TABLE_INFO, + { /* zName: */ FzName: ts + 15193, /* "table_xinfo" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_TABLE_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(8), FnPragCName: U8(7), /* iArg: */ FiArg: uint64(1)}, - { /* zName: */ FzName: ts + 14776, /* "temp_store" */ - /* ePragTyp: */ FePragTyp: PragTyp_TEMP_STORE, + { /* zName: */ FzName: ts + 15205, /* "temp_store" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_TEMP_STORE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 14787, /* "temp_store_direc..." */ - /* ePragTyp: */ FePragTyp: PragTyp_TEMP_STORE_DIRECTORY, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns1}, - { /* zName: */ FzName: ts + 14808, /* "threads" */ - /* ePragTyp: */ FePragTyp: PragTyp_THREADS, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, - { /* zName: */ FzName: ts + 14816, /* "trusted_schema" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 15216, /* "temp_store_direc..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_TEMP_STORE_DIRECTORY), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns1)}, + { /* zName: */ FzName: ts + 15237, /* "threads" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_THREADS), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, + { /* zName: */ FzName: ts + 15245, /* "trusted_schema" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_TrustedSchema}, - { /* zName: */ FzName: ts + 14831, /* "user_version" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* iArg: */ FiArg: uint64(SQLITE_TrustedSchema)}, + { /* zName: */ FzName: ts + 15260, /* "user_version" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_USER_VERSION}, - { /* zName: */ FzName: ts + 14844, /* "wal_autocheckpoi..." */ - /* ePragTyp: */ FePragTyp: PragTyp_WAL_AUTOCHECKPOINT}, - { /* zName: */ FzName: ts + 14863, /* "wal_checkpoint" */ - /* ePragTyp: */ FePragTyp: PragTyp_WAL_CHECKPOINT, - /* ePragFlg: */ FmPragFlg: PragFlg_NeedSchema, + /* iArg: */ FiArg: uint64(BTREE_USER_VERSION)}, + { /* zName: */ FzName: ts + 15273, /* "wal_autocheckpoi..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_WAL_AUTOCHECKPOINT)}, + { /* zName: */ FzName: ts + 15292, /* "wal_checkpoint" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_WAL_CHECKPOINT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema), /* ColNames: */ FiPragCName: U8(44), FnPragCName: U8(3)}, - { /* zName: */ FzName: ts + 14878, /* "writable_schema" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 15307, /* "writable_schema" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), /* iArg: */ FiArg: (uint64(SQLITE_WriteSchema | SQLITE_NoSchemaError))}, -} /* sqlite3.c:125260:25 */ +} /* sqlite3.c:126982:25 */ // Number of pragmas: 67 on by default, 77 total. @@ -104598,7 +105940,7 @@ var aPragmaName = [65]PragmaName{ // 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 *libc.TLS, z uintptr, omitFull int32, dflt U8) U8 { /* sqlite3.c:125789:11: */ +func getSafetyLevel(tls *libc.TLS, z uintptr, omitFull int32, dflt U8) U8 { /* sqlite3.c:127511:11: */ // on no off false yes true extra full var i int32 var n int32 @@ -104615,13 +105957,13 @@ func getSafetyLevel(tls *libc.TLS, z uintptr, omitFull int32, dflt U8) U8 { /* s return dflt } -var zText = *(*[25]int8)(unsafe.Pointer(ts + 14894 /* "onoffalseyestrue..." */)) /* sqlite3.c:125791:21 */ -var iOffset = [8]U8{U8(0), U8(1), U8(2), U8(4), U8(9), U8(12), U8(15), U8(20)} /* sqlite3.c:125792:19 */ -var iLength = [8]U8{U8(2), U8(2), U8(3), U8(5), U8(3), U8(4), U8(5), U8(4)} /* sqlite3.c:125793:19 */ -var iValue = [8]U8{U8(1), U8(0), U8(0), U8(0), U8(1), U8(1), U8(3), U8(2)} /* sqlite3.c:125794:19 */ +var zText = *(*[25]int8)(unsafe.Pointer(ts + 15323 /* "onoffalseyestrue..." */)) /* sqlite3.c:127513:21 */ +var iOffset = [8]U8{U8(0), U8(1), U8(2), U8(4), U8(9), U8(12), U8(15), U8(20)} /* sqlite3.c:127514:19 */ +var iLength = [8]U8{U8(2), U8(2), U8(3), U8(5), U8(3), U8(4), U8(5), U8(4)} /* sqlite3.c:127515:19 */ +var iValue = [8]U8{U8(1), U8(0), U8(0), U8(0), U8(1), U8(1), U8(3), U8(2)} /* sqlite3.c:127516:19 */ // Interpret the given string as a boolean value. -func Xsqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt U8) U8 { /* sqlite3.c:125814:19: */ +func Xsqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt U8) U8 { /* sqlite3.c:127536:19: */ return (U8(libc.Bool32(int32(getSafetyLevel(tls, z, 1, dflt)) != 0))) } @@ -104630,12 +105972,12 @@ func Xsqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt U8) U8 { /* sqlite3.c:125 // the rest of the file if PRAGMAs are omitted from the build. // Interpret the given string as a locking mode value. -func getLockingMode(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:125827:12: */ +func getLockingMode(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:127549:12: */ if z != 0 { - if 0 == Xsqlite3StrICmp(tls, z, ts+14919 /* "exclusive" */) { + if 0 == Xsqlite3StrICmp(tls, z, ts+15348 /* "exclusive" */) { return PAGER_LOCKINGMODE_EXCLUSIVE } - if 0 == Xsqlite3StrICmp(tls, z, ts+14929 /* "normal" */) { + if 0 == Xsqlite3StrICmp(tls, z, ts+15358 /* "normal" */) { return PAGER_LOCKINGMODE_NORMAL } } @@ -104646,15 +105988,15 @@ func getLockingMode(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:125827:12: */ // // The following strings, "none", "full" and "incremental" are // acceptable, as are their numeric equivalents: 0, 1 and 2 respectively. -func getAutoVacuum(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:125842:12: */ +func getAutoVacuum(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:127564:12: */ var i int32 - if 0 == Xsqlite3StrICmp(tls, z, ts+14936 /* "none" */) { + if 0 == Xsqlite3StrICmp(tls, z, ts+15365 /* "none" */) { return BTREE_AUTOVACUUM_NONE } - if 0 == Xsqlite3StrICmp(tls, z, ts+14941 /* "full" */) { + if 0 == Xsqlite3StrICmp(tls, z, ts+15370 /* "full" */) { return BTREE_AUTOVACUUM_FULL } - if 0 == Xsqlite3StrICmp(tls, z, ts+14946 /* "incremental" */) { + if 0 == Xsqlite3StrICmp(tls, z, ts+15375 /* "incremental" */) { return BTREE_AUTOVACUUM_INCR } i = Xsqlite3Atoi(tls, z) @@ -104669,12 +106011,12 @@ func getAutoVacuum(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:125842:12: */ // 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 *libc.TLS, z uintptr) int32 { /* sqlite3.c:125858:12: */ +func getTempStore(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:127580:12: */ if (int32(*(*int8)(unsafe.Pointer(z))) >= '0') && (int32(*(*int8)(unsafe.Pointer(z))) <= '2') { return (int32(*(*int8)(unsafe.Pointer(z))) - '0') - } else if Xsqlite3StrICmp(tls, z, ts+13876 /* "file" */) == 0 { + } else if Xsqlite3StrICmp(tls, z, ts+14305 /* "file" */) == 0 { return 1 - } else if Xsqlite3StrICmp(tls, z, ts+14958 /* "memory" */) == 0 { + } else if Xsqlite3StrICmp(tls, z, ts+15387 /* "memory" */) == 0 { return 2 } else { return 0 @@ -104684,12 +106026,13 @@ func getTempStore(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:125858:12: */ // 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 *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:125876:12: */ +func invalidateTempStorage(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:127598:12: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpBt != uintptr(0) { - if !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) || (Xsqlite3BtreeIsInReadTrans(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpBt) != 0) { + if !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) || + (Xsqlite3BtreeTxnState(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpBt) != SQLITE_TXN_NONE) { Xsqlite3ErrorMsg(tls, pParse, - ts+14965 /* "temporary storag..." */, 0) + ts+15394 /* "temporary storag..." */, 0) return SQLITE_ERROR } Xsqlite3BtreeClose(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpBt) @@ -104702,7 +106045,7 @@ func invalidateTempStorage(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:1 // 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 *libc.TLS, pParse uintptr, zStorageType uintptr) int32 { /* sqlite3.c:125898:12: */ +func changeTempStorage(tls *libc.TLS, pParse uintptr, zStorageType uintptr) int32 { /* sqlite3.c:127622:12: */ var ts int32 = getTempStore(tls, zStorageType) var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == ts { @@ -104716,7 +106059,7 @@ func changeTempStorage(tls *libc.TLS, pParse uintptr, zStorageType uintptr) int3 } // Set result column names for a pragma. -func setPragmaResultColumnNames(tls *libc.TLS, v uintptr, pPragma uintptr) { /* sqlite3.c:125913:13: */ +func setPragmaResultColumnNames(tls *libc.TLS, v uintptr, pPragma uintptr) { /* sqlite3.c:127637:13: */ var n U8 = (*PragmaName)(unsafe.Pointer(pPragma)).FnPragCName Xsqlite3VdbeSetNumCols(tls, v, func() int32 { if int32(n) == 0 { @@ -104750,7 +106093,7 @@ func setPragmaResultColumnNames(tls *libc.TLS, v uintptr, pPragma uintptr) { /* } // Generate code to return a single integer value. -func returnSingleInt(tls *libc.TLS, v uintptr, value I64) { /* sqlite3.c:125932:13: */ +func returnSingleInt(tls *libc.TLS, v uintptr, value I64) { /* sqlite3.c:127656:13: */ bp := tls.Alloc(8) defer tls.Free(8) *(*I64)(unsafe.Pointer(bp)) = value @@ -104760,7 +106103,7 @@ func returnSingleInt(tls *libc.TLS, v uintptr, value I64) { /* sqlite3.c:125932: } // Generate code to return a single text value. -func returnSingleText(tls *libc.TLS, v uintptr, zValue uintptr) { /* sqlite3.c:125940:13: */ +func returnSingleText(tls *libc.TLS, v uintptr, zValue uintptr) { /* sqlite3.c:127664:13: */ if zValue != 0 { Xsqlite3VdbeLoadString(tls, v, 1, zValue) Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 1, 1) @@ -104769,7 +106112,7 @@ func returnSingleText(tls *libc.TLS, v uintptr, zValue uintptr) { /* sqlite3.c:1 // Set the safety_level and pager flags for pager iDb. Or if iDb<0 // set these values for all pagers. -func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:125956:13: */ +func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:127680:13: */ if (*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0 { var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb var n int32 = (*Sqlite3)(unsafe.Pointer(db)).FnDb @@ -104777,7 +106120,7 @@ func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:125956:13: */ for (libc.PostDecInt32(&n, 1)) > 0 { if (*Db)(unsafe.Pointer(pDb)).FpBt != 0 { Xsqlite3BtreeSetPagerFlags(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, - (uint32(U64((*Db)(unsafe.Pointer(pDb)).Fsafety_level) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & PAGER_FLAGS_MASK)))) + (uint32(U64((*Db)(unsafe.Pointer(pDb)).Fsafety_level) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(PAGER_FLAGS_MASK))))) } pDb += 32 } @@ -104785,23 +106128,23 @@ func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:125956:13: */ } // Return a human-readable name for a constraint resolution action. -func actionName(tls *libc.TLS, action U8) uintptr { /* sqlite3.c:125984:19: */ +func actionName(tls *libc.TLS, action U8) uintptr { /* sqlite3.c:127708:19: */ var zName uintptr switch int32(action) { case OE_SetNull: - zName = ts + 15027 /* "SET NULL" */ + zName = ts + 15456 /* "SET NULL" */ break case OE_SetDflt: - zName = ts + 15036 /* "SET DEFAULT" */ + zName = ts + 15465 /* "SET DEFAULT" */ break case OE_Cascade: - zName = ts + 15048 /* "CASCADE" */ + zName = ts + 15477 /* "CASCADE" */ break case OE_Restrict: - zName = ts + 15056 /* "RESTRICT" */ + zName = ts + 15485 /* "RESTRICT" */ break default: - zName = ts + 15065 /* "NO ACTION" */ + zName = ts + 15494 /* "NO ACTION" */ break } return zName @@ -104810,7 +106153,7 @@ func actionName(tls *libc.TLS, action U8) uintptr { /* sqlite3.c:125984:19: */ // 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 Xsqlite3JournalModename(tls *libc.TLS, eMode int32) uintptr { /* sqlite3.c:126004:27: */ +func Xsqlite3JournalModename(tls *libc.TLS, eMode int32) uintptr { /* sqlite3.c:127728:27: */ if eMode == (int32(uint64(unsafe.Sizeof(azModeName)) / uint64(unsafe.Sizeof(uintptr(0))))) { return uintptr(0) @@ -104819,11 +106162,11 @@ func Xsqlite3JournalModename(tls *libc.TLS, eMode int32) uintptr { /* sqlite3.c: } var azModeName = [6]uintptr{ - ts + 15075 /* "delete" */, ts + 15082 /* "persist" */, ts + 15090 /* "off" */, ts + 15094 /* "truncate" */, ts + 14958 /* "memory" */, ts + 15103, /* "wal" */ -} /* sqlite3.c:126005:15 */ + ts + 15504 /* "delete" */, ts + 15511 /* "persist" */, ts + 15519 /* "off" */, ts + 15523 /* "truncate" */, ts + 15387 /* "memory" */, ts + 15532, /* "wal" */ +} /* sqlite3.c:127729:15 */ // Locate a pragma in the aPragmaName[] array. -func pragmaLocate(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:126026:25: */ +func pragmaLocate(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:127750:25: */ var upr int32 var lwr int32 var mid int32 = 0 @@ -104850,7 +106193,7 @@ func pragmaLocate(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:126026:25 // Create zero or more entries in the output for the SQL functions // defined by FuncDef p. -func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, showInternFuncs int32) { /* sqlite3.c:126047:13: */ +func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, showInternFuncs int32) { /* sqlite3.c:127771:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -104860,34 +106203,34 @@ func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, sh if (*FuncDef)(unsafe.Pointer(p)).FxSFunc == uintptr(0) { continue } - if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_INTERNAL) != U32(0)) && + if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_INTERNAL)) != U32(0)) && (showInternFuncs == 0) { continue } if (*FuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = ts + 15107 /* "w" */ + zType = ts + 15536 /* "w" */ } else if (*FuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = ts + 15109 /* "a" */ + zType = ts + 15538 /* "a" */ } else { - zType = ts + 15111 /* "s" */ + zType = ts + 15540 /* "s" */ } - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15113, /* "sissii" */ + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15542, /* "sissii" */ libc.VaList(bp, (*FuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, - zType, azEnc[((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&SQLITE_FUNC_ENCMASK)], + zType, azEnc[((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_ENCMASK))], int32((*FuncDef)(unsafe.Pointer(p)).FnArg), - (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&mask)^SQLITE_INNOCUOUS))) + (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&mask)^U32(SQLITE_INNOCUOUS)))) } } -var mask U32 = (U32((((SQLITE_DETERMINISTIC | SQLITE_DIRECTONLY) | SQLITE_SUBTYPE) | SQLITE_INNOCUOUS) | SQLITE_FUNC_INTERNAL)) /* sqlite3.c:126055:22 */ -var azEnc = [4]uintptr{uintptr(0), ts + 15120 /* "utf8" */, ts + 15125 /* "utf16le" */, ts + 15133 /* "utf16be" */} /* sqlite3.c:126062:23 */ +var mask U32 = (U32((((SQLITE_DETERMINISTIC | SQLITE_DIRECTONLY) | SQLITE_SUBTYPE) | SQLITE_INNOCUOUS) | SQLITE_FUNC_INTERNAL)) /* sqlite3.c:127779:22 */ +var azEnc = [4]uintptr{uintptr(0), ts + 15549 /* "utf8" */, ts + 15554 /* "utf16le" */, ts + 15562 /* "utf16be" */} /* sqlite3.c:127786:23 */ // Helper subroutine for PRAGMA integrity_check: // // Generate code to output a single-column result row with a value of the // string held in register 3. Decrement the result count in register 1 // and halt if the maximum number of result rows have been issued. -func integrityCheckResultRow(tls *libc.TLS, v uintptr) int32 { /* sqlite3.c:126099:12: */ +func integrityCheckResultRow(tls *libc.TLS, v uintptr) int32 { /* sqlite3.c:127823:12: */ var addr int32 Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 3, 1) addr = Xsqlite3VdbeAddOp3(tls, v, OP_IfPos, 1, (Xsqlite3VdbeCurrentAddr(tls, v) + 2), 1) @@ -104909,7 +106252,7 @@ func integrityCheckResultRow(tls *libc.TLS, v uintptr) int32 { /* sqlite3.c:1260 // 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 Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pValue uintptr, minusFlag int32) { /* sqlite3.c:126123:21: */ +func Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pValue uintptr, minusFlag int32) { /* sqlite3.c:127847:21: */ bp := tls.Alloc(528) defer tls.Free(528) @@ -105142,7 +106485,7 @@ __4: if !(minusFlag != 0) { goto __5 } - zRight = Xsqlite3MPrintf(tls, db, ts+15141 /* "-%T" */, libc.VaList(bp, pValue)) + zRight = Xsqlite3MPrintf(tls, db, ts+15570 /* "-%T" */, libc.VaList(bp, pValue)) goto __6 __5: zRight = Xsqlite3NameFromToken(tls, db, pValue) @@ -105197,7 +106540,7 @@ __8: if !(*(*uintptr)(unsafe.Pointer(bp + 368 /* &aFcntl[0] */)) != 0) { goto __10 } - Xsqlite3ErrorMsg(tls, pParse, ts+2690 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 368 /* &aFcntl[0] */)))) + Xsqlite3ErrorMsg(tls, pParse, ts+2718 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 368 /* &aFcntl[0] */)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 368 /* &aFcntl[0] */))) __10: ; @@ -105769,7 +107112,7 @@ __18: if !(zRight != 0) { goto __62 } - if !(Xsqlite3_stricmp(tls, zRight, ts+15145 /* "fast" */) == 0) { + if !(Xsqlite3_stricmp(tls, zRight, ts+15574 /* "fast" */) == 0) { goto __63 } b = 2 @@ -105858,7 +107201,7 @@ __70: // PRAGMA [schema.]locking_mode // PRAGMA [schema.]locking_mode = (normal|exclusive) __20: - zRet = ts + 14929 /* "normal" */ + zRet = ts + 15358 /* "normal" */ eMode = getLockingMode(tls, zRight) if !(((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) && (eMode == -1)) { @@ -105899,7 +107242,7 @@ __77: if !(eMode == PAGER_LOCKINGMODE_EXCLUSIVE) { goto __82 } - zRet = ts + 14919 /* "exclusive" */ + zRet = ts + 15348 /* "exclusive" */ __82: ; returnSingleText(tls, v, zRet) @@ -105945,7 +107288,7 @@ __87: eMode1 = -1 __89: ; - if !((eMode1 == PAGER_JOURNALMODE_OFF) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_Defensive) != uint64(0))) { + if !((eMode1 == PAGER_JOURNALMODE_OFF) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_Defensive)) != uint64(0))) { goto __90 } // Do not allow journal-mode "OFF" in defensive since the database @@ -106124,7 +107467,7 @@ __26: } returnSingleInt(tls, v, func() int64 { - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_CacheSpill) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_CacheSpill)) == uint64(0) { return int64(0) } return int64(Xsqlite3BtreeSetSpillSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, 0)) @@ -106141,10 +107484,10 @@ __107: if !(Xsqlite3GetBoolean(tls, zRight, (uint8(libc.Bool32(*(*int32)(unsafe.Pointer(bp + 420 /* size3 */)) != 0)))) != 0) { goto __108 } - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (SQLITE_CacheSpill) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_CacheSpill)) goto __109 __108: - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_CacheSpill)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_CacheSpill))) __109: ; setAllPagerFlags(tls, db) @@ -106264,7 +107607,7 @@ __122: if !((rc != SQLITE_OK) || (*(*int32)(unsafe.Pointer(bp + 432 /* res */)) == 0)) { goto __125 } - Xsqlite3ErrorMsg(tls, pParse, ts+15150 /* "not a writable d..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+15579 /* "not a writable d..." */, 0) goto pragma_out __125: ; @@ -106282,7 +107625,7 @@ __126: if !(*(*int8)(unsafe.Pointer(zRight)) != 0) { goto __127 } - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp+16, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp+16, zRight)) goto __128 __127: Xsqlite3_temp_directory = uintptr(0) @@ -106310,7 +107653,7 @@ __129: goto __131 } Xsqlite3ErrorMsg(tls, pParse, - ts+15175 /* "Safety level may..." */, 0) + ts+15604 /* "Safety level may..." */, 0) goto __132 __131: if !(iDb != 1) { @@ -106359,7 +107702,7 @@ __137: goto __139 __138: *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^mask) - if !(mask == SQLITE_DeferFKs) { + if !(mask == uint64(SQLITE_DeferFKs)) { goto __140 } (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0) @@ -106393,7 +107736,7 @@ __32: goto __141 } Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb) - pTab = Xsqlite3LocateTable(tls, pParse, LOCATE_NOERR, zRight, zDb) + pTab = Xsqlite3LocateTable(tls, pParse, uint32(LOCATE_NOERR), zRight, zDb) if !(pTab != 0) { goto __142 } @@ -106469,9 +107812,9 @@ __153: Xsqlite3VdbeMultiLoad(tls, v, 1, func() uintptr { if (*PragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - return ts + 15228 /* "issisii" */ + return ts + 15657 /* "issisii" */ } - return ts + 15236 /* "issisi" */ + return ts + 15665 /* "issisi" */ }(), libc.VaList(bp+24, (i-nHidden), (*Column)(unsafe.Pointer(pCol)).FzName, @@ -106515,8 +107858,8 @@ __33: // If there is no index named zRight, check to see if there is a // WITHOUT ROWID table named zRight, and if there is, show the // structure of the PRIMARY KEY index for that table. - pTab1 = Xsqlite3LocateTable(tls, pParse, LOCATE_NOERR, zRight, zDb) - if !((pTab1 != 0) && !(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & TF_WithoutRowid) == U32(0))) { + pTab1 = Xsqlite3LocateTable(tls, pParse, uint32(LOCATE_NOERR), zRight, zDb) + if !((pTab1 != 0) && !(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __161 } pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab1) @@ -106550,7 +107893,7 @@ __165: goto __167 } cnum = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i1)*2)) - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15243 /* "iisX" */, libc.VaList(bp+80, i1, int32(cnum), + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15672 /* "iisX" */, libc.VaList(bp+80, i1, int32(cnum), func() uintptr { if int32(cnum) < 0 { return uintptr(0) @@ -106560,7 +107903,7 @@ __165: if !((*PragmaName)(unsafe.Pointer(pPragma)).FiArg != 0) { goto __168 } - Xsqlite3VdbeMultiLoad(tls, v, 4, ts+15248, /* "isiX" */ + Xsqlite3VdbeMultiLoad(tls, v, 4, ts+15677, /* "isiX" */ libc.VaList(bp+104, int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), (libc.Bool32(i1 < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol))))) @@ -106597,8 +107940,8 @@ __171: if !(pIdx1 != 0) { goto __173 } - *(*[3]uintptr)(unsafe.Pointer(bp + 440 /* azOrigin */)) = [3]uintptr{ts + 15253 /* "c" */, ts + 15255 /* "u" */, ts + 13775 /* "pk" */} - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15257, /* "isisi" */ + *(*[3]uintptr)(unsafe.Pointer(bp + 440 /* azOrigin */)) = [3]uintptr{ts + 15682 /* "c" */, ts + 15684 /* "u" */, ts + 14204 /* "pk" */} + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15686, /* "isisi" */ libc.VaList(bp+128, i2, (*Index)(unsafe.Pointer(pIdx1)).FzName, (libc.Bool32(int32((*Index)(unsafe.Pointer((pIdx1))).FonError) != OE_None)), @@ -106632,7 +107975,7 @@ __174: __177: ; - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15263, /* "iss" */ + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15692, /* "iss" */ libc.VaList(bp+168, i3, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i3)*32)).FzDbSName, Xsqlite3BtreeGetFilename(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i3)*32)).FpBt))) @@ -106649,13 +107992,13 @@ __176: __36: i4 = 0 (*Parse)(unsafe.Pointer(pParse)).FnMem = 2 - p = (*Hash)(unsafe.Pointer((db + 600 /* &.aCollSeq */))).Ffirst + p = (*Hash)(unsafe.Pointer((db + 608 /* &.aCollSeq */))).Ffirst __178: if !(p != 0) { goto __180 } pColl = (*HashElem)(unsafe.Pointer(p)).Fdata - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15267 /* "is" */, libc.VaList(bp+192, libc.PostIncInt32(&i4, 1), (*CollSeq)(unsafe.Pointer(pColl)).FzName)) + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15696 /* "is" */, libc.VaList(bp+192, libc.PostIncInt32(&i4, 1), (*CollSeq)(unsafe.Pointer(pColl)).FzName)) goto __179 __179: p = (*HashElem)(unsafe.Pointer(p)).Fnext @@ -106667,7 +108010,7 @@ __180: goto __15 __37: - showInternFunc = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_InternalFunc) != U32(0))) + showInternFunc = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_InternalFunc)) != U32(0))) (*Parse)(unsafe.Pointer(pParse)).FnMem = 6 i5 = 0 __181: @@ -106694,7 +108037,7 @@ __182: goto __183 __183: ; - j = (*Hash)(unsafe.Pointer((db + 576 /* &.aFunc */))).Ffirst + j = (*Hash)(unsafe.Pointer((db + 584 /* &.aFunc */))).Ffirst __187: if !(j != 0) { goto __189 @@ -106713,13 +108056,13 @@ __189: __38: (*Parse)(unsafe.Pointer(pParse)).FnMem = 1 - j1 = (*Hash)(unsafe.Pointer((db + 528 /* &.aModule */))).Ffirst + j1 = (*Hash)(unsafe.Pointer((db + 536 /* &.aModule */))).Ffirst __190: if !(j1 != 0) { goto __192 } pMod = (*HashElem)(unsafe.Pointer(j1)).Fdata - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15111 /* "s" */, libc.VaList(bp+208, (*Module)(unsafe.Pointer(pMod)).FzName)) + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15540 /* "s" */, libc.VaList(bp+208, (*Module)(unsafe.Pointer(pMod)).FzName)) goto __191 __191: j1 = (*HashElem)(unsafe.Pointer(j1)).Fnext @@ -106736,7 +108079,7 @@ __193: if !(i6 < (int32(uint64(unsafe.Sizeof(aPragmaName)) / uint64(unsafe.Sizeof(PragmaName{}))))) { goto __195 } - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15111 /* "s" */, libc.VaList(bp+216, aPragmaName[i6].FzName)) + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15540 /* "s" */, libc.VaList(bp+216, aPragmaName[i6].FzName)) goto __194 __194: i6++ @@ -106772,7 +108115,7 @@ __201: if !(j2 < (*FKey)(unsafe.Pointer(pFK)).FnCol) { goto __203 } - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15270, /* "iissssss" */ + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15699, /* "iissssss" */ libc.VaList(bp+224, i7, j2, (*FKey)(unsafe.Pointer(pFK)).FzTo, @@ -106780,7 +108123,7 @@ __201: (*sColMap)(unsafe.Pointer((pFK+64 /* &.aCol */)+uintptr(j2)*16)).FzCol, actionName(tls, *(*U8)(unsafe.Pointer((pFK + 45 /* &.aAction */) + 1))), // ON UPDATE actionName(tls, *(*U8)(unsafe.Pointer((pFK + 45 /* &.aAction */)))), // ON DELETE - ts+15279 /* "NONE" */)) + ts+15708 /* "NONE" */)) goto __202 __202: j2++ @@ -106964,7 +108307,7 @@ __228: ; // Generate code to report an FK violation to the caller. - if !(((*Table)(unsafe.Pointer((pTab4))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab4))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __230 } Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, 0, (regResult + 1)) @@ -106973,7 +108316,7 @@ __230: Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (regResult + 1)) __231: ; - Xsqlite3VdbeMultiLoad(tls, v, (regResult + 2), ts+15284 /* "siX" */, libc.VaList(bp+288, (*FKey)(unsafe.Pointer(pFK1)).FzTo, (i8-1))) + Xsqlite3VdbeMultiLoad(tls, v, (regResult + 2), ts+15713 /* "siX" */, libc.VaList(bp+288, (*FKey)(unsafe.Pointer(pFK1)).FzTo, (i8-1))) Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, regResult, 4) Xsqlite3VdbeResolveLabel(tls, v, addrOk) Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* aiCols */))) @@ -107125,7 +108468,7 @@ __243: goto __244 __246: ; - if !(((*Table)(unsafe.Pointer((pTab5))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab5))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __247 } cnt++ @@ -107197,7 +108540,7 @@ __256: goto __257 __259: ; - if !(((*Table)(unsafe.Pointer((pTab6))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab6))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __260 } *(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = int32((*Table)(unsafe.Pointer(pTab6)).Ftnum) @@ -107239,7 +108582,7 @@ __258: Xsqlite3VdbeChangeP5(tls, v, uint16(U8(i9))) addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, 2) Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, - Xsqlite3MPrintf(tls, db, ts+15288 /* "*** in database ..." */, libc.VaList(bp+304, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i9)*32)).FzDbSName)), + Xsqlite3MPrintf(tls, db, ts+15717 /* "*** in database ..." */, libc.VaList(bp+304, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i9)*32)).FzDbSName)), -7) Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 2, 3, 3) integrityCheckResultRow(tls, v) @@ -107267,7 +108610,7 @@ __267: goto __265 __268: ; - if ((*Table)(unsafe.Pointer((pTab7))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab7))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk1 = uintptr(0) } else { pPk1 = Xsqlite3PrimaryKeyIndex(tls, pTab7) @@ -107300,7 +108643,7 @@ __271: } // Sanity check on record header decoding Xsqlite3VdbeAddOp3(tls, v, OP_Column, *(*int32)(unsafe.Pointer(bp + 484 /* iDataCur */)), (int32((*Table)(unsafe.Pointer(pTab7)).FnNVCol) - 1), 3) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_TYPEOFARG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG)) __272: ; // Verify that all NOT NULL columns really are NOT NULL @@ -107325,11 +108668,11 @@ __277: if !(int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, -1))).Fopcode) == OP_Column) { goto __278 } - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_TYPEOFARG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG)) __278: ; jmp2 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, 3) - zErr = Xsqlite3MPrintf(tls, db, ts+15312 /* "NULL value in %s..." */, libc.VaList(bp+312, (*Table)(unsafe.Pointer(pTab7)).FzName, + zErr = Xsqlite3MPrintf(tls, db, ts+15741 /* "NULL value in %s..." */, libc.VaList(bp+312, (*Table)(unsafe.Pointer(pTab7)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab7)).FaCol+uintptr(j4)*32)).FzName)) Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, zErr, -7) integrityCheckResultRow(tls, v) @@ -107342,7 +108685,7 @@ __274: __275: ; // Verify CHECK constraints - if !(((*Table)(unsafe.Pointer(pTab7)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_IgnoreChecks) == uint64(0))) { + if !(((*Table)(unsafe.Pointer(pTab7)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_IgnoreChecks)) == uint64(0))) { goto __279 } pCheck = Xsqlite3ExprListDup(tls, db, (*Table)(unsafe.Pointer(pTab7)).FpCheck, 0) @@ -107369,7 +108712,7 @@ __283: SQLITE_JUMPIFNULL) Xsqlite3VdbeResolveLabel(tls, v, addrCkFault) (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr1 = Xsqlite3MPrintf(tls, db, ts+15332, /* "CHECK constraint..." */ + zErr1 = Xsqlite3MPrintf(tls, db, ts+15761, /* "CHECK constraint..." */ libc.VaList(bp+328, (*Table)(unsafe.Pointer(pTab7)).FzName)) Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, zErr1, -7) integrityCheckResultRow(tls, v) @@ -107403,9 +108746,9 @@ __288: // Verify that an index entry exists for the current table row jmp21 = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, (*(*int32)(unsafe.Pointer(bp + 488 /* iIdxCur */)) + j4), ckUniq, r1, int32((*Index)(unsafe.Pointer(pIdx5)).FnColumn)) - Xsqlite3VdbeLoadString(tls, v, 3, ts+15362 /* "row " */) + Xsqlite3VdbeLoadString(tls, v, 3, ts+15791 /* "row " */) Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 7, 3, 3) - Xsqlite3VdbeLoadString(tls, v, 4, ts+15367 /* " missing from in..." */) + Xsqlite3VdbeLoadString(tls, v, 4, ts+15796 /* " missing from in..." */) Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 3, 3) jmp5 = Xsqlite3VdbeLoadString(tls, v, 4, (*Index)(unsafe.Pointer(pIdx5)).FzName) Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 3, 3) @@ -107445,7 +108788,7 @@ __292: Xsqlite3VdbeJumpHere(tls, v, jmp6) Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxGT, (*(*int32)(unsafe.Pointer(bp + 488 /* iIdxCur */)) + j4), uniqOk, r1, int32((*Index)(unsafe.Pointer(pIdx5)).FnKeyCol)) - Xsqlite3VdbeLoadString(tls, v, 3, ts+15388 /* "non-unique entry..." */) + Xsqlite3VdbeLoadString(tls, v, 3, ts+15817 /* "non-unique entry..." */) Xsqlite3VdbeGoto(tls, v, jmp5) Xsqlite3VdbeResolveLabel(tls, v, uniqOk) __289: @@ -107467,7 +108810,7 @@ __284: if !(!(isQuick != 0)) { goto __294 } - Xsqlite3VdbeLoadString(tls, v, 2, ts+15415 /* "wrong # of entri..." */) + Xsqlite3VdbeLoadString(tls, v, 2, ts+15844 /* "wrong # of entri..." */) j4 = 0 pIdx5 = (*Table)(unsafe.Pointer(pTab7)).FpIndex __295: @@ -107482,7 +108825,7 @@ __298: ; Xsqlite3VdbeAddOp2(tls, v, OP_Count, (*(*int32)(unsafe.Pointer(bp + 488 /* iIdxCur */)) + j4), 3) addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_Eq, (8 + j4), 0, 3) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) Xsqlite3VdbeLoadString(tls, v, 4, (*Index)(unsafe.Pointer(pIdx5)).FzName) Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 2, 3) integrityCheckResultRow(tls, v) @@ -107518,7 +108861,7 @@ __240: } (*VdbeOp)(unsafe.Pointer(aOp2)).Fp2 = (1 - *(*int32)(unsafe.Pointer(bp + 480 /* mxErr */))) (*VdbeOp)(unsafe.Pointer(aOp2 + 2*24)).Fp4type = int8(-1) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16 /* &.p4 */)) = ts + 15444 /* "ok" */ + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16 /* &.p4 */)) = ts + 15873 /* "ok" */ (*VdbeOp)(unsafe.Pointer(aOp2 + 5*24)).Fp4type = int8(-1) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16 /* &.p4 */)) = Xsqlite3ErrStr(tls, SQLITE_CORRUPT) __299: @@ -107565,7 +108908,7 @@ __300: // "PRAGMA encoding = XXX" // initialized. If the main database exists, the new sqlite.enc value // will be overwritten when the schema is next loaded. If it does not // already exists, it will be created to use the new encoding value. - if !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_EncodingFixed) == U32(0)) { + if !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) == U32(0)) { goto __303 } pEnc = (uintptr(unsafe.Pointer(&encnames1))) @@ -107579,7 +108922,7 @@ __304: if (*EncName)(unsafe.Pointer(pEnc)).Fenc != 0 { enc = (*EncName)(unsafe.Pointer(pEnc)).Fenc } else { - enc = SQLITE_UTF16LE + enc = uint8(SQLITE_UTF16LE) } ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb)).FpSchema)).Fenc) = enc Xsqlite3SetTextEncoding(tls, db, enc) @@ -107596,7 +108939,7 @@ __306: if !(!(int32((*EncName)(unsafe.Pointer(pEnc)).FzName) != 0)) { goto __308 } - Xsqlite3ErrorMsg(tls, pParse, ts+15447 /* "unsupported enco..." */, libc.VaList(bp+336, zRight)) + Xsqlite3ErrorMsg(tls, pParse, ts+15876 /* "unsupported enco..." */, libc.VaList(bp+336, zRight)) __308: ; __303: @@ -107702,25 +109045,25 @@ __47: if (*Token)(unsafe.Pointer(pId2)).Fz != 0 { return iDb } - return SQLITE_MAX_ATTACHED + return (SQLITE_MAX_ATTACHED + 2) }() eMode2 = SQLITE_CHECKPOINT_PASSIVE if !(zRight != 0) { goto __315 } - if !(Xsqlite3StrICmp(tls, zRight, ts+14941 /* "full" */) == 0) { + if !(Xsqlite3StrICmp(tls, zRight, ts+15370 /* "full" */) == 0) { goto __316 } eMode2 = SQLITE_CHECKPOINT_FULL goto __317 __316: - if !(Xsqlite3StrICmp(tls, zRight, ts+15472 /* "restart" */) == 0) { + if !(Xsqlite3StrICmp(tls, zRight, ts+15901 /* "restart" */) == 0) { goto __318 } eMode2 = SQLITE_CHECKPOINT_RESTART goto __319 __318: - if !(Xsqlite3StrICmp(tls, zRight, ts+15094 /* "truncate" */) == 0) { + if !(Xsqlite3StrICmp(tls, zRight, ts+15523 /* "truncate" */) == 0) { goto __320 } eMode2 = SQLITE_CHECKPOINT_TRUNCATE @@ -107870,7 +109213,7 @@ __329: // If table pTab has not been used in a way that would benefit from // having analysis statistics during the current session, then skip it. // This also has the effect of skipping virtual tables and views - if !(((*Table)(unsafe.Pointer(pTab8)).FtabFlags & TF_StatsUsed) == U32(0)) { + if !(((*Table)(unsafe.Pointer(pTab8)).FtabFlags & U32(TF_StatsUsed)) == U32(0)) { goto __332 } goto __330 @@ -107907,7 +109250,7 @@ __335: __337: ; - zSubSql = Xsqlite3MPrintf(tls, db, ts+15480, /* "ANALYZE \"%w\".\"%w..." */ + zSubSql = Xsqlite3MPrintf(tls, db, ts+15909, /* "ANALYZE \"%w\".\"%w..." */ libc.VaList(bp+344, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Table)(unsafe.Pointer(pTab8)).FzName)) if !((opMask & U32(0x01)) != 0) { goto __338 @@ -108058,58 +109401,58 @@ type EncName = struct { FzName uintptr Fenc U8 _ [7]byte -} /* sqlite3.c:127572:18 */ +} /* sqlite3.c:129296:18 */ -var iLn3 int32 = 0 /* sqlite3.c:126248:22 */ +var iLn3 int32 = 0 /* sqlite3.c:127972:22 */ var getCacheSize = [9]VdbeOpList{ - {Fopcode: OP_Transaction}, // 0 - {Fopcode: OP_ReadCookie, Fp2: int8(1), Fp3: BTREE_DEFAULT_CACHE_SIZE}, // 1 - {Fopcode: OP_IfPos, Fp1: int8(1), Fp2: int8(8)}, - {Fopcode: OP_Integer, Fp2: int8(2)}, - {Fopcode: OP_Subtract, Fp1: int8(1), Fp2: int8(2), Fp3: int8(1)}, - {Fopcode: OP_IfPos, Fp1: int8(1), Fp2: int8(8)}, - {Fopcode: OP_Integer, Fp2: int8(1)}, // 6 - {Fopcode: OP_Noop}, - {Fopcode: OP_ResultRow, Fp1: int8(1), Fp2: int8(1)}, -} /* sqlite3.c:126249:29 */ -var iLn4 int32 = 0 /* sqlite3.c:126517:26 */ + {Fopcode: U8(OP_Transaction)}, // 0 + {Fopcode: U8(OP_ReadCookie), Fp2: int8(1), Fp3: int8(BTREE_DEFAULT_CACHE_SIZE)}, // 1 + {Fopcode: U8(OP_IfPos), Fp1: int8(1), Fp2: int8(8)}, + {Fopcode: U8(OP_Integer), Fp2: int8(2)}, + {Fopcode: U8(OP_Subtract), Fp1: int8(1), Fp2: int8(2), Fp3: int8(1)}, + {Fopcode: U8(OP_IfPos), Fp1: int8(1), Fp2: int8(8)}, + {Fopcode: U8(OP_Integer), Fp2: int8(1)}, // 6 + {Fopcode: U8(OP_Noop)}, + {Fopcode: U8(OP_ResultRow), Fp1: int8(1), Fp2: int8(1)}, +} /* sqlite3.c:127973:29 */ +var iLn4 int32 = 0 /* sqlite3.c:128241:26 */ var setMeta6 = [5]VdbeOpList{ - {Fopcode: OP_Transaction, Fp2: int8(1)}, // 0 - {Fopcode: OP_ReadCookie, Fp2: int8(1), Fp3: BTREE_LARGEST_ROOT_PAGE}, - {Fopcode: OP_If, Fp1: int8(1)}, // 2 - {Fopcode: OP_Halt, Fp2: OE_Abort}, // 3 - {Fopcode: OP_SetCookie, Fp2: BTREE_INCR_VACUUM}, // 4 -} /* sqlite3.c:126518:33 */ -var iLn5 int32 = 0 /* sqlite3.c:127522:24 */ + {Fopcode: U8(OP_Transaction), Fp2: int8(1)}, // 0 + {Fopcode: U8(OP_ReadCookie), Fp2: int8(1), Fp3: int8(BTREE_LARGEST_ROOT_PAGE)}, + {Fopcode: U8(OP_If), Fp1: int8(1)}, // 2 + {Fopcode: U8(OP_Halt), Fp2: int8(OE_Abort)}, // 3 + {Fopcode: U8(OP_SetCookie), Fp2: int8(BTREE_INCR_VACUUM)}, // 4 +} /* sqlite3.c:128242:33 */ +var iLn5 int32 = 0 /* sqlite3.c:129246:24 */ var endCode = [7]VdbeOpList{ - {Fopcode: OP_AddImm, Fp1: int8(1)}, // 0 - {Fopcode: OP_IfNotZero, Fp1: int8(1), Fp2: int8(4)}, // 1 - {Fopcode: OP_String8, Fp2: int8(3)}, // 2 - {Fopcode: OP_ResultRow, Fp1: int8(3), Fp2: int8(1)}, // 3 - {Fopcode: OP_Halt}, // 4 - {Fopcode: OP_String8, Fp2: int8(3)}, // 5 - {Fopcode: OP_Goto, Fp2: int8(3)}, // 6 -} /* sqlite3.c:127523:31 */ + {Fopcode: U8(OP_AddImm), Fp1: int8(1)}, // 0 + {Fopcode: U8(OP_IfNotZero), Fp1: int8(1), Fp2: int8(4)}, // 1 + {Fopcode: U8(OP_String8), Fp2: int8(3)}, // 2 + {Fopcode: U8(OP_ResultRow), Fp1: int8(3), Fp2: int8(1)}, // 3 + {Fopcode: U8(OP_Halt)}, // 4 + {Fopcode: U8(OP_String8), Fp2: int8(3)}, // 5 + {Fopcode: U8(OP_Goto), Fp2: int8(3)}, // 6 +} /* sqlite3.c:129247:31 */ var encnames1 = [9]EncName{ - {FzName: ts + 15498 /* "UTF8" */, Fenc: SQLITE_UTF8}, - {FzName: ts + 15503 /* "UTF-8" */, Fenc: SQLITE_UTF8}, // Must be element [1] - {FzName: ts + 15509 /* "UTF-16le" */, Fenc: SQLITE_UTF16LE}, // Must be element [2] - {FzName: ts + 15518 /* "UTF-16be" */, Fenc: SQLITE_UTF16BE}, // Must be element [3] - {FzName: ts + 15527 /* "UTF16le" */, Fenc: SQLITE_UTF16LE}, - {FzName: ts + 15535 /* "UTF16be" */, Fenc: SQLITE_UTF16BE}, - {FzName: ts + 15543 /* "UTF-16" */}, // SQLITE_UTF16NATIVE - {FzName: ts + 15550 /* "UTF16" */}, // SQLITE_UTF16NATIVE + {FzName: ts + 15927 /* "UTF8" */, Fenc: U8(SQLITE_UTF8)}, + {FzName: ts + 15932 /* "UTF-8" */, Fenc: U8(SQLITE_UTF8)}, // Must be element [1] + {FzName: ts + 15938 /* "UTF-16le" */, Fenc: U8(SQLITE_UTF16LE)}, // Must be element [2] + {FzName: ts + 15947 /* "UTF-16be" */, Fenc: U8(SQLITE_UTF16BE)}, // Must be element [3] + {FzName: ts + 15956 /* "UTF16le" */, Fenc: U8(SQLITE_UTF16LE)}, + {FzName: ts + 15964 /* "UTF16be" */, Fenc: U8(SQLITE_UTF16BE)}, + {FzName: ts + 15972 /* "UTF-16" */}, // SQLITE_UTF16NATIVE + {FzName: ts + 15979 /* "UTF16" */}, // SQLITE_UTF16NATIVE {}, -} /* sqlite3.c:127575:7 */ +} /* sqlite3.c:129299:7 */ var setCookie = [2]VdbeOpList{ - {Fopcode: OP_Transaction, Fp2: int8(1)}, // 0 - {Fopcode: OP_SetCookie}, // 1 -} /* sqlite3.c:127655:31 */ + {Fopcode: U8(OP_Transaction), Fp2: int8(1)}, // 0 + {Fopcode: U8(OP_SetCookie)}, // 1 +} /* sqlite3.c:129379:31 */ var readCookie = [3]VdbeOpList{ - {Fopcode: OP_Transaction}, // 0 - {Fopcode: OP_ReadCookie, Fp2: int8(1)}, // 1 - {Fopcode: OP_ResultRow, Fp1: int8(1), Fp2: int8(1)}, -} /* sqlite3.c:127670:31 */ + {Fopcode: U8(OP_Transaction)}, // 0 + {Fopcode: U8(OP_ReadCookie), Fp2: int8(1)}, // 1 + {Fopcode: U8(OP_ResultRow), Fp1: int8(1), Fp2: int8(1)}, +} /* sqlite3.c:129394:31 */ // **************************************************************************** // // Implementation of an eponymous virtual table that runs a pragma. @@ -108121,24 +109464,24 @@ type PragmaVtab1 = struct { FnHidden U8 FiHidden U8 _ [6]byte -} /* sqlite3.c:128030:9 */ +} /* sqlite3.c:129754:9 */ // **************************************************************************** // // Implementation of an eponymous virtual table that runs a pragma. // -type PragmaVtab = PragmaVtab1 /* sqlite3.c:128030:27 */ +type PragmaVtab = PragmaVtab1 /* sqlite3.c:129754:27 */ type PragmaVtabCursor1 = struct { Fbase Sqlite3_vtab_cursor FpPragma uintptr FiRowid Sqlite_int64 FazArg [2]uintptr -} /* sqlite3.c:128031:9 */ +} /* sqlite3.c:129755:9 */ -type PragmaVtabCursor = PragmaVtabCursor1 /* sqlite3.c:128031:33 */ +type PragmaVtabCursor = PragmaVtabCursor1 /* sqlite3.c:129755:33 */ // Pragma virtual table module xConnect method. -func pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:128049:12: */ +func pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:129773:12: */ bp := tls.Alloc(264) defer tls.Free(264) @@ -108155,7 +109498,7 @@ func pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argc _ = argv Xsqlite3StrAccumInit(tls, bp+32 /* &acc */, uintptr(0), bp+64 /* &zBuf[0] */, int32(unsafe.Sizeof([200]int8{})), 0) - Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+15556 /* "CREATE TABLE x" */) + Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+15985 /* "CREATE TABLE x" */) i = 0 j = int32((*PragmaName)(unsafe.Pointer(pPragma)).FiPragCName) __1: @@ -108163,7 +109506,7 @@ __1: goto __3 } { - Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+15571 /* "%c\"%s\"" */, libc.VaList(bp, int32(cSep), pragCName[j])) + Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+16000 /* "%c\"%s\"" */, libc.VaList(bp, int32(cSep), pragCName[j])) cSep = int8(',') } @@ -108176,19 +109519,19 @@ __2: __3: ; if i == 0 { - Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+15578 /* "(\"%s\"" */, libc.VaList(bp+16, (*PragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+16007 /* "(\"%s\"" */, libc.VaList(bp+16, (*PragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if (int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+15584 /* ",arg HIDDEN" */) + Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+16013 /* ",arg HIDDEN" */) j++ } if (int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & (PragFlg_SchemaOpt | PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+15596 /* ",schema HIDDEN" */) + Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+16025 /* ",schema HIDDEN" */) j++ } - Xsqlite3_str_append(tls, bp+32 /* &acc */, ts+3907 /* ")" */, 1) + Xsqlite3_str_append(tls, bp+32 /* &acc */, ts+3935 /* ")" */, 1) Xsqlite3StrAccumFinish(tls, bp+32 /* &acc */) rc = Xsqlite3_declare_vtab(tls, db, bp+64 /* &zBuf[0] */) @@ -108204,7 +109547,7 @@ __3: (*PragmaVtab)(unsafe.Pointer(pTab)).FnHidden = U8(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab @@ -108212,7 +109555,7 @@ __3: } // Pragma virtual table module xDisconnect method. -func pragmaVtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:128111:12: */ +func pragmaVtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:129835:12: */ var pTab uintptr = pVtab Xsqlite3_free(tls, pTab) return SQLITE_OK @@ -108224,7 +109567,7 @@ func pragmaVtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:128 // 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 *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:128124:12: */ +func pragmaVtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:129848:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -108289,7 +109632,7 @@ __3: } // Create a new cursor for the pragma virtual table -func pragmaVtabOpen(tls *libc.TLS, pVtab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:128161:12: */ +func pragmaVtabOpen(tls *libc.TLS, pVtab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:129885:12: */ var pCsr uintptr pCsr = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(PragmaVtabCursor{}))) if pCsr == uintptr(0) { @@ -108302,7 +109645,7 @@ func pragmaVtabOpen(tls *libc.TLS, pVtab uintptr, ppCursor uintptr) int32 { /* s } // Clear all content from pragma virtual table cursor. -func pragmaVtabCursorClear(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:128172:13: */ +func pragmaVtabCursorClear(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:129896:13: */ var i int32 Xsqlite3_finalize(tls, (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma) (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma = uintptr(0) @@ -108313,7 +109656,7 @@ func pragmaVtabCursorClear(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:128172:13 } // Close a pragma virtual table cursor -func pragmaVtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:128183:12: */ +func pragmaVtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:129907:12: */ var pCsr uintptr = cur pragmaVtabCursorClear(tls, pCsr) Xsqlite3_free(tls, pCsr) @@ -108321,7 +109664,7 @@ func pragmaVtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:128183:12: } // Advance the pragma virtual table cursor to the next row -func pragmaVtabNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:128191:12: */ +func pragmaVtabNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:129915:12: */ var pCsr uintptr = pVtabCursor var rc int32 = SQLITE_OK @@ -108337,7 +109680,7 @@ func pragmaVtabNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:128 } // Pragma virtual table module xFilter method. -func pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:128209:12: */ +func pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:129933:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -108367,7 +109710,7 @@ __1: var zText uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if zText != 0 { - *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr(j)*8)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp, zText)) + *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr(j)*8)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp, zText)) if *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr(j)*8)) == uintptr(0) { return SQLITE_NOMEM } @@ -108382,14 +109725,14 @@ __2: goto __3 __3: ; - Xsqlite3StrAccumInit(tls, bp+32 /* &acc */, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer(((*PragmaVtab)(unsafe.Pointer(pTab)).Fdb + 124 /* &.aLimit */) + 1*4))) - Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+15611 /* "PRAGMA " */) + Xsqlite3StrAccumInit(tls, bp+32 /* &acc */, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer(((*PragmaVtab)(unsafe.Pointer(pTab)).Fdb + 128 /* &.aLimit */) + 1*4))) + Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+16040 /* "PRAGMA " */) if *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+15619 /* "%Q." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + 1*8)))) + Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+16048 /* "%Q." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + 1*8)))) } Xsqlite3_str_appendall(tls, bp+32 /* &acc */, (*PragmaName)(unsafe.Pointer((*PragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */))) != 0 { - Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+15623 /* "=%Q" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */))))) + Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+16052 /* "=%Q" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */))))) } zSql = Xsqlite3StrAccumFinish(tls, bp+32 /* &acc */) if zSql == uintptr(0) { @@ -108398,21 +109741,21 @@ __3: rc = Xsqlite3_prepare_v2(tls, (*PragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -1, (pCsr + 8 /* &.pPragma */), uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*PragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, (*PragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*PragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, (*PragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return pragmaVtabNext(tls, pVtabCursor) } // Pragma virtual table module xEof method. -func pragmaVtabEof(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:128259:12: */ +func pragmaVtabEof(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:129983:12: */ var pCsr uintptr = pVtabCursor return (libc.Bool32((*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma == uintptr(0))) } // The xColumn method simply returns the corresponding column from // the PRAGMA. -func pragmaVtabColumn(tls *libc.TLS, pVtabCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:128267:12: */ +func pragmaVtabColumn(tls *libc.TLS, pVtabCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:129991:12: */ var pCsr uintptr = pVtabCursor var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab if i < int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden) { @@ -108424,7 +109767,7 @@ func pragmaVtabColumn(tls *libc.TLS, pVtabCursor uintptr, ctx uintptr, i int32) } // Pragma virtual table module xRowid method. -func pragmaVtabRowid(tls *libc.TLS, pVtabCursor uintptr, p uintptr) int32 { /* sqlite3.c:128285:12: */ +func pragmaVtabRowid(tls *libc.TLS, pVtabCursor uintptr, p uintptr) int32 { /* sqlite3.c:130009:12: */ var pCsr uintptr = pVtabCursor *(*Sqlite_int64)(unsafe.Pointer(p)) = (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FiRowid return SQLITE_OK @@ -108442,12 +109785,12 @@ var pragmaVtabModule = Sqlite3_module{ // xCreate - create a table FxEof: 0, // xEof FxColumn: 0, // xColumn - read data FxRowid: 0, // xShadowName -} /* sqlite3.c:128292:29 */ +} /* sqlite3.c:130016:29 */ // 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 Xsqlite3PragmaVtabRegister(tls *libc.TLS, db uintptr, zName uintptr) uintptr { /* sqlite3.c:128324:23: */ +func Xsqlite3PragmaVtabRegister(tls *libc.TLS, db uintptr, zName uintptr) uintptr { /* sqlite3.c:130048:23: */ var pName uintptr pName = pragmaLocate(tls, (zName + uintptr(7))) @@ -108480,38 +109823,49 @@ func Xsqlite3PragmaVtabRegister(tls *libc.TLS, db uintptr, zName uintptr) uintpt // Fill the InitData structure with an error message that indicates // that the database is corrupt. -func corruptSchema(tls *libc.TLS, pData uintptr, zObj uintptr, zExtra uintptr) { /* sqlite3.c:128361:13: */ - bp := tls.Alloc(24) - defer tls.Free(24) +func corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) { /* sqlite3.c:130085:13: */ + bp := tls.Alloc(56) + defer tls.Free(56) var db uintptr = (*InitData)(unsafe.Pointer(pData)).Fdb if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*InitData)(unsafe.Pointer(pData)).Frc = SQLITE_NOMEM } else if *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) != uintptr(0) { // A error message has already been generated. Do not overwrite it - } else if ((*InitData)(unsafe.Pointer(pData)).FmInitFlags & INITFLAG_AlterTable) != 0 { - *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = Xsqlite3DbStrDup(tls, db, zExtra) + } else if ((*InitData)(unsafe.Pointer(pData)).FmInitFlags & (U32(INITFLAG_AlterRename | INITFLAG_AlterDrop))) != 0 { + *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = Xsqlite3MPrintf(tls, db, + ts+16056 /* "error in %s %s a..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), + func() uintptr { + if ((*InitData)(unsafe.Pointer(pData)).FmInitFlags & U32(INITFLAG_AlterRename)) != 0 { + return ts + 16084 /* "rename" */ + } + return ts + 16091 /* "drop column" */ + }(), + zExtra)) (*InitData)(unsafe.Pointer(pData)).Frc = SQLITE_ERROR - } else if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_WriteSchema) != 0 { - (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 128375) + } else if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_WriteSchema)) != 0 { + (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 130103) } else { var z uintptr - if zObj == uintptr(0) { - zObj = ts + 3963 /* "?" */ + var zObj uintptr + if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { + zObj = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) + } else { + zObj = ts + 3991 /* "?" */ } - z = Xsqlite3MPrintf(tls, db, ts+15627 /* "malformed databa..." */, libc.VaList(bp, zObj)) + z = Xsqlite3MPrintf(tls, db, ts+16103 /* "malformed databa..." */, libc.VaList(bp+32, zObj)) if (zExtra != 0) && (*(*int8)(unsafe.Pointer(zExtra)) != 0) { - z = Xsqlite3MPrintf(tls, db, ts+15658 /* "%z - %s" */, libc.VaList(bp+8, z, zExtra)) + z = Xsqlite3MPrintf(tls, db, ts+16134 /* "%z - %s" */, libc.VaList(bp+40, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 128382) + (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 130110) } } // Check to see if any sibling index (another index on the same table) // of pIndex has the same root page number, and if it does, return true. // This would indicate a corrupt schema. -func Xsqlite3IndexHasDuplicateRootPage(tls *libc.TLS, pIndex uintptr) int32 { /* sqlite3.c:128391:20: */ +func Xsqlite3IndexHasDuplicateRootPage(tls *libc.TLS, pIndex uintptr) int32 { /* sqlite3.c:130119:20: */ var p uintptr for p = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FpIndex; p != 0; p = (*Index)(unsafe.Pointer(p)).FpNext { if ((*Index)(unsafe.Pointer(p)).Ftnum == (*Index)(unsafe.Pointer(pIndex)).Ftnum) && (p != pIndex) { @@ -108533,7 +109887,7 @@ func Xsqlite3IndexHasDuplicateRootPage(tls *libc.TLS, pIndex uintptr) int32 { /* // argv[3] = root page number for table or index. 0 for trigger or view. // argv[4] = SQL text for the CREATE statement. // -func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:128425:20: */ +func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:130153:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -108544,10 +109898,10 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr _ = NotUsed _ = argc - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_EncodingFixed) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_EncodingFixed)) (*InitData)(unsafe.Pointer(pData)).FnInitRow++ if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0)) + corruptSchema(tls, pData, argv, uintptr(0)) return 1 } @@ -108555,12 +109909,19 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr return 0 } // Might happen if EMPTY_RESULT_CALLBACKS are on if *(*uintptr)(unsafe.Pointer(argv + 3*8)) == uintptr(0) { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0)) - } else if Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)), ts+15666 /* "create " */, 7) == 0 { + corruptSchema(tls, pData, argv, uintptr(0)) + } else if ((*(*uintptr)(unsafe.Pointer(argv + 4*8)) != 0) && + ('c' == int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*8)))))]))) && + ('r' == int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*8)) + 1)))])) { // Call the parser to process a CREATE TABLE, INDEX or VIEW. // But because db->init.busy is set to 1, no VDBE code is generated // or executed. All the parser does is build the internal data // structures that describe the table, index, or view. + // + // No other valid SQL statement, other than the variable CREATE statements, + // can begin with the letters "C" and "R". Thus, it is not possible run + // any other kind of statement while parsing the schema, even a corrupt + // schema. var rc int32 var saved_iDb U8 = (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb // var pStmt uintptr at bp, 8 @@ -108568,13 +109929,13 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr // Return code from sqlite3_prepare() (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(iDb) - if (Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), (db+176 /* &.init */ /* &.newTnum */)) == 0) || + if (Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), (db+184 /* &.init */ /* &.newTnum */)) == 0) || (((*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum > (*InitData)(unsafe.Pointer(pData)).FmxPage) && ((*InitData)(unsafe.Pointer(pData)).FmxPage > Pgno(0))) { if Xsqlite3Config.FbExtraSchemaChecks != 0 { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+11973 /* "invalid rootpage" */) + corruptSchema(tls, pData, argv, ts+12389 /* "invalid rootpage" */) } } - libc.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.orphanTrigger */, uint32(0), 0, 0x1) + libc.SetBitFieldPtr8Uint32(db+184 /* &.init */ +8 /* &.orphanTrigger */, uint32(0), 0, 0x1) (*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit = argv *(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = uintptr(0) sqlite3Prepare(tls, db, *(*uintptr)(unsafe.Pointer(argv + 4*8)), -1, uint32(0), uintptr(0), bp /* &pStmt */, uintptr(0)) @@ -108583,7 +109944,7 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = saved_iDb // assert( saved_iDb==0 || (db->mDbFlags & DBFLAG_Vacuum)!=0 ); if SQLITE_OK != rc { - if (uint32(int32(*(*uint8)(unsafe.Pointer(db + 176 /* &.init */ + 8 /* &.orphanTrigger */)) & 0x1 >> 0))) != 0 { + if (uint32(int32(*(*uint8)(unsafe.Pointer(db + 184 /* &.init */ + 8 /* &.orphanTrigger */)) & 0x1 >> 0))) != 0 { } else { if rc > (*InitData)(unsafe.Pointer(pData)).Frc { @@ -108592,13 +109953,13 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr if rc == SQLITE_NOMEM { Xsqlite3OomFault(tls, db) } else if (rc != SQLITE_INTERRUPT) && ((rc & 0xFF) != SQLITE_LOCKED) { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), Xsqlite3_errmsg(tls, db)) + corruptSchema(tls, pData, argv, Xsqlite3_errmsg(tls, db)) } } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) } else if (*(*uintptr)(unsafe.Pointer(argv + 1*8)) == uintptr(0)) || ((*(*uintptr)(unsafe.Pointer(argv + 4*8)) != uintptr(0)) && (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*8))))) != 0)) { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0)) + corruptSchema(tls, pData, argv, uintptr(0)) } else { // If the SQL column is blank it means this is an index that // was created to be the PRIMARY KEY or to fulfill a UNIQUE @@ -108608,13 +109969,13 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr var pIndex uintptr pIndex = Xsqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName) if pIndex == uintptr(0) { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+15674 /* "orphan index" */) + corruptSchema(tls, pData, argv, ts+16142 /* "orphan index" */) } else if (((Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), (pIndex+88 /* &.tnum */)) == 0) || ((*Index)(unsafe.Pointer(pIndex)).Ftnum < Pgno(2))) || ((*Index)(unsafe.Pointer(pIndex)).Ftnum > (*InitData)(unsafe.Pointer(pData)).FmxPage)) || (Xsqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0) { if Xsqlite3Config.FbExtraSchemaChecks != 0 { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+11973 /* "invalid rootpage" */) + corruptSchema(tls, pData, argv, ts+12389 /* "invalid rootpage" */) } } } @@ -108627,7 +109988,7 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr // 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 Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFlags U32) int32 { /* sqlite3.c:128520:20: */ +func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFlags U32) int32 { /* sqlite3.c:130255:20: */ bp := tls.Alloc(124) defer tls.Free(124) @@ -108648,7 +110009,7 @@ func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl var xAuth Sqlite3_xauth var zSql uintptr openedTransaction = 0 - mask = (int32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_EncodingFixed) | libc.Uint32FromInt32(libc.CplInt32(DBFLAG_EncodingFixed)))) + mask = (int32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) | libc.Uint32FromInt32(libc.CplInt32(DBFLAG_EncodingFixed)))) (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(1) @@ -108657,16 +110018,16 @@ func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl // table name will be inserted automatically by the parser so we can just // use the abbreviation "x" here. The parser will also automatically tag // the schema table as read-only. - *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */)) = ts + 7333 /* "table" */ + *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */)) = ts + 7386 /* "table" */ *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 1*8)) = libc.AssignUintptr(&zSchemaTabName, func() uintptr { if (!(0 != 0)) && (iDb == 1) { - return ts + 10046 /* "sqlite_temp_mast..." */ + return ts + 10411 /* "sqlite_temp_mast..." */ } - return ts + 4780 /* "sqlite_master" */ + return ts + 4825 /* "sqlite_master" */ }()) *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 2*8)) = *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 1*8)) - *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 3*8)) = ts + 6737 /* "1" */ - *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 4*8)) = ts + 15687 /* "CREATE TABLE x(t..." */ + *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 3*8)) = ts + 6782 /* "1" */ + *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 4*8)) = ts + 16155 /* "CREATE TABLE x(t..." */ *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 5*8)) = uintptr(0) (*InitData)(unsafe.Pointer(bp + 64 /* &initData */)).Fdb = db (*InitData)(unsafe.Pointer(bp + 64 /* &initData */)).FiDb = iDb @@ -108701,7 +110062,7 @@ __2: // on the b-tree database, open one now. If a transaction is opened, it // will be closed before this function returns. Xsqlite3BtreeEnter(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) - if !(!(Xsqlite3BtreeIsInReadTrans(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != 0)) { + if !(Xsqlite3BtreeTxnState(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) == SQLITE_TXN_NONE) { goto __3 } rc = Xsqlite3BtreeBeginTrans(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, 0, uintptr(0)) @@ -108745,7 +110106,7 @@ __6: goto __7 __7: ; - if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ResetDatabase) != uint64(0)) { + if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ResetDatabase)) != uint64(0)) { goto __8 } libc.Xmemset(tls, bp+104 /* &meta[0] */, 0, uint64(unsafe.Sizeof([5]int32{}))) @@ -108760,7 +110121,7 @@ __8: if !(*(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + 4*4)) != 0) { goto __9 } // text encoding - if !((iDb == 0) && (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_EncodingFixed) == U32(0))) { + if !((iDb == 0) && (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) == U32(0))) { goto __10 } // If opening the main database, set ENC(db). @@ -108768,7 +110129,7 @@ __8: if !(int32(encoding) == 0) { goto __12 } - encoding = SQLITE_UTF8 + encoding = U8(SQLITE_UTF8) __12: ; Xsqlite3SetTextEncoding(tls, db, encoding) @@ -108779,7 +110140,7 @@ __10: goto __13 } Xsqlite3SetString(tls, pzErrMsg, db, - ts+9673 /* "attached databas..." */) + ts+10038 /* "attached databas..." */) rc = SQLITE_ERROR goto initone_error_out __13: @@ -108819,7 +110180,7 @@ __16: if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > SQLITE_MAX_FILE_FORMAT) { goto __17 } - Xsqlite3SetString(tls, pzErrMsg, db, ts+15759 /* "unsupported file..." */) + Xsqlite3SetString(tls, pzErrMsg, db, ts+16227 /* "unsupported file..." */) rc = SQLITE_ERROR goto initone_error_out __17: @@ -108832,7 +110193,7 @@ __17: if !((iDb == 0) && (*(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + 1*4)) >= 4)) { goto __18 } - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_LegacyFileFmt)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_LegacyFileFmt))) __18: ; @@ -108841,7 +110202,7 @@ __18: (*InitData)(unsafe.Pointer(bp + 64 /* &initData */)).FmxPage = Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) zSql = Xsqlite3MPrintf(tls, db, - ts+15783, /* "SELECT*FROM\"%w\"...." */ + ts+16251, /* "SELECT*FROM\"%w\"...." */ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zSchemaTabName)) xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth @@ -108872,7 +110233,7 @@ __20: Xsqlite3ResetAllSchemasOfConnection(tls, db) __21: ; - if !((rc == SQLITE_OK) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_NoSchemaError) != 0)) { + if !((rc == SQLITE_OK) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NoSchemaError)) != 0)) { goto __22 } // Black magic: If the SQLITE_NoSchemaError flag is set, then consider @@ -108923,10 +110284,10 @@ __24: // // After a database is initialized, the DB_SchemaLoaded bit is set // bit is set in the flags field of the Db structure. -func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:128755:20: */ +func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:130490:20: */ var i int32 var rc int32 - var commit_internal int32 = libc.BoolInt32(!(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaChange) != 0)) + var commit_internal int32 = libc.BoolInt32(!(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != 0)) ((*Sqlite3)(unsafe.Pointer(db)).Fenc) = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb)).FpSchema)).Fenc @@ -108955,7 +110316,7 @@ func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite // This routine is a no-op if the database schema is already initialized. // Otherwise, the schema is loaded. An error code is returned. -func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:128787:20: */ +func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:130522:20: */ var rc int32 = SQLITE_OK var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb @@ -108965,7 +110326,7 @@ func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:1287 (*Parse)(unsafe.Pointer(pParse)).Frc = rc (*Parse)(unsafe.Pointer(pParse)).FnErr++ } else if (*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache != 0 { - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaKnownOk) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaKnownOk)) } } return rc @@ -108974,7 +110335,7 @@ func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:1287 // 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 *libc.TLS, pParse uintptr) { /* sqlite3.c:128809:13: */ +func schemaIsValid(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:130544:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -108993,7 +110354,7 @@ func schemaIsValid(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:128809:13: */ // If there is not already a read-only (or read-write) transaction opened // on the b-tree database, open one now. If a transaction is opened, it // will be closed immediately after reading the meta-value. - if !(Xsqlite3BtreeIsInReadTrans(tls, pBt) != 0) { + if Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_NONE { rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0)) if (rc == SQLITE_NOMEM) || (rc == (SQLITE_IOERR | (int32(12) << 8))) { Xsqlite3OomFault(tls, db) @@ -109026,7 +110387,7 @@ func schemaIsValid(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:128809:13: */ // // If the same database is attached more than once, the first // attached database is returned. -func Xsqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) int32 { /* sqlite3.c:128858:20: */ +func Xsqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) int32 { /* sqlite3.c:130593:20: */ var i int32 = -32768 // If pSchema is NULL, then return -32768. This happens when code in @@ -109052,27 +110413,22 @@ func Xsqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) int32 { / return i } -// Deallocate a single AggInfo object -func agginfoFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:128888:13: */ - Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaCol) - Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaFunc) - Xsqlite3DbFree(tls, db, p) -} - // Free all memory allocations in the pParse object -func Xsqlite3ParserReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:128897:21: */ +func Xsqlite3ParserReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:130623:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - var pThis uintptr = (*Parse)(unsafe.Pointer(pParse)).FpAggList - for pThis != 0 { - var pNext uintptr = (*AggInfo)(unsafe.Pointer(pThis)).FpNext - agginfoFree(tls, db, pThis) - pThis = pNext + for (*Parse)(unsafe.Pointer(pParse)).FpCleanup != 0 { + var pCleanup uintptr = (*Parse)(unsafe.Pointer(pParse)).FpCleanup + (*Parse)(unsafe.Pointer(pParse)).FpCleanup = (*ParseCleanup)(unsafe.Pointer(pCleanup)).FpNext + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pCleanup + 16 /* &.xCleanup */))))(tls, db, (*ParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr) + Xsqlite3DbFreeNN(tls, db, pCleanup) } Xsqlite3DbFree(tls, db, (*Parse)(unsafe.Pointer(pParse)).FaLabel) - Xsqlite3ExprListDelete(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpConstExpr) + if (*Parse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { + Xsqlite3ExprListDelete(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpConstExpr) + } if db != 0 { - *(*U32)(unsafe.Pointer(db + 400 /* &.lookaside */ /* &.bDisable */)) -= (U32((*Parse)(unsafe.Pointer(pParse)).FdisableLookaside)) + *(*U32)(unsafe.Pointer(db + 408 /* &.lookaside */ /* &.bDisable */)) -= (U32((*Parse)(unsafe.Pointer(pParse)).FdisableLookaside)) (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 { if (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 { return uint16(0) @@ -109083,34 +110439,74 @@ func Xsqlite3ParserReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:128897:21 (*Parse)(unsafe.Pointer(pParse)).FdisableLookaside = U8(0) } -// Compile the UTF-8 encoded SQL statement zSql into a statement handle. -func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pReprepare uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:128918:12: */ - bp := tls.Alloc(448) - defer tls.Free(448) +// Add a new cleanup operation to a Parser. The cleanup should happen when +// the parser object is destroyed. But, beware: the cleanup might happen +// immediately. +// +// Use this mechanism for uncommon cleanups. There is a higher setup +// cost for this mechansim (an extra malloc), so it should not be used +// for common cleanups that happen on most calls. But for less +// common cleanups, we save a single NULL-pointer comparison in +// sqlite3ParserReset(), which reduces the total CPU cycle count. +// +// If a memory allocation error occurs, then the cleanup happens immediately. +// When either SQLITE_DEBUG or SQLITE_COVERAGE_TEST are defined, the +// pParse->earlyCleanup flag is set in that case. Calling code show verify +// that test cases exist for which this happens, to guard against possible +// use-after-free errors following an OOM. The preferred way to do this is +// to immediately follow the call to this routine with: +// +// testcase( pParse->earlyCleanup ); +// +// This routine returns a copy of its pPtr input (the third parameter) +// except if an early cleanup occurs, in which case it returns NULL. So +// another way to check for early cleanup is to check the return value. +// Or, stop using the pPtr parameter with this call and use only its +// return value thereafter. Something like this: +// +// pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); +func Xsqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) uintptr { /* sqlite3.c:130671:21: */ + var pCleanup uintptr = Xsqlite3DbMallocRaw(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(ParseCleanup{}))) + if pCleanup != 0 { + (*ParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*Parse)(unsafe.Pointer(pParse)).FpCleanup + (*Parse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup + (*ParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr + (*ParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + } else { + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&xCleanup)))(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pPtr) + pPtr = uintptr(0) + } + return pPtr +} - // var zErrMsg uintptr at bp+440, 8 +// Compile the UTF-8 encoded SQL statement zSql into a statement handle. +func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pReprepare uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:130695:12: */ + bp := tls.Alloc(432) + defer tls.Free(432) + + // var zErrMsg uintptr at bp+424, 8 // Error message var rc int32 // Result code var i int32 // Loop counter - // var sParse Parse at bp+16, 424 + // var sParse Parse at bp+16, 408 var zDb uintptr var pBt uintptr var zSqlCopy uintptr var mxLen int32 var pT uintptr - *(*uintptr)(unsafe.Pointer(bp + 440 /* zErrMsg */)) = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 424 /* zErrMsg */)) = uintptr(0) rc = SQLITE_OK // Parsing context - libc.Xmemset(tls, bp+16 /* &sParse */, 0, uint64((uintptr(0) + 212 /* &.aTempReg */))) - libc.Xmemset(tls, ((bp + 16 /* &sParse */) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), 0, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */))))) + libc.Xmemset(tls, bp+16 /* &sParse */, 0, uint64((uintptr(0) + 208 /* &.aTempReg */))) + libc.Xmemset(tls, ((bp + 16 /* &sParse */) + uintptr((uint64((uintptr(0) + 256 /* &.sLastToken */))))), 0, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 256 /* &.sLastToken */))))) (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FpReprepare = pReprepare // assert( !db->mallocFailed ); // not true with SQLITE_USE_ALLOCA // For a long-term use prepared statement avoid the use of // lookaside memory. - if !((prepFlags & SQLITE_PREPARE_PERSISTENT) != 0) { + if !((prepFlags & U32(SQLITE_PREPARE_PERSISTENT)) != 0) { goto __1 } (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FdisableLookaside++ @@ -109118,7 +110514,7 @@ func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepF (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0) __1: ; - (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FdisableVtab = (U8(libc.Bool32((prepFlags & SQLITE_PREPARE_NO_VTAB) != U32(0)))) + (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FdisableVtab = (U8(libc.Bool32((prepFlags & U32(SQLITE_PREPARE_NO_VTAB)) != U32(0)))) // Check to verify that it is possible to get a read lock on all // database schemas. The inability to get a read lock indicates that @@ -109160,7 +110556,7 @@ __3: goto __7 } zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FzDbSName - Xsqlite3ErrorWithMsg(tls, db, rc, ts+15817 /* "database schema ..." */, libc.VaList(bp, zDb)) + Xsqlite3ErrorWithMsg(tls, db, rc, ts+16285 /* "database schema ..." */, libc.VaList(bp, zDb)) goto end_prepare __7: @@ -109183,12 +110579,12 @@ __2: if !((nBytes >= 0) && ((nBytes == 0) || (int32(*(*int8)(unsafe.Pointer(zSql + uintptr((nBytes - 1))))) != 0))) { goto __8 } - mxLen = *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 1*4)) + mxLen = *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 1*4)) if !(nBytes > mxLen) { goto __10 } - Xsqlite3ErrorWithMsg(tls, db, SQLITE_TOOBIG, ts+15847 /* "statement too lo..." */, 0) + Xsqlite3ErrorWithMsg(tls, db, SQLITE_TOOBIG, ts+16315 /* "statement too lo..." */, 0) rc = Xsqlite3ApiExit(tls, db, SQLITE_TOOBIG) goto end_prepare __10: @@ -109197,7 +110593,7 @@ __10: if !(zSqlCopy != 0) { goto __11 } - Xsqlite3RunParser(tls, bp+16 /* &sParse */, zSqlCopy, bp+440 /* &zErrMsg */) + Xsqlite3RunParser(tls, bp+16 /* &sParse */, zSqlCopy, bp+424 /* &zErrMsg */) (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FzTail = (zSql + uintptr(((int64((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzTail) - int64(zSqlCopy)) / 1))) Xsqlite3DbFree(tls, db, zSqlCopy) goto __12 @@ -109207,79 +110603,75 @@ __12: ; goto __9 __8: - Xsqlite3RunParser(tls, bp+16 /* &sParse */, zSql, bp+440 /* &zErrMsg */) + Xsqlite3RunParser(tls, bp+16 /* &sParse */, zSql, bp+424 /* &zErrMsg */) __9: ; - if !((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc == SQLITE_DONE) { + if !(pzTail != 0) { goto __13 } - (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).Frc = SQLITE_OK -__13: - ; - if !((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FcheckSchema != 0) { - goto __14 - } - schemaIsValid(tls, bp+16 /* &sParse */) -__14: - ; - if !(pzTail != 0) { - goto __15 - } *(*uintptr)(unsafe.Pointer(pzTail)) = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FzTail -__15: +__13: ; if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0) { - goto __16 + goto __14 } Xsqlite3VdbeSetSql(tls, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FpVdbe, zSql, (int32((int64((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzTail) - int64(zSql)) / 1)), uint8(prepFlags)) -__16: +__14: ; if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - goto __17 + goto __15 } (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).Frc = SQLITE_NOMEM -__17: +__15: ; - rc = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).Frc - if !(rc != SQLITE_OK) { + if !(((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc != SQLITE_OK) && ((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc != SQLITE_DONE)) { + goto __16 + } + if !((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FcheckSchema != 0) { goto __18 } + schemaIsValid(tls, bp+16 /* &sParse */) +__18: + ; if !((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FpVdbe != 0) { - goto __20 + goto __19 } Xsqlite3VdbeFinalize(tls, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FpVdbe) -__20: - ; - - goto __19 -__18: - *(*uintptr)(unsafe.Pointer(ppStmt)) = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FpVdbe __19: ; - if !(*(*uintptr)(unsafe.Pointer(bp + 440 /* zErrMsg */)) != 0) { - goto __21 + rc = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).Frc + if !(*(*uintptr)(unsafe.Pointer(bp + 424 /* zErrMsg */)) != 0) { + goto __20 } - Xsqlite3ErrorWithMsg(tls, db, rc, ts+2690 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 440 /* zErrMsg */)))) - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 440 /* zErrMsg */))) - goto __22 -__21: + Xsqlite3ErrorWithMsg(tls, db, rc, ts+2718 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 424 /* zErrMsg */)))) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 424 /* zErrMsg */))) + goto __21 +__20: Xsqlite3Error(tls, db, rc) -__22: +__21: + ; + goto __17 +__16: + ; + *(*uintptr)(unsafe.Pointer(ppStmt)) = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FpVdbe + rc = SQLITE_OK + Xsqlite3ErrorClear(tls, db) +__17: ; // Delete any TriggerPrg structures allocated while parsing this statement. -__23: +__22: if !((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FpTriggerPrg != 0) { - goto __24 + goto __23 } pT = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FpTriggerPrg (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FpTriggerPrg = (*TriggerPrg)(unsafe.Pointer(pT)).FpNext Xsqlite3DbFree(tls, db, pT) - goto __23 -__24: + goto __22 +__23: ; end_prepare: @@ -109288,13 +110680,13 @@ end_prepare: return rc } -func sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pOld uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129056:12: */ +func sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pOld uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:130835:12: */ var rc int32 var cnt int32 = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(Xsqlite3SafetyCheckOk(tls, db) != 0) || (zSql == uintptr(0)) { - return Xsqlite3MisuseError(tls, 129073) + return Xsqlite3MisuseError(tls, 130852) } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) Xsqlite3BtreeEnterAll(tls, db) @@ -109309,6 +110701,7 @@ func sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32 Xsqlite3BtreeLeaveAll(tls, db) rc = Xsqlite3ApiExit(tls, db, rc) + (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return rc } @@ -109319,7 +110712,7 @@ func sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32 // if the statement cannot be recompiled because another connection has // locked the sqlite3_schema table, return SQLITE_LOCKED. If any other error // occurs, return SQLITE_SCHEMA. -func Xsqlite3Reprepare(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:129101:20: */ +func Xsqlite3Reprepare(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:130881:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -109358,27 +110751,27 @@ func Xsqlite3Reprepare(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:129101:20: // 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 *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129140:16: */ +func Xsqlite3_prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:130920:16: */ var rc int32 rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, uint32(0), uintptr(0), ppStmt, pzTail) // VERIFY: F13021 return rc } -func Xsqlite3_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129152:16: */ +func Xsqlite3_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:130932:16: */ var rc int32 // EVIDENCE-OF: R-37923-12173 The sqlite3_prepare_v2() interface works // exactly the same as sqlite3_prepare_v3() with a zero prepFlags // parameter. // // Proof in that the 5th parameter to sqlite3LockAndPrepare is 0 - rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, SQLITE_PREPARE_SAVESQL, uintptr(0), + rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL), uintptr(0), ppStmt, pzTail) return rc } -func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129170:16: */ +func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:130950:16: */ var rc int32 // EVIDENCE-OF: R-56861-42673 sqlite3_prepare_v3() differs from // sqlite3_prepare_v2() only in having the extra prepFlags parameter, @@ -109388,14 +110781,14 @@ func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, // Proof by comparison to the implementation of sqlite3_prepare_v2() // directly above. rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, - (SQLITE_PREPARE_SAVESQL | (prepFlags & SQLITE_PREPARE_MASK)), + (uint32(SQLITE_PREPARE_SAVESQL) | (prepFlags & uint32(SQLITE_PREPARE_MASK))), uintptr(0), ppStmt, pzTail) return rc } // Compile the UTF-16 encoded SQL statement zSql into a statement handle. -func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129198:12: */ +func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:130978:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -109408,7 +110801,7 @@ func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pre *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(Xsqlite3SafetyCheckOk(tls, db) != 0) || (zSql == uintptr(0)) { - return Xsqlite3MisuseError(tls, 129219) + return Xsqlite3MisuseError(tls, 130999) } if nBytes >= 0 { var sz int32 @@ -109418,7 +110811,7 @@ func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pre nBytes = sz } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - zSql8 = Xsqlite3Utf16to8(tls, db, zSql, nBytes, SQLITE_UTF16LE) + zSql8 = Xsqlite3Utf16to8(tls, db, zSql, nBytes, uint8(SQLITE_UTF16LE)) if zSql8 != 0 { rc = sqlite3LockAndPrepare(tls, db, zSql8, -1, prepFlags, uintptr(0), ppStmt, bp /* &zTail8 */) } @@ -109443,24 +110836,24 @@ func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pre // 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 *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129256:16: */ +func Xsqlite3_prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:131036:16: */ var rc int32 rc = sqlite3Prepare16(tls, db, zSql, nBytes, uint32(0), ppStmt, pzTail) // VERIFY: F13021 return rc } -func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129268:16: */ +func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:131048:16: */ var rc int32 - rc = sqlite3Prepare16(tls, db, zSql, nBytes, SQLITE_PREPARE_SAVESQL, ppStmt, pzTail) + rc = sqlite3Prepare16(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL), ppStmt, pzTail) // VERIFY: F13021 return rc } -func Xsqlite3_prepare16_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129280:16: */ +func Xsqlite3_prepare16_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:131060:16: */ var rc int32 rc = sqlite3Prepare16(tls, db, zSql, nBytes, - (SQLITE_PREPARE_SAVESQL | (prepFlags & SQLITE_PREPARE_MASK)), + (uint32(SQLITE_PREPARE_SAVESQL) | (prepFlags & uint32(SQLITE_PREPARE_MASK))), ppStmt, pzTail) // VERIFY: F13021 return rc @@ -109491,7 +110884,7 @@ type DistinctCtx1 = struct { _ [2]byte FtabTnct int32 FaddrTnct int32 -} /* sqlite3.c:129321:9 */ +} /* sqlite3.c:131101:9 */ //************* End of prepare.c ******************************************** //************* Begin file select.c ***************************************** @@ -109512,7 +110905,7 @@ type DistinctCtx1 = struct { // An instance of the following object is used to record information about // how to process the DISTINCT keyword, to simplify passing that information // into the selectInnerLoop() routine. -type DistinctCtx = DistinctCtx1 /* sqlite3.c:129321:28 */ +type DistinctCtx = DistinctCtx1 /* sqlite3.c:131101:28 */ // An instance of the following object is used to record information about // the ORDER BY (or GROUP BY) clause of query is being coded. @@ -109542,7 +110935,7 @@ type SortCtx1 = struct { FsortFlags U8 _ [3]byte FpDeferredRowLoad uintptr -} /* sqlite3.c:129347:9 */ +} /* sqlite3.c:131127:9 */ // An instance of the following object is used to record information about // the ORDER BY (or GROUP BY) clause of query is being coded. @@ -109560,19 +110953,19 @@ type SortCtx1 = struct { // When the sorter-reference optimization is used, there is one entry in the // aDefer[] array for each database table that may be read as values are // extracted from the sorter. -type SortCtx = SortCtx1 /* sqlite3.c:129347:24 */ +type SortCtx = SortCtx1 /* sqlite3.c:131127:24 */ type RowLoadInfo1 = struct { FregResult int32 FecelFlags U8 _ [3]byte -} /* sqlite3.c:129347:9 */ +} /* sqlite3.c:131127:9 */ // Delete all the content of a Select structure. Deallocate the structure // itself depending on the value of bFree // // If bFree==1, call sqlite3DbFree() on the p object. // If bFree==0, Leave the first Select object unfreed -func clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3.c:129377:13: */ +func clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3.c:131157:13: */ for p != 0 { var pPrior uintptr = (*Select)(unsafe.Pointer(p)).FpPrior Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpEList) @@ -109582,11 +110975,15 @@ func clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3 Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpHaving) Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpOrderBy) Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit) + if (*Select)(unsafe.Pointer(p)).FpWith != 0 { + Xsqlite3WithDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpWith) + } if (*Select)(unsafe.Pointer(p)).FpWinDefn != 0 { Xsqlite3WindowListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpWinDefn) } - if (*Select)(unsafe.Pointer(p)).FpWith != 0 { - Xsqlite3WithDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpWith) + for (*Select)(unsafe.Pointer(p)).FpWin != 0 { + + Xsqlite3WindowUnlinkFromSelect(tls, (*Select)(unsafe.Pointer(p)).FpWin) } if bFree != 0 { Xsqlite3DbFreeNN(tls, db, p) @@ -109597,7 +110994,7 @@ func clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3 } // Initialize a SelectDest structure. -func Xsqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int32) { /* sqlite3.c:129402:21: */ +func Xsqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int32) { /* sqlite3.c:131186:21: */ (*SelectDest)(unsafe.Pointer(pDest)).FeDest = U8(eDest) (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm = iParm (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = 0 @@ -109608,7 +111005,7 @@ func Xsqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int // Allocate a new Select structure and return a pointer to that // structure. -func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintptr, pWhere uintptr, pGroupBy uintptr, pHaving uintptr, pOrderBy uintptr, selFlags U32, pLimit uintptr) uintptr { /* sqlite3.c:129416:23: */ +func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintptr, pWhere uintptr, pGroupBy uintptr, pHaving uintptr, pOrderBy uintptr, selFlags U32, pLimit uintptr) uintptr { /* sqlite3.c:131200:23: */ bp := tls.Alloc(128) defer tls.Free(128) @@ -109626,7 +111023,7 @@ func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ASTERISK, uintptr(0))) } (*Select)(unsafe.Pointer(pNew)).FpEList = pEList - (*Select)(unsafe.Pointer(pNew)).Fop = TK_SELECT + (*Select)(unsafe.Pointer(pNew)).Fop = U8(TK_SELECT) (*Select)(unsafe.Pointer(pNew)).FselFlags = selFlags (*Select)(unsafe.Pointer(pNew)).FiLimit = 0 (*Select)(unsafe.Pointer(pNew)).FiOffset = 0 @@ -109658,14 +111055,14 @@ func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp } // Delete the given Select structure and all of its substructures. -func Xsqlite3SelectDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:129474:21: */ +func Xsqlite3SelectDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:131258:21: */ if p != 0 { clearSelect(tls, db, p, 1) } } // Return a pointer to the right-most SELECT statement in a compound. -func findRightmost(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:129481:15: */ +func findRightmost(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:131265:15: */ for (*Select)(unsafe.Pointer(p)).FpNext != 0 { p = (*Select)(unsafe.Pointer(p)).FpNext } @@ -109687,7 +111084,7 @@ func findRightmost(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:129481:15: * // // If an illegal or unsupported join type is seen, then still return // a join type, but put an error in the pParse structure. -func Xsqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC uintptr) int32 { /* sqlite3.c:129503:20: */ +func Xsqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC uintptr) int32 { /* sqlite3.c:131287:20: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -109724,41 +111121,41 @@ func Xsqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC } } if ((jointype & (JT_INNER | JT_OUTER)) == (JT_INNER | JT_OUTER)) || ((jointype & JT_ERROR) != 0) { - var zSp uintptr = ts + 12763 /* " " */ + var zSp uintptr = ts + 9214 /* " " */ if pC == uintptr(0) { zSp++ } Xsqlite3ErrorMsg(tls, pParse, - ts+15866 /* "unknown or unsup..." */, libc.VaList(bp, pA, pB, zSp, pC)) + ts+16334 /* "unknown or unsup..." */, libc.VaList(bp, pA, pB, zSp, pC)) jointype = JT_INNER } else if ((jointype & JT_OUTER) != 0) && ((jointype & (JT_LEFT | JT_RIGHT)) != JT_LEFT) { Xsqlite3ErrorMsg(tls, pParse, - ts+15910 /* "RIGHT and FULL O..." */, 0) + ts+16378 /* "RIGHT and FULL O..." */, 0) jointype = JT_INNER } return jointype } -var zKeyText = *(*[34]int8)(unsafe.Pointer(ts + 15965 /* "naturaleftouteri..." */)) /* sqlite3.c:129508:21 */ +var zKeyText = *(*[34]int8)(unsafe.Pointer(ts + 16433 /* "naturaleftouteri..." */)) /* sqlite3.c:131292:21 */ var aKeyword = [7]struct { Fi U8 FnChar U8 Fcode U8 }{ - /* natural */ {FnChar: U8(7), Fcode: JT_NATURAL}, + /* natural */ {FnChar: U8(7), Fcode: U8(JT_NATURAL)}, /* left */ {Fi: U8(6), FnChar: U8(4), Fcode: (U8(JT_LEFT | JT_OUTER))}, - /* outer */ {Fi: U8(10), FnChar: U8(5), Fcode: JT_OUTER}, + /* outer */ {Fi: U8(10), FnChar: U8(5), Fcode: U8(JT_OUTER)}, /* right */ {Fi: U8(14), FnChar: U8(5), Fcode: (U8(JT_RIGHT | JT_OUTER))}, /* full */ {Fi: U8(19), FnChar: U8(4), Fcode: (U8((JT_LEFT | JT_RIGHT) | JT_OUTER))}, - /* inner */ {Fi: U8(23), FnChar: U8(5), Fcode: JT_INNER}, + /* inner */ {Fi: U8(23), FnChar: U8(5), Fcode: U8(JT_INNER)}, /* cross */ {Fi: U8(28), FnChar: U8(5), Fcode: (U8(JT_INNER | JT_CROSS))}, -} /* sqlite3.c:129513:5 */ +} /* sqlite3.c:131297:5 */ // Return the index of a column in a table. Return -1 if the column // is not contained in the table. -func columnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) int32 { /* sqlite3.c:129564:12: */ +func Xsqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) int32 { /* sqlite3.c:131348:20: */ var i int32 var h U8 = Xsqlite3StrIHash(tls, zCol) var pCol uintptr @@ -109792,15 +111189,15 @@ __3: // of the matching column and return TRUE. // // If not found, return FALSE. -func tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, N int32, zCol uintptr, piTab uintptr, piCol uintptr, bIgnoreHidden int32) int32 { /* sqlite3.c:129583:12: */ +func tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, N int32, zCol uintptr, piTab uintptr, piCol uintptr, bIgnoreHidden int32) int32 { /* sqlite3.c:131367:12: */ var i int32 // For looping over tables in pSrc var iCol int32 // Index of column matching zCol // Both or neither are NULL for i = 0; i < N; i++ { - iCol = columnIndex(tls, (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpTab, zCol) + iCol = Xsqlite3ColumnIndex(tls, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpTab, zCol) if (iCol >= 0) && - ((bIgnoreHidden == 0) || ((libc.Bool32((int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpTab)).FaCol + uintptr(iCol)*32))).FcolFlags) & COLFLAG_HIDDEN) != 0)) == 0)) { + ((bIgnoreHidden == 0) || ((libc.Bool32((int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpTab)).FaCol + uintptr(iCol)*32))).FcolFlags) & COLFLAG_HIDDEN) != 0)) == 0)) { if piTab != 0 { *(*int32)(unsafe.Pointer(piTab)) = i *(*int32)(unsafe.Pointer(piCol)) = iCol @@ -109820,7 +111217,7 @@ func tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, N int32, zCol uintptr, piT // 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 *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iColLeft int32, iRight int32, iColRight int32, isOuterJoin int32, ppWhere uintptr) { /* sqlite3.c:129621:13: */ +func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iColLeft int32, iRight int32, iColRight int32, isOuterJoin int32, ppWhere uintptr) { /* sqlite3.c:131405:13: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pE1 uintptr var pE2 uintptr @@ -109831,9 +111228,9 @@ func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iCol pEq = Xsqlite3PExpr(tls, pParse, TK_EQ, pE1, pE2) if (pEq != 0) && (isOuterJoin != 0) { - *(*U32)(unsafe.Pointer(pEq + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(pEq + 4 /* &.flags */)) |= (U32(EP_FromJoin)) - (*Expr)(unsafe.Pointer(pEq)).FiRightJoinTable = I16((*Expr)(unsafe.Pointer(pE2)).FiTable) + (*Expr)(unsafe.Pointer(pEq)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pE2)).FiTable } *(*uintptr)(unsafe.Pointer(ppWhere)) = Xsqlite3ExprAnd(tls, pParse, *(*uintptr)(unsafe.Pointer(ppWhere)), pEq) } @@ -109862,11 +111259,11 @@ func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iCol // 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 Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:129680:21: */ +func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:131464:21: */ for p != 0 { - *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (U32(EP_FromJoin)) - (*Expr)(unsafe.Pointer(p)).FiRightJoinTable = I16(iTable) + (*Expr)(unsafe.Pointer(p)).FiRightJoinTable = iTable if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION) && (*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0) { var i int32 for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)))).FnExpr; i++ { @@ -109883,12 +111280,15 @@ func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c: // an ordinary term that omits the EP_FromJoin mark. // // This happens when a LEFT JOIN is simplified into an ordinary JOIN. -func unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:129703:13: */ +func unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:131487:13: */ for p != 0 { - if (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_FromJoin)) != U32(0)) && - ((iTable < 0) || (int32((*Expr)(unsafe.Pointer(p)).FiRightJoinTable) == iTable)) { + if (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_FromJoin))) != U32(0)) && + ((iTable < 0) || ((*Expr)(unsafe.Pointer(p)).FiRightJoinTable == iTable)) { *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_FromJoin))) } + if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(p)).FiTable == iTable) { + *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_CanBeNull))) + } if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION) && (*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0) { var i int32 for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)))).FnExpr; i++ { @@ -109912,7 +111312,7 @@ func unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:129703 // also attached to the left entry. // // This routine returns the number of errors encountered. -func sqliteProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:129734:12: */ +func sqliteProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:131521:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -109931,20 +111331,20 @@ __1: goto __3 } { - var pRightTab uintptr = (*SrcList_item)(unsafe.Pointer(pRight)).FpTab + var pRightTab uintptr = (*SrcItem)(unsafe.Pointer(pRight)).FpTab var isOuter int32 - if ((*SrcList_item)(unsafe.Pointer(pLeft)).FpTab == uintptr(0)) || (pRightTab == uintptr(0)) { + if ((*SrcItem)(unsafe.Pointer(pLeft)).FpTab == uintptr(0)) || (pRightTab == uintptr(0)) { goto __2 } - isOuter = (libc.Bool32((int32((*SrcList_item)(unsafe.Pointer(pRight)).Ffg.Fjointype) & JT_OUTER) != 0)) + isOuter = (libc.Bool32((int32((*SrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype) & JT_OUTER) != 0)) // When the NATURAL keyword is present, add WHERE clause terms for // every column that the two tables have in common. - if (int32((*SrcList_item)(unsafe.Pointer(pRight)).Ffg.Fjointype) & JT_NATURAL) != 0 { - if ((*SrcList_item)(unsafe.Pointer(pRight)).FpOn != 0) || ((*SrcList_item)(unsafe.Pointer(pRight)).FpUsing != 0) { + if (int32((*SrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype) & JT_NATURAL) != 0 { + if ((*SrcItem)(unsafe.Pointer(pRight)).FpOn != 0) || ((*SrcItem)(unsafe.Pointer(pRight)).FpUsing != 0) { Xsqlite3ErrorMsg(tls, pParse, - ts+15999 /* "a NATURAL join m..." */, libc.VaList(bp, 0)) + ts+16467 /* "a NATURAL join m..." */, libc.VaList(bp, 0)) return 1 } for j = 0; j < int32((*Table)(unsafe.Pointer(pRightTab)).FnCol); j++ { @@ -109966,20 +111366,20 @@ __1: } // Disallow both ON and USING clauses in the same join - if ((*SrcList_item)(unsafe.Pointer(pRight)).FpOn != 0) && ((*SrcList_item)(unsafe.Pointer(pRight)).FpUsing != 0) { + if ((*SrcItem)(unsafe.Pointer(pRight)).FpOn != 0) && ((*SrcItem)(unsafe.Pointer(pRight)).FpUsing != 0) { Xsqlite3ErrorMsg(tls, pParse, - ts+16049 /* "cannot have both..." */, 0) + ts+16517 /* "cannot have both..." */, 0) return 1 } // Add the ON clause to the end of the WHERE clause, connected by // an AND operator. - if (*SrcList_item)(unsafe.Pointer(pRight)).FpOn != 0 { + if (*SrcItem)(unsafe.Pointer(pRight)).FpOn != 0 { if isOuter != 0 { - Xsqlite3SetJoinExpr(tls, (*SrcList_item)(unsafe.Pointer(pRight)).FpOn, (*SrcList_item)(unsafe.Pointer(pRight)).FiCursor) + Xsqlite3SetJoinExpr(tls, (*SrcItem)(unsafe.Pointer(pRight)).FpOn, (*SrcItem)(unsafe.Pointer(pRight)).FiCursor) } - (*Select)(unsafe.Pointer(p)).FpWhere = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcList_item)(unsafe.Pointer(pRight)).FpOn) - (*SrcList_item)(unsafe.Pointer(pRight)).FpOn = uintptr(0) + (*Select)(unsafe.Pointer(p)).FpWhere = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pRight)).FpOn) + (*SrcItem)(unsafe.Pointer(pRight)).FpOn = uintptr(0) } // Create extra terms on the WHERE clause for each column named @@ -109988,8 +111388,8 @@ __1: // to the WHERE clause: A.X=B.X AND A.Y=B.Y AND A.Z=B.Z // Report an error if any column mentioned in the USING clause is // not contained in both tables to be joined. - if (*SrcList_item)(unsafe.Pointer(pRight)).FpUsing != 0 { - var pList uintptr = (*SrcList_item)(unsafe.Pointer(pRight)).FpUsing + if (*SrcItem)(unsafe.Pointer(pRight)).FpUsing != 0 { + var pList uintptr = (*SrcItem)(unsafe.Pointer(pRight)).FpUsing for j = 0; j < (*IdList)(unsafe.Pointer(pList)).FnId; j++ { var zName uintptr // Name of the term in the USING clause // var iLeft int32 at bp+24, 4 @@ -109999,11 +111399,11 @@ __1: var iRightCol int32 // Column number of matching column on the right zName = (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pList)).Fa + uintptr(j)*16)).FzName - iRightCol = columnIndex(tls, pRightTab, zName) + iRightCol = Xsqlite3ColumnIndex(tls, pRightTab, zName) if (iRightCol < 0) || !(tableAndColumnIndex(tls, pSrc, (i+1), zName, bp+24 /* &iLeft */, bp+28 /* &iLeftCol */, 0) != 0) { Xsqlite3ErrorMsg(tls, pParse, - ts+16104 /* "cannot join usin..." */, libc.VaList(bp+8, zName)) + ts+16572 /* "cannot join usin..." */, libc.VaList(bp+8, zName)) return 1 } addWhereTerm(tls, pParse, pSrc, *(*int32)(unsafe.Pointer(bp + 24 /* iLeft */)), *(*int32)(unsafe.Pointer(bp + 28 /* iLeftCol */)), (i + 1), iRightCol, @@ -110026,11 +111426,11 @@ __3: // An instance of this object holds information (beyond pParse and pSelect) // needed to load the next result row that is to be added to the sorter. -type RowLoadInfo = RowLoadInfo1 /* sqlite3.c:129826:28 */ +type RowLoadInfo = RowLoadInfo1 /* sqlite3.c:131613:28 */ // This routine does the work of loading query data into an array of // registers so that it can be added to the sorter. -func innerLoopLoadRow(tls *libc.TLS, pParse uintptr, pSelect uintptr, pInfo uintptr) { /* sqlite3.c:129840:13: */ +func innerLoopLoadRow(tls *libc.TLS, pParse uintptr, pSelect uintptr, pInfo uintptr) { /* sqlite3.c:131627:13: */ Xsqlite3ExprCodeExprList(tls, pParse, (*Select)(unsafe.Pointer(pSelect)).FpEList, (*RowLoadInfo)(unsafe.Pointer(pInfo)).FregResult, 0, (*RowLoadInfo)(unsafe.Pointer(pInfo)).FecelFlags) } @@ -110039,7 +111439,7 @@ func innerLoopLoadRow(tls *libc.TLS, pParse uintptr, pSelect uintptr, pInfo uint // added into the sorter. // // Return the register in which the result is stored. -func makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regBase int32, nBase int32) int32 { /* sqlite3.c:129861:12: */ +func makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regBase int32, nBase int32) int32 { /* sqlite3.c:131648:12: */ var nOBSat int32 = (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var regOut int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) @@ -110052,7 +111452,7 @@ func makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uint // Generate code that will push the record in registers regData // through regData+nData-1 onto the sorter. -func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regData int32, regOrigData int32, nData int32, nPrefixReg int32) { /* sqlite3.c:129882:13: */ +func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regData int32, regOrigData int32, nData int32, nPrefixReg int32) { /* sqlite3.c:131669:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Stmt under construction var bSeq int32 = (libc.Bool32((int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags) & SORTFLAG_UseSorter) == 0)) var nExpr int32 = (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy)).FnExpr // No. of ORDER BY terms @@ -110195,7 +111595,7 @@ func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintpt } // Add code to implement the OFFSET -func codeOffset(tls *libc.TLS, v uintptr, iOffset int32, iContinue int32) { /* sqlite3.c:130024:13: */ +func codeOffset(tls *libc.TLS, v uintptr, iOffset int32, iContinue int32) { /* sqlite3.c:131811:13: */ if iOffset > 0 { Xsqlite3VdbeAddOp3(tls, v, OP_IfPos, iOffset, iContinue, 1) @@ -110209,7 +111609,7 @@ func codeOffset(tls *libc.TLS, v uintptr, iOffset int32, iContinue int32) { /* s // // 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 *libc.TLS, pParse uintptr, iTab int32, addrRepeat int32, N int32, iMem int32) { /* sqlite3.c:130044:13: */ +func codeDistinct(tls *libc.TLS, pParse uintptr, iTab int32, addrRepeat int32, N int32, iMem int32) { /* sqlite3.c:131831:13: */ var v uintptr var r1 int32 @@ -110218,7 +111618,7 @@ func codeDistinct(tls *libc.TLS, pParse uintptr, iTab int32, addrRepeat int32, N Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iTab, addrRepeat, iMem, N) Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, iMem, N, r1) Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iTab, r1, iMem, N) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) Xsqlite3ReleaseTempReg(tls, pParse, r1) } @@ -110229,7 +111629,7 @@ func codeDistinct(tls *libc.TLS, pParse uintptr, iTab int32, addrRepeat int32, N // are evaluated in order to get the data for this row. If srcTab is // zero or more, then data is pulled from srcTab and p->pEList is used only // to get the number of columns and the collation sequence for each column. -func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSort uintptr, pDistinct uintptr, pDest uintptr, iContinue int32, iBreak int32) { /* sqlite3.c:130153:13: */ +func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSort uintptr, pDistinct uintptr, pDest uintptr, iContinue int32, iBreak int32) { /* sqlite3.c:131940:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -110298,7 +111698,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo var ecelFlags U8 // "ecel" is an abbreviation of "ExprCodeExprList" var pEList uintptr if ((eDest == SRT_Mem) || (eDest == SRT_Output)) || (eDest == SRT_Coroutine) { - ecelFlags = SQLITE_ECEL_DUP + ecelFlags = U8(SQLITE_ECEL_DUP) } else { ecelFlags = U8(0) } @@ -110364,7 +111764,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo // row is all NULLs. Xsqlite3VdbeChangeToNoop(tls, v, (*DistinctCtx)(unsafe.Pointer(pDistinct)).FaddrTnct) pOp = Xsqlite3VdbeGetOp(tls, v, (*DistinctCtx)(unsafe.Pointer(pDistinct)).FaddrTnct) - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Null + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Null) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = 1 (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = regPrev pOp = uintptr(0) // Ensure pOp is not used after sqlite3VdbeAddOp() @@ -110380,7 +111780,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo } Xsqlite3VdbeChangeP4(tls, v, -1, pColl, -2) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NULLEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ)) } Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regResult, regPrev, (nResultCol - 1)) @@ -110466,7 +111866,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo var r2 int32 = Xsqlite3GetTempReg(tls, pParse) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iParm, r2) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, r1, r2) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3ReleaseTempReg(tls, pParse, r2) } Xsqlite3ReleaseTempRange(tls, pParse, r1, (nPrefixReg + 1)) @@ -110599,7 +111999,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regResult, nResultCol, r3) if eDest == SRT_DistQueue { Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, (iParm + 1), r3) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) } for i = 0; i < nKey; i++ { Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, @@ -110640,7 +112040,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo // Allocate a KeyInfo object sufficient for an index of N key columns and // X extra columns. -func Xsqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) uintptr { /* sqlite3.c:130595:24: */ +func Xsqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) uintptr { /* sqlite3.c:132382:24: */ var nExtra int32 = (int32(((uint64(N + X)) * (uint64(unsafe.Sizeof(uintptr(0))) + uint64(1))) - uint64(unsafe.Sizeof(uintptr(0))))) var p uintptr = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint64(unsafe.Sizeof(KeyInfo{})) + uint64(nExtra)))) if p != 0 { @@ -110658,7 +112058,7 @@ func Xsqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) uintptr { } // Deallocate a KeyInfo object -func Xsqlite3KeyInfoUnref(tls *libc.TLS, p uintptr) { /* sqlite3.c:130615:21: */ +func Xsqlite3KeyInfoUnref(tls *libc.TLS, p uintptr) { /* sqlite3.c:132402:21: */ if p != 0 { (*KeyInfo)(unsafe.Pointer(p)).FnRef-- @@ -110669,7 +112069,7 @@ func Xsqlite3KeyInfoUnref(tls *libc.TLS, p uintptr) { /* sqlite3.c:130615:21: */ } // Make a new pointer to a KeyInfo object -func Xsqlite3KeyInfoRef(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:130626:24: */ +func Xsqlite3KeyInfoRef(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:132413:24: */ if p != 0 { (*KeyInfo)(unsafe.Pointer(p)).FnRef++ @@ -110689,7 +112089,7 @@ func Xsqlite3KeyInfoRef(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:130626: // Space to hold the KeyInfo structure is obtained from malloc. The calling // function is responsible for seeing that this structure is eventually // freed. -func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, iStart int32, nExtra int32) uintptr { /* sqlite3.c:130658:24: */ +func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, iStart int32, nExtra int32) uintptr { /* sqlite3.c:132445:24: */ var nExpr int32 var pInfo uintptr var pItem uintptr @@ -110723,20 +112123,20 @@ func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, i } // Name of the connection operator, used for error messages. -func selectOpName(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:130685:19: */ +func Xsqlite3SelectOpName(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:132472:27: */ var z uintptr switch id { case TK_ALL: - z = ts + 16168 /* "UNION ALL" */ + z = ts + 16636 /* "UNION ALL" */ break case TK_INTERSECT: - z = ts + 16178 /* "INTERSECT" */ + z = ts + 16646 /* "INTERSECT" */ break case TK_EXCEPT: - z = ts + 16188 /* "EXCEPT" */ + z = ts + 16656 /* "EXCEPT" */ break default: - z = ts + 16195 /* "UNION" */ + z = ts + 16663 /* "UNION" */ break } return z @@ -110750,11 +112150,11 @@ func selectOpName(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:130685:19: */ // // where xxx is one of "DISTINCT", "ORDER BY" or "GROUP BY". Exactly which // is determined by the zUsage argument. -func explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { /* sqlite3.c:130707:13: */ +func explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { /* sqlite3.c:132494:13: */ bp := tls.Alloc(8) defer tls.Free(8) - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+16201 /* "USE TEMP B-TREE ..." */, libc.VaList(bp, zUsage)) + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+16669 /* "USE TEMP B-TREE ..." */, libc.VaList(bp, zUsage)) } // Assign expression b to lvalue a. A second, no-op, version of this macro @@ -110767,7 +112167,7 @@ func explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { /* sqlite // 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 *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nColumn int32, pDest uintptr) { /* sqlite3.c:130733:13: */ +func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nColumn int32, pDest uintptr) { /* sqlite3.c:132520:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // The prepared statement var addrBreak int32 = (*SortCtx)(unsafe.Pointer(pSort)).FlabelDone // Jump here to exit loop var addrContinue int32 = Xsqlite3VdbeMakeLabel(tls, pParse) // Jump here for next cycle @@ -110856,7 +112256,7 @@ func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, n Xsqlite3VdbeAddOp3(tls, v, OP_Column, iSortTab, (nKey + bSeq), regRow) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iParm, regRowid) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, regRow, regRowid) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) break } @@ -110943,7 +112343,7 @@ func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, n // // This routine has either 3 or 6 parameters depending on whether or not // the SQLITE_ENABLE_COLUMN_METADATA compile-time option is used. -func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, pzOrigTab uintptr, pzOrigCol uintptr) uintptr { /* sqlite3.c:130958:19: */ +func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, pzOrigTab uintptr, pzOrigCol uintptr) uintptr { /* sqlite3.c:132745:19: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -110964,11 +112364,11 @@ func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, var iCol int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) // Index of column in pTab for (pNC != 0) && !(pTab != 0) { var pTabList uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpSrcList - for j = 0; (j < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) && ((*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(j)*112)).FiCursor != (*Expr)(unsafe.Pointer(pExpr)).FiTable); j++ { + for j = 0; (j < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) && ((*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(j)*112)).FiCursor != (*Expr)(unsafe.Pointer(pExpr)).FiTable); j++ { } if j < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc { - pTab = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(j)*112)).FpTab - pS = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(j)*112)).FpSelect + pTab = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(j)*112)).FpTab + pS = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(j)*112)).FpSelect } else { pNC = (*NameContext)(unsafe.Pointer(pNC)).FpNext } @@ -111019,8 +112419,8 @@ func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, } if iCol < 0 { - zType = ts + 10507 /* "INTEGER" */ - *(*uintptr)(unsafe.Pointer(bp + 72 /* zOrigCol */)) = ts + 13865 /* "rowid" */ + zType = ts + 10923 /* "INTEGER" */ + *(*uintptr)(unsafe.Pointer(bp + 72 /* zOrigCol */)) = ts + 14294 /* "rowid" */ } else { *(*uintptr)(unsafe.Pointer(bp + 72 /* zOrigCol */)) = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).FzName zType = Xsqlite3ColumnType(tls, ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32), uintptr(0)) @@ -111064,7 +112464,7 @@ func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, // Generate code that will tell the VDBE the declaration types of columns // in the result set. -func generateColumnTypes(tls *libc.TLS, pParse uintptr, pTabList uintptr, pEList uintptr) { /* sqlite3.c:131101:13: */ +func generateColumnTypes(tls *libc.TLS, pParse uintptr, pTabList uintptr, pEList uintptr) { /* sqlite3.c:132888:13: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -111121,7 +112521,7 @@ func generateColumnTypes(tls *libc.TLS, pParse uintptr, pTabList uintptr, pEList // full=ON, short=ANY: If the result refers directly to a table column, // then the result column name with the table name // prefix, ex: TABLE.COLUMN. Otherwise use zSpan. -func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:131168:13: */ +func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:132955:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -111151,8 +112551,8 @@ func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sq pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList (*Parse)(unsafe.Pointer(pParse)).FcolNamesSet = U8(1) - fullName = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_FullColNames) != uint64(0))) - srcName = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ShortColNames) != uint64(0)) || (fullName != 0))) + fullName = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_FullColNames)) != uint64(0))) + srcName = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ShortColNames)) != uint64(0)) || (fullName != 0))) Xsqlite3VdbeSetNumCols(tls, v, (*ExprList)(unsafe.Pointer(pEList)).FnExpr) for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ { var p uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*32)).FpExpr @@ -111173,13 +112573,13 @@ func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sq } if iCol < 0 { - zCol = ts + 13865 /* "rowid" */ + zCol = ts + 14294 /* "rowid" */ } else { zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).FzName } if fullName != 0 { var zName uintptr = uintptr(0) - zName = Xsqlite3MPrintf(tls, db, ts+9959 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, zCol)) + zName = Xsqlite3MPrintf(tls, db, ts+10324 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, zCol)) Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) } else { Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, libc.UintptrFromInt32(-1)) @@ -111187,7 +112587,7 @@ func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sq } else { var z uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*32)).FzEName if z == uintptr(0) { - z = Xsqlite3MPrintf(tls, db, ts+16224 /* "column%d" */, libc.VaList(bp+16, (i+1))) + z = Xsqlite3MPrintf(tls, db, ts+16692 /* "column%d" */, libc.VaList(bp+16, (i+1))) } else { z = Xsqlite3DbStrDup(tls, db, z) } @@ -111217,7 +112617,7 @@ func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sq // when modifying this routine to avoid breaking legacy. // // See Also: generateColumnNames() -func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, pnCol uintptr, paCol uintptr) int32 { /* sqlite3.c:131260:20: */ +func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, pnCol uintptr, paCol uintptr) int32 { /* sqlite3.c:133047:20: */ bp := tls.Alloc(60) defer tls.Free(60) @@ -111233,6 +112633,7 @@ func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, var nName int32 // Size of name in zName[] // var ht Hash at bp+32, 24 // Hash table of column names + var pTab uintptr Xsqlite3HashInit(tls, bp+32 /* &ht */) if pEList != 0 { @@ -111262,22 +112663,20 @@ __1: // If the column contains an "AS " phrase, use as the name } else { var pColExpr uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*32)).FpExpr) - for int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_DOT { + for (pColExpr != uintptr(0)) && (int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_DOT) { pColExpr = (*Expr)(unsafe.Pointer(pColExpr)).FpRight } - if int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_COLUMN { + if (int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_COLUMN) && ((libc.AssignUintptr(&pTab, *(*uintptr)(unsafe.Pointer(pColExpr + 64 /* &.y */)))) != uintptr(0)) { // For columns use the column name name var iCol int32 = int32((*Expr)(unsafe.Pointer(pColExpr)).FiColumn) - var pTab uintptr = *(*uintptr)(unsafe.Pointer(pColExpr + 64 /* &.y */)) - if iCol < 0 { iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey) } if iCol >= 0 { zName = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).FzName } else { - zName = ts + 13865 /* "rowid" */ + zName = ts + 14294 /* "rowid" */ } } else if int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_ID { @@ -111290,7 +112689,7 @@ __1: if (zName != 0) && !(Xsqlite3IsTrueOrFalse(tls, zName) != 0) { zName = Xsqlite3DbStrDup(tls, db, zName) } else { - zName = Xsqlite3MPrintf(tls, db, ts+16224 /* "column%d" */, libc.VaList(bp, (i+1))) + zName = Xsqlite3MPrintf(tls, db, ts+16692 /* "column%d" */, libc.VaList(bp, (i+1))) } // Make sure the column name is unique. If the name is not unique, @@ -111305,7 +112704,7 @@ __1: nName = j } } - zName = Xsqlite3MPrintf(tls, db, ts+16233 /* "%.*z:%u" */, libc.VaList(bp+8, nName, zName, libc.PreIncUint32(&*(*U32)(unsafe.Pointer(bp + 56 /* cnt */)), 1))) + zName = Xsqlite3MPrintf(tls, db, ts+16701 /* "%.*z:%u" */, libc.VaList(bp+8, nName, zName, libc.PreIncUint32(&*(*U32)(unsafe.Pointer(bp + 56 /* cnt */)), 1))) if *(*U32)(unsafe.Pointer(bp + 56 /* cnt */)) > U32(3) { Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), bp+56 /* &cnt */) } @@ -111348,7 +112747,7 @@ __3: // // This routine requires that all identifiers in the SELECT // statement be resolved. -func Xsqlite3SelectAddColumnTypeAndCollation(tls *libc.TLS, pParse uintptr, pTab uintptr, pSelect uintptr, aff int8) { /* sqlite3.c:131365:21: */ +func Xsqlite3SelectAddColumnTypeAndCollation(tls *libc.TLS, pParse uintptr, pTab uintptr, pSelect uintptr, aff int8) { /* sqlite3.c:133151:21: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -111377,6 +112776,7 @@ __1: var zType uintptr var n int32 var m int32 + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_NOINSERT)) p = (*ExprList_item)(unsafe.Pointer(a + uintptr(i)*32)).FpExpr zType = columnTypeImpl(tls, bp /* &sNC */, p, uintptr(0), uintptr(0), uintptr(0)) // pCol->szEst = ... // Column size est for SELECT tables never used @@ -111412,14 +112812,14 @@ __3: // Given a SELECT statement, generate a Table structure that describes // the result set of that SELECT. -func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, aff int8) uintptr { /* sqlite3.c:131415:22: */ +func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, aff int8) uintptr { /* sqlite3.c:133202:22: */ var pTab uintptr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var savedFlags U64 savedFlags = (*Sqlite3)(unsafe.Pointer(db)).Fflags - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_FullColNames)) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (SQLITE_ShortColNames) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_FullColNames))) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_ShortColNames)) Xsqlite3SelectPrep(tls, pParse, pSelect, uintptr(0)) (*Sqlite3)(unsafe.Pointer(db)).Fflags = savedFlags if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -111447,12 +112847,12 @@ func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a // 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 Xsqlite3GetVdbe(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:131448:21: */ +func Xsqlite3GetVdbe(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:133235:21: */ if (*Parse)(unsafe.Pointer(pParse)).FpVdbe != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpVdbe } if ((*Parse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0)) && - ((int32((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags) & (SQLITE_FactorOutConst)) == 0) { + (((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags & (U32(SQLITE_FactorOutConst))) == U32(0)) { (*Parse)(unsafe.Pointer(pParse)).FokConstFactor = U8(1) } return Xsqlite3VdbeCreate(tls, pParse) @@ -111479,7 +112879,7 @@ func Xsqlite3GetVdbe(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:13144 // 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 *libc.TLS, pParse uintptr, p uintptr, iBreak int32) { /* sqlite3.c:131484:13: */ +func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int32) { /* sqlite3.c:133271:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -111510,7 +112910,7 @@ func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int3 Xsqlite3VdbeGoto(tls, v, iBreak) } else if (*(*int32)(unsafe.Pointer(bp /* n */)) >= 0) && (int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp /* n */)))))) { (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp /* n */)))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_FixedLimit) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_FixedLimit)) } } else { Xsqlite3ExprCode(tls, pParse, (*Expr)(unsafe.Pointer(pLimit)).FpLeft, iLimit) @@ -111536,7 +112936,7 @@ func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int3 // // 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 *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:131541:16: */ +func multiSelectCollSeq(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:133328:16: */ var pRet uintptr if (*Select)(unsafe.Pointer(p)).FpPrior != 0 { pRet = multiSelectCollSeq(tls, pParse, (*Select)(unsafe.Pointer(p)).FpPrior, iCol) @@ -111560,7 +112960,7 @@ func multiSelectCollSeq(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) ui // 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 *libc.TLS, pParse uintptr, p uintptr, nExtra int32) uintptr { /* sqlite3.c:131567:16: */ +func multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra int32) uintptr { /* sqlite3.c:133354:16: */ var pOrderBy uintptr = (*Select)(unsafe.Pointer(p)).FpOrderBy var nOrderBy int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb @@ -111572,7 +112972,7 @@ func multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra var pTerm uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr var pColl uintptr - if ((*Expr)(unsafe.Pointer(pTerm)).Fflags & EP_Collate) != 0 { + if ((*Expr)(unsafe.Pointer(pTerm)).Fflags & U32(EP_Collate)) != 0 { pColl = Xsqlite3ExprCollSeq(tls, pParse, pTerm) } else { pColl = multiSelectCollSeq(tls, pParse, p, (int32(*(*U16)(unsafe.Pointer((pItem + 24 /* &.u */ /* &.x */) /* &.iOrderByCol */))) - 1)) @@ -111624,15 +113024,16 @@ func multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra // 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 *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) { /* sqlite3.c:131633:13: */ +func generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) { /* sqlite3.c:133420:13: */ bp := tls.Alloc(40) defer tls.Free(40) - var pSrc uintptr // The FROM clause of the recursive query - var nCol int32 // Number of columns in the recursive table - var v uintptr // The prepared statement under construction - var pSetup uintptr // The setup query - var addrTop int32 // Top of the loop + var pSrc uintptr // The FROM clause of the recursive query + var nCol int32 // Number of columns in the recursive table + var v uintptr // The prepared statement under construction + var pSetup uintptr // The setup query + var pFirstRec uintptr // Left-most recursive term + var addrTop int32 // Top of the loop var addrCont int32 var addrBreak int32 // CONTINUE and BREAK addresses var iCurrent int32 // The Current table @@ -111660,7 +113061,7 @@ func generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest if !((*Select)(unsafe.Pointer(p)).FpWin != 0) { goto __1 } - Xsqlite3ErrorMsg(tls, pParse, ts+16241 /* "cannot use windo..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+16709 /* "cannot use windo..." */, 0) return __1: ; @@ -111693,7 +113094,7 @@ __3: if !((uint32(int32(*(*uint8)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112 + 60 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5))) != 0) { goto __6 } - iCurrent = (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor + iCurrent = (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor goto __5 __6: ; @@ -111749,23 +113150,58 @@ __10: goto __11 } *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, iDistinct, 0) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_UsesEphemeral) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral)) __11: ; // Detach the ORDER BY clause from the compound SELECT (*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) + // Figure out how many elements of the compound SELECT are part of the + // recursive query. Make sure no recursive elements use aggregate + // functions. Mark the recursive elements as UNION ALL even if they + // are really UNION because the distinctness will be enforced by the + // iDistinct table. pFirstRec is left pointing to the left-most + // recursive term of the CTE. + pFirstRec = p + pFirstRec = p +__12: + if !(pFirstRec != uintptr(0)) { + goto __14 + } + if !(((*Select)(unsafe.Pointer(pFirstRec)).FselFlags & U32(SF_Aggregate)) != 0) { + goto __15 + } + Xsqlite3ErrorMsg(tls, pParse, ts+16758 /* "recursive aggreg..." */, 0) + goto end_of_recursive_query +__15: + ; + (*Select)(unsafe.Pointer(pFirstRec)).Fop = U8(TK_ALL) + if !(((*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(pFirstRec)).FpPrior)).FselFlags & U32(SF_Recursive)) == U32(0)) { + goto __16 + } + goto __14 +__16: + ; + goto __13 +__13: + pFirstRec = (*Select)(unsafe.Pointer(pFirstRec)).FpPrior + goto __12 + goto __14 +__14: + ; + // Store the results of the setup-query in Queue. + pSetup = (*Select)(unsafe.Pointer(pFirstRec)).FpPrior (*Select)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16290 /* "SETUP" */, 0) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16800 /* "SETUP" */, 0) rc = Xsqlite3Select(tls, pParse, pSetup, bp /* &destQueue */) (*Select)(unsafe.Pointer(pSetup)).FpNext = p if !(rc != 0) { - goto __12 + goto __17 } goto end_of_recursive_query -__12: +__17: ; // Find the next row in the Queue and output that row @@ -111774,13 +113210,13 @@ __12: // Transfer the next row in Queue over to Current Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, iCurrent) // To reset column cache if !(pOrderBy != 0) { - goto __13 + goto __18 } Xsqlite3VdbeAddOp3(tls, v, OP_Column, iQueue, ((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr + 1), regCurrent) - goto __14 -__13: + goto __19 +__18: Xsqlite3VdbeAddOp2(tls, v, OP_RowData, iQueue, regCurrent) -__14: +__19: ; Xsqlite3VdbeAddOp1(tls, v, OP_Delete, iQueue) @@ -111790,29 +113226,21 @@ __14: selectInnerLoop(tls, pParse, p, iCurrent, uintptr(0), uintptr(0), pDest, addrCont, addrBreak) if !(regLimit != 0) { - goto __15 + goto __20 } Xsqlite3VdbeAddOp2(tls, v, OP_DecrJumpZero, regLimit, addrBreak) -__15: +__20: ; Xsqlite3VdbeResolveLabel(tls, v, addrCont) // Execute the recursive SELECT taking the single row in Current as // the value for the recursive-table. Store the results in the Queue. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Aggregate) != 0) { - goto __16 - } - Xsqlite3ErrorMsg(tls, pParse, ts+16296 /* "recursive aggreg..." */, 0) - goto __17 -__16: - (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16338 /* "RECURSIVE STEP" */, 0) + (*Select)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16806 /* "RECURSIVE STEP" */, 0) Xsqlite3Select(tls, pParse, p, bp /* &destQueue */) - (*Select)(unsafe.Pointer(p)).FpPrior = pSetup -__17: - ; + (*Select)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup // Keep running the loop until the Queue is empty Xsqlite3VdbeGoto(tls, v, addrTop) @@ -111839,7 +113267,7 @@ end_of_recursive_query: // clause occurs within scalar expression (ex: "SELECT (VALUES(1),(2),(3))"). // The sqlite3CodeSubselect will have added the LIMIT 1 clause in tht case. // Since the limit is exactly 1, we only need to evalutes the left-most VALUES. -func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:131795:12: */ +func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:133597:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -111859,11 +113287,11 @@ func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) p = (*Select)(unsafe.Pointer(p)).FpPrior nRow = nRow + (bShowAll) } - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+16353 /* "SCAN %d CONSTANT..." */, libc.VaList(bp, nRow, func() uintptr { + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+16821 /* "SCAN %d CONSTANT..." */, libc.VaList(bp, nRow, func() uintptr { if nRow == 1 { return ts + 703 /* "" */ } - return ts + 16376 /* "S" */ + return ts + 16844 /* "S" */ }())) for p != 0 { selectInnerLoop(tls, pParse, p, -1, uintptr(0), uintptr(0), pDest, 1, 1) @@ -111876,6 +113304,16 @@ func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) return rc } +// Return true if the SELECT statement which is known to be the recursive +// part of a recursive CTE still has its anchor terms attached. If the +// anchor terms have already been removed, then return false. +func hasAnchor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:133634:12: */ + for (p != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Recursive)) != U32(0)) { + p = (*Select)(unsafe.Pointer(p)).FpPrior + } + return (libc.Bool32(p != uintptr(0))) +} + // This routine is called to process a compound query form from // two or more separate queries using UNION, UNION ALL, EXCEPT, or // INTERSECT @@ -111905,19 +113343,19 @@ func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) // // Notice that because of the way SQLite parses compound SELECTs, the // individual selects always group from left to right. -func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:131858:12: */ - bp := tls.Alloc(160) - defer tls.Free(160) +func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:133670:12: */ + bp := tls.Alloc(144) + defer tls.Free(144) var rc int32 // Success code from a subroutine var pPrior uintptr // Another SELECT immediately to our left var v uintptr // Generate code to this VDBE - // var dest SelectDest at bp+32, 40 + // var dest SelectDest at bp+16, 40 // Alternative data destination var pDelete uintptr // Chain of simple selects to delete var db uintptr var addr int32 - // var nLimit int32 at bp+72, 4 + // var nLimit int32 at bp+56, 4 var iCont int32 var iBreak int32 @@ -111927,7 +113365,7 @@ func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 var priorOp int32 // The SRT_ operation to apply to prior selects var pLimit uintptr // Saved values of p->nLimit var addr1 int32 - // var uniondest SelectDest at bp+80, 40 + // var uniondest SelectDest at bp+64, 40 var tab1 int32 var tab2 int32 @@ -111936,7 +113374,7 @@ func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 var iStart1 int32 var pLimit1 uintptr var addr2 int32 - // var intersectdest SelectDest at bp+120, 40 + // var intersectdest SelectDest at bp+104, 40 var r1 int32 var addr3 int32 @@ -111954,155 +113392,141 @@ func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 db = (*Parse)(unsafe.Pointer(pParse)).Fdb pPrior = (*Select)(unsafe.Pointer(p)).FpPrior - *(*SelectDest)(unsafe.Pointer(bp + 32 /* dest */)) = *(*SelectDest)(unsafe.Pointer(pDest)) - if !(((*Select)(unsafe.Pointer(pPrior)).FpOrderBy != 0) || ((*Select)(unsafe.Pointer(pPrior)).FpLimit != 0)) { - goto __1 - } - Xsqlite3ErrorMsg(tls, pParse, ts+16378, /* "%s clause should..." */ - libc.VaList(bp, func() uintptr { - if (*Select)(unsafe.Pointer(pPrior)).FpOrderBy != uintptr(0) { - return ts + 16420 /* "ORDER BY" */ - } - return ts + 16429 /* "LIMIT" */ - }(), selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) - rc = 1 - goto multi_select_end -__1: - ; + *(*SelectDest)(unsafe.Pointer(bp + 16 /* dest */)) = *(*SelectDest)(unsafe.Pointer(pDest)) v = Xsqlite3GetVdbe(tls, pParse) // The VDBE already created by calling function // Create the destination temporary table if necessary - if !(int32((*SelectDest)(unsafe.Pointer(bp+32 /* &dest */)).FeDest) == SRT_EphemTab) { - goto __2 + if !(int32((*SelectDest)(unsafe.Pointer(bp+16 /* &dest */)).FeDest) == SRT_EphemTab) { + goto __1 } - Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*SelectDest)(unsafe.Pointer(bp+32 /* &dest */)).FiSDParm, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr) - (*SelectDest)(unsafe.Pointer(bp + 32 /* &dest */)).FeDest = SRT_Table -__2: + Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*SelectDest)(unsafe.Pointer(bp+16 /* &dest */)).FiSDParm, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr) + (*SelectDest)(unsafe.Pointer(bp + 16 /* &dest */)).FeDest = U8(SRT_Table) +__1: ; // Special handling for a compound-select that originates as a VALUES clause. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_MultiValue) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_MultiValue)) != 0) { + goto __2 + } + rc = multiSelectValues(tls, pParse, p, bp+16 /* &dest */) + if !(rc >= 0) { goto __3 } - rc = multiSelectValues(tls, pParse, p, bp+32 /* &dest */) - if !(rc >= 0) { - goto __4 - } goto multi_select_end -__4: +__3: ; rc = SQLITE_OK -__3: +__2: ; // Make sure all SELECTs in the statement have the same number of elements // in their result sets. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Recursive) != 0) { - goto __5 + if !((((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Recursive)) != U32(0)) && (hasAnchor(tls, p) != 0)) { + goto __4 } - generateWithRecursiveQuery(tls, pParse, p, bp+32 /* &dest */) - goto __6 -__5: + generateWithRecursiveQuery(tls, pParse, p, bp+16 /* &dest */) + goto __5 +__4: // Compound SELECTs that have an ORDER BY clause are handled separately. if !((*Select)(unsafe.Pointer(p)).FpOrderBy != 0) { - goto __7 + goto __6 } return multiSelectOrderBy(tls, pParse, p, pDest) - goto __8 -__7: + goto __7 +__6: if !((*Select)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0)) { - goto __9 + goto __8 } - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16435 /* "COMPOUND QUERY" */, 0) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16450 /* "LEFT-MOST SUBQUE..." */, 0) -__9: + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16846 /* "COMPOUND QUERY" */, 0) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16861 /* "LEFT-MOST SUBQUE..." */, 0) +__8: ; // Generate code for the left and right SELECT statements. switch int32((*Select)(unsafe.Pointer(p)).Fop) { case TK_ALL: - goto __11 + goto __10 case TK_EXCEPT: - goto __12 + goto __11 case TK_UNION: - goto __13 + goto __12 default: - goto __14 + goto __13 } - goto __10 -__11: + goto __9 +__10: addr = 0 (*Select)(unsafe.Pointer(pPrior)).FiLimit = (*Select)(unsafe.Pointer(p)).FiLimit (*Select)(unsafe.Pointer(pPrior)).FiOffset = (*Select)(unsafe.Pointer(p)).FiOffset (*Select)(unsafe.Pointer(pPrior)).FpLimit = (*Select)(unsafe.Pointer(p)).FpLimit - rc = Xsqlite3Select(tls, pParse, pPrior, bp+32 /* &dest */) - (*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0) + rc = Xsqlite3Select(tls, pParse, pPrior, bp+16 /* &dest */) + (*Select)(unsafe.Pointer(pPrior)).FpLimit = uintptr(0) if !(rc != 0) { - goto __15 + goto __14 } goto multi_select_end -__15: +__14: ; (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) (*Select)(unsafe.Pointer(p)).FiLimit = (*Select)(unsafe.Pointer(pPrior)).FiLimit (*Select)(unsafe.Pointer(p)).FiOffset = (*Select)(unsafe.Pointer(pPrior)).FiOffset if !((*Select)(unsafe.Pointer(p)).FiLimit != 0) { - goto __16 + goto __15 } addr = Xsqlite3VdbeAddOp1(tls, v, OP_IfNot, (*Select)(unsafe.Pointer(p)).FiLimit) if !((*Select)(unsafe.Pointer(p)).FiOffset != 0) { - goto __17 + goto __16 } Xsqlite3VdbeAddOp3(tls, v, OP_OffsetLimit, (*Select)(unsafe.Pointer(p)).FiLimit, ((*Select)(unsafe.Pointer(p)).FiOffset + 1), (*Select)(unsafe.Pointer(p)).FiOffset) -__17: - ; __16: ; - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16168 /* "UNION ALL" */, 0) - rc = Xsqlite3Select(tls, pParse, p, bp+32 /* &dest */) +__15: + ; + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16636 /* "UNION ALL" */, 0) + rc = Xsqlite3Select(tls, pParse, p, bp+16 /* &dest */) pDelete = (*Select)(unsafe.Pointer(p)).FpPrior (*Select)(unsafe.Pointer(p)).FpPrior = pPrior (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEstAdd(tls, (*Select)(unsafe.Pointer(p)).FnSelectRow, (*Select)(unsafe.Pointer(pPrior)).FnSelectRow) - if !(((((*Select)(unsafe.Pointer(pPrior)).FpLimit != 0) && - (Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pPrior)).FpLimit)).FpLeft, bp+72 /* &nLimit */) != 0)) && - (*(*int32)(unsafe.Pointer(bp + 72 /* nLimit */)) > 0)) && (int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 72 /* nLimit */))))))) { - goto __18 + if !(((((*Select)(unsafe.Pointer(p)).FpLimit != 0) && + (Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpLimit)).FpLeft, bp+56 /* &nLimit */) != 0)) && + (*(*int32)(unsafe.Pointer(bp + 56 /* nLimit */)) > 0)) && (int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 56 /* nLimit */))))))) { + goto __17 } - (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 72 /* nLimit */)))) -__18: + (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 56 /* nLimit */)))) +__17: ; if !(addr != 0) { - goto __19 + goto __18 } Xsqlite3VdbeJumpHere(tls, v, addr) -__19: +__18: ; - goto __10 + goto __9 -__12: -__13: // Cursor number of the temp table holding result +__11: +__12: // Cursor number of the temp table holding result op = U8(0) priorOp = SRT_Union - if !(int32((*SelectDest)(unsafe.Pointer(bp+32 /* &dest */)).FeDest) == priorOp) { - goto __20 + if !(int32((*SelectDest)(unsafe.Pointer(bp+16 /* &dest */)).FeDest) == priorOp) { + goto __19 } // We can reuse a temporary table generated by a SELECT to our // right. // Not allowed on leftward elements - unionTab = (*SelectDest)(unsafe.Pointer(bp + 32 /* &dest */)).FiSDParm - goto __21 -__20: + unionTab = (*SelectDest)(unsafe.Pointer(bp + 16 /* &dest */)).FiSDParm + goto __20 +__19: // We will need to create our own temporary table to hold the // intermediate results. unionTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) @@ -112110,48 +113534,48 @@ __20: addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, unionTab, 0) *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = addr1 - *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (SF_UsesEphemeral) + *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral)) -__21: +__20: ; // Code the SELECT statements to our left - Xsqlite3SelectDestInit(tls, bp+80 /* &uniondest */, priorOp, unionTab) - rc = Xsqlite3Select(tls, pParse, pPrior, bp+80 /* &uniondest */) + Xsqlite3SelectDestInit(tls, bp+64 /* &uniondest */, priorOp, unionTab) + rc = Xsqlite3Select(tls, pParse, pPrior, bp+64 /* &uniondest */) if !(rc != 0) { - goto __22 + goto __21 } goto multi_select_end -__22: +__21: ; // Code the current SELECT statement if !(int32((*Select)(unsafe.Pointer(p)).Fop) == TK_EXCEPT) { - goto __23 + goto __22 } - op = SRT_Except - goto __24 -__23: + op = U8(SRT_Except) + goto __23 +__22: ; - op = SRT_Union -__24: + op = U8(SRT_Union) +__23: ; (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) pLimit = (*Select)(unsafe.Pointer(p)).FpLimit (*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0) - (*SelectDest)(unsafe.Pointer(bp + 80 /* &uniondest */)).FeDest = op - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16469 /* "%s USING TEMP B-..." */, libc.VaList(bp+16, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) - rc = Xsqlite3Select(tls, pParse, p, bp+80 /* &uniondest */) + (*SelectDest)(unsafe.Pointer(bp + 64 /* &uniondest */)).FeDest = op + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16880 /* "%s USING TEMP B-..." */, libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) + rc = Xsqlite3Select(tls, pParse, p, bp+64 /* &uniondest */) pDelete = (*Select)(unsafe.Pointer(p)).FpPrior (*Select)(unsafe.Pointer(p)).FpPrior = pPrior (*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) if !(int32((*Select)(unsafe.Pointer(p)).Fop) == TK_UNION) { - goto __25 + goto __24 } (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEstAdd(tls, (*Select)(unsafe.Pointer(p)).FnSelectRow, (*Select)(unsafe.Pointer(pPrior)).FnSelectRow) -__25: +__24: ; Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit) (*Select)(unsafe.Pointer(p)).FpLimit = pLimit @@ -112161,8 +113585,8 @@ __25: // Convert the data in the temporary table into whatever form // it is that we currently need. - if !((int32((*SelectDest)(unsafe.Pointer(bp+32 /* &dest */)).FeDest) != priorOp) && (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0)) { - goto __26 + if !((int32((*SelectDest)(unsafe.Pointer(bp+16 /* &dest */)).FeDest) != priorOp) && (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0)) { + goto __25 } iBreak = Xsqlite3VdbeMakeLabel(tls, pParse) iCont = Xsqlite3VdbeMakeLabel(tls, pParse) @@ -112170,16 +113594,16 @@ __25: Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, unionTab, iBreak) iStart = Xsqlite3VdbeCurrentAddr(tls, v) selectInnerLoop(tls, pParse, p, unionTab, - uintptr(0), uintptr(0), bp+32 /* &dest */, iCont, iBreak) + uintptr(0), uintptr(0), bp+16 /* &dest */, iCont, iBreak) Xsqlite3VdbeResolveLabel(tls, v, iCont) Xsqlite3VdbeAddOp2(tls, v, OP_Next, unionTab, iStart) Xsqlite3VdbeResolveLabel(tls, v, iBreak) Xsqlite3VdbeAddOp2(tls, v, OP_Close, unionTab, 0) -__26: +__25: ; - goto __10 + goto __9 -__14: +__13: ; // INTERSECT is different from the others since it requires @@ -112191,16 +113615,16 @@ __14: addr2 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, tab1, 0) *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = addr2 - *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (SF_UsesEphemeral) + *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral)) // Code the SELECTs to our left into temporary table "tab1". - Xsqlite3SelectDestInit(tls, bp+120 /* &intersectdest */, SRT_Union, tab1) - rc = Xsqlite3Select(tls, pParse, pPrior, bp+120 /* &intersectdest */) + Xsqlite3SelectDestInit(tls, bp+104 /* &intersectdest */, SRT_Union, tab1) + rc = Xsqlite3Select(tls, pParse, pPrior, bp+104 /* &intersectdest */) if !(rc != 0) { - goto __27 + goto __26 } goto multi_select_end -__27: +__26: ; // Code the current SELECT into temporary table "tab2" @@ -112210,17 +113634,17 @@ __27: (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) pLimit1 = (*Select)(unsafe.Pointer(p)).FpLimit (*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0) - (*SelectDest)(unsafe.Pointer(bp + 120 /* &intersectdest */)).FiSDParm = tab2 - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16469 /* "%s USING TEMP B-..." */, libc.VaList(bp+24, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) - rc = Xsqlite3Select(tls, pParse, p, bp+120 /* &intersectdest */) + (*SelectDest)(unsafe.Pointer(bp + 104 /* &intersectdest */)).FiSDParm = tab2 + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16880 /* "%s USING TEMP B-..." */, libc.VaList(bp+8, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) + rc = Xsqlite3Select(tls, pParse, p, bp+104 /* &intersectdest */) pDelete = (*Select)(unsafe.Pointer(p)).FpPrior (*Select)(unsafe.Pointer(p)).FpPrior = pPrior if !(int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32((*Select)(unsafe.Pointer(pPrior)).FnSelectRow)) { - goto __28 + goto __27 } (*Select)(unsafe.Pointer(p)).FnSelectRow = (*Select)(unsafe.Pointer(pPrior)).FnSelectRow -__28: +__27: ; Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit) (*Select)(unsafe.Pointer(p)).FpLimit = pLimit1 @@ -112228,10 +113652,10 @@ __28: // Generate code to take the intersection of the two temporary // tables. if !(rc != 0) { - goto __29 + goto __28 } - goto __10 -__29: + goto __9 +__28: ; iBreak1 = Xsqlite3VdbeMakeLabel(tls, pParse) @@ -112244,32 +113668,32 @@ __29: Xsqlite3ReleaseTempReg(tls, pParse, r1) selectInnerLoop(tls, pParse, p, tab1, - uintptr(0), uintptr(0), bp+32 /* &dest */, iCont1, iBreak1) + uintptr(0), uintptr(0), bp+16 /* &dest */, iCont1, iBreak1) Xsqlite3VdbeResolveLabel(tls, v, iCont1) Xsqlite3VdbeAddOp2(tls, v, OP_Next, tab1, iStart1) Xsqlite3VdbeResolveLabel(tls, v, iBreak1) Xsqlite3VdbeAddOp2(tls, v, OP_Close, tab2, 0) Xsqlite3VdbeAddOp2(tls, v, OP_Close, tab1, 0) - goto __10 + goto __9 -__10: +__9: ; if !((*Select)(unsafe.Pointer(p)).FpNext == uintptr(0)) { - goto __30 + goto __29 } Xsqlite3VdbeExplainPop(tls, pParse) -__30: +__29: ; -__8: +__7: ; -__6: +__5: ; if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) { - goto __31 + goto __30 } goto multi_select_end -__31: +__30: ; // Compute collating sequences used by @@ -112280,101 +113704,102 @@ __31: // SELECT statements to the left always skip this part. The right-most // SELECT might also skip this part if it has no ORDER BY clause and // no temp tables are required. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_UsesEphemeral) != 0) { - goto __32 + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_UsesEphemeral)) != 0) { + goto __31 } // Number of columns in result set nCol = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr pKeyInfo = Xsqlite3KeyInfoAlloc(tls, db, nCol, 1) if !(!(pKeyInfo != 0)) { - goto __33 + goto __32 } rc = SQLITE_NOMEM goto multi_select_end -__33: +__32: ; i = 0 apColl = pKeyInfo + 32 /* &.aColl */ -__34: +__33: if !(i < nCol) { - goto __36 + goto __35 } *(*uintptr)(unsafe.Pointer(apColl)) = multiSelectCollSeq(tls, pParse, p, i) if !(uintptr(0) == *(*uintptr)(unsafe.Pointer(apColl))) { - goto __37 + goto __36 } *(*uintptr)(unsafe.Pointer(apColl)) = (*Sqlite3)(unsafe.Pointer(db)).FpDfltColl -__37: +__36: ; - goto __35 -__35: + goto __34 +__34: i++ apColl += 8 - goto __34 - goto __36 -__36: + goto __33 + goto __35 +__35: ; pLoop = p -__38: +__37: if !(pLoop != 0) { - goto __40 + goto __39 } i = 0 -__41: +__40: if !(i < 2) { - goto __43 + goto __42 } addr3 = *(*int32)(unsafe.Pointer((pLoop + 20 /* &.addrOpenEphm */) + uintptr(i)*4)) if !(addr3 < 0) { - goto __44 + goto __43 } // If [0] is unused then [1] is also unused. So we can // always safely abort as soon as the first unused slot is found - goto __43 -__44: + goto __42 +__43: ; Xsqlite3VdbeChangeP2(tls, v, addr3, nCol) Xsqlite3VdbeChangeP4(tls, v, addr3, Xsqlite3KeyInfoRef(tls, pKeyInfo), -9) *(*int32)(unsafe.Pointer((pLoop + 20 /* &.addrOpenEphm */) + uintptr(i)*4)) = -1 + goto __41 +__41: + i++ + goto __40 goto __42 __42: - i++ - goto __41 - goto __43 -__43: ; + goto __38 +__38: + pLoop = (*Select)(unsafe.Pointer(pLoop)).FpPrior + goto __37 goto __39 __39: - pLoop = (*Select)(unsafe.Pointer(pLoop)).FpPrior - goto __38 - goto __40 -__40: ; Xsqlite3KeyInfoUnref(tls, pKeyInfo) -__32: +__31: ; multi_select_end: - (*SelectDest)(unsafe.Pointer(pDest)).FiSdst = (*SelectDest)(unsafe.Pointer(bp + 32 /* &dest */)).FiSdst - (*SelectDest)(unsafe.Pointer(pDest)).FnSdst = (*SelectDest)(unsafe.Pointer(bp + 32 /* &dest */)).FnSdst + (*SelectDest)(unsafe.Pointer(pDest)).FiSdst = (*SelectDest)(unsafe.Pointer(bp + 16 /* &dest */)).FiSdst + (*SelectDest)(unsafe.Pointer(pDest)).FnSdst = (*SelectDest)(unsafe.Pointer(bp + 16 /* &dest */)).FnSdst Xsqlite3SelectDelete(tls, db, pDelete) return rc } // Error message for when two or more terms of a compound select have different // size result sets. -func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:132206:21: */ +func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:134015:21: */ bp := tls.Alloc(8) defer tls.Free(8) - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Values) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+16490 /* "all VALUES must ..." */, 0) + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Values)) != 0 { + Xsqlite3ErrorMsg(tls, pParse, ts+16901 /* "all VALUES must ..." */, 0) } else { Xsqlite3ErrorMsg(tls, pParse, - ts+16536 /* "SELECTs to the l..." */, libc.VaList(bp, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) + ts+16947, /* "SELECTs to the l..." */ + libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) } } @@ -112396,7 +113821,7 @@ func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) // // If the LIMIT found in p->iLimit is reached, jump immediately to // iBreak. -func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uintptr, pDest uintptr, regReturn int32, regPrev int32, pKeyInfo uintptr, iBreak int32) int32 { /* sqlite3.c:132235:12: */ +func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uintptr, pDest uintptr, regReturn int32, regPrev int32, pKeyInfo uintptr, iBreak int32) int32 { /* sqlite3.c:134045:12: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var iContinue int32 var addr int32 @@ -112432,7 +113857,7 @@ func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uint Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst, r1) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, r2) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, r1, r2) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3ReleaseTempReg(tls, pParse, r2) Xsqlite3ReleaseTempReg(tls, pParse, r1) break @@ -112460,10 +113885,8 @@ func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uint // if it is the RHS of a row-value IN operator. case SRT_Mem: { - if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 { - Xsqlite3ExprCodeMove(tls, pParse, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst) - } + Xsqlite3ExprCodeMove(tls, pParse, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst) // The LIMIT clause will jump out of the loop for us break @@ -112594,7 +114017,7 @@ func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uint // actually called using Gosub and they do not Return. EofA and EofB loop // until all data is exhausted then jump to the "end" labe. AltB, AeqB, // and AgtB jump to either L2 or to one of EofA or EofB. -func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:132445:12: */ +func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:134253:12: */ bp := tls.Alloc(88) defer tls.Free(88) @@ -112683,7 +114106,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if pNew == uintptr(0) { return SQLITE_NOMEM } - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_IntValue) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_IntValue)) *(*int32)(unsafe.Pointer(pNew + 8 /* &.u */)) = i (*Select)(unsafe.Pointer(p)).FpOrderBy = libc.AssignUintptr(&pOrderBy, Xsqlite3ExprListAppend(tls, pParse, pOrderBy, pNew)) if pOrderBy != 0 { @@ -112755,9 +114178,9 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) // Separate the left and the right query from one another (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) (*Select)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) - Xsqlite3ResolveOrderGroupBy(tls, pParse, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+6064 /* "ORDER" */) + Xsqlite3ResolveOrderGroupBy(tls, pParse, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+6120 /* "ORDER" */) if (*Select)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - Xsqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*Select)(unsafe.Pointer(pPrior)).FpOrderBy, ts+6064 /* "ORDER" */) + Xsqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*Select)(unsafe.Pointer(pPrior)).FpOrderBy, ts+6120 /* "ORDER" */) } // Compute the limit registers @@ -112786,7 +114209,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) Xsqlite3SelectDestInit(tls, bp+8 /* &destA */, SRT_Coroutine, regAddrA) Xsqlite3SelectDestInit(tls, bp+48 /* &destB */, SRT_Coroutine, regAddrB) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16618 /* "MERGE (%s)" */, libc.VaList(bp, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17029 /* "MERGE (%s)" */, libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) // Generate a coroutine to evaluate the SELECT statement to the // left of the compound operator - the "A" select. @@ -112794,7 +114217,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regAddrA, 0, addrSelectA) (*Select)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16629 /* "LEFT" */, 0) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17040 /* "LEFT" */, 0) Xsqlite3Select(tls, pParse, pPrior, bp+8 /* &destA */) Xsqlite3VdbeEndCoroutine(tls, v, regAddrA) Xsqlite3VdbeJumpHere(tls, v, addr1) @@ -112808,7 +114231,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) savedOffset = (*Select)(unsafe.Pointer(p)).FiOffset (*Select)(unsafe.Pointer(p)).FiLimit = regLimitB (*Select)(unsafe.Pointer(p)).FiOffset = 0 - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16634 /* "RIGHT" */, 0) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17045 /* "RIGHT" */, 0) Xsqlite3Select(tls, pParse, p, bp+48 /* &destB */) (*Select)(unsafe.Pointer(p)).FiLimit = savedLimit (*Select)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -112895,7 +114318,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) Xsqlite3VdbeAddOp4(tls, v, OP_Permutation, 0, 0, 0, aPermute, -15) Xsqlite3VdbeAddOp4(tls, v, OP_Compare, (*SelectDest)(unsafe.Pointer(bp+8 /* &destA */)).FiSdst, (*SelectDest)(unsafe.Pointer(bp+48 /* &destB */)).FiSdst, nOrderBy, pKeyMerge, -9) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_PERMUTE) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_PERMUTE)) Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addrAltB, addrAeqB, addrAgtB) // Jump to the this point in order to terminate the query. @@ -112927,14 +114350,14 @@ type SubstContext1 = struct { FisLeftJoin int32 _ [4]byte FpEList uintptr -} /* sqlite3.c:132752:9 */ +} /* sqlite3.c:134560:9 */ // An instance of the SubstContext object describes an substitution edit // to be performed on a parse tree. // // All references to columns in table iTable are to be replaced by corresponding // expressions in pEList. -type SubstContext = SubstContext1 /* sqlite3.c:132758:3 */ +type SubstContext = SubstContext1 /* sqlite3.c:134566:3 */ // Scan through the expression pExpr. Replace every reference to // a column in table number iTable with a copy of the iColumn-th @@ -112947,22 +114370,22 @@ type SubstContext = SubstContext1 /* sqlite3.c:132758:3 */ // 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 *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite3.c:132777:13: */ +func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite3.c:134585:13: */ bp := tls.Alloc(72) defer tls.Free(72) if pExpr == uintptr(0) { return uintptr(0) } - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) && - (int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable) { - (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable = I16((*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable) + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) && + ((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable) { + (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable = (*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable } if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable)) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FixedCol)) != U32(0)) { + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) { if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } else { var pNew uintptr var pCopy uintptr = (*ExprList_item)(unsafe.Pointer(((*SubstContext)(unsafe.Pointer(pSubst)).FpEList + 8 /* &.a */) + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*32)).FpExpr @@ -112974,20 +114397,19 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite var db uintptr = (*Parse)(unsafe.Pointer((*SubstContext)(unsafe.Pointer(pSubst)).FpParse)).Fdb if ((*SubstContext)(unsafe.Pointer(pSubst)).FisLeftJoin != 0) && (int32((*Expr)(unsafe.Pointer(pCopy)).Fop) != TK_COLUMN) { libc.Xmemset(tls, bp /* &ifNullRow */, 0, uint64(unsafe.Sizeof(Expr{}))) - (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fop = TK_IF_NULL_ROW + (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fop = U8(TK_IF_NULL_ROW) (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).FpLeft = pCopy (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).FiTable = (*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable - (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fflags = EP_Skip + (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fflags = U32(EP_IfNullRow) pCopy = bp /* &ifNullRow */ } pNew = Xsqlite3ExprDup(tls, db, pCopy, 0) if (pNew != 0) && ((*SubstContext)(unsafe.Pointer(pSubst)).FisLeftJoin != 0) { - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_CanBeNull) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_CanBeNull)) } - if (pNew != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) { - (*Expr)(unsafe.Pointer(pNew)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_FromJoin) + if (pNew != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { + Xsqlite3SetJoinExpr(tls, pNew, (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) } Xsqlite3ExprDelete(tls, db, pExpr) pExpr = pNew @@ -113015,12 +114437,12 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite } (*Expr)(unsafe.Pointer(pExpr)).FpLeft = substExpr(tls, pSubst, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) (*Expr)(unsafe.Pointer(pExpr)).FpRight = substExpr(tls, pSubst, (*Expr)(unsafe.Pointer(pExpr)).FpRight) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { substSelect(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)), 1) } else { substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) (*Window)(unsafe.Pointer(pWin)).FpFilter = substExpr(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpFilter) substExprList(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpPartition) @@ -113030,7 +114452,7 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite return pExpr } -func substExprList(tls *libc.TLS, pSubst uintptr, pList uintptr) { /* sqlite3.c:132858:13: */ +func substExprList(tls *libc.TLS, pSubst uintptr, pList uintptr) { /* sqlite3.c:134665:13: */ var i int32 if pList == uintptr(0) { return @@ -113040,7 +114462,7 @@ func substExprList(tls *libc.TLS, pSubst uintptr, pList uintptr) { /* sqlite3.c: } } -func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* sqlite3.c:132868:13: */ +func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* sqlite3.c:134675:13: */ var pSrc uintptr var pItem uintptr var i int32 @@ -113062,7 +114484,7 @@ func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* s goto __3 } { - substSelect(tls, pSubst, (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect, 1) + substSelect(tls, pSubst, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect, 1) if (uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 60 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 { substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pItem + 96 /* &.u1 */))) } @@ -113083,13 +114505,13 @@ func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* s // // This routine scans the entire SELECT statement and recomputes the // pSrcItem->colUsed mask. -func recomputeColumnsUsedExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:132903:12: */ +func recomputeColumnsUsedExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:134710:12: */ var pItem uintptr if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN { return WRC_Continue } pItem = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) - if (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor != (*Expr)(unsafe.Pointer(pExpr)).FiTable { + if (*SrcItem)(unsafe.Pointer(pItem)).FiCursor != (*Expr)(unsafe.Pointer(pExpr)).FiTable { return WRC_Continue } if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 { @@ -113099,13 +114521,13 @@ func recomputeColumnsUsedExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int return WRC_Continue } -func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* sqlite3.c:132912:13: */ +func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* sqlite3.c:134719:13: */ bp := tls.Alloc(48) defer tls.Free(48) // var w Walker at bp, 48 - if (*SrcList_item)(unsafe.Pointer(pSrcItem)).FpTab == uintptr(0) { + if (*SrcItem)(unsafe.Pointer(pSrcItem)).FpTab == uintptr(0) { return } libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{}))) @@ -113116,10 +114538,97 @@ func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* f func(*libc.TLS, uintptr, uintptr) int32 }{Xsqlite3SelectWalkNoop})) *(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = pSrcItem - (*SrcList_item)(unsafe.Pointer(pSrcItem)).FcolUsed = uint64(0) + (*SrcItem)(unsafe.Pointer(pSrcItem)).FcolUsed = uint64(0) Xsqlite3WalkSelect(tls, bp /* &w */, pSelect) } +// Assign new cursor numbers to each of the items in pSrc. For each +// new cursor number assigned, set an entry in the aCsrMap[] array +// to map the old cursor number to the new: +// +// aCsrMap[iOld] = iNew; +// +// The array is guaranteed by the caller to be large enough for all +// existing cursor numbers in pSrc. +// +// If pSrc contains any sub-selects, call this routine recursively +// on the FROM clause of each such sub-select, with iExcept set to -1. +func srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSrc uintptr, iExcept int32) { /* sqlite3.c:134748:13: */ + var i int32 + var pItem uintptr + i = 0 + pItem = pSrc + 8 /* &.a */ +__1: + if !(i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc) { + goto __3 + } + { + if i != iExcept { + var p uintptr + (*SrcItem)(unsafe.Pointer(pItem)).FiCursor = libc.AssignPtrInt32(aCsrMap+uintptr((*SrcItem)(unsafe.Pointer(pItem)).FiCursor)*4, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)) + for p = (*SrcItem)(unsafe.Pointer(pItem)).FpSelect; p != 0; p = (*Select)(unsafe.Pointer(p)).FpPrior { + srclistRenumberCursors(tls, pParse, aCsrMap, (*Select)(unsafe.Pointer(p)).FpSrc, -1) + } + } + + } + goto __2 +__2: + i++ + pItem += 112 + goto __1 + goto __3 +__3: +} + +// Expression walker callback used by renumberCursors() to update +// Expr objects to match newly assigned cursor numbers. +func renumberCursorsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:134771:12: */ + var aCsrMap uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) + var op int32 = int32((*Expr)(unsafe.Pointer(pExpr)).Fop) + if ((op == TK_COLUMN) || (op == TK_IF_NULL_ROW)) && (*(*int32)(unsafe.Pointer(aCsrMap + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiTable)*4)) != 0) { + (*Expr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiTable)*4)) + } + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) && (*(*int32)(unsafe.Pointer(aCsrMap + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable)*4)) != 0) { + (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable = *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable)*4)) + } + return WRC_Continue +} + +// Assign a new cursor number to each cursor in the FROM clause (Select.pSrc) +// of the SELECT statement passed as the second argument, and to each +// cursor in the FROM clause of any FROM clause sub-selects, recursively. +// Except, do not assign a new cursor number to the iExcept'th element in +// the FROM clause of (*p). Update all expressions and other references +// to refer to the new cursor numbers. +// +// Argument aCsrMap is an array that may be used for temporary working +// space. Two guarantees are made by the caller: +// +// * the array is larger than the largest cursor number used within the +// select statement passed as an argument, and +// +// * the array entries for all cursor numbers that do *not* appear in +// FROM clauses of the select statement as described above are +// initialized to zero. +func renumberCursors(tls *libc.TLS, pParse uintptr, p uintptr, iExcept int32, aCsrMap uintptr) { /* sqlite3.c:134801:13: */ + bp := tls.Alloc(48) + defer tls.Free(48) + + // var w Walker at bp, 48 + + srclistRenumberCursors(tls, pParse, aCsrMap, (*Select)(unsafe.Pointer(p)).FpSrc, iExcept) + libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{}))) + *(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = aCsrMap + (*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) int32 + }{renumberCursorsCb})) + (*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) int32 + }{Xsqlite3SelectWalkNoop})) + Xsqlite3WalkSelect(tls, bp /* &w */, p) +} + // This routine attempts to flatten subqueries as a performance optimization. // This routine returns 1 if it makes changes and 0 if no flattening occurs. // @@ -113212,9 +114721,9 @@ func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* // (17c) every term within the subquery compound must have a FROM clause // (17d) the outer query may not be // (17d1) aggregate, or -// (17d2) DISTINCT, or -// (17d3) a join. -// (17e) the subquery may not contain window functions +// (17d2) DISTINCT +// (17e) the subquery may not contain window functions, and +// (17f) the subquery must not be the RHS of a LEFT JOIN. // // The parent and sub-query may contain WHERE clauses. Subject to // rules (11), (13) and (14), they may also contain ORDER BY, @@ -113230,8 +114739,8 @@ func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* // 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. +// ORDER BY clause of the parent must be copies of a term returned +// by the parent query. // // (19) If the subquery uses LIMIT then the outer query may not // have a WHERE clause. @@ -113247,9 +114756,8 @@ func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* // // (22) The subquery may not be a recursive CTE. // -// (**) Subsumed into restriction (17d3). Was: If the outer query is -// a recursive CTE, then the sub-query may not be a compound query. -// This restriction is because transforming the +// (23) If the outer query is a recursive CTE, then the sub-query may not be +// a compound query. This restriction is because transforming the // parent to a compound query confuses the code that handles // recursive queries in multiSelect(). // @@ -113273,7 +114781,7 @@ func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* // // All of the expression analysis must occur on both the outer query and // the subquery before this routine runs. -func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAgg int32) int32 { /* sqlite3.c:133083:12: */ +func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAgg int32) int32 { /* sqlite3.c:134972:12: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -113292,17 +114800,18 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // var w Walker at bp+32, 48 // Walker to persist agginfo data + var aCsrMap uintptr = uintptr(0) // Check to see if flattening is permitted. Return 0 if not. - if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_QueryFlattener)) != 0 { + if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_QueryFlattener))) != U32(0) { return 0 } pSrc = (*Select)(unsafe.Pointer(p)).FpSrc pSubitem = ((pSrc + 8 /* &.a */) + uintptr(iFrom)*112) - iParent = (*SrcList_item)(unsafe.Pointer(pSubitem)).FiCursor - pSub = (*SrcList_item)(unsafe.Pointer(pSubitem)).FpSelect + iParent = (*SrcItem)(unsafe.Pointer(pSubitem)).FiCursor + pSub = (*SrcItem)(unsafe.Pointer(pSubitem)).FpSelect if ((*Select)(unsafe.Pointer(p)).FpWin != 0) || ((*Select)(unsafe.Pointer(pSub)).FpWin != 0) { return 0 @@ -113321,13 +114830,13 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && ((*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpLimit)).FpRight != 0) { return 0 } // Restriction (14) - if (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Compound) != U32(0)) && ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) { + if (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Compound)) != U32(0)) && ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) { return 0 // Restriction (15) } if (*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc == 0 { return 0 } // Restriction (7) - if ((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_Distinct) != 0 { + if ((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Distinct)) != 0 { return 0 } // Restriction (4) if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1) || (isAgg != 0)) { @@ -113342,10 +114851,10 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && ((*Select)(unsafe.Pointer(p)).FpWhere != 0) { return 0 } // Restriction (19) - if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0)) { + if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)) { return 0 // Restriction (21) } - if ((*Select)(unsafe.Pointer(pSub)).FselFlags & (SF_Recursive)) != 0 { + if ((*Select)(unsafe.Pointer(pSub)).FselFlags & (U32(SF_Recursive))) != 0 { return 0 // Restrictions (22) } @@ -113367,12 +114876,12 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg // the LEFT JOIN table should be all-NULL. // // See also tickets #306, #350, and #3300. - if (int32((*SrcList_item)(unsafe.Pointer(pSubitem)).Ffg.Fjointype) & JT_OUTER) != 0 { + if (int32((*SrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype) & JT_OUTER) != 0 { isLeftJoin = 1 if ((((*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc > 1) || // (3a) (isAgg != 0)) || // (3b) - ((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pSubSrc + 8 /* &.a */))).FpTab)).FnModuleArg != 0)) || // (3c) - (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0)) { + ((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pSubSrc + 8 /* &.a */))).FpTab)).FnModuleArg != 0)) || // (3c) + (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)) { return 0 } } @@ -113385,8 +114894,8 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if (*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0 { return 0 // Restriction (20) } - if ((isAgg != 0) || (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0))) || ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc != 1) { - return 0 // (17d1), (17d2), or (17d3) + if ((isAgg != 0) || (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0))) || (isLeftJoin > 0) { + return 0 // (17d1), (17d2), or (17f) } for pSub1 = pSub; pSub1 != 0; pSub1 = (*Select)(unsafe.Pointer(pSub1)).FpPrior { @@ -113408,22 +114917,35 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg } } } - } - // Ex-restriction (23): - // The only way that the recursive part of a CTE can contain a compound - // subquery is for the subquery to be one term of a join. But if the - // subquery is a join, then the flattening has already been stopped by - // restriction (17d3) + // Restriction (23) + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Recursive)) != 0 { + return 0 + } + + if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1 { + aCsrMap = Xsqlite3DbMallocZero(tls, db, (uint64(uint64((*Parse)(unsafe.Pointer(pParse)).FnTab) * uint64(unsafe.Sizeof(int32(0)))))) + } + } //**** If we reach this point, flattening is permitted. **** // Authorize the subquery - (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcList_item)(unsafe.Pointer(pSubitem)).FzName + (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcItem)(unsafe.Pointer(pSubitem)).FzName Xsqlite3AuthCheck(tls, pParse, SQLITE_SELECT, uintptr(0), uintptr(0), uintptr(0)) (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedAuthContext + // Delete the transient structures associated with thesubquery + pSub1 = (*SrcItem)(unsafe.Pointer(pSubitem)).FpSelect + Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pSubitem)).FzDatabase) + Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pSubitem)).FzName) + Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pSubitem)).FzAlias) + (*SrcItem)(unsafe.Pointer(pSubitem)).FzDatabase = uintptr(0) + (*SrcItem)(unsafe.Pointer(pSubitem)).FzName = uintptr(0) + (*SrcItem)(unsafe.Pointer(pSubitem)).FzAlias = uintptr(0) + (*SrcItem)(unsafe.Pointer(pSubitem)).FpSelect = uintptr(0) + // If the sub-query is a compound SELECT statement, then (by restrictions // 17 and 18 above) it must be a UNION ALL and the parent query must // be of the form: @@ -113461,18 +114983,22 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg var pOrderBy uintptr = (*Select)(unsafe.Pointer(p)).FpOrderBy var pLimit uintptr = (*Select)(unsafe.Pointer(p)).FpLimit var pPrior uintptr = (*Select)(unsafe.Pointer(p)).FpPrior + var pItemTab uintptr = (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab + (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab = uintptr(0) (*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) - (*Select)(unsafe.Pointer(p)).FpSrc = uintptr(0) (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) (*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0) pNew = Xsqlite3SelectDup(tls, db, p, 0) (*Select)(unsafe.Pointer(p)).FpLimit = pLimit (*Select)(unsafe.Pointer(p)).FpOrderBy = pOrderBy - (*Select)(unsafe.Pointer(p)).FpSrc = pSrc - (*Select)(unsafe.Pointer(p)).Fop = TK_ALL + (*Select)(unsafe.Pointer(p)).Fop = U8(TK_ALL) + (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab = pItemTab if pNew == uintptr(0) { (*Select)(unsafe.Pointer(p)).FpPrior = pPrior } else { + if (aCsrMap != 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) { + renumberCursors(tls, pParse, pNew, iFrom, aCsrMap) + } (*Select)(unsafe.Pointer(pNew)).FpPrior = pPrior if pPrior != 0 { (*Select)(unsafe.Pointer(pPrior)).FpNext = pNew @@ -113481,24 +115007,13 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg (*Select)(unsafe.Pointer(p)).FpPrior = pNew } - if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - return 1 - } + + } + Xsqlite3DbFree(tls, db, aCsrMap) + if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + (*SrcItem)(unsafe.Pointer(pSubitem)).FpSelect = pSub1 + return 1 } - - // Begin flattening the iFrom-th entry of the FROM clause - // in the outer query. - pSub = libc.AssignUintptr(&pSub1, (*SrcList_item)(unsafe.Pointer(pSubitem)).FpSelect) - - // Delete the transient table structure associated with the - // subquery - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pSubitem)).FzDatabase) - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pSubitem)).FzName) - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pSubitem)).FzAlias) - (*SrcList_item)(unsafe.Pointer(pSubitem)).FzDatabase = uintptr(0) - (*SrcList_item)(unsafe.Pointer(pSubitem)).FzName = uintptr(0) - (*SrcList_item)(unsafe.Pointer(pSubitem)).FzAlias = uintptr(0) - (*SrcList_item)(unsafe.Pointer(pSubitem)).FpSelect = uintptr(0) // Defer deleting the Table object associated with the // subquery until code generation is @@ -113506,8 +115021,8 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg // refer to the subquery even after flattening. Ticket #3346. // // pSubitem->pTab is always non-NULL by test restrictions and tests above. - if (*SrcList_item)(unsafe.Pointer(pSubitem)).FpTab != uintptr(0) { - var pTabToDel uintptr = (*SrcList_item)(unsafe.Pointer(pSubitem)).FpTab + if (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab != uintptr(0) { + var pTabToDel uintptr = (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab if (*Table)(unsafe.Pointer(pTabToDel)).FnTabRef == U32(1) { var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { @@ -113515,12 +115030,16 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg } return pParse }() - (*Table)(unsafe.Pointer(pTabToDel)).FpNextZombie = (*Parse)(unsafe.Pointer(pToplevel)).FpZombieTab - (*Parse)(unsafe.Pointer(pToplevel)).FpZombieTab = pTabToDel + Xsqlite3ParserAddCleanup(tls, pToplevel, + *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{Xsqlite3DeleteTable})), + pTabToDel) + } else { (*Table)(unsafe.Pointer(pTabToDel)).FnTabRef-- } - (*SrcList_item)(unsafe.Pointer(pSubitem)).FpTab = uintptr(0) + (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab = uintptr(0) } // The following loop runs once for each term in a compound-subquery @@ -113535,6 +115054,7 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg // will scan expressions looking for iParent references and replace // those references with expressions that resolve to the subquery FROM // elements we are now copying in. + pSub = pSub1 pParent = p __1: if !(pParent != 0) { @@ -113548,16 +115068,8 @@ __1: nSubSrc = (*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc // Number of terms in subquery FROM clause pSrc = (*Select)(unsafe.Pointer(pParent)).FpSrc // FROM clause of the outer query - if pSrc != 0 { - // First time through the loop - jointype = (*SrcList_item)(unsafe.Pointer(pSubitem)).Ffg.Fjointype - } else { - // 2nd and subsequent times through the loop - pSrc = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) - if pSrc == uintptr(0) { - goto __3 - } - (*Select)(unsafe.Pointer(pParent)).FpSrc = pSrc + if pParent == p { + jointype = (*SrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype // First time through the loop } // The subquery uses a single slot of the FROM clause of the outer @@ -113585,13 +115097,13 @@ __1: // Transfer the FROM clause terms from the subquery into the // outer query. for i = 0; i < nSubSrc; i++ { - Xsqlite3IdListDelete(tls, db, (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr((i+iFrom))*112)).FpUsing) + Xsqlite3IdListDelete(tls, db, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr((i+iFrom))*112)).FpUsing) - *(*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr((i+iFrom))*112)) = *(*SrcList_item)(unsafe.Pointer((pSubSrc + 8 /* &.a */) + uintptr(i)*112)) - iNewParent = (*SrcList_item)(unsafe.Pointer((pSubSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor - libc.Xmemset(tls, ((pSubSrc + 8 /* &.a */) + uintptr(i)*112), 0, uint64(unsafe.Sizeof(SrcList_item{}))) + *(*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr((i+iFrom))*112)) = *(*SrcItem)(unsafe.Pointer((pSubSrc + 8 /* &.a */) + uintptr(i)*112)) + iNewParent = (*SrcItem)(unsafe.Pointer((pSubSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor + libc.Xmemset(tls, ((pSubSrc + 8 /* &.a */) + uintptr(i)*112), 0, uint64(unsafe.Sizeof(SrcItem{}))) } - (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(iFrom)*112)).Ffg.Fjointype = jointype + (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(iFrom)*112)).Ffg.Fjointype = jointype // Now begin substituting subquery result set expressions for // references to the iParent in the outer query. @@ -113604,7 +115116,7 @@ __1: // // We look at every expression in the outer query and every place we see // "a" we substitute "x*3" and every place we see "b" we substitute "y+10". - if ((*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0) && (((*Select)(unsafe.Pointer(pParent)).FselFlags & SF_NoopOrderBy) == U32(0)) { + if ((*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0) && (((*Select)(unsafe.Pointer(pParent)).FselFlags & U32(SF_NoopOrderBy)) == U32(0)) { // At this point, any non-zero iOrderByCol values indicate that the // ORDER BY column expression is identical to the iOrderByCol'th // expression returned by SELECT statement pSub. Since these values @@ -113648,7 +115160,7 @@ __1: // The flattened query is a compound if either the inner or the // outer query is a compound. - *(*U32)(unsafe.Pointer(pParent + 4 /* &.selFlags */)) |= ((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_Compound) + *(*U32)(unsafe.Pointer(pParent + 4 /* &.selFlags */)) |= ((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Compound)) // restriction (17b) // SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y; @@ -113687,7 +115199,7 @@ __3: // A structure to keep track of all of the column values that are fixed to // a known value due to WHERE clause constraints of the form COLUMN=VALUE. -type WhereConst = WhereConst1 /* sqlite3.c:133502:27 */ +type WhereConst = WhereConst1 /* sqlite3.c:135393:27 */ // Add a new entry to the pConst object. Except, do not add duplicate // pColumn entires. Also, do not add if doing so would not be appropriate. @@ -113695,10 +115207,10 @@ type WhereConst = WhereConst1 /* sqlite3.c:133502:27 */ // The caller guarantees the pColumn is a column and pValue is a constant. // This routine has to do some additional checks before completing the // insert. -func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr, pExpr uintptr) { /* sqlite3.c:133518:13: */ +func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr, pExpr uintptr) { /* sqlite3.c:135409:13: */ var i int32 - if ((*Expr)(unsafe.Pointer((pColumn))).Fflags & (EP_FixedCol)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pColumn))).Fflags & (U32(EP_FixedCol))) != U32(0) { return } if int32(Xsqlite3ExprAffinity(tls, pValue)) != 0 { @@ -113734,13 +115246,13 @@ func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr, // is a constant expression and where the term must be true because it // is part of the AND-connected terms of the expression. For each term // found, add it to the pConst structure. -func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3.c:133563:13: */ +func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3.c:135454:13: */ var pRight uintptr var pLeft uintptr if pExpr == uintptr(0) { return } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { return } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND { @@ -113766,7 +115278,7 @@ func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3 // to be replaced by a value. If pExpr is equivalent to one of the // columns named in pWalker->u.pConst, then overwrite it with its // corresponding value. -func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:133591:12: */ +func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:135482:12: */ var i int32 var pConst uintptr if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN { @@ -113791,7 +115303,7 @@ func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) // A match is found. Add the EP_FixedCol property (*WhereConst)(unsafe.Pointer(pConst)).FnChng++ *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Leaf))) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FixedCol) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FixedCol)) (*Expr)(unsafe.Pointer(pExpr)).FpLeft = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(((i*2)+1))*8)), 0) break @@ -113833,7 +115345,7 @@ func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) // routines know to generate the constant "123" instead of looking up the // column value. Also, to avoid collation problems, this optimization is // only attempted if the "a=123" term uses the default BINARY collation. -func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:133653:12: */ +func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:135544:12: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -113868,6 +115380,27 @@ func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sql return nChng } +// This function is called to determine whether or not it is safe to +// push WHERE clause expression pExpr down to FROM clause sub-query +// pSubq, which contains at least one window function. Return 1 +// if it is safe and the expression should be pushed down, or 0 +// otherwise. +// +// It is only safe to push the expression down if it consists only +// of constants and copies of expressions that appear in the PARTITION +// BY clause of all window function used by the sub-query. It is safe +// to filter out entire partitions, but not rows within partitions, as +// this may change the results of the window functions. +// +// At the time this function is called it is guaranteed that +// +// * the sub-query uses only one distinct window frame, and +// * that the window frame has a PARTITION BY clase. +func pushDownWindowCheck(tls *libc.TLS, pParse uintptr, pSubq uintptr, pExpr uintptr) int32 { /* sqlite3.c:135593:12: */ + + return Xsqlite3ExprIsConstantOrGroupBy(tls, pParse, pExpr, (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSubq)).FpWin)).FpPartition) +} + // Make copies of relevant WHERE clause terms of the outer query into // the WHERE clause of subquery. Example: // @@ -113913,30 +115446,51 @@ func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sql // But if the (b2=2) term were to be pushed down into the bb subquery, // then the (1,1,NULL) row would be suppressed. // -// (6) The inner query features one or more window-functions (since -// changes to the WHERE clause of the inner query could change the -// window over which window functions are calculated). +// (6) Window functions make things tricky as changes to the WHERE clause +// of the inner query could change the window over which window +// functions are calculated. Therefore, do not attempt the optimization +// if: +// +// (6a) The inner query uses multiple incompatible window partitions. +// +// (6b) The inner query is a compound and uses window-functions. +// +// (6c) The WHERE clause does not consist entirely of constants and +// copies of expressions found in the PARTITION BY clause of +// all window-functions used by the sub-query. It is safe to +// filter out entire partitions, as this does not change the +// window over which any window-function is calculated. +// +// (7) The inner query is a Common Table Expression (CTE) that should +// be materialized. (This restriction is implemented in the calling +// routine.) // // 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 *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uintptr, iCursor int32, isLeftJoin int32) int32 { /* sqlite3.c:133736:12: */ +func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uintptr, iCursor int32, isLeftJoin int32) int32 { /* sqlite3.c:135671:12: */ bp := tls.Alloc(32) defer tls.Free(32) var pNew uintptr var nChng int32 = 0 - var pSel uintptr if pWhere == uintptr(0) { return 0 } - if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & SF_Recursive) != 0 { + if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & (U32(SF_Recursive | SF_MultiPart))) != 0 { return 0 - } // restriction (2) + } - for pSel = pSubq; pSel != 0; pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior { - if (*Select)(unsafe.Pointer(pSel)).FpWin != 0 { + if (*Select)(unsafe.Pointer(pSubq)).FpPrior != 0 { + var pSel uintptr + for pSel = pSubq; pSel != 0; pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior { + if (*Select)(unsafe.Pointer(pSel)).FpWin != 0 { + return 0 + } // restriction (6b) + } + } else { + if ((*Select)(unsafe.Pointer(pSubq)).FpWin != 0) && ((*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSubq)).FpWin)).FpPartition == uintptr(0)) { return 0 - } // restriction (6) + } } if (*Select)(unsafe.Pointer(pSubq)).FpLimit != uintptr(0) { @@ -113948,15 +115502,16 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin pWhere = (*Expr)(unsafe.Pointer(pWhere)).FpLeft } if (isLeftJoin != 0) && - (((libc.Bool32(((*Expr)(unsafe.Pointer((pWhere))).Fflags & (EP_FromJoin)) != U32(0))) == 0) || - (int32((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable) != iCursor)) { + (((libc.Bool32(((*Expr)(unsafe.Pointer((pWhere))).Fflags & (U32(EP_FromJoin))) != U32(0))) == 0) || + ((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable != iCursor)) { return 0 // restriction (4) } - if (((*Expr)(unsafe.Pointer((pWhere))).Fflags & (EP_FromJoin)) != U32(0)) && (int32((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable) != iCursor) { + if (((*Expr)(unsafe.Pointer((pWhere))).Fflags & (U32(EP_FromJoin))) != U32(0)) && ((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable != iCursor) { return 0 // restriction (5) } if Xsqlite3ExprIsTableConstant(tls, pWhere, iCursor) != 0 { nChng++ + *(*U32)(unsafe.Pointer(pSubq + 4 /* &.selFlags */)) |= (U32(SF_PushDown)) for pSubq != 0 { // var x SubstContext at bp, 32 @@ -113968,7 +115523,13 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin (*SubstContext)(unsafe.Pointer(bp /* &x */)).FisLeftJoin = 0 (*SubstContext)(unsafe.Pointer(bp /* &x */)).FpEList = (*Select)(unsafe.Pointer(pSubq)).FpEList pNew = substExpr(tls, bp /* &x */, pNew) - if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & SF_Aggregate) != 0 { + if ((*Select)(unsafe.Pointer(pSubq)).FpWin != 0) && (0 == pushDownWindowCheck(tls, pParse, pSubq, pNew)) { + // Restriction 6c has prevented push-down in this case + Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pNew) + nChng-- + break + } + if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & U32(SF_Aggregate)) != 0 { (*Select)(unsafe.Pointer(pSubq)).FpHaving = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(pSubq)).FpHaving, pNew) } else { (*Select)(unsafe.Pointer(pSubq)).FpWhere = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(pSubq)).FpWhere, pNew) @@ -113993,25 +115554,28 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin // This routine must be called after aggregate functions have been // located but before their arguments have been subjected to aggregate // analysis. -func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 { /* sqlite3.c:133825:11: */ +func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 { /* sqlite3.c:135773:11: */ var eRet int32 = WHERE_ORDERBY_NORMAL // Return value var pEList uintptr = *(*uintptr)(unsafe.Pointer(pFunc + 32 /* &.x */)) // Arguments to agg function var zFunc uintptr // Name of aggregate function pFunc var pOrderBy uintptr var sortFlags U8 = U8(0) - if ((pEList == uintptr(0)) || ((*ExprList)(unsafe.Pointer(pEList)).FnExpr != 1)) || (((*Expr)(unsafe.Pointer((pFunc))).Fflags & (EP_WinFunc)) != U32(0)) { + if (((pEList == uintptr(0)) || + ((*ExprList)(unsafe.Pointer(pEList)).FnExpr != 1)) || + (((*Expr)(unsafe.Pointer((pFunc))).Fflags & (U32(EP_WinFunc))) != U32(0))) || + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_MinMaxOpt))) != U32(0)) { return U8(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8 /* &.u */)) - if Xsqlite3StrICmp(tls, zFunc, ts+12964 /* "min" */) == 0 { + if Xsqlite3StrICmp(tls, zFunc, ts+13378 /* "min" */) == 0 { eRet = WHERE_ORDERBY_MIN if Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */))).FpExpr) != 0 { - sortFlags = KEYINFO_ORDER_BIGNULL + sortFlags = U8(KEYINFO_ORDER_BIGNULL) } - } else if Xsqlite3StrICmp(tls, zFunc, ts+12968 /* "max" */) == 0 { + } else if Xsqlite3StrICmp(tls, zFunc, ts+13382 /* "max" */) == 0 { eRet = WHERE_ORDERBY_MAX - sortFlags = KEYINFO_ORDER_DESC + sortFlags = U8(KEYINFO_ORDER_DESC) } else { return U8(eRet) } @@ -114032,15 +115596,15 @@ func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 // 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 *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqlite3.c:133867:14: */ +func isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqlite3.c:135819:14: */ var pTab uintptr var pExpr uintptr if ((((*Select)(unsafe.Pointer(p)).FpWhere != 0) || ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr != 1)) || - ((*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc != 1)) || ((*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect != 0) { + ((*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc != 1)) || ((*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect != 0) { return uintptr(0) } - pTab = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab + pTab = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab pExpr = (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpEList + 8 /* &.a */))).FpExpr if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { @@ -114052,7 +115616,7 @@ func isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqli if (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 0 { return uintptr(0) } - if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFunc)).FfuncFlags & SQLITE_FUNC_COUNT) == U32(0) { + if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_COUNT)) == U32(0) { return uintptr(0) } if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Distinct | EP_WinFunc))) != U32(0) { @@ -114067,23 +115631,22 @@ func isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqli // 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 Xsqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:133898:20: */ +func Xsqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:135850:20: */ bp := tls.Alloc(16) defer tls.Free(16) - if ((*SrcList_item)(unsafe.Pointer(pFrom)).FpTab != 0) && ((uint32(int32(*(*uint8)(unsafe.Pointer((pFrom + 60 /* &.fg */) + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0) { - var pTab uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab - var zIndexedBy uintptr = *(*uintptr)(unsafe.Pointer(pFrom + 96 /* &.u1 */)) - var pIdx uintptr - for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; (pIdx != 0) && (Xsqlite3StrICmp(tls, (*Index)(unsafe.Pointer(pIdx)).FzName, zIndexedBy) != 0); pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext { - } - if !(pIdx != 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+16640 /* "no such index: %..." */, libc.VaList(bp, zIndexedBy, 0)) - (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) - return SQLITE_ERROR - } - (*SrcList_item)(unsafe.Pointer(pFrom)).FpIBIndex = pIdx + var pTab uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab + var zIndexedBy uintptr = *(*uintptr)(unsafe.Pointer(pFrom + 96 /* &.u1 */)) + var pIdx uintptr + + for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; (pIdx != 0) && (Xsqlite3StrICmp(tls, (*Index)(unsafe.Pointer(pIdx)).FzName, zIndexedBy) != 0); pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext { } + if !(pIdx != 0) { + Xsqlite3ErrorMsg(tls, pParse, ts+17051 /* "no such index: %..." */, libc.VaList(bp, zIndexedBy, 0)) + (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) + return SQLITE_ERROR + } + *(*uintptr)(unsafe.Pointer(pFrom + 104 /* &.u2 */)) = pIdx return SQLITE_OK } @@ -114106,7 +115669,7 @@ func Xsqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 // 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 *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:133937:12: */ +func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:135891:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -114140,7 +115703,7 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) return WRC_Continue } for i = ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr - 1); i >= 0; i-- { - if ((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(a+uintptr(i)*32)).FpExpr)).Fflags & EP_Collate) != 0 { + if ((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(a+uintptr(i)*32)).FpExpr)).Fflags & U32(EP_Collate)) != 0 { break } } @@ -114164,7 +115727,7 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) *(*Select)(unsafe.Pointer(pNew)) = *(*Select)(unsafe.Pointer(p)) (*Select)(unsafe.Pointer(p)).FpSrc = pNewSrc (*Select)(unsafe.Pointer(p)).FpEList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), Xsqlite3Expr(tls, db, TK_ASTERISK, uintptr(0))) - (*Select)(unsafe.Pointer(p)).Fop = TK_SELECT + (*Select)(unsafe.Pointer(p)).Fop = U8(TK_SELECT) (*Select)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*Select)(unsafe.Pointer(pNew)).FpGroupBy = uintptr(0) (*Select)(unsafe.Pointer(pNew)).FpHaving = uintptr(0) @@ -114175,7 +115738,7 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*Select)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Compound))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Converted) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Converted)) (*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*Select)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -114185,12 +115748,12 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) // 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 *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:134002:12: */ +func cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:135956:12: */ bp := tls.Alloc(8) defer tls.Free(8) if (uint32(int32(*(*uint8)(unsafe.Pointer(pFrom + 60 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+16658 /* "'%s' is not a fu..." */, libc.VaList(bp, (*SrcList_item)(unsafe.Pointer(pFrom)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+17069 /* "'%s' is not a fu..." */, libc.VaList(bp, (*SrcItem)(unsafe.Pointer(pFrom)).FzName)) return 1 } return 0 @@ -114204,17 +115767,16 @@ func cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* s // // If a non-NULL value is returned, set *ppContext to point to the With // object that the returned CTE belongs to. -func searchWith(tls *libc.TLS, pWith uintptr, pItem uintptr, ppContext uintptr) uintptr { /* sqlite3.c:134021:19: */ - var zName uintptr - if ((*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase == uintptr(0)) && ((libc.AssignUintptr(&zName, (*SrcList_item)(unsafe.Pointer(pItem)).FzName)) != uintptr(0)) { - var p uintptr - for p = pWith; p != 0; p = (*With)(unsafe.Pointer(p)).FpOuter { - var i int32 - for i = 0; i < (*With)(unsafe.Pointer(p)).FnCte; i++ { - if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*32)).FzName) == 0 { - *(*uintptr)(unsafe.Pointer(ppContext)) = p - return ((p + 16 /* &.a */) + uintptr(i)*32) - } +func searchWith(tls *libc.TLS, pWith uintptr, pItem uintptr, ppContext uintptr) uintptr { /* sqlite3.c:135975:19: */ + var zName uintptr = (*SrcItem)(unsafe.Pointer(pItem)).FzName + var p uintptr + + for p = pWith; p != 0; p = (*With)(unsafe.Pointer(p)).FpOuter { + var i int32 + for i = 0; i < (*With)(unsafe.Pointer(p)).FnCte; i++ { + if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*48)).FzName) == 0 { + *(*uintptr)(unsafe.Pointer(ppContext)) = p + return ((p + 16 /* &.a */) + uintptr(i)*48) } } } @@ -114230,53 +115792,63 @@ func searchWith(tls *libc.TLS, pWith uintptr, pItem uintptr, ppContext uintptr) // 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 Xsqlite3WithPush(tls *libc.TLS, pParse uintptr, pWith uintptr, bFree U8) { /* sqlite3.c:134052:21: */ - +func Xsqlite3WithPush(tls *libc.TLS, pParse uintptr, pWith uintptr, bFree U8) { /* sqlite3.c:136006:21: */ if pWith != 0 { (*With)(unsafe.Pointer(pWith)).FpOuter = (*Parse)(unsafe.Pointer(pParse)).FpWith (*Parse)(unsafe.Pointer(pParse)).FpWith = pWith if bFree != 0 { - (*Parse)(unsafe.Pointer(pParse)).FpWithToFree = pWith + Xsqlite3ParserAddCleanup(tls, pParse, + *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{Xsqlite3WithDelete})), + pWith) + } } } // 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. +// a WITH clause on the stack currently maintained by the parser (on the +// pParse->pWith linked list). And if currently processing a CTE +// CTE expression, through routine checks to see if the reference is +// a recursive reference to the 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. +// If pFrom matches a CTE according to either of these two above, pFrom->pTab +// and other fields are populated accordingly. // -// 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 *libc.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3.c:134077:12: */ +// Return 0 if no match is found. +// Return 1 if a match is found. +// Return 2 if an error condition is detected. +func resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3.c:136034:12: */ bp := tls.Alloc(48) defer tls.Free(48) - var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse - var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pCte uintptr // Matched CTE (or NULL if no match) // var pWith uintptr at bp+40, 8 - // WITH clause that pCte belongs to + // The matching WITH - if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { - return SQLITE_ERROR + if (*Parse)(unsafe.Pointer(pParse)).FpWith == uintptr(0) { + // There are no WITH clauses in the stack. No match is possible + return 0 + } + if (*SrcItem)(unsafe.Pointer(pFrom)).FzDatabase != uintptr(0) { + // The FROM term contains a schema qualifier (ex: main.t1) and so + // it cannot possibly be a CTE reference. + return 0 } - pCte = searchWith(tls, (*Parse)(unsafe.Pointer(pParse)).FpWith, pFrom, bp+40 /* &pWith */) if pCte != 0 { + var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTab uintptr var pEList uintptr var pSel uintptr var pLeft uintptr // Left-most SELECT statement + var pRecTerm uintptr // Left-most recursive term var bMayRecursive int32 // True if compound joined by UNION [ALL] var pSavedWith uintptr // Initial value of pParse->pWith + var iRecTab int32 = -1 // Cursor for recursive table + var pCteUse uintptr // If pCte->zCteErr is non-NULL at this point, then this is an illegal // recursive reference to CTE pCte. Leave an error in pParse and return @@ -114284,61 +115856,87 @@ func withExpand(tls *libc.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite // In this case, proceed. if (*Cte)(unsafe.Pointer(pCte)).FzCteErr != 0 { Xsqlite3ErrorMsg(tls, pParse, (*Cte)(unsafe.Pointer(pCte)).FzCteErr, libc.VaList(bp, (*Cte)(unsafe.Pointer(pCte)).FzName)) - return SQLITE_ERROR + return 2 } if cannotBeFunction(tls, pParse, pFrom) != 0 { - return SQLITE_ERROR + return 2 } - (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{})))) + pTab = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{}))) if pTab == uintptr(0) { - return WRC_Abort + return 2 } + pCteUse = (*Cte)(unsafe.Pointer(pCte)).FpUse + if pCteUse == uintptr(0) { + (*Cte)(unsafe.Pointer(pCte)).FpUse = libc.AssignUintptr(&pCteUse, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(CteUse{})))) + if (pCteUse == uintptr(0)) || + (Xsqlite3ParserAddCleanup(tls, pParse, *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{Xsqlite3DbFree})), pCteUse) == uintptr(0)) { + Xsqlite3DbFree(tls, db, pTab) + return 2 + } + (*CteUse)(unsafe.Pointer(pCteUse)).FeM10d = (*Cte)(unsafe.Pointer(pCte)).FeM10d + } + (*SrcItem)(unsafe.Pointer(pFrom)).FpTab = pTab (*Table)(unsafe.Pointer(pTab)).FnTabRef = U32(1) (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3DbStrDup(tls, db, (*Cte)(unsafe.Pointer(pCte)).FzName) (*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1) (*Table)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200) *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral | TF_NoVisibleRowid)) - (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpSelect, 0) + (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpSelect, 0) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - return SQLITE_NOMEM + return 2 + } + + libc.SetBitFieldPtr8Uint32(pFrom+60 /* &.fg */ +4 /* &.isCte */, uint32(1), 7, 0x80) + *(*uintptr)(unsafe.Pointer(pFrom + 104 /* &.u2 */)) = pCteUse + (*CteUse)(unsafe.Pointer(pCteUse)).FnUse++ + if ((*CteUse)(unsafe.Pointer(pCteUse)).FnUse >= 2) && (int32((*CteUse)(unsafe.Pointer(pCteUse)).FeM10d) == M10d_Any) { + (*CteUse)(unsafe.Pointer(pCteUse)).FeM10d = U8(M10d_Yes) } // Check if this is a recursive CTE. - pSel = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect + pRecTerm = libc.AssignUintptr(&pSel, (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect) bMayRecursive = (libc.Bool32((int32((*Select)(unsafe.Pointer(pSel)).Fop) == TK_ALL) || (int32((*Select)(unsafe.Pointer(pSel)).Fop) == TK_UNION))) - if bMayRecursive != 0 { + for (bMayRecursive != 0) && (int32((*Select)(unsafe.Pointer(pRecTerm)).Fop) == int32((*Select)(unsafe.Pointer(pSel)).Fop)) { var i int32 - var pSrc uintptr = (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect)).FpSrc + var pSrc uintptr = (*Select)(unsafe.Pointer(pRecTerm)).FpSrc + for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ { var pItem uintptr = ((pSrc + 8 /* &.a */) + uintptr(i)*112) - if (((*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase == uintptr(0)) && - ((*SrcList_item)(unsafe.Pointer(pItem)).FzName != uintptr(0))) && - (0 == Xsqlite3StrICmp(tls, (*SrcList_item)(unsafe.Pointer(pItem)).FzName, (*Cte)(unsafe.Pointer(pCte)).FzName)) { - (*SrcList_item)(unsafe.Pointer(pItem)).FpTab = pTab - libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isRecursive */, uint32(1), 5, 0x20) + if (((*SrcItem)(unsafe.Pointer(pItem)).FzDatabase == uintptr(0)) && + ((*SrcItem)(unsafe.Pointer(pItem)).FzName != uintptr(0))) && + (0 == Xsqlite3StrICmp(tls, (*SrcItem)(unsafe.Pointer(pItem)).FzName, (*Cte)(unsafe.Pointer(pCte)).FzName)) { + (*SrcItem)(unsafe.Pointer(pItem)).FpTab = pTab (*Table)(unsafe.Pointer(pTab)).FnTabRef++ - *(*U32)(unsafe.Pointer(pSel + 4 /* &.selFlags */)) |= (SF_Recursive) + libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isRecursive */, uint32(1), 5, 0x20) + if ((*Select)(unsafe.Pointer(pRecTerm)).FselFlags & U32(SF_Recursive)) != 0 { + Xsqlite3ErrorMsg(tls, pParse, + ts+17092 /* "multiple referen..." */, libc.VaList(bp+8, (*Cte)(unsafe.Pointer(pCte)).FzName)) + return 2 + } + *(*U32)(unsafe.Pointer(pRecTerm + 4 /* &.selFlags */)) |= (U32(SF_Recursive)) + if iRecTab < 0 { + iRecTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + } + (*SrcItem)(unsafe.Pointer(pItem)).FiCursor = iRecTab } } + if ((*Select)(unsafe.Pointer(pRecTerm)).FselFlags & U32(SF_Recursive)) == U32(0) { + break + } + pRecTerm = (*Select)(unsafe.Pointer(pRecTerm)).FpPrior } - // Only one recursive reference is permitted. - if (*Table)(unsafe.Pointer(pTab)).FnTabRef > U32(2) { - Xsqlite3ErrorMsg(tls, - pParse, ts+16681 /* "multiple referen..." */, libc.VaList(bp+8, (*Cte)(unsafe.Pointer(pCte)).FzName)) - return SQLITE_ERROR - } - - (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 16724 /* "circular referen..." */ + (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 17135 /* "circular referen..." */ pSavedWith = (*Parse)(unsafe.Pointer(pParse)).FpWith (*Parse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp + 40 /* pWith */)) - if bMayRecursive != 0 { - var pPrior uintptr = (*Select)(unsafe.Pointer(pSel)).FpPrior + if ((*Select)(unsafe.Pointer(pSel)).FselFlags & U32(SF_Recursive)) != 0 { - (*Select)(unsafe.Pointer(pPrior)).FpWith = (*Select)(unsafe.Pointer(pSel)).FpWith - Xsqlite3WalkSelect(tls, pWalker, pPrior) - (*Select)(unsafe.Pointer(pPrior)).FpWith = uintptr(0) + (*Select)(unsafe.Pointer(pRecTerm)).FpWith = (*Select)(unsafe.Pointer(pSel)).FpWith + Xsqlite3WalkSelect(tls, pWalker, pRecTerm) + (*Select)(unsafe.Pointer(pRecTerm)).FpWith = uintptr(0) } else { Xsqlite3WalkSelect(tls, pWalker, pSel) } @@ -114349,28 +115947,28 @@ func withExpand(tls *libc.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite pEList = (*Select)(unsafe.Pointer(pLeft)).FpEList if (*Cte)(unsafe.Pointer(pCte)).FpCols != 0 { if (pEList != 0) && ((*ExprList)(unsafe.Pointer(pEList)).FnExpr != (*ExprList)(unsafe.Pointer((*Cte)(unsafe.Pointer(pCte)).FpCols)).FnExpr) { - Xsqlite3ErrorMsg(tls, pParse, ts+16747, /* "table %s has %d ..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+17158, /* "table %s has %d ..." */ libc.VaList(bp+16, (*Cte)(unsafe.Pointer(pCte)).FzName, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, (*ExprList)(unsafe.Pointer((*Cte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*Parse)(unsafe.Pointer(pParse)).FpWith = pSavedWith - return SQLITE_ERROR + return 2 } pEList = (*Cte)(unsafe.Pointer(pCte)).FpCols } Xsqlite3ColumnsFromExprList(tls, pParse, pEList, (pTab + 70 /* &.nCol */), (pTab + 8 /* &.aCol */)) if bMayRecursive != 0 { - if ((*Select)(unsafe.Pointer(pSel)).FselFlags & SF_Recursive) != 0 { - (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 16785 /* "multiple recursi..." */ + if ((*Select)(unsafe.Pointer(pSel)).FselFlags & U32(SF_Recursive)) != 0 { + (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 17196 /* "multiple recursi..." */ } else { - (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 16819 /* "recursive refere..." */ + (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 17230 /* "recursive refere..." */ } Xsqlite3WalkSelect(tls, pWalker, pSel) } (*Cte)(unsafe.Pointer(pCte)).FzCteErr = uintptr(0) (*Parse)(unsafe.Pointer(pParse)).FpWith = pSavedWith + return 1 // Success } - - return SQLITE_OK + return 0 // No match } // If the SELECT passed as the second argument has an associated WITH @@ -114379,7 +115977,7 @@ func withExpand(tls *libc.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite // 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 *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:134205:13: */ +func selectPopWith(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:136192:13: */ var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse if ((*Parse)(unsafe.Pointer(pParse)).FpWith != 0) && ((*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0)) { var pWith uintptr = (*Select)(unsafe.Pointer(findRightmost(tls, p))).FpWith @@ -114395,22 +115993,22 @@ func selectPopWith(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:134 // allocates and populates the SrcList_item.pTab object. If successful, // SQLITE_OK is returned. Otherwise, if an OOM error is encountered, // SQLITE_NOMEM. -func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:134226:20: */ +func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:136213:20: */ bp := tls.Alloc(8) defer tls.Free(8) - var pSel uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect + var pSel uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect var pTab uintptr - (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Table{})))) + (*SrcItem)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Table{})))) if pTab == uintptr(0) { return SQLITE_NOMEM } (*Table)(unsafe.Pointer(pTab)).FnTabRef = U32(1) - if (*SrcList_item)(unsafe.Pointer(pFrom)).FzAlias != 0 { - (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3DbStrDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcList_item)(unsafe.Pointer(pFrom)).FzAlias) + if (*SrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { + (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3DbStrDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+16857 /* "subquery_%u" */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId)) + (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+17268 /* "subquery_%u" */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId)) } for (*Select)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior @@ -114418,7 +116016,7 @@ func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 Xsqlite3ColumnsFromExprList(tls, pParse, (*Select)(unsafe.Pointer(pSel)).FpEList, (pTab + 70 /* &.nCol */), (pTab + 8 /* &.aCol */)) (*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1) (*Table)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200) - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_Ephemeral) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral)) if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return SQLITE_ERROR @@ -114448,7 +116046,7 @@ func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 // If found, expand each "*" to be every column in every table // and TABLE.* to be every column in TABLE. // -func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:134272:12: */ +func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:136259:12: */ bp := tls.Alloc(88) defer tls.Free(88) @@ -114456,6 +116054,7 @@ func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite var i int32 var j int32 var k int32 + var rc int32 var pTabList uintptr var pEList uintptr var pFrom uintptr @@ -114466,7 +116065,7 @@ func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite var selFlags U16 = U16((*Select)(unsafe.Pointer(p)).FselFlags) var elistFlags U32 = U32(0) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Expanded) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Expanded)) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return WRC_Abort } @@ -114498,16 +116097,12 @@ __1: { var pTab uintptr - if (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab != 0 { + if (*SrcItem)(unsafe.Pointer(pFrom)).FpTab != 0 { goto __2 } - if withExpand(tls, pWalker, pFrom) != 0 { - return WRC_Abort - } - if (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab != 0 { - } else if (*SrcList_item)(unsafe.Pointer(pFrom)).FzName == uintptr(0) { - var pSel uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect + if (*SrcItem)(unsafe.Pointer(pFrom)).FzName == uintptr(0) { + var pSel uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect // A sub-query in the FROM clause of a SELECT if Xsqlite3WalkSelect(tls, pWalker, pSel) != 0 { @@ -114516,17 +116111,23 @@ __1: if Xsqlite3ExpandSubquery(tls, pParse, pFrom) != 0 { return WRC_Abort } + } else if (libc.AssignInt32(&rc, resolveFromTermToCte(tls, pParse, pWalker, pFrom))) != 0 { + if rc > 1 { + return WRC_Abort + } + pTab = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab + } else { // An ordinary table or view name in the FROM clause - (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3LocateTableItem(tls, pParse, uint32(0), pFrom)) + (*SrcItem)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3LocateTableItem(tls, pParse, uint32(0), pFrom)) if pTab == uintptr(0) { return WRC_Abort } if (*Table)(unsafe.Pointer(pTab)).FnTabRef >= U32(0xffff) { - Xsqlite3ErrorMsg(tls, pParse, ts+16869, /* "too many referen..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+17280, /* "too many referen..." */ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) - (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = uintptr(0) + (*SrcItem)(unsafe.Pointer(pFrom)).FpTab = uintptr(0) return WRC_Abort } (*Table)(unsafe.Pointer(pTab)).FnTabRef++ @@ -114540,29 +116141,31 @@ __1: return WRC_Abort } - if ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_EnableView) == uint64(0)) { - Xsqlite3ErrorMsg(tls, pParse, ts+16908, /* "access to view \"..." */ + if (((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) && + (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableView)) == uint64(0))) && + ((*Table)(unsafe.Pointer(pTab)).FpSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema) { + Xsqlite3ErrorMsg(tls, pParse, ts+17319, /* "access to view \"..." */ libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) } if ((((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) && ((uint32(int32(*(*uint8)(unsafe.Pointer((pFrom + 60 /* &.fg */) + 4 /* &.fromDDL */)) & 0x40 >> 6))) != 0)) && ((*Table)(unsafe.Pointer(pTab)).FpVTable != uintptr(0))) && - (int32((*VTable)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpVTable)).FeVtabRisk) > (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_TrustedSchema) != uint64(0)))) { - Xsqlite3ErrorMsg(tls, pParse, ts+16939, /* "unsafe use of vi..." */ + (int32((*VTable)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpVTable)).FeVtabRisk) > (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_TrustedSchema)) != uint64(0)))) { + Xsqlite3ErrorMsg(tls, pParse, ts+17350, /* "unsafe use of vi..." */ libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName)) } - (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSelect, 0) + (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSelect, 0) nCol = (*Table)(unsafe.Pointer(pTab)).FnCol (*Table)(unsafe.Pointer(pTab)).FnCol = int16(-1) (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(1) // Turn on Select.selId renumbering - Xsqlite3WalkSelect(tls, pWalker, (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect) + Xsqlite3WalkSelect(tls, pWalker, (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect) (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(eCodeOrig) (*Table)(unsafe.Pointer(pTab)).FnCol = nCol } } // Locate the index named by the INDEXED BY clause, if any. - if Xsqlite3IndexedByLookup(tls, pParse, pFrom) != 0 { + if ((uint32(int32(*(*uint8)(unsafe.Pointer((pFrom + 60 /* &.fg */) + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0) && (Xsqlite3IndexedByLookup(tls, pParse, pFrom) != 0) { return WRC_Abort } @@ -114643,9 +116246,9 @@ __3: goto __6 } { - var pTab uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab - var pSub uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect - var zTabName uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FzAlias + var pTab uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab + var pSub uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect + var zTabName uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FzAlias var zSchemaName uintptr = uintptr(0) var iDb int32 if zTabName == uintptr(0) { @@ -114654,7 +116257,7 @@ __3: if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto __6 } - if (pSub == uintptr(0)) || (((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_NestedFrom) == U32(0)) { + if (pSub == uintptr(0)) || (((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_NestedFrom)) == U32(0)) { pSub = uintptr(0) if (zTName != 0) && (Xsqlite3StrICmp(tls, zTName, zTabName) != 0) { goto __5 @@ -114663,7 +116266,7 @@ __3: if iDb >= 0 { zSchemaName = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName } else { - zSchemaName = ts + 16972 /* "*" */ + zSchemaName = ts + 17383 /* "*" */ } } for j = 0; j < int32((*Table)(unsafe.Pointer(pTab)).FnCol); j++ { @@ -114681,20 +116284,20 @@ __3: // If a column is marked as 'hidden', omit it from the expanded // result-set list unless the SELECT has the SF_IncludeHidden // bit set. - if (((*Select)(unsafe.Pointer(p)).FselFlags & SF_IncludeHidden) == U32(0)) && + if (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_IncludeHidden)) == U32(0)) && ((int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*32))).FcolFlags) & COLFLAG_HIDDEN) != 0) { continue } tableSeen = 1 if (i > 0) && (zTName == uintptr(0)) { - if ((int32((*SrcList_item)(unsafe.Pointer(pFrom)).Ffg.Fjointype) & JT_NATURAL) != 0) && + if ((int32((*SrcItem)(unsafe.Pointer(pFrom)).Ffg.Fjointype) & JT_NATURAL) != 0) && (tableAndColumnIndex(tls, pTabList, i, zName, uintptr(0), uintptr(0), 1) != 0) { // In a NATURAL join, omit the join columns from the // table to the right of the join continue } - if Xsqlite3IdListIndex(tls, (*SrcList_item)(unsafe.Pointer(pFrom)).FpUsing, zName) >= 0 { + if Xsqlite3IdListIndex(tls, (*SrcItem)(unsafe.Pointer(pFrom)).FpUsing, zName) >= 0 { // In a join with a USING clause, omit columns in the // using clause from the table on the right. continue @@ -114712,7 +116315,7 @@ __3: pExpr = Xsqlite3PExpr(tls, pParse, TK_DOT, pLeft, pExpr) } if longNames != 0 { - zColname = Xsqlite3MPrintf(tls, db, ts+9959 /* "%s.%s" */, libc.VaList(bp+24, zTabName, zName)) + zColname = Xsqlite3MPrintf(tls, db, ts+10324 /* "%s.%s" */, libc.VaList(bp+24, zTabName, zName)) zToFree = zColname } } else { @@ -114721,18 +116324,18 @@ __3: pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pExpr) Xsqlite3TokenInit(tls, bp+72 /* &sColname */, zColname) Xsqlite3ExprListSetName(tls, pParse, pNew, bp+72 /* &sColname */, 0) - if ((pNew != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_NestedFrom) != U32(0))) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { + if ((pNew != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_NestedFrom)) != U32(0))) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { var pX uintptr = ((pNew + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*32) Xsqlite3DbFree(tls, db, (*ExprList_item)(unsafe.Pointer(pX)).FzEName) if pSub != 0 { (*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSub)).FpEList+8 /* &.a */)+uintptr(j)*32)).FzEName) } else { - (*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3MPrintf(tls, db, ts+16974, /* "%s.%s.%s" */ + (*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3MPrintf(tls, db, ts+17385, /* "%s.%s.%s" */ libc.VaList(bp+40, zSchemaName, zTabName, zColname)) } - libc.SetBitFieldPtr8Uint32(pX+20 /* &.eEName */, ENAME_TAB, 0, 0x3) + libc.SetBitFieldPtr8Uint32(pX+20 /* &.eEName */, uint32(ENAME_TAB), 0, 0x3) } Xsqlite3DbFree(tls, db, zToFree) } @@ -114748,9 +116351,9 @@ __3: ; if !(tableSeen != 0) { if zTName != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+16983 /* "no such table: %..." */, libc.VaList(bp+64, zTName)) + Xsqlite3ErrorMsg(tls, pParse, ts+17394 /* "no such table: %..." */, libc.VaList(bp+64, zTName)) } else { - Xsqlite3ErrorMsg(tls, pParse, ts+17001 /* "no tables specif..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+17412 /* "no tables specif..." */, 0) } } } @@ -114759,12 +116362,12 @@ __3: (*Select)(unsafe.Pointer(p)).FpEList = pNew } if (*Select)(unsafe.Pointer(p)).FpEList != 0 { - if (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 2*4)) { - Xsqlite3ErrorMsg(tls, pParse, ts+17021 /* "too many columns..." */, 0) + if (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 2*4)) { + Xsqlite3ErrorMsg(tls, pParse, ts+17432 /* "too many columns..." */, 0) return WRC_Abort } if (elistFlags & (U32(EP_HasFunc | EP_Subquery))) != U32(0) { - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_ComplexResult) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_ComplexResult)) } } return WRC_Continue @@ -114781,7 +116384,7 @@ __3: // 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 *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:134582:13: */ +func sqlite3SelectExpand(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:136574:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -114819,16 +116422,16 @@ func sqlite3SelectExpand(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sq // 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 *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:134612:13: */ +func selectAddSubqueryTypeInfo(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:136604:13: */ var pParse uintptr var i int32 var pTabList uintptr var pFrom uintptr - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_HasTypeInfo) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_HasTypeInfo)) != 0 { return } - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_HasTypeInfo) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_HasTypeInfo)) pParse = (*Walker)(unsafe.Pointer(pWalker)).FpParse pTabList = (*Select)(unsafe.Pointer(p)).FpSrc i = 0 @@ -114838,17 +116441,17 @@ __1: goto __3 } { - var pTab uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab + var pTab uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Ephemeral) != U32(0) { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) != U32(0) { // A sub-query in the FROM clause of a SELECT - var pSel uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect + var pSel uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect if pSel != 0 { for (*Select)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior } Xsqlite3SelectAddColumnTypeAndCollation(tls, pParse, pTab, pSel, - SQLITE_AFF_NONE) + int8(SQLITE_AFF_NONE)) } } @@ -114867,7 +116470,7 @@ __3: // SELECT statement. // // Use this routine after name resolution. -func sqlite3SelectAddTypeInfo(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:134647:13: */ +func sqlite3SelectAddTypeInfo(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:136639:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -114896,12 +116499,12 @@ func sqlite3SelectAddTypeInfo(tls *libc.TLS, pParse uintptr, pSelect uintptr) { // * Identifiers in expression are matched to tables. // // This routine acts recursively on all subqueries within the SELECT. -func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:134671:21: */ +func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:136663:21: */ if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return } - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_HasTypeInfo) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_HasTypeInfo)) != 0 { return } sqlite3SelectExpand(tls, pParse, p) @@ -114921,7 +116524,7 @@ func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintp // intermediate results while calculating an aggregate. This // routine generates code that stores NULLs in all of those memory // cells. -func resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:134694:13: */ +func resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:136686:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var i int32 var pFunc uintptr @@ -114945,7 +116548,7 @@ __1: if (*(*uintptr)(unsafe.Pointer(pE + 32 /* &.x */)) == uintptr(0)) || ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32 /* &.x */)))).FnExpr != 1) { Xsqlite3ErrorMsg(tls, pParse, - ts+17052 /* "DISTINCT aggrega..." */, 0) + ts+17463 /* "DISTINCT aggrega..." */, 0) (*AggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -1 } else { var pKeyInfo uintptr = Xsqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32 /* &.x */)), 0, 0) @@ -114966,7 +116569,7 @@ __3: // Invoke the OP_AggFinalize opcode for every aggregate function // in the AggInfo structure. -func finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:134736:13: */ +func finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:136728:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var i int32 var pF uintptr @@ -115004,7 +116607,7 @@ __3: // in pAggInfo, then only populate the pAggInfo->nAccumulator accumulator // registers if register regAcc contains 0. The caller will take care // of setting and clearing regAcc. -func updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo uintptr) { /* sqlite3.c:134758:13: */ +func updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo uintptr) { /* sqlite3.c:136750:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var i int32 var regHit int32 = 0 @@ -115025,10 +116628,10 @@ __1: var regAgg int32 var pList uintptr = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 32 /* &.x */)) - if ((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { var pFilter uintptr = (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 64 /* &.y */)))).FpFilter if (((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) && - (((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0)) && + (((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0)) && (regAcc != 0) { // If regAcc==0, there there exists some min() or max() function // without a FILTER clause that will ensure the magnet registers @@ -115051,7 +116654,7 @@ __1: if pList != 0 { nArg = (*ExprList)(unsafe.Pointer(pList)).FnExpr regAgg = Xsqlite3GetTempRange(tls, pParse, nArg) - Xsqlite3ExprCodeExprList(tls, pParse, pList, regAgg, 0, SQLITE_ECEL_DUP) + Xsqlite3ExprCodeExprList(tls, pParse, pList, regAgg, 0, uint8(SQLITE_ECEL_DUP)) } else { nArg = 0 regAgg = 0 @@ -115064,7 +116667,7 @@ __1: // Also an error codeDistinct(tls, pParse, (*AggInfo_func)(unsafe.Pointer(pF)).FiDistinct, addrNext, 1, regAgg) } - if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0 { + if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0 { var pColl uintptr = uintptr(0) var pItem uintptr var j int32 @@ -115145,17 +116748,17 @@ __9: // Add a single OP_Explain instruction to the VDBE to explain a simple // count(*) query ("SELECT count(*) FROM pTab"). -func explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintptr) { /* sqlite3.c:134855:13: */ +func explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintptr) { /* sqlite3.c:136847:13: */ bp := tls.Alloc(24) defer tls.Free(24) if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 { - var bCover int32 = (libc.Bool32((pIdx != uintptr(0)) && ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)))) - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+17103, /* "SCAN TABLE %s%s%..." */ + var bCover int32 = (libc.Bool32((pIdx != uintptr(0)) && ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)))) + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+17514, /* "SCAN TABLE %s%s%..." */ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, func() uintptr { if bCover != 0 { - return ts + 17121 /* " USING COVERING ..." */ + return ts + 17532 /* " USING COVERING ..." */ } return ts + 703 /* "" */ }(), @@ -115177,12 +116780,13 @@ func explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintpt // 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 *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:134884:12: */ +func havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:136876:12: */ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_AND { var pS uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) - if Xsqlite3ExprIsConstantOrGroupBy(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*Select)(unsafe.Pointer(pS)).FpGroupBy) != 0 { + if (Xsqlite3ExprIsConstantOrGroupBy(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*Select)(unsafe.Pointer(pS)).FpGroupBy) != 0) && + ((libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse))) == 0) { var db uintptr = (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - var pNew uintptr = Xsqlite3Expr(tls, db, TK_INTEGER, ts+6737 /* "1" */) + var pNew uintptr = Xsqlite3Expr(tls, db, TK_INTEGER, ts+6782 /* "1" */) if pNew != 0 { var pWhere uintptr = (*Select)(unsafe.Pointer(pS)).FpWhere { @@ -115214,7 +116818,7 @@ func havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { // 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 *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:134918:13: */ +func havingToWhere(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:136912:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -115232,34 +116836,37 @@ func havingToWhere(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:1349 // 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 *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /* sqlite3.c:134938:28: */ +func isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /* sqlite3.c:136932:16: */ var pItem uintptr + + if ((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pThis)).FpSelect)).FselFlags & U32(SF_PushDown)) != 0 { + return uintptr(0) + } for pItem = pTabList + 8; /* &.a */ pItem < pThis; pItem += 112 { var pS1 uintptr - if (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect == uintptr(0) { + if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect == uintptr(0) { continue } if (uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 60 /* &.fg */ + 4 /* &.viaCoroutine */)) & 0x10 >> 4))) != 0 { continue } - if (*SrcList_item)(unsafe.Pointer(pItem)).FzName == uintptr(0) { + if (*SrcItem)(unsafe.Pointer(pItem)).FzName == uintptr(0) { continue } - if (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpTab)).FpSchema != (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pThis)).FpTab)).FpSchema { + if (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FpSchema != (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pThis)).FpTab)).FpSchema { continue } - if Xsqlite3_stricmp(tls, (*SrcList_item)(unsafe.Pointer(pItem)).FzName, (*SrcList_item)(unsafe.Pointer(pThis)).FzName) != 0 { + if Xsqlite3_stricmp(tls, (*SrcItem)(unsafe.Pointer(pItem)).FzName, (*SrcItem)(unsafe.Pointer(pThis)).FzName) != 0 { continue } - pS1 = (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect - if ((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpTab)).FpSchema == uintptr(0)) && ((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pThis)).FpSelect)).FselId != (*Select)(unsafe.Pointer(pS1)).FselId) { + pS1 = (*SrcItem)(unsafe.Pointer(pItem)).FpSelect + if ((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FpSchema == uintptr(0)) && ((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pThis)).FpSelect)).FselId != (*Select)(unsafe.Pointer(pS1)).FselId) { // The query flattener left two different CTE tables with identical // names in the same FROM clause. continue } - if (Xsqlite3ExprCompare(tls, uintptr(0), (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pThis)).FpSelect)).FpWhere, (*Select)(unsafe.Pointer(pS1)).FpWhere, -1) != 0) || - (Xsqlite3ExprCompare(tls, uintptr(0), (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pThis)).FpSelect)).FpHaving, (*Select)(unsafe.Pointer(pS1)).FpHaving, -1) != 0) { + if ((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & U32(SF_PushDown)) != 0 { // The view was modified by some other optimization such as // pushDownWhereTerms() continue @@ -115269,6 +116876,13 @@ func isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /* return uintptr(0) } +// Deallocate a single AggInfo object +func agginfoFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:136967:13: */ + Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaCol) + Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaFunc) + Xsqlite3DbFreeNN(tls, db, p) +} + // Generate code for the SELECT statement given in the p argument. // // The results are returned according to the SelectDest structure. @@ -115280,7 +116894,7 @@ func isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /* // // This routine does NOT free the Select structure passed in. The // calling function needs to do that. -func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:135070:20: */ +func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:137073:20: */ bp := tls.Alloc(216) defer tls.Free(216) @@ -115313,15 +116927,18 @@ func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int // Implement a co-routine that will return a single row of the result // set on each invocation. var addrTop int32 - // Generate a subroutine that will fill an ephemeral table with - // the content of this subquery. pItem->addrFillSub will point - // to the address of the generated subroutine. pItem->regReturn - // is a register allocated to hold the subroutine return address + // This is a CTE for which materialization code has already been + // generated. Invoke the subroutine to compute the materialization, + // the make the pItem->iCursor be a copy of the ephemerial table that + // holds the result of the materialization. + var pCteUse uintptr + var pCteUse1 uintptr + // Generate a subroutine that will materialize the view. var topAddr int32 var onceAddr int32 var retAddr int32 - var pPrior uintptr var pItem1 uintptr + var pPrior uintptr // var dest SelectDest at bp+96, 40 var pSub1 uintptr @@ -115376,8 +116993,7 @@ func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int var pKeyInfo2 uintptr // Keyinfo for scanned index var pBest uintptr // Best index found so far var iRoot Pgno - var regAcc int32 // "populate accumulators" flag - var addrSkip int32 + var regAcc int32 var pTab1 uintptr // This case when there exist aggregate functions or a GROUP BY clause // or both @@ -115418,90 +117034,99 @@ __2: goto __3 } - // If ORDER BY makes no difference in the output then neither does - // DISTINCT so it can be removed too. - Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpOrderBy) + // All of these destinations are also able to ignore the ORDER BY clause + if !((*Select)(unsafe.Pointer(p)).FpOrderBy != 0) { + goto __4 + } + Xsqlite3ParserAddCleanup(tls, pParse, + *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{Xsqlite3ExprListDelete})), + (*Select)(unsafe.Pointer(p)).FpOrderBy) + (*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) +__4: + ; *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Distinct))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_NoopOrderBy) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_NoopOrderBy)) __3: ; Xsqlite3SelectPrep(tls, pParse, p, uintptr(0)) if !(((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) { - goto __4 + goto __5 } goto select_end -__4: +__5: ; // If the SF_UpdateFrom flag is set, then this function is being called // as part of populating the temp table for an UPDATE...FROM statement. // In this case, it is an error if the target object (pSrc->a[0]) name // or alias is duplicated within FROM clause (pSrc->a[1..n]). - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_UpdateFrom) != 0) { - goto __5 + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_UpdateFrom)) != 0) { + goto __6 } p0 = ((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) i = 1 -__6: +__7: if !(i < (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc) { - goto __8 - } - p1 = (((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(i)*112) - if !(((*SrcList_item)(unsafe.Pointer(p0)).FpTab == (*SrcList_item)(unsafe.Pointer(p1)).FpTab) && (0 == Xsqlite3_stricmp(tls, (*SrcList_item)(unsafe.Pointer(p0)).FzAlias, (*SrcList_item)(unsafe.Pointer(p1)).FzAlias))) { goto __9 } + p1 = (((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(i)*112) + if !(((*SrcItem)(unsafe.Pointer(p0)).FpTab == (*SrcItem)(unsafe.Pointer(p1)).FpTab) && (0 == Xsqlite3_stricmp(tls, (*SrcItem)(unsafe.Pointer(p0)).FzAlias, (*SrcItem)(unsafe.Pointer(p1)).FzAlias))) { + goto __10 + } Xsqlite3ErrorMsg(tls, pParse, - ts+17144, /* "target object/al..." */ + ts+17555, /* "target object/al..." */ libc.VaList(bp, func() uintptr { - if (*SrcList_item)(unsafe.Pointer(p0)).FzAlias != 0 { - return (*SrcList_item)(unsafe.Pointer(p0)).FzAlias + if (*SrcItem)(unsafe.Pointer(p0)).FzAlias != 0 { + return (*SrcItem)(unsafe.Pointer(p0)).FzAlias } - return (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(p0)).FpTab)).FzName + return (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(p0)).FpTab)).FzName }())) goto select_end -__9: +__10: ; - goto __7 -__7: - i++ - goto __6 goto __8 __8: + i++ + goto __7 + goto __9 +__9: ; -__5: +__6: ; if !(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) == SRT_Output) { - goto __10 + goto __11 } generateColumnNames(tls, pParse, p) -__10: +__11: ; rc = Xsqlite3WindowRewrite(tls, pParse, p) if !(rc != 0) { - goto __11 + goto __12 } goto select_end -__11: +__12: ; pTabList = (*Select)(unsafe.Pointer(p)).FpSrc - isAgg = (libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Aggregate) != U32(0))) + isAgg = (libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Aggregate)) != U32(0))) libc.Xmemset(tls, bp+48 /* &sSort */, 0, uint64(unsafe.Sizeof(SortCtx{}))) (*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy // Try to do various optimizations (flattening subqueries, and strength // reduction of join operators) in the FROM clause up into the main query i = 0 -__12: +__13: if !(!(int32((*Select)(unsafe.Pointer(p)).FpPrior) != 0) && (i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc)) { - goto __14 + goto __15 } pItem = ((pTabList + 8 /* &.a */) + uintptr(i)*112) - pSub = (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect - pTab = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab + pSub = (*SrcItem)(unsafe.Pointer(pItem)).FpSelect + pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab // The expander should have already created transient Table objects // even for FROM clause elements such as subqueries that do not correspond @@ -115509,34 +117134,34 @@ __12: // Convert LEFT JOIN into JOIN if there are terms of the right table // of the LEFT JOIN used in the WHERE clause. - if !((((int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) != 0) && - (Xsqlite3ExprImpliesNonNullRow(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor) != 0)) && - ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_SimplifyJoin)) == 0)) { - goto __15 + if !((((int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) != 0) && + (Xsqlite3ExprImpliesNonNullRow(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor) != 0)) && + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_SimplifyJoin))) == U32(0))) { + goto __16 } *(*U8)(unsafe.Pointer(pItem + 60 /* &.fg */ /* &.jointype */)) &= libc.Uint8FromInt32((libc.CplInt32((JT_LEFT | JT_OUTER)))) - unsetJoinExpr(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor) -__15: + unsetJoinExpr(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor) +__16: ; // No futher action if this term of the FROM clause is no a subquery if !(pSub == uintptr(0)) { - goto __16 + goto __17 } - goto __13 -__16: + goto __14 +__17: ; // Catch mismatch in the declared columns of a view and the number of // columns in the SELECT on the RHS if !(int32((*Table)(unsafe.Pointer(pTab)).FnCol) != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpEList)).FnExpr) { - goto __17 + goto __18 } - Xsqlite3ErrorMsg(tls, pParse, ts+17198, /* "expected %d colu..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+17609, /* "expected %d colu..." */ libc.VaList(bp+8, int32((*Table)(unsafe.Pointer(pTab)).FnCol), (*Table)(unsafe.Pointer(pTab)).FzName, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end -__17: +__18: ; // Do not try to flatten an aggregate subquery. @@ -115545,11 +117170,11 @@ __17: // is not a join. But if the outer query is not a join, then the subquery // will be implemented as a co-routine and there is no advantage to // flattening in that case. - if !(((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_Aggregate) != U32(0)) { - goto __18 + if !(((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Aggregate)) != U32(0)) { + goto __19 } - goto __13 -__18: + goto __14 +__19: ; // If the outer query contains a "complex" result set (that is, @@ -115571,63 +117196,63 @@ __18: // SELECT x FROM (SELECT x FROM tab ORDER BY y LIMIT 10); if !(((((*Select)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0)) && (i == 0)) && - (((*Select)(unsafe.Pointer(p)).FselFlags & SF_ComplexResult) != U32(0))) && + (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_ComplexResult)) != U32(0))) && (((*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1) || - ((int32((*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+1*112)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0))) { - goto __19 + ((int32((*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+1*112)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0))) { + goto __20 } - goto __13 -__19: + goto __14 +__20: ; if !(flattenSubquery(tls, pParse, p, i, isAgg) != 0) { - goto __20 - } - if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) { goto __21 } - goto select_end -__21: - ; - // This subquery can be absorbed into its parent. - i = -1 -__20: - ; - pTabList = (*Select)(unsafe.Pointer(p)).FpSrc - if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) { goto __22 } goto select_end __22: ; - if !(!((int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest)) <= SRT_DistQueue)) { + // This subquery can be absorbed into its parent. + i = -1 +__21: + ; + pTabList = (*Select)(unsafe.Pointer(p)).FpSrc + if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { goto __23 } - (*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy + goto select_end __23: ; - goto __13 -__13: - i++ - goto __12 + if !(!((int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest)) <= SRT_Fifo)) { + goto __24 + } + (*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy +__24: + ; goto __14 __14: + i++ + goto __13 + goto __15 +__15: ; // Handle compound SELECT statements using the separate multiSelect() // procedure. if !((*Select)(unsafe.Pointer(p)).FpPrior != 0) { - goto __24 + goto __25 } rc = multiSelect(tls, pParse, p, pDest) if !((*Select)(unsafe.Pointer(p)).FpNext == uintptr(0)) { - goto __25 + goto __26 } Xsqlite3VdbeExplainPop(tls, pParse) -__25: +__26: ; return rc -__24: +__25: ; // Do the WHERE-clause constant propagation optimization if this is @@ -115635,23 +117260,23 @@ __24: // as the equivalent optimization will be handled by query planner in // sqlite3WhereBegin(). if !((((*SrcList)(unsafe.Pointer(pTabList)).FnSrc > 1) && - ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_PropagateConst)) == 0)) && + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_PropagateConst))) == U32(0))) && (propagateConstants(tls, pParse, p) != 0)) { - goto __26 + goto __27 } - goto __27 -__26: - ; + goto __28 __27: ; +__28: + ; // For each term in the FROM clause, do two things: // (1) Authorized unreferenced tables // (2) Generate code for all sub-queries i = 0 -__28: +__29: if !(i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) { - goto __30 + goto __31 } pItem1 = ((pTabList + 8 /* &.a */) + uintptr(i)*112) @@ -115670,20 +117295,20 @@ __28: // which would be unambiguous. But legacy authorization callbacks might // assume the column name is non-NULL and segfault. The use of an empty // string for the fake column name seems safer. - if !(((*SrcList_item)(unsafe.Pointer(pItem1)).FcolUsed == uint64(0)) && ((*SrcList_item)(unsafe.Pointer(pItem1)).FzName != uintptr(0))) { - goto __31 + if !(((*SrcItem)(unsafe.Pointer(pItem1)).FcolUsed == uint64(0)) && ((*SrcItem)(unsafe.Pointer(pItem1)).FzName != uintptr(0))) { + goto __32 } - Xsqlite3AuthCheck(tls, pParse, SQLITE_READ, (*SrcList_item)(unsafe.Pointer(pItem1)).FzName, ts+703 /* "" */, (*SrcList_item)(unsafe.Pointer(pItem1)).FzDatabase) -__31: + Xsqlite3AuthCheck(tls, pParse, SQLITE_READ, (*SrcItem)(unsafe.Pointer(pItem1)).FzName, ts+703 /* "" */, (*SrcItem)(unsafe.Pointer(pItem1)).FzDatabase) +__32: ; // Generate code for all sub-queries in the FROM clause - pSub1 = (*SrcList_item)(unsafe.Pointer(pItem1)).FpSelect + pSub1 = (*SrcItem)(unsafe.Pointer(pItem1)).FpSelect if !(pSub1 == uintptr(0)) { - goto __32 + goto __33 } - goto __29 -__32: + goto __30 +__33: ; // The code for a subquery should only be generated once, though it is @@ -115704,116 +117329,156 @@ __32: // (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit // more conservative than necessary, but much easier than enforcing // an exact limit. - *(*int32)(unsafe.Pointer(pParse + 292 /* &.nHeight */)) += (Xsqlite3SelectExprHeight(tls, p)) + *(*int32)(unsafe.Pointer(pParse + 284 /* &.nHeight */)) += (Xsqlite3SelectExprHeight(tls, p)) // Make copies of constant WHERE-clause terms in the outer query down // inside the subquery. This can help the subquery to run more efficiently. - if !(((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_PushDown)) == 0) && - (pushDownWhereTerms(tls, pParse, pSub1, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcList_item)(unsafe.Pointer(pItem1)).FiCursor, - (libc.Bool32((int32((*SrcList_item)(unsafe.Pointer(pItem1)).Ffg.Fjointype)&JT_OUTER) != 0))) != 0)) { - goto __33 + if !(((((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_PushDown))) == U32(0)) && + (((int32(*(*uint8)(unsafe.Pointer((pItem1 + 60 /* &.fg */) + 4 /* &.isCte */)) & 0x80 >> 7)) == 0) || (int32((*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 104 /* &.u2 */)))).FeM10d) != M10d_Yes))) && + (pushDownWhereTerms(tls, pParse, pSub1, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor, + (libc.Bool32((int32((*SrcItem)(unsafe.Pointer(pItem1)).Ffg.Fjointype)&JT_OUTER) != 0))) != 0)) { + goto __34 } - goto __34 -__33: - ; + + goto __35 __34: ; +__35: + ; zSavedAuthContext = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext - (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcList_item)(unsafe.Pointer(pItem1)).FzName + (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcItem)(unsafe.Pointer(pItem1)).FzName // Generate code to implement the subquery // - // The subquery is implemented as a co-routine if the subquery is - // guaranteed to be the outer loop (so that it does not need to be - // computed more than once) + // The subquery is implemented as a co-routine if: + // (1) the subquery is guaranteed to be the outer loop (so that + // it does not need to be computed more than once), and + // (2) the subquery is not a CTE that should be materialized // - // TODO: Are there other reasons beside (1) to use a co-routine + // TODO: Are there other reasons beside (1) and (2) to use a co-routine // implementation? - if !((i == 0) && + if !(((i == 0) && (((*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1) || - ((int32((*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+1*112)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0))) { - goto __35 + ((int32((*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+1*112)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0))) && // (1) + (((int32(*(*uint8)(unsafe.Pointer((pItem1 + 60 /* &.fg */) + 4 /* &.isCte */)) & 0x80 >> 7)) == 0) || (int32((*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 104 /* &.u2 */)))).FeM10d) != M10d_Yes))) { + goto __36 } // Implement a co-routine that will return a single row of the result // set on each invocation. addrTop = (Xsqlite3VdbeCurrentAddr(tls, v) + 1) - (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) - Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn, 0, addrTop) + (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) + Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn, 0, addrTop) - (*SrcList_item)(unsafe.Pointer(pItem1)).FaddrFillSub = addrTop - Xsqlite3SelectDestInit(tls, bp+96 /* &dest */, SRT_Coroutine, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17238 /* "CO-ROUTINE %u" */, libc.VaList(bp+32, (*Select)(unsafe.Pointer(pSub1)).FselId)) + (*SrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub = addrTop + Xsqlite3SelectDestInit(tls, bp+96 /* &dest */, SRT_Coroutine, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17649 /* "CO-ROUTINE %u" */, libc.VaList(bp+32, (*Select)(unsafe.Pointer(pSub1)).FselId)) Xsqlite3Select(tls, pParse, pSub1, bp+96 /* &dest */) - (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow + (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr8Uint32(pItem1+60 /* &.fg */ +4 /* &.viaCoroutine */, uint32(1), 4, 0x10) - (*SrcList_item)(unsafe.Pointer(pItem1)).FregResult = (*SelectDest)(unsafe.Pointer(bp + 96 /* &dest */)).FiSdst - Xsqlite3VdbeEndCoroutine(tls, v, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn) + (*SrcItem)(unsafe.Pointer(pItem1)).FregResult = (*SelectDest)(unsafe.Pointer(bp + 96 /* &dest */)).FiSdst + Xsqlite3VdbeEndCoroutine(tls, v, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn) Xsqlite3VdbeJumpHere(tls, v, (addrTop - 1)) Xsqlite3ClearTempRegCache(tls, pParse) - goto __36 -__35: + goto __37 +__36: + if !(((uint32(int32(*(*uint8)(unsafe.Pointer((pItem1 + 60 /* &.fg */) + 4 /* &.isCte */)) & 0x80 >> 7))) != 0) && ((*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 104 /* &.u2 */)))).FaddrM9e > 0)) { + goto __38 + } + // This is a CTE for which materialization code has already been + // generated. Invoke the subroutine to compute the materialization, + // the make the pItem->iCursor be a copy of the ephemerial table that + // holds the result of the materialization. + pCteUse = *(*uintptr)(unsafe.Pointer(pItem1 + 104 /* &.u2 */)) + Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*CteUse)(unsafe.Pointer(pCteUse)).FregRtn, (*CteUse)(unsafe.Pointer(pCteUse)).FaddrM9e) + if !((*SrcItem)(unsafe.Pointer(pItem1)).FiCursor != (*CteUse)(unsafe.Pointer(pCteUse)).FiCur) { + goto __40 + } + Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor, (*CteUse)(unsafe.Pointer(pCteUse)).FiCur) +__40: + ; + (*Select)(unsafe.Pointer(pSub1)).FnSelectRow = (*CteUse)(unsafe.Pointer(pCteUse)).FnRowEst + goto __39 +__38: + if !((libc.AssignUintptr(&pPrior, isSelfJoinView(tls, pTabList, pItem1))) != uintptr(0)) { + goto __41 + } + // This view has already been materialized by a prior entry in + // this same FROM clause. Reuse it. + if !((*SrcItem)(unsafe.Pointer(pPrior)).FaddrFillSub != 0) { + goto __43 + } + Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*SrcItem)(unsafe.Pointer(pPrior)).FregReturn, (*SrcItem)(unsafe.Pointer(pPrior)).FaddrFillSub) +__43: + ; + Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor, (*SrcItem)(unsafe.Pointer(pPrior)).FiCursor) + (*Select)(unsafe.Pointer(pSub1)).FnSelectRow = (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pPrior)).FpSelect)).FnSelectRow + goto __42 +__41: onceAddr = 0 // Ticket c52b09c7f38903b1311 - (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) - topAddr = Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn) - (*SrcList_item)(unsafe.Pointer(pItem1)).FaddrFillSub = (topAddr + 1) + (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) + topAddr = Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn) + (*SrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub = (topAddr + 1) if !((int32(*(*uint8)(unsafe.Pointer((pItem1 + 60 /* &.fg */) + 4 /* &.isCorrelated */)) & 0x8 >> 3)) == 0) { - goto __37 + goto __44 } // If the subquery is not correlated and if we are not inside of // a trigger, then we only need to compute the value of the subquery // once. onceAddr = Xsqlite3VdbeAddOp0(tls, v, OP_Once) - goto __38 -__37: + goto __45 +__44: ; -__38: +__45: ; - pPrior = isSelfJoinView(tls, pTabList, pItem1) - if !(pPrior != 0) { - goto __39 - } - Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*SrcList_item)(unsafe.Pointer(pItem1)).FiCursor, (*SrcList_item)(unsafe.Pointer(pPrior)).FiCursor) - - (*Select)(unsafe.Pointer(pSub1)).FnSelectRow = (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pPrior)).FpSelect)).FnSelectRow - goto __40 -__39: - Xsqlite3SelectDestInit(tls, bp+96 /* &dest */, SRT_EphemTab, (*SrcList_item)(unsafe.Pointer(pItem1)).FiCursor) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17252 /* "MATERIALIZE %u" */, libc.VaList(bp+40, (*Select)(unsafe.Pointer(pSub1)).FselId)) + Xsqlite3SelectDestInit(tls, bp+96 /* &dest */, SRT_EphemTab, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17663 /* "MATERIALIZE %u" */, libc.VaList(bp+40, (*Select)(unsafe.Pointer(pSub1)).FselId)) Xsqlite3Select(tls, pParse, pSub1, bp+96 /* &dest */) -__40: - ; - (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow + (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow if !(onceAddr != 0) { - goto __41 + goto __46 } Xsqlite3VdbeJumpHere(tls, v, onceAddr) -__41: +__46: ; - retAddr = Xsqlite3VdbeAddOp1(tls, v, OP_Return, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn) + retAddr = Xsqlite3VdbeAddOp1(tls, v, OP_Return, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn) Xsqlite3VdbeChangeP1(tls, v, topAddr, retAddr) Xsqlite3ClearTempRegCache(tls, pParse) -__36: - ; - if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - goto __42 + if !((uint32(int32(*(*uint8)(unsafe.Pointer(pItem1 + 60 /* &.fg */ + 4 /* &.isCte */)) & 0x80 >> 7))) != 0) { + goto __47 } - goto select_end + pCteUse1 = *(*uintptr)(unsafe.Pointer(pItem1 + 104 /* &.u2 */)) + (*CteUse)(unsafe.Pointer(pCteUse1)).FaddrM9e = (*SrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub + (*CteUse)(unsafe.Pointer(pCteUse1)).FregRtn = (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn + (*CteUse)(unsafe.Pointer(pCteUse1)).FiCur = (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor + (*CteUse)(unsafe.Pointer(pCteUse1)).FnRowEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow +__47: + ; __42: ; - *(*int32)(unsafe.Pointer(pParse + 292 /* &.nHeight */)) -= (Xsqlite3SelectExprHeight(tls, p)) +__39: + ; +__37: + ; + if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + goto __48 + } + goto select_end +__48: + ; + *(*int32)(unsafe.Pointer(pParse + 284 /* &.nHeight */)) -= (Xsqlite3SelectExprHeight(tls, p)) (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedAuthContext - goto __29 -__29: - i++ - goto __28 goto __30 __30: + i++ + goto __29 + goto __31 +__31: ; // Various elements of the SELECT copied into local variables for @@ -115822,7 +117487,7 @@ __30: pWhere = (*Select)(unsafe.Pointer(p)).FpWhere pGroupBy = (*Select)(unsafe.Pointer(p)).FpGroupBy pHaving = (*Select)(unsafe.Pointer(p)).FpHaving - (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FisTnct = (U8(libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0)))) + (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FisTnct = (U8(libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)))) // If the query is DISTINCT with an ORDER BY but is not an aggregate, and // if the select-list is the same as the ORDER BY list, then this query @@ -115838,19 +117503,19 @@ __30: // used for both the ORDER BY and DISTINCT processing. As originally // written the query must use a temp-table for at least one of the ORDER // BY and DISTINCT, and an index or separate temp-table for the other. - if !(((((*Select)(unsafe.Pointer(p)).FselFlags & (U32(SF_Distinct | SF_Aggregate))) == SF_Distinct) && + if !(((((*Select)(unsafe.Pointer(p)).FselFlags & (U32(SF_Distinct | SF_Aggregate))) == U32(SF_Distinct)) && (Xsqlite3ExprListCompare(tls, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy, pEList, -1) == 0)) && ((*Select)(unsafe.Pointer(p)).FpWin == uintptr(0))) { - goto __43 + goto __49 } *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Distinct))) pGroupBy = libc.AssignPtrUintptr(p+56 /* &.pGroupBy */, Xsqlite3ExprListDup(tls, db, pEList, 0)) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Aggregate) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Aggregate)) // Notice that even thought SF_Distinct has been cleared from p->selFlags, // the sDistinct.isTnct is still set. Hence, isTnct represents the // original setting of the SF_Distinct flag, not the current setting -__43: +__49: ; // If there is an ORDER BY clause, then create an ephemeral index to @@ -115861,7 +117526,7 @@ __43: // not needed. The sSort.addrSortIndex variable is used to facilitate // that change. if !((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy != 0) { - goto __44 + goto __50 } pKeyInfo = Xsqlite3KeyInfoFromExprList(tls, pParse, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy, 0, (*ExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -115869,71 +117534,71 @@ __43: (*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FaddrSortIndex = Xsqlite3VdbeAddOp4(tls, v, OP_OpenEphemeral, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FiECursor, (((*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy)).FnExpr + 1) + (*ExprList)(unsafe.Pointer(pEList)).FnExpr), 0, pKeyInfo, -9) - goto __45 -__44: + goto __51 +__50: (*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FaddrSortIndex = -1 -__45: +__51: ; // If the output is destined for a temporary table, open that table. if !(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) == SRT_EphemTab) { - goto __46 + goto __52 } Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, (*ExprList)(unsafe.Pointer(pEList)).FnExpr) -__46: +__52: ; // Set the limiter. iEnd = Xsqlite3VdbeMakeLabel(tls, pParse) - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_FixedLimit) == U32(0)) { - goto __47 + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_FixedLimit)) == U32(0)) { + goto __53 } (*Select)(unsafe.Pointer(p)).FnSelectRow = int16(320) // 4 billion rows -__47: +__53: ; computeLimitRegisters(tls, pParse, p, iEnd) if !(((*Select)(unsafe.Pointer(p)).FiLimit == 0) && ((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex >= 0)) { - goto __48 + goto __54 } - Xsqlite3VdbeChangeOpcode(tls, v, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex, OP_SorterOpen) + Xsqlite3VdbeChangeOpcode(tls, v, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex, uint8(OP_SorterOpen)) *(*U8)(unsafe.Pointer(bp + 48 /* &sSort */ + 36 /* &.sortFlags */)) |= U8((SORTFLAG_UseSorter)) -__48: +__54: ; // Open an ephemeral index to use for the distinct set. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != 0) { - goto __49 + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != 0) { + goto __55 } (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FtabTnct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FaddrTnct = Xsqlite3VdbeAddOp4(tls, v, OP_OpenEphemeral, (*DistinctCtx)(unsafe.Pointer(bp+136 /* &sDistinct */)).FtabTnct, 0, 0, Xsqlite3KeyInfoFromExprList(tls, pParse, (*Select)(unsafe.Pointer(p)).FpEList, 0, 0), -9) - Xsqlite3VdbeChangeP5(tls, v, BTREE_UNORDERED) - (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FeTnctType = WHERE_DISTINCT_UNORDERED - goto __50 -__49: - (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FeTnctType = WHERE_DISTINCT_NOOP -__50: + Xsqlite3VdbeChangeP5(tls, v, uint16(BTREE_UNORDERED)) + (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FeTnctType = U8(WHERE_DISTINCT_UNORDERED) + goto __56 +__55: + (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FeTnctType = U8(WHERE_DISTINCT_NOOP) +__56: ; if !(!(isAgg != 0) && (pGroupBy == uintptr(0))) { - goto __51 + goto __57 } // No aggregate functions and no GROUP BY clause wctrlFlags = (U16((func() uint32 { if (*DistinctCtx)(unsafe.Pointer(bp+136 /* &sDistinct */)).FisTnct != 0 { - return WHERE_WANT_DISTINCT + return uint32(WHERE_WANT_DISTINCT) } return uint32(0) }()) | - ((*Select)(unsafe.Pointer(p)).FselFlags & SF_FixedLimit))) + ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_FixedLimit)))) pWin = (*Select)(unsafe.Pointer(p)).FpWin // Main window object (or NULL) if !(pWin != 0) { - goto __53 + goto __59 } Xsqlite3WindowCodeInit(tls, pParse, p) -__53: +__59: ; // Begin the database scan. @@ -115941,49 +117606,49 @@ __53: pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy, (*Select)(unsafe.Pointer(p)).FpEList, wctrlFlags, int32((*Select)(unsafe.Pointer(p)).FnSelectRow)) if !(pWInfo == uintptr(0)) { - goto __54 + goto __60 } goto select_end -__54: +__60: ; if !(int32(Xsqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*Select)(unsafe.Pointer(p)).FnSelectRow)) { - goto __55 + goto __61 } (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3WhereOutputRowCount(tls, pWInfo) -__55: +__61: ; if !(((*DistinctCtx)(unsafe.Pointer(bp+136 /* &sDistinct */)).FisTnct != 0) && (Xsqlite3WhereIsDistinct(tls, pWInfo) != 0)) { - goto __56 + goto __62 } (*DistinctCtx)(unsafe.Pointer(bp + 136 /* &sDistinct */)).FeTnctType = U8(Xsqlite3WhereIsDistinct(tls, pWInfo)) -__56: +__62: ; if !((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy != 0) { - goto __57 + goto __63 } (*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FnOBSat = Xsqlite3WhereIsOrdered(tls, pWInfo) (*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FlabelOBLopt = Xsqlite3WhereOrderByLimitOptLabel(tls, pWInfo) if !((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FnOBSat == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy)).FnExpr) { - goto __58 + goto __64 } (*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FpOrderBy = uintptr(0) -__58: +__64: ; -__57: +__63: ; // If sorting index that was created by a prior OP_OpenEphemeral // instruction ended up not being needed, then change the OP_OpenEphemeral // into an OP_Noop. if !(((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex >= 0) && ((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy == uintptr(0))) { - goto __59 + goto __65 } Xsqlite3VdbeChangeToNoop(tls, v, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex) -__59: +__65: ; if !(pWin != 0) { - goto __60 + goto __66 } addrGosub = Xsqlite3VdbeMakeLabel(tls, pParse) iCont = Xsqlite3VdbeMakeLabel(tls, pParse) @@ -116001,8 +117666,8 @@ __59: Xsqlite3VdbeAddOp1(tls, v, OP_Return, regGosub) Xsqlite3VdbeResolveLabel(tls, v, iBreak) - goto __61 -__60: + goto __67 +__66: // Use the standard inner loop. selectInnerLoop(tls, pParse, p, -1, bp+48 /* &sSort */, bp+136 /* &sDistinct */, pDest, @@ -116010,11 +117675,12 @@ __60: Xsqlite3WhereBreakLabel(tls, pWInfo)) // End the database scan loop. + Xsqlite3WhereEnd(tls, pWInfo) -__61: +__67: ; - goto __52 -__51: // End of processing for this SELECT + goto __58 +__57: // End of processing for this SELECT sortPTab = 0 // Pseudotable used to decode sorting results sortOut = 0 // Output register from the sorter orderByGrp = 0 // True if the GROUP BY and ORDER BY are the same @@ -116022,45 +117688,45 @@ __51: // End of processing for this SELECT // Remove any and all aliases between the result set and the // GROUP BY clause. if !(pGroupBy != 0) { - goto __62 + goto __68 } // For looping over expression in a list k = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr pItem2 = (*Select)(unsafe.Pointer(p)).FpEList + 8 /* &.a */ -__64: +__70: if !(k > 0) { - goto __66 + goto __72 } *(*U16)(unsafe.Pointer(pItem2 + 24 /* &.u */ /* &.x */ + 2 /* &.iAlias */)) = U16(0) - goto __65 -__65: + goto __71 +__71: k-- pItem2 += 32 - goto __64 - goto __66 -__66: + goto __70 + goto __72 +__72: ; k = (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr pItem2 = pGroupBy + 8 /* &.a */ -__67: +__73: if !(k > 0) { - goto __69 + goto __75 } *(*U16)(unsafe.Pointer(pItem2 + 24 /* &.u */ /* &.x */ + 2 /* &.iAlias */)) = U16(0) - goto __68 -__68: + goto __74 +__74: k-- pItem2 += 32 - goto __67 - goto __69 -__69: + goto __73 + goto __75 +__75: ; if !(int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > 66) { - goto __70 + goto __76 } (*Select)(unsafe.Pointer(p)).FnSelectRow = int16(66) -__70: +__76: ; // If there is both a GROUP BY and an ORDER BY clause and they are @@ -116072,7 +117738,7 @@ __70: // ORDER BY and GROUP BY clauses are the same by setting the orderByGrp // variable. if !(((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy != 0) && ((*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy)).FnExpr)) { - goto __71 + goto __77 } // The GROUP BY processing doesn't care whether rows are delivered in // ASC or DESC order - only that each group is returned contiguously. @@ -116080,32 +117746,32 @@ __70: // ORDER BY to maximize the chances of rows being delivered in an // order that makes the ORDER BY redundant. ii = 0 -__72: +__78: if !(ii < (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) { - goto __74 + goto __80 } sortFlags = (U8(int32((*ExprList_item)(unsafe.Pointer(((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy+8 /* &.a */)+uintptr(ii)*32)).FsortFlags) & KEYINFO_ORDER_DESC)) (*ExprList_item)(unsafe.Pointer((pGroupBy + 8 /* &.a */) + uintptr(ii)*32)).FsortFlags = sortFlags - goto __73 -__73: + goto __79 +__79: ii++ - goto __72 - goto __74 -__74: + goto __78 + goto __80 +__80: ; if !(Xsqlite3ExprListCompare(tls, pGroupBy, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy, -1) == 0) { - goto __75 + goto __81 } orderByGrp = 1 -__75: +__81: ; -__71: +__77: ; - goto __63 -__62: + goto __69 +__68: ; (*Select)(unsafe.Pointer(p)).FnSelectRow = int16(0) -__63: +__69: ; // Create a label to jump to when we want to abort the query @@ -116115,14 +117781,22 @@ __63: // sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the // SELECT statement. pAggInfo = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(AggInfo{}))) - if !(pAggInfo == uintptr(0)) { - goto __76 + if !(pAggInfo != 0) { + goto __82 + } + Xsqlite3ParserAddCleanup(tls, pParse, + *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{agginfoFree})), pAggInfo) + +__82: + ; + if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + goto __83 } goto select_end -__76: +__83: ; - (*AggInfo)(unsafe.Pointer(pAggInfo)).FpNext = (*Parse)(unsafe.Pointer(pParse)).FpAggList - (*Parse)(unsafe.Pointer(pParse)).FpAggList = pAggInfo (*AggInfo)(unsafe.Pointer(pAggInfo)).FselId = (*Select)(unsafe.Pointer(p)).FselId libc.Xmemset(tls, bp+152 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) (*NameContext)(unsafe.Pointer(bp + 152 /* &sNC */)).FpParse = pParse @@ -116140,65 +117814,65 @@ __76: Xsqlite3ExprAnalyzeAggList(tls, bp+152 /* &sNC */, pEList) Xsqlite3ExprAnalyzeAggList(tls, bp+152 /* &sNC */, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy) if !(pHaving != 0) { - goto __77 + goto __84 } if !(pGroupBy != 0) { - goto __78 + goto __85 } havingToWhere(tls, pParse, p) pWhere = (*Select)(unsafe.Pointer(p)).FpWhere -__78: +__85: ; Xsqlite3ExprAnalyzeAggregates(tls, bp+152 /* &sNC */, pHaving) -__77: +__84: ; (*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator = (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn if !((((*Select)(unsafe.Pointer(p)).FpGroupBy == uintptr(0)) && ((*Select)(unsafe.Pointer(p)).FpHaving == uintptr(0))) && ((*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 1)) { - goto __79 + goto __86 } minMaxFlag = minMaxQuery(tls, db, (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr, bp+208 /* &pMinMaxOrderBy */) - goto __80 -__79: - minMaxFlag = WHERE_ORDERBY_NORMAL -__80: + goto __87 +__86: + minMaxFlag = U8(WHERE_ORDERBY_NORMAL) +__87: ; i = 0 -__81: +__88: if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { - goto __83 + goto __90 } pExpr = (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpFExpr *(*int32)(unsafe.Pointer(bp + 152 /* &sNC */ + 40 /* &.ncFlags */)) |= (NC_InAggFunc) Xsqlite3ExprAnalyzeAggList(tls, bp+152 /* &sNC */, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { - goto __84 + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { + goto __91 } Xsqlite3ExprAnalyzeAggregates(tls, bp+152 /* &sNC */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter) -__84: +__91: ; *(*int32)(unsafe.Pointer(bp + 152 /* &sNC */ + 40 /* &.ncFlags */)) &= (libc.CplInt32(NC_InAggFunc)) - goto __82 -__82: + goto __89 +__89: i++ - goto __81 - goto __83 -__83: + goto __88 + goto __90 +__90: ; (*AggInfo)(unsafe.Pointer(pAggInfo)).FmxReg = (*Parse)(unsafe.Pointer(pParse)).FnMem if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - goto __85 + goto __92 } goto select_end -__85: +__92: ; // Processing for aggregates with GROUP BY is very different and // much more complex than aggregates without a GROUP BY. if !(pGroupBy != 0) { - goto __86 + goto __93 } // Return address register for reset subroutine // If there is a GROUP BY clause we might need a sorting index to @@ -116241,27 +117915,28 @@ __85: return 0 }()))), 0) if !(pWInfo == uintptr(0)) { - goto __88 + goto __95 } goto select_end -__88: +__95: ; + if !(Xsqlite3WhereIsOrdered(tls, pWInfo) == (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) { - goto __89 + goto __96 } // The optimizer is able to deliver rows in group by order so // we do not have to sort. The OP_OpenEphemeral table will be // cancelled later because we still need to use the pKeyInfo groupBySort = 0 - goto __90 -__89: + goto __97 +__96: explainTempTable(tls, pParse, func() uintptr { - if ((*DistinctCtx)(unsafe.Pointer(bp+136 /* &sDistinct */)).FisTnct != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) == U32(0)) { - return ts + 17267 /* "DISTINCT" */ + if ((*DistinctCtx)(unsafe.Pointer(bp+136 /* &sDistinct */)).FisTnct != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) == U32(0)) { + return ts + 17678 /* "DISTINCT" */ } - return ts + 17276 /* "GROUP BY" */ + return ts + 17687 /* "GROUP BY" */ }()) groupBySort = 1 @@ -116269,54 +117944,55 @@ __89: nCol = nGroupBy j = nGroupBy i = 0 -__91: +__98: if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { - goto __93 + goto __100 } if !(int32((*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol+uintptr(i)*32)).FiSorterColumn) >= j) { - goto __94 + goto __101 } nCol++ j++ -__94: +__101: ; - goto __92 -__92: + goto __99 +__99: i++ - goto __91 - goto __93 -__93: + goto __98 + goto __100 +__100: ; regBase = Xsqlite3GetTempRange(tls, pParse, nCol) Xsqlite3ExprCodeExprList(tls, pParse, pGroupBy, regBase, 0, uint8(0)) j = nGroupBy i = 0 -__95: +__102: if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { - goto __97 + goto __104 } pCol = ((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32) if !(int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j) { - goto __98 + goto __105 } r1 = (j + regBase) Xsqlite3ExprCodeGetColumnOfTable(tls, v, (*AggInfo_col)(unsafe.Pointer(pCol)).FpTab, (*AggInfo_col)(unsafe.Pointer(pCol)).FiTable, int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn), r1) j++ -__98: +__105: ; - goto __96 -__96: + goto __103 +__103: i++ - goto __95 - goto __97 -__97: + goto __102 + goto __104 +__104: ; regRecord = Xsqlite3GetTempReg(tls, pParse) Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regBase, nCol, regRecord) Xsqlite3VdbeAddOp2(tls, v, OP_SorterInsert, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, regRecord) Xsqlite3ReleaseTempReg(tls, pParse, regRecord) Xsqlite3ReleaseTempRange(tls, pParse, regBase, nCol) + Xsqlite3WhereEnd(tls, pWInfo) (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = libc.AssignInt32(&sortPTab, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)) sortOut = Xsqlite3GetTempReg(tls, pParse) @@ -116324,7 +118000,7 @@ __97: Xsqlite3VdbeAddOp2(tls, v, OP_SorterSort, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) (*AggInfo)(unsafe.Pointer(pAggInfo)).FuseSortingIdx = U8(1) -__90: +__97: ; // If the index or temporary table used by the GROUP BY sort @@ -116334,13 +118010,13 @@ __90: // This is an optimization - the correct answer should result regardless. // Use the SQLITE_GroupByOrder flag with SQLITE_TESTCTRL_OPTIMIZER to // disable this optimization for testing purposes. - if !(((orderByGrp != 0) && ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_GroupByOrder)) == 0)) && + if !(((orderByGrp != 0) && (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_GroupByOrder))) == U32(0))) && ((groupBySort != 0) || (Xsqlite3WhereIsSorted(tls, pWInfo) != 0))) { - goto __99 + goto __106 } (*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FpOrderBy = uintptr(0) Xsqlite3VdbeChangeToNoop(tls, v, (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FaddrSortIndex) -__99: +__106: ; // Evaluate the current GROUP BY terms and store in b0, b1, b2... @@ -116349,33 +118025,33 @@ __99: // from the previous row currently stored in a0, a1, a2... addrTopOfLoop = Xsqlite3VdbeCurrentAddr(tls, v) if !(groupBySort != 0) { - goto __100 + goto __107 } Xsqlite3VdbeAddOp3(tls, v, OP_SorterData, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, sortOut, sortPTab) -__100: +__107: ; j = 0 -__101: +__108: if !(j < (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) { - goto __103 + goto __110 } if !(groupBySort != 0) { - goto __104 + goto __111 } Xsqlite3VdbeAddOp3(tls, v, OP_Column, sortPTab, j, (iBMem + j)) - goto __105 -__104: + goto __112 +__111: (*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = U8(1) Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pGroupBy+8 /* &.a */)+uintptr(j)*32)).FpExpr, (iBMem + j)) -__105: +__112: ; - goto __102 -__102: + goto __109 +__109: j++ - goto __101 - goto __103 -__103: + goto __108 + goto __110 +__110: ; Xsqlite3VdbeAddOp4(tls, v, OP_Compare, iAMem, iBMem, (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr, Xsqlite3KeyInfoRef(tls, pKeyInfo1), -9) @@ -116405,15 +118081,16 @@ __103: // End of the loop if !(groupBySort != 0) { - goto __106 + goto __113 } Xsqlite3VdbeAddOp2(tls, v, OP_SorterNext, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrTopOfLoop) - goto __107 -__106: + goto __114 +__113: + ; Xsqlite3WhereEnd(tls, pWInfo) Xsqlite3VdbeChangeToNoop(tls, v, addrSortingIdx) -__107: +__114: ; // Output the final row of result @@ -116451,10 +118128,10 @@ __107: Xsqlite3VdbeAddOp1(tls, v, OP_Return, regReset) - goto __87 -__86: + goto __94 +__93: if !((libc.AssignUintptr(&pTab1, isSimpleCount(tls, p, pAggInfo))) != uintptr(0)) { - goto __108 + goto __115 } // If isSimpleCount() returns a pointer to a Table structure, then // the SQL statement is of the form: @@ -116485,60 +118162,60 @@ __86: // // In practice the KeyInfo structure will not be used. It is only // passed to keep OP_OpenRead happy. - if !(!(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & TF_WithoutRowid) == U32(0))) { - goto __110 + if !(!(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { + goto __117 } pBest = Xsqlite3PrimaryKeyIndex(tls, pTab1) -__110: +__117: ; if !(!((int32(*(*uint8)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + 60 /* &.fg */ + 4 /* &.notIndexed */)) & 0x1 >> 0)) != 0)) { - goto __111 + goto __118 } pIdx = (*Table)(unsafe.Pointer(pTab1)).FpIndex -__112: +__119: if !(pIdx != 0) { - goto __114 + goto __121 } if !(((((int32(*(*uint16)(unsafe.Pointer(pIdx + 100 /* &.bUnordered */)) & 0x4 >> 2)) == 0) && (int32((*Index)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*Table)(unsafe.Pointer(pTab1)).FszTabRow))) && ((*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0))) && (!(pBest != 0) || (int32((*Index)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*Index)(unsafe.Pointer(pBest)).FszIdxRow)))) { - goto __115 + goto __122 } pBest = pIdx -__115: +__122: ; - goto __113 -__113: + goto __120 +__120: pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext - goto __112 - goto __114 -__114: + goto __119 + goto __121 +__121: ; -__111: +__118: ; if !(pBest != 0) { - goto __116 + goto __123 } iRoot = (*Index)(unsafe.Pointer(pBest)).Ftnum pKeyInfo2 = Xsqlite3KeyInfoOfIndex(tls, pParse, pBest) -__116: +__123: ; // Open a read-only cursor, execute the OP_Count, close the cursor. Xsqlite3VdbeAddOp4Int(tls, v, OP_OpenRead, iCsr, int32(iRoot), iDb, 1) if !(pKeyInfo2 != 0) { - goto __117 + goto __124 } Xsqlite3VdbeChangeP4(tls, v, -1, pKeyInfo2, -9) -__117: +__124: ; Xsqlite3VdbeAddOp2(tls, v, OP_Count, iCsr, (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FiMem) Xsqlite3VdbeAddOp1(tls, v, OP_Close, iCsr) explainSimpleCount(tls, pParse, pTab1, pBest) - goto __109 -__108: - regAcc = 0 + goto __116 +__115: + regAcc = 0 // "populate accumulators" flag // If there are accumulator registers but no min() or max() functions // without FILTER clauses, allocate register regAcc. Register regAcc @@ -116550,40 +118227,40 @@ __108: // least once even if the FILTER clause means the min() or max() // function visits zero rows. if !((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) { - goto __118 + goto __125 } i = 0 -__119: +__126: if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { - goto __121 + goto __128 } - if !(((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpFExpr))).Fflags & (EP_WinFunc)) != U32(0)) { - goto __122 + if !(((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpFExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { + goto __129 } - goto __120 -__122: + goto __127 +__129: ; - if !(((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*24)).FpFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0) { - goto __123 + if !(((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*24)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0) { + goto __130 } - goto __121 -__123: + goto __128 +__130: ; - goto __120 -__120: + goto __127 +__127: i++ - goto __119 - goto __121 -__121: + goto __126 + goto __128 +__128: ; if !(i == (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { - goto __124 + goto __131 } regAcc = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regAcc) -__124: +__131: ; -__118: +__125: ; // This case runs if the aggregate has no GROUP BY clause. The @@ -116600,63 +118277,64 @@ __118: pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, *(*uintptr)(unsafe.Pointer(bp + 208 /* pMinMaxOrderBy */)), uintptr(0), uint16(minMaxFlag), 0) if !(pWInfo == uintptr(0)) { - goto __125 + goto __132 } goto select_end -__125: +__132: ; + updateAccumulator(tls, pParse, regAcc, pAggInfo) if !(regAcc != 0) { - goto __126 + goto __133 } Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, regAcc) -__126: +__133: ; - addrSkip = Xsqlite3WhereOrderByLimitOptLabel(tls, pWInfo) - if !(addrSkip != Xsqlite3WhereContinueLabel(tls, pWInfo)) { - goto __127 + if !(minMaxFlag != 0) { + goto __134 } - Xsqlite3VdbeGoto(tls, v, addrSkip) -__127: + Xsqlite3WhereMinMaxOptEarlyOut(tls, v, pWInfo) +__134: ; + Xsqlite3WhereEnd(tls, pWInfo) finalizeAggFunctions(tls, pParse, pAggInfo) -__109: +__116: ; (*SortCtx)(unsafe.Pointer(bp + 48 /* &sSort */)).FpOrderBy = uintptr(0) Xsqlite3ExprIfFalse(tls, pParse, pHaving, addrEnd, SQLITE_JUMPIFNULL) selectInnerLoop(tls, pParse, p, -1, uintptr(0), uintptr(0), pDest, addrEnd, addrEnd) -__87: +__94: ; Xsqlite3VdbeResolveLabel(tls, v, addrEnd) -__52: +__58: ; // endif aggregate query if !(int32((*DistinctCtx)(unsafe.Pointer(bp+136 /* &sDistinct */)).FeTnctType) == WHERE_DISTINCT_UNORDERED) { - goto __128 + goto __135 } - explainTempTable(tls, pParse, ts+17267 /* "DISTINCT" */) -__128: + explainTempTable(tls, pParse, ts+17678 /* "DISTINCT" */) +__135: ; // If there is an ORDER BY clause, then we need to sort the results // and send them to the callback one by one. if !((*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FpOrderBy != 0) { - goto __129 + goto __136 } explainTempTable(tls, pParse, func() uintptr { if (*SortCtx)(unsafe.Pointer(bp+48 /* &sSort */)).FnOBSat > 0 { - return ts + 17285 /* "RIGHT PART OF OR..." */ + return ts + 17696 /* "RIGHT PART OF OR..." */ } - return ts + 16420 /* "ORDER BY" */ + return ts + 17719 /* "ORDER BY" */ }()) generateSortTail(tls, pParse, p, bp+48 /* &sSort */, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, pDest) -__129: +__136: ; // Jump here to skip this query @@ -116706,7 +118384,7 @@ type TabResult1 = struct { FnData U32 Frc int32 _ [4]byte -} /* sqlite3.c:136216:9 */ +} /* sqlite3.c:138257:9 */ //************* End of select.c ********************************************* //************* Begin file table.c ****************************************** @@ -116730,12 +118408,12 @@ type TabResult1 = struct { // This structure is used to pass data from sqlite3_get_table() through // to the callback function is uses to build the result. -type TabResult = TabResult1 /* sqlite3.c:136224:3 */ +type TabResult = TabResult1 /* sqlite3.c:138265:3 */ // 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 *libc.TLS, pArg uintptr, nCol int32, argv uintptr, colv uintptr) int32 { /* sqlite3.c:136231:12: */ +func sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr, colv uintptr) int32 { /* sqlite3.c:138272:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -116784,7 +118462,7 @@ __7: if !(i < nCol) { goto __9 } - z = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if !(z == uintptr(0)) { goto __10 } @@ -116806,7 +118484,7 @@ __5: } Xsqlite3_free(tls, (*TabResult)(unsafe.Pointer(p)).FzErrMsg) (*TabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, - ts+17308 /* "sqlite3_get_tabl..." */, 0) + ts+17728 /* "sqlite3_get_tabl..." */, 0) (*TabResult)(unsafe.Pointer(p)).Frc = SQLITE_ERROR return 1 __11: @@ -116866,7 +118544,7 @@ malloc_failed: // 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 *libc.TLS, db uintptr, zSql uintptr, pazResult uintptr, pnRow uintptr, pnColumn uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:136305:16: */ +func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintptr, pnRow uintptr, pnColumn uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:138346:16: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -116905,7 +118583,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp, (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp, (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FzErrMsg)) } Xsqlite3_free(tls, (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FzErrMsg) } @@ -116938,7 +118616,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp } // This routine frees the space the sqlite3_get_table() malloced. -func Xsqlite3_free_table(tls *libc.TLS, azResult uintptr) { /* sqlite3.c:136374:17: */ +func Xsqlite3_free_table(tls *libc.TLS, azResult uintptr) { /* sqlite3.c:138415:17: */ if azResult != 0 { var i int32 var n int32 @@ -116969,7 +118647,7 @@ func Xsqlite3_free_table(tls *libc.TLS, azResult uintptr) { /* sqlite3.c:136374: // #include "sqliteInt.h" // Delete a linked list of TriggerStep structures. -func Xsqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr) { /* sqlite3.c:136409:21: */ +func Xsqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr) { /* sqlite3.c:138450:21: */ for pTriggerStep != 0 { var pTmp uintptr = pTriggerStep pTriggerStep = (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpNext @@ -116998,38 +118676,38 @@ func Xsqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr) // 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 Xsqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) uintptr { /* sqlite3.c:136440:24: */ - var pTmpSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32)).FpSchema - var pList uintptr = uintptr(0) // List of triggers to return +func Xsqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) uintptr { /* sqlite3.c:138481:24: */ + var pTmpSchema uintptr // Schema of the pTab table + var pList uintptr // List of triggers to return + var p uintptr // Loop variable for TEMP triggers if (*Parse)(unsafe.Pointer(pParse)).FdisableTriggers != 0 { return uintptr(0) } - + pTmpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32)).FpSchema + p = (*Hash)(unsafe.Pointer((pTmpSchema + 56 /* &.trigHash */))).Ffirst + if p == uintptr(0) { + return (*Table)(unsafe.Pointer(pTab)).FpTrigger + } + pList = (*Table)(unsafe.Pointer(pTab)).FpTrigger if pTmpSchema != (*Table)(unsafe.Pointer(pTab)).FpSchema { - var p uintptr - - for p = (*Hash)(unsafe.Pointer((pTmpSchema + 56 /* &.trigHash */))).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext { + for p != 0 { var pTrig uintptr = (*HashElem)(unsafe.Pointer(p)).Fdata if ((*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema == (*Table)(unsafe.Pointer(pTab)).FpSchema) && (0 == Xsqlite3StrICmp(tls, (*Trigger)(unsafe.Pointer(pTrig)).Ftable, (*Table)(unsafe.Pointer(pTab)).FzName)) { - (*Trigger)(unsafe.Pointer(pTrig)).FpNext = func() uintptr { - if pList != 0 { - return pList - } - return (*Table)(unsafe.Pointer(pTab)).FpTrigger - }() + (*Trigger)(unsafe.Pointer(pTrig)).FpNext = pList + pList = pTrig + } else if int32((*Trigger)(unsafe.Pointer(pTrig)).Fop) == TK_RETURNING { + + (*Trigger)(unsafe.Pointer(pTrig)).Ftable = (*Table)(unsafe.Pointer(pTab)).FzName + (*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema + (*Trigger)(unsafe.Pointer(pTrig)).FpNext = pList pList = pTrig } + p = (*HashElem)(unsafe.Pointer(p)).Fnext } } - - return func() uintptr { - if pList != 0 { - return pList - } - return (*Table)(unsafe.Pointer(pTab)).FpTrigger - }() + return pList } // This is called by the parser when it sees a CREATE TRIGGER statement @@ -117038,9 +118716,9 @@ func Xsqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) uintptr { // in pParse->pNewTrigger. After the trigger actions have been parsed, the // sqlite3FinishTrigger() function is called to complete the trigger // construction process. -func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, tr_tm int32, op int32, pColumns uintptr, pTableName uintptr, pWhen uintptr, isTemp int32, noErr int32) { /* sqlite3.c:136473:21: */ - bp := tls.Alloc(104) - defer tls.Free(104) +func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, tr_tm int32, op int32, pColumns uintptr, pTableName uintptr, pWhen uintptr, isTemp int32, noErr int32) { /* sqlite3.c:138525:21: */ + bp := tls.Alloc(152) + defer tls.Free(152) var pTrigger uintptr // The new trigger var pTab uintptr // Table that the trigger fires off of @@ -117049,7 +118727,7 @@ func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 var iDb int32 // The database to store the trigger in // var pName uintptr at bp+48, 8 // The unqualified db name - // var sFix DbFixer at bp+56, 48 + // var sFix DbFixer at bp+56, 96 var iTabDb int32 var code int32 @@ -117068,7 +118746,7 @@ func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if !((*Token)(unsafe.Pointer(pName2)).Fn > uint32(0)) { goto __3 } - Xsqlite3ErrorMsg(tls, pParse, ts+17373 /* "temporary trigge..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+17793 /* "temporary trigge..." */, 0) goto trigger_cleanup __3: ; @@ -117103,8 +118781,8 @@ __5: if !(((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) && (iDb != 1)) { goto __6 } - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzDatabase) - (*SrcList_item)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzDatabase = uintptr(0) + Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzDatabase) + (*SrcItem)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzDatabase = uintptr(0) __6: ; @@ -117129,7 +118807,7 @@ __7: __8: ; - Xsqlite3FixInit(tls, bp+56 /* &sFix */, pParse, iDb, ts+17419 /* "trigger" */, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */))) + Xsqlite3FixInit(tls, bp+56 /* &sFix */, pParse, iDb, ts+17839 /* "trigger" */, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */))) if !(Xsqlite3FixSrcList(tls, bp+56 /* &sFix */, pTableName) != 0) { goto __9 } @@ -117141,104 +118819,91 @@ __9: goto __10 } // The table does not exist. - if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) == 1) { - goto __11 - } - // Ticket #3810. - // Normally, whenever a table is dropped, all associated triggers are - // dropped too. But if a TEMP trigger is created on a non-TEMP table - // and the table is dropped by a different database connection, the - // trigger is not visible to the database connection that does the - // drop so the trigger cannot be dropped. This results in an - // "orphaned trigger" - a trigger whose associated table is missing. - libc.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.orphanTrigger */, uint32(1), 0, 0x1) -__11: - ; - goto trigger_cleanup + goto trigger_orphan_error __10: ; if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { - goto __12 + goto __11 } - Xsqlite3ErrorMsg(tls, pParse, ts+17427 /* "cannot create tr..." */, 0) - goto trigger_cleanup -__12: + Xsqlite3ErrorMsg(tls, pParse, ts+17847 /* "cannot create tr..." */, 0) + goto trigger_orphan_error +__11: ; // Check that the trigger name is not reserved and that no trigger of the // specified name exists zName = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */))) if !(zName == uintptr(0)) { - goto __13 + goto __12 } + goto trigger_cleanup +__12: + ; + if !(Xsqlite3CheckObjectName(tls, pParse, zName, ts+17839 /* "trigger" */, (*Table)(unsafe.Pointer(pTab)).FzName) != 0) { + goto __13 + } goto trigger_cleanup __13: ; - if !(Xsqlite3CheckObjectName(tls, pParse, zName, ts+17419 /* "trigger" */, (*Table)(unsafe.Pointer(pTab)).FzName) != 0) { + + if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME)) { goto __14 } + if !(Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema+56 /* &.trigHash */), zName) != 0) { + goto __15 + } + if !(!(noErr != 0)) { + goto __16 + } + Xsqlite3ErrorMsg(tls, pParse, ts+17888 /* "trigger %T alrea..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */)))) + goto __17 +__16: + ; + Xsqlite3CodeVerifySchema(tls, pParse, iDb) +__17: + ; goto trigger_cleanup +__15: + ; __14: ; - if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME)) { - goto __15 - } - if !(Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema+56 /* &.trigHash */), zName) != 0) { - goto __16 - } - if !(!(noErr != 0)) { - goto __17 - } - Xsqlite3ErrorMsg(tls, pParse, ts+17468 /* "trigger %T alrea..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */)))) - goto __18 -__17: - ; - Xsqlite3CodeVerifySchema(tls, pParse, iDb) -__18: - ; - goto trigger_cleanup -__16: - ; -__15: - ; - // Do not create a trigger on a system table - if !(Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+6905 /* "sqlite_" */, 7) == 0) { - goto __19 + if !(Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+6950 /* "sqlite_" */, 7) == 0) { + goto __18 } - Xsqlite3ErrorMsg(tls, pParse, ts+17494 /* "cannot create tr..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+17914 /* "cannot create tr..." */, 0) goto trigger_cleanup -__19: +__18: ; // INSTEAD of triggers are only for views and views only support INSTEAD // of triggers. if !(((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) && (tr_tm != TK_INSTEAD)) { - goto __20 + goto __19 } - Xsqlite3ErrorMsg(tls, pParse, ts+17532, /* "cannot create %s..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+17952, /* "cannot create %s..." */ libc.VaList(bp+8, func() uintptr { if tr_tm == TK_BEFORE { - return ts + 17569 /* "BEFORE" */ + return ts + 17989 /* "BEFORE" */ } - return ts + 17576 /* "AFTER" */ + return ts + 17996 /* "AFTER" */ }(), pTableName, 0)) - goto trigger_cleanup -__20: + goto trigger_orphan_error +__19: ; if !(!(int32((*Table)(unsafe.Pointer(pTab)).FpSelect) != 0) && (tr_tm == TK_INSTEAD)) { - goto __21 + goto __20 } Xsqlite3ErrorMsg(tls, pParse, - ts+17582 /* "cannot create IN..." */, libc.VaList(bp+32, pTableName, 0)) - goto trigger_cleanup -__21: + ts+18002 /* "cannot create IN..." */, libc.VaList(bp+32, pTableName, 0)) + goto trigger_orphan_error +__20: ; if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME)) { - goto __22 + goto __21 } iTabDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) code = SQLITE_CREATE_TRIGGER @@ -117249,29 +118914,29 @@ __21: zDbTrig = zDb } if !((iTabDb == 1) || (isTemp != 0)) { - goto __23 + goto __22 } code = SQLITE_CREATE_TEMP_TRIGGER -__23: +__22: ; if !(Xsqlite3AuthCheck(tls, pParse, code, zName, (*Table)(unsafe.Pointer(pTab)).FzName, zDbTrig) != 0) { + goto __23 + } + goto trigger_cleanup +__23: + ; + if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr { + if (!(0 != 0)) && (iTabDb == 1) { + return ts + 10411 /* "sqlite_temp_mast..." */ + } + return ts + 4825 /* "sqlite_master" */ + }(), uintptr(0), zDb) != 0) { goto __24 } goto trigger_cleanup __24: ; - if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr { - if (!(0 != 0)) && (iTabDb == 1) { - return ts + 10046 /* "sqlite_temp_mast..." */ - } - return ts + 4780 /* "sqlite_master" */ - }(), uintptr(0), zDb) != 0) { - goto __25 - } - goto trigger_cleanup -__25: - ; -__22: +__21: ; // INSTEAD OF triggers can only appear on views and BEFORE triggers @@ -117279,42 +118944,42 @@ __22: // INSTEAD OF trigger into a BEFORE trigger. It simplifies code // elsewhere. if !(tr_tm == TK_INSTEAD) { - goto __26 + goto __25 } tr_tm = TK_BEFORE -__26: +__25: ; // Build the Trigger object pTrigger = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Trigger{}))) if !(pTrigger == uintptr(0)) { - goto __27 + goto __26 } goto trigger_cleanup -__27: +__26: ; (*Trigger)(unsafe.Pointer(pTrigger)).FzName = zName zName = uintptr(0) - (*Trigger)(unsafe.Pointer(pTrigger)).Ftable = Xsqlite3DbStrDup(tls, db, (*SrcList_item)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzName) + (*Trigger)(unsafe.Pointer(pTrigger)).Ftable = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzName) (*Trigger)(unsafe.Pointer(pTrigger)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema (*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema (*Trigger)(unsafe.Pointer(pTrigger)).Fop = U8(op) (*Trigger)(unsafe.Pointer(pTrigger)).Ftr_tm = func() uint8 { if tr_tm == TK_BEFORE { - return TRIGGER_BEFORE + return uint8(TRIGGER_BEFORE) } - return TRIGGER_AFTER + return uint8(TRIGGER_AFTER) }() if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { - goto __28 + goto __27 } - Xsqlite3RenameTokenRemap(tls, pParse, (*Trigger)(unsafe.Pointer(pTrigger)).Ftable, (*SrcList_item)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzName) + Xsqlite3RenameTokenRemap(tls, pParse, (*Trigger)(unsafe.Pointer(pTrigger)).Ftable, (*SrcItem)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzName) (*Trigger)(unsafe.Pointer(pTrigger)).FpWhen = pWhen pWhen = uintptr(0) - goto __29 -__28: + goto __28 +__27: (*Trigger)(unsafe.Pointer(pTrigger)).FpWhen = Xsqlite3ExprDup(tls, db, pWhen, EXPRDUP_REDUCE) -__29: +__28: ; (*Trigger)(unsafe.Pointer(pTrigger)).FpColumns = pColumns pColumns = uintptr(0) @@ -117327,25 +118992,45 @@ trigger_cleanup: Xsqlite3IdListDelete(tls, db, pColumns) Xsqlite3ExprDelete(tls, db, pWhen) if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FpNewTrigger) != 0)) { - goto __30 + goto __29 } Xsqlite3DeleteTrigger(tls, db, pTrigger) - goto __31 + goto __30 +__29: + ; __30: ; + return + +trigger_orphan_error: + if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) == 1) { + goto __31 + } + // Ticket #3810. + // Normally, whenever a table is dropped, all associated triggers are + // dropped too. But if a TEMP trigger is created on a non-TEMP table + // and the table is dropped by a different database connection, the + // trigger is not visible to the database connection that does the + // drop so the trigger cannot be dropped. This results in an + // "orphaned trigger" - a trigger whose associated table is missing. + // + // 2020-11-05 see also https://sqlite.org/forum/forumpost/157dc791df + libc.SetBitFieldPtr8Uint32(db+184 /* &.init */ +8 /* &.orphanTrigger */, uint32(1), 0, 0x1) __31: + ; + goto trigger_cleanup } // This routine is called after all of the trigger actions have been parsed // in order to complete the process of building the trigger. -func Xsqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAll uintptr) { /* sqlite3.c:136674:21: */ - bp := tls.Alloc(104) - defer tls.Free(104) +func Xsqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAll uintptr) { /* sqlite3.c:138732:21: */ + bp := tls.Alloc(152) + defer tls.Free(152) var pTrig uintptr // Trigger being finished var zName uintptr // Name of trigger var db uintptr // The database - // var sFix DbFixer at bp+56, 48 + // var sFix DbFixer at bp+56, 96 // Fixer object var iDb int32 // Database containing the trigger // var nameToken Token at bp+40, 16 @@ -117378,7 +119063,7 @@ __2: __3: ; Xsqlite3TokenInit(tls, bp+40 /* &nameToken */, (*Trigger)(unsafe.Pointer(pTrig)).FzName) - Xsqlite3FixInit(tls, bp+56 /* &sFix */, pParse, iDb, ts+17419 /* "trigger" */, bp+40 /* &nameToken */) + Xsqlite3FixInit(tls, bp+56 /* &sFix */, pParse, iDb, ts+17839 /* "trigger" */, bp+40 /* &nameToken */) if !((Xsqlite3FixTriggerStep(tls, bp+56 /* &sFix */, (*Trigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0) || (Xsqlite3FixExpr(tls, bp+56 /* &sFix */, (*Trigger)(unsafe.Pointer(pTrig)).FpWhen) != 0)) { goto __4 @@ -117415,13 +119100,13 @@ __8: Xsqlite3NestedParse(tls, pParse, - ts+17628, /* "INSERT INTO %Q.s..." */ + ts+18048, /* "INSERT INTO %Q.s..." */ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zName, (*Trigger)(unsafe.Pointer(pTrig)).Ftable, z)) Xsqlite3DbFree(tls, db, z) Xsqlite3ChangeCookie(tls, pParse, iDb) Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb, - Xsqlite3MPrintf(tls, db, ts+17703 /* "type='trigger' A..." */, libc.VaList(bp+32, zName))) + Xsqlite3MPrintf(tls, db, ts+18123 /* "type='trigger' A..." */, libc.VaList(bp+32, zName)), uint16(0)) __7: ; __6: @@ -117462,7 +119147,7 @@ triggerfinish_cleanup: // Duplicate a range of text from an SQL statement, then convert all // whitespace characters into ordinary space characters. -func triggerSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136762:13: */ +func triggerSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:138820:13: */ var z uintptr = Xsqlite3DbSpanDup(tls, db, zStart, zEnd) var i int32 if z != 0 { @@ -117480,15 +119165,15 @@ func triggerSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uin // // The parser calls this routine when it finds a SELECT statement in // body of a TRIGGER. -func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136776:28: */ +func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:138834:28: */ var pTriggerStep uintptr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(TriggerStep{}))) if pTriggerStep == uintptr(0) { Xsqlite3SelectDelete(tls, db, pSelect) return uintptr(0) } - (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Fop = TK_SELECT + (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Fop = U8(TK_SELECT) (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpSelect = pSelect - (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = OE_Default + (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = U8(OE_Default) (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FzSpan = triggerSpanDup(tls, db, zStart, zEnd) return pTriggerStep } @@ -117497,7 +119182,7 @@ func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStar // 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 *libc.TLS, pParse uintptr, op U8, pName uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136800:20: */ +func triggerStepAllocate(tls *libc.TLS, pParse uintptr, op U8, pName uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:138858:20: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr @@ -117521,11 +119206,11 @@ func triggerStepAllocate(tls *libc.TLS, pParse uintptr, op U8, pName uintptr, zS // // The parser calls this routine when it sees an INSERT inside the // body of a trigger. -func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pColumn uintptr, pSelect uintptr, orconf U8, pUpsert uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136832:28: */ +func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pColumn uintptr, pSelect uintptr, orconf U8, pUpsert uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:138890:28: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr - pTriggerStep = triggerStepAllocate(tls, pParse, TK_INSERT, pTableName, zStart, zEnd) + pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_INSERT), pTableName, zStart, zEnd) if pTriggerStep != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpSelect = pSelect @@ -117553,11 +119238,11 @@ func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr // 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 Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pFrom uintptr, pEList uintptr, pWhere uintptr, orconf U8, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136877:28: */ +func Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pFrom uintptr, pEList uintptr, pWhere uintptr, orconf U8, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:138935:28: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr - pTriggerStep = triggerStepAllocate(tls, pParse, TK_UPDATE, pTableName, zStart, zEnd) + pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_UPDATE), pTableName, zStart, zEnd) if pTriggerStep != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpExprList = pEList @@ -117582,11 +119267,11 @@ func Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr // 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 Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pWhere uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136917:28: */ +func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pWhere uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:138975:28: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr - pTriggerStep = triggerStepAllocate(tls, pParse, TK_DELETE, pTableName, zStart, zEnd) + pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_DELETE), pTableName, zStart, zEnd) if pTriggerStep != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = pWhere @@ -117594,15 +119279,15 @@ func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr } else { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = Xsqlite3ExprDup(tls, db, pWhere, EXPRDUP_REDUCE) } - (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = OE_Default + (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = U8(OE_Default) } Xsqlite3ExprDelete(tls, db, pWhere) return pTriggerStep } // Recursively delete a Trigger structure -func Xsqlite3DeleteTrigger(tls *libc.TLS, db uintptr, pTrigger uintptr) { /* sqlite3.c:136944:21: */ - if pTrigger == uintptr(0) { +func Xsqlite3DeleteTrigger(tls *libc.TLS, db uintptr, pTrigger uintptr) { /* sqlite3.c:139002:21: */ + if (pTrigger == uintptr(0)) || ((*Trigger)(unsafe.Pointer(pTrigger)).FbReturning != 0) { return } Xsqlite3DeleteTriggerStep(tls, db, (*Trigger)(unsafe.Pointer(pTrigger)).Fstep_list) @@ -117621,7 +119306,7 @@ func Xsqlite3DeleteTrigger(tls *libc.TLS, db uintptr, pTrigger uintptr) { /* sql // same job as this routine except it takes a pointer to the trigger // instead of the trigger name. // -func Xsqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int32) { /* sqlite3.c:136962:21: */ +func Xsqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int32) { /* sqlite3.c:139020:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -117647,8 +119332,8 @@ __1: __2: ; - zDb = (*SrcList_item)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase - zName = (*SrcList_item)(unsafe.Pointer((pName + 8 /* &.a */))).FzName + zDb = (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase + zName = (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzName i = OMIT_TEMPDB __3: @@ -117687,7 +119372,7 @@ __5: if !(!(noErr != 0)) { goto __9 } - Xsqlite3ErrorMsg(tls, pParse, ts+17732 /* "no such trigger:..." */, libc.VaList(bp, pName, 0)) + Xsqlite3ErrorMsg(tls, pParse, ts+18152 /* "no such trigger:..." */, libc.VaList(bp, pName, 0)) goto __10 __9: Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb) @@ -117705,12 +119390,12 @@ drop_trigger_cleanup: // Return a pointer to the Table structure for the table that a trigger // is set on. -func tableOfTrigger(tls *libc.TLS, pTrigger uintptr) uintptr { /* sqlite3.c:137004:14: */ +func tableOfTrigger(tls *libc.TLS, pTrigger uintptr) uintptr { /* sqlite3.c:139062:14: */ return Xsqlite3HashFind(tls, ((*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema + 8 /* &.tblHash */), (*Trigger)(unsafe.Pointer(pTrigger)).Ftable) } // Drop a trigger given a pointer to that trigger. -func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { /* sqlite3.c:137012:21: */ +func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { /* sqlite3.c:139070:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -117728,9 +119413,9 @@ func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { / var zDb uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName var zTab uintptr = func() uintptr { if (!(0 != 0)) && (iDb == 1) { - return ts + 10046 /* "sqlite_temp_mast..." */ + return ts + 10411 /* "sqlite_temp_mast..." */ } - return ts + 4780 /* "sqlite_master" */ + return ts + 4825 /* "sqlite_master" */ }() if iDb == 1 { code = SQLITE_DROP_TEMP_TRIGGER @@ -117743,7 +119428,7 @@ func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { / // Generate code to destroy the database record of the trigger. if (libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse))) != uintptr(0) { Xsqlite3NestedParse(tls, pParse, - ts+17752, /* "DELETE FROM %Q.s..." */ + ts+18172, /* "DELETE FROM %Q.s..." */ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Trigger)(unsafe.Pointer(pTrigger)).FzName)) Xsqlite3ChangeCookie(tls, pParse, iDb) Xsqlite3VdbeAddOp4(tls, v, OP_DropTrigger, iDb, 0, 0, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, 0) @@ -117751,7 +119436,7 @@ func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { / } // Remove a trigger from the hash tables of the sqlite* pointer. -func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) { /* sqlite3.c:137050:21: */ +func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) { /* sqlite3.c:139108:21: */ var pTrigger uintptr var pHash uintptr @@ -117771,7 +119456,7 @@ func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName } } Xsqlite3DeleteTrigger(tls, db, pTrigger) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) } } @@ -117782,7 +119467,7 @@ func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName // 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 *libc.TLS, pIdList uintptr, pEList uintptr) int32 { /* sqlite3.c:137084:12: */ +func checkColumnOverlap(tls *libc.TLS, pIdList uintptr, pEList uintptr) int32 { /* sqlite3.c:139142:12: */ var e int32 if (pIdList == uintptr(0)) || (pEList == uintptr(0)) { return 1 @@ -117799,23 +119484,117 @@ func checkColumnOverlap(tls *libc.TLS, pIdList uintptr, pEList uintptr) int32 { // 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 Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, pChanges uintptr, pMask uintptr) uintptr { /* sqlite3.c:137099:24: */ - var mask int32 = 0 - var pList uintptr = uintptr(0) +func Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, pChanges uintptr, pMask uintptr) uintptr { /* sqlite3.c:139157:24: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + var mask int32 + var pList uintptr var p uintptr + mask = 0 + pList = uintptr(0) - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_EnableTrigger) != uint64(0) { - pList = Xsqlite3TriggerList(tls, pParse, pTab) - } + pList = Xsqlite3TriggerList(tls, pParse, pTab) - for p = pList; p != 0; p = (*Trigger)(unsafe.Pointer(p)).FpNext { - if (int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) && (checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0) { - mask = mask | (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)) - } + if !(pList != uintptr(0)) { + goto __1 } - if pMask != 0 { - *(*int32)(unsafe.Pointer(pMask)) = mask + p = pList + if !((((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_EnableTrigger)) == uint64(0)) && + ((*Table)(unsafe.Pointer(pTab)).FpTrigger != uintptr(0))) { + goto __2 } + // The SQLITE_DBCONFIG_ENABLE_TRIGGER setting is off. That means that + // only TEMP triggers are allowed. Truncate the pList so that it + // includes only TEMP triggers + if !(pList == (*Table)(unsafe.Pointer(pTab)).FpTrigger) { + goto __3 + } + pList = uintptr(0) + goto exit_triggers_exist +__3: + ; +__4: + if !(((*Trigger)(unsafe.Pointer(p)).FpNext != 0) && ((*Trigger)(unsafe.Pointer(p)).FpNext != (*Table)(unsafe.Pointer(pTab)).FpTrigger)) { + goto __5 + } + p = (*Trigger)(unsafe.Pointer(p)).FpNext + goto __4 +__5: + ; + (*Trigger)(unsafe.Pointer(p)).FpNext = uintptr(0) + p = pList +__2: + ; +__6: + if !((int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) && (checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0)) { + goto __9 + } + mask = mask | (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)) + goto __10 +__9: + if !(int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_RETURNING) { + goto __11 + } + // The first time a RETURNING trigger is seen, the "op" value tells + // us what time of trigger it should be. + + (*Trigger)(unsafe.Pointer(p)).Fop = U8(op) + if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { + goto __13 + } + if !(op != TK_INSERT) { + goto __15 + } + Xsqlite3ErrorMsg(tls, pParse, + ts+18234, /* "%s RETURNING is ..." */ + libc.VaList(bp, func() uintptr { + if op == TK_DELETE { + return ts + 18282 /* "DELETE" */ + } + return ts + 18289 /* "UPDATE" */ + }())) +__15: + ; + (*Trigger)(unsafe.Pointer(p)).Ftr_tm = U8(TRIGGER_BEFORE) + goto __14 +__13: + (*Trigger)(unsafe.Pointer(p)).Ftr_tm = U8(TRIGGER_AFTER) +__14: + ; + mask = mask | (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)) + goto __12 +__11: + if !(((((*Trigger)(unsafe.Pointer(p)).FbReturning != 0) && (int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_INSERT)) && (op == TK_UPDATE)) && + ((*Parse)(unsafe.Pointer((pParse))).FpToplevel == uintptr(0))) { + goto __16 + } + // Also fire a RETURNING trigger for an UPSERT + mask = mask | (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)) +__16: + ; +__12: + ; +__10: + ; + p = (*Trigger)(unsafe.Pointer(p)).FpNext + goto __7 +__7: + if p != 0 { + goto __6 + } + goto __8 +__8: + ; +__1: + ; +exit_triggers_exist: + if !(pMask != 0) { + goto __17 + } + *(*int32)(unsafe.Pointer(pMask)) = mask +__17: + ; return func() uintptr { if mask != 0 { return pList @@ -117832,7 +119611,7 @@ func Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32 // 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 Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintptr { /* sqlite3.c:137135:24: */ +func Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintptr { /* sqlite3.c:139231:24: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pSrc uintptr // SrcList to be returned var zName uintptr = Xsqlite3DbStrDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget) @@ -117840,9 +119619,9 @@ func Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintpt if pSrc != 0 { var pSchema uintptr = (*Trigger)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpTrig)).FpSchema - (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FzName = zName + (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FzName = zName if pSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema { - (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpSchema = pSchema + (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpSchema = pSchema } if (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 { var pDup uintptr = Xsqlite3SrcListDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom, 0) @@ -117854,9 +119633,104 @@ func Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintpt return pSrc } +// The input list pList is the list of result set terms from a RETURNING +// clause. The table that we are returning from is pTab. +// +// This routine makes a copy of the pList, and at the same time expands +// any "*" wildcards to be the complete set of columns from pTab. +func sqlite3ExpandReturning(tls *libc.TLS, pParse uintptr, pList uintptr, pTab uintptr) uintptr { /* sqlite3.c:139263:17: */ + var pNew uintptr = uintptr(0) + var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb + var i int32 + + for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ { + var pOldExpr uintptr = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32)).FpExpr + if (pOldExpr != uintptr(0)) && (int32((*Expr)(unsafe.Pointer(pOldExpr)).Fop) == TK_ASTERISK) { + var jj int32 + for jj = 0; jj < int32((*Table)(unsafe.Pointer(pTab)).FnCol); jj++ { + var pNewExpr uintptr + if (int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(jj)*32))).FcolFlags) & COLFLAG_HIDDEN) != 0 { + continue + } + pNewExpr = Xsqlite3Expr(tls, db, TK_ID, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*32)).FzName) + pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pNewExpr) + if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { + var pItem uintptr = ((pNew + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*32) + (*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrDup(tls, db, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*32)).FzName) + libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, uint32(ENAME_NAME), 0, 0x3) + } + } + } else { + var pNewExpr uintptr = Xsqlite3ExprDup(tls, db, pOldExpr, 0) + pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pNewExpr) + if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) && ((*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*32)).FzEName != uintptr(0)) { + var pItem uintptr = ((pNew + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*32) + (*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*32)).FzEName) + libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, (uint32(int32(*(*uint8)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32 + 20 /* &.eEName */)) & 0x3 >> 0))), 0, 0x3) + } + } + } + if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { + var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe + + Xsqlite3VdbeSetNumCols(tls, v, (*ExprList)(unsafe.Pointer(pNew)).FnExpr) + for i = 0; i < (*ExprList)(unsafe.Pointer(pNew)).FnExpr; i++ { + Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, (*ExprList_item)(unsafe.Pointer((pNew+8 /* &.a */)+uintptr(i)*32)).FzEName, + libc.UintptrFromInt32(-1)) + } + } + return pNew +} + +// Generate code for the RETURNING trigger. Unlike other triggers +// that invoke a subprogram in the bytecode, the code for RETURNING +// is generated in-line. +func codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { /* sqlite3.c:139314:13: */ + bp := tls.Alloc(56) + defer tls.Free(56) + + var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe + var pNew uintptr + var pReturning uintptr + + pReturning = *(*uintptr)(unsafe.Pointer(pParse + 184 /* &.u1 */)) + + pNew = sqlite3ExpandReturning(tls, pParse, (*Returning)(unsafe.Pointer(pReturning)).FpReturnEL, pTab) + if pNew != 0 { + // var sNC NameContext at bp, 56 + + libc.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) + if (*Returning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { + (*Returning)(unsafe.Pointer(pReturning)).FnRetCol = (*ExprList)(unsafe.Pointer(pNew)).FnExpr + (*Returning)(unsafe.Pointer(pReturning)).FiRetCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + } + (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = pParse + *(*int32)(unsafe.Pointer(bp /* &sNC */ + 16 /* &.uNC */)) = regIn + (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags = NC_UBaseReg + (*Parse)(unsafe.Pointer(pParse)).FeTriggerOp = (*Trigger)(unsafe.Pointer(pTrigger)).Fop + (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab = pTab + if Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, pNew) == SQLITE_OK { + var i int32 + var nCol int32 = (*ExprList)(unsafe.Pointer(pNew)).FnExpr + var reg int32 = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1) + *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (nCol + 2) + (*Returning)(unsafe.Pointer(pReturning)).FiRetReg = reg + for i = 0; i < nCol; i++ { + Xsqlite3ExprCodeFactorable(tls, pParse, (*ExprList_item)(unsafe.Pointer((pNew+8 /* &.a */)+uintptr(i)*32)).FpExpr, (reg + i)) + } + Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, reg, i, (reg + i)) + Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, ((reg + i) + 1)) + Xsqlite3VdbeAddOp3(tls, v, OP_Insert, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, (reg + i), ((reg + i) + 1)) + } + Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pNew) + (*Parse)(unsafe.Pointer(pParse)).FeTriggerOp = U8(0) + (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab = uintptr(0) + } +} + // Generate VDBE code for the statements inside the body of a single // trigger. -func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf int32) int32 { /* sqlite3.c:137165:12: */ +func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf int32) int32 { /* sqlite3.c:139366:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -117886,7 +119760,7 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf if (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { Xsqlite3VdbeAddOp4(tls, v, OP_Trace, 0x7fffffff, 1, 0, - Xsqlite3MPrintf(tls, db, ts+4967 /* "-- %s" */, libc.VaList(bp, (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan)), + Xsqlite3MPrintf(tls, db, ts+5012 /* "-- %s" */, libc.VaList(bp, (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -7) } @@ -117898,6 +119772,7 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf Xsqlite3ExprListDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList, 0), Xsqlite3ExprDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere, 0), int32((*Parse)(unsafe.Pointer(pParse)).FeOrconf), uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3VdbeAddOp0(tls, v, OP_ResetCount) break } @@ -117909,6 +119784,7 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf Xsqlite3IdListDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpIdList), int32((*Parse)(unsafe.Pointer(pParse)).FeOrconf), Xsqlite3UpsertDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert)) + Xsqlite3VdbeAddOp0(tls, v, OP_ResetCount) break } @@ -117917,6 +119793,7 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf Xsqlite3DeleteFrom(tls, pParse, Xsqlite3TriggerStepSrc(tls, pParse, pStep), Xsqlite3ExprDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere, 0), uintptr(0), uintptr(0)) + Xsqlite3VdbeAddOp0(tls, v, OP_ResetCount) break } @@ -117932,9 +119809,6 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf } } - if int32((*TriggerStep)(unsafe.Pointer(pStep)).Fop) != TK_SELECT { - Xsqlite3VdbeAddOp0(tls, v, OP_ResetCount) - } } return 0 @@ -117943,7 +119817,7 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf // 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 *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:137269:13: */ +func transferParseError(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:139470:13: */ if (*Parse)(unsafe.Pointer(pTo)).FnErr == 0 { (*Parse)(unsafe.Pointer(pTo)).FzErrMsg = (*Parse)(unsafe.Pointer(pFrom)).FzErrMsg @@ -117956,7 +119830,7 @@ func transferParseError(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3. // Create and populate a new TriggerPrg object with a sub-program // implementing trigger pTrigger with ON CONFLICT policy orconf. -func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:137285:19: */ +func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:139486:19: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -118016,7 +119890,7 @@ func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintpt if (*Trigger)(unsafe.Pointer(pTrigger)).FzName != 0 { Xsqlite3VdbeChangeP4(tls, v, -1, - Xsqlite3MPrintf(tls, db, ts+17814 /* "-- TRIGGER %s" */, libc.VaList(bp, (*Trigger)(unsafe.Pointer(pTrigger)).FzName)), -7) + Xsqlite3MPrintf(tls, db, ts+18296 /* "-- TRIGGER %s" */, libc.VaList(bp, (*Trigger)(unsafe.Pointer(pTrigger)).FzName)), -7) } // If one was specified, code the WHEN clause. If it evaluates to false @@ -118063,7 +119937,7 @@ func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintpt // 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 *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:137401:19: */ +func getRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:139601:19: */ var pRoot uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -118091,7 +119965,7 @@ func getRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr // 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 Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:137435:21: */ +func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:139635:21: */ var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Main VM var pPrg uintptr pPrg = getRowTrigger(tls, pParse, p, pTab, orconf) @@ -118099,7 +119973,7 @@ func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab // Code the OP_Program opcode in the parent VDBE. P4 of the OP_Program // is a pointer to the sub-vdbe containing the trigger program. if pPrg != 0 { - var bRecursive int32 = (libc.Bool32(((*Trigger)(unsafe.Pointer(p)).FzName != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_RecTriggers)))) + var bRecursive int32 = (libc.Bool32(((*Trigger)(unsafe.Pointer(p)).FzName != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_RecTriggers))))) Xsqlite3VdbeAddOp4(tls, v, OP_Program, reg, ignoreJump, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1), (*TriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -4) @@ -118134,7 +120008,7 @@ func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, 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+2 NEW.* value of left-most column of pTab // ... ... // reg+N+N+1 NEW.* value of right-most column of pTab // @@ -118151,7 +120025,7 @@ func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab // 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 Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op int32, pChanges uintptr, tr_tm int32, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:137507:21: */ +func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op int32, pChanges uintptr, tr_tm int32, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:139707:21: */ var p uintptr // Used to iterate through pTrigger list for p = pTrigger; p != 0; p = (*Trigger)(unsafe.Pointer(p)).FpNext { @@ -118160,11 +120034,18 @@ func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op // always defined. The trigger must be in the same schema as the table // or else it must be a TEMP trigger. - // Determine whether we should code this trigger - if ((int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) && + // Determine whether we should code this trigger. One of two choices: + // 1. The trigger is an exact match to the current DML statement + // 2. This is a RETURNING trigger for INSERT but we are currently + // doing the UPDATE part of an UPSERT. + if (((int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) || ((((*Trigger)(unsafe.Pointer(p)).FbReturning != 0) && (int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_INSERT)) && (op == TK_UPDATE))) && (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm) == tr_tm)) && (checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0) { - Xsqlite3CodeRowTriggerDirect(tls, pParse, p, pTab, reg, orconf, ignoreJump) + if !(int32((*Trigger)(unsafe.Pointer(p)).FbReturning) != 0) { + Xsqlite3CodeRowTriggerDirect(tls, pParse, p, pTab, reg, orconf, ignoreJump) + } else if (*Parse)(unsafe.Pointer((pParse))).FpToplevel == uintptr(0) { + codeReturningTrigger(tls, pParse, p, pTab, reg) + } } } } @@ -118192,7 +120073,7 @@ func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op // 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 Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pChanges uintptr, isNew int32, tr_tm int32, pTab uintptr, orconf int32) U32 { /* sqlite3.c:137569:20: */ +func Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pChanges uintptr, isNew int32, tr_tm int32, pTab uintptr, orconf int32) U32 { /* sqlite3.c:139777:20: */ var op int32 if pChanges != 0 { op = TK_UPDATE @@ -118203,12 +120084,17 @@ func Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pCh var p uintptr for p = pTrigger; p != 0; p = (*Trigger)(unsafe.Pointer(p)).FpNext { - if ((int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) && ((tr_tm & int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)) != 0)) && + if ((int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) && + ((tr_tm & int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)) != 0)) && (checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0) { - var pPrg uintptr - pPrg = getRowTrigger(tls, pParse, p, pTab, orconf) - if pPrg != 0 { - mask = mask | (*(*U32)(unsafe.Pointer((pPrg + 28 /* &.aColmask */) + uintptr(isNew)*4))) + if (*Trigger)(unsafe.Pointer(p)).FbReturning != 0 { + mask = 0xffffffff + } else { + var pPrg uintptr + pPrg = getRowTrigger(tls, pParse, p, pTab, orconf) + if pPrg != 0 { + mask = mask | (*(*U32)(unsafe.Pointer((pPrg + 28 /* &.aColmask */) + uintptr(isNew)*4))) + } } } } @@ -118244,7 +120130,7 @@ func Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pCh // (not a virtual table) then the value might have been stored as an // integer. In that case, add an OP_RealAffinity opcode to make sure // it has been converted into REAL. -func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg int32) { /* sqlite3.c:137662:21: */ +func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg int32) { /* sqlite3.c:139875:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -118273,7 +120159,7 @@ func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg // aXRef[j] will be non-negative if column j of the original table is // being updated. chngRowid will be true if the rowid of the table is // being updated. -func indexColumnIsBeingUpdated(tls *libc.TLS, pIdx uintptr, iCol int32, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:137694:12: */ +func indexColumnIsBeingUpdated(tls *libc.TLS, pIdx uintptr, iCol int32, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:139907:12: */ var iIdxCol I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2)) // Cannot index rowid if int32(iIdxCol) >= 0 { @@ -118294,7 +120180,7 @@ func indexColumnIsBeingUpdated(tls *libc.TLS, pIdx uintptr, iCol int32, aXRef ui // aXRef[j] will be non-negative if column j of the original table is // being updated. chngRowid will be true if the rowid of the table is // being updated. -func indexWhereClauseMightChange(tls *libc.TLS, pIdx uintptr, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:137724:12: */ +func indexWhereClauseMightChange(tls *libc.TLS, pIdx uintptr, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:139937:12: */ if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) { return 0 } @@ -118306,7 +120192,7 @@ func indexWhereClauseMightChange(tls *libc.TLS, pIdx uintptr, aXRef uintptr, chn // Expr.iColumn set to value (iCol+1). The resolver will modify the // expression to be a TK_COLUMN reading column iCol of the first // table in the source-list (pSrc->a[0]). -func exprRowColumn(tls *libc.TLS, pParse uintptr, iCol int32) uintptr { /* sqlite3.c:137740:13: */ +func exprRowColumn(tls *libc.TLS, pParse uintptr, iCol int32) uintptr { /* sqlite3.c:139953:13: */ var pRet uintptr = Xsqlite3PExpr(tls, pParse, TK_ROW, uintptr(0), uintptr(0)) if pRet != 0 { (*Expr)(unsafe.Pointer(pRet)).FiColumn = (YnVar(iCol + 1)) @@ -118350,7 +120236,7 @@ func exprRowColumn(tls *libc.TLS, pParse uintptr, iCol int32) uintptr { /* sqlit // records with automatically assigned integer keys For intkey tables, the // rowid value in is used as the integer key, and the // remaining fields make up the table record. -func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pChanges uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:137784:13: */ +func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pChanges uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:139997:13: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -118363,7 +120249,7 @@ func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pC var pLimit2 uintptr = uintptr(0) var pOrderBy2 uintptr = uintptr(0) var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - var pTab uintptr = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab + var pTab uintptr = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab var pSrc uintptr var pWhere2 uintptr var eDest int32 @@ -118375,16 +120261,20 @@ func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pC pWhere2 = Xsqlite3ExprDup(tls, db, pWhere, 0) if pSrc != 0 { - (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor = -1 - (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab)).FnTabRef-- - (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab = uintptr(0) + (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor = -1 + (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab)).FnTabRef-- + (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab = uintptr(0) } if pPk != 0 { for i = 0; i < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); i++ { var pNew uintptr = exprRowColumn(tls, pParse, int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) pList = Xsqlite3ExprListAppend(tls, pParse, pList, pNew) } - eDest = SRT_Upfrom + if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { + eDest = SRT_Table + } else { + eDest = SRT_Upfrom + } } else if (*Table)(unsafe.Pointer(pTab)).FpSelect != 0 { for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ { pList = Xsqlite3ExprListAppend(tls, pParse, pList, exprRowColumn(tls, pParse, i)) @@ -118424,7 +120314,7 @@ func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pC // onError | pChanges | pWhere // \_______________________/ // pTabList -func Xsqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { /* sqlite3.c:137878:21: */ +func Xsqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { /* sqlite3.c:140091:21: */ bp := tls.Alloc(108) defer tls.Free(108) @@ -118574,7 +120464,7 @@ __4: // allocate enough space, just in case. iBaseCur = libc.AssignInt32(&iDataCur, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)) iIdxCur = (iDataCur + 1) - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk = uintptr(0) } else { pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) @@ -118610,7 +120500,7 @@ __7: (*Parse)(unsafe.Pointer(pParse)).FnTab = iBaseCur __9: ; - (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor = iDataCur + (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor = iDataCur // Allocate space for aXRef[], aRegIdx[], and aToOpen[]. // Initialize aXRef[] and aToOpen[] to their default values. @@ -118701,7 +120591,7 @@ __25: } Xsqlite3ErrorMsg(tls, pParse, - ts+17828, /* "cannot UPDATE ge..." */ + ts+18310, /* "cannot UPDATE ge..." */ libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*32)).FzName)) goto update_cleanup __27: @@ -118733,7 +120623,7 @@ __21: iRowidExpr = i goto __30 __29: - Xsqlite3ErrorMsg(tls, pParse, ts+17864 /* "no such column: ..." */, libc.VaList(bp+8, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*32)).FzEName)) + Xsqlite3ErrorMsg(tls, pParse, ts+18346 /* "no such column: ..." */, libc.VaList(bp+8, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*32)).FzEName)) (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) goto update_cleanup __30: @@ -118744,7 +120634,7 @@ __28: rc = Xsqlite3AuthCheck(tls, pParse, SQLITE_UPDATE, (*Table)(unsafe.Pointer(pTab)).FzName, func() uintptr { if j < 0 { - return ts + 6512 /* "ROWID" */ + return ts + 6557 /* "ROWID" */ } return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*32)).FzName }(), @@ -118780,7 +120670,7 @@ __17: // is non-negative, so the value of aXRef[] for generated columns can be // set to any non-negative number. We use 99999 so that the value is // obvious when looking at aXRef[] in a symbolic debugger. - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { goto __34 } @@ -118833,7 +120723,7 @@ __34: // So reset the colUsed mask. Unless this is a virtual table. In that // case, set all bits of the colUsed mask (to ensure that the virtual // table implementation makes all columns available). - (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FcolUsed = func() uint64 { + (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FcolUsed = func() uint64 { if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { return libc.Uint64(libc.Uint64FromInt32(-1)) } @@ -119001,9 +120891,10 @@ __64: // Not an UPSERT. Normal processing. Begin by // initialize the count of updated rows - if !((((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) && + if !(((((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) && + !(int32((*Parse)(unsafe.Pointer(pParse)).FbReturning) != 0)) && (pUpsert == uintptr(0))) { goto __65 } @@ -119012,10 +120903,12 @@ __64: __65: ; - if !((nChangeFrom == 0) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !((nChangeFrom == 0) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __66 } Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, regRowSet, regOldRowid) + iEph = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + addrOpen = Xsqlite3VdbeAddOp3(tls, v, OP_OpenEphemeral, iEph, 0, regRowSet) goto __67 __66: ; @@ -119105,7 +120998,7 @@ __76: // be deleted as a result of REPLACE conflict handling. Any of these // things might disturb a cursor being used to scan through the table // or index, causing a single-pass approach to malfunction. - flags = (WHERE_ONEPASS_DESIRED | WHERE_SEEK_UNIQ_TABLE) + flags = WHERE_ONEPASS_DESIRED if !((((!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) && !(pTrigger != 0)) && !(hasFK != 0)) && !(chngKey != 0)) && !(*(*int32)(unsafe.Pointer(bp + 104 /* bReplace */)) != 0)) { goto __78 } @@ -119154,7 +121047,7 @@ __80: __77: ; - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __83 } // Read the rowid of the current row of the WHERE scan. In ONEPASS_OFF @@ -119164,10 +121057,17 @@ __77: if !(eOnePass == ONEPASS_OFF) { goto __85 } - // We need to use regRowSet, so reallocate aRegIdx[nAllIdx] *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) - Xsqlite3VdbeAddOp2(tls, v, OP_RowSetAdd, regRowSet, regOldRowid) + Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iEph, regRowSet, regOldRowid) + goto __86 __85: + if !(addrOpen != 0) { + goto __87 + } + Xsqlite3VdbeChangeToNoop(tls, v, addrOpen) +__87: + ; +__86: ; goto __84 __83: @@ -119177,37 +121077,37 @@ __83: // the OP_OpenEphemeral instruction to a Noop (the ephemeral table // is not required) and leave the PK fields in the array of registers. i = 0 -__86: +__88: if !(i < int32(nPk)) { - goto __88 + goto __90 } Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), (iPk + i)) - goto __87 -__87: + goto __89 +__89: i++ - goto __86 goto __88 -__88: + goto __90 +__90: ; if !(eOnePass != 0) { - goto __89 - } - if !(addrOpen != 0) { goto __91 } + if !(addrOpen != 0) { + goto __93 + } Xsqlite3VdbeChangeToNoop(tls, v, addrOpen) -__91: +__93: ; nKey = int32(nPk) regKey = iPk - goto __90 -__89: + goto __92 +__91: Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, iPk, int32(nPk), regKey, Xsqlite3IndexAffinityStr(tls, db, pPk), int32(nPk)) Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iEph, regKey, iPk, int32(nPk)) -__90: +__92: ; __84: ; @@ -119215,73 +121115,73 @@ __75: ; if !(pUpsert == uintptr(0)) { - goto __92 + goto __94 } if !((nChangeFrom == 0) && (eOnePass != ONEPASS_MULTI)) { - goto __93 + goto __95 } Xsqlite3WhereEnd(tls, pWInfo) -__93: +__95: ; if !(!(isView != 0)) { - goto __94 + goto __96 } addrOnce = 0 // Open every index that needs updating. if !(eOnePass != ONEPASS_OFF) { - goto __95 - } - if !(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */)) >= 0) { - goto __96 - } - *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */)) - iBaseCur)))) = U8(0) -__96: - ; - if !(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + 1*4)) >= 0) { goto __97 } - *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + 1*4)) - iBaseCur)))) = U8(0) -__97: + if !(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */)) >= 0) { + goto __98 + } + *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */)) - iBaseCur)))) = U8(0) +__98: ; -__95: + if !(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + 1*4)) >= 0) { + goto __99 + } + *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + 1*4)) - iBaseCur)))) = U8(0) +__99: + ; +__97: ; if !((eOnePass == ONEPASS_MULTI) && ((nIdx - (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + 1*4)) >= 0))) > 0)) { - goto __98 + goto __100 } addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once) -__98: +__100: ; Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, uint8(0), iBaseCur, aToOpen, uintptr(0), uintptr(0)) if !(addrOnce != 0) { - goto __99 + goto __101 } Xsqlite3VdbeJumpHereOrPopInst(tls, v, addrOnce) -__99: +__101: ; -__94: +__96: ; // Top of the update loop if !(eOnePass != ONEPASS_OFF) { - goto __100 + goto __102 } if !((!(isView != 0) && (*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */)) != iDataCur)) && (*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + 1*4)) != iDataCur)) { - goto __102 + goto __104 } Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelBreak, regKey, nKey) -__102: +__104: ; if !(eOnePass != ONEPASS_SINGLE) { - goto __103 + goto __105 } labelContinue = Xsqlite3VdbeMakeLabel(tls, pParse) -__103: +__105: ; Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, func() int32 { if pPk != 0 { @@ -119290,66 +121190,67 @@ __103: return regOldRowid }(), labelBreak) - goto __101 -__100: + goto __103 +__102: if !((pPk != 0) || (nChangeFrom != 0)) { - goto __104 + goto __106 } labelContinue = Xsqlite3VdbeMakeLabel(tls, pParse) Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iEph, labelBreak) addrTop = Xsqlite3VdbeCurrentAddr(tls, v) if !(nChangeFrom != 0) { - goto __106 - } - if !(!(isView != 0)) { goto __108 } + if !(!(isView != 0)) { + goto __110 + } if !(pPk != 0) { - goto __109 + goto __111 } i = 0 -__111: +__113: if !(i < int32(nPk)) { - goto __113 + goto __115 } Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, i, (iPk + i)) - goto __112 -__112: + goto __114 +__114: i++ - goto __111 goto __113 -__113: + goto __115 +__115: ; Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelContinue, iPk, int32(nPk)) - goto __110 -__109: + goto __112 +__111: Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iEph, regOldRowid) Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, labelContinue, regOldRowid) +__112: + ; __110: ; + goto __109 __108: - ; - goto __107 -__106: Xsqlite3VdbeAddOp2(tls, v, OP_RowData, iEph, regKey) Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelContinue, regKey, 0) -__107: +__109: ; - goto __105 -__104: - labelContinue = Xsqlite3VdbeAddOp3(tls, v, OP_RowSetRead, regRowSet, labelBreak, - regOldRowid) + goto __107 +__106: + Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iEph, labelBreak) + labelContinue = Xsqlite3VdbeMakeLabel(tls, pParse) + addrTop = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iEph, regOldRowid) Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, labelContinue, regOldRowid) -__105: +__107: ; -__101: +__103: ; -__92: +__94: ; // If the rowid value will change, set register regNewRowid to @@ -119358,26 +121259,26 @@ __92: // already populated. if !(chngRowid != 0) { - goto __114 + goto __116 } if !(nChangeFrom == 0) { - goto __115 + goto __117 } Xsqlite3ExprCode(tls, pParse, pRowidExpr, regNewRowid) - goto __116 -__115: + goto __118 +__117: Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, iRowidExpr, regNewRowid) -__116: +__118: ; Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, regNewRowid) -__114: +__116: ; // Compute the old pre-UPDATE content of the row being changed, if that // information is needed if !(((chngPk != 0) || (hasFK != 0)) || (pTrigger != 0)) { - goto __117 + goto __119 } oldmask = func() uint32 { if hasFK != 0 { @@ -119388,38 +121289,38 @@ __114: oldmask = oldmask | (Xsqlite3TriggerColmask(tls, pParse, pTrigger, pChanges, 0, (TRIGGER_BEFORE | TRIGGER_AFTER), pTab, onError)) i = 0 -__118: +__120: if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __120 + goto __122 } colFlags = U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)).FcolFlags) k = (int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + regOld) if !(((oldmask == 0xffffffff) || ((i < 32) && ((oldmask & (uint32((uint32(1))) << (i))) != U32(0)))) || - ((colFlags & COLFLAG_PRIMKEY) != U32(0))) { - goto __121 + ((colFlags & U32(COLFLAG_PRIMKEY)) != U32(0))) { + goto __123 } Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) - goto __122 -__121: + goto __124 +__123: Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, k) +__124: + ; + goto __121 +__121: + i++ + goto __120 + goto __122 __122: - ; - goto __119 -__119: - i++ - goto __118 - goto __120 -__120: ; if !((int32(chngRowid) == 0) && (pPk == uintptr(0))) { - goto __123 + goto __125 } Xsqlite3VdbeAddOp2(tls, v, OP_Copy, regOldRowid, regNewRowid) -__123: +__125: ; -__117: +__119: ; // Populate the array of registers beginning at regNew with the new @@ -119438,33 +121339,33 @@ __117: pParse, pTrigger, pChanges, 1, TRIGGER_BEFORE, pTab, onError)) i = 0 k = regNew -__124: +__126: if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __126 + goto __128 } if !(i == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) { - goto __127 - } - Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, k) - goto __128 -__127: - if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { goto __129 } - if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) != 0) { - goto __131 - } - k-- -__131: - ; + Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, k) goto __130 __129: + if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { + goto __131 + } + if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) != 0) { + goto __133 + } + k-- +__133: + ; + goto __132 +__131: j = *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) if !(j >= 0) { - goto __132 + goto __134 } if !(nChangeFrom != 0) { - goto __134 + goto __136 } nOff = func() int32 { if isView != 0 { @@ -119474,15 +121375,15 @@ __129: }() Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, (nOff + j), k) + goto __137 +__136: + Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(j)*32)).FpExpr, k) +__137: + ; goto __135 __134: - Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(j)*32)).FpExpr, k) -__135: - ; - goto __133 -__132: if !(((0 == (*(*int32)(unsafe.Pointer(bp + 32 /* tmask */)) & TRIGGER_BEFORE)) || (i > 31)) || ((uint32(newmask) & (uint32((uint32(1))) << (i))) != 0)) { - goto __136 + goto __138 } // This branch loads the value of a column that will not be changed // into a register. This is done if there are no BEFORE triggers, or @@ -119491,44 +121392,44 @@ __132: Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) bFinishSeek = 0 - goto __137 -__136: + goto __139 +__138: Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, k) -__137: +__139: ; -__133: +__135: + ; +__132: ; __130: ; -__128: - ; - goto __125 -__125: + goto __127 +__127: i++ k++ - goto __124 goto __126 -__126: + goto __128 +__128: ; - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { - goto __138 + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { + goto __140 } Xsqlite3ComputeGeneratedColumns(tls, pParse, regNew, pTab) -__138: +__140: ; // Fire any BEFORE UPDATE triggers. This happens before constraints are // verified. One could argue that this is wrong. if !((*(*int32)(unsafe.Pointer(bp + 32 /* tmask */)) & TRIGGER_BEFORE) != 0) { - goto __139 + goto __141 } Xsqlite3TableAffinity(tls, v, pTab, regNew) Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, TK_UPDATE, pChanges, TRIGGER_BEFORE, pTab, regOldRowid, onError, labelContinue) if !(!(isView != 0)) { - goto __140 + goto __142 } // The row-trigger may have deleted the row being updated. In this // case, jump to the next row. No updates or AFTER triggers are @@ -119536,15 +121437,15 @@ __138: // is deleted or renamed by a BEFORE trigger - is left undefined in the // documentation. if !(pPk != 0) { - goto __141 + goto __143 } Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelContinue, regKey, nKey) - goto __142 -__141: + goto __144 +__143: Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, labelContinue, regOldRowid) -__142: +__144: ; // After-BEFORE-trigger-reload-loop: @@ -119557,51 +121458,51 @@ __142: // for an example. i = 0 k = regNew -__143: +__145: if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __145 + goto __147 } if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { - goto __146 - } - if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) != 0) { goto __148 } + if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) != 0) { + goto __150 + } k-- -__148: +__150: ; - goto __147 -__146: + goto __149 +__148: if !((*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) < 0) && (i != int32((*Table)(unsafe.Pointer(pTab)).FiPKey))) { - goto __149 + goto __151 } Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) +__151: + ; __149: ; -__147: - ; - goto __144 -__144: + goto __146 +__146: i++ k++ - goto __143 goto __145 -__145: + goto __147 +__147: ; - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { - goto __150 + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { + goto __152 } Xsqlite3ComputeGeneratedColumns(tls, pParse, regNew, pTab) -__150: +__152: ; -__140: +__142: ; -__139: +__141: ; if !(!(isView != 0)) { - goto __151 + goto __153 } // Do constraint checks. @@ -119613,27 +121514,27 @@ __139: // row is changing, then the GenerateConstraintChecks() above may have // moved cursor iDataCur. Reseek it. if !((*(*int32)(unsafe.Pointer(bp + 104 /* bReplace */)) != 0) || (chngKey != 0)) { - goto __152 + goto __154 } if !(pPk != 0) { - goto __153 + goto __155 } Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelContinue, regKey, nKey) - goto __154 -__153: + goto __156 +__155: Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, labelContinue, regOldRowid) -__154: +__156: ; -__152: +__154: ; // Do FK constraint checks. if !(hasFK != 0) { - goto __155 + goto __157 } Xsqlite3FkCheck(tls, pParse, pTab, regOldRowid, 0, aXRef, int32(chngKey)) -__155: +__157: ; // Delete the index entries associated with the current record. @@ -119645,10 +121546,10 @@ __155: // we want to avoid the OP_FinishSeek if possible, as running it // costs CPU cycles. if !(bFinishSeek != 0) { - goto __156 + goto __158 } Xsqlite3VdbeAddOp1(tls, v, OP_FinishSeek, iDataCur) -__156: +__158: ; // If changing the rowid value, or if there are foreign key constraints @@ -119669,24 +121570,24 @@ __156: }())), regNewRowid) if !(eOnePass == ONEPASS_MULTI) { - goto __157 + goto __159 } - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_SAVEPOSITION) -__157: + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) +__159: ; if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) { - goto __158 + goto __160 } Xsqlite3VdbeAppendP4(tls, v, pTab, -6) -__158: +__160: ; if !(hasFK != 0) { - goto __159 + goto __161 } Xsqlite3FkCheck(tls, pParse, pTab, 0, regNewRowid, aXRef, int32(chngKey)) -__159: +__161: ; // Insert the new index entries and the new record. @@ -119704,20 +121605,20 @@ __159: // handle rows (possibly in other tables) that refer via a foreign key // to the row just updated. if !(hasFK != 0) { - goto __160 + goto __162 } Xsqlite3FkActions(tls, pParse, pTab, pChanges, regOldRowid, aXRef, int32(chngKey)) -__160: +__162: ; -__151: +__153: ; // Increment the row counter if !(regRowCount != 0) { - goto __161 + goto __163 } Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, regRowCount, 1) -__161: +__163: ; Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, TK_UPDATE, pChanges, @@ -119726,32 +121627,24 @@ __161: // Repeat the above with the next record to be updated, until // all record selected by the WHERE clause have been updated. if !(eOnePass == ONEPASS_SINGLE) { - goto __162 - } - // Nothing to do at end-of-loop for a single-pass - goto __163 -__162: - if !(eOnePass == ONEPASS_MULTI) { goto __164 } - Xsqlite3VdbeResolveLabel(tls, v, labelContinue) - Xsqlite3WhereEnd(tls, pWInfo) + // Nothing to do at end-of-loop for a single-pass goto __165 __164: - if !((pPk != 0) || (nChangeFrom != 0)) { + if !(eOnePass == ONEPASS_MULTI) { goto __166 } Xsqlite3VdbeResolveLabel(tls, v, labelContinue) - Xsqlite3VdbeAddOp2(tls, v, OP_Next, iEph, addrTop) + Xsqlite3WhereEnd(tls, pWInfo) goto __167 __166: - Xsqlite3VdbeGoto(tls, v, labelContinue) + Xsqlite3VdbeResolveLabel(tls, v, labelContinue) + Xsqlite3VdbeAddOp2(tls, v, OP_Next, iEph, addrTop) __167: ; __165: ; -__163: - ; Xsqlite3VdbeResolveLabel(tls, v, labelBreak) // Update the sqlite_sequence table by storing the content of the @@ -119769,9 +121662,9 @@ __168: if !(regRowCount != 0) { goto __169 } - Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, regRowCount, 1) + Xsqlite3VdbeAddOp2(tls, v, OP_ChngCntRow, regRowCount, 1) Xsqlite3VdbeSetNumCols(tls, v, 1) - Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+17883 /* "rows updated" */, uintptr(0)) + Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+18365 /* "rows updated" */, uintptr(0)) __169: ; @@ -119807,7 +121700,7 @@ update_cleanup: // 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 *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pChanges uintptr, pRowid uintptr, aXRef uintptr, pWhere uintptr, onError int32) { /* sqlite3.c:138757:13: */ +func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pChanges uintptr, pRowid uintptr, aXRef uintptr, pWhere uintptr, onError int32) { /* sqlite3.c:140973:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -119817,11 +121710,11 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database connection var pVTab uintptr = Xsqlite3GetVTable(tls, db, pTab) var pWInfo uintptr = uintptr(0) - var nArg int32 = (2 + int32((*Table)(unsafe.Pointer(pTab)).FnCol)) // Number of arguments to VUpdate - var regArg int32 // First register in VUpdate arg array - var regRec int32 // Register in which to assemble record - var regRowid int32 // Register for ephem table rowid - var iCsr int32 = (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor // Cursor used for virtual table scan + var nArg int32 = (2 + int32((*Table)(unsafe.Pointer(pTab)).FnCol)) // Number of arguments to VUpdate + var regArg int32 // First register in VUpdate arg array + var regRec int32 // Register in which to assemble record + var regRowid int32 // Register for ephem table rowid + var iCsr int32 = (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor // Cursor used for virtual table scan // var aDummy [2]int32 at bp, 8 // Unused arg for sqlite3WhereOkOnePass() var eOnePass int32 // True to use onepass strategy @@ -119836,12 +121729,25 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt regArg = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1) *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (nArg) if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1 { + var pPk uintptr = uintptr(0) var pRow uintptr var pList uintptr - if pRowid != 0 { - pRow = Xsqlite3ExprDup(tls, db, pRowid, 0) + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + if pRowid != 0 { + pRow = Xsqlite3ExprDup(tls, db, pRowid, 0) + } else { + pRow = Xsqlite3PExpr(tls, pParse, TK_ROW, uintptr(0), uintptr(0)) + } } else { - pRow = Xsqlite3PExpr(tls, pParse, TK_ROW, uintptr(0), uintptr(0)) + var iPk I16 // PRIMARY KEY column + pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) + + iPk = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn)) + if *(*int32)(unsafe.Pointer(aXRef + uintptr(iPk)*4)) >= 0 { + pRow = Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(iPk)*4)))*32)).FpExpr, 0) + } else { + pRow = exprRowColumn(tls, pParse, int32(iPk)) + } } pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), pRow) @@ -119854,7 +121760,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt } } - updateFromSelect(tls, pParse, ephemTab, uintptr(0), pList, pSrc, pWhere, uintptr(0), uintptr(0)) + updateFromSelect(tls, pParse, ephemTab, pPk, pList, pSrc, pWhere, uintptr(0), uintptr(0)) Xsqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { @@ -119862,7 +121768,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt regRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Start scanning the virtual table - pWInfo = Xsqlite3WhereBegin(tls, pParse, pSrc, pWhere, uintptr(0), uintptr(0), WHERE_ONEPASS_DESIRED, 0) + pWInfo = Xsqlite3WhereBegin(tls, pParse, pSrc, pWhere, uintptr(0), uintptr(0), uint16(WHERE_ONEPASS_DESIRED), 0) if pWInfo == uintptr(0) { return } @@ -119874,10 +121780,10 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*32)).FpExpr, ((regArg + 2) + i)) } else { Xsqlite3VdbeAddOp3(tls, v, OP_VColumn, iCsr, i, ((regArg + 2) + i)) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_NOCHNG) // For sqlite3_vtab_nochange() + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_NOCHNG)) // For sqlite3_vtab_nochange() } } - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCsr, regArg) if pRowid != 0 { Xsqlite3ExprCode(tls, pParse, pRowid, (regArg + 1)) @@ -119932,7 +121838,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 0, nArg, regArg, pVTab, -12) Xsqlite3VdbeChangeP5(tls, v, func() uint16 { if onError == OE_Default { - return OE_Abort + return uint16(OE_Abort) } return uint16(onError) }()) @@ -119966,18 +121872,27 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt // #include "sqliteInt.h" // Free a list of Upsert objects -func Xsqlite3UpsertDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:138929:21: */ - if p != 0 { +func upsertDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:141159:29: */ + for ok := true; ok; ok = p != 0 { + var pNext uintptr = (*Upsert)(unsafe.Pointer(p)).FpNextUpsert Xsqlite3ExprListDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTarget) Xsqlite3ExprDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTargetWhere) Xsqlite3ExprListDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertSet) Xsqlite3ExprDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertWhere) + Xsqlite3DbFree(tls, db, (*Upsert)(unsafe.Pointer(p)).FpToFree) Xsqlite3DbFree(tls, db, p) + p = pNext + } +} + +func Xsqlite3UpsertDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:141171:21: */ + if p != 0 { + upsertDelete(tls, db, p) } } // Duplicate an Upsert object. -func Xsqlite3UpsertDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:138942:23: */ +func Xsqlite3UpsertDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:141179:23: */ if p == uintptr(0) { return uintptr(0) } @@ -119985,25 +121900,28 @@ func Xsqlite3UpsertDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite Xsqlite3ExprListDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTarget, 0), Xsqlite3ExprDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTargetWhere, 0), Xsqlite3ExprListDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertSet, 0), - Xsqlite3ExprDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertWhere, 0)) + Xsqlite3ExprDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertWhere, 0), + Xsqlite3UpsertDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpNextUpsert)) } // Create a new Upsert object. -func Xsqlite3UpsertNew(tls *libc.TLS, db uintptr, pTarget uintptr, pTargetWhere uintptr, pSet uintptr, pWhere uintptr) uintptr { /* sqlite3.c:138955:23: */ +func Xsqlite3UpsertNew(tls *libc.TLS, db uintptr, pTarget uintptr, pTargetWhere uintptr, pSet uintptr, pWhere uintptr, pNext uintptr) uintptr { /* sqlite3.c:141193:23: */ var pNew uintptr - pNew = Xsqlite3DbMallocRaw(tls, db, uint64(unsafe.Sizeof(Upsert{}))) + pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Upsert{}))) if pNew == uintptr(0) { Xsqlite3ExprListDelete(tls, db, pTarget) Xsqlite3ExprDelete(tls, db, pTargetWhere) Xsqlite3ExprListDelete(tls, db, pSet) Xsqlite3ExprDelete(tls, db, pWhere) + Xsqlite3UpsertDelete(tls, db, pNext) return uintptr(0) } else { (*Upsert)(unsafe.Pointer(pNew)).FpUpsertTarget = pTarget (*Upsert)(unsafe.Pointer(pNew)).FpUpsertTargetWhere = pTargetWhere (*Upsert)(unsafe.Pointer(pNew)).FpUpsertSet = pSet (*Upsert)(unsafe.Pointer(pNew)).FpUpsertWhere = pWhere - (*Upsert)(unsafe.Pointer(pNew)).FpUpsertIdx = uintptr(0) + (*Upsert)(unsafe.Pointer(pNew)).FisDoUpdate = (U8(libc.Bool32(pSet != uintptr(0)))) + (*Upsert)(unsafe.Pointer(pNew)).FpNextUpsert = pNext } return pNew } @@ -120013,9 +121931,9 @@ func Xsqlite3UpsertNew(tls *libc.TLS, db uintptr, pTarget uintptr, pTargetWhere // // Return SQLITE_OK if everything works, or an error code is something // is wrong. -func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr, pUpsert uintptr) int32 { /* sqlite3.c:138987:20: */ - bp := tls.Alloc(200) - defer tls.Free(200) +func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr, pUpsert uintptr) int32 { /* sqlite3.c:141228:20: */ + bp := tls.Alloc(232) + defer tls.Free(232) var pTab uintptr // That table into which we are inserting var rc int32 // Result code @@ -120023,107 +121941,167 @@ func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr var pIdx uintptr // One of the indexes of pTab var pTarget uintptr // The conflict-target clause var pTerm uintptr // One term of the conflict-target clause - // var sNC NameContext at bp, 56 + // var sNC NameContext at bp+16, 56 // Context for resolving symbolic names - // var sCol [2]Expr at bp+56, 144 + // var sCol [2]Expr at bp+72, 144 // Index column converted into an Expr + var nClause int32 = 0 // Counter of ON CONFLICT clauses // Resolve all symbolic names in the conflict-target clause, which // includes both the list of columns and the optional partial-index // WHERE clause. - libc.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) - (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = pParse - (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = pTabList - rc = Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget) - if rc != 0 { - return rc + libc.Xmemset(tls, bp+16 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) + (*NameContext)(unsafe.Pointer(bp + 16 /* &sNC */)).FpParse = pParse + (*NameContext)(unsafe.Pointer(bp + 16 /* &sNC */)).FpSrcList = pTabList +__1: + if !((pUpsert != 0) && ((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget != 0)) { + goto __3 } - rc = Xsqlite3ResolveExprNames(tls, bp /* &sNC */, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere) - if rc != 0 { - return rc - } - - // Check to see if the conflict target matches the rowid. - pTab = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab - pTarget = (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget - iCursor = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor - if (((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && - ((*ExprList)(unsafe.Pointer(pTarget)).FnExpr == 1)) && - (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pTerm, (*ExprList_item)(unsafe.Pointer((pTarget + 8 /* &.a */))).FpExpr)))).Fop) == TK_COLUMN)) && - (int32((*Expr)(unsafe.Pointer(pTerm)).FiColumn) == (-1)) { - // The conflict-target is the rowid of the primary table - - return SQLITE_OK - } - - // Initialize sCol[0..1] to be an expression parse tree for a - // single column of an index. The sCol[0] node will be the TK_COLLATE - // operator and sCol[1] will be the TK_COLUMN operator. Code below - // will populate the specific collation and column number values - // prior to comparing against the conflict-target expression. - libc.Xmemset(tls, bp+56 /* &sCol[0] */, 0, uint64(unsafe.Sizeof([2]Expr{}))) - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).Fop = TK_COLLATE - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).FpLeft = (bp + 56 /* &sCol */ + 1*72) - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + 1*72)).Fop = TK_COLUMN - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + 1*72)).FiTable = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor - - // Check for matches against other indexes - for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext { - var ii int32 - var jj int32 - var nn int32 - if !(int32((*Index)(unsafe.Pointer((pIdx))).FonError) != OE_None) { - continue + { + rc = Xsqlite3ResolveExprListNames(tls, bp+16 /* &sNC */, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget) + if rc != 0 { + return rc } - if (*ExprList)(unsafe.Pointer(pTarget)).FnExpr != int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) { - continue + rc = Xsqlite3ResolveExprNames(tls, bp+16 /* &sNC */, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere) + if rc != 0 { + return rc } - if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { - if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere == uintptr(0) { + + // Check to see if the conflict target matches the rowid. + pTab = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab + pTarget = (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget + iCursor = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor + if (((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && + ((*ExprList)(unsafe.Pointer(pTarget)).FnExpr == 1)) && + (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pTerm, (*ExprList_item)(unsafe.Pointer((pTarget + 8 /* &.a */))).FpExpr)))).Fop) == TK_COLUMN)) && + (int32((*Expr)(unsafe.Pointer(pTerm)).FiColumn) == (-1)) { + // The conflict-target is the rowid of the primary table + + goto __2 + } + + // Initialize sCol[0..1] to be an expression parse tree for a + // single column of an index. The sCol[0] node will be the TK_COLLATE + // operator and sCol[1] will be the TK_COLUMN operator. Code below + // will populate the specific collation and column number values + // prior to comparing against the conflict-target expression. + libc.Xmemset(tls, bp+72 /* &sCol[0] */, 0, uint64(unsafe.Sizeof([2]Expr{}))) + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */)).Fop = U8(TK_COLLATE) + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */)).FpLeft = (bp + 72 /* &sCol */ + 1*72) + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */ + 1*72)).Fop = U8(TK_COLUMN) + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */ + 1*72)).FiTable = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor + + // Check for matches against other indexes + for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext { + var ii int32 + var jj int32 + var nn int32 + if !(int32((*Index)(unsafe.Pointer((pIdx))).FonError) != OE_None) { continue } - if Xsqlite3ExprCompare(tls, pParse, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere, - (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCursor) != 0 { + if (*ExprList)(unsafe.Pointer(pTarget)).FnExpr != int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) { continue } - } - nn = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) - for ii = 0; ii < nn; ii++ { - var pExpr uintptr - *(*uintptr)(unsafe.Pointer(bp + 56 /* &sCol */ + 8 /* &.u */)) = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(ii)*8)) - if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2))) == (-2) { - - pExpr = (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr + 8 /* &.a */) + uintptr(ii)*32)).FpExpr - if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLLATE { - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).FpLeft = pExpr - pExpr = (bp + 56 /* &sCol */) + if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere == uintptr(0) { + continue } + if Xsqlite3ExprCompare(tls, pParse, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere, + (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCursor) != 0 { + continue + } + } + nn = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) + for ii = 0; ii < nn; ii++ { + var pExpr uintptr + *(*uintptr)(unsafe.Pointer(bp + 72 /* &sCol */ + 8 /* &.u */)) = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(ii)*8)) + if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2))) == (-2) { + + pExpr = (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr + 8 /* &.a */) + uintptr(ii)*32)).FpExpr + if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLLATE { + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */)).FpLeft = pExpr + pExpr = (bp + 72 /* &sCol */) + } + } else { + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */)).FpLeft = (bp + 72 /* &sCol */ + 1*72) + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */ + 1*72)).FiColumn = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2)) + pExpr = (bp + 72 /* &sCol */) + } + for jj = 0; jj < nn; jj++ { + if Xsqlite3ExprCompare(tls, pParse, (*ExprList_item)(unsafe.Pointer((pTarget+8 /* &.a */)+uintptr(jj)*32)).FpExpr, pExpr, iCursor) < 2 { + break // Column ii of the index matches column jj of target + } + } + if jj >= nn { + // The target contains no match for column jj of the index + break + } + } + if ii < nn { + // Column ii of the index did not match any term of the conflict target. + // Continue the search with the next index. + continue + } + (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx = pIdx + break + } + if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx == uintptr(0) { + // var zWhich [16]int8 at bp+216, 16 + + if (nClause == 0) && ((*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0)) { + *(*int8)(unsafe.Pointer(bp + 216 /* &zWhich[0] */)) = int8(0) } else { - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).FpLeft = (bp + 56 /* &sCol */ + 1*72) - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + 1*72)).FiColumn = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2)) - pExpr = (bp + 56 /* &sCol */) - } - for jj = 0; jj < nn; jj++ { - if Xsqlite3ExprCompare(tls, pParse, (*ExprList_item)(unsafe.Pointer((pTarget+8 /* &.a */)+uintptr(jj)*32)).FpExpr, pExpr, iCursor) < 2 { - break // Column ii of the index matches column jj of target - } - } - if jj >= nn { - // The target contains no match for column jj of the index - break + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([16]int8{})), bp+216 /* &zWhich[0] */, ts+18378 /* "%r " */, libc.VaList(bp, (nClause+1))) } + Xsqlite3ErrorMsg(tls, pParse, + ts+18382 /* "%sON CONFLICT cl..." */, libc.VaList(bp+8, bp+216 /* &zWhich[0] */)) + return SQLITE_ERROR } - if ii < nn { - // Column ii of the index did not match any term of the conflict target. - // Continue the search with the next index. - continue - } - (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx = pIdx - return SQLITE_OK + } - Xsqlite3ErrorMsg(tls, pParse, - ts+17896 /* "ON CONFLICT clau..." */, 0) - return SQLITE_ERROR + goto __2 +__2: + pUpsert = (*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert + nClause++ + goto __1 + goto __3 +__3: + ; + return SQLITE_OK +} + +// Return true if pUpsert is the last ON CONFLICT clause with a +// conflict target, or if pUpsert is followed by another ON CONFLICT +// clause that targets the INTEGER PRIMARY KEY. +func Xsqlite3UpsertNextIsIPK(tls *libc.TLS, pUpsert uintptr) int32 { /* sqlite3.c:141355:20: */ + var pNext uintptr + if pUpsert == uintptr(0) { + return 0 + } + pNext = (*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert + if pNext == uintptr(0) { + return 1 + } + if (*Upsert)(unsafe.Pointer(pNext)).FpUpsertTarget == uintptr(0) { + return 1 + } + if (*Upsert)(unsafe.Pointer(pNext)).FpUpsertIdx == uintptr(0) { + return 1 + } + return 0 +} + +// Given the list of ON CONFLICT clauses described by pUpsert, and +// a particular index pIdx, return a pointer to the particular ON CONFLICT +// clause that applies to the index. Or, if the index is not subject to +// any ON CONFLICT clause, return NULL. +func Xsqlite3UpsertOfIndex(tls *libc.TLS, pUpsert uintptr, pIdx uintptr) uintptr { /* sqlite3.c:141371:23: */ + for ((pUpsert != 0) && + ((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget != uintptr(0))) && + ((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx != pIdx) { + pUpsert = (*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert + } + return pUpsert } // Generate bytecode that does an UPDATE as part of an upsert. @@ -120133,16 +122111,19 @@ func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr // currently points to the conflicting table row. Otherwise, if pIdx // is not NULL, then pIdx is the constraint that failed and iCur is a // cursor points to the conflicting row. -func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab uintptr, pIdx uintptr, iCur int32) { /* sqlite3.c:139105:21: */ +func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab uintptr, pIdx uintptr, iCur int32) { /* sqlite3.c:141391:21: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pSrc uintptr // FROM clause for the UPDATE var iDataCur int32 var i int32 + var pTop uintptr = pUpsert iDataCur = (*Upsert)(unsafe.Pointer(pUpsert)).FiDataCur + pUpsert = Xsqlite3UpsertOfIndex(tls, pTop, pIdx) + if (pIdx != 0) && (iCur != iDataCur) { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { var regRowid int32 = Xsqlite3GetTempReg(tls, pParse) Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iCur, regRowid) Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, iDataCur, 0, regRowid) @@ -120164,24 +122145,22 @@ func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iDataCur, 0, iPk, nPk) Xsqlite3VdbeAddOp4(tls, v, OP_Halt, SQLITE_CORRUPT, OE_Abort, 0, - ts+10100 /* "corrupt database" */, -1) + ts+10465 /* "corrupt database" */, -1) Xsqlite3MayAbort(tls, pParse) Xsqlite3VdbeJumpHere(tls, v, i) } } - // pUpsert does not own pUpsertSrc - the outer INSERT statement does. So - // we have to make a copy before passing it down into sqlite3Update() - pSrc = Xsqlite3SrcListDup(tls, db, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc, 0) + // pUpsert does not own pTop->pUpsertSrc - the outer INSERT statement does. + // So we have to make a copy before passing it down into sqlite3Update() + pSrc = Xsqlite3SrcListDup(tls, db, (*Upsert)(unsafe.Pointer(pTop)).FpUpsertSrc, 0) // excluded.* columns of type REAL need to be converted to a hard real for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ { if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).Faffinity) == SQLITE_AFF_REAL { - Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, ((*Upsert)(unsafe.Pointer(pUpsert)).FregData + i)) + Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, ((*Upsert)(unsafe.Pointer(pTop)).FregData + i)) } } - Xsqlite3Update(tls, pParse, pSrc, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet, - (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertWhere, OE_Abort, uintptr(0), uintptr(0), pUpsert) - (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet = uintptr(0) // Will have been deleted by sqlite3Update() - (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertWhere = uintptr(0) // Will have been deleted by sqlite3Update() + Xsqlite3Update(tls, pParse, pSrc, Xsqlite3ExprListDup(tls, db, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet, 0), + Xsqlite3ExprDup(tls, db, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertWhere, 0), OE_Abort, uintptr(0), uintptr(0), pUpsert) } @@ -120212,7 +122191,7 @@ func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab // // The execSqlF() routine does the same thing, except it accepts // a format string as its third argument -func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { /* sqlite3.c:139202:12: */ +func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { /* sqlite3.c:141488:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -120234,7 +122213,7 @@ func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { // then run VACUUM to get those statements to execute at inappropriate // times. if (zSubSql != 0) && - ((libc.Xstrncmp(tls, zSubSql, ts+17967 /* "CRE" */, uint64(3)) == 0) || (libc.Xstrncmp(tls, zSubSql, ts+17971 /* "INS" */, uint64(3)) == 0)) { + ((libc.Xstrncmp(tls, zSubSql, ts+18455 /* "CRE" */, uint64(3)) == 0) || (libc.Xstrncmp(tls, zSubSql, ts+18459 /* "INS" */, uint64(3)) == 0)) { rc = execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -120252,7 +122231,7 @@ func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { return rc } -func execSqlF(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr, va uintptr) int32 { /* sqlite3.c:139232:12: */ +func execSqlF(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr, va uintptr) int32 { /* sqlite3.c:141518:12: */ var z uintptr var ap Va_list _ = ap @@ -120296,7 +122275,7 @@ func execSqlF(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr, va uint // 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 Xsqlite3Vacuum(tls *libc.TLS, pParse uintptr, pNm uintptr, pInto uintptr) { /* sqlite3.c:139275:21: */ +func Xsqlite3Vacuum(tls *libc.TLS, pParse uintptr, pNm uintptr, pInto uintptr) { /* sqlite3.c:141561:21: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = pNm @@ -120353,7 +122332,7 @@ build_vacuum_end: } // This routine implements the OP_Vacuum opcode of the VDBE. -func Xsqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, pOut uintptr) int32 { /* sqlite3.c:139313:36: */ +func Xsqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, pOut uintptr) int32 { /* sqlite3.c:141599:36: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -120384,14 +122363,14 @@ func Xsqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) { goto __1 } - Xsqlite3SetString(tls, pzErrMsg, db, ts+17975 /* "cannot VACUUM fr..." */) + Xsqlite3SetString(tls, pzErrMsg, db, ts+18463 /* "cannot VACUUM fr..." */) return SQLITE_ERROR // IMP: R-12218-18073 __1: ; if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive > 1) { goto __2 } - Xsqlite3SetString(tls, pzErrMsg, db, ts+18015 /* "cannot VACUUM - ..." */) + Xsqlite3SetString(tls, pzErrMsg, db, ts+18503 /* "cannot VACUUM - ..." */) return SQLITE_ERROR // IMP: R-15610-35227 __2: ; @@ -120402,7 +122381,7 @@ __2: if !(Xsqlite3_value_type(tls, pOut) != SQLITE_TEXT) { goto __5 } - Xsqlite3SetString(tls, pzErrMsg, db, ts+18058 /* "non-text filenam..." */) + Xsqlite3SetString(tls, pzErrMsg, db, ts+18546 /* "non-text filenam..." */) return SQLITE_ERROR __5: ; @@ -120447,7 +122426,7 @@ __4: // time to parse and run the PRAGMA to turn journalling off than it does // to write the journal header file. nDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb - rc = execSqlF(tls, db, pzErrMsg, ts+18076 /* "ATTACH %Q AS vac..." */, libc.VaList(bp, zOut)) + rc = execSqlF(tls, db, pzErrMsg, ts+18564 /* "ATTACH %Q AS vac..." */, libc.VaList(bp, zOut)) (*Sqlite3)(unsafe.Pointer(db)).FopenFlags = saved_openFlags if !(rc != SQLITE_OK) { goto __6 @@ -120468,11 +122447,11 @@ __6: goto __8 } rc = SQLITE_ERROR - Xsqlite3SetString(tls, pzErrMsg, db, ts+18099 /* "output file alre..." */) + Xsqlite3SetString(tls, pzErrMsg, db, ts+18587 /* "output file alre..." */) goto end_of_vacuum __8: ; - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_VacuumInto) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_VacuumInto)) __7: ; nRes = Xsqlite3BtreeGetRequestedReserve(tls, pMain) @@ -120484,7 +122463,7 @@ __7: // Begin a transaction and take an exclusive lock on the main database // file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, // to ensure that we do not try to change the page-size on a WAL database. - rc = execSql(tls, db, pzErrMsg, ts+12336 /* "BEGIN" */) + rc = execSql(tls, db, pzErrMsg, ts+12752 /* "BEGIN" */) if !(rc != SQLITE_OK) { goto __9 } @@ -120535,7 +122514,7 @@ __12: (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(nDb) // force new CREATE statements into vacuum_db rc = execSqlF(tls, db, pzErrMsg, - ts+18126, /* "SELECT sql FROM ..." */ + ts+18614, /* "SELECT sql FROM ..." */ libc.VaList(bp+8, zDbMain)) if !(rc != SQLITE_OK) { goto __13 @@ -120545,7 +122524,7 @@ __13: ; rc = execSqlF(tls, db, pzErrMsg, - ts+18234, /* "SELECT sql FROM ..." */ + ts+18722, /* "SELECT sql FROM ..." */ libc.VaList(bp+16, zDbMain)) if !(rc != SQLITE_OK) { goto __14 @@ -120560,7 +122539,7 @@ __14: // the contents to the temporary database. rc = execSqlF(tls, db, pzErrMsg, - ts+18288, /* "SELECT'INSERT IN..." */ + ts+18776, /* "SELECT'INSERT IN..." */ libc.VaList(bp+24, zDbMain)) *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_Vacuum))) @@ -120577,7 +122556,7 @@ __15: // from the schema table. rc = execSqlF(tls, db, pzErrMsg, - ts+18439, /* "INSERT INTO vacu..." */ + ts+18927, /* "INSERT INTO vacu..." */ libc.VaList(bp+32, zDbMain)) if !(rc != 0) { goto __16 @@ -120685,12 +122664,12 @@ __26: } var aCopy = [10]uint8{ - BTREE_SCHEMA_VERSION, uint8(1), // Add one to the old schema cookie - BTREE_DEFAULT_CACHE_SIZE, uint8(0), // Preserve the default page cache size - BTREE_TEXT_ENCODING, uint8(0), // Preserve the text encoding - BTREE_USER_VERSION, uint8(0), // Preserve the user version - BTREE_APPLICATION_ID, uint8(0), // Preserve the application id -} /* sqlite3.c:139504:32 */ + uint8(BTREE_SCHEMA_VERSION), uint8(1), // Add one to the old schema cookie + uint8(BTREE_DEFAULT_CACHE_SIZE), uint8(0), // Preserve the default page cache size + uint8(BTREE_TEXT_ENCODING), uint8(0), // Preserve the text encoding + uint8(BTREE_USER_VERSION), uint8(0), // Preserve the user version + uint8(BTREE_APPLICATION_ID), uint8(0), // Preserve the application id +} /* sqlite3.c:141790:32 */ // Construct and install a Module object for a virtual table. When this // routine is called, it is guaranteed that all appropriate locks are held @@ -120698,7 +122677,7 @@ var aCopy = [10]uint8{ // // If there already exists a module with zName, replace it with the new one. // If pModule==0, then delete the module zName if it exists. -func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) uintptr { /* sqlite3.c:139616:23: */ +func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) uintptr { /* sqlite3.c:141902:23: */ var pMod uintptr var pDel uintptr var zCopy uintptr @@ -120721,7 +122700,7 @@ func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*Module)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*Module)(unsafe.Pointer(pMod)).FnRefModule = 1 } - pDel = Xsqlite3HashInsert(tls, (db + 528 /* &.aModule */), zCopy, pMod) + pDel = Xsqlite3HashInsert(tls, (db + 536 /* &.aModule */), zCopy, pMod) if pDel != 0 { if pDel == pMod { Xsqlite3OomFault(tls, db) @@ -120738,7 +122717,7 @@ func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // 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 *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:139664:12: */ +func createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:141950:12: */ var rc int32 = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -120752,21 +122731,21 @@ func createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAu } // External API function used to create a new virtual-table module. -func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr) int32 { /* sqlite3.c:139685:16: */ +func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr) int32 { /* sqlite3.c:141971:16: */ return createModule(tls, db, zName, pModule, pAux, uintptr(0)) } // External API function used to create a new virtual-table module. -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:139700:16: */ +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:141986:16: */ return createModule(tls, db, zName, pModule, pAux, xDestroy) } // External API to drop all virtual-table modules, except those named // on the azNames list. -func Xsqlite3_drop_modules(tls *libc.TLS, db uintptr, azNames uintptr) int32 { /* sqlite3.c:139717:16: */ +func Xsqlite3_drop_modules(tls *libc.TLS, db uintptr, azNames uintptr) int32 { /* sqlite3.c:142003:16: */ var pThis uintptr var pNext uintptr - for pThis = (*Hash)(unsafe.Pointer((db + 528 /* &.aModule */))).Ffirst; pThis != 0; pThis = pNext { + for pThis = (*Hash)(unsafe.Pointer((db + 536 /* &.aModule */))).Ffirst; pThis != 0; pThis = pNext { var pMod uintptr = (*HashElem)(unsafe.Pointer(pThis)).Fdata pNext = (*HashElem)(unsafe.Pointer(pThis)).Fnext if azNames != 0 { @@ -120784,7 +122763,7 @@ func Xsqlite3_drop_modules(tls *libc.TLS, db uintptr, azNames uintptr) int32 { / // Decrement the reference count on a Module object. Destroy the // module when the reference count reaches zero. -func Xsqlite3VtabModuleUnref(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:139739:21: */ +func Xsqlite3VtabModuleUnref(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:142025:21: */ (*Module)(unsafe.Pointer(pMod)).FnRefModule-- if (*Module)(unsafe.Pointer(pMod)).FnRefModule == 0 { @@ -120802,14 +122781,14 @@ func Xsqlite3VtabModuleUnref(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlit // // If a disconnect is attempted while a virtual table is locked, // the disconnect is deferred until all locks have been removed. -func Xsqlite3VtabLock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:139759:21: */ +func Xsqlite3VtabLock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:142045:21: */ (*VTable)(unsafe.Pointer(pVTab)).FnRef++ } // 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 Xsqlite3GetVTable(tls *libc.TLS, db uintptr, pTab uintptr) uintptr { /* sqlite3.c:139769:23: */ +func Xsqlite3GetVTable(tls *libc.TLS, db uintptr, pTab uintptr) uintptr { /* sqlite3.c:142055:23: */ var pVtab uintptr for pVtab = (*Table)(unsafe.Pointer(pTab)).FpVTable; (pVtab != 0) && ((*VTable)(unsafe.Pointer(pVtab)).Fdb != db); pVtab = (*VTable)(unsafe.Pointer(pVtab)).FpNext { @@ -120819,7 +122798,7 @@ func Xsqlite3GetVTable(tls *libc.TLS, db uintptr, pTab uintptr) uintptr { /* sql // Decrement the ref-count on a virtual table object. When the ref-count // reaches zero, call the xDisconnect() method to delete the object. -func Xsqlite3VtabUnlock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:139780:21: */ +func Xsqlite3VtabUnlock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:142066:21: */ var db uintptr = (*VTable)(unsafe.Pointer(pVTab)).Fdb (*VTable)(unsafe.Pointer(pVTab)).FnRef-- @@ -120838,7 +122817,7 @@ func Xsqlite3VtabUnlock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:139780:21: // 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 *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:139805:15: */ +func vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:142091:15: */ var pRet uintptr = uintptr(0) var pVTable uintptr = (*Table)(unsafe.Pointer(p)).FpVTable (*Table)(unsafe.Pointer(p)).FpVTable = uintptr(0) @@ -120873,7 +122852,7 @@ func vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite // 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 Xsqlite3VtabDisconnect(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:139845:21: */ +func Xsqlite3VtabDisconnect(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:142131:21: */ var ppVTab uintptr for ppVTab = (p + 96 /* &.pVTable */); *(*uintptr)(unsafe.Pointer(ppVTab)) != 0; ppVTab = (*(*uintptr)(unsafe.Pointer(ppVTab)) + 40 /* &.pNext */) { @@ -120904,7 +122883,7 @@ func Xsqlite3VtabDisconnect(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c // // As a result, a sqlite3.pDisconnect cannot be accessed simultaneously // by multiple threads. It is thread-safe. -func Xsqlite3VtabUnlockList(tls *libc.TLS, db uintptr) { /* sqlite3.c:139883:21: */ +func Xsqlite3VtabUnlockList(tls *libc.TLS, db uintptr) { /* sqlite3.c:142169:21: */ var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpDisconnect if p != 0 { @@ -120930,7 +122909,7 @@ func Xsqlite3VtabUnlockList(tls *libc.TLS, db uintptr) { /* sqlite3.c:139883:21: // 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 Xsqlite3VtabClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:139914:21: */ +func Xsqlite3VtabClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:142200:21: */ if !(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0)) { vtabDisconnectAll(tls, uintptr(0), p) } @@ -120949,15 +122928,15 @@ func Xsqlite3VtabClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:1399 // The string is not copied - the pointer is stored. The // string will be freed automatically when the table is // deleted. -func addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uintptr) { /* sqlite3.c:139931:13: */ +func addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uintptr) { /* sqlite3.c:142217:13: */ bp := tls.Alloc(8) defer tls.Free(8) var nBytes Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * (uint64(2 + (*Table)(unsafe.Pointer(pTable)).FnModuleArg)))) var azModuleArg uintptr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - if ((*Table)(unsafe.Pointer(pTable)).FnModuleArg + 3) >= *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 2*4)) { - Xsqlite3ErrorMsg(tls, pParse, ts+10279 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName)) + if ((*Table)(unsafe.Pointer(pTable)).FnModuleArg + 3) >= *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 2*4)) { + Xsqlite3ErrorMsg(tls, pParse, ts+10695 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = Xsqlite3DbRealloc(tls, db, (*Table)(unsafe.Pointer(pTable)).FazModuleArg, uint64(nBytes)) if azModuleArg == uintptr(0) { @@ -120973,7 +122952,7 @@ func addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uintp // 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 Xsqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pModuleName uintptr, ifNotExists int32) { /* sqlite3.c:139954:21: */ +func Xsqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pModuleName uintptr, ifNotExists int32) { /* sqlite3.c:142240:21: */ var pTable uintptr // The new virtual table var db uintptr // Database connection @@ -121006,7 +122985,7 @@ func Xsqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName // 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 *libc.TLS, pParse uintptr) { /* sqlite3.c:140002:13: */ +func addArgumentToVtab(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:142288:13: */ if ((*Parse)(unsafe.Pointer(pParse)).FsArg.Fz != 0) && ((*Parse)(unsafe.Pointer(pParse)).FpNewTable != 0) { var z uintptr = (*Parse)(unsafe.Pointer(pParse)).FsArg.Fz var n int32 = int32((*Parse)(unsafe.Pointer(pParse)).FsArg.Fn) @@ -121017,7 +122996,7 @@ func addArgumentToVtab(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:140002:13: // The parser calls this routine after the CREATE VIRTUAL TABLE statement // has been completely parsed. -func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* sqlite3.c:140015:21: */ +func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* sqlite3.c:142301:21: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -121051,7 +123030,7 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s if pEnd != 0 { (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fn = (uint32((int32((int64((*Token)(unsafe.Pointer(pEnd)).Fz) - int64((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) / 1))) + (*Token)(unsafe.Pointer(pEnd)).Fn) } - zStmt = Xsqlite3MPrintf(tls, db, ts+18569 /* "CREATE VIRTUAL T..." */, libc.VaList(bp, (pParse+248 /* &.sNameToken */))) + zStmt = Xsqlite3MPrintf(tls, db, ts+19057 /* "CREATE VIRTUAL T..." */, libc.VaList(bp, (pParse+240 /* &.sNameToken */))) // A slot for the record has already been allocated in the // schema table. We just need to update that slot with all @@ -121063,7 +123042,7 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) Xsqlite3NestedParse(tls, pParse, - ts+18593, /* "UPDATE %Q.sqlite..." */ + ts+19081, /* "UPDATE %Q.sqlite..." */ libc.VaList(bp+8, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName, (*Table)(unsafe.Pointer(pTab)).FzName, @@ -121073,8 +123052,8 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s Xsqlite3ChangeCookie(tls, pParse, iDb) Xsqlite3VdbeAddOp0(tls, v, OP_Expire) - zWhere = Xsqlite3MPrintf(tls, db, ts+18692 /* "name=%Q AND sql=..." */, libc.VaList(bp+48, (*Table)(unsafe.Pointer(pTab)).FzName, zStmt)) - Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere) + zWhere = Xsqlite3MPrintf(tls, db, ts+19180 /* "name=%Q AND sql=..." */, libc.VaList(bp+48, (*Table)(unsafe.Pointer(pTab)).FzName, zStmt)) + Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) Xsqlite3DbFree(tls, db, zStmt) iReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) @@ -121097,7 +123076,7 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s // 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 Xsqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:140101:21: */ +func Xsqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:142387:21: */ addArgumentToVtab(tls, pParse) (*Parse)(unsafe.Pointer(pParse)).FsArg.Fz = uintptr(0) (*Parse)(unsafe.Pointer(pParse)).FsArg.Fn = uint32(0) @@ -121105,8 +123084,8 @@ func Xsqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:140101:21 // 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 Xsqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:140111:21: */ - var pArg uintptr = (pParse + 360 /* &.sArg */) +func Xsqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:142397:21: */ + var pArg uintptr = (pParse + 352 /* &.sArg */) if (*Token)(unsafe.Pointer(pArg)).Fz == uintptr(0) { (*Token)(unsafe.Pointer(pArg)).Fz = (*Token)(unsafe.Pointer(p)).Fz (*Token)(unsafe.Pointer(pArg)).Fn = (*Token)(unsafe.Pointer(p)).Fn @@ -121119,7 +123098,7 @@ func Xsqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite // 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 *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) int32 { /* sqlite3.c:140127:12: */ +func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) int32 { /* sqlite3.c:142413:12: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -121138,7 +123117,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, for pCtx = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx; pCtx != 0; pCtx = (*VtabCtx)(unsafe.Pointer(pCtx)).FpPrior { if (*VtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, - ts+18711 /* "vtable construct..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + ts+19199 /* "vtable construct..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) return SQLITE_LOCKED } } @@ -121156,7 +123135,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } (*VTable)(unsafe.Pointer(pVTable)).Fdb = db (*VTable)(unsafe.Pointer(pVTable)).FpMod = pMod - (*VTable)(unsafe.Pointer(pVTable)).FeVtabRisk = SQLITE_VTABRISK_Normal + (*VTable)(unsafe.Pointer(pVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_Normal) iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg + 1*8)) = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName @@ -121176,9 +123155,9 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+18753 /* "vtable construct..." */, libc.VaList(bp+8, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+19241 /* "vtable construct..." */, libc.VaList(bp+8, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+2690 /* "%s" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+2718 /* "%s" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */))) } Xsqlite3DbFree(tls, db, pVTable) @@ -121190,7 +123169,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*Module)(unsafe.Pointer(pMod)).FnRefModule++ (*VTable)(unsafe.Pointer(pVTable)).FnRef = 1 if (*VtabCtx)(unsafe.Pointer(bp+32 /* &sCtx */)).FbDeclared == 0 { - var zFormat uintptr = ts + 18783 /* "vtable construct..." */ + var zFormat uintptr = ts + 19271 /* "vtable construct..." */ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+24, (*Table)(unsafe.Pointer(pTab)).FzName)) Xsqlite3VtabUnlock(tls, pVTable) rc = SQLITE_ERROR @@ -121211,7 +123190,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, var i int32 = 0 nType = Xsqlite3Strlen30(tls, zType) for i = 0; i < nType; i++ { - if ((0 == Xsqlite3_strnicmp(tls, ts+13778 /* "hidden" */, (zType+uintptr(i)), 6)) && + if ((0 == Xsqlite3_strnicmp(tls, ts+14207 /* "hidden" */, (zType+uintptr(i)), 6)) && ((i == 0) || (int32(*(*int8)(unsafe.Pointer(zType + uintptr((i - 1))))) == ' '))) && ((int32(*(*int8)(unsafe.Pointer(zType + uintptr((i + 6))))) == 0) || (int32(*(*int8)(unsafe.Pointer(zType + uintptr((i + 6))))) == ' ')) { break @@ -121233,7 +123212,8 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, *(*int8)(unsafe.Pointer(zType + uintptr((i - 1)))) = int8(0) } *(*U16)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32 + 28 /* &.colFlags */)) |= U16((COLFLAG_HIDDEN)) - oooHidden = TF_OOOHidden + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_HasHidden)) + oooHidden = U16(TF_OOOHidden) } else { *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(oooHidden)) } @@ -121250,7 +123230,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, // and an error left in pParse. // // This call is a no-op if table pTab is not a virtual table. -func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:140259:20: */ +func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:142546:20: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -121265,17 +123245,17 @@ func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 // Locate the required virtual table module zMod = *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg)) - pMod = Xsqlite3HashFind(tls, (db + 528 /* &.aModule */), zMod) + pMod = Xsqlite3HashFind(tls, (db + 536 /* &.aModule */), zMod) if !(pMod != 0) { var zModule uintptr = *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg)) - Xsqlite3ErrorMsg(tls, pParse, ts+18829 /* "no such module: ..." */, libc.VaList(bp, zModule)) + Xsqlite3ErrorMsg(tls, pParse, ts+19317 /* "no such module: ..." */, libc.VaList(bp, zModule)) rc = SQLITE_ERROR } else { *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)) = uintptr(0) rc = vtabCallConstructor(tls, db, pTab, pMod, (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp+16 /* &zErr */) if rc != SQLITE_OK { - Xsqlite3ErrorMsg(tls, pParse, ts+2690 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)))) + Xsqlite3ErrorMsg(tls, pParse, ts+2718 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)))) (*Parse)(unsafe.Pointer(pParse)).Frc = rc } Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */))) @@ -121286,7 +123266,7 @@ func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 // 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 *libc.TLS, db uintptr) int32 { /* sqlite3.c:140294:12: */ +func growVTrans(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:142581:12: */ var ARRAY_INCR int32 = 5 // Grow the sqlite3.aVTrans array if required @@ -121306,7 +123286,7 @@ func growVTrans(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140294:12: */ // Add the virtual table pVTab to the array sqlite3.aVTrans[]. Space should // have already been reserved using growVTrans(). -func addToVTrans(tls *libc.TLS, db uintptr, pVTab uintptr) { /* sqlite3.c:140317:13: */ +func addToVTrans(tls *libc.TLS, db uintptr, pVTab uintptr) { /* sqlite3.c:142604:13: */ // Add pVtab to the end of sqlite3.aVTrans *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaVTrans + uintptr(libc.PostIncInt32(&(*Sqlite3)(unsafe.Pointer(db)).FnVTrans, 1))*8)) = pVTab Xsqlite3VtabLock(tls, pVTab) @@ -121318,7 +123298,7 @@ func addToVTrans(tls *libc.TLS, db uintptr, pVTab uintptr) { /* sqlite3.c:140317 // 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 Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:140331:20: */ +func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:142618:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -121331,13 +123311,13 @@ func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, // Locate the required virtual table module zMod = *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg)) - pMod = Xsqlite3HashFind(tls, (db + 528 /* &.aModule */), zMod) + pMod = Xsqlite3HashFind(tls, (db + 536 /* &.aModule */), zMod) // If the module has been registered and includes a Create method, // invoke it now. If the module has not been registered, return an // error. Otherwise, do nothing. if ((pMod == uintptr(0)) || ((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0))) || ((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0)) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+18829 /* "no such module: ..." */, libc.VaList(bp, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+19317 /* "no such module: ..." */, libc.VaList(bp, zMod)) rc = SQLITE_ERROR } else { rc = vtabCallConstructor(tls, db, pTab, pMod, (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -121358,30 +123338,30 @@ func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, // 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 *libc.TLS, db uintptr, zCreateTable uintptr) int32 { /* sqlite3.c:140372:16: */ - bp := tls.Alloc(440) - defer tls.Free(440) +func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int32 { /* sqlite3.c:142659:16: */ + bp := tls.Alloc(424) + defer tls.Free(424) var pCtx uintptr var rc int32 = SQLITE_OK var pTab uintptr - *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */)) = uintptr(0) - // var sParse Parse at bp+8, 424 + *(*uintptr)(unsafe.Pointer(bp + 416 /* zErr */)) = uintptr(0) + // var sParse Parse at bp+8, 408 Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || ((*VtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0) { Xsqlite3Error(tls, db, SQLITE_MISUSE) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - return Xsqlite3MisuseError(tls, 140389) + return Xsqlite3MisuseError(tls, 142676) } pTab = (*VtabCtx)(unsafe.Pointer(pCtx)).FpTab libc.Xmemset(tls, bp+8 /* &sParse */, 0, uint64(unsafe.Sizeof(Parse{}))) - (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = PARSE_MODE_DECLARE_VTAB + (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = U8(PARSE_MODE_DECLARE_VTAB) (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).Fdb = db (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FnQueryLoop = U32(1) - if ((((SQLITE_OK == Xsqlite3RunParser(tls, bp+8 /* &sParse */, zCreateTable, bp+432 /* &zErr */)) && + if ((((SQLITE_OK == Xsqlite3RunParser(tls, bp+8 /* &sParse */, zCreateTable, bp+416 /* &zErr */)) && ((*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpNewTable != 0)) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0)) && !(int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpNewTable)).FpSelect) != 0)) && @@ -121390,12 +123370,12 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3 var pNew uintptr = (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FpNewTable var pIdx uintptr (*Table)(unsafe.Pointer(pTab)).FaCol = (*Table)(unsafe.Pointer(pNew)).FaCol - (*Table)(unsafe.Pointer(pTab)).FnCol = (*Table)(unsafe.Pointer(pNew)).FnCol + (*Table)(unsafe.Pointer(pTab)).FnNVCol = libc.AssignPtrInt16(pTab+70 /* &.nCol */, (*Table)(unsafe.Pointer(pNew)).FnCol) *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= ((*Table)(unsafe.Pointer(pNew)).FtabFlags & (U32(TF_WithoutRowid | TF_NoVisibleRowid))) (*Table)(unsafe.Pointer(pNew)).FnCol = int16(0) (*Table)(unsafe.Pointer(pNew)).FaCol = uintptr(0) - if (!(((*Table)(unsafe.Pointer((pNew))).FtabFlags & TF_WithoutRowid) == U32(0)) && + if (!(((*Table)(unsafe.Pointer((pNew))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(pCtx)).FpVTable)).FpMod)).FpModule)).FxUpdate != uintptr(0))) && (int32((*Index)(unsafe.Pointer(Xsqlite3PrimaryKeyIndex(tls, pNew))).FnKeyCol) != 1) { // WITHOUT ROWID virtual tables must either be read-only (xUpdate==0) @@ -121413,15 +123393,15 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3 (*VtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = 1 } else { Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, func() uintptr { - if *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */)) != 0 { - return ts + 2690 /* "%s" */ + if *(*uintptr)(unsafe.Pointer(bp + 416 /* zErr */)) != 0 { + return ts + 2718 /* "%s" */ } return uintptr(0) - }(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */)))) - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */))) + }(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 416 /* zErr */)))) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 416 /* zErr */))) rc = SQLITE_ERROR } - (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = PARSE_MODE_NORMAL + (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = U8(PARSE_MODE_NORMAL) if (*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpVdbe != 0 { Xsqlite3VdbeFinalize(tls, (*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpVdbe) @@ -121439,7 +123419,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3 // when a DROP TABLE is mentioned. // // This call is a no-op if zTab is not a virtual table. -func Xsqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) int32 { /* sqlite3.c:140457:20: */ +func Xsqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) int32 { /* sqlite3.c:142744:20: */ var rc int32 = SQLITE_OK var pTab uintptr @@ -121480,7 +123460,7 @@ func Xsqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) // the offset of the method to call in the sqlite3_module structure. // // The array is cleared after invoking the callbacks. -func callFinaliser(tls *libc.TLS, db uintptr, offset int32) { /* sqlite3.c:140498:13: */ +func callFinaliser(tls *libc.TLS, db uintptr, offset int32) { /* sqlite3.c:142785:13: */ var i int32 if (*Sqlite3)(unsafe.Pointer(db)).FaVTrans != 0 { var aVTrans uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaVTrans @@ -121508,7 +123488,7 @@ func callFinaliser(tls *libc.TLS, db uintptr, offset int32) { /* sqlite3.c:14049 // SQLITE_OK if all xSync operations are successful. // // If an error message is available, leave it in p->zErrMsg. -func Xsqlite3VtabSync(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:140526:20: */ +func Xsqlite3VtabSync(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:142813:20: */ var i int32 var rc int32 = SQLITE_OK var aVTrans uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaVTrans @@ -121528,14 +123508,14 @@ func Xsqlite3VtabSync(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c // Invoke the xRollback method of all virtual tables in the // sqlite3.aVTrans array. Then clear the array itself. -func Xsqlite3VtabRollback(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140548:20: */ +func Xsqlite3VtabRollback(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:142835:20: */ callFinaliser(tls, db, int32((uintptr(0) + 136 /* &.xRollback */))) return SQLITE_OK } // Invoke the xCommit method of all virtual tables in the // sqlite3.aVTrans array. Then clear the array itself. -func Xsqlite3VtabCommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140557:20: */ +func Xsqlite3VtabCommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:142844:20: */ callFinaliser(tls, db, int32((uintptr(0) + 128 /* &.xCommit */))) return SQLITE_OK } @@ -121546,7 +123526,7 @@ func Xsqlite3VtabCommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140557:2 // // If the xBegin call is successful, place the sqlite3_vtab pointer // in the sqlite3.aVTrans array. -func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32 { /* sqlite3.c:140570:20: */ +func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32 { /* sqlite3.c:142857:20: */ var rc int32 = SQLITE_OK var pModule uintptr @@ -121603,7 +123583,7 @@ func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32 { /* sqli // 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 Xsqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:140630:20: */ +func Xsqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:142917:20: */ var rc int32 = SQLITE_OK if (*Sqlite3)(unsafe.Pointer(db)).FaVTrans != 0 { @@ -121649,7 +123629,7 @@ func Xsqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32 // 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 Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg int32, pExpr uintptr) uintptr { /* sqlite3.c:140678:24: */ +func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg int32, pExpr uintptr) uintptr { /* sqlite3.c:142965:24: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -121705,7 +123685,7 @@ func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg libc.Xmemcpy(tls, (pNew + 1*72), (*FuncDef)(unsafe.Pointer(pDef)).FzName, (uint64(Xsqlite3Strlen30(tls, (*FuncDef)(unsafe.Pointer(pDef)).FzName) + 1))) (*FuncDef)(unsafe.Pointer(pNew)).FxSFunc = *(*uintptr)(unsafe.Pointer(bp /* xSFunc */)) (*FuncDef)(unsafe.Pointer(pNew)).FpUserData = *(*uintptr)(unsafe.Pointer(bp + 8 /* pArg */)) - *(*U32)(unsafe.Pointer(pNew + 4 /* &.funcFlags */)) |= (SQLITE_FUNC_EPHEM) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.funcFlags */)) |= (U32(SQLITE_FUNC_EPHEM)) return pNew } @@ -121713,7 +123693,7 @@ func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg // 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 Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:140747:21: */ +func Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:143034:21: */ var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -121751,7 +123731,7 @@ func Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* // // Any virtual table module for which xConnect and xCreate are the same // method can have an eponymous virtual table instance. -func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) int32 { /* sqlite3.c:140780:20: */ +func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) int32 { /* sqlite3.c:143067:20: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -121785,7 +123765,7 @@ func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) addModuleArgument(tls, pParse, pTab, Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pTab)).FzName)) rc = vtabCallConstructor(tls, db, pTab, pMod, (*Sqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp+8 /* &zErr */) if rc != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+2690 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */)))) + Xsqlite3ErrorMsg(tls, pParse, ts+2718 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */)))) Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */))) Xsqlite3VtabEponymousTableClear(tls, db, pMod) return 0 @@ -121795,13 +123775,13 @@ func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) // Erase the eponymous virtual table instance associated with // virtual table module pMod, if it exists. -func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:140817:21: */ +func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:143104:21: */ var pTab uintptr = (*Module)(unsafe.Pointer(pMod)).FpEpoTab if pTab != uintptr(0) { // Mark the table as Ephemeral prior to deleting it, so that the // sqlite3DeleteTable() routine will know that it is not stored in // the schema. - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_Ephemeral) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral)) Xsqlite3DeleteTable(tls, db, pTab) (*Module)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) } @@ -121812,19 +123792,19 @@ func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) { // // The results of this routine are undefined unless it is called from // within an xUpdate method. -func Xsqlite3_vtab_on_conflict(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140836:16: */ +func Xsqlite3_vtab_on_conflict(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:143123:16: */ return int32(aMap[(int32((*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict) - 1)]) } var aMap = [5]uint8{ - SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE, -} /* sqlite3.c:140837:30 */ + uint8(SQLITE_ROLLBACK), uint8(SQLITE_ABORT), uint8(SQLITE_FAIL), uint8(SQLITE_IGNORE), uint8(SQLITE_REPLACE), +} /* sqlite3.c:143124:30 */ // 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 *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:140854:16: */ +func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:143141:16: */ var ap Va_list _ = ap var rc int32 = SQLITE_OK @@ -121833,7 +123813,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = Xsqlite3MisuseError(tls, 140865) + rc = Xsqlite3MisuseError(tls, 143152) } else { ap = va @@ -121847,21 +123827,21 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 fallthrough case SQLITE_VTAB_INNOCUOUS: { - (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = SQLITE_VTABRISK_Low + (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_Low) break } fallthrough case SQLITE_VTAB_DIRECTONLY: { - (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = SQLITE_VTABRISK_High + (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_High) break } fallthrough default: { - rc = Xsqlite3MisuseError(tls, 140883) + rc = Xsqlite3MisuseError(tls, 143170) break } @@ -121913,8 +123893,6 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 // planner logic in "where.c". These definitions are broken out into // a separate source file for easier editing. -// Trace output macros - // Forward references type WhereClause1 = struct { FpWInfo uintptr @@ -121927,7 +123905,7 @@ type WhereClause1 = struct { _ [4]byte Fa uintptr FaStatic [8]WhereTerm -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ //************* End of vtab.c *********************************************** //************* Begin file wherecode.c ************************************** @@ -121966,26 +123944,24 @@ type WhereClause1 = struct { // planner logic in "where.c". These definitions are broken out into // a separate source file for easier editing. -// Trace output macros - // Forward references -type WhereClause = WhereClause1 /* sqlite3.c:140956:28 */ +type WhereClause = WhereClause1 /* sqlite3.c:143230:28 */ type WhereMaskSet1 = struct { FbVarSelect int32 Fn int32 Fix [64]int32 -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ -type WhereMaskSet = WhereMaskSet1 /* sqlite3.c:140957:29 */ +type WhereMaskSet = WhereMaskSet1 /* sqlite3.c:143231:29 */ type WhereOrInfo1 = struct { Fwc WhereClause Findexable Bitmask -} /* sqlite3.c:140958:9 */ +} /* sqlite3.c:143232:9 */ -type WhereOrInfo = WhereOrInfo1 /* sqlite3.c:140958:28 */ -type WhereAndInfo1 = struct{ Fwc WhereClause } /* sqlite3.c:140959:9 */ +type WhereOrInfo = WhereOrInfo1 /* sqlite3.c:143232:28 */ +type WhereAndInfo1 = struct{ Fwc WhereClause } /* sqlite3.c:143233:9 */ -type WhereAndInfo = WhereAndInfo1 /* sqlite3.c:140959:29 */ +type WhereAndInfo = WhereAndInfo1 /* sqlite3.c:143233:29 */ type WhereLevel1 = struct { FiLeftJoin int32 FiTabCur int32 @@ -122013,9 +123989,9 @@ type WhereLevel1 = struct { } FpWLoop uintptr FnotReady Bitmask -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ -type WhereLevel = WhereLevel1 /* sqlite3.c:140960:27 */ +type WhereLevel = WhereLevel1 /* sqlite3.c:143234:27 */ type WhereLoop1 = struct { Fprereq Bitmask FmaskSelf Bitmask @@ -122041,9 +124017,9 @@ type WhereLoop1 = struct { FaLTerm uintptr FpNextLoop uintptr FaLTermSpace [3]uintptr -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ -type WhereLoop = WhereLoop1 /* sqlite3.c:140961:26 */ +type WhereLoop = WhereLoop1 /* sqlite3.c:143235:26 */ type WherePath1 = struct { FmaskLoop Bitmask FrevLoop Bitmask @@ -122053,9 +124029,9 @@ type WherePath1 = struct { FisOrdered I8 _ [1]byte FaLoop uintptr -} /* sqlite3.c:140962:9 */ +} /* sqlite3.c:143236:9 */ -type WherePath = WherePath1 /* sqlite3.c:140962:26 */ +type WherePath = WherePath1 /* sqlite3.c:143236:26 */ type WhereTerm1 = struct { FpExpr uintptr FpWC uintptr @@ -122066,18 +124042,18 @@ type WhereTerm1 = struct { FeMatchOp U8 FiParent int32 FleftCursor int32 - FiField int32 - _ [4]byte Fu struct { - _ [0]uint64 - FleftColumn int32 - _ [4]byte + _ [0]uint64 + Fx struct { + FleftColumn int32 + FiField int32 + } } FprereqRight Bitmask FprereqAll Bitmask -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ -type WhereTerm = WhereTerm1 /* sqlite3.c:140963:26 */ +type WhereTerm = WhereTerm1 /* sqlite3.c:143237:26 */ type WhereLoopBuilder1 = struct { FpWInfo uintptr FpWC uintptr @@ -122091,9 +124067,9 @@ type WhereLoopBuilder1 = struct { _ [2]byte FiPlanLimit uint32 _ [4]byte -} /* sqlite3.c:140964:9 */ +} /* sqlite3.c:143238:9 */ -type WhereLoopBuilder = WhereLoopBuilder1 /* sqlite3.c:140964:33 */ +type WhereLoopBuilder = WhereLoopBuilder1 /* sqlite3.c:143238:33 */ type WhereScan1 = struct { FpOrigWC uintptr FpWC uintptr @@ -122108,24 +124084,24 @@ type WhereScan1 = struct { FaiCur [11]int32 FaiColumn [11]I16 _ [2]byte -} /* sqlite3.c:140965:9 */ +} /* sqlite3.c:143239:9 */ -type WhereScan = WhereScan1 /* sqlite3.c:140965:26 */ +type WhereScan = WhereScan1 /* sqlite3.c:143239:26 */ type WhereOrCost1 = struct { Fprereq Bitmask FrRun LogEst FnOut LogEst _ [4]byte -} /* sqlite3.c:140964:9 */ +} /* sqlite3.c:143238:9 */ -type WhereOrCost = WhereOrCost1 /* sqlite3.c:140966:28 */ +type WhereOrCost = WhereOrCost1 /* sqlite3.c:143240:28 */ type WhereOrSet1 = struct { Fn U16 _ [6]byte Fa [3]WhereOrCost -} /* sqlite3.c:140964:9 */ +} /* sqlite3.c:143238:9 */ -type WhereOrSet = WhereOrSet1 /* sqlite3.c:140967:27 */ +type WhereOrSet = WhereOrSet1 /* sqlite3.c:143241:27 */ // This object contains information needed to implement a single nested // loop in WHERE clause. @@ -122147,7 +124123,7 @@ type InLoop = struct { FnPrefix int32 FeEndLoopOp U8 _ [3]byte -} /* sqlite3.c:141006:7 */ +} /* sqlite3.c:143280:7 */ // Allowed values for WhereLoopBuider.bldFlags @@ -122173,7 +124149,7 @@ type WhereExprMod1 = struct { FpNext uintptr FpExpr uintptr Forig Expr -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ // Allowed values for WhereLoopBuider.bldFlags @@ -122195,7 +124171,7 @@ type WhereExprMod1 = struct { // of an index rather than an expression or a virtual column. All // such transformations need to be undone at the end of WHERE clause // processing. -type WhereExprMod = WhereExprMod1 /* sqlite3.c:141372:29 */ +type WhereExprMod = WhereExprMod1 /* sqlite3.c:143644:29 */ // Bitmasks for the operators on WhereTerm objects. These are all // operators that are of interest to the query planner. An @@ -122217,13 +124193,13 @@ type WhereExprMod = WhereExprMod1 /* sqlite3.c:141372:29 */ //************* Continuing where we left off in wherecode.c ***************** // Return the name of the i-th column of the pIdx index. -func explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) uintptr { /* sqlite3.c:141550:19: */ +func explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) uintptr { /* sqlite3.c:143824:19: */ i = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == (-2) { - return ts + 18848 /* "" */ + return ts + 19336 /* "" */ } if i == (-1) { - return ts + 13865 /* "rowid" */ + return ts + 14294 /* "rowid" */ } return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*32)).FzName } @@ -122234,39 +124210,39 @@ func explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) uintptr { /* s // 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 *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, iTerm int32, bAnd int32, zOp uintptr) { /* sqlite3.c:141565:13: */ +func explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, iTerm int32, bAnd int32, zOp uintptr) { /* sqlite3.c:143839:13: */ var i int32 if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, ts+18855 /* " AND " */, 5) + Xsqlite3_str_append(tls, pStr, ts+19343 /* " AND " */, 5) } if nTerm > 1 { - Xsqlite3_str_append(tls, pStr, ts+18861 /* "(" */, 1) + Xsqlite3_str_append(tls, pStr, ts+19349 /* "(" */, 1) } for i = 0; i < nTerm; i++ { if i != 0 { - Xsqlite3_str_append(tls, pStr, ts+10660 /* "," */, 1) + Xsqlite3_str_append(tls, pStr, ts+11076 /* "," */, 1) } Xsqlite3_str_appendall(tls, pStr, explainIndexColumnName(tls, pIdx, (iTerm+i))) } if nTerm > 1 { - Xsqlite3_str_append(tls, pStr, ts+3907 /* ")" */, 1) + Xsqlite3_str_append(tls, pStr, ts+3935 /* ")" */, 1) } Xsqlite3_str_append(tls, pStr, zOp, 1) if nTerm > 1 { - Xsqlite3_str_append(tls, pStr, ts+18861 /* "(" */, 1) + Xsqlite3_str_append(tls, pStr, ts+19349 /* "(" */, 1) } for i = 0; i < nTerm; i++ { if i != 0 { - Xsqlite3_str_append(tls, pStr, ts+10660 /* "," */, 1) + Xsqlite3_str_append(tls, pStr, ts+11076 /* "," */, 1) } - Xsqlite3_str_append(tls, pStr, ts+3963 /* "?" */, 1) + Xsqlite3_str_append(tls, pStr, ts+3991 /* "?" */, 1) } if nTerm > 1 { - Xsqlite3_str_append(tls, pStr, ts+3907 /* ")" */, 1) + Xsqlite3_str_append(tls, pStr, ts+3935 /* ")" */, 1) } } @@ -122282,7 +124258,7 @@ func explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i // string similar to: // // "a=? AND b>?" -func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3.c:141609:13: */ +func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3.c:143883:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -122295,29 +124271,29 @@ func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3. if (int32(nEq) == 0) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_BTM_LIMIT | WHERE_TOP_LIMIT))) == U32(0)) { return } - Xsqlite3_str_append(tls, pStr, ts+18863 /* " (" */, 2) + Xsqlite3_str_append(tls, pStr, ts+19351 /* " (" */, 2) for i = 0; i < int32(nEq); i++ { var z uintptr = explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, ts+18855 /* " AND " */, 5) + Xsqlite3_str_append(tls, pStr, ts+19343 /* " AND " */, 5) } Xsqlite3_str_appendf(tls, pStr, func() uintptr { if i >= int32(nSkip) { - return ts + 18866 /* "%s=?" */ + return ts + 19354 /* "%s=?" */ } - return ts + 18871 /* "ANY(%s)" */ + return ts + 19359 /* "ANY(%s)" */ }(), libc.VaList(bp, z)) } j = i - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BTM_LIMIT) != 0 { - explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */))), j, i, ts+18879 /* ">" */) + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { + explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */))), j, i, ts+19367 /* ">" */) i = 1 } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_TOP_LIMIT) != 0 { - explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */))), j, i, ts+18881 /* "<" */) + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 { + explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */))), j, i, ts+19369 /* "<" */) } - Xsqlite3_str_append(tls, pStr, ts+3907 /* ")" */, 1) + Xsqlite3_str_append(tls, pStr, ts+3935 /* ")" */, 1) } // This function is a no-op unless currently processing an EXPLAIN QUERY PLAN @@ -122327,7 +124303,7 @@ func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3. // // 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 Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr, pLevel uintptr, wctrlFlags U16) int32 { /* sqlite3.c:141643:20: */ +func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr, pLevel uintptr, wctrlFlags U16) int32 { /* sqlite3.c:143917:20: */ bp := tls.Alloc(188) defer tls.Free(188) @@ -122352,29 +124328,29 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop flags = (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags - if ((flags & WHERE_MULTI_OR) != 0) || ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0) { + if ((flags & U32(WHERE_MULTI_OR)) != 0) || ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0) { return 0 } isSearch = (libc.Bool32((((flags & (U32(WHERE_BTM_LIMIT | WHERE_TOP_LIMIT))) != U32(0)) || - (((flags & WHERE_VIRTUALTABLE) == U32(0)) && (int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) > 0))) || + (((flags & U32(WHERE_VIRTUALTABLE)) == U32(0)) && (int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) > 0))) || ((int32(wctrlFlags) & (WHERE_ORDERBY_MIN | WHERE_ORDERBY_MAX)) != 0))) Xsqlite3StrAccumInit(tls, bp+56 /* &str */, db, bp+88 /* &zBuf[0] */, int32(unsafe.Sizeof([100]int8{})), SQLITE_MAX_LENGTH) Xsqlite3_str_appendall(tls, bp+56 /* &str */, func() uintptr { if isSearch != 0 { - return ts + 18883 /* "SEARCH" */ + return ts + 19371 /* "SEARCH" */ } - return ts + 18890 /* "SCAN" */ + return ts + 19378 /* "SCAN" */ }()) - if (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0 { - Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+18895 /* " SUBQUERY %u" */, libc.VaList(bp, (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselId)) + if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 { + Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+19383 /* " SUBQUERY %u" */, libc.VaList(bp, (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselId)) } else { - Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+18908 /* " TABLE %s" */, libc.VaList(bp+8, (*SrcList_item)(unsafe.Pointer(pItem)).FzName)) + Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+19396 /* " TABLE %s" */, libc.VaList(bp+8, (*SrcItem)(unsafe.Pointer(pItem)).FzName)) } - if (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias != 0 { - Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+18918 /* " AS %s" */, libc.VaList(bp+16, (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias)) + if (*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 { + Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+19406 /* " AS %s" */, libc.VaList(bp+16, (*SrcItem)(unsafe.Pointer(pItem)).FzAlias)) } if (flags & (U32(WHERE_IPK | WHERE_VIRTUALTABLE))) == U32(0) { var zFmt uintptr = uintptr(0) @@ -122382,40 +124358,40 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) - if !(((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer(pItem)).FpTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + if !(((*Table)(unsafe.Pointer(((*SrcItem)(unsafe.Pointer(pItem)).FpTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = ts + 18925 /* "PRIMARY KEY" */ + zFmt = ts + 9256 /* "PRIMARY KEY" */ } - } else if (flags & WHERE_PARTIALIDX) != 0 { - zFmt = ts + 18937 /* "AUTOMATIC PARTIA..." */ - } else if (flags & WHERE_AUTO_INDEX) != 0 { - zFmt = ts + 18970 /* "AUTOMATIC COVERI..." */ - } else if (flags & WHERE_IDX_ONLY) != 0 { - zFmt = ts + 18995 /* "COVERING INDEX %..." */ + } else if (flags & U32(WHERE_PARTIALIDX)) != 0 { + zFmt = ts + 19413 /* "AUTOMATIC PARTIA..." */ + } else if (flags & U32(WHERE_AUTO_INDEX)) != 0 { + zFmt = ts + 19446 /* "AUTOMATIC COVERI..." */ + } else if (flags & U32(WHERE_IDX_ONLY)) != 0 { + zFmt = ts + 19471 /* "COVERING INDEX %..." */ } else { - zFmt = ts + 19013 /* "INDEX %s" */ + zFmt = ts + 19489 /* "INDEX %s" */ } if zFmt != 0 { - Xsqlite3_str_append(tls, bp+56 /* &str */, ts+19022 /* " USING " */, 7) + Xsqlite3_str_append(tls, bp+56 /* &str */, ts+19498 /* " USING " */, 7) Xsqlite3_str_appendf(tls, bp+56 /* &str */, zFmt, libc.VaList(bp+24, (*Index)(unsafe.Pointer(pIdx)).FzName)) explainIndexRange(tls, bp+56 /* &str */, pLoop) } - } else if ((flags & WHERE_IPK) != U32(0)) && ((flags & WHERE_CONSTRAINT) != U32(0)) { + } else if ((flags & U32(WHERE_IPK)) != U32(0)) && ((flags & U32(WHERE_CONSTRAINT)) != U32(0)) { var zRangeOp uintptr if (flags & (U32(WHERE_COLUMN_EQ | WHERE_COLUMN_IN))) != 0 { - zRangeOp = ts + 19030 /* "=" */ - } else if (flags & WHERE_BOTH_LIMIT) == WHERE_BOTH_LIMIT { - zRangeOp = ts + 19032 /* ">? AND rowid<" */ - } else if (flags & WHERE_BTM_LIMIT) != 0 { - zRangeOp = ts + 18879 /* ">" */ + zRangeOp = ts + 19506 /* "=" */ + } else if (flags & U32(WHERE_BOTH_LIMIT)) == U32(WHERE_BOTH_LIMIT) { + zRangeOp = ts + 19508 /* ">? AND rowid<" */ + } else if (flags & U32(WHERE_BTM_LIMIT)) != 0 { + zRangeOp = ts + 19367 /* ">" */ } else { - zRangeOp = ts + 18881 /* "<" */ + zRangeOp = ts + 19369 /* "<" */ } Xsqlite3_str_appendf(tls, bp+56, /* &str */ - ts+19046 /* " USING INTEGER P..." */, libc.VaList(bp+32, zRangeOp)) - } else if (flags & WHERE_VIRTUALTABLE) != U32(0) { - Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+19084, /* " VIRTUAL TABLE I..." */ + ts+19522 /* " USING INTEGER P..." */, libc.VaList(bp+32, zRangeOp)) + } else if (flags & U32(WHERE_VIRTUALTABLE)) != U32(0) { + Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+19560, /* " VIRTUAL TABLE I..." */ libc.VaList(bp+40, *(*int32)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ /* &.idxNum */)), *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)))) } zMsg = Xsqlite3StrAccumFinish(tls, bp+56 /* &str */) @@ -122466,11 +124442,11 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr // 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 *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:141818:13: */ +func disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:144092:13: */ var nLoop int32 = 0 for (((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_CODED) == 0) && - (((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0) || (((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)))) && + (((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0) || (((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)))) && (((*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady & (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll) == uint64(0)) { if (nLoop != 0) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_LIKE) != 0) { *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_LIKECOND)) @@ -122480,7 +124456,7 @@ func disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:14 if (*WhereTerm)(unsafe.Pointer(pTerm)).FiParent < 0 { break } - pTerm = ((*WhereClause)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpWC)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pTerm)).FiParent)*64) + pTerm = ((*WhereClause)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpWC)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pTerm)).FiParent)*56) (*WhereTerm)(unsafe.Pointer(pTerm)).FnChild-- if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FnChild) != 0 { @@ -122499,7 +124475,7 @@ func disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:14 // // This routine makes its own copy of zAff so that the caller is free // to modify zAff after this routine returns. -func codeApplyAffinity(tls *libc.TLS, pParse uintptr, base int32, n int32, zAff uintptr) { /* sqlite3.c:141850:13: */ +func codeApplyAffinity(tls *libc.TLS, pParse uintptr, base int32, n int32, zAff uintptr) { /* sqlite3.c:144124:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe if zAff == uintptr(0) { @@ -122532,13 +124508,13 @@ func codeApplyAffinity(tls *libc.TLS, pParse uintptr, base int32, n int32, zAff // // * the comparison will be performed with no affinity, or // * the affinity change in zAff is guaranteed not to change the value. -func updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintptr) { /* sqlite3.c:141887:13: */ +func updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintptr) { /* sqlite3.c:144161:13: */ var i int32 for i = 0; i < n; i++ { var p uintptr = Xsqlite3VectorFieldSubexpr(tls, pRight, i) if (int32(Xsqlite3CompareAffinity(tls, p, *(*int8)(unsafe.Pointer(zAff + uintptr(i))))) == SQLITE_AFF_BLOB) || (Xsqlite3ExprNeedsNoAffinityChange(tls, p, *(*int8)(unsafe.Pointer(zAff + uintptr(i)))) != 0) { - *(*int8)(unsafe.Pointer(zAff + uintptr(i))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(i))) = int8(SQLITE_AFF_BLOB) } } } @@ -122570,7 +124546,7 @@ func updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintptr // The reduced pX is different from the original (obviously) and thus is // only used for indexing, to improve performance. The original unaltered // IN expression must also be run on each output row for correctness. -func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pLoop uintptr, pX uintptr) uintptr { /* sqlite3.c:141933:13: */ +func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pLoop uintptr, pX uintptr) uintptr { /* sqlite3.c:144207:13: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pNew uintptr pNew = Xsqlite3ExprDup(tls, db, pX, 0) @@ -122584,7 +124560,7 @@ func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pL for i = iEq; i < int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm); i++ { if (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX { - var iField int32 = ((*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FiField - 1) + var iField int32 = (*(*int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32 /* &.u */ /* &.x */) + 4 /* &.iField */)) - 1) if (*ExprList_item)(unsafe.Pointer((pOrigRhs+8 /* &.a */)+uintptr(iField)*32)).FpExpr == uintptr(0) { continue } // Duplicate PK column @@ -122640,7 +124616,7 @@ func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pL // 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 *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) int32 { /* sqlite3.c:142015:12: */ +func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) int32 { /* sqlite3.c:144289:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -122663,7 +124639,7 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp var nEq int32 = 0 var aiMap uintptr = uintptr(0) - if ((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0)) && + if ((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0)) && (*(*uintptr)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0))) && (*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)))).FaSortOrder + uintptr(iEq))) != 0) { @@ -122686,15 +124662,15 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp } *(*int32)(unsafe.Pointer(bp /* iTab */)) = 0 - if (((*Expr)(unsafe.Pointer(pX)).Fflags & EP_xIsSelect) == U32(0)) || ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FpEList)).FnExpr == 1) { - eType = Xsqlite3FindInIndex(tls, pParse, pX, IN_INDEX_LOOP, uintptr(0), uintptr(0), bp /* &iTab */) + if (((*Expr)(unsafe.Pointer(pX)).Fflags & U32(EP_xIsSelect)) == U32(0)) || ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FpEList)).FnExpr == 1) { + eType = Xsqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp /* &iTab */) } else { var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb pX = removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { aiMap = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (uint64(uint64(unsafe.Sizeof(int32(0))) * uint64(nEq)))) - eType = Xsqlite3FindInIndex(tls, pParse, pX, IN_INDEX_LOOP, uintptr(0), aiMap, bp /* &iTab */) + eType = Xsqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp /* &iTab */) (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiTable = *(*int32)(unsafe.Pointer(bp /* iTab */)) } Xsqlite3ExprDelete(tls, db, pX) @@ -122712,10 +124688,13 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp return OP_Rewind }(), *(*int32)(unsafe.Pointer(bp /* iTab */)), 0) - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_IN_ABLE) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_IN_ABLE)) if *(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) == 0 { (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt = Xsqlite3VdbeMakeLabel(tls, pParse) } + if (iEq > 0) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_SEEKSCAN)) == U32(0)) { + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_IN_EARLYOUT)) + } i = *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */)) *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */)) += (nEq) @@ -122744,23 +124723,27 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp *(*int32)(unsafe.Pointer(pIn /* &.iCur */)) = *(*int32)(unsafe.Pointer(bp /* iTab */)) *(*U8)(unsafe.Pointer(pIn + 16 /* &.eEndLoopOp */)) = func() uint8 { if bRev != 0 { - return OP_Prev + return uint8(OP_Prev) } - return OP_Next + return uint8(OP_Next) }() if iEq > 0 { *(*int32)(unsafe.Pointer(pIn + 8 /* &.iBase */)) = (iReg - i) *(*int32)(unsafe.Pointer(pIn + 12 /* &.nPrefix */)) = i - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_IN_EARLYOUT) } else { *(*int32)(unsafe.Pointer(pIn + 12 /* &.nPrefix */)) = 0 } } else { - *(*U8)(unsafe.Pointer(pIn + 16 /* &.eEndLoopOp */)) = OP_Noop + *(*U8)(unsafe.Pointer(pIn + 16 /* &.eEndLoopOp */)) = U8(OP_Noop) } pIn += 20 } } + + if (iEq > 0) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_IN_SEEKSCAN | WHERE_VIRTUALTABLE))) == U32(0)) { + Xsqlite3VdbeAddOp3(tls, v, OP_SeekHit, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, 0, iEq) + } } else { *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */)) = 0 } @@ -122813,7 +124796,7 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp // 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 *libc.TLS, pParse uintptr, pLevel uintptr, bRev int32, nExtraReg int32, pzAff uintptr) int32 { /* sqlite3.c:142186:12: */ +func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev int32, nExtraReg int32, pzAff uintptr) int32 { /* sqlite3.c:144470:12: */ var nEq U16 // The number of == or IN constraints to code var nSkip U16 // Number of left-most columns to skip var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // The vm under construction @@ -122883,13 +124866,13 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in } } if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IN) != 0 { - if ((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags & U32(EP_xIsSelect)) != 0 { // No affinity ever needs to be (or should be) applied to a value // from the RHS of an "? IN (SELECT ...)" expression. The // sqlite3FindInIndex() routine has already ensured that the // affinity of the comparison has been applied to the value. if zAff != 0 { - *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB) } } } else if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_ISNULL) == 0 { @@ -122900,10 +124883,10 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in } if zAff != 0 { if int32(Xsqlite3CompareAffinity(tls, pRight, *(*int8)(unsafe.Pointer(zAff + uintptr(j))))) == SQLITE_AFF_BLOB { - *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB) } if Xsqlite3ExprNeedsNoAffinityChange(tls, pRight, *(*int8)(unsafe.Pointer(zAff + uintptr(j)))) != 0 { - *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB) } } } @@ -122928,7 +124911,7 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in // 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 *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, iIdxCur int32) { /* sqlite3.c:142558:13: */ +func codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, iIdxCur int32) { /* sqlite3.c:144842:13: */ var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse // Parse context var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Vdbe to generate code within @@ -122969,10 +124952,10 @@ func codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, i // 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 *libc.TLS, pParse uintptr, p uintptr, iReg int32, nReg int32) { /* sqlite3.c:142602:13: */ +func codeExprOrVector(tls *libc.TLS, pParse uintptr, p uintptr, iReg int32, nReg int32) { /* sqlite3.c:144886:13: */ if (p != 0) && (Xsqlite3ExprIsVector(tls, p) != 0) { - if ((*Expr)(unsafe.Pointer(p)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_xIsSelect)) != 0 { var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var iSelect int32 @@ -122995,10 +124978,10 @@ func codeExprOrVector(tls *libc.TLS, pParse uintptr, p uintptr, iReg int32, nReg // An instance of the IdxExprTrans object carries information about a // mapping from an expression on table columns into a column in an index // down through the Walker. -type IdxExprTrans = IdxExprTrans1 /* sqlite3.c:142640:3 */ +type IdxExprTrans = IdxExprTrans1 /* sqlite3.c:144924:3 */ // Preserve pExpr on the WhereETrans list of the WhereInfo. -func preserveExpr(tls *libc.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:142645:13: */ +func preserveExpr(tls *libc.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:144929:13: */ var pNew uintptr pNew = Xsqlite3DbMallocRaw(tls, (*IdxExprTrans)(unsafe.Pointer(pTrans)).Fdb, uint64(unsafe.Sizeof(WhereExprMod{}))) if pNew == uintptr(0) { @@ -123015,12 +124998,12 @@ func preserveExpr(tls *libc.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:1 // // If pExpr matches, then transform it into a reference to the index column // that contains the value of pExpr. -func whereIndexExprTransNode(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:142661:12: */ +func whereIndexExprTransNode(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:144945:12: */ var pX uintptr = *(*uintptr)(unsafe.Pointer(p + 40 /* &.u */)) if Xsqlite3ExprCompare(tls, uintptr(0), pExpr, (*IdxExprTrans)(unsafe.Pointer(pX)).FpIdxExpr, (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCur) == 0 { preserveExpr(tls, pX, pExpr) (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = Xsqlite3ExprAffinity(tls, pExpr) - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN) (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*IdxExprTrans)(unsafe.Pointer(pX)).FiIdxCur (*Expr)(unsafe.Pointer(pExpr)).FiColumn = YnVar((*IdxExprTrans)(unsafe.Pointer(pX)).FiIdxCol) *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = uintptr(0) @@ -123035,7 +125018,7 @@ func whereIndexExprTransNode(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* // A walker node callback that translates a column reference to a table // into a corresponding column reference of an index. -func whereIndexExprTransColumn(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:142683:12: */ +func whereIndexExprTransColumn(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:144967:12: */ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN { var pX uintptr = *(*uintptr)(unsafe.Pointer(p + 40 /* &.u */)) if ((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCur) && (int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCol) { @@ -123057,7 +125040,7 @@ func whereIndexExprTransColumn(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { // 2019-10-24: Updated to also translate references to a VIRTUAL column in // the table into references to the corresponding (stored) column of the // index. -func whereIndexExprTrans(tls *libc.TLS, pIdx uintptr, iTabCur int32, iIdxCur int32, pWInfo uintptr) { /* sqlite3.c:142708:13: */ +func whereIndexExprTrans(tls *libc.TLS, pIdx uintptr, iTabCur int32, iIdxCur int32, pWInfo uintptr) { /* sqlite3.c:144992:13: */ bp := tls.Alloc(88) defer tls.Free(88) @@ -123121,7 +125104,7 @@ func whereIndexExprTrans(tls *libc.TLS, pIdx uintptr, iTabCur int32, iIdxCur int // WHERE clause terms on the query, and if any of those terms must be // true because pTruth is true, then mark those WHERE clause terms as // coded. -func whereApplyPartialIndexConstraints(tls *libc.TLS, pTruth uintptr, iTabCur int32, pWC uintptr) { /* sqlite3.c:142771:13: */ +func whereApplyPartialIndexConstraints(tls *libc.TLS, pTruth uintptr, iTabCur int32, pWC uintptr) { /* sqlite3.c:145055:13: */ var i int32 var pTerm uintptr for int32((*Expr)(unsafe.Pointer(pTruth)).Fop) == TK_AND { @@ -123148,7 +125131,7 @@ __1: goto __2 __2: i++ - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -123156,7 +125139,7 @@ __3: // Generate code for the start of the iLevel-th loop in the WHERE clause // implementation described by pWInfo. -func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWInfo uintptr, iLevel int32, pLevel uintptr, notReady Bitmask) Bitmask { /* sqlite3.c:142796:24: */ +func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWInfo uintptr, iLevel int32, pLevel uintptr, notReady Bitmask) Bitmask { /* sqlite3.c:145080:24: */ bp := tls.Alloc(96) defer tls.Free(96) @@ -123182,8 +125165,8 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI db = (*Parse)(unsafe.Pointer(pParse)).Fdb pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112) - iCur = (*SrcList_item)(unsafe.Pointer(pTabItem)).FiCursor - (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady = (notReady & ^Xsqlite3WhereGetMask(tls, (pWInfo+656 /* &.sMaskSet */), iCur)) + iCur = (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor + (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady = (notReady & ^Xsqlite3WhereGetMask(tls, (pWInfo+592 /* &.sMaskSet */), iCur)) bRev = (int32(((*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask >> iLevel) & uint64(1))) // Create labels for the "break" and "continue" instructions @@ -123202,7 +125185,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // initialize a memory cell that records if this table matches any // row of the left table of the join. - if (int32((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0) && ((int32((*SrcList_item)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) { + if (int32((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0) && ((int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) { (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin) @@ -123210,18 +125193,18 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // Compute a safe address to jump to if we discover that the table for // this loop is empty and can never contribute content. - for j = iLevel; (j > 0) && ((*WhereLevel)(unsafe.Pointer((pWInfo+920 /* &.a */)+uintptr(j)*88)).FiLeftJoin == 0); j-- { + for j = iLevel; (j > 0) && ((*WhereLevel)(unsafe.Pointer((pWInfo+856 /* &.a */)+uintptr(j)*88)).FiLeftJoin == 0); j-- { } - addrHalt = (*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */) + uintptr(j)*88)).FaddrBrk + addrHalt = (*WhereLevel)(unsafe.Pointer((pWInfo + 856 /* &.a */) + uintptr(j)*88)).FaddrBrk // Special case of a FROM clause subquery implemented as a co-routine if (uint32(int32(*(*uint8)(unsafe.Pointer(pTabItem + 60 /* &.fg */ + 4 /* &.viaCoroutine */)) & 0x10 >> 4))) != 0 { - var regYield int32 = (*SrcList_item)(unsafe.Pointer(pTabItem)).FregReturn - Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, (*SrcList_item)(unsafe.Pointer(pTabItem)).FaddrFillSub) + var regYield int32 = (*SrcItem)(unsafe.Pointer(pTabItem)).FregReturn + Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, (*SrcItem)(unsafe.Pointer(pTabItem)).FaddrFillSub) (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regYield, addrBrk) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Goto - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) != U32(0) { + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Goto) + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0) { // Case 1: The table is a virtual-table. Use the VFilter and VNext // to access the data. var iReg int32 // P3 Value for OP_VFilter @@ -123257,12 +125240,17 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI }()) *(*U8)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) + // An OOM inside of AddOp4(OP_VFilter) instruction above might have freed + // the u.vtab.idxStr. NULL it out to prevent a use-after-free + if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)) = uintptr(0) + } (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = func() uint8 { if (*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass != 0 { - return OP_Noop + return uint8(OP_Noop) } - return OP_VNext + return uint8(OP_VNext) }() (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeCurrentAddr(tls, v) iIn = *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */)) @@ -123315,7 +125303,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // simpler and safer to simply not reuse the registers. // // sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2); - } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IPK) != U32(0)) && + } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != U32(0)) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_COLUMN_IN | WHERE_COLUMN_EQ))) != U32(0)) { // Case 2: We can directly reference a single row using an // equality comparison against the ROWID field. Or @@ -123332,12 +125320,12 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI addrNxt = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, iCur, addrNxt, iRowidReg) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Noop + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop) if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady) == uint64(0) { *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_CODED)) } - } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IPK) != U32(0)) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_COLUMN_RANGE) != U32(0)) { + } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != U32(0)) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != U32(0)) { // Case 3: We have an inequality comparison against the ROWID field. var testOp int32 = OP_Noop var start int32 @@ -123347,10 +125335,10 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI j = 0 pStart = libc.AssignUintptr(&pEnd, uintptr(0)) - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { pStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_TOP_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 { pEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) } @@ -123370,10 +125358,10 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // The following constant maps TK_xx codes into corresponding // seek opcodes. It depends on a particular ordering of TK_xx *(*[4]U8)(unsafe.Pointer(bp + 8 /* aMoveOp */)) = [4]U8{ - /* TK_GT */ OP_SeekGT, - /* TK_LE */ OP_SeekLE, - /* TK_LT */ OP_SeekLT, - /* TK_GE */ OP_SeekGE, + /* TK_GT */ U8(OP_SeekGT), + /* TK_LE */ U8(OP_SeekLE), + /* TK_LT */ U8(OP_SeekLT), + /* TK_GE */ U8(OP_SeekGE), } // Make sure the ordering.. // ... of the TK_xx values... @@ -123434,9 +125422,9 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI start = Xsqlite3VdbeCurrentAddr(tls, v) (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = func() uint8 { if bRev != 0 { - return OP_Prev + return uint8(OP_Prev) } - return OP_Next + return uint8(OP_Next) }() (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start @@ -123448,7 +125436,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI Xsqlite3VdbeChangeP5(tls, v, (uint16(SQLITE_AFF_NUMERIC | SQLITE_JUMPIFNULL))) } - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_INDEXED) != 0 { + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != 0 { var nEq U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)) // Number of == or IN terms var nBtm U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)) // Length of BTM vector var nTop U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) // Length of TOP vector @@ -123469,6 +125457,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI var bStopAtNull U8 = U8(0) // Add condition to terminate at NULLs var omitTable int32 // True if we use the index only var regBignull int32 = 0 // big-null flag register + var addrSeekScan int32 = 0 // Opcode of the OP_SeekScan, if any pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) iIdxCur = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -123476,7 +125465,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // Find any inequality constraint terms for the start and end // of the range. j = int32(nEq) - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { pRangeStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) nExtraReg = func() int32 { if (nExtraReg) > (int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)))) { @@ -123487,7 +125476,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // Like optimization range constraints always occur in pairs } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_TOP_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 { pRangeEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) nExtraReg = func() int32 { if (nExtraReg) > (int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)))) { @@ -123510,7 +125499,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // it is not. For an ASC sort, the non-NULL entries are scanned first. // For DESC, NULL entries are scanned first. if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_TOP_LIMIT | WHERE_BTM_LIMIT))) == U32(0)) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BIGNULL_SORT) != U32(0)) { + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BIGNULL_SORT)) != U32(0)) { nExtraReg = 1 bSeekPastNull = U8(1) @@ -123546,6 +125535,12 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } + if (iLevel > 0) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_SEEKSCAN)) != U32(0)) { + // In case OP_SeekScan is used, ensure that the index cursor does not + // point to a valid row for the first iteration of this loop. + Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, iIdxCur) + } + // Generate code to evaluate all constraint terms using == or IN // and store the values of those terms in an array of registers // starting at regBase. @@ -123604,9 +125599,6 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // above has already left the cursor sitting on the correct row, // so no further seeking is needed } else { - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IN_EARLYOUT) != 0 { - Xsqlite3VdbeAddOp1(tls, v, OP_SeekHit, iIdxCur) - } if regBignull != 0 { Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, regBignull) @@ -123614,6 +125606,20 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI op = int32(aStartOp[(((start_constraints << 2) + (startEq << 1)) + bRev)]) + if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_SEEKSCAN)) != U32(0)) && (op == OP_SeekGE) { + + // TUNING: The OP_SeekScan opcode seeks to reduce the number + // of expensive seek operations by replacing a single seek with + // 1 or more step operations. The question is, how many steps + // should we try before giving up and going with a seek. The cost + // of a seek is proportional to the logarithm of the of the number + // of entries in the tree, so basing the number of steps to try + // on the estimated number of rows in the btree seems like a good + // guess. + addrSeekScan = Xsqlite3VdbeAddOp1(tls, v, OP_SeekScan, + ((int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst))) + 9) / 10)) + + } Xsqlite3VdbeAddOp4Int(tls, v, op, iIdxCur, addrNxt, regBase, nConstraint) if regBignull != 0 { @@ -123674,6 +125680,9 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI op = int32(aEndOp[((bRev * 2) + endEq)]) Xsqlite3VdbeAddOp4Int(tls, v, op, iIdxCur, addrNxt, regBase, nConstraint) + if addrSeekScan != 0 { + Xsqlite3VdbeJumpHere(tls, v, addrSeekScan) + } } if regBignull != 0 { // During a NULL-scan, check to see if we have reached the end of @@ -123687,26 +125696,17 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IN_EARLYOUT) != 0 { - Xsqlite3VdbeAddOp2(tls, v, OP_SeekHit, iIdxCur, 1) + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_EARLYOUT)) != U32(0) { + Xsqlite3VdbeAddOp3(tls, v, OP_SeekHit, iIdxCur, int32(nEq), int32(nEq)) } // Seek the table cursor, if required - omitTable = (libc.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IDX_ONLY) != U32(0)) && + omitTable = (libc.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IDX_ONLY)) != U32(0)) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_OR_SUBCLAUSE) == 0))) if omitTable != 0 { // pIdx is a covering index. No need to access the main table. - } else if ((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & TF_WithoutRowid) == U32(0) { - if ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_SEEK_TABLE) != 0) || - (((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_SEEK_UNIQ_TABLE) != 0) && - ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_SINGLE) || (int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) == 0))) { - iRowidReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) - Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iIdxCur, iRowidReg) - Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iCur, 0, iRowidReg) - - } else { - codeDeferredSeek(tls, pWInfo, pIdx, iCur, iIdxCur) - } + } else if ((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + codeDeferredSeek(tls, pWInfo, pIdx, iCur, iIdxCur) } else if iCur != iIdxCur { var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable) iRowidReg = Xsqlite3GetTempRange(tls, pParse, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)) @@ -123757,29 +125757,29 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } // Record the instruction used to terminate the loop. - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_ONEROW) != 0 { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Noop + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) != 0 { + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop) } else if bRev != 0 { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Prev + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Prev) } else { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Next + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Next) } (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iIdxCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fp3 = func() uint8 { - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_UNQ_WANTED) != U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_UNQ_WANTED)) != U32(0) { return uint8(1) } return uint8(0) }() - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_CONSTRAINT) == U32(0) { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = SQLITE_STMTSTATUS_FULLSCAN_STEP + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_CONSTRAINT)) == U32(0) { + (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = U8(SQLITE_STMTSTATUS_FULLSCAN_STEP) } else { } if omitTable != 0 { pIdx = uintptr(0) } - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_MULTI_OR) != 0 { + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_MULTI_OR)) != 0 { // Case 5: Two or more separately indexed terms connected by OR // // Example: @@ -123834,14 +125834,13 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI var iRetInit int32 // Address of regReturn init var untestedTerms int32 = 0 // Some terms not completely tested var ii int32 // Loop counter - var wctrlFlags U16 // Flags for sub-WHERE clause var pAndExpr uintptr = uintptr(0) // An ".. AND (...)" expression - var pTab uintptr = (*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab + var pTab uintptr = (*SrcItem)(unsafe.Pointer(pTabItem)).FpTab pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - pOrWc = (*(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)) /* &.wc */) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Return + pOrWc = (*(*uintptr)(unsafe.Pointer(pTerm + 32 /* &.u */)) /* &.wc */) + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Return) (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = regReturn // Set up a new SrcList in pOrTab containing the table being scanned @@ -123851,16 +125850,16 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI var nNotReady int32 // The number of notReady tables var origSrc uintptr // Original list of tables nNotReady = ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel) - 1) - pOrTab = Xsqlite3DbMallocRaw(tls, db, (uint64(uint64(unsafe.Sizeof(SrcList{})) + (uint64(nNotReady) * uint64(unsafe.Sizeof(SrcList_item{})))))) + pOrTab = Xsqlite3DbMallocRaw(tls, db, (uint64(uint64(unsafe.Sizeof(SrcList{})) + (uint64(nNotReady) * uint64(unsafe.Sizeof(SrcItem{})))))) if pOrTab == uintptr(0) { return notReady } (*SrcList)(unsafe.Pointer(pOrTab)).FnAlloc = U32((U8(nNotReady + 1))) (*SrcList)(unsafe.Pointer(pOrTab)).FnSrc = int32((*SrcList)(unsafe.Pointer(pOrTab)).FnAlloc) - libc.Xmemcpy(tls, pOrTab+8 /* &.a */, pTabItem, uint64(unsafe.Sizeof(SrcList_item{}))) + libc.Xmemcpy(tls, pOrTab+8 /* &.a */, pTabItem, uint64(unsafe.Sizeof(SrcItem{}))) origSrc = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */ for k = 1; k <= nNotReady; k++ { - libc.Xmemcpy(tls, ((pOrTab + 8 /* &.a */) + uintptr(k)*112), (origSrc + uintptr((*WhereLevel)(unsafe.Pointer(pLevel+uintptr(k)*88)).FiFrom)*112), uint64(unsafe.Sizeof(SrcList_item{}))) + libc.Xmemcpy(tls, ((pOrTab + 8 /* &.a */) + uintptr(k)*112), (origSrc + uintptr((*WhereLevel)(unsafe.Pointer(pLevel+uintptr(k)*88)).FiFrom)*112), uint64(unsafe.Sizeof(SrcItem{}))) } } else { pOrTab = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList @@ -123878,7 +125877,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // fall through to the next instruction, just as an OP_Next does if // called on an uninitialized cursor. if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DUPLICATES_OK) == 0 { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { regRowset = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regRowset) } else { @@ -123907,15 +125906,15 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*WhereClause)(unsafe.Pointer(pWC)).FnTerm > 1 { var iTerm int32 for iTerm = 0; iTerm < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm; iTerm++ { - var pExpr uintptr = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*64)).FpExpr - if ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*64) == pTerm { + var pExpr uintptr = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*56)).FpExpr + if ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*56) == pTerm { continue } - if (int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*64)).FwtFlags) & (TERM_VIRTUAL | TERM_CODED)) != 0 { + if (int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*56)).FwtFlags) & (TERM_VIRTUAL | TERM_CODED)) != 0 { continue } - if (int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*64)).FeOperator) & WO_ALL) == 0 { + if (int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*56)).FeOperator) & WO_ALL) == 0 { continue } @@ -123935,10 +125934,9 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // Run a separate WHERE clause for each term of the OR clause. After // eliminating duplicates from other WHERE clauses, the action for each // sub-WHERE clause is to to invoke the main loop body as a subroutine. - wctrlFlags = (U16(WHERE_OR_SUBCLAUSE | (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_SEEK_TABLE))) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19111 /* "MULTI-INDEX OR" */, 0) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19587 /* "MULTI-INDEX OR" */, 0) for ii = 0; ii < (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm; ii++ { - var pOrTerm uintptr = ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr(ii)*64) + var pOrTerm uintptr = ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr(ii)*56) if ((*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur) || ((int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator) & WO_AND) != 0) { var pSubWInfo uintptr // Info for single OR-term scan var pOrExpr uintptr = (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr // Current OR clause term @@ -123949,15 +125947,15 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } // Loop through table entries that match term pOrTerm. - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19126 /* "INDEX %d" */, libc.VaList(bp, (ii+1))) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19602 /* "INDEX %d" */, libc.VaList(bp, (ii+1))) pSubWInfo = Xsqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), - wctrlFlags, iCovCur) + uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { var pSubLoop uintptr var addrExplain int32 = Xsqlite3WhereExplainOneScan(tls, - pParse, pOrTab, (pSubWInfo + 920 /* &.a */), uint16(0)) + pParse, pOrTab, (pSubWInfo + 856 /* &.a */), uint16(0)) _ = addrExplain _ = addrExplain @@ -123972,7 +125970,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } return ii }() - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, -1, regRowid) jmp1 = Xsqlite3VdbeAddOp4Int(tls, v, OP_RowSetTest, regRowset, 0, regRowid, iSet) @@ -124010,7 +126008,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, regRowset, regRowid, r, nPk) if iSet != 0 { - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) } } @@ -124047,16 +126045,19 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // terms, set pCov to the candidate covering index. Otherwise, set // pCov to NULL to indicate that no candidate covering index will // be available. - pSubLoop = (*WhereLevel)(unsafe.Pointer((pSubWInfo + 920 /* &.a */))).FpWLoop + pSubLoop = (*WhereLevel)(unsafe.Pointer((pSubWInfo + 856 /* &.a */))).FpWLoop - if ((((*WhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags & WHERE_INDEXED) != U32(0)) && + if ((((*WhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags & U32(WHERE_INDEXED)) != U32(0)) && ((ii == 0) || (*(*uintptr)(unsafe.Pointer((pSubLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) == pCov))) && - ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) { + ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) { pCov = *(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) } else { pCov = uintptr(0) } + if Xsqlite3WhereUsesDeferredSeek(tls, pSubWInfo) != 0 { + libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bDeferredSeek */, uint32(1), 0, 0x1) + } // Finish the loop through table entries that match term pOrTerm. Xsqlite3WhereEnd(tls, pSubWInfo) @@ -124088,14 +126089,14 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (uint32(int32(*(*uint8)(unsafe.Pointer(pTabItem + 60 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5))) != 0 { // Tables marked isRecursive have only a single row that is stored in // a pseudo-cursor. No need to Rewind or Next such cursors. - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Noop + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop) } else { (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = aStep[bRev] (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = (1 + Xsqlite3VdbeAddOp2(tls, v, int32(aStart[bRev]), iCur, addrHalt)) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = SQLITE_STMTSTATUS_FULLSCAN_STEP + (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = U8(SQLITE_STMTSTATUS_FULLSCAN_STEP) } } @@ -124140,7 +126141,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } pE = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if ((int32((*SrcList_item)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) && !(((*Expr)(unsafe.Pointer((pE))).Fflags & (EP_FromJoin)) != U32(0)) { + if ((int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) && !(((*Expr)(unsafe.Pointer((pE))).Fflags & (U32(EP_FromJoin))) != U32(0)) { goto __2 } @@ -124173,7 +126174,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI goto __2 __2: j-- - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -124211,12 +126212,12 @@ __4: if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != iCur { goto __5 } - if (int32((*SrcList_item)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0 { + if (int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0 { goto __5 } pE = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - pAlt = Xsqlite3WhereFindTerm(tls, pWC, iCur, *(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)), notReady, + pAlt = Xsqlite3WhereFindTerm(tls, pWC, iCur, *(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)), notReady, (uint32((WO_EQ | WO_IN) | WO_IS)), uintptr(0)) if pAlt == uintptr(0) { goto __5 @@ -124225,7 +126226,7 @@ __4: goto __5 } if (((int32((*WhereTerm)(unsafe.Pointer(pAlt)).FeOperator) & WO_IN) != 0) && - (((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr)).Fflags & EP_xIsSelect) != 0)) && + (((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr)).Fflags & U32(EP_xIsSelect)) != 0)) && ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr + 32 /* &.x */)))).FpEList)).FnExpr > 1) { goto __5 } @@ -124238,7 +126239,7 @@ __4: goto __5 __5: j-- - pTerm += 64 + pTerm += 56 goto __4 goto __6 __6: @@ -124273,7 +126274,7 @@ __6: goto __8 __8: j++ - pTerm += 64 + pTerm += 56 goto __7 goto __9 __9: @@ -124285,30 +126286,30 @@ __6: var aStartOp = [8]U8{ U8(0), U8(0), - OP_Rewind, // 2: (!start_constraints && startEq && !bRev) - OP_Last, // 3: (!start_constraints && startEq && bRev) - OP_SeekGT, // 4: (start_constraints && !startEq && !bRev) - OP_SeekLT, // 5: (start_constraints && !startEq && bRev) - OP_SeekGE, // 6: (start_constraints && startEq && !bRev) - OP_SeekLE, // 7: (start_constraints && startEq && bRev) -} /* sqlite3.c:143140:21 */ + U8(OP_Rewind), // 2: (!start_constraints && startEq && !bRev) + U8(OP_Last), // 3: (!start_constraints && startEq && bRev) + U8(OP_SeekGT), // 4: (start_constraints && !startEq && !bRev) + U8(OP_SeekLT), // 5: (start_constraints && !startEq && bRev) + U8(OP_SeekGE), // 6: (start_constraints && startEq && !bRev) + U8(OP_SeekLE), // 7: (start_constraints && startEq && bRev) +} /* sqlite3.c:145427:21 */ var aEndOp = [4]U8{ - OP_IdxGE, // 0: (end_constraints && !bRev && !endEq) - OP_IdxGT, // 1: (end_constraints && !bRev && endEq) - OP_IdxLE, // 2: (end_constraints && bRev && !endEq) - OP_IdxLT, // 3: (end_constraints && bRev && endEq) -} /* sqlite3.c:143150:21 */ -var aStep = [2]U8{OP_Next, OP_Prev} /* sqlite3.c:143816:21 */ -var aStart = [2]U8{OP_Rewind, OP_Last} /* sqlite3.c:143817:21 */ + U8(OP_IdxGE), // 0: (end_constraints && !bRev && !endEq) + U8(OP_IdxGT), // 1: (end_constraints && !bRev && endEq) + U8(OP_IdxLE), // 2: (end_constraints && bRev && !endEq) + U8(OP_IdxLT), // 3: (end_constraints && bRev && endEq) +} /* sqlite3.c:145437:21 */ +var aStep = [2]U8{U8(OP_Next), U8(OP_Prev)} /* sqlite3.c:146113:21 */ +var aStart = [2]U8{U8(OP_Rewind), U8(OP_Last)} /* sqlite3.c:146114:21 */ // Deallocate all memory associated with a WhereOrInfo object. -func whereOrInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:144024:13: */ +func whereOrInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:146321:13: */ Xsqlite3WhereClauseClear(tls, (p /* &.wc */)) Xsqlite3DbFree(tls, db, p) } // Deallocate all memory associated with a WhereAndInfo object. -func whereAndInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:144032:13: */ +func whereAndInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:146329:13: */ Xsqlite3WhereClauseClear(tls, (p /* &.wc */)) Xsqlite3DbFree(tls, db, p) } @@ -124330,7 +126331,7 @@ func whereAndInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:144 // 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 *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 { /* sqlite3.c:144056:12: */ +func whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 { /* sqlite3.c:146353:12: */ var pTerm uintptr var idx int32 @@ -124351,8 +126352,8 @@ func whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 } (*WhereClause)(unsafe.Pointer(pWC)).FnSlot = (int32(uint64(Xsqlite3DbMallocSize(tls, db, (*WhereClause)(unsafe.Pointer(pWC)).Fa)) / uint64(unsafe.Sizeof(WhereTerm{})))) } - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(libc.AssignInt32(&idx, libc.PostIncInt32(&(*WhereClause)(unsafe.Pointer(pWC)).FnTerm, 1)))*64) - if (p != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Unlikely)) != U32(0)) { + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(libc.AssignInt32(&idx, libc.PostIncInt32(&(*WhereClause)(unsafe.Pointer(pWC)).FnTerm, 1)))*56) + if (p != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Unlikely))) != U32(0)) { (*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = (LogEst(int32(Xsqlite3LogEst(tls, uint64((*Expr)(unsafe.Pointer(p)).FiTable))) - 270)) } else { (*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = int16(1) @@ -124369,18 +126370,18 @@ func whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 // 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 *libc.TLS, op int32) int32 { /* sqlite3.c:144097:12: */ +func allowedOp(tls *libc.TLS, op int32) int32 { /* sqlite3.c:146394:12: */ return (libc.Bool32((((op == TK_IN) || ((op >= TK_EQ) && (op <= TK_GE))) || (op == TK_ISNULL)) || (op == TK_IS))) } // Commute a comparison operator. Expressions of the form "X op Y" // are converted into "Y op X". -func exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3.c:144109:12: */ +func exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3.c:146406:12: */ if ((int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR) || (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fop) == TK_VECTOR)) || (Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight) != Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) ^= (EP_Commuted) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) ^= (U32(EP_Commuted)) } { var t uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpRight @@ -124396,15 +126397,15 @@ func exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3. } // Translate from TK_xx operator to WO_xx bitmask. -func operatorMask(tls *libc.TLS, op int32) U16 { /* sqlite3.c:144132:12: */ +func operatorMask(tls *libc.TLS, op int32) U16 { /* sqlite3.c:146429:12: */ var c U16 if op == TK_IN { - c = WO_IN + c = U16(WO_IN) } else if op == TK_ISNULL { - c = WO_ISNULL + c = U16(WO_ISNULL) } else if op == TK_IS { - c = WO_IS + c = U16(WO_IS) } else { c = (U16(int32(WO_EQ) << (op - TK_EQ))) @@ -124423,7 +126424,7 @@ func operatorMask(tls *libc.TLS, op int32) U16 { /* sqlite3.c:144132:12: */ // 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 *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr, pisComplete uintptr, pnoCase uintptr) int32 { /* sqlite3.c:144170:12: */ +func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr, pisComplete uintptr, pnoCase uintptr) int32 { /* sqlite3.c:146467:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -124448,10 +126449,10 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr pRight = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FpExpr) op = int32((*Expr)(unsafe.Pointer(pRight)).Fop) - if (op == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_EnableQPSG) == uint64(0)) { + if (op == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableQPSG)) == uint64(0)) { var pReprepare uintptr = (*Parse)(unsafe.Pointer(pParse)).FpReprepare var iCol int32 = int32((*Expr)(unsafe.Pointer(pRight)).FiColumn) - pVal = Xsqlite3VdbeGetBoundValue(tls, pReprepare, iCol, SQLITE_AFF_BLOB) + pVal = Xsqlite3VdbeGetBoundValue(tls, pReprepare, iCol, uint8(SQLITE_AFF_BLOB)) if (pVal != 0) && (Xsqlite3_value_type(tls, pVal) == SQLITE_TEXT) { z = Xsqlite3_value_text(tls, pVal) } @@ -124518,13 +126519,13 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr var isNum int32 // var rDummy float64 at bp+8, 8 - isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, SQLITE_UTF8) + isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, uint8(SQLITE_UTF8)) if isNum <= 0 { if (iTo == 1) && (int32(*(*int8)(unsafe.Pointer(zNew))) == '-') { isNum = +1 } else { *(*int8)(unsafe.Pointer(zNew + uintptr((iTo - 1))))++ - isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, SQLITE_UTF8) + isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, uint8(SQLITE_UTF8)) *(*int8)(unsafe.Pointer(zNew + uintptr((iTo - 1))))-- } } @@ -124588,7 +126589,7 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr // of virtual table in forms (5) or (7) then return 2. // // If the expression matches none of the patterns above, return 0. -func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uintptr, ppLeft uintptr, ppRight uintptr) int32 { /* sqlite3.c:144342:12: */ +func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uintptr, ppLeft uintptr, ppRight uintptr) int32 { /* sqlite3.c:146639:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -124673,13 +126674,13 @@ func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uin *(*uintptr)(unsafe.Pointer(ppLeft)) = pLeft *(*uintptr)(unsafe.Pointer(ppRight)) = pRight if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NE { - *(*uint8)(unsafe.Pointer(peOp2)) = SQLITE_INDEX_CONSTRAINT_NE + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_NE) } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_ISNOT { - *(*uint8)(unsafe.Pointer(peOp2)) = SQLITE_INDEX_CONSTRAINT_ISNOT + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOT) } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL { - *(*uint8)(unsafe.Pointer(peOp2)) = SQLITE_INDEX_CONSTRAINT_ISNOTNULL + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOTNULL) } return res } @@ -124690,43 +126691,43 @@ type Op2 = struct { FzOp uintptr FeOp2 uint8 _ [7]byte -} /* sqlite3.c:144350:18 */ +} /* sqlite3.c:146647:18 */ var aOp = [4]Op2{ - {FzOp: ts + 13736 /* "match" */, FeOp2: SQLITE_INDEX_CONSTRAINT_MATCH}, - {FzOp: ts + 13216 /* "glob" */, FeOp2: SQLITE_INDEX_CONSTRAINT_GLOB}, - {FzOp: ts + 12776 /* "like" */, FeOp2: SQLITE_INDEX_CONSTRAINT_LIKE}, - {FzOp: ts + 19135 /* "regexp" */, FeOp2: SQLITE_INDEX_CONSTRAINT_REGEXP}, -} /* sqlite3.c:144353:7 */ + {FzOp: ts + 14165 /* "match" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH)}, + {FzOp: ts + 13640 /* "glob" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB)}, + {FzOp: ts + 13190 /* "like" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE)}, + {FzOp: ts + 19611 /* "regexp" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP)}, +} /* sqlite3.c:146650:7 */ // 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 *libc.TLS, pDerived uintptr, pBase uintptr) { /* sqlite3.c:144447:13: */ +func transferJoinMarkings(tls *libc.TLS, pDerived uintptr, pBase uintptr) { /* sqlite3.c:146744:13: */ if pDerived != 0 { - *(*U32)(unsafe.Pointer(pDerived + 4 /* &.flags */)) |= ((*Expr)(unsafe.Pointer(pBase)).Fflags & EP_FromJoin) + *(*U32)(unsafe.Pointer(pDerived + 4 /* &.flags */)) |= ((*Expr)(unsafe.Pointer(pBase)).Fflags & U32(EP_FromJoin)) (*Expr)(unsafe.Pointer(pDerived)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pBase)).FiRightJoinTable } } // Mark term iChild as being a child of term iParent -func markTermAsChild(tls *libc.TLS, pWC uintptr, iChild int32, iParent int32) { /* sqlite3.c:144457:13: */ - (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*64)).FiParent = iParent - (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*64)).FtruthProb = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iParent)*64)).FtruthProb - (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iParent)*64)).FnChild++ +func markTermAsChild(tls *libc.TLS, pWC uintptr, iChild int32, iParent int32) { /* sqlite3.c:146754:13: */ + (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*56)).FiParent = iParent + (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*56)).FtruthProb = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iParent)*56)).FtruthProb + (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iParent)*56)).FnChild++ } // 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 *libc.TLS, pTerm uintptr, N int32) uintptr { /* sqlite3.c:144468:18: */ +func whereNthSubterm(tls *libc.TLS, pTerm uintptr, N int32) uintptr { /* sqlite3.c:146765:18: */ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) != WO_AND { if N == 0 { return pTerm } return uintptr(0) } - if N < (*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)))).Fwc.FnTerm { - return ((*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)))).Fwc.Fa + uintptr(N)*64) + if N < (*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 32 /* &.u */)))).Fwc.FnTerm { + return ((*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 32 /* &.u */)))).Fwc.Fa + uintptr(N)*56) } return uintptr(0) } @@ -124749,7 +126750,7 @@ func whereNthSubterm(tls *libc.TLS, pTerm uintptr, N int32) uintptr { /* sqlite3 // The following is NOT generated: // // xy --> x!=y -func whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintptr, pTwo uintptr) { /* sqlite3.c:144498:13: */ +func whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintptr, pTwo uintptr) { /* sqlite3.c:146795:13: */ var eOp U16 = (U16(int32((*WhereTerm)(unsafe.Pointer(pOne)).FeOperator) | int32((*WhereTerm)(unsafe.Pointer(pTwo)).FeOperator))) var db uintptr // Database connection (for malloc) var pNew uintptr // New virtual expression @@ -124879,11 +126880,11 @@ func whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintpt // // 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 *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:144624:13: */ +func exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:146921:13: */ var pWInfo uintptr = (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo // WHERE clause processing context var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse // Parser context var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database connection - var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) // The term to be analyzed + var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) // The term to be analyzed var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr // The expression of the term var i int32 // Loop counters var pOrWc uintptr // Breakup of pTerm into subterms @@ -124896,7 +126897,7 @@ func exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // stored in a WhereClause structure containing within the WhereOrInfo // object that is attached to the original OR clause term. - *(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)) = libc.AssignUintptr(&pOrInfo, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(WhereOrInfo{})))) + *(*uintptr)(unsafe.Pointer(pTerm + 32 /* &.u */)) = libc.AssignUintptr(&pOrInfo, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(WhereOrInfo{})))) if pOrInfo == uintptr(0) { return } @@ -124904,7 +126905,7 @@ func exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) pOrWc = (pOrInfo /* &.wc */) libc.Xmemset(tls, pOrWc+40 /* &.aStatic */, 0, uint64(unsafe.Sizeof([8]WhereTerm{}))) Xsqlite3WhereClauseInit(tls, pOrWc, pWInfo) - Xsqlite3WhereSplit(tls, pOrWc, pExpr, TK_OR) + Xsqlite3WhereSplit(tls, pOrWc, pExpr, uint8(TK_OR)) Xsqlite3WhereExprAnalyze(tls, pSrc, pOrWc) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return @@ -124930,13 +126931,13 @@ __1: var pAndTerm uintptr var j int32 var b Bitmask = uint64(0) - *(*uintptr)(unsafe.Pointer(pOrTerm + 40 /* &.u */)) = pAndInfo + *(*uintptr)(unsafe.Pointer(pOrTerm + 32 /* &.u */)) = pAndInfo *(*U16)(unsafe.Pointer(pOrTerm + 18 /* &.wtFlags */)) |= U16((TERM_ANDINFO)) - (*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator = WO_AND + (*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator = U16(WO_AND) pAndWC = (pAndInfo /* &.wc */) libc.Xmemset(tls, pAndWC+40 /* &.aStatic */, 0, uint64(unsafe.Sizeof([8]WhereTerm{}))) Xsqlite3WhereClauseInit(tls, pAndWC, (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo) - Xsqlite3WhereSplit(tls, pAndWC, (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr, TK_AND) + Xsqlite3WhereSplit(tls, pAndWC, (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr, uint8(TK_AND)) Xsqlite3WhereExprAnalyze(tls, pSrc, pAndWC) (*WhereClause)(unsafe.Pointer(pAndWC)).FpOuter = pWC if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { @@ -124950,14 +126951,14 @@ __1: if (allowedOp(tls, int32((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAndTerm)).FpExpr)).Fop)) != 0) || (int32((*WhereTerm)(unsafe.Pointer(pAndTerm)).FeOperator) == WO_AUX) { - b = b | (Xsqlite3WhereGetMask(tls, (pWInfo + 656 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pAndTerm)).FleftCursor)) + b = b | (Xsqlite3WhereGetMask(tls, (pWInfo + 592 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pAndTerm)).FleftCursor)) } } goto __5 __5: j++ - pAndTerm += 64 + pAndTerm += 56 goto __4 goto __6 __6: @@ -124969,10 +126970,10 @@ __1: // corresponding TERM_VIRTUAL term } else { var b Bitmask - b = Xsqlite3WhereGetMask(tls, (pWInfo + 656 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor) + b = Xsqlite3WhereGetMask(tls, (pWInfo + 592 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor) if (int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags) & TERM_VIRTUAL) != 0 { - var pOther uintptr = ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pOrTerm)).FiParent)*64) - b = b | (Xsqlite3WhereGetMask(tls, (pWInfo + 656 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pOther)).FleftCursor)) + var pOther uintptr = ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pOrTerm)).FiParent)*56) + b = b | (Xsqlite3WhereGetMask(tls, (pWInfo + 592 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pOther)).FleftCursor)) } indexable = indexable & (b) if (int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator) & WO_EQ) == 0 { @@ -124986,7 +126987,7 @@ __1: goto __2 __2: i-- - pOrTerm += 64 + pOrTerm += 56 goto __1 goto __3 __3: @@ -124996,10 +126997,10 @@ __3: // empty. (*WhereOrInfo)(unsafe.Pointer(pOrInfo)).Findexable = indexable if indexable != 0 { - (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = WO_OR + (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_OR) (*WhereClause)(unsafe.Pointer(pWC)).FhasOr = U8(1) } else { - (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = WO_OR + (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_OR) } // For a two-way OR, attempt to implementation case 2. @@ -125009,7 +127010,7 @@ __3: for (libc.AssignUintptr(&pOne, whereNthSubterm(tls, ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa), libc.PostIncInt32(&iOne, 1)))) != uintptr(0) { var iTwo int32 = 0 var pTwo uintptr - for (libc.AssignUintptr(&pTwo, whereNthSubterm(tls, ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa+1*64), libc.PostIncInt32(&iTwo, 1)))) != uintptr(0) { + for (libc.AssignUintptr(&pTwo, whereNthSubterm(tls, ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa+1*56), libc.PostIncInt32(&iTwo, 1)))) != uintptr(0) { whereCombineDisjuncts(tls, pSrc, pWC, pOne, pTwo) } } @@ -125062,7 +127063,7 @@ __3: goto __8 } - if (chngToIN & Xsqlite3WhereGetMask(tls, (pWInfo+656 /* &.sMaskSet */), + if (chngToIN & Xsqlite3WhereGetMask(tls, (pWInfo+592 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor)) == uint64(0) { // This term must be of the form t1.a==t2.b where t2 is in the // chngToIN set but t1 is not. This term will be either preceded @@ -125071,7 +127072,7 @@ __3: goto __8 } - iColumn = *(*int32)(unsafe.Pointer(pOrTerm + 40 /* &.u */)) + iColumn = *(*int32)(unsafe.Pointer(pOrTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) iCursor = (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor pLeft = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft goto __9 @@ -125080,7 +127081,7 @@ __3: goto __8 __8: i-- - pOrTerm += 64 + pOrTerm += 56 goto __7 goto __9 __9: @@ -125103,7 +127104,7 @@ __3: if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor != iCursor { *(*U16)(unsafe.Pointer(pOrTerm + 18 /* &.wtFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(TERM_OR_OK))) - } else if (*(*int32)(unsafe.Pointer(pOrTerm + 40 /* &.u */)) != iColumn) || ((iColumn == (-2)) && + } else if (*(*int32)(unsafe.Pointer((pOrTerm + 32 /* &.u */ /* &.x */) /* &.leftColumn */)) != iColumn) || ((iColumn == (-2)) && (Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft, pLeft, -1) != 0)) { okToChngToIN = 0 } else { @@ -125125,7 +127126,7 @@ __3: goto __11 __11: i-- - pOrTerm += 64 + pOrTerm += 56 goto __10 goto __12 __12: @@ -125159,7 +127160,7 @@ __3: goto __14 __14: i-- - pOrTerm += 64 + pOrTerm += 56 goto __13 goto __15 __15: @@ -125197,17 +127198,17 @@ __3: // 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 *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:144895:12: */ +func termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:147192:12: */ var aff1 int8 var aff2 int8 var pColl uintptr - if !((int32((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags) & (SQLITE_Transitive)) == 0) { + if !(((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags & (U32(SQLITE_Transitive))) == U32(0)) { return 0 } if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_EQ) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_IS) { return 0 } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { return 0 } aff1 = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) @@ -125226,7 +127227,7 @@ func termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* // Recursively walk the expressions of a SELECT statement and generate // a bitmask indicating which tables are used in that expression // tree. -func exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* sqlite3.c:144918:16: */ +func exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* sqlite3.c:147215:16: */ var mask Bitmask = uint64(0) for pS != 0 { var pSrc uintptr = (*Select)(unsafe.Pointer(pS)).FpSrc @@ -125238,8 +127239,8 @@ func exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* s if pSrc != uintptr(0) { var i int32 for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ { - mask = mask | (exprSelectUsage(tls, pMaskSet, (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpSelect)) - mask = mask | (Xsqlite3WhereExprUsage(tls, pMaskSet, (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpOn)) + mask = mask | (exprSelectUsage(tls, pMaskSet, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpSelect)) + mask = mask | (Xsqlite3WhereExprUsage(tls, pMaskSet, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpOn)) if (uint32(int32(*(*uint8)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112 + 60 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 { mask = mask | (Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112 + 96 /* &.u1 */)))) } @@ -125261,7 +127262,7 @@ func exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* s // 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 *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr) int32 { /* sqlite3.c:144955:28: */ +func exprMightBeIndexed2(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr) int32 { /* sqlite3.c:147252:28: */ var pIdx uintptr var i int32 var iCur int32 @@ -125280,8 +127281,8 @@ __2: goto __3 __3: ; - iCur = (*SrcList_item)(unsafe.Pointer((pFrom + 8 /* &.a */) + uintptr(i)*112)).FiCursor - for pIdx = (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pFrom + 8 /* &.a */) + uintptr(i)*112)).FpTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext { + iCur = (*SrcItem)(unsafe.Pointer((pFrom + 8 /* &.a */) + uintptr(i)*112)).FiCursor + for pIdx = (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pFrom + 8 /* &.a */) + uintptr(i)*112)).FpTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext { if (*Index)(unsafe.Pointer(pIdx)).FaColExpr == uintptr(0) { continue } @@ -125299,7 +127300,7 @@ __3: return 0 } -func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr, op int32) int32 { /* sqlite3.c:144979:12: */ +func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr, op int32) int32 { /* sqlite3.c:147276:12: */ // If this expression is a vector to the left or right of a // inequality constraint (>, <, >= or <=), perform the processing // on the first element of the vector. @@ -125322,6 +127323,299 @@ func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol return exprMightBeIndexed2(tls, pFrom, mPrereq, aiCurCol, pExpr) } +// Expression callback for exprUsesSrclist(). +func exprUsesSrclistCb(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:147306:12: */ + if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN { + var pSrc uintptr = *(*uintptr)(unsafe.Pointer(p + 40 /* &.u */)) + var iCsr int32 = (*Expr)(unsafe.Pointer(pExpr)).FiTable + var ii int32 + for ii = 0; ii < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; ii++ { + if (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(ii)*112)).FiCursor == iCsr { + if (*Walker)(unsafe.Pointer(p)).FeCode != 0 { + return WRC_Abort + } + return WRC_Continue + } + } + if (*Walker)(unsafe.Pointer(p)).FeCode != 0 { + return WRC_Continue + } + return WRC_Abort + } + return WRC_Continue +} + +// Select callback for exprUsesSrclist(). +func exprUsesSrclistSelectCb(tls *libc.TLS, NotUsed1 uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:147324:12: */ + _ = NotUsed1 + _ = NotUsed2 + return WRC_Abort +} + +// This function always returns true if expression pExpr contains +// a sub-select. +// +// If there is no sub-select in pExpr, then return true if pExpr +// contains a TK_COLUMN node for a table that is (bUses==1) +// or is not (bUses==0) in pSrc. +// +// Said another way: +// +// bUses Return Meaning +// -------- ------ ------------------------------------------------ +// +// bUses==1 true pExpr contains either a sub-select or a +// TK_COLUMN referencing pSrc. +// +// bUses==1 false pExpr contains no sub-selects and all TK_COLUMN +// nodes reference tables not found in pSrc +// +// bUses==0 true pExpr contains either a sub-select or a TK_COLUMN +// that references a table not in pSrc. +// +// bUses==0 false pExpr contains no sub-selects and all TK_COLUMN +// nodes reference pSrc +func exprUsesSrclist(tls *libc.TLS, pSrc uintptr, pExpr uintptr, bUses int32) int32 { /* sqlite3.c:147355:12: */ + bp := tls.Alloc(48) + defer tls.Free(48) + + // var sWalker Walker at bp, 48 + + libc.Xmemset(tls, bp /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{}))) + (*Walker)(unsafe.Pointer(bp /* &sWalker */)).FeCode = U16(bUses) + *(*uintptr)(unsafe.Pointer(bp /* &sWalker */ + 40 /* &.u */)) = pSrc + (*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) int32 + }{exprUsesSrclistCb})) + (*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) int32 + }{exprUsesSrclistSelectCb})) + return (libc.Bool32(Xsqlite3WalkExpr(tls, bp /* &sWalker */, pExpr) == WRC_Abort)) +} + +// Context object used by exprExistsToInIter() as it iterates through an +// expression tree. +type ExistsToInCtx = struct { + FpSrc uintptr + FpInLhs uintptr + FpEq uintptr + FppAnd uintptr + FppParent uintptr +} /* sqlite3.c:147369:1 */ + +// Iterate through all AND connected nodes in the expression tree +// headed by (*ppExpr), populating the structure passed as the first +// argument with the values required by exprAnalyzeExistsFindEq(). +// +// This function returns non-zero if the expression tree does not meet +// the two conditions described by the header comment for +// exprAnalyzeExistsFindEq(), or zero if it does. +func exprExistsToInIter(tls *libc.TLS, p uintptr, ppExpr uintptr) int32 { /* sqlite3.c:147386:12: */ + var pExpr uintptr = *(*uintptr)(unsafe.Pointer(ppExpr)) + switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) { + case TK_AND: + (*ExistsToInCtx)(unsafe.Pointer(p)).FppParent = ppExpr + if exprExistsToInIter(tls, p, (pExpr+16 /* &.pLeft */)) != 0 { + return 1 + } + (*ExistsToInCtx)(unsafe.Pointer(p)).FppParent = ppExpr + if exprExistsToInIter(tls, p, (pExpr+24 /* &.pRight */)) != 0 { + return 1 + } + break + case TK_EQ: + { + var bLeft int32 = exprUsesSrclist(tls, (*ExistsToInCtx)(unsafe.Pointer(p)).FpSrc, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, 0) + var bRight int32 = exprUsesSrclist(tls, (*ExistsToInCtx)(unsafe.Pointer(p)).FpSrc, (*Expr)(unsafe.Pointer(pExpr)).FpRight, 0) + if (bLeft != 0) || (bRight != 0) { + if ((bLeft != 0) && (bRight != 0)) || ((*ExistsToInCtx)(unsafe.Pointer(p)).FpInLhs != 0) { + return 1 + } + (*ExistsToInCtx)(unsafe.Pointer(p)).FpInLhs = func() uintptr { + if bLeft != 0 { + return (*Expr)(unsafe.Pointer(pExpr)).FpLeft + } + return (*Expr)(unsafe.Pointer(pExpr)).FpRight + }() + if exprUsesSrclist(tls, (*ExistsToInCtx)(unsafe.Pointer(p)).FpSrc, (*ExistsToInCtx)(unsafe.Pointer(p)).FpInLhs, 1) != 0 { + return 1 + } + (*ExistsToInCtx)(unsafe.Pointer(p)).FpEq = pExpr + (*ExistsToInCtx)(unsafe.Pointer(p)).FppAnd = (*ExistsToInCtx)(unsafe.Pointer(p)).FppParent + } + break + + } + default: + if exprUsesSrclist(tls, (*ExistsToInCtx)(unsafe.Pointer(p)).FpSrc, pExpr, 0) != 0 { + return 1 + } + break + } + + return 0 +} + +// This function is used by exprAnalyzeExists() when creating virtual IN(...) +// terms equivalent to user-supplied EXIST(...) clauses. It splits the WHERE +// clause of the Select object passed as the first argument into one or more +// expressions joined by AND operators, and then tests if the following are +// true: +// +// 1. Exactly one of the AND separated terms refers to the outer +// query, and it is an == (TK_EQ) expression. +// +// 2. Only one side of the == expression refers to the outer query, and +// it does not refer to any columns from the inner query. +// +// If both these conditions are true, then a pointer to the side of the == +// expression that refers to the outer query is returned. The caller will +// use this expression as the LHS of the IN(...) virtual term. Or, if one +// or both of the above conditions are not true, NULL is returned. +// +// If non-NULL is returned and ppEq is non-NULL, *ppEq is set to point +// to the == expression node before returning. If pppAnd is non-NULL and +// the == node is not the root of the WHERE clause, then *pppAnd is set +// to point to the pointer to the AND node that is the parent of the == +// node within the WHERE expression tree. +func exprAnalyzeExistsFindEq(tls *libc.TLS, pSel uintptr, ppEq uintptr, pppAnd uintptr) uintptr { /* sqlite3.c:147441:13: */ + bp := tls.Alloc(40) + defer tls.Free(40) + + // var ctx ExistsToInCtx at bp, 40 + + libc.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(ExistsToInCtx{}))) + (*ExistsToInCtx)(unsafe.Pointer(bp /* &ctx */)).FpSrc = (*Select)(unsafe.Pointer(pSel)).FpSrc + if exprExistsToInIter(tls, bp /* &ctx */, (pSel+48 /* &.pWhere */)) != 0 { + return uintptr(0) + } + if ppEq != 0 { + *(*uintptr)(unsafe.Pointer(ppEq)) = (*ExistsToInCtx)(unsafe.Pointer(bp /* &ctx */)).FpEq + } + if pppAnd != 0 { + *(*uintptr)(unsafe.Pointer(pppAnd)) = (*ExistsToInCtx)(unsafe.Pointer(bp /* &ctx */)).FppAnd + } + return (*ExistsToInCtx)(unsafe.Pointer(bp /* &ctx */)).FpInLhs +} + +// Term idxTerm of the WHERE clause passed as the second argument is an +// EXISTS expression with a correlated SELECT statement on the RHS. +// This function analyzes the SELECT statement, and if possible adds an +// equivalent "? IN(SELECT...)" virtual term to the WHERE clause. +// +// For an EXISTS term such as the following: +// +// EXISTS (SELECT ... FROM WHERE = AND ) +// +// The virtual IN() term added is: +// +// IN (SELECT FROM WHERE ) +// +// The virtual term is only added if the following conditions are met: +// +// 1. The sub-select must not be an aggregate or use window functions, +// +// 2. The sub-select must not be a compound SELECT, +// +// 3. Expression must refer to at least one column from the outer +// query, and must not refer to any column from the inner query +// (i.e. from ). +// +// 4. and must not refer to any values from the outer query. +// In other words, once has been removed, the inner query +// must not be correlated. +// +func exprAnalyzeExists(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:147486:13: */ + bp := tls.Alloc(16) + defer tls.Free(16) + + var pParse uintptr = (*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse + var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) + var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr + var pSel uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + var pDup uintptr = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp /* pEq */)) = uintptr(0) + var pRet uintptr = uintptr(0) + var pInLhs uintptr = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 8 /* ppAnd */)) = uintptr(0) + var idxNew int32 + var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb + + if ((*Select)(unsafe.Pointer(pSel)).FselFlags & U32(SF_Aggregate)) != 0 { + return + } + if (*Select)(unsafe.Pointer(pSel)).FpWin != 0 { + return + } + if (*Select)(unsafe.Pointer(pSel)).FpPrior != 0 { + return + } + if (*Select)(unsafe.Pointer(pSel)).FpWhere == uintptr(0) { + return + } + if uintptr(0) == exprAnalyzeExistsFindEq(tls, pSel, uintptr(0), uintptr(0)) { + return + } + + pDup = Xsqlite3ExprDup(tls, db, pExpr, 0) + if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + Xsqlite3ExprDelete(tls, db, pDup) + return + } + pSel = *(*uintptr)(unsafe.Pointer(pDup + 32 /* &.x */)) + Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(pSel)).FpEList) + (*Select)(unsafe.Pointer(pSel)).FpEList = uintptr(0) + + pInLhs = exprAnalyzeExistsFindEq(tls, pSel, bp /* &pEq */, bp+8 /* &ppAnd */) + + if pInLhs == (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pEq */)))).FpLeft { + pRet = (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pEq */)))).FpRight + } else { + var p uintptr = Xsqlite3ExprCompareCollSeq(tls, pParse, *(*uintptr)(unsafe.Pointer(bp /* pEq */))) + pInLhs = Xsqlite3ExprAddCollateString(tls, pParse, pInLhs, func() uintptr { + if p != 0 { + return (*CollSeq)(unsafe.Pointer(p)).FzName + } + return ts + 266 /* "BINARY" */ + }()) + pRet = (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pEq */)))).FpLeft + } + + (*Expr)(unsafe.Pointer(pDup)).Fop = U8(TK_IN) + (*Expr)(unsafe.Pointer(pDup)).FpLeft = pInLhs + *(*U32)(unsafe.Pointer(pDup + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_VarSelect))) + if int32((*Expr)(unsafe.Pointer(pRet)).Fop) == TK_VECTOR { + (*Select)(unsafe.Pointer(pSel)).FpEList = *(*uintptr)(unsafe.Pointer(pRet + 32 /* &.x */)) + *(*uintptr)(unsafe.Pointer(pRet + 32 /* &.x */)) = uintptr(0) + Xsqlite3ExprDelete(tls, db, pRet) + } else { + (*Select)(unsafe.Pointer(pSel)).FpEList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), pRet) + } + (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pEq */)))).FpLeft = uintptr(0) + (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pEq */)))).FpRight = uintptr(0) + if *(*uintptr)(unsafe.Pointer(bp + 8 /* ppAnd */)) != 0 { + var pAnd uintptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* ppAnd */)))) + var pOther uintptr + if (*Expr)(unsafe.Pointer(pAnd)).FpLeft == *(*uintptr)(unsafe.Pointer(bp /* pEq */)) { + pOther = (*Expr)(unsafe.Pointer(pAnd)).FpRight + } else { + pOther = (*Expr)(unsafe.Pointer(pAnd)).FpLeft + } + (*Expr)(unsafe.Pointer(pAnd)).FpLeft = libc.AssignPtrUintptr(pAnd+24 /* &.pRight */, uintptr(0)) + Xsqlite3ExprDelete(tls, db, pAnd) + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* ppAnd */)))) = pOther + } else { + + (*Select)(unsafe.Pointer(pSel)).FpWhere = uintptr(0) + } + Xsqlite3ExprDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp /* pEq */))) + + idxNew = whereClauseInsert(tls, pWC, pDup, (uint16(TERM_VIRTUAL | TERM_DYNAMIC))) + exprAnalyze(tls, pSrc, pWC, idxNew) + markTermAsChild(tls, pWC, idxNew, idxTerm) + *(*U16)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56 + 18 /* &.wtFlags */)) |= U16((TERM_COPIED)) +} + // 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 @@ -125338,7 +127632,7 @@ func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol // 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 *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:145024:13: */ +func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:147591:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -125361,8 +127655,8 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) - pMaskSet = (pWInfo + 656 /* &.sMaskSet */) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) + pMaskSet = (pWInfo + 592 /* &.sMaskSet */) pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr prereqLeft = Xsqlite3WhereExprUsage(tls, pMaskSet, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) @@ -125372,7 +127666,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if Xsqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) } else { (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) @@ -125387,13 +127681,13 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect != 0 { *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_VARSELECT)) } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { - var x Bitmask = Xsqlite3WhereGetMask(tls, pMaskSet, int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable)) + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { + var x Bitmask = Xsqlite3WhereGetMask(tls, pMaskSet, (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) prereqAll = prereqAll | (x) extraRight = (x - uint64(1)) // ON clause terms may not be used with an index // on left table of a LEFT JOIN. Ticket #3015 if (prereqAll >> 1) >= x { - Xsqlite3ErrorMsg(tls, pParse, ts+19142 /* "ON clause refere..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+19618 /* "ON clause refere..." */, 0) return } } @@ -125408,19 +127702,19 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s var pRight uintptr = Xsqlite3ExprSkipCollate(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) var opMask U16 if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & prereqLeft) == uint64(0) { - opMask = WO_ALL + opMask = uint16(WO_ALL) } else { - opMask = WO_EQUIV + opMask = uint16(WO_EQUIV) } - if (*WhereTerm)(unsafe.Pointer(pTerm)).FiField > 0 { + if *(*int32)(unsafe.Pointer((pTerm + 32 /* &.u */ /* &.x */) + 4 /* &.iField */)) > 0 { - pLeft = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pLeft + 32 /* &.x */)) + 8 /* &.a */) + uintptr(((*WhereTerm)(unsafe.Pointer(pTerm)).FiField-1))*32)).FpExpr + pLeft = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pLeft + 32 /* &.x */)) + 8 /* &.a */) + uintptr((*(*int32)(unsafe.Pointer((pTerm + 32 /* &.u */ /* &.x */) + 4 /* &.iField */))-1))*32)).FpExpr } if exprMightBeIndexed(tls, pSrc, prereqLeft, bp /* &aiCurCol[0] */, pLeft, op) != 0 { (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */)) - *(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)) = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */ + 1*4)) + *(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */ + 1*4)) (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = (U16(int32(operatorMask(tls, op)) & int32(opMask))) } if op == TK_IS { @@ -125443,17 +127737,17 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if idxNew == 0 { return } - pNew = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*64) + pNew = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*56) markTermAsChild(tls, pWC, idxNew, idxTerm) if op == TK_IS { *(*U16)(unsafe.Pointer(pNew + 18 /* &.wtFlags */)) |= U16((TERM_IS)) } - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_COPIED)) if termIsEquivalence(tls, pParse, pDup) != 0 { *(*U16)(unsafe.Pointer(pTerm + 20 /* &.eOperator */)) |= U16((WO_EQUIV)) - eExtraOp = WO_EQUIV + eExtraOp = U16(WO_EQUIV) } } else { pDup = pExpr @@ -125461,11 +127755,17 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s } *(*U16)(unsafe.Pointer(pNew + 18 /* &.wtFlags */)) |= U16((int32(exprCommute(tls, pParse, pDup)))) (*WhereTerm)(unsafe.Pointer(pNew)).FleftCursor = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */)) - *(*int32)(unsafe.Pointer(pNew + 40 /* &.u */)) = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */ + 1*4)) + *(*int32)(unsafe.Pointer(pNew + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */ + 1*4)) (*WhereTerm)(unsafe.Pointer(pNew)).FprereqRight = (prereqLeft | extraRight) (*WhereTerm)(unsafe.Pointer(pNew)).FprereqAll = prereqAll (*WhereTerm)(unsafe.Pointer(pNew)).FeOperator = (U16((int32(operatorMask(tls, int32((*Expr)(unsafe.Pointer(pDup)).Fop))) + int32(eExtraOp)) & int32(opMask))) + } else if (op == TK_ISNULL) && (0 == Xsqlite3ExprCanBeNull(tls, pLeft)) { + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUEFALSE) + *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = ts + 5644 /* "false" */ + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_IsFalse)) + (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) + (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(0) } } else if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_BETWEEN) && (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) { var pList uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) @@ -125481,28 +127781,48 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s idxNew = whereClauseInsert(tls, pWC, pNewExpr, (uint16(TERM_VIRTUAL | TERM_DYNAMIC))) exprAnalyze(tls, pSrc, pWC, idxNew) - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) markTermAsChild(tls, pWC, idxNew, idxTerm) } } else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_OR { exprAnalyzeOrTerm(tls, pSrc, pWC, idxTerm) - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) - } + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) + } else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_EXISTS { + // Perhaps treat an EXISTS operator as an IN operator + if (((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_VarSelect)) != U32(0)) && + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_ExistsToIN))) == U32(0)) { + exprAnalyzeExists(tls, pSrc, pWC, idxTerm) + } + } else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL { + if ((int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_COLUMN) && + (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiColumn) >= 0)) && + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { + var pNewExpr uintptr + var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft + var idxNew int32 + var pNewTerm uintptr - // Add constraints to reduce the search space on a LIKE or GLOB - // operator. - // - // A like pattern of the form "x LIKE 'aBc%'" is changed into constraints - // - // x>='ABC' AND x<'abd' AND x LIKE 'aBc%' - // - // The last character of the prefix "abc" is incremented to form the - // termination condition "abd". If case is not significant (the default - // for LIKE) then the lower-bound is made all uppercase and the upper- - // bound is made all lowercase so that the bounds also work when comparing - // BLOBs. - if (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) && + pNewExpr = Xsqlite3PExpr(tls, pParse, TK_GT, + Xsqlite3ExprDup(tls, db, pLeft, 0), + Xsqlite3ExprAlloc(tls, db, TK_NULL, uintptr(0), 0)) + + idxNew = whereClauseInsert(tls, pWC, pNewExpr, + (uint16((TERM_VIRTUAL | TERM_DYNAMIC) | TERM_VNULL))) + if idxNew != 0 { + pNewTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*56) + (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = uint64(0) + (*WhereTerm)(unsafe.Pointer(pNewTerm)).FleftCursor = (*Expr)(unsafe.Pointer(pLeft)).FiTable + *(*int32)(unsafe.Pointer(pNewTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) = int32((*Expr)(unsafe.Pointer(pLeft)).FiColumn) + (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = (U16(int32(WO_EQ) << (TK_GT - TK_EQ))) + markTermAsChild(tls, pWC, idxNew, idxTerm) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) + *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_COPIED)) + (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqAll = (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll + } + } + } else if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && + (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND)) && (isLikeOrGlob(tls, pParse, pExpr, bp+8 /* &pStr1 */, bp+16 /* &isComplete */, bp+20 /* &noCase */) != 0) { var pLeft uintptr // LHS of LIKE/GLOB operator var pStr2 uintptr // Copy of pStr1 - RHS of LIKE/GLOB operator @@ -125549,7 +127869,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s } zCollSeqName = func() uintptr { if *(*int32)(unsafe.Pointer(bp + 20 /* noCase */)) != 0 { - return ts + 19183 /* "NOCASE" */ + return ts + 19659 /* "NOCASE" */ } return uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)) }() @@ -125569,22 +127889,56 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s idxNew2 = whereClauseInsert(tls, pWC, pNewExpr2, wtFlags) exprAnalyze(tls, pSrc, pWC, idxNew2) - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) if *(*int32)(unsafe.Pointer(bp + 16 /* isComplete */)) != 0 { markTermAsChild(tls, pWC, idxNew1, idxTerm) markTermAsChild(tls, pWC, idxNew2, idxTerm) } } - // Add a WO_AUX auxiliary term to the constraint set if the - // current expression is of the form "column OP expr" where OP - // is an operator that gets passed into virtual tables but which is - // not normally optimized for ordinary tables. In other words, OP - // is one of MATCH, LIKE, GLOB, REGEXP, !=, IS, IS NOT, or NOT NULL. - // This information is used by the xBestIndex methods of - // virtual tables. The native query optimizer does not attempt - // to do anything with MATCH functions. - if int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND { + // If there is a vector == or IS term - e.g. "(a, b) == (?, ?)" - create + // new terms for each component comparison - "a = ?" and "b = ?". The + // new terms completely replace the original vector comparison, which is + // no longer used. + // + // This is only required if at least one side of the comparison operation + // is not a sub-select. + if (((((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_EQ) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IS)) && + ((libc.AssignInt32(&nLeft, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))) > 1)) && + (Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) == nLeft)) && + ((((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags & U32(EP_xIsSelect)) == U32(0)) || + (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fflags & U32(EP_xIsSelect)) == U32(0)))) && + (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) { + var i int32 + for i = 0; i < nLeft; i++ { + var idxNew int32 + var pNew uintptr + var pLeft uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, i) + var pRight uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, i) + + pNew = Xsqlite3PExpr(tls, pParse, int32((*Expr)(unsafe.Pointer(pExpr)).Fop), pLeft, pRight) + transferJoinMarkings(tls, pNew, pExpr) + idxNew = whereClauseInsert(tls, pWC, pNew, uint16(TERM_DYNAMIC)) + exprAnalyze(tls, pSrc, pWC, idxNew) + } + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) + *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_CODED | TERM_VIRTUAL)) // Disable the original + (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(0) + } else if (((((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IN) && + (*(*int32)(unsafe.Pointer((pTerm + 32 /* &.u */ /* &.x */) + 4 /* &.iField */)) == 0)) && + (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR)) && + ((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpPrior == uintptr(0))) && + ((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpWin == uintptr(0))) && + (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) { + var i int32 + for i = 0; i < Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft); i++ { + var idxNew int32 + idxNew = whereClauseInsert(tls, pWC, pExpr, uint16(TERM_VIRTUAL)) + *(*int32)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*56 + 32 /* &.u */ /* &.x */ + 4 /* &.iField */)) = (i + 1) + exprAnalyze(tls, pSrc, pWC, idxNew) + markTermAsChild(tls, pWC, idxNew, idxTerm) + } + } else if int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND { *(*uintptr)(unsafe.Pointer(bp + 40 /* pRight */)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 32 /* pLeft */)) = uintptr(0) var res int32 = isAuxiliaryVtabOperator(tls, db, pExpr, bp+24 /* &eOp2 */, bp+32 /* &pLeft */, bp+40 /* &pRight */) @@ -125600,20 +127954,20 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s var pNewExpr uintptr pNewExpr = Xsqlite3PExpr(tls, pParse, TK_MATCH, uintptr(0), Xsqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40 /* pRight */)), 0)) - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) && (pNewExpr != 0) { - *(*U32)(unsafe.Pointer(pNewExpr + 4 /* &.flags */)) |= (EP_FromJoin) + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) && (pNewExpr != 0) { + *(*U32)(unsafe.Pointer(pNewExpr + 4 /* &.flags */)) |= (U32(EP_FromJoin)) (*Expr)(unsafe.Pointer(pNewExpr)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable } idxNew = whereClauseInsert(tls, pWC, pNewExpr, (uint16(TERM_VIRTUAL | TERM_DYNAMIC))) - pNewTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*64) + pNewTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*56) (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = prereqExpr (*WhereTerm)(unsafe.Pointer(pNewTerm)).FleftCursor = (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pLeft */)))).FiTable - *(*int32)(unsafe.Pointer(pNewTerm + 40 /* &.u */)) = int32((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pLeft */)))).FiColumn) - (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = WO_AUX + *(*int32)(unsafe.Pointer(pNewTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) = int32((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pLeft */)))).FiColumn) + (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = U16(WO_AUX) (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeMatchOp = *(*uint8)(unsafe.Pointer(bp + 24 /* eOp2 */)) markTermAsChild(tls, pWC, idxNew, idxTerm) - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_COPIED)) (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqAll = (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll } @@ -125626,101 +127980,14 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s } } - // If there is a vector == or IS term - e.g. "(a, b) == (?, ?)" - create - // new terms for each component comparison - "a = ?" and "b = ?". The - // new terms completely replace the original vector comparison, which is - // no longer used. - // - // This is only required if at least one side of the comparison operation - // is not a sub-select. - if ((((int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) && - ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_EQ) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IS))) && - ((libc.AssignInt32(&nLeft, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))) > 1)) && - (Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) == nLeft)) && - ((((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags & EP_xIsSelect) == U32(0)) || - (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fflags & EP_xIsSelect) == U32(0))) { - var i int32 - for i = 0; i < nLeft; i++ { - var idxNew int32 - var pNew uintptr - var pLeft uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, i) - var pRight uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, i) - - pNew = Xsqlite3PExpr(tls, pParse, int32((*Expr)(unsafe.Pointer(pExpr)).Fop), pLeft, pRight) - transferJoinMarkings(tls, pNew, pExpr) - idxNew = whereClauseInsert(tls, pWC, pNew, TERM_DYNAMIC) - exprAnalyze(tls, pSrc, pWC, idxNew) - } - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) - *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_CODED | TERM_VIRTUAL)) // Disable the original - (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(0) - } - - // If there is a vector IN term - e.g. "(a, b) IN (SELECT ...)" - create - // a virtual term for each vector component. The expression object - // used by each such virtual term is pExpr (the full vector IN(...) - // expression). The WhereTerm.iField variable identifies the index within - // the vector on the LHS that the virtual term represents. - // - // This only works if the RHS is a simple SELECT (not a compound) that does - // not use window functions. - if (((((int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IN)) && ((*WhereTerm)(unsafe.Pointer(pTerm)).FiField == 0)) && - (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR)) && - ((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpPrior == uintptr(0))) && - ((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpWin == uintptr(0)) { - var i int32 - for i = 0; i < Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft); i++ { - var idxNew int32 - idxNew = whereClauseInsert(tls, pWC, pExpr, TERM_VIRTUAL) - (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*64)).FiField = (i + 1) - exprAnalyze(tls, pSrc, pWC, idxNew) - markTermAsChild(tls, pWC, idxNew, idxTerm) - } - } - - // When sqlite_stat4 histogram data is available an operator of the - // form "x IS NOT NULL" can sometimes be evaluated more efficiently - // as "x>NULL" if x is not an INTEGER PRIMARY KEY. So construct a - // virtual term of that form. - // - // Note that the virtual term must be tagged with TERM_VNULL. - if ((((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL) && - (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_COLUMN)) && - (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiColumn) >= 0)) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0))) && - ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0) { - var pNewExpr uintptr - var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft - var idxNew int32 - var pNewTerm uintptr - - pNewExpr = Xsqlite3PExpr(tls, pParse, TK_GT, - Xsqlite3ExprDup(tls, db, pLeft, 0), - Xsqlite3ExprAlloc(tls, db, TK_NULL, uintptr(0), 0)) - - idxNew = whereClauseInsert(tls, pWC, pNewExpr, - (uint16((TERM_VIRTUAL | TERM_DYNAMIC) | TERM_VNULL))) - if idxNew != 0 { - pNewTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*64) - (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = uint64(0) - (*WhereTerm)(unsafe.Pointer(pNewTerm)).FleftCursor = (*Expr)(unsafe.Pointer(pLeft)).FiTable - *(*int32)(unsafe.Pointer(pNewTerm + 40 /* &.u */)) = int32((*Expr)(unsafe.Pointer(pLeft)).FiColumn) - (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = (U16(int32(WO_EQ) << (TK_GT - TK_EQ))) - markTermAsChild(tls, pWC, idxNew, idxTerm) - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) - *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_COPIED)) - (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqAll = (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll - } - } - // Prevent ON clause terms of a LEFT JOIN from being used to drive // an index for tables to the left of the join. - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) - *(*Bitmask)(unsafe.Pointer(pTerm + 48 /* &.prereqRight */)) |= (extraRight) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) + *(*Bitmask)(unsafe.Pointer(pTerm + 40 /* &.prereqRight */)) |= (extraRight) } -var ops = [2]U8{TK_GE, TK_LE} /* sqlite3.c:145161:21 */ +var ops = [2]U8{U8(TK_GE), U8(TK_LE)} /* sqlite3.c:147734:21 */ // ************************************************************************** // @@ -125743,9 +128010,10 @@ var ops = [2]U8{TK_GE, TK_LE} /* sqlite3.c:145161:21 */ // 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 Xsqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op U8) { /* sqlite3.c:145447:21: */ +func Xsqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op U8) { /* sqlite3.c:148030:21: */ var pE2 uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr) (*WhereClause)(unsafe.Pointer(pWC)).Fop = op + if pE2 == uintptr(0) { return } @@ -125758,7 +128026,7 @@ func Xsqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op U8) { /* s } // Initialize a preallocated WhereClause structure. -func Xsqlite3WhereClauseInit(tls *libc.TLS, pWC uintptr, pWInfo uintptr) { /* sqlite3.c:145462:21: */ +func Xsqlite3WhereClauseInit(tls *libc.TLS, pWC uintptr, pWInfo uintptr) { /* sqlite3.c:148046:21: */ (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo = pWInfo (*WhereClause)(unsafe.Pointer(pWC)).FhasOr = U8(0) (*WhereClause)(unsafe.Pointer(pWC)).FpOuter = uintptr(0) @@ -125770,7 +128038,7 @@ func Xsqlite3WhereClauseInit(tls *libc.TLS, pWC uintptr, pWInfo uintptr) { /* sq // Deallocate a WhereClause structure. The WhereClause structure // itself is not freed. This routine is the inverse of // sqlite3WhereClauseInit(). -func Xsqlite3WhereClauseClear(tls *libc.TLS, pWC uintptr) { /* sqlite3.c:145479:21: */ +func Xsqlite3WhereClauseClear(tls *libc.TLS, pWC uintptr) { /* sqlite3.c:148063:21: */ var i int32 var a uintptr var db uintptr = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb @@ -125785,16 +128053,16 @@ __1: Xsqlite3ExprDelete(tls, db, (*WhereTerm)(unsafe.Pointer(a)).FpExpr) } if (int32((*WhereTerm)(unsafe.Pointer(a)).FwtFlags) & TERM_ORINFO) != 0 { - whereOrInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 40 /* &.u */))) + whereOrInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 32 /* &.u */))) } else if (int32((*WhereTerm)(unsafe.Pointer(a)).FwtFlags) & TERM_ANDINFO) != 0 { - whereAndInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 40 /* &.u */))) + whereAndInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 32 /* &.u */))) } } goto __2 __2: i-- - a += 64 + a += 56 goto __1 goto __3 __3: @@ -125807,9 +128075,9 @@ __3: // These routines walk (recursively) an expression tree and generate // a bitmask indicating which tables are used in that expression // tree. -func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:145504:24: */ +func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:148088:24: */ var mask Bitmask - if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_FixedCol)) != U32(0)) { + if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_FixedCol))) != U32(0)) { return Xsqlite3WhereGetMask(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FiTable) } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0) { @@ -125826,8 +128094,8 @@ func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmas if (*Expr)(unsafe.Pointer(p)).FpRight != 0 { mask = mask | (Xsqlite3WhereExprUsageNN(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FpRight)) - } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_VarSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_VarSelect))) != U32(0) { (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect = 1 } mask = mask | (exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)))) @@ -125842,14 +128110,14 @@ func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmas return mask } -func Xsqlite3WhereExprUsage(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:145532:24: */ +func Xsqlite3WhereExprUsage(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:148116:24: */ if p != 0 { return Xsqlite3WhereExprUsageNN(tls, pMaskSet, p) } return uint64(0) } -func Xsqlite3WhereExprListUsage(tls *libc.TLS, pMaskSet uintptr, pList uintptr) Bitmask { /* sqlite3.c:145535:24: */ +func Xsqlite3WhereExprListUsage(tls *libc.TLS, pMaskSet uintptr, pList uintptr) Bitmask { /* sqlite3.c:148119:24: */ var i int32 var mask Bitmask = uint64(0) if pList != 0 { @@ -125866,7 +128134,7 @@ func Xsqlite3WhereExprListUsage(tls *libc.TLS, pMaskSet uintptr, pList uintptr) // 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 Xsqlite3WhereExprAnalyze(tls *libc.TLS, pTabList uintptr, pWC uintptr) { /* sqlite3.c:145555:21: */ +func Xsqlite3WhereExprAnalyze(tls *libc.TLS, pTabList uintptr, pWC uintptr) { /* sqlite3.c:148139:21: */ var i int32 for i = ((*WhereClause)(unsafe.Pointer(pWC)).FnTerm - 1); i >= 0; i-- { exprAnalyze(tls, pTabList, pWC, i) @@ -125878,7 +128146,7 @@ func Xsqlite3WhereExprAnalyze(tls *libc.TLS, pTabList uintptr, pWC uintptr) { /* // // Each function argument translates into an equality constraint against // a HIDDEN column in the table. -func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC uintptr) { /* sqlite3.c:145572:21: */ +func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC uintptr) { /* sqlite3.c:148156:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -125891,7 +128159,7 @@ func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC if (int32(*(*uint8)(unsafe.Pointer((pItem + 60 /* &.fg */) + 4 /* &.isTabFunc */)) & 0x4 >> 2)) == 0 { return } - pTab = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab + pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab pArgs = *(*uintptr)(unsafe.Pointer(pItem + 96 /* &.u1 */)) if pArgs == uintptr(0) { @@ -125903,7 +128171,7 @@ func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*Table)(unsafe.Pointer(pTab)).FnCol) { - Xsqlite3ErrorMsg(tls, pParse, ts+19190, /* "too many argumen..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+19666, /* "too many argumen..." */ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, j)) return } @@ -125911,16 +128179,16 @@ func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC if pColRef == uintptr(0) { return } - (*Expr)(unsafe.Pointer(pColRef)).FiTable = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor + (*Expr)(unsafe.Pointer(pColRef)).FiTable = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor (*Expr)(unsafe.Pointer(pColRef)).FiColumn = YnVar(libc.PostIncInt32(&k, 1)) *(*uintptr)(unsafe.Pointer(pColRef + 64 /* &.y */)) = pTab pRhs = Xsqlite3PExpr(tls, pParse, TK_UPLUS, Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*ExprList_item)(unsafe.Pointer((pArgs+8 /* &.a */)+uintptr(j)*32)).FpExpr, 0), uintptr(0)) pTerm = Xsqlite3PExpr(tls, pParse, TK_EQ, pColRef, pRhs) - if (int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) != 0 { - Xsqlite3SetJoinExpr(tls, pTerm, (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor) + if (int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) != 0 { + Xsqlite3SetJoinExpr(tls, pTerm, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor) } - whereClauseInsert(tls, pWC, pTerm, TERM_DYNAMIC) + whereClauseInsert(tls, pWC, pTerm, uint16(TERM_DYNAMIC)) } } @@ -125955,7 +128223,7 @@ func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC type HiddenIndexInfo1 = struct { FpWC uintptr FpParse uintptr -} /* sqlite3.c:145642:9 */ +} /* sqlite3.c:148226:9 */ //************* End of whereexpr.c ****************************************** //************* Begin file where.c ****************************************** @@ -125985,18 +128253,16 @@ type HiddenIndexInfo1 = struct { // This object is not an API and can be changed from one release to the // next. As long as allocateIndexInfo() and sqlite3_vtab_collation() // agree on the structure, all will be well. -type HiddenIndexInfo = HiddenIndexInfo1 /* sqlite3.c:145642:32 */ - -// Test variable that can be set to enable WHERE tracing +type HiddenIndexInfo = HiddenIndexInfo1 /* sqlite3.c:148226:32 */ // Return the estimated number of output rows from a WHERE clause -func Xsqlite3WhereOutputRowCount(tls *libc.TLS, pWInfo uintptr) LogEst { /* sqlite3.c:145660:23: */ +func Xsqlite3WhereOutputRowCount(tls *libc.TLS, pWInfo uintptr) LogEst { /* sqlite3.c:148238:23: */ return (*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut } // Return one of the WHERE_DISTINCT_xxxxx values to indicate how this // WHERE clause returns outputs for DISTINCT processing. -func Xsqlite3WhereIsDistinct(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145668:20: */ +func Xsqlite3WhereIsDistinct(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:148246:20: */ return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) } @@ -126006,7 +128272,7 @@ func Xsqlite3WhereIsDistinct(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c // terms means that no sorting is needed at all. A return that // is positive but less than the number of ORDER BY terms means that // block sorting is required. -func Xsqlite3WhereIsOrdered(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145680:20: */ +func Xsqlite3WhereIsOrdered(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:148258:20: */ return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) } @@ -126031,28 +128297,56 @@ func Xsqlite3WhereIsOrdered(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c: // Returning the continuation the second inner loop is an optimization // that might make the code run a little faster, but should not change // the final answer. -func Xsqlite3WhereOrderByLimitOptLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145707:20: */ +func Xsqlite3WhereOrderByLimitOptLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:148285:20: */ var pInner uintptr if !((int32(*(*uint8)(unsafe.Pointer(pWInfo + 68 /* &.bOrderedInnerLoop */)) & 0x4 >> 2)) != 0) { // The ORDER BY LIMIT optimization does not apply. Jump to the // continuation of the inner-most loop. return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiContinue } - pInner = ((pWInfo + 920 /* &.a */) + uintptr((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-1))*88) + pInner = ((pWInfo + 856 /* &.a */) + uintptr((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-1))*88) return (*WhereLevel)(unsafe.Pointer(pInner)).FaddrNxt } +// While generating code for the min/max optimization, after handling +// the aggregate-step call to min() or max(), check to see if any +// additional looping is required. If the output order is such that +// we are certain that the correct answer has already been found, then +// code an OP_Goto to by pass subsequent processing. +// +// Any extra OP_Goto that is coded here is an optimization. The +// correct answer should be obtained regardless. This OP_Goto just +// makes the answer appear faster. +func Xsqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { /* sqlite3.c:148308:21: */ + var pInner uintptr + var i int32 + if !((int32(*(*uint8)(unsafe.Pointer(pWInfo + 68 /* &.bOrderedInnerLoop */)) & 0x4 >> 2)) != 0) { + return + } + if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == 0 { + return + } + for i = (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1); i >= 0; i-- { + pInner = ((pWInfo + 856 /* &.a */) + uintptr(i)*88) + if ((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags & U32(WHERE_COLUMN_IN)) != U32(0) { + Xsqlite3VdbeGoto(tls, v, (*WhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) + return + } + } + Xsqlite3VdbeGoto(tls, v, (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak) +} + // Return the VDBE address or label to jump to in order to continue // immediately with the next row of a WHERE clause. -func Xsqlite3WhereContinueLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145723:20: */ +func Xsqlite3WhereContinueLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:148327:20: */ return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiContinue } // Return the VDBE address or label to jump to in order to break // out of a WHERE loop. -func Xsqlite3WhereBreakLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145732:20: */ +func Xsqlite3WhereBreakLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:148336:20: */ return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak } @@ -126071,19 +128365,19 @@ func Xsqlite3WhereBreakLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c // // aiCur[0] and aiCur[1] both get -1 if the where-clause logic is // unable to use the ONEPASS optimization. -func Xsqlite3WhereOkOnePass(tls *libc.TLS, pWInfo uintptr, aiCur uintptr) int32 { /* sqlite3.c:145753:20: */ +func Xsqlite3WhereOkOnePass(tls *libc.TLS, pWInfo uintptr, aiCur uintptr) int32 { /* sqlite3.c:148357:20: */ libc.Xmemcpy(tls, aiCur, pWInfo+40 /* &.aiCurOnePass */, (uint64(unsafe.Sizeof(int32(0))) * uint64(2))) return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) } // Return TRUE if the WHERE loop uses the OP_DeferredSeek opcode to move // the data cursor to the row selected by the index cursor. -func Xsqlite3WhereUsesDeferredSeek(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145769:20: */ +func Xsqlite3WhereUsesDeferredSeek(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:148373:20: */ return (int32(*(*uint8)(unsafe.Pointer(pWInfo + 68 /* &.bDeferredSeek */)) & 0x1 >> 0)) } // Move the content of pSrc into pDest -func whereOrMove(tls *libc.TLS, pDest uintptr, pSrc uintptr) { /* sqlite3.c:145776:13: */ +func whereOrMove(tls *libc.TLS, pDest uintptr, pSrc uintptr) { /* sqlite3.c:148380:13: */ (*WhereOrSet)(unsafe.Pointer(pDest)).Fn = (*WhereOrSet)(unsafe.Pointer(pSrc)).Fn libc.Xmemcpy(tls, pDest+8 /* &.a */, pSrc+8 /* &.a */, (uint64((*WhereOrSet)(unsafe.Pointer(pDest)).Fn) * uint64(unsafe.Sizeof(WhereOrCost{})))) } @@ -126093,7 +128387,7 @@ func whereOrMove(tls *libc.TLS, pDest uintptr, pSrc uintptr) { /* sqlite3.c:1457 // 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 *libc.TLS, pSet uintptr, prereq Bitmask, rRun LogEst, nOut LogEst) int32 { /* sqlite3.c:145788:12: */ +func whereOrInsert(tls *libc.TLS, pSet uintptr, prereq Bitmask, rRun LogEst, nOut LogEst) int32 { /* sqlite3.c:148392:12: */ var i U16 var p uintptr i = (*WhereOrSet)(unsafe.Pointer(pSet)).Fn @@ -126170,7 +128464,7 @@ __13: // Return the bitmask for the given cursor number. Return 0 if // iCursor is not in the set. -func Xsqlite3WhereGetMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) Bitmask { /* sqlite3.c:145825:24: */ +func Xsqlite3WhereGetMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) Bitmask { /* sqlite3.c:148429:24: */ var i int32 for i = 0; i < (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn; i++ { @@ -126187,15 +128481,25 @@ func Xsqlite3WhereGetMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) Bitmas // tables in the FROM clause is limited by a test early in the // sqlite3WhereBegin() routine. So we know that the pMaskSet->ix[] // array will never overflow. -func createMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) { /* sqlite3.c:145844:13: */ +func createMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) { /* sqlite3.c:148448:13: */ *(*int32)(unsafe.Pointer((pMaskSet + 8 /* &.ix */) + uintptr(libc.PostIncInt32(&(*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn, 1))*4)) = iCursor } +// If the right-hand branch of the expression is a TK_COLUMN, then return +// a pointer to the right-hand branch. Otherwise, return NULL. +func whereRightSubexprIsColumn(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:148457:13: */ + p = Xsqlite3ExprSkipCollateAndLikely(tls, (*Expr)(unsafe.Pointer(p)).FpRight) + if (p != uintptr(0)) && (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) { + return p + } + return uintptr(0) +} + // 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 *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145854:18: */ +func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:148468:18: */ var iCur int32 // The cursor on the LHS of the term var iColumn I16 // The column on the LHS of the term. -1 for IPK var pX uintptr // An expression being tested @@ -126209,22 +128513,21 @@ func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145854:1 iCur = *(*int32)(unsafe.Pointer((pScan + 44 /* &.aiCur */) + uintptr((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv)-1))*4)) for ok := true; ok; ok = (pWC != uintptr(0)) { - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(k)*64) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(k)*56) __1: if !(k < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm) { goto __3 } { if ((((*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor == iCur) && - (*(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)) == int32(iColumn))) && + (*(*int32)(unsafe.Pointer((pTerm + 32 /* &.u */ /* &.x */) /* &.leftColumn */)) == int32(iColumn))) && ((int32(iColumn) != (-2)) || (Xsqlite3ExprCompareSkip(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft, (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr, iCur) == 0))) && - ((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= 1) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0))) { + ((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= 1) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) { if (((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_EQUIV) != 0) && (int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv) < (int32(uint64(unsafe.Sizeof([11]int32{})) / uint64(unsafe.Sizeof(int32(0))))))) && - (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pX, Xsqlite3ExprSkipCollateAndLikely(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight))))).Fop) == - TK_COLUMN) { + ((libc.AssignUintptr(&pX, whereRightSubexprIsColumn(tls, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))) != uintptr(0)) { var j int32 for j = 0; j < int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv); j++ { if (*(*int32)(unsafe.Pointer((pScan + 44 /* &.aiCur */) + uintptr(j)*4)) == (*Expr)(unsafe.Pointer(pX)).FiTable) && @@ -126273,7 +128576,7 @@ func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145854:1 goto __2 __2: k++ - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -126295,7 +128598,7 @@ func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145854:1 // It is factored out into a separate tail-recursion subroutine so that // the normal whereScanInit() routine, which is a high-runner, does not // need to push registers onto the stack as part of its prologue. -func whereScanInitIndexExpr(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145942:34: */ +func whereScanInitIndexExpr(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:148555:34: */ (*WhereScan)(unsafe.Pointer(pScan)).Fidxaff = Xsqlite3ExprAffinity(tls, (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr) return whereScanNext(tls, pScan) } @@ -126317,7 +128620,7 @@ func whereScanInitIndexExpr(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c // // If X is not the INTEGER PRIMARY KEY then X must be compatible with // index pIdx. -func whereScanInit(tls *libc.TLS, pScan uintptr, pWC uintptr, iCur int32, iColumn int32, opMask U32, pIdx uintptr) uintptr { /* sqlite3.c:145966:18: */ +func whereScanInit(tls *libc.TLS, pScan uintptr, pWC uintptr, iCur int32, iColumn int32, opMask U32, pIdx uintptr) uintptr { /* sqlite3.c:148579:18: */ (*WhereScan)(unsafe.Pointer(pScan)).FpOrigWC = pWC (*WhereScan)(unsafe.Pointer(pScan)).FpWC = pWC (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr = uintptr(0) @@ -126372,7 +128675,7 @@ func whereScanInit(tls *libc.TLS, pScan uintptr, pWC uintptr, iCur int32, iColum // 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 Xsqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32, notReady Bitmask, op U32, pIdx uintptr) uintptr { /* sqlite3.c:146030:26: */ +func Xsqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32, notReady Bitmask, op U32, pIdx uintptr) uintptr { /* sqlite3.c:148643:26: */ bp := tls.Alloc(112) defer tls.Free(112) @@ -126402,13 +128705,14 @@ func Xsqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32 // // If such an expression is found, its index in pList->a[] is returned. If // no expression is found, -1 is returned. -func findIndexCol(tls *libc.TLS, pParse uintptr, pList uintptr, iBase int32, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:146064:12: */ +func findIndexCol(tls *libc.TLS, pParse uintptr, pList uintptr, iBase int32, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:148677:12: */ var i int32 var zColl uintptr = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(iCol)*8)) for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ { var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*32)).FpExpr) - if ((int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && + if (((p != uintptr(0)) && + (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN)) && (int32((*Expr)(unsafe.Pointer(p)).FiColumn) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2))))) && ((*Expr)(unsafe.Pointer(p)).FiTable == iBase) { var pColl uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*32)).FpExpr) @@ -126422,7 +128726,7 @@ func findIndexCol(tls *libc.TLS, pParse uintptr, pList uintptr, iBase int32, pId } // Return TRUE if the iCol-th column of index pIdx is NOT NULL -func indexColumnNotNull(tls *libc.TLS, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:146093:12: */ +func indexColumnNotNull(tls *libc.TLS, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:148707:12: */ var j int32 j = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2))) @@ -126443,7 +128747,7 @@ func indexColumnNotNull(tls *libc.TLS, pIdx uintptr, iCol int32) int32 { /* sqli // // 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 *libc.TLS, pParse uintptr, pTabList uintptr, pWC uintptr, pDistinct uintptr) int32 { /* sqlite3.c:146116:12: */ +func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC uintptr, pDistinct uintptr) int32 { /* sqlite3.c:148730:12: */ var pTab uintptr var pIdx uintptr var i int32 @@ -126455,14 +128759,17 @@ func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC ui if (*SrcList)(unsafe.Pointer(pTabList)).FnSrc != 1 { return 0 } - iBase = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor - pTab = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab + iBase = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor + pTab = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab // If any of the expressions is an IPK column on table iBase, then return // true. Note: The (p->iTable==iBase) part of this test may be false if the // current SELECT is a correlated sub-query. for i = 0; i < (*ExprList)(unsafe.Pointer(pDistinct)).FnExpr; i++ { var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pDistinct+8 /* &.a */)+uintptr(i)*32)).FpExpr) + if p == uintptr(0) { + continue + } if ((int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(p)).FiTable == iBase)) && (int32((*Expr)(unsafe.Pointer(p)).FiColumn) < 0) { return 1 } @@ -126485,7 +128792,7 @@ func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC ui continue } for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); i++ { - if uintptr(0) == Xsqlite3WhereFindTerm(tls, pWC, iBase, i, libc.CplUint64(uint64(0)), WO_EQ, pIdx) { + if uintptr(0) == Xsqlite3WhereFindTerm(tls, pWC, iBase, i, libc.CplUint64(uint64(0)), uint32(WO_EQ), pIdx) { if findIndexCol(tls, pParse, pDistinct, iBase, pIdx, i) < 0 { break } @@ -126504,7 +128811,7 @@ func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC ui } // Estimate the logarithm of the input value to base 2. -func estLog(tls *libc.TLS, N LogEst) LogEst { /* sqlite3.c:146177:15: */ +func estLog(tls *libc.TLS, N LogEst) LogEst { /* sqlite3.c:148792:15: */ if int32(N) <= 10 { return int16(0) } @@ -126521,7 +128828,7 @@ func estLog(tls *libc.TLS, N LogEst) LogEst { /* sqlite3.c:146177:15: */ // cursor iTabCur are transformed into OP_Sequence opcode for the // iAutoidxCur cursor, in order to generate unique rowids for the // automatic index being generated. -func translateColumnToCopy(tls *libc.TLS, pParse uintptr, iStart int32, iTabCur int32, iRegister int32, iAutoidxCur int32) { /* sqlite3.c:146193:13: */ +func translateColumnToCopy(tls *libc.TLS, pParse uintptr, iStart int32, iTabCur int32, iRegister int32, iAutoidxCur int32) { /* sqlite3.c:148808:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var pOp uintptr = Xsqlite3VdbeGetOp(tls, v, iStart) var iEnd int32 = Xsqlite3VdbeCurrentAddr(tls, v) @@ -126537,16 +128844,16 @@ __1: goto __2 } if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column { - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Copy + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Copy) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = ((*VdbeOp)(unsafe.Pointer(pOp)).Fp2 + iRegister) (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = 0 } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Rowid { if iAutoidxCur != 0 { - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Sequence + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Sequence) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = iAutoidxCur } else { - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Null + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Null) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = 0 (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = 0 } @@ -126570,16 +128877,16 @@ __3: // 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 *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitmask) int32 { /* sqlite3.c:146275:12: */ +func termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitmask) int32 { /* sqlite3.c:148890:12: */ var aff int8 - if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor { + if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor { return 0 } if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & (WO_EQ | WO_IS)) == 0 { return 0 } - if (((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && - !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0))) && + if (((int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && + !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IS) != 0) { // Cannot use an IS term from the WHERE clause as an index driver for // the RHS of a LEFT JOIN. Such a term can only be used if it is from @@ -126589,10 +128896,10 @@ func termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitm if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & notReady) != uint64(0) { return 0 } - if *(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)) < 0 { + if *(*int32)(unsafe.Pointer((pTerm + 32 /* &.u */ /* &.x */) /* &.leftColumn */)) < 0 { return 0 } - aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FaCol + uintptr(*(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)))*32)).Faffinity + aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FaCol + uintptr(*(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)))*32)).Faffinity if !(Xsqlite3IndexAffinityOk(tls, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr, aff) != 0) { return 0 } @@ -126603,7 +128910,7 @@ func termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitm // 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 *libc.TLS, pParse uintptr, pWC uintptr, pSrc uintptr, notReady Bitmask, pLevel uintptr) { /* sqlite3.c:146308:13: */ +func constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, pSrc uintptr, notReady Bitmask, pLevel uintptr) { /* sqlite3.c:148923:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -126652,8 +128959,8 @@ func constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, pSrc ui // Count the number of columns that will be added to the index // and used to match WHERE clause constraints nKeyCol = 0 - pTable = (*SrcList_item)(unsafe.Pointer(pSrc)).FpTab - pWCEnd = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*64) + pTable = (*SrcItem)(unsafe.Pointer(pSrc)).FpTab + pWCEnd = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*56) pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop idxCols = uint64(0) pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa @@ -126665,8 +128972,8 @@ __1: // table of a LEFT JOIN if !(((((*WhereLoop)(unsafe.Pointer(pLoop)).Fprereq == uint64(0)) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_VIRTUAL) == 0)) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0))) && - (Xsqlite3ExprIsTableConstant(tls, pExpr, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor) != 0)) { + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) && + (Xsqlite3ExprIsTableConstant(tls, pExpr, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor) != 0)) { goto __4 } pPartial = Xsqlite3ExprAnd(tls, pParse, pPartial, @@ -126676,7 +128983,7 @@ __4: if !(termCanDriveIndex(tls, pTerm, pSrc, notReady) != 0) { goto __5 } - iCol = *(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)) + iCol = *(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) if iCol >= (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) { cMask = (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1)) } else { @@ -126687,7 +128994,7 @@ __4: goto __6 } Xsqlite3_log(tls, (SQLITE_WARNING | (int32(1) << 8)), - ts+19226 /* "automatic index ..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName, + ts+19702 /* "automatic index ..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTable)).FaCol+uintptr(iCol)*32)).FzName)) sentWarning = U8(1) __6: @@ -126709,7 +129016,7 @@ __5: ; goto __2 __2: - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -126726,7 +129033,7 @@ __3: // be a covering index because the index will not be updated if the // original table changes and the index and table cannot both be used // if they go out of sync. - extraCols = ((*SrcList_item)(unsafe.Pointer(pSrc)).FcolUsed & (^idxCols | (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1)))) + extraCols = ((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (^idxCols | (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1)))) mxBitCol = func() int32 { if ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1) < (int32((*Table)(unsafe.Pointer(pTable)).FnCol)) { return ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1) @@ -126752,7 +129059,7 @@ __10: goto __11 __11: ; - if !(((*SrcList_item)(unsafe.Pointer(pSrc)).FcolUsed & (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1))) != 0) { + if !(((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1))) != 0) { goto __13 } nKeyCol = nKeyCol + ((int32((*Table)(unsafe.Pointer(pTable)).FnCol) - (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8)))) + 1) @@ -126768,7 +129075,7 @@ __13: __14: ; *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = pIdx - (*Index)(unsafe.Pointer(pIdx)).FzName = ts + 19252 /* "auto-index" */ + (*Index)(unsafe.Pointer(pIdx)).FzName = ts + 19728 /* "auto-index" */ (*Index)(unsafe.Pointer(pIdx)).FpTable = pTable n = 0 idxCols = uint64(0) @@ -126780,7 +129087,7 @@ __15: if !(termCanDriveIndex(tls, pTerm, pSrc, notReady) != 0) { goto __18 } - iCol1 = *(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)) + iCol1 = *(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) if iCol1 >= (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) { cMask1 = (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1)) } else { @@ -126792,7 +129099,7 @@ __15: } pX = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr idxCols = idxCols | (cMask1) - *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = I16(*(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */))) + *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = I16(*(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */))) pColl = Xsqlite3ExprCompareCollSeq(tls, pParse, pX) // TH3 collate01.800 *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*8)) = func() uintptr { @@ -126808,7 +129115,7 @@ __18: ; goto __16 __16: - pTerm += 64 + pTerm += 56 goto __15 goto __17 __17: @@ -126836,7 +129143,7 @@ __21: goto __22 __22: ; - if !(((*SrcList_item)(unsafe.Pointer(pSrc)).FcolUsed & (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1))) != 0) { + if !(((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1))) != 0) { goto __24 } i = ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1) @@ -126871,9 +129178,9 @@ __24: if !((uint32(int32(*(*uint8)(unsafe.Pointer(pTabItem + 60 /* &.fg */ + 4 /* &.viaCoroutine */)) & 0x10 >> 4))) != 0) { goto __28 } - regYield = (*SrcList_item)(unsafe.Pointer(pTabItem)).FregReturn + regYield = (*SrcItem)(unsafe.Pointer(pTabItem)).FregReturn addrCounter = Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, 0) - Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, (*SrcList_item)(unsafe.Pointer(pTabItem)).FaddrFillSub) + Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, (*SrcItem)(unsafe.Pointer(pTabItem)).FaddrFillSub) addrTop = Xsqlite3VdbeAddOp1(tls, v, OP_Yield, regYield) goto __29 @@ -126886,14 +129193,14 @@ __29: } iContinue = Xsqlite3VdbeMakeLabel(tls, pParse) Xsqlite3ExprIfFalse(tls, pParse, pPartial, iContinue, SQLITE_JUMPIFNULL) - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_PARTIALIDX) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_PARTIALIDX)) __30: ; regRecord = Xsqlite3GetTempReg(tls, pParse) regBase = Xsqlite3GenerateIndexKey(tls, pParse, pIdx, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, regRecord, 0, uintptr(0), uintptr(0), 0) Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, regRecord) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) if !(pPartial != 0) { goto __31 } @@ -126906,13 +129213,13 @@ __31: Xsqlite3VdbeChangeP2(tls, v, addrCounter, (regBase + n)) translateColumnToCopy(tls, pParse, addrTop, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, - (*SrcList_item)(unsafe.Pointer(pTabItem)).FregResult, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur) + (*SrcItem)(unsafe.Pointer(pTabItem)).FregResult, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur) Xsqlite3VdbeGoto(tls, v, addrTop) libc.SetBitFieldPtr8Uint32(pTabItem+60 /* &.fg */ +4 /* &.viaCoroutine */, uint32(0), 4, 0x10) goto __33 __32: Xsqlite3VdbeAddOp2(tls, v, OP_Next, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, (addrTop + 1)) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_STMTSTATUS_AUTOINDEX) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_STMTSTATUS_AUTOINDEX)) __33: ; Xsqlite3VdbeJumpHere(tls, v, addrTop) @@ -126928,7 +129235,7 @@ end_auto_index_create: // 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 *libc.TLS, pParse uintptr, pWC uintptr, mUnusable Bitmask, pSrc uintptr, pOrderBy uintptr, pmNoOmit uintptr) uintptr { /* sqlite3.c:146515:27: */ +func allocateIndexInfo(tls *libc.TLS, pParse uintptr, pWC uintptr, mUnusable Bitmask, pSrc uintptr, pOrderBy uintptr, pmNoOmit uintptr) uintptr { /* sqlite3.c:149130:27: */ var i int32 var j int32 var nTerm int32 @@ -126950,7 +129257,7 @@ __1: goto __3 } { - if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor { + if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor { goto __2 } if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & mUnusable) != 0 { @@ -126970,7 +129277,7 @@ __1: goto __2 __2: i++ - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -126984,7 +129291,7 @@ __3: var n int32 = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr for i = 0; i < n; i++ { var pExpr uintptr = (*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(i)*32)).FpExpr - if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN) || ((*Expr)(unsafe.Pointer(pExpr)).FiTable != (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor) { + if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN) || ((*Expr)(unsafe.Pointer(pExpr)).FiTable != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor) { break } if (int32((*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*32)).FsortFlags) & KEYINFO_ORDER_BIGNULL) != 0 { @@ -127001,7 +129308,7 @@ __3: ((uint64(unsafe.Sizeof(sqlite3_index_constraint{})) + uint64(unsafe.Sizeof(sqlite3_index_constraint_usage{}))) * uint64(nTerm))) + (uint64(unsafe.Sizeof(sqlite3_index_orderby{})) * uint64(nOrderBy))) + uint64(unsafe.Sizeof(HiddenIndexInfo1{}))))) if pIdxInfo == uintptr(0) { - Xsqlite3ErrorMsg(tls, pParse, ts+5005 /* "out of memory" */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+5050 /* "out of memory" */, 0) return uintptr(0) } pHidden = (pIdxInfo + 1*96) @@ -127022,7 +129329,7 @@ __4: } { var op U16 - if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor { + if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor { goto __5 } if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & mUnusable) != 0 { @@ -127039,24 +129346,24 @@ __4: // tag-20191211-002: WHERE-clause constraints are not useful to the // right-hand table of a LEFT JOIN. See tag-20191211-001 for the // equivalent restriction for ordinary tables. - if ((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && - !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + if ((int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && + !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { goto __5 } - (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).FiColumn = *(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)) + (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).FiColumn = *(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).FiTermOffset = i op = (U16(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_ALL)) if int32(op) == WO_IN { - op = WO_EQ + op = U16(WO_EQ) } if int32(op) == WO_AUX { (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = (*WhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp } else if (int32(op) & (WO_ISNULL | WO_IS)) != 0 { if int32(op) == WO_ISNULL { - (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = SQLITE_INDEX_CONSTRAINT_ISNULL + (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(SQLITE_INDEX_CONSTRAINT_ISNULL) } else { - (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = SQLITE_INDEX_CONSTRAINT_IS + (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(SQLITE_INDEX_CONSTRAINT_IS) } } else { (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = U8(op) @@ -127085,7 +129392,7 @@ __4: goto __5 __5: i++ - pTerm += 64 + pTerm += 56 goto __4 goto __6 __6: @@ -127115,7 +129422,7 @@ __6: // 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 *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) int32 { /* sqlite3.c:146670:12: */ +func vtabBestIndex(tls *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) int32 { /* sqlite3.c:149285:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -127128,9 +129435,9 @@ func vtabBestIndex(tls *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) int32 if rc == SQLITE_NOMEM { Xsqlite3OomFault(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb) } else if !(int32((*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg) != 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+2690 /* "%s" */, libc.VaList(bp, Xsqlite3ErrStr(tls, rc))) + Xsqlite3ErrorMsg(tls, pParse, ts+2718 /* "%s" */, libc.VaList(bp, Xsqlite3ErrStr(tls, rc))) } else { - Xsqlite3ErrorMsg(tls, pParse, ts+2690 /* "%s" */, libc.VaList(bp+8, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg)) + Xsqlite3ErrorMsg(tls, pParse, ts+2718 /* "%s" */, libc.VaList(bp+8, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg)) } } Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg) @@ -127149,7 +129456,7 @@ func vtabBestIndex(tls *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) int32 // into the aSample[] array - it is an index into a virtual set of samples // based on the contents of aSample[] and the number of fields in record // pRec. -func whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, roundUp int32, aStat uintptr) int32 { /* sqlite3.c:146707:12: */ +func whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, roundUp int32, aStat uintptr) int32 { /* sqlite3.c:149322:12: */ var aSample uintptr = (*Index)(unsafe.Pointer(pIdx)).FaSample var iCol int32 // Index of required stats in anEq[] etc. var i int32 // Index of first sample >= pRec @@ -127288,7 +129595,7 @@ func whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, ro // 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 *libc.TLS, pTerm uintptr, nNew LogEst) LogEst { /* sqlite3.c:146899:15: */ +func whereRangeAdjust(tls *libc.TLS, pTerm uintptr, nNew LogEst) LogEst { /* sqlite3.c:149514:15: */ var nRet LogEst = nNew if pTerm != 0 { if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0 { @@ -127301,11 +129608,11 @@ func whereRangeAdjust(tls *libc.TLS, pTerm uintptr, nNew LogEst) LogEst { /* sql } // Return the affinity for a single column of an index. -func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol int32) int8 { /* sqlite3.c:146916:21: */ +func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol int32) int8 { /* sqlite3.c:149531:21: */ if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) { if Xsqlite3IndexAffinityStr(tls, db, pIdx) == uintptr(0) { - return SQLITE_AFF_BLOB + return int8(SQLITE_AFF_BLOB) } } @@ -127345,7 +129652,7 @@ func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol i // // If an error occurs, an SQLite error code is returned. Otherwise, // SQLITE_OK. -func whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUpper uintptr, pLoop uintptr, pbDone uintptr) int32 { /* sqlite3.c:146963:12: */ +func whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUpper uintptr, pLoop uintptr, pbDone uintptr) int32 { /* sqlite3.c:149578:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -127460,7 +129767,7 @@ func whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUpper // used, a single range inequality reduces the search space by a factor of 4. // and a pair of constraints (x>? AND x 0) && (nEq < (*Index)(unsafe.Pointer(p)).FnSampleCol)) && - ((int32((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags) & (SQLITE_Stat4)) == 0) { + (((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0)) { if nEq == (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid { *(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)) = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec // var a [2]TRowcnt at bp, 8 @@ -127656,7 +129963,7 @@ func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower u // required for string comparison, or if unable to allocate memory // for a UTF conversion required for comparison. The error is stored // in the pParse structure. -func whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr uintptr, pnRow uintptr) int32 { /* sqlite3.c:147256:12: */ +func whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr uintptr, pnRow uintptr) int32 { /* sqlite3.c:149871:12: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -127712,7 +130019,7 @@ func whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr ui // required for string comparison, or if unable to allocate memory // for a UTF conversion required for comparison. The error is stored // in the pParse structure. -func whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uintptr, pnRow uintptr) int32 { /* sqlite3.c:147320:12: */ +func whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uintptr, pnRow uintptr) int32 { /* sqlite3.c:149935:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -127745,7 +130052,7 @@ func whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uintp // Convert bulk memory into a valid WhereLoop that can be passed // to whereLoopClear harmlessly. -func whereLoopInit(tls *libc.TLS, p uintptr) { /* sqlite3.c:147466:13: */ +func whereLoopInit(tls *libc.TLS, p uintptr) { /* sqlite3.c:150081:13: */ (*WhereLoop)(unsafe.Pointer(p)).FaLTerm = p + 72 /* &.aLTermSpace */ (*WhereLoop)(unsafe.Pointer(p)).FnLTerm = U16(0) (*WhereLoop)(unsafe.Pointer(p)).FnLSlot = U16((int32(uint64(unsafe.Sizeof([3]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0)))))) @@ -127753,13 +130060,13 @@ func whereLoopInit(tls *libc.TLS, p uintptr) { /* sqlite3.c:147466:13: */ } // Clear the WhereLoop.u union. Leave WhereLoop.pLTerm intact. -func whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147476:13: */ +func whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:150091:13: */ if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & (U32(WHERE_VIRTUALTABLE | WHERE_AUTO_INDEX))) != 0 { - if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_VIRTUALTABLE) != U32(0)) && (*(*U8)(unsafe.Pointer((p + 24 /* &.u */ /* &.vtab */) + 4 /* &.needFree */)) != 0) { + if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0)) && (*(*U8)(unsafe.Pointer((p + 24 /* &.u */ /* &.vtab */) + 4 /* &.needFree */)) != 0) { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */))) *(*U8)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)) = uintptr(0) - } else if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) && (*(*uintptr)(unsafe.Pointer((p + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0)) { + } else if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && (*(*uintptr)(unsafe.Pointer((p + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0)) { Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))).FzColAff) Xsqlite3DbFreeNN(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))) *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0) @@ -127768,7 +130075,7 @@ func whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:14 } // Deallocate internal memory used by a WhereLoop object -func whereLoopClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147493:13: */ +func whereLoopClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:150108:13: */ if (*WhereLoop)(unsafe.Pointer(p)).FaLTerm != p+72 /* &.aLTermSpace */ { Xsqlite3DbFreeNN(tls, db, (*WhereLoop)(unsafe.Pointer(p)).FaLTerm) } @@ -127777,7 +130084,7 @@ func whereLoopClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147493: } // Increase the memory allocation for pLoop->aLTerm[] to be at least n. -func whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) int32 { /* sqlite3.c:147502:12: */ +func whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) int32 { /* sqlite3.c:150117:12: */ var paNew uintptr if int32((*WhereLoop)(unsafe.Pointer(p)).FnLSlot) >= n { return SQLITE_OK @@ -127797,7 +130104,7 @@ func whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) int32 { /* s } // Transfer content from the second pLoop into the first. -func whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:147518:12: */ +func whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:150133:12: */ whereLoopClearUnion(tls, db, pTo) if whereLoopResize(tls, db, pTo, int32((*WhereLoop)(unsafe.Pointer(pFrom)).FnLTerm)) != 0 { libc.Xmemset(tls, (pTo + 24 /* &.u */), 0, uint64(unsafe.Sizeof(struct { @@ -127813,27 +130120,27 @@ func whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 } libc.Xmemcpy(tls, pTo, pFrom, uint64((uintptr(0) + 48 /* &.nLSlot */))) libc.Xmemcpy(tls, (*WhereLoop)(unsafe.Pointer(pTo)).FaLTerm, (*WhereLoop)(unsafe.Pointer(pFrom)).FaLTerm, (uint64((*WhereLoop)(unsafe.Pointer(pTo)).FnLTerm) * uint64(unsafe.Sizeof(uintptr(0))))) - if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & WHERE_VIRTUALTABLE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != 0 { *(*U8)(unsafe.Pointer(pFrom + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) - } else if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & WHERE_AUTO_INDEX) != U32(0) { + } else if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0) { *(*uintptr)(unsafe.Pointer(pFrom + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0) } return SQLITE_OK } // Delete a WhereLoop object -func whereLoopDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147537:13: */ +func whereLoopDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:150152:13: */ whereLoopClear(tls, db, p) Xsqlite3DbFreeNN(tls, db, p) } // Free a WhereInfo structure -func whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:147545:13: */ +func whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:150160:13: */ var i int32 for i = 0; i < int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel); i++ { - var pLevel uintptr = ((pWInfo + 920 /* &.a */) + uintptr(i)*88) - if ((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop != 0) && (((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & WHERE_IN_ABLE) != 0) { + var pLevel uintptr = ((pWInfo + 856 /* &.a */) + uintptr(i)*88) + if ((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop != 0) && (((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & U32(WHERE_IN_ABLE)) != 0) { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ + 8 /* &.aInLoop */))) } } @@ -127863,7 +130170,7 @@ func whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:147 // deserve a lower cost even if it is a proper subset of Y. Constraint (5) // was added because a covering index probably deserves to have a lower cost // than a non-covering index even if it is a proper subset. -func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { /* sqlite3.c:147582:12: */ +func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { /* sqlite3.c:150197:12: */ var i int32 var j int32 if (int32((*WhereLoop)(unsafe.Pointer(pX)).FnLTerm) - int32((*WhereLoop)(unsafe.Pointer(pX)).FnSkip)) >= (int32((*WhereLoop)(unsafe.Pointer(pY)).FnLTerm) - int32((*WhereLoop)(unsafe.Pointer(pY)).FnSkip)) { @@ -127893,8 +130200,8 @@ func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { return 0 } // X not a subset of Y since term X[i] not used by Y } - if (((*WhereLoop)(unsafe.Pointer(pX)).FwsFlags & WHERE_IDX_ONLY) != U32(0)) && - (((*WhereLoop)(unsafe.Pointer(pY)).FwsFlags & WHERE_IDX_ONLY) == U32(0)) { + if (((*WhereLoop)(unsafe.Pointer(pX)).FwsFlags & U32(WHERE_IDX_ONLY)) != U32(0)) && + (((*WhereLoop)(unsafe.Pointer(pY)).FwsFlags & U32(WHERE_IDX_ONLY)) == U32(0)) { return 0 // Constraint (5) } return 1 // All conditions meet @@ -127912,15 +130219,15 @@ func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { // 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 *libc.TLS, p uintptr, pTemplate uintptr) { /* sqlite3.c:147623:13: */ - if ((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & WHERE_INDEXED) == U32(0) { +func whereLoopAdjustCost(tls *libc.TLS, p uintptr, pTemplate uintptr) { /* sqlite3.c:150238:13: */ + if ((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_INDEXED)) == U32(0) { return } for ; p != 0; p = (*WhereLoop)(unsafe.Pointer(p)).FpNextLoop { if int32((*WhereLoop)(unsafe.Pointer(p)).FiTab) != int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FiTab) { continue } - if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_INDEXED) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_INDEXED)) == U32(0) { continue } if whereLoopCheaperProperSubset(tls, p, pTemplate) != 0 { @@ -127951,7 +130258,7 @@ func whereLoopAdjustCost(tls *libc.TLS, p uintptr, pTemplate uintptr) { /* sqlit // If pTemplate cannot replace any existing element of the list but needs // to be added to the list as a new entry, then return a pointer to the // tail of the list. -func whereLoopFindLesser(tls *libc.TLS, ppPrev uintptr, pTemplate uintptr) uintptr { /* sqlite3.c:147660:18: */ +func whereLoopFindLesser(tls *libc.TLS, ppPrev uintptr, pTemplate uintptr) uintptr { /* sqlite3.c:150275:18: */ var p uintptr p = *(*uintptr)(unsafe.Pointer(ppPrev)) __1: @@ -127976,10 +130283,10 @@ __1: // Any loop using an appliation-defined index (or PRIMARY KEY or // UNIQUE constraint) with one or more == constraints is better // than an automatic index. Unless it is a skip-scan. - if ((((((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) && + if ((((((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && ((int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnSkip)) == 0)) && - (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & WHERE_INDEXED) != U32(0))) && - (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & WHERE_COLUMN_EQ) != U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_INDEXED)) != U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_COLUMN_EQ)) != U32(0))) && (((*WhereLoop)(unsafe.Pointer(p)).Fprereq & (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq) == (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq) { goto __3 } @@ -128040,7 +130347,7 @@ __3: // (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 *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 { /* sqlite3.c:147748:12: */ +func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 { /* sqlite3.c:150363:12: */ var ppPrev uintptr var p uintptr var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo @@ -128111,7 +130418,7 @@ func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 { } } rc = whereLoopXfer(tls, db, p, pTemplate) - if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0) { var pIndex uintptr = *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) if (pIndex != 0) && ((int32(*(*uint16)(unsafe.Pointer(pIndex + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_IPK) { *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0) @@ -128147,7 +130454,7 @@ func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 { // "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 *libc.TLS, pWC uintptr, pLoop uintptr, nRow LogEst) { /* sqlite3.c:147885:13: */ +func whereLoopOutputAdjust(tls *libc.TLS, pWC uintptr, pLoop uintptr, nRow LogEst) { /* sqlite3.c:150500:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -128183,7 +130490,7 @@ __1: if pX == pTerm { break } - if ((*WhereTerm)(unsafe.Pointer(pX)).FiParent >= 0) && (((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pX)).FiParent)*64) == pTerm) { + if ((*WhereTerm)(unsafe.Pointer(pX)).FiParent >= 0) && (((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pX)).FiParent)*56) == pTerm) { break } } @@ -128218,7 +130525,7 @@ __1: goto __2 __2: i-- - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -128243,7 +130550,7 @@ __3: // // then this function would be invoked with nEq=1. The value returned in // this case is 3. -func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr, nEq int32, pTerm uintptr) int32 { /* sqlite3.c:147955:12: */ +func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr, nEq int32, pTerm uintptr) int32 { /* sqlite3.c:150570:12: */ var nCmp int32 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft) var i int32 @@ -128261,7 +130568,7 @@ func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr var pColl uintptr // Comparison collation sequence var pLhs uintptr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr var pRhs uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight - if ((*Expr)(unsafe.Pointer(pRhs)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pRhs)).Fflags & U32(EP_xIsSelect)) != 0 { pRhs = (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRhs + 32 /* &.x */)))).FpEList + 8 /* &.a */) + uintptr(i)*32)).FpExpr } else { pRhs = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pRhs + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr @@ -128308,7 +130615,7 @@ func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr // // If pProbe->idxType==SQLITE_IDXTYPE_IPK, that means pIndex is // a fake index used for the INTEGER PRIMARY KEY. -func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProbe uintptr, nInMul LogEst) int32 { /* sqlite3.c:148026:12: */ +func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProbe uintptr, nInMul LogEst) int32 { /* sqlite3.c:150641:12: */ bp := tls.Alloc(116) defer tls.Free(116) @@ -128339,7 +130646,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb return SQLITE_NOMEM } - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { opMask = ((int32(WO_EQ) << (TK_LT - TK_EQ)) | (int32(WO_EQ) << (TK_LE - TK_EQ))) } else { @@ -128357,7 +130664,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb saved_wsFlags = (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags saved_prereq = (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq saved_nOut = (*WhereLoop)(unsafe.Pointer(pNew)).FnOut - pTerm = whereScanInit(tls, bp /* &scan */, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor, int32(saved_nEq), + pTerm = whereScanInit(tls, bp /* &scan */, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, int32(saved_nEq), uint32(opMask), pProbe) (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0) rSize = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -128385,8 +130692,8 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // tag-20191211-001: Do not allow constraints from the WHERE clause to // be used by the right table of a LEFT JOIN. Only constraints in the // ON clause are allowed. See tag-20191211-002 for the vtab equivalent. - if ((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && - !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + if ((int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && + !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { continue } @@ -128408,7 +130715,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb if (int32(eOp) & WO_IN) != 0 { var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { // "x IN (SELECT ...)": TUNING: the SELECT returns 25 rows var i int32 nIn = 46 @@ -128427,7 +130734,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // "x IN (value, value, ...)" nIn = int32(Xsqlite3LogEst(tls, uint64((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FnExpr))) } - if (uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.hasStat1 */)) & 0x80 >> 7))) != 0 { + if ((uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.hasStat1 */)) & 0x80 >> 7))) != 0) && (int32(rLogSize) >= 10) { var M LogEst var logK LogEst var safetyMargin LogEst @@ -128448,59 +130755,60 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // a safety margin of 2 (LogEst: 10) that favors using the IN operator // with the index, as using an index has better worst-case behavior. // If we do not have real sqlite_stat1 data, always prefer to use - // the index. + // the index. Do not bother with this optimization on very small + // tables (less than 2 rows) as it is pointless in that case. M = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2)) logK = estLog(tls, int16(nIn)) safetyMargin = int16(10) // TUNING: extra weight for indexed IN if ((int32(M) + int32(logK)) + int32(safetyMargin)) < (nIn + int32(rLogSize)) { - continue + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_IN_SEEKSCAN)) } else { } } - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_COLUMN_IN) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_IN)) } else if (int32(eOp) & (WO_EQ | WO_IS)) != 0 { var iCol int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiColumn + uintptr(saved_nEq)*2))) - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_COLUMN_EQ) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_EQ)) if (iCol == (-1)) || (((iCol >= 0) && (int32(nInMul) == 0)) && (int32(saved_nEq) == (int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) - 1))) { if ((iCol == (-1)) || ((uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.uniqNotNull */)) & 0x8 >> 3))) != 0)) || (((int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) == 1) && ((*Index)(unsafe.Pointer(pProbe)).FonError != 0)) && (int32(eOp) == WO_EQ)) { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_ONEROW) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_ONEROW)) } else { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_UNQ_WANTED) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_UNQ_WANTED)) } } } else if (int32(eOp) & WO_ISNULL) != 0 { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_COLUMN_NULL) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_NULL)) } else if (int32(eOp) & ((int32(WO_EQ) << (TK_GT - TK_EQ)) | (int32(WO_EQ) << (TK_GE - TK_EQ)))) != 0 { *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_RANGE | WHERE_BTM_LIMIT)) *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)) = U16(whereRangeVectorLen(tls, - pParse, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm)) + pParse, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm)) pBtm = pTerm pTop = uintptr(0) if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_LIKEOPT) != 0 { - // Range contraints that come from the LIKE optimization are + // Range constraints that come from the LIKE optimization are // always used in pairs. - pTop = (pTerm + 1*64) + pTop = (pTerm + 1*56) if whereLoopResize(tls, db, pNew, (int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1)) != 0 { break } // OOM *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = pTop - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_TOP_LIMIT) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_TOP_LIMIT)) *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) = U16(1) } } else { *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_RANGE | WHERE_TOP_LIMIT)) *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) = U16(whereRangeVectorLen(tls, - pParse, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm)) + pParse, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm)) pTop = pTerm - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_BTM_LIMIT) != U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_BTM_LIMIT)) != U32(0) { pBtm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr((int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-2))*8)) } else { pBtm = uintptr(0) @@ -128513,7 +130821,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // "x IN(...)" terms are replaced with "x = ?". This block updates // the value of pNew->nOut to account for pTerm (but not nIn/nInMul). - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_COLUMN_RANGE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != 0 { // Adjust nOut using stat4 data. Or, if there is no stat4 // data, using some other estimate. whereRangeScanEst(tls, pParse, pBuilder, pBtm, pTop, pNew) @@ -128529,8 +130837,8 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb if ((((int32(nInMul) == 0) && ((*Index)(unsafe.Pointer(pProbe)).FnSample != 0)) && (int32(*(*U16)(unsafe.Pointer((pNew + 24 /* &.u */ /* &.btree */) /* &.nEq */))) <= (*Index)(unsafe.Pointer(pProbe)).FnSampleCol)) && - (((int32(eOp) & WO_IN) == 0) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_xIsSelect)) != U32(0)))) && - ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0) { + (((int32(eOp) & WO_IN) == 0) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0)))) && + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0)) { var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (int32(eOp) & ((WO_EQ | WO_ISNULL) | WO_IS)) != 0 { @@ -128582,7 +130890,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // seek only. Then, if this is a non-covering index, add the cost of // visiting the rows in the main table. - rCostIdx = (LogEst((int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) + 1) + ((15 * int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow)) / int32((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FszTabRow)))) + rCostIdx = (LogEst((int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) + 1) + ((15 * int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow)) / int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FszTabRow)))) (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, rLogSize, rCostIdx) if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & (U32(WHERE_IDX_ONLY | WHERE_IPK))) == U32(0) { (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, (*WhereLoop)(unsafe.Pointer(pNew)).FrRun, (int16(int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) + 16))) @@ -128594,13 +130902,13 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb whereLoopOutputAdjust(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, pNew, rSize) rc = whereLoopInsert(tls, pBuilder, pNew) - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_COLUMN_RANGE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != 0 { (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut } else { (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = nOutUnadjusted } - if (((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_TOP_LIMIT) == U32(0)) && + if (((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_TOP_LIMIT)) == U32(0)) && (int32(*(*U16)(unsafe.Pointer((pNew + 24 /* &.u */ /* &.btree */) /* &.nEq */))) < int32((*Index)(unsafe.Pointer(pProbe)).FnColumn)) { whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, (int16(int32(nInMul) + nIn))) } @@ -128632,14 +130940,14 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb (int32(saved_nEq) == int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm))) && ((int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.noSkipScan */)) & 0x40 >> 6)) == 0)) && ((int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.hasStat1 */)) & 0x80 >> 7)) != 0)) && - ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_SkipScan)) == 0)) && + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_SkipScan))) == U32(0))) && (int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr((int32(saved_nEq)+1))*2))) >= 42)) && // TUNING: Minimum for skip-scan ((libc.AssignInt32(&rc, whereLoopResize(tls, db, pNew, (int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1)))) == SQLITE_OK) { var nIter LogEst *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ /* &.nEq */))++ (*WhereLoop)(unsafe.Pointer(pNew)).FnSkip++ *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = uintptr(0) - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_SKIPSCAN) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_SKIPSCAN)) nIter = (LogEst(int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))) - int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr((int32(saved_nEq)+1))*2))))) *(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) -= LogEst((int32(nIter))) // TUNING: Because uncertainties in the estimates for skip-scan queries, @@ -128661,7 +130969,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // 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 *libc.TLS, pBuilder uintptr, pIndex uintptr, iCursor int32) int32 { /* sqlite3.c:148411:12: */ +func indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr, iCursor int32) int32 { /* sqlite3.c:151027:12: */ var pOB uintptr var aColExpr uintptr var ii int32 @@ -128675,6 +130983,9 @@ func indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr, } for ii = 0; ii < (*ExprList)(unsafe.Pointer(pOB)).FnExpr; ii++ { var pExpr uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pOB+8 /* &.a */)+uintptr(ii)*32)).FpExpr) + if pExpr == uintptr(0) { + continue + } if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == iCursor) { if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 { return 1 @@ -128700,7 +131011,7 @@ func indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr, // 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 *libc.TLS, iTab int32, isLeft int32, pWC uintptr, pWhere uintptr) int32 { /* sqlite3.c:148444:12: */ +func whereUsablePartialIndex(tls *libc.TLS, iTab int32, isLeft int32, pWC uintptr, pWhere uintptr) int32 { /* sqlite3.c:151061:12: */ var i int32 var pTerm uintptr var pParse uintptr = (*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse @@ -128710,7 +131021,7 @@ func whereUsablePartialIndex(tls *libc.TLS, iTab int32, isLeft int32, pWC uintpt } pWhere = (*Expr)(unsafe.Pointer(pWhere)).FpRight } - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_EnableQPSG) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_EnableQPSG)) != 0 { pParse = uintptr(0) } i = 0 @@ -128722,8 +131033,8 @@ __1: { var pExpr uintptr pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if ((!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) || (int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) == iTab)) && - ((isLeft == 0) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)))) && + if ((!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) || ((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable == iTab)) && + ((isLeft == 0) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)))) && (Xsqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0) { return 1 } @@ -128732,7 +131043,7 @@ __1: goto __2 __2: i++ - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -128774,7 +131085,7 @@ __3: // 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 *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { /* sqlite3.c:148507:12: */ +func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { /* sqlite3.c:151124:12: */ bp := tls.Alloc(158) defer tls.Free(158) @@ -128800,13 +131111,13 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { pWInfo = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo pTabList = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList pSrc = ((pTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*112) - pTab = (*SrcList_item)(unsafe.Pointer(pSrc)).FpTab + pTab = (*SrcItem)(unsafe.Pointer(pSrc)).FpTab pWC = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC - if (*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex != 0 { + if (uint32(int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 { // An INDEXED BY clause specifies a particular index to use - pProbe = (*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex - } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + pProbe = *(*uintptr)(unsafe.Pointer(pSrc + 104 /* &.u2 */)) + } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { pProbe = (*Table)(unsafe.Pointer(pTab)).FpIndex } else { // There is no INDEXED BY clause. Create a fake Index object in local @@ -128819,13 +131130,13 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { (*Index)(unsafe.Pointer(bp /* &sPk */)).FnColumn = U16(1) (*Index)(unsafe.Pointer(bp /* &sPk */)).FaiColumn = bp + 152 /* &aiColumnPk */ (*Index)(unsafe.Pointer(bp /* &sPk */)).FaiRowLogEst = bp + 154 /* &aiRowEstPk[0] */ - (*Index)(unsafe.Pointer(bp /* &sPk */)).FonError = OE_Replace + (*Index)(unsafe.Pointer(bp /* &sPk */)).FonError = U8(OE_Replace) (*Index)(unsafe.Pointer(bp /* &sPk */)).FpTable = pTab (*Index)(unsafe.Pointer(bp /* &sPk */)).FszIdxRow = (*Table)(unsafe.Pointer(pTab)).FszTabRow - libc.SetBitFieldPtr16Uint32(bp /* &sPk */ +100 /* &.idxType */, SQLITE_IDXTYPE_IPK, 0, 0x3) + libc.SetBitFieldPtr16Uint32(bp /* &sPk */ +100 /* &.idxType */, uint32(SQLITE_IDXTYPE_IPK), 0, 0x3) *(*LogEst)(unsafe.Pointer(bp + 154 /* &aiRowEstPk[0] */)) = (*Table)(unsafe.Pointer(pTab)).FnRowLogEst *(*LogEst)(unsafe.Pointer(bp + 154 /* &aiRowEstPk[0] */ + 1*2)) = int16(0) - pFirst = (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FpIndex + pFirst = (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FpIndex if (int32(*(*uint8)(unsafe.Pointer((pSrc + 60 /* &.fg */) + 4 /* &.notIndexed */)) & 0x1 >> 0)) == 0 { // The real indices of the table are only considered if the // NOT INDEXED qualifier is omitted from the FROM clause @@ -128839,16 +131150,16 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { // Automatic indexes if ((((((!(int32((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet) != 0) && // Not part of an OR optimization ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_OR_SUBCLAUSE) == 0)) && - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags & SQLITE_AutoIndex) != uint64(0))) && - ((*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex == uintptr(0))) && // Has no INDEXED BY clause + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags & uint64(SQLITE_AutoIndex)) != uint64(0))) && + !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1)) != 0)) && // Has no INDEXED BY clause !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.notIndexed */)) & 0x1 >> 0)) != 0)) && // Has no NOT INDEXED clause - (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) && // Not WITHOUT ROWID table. (FIXME: Why not?) + (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) && // Not WITHOUT ROWID table. (FIXME: Why not?) !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isCorrelated */)) & 0x8 >> 3)) != 0)) && // Not a correlated subquery !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5)) != 0) { // Generate auto-index WhereLoops var pTerm uintptr - var pWCEnd uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*64) - for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; (rc == SQLITE_OK) && (pTerm < pWCEnd); pTerm += 64 { + var pWCEnd uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*56) + for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; (rc == SQLITE_OK) && (pTerm < pWCEnd); pTerm += 56 { if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf) != 0 { continue } @@ -128867,7 +131178,7 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { // those objects, since there is no opportunity to add schema // indexes on subqueries and views. (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = (LogEst(int32(rLogSize) + int32(rSize))) - if ((*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0)) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Ephemeral) == U32(0)) { + if ((*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0)) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) == U32(0)) { *(*LogEst)(unsafe.Pointer(pNew + 18 /* &.rSetup */)) += int16((28)) } else { *(*LogEst)(unsafe.Pointer(pNew + 18 /* &.rSetup */)) -= int16((10)) @@ -128882,7 +131193,7 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { // not be unreasonable to make this value much larger. (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = int16(43) (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, rLogSize, (*WhereLoop)(unsafe.Pointer(pNew)).FnOut) - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_AUTO_INDEX + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_AUTO_INDEX) (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = (mPrereq | (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) rc = whereLoopInsert(tls, pBuilder, pNew) } @@ -128896,9 +131207,9 @@ __1: goto __3 } { - var isLeft int32 = (libc.Bool32((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_OUTER) != 0)) + var isLeft int32 = (libc.Bool32((int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_OUTER) != 0)) if ((*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0)) && - !(whereUsablePartialIndex(tls, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor, isLeft, pWC, + !(whereUsablePartialIndex(tls, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, isLeft, pWC, (*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere) != 0) { // See ticket [98d973b8f5] goto __2 // Partial index inappropriate for this query @@ -128917,13 +131228,13 @@ __1: (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = mPrereq (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = rSize *(*uintptr)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = pProbe - b = indexMightHelpWithOrderBy(tls, pBuilder, pProbe, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor) + b = indexMightHelpWithOrderBy(tls, pBuilder, pProbe, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor) // The ONEPASS_DESIRED flags never occurs together with ORDER BY if (int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_IPK { // Integer primary key index - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_IPK + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_IPK) // Full table scan (*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = func() uint8 { @@ -128932,8 +131243,18 @@ __1: } return uint8(0) }() - // TUNING: Cost of full table scan is (N*3.0). - (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = (LogEst(int32(rSize) + 16)) + // TUNING: Cost of full table scan is 3.0*N. The 3.0 factor is an + // extra cost designed to discourage the use of full table scans, + // since index lookups have better worst-case performance if our + // stat guesses are wrong. Reduce the 3.0 penalty slightly + // (to 2.75) if we have valid STAT4 information for the table. + // At 2.75, a full table scan is preferred over using an index on + // a column with just two distinct values where each value has about + // an equal number of appearances. Without STAT4 data, we still want + // to use an index in that case, since the constraint might be for + // the scarcer of the two values, and in that case an index lookup is + // better. + (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = (LogEst((int32(rSize) + 16) - (2 * (libc.Bool32(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasStat4)) != U32(0)))))) whereLoopOutputAdjust(tls, pWC, pNew, rSize) rc = whereLoopInsert(tls, pBuilder, pNew) @@ -128947,18 +131268,18 @@ __1: (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = (U32(WHERE_IDX_ONLY | WHERE_INDEXED)) m = uint64(0) } else { - m = ((*SrcList_item)(unsafe.Pointer(pSrc)).FcolUsed & (*Index)(unsafe.Pointer(pProbe)).FcolNotIdxed) + m = ((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (*Index)(unsafe.Pointer(pProbe)).FcolNotIdxed) (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = func() uint32 { if m == uint64(0) { return (uint32(WHERE_IDX_ONLY | WHERE_INDEXED)) } - return WHERE_INDEXED + return uint32(WHERE_INDEXED) }() } // Full scan via index if ((((b != 0) || - !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) || + !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) || ((*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0))) || ((uint32(int32(*(*uint8)(unsafe.Pointer((pSrc + 60 /* &.fg */) + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0)) || ((((((m == uint64(0)) && @@ -128966,7 +131287,7 @@ __1: (int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow) < int32((*Table)(unsafe.Pointer(pTab)).FszTabRow))) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_ONEPASS_DESIRED) == 0)) && (Xsqlite3Config.FbUseCis != 0)) && - ((int32((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb))).FdbOptFlags) & (SQLITE_CoverIdxScan)) == 0)) { + (((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb))).FdbOptFlags & (U32(SQLITE_CoverIdxScan))) == U32(0))) { (*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = func() uint8 { if b != 0 { return uint8(iSortIdx) @@ -128986,10 +131307,10 @@ __1: // table lookup. var nLookup LogEst = (LogEst(int32(rSize) + 16)) // Base cost: N*3 var ii int32 - var iCur int32 = (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor + var iCur int32 = (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor var pWC2 uintptr = (pWInfo + 104 /* &.sWC */) for ii = 0; ii < (*WhereClause)(unsafe.Pointer(pWC2)).FnTerm; ii++ { - var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC2)).Fa + uintptr(ii)*64) + var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC2)).Fa + uintptr(ii)*56) if !(Xsqlite3ExprCoveredByIndex(tls, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr, iCur, pProbe) != 0) { break } @@ -129024,7 +131345,7 @@ __1: // unique index is used (making the index functionally non-unique) // then the sqlite_stat1 data becomes important for scoring the // plan - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_StatsUsed) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_StatsUsed)) } Xsqlite3Stat4ProbeFree(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec) (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = 0 @@ -129034,7 +131355,7 @@ __1: goto __2 __2: pProbe = func() uintptr { - if (*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex != 0 { + if (uint32(int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 { return uintptr(0) } return (*Index)(unsafe.Pointer(pProbe)).FpNext @@ -129065,7 +131386,7 @@ __3: // // 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 *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUsable Bitmask, mExclude U16, pIdxInfo uintptr, mNoOmit U16, pbIn uintptr) int32 { /* sqlite3.c:148766:12: */ +func whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUsable Bitmask, mExclude U16, pIdxInfo uintptr, mNoOmit U16, pbIn uintptr) int32 { /* sqlite3.c:151398:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -129092,7 +131413,7 @@ __1: goto __3 } { - var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset)*64) + var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset)*56) (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable = uint8(0) if (((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & mUsable) == (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & int32(mExclude)) == 0) { @@ -129118,10 +131439,10 @@ __3: (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = (float64((1e99)) / float64(2)) (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(25) (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags = 0 - (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FcolUsed = Sqlite3_uint64(Sqlite3_int64((*SrcList_item)(unsafe.Pointer(pSrc)).FcolUsed)) + (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FcolUsed = Sqlite3_uint64(Sqlite3_int64((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed)) // Invoke the virtual table xBestIndex() method - rc = vtabBestIndex(tls, pParse, (*SrcList_item)(unsafe.Pointer(pSrc)).FpTab, pIdxInfo) + rc = vtabBestIndex(tls, pParse, (*SrcItem)(unsafe.Pointer(pSrc)).FpTab, pIdxInfo) if rc != 0 { if rc == SQLITE_CONSTRAINT { // If the xBestIndex method returns SQLITE_CONSTRAINT, that means @@ -129155,12 +131476,12 @@ __4: (j >= (*WhereClause)(unsafe.Pointer(pWC)).FnTerm)) || (*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0))) || (int32((*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+19263 /* "%s.xBestIndex ma..." */, libc.VaList(bp, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+19739 /* "%s.xBestIndex ma..." */, libc.VaList(bp, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FzName)) return SQLITE_ERROR } - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(j)*64) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(j)*56) *(*Bitmask)(unsafe.Pointer(pNew /* &.prereq */)) |= ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) = pTerm @@ -129203,7 +131524,7 @@ __6: if *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { // The non-zero argvIdx values must be contiguous. Raise an // error if they are not - Xsqlite3ErrorMsg(tls, pParse, ts+19263 /* "%s.xBestIndex ma..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+19739 /* "%s.xBestIndex ma..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FzName)) return SQLITE_ERROR } @@ -129226,7 +131547,7 @@ __6: // Set the WHERE_ONEROW flag if the xBestIndex() method indicated // that the scan will visit at most one row. Clear it otherwise. if ((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags & SQLITE_INDEX_SCAN_UNIQUE) != 0 { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_ONEROW) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_ONEROW)) } else { *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(WHERE_ONEROW))) } @@ -129244,13 +131565,13 @@ __6: // sequence associated with element iCons of the sqlite3_index_info.aConstraint // array. Or, if iCons is out of range or there is no active xBestIndex // call, return NULL. -func Xsqlite3_vtab_collation(tls *libc.TLS, pIdxInfo uintptr, iCons int32) uintptr { /* sqlite3.c:148926:23: */ +func Xsqlite3_vtab_collation(tls *libc.TLS, pIdxInfo uintptr, iCons int32) uintptr { /* sqlite3.c:151558:23: */ var pHidden uintptr = (pIdxInfo + 1*96) var zRet uintptr = uintptr(0) if (iCons >= 0) && (iCons < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) { var pC uintptr = uintptr(0) var iTerm int32 = (*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12)).FiTermOffset - var pX uintptr = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer((*HiddenIndexInfo)(unsafe.Pointer(pHidden)).FpWC)).Fa + uintptr(iTerm)*64)).FpExpr + var pX uintptr = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer((*HiddenIndexInfo)(unsafe.Pointer(pHidden)).FpWC)).Fa + uintptr(iTerm)*56)).FpExpr if (*Expr)(unsafe.Pointer(pX)).FpLeft != 0 { pC = Xsqlite3ExprCompareCollSeq(tls, (*HiddenIndexInfo)(unsafe.Pointer(pHidden)).FpParse, pX) } @@ -129287,7 +131608,7 @@ func Xsqlite3_vtab_collation(tls *libc.TLS, pIdxInfo uintptr, iCons int32) uintp // 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 *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:148966:12: */ +func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:151598:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -129316,7 +131637,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus return SQLITE_NOMEM } (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0) - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_VIRTUALTABLE + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_VIRTUALTABLE) (*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(0) *(*U8)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) nConstraint = (*Sqlite3_index_info)(unsafe.Pointer(p)).FnConstraint @@ -129345,7 +131666,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus if *(*int32)(unsafe.Pointer(bp + 4 /* bIn */)) != 0 { rc = whereLoopAddVirtualOne(tls, - pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), WO_IN, p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) + pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), uint16(WO_IN), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) mBestNoIn = ((*WhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq) if mBestNoIn == uint64(0) { @@ -129361,7 +131682,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus var mNext Bitmask = libc.Uint64(libc.Uint64FromInt32(-1)) for i = 0; i < nConstraint; i++ { - var mThis Bitmask = ((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr((*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(p)).FaConstraint+uintptr(i)*12)).FiTermOffset)*64)).FprereqRight & ^mPrereq) + var mThis Bitmask = ((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr((*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(p)).FaConstraint+uintptr(i)*12)).FiTermOffset)*56)).FprereqRight & ^mPrereq) if (mThis > mPrev) && (mThis < mNext) { mNext = mThis } @@ -129402,7 +131723,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus if (rc == SQLITE_OK) && (seenZeroNoIN == 0) { rc = whereLoopAddVirtualOne(tls, - pBuilder, mPrereq, mPrereq, WO_IN, p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) + pBuilder, mPrereq, mPrereq, uint16(WO_IN), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) } } @@ -129416,9 +131737,9 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus // Add WhereLoop entries to handle OR terms. This works for either // btrees or virtual tables. -func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:149089:12: */ - bp := tls.Alloc(784) - defer tls.Free(784) +func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:151721:12: */ + bp := tls.Alloc(720) + defer tls.Free(720) var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo var pWC uintptr @@ -129427,9 +131748,9 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable var pWCEnd uintptr var rc int32 = SQLITE_OK var iCur int32 - // var tempWC WhereClause at bp+112, 552 + // var tempWC WhereClause at bp+112, 488 - // var sSubBuild WhereLoopBuilder at bp+664, 64 + // var sSubBuild WhereLoopBuilder at bp+600, 64 // var sSum WhereOrSet at bp, 56 @@ -129438,47 +131759,47 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable var pItem uintptr pWC = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC - pWCEnd = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*64) + pWCEnd = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*56) pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew libc.Xmemset(tls, bp /* &sSum */, 0, uint64(unsafe.Sizeof(WhereOrSet{}))) pItem = (((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*112) - iCur = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor + iCur = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor - for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; (pTerm < pWCEnd) && (rc == SQLITE_OK); pTerm += 64 { + for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; (pTerm < pWCEnd) && (rc == SQLITE_OK); pTerm += 56 { if ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_OR) != 0) && - (((*WhereOrInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)))).Findexable & (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf) != uint64(0)) { - var pOrWC uintptr = (*(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)) /* &.wc */) - var pOrWCEnd uintptr = ((*WhereClause)(unsafe.Pointer(pOrWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pOrWC)).FnTerm)*64) + (((*WhereOrInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 32 /* &.u */)))).Findexable & (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf) != uint64(0)) { + var pOrWC uintptr = (*(*uintptr)(unsafe.Pointer(pTerm + 32 /* &.u */)) /* &.wc */) + var pOrWCEnd uintptr = ((*WhereClause)(unsafe.Pointer(pOrWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pOrWC)).FnTerm)*56) var pOrTerm uintptr var once int32 = 1 var i int32 var j int32 - *(*WhereLoopBuilder)(unsafe.Pointer(bp + 664 /* sSubBuild */)) = *(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)) - (*WhereLoopBuilder)(unsafe.Pointer(bp + 664 /* &sSubBuild */)).FpOrderBy = uintptr(0) - (*WhereLoopBuilder)(unsafe.Pointer(bp + 664 /* &sSubBuild */)).FpOrSet = bp + 56 /* &sCur */ + *(*WhereLoopBuilder)(unsafe.Pointer(bp + 600 /* sSubBuild */)) = *(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)) + (*WhereLoopBuilder)(unsafe.Pointer(bp + 600 /* &sSubBuild */)).FpOrderBy = uintptr(0) + (*WhereLoopBuilder)(unsafe.Pointer(bp + 600 /* &sSubBuild */)).FpOrSet = bp + 56 /* &sCur */ - for pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWC)).Fa; pOrTerm < pOrWCEnd; pOrTerm += 64 { + for pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWC)).Fa; pOrTerm < pOrWCEnd; pOrTerm += 56 { if (int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator) & WO_AND) != 0 { - (*WhereLoopBuilder)(unsafe.Pointer(bp + 664 /* &sSubBuild */)).FpWC = (*(*uintptr)(unsafe.Pointer(pOrTerm + 40 /* &.u */)) /* &.wc */) + (*WhereLoopBuilder)(unsafe.Pointer(bp + 600 /* &sSubBuild */)).FpWC = (*(*uintptr)(unsafe.Pointer(pOrTerm + 32 /* &.u */)) /* &.wc */) } else if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur { (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FpWInfo = (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FpOuter = pWC - (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).Fop = TK_AND + (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).Fop = U8(TK_AND) (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FnTerm = 1 (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).Fa = pOrTerm - (*WhereLoopBuilder)(unsafe.Pointer(bp + 664 /* &sSubBuild */)).FpWC = bp + 112 /* &tempWC */ + (*WhereLoopBuilder)(unsafe.Pointer(bp + 600 /* &sSubBuild */)).FpWC = bp + 112 /* &tempWC */ } else { continue } (*WhereOrSet)(unsafe.Pointer(bp + 56 /* &sCur */)).Fn = U16(0) - if (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpTab)).FnModuleArg != 0 { - rc = whereLoopAddVirtual(tls, bp+664 /* &sSubBuild */, mPrereq, mUnusable) + if (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FnModuleArg != 0 { + rc = whereLoopAddVirtual(tls, bp+600 /* &sSubBuild */, mPrereq, mUnusable) } else { - rc = whereLoopAddBtree(tls, bp+664 /* &sSubBuild */, mPrereq) + rc = whereLoopAddBtree(tls, bp+600 /* &sSubBuild */, mPrereq) } if rc == SQLITE_OK { - rc = whereLoopAddOr(tls, bp+664 /* &sSubBuild */, mPrereq, mUnusable) + rc = whereLoopAddOr(tls, bp+600 /* &sSubBuild */, mPrereq, mUnusable) } if int32((*WhereOrSet)(unsafe.Pointer(bp+56 /* &sCur */)).Fn) == 0 { @@ -129488,22 +131809,22 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable whereOrMove(tls, bp /* &sSum */, bp+56 /* &sCur */) once = 0 } else { - // var sPrev WhereOrSet at bp+728, 56 + // var sPrev WhereOrSet at bp+664, 56 - whereOrMove(tls, bp+728 /* &sPrev */, bp /* &sSum */) + whereOrMove(tls, bp+664 /* &sPrev */, bp /* &sSum */) (*WhereOrSet)(unsafe.Pointer(bp /* &sSum */)).Fn = U16(0) - for i = 0; i < int32((*WhereOrSet)(unsafe.Pointer(bp+728 /* &sPrev */)).Fn); i++ { + for i = 0; i < int32((*WhereOrSet)(unsafe.Pointer(bp+664 /* &sPrev */)).Fn); i++ { for j = 0; j < int32((*WhereOrSet)(unsafe.Pointer(bp+56 /* &sCur */)).Fn); j++ { - whereOrInsert(tls, bp /* &sSum */, ((*WhereOrCost)(unsafe.Pointer((bp+728 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).Fprereq | (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).Fprereq), - Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+728 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FrRun, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FrRun), - Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+728 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FnOut, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FnOut)) + whereOrInsert(tls, bp /* &sSum */, ((*WhereOrCost)(unsafe.Pointer((bp+664 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).Fprereq | (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).Fprereq), + Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+664 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FrRun, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FrRun), + Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+664 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FnOut, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FnOut)) } } } } (*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(1) *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm)) = pTerm - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_MULTI_OR + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_MULTI_OR) (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0) (*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = U8(0) libc.Xmemset(tls, (pNew + 24 /* &.u */), 0, uint64(unsafe.Sizeof(struct { @@ -129540,7 +131861,7 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable } // Add all WhereLoop objects for all tables -func whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:149213:12: */ +func whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:151845:12: */ var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo var mPrereq Bitmask = uint64(0) var mPrior Bitmask = uint64(0) @@ -129555,7 +131876,7 @@ func whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:14921 // Loop over the tables in the join, from left to right pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew whereLoopInit(tls, pNew) - (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FiPlanLimit = SQLITE_QUERY_PLANNER_LIMIT + (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FiPlanLimit = uint32(SQLITE_QUERY_PLANNER_LIMIT) iTab = 0 pItem = pTabList + 8 /* &.a */ __1: @@ -129565,20 +131886,20 @@ __1: { var mUnusable Bitmask = uint64(0) (*WhereLoop)(unsafe.Pointer(pNew)).FiTab = U8(iTab) - *(*uint32)(unsafe.Pointer(pBuilder + 56 /* &.iPlanLimit */)) += (SQLITE_QUERY_PLANNER_LIMIT_INCR) - (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf = Xsqlite3WhereGetMask(tls, (pWInfo + 656 /* &.sMaskSet */), (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor) - if (int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0 { + *(*uint32)(unsafe.Pointer(pBuilder + 56 /* &.iPlanLimit */)) += (uint32(SQLITE_QUERY_PLANNER_LIMIT_INCR)) + (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf = Xsqlite3WhereGetMask(tls, (pWInfo + 592 /* &.sMaskSet */), (*SrcItem)(unsafe.Pointer(pItem)).FiCursor) + if (int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0 { // This condition is true when pItem is the FROM clause term on the // right-hand-side of a LEFT or CROSS JOIN. mPrereq = mPrior } else { mPrereq = uint64(0) } - if (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpTab)).FnModuleArg != 0 { + if (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FnModuleArg != 0 { var p uintptr for p = (pItem + 1*112); p < pEnd; p += 112 { - if (mUnusable != 0) || ((int32((*SrcList_item)(unsafe.Pointer(p)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0) { - mUnusable = mUnusable | (Xsqlite3WhereGetMask(tls, (pWInfo + 656 /* &.sMaskSet */), (*SrcList_item)(unsafe.Pointer(p)).FiCursor)) + if (mUnusable != 0) || ((int32((*SrcItem)(unsafe.Pointer(p)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0) { + mUnusable = mUnusable | (Xsqlite3WhereGetMask(tls, (pWInfo + 592 /* &.sMaskSet */), (*SrcItem)(unsafe.Pointer(p)).FiCursor)) } } rc = whereLoopAddVirtual(tls, pBuilder, mPrereq, mUnusable) @@ -129592,7 +131913,7 @@ __1: if (rc != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { if rc == SQLITE_DONE { // We hit the query planner search limit set by iPlanLimit - Xsqlite3_log(tls, SQLITE_WARNING, ts+19289 /* "abbreviated quer..." */, 0) + Xsqlite3_log(tls, SQLITE_WARNING, ts+19765 /* "abbreviated quer..." */, 0) rc = SQLITE_OK } else { goto __3 @@ -129628,7 +131949,7 @@ __3: // 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 *libc.TLS, pWInfo uintptr, pOrderBy uintptr, pPath uintptr, wctrlFlags U16, nLoop U16, pLast uintptr, pRevMask uintptr) I8 { /* sqlite3.c:149291:11: */ +func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, pPath uintptr, wctrlFlags U16, nLoop U16, pLast uintptr, pRevMask uintptr) I8 { /* sqlite3.c:151923:11: */ var revSet U8 // True if rev is known var rev U8 // Composite sort order var revIdx U8 // Index sort order @@ -129675,7 +131996,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, // rowid appears in the ORDER BY clause, the corresponding WhereLoop is // automatically order-distinct. - if (nLoop != 0) && ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_OrderByIdxJoin)) != 0) { + if (nLoop != 0) && (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_OrderByIdxJoin))) != U32(0)) { return int8(0) } @@ -129704,7 +132025,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } else { pLoop = pLast } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != 0 { if (*(*I8)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.vtab */) + 5 /* &.isOrdered */)) != 0) && ((int32(wctrlFlags) & WHERE_DISTINCTBY) == 0) { obSat = obDone } @@ -129712,7 +132033,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } else if (int32(wctrlFlags) & WHERE_DISTINCTBY) != 0 { *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 6 /* &.nDistinctCol */)) = U16(0) } - iCur = (*SrcList_item)(unsafe.Pointer(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*112)).FiCursor + iCur = (*SrcItem)(unsafe.Pointer(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*112)).FiCursor // Mark off any ORDER BY term X that is a column in the table of // the current loop for which there is term in the WHERE @@ -129723,6 +132044,9 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, continue } pOBExpr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*32)).FpExpr) + if pOBExpr == uintptr(0) { + continue + } if int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_COLUMN { continue } @@ -129758,8 +132082,8 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, obSat = obSat | (Bitmask((uint64(1))) << (i)) } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_ONEROW) == U32(0) { - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IPK) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != 0 { pIndex = uintptr(0) nKeyCol = U16(0) nColumn = U16(1) @@ -129770,7 +132094,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, nColumn = (*Index)(unsafe.Pointer(pIndex)).FnColumn isOrderDistinct = (U8(libc.Bool32((int32((*Index)(unsafe.Pointer((pIndex))).FonError) != OE_None) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_SKIPSCAN) == U32(0))))) + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_SKIPSCAN)) == U32(0))))) } // Loop through all columns of the index and deal with the ones @@ -129847,6 +132171,9 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } pOBExpr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*32)).FpExpr) + if pOBExpr == uintptr(0) { + continue + } if (int32(wctrlFlags) & (WHERE_GROUPBY | WHERE_DISTINCTBY)) == 0 { bOnce = U8(0) } @@ -129895,7 +132222,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } if (isMatch != 0) && ((int32((*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*32)).FsortFlags) & KEYINFO_ORDER_BIGNULL) != 0) { if j == int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) { - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_BIGNULL_SORT) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_BIGNULL_SORT)) } else { isMatch = U8(0) } @@ -129931,7 +132258,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, continue } p = (*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(i)*32)).FpExpr - mTerm = Xsqlite3WhereExprUsage(tls, (pWInfo + 656 /* &.sMaskSet */), p) + mTerm = Xsqlite3WhereExprUsage(tls, (pWInfo + 592 /* &.sMaskSet */), p) if (mTerm == uint64(0)) && !(Xsqlite3ExprIsConstant(tls, p) != 0) { continue } @@ -129977,7 +132304,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, // // 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 Xsqlite3WhereIsSorted(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:149626:20: */ +func Xsqlite3WhereIsSorted(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:152260:20: */ return (int32(*(*uint8)(unsafe.Pointer(pWInfo + 68 /* &.sorted */)) & 0x8 >> 3)) } @@ -129985,7 +132312,7 @@ func Xsqlite3WhereIsSorted(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:1 // 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 *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32, nSorted int32) LogEst { /* sqlite3.c:149649:15: */ +func whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32, nSorted int32) LogEst { /* sqlite3.c:152283:15: */ // TUNING: Estimated cost of a full external sort, where N is // the number of rows to sort is: // @@ -130006,9 +132333,17 @@ func whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32 rSortCost = (LogEst((int32(nRow) + int32(rScale)) + 16)) // Multiple by log(M) where M is the number of output rows. - // Use the LIMIT for M if it is smaller + // Use the LIMIT for M if it is smaller. Or if this sort is for + // a DISTINCT operator, M will be the number of distinct output + // rows, so fudge it downwards a bit. if ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_USE_LIMIT) != 0) && (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FiLimit) < int32(nRow)) { nRow = (*WhereInfo)(unsafe.Pointer(pWInfo)).FiLimit + } else if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_WANT_DISTINCT) != 0 { + // TUNING: In the sort for a DISTINCT operator, assume that the DISTINCT + // reduces the number of output rows by a factor of 2 + if int32(nRow) > 10 { + nRow = int16(int32(nRow) - (10)) + } } rSortCost = LogEst(int32(rSortCost) + (int32(estLog(tls, nRow)))) return rSortCost @@ -130024,7 +132359,7 @@ func whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32 // // Return SQLITE_OK on success or SQLITE_NOMEM of a memory allocation // error occurs. -func wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst LogEst) int32 { /* sqlite3.c:149694:12: */ +func wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst LogEst) int32 { /* sqlite3.c:152336:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -130174,7 +132509,7 @@ __3: if ((*WhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf & (*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop) != uint64(0) { continue } - if (((*WhereLoop)(unsafe.Pointer(pWLoop)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) && (int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) < 3) { + if (((*WhereLoop)(unsafe.Pointer(pWLoop)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && (int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) < 3) { // Do not use an automatic index if the this loop is expected // to run less than 1.25 times. It is tempting to also exclude // automatic index usage on an outer loop, but sometimes an automatic @@ -130339,7 +132674,7 @@ __3: } if nFrom == 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+19324 /* "no query solutio..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+19800 /* "no query solutio..." */, 0) Xsqlite3DbFreeNN(tls, db, pSpace) return SQLITE_ERROR } @@ -130354,10 +132689,10 @@ __3: // Load the lowest cost path into pWInfo for iLoop = 0; iLoop < nLoop; iLoop++ { - var pLevel uintptr = ((pWInfo + 920 /* &.a */) + uintptr(iLoop)*88) + var pLevel uintptr = ((pWInfo + 856 /* &.a */) + uintptr(iLoop)*88) (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop = libc.AssignUintptr(&pWLoop, *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(iLoop)*8))) (*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom = (*WhereLoop)(unsafe.Pointer(pWLoop)).FiTab - (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur = (*SrcList_item)(unsafe.Pointer(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112)).FiCursor + (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur = (*SrcItem)(unsafe.Pointer(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112)).FiCursor } if ((((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_WANT_DISTINCT) != 0) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DISTINCTBY) == 0)) && @@ -130366,16 +132701,16 @@ __3: // var notUsed Bitmask at bp+8, 8 var rc int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet, pFrom, - WHERE_DISTINCTBY, (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+8 /* ¬Used */)) + uint16(WHERE_DISTINCTBY), (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+8 /* ¬Used */)) if rc == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet)).FnExpr { - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_ORDERED + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_ORDERED) } } libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bOrderedInnerLoop */, uint32(0), 2, 0x4) if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 { if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DISTINCTBY) != 0 { if int32((*WherePath)(unsafe.Pointer(pFrom)).FisOrdered) == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr { - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_ORDERED + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_ORDERED) } } else { (*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = (*WherePath)(unsafe.Pointer(pFrom)).FisOrdered @@ -130384,11 +132719,11 @@ __3: (*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = int8(0) if nLoop > 0 { var wsFlags U32 = (*WhereLoop)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)))).FwsFlags - if ((wsFlags & WHERE_ONEROW) == U32(0)) && + if ((wsFlags & U32(WHERE_ONEROW)) == U32(0)) && ((wsFlags & (U32(WHERE_IPK | WHERE_COLUMN_IN))) != (U32(WHERE_IPK | WHERE_COLUMN_IN))) { *(*Bitmask)(unsafe.Pointer(bp + 16 /* m */)) = uint64(0) var rc int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, - WHERE_ORDERBY_LIMIT, (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+16 /* &m */)) + uint16(WHERE_ORDERBY_LIMIT), (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+16 /* &m */)) if rc == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr { libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bOrderedInnerLoop */, uint32(1), 2, 0x4) @@ -130431,7 +132766,7 @@ __3: // 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 *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086:12: */ +func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:152728:12: */ var pWInfo uintptr var pItem uintptr var pWC uintptr @@ -130448,14 +132783,14 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: } pItem = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */ - pTab = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab + pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { return 0 } if (uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 60 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 { return 0 } - iCur = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor + iCur = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor pWC = (pWInfo + 104 /* &.sWC */) pLoop = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = U32(0) @@ -130495,8 +132830,8 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: continue } (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = (U32((WHERE_COLUMN_EQ | WHERE_ONEROW) | WHERE_INDEXED)) - if ((uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100 /* &.isCovering */)) & 0x20 >> 5))) != 0) || (((*SrcList_item)(unsafe.Pointer(pItem)).FcolUsed & (*Index)(unsafe.Pointer(pIdx)).FcolNotIdxed) == uint64(0)) { - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_IDX_ONLY) + if ((uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100 /* &.isCovering */)) & 0x20 >> 5))) != 0) || (((*SrcItem)(unsafe.Pointer(pItem)).FcolUsed & (*Index)(unsafe.Pointer(pIdx)).FcolNotIdxed) == uint64(0)) { + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_IDX_ONLY)) } (*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = U16(j) *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)) = U16(j) @@ -130508,16 +132843,16 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: } if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags != 0 { (*WhereLoop)(unsafe.Pointer(pLoop)).FnOut = int16(1) - (*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */))).FpWLoop = pLoop + (*WhereLevel)(unsafe.Pointer((pWInfo + 856 /* &.a */))).FpWLoop = pLoop (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf = uint64(1) // sqlite3WhereGetMask(&pWInfo->sMaskSet, iCur); - (*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */))).FiTabCur = iCur + (*WhereLevel)(unsafe.Pointer((pWInfo + 856 /* &.a */))).FiTabCur = iCur (*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut = int16(1) if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 { (*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = I8((*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr) } if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_WANT_DISTINCT) != 0 { - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_UNIQUE + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE) } return 1 } @@ -130525,8 +132860,8 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: } // Helper function for exprIsDeterministic(). -func exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:150168:12: */ - if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && ((libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_ConstFunc)) != U32(0))) == 0) { +func exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:152810:12: */ + if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && ((libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_ConstFunc))) != U32(0))) == 0) { (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort } @@ -130536,7 +132871,7 @@ func exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int3 // Return true if the expression contains no non-deterministic SQL // functions. Do not consider non-deterministic SQL functions that are // part of sub-select statements. -func exprIsDeterministic(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:150181:12: */ +func exprIsDeterministic(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:152823:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -130640,7 +132975,7 @@ func exprIsDeterministic(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:150181:1 // 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 Xsqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pResultSet uintptr, wctrlFlags U16, iAuxArg int32) uintptr { /* sqlite3.c:150301:26: */ +func Xsqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pResultSet uintptr, wctrlFlags U16, iAuxArg int32) uintptr { /* sqlite3.c:152943:26: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -130707,7 +133042,7 @@ __1: // Disable the DISTINCT optimization if SQLITE_DistinctOpt is set via // sqlite3_test_ctrl(SQLITE_TESTCTRL_OPTIMIZATIONS,...) - if !((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_DistinctOpt)) != 0) { + if !(((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_DistinctOpt))) != U32(0)) { goto __2 } wctrlFlags = libc.Uint16FromInt32(int32(wctrlFlags) & (libc.CplInt32(WHERE_WANT_DISTINCT))) @@ -130720,7 +133055,7 @@ __2: if !((*SrcList)(unsafe.Pointer(pTabList)).FnSrc > (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8)))) { goto __3 } - Xsqlite3ErrorMsg(tls, pParse, ts+19342 /* "at most %d table..." */, libc.VaList(bp, (int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))))) + Xsqlite3ErrorMsg(tls, pParse, ts+19818 /* "at most %d table..." */, libc.VaList(bp, (int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))))) return uintptr(0) __3: ; @@ -130764,9 +133099,9 @@ __4: (*WhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop = int32((*Parse)(unsafe.Pointer(pParse)).FnQueryLoop) libc.Xmemset(tls, (pWInfo + 65 /* &.nOBSat */), 0, ((uint64((uintptr(0) + 104 /* &.sWC */))) - (uint64((uintptr(0) + 65 /* &.nOBSat */))))) - libc.Xmemset(tls, (pWInfo + 920 /* &.a */), 0, (uint64(unsafe.Sizeof(WhereLoop{})) + (uint64(nTabList) * uint64(unsafe.Sizeof(WhereLevel{}))))) + libc.Xmemset(tls, (pWInfo + 856 /* &.a */), 0, (uint64(unsafe.Sizeof(WhereLoop{})) + (uint64(nTabList) * uint64(unsafe.Sizeof(WhereLevel{}))))) // ONEPASS defaults to OFF - pMaskSet = (pWInfo + 656 /* &.sMaskSet */) + pMaskSet = (pWInfo + 592 /* &.sMaskSet */) (*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpWInfo = pWInfo (*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpWC = (pWInfo + 104 /* &.sWC */) (*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpNew = ((pWInfo) + uintptr(nByteWInfo)) @@ -130777,7 +133112,7 @@ __4: // subexpression is separated by an AND operator. (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn = 0 Xsqlite3WhereClauseInit(tls, (pWInfo + 104 /* &.sWC */), pWInfo) - Xsqlite3WhereSplit(tls, (pWInfo + 104 /* &.sWC */), pWhere, TK_AND) + Xsqlite3WhereSplit(tls, (pWInfo + 104 /* &.sWC */), pWhere, uint8(TK_AND)) // Special case: No FROM clause if !(nTabList == 0) { @@ -130792,10 +133127,10 @@ __7: if !((int32(wctrlFlags) & WHERE_WANT_DISTINCT) != 0) { goto __8 } - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_UNIQUE + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE) __8: ; - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+19370 /* "SCAN CONSTANT RO..." */, 0) + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+19846 /* "SCAN CONSTANT RO..." */, 0) goto __6 __5: // Assign a bit from the bitmask to every term in the FROM clause. @@ -130813,7 +133148,7 @@ __5: // WHERE_OR_SUBCLAUSE flag is set. ii = 0 __9: - createMask(tls, pMaskSet, (*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(ii)*112)).FiCursor) + createMask(tls, pMaskSet, (*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(ii)*112)).FiCursor) Xsqlite3WhereTabFuncArgs(tls, pParse, ((pTabList + 8 /* &.a */) + uintptr(ii)*112), (pWInfo + 104 /* &.sWC */)) goto __10 __10: @@ -130850,7 +133185,7 @@ __13: if !(ii < (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).FnTerm) { goto __15 } - pT = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).Fa + uintptr(ii)*64) + pT = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).Fa + uintptr(ii)*56) if !((int32((*WhereTerm)(unsafe.Pointer(pT)).FwtFlags) & TERM_VIRTUAL) != 0) { goto __16 } @@ -130879,7 +133214,7 @@ __15: goto __19 } // The DISTINCT marking is pointless. Ignore it. - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_UNIQUE + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE) goto __20 __19: if !(pOrderBy == uintptr(0)) { @@ -130958,7 +133293,7 @@ __29: ; __22: ; - if !(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0)) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ReverseOrder) != uint64(0))) { + if !(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0)) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ReverseOrder)) != uint64(0))) { goto __31 } (*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = libc.Uint64(libc.Uint64FromInt32(-1)) @@ -131002,7 +133337,7 @@ __32: notReady = libc.CplUint64(uint64(0)) if !(((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= 2) && (pResultSet != uintptr(0))) && // guarantees condition (1) above - ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_OmitNoopJoin)) == 0)) { + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_OmitNoopJoin))) == U32(0))) { goto __33 } tabUsed = Xsqlite3WhereExprListUsage(tls, pMaskSet, pResultSet) @@ -131017,16 +133352,16 @@ __35: if !(i >= 1) { goto __37 } - pLoop = (*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */) + uintptr(i)*88)).FpWLoop + pLoop = (*WhereLevel)(unsafe.Pointer((pWInfo + 856 /* &.a */) + uintptr(i)*88)).FpWLoop pItem = (((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*112) - if !((int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) == 0) { + if !((int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) == 0) { goto __38 } goto __36 __38: ; if !(((int32(wctrlFlags) & WHERE_WANT_DISTINCT) == 0) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_ONEROW) == U32(0))) { + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) == U32(0))) { goto __39 } goto __36 @@ -131038,7 +133373,7 @@ __39: goto __36 __40: ; - pEnd = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).FnTerm)*64) + pEnd = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).FnTerm)*56) pTerm = (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpWC)).Fa __41: if !(pTerm < pEnd) { @@ -131047,8 +133382,8 @@ __41: if !(((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf) != uint64(0)) { goto __44 } - if !(!(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)) || - (int32((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiRightJoinTable) != (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor)) { + if !(!(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) || + ((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiRightJoinTable != (*SrcItem)(unsafe.Pointer(pItem)).FiCursor)) { goto __45 } goto __43 @@ -131058,7 +133393,7 @@ __44: ; goto __42 __42: - pTerm += 64 + pTerm += 56 goto __41 goto __43 __43: @@ -131084,7 +133419,7 @@ __50: ; goto __48 __48: - pTerm += 64 + pTerm += 56 goto __47 goto __49 __49: @@ -131093,7 +133428,7 @@ __49: goto __51 } nByte = (int32((uint64((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1) - i)) * uint64(unsafe.Sizeof(WhereLevel{})))) - libc.Xmemmove(tls, ((pWInfo + 920 /* &.a */) + uintptr(i)*88), ((pWInfo + 920 /* &.a */) + uintptr((i+1))*88), uint64(nByte)) + libc.Xmemmove(tls, ((pWInfo + 856 /* &.a */) + uintptr(i)*88), ((pWInfo + 856 /* &.a */) + uintptr((i+1))*88), uint64(nByte)) __51: ; (*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel-- @@ -131107,7 +133442,7 @@ __37: ; __33: ; - *(*U32)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 196 /* &.nQueryLoop */)) += (U32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) + *(*U32)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 192 /* &.nQueryLoop */)) += (U32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) // If the caller is an UPDATE or DELETE statement that is requesting // to use a one-pass algorithm, determine if this is appropriate. @@ -131131,30 +133466,30 @@ __33: if !((int32(wctrlFlags) & WHERE_ONEPASS_DESIRED) != 0) { goto __52 } - wsFlags = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */))).FpWLoop)).FwsFlags) + wsFlags = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 856 /* &.a */))).FpWLoop)).FwsFlags) bOnerow = (libc.Bool32((wsFlags & WHERE_ONEROW) != 0)) if !((bOnerow != 0) || (((0 != (int32(wctrlFlags) & WHERE_ONEPASS_MULTIROW)) && - !((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab)).FnModuleArg != 0)) && + !((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab)).FnModuleArg != 0)) && ((0 == (wsFlags & WHERE_MULTI_OR)) || ((int32(wctrlFlags) & WHERE_DUPLICATES_OK) != 0)))) { goto __53 } (*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass = func() uint8 { if bOnerow != 0 { - return ONEPASS_SINGLE + return uint8(ONEPASS_SINGLE) } - return ONEPASS_MULTI + return uint8(ONEPASS_MULTI) }() - if !((((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((wsFlags & WHERE_IDX_ONLY) != 0)) { + if !((((*Table)(unsafe.Pointer(((*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((wsFlags & WHERE_IDX_ONLY) != 0)) { goto __54 } if !((int32(wctrlFlags) & WHERE_ONEPASS_MULTIROW) != 0) { goto __55 } - bFordelete = OPFLAG_FORDELETE + bFordelete = U8(OPFLAG_FORDELETE) __55: ; - (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */))).FpWLoop)).FwsFlags = (U32(wsFlags & libc.CplInt32(WHERE_IDX_ONLY))) + (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 856 /* &.a */))).FpWLoop)).FwsFlags = (U32(wsFlags & libc.CplInt32(WHERE_IDX_ONLY))) __54: ; __53: @@ -131165,27 +133500,27 @@ __52: // Open all tables in the pTabList and any indices selected for // searching those tables. ii = 0 - pLevel = pWInfo + 920 /* &.a */ + pLevel = pWInfo + 856 /* &.a */ __56: if !(ii < nTabList) { goto __58 } pTabItem = ((pTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112) - pTab = (*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab + pTab = (*SrcItem)(unsafe.Pointer(pTabItem)).FpTab iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop - if !((((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Ephemeral) != U32(0)) || ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) { + if !((((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) != U32(0)) || ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) { goto __59 } // Do nothing goto __60 __59: - if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) != U32(0)) { + if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0)) { goto __61 } pVTab = Xsqlite3GetVTable(tls, db, pTab) - iCur = (*SrcList_item)(unsafe.Pointer(pTabItem)).FiCursor + iCur = (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor Xsqlite3VdbeAddOp4(tls, v, OP_VOpen, iCur, 0, 0, pVTab, -12) goto __62 __61: @@ -131195,7 +133530,7 @@ __61: // noop goto __64 __63: - if !((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IDX_ONLY) == U32(0)) && + if !((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IDX_ONLY)) == U32(0)) && ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) == 0)) { goto __65 } @@ -131204,11 +133539,11 @@ __63: goto __67 } op = OP_OpenWrite - *(*int32)(unsafe.Pointer((pWInfo + 40 /* &.aiCurOnePass */))) = (*SrcList_item)(unsafe.Pointer(pTabItem)).FiCursor + *(*int32)(unsafe.Pointer((pWInfo + 40 /* &.aiCurOnePass */))) = (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor __67: ; - Xsqlite3OpenTable(tls, pParse, (*SrcList_item)(unsafe.Pointer(pTabItem)).FiCursor, iDb, pTab, op) + Xsqlite3OpenTable(tls, pParse, (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor, iDb, pTab, op) if !(((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF) && (int32((*Table)(unsafe.Pointer(pTab)).FnCol) < (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))))) && @@ -131218,7 +133553,7 @@ __67: // If we know that only a prefix of the record will be used, // it is advantageous to reduce the "column count" field in // the P4 operand of the OP_OpenRead/Write opcode. - b = (*SrcList_item)(unsafe.Pointer(pTabItem)).FcolUsed + b = (*SrcItem)(unsafe.Pointer(pTabItem)).FcolUsed n = 0 __69: if !(b != 0) { @@ -131250,14 +133585,14 @@ __62: ; __60: ; - if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_INDEXED) != 0) { + if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != 0) { goto __72 } pIx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) op1 = OP_OpenRead // iAuxArg is always set to a positive value if ONEPASS is possible - if !((!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) && + if !((!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) && ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0)) { goto __73 } @@ -131270,7 +133605,7 @@ __73: if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) != ONEPASS_OFF) { goto __75 } - pJ = (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab)).FpIndex + pJ = (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pTabItem)).FpTab)).FpIndex iIndexCur = iAuxArg __77: @@ -131307,14 +133642,15 @@ __74: } Xsqlite3VdbeAddOp3(tls, v, op1, iIndexCur, int32((*Index)(unsafe.Pointer(pIx)).Ftnum), iDb) Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIx) - if !(((((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_CONSTRAINT) != U32(0)) && + if !((((((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_CONSTRAINT)) != U32(0)) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_COLUMN_RANGE | WHERE_SKIPSCAN))) == U32(0))) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BIGNULL_SORT) == U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BIGNULL_SORT)) == U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_SEEKSCAN)) == U32(0))) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_ORDERBY_MIN) == 0)) && (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) != WHERE_DISTINCT_ORDERED)) { goto __82 } - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_SEEKEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SEEKEQ)) __82: ; @@ -131352,9 +133688,9 @@ __85: if !(ii < nTabList) { goto __87 } - pLevel = ((pWInfo + 920 /* &.a */) + uintptr(ii)*88) + pLevel = ((pWInfo + 856 /* &.a */) + uintptr(ii)*88) wsFlags1 = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) - if !(((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) { + if !(((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) { goto __88 } constructAutomaticIndex(tls, pParse, (pWInfo + 104 /* &.sWC */), @@ -131388,6 +133724,7 @@ __87: // Done. + (*WhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = Xsqlite3VdbeCurrentAddr(tls, v) return pWInfo // Jump here if malloc fails @@ -131409,7 +133746,7 @@ __91: // Generate the end of the WHERE loop. See comments on // sqlite3WhereBegin() for additional information. -func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: */ +func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:153539:21: */ var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var i int32 @@ -131417,12 +133754,13 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * var pLoop uintptr var pTabList uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb + var iEnd int32 = Xsqlite3VdbeCurrentAddr(tls, v) // Generate loop termination code. for i = (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1); i >= 0; i-- { var addr int32 - pLevel = ((pWInfo + 920 /* &.a */) + uintptr(i)*88) + pLevel = ((pWInfo + 856 /* &.a */) + uintptr(i)*88) pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if int32((*WhereLevel)(unsafe.Pointer(pLevel)).Fop) != OP_Noop { var addrSeek int32 = 0 @@ -131430,7 +133768,7 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * var n int32 if (((((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == WHERE_DISTINCT_ORDERED) && (i == (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1))) && // Ticket [ef9318757b152e3] 2017-10-21 - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_INDEXED) != U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != U32(0))) && ((uint32(int32(*(*uint16)(unsafe.Pointer((libc.AssignUintptr(&pIdx, *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))) + 100 /* &.hasStat1 */)) & 0x80 >> 7))) != 0)) && ((libc.AssignInt32(&n, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 6 /* &.nDistinctCol */))))) > 0)) && (int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst + uintptr(n)*2))) >= 36) { @@ -131466,7 +133804,7 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * } else { Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont) } - if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IN_ABLE) != 0) && (*(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) > 0) { + if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_ABLE)) != 0) && (*(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) > 0) { var pIn uintptr var j int32 Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt) @@ -131480,7 +133818,8 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * Xsqlite3VdbeJumpHere(tls, v, ((*InLoop)(unsafe.Pointer(pIn)).FaddrInTop + 1)) if int32((*InLoop)(unsafe.Pointer(pIn)).FeEndLoopOp) != OP_Noop { if (*InLoop)(unsafe.Pointer(pIn)).FnPrefix != 0 { - + var bEarlyOut int32 = (libc.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0)) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_EARLYOUT)) != U32(0)))) if (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin != 0 { // For LEFT JOIN queries, cursor pIn->iCur may not have been // opened yet. This occurs for WHERE clauses such as @@ -131491,10 +133830,10 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * // jump over the OP_Next or OP_Prev instruction about to // be coded. Xsqlite3VdbeAddOp2(tls, v, OP_IfNotOpen, (*InLoop)(unsafe.Pointer(pIn)).FiCur, - ((Xsqlite3VdbeCurrentAddr(tls, v) + 2) + (libc.Bool32(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0))))) + ((Xsqlite3VdbeCurrentAddr(tls, v) + 2) + bEarlyOut)) } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0) { + if bEarlyOut != 0 { Xsqlite3VdbeAddOp4Int(tls, v, OP_IfNoHope, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, (Xsqlite3VdbeCurrentAddr(tls, v) + 2), (*InLoop)(unsafe.Pointer(pIn)).FiBase, (*InLoop)(unsafe.Pointer(pIn)).FnPrefix) @@ -131549,7 +133888,7 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * Xsqlite3VdbeResolveLabel(tls, v, (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak) i = 0 - pLevel = pWInfo + 920 /* &.a */ + pLevel = pWInfo + 856 /* &.a */ __4: if !(i < int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)) { goto __6 @@ -131558,9 +133897,10 @@ __4: var k int32 var last int32 var pOp uintptr + var pLastOp uintptr var pIdx uintptr = uintptr(0) var pTabItem uintptr = ((pTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112) - var pTab uintptr = (*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab + var pTab uintptr = (*SrcItem)(unsafe.Pointer(pTabItem)).FpTab pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -131570,7 +133910,7 @@ __4: if (uint32(int32(*(*uint8)(unsafe.Pointer(pTabItem + 60 /* &.fg */ + 4 /* &.viaCoroutine */)) & 0x10 >> 4))) != 0 { translateColumnToCopy(tls, pParse, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, - (*SrcList_item)(unsafe.Pointer(pTabItem)).FregResult, 0) + (*SrcItem)(unsafe.Pointer(pTabItem)).FregResult, 0) goto __5 } @@ -131586,28 +133926,28 @@ __4: // reference the index. if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_INDEXED | WHERE_IDX_ONLY))) != 0 { pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_MULTI_OR) != 0 { + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_MULTI_OR)) != 0 { pIdx = *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */)) } - if ((pIdx != 0) && - ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF) || !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & TF_WithoutRowid) == U32(0)))) && + if (pIdx != 0) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { - last = Xsqlite3VdbeCurrentAddr(tls, v) - k = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody - pOp = Xsqlite3VdbeGetOp(tls, v, k) - __7: - if !(k < last) { - goto __9 + if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF) || !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { + last = iEnd + } else { + last = (*WhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - { + k = ((*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody + 1) + pOp = Xsqlite3VdbeGetOp(tls, v, k) + pLastOp = (pOp + uintptr((last-k))*24) + + for ok := true; ok; ok = ((libc.PreIncUintptr(&pOp, 24)) < pLastOp) { if (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 != (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur { - goto __8 - } - if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column) || + // no-op + } else if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column) || (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Offset) { var x int32 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, pTab) x = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(x)*2))) @@ -131624,21 +133964,13 @@ __4: } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Rowid { (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_IdxRowid + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_IdxRowid) } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_IfNullRow { (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur } - } - goto __8 - __8: - k++ - pOp += 24 - goto __7 - goto __9 - __9: } } @@ -131805,7 +134137,7 @@ __6: // window frame has been coerced to: // // ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW -func row_numberStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151312:13: */ +func row_numberStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:153971:13: */ var p uintptr = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(I64(0)))) if p != 0 { (*(*I64)(unsafe.Pointer(p)))++ @@ -131814,7 +134146,7 @@ func row_numberStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = apArg } -func row_numberValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151322:13: */ +func row_numberValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:153981:13: */ var p uintptr = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(I64(0)))) Xsqlite3_result_int64(tls, pCtx, func() int64 { if p != 0 { @@ -131830,13 +134162,13 @@ type CallCount = struct { FnValue I64 FnStep I64 FnTotal I64 -} /* sqlite3.c:151331:1 */ +} /* sqlite3.c:153990:1 */ // Implementation of built-in window function dense_rank(). Assumes that // the window frame has been set to: // // RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW -func dense_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151343:13: */ +func dense_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154002:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{}))) if p != 0 { @@ -131846,7 +134178,7 @@ func dense_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = apArg } -func dense_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151354:13: */ +func dense_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154013:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{}))) if p != 0 { @@ -131864,9 +134196,9 @@ func dense_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151354:13: type NthValueCtx = struct { FnStep I64 FpValue uintptr -} /* sqlite3.c:151371:1 */ +} /* sqlite3.c:154030:1 */ -func nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151375:13: */ +func nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154034:13: */ var p uintptr var fVal float64 var iVal I64 @@ -131929,10 +134261,10 @@ __1: error_out: Xsqlite3_result_error(tls, - pCtx, ts+19388 /* "second argument ..." */, -1) + pCtx, ts+19864 /* "second argument ..." */, -1) } -func nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151416:13: */ +func nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154075:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, 0) if (p != 0) && ((*NthValueCtx)(unsafe.Pointer(p)).FpValue != 0) { @@ -131942,7 +134274,7 @@ func nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151416:13 } } -func first_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151428:13: */ +func first_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154087:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NthValueCtx{}))) if (p != 0) && ((*NthValueCtx)(unsafe.Pointer(p)).FpValue == uintptr(0)) { @@ -131955,7 +134287,7 @@ func first_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = apArg } -func first_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151444:13: */ +func first_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154103:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NthValueCtx{}))) if (p != 0) && ((*NthValueCtx)(unsafe.Pointer(p)).FpValue != 0) { @@ -131969,7 +134301,7 @@ func first_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151444: // the window frame has been set to: // // RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW -func rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151462:13: */ +func rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154121:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{}))) if p != 0 { @@ -131982,7 +134314,7 @@ func rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* s _ = apArg } -func rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151478:13: */ +func rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154137:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{}))) if p != 0 { @@ -131995,7 +134327,7 @@ func rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151478:13: */ // the window frame has been set to: // // GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING -func percent_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151493:13: */ +func percent_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154152:13: */ var p uintptr _ = nArg _ = apArg @@ -132005,7 +134337,7 @@ func percent_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr } } -func percent_rankInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151506:13: */ +func percent_rankInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154165:13: */ var p uintptr _ = nArg _ = apArg @@ -132013,7 +134345,7 @@ func percent_rankInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) (*CallCount)(unsafe.Pointer(p)).FnStep++ } -func percent_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151517:13: */ +func percent_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154176:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{}))) if p != 0 { @@ -132031,7 +134363,7 @@ func percent_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151517:13 // the window frame has been set to: // // GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING -func cume_distStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151538:13: */ +func cume_distStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154197:13: */ var p uintptr _ = nArg _ = apArg @@ -132041,7 +134373,7 @@ func cume_distStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { } } -func cume_distInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151551:13: */ +func cume_distInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154210:13: */ var p uintptr _ = nArg _ = apArg @@ -132049,7 +134381,7 @@ func cume_distInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { (*CallCount)(unsafe.Pointer(p)).FnStep++ } -func cume_distValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151562:13: */ +func cume_distValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154221:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, 0) if p != 0 { @@ -132063,13 +134395,13 @@ type NtileCtx = struct { FnTotal I64 FnParam I64 FiRow I64 -} /* sqlite3.c:151575:1 */ +} /* sqlite3.c:154234:1 */ // Implementation of ntile(). This assumes that the window frame has // been coerced to: // // ROWS CURRENT ROW AND UNBOUNDED FOLLOWING -func ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151587:13: */ +func ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154246:13: */ var p uintptr _ = nArg p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NtileCtx{}))) @@ -132078,14 +134410,14 @@ func ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* (*NtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*NtileCtx)(unsafe.Pointer(p)).FnParam <= int64(0) { Xsqlite3_result_error(tls, - pCtx, ts+19444 /* "argument of ntil..." */, -1) + pCtx, ts+19920 /* "argument of ntil..." */, -1) } } (*NtileCtx)(unsafe.Pointer(p)).FnTotal++ } } -func ntileInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151607:13: */ +func ntileInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154266:13: */ var p uintptr _ = nArg _ = apArg @@ -132093,7 +134425,7 @@ func ntileInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* s (*NtileCtx)(unsafe.Pointer(p)).FiRow++ } -func ntileValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151618:13: */ +func ntileValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154277:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NtileCtx{}))) if (p != 0) && ((*NtileCtx)(unsafe.Pointer(p)).FnParam > int64(0)) { @@ -132119,10 +134451,10 @@ type LastValueCtx = struct { FpVal uintptr FnVal int32 _ [4]byte -} /* sqlite3.c:151645:1 */ +} /* sqlite3.c:154304:1 */ // Implementation of last_value(). -func last_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151653:13: */ +func last_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154312:13: */ var p uintptr _ = nArg p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(LastValueCtx{}))) @@ -132137,7 +134469,7 @@ func last_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) } } -func last_valueInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151671:13: */ +func last_valueInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154330:13: */ var p uintptr _ = nArg _ = apArg @@ -132151,7 +134483,7 @@ func last_valueInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { } } -func last_valueValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151688:13: */ +func last_valueValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154347:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, 0) if (p != 0) && ((*LastValueCtx)(unsafe.Pointer(p)).FpVal != 0) { @@ -132159,7 +134491,7 @@ func last_valueValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151688:13: } } -func last_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151695:13: */ +func last_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154354:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(LastValueCtx{}))) if (p != 0) && ((*LastValueCtx)(unsafe.Pointer(p)).FpVal != 0) { @@ -132175,17 +134507,17 @@ func last_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151695:1 // comparison of the zName pointer. Example: // // if( pFuncDef->zName==row_valueName ){ ... } -var row_numberName = *(*[11]int8)(unsafe.Pointer(ts + 19489 /* "row_number" */)) /* sqlite3.c:151713:19 */ -var dense_rankName = *(*[11]int8)(unsafe.Pointer(ts + 19500 /* "dense_rank" */)) /* sqlite3.c:151714:19 */ -var rankName = *(*[5]int8)(unsafe.Pointer(ts + 19511 /* "rank" */)) /* sqlite3.c:151715:19 */ -var percent_rankName = *(*[13]int8)(unsafe.Pointer(ts + 19516 /* "percent_rank" */)) /* sqlite3.c:151716:19 */ -var cume_distName = *(*[10]int8)(unsafe.Pointer(ts + 19529 /* "cume_dist" */)) /* sqlite3.c:151717:19 */ -var ntileName = *(*[6]int8)(unsafe.Pointer(ts + 19539 /* "ntile" */)) /* sqlite3.c:151718:19 */ -var last_valueName = *(*[11]int8)(unsafe.Pointer(ts + 19545 /* "last_value" */)) /* sqlite3.c:151719:19 */ -var nth_valueName = *(*[10]int8)(unsafe.Pointer(ts + 19556 /* "nth_value" */)) /* sqlite3.c:151720:19 */ -var first_valueName = *(*[12]int8)(unsafe.Pointer(ts + 19566 /* "first_value" */)) /* sqlite3.c:151721:19 */ -var leadName = *(*[5]int8)(unsafe.Pointer(ts + 19578 /* "lead" */)) /* sqlite3.c:151722:19 */ -var lagName = *(*[4]int8)(unsafe.Pointer(ts + 19583 /* "lag" */)) /* sqlite3.c:151723:19 */ +var row_numberName = *(*[11]int8)(unsafe.Pointer(ts + 19965 /* "row_number" */)) /* sqlite3.c:154372:19 */ +var dense_rankName = *(*[11]int8)(unsafe.Pointer(ts + 19976 /* "dense_rank" */)) /* sqlite3.c:154373:19 */ +var rankName = *(*[5]int8)(unsafe.Pointer(ts + 19987 /* "rank" */)) /* sqlite3.c:154374:19 */ +var percent_rankName = *(*[13]int8)(unsafe.Pointer(ts + 19992 /* "percent_rank" */)) /* sqlite3.c:154375:19 */ +var cume_distName = *(*[10]int8)(unsafe.Pointer(ts + 20005 /* "cume_dist" */)) /* sqlite3.c:154376:19 */ +var ntileName = *(*[6]int8)(unsafe.Pointer(ts + 20015 /* "ntile" */)) /* sqlite3.c:154377:19 */ +var last_valueName = *(*[11]int8)(unsafe.Pointer(ts + 20021 /* "last_value" */)) /* sqlite3.c:154378:19 */ +var nth_valueName = *(*[10]int8)(unsafe.Pointer(ts + 20032 /* "nth_value" */)) /* sqlite3.c:154379:19 */ +var first_valueName = *(*[12]int8)(unsafe.Pointer(ts + 20042 /* "first_value" */)) /* sqlite3.c:154380:19 */ +var leadName = *(*[5]int8)(unsafe.Pointer(ts + 20054 /* "lead" */)) /* sqlite3.c:154381:19 */ +var lagName = *(*[4]int8)(unsafe.Pointer(ts + 20059 /* "lag" */)) /* sqlite3.c:154382:19 */ // No-op implementations of xStep() and xFinalize(). Used as place-holders // for built-in window functions that never call those interfaces. @@ -132194,7 +134526,7 @@ var lagName = *(*[4]int8)(unsafe.Pointer(ts + 19583 /* "lag" */)) // noopStepFunc() is never called, and so it is marked with NO_TEST to // let the test coverage routine know not to expect this function to be // invoked. -func noopStepFunc(tls *libc.TLS, p uintptr, n int32, a uintptr) { /* sqlite3.c:151734:13: */ //NO_TEST +func noopStepFunc(tls *libc.TLS, p uintptr, n int32, a uintptr) { /* sqlite3.c:154393:13: */ //NO_TEST _ = p //NO_TEST _ = n //NO_TEST _ = a //NO_TEST @@ -132202,7 +134534,7 @@ func noopStepFunc(tls *libc.TLS, p uintptr, n int32, a uintptr) { /* sqlite3.c:1 } //NO_TEST -func noopValueFunc(tls *libc.TLS, p uintptr) { /* sqlite3.c:151744:13: */ +func noopValueFunc(tls *libc.TLS, p uintptr) { /* sqlite3.c:154403:13: */ _ = p /*no-op*/ } @@ -132217,7 +134549,7 @@ func noopValueFunc(tls *libc.TLS, p uintptr) { /* sqlite3.c:151744:13: */ // xInverse. // Register those built-in window functions that are not also aggregates. -func Xsqlite3WindowFunctions(tls *libc.TLS) { /* sqlite3.c:151775:21: */ +func Xsqlite3WindowFunctions(tls *libc.TLS) { /* sqlite3.c:154434:21: */ Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aWindowFuncs)), (int32(uint64(unsafe.Sizeof(aWindowFuncs)) / uint64(unsafe.Sizeof(FuncDef{}))))) } @@ -132236,9 +134568,9 @@ var aWindowFuncs = [15]FuncDef{ {FnArg: int8(3), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0}, {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0}, {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0}, - {FnArg: int8(3), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0}} /* sqlite3.c:151776:18 */ + {FnArg: int8(3), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0}} /* sqlite3.c:154435:18 */ -func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uintptr { /* sqlite3.c:151796:15: */ +func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uintptr { /* sqlite3.c:154455:15: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -132249,7 +134581,7 @@ func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uin } } if p == uintptr(0) { - Xsqlite3ErrorMsg(tls, pParse, ts+19587 /* "no such window: ..." */, libc.VaList(bp, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+20063 /* "no such window: ..." */, libc.VaList(bp, zName)) } return p } @@ -132269,7 +134601,7 @@ func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uin // * If the function is a built-in window function that requires the // window to be coerced (see "BUILT-IN WINDOW FUNCTIONS" at the top // of this file), pWin is updated here. -func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uintptr, pFunc uintptr) { /* sqlite3.c:151824:21: */ +func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uintptr, pFunc uintptr) { /* sqlite3.c:154483:21: */ bp := tls.Alloc(192) defer tls.Free(192) @@ -132293,12 +134625,12 @@ func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (((*Window)(unsafe.Pointer(pWin)).FpStart != 0) || ((*Window)(unsafe.Pointer(pWin)).FpEnd != 0))) && (((*Window)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0)) || ((*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != 1)) { Xsqlite3ErrorMsg(tls, pParse, - ts+19606 /* "RANGE with offse..." */, 0) - } else if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_WINDOW) != 0 { + ts+20082 /* "RANGE with offse..." */, 0) + } else if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0 { var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if (*Window)(unsafe.Pointer(pWin)).FpFilter != 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+19677 /* "FILTER clause ma..." */, 0) + ts+20153 /* "FILTER clause ma..." */, 0) } else { *(*[8]WindowUpdate)(unsafe.Pointer(bp /* aUp */)) = [8]WindowUpdate{ {FzFunc: uintptr(unsafe.Pointer(&row_numberName)), FeFrmType: TK_ROWS, FeStart: TK_UNBOUNDED, FeEnd: TK_CURRENT}, @@ -132321,7 +134653,7 @@ func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*Window)(unsafe.Pointer(pWin)).FeEnd = U8((*WindowUpdate)(unsafe.Pointer(bp /* &aUp */ + uintptr(i)*24)).FeEnd) (*Window)(unsafe.Pointer(pWin)).FeExclude = U8(0) if int32((*Window)(unsafe.Pointer(pWin)).FeStart) == TK_FOLLOWING { - (*Window)(unsafe.Pointer(pWin)).FpStart = Xsqlite3Expr(tls, db, TK_INTEGER, ts+6737 /* "1" */) + (*Window)(unsafe.Pointer(pWin)).FpStart = Xsqlite3Expr(tls, db, TK_INTEGER, ts+6782 /* "1" */) } break } @@ -132337,16 +134669,16 @@ type WindowUpdate = struct { FeStart int32 FeEnd int32 _ [4]byte -} /* sqlite3.c:151859:7 */ +} /* sqlite3.c:154518:7 */ // Context object passed through sqlite3WalkExprList() to // selectWindowRewriteExprCb() by selectWindowRewriteEList(). -type WindowRewrite = WindowRewrite1 /* sqlite3.c:151899:30 */ +type WindowRewrite = WindowRewrite1 /* sqlite3.c:154558:30 */ // Callback function used by selectWindowRewriteEList(). If necessary, // this function appends to the output expression-list and updates // expression (*ppExpr) in place. -func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:151913:12: */ +func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:154572:12: */ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse @@ -132362,7 +134694,7 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in var nSrc int32 = (*SrcList)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc var i int32 for i = 0; i < nSrc; i++ { - if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcList_item)(unsafe.Pointer(((*WindowRewrite1)(unsafe.Pointer(p)).FpSrc+8 /* &.a */)+uintptr(i)*112)).FiCursor { + if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer(((*WindowRewrite1)(unsafe.Pointer(p)).FpSrc+8 /* &.a */)+uintptr(i)*112)).FiCursor { break } } @@ -132375,7 +134707,7 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) { case TK_FUNCTION: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { break } else { var pWin uintptr @@ -132405,19 +134737,19 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in if iCol < 0 { var pDup uintptr = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0) if (pDup != 0) && (int32((*Expr)(unsafe.Pointer(pDup)).Fop) == TK_AGG_FUNCTION) { - (*Expr)(unsafe.Pointer(pDup)).Fop = TK_FUNCTION + (*Expr)(unsafe.Pointer(pDup)).Fop = U8(TK_FUNCTION) } (*WindowRewrite1)(unsafe.Pointer(p)).FpSub = Xsqlite3ExprListAppend(tls, pParse, (*WindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) } if (*WindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { - var f int32 = (int32((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_Collate)) + var f int32 = (int32((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_Collate))) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Static) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Static)) Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr) *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Static))) libc.Xmemset(tls, pExpr, 0, uint64(unsafe.Sizeof(Expr{}))) - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN) (*Expr)(unsafe.Pointer(pExpr)).FiColumn = func() int16 { if iCol < 0 { return (int16((*ExprList)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - 1)) @@ -132442,7 +134774,7 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in return WRC_Continue } -func selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:151994:12: */ +func selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:154653:12: */ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pSave uintptr = (*WindowRewrite1)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { @@ -132466,7 +134798,7 @@ func selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr // with a TK_COLUMN that reads the (N-1)th element of table // pWin->iEphCsr, where N is the number of elements in (*ppSub) after // appending the new one. -func selectWindowRewriteEList(tls *libc.TLS, pParse uintptr, pWin uintptr, pSrc uintptr, pEList uintptr, pTab uintptr, ppSub uintptr) { /* sqlite3.c:152021:13: */ +func selectWindowRewriteEList(tls *libc.TLS, pParse uintptr, pWin uintptr, pSrc uintptr, pEList uintptr, pTab uintptr, ppSub uintptr) { /* sqlite3.c:154680:13: */ bp := tls.Alloc(88) defer tls.Free(88) @@ -132498,7 +134830,7 @@ func selectWindowRewriteEList(tls *libc.TLS, pParse uintptr, pWin uintptr, pSrc // Append a copy of each expression in expression-list pAppend to // expression list pList. Return a pointer to the result list. -func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend uintptr, bIntToNull int32) uintptr { /* sqlite3.c:152055:17: */ +func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend uintptr, bIntToNull int32) uintptr { /* sqlite3.c:154714:17: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -132517,11 +134849,11 @@ func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend ui // var iDummy int32 at bp, 4 var pSub uintptr - for pSub = pDup; ((*Expr)(unsafe.Pointer((pSub))).Fflags & (EP_Skip)) != U32(0); pSub = (*Expr)(unsafe.Pointer(pSub)).FpLeft { + for pSub = pDup; ((*Expr)(unsafe.Pointer((pSub))).Fflags & (U32(EP_Skip))) != U32(0); pSub = (*Expr)(unsafe.Pointer(pSub)).FpLeft { } if Xsqlite3ExprIsInteger(tls, pSub, bp /* &iDummy */) != 0 { - (*Expr)(unsafe.Pointer(pSub)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pSub)).Fop = U8(TK_NULL) *(*U32)(unsafe.Pointer(pSub + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(((EP_IntValue | EP_IsTrue) | EP_IsFalse)))) *(*uintptr)(unsafe.Pointer(pSub + 8 /* &.u */)) = uintptr(0) } @@ -132541,7 +134873,7 @@ func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend ui // due to the extra subquery layer that was added. // // See also the incrAggDepth() routine in resolve.c -func sqlite3WindowExtraAggFuncDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:152094:12: */ +func sqlite3WindowExtraAggFuncDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:154753:12: */ if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_FUNCTION) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) >= (*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth) { (*Expr)(unsafe.Pointer(pExpr)).Fop2++ @@ -132554,12 +134886,12 @@ func sqlite3WindowExtraAggFuncDepth(tls *libc.TLS, pWalker uintptr, pExpr uintpt // rewrites the SELECT statement so that window function xStep functions // are invoked in the correct order as described under "SELECT REWRITING" // at the top of this file. -func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:152110:20: */ +func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:154769:20: */ bp := tls.Alloc(56) defer tls.Free(56) var rc int32 = SQLITE_OK - if (((*Select)(unsafe.Pointer(p)).FpWin != 0) && ((*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0))) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_WinRewrite) == U32(0)) { + if (((*Select)(unsafe.Pointer(p)).FpWin != 0) && ((*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0))) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_WinRewrite)) == U32(0)) { var v uintptr = Xsqlite3GetVdbe(tls, pParse) var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pSub uintptr = uintptr(0) // The subquery @@ -132589,7 +134921,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* (*Select)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*Select)(unsafe.Pointer(p)).FpHaving = uintptr(0) *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Aggregate))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_WinRewrite) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_WinRewrite)) // Create the ORDER BY clause for the sub-select. This is the concatenation // of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -132633,7 +134965,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* // results. for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { var pArgs uintptr = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32 /* &.x */)) - if ((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & SQLITE_FUNC_SUBTYPE) != 0 { + if ((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_SUBTYPE)) != 0 { selectWindowRewriteEList(tls, pParse, pMWin, pSrc, pArgs, pTab, bp+48 /* &pSublist */) (*Window)(unsafe.Pointer(pWin)).FiArgCol = func() int32 { if *(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)) != 0 { @@ -132667,7 +134999,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* // keep everything legal in this case. if *(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), - Xsqlite3Expr(tls, db, TK_INTEGER, ts+6319 /* "0" */)) + Xsqlite3Expr(tls, db, TK_INTEGER, ts+6375 /* "0" */)) } pSub = Xsqlite3SelectNew(tls, @@ -132676,11 +135008,11 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* (*Select)(unsafe.Pointer(p)).FpSrc = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) if (*Select)(unsafe.Pointer(p)).FpSrc != 0 { var pTab2 uintptr - (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect = pSub + (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect = pSub Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer(p)).FpSrc) - *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (SF_Expanded) - pTab2 = Xsqlite3ResultSetOfSelect(tls, pParse, pSub, SQLITE_AFF_NONE) - *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (selFlags & SF_Aggregate) + *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (U32(SF_Expanded)) + pTab2 = Xsqlite3ResultSetOfSelect(tls, pParse, pSub, int8(SQLITE_AFF_NONE)) + *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (selFlags & U32(SF_Aggregate)) if pTab2 == uintptr(0) { // Might actually be some other kind of error, but in that case // pParse->nErr will be set, so if SQLITE_NOMEM is set, we will get @@ -132688,8 +135020,8 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* rc = SQLITE_NOMEM } else { libc.Xmemcpy(tls, pTab, pTab2, uint64(unsafe.Sizeof(Table{}))) - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_Ephemeral) - (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab = pTab + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral)) + (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab = pTab pTab = pTab2 libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{}))) (*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { @@ -132723,7 +135055,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* // Unlink the Window object from the Select to which it is attached, // if it is attached. -func Xsqlite3WindowUnlinkFromSelect(tls *libc.TLS, p uintptr) { /* sqlite3.c:152260:21: */ +func Xsqlite3WindowUnlinkFromSelect(tls *libc.TLS, p uintptr) { /* sqlite3.c:154919:21: */ if (*Window)(unsafe.Pointer(p)).FppThis != 0 { *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(p)).FppThis)) = (*Window)(unsafe.Pointer(p)).FpNextWin if (*Window)(unsafe.Pointer(p)).FpNextWin != 0 { @@ -132734,7 +135066,7 @@ func Xsqlite3WindowUnlinkFromSelect(tls *libc.TLS, p uintptr) { /* sqlite3.c:152 } // Free the Window object passed as the second argument. -func Xsqlite3WindowDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:152271:21: */ +func Xsqlite3WindowDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:154930:21: */ if p != 0 { Xsqlite3WindowUnlinkFromSelect(tls, p) Xsqlite3ExprDelete(tls, db, (*Window)(unsafe.Pointer(p)).FpFilter) @@ -132749,7 +135081,7 @@ func Xsqlite3WindowDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:1 } // Free the linked list of Window objects starting at the second argument. -func Xsqlite3WindowListDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:152288:21: */ +func Xsqlite3WindowListDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:154947:21: */ for p != 0 { var pNext uintptr = (*Window)(unsafe.Pointer(p)).FpNextWin Xsqlite3WindowDelete(tls, db, p) @@ -132762,7 +135094,7 @@ func Xsqlite3WindowListDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3 // constant, change it to NULL. The fact that it is then a non-negative // integer will be caught later. But it is important not to leave // variable values in the expression tree. -func sqlite3WindowOffsetExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:152303:13: */ +func sqlite3WindowOffsetExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:154962:13: */ if 0 == Xsqlite3ExprIsConstant(tls, pExpr) { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { Xsqlite3RenameExprUnmap(tls, pParse, pExpr) @@ -132774,7 +135106,7 @@ func sqlite3WindowOffsetExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintp } // Allocate and return a new Window object describing a Window Definition. -func Xsqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int32, pStart uintptr, eEnd int32, pEnd uintptr, eExclude U8) uintptr { /* sqlite3.c:152315:23: */ +func Xsqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int32, pStart uintptr, eEnd int32, pEnd uintptr, eExclude U8) uintptr { /* sqlite3.c:154974:23: */ var pWin uintptr var bImplicitFrame int32 pWin = uintptr(0) @@ -132807,7 +135139,7 @@ __1: ((eStart == TK_FOLLOWING) && ((eEnd == TK_PRECEDING) || (eEnd == TK_CURRENT)))) { goto __2 } - Xsqlite3ErrorMsg(tls, pParse, ts+19740 /* "unsupported fram..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+20216 /* "unsupported fram..." */, 0) goto windowAllocErr __2: ; @@ -132822,10 +135154,10 @@ __3: (*Window)(unsafe.Pointer(pWin)).FeFrmType = U8(eType) (*Window)(unsafe.Pointer(pWin)).FeStart = U8(eStart) (*Window)(unsafe.Pointer(pWin)).FeEnd = U8(eEnd) - if !((int32(eExclude) == 0) && ((int32((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags) & (SQLITE_WindowFunc)) != 0)) { + if !((int32(eExclude) == 0) && (((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags & (U32(SQLITE_WindowFunc))) != U32(0))) { goto __4 } - eExclude = TK_NO + eExclude = U8(TK_NO) __4: ; (*Window)(unsafe.Pointer(pWin)).FeExclude = eExclude @@ -132843,7 +135175,7 @@ windowAllocErr: // Attach PARTITION and ORDER BY clauses pPartition and pOrderBy to window // pWin. Also, if parameter pBase is not NULL, set pWin->zBase to the // equivalent nul-terminated string. -func Xsqlite3WindowAssemble(tls *libc.TLS, pParse uintptr, pWin uintptr, pPartition uintptr, pOrderBy uintptr, pBase uintptr) uintptr { /* sqlite3.c:152387:23: */ +func Xsqlite3WindowAssemble(tls *libc.TLS, pParse uintptr, pWin uintptr, pPartition uintptr, pOrderBy uintptr, pBase uintptr) uintptr { /* sqlite3.c:155046:23: */ if pWin != 0 { (*Window)(unsafe.Pointer(pWin)).FpPartition = pPartition (*Window)(unsafe.Pointer(pWin)).FpOrderBy = pOrderBy @@ -132862,7 +135194,7 @@ func Xsqlite3WindowAssemble(tls *libc.TLS, pParse uintptr, pWin uintptr, pPartit // stored in the linked list starting at pWin->pNextWin. This function // either updates *pWin according to the base specification, or else // leaves an error in pParse. -func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uintptr) { /* sqlite3.c:152414:21: */ +func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uintptr) { /* sqlite3.c:155073:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -132873,15 +135205,15 @@ func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint var zErr uintptr = uintptr(0) // Check for errors if (*Window)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = ts + 19772 /* "PARTITION clause" */ + zErr = ts + 20248 /* "PARTITION clause" */ } else if ((*Window)(unsafe.Pointer(pExist)).FpOrderBy != 0) && ((*Window)(unsafe.Pointer(pWin)).FpOrderBy != 0) { - zErr = ts + 19789 /* "ORDER BY clause" */ + zErr = ts + 20265 /* "ORDER BY clause" */ } else if int32((*Window)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = ts + 19805 /* "frame specificat..." */ + zErr = ts + 20281 /* "frame specificat..." */ } if zErr != 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+19825 /* "cannot override ..." */, libc.VaList(bp, zErr, (*Window)(unsafe.Pointer(pWin)).FzBase)) + ts+20301 /* "cannot override ..." */, libc.VaList(bp, zErr, (*Window)(unsafe.Pointer(pWin)).FzBase)) } else { (*Window)(unsafe.Pointer(pWin)).FpPartition = Xsqlite3ExprListDup(tls, db, (*Window)(unsafe.Pointer(pExist)).FpPartition, 0) if (*Window)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -132896,15 +135228,15 @@ func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint } // Attach window object pWin to expression p. -func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr) { /* sqlite3.c:152448:21: */ +func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr) { /* sqlite3.c:155107:21: */ if p != 0 { *(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) = pWin - *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (EP_WinFunc) + *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (U32(EP_WinFunc)) (*Window)(unsafe.Pointer(pWin)).FpOwner = p - if (((*Expr)(unsafe.Pointer(p)).Fflags & EP_Distinct) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) != TK_FILTER) { + if (((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_Distinct)) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) != TK_FILTER) { Xsqlite3ErrorMsg(tls, pParse, - ts+19858 /* "DISTINCT is not ..." */, 0) + ts+20334 /* "DISTINCT is not ..." */, 0) } } else { Xsqlite3WindowDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -132915,22 +135247,27 @@ func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr // to be processed as part of SELECT statement pSel). The window is linked // in if either (a) there are no other windows already linked to this // SELECT, or (b) the windows already linked use a compatible window frame. -func Xsqlite3WindowLink(tls *libc.TLS, pSel uintptr, pWin uintptr) { /* sqlite3.c:152471:21: */ - if (pSel != uintptr(0)) && - ((uintptr(0) == (*Select)(unsafe.Pointer(pSel)).FpWin) || (0 == Xsqlite3WindowCompare(tls, uintptr(0), (*Select)(unsafe.Pointer(pSel)).FpWin, pWin, 0))) { - (*Window)(unsafe.Pointer(pWin)).FpNextWin = (*Select)(unsafe.Pointer(pSel)).FpWin - if (*Select)(unsafe.Pointer(pSel)).FpWin != 0 { - (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpWin)).FppThis = (pWin + 64 /* &.pNextWin */) +func Xsqlite3WindowLink(tls *libc.TLS, pSel uintptr, pWin uintptr) { /* sqlite3.c:155130:21: */ + if pSel != 0 { + if (uintptr(0) == (*Select)(unsafe.Pointer(pSel)).FpWin) || (0 == Xsqlite3WindowCompare(tls, uintptr(0), (*Select)(unsafe.Pointer(pSel)).FpWin, pWin, 0)) { + (*Window)(unsafe.Pointer(pWin)).FpNextWin = (*Select)(unsafe.Pointer(pSel)).FpWin + if (*Select)(unsafe.Pointer(pSel)).FpWin != 0 { + (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpWin)).FppThis = (pWin + 64 /* &.pNextWin */) + } + (*Select)(unsafe.Pointer(pSel)).FpWin = pWin + (*Window)(unsafe.Pointer(pWin)).FppThis = (pSel + 112 /* &.pWin */) + } else { + if Xsqlite3ExprListCompare(tls, (*Window)(unsafe.Pointer(pWin)).FpPartition, (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpWin)).FpPartition, -1) != 0 { + *(*U32)(unsafe.Pointer(pSel + 4 /* &.selFlags */)) |= (U32(SF_MultiPart)) + } } - (*Select)(unsafe.Pointer(pSel)).FpWin = pWin - (*Window)(unsafe.Pointer(pWin)).FppThis = (pSel + 112 /* &.pWin */) } } // Return 0 if the two window objects are identical, 1 if they are // different, or 2 if it cannot be determined if the objects are identical // or not. Identical window objects can be processed in a single scan. -func Xsqlite3WindowCompare(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr, bFilter int32) int32 { /* sqlite3.c:152489:20: */ +func Xsqlite3WindowCompare(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr, bFilter int32) int32 { /* sqlite3.c:155152:20: */ var res int32 if (p1 == uintptr(0)) || (p2 == uintptr(0)) { return 1 @@ -132970,8 +135307,8 @@ func Xsqlite3WindowCompare(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr // This is called by code in select.c before it calls sqlite3WhereBegin() // to begin iterating through the sub-query results. It is used to allocate // and initialize registers and cursors used by sqlite3WindowCodeStep(). -func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:152518:21: */ - var nEphExpr int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpSrc + 8 /* &.a */))).FpSelect)).FpEList)).FnExpr +func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:155181:21: */ + var nEphExpr int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpSrc + 8 /* &.a */))).FpSelect)).FpEList)).FnExpr var pMWin uintptr = (*Select)(unsafe.Pointer(pSelect)).FpWin var pWin uintptr var v uintptr = Xsqlite3GetVdbe(tls, pParse) @@ -133005,7 +135342,7 @@ func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { var p uintptr = (*Window)(unsafe.Pointer(pWin)).FpFunc - if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { + if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { // The inline versions of min() and max() require a single ephemeral // table and 3 registers. The registers are used as follows: // @@ -133019,7 +135356,7 @@ func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (3) if (pKeyInfo != 0) && (int32(*(*int8)(unsafe.Pointer((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FzName + 1))) == 'i') { - *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = KEYINFO_ORDER_DESC + *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = U8(KEYINFO_ORDER_DESC) } Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Window)(unsafe.Pointer(pWin)).FcsrApp, 2) Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -9) @@ -133043,7 +135380,7 @@ func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* // evaluated and the result left in register reg. This function generates VM // code to check that the value is a non-negative integer and throws an // exception if it is not. -func windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { /* sqlite3.c:152602:13: */ +func windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { /* sqlite3.c:155265:13: */ var v uintptr = Xsqlite3GetVdbe(tls, pParse) var regZero int32 = Xsqlite3GetTempReg(tls, pParse) @@ -133071,17 +135408,17 @@ func windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { / } var azErr = [5]uintptr{ - ts + 19905, /* "frame starting o..." */ - ts + 19958, /* "frame ending off..." */ - ts + 19388, /* "second argument ..." */ - ts + 20009, /* "frame starting o..." */ - ts + 20061, /* "frame ending off..." */ -} /* sqlite3.c:152603:21 */ -var aOp1 = [5]int32{OP_Ge, OP_Ge, OP_Gt, OP_Ge, OP_Ge} /* sqlite3.c:152610:14 */ + ts + 20381, /* "frame starting o..." */ + ts + 20434, /* "frame ending off..." */ + ts + 19864, /* "second argument ..." */ + ts + 20485, /* "frame starting o..." */ + ts + 20537, /* "frame ending off..." */ +} /* sqlite3.c:155266:21 */ +var aOp1 = [5]int32{OP_Ge, OP_Ge, OP_Gt, OP_Ge, OP_Ge} /* sqlite3.c:155273:14 */ // Return the number of arguments passed to the window-function associated // with the object passed as the only argument to this function. -func windowArgCount(tls *libc.TLS, pWin uintptr) int32 { /* sqlite3.c:152648:12: */ +func windowArgCount(tls *libc.TLS, pWin uintptr) int32 { /* sqlite3.c:155311:12: */ var pList uintptr = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32 /* &.x */)) return func() int32 { if pList != 0 { @@ -133102,19 +135439,19 @@ type WindowCodeArg1 = struct { Fstart WindowCsrAndReg Fcurrent WindowCsrAndReg Fend WindowCsrAndReg -} /* sqlite3.c:152653:9 */ +} /* sqlite3.c:155316:9 */ -type WindowCodeArg = WindowCodeArg1 /* sqlite3.c:152653:30 */ +type WindowCodeArg = WindowCodeArg1 /* sqlite3.c:155316:30 */ type WindowCsrAndReg1 = struct { Fcsr int32 Freg int32 -} /* sqlite3.c:152653:9 */ +} /* sqlite3.c:155316:9 */ -type WindowCsrAndReg = WindowCsrAndReg1 /* sqlite3.c:152654:32 */ +type WindowCsrAndReg = WindowCsrAndReg1 /* sqlite3.c:155317:32 */ // Generate VM code to read the window frames peer values from cursor csr into // an array of registers starting at reg. -func windowReadPeerValues(tls *libc.TLS, p uintptr, csr int32, reg int32) { /* sqlite3.c:152737:13: */ +func windowReadPeerValues(tls *libc.TLS, p uintptr, csr int32, reg int32) { /* sqlite3.c:155400:13: */ var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin var pOrderBy uintptr = (*Window)(unsafe.Pointer(pMWin)).FpOrderBy if pOrderBy != 0 { @@ -133150,7 +135487,7 @@ func windowReadPeerValues(tls *libc.TLS, p uintptr, csr int32, reg int32) { /* s // // If argument regPartSize is non-zero, then it is a register containing the // number of rows in the current partition. -func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse int32, reg int32) { /* sqlite3.c:152774:13: */ +func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse int32, reg int32) { /* sqlite3.c:155437:13: */ var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse var v uintptr = Xsqlite3GetVdbe(tls, pParse) var pWin uintptr @@ -133178,7 +135515,7 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse regArg = reg if (((*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0) && - (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0)) && + (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0)) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { var addrIsNull int32 = Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, regArg) @@ -133227,7 +135564,7 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse } } } - if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0 { + if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0 { var pColl uintptr pColl = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32 /* &.x */)) + 8 /* &.a */))).FpExpr) @@ -133258,7 +135595,7 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse // (bFin==1) for each window function in the linked list starting at // pMWin. Or, for built-in window-functions that do not use the standard // API, generate the equivalent VM code. -func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:152888:13: */ +func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:155551:13: */ var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin var v uintptr = Xsqlite3GetVdbe(tls, pParse) @@ -133266,7 +135603,7 @@ func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:152888: for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { if (((*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0) && - (((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0)) && + (((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0)) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregResult) Xsqlite3VdbeAddOp1(tls, v, OP_Last, (*Window)(unsafe.Pointer(pWin)).FcsrApp) @@ -133294,7 +135631,7 @@ func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:152888: // p->pMWin list by doing a full scan of the current window frame. Store the // results in the Window.regResult registers, ready to return the upper // layer. -func windowFullScan(tls *libc.TLS, p uintptr) { /* sqlite3.c:152927:13: */ +func windowFullScan(tls *libc.TLS, p uintptr) { /* sqlite3.c:155590:13: */ var pWin uintptr var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin @@ -133401,7 +135738,7 @@ func windowFullScan(tls *libc.TLS, p uintptr) { /* sqlite3.c:152927:13: */ // first_value() // lag() // lead() -func windowReturnOneRow(tls *libc.TLS, p uintptr) { /* sqlite3.c:153033:13: */ +func windowReturnOneRow(tls *libc.TLS, p uintptr) { /* sqlite3.c:155696:13: */ var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin var v uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpVdbe @@ -133483,7 +135820,7 @@ func windowReturnOneRow(tls *libc.TLS, p uintptr) { /* sqlite3.c:153033:13: */ // in the linked list passed as the second argument to NULL. And perform // any equivalent initialization required by any built-in window functions // in the list. -func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sqlite3.c:153109:12: */ +func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sqlite3.c:155772:12: */ var v uintptr = Xsqlite3GetVdbe(tls, pParse) var regArg int32 var nArg int32 = 0 @@ -133504,7 +135841,7 @@ func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sq Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, ((*Window)(unsafe.Pointer(pWin)).FregApp + 1)) } - if (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0) && ((*Window)(unsafe.Pointer(pWin)).FcsrApp != 0) { + if (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0) && ((*Window)(unsafe.Pointer(pWin)).FcsrApp != 0) { Xsqlite3VdbeAddOp1(tls, v, OP_ResetSorter, (*Window)(unsafe.Pointer(pWin)).FcsrApp) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, ((*Window)(unsafe.Pointer(pWin)).FregApp + 1)) @@ -133518,7 +135855,7 @@ func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sq // Return true if the current frame should be cached in the ephemeral table, // even if there are no xInverse() calls required. -func windowCacheFrame(tls *libc.TLS, pMWin uintptr) int32 { /* sqlite3.c:153141:12: */ +func windowCacheFrame(tls *libc.TLS, pMWin uintptr) int32 { /* sqlite3.c:155804:12: */ var pWin uintptr if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid != 0 { return 1 @@ -133543,7 +135880,7 @@ func windowCacheFrame(tls *libc.TLS, pMWin uintptr) int32 { /* sqlite3.c:153141: // If the two arrays are not equal, the contents of regNew is copied to // regOld and control falls through. Otherwise, if the contents of the arrays // are equal, an OP_Goto is executed. The address of the OP_Goto is returned. -func windowIfNewPeer(tls *libc.TLS, pParse uintptr, pOrderBy uintptr, regNew int32, regOld int32, addr int32) { /* sqlite3.c:153167:13: */ +func windowIfNewPeer(tls *libc.TLS, pParse uintptr, pOrderBy uintptr, regNew int32, regOld int32, addr int32) { /* sqlite3.c:155830:13: */ var v uintptr = Xsqlite3GetVdbe(tls, pParse) if pOrderBy != 0 { var nVal int32 = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr @@ -133580,7 +135917,7 @@ func windowIfNewPeer(tls *libc.TLS, pParse uintptr, pOrderBy uintptr, regNew int // A special type of arithmetic is used such that if csr1.peerVal is not // a numeric type (real or integer), then the result of the addition addition // or subtraction is a a copy of csr1.peerVal. -func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal int32, csr2 int32, lbl int32) { /* sqlite3.c:153213:13: */ +func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal int32, csr2 int32, lbl int32) { /* sqlite3.c:155876:13: */ var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse var v uintptr = Xsqlite3GetVdbe(tls, pParse) var pOrderBy uintptr = (*Window)(unsafe.Pointer((*WindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy // ORDER BY clause for window @@ -133589,6 +135926,7 @@ func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal var regString int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Reg. for constant value '' var arith int32 = OP_Add // OP_Add or OP_Subtract var addrGe int32 // Jump destination + var pColl uintptr if (int32((*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */))).FsortFlags) & KEYINFO_ORDER_DESC) != 0 { switch op { @@ -133684,7 +136022,9 @@ func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal // control skips over this test if the BIGNULL flag is set and either // reg1 or reg2 contain a NULL value. Xsqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NULLEQ) + pColl = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */))).FpExpr) + Xsqlite3VdbeAppendP4(tls, v, pColl, -2) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ)) Xsqlite3ReleaseTempReg(tls, pParse, reg1) Xsqlite3ReleaseTempReg(tls, pParse, reg2) @@ -133695,7 +136035,7 @@ func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal // generates VM code for a single RETURN_ROW, AGGSTEP or AGGINVERSE // operation. Refer to the header comment for sqlite3WindowCodeStep() for // details. -func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOnEof int32) int32 { /* sqlite3.c:153338:12: */ +func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOnEof int32) int32 { /* sqlite3.c:156004:12: */ var csr int32 var reg int32 var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse @@ -133792,7 +136132,7 @@ func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOn if op == (*WindowCodeArg)(unsafe.Pointer(p)).FeDelete { Xsqlite3VdbeAddOp1(tls, v, OP_Delete, csr) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_SAVEPOSITION) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } if jumpOnEof != 0 { @@ -133835,7 +136175,7 @@ func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOn // Allocate and return a duplicate of the Window object indicated by the // third argument. Set the Window.pOwner field of the new object to // pOwner. -func Xsqlite3WindowDup(tls *libc.TLS, db uintptr, pOwner uintptr, p uintptr) uintptr { /* sqlite3.c:153479:23: */ +func Xsqlite3WindowDup(tls *libc.TLS, db uintptr, pOwner uintptr, p uintptr) uintptr { /* sqlite3.c:156145:23: */ var pNew uintptr = uintptr(0) if p != 0 { pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Window{}))) @@ -133866,7 +136206,7 @@ func Xsqlite3WindowDup(tls *libc.TLS, db uintptr, pOwner uintptr, p uintptr) uin // Return a copy of the linked list of Window objects passed as the // second argument. -func Xsqlite3WindowListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:153512:23: */ +func Xsqlite3WindowListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:156178:23: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -133891,14 +136231,14 @@ func Xsqlite3WindowListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sq // // If an OOM error occurs, this function sets the Parse.db.mallocFailed // flag and returns zero. -func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:153534:12: */ +func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:156200:12: */ bp := tls.Alloc(8) defer tls.Free(8) var ret int32 = 0 var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb *(*uintptr)(unsafe.Pointer(bp /* pVal */)) = uintptr(0) - Xsqlite3ValueFromExpr(tls, db, pExpr, (*Sqlite3)(unsafe.Pointer(db)).Fenc, SQLITE_AFF_NUMERIC, bp /* &pVal */) + Xsqlite3ValueFromExpr(tls, db, pExpr, (*Sqlite3)(unsafe.Pointer(db)).Fenc, uint8(SQLITE_AFF_NUMERIC), bp /* &pVal */) if (*(*uintptr)(unsafe.Pointer(bp /* pVal */)) != 0) && (Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) > 0) { ret = 1 } @@ -134239,27 +136579,27 @@ func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* s // // The text above leaves out many details. Refer to the code and comments // below for a more complete picture. -func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uintptr, regGosub int32, addrGosub int32) { /* sqlite3.c:153881:21: */ +func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uintptr, regGosub int32, addrGosub int32) { /* sqlite3.c:156547:21: */ bp := tls.Alloc(64) defer tls.Free(64) var pMWin uintptr = (*Select)(unsafe.Pointer(p)).FpWin var pOrderBy uintptr = (*Window)(unsafe.Pointer(pMWin)).FpOrderBy var v uintptr = Xsqlite3GetVdbe(tls, pParse) - var csrWrite int32 // Cursor used to write to eph. table - var csrInput int32 = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FiCursor // Cursor of sub-select - var nInput int32 = int32((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab)).FnCol) // Number of cols returned by sub - var iInput int32 // To iterate through sub cols - var addrNe int32 // Address of OP_Ne - var addrGosubFlush int32 = 0 // Address of OP_Gosub to flush: - var addrInteger int32 = 0 // Address of OP_Integer - var addrEmpty int32 // Address of OP_Rewind in flush: - var regNew int32 // Array of registers holding new input row - var regRecord int32 // regNew array in record form - var regRowid int32 // Rowid for regRecord in eph table - var regNewPeer int32 = 0 // Peer values for new row (part of regNew) - var regPeer int32 = 0 // Peer values for current row - var regFlushPart int32 = 0 // Register for "Gosub flush_partition" + var csrWrite int32 // Cursor used to write to eph. table + var csrInput int32 = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FiCursor // Cursor of sub-select + var nInput int32 = int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab)).FnCol) // Number of cols returned by sub + var iInput int32 // To iterate through sub cols + var addrNe int32 // Address of OP_Ne + var addrGosubFlush int32 = 0 // Address of OP_Gosub to flush: + var addrInteger int32 = 0 // Address of OP_Integer + var addrEmpty int32 // Address of OP_Rewind in flush: + var regNew int32 // Array of registers holding new input row + var regRecord int32 // regNew array in record form + var regRowid int32 // Rowid for regRecord in eph table + var regNewPeer int32 = 0 // Peer values for new row (part of regNew) + var regPeer int32 = 0 // Peer values for current row + var regFlushPart int32 = 0 // Register for "Gosub flush_partition" // var s WindowCodeArg at bp, 64 // Context object for sub-routines var lblWhereEnd int32 // Label just before sqlite3WhereEnd() code @@ -134583,7 +136923,9 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin //************* End of window.c ********************************************* //************* Begin file parse.c ****************************************** -// 2000-05-29 +// This file is automatically generated by Lemon from input grammar +// source file "parse.y". +// 2001-09-15 // // The author disclaims copyright to this source code. In place of // a legal notice, here is a blessing: @@ -134593,21 +136935,14 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin // May you share freely, never taking more than you give. // // -// Driver template for the LEMON parser generator. +// This file contains SQLite's SQL parser. // -// The "lemon" program processes an LALR(1) input grammar file, then uses -// this template to construct a parser. The "lemon" program inserts text -// at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the -// interstitial "-" characters) contained in this template is changed into -// the value of the %name directive from the grammar. Otherwise, the content -// of this template is copied straight through into the generate parser -// source file. -// -// The following is the concatenation of all %include directives from the -// input grammar file: -// #include -// #include -//*********** Begin %include sections from the grammar *********************** +// The canonical source code to this file ("parse.y") is a Lemon grammar +// file that specifies the input grammar and actions to take while parsing. +// That input file is processed by Lemon to generate a C-language +// implementation of a parser for the given grammer. You might be reading +// this comment as part of the translated C-code. Edits should be made +// to the original parse.y sources. // #include "sqliteInt.h" @@ -134641,17 +136976,17 @@ type TrigEvent = struct { Fa int32 _ [4]byte Fb uintptr -} /* sqlite3.c:154286:1 */ +} /* sqlite3.c:156947:1 */ type FrameBound = struct { FeType int32 _ [4]byte FpExpr uintptr -} /* sqlite3.c:154288:1 */ +} /* sqlite3.c:156949:1 */ // Disable lookaside memory allocation for objects that might be // shared across database connections. -func disableLookaside(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:154294:13: */ +func disableLookaside(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:156955:13: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb (*Parse)(unsafe.Pointer(pParse)).FdisableLookaside++ (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ @@ -134661,43 +136996,60 @@ func disableLookaside(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:154294:13: * // For a compound SELECT statement, make sure p->pPrior->pNext==p for // all elements in the list. And make sure list length does not exceed // SQLITE_LIMIT_COMPOUND_SELECT. -func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:154327:15: */ +func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:156988:15: */ + bp := tls.Alloc(16) + defer tls.Free(16) if (*Select)(unsafe.Pointer(p)).FpPrior != 0 { var pNext uintptr = uintptr(0) - var pLoop uintptr + var pLoop uintptr = p var mxSelect int32 - var cnt int32 = 0 - pLoop = p - __1: - if !(pLoop != 0) { - goto __3 - } - { + var cnt int32 = 1 + for 1 != 0 { (*Select)(unsafe.Pointer(pLoop)).FpNext = pNext - *(*U32)(unsafe.Pointer(pLoop + 4 /* &.selFlags */)) |= (SF_Compound) - + *(*U32)(unsafe.Pointer(pLoop + 4 /* &.selFlags */)) |= (U32(SF_Compound)) + pNext = pLoop + pLoop = (*Select)(unsafe.Pointer(pLoop)).FpPrior + if pLoop == uintptr(0) { + break + } + cnt++ + if ((*Select)(unsafe.Pointer(pLoop)).FpOrderBy != 0) || ((*Select)(unsafe.Pointer(pLoop)).FpLimit != 0) { + Xsqlite3ErrorMsg(tls, pParse, ts+20587, /* "%s clause should..." */ + libc.VaList(bp, func() uintptr { + if (*Select)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { + return ts + 17719 /* "ORDER BY" */ + } + return ts + 20629 /* "LIMIT" */ + }(), + Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(pNext)).Fop)))) + break + } } - goto __2 - __2: - pNext = pLoop - pLoop = (*Select)(unsafe.Pointer(pLoop)).FpPrior - cnt++ - goto __1 - goto __3 - __3: - ; - if ((((*Select)(unsafe.Pointer(p)).FselFlags & SF_MultiValue) == U32(0)) && ((libc.AssignInt32(&mxSelect, *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + 4*4)))) > 0)) && (cnt > mxSelect) { - Xsqlite3ErrorMsg(tls, pParse, ts+20111 /* "too many terms i..." */, 0) + if ((((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_MultiValue)) == U32(0)) && ((libc.AssignInt32(&mxSelect, *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 128 /* &.aLimit */) + 4*4)))) > 0)) && (cnt > mxSelect) { + Xsqlite3ErrorMsg(tls, pParse, ts+20635 /* "too many terms i..." */, 0) } } } +// Attach a With object describing the WITH clause to a Select +// object describing the query for which the WITH clause is a prefix. +func attachWithToSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, pWith uintptr) uintptr { /* sqlite3.c:157019:17: */ + if pSelect != 0 { + (*Select)(unsafe.Pointer(pSelect)).FpWith = pWith + parserDoubleLinkSelect(tls, pParse, pSelect) + } else { + Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pWith) + } + return pSelect + +} + // Construct a new Expr object from a single identifier. Use the // new Expr to populate pOut. Set the span of pOut to be the identifier // that created the expression. -func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sqlite3.c:154350:15: */ +func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sqlite3.c:157034:15: */ bp := tls.Alloc(16) defer tls.Free(16) *(*Token)(unsafe.Pointer(bp)) = t @@ -134707,7 +137059,7 @@ func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sq // memset(p, 0, sizeof(Expr)); (*Expr)(unsafe.Pointer(p)).Fop = U8(op) (*Expr)(unsafe.Pointer(p)).FaffExpr = int8(0) - (*Expr)(unsafe.Pointer(p)).Fflags = EP_Leaf + (*Expr)(unsafe.Pointer(p)).Fflags = U32(EP_Leaf) (*Expr)(unsafe.Pointer(p)).FiAgg = int16(-1) (*Expr)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+24 /* &.pRight */, uintptr(0)) @@ -134734,7 +137086,7 @@ func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sq // A routine to convert a binary TK_IS or TK_ISNOT expression into a // unary TK_ISNULL or TK_NOTNULL expression. -func binaryToUnaryIfNull(tls *libc.TLS, pParse uintptr, pY uintptr, pA uintptr, op int32) { /* sqlite3.c:154385:15: */ +func binaryToUnaryIfNull(tls *libc.TLS, pParse uintptr, pY uintptr, pA uintptr, op int32) { /* sqlite3.c:157069:15: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if (((pA != 0) && (pY != 0)) && (int32((*Expr)(unsafe.Pointer(pY)).Fop) == TK_NULL)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { (*Expr)(unsafe.Pointer(pA)).Fop = U8(op) @@ -134748,14 +137100,14 @@ func binaryToUnaryIfNull(tls *libc.TLS, pParse uintptr, pY uintptr, pA uintptr, // list of identifiers. Report an error if the ID list contains // a COLLATE clause or an ASC or DESC keyword, except ignore the // error while parsing a legacy schema. -func parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pIdToken uintptr, hasCollate int32, sortOrder int32) uintptr { /* sqlite3.c:154399:19: */ +func parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pIdToken uintptr, hasCollate int32, sortOrder int32) uintptr { /* sqlite3.c:157083:19: */ bp := tls.Alloc(16) defer tls.Free(16) var p uintptr = Xsqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if ((hasCollate != 0) || (sortOrder != -1)) && (int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+20145, /* "syntax error aft..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+20669, /* "syntax error aft..." */ libc.VaList(bp, (*Token)(unsafe.Pointer(pIdToken)).Fn, (*Token)(unsafe.Pointer(pIdToken)).Fz)) } Xsqlite3ExprListSetName(tls, pParse, p, pIdToken, 1) @@ -134764,11 +137116,9 @@ func parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pIdT } //*************** End of %include directives ********************************* -// These constants specify the various numeric values for terminal symbols -// in a format understandable to "makeheaders". This section is blank unless -// "lemon" is run with the "-m" command-line option. -// Begin makeheaders token definitions ************************ -//*************** End makeheaders token definitions ************************** +// These constants specify the various numeric values for terminal symbols. +// Begin token definitions ************************************ +//*************** End token definitions ************************************** // The next sections is a series of control #defines. // various aspects of the generated parser. @@ -134825,7 +137175,7 @@ type YYMINORTYPE = struct { _ [0]uint64 Fyyinit int32 _ [12]byte -} /* sqlite3.c:154505:3 */ +} /* sqlite3.c:157372:3 */ //************ End control #defines ****************************************** // Define the yytestcase() macro to be a no-op if is not already defined @@ -134886,580 +137236,594 @@ type YYMINORTYPE = struct { // yy_default[] Default action for each state. // // Begin parsing tables ********************************************* -var yy_action = [1962]uint16{ - /* 0 */ uint16(546), uint16(1222), uint16(546), uint16(451), uint16(1260), uint16(546), uint16(1239), uint16(546), uint16(114), uint16(111), - /* 10 */ uint16(211), uint16(546), uint16(1537), uint16(546), uint16(1260), uint16(523), uint16(114), uint16(111), uint16(211), uint16(392), - /* 20 */ uint16(1232), uint16(344), uint16(42), uint16(42), uint16(42), uint16(42), uint16(1225), uint16(42), uint16(42), uint16(71), - /* 30 */ uint16(71), uint16(937), uint16(1224), uint16(71), uint16(71), uint16(71), uint16(71), uint16(1462), uint16(1493), uint16(938), - /* 40 */ uint16(820), uint16(453), uint16(6), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), - /* 50 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(1543), uint16(392), - /* 60 */ uint16(1358), uint16(1517), uint16(552), uint16(2), uint16(1193), uint16(194), uint16(528), uint16(436), uint16(143), uint16(291), - /* 70 */ uint16(528), uint16(136), uint16(528), uint16(371), uint16(261), uint16(504), uint16(272), uint16(385), uint16(1273), uint16(527), - /* 80 */ uint16(503), uint16(493), uint16(164), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), - /* 90 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(1358), uint16(442), - /* 100 */ uint16(1514), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), - /* 110 */ uint16(115), uint16(424), uint16(266), uint16(266), uint16(266), uint16(266), uint16(1498), uint16(358), uint16(1500), uint16(435), - /* 120 */ uint16(357), uint16(1498), uint16(517), uint16(524), uint16(1485), uint16(543), uint16(1114), uint16(543), uint16(1114), uint16(392), - /* 130 */ uint16(405), uint16(241), uint16(208), uint16(114), uint16(111), uint16(211), uint16(98), uint16(290), uint16(537), uint16(221), - /* 140 */ uint16(1029), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), - /* 150 */ uint16(115), uint16(424), uint16(1142), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), - /* 160 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(406), uint16(428), - /* 170 */ uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(1418), uint16(468), uint16(123), - /* 180 */ uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), - /* 190 */ uint16(424), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(540), uint16(540), uint16(540), uint16(392), - /* 200 */ uint16(505), uint16(120), uint16(120), uint16(120), uint16(120), uint16(113), uint16(1051), uint16(1142), uint16(1143), uint16(1144), - /* 210 */ uint16(1051), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), - /* 220 */ uint16(115), uint16(424), uint16(1461), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), - /* 230 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(392), uint16(444), - /* 240 */ uint16(316), uint16(83), uint16(463), uint16(81), uint16(359), uint16(382), uint16(1142), uint16(80), uint16(118), uint16(118), - /* 250 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(179), - /* 260 */ uint16(434), uint16(424), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), - /* 270 */ uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(434), uint16(433), uint16(266), - /* 280 */ uint16(266), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), - /* 290 */ uint16(115), uint16(424), uint16(543), uint16(1109), uint16(903), uint16(506), uint16(1142), uint16(114), uint16(111), uint16(211), - /* 300 */ uint16(1431), uint16(1142), uint16(1143), uint16(1144), uint16(206), uint16(491), uint16(1109), uint16(392), uint16(449), uint16(1109), - /* 310 */ uint16(545), uint16(330), uint16(120), uint16(120), uint16(120), uint16(120), uint16(298), uint16(1431), uint16(1433), uint16(17), - /* 320 */ uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), - /* 330 */ uint16(424), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), - /* 340 */ uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(392), uint16(1358), uint16(434), uint16(1142), - /* 350 */ uint16(482), uint16(1142), uint16(1143), uint16(1144), uint16(996), uint16(996), uint16(1007), uint16(1010), uint16(445), uint16(118), - /* 360 */ uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), - /* 370 */ uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), - /* 380 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(1054), uint16(1054), uint16(465), uint16(1431), uint16(118), - /* 390 */ uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), - /* 400 */ uint16(1142), uint16(451), uint16(546), uint16(1426), uint16(1142), uint16(1143), uint16(1144), uint16(233), uint16(966), uint16(1142), - /* 410 */ uint16(481), uint16(478), uint16(477), uint16(171), uint16(360), uint16(392), uint16(164), uint16(407), uint16(414), uint16(842), - /* 420 */ uint16(476), uint16(164), uint16(185), uint16(334), uint16(71), uint16(71), uint16(1243), uint16(1000), uint16(118), uint16(118), - /* 430 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(121), - /* 440 */ uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), - /* 450 */ uint16(120), uint16(120), uint16(120), uint16(120), uint16(392), uint16(1142), uint16(1143), uint16(1144), uint16(835), uint16(12), - /* 460 */ uint16(314), uint16(509), uint16(163), uint16(356), uint16(1142), uint16(1143), uint16(1144), uint16(114), uint16(111), uint16(211), - /* 470 */ uint16(508), uint16(290), uint16(537), uint16(546), uint16(276), uint16(180), uint16(290), uint16(537), uint16(121), uint16(122), - /* 480 */ uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), - /* 490 */ uint16(120), uint16(120), uint16(120), uint16(345), uint16(484), uint16(71), uint16(71), uint16(118), uint16(118), uint16(118), - /* 500 */ uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(1142), uint16(209), - /* 510 */ uint16(411), uint16(523), uint16(1142), uint16(1109), uint16(1571), uint16(378), uint16(252), uint16(269), uint16(342), uint16(487), - /* 520 */ uint16(337), uint16(486), uint16(238), uint16(392), uint16(513), uint16(364), uint16(1109), uint16(1127), uint16(333), uint16(1109), - /* 530 */ uint16(191), uint16(409), uint16(286), uint16(32), uint16(457), uint16(443), uint16(118), uint16(118), uint16(118), uint16(118), - /* 540 */ uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(121), uint16(122), uint16(112), - /* 550 */ uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), - /* 560 */ uint16(120), uint16(120), uint16(392), uint16(1142), uint16(1143), uint16(1144), uint16(987), uint16(1142), uint16(1143), uint16(1144), - /* 570 */ uint16(1142), uint16(233), uint16(492), uint16(1492), uint16(481), uint16(478), uint16(477), uint16(6), uint16(163), uint16(546), - /* 580 */ uint16(512), uint16(546), uint16(115), uint16(424), uint16(476), uint16(5), uint16(121), uint16(122), uint16(112), uint16(1165), - /* 590 */ uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), - /* 600 */ uint16(120), uint16(13), uint16(13), uint16(13), uint16(13), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), - /* 610 */ uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(403), uint16(502), uint16(408), uint16(546), - /* 620 */ uint16(1486), uint16(544), uint16(1142), uint16(892), uint16(892), uint16(1142), uint16(1143), uint16(1144), uint16(1473), uint16(1142), - /* 630 */ uint16(275), uint16(392), uint16(808), uint16(809), uint16(810), uint16(971), uint16(422), uint16(422), uint16(422), uint16(16), - /* 640 */ uint16(16), uint16(55), uint16(55), uint16(1242), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), - /* 650 */ uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), - /* 660 */ uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), - /* 670 */ uint16(392), uint16(1189), uint16(1), uint16(1), uint16(552), uint16(2), uint16(1193), uint16(1142), uint16(1143), uint16(1144), - /* 680 */ uint16(194), uint16(291), uint16(898), uint16(136), uint16(1142), uint16(1143), uint16(1144), uint16(897), uint16(521), uint16(1492), - /* 690 */ uint16(1273), uint16(3), uint16(380), uint16(6), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), - /* 700 */ uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(858), - /* 710 */ uint16(546), uint16(924), uint16(546), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), - /* 720 */ uint16(116), uint16(116), uint16(115), uint16(424), uint16(266), uint16(266), uint16(1092), uint16(1569), uint16(1142), uint16(551), - /* 730 */ uint16(1569), uint16(1193), uint16(13), uint16(13), uint16(13), uint16(13), uint16(291), uint16(543), uint16(136), uint16(392), - /* 740 */ uint16(485), uint16(421), uint16(420), uint16(966), uint16(344), uint16(1273), uint16(468), uint16(410), uint16(859), uint16(279), - /* 750 */ uint16(140), uint16(221), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), - /* 760 */ uint16(116), uint16(115), uint16(424), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), - /* 770 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(546), uint16(266), - /* 780 */ uint16(266), uint16(428), uint16(392), uint16(1142), uint16(1143), uint16(1144), uint16(1172), uint16(830), uint16(1172), uint16(468), - /* 790 */ uint16(431), uint16(145), uint16(543), uint16(1146), uint16(401), uint16(314), uint16(439), uint16(302), uint16(838), uint16(1490), - /* 800 */ uint16(71), uint16(71), uint16(412), uint16(6), uint16(1090), uint16(473), uint16(221), uint16(100), uint16(112), uint16(1165), - /* 810 */ uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), - /* 820 */ uint16(120), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), - /* 830 */ uint16(115), uint16(424), uint16(237), uint16(1425), uint16(546), uint16(451), uint16(428), uint16(287), uint16(986), uint16(546), - /* 840 */ uint16(236), uint16(235), uint16(234), uint16(830), uint16(97), uint16(529), uint16(429), uint16(1265), uint16(1265), uint16(1146), - /* 850 */ uint16(494), uint16(307), uint16(430), uint16(838), uint16(977), uint16(546), uint16(71), uint16(71), uint16(976), uint16(1241), - /* 860 */ uint16(546), uint16(51), uint16(51), uint16(300), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), - /* 870 */ uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(194), uint16(103), uint16(70), uint16(70), uint16(266), - /* 880 */ uint16(266), uint16(546), uint16(71), uint16(71), uint16(266), uint16(266), uint16(30), uint16(391), uint16(344), uint16(976), - /* 890 */ uint16(976), uint16(978), uint16(543), uint16(528), uint16(1109), uint16(328), uint16(392), uint16(543), uint16(495), uint16(397), - /* 900 */ uint16(1470), uint16(195), uint16(530), uint16(13), uint16(13), uint16(1358), uint16(240), uint16(1109), uint16(277), uint16(280), - /* 910 */ uint16(1109), uint16(280), uint16(304), uint16(457), uint16(306), uint16(333), uint16(392), uint16(31), uint16(188), uint16(419), - /* 920 */ uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), - /* 930 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(142), uint16(392), uint16(365), uint16(457), uint16(986), - /* 940 */ uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), - /* 950 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(977), uint16(323), uint16(1142), uint16(326), uint16(976), - /* 960 */ uint16(121), uint16(110), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), - /* 970 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(464), uint16(377), uint16(1185), uint16(118), uint16(118), - /* 980 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(1142), - /* 990 */ uint16(976), uint16(976), uint16(978), uint16(305), uint16(9), uint16(366), uint16(244), uint16(362), uint16(118), uint16(118), - /* 1000 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(313), - /* 1010 */ uint16(546), uint16(344), uint16(1142), uint16(1143), uint16(1144), uint16(299), uint16(290), uint16(537), uint16(118), uint16(118), - /* 1020 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(1263), - /* 1030 */ uint16(1263), uint16(1163), uint16(13), uint16(13), uint16(278), uint16(421), uint16(420), uint16(468), uint16(392), uint16(923), - /* 1040 */ uint16(260), uint16(260), uint16(289), uint16(1169), uint16(1142), uint16(1143), uint16(1144), uint16(189), uint16(1171), uint16(266), - /* 1050 */ uint16(266), uint16(468), uint16(390), uint16(543), uint16(1186), uint16(546), uint16(1170), uint16(263), uint16(144), uint16(489), - /* 1060 */ uint16(922), uint16(546), uint16(543), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), - /* 1070 */ uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(71), uint16(71), uint16(1142), - /* 1080 */ uint16(1172), uint16(1272), uint16(1172), uint16(13), uint16(13), uint16(898), uint16(1070), uint16(1163), uint16(546), uint16(468), - /* 1090 */ uint16(897), uint16(107), uint16(538), uint16(1491), uint16(4), uint16(1268), uint16(1109), uint16(6), uint16(525), uint16(1049), - /* 1100 */ uint16(12), uint16(1071), uint16(1092), uint16(1570), uint16(312), uint16(455), uint16(1570), uint16(520), uint16(541), uint16(1109), - /* 1110 */ uint16(56), uint16(56), uint16(1109), uint16(1489), uint16(423), uint16(1358), uint16(1072), uint16(6), uint16(345), uint16(285), - /* 1120 */ uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), - /* 1130 */ uint16(424), uint16(425), uint16(1271), uint16(321), uint16(1142), uint16(1143), uint16(1144), uint16(878), uint16(266), uint16(266), - /* 1140 */ uint16(1277), uint16(107), uint16(538), uint16(535), uint16(4), uint16(1488), uint16(293), uint16(879), uint16(1211), uint16(6), - /* 1150 */ uint16(210), uint16(543), uint16(543), uint16(164), uint16(294), uint16(496), uint16(416), uint16(204), uint16(541), uint16(267), - /* 1160 */ uint16(267), uint16(1214), uint16(398), uint16(511), uint16(499), uint16(204), uint16(266), uint16(266), uint16(396), uint16(531), - /* 1170 */ uint16(8), uint16(986), uint16(543), uint16(519), uint16(546), uint16(922), uint16(458), uint16(105), uint16(105), uint16(543), - /* 1180 */ uint16(1090), uint16(425), uint16(266), uint16(266), uint16(106), uint16(417), uint16(425), uint16(548), uint16(547), uint16(266), - /* 1190 */ uint16(266), uint16(976), uint16(518), uint16(535), uint16(1373), uint16(543), uint16(15), uint16(15), uint16(266), uint16(266), - /* 1200 */ uint16(456), uint16(1120), uint16(543), uint16(266), uint16(266), uint16(1070), uint16(1372), uint16(515), uint16(290), uint16(537), - /* 1210 */ uint16(546), uint16(543), uint16(514), uint16(97), uint16(444), uint16(316), uint16(543), uint16(546), uint16(922), uint16(125), - /* 1220 */ uint16(1071), uint16(986), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(105), uint16(105), uint16(401), - /* 1230 */ uint16(343), uint16(1511), uint16(44), uint16(44), uint16(106), uint16(1072), uint16(425), uint16(548), uint16(547), uint16(57), - /* 1240 */ uint16(57), uint16(976), uint16(343), uint16(1511), uint16(107), uint16(538), uint16(546), uint16(4), uint16(462), uint16(401), - /* 1250 */ uint16(214), uint16(1120), uint16(459), uint16(297), uint16(377), uint16(1091), uint16(534), uint16(1309), uint16(546), uint16(539), - /* 1260 */ uint16(398), uint16(541), uint16(290), uint16(537), uint16(104), uint16(244), uint16(102), uint16(526), uint16(58), uint16(58), - /* 1270 */ uint16(546), uint16(199), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(1516), uint16(1131), uint16(427), - /* 1280 */ uint16(59), uint16(59), uint16(270), uint16(237), uint16(425), uint16(138), uint16(95), uint16(375), uint16(375), uint16(374), - /* 1290 */ uint16(255), uint16(372), uint16(60), uint16(60), uint16(817), uint16(1180), uint16(535), uint16(546), uint16(273), uint16(546), - /* 1300 */ uint16(1163), uint16(1308), uint16(389), uint16(388), uint16(546), uint16(438), uint16(546), uint16(215), uint16(210), uint16(296), - /* 1310 */ uint16(515), uint16(849), uint16(546), uint16(265), uint16(208), uint16(516), uint16(1476), uint16(295), uint16(274), uint16(61), - /* 1320 */ uint16(61), uint16(62), uint16(62), uint16(308), uint16(986), uint16(109), uint16(45), uint16(45), uint16(46), uint16(46), - /* 1330 */ uint16(105), uint16(105), uint16(1186), uint16(922), uint16(47), uint16(47), uint16(341), uint16(106), uint16(546), uint16(425), - /* 1340 */ uint16(548), uint16(547), uint16(1542), uint16(546), uint16(976), uint16(867), uint16(340), uint16(217), uint16(546), uint16(937), - /* 1350 */ uint16(397), uint16(107), uint16(538), uint16(218), uint16(4), uint16(156), uint16(1163), uint16(938), uint16(158), uint16(546), - /* 1360 */ uint16(49), uint16(49), uint16(1162), uint16(546), uint16(268), uint16(50), uint16(50), uint16(546), uint16(541), uint16(1450), - /* 1370 */ uint16(63), uint16(63), uint16(546), uint16(1449), uint16(216), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), - /* 1380 */ uint16(446), uint16(64), uint16(64), uint16(546), uint16(460), uint16(65), uint16(65), uint16(546), uint16(318), uint16(14), - /* 1390 */ uint16(14), uint16(425), uint16(1305), uint16(546), uint16(66), uint16(66), uint16(1087), uint16(546), uint16(141), uint16(379), - /* 1400 */ uint16(38), uint16(546), uint16(963), uint16(535), uint16(322), uint16(127), uint16(127), uint16(546), uint16(393), uint16(67), - /* 1410 */ uint16(67), uint16(546), uint16(325), uint16(290), uint16(537), uint16(52), uint16(52), uint16(515), uint16(546), uint16(68), - /* 1420 */ uint16(68), uint16(845), uint16(514), uint16(69), uint16(69), uint16(399), uint16(165), uint16(857), uint16(856), uint16(53), - /* 1430 */ uint16(53), uint16(986), uint16(311), uint16(151), uint16(151), uint16(97), uint16(432), uint16(105), uint16(105), uint16(327), - /* 1440 */ uint16(152), uint16(152), uint16(526), uint16(1048), uint16(106), uint16(1048), uint16(425), uint16(548), uint16(547), uint16(1131), - /* 1450 */ uint16(427), uint16(976), uint16(1032), uint16(270), uint16(968), uint16(239), uint16(329), uint16(243), uint16(375), uint16(375), - /* 1460 */ uint16(374), uint16(255), uint16(372), uint16(940), uint16(941), uint16(817), uint16(1296), uint16(546), uint16(220), uint16(546), - /* 1470 */ uint16(107), uint16(538), uint16(546), uint16(4), uint16(546), uint16(1256), uint16(199), uint16(845), uint16(215), uint16(1036), - /* 1480 */ uint16(296), uint16(1530), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(541), uint16(295), uint16(76), - /* 1490 */ uint16(76), uint16(54), uint16(54), uint16(980), uint16(72), uint16(72), uint16(128), uint16(128), uint16(864), uint16(865), - /* 1500 */ uint16(107), uint16(538), uint16(546), uint16(4), uint16(1047), uint16(546), uint16(1047), uint16(533), uint16(469), uint16(546), - /* 1510 */ uint16(425), uint16(546), uint16(450), uint16(1240), uint16(546), uint16(243), uint16(546), uint16(541), uint16(217), uint16(546), - /* 1520 */ uint16(452), uint16(197), uint16(535), uint16(243), uint16(73), uint16(73), uint16(156), uint16(129), uint16(129), uint16(158), - /* 1530 */ uint16(336), uint16(130), uint16(130), uint16(126), uint16(126), uint16(1036), uint16(150), uint16(150), uint16(149), uint16(149), - /* 1540 */ uint16(425), uint16(134), uint16(134), uint16(317), uint16(474), uint16(216), uint16(97), uint16(239), uint16(331), uint16(980), - /* 1550 */ uint16(986), uint16(97), uint16(535), uint16(346), uint16(347), uint16(546), uint16(105), uint16(105), uint16(902), uint16(931), - /* 1560 */ uint16(546), uint16(895), uint16(243), uint16(106), uint16(109), uint16(425), uint16(548), uint16(547), uint16(546), uint16(1505), - /* 1570 */ uint16(976), uint16(828), uint16(99), uint16(538), uint16(139), uint16(4), uint16(546), uint16(133), uint16(133), uint16(393), - /* 1580 */ uint16(986), uint16(1317), uint16(131), uint16(131), uint16(290), uint16(537), uint16(105), uint16(105), uint16(1357), uint16(541), - /* 1590 */ uint16(132), uint16(132), uint16(1292), uint16(106), uint16(1303), uint16(425), uint16(548), uint16(547), uint16(75), uint16(75), - /* 1600 */ uint16(976), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(546), uint16(432), uint16(896), uint16(1289), - /* 1610 */ uint16(532), uint16(109), uint16(425), uint16(1363), uint16(546), uint16(1221), uint16(1213), uint16(1202), uint16(258), uint16(546), - /* 1620 */ uint16(349), uint16(546), uint16(1201), uint16(11), uint16(535), uint16(1203), uint16(1524), uint16(351), uint16(77), uint16(77), - /* 1630 */ uint16(376), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(74), uint16(74), uint16(353), uint16(213), - /* 1640 */ uint16(301), uint16(43), uint16(43), uint16(48), uint16(48), uint16(437), uint16(310), uint16(201), uint16(303), uint16(1350), - /* 1650 */ uint16(315), uint16(355), uint16(986), uint16(454), uint16(479), uint16(1239), uint16(339), uint16(192), uint16(105), uint16(105), - /* 1660 */ uint16(1422), uint16(1421), uint16(193), uint16(536), uint16(205), uint16(106), uint16(1527), uint16(425), uint16(548), uint16(547), - /* 1670 */ uint16(1180), uint16(167), uint16(976), uint16(270), uint16(247), uint16(1469), uint16(1467), uint16(1177), uint16(375), uint16(375), - /* 1680 */ uint16(374), uint16(255), uint16(372), uint16(200), uint16(369), uint16(817), uint16(400), uint16(83), uint16(79), uint16(82), - /* 1690 */ uint16(1427), uint16(448), uint16(177), uint16(95), uint16(1342), uint16(161), uint16(169), uint16(1339), uint16(215), uint16(440), - /* 1700 */ uint16(296), uint16(172), uint16(173), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(295), uint16(174), - /* 1710 */ uint16(175), uint16(441), uint16(472), uint16(223), uint16(1347), uint16(383), uint16(35), uint16(381), uint16(36), uint16(461), - /* 1720 */ uint16(88), uint16(1353), uint16(181), uint16(447), uint16(384), uint16(1416), uint16(227), uint16(467), uint16(259), uint16(229), - /* 1730 */ uint16(186), uint16(488), uint16(470), uint16(324), uint16(1250), uint16(230), uint16(231), uint16(320), uint16(217), uint16(1204), - /* 1740 */ uint16(1438), uint16(1259), uint16(386), uint16(1258), uint16(413), uint16(90), uint16(156), uint16(849), uint16(1541), uint16(158), - /* 1750 */ uint16(206), uint16(415), uint16(1540), uint16(507), uint16(1300), uint16(1257), uint16(94), uint16(348), uint16(1229), uint16(1301), - /* 1760 */ uint16(387), uint16(1510), uint16(1228), uint16(338), uint16(1227), uint16(216), uint16(350), uint16(1539), uint16(498), uint16(283), - /* 1770 */ uint16(284), uint16(1249), uint16(501), uint16(1299), uint16(352), uint16(245), uint16(246), uint16(418), uint16(1298), uint16(354), - /* 1780 */ uint16(1496), uint16(1495), uint16(124), uint16(10), uint16(526), uint16(363), uint16(101), uint16(1324), uint16(253), uint16(96), - /* 1790 */ uint16(510), uint16(1210), uint16(34), uint16(549), uint16(1137), uint16(254), uint16(256), uint16(257), uint16(166), uint16(393), - /* 1800 */ uint16(550), uint16(1199), uint16(1282), uint16(361), uint16(290), uint16(537), uint16(1281), uint16(196), uint16(367), uint16(368), - /* 1810 */ uint16(1194), uint16(153), uint16(1454), uint16(137), uint16(281), uint16(1323), uint16(1455), uint16(804), uint16(154), uint16(426), - /* 1820 */ uint16(198), uint16(155), uint16(1453), uint16(1452), uint16(292), uint16(212), uint16(202), uint16(432), uint16(1402), uint16(203), - /* 1830 */ uint16(271), uint16(135), uint16(288), uint16(78), uint16(1046), uint16(1044), uint16(960), uint16(168), uint16(157), uint16(881), - /* 1840 */ uint16(170), uint16(219), uint16(309), uint16(222), uint16(1060), uint16(176), uint16(964), uint16(159), uint16(402), uint16(84), - /* 1850 */ uint16(178), uint16(404), uint16(85), uint16(86), uint16(87), uint16(160), uint16(1063), uint16(224), uint16(394), uint16(395), - /* 1860 */ uint16(225), uint16(1059), uint16(146), uint16(18), uint16(226), uint16(319), uint16(243), uint16(1174), uint16(466), uint16(228), - /* 1870 */ uint16(1052), uint16(182), uint16(183), uint16(37), uint16(819), uint16(471), uint16(340), uint16(232), uint16(332), uint16(483), - /* 1880 */ uint16(184), uint16(89), uint16(162), uint16(19), uint16(20), uint16(475), uint16(91), uint16(480), uint16(847), uint16(335), - /* 1890 */ uint16(147), uint16(860), uint16(282), uint16(92), uint16(490), uint16(93), uint16(1125), uint16(148), uint16(1012), uint16(1095), - /* 1900 */ uint16(39), uint16(497), uint16(1096), uint16(40), uint16(500), uint16(262), uint16(207), uint16(264), uint16(930), uint16(187), - /* 1910 */ uint16(925), uint16(109), uint16(1111), uint16(1115), uint16(1113), uint16(7), uint16(1099), uint16(242), uint16(33), uint16(1119), - /* 1920 */ uint16(21), uint16(522), uint16(22), uint16(23), uint16(24), uint16(1118), uint16(25), uint16(190), uint16(97), uint16(26), - /* 1930 */ uint16(1027), uint16(1013), uint16(1011), uint16(1015), uint16(1069), uint16(1016), uint16(1068), uint16(249), uint16(248), uint16(28), - /* 1940 */ uint16(41), uint16(891), uint16(981), uint16(829), uint16(108), uint16(29), uint16(250), uint16(542), uint16(251), uint16(370), - /* 1950 */ uint16(373), uint16(1133), uint16(1132), uint16(1190), uint16(1190), uint16(1190), uint16(1190), uint16(1190), uint16(1190), uint16(1190), - /* 1960 */ uint16(1532), uint16(1531), -} /* sqlite3.c:154599:27 */ -var yy_lookahead = [2143]uint16{ - /* 0 */ uint16(189), uint16(211), uint16(189), uint16(189), uint16(218), uint16(189), uint16(220), uint16(189), uint16(267), uint16(268), - /* 10 */ uint16(269), uint16(189), uint16(210), uint16(189), uint16(228), uint16(189), uint16(267), uint16(268), uint16(269), uint16(19), - /* 20 */ uint16(218), uint16(189), uint16(211), uint16(212), uint16(211), uint16(212), uint16(211), uint16(211), uint16(212), uint16(211), - /* 30 */ uint16(212), uint16(31), uint16(211), uint16(211), uint16(212), uint16(211), uint16(212), uint16(288), uint16(300), uint16(39), - /* 40 */ uint16(21), uint16(189), uint16(304), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), - /* 50 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(225), uint16(19), - /* 60 */ uint16(189), uint16(183), uint16(184), uint16(185), uint16(186), uint16(189), uint16(248), uint16(263), uint16(236), uint16(191), - /* 70 */ uint16(248), uint16(193), uint16(248), uint16(197), uint16(208), uint16(257), uint16(262), uint16(201), uint16(200), uint16(257), - /* 80 */ uint16(200), uint16(257), uint16(81), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), - /* 90 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(189), uint16(80), - /* 100 */ uint16(189), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), - /* 110 */ uint16(110), uint16(111), uint16(234), uint16(235), uint16(234), uint16(235), uint16(305), uint16(306), uint16(305), uint16(118), - /* 120 */ uint16(307), uint16(305), uint16(306), uint16(297), uint16(298), uint16(247), uint16(86), uint16(247), uint16(88), uint16(19), - /* 130 */ uint16(259), uint16(251), uint16(252), uint16(267), uint16(268), uint16(269), uint16(26), uint16(136), uint16(137), uint16(261), - /* 140 */ uint16(121), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), - /* 150 */ uint16(110), uint16(111), uint16(59), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), - /* 160 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(259), uint16(291), - /* 170 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(158), uint16(189), uint16(69), - /* 180 */ uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), - /* 190 */ uint16(111), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(205), uint16(206), uint16(207), uint16(19), - /* 200 */ uint16(19), uint16(54), uint16(55), uint16(56), uint16(57), uint16(58), uint16(29), uint16(114), uint16(115), uint16(116), - /* 210 */ uint16(33), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), - /* 220 */ uint16(110), uint16(111), uint16(233), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), - /* 230 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(126), - /* 240 */ uint16(127), uint16(148), uint16(65), uint16(24), uint16(214), uint16(200), uint16(59), uint16(67), uint16(101), uint16(102), - /* 250 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(22), - /* 260 */ uint16(189), uint16(111), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), - /* 270 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(206), uint16(207), uint16(234), - /* 280 */ uint16(235), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), - /* 290 */ uint16(110), uint16(111), uint16(247), uint16(76), uint16(107), uint16(114), uint16(59), uint16(267), uint16(268), uint16(269), - /* 300 */ uint16(189), uint16(114), uint16(115), uint16(116), uint16(162), uint16(163), uint16(89), uint16(19), uint16(263), uint16(92), - /* 310 */ uint16(189), uint16(23), uint16(54), uint16(55), uint16(56), uint16(57), uint16(189), uint16(206), uint16(207), uint16(22), - /* 320 */ uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), - /* 330 */ uint16(111), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), - /* 340 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(189), uint16(277), uint16(59), - /* 350 */ uint16(23), uint16(114), uint16(115), uint16(116), uint16(46), uint16(47), uint16(48), uint16(49), uint16(61), uint16(101), - /* 360 */ uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), - /* 370 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), - /* 380 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(125), uint16(126), uint16(127), uint16(277), uint16(101), - /* 390 */ uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), - /* 400 */ uint16(59), uint16(189), uint16(189), uint16(276), uint16(114), uint16(115), uint16(116), uint16(117), uint16(73), uint16(59), - /* 410 */ uint16(120), uint16(121), uint16(122), uint16(72), uint16(214), uint16(19), uint16(81), uint16(259), uint16(19), uint16(23), - /* 420 */ uint16(130), uint16(81), uint16(72), uint16(24), uint16(211), uint16(212), uint16(221), uint16(119), uint16(101), uint16(102), - /* 430 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(43), +var yy_action = [2020]uint16{ + /* 0 */ uint16(563), uint16(1295), uint16(563), uint16(1274), uint16(168), uint16(361), uint16(115), uint16(112), uint16(218), uint16(373), + /* 10 */ uint16(563), uint16(1295), uint16(374), uint16(563), uint16(488), uint16(563), uint16(115), uint16(112), uint16(218), uint16(406), + /* 20 */ uint16(1300), uint16(1300), uint16(41), uint16(41), uint16(41), uint16(41), uint16(514), uint16(1504), uint16(520), uint16(1298), + /* 30 */ uint16(1298), uint16(959), uint16(41), uint16(41), uint16(1257), uint16(71), uint16(71), uint16(51), uint16(51), uint16(960), + /* 40 */ uint16(557), uint16(557), uint16(557), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), + /* 50 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(414), uint16(406), + /* 60 */ uint16(273), uint16(273), uint16(273), uint16(273), uint16(115), uint16(112), uint16(218), uint16(115), uint16(112), uint16(218), + /* 70 */ uint16(197), uint16(268), uint16(545), uint16(560), uint16(515), uint16(560), uint16(1260), uint16(563), uint16(385), uint16(248), + /* 80 */ uint16(215), uint16(521), uint16(399), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), + /* 90 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(540), uint16(13), + /* 100 */ uint16(13), uint16(1259), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), + /* 110 */ uint16(117), uint16(116), uint16(441), uint16(1176), uint16(419), uint16(1531), uint16(446), uint16(137), uint16(512), uint16(1539), + /* 120 */ uint16(1545), uint16(372), uint16(1547), uint16(6), uint16(371), uint16(1176), uint16(1148), uint16(1584), uint16(1148), uint16(406), + /* 130 */ uint16(1545), uint16(534), uint16(115), uint16(112), uint16(218), uint16(1267), uint16(99), uint16(441), uint16(121), uint16(121), + /* 140 */ uint16(121), uint16(121), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), + /* 150 */ uint16(117), uint16(116), uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), + /* 160 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(197), uint16(1176), + /* 170 */ uint16(1177), uint16(1178), uint16(241), uint16(304), uint16(554), uint16(501), uint16(498), uint16(497), uint16(473), uint16(124), + /* 180 */ uint16(394), uint16(1176), uint16(1177), uint16(1178), uint16(1176), uint16(496), uint16(119), uint16(119), uint16(119), uint16(119), + /* 190 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(139), uint16(540), uint16(406), + /* 200 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(114), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), + /* 210 */ uint16(541), uint16(1532), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), + /* 220 */ uint16(117), uint16(116), uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), + /* 230 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(406), uint16(320), + /* 240 */ uint16(1176), uint16(1177), uint16(1178), uint16(81), uint16(342), uint16(1590), uint16(396), uint16(80), uint16(119), uint16(119), + /* 250 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(1176), + /* 260 */ uint16(211), uint16(450), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), + /* 270 */ uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(251), uint16(450), uint16(449), + /* 280 */ uint16(273), uint16(273), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), + /* 290 */ uint16(117), uint16(116), uint16(441), uint16(560), uint16(1224), uint16(1), uint16(1), uint16(569), uint16(2), uint16(1228), + /* 300 */ uint16(317), uint16(1176), uint16(319), uint16(1561), uint16(305), uint16(337), uint16(140), uint16(340), uint16(406), uint16(430), + /* 310 */ uint16(469), uint16(1533), uint16(1197), uint16(1308), uint16(348), uint16(1176), uint16(1177), uint16(1178), uint16(168), uint16(462), + /* 320 */ uint16(330), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), + /* 330 */ uint16(116), uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), + /* 340 */ uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(273), uint16(273), uint16(563), + /* 350 */ uint16(83), uint16(450), uint16(416), uint16(1564), uint16(569), uint16(2), uint16(1228), uint16(1176), uint16(1177), uint16(1178), + /* 360 */ uint16(560), uint16(305), uint16(471), uint16(140), uint16(944), uint16(995), uint16(860), uint16(563), uint16(467), uint16(1197), + /* 370 */ uint16(1308), uint16(13), uint16(13), uint16(137), uint16(229), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), + /* 380 */ uint16(116), uint16(441), uint16(96), uint16(318), uint16(946), uint16(504), uint16(424), uint16(361), uint16(562), uint16(71), + /* 390 */ uint16(71), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), + /* 400 */ uint16(116), uint16(441), uint16(427), uint16(205), uint16(273), uint16(273), uint16(445), uint16(1015), uint16(259), uint16(276), + /* 410 */ uint16(356), uint16(507), uint16(351), uint16(506), uint16(246), uint16(406), uint16(959), uint16(560), uint16(328), uint16(344), + /* 420 */ uint16(347), uint16(315), uint16(860), uint16(1006), uint16(960), uint16(126), uint16(545), uint16(1005), uint16(313), uint16(304), + /* 430 */ uint16(554), uint16(229), uint16(538), uint16(1539), uint16(148), uint16(544), uint16(281), uint16(6), uint16(203), uint16(122), + /* 440 */ uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), + /* 450 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(563), uint16(217), uint16(563), uint16(12), uint16(406), uint16(1005), + /* 460 */ uint16(1005), uint16(1007), uint16(502), uint16(445), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), + /* 470 */ uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(452), uint16(71), uint16(71), uint16(70), uint16(70), + /* 480 */ uint16(944), uint16(137), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), + /* 490 */ uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(1530), uint16(119), uint16(119), + /* 500 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(403), + /* 510 */ uint16(402), uint16(241), uint16(1176), uint16(545), uint16(501), uint16(498), uint16(497), uint16(1468), uint16(1143), uint16(451), + /* 520 */ uint16(267), uint16(267), uint16(513), uint16(1540), uint16(496), uint16(142), uint16(1176), uint16(6), uint16(406), uint16(530), + /* 530 */ uint16(194), uint16(1143), uint16(864), uint16(560), uint16(1143), uint16(461), uint16(182), uint16(304), uint16(554), uint16(32), + /* 540 */ uint16(379), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), + /* 550 */ uint16(116), uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), + /* 560 */ uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(406), uint16(1176), uint16(1177), + /* 570 */ uint16(1178), uint16(857), uint16(568), uint16(1176), uint16(1228), uint16(925), uint16(1176), uint16(454), uint16(361), uint16(305), + /* 580 */ uint16(189), uint16(140), uint16(1176), uint16(1177), uint16(1178), uint16(519), uint16(529), uint16(404), uint16(1308), uint16(183), + /* 590 */ uint16(1015), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), + /* 600 */ uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(1006), uint16(16), uint16(16), uint16(370), + /* 610 */ uint16(1005), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), + /* 620 */ uint16(116), uint16(441), uint16(273), uint16(273), uint16(1537), uint16(150), uint16(1176), uint16(98), uint16(6), uint16(1176), + /* 630 */ uint16(1177), uint16(1178), uint16(1176), uint16(1177), uint16(1178), uint16(560), uint16(380), uint16(406), uint16(376), uint16(438), + /* 640 */ uint16(437), uint16(1161), uint16(1005), uint16(1005), uint16(1007), uint16(1025), uint16(1025), uint16(1036), uint16(1039), uint16(229), + /* 650 */ uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), + /* 660 */ uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), + /* 670 */ uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(406), uint16(1143), uint16(1619), uint16(392), + /* 680 */ uint16(1016), uint16(445), uint16(1176), uint16(1177), uint16(1178), uint16(1207), uint16(525), uint16(1207), uint16(1530), uint16(995), + /* 690 */ uint16(1143), uint16(304), uint16(554), uint16(1143), uint16(5), uint16(563), uint16(543), uint16(3), uint16(361), uint16(216), + /* 700 */ uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), + /* 710 */ uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(143), uint16(563), uint16(13), uint16(13), uint16(1029), + /* 720 */ uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), + /* 730 */ uint16(441), uint16(1176), uint16(426), uint16(563), uint16(1176), uint16(563), uint16(274), uint16(274), uint16(13), uint16(13), + /* 740 */ uint16(1078), uint16(1176), uint16(328), uint16(457), uint16(316), uint16(147), uint16(406), uint16(211), uint16(361), uint16(560), + /* 750 */ uint16(1000), uint16(213), uint16(511), uint16(293), uint16(477), uint16(55), uint16(55), uint16(71), uint16(71), uint16(119), + /* 760 */ uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), + /* 770 */ uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), + /* 780 */ uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(406), uint16(455), uint16(1176), uint16(1177), uint16(1178), + /* 790 */ uint16(1176), uint16(1177), uint16(1178), uint16(471), uint16(526), uint16(149), uint16(404), uint16(1176), uint16(1177), uint16(1178), + /* 800 */ uint16(105), uint16(270), uint16(103), uint16(563), uint16(944), uint16(563), uint16(116), uint16(441), uint16(1530), uint16(122), + /* 810 */ uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), + /* 820 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(945), uint16(13), uint16(13), uint16(13), uint16(13), uint16(119), + /* 830 */ uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), + /* 840 */ uint16(191), uint16(563), uint16(192), uint16(563), uint16(416), uint16(439), uint16(439), uint16(439), uint16(1083), uint16(1083), + /* 850 */ uint16(485), uint16(561), uint16(285), uint16(914), uint16(914), uint16(406), uint16(462), uint16(330), uint16(1530), uint16(830), + /* 860 */ uint16(831), uint16(832), uint16(206), uint16(71), uint16(71), uint16(71), uint16(71), uint16(286), uint16(119), uint16(119), + /* 870 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(122), + /* 880 */ uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), + /* 890 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(563), uint16(217), uint16(563), uint16(1122), uint16(1617), uint16(406), + /* 900 */ uint16(300), uint16(1617), uint16(301), uint16(416), uint16(1278), uint16(1473), uint16(244), uint16(243), uint16(242), uint16(1249), + /* 910 */ uint16(412), uint16(556), uint16(412), uint16(282), uint16(842), uint16(279), uint16(71), uint16(71), uint16(71), uint16(71), + /* 920 */ uint16(944), uint16(1415), uint16(1473), uint16(1475), uint16(101), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), + /* 930 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(119), uint16(119), + /* 940 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(273), + /* 950 */ uint16(273), uint16(1099), uint16(563), uint16(436), uint16(1143), uint16(440), uint16(563), uint16(1122), uint16(1618), uint16(357), + /* 960 */ uint16(1558), uint16(1618), uint16(560), uint16(546), uint16(488), uint16(197), uint16(1100), uint16(1143), uint16(378), uint16(290), + /* 970 */ uint16(1143), uint16(1306), uint16(284), uint16(460), uint16(71), uint16(71), uint16(1120), uint16(405), uint16(13), uint16(13), + /* 980 */ uint16(145), uint16(1101), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), + /* 990 */ uint16(117), uint16(116), uint16(441), uint16(542), uint16(104), uint16(1473), uint16(509), uint16(273), uint16(273), uint16(294), + /* 1000 */ uint16(1514), uint16(294), uint16(900), uint16(273), uint16(273), uint16(273), uint16(273), uint16(563), uint16(1503), uint16(563), + /* 1010 */ uint16(560), uint16(545), uint16(901), uint16(464), uint16(406), uint16(1058), uint16(560), uint16(852), uint16(560), uint16(198), + /* 1020 */ uint16(547), uint16(1080), uint16(920), uint16(404), uint16(1400), uint16(1080), uint16(146), uint16(919), uint16(38), uint16(56), + /* 1030 */ uint16(56), uint16(15), uint16(15), uint16(563), uint16(406), uint16(12), uint16(1120), uint16(471), uint16(122), uint16(123), + /* 1040 */ uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), + /* 1050 */ uint16(121), uint16(121), uint16(121), uint16(1460), uint16(406), uint16(43), uint16(43), uint16(483), uint16(122), uint16(123), + /* 1060 */ uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), + /* 1070 */ uint16(121), uint16(121), uint16(121), uint16(563), uint16(852), uint16(9), uint16(471), uint16(251), uint16(122), uint16(111), + /* 1080 */ uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), + /* 1090 */ uint16(121), uint16(121), uint16(121), uint16(563), uint16(421), uint16(57), uint16(57), uint16(119), uint16(119), uint16(119), + /* 1100 */ uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(1176), uint16(493), + /* 1110 */ uint16(563), uint16(289), uint16(1197), uint16(478), uint16(1516), uint16(44), uint16(44), uint16(119), uint16(119), uint16(119), + /* 1120 */ uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(880), uint16(563), + /* 1130 */ uint16(536), uint16(563), uint16(58), uint16(58), uint16(488), uint16(1414), uint16(245), uint16(119), uint16(119), uint16(119), + /* 1140 */ uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(563), uint16(535), + /* 1150 */ uint16(291), uint16(59), uint16(59), uint16(60), uint16(60), uint16(438), uint16(437), uint16(406), uint16(1154), uint16(505), + /* 1160 */ uint16(304), uint16(554), uint16(477), uint16(1204), uint16(1176), uint16(1177), uint16(1178), uint16(881), uint16(1206), uint16(1197), + /* 1170 */ uint16(61), uint16(61), uint16(1246), uint16(357), uint16(1558), uint16(1538), uint16(1205), uint16(563), uint16(1467), uint16(6), + /* 1180 */ uint16(1176), uint16(488), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), + /* 1190 */ uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(1400), uint16(1143), uint16(410), uint16(62), + /* 1200 */ uint16(62), uint16(1207), uint16(1099), uint16(1207), uint16(411), uint16(447), uint16(273), uint16(273), uint16(537), uint16(1154), + /* 1210 */ uint16(1143), uint16(108), uint16(555), uint16(1143), uint16(4), uint16(391), uint16(1220), uint16(1100), uint16(1512), uint16(560), + /* 1220 */ uint16(347), uint16(516), uint16(428), uint16(548), uint16(308), uint16(1307), uint16(1536), uint16(1077), uint16(558), uint16(1077), + /* 1230 */ uint16(6), uint16(488), uint16(1101), uint16(1400), uint16(488), uint16(309), uint16(1176), uint16(1177), uint16(1178), uint16(563), + /* 1240 */ uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), + /* 1250 */ uint16(441), uint16(442), uint16(278), uint16(551), uint16(563), uint16(273), uint16(273), uint16(273), uint16(273), uint16(563), + /* 1260 */ uint16(327), uint16(45), uint16(45), uint16(552), uint16(563), uint16(528), uint16(422), uint16(563), uint16(560), uint16(1400), + /* 1270 */ uint16(560), uint16(108), uint16(555), uint16(137), uint16(4), uint16(1303), uint16(46), uint16(46), uint16(335), uint16(563), + /* 1280 */ uint16(482), uint16(47), uint16(47), uint16(477), uint16(479), uint16(307), uint16(49), uint16(49), uint16(558), uint16(50), + /* 1290 */ uint16(50), uint16(563), uint16(1015), uint16(563), uint16(1221), uint16(563), uint16(1400), uint16(563), uint16(106), uint16(106), + /* 1300 */ uint16(8), uint16(63), uint16(63), uint16(423), uint16(563), uint16(107), uint16(312), uint16(442), uint16(565), uint16(564), + /* 1310 */ uint16(563), uint16(442), uint16(1005), uint16(64), uint16(64), uint16(65), uint16(65), uint16(14), uint16(14), uint16(66), + /* 1320 */ uint16(66), uint16(391), uint16(1121), uint16(552), uint16(1312), uint16(1180), uint16(128), uint16(128), uint16(563), uint16(304), + /* 1330 */ uint16(554), uint16(563), uint16(67), uint16(67), uint16(563), uint16(359), uint16(560), uint16(532), uint16(563), uint16(484), + /* 1340 */ uint16(563), uint16(1196), uint16(531), uint16(222), uint16(1005), uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(522), + /* 1350 */ uint16(52), uint16(52), uint16(1015), uint16(68), uint16(68), uint16(563), uint16(69), uint16(69), uint16(106), uint16(106), + /* 1360 */ uint16(53), uint16(53), uint16(156), uint16(156), uint16(563), uint16(107), uint16(434), uint16(442), uint16(565), uint16(564), + /* 1370 */ uint16(272), uint16(215), uint16(1005), uint16(425), uint16(563), uint16(359), uint16(563), uint16(157), uint16(157), uint16(563), + /* 1380 */ uint16(1535), uint16(292), uint16(1180), uint16(98), uint16(6), uint16(1344), uint16(76), uint16(76), uint16(1215), uint16(475), + /* 1390 */ uint16(413), uint16(169), uint16(226), uint16(563), uint16(245), uint16(563), uint16(54), uint16(54), uint16(72), uint16(72), + /* 1400 */ uint16(1221), uint16(129), uint16(129), uint16(1343), uint16(1005), uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(1563), + /* 1410 */ uint16(1165), uint16(444), uint16(456), uint16(433), uint16(277), uint16(73), uint16(73), uint16(130), uint16(130), uint16(389), + /* 1420 */ uint16(389), uint16(388), uint16(262), uint16(386), uint16(1165), uint16(444), uint16(839), uint16(1519), uint16(277), uint16(108), + /* 1430 */ uint16(555), uint16(321), uint16(4), uint16(389), uint16(389), uint16(388), uint16(262), uint16(386), uint16(563), uint16(223), + /* 1440 */ uint16(839), uint16(311), uint16(468), uint16(84), uint16(202), uint16(523), uint16(558), uint16(1492), uint16(303), uint16(310), + /* 1450 */ uint16(563), uint16(110), uint16(404), uint16(223), uint16(563), uint16(311), uint16(206), uint16(30), uint16(404), uint16(277), + /* 1460 */ uint16(131), uint16(131), uint16(411), uint16(310), uint16(389), uint16(389), uint16(388), uint16(262), uint16(386), uint16(442), + /* 1470 */ uint16(920), uint16(839), uint16(127), uint16(127), uint16(563), uint16(919), uint16(155), uint16(155), uint16(1491), uint16(225), + /* 1480 */ uint16(563), uint16(552), uint16(871), uint16(563), uint16(223), uint16(476), uint16(311), uint16(161), uint16(31), uint16(563), + /* 1490 */ uint16(135), uint16(563), uint16(480), uint16(225), uint16(310), uint16(532), uint16(154), uint16(154), uint16(332), uint16(17), + /* 1500 */ uint16(533), uint16(161), uint16(136), uint16(136), uint16(135), uint16(134), uint16(134), uint16(224), uint16(228), uint16(355), + /* 1510 */ uint16(1015), uint16(132), uint16(132), uint16(133), uint16(133), uint16(1589), uint16(106), uint16(106), uint16(889), uint16(354), + /* 1520 */ uint16(563), uint16(224), uint16(563), uint16(107), uint16(225), uint16(442), uint16(565), uint16(564), uint16(1117), uint16(275), + /* 1530 */ uint16(1005), uint16(393), uint16(161), uint16(518), uint16(563), uint16(135), uint16(108), uint16(555), uint16(417), uint16(4), + /* 1540 */ uint16(1340), uint16(407), uint16(75), uint16(75), uint16(77), uint16(77), uint16(304), uint16(554), uint16(867), uint16(563), + /* 1550 */ uint16(336), uint16(563), uint16(224), uint16(558), uint16(463), uint16(407), uint16(74), uint16(74), uint16(465), uint16(1065), + /* 1560 */ uint16(304), uint16(554), uint16(1005), uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(962), uint16(963), uint16(543), + /* 1570 */ uint16(448), uint16(42), uint16(42), uint16(48), uint16(48), uint16(326), uint16(442), uint16(325), uint16(98), uint16(997), + /* 1580 */ uint16(470), uint16(287), uint16(250), uint16(250), uint16(448), uint16(1009), uint16(407), uint16(472), uint16(552), uint16(339), + /* 1590 */ uint16(250), uint16(304), uint16(554), uint16(879), uint16(878), uint16(331), uint16(108), uint16(555), uint16(98), uint16(4), + /* 1600 */ uint16(1277), uint16(494), uint16(532), uint16(345), uint16(247), uint16(867), uint16(98), uint16(531), uint16(341), uint16(886), + /* 1610 */ uint16(887), uint16(1126), uint16(1076), uint16(558), uint16(1076), uint16(448), uint16(1065), uint16(1015), uint16(1061), uint16(953), + /* 1620 */ uint16(343), uint16(247), uint16(250), uint16(106), uint16(106), uint16(1291), uint16(917), uint16(1276), uint16(850), uint16(110), + /* 1630 */ uint16(107), uint16(144), uint16(442), uint16(565), uint16(564), uint16(918), uint16(442), uint16(1005), uint16(110), uint16(1275), + /* 1640 */ uint16(350), uint16(360), uint16(1009), uint16(1331), uint16(1352), uint16(299), uint16(1399), uint16(1577), uint16(552), uint16(1327), + /* 1650 */ uint16(1552), uint16(550), uint16(1338), uint16(549), uint16(1405), uint16(1256), uint16(1248), uint16(1237), uint16(1236), uint16(1238), + /* 1660 */ uint16(1571), uint16(489), uint16(265), uint16(200), uint16(1324), uint16(363), uint16(365), uint16(367), uint16(11), uint16(1005), + /* 1670 */ uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(390), uint16(221), uint16(1386), uint16(1015), uint16(280), uint16(1391), + /* 1680 */ uint16(1381), uint16(208), uint16(323), uint16(106), uint16(106), uint16(924), uint16(1374), uint16(453), uint16(283), uint16(324), + /* 1690 */ uint16(107), uint16(474), uint16(442), uint16(565), uint16(564), uint16(1390), uint16(499), uint16(1005), uint16(212), uint16(288), + /* 1700 */ uint16(1274), uint16(397), uint16(353), uint16(108), uint16(555), uint16(195), uint16(4), uint16(1464), uint16(369), uint16(1463), + /* 1710 */ uint16(1574), uint16(1215), uint16(1212), uint16(329), uint16(553), uint16(171), uint16(207), uint16(383), uint16(1511), uint16(196), + /* 1720 */ uint16(558), uint16(254), uint16(1509), uint16(415), uint16(100), uint16(555), uint16(83), uint16(4), uint16(204), uint16(1005), + /* 1730 */ uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(219), uint16(79), uint16(82), uint16(1469), uint16(180), uint16(166), + /* 1740 */ uint16(173), uint16(558), uint16(458), uint16(442), uint16(175), uint16(176), uint16(177), uint16(178), uint16(35), uint16(1387), + /* 1750 */ uint16(492), uint16(459), uint16(231), uint16(1395), uint16(96), uint16(552), uint16(1393), uint16(1392), uint16(395), uint16(184), + /* 1760 */ uint16(481), uint16(466), uint16(36), uint16(235), uint16(442), uint16(89), uint16(398), uint16(266), uint16(487), uint16(1480), + /* 1770 */ uint16(1458), uint16(237), uint16(188), uint16(338), uint16(508), uint16(429), uint16(552), uint16(490), uint16(400), uint16(238), + /* 1780 */ uint16(334), uint16(1239), uint16(239), uint16(1294), uint16(1015), uint16(1293), uint16(1292), uint16(1285), uint16(91), uint16(871), + /* 1790 */ uint16(106), uint16(106), uint16(213), uint16(431), uint16(1588), uint16(432), uint16(524), uint16(107), uint16(517), uint16(442), + /* 1800 */ uint16(565), uint16(564), uint16(401), uint16(1264), uint16(1005), uint16(1015), uint16(1263), uint16(1587), uint16(352), uint16(1262), + /* 1810 */ uint16(1557), uint16(106), uint16(106), uint16(1586), uint16(1284), uint16(297), uint16(298), uint16(358), uint16(107), uint16(1335), + /* 1820 */ uint16(442), uint16(565), uint16(564), uint16(95), uint16(362), uint16(1005), uint16(253), uint16(252), uint16(435), uint16(125), + /* 1830 */ uint16(543), uint16(10), uint16(1444), uint16(1543), uint16(377), uint16(1542), uint16(1005), uint16(1005), uint16(1007), uint16(1008), + /* 1840 */ uint16(27), uint16(302), uint16(102), uint16(97), uint16(527), uint16(1336), uint16(260), uint16(1317), uint16(364), uint16(1245), + /* 1850 */ uint16(1334), uint16(34), uint16(566), uint16(1171), uint16(366), uint16(381), uint16(375), uint16(1005), uint16(1005), uint16(1007), + /* 1860 */ uint16(1008), uint16(27), uint16(1333), uint16(1359), uint16(368), uint16(1316), uint16(199), uint16(382), uint16(261), uint16(263), + /* 1870 */ uint16(264), uint16(1358), uint16(158), uint16(1496), uint16(141), uint16(1497), uint16(1495), uint16(567), uint16(1234), uint16(1229), + /* 1880 */ uint16(1494), uint16(295), uint16(159), uint16(209), uint16(210), uint16(78), uint16(826), uint16(443), uint16(201), uint16(306), + /* 1890 */ uint16(220), uint16(1075), uint16(138), uint16(1073), uint16(160), uint16(314), uint16(162), uint16(172), uint16(1196), uint16(174), + /* 1900 */ uint16(903), uint16(227), uint16(230), uint16(322), uint16(1089), uint16(179), uint16(163), uint16(164), uint16(418), uint16(85), + /* 1910 */ uint16(420), uint16(181), uint16(170), uint16(408), uint16(409), uint16(86), uint16(87), uint16(165), uint16(88), uint16(1092), + /* 1920 */ uint16(232), uint16(233), uint16(1088), uint16(151), uint16(18), uint16(234), uint16(1081), uint16(250), uint16(333), uint16(185), + /* 1930 */ uint16(1209), uint16(486), uint16(236), uint16(186), uint16(37), uint16(841), uint16(491), uint16(354), uint16(240), uint16(346), + /* 1940 */ uint16(503), uint16(187), uint16(90), uint16(167), uint16(19), uint16(495), uint16(20), uint16(869), uint16(500), uint16(349), + /* 1950 */ uint16(92), uint16(882), uint16(296), uint16(152), uint16(93), uint16(510), uint16(1127), uint16(1159), uint16(153), uint16(1041), + /* 1960 */ uint16(214), uint16(1128), uint16(39), uint16(94), uint16(269), uint16(271), uint16(952), uint16(190), uint16(947), uint16(110), + /* 1970 */ uint16(1149), uint16(1145), uint16(1153), uint16(249), uint16(1133), uint16(1147), uint16(7), uint16(33), uint16(21), uint16(193), + /* 1980 */ uint16(22), uint16(23), uint16(24), uint16(25), uint16(1152), uint16(539), uint16(98), uint16(1056), uint16(26), uint16(1042), + /* 1990 */ uint16(1040), uint16(1044), uint16(1098), uint16(1045), uint16(1097), uint16(256), uint16(255), uint16(28), uint16(40), uint16(387), + /* 2000 */ uint16(1010), uint16(851), uint16(109), uint16(29), uint16(1167), uint16(559), uint16(384), uint16(257), uint16(913), uint16(258), + /* 2010 */ uint16(1166), uint16(1579), uint16(1225), uint16(1225), uint16(1225), uint16(1225), uint16(1225), uint16(1225), uint16(1225), uint16(1578), +} /* sqlite3.c:157466:27 */ +var yy_lookahead = [2203]uint16{ + /* 0 */ uint16(191), uint16(220), uint16(191), uint16(222), uint16(191), uint16(191), uint16(271), uint16(272), uint16(273), uint16(216), + /* 10 */ uint16(191), uint16(230), uint16(216), uint16(191), uint16(191), uint16(191), uint16(271), uint16(272), uint16(273), uint16(19), + /* 20 */ uint16(232), uint16(233), uint16(213), uint16(214), uint16(213), uint16(214), uint16(202), uint16(292), uint16(202), uint16(232), + /* 30 */ uint16(233), uint16(31), uint16(213), uint16(214), uint16(213), uint16(213), uint16(214), uint16(213), uint16(214), uint16(39), + /* 40 */ uint16(207), uint16(208), uint16(209), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), + /* 50 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(235), uint16(19), + /* 60 */ uint16(236), uint16(237), uint16(236), uint16(237), uint16(271), uint16(272), uint16(273), uint16(271), uint16(272), uint16(273), + /* 70 */ uint16(191), uint16(210), uint16(250), uint16(249), uint16(250), uint16(249), uint16(213), uint16(191), uint16(199), uint16(253), + /* 80 */ uint16(254), uint16(259), uint16(203), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), + /* 90 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(191), uint16(213), + /* 100 */ uint16(214), uint16(213), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), + /* 110 */ uint16(110), uint16(111), uint16(112), uint16(59), uint16(228), uint16(301), uint16(293), uint16(81), uint16(305), uint16(306), + /* 120 */ uint16(311), uint16(312), uint16(311), uint16(310), uint16(313), uint16(59), uint16(86), uint16(212), uint16(88), uint16(19), + /* 130 */ uint16(311), uint16(312), uint16(271), uint16(272), uint16(273), uint16(220), uint16(26), uint16(112), uint16(54), uint16(55), + /* 140 */ uint16(56), uint16(57), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), + /* 150 */ uint16(110), uint16(111), uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), + /* 160 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(191), uint16(115), + /* 170 */ uint16(116), uint16(117), uint16(118), uint16(137), uint16(138), uint16(121), uint16(122), uint16(123), uint16(191), uint16(69), + /* 180 */ uint16(203), uint16(115), uint16(116), uint16(117), uint16(59), uint16(131), uint16(102), uint16(103), uint16(104), uint16(105), + /* 190 */ uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(72), uint16(191), uint16(19), + /* 200 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(58), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), + /* 210 */ uint16(303), uint16(304), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), + /* 220 */ uint16(110), uint16(111), uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), + /* 230 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(16), + /* 240 */ uint16(115), uint16(116), uint16(117), uint16(24), uint16(16), uint16(227), uint16(202), uint16(67), uint16(102), uint16(103), + /* 250 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(59), + /* 260 */ uint16(26), uint16(191), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), + /* 270 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(24), uint16(208), uint16(209), + /* 280 */ uint16(236), uint16(237), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), + /* 290 */ uint16(110), uint16(111), uint16(112), uint16(249), uint16(183), uint16(184), uint16(185), uint16(186), uint16(187), uint16(188), + /* 300 */ uint16(77), uint16(59), uint16(79), uint16(191), uint16(193), uint16(77), uint16(195), uint16(79), uint16(19), uint16(19), + /* 310 */ uint16(266), uint16(304), uint16(59), uint16(202), uint16(24), uint16(115), uint16(116), uint16(117), uint16(191), uint16(127), + /* 320 */ uint16(128), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), + /* 330 */ uint16(111), uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), + /* 340 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(236), uint16(237), uint16(191), + /* 350 */ uint16(150), uint16(281), uint16(191), uint16(185), uint16(186), uint16(187), uint16(188), uint16(115), uint16(116), uint16(117), + /* 360 */ uint16(249), uint16(193), uint16(191), uint16(195), uint16(26), uint16(73), uint16(59), uint16(191), uint16(114), uint16(116), + /* 370 */ uint16(202), uint16(213), uint16(214), uint16(81), uint16(263), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), + /* 380 */ uint16(111), uint16(112), uint16(148), uint16(160), uint16(142), uint16(95), uint16(228), uint16(191), uint16(191), uint16(213), + /* 390 */ uint16(214), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), + /* 400 */ uint16(111), uint16(112), uint16(112), uint16(149), uint16(236), uint16(237), uint16(295), uint16(100), uint16(118), uint16(119), + /* 410 */ uint16(120), uint16(121), uint16(122), uint16(123), uint16(124), uint16(19), uint16(31), uint16(249), uint16(126), uint16(23), + /* 420 */ uint16(130), uint16(260), uint16(115), uint16(116), uint16(39), uint16(22), uint16(250), uint16(120), uint16(191), uint16(137), + /* 430 */ uint16(138), uint16(263), uint16(305), uint16(306), uint16(238), uint16(259), uint16(265), uint16(310), uint16(149), uint16(43), /* 440 */ uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), - /* 450 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(114), uint16(115), uint16(116), uint16(23), uint16(208), - /* 460 */ uint16(125), uint16(248), uint16(189), uint16(189), uint16(114), uint16(115), uint16(116), uint16(267), uint16(268), uint16(269), - /* 470 */ uint16(189), uint16(136), uint16(137), uint16(189), uint16(262), uint16(22), uint16(136), uint16(137), uint16(43), uint16(44), - /* 480 */ uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), - /* 490 */ uint16(55), uint16(56), uint16(57), uint16(189), uint16(95), uint16(211), uint16(212), uint16(101), uint16(102), uint16(103), - /* 500 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(59), uint16(189), - /* 510 */ uint16(111), uint16(189), uint16(59), uint16(76), uint16(294), uint16(295), uint16(117), uint16(118), uint16(119), uint16(120), - /* 520 */ uint16(121), uint16(122), uint16(123), uint16(19), uint16(87), uint16(189), uint16(89), uint16(23), uint16(129), uint16(92), - /* 530 */ uint16(279), uint16(227), uint16(248), uint16(22), uint16(189), uint16(284), uint16(101), uint16(102), uint16(103), uint16(104), - /* 540 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(43), uint16(44), uint16(45), - /* 550 */ uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), - /* 560 */ uint16(56), uint16(57), uint16(19), uint16(114), uint16(115), uint16(116), uint16(23), uint16(114), uint16(115), uint16(116), - /* 570 */ uint16(59), uint16(117), uint16(299), uint16(300), uint16(120), uint16(121), uint16(122), uint16(304), uint16(189), uint16(189), - /* 580 */ uint16(143), uint16(189), uint16(110), uint16(111), uint16(130), uint16(22), uint16(43), uint16(44), uint16(45), uint16(46), - /* 590 */ uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), - /* 600 */ uint16(57), uint16(211), uint16(212), uint16(211), uint16(212), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), - /* 610 */ uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(226), uint16(189), uint16(226), uint16(189), - /* 620 */ uint16(298), uint16(132), uint16(59), uint16(134), uint16(135), uint16(114), uint16(115), uint16(116), uint16(189), uint16(59), - /* 630 */ uint16(285), uint16(19), uint16(7), uint16(8), uint16(9), uint16(23), uint16(205), uint16(206), uint16(207), uint16(211), - /* 640 */ uint16(212), uint16(211), uint16(212), uint16(221), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), - /* 650 */ uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), - /* 660 */ uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), - /* 670 */ uint16(19), uint16(181), uint16(182), uint16(183), uint16(184), uint16(185), uint16(186), uint16(114), uint16(115), uint16(116), - /* 680 */ uint16(189), uint16(191), uint16(133), uint16(193), uint16(114), uint16(115), uint16(116), uint16(138), uint16(299), uint16(300), - /* 690 */ uint16(200), uint16(22), uint16(201), uint16(304), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), - /* 700 */ uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(35), - /* 710 */ uint16(189), uint16(141), uint16(189), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), - /* 720 */ uint16(108), uint16(109), uint16(110), uint16(111), uint16(234), uint16(235), uint16(22), uint16(23), uint16(59), uint16(184), - /* 730 */ uint16(26), uint16(186), uint16(211), uint16(212), uint16(211), uint16(212), uint16(191), uint16(247), uint16(193), uint16(19), - /* 740 */ uint16(66), uint16(105), uint16(106), uint16(73), uint16(189), uint16(200), uint16(189), uint16(226), uint16(74), uint16(226), - /* 750 */ uint16(22), uint16(261), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), - /* 760 */ uint16(109), uint16(110), uint16(111), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), - /* 770 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(189), uint16(234), - /* 780 */ uint16(235), uint16(291), uint16(19), uint16(114), uint16(115), uint16(116), uint16(150), uint16(59), uint16(152), uint16(189), - /* 790 */ uint16(233), uint16(236), uint16(247), uint16(59), uint16(189), uint16(125), uint16(126), uint16(127), uint16(59), uint16(300), - /* 800 */ uint16(211), uint16(212), uint16(128), uint16(304), uint16(100), uint16(19), uint16(261), uint16(156), uint16(45), uint16(46), - /* 810 */ uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), - /* 820 */ uint16(57), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), - /* 830 */ uint16(110), uint16(111), uint16(46), uint16(233), uint16(189), uint16(189), uint16(291), uint16(248), uint16(99), uint16(189), - /* 840 */ uint16(125), uint16(126), uint16(127), uint16(115), uint16(26), uint16(200), uint16(289), uint16(230), uint16(231), uint16(115), - /* 850 */ uint16(200), uint16(16), uint16(189), uint16(114), uint16(115), uint16(189), uint16(211), uint16(212), uint16(119), uint16(221), - /* 860 */ uint16(189), uint16(211), uint16(212), uint16(258), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), - /* 870 */ uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(189), uint16(156), uint16(211), uint16(212), uint16(234), - /* 880 */ uint16(235), uint16(189), uint16(211), uint16(212), uint16(234), uint16(235), uint16(22), uint16(201), uint16(189), uint16(150), - /* 890 */ uint16(151), uint16(152), uint16(247), uint16(248), uint16(76), uint16(16), uint16(19), uint16(247), uint16(248), uint16(113), - /* 900 */ uint16(189), uint16(24), uint16(257), uint16(211), uint16(212), uint16(189), uint16(26), uint16(89), uint16(262), uint16(223), - /* 910 */ uint16(92), uint16(225), uint16(77), uint16(189), uint16(79), uint16(129), uint16(19), uint16(53), uint16(226), uint16(248), - /* 920 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), - /* 930 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(236), uint16(19), uint16(271), uint16(189), uint16(99), - /* 940 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), - /* 950 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(115), uint16(77), uint16(59), uint16(79), uint16(119), - /* 960 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), - /* 970 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(259), uint16(22), uint16(23), uint16(101), uint16(102), - /* 980 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(59), - /* 990 */ uint16(150), uint16(151), uint16(152), uint16(158), uint16(22), uint16(244), uint16(24), uint16(246), uint16(101), uint16(102), - /* 1000 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(285), - /* 1010 */ uint16(189), uint16(189), uint16(114), uint16(115), uint16(116), uint16(200), uint16(136), uint16(137), uint16(101), uint16(102), - /* 1020 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(230), - /* 1030 */ uint16(231), uint16(59), uint16(211), uint16(212), uint16(285), uint16(105), uint16(106), uint16(189), uint16(19), uint16(141), - /* 1040 */ uint16(234), uint16(235), uint16(239), uint16(113), uint16(114), uint16(115), uint16(116), uint16(226), uint16(118), uint16(234), - /* 1050 */ uint16(235), uint16(189), uint16(249), uint16(247), uint16(100), uint16(189), uint16(126), uint16(23), uint16(236), uint16(107), - /* 1060 */ uint16(26), uint16(189), uint16(247), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), - /* 1070 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(211), uint16(212), uint16(59), - /* 1080 */ uint16(150), uint16(233), uint16(152), uint16(211), uint16(212), uint16(133), uint16(12), uint16(115), uint16(189), uint16(189), - /* 1090 */ uint16(138), uint16(19), uint16(20), uint16(300), uint16(22), uint16(233), uint16(76), uint16(304), uint16(226), uint16(11), - /* 1100 */ uint16(208), uint16(27), uint16(22), uint16(23), uint16(200), uint16(19), uint16(26), uint16(87), uint16(36), uint16(89), - /* 1110 */ uint16(211), uint16(212), uint16(92), uint16(300), uint16(248), uint16(189), uint16(42), uint16(304), uint16(189), uint16(250), - /* 1120 */ uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), - /* 1130 */ uint16(111), uint16(59), uint16(200), uint16(233), uint16(114), uint16(115), uint16(116), uint16(63), uint16(234), uint16(235), - /* 1140 */ uint16(235), uint16(19), uint16(20), uint16(71), uint16(22), uint16(300), uint16(189), uint16(73), uint16(200), uint16(304), - /* 1150 */ uint16(116), uint16(247), uint16(247), uint16(81), uint16(189), uint16(200), uint16(227), uint16(26), uint16(36), uint16(234), - /* 1160 */ uint16(235), uint16(203), uint16(204), uint16(143), uint16(200), uint16(26), uint16(234), uint16(235), uint16(194), uint16(200), - /* 1170 */ uint16(48), uint16(99), uint16(247), uint16(66), uint16(189), uint16(141), uint16(284), uint16(105), uint16(106), uint16(247), - /* 1180 */ uint16(100), uint16(59), uint16(234), uint16(235), uint16(112), uint16(259), uint16(114), uint16(115), uint16(116), uint16(234), - /* 1190 */ uint16(235), uint16(119), uint16(85), uint16(71), uint16(266), uint16(247), uint16(211), uint16(212), uint16(234), uint16(235), - /* 1200 */ uint16(114), uint16(94), uint16(247), uint16(234), uint16(235), uint16(12), uint16(266), uint16(85), uint16(136), uint16(137), - /* 1210 */ uint16(189), uint16(247), uint16(90), uint16(26), uint16(126), uint16(127), uint16(247), uint16(189), uint16(26), uint16(22), - /* 1220 */ uint16(27), uint16(99), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(105), uint16(106), uint16(189), - /* 1230 */ uint16(302), uint16(303), uint16(211), uint16(212), uint16(112), uint16(42), uint16(114), uint16(115), uint16(116), uint16(211), - /* 1240 */ uint16(212), uint16(119), uint16(302), uint16(303), uint16(19), uint16(20), uint16(189), uint16(22), uint16(274), uint16(189), - /* 1250 */ uint16(15), uint16(144), uint16(278), uint16(189), uint16(22), uint16(23), uint16(63), uint16(189), uint16(189), uint16(203), - /* 1260 */ uint16(204), uint16(36), uint16(136), uint16(137), uint16(155), uint16(24), uint16(157), uint16(143), uint16(211), uint16(212), - /* 1270 */ uint16(189), uint16(140), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(0), uint16(1), uint16(2), - /* 1280 */ uint16(211), uint16(212), uint16(5), uint16(46), uint16(59), uint16(161), uint16(147), uint16(10), uint16(11), uint16(12), - /* 1290 */ uint16(13), uint16(14), uint16(211), uint16(212), uint16(17), uint16(60), uint16(71), uint16(189), uint16(258), uint16(189), - /* 1300 */ uint16(59), uint16(189), uint16(105), uint16(106), uint16(189), uint16(189), uint16(189), uint16(30), uint16(116), uint16(32), - /* 1310 */ uint16(85), uint16(124), uint16(189), uint16(251), uint16(252), uint16(90), uint16(189), uint16(40), uint16(258), uint16(211), - /* 1320 */ uint16(212), uint16(211), uint16(212), uint16(189), uint16(99), uint16(26), uint16(211), uint16(212), uint16(211), uint16(212), - /* 1330 */ uint16(105), uint16(106), uint16(100), uint16(141), uint16(211), uint16(212), uint16(119), uint16(112), uint16(189), uint16(114), - /* 1340 */ uint16(115), uint16(116), uint16(23), uint16(189), uint16(119), uint16(26), uint16(129), uint16(70), uint16(189), uint16(31), - /* 1350 */ uint16(113), uint16(19), uint16(20), uint16(24), uint16(22), uint16(78), uint16(115), uint16(39), uint16(81), uint16(189), - /* 1360 */ uint16(211), uint16(212), uint16(26), uint16(189), uint16(22), uint16(211), uint16(212), uint16(189), uint16(36), uint16(189), - /* 1370 */ uint16(211), uint16(212), uint16(189), uint16(189), uint16(97), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), - /* 1380 */ uint16(127), uint16(211), uint16(212), uint16(189), uint16(189), uint16(211), uint16(212), uint16(189), uint16(189), uint16(211), - /* 1390 */ uint16(212), uint16(59), uint16(189), uint16(189), uint16(211), uint16(212), uint16(23), uint16(189), uint16(22), uint16(26), - /* 1400 */ uint16(24), uint16(189), uint16(149), uint16(71), uint16(189), uint16(211), uint16(212), uint16(189), uint16(131), uint16(211), - /* 1410 */ uint16(212), uint16(189), uint16(189), uint16(136), uint16(137), uint16(211), uint16(212), uint16(85), uint16(189), uint16(211), - /* 1420 */ uint16(212), uint16(59), uint16(90), uint16(211), uint16(212), uint16(292), uint16(293), uint16(118), uint16(119), uint16(211), - /* 1430 */ uint16(212), uint16(99), uint16(23), uint16(211), uint16(212), uint16(26), uint16(159), uint16(105), uint16(106), uint16(189), - /* 1440 */ uint16(211), uint16(212), uint16(143), uint16(150), uint16(112), uint16(152), uint16(114), uint16(115), uint16(116), uint16(1), - /* 1450 */ uint16(2), uint16(119), uint16(23), uint16(5), uint16(23), uint16(26), uint16(189), uint16(26), uint16(10), uint16(11), - /* 1460 */ uint16(12), uint16(13), uint16(14), uint16(83), uint16(84), uint16(17), uint16(253), uint16(189), uint16(139), uint16(189), - /* 1470 */ uint16(19), uint16(20), uint16(189), uint16(22), uint16(189), uint16(189), uint16(140), uint16(115), uint16(30), uint16(59), - /* 1480 */ uint16(32), uint16(139), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(36), uint16(40), uint16(211), - /* 1490 */ uint16(212), uint16(211), uint16(212), uint16(59), uint16(211), uint16(212), uint16(211), uint16(212), uint16(7), uint16(8), - /* 1500 */ uint16(19), uint16(20), uint16(189), uint16(22), uint16(150), uint16(189), uint16(152), uint16(231), uint16(281), uint16(189), - /* 1510 */ uint16(59), uint16(189), uint16(23), uint16(189), uint16(189), uint16(26), uint16(189), uint16(36), uint16(70), uint16(189), - /* 1520 */ uint16(23), uint16(237), uint16(71), uint16(26), uint16(211), uint16(212), uint16(78), uint16(211), uint16(212), uint16(81), - /* 1530 */ uint16(189), uint16(211), uint16(212), uint16(211), uint16(212), uint16(115), uint16(211), uint16(212), uint16(211), uint16(212), - /* 1540 */ uint16(59), uint16(211), uint16(212), uint16(23), uint16(23), uint16(97), uint16(26), uint16(26), uint16(23), uint16(115), - /* 1550 */ uint16(99), uint16(26), uint16(71), uint16(189), uint16(189), uint16(189), uint16(105), uint16(106), uint16(107), uint16(23), - /* 1560 */ uint16(189), uint16(23), uint16(26), uint16(112), uint16(26), uint16(114), uint16(115), uint16(116), uint16(189), uint16(309), - /* 1570 */ uint16(119), uint16(23), uint16(19), uint16(20), uint16(26), uint16(22), uint16(189), uint16(211), uint16(212), uint16(131), - /* 1580 */ uint16(99), uint16(189), uint16(211), uint16(212), uint16(136), uint16(137), uint16(105), uint16(106), uint16(189), uint16(36), - /* 1590 */ uint16(211), uint16(212), uint16(189), uint16(112), uint16(189), uint16(114), uint16(115), uint16(116), uint16(211), uint16(212), - /* 1600 */ uint16(119), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(189), uint16(159), uint16(23), uint16(250), - /* 1610 */ uint16(189), uint16(26), uint16(59), uint16(189), uint16(189), uint16(189), uint16(189), uint16(189), uint16(280), uint16(189), - /* 1620 */ uint16(250), uint16(189), uint16(189), uint16(238), uint16(71), uint16(189), uint16(189), uint16(250), uint16(211), uint16(212), - /* 1630 */ uint16(187), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(211), uint16(212), uint16(250), uint16(290), - /* 1640 */ uint16(240), uint16(211), uint16(212), uint16(211), uint16(212), uint16(254), uint16(286), uint16(209), uint16(254), uint16(241), - /* 1650 */ uint16(240), uint16(254), uint16(99), uint16(286), uint16(215), uint16(220), uint16(214), uint16(244), uint16(105), uint16(106), - /* 1660 */ uint16(214), uint16(214), uint16(244), uint16(273), uint16(224), uint16(112), uint16(192), uint16(114), uint16(115), uint16(116), - /* 1670 */ uint16(60), uint16(290), uint16(119), uint16(5), uint16(139), uint16(196), uint16(196), uint16(38), uint16(10), uint16(11), - /* 1680 */ uint16(12), uint16(13), uint16(14), uint16(238), uint16(240), uint16(17), uint16(196), uint16(148), uint16(287), uint16(287), - /* 1690 */ uint16(276), uint16(113), uint16(22), uint16(147), uint16(241), uint16(43), uint16(229), uint16(241), uint16(30), uint16(18), - /* 1700 */ uint16(32), uint16(232), uint16(232), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(40), uint16(232), - /* 1710 */ uint16(232), uint16(196), uint16(18), uint16(195), uint16(265), uint16(265), uint16(264), uint16(241), uint16(264), uint16(196), - /* 1720 */ uint16(155), uint16(229), uint16(229), uint16(241), uint16(241), uint16(241), uint16(195), uint16(62), uint16(196), uint16(195), - /* 1730 */ uint16(22), uint16(113), uint16(216), uint16(196), uint16(222), uint16(195), uint16(195), uint16(282), uint16(70), uint16(196), - /* 1740 */ uint16(283), uint16(213), uint16(216), uint16(213), uint16(64), uint16(22), uint16(78), uint16(124), uint16(219), uint16(81), - /* 1750 */ uint16(162), uint16(111), uint16(219), uint16(142), uint16(256), uint16(213), uint16(113), uint16(255), uint16(213), uint16(256), - /* 1760 */ uint16(216), uint16(303), uint16(215), uint16(213), uint16(213), uint16(97), uint16(255), uint16(213), uint16(216), uint16(275), - /* 1770 */ uint16(275), uint16(222), uint16(216), uint16(256), uint16(255), uint16(196), uint16(91), uint16(82), uint16(256), uint16(255), - /* 1780 */ uint16(308), uint16(308), uint16(146), uint16(22), uint16(143), uint16(196), uint16(155), uint16(260), uint16(25), uint16(145), - /* 1790 */ uint16(144), uint16(199), uint16(26), uint16(198), uint16(13), uint16(190), uint16(190), uint16(6), uint16(293), uint16(131), - /* 1800 */ uint16(188), uint16(188), uint16(245), uint16(244), uint16(136), uint16(137), uint16(245), uint16(243), uint16(242), uint16(241), - /* 1810 */ uint16(188), uint16(202), uint16(208), uint16(217), uint16(217), uint16(260), uint16(208), uint16(4), uint16(202), uint16(3), - /* 1820 */ uint16(22), uint16(202), uint16(208), uint16(208), uint16(160), uint16(15), uint16(209), uint16(159), uint16(270), uint16(209), - /* 1830 */ uint16(98), uint16(16), uint16(272), uint16(208), uint16(23), uint16(23), uint16(137), uint16(148), uint16(128), uint16(20), - /* 1840 */ uint16(140), uint16(24), uint16(16), uint16(142), uint16(1), uint16(140), uint16(149), uint16(128), uint16(61), uint16(53), - /* 1850 */ uint16(148), uint16(37), uint16(53), uint16(53), uint16(53), uint16(128), uint16(114), uint16(34), uint16(296), uint16(296), - /* 1860 */ uint16(139), uint16(1), uint16(5), uint16(22), uint16(113), uint16(158), uint16(26), uint16(75), uint16(41), uint16(139), - /* 1870 */ uint16(68), uint16(68), uint16(113), uint16(24), uint16(20), uint16(19), uint16(129), uint16(123), uint16(23), uint16(96), - /* 1880 */ uint16(22), uint16(22), uint16(37), uint16(22), uint16(22), uint16(67), uint16(22), uint16(67), uint16(59), uint16(24), - /* 1890 */ uint16(23), uint16(28), uint16(67), uint16(147), uint16(22), uint16(26), uint16(23), uint16(23), uint16(23), uint16(23), - /* 1900 */ uint16(22), uint16(24), uint16(23), uint16(22), uint16(24), uint16(23), uint16(139), uint16(23), uint16(114), uint16(22), - /* 1910 */ uint16(141), uint16(26), uint16(88), uint16(75), uint16(86), uint16(44), uint16(23), uint16(34), uint16(22), uint16(75), - /* 1920 */ uint16(34), uint16(24), uint16(34), uint16(34), uint16(34), uint16(93), uint16(34), uint16(26), uint16(26), uint16(34), - /* 1930 */ uint16(23), uint16(23), uint16(23), uint16(23), uint16(23), uint16(11), uint16(23), uint16(22), uint16(26), uint16(22), - /* 1940 */ uint16(22), uint16(133), uint16(23), uint16(23), uint16(22), uint16(22), uint16(139), uint16(26), uint16(139), uint16(23), - /* 1950 */ uint16(15), uint16(1), uint16(1), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 1960 */ uint16(139), uint16(139), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 1970 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 1980 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 1990 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2000 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2010 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2020 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2030 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2040 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2050 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2060 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2070 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2080 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2090 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2100 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2110 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2120 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2130 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2140 */ uint16(310), uint16(310), uint16(310), -} /* sqlite3.c:154798:25 */ -var yy_shift_ofst = [553]uint16{ - /* 0 */ uint16(1448), uint16(1277), uint16(1668), uint16(1072), uint16(1072), uint16(340), uint16(1122), uint16(1225), uint16(1332), uint16(1481), - /* 10 */ uint16(1481), uint16(1481), uint16(335), uint16(0), uint16(0), uint16(180), uint16(897), uint16(1481), uint16(1481), uint16(1481), - /* 20 */ uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), - /* 30 */ uint16(930), uint16(930), uint16(1020), uint16(1020), uint16(290), uint16(1), uint16(340), uint16(340), uint16(340), uint16(340), - /* 40 */ uint16(340), uint16(340), uint16(40), uint16(110), uint16(219), uint16(288), uint16(327), uint16(396), uint16(435), uint16(504), - /* 50 */ uint16(543), uint16(612), uint16(651), uint16(720), uint16(877), uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), - /* 60 */ uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), - /* 70 */ uint16(897), uint16(897), uint16(897), uint16(917), uint16(897), uint16(1019), uint16(763), uint16(763), uint16(1451), uint16(1481), - /* 80 */ uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), - /* 90 */ uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), - /* 100 */ uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), - /* 110 */ uint16(1481), uint16(1481), uint16(1553), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), - /* 120 */ uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(147), uint16(258), uint16(258), uint16(258), - /* 130 */ uint16(258), uint16(258), uint16(79), uint16(65), uint16(84), uint16(449), uint16(19), uint16(786), uint16(449), uint16(636), - /* 140 */ uint16(636), uint16(449), uint16(880), uint16(880), uint16(880), uint16(880), uint16(113), uint16(142), uint16(142), uint16(472), - /* 150 */ uint16(150), uint16(1962), uint16(1962), uint16(399), uint16(399), uint16(399), uint16(93), uint16(237), uint16(341), uint16(237), - /* 160 */ uint16(237), uint16(1074), uint16(1074), uint16(437), uint16(350), uint16(704), uint16(1080), uint16(449), uint16(449), uint16(449), - /* 170 */ uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), - /* 180 */ uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(818), uint16(818), - /* 190 */ uint16(449), uint16(1088), uint16(217), uint16(217), uint16(734), uint16(734), uint16(1124), uint16(1126), uint16(1962), uint16(1962), - /* 200 */ uint16(1962), uint16(739), uint16(840), uint16(840), uint16(453), uint16(454), uint16(511), uint16(187), uint16(563), uint16(570), - /* 210 */ uint16(898), uint16(669), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), - /* 220 */ uint16(449), uint16(670), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), - /* 230 */ uint16(449), uint16(449), uint16(449), uint16(449), uint16(674), uint16(674), uint16(674), uint16(449), uint16(449), uint16(449), - /* 240 */ uint16(449), uint16(1034), uint16(449), uint16(449), uint16(449), uint16(972), uint16(1107), uint16(449), uint16(449), uint16(1193), - /* 250 */ uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(260), uint16(177), - /* 260 */ uint16(489), uint16(1241), uint16(1241), uint16(1241), uint16(1241), uint16(1192), uint16(489), uint16(489), uint16(952), uint16(1197), - /* 270 */ uint16(625), uint16(1235), uint16(1131), uint16(181), uint16(181), uint16(1086), uint16(1139), uint16(1131), uint16(1086), uint16(1187), - /* 280 */ uint16(1319), uint16(1237), uint16(1318), uint16(1318), uint16(1318), uint16(181), uint16(1299), uint16(1299), uint16(1109), uint16(1336), - /* 290 */ uint16(549), uint16(1376), uint16(1610), uint16(1535), uint16(1535), uint16(1639), uint16(1639), uint16(1535), uint16(1539), uint16(1578), - /* 300 */ uint16(1670), uint16(1546), uint16(1652), uint16(1546), uint16(1681), uint16(1681), uint16(1681), uint16(1681), uint16(1535), uint16(1694), - /* 310 */ uint16(1546), uint16(1546), uint16(1578), uint16(1670), uint16(1652), uint16(1546), uint16(1652), uint16(1546), uint16(1535), uint16(1694), - /* 320 */ uint16(1565), uint16(1665), uint16(1535), uint16(1694), uint16(1708), uint16(1535), uint16(1694), uint16(1535), uint16(1694), uint16(1708), - /* 330 */ uint16(1618), uint16(1618), uint16(1618), uint16(1680), uint16(1723), uint16(1723), uint16(1708), uint16(1618), uint16(1623), uint16(1618), - /* 340 */ uint16(1680), uint16(1618), uint16(1618), uint16(1588), uint16(1708), uint16(1640), uint16(1640), uint16(1708), uint16(1611), uint16(1643), - /* 350 */ uint16(1611), uint16(1643), uint16(1611), uint16(1643), uint16(1611), uint16(1643), uint16(1535), uint16(1685), uint16(1685), uint16(1695), - /* 360 */ uint16(1695), uint16(1636), uint16(1641), uint16(1761), uint16(1535), uint16(1631), uint16(1636), uint16(1644), uint16(1646), uint16(1546), - /* 370 */ uint16(1763), uint16(1766), uint16(1781), uint16(1781), uint16(1791), uint16(1791), uint16(1791), uint16(1962), uint16(1962), uint16(1962), - /* 380 */ uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), - /* 390 */ uint16(1962), uint16(1962), uint16(308), uint16(835), uint16(954), uint16(1232), uint16(879), uint16(715), uint16(728), uint16(1373), - /* 400 */ uint16(864), uint16(1329), uint16(1253), uint16(1409), uint16(297), uint16(1431), uint16(1489), uint16(1497), uint16(1520), uint16(1521), - /* 410 */ uint16(1525), uint16(1362), uint16(1309), uint16(1491), uint16(1217), uint16(1420), uint16(1429), uint16(1536), uint16(1380), uint16(1538), - /* 420 */ uint16(1293), uint16(1354), uint16(1548), uint16(1585), uint16(1434), uint16(1342), uint16(1813), uint16(1816), uint16(1798), uint16(1664), - /* 430 */ uint16(1810), uint16(1732), uint16(1815), uint16(1811), uint16(1812), uint16(1699), uint16(1689), uint16(1710), uint16(1817), uint16(1700), - /* 440 */ uint16(1819), uint16(1701), uint16(1826), uint16(1843), uint16(1705), uint16(1697), uint16(1719), uint16(1787), uint16(1814), uint16(1702), - /* 450 */ uint16(1796), uint16(1799), uint16(1800), uint16(1801), uint16(1727), uint16(1742), uint16(1823), uint16(1721), uint16(1860), uint16(1857), - /* 460 */ uint16(1841), uint16(1751), uint16(1707), uint16(1802), uint16(1840), uint16(1803), uint16(1792), uint16(1827), uint16(1730), uint16(1759), - /* 470 */ uint16(1849), uint16(1854), uint16(1856), uint16(1747), uint16(1754), uint16(1858), uint16(1818), uint16(1859), uint16(1861), uint16(1855), - /* 480 */ uint16(1862), uint16(1820), uint16(1829), uint16(1865), uint16(1783), uint16(1863), uint16(1864), uint16(1825), uint16(1845), uint16(1867), - /* 490 */ uint16(1746), uint16(1872), uint16(1873), uint16(1874), uint16(1875), uint16(1869), uint16(1876), uint16(1878), uint16(1877), uint16(1879), - /* 500 */ uint16(1881), uint16(1880), uint16(1767), uint16(1882), uint16(1884), uint16(1794), uint16(1883), uint16(1887), uint16(1769), uint16(1885), - /* 510 */ uint16(1886), uint16(1888), uint16(1889), uint16(1890), uint16(1824), uint16(1838), uint16(1828), uint16(1871), uint16(1844), uint16(1832), - /* 520 */ uint16(1892), uint16(1893), uint16(1896), uint16(1897), uint16(1901), uint16(1902), uint16(1895), uint16(1907), uint16(1885), uint16(1908), - /* 530 */ uint16(1909), uint16(1910), uint16(1911), uint16(1912), uint16(1913), uint16(1915), uint16(1924), uint16(1917), uint16(1918), uint16(1919), - /* 540 */ uint16(1920), uint16(1922), uint16(1923), uint16(1921), uint16(1808), uint16(1807), uint16(1809), uint16(1821), uint16(1822), uint16(1926), - /* 550 */ uint16(1935), uint16(1950), uint16(1951), -} /* sqlite3.c:155018:33 */ -var yy_reduce_ofst = [392]int16{ - /* 0 */ int16(490), int16(-122), int16(545), int16(645), int16(650), int16(-120), int16(-189), int16(-187), int16(-184), int16(-182), - /* 10 */ int16(-178), int16(-176), int16(45), int16(30), int16(200), int16(-251), int16(-134), int16(390), int16(392), int16(521), - /* 20 */ int16(523), int16(213), int16(692), int16(821), int16(284), int16(589), int16(872), int16(666), int16(671), int16(866), - /* 30 */ int16(71), int16(111), int16(273), int16(389), int16(686), int16(815), int16(904), int16(932), int16(948), int16(955), - /* 40 */ int16(964), int16(969), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), - /* 50 */ int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), - /* 60 */ int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), - /* 70 */ int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(428), int16(430), - /* 80 */ int16(899), int16(985), int16(1021), int16(1028), int16(1057), int16(1069), int16(1081), int16(1108), int16(1110), int16(1115), - /* 90 */ int16(1117), int16(1123), int16(1149), int16(1154), int16(1159), int16(1170), int16(1174), int16(1178), int16(1183), int16(1194), - /* 100 */ int16(1198), int16(1204), int16(1208), int16(1212), int16(1218), int16(1222), int16(1229), int16(1278), int16(1280), int16(1283), - /* 110 */ int16(1285), int16(1313), int16(1316), int16(1320), int16(1322), int16(1325), int16(1327), int16(1330), int16(1366), int16(1371), - /* 120 */ int16(1379), int16(1387), int16(1417), int16(1425), int16(1430), int16(1432), int16(-259), int16(-259), int16(-259), int16(-259), - /* 130 */ int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(557), int16(974), int16(-214), int16(-174), int16(-9), - /* 140 */ int16(431), int16(-124), int16(806), int16(925), int16(806), int16(925), int16(251), int16(928), int16(940), int16(-259), - /* 150 */ int16(-259), int16(-259), int16(-259), int16(-198), int16(-198), int16(-198), int16(127), int16(-186), int16(-168), int16(212), - /* 160 */ int16(646), int16(617), int16(799), int16(-262), int16(555), int16(220), int16(220), int16(491), int16(605), int16(1040), - /* 170 */ int16(1060), int16(699), int16(-11), int16(600), int16(848), int16(862), int16(345), int16(-129), int16(724), int16(-91), - /* 180 */ int16(158), int16(749), int16(716), int16(900), int16(304), int16(822), int16(929), int16(926), int16(499), int16(793), - /* 190 */ int16(322), int16(892), int16(813), int16(845), int16(958), int16(1056), int16(751), int16(905), int16(1133), int16(1062), - /* 200 */ int16(803), int16(-210), int16(-185), int16(-179), int16(-148), int16(-167), int16(-89), int16(121), int16(274), int16(281), - /* 210 */ int16(320), int16(336), int16(439), int16(663), int16(711), int16(957), int16(965), int16(1064), int16(1068), int16(1112), - /* 220 */ int16(1116), int16(-196), int16(1127), int16(1134), int16(1180), int16(1184), int16(1195), int16(1199), int16(1203), int16(1215), - /* 230 */ int16(1223), int16(1250), int16(1267), int16(1286), int16(205), int16(422), int16(638), int16(1324), int16(1341), int16(1364), - /* 240 */ int16(1365), int16(1213), int16(1392), int16(1399), int16(1403), int16(869), int16(1260), int16(1405), int16(1421), int16(1276), - /* 250 */ int16(1424), int16(121), int16(1426), int16(1427), int16(1428), int16(1433), int16(1436), int16(1437), int16(1227), int16(1338), - /* 260 */ int16(1284), int16(1359), int16(1370), int16(1377), int16(1388), int16(1213), int16(1284), int16(1284), int16(1385), int16(1438), - /* 270 */ int16(1443), int16(1349), int16(1400), int16(1391), int16(1394), int16(1360), int16(1408), int16(1410), int16(1367), int16(1439), - /* 280 */ int16(1440), int16(1435), int16(1442), int16(1446), int16(1447), int16(1397), int16(1413), int16(1418), int16(1390), int16(1444), - /* 290 */ int16(1445), int16(1474), int16(1381), int16(1479), int16(1480), int16(1401), int16(1402), int16(1490), int16(1414), int16(1449), - /* 300 */ int16(1452), int16(1453), int16(1467), int16(1456), int16(1469), int16(1470), int16(1477), int16(1478), int16(1515), int16(1518), - /* 310 */ int16(1476), int16(1482), int16(1450), int16(1454), int16(1492), int16(1483), int16(1493), int16(1484), int16(1523), int16(1531), - /* 320 */ int16(1457), int16(1455), int16(1532), int16(1534), int16(1516), int16(1537), int16(1540), int16(1543), int16(1541), int16(1526), - /* 330 */ int16(1528), int16(1530), int16(1542), int16(1512), int16(1529), int16(1533), int16(1544), int16(1545), int16(1547), int16(1550), - /* 340 */ int16(1549), int16(1551), int16(1554), int16(1458), int16(1552), int16(1494), int16(1495), int16(1556), int16(1498), int16(1502), - /* 350 */ int16(1503), int16(1511), int16(1517), int16(1519), int16(1522), int16(1524), int16(1579), int16(1472), int16(1473), int16(1527), - /* 360 */ int16(1555), int16(1557), int16(1559), int16(1558), int16(1589), int16(1560), int16(1561), int16(1564), int16(1566), int16(1568), - /* 370 */ int16(1592), int16(1595), int16(1605), int16(1606), int16(1612), int16(1613), int16(1622), int16(1562), int16(1563), int16(1505), - /* 380 */ int16(1609), int16(1604), int16(1608), int16(1614), int16(1615), int16(1616), int16(1596), int16(1597), int16(1617), int16(1620), - /* 390 */ int16(1625), int16(1619), -} /* sqlite3.c:155079:20 */ -var yy_default = [553]uint16{ - /* 0 */ uint16(1575), uint16(1575), uint16(1575), uint16(1411), uint16(1188), uint16(1297), uint16(1188), uint16(1188), uint16(1188), uint16(1411), - /* 10 */ uint16(1411), uint16(1411), uint16(1188), uint16(1327), uint16(1327), uint16(1464), uint16(1219), uint16(1188), uint16(1188), uint16(1188), - /* 20 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1410), uint16(1188), uint16(1188), - /* 30 */ uint16(1188), uint16(1188), uint16(1494), uint16(1494), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 40 */ uint16(1188), uint16(1188), uint16(1188), uint16(1336), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 50 */ uint16(1412), uint16(1413), uint16(1188), uint16(1188), uint16(1188), uint16(1463), uint16(1465), uint16(1428), uint16(1346), uint16(1345), - /* 60 */ uint16(1344), uint16(1343), uint16(1446), uint16(1314), uint16(1341), uint16(1334), uint16(1338), uint16(1406), uint16(1407), uint16(1405), - /* 70 */ uint16(1409), uint16(1413), uint16(1412), uint16(1188), uint16(1337), uint16(1377), uint16(1391), uint16(1376), uint16(1188), uint16(1188), - /* 80 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 90 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 100 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 110 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 120 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1385), uint16(1390), uint16(1396), uint16(1389), - /* 130 */ uint16(1386), uint16(1379), uint16(1378), uint16(1380), uint16(1381), uint16(1188), uint16(1209), uint16(1261), uint16(1188), uint16(1188), - /* 140 */ uint16(1188), uint16(1188), uint16(1482), uint16(1481), uint16(1188), uint16(1188), uint16(1219), uint16(1371), uint16(1370), uint16(1382), - /* 150 */ uint16(1383), uint16(1393), uint16(1392), uint16(1471), uint16(1529), uint16(1528), uint16(1429), uint16(1188), uint16(1188), uint16(1188), - /* 160 */ uint16(1188), uint16(1188), uint16(1188), uint16(1494), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 170 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 180 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1494), uint16(1494), - /* 190 */ uint16(1188), uint16(1219), uint16(1494), uint16(1494), uint16(1215), uint16(1215), uint16(1321), uint16(1188), uint16(1477), uint16(1297), - /* 200 */ uint16(1288), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 210 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1468), uint16(1466), uint16(1188), uint16(1188), uint16(1188), - /* 220 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 230 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 240 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1293), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 250 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1523), uint16(1188), uint16(1441), - /* 260 */ uint16(1275), uint16(1293), uint16(1293), uint16(1293), uint16(1293), uint16(1295), uint16(1276), uint16(1274), uint16(1287), uint16(1220), - /* 270 */ uint16(1195), uint16(1567), uint16(1294), uint16(1316), uint16(1316), uint16(1564), uint16(1340), uint16(1294), uint16(1564), uint16(1236), - /* 280 */ uint16(1545), uint16(1231), uint16(1327), uint16(1327), uint16(1327), uint16(1316), uint16(1321), uint16(1321), uint16(1408), uint16(1294), - /* 290 */ uint16(1287), uint16(1188), uint16(1567), uint16(1302), uint16(1302), uint16(1566), uint16(1566), uint16(1302), uint16(1429), uint16(1349), - /* 300 */ uint16(1355), uint16(1340), uint16(1264), uint16(1340), uint16(1270), uint16(1270), uint16(1270), uint16(1270), uint16(1302), uint16(1206), - /* 310 */ uint16(1340), uint16(1340), uint16(1349), uint16(1355), uint16(1264), uint16(1340), uint16(1264), uint16(1340), uint16(1302), uint16(1206), - /* 320 */ uint16(1445), uint16(1561), uint16(1302), uint16(1206), uint16(1419), uint16(1302), uint16(1206), uint16(1302), uint16(1206), uint16(1419), - /* 330 */ uint16(1262), uint16(1262), uint16(1262), uint16(1251), uint16(1188), uint16(1188), uint16(1419), uint16(1262), uint16(1236), uint16(1262), - /* 340 */ uint16(1251), uint16(1262), uint16(1262), uint16(1512), uint16(1419), uint16(1423), uint16(1423), uint16(1419), uint16(1320), uint16(1315), - /* 350 */ uint16(1320), uint16(1315), uint16(1320), uint16(1315), uint16(1320), uint16(1315), uint16(1302), uint16(1504), uint16(1504), uint16(1330), - /* 360 */ uint16(1330), uint16(1335), uint16(1321), uint16(1414), uint16(1302), uint16(1188), uint16(1335), uint16(1333), uint16(1331), uint16(1340), - /* 370 */ uint16(1212), uint16(1254), uint16(1526), uint16(1526), uint16(1522), uint16(1522), uint16(1522), uint16(1572), uint16(1572), uint16(1477), - /* 380 */ uint16(1538), uint16(1219), uint16(1219), uint16(1219), uint16(1219), uint16(1538), uint16(1238), uint16(1238), uint16(1220), uint16(1220), - /* 390 */ uint16(1219), uint16(1538), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1533), uint16(1188), - /* 400 */ uint16(1430), uint16(1306), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 410 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 420 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1360), uint16(1188), uint16(1191), uint16(1474), uint16(1188), - /* 430 */ uint16(1188), uint16(1472), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1307), uint16(1188), - /* 440 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 450 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1563), uint16(1188), uint16(1188), - /* 460 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1444), uint16(1443), uint16(1188), uint16(1188), uint16(1304), uint16(1188), - /* 470 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 480 */ uint16(1188), uint16(1188), uint16(1234), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 490 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 500 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1332), - /* 510 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 520 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1509), uint16(1322), uint16(1188), uint16(1188), uint16(1554), uint16(1188), - /* 530 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 540 */ uint16(1188), uint16(1188), uint16(1188), uint16(1549), uint16(1278), uint16(1362), uint16(1188), uint16(1361), uint16(1365), uint16(1188), - /* 550 */ uint16(1200), uint16(1188), uint16(1188), -} /* sqlite3.c:155121:27 */ + /* 450 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(191), uint16(117), uint16(191), uint16(210), uint16(19), uint16(152), + /* 460 */ uint16(153), uint16(154), uint16(23), uint16(295), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), + /* 470 */ uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(266), uint16(213), uint16(214), uint16(213), uint16(214), + /* 480 */ uint16(142), uint16(81), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), + /* 490 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(301), uint16(102), uint16(103), + /* 500 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(106), + /* 510 */ uint16(107), uint16(118), uint16(59), uint16(250), uint16(121), uint16(122), uint16(123), uint16(280), uint16(76), uint16(119), + /* 520 */ uint16(236), uint16(237), uint16(259), uint16(306), uint16(131), uint16(72), uint16(59), uint16(310), uint16(19), uint16(87), + /* 530 */ uint16(283), uint16(89), uint16(23), uint16(249), uint16(92), uint16(288), uint16(22), uint16(137), uint16(138), uint16(22), + /* 540 */ uint16(275), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), + /* 550 */ uint16(111), uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), + /* 560 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(115), uint16(116), + /* 570 */ uint16(117), uint16(23), uint16(186), uint16(59), uint16(188), uint16(108), uint16(59), uint16(241), uint16(191), uint16(193), + /* 580 */ uint16(26), uint16(195), uint16(115), uint16(116), uint16(117), uint16(191), uint16(144), uint16(251), uint16(202), uint16(22), + /* 590 */ uint16(100), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), + /* 600 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(116), uint16(213), uint16(214), uint16(191), + /* 610 */ uint16(120), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), + /* 620 */ uint16(111), uint16(112), uint16(236), uint16(237), uint16(306), uint16(238), uint16(59), uint16(26), uint16(310), uint16(115), + /* 630 */ uint16(116), uint16(117), uint16(115), uint16(116), uint16(117), uint16(249), uint16(246), uint16(19), uint16(248), uint16(106), + /* 640 */ uint16(107), uint16(23), uint16(152), uint16(153), uint16(154), uint16(46), uint16(47), uint16(48), uint16(49), uint16(263), + /* 650 */ uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), + /* 660 */ uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), + /* 670 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(76), uint16(298), uint16(299), + /* 680 */ uint16(23), uint16(295), uint16(115), uint16(116), uint16(117), uint16(152), uint16(191), uint16(154), uint16(301), uint16(73), + /* 690 */ uint16(89), uint16(137), uint16(138), uint16(92), uint16(22), uint16(191), uint16(144), uint16(22), uint16(191), uint16(191), + /* 700 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), + /* 710 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(163), uint16(191), uint16(213), uint16(214), uint16(120), + /* 720 */ uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), + /* 730 */ uint16(112), uint16(59), uint16(228), uint16(191), uint16(59), uint16(191), uint16(236), uint16(237), uint16(213), uint16(214), + /* 740 */ uint16(11), uint16(59), uint16(126), uint16(127), uint16(128), uint16(238), uint16(19), uint16(26), uint16(191), uint16(249), + /* 750 */ uint16(23), uint16(164), uint16(165), uint16(228), uint16(191), uint16(213), uint16(214), uint16(213), uint16(214), uint16(102), + /* 760 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), + /* 770 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), + /* 780 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(241), uint16(115), uint16(116), uint16(117), + /* 790 */ uint16(115), uint16(116), uint16(117), uint16(191), uint16(250), uint16(238), uint16(251), uint16(115), uint16(116), uint16(117), + /* 800 */ uint16(157), uint16(23), uint16(159), uint16(191), uint16(26), uint16(191), uint16(111), uint16(112), uint16(301), uint16(43), + /* 810 */ uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), + /* 820 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(142), uint16(213), uint16(214), uint16(213), uint16(214), uint16(102), + /* 830 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), + /* 840 */ uint16(228), uint16(191), uint16(228), uint16(191), uint16(191), uint16(207), uint16(208), uint16(209), uint16(126), uint16(127), + /* 850 */ uint16(128), uint16(133), uint16(289), uint16(135), uint16(136), uint16(19), uint16(127), uint16(128), uint16(301), uint16(7), + /* 860 */ uint16(8), uint16(9), uint16(141), uint16(213), uint16(214), uint16(213), uint16(214), uint16(265), uint16(102), uint16(103), + /* 870 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(43), + /* 880 */ uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), + /* 890 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(191), uint16(117), uint16(191), uint16(22), uint16(23), uint16(19), + /* 900 */ uint16(250), uint16(26), uint16(250), uint16(191), uint16(223), uint16(191), uint16(126), uint16(127), uint16(128), uint16(205), + /* 910 */ uint16(206), uint16(205), uint16(206), uint16(260), uint16(21), uint16(202), uint16(213), uint16(214), uint16(213), uint16(214), + /* 920 */ uint16(142), uint16(270), uint16(208), uint16(209), uint16(158), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), + /* 930 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(102), uint16(103), + /* 940 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(236), + /* 950 */ uint16(237), uint16(12), uint16(191), uint16(250), uint16(76), uint16(250), uint16(191), uint16(22), uint16(23), uint16(308), + /* 960 */ uint16(309), uint16(26), uint16(249), uint16(202), uint16(191), uint16(191), uint16(27), uint16(89), uint16(191), uint16(202), + /* 970 */ uint16(92), uint16(202), uint16(260), uint16(80), uint16(213), uint16(214), uint16(101), uint16(203), uint16(213), uint16(214), + /* 980 */ uint16(22), uint16(42), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), + /* 990 */ uint16(110), uint16(111), uint16(112), uint16(228), uint16(158), uint16(281), uint16(108), uint16(236), uint16(237), uint16(225), + /* 1000 */ uint16(191), uint16(227), uint16(63), uint16(236), uint16(237), uint16(236), uint16(237), uint16(191), uint16(235), uint16(191), + /* 1010 */ uint16(249), uint16(250), uint16(73), uint16(241), uint16(19), uint16(122), uint16(249), uint16(59), uint16(249), uint16(24), + /* 1020 */ uint16(259), uint16(29), uint16(134), uint16(251), uint16(191), uint16(33), uint16(22), uint16(139), uint16(24), uint16(213), + /* 1030 */ uint16(214), uint16(213), uint16(214), uint16(191), uint16(19), uint16(210), uint16(101), uint16(191), uint16(43), uint16(44), + /* 1040 */ uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), + /* 1050 */ uint16(55), uint16(56), uint16(57), uint16(160), uint16(19), uint16(213), uint16(214), uint16(65), uint16(43), uint16(44), + /* 1060 */ uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), + /* 1070 */ uint16(55), uint16(56), uint16(57), uint16(191), uint16(116), uint16(22), uint16(191), uint16(24), uint16(43), uint16(44), + /* 1080 */ uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), + /* 1090 */ uint16(55), uint16(56), uint16(57), uint16(191), uint16(261), uint16(213), uint16(214), uint16(102), uint16(103), uint16(104), + /* 1100 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(59), uint16(19), + /* 1110 */ uint16(191), uint16(265), uint16(59), uint16(288), uint16(191), uint16(213), uint16(214), uint16(102), uint16(103), uint16(104), + /* 1120 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(35), uint16(191), + /* 1130 */ uint16(66), uint16(191), uint16(213), uint16(214), uint16(191), uint16(270), uint16(46), uint16(102), uint16(103), uint16(104), + /* 1140 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(191), uint16(85), + /* 1150 */ uint16(265), uint16(213), uint16(214), uint16(213), uint16(214), uint16(106), uint16(107), uint16(19), uint16(94), uint16(66), + /* 1160 */ uint16(137), uint16(138), uint16(191), uint16(114), uint16(115), uint16(116), uint16(117), uint16(74), uint16(119), uint16(116), + /* 1170 */ uint16(213), uint16(214), uint16(202), uint16(308), uint16(309), uint16(306), uint16(127), uint16(191), uint16(235), uint16(310), + /* 1180 */ uint16(59), uint16(191), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), + /* 1190 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(191), uint16(76), uint16(196), uint16(213), + /* 1200 */ uint16(214), uint16(152), uint16(12), uint16(154), uint16(114), uint16(191), uint16(236), uint16(237), uint16(87), uint16(145), + /* 1210 */ uint16(89), uint16(19), uint16(20), uint16(92), uint16(22), uint16(22), uint16(23), uint16(27), uint16(191), uint16(249), + /* 1220 */ uint16(130), uint16(202), uint16(129), uint16(202), uint16(191), uint16(235), uint16(306), uint16(152), uint16(36), uint16(154), + /* 1230 */ uint16(310), uint16(191), uint16(42), uint16(191), uint16(191), uint16(191), uint16(115), uint16(116), uint16(117), uint16(191), + /* 1240 */ uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), + /* 1250 */ uint16(112), uint16(59), uint16(99), uint16(63), uint16(191), uint16(236), uint16(237), uint16(236), uint16(237), uint16(191), + /* 1260 */ uint16(289), uint16(213), uint16(214), uint16(71), uint16(191), uint16(144), uint16(261), uint16(191), uint16(249), uint16(191), + /* 1270 */ uint16(249), uint16(19), uint16(20), uint16(81), uint16(22), uint16(235), uint16(213), uint16(214), uint16(235), uint16(191), + /* 1280 */ uint16(278), uint16(213), uint16(214), uint16(191), uint16(282), uint16(132), uint16(213), uint16(214), uint16(36), uint16(213), + /* 1290 */ uint16(214), uint16(191), uint16(100), uint16(191), uint16(101), uint16(191), uint16(191), uint16(191), uint16(106), uint16(107), + /* 1300 */ uint16(48), uint16(213), uint16(214), uint16(261), uint16(191), uint16(113), uint16(191), uint16(115), uint16(116), uint16(117), + /* 1310 */ uint16(191), uint16(59), uint16(120), uint16(213), uint16(214), uint16(213), uint16(214), uint16(213), uint16(214), uint16(213), + /* 1320 */ uint16(214), uint16(22), uint16(23), uint16(71), uint16(237), uint16(59), uint16(213), uint16(214), uint16(191), uint16(137), + /* 1330 */ uint16(138), uint16(191), uint16(213), uint16(214), uint16(191), uint16(191), uint16(249), uint16(85), uint16(191), uint16(261), + /* 1340 */ uint16(191), uint16(26), uint16(90), uint16(15), uint16(152), uint16(153), uint16(154), uint16(155), uint16(156), uint16(19), + /* 1350 */ uint16(213), uint16(214), uint16(100), uint16(213), uint16(214), uint16(191), uint16(213), uint16(214), uint16(106), uint16(107), + /* 1360 */ uint16(213), uint16(214), uint16(213), uint16(214), uint16(191), uint16(113), uint16(261), uint16(115), uint16(116), uint16(117), + /* 1370 */ uint16(253), uint16(254), uint16(120), uint16(229), uint16(191), uint16(191), uint16(191), uint16(213), uint16(214), uint16(191), + /* 1380 */ uint16(306), uint16(289), uint16(116), uint16(26), uint16(310), uint16(191), uint16(213), uint16(214), uint16(60), uint16(19), + /* 1390 */ uint16(296), uint16(297), uint16(24), uint16(191), uint16(46), uint16(191), uint16(213), uint16(214), uint16(213), uint16(214), + /* 1400 */ uint16(101), uint16(213), uint16(214), uint16(191), uint16(152), uint16(153), uint16(154), uint16(155), uint16(156), uint16(0), + /* 1410 */ uint16(1), uint16(2), uint16(191), uint16(229), uint16(5), uint16(213), uint16(214), uint16(213), uint16(214), uint16(10), + /* 1420 */ uint16(11), uint16(12), uint16(13), uint16(14), uint16(1), uint16(2), uint16(17), uint16(191), uint16(5), uint16(19), + /* 1430 */ uint16(20), uint16(191), uint16(22), uint16(10), uint16(11), uint16(12), uint16(13), uint16(14), uint16(191), uint16(30), + /* 1440 */ uint16(17), uint16(32), uint16(241), uint16(148), uint16(149), uint16(115), uint16(36), uint16(191), uint16(241), uint16(40), + /* 1450 */ uint16(191), uint16(26), uint16(251), uint16(30), uint16(191), uint16(32), uint16(141), uint16(22), uint16(251), uint16(5), + /* 1460 */ uint16(213), uint16(214), uint16(114), uint16(40), uint16(10), uint16(11), uint16(12), uint16(13), uint16(14), uint16(59), + /* 1470 */ uint16(134), uint16(17), uint16(213), uint16(214), uint16(191), uint16(139), uint16(213), uint16(214), uint16(191), uint16(70), + /* 1480 */ uint16(191), uint16(71), uint16(125), uint16(191), uint16(30), uint16(115), uint16(32), uint16(78), uint16(53), uint16(191), + /* 1490 */ uint16(81), uint16(191), uint16(191), uint16(70), uint16(40), uint16(85), uint16(213), uint16(214), uint16(191), uint16(22), + /* 1500 */ uint16(90), uint16(78), uint16(213), uint16(214), uint16(81), uint16(213), uint16(214), uint16(98), uint16(140), uint16(120), + /* 1510 */ uint16(100), uint16(213), uint16(214), uint16(213), uint16(214), uint16(23), uint16(106), uint16(107), uint16(26), uint16(130), + /* 1520 */ uint16(191), uint16(98), uint16(191), uint16(113), uint16(70), uint16(115), uint16(116), uint16(117), uint16(23), uint16(22), + /* 1530 */ uint16(120), uint16(26), uint16(78), uint16(19), uint16(191), uint16(81), uint16(19), uint16(20), uint16(61), uint16(22), + /* 1540 */ uint16(191), uint16(132), uint16(213), uint16(214), uint16(213), uint16(214), uint16(137), uint16(138), uint16(59), uint16(191), + /* 1550 */ uint16(191), uint16(191), uint16(98), uint16(36), uint16(128), uint16(132), uint16(213), uint16(214), uint16(128), uint16(59), + /* 1560 */ uint16(137), uint16(138), uint16(152), uint16(153), uint16(154), uint16(155), uint16(156), uint16(83), uint16(84), uint16(144), + /* 1570 */ uint16(161), uint16(213), uint16(214), uint16(213), uint16(214), uint16(23), uint16(59), uint16(151), uint16(26), uint16(23), + /* 1580 */ uint16(23), uint16(151), uint16(26), uint16(26), uint16(161), uint16(59), uint16(132), uint16(23), uint16(71), uint16(191), + /* 1590 */ uint16(26), uint16(137), uint16(138), uint16(119), uint16(120), uint16(23), uint16(19), uint16(20), uint16(26), uint16(22), + /* 1600 */ uint16(223), uint16(23), uint16(85), uint16(23), uint16(26), uint16(116), uint16(26), uint16(90), uint16(191), uint16(7), + /* 1610 */ uint16(8), uint16(97), uint16(152), uint16(36), uint16(154), uint16(161), uint16(116), uint16(100), uint16(23), uint16(23), + /* 1620 */ uint16(191), uint16(26), uint16(26), uint16(106), uint16(107), uint16(191), uint16(23), uint16(223), uint16(23), uint16(26), + /* 1630 */ uint16(113), uint16(26), uint16(115), uint16(116), uint16(117), uint16(23), uint16(59), uint16(120), uint16(26), uint16(191), + /* 1640 */ uint16(191), uint16(191), uint16(116), uint16(255), uint16(191), uint16(252), uint16(191), uint16(140), uint16(71), uint16(191), + /* 1650 */ uint16(315), uint16(233), uint16(191), uint16(191), uint16(191), uint16(191), uint16(191), uint16(191), uint16(191), uint16(191), + /* 1660 */ uint16(191), uint16(285), uint16(284), uint16(239), uint16(252), uint16(252), uint16(252), uint16(252), uint16(240), uint16(152), + /* 1670 */ uint16(153), uint16(154), uint16(155), uint16(156), uint16(189), uint16(294), uint16(268), uint16(100), uint16(242), uint16(268), + /* 1680 */ uint16(264), uint16(211), uint16(290), uint16(106), uint16(107), uint16(108), uint16(264), uint16(256), uint16(256), uint16(243), + /* 1690 */ uint16(113), uint16(290), uint16(115), uint16(116), uint16(117), uint16(268), uint16(217), uint16(120), uint16(226), uint16(243), + /* 1700 */ uint16(222), uint16(268), uint16(216), uint16(19), uint16(20), uint16(246), uint16(22), uint16(216), uint16(256), uint16(216), + /* 1710 */ uint16(194), uint16(60), uint16(38), uint16(242), uint16(277), uint16(294), uint16(240), uint16(242), uint16(198), uint16(246), + /* 1720 */ uint16(36), uint16(140), uint16(198), uint16(198), uint16(19), uint16(20), uint16(150), uint16(22), uint16(149), uint16(152), + /* 1730 */ uint16(153), uint16(154), uint16(155), uint16(156), uint16(294), uint16(291), uint16(291), uint16(280), uint16(22), uint16(43), + /* 1740 */ uint16(231), uint16(36), uint16(18), uint16(59), uint16(234), uint16(234), uint16(234), uint16(234), uint16(267), uint16(269), + /* 1750 */ uint16(18), uint16(198), uint16(197), uint16(231), uint16(148), uint16(71), uint16(269), uint16(269), uint16(243), uint16(231), + /* 1760 */ uint16(198), uint16(243), uint16(267), uint16(197), uint16(59), uint16(157), uint16(243), uint16(198), uint16(62), uint16(287), + /* 1770 */ uint16(243), uint16(197), uint16(22), uint16(198), uint16(114), uint16(64), uint16(71), uint16(218), uint16(218), uint16(197), + /* 1780 */ uint16(286), uint16(198), uint16(197), uint16(215), uint16(100), uint16(215), uint16(215), uint16(224), uint16(22), uint16(125), + /* 1790 */ uint16(106), uint16(107), uint16(164), uint16(24), uint16(221), uint16(112), uint16(143), uint16(113), uint16(302), uint16(115), + /* 1800 */ uint16(116), uint16(117), uint16(218), uint16(215), uint16(120), uint16(100), uint16(217), uint16(221), uint16(215), uint16(215), + /* 1810 */ uint16(309), uint16(106), uint16(107), uint16(215), uint16(224), uint16(279), uint16(279), uint16(218), uint16(113), uint16(258), + /* 1820 */ uint16(115), uint16(116), uint16(117), uint16(114), uint16(257), uint16(120), uint16(91), uint16(198), uint16(82), uint16(147), + /* 1830 */ uint16(144), uint16(22), uint16(274), uint16(314), uint16(198), uint16(314), uint16(152), uint16(153), uint16(154), uint16(155), + /* 1840 */ uint16(156), uint16(276), uint16(157), uint16(146), uint16(145), uint16(258), uint16(25), uint16(247), uint16(257), uint16(201), + /* 1850 */ uint16(258), uint16(26), uint16(200), uint16(13), uint16(257), uint16(244), uint16(246), uint16(152), uint16(153), uint16(154), + /* 1860 */ uint16(155), uint16(156), uint16(258), uint16(262), uint16(257), uint16(247), uint16(245), uint16(243), uint16(192), uint16(192), + /* 1870 */ uint16(6), uint16(262), uint16(204), uint16(210), uint16(219), uint16(210), uint16(210), uint16(190), uint16(190), uint16(190), + /* 1880 */ uint16(210), uint16(219), uint16(204), uint16(211), uint16(211), uint16(210), uint16(4), uint16(3), uint16(22), uint16(162), + /* 1890 */ uint16(15), uint16(23), uint16(16), uint16(23), uint16(204), uint16(138), uint16(129), uint16(150), uint16(26), uint16(141), + /* 1900 */ uint16(20), uint16(24), uint16(143), uint16(16), uint16(1), uint16(141), uint16(129), uint16(129), uint16(61), uint16(53), + /* 1910 */ uint16(37), uint16(150), uint16(297), uint16(300), uint16(300), uint16(53), uint16(53), uint16(129), uint16(53), uint16(115), + /* 1920 */ uint16(34), uint16(140), uint16(1), uint16(5), uint16(22), uint16(114), uint16(68), uint16(26), uint16(160), uint16(68), + /* 1930 */ uint16(75), uint16(41), uint16(140), uint16(114), uint16(24), uint16(20), uint16(19), uint16(130), uint16(124), uint16(23), + /* 1940 */ uint16(96), uint16(22), uint16(22), uint16(37), uint16(22), uint16(67), uint16(22), uint16(59), uint16(67), uint16(24), + /* 1950 */ uint16(22), uint16(28), uint16(67), uint16(23), uint16(148), uint16(22), uint16(97), uint16(23), uint16(23), uint16(23), + /* 1960 */ uint16(140), uint16(23), uint16(22), uint16(26), uint16(23), uint16(23), uint16(115), uint16(22), uint16(142), uint16(26), + /* 1970 */ uint16(75), uint16(88), uint16(75), uint16(34), uint16(23), uint16(86), uint16(44), uint16(22), uint16(34), uint16(26), + /* 1980 */ uint16(34), uint16(34), uint16(34), uint16(34), uint16(93), uint16(24), uint16(26), uint16(23), uint16(34), uint16(23), + /* 1990 */ uint16(23), uint16(23), uint16(23), uint16(11), uint16(23), uint16(22), uint16(26), uint16(22), uint16(22), uint16(15), + /* 2000 */ uint16(23), uint16(23), uint16(22), uint16(22), uint16(1), uint16(26), uint16(23), uint16(140), uint16(134), uint16(140), + /* 2010 */ uint16(1), uint16(140), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(140), + /* 2020 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2030 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2040 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2050 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2060 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2070 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2080 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2090 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2100 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2110 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2120 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2130 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2140 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2150 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2160 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2170 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2180 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2190 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2200 */ uint16(316), uint16(316), uint16(316), +} /* sqlite3.c:157670:25 */ +var yy_shift_ofst = [570]uint16{ + /* 0 */ uint16(1423), uint16(1409), uint16(1454), uint16(1192), uint16(1192), uint16(36), uint16(1252), uint16(1410), uint16(1517), uint16(1684), + /* 10 */ uint16(1684), uint16(1684), uint16(292), uint16(0), uint16(0), uint16(180), uint16(1015), uint16(1684), uint16(1684), uint16(1684), + /* 20 */ uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), + /* 30 */ uint16(1049), uint16(1049), uint16(1121), uint16(1121), uint16(54), uint16(400), uint16(36), uint16(36), uint16(36), uint16(36), + /* 40 */ uint16(36), uint16(40), uint16(110), uint16(219), uint16(289), uint16(396), uint16(439), uint16(509), uint16(548), uint16(618), + /* 50 */ uint16(657), uint16(727), uint16(766), uint16(836), uint16(995), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), + /* 60 */ uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), + /* 70 */ uint16(1015), uint16(1015), uint16(1015), uint16(1035), uint16(1015), uint16(1138), uint16(880), uint16(880), uint16(1577), uint16(1684), + /* 80 */ uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), + /* 90 */ uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), + /* 100 */ uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), + /* 110 */ uint16(1684), uint16(1684), uint16(1684), uint16(1705), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), + /* 120 */ uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(146), uint16(84), uint16(84), + /* 130 */ uint16(84), uint16(84), uint16(84), uint16(362), uint16(269), uint16(125), uint16(97), uint16(453), uint16(66), uint16(66), + /* 140 */ uint16(893), uint16(1090), uint16(66), uint16(66), uint16(533), uint16(533), uint16(66), uint16(554), uint16(554), uint16(554), + /* 150 */ uint16(554), uint16(192), uint16(587), uint16(587), uint16(695), uint16(25), uint16(2020), uint16(2020), uint16(290), uint16(290), + /* 160 */ uint16(290), uint16(200), uint16(514), uint16(514), uint16(514), uint16(514), uint16(939), uint16(939), uint16(442), uint16(875), + /* 170 */ uint16(935), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), + /* 180 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), + /* 190 */ uint16(66), uint16(601), uint16(601), uint16(66), uint16(729), uint16(878), uint16(878), uint16(1266), uint16(1266), uint16(552), + /* 200 */ uint16(1023), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(307), uint16(490), + /* 210 */ uint16(490), uint16(567), uint16(393), uint16(517), uint16(467), uint16(672), uint16(242), uint16(682), uint16(675), uint16(66), + /* 220 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(616), + /* 230 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), + /* 240 */ uint16(66), uint16(66), uint16(1093), uint16(1093), uint16(1093), uint16(66), uint16(66), uint16(66), uint16(778), uint16(66), + /* 250 */ uint16(66), uint16(66), uint16(1053), uint16(1064), uint16(66), uint16(66), uint16(1190), uint16(66), uint16(66), uint16(66), + /* 260 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(722), uint16(992), uint16(718), uint16(253), uint16(253), + /* 270 */ uint16(253), uint16(253), uint16(338), uint16(718), uint16(718), uint16(888), uint16(403), uint16(852), uint16(1328), uint16(254), + /* 280 */ uint16(1295), uint16(721), uint16(1330), uint16(1295), uint16(1330), uint16(1370), uint16(234), uint16(254), uint16(254), uint16(234), + /* 290 */ uint16(254), uint16(721), uint16(1370), uint16(1357), uint16(1492), uint16(1348), uint16(385), uint16(385), uint16(385), uint16(1330), + /* 300 */ uint16(1425), uint16(1425), uint16(643), uint16(1315), uint16(1336), uint16(1004), uint16(1651), uint16(1651), uint16(1581), uint16(1581), + /* 310 */ uint16(1674), uint16(1674), uint16(1581), uint16(1576), uint16(1579), uint16(1716), uint16(1696), uint16(1724), uint16(1724), uint16(1724), + /* 320 */ uint16(1724), uint16(1581), uint16(1732), uint16(1606), uint16(1579), uint16(1579), uint16(1606), uint16(1716), uint16(1696), uint16(1606), + /* 330 */ uint16(1696), uint16(1606), uint16(1581), uint16(1732), uint16(1608), uint16(1706), uint16(1581), uint16(1732), uint16(1750), uint16(1581), + /* 340 */ uint16(1732), uint16(1581), uint16(1732), uint16(1750), uint16(1660), uint16(1660), uint16(1660), uint16(1711), uint16(1766), uint16(1766), + /* 350 */ uint16(1750), uint16(1660), uint16(1664), uint16(1660), uint16(1711), uint16(1660), uint16(1660), uint16(1628), uint16(1769), uint16(1683), + /* 360 */ uint16(1683), uint16(1750), uint16(1653), uint16(1709), uint16(1653), uint16(1709), uint16(1653), uint16(1709), uint16(1653), uint16(1709), + /* 370 */ uint16(1581), uint16(1735), uint16(1735), uint16(1746), uint16(1746), uint16(1682), uint16(1686), uint16(1809), uint16(1581), uint16(1685), + /* 380 */ uint16(1682), uint16(1697), uint16(1699), uint16(1606), uint16(1821), uint16(1825), uint16(1840), uint16(1840), uint16(1864), uint16(1864), + /* 390 */ uint16(1864), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), + /* 400 */ uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(599), uint16(223), uint16(1193), uint16(1299), + /* 410 */ uint16(228), uint16(780), uint16(958), uint16(1505), uint16(1153), uint16(1435), uint16(1368), uint16(1426), uint16(1430), uint16(1552), + /* 420 */ uint16(1477), uint16(1556), uint16(1557), uint16(1564), uint16(1572), uint16(1578), uint16(1580), uint16(1489), uint16(1474), uint16(1602), + /* 430 */ uint16(1389), uint16(1514), uint16(1500), uint16(1595), uint16(1596), uint16(1484), uint16(1603), uint16(1075), uint16(1460), uint16(1605), + /* 440 */ uint16(1612), uint16(1526), uint16(1507), uint16(1882), uint16(1884), uint16(1866), uint16(1727), uint16(1875), uint16(1876), uint16(1868), + /* 450 */ uint16(1870), uint16(1757), uint16(1747), uint16(1767), uint16(1872), uint16(1872), uint16(1877), uint16(1758), uint16(1880), uint16(1759), + /* 460 */ uint16(1887), uint16(1903), uint16(1764), uint16(1777), uint16(1872), uint16(1778), uint16(1847), uint16(1873), uint16(1872), uint16(1761), + /* 470 */ uint16(1856), uint16(1862), uint16(1863), uint16(1865), uint16(1788), uint16(1804), uint16(1886), uint16(1781), uint16(1921), uint16(1918), + /* 480 */ uint16(1902), uint16(1811), uint16(1768), uint16(1858), uint16(1901), uint16(1861), uint16(1855), uint16(1890), uint16(1792), uint16(1819), + /* 490 */ uint16(1910), uint16(1915), uint16(1917), uint16(1807), uint16(1814), uint16(1919), uint16(1878), uint16(1920), uint16(1922), uint16(1916), + /* 500 */ uint16(1924), uint16(1881), uint16(1888), uint16(1925), uint16(1844), uint16(1923), uint16(1928), uint16(1885), uint16(1906), uint16(1930), + /* 510 */ uint16(1806), uint16(1933), uint16(1934), uint16(1935), uint16(1936), uint16(1937), uint16(1938), uint16(1940), uint16(1859), uint16(1820), + /* 520 */ uint16(1941), uint16(1942), uint16(1851), uint16(1939), uint16(1945), uint16(1826), uint16(1943), uint16(1944), uint16(1946), uint16(1947), + /* 530 */ uint16(1948), uint16(1883), uint16(1895), uint16(1889), uint16(1932), uint16(1897), uint16(1891), uint16(1949), uint16(1951), uint16(1955), + /* 540 */ uint16(1961), uint16(1953), uint16(1960), uint16(1954), uint16(1964), uint16(1943), uint16(1966), uint16(1967), uint16(1968), uint16(1969), + /* 550 */ uint16(1970), uint16(1971), uint16(1973), uint16(1982), uint16(1975), uint16(1976), uint16(1977), uint16(1978), uint16(1980), uint16(1981), + /* 560 */ uint16(1979), uint16(1874), uint16(1867), uint16(1869), uint16(1871), uint16(1879), uint16(1983), uint16(1984), uint16(2003), uint16(2009), +} /* sqlite3.c:157896:33 */ +var yy_reduce_ofst = [406]int16{ + /* 0 */ int16(111), int16(168), int16(386), int16(761), int16(-176), int16(-174), int16(-191), int16(-189), int16(-181), int16(-178), + /* 10 */ int16(176), int16(263), int16(44), int16(-207), int16(-204), int16(-265), int16(-139), int16(-114), int16(158), int16(504), + /* 20 */ int16(525), int16(544), int16(612), int16(614), int16(650), int16(652), int16(765), int16(265), int16(703), int16(705), + /* 30 */ int16(70), int16(714), int16(-187), int16(127), int16(774), int16(713), int16(767), int16(769), int16(970), int16(1019), + /* 40 */ int16(1021), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), + /* 50 */ int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), + /* 60 */ int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), + /* 70 */ int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(394), int16(542), + /* 80 */ int16(816), int16(818), int16(842), int16(882), int16(902), int16(919), int16(938), int16(940), int16(957), int16(986), + /* 90 */ int16(1048), int16(1063), int16(1068), int16(1073), int16(1076), int16(1088), int16(1100), int16(1102), int16(1104), int16(1106), + /* 100 */ int16(1113), int16(1119), int16(1137), int16(1140), int16(1143), int16(1147), int16(1149), int16(1164), int16(1173), int16(1183), + /* 110 */ int16(1185), int16(1188), int16(1202), int16(1204), int16(1247), int16(1259), int16(1263), int16(1283), int16(1289), int16(1292), + /* 120 */ int16(1298), int16(1300), int16(1329), int16(1331), int16(1343), int16(1358), int16(1360), int16(-255), int16(-255), int16(-255), + /* 130 */ int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(196), int16(-255), int16(387), int16(-177), int16(507), + /* 140 */ int16(1002), int16(-219), int16(557), int16(-93), int16(-167), int16(638), int16(-121), int16(284), int16(500), int16(284), + /* 150 */ int16(500), int16(247), int16(651), int16(865), int16(-255), int16(-255), int16(-255), int16(-255), int16(-85), int16(-85), + /* 160 */ int16(-85), int16(237), int16(171), int16(602), int16(846), int16(885), int16(-212), int16(-203), int16(217), int16(380), + /* 170 */ int16(380), int16(-23), int16(161), int16(653), int16(712), int16(773), int16(943), int16(990), int16(1040), int16(563), + /* 180 */ int16(833), int16(971), int16(1005), int16(1042), int16(1092), int16(1078), int16(1043), int16(1144), int16(1184), int16(-186), + /* 190 */ int16(1105), int16(318), int16(869), int16(7), int16(825), int16(920), int16(1074), int16(704), int16(706), int16(390), + /* 200 */ int16(1087), int16(1094), int16(336), int16(545), int16(772), int16(1201), int16(1117), int16(1207), int16(-179), int16(-137), + /* 210 */ int16(-112), int16(-13), int16(18), int16(112), int16(197), int16(418), int16(495), int16(508), int16(777), int16(809), + /* 220 */ int16(923), int16(1014), int16(1027), int16(1033), int16(1044), int16(1115), int16(1194), int16(1212), int16(1221), int16(209), + /* 230 */ int16(1236), int16(1240), int16(1256), int16(1287), int16(1301), int16(1307), int16(1349), int16(1359), int16(1398), int16(1417), + /* 240 */ int16(1429), int16(1434), int16(681), int16(1377), int16(1404), int16(1448), int16(1449), int16(1450), int16(1388), int16(1453), + /* 250 */ int16(1455), int16(1458), int16(1393), int16(1335), int16(1461), int16(1462), int16(1418), int16(1463), int16(197), int16(1464), + /* 260 */ int16(1465), int16(1466), int16(1467), int16(1468), int16(1469), int16(1376), int16(1378), int16(1424), int16(1412), int16(1413), + /* 270 */ int16(1414), int16(1415), int16(1388), int16(1424), int16(1424), int16(1428), int16(1470), int16(1485), int16(1381), int16(1408), + /* 280 */ int16(1416), int16(1436), int16(1431), int16(1422), int16(1432), int16(1392), int16(1446), int16(1411), int16(1427), int16(1456), + /* 290 */ int16(1433), int16(1471), int16(1401), int16(1479), int16(1472), int16(1478), int16(1486), int16(1491), int16(1493), int16(1452), + /* 300 */ int16(1459), int16(1473), int16(1437), int16(1475), int16(1476), int16(1516), int16(1421), int16(1440), int16(1520), int16(1524), + /* 310 */ int16(1444), int16(1445), int16(1525), int16(1457), int16(1480), int16(1481), int16(1509), int16(1510), int16(1511), int16(1512), + /* 320 */ int16(1513), int16(1553), int16(1555), int16(1515), int16(1487), int16(1488), int16(1518), int16(1495), int16(1522), int16(1523), + /* 330 */ int16(1528), int16(1527), int16(1562), int16(1566), int16(1482), int16(1494), int16(1569), int16(1574), int16(1559), int16(1575), + /* 340 */ int16(1582), int16(1583), int16(1585), int16(1560), int16(1568), int16(1570), int16(1571), int16(1563), int16(1573), int16(1586), + /* 350 */ int16(1584), int16(1588), int16(1589), int16(1593), int16(1590), int16(1594), int16(1598), int16(1501), int16(1496), int16(1536), + /* 360 */ int16(1537), int16(1599), int16(1561), int16(1567), int16(1587), int16(1591), int16(1592), int16(1597), int16(1604), int16(1607), + /* 370 */ int16(1629), int16(1519), int16(1521), int16(1601), int16(1609), int16(1600), int16(1610), int16(1558), int16(1636), int16(1565), + /* 380 */ int16(1618), int16(1621), int16(1611), int16(1624), int16(1648), int16(1652), int16(1676), int16(1677), int16(1687), int16(1688), + /* 390 */ int16(1689), int16(1613), int16(1614), int16(1615), int16(1668), int16(1663), int16(1665), int16(1666), int16(1670), int16(1678), + /* 400 */ int16(1655), int16(1662), int16(1672), int16(1673), int16(1675), int16(1690), +} /* sqlite3.c:157958:20 */ +var yy_default = [570]uint16{ + /* 0 */ uint16(1623), uint16(1623), uint16(1623), uint16(1453), uint16(1223), uint16(1332), uint16(1223), uint16(1223), uint16(1223), uint16(1453), + /* 10 */ uint16(1453), uint16(1453), uint16(1223), uint16(1362), uint16(1362), uint16(1506), uint16(1254), uint16(1223), uint16(1223), uint16(1223), + /* 20 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1452), uint16(1223), uint16(1223), + /* 30 */ uint16(1223), uint16(1223), uint16(1541), uint16(1541), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 40 */ uint16(1223), uint16(1223), uint16(1371), uint16(1223), uint16(1378), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 50 */ uint16(1454), uint16(1455), uint16(1223), uint16(1223), uint16(1223), uint16(1505), uint16(1507), uint16(1470), uint16(1385), uint16(1384), + /* 60 */ uint16(1383), uint16(1382), uint16(1488), uint16(1349), uint16(1376), uint16(1369), uint16(1373), uint16(1448), uint16(1449), uint16(1447), + /* 70 */ uint16(1451), uint16(1455), uint16(1454), uint16(1223), uint16(1372), uint16(1419), uint16(1433), uint16(1418), uint16(1223), uint16(1223), + /* 80 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 90 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 100 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 110 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 120 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1427), uint16(1432), uint16(1438), + /* 130 */ uint16(1431), uint16(1428), uint16(1421), uint16(1420), uint16(1422), uint16(1223), uint16(1423), uint16(1223), uint16(1223), uint16(1223), + /* 140 */ uint16(1244), uint16(1296), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1525), uint16(1524), uint16(1223), + /* 150 */ uint16(1223), uint16(1254), uint16(1413), uint16(1412), uint16(1424), uint16(1425), uint16(1435), uint16(1434), uint16(1513), uint16(1576), + /* 160 */ uint16(1575), uint16(1471), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1541), uint16(1223), + /* 170 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 180 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 190 */ uint16(1223), uint16(1541), uint16(1541), uint16(1223), uint16(1254), uint16(1541), uint16(1541), uint16(1250), uint16(1250), uint16(1356), + /* 200 */ uint16(1223), uint16(1520), uint16(1323), uint16(1323), uint16(1323), uint16(1323), uint16(1332), uint16(1323), uint16(1223), uint16(1223), + /* 210 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 220 */ uint16(1223), uint16(1223), uint16(1223), uint16(1510), uint16(1508), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 230 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 240 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 250 */ uint16(1223), uint16(1223), uint16(1328), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 260 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1570), uint16(1223), uint16(1483), uint16(1310), uint16(1328), uint16(1328), + /* 270 */ uint16(1328), uint16(1328), uint16(1330), uint16(1311), uint16(1309), uint16(1322), uint16(1255), uint16(1230), uint16(1615), uint16(1388), + /* 280 */ uint16(1377), uint16(1329), uint16(1351), uint16(1377), uint16(1351), uint16(1612), uint16(1375), uint16(1388), uint16(1388), uint16(1375), + /* 290 */ uint16(1388), uint16(1329), uint16(1612), uint16(1271), uint16(1592), uint16(1266), uint16(1362), uint16(1362), uint16(1362), uint16(1351), + /* 300 */ uint16(1356), uint16(1356), uint16(1450), uint16(1329), uint16(1322), uint16(1223), uint16(1615), uint16(1615), uint16(1337), uint16(1337), + /* 310 */ uint16(1614), uint16(1614), uint16(1337), uint16(1471), uint16(1599), uint16(1397), uint16(1299), uint16(1305), uint16(1305), uint16(1305), + /* 320 */ uint16(1305), uint16(1337), uint16(1241), uint16(1375), uint16(1599), uint16(1599), uint16(1375), uint16(1397), uint16(1299), uint16(1375), + /* 330 */ uint16(1299), uint16(1375), uint16(1337), uint16(1241), uint16(1487), uint16(1609), uint16(1337), uint16(1241), uint16(1461), uint16(1337), + /* 340 */ uint16(1241), uint16(1337), uint16(1241), uint16(1461), uint16(1297), uint16(1297), uint16(1297), uint16(1286), uint16(1223), uint16(1223), + /* 350 */ uint16(1461), uint16(1297), uint16(1271), uint16(1297), uint16(1286), uint16(1297), uint16(1297), uint16(1559), uint16(1223), uint16(1465), + /* 360 */ uint16(1465), uint16(1461), uint16(1355), uint16(1350), uint16(1355), uint16(1350), uint16(1355), uint16(1350), uint16(1355), uint16(1350), + /* 370 */ uint16(1337), uint16(1551), uint16(1551), uint16(1365), uint16(1365), uint16(1370), uint16(1356), uint16(1456), uint16(1337), uint16(1223), + /* 380 */ uint16(1370), uint16(1368), uint16(1366), uint16(1375), uint16(1247), uint16(1289), uint16(1573), uint16(1573), uint16(1569), uint16(1569), + /* 390 */ uint16(1569), uint16(1620), uint16(1620), uint16(1520), uint16(1585), uint16(1254), uint16(1254), uint16(1254), uint16(1254), uint16(1585), + /* 400 */ uint16(1273), uint16(1273), uint16(1255), uint16(1255), uint16(1254), uint16(1585), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 410 */ uint16(1223), uint16(1223), uint16(1580), uint16(1223), uint16(1515), uint16(1472), uint16(1341), uint16(1223), uint16(1223), uint16(1223), + /* 420 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 430 */ uint16(1223), uint16(1526), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 440 */ uint16(1223), uint16(1223), uint16(1402), uint16(1223), uint16(1226), uint16(1517), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 450 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1379), uint16(1380), uint16(1342), uint16(1223), uint16(1223), uint16(1223), + /* 460 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1394), uint16(1223), uint16(1223), uint16(1223), uint16(1389), uint16(1223), + /* 470 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1611), uint16(1223), uint16(1223), + /* 480 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1486), uint16(1485), uint16(1223), uint16(1223), uint16(1339), uint16(1223), + /* 490 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 500 */ uint16(1223), uint16(1223), uint16(1269), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 510 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 520 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1367), uint16(1223), uint16(1223), uint16(1223), + /* 530 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 540 */ uint16(1223), uint16(1556), uint16(1357), uint16(1223), uint16(1223), uint16(1602), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 550 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 560 */ uint16(1596), uint16(1313), uint16(1404), uint16(1223), uint16(1403), uint16(1407), uint16(1223), uint16(1235), uint16(1223), uint16(1223), +} /* sqlite3.c:158001:27 */ //********* End of lemon-generated parsing tables **************************** // The next table maps tokens (terminal symbols) into fallback tokens. @@ -135475,7 +137839,7 @@ var yy_default = [553]uint16{ // This feature can be used, for example, to cause some keywords in a language // to revert to identifiers if they keyword does not apply in the context where // it appears. -var yyFallback = [181]uint16{ +var yyFallback = [183]uint16{ uint16(0), // $ => nothing uint16(0), // SEMI => nothing uint16(59), // EXPLAIN => ID @@ -135573,6 +137937,7 @@ var yyFallback = [181]uint16{ uint16(59), // TIES => ID uint16(59), // GENERATED => ID uint16(59), // ALWAYS => ID + uint16(59), // MATERIALIZED => ID uint16(59), // REINDEX => ID uint16(59), // RENAME => ID uint16(59), // CTIME_KW => ID @@ -135624,6 +137989,7 @@ var yyFallback = [181]uint16{ uint16(0), // HAVING => nothing uint16(0), // LIMIT => nothing uint16(0), // WHERE => nothing + uint16(0), // RETURNING => nothing uint16(0), // INTO => nothing uint16(0), // NOTHING => nothing uint16(0), // FLOAT => nothing @@ -135657,7 +138023,7 @@ var yyFallback = [181]uint16{ uint16(0), // SPAN => nothing uint16(0), // SPACE => nothing uint16(0), // ILLEGAL => nothing -} /* sqlite3.c:155196:25 */ +} /* sqlite3.c:158077:25 */ // The following structure represents a single element of the // parser's stack. Information stored includes: @@ -135679,9 +138045,9 @@ type yyStackEntry = struct { Fmajor uint16 _ [4]byte Fminor YYMINORTYPE -} /* sqlite3.c:155397:1 */ +} /* sqlite3.c:158280:1 */ -type YyStackEntry = yyStackEntry /* sqlite3.c:155404:29 */ +type YyStackEntry = yyStackEntry /* sqlite3.c:158287:29 */ // The state of the parser is completely contained in an instance of // the following structure @@ -135690,9 +138056,9 @@ type yyParser = struct { FpParse uintptr Fyystack [100]YyStackEntry FyystackEnd uintptr -} /* sqlite3.c:155408:1 */ +} /* sqlite3.c:158291:1 */ -type YyParser = yyParser /* sqlite3.c:155427:25 */ +type YyParser = yyParser /* sqlite3.c:158310:25 */ // Datatype of the argument to the memory allocated passed as the // second argument to sqlite3ParserAlloc() below. This can be changed by @@ -135700,7 +138066,7 @@ type YyParser = yyParser /* sqlite3.c:155427:25 */ // grammar. // Initialize a new parser that has already been allocated. -func Xsqlite3ParserInit(tls *libc.TLS, yypRawParser uintptr, pParse uintptr) { /* sqlite3.c:156215:21: */ +func Xsqlite3ParserInit(tls *libc.TLS, yypRawParser uintptr, pParse uintptr) { /* sqlite3.c:159118:21: */ var yypParser uintptr = yypRawParser (*YyParser)(unsafe.Pointer(yypParser)).FpParse = pParse (*YyParser)(unsafe.Pointer(yypParser)).Fyytos = yypParser + 16 /* &.yystack */ @@ -135715,7 +138081,7 @@ func Xsqlite3ParserInit(tls *libc.TLS, yypRawParser uintptr, pParse uintptr) { / // 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 *libc.TLS, yypParser uintptr, yymajor uint16, yypminor uintptr) { /* sqlite3.c:156273:13: */ +func yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor uintptr) { /* sqlite3.c:159176:13: */ var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse switch int32(yymajor) { @@ -135729,135 +138095,137 @@ func yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor ui // which appear on the RHS of the rule, but which are *not* used // inside the C code. //******** Begin destructor definitions ************************************** - case 200: + case 202: fallthrough // select - case 234: + case 236: fallthrough // selectnowith - case 235: + case 237: fallthrough // oneselect - case 247: /* values */ + case 249: /* values */ { - Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy539 */))) + Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy307 */))) } break - case 211: + case 213: fallthrough // term - case 212: + case 214: fallthrough // expr - case 241: - fallthrough // where_opt case 243: + fallthrough // where_opt + case 245: fallthrough // having_opt - case 255: - fallthrough // on_opt - case 271: - fallthrough // case_operand - case 273: - fallthrough // case_else - case 276: - fallthrough // vinto - case 283: - fallthrough // when_clause - case 288: - fallthrough // key_opt - case 302: /* filter_clause */ - { - Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy202 */))) - } - break - case 216: - fallthrough // eidlist_opt - case 226: - fallthrough // sortlist - case 227: - fallthrough // eidlist - case 239: - fallthrough // selcollist - case 242: - fallthrough // groupby_opt - case 244: - fallthrough // orderby_opt - case 248: - fallthrough // nexprlist - case 249: - fallthrough // sclp case 257: - fallthrough // exprlist - case 262: - fallthrough // setlist - case 270: - fallthrough // paren_exprlist - case 272: - fallthrough // case_exprlist - case 301: /* part_opt */ + fallthrough // on_opt + case 264: + fallthrough // where_opt_ret + case 275: + fallthrough // case_operand + case 277: + fallthrough // case_else + case 280: + fallthrough // vinto + case 287: + fallthrough // when_clause + case 292: + fallthrough // key_opt + case 308: /* filter_clause */ { - Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy242 */))) - } - break - case 233: - fallthrough // fullname - case 240: - fallthrough // from - case 251: - fallthrough // seltablist - case 252: - fallthrough // stl_prefix - case 258: /* xfullname */ - { - Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy47 */))) - } - break - case 236: /* wqlist */ - { - Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy131 */))) + Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy602 */))) } break + case 218: + fallthrough // eidlist_opt + case 228: + fallthrough // sortlist + case 229: + fallthrough // eidlist + case 241: + fallthrough // selcollist + case 244: + fallthrough // groupby_opt case 246: - fallthrough // window_clause - case 297: /* windowdefn_list */ - { - Xsqlite3WindowListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy303 */))) - } - break - case 256: - fallthrough // using_opt + fallthrough // orderby_opt + case 250: + fallthrough // nexprlist + case 251: + fallthrough // sclp case 259: + fallthrough // exprlist + case 265: + fallthrough // setlist + case 274: + fallthrough // paren_exprlist + case 276: + fallthrough // case_exprlist + case 307: /* part_opt */ + { + Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy338 */))) + } + break + case 235: + fallthrough // fullname + case 242: + fallthrough // from + case 253: + fallthrough // seltablist + case 254: + fallthrough // stl_prefix + case 260: /* xfullname */ + { + Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy291 */))) + } + break + case 238: /* wqlist */ + { + Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy195 */))) + } + break + case 248: + fallthrough // window_clause + case 303: /* windowdefn_list */ + { + Xsqlite3WindowListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy19 */))) + } + break + case 258: + fallthrough // using_opt + case 261: fallthrough // idlist - case 264: /* idlist_opt */ + case 267: /* idlist_opt */ { - Xsqlite3IdListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy600 */))) + Xsqlite3IdListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy288 */))) } break - case 266: + case 270: fallthrough // filter_over - case 298: + case 304: fallthrough // windowdefn - case 299: + case 305: fallthrough // window - case 300: + case 306: fallthrough // frame_opt - case 303: /* over_clause */ + case 309: /* over_clause */ { - Xsqlite3WindowDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy303 */))) + Xsqlite3WindowDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy19 */))) } break - case 279: + case 283: fallthrough // trigger_cmd_list - case 284: /* trigger_cmd */ + case 288: /* trigger_cmd */ { - Xsqlite3DeleteTriggerStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy447 */))) + Xsqlite3DeleteTriggerStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy483 */))) } break - case 281: /* trigger_event */ + case 285: /* trigger_event */ { Xsqlite3IdListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*TrigEvent)(unsafe.Pointer(yypminor)).Fb) } break - case 305: + case 311: fallthrough // frame_bound - case 306: + case 312: fallthrough // frame_bound_s - case 307: /* frame_bound_e */ + case 313: /* frame_bound_e */ { Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*FrameBound)(unsafe.Pointer(yypminor)).FpExpr) } @@ -135872,7 +138240,7 @@ func yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor ui // // 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 *libc.TLS, pParser uintptr) { /* sqlite3.c:156397:13: */ +func yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:159301:13: */ var yytos uintptr yytos = libc.PostDecUintptr(&(*YyParser)(unsafe.Pointer(pParser)).Fyytos, 24) @@ -135880,7 +138248,7 @@ func yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:156397:1 } // Clear all secondary memory allocations from the parser -func Xsqlite3ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:156415:21: */ +func Xsqlite3ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:159319:21: */ var pParser uintptr = p for (*YyParser)(unsafe.Pointer(pParser)).Fyytos > pParser+16 /* &.yystack */ { yy_pop_parser_stack(tls, pParser) @@ -135903,7 +138271,7 @@ func Xsqlite3ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:156415:21: // Find the appropriate action for a parser given the terminal // look-ahead token iLookAhead. -func yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) uint16 { /* sqlite3.c:156495:21: */ +func yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) uint16 { /* sqlite3.c:159399:21: */ var i int32 if int32(stateno) > YY_MAX_SHIFT { @@ -135943,7 +138311,7 @@ func yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) uint // Find the appropriate action for a parser given the non-terminal // look-ahead token iLookAhead. -func yy_find_reduce_action(tls *libc.TLS, stateno uint16, iLookAhead uint16) uint16 { /* sqlite3.c:156560:21: */ +func yy_find_reduce_action(tls *libc.TLS, stateno uint16, iLookAhead uint16) uint16 { /* sqlite3.c:159464:21: */ var i int32 i = int32(yy_reduce_ofst[stateno]) @@ -135954,7 +138322,7 @@ func yy_find_reduce_action(tls *libc.TLS, stateno uint16, iLookAhead uint16) uin } // The following routine is called if the stack overflows. -func yyStackOverflow(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:156589:13: */ +func yyStackOverflow(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:159493:13: */ var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse for (*YyParser)(unsafe.Pointer(yypParser)).Fyytos > yypParser+16 /* &.yystack */ { @@ -135964,7 +138332,7 @@ func yyStackOverflow(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:156589:13: // stack every overflows //******* Begin %stack_overflow code ***************************************** - Xsqlite3ErrorMsg(tls, pParse, ts+20183 /* "parser stack ove..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+20707 /* "parser stack ove..." */, 0) //******* End %stack_overflow code ******************************************* (*YyParser)(unsafe.Pointer(yypParser)).FpParse = pParse @@ -135973,7 +138341,7 @@ func yyStackOverflow(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:156589:13: // Print tracing information for a SHIFT action // Perform a shift action. -func yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint16, yyMinor Token) { /* sqlite3.c:156632:13: */ +func yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint16, yyMinor Token) { /* sqlite3.c:159536:13: */ var yytos uintptr (*YyParser)(unsafe.Pointer(yypParser)).Fyytos += 24 if (*YyParser)(unsafe.Pointer(yypParser)).Fyytos > (*YyParser)(unsafe.Pointer(yypParser)).FyystackEnd { @@ -135993,397 +138361,410 @@ func yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint1 // For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side // of that rule -var yyRuleInfoLhs = [385]uint16{ - uint16(185), // (0) explain ::= EXPLAIN - uint16(185), // (1) explain ::= EXPLAIN QUERY PLAN - uint16(184), // (2) cmdx ::= cmd - uint16(186), // (3) cmd ::= BEGIN transtype trans_opt - uint16(187), // (4) transtype ::= - uint16(187), // (5) transtype ::= DEFERRED - uint16(187), // (6) transtype ::= IMMEDIATE - uint16(187), // (7) transtype ::= EXCLUSIVE - uint16(186), // (8) cmd ::= COMMIT|END trans_opt - uint16(186), // (9) cmd ::= ROLLBACK trans_opt - uint16(186), // (10) cmd ::= SAVEPOINT nm - uint16(186), // (11) cmd ::= RELEASE savepoint_opt nm - uint16(186), // (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm - uint16(191), // (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm - uint16(193), // (14) createkw ::= CREATE - uint16(195), // (15) ifnotexists ::= - uint16(195), // (16) ifnotexists ::= IF NOT EXISTS - uint16(194), // (17) temp ::= TEMP - uint16(194), // (18) temp ::= - uint16(192), // (19) create_table_args ::= LP columnlist conslist_opt RP table_options - uint16(192), // (20) create_table_args ::= AS select - uint16(199), // (21) table_options ::= - uint16(199), // (22) table_options ::= WITHOUT nm - uint16(201), // (23) columnname ::= nm typetoken - uint16(203), // (24) typetoken ::= - uint16(203), // (25) typetoken ::= typename LP signed RP - uint16(203), // (26) typetoken ::= typename LP signed COMMA signed RP - uint16(204), // (27) typename ::= typename ID|STRING - uint16(208), // (28) scanpt ::= - uint16(209), // (29) scantok ::= - uint16(210), // (30) ccons ::= CONSTRAINT nm - uint16(210), // (31) ccons ::= DEFAULT scantok term - uint16(210), // (32) ccons ::= DEFAULT LP expr RP - uint16(210), // (33) ccons ::= DEFAULT PLUS scantok term - uint16(210), // (34) ccons ::= DEFAULT MINUS scantok term - uint16(210), // (35) ccons ::= DEFAULT scantok ID|INDEXED - uint16(210), // (36) ccons ::= NOT NULL onconf - uint16(210), // (37) ccons ::= PRIMARY KEY sortorder onconf autoinc - uint16(210), // (38) ccons ::= UNIQUE onconf - uint16(210), // (39) ccons ::= CHECK LP expr RP - uint16(210), // (40) ccons ::= REFERENCES nm eidlist_opt refargs - uint16(210), // (41) ccons ::= defer_subclause - uint16(210), // (42) ccons ::= COLLATE ID|STRING - uint16(219), // (43) generated ::= LP expr RP - uint16(219), // (44) generated ::= LP expr RP ID - uint16(215), // (45) autoinc ::= - uint16(215), // (46) autoinc ::= AUTOINCR - uint16(217), // (47) refargs ::= - uint16(217), // (48) refargs ::= refargs refarg - uint16(220), // (49) refarg ::= MATCH nm - uint16(220), // (50) refarg ::= ON INSERT refact - uint16(220), // (51) refarg ::= ON DELETE refact - uint16(220), // (52) refarg ::= ON UPDATE refact - uint16(221), // (53) refact ::= SET NULL - uint16(221), // (54) refact ::= SET DEFAULT - uint16(221), // (55) refact ::= CASCADE - uint16(221), // (56) refact ::= RESTRICT - uint16(221), // (57) refact ::= NO ACTION - uint16(218), // (58) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt - uint16(218), // (59) defer_subclause ::= DEFERRABLE init_deferred_pred_opt - uint16(222), // (60) init_deferred_pred_opt ::= - uint16(222), // (61) init_deferred_pred_opt ::= INITIALLY DEFERRED - uint16(222), // (62) init_deferred_pred_opt ::= INITIALLY IMMEDIATE - uint16(198), // (63) conslist_opt ::= - uint16(224), // (64) tconscomma ::= COMMA - uint16(225), // (65) tcons ::= CONSTRAINT nm - uint16(225), // (66) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf - uint16(225), // (67) tcons ::= UNIQUE LP sortlist RP onconf - uint16(225), // (68) tcons ::= CHECK LP expr RP onconf - uint16(225), // (69) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt - uint16(228), // (70) defer_subclause_opt ::= - uint16(213), // (71) onconf ::= - uint16(213), // (72) onconf ::= ON CONFLICT resolvetype - uint16(229), // (73) orconf ::= - uint16(229), // (74) orconf ::= OR resolvetype - uint16(230), // (75) resolvetype ::= IGNORE - uint16(230), // (76) resolvetype ::= REPLACE - uint16(186), // (77) cmd ::= DROP TABLE ifexists fullname - uint16(232), // (78) ifexists ::= IF EXISTS - uint16(232), // (79) ifexists ::= - uint16(186), // (80) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select - uint16(186), // (81) cmd ::= DROP VIEW ifexists fullname - uint16(186), // (82) cmd ::= select - uint16(200), // (83) select ::= WITH wqlist selectnowith - uint16(200), // (84) select ::= WITH RECURSIVE wqlist selectnowith - uint16(200), // (85) select ::= selectnowith - uint16(234), // (86) selectnowith ::= selectnowith multiselect_op oneselect - uint16(237), // (87) multiselect_op ::= UNION - uint16(237), // (88) multiselect_op ::= UNION ALL - uint16(237), // (89) multiselect_op ::= EXCEPT|INTERSECT - uint16(235), // (90) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt - uint16(235), // (91) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt - uint16(247), // (92) values ::= VALUES LP nexprlist RP - uint16(247), // (93) values ::= values COMMA LP nexprlist RP - uint16(238), // (94) distinct ::= DISTINCT - uint16(238), // (95) distinct ::= ALL - uint16(238), // (96) distinct ::= - uint16(249), // (97) sclp ::= - uint16(239), // (98) selcollist ::= sclp scanpt expr scanpt as - uint16(239), // (99) selcollist ::= sclp scanpt STAR - uint16(239), // (100) selcollist ::= sclp scanpt nm DOT STAR - uint16(250), // (101) as ::= AS nm - uint16(250), // (102) as ::= - uint16(240), // (103) from ::= - uint16(240), // (104) from ::= FROM seltablist - uint16(252), // (105) stl_prefix ::= seltablist joinop - uint16(252), // (106) stl_prefix ::= - uint16(251), // (107) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt - uint16(251), // (108) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt - uint16(251), // (109) seltablist ::= stl_prefix LP select RP as on_opt using_opt - uint16(251), // (110) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt - uint16(196), // (111) dbnm ::= - uint16(196), // (112) dbnm ::= DOT nm - uint16(233), // (113) fullname ::= nm - uint16(233), // (114) fullname ::= nm DOT nm - uint16(258), // (115) xfullname ::= nm - uint16(258), // (116) xfullname ::= nm DOT nm - uint16(258), // (117) xfullname ::= nm DOT nm AS nm - uint16(258), // (118) xfullname ::= nm AS nm - uint16(253), // (119) joinop ::= COMMA|JOIN - uint16(253), // (120) joinop ::= JOIN_KW JOIN - uint16(253), // (121) joinop ::= JOIN_KW nm JOIN - uint16(253), // (122) joinop ::= JOIN_KW nm nm JOIN - uint16(255), // (123) on_opt ::= ON expr - uint16(255), // (124) on_opt ::= - uint16(254), // (125) indexed_opt ::= - uint16(254), // (126) indexed_opt ::= INDEXED BY nm - uint16(254), // (127) indexed_opt ::= NOT INDEXED - uint16(256), // (128) using_opt ::= USING LP idlist RP - uint16(256), // (129) using_opt ::= - uint16(244), // (130) orderby_opt ::= - uint16(244), // (131) orderby_opt ::= ORDER BY sortlist - uint16(226), // (132) sortlist ::= sortlist COMMA expr sortorder nulls - uint16(226), // (133) sortlist ::= expr sortorder nulls - uint16(214), // (134) sortorder ::= ASC - uint16(214), // (135) sortorder ::= DESC - uint16(214), // (136) sortorder ::= - uint16(260), // (137) nulls ::= NULLS FIRST - uint16(260), // (138) nulls ::= NULLS LAST - uint16(260), // (139) nulls ::= - uint16(242), // (140) groupby_opt ::= - uint16(242), // (141) groupby_opt ::= GROUP BY nexprlist - uint16(243), // (142) having_opt ::= - uint16(243), // (143) having_opt ::= HAVING expr - uint16(245), // (144) limit_opt ::= - uint16(245), // (145) limit_opt ::= LIMIT expr - uint16(245), // (146) limit_opt ::= LIMIT expr OFFSET expr - uint16(245), // (147) limit_opt ::= LIMIT expr COMMA expr - uint16(186), // (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt - uint16(241), // (149) where_opt ::= - uint16(241), // (150) where_opt ::= WHERE expr - uint16(186), // (151) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt - uint16(262), // (152) setlist ::= setlist COMMA nm EQ expr - uint16(262), // (153) setlist ::= setlist COMMA LP idlist RP EQ expr - uint16(262), // (154) setlist ::= nm EQ expr - uint16(262), // (155) setlist ::= LP idlist RP EQ expr - uint16(186), // (156) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert - uint16(186), // (157) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES - uint16(265), // (158) upsert ::= - uint16(265), // (159) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt - uint16(265), // (160) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING - uint16(265), // (161) upsert ::= ON CONFLICT DO NOTHING - uint16(263), // (162) insert_cmd ::= INSERT orconf - uint16(263), // (163) insert_cmd ::= REPLACE - uint16(264), // (164) idlist_opt ::= - uint16(264), // (165) idlist_opt ::= LP idlist RP - uint16(259), // (166) idlist ::= idlist COMMA nm - uint16(259), // (167) idlist ::= nm - uint16(212), // (168) expr ::= LP expr RP - uint16(212), // (169) expr ::= ID|INDEXED - uint16(212), // (170) expr ::= JOIN_KW - uint16(212), // (171) expr ::= nm DOT nm - uint16(212), // (172) expr ::= nm DOT nm DOT nm - uint16(211), // (173) term ::= NULL|FLOAT|BLOB - uint16(211), // (174) term ::= STRING - uint16(211), // (175) term ::= INTEGER - uint16(212), // (176) expr ::= VARIABLE - uint16(212), // (177) expr ::= expr COLLATE ID|STRING - uint16(212), // (178) expr ::= CAST LP expr AS typetoken RP - uint16(212), // (179) expr ::= ID|INDEXED LP distinct exprlist RP - uint16(212), // (180) expr ::= ID|INDEXED LP STAR RP - uint16(212), // (181) expr ::= ID|INDEXED LP distinct exprlist RP filter_over - uint16(212), // (182) expr ::= ID|INDEXED LP STAR RP filter_over - uint16(211), // (183) term ::= CTIME_KW - uint16(212), // (184) expr ::= LP nexprlist COMMA expr RP - uint16(212), // (185) expr ::= expr AND expr - uint16(212), // (186) expr ::= expr OR expr - uint16(212), // (187) expr ::= expr LT|GT|GE|LE expr - uint16(212), // (188) expr ::= expr EQ|NE expr - uint16(212), // (189) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr - uint16(212), // (190) expr ::= expr PLUS|MINUS expr - uint16(212), // (191) expr ::= expr STAR|SLASH|REM expr - uint16(212), // (192) expr ::= expr CONCAT expr - uint16(267), // (193) likeop ::= NOT LIKE_KW|MATCH - uint16(212), // (194) expr ::= expr likeop expr - uint16(212), // (195) expr ::= expr likeop expr ESCAPE expr - uint16(212), // (196) expr ::= expr ISNULL|NOTNULL - uint16(212), // (197) expr ::= expr NOT NULL - uint16(212), // (198) expr ::= expr IS expr - uint16(212), // (199) expr ::= expr IS NOT expr - uint16(212), // (200) expr ::= NOT expr - uint16(212), // (201) expr ::= BITNOT expr - uint16(212), // (202) expr ::= PLUS|MINUS expr - uint16(268), // (203) between_op ::= BETWEEN - uint16(268), // (204) between_op ::= NOT BETWEEN - uint16(212), // (205) expr ::= expr between_op expr AND expr - uint16(269), // (206) in_op ::= IN - uint16(269), // (207) in_op ::= NOT IN - uint16(212), // (208) expr ::= expr in_op LP exprlist RP - uint16(212), // (209) expr ::= LP select RP - uint16(212), // (210) expr ::= expr in_op LP select RP - uint16(212), // (211) expr ::= expr in_op nm dbnm paren_exprlist - uint16(212), // (212) expr ::= EXISTS LP select RP - uint16(212), // (213) expr ::= CASE case_operand case_exprlist case_else END - uint16(272), // (214) case_exprlist ::= case_exprlist WHEN expr THEN expr - uint16(272), // (215) case_exprlist ::= WHEN expr THEN expr - uint16(273), // (216) case_else ::= ELSE expr - uint16(273), // (217) case_else ::= - uint16(271), // (218) case_operand ::= expr - uint16(271), // (219) case_operand ::= - uint16(257), // (220) exprlist ::= - uint16(248), // (221) nexprlist ::= nexprlist COMMA expr - uint16(248), // (222) nexprlist ::= expr - uint16(270), // (223) paren_exprlist ::= - uint16(270), // (224) paren_exprlist ::= LP exprlist RP - uint16(186), // (225) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt - uint16(274), // (226) uniqueflag ::= UNIQUE - uint16(274), // (227) uniqueflag ::= - uint16(216), // (228) eidlist_opt ::= - uint16(216), // (229) eidlist_opt ::= LP eidlist RP - uint16(227), // (230) eidlist ::= eidlist COMMA nm collate sortorder - uint16(227), // (231) eidlist ::= nm collate sortorder - uint16(275), // (232) collate ::= - uint16(275), // (233) collate ::= COLLATE ID|STRING - uint16(186), // (234) cmd ::= DROP INDEX ifexists fullname - uint16(186), // (235) cmd ::= VACUUM vinto - uint16(186), // (236) cmd ::= VACUUM nm vinto - uint16(276), // (237) vinto ::= INTO expr - uint16(276), // (238) vinto ::= - uint16(186), // (239) cmd ::= PRAGMA nm dbnm - uint16(186), // (240) cmd ::= PRAGMA nm dbnm EQ nmnum - uint16(186), // (241) cmd ::= PRAGMA nm dbnm LP nmnum RP - uint16(186), // (242) cmd ::= PRAGMA nm dbnm EQ minus_num - uint16(186), // (243) cmd ::= PRAGMA nm dbnm LP minus_num RP - uint16(206), // (244) plus_num ::= PLUS INTEGER|FLOAT - uint16(207), // (245) minus_num ::= MINUS INTEGER|FLOAT - uint16(186), // (246) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END - uint16(278), // (247) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause - uint16(280), // (248) trigger_time ::= BEFORE|AFTER - uint16(280), // (249) trigger_time ::= INSTEAD OF - uint16(280), // (250) trigger_time ::= - uint16(281), // (251) trigger_event ::= DELETE|INSERT - uint16(281), // (252) trigger_event ::= UPDATE - uint16(281), // (253) trigger_event ::= UPDATE OF idlist - uint16(283), // (254) when_clause ::= - uint16(283), // (255) when_clause ::= WHEN expr - uint16(279), // (256) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI - uint16(279), // (257) trigger_cmd_list ::= trigger_cmd SEMI - uint16(285), // (258) trnm ::= nm DOT nm - uint16(286), // (259) tridxby ::= INDEXED BY nm - uint16(286), // (260) tridxby ::= NOT INDEXED - uint16(284), // (261) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt - uint16(284), // (262) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt - uint16(284), // (263) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt - uint16(284), // (264) trigger_cmd ::= scanpt select scanpt - uint16(212), // (265) expr ::= RAISE LP IGNORE RP - uint16(212), // (266) expr ::= RAISE LP raisetype COMMA nm RP - uint16(231), // (267) raisetype ::= ROLLBACK - uint16(231), // (268) raisetype ::= ABORT - uint16(231), // (269) raisetype ::= FAIL - uint16(186), // (270) cmd ::= DROP TRIGGER ifexists fullname - uint16(186), // (271) cmd ::= ATTACH database_kw_opt expr AS expr key_opt - uint16(186), // (272) cmd ::= DETACH database_kw_opt expr - uint16(288), // (273) key_opt ::= - uint16(288), // (274) key_opt ::= KEY expr - uint16(186), // (275) cmd ::= REINDEX - uint16(186), // (276) cmd ::= REINDEX nm dbnm - uint16(186), // (277) cmd ::= ANALYZE - uint16(186), // (278) cmd ::= ANALYZE nm dbnm - uint16(186), // (279) cmd ::= ALTER TABLE fullname RENAME TO nm - uint16(186), // (280) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist - uint16(289), // (281) add_column_fullname ::= fullname - uint16(186), // (282) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm - uint16(186), // (283) cmd ::= create_vtab - uint16(186), // (284) cmd ::= create_vtab LP vtabarglist RP - uint16(291), // (285) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm - uint16(293), // (286) vtabarg ::= - uint16(294), // (287) vtabargtoken ::= ANY - uint16(294), // (288) vtabargtoken ::= lp anylist RP - uint16(295), // (289) lp ::= LP - uint16(261), // (290) with ::= WITH wqlist - uint16(261), // (291) with ::= WITH RECURSIVE wqlist - uint16(236), // (292) wqlist ::= nm eidlist_opt AS LP select RP - uint16(236), // (293) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP - uint16(297), // (294) windowdefn_list ::= windowdefn - uint16(297), // (295) windowdefn_list ::= windowdefn_list COMMA windowdefn - uint16(298), // (296) windowdefn ::= nm AS LP window RP - uint16(299), // (297) window ::= PARTITION BY nexprlist orderby_opt frame_opt - uint16(299), // (298) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt - uint16(299), // (299) window ::= ORDER BY sortlist frame_opt - uint16(299), // (300) window ::= nm ORDER BY sortlist frame_opt - uint16(299), // (301) window ::= frame_opt - uint16(299), // (302) window ::= nm frame_opt - uint16(300), // (303) frame_opt ::= - uint16(300), // (304) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt - uint16(300), // (305) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt - uint16(304), // (306) range_or_rows ::= RANGE|ROWS|GROUPS - uint16(306), // (307) frame_bound_s ::= frame_bound - uint16(306), // (308) frame_bound_s ::= UNBOUNDED PRECEDING - uint16(307), // (309) frame_bound_e ::= frame_bound - uint16(307), // (310) frame_bound_e ::= UNBOUNDED FOLLOWING - uint16(305), // (311) frame_bound ::= expr PRECEDING|FOLLOWING - uint16(305), // (312) frame_bound ::= CURRENT ROW - uint16(308), // (313) frame_exclude_opt ::= - uint16(308), // (314) frame_exclude_opt ::= EXCLUDE frame_exclude - uint16(309), // (315) frame_exclude ::= NO OTHERS - uint16(309), // (316) frame_exclude ::= CURRENT ROW - uint16(309), // (317) frame_exclude ::= GROUP|TIES - uint16(246), // (318) window_clause ::= WINDOW windowdefn_list - uint16(266), // (319) filter_over ::= filter_clause over_clause - uint16(266), // (320) filter_over ::= over_clause - uint16(266), // (321) filter_over ::= filter_clause - uint16(303), // (322) over_clause ::= OVER LP window RP - uint16(303), // (323) over_clause ::= OVER nm - uint16(302), // (324) filter_clause ::= FILTER LP WHERE expr RP - uint16(181), // (325) input ::= cmdlist - uint16(182), // (326) cmdlist ::= cmdlist ecmd - uint16(182), // (327) cmdlist ::= ecmd - uint16(183), // (328) ecmd ::= SEMI - uint16(183), // (329) ecmd ::= cmdx SEMI - uint16(183), // (330) ecmd ::= explain cmdx SEMI - uint16(188), // (331) trans_opt ::= - uint16(188), // (332) trans_opt ::= TRANSACTION - uint16(188), // (333) trans_opt ::= TRANSACTION nm - uint16(190), // (334) savepoint_opt ::= SAVEPOINT - uint16(190), // (335) savepoint_opt ::= - uint16(186), // (336) cmd ::= create_table create_table_args - uint16(197), // (337) columnlist ::= columnlist COMMA columnname carglist - uint16(197), // (338) columnlist ::= columnname carglist - uint16(189), // (339) nm ::= ID|INDEXED - uint16(189), // (340) nm ::= STRING - uint16(189), // (341) nm ::= JOIN_KW - uint16(203), // (342) typetoken ::= typename - uint16(204), // (343) typename ::= ID|STRING - uint16(205), // (344) signed ::= plus_num - uint16(205), // (345) signed ::= minus_num - uint16(202), // (346) carglist ::= carglist ccons - uint16(202), // (347) carglist ::= - uint16(210), // (348) ccons ::= NULL onconf - uint16(210), // (349) ccons ::= GENERATED ALWAYS AS generated - uint16(210), // (350) ccons ::= AS generated - uint16(198), // (351) conslist_opt ::= COMMA conslist - uint16(223), // (352) conslist ::= conslist tconscomma tcons - uint16(223), // (353) conslist ::= tcons - uint16(224), // (354) tconscomma ::= - uint16(228), // (355) defer_subclause_opt ::= defer_subclause - uint16(230), // (356) resolvetype ::= raisetype - uint16(234), // (357) selectnowith ::= oneselect - uint16(235), // (358) oneselect ::= values - uint16(249), // (359) sclp ::= selcollist COMMA - uint16(250), // (360) as ::= ID|STRING - uint16(212), // (361) expr ::= term - uint16(267), // (362) likeop ::= LIKE_KW|MATCH - uint16(257), // (363) exprlist ::= nexprlist - uint16(277), // (364) nmnum ::= plus_num - uint16(277), // (365) nmnum ::= nm - uint16(277), // (366) nmnum ::= ON - uint16(277), // (367) nmnum ::= DELETE - uint16(277), // (368) nmnum ::= DEFAULT - uint16(206), // (369) plus_num ::= INTEGER|FLOAT - uint16(282), // (370) foreach_clause ::= - uint16(282), // (371) foreach_clause ::= FOR EACH ROW - uint16(285), // (372) trnm ::= nm - uint16(286), // (373) tridxby ::= - uint16(287), // (374) database_kw_opt ::= DATABASE - uint16(287), // (375) database_kw_opt ::= - uint16(290), // (376) kwcolumn_opt ::= - uint16(290), // (377) kwcolumn_opt ::= COLUMNKW - uint16(292), // (378) vtabarglist ::= vtabarg - uint16(292), // (379) vtabarglist ::= vtabarglist COMMA vtabarg - uint16(293), // (380) vtabarg ::= vtabarg vtabargtoken - uint16(296), // (381) anylist ::= - uint16(296), // (382) anylist ::= anylist LP anylist RP - uint16(296), // (383) anylist ::= anylist ANY - uint16(261), // (384) with ::= -} /* sqlite3.c:156673:25 */ +var yyRuleInfoLhs = [398]uint16{ + uint16(187), // (0) explain ::= EXPLAIN + uint16(187), // (1) explain ::= EXPLAIN QUERY PLAN + uint16(186), // (2) cmdx ::= cmd + uint16(188), // (3) cmd ::= BEGIN transtype trans_opt + uint16(189), // (4) transtype ::= + uint16(189), // (5) transtype ::= DEFERRED + uint16(189), // (6) transtype ::= IMMEDIATE + uint16(189), // (7) transtype ::= EXCLUSIVE + uint16(188), // (8) cmd ::= COMMIT|END trans_opt + uint16(188), // (9) cmd ::= ROLLBACK trans_opt + uint16(188), // (10) cmd ::= SAVEPOINT nm + uint16(188), // (11) cmd ::= RELEASE savepoint_opt nm + uint16(188), // (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm + uint16(193), // (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm + uint16(195), // (14) createkw ::= CREATE + uint16(197), // (15) ifnotexists ::= + uint16(197), // (16) ifnotexists ::= IF NOT EXISTS + uint16(196), // (17) temp ::= TEMP + uint16(196), // (18) temp ::= + uint16(194), // (19) create_table_args ::= LP columnlist conslist_opt RP table_options + uint16(194), // (20) create_table_args ::= AS select + uint16(201), // (21) table_options ::= + uint16(201), // (22) table_options ::= WITHOUT nm + uint16(203), // (23) columnname ::= nm typetoken + uint16(205), // (24) typetoken ::= + uint16(205), // (25) typetoken ::= typename LP signed RP + uint16(205), // (26) typetoken ::= typename LP signed COMMA signed RP + uint16(206), // (27) typename ::= typename ID|STRING + uint16(210), // (28) scanpt ::= + uint16(211), // (29) scantok ::= + uint16(212), // (30) ccons ::= CONSTRAINT nm + uint16(212), // (31) ccons ::= DEFAULT scantok term + uint16(212), // (32) ccons ::= DEFAULT LP expr RP + uint16(212), // (33) ccons ::= DEFAULT PLUS scantok term + uint16(212), // (34) ccons ::= DEFAULT MINUS scantok term + uint16(212), // (35) ccons ::= DEFAULT scantok ID|INDEXED + uint16(212), // (36) ccons ::= NOT NULL onconf + uint16(212), // (37) ccons ::= PRIMARY KEY sortorder onconf autoinc + uint16(212), // (38) ccons ::= UNIQUE onconf + uint16(212), // (39) ccons ::= CHECK LP expr RP + uint16(212), // (40) ccons ::= REFERENCES nm eidlist_opt refargs + uint16(212), // (41) ccons ::= defer_subclause + uint16(212), // (42) ccons ::= COLLATE ID|STRING + uint16(221), // (43) generated ::= LP expr RP + uint16(221), // (44) generated ::= LP expr RP ID + uint16(217), // (45) autoinc ::= + uint16(217), // (46) autoinc ::= AUTOINCR + uint16(219), // (47) refargs ::= + uint16(219), // (48) refargs ::= refargs refarg + uint16(222), // (49) refarg ::= MATCH nm + uint16(222), // (50) refarg ::= ON INSERT refact + uint16(222), // (51) refarg ::= ON DELETE refact + uint16(222), // (52) refarg ::= ON UPDATE refact + uint16(223), // (53) refact ::= SET NULL + uint16(223), // (54) refact ::= SET DEFAULT + uint16(223), // (55) refact ::= CASCADE + uint16(223), // (56) refact ::= RESTRICT + uint16(223), // (57) refact ::= NO ACTION + uint16(220), // (58) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt + uint16(220), // (59) defer_subclause ::= DEFERRABLE init_deferred_pred_opt + uint16(224), // (60) init_deferred_pred_opt ::= + uint16(224), // (61) init_deferred_pred_opt ::= INITIALLY DEFERRED + uint16(224), // (62) init_deferred_pred_opt ::= INITIALLY IMMEDIATE + uint16(200), // (63) conslist_opt ::= + uint16(226), // (64) tconscomma ::= COMMA + uint16(227), // (65) tcons ::= CONSTRAINT nm + uint16(227), // (66) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf + uint16(227), // (67) tcons ::= UNIQUE LP sortlist RP onconf + uint16(227), // (68) tcons ::= CHECK LP expr RP onconf + uint16(227), // (69) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt + uint16(230), // (70) defer_subclause_opt ::= + uint16(215), // (71) onconf ::= + uint16(215), // (72) onconf ::= ON CONFLICT resolvetype + uint16(231), // (73) orconf ::= + uint16(231), // (74) orconf ::= OR resolvetype + uint16(232), // (75) resolvetype ::= IGNORE + uint16(232), // (76) resolvetype ::= REPLACE + uint16(188), // (77) cmd ::= DROP TABLE ifexists fullname + uint16(234), // (78) ifexists ::= IF EXISTS + uint16(234), // (79) ifexists ::= + uint16(188), // (80) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select + uint16(188), // (81) cmd ::= DROP VIEW ifexists fullname + uint16(188), // (82) cmd ::= select + uint16(202), // (83) select ::= WITH wqlist selectnowith + uint16(202), // (84) select ::= WITH RECURSIVE wqlist selectnowith + uint16(202), // (85) select ::= selectnowith + uint16(236), // (86) selectnowith ::= selectnowith multiselect_op oneselect + uint16(239), // (87) multiselect_op ::= UNION + uint16(239), // (88) multiselect_op ::= UNION ALL + uint16(239), // (89) multiselect_op ::= EXCEPT|INTERSECT + uint16(237), // (90) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt + uint16(237), // (91) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt + uint16(249), // (92) values ::= VALUES LP nexprlist RP + uint16(249), // (93) values ::= values COMMA LP nexprlist RP + uint16(240), // (94) distinct ::= DISTINCT + uint16(240), // (95) distinct ::= ALL + uint16(240), // (96) distinct ::= + uint16(251), // (97) sclp ::= + uint16(241), // (98) selcollist ::= sclp scanpt expr scanpt as + uint16(241), // (99) selcollist ::= sclp scanpt STAR + uint16(241), // (100) selcollist ::= sclp scanpt nm DOT STAR + uint16(252), // (101) as ::= AS nm + uint16(252), // (102) as ::= + uint16(242), // (103) from ::= + uint16(242), // (104) from ::= FROM seltablist + uint16(254), // (105) stl_prefix ::= seltablist joinop + uint16(254), // (106) stl_prefix ::= + uint16(253), // (107) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt + uint16(253), // (108) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt + uint16(253), // (109) seltablist ::= stl_prefix LP select RP as on_opt using_opt + uint16(253), // (110) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt + uint16(198), // (111) dbnm ::= + uint16(198), // (112) dbnm ::= DOT nm + uint16(235), // (113) fullname ::= nm + uint16(235), // (114) fullname ::= nm DOT nm + uint16(260), // (115) xfullname ::= nm + uint16(260), // (116) xfullname ::= nm DOT nm + uint16(260), // (117) xfullname ::= nm DOT nm AS nm + uint16(260), // (118) xfullname ::= nm AS nm + uint16(255), // (119) joinop ::= COMMA|JOIN + uint16(255), // (120) joinop ::= JOIN_KW JOIN + uint16(255), // (121) joinop ::= JOIN_KW nm JOIN + uint16(255), // (122) joinop ::= JOIN_KW nm nm JOIN + uint16(257), // (123) on_opt ::= ON expr + uint16(257), // (124) on_opt ::= + uint16(256), // (125) indexed_opt ::= + uint16(256), // (126) indexed_opt ::= INDEXED BY nm + uint16(256), // (127) indexed_opt ::= NOT INDEXED + uint16(258), // (128) using_opt ::= USING LP idlist RP + uint16(258), // (129) using_opt ::= + uint16(246), // (130) orderby_opt ::= + uint16(246), // (131) orderby_opt ::= ORDER BY sortlist + uint16(228), // (132) sortlist ::= sortlist COMMA expr sortorder nulls + uint16(228), // (133) sortlist ::= expr sortorder nulls + uint16(216), // (134) sortorder ::= ASC + uint16(216), // (135) sortorder ::= DESC + uint16(216), // (136) sortorder ::= + uint16(262), // (137) nulls ::= NULLS FIRST + uint16(262), // (138) nulls ::= NULLS LAST + uint16(262), // (139) nulls ::= + uint16(244), // (140) groupby_opt ::= + uint16(244), // (141) groupby_opt ::= GROUP BY nexprlist + uint16(245), // (142) having_opt ::= + uint16(245), // (143) having_opt ::= HAVING expr + uint16(247), // (144) limit_opt ::= + uint16(247), // (145) limit_opt ::= LIMIT expr + uint16(247), // (146) limit_opt ::= LIMIT expr OFFSET expr + uint16(247), // (147) limit_opt ::= LIMIT expr COMMA expr + uint16(188), // (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret + uint16(243), // (149) where_opt ::= + uint16(243), // (150) where_opt ::= WHERE expr + uint16(264), // (151) where_opt_ret ::= + uint16(264), // (152) where_opt_ret ::= WHERE expr + uint16(264), // (153) where_opt_ret ::= RETURNING selcollist + uint16(264), // (154) where_opt_ret ::= WHERE expr RETURNING selcollist + uint16(188), // (155) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret + uint16(265), // (156) setlist ::= setlist COMMA nm EQ expr + uint16(265), // (157) setlist ::= setlist COMMA LP idlist RP EQ expr + uint16(265), // (158) setlist ::= nm EQ expr + uint16(265), // (159) setlist ::= LP idlist RP EQ expr + uint16(188), // (160) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert + uint16(188), // (161) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning + uint16(268), // (162) upsert ::= + uint16(268), // (163) upsert ::= RETURNING selcollist + uint16(268), // (164) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert + uint16(268), // (165) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert + uint16(268), // (166) upsert ::= ON CONFLICT DO NOTHING returning + uint16(268), // (167) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning + uint16(269), // (168) returning ::= RETURNING selcollist + uint16(266), // (169) insert_cmd ::= INSERT orconf + uint16(266), // (170) insert_cmd ::= REPLACE + uint16(267), // (171) idlist_opt ::= + uint16(267), // (172) idlist_opt ::= LP idlist RP + uint16(261), // (173) idlist ::= idlist COMMA nm + uint16(261), // (174) idlist ::= nm + uint16(214), // (175) expr ::= LP expr RP + uint16(214), // (176) expr ::= ID|INDEXED + uint16(214), // (177) expr ::= JOIN_KW + uint16(214), // (178) expr ::= nm DOT nm + uint16(214), // (179) expr ::= nm DOT nm DOT nm + uint16(213), // (180) term ::= NULL|FLOAT|BLOB + uint16(213), // (181) term ::= STRING + uint16(213), // (182) term ::= INTEGER + uint16(214), // (183) expr ::= VARIABLE + uint16(214), // (184) expr ::= expr COLLATE ID|STRING + uint16(214), // (185) expr ::= CAST LP expr AS typetoken RP + uint16(214), // (186) expr ::= ID|INDEXED LP distinct exprlist RP + uint16(214), // (187) expr ::= ID|INDEXED LP STAR RP + uint16(214), // (188) expr ::= ID|INDEXED LP distinct exprlist RP filter_over + uint16(214), // (189) expr ::= ID|INDEXED LP STAR RP filter_over + uint16(213), // (190) term ::= CTIME_KW + uint16(214), // (191) expr ::= LP nexprlist COMMA expr RP + uint16(214), // (192) expr ::= expr AND expr + uint16(214), // (193) expr ::= expr OR expr + uint16(214), // (194) expr ::= expr LT|GT|GE|LE expr + uint16(214), // (195) expr ::= expr EQ|NE expr + uint16(214), // (196) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr + uint16(214), // (197) expr ::= expr PLUS|MINUS expr + uint16(214), // (198) expr ::= expr STAR|SLASH|REM expr + uint16(214), // (199) expr ::= expr CONCAT expr + uint16(271), // (200) likeop ::= NOT LIKE_KW|MATCH + uint16(214), // (201) expr ::= expr likeop expr + uint16(214), // (202) expr ::= expr likeop expr ESCAPE expr + uint16(214), // (203) expr ::= expr ISNULL|NOTNULL + uint16(214), // (204) expr ::= expr NOT NULL + uint16(214), // (205) expr ::= expr IS expr + uint16(214), // (206) expr ::= expr IS NOT expr + uint16(214), // (207) expr ::= NOT expr + uint16(214), // (208) expr ::= BITNOT expr + uint16(214), // (209) expr ::= PLUS|MINUS expr + uint16(272), // (210) between_op ::= BETWEEN + uint16(272), // (211) between_op ::= NOT BETWEEN + uint16(214), // (212) expr ::= expr between_op expr AND expr + uint16(273), // (213) in_op ::= IN + uint16(273), // (214) in_op ::= NOT IN + uint16(214), // (215) expr ::= expr in_op LP exprlist RP + uint16(214), // (216) expr ::= LP select RP + uint16(214), // (217) expr ::= expr in_op LP select RP + uint16(214), // (218) expr ::= expr in_op nm dbnm paren_exprlist + uint16(214), // (219) expr ::= EXISTS LP select RP + uint16(214), // (220) expr ::= CASE case_operand case_exprlist case_else END + uint16(276), // (221) case_exprlist ::= case_exprlist WHEN expr THEN expr + uint16(276), // (222) case_exprlist ::= WHEN expr THEN expr + uint16(277), // (223) case_else ::= ELSE expr + uint16(277), // (224) case_else ::= + uint16(275), // (225) case_operand ::= expr + uint16(275), // (226) case_operand ::= + uint16(259), // (227) exprlist ::= + uint16(250), // (228) nexprlist ::= nexprlist COMMA expr + uint16(250), // (229) nexprlist ::= expr + uint16(274), // (230) paren_exprlist ::= + uint16(274), // (231) paren_exprlist ::= LP exprlist RP + uint16(188), // (232) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt + uint16(278), // (233) uniqueflag ::= UNIQUE + uint16(278), // (234) uniqueflag ::= + uint16(218), // (235) eidlist_opt ::= + uint16(218), // (236) eidlist_opt ::= LP eidlist RP + uint16(229), // (237) eidlist ::= eidlist COMMA nm collate sortorder + uint16(229), // (238) eidlist ::= nm collate sortorder + uint16(279), // (239) collate ::= + uint16(279), // (240) collate ::= COLLATE ID|STRING + uint16(188), // (241) cmd ::= DROP INDEX ifexists fullname + uint16(188), // (242) cmd ::= VACUUM vinto + uint16(188), // (243) cmd ::= VACUUM nm vinto + uint16(280), // (244) vinto ::= INTO expr + uint16(280), // (245) vinto ::= + uint16(188), // (246) cmd ::= PRAGMA nm dbnm + uint16(188), // (247) cmd ::= PRAGMA nm dbnm EQ nmnum + uint16(188), // (248) cmd ::= PRAGMA nm dbnm LP nmnum RP + uint16(188), // (249) cmd ::= PRAGMA nm dbnm EQ minus_num + uint16(188), // (250) cmd ::= PRAGMA nm dbnm LP minus_num RP + uint16(208), // (251) plus_num ::= PLUS INTEGER|FLOAT + uint16(209), // (252) minus_num ::= MINUS INTEGER|FLOAT + uint16(188), // (253) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END + uint16(282), // (254) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause + uint16(284), // (255) trigger_time ::= BEFORE|AFTER + uint16(284), // (256) trigger_time ::= INSTEAD OF + uint16(284), // (257) trigger_time ::= + uint16(285), // (258) trigger_event ::= DELETE|INSERT + uint16(285), // (259) trigger_event ::= UPDATE + uint16(285), // (260) trigger_event ::= UPDATE OF idlist + uint16(287), // (261) when_clause ::= + uint16(287), // (262) when_clause ::= WHEN expr + uint16(283), // (263) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI + uint16(283), // (264) trigger_cmd_list ::= trigger_cmd SEMI + uint16(289), // (265) trnm ::= nm DOT nm + uint16(290), // (266) tridxby ::= INDEXED BY nm + uint16(290), // (267) tridxby ::= NOT INDEXED + uint16(288), // (268) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt + uint16(288), // (269) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt + uint16(288), // (270) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt + uint16(288), // (271) trigger_cmd ::= scanpt select scanpt + uint16(214), // (272) expr ::= RAISE LP IGNORE RP + uint16(214), // (273) expr ::= RAISE LP raisetype COMMA nm RP + uint16(233), // (274) raisetype ::= ROLLBACK + uint16(233), // (275) raisetype ::= ABORT + uint16(233), // (276) raisetype ::= FAIL + uint16(188), // (277) cmd ::= DROP TRIGGER ifexists fullname + uint16(188), // (278) cmd ::= ATTACH database_kw_opt expr AS expr key_opt + uint16(188), // (279) cmd ::= DETACH database_kw_opt expr + uint16(292), // (280) key_opt ::= + uint16(292), // (281) key_opt ::= KEY expr + uint16(188), // (282) cmd ::= REINDEX + uint16(188), // (283) cmd ::= REINDEX nm dbnm + uint16(188), // (284) cmd ::= ANALYZE + uint16(188), // (285) cmd ::= ANALYZE nm dbnm + uint16(188), // (286) cmd ::= ALTER TABLE fullname RENAME TO nm + uint16(188), // (287) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist + uint16(188), // (288) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm + uint16(293), // (289) add_column_fullname ::= fullname + uint16(188), // (290) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm + uint16(188), // (291) cmd ::= create_vtab + uint16(188), // (292) cmd ::= create_vtab LP vtabarglist RP + uint16(295), // (293) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm + uint16(297), // (294) vtabarg ::= + uint16(298), // (295) vtabargtoken ::= ANY + uint16(298), // (296) vtabargtoken ::= lp anylist RP + uint16(299), // (297) lp ::= LP + uint16(263), // (298) with ::= WITH wqlist + uint16(263), // (299) with ::= WITH RECURSIVE wqlist + uint16(302), // (300) wqas ::= AS + uint16(302), // (301) wqas ::= AS MATERIALIZED + uint16(302), // (302) wqas ::= AS NOT MATERIALIZED + uint16(301), // (303) wqitem ::= nm eidlist_opt wqas LP select RP + uint16(238), // (304) wqlist ::= wqitem + uint16(238), // (305) wqlist ::= wqlist COMMA wqitem + uint16(303), // (306) windowdefn_list ::= windowdefn + uint16(303), // (307) windowdefn_list ::= windowdefn_list COMMA windowdefn + uint16(304), // (308) windowdefn ::= nm AS LP window RP + uint16(305), // (309) window ::= PARTITION BY nexprlist orderby_opt frame_opt + uint16(305), // (310) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt + uint16(305), // (311) window ::= ORDER BY sortlist frame_opt + uint16(305), // (312) window ::= nm ORDER BY sortlist frame_opt + uint16(305), // (313) window ::= frame_opt + uint16(305), // (314) window ::= nm frame_opt + uint16(306), // (315) frame_opt ::= + uint16(306), // (316) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt + uint16(306), // (317) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt + uint16(310), // (318) range_or_rows ::= RANGE|ROWS|GROUPS + uint16(312), // (319) frame_bound_s ::= frame_bound + uint16(312), // (320) frame_bound_s ::= UNBOUNDED PRECEDING + uint16(313), // (321) frame_bound_e ::= frame_bound + uint16(313), // (322) frame_bound_e ::= UNBOUNDED FOLLOWING + uint16(311), // (323) frame_bound ::= expr PRECEDING|FOLLOWING + uint16(311), // (324) frame_bound ::= CURRENT ROW + uint16(314), // (325) frame_exclude_opt ::= + uint16(314), // (326) frame_exclude_opt ::= EXCLUDE frame_exclude + uint16(315), // (327) frame_exclude ::= NO OTHERS + uint16(315), // (328) frame_exclude ::= CURRENT ROW + uint16(315), // (329) frame_exclude ::= GROUP|TIES + uint16(248), // (330) window_clause ::= WINDOW windowdefn_list + uint16(270), // (331) filter_over ::= filter_clause over_clause + uint16(270), // (332) filter_over ::= over_clause + uint16(270), // (333) filter_over ::= filter_clause + uint16(309), // (334) over_clause ::= OVER LP window RP + uint16(309), // (335) over_clause ::= OVER nm + uint16(308), // (336) filter_clause ::= FILTER LP WHERE expr RP + uint16(183), // (337) input ::= cmdlist + uint16(184), // (338) cmdlist ::= cmdlist ecmd + uint16(184), // (339) cmdlist ::= ecmd + uint16(185), // (340) ecmd ::= SEMI + uint16(185), // (341) ecmd ::= cmdx SEMI + uint16(185), // (342) ecmd ::= explain cmdx SEMI + uint16(190), // (343) trans_opt ::= + uint16(190), // (344) trans_opt ::= TRANSACTION + uint16(190), // (345) trans_opt ::= TRANSACTION nm + uint16(192), // (346) savepoint_opt ::= SAVEPOINT + uint16(192), // (347) savepoint_opt ::= + uint16(188), // (348) cmd ::= create_table create_table_args + uint16(199), // (349) columnlist ::= columnlist COMMA columnname carglist + uint16(199), // (350) columnlist ::= columnname carglist + uint16(191), // (351) nm ::= ID|INDEXED + uint16(191), // (352) nm ::= STRING + uint16(191), // (353) nm ::= JOIN_KW + uint16(205), // (354) typetoken ::= typename + uint16(206), // (355) typename ::= ID|STRING + uint16(207), // (356) signed ::= plus_num + uint16(207), // (357) signed ::= minus_num + uint16(204), // (358) carglist ::= carglist ccons + uint16(204), // (359) carglist ::= + uint16(212), // (360) ccons ::= NULL onconf + uint16(212), // (361) ccons ::= GENERATED ALWAYS AS generated + uint16(212), // (362) ccons ::= AS generated + uint16(200), // (363) conslist_opt ::= COMMA conslist + uint16(225), // (364) conslist ::= conslist tconscomma tcons + uint16(225), // (365) conslist ::= tcons + uint16(226), // (366) tconscomma ::= + uint16(230), // (367) defer_subclause_opt ::= defer_subclause + uint16(232), // (368) resolvetype ::= raisetype + uint16(236), // (369) selectnowith ::= oneselect + uint16(237), // (370) oneselect ::= values + uint16(251), // (371) sclp ::= selcollist COMMA + uint16(252), // (372) as ::= ID|STRING + uint16(269), // (373) returning ::= + uint16(214), // (374) expr ::= term + uint16(271), // (375) likeop ::= LIKE_KW|MATCH + uint16(259), // (376) exprlist ::= nexprlist + uint16(281), // (377) nmnum ::= plus_num + uint16(281), // (378) nmnum ::= nm + uint16(281), // (379) nmnum ::= ON + uint16(281), // (380) nmnum ::= DELETE + uint16(281), // (381) nmnum ::= DEFAULT + uint16(208), // (382) plus_num ::= INTEGER|FLOAT + uint16(286), // (383) foreach_clause ::= + uint16(286), // (384) foreach_clause ::= FOR EACH ROW + uint16(289), // (385) trnm ::= nm + uint16(290), // (386) tridxby ::= + uint16(291), // (387) database_kw_opt ::= DATABASE + uint16(291), // (388) database_kw_opt ::= + uint16(294), // (389) kwcolumn_opt ::= + uint16(294), // (390) kwcolumn_opt ::= COLUMNKW + uint16(296), // (391) vtabarglist ::= vtabarg + uint16(296), // (392) vtabarglist ::= vtabarglist COMMA vtabarg + uint16(297), // (393) vtabarg ::= vtabarg vtabargtoken + uint16(300), // (394) anylist ::= + uint16(300), // (395) anylist ::= anylist LP anylist RP + uint16(300), // (396) anylist ::= anylist ANY + uint16(263), // (397) with ::= +} /* sqlite3.c:159577:25 */ // For rule J, yyRuleInfoNRhs[J] contains the negative of the number // of symbols on the right-hand side of that rule. -var yyRuleInfoNRhs = [385]int8{ +var yyRuleInfoNRhs = [398]int8{ int8(-1), // (0) explain ::= EXPLAIN int8(-3), // (1) explain ::= EXPLAIN QUERY PLAN int8(-1), // (2) cmdx ::= cmd @@ -136532,244 +138913,257 @@ var yyRuleInfoNRhs = [385]int8{ int8(-2), // (145) limit_opt ::= LIMIT expr int8(-4), // (146) limit_opt ::= LIMIT expr OFFSET expr int8(-4), // (147) limit_opt ::= LIMIT expr COMMA expr - int8(-6), // (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt + int8(-6), // (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret int8(0), // (149) where_opt ::= int8(-2), // (150) where_opt ::= WHERE expr - int8(-9), // (151) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt - int8(-5), // (152) setlist ::= setlist COMMA nm EQ expr - int8(-7), // (153) setlist ::= setlist COMMA LP idlist RP EQ expr - int8(-3), // (154) setlist ::= nm EQ expr - int8(-5), // (155) setlist ::= LP idlist RP EQ expr - int8(-7), // (156) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert - int8(-7), // (157) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES - int8(0), // (158) upsert ::= - int8(-11), // (159) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt - int8(-8), // (160) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING - int8(-4), // (161) upsert ::= ON CONFLICT DO NOTHING - int8(-2), // (162) insert_cmd ::= INSERT orconf - int8(-1), // (163) insert_cmd ::= REPLACE - int8(0), // (164) idlist_opt ::= - int8(-3), // (165) idlist_opt ::= LP idlist RP - int8(-3), // (166) idlist ::= idlist COMMA nm - int8(-1), // (167) idlist ::= nm - int8(-3), // (168) expr ::= LP expr RP - int8(-1), // (169) expr ::= ID|INDEXED - int8(-1), // (170) expr ::= JOIN_KW - int8(-3), // (171) expr ::= nm DOT nm - int8(-5), // (172) expr ::= nm DOT nm DOT nm - int8(-1), // (173) term ::= NULL|FLOAT|BLOB - int8(-1), // (174) term ::= STRING - int8(-1), // (175) term ::= INTEGER - int8(-1), // (176) expr ::= VARIABLE - int8(-3), // (177) expr ::= expr COLLATE ID|STRING - int8(-6), // (178) expr ::= CAST LP expr AS typetoken RP - int8(-5), // (179) expr ::= ID|INDEXED LP distinct exprlist RP - int8(-4), // (180) expr ::= ID|INDEXED LP STAR RP - int8(-6), // (181) expr ::= ID|INDEXED LP distinct exprlist RP filter_over - int8(-5), // (182) expr ::= ID|INDEXED LP STAR RP filter_over - int8(-1), // (183) term ::= CTIME_KW - int8(-5), // (184) expr ::= LP nexprlist COMMA expr RP - int8(-3), // (185) expr ::= expr AND expr - int8(-3), // (186) expr ::= expr OR expr - int8(-3), // (187) expr ::= expr LT|GT|GE|LE expr - int8(-3), // (188) expr ::= expr EQ|NE expr - int8(-3), // (189) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr - int8(-3), // (190) expr ::= expr PLUS|MINUS expr - int8(-3), // (191) expr ::= expr STAR|SLASH|REM expr - int8(-3), // (192) expr ::= expr CONCAT expr - int8(-2), // (193) likeop ::= NOT LIKE_KW|MATCH - int8(-3), // (194) expr ::= expr likeop expr - int8(-5), // (195) expr ::= expr likeop expr ESCAPE expr - int8(-2), // (196) expr ::= expr ISNULL|NOTNULL - int8(-3), // (197) expr ::= expr NOT NULL - int8(-3), // (198) expr ::= expr IS expr - int8(-4), // (199) expr ::= expr IS NOT expr - int8(-2), // (200) expr ::= NOT expr - int8(-2), // (201) expr ::= BITNOT expr - int8(-2), // (202) expr ::= PLUS|MINUS expr - int8(-1), // (203) between_op ::= BETWEEN - int8(-2), // (204) between_op ::= NOT BETWEEN - int8(-5), // (205) expr ::= expr between_op expr AND expr - int8(-1), // (206) in_op ::= IN - int8(-2), // (207) in_op ::= NOT IN - int8(-5), // (208) expr ::= expr in_op LP exprlist RP - int8(-3), // (209) expr ::= LP select RP - int8(-5), // (210) expr ::= expr in_op LP select RP - int8(-5), // (211) expr ::= expr in_op nm dbnm paren_exprlist - int8(-4), // (212) expr ::= EXISTS LP select RP - int8(-5), // (213) expr ::= CASE case_operand case_exprlist case_else END - int8(-5), // (214) case_exprlist ::= case_exprlist WHEN expr THEN expr - int8(-4), // (215) case_exprlist ::= WHEN expr THEN expr - int8(-2), // (216) case_else ::= ELSE expr - int8(0), // (217) case_else ::= - int8(-1), // (218) case_operand ::= expr - int8(0), // (219) case_operand ::= - int8(0), // (220) exprlist ::= - int8(-3), // (221) nexprlist ::= nexprlist COMMA expr - int8(-1), // (222) nexprlist ::= expr - int8(0), // (223) paren_exprlist ::= - int8(-3), // (224) paren_exprlist ::= LP exprlist RP - int8(-12), // (225) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt - int8(-1), // (226) uniqueflag ::= UNIQUE - int8(0), // (227) uniqueflag ::= - int8(0), // (228) eidlist_opt ::= - int8(-3), // (229) eidlist_opt ::= LP eidlist RP - int8(-5), // (230) eidlist ::= eidlist COMMA nm collate sortorder - int8(-3), // (231) eidlist ::= nm collate sortorder - int8(0), // (232) collate ::= - int8(-2), // (233) collate ::= COLLATE ID|STRING - int8(-4), // (234) cmd ::= DROP INDEX ifexists fullname - int8(-2), // (235) cmd ::= VACUUM vinto - int8(-3), // (236) cmd ::= VACUUM nm vinto - int8(-2), // (237) vinto ::= INTO expr - int8(0), // (238) vinto ::= - int8(-3), // (239) cmd ::= PRAGMA nm dbnm - int8(-5), // (240) cmd ::= PRAGMA nm dbnm EQ nmnum - int8(-6), // (241) cmd ::= PRAGMA nm dbnm LP nmnum RP - int8(-5), // (242) cmd ::= PRAGMA nm dbnm EQ minus_num - int8(-6), // (243) cmd ::= PRAGMA nm dbnm LP minus_num RP - int8(-2), // (244) plus_num ::= PLUS INTEGER|FLOAT - int8(-2), // (245) minus_num ::= MINUS INTEGER|FLOAT - int8(-5), // (246) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END - int8(-11), // (247) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause - int8(-1), // (248) trigger_time ::= BEFORE|AFTER - int8(-2), // (249) trigger_time ::= INSTEAD OF - int8(0), // (250) trigger_time ::= - int8(-1), // (251) trigger_event ::= DELETE|INSERT - int8(-1), // (252) trigger_event ::= UPDATE - int8(-3), // (253) trigger_event ::= UPDATE OF idlist - int8(0), // (254) when_clause ::= - int8(-2), // (255) when_clause ::= WHEN expr - int8(-3), // (256) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI - int8(-2), // (257) trigger_cmd_list ::= trigger_cmd SEMI - int8(-3), // (258) trnm ::= nm DOT nm - int8(-3), // (259) tridxby ::= INDEXED BY nm - int8(-2), // (260) tridxby ::= NOT INDEXED - int8(-9), // (261) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt - int8(-8), // (262) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt - int8(-6), // (263) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt - int8(-3), // (264) trigger_cmd ::= scanpt select scanpt - int8(-4), // (265) expr ::= RAISE LP IGNORE RP - int8(-6), // (266) expr ::= RAISE LP raisetype COMMA nm RP - int8(-1), // (267) raisetype ::= ROLLBACK - int8(-1), // (268) raisetype ::= ABORT - int8(-1), // (269) raisetype ::= FAIL - int8(-4), // (270) cmd ::= DROP TRIGGER ifexists fullname - int8(-6), // (271) cmd ::= ATTACH database_kw_opt expr AS expr key_opt - int8(-3), // (272) cmd ::= DETACH database_kw_opt expr - int8(0), // (273) key_opt ::= - int8(-2), // (274) key_opt ::= KEY expr - int8(-1), // (275) cmd ::= REINDEX - int8(-3), // (276) cmd ::= REINDEX nm dbnm - int8(-1), // (277) cmd ::= ANALYZE - int8(-3), // (278) cmd ::= ANALYZE nm dbnm - int8(-6), // (279) cmd ::= ALTER TABLE fullname RENAME TO nm - int8(-7), // (280) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist - int8(-1), // (281) add_column_fullname ::= fullname - int8(-8), // (282) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm - int8(-1), // (283) cmd ::= create_vtab - int8(-4), // (284) cmd ::= create_vtab LP vtabarglist RP - int8(-8), // (285) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm - int8(0), // (286) vtabarg ::= - int8(-1), // (287) vtabargtoken ::= ANY - int8(-3), // (288) vtabargtoken ::= lp anylist RP - int8(-1), // (289) lp ::= LP - int8(-2), // (290) with ::= WITH wqlist - int8(-3), // (291) with ::= WITH RECURSIVE wqlist - int8(-6), // (292) wqlist ::= nm eidlist_opt AS LP select RP - int8(-8), // (293) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP - int8(-1), // (294) windowdefn_list ::= windowdefn - int8(-3), // (295) windowdefn_list ::= windowdefn_list COMMA windowdefn - int8(-5), // (296) windowdefn ::= nm AS LP window RP - int8(-5), // (297) window ::= PARTITION BY nexprlist orderby_opt frame_opt - int8(-6), // (298) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt - int8(-4), // (299) window ::= ORDER BY sortlist frame_opt - int8(-5), // (300) window ::= nm ORDER BY sortlist frame_opt - int8(-1), // (301) window ::= frame_opt - int8(-2), // (302) window ::= nm frame_opt - int8(0), // (303) frame_opt ::= - int8(-3), // (304) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt - int8(-6), // (305) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt - int8(-1), // (306) range_or_rows ::= RANGE|ROWS|GROUPS - int8(-1), // (307) frame_bound_s ::= frame_bound - int8(-2), // (308) frame_bound_s ::= UNBOUNDED PRECEDING - int8(-1), // (309) frame_bound_e ::= frame_bound - int8(-2), // (310) frame_bound_e ::= UNBOUNDED FOLLOWING - int8(-2), // (311) frame_bound ::= expr PRECEDING|FOLLOWING - int8(-2), // (312) frame_bound ::= CURRENT ROW - int8(0), // (313) frame_exclude_opt ::= - int8(-2), // (314) frame_exclude_opt ::= EXCLUDE frame_exclude - int8(-2), // (315) frame_exclude ::= NO OTHERS - int8(-2), // (316) frame_exclude ::= CURRENT ROW - int8(-1), // (317) frame_exclude ::= GROUP|TIES - int8(-2), // (318) window_clause ::= WINDOW windowdefn_list - int8(-2), // (319) filter_over ::= filter_clause over_clause - int8(-1), // (320) filter_over ::= over_clause - int8(-1), // (321) filter_over ::= filter_clause - int8(-4), // (322) over_clause ::= OVER LP window RP - int8(-2), // (323) over_clause ::= OVER nm - int8(-5), // (324) filter_clause ::= FILTER LP WHERE expr RP - int8(-1), // (325) input ::= cmdlist - int8(-2), // (326) cmdlist ::= cmdlist ecmd - int8(-1), // (327) cmdlist ::= ecmd - int8(-1), // (328) ecmd ::= SEMI - int8(-2), // (329) ecmd ::= cmdx SEMI - int8(-3), // (330) ecmd ::= explain cmdx SEMI - int8(0), // (331) trans_opt ::= - int8(-1), // (332) trans_opt ::= TRANSACTION - int8(-2), // (333) trans_opt ::= TRANSACTION nm - int8(-1), // (334) savepoint_opt ::= SAVEPOINT - int8(0), // (335) savepoint_opt ::= - int8(-2), // (336) cmd ::= create_table create_table_args - int8(-4), // (337) columnlist ::= columnlist COMMA columnname carglist - int8(-2), // (338) columnlist ::= columnname carglist - int8(-1), // (339) nm ::= ID|INDEXED - int8(-1), // (340) nm ::= STRING - int8(-1), // (341) nm ::= JOIN_KW - int8(-1), // (342) typetoken ::= typename - int8(-1), // (343) typename ::= ID|STRING - int8(-1), // (344) signed ::= plus_num - int8(-1), // (345) signed ::= minus_num - int8(-2), // (346) carglist ::= carglist ccons - int8(0), // (347) carglist ::= - int8(-2), // (348) ccons ::= NULL onconf - int8(-4), // (349) ccons ::= GENERATED ALWAYS AS generated - int8(-2), // (350) ccons ::= AS generated - int8(-2), // (351) conslist_opt ::= COMMA conslist - int8(-3), // (352) conslist ::= conslist tconscomma tcons - int8(-1), // (353) conslist ::= tcons - int8(0), // (354) tconscomma ::= - int8(-1), // (355) defer_subclause_opt ::= defer_subclause - int8(-1), // (356) resolvetype ::= raisetype - int8(-1), // (357) selectnowith ::= oneselect - int8(-1), // (358) oneselect ::= values - int8(-2), // (359) sclp ::= selcollist COMMA - int8(-1), // (360) as ::= ID|STRING - int8(-1), // (361) expr ::= term - int8(-1), // (362) likeop ::= LIKE_KW|MATCH - int8(-1), // (363) exprlist ::= nexprlist - int8(-1), // (364) nmnum ::= plus_num - int8(-1), // (365) nmnum ::= nm - int8(-1), // (366) nmnum ::= ON - int8(-1), // (367) nmnum ::= DELETE - int8(-1), // (368) nmnum ::= DEFAULT - int8(-1), // (369) plus_num ::= INTEGER|FLOAT - int8(0), // (370) foreach_clause ::= - int8(-3), // (371) foreach_clause ::= FOR EACH ROW - int8(-1), // (372) trnm ::= nm - int8(0), // (373) tridxby ::= - int8(-1), // (374) database_kw_opt ::= DATABASE - int8(0), // (375) database_kw_opt ::= - int8(0), // (376) kwcolumn_opt ::= - int8(-1), // (377) kwcolumn_opt ::= COLUMNKW - int8(-1), // (378) vtabarglist ::= vtabarg - int8(-3), // (379) vtabarglist ::= vtabarglist COMMA vtabarg - int8(-2), // (380) vtabarg ::= vtabarg vtabargtoken - int8(0), // (381) anylist ::= - int8(-4), // (382) anylist ::= anylist LP anylist RP - int8(-2), // (383) anylist ::= anylist ANY - int8(0), // (384) with ::= -} /* sqlite3.c:157063:26 */ + int8(0), // (151) where_opt_ret ::= + int8(-2), // (152) where_opt_ret ::= WHERE expr + int8(-2), // (153) where_opt_ret ::= RETURNING selcollist + int8(-4), // (154) where_opt_ret ::= WHERE expr RETURNING selcollist + int8(-9), // (155) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret + int8(-5), // (156) setlist ::= setlist COMMA nm EQ expr + int8(-7), // (157) setlist ::= setlist COMMA LP idlist RP EQ expr + int8(-3), // (158) setlist ::= nm EQ expr + int8(-5), // (159) setlist ::= LP idlist RP EQ expr + int8(-7), // (160) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert + int8(-8), // (161) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning + int8(0), // (162) upsert ::= + int8(-2), // (163) upsert ::= RETURNING selcollist + int8(-12), // (164) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert + int8(-9), // (165) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert + int8(-5), // (166) upsert ::= ON CONFLICT DO NOTHING returning + int8(-8), // (167) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning + int8(-2), // (168) returning ::= RETURNING selcollist + int8(-2), // (169) insert_cmd ::= INSERT orconf + int8(-1), // (170) insert_cmd ::= REPLACE + int8(0), // (171) idlist_opt ::= + int8(-3), // (172) idlist_opt ::= LP idlist RP + int8(-3), // (173) idlist ::= idlist COMMA nm + int8(-1), // (174) idlist ::= nm + int8(-3), // (175) expr ::= LP expr RP + int8(-1), // (176) expr ::= ID|INDEXED + int8(-1), // (177) expr ::= JOIN_KW + int8(-3), // (178) expr ::= nm DOT nm + int8(-5), // (179) expr ::= nm DOT nm DOT nm + int8(-1), // (180) term ::= NULL|FLOAT|BLOB + int8(-1), // (181) term ::= STRING + int8(-1), // (182) term ::= INTEGER + int8(-1), // (183) expr ::= VARIABLE + int8(-3), // (184) expr ::= expr COLLATE ID|STRING + int8(-6), // (185) expr ::= CAST LP expr AS typetoken RP + int8(-5), // (186) expr ::= ID|INDEXED LP distinct exprlist RP + int8(-4), // (187) expr ::= ID|INDEXED LP STAR RP + int8(-6), // (188) expr ::= ID|INDEXED LP distinct exprlist RP filter_over + int8(-5), // (189) expr ::= ID|INDEXED LP STAR RP filter_over + int8(-1), // (190) term ::= CTIME_KW + int8(-5), // (191) expr ::= LP nexprlist COMMA expr RP + int8(-3), // (192) expr ::= expr AND expr + int8(-3), // (193) expr ::= expr OR expr + int8(-3), // (194) expr ::= expr LT|GT|GE|LE expr + int8(-3), // (195) expr ::= expr EQ|NE expr + int8(-3), // (196) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr + int8(-3), // (197) expr ::= expr PLUS|MINUS expr + int8(-3), // (198) expr ::= expr STAR|SLASH|REM expr + int8(-3), // (199) expr ::= expr CONCAT expr + int8(-2), // (200) likeop ::= NOT LIKE_KW|MATCH + int8(-3), // (201) expr ::= expr likeop expr + int8(-5), // (202) expr ::= expr likeop expr ESCAPE expr + int8(-2), // (203) expr ::= expr ISNULL|NOTNULL + int8(-3), // (204) expr ::= expr NOT NULL + int8(-3), // (205) expr ::= expr IS expr + int8(-4), // (206) expr ::= expr IS NOT expr + int8(-2), // (207) expr ::= NOT expr + int8(-2), // (208) expr ::= BITNOT expr + int8(-2), // (209) expr ::= PLUS|MINUS expr + int8(-1), // (210) between_op ::= BETWEEN + int8(-2), // (211) between_op ::= NOT BETWEEN + int8(-5), // (212) expr ::= expr between_op expr AND expr + int8(-1), // (213) in_op ::= IN + int8(-2), // (214) in_op ::= NOT IN + int8(-5), // (215) expr ::= expr in_op LP exprlist RP + int8(-3), // (216) expr ::= LP select RP + int8(-5), // (217) expr ::= expr in_op LP select RP + int8(-5), // (218) expr ::= expr in_op nm dbnm paren_exprlist + int8(-4), // (219) expr ::= EXISTS LP select RP + int8(-5), // (220) expr ::= CASE case_operand case_exprlist case_else END + int8(-5), // (221) case_exprlist ::= case_exprlist WHEN expr THEN expr + int8(-4), // (222) case_exprlist ::= WHEN expr THEN expr + int8(-2), // (223) case_else ::= ELSE expr + int8(0), // (224) case_else ::= + int8(-1), // (225) case_operand ::= expr + int8(0), // (226) case_operand ::= + int8(0), // (227) exprlist ::= + int8(-3), // (228) nexprlist ::= nexprlist COMMA expr + int8(-1), // (229) nexprlist ::= expr + int8(0), // (230) paren_exprlist ::= + int8(-3), // (231) paren_exprlist ::= LP exprlist RP + int8(-12), // (232) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt + int8(-1), // (233) uniqueflag ::= UNIQUE + int8(0), // (234) uniqueflag ::= + int8(0), // (235) eidlist_opt ::= + int8(-3), // (236) eidlist_opt ::= LP eidlist RP + int8(-5), // (237) eidlist ::= eidlist COMMA nm collate sortorder + int8(-3), // (238) eidlist ::= nm collate sortorder + int8(0), // (239) collate ::= + int8(-2), // (240) collate ::= COLLATE ID|STRING + int8(-4), // (241) cmd ::= DROP INDEX ifexists fullname + int8(-2), // (242) cmd ::= VACUUM vinto + int8(-3), // (243) cmd ::= VACUUM nm vinto + int8(-2), // (244) vinto ::= INTO expr + int8(0), // (245) vinto ::= + int8(-3), // (246) cmd ::= PRAGMA nm dbnm + int8(-5), // (247) cmd ::= PRAGMA nm dbnm EQ nmnum + int8(-6), // (248) cmd ::= PRAGMA nm dbnm LP nmnum RP + int8(-5), // (249) cmd ::= PRAGMA nm dbnm EQ minus_num + int8(-6), // (250) cmd ::= PRAGMA nm dbnm LP minus_num RP + int8(-2), // (251) plus_num ::= PLUS INTEGER|FLOAT + int8(-2), // (252) minus_num ::= MINUS INTEGER|FLOAT + int8(-5), // (253) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END + int8(-11), // (254) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause + int8(-1), // (255) trigger_time ::= BEFORE|AFTER + int8(-2), // (256) trigger_time ::= INSTEAD OF + int8(0), // (257) trigger_time ::= + int8(-1), // (258) trigger_event ::= DELETE|INSERT + int8(-1), // (259) trigger_event ::= UPDATE + int8(-3), // (260) trigger_event ::= UPDATE OF idlist + int8(0), // (261) when_clause ::= + int8(-2), // (262) when_clause ::= WHEN expr + int8(-3), // (263) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI + int8(-2), // (264) trigger_cmd_list ::= trigger_cmd SEMI + int8(-3), // (265) trnm ::= nm DOT nm + int8(-3), // (266) tridxby ::= INDEXED BY nm + int8(-2), // (267) tridxby ::= NOT INDEXED + int8(-9), // (268) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt + int8(-8), // (269) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt + int8(-6), // (270) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt + int8(-3), // (271) trigger_cmd ::= scanpt select scanpt + int8(-4), // (272) expr ::= RAISE LP IGNORE RP + int8(-6), // (273) expr ::= RAISE LP raisetype COMMA nm RP + int8(-1), // (274) raisetype ::= ROLLBACK + int8(-1), // (275) raisetype ::= ABORT + int8(-1), // (276) raisetype ::= FAIL + int8(-4), // (277) cmd ::= DROP TRIGGER ifexists fullname + int8(-6), // (278) cmd ::= ATTACH database_kw_opt expr AS expr key_opt + int8(-3), // (279) cmd ::= DETACH database_kw_opt expr + int8(0), // (280) key_opt ::= + int8(-2), // (281) key_opt ::= KEY expr + int8(-1), // (282) cmd ::= REINDEX + int8(-3), // (283) cmd ::= REINDEX nm dbnm + int8(-1), // (284) cmd ::= ANALYZE + int8(-3), // (285) cmd ::= ANALYZE nm dbnm + int8(-6), // (286) cmd ::= ALTER TABLE fullname RENAME TO nm + int8(-7), // (287) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist + int8(-6), // (288) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm + int8(-1), // (289) add_column_fullname ::= fullname + int8(-8), // (290) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm + int8(-1), // (291) cmd ::= create_vtab + int8(-4), // (292) cmd ::= create_vtab LP vtabarglist RP + int8(-8), // (293) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm + int8(0), // (294) vtabarg ::= + int8(-1), // (295) vtabargtoken ::= ANY + int8(-3), // (296) vtabargtoken ::= lp anylist RP + int8(-1), // (297) lp ::= LP + int8(-2), // (298) with ::= WITH wqlist + int8(-3), // (299) with ::= WITH RECURSIVE wqlist + int8(-1), // (300) wqas ::= AS + int8(-2), // (301) wqas ::= AS MATERIALIZED + int8(-3), // (302) wqas ::= AS NOT MATERIALIZED + int8(-6), // (303) wqitem ::= nm eidlist_opt wqas LP select RP + int8(-1), // (304) wqlist ::= wqitem + int8(-3), // (305) wqlist ::= wqlist COMMA wqitem + int8(-1), // (306) windowdefn_list ::= windowdefn + int8(-3), // (307) windowdefn_list ::= windowdefn_list COMMA windowdefn + int8(-5), // (308) windowdefn ::= nm AS LP window RP + int8(-5), // (309) window ::= PARTITION BY nexprlist orderby_opt frame_opt + int8(-6), // (310) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt + int8(-4), // (311) window ::= ORDER BY sortlist frame_opt + int8(-5), // (312) window ::= nm ORDER BY sortlist frame_opt + int8(-1), // (313) window ::= frame_opt + int8(-2), // (314) window ::= nm frame_opt + int8(0), // (315) frame_opt ::= + int8(-3), // (316) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt + int8(-6), // (317) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt + int8(-1), // (318) range_or_rows ::= RANGE|ROWS|GROUPS + int8(-1), // (319) frame_bound_s ::= frame_bound + int8(-2), // (320) frame_bound_s ::= UNBOUNDED PRECEDING + int8(-1), // (321) frame_bound_e ::= frame_bound + int8(-2), // (322) frame_bound_e ::= UNBOUNDED FOLLOWING + int8(-2), // (323) frame_bound ::= expr PRECEDING|FOLLOWING + int8(-2), // (324) frame_bound ::= CURRENT ROW + int8(0), // (325) frame_exclude_opt ::= + int8(-2), // (326) frame_exclude_opt ::= EXCLUDE frame_exclude + int8(-2), // (327) frame_exclude ::= NO OTHERS + int8(-2), // (328) frame_exclude ::= CURRENT ROW + int8(-1), // (329) frame_exclude ::= GROUP|TIES + int8(-2), // (330) window_clause ::= WINDOW windowdefn_list + int8(-2), // (331) filter_over ::= filter_clause over_clause + int8(-1), // (332) filter_over ::= over_clause + int8(-1), // (333) filter_over ::= filter_clause + int8(-4), // (334) over_clause ::= OVER LP window RP + int8(-2), // (335) over_clause ::= OVER nm + int8(-5), // (336) filter_clause ::= FILTER LP WHERE expr RP + int8(-1), // (337) input ::= cmdlist + int8(-2), // (338) cmdlist ::= cmdlist ecmd + int8(-1), // (339) cmdlist ::= ecmd + int8(-1), // (340) ecmd ::= SEMI + int8(-2), // (341) ecmd ::= cmdx SEMI + int8(-3), // (342) ecmd ::= explain cmdx SEMI + int8(0), // (343) trans_opt ::= + int8(-1), // (344) trans_opt ::= TRANSACTION + int8(-2), // (345) trans_opt ::= TRANSACTION nm + int8(-1), // (346) savepoint_opt ::= SAVEPOINT + int8(0), // (347) savepoint_opt ::= + int8(-2), // (348) cmd ::= create_table create_table_args + int8(-4), // (349) columnlist ::= columnlist COMMA columnname carglist + int8(-2), // (350) columnlist ::= columnname carglist + int8(-1), // (351) nm ::= ID|INDEXED + int8(-1), // (352) nm ::= STRING + int8(-1), // (353) nm ::= JOIN_KW + int8(-1), // (354) typetoken ::= typename + int8(-1), // (355) typename ::= ID|STRING + int8(-1), // (356) signed ::= plus_num + int8(-1), // (357) signed ::= minus_num + int8(-2), // (358) carglist ::= carglist ccons + int8(0), // (359) carglist ::= + int8(-2), // (360) ccons ::= NULL onconf + int8(-4), // (361) ccons ::= GENERATED ALWAYS AS generated + int8(-2), // (362) ccons ::= AS generated + int8(-2), // (363) conslist_opt ::= COMMA conslist + int8(-3), // (364) conslist ::= conslist tconscomma tcons + int8(-1), // (365) conslist ::= tcons + int8(0), // (366) tconscomma ::= + int8(-1), // (367) defer_subclause_opt ::= defer_subclause + int8(-1), // (368) resolvetype ::= raisetype + int8(-1), // (369) selectnowith ::= oneselect + int8(-1), // (370) oneselect ::= values + int8(-2), // (371) sclp ::= selcollist COMMA + int8(-1), // (372) as ::= ID|STRING + int8(0), // (373) returning ::= + int8(-1), // (374) expr ::= term + int8(-1), // (375) likeop ::= LIKE_KW|MATCH + int8(-1), // (376) exprlist ::= nexprlist + int8(-1), // (377) nmnum ::= plus_num + int8(-1), // (378) nmnum ::= nm + int8(-1), // (379) nmnum ::= ON + int8(-1), // (380) nmnum ::= DELETE + int8(-1), // (381) nmnum ::= DEFAULT + int8(-1), // (382) plus_num ::= INTEGER|FLOAT + int8(0), // (383) foreach_clause ::= + int8(-3), // (384) foreach_clause ::= FOR EACH ROW + int8(-1), // (385) trnm ::= nm + int8(0), // (386) tridxby ::= + int8(-1), // (387) database_kw_opt ::= DATABASE + int8(0), // (388) database_kw_opt ::= + int8(0), // (389) kwcolumn_opt ::= + int8(-1), // (390) kwcolumn_opt ::= COLUMNKW + int8(-1), // (391) vtabarglist ::= vtabarg + int8(-3), // (392) vtabarglist ::= vtabarglist COMMA vtabarg + int8(-2), // (393) vtabarg ::= vtabarg vtabargtoken + int8(0), // (394) anylist ::= + int8(-4), // (395) anylist ::= anylist LP anylist RP + int8(-2), // (396) anylist ::= anylist ANY + int8(0), // (397) with ::= +} /* sqlite3.c:159980:26 */ // Forward Declaration @@ -136781,7 +139175,7 @@ var yyRuleInfoNRhs = [385]int8{ // if the lookahead token has already been consumed. As this procedure is // only called from one place, optimizing compilers will in-line it, which // means that the extra parameters have no performance impact. -func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken Token, pParse uintptr) uint16 { /* sqlite3.c:157463:21: */ +func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken Token, pParse uintptr) uint16 { /* sqlite3.c:160393:21: */ bp := tls.Alloc(128) defer tls.Free(128) @@ -136794,19 +139188,6 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in _ = yyLookaheadToken yymsp = (*YyParser)(unsafe.Pointer(yypParser)).Fyytos - // Check that the stack is large enough to grow by a single entry - // if the RHS of the rule is empty. This ensures that there is room - // enough on the stack to push the LHS value - if int32(yyRuleInfoNRhs[yyruleno]) == 0 { - if (*YyParser)(unsafe.Pointer(yypParser)).Fyytos >= (*YyParser)(unsafe.Pointer(yypParser)).FyystackEnd { - yyStackOverflow(tls, yypParser) - // The call to yyStackOverflow() above pops the stack until it is - // empty, causing the main parser loop to exit. So the return value - // is never used and does not matter. - return uint16(0) - } - } - switch yyruleno { // Beginning here are the reduction cases. A typical example // follows: @@ -136849,7 +139230,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough case uint32(7): /* transtype ::= EXCLUSIVE */ fallthrough - case uint32(306): /* range_or_rows ::= RANGE|ROWS|GROUPS */ + case uint32(318): /* range_or_rows ::= RANGE|ROWS|GROUPS */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/ } @@ -136902,7 +139283,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough case uint32(96): /* distinct ::= */ fallthrough - case uint32(232): /* collate ::= */ + case uint32(239): /* collate ::= */ { *(*int32)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = 0 } @@ -136932,11 +139313,11 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(22): /* table_options ::= WITHOUT nm */ { - if ((*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fn == uint32(5)) && (Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fz, ts+13865 /* "rowid" */, 5) == 0) { + if ((*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fn == uint32(5)) && (Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fz, ts+14294 /* "rowid" */, 5) == 0) { *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = (TF_WithoutRowid | TF_NoVisibleRowid) } else { *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 0 - Xsqlite3ErrorMsg(tls, pParse, ts+20205 /* "unknown table op..." */, libc.VaList(bp, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fn, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fz)) + Xsqlite3ErrorMsg(tls, pParse, ts+20729 /* "unknown table op..." */, libc.VaList(bp, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fn, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fz)) } } break @@ -137033,12 +139414,12 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in case uint32(38): /* ccons ::= UNIQUE onconf */ { Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), uintptr(0), *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), uintptr(0), 0, 0, - SQLITE_IDXTYPE_UNIQUE) + uint8(SQLITE_IDXTYPE_UNIQUE)) } break case uint32(39): /* ccons ::= CHECK LP expr RP */ { - Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) + Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*24+8 /* &.minor */)).Fz, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fz) } break case uint32(40): /* ccons ::= REFERENCES nm eidlist_opt refargs */ @@ -137073,31 +139454,31 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(48): /* refargs ::= refargs refarg */ { - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = ((*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) & ^*(*int32)(unsafe.Pointer((yymsp + 8 /* &.minor */ /* &.yy207 */) + 4 /* &.mask */))) | *(*int32)(unsafe.Pointer((yymsp + 8 /* &.minor */ /* &.yy207 */) /* &.value */))) + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = ((*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) & ^*(*int32)(unsafe.Pointer((yymsp + 8 /* &.minor */ /* &.yy615 */) + 4 /* &.mask */))) | *(*int32)(unsafe.Pointer((yymsp + 8 /* &.minor */ /* &.yy615 */) /* &.value */))) } break case uint32(49): /* refarg ::= MATCH nm */ { - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy207 */ /* &.value */)) = 0 - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy207 */ + 4 /* &.mask */)) = 0x000000 + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy615 */ /* &.value */)) = 0 + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy615 */ + 4 /* &.mask */)) = 0x000000 } break case uint32(50): /* refarg ::= ON INSERT refact */ { - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy207 */ /* &.value */)) = 0 - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy207 */ + 4 /* &.mask */)) = 0x000000 + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy615 */ /* &.value */)) = 0 + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy615 */ + 4 /* &.mask */)) = 0x000000 } break case uint32(51): /* refarg ::= ON DELETE refact */ { - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy207 */ /* &.value */)) = *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy207 */ + 4 /* &.mask */)) = 0x0000ff + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy615 */ /* &.value */)) = *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy615 */ + 4 /* &.mask */)) = 0x0000ff } break case uint32(52): /* refarg ::= ON UPDATE refact */ { - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy207 */ /* &.value */)) = (*(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) << 8) - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy207 */ + 4 /* &.mask */)) = 0x00ff00 + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy615 */ /* &.value */)) = (*(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) << 8) + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy615 */ + 4 /* &.mask */)) = 0x00ff00 } break case uint32(53): /* refact ::= SET NULL */ @@ -137134,7 +139515,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough // defer_subclause ::= DEFERRABLE init_deferred_pred_opt case uint32(74): /* orconf ::= OR resolvetype */ fallthrough - case uint32(162): /* insert_cmd ::= INSERT orconf */ + case uint32(169): /* insert_cmd ::= INSERT orconf */ { *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } @@ -137143,11 +139524,11 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough // init_deferred_pred_opt ::= INITIALLY DEFERRED case uint32(78): /* ifexists ::= IF EXISTS */ fallthrough - case uint32(204): /* between_op ::= NOT BETWEEN */ + case uint32(211): /* between_op ::= NOT BETWEEN */ fallthrough - case uint32(207): /* in_op ::= NOT IN */ + case uint32(214): /* in_op ::= NOT IN */ fallthrough - case uint32(233): /* collate ::= COLLATE ID|STRING */ + case uint32(240): /* collate ::= COLLATE ID|STRING */ { *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 1 } @@ -137170,12 +139551,12 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in case uint32(67): /* tcons ::= UNIQUE LP sortlist RP onconf */ { Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), uintptr(0), 0, 0, - SQLITE_IDXTYPE_UNIQUE) + uint8(SQLITE_IDXTYPE_UNIQUE)) } break case uint32(68): /* tcons ::= CHECK LP expr RP onconf */ { - Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) + Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */)).Fz, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz) } break case uint32(69): /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */ @@ -137203,7 +139584,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(76): fallthrough // resolvetype ::= REPLACE - case uint32(163): /* insert_cmd ::= REPLACE */ + case uint32(170): /* insert_cmd ::= REPLACE */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = OE_Replace } @@ -137225,33 +139606,19 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(82): /* cmd ::= select */ { - *(*SelectDest)(unsafe.Pointer(bp + 24 /* dest */)) = SelectDest{FeDest: SRT_Output} + *(*SelectDest)(unsafe.Pointer(bp + 24 /* dest */)) = SelectDest{FeDest: U8(SRT_Output)} Xsqlite3Select(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), bp+24 /* &dest */) Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break case uint32(83): /* select ::= WITH wqlist selectnowith */ { - var p uintptr = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) - if p != 0 { - (*Select)(unsafe.Pointer(p)).FpWith = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) - parserDoubleLinkSelect(tls, pParse, p) - } else { - Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) - } - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = p + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = attachWithToSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) } break case uint32(84): /* select ::= WITH RECURSIVE wqlist selectnowith */ { - var p uintptr = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) - if p != 0 { - (*Select)(unsafe.Pointer(p)).FpWith = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) - parserDoubleLinkSelect(tls, pParse, p) - } else { - Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) - } - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = p + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = attachWithToSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) } break case uint32(85): /* select ::= selectnowith */ @@ -137321,7 +139688,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(92): /* values ::= VALUES LP nexprlist RP */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), SF_Values, uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) } break case uint32(93): /* values ::= values COMMA LP nexprlist RP */ @@ -137333,7 +139700,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*U32)(unsafe.Pointer(pLeft + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_MultiValue))) } if pRight != 0 { - (*Select)(unsafe.Pointer(pRight)).Fop = TK_ALL + (*Select)(unsafe.Pointer(pRight)).Fop = U8(TK_ALL) (*Select)(unsafe.Pointer(pRight)).FpPrior = pLeft *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = pRight } else { @@ -137357,11 +139724,11 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough case uint32(140): /* groupby_opt ::= */ fallthrough - case uint32(220): /* exprlist ::= */ + case uint32(227): /* exprlist ::= */ fallthrough - case uint32(223): /* paren_exprlist ::= */ + case uint32(230): /* paren_exprlist ::= */ fallthrough - case uint32(228): /* eidlist_opt ::= */ + case uint32(235): /* eidlist_opt ::= */ { *(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = uintptr(0) } @@ -137393,9 +139760,9 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough // as ::= AS nm case uint32(112): /* dbnm ::= DOT nm */ fallthrough - case uint32(244): /* plus_num ::= PLUS INTEGER|FLOAT */ + case uint32(251): /* plus_num ::= PLUS INTEGER|FLOAT */ fallthrough - case uint32(245): /* minus_num ::= MINUS INTEGER|FLOAT */ + case uint32(252): /* minus_num ::= MINUS INTEGER|FLOAT */ { *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } @@ -137416,7 +139783,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in case uint32(105): /* stl_prefix ::= seltablist joinop */ { if (*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0) && ((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnSrc > 0) { - (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnSrc-1))*112)).Ffg.Fjointype = U8(*(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */))) + (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnSrc-1))*112)).Ffg.Fjointype = U8(*(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } } break @@ -137447,23 +139814,23 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) != 0 { var pNew uintptr = ((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)))).FnSrc-1))*112) var pOld uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 8 /* &.a */ - (*SrcList_item)(unsafe.Pointer(pNew)).FzName = (*SrcList_item)(unsafe.Pointer(pOld)).FzName - (*SrcList_item)(unsafe.Pointer(pNew)).FzDatabase = (*SrcList_item)(unsafe.Pointer(pOld)).FzDatabase - (*SrcList_item)(unsafe.Pointer(pNew)).FpSelect = (*SrcList_item)(unsafe.Pointer(pOld)).FpSelect + (*SrcItem)(unsafe.Pointer(pNew)).FzName = (*SrcItem)(unsafe.Pointer(pOld)).FzName + (*SrcItem)(unsafe.Pointer(pNew)).FzDatabase = (*SrcItem)(unsafe.Pointer(pOld)).FzDatabase + (*SrcItem)(unsafe.Pointer(pNew)).FpSelect = (*SrcItem)(unsafe.Pointer(pOld)).FpSelect if (uint32(int32(*(*uint8)(unsafe.Pointer(pOld + 60 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 { *(*uintptr)(unsafe.Pointer(pNew + 96 /* &.u1 */)) = *(*uintptr)(unsafe.Pointer(pOld + 96 /* &.u1 */)) *(*uintptr)(unsafe.Pointer(pOld + 96 /* &.u1 */)) = uintptr(0) libc.SetBitFieldPtr8Uint32(pOld+60 /* &.fg */ +4 /* &.isTabFunc */, uint32(0), 2, 0x4) libc.SetBitFieldPtr8Uint32(pNew+60 /* &.fg */ +4 /* &.isTabFunc */, uint32(1), 2, 0x4) } - (*SrcList_item)(unsafe.Pointer(pOld)).FzName = libc.AssignPtrUintptr(pOld+8 /* &.zDatabase */, uintptr(0)) - (*SrcList_item)(unsafe.Pointer(pOld)).FpSelect = uintptr(0) + (*SrcItem)(unsafe.Pointer(pOld)).FzName = libc.AssignPtrUintptr(pOld+8 /* &.zDatabase */, uintptr(0)) + (*SrcItem)(unsafe.Pointer(pOld)).FpSelect = uintptr(0) } Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */))) } else { var pSubquery uintptr Xsqlite3SrcListShiftJoinType(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */))) - pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), SF_NestedFrom, uintptr(0)) + pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_NestedFrom), uintptr(0)) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), pSubquery, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } @@ -137481,7 +139848,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + 8 /* &.minor */ /* &.yy0 */), uintptr(0)) if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && (*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) != 0) { - Xsqlite3RenameTokenMap(tls, pParse, (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) + 8 /* &.a */))).FzName, (yymsp + 8 /* &.minor */ /* &.yy0 */)) + Xsqlite3RenameTokenMap(tls, pParse, (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) + 8 /* &.a */))).FzName, (yymsp + 8 /* &.minor */ /* &.yy0 */)) } } *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) @@ -137490,7 +139857,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */)) if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && (*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) != 0) { - Xsqlite3RenameTokenMap(tls, pParse, (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) + 8 /* &.a */))).FzName, (yymsp + 8 /* &.minor */ /* &.yy0 */)) + Xsqlite3RenameTokenMap(tls, pParse, (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) + 8 /* &.a */))).FzName, (yymsp + 8 /* &.minor */ /* &.yy0 */)) } } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) @@ -137509,7 +139876,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */)) //A-overwrites-X if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 { - (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 8 /* &.a */))).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + 8 /* &.minor */ /* &.yy0 */)) + (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 8 /* &.a */))).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + 8 /* &.minor */ /* &.yy0 */)) } } break @@ -137517,7 +139884,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0)) //A-overwrites-X if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) != 0 { - (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 8 /* &.a */))).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + 8 /* &.minor */ /* &.yy0 */)) + (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 8 /* &.a */))).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + 8 /* &.minor */ /* &.yy0 */)) } } break @@ -137547,9 +139914,11 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough case uint32(150): /* where_opt ::= WHERE expr */ fallthrough - case uint32(216): /* case_else ::= ELSE expr */ + case uint32(152): /* where_opt_ret ::= WHERE expr */ fallthrough - case uint32(237): /* vinto ::= INTO expr */ + case uint32(223): /* case_else ::= ELSE expr */ + fallthrough + case uint32(244): /* vinto ::= INTO expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } @@ -137562,11 +139931,13 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough case uint32(149): /* where_opt ::= */ fallthrough - case uint32(217): /* case_else ::= */ + case uint32(151): /* where_opt_ret ::= */ fallthrough - case uint32(219): /* case_operand ::= */ + case uint32(224): /* case_else ::= */ fallthrough - case uint32(238): /* vinto ::= */ + case uint32(226): /* case_operand ::= */ + fallthrough + case uint32(245): /* vinto ::= */ { *(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = uintptr(0) } @@ -137589,7 +139960,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(129): fallthrough // using_opt ::= - case uint32(164): /* idlist_opt ::= */ + case uint32(171): /* idlist_opt ::= */ { *(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = uintptr(0) } @@ -137655,101 +140026,129 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_LIMIT, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) } break - case uint32(148): /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt */ + case uint32(148): /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */ { Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */)) Xsqlite3DeleteFrom(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), uintptr(0)) } break - case uint32(151): /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt */ + case uint32(153): /* where_opt_ret ::= RETURNING selcollist */ + { + Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = uintptr(0) + } + break + case uint32(154): /* where_opt_ret ::= WHERE expr RETURNING selcollist */ + { + Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + } + break + case uint32(155): /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ { Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */)) - Xsqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), ts+20232 /* "set list" */) + Xsqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), ts+20756 /* "set list" */) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendList(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) Xsqlite3Update(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0)) } break - case uint32(152): /* setlist ::= setlist COMMA nm EQ expr */ + case uint32(156): /* setlist ::= setlist COMMA nm EQ expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1) } break - case uint32(153): /* setlist ::= setlist COMMA LP idlist RP EQ expr */ + case uint32(157): /* setlist ::= setlist COMMA LP idlist RP EQ expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppendVector(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(154): /* setlist ::= nm EQ expr */ + case uint32(158): /* setlist ::= nm EQ expr */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(155): /* setlist ::= LP idlist RP EQ expr */ + case uint32(159): /* setlist ::= LP idlist RP EQ expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppendVector(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(156): /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */ + case uint32(160): /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */ { Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(157): /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */ + case uint32(161): /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */ { - Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), uintptr(0)) + Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0)) } break - case uint32(158): /* upsert ::= */ + case uint32(162): /* upsert ::= */ { *(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = uintptr(0) } break - case uint32(159): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */ + case uint32(163): /* upsert ::= RETURNING selcollist */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = uintptr(0) + Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(160): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */ + case uint32(164): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-11)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(161): /* upsert ::= ON CONFLICT DO NOTHING */ + case uint32(165): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(165): /* idlist_opt ::= LP idlist RP */ + case uint32(166): /* upsert ::= ON CONFLICT DO NOTHING returning */ + { + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + } + break + case uint32(167): /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */ + { + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0)) + } + break + case uint32(168): /* returning ::= RETURNING selcollist */ + { + Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) + } + break + case uint32(172): /* idlist_opt ::= LP idlist RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break - case uint32(166): /* idlist ::= idlist COMMA nm */ + case uint32(173): /* idlist ::= idlist COMMA nm */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3IdListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(167): /* idlist ::= nm */ + case uint32(174): /* idlist ::= nm */ { *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = Xsqlite3IdListAppend(tls, pParse, uintptr(0), (yymsp + 8 /* &.minor */ /* &.yy0 */)) /*A-overwrites-Y*/ } break - case uint32(168): /* expr ::= LP expr RP */ + case uint32(175): /* expr ::= LP expr RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break - case uint32(169): + case uint32(176): fallthrough // expr ::= ID|INDEXED - case uint32(170): /* expr ::= JOIN_KW */ + case uint32(177): /* expr ::= JOIN_KW */ { *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = tokenExpr(tls, pParse, TK_ID, *(*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */))) /*A-overwrites-X*/ } break - case uint32(171): /* expr ::= nm DOT nm */ + case uint32(178): /* expr ::= nm DOT nm */ { var temp1 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1) var temp2 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + 8 /* &.minor */ /* &.yy0 */), 1) @@ -137761,7 +140160,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(172): /* expr ::= nm DOT nm DOT nm */ + case uint32(179): /* expr ::= nm DOT nm DOT nm */ { var temp1 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), 1) var temp2 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1) @@ -137775,20 +140174,20 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(173): + case uint32(180): fallthrough // term ::= NULL|FLOAT|BLOB - case uint32(174): /* term ::= STRING */ + case uint32(181): /* term ::= STRING */ { *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = tokenExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor), *(*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */))) /*A-overwrites-X*/ } break - case uint32(175): /* term ::= INTEGER */ + case uint32(182): /* term ::= INTEGER */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, (yymsp + 8 /* &.minor */ /* &.yy0 */), 1) } *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(176): /* expr ::= VARIABLE */ + case uint32(183): /* expr ::= VARIABLE */ { if !((int32(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */)).Fz))) == '#') && ((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fz + 1)))]) & 0x04) != 0)) { var n U32 = (*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */)).Fn @@ -137801,7 +140200,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*Token)(unsafe.Pointer(bp + 96 /* t */)) = *(*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */)) //A-overwrites-X if int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+20241 /* "near \"%T\": synta..." */, libc.VaList(bp+16, bp+96 /* &t */)) + Xsqlite3ErrorMsg(tls, pParse, ts+20765 /* "near \"%T\": synta..." */, libc.VaList(bp+16, bp+96 /* &t */)) *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = uintptr(0) } else { *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_REGISTER, uintptr(0), uintptr(0)) @@ -137812,50 +140211,50 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } } break - case uint32(177): /* expr ::= expr COLLATE ID|STRING */ + case uint32(184): /* expr ::= expr COLLATE ID|STRING */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprAddCollateToken(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + 8 /* &.minor */ /* &.yy0 */), 1) } break - case uint32(178): /* expr ::= CAST LP expr AS typetoken RP */ + case uint32(185): /* expr ::= CAST LP expr AS typetoken RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_CAST, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 1) Xsqlite3ExprAttachSubtrees(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0)) } break - case uint32(179): /* expr ::= ID|INDEXED LP distinct exprlist RP */ + case uint32(186): /* expr ::= ID|INDEXED LP distinct exprlist RP */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(180): /* expr ::= ID|INDEXED LP STAR RP */ + case uint32(187): /* expr ::= ID|INDEXED LP STAR RP */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), 0) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(181): /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */ + case uint32(188): /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */))) Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(182): /* expr ::= ID|INDEXED LP STAR RP filter_over */ + case uint32(189): /* expr ::= ID|INDEXED LP STAR RP filter_over */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), 0) Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(183): /* term ::= CTIME_KW */ + case uint32(190): /* term ::= CTIME_KW */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + 8 /* &.minor */ /* &.yy0 */), 0) } *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(184): /* expr ::= LP nexprlist COMMA expr RP */ + case uint32(191): /* expr ::= LP nexprlist COMMA expr RP */ { var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_VECTOR, uintptr(0), uintptr(0)) @@ -137869,35 +140268,35 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } } break - case uint32(185): /* expr ::= expr AND expr */ + case uint32(192): /* expr ::= expr AND expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprAnd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(186): + case uint32(193): fallthrough // expr ::= expr OR expr - case uint32(187): /* expr ::= expr LT|GT|GE|LE expr */ + case uint32(194): /* expr ::= expr LT|GT|GE|LE expr */ fallthrough - case uint32(188): /* expr ::= expr EQ|NE expr */ + case uint32(195): /* expr ::= expr EQ|NE expr */ fallthrough - case uint32(189): /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ + case uint32(196): /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ fallthrough - case uint32(190): /* expr ::= expr PLUS|MINUS expr */ + case uint32(197): /* expr ::= expr PLUS|MINUS expr */ fallthrough - case uint32(191): /* expr ::= expr STAR|SLASH|REM expr */ + case uint32(198): /* expr ::= expr STAR|SLASH|REM expr */ fallthrough - case uint32(192): /* expr ::= expr CONCAT expr */ + case uint32(199): /* expr ::= expr CONCAT expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(193): /* likeop ::= NOT LIKE_KW|MATCH */ + case uint32(200): /* likeop ::= NOT LIKE_KW|MATCH */ { *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */)) *(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */ + 8 /* &.n */)) |= (0x80000000) /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/ } break - case uint32(194): /* expr ::= expr likeop expr */ + case uint32(201): /* expr ::= expr likeop expr */ { var pList uintptr var bNot int32 = (int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fn & 0x80000000)) @@ -137909,11 +140308,11 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0)) } if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) != 0 { - *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (EP_InfixFunc) + *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (U32(EP_InfixFunc)) } } break - case uint32(195): /* expr ::= expr likeop expr ESCAPE expr */ + case uint32(202): /* expr ::= expr likeop expr ESCAPE expr */ { var pList uintptr var bNot int32 = (int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */)).Fn & 0x80000000)) @@ -137926,40 +140325,40 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0)) } if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 { - *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (EP_InfixFunc) + *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (U32(EP_InfixFunc)) } } break - case uint32(196): /* expr ::= expr ISNULL|NOTNULL */ + case uint32(203): /* expr ::= expr ISNULL|NOTNULL */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0)) } break - case uint32(197): /* expr ::= expr NOT NULL */ + case uint32(204): /* expr ::= expr NOT NULL */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOTNULL, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0)) } break - case uint32(198): /* expr ::= expr IS expr */ + case uint32(205): /* expr ::= expr IS expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_IS, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), TK_ISNULL) } break - case uint32(199): /* expr ::= expr IS NOT expr */ + case uint32(206): /* expr ::= expr IS NOT expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_ISNOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), TK_NOTNULL) } break - case uint32(200): + case uint32(207): fallthrough // expr ::= NOT expr - case uint32(201): /* expr ::= BITNOT expr */ + case uint32(208): /* expr ::= BITNOT expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0)) /*A-overwrites-B*/ } break - case uint32(202): /* expr ::= PLUS|MINUS expr */ + case uint32(209): /* expr ::= PLUS|MINUS expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, func() int32 { if int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor) == TK_PLUS { @@ -137970,14 +140369,14 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in //A-overwrites-B } break - case uint32(203): + case uint32(210): fallthrough // between_op ::= BETWEEN - case uint32(206): /* in_op ::= IN */ + case uint32(213): /* in_op ::= IN */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = 0 } break - case uint32(205): /* expr ::= expr between_op expr AND expr */ + case uint32(212): /* expr ::= expr between_op expr AND expr */ { var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) @@ -137992,7 +140391,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } } break - case uint32(208): /* expr ::= expr in_op LP exprlist RP */ + case uint32(215): /* expr ::= expr in_op LP exprlist RP */ { if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) == uintptr(0) { // Expressions of the form @@ -138005,9 +140404,9 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in Xsqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */))) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, func() uintptr { if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 { - return ts + 6737 /* "1" */ + return ts + 6782 /* "1" */ } - return ts + 6319 /* "0" */ + return ts + 6375 /* "0" */ }()) } else if ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnExpr == 1) && (Xsqlite3ExprIsConstant(tls, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))+8 /* &.a */))).FpExpr) != 0) { var pRHS uintptr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) + 8 /* &.a */))).FpExpr @@ -138033,14 +140432,14 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } break - case uint32(209): /* expr ::= LP select RP */ + case uint32(216): /* expr ::= LP select RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_SELECT, uintptr(0), uintptr(0)) Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) } break - case uint32(210): /* expr ::= expr in_op LP select RP */ + case uint32(217): /* expr ::= expr in_op LP select RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_IN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0)) Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) @@ -138050,7 +140449,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } break - case uint32(211): /* expr ::= expr in_op nm dbnm paren_exprlist */ + case uint32(218): /* expr ::= expr in_op nm dbnm paren_exprlist */ { var pSrc uintptr = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */)) var pSelect uintptr = Xsqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) @@ -138070,15 +140469,15 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } break - case uint32(212): /* expr ::= EXISTS LP select RP */ + case uint32(219): /* expr ::= EXISTS LP select RP */ { var p uintptr - p = libc.AssignPtrUintptr(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */ /* &.yy202 */, Xsqlite3PExpr(tls, pParse, TK_EXISTS, uintptr(0), uintptr(0))) + p = libc.AssignPtrUintptr(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */ /* &.yy602 */, Xsqlite3PExpr(tls, pParse, TK_EXISTS, uintptr(0), uintptr(0))) Xsqlite3PExprAddSelect(tls, pParse, p, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) } break - case uint32(213): /* expr ::= CASE case_operand case_exprlist case_else END */ + case uint32(220): /* expr ::= CASE case_operand case_exprlist case_else END */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_CASE, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 { @@ -138095,113 +140494,113 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } } break - case uint32(214): /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ + case uint32(221): /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(215): /* case_exprlist ::= WHEN expr THEN expr */ + case uint32(222): /* case_exprlist ::= WHEN expr THEN expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(218): /* case_operand ::= expr */ + case uint32(225): /* case_operand ::= expr */ { *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) /*A-overwrites-X*/ } break - case uint32(221): /* nexprlist ::= nexprlist COMMA expr */ + case uint32(228): /* nexprlist ::= nexprlist COMMA expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(222): /* nexprlist ::= expr */ + case uint32(229): /* nexprlist ::= expr */ { *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) /*A-overwrites-Y*/ } break - case uint32(224): + case uint32(231): fallthrough // paren_exprlist ::= LP exprlist RP - case uint32(229): /* eidlist_opt ::= LP eidlist RP */ + case uint32(236): /* eidlist_opt ::= LP eidlist RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break - case uint32(225): /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ + case uint32(232): /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ { Xsqlite3CreateIndex(tls, pParse, (yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */), Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */ /* &.yy0 */), uintptr(0)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)), - (yymsp + libc.UintptrFromInt32(-11)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), SQLITE_SO_ASC, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), SQLITE_IDXTYPE_APPDEF) + (yymsp + libc.UintptrFromInt32(-11)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), SQLITE_SO_ASC, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), uint8(SQLITE_IDXTYPE_APPDEF)) if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*Parse)(unsafe.Pointer(pParse)).FpNewIndex != 0) { Xsqlite3RenameTokenMap(tls, pParse, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpNewIndex)).FzName, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */)) } } break - case uint32(226): + case uint32(233): fallthrough // uniqueflag ::= UNIQUE - case uint32(268): /* raisetype ::= ABORT */ + case uint32(275): /* raisetype ::= ABORT */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = OE_Abort } break - case uint32(227): /* uniqueflag ::= */ + case uint32(234): /* uniqueflag ::= */ { *(*int32)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = OE_None } break - case uint32(230): /* eidlist ::= eidlist COMMA nm collate sortorder */ + case uint32(237): /* eidlist ::= eidlist COMMA nm collate sortorder */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = parserAddExprIdListTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(231): /* eidlist ::= nm collate sortorder */ + case uint32(238): /* eidlist ::= nm collate sortorder */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = parserAddExprIdListTerm(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */))) //A-overwrites-Y } break - case uint32(234): /* cmd ::= DROP INDEX ifexists fullname */ + case uint32(241): /* cmd ::= DROP INDEX ifexists fullname */ { Xsqlite3DropIndex(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) } break - case uint32(235): /* cmd ::= VACUUM vinto */ + case uint32(242): /* cmd ::= VACUUM vinto */ { Xsqlite3Vacuum(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(236): /* cmd ::= VACUUM nm vinto */ + case uint32(243): /* cmd ::= VACUUM nm vinto */ { Xsqlite3Vacuum(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(239): /* cmd ::= PRAGMA nm dbnm */ + case uint32(246): /* cmd ::= PRAGMA nm dbnm */ { Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */), uintptr(0), 0) } break - case uint32(240): /* cmd ::= PRAGMA nm dbnm EQ nmnum */ + case uint32(247): /* cmd ::= PRAGMA nm dbnm EQ nmnum */ { Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */), 0) } break - case uint32(241): /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ + case uint32(248): /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ { Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 0) } break - case uint32(242): /* cmd ::= PRAGMA nm dbnm EQ minus_num */ + case uint32(249): /* cmd ::= PRAGMA nm dbnm EQ minus_num */ { Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */), 1) } break - case uint32(243): /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ + case uint32(250): /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ { Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 1) } break - case uint32(246): /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ + case uint32(253): /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ { // var all Token at bp+112, 16 @@ -138210,7 +140609,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in Xsqlite3FinishTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), bp+112 /* &all */) } break - case uint32(247): /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ + case uint32(254): /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ { Xsqlite3BeginTrigger(tls, pParse, (yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (*TrigEvent)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fa, (*TrigEvent)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */))) *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)) = func() Token1 { @@ -138221,117 +140620,117 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in }() //A-overwrites-T } break - case uint32(248): /* trigger_time ::= BEFORE|AFTER */ + case uint32(255): /* trigger_time ::= BEFORE|AFTER */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/ } break - case uint32(249): /* trigger_time ::= INSTEAD OF */ + case uint32(256): /* trigger_time ::= INSTEAD OF */ { *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = TK_INSTEAD } break - case uint32(250): /* trigger_time ::= */ + case uint32(257): /* trigger_time ::= */ { *(*int32)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = TK_BEFORE } break - case uint32(251): + case uint32(258): fallthrough // trigger_event ::= DELETE|INSERT - case uint32(252): /* trigger_event ::= UPDATE */ + case uint32(259): /* trigger_event ::= UPDATE */ { (*TrigEvent)(unsafe.Pointer(yymsp + 8 /* &.minor */)).Fa = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/ (*TrigEvent)(unsafe.Pointer(yymsp + 8 /* &.minor */)).Fb = uintptr(0) } break - case uint32(253): /* trigger_event ::= UPDATE OF idlist */ + case uint32(260): /* trigger_event ::= UPDATE OF idlist */ { (*TrigEvent)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fa = TK_UPDATE (*TrigEvent)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fb = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } break - case uint32(254): + case uint32(261): fallthrough // when_clause ::= - case uint32(273): /* key_opt ::= */ + case uint32(280): /* key_opt ::= */ { *(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = uintptr(0) } break - case uint32(255): + case uint32(262): fallthrough // when_clause ::= WHEN expr - case uint32(274): /* key_opt ::= KEY expr */ + case uint32(281): /* key_opt ::= KEY expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } break - case uint32(256): /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ + case uint32(263): /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ { (*TriggerStep)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))).FpLast)).FpNext = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) (*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break - case uint32(257): /* trigger_cmd_list ::= trigger_cmd SEMI */ + case uint32(264): /* trigger_cmd_list ::= trigger_cmd SEMI */ { (*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break - case uint32(258): /* trnm ::= nm DOT nm */ + case uint32(265): /* trnm ::= nm DOT nm */ { *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */)) Xsqlite3ErrorMsg(tls, pParse, - ts+20265 /* "qualified table ..." */, 0) + ts+20789 /* "qualified table ..." */, 0) } break - case uint32(259): /* tridxby ::= INDEXED BY nm */ + case uint32(266): /* tridxby ::= INDEXED BY nm */ { Xsqlite3ErrorMsg(tls, pParse, - ts+20360 /* "the INDEXED BY c..." */, 0) + ts+20884 /* "the INDEXED BY c..." */, 0) } break - case uint32(260): /* tridxby ::= NOT INDEXED */ + case uint32(267): /* tridxby ::= NOT INDEXED */ { Xsqlite3ErrorMsg(tls, pParse, - ts+20444 /* "the NOT INDEXED ..." */, 0) + ts+20968 /* "the NOT INDEXED ..." */, 0) } break - case uint32(261): /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ + case uint32(268): /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerUpdateStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */))), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-8)*24+8 /* &.minor */)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(262): /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ + case uint32(269): /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ { - *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerInsertStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */))), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) //yylhsminor.yy447-overwrites-yymsp[-6].minor.yy192 + *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerInsertStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */))), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) //yylhsminor.yy483-overwrites-yymsp[-6].minor.yy60 } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(263): /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ + case uint32(270): /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerDeleteStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-5)*24+8 /* &.minor */)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(264): /* trigger_cmd ::= scanpt select scanpt */ + case uint32(271): /* trigger_cmd ::= scanpt select scanpt */ { - *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerSelectStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) /*yylhsminor.yy447-overwrites-yymsp[-1].minor.yy539*/ + *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerSelectStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) /*yylhsminor.yy483-overwrites-yymsp[-1].minor.yy307*/ } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(265): /* expr ::= RAISE LP IGNORE RP */ + case uint32(272): /* expr ::= RAISE LP IGNORE RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_RAISE, uintptr(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 { - (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))).FaffExpr = OE_Ignore + (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))).FaffExpr = int8(OE_Ignore) } } break - case uint32(266): /* expr ::= RAISE LP raisetype COMMA nm RP */ + case uint32(273): /* expr ::= RAISE LP raisetype COMMA nm RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_RAISE, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 1) if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) != 0 { @@ -138339,126 +140738,151 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } } break - case uint32(267): /* raisetype ::= ROLLBACK */ + case uint32(274): /* raisetype ::= ROLLBACK */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = OE_Rollback } break - case uint32(269): /* raisetype ::= FAIL */ + case uint32(276): /* raisetype ::= FAIL */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = OE_Fail } break - case uint32(270): /* cmd ::= DROP TRIGGER ifexists fullname */ + case uint32(277): /* cmd ::= DROP TRIGGER ifexists fullname */ { Xsqlite3DropTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) } break - case uint32(271): /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ + case uint32(278): /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ { Xsqlite3Attach(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(272): /* cmd ::= DETACH database_kw_opt expr */ + case uint32(279): /* cmd ::= DETACH database_kw_opt expr */ { Xsqlite3Detach(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(275): /* cmd ::= REINDEX */ + case uint32(282): /* cmd ::= REINDEX */ { Xsqlite3Reindex(tls, pParse, uintptr(0), uintptr(0)) } break - case uint32(276): /* cmd ::= REINDEX nm dbnm */ + case uint32(283): /* cmd ::= REINDEX nm dbnm */ { Xsqlite3Reindex(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(277): /* cmd ::= ANALYZE */ + case uint32(284): /* cmd ::= ANALYZE */ { Xsqlite3Analyze(tls, pParse, uintptr(0), uintptr(0)) } break - case uint32(278): /* cmd ::= ANALYZE nm dbnm */ + case uint32(285): /* cmd ::= ANALYZE nm dbnm */ { Xsqlite3Analyze(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(279): /* cmd ::= ALTER TABLE fullname RENAME TO nm */ + case uint32(286): /* cmd ::= ALTER TABLE fullname RENAME TO nm */ { Xsqlite3AlterRenameTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(280): /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ + case uint32(287): /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ { (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fn = (uint32((int32((int64((*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fz) - int64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz)) / 1))) + (*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fn) Xsqlite3AlterFinishAddColumn(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(281): /* add_column_fullname ::= fullname */ + case uint32(288): /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */ + { + Xsqlite3AlterDropColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), (yymsp + 8 /* &.minor */ /* &.yy0 */)) + } + break + case uint32(289): /* add_column_fullname ::= fullname */ { disableLookaside(tls, pParse) Xsqlite3AlterBeginAddColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(282): /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */ + case uint32(290): /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */ { Xsqlite3AlterRenameColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(283): /* cmd ::= create_vtab */ + case uint32(291): /* cmd ::= create_vtab */ { Xsqlite3VtabFinishParse(tls, pParse, uintptr(0)) } break - case uint32(284): /* cmd ::= create_vtab LP vtabarglist RP */ + case uint32(292): /* cmd ::= create_vtab LP vtabarglist RP */ { Xsqlite3VtabFinishParse(tls, pParse, (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(285): /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ + case uint32(293): /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ { Xsqlite3VtabBeginParse(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */))) } break - case uint32(286): /* vtabarg ::= */ + case uint32(294): /* vtabarg ::= */ { Xsqlite3VtabArgInit(tls, pParse) } break - case uint32(287): + case uint32(295): fallthrough // vtabargtoken ::= ANY - case uint32(288): /* vtabargtoken ::= lp anylist RP */ + case uint32(296): /* vtabargtoken ::= lp anylist RP */ fallthrough - case uint32(289): /* lp ::= LP */ + case uint32(297): /* lp ::= LP */ { Xsqlite3VtabArgExtend(tls, pParse, (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(290): + case uint32(298): fallthrough // with ::= WITH wqlist - case uint32(291): /* with ::= WITH RECURSIVE wqlist */ + case uint32(299): /* with ::= WITH RECURSIVE wqlist */ { Xsqlite3WithPush(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uint8(1)) } break - case uint32(292): /* wqlist ::= nm eidlist_opt AS LP select RP */ + case uint32(300): /* wqas ::= AS */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) //A-overwrites-X + *(*U8)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = U8(M10d_Any) } break - case uint32(293): /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */ + case uint32(301): /* wqas ::= AS MATERIALIZED */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) + *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = U8(M10d_Yes) } break - case uint32(294): /* windowdefn_list ::= windowdefn */ + case uint32(302): /* wqas ::= AS NOT MATERIALIZED */ + { + *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = U8(M10d_No) + } + break + case uint32(303): /* wqitem ::= nm eidlist_opt wqas LP select RP */ + { + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3CteNew(tls, pParse, (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */))) //A-overwrites-X + } + break + case uint32(304): /* wqlist ::= wqitem */ + { + *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) //A-overwrites-X + } + break + case uint32(305): /* wqlist ::= wqlist COMMA wqitem */ + { + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) + } + break + case uint32(306): /* windowdefn_list ::= windowdefn */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(295): /* windowdefn_list ::= windowdefn_list COMMA windowdefn */ + case uint32(307): /* windowdefn_list ::= windowdefn_list COMMA windowdefn */ { Xsqlite3WindowChain(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) @@ -138467,7 +140891,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(296): /* windowdefn ::= nm AS LP window RP */ + case uint32(308): /* windowdefn ::= nm AS LP window RP */ { if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0 { (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FzName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fz, uint64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fn)) @@ -138476,124 +140900,124 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(297): /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */ + case uint32(309): /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0)) } break - case uint32(298): /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */ + case uint32(310): /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */)) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(299): /* window ::= ORDER BY sortlist frame_opt */ + case uint32(311): /* window ::= ORDER BY sortlist frame_opt */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0)) } break - case uint32(300): /* window ::= nm ORDER BY sortlist frame_opt */ + case uint32(312): /* window ::= nm ORDER BY sortlist frame_opt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */)) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(301): + case uint32(313): fallthrough // window ::= frame_opt - case uint32(320): /* filter_over ::= over_clause */ + case uint32(332): /* filter_over ::= over_clause */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(302): /* window ::= nm frame_opt */ + case uint32(314): /* window ::= nm frame_opt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */)) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(303): /* frame_opt ::= */ + case uint32(315): /* frame_opt ::= */ { *(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = Xsqlite3WindowAlloc(tls, pParse, 0, TK_UNBOUNDED, uintptr(0), TK_CURRENT, uintptr(0), uint8(0)) } break - case uint32(304): /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */ + case uint32(316): /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).FpExpr, TK_CURRENT, uintptr(0), *(*U8)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(305): /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */ + case uint32(317): /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */)).FpExpr, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).FpExpr, *(*U8)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(307): + case uint32(319): fallthrough // frame_bound_s ::= frame_bound - case uint32(309): /* frame_bound_e ::= frame_bound */ + case uint32(321): /* frame_bound_e ::= frame_bound */ { *(*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*FrameBound)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } *(*FrameBound)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(308): + case uint32(320): fallthrough // frame_bound_s ::= UNBOUNDED PRECEDING - case uint32(310): /* frame_bound_e ::= UNBOUNDED FOLLOWING */ + case uint32(322): /* frame_bound_e ::= UNBOUNDED FOLLOWING */ fallthrough - case uint32(312): /* frame_bound ::= CURRENT ROW */ + case uint32(324): /* frame_bound ::= CURRENT ROW */ { (*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24)).Fmajor) (*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)).FpExpr = uintptr(0) } *(*FrameBound)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(311): /* frame_bound ::= expr PRECEDING|FOLLOWING */ + case uint32(323): /* frame_bound ::= expr PRECEDING|FOLLOWING */ { (*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) (*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)).FpExpr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } *(*FrameBound)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(313): /* frame_exclude_opt ::= */ + case uint32(325): /* frame_exclude_opt ::= */ { *(*U8)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = U8(0) } break - case uint32(314): /* frame_exclude_opt ::= EXCLUDE frame_exclude */ + case uint32(326): /* frame_exclude_opt ::= EXCLUDE frame_exclude */ { *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*U8)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } break - case uint32(315): + case uint32(327): fallthrough // frame_exclude ::= NO OTHERS - case uint32(316): /* frame_exclude ::= CURRENT ROW */ + case uint32(328): /* frame_exclude ::= CURRENT ROW */ { *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = U8((*YyStackEntry)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24)).Fmajor) /*A-overwrites-X*/ } break - case uint32(317): /* frame_exclude ::= GROUP|TIES */ + case uint32(329): /* frame_exclude ::= GROUP|TIES */ { *(*U8)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = U8((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/ } break - case uint32(318): /* window_clause ::= WINDOW windowdefn_list */ + case uint32(330): /* window_clause ::= WINDOW windowdefn_list */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } break - case uint32(319): /* filter_over ::= filter_clause over_clause */ + case uint32(331): /* filter_over ::= filter_clause over_clause */ { (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(321): /* filter_over ::= filter_clause */ + case uint32(333): /* filter_over ::= filter_clause */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{}))) if *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) != 0 { - (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FeFrmType = TK_FILTER + (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FeFrmType = U8(TK_FILTER) (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } else { Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) @@ -138601,13 +141025,13 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(322): /* over_clause ::= OVER LP window RP */ + case uint32(334): /* over_clause ::= OVER LP window RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break - case uint32(323): /* over_clause ::= OVER nm */ + case uint32(335): /* over_clause ::= OVER nm */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{}))) if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0 { @@ -138615,72 +141039,73 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } } break - case uint32(324): /* filter_clause ::= FILTER LP WHERE expr RP */ + case uint32(336): /* filter_clause ::= FILTER LP WHERE expr RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break default: - /* (325) input ::= cmdlist */ - /* (326) cmdlist ::= cmdlist ecmd */ - /* (327) cmdlist ::= ecmd (OPTIMIZED OUT) */ - /* (328) ecmd ::= SEMI */ - /* (329) ecmd ::= cmdx SEMI */ - /* (330) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ - /* (331) trans_opt ::= */ - /* (332) trans_opt ::= TRANSACTION */ - /* (333) trans_opt ::= TRANSACTION nm */ - /* (334) savepoint_opt ::= SAVEPOINT */ - /* (335) savepoint_opt ::= */ - /* (336) cmd ::= create_table create_table_args */ - /* (337) columnlist ::= columnlist COMMA columnname carglist */ - /* (338) columnlist ::= columnname carglist */ - /* (339) nm ::= ID|INDEXED */ - /* (340) nm ::= STRING */ - /* (341) nm ::= JOIN_KW */ - /* (342) typetoken ::= typename */ - /* (343) typename ::= ID|STRING */ - /* (344) signed ::= plus_num (OPTIMIZED OUT) */ - /* (345) signed ::= minus_num (OPTIMIZED OUT) */ - /* (346) carglist ::= carglist ccons */ - /* (347) carglist ::= */ - /* (348) ccons ::= NULL onconf */ - /* (349) ccons ::= GENERATED ALWAYS AS generated */ - /* (350) ccons ::= AS generated */ - /* (351) conslist_opt ::= COMMA conslist */ - /* (352) conslist ::= conslist tconscomma tcons */ - /* (353) conslist ::= tcons (OPTIMIZED OUT) */ - /* (354) tconscomma ::= */ - /* (355) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ - /* (356) resolvetype ::= raisetype (OPTIMIZED OUT) */ - /* (357) selectnowith ::= oneselect (OPTIMIZED OUT) */ - /* (358) oneselect ::= values */ - /* (359) sclp ::= selcollist COMMA */ - /* (360) as ::= ID|STRING */ - /* (361) expr ::= term (OPTIMIZED OUT) */ - /* (362) likeop ::= LIKE_KW|MATCH */ - /* (363) exprlist ::= nexprlist */ - /* (364) nmnum ::= plus_num (OPTIMIZED OUT) */ - /* (365) nmnum ::= nm (OPTIMIZED OUT) */ - /* (366) nmnum ::= ON */ - /* (367) nmnum ::= DELETE */ - /* (368) nmnum ::= DEFAULT */ - /* (369) plus_num ::= INTEGER|FLOAT */ - /* (370) foreach_clause ::= */ - /* (371) foreach_clause ::= FOR EACH ROW */ - /* (372) trnm ::= nm */ - /* (373) tridxby ::= */ - /* (374) database_kw_opt ::= DATABASE */ - /* (375) database_kw_opt ::= */ - /* (376) kwcolumn_opt ::= */ - /* (377) kwcolumn_opt ::= COLUMNKW */ - /* (378) vtabarglist ::= vtabarg */ - /* (379) vtabarglist ::= vtabarglist COMMA vtabarg */ - /* (380) vtabarg ::= vtabarg vtabargtoken */ - /* (381) anylist ::= */ - /* (382) anylist ::= anylist LP anylist RP */ - /* (383) anylist ::= anylist ANY */ - /* (384) with ::= */ + /* (337) input ::= cmdlist */ + /* (338) cmdlist ::= cmdlist ecmd */ + /* (339) cmdlist ::= ecmd (OPTIMIZED OUT) */ + /* (340) ecmd ::= SEMI */ + /* (341) ecmd ::= cmdx SEMI */ + /* (342) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ + /* (343) trans_opt ::= */ + /* (344) trans_opt ::= TRANSACTION */ + /* (345) trans_opt ::= TRANSACTION nm */ + /* (346) savepoint_opt ::= SAVEPOINT */ + /* (347) savepoint_opt ::= */ + /* (348) cmd ::= create_table create_table_args */ + /* (349) columnlist ::= columnlist COMMA columnname carglist */ + /* (350) columnlist ::= columnname carglist */ + /* (351) nm ::= ID|INDEXED */ + /* (352) nm ::= STRING */ + /* (353) nm ::= JOIN_KW */ + /* (354) typetoken ::= typename */ + /* (355) typename ::= ID|STRING */ + /* (356) signed ::= plus_num (OPTIMIZED OUT) */ + /* (357) signed ::= minus_num (OPTIMIZED OUT) */ + /* (358) carglist ::= carglist ccons */ + /* (359) carglist ::= */ + /* (360) ccons ::= NULL onconf */ + /* (361) ccons ::= GENERATED ALWAYS AS generated */ + /* (362) ccons ::= AS generated */ + /* (363) conslist_opt ::= COMMA conslist */ + /* (364) conslist ::= conslist tconscomma tcons */ + /* (365) conslist ::= tcons (OPTIMIZED OUT) */ + /* (366) tconscomma ::= */ + /* (367) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ + /* (368) resolvetype ::= raisetype (OPTIMIZED OUT) */ + /* (369) selectnowith ::= oneselect (OPTIMIZED OUT) */ + /* (370) oneselect ::= values */ + /* (371) sclp ::= selcollist COMMA */ + /* (372) as ::= ID|STRING */ + /* (373) returning ::= */ + /* (374) expr ::= term (OPTIMIZED OUT) */ + /* (375) likeop ::= LIKE_KW|MATCH */ + /* (376) exprlist ::= nexprlist */ + /* (377) nmnum ::= plus_num (OPTIMIZED OUT) */ + /* (378) nmnum ::= nm (OPTIMIZED OUT) */ + /* (379) nmnum ::= ON */ + /* (380) nmnum ::= DELETE */ + /* (381) nmnum ::= DEFAULT */ + /* (382) plus_num ::= INTEGER|FLOAT */ + /* (383) foreach_clause ::= */ + /* (384) foreach_clause ::= FOR EACH ROW */ + /* (385) trnm ::= nm */ + /* (386) tridxby ::= */ + /* (387) database_kw_opt ::= DATABASE */ + /* (388) database_kw_opt ::= */ + /* (389) kwcolumn_opt ::= */ + /* (390) kwcolumn_opt ::= COLUMNKW */ + /* (391) vtabarglist ::= vtabarg */ + /* (392) vtabarglist ::= vtabarglist COMMA vtabarg */ + /* (393) vtabarg ::= vtabarg vtabargtoken */ + /* (394) anylist ::= */ + /* (395) anylist ::= anylist LP anylist RP */ + /* (396) anylist ::= anylist ANY */ + /* (397) with ::= */ break //********* End reduce actions *********************************************** } @@ -138705,7 +141130,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in // The following code executes when the parse fails // The following code executes when a syntax error first occurs. -func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:159012:13: */ +func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:161913:13: */ bp := tls.Alloc(24) defer tls.Free(24) *(*Token)(unsafe.Pointer(bp + 8)) = yyminor @@ -138715,9 +141140,9 @@ func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor To _ = yymajor // Silence some compiler warnings if *(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp + 8 /* &yyminor */)).Fz)) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+20241 /* "near \"%T\": synta..." */, libc.VaList(bp, bp+8 /* &yyminor */)) + Xsqlite3ErrorMsg(tls, pParse, ts+20765 /* "near \"%T\": synta..." */, libc.VaList(bp, bp+8 /* &yyminor */)) } else { - Xsqlite3ErrorMsg(tls, pParse, ts+20529 /* "incomplete input" */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+21053 /* "incomplete input" */, 0) } //*********** End %syntax_error code ***************************************** @@ -138725,7 +141150,7 @@ func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor To } // The following is executed when the parser accepts -func yy_accept(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:159036:13: */ +func yy_accept(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:161937:13: */ var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse @@ -138755,7 +141180,7 @@ func yy_accept(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:159036:13: */ // // Outputs: // None. -func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:159077:21: */ +func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:161978:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -138767,12 +141192,22 @@ func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) { yyact = (*YyStackEntry)(unsafe.Pointer((*YyParser)(unsafe.Pointer(yypParser)).Fyytos)).Fstateno - for ok := true; ok; ok = ((*YyParser)(unsafe.Pointer(yypParser)).Fyytos > yypParser+16 /* &.yystack */) { + for 1 != 0 { // Exit by "break" yyact = yy_find_shift_action(tls, uint16(yymajor), yyact) if int32(yyact) >= YY_MIN_REDUCE { - yyact = yy_reduce(tls, yypParser, (uint32(int32(yyact) - YY_MIN_REDUCE)), yymajor, - yyminor, pParse) + var yyruleno uint32 = (uint32(int32(yyact) - YY_MIN_REDUCE)) // Reduce by this rule + + // Check that the stack is large enough to grow by a single entry + // if the RHS of the rule is empty. This ensures that there is room + // enough on the stack to push the LHS value + if int32(yyRuleInfoNRhs[yyruleno]) == 0 { + if (*YyParser)(unsafe.Pointer(yypParser)).Fyytos >= (*YyParser)(unsafe.Pointer(yypParser)).FyystackEnd { + yyStackOverflow(tls, yypParser) + break + } + } + yyact = yy_reduce(tls, yypParser, yyruleno, yymajor, yyminor, pParse) } else if int32(yyact) <= YY_MAX_SHIFTREDUCE { yy_shift(tls, yypParser, yyact, uint16(yymajor), yyminor) break @@ -138799,7 +141234,7 @@ func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) { // Return the fallback token corresponding to canonical token iToken, or // 0 if iToken has no fallback. -func Xsqlite3ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:159251:20: */ +func Xsqlite3ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:162196:20: */ return int32(yyFallback[iToken]) } @@ -138834,14 +141269,14 @@ func Xsqlite3ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:15 var aiClass = [256]uint8{ // x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf - /* 0x */ uint8(28), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(7), uint8(7), uint8(27), uint8(7), uint8(7), uint8(27), uint8(27), - /* 1x */ uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), + /* 0x */ uint8(29), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(7), uint8(7), uint8(28), uint8(7), uint8(7), uint8(28), uint8(28), + /* 1x */ uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), /* 2x */ uint8(7), uint8(15), uint8(8), uint8(5), uint8(4), uint8(22), uint8(24), uint8(8), uint8(17), uint8(18), uint8(21), uint8(20), uint8(23), uint8(11), uint8(26), uint8(16), /* 3x */ uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(5), uint8(19), uint8(12), uint8(14), uint8(13), uint8(6), /* 4x */ uint8(5), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), - /* 5x */ uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(1), uint8(1), uint8(9), uint8(27), uint8(27), uint8(27), uint8(1), + /* 5x */ uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(2), uint8(2), uint8(9), uint8(28), uint8(28), uint8(28), uint8(2), /* 6x */ uint8(8), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), - /* 7x */ uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(1), uint8(1), uint8(27), uint8(10), uint8(27), uint8(25), uint8(27), + /* 7x */ uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(2), uint8(2), uint8(28), uint8(10), uint8(28), uint8(25), uint8(28), /* 8x */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), /* 9x */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), /* Ax */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), @@ -138850,7 +141285,7 @@ var aiClass = [256]uint8{ /* Dx */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), /* Ex */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), /* Fx */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), -} /* sqlite3.c:159321:28 */ +} /* sqlite3.c:162267:28 */ // The charMap() macro maps alphabetic characters (only) into their // lower-case ASCII equivalent. On ASCII machines, this is just @@ -138884,20 +141319,21 @@ var aiClass = [256]uint8{ // 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: 227 -// zKWText[] encodes 984 bytes of keyword text in 648 bytes +// Hash score: 231 +// zKWText[] encodes 1007 bytes of keyword text in 667 bytes // REINDEXEDESCAPEACHECKEYBEFOREIGNOREGEXPLAINSTEADDATABASELECT // ABLEFTHENDEFERRABLELSEXCLUDELETEMPORARYISNULLSAVEPOINTERSECT // IESNOTNULLIKEXCEPTRANSACTIONATURALTERAISEXCLUSIVEXISTS // CONSTRAINTOFFSETRIGGERANGENERATEDETACHAVINGLOBEGINNEREFERENCES // UNIQUERYWITHOUTERELEASEATTACHBETWEENOTHINGROUPSCASCADEFAULT // CASECOLLATECREATECURRENT_DATEIMMEDIATEJOINSERTMATCHPLANALYZE -// PRAGMABORTUPDATEVALUESVIRTUALWAYSWHENWHERECURSIVEAFTERENAMEAND -// EFERREDISTINCTAUTOINCREMENTCASTCOLUMNCOMMITCONFLICTCROSS -// CURRENT_TIMESTAMPARTITIONDROPRECEDINGFAILASTFILTEREPLACEFIRST -// FOLLOWINGFROMFULLIMITIFORDERESTRICTOTHERSOVERIGHTROLLBACKROWS -// UNBOUNDEDUNIONUSINGVACUUMVIEWINDOWBYINITIALLYPRIMARY -var zKWText = [647]int8{ +// PRAGMATERIALIZEDEFERREDISTINCTUPDATEVALUESVIRTUALWAYSWHENWHERE +// CURSIVEABORTAFTERENAMEANDROPARTITIONAUTOINCREMENTCASTCOLUMN +// COMMITCONFLICTCROSSCURRENT_TIMESTAMPRECEDINGFAILASTFILTER +// EPLACEFIRSTFOLLOWINGFROMFULLIMITIFORDERESTRICTOTHERSOVER +// ETURNINGRIGHTROLLBACKROWSUNBOUNDEDUNIONUSINGVACUUMVIEWINDOWBY +// INITIALLYPRIMARY +var zKWText = [666]int8{ int8('R'), int8('E'), int8('I'), int8('N'), int8('D'), int8('E'), int8('X'), int8('E'), int8('D'), int8('E'), int8('S'), int8('C'), int8('A'), int8('P'), int8('E'), int8('A'), int8('C'), int8('H'), int8('E'), int8('C'), int8('K'), int8('E'), int8('Y'), int8('B'), int8('E'), int8('F'), int8('O'), int8('R'), int8('E'), int8('I'), int8('G'), int8('N'), int8('O'), int8('R'), int8('E'), int8('G'), int8('E'), int8('X'), int8('P'), int8('L'), int8('A'), int8('I'), int8('N'), int8('S'), int8('T'), int8('E'), int8('A'), int8('D'), int8('D'), int8('A'), int8('T'), int8('A'), int8('B'), int8('A'), @@ -138918,116 +141354,118 @@ var zKWText = [647]int8{ int8('C'), int8('R'), int8('E'), int8('A'), int8('T'), int8('E'), int8('C'), int8('U'), int8('R'), int8('R'), int8('E'), int8('N'), int8('T'), int8('_'), int8('D'), int8('A'), int8('T'), int8('E'), int8('I'), int8('M'), int8('M'), int8('E'), int8('D'), int8('I'), int8('A'), int8('T'), int8('E'), int8('J'), int8('O'), int8('I'), int8('N'), int8('S'), int8('E'), int8('R'), int8('T'), int8('M'), int8('A'), int8('T'), int8('C'), int8('H'), int8('P'), int8('L'), int8('A'), int8('N'), int8('A'), int8('L'), int8('Y'), int8('Z'), int8('E'), int8('P'), int8('R'), int8('A'), int8('G'), int8('M'), - int8('A'), int8('B'), int8('O'), int8('R'), int8('T'), int8('U'), int8('P'), int8('D'), int8('A'), int8('T'), int8('E'), int8('V'), int8('A'), int8('L'), int8('U'), int8('E'), int8('S'), int8('V'), - int8('I'), int8('R'), int8('T'), int8('U'), int8('A'), int8('L'), int8('W'), int8('A'), int8('Y'), int8('S'), int8('W'), int8('H'), int8('E'), int8('N'), int8('W'), int8('H'), int8('E'), int8('R'), - int8('E'), int8('C'), int8('U'), int8('R'), int8('S'), int8('I'), int8('V'), int8('E'), int8('A'), int8('F'), int8('T'), int8('E'), int8('R'), int8('E'), int8('N'), int8('A'), int8('M'), int8('E'), - int8('A'), int8('N'), int8('D'), int8('E'), int8('F'), int8('E'), int8('R'), int8('R'), int8('E'), int8('D'), int8('I'), int8('S'), int8('T'), int8('I'), int8('N'), int8('C'), int8('T'), int8('A'), - int8('U'), int8('T'), int8('O'), int8('I'), int8('N'), int8('C'), int8('R'), int8('E'), int8('M'), int8('E'), int8('N'), int8('T'), int8('C'), int8('A'), int8('S'), int8('T'), int8('C'), int8('O'), - int8('L'), int8('U'), int8('M'), int8('N'), int8('C'), int8('O'), int8('M'), int8('M'), int8('I'), int8('T'), int8('C'), int8('O'), int8('N'), int8('F'), int8('L'), int8('I'), int8('C'), int8('T'), - int8('C'), int8('R'), int8('O'), int8('S'), int8('S'), int8('C'), int8('U'), int8('R'), int8('R'), int8('E'), int8('N'), int8('T'), int8('_'), int8('T'), int8('I'), int8('M'), int8('E'), int8('S'), - int8('T'), int8('A'), int8('M'), int8('P'), int8('A'), int8('R'), int8('T'), int8('I'), int8('T'), int8('I'), int8('O'), int8('N'), int8('D'), int8('R'), int8('O'), int8('P'), int8('R'), int8('E'), - int8('C'), int8('E'), int8('D'), int8('I'), int8('N'), int8('G'), int8('F'), int8('A'), int8('I'), int8('L'), int8('A'), int8('S'), int8('T'), int8('F'), int8('I'), int8('L'), int8('T'), int8('E'), - int8('R'), int8('E'), int8('P'), int8('L'), int8('A'), int8('C'), int8('E'), int8('F'), int8('I'), int8('R'), int8('S'), int8('T'), int8('F'), int8('O'), int8('L'), int8('L'), int8('O'), int8('W'), - int8('I'), int8('N'), int8('G'), int8('F'), int8('R'), int8('O'), int8('M'), int8('F'), int8('U'), int8('L'), int8('L'), int8('I'), int8('M'), int8('I'), int8('T'), int8('I'), int8('F'), int8('O'), - int8('R'), int8('D'), int8('E'), int8('R'), int8('E'), int8('S'), int8('T'), int8('R'), int8('I'), int8('C'), int8('T'), int8('O'), int8('T'), int8('H'), int8('E'), int8('R'), int8('S'), int8('O'), - int8('V'), int8('E'), int8('R'), int8('I'), int8('G'), int8('H'), int8('T'), int8('R'), int8('O'), int8('L'), int8('L'), int8('B'), int8('A'), int8('C'), int8('K'), int8('R'), int8('O'), int8('W'), - int8('S'), int8('U'), int8('N'), int8('B'), int8('O'), int8('U'), int8('N'), int8('D'), int8('E'), int8('D'), int8('U'), int8('N'), int8('I'), int8('O'), int8('N'), int8('U'), int8('S'), int8('I'), - int8('N'), int8('G'), int8('V'), int8('A'), int8('C'), int8('U'), int8('U'), int8('M'), int8('V'), int8('I'), int8('E'), int8('W'), int8('I'), int8('N'), int8('D'), int8('O'), int8('W'), int8('B'), - int8('Y'), int8('I'), int8('N'), int8('I'), int8('T'), int8('I'), int8('A'), int8('L'), int8('L'), int8('Y'), int8('P'), int8('R'), int8('I'), int8('M'), int8('A'), int8('R'), int8('Y'), -} /* sqlite3.c:159436:19 */ + int8('A'), int8('T'), int8('E'), int8('R'), int8('I'), int8('A'), int8('L'), int8('I'), int8('Z'), int8('E'), int8('D'), int8('E'), int8('F'), int8('E'), int8('R'), int8('R'), int8('E'), int8('D'), + int8('I'), int8('S'), int8('T'), int8('I'), int8('N'), int8('C'), int8('T'), int8('U'), int8('P'), int8('D'), int8('A'), int8('T'), int8('E'), int8('V'), int8('A'), int8('L'), int8('U'), int8('E'), + int8('S'), int8('V'), int8('I'), int8('R'), int8('T'), int8('U'), int8('A'), int8('L'), int8('W'), int8('A'), int8('Y'), int8('S'), int8('W'), int8('H'), int8('E'), int8('N'), int8('W'), int8('H'), + int8('E'), int8('R'), int8('E'), int8('C'), int8('U'), int8('R'), int8('S'), int8('I'), int8('V'), int8('E'), int8('A'), int8('B'), int8('O'), int8('R'), int8('T'), int8('A'), int8('F'), int8('T'), + int8('E'), int8('R'), int8('E'), int8('N'), int8('A'), int8('M'), int8('E'), int8('A'), int8('N'), int8('D'), int8('R'), int8('O'), int8('P'), int8('A'), int8('R'), int8('T'), int8('I'), int8('T'), + int8('I'), int8('O'), int8('N'), int8('A'), int8('U'), int8('T'), int8('O'), int8('I'), int8('N'), int8('C'), int8('R'), int8('E'), int8('M'), int8('E'), int8('N'), int8('T'), int8('C'), int8('A'), + int8('S'), int8('T'), int8('C'), int8('O'), int8('L'), int8('U'), int8('M'), int8('N'), int8('C'), int8('O'), int8('M'), int8('M'), int8('I'), int8('T'), int8('C'), int8('O'), int8('N'), int8('F'), + int8('L'), int8('I'), int8('C'), int8('T'), int8('C'), int8('R'), int8('O'), int8('S'), int8('S'), int8('C'), int8('U'), int8('R'), int8('R'), int8('E'), int8('N'), int8('T'), int8('_'), int8('T'), + int8('I'), int8('M'), int8('E'), int8('S'), int8('T'), int8('A'), int8('M'), int8('P'), int8('R'), int8('E'), int8('C'), int8('E'), int8('D'), int8('I'), int8('N'), int8('G'), int8('F'), int8('A'), + int8('I'), int8('L'), int8('A'), int8('S'), int8('T'), int8('F'), int8('I'), int8('L'), int8('T'), int8('E'), int8('R'), int8('E'), int8('P'), int8('L'), int8('A'), int8('C'), int8('E'), int8('F'), + int8('I'), int8('R'), int8('S'), int8('T'), int8('F'), int8('O'), int8('L'), int8('L'), int8('O'), int8('W'), int8('I'), int8('N'), int8('G'), int8('F'), int8('R'), int8('O'), int8('M'), int8('F'), + int8('U'), int8('L'), int8('L'), int8('I'), int8('M'), int8('I'), int8('T'), int8('I'), int8('F'), int8('O'), int8('R'), int8('D'), int8('E'), int8('R'), int8('E'), int8('S'), int8('T'), int8('R'), + int8('I'), int8('C'), int8('T'), int8('O'), int8('T'), int8('H'), int8('E'), int8('R'), int8('S'), int8('O'), int8('V'), int8('E'), int8('R'), int8('E'), int8('T'), int8('U'), int8('R'), int8('N'), + int8('I'), int8('N'), int8('G'), int8('R'), int8('I'), int8('G'), int8('H'), int8('T'), int8('R'), int8('O'), int8('L'), int8('L'), int8('B'), int8('A'), int8('C'), int8('K'), int8('R'), int8('O'), + int8('W'), int8('S'), int8('U'), int8('N'), int8('B'), int8('O'), int8('U'), int8('N'), int8('D'), int8('E'), int8('D'), int8('U'), int8('N'), int8('I'), int8('O'), int8('N'), int8('U'), int8('S'), + int8('I'), int8('N'), int8('G'), int8('V'), int8('A'), int8('C'), int8('U'), int8('U'), int8('M'), int8('V'), int8('I'), int8('E'), int8('W'), int8('I'), int8('N'), int8('D'), int8('O'), int8('W'), + int8('B'), int8('Y'), int8('I'), int8('N'), int8('I'), int8('T'), int8('I'), int8('A'), int8('L'), int8('L'), int8('Y'), int8('P'), int8('R'), int8('I'), int8('M'), int8('A'), int8('R'), int8('Y'), +} /* sqlite3.c:162383:19 */ // aKWHash[i] is the hash value for the i-th keyword var aKWHash = [127]uint8{ - uint8(84), uint8(102), uint8(132), uint8(82), uint8(114), uint8(29), uint8(0), uint8(0), uint8(91), uint8(0), uint8(85), uint8(72), uint8(0), - uint8(53), uint8(35), uint8(86), uint8(15), uint8(0), uint8(42), uint8(94), uint8(54), uint8(126), uint8(133), uint8(19), uint8(0), uint8(0), - uint8(138), uint8(0), uint8(40), uint8(128), uint8(0), uint8(22), uint8(104), uint8(0), uint8(9), uint8(0), uint8(0), uint8(122), uint8(80), - uint8(0), uint8(78), uint8(6), uint8(0), uint8(65), uint8(99), uint8(145), uint8(0), uint8(134), uint8(112), uint8(0), uint8(0), uint8(48), - uint8(0), uint8(100), uint8(24), uint8(0), uint8(17), uint8(0), uint8(27), uint8(70), uint8(23), uint8(26), uint8(5), uint8(60), uint8(140), - uint8(107), uint8(121), uint8(0), uint8(73), uint8(101), uint8(71), uint8(143), uint8(61), uint8(119), uint8(74), uint8(0), uint8(49), uint8(0), - uint8(11), uint8(41), uint8(0), uint8(110), uint8(0), uint8(0), uint8(0), uint8(106), uint8(10), uint8(108), uint8(113), uint8(124), uint8(14), - uint8(50), uint8(123), uint8(0), uint8(89), uint8(0), uint8(18), uint8(120), uint8(142), uint8(56), uint8(129), uint8(137), uint8(88), uint8(83), - uint8(37), uint8(30), uint8(125), uint8(0), uint8(0), uint8(105), uint8(51), uint8(130), uint8(127), uint8(0), uint8(34), uint8(0), uint8(0), - uint8(44), uint8(0), uint8(95), uint8(38), uint8(39), uint8(0), uint8(20), uint8(45), uint8(116), uint8(90), -} /* sqlite3.c:159475:28 */ + uint8(84), uint8(92), uint8(134), uint8(82), uint8(105), uint8(29), uint8(0), uint8(0), uint8(94), uint8(0), uint8(85), uint8(72), uint8(0), + uint8(53), uint8(35), uint8(86), uint8(15), uint8(0), uint8(42), uint8(97), uint8(54), uint8(89), uint8(135), uint8(19), uint8(0), uint8(0), + uint8(140), uint8(0), uint8(40), uint8(129), uint8(0), uint8(22), uint8(107), uint8(0), uint8(9), uint8(0), uint8(0), uint8(123), uint8(80), + uint8(0), uint8(78), uint8(6), uint8(0), uint8(65), uint8(103), uint8(147), uint8(0), uint8(136), uint8(115), uint8(0), uint8(0), uint8(48), + uint8(0), uint8(90), uint8(24), uint8(0), uint8(17), uint8(0), uint8(27), uint8(70), uint8(23), uint8(26), uint8(5), uint8(60), uint8(142), + uint8(110), uint8(122), uint8(0), uint8(73), uint8(91), uint8(71), uint8(145), uint8(61), uint8(120), uint8(74), uint8(0), uint8(49), uint8(0), + uint8(11), uint8(41), uint8(0), uint8(113), uint8(0), uint8(0), uint8(0), uint8(109), uint8(10), uint8(111), uint8(116), uint8(125), uint8(14), + uint8(50), uint8(124), uint8(0), uint8(100), uint8(0), uint8(18), uint8(121), uint8(144), uint8(56), uint8(130), uint8(139), uint8(88), uint8(83), + uint8(37), uint8(30), uint8(126), uint8(0), uint8(0), uint8(108), uint8(51), uint8(131), uint8(128), uint8(0), uint8(34), uint8(0), uint8(0), + uint8(132), uint8(0), uint8(98), uint8(38), uint8(39), uint8(0), uint8(20), uint8(45), uint8(117), uint8(93), +} /* sqlite3.c:162423:28 */ // aKWNext[] forms the hash collision chain. If aKWHash[i]==0 // then the i-th keyword has no more hash collisions. Otherwise, // the next keyword with the same hash is aKWHash[i]-1. -var aKWNext = [145]uint8{ - uint8(0), uint8(0), uint8(0), uint8(0), uint8(4), uint8(0), uint8(43), uint8(0), uint8(0), uint8(103), uint8(111), uint8(0), uint8(0), - uint8(0), uint8(2), uint8(0), uint8(0), uint8(141), uint8(0), uint8(0), uint8(0), uint8(13), uint8(0), uint8(0), uint8(0), uint8(0), - uint8(139), uint8(0), uint8(0), uint8(118), uint8(52), uint8(0), uint8(0), uint8(135), uint8(12), uint8(0), uint8(0), uint8(62), uint8(0), - uint8(136), uint8(0), uint8(131), uint8(0), uint8(0), uint8(36), uint8(0), uint8(0), uint8(28), uint8(77), uint8(0), uint8(0), uint8(0), +var aKWNext = [147]uint8{ + uint8(0), uint8(0), uint8(0), uint8(0), uint8(4), uint8(0), uint8(43), uint8(0), uint8(0), uint8(106), uint8(114), uint8(0), uint8(0), + uint8(0), uint8(2), uint8(0), uint8(0), uint8(143), uint8(0), uint8(0), uint8(0), uint8(13), uint8(0), uint8(0), uint8(0), uint8(0), + uint8(141), uint8(0), uint8(0), uint8(119), uint8(52), uint8(0), uint8(0), uint8(137), uint8(12), uint8(0), uint8(0), uint8(62), uint8(0), + uint8(138), uint8(0), uint8(133), uint8(0), uint8(0), uint8(36), uint8(0), uint8(0), uint8(28), uint8(77), uint8(0), uint8(0), uint8(0), uint8(0), uint8(59), uint8(0), uint8(47), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), - uint8(0), uint8(69), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(144), uint8(3), uint8(0), uint8(58), uint8(0), uint8(1), - uint8(75), uint8(0), uint8(0), uint8(0), uint8(31), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(64), uint8(66), - uint8(63), uint8(0), uint8(0), uint8(0), uint8(0), uint8(46), uint8(0), uint8(16), uint8(0), uint8(115), uint8(0), uint8(0), uint8(0), - uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(81), uint8(97), uint8(0), uint8(8), uint8(0), uint8(109), - uint8(21), uint8(7), uint8(67), uint8(0), uint8(79), uint8(93), uint8(117), uint8(0), uint8(0), uint8(68), uint8(0), uint8(0), uint8(96), - uint8(0), uint8(55), uint8(0), uint8(76), uint8(0), uint8(92), uint8(32), uint8(33), uint8(57), uint8(25), uint8(0), uint8(98), uint8(0), - uint8(0), uint8(87), -} /* sqlite3.c:159490:28 */ + uint8(0), uint8(69), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(146), uint8(3), uint8(0), uint8(58), uint8(0), uint8(1), + uint8(75), uint8(0), uint8(0), uint8(0), uint8(31), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(127), uint8(0), uint8(104), + uint8(0), uint8(64), uint8(66), uint8(63), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(46), uint8(0), uint8(16), uint8(8), + uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(81), uint8(101), uint8(0), + uint8(112), uint8(21), uint8(7), uint8(67), uint8(0), uint8(79), uint8(96), uint8(118), uint8(0), uint8(0), uint8(68), uint8(0), uint8(0), + uint8(99), uint8(44), uint8(0), uint8(55), uint8(0), uint8(76), uint8(0), uint8(95), uint8(32), uint8(33), uint8(57), uint8(25), uint8(0), + uint8(102), uint8(0), uint8(0), uint8(87), +} /* sqlite3.c:162438:28 */ // aKWLen[i] is the length (in bytes) of the i-th keyword -var aKWLen = [145]uint8{ +var aKWLen = [147]uint8{ uint8(7), uint8(7), uint8(5), uint8(4), uint8(6), uint8(4), uint8(5), uint8(3), uint8(6), uint8(7), uint8(3), uint8(6), uint8(6), uint8(7), uint8(7), uint8(3), uint8(8), uint8(2), uint8(6), uint8(5), uint8(4), uint8(4), uint8(3), uint8(10), uint8(4), uint8(7), uint8(6), uint8(9), uint8(4), uint8(2), uint8(6), uint8(5), uint8(9), uint8(9), uint8(4), uint8(7), uint8(3), uint8(2), uint8(4), uint8(4), uint8(6), uint8(11), uint8(6), uint8(2), uint8(7), uint8(5), uint8(5), uint8(9), uint8(6), uint8(10), uint8(4), uint8(6), uint8(2), uint8(3), uint8(7), uint8(5), uint8(9), uint8(6), uint8(6), uint8(4), uint8(5), uint8(5), uint8(10), uint8(6), uint8(5), uint8(7), uint8(4), uint8(5), uint8(7), uint8(6), uint8(7), uint8(7), uint8(6), uint8(5), uint8(7), uint8(3), uint8(7), uint8(4), - uint8(7), uint8(6), uint8(12), uint8(9), uint8(4), uint8(6), uint8(5), uint8(4), uint8(7), uint8(6), uint8(5), uint8(6), uint8(6), - uint8(7), uint8(6), uint8(4), uint8(5), uint8(9), uint8(5), uint8(6), uint8(3), uint8(8), uint8(8), uint8(2), uint8(13), uint8(2), - uint8(2), uint8(4), uint8(6), uint8(6), uint8(8), uint8(5), uint8(17), uint8(12), uint8(7), uint8(9), uint8(4), uint8(9), uint8(4), - uint8(4), uint8(6), uint8(7), uint8(5), uint8(9), uint8(4), uint8(4), uint8(5), uint8(2), uint8(5), uint8(8), uint8(6), uint8(4), - uint8(5), uint8(8), uint8(4), uint8(3), uint8(9), uint8(5), uint8(5), uint8(6), uint8(4), uint8(6), uint8(2), uint8(2), uint8(9), - uint8(3), uint8(7), -} /* sqlite3.c:159505:28 */ + uint8(7), uint8(6), uint8(12), uint8(9), uint8(4), uint8(6), uint8(5), uint8(4), uint8(7), uint8(6), uint8(12), uint8(8), uint8(8), + uint8(2), uint8(6), uint8(6), uint8(7), uint8(6), uint8(4), uint8(5), uint8(9), uint8(5), uint8(5), uint8(6), uint8(3), uint8(4), + uint8(9), uint8(13), uint8(2), uint8(2), uint8(4), uint8(6), uint8(6), uint8(8), uint8(5), uint8(17), uint8(12), uint8(7), uint8(9), + uint8(4), uint8(4), uint8(6), uint8(7), uint8(5), uint8(9), uint8(4), uint8(4), uint8(5), uint8(2), uint8(5), uint8(8), uint8(6), + uint8(4), uint8(9), uint8(5), uint8(8), uint8(4), uint8(3), uint8(9), uint8(5), uint8(5), uint8(6), uint8(4), uint8(6), uint8(2), + uint8(2), uint8(9), uint8(3), uint8(7), +} /* sqlite3.c:162453:28 */ // aKWOffset[i] is the index into zKWText[] of the start of // the text for the i-th keyword. -var aKWOffset = [145]uint16{ +var aKWOffset = [147]uint16{ uint16(0), uint16(2), uint16(2), uint16(8), uint16(9), uint16(14), uint16(16), uint16(20), uint16(23), uint16(25), uint16(25), uint16(29), uint16(33), uint16(36), uint16(41), uint16(46), uint16(48), uint16(53), uint16(54), uint16(59), uint16(62), uint16(65), uint16(67), uint16(69), uint16(78), uint16(81), uint16(86), uint16(90), uint16(90), uint16(94), uint16(99), uint16(101), uint16(105), uint16(111), uint16(119), uint16(123), uint16(123), uint16(123), uint16(126), uint16(129), uint16(132), uint16(137), uint16(142), uint16(146), uint16(147), uint16(152), uint16(156), uint16(160), uint16(168), uint16(174), uint16(181), uint16(184), uint16(184), uint16(187), uint16(189), uint16(195), uint16(198), uint16(206), uint16(211), uint16(216), uint16(219), uint16(222), uint16(226), uint16(236), uint16(239), uint16(244), uint16(244), uint16(248), uint16(252), uint16(259), uint16(265), uint16(271), uint16(277), uint16(277), uint16(283), uint16(284), uint16(288), uint16(295), - uint16(299), uint16(306), uint16(312), uint16(324), uint16(333), uint16(335), uint16(341), uint16(346), uint16(348), uint16(355), uint16(360), uint16(365), uint16(371), - uint16(377), uint16(382), uint16(388), uint16(392), uint16(395), uint16(404), uint16(408), uint16(414), uint16(416), uint16(423), uint16(424), uint16(431), uint16(433), - uint16(435), uint16(444), uint16(448), uint16(454), uint16(460), uint16(468), uint16(473), uint16(473), uint16(473), uint16(489), uint16(498), uint16(501), uint16(510), - uint16(513), uint16(517), uint16(522), uint16(529), uint16(534), uint16(543), uint16(547), uint16(550), uint16(555), uint16(557), uint16(561), uint16(569), uint16(575), - uint16(578), uint16(583), uint16(591), uint16(591), uint16(595), uint16(604), uint16(609), uint16(614), uint16(620), uint16(623), uint16(626), uint16(629), uint16(631), - uint16(636), uint16(640), -} /* sqlite3.c:159521:33 */ + uint16(299), uint16(306), uint16(312), uint16(324), uint16(333), uint16(335), uint16(341), uint16(346), uint16(348), uint16(355), uint16(359), uint16(370), uint16(377), + uint16(378), uint16(385), uint16(391), uint16(397), uint16(402), uint16(408), uint16(412), uint16(415), uint16(424), uint16(429), uint16(433), uint16(439), uint16(441), + uint16(444), uint16(453), uint16(455), uint16(457), uint16(466), uint16(470), uint16(476), uint16(482), uint16(490), uint16(495), uint16(495), uint16(495), uint16(511), + uint16(520), uint16(523), uint16(527), uint16(532), uint16(539), uint16(544), uint16(553), uint16(557), uint16(560), uint16(565), uint16(567), uint16(571), uint16(579), + uint16(585), uint16(588), uint16(597), uint16(602), uint16(610), uint16(610), uint16(614), uint16(623), uint16(628), uint16(633), uint16(639), uint16(642), uint16(645), + uint16(648), uint16(650), uint16(655), uint16(659), +} /* sqlite3.c:162469:33 */ // aKWCode[i] is the parser symbol code for the i-th keyword -var aKWCode = [145]uint8{ - TK_REINDEX, TK_INDEXED, TK_INDEX, TK_DESC, TK_ESCAPE, - TK_EACH, TK_CHECK, TK_KEY, TK_BEFORE, TK_FOREIGN, - TK_FOR, TK_IGNORE, TK_LIKE_KW, TK_EXPLAIN, TK_INSTEAD, - TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, TK_TABLE, - TK_JOIN_KW, TK_THEN, TK_END, TK_DEFERRABLE, TK_ELSE, - TK_EXCLUDE, TK_DELETE, TK_TEMP, TK_TEMP, TK_OR, - TK_ISNULL, TK_NULLS, TK_SAVEPOINT, TK_INTERSECT, TK_TIES, - TK_NOTNULL, TK_NOT, TK_NO, TK_NULL, TK_LIKE_KW, - TK_EXCEPT, TK_TRANSACTION, TK_ACTION, TK_ON, TK_JOIN_KW, - TK_ALTER, TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_CONSTRAINT, - TK_INTO, TK_OFFSET, TK_OF, TK_SET, TK_TRIGGER, - TK_RANGE, TK_GENERATED, TK_DETACH, TK_HAVING, TK_LIKE_KW, - TK_BEGIN, TK_JOIN_KW, TK_REFERENCES, TK_UNIQUE, TK_QUERY, - TK_WITHOUT, TK_WITH, TK_JOIN_KW, TK_RELEASE, TK_ATTACH, - TK_BETWEEN, TK_NOTHING, TK_GROUPS, TK_GROUP, TK_CASCADE, - TK_ASC, TK_DEFAULT, TK_CASE, TK_COLLATE, TK_CREATE, - TK_CTIME_KW, TK_IMMEDIATE, TK_JOIN, TK_INSERT, TK_MATCH, - TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_ABORT, TK_UPDATE, - TK_VALUES, TK_VIRTUAL, TK_ALWAYS, TK_WHEN, TK_WHERE, - TK_RECURSIVE, TK_AFTER, TK_RENAME, TK_AND, TK_DEFERRED, - TK_DISTINCT, TK_IS, TK_AUTOINCR, TK_TO, TK_IN, - TK_CAST, TK_COLUMNKW, TK_COMMIT, TK_CONFLICT, TK_JOIN_KW, - TK_CTIME_KW, TK_CTIME_KW, TK_CURRENT, TK_PARTITION, TK_DROP, - TK_PRECEDING, TK_FAIL, TK_LAST, TK_FILTER, TK_REPLACE, - TK_FIRST, TK_FOLLOWING, TK_FROM, TK_JOIN_KW, TK_LIMIT, - TK_IF, TK_ORDER, TK_RESTRICT, TK_OTHERS, TK_OVER, - TK_JOIN_KW, TK_ROLLBACK, TK_ROWS, TK_ROW, TK_UNBOUNDED, - TK_UNION, TK_USING, TK_VACUUM, TK_VIEW, TK_WINDOW, - TK_DO, TK_BY, TK_INITIALLY, TK_ALL, TK_PRIMARY, -} /* sqlite3.c:159536:28 */ +var aKWCode = [147]uint8{ + uint8(TK_REINDEX), uint8(TK_INDEXED), uint8(TK_INDEX), uint8(TK_DESC), uint8(TK_ESCAPE), + uint8(TK_EACH), uint8(TK_CHECK), uint8(TK_KEY), uint8(TK_BEFORE), uint8(TK_FOREIGN), + uint8(TK_FOR), uint8(TK_IGNORE), uint8(TK_LIKE_KW), uint8(TK_EXPLAIN), uint8(TK_INSTEAD), + uint8(TK_ADD), uint8(TK_DATABASE), uint8(TK_AS), uint8(TK_SELECT), uint8(TK_TABLE), + uint8(TK_JOIN_KW), uint8(TK_THEN), uint8(TK_END), uint8(TK_DEFERRABLE), uint8(TK_ELSE), + uint8(TK_EXCLUDE), uint8(TK_DELETE), uint8(TK_TEMP), uint8(TK_TEMP), uint8(TK_OR), + uint8(TK_ISNULL), uint8(TK_NULLS), uint8(TK_SAVEPOINT), uint8(TK_INTERSECT), uint8(TK_TIES), + uint8(TK_NOTNULL), uint8(TK_NOT), uint8(TK_NO), uint8(TK_NULL), uint8(TK_LIKE_KW), + uint8(TK_EXCEPT), uint8(TK_TRANSACTION), uint8(TK_ACTION), uint8(TK_ON), uint8(TK_JOIN_KW), + uint8(TK_ALTER), uint8(TK_RAISE), uint8(TK_EXCLUSIVE), uint8(TK_EXISTS), uint8(TK_CONSTRAINT), + uint8(TK_INTO), uint8(TK_OFFSET), uint8(TK_OF), uint8(TK_SET), uint8(TK_TRIGGER), + uint8(TK_RANGE), uint8(TK_GENERATED), uint8(TK_DETACH), uint8(TK_HAVING), uint8(TK_LIKE_KW), + uint8(TK_BEGIN), uint8(TK_JOIN_KW), uint8(TK_REFERENCES), uint8(TK_UNIQUE), uint8(TK_QUERY), + uint8(TK_WITHOUT), uint8(TK_WITH), uint8(TK_JOIN_KW), uint8(TK_RELEASE), uint8(TK_ATTACH), + uint8(TK_BETWEEN), uint8(TK_NOTHING), uint8(TK_GROUPS), uint8(TK_GROUP), uint8(TK_CASCADE), + uint8(TK_ASC), uint8(TK_DEFAULT), uint8(TK_CASE), uint8(TK_COLLATE), uint8(TK_CREATE), + uint8(TK_CTIME_KW), uint8(TK_IMMEDIATE), uint8(TK_JOIN), uint8(TK_INSERT), uint8(TK_MATCH), + uint8(TK_PLAN), uint8(TK_ANALYZE), uint8(TK_PRAGMA), uint8(TK_MATERIALIZED), uint8(TK_DEFERRED), + uint8(TK_DISTINCT), uint8(TK_IS), uint8(TK_UPDATE), uint8(TK_VALUES), uint8(TK_VIRTUAL), + uint8(TK_ALWAYS), uint8(TK_WHEN), uint8(TK_WHERE), uint8(TK_RECURSIVE), uint8(TK_ABORT), + uint8(TK_AFTER), uint8(TK_RENAME), uint8(TK_AND), uint8(TK_DROP), uint8(TK_PARTITION), + uint8(TK_AUTOINCR), uint8(TK_TO), uint8(TK_IN), uint8(TK_CAST), uint8(TK_COLUMNKW), + uint8(TK_COMMIT), uint8(TK_CONFLICT), uint8(TK_JOIN_KW), uint8(TK_CTIME_KW), uint8(TK_CTIME_KW), + uint8(TK_CURRENT), uint8(TK_PRECEDING), uint8(TK_FAIL), uint8(TK_LAST), uint8(TK_FILTER), + uint8(TK_REPLACE), uint8(TK_FIRST), uint8(TK_FOLLOWING), uint8(TK_FROM), uint8(TK_JOIN_KW), + uint8(TK_LIMIT), uint8(TK_IF), uint8(TK_ORDER), uint8(TK_RESTRICT), uint8(TK_OTHERS), + uint8(TK_OVER), uint8(TK_RETURNING), uint8(TK_JOIN_KW), uint8(TK_ROLLBACK), uint8(TK_ROWS), + uint8(TK_ROW), uint8(TK_UNBOUNDED), uint8(TK_UNION), uint8(TK_USING), uint8(TK_VACUUM), + uint8(TK_VIEW), uint8(TK_WINDOW), uint8(TK_DO), uint8(TK_BY), uint8(TK_INITIALLY), + uint8(TK_ALL), uint8(TK_PRIMARY), +} /* sqlite3.c:162484:28 */ // Hash table decoded: // 0: INSERT @@ -139051,7 +141489,7 @@ var aKWCode = [145]uint8{ // 18: TRANSACTION RIGHT // 19: WHEN // 20: SET HAVING -// 21: IF +// 21: MATERIALIZED IF // 22: ROWS // 23: SELECT // 24: @@ -139147,7 +141585,7 @@ var aKWCode = [145]uint8{ // 114: INTERSECT UNBOUNDED // 115: // 116: -// 117: ON +// 117: RETURNING ON // 118: // 119: WHERE // 120: NO INNER @@ -139160,12 +141598,12 @@ var aKWCode = [145]uint8{ // Check to see if z[0..n-1] is a keyword. If it is, write the // parser symbol code for that keyword into *pType. Always // return the integer n (the length of the token). -func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sqlite3.c:159699:12: */ +func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sqlite3.c:162648:12: */ var i int32 var j int32 var zKW uintptr if n >= 2 { - i = ((((int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z)))]) * 4) ^ (int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z + uintptr((n - 1)))))]) * 3)) ^ n) % 127) + i = ((((int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z)))]) * 4) ^ (int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z + uintptr((n - 1)))))]) * 3)) ^ (n * 1)) % 127) for i = ((int32(aKWHash[i])) - 1); i >= 0; i = ((int32(aKWNext[i])) - 1) { if int32(aKWLen[i]) != n { continue @@ -139272,7 +141710,10 @@ func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sq // PLAN // ANALYZE // PRAGMA - // ABORT + // MATERIALIZED + // DEFERRED + // DISTINCT + // IS // UPDATE // VALUES // VIRTUAL @@ -139280,12 +141721,12 @@ func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sq // WHEN // WHERE // RECURSIVE + // ABORT // AFTER // RENAME // AND - // DEFERRED - // DISTINCT - // IS + // DROP + // PARTITION // AUTOINCREMENT // TO // IN @@ -139297,8 +141738,6 @@ func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sq // CURRENT_TIMESTAMP // CURRENT_TIME // CURRENT - // PARTITION - // DROP // PRECEDING // FAIL // LAST @@ -139314,6 +141753,7 @@ func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sq // RESTRICT // OTHERS // OVER + // RETURNING // RIGHT // ROLLBACK // ROWS @@ -139336,7 +141776,7 @@ func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sq return n } -func Xsqlite3KeywordCode(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:159871:20: */ +func Xsqlite3KeywordCode(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:162822:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -139345,7 +141785,7 @@ func Xsqlite3KeywordCode(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c return *(*int32)(unsafe.Pointer(bp /* id */)) } -func Xsqlite3_keyword_name(tls *libc.TLS, i int32, pzName uintptr, pnName uintptr) int32 { /* sqlite3.c:159877:16: */ +func Xsqlite3_keyword_name(tls *libc.TLS, i int32, pzName uintptr, pnName uintptr) int32 { /* sqlite3.c:162828:16: */ if (i < 0) || (i >= SQLITE_N_KEYWORD) { return SQLITE_ERROR } @@ -139354,11 +141794,11 @@ func Xsqlite3_keyword_name(tls *libc.TLS, i int32, pzName uintptr, pnName uintpt return SQLITE_OK } -func Xsqlite3_keyword_count(tls *libc.TLS) int32 { /* sqlite3.c:159883:16: */ +func Xsqlite3_keyword_count(tls *libc.TLS) int32 { /* sqlite3.c:162834:16: */ return SQLITE_N_KEYWORD } -func Xsqlite3_keyword_check(tls *libc.TLS, zName uintptr, nName int32) int32 { /* sqlite3.c:159884:16: */ +func Xsqlite3_keyword_check(tls *libc.TLS, zName uintptr, nName int32) int32 { /* sqlite3.c:162835:16: */ return (libc.Bool32(TK_ID != Xsqlite3KeywordCode(tls, zName, nName))) } @@ -139381,13 +141821,13 @@ func Xsqlite3_keyword_check(tls *libc.TLS, zName uintptr, nName int32) int32 { / // But the feature is undocumented. // Make the IdChar function accessible from ctime.c and alter.c -func Xsqlite3IsIdChar(tls *libc.TLS, c U8) int32 { /* sqlite3.c:159931:20: */ +func Xsqlite3IsIdChar(tls *libc.TLS, c U8) int32 { /* sqlite3.c:162882:20: */ return (libc.Bool32((int32(Xsqlite3CtypeMap[c]) & 0x46) != 0)) } // Return the id of the next token in string (*pz). Before returning, set // (*pz) to point to the byte following the parsed token. -func getToken(tls *libc.TLS, pz uintptr) int32 { /* sqlite3.c:159938:12: */ +func getToken(tls *libc.TLS, pz uintptr) int32 { /* sqlite3.c:162889:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -139437,7 +141877,7 @@ func getToken(tls *libc.TLS, pz uintptr) int32 { /* sqlite3.c:159938:12: */ // // * the previous token was TK_RP, and // * the next token is TK_LP. -func analyzeWindowKeyword(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:159987:12: */ +func analyzeWindowKeyword(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:162938:12: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = z @@ -139454,7 +141894,7 @@ func analyzeWindowKeyword(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:159987: return TK_WINDOW } -func analyzeOverKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:159995:12: */ +func analyzeOverKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:162946:12: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = z @@ -139468,7 +141908,7 @@ func analyzeOverKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sq return TK_ID } -func analyzeFilterKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:160002:12: */ +func analyzeFilterKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:162953:12: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = z @@ -139481,7 +141921,7 @@ func analyzeFilterKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* // Return the length (in bytes) of the token that begins at z[0]. // Store the token type in *tokenType before returning. -func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sqlite3.c:160014:20: */ +func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sqlite3.c:162965:20: */ var i int32 var c int32 switch int32(aiClass[*(*uint8)(unsafe.Pointer(z))]) { // Switch on the character-class of the first byte @@ -139765,7 +142205,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq return i } - case CC_KYWD: + case CC_KYWD0: { for i = 1; int32(aiClass[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) <= CC_KYWD; i++ { } @@ -139801,6 +142241,8 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq } fallthrough + case CC_KYWD: + fallthrough case CC_ID: { i = 1 @@ -139832,7 +142274,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq // 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 Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:160300:20: */ +func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:163252:20: */ bp := tls.Alloc(2468) defer tls.Free(2468) @@ -139847,9 +142289,9 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin // var sEngine YyParser at bp+40, 2424 // Space to hold the Lemon-generated Parser object - mxSqlLen = *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 1*4)) + mxSqlLen = *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 1*4)) if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 { - libc.AtomicStoreNInt32((db + 392 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) + libc.AtomicStoreNInt32((db + 400 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) } (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_OK (*Parse)(unsafe.Pointer(pParse)).FzTail = zSql @@ -139868,7 +142310,7 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin } if *(*int32)(unsafe.Pointer(bp + 2464 /* tokenType */)) >= TK_WINDOW { - if libc.AtomicLoadNInt32((db+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0 { + if libc.AtomicLoadNInt32((db+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0 { (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_INTERRUPT break } @@ -139897,7 +142339,7 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin *(*int32)(unsafe.Pointer(bp + 2464 /* tokenType */)) = analyzeFilterKeyword(tls, (zSql + 6), lastTokenParsed) } else { - Xsqlite3ErrorMsg(tls, pParse, ts+20546 /* "unrecognized tok..." */, libc.VaList(bp, n, zSql)) + Xsqlite3ErrorMsg(tls, pParse, ts+21070 /* "unrecognized tok..." */, libc.VaList(bp, n, zSql)) break } } @@ -139917,12 +142359,12 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM } if (((*Parse)(unsafe.Pointer(pParse)).Frc != SQLITE_OK) && ((*Parse)(unsafe.Pointer(pParse)).Frc != SQLITE_DONE)) && ((*Parse)(unsafe.Pointer(pParse)).FzErrMsg == uintptr(0)) { - (*Parse)(unsafe.Pointer(pParse)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+2690 /* "%s" */, libc.VaList(bp+16, Xsqlite3ErrStr(tls, (*Parse)(unsafe.Pointer(pParse)).Frc))) + (*Parse)(unsafe.Pointer(pParse)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+2718 /* "%s" */, libc.VaList(bp+16, Xsqlite3ErrStr(tls, (*Parse)(unsafe.Pointer(pParse)).Frc))) } if (*Parse)(unsafe.Pointer(pParse)).FzErrMsg != 0 { *(*uintptr)(unsafe.Pointer(pzErrMsg)) = (*Parse)(unsafe.Pointer(pParse)).FzErrMsg - Xsqlite3_log(tls, (*Parse)(unsafe.Pointer(pParse)).Frc, ts+20573, /* "%s in \"%s\"" */ + Xsqlite3_log(tls, (*Parse)(unsafe.Pointer(pParse)).Frc, ts+21097, /* "%s in \"%s\"" */ libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(pzErrMsg)), (*Parse)(unsafe.Pointer(pParse)).FzTail)) (*Parse)(unsafe.Pointer(pParse)).FzErrMsg = uintptr(0) nErr++ @@ -139948,21 +142390,7 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { Xsqlite3DeleteTrigger(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpNewTrigger) } - - if (*Parse)(unsafe.Pointer(pParse)).FpWithToFree != 0 { - Xsqlite3WithDelete(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpWithToFree) - } Xsqlite3DbFree(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpVList) - for (*Parse)(unsafe.Pointer(pParse)).FpAinc != 0 { - var p uintptr = (*Parse)(unsafe.Pointer(pParse)).FpAinc - (*Parse)(unsafe.Pointer(pParse)).FpAinc = (*AutoincInfo)(unsafe.Pointer(p)).FpNext - Xsqlite3DbFreeNN(tls, db, p) - } - for (*Parse)(unsafe.Pointer(pParse)).FpZombieTab != 0 { - var p uintptr = (*Parse)(unsafe.Pointer(pParse)).FpZombieTab - (*Parse)(unsafe.Pointer(pParse)).FpZombieTab = (*Table)(unsafe.Pointer(p)).FpNextZombie - Xsqlite3DeleteTable(tls, db, p) - } (*Sqlite3)(unsafe.Pointer(db)).FpParse = (*Parse)(unsafe.Pointer(pParse)).FpParentParse (*Parse)(unsafe.Pointer(pParse)).FpParentParse = uintptr(0) @@ -140045,7 +142473,7 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin // 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 *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716:16: */ +func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:163656:16: */ var state U8 = U8(0) // Current state, using numbers defined in header comment var token U8 @@ -140053,7 +142481,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: switch int32(*(*int8)(unsafe.Pointer(zSql))) { case ';': { // A semicolon - token = TkSEMI + token = U8(TkSEMI) break } @@ -140067,14 +142495,14 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough case '\f': { // White space is ignored - token = TkWS + token = U8(TkWS) break } case '/': { // C-style comments if int32(*(*int8)(unsafe.Pointer(zSql + 1))) != '*' { - token = TkOTHER + token = U8(TkOTHER) break } zSql += uintptr(2) @@ -140085,14 +142513,14 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: return 0 } zSql++ - token = TkWS + token = U8(TkWS) break } case '-': { // SQL-style comments from "--" to end of line if int32(*(*int8)(unsafe.Pointer(zSql + 1))) != '-' { - token = TkOTHER + token = U8(TkOTHER) break } for (*(*int8)(unsafe.Pointer(zSql)) != 0) && (int32(*(*int8)(unsafe.Pointer(zSql))) != '\n') { @@ -140101,7 +142529,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { return (libc.Bool32(int32(state) == 1)) } - token = TkWS + token = U8(TkWS) break } @@ -140114,7 +142542,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { return 0 } - token = TkOTHER + token = U8(TkOTHER) break } @@ -140132,7 +142560,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { return 0 } - token = TkOTHER + token = U8(TkOTHER) break } @@ -140148,10 +142576,10 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough case 'C': { - if (nId == 6) && (Xsqlite3_strnicmp(tls, zSql, ts+20584 /* "create" */, 6) == 0) { - token = TkCREATE + if (nId == 6) && (Xsqlite3_strnicmp(tls, zSql, ts+21108 /* "create" */, 6) == 0) { + token = U8(TkCREATE) } else { - token = TkOTHER + token = U8(TkOTHER) } break @@ -140161,14 +142589,14 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough case 'T': { - if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+17419 /* "trigger" */, 7) == 0) { - token = TkTRIGGER - } else if (nId == 4) && (Xsqlite3_strnicmp(tls, zSql, ts+20591 /* "temp" */, 4) == 0) { - token = TkTEMP - } else if (nId == 9) && (Xsqlite3_strnicmp(tls, zSql, ts+20596 /* "temporary" */, 9) == 0) { - token = TkTEMP + if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+17839 /* "trigger" */, 7) == 0) { + token = U8(TkTRIGGER) + } else if (nId == 4) && (Xsqlite3_strnicmp(tls, zSql, ts+21115 /* "temp" */, 4) == 0) { + token = U8(TkTEMP) + } else if (nId == 9) && (Xsqlite3_strnicmp(tls, zSql, ts+21120 /* "temporary" */, 9) == 0) { + token = U8(TkTEMP) } else { - token = TkOTHER + token = U8(TkOTHER) } break @@ -140178,12 +142606,12 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough case 'E': { - if (nId == 3) && (Xsqlite3_strnicmp(tls, zSql, ts+20606 /* "end" */, 3) == 0) { - token = TkEND - } else if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+20610 /* "explain" */, 7) == 0) { - token = TkEXPLAIN + if (nId == 3) && (Xsqlite3_strnicmp(tls, zSql, ts+21130 /* "end" */, 3) == 0) { + token = U8(TkEND) + } else if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+21134 /* "explain" */, 7) == 0) { + token = U8(TkEXPLAIN) } else { - token = TkOTHER + token = U8(TkOTHER) } break @@ -140191,7 +142619,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough default: { - token = TkOTHER + token = U8(TkOTHER) break } @@ -140199,7 +142627,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: zSql += (uintptr(nId - 1)) } else { // Operators and special symbols - token = TkOTHER + token = U8(TkOTHER) } break @@ -140222,12 +142650,12 @@ var trans = [8][8]U8{ /* 5 TRIGGER: */ {U8(6), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5)}, /* 6 SEMI: */ {U8(6), U8(6), U8(5), U8(5), U8(5), U8(5), U8(5), U8(7)}, /* 7 END: */ {U8(1), U8(7), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5)}, -} /* sqlite3.c:160724:19 */ +} /* sqlite3.c:163664:19 */ // 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 *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160881:16: */ +func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:163821:16: */ var pVal uintptr var zSql8 uintptr var rc int32 @@ -140237,8 +142665,8 @@ func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:16088 return rc } pVal = Xsqlite3ValueNew(tls, uintptr(0)) - Xsqlite3ValueSetStr(tls, pVal, -1, zSql, SQLITE_UTF16LE, uintptr(0)) - zSql8 = Xsqlite3ValueText(tls, pVal, SQLITE_UTF8) + Xsqlite3ValueSetStr(tls, pVal, -1, zSql, uint8(SQLITE_UTF16LE), uintptr(0)) + zSql8 = Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) if zSql8 != 0 { rc = Xsqlite3_complete(tls, zSql8) } else { @@ -140254,7 +142682,7 @@ func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:16088 // This is an extension initializer that is a no-op and always // succeeds, except that it fails if the fault-simulation is set // to 500. -func sqlite3TestExtInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:161033:12: */ +func sqlite3TestExtInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163973:12: */ _ = db return Xsqlite3FaultSim(tls, 500) } @@ -140266,11 +142694,11 @@ var sqlite3BuiltinExtensions = [4]uintptr{ 0, 0, 0, -} /* sqlite3.c:161063:12 */ +} /* sqlite3.c:164003:12 */ // IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns // a pointer to the to the sqlite3_version[] string constant. -func Xsqlite3_libversion(tls *libc.TLS) uintptr { /* sqlite3.c:161110:23: */ +func Xsqlite3_libversion(tls *libc.TLS) uintptr { /* sqlite3.c:164050:23: */ return uintptr(unsafe.Pointer(&Xsqlite3_version)) } @@ -140283,14 +142711,14 @@ func Xsqlite3_libversion(tls *libc.TLS) uintptr { /* sqlite3.c:161110:23: */ // IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function // returns an integer equal to SQLITE_VERSION_NUMBER. -func Xsqlite3_libversion_number(tls *libc.TLS) int32 { /* sqlite3.c:161123:16: */ +func Xsqlite3_libversion_number(tls *libc.TLS) int32 { /* sqlite3.c:164063:16: */ return SQLITE_VERSION_NUMBER } // 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 *libc.TLS) int32 { /* sqlite3.c:161129:16: */ +func Xsqlite3_threadsafe(tls *libc.TLS) int32 { /* sqlite3.c:164069:16: */ return SQLITE_THREADSAFE } @@ -140303,14 +142731,14 @@ func Xsqlite3_threadsafe(tls *libc.TLS) int32 { /* sqlite3.c:161129:16: */ // temporary files. // // See also the "PRAGMA temp_store_directory" SQL command. -var Xsqlite3_temp_directory uintptr = uintptr(0) /* sqlite3.c:161160:17 */ +var Xsqlite3_temp_directory uintptr = uintptr(0) /* sqlite3.c:164100:17 */ // If the following global variable points to a string which is the // name of a directory, then that directory will be used to store // all database files specified with a relative pathname. // // See also the "PRAGMA data_store_directory" SQL command. -var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:161169:17 */ +var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:164109:17 */ // Initialize SQLite. // @@ -140341,7 +142769,7 @@ var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:161169:17 */ // // * Recursive calls to this routine from thread X return immediately // without blocking. -func Xsqlite3_initialize(tls *libc.TLS) int32 { /* sqlite3.c:161202:16: */ +func Xsqlite3_initialize(tls *libc.TLS) int32 { /* sqlite3.c:164142:16: */ var pMainMtx uintptr // The main static mutex var rc int32 // Result code @@ -140464,7 +142892,7 @@ func Xsqlite3_initialize(tls *libc.TLS) int32 { /* sqlite3.c:161202:16: */ // routine is not threadsafe. But it is safe to invoke this routine // on when SQLite is already shut down. If SQLite is already shut down // when this routine is invoked, then this routine is a harmless no-op. -func Xsqlite3_shutdown(tls *libc.TLS) int32 { /* sqlite3.c:161377:16: */ +func Xsqlite3_shutdown(tls *libc.TLS) int32 { /* sqlite3.c:164317:16: */ if Xsqlite3Config.FisInit != 0 { Xsqlite3_os_end(tls) @@ -140503,7 +142931,7 @@ func Xsqlite3_shutdown(tls *libc.TLS) int32 { /* sqlite3.c:161377:16: */ // database connections or memory allocations. This routine is not // threadsafe. Failure to heed these warnings can lead to unpredictable // behavior. -func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:161431:16: */ +func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:164371:16: */ var ap Va_list _ = ap var rc int32 = SQLITE_OK @@ -140511,7 +142939,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:1 // sqlite3_config() shall return SQLITE_MISUSE if it is invoked while // the SQLite library is in use. if Xsqlite3Config.FisInit != 0 { - return Xsqlite3MisuseError(tls, 161437) + return Xsqlite3MisuseError(tls, 164377) } ap = va @@ -140725,11 +143153,11 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:1 // silently truncated if necessary so that it does not exceed the // compile-time maximum mmap size set by the SQLITE_MAX_MMAP_SIZE // compile-time option. - if (mxMmap < int64(0)) || (mxMmap > SQLITE_MAX_MMAP_SIZE) { - mxMmap = SQLITE_MAX_MMAP_SIZE + if (mxMmap < int64(0)) || (mxMmap > int64(SQLITE_MAX_MMAP_SIZE)) { + mxMmap = int64(SQLITE_MAX_MMAP_SIZE) } if szMmap < int64(0) { - szMmap = SQLITE_DEFAULT_MMAP_SIZE + szMmap = int64(SQLITE_DEFAULT_MMAP_SIZE) } if szMmap > mxMmap { szMmap = mxMmap @@ -140774,7 +143202,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:1 // 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 *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32) int32 { /* sqlite3.c:161749:12: */ +func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32) int32 { /* sqlite3.c:164689:12: */ var pStart uintptr var szAlloc Sqlite3_int64 = (Sqlite3_int64(sz) * Sqlite3_int64(cnt)) var nBig int32 // Number of full-size slots @@ -140813,10 +143241,10 @@ func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32 } if sz >= (LOOKASIDE_SMALL * 3) { nBig = (int32(szAlloc / (Sqlite3_int64((3 * LOOKASIDE_SMALL) + sz)))) - nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / LOOKASIDE_SMALL)) + nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / int64(LOOKASIDE_SMALL))) } else if sz >= (LOOKASIDE_SMALL * 2) { nBig = (int32(szAlloc / (Sqlite3_int64(LOOKASIDE_SMALL + sz)))) - nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / LOOKASIDE_SMALL)) + nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / int64(LOOKASIDE_SMALL))) } else if sz > 0 { nBig = (int32(szAlloc / Sqlite3_int64(sz))) nSm = 0 @@ -140872,13 +143300,13 @@ func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32 } // Return the mutex associated with a database connection. -func Xsqlite3_db_mutex(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:161849:26: */ +func Xsqlite3_db_mutex(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:164789:26: */ return (*Sqlite3)(unsafe.Pointer(db)).Fmutex } // Free up as much memory as we can from the given database // connection. -func Xsqlite3_db_release_memory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:161863:16: */ +func Xsqlite3_db_release_memory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:164803:16: */ var i int32 Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -140897,7 +143325,7 @@ func Xsqlite3_db_release_memory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c: // Flush any dirty pages in the pager-cache for any attached database // to disk. -func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:161887:16: */ +func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:164827:16: */ var i int32 var rc int32 = SQLITE_OK var bSeenBusy int32 = 0 @@ -140906,7 +143334,7 @@ func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:1618 Xsqlite3BtreeEnterAll(tls, db) for i = 0; (rc == SQLITE_OK) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb); i++ { var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt - if (pBt != 0) && (Xsqlite3BtreeIsInTrans(tls, pBt) != 0) { + if (pBt != 0) && (Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_WRITE) { var pPager uintptr = Xsqlite3BtreePager(tls, pBt) rc = Xsqlite3PagerFlush(tls, pPager) if rc == SQLITE_BUSY { @@ -140926,7 +143354,7 @@ func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:1618 } // Configuration settings for an individual database connection -func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:161916:16: */ +func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:164856:16: */ var ap Va_list _ = ap var rc int32 @@ -140989,27 +143417,27 @@ var aFlagOp = [16]struct { Fop int32 Fmask U32 }{ - {Fop: SQLITE_DBCONFIG_ENABLE_FKEY, Fmask: SQLITE_ForeignKeys}, - {Fop: SQLITE_DBCONFIG_ENABLE_TRIGGER, Fmask: SQLITE_EnableTrigger}, + {Fop: SQLITE_DBCONFIG_ENABLE_FKEY, Fmask: U32(SQLITE_ForeignKeys)}, + {Fop: SQLITE_DBCONFIG_ENABLE_TRIGGER, Fmask: U32(SQLITE_EnableTrigger)}, {Fop: SQLITE_DBCONFIG_ENABLE_VIEW, Fmask: SQLITE_EnableView}, - {Fop: SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, Fmask: SQLITE_Fts3Tokenizer}, - {Fop: SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, Fmask: SQLITE_LoadExtension}, - {Fop: SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, Fmask: SQLITE_NoCkptOnClose}, - {Fop: SQLITE_DBCONFIG_ENABLE_QPSG, Fmask: SQLITE_EnableQPSG}, - {Fop: SQLITE_DBCONFIG_TRIGGER_EQP, Fmask: SQLITE_TriggerEQP}, - {Fop: SQLITE_DBCONFIG_RESET_DATABASE, Fmask: SQLITE_ResetDatabase}, - {Fop: SQLITE_DBCONFIG_DEFENSIVE, Fmask: SQLITE_Defensive}, + {Fop: SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, Fmask: U32(SQLITE_Fts3Tokenizer)}, + {Fop: SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, Fmask: U32(SQLITE_LoadExtension)}, + {Fop: SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, Fmask: U32(SQLITE_NoCkptOnClose)}, + {Fop: SQLITE_DBCONFIG_ENABLE_QPSG, Fmask: U32(SQLITE_EnableQPSG)}, + {Fop: SQLITE_DBCONFIG_TRIGGER_EQP, Fmask: U32(SQLITE_TriggerEQP)}, + {Fop: SQLITE_DBCONFIG_RESET_DATABASE, Fmask: U32(SQLITE_ResetDatabase)}, + {Fop: SQLITE_DBCONFIG_DEFENSIVE, Fmask: U32(SQLITE_Defensive)}, {Fop: SQLITE_DBCONFIG_WRITABLE_SCHEMA, Fmask: (U32(SQLITE_WriteSchema | SQLITE_NoSchemaError))}, - {Fop: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, Fmask: SQLITE_LegacyAlter}, - {Fop: SQLITE_DBCONFIG_DQS_DDL, Fmask: SQLITE_DqsDDL}, - {Fop: SQLITE_DBCONFIG_DQS_DML, Fmask: SQLITE_DqsDML}, - {Fop: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, Fmask: SQLITE_LegacyFileFmt}, - {Fop: SQLITE_DBCONFIG_TRUSTED_SCHEMA, Fmask: SQLITE_TrustedSchema}, -} /* sqlite3.c:161939:9 */ + {Fop: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, Fmask: U32(SQLITE_LegacyAlter)}, + {Fop: SQLITE_DBCONFIG_DQS_DDL, Fmask: U32(SQLITE_DqsDDL)}, + {Fop: SQLITE_DBCONFIG_DQS_DML, Fmask: U32(SQLITE_DqsDML)}, + {Fop: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, Fmask: U32(SQLITE_LegacyFileFmt)}, + {Fop: SQLITE_DBCONFIG_TRUSTED_SCHEMA, Fmask: U32(SQLITE_TrustedSchema)}, +} /* sqlite3.c:164879:9 */ // This is the default collating function named "BINARY" which is always // available. -func binCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:161991:12: */ +func binCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:164931:12: */ var rc int32 var n int32 _ = NotUsed @@ -141031,7 +143459,7 @@ func binCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKe // This is the collating function named "RTRIM" which is always // available. Ignore trailing spaces. -func rtrimCollFunc(tls *libc.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:162014:12: */ +func rtrimCollFunc(tls *libc.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:164954:12: */ var pK1 uintptr = pKey1 var pK2 uintptr = pKey2 for (nKey1 != 0) && (int32(*(*U8)(unsafe.Pointer(pK1 + uintptr((nKey1 - 1))))) == ' ') { @@ -141044,7 +143472,7 @@ func rtrimCollFunc(tls *libc.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nKe } // Return true if CollSeq is the default built-in BINARY. -func Xsqlite3IsBinary(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:162029:20: */ +func Xsqlite3IsBinary(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:164969:20: */ return (libc.Bool32((p == uintptr(0)) || ((*CollSeq)(unsafe.Pointer(p)).FxCmp == *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 @@ -141058,7 +143486,7 @@ func Xsqlite3IsBinary(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:162029:20: // extends only to the 26 characters used in the English language. // // At the moment there is only a UTF-8 implementation. -func nocaseCollatingFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:162043:12: */ +func nocaseCollatingFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:164983:12: */ var r int32 = Xsqlite3_strnicmp(tls, pKey1, pKey2, func() int32 { if nKey1 < nKey2 { @@ -141074,31 +143502,31 @@ func nocaseCollatingFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uint } // Return the ROWID of the most recent insert -func Xsqlite3_last_insert_rowid(tls *libc.TLS, db uintptr) Sqlite_int64 { /* sqlite3.c:162060:25: */ +func Xsqlite3_last_insert_rowid(tls *libc.TLS, db uintptr) Sqlite_int64 { /* sqlite3.c:165000:25: */ return (*Sqlite3)(unsafe.Pointer(db)).FlastRowid } // Set the value returned by the sqlite3_last_insert_rowid() API function. -func Xsqlite3_set_last_insert_rowid(tls *libc.TLS, db uintptr, iRowid Sqlite3_int64) { /* sqlite3.c:162073:17: */ +func Xsqlite3_set_last_insert_rowid(tls *libc.TLS, db uintptr, iRowid Sqlite3_int64) { /* sqlite3.c:165013:17: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = iRowid Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) } // Return the number of changes in the most recent call to sqlite3_exec(). -func Xsqlite3_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162088:16: */ +func Xsqlite3_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:165028:16: */ return (*Sqlite3)(unsafe.Pointer(db)).FnChange } // Return the number of changes since the database handle was opened. -func Xsqlite3_total_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162101:16: */ +func Xsqlite3_total_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:165041:16: */ return (*Sqlite3)(unsafe.Pointer(db)).FnTotalChange } // 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 Xsqlite3CloseSavepoints(tls *libc.TLS, db uintptr) { /* sqlite3.c:162116:21: */ +func Xsqlite3CloseSavepoints(tls *libc.TLS, db uintptr) { /* sqlite3.c:165056:21: */ for (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint != 0 { var pTmp uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pTmp)).FpNext @@ -141113,7 +143541,7 @@ func Xsqlite3CloseSavepoints(tls *libc.TLS, db uintptr) { /* sqlite3.c:162116:21 // 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 *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:162133:13: */ +func functionDestroy(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:165073:13: */ var pDestructor uintptr = *(*uintptr)(unsafe.Pointer(p + 64 /* &.u */)) if pDestructor != 0 { (*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef-- @@ -141126,7 +143554,7 @@ func functionDestroy(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:162133 // Disconnect all sqlite3_vtab objects that belong to database connection // db. This is called when db is being closed. -func disconnectAllVtab(tls *libc.TLS, db uintptr) { /* sqlite3.c:162148:13: */ +func disconnectAllVtab(tls *libc.TLS, db uintptr) { /* sqlite3.c:165088:13: */ var i int32 var p uintptr Xsqlite3BtreeEnterAll(tls, db) @@ -141141,7 +143569,7 @@ func disconnectAllVtab(tls *libc.TLS, db uintptr) { /* sqlite3.c:162148:13: */ } } } - for p = (*Hash)(unsafe.Pointer((db + 528 /* &.aModule */))).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext { + for p = (*Hash)(unsafe.Pointer((db + 536 /* &.aModule */))).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext { var pMod uintptr = (*HashElem)(unsafe.Pointer(p)).Fdata if (*Module)(unsafe.Pointer(pMod)).FpEpoTab != 0 { Xsqlite3VtabDisconnect(tls, db, (*Module)(unsafe.Pointer(pMod)).FpEpoTab) @@ -141153,7 +143581,7 @@ func disconnectAllVtab(tls *libc.TLS, db uintptr) { /* sqlite3.c:162148:13: */ // Return TRUE if database connection db has unfinalized prepared // statements or unfinished sqlite3_backup objects. -func connectionIsBusy(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162179:12: */ +func connectionIsBusy(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:165119:12: */ var j int32 if (*Sqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { @@ -141169,18 +143597,18 @@ func connectionIsBusy(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162179:12: } // Close an existing SQLite database -func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlite3.c:162193:12: */ +func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlite3.c:165133:12: */ if !(db != 0) { // EVIDENCE-OF: R-63257-11740 Calling sqlite3_close() or // sqlite3_close_v2() with a NULL pointer argument is a harmless no-op. return SQLITE_OK } if !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return Xsqlite3MisuseError(tls, 162200) + return Xsqlite3MisuseError(tls, 165140) } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if (int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_CLOSE) != 0 { - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_CLOSE, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0)) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 240 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_CLOSE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0)) } // Force xDisconnect calls on all virtual tables @@ -141198,17 +143626,49 @@ func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlit // SQLITE_BUSY if the connection can not be closed immediately. if !(forceZombie != 0) && (connectionIsBusy(tls, db) != 0) { Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY, - ts+20618 /* "unable to close ..." */, 0) + ts+21142 /* "unable to close ..." */, 0) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_BUSY } // Convert the connection into a zombie and then close it. - (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_ZOMBIE + (*Sqlite3)(unsafe.Pointer(db)).Fmagic = U32(SQLITE_MAGIC_ZOMBIE) Xsqlite3LeaveMutexAndCloseZombie(tls, db) return SQLITE_OK } +// Return the transaction state for a single databse, or the maximum +// transaction state over all attached databases if zSchema is null. +func Xsqlite3_txn_state(tls *libc.TLS, db uintptr, zSchema uintptr) int32 { /* sqlite3.c:165187:16: */ + var iDb int32 + var nDb int32 + var iTxn int32 = -1 + Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) + if zSchema != 0 { + nDb = libc.AssignInt32(&iDb, Xsqlite3FindDbName(tls, db, zSchema)) + if iDb < 0 { + nDb-- + } + } else { + iDb = 0 + nDb = ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1) + } + for ; iDb <= nDb; iDb++ { + var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt + var x int32 + if pBt != uintptr(0) { + x = Xsqlite3BtreeTxnState(tls, pBt) + } else { + x = SQLITE_TXN_NONE + } + if x > iTxn { + iTxn = x + } + } + Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) + return iTxn +} + // 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 @@ -141216,11 +143676,11 @@ func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlit // 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 *libc.TLS, db uintptr) int32 { /* sqlite3.c:162252:16: */ +func Xsqlite3_close(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:165222:16: */ return sqlite3Close(tls, db, 0) } -func Xsqlite3_close_v2(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162253:16: */ +func Xsqlite3_close_v2(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:165223:16: */ return sqlite3Close(tls, db, 1) } @@ -141230,14 +143690,14 @@ func Xsqlite3_close_v2(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162253:16 // 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 Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c:162264:21: */ +func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c:165234:21: */ var i uintptr // Hash table iterator var j int32 // If there are outstanding sqlite3_stmt or sqlite3_backup objects // or if the connection has not yet been closed by sqlite3_close_v2(), // then just leave the mutex and return. - if ((*Sqlite3)(unsafe.Pointer(db)).Fmagic != SQLITE_MAGIC_ZOMBIE) || (connectionIsBusy(tls, db) != 0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fmagic != U32(SQLITE_MAGIC_ZOMBIE)) || (connectionIsBusy(tls, db) != 0) { Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return } @@ -141280,7 +143740,7 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c: // locks and does not require any further unlock-notify callbacks. Xsqlite3ConnectionClosed(tls, db) - for i = (*Hash)(unsafe.Pointer((db + 576 /* &.aFunc */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext { + for i = (*Hash)(unsafe.Pointer((db + 584 /* &.aFunc */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext { var pNext uintptr var p uintptr p = (*HashElem)(unsafe.Pointer(i)).Fdata @@ -141291,8 +143751,8 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c: p = pNext } } - Xsqlite3HashClear(tls, (db + 576 /* &.aFunc */)) - for i = (*Hash)(unsafe.Pointer((db + 600 /* &.aCollSeq */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext { + Xsqlite3HashClear(tls, (db + 584 /* &.aFunc */)) + for i = (*Hash)(unsafe.Pointer((db + 608 /* &.aCollSeq */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext { var pColl uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata // Invoke any destructors registered for collation sequence user data. for j = 0; j < 3; j++ { @@ -141302,13 +143762,13 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c: } Xsqlite3DbFree(tls, db, pColl) } - Xsqlite3HashClear(tls, (db + 600 /* &.aCollSeq */)) - for i = (*Hash)(unsafe.Pointer((db + 528 /* &.aModule */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext { + Xsqlite3HashClear(tls, (db + 608 /* &.aCollSeq */)) + for i = (*Hash)(unsafe.Pointer((db + 536 /* &.aModule */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext { var pMod uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata Xsqlite3VtabEponymousTableClear(tls, db, pMod) Xsqlite3VtabModuleUnref(tls, db, pMod) } - Xsqlite3HashClear(tls, (db + 528 /* &.aModule */)) + Xsqlite3HashClear(tls, (db + 536 /* &.aModule */)) Xsqlite3Error(tls, db, SQLITE_OK) // Deallocates any cached error strings. Xsqlite3ValueFree(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr) @@ -141337,7 +143797,7 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c: // 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 Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3.c:162384:21: */ +func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3.c:165354:21: */ var i int32 var inTrans int32 = 0 var schemaChange int32 @@ -141351,12 +143811,12 @@ func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3 // the database rollback and schema reset, which can cause false // corruption reports in some cases. Xsqlite3BtreeEnterAll(tls, db) - schemaChange = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaChange) != U32(0)) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0))) + schemaChange = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != U32(0)) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0))) for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { var p uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt if p != 0 { - if Xsqlite3BtreeIsInTrans(tls, p) != 0 { + if Xsqlite3BtreeTxnState(tls, p) == SQLITE_TXN_WRITE { inTrans = 1 } Xsqlite3BtreeRollback(tls, p, tripCode, libc.BoolInt32(!(schemaChange != 0))) @@ -141374,11 +143834,11 @@ func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3 // Any deferred constraint violations have now been resolved. (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0) (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_DeferFKs)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_DeferFKs))) // If one has been configured, invoke the rollback-hook callback if ((*Sqlite3)(unsafe.Pointer(db)).FxRollbackCallback != 0) && ((inTrans != 0) || !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((db + 288 /* &.xRollbackCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpRollbackArg) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((db + 296 /* &.xRollbackCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpRollbackArg) } } @@ -141387,24 +143847,24 @@ func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3 // Return a static string that describes the kind of error specified in the // argument. -func Xsqlite3ErrStr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:162545:27: */ - var zErr uintptr = ts + 20686 /* "unknown error" */ +func Xsqlite3ErrStr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:165515:27: */ + var zErr uintptr = ts + 21210 /* "unknown error" */ switch rc { case (SQLITE_ABORT | (int32(2) << 8)): { - zErr = ts + 20700 /* "abort due to ROL..." */ + zErr = ts + 21224 /* "abort due to ROL..." */ break } case SQLITE_ROW: { - zErr = ts + 20722 /* "another row avai..." */ + zErr = ts + 21246 /* "another row avai..." */ break } case SQLITE_DONE: { - zErr = ts + 20744 /* "no more rows ava..." */ + zErr = ts + 21268 /* "no more rows ava..." */ break } @@ -141422,36 +143882,36 @@ func Xsqlite3ErrStr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:162545:27: * } var aMsg = [29]uintptr{ - /* SQLITE_OK */ ts + 20767, /* "not an error" */ - /* SQLITE_ERROR */ ts + 20780, /* "SQL logic error" */ + /* SQLITE_OK */ ts + 21291, /* "not an error" */ + /* SQLITE_ERROR */ ts + 21304, /* "SQL logic error" */ /* SQLITE_INTERNAL */ uintptr(0), - /* SQLITE_PERM */ ts + 20796, /* "access permissio..." */ - /* SQLITE_ABORT */ ts + 20821, /* "query aborted" */ - /* SQLITE_BUSY */ ts + 20835, /* "database is lock..." */ - /* SQLITE_LOCKED */ ts + 20854, /* "database table i..." */ - /* SQLITE_NOMEM */ ts + 5005, /* "out of memory" */ - /* SQLITE_READONLY */ ts + 20879, /* "attempt to write..." */ - /* SQLITE_INTERRUPT */ ts + 20916, /* "interrupted" */ - /* SQLITE_IOERR */ ts + 20928, /* "disk I/O error" */ - /* SQLITE_CORRUPT */ ts + 20943, /* "database disk im..." */ - /* SQLITE_NOTFOUND */ ts + 20976, /* "unknown operatio..." */ - /* SQLITE_FULL */ ts + 20994, /* "database or disk..." */ - /* SQLITE_CANTOPEN */ ts + 21019, /* "unable to open d..." */ - /* SQLITE_PROTOCOL */ ts + 21048, /* "locking protocol" */ + /* SQLITE_PERM */ ts + 21320, /* "access permissio..." */ + /* SQLITE_ABORT */ ts + 21345, /* "query aborted" */ + /* SQLITE_BUSY */ ts + 21359, /* "database is lock..." */ + /* SQLITE_LOCKED */ ts + 21378, /* "database table i..." */ + /* SQLITE_NOMEM */ ts + 5050, /* "out of memory" */ + /* SQLITE_READONLY */ ts + 21403, /* "attempt to write..." */ + /* SQLITE_INTERRUPT */ ts + 21440, /* "interrupted" */ + /* SQLITE_IOERR */ ts + 21452, /* "disk I/O error" */ + /* SQLITE_CORRUPT */ ts + 21467, /* "database disk im..." */ + /* SQLITE_NOTFOUND */ ts + 21500, /* "unknown operatio..." */ + /* SQLITE_FULL */ ts + 21518, /* "database or disk..." */ + /* SQLITE_CANTOPEN */ ts + 21543, /* "unable to open d..." */ + /* SQLITE_PROTOCOL */ ts + 21572, /* "locking protocol" */ /* SQLITE_EMPTY */ uintptr(0), - /* SQLITE_SCHEMA */ ts + 4752, /* "database schema ..." */ - /* SQLITE_TOOBIG */ ts + 4289, /* "string or blob t..." */ - /* SQLITE_CONSTRAINT */ ts + 21065, /* "constraint faile..." */ - /* SQLITE_MISMATCH */ ts + 21083, /* "datatype mismatc..." */ - /* SQLITE_MISUSE */ ts + 21101, /* "bad parameter or..." */ + /* SQLITE_SCHEMA */ ts + 4780, /* "database schema ..." */ + /* SQLITE_TOOBIG */ ts + 4317, /* "string or blob t..." */ + /* SQLITE_CONSTRAINT */ ts + 21589, /* "constraint faile..." */ + /* SQLITE_MISMATCH */ ts + 21607, /* "datatype mismatc..." */ + /* SQLITE_MISUSE */ ts + 21625, /* "bad parameter or..." */ /* SQLITE_NOLFS */ uintptr(0), - /* SQLITE_AUTH */ ts + 21135, /* "authorization de..." */ + /* SQLITE_AUTH */ ts + 21659, /* "authorization de..." */ /* SQLITE_FORMAT */ uintptr(0), - /* SQLITE_RANGE */ ts + 21156, /* "column index out..." */ - /* SQLITE_NOTADB */ ts + 21182, /* "file is not a da..." */ - /* SQLITE_NOTICE */ ts + 21205, /* "notification mes..." */ - /* SQLITE_WARNING */ ts + 21226, /* "warning message" */ -} /* sqlite3.c:162546:20 */ + /* SQLITE_RANGE */ ts + 21680, /* "column index out..." */ + /* SQLITE_NOTADB */ ts + 21706, /* "file is not a da..." */ + /* SQLITE_NOTICE */ ts + 21729, /* "notification mes..." */ + /* SQLITE_WARNING */ ts + 21750, /* "warning message" */ +} /* sqlite3.c:165516:20 */ // This routine implements a busy callback that sleeps and tries // again until a timeout value is reached. The timeout value is @@ -141460,7 +143920,7 @@ var aMsg = [29]uintptr{ // // Return non-zero to retry the lock. Return zero to stop trying // and cause SQLite to return SQLITE_BUSY. -func sqliteDefaultBusyCallback(tls *libc.TLS, ptr uintptr, count int32) int32 { /* sqlite3.c:162615:12: */ +func sqliteDefaultBusyCallback(tls *libc.TLS, ptr uintptr, count int32) int32 { /* sqlite3.c:165585:12: */ var db uintptr = ptr var tmout int32 = (*Sqlite3)(unsafe.Pointer(db)).FbusyTimeout var delay int32 @@ -141483,8 +143943,8 @@ func sqliteDefaultBusyCallback(tls *libc.TLS, ptr uintptr, count int32) int32 { return 1 } -var delays = [12]U8{U8(1), U8(2), U8(5), U8(10), U8(15), U8(20), U8(25), U8(25), U8(25), U8(50), U8(50), U8(100)} /* sqlite3.c:162622:19 */ -var totals = [12]U8{U8(0), U8(1), U8(3), U8(8), U8(18), U8(33), U8(53), U8(78), U8(103), U8(128), U8(178), U8(228)} /* sqlite3.c:162624:19 */ +var delays = [12]U8{U8(1), U8(2), U8(5), U8(10), U8(15), U8(20), U8(25), U8(25), U8(25), U8(50), U8(50), U8(100)} /* sqlite3.c:165592:19 */ +var totals = [12]U8{U8(0), U8(1), U8(3), U8(8), U8(18), U8(33), U8(53), U8(78), U8(103), U8(128), U8(178), U8(228)} /* sqlite3.c:165594:19 */ // Invoke the given busy handler. // @@ -141493,7 +143953,7 @@ var totals = [12]U8{U8(0), U8(1), U8(3), U8(8), U8(18), U8(33), U8(53), U8(78), // // If this routine returns non-zero, the lock is retried. If it // returns 0, the operation aborts with an SQLITE_BUSY error. -func Xsqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:162667:20: */ +func Xsqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:165637:20: */ var rc int32 if ((*BusyHandler)(unsafe.Pointer(p)).FxBusyHandler == uintptr(0)) || ((*BusyHandler)(unsafe.Pointer(p)).FnBusy < 0) { return 0 @@ -141509,7 +143969,7 @@ func Xsqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:16 // This routine sets the busy callback for an Sqlite database to the // given callback function with the given argument. -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) int32 { /* sqlite3.c:162683:16: */ +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) int32 { /* sqlite3.c:165653:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg @@ -141522,7 +143982,7 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // 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 *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { /* sqlite3.c:162706:17: */ +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { /* sqlite3.c:165676:17: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { (*Sqlite3)(unsafe.Pointer(db)).FxProgress = xProgress @@ -141538,7 +143998,7 @@ func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress // This routine installs a default busy handler that waits for the // specified number of milliseconds before returning 0. -func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) int32 { /* sqlite3.c:162737:16: */ +func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) int32 { /* sqlite3.c:165707:16: */ if ms > 0 { Xsqlite3_busy_handler(tls, db, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32) int32 @@ -141552,15 +144012,15 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) int32 { /* sqlit } // Cause any pending operation to stop at its earliest opportunity. -func Xsqlite3_interrupt(tls *libc.TLS, db uintptr) { /* sqlite3.c:162754:17: */ - libc.AtomicStoreNInt32((db + 392 /* &.u1 */ /* &.isInterrupted */), int32(1), 0) +func Xsqlite3_interrupt(tls *libc.TLS, db uintptr) { /* sqlite3.c:165724:17: */ + libc.AtomicStoreNInt32((db + 400 /* &.u1 */ /* &.isInterrupted */), int32(1), 0) } // 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 Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) int32 { /* sqlite3.c:162771:20: */ +func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) int32 { /* sqlite3.c:165741:20: */ var p uintptr var nName int32 _ = nName @@ -141572,7 +144032,7 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i ((libc.Bool32(xValue == uintptr(0))) != (libc.Bool32(xInverse == uintptr(0))))) || // Both or neither of xValue, xInverse ((nArg < -1) || (nArg > SQLITE_MAX_FUNCTION_ARG))) || (255 < (libc.AssignInt32(&nName, Xsqlite3Strlen30(tls, zFunctionName)))) { - return Xsqlite3MisuseError(tls, 162797) + return Xsqlite3MisuseError(tls, 165767) } extraFlags = (enc & (((SQLITE_DETERMINISTIC | SQLITE_DIRECTONLY) | SQLITE_SUBTYPE) | SQLITE_INNOCUOUS)) @@ -141612,10 +144072,10 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // is being overridden/deleted but there are no active VMs, allow the // operation to continue but invalidate all precompiled statements. p = Xsqlite3FindFunction(tls, db, zFunctionName, nArg, U8(enc), uint8(0)) - if ((p != 0) && (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_ENCMASK) == U32(enc))) && (int32((*FuncDef)(unsafe.Pointer(p)).FnArg) == nArg) { + if ((p != 0) && (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) == U32(enc))) && (int32((*FuncDef)(unsafe.Pointer(p)).FnArg) == nArg) { if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY, - ts+21242 /* "unable to delete..." */, 0) + ts+21766 /* "unable to delete..." */, 0) return SQLITE_BUSY } else { @@ -141637,7 +144097,7 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i (*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef++ } *(*uintptr)(unsafe.Pointer(p + 64 /* &.u */)) = pDestructor - (*FuncDef)(unsafe.Pointer(p)).FfuncFlags = (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_ENCMASK) | U32(extraFlags)) + (*FuncDef)(unsafe.Pointer(p)).FfuncFlags = (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) | U32(extraFlags)) (*FuncDef)(unsafe.Pointer(p)).FxSFunc = func() uintptr { if xSFunc != 0 { @@ -141658,7 +144118,7 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // sqlite3_create_function() // sqlite3_create_function_v2() // sqlite3_create_window_function() -func createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:162891:12: */ +func createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:165861:12: */ var rc int32 var pArg uintptr rc = SQLITE_ERROR @@ -141700,28 +144160,28 @@ out: } // Create new user functions. -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:162942:16: */ +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:165912:16: */ return createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) int32 { /* sqlite3.c:162955:16: */ +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) int32 { /* sqlite3.c:165925:16: */ return createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:162969:16: */ +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:165939:16: */ return createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:162986:16: */ +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:165956:16: */ var rc int32 var zFunc8 uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - zFunc8 = Xsqlite3Utf16to8(tls, db, zFunctionName, -1, SQLITE_UTF16LE) + zFunc8 = Xsqlite3Utf16to8(tls, db, zFunctionName, -1, uint8(SQLITE_UTF16LE)) rc = Xsqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3DbFree(tls, db, zFunc8) rc = Xsqlite3ApiExit(tls, db, rc) @@ -141735,7 +144195,7 @@ func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr // 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 *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:163022:13: */ +func sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:165992:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -141744,7 +144204,7 @@ func sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotUs _ = NotUsed _ = NotUsed2 zErr = Xsqlite3_mprintf(tls, - ts+21305 /* "unable to use fu..." */, libc.VaList(bp, zName)) + ts+21829 /* "unable to use fu..." */, libc.VaList(bp, zName)) Xsqlite3_result_error(tls, context, zErr, -1) Xsqlite3_free(tls, zErr) } @@ -141759,12 +144219,12 @@ func sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotUs // 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 *libc.TLS, db uintptr, zName uintptr, nArg int32) int32 { /* sqlite3.c:163048:16: */ +func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg int32) int32 { /* sqlite3.c:166018:16: */ var rc int32 var zCopy uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - rc = (libc.Bool32(Xsqlite3FindFunction(tls, db, zName, nArg, SQLITE_UTF8, uint8(0)) != uintptr(0))) + rc = (libc.Bool32(Xsqlite3FindFunction(tls, db, zName, nArg, uint8(SQLITE_UTF8), uint8(0)) != uintptr(0))) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if rc != 0 { return SQLITE_OK @@ -141785,25 +144245,25 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // A NULL trace function means that no tracing is executes. A non-NULL // trace is a pointer to a function that is invoked at the start of each // SQL statement. -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) uintptr { /* sqlite3.c:163081:17: */ +func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) uintptr { /* sqlite3.c:166051:17: */ var pOld uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg (*Sqlite3)(unsafe.Pointer(db)).FmTrace = func() uint8 { if xTrace != 0 { - return SQLITE_TRACE_LEGACY + return uint8(SQLITE_TRACE_LEGACY) } return uint8(0) }() - *(*uintptr)(unsafe.Pointer(db + 232 /* &.trace */)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 240 /* &.trace */)) = xTrace (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } // Register a trace callback using the version-2 interface. -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) int32 { /* sqlite3.c:163102:16: */ +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) int32 { /* sqlite3.c:166072:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { xTrace = uintptr(0) @@ -141812,7 +144272,7 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, mTrace = uint32(0) } (*Sqlite3)(unsafe.Pointer(db)).FmTrace = U8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 232 /* &.trace */)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 240 /* &.trace */)) = xTrace (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -141824,16 +144284,16 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // 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 *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) uintptr { /* sqlite3.c:163132:17: */ +func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) uintptr { /* sqlite3.c:166102:17: */ var pOld uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg (*Sqlite3)(unsafe.Pointer(db)).FxProfile = xProfile (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg - *(*U8)(unsafe.Pointer(db + 104 /* &.mTrace */)) &= U8((SQLITE_TRACE_NONLEGACY_MASK)) + *(*U8)(unsafe.Pointer(db + 106 /* &.mTrace */)) &= U8((SQLITE_TRACE_NONLEGACY_MASK)) if (*Sqlite3)(unsafe.Pointer(db)).FxProfile != 0 { - *(*U8)(unsafe.Pointer(db + 104 /* &.mTrace */)) |= U8((SQLITE_TRACE_XPROFILE)) + *(*U8)(unsafe.Pointer(db + 106 /* &.mTrace */)) |= U8((SQLITE_TRACE_XPROFILE)) } Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return pOld @@ -141842,7 +144302,7 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // 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 *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163162:17: */ +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:166132:17: */ var pOld uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -141855,7 +144315,7 @@ func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uin // Register a callback to be invoked each time a row is updated, // inserted or deleted using this database connection. -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163187:17: */ +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:166157:17: */ var pRet uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -141868,7 +144328,7 @@ func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uin // Register a callback to be invoked each time a transaction is rolled // back by this database connection. -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163212:17: */ +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:166182:17: */ var pRet uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -141881,7 +144341,7 @@ func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg u // Register a callback to be invoked each time a row is updated, // inserted or deleted using this database connection. -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163238:17: */ +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:166208:17: */ var pRet uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg @@ -141895,7 +144355,7 @@ func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg // Invoke sqlite3_wal_checkpoint if the number of frames in the log file // is greater than sqlite3.pWalArg cast to an integer (the value configured by // wal_autocheckpoint()). -func Xsqlite3WalDefaultHook(tls *libc.TLS, pClientData uintptr, db uintptr, zDb uintptr, nFrame int32) int32 { /* sqlite3.c:163261:20: */ +func Xsqlite3WalDefaultHook(tls *libc.TLS, pClientData uintptr, db uintptr, zDb uintptr, nFrame int32) int32 { /* sqlite3.c:166231:20: */ if nFrame >= (int32(pClientData)) { Xsqlite3BeginBenignMalloc(tls) Xsqlite3_wal_checkpoint(tls, db, zDb) @@ -141913,7 +144373,7 @@ func Xsqlite3WalDefaultHook(tls *libc.TLS, pClientData uintptr, db uintptr, zDb // 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 *libc.TLS, db uintptr, nFrame int32) int32 { /* sqlite3.c:163287:16: */ +func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) int32 { /* sqlite3.c:166257:16: */ if nFrame > 0 { Xsqlite3_wal_hook(tls, db, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 @@ -141926,7 +144386,7 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) int32 // 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 *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163308:17: */ +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:166278:17: */ var pRet uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Sqlite3)(unsafe.Pointer(db)).FpWalArg @@ -141937,12 +144397,12 @@ func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintpt } // Checkpoint database zDb. -func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:163335:16: */ +func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:166305:16: */ bp := tls.Alloc(8) defer tls.Free(8) - var rc int32 // Return code - var iDb int32 = SQLITE_MAX_ATTACHED // sqlite3.aDb[] index of db to checkpoint + var rc int32 // Return code + var iDb int32 // Schema to checkpoint // Initialize the output variables to -1 in case an error occurs. if pnLog != 0 { @@ -141961,10 +144421,12 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if (zDb != 0) && (*(*int8)(unsafe.Pointer(zDb)) != 0) { iDb = Xsqlite3FindDbName(tls, db, zDb) + } else { + iDb = (SQLITE_MAX_ATTACHED + 2) // This means process all schemas } if iDb < 0 { rc = SQLITE_ERROR - Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+21356 /* "unknown database..." */, libc.VaList(bp, zDb)) + Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+21880 /* "unknown database..." */, libc.VaList(bp, zDb)) } else { (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = Xsqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -141975,7 +144437,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in // If there are no active statements, clear the interrupt flag at this // point. if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 { - libc.AtomicStoreNInt32((db + 392 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) + libc.AtomicStoreNInt32((db + 400 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) } Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -141985,7 +144447,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in // 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 *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:163397:16: */ +func Xsqlite3_wal_checkpoint(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:166369:16: */ // EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to // sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). return Xsqlite3_wal_checkpoint_v2(tls, db, zDb, SQLITE_CHECKPOINT_PASSIVE, uintptr(0), uintptr(0)) @@ -142003,19 +144465,21 @@ func Xsqlite3_wal_checkpoint(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* // 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 +// If iDb is passed SQLITE_MAX_DB then all attached databases are // checkpointed. If an error is encountered it is returned immediately - // no attempt is made to checkpoint any remaining databases. // // Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL, RESTART // or TRUNCATE. -func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:163424:20: */ +func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:166396:20: */ var rc int32 = SQLITE_OK // Return code var i int32 // Used to iterate through attached dbs var bBusy int32 = 0 // True if SQLITE_BUSY has been encountered + // See forum post a006d86f72 + for i = 0; (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb) && (rc == SQLITE_OK); i++ { - if (i == iDb) || (iDb == SQLITE_MAX_ATTACHED) { + if (i == iDb) || (iDb == (SQLITE_MAX_ATTACHED + 2)) { rc = Xsqlite3BtreeCheckpoint(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpBt, eMode, pnLog, pnCkpt) pnLog = uintptr(0) pnCkpt = uintptr(0) @@ -142049,19 +144513,19 @@ func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog // 2 2 memory (return 1) // 2 0 memory (return 1) // 3 any memory (return 1) -func Xsqlite3TempInMemory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163468:20: */ +func Xsqlite3TempInMemory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166442:20: */ return (libc.Bool32(int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == 2)) } // Return UTF-8 encoded English language explanation of the most recent // error. -func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:163489:23: */ +func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:166463:23: */ var z uintptr if !(db != 0) { return Xsqlite3ErrStr(tls, SQLITE_NOMEM) } if !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return Xsqlite3ErrStr(tls, Xsqlite3MisuseError(tls, 163495)) + return Xsqlite3ErrStr(tls, Xsqlite3MisuseError(tls, 166469)) } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -142084,7 +144548,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:163489:23 // Return UTF-16 encoded English language explanation of the most recent // error. -func Xsqlite3_errmsg16(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:163517:23: */ +func Xsqlite3_errmsg16(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:166491:23: */ var z uintptr if !(db != 0) { return uintptr(uintptr(unsafe.Pointer(&outOfMem))) @@ -142113,18 +144577,18 @@ func Xsqlite3_errmsg16(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:163517: var outOfMem = [14]U16{ U16('o'), U16('u'), U16('t'), U16(' '), U16('o'), U16('f'), U16(' '), U16('m'), U16('e'), U16('m'), U16('o'), U16('r'), U16('y'), U16(0), -} /* sqlite3.c:163518:20 */ +} /* sqlite3.c:166492:20 */ var misuse = [34]U16{ U16('b'), U16('a'), U16('d'), U16(' '), U16('p'), U16('a'), U16('r'), U16('a'), U16('m'), U16('e'), U16('t'), U16('e'), U16('r'), U16(' '), U16('o'), U16('r'), U16(' '), U16('o'), U16('t'), U16('h'), U16('e'), U16('r'), U16(' '), U16('A'), U16('P'), U16('I'), U16(' '), U16('m'), U16('i'), U16('s'), U16('u'), U16('s'), U16('e'), U16(0), -} /* sqlite3.c:163521:20 */ +} /* sqlite3.c:166495:20 */ // 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 *libc.TLS, db uintptr) int32 { /* sqlite3.c:163559:16: */ +func Xsqlite3_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166533:16: */ if (db != 0) && !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return Xsqlite3MisuseError(tls, 163561) + return Xsqlite3MisuseError(tls, 166535) } if !(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { return SQLITE_NOMEM @@ -142132,9 +144596,9 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163559:16: return ((*Sqlite3)(unsafe.Pointer(db)).FerrCode & (*Sqlite3)(unsafe.Pointer(db)).FerrMask) } -func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163568:16: */ +func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166542:16: */ if (db != 0) && !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return Xsqlite3MisuseError(tls, 163570) + return Xsqlite3MisuseError(tls, 166544) } if !(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { return SQLITE_NOMEM @@ -142142,7 +144606,7 @@ func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:1 return (*Sqlite3)(unsafe.Pointer(db)).FerrCode } -func Xsqlite3_system_errno(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163577:16: */ +func Xsqlite3_system_errno(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166551:16: */ if db != 0 { return (*Sqlite3)(unsafe.Pointer(db)).FiSysErrno } @@ -142152,13 +144616,13 @@ func Xsqlite3_system_errno(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:16357 // 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 *libc.TLS, rc int32) uintptr { /* sqlite3.c:163586:23: */ +func Xsqlite3_errstr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:166560:23: */ return Xsqlite3ErrStr(tls, rc) } // Create a new collating function for database "db". The name is zName // and the encoding is enc. -func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:163594:12: */ +func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:166568:12: */ var pColl uintptr var enc2 int32 @@ -142171,7 +144635,7 @@ func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uint enc2 = SQLITE_UTF16LE } if (enc2 < SQLITE_UTF8) || (enc2 > SQLITE_UTF16BE) { - return Xsqlite3MisuseError(tls, 163618) + return Xsqlite3MisuseError(tls, 166592) } // Check if this call is removing or replacing an existing collation @@ -142181,7 +144645,7 @@ func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uint if (pColl != 0) && ((*CollSeq)(unsafe.Pointer(pColl)).FxCmp != 0) { if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY, - ts+21377 /* "unable to delete..." */, 0) + ts+21901 /* "unable to delete..." */, 0) return SQLITE_BUSY } Xsqlite3ExpirePreparedStatements(tls, db, 0) @@ -142192,7 +144656,7 @@ func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uint // Also, collation destructor - CollSeq.xDel() - function may need // to be called. if (int32((*CollSeq)(unsafe.Pointer(pColl)).Fenc) & libc.CplInt32(SQLITE_UTF16_ALIGNED)) == enc2 { - var aColl uintptr = Xsqlite3HashFind(tls, (db + 600 /* &.aCollSeq */), zName) + var aColl uintptr = Xsqlite3HashFind(tls, (db + 608 /* &.aCollSeq */), zName) var j int32 for j = 0; j < 3; j++ { var p uintptr = (aColl + uintptr(j)*40) @@ -142234,7 +144698,7 @@ var aHardLimit = [12]int32{ SQLITE_MAX_VARIABLE_NUMBER, // IMP: R-38091-32352 SQLITE_MAX_TRIGGER_DEPTH, SQLITE_MAX_WORKER_THREADS, -} /* sqlite3.c:163671:18 */ +} /* sqlite3.c:166645:18 */ // Make sure the hard limits are set to reasonable values @@ -142246,7 +144710,7 @@ var aHardLimit = [12]int32{ // A new lower limit does not shrink existing constructs. // It merely prevents new constructs that exceed the limit // from forming. -func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) int32 { /* sqlite3.c:163734:16: */ +func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) int32 { /* sqlite3.c:166708:16: */ var oldLimit int32 // EVIDENCE-OF: R-30189-54097 For each limit category SQLITE_LIMIT_NAME @@ -142257,12 +144721,12 @@ func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) in if (limitId < 0) || (limitId >= (SQLITE_LIMIT_WORKER_THREADS + 1)) { return -1 } - oldLimit = *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(limitId)*4)) + oldLimit = *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + uintptr(limitId)*4)) if newLimit >= 0 { // IMP: R-52476-28732 if newLimit > aHardLimit[limitId] { newLimit = aHardLimit[limitId] // IMP: R-51463-25634 } - *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(limitId)*4)) = newLimit + *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + uintptr(limitId)*4)) = newLimit } return oldLimit // IMP: R-53341-35419 } @@ -142291,7 +144755,7 @@ func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) in // 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 Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags uintptr, ppVfs uintptr, pzFile uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:163804:20: */ +func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags uintptr, ppVfs uintptr, pzFile uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:166778:20: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -142322,9 +144786,9 @@ func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u zVfs = zDefaultVfs nUri = Xsqlite3Strlen30(tls, zUri) - if !(((((flags & SQLITE_OPEN_URI) != 0) || // IMP: R-48725-32206 + if !(((((flags & uint32(SQLITE_OPEN_URI)) != 0) || // IMP: R-48725-32206 (Xsqlite3Config.FbOpenUri != 0)) && // IMP: R-51689-46548 - (nUri >= 5)) && (libc.Xmemcmp(tls, zUri, ts+21445 /* "file:" */, uint64(5)) == 0)) { + (nUri >= 5)) && (libc.Xmemcmp(tls, zUri, ts+21969 /* "file:" */, uint64(5)) == 0)) { goto __1 } // Input character index iOut = 0 // Output character index @@ -142332,7 +144796,7 @@ func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u // Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen // method that there may be extra parameters following the file-name. - flags = flags | (SQLITE_OPEN_URI) + flags = flags | (uint32(SQLITE_OPEN_URI)) iIn = 0 __3: @@ -142372,10 +144836,10 @@ __8: goto __8 __9: ; - if !((iIn != 7) && ((iIn != 16) || (libc.Xmemcmp(tls, ts+21451 /* "localhost" */, (zUri+7), uint64(9)) != 0))) { + if !((iIn != 7) && ((iIn != 16) || (libc.Xmemcmp(tls, ts+21975 /* "localhost" */, (zUri+7), uint64(9)) != 0))) { goto __10 } - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+21461, /* "invalid uri auth..." */ + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+21985, /* "invalid uri auth..." */ libc.VaList(bp, (iIn-7), (zUri+7))) rc = SQLITE_ERROR goto parse_uri_out @@ -142497,7 +144961,7 @@ __27: zVal = (zOpt + uintptr((nOpt + 1))) nVal = Xsqlite3Strlen30(tls, zVal) - if !((nOpt == 3) && (libc.Xmemcmp(tls, ts+21489 /* "vfs" */, zOpt, uint64(3)) == 0)) { + if !((nOpt == 3) && (libc.Xmemcmp(tls, ts+22013 /* "vfs" */, zOpt, uint64(3)) == 0)) { goto __29 } zVfs = zVal @@ -142508,17 +144972,17 @@ __29: mask = 0 limit = 0 - if !((nOpt == 5) && (libc.Xmemcmp(tls, ts+21493 /* "cache" */, zOpt, uint64(5)) == 0)) { + if !((nOpt == 5) && (libc.Xmemcmp(tls, ts+22017 /* "cache" */, zOpt, uint64(5)) == 0)) { goto __31 } mask = (SQLITE_OPEN_SHAREDCACHE | SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&aCacheMode)) limit = mask - zModeType = ts + 21493 /* "cache" */ + zModeType = ts + 22017 /* "cache" */ __31: ; - if !((nOpt == 4) && (libc.Xmemcmp(tls, ts+21499 /* "mode" */, zOpt, uint64(4)) == 0)) { + if !((nOpt == 4) && (libc.Xmemcmp(tls, ts+22023 /* "mode" */, zOpt, uint64(4)) == 0)) { goto __32 } @@ -142526,7 +144990,7 @@ __31: SQLITE_OPEN_CREATE) | SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&aOpenMode)) limit = (int32(uint32(mask) & flags)) - zModeType = ts + 2299 /* "access" */ + zModeType = ts + 2327 /* "access" */ __32: ; @@ -142557,7 +145021,7 @@ __36: if !(mode == 0) { goto __38 } - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+21504 /* "no such %s mode:..." */, libc.VaList(bp+16, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+22028 /* "no such %s mode:..." */, libc.VaList(bp+16, zModeType, zVal)) rc = SQLITE_ERROR goto parse_uri_out __38: @@ -142565,7 +145029,7 @@ __38: if !((mode & libc.CplInt32(SQLITE_OPEN_MEMORY)) > limit) { goto __39 } - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+21524, /* "%s mode not allo..." */ + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+22048, /* "%s mode not allo..." */ libc.VaList(bp+32, zModeType, zVal)) rc = SQLITE_PERM goto parse_uri_out @@ -142608,7 +145072,7 @@ __2: if !(*(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0)) { goto __42 } - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+21548 /* "no such vfs: %s" */, libc.VaList(bp+48, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+22072 /* "no such vfs: %s" */, libc.VaList(bp+48, zVfs)) rc = SQLITE_ERROR __42: ; @@ -142629,24 +145093,24 @@ type OpenMode = struct { Fz uintptr Fmode int32 _ [4]byte -} /* sqlite3.c:163946:9 */ +} /* sqlite3.c:166920:9 */ var aCacheMode = [3]OpenMode{ - {Fz: ts + 21564 /* "shared" */, Fmode: SQLITE_OPEN_SHAREDCACHE}, - {Fz: ts + 21571 /* "private" */, Fmode: SQLITE_OPEN_PRIVATECACHE}, + {Fz: ts + 22088 /* "shared" */, Fmode: SQLITE_OPEN_SHAREDCACHE}, + {Fz: ts + 22095 /* "private" */, Fmode: SQLITE_OPEN_PRIVATECACHE}, {}, -} /* sqlite3.c:163955:34 */ +} /* sqlite3.c:166929:34 */ var aOpenMode = [5]OpenMode{ - {Fz: ts + 21579 /* "ro" */, Fmode: SQLITE_OPEN_READONLY}, - {Fz: ts + 21582 /* "rw" */, Fmode: SQLITE_OPEN_READWRITE}, - {Fz: ts + 21585 /* "rwc" */, Fmode: (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)}, - {Fz: ts + 14958 /* "memory" */, Fmode: SQLITE_OPEN_MEMORY}, + {Fz: ts + 22103 /* "ro" */, Fmode: SQLITE_OPEN_READONLY}, + {Fz: ts + 22106 /* "rw" */, Fmode: SQLITE_OPEN_READWRITE}, + {Fz: ts + 22109 /* "rwc" */, Fmode: (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)}, + {Fz: ts + 15387 /* "memory" */, Fmode: SQLITE_OPEN_MEMORY}, {}, -} /* sqlite3.c:163967:34 */ +} /* sqlite3.c:166941:34 */ // This routine does the core work of extracting URI parameters from a // database filename for the sqlite3_uri_parameter() interface. -func uriParameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:164041:19: */ +func uriParameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:167015:19: */ zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)) for *(*int8)(unsafe.Pointer(zFilename)) != 0 { var x int32 = libc.Xstrcmp(tls, zFilename, zParam) @@ -142662,7 +145126,7 @@ func uriParameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* // 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 *libc.TLS, zFilename uintptr, ppDb uintptr, flags uint32, zVfs uintptr) int32 { /* sqlite3.c:164059:12: */ +func openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, flags uint32, zVfs uintptr) int32 { /* sqlite3.c:167033:12: */ bp := tls.Alloc(32) defer tls.Free(32) *(*uint32)(unsafe.Pointer(bp + 8)) = flags @@ -142693,13 +145157,13 @@ __1: isThreadsafe = 0 goto __3 __2: - if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & SQLITE_OPEN_NOMUTEX) != 0) { + if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_NOMUTEX)) != 0) { goto __4 } isThreadsafe = 0 goto __5 __4: - if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & SQLITE_OPEN_FULLMUTEX) != 0) { + if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_FULLMUTEX)) != 0) { goto __6 } isThreadsafe = 1 @@ -142713,7 +145177,7 @@ __5: __3: ; - if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & SQLITE_OPEN_PRIVATECACHE) != 0) { + if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_PRIVATECACHE)) != 0) { goto __8 } *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) &= libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_SHAREDCACHE)) @@ -142722,7 +145186,7 @@ __8: if !(Xsqlite3Config.FsharedCacheEnabled != 0) { goto __10 } - *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) |= SQLITE_OPEN_SHAREDCACHE + *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) |= uint32(SQLITE_OPEN_SHAREDCACHE) __10: ; __9: @@ -142770,12 +145234,12 @@ __12: (*Sqlite3)(unsafe.Pointer(db)).FerrMask = 0xff (*Sqlite3)(unsafe.Pointer(db)).FnDb = 2 (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_BUSY - (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 648 /* &.aDbStatic */ + (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 656 /* &.aDbStatic */ (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable = U32(1) (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0) - libc.Xmemcpy(tls, db+124 /* &.aLimit */, uintptr(unsafe.Pointer(&aHardLimit)), uint64(unsafe.Sizeof([12]int32{}))) - *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 11*4)) = SQLITE_DEFAULT_WORKER_THREADS + libc.Xmemcpy(tls, db+128 /* &.aLimit */, uintptr(unsafe.Pointer(&aHardLimit)), uint64(unsafe.Sizeof([12]int32{}))) + *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 11*4)) = SQLITE_DEFAULT_WORKER_THREADS (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1) (*Sqlite3)(unsafe.Pointer(db)).FnextAutovac = int8(-1) (*Sqlite3)(unsafe.Pointer(db)).FszMmap = Xsqlite3Config.FszMmap @@ -142784,8 +145248,8 @@ __12: *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(((((((uint32(SQLITE_ShortColNames | SQLITE_EnableTrigger)) | SQLITE_EnableView) | - SQLITE_CacheSpill) | - SQLITE_TrustedSchema) | + uint32(SQLITE_CacheSpill)) | + uint32(SQLITE_TrustedSchema)) | // The SQLITE_DQS compile-time option determines the default settings // for SQLITE_DBCONFIG_DQS_DDL and SQLITE_DBCONFIG_DQS_DML. // @@ -142800,12 +145264,12 @@ __12: // Legacy behavior is 3 (double-quoted string literals are allowed anywhere) // and so that is the default. But developers are encouranged to use // -DSQLITE_DQS=0 (best) or -DSQLITE_DQS=1 (second choice) if possible. - SQLITE_DqsDML) | - SQLITE_DqsDDL) | + uint32(SQLITE_DqsDML)) | + uint32(SQLITE_DqsDDL)) | - SQLITE_AutoIndex)) - Xsqlite3HashInit(tls, (db + 600 /* &.aCollSeq */)) - Xsqlite3HashInit(tls, (db + 528 /* &.aModule */)) + uint32(SQLITE_AutoIndex))) + Xsqlite3HashInit(tls, (db + 608 /* &.aCollSeq */)) + Xsqlite3HashInit(tls, (db + 536 /* &.aModule */)) // Add the default collation sequence BINARY. BINARY works for both UTF-8 // and UTF-16, so add a version for each to avoid any unnecessary @@ -142813,19 +145277,19 @@ __12: // // EVIDENCE-OF: R-52786-44878 SQLite defines three built-in collating // functions: - createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{binCollFunc})), uintptr(0)) - createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), SQLITE_UTF16BE, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{binCollFunc})), uintptr(0)) - createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), SQLITE_UTF16LE, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{binCollFunc})), uintptr(0)) - createCollation(tls, db, ts+19183 /* "NOCASE" */, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, ts+19659 /* "NOCASE" */, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{nocaseCollatingFunc})), uintptr(0)) - createCollation(tls, db, ts+21589 /* "RTRIM" */, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, ts+22113 /* "RTRIM" */, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{rtrimCollFunc})), uintptr(0)) if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { @@ -142854,7 +145318,7 @@ __15: if !(((int32(1) << (*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(7))) & 0x46) == 0) { goto __16 } - rc = Xsqlite3MisuseError(tls, 164264) // IMP: R-18321-05872 + rc = Xsqlite3MisuseError(tls, 167238) // IMP: R-18321-05872 goto __17 __16: rc = Xsqlite3ParseUri(tls, zVfs, zFilename, bp+8 /* &flags */, (db /* &.pVfs */), bp+16 /* &zOpen */, bp+24 /* &zErrMsg */) @@ -142871,7 +145335,7 @@ __19: ; Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr { if *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) != 0 { - return ts + 2690 /* "%s" */ + return ts + 2718 /* "%s" */ } return uintptr(0) }(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)))) @@ -142882,7 +145346,7 @@ __18: // Open the backend database driver rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, *(*uintptr)(unsafe.Pointer(bp + 16 /* zOpen */)), db, ((*Sqlite3)(unsafe.Pointer(db)).FaDb + 8 /* &.pBt */), 0, - (int32(*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) | SQLITE_OPEN_MAIN_DB))) + (int32(*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) | uint32(SQLITE_OPEN_MAIN_DB)))) if !(rc != SQLITE_OK) { goto __20 } @@ -142909,10 +145373,10 @@ __22: // The default safety_level for the main database is FULL; for the temp // database it is OFF. This matches the pager layer defaults. - (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FzDbSName = ts + 5282 /* "main" */ + (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FzDbSName = ts + 5327 /* "main" */ (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).Fsafety_level = (U8(SQLITE_DEFAULT_SYNCHRONOUS + 1)) - (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FzDbSName = ts + 20591 /* "temp" */ - (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).Fsafety_level = PAGER_SYNCHRONOUS_OFF + (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FzDbSName = ts + 21115 /* "temp" */ + (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).Fsafety_level = U8(PAGER_SYNCHRONOUS_OFF) (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_OPEN if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { @@ -142997,7 +145461,7 @@ __31: if !(rc != SQLITE_OK) { goto __33 } - (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_SICK + (*Sqlite3)(unsafe.Pointer(db)).Fmagic = U32(SQLITE_MAGIC_SICK) __33: ; __32: @@ -143008,17 +145472,17 @@ __32: } // Open a new database handle. -func Xsqlite3_open(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:164386:16: */ +func Xsqlite3_open(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:167360:16: */ return openDatabase(tls, zFilename, ppDb, (uint32(SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)), uintptr(0)) } -func Xsqlite3_open_v2(tls *libc.TLS, filename uintptr, ppDb uintptr, flags int32, zVfs uintptr) int32 { /* sqlite3.c:164393:16: */ +func Xsqlite3_open_v2(tls *libc.TLS, filename uintptr, ppDb uintptr, flags int32, zVfs uintptr) int32 { /* sqlite3.c:167367:16: */ return openDatabase(tls, filename, ppDb, uint32(flags), zVfs) } // Open a new database handle. -func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:164406:16: */ +func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:167380:16: */ var zFilename8 uintptr // zFilename encoded in UTF-8 instead of UTF-16 var pVal uintptr var rc int32 @@ -143029,17 +145493,17 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* return rc } if zFilename == uintptr(0) { - zFilename = ts + 21595 /* "\x00\x00" */ + zFilename = ts + 22119 /* "\x00\x00" */ } pVal = Xsqlite3ValueNew(tls, uintptr(0)) - Xsqlite3ValueSetStr(tls, pVal, -1, zFilename, SQLITE_UTF16LE, uintptr(0)) - zFilename8 = Xsqlite3ValueText(tls, pVal, SQLITE_UTF8) + Xsqlite3ValueSetStr(tls, pVal, -1, zFilename, uint8(SQLITE_UTF16LE), uintptr(0)) + zFilename8 = Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) if zFilename8 != 0 { rc = openDatabase(tls, zFilename8, ppDb, (uint32(SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)), uintptr(0)) if (rc == SQLITE_OK) && !((int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).FschemaFlags) & (DB_SchemaLoaded)) == (DB_SchemaLoaded)) { - ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).Fenc) = libc.AssignPtrUint8(*(*uintptr)(unsafe.Pointer(ppDb))+94 /* &.enc */, SQLITE_UTF16LE) + ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).Fenc) = libc.AssignPtrUint8(*(*uintptr)(unsafe.Pointer(ppDb))+96 /* &.enc */, U8(SQLITE_UTF16LE)) } } else { rc = SQLITE_NOMEM @@ -143050,12 +145514,12 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* } // Register a new collation sequence with the database handle db. -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:164445:16: */ +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:167419:16: */ return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) } // Register a new collation sequence with the database handle db. -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:164458:16: */ +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:167432:16: */ var rc int32 Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -143067,13 +145531,13 @@ func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc } // Register a new collation sequence with the database handle db. -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:164483:16: */ +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:167457:16: */ var rc int32 = SQLITE_OK var zName8 uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - zName8 = Xsqlite3Utf16to8(tls, db, zName, -1, SQLITE_UTF16LE) + zName8 = Xsqlite3Utf16to8(tls, db, zName, -1, uint8(SQLITE_UTF16LE)) if zName8 != 0 { rc = createCollation(tls, db, zName8, U8(enc), pCtx, xCompare, uintptr(0)) Xsqlite3DbFree(tls, db, zName8) @@ -143085,7 +145549,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i // Register a collation sequence factory callback with the database handle // db. Replace any previously installed collation sequence factory. -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) int32 { /* sqlite3.c:164513:16: */ +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) int32 { /* sqlite3.c:167487:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) @@ -143096,7 +145560,7 @@ func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr // Register a collation sequence factory callback with the database handle // db. Replace any previously installed collation sequence factory. -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) int32 { /* sqlite3.c:164534:16: */ +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) int32 { /* sqlite3.c:167508:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 @@ -143107,7 +145571,7 @@ func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintp // This function is now an anachronism. It used to be used to recover from a // malloc() failure, but SQLite now does this automatically. -func Xsqlite3_global_recover(tls *libc.TLS) int32 { /* sqlite3.c:164556:16: */ +func Xsqlite3_global_recover(tls *libc.TLS) int32 { /* sqlite3.c:167530:16: */ return SQLITE_OK } @@ -143115,7 +145579,7 @@ func Xsqlite3_global_recover(tls *libc.TLS) int32 { /* sqlite3.c:164556:16: */ // 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 *libc.TLS, db uintptr) int32 { /* sqlite3.c:164567:16: */ +func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:167541:16: */ return int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) } @@ -143128,28 +145592,28 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:164 // // 2. Invoke sqlite3_log() to provide the source code location where // a low-level error is first detected. -func Xsqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) int32 { /* sqlite3.c:164588:20: */ +func Xsqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) int32 { /* sqlite3.c:167562:20: */ bp := tls.Alloc(24) defer tls.Free(24) - Xsqlite3_log(tls, iErr, ts+21598, /* "%s at line %d of..." */ + Xsqlite3_log(tls, iErr, ts+22122, /* "%s at line %d of..." */ libc.VaList(bp, zType, lineno, (uintptr(20)+Xsqlite3_sourceid(tls)))) return iErr } -func Xsqlite3CorruptError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:164593:20: */ +func Xsqlite3CorruptError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:167567:20: */ - return Xsqlite3ReportError(tls, SQLITE_CORRUPT, lineno, ts+21623 /* "database corrupt..." */) + return Xsqlite3ReportError(tls, SQLITE_CORRUPT, lineno, ts+22147 /* "database corrupt..." */) } -func Xsqlite3MisuseError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:164597:20: */ +func Xsqlite3MisuseError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:167571:20: */ - return Xsqlite3ReportError(tls, SQLITE_MISUSE, lineno, ts+21643 /* "misuse" */) + return Xsqlite3ReportError(tls, SQLITE_MISUSE, lineno, ts+22167 /* "misuse" */) } -func Xsqlite3CantopenError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:164601:20: */ +func Xsqlite3CantopenError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:167575:20: */ - return Xsqlite3ReportError(tls, SQLITE_CANTOPEN, lineno, ts+21650 /* "cannot open file" */) + return Xsqlite3ReportError(tls, SQLITE_CANTOPEN, lineno, ts+22174 /* "cannot open file" */) } // This is a convenience routine that makes sure that all thread-specific @@ -143157,12 +145621,12 @@ func Xsqlite3CantopenError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:164 // // 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 *libc.TLS) { /* sqlite3.c:164632:17: */ +func Xsqlite3_thread_cleanup(tls *libc.TLS) { /* sqlite3.c:167606:17: */ } // 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 *libc.TLS, db uintptr, zDbName uintptr, zTableName uintptr, zColumnName uintptr, pzDataType uintptr, pzCollSeq uintptr, pNotNull uintptr, pPrimaryKey uintptr, pAutoinc uintptr) int32 { /* sqlite3.c:164640:16: */ +func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, zTableName uintptr, zColumnName uintptr, pzDataType uintptr, pzCollSeq uintptr, pNotNull uintptr, pPrimaryKey uintptr, pAutoinc uintptr) int32 { /* sqlite3.c:167614:16: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -143237,7 +145701,7 @@ __7: if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { goto __9 } - if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && (Xsqlite3IsRowid(tls, zColumnName) != 0)) { + if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && (Xsqlite3IsRowid(tls, zColumnName) != 0)) { goto __10 } iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey) @@ -143273,10 +145737,10 @@ __4: zCollSeq = (*Column)(unsafe.Pointer(pCol)).FzColl notnull = (libc.Bool32(int32((*Column)(unsafe.Pointer(pCol)).FnotNull) != 0)) primarykey = (libc.Bool32((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_PRIMKEY) != 0)) - autoinc = (libc.Bool32((int32((*Table)(unsafe.Pointer(pTab)).FiPKey) == iCol) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Autoincrement) != U32(0)))) + autoinc = (libc.Bool32((int32((*Table)(unsafe.Pointer(pTab)).FiPKey) == iCol) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != U32(0)))) goto __13 __12: - zDataType = ts + 10507 /* "INTEGER" */ + zDataType = ts + 10923 /* "INTEGER" */ primarykey = 1 __13: ; @@ -143328,14 +145792,14 @@ __19: goto __20 } Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */))) - *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) = Xsqlite3MPrintf(tls, db, ts+21667 /* "no such table co..." */, libc.VaList(bp, zTableName, + *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) = Xsqlite3MPrintf(tls, db, ts+22191 /* "no such table co..." */, libc.VaList(bp, zTableName, zColumnName)) rc = SQLITE_ERROR __20: ; Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr { if *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) != 0 { - return ts + 2690 /* "%s" */ + return ts + 2718 /* "%s" */ } return uintptr(0) }(), libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)))) @@ -143346,7 +145810,7 @@ __20: } // Sleep for a little while. Return the amount of time slept. -func Xsqlite3_sleep(tls *libc.TLS, ms int32) int32 { /* sqlite3.c:164758:16: */ +func Xsqlite3_sleep(tls *libc.TLS, ms int32) int32 { /* sqlite3.c:167732:16: */ var pVfs uintptr var rc int32 pVfs = Xsqlite3_vfs_find(tls, uintptr(0)) @@ -143361,7 +145825,7 @@ func Xsqlite3_sleep(tls *libc.TLS, ms int32) int32 { /* sqlite3.c:164758:16: */ } // Enable or disable the extended result codes. -func Xsqlite3_extended_result_codes(tls *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:164774:16: */ +func Xsqlite3_extended_result_codes(tls *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:167748:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).FerrMask = func() int32 { if onoff != 0 { @@ -143374,7 +145838,7 @@ func Xsqlite3_extended_result_codes(tls *libc.TLS, db uintptr, onoff int32) int3 } // Invoke the xFileControl method on a particular database. -func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:164787:16: */ +func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:167761:16: */ var rc int32 = SQLITE_ERROR var pBtree uintptr @@ -143408,7 +145872,9 @@ func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, } rc = SQLITE_OK } else { + var nSave int32 = (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy rc = Xsqlite3OsFileControl(tls, fd, op, pArg) + (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = nSave } Xsqlite3BtreeLeave(tls, pBtree) } @@ -143417,7 +145883,7 @@ func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, } // Interface to the testing logic. -func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:164835:16: */ +func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:167811:16: */ var rc int32 = 0 var ap Va_list _ = ap @@ -143629,7 +146095,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit case SQLITE_TESTCTRL_OPTIMIZATIONS: { var db uintptr = libc.VaUintptr(&ap) - (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags = (U16((int32(libc.VaInt32(&ap))) & 0xffff)) + (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags = U32(libc.VaUint32(&ap)) break } @@ -143652,7 +146118,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: { var db uintptr = libc.VaUintptr(&ap) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) ^= (DBFLAG_InternalFunc) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) ^= (U32(DBFLAG_InternalFunc)) break } @@ -143752,7 +146218,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit var db uintptr = libc.VaUintptr(&ap) Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(Xsqlite3FindDbName(tls, db, libc.VaUintptr(&ap))) - (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(libc.AssignBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.imposterTable */, uint32(libc.VaInt32(&ap)), 1, 1, 0x2)) + (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(libc.AssignBitFieldPtr8Uint32(db+184 /* &.init */ +8 /* &.imposterTable */, uint32(libc.VaInt32(&ap)), 1, 1, 0x2)) (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum = Pgno(libc.VaInt32(&ap)) if (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0) && ((*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum > Pgno(0)) { Xsqlite3ResetAllSchemasOfConnection(tls, db) @@ -143778,6 +146244,55 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit break } + + // sqlite3_test_control(SQLITE_TESTCTRL_SEEK_COUNT, + // sqlite3 *db, // Database connection + // u64 *pnSeek // Write seek count here + // ); + // + // This test-control queries the seek-counter on the "main" database + // file. The seek-counter is written into *pnSeek and is then reset. + // The seek-count is only available if compiled with SQLITE_DEBUG. + case SQLITE_TESTCTRL_SEEK_COUNT: + { + var db uintptr = libc.VaUintptr(&ap) + _ = db + var pn uintptr = libc.VaUintptr(&ap) + *(*U64)(unsafe.Pointer(pn)) = uint64(0) + _ = db // Silence harmless unused variable warning + break + + } + + // sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, op, ptr) + // + // "ptr" is a pointer to a u32. + // + // op==0 Store the current sqlite3SelectTrace in *ptr + // op==1 Set sqlite3SelectTrace to the value *ptr + // op==3 Store the current sqlite3WhereTrace in *ptr + // op==3 Set sqlite3WhereTrace to the value *ptr + case SQLITE_TESTCTRL_TRACEFLAGS: + { + var opTrace int32 = int32(libc.VaInt32(&ap)) + var ptr uintptr = libc.VaUintptr(&ap) + switch opTrace { + case 0: + *(*U32)(unsafe.Pointer(ptr)) = Xsqlite3SelectTrace + break + case 1: + Xsqlite3SelectTrace = *(*U32)(unsafe.Pointer(ptr)) + break + case 2: + *(*U32)(unsafe.Pointer(ptr)) = Xsqlite3WhereTrace + break + case 3: + Xsqlite3WhereTrace = *(*U32)(unsafe.Pointer(ptr)) + break + } + break + + } } _ = ap return rc @@ -143789,7 +146304,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit // backwards for the first byte following four consecutive zero bytes. // // This only works if the filename passed in was obtained from the Pager. -func databaseName(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:165221:19: */ +func databaseName(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:168235:19: */ for (((int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-1)))) != 0) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-2)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-3)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-4)))) != 0) { zName-- } @@ -143798,7 +146313,7 @@ func databaseName(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:165221:19 // Append text z[] to the end of p[]. Return a pointer to the first // character after then zero terminator on the new text in p[]. -func appendText(tls *libc.TLS, p uintptr, z uintptr) uintptr { /* sqlite3.c:165232:13: */ +func appendText(tls *libc.TLS, p uintptr, z uintptr) uintptr { /* sqlite3.c:168246:13: */ var n Size_t = libc.Xstrlen(tls, z) libc.Xmemcpy(tls, p, z, (n + uint64(1))) return ((p + uintptr(n)) + uintptr(1)) @@ -143811,7 +146326,7 @@ func appendText(tls *libc.TLS, p uintptr, z uintptr) uintptr { /* sqlite3.c:1652 // // Memory layout must be compatible with that generated by the pager // and expected by sqlite3_uri_parameter() and databaseName(). -func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr, zWal uintptr, nParam int32, azParam uintptr) uintptr { /* sqlite3.c:165247:17: */ +func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr, zWal uintptr, nParam int32, azParam uintptr) uintptr { /* sqlite3.c:168261:17: */ var nByte Sqlite3_int64 var i int32 var pResult uintptr @@ -143842,7 +146357,7 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr // Free memory obtained from sqlite3_create_filename(). It is a severe // error to call this routine with any parameter other than a pointer // previously obtained from sqlite3_create_filename() or a NULL pointer. -func Xsqlite3_free_filename(tls *libc.TLS, p uintptr) { /* sqlite3.c:165283:17: */ +func Xsqlite3_free_filename(tls *libc.TLS, p uintptr) { /* sqlite3.c:168297:17: */ if p == uintptr(0) { return } @@ -143859,7 +146374,7 @@ func Xsqlite3_free_filename(tls *libc.TLS, p uintptr) { /* sqlite3.c:165283:17: // 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 *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:165301:23: */ +func Xsqlite3_uri_parameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:168315:23: */ if (zFilename == uintptr(0)) || (zParam == uintptr(0)) { return uintptr(0) } @@ -143868,7 +146383,7 @@ func Xsqlite3_uri_parameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) ui } // Return a pointer to the name of Nth query parameter of the filename. -func Xsqlite3_uri_key(tls *libc.TLS, zFilename uintptr, N int32) uintptr { /* sqlite3.c:165310:23: */ +func Xsqlite3_uri_key(tls *libc.TLS, zFilename uintptr, N int32) uintptr { /* sqlite3.c:168324:23: */ if (zFilename == uintptr(0)) || (N < 0) { return uintptr(0) } @@ -143885,7 +146400,7 @@ func Xsqlite3_uri_key(tls *libc.TLS, zFilename uintptr, N int32) uintptr { /* sq } // Return a boolean value for a query parameter. -func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt int32) int32 { /* sqlite3.c:165324:16: */ +func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt int32) int32 { /* sqlite3.c:168338:16: */ var z uintptr = Xsqlite3_uri_parameter(tls, zFilename, zParam) bDflt = (libc.Bool32(bDflt != 0)) if z != 0 { @@ -143895,7 +146410,7 @@ func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDfl } // Return a 64-bit integer value for a query parameter. -func Xsqlite3_uri_int64(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:165333:26: */ +func Xsqlite3_uri_int64(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:168347:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -143916,11 +146431,11 @@ func Xsqlite3_uri_int64(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt // passing free() a pointer that was not obtained from malloc() - it is // an error that we cannot easily detect but that will likely cause memory // corruption. -func Xsqlite3_filename_database(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:165356:23: */ +func Xsqlite3_filename_database(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:168370:23: */ return databaseName(tls, zFilename) } -func Xsqlite3_filename_journal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:165359:23: */ +func Xsqlite3_filename_journal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:168373:23: */ zFilename = databaseName(tls, zFilename) zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)) for *(*int8)(unsafe.Pointer(zFilename)) != 0 { @@ -143930,14 +146445,14 @@ func Xsqlite3_filename_journal(tls *libc.TLS, zFilename uintptr) uintptr { /* sq return (zFilename + uintptr(1)) } -func Xsqlite3_filename_wal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:165368:23: */ +func Xsqlite3_filename_wal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:168382:23: */ zFilename = Xsqlite3_filename_journal(tls, zFilename) zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)) return zFilename } // Return the Btree pointer identified by zDbName. Return NULL if not found. -func Xsqlite3DbNameToBtree(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:165381:22: */ +func Xsqlite3DbNameToBtree(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:168395:22: */ var iDb int32 if zDbName != 0 { iDb = Xsqlite3FindDbName(tls, db, zDbName) @@ -143952,7 +146467,7 @@ func Xsqlite3DbNameToBtree(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { // Return the filename of the database associated with a database // connection. -func Xsqlite3_db_filename(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:165390:23: */ +func Xsqlite3_db_filename(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:168404:23: */ var pBt uintptr pBt = Xsqlite3DbNameToBtree(tls, db, zDbName) if pBt != 0 { @@ -143963,7 +146478,7 @@ func Xsqlite3_db_filename(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { // Return 1 if database is read-only or 0 if read/write. Return -1 if // no such database exists. -func Xsqlite3_db_readonly(tls *libc.TLS, db uintptr, zDbName uintptr) int32 { /* sqlite3.c:165406:16: */ +func Xsqlite3_db_readonly(tls *libc.TLS, db uintptr, zDbName uintptr) int32 { /* sqlite3.c:168420:16: */ var pBt uintptr pBt = Xsqlite3DbNameToBtree(tls, db, zDbName) if pBt != 0 { @@ -143974,7 +146489,7 @@ func Xsqlite3_db_readonly(tls *libc.TLS, db uintptr, zDbName uintptr) int32 { /* // Obtain a snapshot handle for the snapshot of database zDb currently // being read by handle db. -func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:165423:16: */ +func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:168437:16: */ var rc int32 = SQLITE_ERROR Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -143983,7 +146498,7 @@ func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot ui var iDb int32 = Xsqlite3FindDbName(tls, db, zDb) if (iDb == 0) || (iDb > 1) { var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt - if 0 == Xsqlite3BtreeIsInTrans(tls, pBt) { + if SQLITE_TXN_WRITE != Xsqlite3BtreeTxnState(tls, pBt) { rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0)) if rc == SQLITE_OK { rc = Xsqlite3PagerSnapshotGet(tls, Xsqlite3BtreePager(tls, pBt), ppSnapshot) @@ -143997,7 +146512,7 @@ func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot ui } // Open a read-transaction on the snapshot idendified by pSnapshot. -func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:165459:16: */ +func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:168473:16: */ var rc int32 = SQLITE_ERROR Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -144006,10 +146521,10 @@ func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot ui iDb = Xsqlite3FindDbName(tls, db, zDb) if (iDb == 0) || (iDb > 1) { var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt - if Xsqlite3BtreeIsInTrans(tls, pBt) == 0 { + if Xsqlite3BtreeTxnState(tls, pBt) != SQLITE_TXN_WRITE { var pPager uintptr = Xsqlite3BtreePager(tls, pBt) var bUnlock int32 = 0 - if Xsqlite3BtreeIsInReadTrans(tls, pBt) != 0 { + if Xsqlite3BtreeTxnState(tls, pBt) != SQLITE_TXN_NONE { if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 { rc = Xsqlite3PagerSnapshotCheck(tls, pPager, pSnapshot) if rc == SQLITE_OK { @@ -144040,7 +146555,7 @@ func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot ui // Recover as many snapshots as possible from the wal file associated with // schema zDb of database db. -func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:165515:16: */ +func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:168529:16: */ var rc int32 = SQLITE_ERROR var iDb int32 @@ -144048,7 +146563,7 @@ func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32 { / iDb = Xsqlite3FindDbName(tls, db, zDb) if (iDb == 0) || (iDb > 1) { var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt - if 0 == Xsqlite3BtreeIsInReadTrans(tls, pBt) { + if SQLITE_TXN_NONE == Xsqlite3BtreeTxnState(tls, pBt) { rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0)) if rc == SQLITE_OK { rc = Xsqlite3PagerSnapshotRecover(tls, Xsqlite3BtreePager(tls, pBt)) @@ -144061,7 +146576,7 @@ func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32 { / } // Free a snapshot handle obtained from sqlite3_snapshot_get(). -func Xsqlite3_snapshot_free(tls *libc.TLS, pSnapshot uintptr) { /* sqlite3.c:165546:17: */ +func Xsqlite3_snapshot_free(tls *libc.TLS, pSnapshot uintptr) { /* sqlite3.c:168560:17: */ Xsqlite3_free(tls, pSnapshot) } @@ -144070,7 +146585,7 @@ func Xsqlite3_snapshot_free(tls *libc.TLS, pSnapshot uintptr) { /* sqlite3.c:165 // // The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix // is not required for a match. -func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sqlite3.c:165559:16: */ +func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sqlite3.c:168573:16: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -144082,7 +146597,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sql azCompileOpt = Xsqlite3CompileOptions(tls, bp /* &nOpt */) - if Xsqlite3_strnicmp(tls, zOptName, ts+21695 /* "SQLITE_" */, 7) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, ts+22219 /* "SQLITE_" */, 7) == 0 { zOptName += uintptr(7) } n = Xsqlite3Strlen30(tls, zOptName) @@ -144100,7 +146615,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sql // Return the N-th compile-time option string. If N is out of range, // return a NULL pointer. -func Xsqlite3_compileoption_get(tls *libc.TLS, N int32) uintptr { /* sqlite3.c:165592:23: */ +func Xsqlite3_compileoption_get(tls *libc.TLS, N int32) uintptr { /* sqlite3.c:168606:23: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -144145,14 +146660,14 @@ func Xsqlite3_compileoption_get(tls *libc.TLS, N int32) uintptr { /* sqlite3.c:1 // for which either sqlite3.pBlockingConnection or sqlite3.pUnlockConnection // is not NULL. This variable may only accessed while the STATIC_MAIN // mutex is held. -var sqlite3BlockedList uintptr = uintptr(0) /* sqlite3.c:165644:16 */ +var sqlite3BlockedList uintptr = uintptr(0) /* sqlite3.c:168658:16 */ // Remove connection db from the blocked connections list. If connection // db is not currently a part of the list, this function is a no-op. -func removeFromBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:165687:13: */ +func removeFromBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:168701:13: */ var pp uintptr - for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 792 /* &.pNextBlocked */) { + for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 800 /* &.pNextBlocked */) { if *(*uintptr)(unsafe.Pointer(pp)) == db { *(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNextBlocked break @@ -144162,23 +146677,23 @@ func removeFromBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:165687:13: // Add connection db to the blocked connections list. It is assumed // that it is not already a part of the list. -func addToBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:165702:13: */ +func addToBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:168716:13: */ var pp uintptr - for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).FxUnlockNotify != (*Sqlite3)(unsafe.Pointer(db)).FxUnlockNotify); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 792 /* &.pNextBlocked */) { + for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).FxUnlockNotify != (*Sqlite3)(unsafe.Pointer(db)).FxUnlockNotify); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 800 /* &.pNextBlocked */) { } (*Sqlite3)(unsafe.Pointer(db)).FpNextBlocked = *(*uintptr)(unsafe.Pointer(pp)) *(*uintptr)(unsafe.Pointer(pp)) = db } // Obtain the STATIC_MAIN mutex. -func enterMutex(tls *libc.TLS) { /* sqlite3.c:165717:13: */ +func enterMutex(tls *libc.TLS) { /* sqlite3.c:168731:13: */ Xsqlite3_mutex_enter(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)) } // Release the STATIC_MAIN mutex. -func leaveMutex(tls *libc.TLS) { /* sqlite3.c:165725:13: */ +func leaveMutex(tls *libc.TLS) { /* sqlite3.c:168739:13: */ Xsqlite3_mutex_leave(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)) } @@ -144202,7 +146717,7 @@ func leaveMutex(tls *libc.TLS) { /* sqlite3.c:165725:13: */ // Each call to this routine overrides any prior callbacks registered // on the same "db". If xNotify==0 then any prior callbacks are immediately // cancelled. -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uintptr) int32 { /* sqlite3.c:165752:16: */ +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uintptr) int32 { /* sqlite3.c:168766:16: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = pArg @@ -144243,7 +146758,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uin Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr { if rc != 0 { - return ts + 21703 /* "database is dead..." */ + return ts + 22227 /* "database is dead..." */ } return uintptr(0) }(), 0) @@ -144255,7 +146770,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uin // associated with connection db. The operation will return SQLITE_LOCKED // to the user because it requires a lock that will not be available // until connection pBlocker concludes its current transaction. -func Xsqlite3ConnectionBlocked(tls *libc.TLS, db uintptr, pBlocker uintptr) { /* sqlite3.c:165802:21: */ +func Xsqlite3ConnectionBlocked(tls *libc.TLS, db uintptr, pBlocker uintptr) { /* sqlite3.c:168816:21: */ enterMutex(tls) if ((*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection == uintptr(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FpUnlockConnection == uintptr(0)) { addToBlockedList(tls, db) @@ -144281,7 +146796,7 @@ func Xsqlite3ConnectionBlocked(tls *libc.TLS, db uintptr, pBlocker uintptr) { /* // 3) If the two steps above mean that pBlockingConnection==0 and // pUnlockConnection==0, remove the entry from the blocked connections // list. -func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:165830:21: */ +func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:168844:21: */ bp := tls.Alloc(128) defer tls.Free(128) @@ -144366,7 +146881,7 @@ func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:165830 *(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3)(unsafe.Pointer(p)).FpNextBlocked (*Sqlite3)(unsafe.Pointer(p)).FpNextBlocked = uintptr(0) } else { - pp = (p + 792 /* &.pNextBlocked */) + pp = (p + 800 /* &.pNextBlocked */) } } @@ -144379,7 +146894,7 @@ func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:165830 // This is called when the database connection passed as an argument is // being closed. The connection is removed from the blocked list. -func Xsqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { /* sqlite3.c:165929:21: */ +func Xsqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { /* sqlite3.c:168943:21: */ Xsqlite3ConnectionUnlocked(tls, db) enterMutex(tls) removeFromBlockedList(tls, db) @@ -144996,7 +147511,7 @@ var jsonIsSpace = [256]int8{ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), -} /* sqlite3.c:185497:19 */ +} /* sqlite3.c:188520:19 */ // Objects type JsonString1 = struct { @@ -145008,19 +147523,19 @@ type JsonString1 = struct { FbErr U8 FzSpace [100]int8 _ [2]byte -} /* sqlite3.c:185527:9 */ +} /* sqlite3.c:188550:9 */ // Objects -type JsonString = JsonString1 /* sqlite3.c:185527:27 */ +type JsonString = JsonString1 /* sqlite3.c:188550:27 */ type JsonNode1 = struct { FeType U8 FjnFlags U8 _ [2]byte Fn U32 Fu struct{ FzJContent uintptr } -} /* sqlite3.c:185528:9 */ +} /* sqlite3.c:188551:9 */ -type JsonNode = JsonNode1 /* sqlite3.c:185528:25 */ +type JsonNode = JsonNode1 /* sqlite3.c:188551:25 */ type JsonParse1 = struct { FnNode U32 FnAlloc U32 @@ -145033,9 +147548,9 @@ type JsonParse1 = struct { FnJson int32 FiHold U32 _ [4]byte -} /* sqlite3.c:185529:9 */ +} /* sqlite3.c:188552:9 */ -type JsonParse = JsonParse1 /* sqlite3.c:185529:26 */ +type JsonParse = JsonParse1 /* sqlite3.c:188552:26 */ // JSON type values @@ -145043,8 +147558,8 @@ type JsonParse = JsonParse1 /* sqlite3.c:185529:26 */ // Names of the various JSON types: var jsonType = [8]uintptr{ - ts + 5082 /* "null" */, ts + 6493 /* "true" */, ts + 6498 /* "false" */, ts + 5092 /* "integer" */, ts + 5087 /* "real" */, ts + 12646 /* "text" */, ts + 21726 /* "array" */, ts + 21732, /* "object" */ -} /* sqlite3.c:185562:19 */ + ts + 5127 /* "null" */, ts + 5639 /* "true" */, ts + 5644 /* "false" */, ts + 5137 /* "integer" */, ts + 5132 /* "real" */, ts + 13062 /* "text" */, ts + 22250 /* "array" */, ts + 22256, /* "object" */ +} /* sqlite3.c:188585:19 */ // Maximum nesting depth of JSON for this implementation. // @@ -145058,7 +147573,7 @@ var jsonType = [8]uintptr{ // // Set the JsonString object to an empty string -func jsonZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:185622:13: */ +func jsonZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:188645:13: */ (*JsonString)(unsafe.Pointer(p)).FzBuf = p + 34 /* &.zSpace */ (*JsonString)(unsafe.Pointer(p)).FnAlloc = U64(unsafe.Sizeof([100]int8{})) (*JsonString)(unsafe.Pointer(p)).FnUsed = uint64(0) @@ -145066,7 +147581,7 @@ func jsonZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:185622:13: */ } // Initialize the JsonString object -func jsonInit(tls *libc.TLS, p uintptr, pCtx uintptr) { /* sqlite3.c:185631:13: */ +func jsonInit(tls *libc.TLS, p uintptr, pCtx uintptr) { /* sqlite3.c:188654:13: */ (*JsonString)(unsafe.Pointer(p)).FpCtx = pCtx (*JsonString)(unsafe.Pointer(p)).FbErr = U8(0) jsonZero(tls, p) @@ -145074,7 +147589,7 @@ func jsonInit(tls *libc.TLS, p uintptr, pCtx uintptr) { /* sqlite3.c:185631:13: // Free all allocated memory and reset the JsonString object back to its // initial state. -func jsonReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:185641:13: */ +func jsonReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:188664:13: */ if !(int32((*JsonString)(unsafe.Pointer(p)).FbStatic) != 0) { Xsqlite3_free(tls, (*JsonString)(unsafe.Pointer(p)).FzBuf) } @@ -145082,7 +147597,7 @@ func jsonReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:185641:13: */ } // Report an out-of-memory (OOM) condition -func jsonOom(tls *libc.TLS, p uintptr) { /* sqlite3.c:185649:13: */ +func jsonOom(tls *libc.TLS, p uintptr) { /* sqlite3.c:188672:13: */ (*JsonString)(unsafe.Pointer(p)).FbErr = U8(1) Xsqlite3_result_error_nomem(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx) jsonReset(tls, p) @@ -145090,7 +147605,7 @@ func jsonOom(tls *libc.TLS, p uintptr) { /* sqlite3.c:185649:13: */ // Enlarge pJson->zBuf so that it can hold at least N more bytes. // Return zero on success. Return non-zero on an OOM error -func jsonGrow(tls *libc.TLS, p uintptr, N U32) int32 { /* sqlite3.c:185658:12: */ +func jsonGrow(tls *libc.TLS, p uintptr, N U32) int32 { /* sqlite3.c:188681:12: */ var nTotal U64 if U64(N) < (*JsonString)(unsafe.Pointer(p)).FnAlloc { nTotal = ((*JsonString)(unsafe.Pointer(p)).FnAlloc * uint64(2)) @@ -145123,7 +147638,7 @@ func jsonGrow(tls *libc.TLS, p uintptr, N U32) int32 { /* sqlite3.c:185658:12: * } // Append N bytes from zIn onto the end of the JsonString string. -func jsonAppendRaw(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:185685:13: */ +func jsonAppendRaw(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:188708:13: */ if N == U32(0) { return } @@ -145135,7 +147650,7 @@ func jsonAppendRaw(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c: } // Append formatted text (not to exceed N bytes) to the JsonString. -func jsonPrintf(tls *libc.TLS, N int32, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:185694:13: */ +func jsonPrintf(tls *libc.TLS, N int32, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:188717:13: */ var ap Va_list _ = ap if (((*JsonString)(unsafe.Pointer(p)).FnUsed + U64(N)) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, uint32(N)) != 0) { @@ -145148,7 +147663,7 @@ func jsonPrintf(tls *libc.TLS, N int32, p uintptr, zFormat uintptr, va uintptr) } // Append a single character -func jsonAppendChar(tls *libc.TLS, p uintptr, c int8) { /* sqlite3.c:185705:13: */ +func jsonAppendChar(tls *libc.TLS, p uintptr, c int8) { /* sqlite3.c:188728:13: */ if ((*JsonString)(unsafe.Pointer(p)).FnUsed >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, uint32(1)) != 0) { return } @@ -145157,7 +147672,7 @@ func jsonAppendChar(tls *libc.TLS, p uintptr, c int8) { /* sqlite3.c:185705:13: // Append a comma separator to the output buffer, if the previous // character is not '[' or '{'. -func jsonAppendSeparator(tls *libc.TLS, p uintptr) { /* sqlite3.c:185713:13: */ +func jsonAppendSeparator(tls *libc.TLS, p uintptr) { /* sqlite3.c:188736:13: */ var c int8 if (*JsonString)(unsafe.Pointer(p)).FnUsed == uint64(0) { return @@ -145172,7 +147687,7 @@ func jsonAppendSeparator(tls *libc.TLS, p uintptr) { /* sqlite3.c:185713:13: */ // under construction. Enclose the string in "..." and escape // any double-quotes or backslash characters contained within the // string. -func jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:185725:13: */ +func jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:188748:13: */ var i U32 var c uint8 if !((((U64(N) + (*JsonString)(unsafe.Pointer(p)).FnUsed) + uint64(2)) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, (N+U32(2))) != 0)) { @@ -145223,7 +147738,7 @@ __10: *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('0') *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('0') *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = (int8('0' + (int32(c) >> 4))) - c = uint8(*(*int8)(unsafe.Pointer(ts + 21739 /* "0123456789abcdef" */ + uintptr((int32(c) & 0xf))))) + c = uint8(*(*int8)(unsafe.Pointer(ts + 22263 /* "0123456789abcdef" */ + uintptr((int32(c) & 0xf))))) __8: ; __6: @@ -145243,15 +147758,15 @@ __4: var aSpecial = [32]int8{ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8('b'), int8('t'), int8('n'), int8(0), int8('f'), int8('r'), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), -} /* sqlite3.c:185736:25 */ +} /* sqlite3.c:188759:25 */ // Append a function parameter value to the JSON string under // construction. -func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:185768:13: */ +func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:188791:13: */ switch Xsqlite3_value_type(tls, pValue) { case SQLITE_NULL: { - jsonAppendRaw(tls, p, ts+5082 /* "null" */, uint32(4)) + jsonAppendRaw(tls, p, ts+5127 /* "null" */, uint32(4)) break } @@ -145269,7 +147784,7 @@ func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:18 { var z uintptr = Xsqlite3_value_text(tls, pValue) var n U32 = U32(Xsqlite3_value_bytes(tls, pValue)) - if Xsqlite3_value_subtype(tls, pValue) == JSON_SUBTYPE { + if Xsqlite3_value_subtype(tls, pValue) == uint32(JSON_SUBTYPE) { jsonAppendRaw(tls, p, z, n) } else { jsonAppendString(tls, p, z, n) @@ -145280,7 +147795,7 @@ func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:18 default: { if int32((*JsonString)(unsafe.Pointer(p)).FbErr) == 0 { - Xsqlite3_result_error(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx, ts+21756 /* "JSON cannot hold..." */, -1) + Xsqlite3_result_error(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx, ts+22280 /* "JSON cannot hold..." */, -1) (*JsonString)(unsafe.Pointer(p)).FbErr = U8(2) jsonReset(tls, p) } @@ -145291,7 +147806,7 @@ func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:18 } // Make the JSON in p the result of the SQL function. -func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:185808:13: */ +func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:188831:13: */ if int32((*JsonString)(unsafe.Pointer(p)).FbErr) == 0 { Xsqlite3_result_text64(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx, (*JsonString)(unsafe.Pointer(p)).FzBuf, (*JsonString)(unsafe.Pointer(p)).FnUsed, func() uintptr { @@ -145300,7 +147815,7 @@ func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:185808:13: */ } return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})) }(), - SQLITE_UTF8) + uint8(SQLITE_UTF8)) jsonZero(tls, p) } @@ -145318,7 +147833,7 @@ func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:185808:13: */ // Appended elements are not counted. The value returned is the number // by which the JsonNode counter should increment in order to go to the // next peer value. -func jsonNodeSize(tls *libc.TLS, pNode uintptr) U32 { /* sqlite3.c:185831:12: */ +func jsonNodeSize(tls *libc.TLS, pNode uintptr) U32 { /* sqlite3.c:188854:12: */ if int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) >= JSON_ARRAY { return ((*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1)) } @@ -145327,7 +147842,7 @@ func jsonNodeSize(tls *libc.TLS, pNode uintptr) U32 { /* sqlite3.c:185831:12: */ // Reclaim all memory allocated by a JsonParse object. But do not // delete the JsonParse object itself. -func jsonParseReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:185839:13: */ +func jsonParseReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:188862:13: */ Xsqlite3_free(tls, (*JsonParse)(unsafe.Pointer(pParse)).FaNode) (*JsonParse)(unsafe.Pointer(pParse)).FaNode = uintptr(0) (*JsonParse)(unsafe.Pointer(pParse)).FnNode = U32(0) @@ -145337,7 +147852,7 @@ func jsonParseReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:185839:13: */ } // Free a JsonParse object that was obtained from sqlite3_malloc(). -func jsonParseFree(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:185851:13: */ +func jsonParseFree(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:188874:13: */ jsonParseReset(tls, pParse) Xsqlite3_free(tls, pParse) } @@ -145345,7 +147860,7 @@ func jsonParseFree(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:185851:13: */ // Convert the JsonNode pNode into a pure JSON string and // append to pOut. Subsubstructure is also included. Return // the number of JsonNode objects that are encoded. -func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr) { /* sqlite3.c:185861:13: */ +func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr) { /* sqlite3.c:188884:13: */ if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & (JNODE_REPLACE | JNODE_PATCH)) != 0 { if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & JNODE_REPLACE) != 0 { jsonAppendValue(tls, pOut, *(*uintptr)(unsafe.Pointer(aReplace + uintptr(*(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)))*8))) @@ -145357,19 +147872,19 @@ func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr default: { - jsonAppendRaw(tls, pOut, ts+5082 /* "null" */, uint32(4)) + jsonAppendRaw(tls, pOut, ts+5127 /* "null" */, uint32(4)) break } case JSON_TRUE: { - jsonAppendRaw(tls, pOut, ts+6493 /* "true" */, uint32(4)) + jsonAppendRaw(tls, pOut, ts+5639 /* "true" */, uint32(4)) break } case JSON_FALSE: { - jsonAppendRaw(tls, pOut, ts+6498 /* "false" */, uint32(5)) + jsonAppendRaw(tls, pOut, ts+5644 /* "false" */, uint32(5)) break } @@ -145440,7 +147955,7 @@ func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr } // Return a JsonNode and all its descendents as a JSON string. -func jsonReturnJson(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:185943:13: */ +func jsonReturnJson(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:188966:13: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -145449,20 +147964,20 @@ func jsonReturnJson(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr jsonInit(tls, bp /* &s */, pCtx) jsonRenderNode(tls, pNode, bp /* &s */, aReplace) jsonResult(tls, bp /* &s */) - Xsqlite3_result_subtype(tls, pCtx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, pCtx, uint32(JSON_SUBTYPE)) } // 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 jsonHexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:185960:11: */ +func jsonHexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:188983:11: */ h = h + (9 * (1 & (h >> 6))) return (U8(h & 0xf)) } // Convert a 4-byte hex string into an integer -func jsonHexToInt4(tls *libc.TLS, z uintptr) U32 { /* sqlite3.c:185973:12: */ +func jsonHexToInt4(tls *libc.TLS, z uintptr) U32 { /* sqlite3.c:188996:12: */ var v U32 v = (U32((((int32(jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z))))) << 12) + @@ -145473,7 +147988,7 @@ func jsonHexToInt4(tls *libc.TLS, z uintptr) U32 { /* sqlite3.c:185973:12: */ } // Make the JsonNode the return value of the function. -func jsonReturn(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:185989:13: */ +func jsonReturn(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:189012:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -145594,7 +148109,7 @@ int_as_real: __6: z1 = *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)) - Xsqlite3AtoF(tls, z1, bp /* &r */, Xsqlite3Strlen30(tls, z1), SQLITE_UTF8) + Xsqlite3AtoF(tls, z1, bp /* &r */, Xsqlite3Strlen30(tls, z1), uint8(SQLITE_UTF8)) Xsqlite3_result_double(tls, pCtx, *(*float64)(unsafe.Pointer(bp /* r */))) goto __1 @@ -145750,7 +148265,7 @@ __1: // A macro to hint to the compiler that a function should not be // inlined. -func jsonParseAddNodeExpand(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:186153:26: */ +func jsonParseAddNodeExpand(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:189176:26: */ var nNew U32 var pNew uintptr @@ -145772,7 +148287,7 @@ func jsonParseAddNodeExpand(tls *libc.TLS, pParse uintptr, eType U32, n U32, zCo // Create a new JsonNode instance based on the arguments and append that // instance to the JsonParse. Return the index in pParse->aNode[] of the // new node, or -1 if a memory allocation fails. -func jsonParseAddNode(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:186180:12: */ +func jsonParseAddNode(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:189203:12: */ var p uintptr if (*JsonParse)(unsafe.Pointer(pParse)).FnNode >= (*JsonParse)(unsafe.Pointer(pParse)).FnAlloc { return jsonParseAddNodeExpand(tls, pParse, eType, n, zContent) @@ -145786,7 +148301,7 @@ func jsonParseAddNode(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent } // Return true if z[] begins with 4 (or more) hexadecimal digits -func jsonIs4Hex(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:186201:12: */ +func jsonIs4Hex(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:189224:12: */ var i int32 for i = 0; i < 4; i++ { if !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))]) & 0x08) != 0) { @@ -145802,7 +148317,7 @@ func jsonIs4Hex(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:186201:12: */ // Return negative for a syntax error. Special cases: return -2 if the // first non-whitespace character is '}' and return -3 if the first // non-whitespace character is ']'. -func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:186215:12: */ +func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:189238:12: */ var c int8 var j U32 var iThis int32 @@ -145814,7 +148329,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } if (int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(z + uintptr(i)))))) == '{' { // Parse object - iThis = jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(0), uintptr(0)) + iThis = jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(0), uintptr(0)) if iThis < 0 { return -1 } @@ -145871,7 +148386,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 return (int32(j + U32(1))) } else if int32(c) == '[' { // Parse array - iThis = jsonParseAddNode(tls, pParse, JSON_ARRAY, uint32(0), uintptr(0)) + iThis = jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(0), uintptr(0)) if iThis < 0 { return -1 } @@ -145920,7 +148435,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 if ((((((((int32(c) == '"') || (int32(c) == '\\')) || (int32(c) == '/')) || (int32(c) == 'b')) || (int32(c) == 'f')) || (int32(c) == 'n')) || (int32(c) == 'r')) || (int32(c) == 't')) || ((int32(c) == 'u') && (jsonIs4Hex(tls, ((z+uintptr(j))+uintptr(1))) != 0)) { - jnFlags = JNODE_ESCAPE + jnFlags = U8(JNODE_ESCAPE) } else { return -1 } @@ -145929,25 +148444,25 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } j++ } - jsonParseAddNode(tls, pParse, JSON_STRING, ((j + U32(1)) - i), (z + uintptr(i))) + jsonParseAddNode(tls, pParse, uint32(JSON_STRING), ((j + U32(1)) - i), (z + uintptr(i))) if !(int32((*JsonParse)(unsafe.Pointer(pParse)).Foom) != 0) { (*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*16)).FjnFlags = jnFlags } return (int32(j + U32(1))) } else if ((int32(c) == 'n') && - (libc.Xstrncmp(tls, (z+uintptr(i)), ts+5082 /* "null" */, uint64(4)) == 0)) && + (libc.Xstrncmp(tls, (z+uintptr(i)), ts+5127 /* "null" */, uint64(4)) == 0)) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(4))))))]) & 0x06) != 0) { - jsonParseAddNode(tls, pParse, JSON_NULL, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_NULL), uint32(0), uintptr(0)) return (int32(i + U32(4))) } else if ((int32(c) == 't') && - (libc.Xstrncmp(tls, (z+uintptr(i)), ts+6493 /* "true" */, uint64(4)) == 0)) && + (libc.Xstrncmp(tls, (z+uintptr(i)), ts+5639 /* "true" */, uint64(4)) == 0)) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(4))))))]) & 0x06) != 0) { - jsonParseAddNode(tls, pParse, JSON_TRUE, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_TRUE), uint32(0), uintptr(0)) return (int32(i + U32(4))) } else if ((int32(c) == 'f') && - (libc.Xstrncmp(tls, (z+uintptr(i)), ts+6498 /* "false" */, uint64(5)) == 0)) && + (libc.Xstrncmp(tls, (z+uintptr(i)), ts+5644 /* "false" */, uint64(5)) == 0)) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(5))))))]) & 0x06) != 0) { - jsonParseAddNode(tls, pParse, JSON_FALSE, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_FALSE), uint32(0), uintptr(0)) return (int32(i + U32(5))) } else if (int32(c) == '-') || ((int32(c) >= '0') && (int32(c) <= '9')) { // Parse number @@ -146005,9 +148520,9 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } jsonParseAddNode(tls, pParse, func() uint32 { if seenDP != 0 { - return JSON_REAL + return uint32(JSON_REAL) } - return JSON_INT + return uint32(JSON_INT) }(), (j - i), (z + uintptr(i))) return int32(j) @@ -146028,7 +148543,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 // pParse. // // pParse is uninitialized when this routine is called. -func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32 { /* sqlite3.c:186375:12: */ +func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32 { /* sqlite3.c:189398:12: */ var i int32 libc.Xmemset(tls, pParse, 0, uint64(unsafe.Sizeof(JsonParse{}))) if zJson == uintptr(0) { @@ -146053,7 +148568,7 @@ func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32 if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, ts+21785 /* "malformed JSON" */, -1) + Xsqlite3_result_error(tls, pCtx, ts+22309 /* "malformed JSON" */, -1) } } jsonParseReset(tls, pParse) @@ -146064,7 +148579,7 @@ func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32 // Mark node i of pParse as being a child of iParent. Call recursively // to fill in all the descendants of node i. -func jsonParseFillInParentage(tls *libc.TLS, pParse uintptr, i U32, iParent U32) { /* sqlite3.c:186408:13: */ +func jsonParseFillInParentage(tls *libc.TLS, pParse uintptr, i U32, iParent U32) { /* sqlite3.c:189431:13: */ var pNode uintptr = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(i)*16) var j U32 *(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaUp + uintptr(i)*4)) = iParent @@ -146095,7 +148610,7 @@ func jsonParseFillInParentage(tls *libc.TLS, pParse uintptr, i U32, iParent U32) } // Compute the parentage of all nodes in a completed parse. -func jsonParseFindParents(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:186435:12: */ +func jsonParseFindParents(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:189458:12: */ var aUp uintptr aUp = libc.AssignPtrUintptr(pParse+24 /* &.aUp */, Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(U32(0)))*uint64((*JsonParse)(unsafe.Pointer(pParse)).FnNode))))) @@ -146115,7 +148630,7 @@ func jsonParseFindParents(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:18 // is no longer valid, parse the JSON again and return the new parse, // and also register the new parse so that it will be available for // future sqlite3_get_auxdata() calls. -func jsonParseCached(tls *libc.TLS, pCtx uintptr, argv uintptr, pErrCtx uintptr) uintptr { /* sqlite3.c:186461:18: */ +func jsonParseCached(tls *libc.TLS, pCtx uintptr, argv uintptr, pErrCtx uintptr) uintptr { /* sqlite3.c:189484:18: */ var zJson uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) var nJson int32 = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) var p uintptr @@ -146172,7 +148687,7 @@ func jsonParseCached(tls *libc.TLS, pCtx uintptr, argv uintptr, pErrCtx uintptr) // Compare the OBJECT label at pNode against zKey,nKey. Return true on // a match. -func jsonLabelCompare(tls *libc.TLS, pNode uintptr, zKey uintptr, nKey U32) int32 { /* sqlite3.c:186523:12: */ +func jsonLabelCompare(tls *libc.TLS, pNode uintptr, zKey uintptr, nKey U32) int32 { /* sqlite3.c:189546:12: */ if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & JNODE_RAW) != 0 { if (*JsonNode)(unsafe.Pointer(pNode)).Fn != nKey { return 0 @@ -146194,7 +148709,7 @@ func jsonLabelCompare(tls *libc.TLS, pNode uintptr, zKey uintptr, nKey U32) int3 // If pApnd!=0, then try to append new nodes to complete zPath if it is // possible to do so and if no existing node corresponds to zPath. If // new nodes are appended *pApnd is set to 1. -func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:186545:17: */ +func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:189568:17: */ var i U32 var j U32 var nKey U32 @@ -146252,8 +148767,8 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp var iStart U32 var iLabel U32 var pNode uintptr - iStart = U32(jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(2), uintptr(0))) - iLabel = U32(jsonParseAddNode(tls, pParse, JSON_STRING, nKey, zKey)) + iStart = U32(jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(2), uintptr(0))) + iLabel = U32(jsonParseAddNode(tls, pParse, uint32(JSON_STRING), nKey, zKey)) zPath += uintptr(i) pNode = jsonLookupAppend(tls, pParse, zPath, pApnd, pzErr) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { @@ -146342,7 +148857,7 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp if (i == U32(0)) && (pApnd != 0) { var iStart U32 var pNode uintptr - iStart = U32(jsonParseAddNode(tls, pParse, JSON_ARRAY, uint32(1), uintptr(0))) + iStart = U32(jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(1), uintptr(0))) pNode = jsonLookupAppend(tls, pParse, zPath, pApnd, pzErr) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return uintptr(0) @@ -146362,19 +148877,19 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp // Append content to pParse that will complete zPath. Return a pointer // to the inserted node, or return NULL if the append fails. -func jsonLookupAppend(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:186690:17: */ +func jsonLookupAppend(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:189713:17: */ *(*int32)(unsafe.Pointer(pApnd)) = 1 if int32(*(*int8)(unsafe.Pointer(zPath))) == 0 { - jsonParseAddNode(tls, pParse, JSON_NULL, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_NULL), uint32(0), uintptr(0)) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return uintptr(0) } return ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*16) } if int32(*(*int8)(unsafe.Pointer(zPath))) == '.' { - jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(0), uintptr(0)) - } else if libc.Xstrncmp(tls, zPath, ts+21800 /* "[0]" */, uint64(3)) == 0 { - jsonParseAddNode(tls, pParse, JSON_ARRAY, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(0), uintptr(0)) + } else if libc.Xstrncmp(tls, zPath, ts+22324 /* "[0]" */, uint64(3)) == 0 { + jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(0), uintptr(0)) } else { return uintptr(0) } @@ -146386,11 +148901,11 @@ func jsonLookupAppend(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintpt // Return the text of a syntax error message on a JSON path. Space is // obtained from sqlite3_malloc(). -func jsonPathSyntaxError(tls *libc.TLS, zErr uintptr) uintptr { /* sqlite3.c:186716:13: */ +func jsonPathSyntaxError(tls *libc.TLS, zErr uintptr) uintptr { /* sqlite3.c:189739:13: */ bp := tls.Alloc(8) defer tls.Free(8) - return Xsqlite3_mprintf(tls, ts+21804 /* "JSON path error ..." */, libc.VaList(bp, zErr)) + return Xsqlite3_mprintf(tls, ts+22328 /* "JSON path error ..." */, libc.VaList(bp, zErr)) } // Do a node lookup using zPath. Return a pointer to the node on success. @@ -146401,7 +148916,7 @@ func jsonPathSyntaxError(tls *libc.TLS, zErr uintptr) uintptr { /* sqlite3.c:186 // // If pApnd!=NULL then try to append missing nodes and set *pApnd = 1 if // nodes are appended. -func jsonLookup(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pCtx uintptr) uintptr { /* sqlite3.c:186730:17: */ +func jsonLookup(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pCtx uintptr) uintptr { /* sqlite3.c:189753:17: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -146453,18 +148968,18 @@ __5: // Report the wrong number of arguments for json_insert(), json_replace() // or json_set(). -func jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { /* sqlite3.c:186767:13: */ +func jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { /* sqlite3.c:189790:13: */ bp := tls.Alloc(8) defer tls.Free(8) - var zMsg uintptr = Xsqlite3_mprintf(tls, ts+21830, /* "json_%s() needs ..." */ + var zMsg uintptr = Xsqlite3_mprintf(tls, ts+22354, /* "json_%s() needs ..." */ libc.VaList(bp, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -1) Xsqlite3_free(tls, zMsg) } // Mark all NULL entries in the Object passed in as JNODE_REMOVE. -func jsonRemoveAllNulls(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:186780:13: */ +func jsonRemoveAllNulls(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:189803:13: */ var i int32 var n int32 @@ -146495,7 +149010,7 @@ func jsonRemoveAllNulls(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:186780:13: // corresponding to the SQL value input. Mostly this means putting // double-quotes around strings and returning the unquoted string "null" // when given a NULL input. -func jsonQuoteFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:186865:13: */ +func jsonQuoteFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:189888:13: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -146506,13 +149021,13 @@ func jsonQuoteFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq jsonInit(tls, bp /* &jx */, ctx) jsonAppendValue(tls, bp /* &jx */, *(*uintptr)(unsafe.Pointer(argv))) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } // Implementation of the json_array(VALUE,...) function. Return a JSON // array that contains all values given in arguments. Or if any argument // is a BLOB, throw an error. -func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:186884:13: */ +func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:189907:13: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -146527,7 +149042,7 @@ func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq } jsonAppendChar(tls, bp /* &jx */, int8(']')) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } // json_array_length(JSON) @@ -146535,7 +149050,7 @@ func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq // // Return the number of elements in the top-level JSON array. // Return 0 if the input is not a well-formed JSON array. -func jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:186911:13: */ +func jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:189934:13: */ var p uintptr // The parse var n Sqlite3_int64 = int64(0) var i U32 @@ -146570,7 +149085,7 @@ func jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { // PATH element. If there are multiple PATHs, then return a JSON array // with the result from each path. Throw an error if the JSON or any PATH // is malformed. -func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:186950:13: */ +func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:189973:13: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -146601,7 +149116,7 @@ func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* if pNode != 0 { jsonRenderNode(tls, pNode, bp /* &jx */, uintptr(0)) } else { - jsonAppendRaw(tls, bp /* &jx */, ts+5082 /* "null" */, uint32(4)) + jsonAppendRaw(tls, bp /* &jx */, ts+5127 /* "null" */, uint32(4)) } } else if pNode != 0 { jsonReturn(tls, pNode, ctx, uintptr(0)) @@ -146610,13 +149125,13 @@ func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* if (argc > 2) && (i == argc) { jsonAppendChar(tls, bp /* &jx */, int8(']')) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } jsonReset(tls, bp /* &jx */) } // This is the RFC 7396 MergePatch algorithm. -func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) uintptr { /* sqlite3.c:186991:17: */ +func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) uintptr { /* sqlite3.c:190014:17: */ var i U32 var j U32 var iRoot U32 @@ -146664,9 +149179,9 @@ func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) if (j >= (*JsonNode)(unsafe.Pointer(pTarget)).Fn) && (int32((*JsonNode)(unsafe.Pointer(pPatch+uintptr((i+U32(1)))*16)).FeType) != JSON_NULL) { var iStart int32 var iPatch int32 - iStart = jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(2), uintptr(0)) - jsonParseAddNode(tls, pParse, JSON_STRING, nKey, zKey) - iPatch = jsonParseAddNode(tls, pParse, JSON_TRUE, uint32(0), uintptr(0)) + iStart = jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(2), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_STRING), nKey, zKey) + iPatch = jsonParseAddNode(tls, pParse, uint32(JSON_TRUE), uint32(0), uintptr(0)) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return uintptr(0) } @@ -146685,7 +149200,7 @@ func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) // Implementation of the json_mergepatch(JSON1,JSON2) function. Return a JSON // object that is the result of running the RFC 7396 MergePatch() algorithm // on the two arguments. -func jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187061:13: */ +func jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190084:13: */ bp := tls.Alloc(96) defer tls.Free(96) @@ -146717,7 +149232,7 @@ func jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq // Implementation of the json_object(NAME,VALUE,...) function. Return a JSON // object that contains all name/value given in arguments. Or if any name // is not a string or if any value is a BLOB, throw an error. -func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187093:13: */ +func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190116:13: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -146729,14 +149244,14 @@ func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* s if (argc & 1) != 0 { Xsqlite3_result_error(tls, ctx, - ts+21873 /* "json_object() re..." */, -1) + ts+22397 /* "json_object() re..." */, -1) return } jsonInit(tls, bp /* &jx */, ctx) jsonAppendChar(tls, bp /* &jx */, int8('{')) for i = 0; i < argc; i = i + (2) { if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != SQLITE_TEXT { - Xsqlite3_result_error(tls, ctx, ts+21924 /* "json_object() la..." */, -1) + Xsqlite3_result_error(tls, ctx, ts+22448 /* "json_object() la..." */, -1) jsonReset(tls, bp /* &jx */) return } @@ -146749,14 +149264,14 @@ func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* s } jsonAppendChar(tls, bp /* &jx */, int8('}')) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } // json_remove(JSON, PATH, ...) // // Remove the named elements from JSON and return the result. malformed // JSON or PATH arguments result in an error. -func jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187135:13: */ +func jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190158:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -146825,7 +149340,7 @@ remove_done: // // Replace the value at PATH with VALUE. If PATH does not already exist, // this routine is a no-op. If JSON or PATH is malformed, throw an error. -func jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187168:13: */ +func jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190191:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -146844,7 +149359,7 @@ __1: if !((argc & 1) == 0) { goto __2 } - jsonWrongNumArgs(tls, ctx, ts+13159 /* "replace" */) + jsonWrongNumArgs(tls, ctx, ts+13573 /* "replace" */) return __2: ; @@ -146871,7 +149386,7 @@ __7: if !(pNode != 0) { goto __8 } - *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(JNODE_REPLACE))) + *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(U8(JNODE_REPLACE)))) *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = (i + U32(1)) __8: ; @@ -146905,7 +149420,7 @@ replace_err: // // Create PATH and initialize it to VALUE. If PATH already exists, this // routine is a no-op. If JSON or PATH is malformed, throw an error. -func jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187215:13: */ +func jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190238:13: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -146930,9 +149445,9 @@ __1: } jsonWrongNumArgs(tls, ctx, func() uintptr { if bIsSet != 0 { - return ts + 21958 /* "set" */ + return ts + 22482 /* "set" */ } - return ts + 21962 /* "insert" */ + return ts + 22486 /* "insert" */ }()) return __2: @@ -146968,7 +149483,7 @@ __9: if !((pNode != 0) && ((*(*int32)(unsafe.Pointer(bp + 48 /* bApnd */)) != 0) || (bIsSet != 0))) { goto __11 } - *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(JNODE_REPLACE))) + *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(U8(JNODE_REPLACE)))) *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = (i + U32(1)) __11: ; @@ -147001,7 +149516,7 @@ jsonSetDone: // // Return the top-level "type" of a JSON string. Throw an error if // either the JSON or PATH inputs are not well-formed. -func jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187264:13: */ +func jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190287:13: */ var p uintptr // The parse var zPath uintptr var pNode uintptr @@ -147025,7 +149540,7 @@ func jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sql // // Return 1 if JSON is a well-formed JSON string according to RFC-7159. // Return 0 otherwise. -func jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187292:13: */ +func jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190315:13: */ var p uintptr // The parse _ = argc p = jsonParseCached(tls, ctx, argv, uintptr(0)) @@ -147039,7 +149554,7 @@ func jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq // json_group_array(VALUE) // // Return a JSON array composed of all values in the aggregate. -func jsonArrayStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187312:13: */ +func jsonArrayStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190335:13: */ var pStr uintptr _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(JsonString{}))) @@ -147055,7 +149570,7 @@ func jsonArrayStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq } } -func jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:187331:13: */ +func jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:190354:13: */ var pStr uintptr pStr = Xsqlite3_aggregate_context(tls, ctx, 0) if pStr != 0 { @@ -147080,16 +149595,16 @@ func jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c: (*JsonString)(unsafe.Pointer(pStr)).FnUsed-- } } else { - Xsqlite3_result_text(tls, ctx, ts+21969 /* "[]" */, 2, uintptr(0)) + Xsqlite3_result_text(tls, ctx, ts+22493 /* "[]" */, 2, uintptr(0)) } - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } -func jsonArrayValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187353:13: */ +func jsonArrayValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:190376:13: */ jsonArrayCompute(tls, ctx, 0) } -func jsonArrayFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187356:13: */ +func jsonArrayFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:190379:13: */ jsonArrayCompute(tls, ctx, 1) } @@ -147097,7 +149612,7 @@ func jsonArrayFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187356:13: */ // It works by removing the first element of the group by searching forward // to the first comma (",") that is not within a string and deleting all // text through that comma. -func jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187367:13: */ +func jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190390:13: */ var i uint32 var inStr int32 = 0 var nNest int32 = 0 @@ -147138,7 +149653,7 @@ func jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* // json_group_obj(NAME,VALUE) // // Return a JSON object composed of all names and values in the aggregate. -func jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187414:13: */ +func jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190437:13: */ var pStr uintptr var z uintptr var n U32 @@ -147160,7 +149675,7 @@ func jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* s } } -func jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:187439:13: */ +func jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:190462:13: */ var pStr uintptr pStr = Xsqlite3_aggregate_context(tls, ctx, 0) if pStr != 0 { @@ -147184,16 +149699,16 @@ func jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c (*JsonString)(unsafe.Pointer(pStr)).FnUsed-- } } else { - Xsqlite3_result_text(tls, ctx, ts+21972 /* "{}" */, 2, uintptr(0)) + Xsqlite3_result_text(tls, ctx, ts+22496 /* "{}" */, 2, uintptr(0)) } - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } -func jsonObjectValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187460:13: */ +func jsonObjectValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:190483:13: */ jsonObjectCompute(tls, ctx, 0) } -func jsonObjectFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187463:13: */ +func jsonObjectFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:190486:13: */ jsonObjectCompute(tls, ctx, 1) } @@ -147213,16 +149728,16 @@ type JsonEachCursor1 = struct { FzJson uintptr FzRoot uintptr FsParse JsonParse -} /* sqlite3.c:187473:9 */ +} /* sqlite3.c:190496:9 */ // *************************************************************************** // // The json_each virtual table // -type JsonEachCursor = JsonEachCursor1 /* sqlite3.c:187473:31 */ +type JsonEachCursor = JsonEachCursor1 /* sqlite3.c:190496:31 */ // Constructor for the json_each virtual table -func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:187488:12: */ +func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:190511:12: */ var pNew uintptr var rc int32 @@ -147237,7 +149752,7 @@ func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv u _ = pAux rc = Xsqlite3_declare_vtab(tls, db, - ts+21975 /* "CREATE TABLE x(k..." */) + ts+22499 /* "CREATE TABLE x(k..." */) if rc == SQLITE_OK { pNew = libc.AssignPtrUintptr(ppVtab, Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Sqlite3_vtab{})))) if pNew == uintptr(0) { @@ -147250,13 +149765,13 @@ func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv u } // destructor for json_each virtual table -func jsonEachDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:187530:12: */ +func jsonEachDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:190553:12: */ Xsqlite3_free(tls, pVtab) return SQLITE_OK } // constructor for a JsonEachCursor object for json_each(). -func jsonEachOpenEach(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:187536:12: */ +func jsonEachOpenEach(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:190559:12: */ var pCur uintptr _ = p @@ -147270,7 +149785,7 @@ func jsonEachOpenEach(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sql } // constructor for a JsonEachCursor object for json_tree(). -func jsonEachOpenTree(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:187548:12: */ +func jsonEachOpenTree(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:190571:12: */ var rc int32 = jsonEachOpenEach(tls, p, ppCursor) if rc == SQLITE_OK { var pCur uintptr = *(*uintptr)(unsafe.Pointer(ppCursor)) @@ -147281,7 +149796,7 @@ func jsonEachOpenTree(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sql // Reset a JsonEachCursor back to its original state. Free any memory // held. -func jsonEachCursorReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:187559:13: */ +func jsonEachCursorReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:190582:13: */ Xsqlite3_free(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzJson) Xsqlite3_free(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot) jsonParseReset(tls, (p + 48 /* &.sParse */)) @@ -147294,7 +149809,7 @@ func jsonEachCursorReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:187559:13: */ } // Destructor for a jsonEachCursor object -func jsonEachClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:187572:12: */ +func jsonEachClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:190595:12: */ var p uintptr = cur jsonEachCursorReset(tls, p) Xsqlite3_free(tls, cur) @@ -147303,13 +149818,13 @@ func jsonEachClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:187572:12: * // Return TRUE if the jsonEachCursor object has been advanced off the end // of the JSON object -func jsonEachEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:187581:12: */ +func jsonEachEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:190604:12: */ var p uintptr = cur return (libc.Bool32((*JsonEachCursor)(unsafe.Pointer(p)).Fi >= (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd)) } // Advance the cursor to the next element for json_tree() -func jsonEachNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:187587:12: */ +func jsonEachNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:190610:12: */ var p uintptr = cur if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 { if (int32((*JsonNode)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*16)).FjnFlags) & JNODE_LABEL) != 0 { @@ -147359,7 +149874,7 @@ func jsonEachNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:187587:12: */ } // Append the name of the path for element i to pStr -func jsonEachComputePath(tls *libc.TLS, p uintptr, pStr uintptr, i U32) { /* sqlite3.c:187628:13: */ +func jsonEachComputePath(tls *libc.TLS, p uintptr, pStr uintptr, i U32) { /* sqlite3.c:190651:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -147375,19 +149890,19 @@ func jsonEachComputePath(tls *libc.TLS, p uintptr, pStr uintptr, i U32) { /* sql pNode = ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(i)*16) pUp = ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(iUp)*16) if int32((*JsonNode)(unsafe.Pointer(pUp)).FeType) == JSON_ARRAY { - jsonPrintf(tls, 30, pStr, ts+22058 /* "[%d]" */, libc.VaList(bp, *(*U32)(unsafe.Pointer(pUp + 8 /* &.u */)))) + jsonPrintf(tls, 30, pStr, ts+22582 /* "[%d]" */, libc.VaList(bp, *(*U32)(unsafe.Pointer(pUp + 8 /* &.u */)))) } else { if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & JNODE_LABEL) == 0 { pNode -= 16 } - jsonPrintf(tls, (int32((*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1))), pStr, ts+22063 /* ".%.*s" */, libc.VaList(bp+8, ((*JsonNode)(unsafe.Pointer(pNode)).Fn-U32(2)), (*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))+uintptr(1)))) + jsonPrintf(tls, (int32((*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1))), pStr, ts+22587 /* ".%.*s" */, libc.VaList(bp+8, ((*JsonNode)(unsafe.Pointer(pNode)).Fn-U32(2)), (*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))+uintptr(1)))) } } // Return the value of a column -func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:187655:12: */ +func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:190678:12: */ bp := tls.Alloc(296) defer tls.Free(296) @@ -147475,9 +149990,9 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* jsonAppendChar(tls, bp+24 /* &x */, int8('$')) } if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == JSON_ARRAY { - jsonPrintf(tls, 30, bp+24 /* &x */, ts+22058 /* "[%d]" */, libc.VaList(bp, (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid)) + jsonPrintf(tls, 30, bp+24 /* &x */, ts+22582 /* "[%d]" */, libc.VaList(bp, (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid)) } else if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == JSON_OBJECT { - jsonPrintf(tls, int32((*JsonNode)(unsafe.Pointer(pThis)).Fn), bp+24 /* &x */, ts+22063 /* ".%.*s" */, libc.VaList(bp+8, ((*JsonNode)(unsafe.Pointer(pThis)).Fn-U32(2)), (*(*uintptr)(unsafe.Pointer(pThis + 8 /* &.u */))+uintptr(1)))) + jsonPrintf(tls, int32((*JsonNode)(unsafe.Pointer(pThis)).Fn), bp+24 /* &x */, ts+22587 /* ".%.*s" */, libc.VaList(bp+8, ((*JsonNode)(unsafe.Pointer(pThis)).Fn-U32(2)), (*(*uintptr)(unsafe.Pointer(pThis + 8 /* &.u */))+uintptr(1)))) } } jsonResult(tls, bp+24 /* &x */) @@ -147501,7 +150016,7 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* { var zRoot uintptr = (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot if zRoot == uintptr(0) { - zRoot = ts + 22069 /* "$" */ + zRoot = ts + 22593 /* "$" */ } Xsqlite3_result_text(tls, ctx, zRoot, -1, uintptr(0)) break @@ -147519,7 +150034,7 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* } // Return the current rowid value -func jsonEachRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:187754:12: */ +func jsonEachRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:190777:12: */ var p uintptr = cur *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = Sqlite_int64((*JsonEachCursor)(unsafe.Pointer(p)).FiRowid) return SQLITE_OK @@ -147529,7 +150044,7 @@ func jsonEachRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite // column. Without such a constraint, the table cannot operate. idxNum is // 1 if the constraint is found, 3 if the constraint and zRoot are found, // and 0 otherwise. -func jsonEachBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:187765:12: */ +func jsonEachBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:190788:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -147604,7 +150119,7 @@ __3: } // Start a search on a new JSON string -func jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:187823:12: */ +func jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:190846:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -147633,7 +150148,7 @@ func jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, ar var rc int32 = SQLITE_NOMEM if int32((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.Foom) == 0 { Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+21785 /* "malformed JSON" */, 0) + (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+22309 /* "malformed JSON" */, 0) if (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { rc = SQLITE_ERROR } @@ -147708,7 +150223,7 @@ var jsonEachModule = Sqlite3_module{ // xCreate FxEof: 0, // xEof - check for end of scan FxColumn: 0, // xColumn - read data FxRowid: 0, // xShadowName -} /* sqlite3.c:187902:23 */ +} /* sqlite3.c:190925:23 */ // The methods of the json_tree virtual table. var jsonTreeModule = Sqlite3_module{ // xCreate @@ -147722,7 +150237,7 @@ var jsonTreeModule = Sqlite3_module{ // xCreate FxEof: 0, // xEof - check for end of scan FxColumn: 0, // xColumn - read data FxRowid: 0, // xShadowName -} /* sqlite3.c:187930:23 */ +} /* sqlite3.c:190953:23 */ // *************************************************************************** // @@ -147731,7 +150246,7 @@ var jsonTreeModule = Sqlite3_module{ // xCreate // functions and the virtual table implemented by this file. // -func Xsqlite3Json1Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:187964:20: */ +func Xsqlite3Json1Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:190987:20: */ var rc int32 = SQLITE_OK var i uint32 for i = uint32(0); (uint64(i) < (uint64(unsafe.Sizeof(aFunc)) / uint64(unsafe.Sizeof(struct { @@ -147774,22 +150289,22 @@ var aFunc = [15]struct { Fflag int32 FxFunc uintptr }{ - {FzName: ts + 22071 /* "json" */, FnArg: 1, FxFunc: 0}, - {FzName: ts + 22076 /* "json_array" */, FnArg: -1, FxFunc: 0}, - {FzName: ts + 22087 /* "json_array_lengt..." */, FnArg: 1, FxFunc: 0}, - {FzName: ts + 22087 /* "json_array_lengt..." */, FnArg: 2, FxFunc: 0}, - {FzName: ts + 22105 /* "json_extract" */, FnArg: -1, FxFunc: 0}, - {FzName: ts + 22118 /* "json_insert" */, FnArg: -1, FxFunc: 0}, - {FzName: ts + 22130 /* "json_object" */, FnArg: -1, FxFunc: 0}, - {FzName: ts + 22142 /* "json_patch" */, FnArg: 2, FxFunc: 0}, - {FzName: ts + 22153 /* "json_quote" */, FnArg: 1, FxFunc: 0}, - {FzName: ts + 22164 /* "json_remove" */, FnArg: -1, FxFunc: 0}, - {FzName: ts + 22176 /* "json_replace" */, FnArg: -1, FxFunc: 0}, - {FzName: ts + 22189 /* "json_set" */, FnArg: -1, Fflag: 1, FxFunc: 0}, - {FzName: ts + 22198 /* "json_type" */, FnArg: 1, FxFunc: 0}, - {FzName: ts + 22198 /* "json_type" */, FnArg: 2, FxFunc: 0}, - {FzName: ts + 22208 /* "json_valid" */, FnArg: 1, FxFunc: 0}, -} /* sqlite3.c:187972:5 */ + {FzName: ts + 22595 /* "json" */, FnArg: 1, FxFunc: 0}, + {FzName: ts + 22600 /* "json_array" */, FnArg: -1, FxFunc: 0}, + {FzName: ts + 22611 /* "json_array_lengt..." */, FnArg: 1, FxFunc: 0}, + {FzName: ts + 22611 /* "json_array_lengt..." */, FnArg: 2, FxFunc: 0}, + {FzName: ts + 22629 /* "json_extract" */, FnArg: -1, FxFunc: 0}, + {FzName: ts + 22642 /* "json_insert" */, FnArg: -1, FxFunc: 0}, + {FzName: ts + 22654 /* "json_object" */, FnArg: -1, FxFunc: 0}, + {FzName: ts + 22666 /* "json_patch" */, FnArg: 2, FxFunc: 0}, + {FzName: ts + 22677 /* "json_quote" */, FnArg: 1, FxFunc: 0}, + {FzName: ts + 22688 /* "json_remove" */, FnArg: -1, FxFunc: 0}, + {FzName: ts + 22700 /* "json_replace" */, FnArg: -1, FxFunc: 0}, + {FzName: ts + 22713 /* "json_set" */, FnArg: -1, Fflag: 1, FxFunc: 0}, + {FzName: ts + 22722 /* "json_type" */, FnArg: 1, FxFunc: 0}, + {FzName: ts + 22722 /* "json_type" */, FnArg: 2, FxFunc: 0}, + {FzName: ts + 22732 /* "json_valid" */, FnArg: 1, FxFunc: 0}, +} /* sqlite3.c:190995:5 */ var aAgg = [2]struct { FzName uintptr FnArg int32 @@ -147798,19 +150313,19 @@ var aAgg = [2]struct { FxFinal uintptr FxValue uintptr }{ - {FzName: ts + 22219 /* "json_group_array" */, FnArg: 1, + {FzName: ts + 22743 /* "json_group_array" */, FnArg: 1, FxStep: 0, FxFinal: 0, FxValue: 0}, - {FzName: ts + 22236 /* "json_group_objec..." */, FnArg: 2, + {FzName: ts + 22760 /* "json_group_objec..." */, FnArg: 2, FxStep: 0, FxFinal: 0, FxValue: 0}, -} /* sqlite3.c:188001:5 */ +} /* sqlite3.c:191024:5 */ var aMod = [2]struct { FzName uintptr FpModule uintptr }{ - {FzName: ts + 22254 /* "json_each" */, FpModule: 0}, - {FzName: ts + 22264 /* "json_tree" */, FpModule: 0}, -} /* sqlite3.c:188011:5 */ -var enc int32 = ((SQLITE_UTF8 | SQLITE_DETERMINISTIC) | SQLITE_INNOCUOUS) /* sqlite3.c:188016:20 */ // In the SQLite core + {FzName: ts + 22778 /* "json_each" */, FpModule: 0}, + {FzName: ts + 22788 /* "json_tree" */, FpModule: 0}, +} /* sqlite3.c:191034:5 */ +var enc int32 = ((SQLITE_UTF8 | SQLITE_DETERMINISTIC) | SQLITE_INNOCUOUS) /* sqlite3.c:191039:20 */ // In the SQLite core // #include // #include @@ -147854,7 +150369,7 @@ type Rtree1 = struct { FpDeleteParent uintptr FpWriteAux uintptr FaHash [97]uintptr -} /* sqlite3.c:188152:9 */ +} /* sqlite3.c:191175:9 */ // In the SQLite core @@ -147865,7 +150380,7 @@ type Rtree1 = struct { // The following macro is used to suppress compiler warnings. -type Rtree = Rtree1 /* sqlite3.c:188152:22 */ +type Rtree = Rtree1 /* sqlite3.c:191175:22 */ type RtreeCursor1 = struct { Fbase Sqlite3_vtab_cursor FatEOF U8 @@ -147886,9 +150401,9 @@ type RtreeCursor1 = struct { FaNode [5]uintptr FanQueue [41]U32 _ [4]byte -} /* sqlite3.c:188153:9 */ +} /* sqlite3.c:191176:9 */ -type RtreeCursor = RtreeCursor1 /* sqlite3.c:188153:28 */ +type RtreeCursor = RtreeCursor1 /* sqlite3.c:191176:28 */ type RtreeNode1 = struct { FpParent uintptr FiNode I64 @@ -147896,23 +150411,23 @@ type RtreeNode1 = struct { FisDirty int32 FzData uintptr FpNext uintptr -} /* sqlite3.c:188152:9 */ +} /* sqlite3.c:191175:9 */ -type RtreeNode = RtreeNode1 /* sqlite3.c:188154:26 */ +type RtreeNode = RtreeNode1 /* sqlite3.c:191177:26 */ type RtreeCell1 = struct { FiRowid I64 FaCoord [10]RtreeCoord -} /* sqlite3.c:188155:9 */ +} /* sqlite3.c:191178:9 */ -type RtreeCell = RtreeCell1 /* sqlite3.c:188155:26 */ +type RtreeCell = RtreeCell1 /* sqlite3.c:191178:26 */ type RtreeConstraint1 = struct { FiCoord int32 Fop int32 Fu struct{ FrValue RtreeDValue } FpInfo uintptr -} /* sqlite3.c:188153:9 */ +} /* sqlite3.c:191176:9 */ -type RtreeConstraint = RtreeConstraint1 /* sqlite3.c:188156:32 */ +type RtreeConstraint = RtreeConstraint1 /* sqlite3.c:191179:32 */ type RtreeMatchArg1 = struct { FiSize U32 _ [4]byte @@ -147921,20 +150436,20 @@ type RtreeMatchArg1 = struct { _ [4]byte FapSqlParam uintptr FaParam [1]RtreeDValue -} /* sqlite3.c:188157:9 */ +} /* sqlite3.c:191180:9 */ -type RtreeMatchArg = RtreeMatchArg1 /* sqlite3.c:188157:30 */ +type RtreeMatchArg = RtreeMatchArg1 /* sqlite3.c:191180:30 */ type RtreeGeomCallback1 = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr -} /* sqlite3.c:188157:9 */ +} /* sqlite3.c:191180:9 */ -type RtreeGeomCallback = RtreeGeomCallback1 /* sqlite3.c:188158:34 */ -type RtreeCoord1 = struct{ Ff RtreeValue } /* sqlite3.c:188155:9 */ +type RtreeGeomCallback = RtreeGeomCallback1 /* sqlite3.c:191181:34 */ +type RtreeCoord1 = struct{ Ff RtreeValue } /* sqlite3.c:191178:9 */ -type RtreeCoord = RtreeCoord1 /* sqlite3.c:188159:26 */ +type RtreeCoord = RtreeCoord1 /* sqlite3.c:191182:26 */ type RtreeSearchPoint1 = struct { FrScore RtreeDValue Fid Sqlite3_int64 @@ -147942,17 +150457,17 @@ type RtreeSearchPoint1 = struct { FeWithin U8 FiCell U8 _ [5]byte -} /* sqlite3.c:188153:9 */ +} /* sqlite3.c:191176:9 */ -type RtreeSearchPoint = RtreeSearchPoint1 /* sqlite3.c:188160:33 */ +type RtreeSearchPoint = RtreeSearchPoint1 /* sqlite3.c:191183:33 */ // Possible values for Rtree.eCoordType: // If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will // only deal with integer coordinates. No floating point operations // will be done. -type RtreeDValue = float64 /* sqlite3.c:188255:18 */ // High accuracy coordinate -type RtreeValue = float32 /* sqlite3.c:188256:17 */ +type RtreeDValue = float64 /* sqlite3.c:191278:18 */ // High accuracy coordinate +type RtreeValue = float32 /* sqlite3.c:191279:17 */ // What version of GCC is being used. 0 means GCC is not being used . // Note that the GCC_VERSION macro will also be set correctly when using @@ -147978,16 +150493,16 @@ type RtreeValue = float32 /* sqlite3.c:188256:17 */ // Functions to deserialize a 16 bit integer, 32 bit real number and // 64 bit integer. The deserialized value is returned. -func readInt16(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:188535:12: */ +func readInt16(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:191558:12: */ return ((int32(*(*U8)(unsafe.Pointer(p))) << 8) + int32(*(*U8)(unsafe.Pointer(p + 1)))) } -func readCoord(tls *libc.TLS, p uintptr, pCoord uintptr) { /* sqlite3.c:188538:13: */ +func readCoord(tls *libc.TLS, p uintptr, pCoord uintptr) { /* sqlite3.c:191561:13: */ // p is always 4-byte aligned (*(*U32)(unsafe.Pointer(pCoord /* .Fu */))) = libc.X__builtin_bswap32(tls, *(*U32)(unsafe.Pointer(p))) } -func readInt64(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:188555:12: */ +func readInt64(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:191578:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -148000,12 +150515,12 @@ func readInt64(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:188555:12: */ // Functions to serialize a 16 bit integer, 32 bit real number and // 64 bit integer. The value returned is the number of bytes written // to the argument buffer (always 2, 4 and 8 respectively). -func writeInt16(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:188587:13: */ +func writeInt16(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:191610:13: */ *(*U8)(unsafe.Pointer(p)) = (U8((i >> 8) & 0xFF)) *(*U8)(unsafe.Pointer(p + 1)) = (U8((i >> 0) & 0xFF)) } -func writeCoord(tls *libc.TLS, p uintptr, pCoord uintptr) int32 { /* sqlite3.c:188591:12: */ +func writeCoord(tls *libc.TLS, p uintptr, pCoord uintptr) int32 { /* sqlite3.c:191614:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -148018,7 +150533,7 @@ func writeCoord(tls *libc.TLS, p uintptr, pCoord uintptr) int32 { /* sqlite3.c:1 return 4 } -func writeInt64(tls *libc.TLS, p uintptr, i I64) int32 { /* sqlite3.c:188614:12: */ +func writeInt64(tls *libc.TLS, p uintptr, i I64) int32 { /* sqlite3.c:191637:12: */ bp := tls.Alloc(8) defer tls.Free(8) *(*I64)(unsafe.Pointer(bp)) = i @@ -148029,7 +150544,7 @@ func writeInt64(tls *libc.TLS, p uintptr, i I64) int32 { /* sqlite3.c:188614:12: } // Increment the reference count of node p. -func nodeReference(tls *libc.TLS, p uintptr) { /* sqlite3.c:188639:13: */ +func nodeReference(tls *libc.TLS, p uintptr) { /* sqlite3.c:191662:13: */ if p != 0 { (*RtreeNode)(unsafe.Pointer(p)).FnRef++ @@ -148037,20 +150552,20 @@ func nodeReference(tls *libc.TLS, p uintptr) { /* sqlite3.c:188639:13: */ } // Clear the content of node p (set all bytes to 0x00). -func nodeZero(tls *libc.TLS, pRtree uintptr, p uintptr) { /* sqlite3.c:188649:13: */ +func nodeZero(tls *libc.TLS, pRtree uintptr, p uintptr) { /* sqlite3.c:191672:13: */ libc.Xmemset(tls, ((*RtreeNode)(unsafe.Pointer(p)).FzData + 2), 0, (uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize - 2))) (*RtreeNode)(unsafe.Pointer(p)).FisDirty = 1 } // Given a node number iNode, return the corresponding key to use // in the Rtree.aHash table. -func nodeHash(tls *libc.TLS, iNode I64) uint32 { /* sqlite3.c:188658:21: */ - return ((uint32(iNode)) % HASHSIZE) +func nodeHash(tls *libc.TLS, iNode I64) uint32 { /* sqlite3.c:191681:21: */ + return ((uint32(iNode)) % uint32(HASHSIZE)) } // Search the node hash table for node iNode. If found, return a pointer // to it. Otherwise, return 0. -func nodeHashLookup(tls *libc.TLS, pRtree uintptr, iNode I64) uintptr { /* sqlite3.c:188666:18: */ +func nodeHashLookup(tls *libc.TLS, pRtree uintptr, iNode I64) uintptr { /* sqlite3.c:191689:18: */ var p uintptr for p = *(*uintptr)(unsafe.Pointer((pRtree + 192 /* &.aHash */) + uintptr(nodeHash(tls, iNode))*8)); (p != 0) && ((*RtreeNode)(unsafe.Pointer(p)).FiNode != iNode); p = (*RtreeNode)(unsafe.Pointer(p)).FpNext { } @@ -148058,7 +150573,7 @@ func nodeHashLookup(tls *libc.TLS, pRtree uintptr, iNode I64) uintptr { /* sqlit } // Add node pNode to the node hash table. -func nodeHashInsert(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:188675:13: */ +func nodeHashInsert(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:191698:13: */ var iHash int32 iHash = int32(nodeHash(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)) @@ -148067,7 +150582,7 @@ func nodeHashInsert(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c } // Remove node pNode from the node hash table. -func nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:188686:13: */ +func nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:191709:13: */ var pp uintptr if (*RtreeNode)(unsafe.Pointer(pNode)).FiNode != int64(0) { pp = ((pRtree + 192 /* &.aHash */) + uintptr(nodeHash(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode))*8) @@ -148082,7 +150597,7 @@ func nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c // indicating that node has not yet been assigned a node number. It is // assigned a node number when nodeWrite() is called to write the // node contents out to the database. -func nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) uintptr { /* sqlite3.c:188702:18: */ +func nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) uintptr { /* sqlite3.c:191725:18: */ var pNode uintptr pNode = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(RtreeNode{})) + uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize)))) if pNode != 0 { @@ -148098,7 +150613,7 @@ func nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) uintptr { /* sqlite } // Clear the Rtree.pNodeBlob object -func nodeBlobReset(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:188720:13: */ +func nodeBlobReset(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:191743:13: */ if (((*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob != 0) && (int32((*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans) == 0)) && ((*Rtree)(unsafe.Pointer(pRtree)).FnCursor == U32(0)) { var pBlob uintptr = (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob = uintptr(0) @@ -148108,7 +150623,7 @@ func nodeBlobReset(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:188720:13: */ // Check to see if pNode is the same as pParent or any of the parents // of pParent. -func nodeInParentChain(tls *libc.TLS, pNode uintptr, pParent uintptr) int32 { /* sqlite3.c:188732:12: */ +func nodeInParentChain(tls *libc.TLS, pNode uintptr, pParent uintptr) int32 { /* sqlite3.c:191755:12: */ for ok := true; ok; ok = pParent != 0 { if pNode == pParent { return 1 @@ -148119,7 +150634,7 @@ func nodeInParentChain(tls *libc.TLS, pNode uintptr, pParent uintptr) int32 { /* } // Obtain a reference to an r-tree node. -func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNode uintptr) int32 { /* sqlite3.c:188743:12: */ +func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNode uintptr) int32 { /* sqlite3.c:191766:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -148158,11 +150673,11 @@ func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNo } } if (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - var zTab uintptr = Xsqlite3_mprintf(tls, ts+22274 /* "%s_node" */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) + var zTab uintptr = Xsqlite3_mprintf(tls, ts+22798 /* "%s_node" */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) if zTab == uintptr(0) { return SQLITE_NOMEM } - rc = Xsqlite3_blob_open(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, zTab, ts+22282 /* "data" */, iNode, 0, + rc = Xsqlite3_blob_open(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, zTab, ts+22806 /* "data" */, iNode, 0, (pRtree + 112 /* &.pNodeBlob */)) Xsqlite3_free(tls, zTab) } @@ -148197,7 +150712,7 @@ func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNo // the root node. A height of one means the children of the root node // are the leaves, and so on. If the depth as specified on the root node // is greater than RTREE_MAX_DEPTH, the r-tree structure must be corrupt. - if (pNode != 0) && (iNode == int64(1)) { + if ((pNode != 0) && (rc == SQLITE_OK)) && (iNode == int64(1)) { (*Rtree)(unsafe.Pointer(pRtree)).FiDepth = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData) if (*Rtree)(unsafe.Pointer(pRtree)).FiDepth > RTREE_MAX_DEPTH { rc = (SQLITE_CORRUPT | (int32(1) << 8)) @@ -148236,7 +150751,7 @@ func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNo } // Overwrite cell iCell of node pNode with the contents of pCell. -func nodeOverwriteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iCell int32) { /* sqlite3.c:188863:13: */ +func nodeOverwriteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iCell int32) { /* sqlite3.c:191886:13: */ var ii int32 var p uintptr = ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell)))) p += uintptr(writeInt64(tls, p, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid)) @@ -148247,7 +150762,7 @@ func nodeOverwriteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintp } // Remove the cell with index iCell from node pNode. -func nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) { /* sqlite3.c:188881:13: */ +func nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) { /* sqlite3.c:191904:13: */ var pDst uintptr = ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell)))) var pSrc uintptr = (pDst + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)) var nByte int32 = (((readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+2)) - iCell) - 1) * int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)) @@ -148260,7 +150775,7 @@ func nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) { // is successful, return SQLITE_OK. // // If there is not enough free space in pNode, return SQLITE_FULL. -func nodeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:188896:12: */ +func nodeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:191919:12: */ var nCell int32 // Current number of cells in pNode var nMaxCell int32 // Maximum number of cells for pNode @@ -148277,7 +150792,7 @@ func nodeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) } // If the node is dirty, write it out to the database. -func nodeWrite(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:188920:12: */ +func nodeWrite(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:191943:12: */ var rc int32 = SQLITE_OK if (*RtreeNode)(unsafe.Pointer(pNode)).FisDirty != 0 { var p uintptr = (*Rtree)(unsafe.Pointer(pRtree)).FpWriteNode @@ -148301,7 +150816,7 @@ func nodeWrite(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3. // Release a reference to a node. If the node is dirty and the reference // count drops to zero, the node data is written to the database. -func nodeRelease(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:188946:12: */ +func nodeRelease(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:191969:12: */ var rc int32 = SQLITE_OK if pNode != 0 { @@ -148327,19 +150842,19 @@ func nodeRelease(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite // Return the 64-bit integer value associated with cell iCell of // node pNode. If pNode is a leaf node, this is a rowid. If it is // an internal node, then the 64-bit integer is a child page number. -func nodeGetRowid(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) I64 { /* sqlite3.c:188975:12: */ +func nodeGetRowid(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) I64 { /* sqlite3.c:191998:12: */ return readInt64(tls, ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell))))) } // Return coordinate iCoord from cell iCell in node pNode. -func nodeGetCoord(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iCoord int32, pCoord uintptr) { /* sqlite3.c:188987:13: */ +func nodeGetCoord(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iCoord int32, pCoord uintptr) { /* sqlite3.c:192010:13: */ readCoord(tls, ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(((12 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell)) + (4 * iCoord)))), pCoord) } // Deserialize cell iCell of node pNode. Populate the structure pointed // to by pCell with the results. -func nodeGetCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, pCell uintptr) { /* sqlite3.c:189001:13: */ +func nodeGetCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, pCell uintptr) { /* sqlite3.c:192024:13: */ var pData uintptr var pCoord uintptr var ii int32 = 0 @@ -148355,23 +150870,23 @@ func nodeGetCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, pCel } // Rtree virtual table module xCreate method. -func rtreeCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:189032:12: */ +func rtreeCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:192055:12: */ return rtreeInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 1) } // Rtree virtual table module xConnect method. -func rtreeConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:189045:12: */ +func rtreeConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:192068:12: */ return rtreeInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 0) } // Increment the r-tree reference count. -func rtreeReference(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:189058:13: */ +func rtreeReference(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:192081:13: */ (*Rtree)(unsafe.Pointer(pRtree)).FnBusy++ } // Decrement the r-tree reference count. When the reference count reaches // zero the structure is deleted. -func rtreeRelease(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:189066:13: */ +func rtreeRelease(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:192089:13: */ (*Rtree)(unsafe.Pointer(pRtree)).FnBusy-- if (*Rtree)(unsafe.Pointer(pRtree)).FnBusy == U32(0) { (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = U8(0) @@ -148393,13 +150908,13 @@ func rtreeRelease(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:189066:13: */ } // Rtree virtual table module xDisconnect method. -func rtreeDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:189090:12: */ +func rtreeDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:192113:12: */ rtreeRelease(tls, pVtab) return SQLITE_OK } // Rtree virtual table module xDestroy method. -func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:189098:12: */ +func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:192121:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -148407,7 +150922,7 @@ func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:189098:12: var rc int32 var zCreate uintptr = Xsqlite3_mprintf(tls, - ts+22287, /* "DROP TABLE '%q'...." */ + ts+22811, /* "DROP TABLE '%q'...." */ libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) @@ -148426,7 +150941,7 @@ func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:189098:12: } // Rtree virtual table module xOpen method. -func rtreeOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:189126:12: */ +func rtreeOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:192149:12: */ var rc int32 = SQLITE_NOMEM var pRtree uintptr = pVTab var pCsr uintptr @@ -148444,7 +150959,7 @@ func rtreeOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite } // Reset a cursor back to its initial state. -func resetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:189147:13: */ +func resetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:192170:13: */ var pRtree uintptr = (*RtreeCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab var ii int32 var pStmt uintptr @@ -148474,7 +150989,7 @@ func resetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:189147:13: */ } // Rtree virtual table module xClose method. -func rtreeClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:189175:12: */ +func rtreeClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:192198:12: */ var pRtree uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab var pCsr uintptr = cur @@ -148490,7 +151005,7 @@ func rtreeClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:189175:12: */ // // Return non-zero if the cursor does not currently point to a valid // record (i.e if the scan has finished), or zero otherwise. -func rtreeEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:189193:12: */ +func rtreeEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:192216:12: */ var pCsr uintptr = cur return int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FatEOF) } @@ -148507,7 +151022,7 @@ func rtreeEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:189193:12: */ // Check the RTree node or entry given by pCellData and p against the MATCH // constraint pConstraint. -func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCellData uintptr, pSearch uintptr, prScore uintptr, peWithin uintptr) int32 { /* sqlite3.c:189248:12: */ +func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCellData uintptr, pSearch uintptr, prScore uintptr, peWithin uintptr) int32 { /* sqlite3.c:192271:12: */ bp := tls.Alloc(92) defer tls.Free(92) @@ -148615,7 +151130,7 @@ func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCe // Check the internal RTree node given by pCellData against constraint p. // If this constraint cannot be satisfied by any child within the node, // set *peWithin to NOT_WITHIN. -func rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:189324:13: */ +func rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:192347:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -148686,7 +151201,7 @@ func rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uint // // The op is given by p->op. The xN is p->iCoord-th coordinate in // pCellData. $val is given by p->u.rValue. -func rtreeLeafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:189372:13: */ +func rtreeLeafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:192395:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -148741,7 +151256,7 @@ func rtreeLeafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr // One of the cells in node pNode is guaranteed to have a 64-bit // integer value equal to iRowid. Return the index of this cell. -func nodeRowidIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, iRowid I64, piIndex uintptr) int32 { /* sqlite3.c:189402:12: */ +func nodeRowidIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, iRowid I64, piIndex uintptr) int32 { /* sqlite3.c:192425:12: */ var ii int32 var nCell int32 = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + 2)) @@ -148757,7 +151272,7 @@ func nodeRowidIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, iRowid I64, pi // Return the index of the cell containing a pointer to node pNode // in its parent. If pNode is the root node, return -1. -func nodeParentIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, piIndex uintptr) int32 { /* sqlite3.c:189425:12: */ +func nodeParentIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, piIndex uintptr) int32 { /* sqlite3.c:192448:12: */ var pParent uintptr = (*RtreeNode)(unsafe.Pointer(pNode)).FpParent if pParent != 0 { return nodeRowidIndex(tls, pRtree, pParent, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode, piIndex) @@ -148774,7 +151289,7 @@ func nodeParentIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, piIndex uintp // iLevel values coming first. In this way, if rScore is the same for all // SearchPoints, then iLevel becomes the deciding factor and the result // is a depth-first search, which is the desired default behavior. -func rtreeSearchPointCompare(tls *libc.TLS, pA uintptr, pB uintptr) int32 { /* sqlite3.c:189444:12: */ +func rtreeSearchPointCompare(tls *libc.TLS, pA uintptr, pB uintptr) int32 { /* sqlite3.c:192467:12: */ if (*RtreeSearchPoint)(unsafe.Pointer(pA)).FrScore < (*RtreeSearchPoint)(unsafe.Pointer(pB)).FrScore { return -1 } @@ -148791,7 +151306,7 @@ func rtreeSearchPointCompare(tls *libc.TLS, pA uintptr, pB uintptr) int32 { /* s } // Interchange two search points in a cursor. -func rtreeSearchPointSwap(tls *libc.TLS, p uintptr, i int32, j int32) { /* sqlite3.c:189458:13: */ +func rtreeSearchPointSwap(tls *libc.TLS, p uintptr, i int32, j int32) { /* sqlite3.c:192481:13: */ var t = *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(i)*24)) *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(i)*24)) = *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(j)*24)) @@ -148811,7 +151326,7 @@ func rtreeSearchPointSwap(tls *libc.TLS, p uintptr, i int32, j int32) { /* sqlit } // Return the search point with the lowest current score. -func rtreeSearchPointFirst(tls *libc.TLS, pCur uintptr) uintptr { /* sqlite3.c:189479:25: */ +func rtreeSearchPointFirst(tls *libc.TLS, pCur uintptr) uintptr { /* sqlite3.c:192502:25: */ if (*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint != 0 { return (pCur + 64 /* &.sPoint */) } @@ -148822,7 +151337,7 @@ func rtreeSearchPointFirst(tls *libc.TLS, pCur uintptr) uintptr { /* sqlite3.c:1 } // Get the RtreeNode for the search point with the lowest score. -func rtreeNodeOfFirstSearchPoint(tls *libc.TLS, pCur uintptr, pRC uintptr) uintptr { /* sqlite3.c:189486:18: */ +func rtreeNodeOfFirstSearchPoint(tls *libc.TLS, pCur uintptr, pRC uintptr) uintptr { /* sqlite3.c:192509:18: */ var id Sqlite3_int64 var ii int32 = (1 - int32((*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint)) @@ -148839,7 +151354,7 @@ func rtreeNodeOfFirstSearchPoint(tls *libc.TLS, pCur uintptr, pRC uintptr) uintp } // Push a new element onto the priority queue -func rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:189502:25: */ +func rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:192525:25: */ var i int32 var j int32 var pNew uintptr @@ -148873,7 +151388,7 @@ func rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) ui // Allocate a new RtreeSearchPoint and return a pointer to it. Return // NULL if malloc fails. -func rtreeSearchPointNew(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:189537:25: */ +func rtreeSearchPointNew(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:192560:25: */ var pNew uintptr var pFirst uintptr pFirst = rtreeSearchPointFirst(tls, pCur) @@ -148908,7 +151423,7 @@ func rtreeSearchPointNew(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel } // Remove the search point with the lowest current score. -func rtreeSearchPointPop(tls *libc.TLS, p uintptr) { /* sqlite3.c:189604:13: */ +func rtreeSearchPointPop(tls *libc.TLS, p uintptr) { /* sqlite3.c:192627:13: */ var i int32 var j int32 var k int32 @@ -148956,7 +151471,7 @@ func rtreeSearchPointPop(tls *libc.TLS, p uintptr) { /* sqlite3.c:189604:13: */ // contains an entry suitable for returning as a result-set row, // or until the RtreeSearchPoint queue is empty, indicating that the // query has completed. -func rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:189652:12: */ +func rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:192675:12: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -149049,7 +151564,7 @@ func rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:189652:12 } // Rtree virtual table module xNext method. -func rtreeNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:189733:12: */ +func rtreeNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:192756:12: */ var pCsr uintptr = pVtabCursor var rc int32 = SQLITE_OK @@ -149065,7 +151580,7 @@ func rtreeNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:189733:1 } // Rtree virtual table module xRowid method. -func rtreeRowid(tls *libc.TLS, pVtabCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:189751:12: */ +func rtreeRowid(tls *libc.TLS, pVtabCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:192774:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -149080,7 +151595,7 @@ func rtreeRowid(tls *libc.TLS, pVtabCursor uintptr, pRowid uintptr) int32 { /* s } // Rtree virtual table module xColumn method. -func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:189765:12: */ +func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:192788:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -149141,7 +151656,7 @@ func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sq // return SQLITE_OK. If there is no such record in the table, set // *ppLeaf to 0 and return SQLITE_OK. If an error occurs, set *ppLeaf // to zero and return an SQLite error code. -func findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid I64, ppLeaf uintptr, piNode uintptr) int32 { /* sqlite3.c:189819:12: */ +func findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid I64, ppLeaf uintptr, piNode uintptr) int32 { /* sqlite3.c:192842:12: */ var rc int32 *(*uintptr)(unsafe.Pointer(ppLeaf)) = uintptr(0) Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid, 1, iRowid) @@ -149162,12 +151677,12 @@ func findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid I64, ppLeaf uintptr, piN // as the second argument for a MATCH constraint. The value passed as the // first argument to this function is the right-hand operand to the MATCH // operator. -func deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) int32 { /* sqlite3.c:189845:12: */ +func deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) int32 { /* sqlite3.c:192868:12: */ var pBlob uintptr var pSrc uintptr // BLOB returned by geometry function var pInfo uintptr // Callback information - pSrc = Xsqlite3_value_pointer(tls, pValue, ts+22369 /* "RtreeMatchArg" */) + pSrc = Xsqlite3_value_pointer(tls, pValue, ts+22893 /* "RtreeMatchArg" */) if pSrc == uintptr(0) { return SQLITE_ERROR } @@ -149194,7 +151709,7 @@ func deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) int32 { / } // Rtree virtual table module xFilter method. -func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:189875:12: */ +func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:192898:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -149231,7 +151746,7 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt // Always returns pCsr->sPoint *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8 /* iNode */)) - (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(PARTLY_WITHIN) rc = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)), iRowid, bp+16 /* &iCell */) (*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = U8(*(*int32)(unsafe.Pointer(bp + 16 /* iCell */))) @@ -149290,7 +151805,7 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt } (*RtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1) (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0) - (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(PARTLY_WITHIN) *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) = uintptr(0) @@ -149336,7 +151851,7 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt // The second of each pair of bytes identifies the coordinate column // to which the constraint applies. The leftmost coordinate column // is 'a', the second from the left 'b' etc. -func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:190025:12: */ +func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:193048:12: */ bp := tls.Alloc(49) defer tls.Free(49) @@ -149393,27 +151908,27 @@ func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sql var op U8 switch int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) { case SQLITE_INDEX_CONSTRAINT_EQ: - op = RTREE_EQ + op = U8(RTREE_EQ) break fallthrough case SQLITE_INDEX_CONSTRAINT_GT: - op = RTREE_GT + op = U8(RTREE_GT) break fallthrough case SQLITE_INDEX_CONSTRAINT_LE: - op = RTREE_LE + op = U8(RTREE_LE) break fallthrough case SQLITE_INDEX_CONSTRAINT_LT: - op = RTREE_LT + op = U8(RTREE_LT) break fallthrough case SQLITE_INDEX_CONSTRAINT_GE: - op = RTREE_GE + op = U8(RTREE_GE) break fallthrough case SQLITE_INDEX_CONSTRAINT_MATCH: - op = RTREE_MATCH + op = U8(RTREE_MATCH) break fallthrough default: @@ -149431,7 +151946,7 @@ func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sql (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 2 (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr = 1 - if (iIdx > 0) && (uintptr(0) == (libc.AssignPtrUintptr(pIdxInfo+48 /* &.idxStr */, Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp, bp+8 /* &zIdxStr[0] */))))) { + if (iIdx > 0) && (uintptr(0) == (libc.AssignPtrUintptr(pIdxInfo+48 /* &.idxStr */, Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp, bp+8 /* &zIdxStr[0] */))))) { return SQLITE_NOMEM } @@ -149443,7 +151958,7 @@ func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sql } // Return the N-dimensional volumn of the cell stored in *p. -func cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:190114:20: */ +func cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:193137:20: */ var area RtreeDValue = RtreeDValue(1) if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { @@ -149486,7 +152001,7 @@ func cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3 // Return the margin length of cell p. The margin length is the sum // of the objects size in each dimension. -func cellMargin(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:190144:20: */ +func cellMargin(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:193167:20: */ var margin RtreeDValue = RtreeDValue(0) var ii int32 = (int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) - 2) for ok := true; ok; ok = (ii >= 0) { @@ -149507,7 +152022,7 @@ func cellMargin(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlit } // Store the union of cells p1 and p2 in p1. -func cellUnion(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) { /* sqlite3.c:190157:13: */ +func cellUnion(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) { /* sqlite3.c:193180:13: */ var ii int32 = 0 if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { for ok := true; ok; ok = (ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)) { @@ -149546,7 +152061,7 @@ func cellUnion(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) { /* sqlit // Return true if the area covered by p2 is a subset of the area covered // by p1. False otherwise. -func cellContains(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:190178:12: */ +func cellContains(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:193201:12: */ var ii int32 var isInt int32 = (libc.Bool32(int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_INT32)) for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2); ii = ii + (2) { @@ -149561,7 +152076,7 @@ func cellContains(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) int32 { } // Return the amount cell p would grow by if it were unioned with pCell. -func cellGrowth(tls *libc.TLS, pRtree uintptr, p uintptr, pCell uintptr) RtreeDValue { /* sqlite3.c:190196:20: */ +func cellGrowth(tls *libc.TLS, pRtree uintptr, p uintptr, pCell uintptr) RtreeDValue { /* sqlite3.c:193219:20: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -149574,7 +152089,7 @@ func cellGrowth(tls *libc.TLS, pRtree uintptr, p uintptr, pCell uintptr) RtreeDV return (cellArea(tls, pRtree, bp /* &cell */) - area) } -func cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell int32) RtreeDValue { /* sqlite3.c:190205:20: */ +func cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell int32) RtreeDValue { /* sqlite3.c:193228:20: */ var ii int32 var overlap RtreeDValue = 0.0 for ii = 0; ii < nCell; ii++ { @@ -149649,7 +152164,7 @@ func cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell // This function implements the ChooseLeaf algorithm from Gutman[84]. // ChooseSubTree in r*tree terminology. -func sChooseLeaf(tls *libc.TLS, pRtree uintptr, pCell uintptr, iHeight int32, ppLeaf uintptr) int32 { /* sqlite3.c:190237:12: */ +func sChooseLeaf(tls *libc.TLS, pRtree uintptr, pCell uintptr, iHeight int32, ppLeaf uintptr) int32 { /* sqlite3.c:193260:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -149705,7 +152220,7 @@ func sChooseLeaf(tls *libc.TLS, pRtree uintptr, pCell uintptr, iHeight int32, pp // A cell with the same content as pCell has just been inserted into // the node pNode. This function updates the bounding box cells in // all ancestor elements. -func sAdjustTree(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:190297:12: */ +func sAdjustTree(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:193320:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -149734,7 +152249,7 @@ func sAdjustTree(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) in } // Write mapping (iRowid->iNode) to the _rowid table. -func rowidWrite(tls *libc.TLS, pRtree uintptr, iRowid Sqlite3_int64, iNode Sqlite3_int64) int32 { /* sqlite3.c:190328:12: */ +func rowidWrite(tls *libc.TLS, pRtree uintptr, iRowid Sqlite3_int64, iNode Sqlite3_int64) int32 { /* sqlite3.c:193351:12: */ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 1, iRowid) Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 2, iNode) Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid) @@ -149742,7 +152257,7 @@ func rowidWrite(tls *libc.TLS, pRtree uintptr, iRowid Sqlite3_int64, iNode Sqlit } // Write mapping (iNode->iPar) to the _parent table. -func parentWrite(tls *libc.TLS, pRtree uintptr, iNode Sqlite3_int64, iPar Sqlite3_int64) int32 { /* sqlite3.c:190338:12: */ +func parentWrite(tls *libc.TLS, pRtree uintptr, iNode Sqlite3_int64, iPar Sqlite3_int64) int32 { /* sqlite3.c:193361:12: */ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent, 1, iNode) Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent, 2, iPar) Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent) @@ -149764,7 +152279,7 @@ func parentWrite(tls *libc.TLS, pRtree uintptr, iNode Sqlite3_int64, iPar Sqlite // // The aSpare array is used as temporary working space by the // sorting algorithm. -func sSortByDistance(tls *libc.TLS, aIdx uintptr, nIdx int32, aDistance uintptr, aSpare uintptr) { /* sqlite3.c:190365:13: */ +func sSortByDistance(tls *libc.TLS, aIdx uintptr, nIdx int32, aDistance uintptr, aSpare uintptr) { /* sqlite3.c:193388:13: */ if nIdx > 1 { var iLeft int32 = 0 var iRight int32 = 0 @@ -149812,7 +152327,7 @@ func sSortByDistance(tls *libc.TLS, aIdx uintptr, nIdx int32, aDistance uintptr, // // The aSpare array is used as temporary working space by the // sorting algorithm. -func sSortByDimension(tls *libc.TLS, pRtree uintptr, aIdx uintptr, nIdx int32, iDim int32, aCell uintptr, aSpare uintptr) { /* sqlite3.c:190431:13: */ +func sSortByDimension(tls *libc.TLS, pRtree uintptr, aIdx uintptr, nIdx int32, iDim int32, aCell uintptr, aSpare uintptr) { /* sqlite3.c:193454:13: */ if nIdx > 1 { var iLeft int32 = 0 @@ -149868,7 +152383,7 @@ func sSortByDimension(tls *libc.TLS, pRtree uintptr, aIdx uintptr, nIdx int32, i } // Implementation of the R*-tree variant of SplitNode from Beckman[1990]. -func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32, pLeft uintptr, pRight uintptr, pBboxLeft uintptr, pBboxRight uintptr) int32 { /* sqlite3.c:190490:12: */ +func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32, pLeft uintptr, pRight uintptr, pBboxLeft uintptr, pBboxRight uintptr) int32 { /* sqlite3.c:193513:12: */ bp := tls.Alloc(96) defer tls.Free(96) @@ -149967,7 +152482,7 @@ func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32 return SQLITE_OK } -func updateMapping(tls *libc.TLS, pRtree uintptr, iRowid I64, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:190588:12: */ +func updateMapping(tls *libc.TLS, pRtree uintptr, iRowid I64, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:193611:12: */ var xSetMapping uintptr xSetMapping = func() uintptr { if iHeight == 0 { @@ -149990,7 +152505,7 @@ func updateMapping(tls *libc.TLS, pRtree uintptr, iRowid I64, pNode uintptr, iHe return (*(*func(*libc.TLS, uintptr, Sqlite3_int64, Sqlite3_int64) int32)(unsafe.Pointer(&xSetMapping)))(tls, pRtree, iRowid, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode) } -func sSplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:190607:12: */ +func sSplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:193630:12: */ bp := tls.Alloc(100) defer tls.Free(100) @@ -150224,7 +152739,7 @@ splitnode_out: // rowid of the row to delete, which can be used to find the leaf on which // the entry resides (argument pLeaf). Once the leaf is located, this // function is called to determine its ancestry. -func fixLeafParent(tls *libc.TLS, pRtree uintptr, pLeaf uintptr) int32 { /* sqlite3.c:190754:12: */ +func fixLeafParent(tls *libc.TLS, pRtree uintptr, pLeaf uintptr) int32 { /* sqlite3.c:193777:12: */ var rc int32 = SQLITE_OK var pChild uintptr = pLeaf for ((rc == SQLITE_OK) && ((*RtreeNode)(unsafe.Pointer(pChild)).FiNode != int64(1))) && ((*RtreeNode)(unsafe.Pointer(pChild)).FpParent == uintptr(0)) { @@ -150259,7 +152774,7 @@ func fixLeafParent(tls *libc.TLS, pRtree uintptr, pLeaf uintptr) int32 { /* sqli return rc } -func removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:190789:12: */ +func removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:193812:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -150308,7 +152823,7 @@ func removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) int return SQLITE_OK } -func fixBoundingBox(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:190838:12: */ +func fixBoundingBox(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:193861:12: */ bp := tls.Alloc(100) defer tls.Free(100) @@ -150339,7 +152854,7 @@ func fixBoundingBox(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sql // Delete the cell at index iCell of node pNode. After removing the // cell, adjust the r-tree data structure if required. -func deleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iHeight int32) int32 { /* sqlite3.c:190865:12: */ +func deleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iHeight int32) int32 { /* sqlite3.c:193888:12: */ var pParent uintptr var rc int32 @@ -150368,7 +152883,7 @@ func deleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iHeig return rc } -func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:190896:12: */ +func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:193919:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -150384,7 +152899,7 @@ func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHei var rc int32 = SQLITE_OK var n int32 - libc.Xmemset(tls, bp /* &aCenterCoord[0] */, 0, (uint64(unsafe.Sizeof(RtreeDValue(0))) * RTREE_MAX_DIMENSIONS)) + libc.Xmemset(tls, bp /* &aCenterCoord[0] */, 0, (uint64(unsafe.Sizeof(RtreeDValue(0))) * uint64(RTREE_MAX_DIMENSIONS))) nCell = (readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+2)) + 1) n = ((nCell + 1) & (libc.CplInt32(1))) @@ -150483,7 +152998,7 @@ func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHei // Insert cell pCell into node pNode. Node pNode is the head of a // subtree iHeight high (leaf nodes have iHeight==0). -func rtreeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:191001:12: */ +func rtreeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:194024:12: */ var rc int32 = SQLITE_OK if iHeight > 0 { var pChild uintptr = nodeHashLookup(tls, pRtree, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid) @@ -150513,7 +153028,7 @@ func rtreeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr return rc } -func reinsertNodeContent(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:191036:12: */ +func reinsertNodeContent(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:194059:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -150544,7 +153059,7 @@ func reinsertNodeContent(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { / } // Select a currently unused rowid for a new r-tree record. -func rtreeNewRowid(tls *libc.TLS, pRtree uintptr, piRowid uintptr) int32 { /* sqlite3.c:191065:12: */ +func rtreeNewRowid(tls *libc.TLS, pRtree uintptr, piRowid uintptr) int32 { /* sqlite3.c:194088:12: */ var rc int32 Xsqlite3_bind_null(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 1) Xsqlite3_bind_null(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 2) @@ -150555,7 +153070,7 @@ func rtreeNewRowid(tls *libc.TLS, pRtree uintptr, piRowid uintptr) int32 { /* sq } // Remove the entry with rowid=iDelete from the r-tree structure. -func rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Sqlite3_int64) int32 { /* sqlite3.c:191078:12: */ +func rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Sqlite3_int64) int32 { /* sqlite3.c:194101:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -150644,7 +153159,7 @@ func rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Sqlite3_int64) int3 // Convert an sqlite3_value into an RtreeValue (presumably a float) // while taking care to round toward negative or positive, respectively. -func rtreeValueDown(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:191175:19: */ +func rtreeValueDown(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:194198:19: */ var d float64 = Xsqlite3_value_double(tls, v) var f float32 = float32(d) if float64(f) > d { @@ -150658,7 +153173,7 @@ func rtreeValueDown(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:191175:1 return f } -func rtreeValueUp(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:191183:19: */ +func rtreeValueUp(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:194206:19: */ var d float64 = Xsqlite3_value_double(tls, v) var f float32 = float32(d) if float64(f) < d { @@ -150683,7 +153198,7 @@ func rtreeValueUp(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:191183:19: // (c1<=c2) constraint on columns iCol and iCol+1 that has failed. // // If an OOM occurs, SQLITE_NOMEM is returned instead of SQLITE_CONSTRAINT. -func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /* sqlite3.c:191206:12: */ +func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /* sqlite3.c:194229:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -150691,7 +153206,7 @@ func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /* var zSql uintptr var rc int32 - zSql = Xsqlite3_mprintf(tls, ts+22383 /* "SELECT * FROM %Q..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, ts+22907 /* "SELECT * FROM %Q..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -1, bp+56 /* &pStmt */, uintptr(0)) } else { @@ -150703,12 +153218,12 @@ func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /* if iCol == 0 { var zCol uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), 0) (*Rtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, - ts+22403 /* "UNIQUE constrain..." */, libc.VaList(bp+16, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + ts+22927 /* "UNIQUE constrain..." */, libc.VaList(bp+16, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { var zCol1 uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), iCol) var zCol2 uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), (iCol + 1)) (*Rtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, - ts+22435 /* "rtree constraint..." */, libc.VaList(bp+32, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + ts+22959 /* "rtree constraint..." */, libc.VaList(bp+32, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } @@ -150722,7 +153237,7 @@ func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /* } // The xUpdate method for rtree module virtual tables. -func rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:191244:12: */ +func rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:194267:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -150951,7 +153466,7 @@ constraint: } // Called when a transaction starts. -func rtreeBeginTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:191392:12: */ +func rtreeBeginTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:194415:12: */ var pRtree uintptr = pVtab (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans++ @@ -150960,7 +153475,7 @@ func rtreeBeginTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:19 // Called when a transaction completes (either by COMMIT or ROLLBACK). // The sqlite3_blob object should be released at this point. -func rtreeEndTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:191403:12: */ +func rtreeEndTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:194426:12: */ var pRtree uintptr = pVtab (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = U8(0) nodeBlobReset(tls, pRtree) @@ -150968,7 +153483,7 @@ func rtreeEndTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:1914 } // The xRename method for rtree module virtual tables. -func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 { /* sqlite3.c:191413:12: */ +func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 { /* sqlite3.c:194436:12: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -150976,7 +153491,7 @@ func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 { /* sqli var rc int32 = SQLITE_NOMEM var zSql uintptr = Xsqlite3_mprintf(tls, - ts+22472 /* "ALTER TABLE %Q.'..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + ts+22996 /* "ALTER TABLE %Q.'..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -150997,7 +153512,7 @@ func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 { /* sqli // INSERT INTO rtree... // DROP TABLE ; -- Would fail with SQLITE_LOCKED // COMMIT; -func rtreeSavepoint(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:191446:12: */ +func rtreeSavepoint(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:194469:12: */ var pRtree uintptr = pVtab var iwt U8 = (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans _ = iSavepoint @@ -151010,11 +153525,11 @@ func rtreeSavepoint(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* s // This function populates the pRtree->nRowEst variable with an estimate // of the number of rows in the virtual table. If possible, this is based // on sqlite_stat1 data. Otherwise, use RTREE_DEFAULT_ROWEST. -func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlite3.c:191461:12: */ +func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlite3.c:194484:12: */ bp := tls.Alloc(24) defer tls.Free(24) - var zFmt uintptr = ts + 22617 /* "SELECT stat FROM..." */ + var zFmt uintptr = ts + 23141 /* "SELECT stat FROM..." */ var zSql uintptr // var p uintptr at bp+16, 8 @@ -151022,9 +153537,9 @@ func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlit var nRow I64 = int64(0) rc = Xsqlite3_table_column_metadata(tls, - db, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, ts+9240 /* "sqlite_stat1" */, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + db, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, ts+9605 /* "sqlite_stat1" */, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { - (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = RTREE_DEFAULT_ROWEST + (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == SQLITE_ERROR { return SQLITE_OK } @@ -151046,13 +153561,13 @@ func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlit if rc == SQLITE_OK { if nRow == int64(0) { - (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = RTREE_DEFAULT_ROWEST + (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) } else { (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = func() int64 { - if (nRow) > (RTREE_MIN_ROWEST) { + if (nRow) > (int64(RTREE_MIN_ROWEST)) { return nRow } - return RTREE_MIN_ROWEST + return int64(RTREE_MIN_ROWEST) }() } } @@ -151064,7 +153579,7 @@ func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlit // Return true if zName is the extension on one of the shadow tables used // by this module. -func rtreeShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:191505:12: */ +func rtreeShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:194528:12: */ var i uint32 for i = uint32(0); uint64(i) < (uint64(unsafe.Sizeof(azName1)) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { if Xsqlite3_stricmp(tls, zName, azName1[i]) == 0 { @@ -151075,8 +153590,8 @@ func rtreeShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:191505:1 } var azName1 = [3]uintptr{ - ts + 22673 /* "node" */, ts + 4015 /* "parent" */, ts + 13865, /* "rowid" */ -} /* sqlite3.c:191506:21 */ + ts + 23197 /* "node" */, ts + 4043 /* "parent" */, ts + 14294, /* "rowid" */ +} /* sqlite3.c:194529:21 */ var rtreeModule = Sqlite3_module{ FiVersion: 3, // iVersion @@ -151100,9 +153615,9 @@ var rtreeModule = Sqlite3_module{ FxRename: 0, // xRename - rename the table FxSavepoint: 0, // xRollbackTo FxShadowName: 0, // xShadowName -} /* sqlite3.c:191516:23 */ +} /* sqlite3.c:194539:23 */ -func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefix uintptr, isCreate int32) int32 { /* sqlite3.c:191543:12: */ +func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefix uintptr, isCreate int32) int32 { /* sqlite3.c:194566:12: */ bp := tls.Alloc(232) defer tls.Free(232) @@ -151119,19 +153634,19 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi var p uintptr = Xsqlite3_str_new(tls, db) var ii int32 Xsqlite3_str_appendf(tls, p, - ts+22678, /* "CREATE TABLE \"%w..." */ + ts+23202, /* "CREATE TABLE \"%w..." */ libc.VaList(bp, zDb, zPrefix)) for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux); ii++ { - Xsqlite3_str_appendf(tls, p, ts+22740 /* ",a%d" */, libc.VaList(bp+16, ii)) + Xsqlite3_str_appendf(tls, p, ts+23264 /* ",a%d" */, libc.VaList(bp+16, ii)) } Xsqlite3_str_appendf(tls, p, - ts+22745, /* ");CREATE TABLE \"..." */ + ts+23269, /* ");CREATE TABLE \"..." */ libc.VaList(bp+24, zDb, zPrefix)) Xsqlite3_str_appendf(tls, p, - ts+22809, /* "CREATE TABLE \"%w..." */ + ts+23333, /* "CREATE TABLE \"%w..." */ libc.VaList(bp+40, zDb, zPrefix)) Xsqlite3_str_appendf(tls, p, - ts+22879, /* "INSERT INTO \"%w\"..." */ + ts+23403, /* "INSERT INTO \"%w\"..." */ libc.VaList(bp+56, zDb, zPrefix, (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { @@ -151162,7 +153677,7 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi } else { // An UPSERT is very slightly slower than REPLACE, but it is needed // if there are auxiliary columns - zFormat = ts + 22928 /* "INSERT INTO\"%w\"...." */ + zFormat = ts + 23452 /* "INSERT INTO\"%w\"...." */ } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+80, zDb, zPrefix)) if zSql != 0 { @@ -151174,7 +153689,7 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi } if (*Rtree)(unsafe.Pointer(pRtree)).FnAux != 0 { (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, - ts+23036, /* "SELECT * FROM \"%..." */ + ts+23560, /* "SELECT * FROM \"%..." */ libc.VaList(bp+96, zDb, zPrefix)) if (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = SQLITE_NOMEM @@ -151182,18 +153697,18 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi var p uintptr = Xsqlite3_str_new(tls, db) var ii int32 var zSql uintptr - Xsqlite3_str_appendf(tls, p, ts+23081 /* "UPDATE \"%w\".\"%w_..." */, libc.VaList(bp+112, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, ts+23605 /* "UPDATE \"%w\".\"%w_..." */, libc.VaList(bp+112, zDb, zPrefix)) for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux); ii++ { if ii != 0 { - Xsqlite3_str_append(tls, p, ts+10660 /* "," */, 1) + Xsqlite3_str_append(tls, p, ts+11076 /* "," */, 1) } if ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p, ts+23108 /* "a%d=coalesce(?%d..." */, libc.VaList(bp+128, ii, (ii+2), ii)) + Xsqlite3_str_appendf(tls, p, ts+23632 /* "a%d=coalesce(?%d..." */, libc.VaList(bp+128, ii, (ii+2), ii)) } else { - Xsqlite3_str_appendf(tls, p, ts+23130 /* "a%d=?%d" */, libc.VaList(bp+152, ii, (ii+2))) + Xsqlite3_str_appendf(tls, p, ts+23654 /* "a%d=?%d" */, libc.VaList(bp+152, ii, (ii+2))) } } - Xsqlite3_str_appendf(tls, p, ts+23138 /* " WHERE rowid=?1" */, 0) + Xsqlite3_str_appendf(tls, p, ts+23662 /* " WHERE rowid=?1" */, 0) zSql = Xsqlite3_str_finish(tls, p) if zSql == uintptr(0) { rc = SQLITE_NOMEM @@ -151209,26 +153724,26 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi var azSql = [8]uintptr{ // Write the xxx_node table - ts + 23154, /* "INSERT OR REPLAC..." */ - ts + 23207, /* "DELETE FROM '%q'..." */ + ts + 23678, /* "INSERT OR REPLAC..." */ + ts + 23731, /* "DELETE FROM '%q'..." */ // Read and write the xxx_rowid table - ts + 23252, /* "SELECT nodeno FR..." */ - ts + 23304, /* "INSERT OR REPLAC..." */ - ts + 23358, /* "DELETE FROM '%q'..." */ + ts + 23776, /* "SELECT nodeno FR..." */ + ts + 23828, /* "INSERT OR REPLAC..." */ + ts + 23882, /* "DELETE FROM '%q'..." */ // Read and write the xxx_parent table - ts + 23403, /* "SELECT parentnod..." */ - ts + 23461, /* "INSERT OR REPLAC..." */ - ts + 23516, /* "DELETE FROM '%q'..." */ -} /* sqlite3.c:191553:21 */ + ts + 23927, /* "SELECT parentnod..." */ + ts + 23985, /* "INSERT OR REPLAC..." */ + ts + 24040, /* "DELETE FROM '%q'..." */ +} /* sqlite3.c:194576:21 */ // The second argument to this function contains the text of an SQL statement // that returns a single integer value. The statement is compiled and executed // using database connection db. If successful, the integer value returned // is written to *piVal and SQLITE_OK returned. Otherwise, an SQLite error // code is returned and the value of *piVal after returning is not defined. -func getIntFromStmt(tls *libc.TLS, db uintptr, zSql uintptr, piVal uintptr) int32 { /* sqlite3.c:191673:12: */ +func getIntFromStmt(tls *libc.TLS, db uintptr, zSql uintptr, piVal uintptr) int32 { /* sqlite3.c:194696:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -151259,7 +153774,7 @@ func getIntFromStmt(tls *libc.TLS, db uintptr, zSql uintptr, piVal uintptr) int3 // This ensures that each node is stored on a single database page. If the // database page-size is so large that more than RTREE_MAXCELLS entries // would fit in a single node, use a smaller node-size. -func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzErr uintptr) int32 { /* sqlite3.c:191703:12: */ +func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzErr uintptr) int32 { /* sqlite3.c:194726:12: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -151267,7 +153782,7 @@ func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzEr var zSql uintptr if isCreate != 0 { *(*int32)(unsafe.Pointer(bp + 48 /* iPageSize */)) = 0 - zSql = Xsqlite3_mprintf(tls, ts+23563 /* "PRAGMA %Q.page_s..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, ts+24087 /* "PRAGMA %Q.page_s..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb)) rc = getIntFromStmt(tls, db, zSql, bp+48 /* &iPageSize */) if rc == SQLITE_OK { (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize = (*(*int32)(unsafe.Pointer(bp + 48 /* iPageSize */)) - 64) @@ -151275,19 +153790,19 @@ func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzEr (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize = (4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * RTREE_MAXCELLS)) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } else { zSql = Xsqlite3_mprintf(tls, - ts+23583, /* "SELECT length(da..." */ + ts+24107, /* "SELECT length(da..." */ libc.VaList(bp+16, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) rc = getIntFromStmt(tls, db, zSql, (pRtree + 32 /* &.iNodeSize */)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp+32, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp+32, Xsqlite3_errmsg(tls, db))) } else if (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize < (512 - 64) { rc = (SQLITE_CORRUPT | (int32(1) << 8)) - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+23640, /* "undersize RTree ..." */ + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+24164, /* "undersize RTree ..." */ libc.VaList(bp+40, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) } } @@ -151297,7 +153812,7 @@ func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzEr } // Return the length of a token -func rtreeTokenLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:191746:12: */ +func rtreeTokenLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:194769:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -151312,7 +153827,7 @@ func rtreeTokenLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:191746:12: // argv[1] -> database name // argv[2] -> table name // argv[...] -> column names... -func rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:191760:12: */ +func rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:194783:12: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -151338,17 +153853,17 @@ func rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr ii = 4 *(*[5]uintptr)(unsafe.Pointer(bp + 96 /* aErrMsg */)) = [5]uintptr{ uintptr(0), // 0 - ts + 23675, /* "Wrong number of ..." */ // 1 - ts + 23718, /* "Too few columns ..." */ // 2 - ts + 23753, /* "Too many columns..." */ // 3 - ts + 23789, /* "Auxiliary rtree ..." */ // 4 + ts + 24199, /* "Wrong number of ..." */ // 1 + ts + 24242, /* "Too few columns ..." */ // 2 + ts + 24277, /* "Too many columns..." */ // 3 + ts + 24313, /* "Auxiliary rtree ..." */ // 4 } // Aux columns counted by a u8 if !((argc < 6) || (argc > (RTREE_MAX_AUX_COLUMN + 3))) { goto __1 } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + uintptr((2+(libc.Bool32(argc >= 6))))*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + uintptr((2+(libc.Bool32(argc >= 6))))*8)))) return SQLITE_ERROR __1: ; @@ -151378,7 +153893,7 @@ __2: // that is successful, call sqlite3_declare_vtab() to configure // the r-tree table schema. pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, ts+23826, /* "CREATE TABLE x(%..." */ + Xsqlite3_str_appendf(tls, pSql, ts+24350, /* "CREATE TABLE x(%..." */ libc.VaList(bp+16, rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = 4 __3: @@ -151390,7 +153905,7 @@ __3: goto __6 } (*Rtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, ts+23850 /* ",%.*s" */, libc.VaList(bp+32, rtreeTokenLength(tls, (zArg+uintptr(1))), (zArg+uintptr(1)))) + Xsqlite3_str_appendf(tls, pSql, ts+24374 /* ",%.*s" */, libc.VaList(bp+32, rtreeTokenLength(tls, (zArg+uintptr(1))), (zArg+uintptr(1)))) goto __7 __6: if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux) > 0) { @@ -151413,7 +153928,7 @@ __4: goto __5 __5: ; - Xsqlite3_str_appendf(tls, pSql, ts+23856 /* ");" */, 0) + Xsqlite3_str_appendf(tls, pSql, ts+24380 /* ");" */, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(!(zSql != 0)) { goto __10 @@ -151424,14 +153939,14 @@ __10: if !(ii < argc) { goto __12 } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + 4*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + 4*8)))) rc = SQLITE_ERROR goto __13 __12: if !(SQLITE_OK != (libc.AssignInt32(&rc, Xsqlite3_declare_vtab(tls, db, zSql)))) { goto __14 } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp+72, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp+72, Xsqlite3_errmsg(tls, db))) __14: ; __13: @@ -151474,7 +153989,7 @@ __17: if !(iErr != 0) { goto __22 } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp+80, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + uintptr(iErr)*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp+80, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + uintptr(iErr)*8)))) goto rtreeInit_fail __22: ; @@ -151492,7 +154007,7 @@ __23: if !(rc != 0) { goto __24 } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp+88, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp+88, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail __24: ; @@ -151512,7 +154027,7 @@ __25: return rc } -var azFormat = [2]uintptr{ts + 23859 /* ",%.*s REAL" */, ts + 23870 /* ",%.*s INT" */} /* sqlite3.c:191826:25 */ +var azFormat = [2]uintptr{ts + 24383 /* ",%.*s REAL" */, ts + 24394 /* ",%.*s INT" */} /* sqlite3.c:194849:25 */ // Implementation of a scalar function that decodes r-tree nodes to // human readable strings. This can be used for debugging and analysis. @@ -151528,7 +154043,7 @@ var azFormat = [2]uintptr{ts + 23859 /* ",%.*s REAL" */, ts + 23870 /* ",%.*s IN // entry for each cell in the r-tree node. Each entry is itself a // list, containing the 8-byte rowid/pageno followed by the // *2 coordinates. -func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:191897:13: */ +func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:194920:13: */ bp := tls.Alloc(1072) defer tls.Free(1072) @@ -151567,13 +154082,13 @@ func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlit nodeGetCell(tls, bp+56 /* &tree */, bp+16 /* &node */, ii, bp+1024 /* &cell */) if ii > 0 { - Xsqlite3_str_append(tls, pOut, ts+12763 /* " " */, 1) + Xsqlite3_str_append(tls, pOut, ts+9214 /* " " */, 1) } - Xsqlite3_str_appendf(tls, pOut, ts+23880 /* "{%lld" */, libc.VaList(bp, (*RtreeCell)(unsafe.Pointer(bp+1024 /* &cell */)).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, ts+24404 /* "{%lld" */, libc.VaList(bp, (*RtreeCell)(unsafe.Pointer(bp+1024 /* &cell */)).FiRowid)) for jj = 0; jj < int32((*Rtree)(unsafe.Pointer(bp+56 /* &tree */)).FnDim2); jj++ { - Xsqlite3_str_appendf(tls, pOut, ts+23886 /* " %g" */, libc.VaList(bp+8, float64(*(*RtreeValue)(unsafe.Pointer((bp + 1024 /* &cell */ + 8 /* &.aCoord */) + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, ts+24410 /* " %g" */, libc.VaList(bp+8, float64(*(*RtreeValue)(unsafe.Pointer((bp + 1024 /* &cell */ + 8 /* &.aCoord */) + uintptr(jj)*4))))) } - Xsqlite3_str_append(tls, pOut, ts+23890 /* "}" */, 1) + Xsqlite3_str_append(tls, pOut, ts+24414 /* "}" */, 1) } errCode = Xsqlite3_str_errcode(tls, pOut) Xsqlite3_result_text(tls, ctx, Xsqlite3_str_finish(tls, pOut), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) @@ -151588,11 +154103,11 @@ func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlit // The depth value is 0 for all nodes other than the root node, and the root // node always has nodeno=1, so the example above is the primary use for this // routine. This routine is intended for testing and analysis only. -func rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:191948:13: */ +func rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:194971:13: */ _ = nArg if (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != SQLITE_BLOB) || (Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < 2) { - Xsqlite3_result_error(tls, ctx, ts+23892 /* "Invalid argument..." */, -1) + Xsqlite3_result_error(tls, ctx, ts+24416 /* "Invalid argument..." */, -1) } else { var zBlob uintptr = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) Xsqlite3_result_int(tls, ctx, readInt16(tls, zBlob)) @@ -151616,15 +154131,15 @@ type RtreeCheck1 = struct { FzReport uintptr FnErr int32 _ [4]byte -} /* sqlite3.c:191964:9 */ +} /* sqlite3.c:194987:9 */ // Context object passed between the various routines that make up the // implementation of integrity-check function rtreecheck(). -type RtreeCheck = RtreeCheck1 /* sqlite3.c:191964:27 */ +type RtreeCheck = RtreeCheck1 /* sqlite3.c:194987:27 */ // Reset SQL statement pStmt. If the sqlite3_reset() call returns an error, // and RtreeCheck.rc==SQLITE_OK, set RtreeCheck.rc to the error code. -func rtreeCheckReset(tls *libc.TLS, pCheck uintptr, pStmt uintptr) { /* sqlite3.c:191986:13: */ +func rtreeCheckReset(tls *libc.TLS, pCheck uintptr, pStmt uintptr) { /* sqlite3.c:195009:13: */ var rc int32 = Xsqlite3_reset(tls, pStmt) if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = rc @@ -151637,7 +154152,7 @@ func rtreeCheckReset(tls *libc.TLS, pCheck uintptr, pStmt uintptr) { /* sqlite3. // // If successful, a pointer to the new SQL statement is returned. Otherwise, // NULL is returned and an error code left in RtreeCheck.rc. -func rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:191999:21: */ +func rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:195022:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -151665,7 +154180,7 @@ func rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // The second and subsequent arguments to this function are a printf() // style format string and arguments. This function formats the string and // appends it to the report being accumuated in pCheck. -func rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:192028:13: */ +func rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:195051:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -151677,10 +154192,10 @@ func rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr if z == uintptr(0) { (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = SQLITE_NOMEM } else { - (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, ts+23925, /* "%z%s%z" */ + (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, ts+24449, /* "%z%s%z" */ libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport, func() uintptr { if (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - return ts + 3012 /* "\n" */ + return ts + 3040 /* "\n" */ } return ts + 703 /* "" */ }(), z)) @@ -151705,7 +154220,7 @@ func rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr // Or, if an error does occur, NULL is returned and an error code left // in the RtreeCheck object. The final value of *pnNode is undefined in // this case. -func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) uintptr { /* sqlite3.c:192062:11: */ +func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) uintptr { /* sqlite3.c:195085:11: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -151713,7 +154228,7 @@ func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) if ((*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK) && ((*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0)) { (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = rtreeCheckPrepare(tls, pCheck, - ts+23932, /* "SELECT data FROM..." */ + ts+24456, /* "SELECT data FROM..." */ libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } @@ -151732,7 +154247,7 @@ func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) } rtreeCheckReset(tls, pCheck, (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if ((*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK) && (pRet == uintptr(0)) { - rtreeCheckAppendMsg(tls, pCheck, ts+23977 /* "Node %lld missin..." */, libc.VaList(bp+16, iNode)) + rtreeCheckAppendMsg(tls, pCheck, ts+24501 /* "Node %lld missin..." */, libc.VaList(bp+16, iNode)) } } @@ -151749,15 +154264,15 @@ func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) // In both cases, this function checks that there exists an entry with // IPK value iKey and the second column set to iVal. // -func rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey I64, iVal I64) { /* sqlite3.c:192106:13: */ +func rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey I64, iVal I64) { /* sqlite3.c:195129:13: */ bp := tls.Alloc(96) defer tls.Free(96) var rc int32 var pStmt uintptr *(*[2]uintptr)(unsafe.Pointer(bp + 80 /* azSql */)) = [2]uintptr{ - ts + 24009, /* "SELECT parentnod..." */ - ts + 24063, /* "SELECT nodeno FR..." */ + ts + 24533, /* "SELECT parentnod..." */ + ts + 24587, /* "SELECT nodeno FR..." */ } if *(*uintptr)(unsafe.Pointer((pCheck + 40 /* &.aCheckMapping */) + uintptr(bLeaf)*8)) == uintptr(0) { @@ -151772,23 +154287,23 @@ func rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey I64, iVa Xsqlite3_bind_int64(tls, pStmt, 1, iKey) rc = Xsqlite3_step(tls, pStmt) if rc == SQLITE_DONE { - rtreeCheckAppendMsg(tls, pCheck, ts+24111, /* "Mapping (%lld ->..." */ + rtreeCheckAppendMsg(tls, pCheck, ts+24635, /* "Mapping (%lld ->..." */ libc.VaList(bp+16, iKey, iVal, func() uintptr { if bLeaf != 0 { - return ts + 24156 /* "%_rowid" */ + return ts + 24680 /* "%_rowid" */ } - return ts + 24164 /* "%_parent" */ + return ts + 24688 /* "%_parent" */ }())) } else if rc == SQLITE_ROW { var ii I64 = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { rtreeCheckAppendMsg(tls, pCheck, - ts+24173, /* "Found (%lld -> %..." */ + ts+24697, /* "Found (%lld -> %..." */ libc.VaList(bp+40, iKey, ii, func() uintptr { if bLeaf != 0 { - return ts + 24156 /* "%_rowid" */ + return ts + 24680 /* "%_rowid" */ } - return ts + 24164 /* "%_parent" */ + return ts + 24688 /* "%_parent" */ }(), iKey, iVal)) } } @@ -151805,7 +154320,7 @@ func rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey I64, iVa // containing pCell. In this case it is also verified that the two // sets of coordinates are mutually consistent and an error message added // to the RtreeCheck object if they are not. -func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, pCell uintptr, pParent uintptr) { /* sqlite3.c:192158:13: */ +func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, pCell uintptr, pParent uintptr) { /* sqlite3.c:195181:13: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -151831,7 +154346,7 @@ func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, return (libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 48 /* &c1 */)) > *(*RtreeValue)(unsafe.Pointer(bp + 52 /* &c2 */)))) }() != 0 { rtreeCheckAppendMsg(tls, pCheck, - ts+24231 /* "Dimension %d of ..." */, libc.VaList(bp, i, iCell, iNode)) + ts+24755 /* "Dimension %d of ..." */, libc.VaList(bp, i, iCell, iNode)) } if pParent != 0 { @@ -151851,7 +154366,7 @@ func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, return (libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 52 /* &c2 */)) > *(*RtreeValue)(unsafe.Pointer(bp + 60 /* &p2 */)))) }() != 0) { rtreeCheckAppendMsg(tls, pCheck, - ts+24279 /* "Dimension %d of ..." */, libc.VaList(bp+24, i, iCell, iNode)) + ts+24803 /* "Dimension %d of ..." */, libc.VaList(bp+24, i, iCell, iNode)) } } } @@ -151863,7 +154378,7 @@ func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, // // If any problems are discovered, an error message is appended to the // report accumulated in the RtreeCheck object. -func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr, iNode I64) { /* sqlite3.c:192204:13: */ +func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr, iNode I64) { /* sqlite3.c:195227:13: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -151874,14 +154389,14 @@ func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr if aNode != 0 { if *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)) < 4 { rtreeCheckAppendMsg(tls, pCheck, - ts+24346 /* "Node %lld is too..." */, libc.VaList(bp, iNode, *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)))) + ts+24870 /* "Node %lld is too..." */, libc.VaList(bp, iNode, *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)))) } else { var nCell int32 // Number of cells on page var i int32 // Used to iterate through cells if aParent == uintptr(0) { iDepth = readInt16(tls, aNode) if iDepth > RTREE_MAX_DEPTH { - rtreeCheckAppendMsg(tls, pCheck, ts+24380 /* "Rtree depth out ..." */, libc.VaList(bp+16, iDepth)) + rtreeCheckAppendMsg(tls, pCheck, ts+24904 /* "Rtree depth out ..." */, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } @@ -151889,7 +154404,7 @@ func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr nCell = readInt16(tls, (aNode + 2)) if (4 + (nCell * (8 + (((*RtreeCheck)(unsafe.Pointer(pCheck)).FnDim * 2) * 4)))) > *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)) { rtreeCheckAppendMsg(tls, pCheck, - ts+24410, /* "Node %lld is too..." */ + ts+24934, /* "Node %lld is too..." */ libc.VaList(bp+24, iNode, nCell, *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)))) } else { for i = 0; i < nCell; i++ { @@ -151917,20 +154432,20 @@ func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr // %_rowid or %_parent table is exactly nExpect. If not, it adds // an error message to the report in the RtreeCheck object indicated // by the first argument. -func rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect I64) { /* sqlite3.c:192267:13: */ +func rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect I64) { /* sqlite3.c:195290:13: */ bp := tls.Alloc(48) defer tls.Free(48) if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { var pCount uintptr - pCount = rtreeCheckPrepare(tls, pCheck, ts+24465, /* "SELECT count(*) ..." */ + pCount = rtreeCheckPrepare(tls, pCheck, ts+24989, /* "SELECT count(*) ..." */ libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == SQLITE_ROW { var nActual I64 = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { rtreeCheckAppendMsg(tls, pCheck, - ts+24496 /* "Wrong number of ..." */, libc.VaList(bp+24, zTbl, nExpect, nActual)) + ts+25020 /* "Wrong number of ..." */, libc.VaList(bp+24, zTbl, nExpect, nActual)) } } (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -151940,7 +154455,7 @@ func rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect I64) { // This function does the bulk of the work for the rtree integrity-check. // It is called by rtreecheck(), which is the SQL function implementation. -func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzReport uintptr) int32 { /* sqlite3.c:192291:12: */ +func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzReport uintptr) int32 { /* sqlite3.c:195314:12: */ bp := tls.Alloc(120) defer tls.Free(120) @@ -151960,13 +154475,13 @@ func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRep // to ensure that the queries run as part of this integrity-check operate // on a consistent snapshot. if Xsqlite3_get_autocommit(tls, db) != 0 { - (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = Xsqlite3_exec(tls, db, ts+12336 /* "BEGIN" */, uintptr(0), uintptr(0), uintptr(0)) + (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = Xsqlite3_exec(tls, db, ts+12752 /* "BEGIN" */, uintptr(0), uintptr(0), uintptr(0)) bEnd = 1 } // Find the number of auxiliary columns if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).Frc == SQLITE_OK { - pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+24563 /* "SELECT * FROM %Q..." */, libc.VaList(bp, zDb, zTab)) + pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+25087 /* "SELECT * FROM %Q..." */, libc.VaList(bp, zDb, zTab)) if pStmt != 0 { nAux = (Xsqlite3_column_count(tls, pStmt) - 2) Xsqlite3_finalize(tls, pStmt) @@ -151975,12 +154490,12 @@ func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRep } // Find number of dimensions in the rtree table. - pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+22383 /* "SELECT * FROM %Q..." */, libc.VaList(bp+16, zDb, zTab)) + pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+22907 /* "SELECT * FROM %Q..." */, libc.VaList(bp+16, zDb, zTab)) if pStmt != 0 { var rc int32 (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).FnDim = (((Xsqlite3_column_count(tls, pStmt) - 1) - nAux) / 2) if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnDim < 1 { - rtreeCheckAppendMsg(tls, bp+32 /* &check */, ts+24591 /* "Schema corrupt o..." */, 0) + rtreeCheckAppendMsg(tls, bp+32 /* &check */, ts+25115 /* "Schema corrupt o..." */, 0) } else if SQLITE_ROW == Xsqlite3_step(tls, pStmt) { (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).FbInt = (libc.Bool32(Xsqlite3_column_type(tls, pStmt, 1) == SQLITE_INTEGER)) } @@ -151995,8 +154510,8 @@ func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRep if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).Frc == SQLITE_OK { rtreeCheckNode(tls, bp+32 /* &check */, 0, uintptr(0), int64(1)) } - rtreeCheckCount(tls, bp+32 /* &check */, ts+24622 /* "_rowid" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnLeaf)) - rtreeCheckCount(tls, bp+32 /* &check */, ts+24629 /* "_parent" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnNonLeaf)) + rtreeCheckCount(tls, bp+32 /* &check */, ts+25146 /* "_rowid" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnLeaf)) + rtreeCheckCount(tls, bp+32 /* &check */, ts+25153 /* "_parent" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnNonLeaf)) } // Finalize SQL statements used by the integrity-check @@ -152006,7 +154521,7 @@ func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRep // If one was opened, close the transaction if bEnd != 0 { - var rc int32 = Xsqlite3_exec(tls, db, ts+24637 /* "END" */, uintptr(0), uintptr(0), uintptr(0)) + var rc int32 = Xsqlite3_exec(tls, db, ts+25161 /* "END" */, uintptr(0), uintptr(0), uintptr(0)) if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).Frc == SQLITE_OK { (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = rc } @@ -152046,13 +154561,13 @@ func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRep // as there are non-leaf cells in the r-tree structure, and that // there is a non-leaf cell that corresponds to each entry in the // %_parent table. -func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:192396:13: */ +func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:195419:13: */ bp := tls.Alloc(8) defer tls.Free(8) if (nArg != 1) && (nArg != 2) { Xsqlite3_result_error(tls, ctx, - ts+24641 /* "wrong number of ..." */, -1) + ts+25165 /* "wrong number of ..." */, -1) } else { var rc int32 *(*uintptr)(unsafe.Pointer(bp /* zReport */)) = uintptr(0) @@ -152060,7 +154575,7 @@ func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqli var zTab uintptr if nArg == 1 { zTab = zDb - zDb = ts + 5282 /* "main" */ + zDb = ts + 5327 /* "main" */ } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -152070,7 +154585,7 @@ func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqli if *(*uintptr)(unsafe.Pointer(bp /* zReport */)) != 0 { return *(*uintptr)(unsafe.Pointer(bp /* zReport */)) } - return ts + 15444 /* "ok" */ + return ts + 15873 /* "ok" */ }(), -1, libc.UintptrFromInt32(-1)) } else { Xsqlite3_result_error_code(tls, ctx, rc) @@ -152105,7 +154620,7 @@ func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqli // Compiler and version // Datatype for coordinates -type GeoCoord = float32 /* sqlite3.c:192520:15 */ +type GeoCoord = float32 /* sqlite3.c:195543:15 */ // Internal representation of a polygon. // @@ -152131,7 +154646,7 @@ type GeoPoly1 = struct { FnVertex int32 Fhdr [4]uint8 Fa [8]GeoCoord -} /* sqlite3.c:192544:9 */ +} /* sqlite3.c:195567:9 */ // Internal representation of a polygon. // @@ -152153,7 +154668,7 @@ type GeoPoly1 = struct { // warnings coming from some compiler (notably, clang). In reality, the size // of each GeoPoly memory allocate is adjusted as necessary so that the // GeoPoly.a[] array at the end is the appropriate size. -type GeoPoly = GeoPoly1 /* sqlite3.c:192544:24 */ +type GeoPoly = GeoPoly1 /* sqlite3.c:195567:24 */ // The size of a memory allocation needed for a GeoPoly object sufficient // to hold N coordinate pairs. @@ -152170,7 +154685,7 @@ type GeoParse1 = struct { FnErr int32 _ [4]byte Fa uintptr -} /* sqlite3.c:192567:9 */ +} /* sqlite3.c:195590:9 */ // The size of a memory allocation needed for a GeoPoly object sufficient // to hold N coordinate pairs. @@ -152180,10 +154695,10 @@ type GeoParse1 = struct { // to silence (incorrect) UBSAN warnings if the array index is too large. // State of a parse of a GeoJSON input. -type GeoParse = GeoParse1 /* sqlite3.c:192567:25 */ +type GeoParse = GeoParse1 /* sqlite3.c:195590:25 */ // Do a 4-byte byte swap -func geopolySwab32(tls *libc.TLS, a uintptr) { /* sqlite3.c:192577:13: */ +func geopolySwab32(tls *libc.TLS, a uintptr) { /* sqlite3.c:195600:13: */ var t uint8 = *(*uint8)(unsafe.Pointer(a)) *(*uint8)(unsafe.Pointer(a)) = *(*uint8)(unsafe.Pointer(a + 3)) *(*uint8)(unsafe.Pointer(a + 3)) = t @@ -152193,7 +154708,7 @@ func geopolySwab32(tls *libc.TLS, a uintptr) { /* sqlite3.c:192577:13: */ } // Skip whitespace. Return the next non-whitespace character. -func geopolySkipSpace(tls *libc.TLS, p uintptr) int8 { /* sqlite3.c:192587:13: */ +func geopolySkipSpace(tls *libc.TLS, p uintptr) int8 { /* sqlite3.c:195610:13: */ for jsonIsSpace[*(*uint8)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(p)).Fz))] != 0 { (*GeoParse)(unsafe.Pointer(p)).Fz++ } @@ -152202,7 +154717,7 @@ func geopolySkipSpace(tls *libc.TLS, p uintptr) int8 { /* sqlite3.c:192587:13: * // Parse out a number. Write the value into *pVal if pVal!=0. // return non-zero on success and zero if the next token is not a number. -func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlite3.c:192595:12: */ +func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlite3.c:195618:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -152261,7 +154776,7 @@ func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlit // is available // var r float64 at bp, 8 - Xsqlite3AtoF(tls, (*GeoParse)(unsafe.Pointer(p)).Fz, bp /* &r */, j, SQLITE_UTF8) + Xsqlite3AtoF(tls, (*GeoParse)(unsafe.Pointer(p)).Fz, bp /* &r */, j, uint8(SQLITE_UTF8)) *(*GeoCoord)(unsafe.Pointer(pVal)) = GeoCoord(*(*float64)(unsafe.Pointer(bp /* r */))) } *(*uintptr)(unsafe.Pointer(p /* &.z */)) += (uintptr(j)) @@ -152274,7 +154789,7 @@ func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlit // that object. // // If any error occurs, return NULL. -func geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) uintptr { /* sqlite3.c:192653:16: */ +func geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) uintptr { /* sqlite3.c:195676:16: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -152419,7 +154934,7 @@ __16: // in the binary format or JSON text. Compute a GeoPoly object and // return a pointer to that object. Or if the input is not a well-formed // polygon, put an error message in sqlite3_context and return NULL. -func geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) uintptr { /* sqlite3.c:192730:16: */ +func geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) uintptr { /* sqlite3.c:195753:16: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -152481,7 +154996,7 @@ func geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ui // If the input is a well-formed Geopoly BLOB or JSON string // then return the BLOB representation of the polygon. Otherwise // return NULL. -func geopolyBlobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192786:13: */ +func geopolyBlobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:195809:13: */ var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) if p != 0 { Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */ @@ -152494,7 +155009,7 @@ func geopolyBlobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // // Interpret X as a polygon and render it as a JSON array // of coordinates. Or, if X is not a valid polygon, return NULL. -func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192805:13: */ +func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:195828:13: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -152503,11 +155018,11 @@ func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db uintptr = Xsqlite3_context_db_handle(tls, context) var x uintptr = Xsqlite3_str_new(tls, db) var i int32 - Xsqlite3_str_append(tls, x, ts+24692 /* "[" */, 1) + Xsqlite3_str_append(tls, x, ts+25216 /* "[" */, 1) for i = 0; i < (*GeoPoly)(unsafe.Pointer(p)).FnVertex; i++ { - Xsqlite3_str_appendf(tls, x, ts+24694 /* "[%!g,%!g]," */, libc.VaList(bp, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((i)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((i)*2)+1))*4))))) + Xsqlite3_str_appendf(tls, x, ts+25218 /* "[%!g,%!g]," */, libc.VaList(bp, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((i)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((i)*2)+1))*4))))) } - Xsqlite3_str_appendf(tls, x, ts+24705 /* "[%!g,%!g]]" */, libc.VaList(bp+16, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */)))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + 1*4))))) + Xsqlite3_str_appendf(tls, x, ts+25229 /* "[%!g,%!g]]" */, libc.VaList(bp+16, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */)))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + 1*4))))) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) Xsqlite3_free(tls, p) } @@ -152517,7 +155032,7 @@ func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // // Interpret X as a polygon and render it as a SVG . // Additional arguments are added as attributes to the . -func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192831:13: */ +func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:195854:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -152531,19 +155046,19 @@ func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var x uintptr = Xsqlite3_str_new(tls, db) var i int32 var cSep int8 = int8('\'') - Xsqlite3_str_appendf(tls, x, ts+24716 /* "" */, 0) + Xsqlite3_str_appendf(tls, x, ts+25278 /* ">" */, 0) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) Xsqlite3_free(tls, p) } @@ -152563,7 +155078,7 @@ func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // Rotate by R around the point (0,0): // // geopoly_xform(poly, cos(R), sin(R), -sin(R), cos(R), 0, 0) -func geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192878:13: */ +func geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:195901:13: */ var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) var A float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) var B float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) @@ -152596,7 +155111,7 @@ func geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) // This routine can also be used to detect polygons that rotate in // the wrong direction. Polygons are suppose to be counter-clockwise (CCW). // This routine returns a negative value for clockwise (CW) polygons. -func geopolyArea(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:192914:15: */ +func geopolyArea(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:195937:15: */ var rArea float64 = 0.0 var ii int32 for ii = 0; ii < ((*GeoPoly)(unsafe.Pointer(p)).FnVertex - 1); ii++ { @@ -152616,7 +155131,7 @@ func geopolyArea(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:192914:15: */ // enclosed by the polygon. If the polygon circulates clockwise instead // of counterclockwise (as it should) then return the negative of the // enclosed area. Otherwise return NULL. -func geopolyAreaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192936:13: */ +func geopolyAreaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:195959:13: */ var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) if p != 0 { Xsqlite3_result_double(tls, context, geopolyArea(tls, p)) @@ -152635,7 +155150,7 @@ func geopolyAreaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // // Use this routine to sanitize historical inputs that that sometimes // contain polygons that wind in the wrong direction. -func geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192961:13: */ +func geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:195984:13: */ var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) if p != 0 { if geopolyArea(tls, p) < 0.0 { @@ -152671,7 +155186,7 @@ func geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } // Fast approximation for sine(X) for X between -0.5*pi and 2*pi -func geopolySine(tls *libc.TLS, r float64) float64 { /* sqlite3.c:192989:15: */ +func geopolySine(tls *libc.TLS, r float64) float64 { /* sqlite3.c:196012:15: */ if r >= (float64(1.5) * 3.1415926535897932385) { r = r - (float64(2.0) * 3.1415926535897932385) @@ -152691,7 +155206,7 @@ func geopolySine(tls *libc.TLS, r float64) float64 { /* sqlite3.c:192989:15: */ // // Construct a simple, convex, regular polygon centered at X, Y // with circumradius R and with N sides. -func geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193010:13: */ +func geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196033:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -152736,7 +155251,7 @@ func geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // // If pPoly is NULL but aCoord is not NULL, then compute a new GeoPoly from // the bounding box in aCoord and return a pointer to that GeoPoly. -func geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, pRc uintptr) uintptr { /* sqlite3.c:193053:16: */ +func geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, pRc uintptr) uintptr { /* sqlite3.c:196076:16: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -152872,7 +155387,7 @@ __4: } // Implementation of the geopoly_bbox(X) SQL function. -func geopolyBBoxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193124:13: */ +func geopolyBBoxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196147:13: */ var p uintptr = geopolyBBox(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0), uintptr(0)) if p != 0 { Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */ @@ -152885,13 +155400,13 @@ func geopolyBBoxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { type GeoBBox1 = struct { FisInit int32 Fa [4]RtreeCoord -} /* sqlite3.c:193140:9 */ +} /* sqlite3.c:196163:9 */ // State vector for the geopoly_group_bbox() aggregate function. -type GeoBBox = GeoBBox1 /* sqlite3.c:193140:24 */ +type GeoBBox = GeoBBox1 /* sqlite3.c:196163:24 */ // Implementation of the geopoly_group_bbox(X) aggregate SQL function. -func geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193150:13: */ +func geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196173:13: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -152925,7 +155440,7 @@ func geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } -func geopolyBBoxFinal(tls *libc.TLS, context uintptr) { /* sqlite3.c:193173:13: */ +func geopolyBBoxFinal(tls *libc.TLS, context uintptr) { /* sqlite3.c:196196:13: */ var p uintptr var pBBox uintptr pBBox = Xsqlite3_aggregate_context(tls, context, 0) @@ -152952,7 +155467,7 @@ func geopolyBBoxFinal(tls *libc.TLS, context uintptr) { /* sqlite3.c:193173:13: // // The left-most coordinate min(x1,x2) is not considered to be part of // the line segment for the purposes of this analysis. -func pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 float64, x2 float64, y2 float64) int32 { /* sqlite3.c:193203:12: */ +func pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 float64, x2 float64, y2 float64) int32 { /* sqlite3.c:196226:12: */ var y float64 if (x0 == x1) && (y0 == y1) { return 2 @@ -152993,7 +155508,7 @@ func pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 floa // Return +2 if point X,Y is within polygon P. // Return +1 if point X,Y is on the polygon boundary. // Return 0 if point X,Y is outside the polygon -func geopolyContainsPointFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193234:13: */ +func geopolyContainsPointFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196257:13: */ var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) var x0 float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) var y0 float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) @@ -153031,7 +155546,7 @@ func geopolyContainsPointFunc(tls *libc.TLS, context uintptr, argc int32, argv u // Return +1 if P2 is contained within P1 // Return 0 if any part of P2 is on the outside of P1 // -func geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193277:13: */ +func geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196300:13: */ var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) var p2 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0)) if (p1 != 0) && (p2 != 0) { @@ -153063,10 +155578,10 @@ type GeoEvent1 = struct { _ [4]byte FpSeg uintptr FpNext uintptr -} /* sqlite3.c:193297:9 */ +} /* sqlite3.c:196320:9 */ // Objects used by the overlap algorihm. -type GeoEvent = GeoEvent1 /* sqlite3.c:193297:25 */ +type GeoEvent = GeoEvent1 /* sqlite3.c:196320:25 */ type GeoSegment1 = struct { FC float64 FB float64 @@ -153077,20 +155592,20 @@ type GeoSegment1 = struct { Fidx uint32 _ [4]byte FpNext uintptr -} /* sqlite3.c:193297:9 */ +} /* sqlite3.c:196320:9 */ -type GeoSegment = GeoSegment1 /* sqlite3.c:193298:27 */ +type GeoSegment = GeoSegment1 /* sqlite3.c:196321:27 */ type GeoOverlap1 = struct { FaEvent uintptr FaSegment uintptr FnEvent int32 FnSegment int32 -} /* sqlite3.c:193299:9 */ +} /* sqlite3.c:196322:9 */ -type GeoOverlap = GeoOverlap1 /* sqlite3.c:193299:27 */ +type GeoOverlap = GeoOverlap1 /* sqlite3.c:196322:27 */ // Add a single segment and its associated events. -func geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 GeoCoord, y0 GeoCoord, x1 GeoCoord, y1 GeoCoord, side uint8, idx uint32) { /* sqlite3.c:193324:13: */ +func geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 GeoCoord, y0 GeoCoord, x1 GeoCoord, y1 GeoCoord, side uint8, idx uint32) { /* sqlite3.c:196347:13: */ var pSeg uintptr var pEvent uintptr if x0 == x1 { @@ -153124,7 +155639,7 @@ func geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 GeoCoord, y0 GeoCoord, x1 } // Insert all segments and events for polygon pPoly. -func geopolyAddSegments(tls *libc.TLS, p uintptr, pPoly uintptr, side uint8) { /* sqlite3.c:193368:13: */ +func geopolyAddSegments(tls *libc.TLS, p uintptr, pPoly uintptr, side uint8) { /* sqlite3.c:196391:13: */ var i uint32 var x uintptr for i = uint32(0); i < (uint32((*GeoPoly)(unsafe.Pointer(pPoly)).FnVertex) - uint32(1)); i++ { @@ -153136,7 +155651,7 @@ func geopolyAddSegments(tls *libc.TLS, p uintptr, pPoly uintptr, side uint8) { / } // Merge two lists of sorted events by X coordinate -func geopolyEventMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:193386:17: */ +func geopolyEventMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:196409:17: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -153166,7 +155681,7 @@ func geopolyEventMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { / } // Sort an array of nEvent event objects into a list. -func geopolySortEventsByX(tls *libc.TLS, aEvent uintptr, nEvent int32) uintptr { /* sqlite3.c:193408:17: */ +func geopolySortEventsByX(tls *libc.TLS, aEvent uintptr, nEvent int32) uintptr { /* sqlite3.c:196431:17: */ bp := tls.Alloc(400) defer tls.Free(400) @@ -153196,7 +155711,7 @@ func geopolySortEventsByX(tls *libc.TLS, aEvent uintptr, nEvent int32) uintptr { } // Merge two lists of sorted segments by Y, and then by C. -func geopolySegmentMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:193433:19: */ +func geopolySegmentMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:196456:19: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -153231,7 +155746,7 @@ func geopolySegmentMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { // Sort a list of GeoSegments in order of increasing Y and in the event of // a tie, increasing C (slope). -func geopolySortSegmentsByYAndC(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:193458:19: */ +func geopolySortSegmentsByYAndC(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:196481:19: */ bp := tls.Alloc(400) defer tls.Free(400) @@ -153261,7 +155776,7 @@ func geopolySortSegmentsByYAndC(tls *libc.TLS, pList uintptr) uintptr { /* sqlit } // Determine the overlap between two polygons -func geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:193484:12: */ +func geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:196507:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -153300,7 +155815,7 @@ __1: geopolyAddSegments(tls, p, p1, uint8(1)) geopolyAddSegments(tls, p, p2, uint8(2)) pThisEvent = geopolySortEventsByX(tls, (*GeoOverlap)(unsafe.Pointer(p)).FaEvent, (*GeoOverlap)(unsafe.Pointer(p)).FnEvent) - if (*GeoEvent)(unsafe.Pointer(pThisEvent)).Fx == 0.0 { + if (pThisEvent != 0) && ((*GeoEvent)(unsafe.Pointer(pThisEvent)).Fx == 0.0) { rX = -1.0 } else { rX = 0.0 @@ -153488,7 +156003,7 @@ geopolyOverlapDone: // 3 P2 is completely contained within P1 // 4 P1 and P2 are the same polygon // NULL Either P1 or P2 or both are not valid polygons -func geopolyOverlapFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193607:13: */ +func geopolyOverlapFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196630:13: */ var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) var p2 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0)) if (p1 != 0) && (p2 != 0) { @@ -153504,7 +156019,7 @@ func geopolyOverlapFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr } // Enable or disable debugging output -func geopolyDebugFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193629:13: */ +func geopolyDebugFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196652:13: */ } // This function is the implementation of both the xConnect and xCreate @@ -153514,7 +156029,7 @@ func geopolyDebugFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) // argv[1] -> database name // argv[2] -> table name // argv[...] -> column names... -func geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:193648:12: */ +func geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:196671:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -153544,7 +156059,7 @@ __1: (*Rtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&rtreeModule)) (*Rtree)(unsafe.Pointer(pRtree)).FzDb = (pRtree + 1*968) (*Rtree)(unsafe.Pointer(pRtree)).FzName = ((*Rtree)(unsafe.Pointer(pRtree)).FzDb + uintptr((nDb + int64(1)))) - (*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = RTREE_COORD_REAL32 + (*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = U8(RTREE_COORD_REAL32) (*Rtree)(unsafe.Pointer(pRtree)).FnDim = U8(2) (*Rtree)(unsafe.Pointer(pRtree)).FnDim2 = U8(4) libc.Xmemcpy(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(nDb)) @@ -153554,7 +156069,7 @@ __1: // that is successful, call sqlite3_declare_vtab() to configure // the r-tree table schema. pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, ts+24767 /* "CREATE TABLE x(_..." */, 0) + Xsqlite3_str_appendf(tls, pSql, ts+25291 /* "CREATE TABLE x(_..." */, 0) (*Rtree)(unsafe.Pointer(pRtree)).FnAux = U8(1) // Add one for _shape (*Rtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = U8(1) // The _shape column is always not-null ii = 3 @@ -153563,7 +156078,7 @@ __2: goto __4 } (*Rtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, ts+24789 /* ",%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, ts+25313 /* ",%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto __3 __3: ii++ @@ -153571,7 +156086,7 @@ __3: goto __4 __4: ; - Xsqlite3_str_appendf(tls, pSql, ts+23856 /* ");" */, 0) + Xsqlite3_str_appendf(tls, pSql, ts+24380 /* ");" */, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(!(zSql != 0)) { goto __5 @@ -153582,7 +156097,7 @@ __5: if !(SQLITE_OK != (libc.AssignInt32(&rc, Xsqlite3_declare_vtab(tls, db, zSql)))) { goto __7 } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) __7: ; __6: @@ -153608,7 +156123,7 @@ __9: if !(rc != 0) { goto __10 } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail __10: ; @@ -153629,12 +156144,12 @@ __11: } // GEOPOLY virtual table module xCreate method. -func geopolyCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:193732:12: */ +func geopolyCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:196755:12: */ return geopolyInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 1) } // GEOPOLY virtual table module xConnect method. -func geopolyConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:193745:12: */ +func geopolyConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:196768:12: */ return geopolyInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 0) } @@ -153648,7 +156163,7 @@ func geopolyConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv ui // 3 search for objects overlapping the same bounding box // that contains polygon argv[0] // 4 full table scan -func geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:193768:12: */ +func geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:196791:12: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -153696,7 +156211,7 @@ func geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uint // Always returns pCsr->sPoint *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8 /* iNode */)) - (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(PARTLY_WITHIN) *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)), iRowid, bp+16 /* &iCell */) (*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = U8(*(*int32)(unsafe.Pointer(bp + 16 /* iCell */))) @@ -153787,7 +156302,7 @@ __12: ; (*RtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1) (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0) - (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(PARTLY_WITHIN) *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) = uintptr(0) @@ -153815,7 +156330,7 @@ geopoly_filter_end: // 3 "rtree" R-tree within query using geopoly_within() // 4 "fullscan" full-table scan. // ------------------------------------------------ -func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:193899:12: */ +func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:196922:12: */ var ii int32 var iRowidTerm int32 = -1 var iFuncTerm int32 = -1 @@ -153841,7 +156356,7 @@ func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* s if iRowidTerm >= 0 { (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 1 - (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 13865 /* "rowid" */ + (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 14294 /* "rowid" */ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8)).FargvIndex = 1 (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8)).Fomit = uint8(1) (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 30.0 @@ -153851,7 +156366,7 @@ func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* s } if iFuncTerm >= 0 { (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 24793 /* "rtree" */ + (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 25317 /* "rtree" */ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8)).FargvIndex = 1 (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8)).Fomit = uint8(0) (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 300.0 @@ -153859,14 +156374,14 @@ func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* s return SQLITE_OK } (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 4 - (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 24799 /* "fullscan" */ + (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 25323 /* "fullscan" */ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 3000000.0 (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK } // GEOPOLY virtual table module xColumn method. -func geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:193951:12: */ +func geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:196974:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -153931,7 +156446,7 @@ func geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* // argv[1] = rowid after the change. Never NULL // argv[2] = new value for _shape // argv[3] = new value for first application-defined column.... -func geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:194006:12: */ +func geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:197029:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -153997,7 +156512,7 @@ __1: if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == SQLITE_ERROR) { goto __4 } - (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+24808 /* "_shape does not ..." */, 0) + (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+25332 /* "_shape does not ..." */, 0) __4: ; goto geopoly_update_end @@ -154141,15 +156656,15 @@ geopoly_update_end: // Report that geopoly_overlap() is an overloaded function suitable // for use in xBestIndex. -func geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:194142:12: */ - if Xsqlite3_stricmp(tls, zName, ts+24848 /* "geopoly_overlap" */) == 0 { +func geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:197165:12: */ + if Xsqlite3_stricmp(tls, zName, ts+25372 /* "geopoly_overlap" */) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{geopolyOverlapFunc})) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return SQLITE_INDEX_CONSTRAINT_FUNCTION } - if Xsqlite3_stricmp(tls, zName, ts+24864 /* "geopoly_within" */) == 0 { + if Xsqlite3_stricmp(tls, zName, ts+25388 /* "geopoly_within" */) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{geopolyWithinFunc})) @@ -154182,9 +156697,9 @@ var geopolyModule = Sqlite3_module{ FxRename: 0, // xRename - rename the table FxSavepoint: 0, // xRollbackTo FxShadowName: 0, // xShadowName -} /* sqlite3.c:194163:23 */ +} /* sqlite3.c:197186:23 */ -func sqlite3_geopoly_init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:194190:12: */ +func sqlite3_geopoly_init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:197213:12: */ var rc int32 = SQLITE_OK var i int32 for i = 0; (uint64(i) < (uint64(unsafe.Sizeof(aFunc1)) / uint64(unsafe.Sizeof(struct { @@ -154214,7 +156729,7 @@ func sqlite3_geopoly_init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:194190 uintptr(0), aAgg1[i].FxStep, aAgg1[i].FxFinal) } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, ts+24879 /* "geopoly" */, uintptr(unsafe.Pointer(&geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, ts+25403 /* "geopoly" */, uintptr(unsafe.Pointer(&geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -154226,26 +156741,26 @@ var aFunc1 = [12]struct { _ [6]byte FzName uintptr }{ - {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 24887 /* "geopoly_area" */}, - {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 24900 /* "geopoly_blob" */}, - {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 24913 /* "geopoly_json" */}, - {FxFunc: 0, FnArg: int8(-1), FbPure: uint8(1), FzName: ts + 24926 /* "geopoly_svg" */}, - {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 24864 /* "geopoly_within" */}, - {FxFunc: 0, FnArg: int8(3), FbPure: uint8(1), FzName: ts + 24938 /* "geopoly_contains..." */}, - {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 24848 /* "geopoly_overlap" */}, - {FxFunc: 0, FnArg: int8(1), FzName: ts + 24961 /* "geopoly_debug" */}, - {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 24975 /* "geopoly_bbox" */}, - {FxFunc: 0, FnArg: int8(7), FbPure: uint8(1), FzName: ts + 24988 /* "geopoly_xform" */}, - {FxFunc: 0, FnArg: int8(4), FbPure: uint8(1), FzName: ts + 25002 /* "geopoly_regular" */}, - {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 25018 /* "geopoly_ccw" */}, -} /* sqlite3.c:194197:5 */ + {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 25411 /* "geopoly_area" */}, + {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 25424 /* "geopoly_blob" */}, + {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 25437 /* "geopoly_json" */}, + {FxFunc: 0, FnArg: int8(-1), FbPure: uint8(1), FzName: ts + 25450 /* "geopoly_svg" */}, + {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 25388 /* "geopoly_within" */}, + {FxFunc: 0, FnArg: int8(3), FbPure: uint8(1), FzName: ts + 25462 /* "geopoly_contains..." */}, + {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 25372 /* "geopoly_overlap" */}, + {FxFunc: 0, FnArg: int8(1), FzName: ts + 25485 /* "geopoly_debug" */}, + {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 25499 /* "geopoly_bbox" */}, + {FxFunc: 0, FnArg: int8(7), FbPure: uint8(1), FzName: ts + 25512 /* "geopoly_xform" */}, + {FxFunc: 0, FnArg: int8(4), FbPure: uint8(1), FzName: ts + 25526 /* "geopoly_regular" */}, + {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 25542 /* "geopoly_ccw" */}, +} /* sqlite3.c:197220:5 */ var aAgg1 = [1]struct { FxStep uintptr FxFinal uintptr FzName uintptr }{ - {FxStep: 0, FxFinal: 0, FzName: ts + 25030 /* "geopoly_group_bb..." */}, -} /* sqlite3.c:194215:5 */ + {FxStep: 0, FxFinal: 0, FzName: ts + 25554 /* "geopoly_group_bb..." */}, +} /* sqlite3.c:197238:5 */ //************* End of geopoly.c ******************************************** //************* Continuing where we left off in rtree.c ********************* @@ -154253,30 +156768,30 @@ var aAgg1 = [1]struct { // Register the r-tree module with database handle db. This creates the // virtual table module "rtree" and the debugging/analysis scalar // function "rtreenode". -func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:194250:20: */ +func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:197273:20: */ var utf8 int32 = SQLITE_UTF8 var rc int32 - rc = Xsqlite3_create_function(tls, db, ts+25049 /* "rtreenode" */, 2, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + rc = Xsqlite3_create_function(tls, db, ts+25573 /* "rtreenode" */, 2, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rtreenode})), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, ts+25059 /* "rtreedepth" */, 1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + rc = Xsqlite3_create_function(tls, db, ts+25583 /* "rtreedepth" */, 1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rtreedepth})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, ts+25070 /* "rtreecheck" */, -1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + rc = Xsqlite3_create_function(tls, db, ts+25594 /* "rtreecheck" */, -1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rtreecheck})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - var c uintptr = RTREE_COORD_REAL32 - rc = Xsqlite3_create_module_v2(tls, db, ts+24793 /* "rtree" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0)) + var c uintptr = uintptr(RTREE_COORD_REAL32) + rc = Xsqlite3_create_module_v2(tls, db, ts+25317 /* "rtree" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { - var c uintptr = RTREE_COORD_INT32 - rc = Xsqlite3_create_module_v2(tls, db, ts+25081 /* "rtree_i32" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0)) + var c uintptr = uintptr(RTREE_COORD_INT32) + rc = Xsqlite3_create_module_v2(tls, db, ts+25605 /* "rtree_i32" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { rc = sqlite3_geopoly_init(tls, db) @@ -154290,7 +156805,7 @@ func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:194250:20 // or sqlite3_rtree_query_callback(). In other words, this routine is the // destructor for an RtreeGeomCallback objecct. This routine is called when // the corresponding SQL function is deleted. -func rtreeFreeCallback(tls *libc.TLS, p uintptr) { /* sqlite3.c:194289:13: */ +func rtreeFreeCallback(tls *libc.TLS, p uintptr) { /* sqlite3.c:197312:13: */ var pInfo uintptr = p if (*RtreeGeomCallback)(unsafe.Pointer(pInfo)).FxDestructor != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pInfo + 16 /* &.xDestructor */))))(tls, (*RtreeGeomCallback)(unsafe.Pointer(pInfo)).FpContext) @@ -154299,7 +156814,7 @@ func rtreeFreeCallback(tls *libc.TLS, p uintptr) { /* sqlite3.c:194289:13: */ } // This routine frees the BLOB that is returned by geomCallback(). -func rtreeMatchArgFree(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:194298:13: */ +func rtreeMatchArgFree(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:197321:13: */ var i int32 var p uintptr = pArg for i = 0; i < (*RtreeMatchArg)(unsafe.Pointer(p)).FnParam; i++ { @@ -154320,7 +156835,7 @@ func rtreeMatchArgFree(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:194298:13: */ // The R-Tree MATCH operator will read the returned BLOB, deserialize // the RtreeMatchArg object, and use the RtreeMatchArg object to figure // out which elements of the R-Tree should be returned by the query. -func geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* sqlite3.c:194321:13: */ +func geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* sqlite3.c:197344:13: */ var pGeomCtx uintptr = Xsqlite3_user_data(tls, ctx) var pBlob uintptr var nBlob Sqlite3_int64 @@ -154348,13 +156863,13 @@ func geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* sql Xsqlite3_result_error_nomem(tls, ctx) rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, ts+22369 /* "RtreeMatchArg" */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{rtreeMatchArgFree}))) + Xsqlite3_result_pointer(tls, ctx, pBlob, ts+22893 /* "RtreeMatchArg" */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{rtreeMatchArgFree}))) } } } // Register a new geometry function for use with the r-tree MATCH operator. -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) int32 { /* sqlite3.c:194359:16: */ +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) int32 { /* sqlite3.c:197382:16: */ var pGeomCtx uintptr // Context object for new user-function // Allocate and populate the context object. @@ -154374,7 +156889,7 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, // Register a new 2nd-generation geometry function for use with the // r-tree MATCH operator. -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) int32 { /* sqlite3.c:194383:16: */ +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) int32 { /* sqlite3.c:197406:16: */ var pGeomCtx uintptr // Context object for new user-function // Allocate and populate the context object. @@ -154827,7 +157342,7 @@ type sqlite3rbu = struct { FnRbu int32 _ [4]byte FpRbuFd uintptr -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ //************* End of rtree.c ********************************************** //************* Begin file icu.c ******************************************** @@ -155228,7 +157743,7 @@ type sqlite3rbu = struct { // #include "sqlite3.h" ** Required for error code definitions ** -type Sqlite3rbu = sqlite3rbu /* sqlite3.c:195610:27 */ +type Sqlite3rbu = sqlite3rbu /* sqlite3.c:198633:27 */ //************* End of sqlite3rbu.h ***************************************** //************* Continuing where we left off in sqlite3rbu.c **************** @@ -155290,7 +157805,7 @@ type Sqlite3rbu = sqlite3rbu /* sqlite3.c:195610:27 */ type RbuFrame1 = struct { FiDbPage U32 FiWalFrame U32 -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ //************* End of sqlite3rbu.h ***************************************** //************* Continuing where we left off in sqlite3rbu.c **************** @@ -155349,7 +157864,7 @@ type RbuFrame1 = struct { // Only valid if STAGE==1. The RBU database name of the table // currently being read. -type RbuFrame = RbuFrame1 /* sqlite3.c:196034:25 */ +type RbuFrame = RbuFrame1 /* sqlite3.c:199057:25 */ type RbuObjIter1 = struct { FpTblIter uintptr FpIdxIter uintptr @@ -155381,9 +157896,9 @@ type RbuObjIter1 = struct { FaIdxCol uintptr FzIdxSql uintptr FpRbuUpdate uintptr -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ -type RbuObjIter = RbuObjIter1 /* sqlite3.c:196035:27 */ +type RbuObjIter = RbuObjIter1 /* sqlite3.c:199058:27 */ type RbuState1 = struct { FeStage int32 _ [4]byte @@ -155398,16 +157913,16 @@ type RbuState1 = struct { _ [4]byte FiOalSz I64 FnPhaseOneStep I64 -} /* sqlite3.c:196036:9 */ +} /* sqlite3.c:199059:9 */ -type RbuState = RbuState1 /* sqlite3.c:196036:25 */ +type RbuState = RbuState1 /* sqlite3.c:199059:25 */ type RbuSpan1 = struct { FzSpan uintptr FnSpan int32 _ [4]byte -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ -type RbuSpan = RbuSpan1 /* sqlite3.c:196037:24 */ +type RbuSpan = RbuSpan1 /* sqlite3.c:199060:24 */ type rbu_vfs = struct { Fbase Sqlite3_vfs FpRealVfs uintptr @@ -155415,9 +157930,9 @@ type rbu_vfs = struct { FpRbu uintptr FpMain uintptr FpMainRbu uintptr -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ -type Rbu_vfs = rbu_vfs /* sqlite3.c:196038:24 */ +type Rbu_vfs = rbu_vfs /* sqlite3.c:199061:24 */ type rbu_file = struct { Fbase Sqlite3_file FpReal uintptr @@ -155436,16 +157951,16 @@ type rbu_file = struct { FpWalFd uintptr FpMainNext uintptr FpMainRbuNext uintptr -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ -type Rbu_file = rbu_file /* sqlite3.c:196039:25 */ +type Rbu_file = rbu_file /* sqlite3.c:199062:25 */ type RbuUpdateStmt1 = struct { FzMask uintptr FpUpdate uintptr FpNext uintptr -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ -type RbuUpdateStmt = RbuUpdateStmt1 /* sqlite3.c:196040:30 */ +type RbuUpdateStmt = RbuUpdateStmt1 /* sqlite3.c:199063:30 */ // True for an RBU vacuum handle, or false otherwise. @@ -155464,7 +157979,7 @@ type RbuUpdateStmt = RbuUpdateStmt1 /* sqlite3.c:196040:30 */ // finished, leave *pz pointing to the first character past the end of // the integer. The *pLen parameter holds the length of the string // in *pz and is decremented once for each character in the integer. -func rbuDeltaGetInt(tls *libc.TLS, pz uintptr, pLen uintptr) uint32 { /* sqlite3.c:196330:21: */ +func rbuDeltaGetInt(tls *libc.TLS, pz uintptr, pLen uintptr) uint32 { /* sqlite3.c:199353:21: */ var v uint32 = uint32(0) var c int32 var z uintptr = *(*uintptr)(unsafe.Pointer(pz)) @@ -155487,7 +158002,7 @@ var zValue = [128]int8{ int8(25), int8(26), int8(27), int8(28), int8(29), int8(30), int8(31), int8(32), int8(33), int8(34), int8(35), int8(-1), int8(-1), int8(-1), int8(-1), int8(36), int8(-1), int8(37), int8(38), int8(39), int8(40), int8(41), int8(42), int8(43), int8(44), int8(45), int8(46), int8(47), int8(48), int8(49), int8(50), int8(51), int8(52), int8(53), int8(54), int8(55), int8(56), int8(57), int8(58), int8(59), int8(60), int8(61), int8(62), int8(-1), int8(-1), int8(-1), int8(63), int8(-1), -} /* sqlite3.c:196331:28 */ +} /* sqlite3.c:199354:28 */ // Apply a delta. // @@ -155507,7 +158022,7 @@ var zValue = [128]int8{ // // Refer to the delta_create() documentation above for a description // of the delta file format. -func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, lenDelta int32, zOut uintptr) int32 { /* sqlite3.c:196411:12: */ +func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, lenDelta int32, zOut uintptr) int32 { /* sqlite3.c:199434:12: */ bp := tls.Alloc(12) defer tls.Free(12) *(*uintptr)(unsafe.Pointer(bp)) = zDelta @@ -155597,7 +158112,7 @@ func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, le return -1 } -func rbuDeltaOutputSize(tls *libc.TLS, zDelta uintptr, lenDelta int32) int32 { /* sqlite3.c:196497:12: */ +func rbuDeltaOutputSize(tls *libc.TLS, zDelta uintptr, lenDelta int32) int32 { /* sqlite3.c:199520:12: */ bp := tls.Alloc(12) defer tls.Free(12) *(*uintptr)(unsafe.Pointer(bp)) = zDelta @@ -155622,7 +158137,7 @@ func rbuDeltaOutputSize(tls *libc.TLS, zDelta uintptr, lenDelta int32) int32 { / // arguments must be passed to this function. The first is the blob to // patch and the second the patch to apply. If no error occurs, this // function returns the patched blob. -func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196519:13: */ +func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:199542:13: */ var aDelta uintptr var nDelta int32 var aOrig uintptr @@ -155639,7 +158154,7 @@ func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // Figure out the size of the output nOut = rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, ts+25091 /* "corrupt fossil d..." */, -1) + Xsqlite3_result_error(tls, context, ts+25615 /* "corrupt fossil d..." */, -1) return } @@ -155650,7 +158165,7 @@ func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr nOut2 = rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, ts+25091 /* "corrupt fossil d..." */, -1) + Xsqlite3_result_error(tls, context, ts+25615 /* "corrupt fossil d..." */, -1) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) } @@ -155665,13 +158180,13 @@ func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // an SQLite error code. Additionally, set output variable *pzErrmsg to // point to a buffer containing an error message. It is the responsibility // of the caller to (eventually) free this buffer using sqlite3_free(). -func prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:196572:12: */ +func prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:199595:12: */ bp := tls.Alloc(8) defer tls.Free(8) var rc int32 = Xsqlite3_prepare_v2(tls, db, zSql, -1, ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -155683,13 +158198,13 @@ func prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg // If an error has occurred, then set *pzErrmsg to point to a buffer // containing an error message. It is the responsibility of the caller // to eventually free this buffer using sqlite3_free(). -func resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:196594:12: */ +func resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:199617:12: */ bp := tls.Alloc(8) defer tls.Free(8) var rc int32 = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -155707,7 +158222,7 @@ func resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) int32 // // If argument zSql is NULL, this function assumes that an OOM has occurred. // In this case SQLITE_NOMEM is returned and *ppStmt set to NULL. -func prepareFreeAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:196617:12: */ +func prepareFreeAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:199640:12: */ var rc int32 if zSql == uintptr(0) { @@ -155722,7 +158237,7 @@ func prepareFreeAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErr // Free the RbuObjIter.azTblCol[] and RbuObjIter.abTblPk[] arrays allocated // by an earlier call to rbuObjIterCacheTableInfo(). -func rbuObjIterFreeCols(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:196639:13: */ +func rbuObjIterFreeCols(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:199662:13: */ var i int32 for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))) @@ -155740,7 +158255,7 @@ func rbuObjIterFreeCols(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:196639:13: // Finalize all statements and free all allocations that are specific to // the current object (table/index pair). -func rbuObjIterClearStatements(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:196659:13: */ +func rbuObjIterClearStatements(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:199682:13: */ var pUp uintptr Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect) @@ -155770,7 +158285,7 @@ func rbuObjIterClearStatements(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:1966 // Clean up any resources allocated as part of the iterator object passed // as the only argument. -func rbuObjIterFinalize(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:196691:13: */ +func rbuObjIterFinalize(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:199714:13: */ rbuObjIterClearStatements(tls, pIter) Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter) Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter) @@ -155784,7 +158299,7 @@ func rbuObjIterFinalize(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:196691:13: // pointing to the next entry. Otherwise, an error code and message is // left in the RBU handle passed as the first argument. A copy of the // error code is returned. -func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:196707:12: */ +func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:199730:12: */ var rc int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc if rc == SQLITE_OK { @@ -155793,7 +158308,7 @@ func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3. if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+25112 /* "DROP TRIGGER IF ..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + ts+25636 /* "DROP TRIGGER IF ..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } if rc == SQLITE_OK { @@ -155865,7 +158380,7 @@ func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3. // // For an rbu vacuum handle, a copy of the first argument is returned if // the second argument is either missing or 0 (not a view). -func rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3.c:196787:13: */ +func rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3.c:199810:13: */ var p uintptr = Xsqlite3_user_data(tls, pCtx) var zIn uintptr @@ -155877,7 +158392,7 @@ func rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -1, uintptr(0)) } } else { - if (libc.Xstrlen(tls, zIn) > uint64(4)) && (libc.Xmemcmp(tls, ts+22282 /* "data" */, zIn, uint64(4)) == 0) { + if (libc.Xstrlen(tls, zIn) > uint64(4)) && (libc.Xmemcmp(tls, ts+22806 /* "data" */, zIn, uint64(4)) == 0) { var i int32 for i = 4; (int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) <= '9'); i++ { } @@ -155895,7 +158410,7 @@ func rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { // pointing to the first entry. Otherwise, an error code and message is // left in the RBU handle passed as the first argument. A copy of the // error code is returned. -func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:196823:12: */ +func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:199846:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -155905,9 +158420,9 @@ func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3 rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter /* &.pTblIter */), (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+25283 /* "SELECT rbu_targe..." */, libc.VaList(bp, func() uintptr { + ts+25807 /* "SELECT rbu_targe..." */, libc.VaList(bp, func() uintptr { if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - return ts + 25433 /* "AND rootpage!=0 ..." */ + return ts + 25957 /* "AND rootpage!=0 ..." */ } return ts + 703 /* "" */ }()))) @@ -155915,7 +158430,7 @@ func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3 if rc == SQLITE_OK { rc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 8 /* &.pIdxIter */), (p + 64 /* &.zErrmsg */), - ts+25474 /* "SELECT name, roo..." */) + ts+25998 /* "SELECT name, roo..." */) } (*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = 1 @@ -155930,7 +158445,7 @@ func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3 // than SQLITE_OK), then this function returns NULL without modifying the // stored error code. In this case it still calls sqlite3_free() on any // printf() parameters associated with %z conversions. -func rbuMPrintf(tls *libc.TLS, p uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:196858:13: */ +func rbuMPrintf(tls *libc.TLS, p uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:199881:13: */ var zSql uintptr = uintptr(0) var ap Va_list _ = ap @@ -155956,7 +158471,7 @@ func rbuMPrintf(tls *libc.TLS, p uintptr, zFmt uintptr, va uintptr) uintptr { /* // If an error occurs, an error code and error message is stored in the // RBU handle. If an error has already occurred when this function is // called, it is a no-op. -func rbuMPrintfExec(tls *libc.TLS, p uintptr, db uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:196883:12: */ +func rbuMPrintfExec(tls *libc.TLS, p uintptr, db uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:199906:12: */ var ap Va_list _ = ap var zSql uintptr @@ -155982,7 +158497,7 @@ func rbuMPrintfExec(tls *libc.TLS, p uintptr, db uintptr, zFmt uintptr, va uintp // error has already occurred when this function is called, return NULL // immediately without attempting the allocation or modifying the stored // error code. -func rbuMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:196910:13: */ +func rbuMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:199933:13: */ var pRet uintptr = uintptr(0) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -155999,7 +158514,7 @@ func rbuMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlit // Allocate and zero the pIter->azTblCol[] and abTblPk[] arrays so that // there is room for at least nCol elements. If an OOM occurs, store an // error code in the RBU handle passed as the first argument. -func rbuAllocateIterArrays(tls *libc.TLS, p uintptr, pIter uintptr, nCol int32) { /* sqlite3.c:196930:13: */ +func rbuAllocateIterArrays(tls *libc.TLS, p uintptr, pIter uintptr, nCol int32) { /* sqlite3.c:199953:13: */ var nByte Sqlite3_int64 = (Sqlite3_int64((((uint64(2) * uint64(unsafe.Sizeof(uintptr(0)))) + uint64(unsafe.Sizeof(int32(0)))) + (uint64(3) * uint64(unsafe.Sizeof(U8(0))))) * uint64(nCol))) var azNew uintptr @@ -156022,7 +158537,7 @@ func rbuAllocateIterArrays(tls *libc.TLS, p uintptr, pIter uintptr, nCol int32) // If an OOM condition is encountered when attempting to allocate memory, // output variable (*pRc) is set to SQLITE_NOMEM before returning. Otherwise, // if the allocation succeeds, (*pRc) is left unchanged. -func rbuStrndup(tls *libc.TLS, zStr uintptr, pRc uintptr) uintptr { /* sqlite3.c:196955:13: */ +func rbuStrndup(tls *libc.TLS, zStr uintptr, pRc uintptr) uintptr { /* sqlite3.c:199978:13: */ var zRet uintptr = uintptr(0) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { @@ -156045,7 +158560,7 @@ func rbuStrndup(tls *libc.TLS, zStr uintptr, pRc uintptr) uintptr { /* sqlite3.c // If the sqlite3_finalize() call indicates that an error occurs, and the // rbu handle error code is not already set, set the error code and error // message accordingly. -func rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { /* sqlite3.c:196980:13: */ +func rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { /* sqlite3.c:200003:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -156053,7 +158568,7 @@ func rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { /* sqlite3.c:196980: var rc int32 = Xsqlite3_finalize(tls, pStmt) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (rc != SQLITE_OK) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, db))) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, db))) } } @@ -156095,7 +158610,7 @@ func rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { /* sqlite3.c:196980: // }else{ // return RBU_PK_NONE // } -func rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnum uintptr, piPk uintptr) { /* sqlite3.c:197028:13: */ +func rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnum uintptr, piPk uintptr) { /* sqlite3.c:200051:13: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -156116,7 +158631,7 @@ func rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnum (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */), (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+25599 /* "SELECT (sql LIKE..." */, libc.VaList(bp, zTab))) + ts+26123 /* "SELECT (sql LIKE..." */, libc.VaList(bp, zTab))) if !(((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK) || (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */))) != SQLITE_ROW)) { goto __1 } @@ -156134,7 +158649,7 @@ __2: *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */)), 1) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */ + 1*8), (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+25680 /* "PRAGMA index_lis..." */, libc.VaList(bp+8, zTab))) + Xsqlite3_mprintf(tls, ts+26204 /* "PRAGMA index_lis..." */, libc.VaList(bp+8, zTab))) if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0) { goto __3 } @@ -156152,7 +158667,7 @@ __4: } (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */ + 2*8), (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+25701 /* "SELECT rootpage ..." */, libc.VaList(bp+16, zIdx))) + ts+26225 /* "SELECT rootpage ..." */, libc.VaList(bp+16, zIdx))) if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) { goto __7 } @@ -156176,7 +158691,7 @@ __5: ; (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */ + 3*8), (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+25752 /* "PRAGMA table_inf..." */, libc.VaList(bp+24, zTab))) + Xsqlite3_mprintf(tls, ts+26276 /* "PRAGMA table_inf..." */, libc.VaList(bp+24, zTab))) if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) { goto __10 } @@ -156211,11 +158726,12 @@ __15: goto __14 goto __16 __16: + } // This is a helper function for rbuObjIterCacheTableInfo(). It populates // the pIter->abIndexed[] array. -func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:197112:13: */ +func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:200135:13: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -156225,7 +158741,7 @@ func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, (uint64(unsafe.Sizeof(U8(0))) * uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol))) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+16 /* &pList */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+25773 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + Xsqlite3_mprintf(tls, ts+26297 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*RbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 @@ -156240,7 +158756,7 @@ func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq libc.Xmemset(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, 0x01, (uint64(unsafe.Sizeof(U8(0))) * uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol))) } (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+24 /* &pXInfo */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+25801 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx))) + Xsqlite3_mprintf(tls, ts+26325 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx))) for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pXInfo */)))) { var iCid int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pXInfo */)), 1) if iCid >= 0 { @@ -156273,7 +158789,7 @@ func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq // Return SQLITE_OK if successful, or an SQLite error code otherwise. If // an error does occur, an error code and error message are also left in // the RBU handle. -func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:197166:12: */ +func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:200189:12: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -156290,7 +158806,7 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { / rbuTableType(tls, p, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, (pIter + 72 /* &.eType */), bp+56 /* &iTnum */, (pIter + 108 /* &.iPkTnum */)) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+16983 /* "no such table: %..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+17394 /* "no such table: %..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc @@ -156303,18 +158819,18 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { / // of the input table. Ignore any input table columns that begin with // "rbu_". (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+64 /* &pStmt */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+25830 /* "SELECT * FROM '%..." */, libc.VaList(bp+8, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + Xsqlite3_mprintf(tls, ts+26354 /* "SELECT * FROM '%..." */, libc.VaList(bp+8, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */))) rbuAllocateIterArrays(tls, p, pIter, nCol) } for i = 0; ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (i < nCol); i++ { var zName uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)), i) - if Xsqlite3_strnicmp(tls, ts+25849 /* "rbu_" */, zName, 4) != 0 { + if Xsqlite3_strnicmp(tls, ts+26373 /* "rbu_" */, zName, 4) != 0 { var zCopy uintptr = rbuStrndup(tls, zName, (p + 56 /* &.rc */)) *(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(libc.PostIncInt32(&(*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol, 1))*8)) = zCopy - } else if 0 == Xsqlite3_stricmp(tls, ts+25854 /* "rbu_rowid" */, zName) { + } else if 0 == Xsqlite3_stricmp(tls, ts+26378 /* "rbu_rowid" */, zName) { bRbuRowid = 1 } } @@ -156326,12 +158842,12 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { / (bRbuRowid != (libc.Bool32(((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE)))) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, - ts+25864 /* "table %q %s rbu_..." */, libc.VaList(bp+16, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, + ts+26388 /* "table %q %s rbu_..." */, libc.VaList(bp+16, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, func() uintptr { if bRbuRowid != 0 { - return ts + 25893 /* "may not have" */ + return ts + 26417 /* "may not have" */ } - return ts + 25906 /* "requires" */ + return ts + 26430 /* "requires" */ }())) } @@ -156340,7 +158856,7 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { / // aiTblOrder[] arrays at the same time. if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+64 /* &pStmt */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+25915 /* "PRAGMA table_inf..." */, libc.VaList(bp+32, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + Xsqlite3_mprintf(tls, ts+26439 /* "PRAGMA table_inf..." */, libc.VaList(bp+32, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)))) { var zName uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)), 1) @@ -156354,7 +158870,7 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { / } if i == (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+25937, /* "column missing f..." */ + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+26461, /* "column missing f..." */ libc.VaList(bp+40, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName)) } else { var iPk int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)), 5) @@ -156395,7 +158911,7 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { / // This function constructs and returns a pointer to a nul-terminated // string containing some SQL clause or list based on one or more of the // column names currently stored in the pIter->azTblCol[] array. -func rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:197276:13: */ +func rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:200299:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -156404,8 +158920,8 @@ func rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* var i int32 for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { var z uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = rbuMPrintf(tls, p, ts+25964 /* "%z%s\"%w\"" */, libc.VaList(bp, zList, zSep, z)) - zSep = ts + 12447 /* ", " */ + zList = rbuMPrintf(tls, p, ts+26488 /* "%z%s\"%w\"" */, libc.VaList(bp, zList, zSep, z)) + zSep = ts + 12863 /* ", " */ } return zList } @@ -156414,7 +158930,7 @@ func rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* // in order, for the current table. Before each column name, add the text // zPre. After each column name, add the zPost text. Use zSeparator as // the separator text (usually ", "). -func rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, zSeparator uintptr, zPost uintptr) uintptr { /* sqlite3.c:197297:13: */ +func rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, zSeparator uintptr, zPost uintptr) uintptr { /* sqlite3.c:200320:13: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -156426,7 +158942,7 @@ func rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { if int32(*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = rbuMPrintf(tls, p, ts+25973 /* "%z%s%s\"%w\"%s" */, libc.VaList(bp, zRet, zSep, zPre, zCol, zPost)) + zRet = rbuMPrintf(tls, p, ts+26497 /* "%z%s%s\"%w\"%s" */, libc.VaList(bp, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -156456,7 +158972,7 @@ func rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, // // Instead of "?" placeholders, the actual WHERE clauses created by // this function contain literal SQL values. -func rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, zWrite uintptr) uintptr { /* sqlite3.c:197342:13: */ +func rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, zWrite uintptr) uintptr { /* sqlite3.c:200365:13: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -156465,25 +158981,25 @@ func rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, if bRowid != 0 { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+72 /* &pMax */, (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+25986 /* "SELECT max(_rowi..." */, libc.VaList(bp, zWrite, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + ts+26510 /* "SELECT max(_rowi..." */, libc.VaList(bp, zWrite, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)))) { var iMax Sqlite3_int64 = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)), 0) - zRet = rbuMPrintf(tls, p, ts+26018 /* " WHERE _rowid_ >..." */, libc.VaList(bp+16, iMax)) + zRet = rbuMPrintf(tls, p, ts+26542 /* " WHERE _rowid_ >..." */, libc.VaList(bp+16, iMax)) } rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */))) } else { - var zOrder uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+703 /* "" */, ts+12447 /* ", " */, ts+26041 /* " DESC" */) - var zSelect uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+26047 /* "quote(" */, ts+26054 /* "||','||" */, ts+3907 /* ")" */) - var zList uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+703 /* "" */, ts+12447 /* ", " */, ts+703 /* "" */) + var zOrder uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+703 /* "" */, ts+12863 /* ", " */, ts+26565 /* " DESC" */) + var zSelect uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+26571 /* "quote(" */, ts+26578 /* "||','||" */, ts+3935 /* ")" */) + var zList uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+703 /* "" */, ts+12863 /* ", " */, ts+703 /* "" */) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+72 /* &pMax */, (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+26062, /* "SELECT %s FROM \"..." */ + ts+26586, /* "SELECT %s FROM \"..." */ libc.VaList(bp+24, zSelect, zWrite, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)))) { var zVal uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)), 0) - zRet = rbuMPrintf(tls, p, ts+26104 /* " WHERE (%s) > (%..." */, libc.VaList(bp+56, zList, zVal)) + zRet = rbuMPrintf(tls, p, ts+26628 /* " WHERE (%s) > (%..." */, libc.VaList(bp+56, zList, zVal)) } rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */))) } @@ -156515,7 +159031,7 @@ func rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, // If the expression cannot be created, NULL is returned. In this case, // the caller has to use an OFFSET clause to extract only the required // rows from the sourct table, just as it does for an RBU update operation. -func XrbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:197409:6: */ +func XrbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:200432:6: */ bp := tls.Alloc(192) defer tls.Free(192) @@ -156546,7 +159062,7 @@ func XrbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)) = uintptr(0) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+176 /* &pXInfo */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+25801 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + Xsqlite3_mprintf(tls, ts+26325 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) __1: if !(((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */))))) { goto __2 @@ -156583,7 +159099,7 @@ __10: zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) goto __7 __6: - zCol = ts + 26124 /* "_rowid_" */ + zCol = ts + 26648 /* "_rowid_" */ __7: ; goto __5 @@ -156592,13 +159108,13 @@ __4: __5: ; - zLhs = rbuMPrintf(tls, p, ts+26132, /* "%z%s \"%w\" COLLAT..." */ + zLhs = rbuMPrintf(tls, p, ts+26656, /* "%z%s \"%w\" COLLAT..." */ libc.VaList(bp+8, zLhs, zSep, zCol, zCollate)) - zOrder = rbuMPrintf(tls, p, ts+26153, /* "%z%s \"rbu_imp_%d..." */ + zOrder = rbuMPrintf(tls, p, ts+26677, /* "%z%s \"rbu_imp_%d..." */ libc.VaList(bp+40, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = rbuMPrintf(tls, p, ts+26189, /* "%z%s quote(\"rbu_..." */ + zSelect = rbuMPrintf(tls, p, ts+26713, /* "%z%s quote(\"rbu_..." */ libc.VaList(bp+80, zSelect, zSep, iCol, zCol)) - zSep = ts + 12447 /* ", " */ + zSep = ts + 12863 /* ", " */ iCol++ goto __1 __2: @@ -156617,7 +159133,7 @@ __11: *(*uintptr)(unsafe.Pointer(bp + 184 /* pSel */)) = uintptr(0) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+184 /* &pSel */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+26216, /* "SELECT %s FROM \"..." */ + Xsqlite3_mprintf(tls, ts+26740, /* "SELECT %s FROM \"..." */ libc.VaList(bp+112, zSelect, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if !(((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 184 /* pSel */))))) { goto __13 @@ -156636,8 +159152,8 @@ __14: goto __16 __17: ; - zVector = rbuMPrintf(tls, p, ts+26264 /* "%z%s%s" */, libc.VaList(bp+136, zVector, zSep, zQuoted)) - zSep = ts + 12447 /* ", " */ + zVector = rbuMPrintf(tls, p, ts+26788 /* "%z%s%s" */, libc.VaList(bp+136, zVector, zSep, zQuoted)) + zSep = ts + 12863 /* ", " */ goto __15 __15: iCol++ @@ -156649,7 +159165,7 @@ __16: if !(!(bFailed != 0)) { goto __18 } - zRet = rbuMPrintf(tls, p, ts+26271 /* "(%s) > (%s)" */, libc.VaList(bp+160, zLhs, zVector)) + zRet = rbuMPrintf(tls, p, ts+26795 /* "(%s) > (%s)" */, libc.VaList(bp+160, zLhs, zVector)) __18: ; __13: @@ -156688,7 +159204,7 @@ index_start_out: // pzImposterCols: ... // pzImposterPk: ... // pzWhere: ... -func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterCols uintptr, pzImposterPk uintptr, pzWhere uintptr, pnBind uintptr) uintptr { /* sqlite3.c:197522:13: */ +func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterCols uintptr, pzImposterPk uintptr, pzWhere uintptr, pnBind uintptr) uintptr { /* sqlite3.c:200545:13: */ bp := tls.Alloc(208) defer tls.Free(208) @@ -156706,7 +159222,7 @@ func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterC if rc == SQLITE_OK { rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+200 /* &pXInfo */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+25801 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + Xsqlite3_mprintf(tls, ts+26325 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for (rc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)))) { @@ -156718,7 +159234,7 @@ func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterC if iCid == -2 { var iSeq int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 0) - zRet = Xsqlite3_mprintf(tls, ts+26283 /* "%z%s(%.*s) COLLA..." */, libc.VaList(bp+8, zRet, zCom, + zRet = Xsqlite3_mprintf(tls, ts+26807 /* "%z%s(%.*s) COLLA..." */, libc.VaList(bp+8, zRet, zCom, (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iSeq)*16)).FnSpan, (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iSeq)*16)).FzSpan, zCollate)) zType = ts + 703 /* "" */ } else { @@ -156732,37 +159248,37 @@ func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterC zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - zCol = ts + 26124 /* "_rowid_" */ + zCol = ts + 26648 /* "_rowid_" */ } else { - zCol = ts + 25854 /* "rbu_rowid" */ + zCol = ts + 26378 /* "rbu_rowid" */ } - zType = ts + 10507 /* "INTEGER" */ + zType = ts + 10923 /* "INTEGER" */ } else { zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, ts+26305 /* "%z%s\"%w\" COLLATE..." */, libc.VaList(bp+48, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, ts+26829 /* "%z%s\"%w\" COLLATE..." */, libc.VaList(bp+48, zRet, zCom, zCol, zCollate)) } if ((*RbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0) || (Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 5) != 0) { var zOrder uintptr = func() uintptr { if bDesc != 0 { - return ts + 26041 /* " DESC" */ + return ts + 26565 /* " DESC" */ } return ts + 703 /* "" */ }() - zImpPK = Xsqlite3_mprintf(tls, ts+26325, /* "%z%s\"rbu_imp_%d%..." */ + zImpPK = Xsqlite3_mprintf(tls, ts+26849, /* "%z%s\"rbu_imp_%d%..." */ libc.VaList(bp+80, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, ts+26346, /* "%z%s\"rbu_imp_%d%..." */ + zImpCols = Xsqlite3_mprintf(tls, ts+26870, /* "%z%s\"rbu_imp_%d%..." */ libc.VaList(bp+120, zImpCols, zCom, nBind, zCol, zType, zCollate)) zWhere = Xsqlite3_mprintf(tls, - ts+26379 /* "%z%s\"rbu_imp_%d%..." */, libc.VaList(bp+168, zWhere, zAnd, nBind, zCol)) + ts+26903 /* "%z%s\"rbu_imp_%d%..." */, libc.VaList(bp+168, zWhere, zAnd, nBind, zCol)) if (((zRet == uintptr(0)) || (zImpPK == uintptr(0))) || (zImpCols == uintptr(0))) || (zWhere == uintptr(0)) { rc = SQLITE_NOMEM } - zCom = ts + 12447 /* ", " */ - zAnd = ts + 18855 /* " AND " */ + zCom = ts + 12863 /* ", " */ + zAnd = ts + 19343 /* " AND " */ nBind++ } @@ -156799,7 +159315,7 @@ func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterC // // For tables with implicit rowids - RBU_PK_EXTERNAL and RBU_PK_NONE, append // the text ", old._rowid_" to the returned value. -func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) uintptr { /* sqlite3.c:197634:13: */ +func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) uintptr { /* sqlite3.c:200657:13: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -156810,11 +159326,11 @@ func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, ts+26403 /* "%z%s%s.\"%w\"" */, libc.VaList(bp, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, ts+26927 /* "%z%s%s.\"%w\"" */, libc.VaList(bp, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, ts+26415 /* "%z%sNULL" */, libc.VaList(bp+32, zList, zS)) + zList = Xsqlite3_mprintf(tls, ts+26939 /* "%z%sNULL" */, libc.VaList(bp+32, zList, zS)) } - zS = ts + 12447 /* ", " */ + zS = ts + 12863 /* ", " */ if zList == uintptr(0) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM break @@ -156823,7 +159339,7 @@ func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) // For a table with implicit rowids, append "old._rowid_" to the list. if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) { - zList = rbuMPrintf(tls, p, ts+26424 /* "%z, %s._rowid_" */, libc.VaList(bp+48, zList, zObj)) + zList = rbuMPrintf(tls, p, ts+26948 /* "%z, %s._rowid_" */, libc.VaList(bp+48, zList, zObj)) } } return zList @@ -156837,24 +159353,24 @@ func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) // Return the string: // // "b = ?1 AND c = ?2" -func rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:197675:13: */ +func rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:200698:13: */ bp := tls.Alloc(80) defer tls.Free(80) var zList uintptr = uintptr(0) if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) { - zList = rbuMPrintf(tls, p, ts+26439 /* "_rowid_ = ?%d" */, libc.VaList(bp, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+1))) + zList = rbuMPrintf(tls, p, ts+26963 /* "_rowid_ = ?%d" */, libc.VaList(bp, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+1))) } else if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL { var zSep uintptr = ts + 703 /* "" */ var i int32 for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = rbuMPrintf(tls, p, ts+26453 /* "%z%sc%d=?%d" */, libc.VaList(bp+8, zList, zSep, i, (i+1))) - zSep = ts + 18855 /* " AND " */ + zList = rbuMPrintf(tls, p, ts+26977 /* "%z%sc%d=?%d" */, libc.VaList(bp+8, zList, zSep, i, (i+1))) + zSep = ts + 19343 /* " AND " */ } } zList = rbuMPrintf(tls, p, - ts+26465 /* "_rowid_ = (SELEC..." */, libc.VaList(bp+40, zList)) + ts+26989 /* "_rowid_ = (SELEC..." */, libc.VaList(bp+40, zList)) } else { var zSep uintptr = ts + 703 /* "" */ @@ -156862,8 +159378,8 @@ func rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sq for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = rbuMPrintf(tls, p, ts+26515 /* "%z%s\"%w\"=?%d" */, libc.VaList(bp+48, zList, zSep, zCol, (i+1))) - zSep = ts + 18855 /* " AND " */ + zList = rbuMPrintf(tls, p, ts+27039 /* "%z%s\"%w\"=?%d" */, libc.VaList(bp+48, zList, zSep, zCol, (i+1))) + zSep = ts + 19343 /* " AND " */ } } } @@ -156875,9 +159391,9 @@ func rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sq // is something wrong with the rbu_control value in the rbu_control value // stored in the (p->nCol+1)'th column. Set the error code and error message // of the RBU handle to something reflecting this. -func rbuBadControlError(tls *libc.TLS, p uintptr) { /* sqlite3.c:197716:13: */ +func rbuBadControlError(tls *libc.TLS, p uintptr) { /* sqlite3.c:200739:13: */ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+26528 /* "invalid rbu_cont..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+27052 /* "invalid rbu_cont..." */, 0) } // Return a nul-terminated string containing the comma separated list of @@ -156895,7 +159411,7 @@ func rbuBadControlError(tls *libc.TLS, p uintptr) { /* sqlite3.c:197716:13: */ // argument and NULL is returned. Or, if an error has already occurred // when this function is called, NULL is returned immediately, without // attempting the allocation or modifying the stored error code. -func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr) uintptr { /* sqlite3.c:197739:13: */ +func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr) uintptr { /* sqlite3.c:200762:13: */ bp := tls.Alloc(112) defer tls.Free(112) @@ -156910,17 +159426,17 @@ func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { var c int8 = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if int32(c) == 'x' { - zList = rbuMPrintf(tls, p, ts+26515, /* "%z%s\"%w\"=?%d" */ + zList = rbuMPrintf(tls, p, ts+27039, /* "%z%s\"%w\"=?%d" */ libc.VaList(bp, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), (i+1))) - zSep = ts + 12447 /* ", " */ + zSep = ts + 12863 /* ", " */ } else if int32(c) == 'd' { - zList = rbuMPrintf(tls, p, ts+26554, /* "%z%s\"%w\"=rbu_del..." */ + zList = rbuMPrintf(tls, p, ts+27078, /* "%z%s\"%w\"=rbu_del..." */ libc.VaList(bp+32, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), (i+1))) - zSep = ts + 12447 /* ", " */ + zSep = ts + 12863 /* ", " */ } else if int32(c) == 'f' { - zList = rbuMPrintf(tls, p, ts+26584, /* "%z%s\"%w\"=rbu_fos..." */ + zList = rbuMPrintf(tls, p, ts+27108, /* "%z%s\"%w\"=rbu_fos..." */ libc.VaList(bp+72, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), (i+1))) - zSep = ts + 12447 /* ", " */ + zSep = ts + 12863 /* ", " */ } } } @@ -156941,7 +159457,7 @@ func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr // argument and NULL is returned. Or, if an error has already occurred // when this function is called, NULL is returned immediately, without // attempting the allocation or modifying the stored error code. -func rbuObjIterGetBindlist(tls *libc.TLS, p uintptr, nBind int32) uintptr { /* sqlite3.c:197793:13: */ +func rbuObjIterGetBindlist(tls *libc.TLS, p uintptr, nBind int32) uintptr { /* sqlite3.c:200816:13: */ var zRet uintptr = uintptr(0) var nByte Sqlite3_int64 = ((int64(2) * Sqlite3_int64(nBind)) + int64(1)) @@ -156971,26 +159487,26 @@ func rbuObjIterGetBindlist(tls *libc.TLS, p uintptr, nBind int32) uintptr { /* s // this function returns: // // PRIMARY KEY("b", "a" DESC) -func rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:197820:13: */ +func rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:200843:13: */ bp := tls.Alloc(72) defer tls.Free(72) var z uintptr = uintptr(0) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - var zSep uintptr = ts + 26621 /* "PRIMARY KEY(" */ + var zSep uintptr = ts + 27145 /* "PRIMARY KEY(" */ *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)) = uintptr(0) // PRAGMA index_list = (pIter->zTbl) *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */)) = uintptr(0) // PRAGMA index_xinfo = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+56 /* &pXList */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+25773 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + Xsqlite3_mprintf(tls, ts+26297 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)))) { var zOrig uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)), 3) - if (zOrig != 0) && (libc.Xstrcmp(tls, zOrig, ts+13775 /* "pk" */) == 0) { + if (zOrig != 0) && (libc.Xstrcmp(tls, zOrig, ts+14204 /* "pk" */) == 0) { var zIdx uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)), 1) if zIdx != 0 { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+64 /* &pXInfo */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+25801 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx))) + Xsqlite3_mprintf(tls, ts+26325 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx))) } break } @@ -157003,15 +159519,15 @@ func rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sql var zCol uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */)), 2) var zDesc uintptr if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */)), 3) != 0 { - zDesc = ts + 26041 /* " DESC" */ + zDesc = ts + 26565 /* " DESC" */ } else { zDesc = ts + 703 /* "" */ } - z = rbuMPrintf(tls, p, ts+26634 /* "%z%s\"%w\"%s" */, libc.VaList(bp+16, z, zSep, zCol, zDesc)) - zSep = ts + 12447 /* ", " */ + z = rbuMPrintf(tls, p, ts+27158 /* "%z%s\"%w\"%s" */, libc.VaList(bp+16, z, zSep, zCol, zDesc)) + zSep = ts + 12863 /* ", " */ } } - z = rbuMPrintf(tls, p, ts+26645 /* "%z)" */, libc.VaList(bp+48, z)) + z = rbuMPrintf(tls, p, ts+27169 /* "%z)" */, libc.VaList(bp+48, z)) rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */))) } return z @@ -157034,7 +159550,7 @@ func rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sql // // CREATE TABLE rbu_imposter2(c1 TEXT, c2 REAL, id INTEGER) WITHOUT ROWID; // -func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:197879:13: */ +func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:200902:13: */ bp := tls.Alloc(184) defer tls.Free(184) @@ -157051,7 +159567,7 @@ func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlit // This is needed for the argument to "PRAGMA index_xinfo". Set // zIdx to point to a nul-terminated string containing this name. (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+168 /* &pQuery */, (p + 64 /* &.zErrmsg */), - ts+26649 /* "SELECT name FROM..." */) + ts+27173 /* "SELECT name FROM..." */) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */)), 1, tnum) if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */))) { @@ -157060,7 +159576,7 @@ func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlit } if zIdx != 0 { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+176 /* &pXInfo */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+25801 /* "PRAGMA main.inde..." */, libc.VaList(bp, zIdx))) + Xsqlite3_mprintf(tls, ts+26325 /* "PRAGMA main.inde..." */, libc.VaList(bp, zIdx))) } rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */))) @@ -157070,25 +159586,25 @@ func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlit var iCid int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 1) var bDesc int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 3) var zCollate uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 4) - zCols = rbuMPrintf(tls, p, ts+26699 /* "%z%sc%d %s COLLA..." */, libc.VaList(bp+8, zCols, zComma, + zCols = rbuMPrintf(tls, p, ts+27223 /* "%z%sc%d %s COLLA..." */, libc.VaList(bp+8, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) - zPk = rbuMPrintf(tls, p, ts+26721 /* "%z%sc%d%s" */, libc.VaList(bp+48, zPk, zComma, iCid, func() uintptr { + zPk = rbuMPrintf(tls, p, ts+27245 /* "%z%sc%d%s" */, libc.VaList(bp+48, zPk, zComma, iCid, func() uintptr { if bDesc != 0 { - return ts + 26041 /* " DESC" */ + return ts + 26565 /* " DESC" */ } return ts + 703 /* "" */ }())) - zComma = ts + 12447 /* ", " */ + zComma = ts + 12863 /* ", " */ } } - zCols = rbuMPrintf(tls, p, ts+26731 /* "%z, id INTEGER" */, libc.VaList(bp+80, zCols)) + zCols = rbuMPrintf(tls, p, ts+27255 /* "%z, id INTEGER" */, libc.VaList(bp+80, zCols)) rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */))) - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+88, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5282 /* "main" */, 1, tnum)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+88, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5327 /* "main" */, 1, tnum)) rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+26746, /* "CREATE TABLE rbu..." */ + ts+27270, /* "CREATE TABLE rbu..." */ libc.VaList(bp+120, zCols, zPk)) - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+136, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5282 /* "main" */, 0, 0)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+136, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5327 /* "main" */, 0, 0)) } } @@ -157110,7 +159626,7 @@ func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlit // More precisely, the "same schema" means the same columns, types, // collation sequences. For tables that do not have an external PRIMARY // KEY, it also means the same PRIMARY KEY declaration. -func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:197953:13: */ +func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:200976:13: */ bp := tls.Alloc(200) defer tls.Free(200) @@ -157119,7 +159635,7 @@ func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite var zComma uintptr = ts + 703 /* "" */ var zSql uintptr = uintptr(0) var iCol int32 - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5282 /* "main" */, 0, 1)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5327 /* "main" */, 0, 1)) for iCol = 0; ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (iCol < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol); iCol++ { var zPk uintptr = ts + 703 /* "" */ @@ -157127,41 +159643,41 @@ func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite *(*uintptr)(unsafe.Pointer(bp + 192 /* zColl */)) = uintptr(0) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, - (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5282 /* "main" */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp+192 /* &zColl */, uintptr(0), uintptr(0), uintptr(0)) + (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5327 /* "main" */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp+192 /* &zColl */, uintptr(0), uintptr(0), uintptr(0)) if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_IPK) && (*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0) { // If the target table column is an "INTEGER PRIMARY KEY", add // "PRIMARY KEY" to the imposter table column declaration. - zPk = ts + 26808 /* "PRIMARY KEY " */ + zPk = ts + 27332 /* "PRIMARY KEY " */ } - zSql = rbuMPrintf(tls, p, ts+26821, /* "%z%s\"%w\" %s %sCO..." */ + zSql = rbuMPrintf(tls, p, ts+27345, /* "%z%s\"%w\" %s %sCO..." */ libc.VaList(bp+32, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp + 192 /* zColl */)), func() uintptr { if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - return ts + 26848 /* " NOT NULL" */ + return ts + 27372 /* " NOT NULL" */ } return ts + 703 /* "" */ }())) - zComma = ts + 12447 /* ", " */ + zComma = ts + 12863 /* ", " */ } if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_WITHOUT_ROWID { var zPk uintptr = rbuWithoutRowidPK(tls, p, pIter) if zPk != 0 { - zSql = rbuMPrintf(tls, p, ts+26858 /* "%z, %z" */, libc.VaList(bp+88, zSql, zPk)) + zSql = rbuMPrintf(tls, p, ts+27382 /* "%z, %z" */, libc.VaList(bp+88, zSql, zPk)) } } - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+104, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5282 /* "main" */, 1, tnum)) - rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+26865, /* "CREATE TABLE \"rb..." */ + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+104, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5327 /* "main" */, 1, tnum)) + rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+27389, /* "CREATE TABLE \"rb..." */ libc.VaList(bp+136, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, func() uintptr { if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_WITHOUT_ROWID { - return ts + 26897 /* " WITHOUT ROWID" */ + return ts + 27421 /* " WITHOUT ROWID" */ } return ts + 703 /* "" */ }())) - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+160, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5282 /* "main" */, 0, 0)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+160, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5327 /* "main" */, 0, 0)) } } @@ -157174,7 +159690,7 @@ func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite // the target table, plus one (for the rbu_control column), plus one more // (for the rbu_rowid column) if the target table is an implicit IPK or // virtual table. -func rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zCollist uintptr, zRbuRowid uintptr) { /* sqlite3.c:198009:13: */ +func rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zCollist uintptr, zRbuRowid uintptr) { /* sqlite3.c:201032:13: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -157184,12 +159700,12 @@ func rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zCollis (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter + 152 /* &.pTmpInsert */), (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+26912, /* "INSERT INTO %s.'..." */ + ts+27436, /* "INSERT INTO %s.'..." */ libc.VaList(bp, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } -func rbuTmpInsertFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:198027:13: */ +func rbuTmpInsertFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:201050:13: */ var p uintptr = Xsqlite3_user_data(tls, pCtx) var rc int32 = SQLITE_OK var i int32 @@ -157211,7 +159727,7 @@ func rbuTmpInsertFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } } -func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:198057:13: */ +func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:201080:13: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -157221,7 +159737,7 @@ func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp /* &pStmt */, (p + 64 /* &.zErrmsg */), - ts+26969 /* "SELECT trim(sql)..." */) + ts+27493 /* "SELECT trim(sql)..." */) } if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK { var rc2 int32 @@ -157319,7 +159835,7 @@ func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { // Ensure that the SQLite statement handles required to update the // target database object currently indicated by the iterator passed // as the second argument are available. -func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32) int32 { /* sqlite3.c:198157:12: */ +func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32) int32 { /* sqlite3.c:201180:12: */ bp := tls.Alloc(628) defer tls.Free(628) @@ -157331,7 +159847,7 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 var zLimit uintptr = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, ts+27035 /* " LIMIT -1 OFFSET..." */, libc.VaList(bp, nOffset)) + zLimit = Xsqlite3_mprintf(tls, ts+27559 /* " LIMIT -1 OFFSET..." */, libc.VaList(bp, nOffset)) if !(zLimit != 0) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM } @@ -157352,26 +159868,26 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 zBind = rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 624 /* nBind */))) // Create the imposter table used to write to this index. - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+8, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5282 /* "main" */, 0, 1)) - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+40, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5282 /* "main" */, 1, tnum)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+8, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5327 /* "main" */, 0, 1)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+40, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5327 /* "main" */, 1, tnum)) rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+27055, /* "CREATE TABLE \"rb..." */ + ts+27579, /* "CREATE TABLE \"rb..." */ libc.VaList(bp+72, zTbl, *(*uintptr)(unsafe.Pointer(bp + 600 /* zImposterCols */)), *(*uintptr)(unsafe.Pointer(bp + 608 /* zImposterPK */)))) - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+96, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5282 /* "main" */, 0, 0)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+96, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5327 /* "main" */, 0, 0)) // Create the statement to insert index entries (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 624 /* nBind */)) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 136 /* &.pInsert */), (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+27120 /* "INSERT INTO \"rbu..." */, libc.VaList(bp+128, zTbl, zBind))) + Xsqlite3_mprintf(tls, ts+27644 /* "INSERT INTO \"rbu..." */, libc.VaList(bp+128, zTbl, zBind))) } // And to delete index entries if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 144 /* &.pDelete */), (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+27156 /* "DELETE FROM \"rbu..." */, libc.VaList(bp+144, zTbl, *(*uintptr)(unsafe.Pointer(bp + 616 /* zWhere */))))) + Xsqlite3_mprintf(tls, ts+27680 /* "DELETE FROM \"rbu..." */, libc.VaList(bp+144, zTbl, *(*uintptr)(unsafe.Pointer(bp + 616 /* zWhere */))))) } // Create the SELECT statement to read keys in sorted order @@ -157388,7 +159904,7 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 } zSql = Xsqlite3_mprintf(tls, - ts+27190, /* "SELECT %s, 0 AS ..." */ + ts+27714, /* "SELECT %s, 0 AS ..." */ libc.VaList(bp+160, zCollist, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, @@ -157396,9 +159912,9 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 if zStart != 0 { return func() uintptr { if zPart != 0 { - return ts + 27251 /* "AND" */ + return ts + 27775 /* "AND" */ } - return ts + 27255 /* "WHERE" */ + return ts + 27779 /* "WHERE" */ }() } return ts + 703 /* "" */ @@ -157407,21 +159923,21 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 Xsqlite3_free(tls, zStart) } else if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) { zSql = Xsqlite3_mprintf(tls, - ts+27261, /* "SELECT %s, rbu_c..." */ + ts+27785, /* "SELECT %s, rbu_c..." */ libc.VaList(bp+216, zCollist, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { zSql = Xsqlite3_mprintf(tls, - ts+27322, /* "SELECT %s, rbu_c..." */ + ts+27846, /* "SELECT %s, rbu_c..." */ libc.VaList(bp+264, zCollist, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, func() uintptr { if zPart != 0 { - return ts + 27251 /* "AND" */ + return ts + 27775 /* "AND" */ } - return ts + 27255 /* "WHERE" */ + return ts + 27779 /* "WHERE" */ }(), zCollist, zLimit)) } @@ -157446,8 +159962,8 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 var zBindings uintptr = rbuObjIterGetBindlist(tls, p, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol + bRbuRowid)) var zWhere uintptr = rbuObjIterGetWhere(tls, p, pIter) - var zOldlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+5291 /* "old" */) - var zNewlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+5287 /* "new" */) + var zOldlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+5336 /* "old" */) + var zNewlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+5332 /* "new" */) zCollist = rbuObjIterGetCollist(tls, p, pIter) (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol @@ -157459,17 +159975,17 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB { return ts + 703 /* "" */ } - return ts + 27481 /* "rbu_imp_" */ + return ts + 28005 /* "rbu_imp_" */ }() // Create the INSERT statement to write to the target PK b-tree if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 136 /* &.pInsert */), pz, Xsqlite3_mprintf(tls, - ts+27490, /* "INSERT INTO \"%s%..." */ + ts+28014, /* "INSERT INTO \"%s%..." */ libc.VaList(bp+344, zWrite, zTbl, zCollist, func() uintptr { if bRbuRowid != 0 { - return ts + 27526 /* ", _rowid_" */ + return ts + 28050 /* ", _rowid_" */ } return ts + 703 /* "" */ }(), zBindings))) @@ -157481,28 +159997,28 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 144 /* &.pDelete */), pz, Xsqlite3_mprintf(tls, - ts+27536 /* "DELETE FROM \"%s%..." */, libc.VaList(bp+384, zWrite, zTbl, zWhere))) + ts+28060 /* "DELETE FROM \"%s%..." */, libc.VaList(bp+384, zWrite, zTbl, zWhere))) } if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0) { var zRbuRowid uintptr = ts + 703 /* "" */ if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) { - zRbuRowid = ts + 27564 /* ", rbu_rowid" */ + zRbuRowid = ts + 28088 /* ", rbu_rowid" */ } // Create the rbu_tmp_xxx table and the triggers to populate it. rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, - ts+27576 /* "CREATE TABLE IF ..." */, libc.VaList(bp+408, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, func() uintptr { + ts+28100 /* "CREATE TABLE IF ..." */, libc.VaList(bp+408, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, func() uintptr { if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL { - return ts + 27652 /* ", 0 AS rbu_rowid" */ + return ts + 28176 /* ", 0 AS rbu_rowid" */ } return ts + 703 /* "" */ }(), (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+27669, /* "CREATE TEMP TRIG..." */ + ts+28193, /* "CREATE TEMP TRIG..." */ libc.VaList(bp+440, zWrite, zTbl, zOldlist, zWrite, zTbl, zOldlist, zWrite, zTbl, zNewlist)) @@ -157510,7 +160026,7 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) { rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+27968, /* "CREATE TEMP TRIG..." */ + ts+28492, /* "CREATE TEMP TRIG..." */ libc.VaList(bp+512, zWrite, zTbl, zNewlist)) } @@ -157524,9 +160040,9 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 var zOrder uintptr = uintptr(0) if bRbuRowid != 0 { if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - zRbuRowid = ts + 28067 /* ",_rowid_ " */ + zRbuRowid = ts + 28591 /* ",_rowid_ " */ } else { - zRbuRowid = ts + 28077 /* ",rbu_rowid" */ + zRbuRowid = ts + 28601 /* ",rbu_rowid" */ } } @@ -157539,20 +160055,20 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 } } if bRbuRowid != 0 { - zOrder = rbuMPrintf(tls, p, ts+26124 /* "_rowid_" */, 0) + zOrder = rbuMPrintf(tls, p, ts+26648 /* "_rowid_" */, 0) } else { - zOrder = rbuObjIterGetPkList(tls, p, pIter, ts+703 /* "" */, ts+12447 /* ", " */, ts+703 /* "" */) + zOrder = rbuObjIterGetPkList(tls, p, pIter, ts+703 /* "" */, ts+12863 /* ", " */, ts+703 /* "" */) } } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter + 128 /* &.pSelect */), pz, Xsqlite3_mprintf(tls, - ts+28088, /* "SELECT %s,%s rbu..." */ + ts+28612, /* "SELECT %s,%s rbu..." */ libc.VaList(bp+536, zCollist, func() uintptr { if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - return ts + 28136 /* "0 AS " */ + return ts + 28660 /* "0 AS " */ } return ts + 703 /* "" */ }(), @@ -157565,7 +160081,7 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 }(), func() uintptr { if zOrder != 0 { - return ts + 16420 /* "ORDER BY" */ + return ts + 17719 /* "ORDER BY" */ } return ts + 703 /* "" */ }(), zOrder, @@ -157594,7 +160110,7 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 // // If the zMask string does not specify any columns to update, then this // is not an error. Output variable *ppStmt is set to NULL in this case. -func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, ppStmt uintptr) int32 { /* sqlite3.c:198424:12: */ +func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, ppStmt uintptr) int32 { /* sqlite3.c:201447:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -157645,9 +160161,9 @@ func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, pp var zPrefix uintptr = ts + 703 /* "" */ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType != RBU_PK_VTAB { - zPrefix = ts + 27481 /* "rbu_imp_" */ + zPrefix = ts + 28005 /* "rbu_imp_" */ } - zUpdate = Xsqlite3_mprintf(tls, ts+28142, /* "UPDATE \"%s%w\" SE..." */ + zUpdate = Xsqlite3_mprintf(tls, ts+28666, /* "UPDATE \"%s%w\" SE..." */ libc.VaList(bp, zPrefix, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pUp + 8 /* &.pUpdate */), (p + 64 /* &.zErrmsg */), zUpdate) @@ -157660,7 +160176,7 @@ func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, pp return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc } -func rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) uintptr { /* sqlite3.c:198492:16: */ +func rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) uintptr { /* sqlite3.c:201515:16: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -157674,7 +160190,7 @@ func rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) uin return uintptr(0) }()) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* db */))))) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* db */))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* db */))) *(*uintptr)(unsafe.Pointer(bp + 8 /* db */)) = uintptr(0) } @@ -157683,7 +160199,7 @@ func rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) uin } // Free an RbuState object allocated by rbuLoadState(). -func rbuFreeState(tls *libc.TLS, p uintptr) { /* sqlite3.c:198513:13: */ +func rbuFreeState(tls *libc.TLS, p uintptr) { /* sqlite3.c:201536:13: */ if p != 0 { Xsqlite3_free(tls, (*RbuState)(unsafe.Pointer(p)).FzTbl) Xsqlite3_free(tls, (*RbuState)(unsafe.Pointer(p)).FzDataTbl) @@ -157699,7 +160215,7 @@ func rbuFreeState(tls *libc.TLS, p uintptr) { /* sqlite3.c:198513:13: */ // // If an error occurs, leave an error code and message in the rbu handle // and return NULL. -func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:198531:17: */ +func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:201554:17: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -157715,7 +160231,7 @@ func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:198531:17: */ } *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+8 /* &pStmt */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+28172 /* "SELECT k, v FROM..." */, libc.VaList(bp, p+48 /* &.zStateDb */))) + Xsqlite3_mprintf(tls, ts+28696 /* "SELECT k, v FROM..." */, libc.VaList(bp, p+48 /* &.zStateDb */))) for (*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 0) { case RBU_STATE_STAGE: @@ -157779,7 +160295,7 @@ func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:198531:17: */ // Open the database handle and attach the RBU database as "rbu". If an // error occurs, leave an error code and message in the RBU handle. -func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:198608:13: */ +func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:201631:13: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -157787,31 +160303,31 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:1 (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, 1) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) { - Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5282 /* "main" */, SQLITE_FCNTL_RBUCNT, p) + Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5327 /* "main" */, SQLITE_FCNTL_RBUCNT, p) if (*Sqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - var zFile uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5282 /* "main" */) - (*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+28202 /* "file://%s-vacuum..." */, libc.VaList(bp, zFile, zFile)) + var zFile uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5327 /* "main" */) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+28726 /* "file://%s-vacuum..." */, libc.VaList(bp, zFile, zFile)) } } // If using separate RBU and state databases, attach the state database to // the RBU db handle now. if (*Sqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+28229 /* "ATTACH %Q AS sta..." */, libc.VaList(bp+16, (*Sqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48 /* &.zStateDb */, ts+2313 /* "stat" */, uint64(4)) + rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+28753 /* "ATTACH %Q AS sta..." */, libc.VaList(bp+16, (*Sqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48 /* &.zStateDb */, ts+2341 /* "stat" */, uint64(4)) } else { - libc.Xmemcpy(tls, p+48 /* &.zStateDb */, ts+5282 /* "main" */, uint64(4)) + libc.Xmemcpy(tls, p+48 /* &.zStateDb */, ts+5327 /* "main" */, uint64(4)) } // If it has not already been created, create the rbu_state table - rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+28247 /* "CREATE TABLE IF ..." */, libc.VaList(bp+24, p+48 /* &.zStateDb */)) + rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+28771 /* "CREATE TABLE IF ..." */, libc.VaList(bp+24, p+48 /* &.zStateDb */)) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) { var bOpen int32 = 0 var rc int32 (*Sqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5282 /* "main" */, SQLITE_FCNTL_RBUCNT, p) + rc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5327 /* "main" */, SQLITE_FCNTL_RBUCNT, p) if rc != SQLITE_NOTFOUND { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -157844,11 +160360,11 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:1 return } (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+28313 /* "cannot vacuum wa..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+28837 /* "cannot vacuum wa..." */, 0) } else { var zTarget uintptr var zExtra uintptr = uintptr(0) - if (libc.Xstrlen(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5)) && (0 == libc.Xmemcmp(tls, ts+21445 /* "file:" */, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5))) { + if (libc.Xstrlen(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5)) && (0 == libc.Xmemcmp(tls, ts+21969 /* "file:" */, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5))) { zExtra = ((*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5) for *(*int8)(unsafe.Pointer(zExtra)) != 0 { if int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zExtra, 1)))) == '?' { @@ -157860,13 +160376,13 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:1 } } - zTarget = Xsqlite3_mprintf(tls, ts+28345, /* "file:%s-vactmp?r..." */ - libc.VaList(bp+32, Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5282 /* "main" */), + zTarget = Xsqlite3_mprintf(tls, ts+28869, /* "file:%s-vactmp?r..." */ + libc.VaList(bp+32, Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5327 /* "main" */), func() uintptr { if zExtra == uintptr(0) { return ts + 703 /* "" */ } - return ts + 28377 /* "&" */ + return ts + 28901 /* "&" */ }(), func() uintptr { if zExtra == uintptr(0) { return ts + 703 /* "" */ @@ -157885,40 +160401,40 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:1 if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+28379 /* "rbu_tmp_insert" */, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { + ts+28903 /* "rbu_tmp_insert" */, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rbuTmpInsertFunc})), uintptr(0), uintptr(0)) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+28394 /* "rbu_fossil_delta" */, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + ts+28918 /* "rbu_fossil_delta" */, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rbuFossilDeltaFunc})), uintptr(0), uintptr(0)) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, - ts+28411 /* "rbu_target_name" */, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { + ts+28935 /* "rbu_target_name" */, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rbuTargetNameFunc})), uintptr(0), uintptr(0)) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5282 /* "main" */, SQLITE_FCNTL_RBU, p) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5327 /* "main" */, SQLITE_FCNTL_RBU, p) } - rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+28427 /* "SELECT * FROM sq..." */, 0) + rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+28951 /* "SELECT * FROM sq..." */, 0) // Mark the database file just opened as an RBU target database. If // this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. // This is an error. if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5282 /* "main" */, SQLITE_FCNTL_RBU, p) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5327 /* "main" */, SQLITE_FCNTL_RBU, p) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_NOTFOUND { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+28455 /* "rbu vfs not foun..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+28979 /* "rbu vfs not foun..." */, 0) } } @@ -157940,7 +160456,7 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:1 // test.db-wal => test.wal // test.db-shm => test.shm // test.db-mj7f3319fa => test.9fa -func rbuFileSuffix3(tls *libc.TLS, zBase uintptr, z uintptr) { /* sqlite3.c:198787:13: */ +func rbuFileSuffix3(tls *libc.TLS, zBase uintptr, z uintptr) { /* sqlite3.c:201810:13: */ } // Return the current wal-index header checksum for the target database @@ -157948,7 +160464,7 @@ func rbuFileSuffix3(tls *libc.TLS, zBase uintptr, z uintptr) { /* sqlite3.c:1987 // // The checksum is store in the first page of xShmMap memory as an 8-byte // blob starting at byte offset 40. -func rbuShmChecksum(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:198808:12: */ +func rbuShmChecksum(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:201831:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -157979,7 +160495,7 @@ func rbuShmChecksum(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:198808:12: */ // object, then the rbu handle is set to DONE state. This occurs if some // other client appends a transaction to the wal file in the middle of // an incremental checkpoint. -func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:198837:13: */ +func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:201860:13: */ // If pState is NULL, then the wal file may not have been opened and // recovered. Running a read-statement here to ensure that doing so @@ -157987,7 +160503,7 @@ func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c if pState == uintptr(0) { (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+28427 /* "SELECT * FROM sq..." */, uintptr(0), uintptr(0), uintptr(0)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+28951 /* "SELECT * FROM sq..." */, uintptr(0), uintptr(0), uintptr(0)) } } @@ -158021,7 +160537,7 @@ func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { var rc2 int32 (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_CAPTURE - rc2 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+28473 /* "PRAGMA main.wal_..." */, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+28997 /* "PRAGMA main.wal_..." */, uintptr(0), uintptr(0), uintptr(0)) if rc2 != SQLITE_INTERNAL { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -158067,7 +160583,7 @@ func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c // Called when iAmt bytes are read from offset iOff of the wal file while // the rbu object is in capture mode. Record the frame number of the frame // being read in the aFrame[] array. -func rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff I64, iAmt int32) int32 { /* sqlite3.c:198921:12: */ +func rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff I64, iAmt int32) int32 { /* sqlite3.c:201944:12: */ var mReq U32 = (U32(((int32(1) << WAL_LOCK_WRITE) | (int32(1) << WAL_LOCK_CKPT)) | (int32(1) << WAL_LOCK_READ0))) var iFrame U32 @@ -158106,7 +160622,7 @@ func rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff I64, iAmt int32) int32 // Called when a page of data is written to offset iOff of the database // file while the rbu handle is in capture mode. Record the page number // of the page being written in the aFrame[] array. -func rbuCaptureDbWrite(tls *libc.TLS, pRbu uintptr, iOff I64) int32 { /* sqlite3.c:198953:12: */ +func rbuCaptureDbWrite(tls *libc.TLS, pRbu uintptr, iOff I64) int32 { /* sqlite3.c:201976:12: */ (*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame + uintptr(((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame-1))*8)).FiDbPage = ((U32(iOff / I64((*Sqlite3rbu)(unsafe.Pointer(pRbu)).Fpgsz))) + U32(1)) return SQLITE_OK } @@ -158114,7 +160630,7 @@ func rbuCaptureDbWrite(tls *libc.TLS, pRbu uintptr, iOff I64) int32 { /* sqlite3 // This is called as part of an incremental checkpoint operation. Copy // a single frame of data from the wal file into the database file, as // indicated by the RbuFrame object. -func rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { /* sqlite3.c:198963:13: */ +func rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { /* sqlite3.c:201986:13: */ var pWal uintptr = (*Rbu_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal var iOff I64 @@ -158130,7 +160646,7 @@ func rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { /* sqlite3.c } // Take an EXCLUSIVE lock on the database file. -func rbuLockDatabase(tls *libc.TLS, p uintptr) { /* sqlite3.c:198981:13: */ +func rbuLockDatabase(tls *libc.TLS, p uintptr) { /* sqlite3.c:202004:13: */ var pReal uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pReal)).FpMethods + 56 /* &.xLock */))))(tls, pReal, SQLITE_LOCK_SHARED) @@ -158144,20 +160660,20 @@ func rbuLockDatabase(tls *libc.TLS, p uintptr) { /* sqlite3.c:198981:13: */ // then reopens the database file (this time in vanilla, non-oal, WAL mode). // If an error occurs, leave an error code and error message in the rbu // handle. -func rbuMoveOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:199021:13: */ +func rbuMoveOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:202044:13: */ bp := tls.Alloc(16) defer tls.Free(16) - var zBase uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5282 /* "main" */) + var zBase uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+5327 /* "main" */) var zMove uintptr = zBase var zOal uintptr var zWal uintptr if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5282 /* "main" */) + zMove = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+5327 /* "main" */) } - zOal = Xsqlite3_mprintf(tls, ts+28508 /* "%s-oal" */, libc.VaList(bp, zMove)) - zWal = Xsqlite3_mprintf(tls, ts+28515 /* "%s-wal" */, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, ts+29032 /* "%s-oal" */, libc.VaList(bp, zMove)) + zWal = Xsqlite3_mprintf(tls, ts+29039 /* "%s-wal" */, libc.VaList(bp+8, zMove)) if (zWal == uintptr(0)) || (zOal == uintptr(0)) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM @@ -158213,7 +160729,7 @@ func rbuMoveOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:199021:13: */ // // If the rbu_control field contains an invalid value, an error code and // message are left in the RBU handle and zero returned. -func rbuStepType(tls *libc.TLS, p uintptr, pzMask uintptr) int32 { /* sqlite3.c:199112:12: */ +func rbuStepType(tls *libc.TLS, p uintptr, pzMask uintptr) int32 { /* sqlite3.c:202135:12: */ var iCol int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnCol // Index of rbu_control column var res int32 = 0 // Return value @@ -158269,7 +160785,7 @@ func rbuStepType(tls *libc.TLS, p uintptr, pzMask uintptr) int32 { /* sqlite3.c: // Argument eType must be one of RBU_INSERT, RBU_DELETE, RBU_IDX_INSERT or // RBU_IDX_DELETE. This function performs the work of a single // sqlite3rbu_step() call for the type of operation specified by eType. -func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:199168:13: */ +func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:202191:13: */ var pIter uintptr = (p + 80 /* &.objiter */) var pVal uintptr var pWriter uintptr @@ -158297,7 +160813,7 @@ func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:199168:1 ((*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0))) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_IPK)) && (*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0)) && (Xsqlite3_column_type(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == SQLITE_NULL) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_MISMATCH - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+21083 /* "datatype mismatc..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+21607 /* "datatype mismatc..." */, 0) return } @@ -158341,7 +160857,7 @@ func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:199168:1 // If no error occurs, SQLITE_OK is returned. Otherwise, an error code // and message is left in the RBU handle and a copy of the error code // returned. -func rbuStep(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199251:12: */ +func rbuStep(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:202274:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -158400,7 +160916,7 @@ func rbuStep(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199251:12: */ // Or, if this is an RBU vacuum, set the schema cookie of the main db // opened by p->dbMain to one more than the schema cookie of the main // db opened by p->dbRbu. -func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:199316:13: */ +func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:202339:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -158415,7 +160931,7 @@ func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:199316:13: */ // var pStmt uintptr at bp+8, 8 (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, dbread, bp+8 /* &pStmt */, (p + 64 /* &.zErrmsg */), - ts+28522 /* "PRAGMA schema_ve..." */) + ts+29046 /* "PRAGMA schema_ve..." */) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { // Coverage: it may be that this sqlite3_step() cannot fail. There // is already a transaction open, so the prepared statement cannot @@ -158428,7 +160944,7 @@ func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:199316:13: */ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */))) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+28544 /* "PRAGMA schema_ve..." */, libc.VaList(bp, (iCookie+1))) + rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29068 /* "PRAGMA schema_ve..." */, libc.VaList(bp, (iCookie+1))) } } } @@ -158436,7 +160952,7 @@ func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:199316:13: */ // Update the contents of the rbu_state table within the rbu database. The // value stored in the RBU_STATE_STAGE column is eStage. All other values // are determined by inspecting the rbu handle passed as the first argument. -func rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { /* sqlite3.c:199347:13: */ +func rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { /* sqlite3.c:202370:13: */ bp := tls.Alloc(176) defer tls.Free(176) @@ -158453,7 +160969,7 @@ func rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { /* sqlite3.c:199347: rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+168 /* &pInsert */, (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+28571, /* "INSERT OR REPLAC..." */ + ts+29095, /* "INSERT OR REPLAC..." */ libc.VaList(bp, p+48, /* &.zStateDb */ RBU_STATE_STAGE, eStage, RBU_STATE_TBL, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, @@ -158491,16 +161007,16 @@ func rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { /* sqlite3.c:199347: // // In short, it copies the value of the specified PRAGMA setting from // dbRbu to dbMain. -func rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { /* sqlite3.c:199408:13: */ +func rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { /* sqlite3.c:202431:13: */ bp := tls.Alloc(32) defer tls.Free(32) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)) = uintptr(0) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+24 /* &pPragma */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+28729 /* "PRAGMA main.%s" */, libc.VaList(bp, zPragma))) + Xsqlite3_mprintf(tls, ts+29253 /* "PRAGMA main.%s" */, libc.VaList(bp, zPragma))) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)))) { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+28744, /* "PRAGMA main.%s =..." */ + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29268, /* "PRAGMA main.%s =..." */ libc.VaList(bp+8, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)), 0))) } rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */))) @@ -158510,18 +161026,18 @@ func rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { /* sqlite3.c:199 // The RBU handle passed as the only argument has just been opened and // the state database is empty. If this RBU handle was opened for an // RBU vacuum operation, create the schema in the target db. -func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:199428:13: */ +func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:202451:13: */ bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp /* pSql */)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8 /* pInsert */)) = uintptr(0) - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+28764 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29288 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pSql */, (p + 64 /* &.zErrmsg */), - ts+28789 /* "SELECT sql FROM ..." */) + ts+29313 /* "SELECT sql FROM ..." */) } for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pSql */))) == SQLITE_ROW) { @@ -158535,12 +161051,12 @@ func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:199428:13: * if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pSql */, (p + 64 /* &.zErrmsg */), - ts+28897 /* "SELECT * FROM sq..." */) + ts+29421 /* "SELECT * FROM sq..." */) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8 /* &pInsert */, (p + 64 /* &.zErrmsg */), - ts+28962 /* "INSERT INTO sqli..." */) + ts+29486 /* "INSERT INTO sqli..." */) } for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pSql */))) == SQLITE_ROW) { @@ -158552,7 +161068,7 @@ func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:199428:13: * (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pInsert */))) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29006 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29530 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pSql */))) @@ -158560,7 +161076,7 @@ func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:199428:13: * } // Step the RBU object. -func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199480:16: */ +func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:202503:16: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -158574,8 +161090,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199480:16: // when this handle was opened, create the target database schema. if (((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) { rbuCreateTargetSchema(tls, p) - rbuCopyPragma(tls, p, ts+14831 /* "user_version" */) - rbuCopyPragma(tls, p, ts+13953 /* "application_id" */) + rbuCopyPragma(tls, p, ts+15260 /* "user_version" */) + rbuCopyPragma(tls, p, ts+14382 /* "application_id" */) } for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { @@ -158586,7 +161102,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199480:16: // But the contents can be deleted. if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0) { rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, - ts+29031 /* "DELETE FROM %s.'..." */, libc.VaList(bp, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + ts+29555 /* "DELETE FROM %s.'..." */, libc.VaList(bp, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -158612,10 +161128,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199480:16: rbuSaveState(tls, p, RBU_STAGE_MOVE) rbuIncrSchemaCookie(tls, p) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+12351 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+12767 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+12351 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+12767 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_MOVE } @@ -158699,7 +161215,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199480:16: // Compare strings z1 and z2, returning 0 if they are identical, or non-zero // otherwise. Either or both argument may be NULL. Two NULL values are // considered equal, and NULL is considered distinct from all other values. -func rbuStrCompare(tls *libc.TLS, z1 uintptr, z2 uintptr) int32 { /* sqlite3.c:199609:12: */ +func rbuStrCompare(tls *libc.TLS, z1 uintptr, z2 uintptr) int32 { /* sqlite3.c:202632:12: */ if (z1 == uintptr(0)) && (z2 == uintptr(0)) { return 0 } @@ -158717,7 +161233,7 @@ func rbuStrCompare(tls *libc.TLS, z1 uintptr, z2 uintptr) int32 { /* sqlite3.c:1 // // If an error occurs, an error code and error message are left in the // rbu handle passed as the first argument. -func rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:199625:13: */ +func rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:202648:13: */ if (*RbuState)(unsafe.Pointer(pState)).FzTbl != 0 { var pIter uintptr = (p + 80 /* &.objiter */) @@ -158732,7 +161248,7 @@ func rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:199625 if (rc == SQLITE_OK) && !(int32((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl) != 0) { rc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+29059 /* "rbu_state mismat..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+29583 /* "rbu_state mismat..." */, 0) } if rc == SQLITE_OK { @@ -158747,11 +161263,11 @@ func rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:199625 // If there is a "*-oal" file in the file-system corresponding to the // target database in the file-system, delete it. If an error occurs, // leave an error code and error message in the rbu handle. -func rbuDeleteOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:199658:13: */ +func rbuDeleteOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:202681:13: */ bp := tls.Alloc(8) defer tls.Free(8) - var zOal uintptr = rbuMPrintf(tls, p, ts+28508 /* "%s-oal" */, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + var zOal uintptr = rbuMPrintf(tls, p, ts+29032 /* "%s-oal" */, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { var pVfs uintptr = Xsqlite3_vfs_find(tls, uintptr(0)) @@ -158764,7 +161280,7 @@ func rbuDeleteOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:199658:13: */ // argument. This VFS will be used unless the call to sqlite3rbu_open() // specified a URI with a vfs=? option in place of a target database // file name. -func rbuCreateVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:199674:13: */ +func rbuCreateVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:202697:13: */ bp := tls.Alloc(76) defer tls.Free(76) @@ -158773,7 +161289,7 @@ func rbuCreateVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:199674:13: */ // var zRnd [64]int8 at bp+12, 64 Xsqlite3_randomness(tls, int32(unsafe.Sizeof(int32(0))), bp+8 /* &rnd */) - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+12 /* &zRnd[0] */, ts+29084 /* "rbu_vfs_%d" */, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* rnd */)))) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+12 /* &zRnd[0] */, ts+29608 /* "rbu_vfs_%d" */, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* rnd */)))) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+12 /* &zRnd[0] */, uintptr(0)) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { var pVfs uintptr = Xsqlite3_vfs_find(tls, bp+12 /* &zRnd[0] */) @@ -158785,7 +161301,7 @@ func rbuCreateVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:199674:13: */ // Destroy the private VFS created for the rbu handle passed as the only // argument by an earlier call to rbuCreateVfs(). -func rbuDeleteVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:199694:13: */ +func rbuDeleteVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:202717:13: */ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName != 0 { Xsqlite3rbu_destroy_vfs(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName) (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName = uintptr(0) @@ -158795,7 +161311,7 @@ func rbuDeleteVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:199694:13: */ // This user-defined SQL function is invoked with a single argument - the // name of a table expected to appear in the target database. It returns // the number of auxilliary indexes on the table. -func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:199706:13: */ +func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:202729:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -158812,7 +161328,7 @@ func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { / rc = prepareFreeAndCollectError(tls, db, bp+8 /* &pStmt */, bp+16, /* &zErrmsg */ Xsqlite3_mprintf(tls, - ts+29095 /* "SELECT count(*) ..." */, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + ts+29619 /* "SELECT count(*) ..." */, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrmsg */)), -1) } else { @@ -158844,7 +161360,7 @@ func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { / // sqlite3rbu.nPhaseOneStep is initialized to the sum of (1 + nIndex) * cnt // for all rows in the rbu_count table, where nIndex is the number of // indexes on the corresponding target database table. -func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:199756:13: */ +func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:202779:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -158855,7 +161371,7 @@ func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:199756:13: */ (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-1) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, - ts+29167 /* "rbu_index_cnt" */, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { + ts+29691 /* "rbu_index_cnt" */, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rbuIndexCntFunc})), uintptr(0), uintptr(0)) @@ -158863,7 +161379,7 @@ func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:199756:13: */ // occurs, nPhaseOneStep will be left set to -1. if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pStmt */, (p + 64 /* &.zErrmsg */), - ts+29181 /* "SELECT 1 FROM sq..." */) + ts+29705 /* "SELECT 1 FROM sq..." */) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) { @@ -158875,7 +161391,7 @@ func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:199756:13: */ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (bExists != 0) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pStmt */, (p + 64 /* &.zErrmsg */), - ts+29238 /* "SELECT sum(cnt *..." */) + ts+29762 /* "SELECT sum(cnt *..." */) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) { (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 0) @@ -158886,7 +161402,7 @@ func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:199756:13: */ } } -func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:199797:19: */ +func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:202820:19: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -158921,7 +161437,7 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) libc.Xmemcpy(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, (nRbu + uint64(1))) pCsr += (uintptr(nRbu + uint64(1))) if zState != 0 { - (*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+2690 /* "%s" */, libc.VaList(bp, zState)) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+2718 /* "%s" */, libc.VaList(bp, zState)) } // If the first attempt to open the database file fails and the bRetry @@ -158958,7 +161474,7 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0) { if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+29312 /* "cannot update wa..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+29836 /* "cannot update wa..." */, 0) } else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_MOVE { (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_CKPT (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep = 0 @@ -158980,12 +161496,12 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) // transaction is committed in rollback mode) currently stored on // page 1 of the database file. (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_BUSY - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+29344, /* "database modifie..." */ + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+29868, /* "database modifie..." */ libc.VaList(bp+8, func() uintptr { if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - return ts + 29376 /* "vacuum" */ + return ts + 29900 /* "vacuum" */ } - return ts + 29383 /* "update" */ + return ts + 29907 /* "update" */ }())) } } @@ -158993,7 +161509,7 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL { var db uintptr = (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+12336 /* "BEGIN" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+12752 /* "BEGIN" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) // Point the object iterator at the first object if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -159007,24 +161523,24 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_DONE } else { if (((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*RbuState)(unsafe.Pointer(pState)).FeStage == 0)) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) { - rbuCopyPragma(tls, p, ts+14556 /* "page_size" */) - rbuCopyPragma(tls, p, ts+13968 /* "auto_vacuum" */) + rbuCopyPragma(tls, p, ts+14985 /* "page_size" */) + rbuCopyPragma(tls, p, ts+14397 /* "auto_vacuum" */) } // Open transactions both databases. The *-oal file is opened or // created at this point. if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, ts+29390 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, ts+29914 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } // Check if the main database is a zipvfs db. If it is, set the upper // level pager to use "journal_mode=off". This prevents it from // generating a large journal using a temp file. if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - var frc int32 = Xsqlite3_file_control(tls, db, ts+5282 /* "main" */, SQLITE_FCNTL_ZIPVFS, uintptr(0)) + var frc int32 = Xsqlite3_file_control(tls, db, ts+5327 /* "main" */, SQLITE_FCNTL_ZIPVFS, uintptr(0)) if frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, - db, ts+29406 /* "PRAGMA journal_m..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + db, ts+29930 /* "PRAGMA journal_m..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } } @@ -159051,7 +161567,7 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) // Allocate and return an RBU handle with all fields zeroed except for the // error code, which is set to SQLITE_MISUSE. -func rbuMisuseError(tls *libc.TLS) uintptr { /* sqlite3.c:199953:19: */ +func rbuMisuseError(tls *libc.TLS) uintptr { /* sqlite3.c:202976:19: */ var pRet uintptr pRet = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Sqlite3rbu{}))) if pRet != 0 { @@ -159062,7 +161578,7 @@ func rbuMisuseError(tls *libc.TLS) uintptr { /* sqlite3.c:199953:19: */ } // Open and return a new RBU handle. -func Xsqlite3rbu_open(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:199966:23: */ +func Xsqlite3rbu_open(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:202989:23: */ if (zTarget == uintptr(0)) || (zRbu == uintptr(0)) { return rbuMisuseError(tls) } @@ -159071,13 +161587,13 @@ func Xsqlite3rbu_open(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintp } // Open a handle to begin or resume an RBU VACUUM operation. -func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) uintptr { /* sqlite3.c:199979:23: */ +func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) uintptr { /* sqlite3.c:203002:23: */ if zTarget == uintptr(0) { return rbuMisuseError(tls) } if zState != 0 { var n int32 = int32(libc.Xstrlen(tls, zState)) - if (n >= 7) && (0 == libc.Xmemcmp(tls, ts+29430 /* "-vactmp" */, (zState+uintptr((n-7))), uint64(7))) { + if (n >= 7) && (0 == libc.Xmemcmp(tls, ts+29954 /* "-vactmp" */, (zState+uintptr((n-7))), uint64(7))) { return rbuMisuseError(tls) } } @@ -159086,7 +161602,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) uintptr } // Return the database handle used by pRbu. -func Xsqlite3rbu_db(tls *libc.TLS, pRbu uintptr, bRbu int32) uintptr { /* sqlite3.c:199997:20: */ +func Xsqlite3rbu_db(tls *libc.TLS, pRbu uintptr, bRbu int32) uintptr { /* sqlite3.c:203020:20: */ var db uintptr = uintptr(0) if pRbu != 0 { db = func() uintptr { @@ -159102,12 +161618,12 @@ func Xsqlite3rbu_db(tls *libc.TLS, pRbu uintptr, bRbu int32) uintptr { /* sqlite // If the error code currently stored in the RBU handle is SQLITE_CONSTRAINT, // then edit any error message string so as to remove all occurrences of // the pattern "rbu_imp_[0-9]*". -func rbuEditErrmsg(tls *libc.TLS, p uintptr) { /* sqlite3.c:200011:13: */ +func rbuEditErrmsg(tls *libc.TLS, p uintptr) { /* sqlite3.c:203034:13: */ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_CONSTRAINT) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg != 0) { var i uint32 var nErrmsg Size_t = libc.Xstrlen(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg) for i = uint32(0); Size_t(i) < (nErrmsg - uint64(8)); i++ { - if libc.Xmemcmp(tls, ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i)), ts+27481 /* "rbu_imp_" */, uint64(8)) == 0 { + if libc.Xmemcmp(tls, ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i)), ts+28005 /* "rbu_imp_" */, uint64(8)) == 0 { var nDel int32 = 8 for (int32(*(*int8)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr((i + uint32(nDel)))))) >= '0') && (int32(*(*int8)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr((i + uint32(nDel)))))) <= '9') { nDel++ @@ -159120,13 +161636,13 @@ func rbuEditErrmsg(tls *libc.TLS, p uintptr) { /* sqlite3.c:200011:13: */ } // Close the RBU handle. -func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:200029:16: */ +func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:203052:16: */ var rc int32 if p != 0 { // Commit the transaction to the *-oal file. if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL) { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+12351 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+12767 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } // Sync the db file if currently doing an incremental checkpoint @@ -159138,7 +161654,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sq rbuSaveState(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL) { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+12351 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+12767 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } // Close any open statement handles. @@ -159150,7 +161666,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sq // specifying the current target and state databases to start a new // vacuum from scratch. if (((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0) { - var rc2 int32 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+29438 /* "DELETE FROM stat..." */, uintptr(0), uintptr(0), uintptr(0)) + var rc2 int32 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+29962 /* "DELETE FROM stat..." */, uintptr(0), uintptr(0), uintptr(0)) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_DONE) && (rc2 != SQLITE_OK) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -159183,13 +161699,13 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sq // Return the total number of key-value operations (inserts, deletes or // updates) that have been performed on the target database since the // current RBU update was started. -func Xsqlite3rbu_progress(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:200092:26: */ +func Xsqlite3rbu_progress(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:203115:26: */ return Sqlite3_int64((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnProgress) } // Return permyriadage progress indications for the two main stages of // an RBU update. -func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uintptr) { /* sqlite3.c:200100:17: */ +func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uintptr) { /* sqlite3.c:203123:17: */ var MAX_PROGRESS int32 = 10000 switch (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage { case RBU_STAGE_OAL: @@ -159222,7 +161738,7 @@ func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uint } // Return the current state of the RBU vacuum or update operation. -func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200135:16: */ +func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:203158:16: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -159240,7 +161756,7 @@ func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200135:16: return int32(0) } -func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200163:16: */ +func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:203186:16: */ var rc int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc if rc == SQLITE_DONE { return SQLITE_OK @@ -159249,7 +161765,7 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200163 if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+12351 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+12767 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0)) } } @@ -159266,19 +161782,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200163 if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+12351 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+12767 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { var zBegin uintptr if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - zBegin = ts + 12336 /* "BEGIN" */ + zBegin = ts + 12752 /* "BEGIN" */ } else { - zBegin = ts + 29390 /* "BEGIN IMMEDIATE" */ + zBegin = ts + 29914 /* "BEGIN IMMEDIATE" */ } rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29390 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+29914 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), uintptr(0)) } } @@ -159345,7 +161861,7 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200163 // relinquished). Finally, calls to xSync() on the target database // file fail with SQLITE_INTERNAL errors. -func rbuUnlockShm(tls *libc.TLS, p uintptr) { /* sqlite3.c:200256:13: */ +func rbuUnlockShm(tls *libc.TLS, p uintptr) { /* sqlite3.c:203279:13: */ if (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 { var xShmLock uintptr = (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock @@ -159360,7 +161876,7 @@ func rbuUnlockShm(tls *libc.TLS, p uintptr) { /* sqlite3.c:200256:13: */ } // -func rbuUpdateTempSize(tls *libc.TLS, pFd uintptr, nNew Sqlite3_int64) int32 { /* sqlite3.c:200272:12: */ +func rbuUpdateTempSize(tls *libc.TLS, pFd uintptr, nNew Sqlite3_int64) int32 { /* sqlite3.c:203295:12: */ var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(pFd)).FpRbu var nDiff I64 = (nNew - (*Rbu_file)(unsafe.Pointer(pFd)).Fsz) *(*I64)(unsafe.Pointer(pRbu + 360 /* &.szTemp */)) += (nDiff) @@ -159378,7 +161894,7 @@ func rbuUpdateTempSize(tls *libc.TLS, pFd uintptr, nNew Sqlite3_int64) int32 { / // for all file descriptors with rbu_file.pDb!=0. If the argument has // rbu_file.pDb!=0, then it is assumed to already be present on the // main list and is only added to the pDb!=0 list. -func rbuMainlistAdd(tls *libc.TLS, p uintptr) { /* sqlite3.c:200290:13: */ +func rbuMainlistAdd(tls *libc.TLS, p uintptr) { /* sqlite3.c:203313:13: */ var pRbuVfs uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs var pIter uintptr @@ -159400,7 +161916,7 @@ func rbuMainlistAdd(tls *libc.TLS, p uintptr) { /* sqlite3.c:200290:13: */ } // Remove an item from the main-db lists. -func rbuMainlistRemove(tls *libc.TLS, p uintptr) { /* sqlite3.c:200312:13: */ +func rbuMainlistRemove(tls *libc.TLS, p uintptr) { /* sqlite3.c:203335:13: */ var pp uintptr Xsqlite3_mutex_enter(tls, (*Rbu_vfs)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs)).Fmutex) for pp = ((*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs + 192 /* &.pMain */); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && (*(*uintptr)(unsafe.Pointer(pp)) != p); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 88 /* &.pMainNext */) { @@ -159425,7 +161941,7 @@ func rbuMainlistRemove(tls *libc.TLS, p uintptr) { /* sqlite3.c:200312:13: */ // // If parameter bRbu is true, only search for file-descriptors with // rbu_file.pDb!=0. -func rbuFindMaindb(tls *libc.TLS, pRbuVfs uintptr, zWal uintptr, bRbu int32) uintptr { /* sqlite3.c:200333:17: */ +func rbuFindMaindb(tls *libc.TLS, pRbuVfs uintptr, zWal uintptr, bRbu int32) uintptr { /* sqlite3.c:203356:17: */ var pDb uintptr Xsqlite3_mutex_enter(tls, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fmutex) if bRbu != 0 { @@ -159440,7 +161956,7 @@ func rbuFindMaindb(tls *libc.TLS, pRbuVfs uintptr, zWal uintptr, bRbu int32) uin } // Close an rbu file. -func rbuVfsClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:200348:12: */ +func rbuVfsClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:203371:12: */ var p uintptr = pFile var rc int32 var i int32 @@ -159468,7 +161984,7 @@ func rbuVfsClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:200348:12: * // Read and return an unsigned 32-bit big-endian integer from the buffer // passed as the only argument. -func rbuGetU32(tls *libc.TLS, aBuf uintptr) U32 { /* sqlite3.c:200381:12: */ +func rbuGetU32(tls *libc.TLS, aBuf uintptr) U32 { /* sqlite3.c:203404:12: */ return ((((U32(*(*U8)(unsafe.Pointer(aBuf))) << 24) + (U32(*(*U8)(unsafe.Pointer(aBuf + 1))) << 16)) + (U32(*(*U8)(unsafe.Pointer(aBuf + 2))) << 8)) + @@ -159477,20 +161993,20 @@ func rbuGetU32(tls *libc.TLS, aBuf uintptr) U32 { /* sqlite3.c:200381:12: */ // Write an unsigned 32-bit value in big-endian format to the supplied // buffer. -func rbuPutU32(tls *libc.TLS, aBuf uintptr, iVal U32) { /* sqlite3.c:200392:13: */ +func rbuPutU32(tls *libc.TLS, aBuf uintptr, iVal U32) { /* sqlite3.c:203415:13: */ *(*U8)(unsafe.Pointer(aBuf)) = (U8((iVal >> 24) & U32(0xFF))) *(*U8)(unsafe.Pointer(aBuf + 1)) = (U8((iVal >> 16) & U32(0xFF))) *(*U8)(unsafe.Pointer(aBuf + 2)) = (U8((iVal >> 8) & U32(0xFF))) *(*U8)(unsafe.Pointer(aBuf + 3)) = (U8((iVal >> 0) & U32(0xFF))) } -func rbuPutU16(tls *libc.TLS, aBuf uintptr, iVal U16) { /* sqlite3.c:200399:13: */ +func rbuPutU16(tls *libc.TLS, aBuf uintptr, iVal U16) { /* sqlite3.c:203422:13: */ *(*U8)(unsafe.Pointer(aBuf)) = (U8((int32(iVal) >> 8) & 0xFF)) *(*U8)(unsafe.Pointer(aBuf + 1)) = (U8((int32(iVal) >> 0) & 0xFF)) } // Read data from an rbuVfs-file. -func rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:200407:12: */ +func rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:203430:12: */ var p uintptr = pFile var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu var rc int32 @@ -159550,7 +162066,7 @@ func rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sq } // Write data to an rbuVfs-file. -func rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:200473:12: */ +func rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:203496:12: */ var p uintptr = pFile var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu var rc int32 @@ -159587,7 +162103,7 @@ func rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst S } // Truncate an rbuVfs-file. -func rbuVfsTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sqlite3.c:200516:12: */ +func rbuVfsTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sqlite3.c:203539:12: */ var p uintptr = pFile if (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_DELETEONCLOSE) != 0) && ((*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0) { var rc int32 = rbuUpdateTempSize(tls, p, size) @@ -159599,7 +162115,7 @@ func rbuVfsTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* } // Sync an rbuVfs-file. -func rbuVfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:200528:12: */ +func rbuVfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:203551:12: */ var p uintptr = pFile if ((*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FeStage == RBU_STAGE_CAPTURE) { if ((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_MAIN_DB) != 0 { @@ -159611,7 +162127,7 @@ func rbuVfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c: } // Return the current file-size of an rbuVfs-file. -func rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlite3.c:200542:12: */ +func rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlite3.c:203565:12: */ var p uintptr = pFile var rc int32 rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 48 /* &.xFileSize */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, pSize) @@ -159629,7 +162145,7 @@ func rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqli } // Lock an rbuVfs-file. -func rbuVfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:200563:12: */ +func rbuVfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:203586:12: */ var p uintptr = pFile var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu var rc int32 = SQLITE_OK @@ -159647,19 +162163,19 @@ func rbuVfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c: } // Unlock an rbuVfs-file. -func rbuVfsUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:200585:12: */ +func rbuVfsUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:203608:12: */ var p uintptr = pFile return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 64 /* &.xUnlock */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, eLock) } // Check if another file-handle holds a RESERVED lock on an rbuVfs-file. -func rbuVfsCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* sqlite3.c:200593:12: */ +func rbuVfsCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* sqlite3.c:203616:12: */ var p uintptr = pFile return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, pResOut) } // File control method. For custom operations on an rbuVfs-file. -func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:200601:12: */ +func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:203624:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -159682,7 +162198,7 @@ func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&xControl)))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, SQLITE_FCNTL_ZIPVFS, bp+16 /* &dummy */) if rc == SQLITE_OK { rc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, ts+29465 /* "rbu/zipvfs setup..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, ts+29989 /* "rbu/zipvfs setup..." */, 0) } else if rc == SQLITE_NOTFOUND { (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p (*Rbu_file)(unsafe.Pointer(p)).FpRbu = pRbu @@ -159705,7 +162221,7 @@ func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int if (rc == SQLITE_OK) && (op == SQLITE_FCNTL_VFSNAME) { var pRbuVfs uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs var zIn uintptr = *(*uintptr)(unsafe.Pointer(pArg)) - var zOut uintptr = Xsqlite3_mprintf(tls, ts+29488 /* "rbu(%s)/%z" */, libc.VaList(bp, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + var zOut uintptr = Xsqlite3_mprintf(tls, ts+30012 /* "rbu(%s)/%z" */, libc.VaList(bp, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = SQLITE_NOMEM @@ -159716,28 +162232,29 @@ func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int } // Return the sector-size in bytes for an rbuVfs-file. -func rbuVfsSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:200657:12: */ +func rbuVfsSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:203680:12: */ var p uintptr = pFile return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 88 /* &.xSectorSize */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal) } // Return the device characteristic flags supported by an rbuVfs-file. -func rbuVfsDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:200665:12: */ +func rbuVfsDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:203688:12: */ var p uintptr = pFile return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal) } // Take or release a shared-memory lock. -func rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:200673:12: */ +func rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:203696:12: */ var p uintptr = pFile var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu var rc int32 = SQLITE_OK - if (pRbu != 0) && (((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_OAL) || ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_MOVE)) { - // Magic number 1 is the WAL_CKPT_LOCK lock. Preventing SQLite from - // taking this lock also prevents any checkpoints from occurring. - // todo: really, it's not clear why this might occur, as - // wal_autocheckpoint ought to be turned off. + if (pRbu != 0) && ((((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_OAL) || + ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_MOVE)) || + ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_DONE)) { + // Prevent SQLite from taking a shm-lock on the target file when it + // is supplying heap memory to the upper layer in place of *-shm + // segments. if (ofst == WAL_LOCK_CKPT) && (n == 1) { rc = SQLITE_BUSY } @@ -159746,11 +162263,10 @@ func rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int3 if (pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_CAPTURE) { bCapture = 1 } - if (bCapture == 0) || (0 == (flags & SQLITE_SHM_UNLOCK)) { rc = (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 112 /* &.xShmLock */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, ofst, n, flags) if (bCapture != 0) && (rc == SQLITE_OK) { - *(*U32)(unsafe.Pointer(pRbu + 316 /* &.mLock */)) |= (U32(int32(1) << ofst)) + *(*U32)(unsafe.Pointer(pRbu + 316 /* &.mLock */)) |= (U32(((int32(1) << n) - 1) << ofst)) } } } @@ -159759,7 +162275,7 @@ func rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int3 } // Obtain a pointer to a mapping of a single 32KiB page of the *-shm file. -func rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 { /* sqlite3.c:200709:12: */ +func rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 { /* sqlite3.c:203734:12: */ var p uintptr = pFile var rc int32 = SQLITE_OK var eStage int32 = func() int32 { @@ -159814,13 +162330,13 @@ func rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, i } // Memory barrier. -func rbuVfsShmBarrier(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:200767:13: */ +func rbuVfsShmBarrier(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:203792:13: */ var p uintptr = pFile (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 120 /* &.xShmBarrier */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal) } // The xShmUnmap method. -func rbuVfsShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* sqlite3.c:200775:12: */ +func rbuVfsShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* sqlite3.c:203800:12: */ var p uintptr = pFile var rc int32 = SQLITE_OK var eStage int32 = func() int32 { @@ -159841,7 +162357,7 @@ func rbuVfsShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* sqli } // Open an rbu file handle. -func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:200794:12: */ +func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:203819:12: */ var pRbuVfs uintptr = pVfs var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRealVfs var pFd uintptr = pFile @@ -159873,7 +162389,7 @@ func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags var nCopy Size_t var zCopy uintptr if (*Sqlite3rbu)(unsafe.Pointer(((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu))).FzTarget == uintptr(0) { - zBase = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, ts+5282 /* "main" */) + zBase = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, ts+5327 /* "main" */) zBase = Xsqlite3_filename_wal(tls, zBase) } nCopy = libc.Xstrlen(tls, zBase) @@ -159897,7 +162413,7 @@ func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags } if ((oflags & SQLITE_OPEN_MAIN_DB) != 0) && - (Xsqlite3_uri_boolean(tls, zName, ts+29499 /* "rbu_memory" */, 0) != 0) { + (Xsqlite3_uri_boolean(tls, zName, ts+30023 /* "rbu_memory" */, 0) != 0) { oflags = ((((SQLITE_OPEN_TEMP_DB | SQLITE_OPEN_READWRITE) | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) @@ -159939,17 +162455,17 @@ var rbuvfs_io_methods = Sqlite3_io_methods{ FxShmLock: 0, // xShmLock FxShmBarrier: 0, // xShmBarrier FxShmUnmap: 0, // xFetch, xUnfetch -} /* sqlite3.c:200801:29 */ +} /* sqlite3.c:203826:29 */ // Delete the file located at zPath. -func rbuVfsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:200906:12: */ +func rbuVfsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:203931:12: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pRealVfs + 48 /* &.xDelete */))))(tls, pRealVfs, zPath, dirSync) } // Test for access permissions. Return true if the requested permission // is available, or false otherwise. -func rbuVfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:200915:12: */ +func rbuVfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:203940:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -159992,13 +162508,13 @@ func rbuVfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResO // Populate buffer zOut with the full canonical pathname corresponding // to the pathname in zPath. zOut is guaranteed to point to a buffer // of at least (DEVSYM_MAX_PATHNAME+1) bytes. -func rbuVfsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:200963:12: */ +func rbuVfsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:203988:12: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pRealVfs + 64 /* &.xFullPathname */))))(tls, pRealVfs, zPath, nOut, zOut) } // Open the dynamic library located at zPath and return a handle. -func rbuVfsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:200977:13: */ +func rbuVfsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:204002:13: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pRealVfs + 72 /* &.xDlOpen */))))(tls, pRealVfs, zPath) } @@ -160006,51 +162522,51 @@ func rbuVfsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlit // Populate the buffer zErrMsg (size nByte bytes) with a human readable // utf-8 string describing the most recent error encountered associated // with dynamic libraries. -func rbuVfsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* sqlite3.c:200987:13: */ +func rbuVfsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* sqlite3.c:204012:13: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer((pRealVfs + 80 /* &.xDlError */))))(tls, pRealVfs, nByte, zErrMsg) } // Return a pointer to the symbol zSymbol in the dynamic library pHandle. -func rbuVfsDlSym(tls *libc.TLS, pVfs uintptr, pArg uintptr, zSym uintptr) uintptr { /* sqlite3.c:200995:13: */ +func rbuVfsDlSym(tls *libc.TLS, pVfs uintptr, pArg uintptr, zSym uintptr) uintptr { /* sqlite3.c:204020:13: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((pRealVfs + 88 /* &.xDlSym */))))(tls, pRealVfs, pArg, zSym) } // Close the dynamic library handle pHandle. -func rbuVfsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:201007:13: */ +func rbuVfsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:204032:13: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pRealVfs + 96 /* &.xDlClose */))))(tls, pRealVfs, pHandle) } // Populate the buffer pointed to by zBufOut with nByte bytes of // random data. -func rbuVfsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:201017:12: */ +func rbuVfsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:204042:12: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pRealVfs + 104 /* &.xRandomness */))))(tls, pRealVfs, nByte, zBufOut) } // Sleep for nMicro microseconds. Return the number of microseconds // actually slept. -func rbuVfsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:201026:12: */ +func rbuVfsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:204051:12: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pRealVfs + 112 /* &.xSleep */))))(tls, pRealVfs, nMicro) } // Return the current time as a Julian Day number in *pTimeOut. -func rbuVfsCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:201034:12: */ +func rbuVfsCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:204059:12: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pRealVfs + 120 /* &.xCurrentTime */))))(tls, pRealVfs, pTimeOut) } // No-op. -func rbuVfsGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* sqlite3.c:201042:12: */ +func rbuVfsGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* sqlite3.c:204067:12: */ return 0 } // Deregister and destroy an RBU vfs created by an earlier call to // sqlite3rbu_create_vfs(). -func Xsqlite3rbu_destroy_vfs(tls *libc.TLS, zName uintptr) { /* sqlite3.c:201050:17: */ +func Xsqlite3rbu_destroy_vfs(tls *libc.TLS, zName uintptr) { /* sqlite3.c:204075:17: */ var pVfs uintptr = Xsqlite3_vfs_find(tls, zName) if (pVfs != 0) && ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxOpen == *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32 @@ -160064,7 +162580,7 @@ func Xsqlite3rbu_destroy_vfs(tls *libc.TLS, zName uintptr) { /* sqlite3.c:201050 // Create an RBU VFS named zName that accesses the underlying file-system // via existing VFS zParent. The new object is registered as a non-default // VFS with SQLite before returning. -func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) int32 { /* sqlite3.c:201064:16: */ +func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) int32 { /* sqlite3.c:204089:16: */ var pNew uintptr = uintptr(0) // Newly allocated VFS var rc int32 = SQLITE_OK @@ -160125,17 +162641,17 @@ var vfs_template = Sqlite3_vfs{ FxSleep: 0, // xSleep FxCurrentTime: 0, // xCurrentTime FxGetLastError: 0, // Unimplemented version 3 methods -} /* sqlite3.c:201067:22 */ +} /* sqlite3.c:204092:22 */ // Configure the aggregate temp file size limit for this RBU handle. -func Xsqlite3rbu_temp_size_limit(tls *libc.TLS, pRbu uintptr, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:201142:26: */ +func Xsqlite3rbu_temp_size_limit(tls *libc.TLS, pRbu uintptr, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:204167:26: */ if n >= int64(0) { (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit = n } return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit } -func Xsqlite3rbu_temp_size(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:201149:26: */ +func Xsqlite3rbu_temp_size(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:204174:26: */ return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTemp } @@ -160272,7 +162788,7 @@ type Fts5Global1 = struct { FpTok uintptr FpDfltTok uintptr FpCsr uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ //************************************************************************ @@ -160399,13 +162915,13 @@ type Fts5Global1 = struct { // Mark a function parameter as unused, to suppress nuisance compiler // warnings. -type Fts5Global = Fts5Global1 /* sqlite3.c:208614:27 */ +type Fts5Global = Fts5Global1 /* sqlite3.c:211770:27 */ type Fts5Colset1 = struct { FnCol int32 FaiCol [1]int32 -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5Colset = Fts5Colset1 /* sqlite3.c:208615:27 */ +type Fts5Colset = Fts5Colset1 /* sqlite3.c:211771:27 */ // ************************************************************************* // @@ -160433,24 +162949,24 @@ type Fts5Config1 = struct { FpTok uintptr FpTokApi uintptr FbLock int32 + FePattern int32 FiCookie int32 Fpgsz int32 FnAutomerge int32 FnCrisisMerge int32 FnUsermerge int32 FnHashSize int32 - _ [4]byte FzRank uintptr FzRankArgs uintptr FpzErrmsg uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // ************************************************************************* // // Interface to code in fts5_config.c. fts5_config.c contains contains code // to parse the arguments passed to the CREATE VIRTUAL TABLE statement. -type Fts5Config = Fts5Config1 /* sqlite3.c:208635:27 */ +type Fts5Config = Fts5Config1 /* sqlite3.c:211791:27 */ // // End of interface to code in fts5_config.c. @@ -160465,7 +162981,7 @@ type Fts5Buffer1 = struct { Fp uintptr Fn int32 FnSpace int32 -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // // End of interface to code in fts5_config.c. @@ -160476,7 +162992,7 @@ type Fts5Buffer1 = struct { // Interface to code in fts5_buffer.c. // Buffer object for the incremental building of string data. -type Fts5Buffer = Fts5Buffer1 /* sqlite3.c:208758:27 */ +type Fts5Buffer = Fts5Buffer1 /* sqlite3.c:211917:27 */ type Fts5PoslistReader1 = struct { Fa uintptr @@ -160486,19 +163002,19 @@ type Fts5PoslistReader1 = struct { FbEof U8 _ [6]byte FiPos I64 -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5PoslistReader = Fts5PoslistReader1 /* sqlite3.c:208794:34 */ +type Fts5PoslistReader = Fts5PoslistReader1 /* sqlite3.c:211953:34 */ -type Fts5PoslistWriter1 = struct{ FiPrev I64 } /* sqlite3.c:208813:9 */ +type Fts5PoslistWriter1 = struct{ FiPrev I64 } /* sqlite3.c:211972:9 */ -type Fts5PoslistWriter = Fts5PoslistWriter1 /* sqlite3.c:208813:34 */ +type Fts5PoslistWriter = Fts5PoslistWriter1 /* sqlite3.c:211972:34 */ // Bucket of terms object used by the integrity-check in offsets=0 mode. -type Fts5Termset1 = struct{ FapHash [512]uintptr } /* sqlite3.c:208835:9 */ +type Fts5Termset1 = struct{ FapHash [512]uintptr } /* sqlite3.c:211994:9 */ // Bucket of terms object used by the integrity-check in offsets=0 mode. -type Fts5Termset = Fts5Termset1 /* sqlite3.c:208835:28 */ +type Fts5Termset = Fts5Termset1 /* sqlite3.c:211994:28 */ // // End of interface to code in fts5_buffer.c. @@ -160531,7 +163047,7 @@ type Fts5Index1 = struct { FpDataVersion uintptr FiStructVersion I64 FpStruct uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // // End of interface to code in fts5_buffer.c. @@ -160542,16 +163058,16 @@ type Fts5Index1 = struct { // Interface to code in fts5_index.c. fts5_index.c contains contains code // to access the data stored in the %_data table. -type Fts5Index = Fts5Index1 /* sqlite3.c:208849:26 */ +type Fts5Index = Fts5Index1 /* sqlite3.c:212008:26 */ type Fts5IndexIter1 = struct { FiRowid I64 FpData uintptr FnData int32 FbEof U8 _ [3]byte -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5IndexIter = Fts5IndexIter1 /* sqlite3.c:208850:30 */ +type Fts5IndexIter = Fts5IndexIter1 /* sqlite3.c:212009:30 */ // // End of interface to code in fts5_varint.c. @@ -160566,7 +163082,7 @@ type Fts5Table1 = struct { Fbase Sqlite3_vtab FpConfig uintptr FpIndex uintptr -} /* sqlite3.c:209049:9 */ +} /* sqlite3.c:212208:9 */ // // End of interface to code in fts5_varint.c. @@ -160577,7 +163093,7 @@ type Fts5Table1 = struct { // Interface to code in fts5_main.c. // Virtual-table object. -type Fts5Table = Fts5Table1 /* sqlite3.c:209049:26 */ +type Fts5Table = Fts5Table1 /* sqlite3.c:212208:26 */ // // End of interface to code in fts5.c. @@ -160594,7 +163110,7 @@ type Fts5Hash1 = struct { FnSlot int32 FpScan uintptr FaSlot uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // // End of interface to code in fts5.c. @@ -160603,7 +163119,7 @@ type Fts5Hash1 = struct { // ************************************************************************* // // Interface to code in fts5_hash.c. -type Fts5Hash = Fts5Hash1 /* sqlite3.c:209076:25 */ +type Fts5Hash = Fts5Hash1 /* sqlite3.c:212234:25 */ // // End of interface to code in fts5_hash.c. @@ -160622,7 +163138,7 @@ type Fts5Storage1 = struct { FnTotalRow I64 FaTotalSize uintptr FaStmt [11]uintptr -} /* sqlite3.c:209132:9 */ +} /* sqlite3.c:212290:9 */ // // End of interface to code in fts5_hash.c. @@ -160633,7 +163149,7 @@ type Fts5Storage1 = struct { // Interface to code in fts5_storage.c. fts5_storage.c contains contains // code to access the data stored in the %_content and %_docsize tables. -type Fts5Storage = Fts5Storage1 /* sqlite3.c:209132:28 */ +type Fts5Storage = Fts5Storage1 /* sqlite3.c:212290:28 */ // // End of interface to code in fts5_storage.c. @@ -160649,7 +163165,7 @@ type Fts5Expr1 = struct { FbDesc int32 FnPhrase int32 FapExprPhrase uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // // End of interface to code in fts5_storage.c. @@ -160658,7 +163174,7 @@ type Fts5Expr1 = struct { // ************************************************************************* // // Interface to code in fts5_expr.c. -type Fts5Expr = Fts5Expr1 /* sqlite3.c:209175:25 */ +type Fts5Expr = Fts5Expr1 /* sqlite3.c:212333:25 */ type Fts5ExprNode1 = struct { FeType int32 FbEof int32 @@ -160670,35 +163186,37 @@ type Fts5ExprNode1 = struct { FnChild int32 _ [4]byte FapChild [1]uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5ExprNode = Fts5ExprNode1 /* sqlite3.c:209176:29 */ +type Fts5ExprNode = Fts5ExprNode1 /* sqlite3.c:212334:29 */ type Fts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr -} /* sqlite3.c:209177:9 */ + FpConfig uintptr + FzErr uintptr + Frc int32 + FnPhrase int32 + FapPhrase uintptr + FpExpr uintptr + FbPhraseToAnd int32 + _ [4]byte +} /* sqlite3.c:212335:9 */ -type Fts5Parse = Fts5Parse1 /* sqlite3.c:209177:26 */ +type Fts5Parse = Fts5Parse1 /* sqlite3.c:212335:26 */ type Fts5Token1 = struct { Fp uintptr Fn int32 _ [4]byte -} /* sqlite3.c:209178:9 */ +} /* sqlite3.c:212336:9 */ -type Fts5Token = Fts5Token1 /* sqlite3.c:209178:26 */ +type Fts5Token = Fts5Token1 /* sqlite3.c:212336:26 */ type Fts5ExprPhrase1 = struct { FpNode uintptr Fposlist Fts5Buffer FnTerm int32 _ [4]byte FaTerm [1]Fts5ExprTerm -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5ExprPhrase = Fts5ExprPhrase1 /* sqlite3.c:209179:31 */ +type Fts5ExprPhrase = Fts5ExprPhrase1 /* sqlite3.c:212337:31 */ type Fts5ExprNearset1 = struct { FnNear int32 _ [4]byte @@ -160706,21 +163224,23 @@ type Fts5ExprNearset1 = struct { FnPhrase int32 _ [4]byte FapPhrase [1]uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5ExprNearset = Fts5ExprNearset1 /* sqlite3.c:209180:32 */ +type Fts5ExprNearset = Fts5ExprNearset1 /* sqlite3.c:212338:32 */ type Fts5PoslistPopulator1 = struct { Fwriter Fts5PoslistWriter FbOk int32 FbMiss int32 -} /* sqlite3.c:209220:9 */ +} /* sqlite3.c:212386:9 */ -type Fts5PoslistPopulator = Fts5PoslistPopulator1 /* sqlite3.c:209220:37 */ +type Fts5PoslistPopulator = Fts5PoslistPopulator1 /* sqlite3.c:212386:37 */ // // End of interface to code in fts5_unicode2.c. // +// This file is automatically generated by Lemon from input grammar +// source file "fts5parse.y". // 2000-05-29 // // The author disclaims copyright to this source code. In place of @@ -160743,8 +163263,6 @@ type Fts5PoslistPopulator = Fts5PoslistPopulator1 /* sqlite3.c:209220:37 */ // // The following is the concatenation of all %include directives from the // input grammar file: -// #include -// #include //*********** Begin %include sections from the grammar *********************** // #include "fts5Int.h" @@ -160762,11 +163280,9 @@ type Fts5PoslistPopulator = Fts5PoslistPopulator1 /* sqlite3.c:209220:37 */ // into sqlite3ParserAlloc(). The default is size_t. //*************** End of %include directives ********************************* -// These constants specify the various numeric values for terminal symbols -// in a format understandable to "makeheaders". This section is blank unless -// "lemon" is run with the "-m" command-line option. -// Begin makeheaders token definitions ************************ -//*************** End makeheaders token definitions ************************** +// These constants specify the various numeric values for terminal symbols. +// Begin token definitions ************************************ +//*************** End token definitions ************************************** // The next sections is a series of control #defines. // various aspects of the generated parser. @@ -160823,7 +163339,7 @@ type Fts5YYMINORTYPE = struct { _ [0]uint64 Ffts5yyinit int32 _ [12]byte -} /* sqlite3.c:209477:3 */ +} /* sqlite3.c:212662:3 */ //************ End control #defines ****************************************** // Define the fts5yytestcase() macro to be a no-op if is not already defined @@ -160896,7 +163412,7 @@ var fts5yy_action = [105]uint8{ /* 80 */ uint8(5), uint8(3), uint8(63), uint8(5), uint8(3), uint8(62), uint8(12), uint8(2), uint8(86), uint8(13), /* 90 */ uint8(9), uint8(30), uint8(10), uint8(10), uint8(54), uint8(57), uint8(75), uint8(78), uint8(78), uint8(53), /* 100 */ uint8(57), uint8(15), uint8(82), uint8(82), uint8(71), -} /* sqlite3.c:209570:31 */ +} /* sqlite3.c:212755:31 */ var fts5yy_lookahead = [121]uint8{ /* 0 */ uint8(16), uint8(17), uint8(18), uint8(19), uint8(20), uint8(22), uint8(22), uint8(24), uint8(24), uint8(17), /* 10 */ uint8(18), uint8(19), uint8(20), uint8(7), uint8(22), uint8(9), uint8(24), uint8(17), uint8(18), uint8(19), @@ -160911,23 +163427,23 @@ var fts5yy_lookahead = [121]uint8{ /* 100 */ uint8(9), uint8(9), uint8(27), uint8(27), uint8(11), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), /* 110 */ uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), /* 120 */ uint8(27), -} /* sqlite3.c:209583:29 */ +} /* sqlite3.c:212768:29 */ var fts5yy_shift_ofst = [35]uint8{ /* 0 */ uint8(44), uint8(44), uint8(44), uint8(44), uint8(44), uint8(44), uint8(51), uint8(77), uint8(43), uint8(12), /* 10 */ uint8(14), uint8(83), uint8(82), uint8(14), uint8(23), uint8(23), uint8(31), uint8(31), uint8(71), uint8(74), /* 20 */ uint8(78), uint8(81), uint8(86), uint8(91), uint8(6), uint8(53), uint8(53), uint8(60), uint8(64), uint8(68), /* 30 */ uint8(53), uint8(87), uint8(92), uint8(53), uint8(93), -} /* sqlite3.c:209601:28 */ +} /* sqlite3.c:212786:28 */ var fts5yy_reduce_ofst = [18]int8{ /* 0 */ int8(-16), int8(-8), int8(0), int8(9), int8(17), int8(25), int8(46), int8(-17), int8(-17), int8(37), /* 10 */ int8(67), int8(4), int8(4), int8(8), int8(4), int8(20), int8(27), int8(38), -} /* sqlite3.c:209610:26 */ +} /* sqlite3.c:212795:26 */ var fts5yy_default = [35]uint8{ /* 0 */ uint8(80), uint8(80), uint8(80), uint8(80), uint8(80), uint8(80), uint8(95), uint8(80), uint8(80), uint8(105), /* 10 */ uint8(80), uint8(110), uint8(110), uint8(80), uint8(110), uint8(110), uint8(80), uint8(80), uint8(80), uint8(80), /* 20 */ uint8(80), uint8(91), uint8(80), uint8(80), uint8(80), uint8(101), uint8(100), uint8(80), uint8(80), uint8(90), /* 30 */ uint8(103), uint8(80), uint8(80), uint8(104), uint8(80), -} /* sqlite3.c:209614:31 */ +} /* sqlite3.c:212799:31 */ //********* End of lemon-generated parsing tables **************************** // The next table maps tokens (terminal symbols) into fallback tokens. @@ -160964,9 +163480,9 @@ type fts5yyStackEntry = struct { Fmajor uint8 _ [6]byte Fminor Fts5YYMINORTYPE -} /* sqlite3.c:209657:1 */ +} /* sqlite3.c:212842:1 */ -type Fts5yyStackEntry = fts5yyStackEntry /* sqlite3.c:209664:33 */ +type Fts5yyStackEntry = fts5yyStackEntry /* sqlite3.c:212849:33 */ // The state of the parser is completely contained in an instance of // the following structure @@ -160975,9 +163491,9 @@ type fts5yyParser = struct { FpParse uintptr Ffts5yystack [100]Fts5yyStackEntry Ffts5yystackEnd uintptr -} /* sqlite3.c:209668:1 */ +} /* sqlite3.c:212853:1 */ -type Fts5yyParser = fts5yyParser /* sqlite3.c:209687:29 */ +type Fts5yyParser = fts5yyParser /* sqlite3.c:212872:29 */ // Datatype of the argument to the memory allocated passed as the // second argument to sqlite3Fts5ParserAlloc() below. This can be changed by @@ -160985,7 +163501,7 @@ type Fts5yyParser = fts5yyParser /* sqlite3.c:209687:29 */ // grammar. // Initialize a new parser that has already been allocated. -func sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { /* sqlite3.c:209835:13: */ +func sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { /* sqlite3.c:213021:13: */ var fts5yypParser uintptr = fts5yypRawParser (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos = fts5yypParser + 16 /* &.fts5yystack */ @@ -161004,7 +163520,7 @@ func sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { /* sqlite3 // Outputs: // A pointer to a parser. This pointer is used in subsequent calls // to sqlite3Fts5Parser and sqlite3Fts5ParserFree. -func sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) uintptr { /* sqlite3.c:209874:13: */ +func sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) uintptr { /* sqlite3.c:213060:13: */ var fts5yypParser uintptr fts5yypParser = (*(*func(*libc.TLS, U64) uintptr)(unsafe.Pointer(&mallocProc)))(tls, U64(unsafe.Sizeof(Fts5yyParser{}))) if fts5yypParser != 0 { @@ -161020,7 +163536,7 @@ func sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) uintptr { /* sqli // 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 fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8, fts5yypminor uintptr) { /* sqlite3.c:209893:13: */ +func fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8, fts5yypminor uintptr) { /* sqlite3.c:213079:13: */ var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse _ = pParse @@ -161078,7 +163594,7 @@ func fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8, // // If there is a destructor routine associated with the token which // is popped from the stack, then call it. -func fts5yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:209952:13: */ +func fts5yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:213138:13: */ var fts5yytos uintptr fts5yytos = libc.PostDecUintptr(&(*Fts5yyParser)(unsafe.Pointer(pParser)).Ffts5yytos, 24) @@ -161086,7 +163602,7 @@ func fts5yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:2099 } // Clear all secondary memory allocations from the parser -func sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:209970:13: */ +func sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:213156:13: */ var pParser uintptr = p for (*Fts5yyParser)(unsafe.Pointer(pParser)).Ffts5yytos > pParser+16 /* &.fts5yystack */ { fts5yy_pop_parser_stack(tls, pParser) @@ -161099,7 +163615,7 @@ func sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:209970:1 // If the fts5YYPARSEFREENEVERNULL macro exists (for example because it // is defined in a %include section of the input grammar) then it is // assumed that the input pointer is never NULL. -func sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { /* sqlite3.c:209987:13: */ +func sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { /* sqlite3.c:213173:13: */ if p == uintptr(0) { return } @@ -161123,7 +163639,7 @@ func sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { /* sqli // Find the appropriate action for a parser given the terminal // look-ahead token iLookAhead. -func fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) uint8 { /* sqlite3.c:210050:25: */ +func fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) uint8 { /* sqlite3.c:213236:25: */ var i int32 if int32(stateno) > Fts5YY_MAX_SHIFT { @@ -161147,7 +163663,7 @@ func fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) ui // Find the appropriate action for a parser given the non-terminal // look-ahead token iLookAhead. -func fts5yy_find_reduce_action(tls *libc.TLS, stateno uint8, iLookAhead uint8) uint8 { /* sqlite3.c:210115:25: */ +func fts5yy_find_reduce_action(tls *libc.TLS, stateno uint8, iLookAhead uint8) uint8 { /* sqlite3.c:213301:25: */ var i int32 i = int32(fts5yy_reduce_ofst[stateno]) @@ -161158,7 +163674,7 @@ func fts5yy_find_reduce_action(tls *libc.TLS, stateno uint8, iLookAhead uint8) u } // The following routine is called if the stack overflows. -func fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:210144:13: */ +func fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:213330:13: */ var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse for (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > fts5yypParser+16 /* &.fts5yystack */ { @@ -161168,7 +163684,7 @@ func fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:21 // stack every overflows //******* Begin %stack_overflow code ***************************************** - sqlite3Fts5ParseError(tls, pParse, ts+29510 /* "fts5: parser sta..." */, 0) + sqlite3Fts5ParseError(tls, pParse, ts+30034 /* "fts5: parser sta..." */, 0) //******* End %stack_overflow code ******************************************* (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse // Suppress warning about unused %extra_argument var @@ -161177,7 +163693,7 @@ func fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:21 // Print tracing information for a SHIFT action // Perform a shift action. -func fts5yy_shift(tls *libc.TLS, fts5yypParser uintptr, fts5yyNewState uint8, fts5yyMajor uint8, fts5yyMinor Fts5Token) { /* sqlite3.c:210187:13: */ +func fts5yy_shift(tls *libc.TLS, fts5yypParser uintptr, fts5yyNewState uint8, fts5yyMajor uint8, fts5yyMinor Fts5Token) { /* sqlite3.c:213373:13: */ var fts5yytos uintptr (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos += 24 if (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd { @@ -161226,7 +163742,7 @@ var fts5yyRuleInfoLhs = [28]uint8{ uint8(24), // (25) phrase ::= STRING star_opt uint8(26), // (26) star_opt ::= STAR uint8(26), // (27) star_opt ::= -} /* sqlite3.c:210228:29 */ +} /* sqlite3.c:213414:29 */ // For rule J, fts5yyRuleInfoNRhs[J] contains the negative of the number // of symbols on the right-hand side of that rule. @@ -161259,7 +163775,7 @@ var fts5yyRuleInfoNRhs = [28]int8{ int8(-2), // (25) phrase ::= STRING star_opt int8(-1), // (26) star_opt ::= STAR int8(0), // (27) star_opt ::= -} /* sqlite3.c:210261:26 */ +} /* sqlite3.c:213447:26 */ // Forward Declaration @@ -161271,7 +163787,7 @@ var fts5yyRuleInfoNRhs = [28]int8{ // if the lookahead token has already been consumed. As this procedure is // only called from one place, optimizing compilers will in-line it, which // means that the extra parameters have no performance impact. -func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, fts5yyLookahead int32, fts5yyLookaheadToken Fts5Token) uint8 { /* sqlite3.c:210304:25: */ +func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, fts5yyLookahead int32, fts5yyLookaheadToken Fts5Token) uint8 { /* sqlite3.c:213490:25: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -161284,19 +163800,6 @@ func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, ft _ = fts5yyLookaheadToken fts5yymsp = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos - // Check that the stack is large enough to grow by a single entry - // if the RHS of the rule is empty. This ensures that there is room - // enough on the stack to push the LHS value - if int32(fts5yyRuleInfoNRhs[fts5yyruleno]) == 0 { - if (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos >= (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd { - fts5yyStackOverflow(tls, fts5yypParser) - // The call to fts5yyStackOverflow() above pops the stack until it is - // empty, causing the main parser loop to exit. So the return value - // is never used and does not matter. - return uint8(0) - } - } - switch fts5yyruleno { // Beginning here are the reduction cases. A typical example // follows: @@ -161494,7 +163997,7 @@ func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, ft // The following code executes when the parse fails // The following code executes when a syntax error first occurs. -func fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int32, fts5yyminor Fts5Token) { /* sqlite3.c:210570:13: */ +func fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int32, fts5yyminor Fts5Token) { /* sqlite3.c:213708:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -161504,14 +164007,14 @@ func fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int32 _ = fts5yymajor // Silence a compiler warning sqlite3Fts5ParseError(tls, - pParse, ts+29538 /* "fts5: syntax err..." */, libc.VaList(bp, fts5yyminor.Fn, fts5yyminor.Fp)) + pParse, ts+30062 /* "fts5: syntax err..." */, libc.VaList(bp, fts5yyminor.Fn, fts5yyminor.Fp)) //*********** End %syntax_error code ***************************************** (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse // Suppress warning about unused %extra_argument variable } // The following is executed when the parser accepts -func fts5yy_accept(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:210592:13: */ +func fts5yy_accept(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:213730:13: */ var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse // Here code is inserted which will be executed whenever the @@ -161540,7 +164043,7 @@ func fts5yy_accept(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:210592:1 // // Outputs: // None. -func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yyminor Fts5Token, pParse uintptr) { /* sqlite3.c:210633:13: */ +func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yyminor Fts5Token, pParse uintptr) { /* sqlite3.c:213771:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -161553,12 +164056,22 @@ func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yy fts5yyact = (*Fts5yyStackEntry)(unsafe.Pointer((*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos)).Fstateno - for ok := true; ok; ok = ((*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > fts5yypParser+16 /* &.fts5yystack */) { + for 1 != 0 { // Exit by "break" fts5yyact = fts5yy_find_shift_action(tls, uint8(fts5yymajor), fts5yyact) if int32(fts5yyact) >= Fts5YY_MIN_REDUCE { - fts5yyact = fts5yy_reduce(tls, fts5yypParser, (uint32(int32(fts5yyact) - Fts5YY_MIN_REDUCE)), fts5yymajor, - fts5yyminor) + var fts5yyruleno uint32 = (uint32(int32(fts5yyact) - Fts5YY_MIN_REDUCE)) // Reduce by this rule + + // Check that the stack is large enough to grow by a single entry + // if the RHS of the rule is empty. This ensures that there is room + // enough on the stack to push the LHS value + if int32(fts5yyRuleInfoNRhs[fts5yyruleno]) == 0 { + if (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos >= (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd { + fts5yyStackOverflow(tls, fts5yypParser) + break + } + } + fts5yyact = fts5yy_reduce(tls, fts5yypParser, fts5yyruleno, fts5yymajor, fts5yyminor) } else if int32(fts5yyact) <= Fts5YY_MAX_SHIFTREDUCE { fts5yy_shift(tls, fts5yypParser, fts5yyact, uint8(fts5yymajor), fts5yyminor) break @@ -161585,7 +164098,7 @@ func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yy // Return the fallback token corresponding to canonical token iToken, or // 0 if iToken has no fallback. -func sqlite3Fts5ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:210807:12: */ +func sqlite3Fts5ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:213989:12: */ _ = iToken return 0 } @@ -161648,7 +164161,7 @@ type CInstIter1 = struct { FiStart int32 FiEnd int32 _ [4]byte -} /* sqlite3.c:210853:9 */ +} /* sqlite3.c:214035:9 */ // 2014 May 31 // @@ -161699,11 +164212,11 @@ type CInstIter1 = struct { // printf("instance starts at %d, ends at %d\n", iter.iStart, iter.iEnd); // } // -type CInstIter = CInstIter1 /* sqlite3.c:210853:26 */ +type CInstIter = CInstIter1 /* sqlite3.c:214035:26 */ // Advance the iterator to the next coalesced phrase instance. Return // an SQLite error code if an error occurs, or SQLITE_OK otherwise. -func fts5CInstIterNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:210870:12: */ +func fts5CInstIterNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:214052:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -161742,7 +164255,7 @@ func fts5CInstIterNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:210870 // Initialize the iterator object indicated by the final parameter to // iterate through coalesced phrase instances in column iCol. -func fts5CInstIterInit(tls *libc.TLS, pApi uintptr, pFts uintptr, iCol int32, pIter uintptr) int32 { /* sqlite3.c:210901:12: */ +func fts5CInstIterInit(tls *libc.TLS, pApi uintptr, pFts uintptr, iCol int32, pIter uintptr) int32 { /* sqlite3.c:214083:12: */ var rc int32 libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(CInstIter{}))) @@ -161773,12 +164286,12 @@ type HighlightContext1 = struct { FnIn int32 FiOff int32 FzOut uintptr -} /* sqlite3.c:210927:9 */ +} /* sqlite3.c:214109:9 */ // ************************************************************************ // // Start of highlight() implementation. -type HighlightContext = HighlightContext1 /* sqlite3.c:210927:33 */ +type HighlightContext = HighlightContext1 /* sqlite3.c:214109:33 */ // Append text to the HighlightContext output string - p->zOut. Argument // z points to a buffer containing n bytes of text to append. If n is @@ -161787,7 +164300,7 @@ type HighlightContext = HighlightContext1 /* sqlite3.c:210927:33 */ // If *pRc is set to any value other than SQLITE_OK when this function is // called, it is a no-op. If an error (i.e. an OOM condition) is encountered, // *pRc is set to an error code before returning. -func fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n int32) { /* sqlite3.c:210950:13: */ +func fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n int32) { /* sqlite3.c:214132:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -161795,7 +164308,7 @@ func fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n int if n < 0 { n = int32(libc.Xstrlen(tls, z)) } - (*HighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, ts+29569 /* "%z%.*s" */, libc.VaList(bp, (*HighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*HighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, ts+30093 /* "%z%.*s" */, libc.VaList(bp, (*HighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*HighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM } @@ -161803,7 +164316,7 @@ func fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n int } // Tokenizer callback used by implementation of highlight() function. -func fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:210965:12: */ +func fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:214147:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -161858,7 +164371,7 @@ func fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintp } // Implementation of highlight() function. -func fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:211019:13: */ +func fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:214201:13: */ bp := tls.Alloc(100) defer tls.Free(100) @@ -161869,7 +164382,7 @@ func fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintp var iCol int32 if nVal != 3 { - var zErr uintptr = ts + 29576 /* "wrong number of ..." */ + var zErr uintptr = ts + 30100 /* "wrong number of ..." */ Xsqlite3_result_error(tls, pCtx, zErr, -1) return } @@ -161914,19 +164427,19 @@ type Fts5SFinder1 = struct { _ [4]byte FaFirst uintptr FzDoc uintptr -} /* sqlite3.c:211068:9 */ +} /* sqlite3.c:214250:9 */ // // End of highlight() implementation. // // Context object passed to the fts5SentenceFinderCb() function. -type Fts5SFinder = Fts5SFinder1 /* sqlite3.c:211068:28 */ +type Fts5SFinder = Fts5SFinder1 /* sqlite3.c:214250:28 */ // Add an entry to the Fts5SFinder.aFirst[] array. Grow the array if // necessary. Return SQLITE_OK if successful, or SQLITE_NOMEM if an // error occurs. -func fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) int32 { /* sqlite3.c:211082:12: */ +func fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) int32 { /* sqlite3.c:214264:12: */ if (*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc == (*Fts5SFinder)(unsafe.Pointer(p)).FnFirst { var nNew int32 if (*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc != 0 { @@ -161950,7 +164463,7 @@ func fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) int32 { /* sqli // This function is an xTokenize() callback used by the auxiliary snippet() // function. Its job is to identify tokens that are the first in a sentence. // For each such token, an entry is added to the SFinder.aFirst[] array. -func fts5SentenceFinderCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:211101:12: */ +func fts5SentenceFinderCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:214283:12: */ var rc int32 = SQLITE_OK _ = pToken @@ -161979,7 +164492,7 @@ func fts5SentenceFinderCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken return rc } -func fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32, aSeen uintptr, iCol int32, iPos int32, nToken int32, pnScore uintptr, piPos uintptr) int32 { /* sqlite3.c:211134:12: */ +func fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32, aSeen uintptr, iCol int32, iPos int32, nToken int32, pnScore uintptr, piPos uintptr) int32 { /* sqlite3.c:214316:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -162031,7 +164544,7 @@ func fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32, // Return the value in pVal interpreted as utf-8 text. Except, if pVal // contains a NULL value, return a pointer to a static string zero // bytes in length instead of a NULL pointer. -func fts5ValueToText(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:211183:19: */ +func fts5ValueToText(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:214365:19: */ var zRet uintptr = Xsqlite3_value_text(tls, pVal) if zRet != 0 { return zRet @@ -162040,7 +164553,7 @@ func fts5ValueToText(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:211183: } // Implementation of snippet() function. -func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:211191:13: */ +func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:214373:13: */ bp := tls.Alloc(172) defer tls.Free(172) @@ -162063,7 +164576,7 @@ func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr var nCol int32 if nVal != 5 { - var zErr uintptr = ts + 29626 /* "wrong number of ..." */ + var zErr uintptr = ts + 30150 /* "wrong number of ..." */ Xsqlite3_result_error(tls, pCtx, zErr, -1) return } @@ -162235,17 +164748,17 @@ type Fts5Bm25Data1 = struct { Favgdl float64 FaIDF uintptr FaFreq uintptr -} /* sqlite3.c:211349:9 */ +} /* sqlite3.c:214531:9 */ //********************************************************************** // The first time the bm25() function is called for a query, an instance // of the following structure is allocated and populated. -type Fts5Bm25Data = Fts5Bm25Data1 /* sqlite3.c:211349:29 */ +type Fts5Bm25Data = Fts5Bm25Data1 /* sqlite3.c:214531:29 */ // Callback used by fts5Bm25GetData() to count the number of rows in the // table matched by each individual phrase within the query. -func fts5CountCb(tls *libc.TLS, pApi uintptr, pFts uintptr, pUserData uintptr) int32 { /* sqlite3.c:211361:12: */ +func fts5CountCb(tls *libc.TLS, pApi uintptr, pFts uintptr, pUserData uintptr) int32 { /* sqlite3.c:214543:12: */ var pn uintptr = pUserData _ = pApi _ = pFts @@ -162256,7 +164769,7 @@ func fts5CountCb(tls *libc.TLS, pApi uintptr, pFts uintptr, pUserData uintptr) i // Set *ppData to point to the Fts5Bm25Data object for the current query. // If the object has not already been allocated, allocate and populate it // now. -func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) int32 { /* sqlite3.c:211377:12: */ +func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) int32 { /* sqlite3.c:214559:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -162338,14 +164851,14 @@ func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) } // Implementation of bm25() function. -func fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:211450:13: */ +func fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:214632:13: */ bp := tls.Alloc(28) defer tls.Free(28) - var k1 float64 = 1.2 // Constant "k1" from BM25 formula - var b float64 = 0.75 // Constant "b" from BM25 formula - var rc int32 = SQLITE_OK // Error code - var score float64 = 0.0 // SQL function return value + var k1 float64 = 1.2 // Constant "k1" from BM25 formula + var b float64 = 0.75 // Constant "b" from BM25 formula + var rc int32 // Error code + var score float64 = 0.0 // SQL function return value // var pData uintptr at bp, 8 // Values allocated/calculated once only var i int32 // Iterator variable @@ -162388,32 +164901,30 @@ func fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, n D = float64(*(*int32)(unsafe.Pointer(bp + 24 /* nTok */))) } - // Determine the BM25 score for the current row. - for i = 0; (rc == SQLITE_OK) && (i < (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FnPhrase); i++ { - score = score + (*(*float64)(unsafe.Pointer((*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FaIDF + uintptr(i)*8)) * ((*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + 1.0)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + (k1 * ((float64(1) - b) + ((b * D) / (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).Favgdl)))))) - } - - // If no error has occurred, return the calculated score. Otherwise, - // throw an SQL exception. + // Determine and return the BM25 score for the current row. Or, if an + // error has occurred, throw an exception. if rc == SQLITE_OK { + for i = 0; i < (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FnPhrase; i++ { + score = score + (*(*float64)(unsafe.Pointer((*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FaIDF + uintptr(i)*8)) * ((*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + 1.0)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + (k1 * ((float64(1) - b) + ((b * D) / (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).Favgdl)))))) + } Xsqlite3_result_double(tls, pCtx, (-1.0 * score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } } -func sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:211508:12: */ +func sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:214688:12: */ bp := tls.Alloc(96) defer tls.Free(96) *(*[3]Builtin)(unsafe.Pointer(bp /* aBuiltin */)) = [3]Builtin{ - {FzFunc: ts + 29674 /* "snippet" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct { + {FzFunc: ts + 30198 /* "snippet" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) }{fts5SnippetFunction}))}, - {FzFunc: ts + 29682 /* "highlight" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct { + {FzFunc: ts + 30206 /* "highlight" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) }{fts5HighlightFunction}))}, - {FzFunc: ts + 29692 /* "bm25" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct { + {FzFunc: ts + 30216 /* "bm25" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) }{fts5Bm25Function}))}, } @@ -162436,7 +164947,7 @@ type Builtin = struct { FpUserData uintptr FxFunc Fts5_extension_function FxDestroy uintptr -} /* sqlite3.c:211509:3 */ +} /* sqlite3.c:214689:3 */ // 2014 May 31 // @@ -162451,7 +164962,7 @@ type Builtin = struct { // #include "fts5Int.h" -func sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte U32) int32 { /* sqlite3.c:211551:12: */ +func sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte U32) int32 { /* sqlite3.c:214731:12: */ if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) < nByte { var nNew U64 if (*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace != 0 { @@ -162477,7 +164988,7 @@ func sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte U32) // Encode value iVal as an SQLite varint and append it to the buffer object // pBuf. If an OOM error occurs, set the error code in p. -func sqlite3Fts5BufferAppendVarint(tls *libc.TLS, pRc uintptr, pBuf uintptr, iVal I64) { /* sqlite3.c:211575:13: */ +func sqlite3Fts5BufferAppendVarint(tls *libc.TLS, pRc uintptr, pBuf uintptr, iVal I64) { /* sqlite3.c:214755:13: */ if func() int32 { if ((U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + (U32(9))) <= (U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)) { return 0 @@ -162489,21 +165000,21 @@ func sqlite3Fts5BufferAppendVarint(tls *libc.TLS, pRc uintptr, pBuf uintptr, iVa *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), uint64(iVal))) } -func sqlite3Fts5Put32(tls *libc.TLS, aBuf uintptr, iVal int32) { /* sqlite3.c:211580:13: */ +func sqlite3Fts5Put32(tls *libc.TLS, aBuf uintptr, iVal int32) { /* sqlite3.c:214760:13: */ *(*U8)(unsafe.Pointer(aBuf)) = (U8((iVal >> 24) & 0x00FF)) *(*U8)(unsafe.Pointer(aBuf + 1)) = (U8((iVal >> 16) & 0x00FF)) *(*U8)(unsafe.Pointer(aBuf + 2)) = (U8((iVal >> 8) & 0x00FF)) *(*U8)(unsafe.Pointer(aBuf + 3)) = (U8((iVal >> 0) & 0x00FF)) } -func sqlite3Fts5Get32(tls *libc.TLS, aBuf uintptr) int32 { /* sqlite3.c:211587:12: */ +func sqlite3Fts5Get32(tls *libc.TLS, aBuf uintptr) int32 { /* sqlite3.c:214767:12: */ return (int32(((((U32(*(*U8)(unsafe.Pointer(aBuf)))) << 24) + (U32(int32(*(*U8)(unsafe.Pointer(aBuf + 1))) << 16))) + (U32(int32(*(*U8)(unsafe.Pointer(aBuf + 2))) << 8))) + U32(*(*U8)(unsafe.Pointer(aBuf + 3))))) } // Append buffer nData/pData to buffer pBuf. If an OOM error occurs, set // the error code in p. If an error has already occurred when this function // is called, it is a no-op. -func sqlite3Fts5BufferAppendBlob(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData U32, pData uintptr) { /* sqlite3.c:211596:13: */ +func sqlite3Fts5BufferAppendBlob(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData U32, pData uintptr) { /* sqlite3.c:214776:13: */ if nData != 0 { if func() int32 { @@ -162522,7 +165033,7 @@ func sqlite3Fts5BufferAppendBlob(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData // Append the nul-terminated string zStr to the buffer pBuf. This function // ensures that the byte following the buffer data is set to 0x00, even // though this byte is not included in the pBuf->n count. -func sqlite3Fts5BufferAppendString(tls *libc.TLS, pRc uintptr, pBuf uintptr, zStr uintptr) { /* sqlite3.c:211615:13: */ +func sqlite3Fts5BufferAppendString(tls *libc.TLS, pRc uintptr, pBuf uintptr, zStr uintptr) { /* sqlite3.c:214795:13: */ var nStr int32 = int32(libc.Xstrlen(tls, zStr)) sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, (uint32(nStr + 1)), zStr) (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn-- @@ -162534,7 +165045,7 @@ func sqlite3Fts5BufferAppendString(tls *libc.TLS, pRc uintptr, pBuf uintptr, zSt // Like sqlite3Fts5BufferAppendString(), this function ensures that the byte // following the buffer data is set to 0x00, even though this byte is not // included in the pBuf->n count. -func sqlite3Fts5BufferAppendPrintf(tls *libc.TLS, pRc uintptr, pBuf uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:211633:13: */ +func sqlite3Fts5BufferAppendPrintf(tls *libc.TLS, pRc uintptr, pBuf uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:214813:13: */ if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { var zTmp uintptr var ap Va_list @@ -162552,7 +165063,7 @@ func sqlite3Fts5BufferAppendPrintf(tls *libc.TLS, pRc uintptr, pBuf uintptr, zFm } } -func sqlite3Fts5Mprintf(tls *libc.TLS, pRc uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:211654:13: */ +func sqlite3Fts5Mprintf(tls *libc.TLS, pRc uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:214834:13: */ var zRet uintptr = uintptr(0) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { var ap Va_list @@ -162568,26 +165079,26 @@ func sqlite3Fts5Mprintf(tls *libc.TLS, pRc uintptr, zFmt uintptr, va uintptr) ui } // Free any buffer allocated by pBuf. Zero the structure before returning. -func sqlite3Fts5BufferFree(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:211672:13: */ +func sqlite3Fts5BufferFree(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:214852:13: */ Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp) libc.Xmemset(tls, pBuf, 0, uint64(unsafe.Sizeof(Fts5Buffer{}))) } // Zero the contents of the buffer object. But do not free the associated // memory allocation. -func sqlite3Fts5BufferZero(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:211681:13: */ +func sqlite3Fts5BufferZero(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:214861:13: */ (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0 } // Set the buffer to contain nData/pData. If an OOM error occurs, leave an // the error code in p. If an error has already occurred when this function // is called, it is a no-op. -func sqlite3Fts5BufferSet(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData int32, pData uintptr) { /* sqlite3.c:211690:13: */ +func sqlite3Fts5BufferSet(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData int32, pData uintptr) { /* sqlite3.c:214870:13: */ (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0 sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(nData), pData) } -func sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piOff uintptr) int32 { /* sqlite3.c:211700:12: */ +func sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piOff uintptr) int32 { /* sqlite3.c:214880:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -162645,14 +165156,14 @@ func sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piO // Advance the iterator object passed as the only argument. Return true // if the iterator reaches EOF, or false otherwise. -func sqlite3Fts5PoslistReaderNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:211739:12: */ +func sqlite3Fts5PoslistReaderNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:214919:12: */ if sqlite3Fts5PoslistNext64(tls, (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fa, (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fn, (pIter+12 /* &.i */), (pIter+24 /* &.iPos */)) != 0 { (*Fts5PoslistReader)(unsafe.Pointer(pIter)).FbEof = U8(1) } return int32((*Fts5PoslistReader)(unsafe.Pointer(pIter)).FbEof) } -func sqlite3Fts5PoslistReaderInit(tls *libc.TLS, a uintptr, n int32, pIter uintptr) int32 { /* sqlite3.c:211746:12: */ +func sqlite3Fts5PoslistReaderInit(tls *libc.TLS, a uintptr, n int32, pIter uintptr) int32 { /* sqlite3.c:214926:12: */ libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5PoslistReader{}))) (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fa = a (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fn = n @@ -162664,7 +165175,7 @@ func sqlite3Fts5PoslistReaderInit(tls *libc.TLS, a uintptr, n int32, pIter uintp // pBuf, which must be already be large enough to hold the new data. // The previous position written to this list is *piPrev. *piPrev is set // to iPos before returning. -func sqlite3Fts5PoslistSafeAppend(tls *libc.TLS, pBuf uintptr, piPrev uintptr, iPos I64) { /* sqlite3.c:211763:13: */ +func sqlite3Fts5PoslistSafeAppend(tls *libc.TLS, pBuf uintptr, piPrev uintptr, iPos I64) { /* sqlite3.c:214943:13: */ if (iPos & colmask) != (*(*I64)(unsafe.Pointer(piPrev)) & colmask) { *(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(libc.PostIncInt32(&(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn, 1)))) = U8(1) *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), (uint64(iPos >> 32)))) @@ -162674,9 +165185,9 @@ func sqlite3Fts5PoslistSafeAppend(tls *libc.TLS, pBuf uintptr, piPrev uintptr, i *(*I64)(unsafe.Pointer(piPrev)) = iPos } -var colmask I64 = (I64((int64(0x7FFFFFFF))) << 32) /* sqlite3.c:211768:20 */ +var colmask I64 = (I64((int64(0x7FFFFFFF))) << 32) /* sqlite3.c:214948:20 */ -func sqlite3Fts5PoslistWriterAppend(tls *libc.TLS, pBuf uintptr, pWriter uintptr, iPos I64) int32 { /* sqlite3.c:211778:12: */ +func sqlite3Fts5PoslistWriterAppend(tls *libc.TLS, pBuf uintptr, pWriter uintptr, iPos I64) int32 { /* sqlite3.c:214958:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -162693,7 +165204,7 @@ func sqlite3Fts5PoslistWriterAppend(tls *libc.TLS, pBuf uintptr, pWriter uintptr return SQLITE_OK } -func sqlite3Fts5MallocZero(tls *libc.TLS, pRc uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:211789:13: */ +func sqlite3Fts5MallocZero(tls *libc.TLS, pRc uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:214969:13: */ var pRet uintptr = uintptr(0) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { pRet = Xsqlite3_malloc64(tls, uint64(nByte)) @@ -162714,7 +165225,7 @@ func sqlite3Fts5MallocZero(tls *libc.TLS, pRc uintptr, nByte Sqlite3_int64) uint // // It is the responsibility of the caller to eventually free the returned // buffer using sqlite3_free(). If an OOM error occurs, NULL is returned. -func sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) uintptr { /* sqlite3.c:211810:13: */ +func sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) uintptr { /* sqlite3.c:214990:13: */ var zRet uintptr = uintptr(0) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { if nIn < 0 { @@ -162739,7 +165250,7 @@ func sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) uint // * The 10 integer ASCII characters. // * The underscore character "_" (0x5F). // * The unicode "subsitute" character (0x1A). -func sqlite3Fts5IsBareword(tls *libc.TLS, t int8) int32 { /* sqlite3.c:211838:12: */ +func sqlite3Fts5IsBareword(tls *libc.TLS, t int8) int32 { /* sqlite3.c:215018:12: */ bp := tls.Alloc(128) defer tls.Free(128) @@ -162764,13 +165275,13 @@ type Fts5TermsetEntry1 = struct { FnTerm int32 FiIdx int32 FpNext uintptr -} /* sqlite3.c:208835:9 */ +} /* sqlite3.c:211994:9 */ // ************************************************************************ // -type Fts5TermsetEntry = Fts5TermsetEntry1 /* sqlite3.c:211856:33 */ +type Fts5TermsetEntry = Fts5TermsetEntry1 /* sqlite3.c:215036:33 */ -func sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) int32 { /* sqlite3.c:211868:12: */ +func sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) int32 { /* sqlite3.c:215048:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -162779,7 +165290,7 @@ func sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) int32 { /* sqlite3.c:21186 return *(*int32)(unsafe.Pointer(bp /* rc */)) } -func sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr, nTerm int32, pbPresent uintptr) int32 { /* sqlite3.c:211874:12: */ +func sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr, nTerm int32, pbPresent uintptr) int32 { /* sqlite3.c:215054:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -162825,7 +165336,7 @@ func sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr, return *(*int32)(unsafe.Pointer(bp /* rc */)) } -func sqlite3Fts5TermsetFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:211923:13: */ +func sqlite3Fts5TermsetFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:215103:13: */ if p != 0 { var i U32 for i = U32(0); i < (U32((int32(uint64(unsafe.Sizeof([512]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0))))))); i++ { @@ -162857,18 +165368,18 @@ func sqlite3Fts5TermsetFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:211923:13: // Maximum allowed page size -func fts5_iswhitespace(tls *libc.TLS, x int8) int32 { /* sqlite3.c:211965:12: */ +func fts5_iswhitespace(tls *libc.TLS, x int8) int32 { /* sqlite3.c:215145:12: */ return (libc.Bool32(int32(x) == ' ')) } -func fts5_isopenquote(tls *libc.TLS, x int8) int32 { /* sqlite3.c:211969:12: */ +func fts5_isopenquote(tls *libc.TLS, x int8) int32 { /* sqlite3.c:215149:12: */ return (libc.Bool32((((int32(x) == '"') || (int32(x) == '\'')) || (int32(x) == '[')) || (int32(x) == '`'))) } // Argument pIn points to a character that is part of a nul-terminated // string. Return a pointer to the first character following *pIn in // the string that is not a white-space character. -func fts5ConfigSkipWhitespace(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:211978:19: */ +func fts5ConfigSkipWhitespace(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:215158:19: */ var p uintptr = pIn if p != 0 { for fts5_iswhitespace(tls, *(*int8)(unsafe.Pointer(p))) != 0 { @@ -162881,7 +165392,7 @@ func fts5ConfigSkipWhitespace(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c // Argument pIn points to a character that is part of a nul-terminated // string. Return a pointer to the first character following *pIn in // the string that is not a "bareword" character. -func fts5ConfigSkipBareword(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:211991:19: */ +func fts5ConfigSkipBareword(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:215171:19: */ var p uintptr = pIn for sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(p))) != 0 { p++ @@ -162892,17 +165403,17 @@ func fts5ConfigSkipBareword(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:2 return p } -func fts5_isdigit(tls *libc.TLS, a int8) int32 { /* sqlite3.c:211998:12: */ +func fts5_isdigit(tls *libc.TLS, a int8) int32 { /* sqlite3.c:215178:12: */ return (libc.Bool32((int32(a) >= '0') && (int32(a) <= '9'))) } -func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:212004:19: */ +func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:215184:19: */ var p uintptr = pIn switch int32(*(*int8)(unsafe.Pointer(p))) { case 'n': fallthrough case 'N': - if Xsqlite3_strnicmp(tls, ts+5082 /* "null" */, p, 4) == 0 { + if Xsqlite3_strnicmp(tls, ts+5127 /* "null" */, p, 4) == 0 { p = (p + 4) } else { p = uintptr(0) @@ -162985,7 +165496,7 @@ func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:21 // the character immediately following it. Or, if the close-quote is not // found, -1 is returned. If -1 is returned, the buffer is left in an // undefined state. -func fts5Dequote(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:212080:12: */ +func fts5Dequote(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:215260:12: */ var q int8 var iIn int32 = 1 var iOut int32 = 0 @@ -163030,7 +165541,7 @@ func fts5Dequote(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:212080:12: */ // 'xyz' becomes xyz // [pqr] becomes pqr // `mno` becomes mno -func sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:212125:13: */ +func sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:215305:13: */ var quote int8 // Quote character (if any ) quote = *(*int8)(unsafe.Pointer(z)) @@ -163043,11 +165554,11 @@ type Fts5Enum1 = struct { FzName uintptr FeVal int32 _ [4]byte -} /* sqlite3.c:212136:1 */ +} /* sqlite3.c:215316:1 */ -type Fts5Enum = Fts5Enum1 /* sqlite3.c:212140:25 */ +type Fts5Enum = Fts5Enum1 /* sqlite3.c:215320:25 */ -func fts5ConfigSetEnum(tls *libc.TLS, aEnum uintptr, zEnum uintptr, peVal uintptr) int32 { /* sqlite3.c:212142:12: */ +func fts5ConfigSetEnum(tls *libc.TLS, aEnum uintptr, zEnum uintptr, peVal uintptr) int32 { /* sqlite3.c:215322:12: */ var nEnum int32 = int32(libc.Xstrlen(tls, zEnum)) var i int32 var iVal int32 = -1 @@ -163075,14 +165586,14 @@ func fts5ConfigSetEnum(tls *libc.TLS, aEnum uintptr, zEnum uintptr, peVal uintpt // an error occurs, an SQLite error code is returned and an error message // may be left in *pzErr. It is the responsibility of the caller to // eventually free any such error message using sqlite3_free(). -func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCmd uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:212171:12: */ +func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCmd uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:215351:12: */ bp := tls.Alloc(112) defer tls.Free(112) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_OK var nCmd int32 = int32(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, ts+29697 /* "prefix" */, zCmd, nCmd) == 0 { - var nByte int32 = (int32(uint64(unsafe.Sizeof(int32(0))) * FTS5_MAX_PREFIX_INDEXES)) + if Xsqlite3_strnicmp(tls, ts+30221 /* "prefix" */, zCmd, nCmd) == 0 { + var nByte int32 = (int32(uint64(unsafe.Sizeof(int32(0))) * uint64(FTS5_MAX_PREFIX_INDEXES))) var p uintptr var bFirst int32 = 1 if (*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -163108,14 +165619,14 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm break } if (int32(*(*int8)(unsafe.Pointer(p))) < '0') || (int32(*(*int8)(unsafe.Pointer(p))) > '9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+29704 /* "malformed prefix..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30228 /* "malformed prefix..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR break } if (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix == FTS5_MAX_PREFIX_INDEXES { *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, - ts+29735 /* "too many prefix ..." */, libc.VaList(bp, FTS5_MAX_PREFIX_INDEXES)) + ts+30259 /* "too many prefix ..." */, libc.VaList(bp, FTS5_MAX_PREFIX_INDEXES)) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR break } @@ -163126,7 +165637,7 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm } if (nPre <= 0) || (nPre >= 1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+29768 /* "prefix length ou..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30292 /* "prefix length ou..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR break } @@ -163139,7 +165650,7 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } - if Xsqlite3_strnicmp(tls, ts+29805 /* "tokenize" */, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, ts+30329 /* "tokenize" */, zCmd, nCmd) == 0 { var p uintptr = zArg var nArg Sqlite3_int64 = (Sqlite3_int64(libc.Xstrlen(tls, zArg) + uint64(1))) var azArg uintptr = sqlite3Fts5MallocZero(tls, bp+40 /* &rc */, (int64(uint64(unsafe.Sizeof(uintptr(0))) * uint64(nArg)))) @@ -163148,7 +165659,7 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm if (azArg != 0) && (pSpace != 0) { if (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+29814 /* "multiple tokeniz..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30338 /* "multiple tokeniz..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else { for nArg = int64(0); (p != 0) && (*(*int8)(unsafe.Pointer(p)) != 0); nArg++ { @@ -163167,11 +165678,11 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm } } if p == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+29847 /* "parse error in t..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30371 /* "parse error in t..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else { *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = sqlite3Fts5GetTokenizer(tls, pGlobal, - azArg, int32(nArg), (pConfig + 104 /* &.pTok */), (pConfig + 112 /* &.pTokApi */), + azArg, int32(nArg), pConfig, pzErr) } } @@ -163182,14 +165693,14 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } - if Xsqlite3_strnicmp(tls, ts+29881 /* "content" */, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, ts+30405 /* "content" */, zCmd, nCmd) == 0 { if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+29889 /* "multiple content..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30413 /* "multiple content..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else { if *(*int8)(unsafe.Pointer(zArg)) != 0 { (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent = FTS5_CONTENT_EXTERNAL - (*Fts5Config)(unsafe.Pointer(pConfig)).FzContent = sqlite3Fts5Mprintf(tls, bp+40 /* &rc */, ts+29921 /* "%Q.%Q" */, libc.VaList(bp+8, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*Fts5Config)(unsafe.Pointer(pConfig)).FzContent = sqlite3Fts5Mprintf(tls, bp+40 /* &rc */, ts+30445 /* "%Q.%Q" */, libc.VaList(bp+8, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent = FTS5_CONTENT_NONE } @@ -163197,9 +165708,9 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } - if Xsqlite3_strnicmp(tls, ts+29927 /* "content_rowid" */, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, ts+30451 /* "content_rowid" */, zCmd, nCmd) == 0 { if (*Fts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+29941 /* "multiple content..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30465 /* "multiple content..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else { (*Fts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, zArg, -1) @@ -163207,9 +165718,9 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } - if Xsqlite3_strnicmp(tls, ts+29979 /* "columnsize" */, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, ts+30503 /* "columnsize" */, zCmd, nCmd) == 0 { if ((int32(*(*int8)(unsafe.Pointer(zArg))) != '0') && (int32(*(*int8)(unsafe.Pointer(zArg))) != '1')) || (int32(*(*int8)(unsafe.Pointer(zArg + 1))) != 0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+29990 /* "malformed column..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30514 /* "malformed column..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else { (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(zArg))) == '1')) @@ -163217,31 +165728,30 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } - if Xsqlite3_strnicmp(tls, ts+4030 /* "detail" */, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, ts+4058 /* "detail" */, zCmd, nCmd) == 0 { *(*[4]Fts5Enum)(unsafe.Pointer(bp + 48 /* aDetail */)) = [4]Fts5Enum{ - {FzName: ts + 14936 /* "none" */, FeVal: FTS5_DETAIL_NONE}, - {FzName: ts + 14941 /* "full" */}, - {FzName: ts + 30025 /* "columns" */, FeVal: FTS5_DETAIL_COLUMNS}, + {FzName: ts + 15365 /* "none" */, FeVal: FTS5_DETAIL_NONE}, + {FzName: ts + 15370 /* "full" */}, + {FzName: ts + 30549 /* "columns" */, FeVal: FTS5_DETAIL_COLUMNS}, {}, } if libc.AssignPtrInt32(bp+40 /* rc */, fts5ConfigSetEnum(tls, bp+48 /* &aDetail[0] */, zArg, (pConfig+92 /* &.eDetail */))) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30033 /* "malformed detail..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30557 /* "malformed detail..." */, 0) } return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30064 /* "unrecognized opt..." */, libc.VaList(bp+24, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30588 /* "unrecognized opt..." */, libc.VaList(bp+24, nCmd, zCmd)) return SQLITE_ERROR } // Allocate an instance of the default tokenizer ("simple") at // Fts5Config.pTokenizer. Return SQLITE_OK if successful, or an SQLite error // code if an error occurs. -func fts5ConfigDefaultTokenizer(tls *libc.TLS, pGlobal uintptr, pConfig uintptr) int32 { /* sqlite3.c:212335:12: */ +func fts5ConfigDefaultTokenizer(tls *libc.TLS, pGlobal uintptr, pConfig uintptr) int32 { /* sqlite3.c:215515:12: */ - return sqlite3Fts5GetTokenizer(tls, - pGlobal, uintptr(0), 0, (pConfig + 104 /* &.pTok */), (pConfig + 112 /* &.pTokApi */), uintptr(0)) + return sqlite3Fts5GetTokenizer(tls, pGlobal, uintptr(0), 0, pConfig, uintptr(0)) } // Gobble up the first bareword or quoted word from the input buffer zIn. @@ -163257,7 +165767,7 @@ func fts5ConfigDefaultTokenizer(tls *libc.TLS, pGlobal uintptr, pConfig uintptr) // a no-op (NULL is returned). Otherwise, if an OOM occurs within this // function, *pRc is set to SQLITE_NOMEM before returning. *pRc is *not* // set if a parse error (failed to find close quote) occurs. -func fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintptr, pbQuoted uintptr) uintptr { /* sqlite3.c:212357:19: */ +func fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintptr, pbQuoted uintptr) uintptr { /* sqlite3.c:215535:19: */ var zRet uintptr = uintptr(0) var nIn Sqlite3_int64 = Sqlite3_int64(libc.Xstrlen(tls, zIn)) @@ -163291,20 +165801,20 @@ func fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintptr return zRet } -func fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:212397:12: */ +func fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:215575:12: */ bp := tls.Alloc(16) defer tls.Free(16) var rc int32 = SQLITE_OK - if (0 == Xsqlite3_stricmp(tls, zCol, ts+19511 /* "rank" */)) || - (0 == Xsqlite3_stricmp(tls, zCol, ts+13865 /* "rowid" */)) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30092 /* "reserved fts5 co..." */, libc.VaList(bp, zCol)) + if (0 == Xsqlite3_stricmp(tls, zCol, ts+19987 /* "rank" */)) || + (0 == Xsqlite3_stricmp(tls, zCol, ts+14294 /* "rowid" */)) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30616 /* "reserved fts5 co..." */, libc.VaList(bp, zCol)) rc = SQLITE_ERROR } else if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, ts+30122 /* "unindexed" */) { + if 0 == Xsqlite3_stricmp(tls, zArg, ts+30646 /* "unindexed" */) { *(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*Fts5Config)(unsafe.Pointer(p)).FnCol))) = U8(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30132 /* "unrecognized col..." */, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30656 /* "unrecognized col..." */, libc.VaList(bp+8, zArg)) rc = SQLITE_ERROR } } @@ -163314,7 +165824,7 @@ func fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr, } // Populate the Fts5Config.zContentExprlist string. -func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:212425:12: */ +func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:215603:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -163322,13 +165832,13 @@ func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:21242 *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = SQLITE_OK *(*Fts5Buffer)(unsafe.Pointer(bp + 32 /* buf */)) = Fts5Buffer{} - sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+30163 /* "T.%Q" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(p)).FzContentRowid)) + sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+30687 /* "T.%Q" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*Fts5Config)(unsafe.Pointer(p)).FeContent != FTS5_CONTENT_NONE { for i = 0; i < (*Fts5Config)(unsafe.Pointer(p)).FnCol; i++ { if (*Fts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_EXTERNAL { - sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+30168 /* ", T.%Q" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+30692 /* ", T.%Q" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { - sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+30175 /* ", T.c%d" */, libc.VaList(bp+16, i)) + sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+30699 /* ", T.c%d" */, libc.VaList(bp+16, i)) } } } @@ -163347,7 +165857,7 @@ func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:21242 // returned, *ppOut is set to NULL and an error message may be left in // *pzErr. It is the responsibility of the caller to eventually free any // such error message using sqlite3_free(). -func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int32, azArg uintptr, ppOut uintptr, pzErr uintptr) int32 { /* sqlite3.c:212458:12: */ +func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int32, azArg uintptr, ppOut uintptr, pzErr uintptr) int32 { /* sqlite3.c:215636:12: */ bp := tls.Alloc(76) defer tls.Free(76) @@ -163371,8 +165881,8 @@ func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int (*Fts5Config)(unsafe.Pointer(pRet)).FzName = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -1) (*Fts5Config)(unsafe.Pointer(pRet)).FbColumnsize = 1 (*Fts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && (Xsqlite3_stricmp(tls, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, ts+19511 /* "rank" */) == 0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30183 /* "reserved fts5 ta..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pRet)).FzName)) + if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && (Xsqlite3_stricmp(tls, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, ts+19987 /* "rank" */) == 0) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30707 /* "reserved fts5 ta..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } @@ -163405,7 +165915,7 @@ func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30212 /* "parse error in \"..." */, libc.VaList(bp+8, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30736 /* "parse error in \"..." */, libc.VaList(bp+8, zOrig)) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else { if bOption != 0 { @@ -163438,19 +165948,19 @@ func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int var zTail uintptr = uintptr(0) if (*Fts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = ts + 29881 /* "content" */ + zTail = ts + 30405 /* "content" */ } else if (*Fts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = ts + 30232 /* "docsize" */ + zTail = ts + 30756 /* "docsize" */ } if zTail != 0 { (*Fts5Config)(unsafe.Pointer(pRet)).FzContent = sqlite3Fts5Mprintf(tls, - bp+40 /* &rc */, ts+30240 /* "%Q.'%q_%s'" */, libc.VaList(bp+16, (*Fts5Config)(unsafe.Pointer(pRet)).FzDb, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + bp+40 /* &rc */, ts+30764 /* "%Q.'%q_%s'" */, libc.VaList(bp+16, (*Fts5Config)(unsafe.Pointer(pRet)).FzDb, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0)) { - (*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, ts+13865 /* "rowid" */, -1) + (*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, ts+14294 /* "rowid" */, -1) } // Formulate the zContentExprlist text @@ -163466,7 +165976,7 @@ func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int } // Free the configuration object passed as the only argument. -func sqlite3Fts5ConfigFree(tls *libc.TLS, pConfig uintptr) { /* sqlite3.c:212577:13: */ +func sqlite3Fts5ConfigFree(tls *libc.TLS, pConfig uintptr) { /* sqlite3.c:215755:13: */ if pConfig != 0 { var i int32 if (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok != 0 { @@ -163491,7 +166001,7 @@ func sqlite3Fts5ConfigFree(tls *libc.TLS, pConfig uintptr) { /* sqlite3.c:212577 // Call sqlite3_declare_vtab() based on the contents of the configuration // object passed as the only argument. Return SQLITE_OK if successful, or // an SQLite error code if an error occurs. -func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:212604:12: */ +func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:215782:12: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -163499,18 +166009,18 @@ func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 { /* sql *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = SQLITE_OK var zSql uintptr - zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+30251 /* "CREATE TABLE x(" */, 0) + zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+30775 /* "CREATE TABLE x(" */, 0) for i = 0; (zSql != 0) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ { var zSep uintptr = func() uintptr { if i == 0 { return ts + 703 /* "" */ } - return ts + 12447 /* ", " */ + return ts + 12863 /* ", " */ }() - zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+30267 /* "%z%s%Q" */, libc.VaList(bp, zSql, zSep, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+30791 /* "%z%s%Q" */, libc.VaList(bp, zSql, zSep, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) } - zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+30274, /* "%z, %Q HIDDEN, %..." */ - libc.VaList(bp+24, zSql, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, ts+19511 /* "rank" */)) + zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+30798, /* "%z, %Q HIDDEN, %..." */ + libc.VaList(bp+24, zSql, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, ts+19987 /* "rank" */)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3_declare_vtab(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) @@ -163541,7 +166051,7 @@ func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 { /* sql // still returns SQLITE_OK. Or, if the tokenization was abandoned early // because the callback returned another non-zero value, it is assumed // to be an SQLite error code and returned to the caller. -func sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) int32 { /* sqlite3.c:212650:12: */ +func sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) int32 { /* sqlite3.c:215828:12: */ if pText == uintptr(0) { return SQLITE_OK } @@ -163553,7 +166063,7 @@ func sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uint // a comma-separated list of SQL literals followed by a ')' character. // If it actually is this, return a pointer to the ')'. Otherwise, return // NULL to indicate a parse error. -func fts5ConfigSkipArgs(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:212669:19: */ +func fts5ConfigSkipArgs(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:215847:19: */ var p uintptr = pIn for 1 != 0 { @@ -163580,7 +166090,7 @@ func fts5ConfigSkipArgs(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:21266 // + Open parenthesis - "(" // + Zero or more SQL literals in a comma separated list // + Close parenthesis - ")" -func sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzRankArgs uintptr) int32 { /* sqlite3.c:212696:12: */ +func sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzRankArgs uintptr) int32 { /* sqlite3.c:215874:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -163644,13 +166154,13 @@ func sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzRa return *(*int32)(unsafe.Pointer(bp /* rc */)) } -func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVal uintptr, pbBadkey uintptr) int32 { /* sqlite3.c:212755:12: */ +func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVal uintptr, pbBadkey uintptr) int32 { /* sqlite3.c:215933:12: */ bp := tls.Alloc(16) defer tls.Free(16) var rc int32 = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, ts+30300 /* "pgsz" */) { + if 0 == Xsqlite3_stricmp(tls, zKey, ts+30824 /* "pgsz" */) { var pgsz int32 = 0 if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -163660,7 +166170,7 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa } else { (*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } - } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+30305 /* "hashsize" */) { + } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+30829 /* "hashsize" */) { var nHashSize int32 = -1 if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -163670,7 +166180,7 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa } else { (*Fts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } - } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+30314 /* "automerge" */) { + } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+30838 /* "automerge" */) { var nAutomerge int32 = -1 if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -163683,7 +166193,7 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa } (*Fts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } - } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+30324 /* "usermerge" */) { + } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+30848 /* "usermerge" */) { var nUsermerge int32 = -1 if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -163693,7 +166203,7 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa } else { (*Fts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } - } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+30334 /* "crisismerge" */) { + } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+30858 /* "crisismerge" */) { var nCrisisMerge int32 = -1 if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -163709,7 +166219,7 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa } (*Fts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } - } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+19511 /* "rank" */) { + } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+19987 /* "rank" */) { var zIn uintptr = Xsqlite3_value_text(tls, pVal) // var zRank uintptr at bp, 8 @@ -163732,11 +166242,11 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa } // Load the contents of the %_config table into memory. -func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32 { /* sqlite3.c:212849:12: */ +func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32 { /* sqlite3.c:216027:12: */ bp := tls.Alloc(52) defer tls.Free(52) - var zSelect uintptr = ts + 30346 /* "SELECT k, v FROM..." */ + var zSelect uintptr = ts + 30870 /* "SELECT k, v FROM..." */ var zSql uintptr *(*uintptr)(unsafe.Pointer(bp + 40 /* p */)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = SQLITE_OK @@ -163759,7 +166269,7 @@ func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32 for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* p */))) { var zK uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* p */)), 0) var pVal uintptr = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* p */)), 1) - if 0 == Xsqlite3_stricmp(tls, zK, ts+30378 /* "version" */) { + if 0 == Xsqlite3_stricmp(tls, zK, ts+30902 /* "version" */) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 48 /* bDummy */)) = 0 @@ -163774,7 +166284,7 @@ func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32 if (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg != 0 { *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, - ts+30386, /* "invalid fts5 fil..." */ + ts+30910, /* "invalid fts5 fil..." */ libc.VaList(bp+16, iVersion, FTS5_CURRENT_VERSION)) } } @@ -163809,7 +166319,7 @@ type Fts5ExprTerm1 = struct { FzTerm uintptr FpIter uintptr FpSynonym uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // 2014 May 31 // @@ -163828,9 +166338,9 @@ type Fts5ExprTerm1 = struct { // All token types in the generated fts5parse.h file are greater than 0. -type Fts5ExprTerm = Fts5ExprTerm1 /* sqlite3.c:212927:29 */ +type Fts5ExprTerm = Fts5ExprTerm1 /* sqlite3.c:216105:29 */ -func sqlite3Fts5ParseError(tls *libc.TLS, pParse uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:213033:13: */ +func sqlite3Fts5ParseError(tls *libc.TLS, pParse uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:216212:13: */ var ap Va_list _ = ap ap = va @@ -163841,12 +166351,12 @@ func sqlite3Fts5ParseError(tls *libc.TLS, pParse uintptr, zFmt uintptr, va uintp _ = ap } -func fts5ExprIsspace(tls *libc.TLS, t int8) int32 { /* sqlite3.c:213043:12: */ +func fts5ExprIsspace(tls *libc.TLS, t int8) int32 { /* sqlite3.c:216222:12: */ return (libc.Bool32((((int32(t) == ' ') || (int32(t) == '\t')) || (int32(t) == '\n')) || (int32(t) == '\r'))) } // Read the first token from the nul-terminated string at *pz. -func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) int32 { /* sqlite3.c:213050:12: */ +func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) int32 { /* sqlite3.c:216229:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -163908,7 +166418,7 @@ func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) } } if int32(*(*int8)(unsafe.Pointer(z2))) == 0 { - sqlite3Fts5ParseError(tls, pParse, ts+30451 /* "unterminated str..." */, 0) + sqlite3Fts5ParseError(tls, pParse, ts+30975 /* "unterminated str..." */, 0) return FTS5_EOF } } @@ -163921,20 +166431,20 @@ func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) { var z2 uintptr if sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z))) == 0 { - sqlite3Fts5ParseError(tls, pParse, ts+30471 /* "fts5: syntax err..." */, libc.VaList(bp, z)) + sqlite3Fts5ParseError(tls, pParse, ts+30995 /* "fts5: syntax err..." */, libc.VaList(bp, z)) return FTS5_EOF } tok = FTS5_STRING for z2 = (z + 1); sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z2))) != 0; z2++ { } (*Fts5Token)(unsafe.Pointer(pToken)).Fn = (int32((int64(z2) - int64(z)) / 1)) - if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 2) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+30502 /* "OR" */, uint64(2)) == 0) { + if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 2) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+31026 /* "OR" */, uint64(2)) == 0) { tok = FTS5_OR } - if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+30505 /* "NOT" */, uint64(3)) == 0) { + if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+31029 /* "NOT" */, uint64(3)) == 0) { tok = FTS5_NOT } - if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+27251 /* "AND" */, uint64(3)) == 0) { + if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+27775 /* "AND" */, uint64(3)) == 0) { tok = FTS5_AND } break @@ -163946,23 +166456,23 @@ func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) return tok } -func fts5ParseAlloc(tls *libc.TLS, t U64) uintptr { /* sqlite3.c:213114:13: */ +func fts5ParseAlloc(tls *libc.TLS, t U64) uintptr { /* sqlite3.c:216293:13: */ return Xsqlite3_malloc64(tls, uint64(Sqlite3_int64(t))) } -func fts5ParseFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:213115:13: */ +func fts5ParseFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:216294:13: */ Xsqlite3_free(tls, p) } -func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, iCol int32, zExpr uintptr, ppNew uintptr, pzErr uintptr) int32 { /* sqlite3.c:213117:12: */ - bp := tls.Alloc(64) - defer tls.Free(64) +func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCol int32, zExpr uintptr, ppNew uintptr, pzErr uintptr) int32 { /* sqlite3.c:216296:12: */ + bp := tls.Alloc(72) + defer tls.Free(72) - // var sParse Fts5Parse at bp, 40 + // var sParse Fts5Parse at bp, 48 - // var token Fts5Token at bp+48, 16 + // var token Fts5Token at bp+56, 16 - *(*uintptr)(unsafe.Pointer(bp + 40 /* z */)) = zExpr + *(*uintptr)(unsafe.Pointer(bp + 48 /* z */)) = zExpr var t int32 // Next token type var pEngine uintptr var pNew uintptr @@ -163970,6 +166480,7 @@ func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, iCol int32, zExpr uintpt *(*uintptr)(unsafe.Pointer(ppNew)) = uintptr(0) *(*uintptr)(unsafe.Pointer(pzErr)) = uintptr(0) libc.Xmemset(tls, bp /* &sParse */, 0, uint64(unsafe.Sizeof(Fts5Parse{}))) + (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FbPhraseToAnd = bPhraseToAnd pEngine = sqlite3Fts5ParserAlloc(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, U64) uintptr }{fts5ParseAlloc}))) if pEngine == uintptr(0) { return SQLITE_NOMEM @@ -163977,8 +166488,8 @@ func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, iCol int32, zExpr uintpt (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpConfig = pConfig for ok := true; ok; ok = (((*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc == SQLITE_OK) && (t != FTS5_EOF)) { - t = fts5ExprGetToken(tls, bp /* &sParse */, bp+40 /* &z */, bp+48 /* &token */) - sqlite3Fts5Parser(tls, pEngine, t, *(*Fts5Token)(unsafe.Pointer(bp + 48 /* token */)), bp /* &sParse */) + t = fts5ExprGetToken(tls, bp /* &sParse */, bp+48 /* &z */, bp+56 /* &token */) + sqlite3Fts5Parser(tls, pEngine, t, *(*Fts5Token)(unsafe.Pointer(bp + 56 /* token */)), bp /* &sParse */) } sqlite3Fts5ParserFree(tls, pEngine, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5ParseFree}))) @@ -164013,6 +166524,7 @@ func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, iCol int32, zExpr uintpt (*Fts5Expr)(unsafe.Pointer(pNew)).FpConfig = pConfig (*Fts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FapPhrase (*Fts5Expr)(unsafe.Pointer(pNew)).FnPhrase = (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FnPhrase + (*Fts5Expr)(unsafe.Pointer(pNew)).FbDesc = 0 (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FapPhrase = uintptr(0) } } else { @@ -164024,8 +166536,88 @@ func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, iCol int32, zExpr uintpt return (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc } +// This function is only called when using the special 'trigram' tokenizer. +// Argument zText contains the text of a LIKE or GLOB pattern matched +// against column iCol. This function creates and compiles an FTS5 MATCH +// expression that will match a superset of the rows matched by the LIKE or +// GLOB. If successful, SQLITE_OK is returned. Otherwise, an SQLite error +// code. +func sqlite3Fts5ExprPattern(tls *libc.TLS, pConfig uintptr, bGlob int32, iCol int32, zText uintptr, pp uintptr) int32 { /* sqlite3.c:216377:12: */ + bp := tls.Alloc(3) + defer tls.Free(3) + + var nText I64 = I64(libc.Xstrlen(tls, zText)) + var zExpr uintptr = Xsqlite3_malloc64(tls, (uint64((nText * int64(4)) + int64(1)))) + var rc int32 = SQLITE_OK + + if zExpr == uintptr(0) { + rc = SQLITE_NOMEM + } else { + // var aSpec [3]int8 at bp, 3 + + var iOut int32 = 0 + var i int32 = 0 + var iFirst int32 = 0 + + if bGlob == 0 { + *(*int8)(unsafe.Pointer(bp /* &aSpec[0] */)) = int8('_') + *(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 1)) = int8('%') + *(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 2)) = int8(0) + } else { + *(*int8)(unsafe.Pointer(bp /* &aSpec[0] */)) = int8('*') + *(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 1)) = int8('?') + *(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 2)) = int8('[') + } + + for I64(i) <= nText { + if (((I64(i) == nText) || + (int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(bp /* &aSpec[0] */))))) || (int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 1))))) || (int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 2)))) { + if (i - iFirst) >= 3 { + var jj int32 + *(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8('"') + for jj = iFirst; jj < i; jj++ { + *(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(zText + uintptr(jj))) + if int32(*(*int8)(unsafe.Pointer(zText + uintptr(jj)))) == '"' { + *(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8('"') + } + } + *(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8('"') + *(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8(' ') + } + if int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 2))) { + i = i + (2) + if int32(*(*int8)(unsafe.Pointer(zText + uintptr((i - 1))))) == '^' { + i++ + } + for (I64(i) < nText) && (int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) != ']') { + i++ + } + } + iFirst = (i + 1) + } + i++ + } + if iOut > 0 { + var bAnd int32 = 0 + if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail != FTS5_DETAIL_FULL { + bAnd = 1 + if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE { + iCol = (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol + } + } + *(*int8)(unsafe.Pointer(zExpr + uintptr(iOut))) = int8(0) + rc = sqlite3Fts5ExprNew(tls, pConfig, bAnd, iCol, zExpr, pp, (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg) + } else { + *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0) + } + Xsqlite3_free(tls, zExpr) + } + + return rc +} + // Free the expression node object passed as the only argument. -func sqlite3Fts5ParseNodeFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:213190:13: */ +func sqlite3Fts5ParseNodeFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:216447:13: */ if p != 0 { var i int32 for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(p)).FnChild; i++ { @@ -164037,7 +166629,7 @@ func sqlite3Fts5ParseNodeFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:213190:13 } // Free the expression object passed as the only argument. -func sqlite3Fts5ExprFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:213204:13: */ +func sqlite3Fts5ExprFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:216461:13: */ if p != 0 { sqlite3Fts5ParseNodeFree(tls, (*Fts5Expr)(unsafe.Pointer(p)).FpRoot) Xsqlite3_free(tls, (*Fts5Expr)(unsafe.Pointer(p)).FapExprPhrase) @@ -164045,11 +166637,11 @@ func sqlite3Fts5ExprFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:213204:13: */ } } -func sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) int32 { /* sqlite3.c:213212:12: */ - bp := tls.Alloc(40) - defer tls.Free(40) +func sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) int32 { /* sqlite3.c:216469:12: */ + bp := tls.Alloc(48) + defer tls.Free(48) - // var sParse Fts5Parse at bp, 40 + // var sParse Fts5Parse at bp, 48 libc.Xmemset(tls, bp /* &sParse */, 0, uint64(unsafe.Sizeof(Fts5Parse{}))) @@ -164086,7 +166678,7 @@ func sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) int32 { /* sqlit // Argument pTerm must be a synonym iterator. Return the current rowid // that it points to. -func fts5ExprSynonymRowid(tls *libc.TLS, pTerm uintptr, bDesc int32, pbEof uintptr) I64 { /* sqlite3.c:213252:12: */ +func fts5ExprSynonymRowid(tls *libc.TLS, pTerm uintptr, bDesc int32, pbEof uintptr) I64 { /* sqlite3.c:216509:12: */ var iRet I64 = int64(0) var bRetValid int32 = 0 var p uintptr @@ -164108,7 +166700,7 @@ func fts5ExprSynonymRowid(tls *libc.TLS, pTerm uintptr, bDesc int32, pbEof uintp } // Argument pTerm must be a synonym iterator. -func fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid I64, pBuf uintptr, pa uintptr, pn uintptr) int32 { /* sqlite3.c:213276:12: */ +func fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid I64, pBuf uintptr, pa uintptr, pn uintptr) int32 { /* sqlite3.c:216533:12: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -164272,7 +166864,7 @@ __22: // SQLITE_OK is returned if an error occurs, or an SQLite error code // otherwise. It is not considered an error code if the current rowid is // not a match. -func fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMatch uintptr) int32 { /* sqlite3.c:213359:12: */ +func fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMatch uintptr) int32 { /* sqlite3.c:216616:12: */ bp := tls.Alloc(168) defer tls.Free(168) @@ -164497,11 +167089,11 @@ type Fts5LookaheadReader1 = struct { Fi int32 FiPos I64 FiLookahead I64 -} /* sqlite3.c:213443:9 */ +} /* sqlite3.c:216700:9 */ -type Fts5LookaheadReader = Fts5LookaheadReader1 /* sqlite3.c:213443:36 */ +type Fts5LookaheadReader = Fts5LookaheadReader1 /* sqlite3.c:216700:36 */ -func fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:213454:12: */ +func fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:216711:12: */ (*Fts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*Fts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if sqlite3Fts5PoslistNext64(tls, (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fn, (p+12 /* &.i */), (p+24 /* &.iLookahead */)) != 0 { (*Fts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead = (I64((int64(1))) << 62) @@ -164509,7 +167101,7 @@ func fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:2134 return (libc.Bool32((*Fts5LookaheadReader)(unsafe.Pointer(p)).FiPos == (I64((int64(1))) << 62))) } -func fts5LookaheadReaderInit(tls *libc.TLS, a uintptr, n int32, p uintptr) int32 { /* sqlite3.c:213462:12: */ +func fts5LookaheadReaderInit(tls *libc.TLS, a uintptr, n int32, p uintptr) int32 { /* sqlite3.c:216719:12: */ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Fts5LookaheadReader{}))) (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fa = a (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fn = n @@ -164521,9 +167113,9 @@ type Fts5NearTrimmer1 = struct { Freader Fts5LookaheadReader Fwriter Fts5PoslistWriter FpOut uintptr -} /* sqlite3.c:213473:9 */ +} /* sqlite3.c:216730:9 */ -type Fts5NearTrimmer = Fts5NearTrimmer1 /* sqlite3.c:213473:32 */ +type Fts5NearTrimmer = Fts5NearTrimmer1 /* sqlite3.c:216730:32 */ // The near-set object passed as the first argument contains more than // one phrase. All phrases currently point to the same row. The @@ -164540,7 +167132,7 @@ type Fts5NearTrimmer = Fts5NearTrimmer1 /* sqlite3.c:213473:32 */ // If no error occurs and non-zero (a match) is returned, the position-list // of each phrase object is edited to contain only those entries that // meet the constraint before returning. -func fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) int32 { /* sqlite3.c:213497:12: */ +func fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) int32 { /* sqlite3.c:216754:12: */ bp := tls.Alloc(196) defer tls.Free(196) @@ -164742,7 +167334,7 @@ __29: // If the iterator reaches EOF, set *pbEof to true before returning. If // an error occurs, set *pRc to an error code. If either *pbEof or *pRc // are set, return a non-zero value. Otherwise, return zero. -func fts5ExprAdvanceto(tls *libc.TLS, pIter uintptr, bDesc int32, piLast uintptr, pRc uintptr, pbEof uintptr) int32 { /* sqlite3.c:213596:12: */ +func fts5ExprAdvanceto(tls *libc.TLS, pIter uintptr, bDesc int32, piLast uintptr, pRc uintptr, pbEof uintptr) int32 { /* sqlite3.c:216853:12: */ var iLast I64 = *(*I64)(unsafe.Pointer(piLast)) var iRowid I64 @@ -164762,7 +167354,7 @@ func fts5ExprAdvanceto(tls *libc.TLS, pIter uintptr, bDesc int32, piLast uintptr return 0 } -func fts5ExprSynonymAdvanceto(tls *libc.TLS, pTerm uintptr, bDesc int32, piLast uintptr, pRc uintptr) int32 { /* sqlite3.c:213622:12: */ +func fts5ExprSynonymAdvanceto(tls *libc.TLS, pTerm uintptr, bDesc int32, piLast uintptr, pRc uintptr) int32 { /* sqlite3.c:216879:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -164789,7 +167381,7 @@ func fts5ExprSynonymAdvanceto(tls *libc.TLS, pTerm uintptr, bDesc int32, piLast return *(*int32)(unsafe.Pointer(bp /* bEof */)) } -func fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:213652:12: */ +func fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:216909:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -164846,7 +167438,7 @@ func fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr) // If an error occurs, return an SQLite error code. Otherwise, return // SQLITE_OK. It is not considered an error if some term matches zero // documents. -func fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:213711:12: */ +func fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:216968:12: */ var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear var i int32 @@ -164912,7 +167504,7 @@ func fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* // Otherwise, if this is a DESC iterator, the opposite is returned: // // (iRhs - iLhs) -func fts5RowidCmp(tls *libc.TLS, pExpr uintptr, iLhs I64, iRhs I64) int32 { /* sqlite3.c:213773:12: */ +func fts5RowidCmp(tls *libc.TLS, pExpr uintptr, iLhs I64, iRhs I64) int32 { /* sqlite3.c:217030:12: */ if (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc == 0 { if iLhs < iRhs { @@ -164928,7 +167520,7 @@ func fts5RowidCmp(tls *libc.TLS, pExpr uintptr, iLhs I64, iRhs I64) int32 { /* s return int32(0) } -func fts5ExprSetEof(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:213788:13: */ +func fts5ExprSetEof(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:217045:13: */ var i int32 (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1 (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0 @@ -164937,7 +167529,7 @@ func fts5ExprSetEof(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:213788:13: */ } } -func fts5ExprNodeZeroPoslist(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:213797:13: */ +func fts5ExprNodeZeroPoslist(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:217054:13: */ if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM) { var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear var i int32 @@ -164963,7 +167555,7 @@ func fts5ExprNodeZeroPoslist(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:213797 // This means that if the iteration order is ASC, then numerically larger // rowids are considered larger. Or if it is the default DESC, numerically // smaller rowids are larger. -func fts5NodeCompare(tls *libc.TLS, pExpr uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:213827:12: */ +func fts5NodeCompare(tls *libc.TLS, pExpr uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:217084:12: */ if (*Fts5ExprNode)(unsafe.Pointer(p2)).FbEof != 0 { return -1 } @@ -164982,7 +167574,7 @@ func fts5NodeCompare(tls *libc.TLS, pExpr uintptr, p1 uintptr, p2 uintptr) int32 // SQLITE_OK is returned if an error occurs, or an SQLite error code // otherwise. It is not considered an error code if an iterator reaches // EOF. -func fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:213848:12: */ +func fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:217105:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -165050,7 +167642,7 @@ func fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 // // Return SQLITE_OK if successful, or an SQLite error code if an error // occurs. -func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:213918:12: */ +func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:217175:12: */ var pTerm uintptr = (*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24 /* &.apPhrase */))) + 32 /* &.aTerm */) var rc int32 = SQLITE_OK @@ -165109,7 +167701,7 @@ func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromV return rc } -func fts5ExprNodeTest_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:213983:12: */ +func fts5ExprNodeTest_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:217240:12: */ // As this "NEAR" object is actually a single phrase that consists // of a single term only, grab pointers into the poslist managed by the // fts5_index.c iterator object. This is much faster than synthesizing @@ -165128,7 +167720,7 @@ func fts5ExprNodeTest_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { } // xNext() method for a node of type FTS5_TERM. -func fts5ExprNodeNext_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:214011:12: */ +func fts5ExprNodeNext_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:217268:12: */ var rc int32 var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24 /* &.apPhrase */))) + 32 /* &.aTerm */))).FpIter @@ -165146,7 +167738,7 @@ func fts5ExprNodeNext_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromVal return rc } -func fts5ExprNodeTest_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr) { /* sqlite3.c:214035:13: */ +func fts5ExprNodeTest_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr) { /* sqlite3.c:217292:13: */ var pNext uintptr = *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */))) var i int32 @@ -165162,7 +167754,7 @@ func fts5ExprNodeTest_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr) { /* sqlit (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = (*Fts5ExprNode)(unsafe.Pointer(pNext)).FbNomatch } -func fts5ExprNodeNext_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:214054:12: */ +func fts5ExprNodeNext_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:217311:12: */ var i int32 var iLast I64 = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid @@ -165186,7 +167778,7 @@ func fts5ExprNodeNext_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid } // Argument pNode is an FTS5_AND node. -func fts5ExprNodeTest_AND(tls *libc.TLS, pExpr uintptr, pAnd uintptr) int32 { /* sqlite3.c:214086:12: */ +func fts5ExprNodeTest_AND(tls *libc.TLS, pExpr uintptr, pAnd uintptr) int32 { /* sqlite3.c:217343:12: */ var iChild int32 var iLast I64 = (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FiRowid var rc int32 = SQLITE_OK @@ -165234,7 +167826,7 @@ func fts5ExprNodeTest_AND(tls *libc.TLS, pExpr uintptr, pAnd uintptr) int32 { /* return SQLITE_OK } -func fts5ExprNodeNext_AND(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:214138:12: */ +func fts5ExprNodeNext_AND(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:217395:12: */ var rc int32 = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */))) + 16 /* &.xNext */))))(tls, pExpr, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */))), bFromValid, iFrom) if rc == SQLITE_OK { rc = fts5ExprNodeTest_AND(tls, pExpr, pNode) @@ -165244,7 +167836,7 @@ func fts5ExprNodeNext_AND(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromVali return rc } -func fts5ExprNodeTest_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:214153:12: */ +func fts5ExprNodeTest_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:217410:12: */ var rc int32 = SQLITE_OK var p1 uintptr = *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */))) var p2 uintptr = *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + 1*8)) @@ -165270,7 +167862,7 @@ func fts5ExprNodeTest_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { / return rc } -func fts5ExprNodeNext_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:214181:12: */ +func fts5ExprNodeNext_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:217438:12: */ var rc int32 = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */))) + 16 /* &.xNext */))))(tls, pExpr, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */))), bFromValid, iFrom) if rc == SQLITE_OK { rc = fts5ExprNodeTest_NOT(tls, pExpr, pNode) @@ -165284,7 +167876,7 @@ func fts5ExprNodeNext_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromVali // If pNode currently points to a match, this function returns SQLITE_OK // without modifying it. Otherwise, pNode is advanced until it does point // to a match or EOF is reached. -func fts5ExprNodeTest(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:214202:12: */ +func fts5ExprNodeTest(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:217459:12: */ var rc int32 = SQLITE_OK if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 { switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType { @@ -165337,7 +167929,7 @@ func fts5ExprNodeTest(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sq // // Return an SQLite error code if an error occurs, or SQLITE_OK otherwise. // It is not an error if there are no matches. -func fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:214247:12: */ +func fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:217504:12: */ var rc int32 = SQLITE_OK (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 0 (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0 @@ -165399,7 +167991,7 @@ func fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* s // // Return SQLITE_OK if successful, or an SQLite error code otherwise. It // is not considered an error if the query does not match any documents. -func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bDesc int32) int32 { /* sqlite3.c:214306:12: */ +func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bDesc int32) int32 { /* sqlite3.c:217563:12: */ var pRoot uintptr = (*Fts5Expr)(unsafe.Pointer(p)).FpRoot var rc int32 // Return code @@ -165416,7 +168008,7 @@ func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bD } // If the iterator is not at a real match, skip forward until it is. - for (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbNomatch != 0 { + for ((*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbNomatch != 0) && (rc == SQLITE_OK) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((pRoot + 16 /* &.xNext */))))(tls, p, pRoot, 0, int64(0)) } @@ -165427,7 +168019,7 @@ func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bD // // Return SQLITE_OK if successful, or an SQLite error code otherwise. It // is not considered an error if the query does not match any documents. -func sqlite3Fts5ExprNext(tls *libc.TLS, p uintptr, iLast I64) int32 { /* sqlite3.c:214337:12: */ +func sqlite3Fts5ExprNext(tls *libc.TLS, p uintptr, iLast I64) int32 { /* sqlite3.c:217594:12: */ var rc int32 var pRoot uintptr = (*Fts5Expr)(unsafe.Pointer(p)).FpRoot @@ -165441,15 +168033,15 @@ func sqlite3Fts5ExprNext(tls *libc.TLS, p uintptr, iLast I64) int32 { /* sqlite3 return rc } -func sqlite3Fts5ExprEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:214351:12: */ +func sqlite3Fts5ExprEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:217608:12: */ return (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(p)).FpRoot)).FbEof } -func sqlite3Fts5ExprRowid(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:214355:12: */ +func sqlite3Fts5ExprRowid(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:217612:12: */ return (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(p)).FpRoot)).FiRowid } -func fts5ParseStringFromToken(tls *libc.TLS, pToken uintptr, pz uintptr) int32 { /* sqlite3.c:214359:12: */ +func fts5ParseStringFromToken(tls *libc.TLS, pToken uintptr, pz uintptr) int32 { /* sqlite3.c:217616:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -165459,7 +168051,7 @@ func fts5ParseStringFromToken(tls *libc.TLS, pToken uintptr, pz uintptr) int32 { } // Free the phrase object passed as the only argument. -func fts5ExprPhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:214368:13: */ +func fts5ExprPhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:217625:13: */ if pPhrase != 0 { var i int32 for i = 0; i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; i++ { @@ -165484,7 +168076,7 @@ func fts5ExprPhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:214368:13 // Set the "bFirst" flag on the first token of the phrase passed as the // only argument. -func sqlite3Fts5ParseSetCaret(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:214393:13: */ +func sqlite3Fts5ParseSetCaret(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:217650:13: */ if (pPhrase != 0) && ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm != 0) { (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */))).FbFirst = U8(1) } @@ -165496,7 +168088,7 @@ func sqlite3Fts5ParseSetCaret(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:214 // // If an OOM error occurs, both the pNear and pPhrase objects are freed and // NULL returned. -func sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhrase uintptr) uintptr { /* sqlite3.c:214407:24: */ +func sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhrase uintptr) uintptr { /* sqlite3.c:217664:24: */ var SZALLOC int32 = 8 var pRet uintptr = uintptr(0) @@ -165556,12 +168148,12 @@ type TokenCtx1 = struct { FpPhrase uintptr Frc int32 _ [4]byte -} /* sqlite3.c:214467:9 */ +} /* sqlite3.c:217724:9 */ -type TokenCtx = TokenCtx1 /* sqlite3.c:214467:25 */ +type TokenCtx = TokenCtx1 /* sqlite3.c:217724:25 */ // Callback for tokenizing terms used by ParseTerm(). -func fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:214476:12: */ +func fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:217733:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -165630,12 +168222,12 @@ func fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken uin } // Free the phrase object passed as the only argument. -func sqlite3Fts5ParsePhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:214541:13: */ +func sqlite3Fts5ParsePhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:217798:13: */ fts5ExprPhraseFree(tls, pPhrase) } // Free the phrase object passed as the second argument. -func sqlite3Fts5ParseNearsetFree(tls *libc.TLS, pNear uintptr) { /* sqlite3.c:214548:13: */ +func sqlite3Fts5ParseNearsetFree(tls *libc.TLS, pNear uintptr) { /* sqlite3.c:217805:13: */ if pNear != 0 { var i int32 for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ { @@ -165646,15 +168238,29 @@ func sqlite3Fts5ParseNearsetFree(tls *libc.TLS, pNear uintptr) { /* sqlite3.c:21 } } -func sqlite3Fts5ParseFinished(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:214559:13: */ +func sqlite3Fts5ParseFinished(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:217816:13: */ (*Fts5Parse)(unsafe.Pointer(pParse)).FpExpr = p } +func parseGrowPhraseArray(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:217821:12: */ + if ((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase % 8) == 0 { + var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * (uint64((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase + 8)))) + var apNew uintptr + apNew = Xsqlite3_realloc64(tls, (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase, uint64(nByte)) + if apNew == uintptr(0) { + (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM + return SQLITE_NOMEM + } + (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase = apNew + } + return SQLITE_OK +} + // This function is called by the parser to process a string token. The // string may or may not be quoted. In any case it is tokenized and a // phrase object consisting of all tokens returned. -func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken uintptr, bPrefix int32) uintptr { /* sqlite3.c:214569:23: */ +func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken uintptr, bPrefix int32) uintptr { /* sqlite3.c:217840:23: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -165690,16 +168296,9 @@ func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken } else { if pAppend == uintptr(0) { - if ((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase % 8) == 0 { - var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * (uint64((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase + 8)))) - var apNew uintptr - apNew = Xsqlite3_realloc64(tls, (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase, uint64(nByte)) - if apNew == uintptr(0) { - (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM - fts5ExprPhraseFree(tls, (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase) - return uintptr(0) - } - (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase = apNew + if parseGrowPhraseArray(tls, pParse) != 0 { + fts5ExprPhraseFree(tls, (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase) + return uintptr(0) } (*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase++ } @@ -165719,7 +168318,7 @@ func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken // Create a new FTS5 expression by cloning phrase iPhrase of the // expression passed as the second argument. -func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppNew uintptr) int32 { /* sqlite3.c:214630:12: */ +func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppNew uintptr) int32 { /* sqlite3.c:217894:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -165814,17 +168413,17 @@ func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppN // Token pTok has appeared in a MATCH expression where the NEAR operator // is expected. If token pTok does not contain "NEAR", store an error // in the pParse object. -func sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { /* sqlite3.c:214726:13: */ +func sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { /* sqlite3.c:217990:13: */ bp := tls.Alloc(16) defer tls.Free(16) - if ((*Fts5Token)(unsafe.Pointer(pTok)).Fn != 4) || (libc.Xmemcmp(tls, ts+30509 /* "NEAR" */, (*Fts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0) { + if ((*Fts5Token)(unsafe.Pointer(pTok)).Fn != 4) || (libc.Xmemcmp(tls, ts+31033 /* "NEAR" */, (*Fts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0) { sqlite3Fts5ParseError(tls, - pParse, ts+29538 /* "fts5: syntax err..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(pTok)).Fn, (*Fts5Token)(unsafe.Pointer(pTok)).Fp)) + pParse, ts+30062 /* "fts5: syntax err..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(pTok)).Fn, (*Fts5Token)(unsafe.Pointer(pTok)).Fp)) } } -func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p uintptr) { /* sqlite3.c:214734:13: */ +func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p uintptr) { /* sqlite3.c:217998:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -165836,7 +168435,7 @@ func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p var c int8 = *(*int8)(unsafe.Pointer((*Fts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if (int32(c) < '0') || (int32(c) > '9') { sqlite3Fts5ParseError(tls, - pParse, ts+30514 /* "expected integer..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(p)).Fn, (*Fts5Token)(unsafe.Pointer(p)).Fp)) + pParse, ts+31038 /* "expected integer..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(p)).Fn, (*Fts5Token)(unsafe.Pointer(p)).Fp)) return } nNear = ((nNear * 10) + (int32(*(*int8)(unsafe.Pointer((*Fts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - '0')) @@ -165855,7 +168454,7 @@ func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p // // If an OOM error occurs, store an error code in pParse and return NULL. // The old colset object (if any) is not freed in this case. -func fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:214769:19: */ +func fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:218033:19: */ var nCol int32 if p != 0 { nCol = (*Fts5Colset)(unsafe.Pointer(p)).FnCol @@ -165893,7 +168492,7 @@ func fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintp // Allocate and return an Fts5Colset object specifying the inverse of // the colset passed as the second argument. Free the colset passed // as the second argument before returning. -func sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:214810:19: */ +func sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:218074:19: */ var pRet uintptr var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol @@ -165915,7 +168514,7 @@ func sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) uint return pRet } -func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p uintptr) uintptr { /* sqlite3.c:214833:19: */ +func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p uintptr) uintptr { /* sqlite3.c:218097:19: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -165933,7 +168532,7 @@ func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p ui } } if iCol == (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol { - sqlite3Fts5ParseError(tls, pParse, ts+17864 /* "no such column: ..." */, libc.VaList(bp, z)) + sqlite3Fts5ParseError(tls, pParse, ts+18346 /* "no such column: ..." */, libc.VaList(bp, z)) } else { pRet = fts5ParseColset(tls, pParse, pColset, iCol) } @@ -165954,7 +168553,7 @@ func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p ui // Otherwise, a copy of (*pOrig) is made into memory obtained from // sqlite3Fts5MallocZero() and a pointer to it returned. If the allocation // fails, (*pRc) is set to SQLITE_NOMEM and NULL is returned. -func fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) uintptr { /* sqlite3.c:214873:19: */ +func fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) uintptr { /* sqlite3.c:218137:19: */ var pRet uintptr if pOrig != 0 { var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Colset{})) + ((uint64((*Fts5Colset)(unsafe.Pointer(pOrig)).FnCol - 1)) * uint64(unsafe.Sizeof(int32(0)))))) @@ -165969,7 +168568,7 @@ func fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) uintptr { /* sql } // Remove from colset pColset any columns that are not also in colset pMerge. -func fts5MergeColset(tls *libc.TLS, pColset uintptr, pMerge uintptr) { /* sqlite3.c:214890:13: */ +func fts5MergeColset(tls *libc.TLS, pColset uintptr, pMerge uintptr) { /* sqlite3.c:218154:13: */ var iIn int32 = 0 // Next input in pColset var iMerge int32 = 0 // Next input in pMerge var iOut int32 = 0 // Next output slot in pColset @@ -165993,7 +168592,7 @@ func fts5MergeColset(tls *libc.TLS, pColset uintptr, pMerge uintptr) { /* sqlite // its decendents. If (*ppFree) is not NULL, it contains a spare copy // of pColset. This function may use the spare copy and set (*ppFree) to // zero, or it may create copies of pColset using fts5CloneColset(). -func fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pNode uintptr, pColset uintptr, ppFree uintptr) { /* sqlite3.c:214916:13: */ +func fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pNode uintptr, pColset uintptr, ppFree uintptr) { /* sqlite3.c:218180:13: */ if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM) { @@ -166021,7 +168620,7 @@ func fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pNode uintptr, pColset ui } // Apply colset pColset to expression node pExpr and all of its descendents. -func sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pColset uintptr) { /* sqlite3.c:214954:13: */ +func sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pColset uintptr) { /* sqlite3.c:218218:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -166029,14 +168628,14 @@ func sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pCo if (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == FTS5_DETAIL_NONE { (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR (*Fts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_mprintf(tls, - ts+30543 /* "fts5: column que..." */, 0) + ts+31067 /* "fts5: column que..." */, 0) } else { fts5ParseSetColset(tls, pParse, pExpr, pColset, bp /* &pFree */) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp /* pFree */))) } -func fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:214971:13: */ +func fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:218235:13: */ switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType { case FTS5_STRING: { @@ -166087,7 +168686,7 @@ func fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:214971:13: } } -func fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) { /* sqlite3.c:215004:13: */ +func fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) { /* sqlite3.c:218268:13: */ if ((*Fts5ExprNode)(unsafe.Pointer(p)).FeType != FTS5_NOT) && ((*Fts5ExprNode)(unsafe.Pointer(pSub)).FeType == (*Fts5ExprNode)(unsafe.Pointer(p)).FeType) { var nByte int32 = (int32(uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Fts5ExprNode)(unsafe.Pointer(pSub)).FnChild))) libc.Xmemcpy(tls, ((p + 48 /* &.apChild */) + uintptr((*Fts5ExprNode)(unsafe.Pointer(p)).FnChild)*8), pSub+48 /* &.apChild */, uint64(nByte)) @@ -166098,9 +168697,59 @@ func fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) { /* sqlite3.c: } } +// This function is used when parsing LIKE or GLOB patterns against +// trigram indexes that specify either detail=column or detail=none. +// It converts a phrase: +// +// abc + def + ghi +// +// into an AND tree: +// +// abc AND def AND ghi +func fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) uintptr { /* sqlite3.c:218290:21: */ + var nTerm int32 = (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */))))).FnTerm + var ii int32 + var nByte int32 + var pRet uintptr + + nByte = (int32(uint64(unsafe.Sizeof(Fts5ExprNode{})) + (uint64(nTerm) * uint64(unsafe.Sizeof(uintptr(0)))))) + pRet = sqlite3Fts5MallocZero(tls, (pParse + 16 /* &.rc */), int64(nByte)) + if pRet != 0 { + (*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = FTS5_AND + (*Fts5ExprNode)(unsafe.Pointer(pRet)).FnChild = nTerm + fts5ExprAssignXNext(tls, pRet) + (*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-- + for ii = 0; ii < nTerm; ii++ { + var pPhrase uintptr = sqlite3Fts5MallocZero(tls, + (pParse + 16 /* &.rc */), int64(unsafe.Sizeof(Fts5ExprPhrase{}))) + if pPhrase != 0 { + if parseGrowPhraseArray(tls, pParse) != 0 { + fts5ExprPhraseFree(tls, pPhrase) + } else { + *(*uintptr)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr(libc.PostIncInt32(&(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase, 1))*8)) = pPhrase + (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm = 1 + (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */))).FzTerm = sqlite3Fts5Strndup(tls, + (pParse + 16 /* &.rc */), (*Fts5ExprTerm)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */)))+32 /* &.aTerm */)+uintptr(ii)*32)).FzTerm, -1) + *(*uintptr)(unsafe.Pointer((pRet + 48 /* &.apChild */) + uintptr(ii)*8)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_STRING, + uintptr(0), uintptr(0), sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), pPhrase)) + } + } + } + + if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc != 0 { + sqlite3Fts5ParseNodeFree(tls, pRet) + pRet = uintptr(0) + } else { + sqlite3Fts5ParseNearsetFree(tls, pNear) + } + } + + return pRet +} + // Allocate and return a new expression object. If anything goes wrong (i.e. // OOM error), leave an error code in pParse and return NULL. -func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uintptr, pRight uintptr, pNear uintptr) uintptr { /* sqlite3.c:215019:21: */ +func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uintptr, pRight uintptr, pNear uintptr) uintptr { /* sqlite3.c:218344:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -166120,58 +168769,64 @@ func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uint return pLeft } - if eType == FTS5_NOT { - nChild = 2 - } else if (eType == FTS5_AND) || (eType == FTS5_OR) { - nChild = 2 - if (*Fts5ExprNode)(unsafe.Pointer(pLeft)).FeType == eType { - nChild = nChild + ((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild - 1) - } - if (*Fts5ExprNode)(unsafe.Pointer(pRight)).FeType == eType { - nChild = nChild + ((*Fts5ExprNode)(unsafe.Pointer(pRight)).FnChild - 1) - } - } - - nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5ExprNode{})) + (uint64(unsafe.Sizeof(uintptr(0))) * (uint64(nChild - 1))))) - pRet = sqlite3Fts5MallocZero(tls, (pParse + 16 /* &.rc */), nByte) - - if pRet != 0 { - (*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType - (*Fts5ExprNode)(unsafe.Pointer(pRet)).FpNear = pNear - fts5ExprAssignXNext(tls, pRet) - if eType == FTS5_STRING { - var iPhrase int32 - for iPhrase = 0; iPhrase < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; iPhrase++ { - (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(iPhrase)*8)))).FpNode = pRet - if (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(iPhrase)*8)))).FnTerm == 0 { - (*Fts5ExprNode)(unsafe.Pointer(pRet)).FxNext = uintptr(0) - (*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = FTS5_EOF - } + if ((eType == FTS5_STRING) && + ((*Fts5Parse)(unsafe.Pointer(pParse)).FbPhraseToAnd != 0)) && + ((*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */))))).FnTerm > 1) { + pRet = fts5ParsePhraseToAnd(tls, pParse, pNear) + } else { + if eType == FTS5_NOT { + nChild = 2 + } else if (eType == FTS5_AND) || (eType == FTS5_OR) { + nChild = 2 + if (*Fts5ExprNode)(unsafe.Pointer(pLeft)).FeType == eType { + nChild = nChild + ((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild - 1) } - - if (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail != FTS5_DETAIL_FULL { - var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */))) - if (((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != 1) || - ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 1)) || - (((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0) && ((*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */))).FbFirst != 0)) { - - (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR - - (*Fts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_mprintf(tls, - ts+30596, /* "fts5: %s queries..." */ - libc.VaList(bp, func() uintptr { - if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == 1 { - return ts + 30646 /* "phrase" */ - } - return ts + 30509 /* "NEAR" */ - }())) - Xsqlite3_free(tls, pRet) - pRet = uintptr(0) - } + if (*Fts5ExprNode)(unsafe.Pointer(pRight)).FeType == eType { + nChild = nChild + ((*Fts5ExprNode)(unsafe.Pointer(pRight)).FnChild - 1) + } + } + + nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5ExprNode{})) + (uint64(unsafe.Sizeof(uintptr(0))) * (uint64(nChild - 1))))) + pRet = sqlite3Fts5MallocZero(tls, (pParse + 16 /* &.rc */), nByte) + + if pRet != 0 { + (*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType + (*Fts5ExprNode)(unsafe.Pointer(pRet)).FpNear = pNear + fts5ExprAssignXNext(tls, pRet) + if eType == FTS5_STRING { + var iPhrase int32 + for iPhrase = 0; iPhrase < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; iPhrase++ { + (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(iPhrase)*8)))).FpNode = pRet + if (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(iPhrase)*8)))).FnTerm == 0 { + (*Fts5ExprNode)(unsafe.Pointer(pRet)).FxNext = uintptr(0) + (*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = FTS5_EOF + } + } + + if (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail != FTS5_DETAIL_FULL { + var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */))) + if (((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != 1) || + ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 1)) || + (((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0) && ((*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */))).FbFirst != 0)) { + + (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR + + (*Fts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_mprintf(tls, + ts+31120, /* "fts5: %s queries..." */ + libc.VaList(bp, func() uintptr { + if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == 1 { + return ts + 31170 /* "phrase" */ + } + return ts + 31033 /* "NEAR" */ + }())) + Xsqlite3_free(tls, pRet) + pRet = uintptr(0) + } + } + } else { + fts5ExprAddChildren(tls, pRet, pLeft) + fts5ExprAddChildren(tls, pRet, pRight) } - } else { - fts5ExprAddChildren(tls, pRet, pLeft) - fts5ExprAddChildren(tls, pRet, pRight) } } } @@ -166185,7 +168840,7 @@ func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uint return pRet } -func sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:215097:21: */ +func sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:218429:21: */ var pRet uintptr = uintptr(0) var pPrev uintptr @@ -166229,7 +168884,7 @@ func sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, p return pRet } -func fts5ExprTermPrint(tls *libc.TLS, pTerm uintptr) uintptr { /* sqlite3.c:215161:13: */ +func fts5ExprTermPrint(tls *libc.TLS, pTerm uintptr) uintptr { /* sqlite3.c:218493:13: */ var nByte Sqlite3_int64 = int64(0) var p uintptr var zQuoted uintptr @@ -166265,7 +168920,7 @@ func fts5ExprTermPrint(tls *libc.TLS, pTerm uintptr) uintptr { /* sqlite3.c:2151 return zQuoted } -func fts5PrintfAppend(tls *libc.TLS, zApp uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:215193:13: */ +func fts5PrintfAppend(tls *libc.TLS, zApp uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:218525:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -166276,7 +168931,7 @@ func fts5PrintfAppend(tls *libc.TLS, zApp uintptr, zFmt uintptr, va uintptr) uin zNew = Xsqlite3_vmprintf(tls, zFmt, ap) _ = ap if (zApp != 0) && (zNew != 0) { - var zNew2 uintptr = Xsqlite3_mprintf(tls, ts+3884 /* "%s%s" */, libc.VaList(bp, zApp, zNew)) + var zNew2 uintptr = Xsqlite3_mprintf(tls, ts+3912 /* "%s%s" */, libc.VaList(bp, zApp, zNew)) Xsqlite3_free(tls, zNew) zNew = zNew2 } @@ -166288,7 +168943,7 @@ func fts5PrintfAppend(tls *libc.TLS, zApp uintptr, zFmt uintptr, va uintptr) uin // pointer to a buffer containing that representation. It is the // responsibility of the caller to at some point free the buffer using // sqlite3_free(). -func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr uintptr) uintptr { /* sqlite3.c:215214:13: */ +func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr uintptr) uintptr { /* sqlite3.c:218546:13: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -166298,7 +168953,7 @@ func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr var i int32 var iTerm int32 - zRet = fts5PrintfAppend(tls, zRet, ts+30653 /* "%s " */, libc.VaList(bp, zNearsetCmd)) + zRet = fts5PrintfAppend(tls, zRet, ts+31177 /* "%s " */, libc.VaList(bp, zNearsetCmd)) if zRet == uintptr(0) { return uintptr(0) } @@ -166306,13 +168961,13 @@ func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr var aiCol uintptr = (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset + 4 /* &.aiCol */ var nCol int32 = (*Fts5Colset)(unsafe.Pointer((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset)).FnCol if nCol == 1 { - zRet = fts5PrintfAppend(tls, zRet, ts+30657 /* "-col %d " */, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(aiCol)))) + zRet = fts5PrintfAppend(tls, zRet, ts+31181 /* "-col %d " */, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(aiCol)))) } else { - zRet = fts5PrintfAppend(tls, zRet, ts+30666 /* "-col {%d" */, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(aiCol)))) + zRet = fts5PrintfAppend(tls, zRet, ts+31190 /* "-col {%d" */, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(aiCol)))) for i = 1; i < (*Fts5Colset)(unsafe.Pointer((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset)).FnCol; i++ { - zRet = fts5PrintfAppend(tls, zRet, ts+30675 /* " %d" */, libc.VaList(bp+24, *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)))) + zRet = fts5PrintfAppend(tls, zRet, ts+31199 /* " %d" */, libc.VaList(bp+24, *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)))) } - zRet = fts5PrintfAppend(tls, zRet, ts+30679 /* "} " */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+31203 /* "} " */, 0) } if zRet == uintptr(0) { return uintptr(0) @@ -166320,13 +168975,13 @@ func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr } if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > 1 { - zRet = fts5PrintfAppend(tls, zRet, ts+30682 /* "-near %d " */, libc.VaList(bp+32, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear)) + zRet = fts5PrintfAppend(tls, zRet, ts+31206 /* "-near %d " */, libc.VaList(bp+32, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear)) if zRet == uintptr(0) { return uintptr(0) } } - zRet = fts5PrintfAppend(tls, zRet, ts+30692 /* "--" */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+31216 /* "--" */, 0) if zRet == uintptr(0) { return uintptr(0) } @@ -166334,22 +168989,22 @@ func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ { var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(i)*8)) - zRet = fts5PrintfAppend(tls, zRet, ts+30695 /* " {" */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+31219 /* " {" */, 0) for iTerm = 0; (zRet != 0) && (iTerm < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm); iTerm++ { var zTerm uintptr = (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */) + uintptr(iTerm)*32)).FzTerm - zRet = fts5PrintfAppend(tls, zRet, ts+3884 /* "%s%s" */, libc.VaList(bp+40, func() uintptr { + zRet = fts5PrintfAppend(tls, zRet, ts+3912 /* "%s%s" */, libc.VaList(bp+40, func() uintptr { if iTerm == 0 { return ts + 703 /* "" */ } - return ts + 12763 /* " " */ + return ts + 9214 /* " " */ }(), zTerm)) if (*Fts5ExprTerm)(unsafe.Pointer((pPhrase+32 /* &.aTerm */)+uintptr(iTerm)*32)).FbPrefix != 0 { - zRet = fts5PrintfAppend(tls, zRet, ts+16972 /* "*" */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+17383 /* "*" */, 0) } } if zRet != 0 { - zRet = fts5PrintfAppend(tls, zRet, ts+23890 /* "}" */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+24414 /* "}" */, 0) } if zRet == uintptr(0) { return uintptr(0) @@ -166361,27 +169016,27 @@ func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr var i int32 switch (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType { case FTS5_AND: - zOp = ts + 27251 /* "AND" */ + zOp = ts + 27775 /* "AND" */ break fallthrough case FTS5_NOT: - zOp = ts + 30505 /* "NOT" */ + zOp = ts + 31029 /* "NOT" */ break fallthrough default: - zOp = ts + 30502 /* "OR" */ + zOp = ts + 31026 /* "OR" */ break } - zRet = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp+56, zOp)) + zRet = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp+56, zOp)) for i = 0; (zRet != 0) && (i < (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FnChild); i++ { var z uintptr = fts5ExprPrintTcl(tls, pConfig, zNearsetCmd, *(*uintptr)(unsafe.Pointer((pExpr + 48 /* &.apChild */) + uintptr(i)*8))) if !(z != 0) { Xsqlite3_free(tls, zRet) zRet = uintptr(0) } else { - zRet = fts5PrintfAppend(tls, zRet, ts+30698 /* " [%z]" */, libc.VaList(bp+64, z)) + zRet = fts5PrintfAppend(tls, zRet, ts+31222 /* " [%z]" */, libc.VaList(bp+64, z)) } } } @@ -166389,28 +169044,48 @@ func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr return zRet } -func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* sqlite3.c:215293:13: */ - bp := tls.Alloc(64) - defer tls.Free(64) +func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* sqlite3.c:218625:13: */ + bp := tls.Alloc(80) + defer tls.Free(80) var zRet uintptr = uintptr(0) if (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType == 0 { - return Xsqlite3_mprintf(tls, ts+30704 /* "\"\"" */, 0) + return Xsqlite3_mprintf(tls, ts+31228 /* "\"\"" */, 0) } else if ((*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType == FTS5_STRING) || ((*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType == FTS5_TERM) { var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FpNear var i int32 var iTerm int32 if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset != 0 { - var iCol int32 = *(*int32)(unsafe.Pointer(((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset + 4 /* &.aiCol */))) - zRet = fts5PrintfAppend(tls, zRet, ts+30707 /* "%s : " */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(iCol)*8)))) + var ii int32 + var pColset uintptr = (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset + if (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol > 1 { + zRet = fts5PrintfAppend(tls, zRet, ts+31231 /* "{" */, 0) + } + for ii = 0; ii < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; ii++ { + zRet = fts5PrintfAppend(tls, zRet, ts+3912, /* "%s%s" */ + libc.VaList(bp, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(*(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(ii)*4)))*8)), func() uintptr { + if ii == ((*Fts5Colset)(unsafe.Pointer(pColset)).FnCol - 1) { + return ts + 703 /* "" */ + } + return ts + 9214 /* " " */ + }())) + } + if zRet != 0 { + zRet = fts5PrintfAppend(tls, zRet, ts+31233 /* "%s : " */, libc.VaList(bp+16, func() uintptr { + if (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol > 1 { + return ts + 24414 /* "}" */ + } + return ts + 703 /* "" */ + }())) + } if zRet == uintptr(0) { return uintptr(0) } } if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > 1 { - zRet = fts5PrintfAppend(tls, zRet, ts+30713 /* "NEAR(" */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+31239 /* "NEAR(" */, 0) if zRet == uintptr(0) { return uintptr(0) } @@ -166419,7 +169094,7 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ { var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(i)*8)) if i != 0 { - zRet = fts5PrintfAppend(tls, zRet, ts+12763 /* " " */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+9214 /* " " */, 0) if zRet == uintptr(0) { return uintptr(0) } @@ -166427,11 +169102,11 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s for iTerm = 0; iTerm < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; iTerm++ { var zTerm uintptr = fts5ExprTermPrint(tls, ((pPhrase + 32 /* &.aTerm */) + uintptr(iTerm)*32)) if zTerm != 0 { - zRet = fts5PrintfAppend(tls, zRet, ts+3884 /* "%s%s" */, libc.VaList(bp+8, func() uintptr { + zRet = fts5PrintfAppend(tls, zRet, ts+3912 /* "%s%s" */, libc.VaList(bp+24, func() uintptr { if iTerm == 0 { return ts + 703 /* "" */ } - return ts + 30719 /* " + " */ + return ts + 31245 /* " + " */ }(), zTerm)) Xsqlite3_free(tls, zTerm) } @@ -166443,7 +169118,7 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s } if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > 1 { - zRet = fts5PrintfAppend(tls, zRet, ts+30723 /* ", %d)" */, libc.VaList(bp+24, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear)) + zRet = fts5PrintfAppend(tls, zRet, ts+31249 /* ", %d)" */, libc.VaList(bp+40, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear)) if zRet == uintptr(0) { return uintptr(0) } @@ -166455,16 +169130,16 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s switch (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType { case FTS5_AND: - zOp = ts + 18855 /* " AND " */ + zOp = ts + 19343 /* " AND " */ break fallthrough case FTS5_NOT: - zOp = ts + 30729 /* " NOT " */ + zOp = ts + 31255 /* " NOT " */ break fallthrough default: - zOp = ts + 30735 /* " OR " */ + zOp = ts + 31261 /* " OR " */ break } @@ -166476,8 +169151,8 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s } else { var e int32 = (*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pExpr + 48 /* &.apChild */) + uintptr(i)*8)))).FeType var b int32 = (libc.Bool32(((e != FTS5_STRING) && (e != FTS5_TERM)) && (e != FTS5_EOF))) - zRet = fts5PrintfAppend(tls, zRet, ts+30740, /* "%s%s%z%s" */ - libc.VaList(bp+32, func() uintptr { + zRet = fts5PrintfAppend(tls, zRet, ts+31266, /* "%s%s%z%s" */ + libc.VaList(bp+48, func() uintptr { if i == 0 { return ts + 703 /* "" */ } @@ -166485,12 +169160,12 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s }(), func() uintptr { if b != 0 { - return ts + 18861 /* "(" */ + return ts + 19349 /* "(" */ } return ts + 703 /* "" */ }(), z, func() uintptr { if b != 0 { - return ts + 3907 /* ")" */ + return ts + 3935 /* ")" */ } return ts + 703 /* "" */ }())) @@ -166506,7 +169181,7 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s // The implementation of user-defined scalar functions fts5_expr() (bTcl==0) // and fts5_expr_tcl() (bTcl!=0). -func fts5ExprFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr, bTcl int32) { /* sqlite3.c:215375:13: */ +func fts5ExprFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr, bTcl int32) { /* sqlite3.c:218716:13: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -166518,18 +169193,18 @@ func fts5ExprFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr, bT var rc int32 var i int32 var azConfig uintptr // Array of arguments for Fts5Config - var zNearsetCmd uintptr = ts + 30749 /* "nearset" */ + var zNearsetCmd uintptr = ts + 31275 /* "nearset" */ var nConfig int32 // Size of azConfig[] *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)) = uintptr(0) var iArg int32 = 1 if nArg < 1 { - *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)) = Xsqlite3_mprintf(tls, ts+30757, /* "wrong number of ..." */ + *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)) = Xsqlite3_mprintf(tls, ts+31283, /* "wrong number of ..." */ libc.VaList(bp, func() uintptr { if bTcl != 0 { - return ts + 30798 /* "fts5_expr_tcl" */ + return ts + 31324 /* "fts5_expr_tcl" */ } - return ts + 30812 /* "fts5_expr" */ + return ts + 31338 /* "fts5_expr" */ }())) Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)), -1) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */))) @@ -166548,8 +169223,8 @@ func fts5ExprFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr, bT return } *(*uintptr)(unsafe.Pointer(azConfig)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(azConfig + 1*8)) = ts + 5282 /* "main" */ - *(*uintptr)(unsafe.Pointer(azConfig + 2*8)) = ts + 9384 /* "tbl" */ + *(*uintptr)(unsafe.Pointer(azConfig + 1*8)) = ts + 5327 /* "main" */ + *(*uintptr)(unsafe.Pointer(azConfig + 2*8)) = ts + 9749 /* "tbl" */ for i = 3; iArg < nArg; iArg++ { var z uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(iArg)*8))) *(*uintptr)(unsafe.Pointer(azConfig + uintptr(libc.PostIncInt32(&i, 1))*8)) = func() uintptr { @@ -166567,7 +169242,7 @@ func fts5ExprFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr, bT rc = sqlite3Fts5ConfigParse(tls, pGlobal, db, nConfig, azConfig, bp+8 /* &pConfig */, bp+16 /* &zErr */) if rc == SQLITE_OK { - rc = sqlite3Fts5ExprNew(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)), (*Fts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)))).FnCol, zExpr, bp+24 /* &pExpr */, bp+16 /* &zErr */) + rc = sqlite3Fts5ExprNew(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)), 0, (*Fts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)))).FnCol, zExpr, bp+24 /* &pExpr */, bp+16 /* &zErr */) } if rc == SQLITE_OK { var zText uintptr @@ -166599,18 +169274,18 @@ func fts5ExprFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr, bT sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pExpr */))) } -func fts5ExprFunctionHr(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:215460:13: */ +func fts5ExprFunctionHr(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:218801:13: */ fts5ExprFunction(tls, pCtx, nArg, apVal, 0) } -func fts5ExprFunctionTcl(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:215467:13: */ +func fts5ExprFunctionTcl(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:218808:13: */ fts5ExprFunction(tls, pCtx, nArg, apVal, 1) } // The implementation of an SQLite user-defined-function that accepts a // single integer as an argument. If the integer is an alpha-numeric // unicode code point, 1 is returned. Otherwise 0. -func fts5ExprIsAlnum(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:215480:13: */ +func fts5ExprIsAlnum(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:218821:13: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -166619,21 +169294,21 @@ func fts5ExprIsAlnum(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { / if nArg != 1 { Xsqlite3_result_error(tls, pCtx, - ts+30822 /* "wrong number of ..." */, -1) + ts+31348 /* "wrong number of ..." */, -1) return } libc.Xmemset(tls, bp /* &aArr[0] */, 0, uint64(unsafe.Sizeof([32]U8{}))) - sqlite3Fts5UnicodeCatParse(tls, ts+30873 /* "L*" */, bp /* &aArr[0] */) - sqlite3Fts5UnicodeCatParse(tls, ts+30876 /* "N*" */, bp /* &aArr[0] */) - sqlite3Fts5UnicodeCatParse(tls, ts+30879 /* "Co" */, bp /* &aArr[0] */) + sqlite3Fts5UnicodeCatParse(tls, ts+31399 /* "L*" */, bp /* &aArr[0] */) + sqlite3Fts5UnicodeCatParse(tls, ts+31402 /* "N*" */, bp /* &aArr[0] */) + sqlite3Fts5UnicodeCatParse(tls, ts+31405 /* "Co" */, bp /* &aArr[0] */) iCode = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal))) Xsqlite3_result_int(tls, pCtx, int32(*(*U8)(unsafe.Pointer(bp /* &aArr[0] */ + uintptr(sqlite3Fts5UnicodeCategory(tls, U32(iCode))))))) } -func fts5ExprFold(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:215501:13: */ +func fts5ExprFold(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:218842:13: */ if (nArg != 1) && (nArg != 2) { Xsqlite3_result_error(tls, pCtx, - ts+30882 /* "wrong number of ..." */, -1) + ts+31408 /* "wrong number of ..." */, -1) } else { var iCode int32 var bRemoveDiacritics int32 = 0 @@ -166647,21 +169322,21 @@ func fts5ExprFold(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* s // This is called during initialization to register the fts5_expr() scalar // UDF with the SQLite handle passed as the only argument. -func sqlite3Fts5ExprInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:215523:12: */ +func sqlite3Fts5ExprInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:218864:12: */ bp := tls.Alloc(64) defer tls.Free(64) *(*[4]Fts5ExprFunc)(unsafe.Pointer(bp /* aFunc */)) = [4]Fts5ExprFunc{ - {Fz: ts + 30812 /* "fts5_expr" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { + {Fz: ts + 31338 /* "fts5_expr" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5ExprFunctionHr}))}, - {Fz: ts + 30798 /* "fts5_expr_tcl" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { + {Fz: ts + 31324 /* "fts5_expr_tcl" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5ExprFunctionTcl}))}, - {Fz: ts + 30930 /* "fts5_isalnum" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { + {Fz: ts + 31456 /* "fts5_isalnum" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5ExprIsAlnum}))}, - {Fz: ts + 30943 /* "fts5_fold" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { + {Fz: ts + 31469 /* "fts5_fold" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5ExprFold}))}, } @@ -166684,10 +169359,10 @@ func sqlite3Fts5ExprInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* type Fts5ExprFunc = struct { Fz uintptr Fx uintptr -} /* sqlite3.c:215524:3 */ +} /* sqlite3.c:218865:3 */ // Return the number of phrases in expression pExpr. -func sqlite3Fts5ExprPhraseCount(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:215555:12: */ +func sqlite3Fts5ExprPhraseCount(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:218896:12: */ return func() int32 { if pExpr != 0 { return (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase @@ -166697,7 +169372,7 @@ func sqlite3Fts5ExprPhraseCount(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3 } // Return the number of terms in the iPhrase'th phrase in pExpr. -func sqlite3Fts5ExprPhraseSize(tls *libc.TLS, pExpr uintptr, iPhrase int32) int32 { /* sqlite3.c:215562:12: */ +func sqlite3Fts5ExprPhraseSize(tls *libc.TLS, pExpr uintptr, iPhrase int32) int32 { /* sqlite3.c:218903:12: */ if (iPhrase < 0) || (iPhrase >= (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase) { return 0 } @@ -166706,7 +169381,7 @@ func sqlite3Fts5ExprPhraseSize(tls *libc.TLS, pExpr uintptr, iPhrase int32) int3 // This function is used to access the current position list for phrase // iPhrase. -func sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uintptr) int32 { /* sqlite3.c:215571:12: */ +func sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uintptr) int32 { /* sqlite3.c:218912:12: */ var nRet int32 var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*8)) var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FpNode @@ -166720,7 +169395,7 @@ func sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uint return nRet } -func sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) uintptr { /* sqlite3.c:215591:29: */ +func sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) uintptr { /* sqlite3.c:218932:29: */ var pRet uintptr pRet = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(Fts5PoslistPopulator{})) * uint64((*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)))) if pRet != 0 { @@ -166744,12 +169419,12 @@ type Fts5ExprCtx1 = struct { FpExpr uintptr FaPopulator uintptr FiOff I64 -} /* sqlite3.c:215613:1 */ +} /* sqlite3.c:218954:1 */ -type Fts5ExprCtx = Fts5ExprCtx1 /* sqlite3.c:215618:28 */ +type Fts5ExprCtx = Fts5ExprCtx1 /* sqlite3.c:218959:28 */ // TODO: Make this more efficient! -func fts5ExprColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:215623:12: */ +func fts5ExprColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:218964:12: */ var i int32 for i = 0; i < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; i++ { if *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) == iCol { @@ -166759,7 +169434,7 @@ func fts5ExprColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* s return 0 } -func fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:215631:12: */ +func fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:218972:12: */ var p uintptr = pCtx var pExpr uintptr = (*Fts5ExprCtx)(unsafe.Pointer(p)).FpExpr var i int32 @@ -166794,7 +169469,7 @@ func fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToke return SQLITE_OK } -func sqlite3Fts5ExprPopulatePoslists(tls *libc.TLS, pConfig uintptr, pExpr uintptr, aPopulator uintptr, iCol int32, z uintptr, n int32) int32 { /* sqlite3.c:215666:12: */ +func sqlite3Fts5ExprPopulatePoslists(tls *libc.TLS, pConfig uintptr, pExpr uintptr, aPopulator uintptr, iCol int32, z uintptr, n int32) int32 { /* sqlite3.c:219007:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -166822,7 +169497,7 @@ func sqlite3Fts5ExprPopulatePoslists(tls *libc.TLS, pConfig uintptr, pExpr uintp }{fts5ExprPopulatePoslistsCb}))) } -func fts5ExprClearPoslists(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:215696:13: */ +func fts5ExprClearPoslists(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:219037:13: */ if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING) { (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24 /* &.apPhrase */))))).Fposlist.Fn = 0 } else { @@ -166833,7 +169508,7 @@ func fts5ExprClearPoslists(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:215696:1 } } -func fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid I64) int32 { /* sqlite3.c:215707:12: */ +func fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid I64) int32 { /* sqlite3.c:219048:12: */ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = iRowid (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 0 switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType { @@ -166883,12 +169558,12 @@ func fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid I64) int32 { /* return 1 } -func sqlite3Fts5ExprCheckPoslists(tls *libc.TLS, pExpr uintptr, iRowid I64) { /* sqlite3.c:215751:13: */ +func sqlite3Fts5ExprCheckPoslists(tls *libc.TLS, pExpr uintptr, iRowid I64) { /* sqlite3.c:219092:13: */ fts5ExprCheckPoslists(tls, (*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot, iRowid) } // This function is only called for detail=columns tables. -func sqlite3Fts5ExprPhraseCollist(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppCollist uintptr, pnCollist uintptr) int32 { /* sqlite3.c:215758:12: */ +func sqlite3Fts5ExprPhraseCollist(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppCollist uintptr, pnCollist uintptr) int32 { /* sqlite3.c:219099:12: */ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*8)) var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FpNode var rc int32 = SQLITE_OK @@ -166939,7 +169614,7 @@ type Fts5HashEntry1 = struct { FiCol I16 FiPos int32 FiRowid I64 -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // 2014 August 11 // @@ -166955,14 +169630,14 @@ type Fts5HashEntry1 = struct { // #include "fts5Int.h" -type Fts5HashEntry = Fts5HashEntry1 /* sqlite3.c:215811:30 */ +type Fts5HashEntry = Fts5HashEntry1 /* sqlite3.c:219152:30 */ // Eqivalent to: // // char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } // Allocate a new hash table. -func sqlite3Fts5HashNew(tls *libc.TLS, pConfig uintptr, ppNew uintptr, pnByte uintptr) int32 { /* sqlite3.c:215877:12: */ +func sqlite3Fts5HashNew(tls *libc.TLS, pConfig uintptr, ppNew uintptr, pnByte uintptr) int32 { /* sqlite3.c:219218:12: */ var rc int32 = SQLITE_OK var pNew uintptr @@ -166990,7 +169665,7 @@ func sqlite3Fts5HashNew(tls *libc.TLS, pConfig uintptr, ppNew uintptr, pnByte ui } // Free a hash table object. -func sqlite3Fts5HashFree(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:215907:13: */ +func sqlite3Fts5HashFree(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:219248:13: */ if pHash != 0 { sqlite3Fts5HashClear(tls, pHash) Xsqlite3_free(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot) @@ -166999,7 +169674,7 @@ func sqlite3Fts5HashFree(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:215907:13: } // Empty (but do not delete) a hash table. -func sqlite3Fts5HashClear(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:215918:13: */ +func sqlite3Fts5HashClear(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:219259:13: */ var i int32 for i = 0; i < (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot; i++ { var pNext uintptr @@ -167013,7 +169688,7 @@ func sqlite3Fts5HashClear(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:215918:13 (*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry = 0 } -func fts5HashKey(tls *libc.TLS, nSlot int32, p uintptr, n int32) uint32 { /* sqlite3.c:215932:21: */ +func fts5HashKey(tls *libc.TLS, nSlot int32, p uintptr, n int32) uint32 { /* sqlite3.c:219273:21: */ var i int32 var h uint32 = uint32(13) for i = (n - 1); i >= 0; i-- { @@ -167022,7 +169697,7 @@ func fts5HashKey(tls *libc.TLS, nSlot int32, p uintptr, n int32) uint32 { /* sql return (h % uint32(nSlot)) } -func fts5HashKey2(tls *libc.TLS, nSlot int32, b U8, p uintptr, n int32) uint32 { /* sqlite3.c:215941:21: */ +func fts5HashKey2(tls *libc.TLS, nSlot int32, b U8, p uintptr, n int32) uint32 { /* sqlite3.c:219282:21: */ var i int32 var h uint32 = uint32(13) for i = (n - 1); i >= 0; i-- { @@ -167033,7 +169708,7 @@ func fts5HashKey2(tls *libc.TLS, nSlot int32, b U8, p uintptr, n int32) uint32 { } // Resize the hash table by doubling the number of slots. -func fts5HashResize(tls *libc.TLS, pHash uintptr) int32 { /* sqlite3.c:215954:12: */ +func fts5HashResize(tls *libc.TLS, pHash uintptr) int32 { /* sqlite3.c:219295:12: */ var nNew int32 = ((*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot * 2) var i int32 var apNew uintptr @@ -167063,7 +169738,7 @@ func fts5HashResize(tls *libc.TLS, pHash uintptr) int32 { /* sqlite3.c:215954:12 return SQLITE_OK } -func fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr) int32 { /* sqlite3.c:215982:12: */ +func fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr) int32 { /* sqlite3.c:219323:12: */ var nRet int32 = 0 if (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist != 0 { var pPtr uintptr @@ -167112,7 +169787,7 @@ func fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr) // (bByte || pToken) -> (iRowid,iCol,iPos) // // Or, if iCol is negative, then the value is a delete marker. -func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, iPos int32, bByte int8, pToken uintptr, nToken int32) int32 { /* sqlite3.c:216033:12: */ +func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, iPos int32, bByte int8, pToken uintptr, nToken int32) int32 { /* sqlite3.c:219374:12: */ var iHash uint32 var p uintptr var pPtr uintptr @@ -167183,7 +169858,6 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, }() } - nIncr = nIncr + ((*Fts5HashEntry)(unsafe.Pointer(p)).FnData) } else { // Appending to an existing hash-entry. Check that there is enough @@ -167217,8 +169891,9 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, // If this is a new rowid, append the 4-byte size field for the previous // entry, and the new rowid for this entry. if iRowid != (*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid { + var iDiff U64 = (U64(iRowid) - U64((*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid)) fts5HashAddPoslistSize(tls, pHash, p, uintptr(0)) - *(*int32)(unsafe.Pointer(p + 24 /* &.nData */)) += (sqlite3Fts5PutVarint(tls, (pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)), (uint64(iRowid - (*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid)))) + *(*int32)(unsafe.Pointer(p + 24 /* &.nData */)) += (sqlite3Fts5PutVarint(tls, (pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)), iDiff)) (*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid = iRowid bNew = 1 (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist = (*Fts5HashEntry)(unsafe.Pointer(p)).FnData @@ -167271,7 +169946,7 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, // Arguments pLeft and pRight point to linked-lists of hash-entry objects, // each sorted in key order. This function merges the two lists into a // single list and returns a pointer to its first element. -func fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:216186:22: */ +func fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:219527:22: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -167317,7 +169992,7 @@ func fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { // in sorted order. The hash table is cleared before returning. It is // the responsibility of the caller to free the elements of the returned // list. -func fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32, ppSorted uintptr) int32 { /* sqlite3.c:216232:12: */ +func fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32, ppSorted uintptr) int32 { /* sqlite3.c:219573:12: */ var nMergeSlot int32 = 32 var ap uintptr var pList uintptr @@ -167359,7 +170034,7 @@ func fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32, } // Query the hash table for a doclist associated with term pTerm/nTerm. -func sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintptr, nTerm int32, ppOut uintptr, pnDoclist uintptr) int32 { /* sqlite3.c:216279:12: */ +func sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintptr, nTerm int32, ppOut uintptr, pnDoclist uintptr) int32 { /* sqlite3.c:219620:12: */ var iHash uint32 = fts5HashKey(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot, pTerm, nTerm) var zKey uintptr = uintptr(0) var p uintptr @@ -167393,20 +170068,20 @@ func sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintpt return SQLITE_OK } -func sqlite3Fts5HashScanInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32) int32 { /* sqlite3.c:216317:12: */ +func sqlite3Fts5HashScanInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32) int32 { /* sqlite3.c:219658:12: */ return fts5HashEntrySort(tls, p, pTerm, nTerm, (p + 24 /* &.pScan */)) } -func sqlite3Fts5HashScanNext(tls *libc.TLS, p uintptr) { /* sqlite3.c:216324:13: */ +func sqlite3Fts5HashScanNext(tls *libc.TLS, p uintptr) { /* sqlite3.c:219665:13: */ (*Fts5Hash)(unsafe.Pointer(p)).FpScan = (*Fts5HashEntry)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(p)).FpScan)).FpScanNext } -func sqlite3Fts5HashScanEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:216329:12: */ +func sqlite3Fts5HashScanEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:219670:12: */ return (libc.Bool32((*Fts5Hash)(unsafe.Pointer(p)).FpScan == uintptr(0))) } -func sqlite3Fts5HashScanEntry(tls *libc.TLS, pHash uintptr, pzTerm uintptr, ppDoclist uintptr, pnDoclist uintptr) { /* sqlite3.c:216333:13: */ +func sqlite3Fts5HashScanEntry(tls *libc.TLS, pHash uintptr, pzTerm uintptr, ppDoclist uintptr, pnDoclist uintptr) { /* sqlite3.c:219674:13: */ var p uintptr if libc.AssignUintptr(&p, (*Fts5Hash)(unsafe.Pointer(pHash)).FpScan) != 0 { var zKey uintptr = ((p) + 1*48) @@ -167632,7 +170307,7 @@ type Fts5Data1 = struct { Fp uintptr Fnn int32 FszLeaf int32 -} /* sqlite3.c:216608:9 */ +} /* sqlite3.c:219949:9 */ // 2014 May 31 // @@ -167840,14 +170515,14 @@ type Fts5Data1 = struct { // many zero bytes. This makes it easier to decode the various record formats // without overreading if the records are corrupt. -type Fts5Data = Fts5Data1 /* sqlite3.c:216608:25 */ +type Fts5Data = Fts5Data1 /* sqlite3.c:219949:25 */ type Fts5DlidxIter1 = struct { FnLvl int32 FiSegid int32 FaLvl [1]Fts5DlidxLvl -} /* sqlite3.c:216609:9 */ +} /* sqlite3.c:219950:9 */ -type Fts5DlidxIter = Fts5DlidxIter1 /* sqlite3.c:216609:30 */ +type Fts5DlidxIter = Fts5DlidxIter1 /* sqlite3.c:219950:30 */ type Fts5DlidxLvl1 = struct { FpData uintptr FiOff int32 @@ -167855,17 +170530,17 @@ type Fts5DlidxLvl1 = struct { FiFirstOff int32 FiLeafPgno int32 FiRowid I64 -} /* sqlite3.c:216609:9 */ +} /* sqlite3.c:219950:9 */ -type Fts5DlidxLvl = Fts5DlidxLvl1 /* sqlite3.c:216610:29 */ +type Fts5DlidxLvl = Fts5DlidxLvl1 /* sqlite3.c:219951:29 */ type Fts5DlidxWriter1 = struct { Fpgno int32 FbPrevValid int32 FiPrev I64 Fbuf Fts5Buffer -} /* sqlite3.c:216611:9 */ +} /* sqlite3.c:219952:9 */ -type Fts5DlidxWriter = Fts5DlidxWriter1 /* sqlite3.c:216611:32 */ +type Fts5DlidxWriter = Fts5DlidxWriter1 /* sqlite3.c:219952:32 */ type Fts5Iter1 = struct { Fbase Fts5IndexIter FpIndex uintptr @@ -167879,18 +170554,18 @@ type Fts5Iter1 = struct { FiSwitchRowid I64 FaFirst uintptr FaSeg [1]Fts5SegIter -} /* sqlite3.c:216612:9 */ +} /* sqlite3.c:219953:9 */ -type Fts5Iter = Fts5Iter1 /* sqlite3.c:216612:25 */ +type Fts5Iter = Fts5Iter1 /* sqlite3.c:219953:25 */ type Fts5PageWriter1 = struct { Fpgno int32 FiPrevPgidx int32 Fbuf Fts5Buffer Fpgidx Fts5Buffer Fterm Fts5Buffer -} /* sqlite3.c:216613:9 */ +} /* sqlite3.c:219954:9 */ -type Fts5PageWriter = Fts5PageWriter1 /* sqlite3.c:216613:31 */ +type Fts5PageWriter = Fts5PageWriter1 /* sqlite3.c:219954:31 */ type Fts5SegIter1 = struct { FpSeg uintptr Fflags int32 @@ -167913,18 +170588,18 @@ type Fts5SegIter1 = struct { FnPos int32 FbDel U8 _ [3]byte -} /* sqlite3.c:216612:9 */ +} /* sqlite3.c:219953:9 */ -type Fts5SegIter = Fts5SegIter1 /* sqlite3.c:216614:28 */ +type Fts5SegIter = Fts5SegIter1 /* sqlite3.c:219955:28 */ type Fts5DoclistIter1 = struct { FaEof uintptr FiRowid I64 FaPoslist uintptr FnPoslist int32 FnSize int32 -} /* sqlite3.c:216615:9 */ +} /* sqlite3.c:219956:9 */ -type Fts5DoclistIter = Fts5DoclistIter1 /* sqlite3.c:216615:32 */ +type Fts5DoclistIter = Fts5DoclistIter1 /* sqlite3.c:219956:32 */ type Fts5SegWriter1 = struct { FiSegid int32 _ [4]byte @@ -167941,9 +170616,9 @@ type Fts5SegWriter1 = struct { Fbtterm Fts5Buffer FiBtPage int32 _ [4]byte -} /* sqlite3.c:216616:9 */ +} /* sqlite3.c:219957:9 */ -type Fts5SegWriter = Fts5SegWriter1 /* sqlite3.c:216616:30 */ +type Fts5SegWriter = Fts5SegWriter1 /* sqlite3.c:219957:30 */ type Fts5Structure1 = struct { FnRef int32 _ [4]byte @@ -167951,38 +170626,38 @@ type Fts5Structure1 = struct { FnSegment int32 FnLevel int32 FaLevel [1]Fts5StructureLevel -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5Structure = Fts5Structure1 /* sqlite3.c:216617:30 */ +type Fts5Structure = Fts5Structure1 /* sqlite3.c:219958:30 */ type Fts5StructureLevel1 = struct { FnMerge int32 FnSeg int32 FaSeg uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5StructureLevel = Fts5StructureLevel1 /* sqlite3.c:216618:35 */ +type Fts5StructureLevel = Fts5StructureLevel1 /* sqlite3.c:219959:35 */ type Fts5StructureSegment1 = struct { FiSegid int32 FpgnoFirst int32 FpgnoLast int32 -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5StructureSegment = Fts5StructureSegment1 /* sqlite3.c:216619:37 */ +type Fts5StructureSegment = Fts5StructureSegment1 /* sqlite3.c:219960:37 */ type Fts5CResult1 = struct { FiFirst U16 FbTermEq U8 _ [1]byte -} /* sqlite3.c:216612:9 */ +} /* sqlite3.c:219953:9 */ -type Fts5CResult = Fts5CResult1 /* sqlite3.c:216729:28 */ +type Fts5CResult = Fts5CResult1 /* sqlite3.c:220070:28 */ -func fts5PutU16(tls *libc.TLS, aOut uintptr, iVal U16) { /* sqlite3.c:216908:13: */ +func fts5PutU16(tls *libc.TLS, aOut uintptr, iVal U16) { /* sqlite3.c:220249:13: */ *(*U8)(unsafe.Pointer(aOut)) = (U8(int32(iVal) >> 8)) *(*U8)(unsafe.Pointer(aOut + 1)) = (U8(int32(iVal) & 0xFF)) } -func fts5GetU16(tls *libc.TLS, aIn uintptr) U16 { /* sqlite3.c:216913:12: */ +func fts5GetU16(tls *libc.TLS, aIn uintptr) U16 { /* sqlite3.c:220254:12: */ return (U16((int32(U16(*(*U8)(unsafe.Pointer(aIn)))) << 8) + int32(*(*U8)(unsafe.Pointer(aIn + 1))))) } @@ -167990,7 +170665,7 @@ func fts5GetU16(tls *libc.TLS, aIn uintptr) U16 { /* sqlite3.c:216913:12: */ // // If an OOM error is encountered, return NULL and set the error code in // the Fts5Index handle passed as the first argument. -func fts5IdxMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:216923:13: */ +func fts5IdxMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:220264:13: */ return sqlite3Fts5MallocZero(tls, (p + 52 /* &.rc */), nByte) } @@ -168008,7 +170683,7 @@ func fts5IdxMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* s // +ve if pRight is smaller than pLeft. In other words: // // res = *pLeft - *pRight -func fts5BufferCompare(tls *libc.TLS, pLeft uintptr, pRight uintptr) int32 { /* sqlite3.c:216955:12: */ +func fts5BufferCompare(tls *libc.TLS, pLeft uintptr, pRight uintptr) int32 { /* sqlite3.c:220296:12: */ var nCmp int32 = func() int32 { if ((*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn) < ((*Fts5Buffer)(unsafe.Pointer(pRight)).Fn) { return (*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn @@ -168029,7 +170704,7 @@ func fts5BufferCompare(tls *libc.TLS, pLeft uintptr, pRight uintptr) int32 { /* }() } -func fts5LeafFirstTermOff(tls *libc.TLS, pLeaf uintptr) int32 { /* sqlite3.c:216961:12: */ +func fts5LeafFirstTermOff(tls *libc.TLS, pLeaf uintptr) int32 { /* sqlite3.c:220302:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -168040,7 +170715,7 @@ func fts5LeafFirstTermOff(tls *libc.TLS, pLeaf uintptr) int32 { /* sqlite3.c:216 } // Close the read-only blob handle, if it is open. -func sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) { /* sqlite3.c:216970:13: */ +func sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) { /* sqlite3.c:220311:13: */ if (*Fts5Index)(unsafe.Pointer(p)).FpReader != 0 { var pReader uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpReader (*Fts5Index)(unsafe.Pointer(p)).FpReader = uintptr(0) @@ -168052,7 +170727,7 @@ func sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) { /* sqlite3.c:216970 // // If an error occurs, NULL is returned and an error left in the // Fts5Index object. -func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:216984:17: */ +func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:220325:17: */ var pRet uintptr = uintptr(0) if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { var rc int32 = SQLITE_OK @@ -168079,7 +170754,7 @@ func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2 if ((*Fts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0)) && (rc == SQLITE_OK) { var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig rc = Xsqlite3_blob_open(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, - (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl, ts+30953 /* "block" */, iRowid, 0, (p + 56 /* &.pReader */)) + (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl, ts+31479 /* "block" */, iRowid, 0, (p + 56 /* &.pReader */)) } // If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls @@ -168094,7 +170769,7 @@ func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2 if rc == SQLITE_OK { var aOut uintptr = uintptr(0) // Read blob data into this buffer var nByte int32 = Xsqlite3_blob_bytes(tls, (*Fts5Index)(unsafe.Pointer(p)).FpReader) - var nAlloc Sqlite3_int64 = (Sqlite3_int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64(nByte)) + FTS5_DATA_PADDING)) + var nAlloc Sqlite3_int64 = (Sqlite3_int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64(nByte)) + uint64(FTS5_DATA_PADDING))) pRet = Xsqlite3_malloc64(tls, uint64(nAlloc)) if pRet != 0 { (*Fts5Data)(unsafe.Pointer(pRet)).Fnn = nByte @@ -168125,11 +170800,11 @@ func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2 // Release a reference to data record returned by an earlier call to // fts5DataRead(). -func fts5DataRelease(tls *libc.TLS, pData uintptr) { /* sqlite3.c:217057:13: */ +func fts5DataRelease(tls *libc.TLS, pData uintptr) { /* sqlite3.c:220398:13: */ Xsqlite3_free(tls, pData) } -func fts5LeafRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:217061:17: */ +func fts5LeafRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:220402:17: */ var pRet uintptr = fts5DataRead(tls, p, iRowid) if pRet != 0 { if ((*Fts5Data)(unsafe.Pointer(pRet)).Fnn < 4) || ((*Fts5Data)(unsafe.Pointer(pRet)).FszLeaf > (*Fts5Data)(unsafe.Pointer(pRet)).Fnn) { @@ -168141,7 +170816,7 @@ func fts5LeafRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2 return pRet } -func fts5IndexPrepareStmt(tls *libc.TLS, p uintptr, ppStmt uintptr, zSql uintptr) int32 { /* sqlite3.c:217073:12: */ +func fts5IndexPrepareStmt(tls *libc.TLS, p uintptr, ppStmt uintptr, zSql uintptr) int32 { /* sqlite3.c:220414:12: */ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { if zSql != 0 { (*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fdb, zSql, -1, @@ -168156,7 +170831,7 @@ func fts5IndexPrepareStmt(tls *libc.TLS, p uintptr, ppStmt uintptr, zSql uintptr } // INSERT OR REPLACE a record into the %_data table. -func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData int32) { /* sqlite3.c:217095:13: */ +func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData int32) { /* sqlite3.c:220436:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -168167,7 +170842,7 @@ func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData in if (*Fts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig fts5IndexPrepareStmt(tls, p, (p + 64 /* &.pWriter */), Xsqlite3_mprintf(tls, - ts+30959, /* "REPLACE INTO '%q..." */ + ts+31485, /* "REPLACE INTO '%q..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 { return @@ -168184,7 +170859,7 @@ func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData in // Execute the following SQL: // // DELETE FROM %_data WHERE id BETWEEN $iFirst AND $iLast -func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) { /* sqlite3.c:217119:13: */ +func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) { /* sqlite3.c:220460:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -168195,7 +170870,7 @@ func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) { /* sqlite if (*Fts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig var zSql uintptr = Xsqlite3_mprintf(tls, - ts+31010, /* "DELETE FROM '%q'..." */ + ts+31536, /* "DELETE FROM '%q'..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) if fts5IndexPrepareStmt(tls, p, (p+72 /* &.pDeleter */), zSql) != 0 { return @@ -168209,7 +170884,7 @@ func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) { /* sqlite } // Remove all records associated with segment iSegid. -func fts5DataRemoveSegment(tls *libc.TLS, p uintptr, iSegid int32) { /* sqlite3.c:217140:13: */ +func fts5DataRemoveSegment(tls *libc.TLS, p uintptr, iSegid int32) { /* sqlite3.c:220481:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -168219,7 +170894,7 @@ func fts5DataRemoveSegment(tls *libc.TLS, p uintptr, iSegid int32) { /* sqlite3. if (*Fts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig fts5IndexPrepareStmt(tls, p, (p + 88 /* &.pIdxDeleter */), Xsqlite3_mprintf(tls, - ts+31059, /* "DELETE FROM '%q'..." */ + ts+31585, /* "DELETE FROM '%q'..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -168231,7 +170906,7 @@ func fts5DataRemoveSegment(tls *libc.TLS, p uintptr, iSegid int32) { /* sqlite3. // Release a reference to an Fts5Structure object returned by an earlier // call to fts5StructureRead() or fts5StructureDecode(). -func fts5StructureRelease(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:217162:13: */ +func fts5StructureRelease(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:220503:13: */ if (pStruct != 0) && (0 >= (libc.PreDecInt32(&(*Fts5Structure)(unsafe.Pointer(pStruct)).FnRef, 1))) { var i int32 @@ -168242,7 +170917,7 @@ func fts5StructureRelease(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:217162: } } -func fts5StructureRef(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:217173:13: */ +func fts5StructureRef(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:220514:13: */ (*Fts5Structure)(unsafe.Pointer(pStruct)).FnRef++ } @@ -168256,7 +170931,7 @@ func fts5StructureRef(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:217173:13: // If an error occurs, *ppOut is set to NULL and an SQLite error code // returned. Otherwise, *ppOut is set to point to the new object and // SQLITE_OK returned. -func fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie uintptr, ppOut uintptr) int32 { /* sqlite3.c:217189:12: */ +func fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie uintptr, ppOut uintptr) int32 { /* sqlite3.c:220530:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -168348,7 +171023,7 @@ func fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie uin } // -func fts5StructureAddLevel(tls *libc.TLS, pRc uintptr, ppStruct uintptr) { /* sqlite3.c:217280:13: */ +func fts5StructureAddLevel(tls *libc.TLS, pRc uintptr, ppStruct uintptr) { /* sqlite3.c:220621:13: */ if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { var pStruct uintptr = *(*uintptr)(unsafe.Pointer(ppStruct)) var nLevel int32 = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel @@ -168367,7 +171042,7 @@ func fts5StructureAddLevel(tls *libc.TLS, pRc uintptr, ppStruct uintptr) { /* sq // Extend level iLvl so that there is room for at least nExtra more // segments. -func fts5StructureExtendLevel(tls *libc.TLS, pRc uintptr, pStruct uintptr, iLvl int32, nExtra int32, bInsert int32) { /* sqlite3.c:217304:13: */ +func fts5StructureExtendLevel(tls *libc.TLS, pRc uintptr, pStruct uintptr, iLvl int32, nExtra int32, bInsert int32) { /* sqlite3.c:220645:13: */ if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { var pLvl uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iLvl)*16) var aNew uintptr @@ -168390,7 +171065,7 @@ func fts5StructureExtendLevel(tls *libc.TLS, pRc uintptr, pStruct uintptr, iLvl } } -func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:217333:22: */ +func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:220674:22: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -168400,10 +171075,10 @@ func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c: // Configuration cookie var pData uintptr - pData = fts5DataRead(tls, p, FTS5_STRUCTURE_ROWID) + pData = fts5DataRead(tls, p, int64(FTS5_STRUCTURE_ROWID)) if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { // TODO: Do we need this if the leaf-index is appended? Probably... - libc.Xmemset(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0, FTS5_DATA_PADDING) + libc.Xmemset(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0, uint64(FTS5_DATA_PADDING)) (*Fts5Index)(unsafe.Pointer(p)).Frc = fts5StructureDecode(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, (*Fts5Data)(unsafe.Pointer(pData)).Fnn, bp /* &iCookie */, bp+8 /* &pRet */) if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (((*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz == 0) || ((*Fts5Config)(unsafe.Pointer(pConfig)).FiCookie != *(*int32)(unsafe.Pointer(bp /* iCookie */)))) { (*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5ConfigLoad(tls, pConfig, *(*int32)(unsafe.Pointer(bp /* iCookie */))) @@ -168418,7 +171093,7 @@ func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c: return *(*uintptr)(unsafe.Pointer(bp + 8 /* pRet */)) } -func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:217357:12: */ +func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:220698:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -168427,7 +171102,7 @@ func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:217357:12 if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Fts5Index)(unsafe.Pointer(p)).FpDataVersion == uintptr(0) { (*Fts5Index)(unsafe.Pointer(p)).Frc = fts5IndexPrepareStmt(tls, p, (p + 112 /* &.pDataVersion */), - Xsqlite3_mprintf(tls, ts+31099 /* "PRAGMA %Q.data_v..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb))) + Xsqlite3_mprintf(tls, ts+31625 /* "PRAGMA %Q.data_v..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb))) if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 { return int64(0) } @@ -168451,7 +171126,7 @@ func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:217357:12 // If an error occurs, NULL is returned and an error code left in the // Fts5Index handle. If an error has already occurred when this function // is called, it is a no-op. -func fts5StructureRead(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:217388:22: */ +func fts5StructureRead(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:220729:22: */ if (*Fts5Index)(unsafe.Pointer(p)).FpStruct == uintptr(0) { (*Fts5Index)(unsafe.Pointer(p)).FiStructVersion = fts5IndexDataVersion(tls, p) @@ -168468,7 +171143,7 @@ func fts5StructureRead(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:217388:2 return (*Fts5Index)(unsafe.Pointer(p)).FpStruct } -func fts5StructureInvalidate(tls *libc.TLS, p uintptr) { /* sqlite3.c:217427:13: */ +func fts5StructureInvalidate(tls *libc.TLS, p uintptr) { /* sqlite3.c:220768:13: */ if (*Fts5Index)(unsafe.Pointer(p)).FpStruct != 0 { fts5StructureRelease(tls, (*Fts5Index)(unsafe.Pointer(p)).FpStruct) (*Fts5Index)(unsafe.Pointer(p)).FpStruct = uintptr(0) @@ -168482,7 +171157,7 @@ func fts5StructureInvalidate(tls *libc.TLS, p uintptr) { /* sqlite3.c:217427:13: // // If an error occurs, leave an error code in the Fts5Index object. If an // error has already occurred, this function is a no-op. -func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { /* sqlite3.c:217470:13: */ +func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { /* sqlite3.c:220811:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -168530,19 +171205,19 @@ func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { /* sqlite3. } } - fts5DataWrite(tls, p, FTS5_STRUCTURE_ROWID, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn) + fts5DataWrite(tls, p, int64(FTS5_STRUCTURE_ROWID), (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn) sqlite3Fts5BufferFree(tls, bp /* &buf */) } } -func fts5SegmentSize(tls *libc.TLS, pSeg uintptr) int32 { /* sqlite3.c:217525:12: */ +func fts5SegmentSize(tls *libc.TLS, pSeg uintptr) int32 { /* sqlite3.c:220866:12: */ return ((1 + (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast) - (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst) } // Return a copy of index structure pStruct. Except, promote as many // segments as possible to level iPromote. If an OOM occurs, NULL is // returned. -func fts5StructurePromoteTo(tls *libc.TLS, p uintptr, iPromote int32, szPromote int32, pStruct uintptr) { /* sqlite3.c:217534:13: */ +func fts5StructurePromoteTo(tls *libc.TLS, p uintptr, iPromote int32, szPromote int32, pStruct uintptr) { /* sqlite3.c:220875:13: */ var il int32 var is int32 var pOut uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iPromote)*16) @@ -168585,7 +171260,7 @@ func fts5StructurePromoteTo(tls *libc.TLS, p uintptr, iPromote int32, szPromote // // If one or more segments are promoted, the structure object is updated // to reflect this. -func fts5StructurePromote(tls *libc.TLS, p uintptr, iLvl int32, pStruct uintptr) { /* sqlite3.c:217577:13: */ +func fts5StructurePromote(tls *libc.TLS, p uintptr, iLvl int32, pStruct uintptr) { /* sqlite3.c:220918:13: */ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { var iTst int32 var iPromote int32 = -1 @@ -168634,7 +171309,7 @@ func fts5StructurePromote(tls *libc.TLS, p uintptr, iLvl int32, pStruct uintptr) // Advance the iterator passed as the only argument. If the end of the // doclist-index page is reached, return non-zero. -func fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:217628:12: */ +func fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:220969:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -168670,7 +171345,7 @@ func fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:217628:1 } // Advance the iterator passed as the only argument. -func fts5DlidxIterNextR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:217660:12: */ +func fts5DlidxIterNextR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:221001:12: */ var pLvl uintptr = ((pIter + 8 /* &.aLvl */) + uintptr(iLvl)*32) if fts5DlidxLvlNext(tls, pLvl) != 0 { @@ -168691,7 +171366,7 @@ func fts5DlidxIterNextR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FbEof } -func fts5DlidxIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:217680:12: */ +func fts5DlidxIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:221021:12: */ return fts5DlidxIterNextR(tls, p, pIter, 0) } @@ -168704,7 +171379,7 @@ func fts5DlidxIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlit // // When this function is called pIter->iLeafPgno is the page number the // doclist is associated with (the one featuring the term). -func fts5DlidxIterFirst(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:217695:12: */ +func fts5DlidxIterFirst(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:221036:12: */ var i int32 for i = 0; i < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl; i++ { fts5DlidxLvlNext(tls, ((pIter + 8 /* &.aLvl */) + uintptr(i)*32)) @@ -168712,11 +171387,11 @@ func fts5DlidxIterFirst(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:21769 return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FbEof } -func fts5DlidxIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:217704:12: */ +func fts5DlidxIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:221045:12: */ return (libc.Bool32(((*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK) || ((*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FbEof != 0))) } -func fts5DlidxIterLast(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:217708:13: */ +func fts5DlidxIterLast(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221049:13: */ var i int32 // Advance each level to the last entry on the last page @@ -168737,7 +171412,7 @@ func fts5DlidxIterLast(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:2 } // Move the iterator passed as the only argument to the previous entry. -func fts5DlidxLvlPrev(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:217731:12: */ +func fts5DlidxLvlPrev(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:221072:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -168799,7 +171474,7 @@ func fts5DlidxLvlPrev(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:217731:1 return (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof } -func fts5DlidxIterPrevR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:217780:12: */ +func fts5DlidxIterPrevR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:221121:12: */ var pLvl uintptr = ((pIter + 8 /* &.aLvl */) + uintptr(iLvl)*32) if fts5DlidxLvlPrev(tls, pLvl) != 0 { @@ -168822,12 +171497,12 @@ func fts5DlidxIterPrevR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FbEof } -func fts5DlidxIterPrev(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:217803:12: */ +func fts5DlidxIterPrev(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:221144:12: */ return fts5DlidxIterPrevR(tls, p, pIter, 0) } // Free a doclist-index iterator object allocated by fts5DlidxIterInit(). -func fts5DlidxIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:217810:13: */ +func fts5DlidxIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:221151:13: */ if pIter != 0 { var i int32 for i = 0; i < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl; i++ { @@ -168837,7 +171512,7 @@ func fts5DlidxIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:217810:13: * } } -func fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLeafPg int32) uintptr { /* sqlite3.c:217820:22: */ +func fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLeafPg int32) uintptr { /* sqlite3.c:221161:22: */ var pIter uintptr = uintptr(0) var i int32 var bDone int32 = 0 @@ -168879,16 +171554,16 @@ func fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLeaf return pIter } -func fts5DlidxIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:217867:12: */ +func fts5DlidxIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:221208:12: */ return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FiRowid } -func fts5DlidxIterPgno(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:217870:12: */ +func fts5DlidxIterPgno(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:221211:12: */ return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FiLeafPgno } // Load the next leaf page into the segment iterator. -func fts5SegIterNextPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:217877:13: */ +func fts5SegIterNextPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221218:13: */ var pLeaf uintptr var pSeg uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -168918,7 +171593,7 @@ func fts5SegIterNextPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c // position list size field. Read the varint and return the number of bytes // read. Before returning, set *pnSz to the number of bytes in the position // list, and *pbDel to true if the delete flag is set, or false otherwise. -func fts5GetPoslistSize(tls *libc.TLS, p uintptr, pnSz uintptr, pbDel uintptr) int32 { /* sqlite3.c:217915:12: */ +func fts5GetPoslistSize(tls *libc.TLS, p uintptr, pnSz uintptr, pbDel uintptr) int32 { /* sqlite3.c:221256:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -168947,7 +171622,7 @@ func fts5GetPoslistSize(tls *libc.TLS, p uintptr, pnSz uintptr, pbDel uintptr) i // // Leave Fts5SegIter.iLeafOffset pointing to the first byte of the // position list content (if any). -func fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:217936:13: */ +func fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221277:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -168992,7 +171667,7 @@ func fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c } } -func fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:217965:13: */ +func fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221306:13: */ var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp // Buffer to read data from var iOff int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset @@ -169024,7 +171699,7 @@ func fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3. // accordingly and leaves (Fts5SegIter.iLeafOffset) set to the content of // the first position list. The position list belonging to document // (Fts5SegIter.iRowid). -func fts5SegIterLoadTerm(tls *libc.TLS, p uintptr, pIter uintptr, nKeep int32) { /* sqlite3.c:217998:13: */ +func fts5SegIterLoadTerm(tls *libc.TLS, p uintptr, pIter uintptr, nKeep int32) { /* sqlite3.c:221339:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -169058,7 +171733,7 @@ func fts5SegIterLoadTerm(tls *libc.TLS, p uintptr, pIter uintptr, nKeep int32) { fts5SegIterLoadRowid(tls, p, pIter) } -func fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218031:13: */ +func fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221372:13: */ if ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_REVERSE) != 0 { (*Fts5SegIter)(unsafe.Pointer(pIter)).FxNext = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr) @@ -169080,7 +171755,7 @@ func fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c: // // If an error occurs, Fts5Index.rc is set to an appropriate error code. If // an error has already occurred when this function is called, it is a no-op. -func fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) { /* sqlite3.c:218049:13: */ +func fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) { /* sqlite3.c:221390:13: */ if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { // This happens if the segment is being used as an input to an incremental // merge and all data has already been "trimmed". See function @@ -169121,7 +171796,7 @@ func fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) { /* // aRowidOffset[] and iRowidOffset variables. At this point the iterator // is in its regular state - Fts5SegIter.iLeafOffset points to the first // byte of the position list content associated with said rowid. -func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218097:13: */ +func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221438:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -169136,7 +171811,7 @@ func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq } for 1 != 0 { - *(*I64)(unsafe.Pointer(bp + 8 /* iDelta */)) = int64(0) + *(*U64)(unsafe.Pointer(bp + 8 /* iDelta */)) = uint64(0) if eDetail == FTS5_DETAIL_NONE { // todo @@ -169158,7 +171833,7 @@ func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq break } i = i + (int32(sqlite3Fts5GetVarint(tls, (a + uintptr(i)), bp+8 /* &iDelta */))) - *(*I64)(unsafe.Pointer(pIter + 104 /* &.iRowid */)) += (*(*I64)(unsafe.Pointer(bp + 8 /* iDelta */))) + *(*I64)(unsafe.Pointer(pIter + 104 /* &.iRowid */)) += I64((*(*U64)(unsafe.Pointer(bp + 8 /* iDelta */)))) // If necessary, grow the pIter->aRowidOffset[] array. if iRowidOffset >= (*Fts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { @@ -169180,7 +171855,7 @@ func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq } // -func fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218150:13: */ +func fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221491:13: */ fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0) @@ -169226,7 +171901,7 @@ func fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sql // Return true if the iterator passed as the second argument currently // points to a delete marker. A delete marker is an entry with a 0 byte // position-list. -func fts5MultiIterIsEmpty(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:218202:12: */ +func fts5MultiIterIsEmpty(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:221543:12: */ var pSeg uintptr = ((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120) return (libc.Bool32((((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0)) && ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos == 0))) } @@ -169234,7 +171909,7 @@ func fts5MultiIterIsEmpty(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sq // Advance iterator pIter to the next entry. // // This version of fts5SegIterNext() is only used by reverse iterators. -func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused uintptr) { /* sqlite3.c:218212:13: */ +func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused uintptr) { /* sqlite3.c:221553:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -169243,7 +171918,7 @@ func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused u if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset > 0 { var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp var iOff int32 - // var iDelta I64 at bp, 8 + // var iDelta U64 at bp, 8 (*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset-- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = *(*int32)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset)*4)) @@ -169253,7 +171928,7 @@ func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused u iOff = iOff + ((*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos) } sqlite3Fts5GetVarint(tls, (a + uintptr(iOff)), bp /* &iDelta */) - *(*I64)(unsafe.Pointer(pIter + 104 /* &.iRowid */)) -= (*(*I64)(unsafe.Pointer(bp /* iDelta */))) + *(*I64)(unsafe.Pointer(pIter + 104 /* &.iRowid */)) -= I64((*(*U64)(unsafe.Pointer(bp /* iDelta */)))) } else { fts5SegIterReverseNewPage(tls, p, pIter) } @@ -169263,7 +171938,7 @@ func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused u // // This version of fts5SegIterNext() is only used if detail=none and the // iterator is not a reverse direction iterator. -func fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:218246:13: */ +func fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:221587:13: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -169368,7 +172043,7 @@ next_none_eof: // If an error occurs, Fts5Index.rc is set to an appropriate error code. It // is not considered an error if the iterator reaches EOF. If an error has // already occurred when this function is called, it is a no-op. -func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:218318:13: */ +func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:221659:13: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -169473,9 +172148,6 @@ func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) // The following could be done by calling fts5SegIterLoadNPos(). But // this block is particularly performance critical, so equivalent // code is inlined. - // - // Later: Switched back to fts5SegIterLoadNPos() because it supports - // detail=none mode. Not ideal. // var nSz int32 at bp+40, 4 { @@ -169496,7 +172168,7 @@ func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) // Iterator pIter currently points to the first rowid in a doclist. This // function sets the iterator up so that iterates in reverse order through // the doclist. -func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218454:13: */ +func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221791:13: */ var pDlidx uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx var pLast uintptr = uintptr(0) var pgnoLast int32 = 0 @@ -169593,7 +172265,7 @@ func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c: // There is a doclist-index associated with the final term on the current // page. If the current term is the last term on the page, load the // doclist-index from disk and initialize an iterator at (pIter->pDlidx). -func fts5SegIterLoadDlidx(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218540:13: */ +func fts5SegIterLoadDlidx(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221877:13: */ var iSeg int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FiSegid var bRev int32 = ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_REVERSE) var pLeaf uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf // Current leaf data @@ -169621,7 +172293,7 @@ func fts5SegIterLoadDlidx(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3. // iterator is left pointing to the smallest term in the segment that // is larger than the specified term, even if this term is not on the // current page. -func fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uintptr, nTerm int32) { /* sqlite3.c:218574:13: */ +func fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uintptr, nTerm int32) { /* sqlite3.c:221911:13: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -169857,7 +172529,7 @@ __31: fts5SegIterLoadNPos(tls, p, pIter) } -func fts5IdxSelectStmt(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:218701:21: */ +func fts5IdxSelectStmt(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:222038:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -169865,7 +172537,7 @@ func fts5IdxSelectStmt(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:218701:2 var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig fts5IndexPrepareStmt(tls, p, (p + 96 /* &.pIdxSelect */), Xsqlite3_mprintf(tls, - ts+31122, /* "SELECT pgno FROM..." */ + ts+31648, /* "SELECT pgno FROM..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*Fts5Index)(unsafe.Pointer(p)).FpIdxSelect @@ -169876,7 +172548,7 @@ func fts5IdxSelectStmt(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:218701:2 // // If an error occurs, Fts5Index.rc is set to an appropriate error code. If // an error has already occurred when this function is called, it is a no-op. -func fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pSeg uintptr, pIter uintptr) { /* sqlite3.c:218720:13: */ +func fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pSeg uintptr, pIter uintptr) { /* sqlite3.c:222057:13: */ var iPg int32 = 1 var bGe int32 = (flags & FTS5INDEX_QUERY_SCAN) var bDlidx int32 = 0 // True if there is a doclist-index @@ -169946,7 +172618,7 @@ func fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, f // // If an error occurs, Fts5Index.rc is set to an appropriate error code. If // an error has already occurred when this function is called, it is a no-op. -func fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pIter uintptr) { /* sqlite3.c:218803:13: */ +func fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pIter uintptr) { /* sqlite3.c:222140:13: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -170002,7 +172674,7 @@ func fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, f } // Zero the iterator passed as the only argument. -func fts5SegIterClear(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:218862:13: */ +func fts5SegIterClear(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:222199:13: */ sqlite3Fts5BufferFree(tls, (pIter + 88 /* &.term */)) fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf) @@ -170017,7 +172689,7 @@ func fts5SegIterClear(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:218862:13: */ // in the pIter->aSeg[] array that is (a) not at EOF, and (b) pointing // to a key that is a duplicate of another, higher priority, // segment-iterator in the pSeg->aSeg[] array. -func fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) int32 { /* sqlite3.c:218966:12: */ +func fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) int32 { /* sqlite3.c:222303:12: */ var i1 int32 // Index of left-hand Fts5SegIter var i2 int32 // Index of right-hand Fts5SegIter var iRes int32 @@ -170069,7 +172741,7 @@ func fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) int32 { /* // Move the seg-iter so that it points to the first rowid on page iLeafPgno. // It is an error if leaf iLeafPgno does not exist or contains no rowids. -func fts5SegIterGotoPage(tls *libc.TLS, p uintptr, pIter uintptr, iLeafPgno int32) { /* sqlite3.c:219020:13: */ +func fts5SegIterGotoPage(tls *libc.TLS, p uintptr, pIter uintptr, iLeafPgno int32) { /* sqlite3.c:222357:13: */ if iLeafPgno > (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FpgnoLast { (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8)) @@ -170099,7 +172771,7 @@ func fts5SegIterGotoPage(tls *libc.TLS, p uintptr, pIter uintptr, iLeafPgno int3 // Advance the iterator passed as the second argument until it is at or // past rowid iFrom. Regardless of the value of iFrom, the iterator is // always advanced at least once. -func fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:219058:13: */ +func fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:222395:13: */ var bRev int32 = ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_REVERSE) var pDlidx uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx var iLeafPgno int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno @@ -170147,7 +172819,7 @@ func fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { } // Free the iterator object passed as the second argument. -func fts5MultiIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:219112:13: */ +func fts5MultiIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:222449:13: */ if pIter != 0 { var i int32 for i = 0; i < (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg; i++ { @@ -170158,7 +172830,7 @@ func fts5MultiIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:219112:13: * } } -func fts5MultiIterAdvanced(tls *libc.TLS, p uintptr, pIter uintptr, iChanged int32, iMinset int32) { /* sqlite3.c:219123:13: */ +func fts5MultiIterAdvanced(tls *libc.TLS, p uintptr, pIter uintptr, iChanged int32, iMinset int32) { /* sqlite3.c:222460:13: */ var i int32 for i = (((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iChanged) / 2); (i >= iMinset) && ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK); i = (i / 2) { var iEq int32 @@ -170179,7 +172851,7 @@ func fts5MultiIterAdvanced(tls *libc.TLS, p uintptr, pIter uintptr, iChanged int // If non-zero is returned, the caller should call fts5MultiIterAdvanced() // on the iterator instead. That function does the same as this one, except // that it deals with more complicated cases as well. -func fts5MultiIterAdvanceRowid(tls *libc.TLS, pIter uintptr, iChanged int32, ppFirst uintptr) int32 { /* sqlite3.c:219151:12: */ +func fts5MultiIterAdvanceRowid(tls *libc.TLS, pIter uintptr, iChanged int32, ppFirst uintptr) int32 { /* sqlite3.c:222488:12: */ var pNew uintptr = ((pIter + 96 /* &.aSeg */) + uintptr(iChanged)*120) if ((*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid == (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid) || @@ -170219,7 +172891,7 @@ func fts5MultiIterAdvanceRowid(tls *libc.TLS, pIter uintptr, iChanged int32, ppF } // Set the pIter->bEof variable based on the state of the sub-iterators. -func fts5MultiIterSetEof(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:219194:13: */ +func fts5MultiIterSetEof(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:222531:13: */ var pSeg uintptr = ((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120) (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof = (U8(libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf == uintptr(0)))) (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid @@ -170230,7 +172902,7 @@ func fts5MultiIterSetEof(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:219194:13: // If an error occurs, an error code is left in Fts5Index.rc. It is not // considered an error if the iterator reaches EOF, or if it is already at // EOF when this function is called. -func fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iFrom I64) { /* sqlite3.c:219207:13: */ +func fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iFrom I64) { /* sqlite3.c:222544:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -170265,7 +172937,7 @@ func fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iFr } } -func fts5MultiIterNext2(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:219245:13: */ +func fts5MultiIterNext2(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:222582:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -170288,12 +172960,12 @@ func fts5MultiIterNext2(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintp } } -func fts5IterSetOutputs_Noop(tls *libc.TLS, pUnused1 uintptr, pUnused2 uintptr) { /* sqlite3.c:219273:13: */ +func fts5IterSetOutputs_Noop(tls *libc.TLS, pUnused1 uintptr, pUnused2 uintptr) { /* sqlite3.c:222610:13: */ _ = pUnused1 _ = pUnused2 } -func fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) uintptr { /* sqlite3.c:219277:17: */ +func fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) uintptr { /* sqlite3.c:222614:17: */ var pNew uintptr var nSlot int32 // Power of two >= nSeg @@ -170312,7 +172984,7 @@ func fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) uintptr { /* sqlit return pNew } -func fts5PoslistCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:219299:13: */ +func fts5PoslistCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:222636:13: */ _ = pUnused if nChunk > 0 { @@ -170329,21 +173001,21 @@ type PoslistCallbackCtx1 = struct { FpColset uintptr FeState int32 _ [4]byte -} /* sqlite3.c:219311:9 */ +} /* sqlite3.c:222648:9 */ -type PoslistCallbackCtx = PoslistCallbackCtx1 /* sqlite3.c:219311:35 */ +type PoslistCallbackCtx = PoslistCallbackCtx1 /* sqlite3.c:222648:35 */ type PoslistOffsetsCtx1 = struct { FpBuf uintptr FpColset uintptr FiRead int32 FiWrite int32 -} /* sqlite3.c:219318:9 */ +} /* sqlite3.c:222655:9 */ -type PoslistOffsetsCtx = PoslistOffsetsCtx1 /* sqlite3.c:219318:34 */ +type PoslistOffsetsCtx = PoslistOffsetsCtx1 /* sqlite3.c:222655:34 */ // TODO: Make this more efficient! -func fts5IndexColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:219329:12: */ +func fts5IndexColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:222666:12: */ var i int32 for i = 0; i < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; i++ { if *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) == iCol { @@ -170353,7 +173025,7 @@ func fts5IndexColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* return 0 } -func fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:219337:13: */ +func fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:222674:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -170379,7 +173051,7 @@ func fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:219360:13: */ +func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:222697:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -170459,7 +173131,7 @@ func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, } } -func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { /* sqlite3.c:219412:13: */ +func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { /* sqlite3.c:222749:13: */ var nRem int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos // Number of bytes still to come var pData uintptr = uintptr(0) var pChunk uintptr = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)) @@ -170472,7 +173144,7 @@ func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChu var pgno int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno var pgnoSave int32 = 0 - // This function does notmwork with detail=none databases. + // This function does not work with detail=none databases. if ((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fflags & FTS5_SEGITER_REVERSE) == 0 { pgnoSave = (pgno + 1) @@ -170484,6 +173156,9 @@ func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChu fts5DataRelease(tls, pData) if nRem <= 0 { break + } else if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg == uintptr(0) { + (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8)) + return } else { pgno++ pData = fts5LeafRead(tls, p, (((((I64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (I64(pgno)))) @@ -170510,7 +173185,7 @@ func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChu // function appends the position list data for the current entry to // buffer pBuf. It does not make a copy of the position-list size // field. -func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, pBuf uintptr) { /* sqlite3.c:219459:13: */ +func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, pBuf uintptr) { /* sqlite3.c:222799:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -170520,7 +173195,7 @@ func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, } return sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), pBuf, (uint32(((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos + FTS5_DATA_ZERO_PADDING) + (*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn))) }()) { - libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0, FTS5_DATA_ZERO_PADDING) + libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0, uint64(FTS5_DATA_ZERO_PADDING)) if pColset == uintptr(0) { fts5ChunkIterate(tls, p, pSeg, pBuf, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32) @@ -170550,72 +173225,78 @@ func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, } } -// IN/OUT parameter (*pa) points to a position list n bytes in size. If -// the position list contains entries for column iCol, then (*pa) is set -// to point to the sub-position-list for that column and the number of -// bytes in it returned. Or, if the argument position list does not -// contain any entries for column iCol, return 0. -func fts5IndexExtractCol(tls *libc.TLS, pa uintptr, n int32, iCol int32) int32 { /* sqlite3.c:219495:12: */ +// Parameter pPos points to a buffer containing a position list, size nPos. +// This function filters it according to pColset (which must be non-NULL) +// and sets pIter->base.pData/nData to point to the new position list. +// If memory is required for the new position list, use buffer pIter->poslist. +// Or, if the new position list is a contiguous subset of the input, set +// pIter->base.pData/nData to point directly to it. +// +// This function is a no-op if *pRc is other than SQLITE_OK when it is +// called. If an OOM error is encountered, *pRc is set to SQLITE_NOMEM +// before returning. +func fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos uintptr, nPos int32, pIter uintptr) { /* sqlite3.c:222840:13: */ bp := tls.Alloc(4) defer tls.Free(4) - *(*int32)(unsafe.Pointer(bp /* iCurrent */)) = 0 // Anything before the first 0x01 is col 0 - var p uintptr = *(*uintptr)(unsafe.Pointer(pa)) - var pEnd uintptr = (p + uintptr(n)) // One byte past end of position list - - for iCol > *(*int32)(unsafe.Pointer(bp /* iCurrent */)) { - // Advance pointer p until it points to pEnd or an 0x01 byte that is - // not part of a varint. Note that it is not possible for a negative - // or extremely large varint to occur within an uncorrupted position - // list. So the last byte of each varint may be assumed to have a clear - // 0x80 bit. - for int32(*(*U8)(unsafe.Pointer(p))) != 0x01 { - for (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) & 0x80) != 0 { - } - if p >= pEnd { - return 0 - } - } - *(*uintptr)(unsafe.Pointer(pa)) = libc.PostIncUintptr(&p, 1) - *(*int32)(unsafe.Pointer(bp /* iCurrent */)) = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) - if (*(*int32)(unsafe.Pointer(bp /* iCurrent */)) & 0x80) != 0 { - p-- - p += uintptr(sqlite3Fts5GetVarint32(tls, p, bp /* &iCurrent */)) - } - } - if iCol != *(*int32)(unsafe.Pointer(bp /* iCurrent */)) { - return 0 - } - - // Advance pointer p until it points to pEnd or an 0x01 byte that is - // not part of a varint - for (p < pEnd) && (int32(*(*U8)(unsafe.Pointer(p))) != 0x01) { - for (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) & 0x80) != 0 { - } - } - - return (int32((int64(p) - (int64(*(*uintptr)(unsafe.Pointer(pa))))) / 1)) -} - -func fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos uintptr, nPos int32, pBuf uintptr) { /* sqlite3.c:219532:13: */ - bp := tls.Alloc(8) - defer tls.Free(8) - if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - var i int32 - sqlite3Fts5BufferZero(tls, pBuf) - for i = 0; i < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; i++ { - *(*uintptr)(unsafe.Pointer(bp /* pSub */)) = pPos - var nSub int32 = fts5IndexExtractCol(tls, bp /* &pSub */, nPos, *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4))) - if nSub != 0 { - sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(nSub), *(*uintptr)(unsafe.Pointer(bp /* pSub */))) + var p uintptr = pPos + var aCopy uintptr = p + var pEnd uintptr = (p + uintptr(nPos)) // One byte past end of position list + var i int32 = 0 + *(*int32)(unsafe.Pointer(bp /* iCurrent */)) = 0 + + if ((*Fts5Colset)(unsafe.Pointer(pColset)).FnCol > 1) && (sqlite3Fts5BufferSize(tls, pRc, (pIter+32 /* &.poslist */), uint32(nPos)) != 0) { + return + } + + for 1 != 0 { + for *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) < *(*int32)(unsafe.Pointer(bp /* iCurrent */)) { + i++ + if i == (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol { + (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp + (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn + return + } + } + + // Advance pointer p until it points to pEnd or an 0x01 byte that is + // not part of a varint + for (p < pEnd) && (int32(*(*U8)(unsafe.Pointer(p))) != 0x01) { + for (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) & 0x80) != 0 { + } + } + + if *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) == *(*int32)(unsafe.Pointer(bp /* iCurrent */)) { + if (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol == 1 { + (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = aCopy + (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (int32((int64(p) - int64(aCopy)) / 1)) + return + } + { + libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((pIter + 32 /* &.poslist */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pIter + 32 /* &.poslist */))).Fn)), aCopy, (uint64((int64(p) - int64(aCopy)) / 1))) + *(*int32)(unsafe.Pointer((pIter + 32 /* &.poslist */) + 8 /* &.n */)) += int32(((int64(p) - int64(aCopy)) / 1)) + } + + } + if p == pEnd { + (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp + (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn + return + } + aCopy = libc.PostIncUintptr(&p, 1) + *(*int32)(unsafe.Pointer(bp /* iCurrent */)) = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) + if (*(*int32)(unsafe.Pointer(bp /* iCurrent */)) & 0x80) != 0 { + p-- + p += uintptr(sqlite3Fts5GetVarint32(tls, p, bp /* &iCurrent */)) } } } + } // xSetOutputs callback used by detail=none tables. -func fts5IterSetOutputs_None(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219554:13: */ +func fts5IterSetOutputs_None(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:222900:13: */ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos @@ -170623,7 +173304,7 @@ func fts5IterSetOutputs_None(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sq // xSetOutputs callback used by detail=full and detail=col tables when no // column filters are specified. -func fts5IterSetOutputs_Nocolset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219564:13: */ +func fts5IterSetOutputs_Nocolset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:222910:13: */ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos @@ -170643,7 +173324,7 @@ func fts5IterSetOutputs_Nocolset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { / // xSetOutputs callback used when the Fts5Colset object has nCol==0 (match // against no columns at all). -func fts5IterSetOutputs_ZeroColset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219589:13: */ +func fts5IterSetOutputs_ZeroColset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:222935:13: */ _ = pSeg (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = 0 } @@ -170651,7 +173332,7 @@ func fts5IterSetOutputs_ZeroColset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { // xSetOutputs callback used by detail=col when there is a column filter // and there are 100 or more columns. Also called as a fallback from // fts5IterSetOutputs_Col100 if the column-list spans more than one page. -func fts5IterSetOutputs_Col(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219599:13: */ +func fts5IterSetOutputs_Col(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:222945:13: */ sqlite3Fts5BufferZero(tls, (pIter + 32 /* &.poslist */)) fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset, (pIter + 32 /* &.poslist */)) (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid @@ -170667,7 +173348,7 @@ func fts5IterSetOutputs_Col(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sql // // The last point is to ensure all column numbers are stored as // single-byte varints. -func fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219617:13: */ +func fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:222963:13: */ var a uintptr var pEnd uintptr var iPrev int32 @@ -170729,27 +173410,17 @@ __2: } // xSetOutputs callback used by detail=full when there is a column filter. -func fts5IterSetOutputs_Full(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219657:13: */ - bp := tls.Alloc(8) - defer tls.Free(8) - +func fts5IterSetOutputs_Full(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:223003:13: */ var pColset uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid if ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos) <= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf { // All data is stored on the current page. Populate the output // variables to point into the body of the page object. - *(*uintptr)(unsafe.Pointer(bp /* a */)) = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)) - if (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol == 1 { - (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = fts5IndexExtractCol(tls, bp /* &a */, (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos, *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */)))) - (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = *(*uintptr)(unsafe.Pointer(bp /* a */)) - } else { - var pRc uintptr = ((*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex + 52 /* &.rc */) - sqlite3Fts5BufferZero(tls, (pIter + 32 /* &.poslist */)) - fts5IndexExtractColset(tls, pRc, pColset, *(*uintptr)(unsafe.Pointer(bp /* a */)), (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos, (pIter + 32 /* &.poslist */)) - (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp - (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn - } + var a uintptr = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)) + var pRc uintptr = ((*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex + 52 /* &.rc */) + sqlite3Fts5BufferZero(tls, (pIter + 32 /* &.poslist */)) + fts5IndexExtractColset(tls, pRc, pColset, a, (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos, pIter) } else { // The data is distributed over two or more pages. Copy it into the // Fts5Iter.poslist buffer and then set the output pointer to point @@ -170761,7 +173432,7 @@ func fts5IterSetOutputs_Full(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sq } } -func fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) { /* sqlite3.c:219689:13: */ +func fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) { /* sqlite3.c:223028:13: */ if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { var pConfig uintptr = (*Fts5Index)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex)).FpConfig if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE { @@ -170805,7 +173476,7 @@ func fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) { /* sqlite3 // // The iterator initially points to the first term/rowid entry in the // iterated data. -func fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, pColset uintptr, pTerm uintptr, nTerm int32, iLevel int32, nSegment int32, ppOut uintptr) { /* sqlite3.c:219732:13: */ +func fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, pColset uintptr, pTerm uintptr, nTerm int32, iLevel int32, nSegment int32, ppOut uintptr) { /* sqlite3.c:223071:13: */ var nSeg int32 = 0 // Number of segment-iters in use var iIter int32 = 0 // var iSeg int32 // Used to iterate through segments @@ -170904,7 +173575,7 @@ func fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, pC // Create an Fts5Iter that iterates through the doclist provided // as the second argument. -func fts5MultiIterNew2(tls *libc.TLS, p uintptr, pData uintptr, bDesc int32, ppOut uintptr) { /* sqlite3.c:219831:13: */ +func fts5MultiIterNew2(tls *libc.TLS, p uintptr, pData uintptr, bDesc int32, ppOut uintptr) { /* sqlite3.c:223170:13: */ var pNew uintptr pNew = fts5MultiIterAlloc(tls, p, 2) if pNew != 0 { @@ -170937,7 +173608,7 @@ func fts5MultiIterNew2(tls *libc.TLS, p uintptr, pData uintptr, bDesc int32, ppO // Return true if the iterator is at EOF or if an error has occurred. // False otherwise. -func fts5MultiIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:219871:12: */ +func fts5MultiIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:223210:12: */ return (libc.Bool32(((*Fts5Index)(unsafe.Pointer(p)).Frc != 0) || ((*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof != 0))) } @@ -170945,13 +173616,13 @@ func fts5MultiIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite // Return the rowid of the entry that the iterator currently points // to. If the iterator points to EOF when this function is called the // results are undefined. -func fts5MultiIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:219883:12: */ +func fts5MultiIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:223222:12: */ return (*Fts5SegIter)(unsafe.Pointer((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120)).FiRowid } // Move the iterator to the next entry at or following iMatch. -func fts5MultiIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:219891:13: */ +func fts5MultiIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:223230:13: */ for 1 != 0 { var iRowid I64 fts5MultiIterNext(tls, p, pIter, 1, iMatch) @@ -170970,7 +173641,7 @@ func fts5MultiIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) // Return a pointer to a buffer containing the term associated with the // entry that the iterator currently points to. -func fts5MultiIterTerm(tls *libc.TLS, pIter uintptr, pn uintptr) uintptr { /* sqlite3.c:219910:17: */ +func fts5MultiIterTerm(tls *libc.TLS, pIter uintptr, pn uintptr) uintptr { /* sqlite3.c:223249:17: */ var p uintptr = ((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120) *(*int32)(unsafe.Pointer(pn)) = (*Fts5SegIter)(unsafe.Pointer(p)).Fterm.Fn return (*Fts5SegIter)(unsafe.Pointer(p)).Fterm.Fp @@ -170983,7 +173654,7 @@ func fts5MultiIterTerm(tls *libc.TLS, pIter uintptr, pn uintptr) uintptr { /* sq // // If an error has already occurred, this function is a no-op. 0 is // returned in this case. -func fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) int32 { /* sqlite3.c:219925:12: */ +func fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) int32 { /* sqlite3.c:223264:12: */ bp := tls.Alloc(252) defer tls.Free(252) @@ -171025,7 +173696,7 @@ func fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) int32 { /* sql } // Discard all data currently cached in the hash-tables. -func fts5IndexDiscardData(tls *libc.TLS, p uintptr) { /* sqlite3.c:219982:13: */ +func fts5IndexDiscardData(tls *libc.TLS, p uintptr) { /* sqlite3.c:223321:13: */ if (*Fts5Index)(unsafe.Pointer(p)).FpHash != 0 { sqlite3Fts5HashClear(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash) @@ -171038,7 +173709,7 @@ func fts5IndexDiscardData(tls *libc.TLS, p uintptr) { /* sqlite3.c:219982:13: */ // // Buffer (pNew/) is guaranteed to be greater // than buffer (pOld/nOld). -func fts5PrefixCompress(tls *libc.TLS, nOld int32, pOld uintptr, pNew uintptr) int32 { /* sqlite3.c:219997:12: */ +func fts5PrefixCompress(tls *libc.TLS, nOld int32, pOld uintptr, pNew uintptr) int32 { /* sqlite3.c:223336:12: */ var i int32 for i = 0; i < nOld; i++ { if int32(*(*U8)(unsafe.Pointer(pOld + uintptr(i)))) != int32(*(*U8)(unsafe.Pointer(pNew + uintptr(i)))) { @@ -171048,7 +173719,7 @@ func fts5PrefixCompress(tls *libc.TLS, nOld int32, pOld uintptr, pNew uintptr) i return i } -func fts5WriteDlidxClear(tls *libc.TLS, p uintptr, pWriter uintptr, bFlush int32) { /* sqlite3.c:220005:13: */ +func fts5WriteDlidxClear(tls *libc.TLS, p uintptr, pWriter uintptr, bFlush int32) { /* sqlite3.c:223344:13: */ var i int32 for i = 0; i < (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx; i++ { @@ -171069,7 +173740,7 @@ func fts5WriteDlidxClear(tls *libc.TLS, p uintptr, pWriter uintptr, bFlush int32 // Grow the pWriter->aDlidx[] array to at least nLvl elements in size. // Any new array elements are zeroed before returning. -func fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) int32 { /* sqlite3.c:220031:12: */ +func fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) int32 { /* sqlite3.c:223370:12: */ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (nLvl >= (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx) { var aDlidx uintptr = Xsqlite3_realloc64(tls, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, (uint64(uint64(unsafe.Sizeof(Fts5DlidxWriter{})) * uint64(nLvl)))) @@ -171088,7 +173759,7 @@ func fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) i // If the current doclist-index accumulating in pWriter->aDlidx[] is large // enough, flush it to disk and return 1. Otherwise discard it and return // zero. -func fts5WriteFlushDlidx(tls *libc.TLS, p uintptr, pWriter uintptr) int32 { /* sqlite3.c:220057:12: */ +func fts5WriteFlushDlidx(tls *libc.TLS, p uintptr, pWriter uintptr) int32 { /* sqlite3.c:223396:12: */ var bFlag int32 = 0 // If there were FTS5_MIN_DLIDX_SIZE or more empty leaf pages written @@ -171110,7 +173781,7 @@ func fts5WriteFlushDlidx(tls *libc.TLS, p uintptr, pWriter uintptr) int32 { /* s // it. // // Fts5SegWriter.btterm currently contains the first term on page iBtPage. -func fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:220081:13: */ +func fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:223420:13: */ var bFlag int32 if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage == 0 { @@ -171143,7 +173814,7 @@ func fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3 // // If an error occurs, an error code is left in Fts5Index.rc. If an error // has already occurred when this function is called, it is a no-op. -func fts5WriteBtreeTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:220110:13: */ +func fts5WriteBtreeTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:223449:13: */ fts5WriteFlushBtree(tls, p, pWriter) if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), (pWriter + 96 /* &.btterm */), nTerm, pTerm) @@ -171153,7 +173824,7 @@ func fts5WriteBtreeTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, // This function is called when flushing a leaf page that contains no // terms at all to disk. -func fts5WriteBtreeNoTerm(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:220126:13: */ +func fts5WriteBtreeNoTerm(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:223465:13: */ // If there were no rowids on the leaf page either and the doclist-index // has already been started, append an 0x00 byte to it. if ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0) && ((*Fts5DlidxWriter)(unsafe.Pointer((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx)).Fbuf.Fn > 0) { @@ -171166,7 +173837,7 @@ func fts5WriteBtreeNoTerm(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnEmpty++ } -func fts5DlidxExtractFirstRowid(tls *libc.TLS, pBuf uintptr) I64 { /* sqlite3.c:220142:12: */ +func fts5DlidxExtractFirstRowid(tls *libc.TLS, pBuf uintptr) I64 { /* sqlite3.c:223481:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -171182,7 +173853,7 @@ func fts5DlidxExtractFirstRowid(tls *libc.TLS, pBuf uintptr) I64 { /* sqlite3.c: // Rowid iRowid has just been appended to the current leaf page. It is the // first on the page. This function appends an appropriate entry to the current // doclist-index. -func fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:220156:13: */ +func fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:223495:13: */ var i int32 var bDone int32 = 0 @@ -171242,7 +173913,7 @@ func fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) } } -func fts5WriteFlushLeaf(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:220216:13: */ +func fts5WriteFlushLeaf(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:223555:13: */ var pPage uintptr = (pWriter + 8 /* &.writer */) var iRowid I64 @@ -171278,14 +173949,14 @@ func fts5WriteFlushLeaf(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3. (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage = U8(1) } -var zero = [4]U8{U8(0x00), U8(0x00), U8(0x00), U8(0x00)} /* sqlite3.c:220217:19 */ +var zero = [4]U8{U8(0x00), U8(0x00), U8(0x00), U8(0x00)} /* sqlite3.c:223556:19 */ // Append term pTerm/nTerm to the segment being written by the writer passed // as the second argument. // // If an error occurs, set the Fts5Index.rc error code. If an error has // already occurred, this function is a no-op. -func fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:220262:13: */ +func fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:223601:13: */ var nPrefix int32 // Bytes of prefix compression for term var pPage uintptr = (pWriter + 8 /* &.writer */) var pPgidx uintptr = (pWriter + 8 /* &.writer */ + 24 /* &.pgidx */) @@ -171361,7 +174032,7 @@ func fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, } // Append a rowid and position-list size field to the writers output. -func fts5WriteAppendRowid(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:220343:13: */ +func fts5WriteAppendRowid(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:223682:13: */ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { var pPage uintptr = (pWriter + 8 /* &.writer */) @@ -171390,7 +174061,7 @@ func fts5WriteAppendRowid(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) } } -func fts5WriteAppendPoslistData(tls *libc.TLS, p uintptr, pWriter uintptr, aData uintptr, nData int32) { /* sqlite3.c:220376:13: */ +func fts5WriteAppendPoslistData(tls *libc.TLS, p uintptr, pWriter uintptr, aData uintptr, nData int32) { /* sqlite3.c:223715:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -171419,7 +174090,7 @@ func fts5WriteAppendPoslistData(tls *libc.TLS, p uintptr, pWriter uintptr, aData // Flush any data cached by the writer object to the database. Free any // allocations associated with the writer. -func fts5WriteFinish(tls *libc.TLS, p uintptr, pWriter uintptr, pnLeaf uintptr) { /* sqlite3.c:220410:13: */ +func fts5WriteFinish(tls *libc.TLS, p uintptr, pWriter uintptr, pnLeaf uintptr) { /* sqlite3.c:223749:13: */ var i int32 var pLeaf uintptr = (pWriter + 8 /* &.writer */) if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -171443,7 +174114,7 @@ func fts5WriteFinish(tls *libc.TLS, p uintptr, pWriter uintptr, pnLeaf uintptr) Xsqlite3_free(tls, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx) } -func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { /* sqlite3.c:220438:13: */ +func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { /* sqlite3.c:223777:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -171464,7 +174135,7 @@ func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { /* if (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig fts5IndexPrepareStmt(tls, p, (p + 80 /* &.pIdxWriter */), Xsqlite3_mprintf(tls, - ts+31206, /* "INSERT INTO '%q'..." */ + ts+31732, /* "INSERT INTO '%q'..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))) } @@ -171483,7 +174154,7 @@ func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { /* // Iterator pIter was used to iterate through the input segments of on an // incremental merge operation. This function is called if the incremental // merge step has finished but the input has not been completely exhausted. -func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:220485:13: */ +func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:223824:13: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -171552,13 +174223,13 @@ func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:22 sqlite3Fts5BufferFree(tls, bp /* &buf */) } -func fts5MergeChunkCallback(tls *libc.TLS, p uintptr, pCtx uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:220551:13: */ +func fts5MergeChunkCallback(tls *libc.TLS, p uintptr, pCtx uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:223890:13: */ var pWriter uintptr = pCtx fts5WriteAppendPoslistData(tls, p, pWriter, pChunk, nChunk) } // -func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32, pnRem uintptr) { /* sqlite3.c:220563:13: */ +func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32, pnRem uintptr) { /* sqlite3.c:223902:13: */ bp := tls.Alloc(148) defer tls.Free(148) @@ -171717,7 +174388,7 @@ func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32, // Do up to nPg pages of automerge work on the index. // // Return true if any changes were actually made, or false otherwise. -func fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin int32) int32 { /* sqlite3.c:220712:12: */ +func fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin int32) int32 { /* sqlite3.c:224051:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -171767,7 +174438,7 @@ func fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin // // If an error occurs, set the Fts5Index.rc error code. If an error has // already occurred, this function is a no-op. -func fts5IndexAutomerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nLeaf int32) { /* sqlite3.c:220771:13: */ +func fts5IndexAutomerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nLeaf int32) { /* sqlite3.c:224110:13: */ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnAutomerge > 0) { var pStruct uintptr = *(*uintptr)(unsafe.Pointer(ppStruct)) var nWrite U64 // Initial value of write-counter @@ -171784,7 +174455,7 @@ func fts5IndexAutomerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nLeaf int32) } } -func fts5IndexCrisismerge(tls *libc.TLS, p uintptr, ppStruct uintptr) { /* sqlite3.c:220792:13: */ +func fts5IndexCrisismerge(tls *libc.TLS, p uintptr, ppStruct uintptr) { /* sqlite3.c:224131:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -171801,7 +174472,7 @@ func fts5IndexCrisismerge(tls *libc.TLS, p uintptr, ppStruct uintptr) { /* sqlit *(*uintptr)(unsafe.Pointer(ppStruct)) = *(*uintptr)(unsafe.Pointer(bp /* pStruct */)) } -func fts5IndexReturn(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:220810:12: */ +func fts5IndexReturn(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:224149:12: */ var rc int32 = (*Fts5Index)(unsafe.Pointer(p)).Frc (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_OK return rc @@ -171810,14 +174481,14 @@ func fts5IndexReturn(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:220810:12: * type Fts5FlushCtx1 = struct { FpIdx uintptr Fwriter Fts5SegWriter -} /* sqlite3.c:220816:9 */ +} /* sqlite3.c:224155:9 */ -type Fts5FlushCtx = Fts5FlushCtx1 /* sqlite3.c:220816:29 */ +type Fts5FlushCtx = Fts5FlushCtx1 /* sqlite3.c:224155:29 */ // Buffer aBuf[] contains a list of varints, all small enough to fit // in a 32-bit integer. Return the size of the largest prefix of this // list nMax bytes or less in size. -func fts5PoslistPrefix(tls *libc.TLS, aBuf uintptr, nMax int32) int32 { /* sqlite3.c:220827:12: */ +func fts5PoslistPrefix(tls *libc.TLS, aBuf uintptr, nMax int32) int32 { /* sqlite3.c:224166:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -171842,7 +174513,7 @@ func fts5PoslistPrefix(tls *libc.TLS, aBuf uintptr, nMax int32) int32 { /* sqlit // // If an error occurs, set the Fts5Index.rc error code. If an error has // already occurred, this function is a no-op. -func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:220848:13: */ +func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:224187:13: */ bp := tls.Alloc(176) defer tls.Free(176) @@ -172020,7 +174691,7 @@ func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:220848:13: */ } // Flush any data stored in the in-memory hash tables to the database. -func fts5IndexFlush(tls *libc.TLS, p uintptr) { /* sqlite3.c:221002:13: */ +func fts5IndexFlush(tls *libc.TLS, p uintptr) { /* sqlite3.c:224341:13: */ // Unless it is empty, flush the hash table to disk if (*Fts5Index)(unsafe.Pointer(p)).FnPendingData != 0 { @@ -172029,7 +174700,7 @@ func fts5IndexFlush(tls *libc.TLS, p uintptr) { /* sqlite3.c:221002:13: */ } } -func fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) uintptr { /* sqlite3.c:221011:22: */ +func fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) uintptr { /* sqlite3.c:224350:22: */ var pNew uintptr = uintptr(0) var nByte Sqlite3_int64 = Sqlite3_int64(unsafe.Sizeof(Fts5Structure{})) var nSeg int32 = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment @@ -172090,7 +174761,7 @@ func fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) uintptr return pNew } -func sqlite3Fts5IndexOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221073:12: */ +func sqlite3Fts5IndexOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:224412:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -172124,7 +174795,7 @@ func sqlite3Fts5IndexOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221 // This is called to implement the special "VALUES('merge', $nMerge)" // INSERT command. -func sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:221107:12: */ +func sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:224446:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -172149,12 +174820,12 @@ func sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sq return fts5IndexReturn(tls, p) } -func fts5AppendRowid(tls *libc.TLS, p uintptr, iDelta I64, pUnused uintptr, pBuf uintptr) { /* sqlite3.c:221129:13: */ +func fts5AppendRowid(tls *libc.TLS, p uintptr, iDelta I64, pUnused uintptr, pBuf uintptr) { /* sqlite3.c:224468:13: */ _ = pUnused sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), pBuf, iDelta) } -func fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta I64, pMulti uintptr, pBuf uintptr) { /* sqlite3.c:221139:13: */ +func fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta I64, pMulti uintptr, pBuf uintptr) { /* sqlite3.c:224478:13: */ var nData int32 = (*Fts5Iter)(unsafe.Pointer(pMulti)).Fbase.FnData var nByte int32 = (((nData + 9) + 9) + FTS5_DATA_ZERO_PADDING) @@ -172177,11 +174848,11 @@ func fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta I64, pMulti uintptr, pBu *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (nData) } - libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0, FTS5_DATA_ZERO_PADDING) + libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0, uint64(FTS5_DATA_ZERO_PADDING)) } } -func fts5DoclistIterNext(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:221157:13: */ +func fts5DoclistIterNext(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:224496:13: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -172207,24 +174878,29 @@ func fts5DoclistIterNext(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:221157:13: } (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = p + if ((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist + uintptr((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist)) > (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof { + (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = uintptr(0) + } } } -func fts5DoclistIterInit(tls *libc.TLS, pBuf uintptr, pIter uintptr) { /* sqlite3.c:221183:13: */ +func fts5DoclistIterInit(tls *libc.TLS, pBuf uintptr, pIter uintptr) { /* sqlite3.c:224525:13: */ libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5DoclistIter{}))) - (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp - (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof = ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) - fts5DoclistIterNext(tls, pIter) + if (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn > 0 { + (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof = ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + fts5DoclistIterNext(tls, pIter) + } } // Swap the contents of buffer *p1 with that of *p2. -func fts5BufferSwap(tls *libc.TLS, p1 uintptr, p2 uintptr) { /* sqlite3.c:221220:13: */ +func fts5BufferSwap(tls *libc.TLS, p1 uintptr, p2 uintptr) { /* sqlite3.c:224564:13: */ var tmp = *(*Fts5Buffer)(unsafe.Pointer(p1)) *(*Fts5Buffer)(unsafe.Pointer(p1)) = *(*Fts5Buffer)(unsafe.Pointer(p2)) *(*Fts5Buffer)(unsafe.Pointer(p2)) = tmp } -func fts5NextRowid(tls *libc.TLS, pBuf uintptr, piOff uintptr, piRowid uintptr) { /* sqlite3.c:221226:13: */ +func fts5NextRowid(tls *libc.TLS, pBuf uintptr, piOff uintptr, piRowid uintptr) { /* sqlite3.c:224570:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -172241,7 +174917,7 @@ func fts5NextRowid(tls *libc.TLS, pBuf uintptr, piOff uintptr, piRowid uintptr) // This is the equivalent of fts5MergePrefixLists() for detail=none mode. // In this case the buffers consist of a delta-encoded list of rowids only. -func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, p2 uintptr) { /* sqlite3.c:221241:13: */ +func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf uintptr) { /* sqlite3.c:224585:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -172250,9 +174926,12 @@ func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, p2 uintptr) { /* *(*I64)(unsafe.Pointer(bp + 24 /* iRowid1 */)) = int64(0) *(*I64)(unsafe.Pointer(bp + 40 /* iRowid2 */)) = int64(0) var iOut I64 = int64(0) + var p2 uintptr = (aBuf) // var out Fts5Buffer at bp, 16 + _ = nBuf libc.Xmemset(tls, bp /* &out */, 0, uint64(unsafe.Sizeof(Fts5Buffer{}))) + sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), bp /* &out */, (uint32((*Fts5Buffer)(unsafe.Pointer(p1)).Fn + (*Fts5Buffer)(unsafe.Pointer(p2)).Fn))) if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 { return @@ -172287,245 +174966,231 @@ func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, p2 uintptr) { /* sqlite3Fts5BufferFree(tls, bp /* &out */) } -// Buffers p1 and p2 contain doclists. This function merges the content -// of the two doclists together and sets buffer p1 to the result before -// returning. -// -// If an error occurs, an error code is left in p->rc. If an error has -// already occurred, this function is a no-op. -func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, p2 uintptr) { /* sqlite3.c:221288:13: */ - bp := tls.Alloc(144) - defer tls.Free(144) +type PrefixMerger1 = struct { + Fiter Fts5DoclistIter + FiPos I64 + FiOff int32 + _ [4]byte + FaPos uintptr + FpNext uintptr +} /* sqlite3.c:224628:9 */ - if (*Fts5Buffer)(unsafe.Pointer(p2)).Fn != 0 { - var iLastRowid I64 = int64(0) - // var i1 Fts5DoclistIter at bp+16, 32 +type PrefixMerger = PrefixMerger1 /* sqlite3.c:224628:29 */ - // var i2 Fts5DoclistIter at bp+48, 32 - - *(*Fts5Buffer)(unsafe.Pointer(bp /* out */)) = Fts5Buffer{} - *(*Fts5Buffer)(unsafe.Pointer(bp + 88 /* tmp */)) = Fts5Buffer{} - - // The maximum size of the output is equal to the sum of the two - // input sizes + 1 varint (9 bytes). The extra varint is because if the - // first rowid in one input is a large negative number, and the first in - // the other a non-negative number, the delta for the non-negative - // number will be larger on disk than the literal integer value - // was. - // - // Or, if the input position-lists are corrupt, then the output might - // include up to 2 extra 10-byte positions created by interpreting -1 - // (the value PoslistNext64() uses for EOF) as a position and appending - // it to the output. This can happen at most once for each input - // position-list, hence two 10 byte paddings. - if sqlite3Fts5BufferSize(tls, (p+52 /* &.rc */), bp /* &out */, (uint32(((((*Fts5Buffer)(unsafe.Pointer(p1)).Fn+(*Fts5Buffer)(unsafe.Pointer(p2)).Fn)+9)+10)+10))) != 0 { - return +func fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { /* sqlite3.c:224637:13: */ + if (*PrefixMerger)(unsafe.Pointer(p)).Fiter.FaPoslist != 0 { + var pp uintptr = ppHead + for (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*PrefixMerger)(unsafe.Pointer(p)).Fiter.FiRowid > (*PrefixMerger)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).Fiter.FiRowid) { + pp = (*(*uintptr)(unsafe.Pointer(pp)) + 56 /* &.pNext */) } - fts5DoclistIterInit(tls, p1, bp+16 /* &i1 */) - fts5DoclistIterInit(tls, p2, bp+48 /* &i2 */) - - for 1 != 0 { - if (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FiRowid < (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FiRowid { - /* Copy entry from i1 */ - { - { - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 16 /* &i1 */)).FiRowid) - (iLastRowid))))) - } - (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 16 /* &i1 */)).FiRowid - } - - { - libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist, (uint64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnSize))) - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnSize) - } - - fts5DoclistIterNext(tls, bp+16 /* &i1 */) - if (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist == uintptr(0) { - break - } - - } else if (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FiRowid != (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FiRowid { - /* Copy entry from i2 */ - { - { - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid) - (iLastRowid))))) - } - (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid - } - - { - libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist, (uint64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnSize))) - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += ((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnSize) - } - - fts5DoclistIterNext(tls, bp+48 /* &i2 */) - if (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist == uintptr(0) { - break - } - - } else { - // Merge the two position lists. - *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) = int64(0) - *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) = int64(0) - *(*int32)(unsafe.Pointer(bp + 104 /* iOff1 */)) = 0 - *(*int32)(unsafe.Pointer(bp + 120 /* iOff2 */)) = 0 - var a1 uintptr = ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist + uintptr((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnSize)) - var a2 uintptr = ((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist + uintptr((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnSize)) - var nCopy int32 - var aCopy uintptr - - *(*I64)(unsafe.Pointer(bp + 136 /* iPrev */)) = int64(0) - // var writer Fts5PoslistWriter at bp+80, 8 - - libc.Xmemset(tls, bp+80 /* &writer */, 0, uint64(unsafe.Sizeof(Fts5PoslistWriter{}))) - - /* See the earlier comment in this function for an explanation of why - ** corrupt input position lists might cause the output to consume - ** at most 20 bytes of unexpected space. */ - { - { - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid) - (iLastRowid))))) - } - (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid - } - - sqlite3Fts5BufferZero(tls, bp+88 /* &tmp */) - sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), bp+88 /* &tmp */, (uint32((((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist) + 10) + 10))) - if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 { - break - } - - sqlite3Fts5PoslistNext64(tls, a1, (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist, bp+104 /* &iOff1 */, bp+112 /* &iPos1 */) - sqlite3Fts5PoslistNext64(tls, a2, (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist, bp+120 /* &iOff2 */, bp+128 /* &iPos2 */) - - if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) < *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) { - sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */))) - sqlite3Fts5PoslistNext64(tls, a1, (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist, bp+104 /* &iOff1 */, bp+112 /* &iPos1 */) - } else { - sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */))) - sqlite3Fts5PoslistNext64(tls, a2, (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist, bp+120 /* &iOff2 */, bp+128 /* &iPos2 */) - } - if (*(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) >= int64(0)) && (*(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) >= int64(0)) { - for 1 != 0 { - if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) < *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) { - if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) != *(*I64)(unsafe.Pointer(bp + 136 /* iPrev */)) { - sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */))) - } - sqlite3Fts5PoslistNext64(tls, a1, (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist, bp+104 /* &iOff1 */, bp+112 /* &iPos1 */) - if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) < int64(0) { - break - } - } else { - - sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */))) - sqlite3Fts5PoslistNext64(tls, a2, (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist, bp+120 /* &iOff2 */, bp+128 /* &iPos2 */) - if *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) < int64(0) { - break - } - } - } - } - - if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) >= int64(0) { - if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) != *(*I64)(unsafe.Pointer(bp + 136 /* iPrev */)) { - sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */))) - } - aCopy = (a1 + uintptr(*(*int32)(unsafe.Pointer(bp + 104 /* iOff1 */)))) - nCopy = ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist - *(*int32)(unsafe.Pointer(bp + 104 /* iOff1 */))) - } else { - - sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */))) - aCopy = (a2 + uintptr(*(*int32)(unsafe.Pointer(bp + 120 /* iOff2 */)))) - nCopy = ((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist - *(*int32)(unsafe.Pointer(bp + 120 /* iOff2 */))) - } - if nCopy > 0 { - { - libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 88 /* &tmp */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 88 /* &tmp */))).Fn)), aCopy, uint64(nCopy)) - *(*int32)(unsafe.Pointer(bp + 88 /* &tmp */ + 8 /* &.n */)) += (nCopy) - } - - } - - // WRITEPOSLISTSIZE - - if (*Fts5Buffer)(unsafe.Pointer(bp+88 /* &tmp */)).Fn > ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist) { - if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8)) - } - break - } - { - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64((*Fts5Buffer)(unsafe.Pointer(bp+88 /* &tmp */)).Fn * 2)))) - } - - { - libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5Buffer)(unsafe.Pointer(bp+88 /* &tmp */)).Fp, uint64((*Fts5Buffer)(unsafe.Pointer(bp+88 /* &tmp */)).Fn)) - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += ((*Fts5Buffer)(unsafe.Pointer(bp + 88 /* &tmp */)).Fn) - } - - fts5DoclistIterNext(tls, bp+16 /* &i1 */) - fts5DoclistIterNext(tls, bp+48 /* &i2 */) - - if ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist == uintptr(0)) || ((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist == uintptr(0)) { - break - } - - } - } - - if (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist != 0 { - { - { - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 16 /* &i1 */)).FiRowid) - (iLastRowid))))) - } - (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 16 /* &i1 */)).FiRowid - } - - { - libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist, (uint64((int64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaEof) - int64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist)) / 1))) - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += int32(((int64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaEof) - int64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist)) / 1)) - } - - } else if (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist != 0 { - { - { - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid) - (iLastRowid))))) - } - (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid - } - - { - libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist, (uint64((int64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaEof) - int64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist)) / 1))) - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += int32(((int64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaEof) - int64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist)) / 1)) - } - - } - - sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), p1, (*Fts5Buffer)(unsafe.Pointer(bp /* &out */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp /* &out */)).Fp) - sqlite3Fts5BufferFree(tls, bp+88 /* &tmp */) - sqlite3Fts5BufferFree(tls, bp /* &out */) + (*PrefixMerger)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(pp)) + *(*uintptr)(unsafe.Pointer(pp)) = p } } -func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, pToken uintptr, nToken int32, pColset uintptr, ppIter uintptr) { /* sqlite3.c:221433:13: */ - bp := tls.Alloc(28) - defer tls.Free(28) +func fts5PrefixMergerInsertByPosition(tls *libc.TLS, ppHead uintptr, p uintptr) { /* sqlite3.c:224651:13: */ + if (*PrefixMerger)(unsafe.Pointer(p)).FiPos >= int64(0) { + var pp uintptr = ppHead + for (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*PrefixMerger)(unsafe.Pointer(p)).FiPos > (*PrefixMerger)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).FiPos) { + pp = (*(*uintptr)(unsafe.Pointer(pp)) + 56 /* &.pNext */) + } + (*PrefixMerger)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(pp)) + *(*uintptr)(unsafe.Pointer(pp)) = p + } +} + +// Array aBuf[] contains nBuf doclists. These are all merged in with the +// doclist in buffer p1. +func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf uintptr) { /* sqlite3.c:224670:13: */ + bp := tls.Alloc(1072) + defer tls.Free(1072) + + // var aMerger [16]PrefixMerger at bp, 1024 + + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = uintptr(0) + var i int32 + var nOut int32 = 0 + *(*Fts5Buffer)(unsafe.Pointer(bp + 1032 /* out */)) = Fts5Buffer{} + *(*Fts5Buffer)(unsafe.Pointer(bp + 1048 /* tmp */)) = Fts5Buffer{} + var iLastRowid I64 = int64(0) + + // Initialize a doclist-iterator for each input buffer. Arrange them in + // a linked-list starting at pHead in ascending order of rowid. Avoid + // linking any iterators already at EOF into the linked list at all. + + libc.Xmemset(tls, bp /* &aMerger[0] */, 0, (uint64(unsafe.Sizeof(PrefixMerger{})) * (uint64(nBuf + 1)))) + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = (bp /* &aMerger */ + uintptr(nBuf)*64) + fts5DoclistIterInit(tls, p1, (*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) /* &.iter */)) + for i = 0; i < nBuf; i++ { + fts5DoclistIterInit(tls, (aBuf + uintptr(i)*16), (bp /* &aMerger */ + uintptr(i)*64 /* &.iter */)) + fts5PrefixMergerInsertByRowid(tls, bp+1024 /* &pHead */, (bp /* &aMerger */ + uintptr(i)*64)) + nOut = nOut + ((*Fts5Buffer)(unsafe.Pointer(aBuf + uintptr(i)*16)).Fn) + } + if nOut == 0 { + return + } + nOut = nOut + (((*Fts5Buffer)(unsafe.Pointer(p1)).Fn + 9) + (10 * nBuf)) + + // The maximum size of the output is equal to the sum of the + // input sizes + 1 varint (9 bytes). The extra varint is because if the + // first rowid in one input is a large negative number, and the first in + // the other a non-negative number, the delta for the non-negative + // number will be larger on disk than the literal integer value + // was. + // + // Or, if the input position-lists are corrupt, then the output might + // include up to (nBuf+1) extra 10-byte positions created by interpreting -1 + // (the value PoslistNext64() uses for EOF) as a position and appending + // it to the output. This can happen at most once for each input + // position-list, hence (nBuf+1) 10 byte paddings. + if sqlite3Fts5BufferSize(tls, (p+52 /* &.rc */), bp+1032 /* &out */, uint32(nOut)) != 0 { + return + } + + for *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) != 0 { + { + { + *(*int32)(unsafe.Pointer(bp + 1032 /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fn)), (uint64(((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).Fiter.FiRowid) - (iLastRowid))))) + } + (iLastRowid) = (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).Fiter.FiRowid + } + + if ((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FpNext != 0) && (iLastRowid == (*PrefixMerger)(unsafe.Pointer((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FpNext)).Fiter.FiRowid) { + // Merge data from two or more poslists + *(*I64)(unsafe.Pointer(bp + 1064 /* iPrev */)) = int64(0) + var nTmp int32 = FTS5_DATA_ZERO_PADDING + var nMerge int32 = 0 + var pSave uintptr = *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) + var pThis uintptr = uintptr(0) + var nTail int32 = 0 + + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = uintptr(0) + for (pSave != 0) && ((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FiRowid == iLastRowid) { + var pNext uintptr = (*PrefixMerger)(unsafe.Pointer(pSave)).FpNext + (*PrefixMerger)(unsafe.Pointer(pSave)).FiOff = 0 + (*PrefixMerger)(unsafe.Pointer(pSave)).FiPos = int64(0) + (*PrefixMerger)(unsafe.Pointer(pSave)).FaPos = ((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FaPoslist + uintptr((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FnSize)) + sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pSave)).FaPos, (*PrefixMerger)(unsafe.Pointer((pSave))).Fiter.FnPoslist, (pSave + 40 /* &.iOff */), (pSave + 32 /* &.iPos */)) + + nTmp = nTmp + ((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FnPoslist + 10) + nMerge++ + fts5PrefixMergerInsertByPosition(tls, bp+1024 /* &pHead */, pSave) + pSave = pNext + } + + if (*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) == uintptr(0)) || ((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FpNext == uintptr(0)) { + (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8)) + break + } + + // See the earlier comment in this function for an explanation of why + // corrupt input position lists might cause the output to consume + // at most nMerge*10 bytes of unexpected space. + if sqlite3Fts5BufferSize(tls, (p+52 /* &.rc */), bp+1048 /* &tmp */, (uint32(nTmp+(nMerge*10)))) != 0 { + break + } + sqlite3Fts5BufferZero(tls, bp+1048 /* &tmp */) + + pThis = *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = (*PrefixMerger)(unsafe.Pointer(pThis)).FpNext + sqlite3Fts5PoslistSafeAppend(tls, bp+1048 /* &tmp */, bp+1064 /* &iPrev */, (*PrefixMerger)(unsafe.Pointer(pThis)).FiPos) + sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pThis)).FaPos, (*PrefixMerger)(unsafe.Pointer((pThis))).Fiter.FnPoslist, (pThis + 40 /* &.iOff */), (pThis + 32 /* &.iPos */)) + + fts5PrefixMergerInsertByPosition(tls, bp+1024 /* &pHead */, pThis) + + for (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FpNext != 0 { + pThis = *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) + if (*PrefixMerger)(unsafe.Pointer(pThis)).FiPos != *(*I64)(unsafe.Pointer(bp + 1064 /* iPrev */)) { + sqlite3Fts5PoslistSafeAppend(tls, bp+1048 /* &tmp */, bp+1064 /* &iPrev */, (*PrefixMerger)(unsafe.Pointer(pThis)).FiPos) + } + sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pThis)).FaPos, (*PrefixMerger)(unsafe.Pointer((pThis))).Fiter.FnPoslist, (pThis + 40 /* &.iOff */), (pThis + 32 /* &.iPos */)) + + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = (*PrefixMerger)(unsafe.Pointer(pThis)).FpNext + fts5PrefixMergerInsertByPosition(tls, bp+1024 /* &pHead */, pThis) + } + + if (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FiPos != *(*I64)(unsafe.Pointer(bp + 1064 /* iPrev */)) { + sqlite3Fts5PoslistSafeAppend(tls, bp+1048 /* &tmp */, bp+1064 /* &iPrev */, (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FiPos) + } + nTail = ((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).Fiter.FnPoslist - (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FiOff) + + // WRITEPOSLISTSIZE + + if ((*Fts5Buffer)(unsafe.Pointer(bp+1048 /* &tmp */)).Fn + nTail) > (nTmp - FTS5_DATA_ZERO_PADDING) { + if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { + (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8)) + } + break + } + { + *(*int32)(unsafe.Pointer(bp + 1032 /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fn)), (uint64(((*Fts5Buffer)(unsafe.Pointer(bp+1048 /* &tmp */)).Fn + nTail) * 2)))) + } + + { + libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fn)), (*Fts5Buffer)(unsafe.Pointer(bp+1048 /* &tmp */)).Fp, uint64((*Fts5Buffer)(unsafe.Pointer(bp+1048 /* &tmp */)).Fn)) + *(*int32)(unsafe.Pointer(bp + 1032 /* &out */ + 8 /* &.n */)) += ((*Fts5Buffer)(unsafe.Pointer(bp + 1048 /* &tmp */)).Fn) + } + + if nTail > 0 { + { + libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fn)), ((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FaPos + uintptr((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FiOff)), uint64(nTail)) + *(*int32)(unsafe.Pointer(bp + 1032 /* &out */ + 8 /* &.n */)) += (nTail) + } + + } + + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = pSave + for i = 0; i < (nBuf + 1); i++ { + var pX uintptr = (bp /* &aMerger */ + uintptr(i)*64) + if ((*PrefixMerger)(unsafe.Pointer(pX)).Fiter.FaPoslist != 0) && ((*PrefixMerger)(unsafe.Pointer(pX)).Fiter.FiRowid == iLastRowid) { + fts5DoclistIterNext(tls, (pX /* &.iter */)) + fts5PrefixMergerInsertByRowid(tls, bp+1024 /* &pHead */, pX) + } + } + + } else { + // Copy poslist from pHead to output + var pThis uintptr = *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) + var pI uintptr = (pThis /* &.iter */) + { + libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(pI)).FaPoslist, (uint64((*Fts5DoclistIter)(unsafe.Pointer(pI)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(pI)).FnSize))) + *(*int32)(unsafe.Pointer(bp + 1032 /* &out */ + 8 /* &.n */)) += ((*Fts5DoclistIter)(unsafe.Pointer(pI)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(pI)).FnSize) + } + + fts5DoclistIterNext(tls, pI) + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = (*PrefixMerger)(unsafe.Pointer(pThis)).FpNext + fts5PrefixMergerInsertByRowid(tls, bp+1024 /* &pHead */, pThis) + } + } + + sqlite3Fts5BufferFree(tls, p1) + sqlite3Fts5BufferFree(tls, bp+1048 /* &tmp */) + libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(bp+1032 /* &out */)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(bp+1032 /* &out */)).Fn)), 0, uint64(FTS5_DATA_ZERO_PADDING)) + *(*Fts5Buffer)(unsafe.Pointer(p1)) = *(*Fts5Buffer)(unsafe.Pointer(bp + 1032 /* out */)) +} + +func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pToken uintptr, nToken int32, pColset uintptr, ppIter uintptr) { /* sqlite3.c:224813:13: */ + bp := tls.Alloc(32) + defer tls.Free(32) var pStruct uintptr var aBuf uintptr var nBuf int32 = 32 + var nMerge int32 = 1 var xMerge uintptr var xAppend uintptr if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_NONE { xMerge = *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, uintptr, uintptr) + f func(*libc.TLS, uintptr, uintptr, int32, uintptr) }{fts5MergeRowidLists})) xAppend = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, I64, uintptr, uintptr) }{fts5AppendRowid})) } else { + nMerge = (FTS5_MERGE_NLIST - 1) + nBuf = (nMerge * 8) // Sufficient to merge (16^8)==(2^32) lists xMerge = *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, uintptr, uintptr) + f func(*libc.TLS, uintptr, uintptr, int32, uintptr) }{fts5MergePrefixLists})) xAppend = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, I64, uintptr, uintptr) @@ -172545,18 +175210,36 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, pToken uintptr, var pData uintptr // var doclist Fts5Buffer at bp, 16 - *(*int32)(unsafe.Pointer(bp + 24 /* bNewTerm */)) = 1 + *(*int32)(unsafe.Pointer(bp + 28 /* bNewTerm */)) = 1 libc.Xmemset(tls, bp /* &doclist */, 0, uint64(unsafe.Sizeof(Fts5Buffer{}))) + if iIdx != 0 { + *(*int32)(unsafe.Pointer(bp + 24 /* dummy */)) = 0 + var f2 int32 = (FTS5INDEX_QUERY_SKIPEMPTY | FTS5INDEX_QUERY_NOOUTPUT) + *(*U8)(unsafe.Pointer(pToken)) = U8('0') + fts5MultiIterNew(tls, p, pStruct, f2, pColset, pToken, nToken, -1, 0, bp+16 /* &p1 */) + fts5IterSetOutputCb(tls, (p + 52 /* &.rc */), *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) + for ; fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) == 0; fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), bp+24 /* &dummy */) { + var pSeg uintptr = ((*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)) + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).FaFirst+1*4)).FiFirst)*120) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)) + 56 /* &.xSetOutputs */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), pSeg) + if (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FnData != 0 { + (*(*func(*libc.TLS, uintptr, I64, uintptr, uintptr))(unsafe.Pointer(&xAppend)))(tls, p, ((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FiRowid - iLastRowid), *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), bp /* &doclist */) + iLastRowid = (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FiRowid + } + } + fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) + } + + *(*U8)(unsafe.Pointer(pToken)) = (U8('0' + iIdx)) fts5MultiIterNew(tls, p, pStruct, flags, pColset, pToken, nToken, -1, 0, bp+16 /* &p1 */) fts5IterSetOutputCb(tls, (p + 52 /* &.rc */), *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) - for ; fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) == 0; fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), bp+24 /* &bNewTerm */) { + for ; fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) == 0; fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), bp+28 /* &bNewTerm */) { var pSeg uintptr = ((*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)) + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).FaFirst+1*4)).FiFirst)*120) var nTerm int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn var pTerm uintptr = (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)) + 56 /* &.xSetOutputs */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), pSeg) - if *(*int32)(unsafe.Pointer(bp + 24 /* bNewTerm */)) != 0 { + if *(*int32)(unsafe.Pointer(bp + 28 /* bNewTerm */)) != 0 { if (nTerm < nToken) || (libc.Xmemcmp(tls, pToken, pTerm, uint64(nToken)) != 0) { break } @@ -172568,13 +175251,21 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, pToken uintptr, if ((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FiRowid <= iLastRowid) && ((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn > 0) { for i = 0; ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn != 0); i++ { + var i1 int32 = (i * nMerge) + var iStore int32 - if (*Fts5Buffer)(unsafe.Pointer(aBuf+uintptr(i)*16)).Fn == 0 { - fts5BufferSwap(tls, bp /* &doclist */, (aBuf + uintptr(i)*16)) - sqlite3Fts5BufferZero(tls, bp /* &doclist */) - } else { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&xMerge)))(tls, p, bp /* &doclist */, (aBuf + uintptr(i)*16)) - sqlite3Fts5BufferZero(tls, (aBuf + uintptr(i)*16)) + for iStore = i1; iStore < (i1 + nMerge); iStore++ { + if (*Fts5Buffer)(unsafe.Pointer(aBuf+uintptr(iStore)*16)).Fn == 0 { + fts5BufferSwap(tls, bp /* &doclist */, (aBuf + uintptr(iStore)*16)) + sqlite3Fts5BufferZero(tls, bp /* &doclist */) + break + } + } + if iStore == (i1 + nMerge) { + (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(&xMerge)))(tls, p, bp /* &doclist */, nMerge, (aBuf + uintptr(i1)*16)) + for iStore = i1; iStore < (i1 + nMerge); iStore++ { + sqlite3Fts5BufferZero(tls, (aBuf + uintptr(iStore)*16)) + } } } iLastRowid = int64(0) @@ -172584,15 +175275,18 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, pToken uintptr, iLastRowid = (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FiRowid } - for i = 0; i < nBuf; i++ { + for i = 0; i < nBuf; i = i + (nMerge) { + var iFree int32 if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&xMerge)))(tls, p, bp /* &doclist */, (aBuf + uintptr(i)*16)) + (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(&xMerge)))(tls, p, bp /* &doclist */, nMerge, (aBuf + uintptr(i)*16)) + } + for iFree = i; iFree < (i + nMerge); iFree++ { + sqlite3Fts5BufferFree(tls, (aBuf + uintptr(iFree)*16)) } - sqlite3Fts5BufferFree(tls, (aBuf + uintptr(i)*16)) } fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) - pData = fts5IdxMalloc(tls, p, (int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn)) + FTS5_DATA_ZERO_PADDING))) + pData = fts5IdxMalloc(tls, p, (int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn)) + uint64(FTS5_DATA_ZERO_PADDING)))) if pData != 0 { (*Fts5Data)(unsafe.Pointer(pData)).Fp = (pData + 1*16) (*Fts5Data)(unsafe.Pointer(pData)).Fnn = libc.AssignPtrInt32(pData+12 /* &.szLeaf */, (*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn) @@ -172610,7 +175304,7 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, pToken uintptr, // Indicate that all subsequent calls to sqlite3Fts5IndexWrite() pertain // to the document with rowid iRowid. -func sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid I64) int32 { /* sqlite3.c:221533:12: */ +func sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid I64) int32 { /* sqlite3.c:224950:12: */ // Allocate the hash table if it has not already been allocated if (*Fts5Index)(unsafe.Pointer(p)).FpHash == uintptr(0) { @@ -172630,7 +175324,7 @@ func sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid } // Commit data to disk. -func sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221557:12: */ +func sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:224974:12: */ fts5IndexFlush(tls, p) sqlite3Fts5IndexCloseReader(tls, p) @@ -172641,7 +175335,7 @@ func sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221557: // to the database. Additionally, assume that the contents of the %_data // table may have changed on disk. So any in-memory caches of %_data // records must be invalidated. -func sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221570:12: */ +func sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:224987:12: */ sqlite3Fts5IndexCloseReader(tls, p) fts5IndexDiscardData(tls, p) fts5StructureInvalidate(tls, p) @@ -172652,7 +175346,7 @@ func sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221 // The %_data table is completely empty when this function is called. This // function populates it with the initial structure objects for each index, // and the initial version of the "averages" record (a zero-byte blob). -func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221583:12: */ +func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:225000:12: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -172661,7 +175355,7 @@ func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:22158 fts5StructureInvalidate(tls, p) fts5IndexDiscardData(tls, p) libc.Xmemset(tls, bp /* &s */, 0, uint64(unsafe.Sizeof(Fts5Structure{}))) - fts5DataWrite(tls, p, FTS5_AVERAGES_ROWID, ts+703 /* "" */, 0) + fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), ts+703 /* "" */, 0) fts5StructureWrite(tls, p, bp /* &s */) return fts5IndexReturn(tls, p) } @@ -172671,7 +175365,7 @@ func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:22158 // // If successful, set *pp to point to the new object and return SQLITE_OK. // Otherwise, set *pp to NULL and return an SQLite error code. -func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:221600:12: */ +func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:225017:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -172682,13 +175376,13 @@ func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uint if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK { (*Fts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit = FTS5_WORK_UNIT - (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl = sqlite3Fts5Mprintf(tls, bp+8 /* &rc */, ts+31263 /* "%s_data" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl = sqlite3Fts5Mprintf(tls, bp+8 /* &rc */, ts+31789 /* "%s_data" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) if ((*Fts5Index)(unsafe.Pointer(p)).FzDataTbl != 0) && (bCreate != 0) { *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sqlite3Fts5CreateTable(tls, - pConfig, ts+22282 /* "data" */, ts+31271 /* "id INTEGER PRIMA..." */, 0, pzErr) + pConfig, ts+22806 /* "data" */, ts+31797 /* "id INTEGER PRIMA..." */, 0, pzErr) if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sqlite3Fts5CreateTable(tls, pConfig, ts+9380, /* "idx" */ - ts+31306, /* "segid, term, pgn..." */ + *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sqlite3Fts5CreateTable(tls, pConfig, ts+9745, /* "idx" */ + ts+31832, /* "segid, term, pgn..." */ 1, pzErr) } if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK { @@ -172705,7 +175399,7 @@ func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uint } // Close a handle opened by an earlier call to sqlite3Fts5IndexOpen(). -func sqlite3Fts5IndexClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221641:12: */ +func sqlite3Fts5IndexClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:225058:12: */ var rc int32 = SQLITE_OK if p != 0 { @@ -172726,7 +175420,7 @@ func sqlite3Fts5IndexClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221641 // Argument p points to a buffer containing utf-8 text that is n bytes in // size. Return the number of bytes in the nChar character prefix of the // buffer, or 0 if there are less than nChar characters in total. -func sqlite3Fts5IndexCharlenToBytelen(tls *libc.TLS, p uintptr, nByte int32, nChar int32) int32 { /* sqlite3.c:221664:12: */ +func sqlite3Fts5IndexCharlenToBytelen(tls *libc.TLS, p uintptr, nByte int32, nChar int32) int32 { /* sqlite3.c:225081:12: */ var n int32 = 0 var i int32 for i = 0; i < nChar; i++ { @@ -172753,7 +175447,7 @@ func sqlite3Fts5IndexCharlenToBytelen(tls *libc.TLS, p uintptr, nByte int32, nCh // pIn is a UTF-8 encoded string, nIn bytes in size. Return the number of // unicode characters in the string. -func fts5IndexCharlen(tls *libc.TLS, pIn uintptr, nIn int32) int32 { /* sqlite3.c:221691:12: */ +func fts5IndexCharlen(tls *libc.TLS, pIn uintptr, nIn int32) int32 { /* sqlite3.c:225108:12: */ var nChar int32 = 0 var i int32 = 0 for i < nIn { @@ -172775,7 +175469,7 @@ func fts5IndexCharlen(tls *libc.TLS, pIn uintptr, nIn int32) int32 { /* sqlite3. // If the operation is a delete, it must be called (at least) once for each // unique token in the document with an iCol value less than zero. The iPos // argument is ignored for a delete. -func sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pToken uintptr, nToken int32) int32 { /* sqlite3.c:221713:12: */ +func sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pToken uintptr, nToken int32) int32 { /* sqlite3.c:225130:12: */ var i int32 // Used to iterate through indexes var rc int32 = SQLITE_OK // Return code var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig @@ -172799,7 +175493,7 @@ func sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pTo // Open a new iterator to iterate though all rowid that match the // specified token or token prefix. -func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int32, flags int32, pColset uintptr, ppIter uintptr) int32 { /* sqlite3.c:221749:12: */ +func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int32, flags int32, pColset uintptr, ppIter uintptr) int32 { /* sqlite3.c:225166:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -172810,7 +175504,8 @@ func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int3 // If the QUERY_SCAN flag is set, all other flags must be clear. if sqlite3Fts5BufferSize(tls, (p+52 /* &.rc */), bp /* &buf */, (uint32(nToken+1))) == 0 { - var iIdx int32 = 0 // Index to search + var iIdx int32 = 0 // Index to search + var iPrefixIdx int32 = 0 // +1 prefix index if nToken != 0 { libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp + 1), pToken, uint64(nToken)) } @@ -172828,9 +175523,13 @@ func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int3 if (flags & FTS5INDEX_QUERY_PREFIX) != 0 { var nChar int32 = fts5IndexCharlen(tls, pToken, nToken) for iIdx = 1; iIdx <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix; iIdx++ { - if *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix + uintptr((iIdx-1))*4)) == nChar { + var nIdxChar int32 = *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix + uintptr((iIdx-1))*4)) + if nIdxChar == nChar { break } + if nIdxChar == (nChar + 1) { + iPrefixIdx = iIdx + } } } @@ -172846,8 +175545,7 @@ func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int3 } else { // Scan multiple terms in the main index var bDesc int32 = (libc.Bool32((flags & FTS5INDEX_QUERY_DESC) != 0)) - *(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp)) = U8('0') - fts5SetupPrefixIter(tls, p, bDesc, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (nToken + 1), pColset, bp+16 /* &pRet */) + fts5SetupPrefixIter(tls, p, bDesc, iPrefixIdx, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (nToken + 1), pColset, bp+16 /* &pRet */) fts5IterSetOutputCb(tls, (p + 52 /* &.rc */), *(*uintptr)(unsafe.Pointer(bp + 16 /* pRet */))) if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -172872,7 +175570,7 @@ func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int3 // Return true if the iterator passed as the only argument is at EOF. // Move to the next matching rowid. -func sqlite3Fts5IterNext(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:221831:12: */ +func sqlite3Fts5IterNext(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:225250:12: */ var pIter uintptr = pIndexIter fts5MultiIterNext(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pIter, 0, int64(0)) @@ -172880,7 +175578,7 @@ func sqlite3Fts5IterNext(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c } // Move to the next matching term/rowid. Used by the fts5vocab module. -func sqlite3Fts5IterNextScan(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:221841:12: */ +func sqlite3Fts5IterNextScan(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:225260:12: */ var pIter uintptr = pIndexIter var p uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex @@ -172900,26 +175598,32 @@ func sqlite3Fts5IterNextScan(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlit // Move to the next matching rowid that occurs at or after iMatch. The // definition of "at or after" depends on whether this iterator iterates // in ascending or descending rowid order. -func sqlite3Fts5IterNextFrom(tls *libc.TLS, pIndexIter uintptr, iMatch I64) int32 { /* sqlite3.c:221865:12: */ +func sqlite3Fts5IterNextFrom(tls *libc.TLS, pIndexIter uintptr, iMatch I64) int32 { /* sqlite3.c:225284:12: */ var pIter uintptr = pIndexIter fts5MultiIterNextFrom(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pIter, iMatch) return fts5IndexReturn(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex) } // Return the current term. -func sqlite3Fts5IterTerm(tls *libc.TLS, pIndexIter uintptr, pn uintptr) uintptr { /* sqlite3.c:221874:19: */ +func sqlite3Fts5IterTerm(tls *libc.TLS, pIndexIter uintptr, pn uintptr) uintptr { /* sqlite3.c:225293:19: */ bp := tls.Alloc(4) defer tls.Free(4) // var n int32 at bp, 4 var z uintptr = fts5MultiIterTerm(tls, pIndexIter, bp /* &n */) + *(*int32)(unsafe.Pointer(pn)) = (*(*int32)(unsafe.Pointer(bp /* n */)) - 1) - return (z + 1) + return func() uintptr { + if z != 0 { + return (z + 1) + } + return uintptr(0) + }() } // Close an iterator opened by an earlier call to sqlite3Fts5IndexQuery(). -func sqlite3Fts5IterClose(tls *libc.TLS, pIndexIter uintptr) { /* sqlite3.c:221884:13: */ +func sqlite3Fts5IterClose(tls *libc.TLS, pIndexIter uintptr) { /* sqlite3.c:225304:13: */ if pIndexIter != 0 { var pIter uintptr = pIndexIter var pIndex uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex @@ -172932,13 +175636,13 @@ func sqlite3Fts5IterClose(tls *libc.TLS, pIndexIter uintptr) { /* sqlite3.c:2218 // // Parameter anSize must point to an array of size nCol, where nCol is // the number of user defined columns in the FTS table. -func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize uintptr) int32 { /* sqlite3.c:221899:12: */ +func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize uintptr) int32 { /* sqlite3.c:225319:12: */ var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnCol var pData uintptr *(*I64)(unsafe.Pointer(pnRow)) = int64(0) libc.Xmemset(tls, anSize, 0, (uint64(unsafe.Sizeof(I64(0))) * uint64(nCol))) - pData = fts5DataRead(tls, p, FTS5_AVERAGES_ROWID) + pData = fts5DataRead(tls, p, int64(FTS5_AVERAGES_ROWID)) if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5Data)(unsafe.Pointer(pData)).Fnn != 0) { var i int32 = 0 var iCol int32 @@ -172954,15 +175658,15 @@ func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize // Replace the current "averages" record with the contents of the buffer // supplied as the second argument. -func sqlite3Fts5IndexSetAverages(tls *libc.TLS, p uintptr, pData uintptr, nData int32) int32 { /* sqlite3.c:221923:12: */ +func sqlite3Fts5IndexSetAverages(tls *libc.TLS, p uintptr, pData uintptr, nData int32) int32 { /* sqlite3.c:225343:12: */ - fts5DataWrite(tls, p, FTS5_AVERAGES_ROWID, pData, nData) + fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), pData, nData) return fts5IndexReturn(tls, p) } // Return the total number of blocks this module has read from the %_data // table since it was created. -func sqlite3Fts5IndexReads(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221933:12: */ +func sqlite3Fts5IndexReads(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:225353:12: */ return (*Fts5Index)(unsafe.Pointer(p)).FnRead } @@ -172971,7 +175675,7 @@ func sqlite3Fts5IndexReads(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221933 // // Return SQLITE_OK if successful, or an SQLite error code if an error // occurs. -func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /* sqlite3.c:221944:12: */ +func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /* sqlite3.c:225364:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -172984,7 +175688,7 @@ func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /* sqlite3Fts5Put32(tls, bp /* &aCookie[0] */, iNew) rc = Xsqlite3_blob_open(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl, - ts+30953 /* "block" */, FTS5_STRUCTURE_ROWID, 1, bp+8 /* &pBlob */) + ts+31479 /* "block" */, int64(FTS5_STRUCTURE_ROWID), 1, bp+8 /* &pBlob */) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pBlob */)), bp /* &aCookie[0] */, 4, 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pBlob */))) @@ -172993,7 +175697,7 @@ func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /* return rc } -func sqlite3Fts5IndexLoadConfig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221964:12: */ +func sqlite3Fts5IndexLoadConfig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:225384:12: */ var pStruct uintptr pStruct = fts5StructureRead(tls, p) fts5StructureRelease(tls, pStruct) @@ -173007,7 +175711,7 @@ func sqlite3Fts5IndexLoadConfig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:2 // functionality. // Return a simple checksum value based on the arguments. -func sqlite3Fts5IndexEntryCksum(tls *libc.TLS, iRowid I64, iCol int32, iPos int32, iIdx int32, pTerm uintptr, nTerm int32) U64 { /* sqlite3.c:221981:12: */ +func sqlite3Fts5IndexEntryCksum(tls *libc.TLS, iRowid I64, iCol int32, iPos int32, iIdx int32, pTerm uintptr, nTerm int32) U64 { /* sqlite3.c:225401:12: */ var i int32 var ret U64 = U64(iRowid) ret = ret + ((ret << 3) + U64(iCol)) @@ -173027,7 +175731,7 @@ func sqlite3Fts5IndexEntryCksum(tls *libc.TLS, iRowid I64, iCol int32, iPos int3 // contain zero terms. // 2) All leaves of pSeg between iNoRowid and iLast (inclusive) exist and // contain zero rowids. -func fts5IndexIntegrityCheckEmpty(tls *libc.TLS, p uintptr, pSeg uintptr, iFirst int32, iNoRowid int32, iLast int32) { /* sqlite3.c:222199:13: */ +func fts5IndexIntegrityCheckEmpty(tls *libc.TLS, p uintptr, pSeg uintptr, iFirst int32, iNoRowid int32, iLast int32) { /* sqlite3.c:225619:13: */ var i int32 // Now check that the iter.nEmpty leaves following the current leaf @@ -173046,7 +175750,7 @@ func fts5IndexIntegrityCheckEmpty(tls *libc.TLS, p uintptr, pSeg uintptr, iFirst } } -func fts5IntegrityCheckPgidx(tls *libc.TLS, p uintptr, pLeaf uintptr) { /* sqlite3.c:222220:13: */ +func fts5IntegrityCheckPgidx(tls *libc.TLS, p uintptr, pLeaf uintptr) { /* sqlite3.c:225640:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -173105,7 +175809,7 @@ func fts5IntegrityCheckPgidx(tls *libc.TLS, p uintptr, pLeaf uintptr) { /* sqlit sqlite3Fts5BufferFree(tls, bp+32 /* &buf2 */) } -func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /* sqlite3.c:222270:13: */ +func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /* sqlite3.c:225690:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -173121,7 +175825,7 @@ func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /* fts5IndexPrepareStmt(tls, p, bp+24 /* &pStmt */, Xsqlite3_mprintf(tls, - ts+31350, /* "SELECT segid, te..." */ + ts+31876, /* "SELECT segid, te..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) // Iterate through the b-tree hierarchy. @@ -173274,7 +175978,7 @@ func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /* // checksum does not match. Return SQLITE_OK if all checks pass without // error, or some other SQLite error code if another error (e.g. OOM) // occurs. -func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64) int32 { /* sqlite3.c:222415:12: */ +func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64, bUseCksum int32) int32 { /* sqlite3.c:225835:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -173331,6 +176035,7 @@ func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64) int32 { } else { (*Fts5Buffer)(unsafe.Pointer(bp + 16 /* &poslist */)).Fn = 0 fts5SegiterPoslist(tls, p, ((*(*uintptr)(unsafe.Pointer(bp /* pIter */)) + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIter */)))).FaFirst+1*4)).FiFirst)*120), uintptr(0), bp+16 /* &poslist */) + sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), bp+16 /* &poslist */, uint32(4), ts+31962 /* "\x00\x00\x00\x00" */) for 0 == sqlite3Fts5PoslistNext64(tls, (*Fts5Buffer)(unsafe.Pointer(bp+16 /* &poslist */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp+16 /* &poslist */)).Fn, bp+32 /* &iOff */, bp+40 /* &iPos */) { var iCol int32 = (int32(*(*I64)(unsafe.Pointer(bp + 40 /* iPos */)) >> 32)) var iTokOff int32 = (int32(*(*I64)(unsafe.Pointer(bp + 40 /* iPos */)) & int64(0x7FFFFFFF))) @@ -173340,7 +176045,7 @@ func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64) int32 { } fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp /* pIter */))) - if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (cksum != cksum2) { + if (((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (bUseCksum != 0)) && (cksum != cksum2) { (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8)) } @@ -173357,7 +176062,7 @@ func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64) int32 { // Decode a segment-data rowid from the %_data table. This function is // the opposite of macro FTS5_SEGMENT_ROWID(). -func fts5DecodeRowid(tls *libc.TLS, iRowid I64, piSegid uintptr, pbDlidx uintptr, piHeight uintptr, piPgno uintptr) { /* sqlite3.c:222506:13: */ +func fts5DecodeRowid(tls *libc.TLS, iRowid I64, piSegid uintptr, pbDlidx uintptr, piHeight uintptr, piPgno uintptr) { /* sqlite3.c:225927:13: */ *(*int32)(unsafe.Pointer(piPgno)) = (int32(iRowid & ((I64(int64(1)) << FTS5_DATA_PAGE_B) - int64(1)))) iRowid >>= FTS5_DATA_PAGE_B @@ -173370,7 +176075,7 @@ func fts5DecodeRowid(tls *libc.TLS, iRowid I64, piSegid uintptr, pbDlidx uintptr *(*int32)(unsafe.Pointer(piSegid)) = (int32(iRowid & ((I64(int64(1)) << FTS5_DATA_ID_B) - int64(1)))) } -func fts5DebugRowid(tls *libc.TLS, pRc uintptr, pBuf uintptr, iKey I64) { /* sqlite3.c:222525:13: */ +func fts5DebugRowid(tls *libc.TLS, pRc uintptr, pBuf uintptr, iKey I64) { /* sqlite3.c:225946:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -173385,23 +176090,23 @@ func fts5DebugRowid(tls *libc.TLS, pRc uintptr, pBuf uintptr, iKey I64) { /* sql fts5DecodeRowid(tls, iKey, bp+32 /* &iSegid */, bp+36 /* &bDlidx */, bp+40 /* &iHeight */, bp+44 /* &iPgno */) if *(*int32)(unsafe.Pointer(bp + 32 /* iSegid */)) == 0 { - if iKey == FTS5_AVERAGES_ROWID { - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31436 /* "{averages} " */, 0) + if iKey == int64(FTS5_AVERAGES_ROWID) { + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31967 /* "{averages} " */, 0) } else { - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31448 /* "{structure}" */, 0) + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31979 /* "{structure}" */, 0) } } else { - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31460, /* "{%ssegid=%d h=%d..." */ + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31991, /* "{%ssegid=%d h=%d..." */ libc.VaList(bp, func() uintptr { if *(*int32)(unsafe.Pointer(bp + 36 /* bDlidx */)) != 0 { - return ts + 31486 /* "dlidx " */ + return ts + 32017 /* "dlidx " */ } return ts + 703 /* "" */ }(), *(*int32)(unsafe.Pointer(bp + 32 /* iSegid */)), *(*int32)(unsafe.Pointer(bp + 40 /* iHeight */)), *(*int32)(unsafe.Pointer(bp + 44 /* iPgno */)))) } } -func fts5DebugStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, p uintptr) { /* sqlite3.c:222543:13: */ +func fts5DebugStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, p uintptr) { /* sqlite3.c:225964:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -173411,13 +176116,13 @@ func fts5DebugStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, p uintptr) { / for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(p)).FnLevel; iLvl++ { var pLvl uintptr = ((p + 24 /* &.aLevel */) + uintptr(iLvl)*16) sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, - ts+31493 /* " {lvl=%d nMerge=..." */, libc.VaList(bp, iLvl, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg)) + ts+32024 /* " {lvl=%d nMerge=..." */, libc.VaList(bp, iLvl, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg)) for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg; iSeg++ { var pSeg uintptr = ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSeg)*12) - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31520, /* " {id=%d leaves=%..." */ + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+32051, /* " {id=%d leaves=%..." */ libc.VaList(bp+24, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast)) } - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+23890 /* "}" */, 0) + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+24414 /* "}" */, 0) } } @@ -173426,7 +176131,7 @@ func fts5DebugStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, p uintptr) { / // Arguments pBlob/nBlob contain a serialized Fts5Structure object. This // function appends a human-readable representation of the same object // to the buffer passed as the second argument. -func fts5DecodeStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, nBlob int32) { /* sqlite3.c:222572:13: */ +func fts5DecodeStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, nBlob int32) { /* sqlite3.c:225993:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -173448,7 +176153,7 @@ func fts5DecodeStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr // Arguments pBlob/nBlob contain an "averages" record. This function // appends a human-readable representation of record to the buffer passed // as the second argument. -func fts5DecodeAverages(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, nBlob int32) { /* sqlite3.c:222597:13: */ +func fts5DecodeAverages(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, nBlob int32) { /* sqlite3.c:226018:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -173459,8 +176164,8 @@ func fts5DecodeAverages(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, // var iVal U64 at bp+16, 8 i = i + (int32(sqlite3Fts5GetVarint(tls, (pBlob + uintptr(i)), bp+16 /* &iVal */))) - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31543 /* "%s%d" */, libc.VaList(bp, zSpace, int32(*(*U64)(unsafe.Pointer(bp + 16 /* iVal */))))) - zSpace = ts + 12763 /* " " */ + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+32074 /* "%s%d" */, libc.VaList(bp, zSpace, int32(*(*U64)(unsafe.Pointer(bp + 16 /* iVal */))))) + zSpace = ts + 9214 /* " " */ } } @@ -173469,7 +176174,7 @@ func fts5DecodeAverages(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, // after either the input buffer is exhausted or a 0 value is read. // // The return value is the number of bytes read from the input buffer. -func fts5DecodePoslist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n int32) int32 { /* sqlite3.c:222620:12: */ +func fts5DecodePoslist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n int32) int32 { /* sqlite3.c:226041:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -173478,7 +176183,7 @@ func fts5DecodePoslist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n in // var iVal int32 at bp+8, 4 iOff = iOff + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iOff)), bp+8 /* &iVal */)) - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+30675 /* " %d" */, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* iVal */)))) + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31199 /* " %d" */, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* iVal */)))) } return iOff } @@ -173489,7 +176194,7 @@ func fts5DecodePoslist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n in // pBuf. // // The return value is the number of bytes read from the input buffer. -func fts5DecodeDoclist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n int32) int32 { /* sqlite3.c:222638:12: */ +func fts5DecodeDoclist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n int32) int32 { /* sqlite3.c:226059:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -173498,7 +176203,7 @@ func fts5DecodeDoclist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n in if n > 0 { iOff = int32(sqlite3Fts5GetVarint(tls, a, bp+32 /* &iDocid */)) - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31548 /* " id=%lld" */, libc.VaList(bp, *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */)))) + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+32079 /* " id=%lld" */, libc.VaList(bp, *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */)))) } for iOff < n { // var nPos int32 at bp+40, 4 @@ -173506,9 +176211,9 @@ func fts5DecodeDoclist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n in // var bDel int32 at bp+44, 4 iOff = iOff + (fts5GetPoslistSize(tls, (a + uintptr(iOff)), bp+40 /* &nPos */, bp+44 /* &bDel */)) - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31557 /* " nPos=%d%s" */, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(bp + 40 /* nPos */)), func() uintptr { + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+32088 /* " nPos=%d%s" */, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(bp + 40 /* nPos */)), func() uintptr { if *(*int32)(unsafe.Pointer(bp + 44 /* bDel */)) != 0 { - return ts + 16972 /* "*" */ + return ts + 17383 /* "*" */ } return ts + 703 /* "" */ }())) @@ -173523,7 +176228,7 @@ func fts5DecodeDoclist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n in iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, (a + uintptr(iOff)), bp+48 /* &iDelta */))) *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */)) += *(*I64)(unsafe.Pointer(bp + 48 /* iDelta */)) - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31548 /* " id=%lld" */, libc.VaList(bp+24, *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */)))) + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+32079 /* " id=%lld" */, libc.VaList(bp+24, *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */)))) } } @@ -173541,7 +176246,7 @@ func fts5DecodeDoclist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n in // no-op. If an OOM or other error occurs within this function, *pRc is // set to an SQLite error code before returning. The final state of buffer // pBuf is undefined in this case. -func fts5DecodeRowidList(tls *libc.TLS, pRc uintptr, pBuf uintptr, pData uintptr, nData int32) { /* sqlite3.c:222676:13: */ +func fts5DecodeRowidList(tls *libc.TLS, pRc uintptr, pBuf uintptr, pData uintptr, nData int32) { /* sqlite3.c:226097:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -173559,18 +176264,18 @@ func fts5DecodeRowidList(tls *libc.TLS, pRc uintptr, pBuf uintptr, pData uintptr i++ if (i < nData) && (int32(*(*U8)(unsafe.Pointer(pData + uintptr(i)))) == 0x00) { i++ - zApp = ts + 31568 /* "+" */ + zApp = ts + 32099 /* "+" */ } else { - zApp = ts + 16972 /* "*" */ + zApp = ts + 17383 /* "*" */ } } - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+31570 /* " %lld%s" */, libc.VaList(bp, iRowid, zApp)) + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+32101 /* " %lld%s" */, libc.VaList(bp, iRowid, zApp)) } } // The implementation of user-defined scalar function fts5_decode(). -func fts5DecodeFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:222707:13: */ +func fts5DecodeFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:226128:13: */ bp := tls.Alloc(192) defer tls.Free(192) @@ -173672,7 +176377,7 @@ __5: goto __7 } sqlite3Fts5BufferAppendPrintf(tls, bp+64 /* &rc */, bp+48, /* &s */ - ts+31578 /* " %d(%lld)" */, libc.VaList(bp, (*Fts5DlidxLvl)(unsafe.Pointer(bp+88 /* &lvl */)).FiLeafPgno, (*Fts5DlidxLvl)(unsafe.Pointer(bp+88 /* &lvl */)).FiRowid)) + ts+32109 /* " %d(%lld)" */, libc.VaList(bp, (*Fts5DlidxLvl)(unsafe.Pointer(bp+88 /* &lvl */)).FiLeafPgno, (*Fts5DlidxLvl)(unsafe.Pointer(bp+88 /* &lvl */)).FiRowid)) goto __6 __6: fts5DlidxLvlNext(tls, bp+88 /* &lvl */) @@ -173685,7 +176390,7 @@ __3: if !(*(*int32)(unsafe.Pointer(bp + 68 /* iSegid */)) == 0) { goto __8 } - if !(iRowid == FTS5_AVERAGES_ROWID) { + if !(iRowid == int64(FTS5_AVERAGES_ROWID)) { goto __10 } fts5DecodeAverages(tls, bp+64 /* &rc */, bp+48 /* &s */, a, n) @@ -173727,7 +176432,7 @@ __16: (*Fts5Buffer)(unsafe.Pointer(bp + 136 /* &term */)).Fn = *(*int32)(unsafe.Pointer(bp + 164 /* nKeep */)) sqlite3Fts5BufferAppendBlob(tls, bp+64 /* &rc */, bp+136 /* &term */, uint32(*(*int32)(unsafe.Pointer(bp + 156 /* nAppend */))), (a + uintptr(iOff))) sqlite3Fts5BufferAppendPrintf(tls, - bp+64 /* &rc */, bp+48 /* &s */, ts+31588 /* " term=%.*s" */, libc.VaList(bp+16, (*Fts5Buffer)(unsafe.Pointer(bp+136 /* &term */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+136 /* &term */)).Fp)) + bp+64 /* &rc */, bp+48 /* &s */, ts+32119 /* " term=%.*s" */, libc.VaList(bp+16, (*Fts5Buffer)(unsafe.Pointer(bp+136 /* &term */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+136 /* &term */)).Fp)) iOff = iOff + (*(*int32)(unsafe.Pointer(bp + 156 /* nAppend */))) // Figure out where the doclist for this term ends @@ -173766,7 +176471,7 @@ __12: if !(n < 4) { goto __21 } - sqlite3Fts5BufferSet(tls, bp+64 /* &rc */, bp+48 /* &s */, 7, ts+31599 /* "corrupt" */) + sqlite3Fts5BufferSet(tls, bp+64 /* &rc */, bp+48 /* &s */, 7, ts+32130 /* "corrupt" */) goto decode_out goto __22 __21: @@ -173888,7 +176593,7 @@ __39: iOff1 = iOff1 + (*(*int32)(unsafe.Pointer(bp + 188 /* nByte */))) sqlite3Fts5BufferAppendPrintf(tls, - bp+64 /* &rc */, bp+48 /* &s */, ts+31588 /* " term=%.*s" */, libc.VaList(bp+32, (*Fts5Buffer)(unsafe.Pointer(bp+168 /* &term1 */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+168 /* &term1 */)).Fp)) + bp+64 /* &rc */, bp+48 /* &s */, ts+32119 /* " term=%.*s" */, libc.VaList(bp+32, (*Fts5Buffer)(unsafe.Pointer(bp+168 /* &term1 */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+168 /* &term1 */)).Fp)) iOff1 = iOff1 + (fts5DecodeDoclist(tls, bp+64 /* &rc */, bp+48 /* &s */, (a + uintptr(iOff1)), (iEnd - iOff1))) goto __32 __33: @@ -173917,19 +176622,19 @@ __41: } // The implementation of user-defined scalar function fts5_rowid(). -func fts5RowidFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:222916:13: */ +func fts5RowidFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:226337:13: */ var zArg uintptr if nArg == 0 { - Xsqlite3_result_error(tls, pCtx, ts+31607 /* "should be: fts5_..." */, -1) + Xsqlite3_result_error(tls, pCtx, ts+32138 /* "should be: fts5_..." */, -1) } else { zArg = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal))) - if 0 == Xsqlite3_stricmp(tls, zArg, ts+31644 /* "segment" */) { + if 0 == Xsqlite3_stricmp(tls, zArg, ts+32175 /* "segment" */) { var iRowid I64 var segid int32 var pgno int32 if nArg != 3 { Xsqlite3_result_error(tls, pCtx, - ts+31652 /* "should be: fts5_..." */, -1) + ts+32183 /* "should be: fts5_..." */, -1) } else { segid = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) pgno = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + 2*8))) @@ -173938,7 +176643,7 @@ func fts5RowidFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { } } else { Xsqlite3_result_error(tls, pCtx, - ts+31699 /* "first arg to fts..." */, -1) + ts+32230 /* "first arg to fts..." */, -1) } } } @@ -173949,15 +176654,15 @@ func fts5RowidFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { // // If successful, SQLITE_OK is returned. If an error occurs, some other // SQLite error code is returned instead. -func sqlite3Fts5IndexInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:222955:12: */ +func sqlite3Fts5IndexInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:226376:12: */ var rc int32 = Xsqlite3_create_function(tls, - db, ts+31743 /* "fts5_decode" */, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + db, ts+32274 /* "fts5_decode" */, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5DecodeFunction})), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = Xsqlite3_create_function(tls, - db, ts+31755 /* "fts5_decode_none" */, 2, + db, ts+32286 /* "fts5_decode_none" */, 2, SQLITE_UTF8, db, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5DecodeFunction})), uintptr(0), uintptr(0)) @@ -173965,14 +176670,14 @@ func sqlite3Fts5IndexInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:222955 if rc == SQLITE_OK { rc = Xsqlite3_create_function(tls, - db, ts+31772 /* "fts5_rowid" */, -1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + db, ts+32303 /* "fts5_rowid" */, -1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5RowidFunction})), uintptr(0), uintptr(0)) } return rc } -func sqlite3Fts5IndexReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:222976:12: */ +func sqlite3Fts5IndexReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226397:12: */ if fts5IndexDataVersion(tls, p) != (*Fts5Index)(unsafe.Pointer(p)).FiStructVersion { fts5StructureInvalidate(tls, p) @@ -173999,16 +176704,16 @@ func sqlite3Fts5IndexReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:222976 // structures should not be corrupt. Otherwise, true. If it is false, extra // assert() conditions in the fts5 code are activated - conditions that are // only true if it is guaranteed that the fts5 database is not corrupt. -var Xsqlite3_fts5_may_be_corrupt int32 = 1 /* sqlite3.c:223008:16 */ +var Xsqlite3_fts5_may_be_corrupt int32 = 1 /* sqlite3.c:226429:16 */ type Fts5Auxdata1 = struct { FpAux uintptr FpPtr uintptr FxDelete uintptr FpNext uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5Auxdata = Fts5Auxdata1 /* sqlite3.c:223011:28 */ +type Fts5Auxdata = Fts5Auxdata1 /* sqlite3.c:226432:28 */ type Fts5Auxiliary1 = struct { FpGlobal uintptr FzFunc uintptr @@ -174016,9 +176721,9 @@ type Fts5Auxiliary1 = struct { FxFunc Fts5_extension_function FxDestroy uintptr FpNext uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5Auxiliary = Fts5Auxiliary1 /* sqlite3.c:223012:30 */ +type Fts5Auxiliary = Fts5Auxiliary1 /* sqlite3.c:226433:30 */ type Fts5Cursor1 = struct { Fbase Sqlite3_vtab_cursor FpNext uintptr @@ -174047,35 +176752,35 @@ type Fts5Cursor1 = struct { FnInstAlloc int32 FnInstCount int32 FaInst uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5Cursor = Fts5Cursor1 /* sqlite3.c:223013:27 */ +type Fts5Cursor = Fts5Cursor1 /* sqlite3.c:226434:27 */ type Fts5FullTable1 = struct { Fp Fts5Table FpStorage uintptr FpGlobal uintptr FpSortCsr uintptr -} /* sqlite3.c:223014:9 */ +} /* sqlite3.c:226435:9 */ -type Fts5FullTable = Fts5FullTable1 /* sqlite3.c:223014:30 */ +type Fts5FullTable = Fts5FullTable1 /* sqlite3.c:226435:30 */ type Fts5Sorter1 = struct { FpStmt uintptr FiRowid I64 FaPoslist uintptr FnIdx int32 FaIdx [1]int32 -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5Sorter = Fts5Sorter1 /* sqlite3.c:223015:27 */ +type Fts5Sorter = Fts5Sorter1 /* sqlite3.c:226436:27 */ type Fts5TokenizerModule1 = struct { FzName uintptr FpUserData uintptr Fx Fts5_tokenizer FxDestroy uintptr FpNext uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5TokenizerModule = Fts5TokenizerModule1 /* sqlite3.c:223016:36 */ +type Fts5TokenizerModule = Fts5TokenizerModule1 /* sqlite3.c:226437:36 */ // NOTES ON TRANSACTIONS: // @@ -174109,21 +176814,21 @@ type Fts5TokenizerModule = Fts5TokenizerModule1 /* sqlite3.c:223016:36 */ type Fts5TransactionState = struct { FeState int32 FiSavepoint int32 -} /* sqlite3.c:223049:1 */ +} /* sqlite3.c:226470:1 */ type Fts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 _ [4]byte -} /* sqlite3.c:223106:1 */ +} /* sqlite3.c:226527:1 */ // Return true if pTab is a contentless table. -func fts5IsContentless(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:223290:12: */ +func fts5IsContentless(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:226711:12: */ return (libc.Bool32((*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FeContent == FTS5_CONTENT_NONE)) } // Delete a virtual table handle allocated by fts5InitVtab(). -func fts5FreeVtab(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:223297:13: */ +func fts5FreeVtab(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:226718:13: */ if pTab != 0 { sqlite3Fts5IndexClose(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex) sqlite3Fts5StorageClose(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage) @@ -174133,13 +176838,13 @@ func fts5FreeVtab(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:223297:13: */ } // The xDisconnect() virtual table method. -func fts5DisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:223309:12: */ +func fts5DisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:226730:12: */ fts5FreeVtab(tls, pVtab) return SQLITE_OK } // The xDestroy() virtual table method. -func fts5DestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:223317:12: */ +func fts5DestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:226738:12: */ var pTab uintptr = pVtab var rc int32 = sqlite3Fts5DropAll(tls, (*Fts5Table)(unsafe.Pointer(pTab)).FpConfig) if rc == SQLITE_OK { @@ -174157,7 +176862,7 @@ func fts5DestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:223317 // argv[1] -> database name // argv[2] -> table name // argv[...] -> "column name" and other module argument fields. -func fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:223337:12: */ +func fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:226758:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -174215,11 +176920,11 @@ func fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc i // The xConnect() and xCreate() methods for the virtual table. All the // work is done in function fts5InitVtab(). -func fts5ConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:223403:12: */ +func fts5ConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:226824:12: */ return fts5InitVtab(tls, 0, db, pAux, argc, argv, ppVtab, pzErr) } -func fts5CreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:223413:12: */ +func fts5CreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:226834:12: */ return fts5InitVtab(tls, 1, db, pAux, argc, argv, ppVtab, pzErr) } @@ -174228,13 +176933,25 @@ func fts5CreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv // Set the SQLITE_INDEX_SCAN_UNIQUE flag in pIdxInfo->flags. Unless this // extension is currently being used by a version of SQLite too old to // support index-info flags. In that case this function is a no-op. -func fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) { /* sqlite3.c:223439:13: */ +func fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) { /* sqlite3.c:226860:13: */ { *(*int32)(unsafe.Pointer(pIdxInfo + 80 /* &.idxFlags */)) |= (SQLITE_INDEX_SCAN_UNIQUE) } } +func fts5UsePatternMatch(tls *libc.TLS, pConfig uintptr, p uintptr) int32 { /* sqlite3.c:226871:12: */ + + if ((*Fts5Config)(unsafe.Pointer(pConfig)).FePattern == FTS5_PATTERN_GLOB) && (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_GLOB) { + return 1 + } + if ((*Fts5Config)(unsafe.Pointer(pConfig)).FePattern == FTS5_PATTERN_LIKE) && + ((int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_LIKE) || (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_GLOB)) { + return 1 + } + return 0 +} + // Implementation of the xBestIndex method for FTS5 tables. Within the // WHERE constraint, it searches for the following: // @@ -174263,7 +176980,9 @@ func fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) { /* sqlite3.c:223439:13 // // Match against table column: "m" // Match against rank column: "r" -// Match against other column: "" +// Match against other column: "M" +// LIKE against other column: "L" +// GLOB against other column: "G" // Equality constraint against the rowid: "=" // A < or <= against the rowid: "<" // A > or >= against the rowid: ">" @@ -174292,9 +177011,9 @@ func fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) { /* sqlite3.c:223439:13 // * An == rowid constraint: cost=10.0 // // Costs are not modified by the ORDER BY clause. -func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* sqlite3.c:223509:12: */ - bp := tls.Alloc(8) - defer tls.Free(8) +func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* sqlite3.c:226949:12: */ + bp := tls.Alloc(16) + defer tls.Free(16) var pTab uintptr = pVTab var pConfig uintptr = (*Fts5Table)(unsafe.Pointer(pTab)).FpConfig @@ -174313,11 +177032,11 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* if (*Fts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { (*Fts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, - ts+31783 /* "recursively defi..." */, 0) + ts+32314 /* "recursively defi..." */, 0) return SQLITE_ERROR } - idxStr = Xsqlite3_malloc(tls, (((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint * 6) + 1)) + idxStr = Xsqlite3_malloc(tls, (((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint * 8) + 1)) if idxStr == uintptr(0) { return SQLITE_NOMEM } @@ -174344,23 +177063,34 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* } *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('r') bSeenRank = 1 - } else { + } else if iCol >= 0 { bSeenMatch = 1 - *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('m') - if iCol < nCol { - Xsqlite3_snprintf(tls, 6, (idxStr + uintptr(iIdxStr)), ts+3930 /* "%d" */, libc.VaList(bp, iCol)) - idxStr += uintptr(libc.Xstrlen(tls, (idxStr + uintptr(iIdxStr)))) + *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('M') + Xsqlite3_snprintf(tls, 6, (idxStr + uintptr(iIdxStr)), ts+3958 /* "%d" */, libc.VaList(bp, iCol)) + idxStr += uintptr(libc.Xstrlen(tls, (idxStr + uintptr(iIdxStr)))) - } } (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1) (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1) } - } else if ((((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0) && (bSeenEq == 0)) && - (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ)) && (iCol < 0) { - *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('=') - bSeenEq = 1 - (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1) + } else if (*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 { + if ((iCol >= 0) && (iCol < nCol)) && (fts5UsePatternMatch(tls, pConfig, p) != 0) { + + *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = func() int8 { + if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_LIKE { + return int8('L') + } + return int8('G') + }() + Xsqlite3_snprintf(tls, 6, (idxStr + uintptr(iIdxStr)), ts+3958 /* "%d" */, libc.VaList(bp+8, iCol)) + idxStr += uintptr(libc.Xstrlen(tls, (idxStr + uintptr(iIdxStr)))) + (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1) + + } else if ((bSeenEq == 0) && (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ)) && (iCol < 0) { + *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('=') + bSeenEq = 1 + (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1) + } } } @@ -174443,7 +177173,7 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* return SQLITE_OK } -func fts5NewTransaction(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:223640:12: */ +func fts5NewTransaction(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:227084:12: */ var pCsr uintptr for pCsr = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext { if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab == pTab { @@ -174454,7 +177184,7 @@ func fts5NewTransaction(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:223640 } // Implementation of xOpen method. -func fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:223651:12: */ +func fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:227095:12: */ var pTab uintptr = pVTab var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig var pCsr uintptr = uintptr(0) // New cursor object @@ -174480,7 +177210,7 @@ func fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqli return rc } -func fts5StmtType(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:223677:12: */ +func fts5StmtType(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:227121:12: */ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_SCAN { if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FbDesc != 0 { return FTS5_STMT_SCAN_DESC @@ -174493,11 +177223,11 @@ func fts5StmtType(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:223677:12: * // This function is called after the cursor passed as the only argument // is moved to point at a different row. It clears all cached data // specific to the previous row stored by the cursor object. -func fts5CsrNewrow(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:223689:13: */ +func fts5CsrNewrow(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:227133:13: */ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) |= (((FTS5CSR_REQUIRE_CONTENT | FTS5CSR_REQUIRE_DOCSIZE) | FTS5CSR_REQUIRE_INST) | FTS5CSR_REQUIRE_POSLIST) } -func fts5FreeCursorComponents(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:223698:13: */ +func fts5FreeCursorComponents(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:227142:13: */ var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab var pData uintptr var pNext uintptr @@ -174540,7 +177270,7 @@ func fts5FreeCursorComponents(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:223698 // Close the cursor. For additional information see the documentation // on the xClose method of the virtual table interface. -func fts5CloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:223742:12: */ +func fts5CloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:227186:12: */ if pCursor != 0 { var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab var pCsr uintptr = pCursor @@ -174557,7 +177287,7 @@ func fts5CloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:223742 return SQLITE_OK } -func fts5SorterNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:223758:12: */ +func fts5SorterNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:227202:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -174601,7 +177331,7 @@ func fts5SorterNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:223758:12: // Set the FTS5CSR_REQUIRE_RESEEK flag on all FTS5_PLAN_MATCH cursors // open on table pTab. -func fts5TripCursors(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:223801:13: */ +func fts5TripCursors(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:227245:13: */ var pCsr uintptr for pCsr = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext { if ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_MATCH) && @@ -174621,7 +177351,7 @@ func fts5TripCursors(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:223801:13: */ // // Return SQLITE_OK if successful or if no reseek was required, or an // error code if an error occurred. -func fts5CursorReseek(tls *libc.TLS, pCsr uintptr, pbSkip uintptr) int32 { /* sqlite3.c:223824:12: */ +func fts5CursorReseek(tls *libc.TLS, pCsr uintptr, pbSkip uintptr) int32 { /* sqlite3.c:227268:12: */ var rc int32 = SQLITE_OK if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_REQUIRE_RESEEK)) != 0 { @@ -174650,7 +177380,7 @@ func fts5CursorReseek(tls *libc.TLS, pCsr uintptr, pbSkip uintptr) int32 { /* sq // Return SQLITE_OK if nothing goes wrong. SQLITE_OK is returned // even if we reach end-of-file. The fts5EofMethod() will be called // subsequently to determine whether or not an EOF was hit. -func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:223856:12: */ +func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:227300:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -174695,7 +177425,7 @@ func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:223856: rc = Xsqlite3_reset(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, - ts+2690 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb))) + ts+2718 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -174709,7 +177439,7 @@ func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:223856: return rc } -func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:223909:12: */ +func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:227353:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -174725,9 +177455,9 @@ func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt u rc = SQLITE_NOMEM } else { rc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1, - SQLITE_PREPARE_PERSISTENT, bp+8 /* &pRet */, uintptr(0)) + uint32(SQLITE_PREPARE_PERSISTENT), bp+8 /* &pRet */, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb))) + *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -174737,7 +177467,7 @@ func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt u return rc } -func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:223938:12: */ +func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:227382:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -174766,11 +177496,11 @@ func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int3 // // If SQLite a built-in statement cache, this wouldn't be a problem. rc = fts5PrepareStatement(tls, (pSorter /* &.pStmt */), pConfig, - ts+31822, /* "SELECT rowid, ra..." */ + ts+32353, /* "SELECT rowid, ra..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, func() uintptr { if zRankArgs != 0 { - return ts + 12447 /* ", " */ + return ts + 12863 /* ", " */ } return ts + 703 /* "" */ }(), @@ -174782,9 +177512,9 @@ func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int3 }(), func() uintptr { if bDesc != 0 { - return ts + 31877 /* "DESC" */ + return ts + 32408 /* "DESC" */ } - return ts + 31882 /* "ASC" */ + return ts + 32413 /* "ASC" */ }())) (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter @@ -174804,7 +177534,7 @@ func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int3 return rc } -func fts5CursorFirst(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:223990:12: */ +func fts5CursorFirst(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:227434:12: */ var rc int32 var pExpr uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr rc = sqlite3Fts5ExprFirst(tls, pExpr, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid, bDesc) @@ -174819,7 +177549,7 @@ func fts5CursorFirst(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int // MATCH expression that begins with a '*' character. The remainder of // the text passed to the MATCH operator are used as the special query // parameters. -func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr) int32 { /* sqlite3.c:224007:12: */ +func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr) int32 { /* sqlite3.c:227451:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -174835,13 +177565,13 @@ func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr) (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = FTS5_PLAN_SPECIAL - if (n == 5) && (0 == Xsqlite3_strnicmp(tls, ts+31886 /* "reads" */, z, n)) { + if (n == 5) && (0 == Xsqlite3_strnicmp(tls, ts+32417 /* "reads" */, z, n)) { (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = I64(sqlite3Fts5IndexReads(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) - } else if (n == 2) && (0 == Xsqlite3_strnicmp(tls, ts+4012 /* "id" */, z, n)) { + } else if (n == 2) && (0 == Xsqlite3_strnicmp(tls, ts+4040 /* "id" */, z, n)) { (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { // An unrecognized directive. Return an error message. - (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+31892 /* "unknown special ..." */, libc.VaList(bp, n, z)) + (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+32423 /* "unknown special ..." */, libc.VaList(bp, n, z)) rc = SQLITE_ERROR } @@ -174851,7 +177581,7 @@ func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr) // Search for an auxiliary function named zName that can be used with table // pTab. If one is found, return a pointer to the corresponding Fts5Auxiliary // structure. Otherwise, if no such function exists, return NULL. -func fts5FindAuxiliary(tls *libc.TLS, pTab uintptr, zName uintptr) uintptr { /* sqlite3.c:224042:22: */ +func fts5FindAuxiliary(tls *libc.TLS, pTab uintptr, zName uintptr) uintptr { /* sqlite3.c:227486:22: */ var pAux uintptr for pAux = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpAux; pAux != 0; pAux = (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpNext { @@ -174864,7 +177594,7 @@ func fts5FindAuxiliary(tls *libc.TLS, pTab uintptr, zName uintptr) uintptr { /* return uintptr(0) } -func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:224054:12: */ +func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:227498:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -174876,11 +177606,11 @@ func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:2240 var zRankArgs uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - var zSql uintptr = sqlite3Fts5Mprintf(tls, bp+16 /* &rc */, ts+31920 /* "SELECT %s" */, libc.VaList(bp, zRankArgs)) + var zSql uintptr = sqlite3Fts5Mprintf(tls, bp+16 /* &rc */, ts+32451 /* "SELECT %s" */, libc.VaList(bp, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1, - SQLITE_PREPARE_PERSISTENT, bp+24 /* &pStmt */, uintptr(0)) + uint32(SQLITE_PREPARE_PERSISTENT), bp+24 /* &pStmt */, uintptr(0)) Xsqlite3_free(tls, zSql) if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK { @@ -174908,7 +177638,7 @@ func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:2240 pAux = fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+31930 /* "no such function..." */, libc.VaList(bp+8, zRank)) + (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+32461 /* "no such function..." */, libc.VaList(bp+8, zRank)) *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = SQLITE_ERROR } } @@ -174917,7 +177647,7 @@ func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:2240 return *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) } -func fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank uintptr) int32 { /* sqlite3.c:224105:12: */ +func fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank uintptr) int32 { /* sqlite3.c:227549:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -174940,21 +177670,21 @@ func fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank uin *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) |= (FTS5CSR_FREE_ZRANK) } else if rc == SQLITE_ERROR { (*Sqlite3_vtab)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, - ts+31951 /* "parse error in r..." */, libc.VaList(bp, z)) + ts+32482 /* "parse error in r..." */, libc.VaList(bp, z)) } } else { if (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank != 0 { (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*Fts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = ts + 29692 /* "bm25" */ + (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = ts + 30216 /* "bm25" */ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } return rc } -func fts5GetRowidLimit(tls *libc.TLS, pVal uintptr, iDefault I64) I64 { /* sqlite3.c:224142:12: */ +func fts5GetRowidLimit(tls *libc.TLS, pVal uintptr, iDefault I64) I64 { /* sqlite3.c:227586:12: */ if pVal != 0 { var eType int32 = Xsqlite3_value_numeric_type(tls, pVal) if eType == SQLITE_INTEGER { @@ -174973,7 +177703,7 @@ func fts5GetRowidLimit(tls *libc.TLS, pVal uintptr, iDefault I64) I64 { /* sqlit // 1. Full-text search using a MATCH operator. // 2. A by-rowid lookup. // 3. A full-table scan. -func fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, nVal int32, apVal uintptr) int32 { /* sqlite3.c:224163:12: */ +func fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, nVal int32, apVal uintptr) int32 { /* sqlite3.c:227607:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -174995,6 +177725,8 @@ func fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintp var pzErr uintptr var zText uintptr + var bGlob int32 + var zText1 uintptr pTab = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab pConfig = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig pCsr = pCursor @@ -175011,7 +177743,7 @@ func fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintp goto __1 } (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, - ts+31783 /* "recursively defi..." */, 0) + ts+32314 /* "recursively defi..." */, 0) return SQLITE_ERROR __1: ; @@ -175035,14 +177767,18 @@ __3: switch int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1))))) { case 'r': goto __7 - case 'm': + case 'M': goto __8 - case '=': + case 'L': goto __9 - case '<': + case 'G': goto __10 - default: + case '=': goto __11 + case '<': + goto __12 + default: + goto __13 } goto __6 __7: @@ -175051,15 +177787,11 @@ __7: __8: zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))) if !(zText == uintptr(0)) { - goto __12 + goto __14 } zText = ts + 703 /* "" */ -__12: +__14: ; - - if !((int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) <= '9')) { - goto __13 - } iCol = 0 __15: iCol = ((iCol * 10) + (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) - '0')) @@ -175072,11 +177804,6 @@ __16: goto __17 __17: ; - goto __14 -__13: - iCol = (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol -__14: - ; if !(int32(*(*int8)(unsafe.Pointer(zText))) == '*') { goto __18 @@ -175089,7 +177816,7 @@ __14: goto __19 __18: pzErr = (pTab /* &.p */ /* &.base */ + 16 /* &.zErrMsg */) - rc = sqlite3Fts5ExprNew(tls, pConfig, iCol, zText, bp+8 /* &pExpr */, pzErr) + rc = sqlite3Fts5ExprNew(tls, pConfig, 0, iCol, zText, bp+8 /* &pExpr */, pzErr) if !(rc == SQLITE_OK) { goto __20 } @@ -175109,12 +177836,49 @@ __19: goto __6 __9: +__10: + bGlob = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(idxStr + uintptr((iIdxStr - 1))))) == 'G')) + zText1 = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))) + iCol = 0 +__22: + iCol = ((iCol * 10) + (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) - '0')) + iIdxStr++ + goto __23 +__23: + if (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) <= '9') { + goto __22 + } + goto __24 +__24: + ; + if !(zText1 != 0) { + goto __25 + } + rc = sqlite3Fts5ExprPattern(tls, pConfig, bGlob, iCol, zText1, bp+8 /* &pExpr */) +__25: + ; + if !(rc == SQLITE_OK) { + goto __26 + } + rc = sqlite3Fts5ExprAnd(tls, (pCsr + 64 /* &.pExpr */), *(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */))) + *(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */)) = uintptr(0) +__26: + ; + if !(rc != SQLITE_OK) { + goto __27 + } + goto filter_out +__27: + ; + goto __6 + +__11: pRowidEq = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)) goto __6 -__10: +__12: pRowidLe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)) goto __6 -__11: +__13: ; pRowidGe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)) goto __6 @@ -175145,25 +177909,25 @@ __5: // sqlite3_index_constraint.omit flag clear for range constraints // on the rowid field. if !(pRowidEq != 0) { - goto __22 + goto __28 } pRowidLe = libc.AssignUintptr(&pRowidGe, pRowidEq) -__22: +__28: ; if !(bDesc != 0) { - goto __23 + goto __29 } (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = fts5GetRowidLimit(tls, pRowidLe, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = fts5GetRowidLimit(tls, pRowidGe, ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))) - goto __24 -__23: + goto __30 +__29: (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = fts5GetRowidLimit(tls, pRowidLe, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = fts5GetRowidLimit(tls, pRowidGe, ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))) -__24: +__30: ; if !((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr != 0) { - goto __25 + goto __31 } // If pSortCsr is non-NULL, then this call is being made as part of // processing for a "... MATCH ORDER BY rank" query (ePlan is @@ -175173,51 +177937,51 @@ __24: // fts5CursorFirstSorted() above. if !((*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FbDesc != 0) { - goto __27 + goto __33 } (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiFirstRowid (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiLastRowid - goto __28 -__27: + goto __34 +__33: (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiLastRowid (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiFirstRowid -__28: +__34: ; (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = FTS5_PLAN_SOURCE (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FpExpr rc = fts5CursorFirst(tls, pTab, pCsr, bDesc) - goto __26 -__25: + goto __32 +__31: if !((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr != 0) { - goto __29 + goto __35 } rc = fts5CursorParseRank(tls, pConfig, pCsr, pRank) if !(rc == SQLITE_OK) { - goto __31 + goto __37 } if !(bOrderByRank != 0) { - goto __32 + goto __38 } (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = FTS5_PLAN_SORTED_MATCH rc = fts5CursorFirstSorted(tls, pTab, pCsr, bDesc) - goto __33 -__32: + goto __39 +__38: (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = FTS5_PLAN_MATCH rc = fts5CursorFirst(tls, pTab, pCsr, bDesc) -__33: +__39: ; -__31: +__37: ; - goto __30 -__29: + goto __36 +__35: if !((*Fts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0)) { - goto __34 + goto __40 } *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, - ts+31984 /* "%s: table does n..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) + ts+32515 /* "%s: table does n..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = SQLITE_ERROR - goto __35 -__34: + goto __41 +__40: // This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup // by rowid (ePlan==FTS5_PLAN_ROWID). (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = func() int32 { @@ -175229,26 +177993,26 @@ __34: rc = sqlite3Fts5StorageStmt(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, fts5StmtType(tls, pCsr), (pCsr + 56 /* &.pStmt */), (pTab /* &.p */ /* &.base */ + 16 /* &.zErrMsg */)) if !(rc == SQLITE_OK) { - goto __36 + goto __42 } if !((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_ROWID) { - goto __37 + goto __43 } Xsqlite3_bind_value(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 1, pRowidEq) - goto __38 -__37: + goto __44 +__43: Xsqlite3_bind_int64(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 1, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid) Xsqlite3_bind_int64(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 2, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid) -__38: +__44: ; rc = fts5NextMethod(tls, pCursor) +__42: + ; +__41: + ; __36: ; -__35: - ; -__30: - ; -__26: +__32: ; filter_out: @@ -175259,7 +178023,7 @@ filter_out: // This is the xEof method of the virtual table. SQLite calls this // routine to find out if it has reached the end of a result set. -func fts5EofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:224341:12: */ +func fts5EofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:227799:12: */ var pCsr uintptr = pCursor return func() int32 { if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_EOF)) != 0 { @@ -175270,7 +178034,7 @@ func fts5EofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:224341:1 } // Return the rowid that the cursor currently points to. -func fts5CursorRowid(tls *libc.TLS, pCsr uintptr) I64 { /* sqlite3.c:224349:12: */ +func fts5CursorRowid(tls *libc.TLS, pCsr uintptr) I64 { /* sqlite3.c:227807:12: */ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 { return (*Fts5Sorter)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter)).FiRowid @@ -175284,7 +178048,7 @@ func fts5CursorRowid(tls *libc.TLS, pCsr uintptr) I64 { /* sqlite3.c:224349:12: // retrieve the rowid for the current row of the result set. fts5 // exposes %_content.rowid as the rowid for the virtual table. The // rowid should be written to *pRowid. -func fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:224367:12: */ +func fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:227825:12: */ var pCsr uintptr = pCursor var ePlan int32 = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan @@ -175314,7 +178078,7 @@ func fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* // // If argument bErrormsg is true and an error occurs, an error message may // be left in sqlite3_vtab.zErrMsg. -func fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) int32 { /* sqlite3.c:224398:12: */ +func fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) int32 { /* sqlite3.c:227856:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -175351,14 +178115,14 @@ func fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) int32 { /* sql rc = (SQLITE_CORRUPT | (int32(1) << 8)) } else if (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).FpzErrmsg != 0 { *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, - ts+2690 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).Fdb))) + ts+2718 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).Fdb))) } } } return rc } -func fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:224437:13: */ +func fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:227895:13: */ var ap Va_list _ = ap // ... printf arguments ap = va @@ -175380,7 +178144,7 @@ func fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { / // The commands implemented by this function are documented in the "Special // INSERT Directives" section of the documentation. It should be updated if // more commands are added to this function. -func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) int32 { /* sqlite3.c:224460:12: */ +func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) int32 { /* sqlite3.c:227918:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -175388,30 +178152,31 @@ func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) var rc int32 = SQLITE_OK *(*int32)(unsafe.Pointer(bp /* bError */)) = 0 - if 0 == Xsqlite3_stricmp(tls, ts+32020 /* "delete-all" */, zCmd) { + if 0 == Xsqlite3_stricmp(tls, ts+32551 /* "delete-all" */, zCmd) { if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { fts5SetVtabError(tls, pTab, - ts+32031 /* "'delete-all' may..." */, 0) + ts+32562 /* "'delete-all' may..." */, 0) rc = SQLITE_ERROR } else { rc = sqlite3Fts5StorageDeleteAll(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage) } - } else if 0 == Xsqlite3_stricmp(tls, ts+32111 /* "rebuild" */, zCmd) { + } else if 0 == Xsqlite3_stricmp(tls, ts+32642 /* "rebuild" */, zCmd) { if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NONE { fts5SetVtabError(tls, pTab, - ts+32119 /* "'rebuild' may no..." */, 0) + ts+32650 /* "'rebuild' may no..." */, 0) rc = SQLITE_ERROR } else { rc = sqlite3Fts5StorageRebuild(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage) } - } else if 0 == Xsqlite3_stricmp(tls, ts+14536 /* "optimize" */, zCmd) { + } else if 0 == Xsqlite3_stricmp(tls, ts+14965 /* "optimize" */, zCmd) { rc = sqlite3Fts5StorageOptimize(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage) - } else if 0 == Xsqlite3_stricmp(tls, ts+32175 /* "merge" */, zCmd) { + } else if 0 == Xsqlite3_stricmp(tls, ts+32706 /* "merge" */, zCmd) { var nMerge int32 = Xsqlite3_value_int(tls, pVal) rc = sqlite3Fts5StorageMerge(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, nMerge) - } else if 0 == Xsqlite3_stricmp(tls, ts+32181 /* "integrity-check" */, zCmd) { - rc = sqlite3Fts5StorageIntegrity(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage) + } else if 0 == Xsqlite3_stricmp(tls, ts+32712 /* "integrity-check" */, zCmd) { + var iArg int32 = Xsqlite3_value_int(tls, pVal) + rc = sqlite3Fts5StorageIntegrity(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iArg) } else { rc = sqlite3Fts5IndexLoadConfig(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex) if rc == SQLITE_OK { @@ -175428,7 +178193,7 @@ func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) return rc } -func fts5SpecialDelete(tls *libc.TLS, pTab uintptr, apVal uintptr) int32 { /* sqlite3.c:224515:12: */ +func fts5SpecialDelete(tls *libc.TLS, pTab uintptr, apVal uintptr) int32 { /* sqlite3.c:227974:12: */ var rc int32 = SQLITE_OK var eType1 int32 = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) if eType1 == SQLITE_INTEGER { @@ -175438,7 +178203,7 @@ func fts5SpecialDelete(tls *libc.TLS, pTab uintptr, apVal uintptr) int32 { /* sq return rc } -func fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr, piRowid uintptr) { /* sqlite3.c:224528:13: */ +func fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr, piRowid uintptr) { /* sqlite3.c:227987:13: */ var rc int32 = *(*int32)(unsafe.Pointer(pRc)) if rc == SQLITE_OK { rc = sqlite3Fts5StorageContentInsert(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, piRowid) @@ -175461,7 +178226,7 @@ func fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr, // 2. The "new" rowid. // 3. Values for each of the nCol matchable columns. // 4. Values for the two hidden columns ( and "rank"). -func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, pRowid uintptr) int32 { /* sqlite3.c:224558:12: */ +func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, pRowid uintptr) int32 { /* sqlite3.c:228017:12: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -175483,7 +178248,7 @@ func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, p // A "special" INSERT op. These are handled separately. var z uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))*8))) if ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL) && - (0 == Xsqlite3_stricmp(tls, ts+15075 /* "delete" */, z)) { + (0 == Xsqlite3_stricmp(tls, ts+15504 /* "delete" */, z)) { *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = fts5SpecialDelete(tls, pTab, apVal) } else { *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = fts5SpecialInsert(tls, pTab, z, *(*uintptr)(unsafe.Pointer(apVal + uintptr(((2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)+1))*8))) @@ -175508,12 +178273,12 @@ func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, p // This is not suported. if (eType0 == SQLITE_INTEGER) && (fts5IsContentless(tls, pTab) != 0) { (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, - ts+32197, /* "cannot %s conten..." */ + ts+32728, /* "cannot %s conten..." */ libc.VaList(bp, func() uintptr { if nArg > 1 { - return ts + 32234 /* "UPDATE" */ + return ts + 18289 /* "UPDATE" */ } - return ts + 32241 /* "DELETE from" */ + return ts + 32765 /* "DELETE from" */ }(), (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = SQLITE_ERROR } else if nArg == 1 { @@ -175563,7 +178328,7 @@ func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, p } // Implementation of xSync() method. -func fts5SyncMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224684:12: */ +func fts5SyncMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:228143:12: */ var rc int32 var pTab uintptr = pVtab @@ -175575,7 +178340,7 @@ func fts5SyncMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224684:12 } // Implementation of xBegin() method. -func fts5BeginMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224698:12: */ +func fts5BeginMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:228157:12: */ fts5NewTransaction(tls, pVtab) return SQLITE_OK @@ -175584,7 +178349,7 @@ func fts5BeginMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224698:1 // Implementation of xCommit() method. This is a no-op. The contents of // the pending-terms hash-table have already been flushed into the database // by fts5SyncMethod(). -func fts5CommitMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224709:12: */ +func fts5CommitMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:228168:12: */ _ = pVtab // Call below is a no-op for NDEBUG builds return SQLITE_OK @@ -175592,7 +178357,7 @@ func fts5CommitMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224709: // Implementation of xRollback(). Discard the contents of the pending-terms // hash-table. Any changes made to the database are reverted by SQLite. -func fts5RollbackMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224719:12: */ +func fts5RollbackMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:228178:12: */ var rc int32 var pTab uintptr = pVtab @@ -175600,46 +178365,46 @@ func fts5RollbackMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:22471 return rc } -func fts5ApiUserData(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:224729:13: */ +func fts5ApiUserData(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:228188:13: */ var pCsr uintptr = pCtx return (*Fts5Auxiliary)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux)).FpUserData } -func fts5ApiColumnCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:224734:12: */ +func fts5ApiColumnCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:228193:12: */ var pCsr uintptr = pCtx return (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig)).FnCol } -func fts5ApiColumnTotalSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:224739:12: */ +func fts5ApiColumnTotalSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:228198:12: */ var pCsr uintptr = pCtx var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab return sqlite3Fts5StorageSize(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iCol, pnToken) } -func fts5ApiRowCount(tls *libc.TLS, pCtx uintptr, pnRow uintptr) int32 { /* sqlite3.c:224749:12: */ +func fts5ApiRowCount(tls *libc.TLS, pCtx uintptr, pnRow uintptr) int32 { /* sqlite3.c:228208:12: */ var pCsr uintptr = pCtx var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab return sqlite3Fts5StorageRowCount(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, pnRow) } -func fts5ApiTokenize(tls *libc.TLS, pCtx uintptr, pText uintptr, nText int32, pUserData uintptr, xToken uintptr) int32 { /* sqlite3.c:224755:12: */ +func fts5ApiTokenize(tls *libc.TLS, pCtx uintptr, pText uintptr, nText int32, pUserData uintptr, xToken uintptr) int32 { /* sqlite3.c:228214:12: */ var pCsr uintptr = pCtx var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab return sqlite3Fts5Tokenize(tls, (*Fts5Table)(unsafe.Pointer(pTab)).FpConfig, FTS5_TOKENIZE_AUX, pText, nText, pUserData, xToken) } -func fts5ApiPhraseCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:224768:12: */ +func fts5ApiPhraseCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:228227:12: */ var pCsr uintptr = pCtx return sqlite3Fts5ExprPhraseCount(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) } -func fts5ApiPhraseSize(tls *libc.TLS, pCtx uintptr, iPhrase int32) int32 { /* sqlite3.c:224773:12: */ +func fts5ApiPhraseSize(tls *libc.TLS, pCtx uintptr, iPhrase int32) int32 { /* sqlite3.c:228232:12: */ var pCsr uintptr = pCtx return sqlite3Fts5ExprPhraseSize(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase) } -func fts5ApiColumnText(tls *libc.TLS, pCtx uintptr, iCol int32, pz uintptr, pn uintptr) int32 { /* sqlite3.c:224778:12: */ +func fts5ApiColumnText(tls *libc.TLS, pCtx uintptr, iCol int32, pz uintptr, pn uintptr) int32 { /* sqlite3.c:228237:12: */ var rc int32 = SQLITE_OK var pCsr uintptr = pCtx if (fts5IsContentless(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab) != 0) || @@ -175656,7 +178421,7 @@ func fts5ApiColumnText(tls *libc.TLS, pCtx uintptr, iCol int32, pz uintptr, pn u return rc } -func fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn uintptr) int32 { /* sqlite3.c:224801:12: */ +func fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn uintptr) int32 { /* sqlite3.c:228260:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -175713,7 +178478,7 @@ func fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn u // Ensure that the Fts5Cursor.nInstCount and aInst[] variables are populated // correctly for the current view. Return SQLITE_OK if successful, or an // SQLite error code otherwise. -func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:224853:12: */ +func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:228312:12: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -175795,7 +178560,7 @@ func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:224853 return *(*int32)(unsafe.Pointer(bp /* rc */)) } -func fts5ApiInstCount(tls *libc.TLS, pCtx uintptr, pnInst uintptr) int32 { /* sqlite3.c:224925:12: */ +func fts5ApiInstCount(tls *libc.TLS, pCtx uintptr, pnInst uintptr) int32 { /* sqlite3.c:228384:12: */ var pCsr uintptr = pCtx var rc int32 = SQLITE_OK if (((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_REQUIRE_INST)) == 0) || @@ -175805,7 +178570,7 @@ func fts5ApiInstCount(tls *libc.TLS, pCtx uintptr, pnInst uintptr) int32 { /* sq return rc } -func fts5ApiInst(tls *libc.TLS, pCtx uintptr, iIdx int32, piPhrase uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:224935:12: */ +func fts5ApiInst(tls *libc.TLS, pCtx uintptr, iIdx int32, piPhrase uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:228394:12: */ var pCsr uintptr = pCtx var rc int32 = SQLITE_OK if (((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_REQUIRE_INST)) == 0) || @@ -175821,11 +178586,11 @@ func fts5ApiInst(tls *libc.TLS, pCtx uintptr, iIdx int32, piPhrase uintptr, piCo return rc } -func fts5ApiRowid(tls *libc.TLS, pCtx uintptr) Sqlite3_int64 { /* sqlite3.c:224964:22: */ +func fts5ApiRowid(tls *libc.TLS, pCtx uintptr) Sqlite3_int64 { /* sqlite3.c:228423:22: */ return fts5CursorRowid(tls, pCtx) } -func fts5ColumnSizeCb(tls *libc.TLS, pContext uintptr, tflags int32, pUnused uintptr, nUnused int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:224968:12: */ +func fts5ColumnSizeCb(tls *libc.TLS, pContext uintptr, tflags int32, pUnused uintptr, nUnused int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:228427:12: */ var pCnt uintptr = pContext _ = pUnused _ = nUnused @@ -175837,7 +178602,7 @@ func fts5ColumnSizeCb(tls *libc.TLS, pContext uintptr, tflags int32, pUnused uin return SQLITE_OK } -func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:224985:12: */ +func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:228444:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -175895,7 +178660,7 @@ func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) } // Implementation of the xSetAuxdata() method. -func fts5ApiSetAuxdata(tls *libc.TLS, pCtx uintptr, pPtr uintptr, xDelete uintptr) int32 { /* sqlite3.c:225038:12: */ +func fts5ApiSetAuxdata(tls *libc.TLS, pCtx uintptr, pPtr uintptr, xDelete uintptr) int32 { /* sqlite3.c:228497:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -175933,7 +178698,7 @@ func fts5ApiSetAuxdata(tls *libc.TLS, pCtx uintptr, pPtr uintptr, xDelete uintpt return SQLITE_OK } -func fts5ApiGetAuxdata(tls *libc.TLS, pCtx uintptr, bClear int32) uintptr { /* sqlite3.c:225073:13: */ +func fts5ApiGetAuxdata(tls *libc.TLS, pCtx uintptr, bClear int32) uintptr { /* sqlite3.c:228532:13: */ var pCsr uintptr = pCtx var pData uintptr var pRet uintptr = uintptr(0) @@ -175955,7 +178720,7 @@ func fts5ApiGetAuxdata(tls *libc.TLS, pCtx uintptr, bClear int32) uintptr { /* s return pRet } -func fts5ApiPhraseNext(tls *libc.TLS, pUnused uintptr, pIter uintptr, piCol uintptr, piOff uintptr) { /* sqlite3.c:225093:13: */ +func fts5ApiPhraseNext(tls *libc.TLS, pUnused uintptr, pIter uintptr, piCol uintptr, piOff uintptr) { /* sqlite3.c:228552:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -175977,7 +178742,7 @@ func fts5ApiPhraseNext(tls *libc.TLS, pUnused uintptr, pIter uintptr, piCol uint } } -func fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:225115:12: */ +func fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:228574:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -175986,7 +178751,13 @@ func fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintpt var rc int32 = fts5CsrPoslist(tls, pCsr, iPhrase, (pIter /* &.a */), bp /* &n */) if rc == SQLITE_OK { - (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp /* n */)))) + + (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = func() uintptr { + if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 { + return ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp /* n */)))) + } + return uintptr(0) + }() *(*int32)(unsafe.Pointer(piCol)) = 0 *(*int32)(unsafe.Pointer(piOff)) = 0 fts5ApiPhraseNext(tls, pCtx, pIter, piCol, piOff) @@ -175994,7 +178765,7 @@ func fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintpt return rc } -func fts5ApiPhraseNextColumn(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol uintptr) { /* sqlite3.c:225133:13: */ +func fts5ApiPhraseNextColumn(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol uintptr) { /* sqlite3.c:228593:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -176027,7 +178798,7 @@ func fts5ApiPhraseNextColumn(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol u } } -func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr) int32 { /* sqlite3.c:225163:12: */ +func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr) int32 { /* sqlite3.c:228623:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -176052,7 +178823,13 @@ func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter rc = sqlite3Fts5ExprPhraseCollist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, (pIter /* &.a */), bp /* &n */) } if rc == SQLITE_OK { - (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp /* n */)))) + + (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = func() uintptr { + if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 { + return ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp /* n */)))) + } + return uintptr(0) + }() *(*int32)(unsafe.Pointer(piCol)) = 0 fts5ApiPhraseNextColumn(tls, pCtx, pIter, piCol) } @@ -176061,7 +178838,13 @@ func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter rc = fts5CsrPoslist(tls, pCsr, iPhrase, (pIter /* &.a */), bp+4 /* &n */) if rc == SQLITE_OK { - (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp + 4 /* n */)))) + + (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = func() uintptr { + if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 { + return ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp + 4 /* n */)))) + } + return uintptr(0) + }() if *(*int32)(unsafe.Pointer(bp + 4 /* n */)) <= 0 { *(*int32)(unsafe.Pointer(piCol)) = -1 } else if int32(*(*uint8)(unsafe.Pointer((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa))) == 0x01 { @@ -176096,10 +178879,10 @@ var sFts5Api = Fts5ExtensionApi{ FxPhraseNext: 0, FxPhraseFirstColumn: 0, FxPhraseNextColumn: 0, -} /* sqlite3.c:225211:31 */ +} /* sqlite3.c:228673:31 */ // Implementation of API function xQueryPhrase(). -func fts5ApiQueryPhrase(tls *libc.TLS, pCtx uintptr, iPhrase int32, pUserData uintptr, xCallback uintptr) int32 { /* sqlite3.c:225237:12: */ +func fts5ApiQueryPhrase(tls *libc.TLS, pCtx uintptr, iPhrase int32, pUserData uintptr, xCallback uintptr) int32 { /* sqlite3.c:228699:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -176133,14 +178916,14 @@ func fts5ApiQueryPhrase(tls *libc.TLS, pCtx uintptr, iPhrase int32, pUserData ui return rc } -func fts5ApiInvoke(tls *libc.TLS, pAux uintptr, pCsr uintptr, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:225274:13: */ +func fts5ApiInvoke(tls *libc.TLS, pAux uintptr, pCsr uintptr, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:228736:13: */ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux = pAux (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((pAux + 24 /* &.xFunc */))))(tls, uintptr(unsafe.Pointer(&sFts5Api)), pCsr, context, argc, argv) (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux = uintptr(0) } -func fts5CursorFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:225287:19: */ +func fts5CursorFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:228749:19: */ var pCsr uintptr for pCsr = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext { if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId == iCsrId { @@ -176150,7 +178933,7 @@ func fts5CursorFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { / return pCsr } -func fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:225295:13: */ +func fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:228757:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -176163,7 +178946,7 @@ func fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { pCsr = fts5CursorFromCsrid(tls, (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpGlobal, iCsrId) if (pCsr == uintptr(0)) || ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 0) { - var zErr uintptr = Xsqlite3_mprintf(tls, ts+32253 /* "no such cursor: ..." */, libc.VaList(bp, iCsrId)) + var zErr uintptr = Xsqlite3_mprintf(tls, ts+32777 /* "no such cursor: ..." */, libc.VaList(bp, iCsrId)) Xsqlite3_result_error(tls, context, zErr, -1) Xsqlite3_free(tls, zErr) } else { @@ -176173,7 +178956,7 @@ func fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // Given cursor id iId, return a pointer to the corresponding Fts5Table // object. Or NULL If the cursor id does not exist. -func sqlite3Fts5TableFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:225324:18: */ +func sqlite3Fts5TableFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:228786:18: */ var pCsr uintptr pCsr = fts5CursorFromCsrid(tls, pGlobal, iCsrId) if pCsr != 0 { @@ -176195,7 +178978,7 @@ func sqlite3Fts5TableFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintp // for phrase 0. The second (same disclaimer) contains the size of position // list 1. And so on. There is no size field for the final position list, // as it can be derived from the total size of the blob. -func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 { /* sqlite3.c:225351:12: */ +func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 { /* sqlite3.c:228813:12: */ bp := tls.Alloc(68) defer tls.Free(68) @@ -176259,7 +179042,7 @@ func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 { /* sqlit // This is the xColumn method, called by SQLite to request a value from // the row that the supplied cursor currently points to. -func fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:225408:12: */ +func fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:228870:12: */ var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig var pCsr uintptr = pCursor @@ -176299,7 +179082,7 @@ func fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) // This routine implements the xFindFunction method for the FTS3 // virtual table. -func fts5FindFunctionMethod(tls *libc.TLS, pVtab uintptr, nUnused int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:225461:12: */ +func fts5FindFunctionMethod(tls *libc.TLS, pVtab uintptr, nUnused int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:228923:12: */ var pTab uintptr = pVtab var pAux uintptr @@ -176318,12 +179101,12 @@ func fts5FindFunctionMethod(tls *libc.TLS, pVtab uintptr, nUnused int32, zName u } // Implementation of FTS5 xRename method. Rename an fts5 table. -func fts5RenameMethod(tls *libc.TLS, pVtab uintptr, zName uintptr) int32 { /* sqlite3.c:225486:12: */ +func fts5RenameMethod(tls *libc.TLS, pVtab uintptr, zName uintptr) int32 { /* sqlite3.c:228948:12: */ var pTab uintptr = pVtab return sqlite3Fts5StorageRename(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, zName) } -func sqlite3Fts5FlushToDisk(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:225494:12: */ +func sqlite3Fts5FlushToDisk(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:228956:12: */ fts5TripCursors(tls, pTab) return sqlite3Fts5StorageSync(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage) } @@ -176331,7 +179114,7 @@ func sqlite3Fts5FlushToDisk(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:22 // The xSavepoint() method. // // Flush the contents of the pending-terms table to disk. -func fts5SavepointMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:225504:12: */ +func fts5SavepointMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:228966:12: */ _ = iSavepoint // Call below is a no-op for NDEBUG builds return sqlite3Fts5FlushToDisk(tls, pVtab) @@ -176340,7 +179123,7 @@ func fts5SavepointMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { // The xRelease() method. // // This is a no-op. -func fts5ReleaseMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:225515:12: */ +func fts5ReleaseMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:228977:12: */ _ = iSavepoint // Call below is a no-op for NDEBUG builds return sqlite3Fts5FlushToDisk(tls, pVtab) @@ -176349,7 +179132,7 @@ func fts5ReleaseMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { / // The xRollbackTo() method. // // Discard the contents of the pending terms table. -func fts5RollbackToMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:225526:12: */ +func fts5RollbackToMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:228988:12: */ var pTab uintptr = pVtab _ = iSavepoint // Call below is a no-op for NDEBUG builds @@ -176358,7 +179141,7 @@ func fts5RollbackToMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 } // Register a new auxiliary function with global context pGlobal. -func fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, xFunc Fts5_extension_function, xDestroy uintptr) int32 { /* sqlite3.c:225537:12: */ +func fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, xFunc Fts5_extension_function, xDestroy uintptr) int32 { /* sqlite3.c:228999:12: */ var pGlobal uintptr = pApi var rc int32 = Xsqlite3_overload_function(tls, (*Fts5Global)(unsafe.Pointer(pGlobal)).Fdb, zName, -1) if rc == SQLITE_OK { @@ -176389,7 +179172,7 @@ func fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr // Register a new tokenizer. This is the implementation of the // fts5_api.xCreateTokenizer() method. -func fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, pTokenizer uintptr, xDestroy uintptr) int32 { /* sqlite3.c:225576:12: */ +func fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, pTokenizer uintptr, xDestroy uintptr) int32 { /* sqlite3.c:229038:12: */ var pGlobal uintptr = pApi var pNew uintptr var nName Sqlite3_int64 // Size of zName and its \0 terminator @@ -176418,7 +179201,7 @@ func fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData u return rc } -func fts5LocateTokenizer(tls *libc.TLS, pGlobal uintptr, zName uintptr) uintptr { /* sqlite3.c:225611:28: */ +func fts5LocateTokenizer(tls *libc.TLS, pGlobal uintptr, zName uintptr) uintptr { /* sqlite3.c:229073:28: */ var pMod uintptr = uintptr(0) if zName == uintptr(0) { @@ -176436,7 +179219,7 @@ func fts5LocateTokenizer(tls *libc.TLS, pGlobal uintptr, zName uintptr) uintptr // Find a tokenizer. This is the implementation of the // fts5_api.xFindTokenizer() method. -func fts5FindTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, ppUserData uintptr, pTokenizer uintptr) int32 { /* sqlite3.c:225632:12: */ +func fts5FindTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, ppUserData uintptr, pTokenizer uintptr) int32 { /* sqlite3.c:229094:12: */ var rc int32 = SQLITE_OK var pMod uintptr @@ -176452,7 +179235,7 @@ func fts5FindTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, ppUserData ui return rc } -func sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nArg int32, ppTok uintptr, ppTokApi uintptr, pzErr uintptr) int32 { /* sqlite3.c:225653:12: */ +func sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nArg int32, pConfig uintptr, pzErr uintptr) int32 { /* sqlite3.c:229115:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -176468,29 +179251,40 @@ func sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nArg if pMod == uintptr(0) { rc = SQLITE_ERROR - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32274 /* "no such tokenize..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azArg)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32798 /* "no such tokenize..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azArg)))) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pMod + 16 /* &.x */ /* &.xCreate */))))(tls, (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, (azArg + 1*8), func() int32 { - if nArg != 0 { - return (nArg - 1) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pMod + 16 /* &.x */ /* &.xCreate */))))(tls, + (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, func() uintptr { + if azArg != 0 { + return (azArg + 1*8) + } + return uintptr(0) + }(), func() int32 { + if nArg != 0 { + return (nArg - 1) + } + return 0 + }(), (pConfig + 104 /* &.pTok */)) + (*Fts5Config)(unsafe.Pointer(pConfig)).FpTokApi = (pMod + 16 /* &.x */) + if rc != SQLITE_OK { + if pzErr != 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32820 /* "error in tokeniz..." */, 0) } - return 0 - }(), ppTok) - *(*uintptr)(unsafe.Pointer(ppTokApi)) = (pMod + 16 /* &.x */) - if (rc != SQLITE_OK) && (pzErr != 0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+32296 /* "error in tokeniz..." */, 0) + } else { + (*Fts5Config)(unsafe.Pointer(pConfig)).FePattern = sqlite3Fts5TokenizerPattern(tls, + (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).Fx.FxCreate, (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok) } } if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(ppTokApi)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(ppTok)) = uintptr(0) + (*Fts5Config)(unsafe.Pointer(pConfig)).FpTokApi = uintptr(0) + (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok = uintptr(0) } return rc } -func fts5ModuleDestroy(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:225685:13: */ +func fts5ModuleDestroy(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:229152:13: */ var pTok uintptr var pNextTok uintptr var pAux uintptr @@ -176516,28 +179310,28 @@ func fts5ModuleDestroy(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:225685:13: */ Xsqlite3_free(tls, pGlobal) } -func fts5Fts5Func(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:225705:13: */ +func fts5Fts5Func(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:229172:13: */ var pGlobal uintptr = Xsqlite3_user_data(tls, pCtx) var ppApi uintptr _ = nArg - ppApi = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(apArg)), ts+32327 /* "fts5_api_ptr" */) + ppApi = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(apArg)), ts+32851 /* "fts5_api_ptr" */) if ppApi != 0 { *(*uintptr)(unsafe.Pointer(ppApi)) = (pGlobal /* &.api */) } } // Implementation of fts5_source_id() function. -func fts5SourceIdFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apUnused uintptr) { /* sqlite3.c:225721:13: */ +func fts5SourceIdFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apUnused uintptr) { /* sqlite3.c:229188:13: */ _ = nArg _ = apUnused - Xsqlite3_result_text(tls, pCtx, ts+32340 /* "fts5: 2020-08-14..." */, -1, libc.UintptrFromInt32(-1)) + Xsqlite3_result_text(tls, pCtx, ts+32864 /* "fts5: 2021-03-12..." */, -1, libc.UintptrFromInt32(-1)) } // Return true if zName is the extension on one of the shadow tables used // by this module. -func fts5ShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:225735:12: */ +func fts5ShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:229202:12: */ var i uint32 for i = uint32(0); uint64(i) < (uint64(unsafe.Sizeof(azName2)) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { if Xsqlite3_stricmp(tls, zName, azName2[i]) == 0 { @@ -176548,10 +179342,10 @@ func fts5ShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:225735:12 } var azName2 = [5]uintptr{ - ts + 32431 /* "config" */, ts + 29881 /* "content" */, ts + 22282 /* "data" */, ts + 30232 /* "docsize" */, ts + 9380, /* "idx" */ -} /* sqlite3.c:225736:21 */ + ts + 32955 /* "config" */, ts + 30405 /* "content" */, ts + 22806 /* "data" */, ts + 30756 /* "docsize" */, ts + 9745, /* "idx" */ +} /* sqlite3.c:229203:21 */ -func fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:225746:12: */ +func fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:229213:12: */ var rc int32 var pGlobal uintptr = uintptr(0) @@ -176572,7 +179366,7 @@ func fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:225746:12: */ (*Fts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxFindTokenizer = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32 }{fts5FindTokenizer})) - rc = Xsqlite3_create_module_v2(tls, db, ts+32438 /* "fts5" */, uintptr(unsafe.Pointer(&fts5Mod)), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5ModuleDestroy}))) + rc = Xsqlite3_create_module_v2(tls, db, ts+32962 /* "fts5" */, uintptr(unsafe.Pointer(&fts5Mod)), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5ModuleDestroy}))) if rc == SQLITE_OK { rc = sqlite3Fts5IndexInit(tls, db) } @@ -176590,13 +179384,13 @@ func fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:225746:12: */ } if rc == SQLITE_OK { rc = Xsqlite3_create_function(tls, - db, ts+32438 /* "fts5" */, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { + db, ts+32962 /* "fts5" */, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5Fts5Func})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { rc = Xsqlite3_create_function(tls, - db, ts+32443 /* "fts5_source_id" */, 0, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { + db, ts+32967 /* "fts5_source_id" */, 0, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5SourceIdFunc})), uintptr(0), uintptr(0)) } @@ -176634,7 +179428,7 @@ var fts5Mod = Sqlite3_module{ /* xRelease */ FxRelease: 0, /* xRollbackTo */ FxRollbackTo: 0, /* xShadowName */ FxShadowName: 0, -} /* sqlite3.c:225747:31 */ +} /* sqlite3.c:229214:31 */ // The following functions are used to register the module with SQLite. If // this module is being built as part of the SQLite core (SQLITE_CORE is @@ -176643,7 +179437,7 @@ var fts5Mod = Sqlite3_module{ // Or, if this module is being built as a loadable extension, // sqlite3Fts5Init() is omitted and the two standard entry points // sqlite3_fts_init() and sqlite3_fts5_init() defined instead. -func Xsqlite3Fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:225855:20: */ +func Xsqlite3Fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:229322:20: */ return fts5Init(tls, db) } @@ -176651,7 +179445,7 @@ func Xsqlite3Fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:225855:20: // Fts5Storage.pInsertDocsize - if they have not already been prepared. // Return SQLITE_OK if successful, or an SQLite error code if an error // occurs. -func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:225913:12: */ +func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:229380:12: */ bp := tls.Alloc(216) defer tls.Free(216) @@ -176662,20 +179456,20 @@ func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, p if *(*uintptr)(unsafe.Pointer((p + 40 /* &.aStmt */) + uintptr(eStmt)*8)) == uintptr(0) { *(*[11]uintptr)(unsafe.Pointer(bp + 128 /* azStmt */)) = [11]uintptr{ - ts + 32458, /* "SELECT %s FROM %..." */ - ts + 32526, /* "SELECT %s FROM %..." */ - ts + 32595, /* "SELECT %s FROM %..." */ // LOOKUP + ts + 32982, /* "SELECT %s FROM %..." */ + ts + 33050, /* "SELECT %s FROM %..." */ + ts + 33119, /* "SELECT %s FROM %..." */ // LOOKUP - ts + 32628, /* "INSERT INTO %Q.'..." */ // INSERT_CONTENT - ts + 32667, /* "REPLACE INTO %Q...." */ // REPLACE_CONTENT - ts + 32707, /* "DELETE FROM %Q.'..." */ // DELETE_CONTENT - ts + 32746, /* "REPLACE INTO %Q...." */ // REPLACE_DOCSIZE - ts + 32787, /* "DELETE FROM %Q.'..." */ // DELETE_DOCSIZE + ts + 33152, /* "INSERT INTO %Q.'..." */ // INSERT_CONTENT + ts + 33191, /* "REPLACE INTO %Q...." */ // REPLACE_CONTENT + ts + 33231, /* "DELETE FROM %Q.'..." */ // DELETE_CONTENT + ts + 33270, /* "REPLACE INTO %Q...." */ // REPLACE_DOCSIZE + ts + 33311, /* "DELETE FROM %Q.'..." */ // DELETE_DOCSIZE - ts + 32826, /* "SELECT sz FROM %..." */ // LOOKUP_DOCSIZE + ts + 33350, /* "SELECT sz FROM %..." */ // LOOKUP_DOCSIZE - ts + 32868, /* "REPLACE INTO %Q...." */ // REPLACE_CONFIG - ts + 32908, /* "SELECT %s FROM %..." */ // SCAN + ts + 33392, /* "REPLACE INTO %Q...." */ // REPLACE_CONFIG + ts + 33432, /* "SELECT %s FROM %..." */ // SCAN } var pC uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig var zSql uintptr = uintptr(0) @@ -176742,7 +179536,7 @@ func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, p (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FbLock-- Xsqlite3_free(tls, zSql) if (rc != SQLITE_OK) && (pzErrMsg != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+2690 /* "%s" */, libc.VaList(bp+120, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pC)).Fdb))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+2718 /* "%s" */, libc.VaList(bp+120, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pC)).Fdb))) } } } @@ -176752,7 +179546,7 @@ func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, p return rc } -func fts5ExecPrintf(tls *libc.TLS, db uintptr, pzErr uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:226016:12: */ +func fts5ExecPrintf(tls *libc.TLS, db uintptr, pzErr uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:229483:12: */ var rc int32 var ap Va_list _ = ap // ... printf arguments @@ -176774,79 +179568,79 @@ func fts5ExecPrintf(tls *libc.TLS, db uintptr, pzErr uintptr, zFormat uintptr, v // Drop all shadow tables. Return SQLITE_OK if successful or an SQLite error // code otherwise. -func sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:226044:12: */ +func sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:229511:12: */ bp := tls.Alloc(80) defer tls.Free(80) var rc int32 = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), - ts+32931, /* "DROP TABLE IF EX..." */ + ts+33455, /* "DROP TABLE IF EX..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) { rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), - ts+33035, /* "DROP TABLE IF EX..." */ + ts+33559, /* "DROP TABLE IF EX..." */ libc.VaList(bp+48, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) } if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL) { rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), - ts+33073, /* "DROP TABLE IF EX..." */ + ts+33597, /* "DROP TABLE IF EX..." */ libc.VaList(bp+64, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } -func fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail uintptr, zName uintptr) { /* sqlite3.c:226068:13: */ +func fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail uintptr, zName uintptr) { /* sqlite3.c:229535:13: */ bp := tls.Alloc(40) defer tls.Free(40) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { *(*int32)(unsafe.Pointer(pRc)) = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), - ts+33111, /* "ALTER TABLE %Q.'..." */ + ts+33635, /* "ALTER TABLE %Q.'..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } -func sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) int32 { /* sqlite3.c:226082:12: */ +func sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) int32 { /* sqlite3.c:229549:12: */ bp := tls.Alloc(4) defer tls.Free(4) var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5StorageSync(tls, pStorage) - fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+22282 /* "data" */, zName) - fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+9380 /* "idx" */, zName) - fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+32431 /* "config" */, zName) + fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+22806 /* "data" */, zName) + fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+9745 /* "idx" */, zName) + fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+32955 /* "config" */, zName) if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+30232 /* "docsize" */, zName) + fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+30756 /* "docsize" */, zName) } if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+29881 /* "content" */, zName) + fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+30405 /* "content" */, zName) } return *(*int32)(unsafe.Pointer(bp /* rc */)) } // Create the shadow table named zPost, with definition zDefn. Return // SQLITE_OK if successful, or an SQLite error code otherwise. -func sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDefn uintptr, bWithout int32, pzErr uintptr) int32 { /* sqlite3.c:226102:12: */ +func sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDefn uintptr, bWithout int32, pzErr uintptr) int32 { /* sqlite3.c:229569:12: */ bp := tls.Alloc(72) defer tls.Free(72) var rc int32 *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)) = uintptr(0) - rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, bp+64 /* &zErr */, ts+33153, /* "CREATE TABLE %Q...." */ + rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, bp+64 /* &zErr */, ts+33677, /* "CREATE TABLE %Q...." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, func() uintptr { if bWithout != 0 { - return ts + 26897 /* " WITHOUT ROWID" */ + return ts + 27421 /* " WITHOUT ROWID" */ } return ts + 703 /* "" */ }())) if *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)) != 0 { *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, - ts+33183, /* "fts5: error crea..." */ + ts+33707, /* "fts5: error crea..." */ libc.VaList(bp+40, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */))) } @@ -176859,7 +179653,7 @@ func sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDefn // // If successful, set *pp to point to the new object and return SQLITE_OK. // Otherwise, set *pp to NULL and return an SQLite error code. -func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:226137:12: */ +func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:229604:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -176888,27 +179682,27 @@ func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCre } else { var i int32 var iOff int32 - Xsqlite3_snprintf(tls, nDefn, zDefn, ts+33227 /* "id INTEGER PRIMA..." */, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, ts+33751 /* "id INTEGER PRIMA..." */, 0) iOff = int32(libc.Xstrlen(tls, zDefn)) for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ { - Xsqlite3_snprintf(tls, (nDefn - iOff), (zDefn + uintptr(iOff)), ts+33250 /* ", c%d" */, libc.VaList(bp, i)) + Xsqlite3_snprintf(tls, (nDefn - iOff), (zDefn + uintptr(iOff)), ts+33774 /* ", c%d" */, libc.VaList(bp, i)) iOff = iOff + (int32(libc.Xstrlen(tls, (zDefn + uintptr(iOff))))) } - rc = sqlite3Fts5CreateTable(tls, pConfig, ts+29881 /* "content" */, zDefn, 0, pzErr) + rc = sqlite3Fts5CreateTable(tls, pConfig, ts+30405 /* "content" */, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) { rc = sqlite3Fts5CreateTable(tls, - pConfig, ts+30232 /* "docsize" */, ts+33256 /* "id INTEGER PRIMA..." */, 0, pzErr) + pConfig, ts+30756 /* "docsize" */, ts+33780 /* "id INTEGER PRIMA..." */, 0, pzErr) } if rc == SQLITE_OK { rc = sqlite3Fts5CreateTable(tls, - pConfig, ts+32431 /* "config" */, ts+33288 /* "k PRIMARY KEY, v" */, 1, pzErr) + pConfig, ts+32955 /* "config" */, ts+33812 /* "k PRIMARY KEY, v" */, 1, pzErr) } if rc == SQLITE_OK { - rc = sqlite3Fts5StorageConfigValue(tls, p, ts+30378 /* "version" */, uintptr(0), FTS5_CURRENT_VERSION) + rc = sqlite3Fts5StorageConfigValue(tls, p, ts+30902 /* "version" */, uintptr(0), FTS5_CURRENT_VERSION) } } @@ -176920,7 +179714,7 @@ func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCre } // Close a handle opened by an earlier call to sqlite3Fts5StorageOpen(). -func sqlite3Fts5StorageClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226203:12: */ +func sqlite3Fts5StorageClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:229670:12: */ var rc int32 = SQLITE_OK if p != 0 { var i int32 @@ -176939,12 +179733,12 @@ type Fts5InsertCtx1 = struct { FpStorage uintptr FiCol int32 FszCol int32 -} /* sqlite3.c:226218:9 */ +} /* sqlite3.c:229685:9 */ -type Fts5InsertCtx = Fts5InsertCtx1 /* sqlite3.c:226218:30 */ +type Fts5InsertCtx = Fts5InsertCtx1 /* sqlite3.c:229685:30 */ // Tokenization callback used when inserting tokens into the FTS index. -func fts5StorageInsertCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:226228:12: */ +func fts5StorageInsertCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:229695:12: */ var pCtx uintptr = pContext var pIdx uintptr = (*Fts5Storage)(unsafe.Pointer((*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FpStorage)).FpIndex _ = iUnused1 @@ -176961,7 +179755,7 @@ func fts5StorageInsertCallback(tls *libc.TLS, pContext uintptr, tflags int32, pT // If a row with rowid iDel is present in the %_content table, add the // delete-markers to the FTS index necessary to delete it. Do not actually // remove the %_content row at this time though. -func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:226251:12: */ +func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:229718:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -177003,9 +179797,16 @@ func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintpt f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32 }{fts5StorageInsertCallback}))) *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((iCol-1))*8)) -= (I64((*Fts5InsertCtx)(unsafe.Pointer(bp + 8 /* &ctx */)).FszCol)) + if *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((iCol-1))*8)) < int64(0) { + rc = (SQLITE_CORRUPT | (int32(1) << 8)) + } } } - (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow-- + if (rc == SQLITE_OK) && ((*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow < int64(1)) { + rc = (SQLITE_CORRUPT | (int32(1) << 8)) + } else { + (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow-- + } rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pSeek */))) if rc == SQLITE_OK { @@ -177020,7 +179821,7 @@ func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintpt // // If there is no %_docsize table (as happens if the columnsize=0 option // is specified when the FTS5 table is created), this function is a no-op. -func fts5StorageInsertDocsize(tls *libc.TLS, p uintptr, iRowid I64, pBuf uintptr) int32 { /* sqlite3.c:226309:12: */ +func fts5StorageInsertDocsize(tls *libc.TLS, p uintptr, iRowid I64, pBuf uintptr) int32 { /* sqlite3.c:229783:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -177047,7 +179848,7 @@ func fts5StorageInsertDocsize(tls *libc.TLS, p uintptr, iRowid I64, pBuf uintptr // // Return SQLITE_OK if successful, or an SQLite error code if an error // occurs. -func fts5StorageLoadTotals(tls *libc.TLS, p uintptr, bCache int32) int32 { /* sqlite3.c:226339:12: */ +func fts5StorageLoadTotals(tls *libc.TLS, p uintptr, bCache int32) int32 { /* sqlite3.c:229813:12: */ var rc int32 = SQLITE_OK if (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid == 0 { rc = sqlite3Fts5IndexGetAverages(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, (p + 24 /* &.nTotalRow */), (*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize) @@ -177061,7 +179862,7 @@ func fts5StorageLoadTotals(tls *libc.TLS, p uintptr, bCache int32) int32 { /* sq // // Return SQLITE_OK if successful, or an SQLite error code if an error // occurs. -func fts5StorageSaveTotals(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226355:12: */ +func fts5StorageSaveTotals(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:229829:12: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -177085,7 +179886,7 @@ func fts5StorageSaveTotals(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226355 } // Remove a row from the FTS table. -func sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:226377:12: */ +func sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:229851:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -177126,7 +179927,7 @@ func sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) } // Delete all entries in the FTS5 index. -func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226418:12: */ +func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:229892:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -177138,12 +179939,12 @@ func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c: // Delete the contents of the %_data and %_docsize tables. rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), - ts+33305, /* "DELETE FROM %Q.'..." */ + ts+33829, /* "DELETE FROM %Q.'..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) { rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), - ts+33355, /* "DELETE FROM %Q.'..." */ + ts+33879, /* "DELETE FROM %Q.'..." */ libc.VaList(bp+32, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) } @@ -177153,12 +179954,12 @@ func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c: rc = sqlite3Fts5IndexReinit(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = sqlite3Fts5StorageConfigValue(tls, p, ts+30378 /* "version" */, uintptr(0), FTS5_CURRENT_VERSION) + rc = sqlite3Fts5StorageConfigValue(tls, p, ts+30902 /* "version" */, uintptr(0), FTS5_CURRENT_VERSION) } return rc } -func sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226449:12: */ +func sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:229923:12: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -177222,15 +180023,15 @@ func sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:22 return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } -func sqlite3Fts5StorageOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226504:12: */ +func sqlite3Fts5StorageOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:229978:12: */ return sqlite3Fts5IndexOptimize(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex) } -func sqlite3Fts5StorageMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:226508:12: */ +func sqlite3Fts5StorageMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:229982:12: */ return sqlite3Fts5IndexMerge(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, nMerge) } -func sqlite3Fts5StorageReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226512:12: */ +func sqlite3Fts5StorageReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:229986:12: */ return sqlite3Fts5IndexReset(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex) } @@ -177241,7 +180042,7 @@ func sqlite3Fts5StorageReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:2265 // // If the %_docsize table does not exist, SQLITE_MISMATCH is returned. In // this case the user is required to provide a rowid explicitly. -func fts5StorageNewRowid(tls *libc.TLS, p uintptr, piRowid uintptr) int32 { /* sqlite3.c:226525:12: */ +func fts5StorageNewRowid(tls *libc.TLS, p uintptr, piRowid uintptr) int32 { /* sqlite3.c:229999:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -177263,7 +180064,7 @@ func fts5StorageNewRowid(tls *libc.TLS, p uintptr, piRowid uintptr) int32 { /* s } // Insert a new row into the FTS content table. -func sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, piRowid uintptr) int32 { /* sqlite3.c:226546:12: */ +func sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, piRowid uintptr) int32 { /* sqlite3.c:230020:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -177295,7 +180096,7 @@ func sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, pi } // Insert new entries into the FTS index and %_docsize table. -func sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRowid I64) int32 { /* sqlite3.c:226581:12: */ +func sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRowid I64) int32 { /* sqlite3.c:230055:12: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -177340,7 +180141,7 @@ func sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRow return *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) } -func fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) int32 { /* sqlite3.c:226624:12: */ +func fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) int32 { /* sqlite3.c:230098:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -177348,7 +180149,7 @@ func fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var zSql uintptr var rc int32 - zSql = Xsqlite3_mprintf(tls, ts+33384, /* "SELECT count(*) ..." */ + zSql = Xsqlite3_mprintf(tls, ts+33908, /* "SELECT count(*) ..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = SQLITE_NOMEM @@ -177375,13 +180176,13 @@ type Fts5IntegrityCtx1 = struct { Fcksum U64 FpTermset uintptr FpConfig uintptr -} /* sqlite3.c:226652:9 */ +} /* sqlite3.c:230126:9 */ // Context object used by sqlite3Fts5StorageIntegrity(). -type Fts5IntegrityCtx = Fts5IntegrityCtx1 /* sqlite3.c:226652:33 */ +type Fts5IntegrityCtx = Fts5IntegrityCtx1 /* sqlite3.c:230126:33 */ // Tokenization callback used by integrity check. -func fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:226666:12: */ +func fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:230140:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -177447,18 +180248,20 @@ func fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32, // table. Return SQLITE_OK if they do, or SQLITE_CORRUPT if not. Return // some other SQLite error code if an error occurs while attempting to // determine this. -func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226736:12: */ +func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) int32 { /* sqlite3.c:230210:12: */ bp := tls.Alloc(64) defer tls.Free(64) var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig - var rc int32 // Return code - var aColSize uintptr // Array of size pConfig->nCol - var aTotalSize uintptr // Array of size pConfig->nCol + var rc int32 = SQLITE_OK // Return code + var aColSize uintptr // Array of size pConfig->nCol + var aTotalSize uintptr // Array of size pConfig->nCol // var ctx Fts5IntegrityCtx at bp, 40 // var pScan uintptr at bp+40, 8 + var bUseCksum int32 + libc.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(Fts5IntegrityCtx{}))) (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpConfig = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig aTotalSize = Xsqlite3_malloc64(tls, (uint64(uint64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) * (uint64(unsafe.Sizeof(int32(0))) + uint64(unsafe.Sizeof(I64(0))))))) @@ -177468,88 +180271,92 @@ func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c: aColSize = (aTotalSize + uintptr((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*8) libc.Xmemset(tls, aTotalSize, 0, (uint64(unsafe.Sizeof(I64(0))) * uint64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))) - // Generate the expected index checksum based on the contents of the - // %_content table. This block stores the checksum in ctx.cksum. - rc = fts5StorageGetStmt(tls, p, FTS5_STMT_SCAN, bp+40 /* &pScan */, uintptr(0)) - if rc == SQLITE_OK { - var rc2 int32 - for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */))) { - var i int32 - (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiRowid = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), 0) - (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol = 0 - if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = sqlite3Fts5StorageDocsize(tls, p, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiRowid, aColSize) - } - if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE) { - rc = sqlite3Fts5TermsetNew(tls, (bp /* &ctx */ + 24 /* &.pTermset */)) - } - for i = 0; (rc == SQLITE_OK) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ { - if *(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - continue - } - (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol = i + bUseCksum = (libc.Bool32(((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL) || + (((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_EXTERNAL) && (iArg != 0)))) + if bUseCksum != 0 { + // Generate the expected index checksum based on the contents of the + // %_content table. This block stores the checksum in ctx.cksum. + rc = fts5StorageGetStmt(tls, p, FTS5_STMT_SCAN, bp+40 /* &pScan */, uintptr(0)) + if rc == SQLITE_OK { + var rc2 int32 + for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */))) { + var i int32 + (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiRowid = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), 0) (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol = 0 - if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS { + if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { + rc = sqlite3Fts5StorageDocsize(tls, p, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiRowid, aColSize) + } + if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE) { rc = sqlite3Fts5TermsetNew(tls, (bp /* &ctx */ + 24 /* &.pTermset */)) } - if rc == SQLITE_OK { - var zText uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), (i + 1)) - var nText int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), (i + 1)) - rc = sqlite3Fts5Tokenize(tls, pConfig, - FTS5_TOKENIZE_DOCUMENT, - zText, nText, - bp, /* &ctx */ - *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32 - }{fts5StorageIntegrityCallback}))) + for i = 0; (rc == SQLITE_OK) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ { + if *(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { + continue + } + (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol = i + (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol = 0 + if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS { + rc = sqlite3Fts5TermsetNew(tls, (bp /* &ctx */ + 24 /* &.pTermset */)) + } + if rc == SQLITE_OK { + var zText uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), (i + 1)) + var nText int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), (i + 1)) + rc = sqlite3Fts5Tokenize(tls, pConfig, + FTS5_TOKENIZE_DOCUMENT, + zText, nText, + bp, /* &ctx */ + *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32 + }{fts5StorageIntegrityCallback}))) + } + if ((rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0)) && ((*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol != *(*int32)(unsafe.Pointer(aColSize + uintptr(i)*4))) { + rc = (SQLITE_CORRUPT | (int32(1) << 8)) + } + *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) += (I64((*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol)) + if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS { + sqlite3Fts5TermsetFree(tls, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset) + (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset = uintptr(0) + } } - if ((rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0)) && ((*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol != *(*int32)(unsafe.Pointer(aColSize + uintptr(i)*4))) { + sqlite3Fts5TermsetFree(tls, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset) + (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset = uintptr(0) + + if rc != SQLITE_OK { + break + } + } + rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */))) + if rc == SQLITE_OK { + rc = rc2 + } + } + + // Test that the "totals" (sometimes called "averages") record looks Ok + if rc == SQLITE_OK { + var i int32 + rc = fts5StorageLoadTotals(tls, p, 0) + for i = 0; (rc == SQLITE_OK) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ { + if *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8)) != *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) { rc = (SQLITE_CORRUPT | (int32(1) << 8)) } - *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) += (I64((*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol)) - if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS { - sqlite3Fts5TermsetFree(tls, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset) - (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset = uintptr(0) - } - } - sqlite3Fts5TermsetFree(tls, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset) - (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset = uintptr(0) - - if rc != SQLITE_OK { - break } } - rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */))) - if rc == SQLITE_OK { - rc = rc2 - } - } - // Test that the "totals" (sometimes called "averages") record looks Ok - if rc == SQLITE_OK { - var i int32 - rc = fts5StorageLoadTotals(tls, p, 0) - for i = 0; (rc == SQLITE_OK) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ { - if *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8)) != *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) { + // Check that the %_docsize and %_content tables contain the expected + // number of rows. + if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL) { + *(*I64)(unsafe.Pointer(bp + 48 /* nRow */)) = int64(0) + rc = fts5StorageCount(tls, p, ts+30405 /* "content" */, bp+48 /* &nRow */) + if (rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp + 48 /* nRow */)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow) { rc = (SQLITE_CORRUPT | (int32(1) << 8)) } } - } - - // Check that the %_docsize and %_content tables contain the expected - // number of rows. - if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL) { - *(*I64)(unsafe.Pointer(bp + 48 /* nRow */)) = int64(0) - rc = fts5StorageCount(tls, p, ts+29881 /* "content" */, bp+48 /* &nRow */) - if (rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp + 48 /* nRow */)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow) { - rc = (SQLITE_CORRUPT | (int32(1) << 8)) - } - } - if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) { - *(*I64)(unsafe.Pointer(bp + 56 /* nRow */)) = int64(0) - rc = fts5StorageCount(tls, p, ts+30232 /* "docsize" */, bp+56 /* &nRow */) - if (rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp + 56 /* nRow */)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow) { - rc = (SQLITE_CORRUPT | (int32(1) << 8)) + if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) { + *(*I64)(unsafe.Pointer(bp + 56 /* nRow */)) = int64(0) + rc = fts5StorageCount(tls, p, ts+30756 /* "docsize" */, bp+56 /* &nRow */) + if (rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp + 56 /* nRow */)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow) { + rc = (SQLITE_CORRUPT | (int32(1) << 8)) + } } } @@ -177557,7 +180364,7 @@ func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c: // verify, amongst other things, that it matches the checksum generated by // inspecting the index itself. if rc == SQLITE_OK { - rc = sqlite3Fts5IndexIntegrityCheck(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).Fcksum) + rc = sqlite3Fts5IndexIntegrityCheck(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).Fcksum, bUseCksum) } Xsqlite3_free(tls, aTotalSize) @@ -177566,7 +180373,7 @@ func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c: // Obtain an SQLite statement handle that may be used to read data from the // %_content table. -func sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:226838:12: */ +func sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:230318:12: */ var rc int32 rc = fts5StorageGetStmt(tls, p, eStmt, pp, pzErrMsg) @@ -177580,7 +180387,7 @@ func sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, p // Release an SQLite statement handle obtained via an earlier call to // sqlite3Fts5StorageStmt(). The eStmt parameter passed to this function // must match that passed to the sqlite3Fts5StorageStmt() call. -func sqlite3Fts5StorageStmtRelease(tls *libc.TLS, p uintptr, eStmt int32, pStmt uintptr) { /* sqlite3.c:226862:13: */ +func sqlite3Fts5StorageStmtRelease(tls *libc.TLS, p uintptr, eStmt int32, pStmt uintptr) { /* sqlite3.c:230342:13: */ if *(*uintptr)(unsafe.Pointer((p + 40 /* &.aStmt */) + uintptr(eStmt)*8)) == uintptr(0) { Xsqlite3_reset(tls, pStmt) @@ -177590,7 +180397,7 @@ func sqlite3Fts5StorageStmtRelease(tls *libc.TLS, p uintptr, eStmt int32, pStmt } } -func fts5StorageDecodeSizeArray(tls *libc.TLS, aCol uintptr, nCol int32, aBlob uintptr, nBlob int32) int32 { /* sqlite3.c:226879:12: */ +func fts5StorageDecodeSizeArray(tls *libc.TLS, aCol uintptr, nCol int32, aBlob uintptr, nBlob int32) int32 { /* sqlite3.c:230359:12: */ var i int32 var iOff int32 = 0 for i = 0; i < nCol; i++ { @@ -177608,7 +180415,7 @@ func fts5StorageDecodeSizeArray(tls *libc.TLS, aCol uintptr, nCol int32, aBlob u // // An SQLite error code is returned if an error occurs, or SQLITE_OK // otherwise. -func sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid I64, aCol uintptr) int32 { /* sqlite3.c:226900:12: */ +func sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid I64, aCol uintptr) int32 { /* sqlite3.c:230380:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -177636,7 +180443,7 @@ func sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid I64, aCol uintpt return rc } -func sqlite3Fts5StorageSize(tls *libc.TLS, p uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:226926:12: */ +func sqlite3Fts5StorageSize(tls *libc.TLS, p uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:230406:12: */ var rc int32 = fts5StorageLoadTotals(tls, p, 0) if rc == SQLITE_OK { *(*I64)(unsafe.Pointer(pnToken)) = int64(0) @@ -177654,7 +180461,7 @@ func sqlite3Fts5StorageSize(tls *libc.TLS, p uintptr, iCol int32, pnToken uintpt return rc } -func sqlite3Fts5StorageRowCount(tls *libc.TLS, p uintptr, pnRow uintptr) int32 { /* sqlite3.c:226944:12: */ +func sqlite3Fts5StorageRowCount(tls *libc.TLS, p uintptr, pnRow uintptr) int32 { /* sqlite3.c:230424:12: */ var rc int32 = fts5StorageLoadTotals(tls, p, 0) if rc == SQLITE_OK { // nTotalRow being zero does not necessarily indicate a corrupt @@ -177671,7 +180478,7 @@ func sqlite3Fts5StorageRowCount(tls *libc.TLS, p uintptr, pnRow uintptr) int32 { } // Flush any data currently held in-memory to disk. -func sqlite3Fts5StorageSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226961:12: */ +func sqlite3Fts5StorageSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:230441:12: */ var rc int32 = SQLITE_OK var iLastRowid I64 = Xsqlite3_last_insert_rowid(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).Fdb) if (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid != 0 { @@ -177685,12 +180492,12 @@ func sqlite3Fts5StorageSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:22696 return rc } -func sqlite3Fts5StorageRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226975:12: */ +func sqlite3Fts5StorageRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:230455:12: */ (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 return sqlite3Fts5IndexRollback(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex) } -func sqlite3Fts5StorageConfigValue(tls *libc.TLS, p uintptr, z uintptr, pVal uintptr, iVal int32) int32 { /* sqlite3.c:226980:12: */ +func sqlite3Fts5StorageConfigValue(tls *libc.TLS, p uintptr, z uintptr, pVal uintptr, iVal int32) int32 { /* sqlite3.c:230460:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -177745,13 +180552,13 @@ var aAsciiTokenChar = [128]uint8{ uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // 0x50..0x5F uint8(0), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), // 0x60..0x6F uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // 0x70..0x7F -} /* sqlite3.c:227033:22 */ +} /* sqlite3.c:230513:22 */ -type AsciiTokenizer1 = struct{ FaTokenChar [128]uint8 } /* sqlite3.c:227044:9 */ +type AsciiTokenizer1 = struct{ FaTokenChar [128]uint8 } /* sqlite3.c:230524:9 */ -type AsciiTokenizer = AsciiTokenizer1 /* sqlite3.c:227044:31 */ +type AsciiTokenizer = AsciiTokenizer1 /* sqlite3.c:230524:31 */ -func fts5AsciiAddExceptions(tls *libc.TLS, p uintptr, zArg uintptr, bTokenChars int32) { /* sqlite3.c:227049:13: */ +func fts5AsciiAddExceptions(tls *libc.TLS, p uintptr, zArg uintptr, bTokenChars int32) { /* sqlite3.c:230529:13: */ var i int32 for i = 0; *(*int8)(unsafe.Pointer(zArg + uintptr(i))) != 0; i++ { if (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) & 0x80) == 0 { @@ -177761,12 +180568,12 @@ func fts5AsciiAddExceptions(tls *libc.TLS, p uintptr, zArg uintptr, bTokenChars } // Delete a "ascii" tokenizer. -func fts5AsciiDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:227065:13: */ +func fts5AsciiDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:230545:13: */ Xsqlite3_free(tls, p) } // Create an "ascii" tokenizer. -func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:227072:12: */ +func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:230552:12: */ var rc int32 = SQLITE_OK var p uintptr = uintptr(0) _ = pUnused @@ -177782,9 +180589,9 @@ func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, libc.Xmemcpy(tls, p /* &.aTokenChar */, uintptr(unsafe.Pointer(&aAsciiTokenChar)), uint64(unsafe.Sizeof(aAsciiTokenChar))) for i = 0; (rc == SQLITE_OK) && (i < nArg); i = i + (2) { var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33416 /* "tokenchars" */) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33940 /* "tokenchars" */) { fts5AsciiAddExceptions(tls, p, zArg, 1) - } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33427 /* "separators" */) { + } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33951 /* "separators" */) { fts5AsciiAddExceptions(tls, p, zArg, 0) } else { rc = SQLITE_ERROR @@ -177801,7 +180608,7 @@ func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, return rc } -func asciiFold(tls *libc.TLS, aOut uintptr, aIn uintptr, nByte int32) { /* sqlite3.c:227113:13: */ +func asciiFold(tls *libc.TLS, aOut uintptr, aIn uintptr, nByte int32) { /* sqlite3.c:230593:13: */ var i int32 for i = 0; i < nByte; i++ { var c int8 = *(*int8)(unsafe.Pointer(aIn + uintptr(i))) @@ -177813,7 +180620,7 @@ func asciiFold(tls *libc.TLS, aOut uintptr, aIn uintptr, nByte int32) { /* sqlit } // Tokenize some text using the ascii tokenizer. -func fts5AsciiTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:227125:12: */ +func fts5AsciiTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:230605:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -177892,7 +180699,7 @@ type Unicode61Tokenizer1 = struct { _ [4]byte FaiException uintptr FaCategory [32]uint8 -} /* sqlite3.c:227240:9 */ +} /* sqlite3.c:230720:9 */ // ************************************************************************* // @@ -177902,11 +180709,11 @@ type Unicode61Tokenizer1 = struct { // from the sqlite3 source file utf.c. If this file is compiled as part // of the amalgamation, they are not required. -type Unicode61Tokenizer = Unicode61Tokenizer1 /* sqlite3.c:227240:35 */ +type Unicode61Tokenizer = Unicode61Tokenizer1 /* sqlite3.c:230720:35 */ // Values for eRemoveDiacritic (must match internals of fts5_unicode2.c) -func fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars int32) int32 { /* sqlite3.c:227257:12: */ +func fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars int32) int32 { /* sqlite3.c:230737:12: */ var rc int32 = SQLITE_OK var n int32 = int32(libc.Xstrlen(tls, z)) var aNew uintptr @@ -177961,7 +180768,7 @@ func fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars i } // Return true if the p->aiException[] array contains the value iCode. -func fts5UnicodeIsException(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:227307:12: */ +func fts5UnicodeIsException(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:230787:12: */ if (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException > 0 { var a uintptr = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException var iLo int32 = 0 @@ -177983,7 +180790,7 @@ func fts5UnicodeIsException(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sq } // Delete a "unicode61" tokenizer. -func fts5UnicodeDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:227331:13: */ +func fts5UnicodeDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:230811:13: */ if pTok != 0 { var p uintptr = pTok Xsqlite3_free(tls, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException) @@ -177993,7 +180800,7 @@ func fts5UnicodeDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:227331:13: */ return } -func unicodeSetCategories(tls *libc.TLS, p uintptr, zCat uintptr) int32 { /* sqlite3.c:227341:12: */ +func unicodeSetCategories(tls *libc.TLS, p uintptr, zCat uintptr) int32 { /* sqlite3.c:230821:12: */ var z uintptr = zCat for *(*int8)(unsafe.Pointer(z)) != 0 { @@ -178013,7 +180820,7 @@ func unicodeSetCategories(tls *libc.TLS, p uintptr, zCat uintptr) int32 { /* sql } // Create a "unicode61" tokenizer. -func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:227359:12: */ +func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:230839:12: */ var rc int32 = SQLITE_OK // Return code var p uintptr = uintptr(0) // New tokenizer object @@ -178024,7 +180831,7 @@ func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32 } else { p = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Unicode61Tokenizer{}))) if p != 0 { - var zCat uintptr = ts + 33438 /* "L* N* Co" */ + var zCat uintptr = ts + 33962 /* "L* N* Co" */ var i int32 libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Unicode61Tokenizer{}))) @@ -178037,7 +180844,7 @@ func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32 // Search for a "categories" argument for i = 0; (rc == SQLITE_OK) && (i < nArg); i = i + (2) { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33447 /* "categories" */) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33971 /* "categories" */) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8)) } } @@ -178048,18 +180855,18 @@ func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32 for i = 0; (rc == SQLITE_OK) && (i < nArg); i = i + (2) { var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33458 /* "remove_diacritic..." */) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33982 /* "remove_diacritic..." */) { if (((int32(*(*int8)(unsafe.Pointer(zArg))) != '0') && (int32(*(*int8)(unsafe.Pointer(zArg))) != '1')) && (int32(*(*int8)(unsafe.Pointer(zArg))) != '2')) || (*(*int8)(unsafe.Pointer(zArg + 1)) != 0) { rc = SQLITE_ERROR } else { (*Unicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = (int32(*(*int8)(unsafe.Pointer(zArg))) - '0') } - } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33416 /* "tokenchars" */) { + } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33940 /* "tokenchars" */) { rc = fts5UnicodeAddExceptions(tls, p, zArg, 1) - } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33427 /* "separators" */) { + } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33951 /* "separators" */) { rc = fts5UnicodeAddExceptions(tls, p, zArg, 0) - } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33447 /* "categories" */) { + } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+33971 /* "categories" */) { // no-op } else { rc = SQLITE_ERROR @@ -178081,12 +180888,12 @@ func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32 // Return true if, for the purposes of tokenizing with the tokenizer // passed as the first argument, codepoint iCode is considered a token // character (not a separator). -func fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:227439:12: */ +func fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:230919:12: */ return (int32(*(*uint8)(unsafe.Pointer((p + 160 /* &.aCategory */) + uintptr(sqlite3Fts5UnicodeCategory(tls, U32(iCode)))))) ^ fts5UnicodeIsException(tls, p, iCode)) } -func fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:227446:12: */ +func fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:230926:12: */ var p uintptr var rc int32 var a uintptr @@ -178340,7 +181147,7 @@ type PorterTokenizer1 = struct { Ftokenizer Fts5_tokenizer FpTokenizer uintptr FaBuf [128]int8 -} /* sqlite3.c:227558:9 */ +} /* sqlite3.c:231038:9 */ // ************************************************************************* // @@ -178349,10 +181156,10 @@ type PorterTokenizer1 = struct { // Any tokens larger than this (in bytes) are passed through without // stemming. -type PorterTokenizer = PorterTokenizer1 /* sqlite3.c:227558:32 */ +type PorterTokenizer = PorterTokenizer1 /* sqlite3.c:231038:32 */ // Delete a "porter" tokenizer. -func fts5PorterDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:227568:13: */ +func fts5PorterDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:231048:13: */ if pTok != 0 { var p uintptr = pTok if (*PorterTokenizer)(unsafe.Pointer(p)).FpTokenizer != 0 { @@ -178363,7 +181170,7 @@ func fts5PorterDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:227568:13: */ } // Create a "porter" tokenizer. -func fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:227581:12: */ +func fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:231061:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -178371,7 +181178,7 @@ func fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, pp var rc int32 = SQLITE_OK var pRet uintptr *(*uintptr)(unsafe.Pointer(bp /* pUserdata */)) = uintptr(0) - var zBase uintptr = ts + 33476 /* "unicode61" */ + var zBase uintptr = ts + 34000 /* "unicode61" */ if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -178412,9 +181219,9 @@ type PorterContext1 = struct { FpCtx uintptr FxToken uintptr FaBuf uintptr -} /* sqlite3.c:227617:9 */ +} /* sqlite3.c:231097:9 */ -type PorterContext = PorterContext1 /* sqlite3.c:227617:30 */ +type PorterContext = PorterContext1 /* sqlite3.c:231097:30 */ type PorterRule1 = struct { FzSuffix uintptr @@ -178424,15 +181231,15 @@ type PorterRule1 = struct { FzOutput uintptr FnOutput int32 _ [4]byte -} /* sqlite3.c:227624:9 */ +} /* sqlite3.c:231104:9 */ -type PorterRule = PorterRule1 /* sqlite3.c:227624:27 */ +type PorterRule = PorterRule1 /* sqlite3.c:231104:27 */ -func fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) int32 { /* sqlite3.c:227659:12: */ +func fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) int32 { /* sqlite3.c:231139:12: */ return (libc.Bool32((((((int32(c) == 'a') || (int32(c) == 'e')) || (int32(c) == 'i')) || (int32(c) == 'o')) || (int32(c) == 'u')) || ((bYIsVowel != 0) && (int32(c) == 'y')))) } -func fts5PorterGobbleVC(tls *libc.TLS, zStem uintptr, nStem int32, bPrevCons int32) int32 { /* sqlite3.c:227665:12: */ +func fts5PorterGobbleVC(tls *libc.TLS, zStem uintptr, nStem int32, bPrevCons int32) int32 { /* sqlite3.c:231145:12: */ var i int32 var bCons int32 = bPrevCons @@ -178453,12 +181260,12 @@ func fts5PorterGobbleVC(tls *libc.TLS, zStem uintptr, nStem int32, bPrevCons int } // porter rule condition: (m > 0) -func fts5Porter_MGt0(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227682:12: */ +func fts5Porter_MGt0(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:231162:12: */ return libc.BoolInt32(!(!(fts5PorterGobbleVC(tls, zStem, nStem, 0) != 0))) } // porter rule condition: (m > 1) -func fts5Porter_MGt1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227687:12: */ +func fts5Porter_MGt1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:231167:12: */ var n int32 n = fts5PorterGobbleVC(tls, zStem, nStem, 0) if (n != 0) && (fts5PorterGobbleVC(tls, (zStem+uintptr(n)), (nStem-n), 1) != 0) { @@ -178468,7 +181275,7 @@ func fts5Porter_MGt1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlit } // porter rule condition: (m = 1) -func fts5Porter_MEq1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227697:12: */ +func fts5Porter_MEq1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:231177:12: */ var n int32 n = fts5PorterGobbleVC(tls, zStem, nStem, 0) if (n != 0) && (0 == fts5PorterGobbleVC(tls, (zStem+uintptr(n)), (nStem-n), 1)) { @@ -178478,7 +181285,7 @@ func fts5Porter_MEq1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlit } // porter rule condition: (*o) -func fts5Porter_Ostar(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227707:12: */ +func fts5Porter_Ostar(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:231187:12: */ if ((int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 'w') || (int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 'x')) || (int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 'y') { return 0 } else { @@ -178496,14 +181303,14 @@ func fts5Porter_Ostar(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqli } // porter rule condition: (m > 1 and (*S or *T)) -func fts5Porter_MGt1_and_S_or_T(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227724:12: */ +func fts5Porter_MGt1_and_S_or_T(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:231204:12: */ return (libc.Bool32(((int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 's') || (int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 't')) && (fts5Porter_MGt1(tls, zStem, nStem) != 0))) } // porter rule condition: (*v*) -func fts5Porter_Vowel(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227731:12: */ +func fts5Porter_Vowel(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:231211:12: */ var i int32 for i = 0; i < nStem; i++ { if fts5PorterIsVowel(tls, *(*int8)(unsafe.Pointer(zStem + uintptr(i))), (libc.Bool32(i > 0))) != 0 { @@ -178518,13 +181325,13 @@ func fts5Porter_Vowel(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqli // // GENERATED CODE STARTS HERE (mkportersteps.tcl) -func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:227747:12: */ +func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:231227:12: */ var ret int32 = 0 var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) { case 'a': - if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+33486 /* "al" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+34010 /* "al" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2) } @@ -178532,11 +181339,11 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'c': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+33489 /* "ance" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+34013 /* "ance" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4) } - } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+33494 /* "ence" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+34018 /* "ence" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4) } @@ -178544,7 +181351,7 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'e': - if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+33499 /* "er" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+34023 /* "er" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2) } @@ -178552,7 +181359,7 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'i': - if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+33502 /* "ic" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+34026 /* "ic" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2) } @@ -178560,11 +181367,11 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'l': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+33505 /* "able" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+34029 /* "able" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4) } - } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+33510 /* "ible" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+34034 /* "ible" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4) } @@ -178572,19 +181379,19 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'n': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33515 /* "ant" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34039 /* "ant" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } - } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+33519 /* "ement" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+34043 /* "ement" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 5) } - } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+33525 /* "ment" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+34049 /* "ment" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4) } - } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33530 /* "ent" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34054 /* "ent" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -178592,11 +181399,11 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'o': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33534 /* "ion" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34058 /* "ion" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1_and_S_or_T(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } - } else if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+33538 /* "ou" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + } else if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+34062 /* "ou" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2) } @@ -178604,7 +181411,7 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 's': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33541 /* "ism" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34065 /* "ism" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -178612,11 +181419,11 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 't': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33545 /* "ate" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34069 /* "ate" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } - } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33549 /* "iti" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34073 /* "iti" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -178624,7 +181431,7 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'u': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33553 /* "ous" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34077 /* "ous" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -178632,7 +181439,7 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'v': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33557 /* "ive" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34081 /* "ive" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -178640,7 +181447,7 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'z': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33561 /* "ize" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34085 /* "ize" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -178651,30 +181458,30 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli return ret } -func fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:227881:12: */ +func fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:231361:12: */ var ret int32 = 0 var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) { case 'a': - if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+33565 /* "at" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+33545 /* "ate" */, uint64(3)) + if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+34089 /* "at" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+34069 /* "ate" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 2) + 3) ret = 1 } break case 'b': - if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+33568 /* "bl" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+33571 /* "ble" */, uint64(3)) + if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+34092 /* "bl" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+34095 /* "ble" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 2) + 3) ret = 1 } break case 'i': - if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+33575 /* "iz" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+33561 /* "ize" */, uint64(3)) + if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+34099 /* "iz" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+34085 /* "ize" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 2) + 3) ret = 1 } @@ -178684,143 +181491,143 @@ func fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sq return ret } -func fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:227915:12: */ +func fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:231395:12: */ var ret int32 = 0 var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) { case 'a': - if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+33578 /* "ational" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { + if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+34102 /* "ational" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+33545 /* "ate" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+34069 /* "ate" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3) } - } else if (nBuf > 6) && (0 == libc.Xmemcmp(tls, ts+33586 /* "tional" */, (aBuf+uintptr((nBuf-6))), uint64(6))) { + } else if (nBuf > 6) && (0 == libc.Xmemcmp(tls, ts+34110 /* "tional" */, (aBuf+uintptr((nBuf-6))), uint64(6))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-6)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 6))), ts+33593 /* "tion" */, uint64(4)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 6))), ts+34117 /* "tion" */, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 6) + 4) } } break case 'c': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+33598 /* "enci" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+34122 /* "enci" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+33494 /* "ence" */, uint64(4)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+34018 /* "ence" */, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 4) } - } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+33603 /* "anci" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+34127 /* "anci" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+33489 /* "ance" */, uint64(4)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+34013 /* "ance" */, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 4) } } break case 'e': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+33608 /* "izer" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+34132 /* "izer" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+33561 /* "ize" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+34085 /* "ize" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 3) } } break case 'g': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+33613 /* "logi" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+34137 /* "logi" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+13886 /* "log" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+14315 /* "log" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 3) } } break case 'l': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33618 /* "bli" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34142 /* "bli" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+33571 /* "ble" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+34095 /* "ble" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 3) + 3) } - } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+33622 /* "alli" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+34146 /* "alli" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+33486 /* "al" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+34010 /* "al" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 2) } - } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+33627 /* "entli" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+34151 /* "entli" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+33530 /* "ent" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+34054 /* "ent" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3) } - } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33633 /* "eli" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34157 /* "eli" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+33637 /* "e" */, uint64(1)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+34161 /* "e" */, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 3) + 1) } - } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+33639 /* "ousli" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+34163 /* "ousli" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+33553 /* "ous" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+34077 /* "ous" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3) } } break case 'o': - if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+33645 /* "ization" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { + if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+34169 /* "ization" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+33561 /* "ize" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+34085 /* "ize" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3) } - } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+33653 /* "ation" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+34177 /* "ation" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+33545 /* "ate" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+34069 /* "ate" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3) } - } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+33659 /* "ator" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+34183 /* "ator" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+33545 /* "ate" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+34069 /* "ate" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 3) } } break case 's': - if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+33664 /* "alism" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+34188 /* "alism" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+33486 /* "al" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+34010 /* "al" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2) } - } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+33670 /* "iveness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { + } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+34194 /* "iveness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+33557 /* "ive" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+34081 /* "ive" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3) } - } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+33678 /* "fulness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { + } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+34202 /* "fulness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+33686 /* "ful" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+34210 /* "ful" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3) } - } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+33690 /* "ousness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { + } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+34214 /* "ousness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+33553 /* "ous" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+34077 /* "ous" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3) } } break case 't': - if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+33698 /* "aliti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+34222 /* "aliti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+33486 /* "al" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+34010 /* "al" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2) } - } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+33704 /* "iviti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+34228 /* "iviti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+33557 /* "ive" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+34081 /* "ive" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3) } - } else if (nBuf > 6) && (0 == libc.Xmemcmp(tls, ts+33710 /* "biliti" */, (aBuf+uintptr((nBuf-6))), uint64(6))) { + } else if (nBuf > 6) && (0 == libc.Xmemcmp(tls, ts+34234 /* "biliti" */, (aBuf+uintptr((nBuf-6))), uint64(6))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-6)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 6))), ts+33571 /* "ble" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 6))), ts+34095 /* "ble" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 6) + 3) } } @@ -178830,22 +181637,22 @@ func fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli return ret } -func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:228062:12: */ +func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:231542:12: */ var ret int32 = 0 var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) { case 'a': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+33717 /* "ical" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+34241 /* "ical" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+33502 /* "ic" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+34026 /* "ic" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 2) } } break case 's': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+33722 /* "ness" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+34246 /* "ness" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4) } @@ -178853,21 +181660,21 @@ func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 't': - if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+33727 /* "icate" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+34251 /* "icate" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+33502 /* "ic" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+34026 /* "ic" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2) } - } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+33733 /* "iciti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+34257 /* "iciti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+33502 /* "ic" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+34026 /* "ic" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2) } } break case 'u': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33686 /* "ful" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34210 /* "ful" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -178875,7 +181682,7 @@ func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'v': - if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+33739 /* "ative" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+34263 /* "ative" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 5) } @@ -178883,9 +181690,9 @@ func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'z': - if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+33745 /* "alize" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+34269 /* "alize" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+33486 /* "al" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+34010 /* "al" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2) } } @@ -178895,18 +181702,18 @@ func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli return ret } -func fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:228128:12: */ +func fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:231608:12: */ var ret int32 = 0 var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) { case 'e': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33751 /* "eed" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34275 /* "eed" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+33755 /* "ee" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+34279 /* "ee" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 3) + 2) } - } else if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+33758 /* "ed" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + } else if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+34282 /* "ed" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { if fts5Porter_Vowel(tls, aBuf, (nBuf-2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2) ret = 1 @@ -178915,7 +181722,7 @@ func fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sql break case 'n': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+33761 /* "ing" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+34285 /* "ing" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_Vowel(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) ret = 1 @@ -178932,7 +181739,7 @@ func fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sql // // -func fts5PorterStep1A(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) { /* sqlite3.c:228165:13: */ +func fts5PorterStep1A(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) { /* sqlite3.c:231645:13: */ var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf)) if int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 1))))) == 's' { if int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) == 'e' { @@ -178948,7 +181755,7 @@ func fts5PorterStep1A(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) { /* sqlite3.c } } -func fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iStart int32, iEnd int32) int32 { /* sqlite3.c:228183:12: */ +func fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iStart int32, iEnd int32) int32 { /* sqlite3.c:231663:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -179042,7 +181849,7 @@ pass_through: } // Tokenize using the porter tokenizer. -func fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:228252:12: */ +func fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:231732:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -179058,33 +181865,249 @@ func fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags i }{fts5PorterCb}))) } -// Register all built-in tokenizers with FTS5. -func sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:228272:12: */ - bp := tls.Alloc(96) - defer tls.Free(96) +// ************************************************************************* +// +// Start of trigram implementation. +type TrigramTokenizer1 = struct{ FbFold int32 } /* sqlite3.c:231752:9 */ - *(*[3]BuiltinTokenizer)(unsafe.Pointer(bp /* aBuiltin */)) = [3]BuiltinTokenizer{ - {FzName: ts + 33476 /* "unicode61" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { +// ************************************************************************* +// +// Start of trigram implementation. +type TrigramTokenizer = TrigramTokenizer1 /* sqlite3.c:231752:33 */ + +// Free a trigram tokenizer. +func fts5TriDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:231760:13: */ + Xsqlite3_free(tls, p) +} + +// Allocate a trigram tokenizer. +func fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:231767:12: */ + var rc int32 = SQLITE_OK + var pNew uintptr = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(TrigramTokenizer{}))) + _ = pUnused + if pNew == uintptr(0) { + rc = SQLITE_NOMEM + } else { + var i int32 + (*TrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = 1 + for i = 0; (rc == SQLITE_OK) && (i < nArg); i = i + (2) { + var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8)) + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+34289 /* "case_sensitive" */) { + if ((int32(*(*int8)(unsafe.Pointer(zArg))) != '0') && (int32(*(*int8)(unsafe.Pointer(zArg))) != '1')) || (*(*int8)(unsafe.Pointer(zArg + 1)) != 0) { + rc = SQLITE_ERROR + } else { + (*TrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(zArg))) == '0')) + } + } else { + rc = SQLITE_ERROR + } + } + if rc != SQLITE_OK { + fts5TriDelete(tls, pNew) + pNew = uintptr(0) + } + } + *(*uintptr)(unsafe.Pointer(ppOut)) = pNew + return rc +} + +// Trigram tokenizer tokenize routine. +func fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:231805:12: */ + bp := tls.Alloc(32) + defer tls.Free(32) + + var p uintptr = pTok + var rc int32 = SQLITE_OK + // var aBuf [32]int8 at bp, 32 + + var zIn uintptr = pText + var zEof uintptr = (zIn + uintptr(nText)) + var iCode U32 + + _ = unusedFlags + for 1 != 0 { + var zOut uintptr = bp /* aBuf */ + var iStart int32 = (int32((int64(zIn) - int64(pText)) / 1)) + var zNext uintptr + + iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))) + if iCode >= U32(0xc0) { + iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))]) + for (zIn != zEof) && ((int32(*(*uint8)(unsafe.Pointer(zIn))) & 0xc0) == 0x80) { + iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))))) + } + if ((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE)) { + iCode = U32(0xFFFD) + } + } + + if iCode == U32(0) { + break + } + zNext = zIn + if zIn < zEof { + if (*TrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { + iCode = U32(sqlite3Fts5UnicodeFold(tls, int32(iCode), 0)) + } + { + if iCode < U32(0x00080) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8((U8(iCode & U32(0xFF)))) + } else if iCode < U32(0x00800) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xC0 + int32((U8((iCode >> 6) & U32(0x1F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } else if iCode < U32(0x10000) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xE0 + int32((U8((iCode >> 12) & U32(0x0F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } else { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xF0 + int32((U8((iCode >> 18) & U32(0x07)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 12) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } + } + + iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))) + if iCode >= U32(0xc0) { + iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))]) + for (zIn != zEof) && ((int32(*(*uint8)(unsafe.Pointer(zIn))) & 0xc0) == 0x80) { + iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))))) + } + if ((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE)) { + iCode = U32(0xFFFD) + } + } + + if iCode == U32(0) { + break + } + } else { + break + } + if zIn < zEof { + if (*TrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { + iCode = U32(sqlite3Fts5UnicodeFold(tls, int32(iCode), 0)) + } + { + if iCode < U32(0x00080) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8((U8(iCode & U32(0xFF)))) + } else if iCode < U32(0x00800) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xC0 + int32((U8((iCode >> 6) & U32(0x1F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } else if iCode < U32(0x10000) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xE0 + int32((U8((iCode >> 12) & U32(0x0F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } else { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xF0 + int32((U8((iCode >> 18) & U32(0x07)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 12) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } + } + + iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))) + if iCode >= U32(0xc0) { + iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))]) + for (zIn != zEof) && ((int32(*(*uint8)(unsafe.Pointer(zIn))) & 0xc0) == 0x80) { + iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))))) + } + if ((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE)) { + iCode = U32(0xFFFD) + } + } + + if iCode == U32(0) { + break + } + if (*TrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { + iCode = U32(sqlite3Fts5UnicodeFold(tls, int32(iCode), 0)) + } + { + if iCode < U32(0x00080) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8((U8(iCode & U32(0xFF)))) + } else if iCode < U32(0x00800) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xC0 + int32((U8((iCode >> 6) & U32(0x1F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } else if iCode < U32(0x10000) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xE0 + int32((U8((iCode >> 12) & U32(0x0F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } else { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xF0 + int32((U8((iCode >> 18) & U32(0x07)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 12) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } + } + + } else { + break + } + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&xToken)))(tls, pCtx, 0, bp /* &aBuf[0] */, (int32(int64((zOut - bp /* &aBuf[0] */) / 1))), iStart, (int32(int64(((uintptr(iStart) + zOut) - bp /* &aBuf[0] */) / 1)))) + if rc != SQLITE_OK { + break + } + zIn = zNext + } + + return rc +} + +// Argument xCreate is a pointer to a constructor function for a tokenizer. +// pTok is a tokenizer previously created using the same method. This function +// returns one of FTS5_PATTERN_NONE, FTS5_PATTERN_LIKE or FTS5_PATTERN_GLOB +// indicating the style of pattern matching that the tokenizer can support. +// In practice, this is: +// +// "trigram" tokenizer, case_sensitive=1 - FTS5_PATTERN_GLOB +// "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE +// all other tokenizers - FTS5_PATTERN_NONE +func sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) int32 { /* sqlite3.c:231865:12: */ + if xCreate == *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 + }{fts5TriCreate})) { + var p uintptr = pTok + if (*TrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { + return FTS5_PATTERN_LIKE + } + return FTS5_PATTERN_GLOB + } + return FTS5_PATTERN_NONE +} + +// Register all built-in tokenizers with FTS5. +func sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:231879:12: */ + bp := tls.Alloc(128) + defer tls.Free(128) + + *(*[4]BuiltinTokenizer)(unsafe.Pointer(bp /* aBuiltin */)) = [4]BuiltinTokenizer{ + {FzName: ts + 34000 /* "unicode61" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{fts5UnicodeCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5UnicodeDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32 }{fts5UnicodeTokenize}))}}, - {FzName: ts + 33765 /* "ascii" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 34304 /* "ascii" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{fts5AsciiCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5AsciiDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32 }{fts5AsciiTokenize}))}}, - {FzName: ts + 33771 /* "porter" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 34310 /* "porter" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{fts5PorterCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5PorterDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32 }{fts5PorterTokenize}))}}, + {FzName: ts + 34317 /* "trigram" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 + }{fts5TriCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5TriDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32 + }{fts5TriTokenize}))}}, } var rc int32 = SQLITE_OK // Return code var i int32 // To iterate through builtin functions - for i = 0; (rc == SQLITE_OK) && (i < (int32(uint64(unsafe.Sizeof([3]BuiltinTokenizer{})) / uint64(unsafe.Sizeof(BuiltinTokenizer{}))))); i++ { + for i = 0; (rc == SQLITE_OK) && (i < (int32(uint64(unsafe.Sizeof([4]BuiltinTokenizer{})) / uint64(unsafe.Sizeof(BuiltinTokenizer{}))))); i++ { rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 8 /* &.xCreateTokenizer */))))(tls, pApi, (*BuiltinTokenizer)(unsafe.Pointer(bp /* &aBuiltin */ +uintptr(i)*32)).FzName, pApi, @@ -179098,7 +182121,7 @@ func sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c: type BuiltinTokenizer = struct { FzName uintptr Fx Fts5_tokenizer -} /* sqlite3.c:228273:3 */ +} /* sqlite3.c:231880:3 */ // 2012-05-25 // @@ -179121,7 +182144,7 @@ type BuiltinTokenizer = struct { // SMALL LETTER E WITH DIAERESIS" - return 65 ("LATIN SMALL LETTER // E"). The resuls of passing a codepoint that corresponds to an // uppercase letter are undefined. -func fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) int32 { /* sqlite3.c:228327:12: */ +func fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) int32 { /* sqlite3.c:231935:12: */ bp := tls.Alloc(378) defer tls.Free(378) @@ -179192,7 +182215,7 @@ func fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) int32 { /* sq // Return true if the argument interpreted as a unicode codepoint // is a diacritical modifier character. -func sqlite3Fts5UnicodeIsdiacritic(tls *libc.TLS, c int32) int32 { /* sqlite3.c:228394:12: */ +func sqlite3Fts5UnicodeIsdiacritic(tls *libc.TLS, c int32) int32 { /* sqlite3.c:232002:12: */ var mask0 uint32 = uint32(0x08029FDF) var mask1 uint32 = uint32(0x000361F8) if (c < 768) || (c > 817) { @@ -179211,7 +182234,7 @@ func sqlite3Fts5UnicodeIsdiacritic(tls *libc.TLS, c int32) int32 { /* sqlite3.c: // // The results are undefined if the value passed to this function // is less than zero. -func sqlite3Fts5UnicodeFold(tls *libc.TLS, c int32, eRemoveDiacritic int32) int32 { /* sqlite3.c:228413:12: */ +func sqlite3Fts5UnicodeFold(tls *libc.TLS, c int32, eRemoveDiacritic int32) int32 { /* sqlite3.c:232021:12: */ var ret int32 = c @@ -179272,7 +182295,7 @@ type TableEntry = struct { FiCode uint16 Fflags uint8 FnRange uint8 -} /* sqlite3.c:228431:16 */ +} /* sqlite3.c:232039:16 */ var aEntry = [163]TableEntry{ {FiCode: uint16(65), Fflags: uint8(14), FnRange: uint8(26)}, {FiCode: uint16(181), Fflags: uint8(64), FnRange: uint8(1)}, {FiCode: uint16(192), Fflags: uint8(14), FnRange: uint8(23)}, @@ -179330,7 +182353,7 @@ var aEntry = [163]TableEntry{ {FiCode: uint16(42878), Fflags: uint8(1), FnRange: uint8(10)}, {FiCode: uint16(42891), FnRange: uint8(1)}, {FiCode: uint16(42893), Fflags: uint8(74), FnRange: uint8(1)}, {FiCode: uint16(42896), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(42912), Fflags: uint8(1), FnRange: uint8(10)}, {FiCode: uint16(42922), Fflags: uint8(72), FnRange: uint8(1)}, {FiCode: uint16(65313), Fflags: uint8(14), FnRange: uint8(26)}, -} /* sqlite3.c:228435:5 */ +} /* sqlite3.c:232043:5 */ var aiOff = [77]uint16{ uint16(1), uint16(2), uint16(8), uint16(15), uint16(16), uint16(26), uint16(28), uint16(32), uint16(37), uint16(38), uint16(40), uint16(48), uint16(63), uint16(64), uint16(69), uint16(71), @@ -179342,9 +182365,9 @@ var aiOff = [77]uint16{ uint16(65408), uint16(65410), uint16(65415), uint16(65424), uint16(65436), uint16(65439), uint16(65450), uint16(65462), uint16(65472), uint16(65476), uint16(65478), uint16(65480), uint16(65482), uint16(65488), uint16(65506), uint16(65511), uint16(65514), uint16(65521), uint16(65527), uint16(65528), uint16(65529), -} /* sqlite3.c:228492:31 */ +} /* sqlite3.c:232100:31 */ -func sqlite3Fts5UnicodeCatParse(tls *libc.TLS, zCat uintptr, aArray uintptr) int32 { /* sqlite3.c:228549:12: */ +func sqlite3Fts5UnicodeCatParse(tls *libc.TLS, zCat uintptr, aArray uintptr) int32 { /* sqlite3.c:232157:12: */ *(*U8)(unsafe.Pointer(aArray)) = U8(1) switch int32(*(*int8)(unsafe.Pointer(zCat))) { case 'C': @@ -179541,7 +182564,7 @@ func sqlite3Fts5UnicodeCatParse(tls *libc.TLS, zCat uintptr, aArray uintptr) int var aFts5UnicodeBlock = [17]U16{ U16(0), U16(1471), U16(1753), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1763), U16(1765), -} /* sqlite3.c:228667:12 */ +} /* sqlite3.c:232275:12 */ var aFts5UnicodeMap = [1765]U16{ U16(0), U16(32), U16(33), U16(36), U16(37), U16(40), U16(41), U16(42), U16(43), U16(44), U16(45), U16(46), U16(48), U16(58), U16(60), U16(63), U16(65), U16(91), U16(92), U16(93), @@ -179720,7 +182743,7 @@ var aFts5UnicodeMap = [1765]U16{ U16(62406), U16(62432), U16(62464), U16(62528), U16(62530), U16(62713), U16(62720), U16(62784), U16(62800), U16(62971), U16(63045), U16(63104), U16(63232), U16(0), U16(42710), U16(42752), U16(46900), U16(46912), U16(47133), U16(63488), U16(1), U16(32), U16(256), U16(0), U16(65533), -} /* sqlite3.c:228671:12 */ +} /* sqlite3.c:232279:12 */ var aFts5UnicodeData = [1765]U16{ U16(1025), U16(61), U16(117), U16(55), U16(117), U16(54), U16(50), U16(53), U16(57), U16(53), U16(49), U16(85), U16(333), U16(85), U16(121), U16(85), U16(841), U16(54), U16(53), U16(50), @@ -179899,9 +182922,9 @@ var aFts5UnicodeData = [1765]U16{ U16(186), U16(570), U16(2042), U16(58), U16(5850), U16(154), U16(2010), U16(154), U16(794), U16(2266), U16(378), U16(2266), U16(3738), U16(39), U16(39), U16(39), U16(39), U16(39), U16(39), U16(17351), U16(34), U16(3074), U16(7692), U16(63), U16(63), -} /* sqlite3.c:228850:12 */ +} /* sqlite3.c:232458:12 */ -func sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode U32) int32 { /* sqlite3.c:229030:12: */ +func sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode U32) int32 { /* sqlite3.c:232638:12: */ var iRes int32 = -1 var iHi int32 var iLo int32 @@ -179941,7 +182964,7 @@ func sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode U32) int32 { /* sqlite3.c:2 return 9 } -func sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { /* sqlite3.c:229061:13: */ +func sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { /* sqlite3.c:232669:13: */ var i int32 = 0 var iTbl int32 = 0 for i < 128 { @@ -179952,6 +182975,7 @@ func sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { /* } iTbl++ } + *(*U8)(unsafe.Pointer(aAscii)) = U8(0) // 0x00 is never a token character } // 2015 May 30 @@ -179972,7 +182996,7 @@ func sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { /* // This is a copy of the sqlite3GetVarint32() routine from the SQLite core. // Except, this version does handle the single byte case that the core // version depends on being handled before its function is called. -func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 { /* sqlite3.c:229097:12: */ +func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 { /* sqlite3.c:232707:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -180047,7 +183071,7 @@ func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 { /* sqli // 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 sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:229175:11: */ +func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:232785:11: */ var a U32 var b U32 var s U32 @@ -180077,7 +183101,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c a = a | (U32(*(*uint8)(unsafe.Pointer(p)))) // a: p0<<14 | p2 (unmasked) if !((a & U32(0x80)) != 0) { - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) b = b & (U32(0x7f)) b = (b << 7) a = a | (b) @@ -180086,13 +183110,13 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c } // CSE1 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) // b: p1<<14 | p3 (unmasked) if !((b & U32(0x80)) != 0) { - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); a = (a << 7) @@ -180106,7 +183130,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) s = a // s: p0<<14 | p2 (masked) @@ -180137,7 +183161,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c if !((b & U32(0x80)) != 0) { // we can skip this cause it was (effectively) done above in calc'ing s // b &= (0x7f<<28)|(0x7f<<14)|(0x7f); - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) a = (a << 7) a = a | (b) s = (s >> 18) @@ -180151,7 +183175,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // a: p2<<28 | p4<<14 | p6 (unmasked) if !((a & U32(0x80)) != 0) { a = a & (SLOT_4_2_0) - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 7) a = a | (b) s = (s >> 11) @@ -180160,7 +183184,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c } // CSE2 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) @@ -180183,7 +183207,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // moved CSE2 up // a &= (0x7f<<29)|(0x7f<<15)|(0xff); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 8) a = a | (b) @@ -180223,7 +183247,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // 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 fts5PutVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:229369:26: */ +func fts5PutVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:232979:26: */ bp := tls.Alloc(10) defer tls.Free(10) @@ -180269,7 +183293,7 @@ __3: return n } -func sqlite3Fts5PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:229394:12: */ +func sqlite3Fts5PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:233004:12: */ if v <= uint64(0x7f) { *(*uint8)(unsafe.Pointer(p)) = (uint8(v & uint64(0x7f))) return 1 @@ -180282,7 +183306,7 @@ func sqlite3Fts5PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c: return fts5PutVarint64(tls, p, v) } -func sqlite3Fts5GetVarintLen(tls *libc.TLS, iVal U32) int32 { /* sqlite3.c:229408:12: */ +func sqlite3Fts5GetVarintLen(tls *libc.TLS, iVal U32) int32 { /* sqlite3.c:233018:12: */ if iVal < (U32(int32(1) << 14)) { return 2 @@ -180342,7 +183366,7 @@ type Fts5VocabTable1 = struct { FpGlobal uintptr FeType int32 FbBusy uint32 -} /* sqlite3.c:229461:9 */ +} /* sqlite3.c:233071:9 */ // 2015 May 08 // @@ -180382,7 +183406,7 @@ type Fts5VocabTable1 = struct { // #include "fts5Int.h" -type Fts5VocabTable = Fts5VocabTable1 /* sqlite3.c:229461:31 */ +type Fts5VocabTable = Fts5VocabTable1 /* sqlite3.c:233071:31 */ type Fts5VocabCursor1 = struct { Fbase Sqlite3_vtab_cursor FpStmt uintptr @@ -180402,9 +183426,9 @@ type Fts5VocabCursor1 = struct { FiInstPos I64 FiInstOff int32 _ [4]byte -} /* sqlite3.c:229462:9 */ +} /* sqlite3.c:233072:9 */ -type Fts5VocabCursor = Fts5VocabCursor1 /* sqlite3.c:229462:32 */ +type Fts5VocabCursor = Fts5VocabCursor1 /* sqlite3.c:233072:32 */ // Bits for the mask used as the idxNum value by xBestIndex/xFilter. @@ -180412,7 +183436,7 @@ type Fts5VocabCursor = Fts5VocabCursor1 /* sqlite3.c:229462:32 */ // FTS5_VOCAB_XXX constant. If successful, set *peType to the output // value and return SQLITE_OK. Otherwise, set *pzErr to an error message // and return SQLITE_ERROR. -func fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uintptr) int32 { /* sqlite3.c:229521:12: */ +func fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uintptr) int32 { /* sqlite3.c:233131:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -180420,14 +183444,14 @@ func fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uint var zCopy uintptr = sqlite3Fts5Strndup(tls, bp+8 /* &rc */, zType, -1) if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK { sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, ts+33778 /* "col" */) == 0 { + if Xsqlite3_stricmp(tls, zCopy, ts+34325 /* "col" */) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL - } else if Xsqlite3_stricmp(tls, zCopy, ts+33782 /* "row" */) == 0 { + } else if Xsqlite3_stricmp(tls, zCopy, ts+34329 /* "row" */) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_ROW - } else if Xsqlite3_stricmp(tls, zCopy, ts+33786 /* "instance" */) == 0 { + } else if Xsqlite3_stricmp(tls, zCopy, ts+34333 /* "instance" */) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_INSTANCE } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33795 /* "fts5vocab: unkno..." */, libc.VaList(bp, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+34342 /* "fts5vocab: unkno..." */, libc.VaList(bp, zCopy)) *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_ERROR } Xsqlite3_free(tls, zCopy) @@ -180437,14 +183461,14 @@ func fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uint } // The xDisconnect() virtual table method. -func fts5VocabDisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:229550:12: */ +func fts5VocabDisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:233160:12: */ var pTab uintptr = pVtab Xsqlite3_free(tls, pTab) return SQLITE_OK } // The xDestroy() virtual table method. -func fts5VocabDestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:229559:12: */ +func fts5VocabDestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:233169:12: */ var pTab uintptr = pVtab Xsqlite3_free(tls, pTab) return SQLITE_OK @@ -180469,24 +183493,24 @@ func fts5VocabDestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:2 // argv[3] -> name of fts5 tables database // argv[4] -> name of fts5 table // argv[5] -> type of fts5vocab table -func fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:229586:12: */ +func fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:233196:12: */ bp := tls.Alloc(36) defer tls.Free(36) *(*[3]uintptr)(unsafe.Pointer(bp + 8 /* azSchema */)) = [3]uintptr{ - ts + 33829, /* "CREATE TABlE voc..." */ - ts + 33869, /* "CREATE TABlE voc..." */ - ts + 33904, /* "CREATE TABlE voc..." */ + ts + 34376, /* "CREATE TABlE voc..." */ + ts + 34416, /* "CREATE TABlE voc..." */ + ts + 34451, /* "CREATE TABlE voc..." */ } var pRet uintptr = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = SQLITE_OK // Return code var bDb int32 - bDb = (libc.Bool32(((argc == 6) && (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4))) && (libc.Xmemcmp(tls, ts+20591 /* "temp" */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0))) + bDb = (libc.Bool32(((argc == 6) && (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4))) && (libc.Xmemcmp(tls, ts+21115 /* "temp" */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0))) if (argc != 5) && (bDb == 0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+33947 /* "wrong number of ..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+34494 /* "wrong number of ..." */, 0) *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = SQLITE_ERROR } else { var nByte int32 // Bytes of space to allocate @@ -180539,11 +183563,11 @@ func fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv // The xConnect() and xCreate() methods for the virtual table. All the // work is done in function fts5VocabInitVtab(). -func fts5VocabConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:229648:12: */ +func fts5VocabConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:233258:12: */ return fts5VocabInitVtab(tls, db, pAux, argc, argv, ppVtab, pzErr) } -func fts5VocabCreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:229658:12: */ +func fts5VocabCreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:233268:12: */ return fts5VocabInitVtab(tls, db, pAux, argc, argv, ppVtab, pzErr) } @@ -180557,7 +183581,7 @@ func fts5VocabCreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, // // are interpreted. Less-than and less-than-or-equal are treated // identically, as are greater-than and greater-than-or-equal. -func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int32 { /* sqlite3.c:229681:12: */ +func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int32 { /* sqlite3.c:233291:12: */ var i int32 var iTermEq int32 = -1 var iTermGe int32 = -1 @@ -180625,7 +183649,7 @@ func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int } // Implementation of xOpen method. -func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:229743:12: */ +func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:233353:12: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -180638,11 +183662,11 @@ func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { (*Sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, - ts+33980 /* "recursive defini..." */, libc.VaList(bp, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + ts+34527 /* "recursive defini..." */, libc.VaList(bp, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return SQLITE_ERROR } zSql = sqlite3Fts5Mprintf(tls, bp+64, /* &rc */ - ts+34011, /* "SELECT t.%Q FROM..." */ + ts+34558, /* "SELECT t.%Q FROM..." */ libc.VaList(bp+16, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = Xsqlite3_prepare_v2(tls, (*Fts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -1, bp+72 /* &pStmt */, uintptr(0)) @@ -180666,7 +183690,7 @@ func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* *(*uintptr)(unsafe.Pointer(bp + 72 /* pStmt */)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == SQLITE_OK { (*Sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, - ts+34062 /* "no such fts5 tab..." */, libc.VaList(bp+48, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + ts+34609 /* "no such fts5 tab..." */, libc.VaList(bp+48, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = SQLITE_ERROR } } else { @@ -180692,7 +183716,7 @@ func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* return *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) } -func fts5VocabResetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:229811:13: */ +func fts5VocabResetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:233421:13: */ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Frowid = int64(0) sqlite3Fts5IterClose(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter) (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter = uintptr(0) @@ -180704,7 +183728,7 @@ func fts5VocabResetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:229811:13: // Close the cursor. For additional information see the documentation // on the xClose method of the virtual table interface. -func fts5VocabCloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:229825:12: */ +func fts5VocabCloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:233435:12: */ var pCsr uintptr = pCursor fts5VocabResetCursor(tls, pCsr) sqlite3Fts5BufferFree(tls, (pCsr + 88 /* &.term */)) @@ -180713,7 +183737,7 @@ func fts5VocabCloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:2 return SQLITE_OK } -func fts5VocabInstanceNewTerm(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:229834:12: */ +func fts5VocabInstanceNewTerm(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:233444:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -180744,7 +183768,7 @@ func fts5VocabInstanceNewTerm(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c: return *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) } -func fts5VocabInstanceNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:229856:12: */ +func fts5VocabInstanceNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:233466:12: */ var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail var rc int32 = SQLITE_OK var pIter uintptr = (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter @@ -180773,7 +183797,7 @@ func fts5VocabInstanceNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:229 } // Advance the cursor to the next row in the table. -func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:229888:12: */ +func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:233498:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -180913,7 +183937,7 @@ func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:22 } // This is the xFilter implementation for the virtual table. -func fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnused uintptr, nUnused int32, apVal uintptr) int32 { /* sqlite3.c:230014:12: */ +func fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnused uintptr, nUnused int32, apVal uintptr) int32 { /* sqlite3.c:233624:12: */ var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab var pCsr uintptr = pCursor var eType int32 = (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType @@ -180984,12 +184008,12 @@ func fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnused // This is the xEof method of the virtual table. SQLite calls this // routine to find out if it has reached the end of a result set. -func fts5VocabEofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:230085:12: */ +func fts5VocabEofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:233695:12: */ var pCsr uintptr = pCursor return (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof } -func fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:230090:12: */ +func fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:233700:12: */ var pCsr uintptr = pCursor var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail var eType int32 = (*Fts5VocabTable)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FeType @@ -181062,16 +184086,16 @@ func fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol in // This is the xRowid method. The SQLite core calls this routine to // retrieve the rowid for the current row of the result set. The // rowid should be written to *pRowid. -func fts5VocabRowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:230162:12: */ +func fts5VocabRowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:233772:12: */ var pCsr uintptr = pCursor *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Frowid return SQLITE_OK } -func sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:230171:12: */ +func sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:233781:12: */ var p uintptr = pGlobal - return Xsqlite3_create_module_v2(tls, db, ts+34088 /* "fts5vocab" */, uintptr(unsafe.Pointer(&fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, ts+34635 /* "fts5vocab" */, uintptr(unsafe.Pointer(&fts5Vocab)), p, uintptr(0)) } var fts5Vocab = Sqlite3_module{ @@ -181088,7 +184112,7 @@ var fts5Vocab = Sqlite3_module{ /* xEof */ FxEof: 0, /* xColumn */ FxColumn: 0, /* xRowid */ FxRowid: 0, -} /* sqlite3.c:230172:31 */ +} /* sqlite3.c:233782:31 */ //************* End of fts5.c *********************************************** //************* Begin file stmt.c ******************************************* @@ -181115,862 +184139,867 @@ var fts5Vocab = Sqlite3_module{ //************* End of stmt.c *********************************************** // Return the source-id for this library -func Xsqlite3_sourceid(tls *libc.TLS) uintptr { /* sqlite3.c:230516:23: */ - return ts + 34098 /* "2020-08-14 13:23..." */ +func Xsqlite3_sourceid(tls *libc.TLS) uintptr { /* sqlite3.c:234126:23: */ + return ts + 34645 /* "2021-03-12 15:10..." */ } //************************* End of sqlite3.c ***************************** func init() { - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 16 /* .xStep */)) = jsonArrayStep // sqlite3.c:188003:7: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 24 /* .xFinal */)) = jsonArrayFinal // sqlite3.c:188003:24: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 32 /* .xValue */)) = jsonArrayValue // sqlite3.c:188003:41: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 56 /* .xStep */)) = jsonObjectStep // sqlite3.c:188005:7: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 64 /* .xFinal */)) = jsonObjectFinal // sqlite3.c:188005:24: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 72 /* .xValue */)) = jsonObjectValue // sqlite3.c:188005:41: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 0 /* .xStep */)) = geopolyBBoxStep // sqlite3.c:194216:8: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 8 /* .xFinal */)) = geopolyBBoxFinal // sqlite3.c:194216:25: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 24 /* .xSFunc */)) = renameColumnFunc // sqlite3.c:107540:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 96 /* .xSFunc */)) = renameTableFunc // sqlite3.c:107541:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 168 /* .xSFunc */)) = renameTableTest // sqlite3.c:107542:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 24 /* .xSFunc */)) = versionFunc // sqlite3.c:118977:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 96 /* .xSFunc */)) = versionFunc // sqlite3.c:118978:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 168 /* .xSFunc */)) = versionFunc // sqlite3.c:118979:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 240 /* .xSFunc */)) = soundexFunc // sqlite3.c:118985:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 312 /* .xSFunc */)) = loadExt // sqlite3.c:118988:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 384 /* .xSFunc */)) = loadExt // sqlite3.c:118989:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 456 /* .xSFunc */)) = compileoptionusedFunc // sqlite3.c:118995:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 528 /* .xSFunc */)) = compileoptiongetFunc // sqlite3.c:118996:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 600 /* .xSFunc */)) = versionFunc // sqlite3.c:118998:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 672 /* .xSFunc */)) = versionFunc // sqlite3.c:118999:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 744 /* .xSFunc */)) = versionFunc // sqlite3.c:119000:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 816 /* .xSFunc */)) = versionFunc // sqlite3.c:119002:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 888 /* .xSFunc */)) = trimFunc // sqlite3.c:119005:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 960 /* .xSFunc */)) = trimFunc // sqlite3.c:119006:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1032 /* .xSFunc */)) = trimFunc // sqlite3.c:119007:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1104 /* .xSFunc */)) = trimFunc // sqlite3.c:119008:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1176 /* .xSFunc */)) = trimFunc // sqlite3.c:119009:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1248 /* .xSFunc */)) = trimFunc // sqlite3.c:119010:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1320 /* .xSFunc */)) = minmaxFunc // sqlite3.c:119011:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1464 /* .xSFunc */)) = minmaxStep // sqlite3.c:119013:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1472 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:119013:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1480 /* .xValue */)) = minMaxValue // sqlite3.c:119013:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1536 /* .xSFunc */)) = minmaxFunc // sqlite3.c:119015:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1680 /* .xSFunc */)) = minmaxStep // sqlite3.c:119017:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1688 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:119017:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1696 /* .xValue */)) = minMaxValue // sqlite3.c:119017:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1752 /* .xSFunc */)) = typeofFunc // sqlite3.c:119019:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1824 /* .xSFunc */)) = lengthFunc // sqlite3.c:119020:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1896 /* .xSFunc */)) = instrFunc // sqlite3.c:119021:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1968 /* .xSFunc */)) = printfFunc // sqlite3.c:119022:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2040 /* .xSFunc */)) = unicodeFunc // sqlite3.c:119023:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2112 /* .xSFunc */)) = charFunc // sqlite3.c:119024:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2184 /* .xSFunc */)) = absFunc // sqlite3.c:119025:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2256 /* .xSFunc */)) = roundFunc // sqlite3.c:119027:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2328 /* .xSFunc */)) = roundFunc // sqlite3.c:119028:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2400 /* .xSFunc */)) = upperFunc // sqlite3.c:119030:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2472 /* .xSFunc */)) = lowerFunc // sqlite3.c:119031:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2544 /* .xSFunc */)) = hexFunc // sqlite3.c:119032:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2616 /* .xSFunc */)) = versionFunc // sqlite3.c:119033:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2688 /* .xSFunc */)) = randomFunc // sqlite3.c:119034:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2760 /* .xSFunc */)) = randomBlob // sqlite3.c:119035:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2832 /* .xSFunc */)) = nullifFunc // sqlite3.c:119036:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2904 /* .xSFunc */)) = versionFunc // sqlite3.c:119037:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2976 /* .xSFunc */)) = sourceidFunc // sqlite3.c:119038:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3048 /* .xSFunc */)) = errlogFunc // sqlite3.c:119039:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3120 /* .xSFunc */)) = quoteFunc // sqlite3.c:119040:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3192 /* .xSFunc */)) = last_insert_rowid // sqlite3.c:119041:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3264 /* .xSFunc */)) = changes // sqlite3.c:119042:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3336 /* .xSFunc */)) = total_changes // sqlite3.c:119043:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3408 /* .xSFunc */)) = replaceFunc // sqlite3.c:119044:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3480 /* .xSFunc */)) = zeroblobFunc // sqlite3.c:119045:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3552 /* .xSFunc */)) = substrFunc // sqlite3.c:119046:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3624 /* .xSFunc */)) = substrFunc // sqlite3.c:119047:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3696 /* .xSFunc */)) = sumStep // sqlite3.c:119048:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3704 /* .xFinalize */)) = sumFinalize // sqlite3.c:119048:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3712 /* .xValue */)) = sumFinalize // sqlite3.c:119048:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3720 /* .xInverse */)) = sumInverse // sqlite3.c:119048:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3768 /* .xSFunc */)) = sumStep // sqlite3.c:119049:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3776 /* .xFinalize */)) = totalFinalize // sqlite3.c:119049:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3784 /* .xValue */)) = totalFinalize // sqlite3.c:119049:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3792 /* .xInverse */)) = sumInverse // sqlite3.c:119049:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3840 /* .xSFunc */)) = sumStep // sqlite3.c:119050:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3848 /* .xFinalize */)) = avgFinalize // sqlite3.c:119050:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3856 /* .xValue */)) = avgFinalize // sqlite3.c:119050:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3864 /* .xInverse */)) = sumInverse // sqlite3.c:119050:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3912 /* .xSFunc */)) = countStep // sqlite3.c:119051:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3920 /* .xFinalize */)) = countFinalize // sqlite3.c:119051:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3928 /* .xValue */)) = countFinalize // sqlite3.c:119051:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3936 /* .xInverse */)) = countInverse // sqlite3.c:119051:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3984 /* .xSFunc */)) = countStep // sqlite3.c:119053:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3992 /* .xFinalize */)) = countFinalize // sqlite3.c:119053:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4000 /* .xValue */)) = countFinalize // sqlite3.c:119053:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4008 /* .xInverse */)) = countInverse // sqlite3.c:119053:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4056 /* .xSFunc */)) = groupConcatStep // sqlite3.c:119055:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4064 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:119055:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4072 /* .xValue */)) = groupConcatValue // sqlite3.c:119055:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4080 /* .xInverse */)) = groupConcatInverse // sqlite3.c:119055:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4128 /* .xSFunc */)) = groupConcatStep // sqlite3.c:119057:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4136 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:119057:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4144 /* .xValue */)) = groupConcatValue // sqlite3.c:119057:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4152 /* .xInverse */)) = groupConcatInverse // sqlite3.c:119057:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4184 /* .pUserData */)) = uintptr(unsafe.Pointer(&globInfo)) // sqlite3.c:119060:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4200 /* .xSFunc */)) = likeFunc // sqlite3.c:119060:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4256 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:119065:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4272 /* .xSFunc */)) = likeFunc // sqlite3.c:119065:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4328 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:119066:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4344 /* .xSFunc */)) = likeFunc // sqlite3.c:119066:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4560 /* .xSFunc */)) = versionFunc // sqlite3.c:119073:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4632 /* .xSFunc */)) = versionFunc // sqlite3.c:119074:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 8 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22948:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 24 /* .xSFunc */)) = juliandayFunc // sqlite3.c:22948:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 80 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22949:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 96 /* .xSFunc */)) = dateFunc // sqlite3.c:22949:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 152 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22950:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 168 /* .xSFunc */)) = timeFunc // sqlite3.c:22950:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 224 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22951:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 240 /* .xSFunc */)) = datetimeFunc // sqlite3.c:22951:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 296 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22952:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 312 /* .xSFunc */)) = strftimeFunc // sqlite3.c:22952:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 384 /* .xSFunc */)) = ctimeFunc // sqlite3.c:22953:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 456 /* .xSFunc */)) = ctimestampFunc // sqlite3.c:22954:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 528 /* .xSFunc */)) = cdateFunc // sqlite3.c:22955:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 16 /* .xFunc */)) = jsonRemoveFunc // sqlite3.c:187973:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 40 /* .xFunc */)) = jsonArrayFunc // sqlite3.c:187974:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 64 /* .xFunc */)) = jsonArrayLengthFunc // sqlite3.c:187975:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 88 /* .xFunc */)) = jsonArrayLengthFunc // sqlite3.c:187976:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 112 /* .xFunc */)) = jsonExtractFunc // sqlite3.c:187977:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 136 /* .xFunc */)) = jsonSetFunc // sqlite3.c:187978:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 160 /* .xFunc */)) = jsonObjectFunc // sqlite3.c:187979:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 184 /* .xFunc */)) = jsonPatchFunc // sqlite3.c:187980:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 208 /* .xFunc */)) = jsonQuoteFunc // sqlite3.c:187981:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 232 /* .xFunc */)) = jsonRemoveFunc // sqlite3.c:187982:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 256 /* .xFunc */)) = jsonReplaceFunc // sqlite3.c:187983:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 280 /* .xFunc */)) = jsonSetFunc // sqlite3.c:187984:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 304 /* .xFunc */)) = jsonTypeFunc // sqlite3.c:187985:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 328 /* .xFunc */)) = jsonTypeFunc // sqlite3.c:187986:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 352 /* .xFunc */)) = jsonValidFunc // sqlite3.c:187987:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 0 /* .xFunc */)) = geopolyAreaFunc // sqlite3.c:194198:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 24 /* .xFunc */)) = geopolyBlobFunc // sqlite3.c:194199:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 48 /* .xFunc */)) = geopolyJsonFunc // sqlite3.c:194200:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 72 /* .xFunc */)) = geopolySvgFunc // sqlite3.c:194201:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 96 /* .xFunc */)) = geopolyWithinFunc // sqlite3.c:194202:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 120 /* .xFunc */)) = geopolyContainsPointFunc // sqlite3.c:194203:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 144 /* .xFunc */)) = geopolyOverlapFunc // sqlite3.c:194204:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 168 /* .xFunc */)) = geopolyDebugFunc // sqlite3.c:194205:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 192 /* .xFunc */)) = geopolyBBoxFunc // sqlite3.c:194206:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 216 /* .xFunc */)) = geopolyXformFunc // sqlite3.c:194207:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 240 /* .xFunc */)) = geopolyRegularFunc // sqlite3.c:194208:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 264 /* .xFunc */)) = geopolyCcwFunc // sqlite3.c:194209:8: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 8 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonEachModule)) // sqlite3.c:188012:31: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 24 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonTreeModule)) // sqlite3.c:188013:31: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 16 /* .xStep */)) = jsonArrayStep // sqlite3.c:191026:7: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 24 /* .xFinal */)) = jsonArrayFinal // sqlite3.c:191026:24: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 32 /* .xValue */)) = jsonArrayValue // sqlite3.c:191026:41: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 56 /* .xStep */)) = jsonObjectStep // sqlite3.c:191028:7: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 64 /* .xFinal */)) = jsonObjectFinal // sqlite3.c:191028:24: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 72 /* .xValue */)) = jsonObjectValue // sqlite3.c:191028:41: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 0 /* .xStep */)) = geopolyBBoxStep // sqlite3.c:197239:8: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 8 /* .xFinal */)) = geopolyBBoxFinal // sqlite3.c:197239:25: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 24 /* .xSFunc */)) = renameColumnFunc // sqlite3.c:108694:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 96 /* .xSFunc */)) = renameTableFunc // sqlite3.c:108695:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 168 /* .xSFunc */)) = renameTableTest // sqlite3.c:108696:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 240 /* .xSFunc */)) = dropColumnFunc // sqlite3.c:108697:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 24 /* .xSFunc */)) = versionFunc // sqlite3.c:120473:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 96 /* .xSFunc */)) = versionFunc // sqlite3.c:120474:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 168 /* .xSFunc */)) = versionFunc // sqlite3.c:120475:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 240 /* .xSFunc */)) = soundexFunc // sqlite3.c:120481:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 312 /* .xSFunc */)) = loadExt // sqlite3.c:120484:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 384 /* .xSFunc */)) = loadExt // sqlite3.c:120485:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 456 /* .xSFunc */)) = compileoptionusedFunc // sqlite3.c:120491:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 528 /* .xSFunc */)) = compileoptiongetFunc // sqlite3.c:120492:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 600 /* .xSFunc */)) = versionFunc // sqlite3.c:120494:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 672 /* .xSFunc */)) = versionFunc // sqlite3.c:120495:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 744 /* .xSFunc */)) = versionFunc // sqlite3.c:120496:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 816 /* .xSFunc */)) = versionFunc // sqlite3.c:120498:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 888 /* .xSFunc */)) = trimFunc // sqlite3.c:120501:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 960 /* .xSFunc */)) = trimFunc // sqlite3.c:120502:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1032 /* .xSFunc */)) = trimFunc // sqlite3.c:120503:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1104 /* .xSFunc */)) = trimFunc // sqlite3.c:120504:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1176 /* .xSFunc */)) = trimFunc // sqlite3.c:120505:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1248 /* .xSFunc */)) = trimFunc // sqlite3.c:120506:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1320 /* .xSFunc */)) = minmaxFunc // sqlite3.c:120507:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1464 /* .xSFunc */)) = minmaxStep // sqlite3.c:120509:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1472 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:120509:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1480 /* .xValue */)) = minMaxValue // sqlite3.c:120509:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1536 /* .xSFunc */)) = minmaxFunc // sqlite3.c:120511:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1680 /* .xSFunc */)) = minmaxStep // sqlite3.c:120513:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1688 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:120513:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1696 /* .xValue */)) = minMaxValue // sqlite3.c:120513:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1752 /* .xSFunc */)) = typeofFunc // sqlite3.c:120515:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1824 /* .xSFunc */)) = lengthFunc // sqlite3.c:120516:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1896 /* .xSFunc */)) = instrFunc // sqlite3.c:120517:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1968 /* .xSFunc */)) = printfFunc // sqlite3.c:120518:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2040 /* .xSFunc */)) = unicodeFunc // sqlite3.c:120519:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2112 /* .xSFunc */)) = charFunc // sqlite3.c:120520:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2184 /* .xSFunc */)) = absFunc // sqlite3.c:120521:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2256 /* .xSFunc */)) = roundFunc // sqlite3.c:120523:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2328 /* .xSFunc */)) = roundFunc // sqlite3.c:120524:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2400 /* .xSFunc */)) = upperFunc // sqlite3.c:120526:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2472 /* .xSFunc */)) = lowerFunc // sqlite3.c:120527:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2544 /* .xSFunc */)) = hexFunc // sqlite3.c:120528:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2616 /* .xSFunc */)) = versionFunc // sqlite3.c:120529:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2688 /* .xSFunc */)) = randomFunc // sqlite3.c:120530:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2760 /* .xSFunc */)) = randomBlob // sqlite3.c:120531:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2832 /* .xSFunc */)) = nullifFunc // sqlite3.c:120532:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2904 /* .xSFunc */)) = versionFunc // sqlite3.c:120533:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2976 /* .xSFunc */)) = sourceidFunc // sqlite3.c:120534:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3048 /* .xSFunc */)) = errlogFunc // sqlite3.c:120535:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3120 /* .xSFunc */)) = quoteFunc // sqlite3.c:120536:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3192 /* .xSFunc */)) = last_insert_rowid // sqlite3.c:120537:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3264 /* .xSFunc */)) = changes // sqlite3.c:120538:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3336 /* .xSFunc */)) = total_changes // sqlite3.c:120539:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3408 /* .xSFunc */)) = replaceFunc // sqlite3.c:120540:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3480 /* .xSFunc */)) = zeroblobFunc // sqlite3.c:120541:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3552 /* .xSFunc */)) = substrFunc // sqlite3.c:120542:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3624 /* .xSFunc */)) = substrFunc // sqlite3.c:120543:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3696 /* .xSFunc */)) = substrFunc // sqlite3.c:120544:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3768 /* .xSFunc */)) = substrFunc // sqlite3.c:120545:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3840 /* .xSFunc */)) = sumStep // sqlite3.c:120546:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3848 /* .xFinalize */)) = sumFinalize // sqlite3.c:120546:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3856 /* .xValue */)) = sumFinalize // sqlite3.c:120546:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3864 /* .xInverse */)) = sumInverse // sqlite3.c:120546:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3912 /* .xSFunc */)) = sumStep // sqlite3.c:120547:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3920 /* .xFinalize */)) = totalFinalize // sqlite3.c:120547:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3928 /* .xValue */)) = totalFinalize // sqlite3.c:120547:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3936 /* .xInverse */)) = sumInverse // sqlite3.c:120547:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3984 /* .xSFunc */)) = sumStep // sqlite3.c:120548:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3992 /* .xFinalize */)) = avgFinalize // sqlite3.c:120548:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4000 /* .xValue */)) = avgFinalize // sqlite3.c:120548:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4008 /* .xInverse */)) = sumInverse // sqlite3.c:120548:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4056 /* .xSFunc */)) = countStep // sqlite3.c:120549:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4064 /* .xFinalize */)) = countFinalize // sqlite3.c:120549:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4072 /* .xValue */)) = countFinalize // sqlite3.c:120549:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4080 /* .xInverse */)) = countInverse // sqlite3.c:120549:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4128 /* .xSFunc */)) = countStep // sqlite3.c:120551:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4136 /* .xFinalize */)) = countFinalize // sqlite3.c:120551:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4144 /* .xValue */)) = countFinalize // sqlite3.c:120551:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4152 /* .xInverse */)) = countInverse // sqlite3.c:120551:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4200 /* .xSFunc */)) = groupConcatStep // sqlite3.c:120553:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4208 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:120553:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4216 /* .xValue */)) = groupConcatValue // sqlite3.c:120553:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4224 /* .xInverse */)) = groupConcatInverse // sqlite3.c:120553:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4272 /* .xSFunc */)) = groupConcatStep // sqlite3.c:120555:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4280 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:120555:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4288 /* .xValue */)) = groupConcatValue // sqlite3.c:120555:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4296 /* .xInverse */)) = groupConcatInverse // sqlite3.c:120555:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4328 /* .pUserData */)) = uintptr(unsafe.Pointer(&globInfo)) // sqlite3.c:120558:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4344 /* .xSFunc */)) = likeFunc // sqlite3.c:120558:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4400 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:120563:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4416 /* .xSFunc */)) = likeFunc // sqlite3.c:120563:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4472 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:120564:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4488 /* .xSFunc */)) = likeFunc // sqlite3.c:120564:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4704 /* .xSFunc */)) = signFunc // sqlite3.c:120607:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4776 /* .xSFunc */)) = versionFunc // sqlite3.c:120608:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4848 /* .xSFunc */)) = versionFunc // sqlite3.c:120609:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 8 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23221:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 24 /* .xSFunc */)) = juliandayFunc // sqlite3.c:23221:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 80 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23222:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 96 /* .xSFunc */)) = dateFunc // sqlite3.c:23222:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 152 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23223:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 168 /* .xSFunc */)) = timeFunc // sqlite3.c:23223:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 224 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23224:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 240 /* .xSFunc */)) = datetimeFunc // sqlite3.c:23224:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 296 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23225:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 312 /* .xSFunc */)) = strftimeFunc // sqlite3.c:23225:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 384 /* .xSFunc */)) = ctimeFunc // sqlite3.c:23226:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 456 /* .xSFunc */)) = ctimestampFunc // sqlite3.c:23227:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 528 /* .xSFunc */)) = cdateFunc // sqlite3.c:23228:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 16 /* .xFunc */)) = jsonRemoveFunc // sqlite3.c:190996:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 40 /* .xFunc */)) = jsonArrayFunc // sqlite3.c:190997:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 64 /* .xFunc */)) = jsonArrayLengthFunc // sqlite3.c:190998:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 88 /* .xFunc */)) = jsonArrayLengthFunc // sqlite3.c:190999:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 112 /* .xFunc */)) = jsonExtractFunc // sqlite3.c:191000:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 136 /* .xFunc */)) = jsonSetFunc // sqlite3.c:191001:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 160 /* .xFunc */)) = jsonObjectFunc // sqlite3.c:191002:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 184 /* .xFunc */)) = jsonPatchFunc // sqlite3.c:191003:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 208 /* .xFunc */)) = jsonQuoteFunc // sqlite3.c:191004:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 232 /* .xFunc */)) = jsonRemoveFunc // sqlite3.c:191005:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 256 /* .xFunc */)) = jsonReplaceFunc // sqlite3.c:191006:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 280 /* .xFunc */)) = jsonSetFunc // sqlite3.c:191007:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 304 /* .xFunc */)) = jsonTypeFunc // sqlite3.c:191008:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 328 /* .xFunc */)) = jsonTypeFunc // sqlite3.c:191009:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 352 /* .xFunc */)) = jsonValidFunc // sqlite3.c:191010:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 0 /* .xFunc */)) = geopolyAreaFunc // sqlite3.c:197221:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 24 /* .xFunc */)) = geopolyBlobFunc // sqlite3.c:197222:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 48 /* .xFunc */)) = geopolyJsonFunc // sqlite3.c:197223:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 72 /* .xFunc */)) = geopolySvgFunc // sqlite3.c:197224:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 96 /* .xFunc */)) = geopolyWithinFunc // sqlite3.c:197225:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 120 /* .xFunc */)) = geopolyContainsPointFunc // sqlite3.c:197226:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 144 /* .xFunc */)) = geopolyOverlapFunc // sqlite3.c:197227:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 168 /* .xFunc */)) = geopolyDebugFunc // sqlite3.c:197228:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 192 /* .xFunc */)) = geopolyBBoxFunc // sqlite3.c:197229:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 216 /* .xFunc */)) = geopolyXformFunc // sqlite3.c:197230:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 240 /* .xFunc */)) = geopolyRegularFunc // sqlite3.c:197231:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 264 /* .xFunc */)) = geopolyCcwFunc // sqlite3.c:197232:8: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 8 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonEachModule)) // sqlite3.c:191035:31: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 24 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonTreeModule)) // sqlite3.c:191036:31: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 8 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, int32) int32 - }{posixOpen})) // sqlite3.c:33936:21: - *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 32 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{libc.Xclose})) // sqlite3.c:33939:21: + }{posixOpen})) // sqlite3.c:34244:21: + *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 32 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{libc.Xclose})) // sqlite3.c:34247:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 56 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32) int32 - }{libc.Xaccess})) // sqlite3.c:33942:21: + }{libc.Xaccess})) // sqlite3.c:34250:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 80 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, Size_t) uintptr - }{libc.Xgetcwd})) // sqlite3.c:33945:21: + }{libc.Xgetcwd})) // sqlite3.c:34253:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 104 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 - }{libc.Xstat})) // sqlite3.c:33948:21: + }{libc.Xstat})) // sqlite3.c:34256:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 128 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, uintptr) int32 - }{libc.Xfstat})) // sqlite3.c:33961:21: + }{libc.Xfstat})) // sqlite3.c:34269:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 152 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, X__off64_t) int32 - }{libc.Xftruncate})) // sqlite3.c:33965:21: + }{libc.Xftruncate})) // sqlite3.c:34273:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 176 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, int32, uintptr) int32 - }{libc.Xfcntl})) // sqlite3.c:33968:21: + }{libc.Xfcntl})) // sqlite3.c:34276:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 200 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, uintptr, Size_t) Ssize_t - }{libc.Xread})) // sqlite3.c:33971:21: + }{libc.Xread})) // sqlite3.c:34279:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 272 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, uintptr, Size_t) Ssize_t - }{libc.Xwrite})) // sqlite3.c:33988:21: + }{libc.Xwrite})) // sqlite3.c:34296:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 344 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, X__mode_t) int32 - }{libc.Xfchmod})) // sqlite3.c:34007:21: + }{libc.Xfchmod})) // sqlite3.c:34315:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 392 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr) int32 - }{libc.Xunlink})) // sqlite3.c:34017:21: + }{libc.Xunlink})) // sqlite3.c:34325:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 416 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 - }{openDirectory})) // sqlite3.c:34020:25: + }{openDirectory})) // sqlite3.c:34328:25: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 440 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, X__mode_t) int32 - }{libc.Xmkdir})) // sqlite3.c:34023:21: + }{libc.Xmkdir})) // sqlite3.c:34331:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 464 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr) int32 - }{libc.Xrmdir})) // sqlite3.c:34026:21: + }{libc.Xrmdir})) // sqlite3.c:34334:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 488 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, X__uid_t, X__gid_t) int32 - }{libc.Xfchown})) // sqlite3.c:34030:21: - *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 512 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) X__uid_t }{libc.Xgeteuid})) // sqlite3.c:34037:21: + }{libc.Xfchown})) // sqlite3.c:34338:21: + *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 512 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) X__uid_t }{libc.Xgeteuid})) // sqlite3.c:34345:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 536 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, Size_t, int32, int32, int32, X__off64_t) uintptr - }{libc.Xmmap})) // sqlite3.c:34044:21: + }{libc.Xmmap})) // sqlite3.c:34352:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 560 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, Size_t) int32 - }{libc.Xmunmap})) // sqlite3.c:34051:21: + }{libc.Xmunmap})) // sqlite3.c:34359:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 584 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, Size_t, Size_t, int32, uintptr) uintptr - }{libc.Xmremap})) // sqlite3.c:34058:21: - *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 608 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{unixGetpagesize})) // sqlite3.c:34065:21: + }{libc.Xmremap})) // sqlite3.c:34366:21: + *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 608 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{unixGetpagesize})) // sqlite3.c:34373:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 632 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, Size_t) Ssize_t - }{libc.Xreadlink})) // sqlite3.c:34072:21: + }{libc.Xreadlink})) // sqlite3.c:34380:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 656 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 - }{libc.Xlstat})) // sqlite3.c:34079:22: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 32 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 40 /* .xOpen */)) = unixOpen // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 48 /* .xDelete */)) = unixDelete // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 56 /* .xAccess */)) = unixAccess // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 64 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 72 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 80 /* .xDlError */)) = unixDlError // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 88 /* .xDlSym */)) = unixDlSym // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 96 /* .xDlClose */)) = unixDlClose // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 104 /* .xRandomness */)) = unixRandomness // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 112 /* .xSleep */)) = unixSleep // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 120 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 128 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 136 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 144 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 152 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 160 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41438:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 200 /* .pAppData */)) = uintptr(unsafe.Pointer(&nolockIoFinder)) // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 208 /* .xOpen */)) = unixOpen // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 216 /* .xDelete */)) = unixDelete // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 224 /* .xAccess */)) = unixAccess // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 232 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 240 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 248 /* .xDlError */)) = unixDlError // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 256 /* .xDlSym */)) = unixDlSym // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 264 /* .xDlClose */)) = unixDlClose // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 272 /* .xRandomness */)) = unixRandomness // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 280 /* .xSleep */)) = unixSleep // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 288 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 296 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 304 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 312 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 320 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 328 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41440:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 368 /* .pAppData */)) = uintptr(unsafe.Pointer(&dotlockIoFinder)) // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 376 /* .xOpen */)) = unixOpen // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 384 /* .xDelete */)) = unixDelete // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 392 /* .xAccess */)) = unixAccess // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 400 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 408 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 416 /* .xDlError */)) = unixDlError // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 424 /* .xDlSym */)) = unixDlSym // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 432 /* .xDlClose */)) = unixDlClose // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 440 /* .xRandomness */)) = unixRandomness // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 448 /* .xSleep */)) = unixSleep // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 456 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 464 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 472 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 480 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 488 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 496 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41441:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 536 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 544 /* .xOpen */)) = unixOpen // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 552 /* .xDelete */)) = unixDelete // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 560 /* .xAccess */)) = unixAccess // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 568 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 576 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 584 /* .xDlError */)) = unixDlError // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 592 /* .xDlSym */)) = unixDlSym // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 600 /* .xDlClose */)) = unixDlClose // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 608 /* .xRandomness */)) = unixRandomness // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 616 /* .xSleep */)) = unixSleep // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 624 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 632 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 640 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 648 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 656 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 664 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 24 /* .xSFunc */)) = row_numberStepFunc // sqlite3.c:151777:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 32 /* .xFinalize */)) = row_numberValueFunc // sqlite3.c:151777:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 40 /* .xValue */)) = row_numberValueFunc // sqlite3.c:151777:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 48 /* .xInverse */)) = noopStepFunc // sqlite3.c:151777:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 56 /* .zName */)) = uintptr(unsafe.Pointer(&row_numberName)) // sqlite3.c:151777:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 96 /* .xSFunc */)) = dense_rankStepFunc // sqlite3.c:151778:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 104 /* .xFinalize */)) = dense_rankValueFunc // sqlite3.c:151778:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 112 /* .xValue */)) = dense_rankValueFunc // sqlite3.c:151778:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 120 /* .xInverse */)) = noopStepFunc // sqlite3.c:151778:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 128 /* .zName */)) = uintptr(unsafe.Pointer(&dense_rankName)) // sqlite3.c:151778:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 168 /* .xSFunc */)) = rankStepFunc // sqlite3.c:151779:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 176 /* .xFinalize */)) = rankValueFunc // sqlite3.c:151779:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 184 /* .xValue */)) = rankValueFunc // sqlite3.c:151779:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 192 /* .xInverse */)) = noopStepFunc // sqlite3.c:151779:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 200 /* .zName */)) = uintptr(unsafe.Pointer(&rankName)) // sqlite3.c:151779:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 240 /* .xSFunc */)) = percent_rankStepFunc // sqlite3.c:151780:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 248 /* .xFinalize */)) = percent_rankValueFunc // sqlite3.c:151780:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 256 /* .xValue */)) = percent_rankValueFunc // sqlite3.c:151780:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 264 /* .xInverse */)) = percent_rankInvFunc // sqlite3.c:151780:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 272 /* .zName */)) = uintptr(unsafe.Pointer(&percent_rankName)) // sqlite3.c:151780:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 312 /* .xSFunc */)) = cume_distStepFunc // sqlite3.c:151781:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 320 /* .xFinalize */)) = cume_distValueFunc // sqlite3.c:151781:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 328 /* .xValue */)) = cume_distValueFunc // sqlite3.c:151781:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 336 /* .xInverse */)) = cume_distInvFunc // sqlite3.c:151781:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 344 /* .zName */)) = uintptr(unsafe.Pointer(&cume_distName)) // sqlite3.c:151781:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 384 /* .xSFunc */)) = ntileStepFunc // sqlite3.c:151782:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 392 /* .xFinalize */)) = ntileValueFunc // sqlite3.c:151782:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 400 /* .xValue */)) = ntileValueFunc // sqlite3.c:151782:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 408 /* .xInverse */)) = ntileInvFunc // sqlite3.c:151782:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 416 /* .zName */)) = uintptr(unsafe.Pointer(&ntileName)) // sqlite3.c:151782:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 456 /* .xSFunc */)) = last_valueStepFunc // sqlite3.c:151783:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 464 /* .xFinalize */)) = last_valueFinalizeFunc // sqlite3.c:151783:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 472 /* .xValue */)) = last_valueValueFunc // sqlite3.c:151783:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 480 /* .xInverse */)) = last_valueInvFunc // sqlite3.c:151783:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 488 /* .zName */)) = uintptr(unsafe.Pointer(&last_valueName)) // sqlite3.c:151783:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 528 /* .xSFunc */)) = nth_valueStepFunc // sqlite3.c:151784:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 536 /* .xFinalize */)) = nth_valueFinalizeFunc // sqlite3.c:151784:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 544 /* .xValue */)) = noopValueFunc // sqlite3.c:151784:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 552 /* .xInverse */)) = noopStepFunc // sqlite3.c:151784:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 560 /* .zName */)) = uintptr(unsafe.Pointer(&nth_valueName)) // sqlite3.c:151784:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 600 /* .xSFunc */)) = first_valueStepFunc // sqlite3.c:151785:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 608 /* .xFinalize */)) = first_valueFinalizeFunc // sqlite3.c:151785:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 616 /* .xValue */)) = noopValueFunc // sqlite3.c:151785:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 624 /* .xInverse */)) = noopStepFunc // sqlite3.c:151785:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 632 /* .zName */)) = uintptr(unsafe.Pointer(&first_valueName)) // sqlite3.c:151785:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 672 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151786:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 680 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151786:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 688 /* .xValue */)) = noopValueFunc // sqlite3.c:151786:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 696 /* .xInverse */)) = noopStepFunc // sqlite3.c:151786:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 704 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:151786:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 744 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151787:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 752 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151787:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 760 /* .xValue */)) = noopValueFunc // sqlite3.c:151787:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 768 /* .xInverse */)) = noopStepFunc // sqlite3.c:151787:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 776 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:151787:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 816 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151788:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 824 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151788:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 832 /* .xValue */)) = noopValueFunc // sqlite3.c:151788:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 840 /* .xInverse */)) = noopStepFunc // sqlite3.c:151788:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 848 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:151788:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 888 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151789:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 896 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151789:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 904 /* .xValue */)) = noopValueFunc // sqlite3.c:151789:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 912 /* .xInverse */)) = noopStepFunc // sqlite3.c:151789:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 920 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:151789:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 960 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151790:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 968 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151790:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 976 /* .xValue */)) = noopValueFunc // sqlite3.c:151790:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 984 /* .xInverse */)) = noopStepFunc // sqlite3.c:151790:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 992 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:151790:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1032 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151791:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1040 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151791:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1048 /* .xValue */)) = noopValueFunc // sqlite3.c:151791:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1056 /* .xInverse */)) = noopStepFunc // sqlite3.c:151791:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1064 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:151791:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&attach_func)) + 24 /* .xSFunc */)) = attachFunc // sqlite3.c:109918:5: - *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 0 /* .xMalloc */)) = sqlite3MemMalloc // sqlite3.c:23831:6: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 8 /* .xFree */)) = sqlite3MemFree // sqlite3.c:23832:6: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 16 /* .xRealloc */)) = sqlite3MemRealloc // sqlite3.c:23833:6: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 24 /* .xSize */)) = sqlite3MemSize // sqlite3.c:23834:6: - *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 32 /* .xRoundup */)) = sqlite3MemRoundup // sqlite3.c:23835:6: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 40 /* .xInit */)) = sqlite3MemInit // sqlite3.c:23836:6: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 48 /* .xShutdown */)) = sqlite3MemShutdown // sqlite3.c:23837:6: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 16 /* .xInit */)) = pcache1Init // sqlite3.c:50956:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 24 /* .xShutdown */)) = pcache1Shutdown // sqlite3.c:50957:5: - *(*func(*libc.TLS, int32, int32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 32 /* .xCreate */)) = pcache1Create // sqlite3.c:50958:5: - *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 40 /* .xCachesize */)) = pcache1Cachesize // sqlite3.c:50959:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 48 /* .xPagecount */)) = pcache1Pagecount // sqlite3.c:50960:5: - *(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 56 /* .xFetch */)) = pcache1Fetch // sqlite3.c:50961:5: - *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 64 /* .xUnpin */)) = pcache1Unpin // sqlite3.c:50962:5: - *(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 72 /* .xRekey */)) = pcache1Rekey // sqlite3.c:50963:5: - *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 80 /* .xTruncate */)) = pcache1Truncate // sqlite3.c:50964:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 88 /* .xDestroy */)) = pcache1Destroy // sqlite3.c:50965:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 96 /* .xShrink */)) = pcache1Shrink // sqlite3.c:50966:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&detach_func)) + 24 /* .xSFunc */)) = detachFunc // sqlite3.c:109898:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoFinder)) + 0)) = dotlockIoFinderImpl // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 8 /* .xClose */)) = dotlockClose // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 56 /* .xLock */)) = dotlockLock // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 64 /* .xUnlock */)) = dotlockUnlock // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 72 /* .xCheckReservedLock */)) = dotlockCheckReservedLock // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 8 /* .xCreate */)) = fts5CreateMethod // sqlite3.c:225749:25: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 16 /* .xConnect */)) = fts5ConnectMethod // sqlite3.c:225750:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 24 /* .xBestIndex */)) = fts5BestIndexMethod // sqlite3.c:225751:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 32 /* .xDisconnect */)) = fts5DisconnectMethod // sqlite3.c:225752:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 40 /* .xDestroy */)) = fts5DestroyMethod // sqlite3.c:225753:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 48 /* .xOpen */)) = fts5OpenMethod // sqlite3.c:225754:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 56 /* .xClose */)) = fts5CloseMethod // sqlite3.c:225755:25: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 64 /* .xFilter */)) = fts5FilterMethod // sqlite3.c:225756:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 72 /* .xNext */)) = fts5NextMethod // sqlite3.c:225757:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 80 /* .xEof */)) = fts5EofMethod // sqlite3.c:225758:25: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 88 /* .xColumn */)) = fts5ColumnMethod // sqlite3.c:225759:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 96 /* .xRowid */)) = fts5RowidMethod // sqlite3.c:225760:25: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 104 /* .xUpdate */)) = fts5UpdateMethod // sqlite3.c:225761:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 112 /* .xBegin */)) = fts5BeginMethod // sqlite3.c:225762:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 120 /* .xSync */)) = fts5SyncMethod // sqlite3.c:225763:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 128 /* .xCommit */)) = fts5CommitMethod // sqlite3.c:225764:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 136 /* .xRollback */)) = fts5RollbackMethod // sqlite3.c:225765:25: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 144 /* .xFindFunction */)) = fts5FindFunctionMethod // sqlite3.c:225766:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 152 /* .xRename */)) = fts5RenameMethod // sqlite3.c:225767:25: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 160 /* .xSavepoint */)) = fts5SavepointMethod // sqlite3.c:225768:25: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 168 /* .xRelease */)) = fts5ReleaseMethod // sqlite3.c:225769:25: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 176 /* .xRollbackTo */)) = fts5RollbackToMethod // sqlite3.c:225770:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 184 /* .xShadowName */)) = fts5ShadowName // sqlite3.c:225771:25: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 8 /* .xCreate */)) = fts5VocabCreateMethod // sqlite3.c:230174:25: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 16 /* .xConnect */)) = fts5VocabConnectMethod // sqlite3.c:230175:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 24 /* .xBestIndex */)) = fts5VocabBestIndexMethod // sqlite3.c:230176:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 32 /* .xDisconnect */)) = fts5VocabDisconnectMethod // sqlite3.c:230177:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 40 /* .xDestroy */)) = fts5VocabDestroyMethod // sqlite3.c:230178:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 48 /* .xOpen */)) = fts5VocabOpenMethod // sqlite3.c:230179:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 56 /* .xClose */)) = fts5VocabCloseMethod // sqlite3.c:230180:25: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 64 /* .xFilter */)) = fts5VocabFilterMethod // sqlite3.c:230181:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 72 /* .xNext */)) = fts5VocabNextMethod // sqlite3.c:230182:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 80 /* .xEof */)) = fts5VocabEofMethod // sqlite3.c:230183:25: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 88 /* .xColumn */)) = fts5VocabColumnMethod // sqlite3.c:230184:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 96 /* .xRowid */)) = fts5VocabRowidMethod // sqlite3.c:230185:25: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 8 /* .xCreate */)) = geopolyCreate // sqlite3.c:194165:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 16 /* .xConnect */)) = geopolyConnect // sqlite3.c:194166:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 24 /* .xBestIndex */)) = geopolyBestIndex // sqlite3.c:194167:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 32 /* .xDisconnect */)) = rtreeDisconnect // sqlite3.c:194168:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 40 /* .xDestroy */)) = rtreeDestroy // sqlite3.c:194169:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 48 /* .xOpen */)) = rtreeOpen // sqlite3.c:194170:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 56 /* .xClose */)) = rtreeClose // sqlite3.c:194171:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 64 /* .xFilter */)) = geopolyFilter // sqlite3.c:194172:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 72 /* .xNext */)) = rtreeNext // sqlite3.c:194173:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 80 /* .xEof */)) = rtreeEof // sqlite3.c:194174:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 88 /* .xColumn */)) = geopolyColumn // sqlite3.c:194175:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 96 /* .xRowid */)) = rtreeRowid // sqlite3.c:194176:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 104 /* .xUpdate */)) = geopolyUpdate // sqlite3.c:194177:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 112 /* .xBegin */)) = rtreeBeginTransaction // sqlite3.c:194178:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 120 /* .xSync */)) = rtreeEndTransaction // sqlite3.c:194179:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 128 /* .xCommit */)) = rtreeEndTransaction // sqlite3.c:194180:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 136 /* .xRollback */)) = rtreeEndTransaction // sqlite3.c:194181:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 144 /* .xFindFunction */)) = geopolyFindFunction // sqlite3.c:194182:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 152 /* .xRename */)) = rtreeRename // sqlite3.c:194183:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 160 /* .xSavepoint */)) = rtreeSavepoint // sqlite3.c:194184:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 184 /* .xShadowName */)) = rtreeShadowName // sqlite3.c:194187:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 16 /* .xConnect */)) = jsonEachConnect // sqlite3.c:187905:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 24 /* .xBestIndex */)) = jsonEachBestIndex // sqlite3.c:187906:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 32 /* .xDisconnect */)) = jsonEachDisconnect // sqlite3.c:187907:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 48 /* .xOpen */)) = jsonEachOpenEach // sqlite3.c:187909:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 56 /* .xClose */)) = jsonEachClose // sqlite3.c:187910:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 64 /* .xFilter */)) = jsonEachFilter // sqlite3.c:187911:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 72 /* .xNext */)) = jsonEachNext // sqlite3.c:187912:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 80 /* .xEof */)) = jsonEachEof // sqlite3.c:187913:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 88 /* .xColumn */)) = jsonEachColumn // sqlite3.c:187914:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 96 /* .xRowid */)) = jsonEachRowid // sqlite3.c:187915:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 16 /* .xConnect */)) = jsonEachConnect // sqlite3.c:187933:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 24 /* .xBestIndex */)) = jsonEachBestIndex // sqlite3.c:187934:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 32 /* .xDisconnect */)) = jsonEachDisconnect // sqlite3.c:187935:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 48 /* .xOpen */)) = jsonEachOpenTree // sqlite3.c:187937:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 56 /* .xClose */)) = jsonEachClose // sqlite3.c:187938:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 64 /* .xFilter */)) = jsonEachFilter // sqlite3.c:187939:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 72 /* .xNext */)) = jsonEachNext // sqlite3.c:187940:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 80 /* .xEof */)) = jsonEachEof // sqlite3.c:187941:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 88 /* .xColumn */)) = jsonEachColumn // sqlite3.c:187942:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 96 /* .xRowid */)) = jsonEachRowid // sqlite3.c:187943:3: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoFinder)) + 0)) = nolockIoFinderImpl // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 8 /* .xClose */)) = nolockClose // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 56 /* .xLock */)) = nolockLock // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 64 /* .xUnlock */)) = nolockUnlock // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 72 /* .xCheckReservedLock */)) = nolockCheckReservedLock // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoFinder)) + 0)) = posixIoFinderImpl // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 8 /* .xClose */)) = unixClose // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 56 /* .xLock */)) = unixLock // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 64 /* .xUnlock */)) = unixUnlock // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 72 /* .xCheckReservedLock */)) = unixCheckReservedLock // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 104 /* .xShmMap */)) = unixShmMap // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 16 /* .xConnect */)) = pragmaVtabConnect // sqlite3.c:128295:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 24 /* .xBestIndex */)) = pragmaVtabBestIndex // sqlite3.c:128296:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 32 /* .xDisconnect */)) = pragmaVtabDisconnect // sqlite3.c:128297:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 48 /* .xOpen */)) = pragmaVtabOpen // sqlite3.c:128299:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 56 /* .xClose */)) = pragmaVtabClose // sqlite3.c:128300:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 64 /* .xFilter */)) = pragmaVtabFilter // sqlite3.c:128301:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 72 /* .xNext */)) = pragmaVtabNext // sqlite3.c:128302:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 80 /* .xEof */)) = pragmaVtabEof // sqlite3.c:128303:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 88 /* .xColumn */)) = pragmaVtabColumn // sqlite3.c:128304:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 96 /* .xRowid */)) = pragmaVtabRowid // sqlite3.c:128305:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 8 /* .xClose */)) = rbuVfsClose // sqlite3.c:200803:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 16 /* .xRead */)) = rbuVfsRead // sqlite3.c:200804:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 24 /* .xWrite */)) = rbuVfsWrite // sqlite3.c:200805:5: - *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 32 /* .xTruncate */)) = rbuVfsTruncate // sqlite3.c:200806:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 40 /* .xSync */)) = rbuVfsSync // sqlite3.c:200807:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 48 /* .xFileSize */)) = rbuVfsFileSize // sqlite3.c:200808:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 56 /* .xLock */)) = rbuVfsLock // sqlite3.c:200809:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 64 /* .xUnlock */)) = rbuVfsUnlock // sqlite3.c:200810:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 72 /* .xCheckReservedLock */)) = rbuVfsCheckReservedLock // sqlite3.c:200811:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 80 /* .xFileControl */)) = rbuVfsFileControl // sqlite3.c:200812:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 88 /* .xSectorSize */)) = rbuVfsSectorSize // sqlite3.c:200813:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 96 /* .xDeviceCharacteristics */)) = rbuVfsDeviceCharacteristics // sqlite3.c:200814:5: - *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 104 /* .xShmMap */)) = rbuVfsShmMap // sqlite3.c:200815:5: - *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 112 /* .xShmLock */)) = rbuVfsShmLock // sqlite3.c:200816:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 120 /* .xShmBarrier */)) = rbuVfsShmBarrier // sqlite3.c:200817:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 128 /* .xShmUnmap */)) = rbuVfsShmUnmap // sqlite3.c:200818:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 8 /* .xCreate */)) = rtreeCreate // sqlite3.c:191518:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 16 /* .xConnect */)) = rtreeConnect // sqlite3.c:191519:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 24 /* .xBestIndex */)) = rtreeBestIndex // sqlite3.c:191520:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 32 /* .xDisconnect */)) = rtreeDisconnect // sqlite3.c:191521:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 40 /* .xDestroy */)) = rtreeDestroy // sqlite3.c:191522:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 48 /* .xOpen */)) = rtreeOpen // sqlite3.c:191523:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 56 /* .xClose */)) = rtreeClose // sqlite3.c:191524:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 64 /* .xFilter */)) = rtreeFilter // sqlite3.c:191525:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 72 /* .xNext */)) = rtreeNext // sqlite3.c:191526:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 80 /* .xEof */)) = rtreeEof // sqlite3.c:191527:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 88 /* .xColumn */)) = rtreeColumn // sqlite3.c:191528:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 96 /* .xRowid */)) = rtreeRowid // sqlite3.c:191529:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 104 /* .xUpdate */)) = rtreeUpdate // sqlite3.c:191530:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 112 /* .xBegin */)) = rtreeBeginTransaction // sqlite3.c:191531:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 120 /* .xSync */)) = rtreeEndTransaction // sqlite3.c:191532:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 128 /* .xCommit */)) = rtreeEndTransaction // sqlite3.c:191533:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 136 /* .xRollback */)) = rtreeEndTransaction // sqlite3.c:191534:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 152 /* .xRename */)) = rtreeRename // sqlite3.c:191536:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 160 /* .xSavepoint */)) = rtreeSavepoint // sqlite3.c:191537:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 184 /* .xShadowName */)) = rtreeShadowName // sqlite3.c:191540:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 8 /* .xUserData */)) = fts5ApiUserData // sqlite3.c:225213:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 16 /* .xColumnCount */)) = fts5ApiColumnCount // sqlite3.c:225214:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 24 /* .xRowCount */)) = fts5ApiRowCount // sqlite3.c:225215:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 32 /* .xColumnTotalSize */)) = fts5ApiColumnTotalSize // sqlite3.c:225216:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 40 /* .xTokenize */)) = fts5ApiTokenize // sqlite3.c:225217:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 48 /* .xPhraseCount */)) = fts5ApiPhraseCount // sqlite3.c:225218:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 56 /* .xPhraseSize */)) = fts5ApiPhraseSize // sqlite3.c:225219:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 64 /* .xInstCount */)) = fts5ApiInstCount // sqlite3.c:225220:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 72 /* .xInst */)) = fts5ApiInst // sqlite3.c:225221:3: - *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 80 /* .xRowid */)) = fts5ApiRowid // sqlite3.c:225222:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 88 /* .xColumnText */)) = fts5ApiColumnText // sqlite3.c:225223:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 96 /* .xColumnSize */)) = fts5ApiColumnSize // sqlite3.c:225224:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 104 /* .xQueryPhrase */)) = fts5ApiQueryPhrase // sqlite3.c:225225:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 112 /* .xSetAuxdata */)) = fts5ApiSetAuxdata // sqlite3.c:225226:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 120 /* .xGetAuxdata */)) = fts5ApiGetAuxdata // sqlite3.c:225227:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 128 /* .xPhraseFirst */)) = fts5ApiPhraseFirst // sqlite3.c:225228:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 136 /* .xPhraseNext */)) = fts5ApiPhraseNext // sqlite3.c:225229:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 144 /* .xPhraseFirstColumn */)) = fts5ApiPhraseFirstColumn // sqlite3.c:225230:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 152 /* .xPhraseNextColumn */)) = fts5ApiPhraseNextColumn // sqlite3.c:225231:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 8 /* .xClose */)) = memjrnlClose // sqlite3.c:97386:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 16 /* .xRead */)) = memjrnlRead // sqlite3.c:97387:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 24 /* .xWrite */)) = memjrnlWrite // sqlite3.c:97388:3: - *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 32 /* .xTruncate */)) = memjrnlTruncate // sqlite3.c:97389:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 40 /* .xSync */)) = memjrnlSync // sqlite3.c:97390:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 48 /* .xFileSize */)) = memjrnlFileSize // sqlite3.c:97391:3: - *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 0 /* .xMutexInit */)) = noopMutexInit // sqlite3.c:26064:5: - *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 8 /* .xMutexEnd */)) = noopMutexEnd // sqlite3.c:26065:5: - *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 16 /* .xMutexAlloc */)) = noopMutexAlloc // sqlite3.c:26066:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 24 /* .xMutexFree */)) = noopMutexFree // sqlite3.c:26067:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 32 /* .xMutexEnter */)) = noopMutexEnter // sqlite3.c:26068:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 40 /* .xMutexTry */)) = noopMutexTry // sqlite3.c:26069:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 48 /* .xMutexLeave */)) = noopMutexLeave // sqlite3.c:26070:5: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 0 /* .aggregate_context */)) = Xsqlite3_aggregate_context // sqlite3.c:124372:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 8 /* .aggregate_count */)) = Xsqlite3_aggregate_count // sqlite3.c:124374:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 16 /* .bind_blob */)) = Xsqlite3_bind_blob // sqlite3.c:124378:3: - *(*func(*libc.TLS, uintptr, int32, float64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 24 /* .bind_double */)) = Xsqlite3_bind_double // sqlite3.c:124379:3: - *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 32 /* .bind_int */)) = Xsqlite3_bind_int // sqlite3.c:124380:3: - *(*func(*libc.TLS, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 40 /* .bind_int64 */)) = Xsqlite3_bind_int64 // sqlite3.c:124381:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 48 /* .bind_null */)) = Xsqlite3_bind_null // sqlite3.c:124382:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 56 /* .bind_parameter_count */)) = Xsqlite3_bind_parameter_count // sqlite3.c:124383:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 64 /* .bind_parameter_index */)) = Xsqlite3_bind_parameter_index // sqlite3.c:124384:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 72 /* .bind_parameter_name */)) = Xsqlite3_bind_parameter_name // sqlite3.c:124385:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 80 /* .bind_text */)) = Xsqlite3_bind_text // sqlite3.c:124386:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 88 /* .bind_text16 */)) = Xsqlite3_bind_text16 // sqlite3.c:124387:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 96 /* .bind_value */)) = Xsqlite3_bind_value // sqlite3.c:124388:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 104 /* .busy_handler */)) = Xsqlite3_busy_handler // sqlite3.c:124389:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 112 /* .busy_timeout */)) = Xsqlite3_busy_timeout // sqlite3.c:124390:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 120 /* .changes */)) = Xsqlite3_changes // sqlite3.c:124391:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 128 /* .close */)) = Xsqlite3_close // sqlite3.c:124392:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 136 /* .collation_needed */)) = Xsqlite3_collation_needed // sqlite3.c:124393:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 144 /* .collation_needed16 */)) = Xsqlite3_collation_needed16 // sqlite3.c:124394:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 152 /* .column_blob */)) = Xsqlite3_column_blob // sqlite3.c:124395:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 160 /* .column_bytes */)) = Xsqlite3_column_bytes // sqlite3.c:124396:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 168 /* .column_bytes16 */)) = Xsqlite3_column_bytes16 // sqlite3.c:124397:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 176 /* .column_count */)) = Xsqlite3_column_count // sqlite3.c:124398:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 184 /* .column_database_name */)) = Xsqlite3_column_database_name // sqlite3.c:124399:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 192 /* .column_database_name16 */)) = Xsqlite3_column_database_name16 // sqlite3.c:124400:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 200 /* .column_decltype */)) = Xsqlite3_column_decltype // sqlite3.c:124401:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 208 /* .column_decltype16 */)) = Xsqlite3_column_decltype16 // sqlite3.c:124402:3: - *(*func(*libc.TLS, uintptr, int32) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 216 /* .column_double */)) = Xsqlite3_column_double // sqlite3.c:124403:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 224 /* .column_int */)) = Xsqlite3_column_int // sqlite3.c:124404:3: - *(*func(*libc.TLS, uintptr, int32) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 232 /* .column_int64 */)) = Xsqlite3_column_int64 // sqlite3.c:124405:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 240 /* .column_name */)) = Xsqlite3_column_name // sqlite3.c:124406:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 248 /* .column_name16 */)) = Xsqlite3_column_name16 // sqlite3.c:124407:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 256 /* .column_origin_name */)) = Xsqlite3_column_origin_name // sqlite3.c:124408:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 264 /* .column_origin_name16 */)) = Xsqlite3_column_origin_name16 // sqlite3.c:124409:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 272 /* .column_table_name */)) = Xsqlite3_column_table_name // sqlite3.c:124410:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 280 /* .column_table_name16 */)) = Xsqlite3_column_table_name16 // sqlite3.c:124411:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 288 /* .column_text */)) = Xsqlite3_column_text // sqlite3.c:124412:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 296 /* .column_text16 */)) = Xsqlite3_column_text16 // sqlite3.c:124413:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 304 /* .column_type */)) = Xsqlite3_column_type // sqlite3.c:124414:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 312 /* .column_value */)) = Xsqlite3_column_value // sqlite3.c:124415:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 320 /* .commit_hook */)) = Xsqlite3_commit_hook // sqlite3.c:124416:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 328 /* .complete */)) = Xsqlite3_complete // sqlite3.c:124417:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 336 /* .complete16 */)) = Xsqlite3_complete16 // sqlite3.c:124418:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 344 /* .create_collation */)) = Xsqlite3_create_collation // sqlite3.c:124419:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 352 /* .create_collation16 */)) = Xsqlite3_create_collation16 // sqlite3.c:124420:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 360 /* .create_function */)) = Xsqlite3_create_function // sqlite3.c:124421:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 368 /* .create_function16 */)) = Xsqlite3_create_function16 // sqlite3.c:124422:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 376 /* .create_module */)) = Xsqlite3_create_module // sqlite3.c:124423:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 384 /* .data_count */)) = Xsqlite3_data_count // sqlite3.c:124424:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 392 /* .db_handle */)) = Xsqlite3_db_handle // sqlite3.c:124425:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 400 /* .declare_vtab */)) = Xsqlite3_declare_vtab // sqlite3.c:124426:3: - *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 408 /* .enable_shared_cache */)) = Xsqlite3_enable_shared_cache // sqlite3.c:124427:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 416 /* .errcode */)) = Xsqlite3_errcode // sqlite3.c:124428:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 424 /* .errmsg */)) = Xsqlite3_errmsg // sqlite3.c:124429:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 432 /* .errmsg16 */)) = Xsqlite3_errmsg16 // sqlite3.c:124430:3: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_callback, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 440 /* .exec */)) = Xsqlite3_exec // sqlite3.c:124431:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 448 /* .expired */)) = Xsqlite3_expired // sqlite3.c:124433:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 456 /* .finalize */)) = Xsqlite3_finalize // sqlite3.c:124437:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 464 /* .free */)) = Xsqlite3_free // sqlite3.c:124438:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 472 /* .free_table */)) = Xsqlite3_free_table // sqlite3.c:124439:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 480 /* .get_autocommit */)) = Xsqlite3_get_autocommit // sqlite3.c:124440:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 488 /* .get_auxdata */)) = Xsqlite3_get_auxdata // sqlite3.c:124441:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 496 /* .get_table */)) = Xsqlite3_get_table // sqlite3.c:124442:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 512 /* .interruptx */)) = Xsqlite3_interrupt // sqlite3.c:124444:3: - *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 520 /* .last_insert_rowid */)) = Xsqlite3_last_insert_rowid // sqlite3.c:124445:3: - *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 528 /* .libversion */)) = Xsqlite3_libversion // sqlite3.c:124446:3: - *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 536 /* .libversion_number */)) = Xsqlite3_libversion_number // sqlite3.c:124447:3: - *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 544 /* .malloc */)) = Xsqlite3_malloc // sqlite3.c:124448:3: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 552 /* .mprintf */)) = Xsqlite3_mprintf // sqlite3.c:124449:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 560 /* .open */)) = Xsqlite3_open // sqlite3.c:124450:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 568 /* .open16 */)) = Xsqlite3_open16 // sqlite3.c:124451:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 576 /* .prepare */)) = Xsqlite3_prepare // sqlite3.c:124452:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 584 /* .prepare16 */)) = Xsqlite3_prepare16 // sqlite3.c:124453:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 592 /* .profile */)) = Xsqlite3_profile // sqlite3.c:124454:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 600 /* .progress_handler */)) = Xsqlite3_progress_handler // sqlite3.c:124455:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 608 /* .realloc */)) = Xsqlite3_realloc // sqlite3.c:124456:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 616 /* .reset */)) = Xsqlite3_reset // sqlite3.c:124457:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 624 /* .result_blob */)) = Xsqlite3_result_blob // sqlite3.c:124458:3: - *(*func(*libc.TLS, uintptr, float64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 632 /* .result_double */)) = Xsqlite3_result_double // sqlite3.c:124459:3: - *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 640 /* .result_error */)) = Xsqlite3_result_error // sqlite3.c:124460:3: - *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 648 /* .result_error16 */)) = Xsqlite3_result_error16 // sqlite3.c:124461:3: - *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 656 /* .result_int */)) = Xsqlite3_result_int // sqlite3.c:124462:3: - *(*func(*libc.TLS, uintptr, I64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 664 /* .result_int64 */)) = Xsqlite3_result_int64 // sqlite3.c:124463:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 672 /* .result_null */)) = Xsqlite3_result_null // sqlite3.c:124464:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 680 /* .result_text */)) = Xsqlite3_result_text // sqlite3.c:124465:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 688 /* .result_text16 */)) = Xsqlite3_result_text16 // sqlite3.c:124466:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 696 /* .result_text16be */)) = Xsqlite3_result_text16be // sqlite3.c:124467:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 704 /* .result_text16le */)) = Xsqlite3_result_text16le // sqlite3.c:124468:3: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 712 /* .result_value */)) = Xsqlite3_result_value // sqlite3.c:124469:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 720 /* .rollback_hook */)) = Xsqlite3_rollback_hook // sqlite3.c:124470:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 728 /* .set_authorizer */)) = Xsqlite3_set_authorizer // sqlite3.c:124471:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 736 /* .set_auxdata */)) = Xsqlite3_set_auxdata // sqlite3.c:124472:3: - *(*func(*libc.TLS, int32, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 744 /* .xsnprintf */)) = Xsqlite3_snprintf // sqlite3.c:124473:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 752 /* .step */)) = Xsqlite3_step // sqlite3.c:124474:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 760 /* .table_column_metadata */)) = Xsqlite3_table_column_metadata // sqlite3.c:124475:3: - *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 768 /* .thread_cleanup */)) = Xsqlite3_thread_cleanup // sqlite3.c:124477:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 776 /* .total_changes */)) = Xsqlite3_total_changes // sqlite3.c:124481:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 784 /* .trace */)) = Xsqlite3_trace // sqlite3.c:124482:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 792 /* .transfer_bindings */)) = Xsqlite3_transfer_bindings // sqlite3.c:124484:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 800 /* .update_hook */)) = Xsqlite3_update_hook // sqlite3.c:124488:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 808 /* .user_data */)) = Xsqlite3_user_data // sqlite3.c:124489:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 816 /* .value_blob */)) = Xsqlite3_value_blob // sqlite3.c:124490:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 824 /* .value_bytes */)) = Xsqlite3_value_bytes // sqlite3.c:124491:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 832 /* .value_bytes16 */)) = Xsqlite3_value_bytes16 // sqlite3.c:124492:3: - *(*func(*libc.TLS, uintptr) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 840 /* .value_double */)) = Xsqlite3_value_double // sqlite3.c:124493:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 848 /* .value_int */)) = Xsqlite3_value_int // sqlite3.c:124494:3: - *(*func(*libc.TLS, uintptr) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 856 /* .value_int64 */)) = Xsqlite3_value_int64 // sqlite3.c:124495:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 864 /* .value_numeric_type */)) = Xsqlite3_value_numeric_type // sqlite3.c:124496:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 872 /* .value_text */)) = Xsqlite3_value_text // sqlite3.c:124497:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 880 /* .value_text16 */)) = Xsqlite3_value_text16 // sqlite3.c:124498:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 888 /* .value_text16be */)) = Xsqlite3_value_text16be // sqlite3.c:124499:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 896 /* .value_text16le */)) = Xsqlite3_value_text16le // sqlite3.c:124500:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 904 /* .value_type */)) = Xsqlite3_value_type // sqlite3.c:124501:3: - *(*func(*libc.TLS, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 912 /* .vmprintf */)) = Xsqlite3_vmprintf // sqlite3.c:124502:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 920 /* .overload_function */)) = Xsqlite3_overload_function // sqlite3.c:124511:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 928 /* .prepare_v2 */)) = Xsqlite3_prepare_v2 // sqlite3.c:124516:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 936 /* .prepare16_v2 */)) = Xsqlite3_prepare16_v2 // sqlite3.c:124517:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 944 /* .clear_bindings */)) = Xsqlite3_clear_bindings // sqlite3.c:124518:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 952 /* .create_module_v2 */)) = Xsqlite3_create_module_v2 // sqlite3.c:124523:3: - *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 960 /* .bind_zeroblob */)) = Xsqlite3_bind_zeroblob // sqlite3.c:124528:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 968 /* .blob_bytes */)) = Xsqlite3_blob_bytes // sqlite3.c:124529:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 976 /* .blob_close */)) = Xsqlite3_blob_close // sqlite3.c:124530:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, Sqlite_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 984 /* .blob_open */)) = Xsqlite3_blob_open // sqlite3.c:124531:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 992 /* .blob_read */)) = Xsqlite3_blob_read // sqlite3.c:124532:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1000 /* .blob_write */)) = Xsqlite3_blob_write // sqlite3.c:124533:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1008 /* .create_collation_v2 */)) = Xsqlite3_create_collation_v2 // sqlite3.c:124534:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1016 /* .file_control */)) = Xsqlite3_file_control // sqlite3.c:124535:3: - *(*func(*libc.TLS, int32) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1024 /* .memory_highwater */)) = Xsqlite3_memory_highwater // sqlite3.c:124536:3: - *(*func(*libc.TLS) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1032 /* .memory_used */)) = Xsqlite3_memory_used // sqlite3.c:124537:3: - *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1040 /* .mutex_alloc */)) = Xsqlite3_mutex_alloc // sqlite3.c:124545:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1048 /* .mutex_enter */)) = Xsqlite3_mutex_enter // sqlite3.c:124546:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1056 /* .mutex_free */)) = Xsqlite3_mutex_free // sqlite3.c:124547:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1064 /* .mutex_leave */)) = Xsqlite3_mutex_leave // sqlite3.c:124548:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1072 /* .mutex_try */)) = Xsqlite3_mutex_try // sqlite3.c:124549:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1080 /* .open_v2 */)) = Xsqlite3_open_v2 // sqlite3.c:124551:3: - *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1088 /* .release_memory */)) = Xsqlite3_release_memory // sqlite3.c:124552:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1096 /* .result_error_nomem */)) = Xsqlite3_result_error_nomem // sqlite3.c:124553:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1104 /* .result_error_toobig */)) = Xsqlite3_result_error_toobig // sqlite3.c:124554:3: - *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1112 /* .sleep */)) = Xsqlite3_sleep // sqlite3.c:124555:3: - *(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1120 /* .soft_heap_limit */)) = Xsqlite3_soft_heap_limit // sqlite3.c:124556:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1128 /* .vfs_find */)) = Xsqlite3_vfs_find // sqlite3.c:124557:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1136 /* .vfs_register */)) = Xsqlite3_vfs_register // sqlite3.c:124558:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1144 /* .vfs_unregister */)) = Xsqlite3_vfs_unregister // sqlite3.c:124559:3: - *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1152 /* .xthreadsafe */)) = Xsqlite3_threadsafe // sqlite3.c:124564:3: - *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1160 /* .result_zeroblob */)) = Xsqlite3_result_zeroblob // sqlite3.c:124565:3: - *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1168 /* .result_error_code */)) = Xsqlite3_result_error_code // sqlite3.c:124566:3: - *(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1176 /* .test_control */)) = Xsqlite3_test_control // sqlite3.c:124567:3: - *(*func(*libc.TLS, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1184 /* .randomness */)) = Xsqlite3_randomness // sqlite3.c:124568:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1192 /* .context_db_handle */)) = Xsqlite3_context_db_handle // sqlite3.c:124569:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1200 /* .extended_result_codes */)) = Xsqlite3_extended_result_codes // sqlite3.c:124574:3: - *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1208 /* .limit */)) = Xsqlite3_limit // sqlite3.c:124575:3: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1216 /* .next_stmt */)) = Xsqlite3_next_stmt // sqlite3.c:124576:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1224 /* .sql */)) = Xsqlite3_sql // sqlite3.c:124577:3: - *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1232 /* .status */)) = Xsqlite3_status // sqlite3.c:124578:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1240 /* .backup_finish */)) = Xsqlite3_backup_finish // sqlite3.c:124583:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1248 /* .backup_init */)) = Xsqlite3_backup_init // sqlite3.c:124584:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1256 /* .backup_pagecount */)) = Xsqlite3_backup_pagecount // sqlite3.c:124585:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1264 /* .backup_remaining */)) = Xsqlite3_backup_remaining // sqlite3.c:124586:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1272 /* .backup_step */)) = Xsqlite3_backup_step // sqlite3.c:124587:3: - *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1280 /* .compileoption_get */)) = Xsqlite3_compileoption_get // sqlite3.c:124589:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1288 /* .compileoption_used */)) = Xsqlite3_compileoption_used // sqlite3.c:124590:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1296 /* .create_function_v2 */)) = Xsqlite3_create_function_v2 // sqlite3.c:124595:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1304 /* .db_config */)) = Xsqlite3_db_config // sqlite3.c:124596:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1312 /* .db_mutex */)) = Xsqlite3_db_mutex // sqlite3.c:124597:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1320 /* .db_status */)) = Xsqlite3_db_status // sqlite3.c:124598:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1328 /* .extended_errcode */)) = Xsqlite3_extended_errcode // sqlite3.c:124599:3: - *(*func(*libc.TLS, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1336 /* .log */)) = Xsqlite3_log // sqlite3.c:124600:3: - *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1344 /* .soft_heap_limit64 */)) = Xsqlite3_soft_heap_limit64 // sqlite3.c:124601:3: - *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1352 /* .sourceid */)) = Xsqlite3_sourceid // sqlite3.c:124602:3: - *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1360 /* .stmt_status */)) = Xsqlite3_stmt_status // sqlite3.c:124603:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1368 /* .strnicmp */)) = Xsqlite3_strnicmp // sqlite3.c:124604:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1376 /* .unlock_notify */)) = Xsqlite3_unlock_notify // sqlite3.c:124606:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1384 /* .wal_autocheckpoint */)) = Xsqlite3_wal_autocheckpoint // sqlite3.c:124611:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1392 /* .wal_checkpoint */)) = Xsqlite3_wal_checkpoint // sqlite3.c:124612:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1400 /* .wal_hook */)) = Xsqlite3_wal_hook // sqlite3.c:124613:3: - *(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1408 /* .blob_reopen */)) = Xsqlite3_blob_reopen // sqlite3.c:124619:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1416 /* .vtab_config */)) = Xsqlite3_vtab_config // sqlite3.c:124620:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1424 /* .vtab_on_conflict */)) = Xsqlite3_vtab_on_conflict // sqlite3.c:124621:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1432 /* .close_v2 */)) = Xsqlite3_close_v2 // sqlite3.c:124622:3: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1440 /* .db_filename */)) = Xsqlite3_db_filename // sqlite3.c:124623:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1448 /* .db_readonly */)) = Xsqlite3_db_readonly // sqlite3.c:124624:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1456 /* .db_release_memory */)) = Xsqlite3_db_release_memory // sqlite3.c:124625:3: - *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1464 /* .errstr */)) = Xsqlite3_errstr // sqlite3.c:124626:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1472 /* .stmt_busy */)) = Xsqlite3_stmt_busy // sqlite3.c:124627:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1480 /* .stmt_readonly */)) = Xsqlite3_stmt_readonly // sqlite3.c:124628:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1488 /* .stricmp */)) = Xsqlite3_stricmp // sqlite3.c:124629:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1496 /* .uri_boolean */)) = Xsqlite3_uri_boolean // sqlite3.c:124630:3: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1504 /* .uri_int64 */)) = Xsqlite3_uri_int64 // sqlite3.c:124631:3: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1512 /* .uri_parameter */)) = Xsqlite3_uri_parameter // sqlite3.c:124632:3: - *(*func(*libc.TLS, int32, uintptr, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1520 /* .xvsnprintf */)) = Xsqlite3_vsnprintf // sqlite3.c:124633:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1528 /* .wal_checkpoint_v2 */)) = Xsqlite3_wal_checkpoint_v2 // sqlite3.c:124634:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1536 /* .auto_extension */)) = Xsqlite3_auto_extension // sqlite3.c:124636:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1544 /* .bind_blob64 */)) = Xsqlite3_bind_blob64 // sqlite3.c:124637:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr, uint8) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1552 /* .bind_text64 */)) = Xsqlite3_bind_text64 // sqlite3.c:124638:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1560 /* .cancel_auto_extension */)) = Xsqlite3_cancel_auto_extension // sqlite3.c:124639:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1568 /* .load_extension */)) = Xsqlite3_load_extension // sqlite3.c:124640:3: - *(*func(*libc.TLS, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1576 /* .malloc64 */)) = Xsqlite3_malloc64 // sqlite3.c:124641:3: - *(*func(*libc.TLS, uintptr) Sqlite3_uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1584 /* .msize */)) = Xsqlite3_msize // sqlite3.c:124642:3: - *(*func(*libc.TLS, uintptr, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1592 /* .realloc64 */)) = Xsqlite3_realloc64 // sqlite3.c:124643:3: - *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1600 /* .reset_auto_extension */)) = Xsqlite3_reset_auto_extension // sqlite3.c:124644:3: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1608 /* .result_blob64 */)) = Xsqlite3_result_blob64 // sqlite3.c:124645:3: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr, uint8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1616 /* .result_text64 */)) = Xsqlite3_result_text64 // sqlite3.c:124646:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1624 /* .strglob */)) = Xsqlite3_strglob // sqlite3.c:124647:3: + }{libc.Xlstat})) // sqlite3.c:34387:22: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 32 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 40 /* .xOpen */)) = unixOpen // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 48 /* .xDelete */)) = unixDelete // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 56 /* .xAccess */)) = unixAccess // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 64 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 72 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 80 /* .xDlError */)) = unixDlError // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 88 /* .xDlSym */)) = unixDlSym // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 96 /* .xDlClose */)) = unixDlClose // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 104 /* .xRandomness */)) = unixRandomness // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 112 /* .xSleep */)) = unixSleep // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 120 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 128 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 136 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 144 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 152 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 160 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41854:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 200 /* .pAppData */)) = uintptr(unsafe.Pointer(&nolockIoFinder)) // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 208 /* .xOpen */)) = unixOpen // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 216 /* .xDelete */)) = unixDelete // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 224 /* .xAccess */)) = unixAccess // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 232 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 240 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 248 /* .xDlError */)) = unixDlError // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 256 /* .xDlSym */)) = unixDlSym // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 264 /* .xDlClose */)) = unixDlClose // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 272 /* .xRandomness */)) = unixRandomness // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 280 /* .xSleep */)) = unixSleep // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 288 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 296 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 304 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 312 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 320 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 328 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41856:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 368 /* .pAppData */)) = uintptr(unsafe.Pointer(&dotlockIoFinder)) // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 376 /* .xOpen */)) = unixOpen // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 384 /* .xDelete */)) = unixDelete // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 392 /* .xAccess */)) = unixAccess // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 400 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 408 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 416 /* .xDlError */)) = unixDlError // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 424 /* .xDlSym */)) = unixDlSym // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 432 /* .xDlClose */)) = unixDlClose // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 440 /* .xRandomness */)) = unixRandomness // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 448 /* .xSleep */)) = unixSleep // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 456 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 464 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 472 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 480 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 488 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 496 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41857:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 536 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 544 /* .xOpen */)) = unixOpen // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 552 /* .xDelete */)) = unixDelete // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 560 /* .xAccess */)) = unixAccess // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 568 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 576 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 584 /* .xDlError */)) = unixDlError // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 592 /* .xDlSym */)) = unixDlSym // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 600 /* .xDlClose */)) = unixDlClose // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 608 /* .xRandomness */)) = unixRandomness // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 616 /* .xSleep */)) = unixSleep // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 624 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 632 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 640 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 648 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 656 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 664 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 24 /* .xSFunc */)) = row_numberStepFunc // sqlite3.c:154436:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 32 /* .xFinalize */)) = row_numberValueFunc // sqlite3.c:154436:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 40 /* .xValue */)) = row_numberValueFunc // sqlite3.c:154436:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 48 /* .xInverse */)) = noopStepFunc // sqlite3.c:154436:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 56 /* .zName */)) = uintptr(unsafe.Pointer(&row_numberName)) // sqlite3.c:154436:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 96 /* .xSFunc */)) = dense_rankStepFunc // sqlite3.c:154437:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 104 /* .xFinalize */)) = dense_rankValueFunc // sqlite3.c:154437:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 112 /* .xValue */)) = dense_rankValueFunc // sqlite3.c:154437:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 120 /* .xInverse */)) = noopStepFunc // sqlite3.c:154437:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 128 /* .zName */)) = uintptr(unsafe.Pointer(&dense_rankName)) // sqlite3.c:154437:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 168 /* .xSFunc */)) = rankStepFunc // sqlite3.c:154438:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 176 /* .xFinalize */)) = rankValueFunc // sqlite3.c:154438:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 184 /* .xValue */)) = rankValueFunc // sqlite3.c:154438:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 192 /* .xInverse */)) = noopStepFunc // sqlite3.c:154438:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 200 /* .zName */)) = uintptr(unsafe.Pointer(&rankName)) // sqlite3.c:154438:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 240 /* .xSFunc */)) = percent_rankStepFunc // sqlite3.c:154439:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 248 /* .xFinalize */)) = percent_rankValueFunc // sqlite3.c:154439:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 256 /* .xValue */)) = percent_rankValueFunc // sqlite3.c:154439:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 264 /* .xInverse */)) = percent_rankInvFunc // sqlite3.c:154439:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 272 /* .zName */)) = uintptr(unsafe.Pointer(&percent_rankName)) // sqlite3.c:154439:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 312 /* .xSFunc */)) = cume_distStepFunc // sqlite3.c:154440:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 320 /* .xFinalize */)) = cume_distValueFunc // sqlite3.c:154440:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 328 /* .xValue */)) = cume_distValueFunc // sqlite3.c:154440:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 336 /* .xInverse */)) = cume_distInvFunc // sqlite3.c:154440:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 344 /* .zName */)) = uintptr(unsafe.Pointer(&cume_distName)) // sqlite3.c:154440:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 384 /* .xSFunc */)) = ntileStepFunc // sqlite3.c:154441:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 392 /* .xFinalize */)) = ntileValueFunc // sqlite3.c:154441:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 400 /* .xValue */)) = ntileValueFunc // sqlite3.c:154441:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 408 /* .xInverse */)) = ntileInvFunc // sqlite3.c:154441:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 416 /* .zName */)) = uintptr(unsafe.Pointer(&ntileName)) // sqlite3.c:154441:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 456 /* .xSFunc */)) = last_valueStepFunc // sqlite3.c:154442:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 464 /* .xFinalize */)) = last_valueFinalizeFunc // sqlite3.c:154442:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 472 /* .xValue */)) = last_valueValueFunc // sqlite3.c:154442:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 480 /* .xInverse */)) = last_valueInvFunc // sqlite3.c:154442:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 488 /* .zName */)) = uintptr(unsafe.Pointer(&last_valueName)) // sqlite3.c:154442:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 528 /* .xSFunc */)) = nth_valueStepFunc // sqlite3.c:154443:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 536 /* .xFinalize */)) = nth_valueFinalizeFunc // sqlite3.c:154443:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 544 /* .xValue */)) = noopValueFunc // sqlite3.c:154443:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 552 /* .xInverse */)) = noopStepFunc // sqlite3.c:154443:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 560 /* .zName */)) = uintptr(unsafe.Pointer(&nth_valueName)) // sqlite3.c:154443:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 600 /* .xSFunc */)) = first_valueStepFunc // sqlite3.c:154444:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 608 /* .xFinalize */)) = first_valueFinalizeFunc // sqlite3.c:154444:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 616 /* .xValue */)) = noopValueFunc // sqlite3.c:154444:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 624 /* .xInverse */)) = noopStepFunc // sqlite3.c:154444:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 632 /* .zName */)) = uintptr(unsafe.Pointer(&first_valueName)) // sqlite3.c:154444:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 672 /* .xSFunc */)) = noopStepFunc // sqlite3.c:154445:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 680 /* .xFinalize */)) = noopValueFunc // sqlite3.c:154445:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 688 /* .xValue */)) = noopValueFunc // sqlite3.c:154445:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 696 /* .xInverse */)) = noopStepFunc // sqlite3.c:154445:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 704 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:154445:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 744 /* .xSFunc */)) = noopStepFunc // sqlite3.c:154446:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 752 /* .xFinalize */)) = noopValueFunc // sqlite3.c:154446:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 760 /* .xValue */)) = noopValueFunc // sqlite3.c:154446:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 768 /* .xInverse */)) = noopStepFunc // sqlite3.c:154446:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 776 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:154446:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 816 /* .xSFunc */)) = noopStepFunc // sqlite3.c:154447:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 824 /* .xFinalize */)) = noopValueFunc // sqlite3.c:154447:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 832 /* .xValue */)) = noopValueFunc // sqlite3.c:154447:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 840 /* .xInverse */)) = noopStepFunc // sqlite3.c:154447:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 848 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:154447:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 888 /* .xSFunc */)) = noopStepFunc // sqlite3.c:154448:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 896 /* .xFinalize */)) = noopValueFunc // sqlite3.c:154448:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 904 /* .xValue */)) = noopValueFunc // sqlite3.c:154448:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 912 /* .xInverse */)) = noopStepFunc // sqlite3.c:154448:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 920 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:154448:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 960 /* .xSFunc */)) = noopStepFunc // sqlite3.c:154449:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 968 /* .xFinalize */)) = noopValueFunc // sqlite3.c:154449:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 976 /* .xValue */)) = noopValueFunc // sqlite3.c:154449:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 984 /* .xInverse */)) = noopStepFunc // sqlite3.c:154449:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 992 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:154449:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1032 /* .xSFunc */)) = noopStepFunc // sqlite3.c:154450:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1040 /* .xFinalize */)) = noopValueFunc // sqlite3.c:154450:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1048 /* .xValue */)) = noopValueFunc // sqlite3.c:154450:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1056 /* .xInverse */)) = noopStepFunc // sqlite3.c:154450:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1064 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:154450:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&attach_func)) + 24 /* .xSFunc */)) = attachFunc // sqlite3.c:111076:5: + *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 0 /* .xMalloc */)) = sqlite3MemMalloc // sqlite3.c:24111:6: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 8 /* .xFree */)) = sqlite3MemFree // sqlite3.c:24112:6: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 16 /* .xRealloc */)) = sqlite3MemRealloc // sqlite3.c:24113:6: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 24 /* .xSize */)) = sqlite3MemSize // sqlite3.c:24114:6: + *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 32 /* .xRoundup */)) = sqlite3MemRoundup // sqlite3.c:24115:6: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 40 /* .xInit */)) = sqlite3MemInit // sqlite3.c:24116:6: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 48 /* .xShutdown */)) = sqlite3MemShutdown // sqlite3.c:24117:6: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 16 /* .xInit */)) = pcache1Init // sqlite3.c:51388:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 24 /* .xShutdown */)) = pcache1Shutdown // sqlite3.c:51389:5: + *(*func(*libc.TLS, int32, int32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 32 /* .xCreate */)) = pcache1Create // sqlite3.c:51390:5: + *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 40 /* .xCachesize */)) = pcache1Cachesize // sqlite3.c:51391:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 48 /* .xPagecount */)) = pcache1Pagecount // sqlite3.c:51392:5: + *(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 56 /* .xFetch */)) = pcache1Fetch // sqlite3.c:51393:5: + *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 64 /* .xUnpin */)) = pcache1Unpin // sqlite3.c:51394:5: + *(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 72 /* .xRekey */)) = pcache1Rekey // sqlite3.c:51395:5: + *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 80 /* .xTruncate */)) = pcache1Truncate // sqlite3.c:51396:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 88 /* .xDestroy */)) = pcache1Destroy // sqlite3.c:51397:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 96 /* .xShrink */)) = pcache1Shrink // sqlite3.c:51398:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&detach_func)) + 24 /* .xSFunc */)) = detachFunc // sqlite3.c:111056:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoFinder)) + 0)) = dotlockIoFinderImpl // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 8 /* .xClose */)) = dotlockClose // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 56 /* .xLock */)) = dotlockLock // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 64 /* .xUnlock */)) = dotlockUnlock // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 72 /* .xCheckReservedLock */)) = dotlockCheckReservedLock // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 8 /* .xCreate */)) = fts5CreateMethod // sqlite3.c:229216:25: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 16 /* .xConnect */)) = fts5ConnectMethod // sqlite3.c:229217:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 24 /* .xBestIndex */)) = fts5BestIndexMethod // sqlite3.c:229218:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 32 /* .xDisconnect */)) = fts5DisconnectMethod // sqlite3.c:229219:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 40 /* .xDestroy */)) = fts5DestroyMethod // sqlite3.c:229220:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 48 /* .xOpen */)) = fts5OpenMethod // sqlite3.c:229221:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 56 /* .xClose */)) = fts5CloseMethod // sqlite3.c:229222:25: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 64 /* .xFilter */)) = fts5FilterMethod // sqlite3.c:229223:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 72 /* .xNext */)) = fts5NextMethod // sqlite3.c:229224:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 80 /* .xEof */)) = fts5EofMethod // sqlite3.c:229225:25: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 88 /* .xColumn */)) = fts5ColumnMethod // sqlite3.c:229226:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 96 /* .xRowid */)) = fts5RowidMethod // sqlite3.c:229227:25: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 104 /* .xUpdate */)) = fts5UpdateMethod // sqlite3.c:229228:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 112 /* .xBegin */)) = fts5BeginMethod // sqlite3.c:229229:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 120 /* .xSync */)) = fts5SyncMethod // sqlite3.c:229230:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 128 /* .xCommit */)) = fts5CommitMethod // sqlite3.c:229231:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 136 /* .xRollback */)) = fts5RollbackMethod // sqlite3.c:229232:25: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 144 /* .xFindFunction */)) = fts5FindFunctionMethod // sqlite3.c:229233:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 152 /* .xRename */)) = fts5RenameMethod // sqlite3.c:229234:25: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 160 /* .xSavepoint */)) = fts5SavepointMethod // sqlite3.c:229235:25: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 168 /* .xRelease */)) = fts5ReleaseMethod // sqlite3.c:229236:25: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 176 /* .xRollbackTo */)) = fts5RollbackToMethod // sqlite3.c:229237:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 184 /* .xShadowName */)) = fts5ShadowName // sqlite3.c:229238:25: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 8 /* .xCreate */)) = fts5VocabCreateMethod // sqlite3.c:233784:25: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 16 /* .xConnect */)) = fts5VocabConnectMethod // sqlite3.c:233785:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 24 /* .xBestIndex */)) = fts5VocabBestIndexMethod // sqlite3.c:233786:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 32 /* .xDisconnect */)) = fts5VocabDisconnectMethod // sqlite3.c:233787:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 40 /* .xDestroy */)) = fts5VocabDestroyMethod // sqlite3.c:233788:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 48 /* .xOpen */)) = fts5VocabOpenMethod // sqlite3.c:233789:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 56 /* .xClose */)) = fts5VocabCloseMethod // sqlite3.c:233790:25: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 64 /* .xFilter */)) = fts5VocabFilterMethod // sqlite3.c:233791:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 72 /* .xNext */)) = fts5VocabNextMethod // sqlite3.c:233792:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 80 /* .xEof */)) = fts5VocabEofMethod // sqlite3.c:233793:25: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 88 /* .xColumn */)) = fts5VocabColumnMethod // sqlite3.c:233794:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 96 /* .xRowid */)) = fts5VocabRowidMethod // sqlite3.c:233795:25: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 8 /* .xCreate */)) = geopolyCreate // sqlite3.c:197188:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 16 /* .xConnect */)) = geopolyConnect // sqlite3.c:197189:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 24 /* .xBestIndex */)) = geopolyBestIndex // sqlite3.c:197190:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 32 /* .xDisconnect */)) = rtreeDisconnect // sqlite3.c:197191:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 40 /* .xDestroy */)) = rtreeDestroy // sqlite3.c:197192:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 48 /* .xOpen */)) = rtreeOpen // sqlite3.c:197193:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 56 /* .xClose */)) = rtreeClose // sqlite3.c:197194:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 64 /* .xFilter */)) = geopolyFilter // sqlite3.c:197195:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 72 /* .xNext */)) = rtreeNext // sqlite3.c:197196:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 80 /* .xEof */)) = rtreeEof // sqlite3.c:197197:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 88 /* .xColumn */)) = geopolyColumn // sqlite3.c:197198:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 96 /* .xRowid */)) = rtreeRowid // sqlite3.c:197199:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 104 /* .xUpdate */)) = geopolyUpdate // sqlite3.c:197200:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 112 /* .xBegin */)) = rtreeBeginTransaction // sqlite3.c:197201:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 120 /* .xSync */)) = rtreeEndTransaction // sqlite3.c:197202:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 128 /* .xCommit */)) = rtreeEndTransaction // sqlite3.c:197203:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 136 /* .xRollback */)) = rtreeEndTransaction // sqlite3.c:197204:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 144 /* .xFindFunction */)) = geopolyFindFunction // sqlite3.c:197205:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 152 /* .xRename */)) = rtreeRename // sqlite3.c:197206:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 160 /* .xSavepoint */)) = rtreeSavepoint // sqlite3.c:197207:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 184 /* .xShadowName */)) = rtreeShadowName // sqlite3.c:197210:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 16 /* .xConnect */)) = jsonEachConnect // sqlite3.c:190928:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 24 /* .xBestIndex */)) = jsonEachBestIndex // sqlite3.c:190929:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 32 /* .xDisconnect */)) = jsonEachDisconnect // sqlite3.c:190930:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 48 /* .xOpen */)) = jsonEachOpenEach // sqlite3.c:190932:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 56 /* .xClose */)) = jsonEachClose // sqlite3.c:190933:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 64 /* .xFilter */)) = jsonEachFilter // sqlite3.c:190934:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 72 /* .xNext */)) = jsonEachNext // sqlite3.c:190935:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 80 /* .xEof */)) = jsonEachEof // sqlite3.c:190936:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 88 /* .xColumn */)) = jsonEachColumn // sqlite3.c:190937:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 96 /* .xRowid */)) = jsonEachRowid // sqlite3.c:190938:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 16 /* .xConnect */)) = jsonEachConnect // sqlite3.c:190956:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 24 /* .xBestIndex */)) = jsonEachBestIndex // sqlite3.c:190957:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 32 /* .xDisconnect */)) = jsonEachDisconnect // sqlite3.c:190958:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 48 /* .xOpen */)) = jsonEachOpenTree // sqlite3.c:190960:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 56 /* .xClose */)) = jsonEachClose // sqlite3.c:190961:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 64 /* .xFilter */)) = jsonEachFilter // sqlite3.c:190962:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 72 /* .xNext */)) = jsonEachNext // sqlite3.c:190963:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 80 /* .xEof */)) = jsonEachEof // sqlite3.c:190964:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 88 /* .xColumn */)) = jsonEachColumn // sqlite3.c:190965:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 96 /* .xRowid */)) = jsonEachRowid // sqlite3.c:190966:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoFinder)) + 0)) = nolockIoFinderImpl // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 8 /* .xClose */)) = nolockClose // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 56 /* .xLock */)) = nolockLock // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 64 /* .xUnlock */)) = nolockUnlock // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 72 /* .xCheckReservedLock */)) = nolockCheckReservedLock // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoFinder)) + 0)) = posixIoFinderImpl // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 8 /* .xClose */)) = unixClose // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 56 /* .xLock */)) = unixLock // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 64 /* .xUnlock */)) = unixUnlock // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 72 /* .xCheckReservedLock */)) = unixCheckReservedLock // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 104 /* .xShmMap */)) = unixShmMap // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 16 /* .xConnect */)) = pragmaVtabConnect // sqlite3.c:130019:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 24 /* .xBestIndex */)) = pragmaVtabBestIndex // sqlite3.c:130020:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 32 /* .xDisconnect */)) = pragmaVtabDisconnect // sqlite3.c:130021:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 48 /* .xOpen */)) = pragmaVtabOpen // sqlite3.c:130023:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 56 /* .xClose */)) = pragmaVtabClose // sqlite3.c:130024:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 64 /* .xFilter */)) = pragmaVtabFilter // sqlite3.c:130025:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 72 /* .xNext */)) = pragmaVtabNext // sqlite3.c:130026:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 80 /* .xEof */)) = pragmaVtabEof // sqlite3.c:130027:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 88 /* .xColumn */)) = pragmaVtabColumn // sqlite3.c:130028:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 96 /* .xRowid */)) = pragmaVtabRowid // sqlite3.c:130029:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 8 /* .xClose */)) = rbuVfsClose // sqlite3.c:203828:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 16 /* .xRead */)) = rbuVfsRead // sqlite3.c:203829:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 24 /* .xWrite */)) = rbuVfsWrite // sqlite3.c:203830:5: + *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 32 /* .xTruncate */)) = rbuVfsTruncate // sqlite3.c:203831:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 40 /* .xSync */)) = rbuVfsSync // sqlite3.c:203832:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 48 /* .xFileSize */)) = rbuVfsFileSize // sqlite3.c:203833:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 56 /* .xLock */)) = rbuVfsLock // sqlite3.c:203834:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 64 /* .xUnlock */)) = rbuVfsUnlock // sqlite3.c:203835:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 72 /* .xCheckReservedLock */)) = rbuVfsCheckReservedLock // sqlite3.c:203836:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 80 /* .xFileControl */)) = rbuVfsFileControl // sqlite3.c:203837:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 88 /* .xSectorSize */)) = rbuVfsSectorSize // sqlite3.c:203838:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 96 /* .xDeviceCharacteristics */)) = rbuVfsDeviceCharacteristics // sqlite3.c:203839:5: + *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 104 /* .xShmMap */)) = rbuVfsShmMap // sqlite3.c:203840:5: + *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 112 /* .xShmLock */)) = rbuVfsShmLock // sqlite3.c:203841:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 120 /* .xShmBarrier */)) = rbuVfsShmBarrier // sqlite3.c:203842:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 128 /* .xShmUnmap */)) = rbuVfsShmUnmap // sqlite3.c:203843:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 8 /* .xCreate */)) = rtreeCreate // sqlite3.c:194541:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 16 /* .xConnect */)) = rtreeConnect // sqlite3.c:194542:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 24 /* .xBestIndex */)) = rtreeBestIndex // sqlite3.c:194543:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 32 /* .xDisconnect */)) = rtreeDisconnect // sqlite3.c:194544:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 40 /* .xDestroy */)) = rtreeDestroy // sqlite3.c:194545:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 48 /* .xOpen */)) = rtreeOpen // sqlite3.c:194546:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 56 /* .xClose */)) = rtreeClose // sqlite3.c:194547:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 64 /* .xFilter */)) = rtreeFilter // sqlite3.c:194548:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 72 /* .xNext */)) = rtreeNext // sqlite3.c:194549:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 80 /* .xEof */)) = rtreeEof // sqlite3.c:194550:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 88 /* .xColumn */)) = rtreeColumn // sqlite3.c:194551:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 96 /* .xRowid */)) = rtreeRowid // sqlite3.c:194552:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 104 /* .xUpdate */)) = rtreeUpdate // sqlite3.c:194553:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 112 /* .xBegin */)) = rtreeBeginTransaction // sqlite3.c:194554:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 120 /* .xSync */)) = rtreeEndTransaction // sqlite3.c:194555:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 128 /* .xCommit */)) = rtreeEndTransaction // sqlite3.c:194556:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 136 /* .xRollback */)) = rtreeEndTransaction // sqlite3.c:194557:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 152 /* .xRename */)) = rtreeRename // sqlite3.c:194559:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 160 /* .xSavepoint */)) = rtreeSavepoint // sqlite3.c:194560:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 184 /* .xShadowName */)) = rtreeShadowName // sqlite3.c:194563:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 8 /* .xUserData */)) = fts5ApiUserData // sqlite3.c:228675:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 16 /* .xColumnCount */)) = fts5ApiColumnCount // sqlite3.c:228676:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 24 /* .xRowCount */)) = fts5ApiRowCount // sqlite3.c:228677:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 32 /* .xColumnTotalSize */)) = fts5ApiColumnTotalSize // sqlite3.c:228678:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 40 /* .xTokenize */)) = fts5ApiTokenize // sqlite3.c:228679:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 48 /* .xPhraseCount */)) = fts5ApiPhraseCount // sqlite3.c:228680:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 56 /* .xPhraseSize */)) = fts5ApiPhraseSize // sqlite3.c:228681:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 64 /* .xInstCount */)) = fts5ApiInstCount // sqlite3.c:228682:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 72 /* .xInst */)) = fts5ApiInst // sqlite3.c:228683:3: + *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 80 /* .xRowid */)) = fts5ApiRowid // sqlite3.c:228684:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 88 /* .xColumnText */)) = fts5ApiColumnText // sqlite3.c:228685:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 96 /* .xColumnSize */)) = fts5ApiColumnSize // sqlite3.c:228686:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 104 /* .xQueryPhrase */)) = fts5ApiQueryPhrase // sqlite3.c:228687:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 112 /* .xSetAuxdata */)) = fts5ApiSetAuxdata // sqlite3.c:228688:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 120 /* .xGetAuxdata */)) = fts5ApiGetAuxdata // sqlite3.c:228689:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 128 /* .xPhraseFirst */)) = fts5ApiPhraseFirst // sqlite3.c:228690:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 136 /* .xPhraseNext */)) = fts5ApiPhraseNext // sqlite3.c:228691:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 144 /* .xPhraseFirstColumn */)) = fts5ApiPhraseFirstColumn // sqlite3.c:228692:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 152 /* .xPhraseNextColumn */)) = fts5ApiPhraseNextColumn // sqlite3.c:228693:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 8 /* .xClose */)) = memjrnlClose // sqlite3.c:98238:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 16 /* .xRead */)) = memjrnlRead // sqlite3.c:98239:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 24 /* .xWrite */)) = memjrnlWrite // sqlite3.c:98240:3: + *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 32 /* .xTruncate */)) = memjrnlTruncate // sqlite3.c:98241:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 40 /* .xSync */)) = memjrnlSync // sqlite3.c:98242:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 48 /* .xFileSize */)) = memjrnlFileSize // sqlite3.c:98243:3: + *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 0 /* .xMutexInit */)) = noopMutexInit // sqlite3.c:26344:5: + *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 8 /* .xMutexEnd */)) = noopMutexEnd // sqlite3.c:26345:5: + *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 16 /* .xMutexAlloc */)) = noopMutexAlloc // sqlite3.c:26346:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 24 /* .xMutexFree */)) = noopMutexFree // sqlite3.c:26347:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 32 /* .xMutexEnter */)) = noopMutexEnter // sqlite3.c:26348:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 40 /* .xMutexTry */)) = noopMutexTry // sqlite3.c:26349:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 48 /* .xMutexLeave */)) = noopMutexLeave // sqlite3.c:26350:5: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 0 /* .aggregate_context */)) = Xsqlite3_aggregate_context // sqlite3.c:126092:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 8 /* .aggregate_count */)) = Xsqlite3_aggregate_count // sqlite3.c:126094:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 16 /* .bind_blob */)) = Xsqlite3_bind_blob // sqlite3.c:126098:3: + *(*func(*libc.TLS, uintptr, int32, float64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 24 /* .bind_double */)) = Xsqlite3_bind_double // sqlite3.c:126099:3: + *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 32 /* .bind_int */)) = Xsqlite3_bind_int // sqlite3.c:126100:3: + *(*func(*libc.TLS, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 40 /* .bind_int64 */)) = Xsqlite3_bind_int64 // sqlite3.c:126101:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 48 /* .bind_null */)) = Xsqlite3_bind_null // sqlite3.c:126102:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 56 /* .bind_parameter_count */)) = Xsqlite3_bind_parameter_count // sqlite3.c:126103:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 64 /* .bind_parameter_index */)) = Xsqlite3_bind_parameter_index // sqlite3.c:126104:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 72 /* .bind_parameter_name */)) = Xsqlite3_bind_parameter_name // sqlite3.c:126105:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 80 /* .bind_text */)) = Xsqlite3_bind_text // sqlite3.c:126106:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 88 /* .bind_text16 */)) = Xsqlite3_bind_text16 // sqlite3.c:126107:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 96 /* .bind_value */)) = Xsqlite3_bind_value // sqlite3.c:126108:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 104 /* .busy_handler */)) = Xsqlite3_busy_handler // sqlite3.c:126109:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 112 /* .busy_timeout */)) = Xsqlite3_busy_timeout // sqlite3.c:126110:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 120 /* .changes */)) = Xsqlite3_changes // sqlite3.c:126111:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 128 /* .close */)) = Xsqlite3_close // sqlite3.c:126112:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 136 /* .collation_needed */)) = Xsqlite3_collation_needed // sqlite3.c:126113:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 144 /* .collation_needed16 */)) = Xsqlite3_collation_needed16 // sqlite3.c:126114:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 152 /* .column_blob */)) = Xsqlite3_column_blob // sqlite3.c:126115:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 160 /* .column_bytes */)) = Xsqlite3_column_bytes // sqlite3.c:126116:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 168 /* .column_bytes16 */)) = Xsqlite3_column_bytes16 // sqlite3.c:126117:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 176 /* .column_count */)) = Xsqlite3_column_count // sqlite3.c:126118:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 184 /* .column_database_name */)) = Xsqlite3_column_database_name // sqlite3.c:126119:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 192 /* .column_database_name16 */)) = Xsqlite3_column_database_name16 // sqlite3.c:126120:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 200 /* .column_decltype */)) = Xsqlite3_column_decltype // sqlite3.c:126121:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 208 /* .column_decltype16 */)) = Xsqlite3_column_decltype16 // sqlite3.c:126122:3: + *(*func(*libc.TLS, uintptr, int32) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 216 /* .column_double */)) = Xsqlite3_column_double // sqlite3.c:126123:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 224 /* .column_int */)) = Xsqlite3_column_int // sqlite3.c:126124:3: + *(*func(*libc.TLS, uintptr, int32) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 232 /* .column_int64 */)) = Xsqlite3_column_int64 // sqlite3.c:126125:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 240 /* .column_name */)) = Xsqlite3_column_name // sqlite3.c:126126:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 248 /* .column_name16 */)) = Xsqlite3_column_name16 // sqlite3.c:126127:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 256 /* .column_origin_name */)) = Xsqlite3_column_origin_name // sqlite3.c:126128:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 264 /* .column_origin_name16 */)) = Xsqlite3_column_origin_name16 // sqlite3.c:126129:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 272 /* .column_table_name */)) = Xsqlite3_column_table_name // sqlite3.c:126130:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 280 /* .column_table_name16 */)) = Xsqlite3_column_table_name16 // sqlite3.c:126131:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 288 /* .column_text */)) = Xsqlite3_column_text // sqlite3.c:126132:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 296 /* .column_text16 */)) = Xsqlite3_column_text16 // sqlite3.c:126133:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 304 /* .column_type */)) = Xsqlite3_column_type // sqlite3.c:126134:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 312 /* .column_value */)) = Xsqlite3_column_value // sqlite3.c:126135:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 320 /* .commit_hook */)) = Xsqlite3_commit_hook // sqlite3.c:126136:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 328 /* .complete */)) = Xsqlite3_complete // sqlite3.c:126137:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 336 /* .complete16 */)) = Xsqlite3_complete16 // sqlite3.c:126138:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 344 /* .create_collation */)) = Xsqlite3_create_collation // sqlite3.c:126139:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 352 /* .create_collation16 */)) = Xsqlite3_create_collation16 // sqlite3.c:126140:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 360 /* .create_function */)) = Xsqlite3_create_function // sqlite3.c:126141:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 368 /* .create_function16 */)) = Xsqlite3_create_function16 // sqlite3.c:126142:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 376 /* .create_module */)) = Xsqlite3_create_module // sqlite3.c:126143:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 384 /* .data_count */)) = Xsqlite3_data_count // sqlite3.c:126144:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 392 /* .db_handle */)) = Xsqlite3_db_handle // sqlite3.c:126145:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 400 /* .declare_vtab */)) = Xsqlite3_declare_vtab // sqlite3.c:126146:3: + *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 408 /* .enable_shared_cache */)) = Xsqlite3_enable_shared_cache // sqlite3.c:126147:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 416 /* .errcode */)) = Xsqlite3_errcode // sqlite3.c:126148:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 424 /* .errmsg */)) = Xsqlite3_errmsg // sqlite3.c:126149:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 432 /* .errmsg16 */)) = Xsqlite3_errmsg16 // sqlite3.c:126150:3: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_callback, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 440 /* .exec */)) = Xsqlite3_exec // sqlite3.c:126151:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 448 /* .expired */)) = Xsqlite3_expired // sqlite3.c:126153:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 456 /* .finalize */)) = Xsqlite3_finalize // sqlite3.c:126157:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 464 /* .free */)) = Xsqlite3_free // sqlite3.c:126158:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 472 /* .free_table */)) = Xsqlite3_free_table // sqlite3.c:126159:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 480 /* .get_autocommit */)) = Xsqlite3_get_autocommit // sqlite3.c:126160:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 488 /* .get_auxdata */)) = Xsqlite3_get_auxdata // sqlite3.c:126161:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 496 /* .get_table */)) = Xsqlite3_get_table // sqlite3.c:126162:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 512 /* .interruptx */)) = Xsqlite3_interrupt // sqlite3.c:126164:3: + *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 520 /* .last_insert_rowid */)) = Xsqlite3_last_insert_rowid // sqlite3.c:126165:3: + *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 528 /* .libversion */)) = Xsqlite3_libversion // sqlite3.c:126166:3: + *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 536 /* .libversion_number */)) = Xsqlite3_libversion_number // sqlite3.c:126167:3: + *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 544 /* .malloc */)) = Xsqlite3_malloc // sqlite3.c:126168:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 552 /* .mprintf */)) = Xsqlite3_mprintf // sqlite3.c:126169:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 560 /* .open */)) = Xsqlite3_open // sqlite3.c:126170:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 568 /* .open16 */)) = Xsqlite3_open16 // sqlite3.c:126171:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 576 /* .prepare */)) = Xsqlite3_prepare // sqlite3.c:126172:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 584 /* .prepare16 */)) = Xsqlite3_prepare16 // sqlite3.c:126173:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 592 /* .profile */)) = Xsqlite3_profile // sqlite3.c:126174:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 600 /* .progress_handler */)) = Xsqlite3_progress_handler // sqlite3.c:126175:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 608 /* .realloc */)) = Xsqlite3_realloc // sqlite3.c:126176:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 616 /* .reset */)) = Xsqlite3_reset // sqlite3.c:126177:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 624 /* .result_blob */)) = Xsqlite3_result_blob // sqlite3.c:126178:3: + *(*func(*libc.TLS, uintptr, float64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 632 /* .result_double */)) = Xsqlite3_result_double // sqlite3.c:126179:3: + *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 640 /* .result_error */)) = Xsqlite3_result_error // sqlite3.c:126180:3: + *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 648 /* .result_error16 */)) = Xsqlite3_result_error16 // sqlite3.c:126181:3: + *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 656 /* .result_int */)) = Xsqlite3_result_int // sqlite3.c:126182:3: + *(*func(*libc.TLS, uintptr, I64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 664 /* .result_int64 */)) = Xsqlite3_result_int64 // sqlite3.c:126183:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 672 /* .result_null */)) = Xsqlite3_result_null // sqlite3.c:126184:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 680 /* .result_text */)) = Xsqlite3_result_text // sqlite3.c:126185:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 688 /* .result_text16 */)) = Xsqlite3_result_text16 // sqlite3.c:126186:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 696 /* .result_text16be */)) = Xsqlite3_result_text16be // sqlite3.c:126187:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 704 /* .result_text16le */)) = Xsqlite3_result_text16le // sqlite3.c:126188:3: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 712 /* .result_value */)) = Xsqlite3_result_value // sqlite3.c:126189:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 720 /* .rollback_hook */)) = Xsqlite3_rollback_hook // sqlite3.c:126190:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 728 /* .set_authorizer */)) = Xsqlite3_set_authorizer // sqlite3.c:126191:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 736 /* .set_auxdata */)) = Xsqlite3_set_auxdata // sqlite3.c:126192:3: + *(*func(*libc.TLS, int32, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 744 /* .xsnprintf */)) = Xsqlite3_snprintf // sqlite3.c:126193:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 752 /* .step */)) = Xsqlite3_step // sqlite3.c:126194:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 760 /* .table_column_metadata */)) = Xsqlite3_table_column_metadata // sqlite3.c:126195:3: + *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 768 /* .thread_cleanup */)) = Xsqlite3_thread_cleanup // sqlite3.c:126197:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 776 /* .total_changes */)) = Xsqlite3_total_changes // sqlite3.c:126201:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 784 /* .trace */)) = Xsqlite3_trace // sqlite3.c:126202:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 792 /* .transfer_bindings */)) = Xsqlite3_transfer_bindings // sqlite3.c:126204:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 800 /* .update_hook */)) = Xsqlite3_update_hook // sqlite3.c:126208:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 808 /* .user_data */)) = Xsqlite3_user_data // sqlite3.c:126209:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 816 /* .value_blob */)) = Xsqlite3_value_blob // sqlite3.c:126210:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 824 /* .value_bytes */)) = Xsqlite3_value_bytes // sqlite3.c:126211:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 832 /* .value_bytes16 */)) = Xsqlite3_value_bytes16 // sqlite3.c:126212:3: + *(*func(*libc.TLS, uintptr) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 840 /* .value_double */)) = Xsqlite3_value_double // sqlite3.c:126213:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 848 /* .value_int */)) = Xsqlite3_value_int // sqlite3.c:126214:3: + *(*func(*libc.TLS, uintptr) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 856 /* .value_int64 */)) = Xsqlite3_value_int64 // sqlite3.c:126215:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 864 /* .value_numeric_type */)) = Xsqlite3_value_numeric_type // sqlite3.c:126216:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 872 /* .value_text */)) = Xsqlite3_value_text // sqlite3.c:126217:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 880 /* .value_text16 */)) = Xsqlite3_value_text16 // sqlite3.c:126218:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 888 /* .value_text16be */)) = Xsqlite3_value_text16be // sqlite3.c:126219:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 896 /* .value_text16le */)) = Xsqlite3_value_text16le // sqlite3.c:126220:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 904 /* .value_type */)) = Xsqlite3_value_type // sqlite3.c:126221:3: + *(*func(*libc.TLS, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 912 /* .vmprintf */)) = Xsqlite3_vmprintf // sqlite3.c:126222:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 920 /* .overload_function */)) = Xsqlite3_overload_function // sqlite3.c:126231:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 928 /* .prepare_v2 */)) = Xsqlite3_prepare_v2 // sqlite3.c:126236:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 936 /* .prepare16_v2 */)) = Xsqlite3_prepare16_v2 // sqlite3.c:126237:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 944 /* .clear_bindings */)) = Xsqlite3_clear_bindings // sqlite3.c:126238:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 952 /* .create_module_v2 */)) = Xsqlite3_create_module_v2 // sqlite3.c:126243:3: + *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 960 /* .bind_zeroblob */)) = Xsqlite3_bind_zeroblob // sqlite3.c:126248:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 968 /* .blob_bytes */)) = Xsqlite3_blob_bytes // sqlite3.c:126249:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 976 /* .blob_close */)) = Xsqlite3_blob_close // sqlite3.c:126250:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, Sqlite_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 984 /* .blob_open */)) = Xsqlite3_blob_open // sqlite3.c:126251:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 992 /* .blob_read */)) = Xsqlite3_blob_read // sqlite3.c:126252:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1000 /* .blob_write */)) = Xsqlite3_blob_write // sqlite3.c:126253:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1008 /* .create_collation_v2 */)) = Xsqlite3_create_collation_v2 // sqlite3.c:126254:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1016 /* .file_control */)) = Xsqlite3_file_control // sqlite3.c:126255:3: + *(*func(*libc.TLS, int32) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1024 /* .memory_highwater */)) = Xsqlite3_memory_highwater // sqlite3.c:126256:3: + *(*func(*libc.TLS) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1032 /* .memory_used */)) = Xsqlite3_memory_used // sqlite3.c:126257:3: + *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1040 /* .mutex_alloc */)) = Xsqlite3_mutex_alloc // sqlite3.c:126265:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1048 /* .mutex_enter */)) = Xsqlite3_mutex_enter // sqlite3.c:126266:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1056 /* .mutex_free */)) = Xsqlite3_mutex_free // sqlite3.c:126267:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1064 /* .mutex_leave */)) = Xsqlite3_mutex_leave // sqlite3.c:126268:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1072 /* .mutex_try */)) = Xsqlite3_mutex_try // sqlite3.c:126269:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1080 /* .open_v2 */)) = Xsqlite3_open_v2 // sqlite3.c:126271:3: + *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1088 /* .release_memory */)) = Xsqlite3_release_memory // sqlite3.c:126272:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1096 /* .result_error_nomem */)) = Xsqlite3_result_error_nomem // sqlite3.c:126273:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1104 /* .result_error_toobig */)) = Xsqlite3_result_error_toobig // sqlite3.c:126274:3: + *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1112 /* .sleep */)) = Xsqlite3_sleep // sqlite3.c:126275:3: + *(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1120 /* .soft_heap_limit */)) = Xsqlite3_soft_heap_limit // sqlite3.c:126276:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1128 /* .vfs_find */)) = Xsqlite3_vfs_find // sqlite3.c:126277:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1136 /* .vfs_register */)) = Xsqlite3_vfs_register // sqlite3.c:126278:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1144 /* .vfs_unregister */)) = Xsqlite3_vfs_unregister // sqlite3.c:126279:3: + *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1152 /* .xthreadsafe */)) = Xsqlite3_threadsafe // sqlite3.c:126284:3: + *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1160 /* .result_zeroblob */)) = Xsqlite3_result_zeroblob // sqlite3.c:126285:3: + *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1168 /* .result_error_code */)) = Xsqlite3_result_error_code // sqlite3.c:126286:3: + *(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1176 /* .test_control */)) = Xsqlite3_test_control // sqlite3.c:126287:3: + *(*func(*libc.TLS, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1184 /* .randomness */)) = Xsqlite3_randomness // sqlite3.c:126288:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1192 /* .context_db_handle */)) = Xsqlite3_context_db_handle // sqlite3.c:126289:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1200 /* .extended_result_codes */)) = Xsqlite3_extended_result_codes // sqlite3.c:126294:3: + *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1208 /* .limit */)) = Xsqlite3_limit // sqlite3.c:126295:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1216 /* .next_stmt */)) = Xsqlite3_next_stmt // sqlite3.c:126296:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1224 /* .sql */)) = Xsqlite3_sql // sqlite3.c:126297:3: + *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1232 /* .status */)) = Xsqlite3_status // sqlite3.c:126298:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1240 /* .backup_finish */)) = Xsqlite3_backup_finish // sqlite3.c:126303:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1248 /* .backup_init */)) = Xsqlite3_backup_init // sqlite3.c:126304:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1256 /* .backup_pagecount */)) = Xsqlite3_backup_pagecount // sqlite3.c:126305:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1264 /* .backup_remaining */)) = Xsqlite3_backup_remaining // sqlite3.c:126306:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1272 /* .backup_step */)) = Xsqlite3_backup_step // sqlite3.c:126307:3: + *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1280 /* .compileoption_get */)) = Xsqlite3_compileoption_get // sqlite3.c:126309:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1288 /* .compileoption_used */)) = Xsqlite3_compileoption_used // sqlite3.c:126310:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1296 /* .create_function_v2 */)) = Xsqlite3_create_function_v2 // sqlite3.c:126315:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1304 /* .db_config */)) = Xsqlite3_db_config // sqlite3.c:126316:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1312 /* .db_mutex */)) = Xsqlite3_db_mutex // sqlite3.c:126317:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1320 /* .db_status */)) = Xsqlite3_db_status // sqlite3.c:126318:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1328 /* .extended_errcode */)) = Xsqlite3_extended_errcode // sqlite3.c:126319:3: + *(*func(*libc.TLS, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1336 /* .log */)) = Xsqlite3_log // sqlite3.c:126320:3: + *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1344 /* .soft_heap_limit64 */)) = Xsqlite3_soft_heap_limit64 // sqlite3.c:126321:3: + *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1352 /* .sourceid */)) = Xsqlite3_sourceid // sqlite3.c:126322:3: + *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1360 /* .stmt_status */)) = Xsqlite3_stmt_status // sqlite3.c:126323:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1368 /* .strnicmp */)) = Xsqlite3_strnicmp // sqlite3.c:126324:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1376 /* .unlock_notify */)) = Xsqlite3_unlock_notify // sqlite3.c:126326:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1384 /* .wal_autocheckpoint */)) = Xsqlite3_wal_autocheckpoint // sqlite3.c:126331:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1392 /* .wal_checkpoint */)) = Xsqlite3_wal_checkpoint // sqlite3.c:126332:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1400 /* .wal_hook */)) = Xsqlite3_wal_hook // sqlite3.c:126333:3: + *(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1408 /* .blob_reopen */)) = Xsqlite3_blob_reopen // sqlite3.c:126339:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1416 /* .vtab_config */)) = Xsqlite3_vtab_config // sqlite3.c:126340:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1424 /* .vtab_on_conflict */)) = Xsqlite3_vtab_on_conflict // sqlite3.c:126341:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1432 /* .close_v2 */)) = Xsqlite3_close_v2 // sqlite3.c:126342:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1440 /* .db_filename */)) = Xsqlite3_db_filename // sqlite3.c:126343:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1448 /* .db_readonly */)) = Xsqlite3_db_readonly // sqlite3.c:126344:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1456 /* .db_release_memory */)) = Xsqlite3_db_release_memory // sqlite3.c:126345:3: + *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1464 /* .errstr */)) = Xsqlite3_errstr // sqlite3.c:126346:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1472 /* .stmt_busy */)) = Xsqlite3_stmt_busy // sqlite3.c:126347:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1480 /* .stmt_readonly */)) = Xsqlite3_stmt_readonly // sqlite3.c:126348:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1488 /* .stricmp */)) = Xsqlite3_stricmp // sqlite3.c:126349:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1496 /* .uri_boolean */)) = Xsqlite3_uri_boolean // sqlite3.c:126350:3: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1504 /* .uri_int64 */)) = Xsqlite3_uri_int64 // sqlite3.c:126351:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1512 /* .uri_parameter */)) = Xsqlite3_uri_parameter // sqlite3.c:126352:3: + *(*func(*libc.TLS, int32, uintptr, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1520 /* .xvsnprintf */)) = Xsqlite3_vsnprintf // sqlite3.c:126353:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1528 /* .wal_checkpoint_v2 */)) = Xsqlite3_wal_checkpoint_v2 // sqlite3.c:126354:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1536 /* .auto_extension */)) = Xsqlite3_auto_extension // sqlite3.c:126356:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1544 /* .bind_blob64 */)) = Xsqlite3_bind_blob64 // sqlite3.c:126357:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr, uint8) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1552 /* .bind_text64 */)) = Xsqlite3_bind_text64 // sqlite3.c:126358:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1560 /* .cancel_auto_extension */)) = Xsqlite3_cancel_auto_extension // sqlite3.c:126359:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1568 /* .load_extension */)) = Xsqlite3_load_extension // sqlite3.c:126360:3: + *(*func(*libc.TLS, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1576 /* .malloc64 */)) = Xsqlite3_malloc64 // sqlite3.c:126361:3: + *(*func(*libc.TLS, uintptr) Sqlite3_uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1584 /* .msize */)) = Xsqlite3_msize // sqlite3.c:126362:3: + *(*func(*libc.TLS, uintptr, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1592 /* .realloc64 */)) = Xsqlite3_realloc64 // sqlite3.c:126363:3: + *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1600 /* .reset_auto_extension */)) = Xsqlite3_reset_auto_extension // sqlite3.c:126364:3: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1608 /* .result_blob64 */)) = Xsqlite3_result_blob64 // sqlite3.c:126365:3: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr, uint8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1616 /* .result_text64 */)) = Xsqlite3_result_text64 // sqlite3.c:126366:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1624 /* .strglob */)) = Xsqlite3_strglob // sqlite3.c:126367:3: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1632 /* .value_dup */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr) uintptr - }{Xsqlite3_value_dup})) // sqlite3.c:124649:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1640 /* .value_free */)) = Xsqlite3_value_free // sqlite3.c:124650:3: - *(*func(*libc.TLS, uintptr, U64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1648 /* .result_zeroblob64 */)) = Xsqlite3_result_zeroblob64 // sqlite3.c:124651:3: - *(*func(*libc.TLS, uintptr, int32, Sqlite3_uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1656 /* .bind_zeroblob64 */)) = Xsqlite3_bind_zeroblob64 // sqlite3.c:124652:3: - *(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1664 /* .value_subtype */)) = Xsqlite3_value_subtype // sqlite3.c:124654:3: - *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1672 /* .result_subtype */)) = Xsqlite3_result_subtype // sqlite3.c:124655:3: - *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1680 /* .status64 */)) = Xsqlite3_status64 // sqlite3.c:124657:3: - *(*func(*libc.TLS, uintptr, uintptr, uint32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1688 /* .strlike */)) = Xsqlite3_strlike // sqlite3.c:124658:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1696 /* .db_cacheflush */)) = Xsqlite3_db_cacheflush // sqlite3.c:124659:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1704 /* .system_errno */)) = Xsqlite3_system_errno // sqlite3.c:124661:3: - *(*func(*libc.TLS, uintptr, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1712 /* .trace_v2 */)) = Xsqlite3_trace_v2 // sqlite3.c:124663:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1720 /* .expanded_sql */)) = Xsqlite3_expanded_sql // sqlite3.c:124664:3: - *(*func(*libc.TLS, uintptr, Sqlite3_int64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1728 /* .set_last_insert_rowid */)) = Xsqlite3_set_last_insert_rowid // sqlite3.c:124666:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1736 /* .prepare_v3 */)) = Xsqlite3_prepare_v3 // sqlite3.c:124668:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1744 /* .prepare16_v3 */)) = Xsqlite3_prepare16_v3 // sqlite3.c:124669:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1752 /* .bind_pointer */)) = Xsqlite3_bind_pointer // sqlite3.c:124670:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1760 /* .result_pointer */)) = Xsqlite3_result_pointer // sqlite3.c:124671:3: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1768 /* .value_pointer */)) = Xsqlite3_value_pointer // sqlite3.c:124672:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1776 /* .vtab_nochange */)) = Xsqlite3_vtab_nochange // sqlite3.c:124674:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1784 /* .value_nochange */)) = Xsqlite3_value_nochange // sqlite3.c:124675:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1792 /* .vtab_collation */)) = Xsqlite3_vtab_collation // sqlite3.c:124676:3: - *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1800 /* .keyword_count */)) = Xsqlite3_keyword_count // sqlite3.c:124678:3: - *(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1808 /* .keyword_name */)) = Xsqlite3_keyword_name // sqlite3.c:124679:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1816 /* .keyword_check */)) = Xsqlite3_keyword_check // sqlite3.c:124680:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1824 /* .str_new */)) = Xsqlite3_str_new // sqlite3.c:124681:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1832 /* .str_finish */)) = Xsqlite3_str_finish // sqlite3.c:124682:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1840 /* .str_appendf */)) = Xsqlite3_str_appendf // sqlite3.c:124683:3: - *(*func(*libc.TLS, uintptr, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1848 /* .str_vappendf */)) = Xsqlite3_str_vappendf // sqlite3.c:124684:3: - *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1856 /* .str_append */)) = Xsqlite3_str_append // sqlite3.c:124685:3: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1864 /* .str_appendall */)) = Xsqlite3_str_appendall // sqlite3.c:124686:3: - *(*func(*libc.TLS, uintptr, int32, int8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1872 /* .str_appendchar */)) = Xsqlite3_str_appendchar // sqlite3.c:124687:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1880 /* .str_reset */)) = Xsqlite3_str_reset // sqlite3.c:124688:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1888 /* .str_errcode */)) = Xsqlite3_str_errcode // sqlite3.c:124689:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1896 /* .str_length */)) = Xsqlite3_str_length // sqlite3.c:124690:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1904 /* .str_value */)) = Xsqlite3_str_value // sqlite3.c:124691:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1912 /* .create_window_function */)) = Xsqlite3_create_window_function // sqlite3.c:124693:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1928 /* .stmt_isexplain */)) = Xsqlite3_stmt_isexplain // sqlite3.c:124701:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1936 /* .value_frombind */)) = Xsqlite3_value_frombind // sqlite3.c:124702:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1944 /* .drop_modules */)) = Xsqlite3_drop_modules // sqlite3.c:124705:3: - *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1952 /* .hard_heap_limit64 */)) = Xsqlite3_hard_heap_limit64 // sqlite3.c:124710:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1960 /* .uri_key */)) = Xsqlite3_uri_key // sqlite3.c:124711:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1968 /* .filename_database */)) = Xsqlite3_filename_database // sqlite3.c:124712:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1976 /* .filename_journal */)) = Xsqlite3_filename_journal // sqlite3.c:124713:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1984 /* .filename_wal */)) = Xsqlite3_filename_wal // sqlite3.c:124714:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1992 /* .create_filename */)) = Xsqlite3_create_filename // sqlite3.c:124716:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2000 /* .free_filename */)) = Xsqlite3_free_filename // sqlite3.c:124717:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2008 /* .database_file_object */)) = Xsqlite3_database_file_object // sqlite3.c:124718:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 0)) = Xsqlite3Fts5Init // sqlite3.c:161074:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 8)) = Xsqlite3RtreeInit // sqlite3.c:161080:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 16)) = sqlite3TestExtInit // sqlite3.c:161088:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 24)) = Xsqlite3Json1Init // sqlite3.c:161090:3: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statGetFuncdef)) + 24 /* .xSFunc */)) = statGet // sqlite3.c:108483:3: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statInitFuncdef)) + 24 /* .xSFunc */)) = statInit // sqlite3.c:108041:3: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statPushFuncdef)) + 24 /* .xSFunc */)) = statPush // sqlite3.c:108331:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 40 /* .xOpen */)) = rbuVfsOpen // sqlite3.c:201074:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 48 /* .xDelete */)) = rbuVfsDelete // sqlite3.c:201075:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 56 /* .xAccess */)) = rbuVfsAccess // sqlite3.c:201076:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 64 /* .xFullPathname */)) = rbuVfsFullPathname // sqlite3.c:201077:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 72 /* .xDlOpen */)) = rbuVfsDlOpen // sqlite3.c:201080:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 80 /* .xDlError */)) = rbuVfsDlError // sqlite3.c:201081:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 88 /* .xDlSym */)) = rbuVfsDlSym // sqlite3.c:201082:5: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 96 /* .xDlClose */)) = rbuVfsDlClose // sqlite3.c:201083:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 104 /* .xRandomness */)) = rbuVfsRandomness // sqlite3.c:201088:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 112 /* .xSleep */)) = rbuVfsSleep // sqlite3.c:201089:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 120 /* .xCurrentTime */)) = rbuVfsCurrentTime // sqlite3.c:201090:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 128 /* .xGetLastError */)) = rbuVfsGetLastError // sqlite3.c:201091:5: + }{Xsqlite3_value_dup})) // sqlite3.c:126369:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1640 /* .value_free */)) = Xsqlite3_value_free // sqlite3.c:126370:3: + *(*func(*libc.TLS, uintptr, U64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1648 /* .result_zeroblob64 */)) = Xsqlite3_result_zeroblob64 // sqlite3.c:126371:3: + *(*func(*libc.TLS, uintptr, int32, Sqlite3_uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1656 /* .bind_zeroblob64 */)) = Xsqlite3_bind_zeroblob64 // sqlite3.c:126372:3: + *(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1664 /* .value_subtype */)) = Xsqlite3_value_subtype // sqlite3.c:126374:3: + *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1672 /* .result_subtype */)) = Xsqlite3_result_subtype // sqlite3.c:126375:3: + *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1680 /* .status64 */)) = Xsqlite3_status64 // sqlite3.c:126377:3: + *(*func(*libc.TLS, uintptr, uintptr, uint32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1688 /* .strlike */)) = Xsqlite3_strlike // sqlite3.c:126378:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1696 /* .db_cacheflush */)) = Xsqlite3_db_cacheflush // sqlite3.c:126379:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1704 /* .system_errno */)) = Xsqlite3_system_errno // sqlite3.c:126381:3: + *(*func(*libc.TLS, uintptr, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1712 /* .trace_v2 */)) = Xsqlite3_trace_v2 // sqlite3.c:126383:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1720 /* .expanded_sql */)) = Xsqlite3_expanded_sql // sqlite3.c:126384:3: + *(*func(*libc.TLS, uintptr, Sqlite3_int64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1728 /* .set_last_insert_rowid */)) = Xsqlite3_set_last_insert_rowid // sqlite3.c:126386:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1736 /* .prepare_v3 */)) = Xsqlite3_prepare_v3 // sqlite3.c:126388:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1744 /* .prepare16_v3 */)) = Xsqlite3_prepare16_v3 // sqlite3.c:126389:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1752 /* .bind_pointer */)) = Xsqlite3_bind_pointer // sqlite3.c:126390:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1760 /* .result_pointer */)) = Xsqlite3_result_pointer // sqlite3.c:126391:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1768 /* .value_pointer */)) = Xsqlite3_value_pointer // sqlite3.c:126392:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1776 /* .vtab_nochange */)) = Xsqlite3_vtab_nochange // sqlite3.c:126394:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1784 /* .value_nochange */)) = Xsqlite3_value_nochange // sqlite3.c:126395:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1792 /* .vtab_collation */)) = Xsqlite3_vtab_collation // sqlite3.c:126396:3: + *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1800 /* .keyword_count */)) = Xsqlite3_keyword_count // sqlite3.c:126398:3: + *(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1808 /* .keyword_name */)) = Xsqlite3_keyword_name // sqlite3.c:126399:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1816 /* .keyword_check */)) = Xsqlite3_keyword_check // sqlite3.c:126400:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1824 /* .str_new */)) = Xsqlite3_str_new // sqlite3.c:126401:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1832 /* .str_finish */)) = Xsqlite3_str_finish // sqlite3.c:126402:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1840 /* .str_appendf */)) = Xsqlite3_str_appendf // sqlite3.c:126403:3: + *(*func(*libc.TLS, uintptr, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1848 /* .str_vappendf */)) = Xsqlite3_str_vappendf // sqlite3.c:126404:3: + *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1856 /* .str_append */)) = Xsqlite3_str_append // sqlite3.c:126405:3: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1864 /* .str_appendall */)) = Xsqlite3_str_appendall // sqlite3.c:126406:3: + *(*func(*libc.TLS, uintptr, int32, int8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1872 /* .str_appendchar */)) = Xsqlite3_str_appendchar // sqlite3.c:126407:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1880 /* .str_reset */)) = Xsqlite3_str_reset // sqlite3.c:126408:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1888 /* .str_errcode */)) = Xsqlite3_str_errcode // sqlite3.c:126409:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1896 /* .str_length */)) = Xsqlite3_str_length // sqlite3.c:126410:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1904 /* .str_value */)) = Xsqlite3_str_value // sqlite3.c:126411:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1912 /* .create_window_function */)) = Xsqlite3_create_window_function // sqlite3.c:126413:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1928 /* .stmt_isexplain */)) = Xsqlite3_stmt_isexplain // sqlite3.c:126421:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1936 /* .value_frombind */)) = Xsqlite3_value_frombind // sqlite3.c:126422:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1944 /* .drop_modules */)) = Xsqlite3_drop_modules // sqlite3.c:126425:3: + *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1952 /* .hard_heap_limit64 */)) = Xsqlite3_hard_heap_limit64 // sqlite3.c:126430:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1960 /* .uri_key */)) = Xsqlite3_uri_key // sqlite3.c:126431:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1968 /* .filename_database */)) = Xsqlite3_filename_database // sqlite3.c:126432:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1976 /* .filename_journal */)) = Xsqlite3_filename_journal // sqlite3.c:126433:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1984 /* .filename_wal */)) = Xsqlite3_filename_wal // sqlite3.c:126434:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1992 /* .create_filename */)) = Xsqlite3_create_filename // sqlite3.c:126436:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2000 /* .free_filename */)) = Xsqlite3_free_filename // sqlite3.c:126437:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2008 /* .database_file_object */)) = Xsqlite3_database_file_object // sqlite3.c:126438:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2016 /* .txn_state */)) = Xsqlite3_txn_state // sqlite3.c:126440:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 0)) = Xsqlite3Fts5Init // sqlite3.c:164014:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 8)) = Xsqlite3RtreeInit // sqlite3.c:164020:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 16)) = sqlite3TestExtInit // sqlite3.c:164028:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 24)) = Xsqlite3Json1Init // sqlite3.c:164030:3: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statGetFuncdef)) + 24 /* .xSFunc */)) = statGet // sqlite3.c:109638:3: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statInitFuncdef)) + 24 /* .xSFunc */)) = statInit // sqlite3.c:109196:3: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statPushFuncdef)) + 24 /* .xSFunc */)) = statPush // sqlite3.c:109486:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 40 /* .xOpen */)) = rbuVfsOpen // sqlite3.c:204099:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 48 /* .xDelete */)) = rbuVfsDelete // sqlite3.c:204100:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 56 /* .xAccess */)) = rbuVfsAccess // sqlite3.c:204101:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 64 /* .xFullPathname */)) = rbuVfsFullPathname // sqlite3.c:204102:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 72 /* .xDlOpen */)) = rbuVfsDlOpen // sqlite3.c:204105:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 80 /* .xDlError */)) = rbuVfsDlError // sqlite3.c:204106:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 88 /* .xDlSym */)) = rbuVfsDlSym // sqlite3.c:204107:5: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 96 /* .xDlClose */)) = rbuVfsDlClose // sqlite3.c:204108:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 104 /* .xRandomness */)) = rbuVfsRandomness // sqlite3.c:204113:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 112 /* .xSleep */)) = rbuVfsSleep // sqlite3.c:204114:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 120 /* .xCurrentTime */)) = rbuVfsCurrentTime // sqlite3.c:204115:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 128 /* .xGetLastError */)) = rbuVfsGetLastError // sqlite3.c:204116:5: } -var ts1 = "COMPILER=gcc-8.3.0\x00ENABLE_COLUMN_METADATA\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_JSON1\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MUTEX_NOOP\x00SOUNDEX\x00THREADSAFE=1\x003.33.0\x00BINARY\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00local time unavailable\x00second\x00minute\x00hour\x00day\x00month\x00year\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00%04d-%02d-%02d %02d:%02d:%02d\x00%02d:%02d:%02d\x00%04d-%02d-%02d\x00%02d\x00%06.3f\x00%03d\x00%.16g\x00%04d\x00julianday\x00date\x00time\x00datetime\x00strftime\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x000123456789ABCDEF0123456789abcdef\x00-x0\x00X0\x00%\x00NaN\x00Inf\x00\x00NULL\x00(NULL)\x00.\x00thstndrd\x00922337203685477580\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00SorterNext\x00Prev\x00Next\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00Not\x00IfNot\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSmaller\x00SorterSort\x00Sort\x00Rewind\x00IdxLE\x00IdxGT\x00IdxLT\x00IdxGE\x00RowSetRead\x00Or\x00And\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IfNotZero\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseNotEq\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Init\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00Offset\x00Column\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00OpenWrite\x00OpenDup\x00OpenAutoindex\x00OpenEphemeral\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00SorterOpen\x00BitNot\x00SequenceTest\x00OpenPseudo\x00String8\x00Close\x00ColumnsUsed\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00Real\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00SQLITE_TMPDIR\x00TMPDIR\x00/var/tmp\x00/usr/tmp\x00/tmp\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00SQLite format 3\x00:memory:\x00@ \x00\n\x00invalid page number %d\x002nd reference to page %d\x00Failed to read ptrmap key=%d\x00Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)\x00failed to get page %d\x00freelist leaf count too big on page %d\x00%s is %d but should be %d\x00size\x00overflow list length\x00Page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00On tree page %u cell %d: \x00On page %u at right child: \x00Offset %d out of range %d..%d\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %d bytes reported as %d on page %u\x00Main freelist: \x00max rootpage (%d) disagrees with header (%d)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %d is never used\x00Pointer map page %d is referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00B\x00,%s%s%s\x00N.\x00)\x00%.18s-%s\x00%s(%d)\x00%lld\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00?\x008\x0016LE\x0016BE\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00cannot change %s wal mode from within a transaction\x00into\x00out of\x00database table is locked: %s\x00-- %s\x00statement aborts at %d: [%s] %s\x00out of memory\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00cannot open value of type %s\x00null\x00real\x00integer\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00main\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to likelihood() must be a constant between 0.0 and 1.0\x00not authorized to use function: %s\x00non-deterministic functions\x00%.*s() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %.*s()\x00no such function: %.*s\x00wrong number of arguments to function %.*s()\x00FILTER may not be used with non-aggregate %.*s()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00a GROUP BY clause is required before HAVING\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x000\x00too many arguments on function %T\x00unsafe use of %s()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00%sLIST SUBQUERY %d\x00CORRELATED \x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%s\x00generated column loop on \"%s\"\x00misuse of aggregate: %s()\x00unknown function: %s()\x00RAISE() may only be used within a trigger-program\x00B\x00C\x00D\x00E\x00sqlite_\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1)=NULL \x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d) WHERE type = 'table' AND name = %Q\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00cannot rename columns of %s \"%s\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q) AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00error in %s %s%s: %s\x00 after rename\x00\"%w\"\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00memdb\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s %T cannot reference objects in database %s\x00%s cannot use variables\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00sqlite_temp_schema\x00sqlite_schema\x00sqlite_temp_master\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00table %T already exists\x00there is already an index named %s\x00too many columns on %s\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00INTEGER\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00unsupported use of NULLS %s\x00FIRST\x00LAST\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00CREATE%s INDEX %.*s\x00 UNIQUE\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00a JOIN clause is required before %s\x00ON\x00USING\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00text\x00blob\x00integer overflow\x00%.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!.20e\x00 \x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\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\x00coalesce\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00sqlite3_extension_init\x00unable to open shared library [%s]\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00so\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00log\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\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\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00onoffalseyestruextrafull\x00exclusive\x00normal\x00none\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00w\x00a\x00s\x00sissii\x00utf8\x00utf16le\x00utf16be\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00issisii\x00issisi\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00NULL value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00non-unique entry in index \x00wrong # of entries in index \x00ok\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00malformed database schema (%s)\x00%z - %s\x00create \x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown or unsupported join type: %T %T%s%T\x00RIGHT and FULL OUTER JOINs are not currently supported\x00naturaleftouterightfullinnercross\x00a NATURAL join may not have an ON or USING clause\x00cannot have both ON and USING clauses in the same join\x00cannot join using column %s - column not present in both tables\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00column%d\x00%.*z:%u\x00cannot use window functions in recursive queries\x00SETUP\x00recursive aggregate queries not supported\x00RECURSIVE STEP\x00SCAN %d CONSTANT ROW%s\x00S\x00%s clause should come after %s not before\x00ORDER BY\x00LIMIT\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00subquery_%u\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00unsafe use of virtual table \"%s\"\x00*\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00SCAN TABLE %s%s%s\x00 USING COVERING INDEX \x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %u\x00MATERIALIZE %u\x00DISTINCT\x00GROUP BY\x00RIGHT PART OF ORDER BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00trigger %T already exists\x00cannot create trigger on system table\x00cannot create %s trigger on view: %S\x00BEFORE\x00AFTER\x00cannot create INSTEAD OF trigger on table: %S\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00ATTACH %Q AS vacuum_db\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO vacuum_db.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM vacuum_db.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO vacuum_db.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00 SUBQUERY %u\x00 TABLE %s\x00 AS %s\x00PRIMARY KEY\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00=\x00>? AND rowid<\x00 USING INTEGER PRIMARY KEY (rowid%s?)\x00 VIRTUAL TABLE INDEX %d:%s\x00MULTI-INDEX OR\x00INDEX %d\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00row_number\x00dense_rank\x00rank\x00percent_rank\x00cume_dist\x00ntile\x00last_value\x00nth_value\x00first_value\x00lead\x00lag\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00parser stack overflow\x00unknown table option: %.*s\x00set list\x00near \"%T\": syntax error\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\x00incomplete input\x00unrecognized token: \"%.*s\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\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\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00mode\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00shared\x00private\x00ro\x00rw\x00rwc\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00[0]\x00JSON path error near '%q'\x00json_%s() needs an odd number of arguments\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%d]\x00.%.*s\x00$\x00json\x00json_array\x00json_array_length\x00json_extract\x00json_insert\x00json_object\x00json_patch\x00json_quote\x00json_remove\x00json_replace\x00json_set\x00json_type\x00json_valid\x00json_group_array\x00json_group_object\x00json_each\x00json_tree\x00%s_node\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00);\x00,%.*s REAL\x00,%.*s INT\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00Mapping (%lld -> %lld) missing from %s table\x00%_rowid\x00%_parent\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00END\x00wrong number of arguments to function rtreecheck()\x00[\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql LIKE 'create virtual%%'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00table %q %s rbu_rowid column\x00may not have\x00requires\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00 NOT NULL\x00%z, %z\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00 WITHOUT ROWID\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00AND\x00WHERE\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00, _rowid_\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00, 0 AS rbu_rowid\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x000 AS \x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file://%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00file:%s-vactmp?rbu_memory=1%s%s\x00&\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00database modified during rbu %s\x00vacuum\x00update\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00snippet\x00highlight\x00bm25\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00columns\x00malformed detail=... directive\x00unrecognized option: \"%.*s\"\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00fts5: %s queries are not supported (detail!=full)\x00phrase\x00%s \x00-col %d \x00-col {%d\x00 %d\x00} \x00-near %d \x00--\x00 {\x00 [%z]\x00\"\"\x00%s : \x00NEAR(\x00 + \x00, %d)\x00 NOT \x00 OR \x00%s%s%z%s\x00nearset\x00wrong number of arguments to function %s\x00fts5_expr_tcl\x00fts5_expr\x00wrong number of arguments to function fts5_isalnum\x00L*\x00N*\x00Co\x00wrong number of arguments to function fts5_fold\x00fts5_isalnum\x00fts5_fold\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00{averages} \x00{structure}\x00{%ssegid=%d h=%d pgno=%d}\x00dlidx \x00 {lvl=%d nMerge=%d nSeg=%d\x00 {id=%d leaves=%d..%d}\x00%s%d\x00 id=%lld\x00 nPos=%d%s\x00+\x00 %lld%s\x00 %d(%lld)\x00 term=%.*s\x00corrupt\x00should be: fts5_rowid(subject, ....)\x00segment\x00should be: fts5_rowid('segment', segid, pgno))\x00first arg to fts5_rowid() must be 'segment'\x00fts5_decode\x00fts5_decode_none\x00fts5_rowid\x00recursively defined fts5 content table\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00DESC\x00ASC\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%s: table does not support scanning\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00cannot %s contentless fts5 table: %s\x00UPDATE\x00DELETE from\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f\x00config\x00fts5\x00fts5_source_id\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f\x00" +var ts1 = "COMPILER=gcc-7.5.0\x00ENABLE_COLUMN_METADATA\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_JSON1\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MUTEX_NOOP\x00SOUNDEX\x00THREADSAFE=1\x003.35.0\x00BINARY\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00local time unavailable\x00second\x00minute\x00hour\x00day\x00month\x00year\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00%04d-%02d-%02d %02d:%02d:%02d\x00%02d:%02d:%02d\x00%04d-%02d-%02d\x00%02d\x00%06.3f\x00%03d\x00%.16g\x00%04d\x00julianday\x00date\x00time\x00datetime\x00strftime\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x000123456789ABCDEF0123456789abcdef\x00-x0\x00X0\x00%\x00NaN\x00Inf\x00\x00NULL\x00(NULL)\x00.\x00thstndrd\x00922337203685477580\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00SorterNext\x00Prev\x00Next\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00Not\x00IfNot\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSmaller\x00SorterSort\x00Sort\x00Rewind\x00IdxLE\x00IdxGT\x00IdxLT\x00IdxGE\x00RowSetRead\x00Or\x00And\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IfNotZero\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseNotEq\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Init\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00ChngCntRow\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00Offset\x00Column\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00OpenWrite\x00OpenDup\x00OpenAutoindex\x00OpenEphemeral\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00SorterOpen\x00BitNot\x00SequenceTest\x00OpenPseudo\x00String8\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00IntegrityCk\x00RowSetAdd\x00Param\x00Real\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00SQLITE_TMPDIR\x00TMPDIR\x00/var/tmp\x00/usr/tmp\x00/tmp\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00SQLite format 3\x00:memory:\x00@ \x00\n\x00invalid page number %d\x002nd reference to page %d\x00Failed to read ptrmap key=%d\x00Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)\x00failed to get page %d\x00freelist leaf count too big on page %d\x00%s is %d but should be %d\x00size\x00overflow list length\x00Page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00On tree page %u cell %d: \x00On page %u at right child: \x00Offset %d out of range %d..%d\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %d bytes reported as %d on page %u\x00Main freelist: \x00max rootpage (%d) disagrees with header (%d)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %d is never used\x00Pointer map page %d is referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00B\x00,%s%s%s\x00N.\x00)\x00%.18s-%s\x00%s(%d)\x00%lld\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00?\x008\x0016LE\x0016BE\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00cannot change %s wal mode from within a transaction\x00into\x00out of\x00database table is locked: %s\x00-- %s\x00statement aborts at %d: [%s] %s\x00out of memory\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00cannot open value of type %s\x00null\x00real\x00integer\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00main\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00true\x00false\x00the \".\" operator\x00second argument to likelihood() must be a constant between 0.0 and 1.0\x00not authorized to use function: %s\x00non-deterministic functions\x00%.*s() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %.*s()\x00no such function: %.*s\x00wrong number of arguments to function %.*s()\x00FILTER may not be used with non-aggregate %.*s()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00a GROUP BY clause is required before HAVING\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x000\x00too many arguments on function %T\x00unsafe use of %s()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00%sLIST SUBQUERY %d\x00CORRELATED \x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%s\x00generated column loop on \"%s\"\x00misuse of aggregate: %s()\x00unknown function: %s()\x00RAISE() may only be used within a trigger-program\x00B\x00C\x00D\x00E\x00sqlite_\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q)=NULL \x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename') THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00cannot %s %s \"%s\"\x00drop column from\x00rename columns of\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q) AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00error in %s %s%s%s: %s\x00 \x00\"%w\"\x00%.*s%s\x00cannot drop %s column: \"%s\"\x00PRIMARY KEY\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00memdb\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00sqlite_temp_schema\x00sqlite_schema\x00sqlite_temp_master\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00table %T already exists\x00there is already an index named %s\x00sqlite_returning\x00cannot use RETURNING in a trigger\x00too many columns on %s\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00INTEGER\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00unsupported use of NULLS %s\x00FIRST\x00LAST\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00CREATE%s INDEX %.*s\x00 UNIQUE\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00a JOIN clause is required before %s\x00ON\x00USING\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00text\x00blob\x00integer overflow\x00%.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!.20e\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\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\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00glob\x00coalesce\x00sign\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00sqlite3_extension_init\x00unable to open shared library [%s]\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00so\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00log\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\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\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00onoffalseyestruextrafull\x00exclusive\x00normal\x00none\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00w\x00a\x00s\x00sissii\x00utf8\x00utf16le\x00utf16be\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00issisii\x00issisi\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00NULL value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00non-unique entry in index \x00wrong # of entries in index \x00ok\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00error in %s %s after %s: %s\x00rename\x00drop column\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown or unsupported join type: %T %T%s%T\x00RIGHT and FULL OUTER JOINs are not currently supported\x00naturaleftouterightfullinnercross\x00a NATURAL join may not have an ON or USING clause\x00cannot have both ON and USING clauses in the same join\x00cannot join using column %s - column not present in both tables\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00column%d\x00%.*z:%u\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00SCAN %d CONSTANT ROW%s\x00S\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00subquery_%u\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00unsafe use of virtual table \"%s\"\x00*\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00SCAN TABLE %s%s%s\x00 USING COVERING INDEX \x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %u\x00MATERIALIZE %u\x00DISTINCT\x00GROUP BY\x00RIGHT PART OF ORDER BY\x00ORDER BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00trigger %T already exists\x00cannot create trigger on system table\x00cannot create %s trigger on view: %S\x00BEFORE\x00AFTER\x00cannot create INSTEAD OF trigger on table: %S\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00%s RETURNING is not available on virtual tables\x00DELETE\x00UPDATE\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00ATTACH %Q AS vacuum_db\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO vacuum_db.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM vacuum_db.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO vacuum_db.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00 SUBQUERY %u\x00 TABLE %s\x00 AS %s\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00=\x00>? AND rowid<\x00 USING INTEGER PRIMARY KEY (rowid%s?)\x00 VIRTUAL TABLE INDEX %d:%s\x00MULTI-INDEX OR\x00INDEX %d\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00row_number\x00dense_rank\x00rank\x00percent_rank\x00cume_dist\x00ntile\x00last_value\x00nth_value\x00first_value\x00lead\x00lag\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00%s clause should come after %s not before\x00LIMIT\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00parser stack overflow\x00unknown table option: %.*s\x00set list\x00near \"%T\": syntax error\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\x00incomplete input\x00unrecognized token: \"%.*s\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\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\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00mode\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00shared\x00private\x00ro\x00rw\x00rwc\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00[0]\x00JSON path error near '%q'\x00json_%s() needs an odd number of arguments\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%d]\x00.%.*s\x00$\x00json\x00json_array\x00json_array_length\x00json_extract\x00json_insert\x00json_object\x00json_patch\x00json_quote\x00json_remove\x00json_replace\x00json_set\x00json_type\x00json_valid\x00json_group_array\x00json_group_object\x00json_each\x00json_tree\x00%s_node\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00);\x00,%.*s REAL\x00,%.*s INT\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00Mapping (%lld -> %lld) missing from %s table\x00%_rowid\x00%_parent\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00END\x00wrong number of arguments to function rtreecheck()\x00[\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql LIKE 'create virtual%%'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00table %q %s rbu_rowid column\x00may not have\x00requires\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00 NOT NULL\x00%z, %z\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00 WITHOUT ROWID\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00AND\x00WHERE\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00, _rowid_\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00, 0 AS rbu_rowid\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x000 AS \x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file://%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00file:%s-vactmp?rbu_memory=1%s%s\x00&\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00database modified during rbu %s\x00vacuum\x00update\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00snippet\x00highlight\x00bm25\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00columns\x00malformed detail=... directive\x00unrecognized option: \"%.*s\"\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00fts5: %s queries are not supported (detail!=full)\x00phrase\x00%s \x00-col %d \x00-col {%d\x00 %d\x00} \x00-near %d \x00--\x00 {\x00 [%z]\x00\"\"\x00{\x00%s : \x00NEAR(\x00 + \x00, %d)\x00 NOT \x00 OR \x00%s%s%z%s\x00nearset\x00wrong number of arguments to function %s\x00fts5_expr_tcl\x00fts5_expr\x00wrong number of arguments to function fts5_isalnum\x00L*\x00N*\x00Co\x00wrong number of arguments to function fts5_fold\x00fts5_isalnum\x00fts5_fold\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00{averages} \x00{structure}\x00{%ssegid=%d h=%d pgno=%d}\x00dlidx \x00 {lvl=%d nMerge=%d nSeg=%d\x00 {id=%d leaves=%d..%d}\x00%s%d\x00 id=%lld\x00 nPos=%d%s\x00+\x00 %lld%s\x00 %d(%lld)\x00 term=%.*s\x00corrupt\x00should be: fts5_rowid(subject, ....)\x00segment\x00should be: fts5_rowid('segment', segid, pgno))\x00first arg to fts5_rowid() must be 'segment'\x00fts5_decode\x00fts5_decode_none\x00fts5_rowid\x00recursively defined fts5 content table\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00DESC\x00ASC\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%s: table does not support scanning\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00cannot %s contentless fts5 table: %s\x00DELETE from\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2021-03-12 15:10:09 acd63062eb06748bfe9e4886639e4f2b54ea6a496a83f10716abbaba4115500b\x00config\x00fts5\x00fts5_source_id\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00ascii\x00porter\x00trigram\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002021-03-12 15:10:09 acd63062eb06748bfe9e4886639e4f2b54ea6a496a83f10716abbaba4115500b\x00" var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data diff --git a/libtest/capi_linux_amd64.go b/libtest/capi_linux_amd64.go index a8b84cd..36bfadd 100644 --- a/libtest/capi_linux_amd64.go +++ b/libtest/capi_linux_amd64.go @@ -1,4 +1,4 @@ -// Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines -export-enums -export-externs X -export-fields F -export-typedefs -pkgname sqlite3 -o libtest/sqlite_linux_amd64.go -trace-translation-units -volatile=sqlite3_io_error_pending,sqlite3_open_file_count,sqlite3_pager_readdb_count,sqlite3_pager_writedb_count,sqlite3_pager_writej_count,sqlite3_search_count,sqlite3_sort_count,saved_cnt testdata/sqlite-amalgamation-3330000/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1', DO NOT EDIT. +// Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines -export-enums -export-externs X -export-fields F -export-typedefs -pkgname sqlite3 -o libtest/sqlite_linux_amd64.go -trace-translation-units -volatile=sqlite3_io_error_pending,sqlite3_open_file_count,sqlite3_pager_readdb_count,sqlite3_pager_writedb_count,sqlite3_pager_writej_count,sqlite3_search_count,sqlite3_sort_count,saved_cnt testdata/sqlite-amalgamation-3350000/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CKSUMVFS_STATIC -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1', DO NOT EDIT. package sqlite3 @@ -15,10 +15,12 @@ var CAPI = map[string]struct{}{ "sqlite3AddInt64": {}, "sqlite3AddNotNull": {}, "sqlite3AddPrimaryKey": {}, + "sqlite3AddReturning": {}, "sqlite3AffinityType": {}, "sqlite3AggInfoPersistWalkerInit": {}, "sqlite3AllocateIndexObject": {}, "sqlite3AlterBeginAddColumn": {}, + "sqlite3AlterDropColumn": {}, "sqlite3AlterFinishAddColumn": {}, "sqlite3AlterFunctions": {}, "sqlite3AlterRenameColumn": {}, @@ -102,8 +104,6 @@ var CAPI = map[string]struct{}{ "sqlite3BtreeIntegerKey": {}, "sqlite3BtreeIntegrityCheck": {}, "sqlite3BtreeIsInBackup": {}, - "sqlite3BtreeIsInReadTrans": {}, - "sqlite3BtreeIsInTrans": {}, "sqlite3BtreeIsReadonly": {}, "sqlite3BtreeLast": {}, "sqlite3BtreeLastPage": {}, @@ -139,7 +139,9 @@ var CAPI = map[string]struct{}{ "sqlite3BtreeSetSpillSize": {}, "sqlite3BtreeSetVersion": {}, "sqlite3BtreeSharable": {}, + "sqlite3BtreeTransferRow": {}, "sqlite3BtreeTripAllCursors": {}, + "sqlite3BtreeTxnState": {}, "sqlite3BtreeUpdateMeta": {}, "sqlite3BuiltinFunctions": {}, "sqlite3CantopenError": {}, @@ -159,6 +161,7 @@ var CAPI = map[string]struct{}{ "sqlite3CodeVerifySchema": {}, "sqlite3CollapseDatabaseArray": {}, "sqlite3ColumnDefault": {}, + "sqlite3ColumnIndex": {}, "sqlite3ColumnType": {}, "sqlite3ColumnsFromExprList": {}, "sqlite3CommitInternalChanges": {}, @@ -176,6 +179,8 @@ var CAPI = map[string]struct{}{ "sqlite3CreateFunc": {}, "sqlite3CreateIndex": {}, "sqlite3CreateView": {}, + "sqlite3CteDelete": {}, + "sqlite3CteNew": {}, "sqlite3CtypeMap": {}, "sqlite3DbFree": {}, "sqlite3DbFreeNN": {}, @@ -216,6 +221,7 @@ var CAPI = map[string]struct{}{ "sqlite3ErrName": {}, "sqlite3ErrStr": {}, "sqlite3Error": {}, + "sqlite3ErrorClear": {}, "sqlite3ErrorMsg": {}, "sqlite3ErrorToParser": {}, "sqlite3ErrorWithMsg": {}, @@ -303,7 +309,6 @@ var CAPI = map[string]struct{}{ "sqlite3FinishCoding": {}, "sqlite3FinishTrigger": {}, "sqlite3FixExpr": {}, - "sqlite3FixExprList": {}, "sqlite3FixInit": {}, "sqlite3FixSelect": {}, "sqlite3FixSrcList": {}, @@ -536,6 +541,7 @@ var CAPI = map[string]struct{}{ "sqlite3PagerWrite": {}, "sqlite3ParseUri": {}, "sqlite3Parser": {}, + "sqlite3ParserAddCleanup": {}, "sqlite3ParserFallback": {}, "sqlite3ParserFinalize": {}, "sqlite3ParserInit": {}, @@ -632,7 +638,9 @@ var CAPI = map[string]struct{}{ "sqlite3SelectDup": {}, "sqlite3SelectExprHeight": {}, "sqlite3SelectNew": {}, + "sqlite3SelectOpName": {}, "sqlite3SelectPrep": {}, + "sqlite3SelectTrace": {}, "sqlite3SelectWalkFail": {}, "sqlite3SelectWalkNoop": {}, "sqlite3SelectWrongNumTermsError": {}, @@ -703,6 +711,8 @@ var CAPI = map[string]struct{}{ "sqlite3UpsertDoUpdate": {}, "sqlite3UpsertDup": {}, "sqlite3UpsertNew": {}, + "sqlite3UpsertNextIsIPK": {}, + "sqlite3UpsertOfIndex": {}, "sqlite3Utf16ByteLen": {}, "sqlite3Utf16to8": {}, "sqlite3Utf8CharLen": {}, @@ -935,6 +945,7 @@ var CAPI = map[string]struct{}{ "sqlite3WhereIsDistinct": {}, "sqlite3WhereIsOrdered": {}, "sqlite3WhereIsSorted": {}, + "sqlite3WhereMinMaxOptEarlyOut": {}, "sqlite3WhereOkOnePass": {}, "sqlite3WhereOrderByLimitOptLabel": {}, "sqlite3WhereOutputRowCount": {}, @@ -1221,8 +1232,8 @@ var CAPI = map[string]struct{}{ "sqlite3_trace": {}, "sqlite3_trace_v2": {}, "sqlite3_transfer_bindings": {}, + "sqlite3_txn_state": {}, "sqlite3_unlock_notify": {}, - "sqlite3_unsupported_selecttrace": {}, "sqlite3_update_hook": {}, "sqlite3_uri_boolean": {}, "sqlite3_uri_int64": {}, diff --git a/libtest/sqlite_darwin_amd64.go b/libtest/sqlite_darwin_amd64.go index c9a0f6b..11f934b 100644 --- a/libtest/sqlite_darwin_amd64.go +++ b/libtest/sqlite_darwin_amd64.go @@ -120511,7 +120511,6 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt goto __4 goto __6 __6: - } } @@ -176195,7 +176194,6 @@ __15: goto __14 goto __16 __16: - } // This is a helper function for rbuObjIterCacheTableInfo(). It populates diff --git a/libtest/sqlite_linux_amd64.go b/libtest/sqlite_linux_amd64.go index 9b1d444..025e4dd 100644 --- a/libtest/sqlite_linux_amd64.go +++ b/libtest/sqlite_linux_amd64.go @@ -1,4 +1,4 @@ -// Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines "" -export-enums "" -export-externs X -export-fields F -export-typedefs "" -pkgname sqlite3 -o libtest/sqlite_linux_amd64.go -trace-translation-units -volatile=sqlite3_io_error_pending,sqlite3_open_file_count,sqlite3_pager_readdb_count,sqlite3_pager_writedb_count,sqlite3_pager_writej_count,sqlite3_search_count,sqlite3_sort_count,saved_cnt testdata/sqlite-amalgamation-3330000/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1', DO NOT EDIT. +// Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines "" -export-enums "" -export-externs X -export-fields F -export-typedefs "" -pkgname sqlite3 -o libtest/sqlite_linux_amd64.go -trace-translation-units -volatile=sqlite3_io_error_pending,sqlite3_open_file_count,sqlite3_pager_readdb_count,sqlite3_pager_writedb_count,sqlite3_pager_writej_count,sqlite3_search_count,sqlite3_sort_count,saved_cnt testdata/sqlite-amalgamation-3350000/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CKSUMVFS_STATIC -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1', DO NOT EDIT. package sqlite3 @@ -41,10 +41,6 @@ const ( AT_FDCWD = -100 AT_NO_AUTOMOUNT = 0x800 AT_REMOVEDIR = 0x200 - AT_STATX_DONT_SYNC = 0x4000 - AT_STATX_FORCE_SYNC = 0x2000 - AT_STATX_SYNC_AS_STAT = 0x0000 - AT_STATX_SYNC_TYPE = 0x6000 AT_SYMLINK_FOLLOW = 0x400 AT_SYMLINK_NOFOLLOW = 0x100 BIG_ENDIAN = 4321 @@ -80,6 +76,7 @@ const ( BTREE_LARGEST_ROOT_PAGE = 4 BTREE_MEMORY = 2 BTREE_OMIT_JOURNAL = 1 + BTREE_PREFORMAT = 0x80 BTREE_SAVEPOSITION = 0x02 BTREE_SCHEMA_VERSION = 1 BTREE_SEEK_EQ = 0x00000002 @@ -109,13 +106,14 @@ const ( CC_DOT = 26 CC_EQ = 14 CC_GT = 13 - CC_ID = 2 - CC_ILLEGAL = 27 - CC_KYWD = 1 + CC_ID = 27 + CC_ILLEGAL = 28 + CC_KYWD = 2 + CC_KYWD0 = 1 CC_LP = 17 CC_LT = 12 CC_MINUS = 11 - CC_NUL = 28 + CC_NUL = 29 CC_PERCENT = 22 CC_PIPE = 10 CC_PLUS = 20 @@ -329,7 +327,6 @@ const ( EPROTONOSUPPORT = 93 EPROTOTYPE = 91 EP_Agg = 0x000010 - EP_Alias = 0x400000 EP_CanBeNull = 0x100000 EP_Collate = 0x000100 EP_Commuted = 0x000200 @@ -340,6 +337,7 @@ const ( EP_FromDDL = 0x40000000 EP_FromJoin = 0x000001 EP_HasFunc = 0x000004 + EP_IfNullRow = 0x020000 EP_Immutable = 0x02 EP_InfixFunc = 0x000080 EP_IntValue = 0x000400 @@ -489,11 +487,15 @@ const ( FTS5_MAX_PREFIX_INDEXES = 31 FTS5_MAX_SEGMENT = 2000 FTS5_MAX_TOKEN_SIZE = 32768 + FTS5_MERGE_NLIST = 16 FTS5_MINUS = 6 FTS5_MIN_DLIDX_SIZE = 4 FTS5_NOT = 3 FTS5_OPT_WORK_UNIT = 1000 FTS5_OR = 1 + FTS5_PATTERN_GLOB = 66 + FTS5_PATTERN_LIKE = 65 + FTS5_PATTERN_NONE = 0 FTS5_PLAN_MATCH = 1 FTS5_PLAN_ROWID = 6 FTS5_PLAN_SCAN = 5 @@ -589,7 +591,7 @@ const ( F_ULOCK = 0 F_UNLCK = 2 F_WRLCK = 1 - GCC_VERSION = 8003000 + GCC_VERSION = 7005000 GEOPOLY_PI = 3.1415926535897932385 HASHSIZE = 97 HASHTABLE_HASH_1 = 383 @@ -605,7 +607,8 @@ const ( INCRINIT_NORMAL = 0 INCRINIT_ROOT = 2 INCRINIT_TASK = 1 - INITFLAG_AlterTable = 0x0001 + INITFLAG_AlterDrop = 0x0002 + INITFLAG_AlterRename = 0x0001 INLINEFUNC_affinity = 4 INLINEFUNC_coalesce = 0 INLINEFUNC_expr_compare = 3 @@ -686,6 +689,9 @@ const ( L_ctermid = 9 L_cuserid = 9 L_tmpnam = 20 + M10d_Any = 1 + M10d_No = 2 + M10d_Yes = 0 MADV_DODUMP = 17 MADV_DOFORK = 11 MADV_DONTDUMP = 16 @@ -711,7 +717,6 @@ const ( MAP_EXECUTABLE = 0x01000 MAP_FILE = 0 MAP_FIXED = 0x10 - MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x00100 MAP_HUGETLB = 0x40000 MAP_HUGE_MASK = 0x3f @@ -722,9 +727,7 @@ const ( MAP_POPULATE = 0x08000 MAP_PRIVATE = 0x02 MAP_SHARED = 0x01 - MAP_SHARED_VALIDATE = 0x03 MAP_STACK = 0x20000 - MAP_SYNC = 0x80000 MAP_TYPE = 0x0f MATH_ERREXCEPT = 2 MATH_ERRNO = 1 @@ -886,6 +889,7 @@ const ( NC_PartIdx = 0x00002 NC_SelfRef = 0x0002e NC_UAggInfo = 0x00100 + NC_UBaseReg = 0x00400 NC_UEList = 0x00080 NC_UUpsert = 0x00200 NC_VarSelect = 0x00040 @@ -942,6 +946,7 @@ const ( OPFLAG_NOCHNG_MAGIC = 0x6d OPFLAG_P2ISREG = 0x10 OPFLAG_PERMUTE = 0x01 + OPFLAG_PREFORMAT = 0x80 OPFLAG_SAVEPOSITION = 0x02 OPFLAG_SEEKEQ = 0x02 OPFLAG_TYPEOFARG = 0x80 @@ -952,51 +957,52 @@ const ( OPFLG_JUMP = 0x01 OPFLG_OUT2 = 0x10 OPFLG_OUT3 = 0x20 - OP_Abortable = 175 - OP_Add = 105 - OP_AddImm = 82 - OP_Affinity = 90 - OP_AggFinal = 157 - OP_AggInverse = 153 - OP_AggStep = 154 - OP_AggStep1 = 155 - OP_AggValue = 156 + OP_Abortable = 178 + OP_Add = 106 + OP_AddImm = 83 + OP_Affinity = 91 + OP_AggFinal = 160 + OP_AggInverse = 156 + OP_AggStep = 157 + OP_AggStep1 = 158 + OP_AggValue = 159 OP_And = 44 OP_AutoCommit = 1 - OP_BitAnd = 101 - OP_BitNot = 112 - OP_BitOr = 102 + OP_BitAnd = 102 + OP_BitNot = 113 + OP_BitOr = 103 OP_Blob = 74 - OP_Cast = 84 + OP_Cast = 85 OP_Checkpoint = 6 - OP_Clear = 137 - OP_Close = 116 - OP_CollSeq = 81 - OP_Column = 89 - OP_ColumnsUsed = 117 - OP_Compare = 86 - OP_Concat = 110 + OP_ChngCntRow = 80 + OP_Clear = 140 + OP_Close = 117 + OP_CollSeq = 82 + OP_Column = 90 + OP_ColumnsUsed = 118 + OP_Compare = 87 + OP_Concat = 111 OP_Copy = 77 - OP_Count = 92 - OP_CreateBtree = 139 - OP_CursorHint = 171 - OP_CursorLock = 159 - OP_CursorUnlock = 160 + OP_Count = 93 + OP_CreateBtree = 142 + OP_CursorHint = 174 + OP_CursorLock = 162 + OP_CursorUnlock = 163 OP_DecrJumpZero = 59 - OP_DeferredSeek = 133 - OP_Delete = 122 - OP_Destroy = 136 - OP_Divide = 108 - OP_DropIndex = 144 - OP_DropTable = 143 - OP_DropTrigger = 145 + OP_DeferredSeek = 136 + OP_Delete = 125 + OP_Destroy = 139 + OP_Divide = 109 + OP_DropIndex = 147 + OP_DropTable = 146 + OP_DropTrigger = 148 OP_ElseNotEq = 58 OP_EndCoroutine = 66 OP_Eq = 53 - OP_Expire = 158 - OP_Explain = 174 - OP_FinishSeek = 135 - OP_FkCounter = 149 + OP_Expire = 161 + OP_Explain = 177 + OP_FinishSeek = 138 + OP_FkCounter = 153 OP_FkIfZero = 47 OP_Found = 30 OP_Function = 64 @@ -1006,13 +1012,13 @@ const ( OP_Gt = 54 OP_Halt = 68 OP_HaltIfNull = 67 - OP_IdxDelete = 132 + OP_IdxDelete = 135 OP_IdxGE = 41 OP_IdxGT = 39 - OP_IdxInsert = 130 + OP_IdxInsert = 133 OP_IdxLE = 38 OP_IdxLT = 40 - OP_IdxRowid = 134 + OP_IdxRowid = 137 OP_If = 18 OP_IfNoHope = 27 OP_IfNot = 20 @@ -1024,106 +1030,108 @@ const ( OP_IncrVacuum = 60 OP_Init = 62 OP_InitCoroutine = 13 - OP_Insert = 121 + OP_Insert = 123 OP_Int64 = 70 OP_IntCopy = 79 OP_Integer = 69 - OP_IntegrityCk = 146 + OP_IntegrityCk = 149 OP_IsNull = 50 - OP_IsTrue = 87 + OP_IsTrue = 88 OP_JournalMode = 7 OP_Jump = 16 OP_Last = 33 OP_Le = 55 - OP_LoadAnalysis = 142 + OP_LoadAnalysis = 145 OP_Lt = 56 - OP_MakeRecord = 91 - OP_MaxPgcnt = 169 - OP_MemMax = 151 + OP_MakeRecord = 92 + OP_MaxPgcnt = 172 + OP_MemMax = 154 OP_Move = 76 - OP_Multiply = 107 + OP_Multiply = 108 OP_MustBeInt = 15 OP_Ne = 52 - OP_NewRowid = 120 + OP_NewRowid = 122 OP_Next = 5 OP_NoConflict = 28 - OP_Noop = 173 + OP_Noop = 176 OP_Not = 19 OP_NotExists = 32 OP_NotFound = 29 OP_NotNull = 51 OP_Null = 72 - OP_NullRow = 128 - OP_Offset = 88 - OP_OffsetLimit = 152 + OP_NullRow = 131 + OP_Offset = 89 + OP_OffsetLimit = 155 OP_Once = 17 - OP_OpenAutoindex = 99 - OP_OpenDup = 98 - OP_OpenEphemeral = 100 - OP_OpenPseudo = 114 - OP_OpenRead = 96 - OP_OpenWrite = 97 + OP_OpenAutoindex = 100 + OP_OpenDup = 99 + OP_OpenEphemeral = 101 + OP_OpenPseudo = 115 + OP_OpenRead = 97 + OP_OpenWrite = 98 OP_Or = 43 - OP_Pagecount = 168 - OP_Param = 148 - OP_ParseSchema = 141 - OP_Permutation = 85 + OP_Pagecount = 171 + OP_Param = 151 + OP_ParseSchema = 144 + OP_Permutation = 86 OP_Prev = 4 OP_Program = 46 OP_PureFunc = 63 - OP_ReadCookie = 93 - OP_Real = 150 - OP_RealAffinity = 83 - OP_ReleaseReg = 172 - OP_Remainder = 109 - OP_ReopenIdx = 95 - OP_ResetCount = 123 - OP_ResetSorter = 138 - OP_ResultRow = 80 + OP_ReadCookie = 94 + OP_Real = 152 + OP_RealAffinity = 84 + OP_ReleaseReg = 175 + OP_Remainder = 110 + OP_ReopenIdx = 96 + OP_ResetCount = 126 + OP_ResetSorter = 141 + OP_ResultRow = 81 OP_Return = 65 OP_Rewind = 37 - OP_RowData = 126 - OP_RowSetAdd = 147 + OP_RowCell = 124 + OP_RowData = 129 + OP_RowSetAdd = 150 OP_RowSetRead = 42 OP_RowSetTest = 45 - OP_Rowid = 127 + OP_Rowid = 130 OP_SCopy = 78 OP_Savepoint = 0 - OP_SeekEnd = 129 + OP_SeekEnd = 132 OP_SeekGE = 24 OP_SeekGT = 25 - OP_SeekHit = 118 + OP_SeekHit = 120 OP_SeekLE = 23 OP_SeekLT = 22 OP_SeekRowid = 31 - OP_Sequence = 119 - OP_SequenceTest = 113 - OP_SetCookie = 94 - OP_ShiftLeft = 103 - OP_ShiftRight = 104 + OP_SeekScan = 119 + OP_Sequence = 121 + OP_SequenceTest = 114 + OP_SetCookie = 95 + OP_ShiftLeft = 104 + OP_ShiftRight = 105 OP_SoftNull = 73 OP_Sort = 36 - OP_SorterCompare = 124 - OP_SorterData = 125 - OP_SorterInsert = 131 + OP_SorterCompare = 127 + OP_SorterData = 128 + OP_SorterInsert = 134 OP_SorterNext = 3 - OP_SorterOpen = 111 + OP_SorterOpen = 112 OP_SorterSort = 35 - OP_SqlExec = 140 + OP_SqlExec = 143 OP_String = 71 - OP_String8 = 115 - OP_Subtract = 106 - OP_TableLock = 161 - OP_Trace = 170 + OP_String8 = 116 + OP_Subtract = 107 + OP_TableLock = 164 + OP_Trace = 173 OP_Transaction = 2 - OP_VBegin = 162 - OP_VColumn = 166 - OP_VCreate = 163 - OP_VDestroy = 164 + OP_VBegin = 165 + OP_VColumn = 169 + OP_VCreate = 166 + OP_VDestroy = 167 OP_VFilter = 9 OP_VNext = 61 - OP_VOpen = 165 - OP_VRename = 167 + OP_VOpen = 168 + OP_VRename = 170 OP_VUpdate = 10 OP_Vacuum = 8 OP_Variable = 75 @@ -1344,10 +1352,8 @@ const ( RBU_UPDATE = 6 READMARK_NOT_USED = 0xffffffff READ_LOCK = 1 - RENAME_EXCHANGE = 2 - RENAME_NOREPLACE = 1 - RENAME_WHITEOUT = 4 RESERVED_LOCK = 2 + RETURNING_TRIGGER_NAME = "sqlite_returning" RNDAWAY = 0 RNDTOWARDS = 0 ROWSET_ALLOCATION_SIZE = 1024 @@ -1411,9 +1417,11 @@ const ( SF_IncludeHidden = 0x0020000 SF_MaybeConvert = 0x0008000 SF_MinMaxAgg = 0x0001000 + SF_MultiPart = 0x2000000 SF_MultiValue = 0x0000400 SF_NestedFrom = 0x0000800 SF_NoopOrderBy = 0x0400000 + SF_PushDown = 0x1000000 SF_Recursive = 0x0002000 SF_Resolved = 0x0000004 SF_UpdateFrom = 0x0800000 @@ -1518,7 +1526,7 @@ const ( SQLITE_ATTACH = 24 SQLITE_AUTH = 23 SQLITE_AUTH_USER = 279 - SQLITE_AllOpts = 0xffff + SQLITE_AllOpts = 0xffffffff SQLITE_AutoIndex = 0x00008000 SQLITE_BIGENDIAN = 0 SQLITE_BIG_DBL = 0 @@ -1545,6 +1553,7 @@ const ( SQLITE_CHECKPOINT_PASSIVE = 0 SQLITE_CHECKPOINT_RESTART = 2 SQLITE_CHECKPOINT_TRUNCATE = 3 + SQLITE_CKSUMVFS_STATIC = 1 SQLITE_CONFIG_COVERING_INDEX_SCAN = 20 SQLITE_CONFIG_GETMALLOC = 5 SQLITE_CONFIG_GETMUTEX = 11 @@ -1603,9 +1612,9 @@ const ( SQLITE_CacheSpill = 0x00000020 SQLITE_CellSizeCk = 0x00200000 SQLITE_CkptFullFSync = 0x00000010 - SQLITE_CountOfView = 0x0200 - SQLITE_CoverIdxScan = 0x0020 - SQLITE_CursorHints = 0x0400 + SQLITE_CountOfView = 0x00000200 + SQLITE_CoverIdxScan = 0x00000020 + SQLITE_CursorHints = 0x00000400 SQLITE_DBCONFIG_DEFENSIVE = 1010 SQLITE_DBCONFIG_DQS_DDL = 1014 SQLITE_DBCONFIG_DQS_DML = 1013 @@ -1679,7 +1688,7 @@ const ( SQLITE_DROP_VTABLE = 30 SQLITE_Defensive = 0x10000000 SQLITE_DeferFKs = 0x00080000 - SQLITE_DistinctOpt = 0x0010 + SQLITE_DistinctOpt = 0x00000010 SQLITE_DqsDDL = 0x20000000 SQLITE_DqsDML = 0x40000000 SQLITE_ECEL_DUP = 0x01 @@ -1716,6 +1725,7 @@ const ( SQLITE_EnableQPSG = 0x00800000 SQLITE_EnableTrigger = 0x00040000 SQLITE_EnableView = 0x80000000 + SQLITE_ExistsToIN = 0x00020000 SQLITE_FAIL = 3 SQLITE_FAULTINJECTOR_COUNT = 1 SQLITE_FAULTINJECTOR_MALLOC = 0 @@ -1788,14 +1798,15 @@ const ( SQLITE_FUNC_UNLIKELY = 0x0400 SQLITE_FUNC_UNSAFE = 0x00200000 SQLITE_FUNC_WINDOW = 0x00010000 - SQLITE_FactorOutConst = 0x0008 + SQLITE_FactorOutConst = 0x00000008 SQLITE_ForeignKeys = 0x00004000 SQLITE_Fts3Tokenizer = 0x00400000 SQLITE_FullColNames = 0x00000004 SQLITE_FullFSync = 0x00000008 SQLITE_GET_LOCKPROXYFILE = 2 - SQLITE_GroupByOrder = 0x0004 + SQLITE_GroupByOrder = 0x00000004 SQLITE_HASH_H = 0 + SQLITE_HAVE_C99_MATH_FUNCS = 1 SQLITE_HAVE_OS_TRACE = 0 SQLITE_HAVE_ZLIB = 1 SQLITE_IDXTYPE_APPDEF = 0 @@ -1849,6 +1860,7 @@ const ( SQLITE_IOERR_CLOSE = 4106 SQLITE_IOERR_COMMIT_ATOMIC = 7690 SQLITE_IOERR_CONVPATH = 6666 + SQLITE_IOERR_CORRUPTFS = 8458 SQLITE_IOERR_DATA = 8202 SQLITE_IOERR_DELETE = 2570 SQLITE_IOERR_DELETE_NOENT = 5898 @@ -1915,6 +1927,7 @@ const ( SQLITE_MAX_ATTACHED = 10 SQLITE_MAX_COLUMN = 2000 SQLITE_MAX_COMPOUND_SELECT = 500 + SQLITE_MAX_DB = 12 SQLITE_MAX_DEFAULT_PAGE_SIZE = 8192 SQLITE_MAX_EXPR_DEPTH = 1000 SQLITE_MAX_FILE_FORMAT = 4 @@ -1959,6 +1972,7 @@ const ( SQLITE_MUTEX_STATIC_VFS2 = 12 SQLITE_MUTEX_STATIC_VFS3 = 13 SQLITE_MX_JUMP_OPCODE = 62 + SQLITE_MinMaxOpt = 0x00010000 SQLITE_NEED_ERR_NAME = 0 SQLITE_NOLFS = 22 SQLITE_NOMATCH = 1 @@ -1975,7 +1989,7 @@ const ( SQLITE_NULL = 5 SQLITE_NULLEQ = 0x80 SQLITE_N_BTREE_META = 16 - SQLITE_N_KEYWORD = 145 + SQLITE_N_KEYWORD = 147 SQLITE_N_LIMIT = 12 SQLITE_NoCkptOnClose = 0x00000800 SQLITE_NoSchemaError = 0x08000000 @@ -2009,8 +2023,8 @@ const ( SQLITE_OS_SETUP_H = 0 SQLITE_OS_UNIX = 1 SQLITE_OS_WIN = 0 - SQLITE_OmitNoopJoin = 0x0100 - SQLITE_OrderByIdxJoin = 0x0040 + SQLITE_OmitNoopJoin = 0x00000100 + SQLITE_OrderByIdxJoin = 0x00000040 SQLITE_PAGER_H = 0 SQLITE_PERM = 3 SQLITE_POWERSAFE_OVERWRITE = 1 @@ -2027,11 +2041,11 @@ const ( SQLITE_PRIVATE = 0 SQLITE_PROTOCOL = 15 SQLITE_PTRSIZE = 8 - SQLITE_PropagateConst = 0x8000 - SQLITE_PushDown = 0x1000 + SQLITE_PropagateConst = 0x00008000 + SQLITE_PushDown = 0x00001000 SQLITE_QUERY_PLANNER_LIMIT = 20000 SQLITE_QUERY_PLANNER_LIMIT_INCR = 1000 - SQLITE_QueryFlattener = 0x0001 + SQLITE_QueryFlattener = 0x00000001 SQLITE_QueryOnly = 0x00100000 SQLITE_RANGE = 25 SQLITE_RBU_STATE_CHECKPOINT = 3 @@ -2075,7 +2089,7 @@ const ( SQLITE_SHM_UNLOCK = 1 SQLITE_SORTER_PMASZ = 250 SQLITE_SOUNDEX = 1 - SQLITE_SOURCE_ID = "2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f" + SQLITE_SOURCE_ID = "2021-03-12 15:10:09 acd63062eb06748bfe9e4886639e4f2b54ea6a496a83f10716abbaba4115500b" SQLITE_SO_ASC = 0 SQLITE_SO_DESC = 1 SQLITE_SO_UNDEFINED = -1 @@ -2107,9 +2121,9 @@ const ( SQLITE_SYSAPI = 0 SQLITE_SYSTEM_MALLOC = 1 SQLITE_ShortColNames = 0x00000040 - SQLITE_SimplifyJoin = 0x2000 - SQLITE_SkipScan = 0x4000 - SQLITE_Stat4 = 0x0800 + SQLITE_SimplifyJoin = 0x00002000 + SQLITE_SkipScan = 0x00004000 + SQLITE_Stat4 = 0x00000800 SQLITE_TCLAPI = 0 SQLITE_TEMP_FILE_PREFIX = "etilqs_" SQLITE_TEMP_STORE = 1 @@ -2127,7 +2141,7 @@ const ( SQLITE_TESTCTRL_INTERNAL_FUNCTIONS = 17 SQLITE_TESTCTRL_ISINIT = 23 SQLITE_TESTCTRL_ISKEYWORD = 16 - SQLITE_TESTCTRL_LAST = 29 + SQLITE_TESTCTRL_LAST = 31 SQLITE_TESTCTRL_LOCALTIME_FAULT = 18 SQLITE_TESTCTRL_NEVER_CORRUPT = 20 SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD = 19 @@ -2141,7 +2155,9 @@ const ( SQLITE_TESTCTRL_RESERVE = 14 SQLITE_TESTCTRL_RESULT_INTREAL = 27 SQLITE_TESTCTRL_SCRATCHMALLOC = 17 + SQLITE_TESTCTRL_SEEK_COUNT = 30 SQLITE_TESTCTRL_SORTER_MMAP = 24 + SQLITE_TESTCTRL_TRACEFLAGS = 31 SQLITE_TESTCTRL_VDBE_COVERAGE = 21 SQLITE_TEXT = 3 SQLITE_THREADSAFE = 1 @@ -2156,7 +2172,10 @@ const ( SQLITE_TRACE_STMT = 0x01 SQLITE_TRACE_XPROFILE = 0x80 SQLITE_TRANSACTION = 22 - SQLITE_Transitive = 0x0080 + SQLITE_TXN_NONE = 0 + SQLITE_TXN_READ = 1 + SQLITE_TXN_WRITE = 2 + SQLITE_Transitive = 0x00000080 SQLITE_TriggerEQP = 0x01000000 SQLITE_TrustedSchema = 0x00000080 SQLITE_UPDATE = 23 @@ -2169,8 +2188,8 @@ const ( SQLITE_UTF8 = 1 SQLITE_VDBEINT_H = 0 SQLITE_VDBE_H = 0 - SQLITE_VERSION = "3.33.0" - SQLITE_VERSION_NUMBER = 3033000 + SQLITE_VERSION = "3.35.0" + SQLITE_VERSION_NUMBER = 3035000 SQLITE_VTABRISK_High = 2 SQLITE_VTABRISK_Low = 0 SQLITE_VTABRISK_Normal = 1 @@ -2184,16 +2203,16 @@ const ( SQLITE_WIN32_DATA_DIRECTORY_TYPE = 1 SQLITE_WIN32_TEMP_DIRECTORY_TYPE = 2 SQLITE_WSD = 0 - SQLITE_WindowFunc = 0x0002 + SQLITE_WindowFunc = 0x00000002 SQLITE_WriteSchema = 0x00000001 SRT_Coroutine = 13 SRT_Discard = 4 - SRT_DistFifo = 6 - SRT_DistQueue = 8 + SRT_DistFifo = 5 + SRT_DistQueue = 6 SRT_EphemTab = 12 SRT_Except = 2 SRT_Exists = 3 - SRT_Fifo = 5 + SRT_Fifo = 8 SRT_Mem = 10 SRT_Output = 9 SRT_Queue = 7 @@ -2201,27 +2220,6 @@ const ( SRT_Table = 14 SRT_Union = 1 SRT_Upfrom = 15 - STATX_ALL = 0x0fff - STATX_ATIME = 0x0020 - STATX_ATTR_APPEND = 0x0020 - STATX_ATTR_AUTOMOUNT = 0x1000 - STATX_ATTR_COMPRESSED = 0x0004 - STATX_ATTR_ENCRYPTED = 0x0800 - STATX_ATTR_IMMUTABLE = 0x0010 - STATX_ATTR_NODUMP = 0x0040 - STATX_BASIC_STATS = 0x07ff - STATX_BLOCKS = 0x0400 - STATX_BTIME = 0x0800 - STATX_CTIME = 0x0080 - STATX_GID = 0x0010 - STATX_INO = 0x0100 - STATX_MODE = 0x0002 - STATX_MTIME = 0x0040 - STATX_NLINK = 0x0004 - STATX_SIZE = 0x0200 - STATX_TYPE = 0x0001 - STATX_UID = 0x0008 - STATX__RESERVED = 0x80000000 STAT_GET_NDLT = 4 STAT_GET_NEQ = 2 STAT_GET_NLT = 3 @@ -2320,11 +2318,13 @@ const ( TERM_VIRTUAL = 0x0002 TERM_VNULL = 0x0080 TF_Autoincrement = 0x0008 - TF_Ephemeral = 0x0002 + TF_Ephemeral = 0x4000 TF_HasGenerated = 0x0060 + TF_HasHidden = 0x0002 TF_HasNotNull = 0x0800 TF_HasPrimaryKey = 0x0004 TF_HasStat1 = 0x0010 + TF_HasStat4 = 0x2000 TF_HasStored = 0x0040 TF_HasVirtual = 0x0020 TF_NoVisibleRowid = 0x0200 @@ -2401,182 +2401,184 @@ const ( TIOCVHANGUP = 0x5437 TK_ABORT = 27 TK_ACTION = 28 - TK_ADD = 160 + TK_ADD = 162 TK_AFTER = 29 - TK_AGG_COLUMN = 166 - TK_AGG_FUNCTION = 165 - TK_ALL = 133 - TK_ALTER = 159 + TK_AGG_COLUMN = 168 + TK_AGG_FUNCTION = 167 + TK_ALL = 134 + TK_ALTER = 161 TK_ALWAYS = 96 TK_ANALYZE = 30 TK_AND = 44 - TK_ANY = 100 + TK_ANY = 101 TK_AS = 24 TK_ASC = 31 - TK_ASTERISK = 177 + TK_ASTERISK = 179 TK_ATTACH = 32 - TK_AUTOINCR = 124 + TK_AUTOINCR = 125 TK_BEFORE = 33 TK_BEGIN = 5 TK_BETWEEN = 48 - TK_BITAND = 101 - TK_BITNOT = 112 - TK_BITOR = 102 - TK_BLOB = 151 + TK_BITAND = 102 + TK_BITNOT = 113 + TK_BITOR = 103 + TK_BLOB = 153 TK_BY = 34 TK_CASCADE = 35 - TK_CASE = 154 + TK_CASE = 156 TK_CAST = 36 - TK_CHECK = 122 - TK_COLLATE = 111 - TK_COLUMN = 164 + TK_CHECK = 123 + TK_COLLATE = 112 + TK_COLUMN = 166 TK_COLUMNKW = 60 TK_COMMA = 26 TK_COMMIT = 10 - TK_CONCAT = 110 + TK_CONCAT = 111 TK_CONFLICT = 37 - TK_CONSTRAINT = 117 + TK_CONSTRAINT = 118 TK_CREATE = 17 - TK_CTIME_KW = 99 + TK_CTIME_KW = 100 TK_CURRENT = 85 TK_DATABASE = 38 - TK_DEFAULT = 118 - TK_DEFERRABLE = 129 + TK_DEFAULT = 119 + TK_DEFERRABLE = 130 TK_DEFERRED = 7 - TK_DELETE = 126 + TK_DELETE = 127 TK_DESC = 39 TK_DETACH = 40 - TK_DISTINCT = 138 + TK_DISTINCT = 139 TK_DO = 61 - TK_DOT = 139 - TK_DROP = 131 + TK_DOT = 140 + TK_DROP = 132 TK_EACH = 41 - TK_ELSE = 157 + TK_ELSE = 159 TK_END = 11 TK_EQ = 53 TK_ESCAPE = 58 - TK_EXCEPT = 134 + TK_EXCEPT = 135 TK_EXCLUDE = 91 TK_EXCLUSIVE = 9 TK_EXISTS = 20 TK_EXPLAIN = 2 TK_FAIL = 42 - TK_FILTER = 163 + TK_FILTER = 165 TK_FIRST = 83 - TK_FLOAT = 150 + TK_FLOAT = 152 TK_FOLLOWING = 86 TK_FOR = 62 - TK_FOREIGN = 130 - TK_FROM = 140 - TK_FUNCTION = 169 + TK_FOREIGN = 131 + TK_FROM = 141 + TK_FUNCTION = 171 TK_GE = 57 TK_GENERATED = 95 - TK_GROUP = 144 + TK_GROUP = 145 TK_GROUPS = 92 TK_GT = 54 - TK_HAVING = 145 + TK_HAVING = 146 TK_ID = 59 TK_IF = 18 - TK_IF_NULL_ROW = 176 + TK_IF_NULL_ROW = 178 TK_IGNORE = 63 - TK_ILLEGAL = 180 + TK_ILLEGAL = 182 TK_IMMEDIATE = 8 TK_IN = 49 - TK_INDEX = 158 - TK_INDEXED = 114 + TK_INDEX = 160 + TK_INDEXED = 115 TK_INITIALLY = 64 - TK_INSERT = 125 + TK_INSERT = 126 TK_INSTEAD = 65 - TK_INTEGER = 152 - TK_INTERSECT = 135 - TK_INTO = 148 + TK_INTEGER = 154 + TK_INTERSECT = 136 + TK_INTO = 150 TK_IS = 45 - TK_ISNOT = 168 + TK_ISNOT = 170 TK_ISNULL = 50 - TK_JOIN = 141 - TK_JOIN_KW = 116 + TK_JOIN = 142 + TK_JOIN_KW = 117 TK_KEY = 67 TK_LAST = 84 TK_LE = 55 TK_LIKE_KW = 47 - TK_LIMIT = 146 + TK_LIMIT = 147 TK_LP = 22 - TK_LSHIFT = 103 + TK_LSHIFT = 104 TK_LT = 56 TK_MATCH = 46 - TK_MINUS = 106 + TK_MATERIALIZED = 97 + TK_MINUS = 107 TK_NE = 52 TK_NO = 66 TK_NOT = 19 - TK_NOTHING = 149 + TK_NOTHING = 151 TK_NOTNULL = 51 - TK_NULL = 119 + TK_NULL = 120 TK_NULLS = 82 TK_OF = 68 TK_OFFSET = 69 - TK_ON = 113 + TK_ON = 114 TK_OR = 43 - TK_ORDER = 143 + TK_ORDER = 144 TK_OTHERS = 93 - TK_OVER = 162 + TK_OVER = 164 TK_PARTITION = 87 TK_PLAN = 4 - TK_PLUS = 105 + TK_PLUS = 106 TK_PRAGMA = 70 TK_PRECEDING = 88 - TK_PRIMARY = 120 + TK_PRIMARY = 121 TK_QUERY = 3 TK_RAISE = 71 TK_RANGE = 89 TK_RECURSIVE = 72 - TK_REFERENCES = 123 - TK_REGISTER = 173 - TK_REINDEX = 97 + TK_REFERENCES = 124 + TK_REGISTER = 175 + TK_REINDEX = 98 TK_RELEASE = 14 - TK_REM = 109 - TK_RENAME = 98 + TK_REM = 110 + TK_RENAME = 99 TK_REPLACE = 73 TK_RESTRICT = 74 + TK_RETURNING = 149 TK_ROLLBACK = 12 TK_ROW = 75 TK_ROWS = 76 TK_RP = 23 - TK_RSHIFT = 104 + TK_RSHIFT = 105 TK_SAVEPOINT = 13 - TK_SELECT = 136 - TK_SELECT_COLUMN = 175 + TK_SELECT = 137 + TK_SELECT_COLUMN = 177 TK_SEMI = 1 - TK_SET = 128 - TK_SLASH = 108 - TK_SPACE = 179 - TK_SPAN = 178 - TK_STAR = 107 - TK_STRING = 115 + TK_SET = 129 + TK_SLASH = 109 + TK_SPACE = 181 + TK_SPAN = 180 + TK_STAR = 108 + TK_STRING = 116 TK_TABLE = 16 TK_TEMP = 21 - TK_THEN = 156 + TK_THEN = 158 TK_TIES = 94 TK_TO = 15 TK_TRANSACTION = 6 TK_TRIGGER = 77 - TK_TRUEFALSE = 167 - TK_TRUTH = 172 - TK_UMINUS = 170 + TK_TRUEFALSE = 169 + TK_TRUTH = 174 + TK_UMINUS = 172 TK_UNBOUNDED = 90 - TK_UNION = 132 - TK_UNIQUE = 121 - TK_UPDATE = 127 - TK_UPLUS = 171 - TK_USING = 142 + TK_UNION = 133 + TK_UNIQUE = 122 + TK_UPDATE = 128 + TK_UPLUS = 173 + TK_USING = 143 TK_VACUUM = 78 - TK_VALUES = 137 - TK_VARIABLE = 153 - TK_VECTOR = 174 + TK_VALUES = 138 + TK_VARIABLE = 155 + TK_VECTOR = 176 TK_VIEW = 79 TK_VIRTUAL = 80 - TK_WHEN = 155 - TK_WHERE = 147 - TK_WINDOW = 161 + TK_WHEN = 157 + TK_WHERE = 148 + TK_WINDOW = 163 TK_WITH = 81 TK_WITHOUT = 25 TMP_MAX = 238328 @@ -2647,6 +2649,7 @@ const ( WHERE_INDEXED = 0x00000200 WHERE_IN_ABLE = 0x00000800 WHERE_IN_EARLYOUT = 0x00040000 + WHERE_IN_SEEKSCAN = 0x00100000 WHERE_IPK = 0x00000100 WHERE_MULTI_OR = 0x00002000 WHERE_ONEPASS_DESIRED = 0x0004 @@ -2658,8 +2661,6 @@ const ( WHERE_ORDERBY_NORMAL = 0x0000 WHERE_OR_SUBCLAUSE = 0x0020 WHERE_PARTIALIDX = 0x00020000 - WHERE_SEEK_TABLE = 0x0400 - WHERE_SEEK_UNIQ_TABLE = 0x1000 WHERE_SKIPSCAN = 0x00008000 WHERE_SORTBYGROUP = 0x0200 WHERE_TOP_LIMIT = 0x00000010 @@ -2703,29 +2704,29 @@ const ( XN_ROWID = -1 X_OK = 1 YYFALLBACK = 1 - YYNOCODE = 310 + YYNOCODE = 316 YYNOERRORRECOVERY = 1 - YYNRULE = 385 - YYNRULE_WITH_ACTION = 325 - YYNSTATE = 553 - YYNTOKEN = 181 + YYNRULE = 398 + YYNRULE_WITH_ACTION = 337 + YYNSTATE = 570 + YYNTOKEN = 183 YYPARSEFREENEVERNULL = 1 YYSTACKDEPTH = 100 - YYWILDCARD = 100 - YY_ACCEPT_ACTION = 1189 - YY_ACTTAB_COUNT = 1962 - YY_ERROR_ACTION = 1188 - YY_MAX_REDUCE = 1575 - YY_MAX_SHIFT = 552 - YY_MAX_SHIFTREDUCE = 1187 - YY_MIN_REDUCE = 1191 - YY_MIN_SHIFTREDUCE = 803 - YY_NO_ACTION = 1190 - YY_REDUCE_COUNT = 391 - YY_REDUCE_MAX = 1625 - YY_REDUCE_MIN = -262 - YY_SHIFT_COUNT = 552 - YY_SHIFT_MAX = 1951 + YYWILDCARD = 101 + YY_ACCEPT_ACTION = 1224 + YY_ACTTAB_COUNT = 2020 + YY_ERROR_ACTION = 1223 + YY_MAX_REDUCE = 1623 + YY_MAX_SHIFT = 569 + YY_MAX_SHIFTREDUCE = 1222 + YY_MIN_REDUCE = 1226 + YY_MIN_SHIFTREDUCE = 825 + YY_NO_ACTION = 1225 + YY_REDUCE_COUNT = 405 + YY_REDUCE_MAX = 1690 + YY_REDUCE_MIN = -265 + YY_SHIFT_COUNT = 569 + YY_SHIFT_MAX = 2009 YY_SHIFT_MIN = 0 X_ALLOCA_H = 1 X_ANSI_STDARG_H_ = 0 @@ -2739,6 +2740,8 @@ const ( X_BITS_ERRNO_H = 1 X_BITS_FLOATN_COMMON_H = 0 X_BITS_FLOATN_H = 0 + X_BITS_G_CONFIG_H = 1 + X_BITS_LIBIO_H = 1 X_BITS_LIBM_SIMD_DECL_STUBS_H = 1 X_BITS_POSIX_OPT_H = 1 X_BITS_PTHREADTYPES_ARCH_H = 1 @@ -2746,6 +2749,7 @@ const ( X_BITS_STAT_H = 1 X_BITS_STDINT_INTN_H = 1 X_BITS_STDIO_LIM_H = 1 + X_BITS_SYSMACROS_H = 1 X_BITS_TIMEX_H = 1 X_BITS_TIME_H = 1 X_BITS_TYPESIZES_H = 1 @@ -2774,6 +2778,11 @@ const ( X_GETOPT_CORE_H = 1 X_GETOPT_POSIX_H = 1 X_GNU_SOURCE = 0 + X_G_BUFSIZ = 8192 + X_G_HAVE_MMAP = 1 + X_G_HAVE_MREMAP = 1 + X_G_HAVE_ST_BLKSIZE = 1 + X_G_IO_IO_FILE_VERSION = 0x20001 X_IOC_DIRBITS = 2 X_IOC_DIRMASK = 3 X_IOC_DIRSHIFT = 30 @@ -2792,8 +2801,54 @@ const ( X_IOFBF = 0 X_IOLBF = 1 X_IONBF = 2 - X_IO_EOF_SEEN = 0x0010 - X_IO_ERR_SEEN = 0x0020 + X_IOS_APPEND = 8 + X_IOS_ATEND = 4 + X_IOS_BIN = 128 + X_IOS_INPUT = 1 + X_IOS_NOCREATE = 32 + X_IOS_NOREPLACE = 64 + X_IOS_OUTPUT = 2 + X_IOS_TRUNC = 16 + X_IO_BAD_SEEN = 0x4000 + X_IO_BOOLALPHA = 0200000 + X_IO_BUFSIZ = 8192 + X_IO_CURRENTLY_PUTTING = 0x800 + X_IO_DEC = 020 + X_IO_DELETE_DONT_CLOSE = 0x40 + X_IO_DONT_CLOSE = 0100000 + X_IO_EOF_SEEN = 0x10 + X_IO_ERR_SEEN = 0x20 + X_IO_FIXED = 010000 + X_IO_FLAGS2_MMAP = 1 + X_IO_FLAGS2_NOTCANCEL = 2 + X_IO_FLAGS2_USER_WBUF = 8 + X_IO_HAVE_ST_BLKSIZE = 1 + X_IO_HEX = 0100 + X_IO_INTERNAL = 010 + X_IO_IN_BACKUP = 0x100 + X_IO_IS_APPENDING = 0x1000 + X_IO_IS_FILEBUF = 0x2000 + X_IO_LEFT = 02 + X_IO_LINE_BUF = 0x200 + X_IO_LINKED = 0x80 + X_IO_MAGIC = 0xFBAD0000 + X_IO_MAGIC_MASK = 0xFFFF0000 + X_IO_NO_READS = 4 + X_IO_NO_WRITES = 8 + X_IO_OCT = 040 + X_IO_RIGHT = 04 + X_IO_SCIENTIFIC = 04000 + X_IO_SHOWBASE = 0200 + X_IO_SHOWPOINT = 0400 + X_IO_SHOWPOS = 02000 + X_IO_SKIPWS = 01 + X_IO_STDIO = 040000 + X_IO_TIED_PUT_GET = 0x400 + X_IO_UNBUFFERED = 2 + X_IO_UNIFIED_JUMPTABLES = 1 + X_IO_UNITBUF = 020000 + X_IO_UPPERCASE = 01000 + X_IO_USER_BUF = 1 X_IO_USER_LOCK = 0x8000 X_ISOC11_SOURCE = 1 X_ISOC95_SOURCE = 1 @@ -2811,6 +2866,7 @@ const ( X_MATH_H = 1 X_MKNOD_VER = 0 X_MKNOD_VER_LINUX = 0 + X_OLD_STDIO_MAGIC = 0xFABC0000 X_OS_COMMON_H_ = 0 X_POSIX2_CHAR_TERM = 200809 X_POSIX2_C_BIND = 200809 @@ -2901,6 +2957,7 @@ const ( X_STDDEF_H = 0 X_STDDEF_H_ = 0 X_STDIO_H = 1 + X_STDIO_USES_IOSTREAM = 0 X_STDLIB_H = 1 X_STRINGS_H = 1 X_STRING_H = 1 @@ -2911,6 +2968,7 @@ const ( X_SYS_SELECT_H = 1 X_SYS_SIZE_T_H = 0 X_SYS_STAT_H = 1 + X_SYS_SYSMACROS_H = 1 X_SYS_TIME_H = 1 X_SYS_TTYDEFAULTS_H_ = 0 X_SYS_TYPES_H = 1 @@ -2935,6 +2993,7 @@ const ( X_WCHAR_T_H = 0 X_XBS5_LP64_OFF64 = 1 X_XBS5_LPBIG_OFFBIG = -1 + X_XOPEN_CRYPT = 1 X_XOPEN_ENH_I18N = 1 X_XOPEN_LEGACY = 1 X_XOPEN_REALTIME = 1 @@ -3150,7 +3209,7 @@ const ( /* math.h:237:1: */ // ISO C99 defines some generic macros which work on any data type. // All floating-point numbers can be put in one of these categories. -const ( /* math.h:853:1: */ +const ( /* math.h:569:1: */ FP_NAN = 0 FP_INFINITE = 1 FP_ZERO = 2 @@ -3566,6 +3625,14 @@ const ( /* fcntl-linux.h:265:1: */ F_OWNER_GID = 2 ) +// This is the structure from the libstdc++ codecvt class. +const ( /* libio.h:180:1: */ + X__codecvt_ok = 0 + X__codecvt_partial = 1 + X__codecvt_error = 2 + X__codecvt_noconv = 3 +) + // In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. // are already defined. // BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. @@ -3639,7 +3706,7 @@ type X__float128 = float64 /* :47:21 */ // ***************************************************************************** // // This file is an amalgamation of many separate C source files from SQLite -// version 3.33.0. By combining all the individual C code files into this +// version 3.35.0. 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 @@ -3689,7 +3756,7 @@ type X__float128 = float64 /* :47:21 */ var sqlite3azCompileOpt = [22]uintptr{ // BEGIN CODE GENERATED BY tool/mkctime.tcl - ts, /* "COMPILER=gcc-8.3..." */ + ts, /* "COMPILER=gcc-7.5..." */ ts + 19, /* "DEFAULT_PAGE_SIZ..." */ ts + 42, /* "ENABLE_BYTECODE_..." */ ts + 63, /* "ENABLE_COLUMN_ME..." */ @@ -3714,7 +3781,7 @@ var sqlite3azCompileOpt = [22]uintptr{ // END CODE GENERATED BY tool/mkctime.tcl } /* sqlite3.c:72:19 */ -func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr { /* sqlite3.c:782:27: */ +func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr { /* sqlite3.c:785:27: */ *(*int32)(unsafe.Pointer(pnOpt)) = (int32(uint64(unsafe.Sizeof(sqlite3azCompileOpt)) / uint64(unsafe.Sizeof(uintptr(0))))) return uintptr(uintptr(unsafe.Pointer(&sqlite3azCompileOpt))) } @@ -3841,6 +3908,9 @@ func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr { /* sqlite3.c // so the GCC_VERSION macro will be set to a correct non-zero value even // when compiling with clang. +// Some C99 functions in "math.h" are only present for MSVC when its version +// is associated with Visual Studio 2013 or higher. + // Needed for various definitions... // Macro to disable warnings about missing "break" at the end of a "case". @@ -3897,7 +3967,7 @@ func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr { /* sqlite3.c // The makefile makes some minor changes to this file (such as inserting // the version number) and changes its name to "sqlite3.h" as // part of the build process. -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -4023,7 +4093,7 @@ type Va_list = X__gnuc_va_list /* stdarg.h:99:24 */ // of the hash might be different from [SQLITE_SOURCE_ID].)^ // // See also: [sqlite_version()] and [sqlite_source_id()]. -var Xsqlite3_version = *(*[7]int8)(unsafe.Pointer(ts + 356 /* "3.33.0" */)) /* sqlite3.c:1210:23 */ +var Xsqlite3_version = *(*[7]int8)(unsafe.Pointer(ts + 356 /* "3.35.0" */)) /* sqlite3.c:1225:23 */ // CAPI3REF: Database Connection Handle // KEYWORDS: {database connection} {database connections} @@ -4053,7 +4123,7 @@ type sqlite3 = struct { FerrCode int32 FerrMask int32 FiSysErrno int32 - FdbOptFlags U16 + FdbOptFlags U32 Fenc U8 FautoCommit U8 Ftemp_store U8 @@ -4067,13 +4137,14 @@ type sqlite3 = struct { FmTrace U8 FnoSharedCache U8 FnSqlExec U8 - _ [1]byte + _ [3]byte FnextPagesize int32 Fmagic U32 FnChange int32 FnTotalChange int32 FaLimit [12]int32 FnMaxSorterMmap int32 + _ [4]byte Finit struct { FnewTnum Pgno FiDb U8 @@ -4143,7 +4214,7 @@ type sqlite3 = struct { FpUnlockArg uintptr FxUnlockNotify uintptr FpNextBlocked uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: Database Connection Handle // KEYWORDS: {database connection} {database connections} @@ -4157,7 +4228,7 @@ type sqlite3 = struct { // [sqlite3_prepare_v2()], [sqlite3_create_function()], and // [sqlite3_busy_timeout()] to name but three) that are methods on an // sqlite3 object. -type Sqlite3 = sqlite3 /* sqlite3.c:1297:24 */ +type Sqlite3 = sqlite3 /* sqlite3.c:1312:24 */ // CAPI3REF: 64-Bit Integer Types // KEYWORDS: sqlite_int64 sqlite_uint64 @@ -4173,15 +4244,15 @@ type Sqlite3 = sqlite3 /* sqlite3.c:1297:24 */ // between -9223372036854775808 and +9223372036854775807 inclusive. ^The // sqlite3_uint64 and sqlite_uint64 types can store integer values // between 0 and +18446744073709551615 inclusive. -type Sqlite_int64 = int64 /* sqlite3.c:1326:25 */ -type Sqlite_uint64 = uint64 /* sqlite3.c:1327:34 */ -type Sqlite3_int64 = Sqlite_int64 /* sqlite3.c:1329:22 */ -type Sqlite3_uint64 = Sqlite_uint64 /* sqlite3.c:1330:23 */ +type Sqlite_int64 = int64 /* sqlite3.c:1341:25 */ +type Sqlite_uint64 = uint64 /* sqlite3.c:1342:34 */ +type Sqlite3_int64 = Sqlite_int64 /* sqlite3.c:1344:22 */ +type Sqlite3_uint64 = Sqlite_uint64 /* sqlite3.c:1345:23 */ // The type for a callback function. // This is legacy and deprecated. It is included for historical // compatibility and is not documented. -type Sqlite3_callback = uintptr /* sqlite3.c:1386:13 */ +type Sqlite3_callback = uintptr /* sqlite3.c:1401:13 */ // CAPI3REF: Result Codes // KEYWORDS: {result code definitions} @@ -4292,7 +4363,7 @@ type Sqlite3_callback = uintptr /* sqlite3.c:1386:13 */ // for their own use. The pMethods entry is a pointer to an // [sqlite3_io_methods] object that defines methods for performing // I/O operations on the open file. -type sqlite3_file = struct{ FpMethods uintptr } /* sqlite3.c:1297:9 */ +type sqlite3_file = struct{ FpMethods uintptr } /* sqlite3.c:1312:9 */ // CAPI3REF: Result Codes // KEYWORDS: {result code definitions} @@ -4403,7 +4474,7 @@ type sqlite3_file = struct{ FpMethods uintptr } /* sqlite3.c:1297:9 */ // for their own use. The pMethods entry is a pointer to an // [sqlite3_io_methods] object that defines methods for performing // I/O operations on the open file. -type Sqlite3_file = sqlite3_file /* sqlite3.c:1731:29 */ +type Sqlite3_file = sqlite3_file /* sqlite3.c:1747:29 */ type sqlite3_io_methods = struct { FiVersion int32 _ [4]byte @@ -4425,7 +4496,7 @@ type sqlite3_io_methods = struct { FxShmUnmap uintptr FxFetch uintptr FxUnfetch uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: OS Interface File Virtual Methods Object // @@ -4519,7 +4590,7 @@ type sqlite3_io_methods = struct { // fails to zero-fill short reads might seem to work. However, // failure to zero-fill short reads will eventually lead to // database corruption. -type Sqlite3_io_methods = sqlite3_io_methods /* sqlite3.c:1830:35 */ +type Sqlite3_io_methods = sqlite3_io_methods /* sqlite3.c:1846:35 */ // CAPI3REF: Loadable Extension Thunk // @@ -4780,7 +4851,8 @@ type sqlite3_api_routines = struct { Fcreate_filename uintptr Ffree_filename uintptr Fdatabase_file_object uintptr -} /* sqlite3.c:2244:9 */ + Ftxn_state uintptr +} /* sqlite3.c:2260:9 */ // CAPI3REF: Loadable Extension Thunk // @@ -4788,7 +4860,7 @@ type sqlite3_api_routines = struct { // the third parameter to entry points of [loadable extensions]. This // structure must be typedefed in order to work around compiler warnings // on some platforms. -type Sqlite3_api_routines = sqlite3_api_routines /* sqlite3.c:2244:37 */ +type Sqlite3_api_routines = sqlite3_api_routines /* sqlite3.c:2260:37 */ // CAPI3REF: OS Interface Object // @@ -4981,7 +5053,7 @@ type sqlite3_vfs = struct { FxSetSystemCall uintptr FxGetSystemCall uintptr FxNextSystemCall uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: OS Interface Object // @@ -5150,8 +5222,8 @@ type sqlite3_vfs = struct { // or all of these interfaces to be NULL or for their behavior to change // from one release to the next. Applications must not attempt to access // any of these methods if the iVersion of the VFS is less than 3. -type Sqlite3_vfs = sqlite3_vfs /* sqlite3.c:2415:28 */ -type Sqlite3_syscall_ptr = uintptr /* sqlite3.c:2416:14 */ +type Sqlite3_vfs = sqlite3_vfs /* sqlite3.c:2431:28 */ +type Sqlite3_syscall_ptr = uintptr /* sqlite3.c:2432:14 */ // CAPI3REF: Memory Allocation Routines // @@ -5223,7 +5295,7 @@ type sqlite3_mem_methods = struct { FxInit uintptr FxShutdown uintptr FpAppData uintptr -} /* sqlite3.c:2713:9 */ +} /* sqlite3.c:2729:9 */ // CAPI3REF: Memory Allocation Routines // @@ -5286,7 +5358,7 @@ type sqlite3_mem_methods = struct { // // SQLite will never invoke xInit() more than once without an intervening // call to xShutdown(). -type Sqlite3_mem_methods = sqlite3_mem_methods /* sqlite3.c:2713:36 */ +type Sqlite3_mem_methods = sqlite3_mem_methods /* sqlite3.c:2729:36 */ // CAPI3REF: Dynamically Typed Value Object // KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} @@ -5338,7 +5410,7 @@ type sqlite3_value = struct { FuTemp U32 Fdb uintptr FxDel uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: Dynamically Typed Value Object // KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} @@ -5378,7 +5450,7 @@ type sqlite3_value = struct { // [sqlite3_value_dup()]. // The [sqlite3_value_blob | sqlite3_value_type()] family of // interfaces require protected sqlite3_value objects. -type Sqlite3_value = sqlite3_value /* sqlite3.c:5292:30 */ +type Sqlite3_value = sqlite3_value /* sqlite3.c:5321:30 */ // CAPI3REF: SQL Function Context Object // @@ -5401,7 +5473,7 @@ type sqlite3_context = struct { Fargc U8 _ [6]byte Fargv [1]uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: SQL Function Context Object // @@ -5413,7 +5485,7 @@ type sqlite3_context = struct { // [sqlite3_aggregate_context()], [sqlite3_user_data()], // [sqlite3_context_db_handle()], [sqlite3_get_auxdata()], // and/or [sqlite3_set_auxdata()]. -type Sqlite3_context = sqlite3_context /* sqlite3.c:5306:32 */ +type Sqlite3_context = sqlite3_context /* sqlite3.c:5335:32 */ // CAPI3REF: Constants Defining Special Destructor Behavior // @@ -5427,7 +5499,7 @@ type Sqlite3_context = sqlite3_context /* sqlite3.c:5306:32 */ // // The typedef is necessary to work around problems in certain // C++ compilers. -type Sqlite3_destructor_type = uintptr /* sqlite3.c:6669:14 */ +type Sqlite3_destructor_type = uintptr /* sqlite3.c:6698:14 */ // The interface to the virtual-table mechanism is currently considered // to be experimental. The interface might change in incompatible ways. @@ -5442,7 +5514,7 @@ type sqlite3_vtab = struct { FnRef int32 _ [4]byte FzErrMsg uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // The interface to the virtual-table mechanism is currently considered // to be experimental. The interface might change in incompatible ways. @@ -5452,7 +5524,7 @@ type sqlite3_vtab = struct { // interface fixed, support it indefinitely, and remove this comment. // Structures used by the virtual table interface -type Sqlite3_vtab = sqlite3_vtab /* sqlite3.c:7737:29 */ +type Sqlite3_vtab = sqlite3_vtab /* sqlite3.c:7817:29 */ type sqlite3_index_info = struct { FnConstraint int32 _ [4]byte @@ -5471,12 +5543,12 @@ type sqlite3_index_info = struct { FidxFlags int32 _ [4]byte FcolUsed Sqlite3_uint64 -} /* sqlite3.c:7738:9 */ +} /* sqlite3.c:7818:9 */ -type Sqlite3_index_info = sqlite3_index_info /* sqlite3.c:7738:35 */ -type sqlite3_vtab_cursor = struct{ FpVtab uintptr } /* sqlite3.c:7739:9 */ +type Sqlite3_index_info = sqlite3_index_info /* sqlite3.c:7818:35 */ +type sqlite3_vtab_cursor = struct{ FpVtab uintptr } /* sqlite3.c:7819:9 */ -type Sqlite3_vtab_cursor = sqlite3_vtab_cursor /* sqlite3.c:7739:36 */ +type Sqlite3_vtab_cursor = sqlite3_vtab_cursor /* sqlite3.c:7819:36 */ type sqlite3_module = struct { FiVersion int32 _ [4]byte @@ -5503,9 +5575,9 @@ type sqlite3_module = struct { FxRelease uintptr FxRollbackTo uintptr FxShadowName uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Sqlite3_module = sqlite3_module /* sqlite3.c:7740:31 */ +type Sqlite3_module = sqlite3_module /* sqlite3.c:7820:31 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -5613,7 +5685,7 @@ type sqlite3_index_constraint = struct { Fusable uint8 _ [2]byte FiTermOffset int32 -} /* sqlite3.c:7738:9 */ +} /* sqlite3.c:7818:9 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -5719,7 +5791,7 @@ type sqlite3_index_orderby = struct { FiColumn int32 Fdesc uint8 _ [3]byte -} /* sqlite3.c:7738:9 */ +} /* sqlite3.c:7818:9 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -5825,7 +5897,7 @@ type sqlite3_index_constraint_usage = struct { FargvIndex int32 Fomit uint8 _ [3]byte -} /* sqlite3.c:7738:9 */ +} /* sqlite3.c:7818:9 */ // CAPI3REF: Mutex Methods Object // @@ -5900,7 +5972,7 @@ type sqlite3_mutex_methods = struct { FxMutexLeave uintptr FxMutexHeld uintptr FxMutexNotheld uintptr -} /* sqlite3.c:8572:9 */ +} /* sqlite3.c:8652:9 */ // CAPI3REF: Mutex Methods Object // @@ -5965,7 +6037,7 @@ type sqlite3_mutex_methods = struct { // called, but only if the prior call to xMutexInit returned SQLITE_OK. // If xMutexInit fails in any way, it is expected to clean up after itself // prior to returning. -type Sqlite3_mutex_methods = sqlite3_mutex_methods /* sqlite3.c:8572:38 */ +type Sqlite3_mutex_methods = sqlite3_mutex_methods /* sqlite3.c:8652:38 */ // CAPI3REF: Dynamic String Object // KEYWORDS: {dynamic string} @@ -5990,7 +6062,7 @@ type sqlite3_str = struct { FaccError U8 FprintfFlags U8 _ [2]byte -} /* sqlite3.c:8832:9 */ +} /* sqlite3.c:8914:9 */ // CAPI3REF: Dynamic String Object // KEYWORDS: {dynamic string} @@ -6006,7 +6078,7 @@ type sqlite3_str = struct { //
  • ^The sqlite3_str object is destroyed and the string it created // is returned using the [sqlite3_str_finish()] interface. // -type Sqlite3_str = sqlite3_str /* sqlite3.c:8832:28 */ +type Sqlite3_str = sqlite3_str /* sqlite3.c:8914:28 */ // CAPI3REF: Custom Page Cache Object // @@ -6019,7 +6091,7 @@ type Sqlite3_str = sqlite3_str /* sqlite3.c:8832:28 */ type sqlite3_pcache_page = struct { FpBuf uintptr FpExtra uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: Custom Page Cache Object // @@ -6029,7 +6101,7 @@ type sqlite3_pcache_page = struct { // of this object as parameters or as their return value. // // See [sqlite3_pcache_methods2] for additional information. -type Sqlite3_pcache_page = sqlite3_pcache_page /* sqlite3.c:9325:36 */ +type Sqlite3_pcache_page = sqlite3_pcache_page /* sqlite3.c:9407:36 */ // CAPI3REF: Application Defined Page Cache. // KEYWORDS: {page cache} @@ -6203,7 +6275,7 @@ type sqlite3_pcache_methods2 = struct { FxTruncate uintptr FxDestroy uintptr FxShrink uintptr -} /* sqlite3.c:9490:9 */ +} /* sqlite3.c:9572:9 */ // CAPI3REF: Application Defined Page Cache. // KEYWORDS: {page cache} @@ -6362,7 +6434,7 @@ type sqlite3_pcache_methods2 = struct { // free up as much of heap memory as possible. The page cache implementation // is not obligated to free any memory, but well-behaved implementations should // do their best. -type Sqlite3_pcache_methods2 = sqlite3_pcache_methods2 /* sqlite3.c:9490:40 */ +type Sqlite3_pcache_methods2 = sqlite3_pcache_methods2 /* sqlite3.c:9572:40 */ // This is the obsolete pcache_methods object that has now been replaced // by sqlite3_pcache_methods2. This object is not used by SQLite. It is @@ -6379,12 +6451,12 @@ type sqlite3_pcache_methods = struct { FxRekey uintptr FxTruncate uintptr FxDestroy uintptr -} /* sqlite3.c:9513:9 */ +} /* sqlite3.c:9595:9 */ // This is the obsolete pcache_methods object that has now been replaced // by sqlite3_pcache_methods2. This object is not used by SQLite. It is // retained in the header file for backwards compatibility only. -type Sqlite3_pcache_methods = sqlite3_pcache_methods /* sqlite3.c:9513:39 */ +type Sqlite3_pcache_methods = sqlite3_pcache_methods /* sqlite3.c:9595:39 */ // CAPI3REF: Online Backup Object // @@ -6408,7 +6480,7 @@ type sqlite3_backup = struct { FnPagecount Pgno FisAttached int32 FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // CAPI3REF: Online Backup Object // @@ -6418,7 +6490,7 @@ type sqlite3_backup = struct { // [sqlite3_backup_finish()]. // // See Also: [Using the SQLite Online Backup API] -type Sqlite3_backup = sqlite3_backup /* sqlite3.c:9539:31 */ +type Sqlite3_backup = sqlite3_backup /* sqlite3.c:9621:31 */ // CAPI3REF: Database Snapshot // KEYWORDS: {snapshot} {sqlite3_snapshot} @@ -6438,7 +6510,7 @@ type Sqlite3_backup = sqlite3_backup /* sqlite3.c:9539:31 */ // version of the database file so that it is possible to later open a new read // transaction that sees that historical version of the database rather than // the most recent version. -type sqlite3_snapshot = struct{ Fhidden [48]uint8 } /* sqlite3.c:10560:9 */ +type sqlite3_snapshot = struct{ Fhidden [48]uint8 } /* sqlite3.c:10652:9 */ // CAPI3REF: Database Snapshot // KEYWORDS: {snapshot} {sqlite3_snapshot} @@ -6458,7 +6530,7 @@ type sqlite3_snapshot = struct{ Fhidden [48]uint8 } /* sqlite3.c:10560:9 */ // version of the database file so that it is possible to later open a new read // transaction that sees that historical version of the database rather than // the most recent version. -type Sqlite3_snapshot = sqlite3_snapshot /* sqlite3.c:10562:3 */ +type Sqlite3_snapshot = sqlite3_snapshot /* sqlite3.c:10654:3 */ // CAPI3REF: Flags for sqlite3_deserialize() // @@ -6502,7 +6574,7 @@ type sqlite3_rtree_geometry = struct { FaParam uintptr FpUser uintptr FxDelUser uintptr -} /* sqlite3.c:10887:9 */ +} /* sqlite3.c:10979:9 */ // CAPI3REF: Flags for sqlite3_deserialize() // @@ -6539,7 +6611,7 @@ type sqlite3_rtree_geometry = struct { // // -type Sqlite3_rtree_geometry = sqlite3_rtree_geometry /* sqlite3.c:10887:39 */ +type Sqlite3_rtree_geometry = sqlite3_rtree_geometry /* sqlite3.c:10979:39 */ type sqlite3_rtree_query_info = struct { FpContext uintptr FnParam int32 @@ -6559,13 +6631,13 @@ type sqlite3_rtree_query_info = struct { FeWithin int32 FrScore Sqlite3_rtree_dbl FapSqlParam uintptr -} /* sqlite3.c:10888:9 */ +} /* sqlite3.c:10980:9 */ -type Sqlite3_rtree_query_info = sqlite3_rtree_query_info /* sqlite3.c:10888:41 */ +type Sqlite3_rtree_query_info = sqlite3_rtree_query_info /* sqlite3.c:10980:41 */ // The double-precision datatype used by RTree depends on the // SQLITE_RTREE_INT_ONLY compile-time option. -type Sqlite3_rtree_dbl = float64 /* sqlite3.c:10896:18 */ +type Sqlite3_rtree_dbl = float64 /* sqlite3.c:10988:18 */ // Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. @@ -6620,7 +6692,7 @@ type Fts5ExtensionApi1 = struct { FxPhraseNext uintptr FxPhraseFirstColumn uintptr FxPhraseNextColumn uintptr -} /* sqlite3.c:12682:9 */ +} /* sqlite3.c:12787:9 */ // Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. @@ -6653,22 +6725,22 @@ type Fts5ExtensionApi1 = struct { // Virtual table implementations may overload SQL functions by implementing // the sqlite3_module.xFindFunction() method. -type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.c:12682:33 */ +type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.c:12787:33 */ type Fts5PhraseIter1 = struct { Fa uintptr Fb uintptr -} /* sqlite3.c:12684:9 */ +} /* sqlite3.c:12789:9 */ -type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.c:12684:31 */ +type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.c:12789:31 */ -type Fts5_extension_function = uintptr /* sqlite3.c:12686:14 */ +type Fts5_extension_function = uintptr /* sqlite3.c:12791:14 */ type fts5_tokenizer = struct { FxCreate uintptr FxDelete uintptr FxTokenize uintptr -} /* sqlite3.c:13145:9 */ +} /* sqlite3.c:13250:9 */ -type Fts5_tokenizer = fts5_tokenizer /* sqlite3.c:13145:31 */ +type Fts5_tokenizer = fts5_tokenizer /* sqlite3.c:13250:31 */ // Flags that may be passed as the third argument to xTokenize() @@ -6688,7 +6760,7 @@ type fts5_api = struct { FxCreateTokenizer uintptr FxFindTokenizer uintptr FxCreateFunction uintptr -} /* sqlite3.c:13181:9 */ +} /* sqlite3.c:13286:9 */ // Flags that may be passed as the third argument to xTokenize() @@ -6702,7 +6774,7 @@ type fts5_api = struct { // ************************************************************************ // // FTS5 EXTENSION REGISTRATION API -type Fts5_api = fts5_api /* sqlite3.c:13181:25 */ +type Fts5_api = fts5_api /* sqlite3.c:13286:25 */ // Is the sqlite3ErrName() function needed in the build? Currently, // it is needed by "mutex_w32.c" (when debugging), "os_win.c" (when @@ -6742,7 +6814,7 @@ type Hash1 = struct { Fcount uint32 Ffirst uintptr Fht uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Is the sqlite3ErrName() function needed in the build? Currently, // it is needed by "mutex_w32.c" (when debugging), "os_win.c" (when @@ -6777,15 +6849,15 @@ type Hash1 = struct { // used in SQLite. // Forward declarations of structures. -type Hash = Hash1 /* sqlite3.c:13860:21 */ +type Hash = Hash1 /* sqlite3.c:13962:21 */ type HashElem1 = struct { Fnext uintptr Fprev uintptr Fdata uintptr FpKey uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type HashElem = HashElem1 /* sqlite3.c:13861:25 */ +type HashElem = HashElem1 /* sqlite3.c:13963:25 */ // A complete hash table is an instance of the following structure. // The internals of this structure are intended to be opaque -- client @@ -6811,7 +6883,7 @@ type _ht = struct { Fcount uint32 _ [4]byte Fchain uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Wide character type. // Locale-writers should change this as necessary to @@ -6828,31 +6900,6 @@ type _ht = struct { // A null pointer constant. -// Copyright (C) 1989-2018 Free Software Foundation, Inc. -// -// This file is part of GCC. -// -// GCC is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// GCC is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// Under Section 7 of GPL version 3, you are granted additional -// permissions described in the GCC Runtime Library Exception, version -// 3.1, as published by the Free Software Foundation. -// -// You should have received a copy of the GNU General Public License and -// a copy of the GCC Runtime Library Exception along with this program; -// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -// . - -// ISO C Standard: 7.15 Variable arguments - // bits/types.h -- definitions of __*_t types underlying *_t types. // Copyright (C) 2002-2018 Free Software Foundation, Inc. // This file is part of the GNU C Library. @@ -6910,23 +6957,13 @@ type X__uint32_t = uint32 /* types.h:41:22 */ type X__int64_t = int64 /* types.h:43:25 */ type X__uint64_t = uint64 /* types.h:44:27 */ -// Smallest types with at least a given width. -type X__int_least8_t = X__int8_t /* types.h:51:18 */ -type X__uint_least8_t = X__uint8_t /* types.h:52:19 */ -type X__int_least16_t = X__int16_t /* types.h:53:19 */ -type X__uint_least16_t = X__uint16_t /* types.h:54:20 */ -type X__int_least32_t = X__int32_t /* types.h:55:19 */ -type X__uint_least32_t = X__uint32_t /* types.h:56:20 */ -type X__int_least64_t = X__int64_t /* types.h:57:19 */ -type X__uint_least64_t = X__uint64_t /* types.h:58:20 */ - // quad_t is also 64 bits. -type X__quad_t = int64 /* types.h:62:18 */ -type X__u_quad_t = uint64 /* types.h:63:27 */ +type X__quad_t = int64 /* types.h:52:18 */ +type X__u_quad_t = uint64 /* types.h:53:27 */ // Largest integral types. -type X__intmax_t = int64 /* types.h:71:18 */ -type X__uintmax_t = uint64 /* types.h:72:27 */ +type X__intmax_t = int64 /* types.h:61:18 */ +type X__uintmax_t = uint64 /* types.h:62:27 */ // The machine-dependent file defines __*_T_TYPE // macros for each of the OS types we define below. The definitions @@ -6991,173 +7028,76 @@ type X__uintmax_t = uint64 /* types.h:72:27 */ // Number of descriptors that can fit in an `fd_set'. -type X__dev_t = uint64 /* types.h:143:25 */ // Type of device numbers. -type X__uid_t = uint32 /* types.h:144:25 */ // Type of user identifications. -type X__gid_t = uint32 /* types.h:145:25 */ // Type of group identifications. -type X__ino_t = uint64 /* types.h:146:25 */ // Type of file serial numbers. -type X__ino64_t = uint64 /* types.h:147:27 */ // Type of file serial numbers (LFS). -type X__mode_t = uint32 /* types.h:148:26 */ // Type of file attribute bitmasks. -type X__nlink_t = uint64 /* types.h:149:27 */ // Type of file link counts. -type X__off_t = int64 /* types.h:150:25 */ // Type of file sizes and offsets. -type X__off64_t = int64 /* types.h:151:27 */ // Type of file sizes and offsets (LFS). -type X__pid_t = int32 /* types.h:152:25 */ // Type of process identifications. -type X__fsid_t = struct{ F__val [2]int32 } /* types.h:153:26 */ // Type of file system IDs. -type X__clock_t = int64 /* types.h:154:27 */ // Type of CPU usage counts. -type X__rlim_t = uint64 /* types.h:155:26 */ // Type for resource measurement. -type X__rlim64_t = uint64 /* types.h:156:28 */ // Type for resource measurement (LFS). -type X__id_t = uint32 /* types.h:157:24 */ // General type for IDs. -type X__time_t = int64 /* types.h:158:26 */ // Seconds since the Epoch. -type X__useconds_t = uint32 /* types.h:159:30 */ // Count of microseconds. -type X__suseconds_t = int64 /* types.h:160:31 */ // Signed count of microseconds. +type X__dev_t = uint64 /* types.h:133:25 */ // Type of device numbers. +type X__uid_t = uint32 /* types.h:134:25 */ // Type of user identifications. +type X__gid_t = uint32 /* types.h:135:25 */ // Type of group identifications. +type X__ino_t = uint64 /* types.h:136:25 */ // Type of file serial numbers. +type X__ino64_t = uint64 /* types.h:137:27 */ // Type of file serial numbers (LFS). +type X__mode_t = uint32 /* types.h:138:26 */ // Type of file attribute bitmasks. +type X__nlink_t = uint64 /* types.h:139:27 */ // Type of file link counts. +type X__off_t = int64 /* types.h:140:25 */ // Type of file sizes and offsets. +type X__off64_t = int64 /* types.h:141:27 */ // Type of file sizes and offsets (LFS). +type X__pid_t = int32 /* types.h:142:25 */ // Type of process identifications. +type X__fsid_t = struct{ F__val [2]int32 } /* types.h:143:26 */ // Type of file system IDs. +type X__clock_t = int64 /* types.h:144:27 */ // Type of CPU usage counts. +type X__rlim_t = uint64 /* types.h:145:26 */ // Type for resource measurement. +type X__rlim64_t = uint64 /* types.h:146:28 */ // Type for resource measurement (LFS). +type X__id_t = uint32 /* types.h:147:24 */ // General type for IDs. +type X__time_t = int64 /* types.h:148:26 */ // Seconds since the Epoch. +type X__useconds_t = uint32 /* types.h:149:30 */ // Count of microseconds. +type X__suseconds_t = int64 /* types.h:150:31 */ // Signed count of microseconds. -type X__daddr_t = int32 /* types.h:162:27 */ // The type of a disk address. -type X__key_t = int32 /* types.h:163:25 */ // Type of an IPC key. +type X__daddr_t = int32 /* types.h:152:27 */ // The type of a disk address. +type X__key_t = int32 /* types.h:153:25 */ // Type of an IPC key. // Clock ID used in clock and timer functions. -type X__clockid_t = int32 /* types.h:166:29 */ +type X__clockid_t = int32 /* types.h:156:29 */ // Timer ID returned by `timer_create'. -type X__timer_t = uintptr /* types.h:169:12 */ +type X__timer_t = uintptr /* types.h:159:12 */ // Type to represent block size. -type X__blksize_t = int64 /* types.h:172:29 */ +type X__blksize_t = int64 /* types.h:162:29 */ // Types from the Large File Support interface. // Type to count number of disk blocks. -type X__blkcnt_t = int64 /* types.h:177:28 */ -type X__blkcnt64_t = int64 /* types.h:178:30 */ +type X__blkcnt_t = int64 /* types.h:167:28 */ +type X__blkcnt64_t = int64 /* types.h:168:30 */ // Type to count file system blocks. -type X__fsblkcnt_t = uint64 /* types.h:181:30 */ -type X__fsblkcnt64_t = uint64 /* types.h:182:32 */ +type X__fsblkcnt_t = uint64 /* types.h:171:30 */ +type X__fsblkcnt64_t = uint64 /* types.h:172:32 */ // Type to count file system nodes. -type X__fsfilcnt_t = uint64 /* types.h:185:30 */ -type X__fsfilcnt64_t = uint64 /* types.h:186:32 */ +type X__fsfilcnt_t = uint64 /* types.h:175:30 */ +type X__fsfilcnt64_t = uint64 /* types.h:176:32 */ // Type of miscellaneous file system fields. -type X__fsword_t = int64 /* types.h:189:28 */ +type X__fsword_t = int64 /* types.h:179:28 */ -type X__ssize_t = int64 /* types.h:191:27 */ // Type of a byte count, or error. +type X__ssize_t = int64 /* types.h:181:27 */ // Type of a byte count, or error. // Signed long type used in system calls. -type X__syscall_slong_t = int64 /* types.h:194:33 */ +type X__syscall_slong_t = int64 /* types.h:184:33 */ // Unsigned long type used in system calls. -type X__syscall_ulong_t = uint64 /* types.h:196:33 */ +type X__syscall_ulong_t = uint64 /* types.h:186:33 */ // These few don't really vary by system, they always correspond // to one of the other defined types. -type X__loff_t = X__off64_t /* types.h:200:19 */ // Type of file sizes and offsets (LFS). -type X__caddr_t = uintptr /* types.h:201:14 */ +type X__loff_t = X__off64_t /* types.h:190:19 */ // Type of file sizes and offsets (LFS). +type X__caddr_t = uintptr /* types.h:191:14 */ // Duplicates info from stdint.h but this is used in unistd.h. -type X__intptr_t = int64 /* types.h:204:25 */ +type X__intptr_t = int64 /* types.h:194:25 */ // Duplicate info from sys/socket.h. -type X__socklen_t = uint32 /* types.h:207:23 */ +type X__socklen_t = uint32 /* types.h:197:23 */ // C99: An integer type that can be accessed as an atomic entity, // even in the presence of asynchronous interrupts. // It is not currently necessary for this to be machine-specific. -type X__sig_atomic_t = int32 /* types.h:212:13 */ - -// bits/types.h -- definitions of __*_t types underlying *_t types. -// Copyright (C) 2002-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// Never include this file directly; use instead. - -// Integral type unchanged by default argument promotions that can -// hold any value corresponding to members of the extended character -// set, as well as at least one value that does not correspond to any -// member of the extended character set. - -// Conversion state information. -type X__mbstate_t = struct { - F__count int32 - F__value struct{ F__wch uint32 } -} /* __mbstate_t.h:21:3 */ - -// The tag name of this struct is _G_fpos_t to preserve historic -// C++ mangled names for functions taking fpos_t arguments. -// That name should not be used in new code. -type _G_fpos_t = struct { - F__pos X__off_t - F__state X__mbstate_t -} /* __fpos_t.h:10:9 */ - -// The tag name of this struct is _G_fpos_t to preserve historic -// C++ mangled names for functions taking fpos_t arguments. -// That name should not be used in new code. -type X__fpos_t = _G_fpos_t /* __fpos_t.h:14:3 */ - -// bits/types.h -- definitions of __*_t types underlying *_t types. -// Copyright (C) 2002-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// Never include this file directly; use instead. - -// The tag name of this struct is _G_fpos64_t to preserve historic -// C++ mangled names for functions taking fpos_t and/or fpos64_t -// arguments. That name should not be used in new code. -type _G_fpos64_t = struct { - F__pos X__off64_t - F__state X__mbstate_t -} /* __fpos64_t.h:10:9 */ - -// bits/types.h -- definitions of __*_t types underlying *_t types. -// Copyright (C) 2002-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// Never include this file directly; use instead. - -// The tag name of this struct is _G_fpos64_t to preserve historic -// C++ mangled names for functions taking fpos_t and/or fpos64_t -// arguments. That name should not be used in new code. -type X__fpos64_t = _G_fpos64_t /* __fpos64_t.h:14:3 */ +type X__sig_atomic_t = int32 /* types.h:202:13 */ type _IO_FILE = struct { F_flags int32 @@ -7184,10 +7124,10 @@ type _IO_FILE = struct { _ [4]byte F_lock uintptr F_offset X__off64_t - F_codecvt uintptr - F_wide_data uintptr - F_freeres_list uintptr - F_freeres_buf uintptr + F__pad1 uintptr + F__pad2 uintptr + F__pad3 uintptr + F__pad4 uintptr F__pad5 Size_t F_mode int32 F_unused2 [20]int8 @@ -7198,33 +7138,188 @@ type X__FILE = _IO_FILE /* __FILE.h:5:25 */ // The opaque type of streams. This is the definition used elsewhere. type FILE = _IO_FILE /* FILE.h:7:25 */ +// Copyright (C) 1991-2018 Free Software Foundation, Inc. +// This file is part of the GNU C Library. +// Written by Per Bothner . +// +// The GNU C Library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// The GNU C Library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with the GNU C Library; if not, see +// . +// +// As a special exception, if you link the code in this file with +// files compiled with a GNU compiler to produce an executable, +// that does not cause the resulting executable to be covered by +// the GNU Lesser General Public License. This exception does not +// however invalidate any other reasons why the executable file +// might be covered by the GNU Lesser General Public License. +// This exception applies to code released by its copyright holders +// in files containing the exception. + +// This file is needed by libio to define various configuration parameters. +// These are always the same in the GNU C library. + +// Define types for libio in terms of the standard internal type names. + +// bits/types.h -- definitions of __*_t types underlying *_t types. +// Copyright (C) 2002-2018 Free Software Foundation, Inc. +// This file is part of the GNU C Library. +// +// The GNU C Library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// The GNU C Library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with the GNU C Library; if not, see +// . + +// Never include this file directly; use instead. + +// Copyright (C) 1989-2017 Free Software Foundation, Inc. +// +// This file is part of GCC. +// +// GCC is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// GCC is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. +// +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +// ISO C Standard: 7.17 Common definitions + +// Any one of these symbols __need_* means that GNU libc +// wants us just to define one data type. So don't define +// the symbols that indicate this file's entire job has been done. + +// This avoids lossage on SunOS but only if stdtypes.h comes first. +// There's no way to win with the other order! Sun lossage. + +// On 4.3bsd-net2, make sure ansi.h is included, so we have +// one less case to deal with in the following. +// On FreeBSD 5, machine/ansi.h does not exist anymore... + +// In 4.3bsd-net2, machine/ansi.h defines these symbols, which are +// defined if the corresponding type is *not* defined. +// FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_. +// NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_ + +// Sequent's header files use _PTRDIFF_T_ in some conflicting way. +// Just ignore it. + +// On VxWorks, may have defined macros like +// _TYPE_size_t which will typedef size_t. fixincludes patched the +// vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is +// not defined, and so that defining this macro defines _GCC_SIZE_T. +// If we find that the macros are still defined at this point, we must +// invoke them so that the type is defined as expected. + +// In case nobody has defined these types, but we aren't running under +// GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and +// __WCHAR_TYPE__ have reasonable values. This can happen if the +// parts of GCC is compiled by an older compiler, that actually +// include gstddef.h, such as collect2. + +// Signed type of difference of two pointers. + +// Define this type if we are doing the whole job, +// or if we want this type in particular. + +// Unsigned type of `sizeof' something. + +// Define this type if we are doing the whole job, +// or if we want this type in particular. + +// Wide character type. +// Locale-writers should change this as necessary to +// be big enough to hold unique values not between 0 and 127, +// and not (wchar_t) -1, for each defined multibyte character. + +// Define this type if we are doing the whole job, +// or if we want this type in particular. + +// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. +// are already defined. +// BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. +// NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here. + +// A null pointer constant. + +// Integral type unchanged by default argument promotions that can +// hold any value corresponding to members of the extended character +// set, as well as at least one value that does not correspond to any +// member of the extended character set. + +// Conversion state information. +type X__mbstate_t = struct { + F__count int32 + F__value struct{ F__wch uint32 } +} /* __mbstate_t.h:21:3 */ + +type X_G_fpos_t = struct { + F__pos X__off_t + F__state X__mbstate_t +} /* _G_config.h:30:3 */ +type X_G_fpos64_t = struct { + F__pos X__off64_t + F__state X__mbstate_t +} /* _G_config.h:35:3 */ + +// A streammarker remembers a position in a buffer. + +type _IO_marker = struct { + F_next uintptr + F_sbuf uintptr + F_pos int32 + _ [4]byte +} /* __FILE.h:4:1 */ + +type X_IO_FILE = _IO_FILE /* libio.h:314:25 */ + // The structure with the cookie function pointers. -// The tag name of this struct is _IO_cookie_io_functions_t to -// preserve historic C++ mangled names for functions taking -// cookie_io_functions_t arguments. That name should not be used in -// new code. -type _IO_cookie_io_functions_t = struct { +type X_IO_cookie_io_functions_t = struct { Fread uintptr Fwrite uintptr Fseek uintptr Fclose uintptr -} /* cookie_io_functions_t.h:55:9 */ +} /* libio.h:374:3 */ +type Cookie_io_functions_t = X_IO_cookie_io_functions_t /* libio.h:375:35 */ -// The structure with the cookie function pointers. -// The tag name of this struct is _IO_cookie_io_functions_t to -// preserve historic C++ mangled names for functions taking -// cookie_io_functions_t arguments. That name should not be used in -// new code. -type Cookie_io_functions_t = _IO_cookie_io_functions_t /* cookie_io_functions_t.h:61:3 */ +type Off_t = X__off64_t /* stdio.h:59:19 */ +type Off64_t = X__off64_t /* stdio.h:64:19 */ -type Off_t = X__off64_t /* stdio.h:65:19 */ -type Off64_t = X__off64_t /* stdio.h:70:19 */ - -type Ssize_t = X__ssize_t /* stdio.h:77:19 */ +type Ssize_t = X__ssize_t /* stdio.h:71:19 */ // The type of the second argument to `fgetpos' and `fsetpos'. -type Fpos_t = X__fpos64_t /* stdio.h:86:20 */ -type Fpos64_t = X__fpos64_t /* stdio.h:89:20 */ +type Fpos_t = X_G_fpos64_t /* stdio.h:80:21 */ +type Fpos64_t = X_G_fpos64_t /* stdio.h:83:21 */ // In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. // are already defined. @@ -7458,11 +7553,6 @@ type Idtype_t = uint32 /* waitflags.h:57:3 */ // configurations support _Float128x or, as of GCC 7, have compiler // support for a type meeting the requirements for _Float128x. -// Defined to 1 if the corresponding _FloatN type is not binary compatible -// with the corresponding ISO C type in the current compilation unit as -// opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built -// in glibc. - // Defined to 1 if any _FloatN or _FloatNx types that are not // ABI-distinct are however distinct types at the C language level (so // for the purposes of __builtin_types_compatible_p and _Generic). @@ -7620,29 +7710,30 @@ type U_long = X__u_long /* types.h:36:18 */ type Quad_t = X__quad_t /* types.h:37:18 */ type U_quad_t = X__u_quad_t /* types.h:38:20 */ type Fsid_t = X__fsid_t /* types.h:39:18 */ -type Loff_t = X__loff_t /* types.h:42:18 */ -type Ino_t = X__ino64_t /* types.h:49:19 */ -type Ino64_t = X__ino64_t /* types.h:54:19 */ +type Loff_t = X__loff_t /* types.h:44:18 */ -type Dev_t = X__dev_t /* types.h:59:17 */ +type Ino_t = X__ino64_t /* types.h:50:19 */ +type Ino64_t = X__ino64_t /* types.h:55:19 */ -type Gid_t = X__gid_t /* types.h:64:17 */ +type Dev_t = X__dev_t /* types.h:60:17 */ -type Mode_t = X__mode_t /* types.h:69:18 */ +type Gid_t = X__gid_t /* types.h:65:17 */ -type Nlink_t = X__nlink_t /* types.h:74:19 */ +type Mode_t = X__mode_t /* types.h:70:18 */ -type Uid_t = X__uid_t /* types.h:79:17 */ +type Nlink_t = X__nlink_t /* types.h:75:19 */ -type Pid_t = X__pid_t /* types.h:97:17 */ +type Uid_t = X__uid_t /* types.h:80:17 */ -type Id_t = X__id_t /* types.h:103:16 */ +type Pid_t = X__pid_t /* types.h:98:17 */ -type Daddr_t = X__daddr_t /* types.h:114:19 */ -type Caddr_t = X__caddr_t /* types.h:115:19 */ +type Id_t = X__id_t /* types.h:104:16 */ -type Key_t = X__key_t /* types.h:121:17 */ +type Daddr_t = X__daddr_t /* types.h:115:19 */ +type Caddr_t = X__caddr_t /* types.h:116:19 */ + +type Key_t = X__key_t /* types.h:122:17 */ // bits/types.h -- definitions of __*_t types underlying *_t types. // Copyright (C) 2002-2018 Free Software Foundation, Inc. @@ -7736,10 +7827,10 @@ type Time_t = X__time_t /* time_t.h:7:18 */ // Timer ID returned by `timer_create'. type Timer_t = X__timer_t /* timer_t.h:7:19 */ -type Useconds_t = X__useconds_t /* types.h:134:22 */ -type Suseconds_t = X__suseconds_t /* types.h:138:23 */ +type Useconds_t = X__useconds_t /* types.h:135:22 */ +type Suseconds_t = X__suseconds_t /* types.h:139:23 */ -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -7822,9 +7913,9 @@ type Suseconds_t = X__suseconds_t /* types.h:138:23 */ // A null pointer constant. // Old compatibility names for C types. -type Ulong = uint64 /* types.h:148:27 */ -type Ushort = uint16 /* types.h:149:28 */ -type Uint = uint32 /* types.h:150:22 */ +type Ulong = uint64 /* types.h:149:27 */ +type Ushort = uint16 /* types.h:150:28 */ +type Uint = uint32 /* types.h:151:22 */ // These size-specific names are used by some of the inet code. @@ -7873,12 +7964,12 @@ type Int64_t = X__int64_t /* stdint-intn.h:27:19 */ // For GCC 2.7 and later, we can use specific type-size attributes. -type U_int8_t = uint32 /* types.h:177:1 */ -type U_int16_t = uint32 /* types.h:178:1 */ -type U_int32_t = uint32 /* types.h:179:1 */ -type U_int64_t = uint32 /* types.h:180:1 */ +type U_int8_t = uint32 /* types.h:178:1 */ +type U_int16_t = uint32 /* types.h:179:1 */ +type U_int32_t = uint32 /* types.h:180:1 */ +type U_int64_t = uint32 /* types.h:181:1 */ -type Register_t = int32 /* types.h:182:13 */ +type Register_t = int32 /* types.h:183:13 */ // It also defines `fd_set' and the FD_* macros for `select'. // `fd_set' type and related macros, and `select'/`pselect' declarations. @@ -8040,18 +8131,16 @@ type Fd_set = struct{ Ffds_bits [16]X__fd_mask } /* select.h:70:5 */ // Sometimes the fd_set member is assumed to have this type. type Fd_mask = X__fd_mask /* select.h:77:19 */ -// Define some inlines helping to catch common problems. - -type Blksize_t = X__blksize_t /* types.h:202:21 */ +type Blksize_t = X__blksize_t /* types.h:212:21 */ // Types from the Large File Support interface. -type Blkcnt_t = X__blkcnt64_t /* types.h:222:22 */ // Type to count number of disk blocks. -type Fsblkcnt_t = X__fsblkcnt64_t /* types.h:226:24 */ // Type to count file system blocks. -type Fsfilcnt_t = X__fsfilcnt64_t /* types.h:230:24 */ // Type to count file system inodes. +type Blkcnt_t = X__blkcnt64_t /* types.h:232:22 */ // Type to count number of disk blocks. +type Fsblkcnt_t = X__fsblkcnt64_t /* types.h:236:24 */ // Type to count file system blocks. +type Fsfilcnt_t = X__fsfilcnt64_t /* types.h:240:24 */ // Type to count file system inodes. -type Blkcnt64_t = X__blkcnt64_t /* types.h:236:22 */ // Type to count number of disk blocks. -type Fsblkcnt64_t = X__fsblkcnt64_t /* types.h:237:24 */ // Type to count file system blocks. -type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:238:24 */ // Type to count file system inodes. +type Blkcnt64_t = X__blkcnt64_t /* types.h:246:22 */ // Type to count number of disk blocks. +type Fsblkcnt64_t = X__fsblkcnt64_t /* types.h:247:24 */ // Type to count file system blocks. +type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:248:24 */ // Type to count file system inodes. // Now add the thread types. // Declaration of common pthread types for all architectures. @@ -8401,13 +8490,13 @@ type Max_align_t = struct { // types can be conveniently redefined at compile-type. Like this: // // cc '-DUINTPTR_TYPE=long long int' ... -type I64 = Sqlite_int64 /* sqlite3.c:14329:22 */ // 8-byte signed integer -type U64 = Sqlite_uint64 /* sqlite3.c:14330:23 */ // 8-byte unsigned integer -type U32 = uint32 /* sqlite3.c:14331:21 */ // 4-byte unsigned integer -type U16 = uint16 /* sqlite3.c:14332:21 */ // 2-byte unsigned integer -type I16 = int16 /* sqlite3.c:14333:20 */ // 2-byte signed integer -type U8 = uint8 /* sqlite3.c:14334:20 */ // 1-byte unsigned integer -type I8 = int8 /* sqlite3.c:14335:19 */ // 1-byte signed integer +type I64 = Sqlite_int64 /* sqlite3.c:14433:22 */ // 8-byte signed integer +type U64 = Sqlite_uint64 /* sqlite3.c:14434:23 */ // 8-byte unsigned integer +type U32 = uint32 /* sqlite3.c:14435:21 */ // 4-byte unsigned integer +type U16 = uint16 /* sqlite3.c:14436:21 */ // 2-byte unsigned integer +type I16 = int16 /* sqlite3.c:14437:20 */ // 2-byte signed integer +type U8 = uint8 /* sqlite3.c:14438:20 */ // 1-byte unsigned integer +type I8 = int8 /* sqlite3.c:14439:19 */ // 1-byte signed integer // SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value // that can be stored in a u32 without loss of data. The value @@ -8418,7 +8507,7 @@ type I8 = int8 /* sqlite3.c:14335:19 */ // 1-byte signed integer // table or index. This is an unsigned integer type. For 99.9% of // the world, a 32-bit integer is sufficient. But a 64-bit integer // can be used at compile-time if desired. -type TRowcnt = U32 /* sqlite3.c:14354:14 */ // 32-bit is the default +type TRowcnt = U32 /* sqlite3.c:14458:14 */ // 32-bit is the default // Estimated quantities used for query planning are stored as 16-bit // logarithms. For quantity X, the value stored is 10*log2(X). This @@ -8441,55 +8530,12 @@ type TRowcnt = U32 /* sqlite3.c:14354:14 */ // 32-bit is the default // Examples: // // 0.5 -> -10 0.1 -> -33 0.0625 -> -40 -type LogEst = int16 /* sqlite3.c:14380:20 */ +type LogEst = int16 /* sqlite3.c:14484:20 */ // Set the SQLITE_PTRSIZE macro to the number of bytes in a pointer // The uptr type is an unsigned integer large enough to hold a pointer -type Uptr = U64 /* sqlite3.c:14404:15 */ - -// The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to -// something between S (inclusive) and E (exclusive). -// -// In other words, S is a buffer and E is a pointer to the first byte after -// the end of buffer S. This macro returns true if P points to something -// contained within the buffer S. - -// Macros to determine whether the machine is big or little endian, -// and whether or not that determination is run-time or compile-time. -// -// For best performance, an attempt is made to guess at the byte-order -// using C-preprocessor macros. If that is unsuccessful, or if -// -DSQLITE_BYTEORDER=0 is set, then byte-order is determined -// at run-time. - -// Constants for the largest and smallest possible 64-bit signed integers. -// These macros are designed to work correctly on both 32-bit and 64-bit -// compilers. - -// Round up a number to the next larger multiple of 8. This is used -// to force 8-byte alignment on 64-bit architectures. - -// Round down to the nearest multiple of 8 - -// Assert that the pointer X is aligned to an 8-byte boundary. This -// macro is used only within assert() to verify that the code gets -// all alignment restrictions correct. -// -// Except, if SQLITE_4_BYTE_ALIGNED_MALLOC is defined, then the -// underlying malloc() implementation might return us 4-byte aligned -// pointers. In that case, only verify 4-byte alignment. - -// Disable MMAP on platforms where it is known to not work - -// Default maximum size of memory used by memory-mapped I/O in the VFS - -// The default MMAP_SIZE is zero on all platforms. Or, even if a larger -// default MMAP_SIZE is specified at compile-time, make sure that it does -// not exceed the maximum mmap size. - -// SELECTTRACE_ENABLED will be either 1 or 0 depending on whether or not -// the Select query generator tracing logic is turned on. +type Uptr = U64 /* sqlite3.c:14508:15 */ // An instance of the following structure is used to store the busy-handler // callback for a given sqlite handle. @@ -8503,50 +8549,7 @@ type BusyHandler1 = struct { FpBusyArg uintptr FnBusy int32 _ [4]byte -} /* sqlite3.c:1297:9 */ - -// The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to -// something between S (inclusive) and E (exclusive). -// -// In other words, S is a buffer and E is a pointer to the first byte after -// the end of buffer S. This macro returns true if P points to something -// contained within the buffer S. - -// Macros to determine whether the machine is big or little endian, -// and whether or not that determination is run-time or compile-time. -// -// For best performance, an attempt is made to guess at the byte-order -// using C-preprocessor macros. If that is unsuccessful, or if -// -DSQLITE_BYTEORDER=0 is set, then byte-order is determined -// at run-time. - -// Constants for the largest and smallest possible 64-bit signed integers. -// These macros are designed to work correctly on both 32-bit and 64-bit -// compilers. - -// Round up a number to the next larger multiple of 8. This is used -// to force 8-byte alignment on 64-bit architectures. - -// Round down to the nearest multiple of 8 - -// Assert that the pointer X is aligned to an 8-byte boundary. This -// macro is used only within assert() to verify that the code gets -// all alignment restrictions correct. -// -// Except, if SQLITE_4_BYTE_ALIGNED_MALLOC is defined, then the -// underlying malloc() implementation might return us 4-byte aligned -// pointers. In that case, only verify 4-byte alignment. - -// Disable MMAP on platforms where it is known to not work - -// Default maximum size of memory used by memory-mapped I/O in the VFS - -// The default MMAP_SIZE is zero on all platforms. Or, even if a larger -// default MMAP_SIZE is specified at compile-time, make sure that it does -// not exceed the maximum mmap size. - -// SELECTTRACE_ENABLED will be either 1 or 0 depending on whether or not -// the Select query generator tracing logic is turned on. +} /* sqlite3.c:1312:9 */ // An instance of the following structure is used to store the busy-handler // callback for a given sqlite handle. @@ -8555,7 +8558,7 @@ type BusyHandler1 = struct { // callback for the database handle. Each pager opened via the sqlite // handle is passed a pointer to sqlite.busyHandler. The busy-handler // callback is currently invoked only from within pager.c. -type BusyHandler = BusyHandler1 /* sqlite3.c:14563:28 */ +type BusyHandler = BusyHandler1 /* sqlite3.c:14679:28 */ // Name of table that holds the database schema. @@ -8620,8 +8623,7 @@ type AggInfo1 = struct { FaFunc uintptr FnFunc int32 FselId U32 - FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Name of table that holds the database schema. @@ -8670,21 +8672,21 @@ type AggInfo1 = struct { // cases the parameters are named as per the usual conventions. // Forward references to structures -type AggInfo = AggInfo1 /* sqlite3.c:14659:24 */ +type AggInfo = AggInfo1 /* sqlite3.c:14775:24 */ type AuthContext1 = struct { FzAuthContext uintptr FpParse uintptr -} /* sqlite3.c:14660:9 */ +} /* sqlite3.c:14776:9 */ -type AuthContext = AuthContext1 /* sqlite3.c:14660:28 */ +type AuthContext = AuthContext1 /* sqlite3.c:14776:28 */ type AutoincInfo1 = struct { FpNext uintptr FpTab uintptr FiDb int32 FregCtr int32 -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type AutoincInfo = AutoincInfo1 /* sqlite3.c:14661:28 */ +type AutoincInfo = AutoincInfo1 /* sqlite3.c:14777:28 */ type Bitvec1 = struct { FiSize U32 FnSet U32 @@ -8694,9 +8696,9 @@ type Bitvec1 = struct { _ [0]uint64 FaBitmap [496]U8 } -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Bitvec = Bitvec1 /* sqlite3.c:14662:23 */ +type Bitvec = Bitvec1 /* sqlite3.c:14778:23 */ type CollSeq1 = struct { FzName uintptr Fenc U8 @@ -8704,9 +8706,9 @@ type CollSeq1 = struct { FpUser uintptr FxCmp uintptr FxDel uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type CollSeq = CollSeq1 /* sqlite3.c:14663:24 */ +type CollSeq = CollSeq1 /* sqlite3.c:14779:24 */ type Column1 = struct { FzName uintptr FpDflt uintptr @@ -8717,9 +8719,31 @@ type Column1 = struct { FhName U8 FcolFlags U16 _ [2]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Column = Column1 /* sqlite3.c:14664:23 */ +type Column = Column1 /* sqlite3.c:14780:23 */ +type Cte1 = struct { + FzName uintptr + FpCols uintptr + FpSelect uintptr + FzCteErr uintptr + FpUse uintptr + FeM10d U8 + _ [7]byte +} /* sqlite3.c:1312:9 */ + +type Cte = Cte1 /* sqlite3.c:14781:20 */ +type CteUse1 = struct { + FnUse int32 + FaddrM9e int32 + FregRtn int32 + FiCur int32 + FnRowEst LogEst + FeM10d U8 + _ [1]byte +} /* sqlite3.c:1312:9 */ + +type CteUse = CteUse1 /* sqlite3.c:14782:23 */ type Db1 = struct { FzDbSName uintptr FpBt uintptr @@ -8727,9 +8751,21 @@ type Db1 = struct { FbSyncSet U8 _ [6]byte FpSchema uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Db = Db1 /* sqlite3.c:14665:19 */ +type Db = Db1 /* sqlite3.c:14783:19 */ +type DbFixer1 = struct { + FpParse uintptr + Fw Walker + FpSchema uintptr + FbTemp U8 + _ [7]byte + FzDb uintptr + FzType uintptr + FpName uintptr +} /* sqlite3.c:14784:9 */ + +type DbFixer = DbFixer1 /* sqlite3.c:14784:24 */ type Schema1 = struct { Fschema_cookie int32 FiGeneration int32 @@ -8742,9 +8778,9 @@ type Schema1 = struct { Fenc U8 FschemaFlags U16 Fcache_size int32 -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Schema = Schema1 /* sqlite3.c:14666:23 */ +type Schema = Schema1 /* sqlite3.c:14785:23 */ type Expr1 = struct { Fop U8 FaffExpr int8 @@ -8759,13 +8795,12 @@ type Expr1 = struct { FiTable int32 FiColumn YnVar FiAgg I16 - FiRightJoinTable I16 - _ [2]byte + FiRightJoinTable int32 FpAggInfo uintptr Fy struct{ FpTab uintptr } -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Expr = Expr1 /* sqlite3.c:14667:21 */ +type Expr = Expr1 /* sqlite3.c:14786:21 */ type ExprList1 = struct { FnExpr int32 _ [4]byte @@ -8785,9 +8820,9 @@ type ExprList1 = struct { } _ [4]byte } -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type ExprList = ExprList1 /* sqlite3.c:14668:25 */ +type ExprList = ExprList1 /* sqlite3.c:14787:25 */ type FKey1 = struct { FpFrom uintptr FpNextFrom uintptr @@ -8804,17 +8839,17 @@ type FKey1 = struct { _ [4]byte FzCol uintptr } -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type FKey = FKey1 /* sqlite3.c:14669:21 */ +type FKey = FKey1 /* sqlite3.c:14788:21 */ type FuncDestructor1 = struct { FnRef int32 _ [4]byte FxDestroy uintptr FpUserData uintptr -} /* sqlite3.c:14670:9 */ +} /* sqlite3.c:14789:9 */ -type FuncDestructor = FuncDestructor1 /* sqlite3.c:14670:31 */ +type FuncDestructor = FuncDestructor1 /* sqlite3.c:14789:31 */ type FuncDef1 = struct { FnArg I8 _ [3]byte @@ -8827,19 +8862,19 @@ type FuncDef1 = struct { FxInverse uintptr FzName uintptr Fu struct{ FpHash uintptr } -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type FuncDef = FuncDef1 /* sqlite3.c:14671:24 */ -type FuncDefHash1 = struct{ Fa [23]uintptr } /* sqlite3.c:14672:9 */ +type FuncDef = FuncDef1 /* sqlite3.c:14790:24 */ +type FuncDefHash1 = struct{ Fa [23]uintptr } /* sqlite3.c:14791:9 */ -type FuncDefHash = FuncDefHash1 /* sqlite3.c:14672:28 */ +type FuncDefHash = FuncDefHash1 /* sqlite3.c:14791:28 */ type IdList1 = struct { Fa uintptr FnId int32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type IdList = IdList1 /* sqlite3.c:14673:23 */ +type IdList = IdList1 /* sqlite3.c:14792:23 */ type Index1 = struct { FzName uintptr FaiColumn uintptr @@ -8868,9 +8903,9 @@ type Index1 = struct { FnRowEst0 TRowcnt _ [4]byte FcolNotIdxed Bitmask -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Index = Index1 /* sqlite3.c:14674:22 */ +type Index = Index1 /* sqlite3.c:14793:22 */ type IndexSample1 = struct { Fp uintptr Fn int32 @@ -8878,9 +8913,9 @@ type IndexSample1 = struct { FanEq uintptr FanLt uintptr FanDLt uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type IndexSample = IndexSample1 /* sqlite3.c:14675:28 */ +type IndexSample = IndexSample1 /* sqlite3.c:14794:28 */ type KeyInfo1 = struct { FnRef U32 Fenc U8 @@ -8891,9 +8926,9 @@ type KeyInfo1 = struct { Fdb uintptr FaSortFlags uintptr FaColl [1]uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type KeyInfo = KeyInfo1 /* sqlite3.c:14677:24 */ +type KeyInfo = KeyInfo1 /* sqlite3.c:14796:24 */ type Lookaside1 = struct { FbDisable U32 Fsz U16 @@ -8910,12 +8945,12 @@ type Lookaside1 = struct { FpMiddle uintptr FpStart uintptr FpEnd uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Lookaside = Lookaside1 /* sqlite3.c:14678:26 */ -type LookasideSlot1 = struct{ FpNext uintptr } /* sqlite3.c:1297:9 */ +type Lookaside = Lookaside1 /* sqlite3.c:14797:26 */ +type LookasideSlot1 = struct{ FpNext uintptr } /* sqlite3.c:1312:9 */ -type LookasideSlot = LookasideSlot1 /* sqlite3.c:14679:30 */ +type LookasideSlot = LookasideSlot1 /* sqlite3.c:14798:30 */ type Module1 = struct { FpModule uintptr FzName uintptr @@ -8924,9 +8959,9 @@ type Module1 = struct { FpAux uintptr FxDestroy uintptr FpEpoTab uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Module = Module1 /* sqlite3.c:14680:23 */ +type Module = Module1 /* sqlite3.c:14799:23 */ type NameContext1 = struct { FpParse uintptr FpSrcList uintptr @@ -8937,9 +8972,9 @@ type NameContext1 = struct { FncFlags int32 _ [4]byte FpWinSelect uintptr -} /* sqlite3.c:14681:9 */ +} /* sqlite3.c:14800:9 */ -type NameContext = NameContext1 /* sqlite3.c:14681:28 */ +type NameContext = NameContext1 /* sqlite3.c:14800:28 */ type Parse1 = struct { Fdb uintptr FzErrMsg uintptr @@ -8982,45 +9017,53 @@ type Parse1 = struct { FpToplevel uintptr FpTriggerTab uintptr FpParentParse uintptr - FpAggList uintptr - FaddrCrTab int32 - FnQueryLoop U32 - Foldmask U32 - Fnewmask U32 - FeTriggerOp U8 - FeOrconf U8 - FdisableTriggers U8 - _ [1]byte - FaTempReg [8]int32 - _ [4]byte - FsNameToken Token - FsLastToken Token - FnVar YnVar - FiPkSortOrder U8 - Fexplain U8 - FeParseMode U8 - _ [3]byte - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - _ [4]byte - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg Token - FapVtabLock uintptr - FpZombieTab uintptr - FpTriggerPrg uintptr - FpWith uintptr - FpWithToFree uintptr - FpRename uintptr -} /* sqlite3.c:1297:9 */ + Fu1 struct { + _ [0]uint64 + FaddrCrTab int32 + _ [4]byte + } + FnQueryLoop U32 + Foldmask U32 + Fnewmask U32 + FeTriggerOp U8 + FbReturning U8 + FeOrconf U8 + FdisableTriggers U8 + FaTempReg [8]int32 + FsNameToken Token + FsLastToken Token + FnVar YnVar + FiPkSortOrder U8 + Fexplain U8 + FeParseMode U8 + _ [3]byte + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + _ [4]byte + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg Token + FapVtabLock uintptr + FpTriggerPrg uintptr + FpWith uintptr + FpCleanup uintptr + FpRename uintptr +} /* sqlite3.c:1312:9 */ -type Parse = Parse1 /* sqlite3.c:14682:22 */ +type Parse = Parse1 /* sqlite3.c:14801:22 */ +type ParseCleanup1 = struct { + FpNext uintptr + FpPtr uintptr + FxCleanup uintptr +} /* sqlite3.c:1312:9 */ + +type ParseCleanup = ParseCleanup1 /* sqlite3.c:14802:29 */ type PreUpdate1 = struct { Fv uintptr FpCsr uintptr @@ -9037,23 +9080,35 @@ type PreUpdate1 = struct { FaNew uintptr FpTab uintptr FpPk uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type PreUpdate = PreUpdate1 /* sqlite3.c:14683:26 */ +type PreUpdate = PreUpdate1 /* sqlite3.c:14803:26 */ type PrintfArguments1 = struct { FnArg int32 FnUsed int32 FapArg uintptr -} /* sqlite3.c:14684:9 */ +} /* sqlite3.c:14804:9 */ -type PrintfArguments = PrintfArguments1 /* sqlite3.c:14684:32 */ +type PrintfArguments = PrintfArguments1 /* sqlite3.c:14804:32 */ type RenameToken1 = struct { Fp uintptr Ft Token FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type RenameToken = RenameToken1 /* sqlite3.c:14685:28 */ +type RenameToken = RenameToken1 /* sqlite3.c:14805:28 */ +type Returning1 = struct { + FpParse uintptr + FpReturnEL uintptr + FretTrig Trigger + FretTStep TriggerStep + FiRetCur int32 + FnRetCol int32 + FiRetReg int32 + _ [4]byte +} /* sqlite3.c:14806:9 */ + +type Returning = Returning1 /* sqlite3.c:14806:26 */ type RowSet1 = struct { FpChunk uintptr Fdb uintptr @@ -9064,17 +9119,17 @@ type RowSet1 = struct { FnFresh U16 FrsFlags U16 FiBatch int32 -} /* sqlite3.c:14686:9 */ +} /* sqlite3.c:14807:9 */ -type RowSet = RowSet1 /* sqlite3.c:14686:23 */ +type RowSet = RowSet1 /* sqlite3.c:14807:23 */ type Savepoint1 = struct { FzName uintptr FnDeferredCons I64 FnDeferredImmCons I64 FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Savepoint = Savepoint1 /* sqlite3.c:14687:26 */ +type Savepoint = Savepoint1 /* sqlite3.c:14808:26 */ type Select1 = struct { Fop U8 _ [1]byte @@ -9097,16 +9152,16 @@ type Select1 = struct { FpWith uintptr FpWin uintptr FpWinDefn uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Select = Select1 /* sqlite3.c:14688:23 */ +type Select = Select1 /* sqlite3.c:14809:23 */ type SQLiteThread1 = struct { FxTask uintptr FpIn uintptr FpResult uintptr -} /* sqlite3.c:14689:9 */ +} /* sqlite3.c:14810:9 */ -type SQLiteThread = SQLiteThread1 /* sqlite3.c:14689:29 */ +type SQLiteThread = SQLiteThread1 /* sqlite3.c:14810:29 */ type SelectDest1 = struct { FeDest U8 _ [3]byte @@ -9117,40 +9172,43 @@ type SelectDest1 = struct { _ [4]byte FzAffSdst uintptr FpOrderBy uintptr -} /* sqlite3.c:14690:9 */ +} /* sqlite3.c:14811:9 */ -type SelectDest = SelectDest1 /* sqlite3.c:14690:27 */ +type SelectDest = SelectDest1 /* sqlite3.c:14811:27 */ +type SrcItem1 = struct { + FpSchema uintptr + FzDatabase uintptr + FzName uintptr + FzAlias uintptr + FpTab uintptr + FpSelect uintptr + FaddrFillSub int32 + FregReturn int32 + FregResult int32 + Ffg struct { + _ [0]uint32 + Fjointype U8 + _ [3]byte + FnotIndexed uint8 /* unsigned notIndexed: 1, unsigned isIndexedBy: 1, unsigned isTabFunc: 1, unsigned isCorrelated: 1, unsigned viaCoroutine: 1, unsigned isRecursive: 1, unsigned fromDDL: 1, unsigned isCte: 1 */ + _ [3]byte + } + FiCursor int32 + FpOn uintptr + FpUsing uintptr + FcolUsed Bitmask + Fu1 struct{ FzIndexedBy uintptr } + Fu2 struct{ FpIBIndex uintptr } +} /* sqlite3.c:1312:9 */ + +type SrcItem = SrcItem1 /* sqlite3.c:14812:24 */ type SrcList1 = struct { FnSrc int32 FnAlloc U32 - Fa [1]struct { - FpSchema uintptr - FzDatabase uintptr - FzName uintptr - FzAlias uintptr - FpTab uintptr - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 - Ffg struct { - _ [0]uint32 - Fjointype U8 - _ [3]byte - FnotIndexed uint8 /* unsigned notIndexed: 1, unsigned isIndexedBy: 1, unsigned isTabFunc: 1, unsigned isCorrelated: 1, unsigned viaCoroutine: 1, unsigned isRecursive: 1, unsigned fromDDL: 1 */ - _ [3]byte - } - FiCursor int32 - FpOn uintptr - FpUsing uintptr - FcolUsed Bitmask - Fu1 struct{ FzIndexedBy uintptr } - FpIBIndex uintptr - } -} /* sqlite3.c:1297:9 */ + Fa [1]SrcItem +} /* sqlite3.c:1312:9 */ -type SrcList = SrcList1 /* sqlite3.c:14691:24 */ -type StrAccum = sqlite3_str /* sqlite3.c:14692:28 */ // Internal alias for sqlite3_str +type SrcList = SrcList1 /* sqlite3.c:14813:24 */ +type StrAccum = sqlite3_str /* sqlite3.c:14814:28 */ // Internal alias for sqlite3_str type Table1 = struct { FzName uintptr FaCol uintptr @@ -9175,42 +9233,42 @@ type Table1 = struct { FpVTable uintptr FpTrigger uintptr FpSchema uintptr - FpNextZombie uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Internal alias for sqlite3_str -type Table = Table1 /* sqlite3.c:14693:22 */ +type Table = Table1 /* sqlite3.c:14815:22 */ type TableLock1 = struct { FiDb int32 FiTab Pgno FisWriteLock U8 _ [7]byte FzLockName uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type TableLock = TableLock1 /* sqlite3.c:14694:26 */ +type TableLock = TableLock1 /* sqlite3.c:14816:26 */ type Token1 = struct { Fz uintptr Fn uint32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Token = Token1 /* sqlite3.c:14695:22 */ +type Token = Token1 /* sqlite3.c:14817:22 */ type Trigger1 = struct { FzName uintptr Ftable uintptr Fop U8 Ftr_tm U8 - _ [6]byte + FbReturning U8 + _ [5]byte FpWhen uintptr FpColumns uintptr FpSchema uintptr FpTabSchema uintptr Fstep_list uintptr FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Trigger = Trigger1 /* sqlite3.c:14697:24 */ +type Trigger = Trigger1 /* sqlite3.c:14819:24 */ type TriggerPrg1 = struct { FpTrigger uintptr FpNext uintptr @@ -9218,9 +9276,9 @@ type TriggerPrg1 = struct { Forconf int32 FaColmask [2]U32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type TriggerPrg = TriggerPrg1 /* sqlite3.c:14698:27 */ +type TriggerPrg = TriggerPrg1 /* sqlite3.c:14820:27 */ type TriggerStep1 = struct { Fop U8 Forconf U8 @@ -9236,9 +9294,9 @@ type TriggerStep1 = struct { FzSpan uintptr FpNext uintptr FpLast uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type TriggerStep = TriggerStep1 /* sqlite3.c:14699:28 */ +type TriggerStep = TriggerStep1 /* sqlite3.c:14821:28 */ type UnpackedRecord1 = struct { FpKeyInfo uintptr FaMem uintptr @@ -9249,23 +9307,27 @@ type UnpackedRecord1 = struct { Fr2 I8 FeqSeen U8 _ [1]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type UnpackedRecord = UnpackedRecord1 /* sqlite3.c:14700:31 */ +type UnpackedRecord = UnpackedRecord1 /* sqlite3.c:14822:31 */ type Upsert1 = struct { FpUpsertTarget uintptr FpUpsertTargetWhere uintptr FpUpsertSet uintptr FpUpsertWhere uintptr + FpNextUpsert uintptr + FisDoUpdate U8 + _ [7]byte + FpToFree uintptr FpUpsertIdx uintptr FpUpsertSrc uintptr FregData int32 FiDataCur int32 FiIdxCur int32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Upsert = Upsert1 /* sqlite3.c:14701:23 */ +type Upsert = Upsert1 /* sqlite3.c:14823:23 */ type VTable1 = struct { Fdb uintptr FpMod uintptr @@ -9277,18 +9339,18 @@ type VTable1 = struct { FiSavepoint int32 _ [4]byte FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type VTable = VTable1 /* sqlite3.c:14702:23 */ +type VTable = VTable1 /* sqlite3.c:14824:23 */ type VtabCtx1 = struct { FpVTable uintptr FpTab uintptr FpPrior uintptr FbDeclared int32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type VtabCtx = VtabCtx1 /* sqlite3.c:14703:24 */ +type VtabCtx = VtabCtx1 /* sqlite3.c:14825:24 */ type Walker1 = struct { FpParse uintptr FxExprCallback uintptr @@ -9298,9 +9360,9 @@ type Walker1 = struct { FeCode U16 _ [2]byte Fu struct{ FpNC uintptr } -} /* sqlite3.c:14704:9 */ +} /* sqlite3.c:14784:9 */ -type Walker = Walker1 /* sqlite3.c:14704:23 */ +type Walker = Walker1 /* sqlite3.c:14826:23 */ type WhereInfo1 = struct { FpParse uintptr FpTabList uintptr @@ -9321,16 +9383,16 @@ type WhereInfo1 = struct { _ [1]byte FnRowOut LogEst FiTop int32 - _ [4]byte + FiEndWhere int32 FpLoops uintptr FpExprMods uintptr FrevMask Bitmask FsWC WhereClause FsMaskSet WhereMaskSet Fa [1]WhereLevel -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ -type WhereInfo = WhereInfo1 /* sqlite3.c:14705:26 */ +type WhereInfo = WhereInfo1 /* sqlite3.c:14827:26 */ type Window1 = struct { FzName uintptr FzBase uintptr @@ -9362,29 +9424,24 @@ type Window1 = struct { FregEndRowid int32 FbExprArgs U8 _ [3]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type Window = Window1 /* sqlite3.c:14706:23 */ +type Window = Window1 /* sqlite3.c:14828:23 */ type With1 = struct { FnCte int32 _ [4]byte FpOuter uintptr - Fa [1]struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - } -} /* sqlite3.c:1297:9 */ + Fa [1]Cte +} /* sqlite3.c:1312:9 */ -type With = With1 /* sqlite3.c:14707:21 */ +type With = With1 /* sqlite3.c:14829:21 */ // The bitmask datatype defined below is used for various optimizations. // // Changing this from a 64-bit to a 32-bit type limits the number of // tables in a join to 32 instead of 64. But it also reduces the size // of the library by 738 bytes on ix86. -type Bitmask = U64 /* sqlite3.c:14720:15 */ +type Bitmask = U64 /* sqlite3.c:14842:15 */ // The number of bits in a Bitmask. "BMS" means "BitMask Size". @@ -9395,7 +9452,7 @@ type Bitmask = U64 /* sqlite3.c:14720:15 */ // variable number associated with that parameter. See the format description // on the sqlite3VListAdd() routine for more information. A VList is really // just an array of integers. -type VList = int32 /* sqlite3.c:14742:13 */ +type VList = int32 /* sqlite3.c:14864:13 */ // Defer sourcing vdbe.h and btree.h until after the "u8" and // "BusyHandler" typedefs. vdbe.h also requires a few of the opaque @@ -9422,7 +9479,7 @@ type VList = int32 /* sqlite3.c:14742:13 */ // The type used to represent a page number. The first page in a file // is called page 1. 0 is used to represent "not a page". -type Pgno = U32 /* sqlite3.c:14783:13 */ +type Pgno = U32 /* sqlite3.c:14905:13 */ // Each open file is managed by a separate instance of the "Pager" structure. type Pager1 = struct { @@ -9492,10 +9549,10 @@ type Pager1 = struct { FpPCache uintptr FpWal uintptr FzWal uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Each open file is managed by a separate instance of the "Pager" structure. -type Pager = Pager1 /* sqlite3.c:14788:22 */ +type Pager = Pager1 /* sqlite3.c:14910:22 */ // Handle type for pages. type PgHdr2 = struct { @@ -9510,10 +9567,10 @@ type PgHdr2 = struct { FnRef I16 FpDirtyNext uintptr FpDirtyPrev uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Handle type for pages. -type DbPage = PgHdr2 /* sqlite3.c:14793:22 */ +type DbPage = PgHdr2 /* sqlite3.c:14915:22 */ //************* End of pager.h ********************************************** //************* Continuing where we left off in sqliteInt.h ***************** @@ -9553,7 +9610,7 @@ type Btree1 = struct { FpNext uintptr FpPrev uintptr Flock BtLock -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ //************* End of pager.h ********************************************** //************* Continuing where we left off in sqliteInt.h ***************** @@ -9580,7 +9637,7 @@ type Btree1 = struct { // it must be turned on for each database using "PRAGMA auto_vacuum = 1". // Forward declarations of structure -type Btree = Btree1 /* sqlite3.c:15036:22 */ +type Btree = Btree1 /* sqlite3.c:15158:22 */ type BtCursor1 = struct { FeState U8 FcurFlags U8 @@ -9603,9 +9660,9 @@ type BtCursor1 = struct { FpKeyInfo uintptr FpPage uintptr FapPage [19]uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type BtCursor = BtCursor1 /* sqlite3.c:15037:25 */ +type BtCursor = BtCursor1 /* sqlite3.c:15159:25 */ type BtShared1 = struct { FpPager uintptr Fdb uintptr @@ -9640,9 +9697,11 @@ type BtShared1 = struct { FpLock uintptr FpWriter uintptr FpTmpSpace uintptr -} /* sqlite3.c:1297:9 */ + FnPreformatSize int32 + _ [4]byte +} /* sqlite3.c:1312:9 */ -type BtShared = BtShared1 /* sqlite3.c:15038:25 */ +type BtShared = BtShared1 /* sqlite3.c:15160:25 */ type BtreePayload1 = struct { FpKey uintptr FnKey Sqlite3_int64 @@ -9653,9 +9712,9 @@ type BtreePayload1 = struct { FnData int32 FnZero int32 _ [4]byte -} /* sqlite3.c:15039:9 */ +} /* sqlite3.c:15161:9 */ -type BtreePayload = BtreePayload1 /* sqlite3.c:15039:29 */ +type BtreePayload = BtreePayload1 /* sqlite3.c:15161:29 */ //************* End of btree.h ********************************************** //************* Continuing where we left off in sqliteInt.h ***************** @@ -9688,7 +9747,7 @@ type Vdbe1 = struct { FpParse uintptr FnVar YnVar _ [2]byte - Fmagic U32 + FiVdbeMagic U32 FnMem int32 FnCursor int32 FcacheCtr U32 @@ -9732,7 +9791,7 @@ type Vdbe1 = struct { Fexpmask U32 FpProgram uintptr FpAuxData uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ //************* End of btree.h ********************************************** //************* Continuing where we left off in sqliteInt.h ***************** @@ -9758,11 +9817,11 @@ type Vdbe1 = struct { // A single VDBE is an opaque structure named "Vdbe". Only routines // in the source file sqliteVdbe.c are allowed to see the insides // of this structure. -type Vdbe = Vdbe1 /* sqlite3.c:15420:21 */ +type Vdbe = Vdbe1 /* sqlite3.c:15559:21 */ // The names of the following types declared in vdbeInt.h are required // for the VdbeOp definition. -type Mem = sqlite3_value /* sqlite3.c:15426:30 */ +type Mem = sqlite3_value /* sqlite3.c:15565:30 */ type SubProgram1 = struct { FaOp uintptr FnOp int32 @@ -9772,9 +9831,9 @@ type SubProgram1 = struct { FaOnce uintptr Ftoken uintptr FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type SubProgram = SubProgram1 /* sqlite3.c:15427:27 */ +type SubProgram = SubProgram1 /* sqlite3.c:15566:27 */ // A single instruction of the virtual machine has an opcode // and as many as three operands. The instruction is recorded @@ -9792,7 +9851,7 @@ type VdbeOp1 = struct { _ [4]byte } FzComment uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // A single instruction of the virtual machine has an opcode // and as many as three operands. The instruction is recorded @@ -9801,9 +9860,9 @@ type p4union = struct { _ [0]uint64 Fi int32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type VdbeOp = VdbeOp1 /* sqlite3.c:15473:23 */ +type VdbeOp = VdbeOp1 /* sqlite3.c:15612:23 */ // A smaller version of VdbeOp used for the VdbeAddOpList() function because // it takes up less space. @@ -9812,11 +9871,11 @@ type VdbeOpList1 = struct { Fp1 int8 Fp2 int8 Fp3 int8 -} /* sqlite3.c:15493:1 */ +} /* sqlite3.c:15632:1 */ -type VdbeOpList = VdbeOpList1 /* sqlite3.c:15499:27 */ +type VdbeOpList = VdbeOpList1 /* sqlite3.c:15638:27 */ -type RecordCompare = uintptr /* sqlite3.c:15904:13 */ +type RecordCompare = uintptr /* sqlite3.c:16046:13 */ // The VdbeCoverage macros are used to set a coverage testing point // for VDBE branch instructions. The coverage testing points are line @@ -9874,7 +9933,7 @@ type RecordCompare = uintptr /* sqlite3.c:15904:13 */ // This header file defines the interface that the sqlite page cache // subsystem. -type PgHdr = PgHdr2 /* sqlite3.c:16037:22 */ +type PgHdr = PgHdr2 /* sqlite3.c:16179:22 */ type PCache2 = struct { FpDirty uintptr FpDirtyTail uintptr @@ -9890,16 +9949,19 @@ type PCache2 = struct { FxStress uintptr FpStress uintptr FpCache uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type PCache = PCache2 /* sqlite3.c:16038:23 */ +type PCache = PCache2 /* sqlite3.c:16180:23 */ // typedef for the authorization callback function. -type Sqlite3_xauth = uintptr /* sqlite3.c:16800:15 */ +type Sqlite3_xauth = uintptr /* sqlite3.c:16942:15 */ // This is an extra SQLITE_TRACE macro that indicates "legacy" tracing // in the style of sqlite3_trace() +// Maximum number of sqlite3.aDb[] entries. This is the number of attached +// databases plus 2 for "main" and "temp". + // Each database connection is an instance of the following structure. type sqlite3InitInfo = struct { FnewTnum Pgno @@ -9909,7 +9971,7 @@ type sqlite3InitInfo = struct { ForphanTrigger uint8 /* unsigned orphanTrigger: 1, unsigned imposterTable: 1, unsigned reopenMemdb: 1 */ _ [7]byte FazInit uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Allowed values for Table.tabFlags. // @@ -9921,8 +9983,9 @@ type sqlite3InitInfo = struct { // // Constraints: // -// TF_HasVirtual == COLFLAG_Virtual -// TF_HasStored == COLFLAG_Stored +// TF_HasVirtual == COLFLAG_VIRTUAL +// TF_HasStored == COLFLAG_STORED +// TF_HasHidden == COLFLAG_HIDDEN // Test to see whether or not a table is a virtual table. This is // done as a macro so that it will be optimized out when virtual @@ -9965,7 +10028,7 @@ type sColMap = struct { FiFrom int32 _ [4]byte FzCol uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // An instance of this structure contains information needed to generate // code for a SELECT that contains aggregate functions. @@ -9986,7 +10049,7 @@ type AggInfo_col = struct { FiColumn I16 FiSorterColumn I16 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // An instance of this structure contains information needed to generate // code for a SELECT that contains aggregate functions. @@ -10004,7 +10067,7 @@ type AggInfo_func = struct { FpFunc uintptr FiMem int32 FiDistinct int32 -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // The datatype ynVar is a signed integer, either 16-bit or 32-bit. // Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater @@ -10014,14 +10077,14 @@ type AggInfo_func = struct { // need more than about 10 or 20 variables. But some extreme users want // to have prepared statements with over 32766 variables, and for them // the option is available (at compile-time). -type YnVar = I16 /* sqlite3.c:17929:13 */ +type YnVar = I16 /* sqlite3.c:18096:13 */ // The following are the meanings of bits in the Expr.flags field. // Value restrictions: // // EP_Agg == NC_HasAgg == SF_HasAgg // EP_Win == NC_HasWin -// 0x020000 // available for reuse +// 0x400000 // Available // 0x80000000 // Available // The EP_Propagate mask is a set of properties that automatically propagate @@ -10081,7 +10144,7 @@ type ExprList_item = struct { } } _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Allowed values for Expr.a.eEName @@ -10102,70 +10165,10 @@ type IdList_item = struct { FzName uintptr Fidx int32 _ [4]byte -} /* sqlite3.c:1297:9 */ - -// The following structure describes the FROM clause of a SELECT statement. -// Each table or subquery in the FROM clause is a separate element of -// the SrcList.a[] array. -// -// With the addition of multiple database support, the following structure -// can also be used to describe a particular table such as the table that -// is modified by an INSERT, DELETE, or UPDATE statement. In standard SQL, -// such a table must be a simple name: ID. But in SQLite, the table can -// now be identified by a database name, a dot, then the table name: ID.ID. -// -// The jointype starts out showing the join type between the current table -// and the next table on the list. The parser builds the list this way. -// But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -// jointype expresses the join between the table and the previous table. -// -// In the colUsed field, the high-order bit (bit 63) is set if the table -// contains more than 63 columns and the 64-th or later column is used. -type SrcList_item = struct { - FpSchema uintptr - FzDatabase uintptr - FzName uintptr - FzAlias uintptr - FpTab uintptr - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 - Ffg struct { - _ [0]uint32 - Fjointype U8 - _ [3]byte - FnotIndexed uint8 /* unsigned notIndexed: 1, unsigned isIndexedBy: 1, unsigned isTabFunc: 1, unsigned isCorrelated: 1, unsigned viaCoroutine: 1, unsigned isRecursive: 1, unsigned fromDDL: 1 */ - _ [3]byte - } - FiCursor int32 - FpOn uintptr - FpUsing uintptr - FcolUsed Bitmask - Fu1 struct{ FzIndexedBy uintptr } - FpIBIndex uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // The yDbMask datatype for the bitmask of all attached databases. -type YDbMask = uint32 /* sqlite3.c:18660:24 */ - -// The following structure contains information used by the sqliteFix... -// routines as they walk the parse tree to make database references -// explicit. -type DbFixer1 = struct { - FpParse uintptr - FpSchema uintptr - FbTemp U8 - _ [7]byte - FzDb uintptr - FzType uintptr - FpName uintptr -} /* sqlite3.c:18959:9 */ - -// The following structure contains information used by the sqliteFix... -// routines as they walk the parse tree to make database references -// explicit. -type DbFixer = DbFixer1 /* sqlite3.c:18959:24 */ +type YDbMask = uint32 /* sqlite3.c:18849:24 */ // A pointer to this structure is used to communicate information // from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback. @@ -10178,7 +10181,7 @@ type InitData = struct { FnInitRow U32 FmxPage Pgno _ [4]byte -} /* sqlite3.c:19001:3 */ +} /* sqlite3.c:19207:3 */ // Allowed values for mInitFlags @@ -10231,7 +10234,7 @@ type Sqlite3Config = struct { FiOnceResetThreshold int32 FszSorterRef U32 FiPrngSeed uint32 -} /* sqlite3.c:19013:1 */ +} /* sqlite3.c:19220:1 */ // This macro is used inside of assert() statements to indicate that // the assert is only valid on a well-formed database. Instead of: @@ -10255,7 +10258,7 @@ type SrcCount = struct { FnThis int32 FnOther int32 _ [4]byte -} /* sqlite3.c:19107:5 */ +} /* sqlite3.c:19314:5 */ // This macro is used inside of assert() statements to indicate that // the assert is only valid on a well-formed database. Instead of: @@ -10277,7 +10280,7 @@ type IdxCover = struct { FpIdx uintptr FiCur int32 _ [4]byte -} /* sqlite3.c:19110:5 */ +} /* sqlite3.c:19317:5 */ // This macro is used inside of assert() statements to indicate that // the assert is only valid on a well-formed database. Instead of: @@ -10303,7 +10306,7 @@ type IdxExprTrans1 = struct { FiTabCol int32 FpWInfo uintptr Fdb uintptr -} /* sqlite3.c:19111:5 */ +} /* sqlite3.c:19318:5 */ // This macro is used inside of assert() statements to indicate that // the assert is only valid on a well-formed database. Instead of: @@ -10327,7 +10330,7 @@ type WindowRewrite1 = struct { FpSub uintptr FpTab uintptr FpSubSelect uintptr -} /* sqlite3.c:19114:5 */ +} /* sqlite3.c:19321:5 */ // This macro is used inside of assert() statements to indicate that // the assert is only valid on a well-formed database. Instead of: @@ -10350,7 +10353,7 @@ type WhereConst1 = struct { FnConst int32 FnChng int32 FapExpr uintptr -} /* sqlite3.c:19115:5 */ +} /* sqlite3.c:19322:5 */ // This macro is used inside of assert() statements to indicate that // the assert is only valid on a well-formed database. Instead of: @@ -10374,19 +10377,7 @@ type RenameCtx1 = struct { FiCol int32 FpTab uintptr FzOld uintptr -} /* sqlite3.c:19116:5 */ - -// Return code from the parse-tree walking primitives and their -// callbacks. - -// An instance of this structure represents a set of one or more CTEs -// (common table expressions) created by a single WITH clause. -type Cte = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:19323:5 */ //************* End of sqliteInt.h ****************************************** //************* Begin file global.c ***************************************** @@ -10426,7 +10417,7 @@ var Xsqlite3UpperToLower = [256]uint8{ uint8(216), uint8(217), uint8(218), uint8(219), uint8(220), uint8(221), uint8(222), uint8(223), uint8(224), uint8(225), uint8(226), uint8(227), uint8(228), uint8(229), uint8(230), uint8(231), uint8(232), uint8(233), uint8(234), uint8(235), uint8(236), uint8(237), uint8(238), uint8(239), uint8(240), uint8(241), uint8(242), uint8(243), uint8(244), uint8(245), uint8(246), uint8(247), uint8(248), uint8(249), uint8(250), uint8(251), uint8(252), uint8(253), uint8(254), uint8(255), -} /* sqlite3.c:20392:36 */ +} /* sqlite3.c:20664:36 */ // The following 256 byte lookup table is used to support SQLites built-in // equivalents to the following standard library functions: @@ -10490,7 +10481,7 @@ var Xsqlite3CtypeMap = [256]uint8{ uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), // e8..ef ........ uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), // f0..f7 ........ uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), // f8..ff ........ -} /* sqlite3.c:20458:36 */ +} /* sqlite3.c:20730:36 */ // EVIDENCE-OF: R-02982-34736 In order to maintain full backwards // compatibility for legacy applications, the URI filename capability is @@ -10538,23 +10529,23 @@ var Xsqlite3CtypeMap = [256]uint8{ var Xsqlite3Config = Sqlite3Config{ // bMemstat FbCoreMutex: U8(1), // bCoreMutex FbFullMutex: (U8(libc.Bool32(SQLITE_THREADSAFE == 1))), // bOpenUri - FbUseCis: SQLITE_ALLOW_COVERING_INDEX_SCAN, // bSmallMalloc + FbUseCis: U8(SQLITE_ALLOW_COVERING_INDEX_SCAN), // bSmallMalloc FbExtraSchemaChecks: U8(1), // bExtraSchemaChecks FmxStrlen: 0x7ffffffe, // neverCorrupt FszLookaside: 1200, FnLookaside: 40, // szLookaside, nLookaside - FnStmtSpill: (64 * 1024), // szMmap - FmxMmap: SQLITE_MAX_MMAP_SIZE, // szPage - FnPage: SQLITE_DEFAULT_PCACHE_INITSZ, // sharedCacheEnabled - FszPma: SQLITE_SORTER_PMASZ, // pLogArg - FmxMemdbSize: SQLITE_MEMDB_DEFAULT_MAXSIZE, // bLocaltimeFault - FiOnceResetThreshold: 0x7ffffffe, // iOnceResetThreshold - FszSorterRef: SQLITE_DEFAULT_SORTERREF_SIZE, // iPrngSeed -} /* sqlite3.c:20578:48 */ + FnStmtSpill: (64 * 1024), // szMmap + FmxMmap: int64(SQLITE_MAX_MMAP_SIZE), // szPage + FnPage: SQLITE_DEFAULT_PCACHE_INITSZ, // sharedCacheEnabled + FszPma: U32(SQLITE_SORTER_PMASZ), // pLogArg + FmxMemdbSize: int64(SQLITE_MEMDB_DEFAULT_MAXSIZE), // bLocaltimeFault + FiOnceResetThreshold: 0x7ffffffe, // iOnceResetThreshold + FszSorterRef: U32(SQLITE_DEFAULT_SORTERREF_SIZE), // iPrngSeed +} /* sqlite3.c:20850:48 */ // Hash table for global functions - functions common to all // database connections. After initialization, this table is // read-only. -var Xsqlite3BuiltinFunctions FuncDefHash /* sqlite3.c:20639:28: */ +var Xsqlite3BuiltinFunctions FuncDefHash /* sqlite3.c:20911:28: */ // The value of the "pending" byte must be 0x40000000 (1 byte past the // 1-gibabyte boundary) in a compatible database. SQLite never uses @@ -10572,20 +10563,21 @@ var Xsqlite3BuiltinFunctions FuncDefHash /* sqlite3.c:20639:28: */ // 0x40000000 results in an incompatible database file format! // Changing the pending byte during operation will result in undefined // and incorrect behavior. -var Xsqlite3PendingByte int32 = 0x40000000 /* sqlite3.c:20668:20 */ +var Xsqlite3PendingByte int32 = 0x40000000 /* sqlite3.c:20940:20 */ -// Flags for select tracing and the ".selecttrace" macro of the CLI -var Xsqlite3_unsupported_selecttrace U32 = U32(0) /* sqlite3.c:20674:16 */ +// Tracing flags set by SQLITE_TESTCTRL_TRACEFLAGS. +var Xsqlite3SelectTrace U32 = U32(0) /* sqlite3.c:20946:20 */ +var Xsqlite3WhereTrace U32 = U32(0) /* sqlite3.c:20947:20 */ // #include "opcodes.h" // Properties of opcodes. The OPFLG_INITIALIZER macro is // created by mkopcodeh.awk during compilation. Data is obtained // from the comments following the "case OP_xxxx:" statements in // the vdbe.c file. -var Xsqlite3OpcodeProperty = [176]uint8{ /* 0 */ uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00), uint8(0x10) /* 8 */, uint8(0x00), uint8(0x01), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x03) /* 16 */, uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x12), uint8(0x03), uint8(0x01), uint8(0x09), uint8(0x09) /* 24 */, uint8(0x09), uint8(0x09), uint8(0x01), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09) /* 32 */, uint8(0x09), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01) /* 40 */, uint8(0x01), uint8(0x01), uint8(0x23), uint8(0x26), uint8(0x26), uint8(0x0b), uint8(0x01), uint8(0x01) /* 48 */, uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x0b), uint8(0x0b), uint8(0x0b), uint8(0x0b) /* 56 */, uint8(0x0b), uint8(0x0b), uint8(0x01), uint8(0x03), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00) /* 64 */, uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x08), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x10) /* 72 */, uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10) /* 80 */, uint8(0x00), uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x00), uint8(0x00), uint8(0x12) /* 88 */, uint8(0x20), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00) /* 96 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x26), uint8(0x26), uint8(0x26) /* 104 */, uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x00) /* 112 */, uint8(0x12), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10) /* 120 */, uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10) /* 128 */, uint8(0x00), uint8(0x00), uint8(0x04), uint8(0x04), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00) /* 136 */, uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 144 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x06), uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x04) /* 152 */, uint8(0x1a), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 160 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 168 */, uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00)} /* sqlite3.c:20683:36 */ +var Xsqlite3OpcodeProperty = [179]uint8{ /* 0 */ uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00), uint8(0x10) /* 8 */, uint8(0x00), uint8(0x01), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x03) /* 16 */, uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x12), uint8(0x03), uint8(0x01), uint8(0x09), uint8(0x09) /* 24 */, uint8(0x09), uint8(0x09), uint8(0x01), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09) /* 32 */, uint8(0x09), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01) /* 40 */, uint8(0x01), uint8(0x01), uint8(0x23), uint8(0x26), uint8(0x26), uint8(0x0b), uint8(0x01), uint8(0x01) /* 48 */, uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x0b), uint8(0x0b), uint8(0x0b), uint8(0x0b) /* 56 */, uint8(0x0b), uint8(0x0b), uint8(0x01), uint8(0x03), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00) /* 64 */, uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x08), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x10) /* 72 */, uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10) /* 80 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x00), uint8(0x00) /* 88 */, uint8(0x12), uint8(0x20), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00) /* 96 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x26), uint8(0x26) /* 104 */, uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26) /* 112 */, uint8(0x00), uint8(0x12), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00) /* 120 */, uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 128 */, uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x04), uint8(0x04), uint8(0x00) /* 136 */, uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00) /* 144 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x06), uint8(0x10) /* 152 */, uint8(0x10), uint8(0x00), uint8(0x04), uint8(0x1a), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 160 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 168 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00) /* 176 */, uint8(0x00), uint8(0x00), uint8(0x00)} /* sqlite3.c:20956:36 */ // Name of the default collating sequence -var Xsqlite3StrBINARY = *(*[7]int8)(unsafe.Pointer(ts + 363 /* "BINARY" */)) /* sqlite3.c:20688:27 */ +var Xsqlite3StrBINARY = *(*[7]int8)(unsafe.Pointer(ts + 363 /* "BINARY" */)) /* sqlite3.c:20961:27 */ //************* End of global.c ********************************************* //************* Begin file status.c ***************************************** @@ -10630,10 +10622,10 @@ var Xsqlite3StrBINARY = *(*[7]int8)(unsafe.Pointer(ts + 363 /* "BINARY" */)) /* // SQL is translated into a sequence of instructions to be // executed by a virtual machine. Each instruction is an instance // of the following structure. -type Op = VdbeOp1 /* sqlite3.c:20755:23 */ +type Op = VdbeOp1 /* sqlite3.c:21028:23 */ // Boolean values -type Bool = uint32 /* sqlite3.c:20760:18 */ +type Bool = uint32 /* sqlite3.c:21033:18 */ // Opaque type used by code in vdbesort.c type VdbeSorter1 = struct { @@ -10656,10 +10648,10 @@ type VdbeSorter1 = struct { FtypeMask U8 _ [3]byte FaTask [1]SortSubtask -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // Opaque type used by code in vdbesort.c -type VdbeSorter = VdbeSorter1 /* sqlite3.c:20763:27 */ +type VdbeSorter = VdbeSorter1 /* sqlite3.c:21036:27 */ // Elements of the linked list at Vdbe.pAuxData type AuxData1 = struct { @@ -10668,10 +10660,10 @@ type AuxData1 = struct { FpAux uintptr FxDeleteAux uintptr FpNextAux uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Elements of the linked list at Vdbe.pAuxData -type AuxData = AuxData1 /* sqlite3.c:20766:24 */ +type AuxData = AuxData1 /* sqlite3.c:21039:24 */ // Types of VDBE cursors @@ -10690,8 +10682,10 @@ type VdbeCursor1 = struct { FdeferredMoveto U8 FisTable U8 _ [3]byte - FisEphemeral uint8 /* Bool isEphemeral: 1, Bool useRandomRowid: 1, Bool isOrdered: 1, Bool seekHit: 1 */ - _ [7]byte + FisEphemeral uint8 /* Bool isEphemeral: 1, Bool useRandomRowid: 1, Bool isOrdered: 1 */ + _ [1]byte + FseekHit U16 + _ [4]byte FpBtx uintptr FseqCount I64 FaAltMap uintptr @@ -10712,7 +10706,7 @@ type VdbeCursor1 = struct { FszRow U32 FaType [1]U32 _ [4]byte -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // Types of VDBE cursors @@ -10724,7 +10718,7 @@ type VdbeCursor1 = struct { // * A sorter // * A virtual table // * A one-row "pseudotable" stored in a single register -type VdbeCursor = VdbeCursor1 /* sqlite3.c:20784:27 */ +type VdbeCursor = VdbeCursor1 /* sqlite3.c:21057:27 */ // A value for VdbeCursor.cacheStatus that means the cache is always invalid. @@ -10766,7 +10760,7 @@ type VdbeFrame1 = struct { FnChildCsr int32 FnChange int32 FnDbChange int32 -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ // A value for VdbeCursor.cacheStatus that means the cache is always invalid. @@ -10789,7 +10783,7 @@ type VdbeFrame1 = struct { // // The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is // set to NULL if the currently executing frame is the main program. -type VdbeFrame = VdbeFrame1 /* sqlite3.c:20870:26 */ +type VdbeFrame = VdbeFrame1 /* sqlite3.c:21143:26 */ // Magic number for sanity checking on VdbeFrame objects @@ -10799,11 +10793,11 @@ type VdbeFrame = VdbeFrame1 /* sqlite3.c:20870:26 */ // Internally, the vdbe manipulates nearly all SQL values as Mem // structures. Each Mem struct may cache multiple representations (string, // integer etc.) of the same value. -type MemValue = struct{ Fr float64 } /* sqlite3.c:1297:9 */ +type MemValue = struct{ Fr float64 } /* sqlite3.c:1312:9 */ // A bitfield type for use inside of structures. Always follow with :N where // N is the number of bits. -type Bft = uint32 /* sqlite3.c:21053:18 */ // Bit Field Type +type Bft = uint32 /* sqlite3.c:21326:18 */ // Bit Field Type // The ScanStatus object holds a single value for the // sqlite3_stmt_scanstatus() interface. @@ -10815,13 +10809,13 @@ type ScanStatus1 = struct { FnEst LogEst _ [6]byte FzName uintptr -} /* sqlite3.c:21058:9 */ +} /* sqlite3.c:21331:9 */ // Bit Field Type // The ScanStatus object holds a single value for the // sqlite3_stmt_scanstatus() interface. -type ScanStatus = ScanStatus1 /* sqlite3.c:21058:27 */ +type ScanStatus = ScanStatus1 /* sqlite3.c:21331:27 */ // The DblquoteStr object holds the text of a double-quoted // string for a prepared statement. A linked list of these objects @@ -10832,7 +10826,7 @@ type ScanStatus = ScanStatus1 /* sqlite3.c:21058:27 */ type DblquoteStr1 = struct { FpNextStr uintptr Fz [8]int8 -} /* sqlite3.c:21075:9 */ +} /* sqlite3.c:21348:9 */ // The DblquoteStr object holds the text of a double-quoted // string for a prepared statement. A linked list of these objects @@ -10840,20 +10834,20 @@ type DblquoteStr1 = struct { // When computing a normalized SQL statement for an SQL statement, that // list is consulted for each double-quoted identifier to see if the // identifier should really be a string literal. -type DblquoteStr = DblquoteStr1 /* sqlite3.c:21075:28 */ +type DblquoteStr = DblquoteStr1 /* sqlite3.c:21348:28 */ //************* End of vdbeInt.h ******************************************** //************* Continuing where we left off in status.c ******************** // Variables in which to record status information. -type Sqlite3StatValueType = Sqlite3_int64 /* sqlite3.c:21341:23 */ +type Sqlite3StatValueType = Sqlite3_int64 /* sqlite3.c:21614:23 */ type sqlite3StatType = struct { FnowValue [10]Sqlite3StatValueType FmxValue [10]Sqlite3StatValueType -} /* sqlite3.c:21345:9 */ +} /* sqlite3.c:21618:9 */ -type Sqlite3StatType = sqlite3StatType /* sqlite3.c:21345:32 */ -var sqlite3Stat = sqlite3StatType{} /* sqlite3.c:21349:3 */ +type Sqlite3StatType = sqlite3StatType /* sqlite3.c:21618:32 */ +var sqlite3Stat = sqlite3StatType{} /* sqlite3.c:21622:3 */ // Elements of sqlite3Stat[] are protected by either the memory allocator // mutex, or by the pcache1 mutex. The following array determines which. @@ -10868,7 +10862,7 @@ var statMutex = [10]int8{ int8(1), // SQLITE_STATUS_PAGECACHE_SIZE int8(0), // SQLITE_STATUS_SCRATCH_SIZE int8(0), // SQLITE_STATUS_MALLOC_COUNT -} /* sqlite3.c:21355:19 */ +} /* sqlite3.c:21628:19 */ // The "wsdStat" macro will resolve to the status information // state vector. If writable static data is unsupported on the target, @@ -10878,7 +10872,7 @@ var statMutex = [10]int8{ // Return the current value of a status parameter. The caller must // be holding the appropriate mutex. -func Xsqlite3StatusValue(tls *libc.TLS, op int32) Sqlite3_int64 { /* sqlite3.c:21387:30: */ +func Xsqlite3StatusValue(tls *libc.TLS, op int32) Sqlite3_int64 { /* sqlite3.c:21660:30: */ return *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*8)) } @@ -10892,7 +10886,7 @@ func Xsqlite3StatusValue(tls *libc.TLS, op int32) Sqlite3_int64 { /* sqlite3.c:2 // // The StatusDown() routine lowers the current value by N. The highwater // mark is unchanged. N must be non-negative for StatusDown(). -func Xsqlite3StatusUp(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21407:21: */ +func Xsqlite3StatusUp(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21680:21: */ *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*8)) += (Sqlite3StatValueType(N)) if *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*8)) > *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) + 80 /* &.mxValue */) + uintptr(op)*8)) { @@ -10900,14 +10894,14 @@ func Xsqlite3StatusUp(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21407:21: } } -func Xsqlite3StatusDown(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21418:21: */ +func Xsqlite3StatusDown(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21691:21: */ *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*8)) -= (Sqlite3StatValueType(N)) } // Adjust the highwater mark if necessary. // The caller must hold the appropriate mutex. -func Xsqlite3StatusHighwater(tls *libc.TLS, op int32, X int32) { /* sqlite3.c:21432:21: */ +func Xsqlite3StatusHighwater(tls *libc.TLS, op int32, X int32) { /* sqlite3.c:21705:21: */ var newValue Sqlite3StatValueType newValue = Sqlite3StatValueType(X) @@ -10918,12 +10912,12 @@ func Xsqlite3StatusHighwater(tls *libc.TLS, op int32, X int32) { /* sqlite3.c:21 } // Query status information. -func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21452:16: */ +func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21725:16: */ var pMutex uintptr _ = pMutex if (op < 0) || (op >= (int32(uint64(unsafe.Sizeof([10]Sqlite3StatValueType{})) / uint64(unsafe.Sizeof(Sqlite3StatValueType(0)))))) { - return Xsqlite3MisuseError(tls, 21461) + return Xsqlite3MisuseError(tls, 21734) } if statMutex[op] != 0 { pMutex = Xsqlite3Pcache1Mutex(tls) @@ -10941,7 +10935,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin return SQLITE_OK } -func Xsqlite3_status(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21477:16: */ +func Xsqlite3_status(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21750:16: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -10957,7 +10951,7 @@ func Xsqlite3_status(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintp } // Return the number of LookasideSlot elements on the linked list -func countLookasideSlots(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:21494:12: */ +func countLookasideSlots(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:21767:12: */ var cnt U32 = U32(0) for p != 0 { p = (*LookasideSlot)(unsafe.Pointer(p)).FpNext @@ -10967,7 +10961,7 @@ func countLookasideSlots(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:21494:12: } // Count the number of slots of lookaside memory that are outstanding -func Xsqlite3LookasideUsed(tls *libc.TLS, db uintptr, pHighwater uintptr) int32 { /* sqlite3.c:21506:20: */ +func Xsqlite3LookasideUsed(tls *libc.TLS, db uintptr, pHighwater uintptr) int32 { /* sqlite3.c:21779:20: */ var nInit U32 = countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit) var nFree U32 = countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree) nInit = nInit + (countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit)) @@ -10979,7 +10973,7 @@ func Xsqlite3LookasideUsed(tls *libc.TLS, db uintptr, pHighwater uintptr) int32 } // Query status information for a single database connection -func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21520:16: */ +func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21793:16: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -11021,9 +11015,9 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p { *(*int32)(unsafe.Pointer(pCurrent)) = 0 - *(*int32)(unsafe.Pointer(pHighwater)) = int32(*(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-SQLITE_DBSTATUS_LOOKASIDE_HIT))*4))) + *(*int32)(unsafe.Pointer(pHighwater)) = int32(*(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-SQLITE_DBSTATUS_LOOKASIDE_HIT))*4))) if resetFlag != 0 { - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-SQLITE_DBSTATUS_LOOKASIDE_HIT))*4)) = U32(0) + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-SQLITE_DBSTATUS_LOOKASIDE_HIT))*4)) = U32(0) } break @@ -11254,7 +11248,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p // License along with the GNU C Library; if not, see // . -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -11579,14 +11573,14 @@ type DateTime1 = struct { FtzSet int8 FisError int8 _ [1]byte -} /* sqlite3.c:21780:9 */ +} /* sqlite3.c:22053:9 */ // The MSVC CRT on Windows CE may not have a localtime() function. // So declare a substitute. The substitute function itself is // defined in "os_win.c". // A structure for holding a single date and time. -type DateTime = DateTime1 /* sqlite3.c:21780:25 */ +type DateTime = DateTime1 /* sqlite3.c:22053:25 */ // Convert zDate into one or more integers according to the conversion // specifier zFormat. @@ -11613,7 +11607,7 @@ type DateTime = DateTime1 /* sqlite3.c:21780:25 */ // the 2-digit day which is the last integer in the set. // // The function returns the number of successful conversions. -func getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:21824:12: */ +func getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:22097:12: */ var ap Va_list _ = ap var cnt int32 @@ -11670,7 +11664,7 @@ end_getDigits: return cnt } -var aMx = [6]U16{U16(12), U16(14), U16(24), U16(31), U16(59), U16(9999)} /* sqlite3.c:21827:20 */ +var aMx = [6]U16{U16(12), U16(14), U16(24), U16(31), U16(59), U16(9999)} /* sqlite3.c:22100:20 */ // Parse a timezone extension on the end of a date-time. // The extension is of the form: @@ -11686,7 +11680,7 @@ var aMx = [6]U16{U16(12), U16(14), U16(24), U16(31), U16(59), U16(9999)} /* sqli // return non-zero. // // A missing specifier is not considered an error. -func parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:21878:12: */ +func parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22151:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -11760,7 +11754,7 @@ __11: // fractional seconds FFFF can be one or more digits. // // Return 1 if there is a parsing error and 0 on success. -func parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:21914:12: */ +func parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22187:12: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -11813,7 +11807,7 @@ func parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:2 } // Put the DateTime object into its error state. -func datetimeError(tls *libc.TLS, p uintptr) { /* sqlite3.c:21954:13: */ +func datetimeError(tls *libc.TLS, p uintptr) { /* sqlite3.c:22227:13: */ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(DateTime{}))) (*DateTime)(unsafe.Pointer(p)).FisError = int8(1) } @@ -11822,7 +11816,7 @@ func datetimeError(tls *libc.TLS, p uintptr) { /* sqlite3.c:21954:13: */ // that the YYYY-MM-DD is according to the Gregorian calendar. // // Reference: Meeus page 61 -func computeJD(tls *libc.TLS, p uintptr) { /* sqlite3.c:21965:13: */ +func computeJD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22238:13: */ var Y int32 var M int32 var D int32 @@ -11878,7 +11872,7 @@ func computeJD(tls *libc.TLS, p uintptr) { /* sqlite3.c:21965:13: */ // 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 *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22015:12: */ +func parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22288:12: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -11929,7 +11923,7 @@ func parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c // Set the time to the current time reported by the VFS. // // Return the number of errors. -func setDateTimeToCurrent(tls *libc.TLS, context uintptr, p uintptr) int32 { /* sqlite3.c:22052:12: */ +func setDateTimeToCurrent(tls *libc.TLS, context uintptr, p uintptr) int32 { /* sqlite3.c:22325:12: */ (*DateTime)(unsafe.Pointer(p)).FiJD = Xsqlite3StmtCurrentTime(tls, context) if (*DateTime)(unsafe.Pointer(p)).FiJD > int64(0) { (*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) @@ -11944,7 +11938,7 @@ func setDateTimeToCurrent(tls *libc.TLS, context uintptr, p uintptr) int32 { /* // 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 *libc.TLS, p uintptr, r float64) { /* sqlite3.c:22068:13: */ +func setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { /* sqlite3.c:22341:13: */ (*DateTime)(unsafe.Pointer(p)).Fs = r (*DateTime)(unsafe.Pointer(p)).FrawS = int8(1) if (r >= 0.0) && (r < 5373484.5) { @@ -11967,7 +11961,7 @@ func setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { /* sqlite3.c:22068: // (":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 *libc.TLS, context uintptr, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22093:12: */ +func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22366:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -11979,7 +11973,7 @@ func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) i return 0 } else if (Xsqlite3StrICmp(tls, zDate, ts+402 /* "now" */) == 0) && (Xsqlite3NotPureFunc(tls, context) != 0) { return setDateTimeToCurrent(tls, context, p) - } else if Xsqlite3AtoF(tls, zDate, bp /* &r */, Xsqlite3Strlen30(tls, zDate), SQLITE_UTF8) > 0 { + } else if Xsqlite3AtoF(tls, zDate, bp /* &r */, Xsqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 { setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp /* r */))) return 0 } @@ -11996,12 +11990,12 @@ func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) i // Return TRUE if the given julian day number is within range. // // The input is the JulianDay times 86400000. -func validJulianDay(tls *libc.TLS, iJD Sqlite3_int64) int32 { /* sqlite3.c:22126:12: */ +func validJulianDay(tls *libc.TLS, iJD Sqlite3_int64) int32 { /* sqlite3.c:22399:12: */ return (libc.Bool32((iJD >= int64(0)) && (iJD <= ((I64((int64(0x1a640))) << 32) | int64(0x1072fdff))))) } // Compute the Year, Month, and Day from the julian day number. -func computeYMD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22133:13: */ +func computeYMD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22406:13: */ var Z int32 var A int32 var B int32 @@ -12046,7 +12040,7 @@ func computeYMD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22133:13: */ } // Compute the Hour, Minute, and Seconds from the julian day number. -func computeHMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22162:13: */ +func computeHMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22435:13: */ var s int32 if (*DateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { return @@ -12065,13 +12059,13 @@ func computeHMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22162:13: */ } // Compute both YMD and HMS -func computeYMD_HMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22181:13: */ +func computeYMD_HMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22454:13: */ computeYMD(tls, p) computeHMS(tls, p) } // Clear the YMD and HMS and the TZ -func clearYMD_HMS_TZ(tls *libc.TLS, p uintptr) { /* sqlite3.c:22189:13: */ +func clearYMD_HMS_TZ(tls *libc.TLS, p uintptr) { /* sqlite3.c:22462:13: */ (*DateTime)(unsafe.Pointer(p)).FvalidYMD = int8(0) (*DateTime)(unsafe.Pointer(p)).FvalidHMS = int8(0) (*DateTime)(unsafe.Pointer(p)).FvalidTZ = int8(0) @@ -12099,7 +12093,7 @@ func clearYMD_HMS_TZ(tls *libc.TLS, p uintptr) { /* sqlite3.c:22189:13: */ // 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 *libc.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:22227:12: */ +func osLocaltime(tls *libc.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:22500:12: */ var rc int32 var pX uintptr var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN) @@ -12122,7 +12116,7 @@ func osLocaltime(tls *libc.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:222 // // Or, if an error does occur, set *pRc to SQLITE_ERROR. The returned value // is undefined in this case. -func localtimeOffset(tls *libc.TLS, p uintptr, pCtx uintptr, pRc uintptr) Sqlite3_int64 { /* sqlite3.c:22266:22: */ +func localtimeOffset(tls *libc.TLS, p uintptr, pCtx uintptr, pRc uintptr) Sqlite3_int64 { /* sqlite3.c:22539:22: */ bp := tls.Alloc(160) defer tls.Free(160) @@ -12200,7 +12194,7 @@ var aXformType = [6]struct { {FnName: U8(3), FzName: ts + 448 /* "day" */, FrLimit: 5373485.0, FrXform: 86400000.0}, {FeType: U8(1), FnName: U8(5), FzName: ts + 452 /* "month" */, FrLimit: 176546.0, FrXform: 2592000000.0}, {FeType: U8(2), FnName: U8(4), FzName: ts + 458 /* "year" */, FrLimit: 14713.0, FrXform: 31536000000.0}, -} /* sqlite3.c:22337:3 */ +} /* sqlite3.c:22610:3 */ // Process a modifier to a date-time stamp. The modifiers are // as follows: @@ -12224,7 +12218,7 @@ var aXformType = [6]struct { // 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 *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) int32 { /* sqlite3.c:22370:12: */ +func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) int32 { /* sqlite3.c:22643:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -12287,7 +12281,7 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i // weekday N where 0==Sunday, 1==Monday, and so forth. If the // date is already on the appropriate weekday, this is a no-op. if ((((Xsqlite3_strnicmp(tls, z, ts+487 /* "weekday " */, 8) == 0) && - (Xsqlite3AtoF(tls, (z+8), bp+8 /* &r */, Xsqlite3Strlen30(tls, (z+8)), SQLITE_UTF8) > 0)) && + (Xsqlite3AtoF(tls, (z+8), bp+8 /* &r */, Xsqlite3Strlen30(tls, (z+8)), uint8(SQLITE_UTF8)) > 0)) && ((float64(libc.AssignInt32(&n, int32(*(*float64)(unsafe.Pointer(bp + 8 /* r */)))))) == *(*float64)(unsafe.Pointer(bp + 8 /* r */)))) && (n >= 0)) && (*(*float64)(unsafe.Pointer(bp + 8 /* r */)) < float64(7)) { var Z Sqlite3_int64 computeYMD_HMS(tls, p) @@ -12366,7 +12360,7 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i var i int32 for n = 1; ((*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != ':')) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(n))))]) & 0x01) != 0); n++ { } - if Xsqlite3AtoF(tls, z, bp+8 /* &r */, n, SQLITE_UTF8) <= 0 { + if Xsqlite3AtoF(tls, z, bp+8 /* &r */, n, uint8(SQLITE_UTF8)) <= 0 { *(*int32)(unsafe.Pointer(bp /* rc */)) = 1 break } @@ -12487,7 +12481,7 @@ func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) i // // If there are zero parameters (if even argv[0] is undefined) // then assume a default value of "now" for argv[0]. -func isDate(tls *libc.TLS, context uintptr, argc int32, argv uintptr, p uintptr) int32 { /* sqlite3.c:22587:12: */ +func isDate(tls *libc.TLS, context uintptr, argc int32, argv uintptr, p uintptr) int32 { /* sqlite3.c:22860:12: */ var i int32 var n int32 var z uintptr @@ -12525,7 +12519,7 @@ func isDate(tls *libc.TLS, context uintptr, argc int32, argv uintptr, p uintptr) // julianday( TIMESTRING, MOD, MOD, ...) // // Return the julian day number of the date specified in the arguments -func juliandayFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22630:13: */ +func juliandayFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22903:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -12540,7 +12534,7 @@ func juliandayFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { / // datetime( TIMESTRING, MOD, MOD, ...) // // Return YYYY-MM-DD HH:MM:SS -func datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22647:13: */ +func datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22920:13: */ bp := tls.Alloc(196) defer tls.Free(196) @@ -12559,7 +12553,7 @@ func datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* // time( TIMESTRING, MOD, MOD, ...) // // Return HH:MM:SS -func timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22667:13: */ +func timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22940:13: */ bp := tls.Alloc(172) defer tls.Free(172) @@ -12577,7 +12571,7 @@ func timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql // date( TIMESTRING, MOD, MOD, ...) // // Return YYYY-MM-DD -func dateFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22686:13: */ +func dateFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22959:13: */ bp := tls.Alloc(172) defer tls.Free(172) @@ -12609,7 +12603,7 @@ func dateFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql // %W week of year 00-53 // %Y year 0000-9999 // %% % -func strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22719:13: */ +func strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22992:13: */ bp := tls.Alloc(280) defer tls.Free(280) @@ -12695,7 +12689,7 @@ __3: if n < U64(unsafe.Sizeof([100]int8{})) { z = bp + 128 /* &zBuf[0] */ - } else if n > U64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) { + } else if n > U64(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) { Xsqlite3_result_error_toobig(tls, context) return } else { @@ -12825,7 +12819,7 @@ __3: // current_time() // // This function returns the same value as time('now'). -func ctimeFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:22857:13: */ +func ctimeFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:23130:13: */ _ = NotUsed _ = NotUsed2 timeFunc(tls, context, 0, uintptr(0)) @@ -12834,7 +12828,7 @@ func ctimeFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) // current_date() // // This function returns the same value as date('now'). -func cdateFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:22871:13: */ +func cdateFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:23144:13: */ _ = NotUsed _ = NotUsed2 dateFunc(tls, context, 0, uintptr(0)) @@ -12843,7 +12837,7 @@ func cdateFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) // current_timestamp() // // This function returns the same value as datetime('now'). -func ctimestampFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:22885:13: */ +func ctimestampFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:23158:13: */ _ = NotUsed _ = NotUsed2 datetimeFunc(tls, context, 0, uintptr(0)) @@ -12852,7 +12846,7 @@ func ctimestampFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uint // 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 Xsqlite3RegisterDateTimeFunctions(tls *libc.TLS) { /* sqlite3.c:22945:21: */ +func Xsqlite3RegisterDateTimeFunctions(tls *libc.TLS) { /* sqlite3.c:23218:21: */ Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aDateTimeFuncs)), (int32(uint64(unsafe.Sizeof(aDateTimeFuncs)) / uint64(unsafe.Sizeof(FuncDef{}))))) } @@ -12864,7 +12858,7 @@ var aDateTimeFuncs = [8]FuncDef{ {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_SLOCHNG | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FpUserData: 0, FxSFunc: 0, FzName: ts + 623 /* "strftime" */}, {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 632 /* "current_time" */}, {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 645 /* "current_timestam..." */}, - {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 663 /* "current_date" */}} /* sqlite3.c:22946:18 */ + {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 663 /* "current_date" */}} /* sqlite3.c:23219:18 */ //************* End of date.c *********************************************** //************* Begin file os.c ********************************************* @@ -12886,16 +12880,16 @@ var aDateTimeFuncs = [8]FuncDef{ // If we compile with the SQLITE_TEST macro set, then the following block // of code will give us the ability to simulate a disk I/O error. This // is used for testing the I/O recovery logic. -var Xsqlite3_io_error_hit int32 = 0 /* sqlite3.c:22990:16 */ // Total number of I/O Errors -var Xsqlite3_io_error_hardhit int32 = 0 /* sqlite3.c:22991:16 */ // Number of non-benign errors -var Xsqlite3_io_error_pending int32 = 0 /* sqlite3.c:22992:16 */ // Count down to first I/O error -var Xsqlite3_io_error_persist int32 = 0 /* sqlite3.c:22993:16 */ // True if I/O errors persist -var Xsqlite3_io_error_benign int32 = 0 /* sqlite3.c:22994:16 */ // True if errors are benign -var Xsqlite3_diskfull_pending int32 = 0 /* sqlite3.c:22995:16 */ -var Xsqlite3_diskfull int32 = 0 /* sqlite3.c:22996:16 */ +var Xsqlite3_io_error_hit int32 = 0 /* sqlite3.c:23263:16 */ // Total number of I/O Errors +var Xsqlite3_io_error_hardhit int32 = 0 /* sqlite3.c:23264:16 */ // Number of non-benign errors +var Xsqlite3_io_error_pending int32 = 0 /* sqlite3.c:23265:16 */ // Count down to first I/O error +var Xsqlite3_io_error_persist int32 = 0 /* sqlite3.c:23266:16 */ // True if I/O errors persist +var Xsqlite3_io_error_benign int32 = 0 /* sqlite3.c:23267:16 */ // True if errors are benign +var Xsqlite3_diskfull_pending int32 = 0 /* sqlite3.c:23268:16 */ +var Xsqlite3_diskfull int32 = 0 /* sqlite3.c:23269:16 */ // When testing, also keep a count of the number of open files. -var Xsqlite3_open_file_count int32 = 0 /* sqlite3.c:23003:16 */ +var Xsqlite3_open_file_count int32 = 0 /* sqlite3.c:23276:16 */ // The default SQLite sqlite3_vfs implementations do not allocate // memory (actually, os_unix.c allocates a small amount of memory @@ -12919,20 +12913,20 @@ var Xsqlite3_open_file_count int32 = 0 /* sqlite3.c:23003:16 */ // sqlite3OsAccess() // sqlite3OsFullPathname() // -var Xsqlite3_memdebug_vfs_oom_test int32 = 1 /* sqlite3.c:23031:16 */ +var Xsqlite3_memdebug_vfs_oom_test int32 = 1 /* sqlite3.c:23304:16 */ // 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 Xsqlite3OsClose(tls *libc.TLS, pId uintptr) { /* sqlite3.c:23048:21: */ +func Xsqlite3OsClose(tls *libc.TLS, pId uintptr) { /* sqlite3.c:23321:21: */ if (*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods + 8 /* &.xClose */))))(tls, pId) (*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } -func Xsqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23054:20: */ +func Xsqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23327:20: */ if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) { var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10)) if !(pTstAlloc != 0) { @@ -12944,7 +12938,7 @@ func Xsqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I return (*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 16 /* &.xRead */))))(tls, id, pBuf, amt, offset) } -func Xsqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23058:20: */ +func Xsqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23331:20: */ if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) { var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10)) if !(pTstAlloc != 0) { @@ -12956,11 +12950,11 @@ func Xsqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset return (*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 24 /* &.xWrite */))))(tls, id, pBuf, amt, offset) } -func Xsqlite3OsTruncate(tls *libc.TLS, id uintptr, size I64) int32 { /* sqlite3.c:23062:20: */ +func Xsqlite3OsTruncate(tls *libc.TLS, id uintptr, size I64) int32 { /* sqlite3.c:23335:20: */ return (*(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 32 /* &.xTruncate */))))(tls, id, size) } -func Xsqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:23065:20: */ +func Xsqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:23338:20: */ if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) { var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10)) if !(pTstAlloc != 0) { @@ -12975,7 +12969,7 @@ func Xsqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c return SQLITE_OK } -func Xsqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:23069:20: */ +func Xsqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:23342:20: */ if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) { var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10)) if !(pTstAlloc != 0) { @@ -12987,7 +12981,7 @@ func Xsqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sql return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 48 /* &.xFileSize */))))(tls, id, pSize) } -func Xsqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23073:20: */ +func Xsqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23346:20: */ if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) { var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10)) if !(pTstAlloc != 0) { @@ -12999,11 +12993,11 @@ func Xsqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 56 /* &.xLock */))))(tls, id, lockType) } -func Xsqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23077:20: */ +func Xsqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23350:20: */ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 64 /* &.xUnlock */))))(tls, id, lockType) } -func Xsqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:23080:20: */ +func Xsqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:23353:20: */ if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) { var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10)) if !(pTstAlloc != 0) { @@ -13021,12 +13015,14 @@ func Xsqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int // 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 Xsqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:23093:20: */ +func Xsqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:23366:20: */ if (*Sqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return SQLITE_NOTFOUND } - if (op != SQLITE_FCNTL_COMMIT_PHASETWO) && - (op != SQLITE_FCNTL_LOCK_TIMEOUT) { + if (((op != SQLITE_FCNTL_COMMIT_PHASETWO) && + (op != SQLITE_FCNTL_LOCK_TIMEOUT)) && + (op != SQLITE_FCNTL_CKPT_DONE)) && + (op != SQLITE_FCNTL_CKPT_START) { // Faults are not injected into COMMIT_PHASETWO because, assuming SQLite // is using a regular VFS, it is called after the corresponding // transaction has been committed. Injecting a fault at this point @@ -13037,6 +13033,10 @@ func Xsqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) in // as if a custom VFS (e.g. zipvfs) returns an error here, it probably // means the commit really has failed and an error should be returned // to the user. + // + // The CKPT_DONE and CKPT_START file-controls are write-only signals + // to the cksumvfs. Their return code is meaningless and is ignored + // by the SQLite core, so there is no point in simulating OOMs for them. if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) { var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10)) if !(pTstAlloc != 0) { @@ -13049,13 +13049,13 @@ func Xsqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) in return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 80 /* &.xFileControl */))))(tls, id, op, pArg) } -func Xsqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { /* sqlite3.c:23114:21: */ +func Xsqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { /* sqlite3.c:23394:21: */ if (*Sqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 80 /* &.xFileControl */))))(tls, id, op, pArg) } } -func Xsqlite3OsSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23118:20: */ +func Xsqlite3OsSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23398:20: */ var xSectorSize uintptr = (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize return func() int32 { if xSectorSize != 0 { @@ -13065,23 +13065,23 @@ func Xsqlite3OsSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23118: }() } -func Xsqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23122:20: */ +func Xsqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23402:20: */ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, id) } -func Xsqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) int32 { /* sqlite3.c:23126:20: */ +func Xsqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) int32 { /* sqlite3.c:23406:20: */ return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 112 /* &.xShmLock */))))(tls, id, offset, n, flags) } -func Xsqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { /* sqlite3.c:23129:21: */ +func Xsqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { /* sqlite3.c:23409:21: */ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 120 /* &.xShmBarrier */))))(tls, id) } -func Xsqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) int32 { /* sqlite3.c:23132:20: */ +func Xsqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) int32 { /* sqlite3.c:23412:20: */ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 128 /* &.xShmUnmap */))))(tls, id, deleteFlag) } -func Xsqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:23135:20: */ +func Xsqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:23415:20: */ if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) { var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10)) if !(pTstAlloc != 0) { @@ -13094,7 +13094,7 @@ func Xsqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExten } // The real implementation of xFetch and xUnfetch -func Xsqlite3OsFetch(tls *libc.TLS, id uintptr, iOff I64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:23149:20: */ +func Xsqlite3OsFetch(tls *libc.TLS, id uintptr, iOff I64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:23429:20: */ if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) { var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10)) if !(pTstAlloc != 0) { @@ -13106,13 +13106,13 @@ func Xsqlite3OsFetch(tls *libc.TLS, id uintptr, iOff I64, iAmt int32, pp uintptr return (*(*func(*libc.TLS, uintptr, Sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 136 /* &.xFetch */))))(tls, id, iOff, iAmt, pp) } -func Xsqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:23153:20: */ +func Xsqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:23433:20: */ return (*(*func(*libc.TLS, uintptr, Sqlite3_int64, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 144 /* &.xUnfetch */))))(tls, id, iOff, p) } // The next group of routines are convenience wrappers around the // VFS methods. -func Xsqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pFlagsOut uintptr) int32 { /* sqlite3.c:23171:20: */ +func Xsqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pFlagsOut uintptr) int32 { /* sqlite3.c:23451:20: */ var rc int32 if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(0 != 0) || !(Xsqlite3JournalIsInMemory(tls, uintptr(0)) != 0)) { var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10)) @@ -13131,7 +13131,7 @@ func Xsqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, f return rc } -func Xsqlite3OsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:23188:20: */ +func Xsqlite3OsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:23468:20: */ if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(0 != 0) || !(Xsqlite3JournalIsInMemory(tls, uintptr(0)) != 0)) { var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10)) if !(pTstAlloc != 0) { @@ -13143,7 +13143,7 @@ func Xsqlite3OsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) return (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pVfs + 48 /* &.xDelete */))))(tls, pVfs, zPath, dirSync) } -func Xsqlite3OsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:23193:20: */ +func Xsqlite3OsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:23473:20: */ if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(0 != 0) || !(Xsqlite3JournalIsInMemory(tls, uintptr(0)) != 0)) { var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10)) if !(pTstAlloc != 0) { @@ -13155,7 +13155,7 @@ func Xsqlite3OsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, p return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 56 /* &.xAccess */))))(tls, pVfs, zPath, flags, pResOut) } -func Xsqlite3OsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* sqlite3.c:23202:20: */ +func Xsqlite3OsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* sqlite3.c:23482:20: */ if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(0 != 0) || !(Xsqlite3JournalIsInMemory(tls, uintptr(0)) != 0)) { var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10)) if !(pTstAlloc != 0) { @@ -13168,23 +13168,23 @@ func Xsqlite3OsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 64 /* &.xFullPathname */))))(tls, pVfs, zPath, nPathOut, zPathOut) } -func Xsqlite3OsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:23213:21: */ +func Xsqlite3OsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:23493:21: */ return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 72 /* &.xDlOpen */))))(tls, pVfs, zPath) } -func Xsqlite3OsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) { /* sqlite3.c:23216:21: */ +func Xsqlite3OsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) { /* sqlite3.c:23496:21: */ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer((pVfs + 80 /* &.xDlError */))))(tls, pVfs, nByte, zBufOut) } -func Xsqlite3OsDlSym(tls *libc.TLS, pVfs uintptr, pHdle uintptr, zSym uintptr) uintptr { /* sqlite3.c:23219:21: */ +func Xsqlite3OsDlSym(tls *libc.TLS, pVfs uintptr, pHdle uintptr, zSym uintptr) uintptr { /* sqlite3.c:23499:21: */ return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 88 /* &.xDlSym */))))(tls, pVfs, pHdle, zSym) } -func Xsqlite3OsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:23222:21: */ +func Xsqlite3OsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:23502:21: */ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pVfs + 96 /* &.xDlClose */))))(tls, pVfs, pHandle) } -func Xsqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:23226:20: */ +func Xsqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:23506:20: */ if Xsqlite3Config.FiPrngSeed != 0 { libc.Xmemset(tls, zBufOut, 0, uint64(nByte)) if nByte > int32(unsafe.Sizeof(uint32(0))) { @@ -13199,18 +13199,18 @@ func Xsqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uint } -func Xsqlite3OsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:23237:20: */ +func Xsqlite3OsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:23517:20: */ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pVfs + 112 /* &.xSleep */))))(tls, pVfs, nMicro) } -func Xsqlite3OsGetLastError(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:23240:20: */ +func Xsqlite3OsGetLastError(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:23520:20: */ if (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxGetLastError != 0 { return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 128 /* &.xGetLastError */))))(tls, pVfs, 0, uintptr(0)) } return 0 } -func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:23243:20: */ +func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:23523:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -13231,7 +13231,7 @@ func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) i return rc } -func Xsqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:23261:20: */ +func Xsqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:23541:20: */ var rc int32 var pFile uintptr pFile = Xsqlite3MallocZero(tls, uint64((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile)) @@ -13248,7 +13248,7 @@ func Xsqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uin return rc } -func Xsqlite3OsCloseFree(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:23283:21: */ +func Xsqlite3OsCloseFree(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:23563:21: */ Xsqlite3OsClose(tls, pFile) Xsqlite3_free(tls, pFile) @@ -13258,7 +13258,7 @@ func Xsqlite3OsCloseFree(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:23283:21: // 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 Xsqlite3OsInit(tls *libc.TLS) int32 { /* sqlite3.c:23295:20: */ +func Xsqlite3OsInit(tls *libc.TLS) int32 { /* sqlite3.c:23575:20: */ var p uintptr = Xsqlite3_malloc(tls, 10) if p == uintptr(0) { return SQLITE_NOMEM @@ -13268,11 +13268,11 @@ func Xsqlite3OsInit(tls *libc.TLS) int32 { /* sqlite3.c:23295:20: */ } // The list of all registered VFS implementations. -var vfsList uintptr = uintptr(0) /* sqlite3.c:23305:20 */ +var vfsList uintptr = uintptr(0) /* sqlite3.c:23585:20 */ // Locate a VFS by name. If no name is given, simply return the // first VFS on the list. -func Xsqlite3_vfs_find(tls *libc.TLS, zVfs uintptr) uintptr { /* sqlite3.c:23312:24: */ +func Xsqlite3_vfs_find(tls *libc.TLS, zVfs uintptr) uintptr { /* sqlite3.c:23592:24: */ var pVfs uintptr = uintptr(0) var mutex uintptr var rc int32 = Xsqlite3_initialize(tls) @@ -13294,7 +13294,7 @@ func Xsqlite3_vfs_find(tls *libc.TLS, zVfs uintptr) uintptr { /* sqlite3.c:23312 } // Unlink a VFS from the linked list -func vfsUnlink(tls *libc.TLS, pVfs uintptr) { /* sqlite3.c:23336:13: */ +func vfsUnlink(tls *libc.TLS, pVfs uintptr) { /* sqlite3.c:23616:13: */ if pVfs == uintptr(0) { // No-op @@ -13314,7 +13314,7 @@ func vfsUnlink(tls *libc.TLS, pVfs uintptr) { /* sqlite3.c:23336:13: */ // 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 *libc.TLS, pVfs uintptr, makeDflt int32) int32 { /* sqlite3.c:23358:16: */ +func Xsqlite3_vfs_register(tls *libc.TLS, pVfs uintptr, makeDflt int32) int32 { /* sqlite3.c:23638:16: */ var mutex uintptr var rc int32 = Xsqlite3_initialize(tls) if rc != 0 { @@ -13337,7 +13337,7 @@ func Xsqlite3_vfs_register(tls *libc.TLS, pVfs uintptr, makeDflt int32) int32 { } // Unregister a VFS so that it is no longer accessible. -func Xsqlite3_vfs_unregister(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:23386:16: */ +func Xsqlite3_vfs_unregister(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:23666:16: */ var mutex uintptr var rc int32 = Xsqlite3_initialize(tls) if rc != 0 { @@ -13382,7 +13382,7 @@ func Xsqlite3_vfs_unregister(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:2 type BenignMallocHooks1 = struct { FxBenignBegin uintptr FxBenignEnd uintptr -} /* sqlite3.c:23434:9 */ +} /* sqlite3.c:23714:9 */ //************* End of os.c ************************************************* //************* Begin file fault.c ****************************************** @@ -13413,8 +13413,8 @@ type BenignMallocHooks1 = struct { // #include "sqliteInt.h" // Global variables. -type BenignMallocHooks = BenignMallocHooks1 /* sqlite3.c:23434:34 */ -var sqlite3Hooks = BenignMallocHooks1{} /* sqlite3.c:23438:3 */ +type BenignMallocHooks = BenignMallocHooks1 /* sqlite3.c:23714:34 */ +var sqlite3Hooks = BenignMallocHooks1{} /* sqlite3.c:23718:3 */ // The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks // structure. If writable static data is unsupported on the target, @@ -13424,7 +13424,7 @@ var sqlite3Hooks = BenignMallocHooks1{} /* sqlite3.c:23438:3 */ // Register hooks to call when sqlite3BeginBenignMalloc() and // sqlite3EndBenignMalloc() are called, respectively. -func Xsqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { /* sqlite3.c:23460:21: */ +func Xsqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { /* sqlite3.c:23740:21: */ sqlite3Hooks.FxBenignBegin = xBenignBegin sqlite3Hooks.FxBenignEnd = xBenignEnd @@ -13433,14 +13433,14 @@ func Xsqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd u // 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 Xsqlite3BeginBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23474:21: */ +func Xsqlite3BeginBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23754:21: */ if sqlite3Hooks.FxBenignBegin != 0 { (*(*func(*libc.TLS))(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Hooks)) /* &.xBenignBegin */))))(tls) } } -func Xsqlite3EndBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23480:21: */ +func Xsqlite3EndBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23760:21: */ if sqlite3Hooks.FxBenignEnd != 0 { (*(*func(*libc.TLS))(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Hooks)) + 8 /* &.xBenignEnd */))))(tls) @@ -13538,7 +13538,7 @@ func Xsqlite3EndBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23480:21: */ // 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 *libc.TLS, nByte int32) uintptr { /* sqlite3.c:23680:13: */ +func sqlite3MemMalloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:23960:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -13561,7 +13561,7 @@ func sqlite3MemMalloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:23680:1 // 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 *libc.TLS, pPrior uintptr) { /* sqlite3.c:23714:13: */ +func sqlite3MemFree(tls *libc.TLS, pPrior uintptr) { /* sqlite3.c:23994:13: */ var p uintptr = pPrior p -= 8 @@ -13570,7 +13570,7 @@ func sqlite3MemFree(tls *libc.TLS, pPrior uintptr) { /* sqlite3.c:23714:13: */ // Report the allocated size of a prior return from xMalloc() // or xRealloc(). -func sqlite3MemSize(tls *libc.TLS, pPrior uintptr) int32 { /* sqlite3.c:23729:12: */ +func sqlite3MemSize(tls *libc.TLS, pPrior uintptr) int32 { /* sqlite3.c:24009:12: */ var p uintptr p = pPrior @@ -13586,7 +13586,7 @@ func sqlite3MemSize(tls *libc.TLS, pPrior uintptr) int32 { /* sqlite3.c:23729:12 // 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 *libc.TLS, pPrior uintptr, nByte int32) uintptr { /* sqlite3.c:23752:13: */ +func sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) uintptr { /* sqlite3.c:24032:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -13608,18 +13608,18 @@ func sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) uintptr { /* } // Round up a request size to the next valid allocation size. -func sqlite3MemRoundup(tls *libc.TLS, n int32) int32 { /* sqlite3.c:23784:12: */ +func sqlite3MemRoundup(tls *libc.TLS, n int32) int32 { /* sqlite3.c:24064:12: */ return (((n) + 7) & libc.CplInt32(7)) } // Initialize this module. -func sqlite3MemInit(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:23791:12: */ +func sqlite3MemInit(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:24071:12: */ _ = NotUsed return SQLITE_OK } // Deinitialize this module. -func sqlite3MemShutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:23818:13: */ +func sqlite3MemShutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:24098:13: */ _ = NotUsed return } @@ -13628,7 +13628,7 @@ func sqlite3MemShutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:23818:13: // // Populate the low-level memory allocation function pointers in // sqlite3GlobalConfig.m with pointers to the routines in this file. -func Xsqlite3MemSetDefault(tls *libc.TLS) { /* sqlite3.c:23829:21: */ +func Xsqlite3MemSetDefault(tls *libc.TLS) { /* sqlite3.c:24109:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -13643,7 +13643,7 @@ var defaultMethods = Sqlite3_mem_methods{ FxRoundup: 0, FxInit: 0, FxShutdown: 0, -} /* sqlite3.c:23830:36 */ +} /* sqlite3.c:24110:36 */ //************* End of mem1.c *********************************************** //************* Begin file mem2.c ******************************************* @@ -13777,7 +13777,7 @@ var defaultMethods = Sqlite3_mem_methods{ // #include "sqliteInt.h" // Initialize the mutex system. -func Xsqlite3MutexInit(tls *libc.TLS) int32 { /* sqlite3.c:25865:20: */ +func Xsqlite3MutexInit(tls *libc.TLS) int32 { /* sqlite3.c:26145:20: */ var rc int32 = SQLITE_OK if !(int32(Xsqlite3Config.Fmutex.FxMutexAlloc) != 0) { // If the xMutexAlloc method has not been set, then the user did not @@ -13811,7 +13811,7 @@ func Xsqlite3MutexInit(tls *libc.TLS) int32 { /* sqlite3.c:25865:20: */ // Shutdown the mutex system. This call frees resources allocated by // sqlite3MutexInit(). -func Xsqlite3MutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:25911:20: */ +func Xsqlite3MutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:26191:20: */ var rc int32 = SQLITE_OK if Xsqlite3Config.Fmutex.FxMutexEnd != 0 { rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 8 /* &.xMutexEnd */))))(tls) @@ -13821,7 +13821,7 @@ func Xsqlite3MutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:25911:20: */ } // Retrieve a pointer to a static mutex or allocate a new dynamic one. -func Xsqlite3_mutex_alloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:25927:26: */ +func Xsqlite3_mutex_alloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26207:26: */ if (id <= SQLITE_MUTEX_RECURSIVE) && (Xsqlite3_initialize(tls) != 0) { return uintptr(0) } @@ -13832,7 +13832,7 @@ func Xsqlite3_mutex_alloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:25927: return (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 16 /* &.xMutexAlloc */))))(tls, id) } -func Xsqlite3MutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:25936:30: */ +func Xsqlite3MutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26216:30: */ if !(int32(Xsqlite3Config.FbCoreMutex) != 0) { return uintptr(0) } @@ -13841,7 +13841,7 @@ func Xsqlite3MutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:25936:30 } // Free a dynamic mutex. -func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:25948:17: */ +func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:26228:17: */ if p != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 24 /* &.xMutexFree */))))(tls, p) @@ -13850,7 +13850,7 @@ func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:25948:17: */ // Obtain the mutex p. If some other thread already has the mutex, block // until it can be obtained. -func Xsqlite3_mutex_enter(tls *libc.TLS, p uintptr) { /* sqlite3.c:25959:17: */ +func Xsqlite3_mutex_enter(tls *libc.TLS, p uintptr) { /* sqlite3.c:26239:17: */ if p != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 32 /* &.xMutexEnter */))))(tls, p) @@ -13859,7 +13859,7 @@ func Xsqlite3_mutex_enter(tls *libc.TLS, p uintptr) { /* sqlite3.c:25959: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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:25970:16: */ +func Xsqlite3_mutex_try(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:26250:16: */ var rc int32 = SQLITE_OK if p != 0 { @@ -13872,7 +13872,7 @@ func Xsqlite3_mutex_try(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:25970:16: // 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 *libc.TLS, p uintptr) { /* sqlite3.c:25985:17: */ +func Xsqlite3_mutex_leave(tls *libc.TLS, p uintptr) { /* sqlite3.c:26265:17: */ if p != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 48 /* &.xMutexLeave */))))(tls, p) @@ -13911,40 +13911,40 @@ func Xsqlite3_mutex_leave(tls *libc.TLS, p uintptr) { /* sqlite3.c:25985:17: */ // Stub routines for all mutex methods. // // This routines provide no mutual exclusion or error checking. -func noopMutexInit(tls *libc.TLS) int32 { /* sqlite3.c:26048:12: */ +func noopMutexInit(tls *libc.TLS) int32 { /* sqlite3.c:26328:12: */ return SQLITE_OK } -func noopMutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:26049:12: */ +func noopMutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:26329:12: */ return SQLITE_OK } -func noopMutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26050:22: */ +func noopMutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26330:22: */ _ = id return uintptr(8) } -func noopMutexFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:26054:13: */ +func noopMutexFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:26334:13: */ _ = p return } -func noopMutexEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:26055:13: */ +func noopMutexEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:26335:13: */ _ = p return } -func noopMutexTry(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:26056:12: */ +func noopMutexTry(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:26336:12: */ _ = p return SQLITE_OK } -func noopMutexLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:26060:13: */ +func noopMutexLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:26340:13: */ _ = p return } -func Xsqlite3NoopMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26062:44: */ +func Xsqlite3NoopMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26342:44: */ return uintptr(unsafe.Pointer(&sMutex)) } @@ -13957,11 +13957,11 @@ var sMutex = Sqlite3_mutex_methods{ FxMutexEnter: 0, FxMutexTry: 0, FxMutexLeave: 0, -} /* sqlite3.c:26063:38 */ +} /* sqlite3.c:26343:38 */ // If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation // is used regardless of the run-time threadsafety setting. -func Xsqlite3DefaultMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26221:44: */ +func Xsqlite3DefaultMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26501:44: */ return Xsqlite3NoopMutex(tls) } @@ -14024,7 +14024,7 @@ func Xsqlite3DefaultMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26221:44: */ // 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 *libc.TLS, n int32) int32 { /* sqlite3.c:27340:16: */ +func Xsqlite3_release_memory(tls *libc.TLS, n int32) int32 { /* sqlite3.c:27620:16: */ return Xsqlite3PcacheReleaseMemory(tls, n) } @@ -14037,22 +14037,22 @@ type Mem0Global = struct { FhardLimit Sqlite3_int64 FnearlyFull int32 _ [4]byte -} /* sqlite3.c:27362:19 */ +} /* sqlite3.c:27642:19 */ // Default value of the hard heap limit. 0 means "no limit". // State information local to the memory allocation subsystem. -var mem0 = Mem0Global{} /* sqlite3.c:27372:3 */ +var mem0 = Mem0Global{} /* sqlite3.c:27652:3 */ // Return the memory allocator mutex. sqlite3_status() needs it. -func Xsqlite3MallocMutex(tls *libc.TLS) uintptr { /* sqlite3.c:27379:30: */ +func Xsqlite3MallocMutex(tls *libc.TLS) uintptr { /* sqlite3.c:27659:30: */ return mem0.Fmutex } // Deprecated external interface. It used to set an alarm callback // that was invoked when memory usage grew too large. Now it is a // no-op. -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Sqlite3_int64) int32 { /* sqlite3.c:27389:16: */ +func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Sqlite3_int64) int32 { /* sqlite3.c:27669:16: */ _ = xCallback _ = pArg _ = iThreshold @@ -14068,7 +14068,7 @@ func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThre // // If the hard heap limit is enabled, then the soft heap limit cannot // be disabled nor raised above the hard heap limit. -func Xsqlite3_soft_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27412:26: */ +func Xsqlite3_soft_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27692:26: */ var priorLimit Sqlite3_int64 var excess Sqlite3_int64 var nUsed Sqlite3_int64 @@ -14096,7 +14096,7 @@ func Xsqlite3_soft_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { return priorLimit } -func Xsqlite3_soft_heap_limit(tls *libc.TLS, n int32) { /* sqlite3.c:27437:17: */ +func Xsqlite3_soft_heap_limit(tls *libc.TLS, n int32) { /* sqlite3.c:27717:17: */ if n < 0 { n = 0 } @@ -14113,7 +14113,7 @@ func Xsqlite3_soft_heap_limit(tls *libc.TLS, n int32) { /* sqlite3.c:27437:17: * // Setting the hard heap limit will also activate the soft heap limit // and constrain the soft heap limit to be no more than the hard heap // limit. -func Xsqlite3_hard_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27454:26: */ +func Xsqlite3_hard_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27734:26: */ var priorLimit Sqlite3_int64 var rc int32 = Xsqlite3_initialize(tls) if rc != 0 { @@ -14132,7 +14132,7 @@ func Xsqlite3_hard_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { } // Initialize the memory allocation subsystem. -func Xsqlite3MallocInit(tls *libc.TLS) int32 { /* sqlite3.c:27476:20: */ +func Xsqlite3MallocInit(tls *libc.TLS) int32 { /* sqlite3.c:27756:20: */ var rc int32 if Xsqlite3Config.Fm.FxMalloc == uintptr(0) { Xsqlite3MemSetDefault(tls) @@ -14154,12 +14154,12 @@ func Xsqlite3MallocInit(tls *libc.TLS) int32 { /* sqlite3.c:27476:20: */ // 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 Xsqlite3HeapNearlyFull(tls *libc.TLS) int32 { /* sqlite3.c:27498:20: */ +func Xsqlite3HeapNearlyFull(tls *libc.TLS) int32 { /* sqlite3.c:27778:20: */ return libc.AtomicLoadNInt32((uintptr(unsafe.Pointer(&mem0)) + 24 /* &.nearlyFull */), 0) } // Deinitialize the memory allocation subsystem. -func Xsqlite3MallocEnd(tls *libc.TLS) { /* sqlite3.c:27505:21: */ +func Xsqlite3MallocEnd(tls *libc.TLS) { /* sqlite3.c:27785:21: */ if Xsqlite3Config.Fm.FxShutdown != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 48 /* &.xShutdown */))))(tls, Xsqlite3Config.Fm.FpAppData) } @@ -14167,7 +14167,7 @@ func Xsqlite3MallocEnd(tls *libc.TLS) { /* sqlite3.c:27505:21: */ } // Return the amount of memory currently checked out. -func Xsqlite3_memory_used(tls *libc.TLS) Sqlite3_int64 { /* sqlite3.c:27515:26: */ +func Xsqlite3_memory_used(tls *libc.TLS) Sqlite3_int64 { /* sqlite3.c:27795:26: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -14182,7 +14182,7 @@ func Xsqlite3_memory_used(tls *libc.TLS) Sqlite3_int64 { /* sqlite3.c:27515:26: // 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 *libc.TLS, resetFlag int32) Sqlite3_int64 { /* sqlite3.c:27526:26: */ +func Xsqlite3_memory_highwater(tls *libc.TLS, resetFlag int32) Sqlite3_int64 { /* sqlite3.c:27806:26: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -14195,7 +14195,7 @@ func Xsqlite3_memory_highwater(tls *libc.TLS, resetFlag int32) Sqlite3_int64 { / } // Trigger the alarm -func sqlite3MallocAlarm(tls *libc.TLS, nByte int32) { /* sqlite3.c:27535:13: */ +func sqlite3MallocAlarm(tls *libc.TLS, nByte int32) { /* sqlite3.c:27815:13: */ if mem0.FalarmThreshold <= int64(0) { return } @@ -14206,7 +14206,7 @@ func sqlite3MallocAlarm(tls *libc.TLS, nByte int32) { /* sqlite3.c:27535:13: */ // Do a memory allocation with statistics and alarms. Assume the // lock is already held. -func mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) { /* sqlite3.c:27546:13: */ +func mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) { /* sqlite3.c:27826:13: */ var p uintptr var nFull int32 @@ -14249,7 +14249,7 @@ func mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) { /* sqlite3.c:27546:13 // Allocate memory. This routine is like sqlite3_malloc() except that it // assumes the memory subsystem has already been initialized. -func Xsqlite3Malloc(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:27595:21: */ +func Xsqlite3Malloc(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:27875:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -14276,7 +14276,7 @@ func Xsqlite3Malloc(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:27595:21: */ // 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 *libc.TLS, n int32) uintptr { /* sqlite3.c:27620:17: */ +func Xsqlite3_malloc(tls *libc.TLS, n int32) uintptr { /* sqlite3.c:27900:17: */ if Xsqlite3_initialize(tls) != 0 { return uintptr(0) } @@ -14286,7 +14286,7 @@ func Xsqlite3_malloc(tls *libc.TLS, n int32) uintptr { /* sqlite3.c:27620:17: */ return Xsqlite3Malloc(tls, uint64(n)) } -func Xsqlite3_malloc64(tls *libc.TLS, n Sqlite3_uint64) uintptr { /* sqlite3.c:27626:17: */ +func Xsqlite3_malloc64(tls *libc.TLS, n Sqlite3_uint64) uintptr { /* sqlite3.c:27906:17: */ if Xsqlite3_initialize(tls) != 0 { return uintptr(0) } @@ -14294,25 +14294,25 @@ func Xsqlite3_malloc64(tls *libc.TLS, n Sqlite3_uint64) uintptr { /* sqlite3.c:2 } // TRUE if p is a lookaside memory allocation from db -func isLookaside(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27637:12: */ +func isLookaside(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27917:12: */ return (libc.Bool32((Uptr((p)) >= Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart))) && (Uptr((p)) < Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd))))) } // Return the size of a memory allocation previously obtained from // sqlite3Malloc() or sqlite3_malloc(). -func Xsqlite3MallocSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:27648:20: */ +func Xsqlite3MallocSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:27928:20: */ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 24 /* &.xSize */))))(tls, p) } -func lookasideMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27652:12: */ +func lookasideMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27932:12: */ if p < (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle { return int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue) } return LOOKASIDE_SMALL } -func Xsqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27659:20: */ +func Xsqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27939:20: */ if db != 0 { if (Uptr(p)) < Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd)) { @@ -14329,7 +14329,7 @@ func Xsqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlit return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 24 /* &.xSize */))))(tls, p) } -func Xsqlite3_msize(tls *libc.TLS, p uintptr) Sqlite3_uint64 { /* sqlite3.c:27688:27: */ +func Xsqlite3_msize(tls *libc.TLS, p uintptr) Sqlite3_uint64 { /* sqlite3.c:27968:27: */ if p != 0 { return uint64((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 24 /* &.xSize */))))(tls, p)) @@ -14338,7 +14338,7 @@ func Xsqlite3_msize(tls *libc.TLS, p uintptr) Sqlite3_uint64 { /* sqlite3.c:2768 } // Free memory previously obtained from sqlite3Malloc(). -func Xsqlite3_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:27697:17: */ +func Xsqlite3_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:27977:17: */ if p == uintptr(0) { return } // IMP: R-49053-54554 @@ -14356,14 +14356,14 @@ func Xsqlite3_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:27697:17: */ // Add the size of memory allocation "p" to the count in // *db->pnBytesFreed. -func measureAllocationSize(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27716:29: */ +func measureAllocationSize(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27996:29: */ *(*int32)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed)) += (Xsqlite3DbMallocSize(tls, db, p)) } // 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 Xsqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27725:21: */ +func Xsqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:28005:21: */ if db != 0 { if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed != 0 { @@ -14389,7 +14389,7 @@ func Xsqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27725 Xsqlite3_free(tls, p) } -func Xsqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27762:21: */ +func Xsqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:28042:21: */ if p != 0 { Xsqlite3DbFreeNN(tls, db, p) @@ -14397,7 +14397,7 @@ func Xsqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27762:2 } // Change the size of an existing memory allocation -func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlite3.c:27770:21: */ +func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlite3.c:28050:21: */ var nOld int32 var nNew int32 var nDiff int32 @@ -14422,11 +14422,16 @@ func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlit if nOld == nNew { pNew = pOld } else if Xsqlite3Config.FbMemstat != 0 { + var nUsed Sqlite3_int64 Xsqlite3_mutex_enter(tls, mem0.Fmutex) Xsqlite3StatusHighwater(tls, SQLITE_STATUS_MALLOC_SIZE, int32(nBytes)) nDiff = (nNew - nOld) - if (nDiff > 0) && (Xsqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED) >= (mem0.FalarmThreshold - Sqlite3_int64(nDiff))) { + if (nDiff > 0) && ((libc.AssignInt64(&nUsed, Xsqlite3StatusValue(tls, SQLITE_STATUS_MEMORY_USED))) >= (mem0.FalarmThreshold - Sqlite3_int64(nDiff))) { sqlite3MallocAlarm(tls, nDiff) + if (mem0.FhardLimit > int64(0)) && (nUsed >= (mem0.FhardLimit - Sqlite3_int64(nDiff))) { + Xsqlite3_mutex_leave(tls, mem0.Fmutex) + return uintptr(0) + } } pNew = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 16 /* &.xRealloc */))))(tls, pOld, nNew) if (pNew == uintptr(0)) && (mem0.FalarmThreshold > int64(0)) { @@ -14447,7 +14452,7 @@ func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlit // The public interface to sqlite3Realloc. Make sure that the memory // subsystem is initialized prior to invoking sqliteRealloc. -func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) uintptr { /* sqlite3.c:27824:17: */ +func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) uintptr { /* sqlite3.c:28109:17: */ if Xsqlite3_initialize(tls) != 0 { return uintptr(0) } @@ -14457,7 +14462,7 @@ func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) uintptr { /* sqlite3 return Xsqlite3Realloc(tls, pOld, uint64(n)) } -func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Sqlite3_uint64) uintptr { /* sqlite3.c:27831:17: */ +func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Sqlite3_uint64) uintptr { /* sqlite3.c:28116:17: */ if Xsqlite3_initialize(tls) != 0 { return uintptr(0) } @@ -14465,7 +14470,7 @@ func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Sqlite3_uint64) uintptr { } // Allocate and zero memory. -func Xsqlite3MallocZero(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:27842:21: */ +func Xsqlite3MallocZero(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:28127:21: */ var p uintptr = Xsqlite3Malloc(tls, n) if p != 0 { libc.Xmemset(tls, p, 0, Size_t(n)) @@ -14475,7 +14480,7 @@ func Xsqlite3MallocZero(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:27842:21: * // Allocate and zero memory. If the allocation fails, make // the mallocFailed flag in the connection pointer. -func Xsqlite3DbMallocZero(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27854:21: */ +func Xsqlite3DbMallocZero(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28139:21: */ var p uintptr p = Xsqlite3DbMallocRaw(tls, db, n) @@ -14487,7 +14492,7 @@ func Xsqlite3DbMallocZero(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3 // Finish the work of sqlite3DbMallocRawNN for the unusual and // slower case when the allocation cannot be fulfilled using lookaside. -func dbMallocRawFinish(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27866:29: */ +func dbMallocRawFinish(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28151:29: */ var p uintptr p = Xsqlite3Malloc(tls, n) @@ -14518,7 +14523,7 @@ func dbMallocRawFinish(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c: // // The sqlite3MallocRawNN() variant guarantees that the "db" parameter is // not a NULL pointer. -func Xsqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27898:21: */ +func Xsqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28183:21: */ var p uintptr if db != 0 { return Xsqlite3DbMallocRawNN(tls, db, n) @@ -14528,45 +14533,45 @@ func Xsqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3. return p } -func Xsqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27905:21: */ +func Xsqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:28190:21: */ var pBuf uintptr if n > U64((*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz) { if !(int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable) != 0) { - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + 1*4))++ + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */) + 1*4))++ } else if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return uintptr(0) } return dbMallocRawFinish(tls, db, n) } - if n <= LOOKASIDE_SMALL { + if n <= uint64(LOOKASIDE_SMALL) { if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree)) != uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */)))++ + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */)))++ return pBuf } else if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit)) != uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */)))++ + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */)))++ return pBuf } } if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree)) != uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */)))++ + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */)))++ return pBuf } else if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit)) != uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */)))++ + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */)))++ return pBuf } else { - *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + 2*4))++ + *(*U32)(unsafe.Pointer((db + 408 /* &.lookaside */ + 16 /* &.anStat */) + 2*4))++ } return dbMallocRawFinish(tls, db, n) } // 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 Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:27961:21: */ +func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28246:21: */ if p == uintptr(0) { return Xsqlite3DbMallocRawNN(tls, db, n) @@ -14574,7 +14579,7 @@ func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* if (Uptr(p)) < Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd) { if (Uptr(p)) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle) { - if n <= LOOKASIDE_SMALL { + if n <= uint64(LOOKASIDE_SMALL) { return p } } else if (Uptr(p)) >= Uptr((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) { @@ -14586,7 +14591,7 @@ func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* return dbReallocFinish(tls, db, p, n) } -func dbReallocFinish(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:27977:29: */ +func dbReallocFinish(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28262:29: */ var pNew uintptr = uintptr(0) if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -14610,7 +14615,7 @@ func dbReallocFinish(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* s // Attempt to reallocate p. If the reallocation fails, then free p // and set the mallocFailed flag in the database connection. -func Xsqlite3DbReallocOrFree(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28007:21: */ +func Xsqlite3DbReallocOrFree(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28292:21: */ var pNew uintptr pNew = Xsqlite3DbRealloc(tls, db, p, n) if !(pNew != 0) { @@ -14624,7 +14629,7 @@ func Xsqlite3DbReallocOrFree(tls *libc.TLS, db uintptr, p uintptr, n U64) uintpt // 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 Xsqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) uintptr { /* sqlite3.c:28023:21: */ +func Xsqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) uintptr { /* sqlite3.c:28308:21: */ var zNew uintptr var n Size_t if z == uintptr(0) { @@ -14638,7 +14643,7 @@ func Xsqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) uintptr { /* sqlite3 return zNew } -func Xsqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n U64) uintptr { /* sqlite3.c:28036:21: */ +func Xsqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n U64) uintptr { /* sqlite3.c:28321:21: */ var zNew uintptr if z != 0 { @@ -14656,7 +14661,7 @@ func Xsqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n U64) uintptr { /* // The text between zStart and zEnd represents a phrase within a larger // SQL statement. Make a copy of this phrase in space obtained form // sqlite3DbMalloc(). Omit leading and trailing whitespace. -func Xsqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:28054:21: */ +func Xsqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:28339:21: */ var n int32 for (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zStart)))]) & 0x01) != 0 { zStart++ @@ -14669,7 +14674,7 @@ func Xsqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) } // Free any prior content in *pz and replace it with a copy of zNew. -func Xsqlite3SetString(tls *libc.TLS, pz uintptr, db uintptr, zNew uintptr) { /* sqlite3.c:28065:21: */ +func Xsqlite3SetString(tls *libc.TLS, pz uintptr, db uintptr, zNew uintptr) { /* sqlite3.c:28350:21: */ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pz))) *(*uintptr)(unsafe.Pointer(pz)) = Xsqlite3DbStrDup(tls, db, zNew) } @@ -14678,11 +14683,11 @@ func Xsqlite3SetString(tls *libc.TLS, pz uintptr, db uintptr, zNew uintptr) { /* // has happened. This routine will set db->mallocFailed, and also // temporarily disable the lookaside memory allocator and interrupt // any running VDBEs. -func Xsqlite3OomFault(tls *libc.TLS, db uintptr) { /* sqlite3.c:28076:21: */ +func Xsqlite3OomFault(tls *libc.TLS, db uintptr) { /* sqlite3.c:28361:21: */ if (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).FbBenignMalloc) == 0) { (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed = U8(1) if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 0 { - libc.AtomicStoreNInt32((db + 392 /* &.u1 */ /* &.isInterrupted */), int32(1), 0) + libc.AtomicStoreNInt32((db + 400 /* &.u1 */ /* &.isInterrupted */), int32(1), 0) } (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0) @@ -14697,10 +14702,10 @@ func Xsqlite3OomFault(tls *libc.TLS, db uintptr) { /* sqlite3.c:28076:21: */ // // The memory allocator is not restarted if there are running // VDBEs. -func Xsqlite3OomClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:28096:21: */ +func Xsqlite3OomClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:28381:21: */ if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0) { (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed = U8(0) - libc.AtomicStoreNInt32((db + 392 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) + libc.AtomicStoreNInt32((db + 400 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable-- (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 { @@ -14712,11 +14717,14 @@ func Xsqlite3OomClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:28096:21: */ } } -// Take actions at the end of an API call to indicate an OOM error -func apiOomError(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:28108:28: */ - Xsqlite3OomClear(tls, db) - Xsqlite3Error(tls, db, SQLITE_NOMEM) - return SQLITE_NOMEM +// Take actions at the end of an API call to deal with error codes. +func apiHandleError(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28393:28: */ + if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || (rc == (SQLITE_IOERR | (int32(12) << 8))) { + Xsqlite3OomClear(tls, db) + Xsqlite3Error(tls, db, SQLITE_NOMEM) + return SQLITE_NOMEM + } + return (rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask) } // This function must be called before exiting any API function (i.e. @@ -14729,13 +14737,13 @@ func apiOomError(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:28108:28: */ // // If an OOM as occurred, then the connection error-code (the value // returned by sqlite3_errcode()) is set to SQLITE_NOMEM. -func Xsqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28126:20: */ +func Xsqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28414:20: */ // If the db handle must hold the connection handle mutex here. // Otherwise the read (and possible write) of db->mallocFailed // is unsafe, as is the call to sqlite3Error(). - if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || (rc == (SQLITE_IOERR | (int32(12) << 8))) { - return apiOomError(tls, db) + if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || (rc != 0) { + return apiHandleError(tls, db, rc) } return (rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask) } @@ -14758,7 +14766,7 @@ func Xsqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:2 // The rest are extensions, not normally found in printf() // An "etByte" is an 8-bit unsigned value. -type EtByte = uint8 /* sqlite3.c:28184:23 */ +type EtByte = uint8 /* sqlite3.c:28472:23 */ // Each builtin conversion character (ex: the 'd' in "%d") is described // by an instance of the following structure @@ -14769,51 +14777,51 @@ type et_info = struct { Ftype EtByte Fcharset EtByte Fprefix EtByte -} /* sqlite3.c:28190:9 */ +} /* sqlite3.c:28478:9 */ // Each builtin conversion character (ex: the 'd' in "%d") is described // by an instance of the following structure -type Et_info = et_info /* sqlite3.c:28197:3 */ +type Et_info = et_info /* sqlite3.c:28485:3 */ // Allowed values for et_info.flags // The following table is searched linearly, so it is good to put the // most frequently used conversion types first. -var aDigits = *(*[33]int8)(unsafe.Pointer(ts + 750 /* "0123456789ABCDEF..." */)) /* sqlite3.c:28210:19 */ -var aPrefix = *(*[7]int8)(unsafe.Pointer(ts + 783 /* "-x0\x00X0" */)) /* sqlite3.c:28211:19 */ +var aDigits = *(*[33]int8)(unsafe.Pointer(ts + 750 /* "0123456789ABCDEF..." */)) /* sqlite3.c:28498:19 */ +var aPrefix = *(*[7]int8)(unsafe.Pointer(ts + 783 /* "-x0\x00X0" */)) /* sqlite3.c:28499:19 */ var fmtinfo = [23]Et_info{ - {Ffmttype: int8('d'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtDECIMAL}, - {Ffmttype: int8('s'), Fflags: EtByte(4), Ftype: EtSTRING}, - {Ffmttype: int8('g'), Fflags: EtByte(1), Ftype: EtGENERIC, Fcharset: EtByte(30)}, - {Ffmttype: int8('z'), Fflags: EtByte(4), Ftype: EtDYNSTRING}, - {Ffmttype: int8('q'), Fflags: EtByte(4), Ftype: EtSQLESCAPE}, - {Ffmttype: int8('Q'), Fflags: EtByte(4), Ftype: EtSQLESCAPE2}, - {Ffmttype: int8('w'), Fflags: EtByte(4), Ftype: EtSQLESCAPE3}, - {Ffmttype: int8('c'), Ftype: EtCHARX}, + {Ffmttype: int8('d'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtDECIMAL)}, + {Ffmttype: int8('s'), Fflags: EtByte(4), Ftype: EtByte(EtSTRING)}, + {Ffmttype: int8('g'), Fflags: EtByte(1), Ftype: EtByte(EtGENERIC), Fcharset: EtByte(30)}, + {Ffmttype: int8('z'), Fflags: EtByte(4), Ftype: EtByte(EtDYNSTRING)}, + {Ffmttype: int8('q'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE)}, + {Ffmttype: int8('Q'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE2)}, + {Ffmttype: int8('w'), Fflags: EtByte(4), Ftype: EtByte(EtSQLESCAPE3)}, + {Ffmttype: int8('c'), Ftype: EtByte(EtCHARX)}, {Ffmttype: int8('o'), Fbase: EtByte(8), Fprefix: EtByte(2)}, - {Ffmttype: int8('u'), Fbase: EtByte(10), Ftype: EtDECIMAL}, + {Ffmttype: int8('u'), Fbase: EtByte(10), Ftype: EtByte(EtDECIMAL)}, {Ffmttype: int8('x'), Fbase: EtByte(16), Fcharset: EtByte(16), Fprefix: EtByte(1)}, {Ffmttype: int8('X'), Fbase: EtByte(16), Fprefix: EtByte(4)}, - {Ffmttype: int8('f'), Fflags: EtByte(1), Ftype: EtFLOAT}, - {Ffmttype: int8('e'), Fflags: EtByte(1), Ftype: EtEXP, Fcharset: EtByte(30)}, - {Ffmttype: int8('E'), Fflags: EtByte(1), Ftype: EtEXP, Fcharset: EtByte(14)}, - {Ffmttype: int8('G'), Fflags: EtByte(1), Ftype: EtGENERIC, Fcharset: EtByte(14)}, - {Ffmttype: int8('i'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtDECIMAL}, - {Ffmttype: int8('n'), Ftype: EtSIZE}, - {Ffmttype: int8('%'), Ftype: EtPERCENT}, - {Ffmttype: int8('p'), Fbase: EtByte(16), Ftype: EtPOINTER, Fprefix: EtByte(1)}, + {Ffmttype: int8('f'), Fflags: EtByte(1), Ftype: EtByte(EtFLOAT)}, + {Ffmttype: int8('e'), Fflags: EtByte(1), Ftype: EtByte(EtEXP), Fcharset: EtByte(30)}, + {Ffmttype: int8('E'), Fflags: EtByte(1), Ftype: EtByte(EtEXP), Fcharset: EtByte(14)}, + {Ffmttype: int8('G'), Fflags: EtByte(1), Ftype: EtByte(EtGENERIC), Fcharset: EtByte(14)}, + {Ffmttype: int8('i'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtDECIMAL)}, + {Ffmttype: int8('n'), Ftype: EtByte(EtSIZE)}, + {Ffmttype: int8('%'), Ftype: EtByte(EtPERCENT)}, + {Ffmttype: int8('p'), Fbase: EtByte(16), Ftype: EtByte(EtPOINTER), Fprefix: EtByte(1)}, // All the rest are undocumented and are for internal use only - {Ffmttype: int8('T'), Ftype: EtTOKEN}, - {Ffmttype: int8('S'), Ftype: EtSRCLIST}, - {Ffmttype: int8('r'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtORDINAL}, -} /* sqlite3.c:28212:22 */ + {Ffmttype: int8('T'), Ftype: EtByte(EtTOKEN)}, + {Ffmttype: int8('S'), Ftype: EtByte(EtSRCLIST)}, + {Ffmttype: int8('r'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(EtORDINAL)}, +} /* sqlite3.c:28500:22 */ // Floating point constants used for rounding var arRound = [10]float64{ 5.0e-01, 5.0e-02, 5.0e-03, 5.0e-04, 5.0e-05, 5.0e-06, 5.0e-07, 5.0e-08, 5.0e-09, 5.0e-10, -} /* sqlite3.c:28243:21 */ +} /* sqlite3.c:28531:21 */ // If SQLITE_OMIT_FLOATING_POINT is defined, then none of the floating point // conversions will work. @@ -14828,7 +14836,7 @@ var arRound = [10]float64{ // 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 *libc.TLS, val uintptr, cnt uintptr) int8 { /* sqlite3.c:28266:13: */ +func et_getdigit(tls *libc.TLS, val uintptr, cnt uintptr) int8 { /* sqlite3.c:28554:13: */ var digit int32 var d float64 if (*(*int32)(unsafe.Pointer(cnt))) <= 0 { @@ -14843,7 +14851,7 @@ func et_getdigit(tls *libc.TLS, val uintptr, cnt uintptr) int8 { /* sqlite3.c:28 } // Set the StrAccum object to an error mode. -func setStrAccumError(tls *libc.TLS, p uintptr, eError U8) { /* sqlite3.c:28282:13: */ +func setStrAccumError(tls *libc.TLS, p uintptr, eError U8) { /* sqlite3.c:28570:13: */ (*StrAccum)(unsafe.Pointer(p)).FaccError = eError if (*StrAccum)(unsafe.Pointer(p)).FmxAlloc != 0 { @@ -14855,21 +14863,21 @@ func setStrAccumError(tls *libc.TLS, p uintptr, eError U8) { /* sqlite3.c:28282: } // Extra argument values from a PrintfArguments object -func getIntArg(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:28292:22: */ +func getIntArg(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:28580:22: */ if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed { return int64(0) } return Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(libc.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*8))) } -func getDoubleArg(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:28296:15: */ +func getDoubleArg(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:28584:15: */ if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed { return 0.0 } return Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(libc.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*8))) } -func getTextArg(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:28300:13: */ +func getTextArg(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:28588:13: */ if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed { return uintptr(0) } @@ -14883,18 +14891,18 @@ func getTextArg(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:28300:13: */ // Do the size check before the memory allocation to prevent rogue // SQL from requesting large allocations using the precision or width // field of the printf() function. -func printfTempBuf(tls *libc.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /* sqlite3.c:28314:13: */ +func printfTempBuf(tls *libc.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /* sqlite3.c:28602:13: */ var z uintptr if (*Sqlite3_str)(unsafe.Pointer(pAccum)).FaccError != 0 { return uintptr(0) } if (n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc)) && (n > Sqlite3_int64((*Sqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc)) { - setStrAccumError(tls, pAccum, SQLITE_TOOBIG) + setStrAccumError(tls, pAccum, uint8(SQLITE_TOOBIG)) return uintptr(0) } z = Xsqlite3DbMallocRaw(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, uint64(n)) if z == uintptr(0) { - setStrAccumError(tls, pAccum, SQLITE_NOMEM) + setStrAccumError(tls, pAccum, uint8(SQLITE_NOMEM)) } return z } @@ -14905,7 +14913,7 @@ func printfTempBuf(tls *libc.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /* // Hard limit on the precision of floating-point conversions. // Render a string given by "fmt" into the StrAccum object. -func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_list) { /* sqlite3.c:28347:17: */ +func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_list) { /* sqlite3.c:28635:17: */ bp := tls.Alloc(100) defer tls.Free(100) @@ -14982,7 +14990,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_lis var pSrc uintptr var k1 int32 var pItem uintptr - xtype = EtINVALID + xtype = EtByte(EtINVALID) zExtra = uintptr(0) pArgList = uintptr(0) // Conversion buffer @@ -15248,7 +15256,7 @@ __14: // Fetch the info entry for the field infop = (uintptr(unsafe.Pointer(&fmtinfo))) - xtype = EtINVALID + xtype = EtByte(EtINVALID) idx = 0 __54: if !(idx < (int32(uint64(unsafe.Sizeof(fmtinfo)) / uint64(unsafe.Sizeof(Et_info{}))))) { @@ -15370,15 +15378,9 @@ __80: if !(v < int64(0)) { goto __85 } - if !(v == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))) { - goto __87 - } - longvalue = (U64((uint64(1))) << 63) - goto __88 -__87: - longvalue = Sqlite_uint64(-v) -__88: - ; + + longvalue = Sqlite_uint64(^v) + longvalue++ prefix = int8('-') goto __86 __85: @@ -15389,162 +15391,162 @@ __86: goto __78 __77: if !(bArgList != 0) { - goto __89 + goto __87 } longvalue = U64(getIntArg(tls, pArgList)) - goto __90 -__89: + goto __88 +__87: if !(flag_long != 0) { - goto __91 + goto __89 } if !(int32(flag_long) == 2) { - goto __93 + goto __91 } longvalue = Sqlite_uint64(libc.VaUint64(&ap)) - goto __94 -__93: - longvalue = Sqlite_uint64(libc.VaUint64(&ap)) -__94: - ; goto __92 __91: - longvalue = Sqlite_uint64(libc.VaUint32(&ap)) + longvalue = Sqlite_uint64(libc.VaUint64(&ap)) __92: ; + goto __90 +__89: + longvalue = Sqlite_uint64(libc.VaUint32(&ap)) __90: ; +__88: + ; prefix = int8(0) __78: ; if !(longvalue == uint64(0)) { - goto __95 + goto __93 } flag_alternateform = EtByte(0) -__95: +__93: ; if !((flag_zeropad != 0) && (precision < (width - (libc.Bool32(int32(prefix) != 0))))) { - goto __96 + goto __94 } precision = (width - (libc.Bool32(int32(prefix) != 0))) -__96: +__94: ; if !(precision < ((SQLITE_PRINT_BUF_SIZE - 10) - (SQLITE_PRINT_BUF_SIZE / 3))) { - goto __97 + goto __95 } nOut = SQLITE_PRINT_BUF_SIZE zOut = bp /* &buf[0] */ - goto __98 -__97: + goto __96 +__95: n = (U64(precision) + uint64(10)) if !(cThousand != 0) { - goto __99 + goto __97 } n = n + (U64(precision / 3)) -__99: +__97: ; zOut = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, int64(n))) if !(zOut == uintptr(0)) { - goto __100 + goto __98 } return -__100: +__98: ; nOut = int32(n) -__98: +__96: ; bufpt = (zOut + uintptr((nOut - 1))) if !(int32(xtype) == EtORDINAL) { - goto __101 + goto __99 } x = (int32(longvalue % uint64(10))) if !((x >= 4) || (((longvalue / uint64(10)) % uint64(10)) == uint64(1))) { - goto __102 + goto __100 } x = 0 -__102: +__100: ; *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = zOrd[((x * 2) + 1)] *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = zOrd[(x * 2)] -__101: +__99: ; cset = (uintptr(unsafe.Pointer(&aDigits)) + uintptr((*Et_info)(unsafe.Pointer(infop)).Fcharset)) base = (*Et_info)(unsafe.Pointer(infop)).Fbase -__103: // Convert to ascii +__101: // Convert to ascii *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = *(*int8)(unsafe.Pointer(cset + uintptr((longvalue % Sqlite_uint64(base))))) longvalue = (longvalue / Sqlite_uint64(base)) - goto __104 -__104: + goto __102 +__102: if longvalue > uint64(0) { - goto __103 + goto __101 } - goto __105 -__105: + goto __103 +__103: ; length = (int32((int64((zOut + uintptr((nOut - 1)))) - int64(bufpt)) / 1)) -__106: +__104: if !(precision > length) { - goto __107 + goto __105 } *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = int8('0') // Zero pad length++ - goto __106 -__107: + goto __104 +__105: ; if !(cThousand != 0) { - goto __108 + goto __106 } nn = ((length - 1) / 3) // Number of "," to insert ix = (((length - 1) % 3) + 1) bufpt -= uintptr(nn) idx = 0 -__109: +__107: if !(nn > 0) { - goto __111 + goto __109 } *(*int8)(unsafe.Pointer(bufpt + uintptr(idx))) = *(*int8)(unsafe.Pointer(bufpt + uintptr((idx + nn)))) ix-- if !(ix == 0) { - goto __112 + goto __110 } *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PreIncInt32(&idx, 1)))) = int8(cThousand) nn-- ix = 3 -__112: - ; - goto __110 __110: - idx++ - goto __109 - goto __111 -__111: ; + goto __108 __108: + idx++ + goto __107 + goto __109 +__109: + ; +__106: ; if !(prefix != 0) { - goto __113 + goto __111 } *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = prefix -__113: +__111: ; // Add sign if !((flag_alternateform != 0) && ((*Et_info)(unsafe.Pointer(infop)).Fprefix != 0)) { - goto __114 + goto __112 } pre = (uintptr(unsafe.Pointer(&aPrefix)) + uintptr((*Et_info)(unsafe.Pointer(infop)).Fprefix)) -__115: +__113: if !((int32(libc.AssignInt8(&x1, *(*int8)(unsafe.Pointer(pre))))) != 0) { - goto __117 + goto __115 } *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = x1 - goto __116 -__116: - pre++ - goto __115 - goto __117 -__117: - ; + goto __114 __114: + pre++ + goto __113 + goto __115 +__115: + ; +__112: ; length = (int32((int64((zOut + uintptr((nOut - 1)))) - int64(bufpt)) / 1)) goto __58 @@ -15552,184 +15554,184 @@ __63: __64: __65: if !(bArgList != 0) { - goto __118 + goto __116 } *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) = getDoubleArg(tls, pArgList) - goto __119 -__118: + goto __117 +__116: *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) = float64(libc.VaFloat64(&ap)) -__119: +__117: ; if !(precision < 0) { - goto __120 + goto __118 } precision = 6 -__120: +__118: ; // Set default precision if !(precision > SQLITE_FP_PRECISION_LIMIT) { - goto __121 + goto __119 } precision = SQLITE_FP_PRECISION_LIMIT -__121: +__119: ; if !(*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) < 0.0) { - goto __122 + goto __120 } *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) = -*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) prefix = int8('-') - goto __123 -__122: + goto __121 +__120: prefix = int8(flag_prefix) -__123: +__121: ; if !((int32(xtype) == EtGENERIC) && (precision > 0)) { - goto __124 + goto __122 } precision-- -__124: +__122: ; idx = (precision & 0xfff) rounder = arRound[(idx % 10)] -__125: +__123: if !(idx >= 10) { - goto __126 + goto __124 } rounder = rounder * (1.0e-10) idx = idx - (10) - goto __125 -__126: + goto __123 +__124: ; if !(int32(xtype) == EtFLOAT) { - goto __127 + goto __125 } *(*float64)(unsafe.Pointer(bp + 80 /* rx */)) = *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) libc.Xmemcpy(tls, bp+72 /* &u */, bp+80 /* &rx */, uint64(unsafe.Sizeof(Sqlite3_uint64(0)))) ex = (-1023 + (int32((*(*Sqlite3_uint64)(unsafe.Pointer(bp + 72 /* u */)) >> 52) & uint64(0x7ff)))) if !((precision + (ex / 3)) < 15) { - goto __128 + goto __126 } rounder = rounder + (*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) * 3e-16) -__128: +__126: ; *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) += rounder -__127: +__125: ; // Normalize realvalue to within 10.0 > realvalue >= 1.0 exp = 0 if !(Xsqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */))) != 0) { - goto __129 + goto __127 } bufpt = ts + 792 /* "NaN" */ length = 3 goto __58 -__129: +__127: ; if !(*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) > 0.0) { - goto __130 + goto __128 } scale = 1.0 -__131: +__129: if !((*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) >= (1e100 * scale)) && (exp <= 350)) { - goto __132 + goto __130 } scale = scale * (1e100) exp = exp + (100) + goto __129 +__130: + ; +__131: + if !((*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) >= (1e10 * scale)) && (exp <= 350)) { + goto __132 + } + scale = scale * (1e10) + exp = exp + (10) goto __131 __132: ; __133: - if !((*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) >= (1e10 * scale)) && (exp <= 350)) { - goto __134 - } - scale = scale * (1e10) - exp = exp + (10) - goto __133 -__134: - ; -__135: if !((*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) >= (10.0 * scale)) && (exp <= 350)) { - goto __136 + goto __134 } scale = scale * (10.0) exp++ - goto __135 -__136: + goto __133 +__134: ; *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) /= scale -__137: +__135: if !(*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) < 1e-8) { - goto __138 + goto __136 } *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) *= 1e8 exp = exp - (8) - goto __137 -__138: + goto __135 +__136: ; -__139: +__137: if !(*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) < 1.0) { - goto __140 + goto __138 } *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) *= 10.0 exp-- - goto __139 -__140: + goto __137 +__138: ; if !(exp > 350) { - goto __141 + goto __139 } bufpt = bp /* &buf[0] */ *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = prefix libc.Xmemcpy(tls, (bp /* &buf[0] */ + uintptr((libc.Bool32(int32(prefix) != 0)))), ts+796 /* "Inf" */, uint64(4)) length = (3 + (libc.Bool32(int32(prefix) != 0))) goto __58 -__141: +__139: ; -__130: +__128: ; bufpt = bp /* &buf[0] */ // If the field type is etGENERIC, then convert to either etEXP // or etFLOAT, as appropriate. if !(int32(xtype) != EtFLOAT) { - goto __142 + goto __140 } *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) += rounder if !(*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) >= 10.0) { - goto __143 + goto __141 } *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) *= 0.1 exp++ -__143: +__141: ; -__142: +__140: ; if !(int32(xtype) == EtGENERIC) { - goto __144 + goto __142 } flag_rtz = libc.BoolUint8(!(flag_alternateform != 0)) if !((exp < -4) || (exp > precision)) { - goto __146 + goto __144 } - xtype = EtEXP - goto __147 -__146: - precision = (precision - exp) - xtype = EtFLOAT -__147: - ; + xtype = EtByte(EtEXP) goto __145 __144: - flag_rtz = flag_altform2 + precision = (precision - exp) + xtype = EtByte(EtFLOAT) __145: + ; + goto __143 +__142: + flag_rtz = flag_altform2 +__143: ; if !(int32(xtype) == EtEXP) { - goto __148 + goto __146 } e2 = 0 - goto __149 -__148: + goto __147 +__146: e2 = exp -__149: +__147: ; // Size of a temporary buffer needed szBufNeeded = ((((func() int64 { @@ -15738,17 +15740,17 @@ __149: } return int64(0) }()) + I64(precision)) + I64(width)) + int64(15)) - if !(szBufNeeded > SQLITE_PRINT_BUF_SIZE) { - goto __150 + if !(szBufNeeded > int64(SQLITE_PRINT_BUF_SIZE)) { + goto __148 } bufpt = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, szBufNeeded)) if !(bufpt == uintptr(0)) { - goto __151 + goto __149 } return -__151: +__149: ; -__150: +__148: ; zOut = bufpt @@ -15761,120 +15763,120 @@ __150: }()) | int32(flag_alternateform)) | int32(flag_altform2))) // The sign in front of the number if !(prefix != 0) { - goto __152 + goto __150 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = prefix -__152: +__150: ; // Digits prior to the decimal point if !(e2 < 0) { - goto __153 + goto __151 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('0') - goto __154 -__153: + goto __152 +__151: ; -__155: +__153: if !(e2 >= 0) { - goto __157 + goto __155 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = et_getdigit(tls, bp+88 /* &realvalue */, bp+96 /* &nsd */) - goto __156 -__156: - e2-- - goto __155 - goto __157 -__157: - ; + goto __154 __154: + e2-- + goto __153 + goto __155 +__155: + ; +__152: ; // The decimal point if !(flag_dp != 0) { - goto __158 + goto __156 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('.') -__158: +__156: ; // "0" digits after the decimal point but before the first // significant digit of the number e2++ -__159: +__157: if !(e2 < 0) { - goto __161 + goto __159 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('0') - goto __160 -__160: + goto __158 +__158: precision-- e2++ + goto __157 goto __159 - goto __161 -__161: +__159: ; // Significant digits after the decimal point -__162: +__160: if !((libc.PostDecInt32(&precision, 1)) > 0) { - goto __163 + goto __161 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = et_getdigit(tls, bp+88 /* &realvalue */, bp+96 /* &nsd */) - goto __162 -__163: + goto __160 +__161: ; // Remove trailing zeros and the "." if no digits follow the "." if !((flag_rtz != 0) && (flag_dp != 0)) { + goto __162 + } +__163: + if !(int32(*(*int8)(unsafe.Pointer(bufpt + libc.UintptrFromInt32(-1)))) == '0') { goto __164 } -__165: - if !(int32(*(*int8)(unsafe.Pointer(bufpt + libc.UintptrFromInt32(-1)))) == '0') { - goto __166 - } *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = int8(0) - goto __165 -__166: + goto __163 +__164: ; if !(int32(*(*int8)(unsafe.Pointer(bufpt + libc.UintptrFromInt32(-1)))) == '.') { - goto __167 + goto __165 } if !(flag_altform2 != 0) { - goto __168 + goto __166 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('0') - goto __169 -__168: + goto __167 +__166: *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = int8(0) -__169: - ; __167: ; -__164: +__165: + ; +__162: ; // Add the "eNNN" suffix if !(int32(xtype) == EtEXP) { - goto __170 + goto __168 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = aDigits[(*Et_info)(unsafe.Pointer(infop)).Fcharset] if !(exp < 0) { - goto __171 + goto __169 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('-') exp = -exp - goto __172 -__171: + goto __170 +__169: *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('+') -__172: +__170: ; if !(exp >= 100) { - goto __173 + goto __171 } *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = (int8((exp / 100) + '0')) // 100's digit exp = exp % (100) -__173: +__171: ; *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = (int8((exp / 10) + '0')) // 10's digit *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = (int8((exp % 10) + '0')) // 1's digit -__170: +__168: ; *(*int8)(unsafe.Pointer(bufpt)) = int8(0) @@ -15887,41 +15889,41 @@ __170: // Special case: Add leading zeros if the flag_zeropad flag is // set and we are not left justified if !(((flag_zeropad != 0) && !(flag_leftjustify != 0)) && (length < width)) { - goto __174 + goto __172 } nPad = (width - length) i = width -__175: +__173: if !(i >= nPad) { - goto __177 + goto __175 } *(*int8)(unsafe.Pointer(bufpt + uintptr(i))) = *(*int8)(unsafe.Pointer(bufpt + uintptr((i - nPad)))) - goto __176 -__176: + goto __174 +__174: i-- + goto __173 goto __175 - goto __177 -__177: +__175: ; i = (libc.Bool32(int32(prefix) != 0)) -__178: +__176: if !(libc.PostDecInt32(&nPad, 1) != 0) { - goto __179 + goto __177 } *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&i, 1)))) = int8('0') - goto __178 -__179: + goto __176 +__177: ; length = width -__174: +__172: ; goto __58 __66: if !(!(bArgList != 0)) { - goto __180 + goto __178 } *(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar) -__180: +__178: ; length = libc.AssignInt32(&width, 0) goto __58 @@ -15932,92 +15934,92 @@ __67: goto __58 __68: if !(bArgList != 0) { - goto __181 + goto __179 } bufpt = getTextArg(tls, pArgList) length = 1 if !(bufpt != 0) { - goto __183 + goto __181 } *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = int8(libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1)))))) if !((c & 0xc0) == 0xc0) { + goto __183 + } +__184: + if !((length < 4) && ((int32(*(*int8)(unsafe.Pointer(bufpt))) & 0xc0) == 0x80)) { goto __185 } -__186: - if !((length < 4) && ((int32(*(*int8)(unsafe.Pointer(bufpt))) & 0xc0) == 0x80)) { - goto __187 - } *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(libc.PostIncInt32(&length, 1)))) = *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) - goto __186 -__187: - ; + goto __184 __185: ; - goto __184 __183: - *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = int8(0) -__184: ; goto __182 __181: + *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = int8(0) +__182: + ; + goto __180 +__179: ch = uint32(libc.VaUint32(&ap)) if !(ch < uint32(0x00080)) { - goto __188 + goto __186 } *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = (int8(ch & uint32(0xff))) length = 1 - goto __189 -__188: + goto __187 +__186: if !(ch < uint32(0x00800)) { - goto __190 + goto __188 } *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = (int8(0xc0 + int32((U8((ch >> 6) & uint32(0x1f)))))) *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + 1)) = (int8(0x80 + int32((U8(ch & uint32(0x3f)))))) length = 2 - goto __191 -__190: + goto __189 +__188: if !(ch < uint32(0x10000)) { - goto __192 + goto __190 } *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = (int8(0xe0 + int32((U8((ch >> 12) & uint32(0x0f)))))) *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + 1)) = (int8(0x80 + int32((U8((ch >> 6) & uint32(0x3f)))))) *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + 2)) = (int8(0x80 + int32((U8(ch & uint32(0x3f)))))) length = 3 - goto __193 -__192: + goto __191 +__190: *(*int8)(unsafe.Pointer(bp /* &buf[0] */)) = (int8(0xf0 + int32((U8((ch >> 18) & uint32(0x07)))))) *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + 1)) = (int8(0x80 + int32((U8((ch >> 12) & uint32(0x3f)))))) *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + 2)) = (int8(0x80 + int32((U8((ch >> 6) & uint32(0x3f)))))) *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + 3)) = (int8(0x80 + int32((U8(ch & uint32(0x3f)))))) length = 4 -__193: - ; __191: ; __189: ; -__182: +__187: + ; +__180: ; if !(precision > 1) { - goto __194 + goto __192 } width = width - (precision - 1) if !((width > 1) && !(flag_leftjustify != 0)) { - goto __195 + goto __193 } Xsqlite3_str_appendchar(tls, pAccum, (width - 1), int8(' ')) width = 0 -__195: - ; -__196: - if !(libc.PostDecInt32(&precision, 1) > 1) { - goto __197 - } - Xsqlite3_str_append(tls, pAccum, bp /* &buf[0] */, length) - goto __196 -__197: +__193: ; __194: + if !(libc.PostDecInt32(&precision, 1) > 1) { + goto __195 + } + Xsqlite3_str_append(tls, pAccum, bp /* &buf[0] */, length) + goto __194 +__195: + ; +__192: ; bufpt = bp /* &buf[0] */ flag_altform2 = EtByte(1) @@ -16025,30 +16027,30 @@ __194: __69: __70: if !(bArgList != 0) { - goto __198 + goto __196 } bufpt = getTextArg(tls, pArgList) - xtype = EtSTRING - goto __199 -__198: + xtype = EtByte(EtSTRING) + goto __197 +__196: bufpt = libc.VaUintptr(&ap) -__199: +__197: ; if !(bufpt == uintptr(0)) { - goto __200 + goto __198 } bufpt = ts + 800 /* "" */ - goto __201 -__200: + goto __199 +__198: if !(int32(xtype) == EtDYNSTRING) { - goto __202 + goto __200 } if !((((((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar == U32(0)) && ((*Sqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0)) && (width == 0)) && (precision < 0)) && (int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0)) { - goto __203 + goto __201 } // Special optimization for sqlite3_mprintf("%z..."): // Extend an existing memory allocation rather than creating @@ -16060,86 +16062,86 @@ __200: *(*U8)(unsafe.Pointer(pAccum + 29 /* &.printfFlags */)) |= U8((SQLITE_PRINTF_MALLOCED)) length = 0 goto __58 -__203: - ; - zExtra = bufpt -__202: - ; __201: + ; + zExtra = bufpt +__200: + ; +__199: ; if !(precision >= 0) { - goto __204 + goto __202 } if !(flag_altform2 != 0) { - goto __206 + goto __204 } // Set length to the number of bytes needed in order to display // precision characters z = bufpt -__208: +__206: if !((libc.PostDecInt32(&precision, 1) > 0) && (*(*uint8)(unsafe.Pointer(z)) != 0)) { - goto __209 + goto __207 } if !((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) >= 0xc0) { + goto __208 + } +__209: + if !((int32(*(*uint8)(unsafe.Pointer(z))) & 0xc0) == 0x80) { goto __210 } -__211: - if !((int32(*(*uint8)(unsafe.Pointer(z))) & 0xc0) == 0x80) { - goto __212 - } z++ - goto __211 -__212: - ; + goto __209 __210: ; +__208: + ; - goto __208 -__209: - ; - length = (int32((int64(z) - int64(bufpt)) / 1)) - goto __207 -__206: - length = 0 -__213: - if !((length < precision) && (*(*int8)(unsafe.Pointer(bufpt + uintptr(length))) != 0)) { - goto __215 - } - goto __214 -__214: - length++ - goto __213 - goto __215 -__215: - ; + goto __206 __207: ; + length = (int32((int64(z) - int64(bufpt)) / 1)) goto __205 __204: - length = (0x7fffffff & int32(libc.Xstrlen(tls, bufpt))) + length = 0 +__211: + if !((length < precision) && (*(*int8)(unsafe.Pointer(bufpt + uintptr(length))) != 0)) { + goto __213 + } + goto __212 +__212: + length++ + goto __211 + goto __213 +__213: + ; __205: ; + goto __203 +__202: + length = (0x7fffffff & int32(libc.Xstrlen(tls, bufpt))) +__203: + ; adjust_width_for_utf8: if !((flag_altform2 != 0) && (width > 0)) { - goto __216 + goto __214 } // Adjust width to account for extra bytes in UTF-8 characters ii = (length - 1) -__217: +__215: if !(ii >= 0) { - goto __218 + goto __216 } if !((int32(*(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostDecInt32(&ii, 1))))) & 0xc0) == 0x80) { - goto __219 + goto __217 } width++ -__219: - ; - goto __217 -__218: +__217: ; + goto __215 __216: ; +__214: + ; goto __58 __71: // %q: Escape ' characters __72: // %Q: Escape ' and enclose in '...' @@ -16152,17 +16154,17 @@ __73: }() if !(bArgList != 0) { - goto __220 + goto __218 } escarg = getTextArg(tls, pArgList) - goto __221 -__220: + goto __219 +__218: escarg = libc.VaUintptr(&ap) -__221: +__219: ; isnull = (libc.Bool32(escarg == uintptr(0))) if !(isnull != 0) { - goto __222 + goto __220 } escarg = func() uintptr { if int32(xtype) == EtSQLESCAPE2 { @@ -16170,7 +16172,7 @@ __221: } return ts + 806 /* "(NULL)" */ }() -__222: +__220: ; // For %q, %Q, and %w, the precision is the number of bytes (or // characters if the ! flags is present) to use from the input. @@ -16178,86 +16180,86 @@ __222: // of output characters may be larger than the precision. k = precision i1 = libc.AssignInt32(&n1, 0) -__223: +__221: if !((k != 0) && ((int32(libc.AssignInt8(&ch1, *(*int8)(unsafe.Pointer(escarg + uintptr(i1)))))) != 0)) { - goto __225 + goto __223 } if !(int32(ch1) == int32(q)) { - goto __226 + goto __224 } n1++ -__226: +__224: ; if !((flag_altform2 != 0) && ((int32(ch1) & 0xc0) == 0xc0)) { + goto __225 + } +__226: + if !((int32(*(*int8)(unsafe.Pointer(escarg + uintptr((i1 + 1))))) & 0xc0) == 0x80) { goto __227 } -__228: - if !((int32(*(*int8)(unsafe.Pointer(escarg + uintptr((i1 + 1))))) & 0xc0) == 0x80) { - goto __229 - } i1++ - goto __228 -__229: - ; + goto __226 __227: ; - goto __224 -__224: +__225: + ; + goto __222 +__222: i1++ k-- + goto __221 goto __223 - goto __225 -__225: +__223: ; needQuote = (libc.Bool32(!(isnull != 0) && (int32(xtype) == EtSQLESCAPE2))) n1 = n1 + (i1 + 3) if !(n1 > SQLITE_PRINT_BUF_SIZE) { - goto __230 + goto __228 } bufpt = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, int64(n1))) if !(bufpt == uintptr(0)) { - goto __232 + goto __230 } return -__232: - ; - goto __231 __230: + ; + goto __229 +__228: bufpt = bp /* &buf[0] */ -__231: +__229: ; j = 0 if !(needQuote != 0) { - goto __233 + goto __231 } *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&j, 1)))) = q -__233: +__231: ; k = i1 i1 = 0 -__234: +__232: if !(i1 < k) { - goto __236 + goto __234 } *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&j, 1)))) = libc.AssignInt8(&ch1, *(*int8)(unsafe.Pointer(escarg + uintptr(i1)))) if !(int32(ch1) == int32(q)) { - goto __237 + goto __235 } *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&j, 1)))) = ch1 -__237: - ; - goto __235 __235: + ; + goto __233 +__233: i1++ + goto __232 goto __234 - goto __236 -__236: +__234: ; if !(needQuote != 0) { - goto __238 + goto __236 } *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&j, 1)))) = q -__238: +__236: ; *(*int8)(unsafe.Pointer(bufpt + uintptr(j))) = int8(0) length = j @@ -16265,41 +16267,41 @@ __238: __74: if !((int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags) & SQLITE_PRINTF_INTERNAL) == 0) { - goto __239 + goto __237 } return -__239: +__237: ; pToken = libc.VaUintptr(&ap) if !((pToken != 0) && ((*Token)(unsafe.Pointer(pToken)).Fn != 0)) { - goto __240 + goto __238 } Xsqlite3_str_append(tls, pAccum, (*Token)(unsafe.Pointer(pToken)).Fz, int32((*Token)(unsafe.Pointer(pToken)).Fn)) -__240: +__238: ; length = libc.AssignInt32(&width, 0) goto __58 __75: if !((int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags) & SQLITE_PRINTF_INTERNAL) == 0) { - goto __241 + goto __239 } return -__241: +__239: ; pSrc = libc.VaUintptr(&ap) k1 = int32(libc.VaInt32(&ap)) pItem = ((pSrc + 8 /* &.a */) + uintptr(k1)*112) - if !((*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase != 0) { - goto __242 + if !((*SrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0) { + goto __240 } - Xsqlite3_str_appendall(tls, pAccum, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase) + Xsqlite3_str_appendall(tls, pAccum, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase) Xsqlite3_str_append(tls, pAccum, ts+813 /* "." */, 1) -__242: +__240: ; - Xsqlite3_str_appendall(tls, pAccum, (*SrcList_item)(unsafe.Pointer(pItem)).FzName) + Xsqlite3_str_appendall(tls, pAccum, (*SrcItem)(unsafe.Pointer(pItem)).FzName) length = libc.AssignInt32(&width, 0) goto __58 @@ -16317,33 +16319,33 @@ __58: // then the values have been translated prior to reaching this point. width = width - (length) if !(width > 0) { - goto __243 + goto __241 } if !(!(flag_leftjustify != 0)) { - goto __245 + goto __243 } Xsqlite3_str_appendchar(tls, pAccum, width, int8(' ')) -__245: +__243: ; Xsqlite3_str_append(tls, pAccum, bufpt, length) if !(flag_leftjustify != 0) { - goto __246 + goto __244 } Xsqlite3_str_appendchar(tls, pAccum, width, int8(' ')) -__246: - ; - goto __244 -__243: - Xsqlite3_str_append(tls, pAccum, bufpt, length) __244: ; + goto __242 +__241: + Xsqlite3_str_append(tls, pAccum, bufpt, length) +__242: + ; if !(zExtra != 0) { - goto __247 + goto __245 } Xsqlite3DbFree(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, zExtra) zExtra = uintptr(0) -__247: +__245: ; goto __4 __4: @@ -16354,7 +16356,7 @@ __5: // End for loop over the format string } -var zOrd = *(*[9]int8)(unsafe.Pointer(ts + 815 /* "thstndrd" */)) /* sqlite3.c:28611:29 */ +var zOrd = *(*[9]int8)(unsafe.Pointer(ts + 815 /* "thstndrd" */)) /* sqlite3.c:28898:29 */ // End of function @@ -16363,7 +16365,7 @@ var zOrd = *(*[9]int8)(unsafe.Pointer(ts + 815 /* "thstndrd" */)) /* sqlite3.c:2 // // 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 *libc.TLS, p uintptr, N int32) int32 { /* sqlite3.c:29051:12: */ +func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite3.c:29338:12: */ var zNew uintptr // Only called if really needed if (*StrAccum)(unsafe.Pointer(p)).FaccError != 0 { @@ -16371,7 +16373,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite return 0 } if (*StrAccum)(unsafe.Pointer(p)).FmxAlloc == U32(0) { - setStrAccumError(tls, p, SQLITE_TOOBIG) + setStrAccumError(tls, p, uint8(SQLITE_TOOBIG)) return (int32(((*StrAccum)(unsafe.Pointer(p)).FnAlloc - (*StrAccum)(unsafe.Pointer(p)).FnChar) - U32(1))) } else { var zOld uintptr @@ -16381,7 +16383,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite zOld = uintptr(0) } var szNew I64 = I64((*StrAccum)(unsafe.Pointer(p)).FnChar) - szNew = szNew + (I64(N + 1)) + szNew = szNew + (Sqlite3_int64(N) + int64(1)) if (szNew + I64((*StrAccum)(unsafe.Pointer(p)).FnChar)) <= I64((*StrAccum)(unsafe.Pointer(p)).FmxAlloc) { // Force exponential buffer size growth as long as it does not overflow, // to avoid having to call this routine too often @@ -16389,7 +16391,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite } if szNew > I64((*StrAccum)(unsafe.Pointer(p)).FmxAlloc) { Xsqlite3_str_reset(tls, p) - setStrAccumError(tls, p, SQLITE_TOOBIG) + setStrAccumError(tls, p, uint8(SQLITE_TOOBIG)) return 0 } else { (*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(int32(szNew)) @@ -16409,7 +16411,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite *(*U8)(unsafe.Pointer(p + 29 /* &.printfFlags */)) |= U8((SQLITE_PRINTF_MALLOCED)) } else { Xsqlite3_str_reset(tls, p) - setStrAccumError(tls, p, SQLITE_NOMEM) + setStrAccumError(tls, p, uint8(SQLITE_NOMEM)) return 0 } } @@ -16417,7 +16419,7 @@ func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite } // Append N copies of character c to the given string buffer. -func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c int8) { /* sqlite3.c:29101:17: */ +func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c int8) { /* sqlite3.c:29388:17: */ if ((I64((*Sqlite3_str)(unsafe.Pointer(p)).FnChar) + I64(N)) >= I64((*Sqlite3_str)(unsafe.Pointer(p)).FnAlloc)) && ((libc.AssignInt32(&N, sqlite3StrAccumEnlarge(tls, p, N))) <= 0) { return @@ -16433,7 +16435,7 @@ func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c int8) { /* sql // This is a helper routine to sqlite3_str_append() that does special-case // work (enlarging the buffer) using tail recursion, so that the // sqlite3_str_append() routine can use fast calling semantics. -func enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29117:29: */ +func enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29404:29: */ N = sqlite3StrAccumEnlarge(tls, p, N) if N > 0 { libc.Xmemcpy(tls, ((*StrAccum)(unsafe.Pointer(p)).FzText + uintptr((*StrAccum)(unsafe.Pointer(p)).FnChar)), z, uint64(N)) @@ -16443,7 +16445,7 @@ func enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3 // Append N bytes of text from z to the StrAccum object. Increase the // size of the memory allocation for StrAccum if necessary. -func Xsqlite3_str_append(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29129:17: */ +func Xsqlite3_str_append(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29416:17: */ if ((*Sqlite3_str)(unsafe.Pointer(p)).FnChar + U32(N)) >= (*Sqlite3_str)(unsafe.Pointer(p)).FnAlloc { enlargeAndAppend(tls, p, z, N) @@ -16455,14 +16457,14 @@ func Xsqlite3_str_append(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqli } // Append the complete text of zero-terminated string z[] to the p string. -func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:29146:17: */ +func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:29433:17: */ Xsqlite3_str_append(tls, p, z, Xsqlite3Strlen30(tls, z)) } // 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 *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29156:29: */ +func strAccumFinishRealloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29443:29: */ var zText uintptr zText = Xsqlite3DbMallocRaw(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, (uint64((*StrAccum)(unsafe.Pointer(p)).FnChar + U32(1)))) @@ -16470,13 +16472,13 @@ func strAccumFinishRealloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:2915 libc.Xmemcpy(tls, zText, (*StrAccum)(unsafe.Pointer(p)).FzText, (uint64((*StrAccum)(unsafe.Pointer(p)).FnChar + U32(1)))) *(*U8)(unsafe.Pointer(p + 29 /* &.printfFlags */)) |= U8((SQLITE_PRINTF_MALLOCED)) } else { - setStrAccumError(tls, p, SQLITE_NOMEM) + setStrAccumError(tls, p, uint8(SQLITE_NOMEM)) } (*StrAccum)(unsafe.Pointer(p)).FzText = zText return zText } -func Xsqlite3StrAccumFinish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29169:21: */ +func Xsqlite3StrAccumFinish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29456:21: */ if (*StrAccum)(unsafe.Pointer(p)).FzText != 0 { *(*int8)(unsafe.Pointer((*StrAccum)(unsafe.Pointer(p)).FzText + uintptr((*StrAccum)(unsafe.Pointer(p)).FnChar))) = int8(0) if ((*StrAccum)(unsafe.Pointer(p)).FmxAlloc > U32(0)) && !((int32((*StrAccum)(unsafe.Pointer((p))).FprintfFlags) & SQLITE_PRINTF_MALLOCED) != 0) { @@ -16490,10 +16492,10 @@ func Xsqlite3StrAccumFinish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:291 // sqlite3_malloc() fails to provide space for a real one. This // sqlite3_str object accepts no new text and always returns // an SQLITE_NOMEM error. -var sqlite3OomStr = Sqlite3_str{FaccError: SQLITE_NOMEM} /* sqlite3.c:29185:20 */ +var sqlite3OomStr = Sqlite3_str{FaccError: U8(SQLITE_NOMEM)} /* sqlite3.c:29472:20 */ // Finalize a string created using sqlite3_str_new(). -func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29191:17: */ +func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29478:17: */ var z uintptr if (p != uintptr(0)) && (p != uintptr(unsafe.Pointer(&sqlite3OomStr))) { z = Xsqlite3StrAccumFinish(tls, p) @@ -16505,7 +16507,7 @@ func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29191: } // Return any error code associated with p -func Xsqlite3_str_errcode(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29203:16: */ +func Xsqlite3_str_errcode(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29490:16: */ if p != 0 { return int32((*Sqlite3_str)(unsafe.Pointer(p)).FaccError) } @@ -16513,7 +16515,7 @@ func Xsqlite3_str_errcode(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29203:1 } // Return the current length of p in bytes -func Xsqlite3_str_length(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29208:16: */ +func Xsqlite3_str_length(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29495:16: */ if p != 0 { return int32((*Sqlite3_str)(unsafe.Pointer(p)).FnChar) } @@ -16521,7 +16523,7 @@ func Xsqlite3_str_length(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29208:16 } // Return the current value for p -func Xsqlite3_str_value(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29213:17: */ +func Xsqlite3_str_value(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29500:17: */ if (p == uintptr(0)) || ((*Sqlite3_str)(unsafe.Pointer(p)).FnChar == U32(0)) { return uintptr(0) } @@ -16530,7 +16532,7 @@ func Xsqlite3_str_value(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29213:1 } // Reset an StrAccum string. Reclaim all malloced memory. -func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) { /* sqlite3.c:29222:17: */ +func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) { /* sqlite3.c:29509:17: */ if (int32((*StrAccum)(unsafe.Pointer((p))).FprintfFlags) & SQLITE_PRINTF_MALLOCED) != 0 { Xsqlite3DbFree(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, (*StrAccum)(unsafe.Pointer(p)).FzText) *(*U8)(unsafe.Pointer(p + 29 /* &.printfFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(SQLITE_PRINTF_MALLOCED))) @@ -16552,7 +16554,7 @@ func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) { /* sqlite3.c:29222:17: */ // 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 Xsqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n int32, mx int32) { /* sqlite3.c:29246:21: */ +func Xsqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n int32, mx int32) { /* sqlite3.c:29533:21: */ (*StrAccum)(unsafe.Pointer(p)).FzText = zBase (*StrAccum)(unsafe.Pointer(p)).Fdb = db (*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(n) @@ -16563,13 +16565,13 @@ func Xsqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n } // Allocate and initialize a new dynamic string object -func Xsqlite3_str_new(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:29257:24: */ +func Xsqlite3_str_new(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:29544:24: */ var p uintptr = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Sqlite3_str{}))) if p != 0 { Xsqlite3StrAccumInit(tls, p, uintptr(0), uintptr(0), 0, func() int32 { if db != 0 { - return *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */))) + return *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */))) } return SQLITE_MAX_LENGTH }()) @@ -16581,7 +16583,7 @@ func Xsqlite3_str_new(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:29257:24 // Print into memory obtained from sqliteMalloc(). Use the internal // %-conversion extensions. -func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29272:21: */ +func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29559:21: */ bp := tls.Alloc(102) defer tls.Free(102) @@ -16591,8 +16593,8 @@ func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) ui // var acc StrAccum at bp, 32 Xsqlite3StrAccumInit(tls, bp /* &acc */, db, bp+32 /* &zBase[0] */, int32(unsafe.Sizeof([70]int8{})), - *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) - (*StrAccum)(unsafe.Pointer(bp /* &acc */)).FprintfFlags = SQLITE_PRINTF_INTERNAL + *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) + (*StrAccum)(unsafe.Pointer(bp /* &acc */)).FprintfFlags = U8(SQLITE_PRINTF_INTERNAL) Xsqlite3_str_vappendf(tls, bp /* &acc */, zFormat, ap) z = Xsqlite3StrAccumFinish(tls, bp /* &acc */) if int32((*StrAccum)(unsafe.Pointer(bp /* &acc */)).FaccError) == SQLITE_NOMEM { @@ -16603,7 +16605,7 @@ func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) ui // Print into memory obtained from sqliteMalloc(). Use the internal // %-conversion extensions. -func Xsqlite3MPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29292:21: */ +func Xsqlite3MPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29579:21: */ var ap Va_list _ = ap var z uintptr @@ -16615,7 +16617,7 @@ func Xsqlite3MPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, va uintptr) uin // Print into memory obtained from sqlite3_malloc(). Omit the internal // %-conversion extensions. -func Xsqlite3_vmprintf(tls *libc.TLS, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29305:17: */ +func Xsqlite3_vmprintf(tls *libc.TLS, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29592:17: */ bp := tls.Alloc(102) defer tls.Free(102) @@ -16635,7 +16637,7 @@ func Xsqlite3_vmprintf(tls *libc.TLS, zFormat uintptr, ap Va_list) uintptr { /* // Print into memory obtained from sqlite3_malloc()(). Omit the internal // %-conversion extensions. -func Xsqlite3_mprintf(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29329:17: */ +func Xsqlite3_mprintf(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29616:17: */ var ap Va_list _ = ap var z uintptr @@ -16659,7 +16661,7 @@ func Xsqlite3_mprintf(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* s // mistake. // // sqlite3_vsnprintf() is the varargs version. -func Xsqlite3_vsnprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29354:17: */ +func Xsqlite3_vsnprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29641:17: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -16674,7 +16676,7 @@ func Xsqlite3_vsnprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, a return zBuf } -func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29369:17: */ +func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29656:17: */ var z uintptr var ap Va_list _ = ap @@ -16696,7 +16698,7 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // 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 *libc.TLS, iErrCode int32, zFormat uintptr, ap Va_list) { /* sqlite3.c:29392:13: */ +func renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Va_list) { /* sqlite3.c:29679:13: */ bp := tls.Alloc(242) defer tls.Free(242) @@ -16712,7 +16714,7 @@ func renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Va_list) { } // Format and write a message to the log if logging is enabled. -func Xsqlite3_log(tls *libc.TLS, iErrCode int32, zFormat uintptr, va uintptr) { /* sqlite3.c:29405:17: */ +func Xsqlite3_log(tls *libc.TLS, iErrCode int32, zFormat uintptr, va uintptr) { /* sqlite3.c:29692:17: */ var ap Va_list _ = ap // Vararg list if Xsqlite3Config.FxLog != 0 { @@ -16725,7 +16727,7 @@ func Xsqlite3_log(tls *libc.TLS, iErrCode int32, zFormat uintptr, va uintptr) { // A version of printf() that understands %lld. Used for debugging. // The printf() built into some versions of windows does not understand %lld // and segfaults if you give it a long long int. -func Xsqlite3DebugPrintf(tls *libc.TLS, zFormat uintptr, va uintptr) { /* sqlite3.c:29420:21: */ +func Xsqlite3DebugPrintf(tls *libc.TLS, zFormat uintptr, va uintptr) { /* sqlite3.c:29707:21: */ bp := tls.Alloc(740) defer tls.Free(740) @@ -16746,7 +16748,7 @@ func Xsqlite3DebugPrintf(tls *libc.TLS, zFormat uintptr, va uintptr) { /* sqlite // variable-argument wrapper around sqlite3_str_vappendf(). The bFlags argument // can contain the bit SQLITE_PRINTF_INTERNAL enable internal formats. -func Xsqlite3_str_appendf(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:29446:17: */ +func Xsqlite3_str_appendf(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:29733:17: */ var ap Va_list _ = ap ap = va @@ -16801,7 +16803,7 @@ type sqlite3PrngType = struct { Fi uint8 Fj uint8 Fs [256]uint8 -} /* sqlite3.c:30258:19 */ +} /* sqlite3.c:30551:19 */ //************* End of printf.c ********************************************* //************* Begin file treeview.c *************************************** @@ -16845,10 +16847,10 @@ type sqlite3PrngType = struct { // All threads share a single random number generator. // This structure is the current state of the generator. -var sqlite3Prng sqlite3PrngType /* sqlite3.c:30262:3: */ +var sqlite3Prng sqlite3PrngType /* sqlite3.c:30555:3: */ // Return N random bytes. -func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { /* sqlite3.c:30267:17: */ +func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { /* sqlite3.c:30560:17: */ bp := tls.Alloc(256) defer tls.Free(256) @@ -16922,16 +16924,16 @@ func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { /* sqlite3.c:30 // // The sqlite3_test_control() interface calls these routines to // control the PRNG. -var sqlite3SavedPrng sqlite3PrngType /* sqlite3.c:30353:42: */ +var sqlite3SavedPrng sqlite3PrngType /* sqlite3.c:30646:42: */ -func Xsqlite3PrngSaveState(tls *libc.TLS) { /* sqlite3.c:30354:21: */ +func Xsqlite3PrngSaveState(tls *libc.TLS) { /* sqlite3.c:30647:21: */ libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&sqlite3SavedPrng)), uintptr(unsafe.Pointer(&sqlite3Prng)), uint64(unsafe.Sizeof(sqlite3Prng))) } -func Xsqlite3PrngRestoreState(tls *libc.TLS) { /* sqlite3.c:30361:21: */ +func Xsqlite3PrngRestoreState(tls *libc.TLS) { /* sqlite3.c:30654:21: */ libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&sqlite3Prng)), uintptr(unsafe.Pointer(&sqlite3SavedPrng)), @@ -16939,7 +16941,7 @@ func Xsqlite3PrngRestoreState(tls *libc.TLS) { /* sqlite3.c:30361:21: */ } // Create a new thread -func Xsqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:30597:20: */ +func Xsqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:30890:20: */ var p uintptr *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) @@ -16959,7 +16961,7 @@ func Xsqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui } // Get the results of the thread -func Xsqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) int32 { /* sqlite3.c:30621:20: */ +func Xsqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) int32 { /* sqlite3.c:30914:20: */ if p == uintptr(0) { return SQLITE_NOMEM @@ -17035,7 +17037,7 @@ var sqlite3Utf8Trans1 = [64]uint8{ uint8(0x08), uint8(0x09), uint8(0x0a), uint8(0x0b), uint8(0x0c), uint8(0x0d), uint8(0x0e), uint8(0x0f), uint8(0x00), uint8(0x01), uint8(0x02), uint8(0x03), uint8(0x04), uint8(0x05), uint8(0x06), uint8(0x07), uint8(0x00), uint8(0x01), uint8(0x02), uint8(0x03), uint8(0x00), uint8(0x01), uint8(0x00), uint8(0x00), -} /* sqlite3.c:30700:28 */ +} /* sqlite3.c:30993:28 */ // Translate a single UTF-8 character. Return the unicode value. // @@ -17062,7 +17064,7 @@ var sqlite3Utf8Trans1 = [64]uint8{ // * This routine accepts over-length UTF8 encodings // for unicode values 0x80 and greater. It does not change over-length // encodings to 0xfffd as some systems recommend. -func Xsqlite3Utf8Read(tls *libc.TLS, pz uintptr) U32 { /* sqlite3.c:30794:20: */ +func Xsqlite3Utf8Read(tls *libc.TLS, pz uintptr) U32 { /* sqlite3.c:31087:20: */ var c uint32 // Same as READ_UTF8() above but without the zTerm parameter. @@ -17089,7 +17091,7 @@ func Xsqlite3Utf8Read(tls *libc.TLS, pz uintptr) U32 { /* sqlite3.c:30794:20: */ // 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 Xsqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc U8) int32 { /* sqlite3.c:30830:36: */ +func Xsqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc U8) int32 { /* sqlite3.c:31123:36: */ var len Sqlite3_int64 // Maximum length of output string in bytes var zOut uintptr // Output buffer var zIn uintptr // Input iterator @@ -17414,7 +17416,7 @@ translate_out: // // The allocation (static, dynamic etc.) and encoding of the Mem may be // changed by this function. -func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:31025:20: */ +func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:31318:20: */ var rc int32 = SQLITE_OK var bom U8 = U8(0) @@ -17422,10 +17424,10 @@ func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c: var b1 U8 = *(*U8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz)) var b2 U8 = *(*U8)(unsafe.Pointer((((*Mem)(unsafe.Pointer(pMem)).Fz) + uintptr(1)))) if (int32(b1) == 0xFE) && (int32(b2) == 0xFF) { - bom = SQLITE_UTF16BE + bom = U8(SQLITE_UTF16BE) } if (int32(b1) == 0xFF) && (int32(b2) == 0xFE) { - bom = SQLITE_UTF16LE + bom = U8(SQLITE_UTF16LE) } } @@ -17448,7 +17450,7 @@ func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c: // 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 Xsqlite3Utf8CharLen(tls *libc.TLS, zIn uintptr, nByte int32) int32 { /* sqlite3.c:31063:20: */ +func Xsqlite3Utf8CharLen(tls *libc.TLS, zIn uintptr, nByte int32) int32 { /* sqlite3.c:31356:20: */ var r int32 = 0 var z uintptr = zIn var zTerm uintptr @@ -17480,7 +17482,7 @@ func Xsqlite3Utf8CharLen(tls *libc.TLS, zIn uintptr, nByte int32) int32 { /* sql // be freed by the calling function. // // NULL is returned if there is an allocation error. -func Xsqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc U8) uintptr { /* sqlite3.c:31117:21: */ +func Xsqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc U8) uintptr { /* sqlite3.c:31410:21: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -17501,7 +17503,7 @@ func Xsqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc U8) // 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 Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sqlite3.c:31138:20: */ +func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sqlite3.c:31431:20: */ var c int32 var z uintptr = zIn var n int32 = 0 @@ -17524,7 +17526,7 @@ func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sq // This routine is called from the TCL test function "translate_selftest". // It checks that the primitives for serializing and deserializing // characters in each encoding are inverses of each other. -func Xsqlite3UtfSelfTest(tls *libc.TLS) { /* sqlite3.c:31160:21: */ +func Xsqlite3UtfSelfTest(tls *libc.TLS) { /* sqlite3.c:31453:21: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -17855,7 +17857,7 @@ type Double_t = float64 /* math.h:150:16 */ // sqlite3FaultSim() instance is being invoked. Each call to sqlite3FaultSim() // should have a unique code. To prevent legacy testing applications from // breaking, the codes should not be changed or reused. -func Xsqlite3FaultSim(tls *libc.TLS, iTest int32) int32 { /* sqlite3.c:31240:20: */ +func Xsqlite3FaultSim(tls *libc.TLS, iTest int32) int32 { /* sqlite3.c:31533:20: */ var xCallback uintptr = Xsqlite3Config.FxTestCallback if xCallback != 0 { return (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&xCallback)))(tls, iTest) @@ -17864,7 +17866,7 @@ func Xsqlite3FaultSim(tls *libc.TLS, iTest int32) int32 { /* sqlite3.c:31240:20: } // Return true if the floating point value is Not a Number (NaN). -func Xsqlite3IsNaN(tls *libc.TLS, x float64) int32 { /* sqlite3.c:31250:20: */ +func Xsqlite3IsNaN(tls *libc.TLS, x float64) int32 { /* sqlite3.c:31543:20: */ bp := tls.Alloc(16) defer tls.Free(16) *(*float64)(unsafe.Pointer(bp + 8)) = x @@ -17881,7 +17883,7 @@ func Xsqlite3IsNaN(tls *libc.TLS, x float64) int32 { /* sqlite3.c:31250:20: */ // 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 Xsqlite3Strlen30(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:31265:20: */ +func Xsqlite3Strlen30(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:31558:20: */ if z == uintptr(0) { return 0 } @@ -17893,7 +17895,7 @@ func Xsqlite3Strlen30(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:31265:20: * // // 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 Xsqlite3ColumnType(tls *libc.TLS, pCol uintptr, zDflt uintptr) uintptr { /* sqlite3.c:31277:21: */ +func Xsqlite3ColumnType(tls *libc.TLS, pCol uintptr, zDflt uintptr) uintptr { /* sqlite3.c:31570:21: */ if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_HASTYPE) == 0 { return zDflt } @@ -17903,7 +17905,7 @@ func Xsqlite3ColumnType(tls *libc.TLS, pCol uintptr, zDflt uintptr) uintptr { /* // Helper function for sqlite3Error() - called rarely. Broken out into // a separate routine to avoid unnecessary register saves on entry to // sqlite3Error(). -func sqlite3ErrorFinish(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:31287:30: */ +func sqlite3ErrorFinish(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:31580:30: */ if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 { Xsqlite3ValueSetNull(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr) } @@ -17913,7 +17915,7 @@ func sqlite3ErrorFinish(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3. // 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 Xsqlite3Error(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:31297:21: */ +func Xsqlite3Error(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:31590:21: */ (*Sqlite3)(unsafe.Pointer(db)).FerrCode = err_code if (err_code != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FpErr != 0) { @@ -17921,9 +17923,19 @@ func Xsqlite3Error(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:312 } } +// The equivalent of sqlite3Error(db, SQLITE_OK). Clear the error state +// and error message. +func Xsqlite3ErrorClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:31600:21: */ + + (*Sqlite3)(unsafe.Pointer(db)).FerrCode = SQLITE_OK + if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 { + Xsqlite3ValueSetNull(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr) + } +} + // Load the sqlite3.iSysErrno field if that is an appropriate thing // to do based on the SQLite error code in rc. -func Xsqlite3SystemError(tls *libc.TLS, db uintptr, rc int32) { /* sqlite3.c:31307:21: */ +func Xsqlite3SystemError(tls *libc.TLS, db uintptr, rc int32) { /* sqlite3.c:31610:21: */ if rc == (SQLITE_IOERR | (int32(12) << 8)) { return } @@ -17952,20 +17964,20 @@ func Xsqlite3SystemError(tls *libc.TLS, db uintptr, rc int32) { /* sqlite3.c:313 // 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 Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uintptr, va uintptr) { /* sqlite3.c:31336:21: */ +func Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uintptr, va uintptr) { /* sqlite3.c:31639:21: */ (*Sqlite3)(unsafe.Pointer(db)).FerrCode = err_code Xsqlite3SystemError(tls, db, err_code) if zFormat == uintptr(0) { Xsqlite3Error(tls, db, err_code) - } else if ((*Sqlite3)(unsafe.Pointer(db)).FpErr != 0) || ((libc.AssignPtrUintptr(db+384 /* &.pErr */, Xsqlite3ValueNew(tls, db))) != uintptr(0)) { + } else if ((*Sqlite3)(unsafe.Pointer(db)).FpErr != 0) || ((libc.AssignPtrUintptr(db+392 /* &.pErr */, Xsqlite3ValueNew(tls, db))) != uintptr(0)) { var z uintptr var ap Va_list _ = ap ap = va z = Xsqlite3VMPrintf(tls, db, zFormat, ap) _ = ap - Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, z, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) + Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, z, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) } } @@ -17984,7 +17996,7 @@ func Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uin // stored by this function into the database handle using sqlite3Error(). // Functions sqlite3Error() or sqlite3ErrorWithMsg() should be used // during statement execution (sqlite3_step() etc.). -func Xsqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:31369:21: */ +func Xsqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:31672:21: */ var zMsg uintptr var ap Va_list _ = ap @@ -18006,7 +18018,7 @@ func Xsqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr // If database connection db is currently parsing SQL, then transfer // error code errCode to that parser if the parser has not already // encountered some other kind of error. -func Xsqlite3ErrorToParser(tls *libc.TLS, db uintptr, errCode int32) int32 { /* sqlite3.c:31392:20: */ +func Xsqlite3ErrorToParser(tls *libc.TLS, db uintptr, errCode int32) int32 { /* sqlite3.c:31695:20: */ var pParse uintptr if (db == uintptr(0)) || ((libc.AssignUintptr(&pParse, (*Sqlite3)(unsafe.Pointer(db)).FpParse)) == uintptr(0)) { return errCode @@ -18031,7 +18043,7 @@ func Xsqlite3ErrorToParser(tls *libc.TLS, db uintptr, errCode int32) int32 { /* // 2002-02-14: This routine is extended to remove MS-Access style // brackets from around identifiers. For example: "[a-b-c]" becomes // "a-b-c". -func Xsqlite3Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:31417:21: */ +func Xsqlite3Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:31720:21: */ var quote int8 var i int32 var j int32 @@ -18063,19 +18075,19 @@ func Xsqlite3Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:31417:21: */ *(*int8)(unsafe.Pointer(z + uintptr(j))) = int8(0) } -func Xsqlite3DequoteExpr(tls *libc.TLS, p uintptr) { /* sqlite3.c:31439:21: */ +func Xsqlite3DequoteExpr(tls *libc.TLS, p uintptr) { /* sqlite3.c:31742:21: */ *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (func() uint32 { if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))))) == '"' { return (uint32(EP_Quoted | EP_DblQuoted)) } - return EP_Quoted + return uint32(EP_Quoted) }()) Xsqlite3Dequote(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) } // Generate a Token object from a string -func Xsqlite3TokenInit(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:31448:21: */ +func Xsqlite3TokenInit(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:31751:21: */ (*Token)(unsafe.Pointer(p)).Fz = z (*Token)(unsafe.Pointer(p)).Fn = uint32(Xsqlite3Strlen30(tls, z)) } @@ -18090,7 +18102,7 @@ func Xsqlite3TokenInit(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:31448 // 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 *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31466:16: */ +func Xsqlite3_stricmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31769:16: */ if zLeft == uintptr(0) { if zRight != 0 { return -1 @@ -18102,7 +18114,7 @@ func Xsqlite3_stricmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* s return Xsqlite3StrICmp(tls, zLeft, zRight) } -func Xsqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31474:20: */ +func Xsqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31777:20: */ var a uintptr var b uintptr var c int32 @@ -18128,7 +18140,7 @@ func Xsqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sq return c } -func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) int32 { /* sqlite3.c:31493:16: */ +func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) int32 { /* sqlite3.c:31796:16: */ var a uintptr var b uintptr if zLeft == uintptr(0) { @@ -18152,7 +18164,7 @@ func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) in } // Compute an 8-bit hash on a string that is insensitive to case differences -func Xsqlite3StrIHash(tls *libc.TLS, z uintptr) U8 { /* sqlite3.c:31509:19: */ +func Xsqlite3StrIHash(tls *libc.TLS, z uintptr) U8 { /* sqlite3.c:31812:19: */ var h U8 = U8(0) if z == uintptr(0) { return U8(0) @@ -18168,7 +18180,7 @@ func Xsqlite3StrIHash(tls *libc.TLS, z uintptr) U8 { /* sqlite3.c:31509:19: */ // E==2 results in 100. E==50 results in 1.0e50. // // This routine only works for values of E between 1 and 341. -func sqlite3Pow10(tls *libc.TLS, E int32) float64 { /* sqlite3.c:31525:24: */ +func sqlite3Pow10(tls *libc.TLS, E int32) float64 { /* sqlite3.c:31828:24: */ var x float64 = 10.0 var r float64 = 1.0 for 1 != 0 { @@ -18211,7 +18223,7 @@ func sqlite3Pow10(tls *libc.TLS, E int32) float64 { /* sqlite3.c:31525:24: */ // 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 Xsqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc U8) int32 { /* sqlite3.c:31590:20: */ +func Xsqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc U8) int32 { /* sqlite3.c:31893:20: */ var incr int32 var zEnd uintptr // sign * significand * (10 ^ (esign * exponent)) @@ -18591,7 +18603,7 @@ __57: // Render an signed 64-bit integer as text. Store the result in zOut[]. // // The caller must ensure that zOut[] is at least 21 bytes in size. -func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr) { /* sqlite3.c:31789:21: */ +func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr) { /* sqlite3.c:32092:21: */ bp := tls.Alloc(22) defer tls.Free(22) @@ -18632,7 +18644,7 @@ func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr) { /* sqlite3.c:3178 // compare2pow63("9223372036854775800", 1) // // will return -8. -func compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) int32 { /* sqlite3.c:31822:12: */ +func compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) int32 { /* sqlite3.c:32125:12: */ var c int32 = 0 var i int32 // 012345678901234567 @@ -18661,7 +18673,7 @@ func compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) int32 { /* sqlite3.c // 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 Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc U8) int32 { /* sqlite3.c:31855:20: */ +func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc U8) int32 { /* sqlite3.c:32158:20: */ var incr int32 var u U64 = uint64(0) var neg int32 = 0 // assume positive @@ -18676,6 +18688,7 @@ func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc incr = 1 } else { incr = 2 + length = length & (libc.CplInt32(1)) for i = (3 - int32(enc)); (i < length) && (int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))) == 0); i = i + (2) { } @@ -18782,7 +18795,7 @@ func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc // 1 Excess text after the integer value // 2 Integer too large for a 64-bit signed integer or is malformed // 3 Special case of 9223372036854775808 -func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sqlite3.c:31957:20: */ +func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sqlite3.c:32261:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -18802,7 +18815,7 @@ func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sq } return 2 } else { - return Xsqlite3Atoi64(tls, z, pOut, Xsqlite3Strlen30(tls, z), SQLITE_UTF8) + return Xsqlite3Atoi64(tls, z, pOut, Xsqlite3Strlen30(tls, z), uint8(SQLITE_UTF8)) } return int32(0) } @@ -18815,7 +18828,7 @@ func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sq // Any non-numeric characters that following zNum are ignored. // This is different from sqlite3Atoi64() which requires the // input number to be zero-terminated. -func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32 { /* sqlite3.c:31987:20: */ +func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32 { /* sqlite3.c:32291:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -18877,7 +18890,7 @@ func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32 { /* sq // Return a 32-bit integer value extracted from a string. If the // string is not an integer, just return 0. -func Xsqlite3Atoi(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:32046:20: */ +func Xsqlite3Atoi(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:32350:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -18890,7 +18903,7 @@ func Xsqlite3Atoi(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:32046:20: */ // success and false if there is an error. // // Only decimal notation is accepted. -func Xsqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) int32 { /* sqlite3.c:32058:20: */ +func Xsqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) int32 { /* sqlite3.c:32362:20: */ var v U64 = uint64(0) var i int32 for i = 0; (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))]) & 0x04) != 0; i++ { @@ -18933,7 +18946,7 @@ func Xsqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) int32 { /* sqlite3. // 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 *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32099:28: */ +func putVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32403:28: */ bp := tls.Alloc(10) defer tls.Free(10) @@ -18979,7 +18992,7 @@ __3: return n } -func Xsqlite3PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32123:20: */ +func Xsqlite3PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32427:20: */ if v <= uint64(0x7f) { *(*uint8)(unsafe.Pointer(p)) = (uint8(v & uint64(0x7f))) return 1 @@ -19002,7 +19015,7 @@ func Xsqlite3PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:321 // 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 Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32153:19: */ +func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32457:19: */ var a U32 var b U32 var s U32 @@ -19024,7 +19037,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 a = a | (U32(*(*uint8)(unsafe.Pointer(p)))) // a: p0<<14 | p2 (unmasked) if !((a & U32(0x80)) != 0) { - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) b = b & (U32(0x7f)) b = (b << 7) a = a | (b) @@ -19033,13 +19046,13 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 } // CSE1 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) // b: p1<<14 | p3 (unmasked) if !((b & U32(0x80)) != 0) { - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); a = (a << 7) @@ -19053,7 +19066,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) s = a // s: p0<<14 | p2 (masked) @@ -19085,7 +19098,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 if !((b & U32(0x80)) != 0) { // we can skip this cause it was (effectively) done above in calc'ing s // b &= (0x7f<<28)|(0x7f<<14)|(0x7f); - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) a = (a << 7) a = a | (b) s = (s >> 18) @@ -19099,7 +19112,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // a: p2<<28 | p4<<14 | p6 (unmasked) if !((a & U32(0x80)) != 0) { a = a & (SLOT_4_2_0) - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 7) a = a | (b) s = (s >> 11) @@ -19108,7 +19121,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 } // CSE2 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) @@ -19131,7 +19144,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // moved CSE2 up // a &= (0x7f<<29)|(0x7f<<15)|(0xff); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 8) a = a | (b) @@ -19155,7 +19168,7 @@ func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32 // 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 Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32314:19: */ +func Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32618:19: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -19223,7 +19236,7 @@ func Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c: // Return the number of bytes that will be needed to store the given // 64-bit integer. -func Xsqlite3VarintLen(tls *libc.TLS, v U64) int32 { /* sqlite3.c:32436:20: */ +func Xsqlite3VarintLen(tls *libc.TLS, v U64) int32 { /* sqlite3.c:32740:20: */ var i int32 for i = 1; (libc.AssignShrUint64(&v, int(uint64(7)))) != uint64(0); i++ { } @@ -19231,7 +19244,7 @@ func Xsqlite3VarintLen(tls *libc.TLS, v U64) int32 { /* sqlite3.c:32436:20: */ } // Read or write a four-byte big-endian integer value. -func Xsqlite3Get4byte(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:32446:20: */ +func Xsqlite3Get4byte(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:32750:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -19241,7 +19254,7 @@ func Xsqlite3Get4byte(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:32446:20: */ return libc.X__builtin_bswap32(tls, *(*U32)(unsafe.Pointer(bp /* x */))) } -func Xsqlite3Put4byte(tls *libc.TLS, p uintptr, v U32) { /* sqlite3.c:32464:21: */ +func Xsqlite3Put4byte(tls *libc.TLS, p uintptr, v U32) { /* sqlite3.c:32768:21: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -19252,7 +19265,7 @@ func Xsqlite3Put4byte(tls *libc.TLS, p uintptr, v U32) { /* sqlite3.c:32464:21: // 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 Xsqlite3HexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:32488:19: */ +func Xsqlite3HexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:32792:19: */ h = h + (9 * (1 & (h >> 6))) return (U8(h & 0xf)) @@ -19262,7 +19275,7 @@ func Xsqlite3HexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:32488:19: */ // 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 Xsqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) uintptr { /* sqlite3.c:32506:21: */ +func Xsqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) uintptr { /* sqlite3.c:32810:21: */ var zBlob uintptr var i int32 @@ -19280,7 +19293,7 @@ func Xsqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) uintptr { // 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 *libc.TLS, zType uintptr) { /* sqlite3.c:32527:13: */ +func logBadConnection(tls *libc.TLS, zType uintptr) { /* sqlite3.c:32831:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -19301,7 +19314,7 @@ func logBadConnection(tls *libc.TLS, zType uintptr) { /* sqlite3.c:32527:13: */ // 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 Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32548:20: */ +func Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32852:20: */ var magic U32 if db == uintptr(0) { logBadConnection(tls, ts+801 /* "NULL" */) @@ -19320,10 +19333,10 @@ func Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32548 return int32(0) } -func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32565:20: */ +func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32869:20: */ var magic U32 magic = (*Sqlite3)(unsafe.Pointer(db)).Fmagic - if ((magic != SQLITE_MAGIC_SICK) && (magic != SQLITE_MAGIC_OPEN)) && (magic != SQLITE_MAGIC_BUSY) { + if ((magic != U32(SQLITE_MAGIC_SICK)) && (magic != SQLITE_MAGIC_OPEN)) && (magic != SQLITE_MAGIC_BUSY) { logBadConnection(tls, ts+900 /* "invalid" */) return 0 @@ -19337,21 +19350,21 @@ func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c // 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 Xsqlite3AddInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32585:20: */ +func Xsqlite3AddInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32889:20: */ return libc.X__builtin_add_overflowInt64(tls, *(*I64)(unsafe.Pointer(pA)), iB, pA) } -func Xsqlite3SubInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32605:20: */ +func Xsqlite3SubInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32909:20: */ return libc.X__builtin_sub_overflowInt64(tls, *(*I64)(unsafe.Pointer(pA)), iB, pA) } -func Xsqlite3MulInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32620:20: */ +func Xsqlite3MulInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32924:20: */ return libc.X__builtin_mul_overflowInt64(tls, *(*I64)(unsafe.Pointer(pA)), iB, pA) } // Compute the absolute value of a 32-bit signed integer, of possible. Or // if the integer has a value of -2147483648, return +2147483647 -func Xsqlite3AbsInt32(tls *libc.TLS, x int32) int32 { /* sqlite3.c:32646:20: */ +func Xsqlite3AbsInt32(tls *libc.TLS, x int32) int32 { /* sqlite3.c:32950:20: */ if x >= 0 { return x } @@ -19365,7 +19378,7 @@ func Xsqlite3AbsInt32(tls *libc.TLS, x int32) int32 { /* sqlite3.c:32646:20: */ // not a simple "+" operator because LogEst is stored as a logarithmic // value. // -func Xsqlite3LogEstAdd(tls *libc.TLS, a LogEst, b LogEst) LogEst { /* sqlite3.c:32689:23: */ +func Xsqlite3LogEstAdd(tls *libc.TLS, a LogEst, b LogEst) LogEst { /* sqlite3.c:32993:23: */ if int32(a) >= int32(b) { if int32(a) > (int32(b) + 49) { return a @@ -19396,11 +19409,11 @@ var x = [32]uint8{ uint8(4), uint8(4), uint8(4), uint8(4), // 15-18 uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), // 19-24 uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), // 25-31 -} /* sqlite3.c:32690:30 */ +} /* sqlite3.c:32994:30 */ // Convert an integer into a LogEst. In other words, compute an // approximation for 10*log2(x). -func Xsqlite3LogEst(tls *libc.TLS, x U64) LogEst { /* sqlite3.c:32716:23: */ +func Xsqlite3LogEst(tls *libc.TLS, x U64) LogEst { /* sqlite3.c:33020:23: */ var y LogEst = int16(40) if x < uint64(8) { if x < uint64(2) { @@ -19418,11 +19431,11 @@ func Xsqlite3LogEst(tls *libc.TLS, x U64) LogEst { /* sqlite3.c:32716:23: */ return (LogEst((int32(a[(x&uint64(7))]) + int32(y)) - 10)) } -var a = [8]LogEst{int16(0), int16(2), int16(3), int16(5), int16(6), int16(7), int16(8), int16(9)} /* sqlite3.c:32717:17 */ +var a = [8]LogEst{int16(0), int16(2), int16(3), int16(5), int16(6), int16(7), int16(8), int16(9)} /* sqlite3.c:33021:17 */ // Convert a double into a LogEst // In other words, compute an approximation for 10*log2(x). -func Xsqlite3LogEstFromDouble(tls *libc.TLS, x float64) LogEst { /* sqlite3.c:32740:23: */ +func Xsqlite3LogEstFromDouble(tls *libc.TLS, x float64) LogEst { /* sqlite3.c:33044:23: */ bp := tls.Alloc(16) defer tls.Free(16) *(*float64)(unsafe.Pointer(bp + 8)) = x @@ -19446,7 +19459,7 @@ func Xsqlite3LogEstFromDouble(tls *libc.TLS, x float64) LogEst { /* sqlite3.c:32 // // Note that this routine is only used when one or more of various // non-standard compile-time options is enabled. -func Xsqlite3LogEstToInt(tls *libc.TLS, x LogEst) U64 { /* sqlite3.c:32761:20: */ +func Xsqlite3LogEstToInt(tls *libc.TLS, x LogEst) U64 { /* sqlite3.c:33065:20: */ var n U64 n = (U64(int32(x) % 10)) x = int16(int32(x) / (10)) @@ -19498,7 +19511,7 @@ func Xsqlite3LogEstToInt(tls *libc.TLS, x LogEst) U64 { /* sqlite3.c:32761:20: * // 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 Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) uintptr { /* sqlite3.c:32815:22: */ +func Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) uintptr { /* sqlite3.c:33119:22: */ var nInt int32 // number of sizeof(int) objects needed for zName var z uintptr // Pointer to where zName will be stored var i int32 // Index in pIn[] where zName is stored @@ -19537,7 +19550,7 @@ func Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nNa // 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 Xsqlite3VListNumToName(tls *libc.TLS, pIn uintptr, iVal int32) uintptr { /* sqlite3.c:32853:27: */ +func Xsqlite3VListNumToName(tls *libc.TLS, pIn uintptr, iVal int32) uintptr { /* sqlite3.c:33157:27: */ var i int32 var mx int32 if pIn == uintptr(0) { @@ -19556,7 +19569,7 @@ func Xsqlite3VListNumToName(tls *libc.TLS, pIn uintptr, iVal int32) uintptr { /* // Return the number of the variable named zName, if it is in VList. // or return 0 if there is no such variable. -func Xsqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:32869:20: */ +func Xsqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:33173:20: */ var i int32 var mx int32 if pIn == uintptr(0) { @@ -19595,7 +19608,7 @@ func Xsqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int // fields of the Hash structure. // // "pNew" is a pointer to the hash table that is to be initialized. -func Xsqlite3HashInit(tls *libc.TLS, pNew uintptr) { /* sqlite3.c:32906:21: */ +func Xsqlite3HashInit(tls *libc.TLS, pNew uintptr) { /* sqlite3.c:33210:21: */ (*Hash)(unsafe.Pointer(pNew)).Ffirst = uintptr(0) (*Hash)(unsafe.Pointer(pNew)).Fcount = uint32(0) @@ -19606,7 +19619,7 @@ func Xsqlite3HashInit(tls *libc.TLS, pNew uintptr) { /* sqlite3.c:32906:21: */ // 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 Xsqlite3HashClear(tls *libc.TLS, pH uintptr) { /* sqlite3.c:32918:21: */ +func Xsqlite3HashClear(tls *libc.TLS, pH uintptr) { /* sqlite3.c:33222:21: */ var elem uintptr // For looping over all elements of the table elem = (*Hash)(unsafe.Pointer(pH)).Ffirst @@ -19623,7 +19636,7 @@ func Xsqlite3HashClear(tls *libc.TLS, pH uintptr) { /* sqlite3.c:32918:21: */ } // The hashing function. -func strHash(tls *libc.TLS, z uintptr) uint32 { /* sqlite3.c:32938:21: */ +func strHash(tls *libc.TLS, z uintptr) uint32 { /* sqlite3.c:33242:21: */ var h uint32 = uint32(0) var c uint8 for (int32(libc.AssignUint8(&c, uint8(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))))) != 0 { //OPTIMIZATION-IF-TRUE @@ -19638,7 +19651,7 @@ func strHash(tls *libc.TLS, z uintptr) uint32 { /* sqlite3.c:32938:21: */ // Link pNew element into the hash table pH. If pEntry!=0 then also // insert pNew into the pEntry hash bucket. -func insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { /* sqlite3.c:32955:13: */ +func insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { /* sqlite3.c:33259:13: */ var pHead uintptr // First element already in pEntry if pEntry != 0 { if (*_ht)(unsafe.Pointer(pEntry)).Fcount != 0 { @@ -19675,13 +19688,13 @@ func insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { /* // 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 *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:32989:12: */ +func rehash(tls *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:33293:12: */ var new_ht uintptr // The new hash table var elem uintptr var next_elem uintptr // For looping over existing elements - if (uint64(new_size) * uint64(unsafe.Sizeof(_ht{}))) > SQLITE_MALLOC_SOFT_LIMIT { - new_size = (uint32(SQLITE_MALLOC_SOFT_LIMIT / uint64(unsafe.Sizeof(_ht{})))) + if (uint64(new_size) * uint64(unsafe.Sizeof(_ht{}))) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { + new_size = (uint32(uint64(SQLITE_MALLOC_SOFT_LIMIT) / uint64(unsafe.Sizeof(_ht{})))) } if new_size == (*Hash)(unsafe.Pointer(pH)).Fhtsize { return 0 @@ -19719,7 +19732,7 @@ func rehash(tls *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:329 // hash table that matches the given key. If no element is found, // a pointer to a static null element with HashElem.data==0 is returned. // If pH is not NULL, then the hash for this key is written to *pH. -func findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr) uintptr { /* sqlite3.c:33030:17: */ +func findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr) uintptr { /* sqlite3.c:33334:17: */ var elem uintptr // Used to loop thru the element list var count uint32 // Number of elements left to test var h uint32 @@ -19748,11 +19761,11 @@ func findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr) return uintptr(unsafe.Pointer(&nullElement)) } -var nullElement = HashElem{} /* sqlite3.c:33038:19 */ +var nullElement = HashElem{} /* sqlite3.c:33342:19 */ // 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 *libc.TLS, pH uintptr, elem uintptr, h uint32) { /* sqlite3.c:33065:13: */ +func removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { /* sqlite3.c:33369:13: */ var pEntry uintptr if (*HashElem)(unsafe.Pointer(elem)).Fprev != 0 { (*HashElem)(unsafe.Pointer((*HashElem)(unsafe.Pointer(elem)).Fprev)).Fnext = (*HashElem)(unsafe.Pointer(elem)).Fnext @@ -19781,7 +19794,7 @@ func removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { // 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 Xsqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) uintptr { /* sqlite3.c:33100:21: */ +func Xsqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) uintptr { /* sqlite3.c:33404:21: */ return (*HashElem)(unsafe.Pointer(findElementWithHash(tls, pH, pKey, uintptr(0)))).Fdata } @@ -19799,7 +19812,7 @@ func Xsqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) uintptr { /* sqli // // If the "data" parameter to this function is NULL, then the // element corresponding to "key" is removed from the hash table. -func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) uintptr { /* sqlite3.c:33120:21: */ +func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) uintptr { /* sqlite3.c:33424:21: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -19848,11 +19861,11 @@ func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) u //************* Begin file opcodes.c **************************************** // Automatically generated. Do not edit // See the tool/mkopcodec.tcl script for details. -func Xsqlite3OpcodeName(tls *libc.TLS, i int32) uintptr { /* sqlite3.c:33166:27: */ +func Xsqlite3OpcodeName(tls *libc.TLS, i int32) uintptr { /* sqlite3.c:33470:27: */ return azName[i] } -var azName = [176]uintptr{ +var azName = [179]uintptr{ /* 0 */ ts + 908, /* "Savepoint\x00" */ /* 1 */ ts + 919, /* "AutoCommit\x00" */ /* 2 */ ts + 931, /* "Transaction\x00" */ @@ -19933,103 +19946,106 @@ var azName = [176]uintptr{ /* 77 */ ts + 2357, /* "Copy\x00r[P2@P3+1]=..." */ /* 78 */ ts + 2384, /* "SCopy\x00r[P2]=r[P1..." */ /* 79 */ ts + 2402, /* "IntCopy\x00r[P2]=r[..." */ - /* 80 */ ts + 2422, /* "ResultRow\x00output..." */ - /* 81 */ ts + 2448, /* "CollSeq\x00" */ - /* 82 */ ts + 2457, /* "AddImm\x00r[P1]=r[P..." */ - /* 83 */ ts + 2479, /* "RealAffinity\x00" */ - /* 84 */ ts + 2493, /* "Cast\x00affinity(r[..." */ - /* 85 */ ts + 2514, /* "Permutation\x00" */ - /* 86 */ ts + 2527, /* "Compare\x00r[P1@P3]..." */ - /* 87 */ ts + 2557, /* "IsTrue\x00r[P2] = c..." */ - /* 88 */ ts + 2602, /* "Offset\x00r[P3] = s..." */ - /* 89 */ ts + 2635, /* "Column\x00r[P3]=PX" */ - /* 90 */ ts + 2651, /* "Affinity\x00affinit..." */ - /* 91 */ ts + 2679, /* "MakeRecord\x00r[P3]..." */ - /* 92 */ ts + 2712, /* "Count\x00r[P2]=coun..." */ - /* 93 */ ts + 2732, /* "ReadCookie\x00" */ - /* 94 */ ts + 2744, /* "SetCookie\x00" */ - /* 95 */ ts + 2755, /* "ReopenIdx\x00root=P..." */ - /* 96 */ ts + 2780, /* "OpenRead\x00root=P2..." */ - /* 97 */ ts + 2804, /* "OpenWrite\x00root=P..." */ - /* 98 */ ts + 2829, /* "OpenDup\x00" */ - /* 99 */ ts + 2838, /* "OpenAutoindex\x00nC..." */ - /* 100 */ ts + 2863, /* "OpenEphemeral\x00nC..." */ - /* 101 */ ts + 2888, /* "BitAnd\x00r[P3]=r[P..." */ - /* 102 */ ts + 2913, /* "BitOr\x00r[P3]=r[P1..." */ - /* 103 */ ts + 2937, /* "ShiftLeft\x00r[P3]=..." */ - /* 104 */ ts + 2966, /* "ShiftRight\x00r[P3]..." */ - /* 105 */ ts + 2996, /* "Add\x00r[P3]=r[P1]+..." */ - /* 106 */ ts + 3018, /* "Subtract\x00r[P3]=r..." */ - /* 107 */ ts + 3045, /* "Multiply\x00r[P3]=r..." */ - /* 108 */ ts + 3072, /* "Divide\x00r[P3]=r[P..." */ - /* 109 */ ts + 3097, /* "Remainder\x00r[P3]=..." */ - /* 110 */ ts + 3125, /* "Concat\x00r[P3]=r[P..." */ - /* 111 */ ts + 3150, /* "SorterOpen\x00" */ - /* 112 */ ts + 3162, /* "BitNot\x00r[P2]= ~r..." */ - /* 113 */ ts + 3183, /* "SequenceTest\x00if(..." */ - /* 114 */ ts + 3227, /* "OpenPseudo\x00P3 co..." */ - /* 115 */ ts + 3258, /* "String8\x00r[P2]='P..." */ - /* 116 */ ts + 3277, /* "Close\x00" */ - /* 117 */ ts + 3284, /* "ColumnsUsed\x00" */ - /* 118 */ ts + 3297, /* "SeekHit\x00seekHit=..." */ - /* 119 */ ts + 3316, /* "Sequence\x00r[P2]=c..." */ - /* 120 */ ts + 3348, /* "NewRowid\x00r[P2]=r..." */ - /* 121 */ ts + 3369, /* "Insert\x00intkey=r[..." */ - /* 122 */ ts + 3400, /* "Delete\x00" */ - /* 123 */ ts + 3408, /* "ResetCount\x00" */ - /* 124 */ ts + 3420, /* "SorterCompare\x00if..." */ - /* 125 */ ts + 3469, /* "SorterData\x00r[P2]..." */ - /* 126 */ ts + 3491, /* "RowData\x00r[P2]=da..." */ - /* 127 */ ts + 3510, /* "Rowid\x00r[P2]=rowi..." */ - /* 128 */ ts + 3528, /* "NullRow\x00" */ - /* 129 */ ts + 3537, /* "SeekEnd\x00" */ - /* 130 */ ts + 3546, /* "IdxInsert\x00key=r[..." */ - /* 131 */ ts + 3566, /* "SorterInsert\x00key..." */ - /* 132 */ ts + 3589, /* "IdxDelete\x00key=r[..." */ - /* 133 */ ts + 3612, /* "DeferredSeek\x00Mov..." */ - /* 134 */ ts + 3655, /* "IdxRowid\x00r[P2]=r..." */ - /* 135 */ ts + 3676, /* "FinishSeek\x00" */ - /* 136 */ ts + 3688, /* "Destroy\x00" */ - /* 137 */ ts + 3697, /* "Clear\x00" */ - /* 138 */ ts + 3704, /* "ResetSorter\x00" */ - /* 139 */ ts + 3717, /* "CreateBtree\x00r[P2..." */ - /* 140 */ ts + 3756, /* "SqlExec\x00" */ - /* 141 */ ts + 3765, /* "ParseSchema\x00" */ - /* 142 */ ts + 3778, /* "LoadAnalysis\x00" */ - /* 143 */ ts + 3792, /* "DropTable\x00" */ - /* 144 */ ts + 3803, /* "DropIndex\x00" */ - /* 145 */ ts + 3814, /* "DropTrigger\x00" */ - /* 146 */ ts + 3827, /* "IntegrityCk\x00" */ - /* 147 */ ts + 3840, /* "RowSetAdd\x00rowset..." */ - /* 148 */ ts + 3867, /* "Param\x00" */ - /* 149 */ ts + 3874, /* "FkCounter\x00fkctr[..." */ - /* 150 */ ts + 3898, /* "Real\x00r[P2]=P4" */ - /* 151 */ ts + 3912, /* "MemMax\x00r[P1]=max..." */ - /* 152 */ ts + 3942, /* "OffsetLimit\x00if r..." */ - /* 153 */ ts + 4011, /* "AggInverse\x00accum..." */ - /* 154 */ ts + 4052, /* "AggStep\x00accum=r[..." */ - /* 155 */ ts + 4087, /* "AggStep1\x00accum=r..." */ - /* 156 */ ts + 4123, /* "AggValue\x00r[P3]=v..." */ - /* 157 */ ts + 4149, /* "AggFinal\x00accum=r..." */ - /* 158 */ ts + 4175, /* "Expire\x00" */ - /* 159 */ ts + 4183, /* "CursorLock\x00" */ - /* 160 */ ts + 4195, /* "CursorUnlock\x00" */ - /* 161 */ ts + 4209, /* "TableLock\x00iDb=P1..." */ - /* 162 */ ts + 4243, /* "VBegin\x00" */ - /* 163 */ ts + 4251, /* "VCreate\x00" */ - /* 164 */ ts + 4260, /* "VDestroy\x00" */ - /* 165 */ ts + 4270, /* "VOpen\x00" */ - /* 166 */ ts + 4277, /* "VColumn\x00r[P3]=vc..." */ - /* 167 */ ts + 4303, /* "VRename\x00" */ - /* 168 */ ts + 4312, /* "Pagecount\x00" */ - /* 169 */ ts + 4323, /* "MaxPgcnt\x00" */ - /* 170 */ ts + 4333, /* "Trace\x00" */ - /* 171 */ ts + 4340, /* "CursorHint\x00" */ - /* 172 */ ts + 4352, /* "ReleaseReg\x00relea..." */ - /* 173 */ ts + 4388, /* "Noop\x00" */ - /* 174 */ ts + 4394, /* "Explain\x00" */ - /* 175 */ ts + 4403, /* "Abortable\x00" */ -} /* sqlite3.c:33167:20 */ + /* 80 */ ts + 2422, /* "ChngCntRow\x00outpu..." */ + /* 81 */ ts + 2446, /* "ResultRow\x00output..." */ + /* 82 */ ts + 2472, /* "CollSeq\x00" */ + /* 83 */ ts + 2481, /* "AddImm\x00r[P1]=r[P..." */ + /* 84 */ ts + 2503, /* "RealAffinity\x00" */ + /* 85 */ ts + 2517, /* "Cast\x00affinity(r[..." */ + /* 86 */ ts + 2538, /* "Permutation\x00" */ + /* 87 */ ts + 2551, /* "Compare\x00r[P1@P3]..." */ + /* 88 */ ts + 2581, /* "IsTrue\x00r[P2] = c..." */ + /* 89 */ ts + 2626, /* "Offset\x00r[P3] = s..." */ + /* 90 */ ts + 2659, /* "Column\x00r[P3]=PX" */ + /* 91 */ ts + 2675, /* "Affinity\x00affinit..." */ + /* 92 */ ts + 2703, /* "MakeRecord\x00r[P3]..." */ + /* 93 */ ts + 2736, /* "Count\x00r[P2]=coun..." */ + /* 94 */ ts + 2756, /* "ReadCookie\x00" */ + /* 95 */ ts + 2768, /* "SetCookie\x00" */ + /* 96 */ ts + 2779, /* "ReopenIdx\x00root=P..." */ + /* 97 */ ts + 2804, /* "OpenRead\x00root=P2..." */ + /* 98 */ ts + 2828, /* "OpenWrite\x00root=P..." */ + /* 99 */ ts + 2853, /* "OpenDup\x00" */ + /* 100 */ ts + 2862, /* "OpenAutoindex\x00nC..." */ + /* 101 */ ts + 2887, /* "OpenEphemeral\x00nC..." */ + /* 102 */ ts + 2912, /* "BitAnd\x00r[P3]=r[P..." */ + /* 103 */ ts + 2937, /* "BitOr\x00r[P3]=r[P1..." */ + /* 104 */ ts + 2961, /* "ShiftLeft\x00r[P3]=..." */ + /* 105 */ ts + 2990, /* "ShiftRight\x00r[P3]..." */ + /* 106 */ ts + 3020, /* "Add\x00r[P3]=r[P1]+..." */ + /* 107 */ ts + 3042, /* "Subtract\x00r[P3]=r..." */ + /* 108 */ ts + 3069, /* "Multiply\x00r[P3]=r..." */ + /* 109 */ ts + 3096, /* "Divide\x00r[P3]=r[P..." */ + /* 110 */ ts + 3121, /* "Remainder\x00r[P3]=..." */ + /* 111 */ ts + 3149, /* "Concat\x00r[P3]=r[P..." */ + /* 112 */ ts + 3174, /* "SorterOpen\x00" */ + /* 113 */ ts + 3186, /* "BitNot\x00r[P2]= ~r..." */ + /* 114 */ ts + 3207, /* "SequenceTest\x00if(..." */ + /* 115 */ ts + 3251, /* "OpenPseudo\x00P3 co..." */ + /* 116 */ ts + 3282, /* "String8\x00r[P2]='P..." */ + /* 117 */ ts + 3301, /* "Close\x00" */ + /* 118 */ ts + 3308, /* "ColumnsUsed\x00" */ + /* 119 */ ts + 3321, /* "SeekScan\x00Scan-ah..." */ + /* 120 */ ts + 3355, /* "SeekHit\x00set P2<=..." */ + /* 121 */ ts + 3383, /* "Sequence\x00r[P2]=c..." */ + /* 122 */ ts + 3415, /* "NewRowid\x00r[P2]=r..." */ + /* 123 */ ts + 3436, /* "Insert\x00intkey=r[..." */ + /* 124 */ ts + 3467, /* "RowCell\x00" */ + /* 125 */ ts + 3476, /* "Delete\x00" */ + /* 126 */ ts + 3484, /* "ResetCount\x00" */ + /* 127 */ ts + 3496, /* "SorterCompare\x00if..." */ + /* 128 */ ts + 3545, /* "SorterData\x00r[P2]..." */ + /* 129 */ ts + 3567, /* "RowData\x00r[P2]=da..." */ + /* 130 */ ts + 3586, /* "Rowid\x00r[P2]=rowi..." */ + /* 131 */ ts + 3604, /* "NullRow\x00" */ + /* 132 */ ts + 3613, /* "SeekEnd\x00" */ + /* 133 */ ts + 3622, /* "IdxInsert\x00key=r[..." */ + /* 134 */ ts + 3642, /* "SorterInsert\x00key..." */ + /* 135 */ ts + 3665, /* "IdxDelete\x00key=r[..." */ + /* 136 */ ts + 3688, /* "DeferredSeek\x00Mov..." */ + /* 137 */ ts + 3731, /* "IdxRowid\x00r[P2]=r..." */ + /* 138 */ ts + 3752, /* "FinishSeek\x00" */ + /* 139 */ ts + 3764, /* "Destroy\x00" */ + /* 140 */ ts + 3773, /* "Clear\x00" */ + /* 141 */ ts + 3780, /* "ResetSorter\x00" */ + /* 142 */ ts + 3793, /* "CreateBtree\x00r[P2..." */ + /* 143 */ ts + 3832, /* "SqlExec\x00" */ + /* 144 */ ts + 3841, /* "ParseSchema\x00" */ + /* 145 */ ts + 3854, /* "LoadAnalysis\x00" */ + /* 146 */ ts + 3868, /* "DropTable\x00" */ + /* 147 */ ts + 3879, /* "DropIndex\x00" */ + /* 148 */ ts + 3890, /* "DropTrigger\x00" */ + /* 149 */ ts + 3903, /* "IntegrityCk\x00" */ + /* 150 */ ts + 3916, /* "RowSetAdd\x00rowset..." */ + /* 151 */ ts + 3943, /* "Param\x00" */ + /* 152 */ ts + 3950, /* "Real\x00r[P2]=P4" */ + /* 153 */ ts + 3964, /* "FkCounter\x00fkctr[..." */ + /* 154 */ ts + 3988, /* "MemMax\x00r[P1]=max..." */ + /* 155 */ ts + 4018, /* "OffsetLimit\x00if r..." */ + /* 156 */ ts + 4087, /* "AggInverse\x00accum..." */ + /* 157 */ ts + 4128, /* "AggStep\x00accum=r[..." */ + /* 158 */ ts + 4163, /* "AggStep1\x00accum=r..." */ + /* 159 */ ts + 4199, /* "AggValue\x00r[P3]=v..." */ + /* 160 */ ts + 4225, /* "AggFinal\x00accum=r..." */ + /* 161 */ ts + 4251, /* "Expire\x00" */ + /* 162 */ ts + 4259, /* "CursorLock\x00" */ + /* 163 */ ts + 4271, /* "CursorUnlock\x00" */ + /* 164 */ ts + 4285, /* "TableLock\x00iDb=P1..." */ + /* 165 */ ts + 4319, /* "VBegin\x00" */ + /* 166 */ ts + 4327, /* "VCreate\x00" */ + /* 167 */ ts + 4336, /* "VDestroy\x00" */ + /* 168 */ ts + 4346, /* "VOpen\x00" */ + /* 169 */ ts + 4353, /* "VColumn\x00r[P3]=vc..." */ + /* 170 */ ts + 4379, /* "VRename\x00" */ + /* 171 */ ts + 4388, /* "Pagecount\x00" */ + /* 172 */ ts + 4399, /* "MaxPgcnt\x00" */ + /* 173 */ ts + 4409, /* "Trace\x00" */ + /* 174 */ ts + 4416, /* "CursorHint\x00" */ + /* 175 */ ts + 4428, /* "ReleaseReg\x00relea..." */ + /* 176 */ ts + 4464, /* "Noop\x00" */ + /* 177 */ ts + 4470, /* "Explain\x00" */ + /* 178 */ ts + 4479, /* "Abortable\x00" */ +} /* sqlite3.c:33471:20 */ //************* End of opcodes.c ******************************************** //************* Begin file os_unix.c **************************************** @@ -20253,76 +20269,6 @@ type stat64 = struct { F__glibc_reserved [3]X__syscall_slong_t } /* stat.h:119:1 */ -// statx-related definitions and declarations. -// Copyright (C) 2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// This interface is based on in Linux. - -type statx_timestamp = struct { - Ftv_sec X__int64_t - Ftv_nsec X__uint32_t - F__statx_timestamp_pad1 [1]X__int32_t -} /* statx.h:25:1 */ - -// Warning: The kernel may add additional fields to this struct in the -// future. Only use this struct for calling the statx function, not -// for storing data. (Expansion will be controlled by the mask -// argument of the statx function.) -type statx = struct { - Fstx_mask X__uint32_t - Fstx_blksize X__uint32_t - Fstx_attributes X__uint64_t - Fstx_nlink X__uint32_t - Fstx_uid X__uint32_t - Fstx_gid X__uint32_t - Fstx_mode X__uint16_t - F__statx_pad1 [1]X__uint16_t - Fstx_ino X__uint64_t - Fstx_size X__uint64_t - Fstx_blocks X__uint64_t - Fstx_attributes_mask X__uint64_t - Fstx_atime struct { - Ftv_sec X__int64_t - Ftv_nsec X__uint32_t - F__statx_timestamp_pad1 [1]X__int32_t - } - Fstx_btime struct { - Ftv_sec X__int64_t - Ftv_nsec X__uint32_t - F__statx_timestamp_pad1 [1]X__int32_t - } - Fstx_ctime struct { - Ftv_sec X__int64_t - Ftv_nsec X__uint32_t - F__statx_timestamp_pad1 [1]X__int32_t - } - Fstx_mtime struct { - Ftv_sec X__int64_t - Ftv_nsec X__uint32_t - F__statx_timestamp_pad1 [1]X__int32_t - } - Fstx_rdev_major X__uint32_t - Fstx_rdev_minor X__uint32_t - Fstx_dev_major X__uint32_t - Fstx_dev_minor X__uint32_t - F__statx_pad2 [14]X__uint64_t -} /* statx.h:36:1 */ - // Copyright (C) 1991-2018 Free Software Foundation, Inc. // This file is part of the GNU C Library. // @@ -20474,7 +20420,7 @@ type flock64 = struct { // License along with the GNU C Library; if not, see // . -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -20896,6 +20842,8 @@ type termio = struct { // The X/Open Unix extensions are available. +// Encryption is present. + // The enhanced internationalization capabilities according to XPG4.2 // are present. @@ -21187,7 +21135,7 @@ type termio = struct { // Never include this file directly; use instead. -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -21276,9 +21224,9 @@ type termio = struct { // The Single Unix specification says that some more types are // available here. -type Intptr_t = X__intptr_t /* unistd.h:267:20 */ +type Intptr_t = X__intptr_t /* unistd.h:270:20 */ -type Socklen_t = X__socklen_t /* unistd.h:274:21 */ +type Socklen_t = X__socklen_t /* unistd.h:277:21 */ // Define some macros helping to catch buffer overflows. @@ -21385,25 +21333,9 @@ type itimerval = struct { // strict C++ rules prevent the automatic promotion. type X__itimer_which_t = uint32 /* time.h:115:29 */ -// Define error_t. -// Copyright (C) 1991-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -type Error_t = int32 /* error_t.h:22:13 */ +// bits/errno.h may have defined this type. If it didn't, provide a +// fallback definition. +type Error_t = int32 /* errno.h:52:13 */ // Try to determine if gethostuuid() is available based on standard // macros. This might sometimes compute the wrong value for some @@ -21444,7 +21376,7 @@ type unixShm = struct { FsharedMask U16 FexclMask U16 _ [2]byte -} /* sqlite3.c:33546:9 */ +} /* sqlite3.c:33854:9 */ // Try to determine if gethostuuid() is available based on standard // macros. This might sometimes compute the wrong value for some @@ -21477,7 +21409,7 @@ type unixShm = struct { // a normal expected return code of SQLITE_BUSY or SQLITE_OK // Forward references -type UnixShm = unixShm /* sqlite3.c:33546:24 */ // Connection shared memory +type UnixShm = unixShm /* sqlite3.c:33854:24 */ // Connection shared memory type unixShmNode = struct { FpInode uintptr FpShmMutex uintptr @@ -21492,10 +21424,11 @@ type unixShmNode = struct { FnRef int32 _ [4]byte FpFirst uintptr -} /* sqlite3.c:33546:9 */ + FaLock [8]int32 +} /* sqlite3.c:33854:9 */ // Connection shared memory -type UnixShmNode = unixShmNode /* sqlite3.c:33547:28 */ // Shared memory instance +type UnixShmNode = unixShmNode /* sqlite3.c:33855:28 */ // Shared memory instance type unixInodeInfo = struct { FfileId struct { Fdev Dev_t @@ -21513,18 +21446,18 @@ type unixInodeInfo = struct { FpShmNode uintptr FpNext uintptr FpPrev uintptr -} /* sqlite3.c:33546:9 */ +} /* sqlite3.c:33854:9 */ // Shared memory instance -type UnixInodeInfo = unixInodeInfo /* sqlite3.c:33548:30 */ // An i-node +type UnixInodeInfo = unixInodeInfo /* sqlite3.c:33856:30 */ // An i-node type UnixUnusedFd1 = struct { Ffd int32 Fflags int32 FpNext uintptr -} /* sqlite3.c:33546:9 */ +} /* sqlite3.c:33854:9 */ // An i-node -type UnixUnusedFd = UnixUnusedFd1 /* sqlite3.c:33549:29 */ +type UnixUnusedFd = UnixUnusedFd1 /* sqlite3.c:33857:29 */ // The unixFile structure is subclass of sqlite3_file specific to the unix // VFS implementations. @@ -21551,18 +21484,18 @@ type unixFile = struct { FsectorSize int32 FdeviceCharacteristics int32 FaPadding [32]int8 -} /* sqlite3.c:33567:9 */ +} /* sqlite3.c:33875:9 */ // The unixFile structure is subclass of sqlite3_file specific to the unix // VFS implementations. -type UnixFile = unixFile /* sqlite3.c:33567:25 */ +type UnixFile = unixFile /* sqlite3.c:33875:25 */ // This variable holds the process id (pid) from when the xRandomness() // method was called. If xOpen() is called from a different process id, // indicating that a fork() has occurred, the PRNG will be reset. -var randomnessPid Pid_t = 0 /* sqlite3.c:33628:14 */ +var randomnessPid Pid_t = 0 /* sqlite3.c:33936:14 */ -func local_ioerr(tls *libc.TLS) { /* sqlite3.c:33812:13: */ +func local_ioerr(tls *libc.TLS) { /* sqlite3.c:34120:13: */ Xsqlite3_io_error_hit++ if !(Xsqlite3_io_error_benign != 0) { @@ -21591,7 +21524,7 @@ func local_ioerr(tls *libc.TLS) { /* sqlite3.c:33812:13: */ // // 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 *libc.TLS, zFile uintptr, flags int32, mode int32) int32 { /* sqlite3.c:33917:12: */ +func posixOpen(tls *libc.TLS, zFile uintptr, flags int32, mode int32) int32 { /* sqlite3.c:34225:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -21606,82 +21539,82 @@ type unix_syscall = struct { FzName uintptr FpCurrent Sqlite3_syscall_ptr FpDefault Sqlite3_syscall_ptr -} /* sqlite3.c:33931:8 */ +} /* sqlite3.c:34239:8 */ // Many system calls are accessed through pointer-to-functions so that // they may be overridden at runtime to facilitate fault injection during // testing and sandboxing. The following array holds the names and pointers // to all overrideable system calls. var aSyscall = [29]unix_syscall{ - {FzName: ts + 4414 /* "open" */, FpCurrent: 0}, + {FzName: ts + 4490 /* "open" */, FpCurrent: 0}, - {FzName: ts + 4419 /* "close" */, FpCurrent: 0}, + {FzName: ts + 4495 /* "close" */, FpCurrent: 0}, - {FzName: ts + 4425 /* "access" */, FpCurrent: 0}, + {FzName: ts + 4501 /* "access" */, FpCurrent: 0}, - {FzName: ts + 4432 /* "getcwd" */, FpCurrent: 0}, + {FzName: ts + 4508 /* "getcwd" */, FpCurrent: 0}, - {FzName: ts + 4439 /* "stat" */, FpCurrent: 0}, + {FzName: ts + 4515 /* "stat" */, FpCurrent: 0}, // The DJGPP compiler environment looks mostly like Unix, but it // lacks the fcntl() system call. So redefine fcntl() to be something // that always succeeds. This means that locking does not occur under // DJGPP. But it is DOS - what did you expect? - {FzName: ts + 4444 /* "fstat" */, FpCurrent: 0}, + {FzName: ts + 4520 /* "fstat" */, FpCurrent: 0}, - {FzName: ts + 4450 /* "ftruncate" */, FpCurrent: 0}, + {FzName: ts + 4526 /* "ftruncate" */, FpCurrent: 0}, - {FzName: ts + 4460 /* "fcntl" */, FpCurrent: 0}, + {FzName: ts + 4536 /* "fcntl" */, FpCurrent: 0}, - {FzName: ts + 4466 /* "read" */, FpCurrent: 0}, + {FzName: ts + 4542 /* "read" */, FpCurrent: 0}, - {FzName: ts + 4471 /* "pread" */}, + {FzName: ts + 4547 /* "pread" */}, - {FzName: ts + 4477 /* "pread64" */}, + {FzName: ts + 4553 /* "pread64" */}, - {FzName: ts + 4485 /* "write" */, FpCurrent: 0}, + {FzName: ts + 4561 /* "write" */, FpCurrent: 0}, - {FzName: ts + 4491 /* "pwrite" */}, + {FzName: ts + 4567 /* "pwrite" */}, - {FzName: ts + 4498 /* "pwrite64" */}, + {FzName: ts + 4574 /* "pwrite64" */}, - {FzName: ts + 4507 /* "fchmod" */, FpCurrent: 0}, + {FzName: ts + 4583 /* "fchmod" */, FpCurrent: 0}, - {FzName: ts + 4514 /* "fallocate" */}, + {FzName: ts + 4590 /* "fallocate" */}, - {FzName: ts + 4524 /* "unlink" */, FpCurrent: 0}, + {FzName: ts + 4600 /* "unlink" */, FpCurrent: 0}, - {FzName: ts + 4531 /* "openDirectory" */, FpCurrent: 0}, + {FzName: ts + 4607 /* "openDirectory" */, FpCurrent: 0}, - {FzName: ts + 4545 /* "mkdir" */, FpCurrent: 0}, + {FzName: ts + 4621 /* "mkdir" */, FpCurrent: 0}, - {FzName: ts + 4551 /* "rmdir" */, FpCurrent: 0}, + {FzName: ts + 4627 /* "rmdir" */, FpCurrent: 0}, - {FzName: ts + 4557 /* "fchown" */, FpCurrent: 0}, + {FzName: ts + 4633 /* "fchown" */, FpCurrent: 0}, - {FzName: ts + 4564 /* "geteuid" */, FpCurrent: 0}, + {FzName: ts + 4640 /* "geteuid" */, FpCurrent: 0}, - {FzName: ts + 4572 /* "mmap" */, FpCurrent: 0}, + {FzName: ts + 4648 /* "mmap" */, FpCurrent: 0}, - {FzName: ts + 4577 /* "munmap" */, FpCurrent: 0}, + {FzName: ts + 4653 /* "munmap" */, FpCurrent: 0}, - {FzName: ts + 4584 /* "mremap" */, FpCurrent: 0}, + {FzName: ts + 4660 /* "mremap" */, FpCurrent: 0}, - {FzName: ts + 4591 /* "getpagesize" */, FpCurrent: 0}, + {FzName: ts + 4667 /* "getpagesize" */, FpCurrent: 0}, - {FzName: ts + 4603 /* "readlink" */, FpCurrent: 0}, + {FzName: ts + 4679 /* "readlink" */, FpCurrent: 0}, - {FzName: ts + 4612 /* "lstat" */, FpCurrent: 0}, + {FzName: ts + 4688 /* "lstat" */, FpCurrent: 0}, - {FzName: ts + 4618 /* "ioctl" */}, -} /* sqlite3.c:33935:3 */ + {FzName: ts + 4694 /* "ioctl" */}, +} /* sqlite3.c:34243:3 */ // End of the overrideable system calls // 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 *libc.TLS, fd int32, uid Uid_t, gid Gid_t) int32 { /* sqlite3.c:34105:12: */ +func robustFchown(tls *libc.TLS, fd int32, uid Uid_t, gid Gid_t) int32 { /* sqlite3.c:34413:12: */ if (*(*func(*libc.TLS) Uid_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 21*24 + 8 /* &.pCurrent */))))(tls) != 0 { return 0 } @@ -21692,7 +21625,7 @@ func robustFchown(tls *libc.TLS, fd int32, uid Uid_t, gid Gid_t) int32 { /* sqli // "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 *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Sqlite3_syscall_ptr) int32 { /* sqlite3.c:34119:12: */ +func unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Sqlite3_syscall_ptr) int32 { /* sqlite3.c:34427:12: */ var i uint32 var rc int32 = SQLITE_NOTFOUND @@ -21729,7 +21662,7 @@ func unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc // 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 *libc.TLS, pNotUsed uintptr, zName uintptr) Sqlite3_syscall_ptr { /* sqlite3.c:34162:28: */ +func unixGetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr) Sqlite3_syscall_ptr { /* sqlite3.c:34470:28: */ var i uint32 _ = pNotUsed @@ -21745,7 +21678,7 @@ func unixGetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr) Sqlite3_s // 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 *libc.TLS, p uintptr, zName uintptr) uintptr { /* sqlite3.c:34181:19: */ +func unixNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) uintptr { /* sqlite3.c:34489:19: */ var i int32 = -1 _ = p @@ -21783,7 +21716,7 @@ func unixNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) uintptr { /* sq // 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 *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3.c:34222:12: */ +func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3.c:34530:12: */ bp := tls.Alloc(160) defer tls.Free(160) @@ -21792,7 +21725,7 @@ func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3 if m != 0 { m2 = m } else { - m2 = SQLITE_DEFAULT_FILE_PERMISSIONS + m2 = uint32(SQLITE_DEFAULT_FILE_PERMISSIONS) } for 1 != 0 { fd = (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 8 /* &.pCurrent */))))(tls, z, (f | 02000000), int32(m2)) @@ -21807,9 +21740,9 @@ func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3 } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 1*24 + 8 /* &.pCurrent */))))(tls, fd) Xsqlite3_log(tls, SQLITE_WARNING, - ts+4624 /* "attempt to open ..." */, libc.VaList(bp, z, fd)) + ts+4700 /* "attempt to open ..." */, libc.VaList(bp, z, fd)) fd = -1 - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 8 /* &.pCurrent */))))(tls, ts+4667 /* "/dev/null" */, O_RDONLY, int32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 8 /* &.pCurrent */))))(tls, ts+4743 /* "/dev/null" */, O_RDONLY, int32(m)) < 0 { break } } @@ -21850,14 +21783,14 @@ func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3 // OK: enter(unixBigLock) // OK: enter(pLockInfo) // ERROR: enter(pLockInfo), enter(unixBigLock) -var unixBigLock uintptr = uintptr(0) /* sqlite3.c:34284:22 */ +var unixBigLock uintptr = uintptr(0) /* sqlite3.c:34592:22 */ -func unixEnterMutex(tls *libc.TLS) { /* sqlite3.c:34285:13: */ +func unixEnterMutex(tls *libc.TLS) { /* sqlite3.c:34593:13: */ // Not a recursive mutex Xsqlite3_mutex_enter(tls, unixBigLock) } -func unixLeaveMutex(tls *libc.TLS) { /* sqlite3.c:34289:13: */ +func unixLeaveMutex(tls *libc.TLS) { /* sqlite3.c:34597:13: */ Xsqlite3_mutex_leave(tls, unixBigLock) } @@ -21865,20 +21798,20 @@ func unixLeaveMutex(tls *libc.TLS) { /* sqlite3.c:34289:13: */ // Helper function for printing out trace information from debugging // binaries. This returns the string representation of the supplied // integer lock-type. -func azFileLock(tls *libc.TLS, eFileLock int32) uintptr { /* sqlite3.c:34306:19: */ +func azFileLock(tls *libc.TLS, eFileLock int32) uintptr { /* sqlite3.c:34614:19: */ switch eFileLock { case NO_LOCK: - return ts + 4677 /* "NONE" */ + return ts + 4753 /* "NONE" */ case SHARED_LOCK: - return ts + 4682 /* "SHARED" */ + return ts + 4758 /* "SHARED" */ case RESERVED_LOCK: - return ts + 4689 /* "RESERVED" */ + return ts + 4765 /* "RESERVED" */ case PENDING_LOCK: - return ts + 4698 /* "PENDING" */ + return ts + 4774 /* "PENDING" */ case EXCLUSIVE_LOCK: - return ts + 4706 /* "EXCLUSIVE" */ + return ts + 4782 /* "EXCLUSIVE" */ } - return ts + 4716 /* "ERROR" */ + return ts + 4792 /* "ERROR" */ } // Retry ftruncate() calls that fail due to EINTR @@ -21886,7 +21819,7 @@ func azFileLock(tls *libc.TLS, eFileLock int32) uintptr { /* sqlite3.c:34306:19: // 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 *libc.TLS, h int32, sz Sqlite3_int64) int32 { /* sqlite3.c:34385:12: */ +func robust_ftruncate(tls *libc.TLS, h int32, sz Sqlite3_int64) int32 { /* sqlite3.c:34693:12: */ var rc int32 for ok := true; ok; ok = ((rc < 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == EINTR)) { rc = (*(*func(*libc.TLS, int32, Off_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 6*24 + 8 /* &.pCurrent */))))(tls, h, int64(sz)) @@ -21902,7 +21835,7 @@ func robust_ftruncate(tls *libc.TLS, h int32, sz Sqlite3_int64) int32 { /* sqlit // // Errors during initialization of locks, or file system support for locks, // should handle ENOLCK, ENOTSUP, EOPNOTSUPP separately. -func sqliteErrorFromPosixError(tls *libc.TLS, posixError int32, sqliteIOErr int32) int32 { /* sqlite3.c:34410:12: */ +func sqliteErrorFromPosixError(tls *libc.TLS, posixError int32, sqliteIOErr int32) int32 { /* sqlite3.c:34718:12: */ switch posixError { case EACCES: @@ -21951,7 +21884,7 @@ type vxworksFileId = struct { FnRef int32 FnName int32 FzCanonicalName uintptr -} /* sqlite3.c:34452:1 */ +} /* sqlite3.c:34760:1 */ // ************** End of Unique File ID Utility Used By VxWorks **************** // @@ -22052,12 +21985,12 @@ type vxworksFileId = struct { type unixFileId = struct { Fdev Dev_t Fino U64 -} /* sqlite3.c:33546:9 */ +} /* sqlite3.c:33854:9 */ // A lists of all unixInodeInfo objects. // // Must hold unixBigLock in order to read or write this variable. -var inodeList uintptr = uintptr(0) /* sqlite3.c:34734:22 */ +var inodeList uintptr = uintptr(0) /* sqlite3.c:35042:22 */ // All unixInodeInfo objects @@ -22075,7 +22008,7 @@ var inodeList uintptr = uintptr(0) /* sqlite3.c:34734:22 */ // The two subsequent arguments should be the name of the OS function that // failed (e.g. "unlink", "open") and the associated file-system path, // if any. -func unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uintptr, iLine int32) int32 { /* sqlite3.c:34769:12: */ +func unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uintptr, iLine int32) int32 { /* sqlite3.c:35077:12: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -22092,7 +22025,7 @@ func unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uintp zPath = ts + 800 /* "" */ } Xsqlite3_log(tls, errcode, - ts+4722, /* "os_unix.c:%d: (%..." */ + ts+4798, /* "os_unix.c:%d: (%..." */ libc.VaList(bp, iLine, iErrno, zFunc, zPath, zErr)) return errcode @@ -22109,9 +22042,9 @@ func unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uintp // 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 *libc.TLS, pFile uintptr, h int32, lineno int32) { /* sqlite3.c:34834:13: */ +func robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { /* sqlite3.c:35142:13: */ if (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 1*24 + 8 /* &.pCurrent */))))(tls, h) != 0 { - unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(16) << 8)), ts+4419, /* "close" */ + unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(16) << 8)), ts+4495, /* "close" */ func() uintptr { if pFile != 0 { return (*UnixFile)(unsafe.Pointer(pFile)).FzPath @@ -22123,19 +22056,19 @@ func robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { /* sqli // Set the pFile->lastErrno. Do this in a subroutine as that provides // a convenient place to set a breakpoint. -func storeLastErrno(tls *libc.TLS, pFile uintptr, error int32) { /* sqlite3.c:34845:13: */ +func storeLastErrno(tls *libc.TLS, pFile uintptr, error int32) { /* sqlite3.c:35153:13: */ (*UnixFile)(unsafe.Pointer(pFile)).FlastErrno = error } // Close all file descriptors accumuated in the unixInodeInfo->pUnused list. -func closePendingFds(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:34852:13: */ +func closePendingFds(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35160:13: */ var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode var p uintptr var pNext uintptr for p = (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpUnused; p != 0; p = pNext { pNext = (*UnixUnusedFd)(unsafe.Pointer(p)).FpNext - robust_close(tls, pFile, (*UnixUnusedFd)(unsafe.Pointer(p)).Ffd, 34859) + robust_close(tls, pFile, (*UnixUnusedFd)(unsafe.Pointer(p)).Ffd, 35167) Xsqlite3_free(tls, p) } (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpUnused = uintptr(0) @@ -22145,7 +22078,7 @@ func closePendingFds(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:34852:13: */ // // The global mutex must be held when this routine is called, but the mutex // on the inode being deleted must NOT be held. -func releaseInodeInfo(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:34871:13: */ +func releaseInodeInfo(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35179:13: */ var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode if pInode != 0 { @@ -22179,7 +22112,7 @@ func releaseInodeInfo(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:34871:13: */ // The global mutex must held when calling this routine. // // Return an appropriate error code. -func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sqlite3.c:34908:12: */ +func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sqlite3.c:35216:12: */ bp := tls.Alloc(160) defer tls.Free(160) @@ -22238,7 +22171,7 @@ func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sql } // Return TRUE if pFile has been renamed or unlinked since it was first opened. -func fileHasMoved(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:35000:12: */ +func fileHasMoved(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:35308:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -22255,7 +22188,7 @@ func fileHasMoved(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:35000:12: * // (3) The file has not been renamed or unlinked // // Issue sqlite3_log(SQLITE_WARNING,...) messages if anything is not right. -func verifyDbFile(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35021:13: */ +func verifyDbFile(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35329:13: */ bp := tls.Alloc(176) defer tls.Free(176) @@ -22270,19 +22203,19 @@ func verifyDbFile(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35021:13: */ rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 5*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, bp+32 /* &buf */) if rc != 0 { - Xsqlite3_log(tls, SQLITE_WARNING, ts+4753 /* "cannot fstat db ..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, SQLITE_WARNING, ts+4829 /* "cannot fstat db ..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) return } if (*stat)(unsafe.Pointer(bp+32 /* &buf */)).Fst_nlink == uint64(0) { - Xsqlite3_log(tls, SQLITE_WARNING, ts+4777 /* "file unlinked wh..." */, libc.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, SQLITE_WARNING, ts+4853 /* "file unlinked wh..." */, libc.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) return } if (*stat)(unsafe.Pointer(bp+32 /* &buf */)).Fst_nlink > uint64(1) { - Xsqlite3_log(tls, SQLITE_WARNING, ts+4806 /* "multiple links t..." */, libc.VaList(bp+16, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, SQLITE_WARNING, ts+4882 /* "multiple links t..." */, libc.VaList(bp+16, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) return } if fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, SQLITE_WARNING, ts+4833 /* "file renamed whi..." */, libc.VaList(bp+24, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, SQLITE_WARNING, ts+4909 /* "file renamed whi..." */, libc.VaList(bp+24, (*UnixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -22291,7 +22224,7 @@ func verifyDbFile(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35021:13: */ // 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 *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:35054:12: */ +func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:35362:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -22315,10 +22248,10 @@ func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { / if !(reserved != 0) && !(int32((*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FbProcessLock) != 0) { // var lock flock at bp+32, 32 - (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 1)) (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_len = int64(1) - (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_type = int16(F_WRLCK) if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_GETLK64, libc.VaList(bp, bp+32 /* &lock */)) != 0 { rc = (SQLITE_IOERR | (int32(14) << 8)) storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) @@ -22329,7 +22262,7 @@ func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { / Xsqlite3_mutex_leave(tls, (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FpLockMutex) if Xsqlite3OSTrace != 0 { - Xsqlite3DebugPrintf(tls, ts+4861 /* "TEST WR-LOCK %d ..." */, libc.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).Fh, rc, reserved)) + Xsqlite3DebugPrintf(tls, ts+4937 /* "TEST WR-LOCK %d ..." */, libc.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).Fh, rc, reserved)) } *(*int32)(unsafe.Pointer(pResOut)) = reserved @@ -22365,7 +22298,7 @@ func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { / // // 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 *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite3.c:35152:12: */ +func unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite3.c:35463:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -22376,10 +22309,10 @@ func unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite if int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0 { // var lock flock at bp+16, 32 - (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_len = SHARED_SIZE - (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_len = int64(SHARED_SIZE) + (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_type = int16(F_WRLCK) rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, F_SETLK64, libc.VaList(bp, bp+16 /* &lock */)) if rc < 0 { return rc @@ -22417,7 +22350,7 @@ func unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite // // This routine will only increase a lock. Use the sqlite3OsUnlock() // routine to lower a locking level. -func unixLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35202:12: */ +func unixLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35513:12: */ bp := tls.Alloc(120) defer tls.Free(120) @@ -22472,7 +22405,7 @@ func unixLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:3 if !(Xsqlite3OSTrace != 0) { goto __1 } - Xsqlite3DebugPrintf(tls, ts+4891 /* "LOCK %d %s wa..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, azFileLock(tls, eFileLock), azFileLock(tls, int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock)), azFileLock(tls, int32((*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FeFileLock)), (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FnShared, libc.Xgetpid(tls))) + Xsqlite3DebugPrintf(tls, ts+4967 /* "LOCK %d %s wa..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, azFileLock(tls, eFileLock), azFileLock(tls, int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock)), azFileLock(tls, int32((*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FeFileLock)), (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FnShared, libc.Xgetpid(tls))) __1: ; @@ -22485,7 +22418,7 @@ __1: if !(Xsqlite3OSTrace != 0) { goto __3 } - Xsqlite3DebugPrintf(tls, ts+4934 /* "LOCK %d %s ok..." */, libc.VaList(bp+48, (*UnixFile)(unsafe.Pointer(pFile)).Fh, azFileLock(tls, eFileLock))) + Xsqlite3DebugPrintf(tls, ts+5010 /* "LOCK %d %s ok..." */, libc.VaList(bp+48, (*UnixFile)(unsafe.Pointer(pFile)).Fh, azFileLock(tls, eFileLock))) __3: ; return SQLITE_OK @@ -22518,7 +22451,7 @@ __4: goto __5 } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared++ (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnLock++ goto end_lock @@ -22529,16 +22462,16 @@ __5: // acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will // be released. (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = 1 - (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_whence = int16(SEEK_SET) if !((eFileLock == SHARED_LOCK) || ((eFileLock == EXCLUSIVE_LOCK) && (int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock) < PENDING_LOCK))) { goto __6 } (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_type = func() int16 { if eFileLock == SHARED_LOCK { - return F_RDLCK + return int16(F_RDLCK) } - return F_WRLCK + return int16(F_WRLCK) }() (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte) if !(unixFileLock(tls, pFile, bp+88 /* &lock */) != 0) { @@ -22566,7 +22499,7 @@ __6: // Now get the read-lock (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = SHARED_SIZE + (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = int64(SHARED_SIZE) if !(unixFileLock(tls, pFile, bp+88 /* &lock */) != 0) { goto __11 } @@ -22578,7 +22511,7 @@ __11: // Drop the temporary PENDING lock (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte) (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = 1 - (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_type = F_UNLCK + (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_type = int16(F_UNLCK) if !((unixFileLock(tls, pFile, bp+88 /* &lock */) != 0) && (rc == SQLITE_OK)) { goto __12 } @@ -22600,7 +22533,7 @@ __15: goto end_lock goto __14 __13: - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnLock++ (*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared = 1 __14: @@ -22619,7 +22552,7 @@ __16: // assumed that there is a SHARED or greater lock on the file // already. ; - (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_type = int16(F_WRLCK) if !(eFileLock == RESERVED_LOCK) { goto __18 @@ -22629,7 +22562,7 @@ __16: goto __19 __18: (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = SHARED_SIZE + (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = int64(SHARED_SIZE) __19: ; @@ -22661,8 +22594,8 @@ __22: if !(eFileLock == EXCLUSIVE_LOCK) { goto __24 } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = PENDING_LOCK - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = PENDING_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(PENDING_LOCK) + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(PENDING_LOCK) __24: ; __23: @@ -22673,11 +22606,11 @@ end_lock: if !(Xsqlite3OSTrace != 0) { goto __25 } - Xsqlite3DebugPrintf(tls, ts+4974 /* "LOCK %d %s %s..." */, libc.VaList(bp+64, (*UnixFile)(unsafe.Pointer(pFile)).Fh, azFileLock(tls, eFileLock), func() uintptr { + Xsqlite3DebugPrintf(tls, ts+5050 /* "LOCK %d %s %s..." */, libc.VaList(bp+64, (*UnixFile)(unsafe.Pointer(pFile)).Fh, azFileLock(tls, eFileLock), func() uintptr { if rc == SQLITE_OK { - return ts + 4999 /* "ok" */ + return ts + 5075 /* "ok" */ } - return ts + 5002 /* "failed" */ + return ts + 5078 /* "failed" */ }())) __25: ; @@ -22686,7 +22619,7 @@ __25: // Add the file descriptor used by file handle pFile to the corresponding // pUnused list. -func setPendingFd(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35429:13: */ +func setPendingFd(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35740:13: */ var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode var p uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused @@ -22707,7 +22640,7 @@ func setPendingFd(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35429:13: */ // 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 *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock int32) int32 { /* sqlite3.c:35452:12: */ +func posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock int32) int32 { /* sqlite3.c:35763:12: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -22722,7 +22655,7 @@ func posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock int if !(Xsqlite3OSTrace != 0) { goto __1 } - Xsqlite3DebugPrintf(tls, ts+5009 /* "UNLOCK %d %d wa..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, eFileLock, int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock), int32((*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FeFileLock), (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FnShared, libc.Xgetpid(tls))) + Xsqlite3DebugPrintf(tls, ts+5085 /* "UNLOCK %d %d wa..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, eFileLock, int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock), int32((*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FeFileLock), (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FnShared, libc.Xgetpid(tls))) __1: ; @@ -22752,10 +22685,10 @@ __2: } _ = handleNFSUnlock - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = F_RDLCK - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = int16(F_RDLCK) + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2)) - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_len = SHARED_SIZE + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_len = int64(SHARED_SIZE) if !(unixFileLock(tls, pFile, bp+48 /* &lock */) != 0) { goto __5 } @@ -22773,14 +22706,14 @@ __5: __4: ; - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = F_UNLCK - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = int16(F_UNLCK) + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte) (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_len = 2 if !(unixFileLock(tls, pFile, bp+48 /* &lock */) == 0) { goto __6 } - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = SHARED_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(SHARED_LOCK) goto __7 __6: rc = (SQLITE_IOERR | (int32(8) << 8)) @@ -22800,19 +22733,19 @@ __3: if !((*UnixInodeInfo)(unsafe.Pointer(pInode)).FnShared == 0) { goto __9 } - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = F_UNLCK - (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = int16(F_UNLCK) + (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = libc.AssignPtrInt64(bp+48 /* &lock */ +16 /* &.l_len */, 0) if !(unixFileLock(tls, pFile, bp+48 /* &lock */) == 0) { goto __10 } - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = NO_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(NO_LOCK) goto __11 __10: rc = (SQLITE_IOERR | (int32(8) << 8)) storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = NO_LOCK - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = NO_LOCK + (*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(NO_LOCK) + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(NO_LOCK) __11: ; __9: @@ -22848,7 +22781,7 @@ __13: // // 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 *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35612:12: */ +func unixUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35923:12: */ return posixUnlock(tls, id, eFileLock, 0) } @@ -22861,18 +22794,18 @@ func unixUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c // 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 *libc.TLS, id uintptr) int32 { /* sqlite3.c:35634:12: */ +func closeUnixFile(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35945:12: */ bp := tls.Alloc(8) defer tls.Free(8) var pFile uintptr = id unixUnmapfile(tls, pFile) if (*UnixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - robust_close(tls, pFile, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 35640) + robust_close(tls, pFile, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 35951) (*UnixFile)(unsafe.Pointer(pFile)).Fh = -1 } if Xsqlite3OSTrace != 0 { - Xsqlite3DebugPrintf(tls, ts+5052 /* "CLOSE %-3d\n" */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh)) + Xsqlite3DebugPrintf(tls, ts+5128 /* "CLOSE %-3d\n" */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh)) } libc.AtomicAddInt32(&Xsqlite3_open_file_count, int32(-1)) Xsqlite3_free(tls, (*UnixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -22881,7 +22814,7 @@ func closeUnixFile(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35634:12: */ } // Close a file. -func unixClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35669:12: */ +func unixClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35980:12: */ var rc int32 = SQLITE_OK var pFile uintptr = id var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode @@ -22904,6 +22837,7 @@ func unixClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35669:12: */ } Xsqlite3_mutex_leave(tls, (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex) releaseInodeInfo(tls, pFile) + rc = closeUnixFile(tls, id) unixLeaveMutex(tls) return rc @@ -22930,26 +22864,26 @@ func unixClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35669:12: */ // database connections are accessing the same database file at the same // time and one or more of those connections are writing. -func nolockCheckReservedLock(tls *libc.TLS, NotUsed uintptr, pResOut uintptr) int32 { /* sqlite3.c:35720:12: */ +func nolockCheckReservedLock(tls *libc.TLS, NotUsed uintptr, pResOut uintptr) int32 { /* sqlite3.c:36032:12: */ _ = NotUsed *(*int32)(unsafe.Pointer(pResOut)) = 0 return SQLITE_OK } -func nolockLock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:35725:12: */ +func nolockLock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:36037:12: */ _ = NotUsed _ = NotUsed2 return SQLITE_OK } -func nolockUnlock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:35729:12: */ +func nolockUnlock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:36041:12: */ _ = NotUsed _ = NotUsed2 return SQLITE_OK } // Close the file. -func nolockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35737:12: */ +func nolockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36049:12: */ return closeUnixFile(tls, id) } @@ -22990,7 +22924,7 @@ func nolockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35737:12: */ // 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 *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:35782:12: */ +func dotlockCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:36094:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -23005,7 +22939,7 @@ func dotlockCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 reserved = (libc.Bool32((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 2*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext, 0) == 0)) if Xsqlite3OSTrace != 0 { - Xsqlite3DebugPrintf(tls, ts+5066 /* "TEST WR-LOCK %d ..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, rc, reserved)) + Xsqlite3DebugPrintf(tls, ts+5142 /* "TEST WR-LOCK %d ..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, rc, reserved)) } *(*int32)(unsafe.Pointer(pResOut)) = reserved return rc @@ -23036,7 +22970,7 @@ func dotlockCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 // // With dotfile locking, we really only support state (4): EXCLUSIVE. // But we track the other locking levels internally. -func dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35823:12: */ +func dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:36135:12: */ var pFile uintptr = id var zLockFile uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext var rc int32 = SQLITE_OK @@ -23078,7 +23012,7 @@ func dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3. // the requested locking level, this routine is a no-op. // // When the locking level reaches NO_LOCK, delete the lock file. -func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35873:12: */ +func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:36185:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -23087,7 +23021,7 @@ func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite var rc int32 if Xsqlite3OSTrace != 0 { - Xsqlite3DebugPrintf(tls, ts+5099 /* "UNLOCK %d %d wa..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, eFileLock, int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock), libc.Xgetpid(tls))) + Xsqlite3DebugPrintf(tls, ts+5175 /* "UNLOCK %d %d wa..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, eFileLock, int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock), libc.Xgetpid(tls))) } // no-op if possible @@ -23098,7 +23032,7 @@ func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite // To downgrade to shared, simply update our internal notion of the // lock state. No need to mess with the file on disk. if eFileLock == SHARED_LOCK { - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = SHARED_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(SHARED_LOCK) return SQLITE_OK } @@ -23115,12 +23049,12 @@ func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite } return rc } - (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = NO_LOCK + (*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(NO_LOCK) return SQLITE_OK } // Close a file. Make sure the lock has been released before closing. -func dotlockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35916:12: */ +func dotlockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:36228:12: */ var pFile uintptr = id dotlockUnlock(tls, id, NO_LOCK) @@ -23219,7 +23153,7 @@ func dotlockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35916:12: */ // // To avoid stomping the errno value on a failed read the lastErrno value // is set before returning. -func seekAndRead(tls *libc.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:36830:12: */ +func seekAndRead(tls *libc.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:37142:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -23259,7 +23193,7 @@ func seekAndRead(tls *libc.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, } if Xsqlite3OSTrace != 0 { - Xsqlite3DebugPrintf(tls, ts+5138 /* "READ %-3d %5d..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(id)).Fh, (got+prior), (offset-Sqlite3_int64(prior)), uint64(0))) + Xsqlite3DebugPrintf(tls, ts+5214 /* "READ %-3d %5d..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(id)).Fh, (got+prior), (offset-Sqlite3_int64(prior)), uint64(0))) } return (got + prior) } @@ -23267,7 +23201,7 @@ func seekAndRead(tls *libc.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, // 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 *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:36879:12: */ +func unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:37191:12: */ var pFile uintptr = id var got int32 @@ -23293,7 +23227,20 @@ func unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3 if got == amt { return SQLITE_OK } else if got < 0 { - // lastErrno set by seekAndRead + // pFile->lastErrno has been set by seekAndRead(). + // Usually we return SQLITE_IOERR_READ here, though for some + // kinds of errors we return SQLITE_IOERR_CORRUPTFS. The + // SQLITE_IOERR_CORRUPTFS will be converted into SQLITE_CORRUPT + // prior to returning to the application by the sqlite3ApiExit() + // routine. + switch (*UnixFile)(unsafe.Pointer(pFile)).FlastErrno { + case ERANGE: + fallthrough + case EIO: + fallthrough + case ENXIO: + return (SQLITE_IOERR | (int32(33) << 8)) + } return (SQLITE_IOERR | (int32(1) << 8)) } else { storeLastErrno(tls, pFile, 0) // not a system error @@ -23309,7 +23256,7 @@ func unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3 // 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 *libc.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32, piErrno uintptr) int32 { /* sqlite3.c:36938:12: */ +func seekAndWriteFd(tls *libc.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32, piErrno uintptr) int32 { /* sqlite3.c:37267:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -23332,7 +23279,7 @@ func seekAndWriteFd(tls *libc.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32, } if Xsqlite3OSTrace != 0 { - Xsqlite3DebugPrintf(tls, ts+5167 /* "WRITE %-3d %5d..." */, libc.VaList(bp, fd, rc, iOff, uint64(0))) + Xsqlite3DebugPrintf(tls, ts+5243 /* "WRITE %-3d %5d..." */, libc.VaList(bp, fd, rc, iOff, uint64(0))) } if rc < 0 { @@ -23346,13 +23293,13 @@ func seekAndWriteFd(tls *libc.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32, // // To avoid stomping the errno value on a failed write the lastErrno value // is set before returning. -func seekAndWrite(tls *libc.TLS, id uintptr, offset I64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:36984:12: */ +func seekAndWrite(tls *libc.TLS, id uintptr, offset I64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:37313:12: */ return seekAndWriteFd(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, offset, pBuf, cnt, (id + 32 /* &.lastErrno */)) } // Write data from a buffer into a file. Return SQLITE_OK on success // or some other error code on failure. -func unixWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:36993:12: */ +func unixWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:37322:12: */ var pFile uintptr = id var wrote int32 = 0 @@ -23397,8 +23344,8 @@ func unixWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite // Count the number of fullsyncs and normal syncs. This is used to test // that syncs and fullsyncs are occurring at the right times. -var Xsqlite3_sync_count int32 = 0 /* sqlite3.c:37078:16 */ -var Xsqlite3_fullsync_count int32 = 0 /* sqlite3.c:37079:16 */ +var Xsqlite3_sync_count int32 = 0 /* sqlite3.c:37407:16 */ +var Xsqlite3_fullsync_count int32 = 0 /* sqlite3.c:37408:16 */ // We do not trust systems to provide a working fdatasync(). Some do. // Others do no. To be safe, we will stick with the (slightly slower) @@ -23431,7 +23378,7 @@ var Xsqlite3_fullsync_count int32 = 0 /* sqlite3.c:37079:16 */ // 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 *libc.TLS, fd int32, fullSync int32, dataOnly int32) int32 { /* sqlite3.c:37128:12: */ +func full_fsync(tls *libc.TLS, fd int32, fullSync int32, dataOnly int32) int32 { /* sqlite3.c:37457:12: */ var rc int32 // The following "ifdef/elif/else/" block has the same structure as @@ -23481,7 +23428,7 @@ func full_fsync(tls *libc.TLS, fd int32, fullSync int32, dataOnly int32) int32 { // // If SQLITE_OK is returned, the caller is responsible for closing // the file descriptor *pFd using close(). -func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sqlite3.c:37224:12: */ +func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sqlite3.c:37553:12: */ bp := tls.Alloc(537) defer tls.Free(537) @@ -23503,14 +23450,14 @@ func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sql fd = robust_open(tls, bp+24 /* &zDirname[0] */, (O_RDONLY | O_BINARY), uint32(0)) if fd >= 0 { if Xsqlite3OSTrace != 0 { - Xsqlite3DebugPrintf(tls, ts+5196 /* "OPENDIR %-3d %s\n" */, libc.VaList(bp+8, fd, bp+24 /* &zDirname[0] */)) + Xsqlite3DebugPrintf(tls, ts+5272 /* "OPENDIR %-3d %s\n" */, libc.VaList(bp+8, fd, bp+24 /* &zDirname[0] */)) } } *(*int32)(unsafe.Pointer(pFd)) = fd if fd >= 0 { return SQLITE_OK } - return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 37243), ts+4531 /* "openDirectory" */, bp+24 /* &zDirname[0] */, 37243) + return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 37572), ts+4607 /* "openDirectory" */, bp+24 /* &zDirname[0] */, 37572) } // Make sure all writes to a particular file are committed to disk. @@ -23526,7 +23473,7 @@ func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sql // 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 *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37261:12: */ +func unixSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37590:12: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -23552,7 +23499,7 @@ func unixSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37261 } if Xsqlite3OSTrace != 0 { - Xsqlite3DebugPrintf(tls, ts+5213 /* "SYNC %-3d\n" */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh)) + Xsqlite3DebugPrintf(tls, ts+5289 /* "SYNC %-3d\n" */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh)) } rc = full_fsync(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (libc.PostDecAtomicInt32(&Xsqlite3_io_error_pending, 1) == 1) { @@ -23562,7 +23509,7 @@ func unixSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37261 if rc != 0 { storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(4) << 8)), ts+5227 /* "full_fsync" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37284) + return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(4) << 8)), ts+5303 /* "full_fsync" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37613) } // Also fsync the directory containing the file if the DIRSYNC flag @@ -23572,12 +23519,12 @@ func unixSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37261 // var dirfd int32 at bp+32, 4 if Xsqlite3OSTrace != 0 { - Xsqlite3DebugPrintf(tls, ts+5238 /* "DIRSYNC %s (have..." */, libc.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, HAVE_FULLFSYNC, isFullsync)) + Xsqlite3DebugPrintf(tls, ts+5314 /* "DIRSYNC %s (have..." */, libc.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, HAVE_FULLFSYNC, isFullsync)) } rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 17*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, bp+32 /* &dirfd */) if rc == SQLITE_OK { full_fsync(tls, *(*int32)(unsafe.Pointer(bp + 32 /* dirfd */)), 0, 0) - robust_close(tls, pFile, *(*int32)(unsafe.Pointer(bp + 32 /* dirfd */)), 37298) + robust_close(tls, pFile, *(*int32)(unsafe.Pointer(bp + 32 /* dirfd */)), 37627) } else { rc = SQLITE_OK @@ -23588,7 +23535,7 @@ func unixSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37261 } // Truncate an open file to a specified size -func unixTruncate(tls *libc.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:37311:12: */ +func unixTruncate(tls *libc.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:37640:12: */ var pFile uintptr = id var rc int32 @@ -23608,7 +23555,7 @@ func unixTruncate(tls *libc.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:373 rc = robust_ftruncate(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, nByte) if rc != 0 { storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(6) << 8)), ts+4450 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37329) + return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(6) << 8)), ts+4526 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37658) } else { // If the file was just truncated to a size smaller than the currently @@ -23624,7 +23571,7 @@ func unixTruncate(tls *libc.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:373 } // Determine the current size of a file in bytes -func unixFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:37361:12: */ +func unixFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:37690:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -23659,7 +23606,7 @@ func unixFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c // 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 *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c:37399:12: */ +func fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c:37728:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -23704,7 +23651,7 @@ func fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c if (*UnixFile)(unsafe.Pointer(pFile)).FszChunk <= 0 { if robust_ftruncate(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, nByte) != 0 { storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(6) << 8)), ts+4450 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37450) + return unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(6) << 8)), ts+4526 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37779) } } @@ -23719,7 +23666,7 @@ func fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c // 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 *libc.TLS, pFile uintptr, mask uint8, pArg uintptr) { /* sqlite3.c:37468:13: */ +func unixModeBit(tls *libc.TLS, pFile uintptr, mask uint8, pArg uintptr) { /* sqlite3.c:37797:13: */ if *(*int32)(unsafe.Pointer(pArg)) < 0 { *(*int32)(unsafe.Pointer(pArg)) = (libc.Bool32((int32((*UnixFile)(unsafe.Pointer(pFile)).FctrlFlags) & int32(mask)) != 0)) } else if (*(*int32)(unsafe.Pointer(pArg))) == 0 { @@ -23730,7 +23677,7 @@ func unixModeBit(tls *libc.TLS, pFile uintptr, mask uint8, pArg uintptr) { /* sq } // Information and control of an open file handle. -func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:37484:12: */ +func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:37813:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -23766,13 +23713,13 @@ func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { } case SQLITE_FCNTL_PERSIST_WAL: { - unixModeBit(tls, pFile, UNIXFILE_PERSIST_WAL, pArg) + unixModeBit(tls, pFile, uint8(UNIXFILE_PERSIST_WAL), pArg) return SQLITE_OK } case SQLITE_FCNTL_POWERSAFE_OVERWRITE: { - unixModeBit(tls, pFile, UNIXFILE_PSOW, pArg) + unixModeBit(tls, pFile, uint8(UNIXFILE_PSOW), pArg) return SQLITE_OK } @@ -23835,7 +23782,7 @@ func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { // // There are two versions of this function. One for QNX and one for all // other systems. -func setDeviceCharacteristics(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37610:13: */ +func setDeviceCharacteristics(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37939:13: */ if (*UnixFile)(unsafe.Pointer(pFd)).FsectorSize == 0 { @@ -23856,7 +23803,7 @@ func setDeviceCharacteristics(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37610:1 // if two files are created in the same file-system directory (i.e. // a database and its journal file) that the sector size will be the // same for both. -func unixSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:37717:12: */ +func unixSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:38046:12: */ var pFd uintptr = id setDeviceCharacteristics(tls, pFd) return (*UnixFile)(unsafe.Pointer(pFd)).FsectorSize @@ -23873,7 +23820,7 @@ func unixSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:37717:12: */ // 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 *libc.TLS, id uintptr) int32 { /* sqlite3.c:37736:12: */ +func unixDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:38065:12: */ var pFd uintptr = id setDeviceCharacteristics(tls, pFd) return (*UnixFile)(unsafe.Pointer(pFd)).FdeviceCharacteristics @@ -23883,7 +23830,7 @@ func unixDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:3 // // This function should not be called directly by other code in this file. // Instead, it should be called via macro osGetpagesize(). -func unixGetpagesize(tls *libc.TLS) int32 { /* sqlite3.c:37750:12: */ +func unixGetpagesize(tls *libc.TLS) int32 { /* sqlite3.c:38079:12: */ return int32(libc.Xsysconf(tls, X_SC_PAGESIZE)) } @@ -23893,7 +23840,7 @@ func unixGetpagesize(tls *libc.TLS) int32 { /* sqlite3.c:37750:12: */ // // Locks block if the mask is exactly UNIX_SHM_C and are non-blocking // otherwise. -func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, n int32) int32 { /* sqlite3.c:37846:12: */ +func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, n int32) int32 { /* sqlite3.c:38176:12: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -23913,7 +23860,7 @@ func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, var res int32 // Initialize the locking parameters (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_type = int16(lockType) - (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_start = X__off64_t(ofst) (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_len = X__off64_t(n) res = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_SETLK64, libc.VaList(bp, bp+8 /* &f */)) @@ -23934,7 +23881,7 @@ func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, // 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 *libc.TLS) int32 { /* sqlite3.c:37931:12: */ +func unixShmRegionPerMap(tls *libc.TLS) int32 { /* sqlite3.c:38261:12: */ var shmsz int32 = (32 * 1024) // SHM region size var pgsz int32 = (*(*func(*libc.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 25*24 + 8 /* &.pCurrent */))))(tls) // System page size // Page size must be a power of 2 @@ -23948,7 +23895,7 @@ func unixShmRegionPerMap(tls *libc.TLS) int32 { /* sqlite3.c:37931:12: */ // // This is not a VFS shared-memory method; it is a utility function called // by VFS shared-memory methods. -func unixShmPurge(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37945:13: */ +func unixShmPurge(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38275:13: */ var p uintptr = (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFd)).FpInode)).FpShmNode if (p != 0) && ((*UnixShmNode)(unsafe.Pointer(p)).FnRef == 0) { @@ -23965,7 +23912,7 @@ func unixShmPurge(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37945:13: */ } Xsqlite3_free(tls, (*UnixShmNode)(unsafe.Pointer(p)).FapRegion) if (*UnixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - robust_close(tls, pFd, (*UnixShmNode)(unsafe.Pointer(p)).FhShm, 37962) + robust_close(tls, pFd, (*UnixShmNode)(unsafe.Pointer(p)).FhShm, 38292) (*UnixShmNode)(unsafe.Pointer(p)).FhShm = -1 } (*UnixInodeInfo)(unsafe.Pointer((*UnixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -23980,7 +23927,7 @@ func unixShmPurge(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37945:13: */ // If the DMS cannot be locked because this is a readonly_shm=1 // connection and no other process already holds a lock, return // SQLITE_READONLY_CANTINIT and set pShmNode->isUnlocked=1. -func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 { /* sqlite3.c:37979:12: */ +func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 { /* sqlite3.c:38309:12: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -24006,10 +23953,10 @@ func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 // process might open and use the *-shm file without truncating it. // And if the *-shm file has been corrupted by a power failure or // system crash, the database itself may also become corrupt. - (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = SEEK_SET + (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_whence = int16(SEEK_SET) (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_start = (int64(((22 + SQLITE_SHM_NLOCK) * 4) + SQLITE_SHM_NLOCK)) (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_len = int64(1) - (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = F_WRLCK + (*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = int16(F_WRLCK) if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 7*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, F_GETLK64, libc.VaList(bp, bp+8 /* &lock */)) != 0 { rc = (SQLITE_IOERR | (int32(15) << 8)) } else if int32((*flock)(unsafe.Pointer(bp+8 /* &lock */)).Fl_type) == F_UNLCK { @@ -24024,7 +23971,7 @@ func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 // help detect if a -shm file truncation is legitimate or is the work // or a rogue process. if (rc == SQLITE_OK) && (robust_ftruncate(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0) { - rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(18) << 8)), ts+4450 /* "ftruncate" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38019) + rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(18) << 8)), ts+4526 /* "ftruncate" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38349) } } } else if int32((*flock)(unsafe.Pointer(bp+8 /* &lock */)).Fl_type) == F_WRLCK { @@ -24071,7 +24018,7 @@ func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 // 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 *libc.TLS, pDbFd uintptr) int32 { /* sqlite3.c:38068:12: */ +func unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) int32 { /* sqlite3.c:38398:12: */ bp := tls.Alloc(152) defer tls.Free(152) @@ -24129,8 +24076,8 @@ __3: __4: ; libc.Xmemset(tls, pShmNode, 0, (uint64(unsafe.Sizeof(unixShmNode{})) + uint64(nShmFilename))) - zShm = libc.AssignPtrUintptr(pShmNode+16 /* &.zFilename */, (pShmNode + 1*64)) - Xsqlite3_snprintf(tls, nShmFilename, zShm, ts+5282 /* "%s-shm" */, libc.VaList(bp, zBasePath)) + zShm = libc.AssignPtrUintptr(pShmNode+16 /* &.zFilename */, (pShmNode + 1*96)) + Xsqlite3_snprintf(tls, nShmFilename, zShm, ts+5358 /* "%s-shm" */, libc.VaList(bp, zBasePath)) (*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm = -1 (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pDbFd)).FpInode)).FpShmNode = pShmNode @@ -24152,7 +24099,7 @@ __5: if !(int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0) { goto __7 } - if !(0 == Xsqlite3_uri_boolean(tls, (*UnixFile)(unsafe.Pointer(pDbFd)).FzPath, ts+5289 /* "readonly_shm" */, 0)) { + if !(0 == Xsqlite3_uri_boolean(tls, (*UnixFile)(unsafe.Pointer(pDbFd)).FzPath, ts+5365 /* "readonly_shm" */, 0)) { goto __8 } (*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm = robust_open(tls, zShm, ((O_RDWR | O_CREAT) | 0400000), @@ -24167,7 +24114,7 @@ __8: if !((*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm < 0) { goto __10 } - rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 38144), ts+4414 /* "open" */, zShm, 38144) + rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 38474), ts+4490 /* "open" */, zShm, 38474) goto shm_open_err __10: ; @@ -24235,7 +24182,7 @@ shm_open_err: // 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 *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:38210:12: */ +func unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:38540:12: */ bp := tls.Alloc(148) defer tls.Free(148) @@ -24338,7 +24285,7 @@ __11: goto __14 } zFile = (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(19) << 8)), ts+4485 /* "write" */, zFile, 38288) + rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(19) << 8)), ts+4561 /* "write" */, zFile, 38618) goto shmpage_out __14: ; @@ -24386,7 +24333,7 @@ __16: if !(pMem == (libc.UintptrFromInt32(-1))) { goto __20 } - rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(21) << 8)), ts+4572 /* "mmap" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38315) + rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(21) << 8)), ts+4648 /* "mmap" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38645) goto shmpage_out __20: ; @@ -24444,7 +24391,13 @@ __27: return rc } -var pgsz int32 = 4096 /* sqlite3.c:38279:28 */ +var pgsz int32 = 4096 /* sqlite3.c:38609:28 */ + +// Check that the pShmNode->aLock[] array comports with the locking bitmasks +// held by each client. Return true if it does, or false otherwise. This +// is to be used in an assert(). e.g. +// +// assert( assertLockingArrayOk(pShmNode) ); // Change the lock state for a shared-memory segment. // @@ -24452,16 +24405,16 @@ var pgsz int32 = 4096 /* sqlite3.c:38279:28 */ // 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 *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:38353:12: */ +func unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:38715:12: */ bp := tls.Alloc(32) defer tls.Free(32) var pDbFd uintptr = fd // Connection holding shared memory var p uintptr = (*UnixFile)(unsafe.Pointer(pDbFd)).FpShm // The shared memory being locked - var pX uintptr // For looping over all siblings var pShmNode uintptr = (*UnixShm)(unsafe.Pointer(p)).FpShmNode // The underlying file iNode var rc int32 = SQLITE_OK // Result code var mask U16 // Mask of locks to take or release + var aLock uintptr = pShmNode + 64 /* &.aLock */ // Check that, if this to be a blocking lock, no locks that occur later // in the following list than the lock being obtained are already held: @@ -24479,80 +24432,83 @@ func unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) in mask = (U16((int32(1) << (ofst + n)) - (int32(1) << ofst))) Xsqlite3_mutex_enter(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) - if (flags & SQLITE_SHM_UNLOCK) != 0 { - var allMask U16 = U16(0) // Mask of locks held by siblings - // See if any siblings hold this same lock - for pX = (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpFirst; pX != 0; pX = (*UnixShm)(unsafe.Pointer(pX)).FpNext { - if pX == p { - continue + if (flags & SQLITE_SHM_UNLOCK) != 0 { + if ((int32((*UnixShm)(unsafe.Pointer(p)).FexclMask) | int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask)) & int32(mask)) != 0 { + var ii int32 + var bUnlock int32 = 1 + + for ii = ofst; ii < (ofst + n); ii++ { + if *(*int32)(unsafe.Pointer(aLock + uintptr(ii)*4)) > (func() int32 { + if (int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask) & (int32(1) << ii)) != 0 { + return 1 + } + return 0 + }()) { + bUnlock = 0 + } } - allMask = U16(int32(allMask) | (int32((*UnixShm)(unsafe.Pointer(pX)).FsharedMask))) - } + if bUnlock != 0 { + rc = unixShmSystemLock(tls, pDbFd, F_UNLCK, (ofst + ((22 + SQLITE_SHM_NLOCK) * 4)), n) + if rc == SQLITE_OK { + libc.Xmemset(tls, (aLock + uintptr(ofst)*4), 0, (uint64(unsafe.Sizeof(int32(0))) * uint64(n))) + } + } else if (int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask) & (int32(1) << ofst)) != 0 { - // Unlock the system-level locks - if (int32(mask) & int32(allMask)) == 0 { - rc = unixShmSystemLock(tls, pDbFd, F_UNLCK, (ofst + ((22 + SQLITE_SHM_NLOCK) * 4)), n) - } else { - rc = SQLITE_OK - } + *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4))-- + } - // Undo the local locks - if rc == SQLITE_OK { - *(*U16)(unsafe.Pointer(p + 20 /* &.exclMask */)) &= U16((^int32(mask))) - *(*U16)(unsafe.Pointer(p + 18 /* &.sharedMask */)) &= U16((^int32(mask))) + // Undo the local locks + if rc == SQLITE_OK { + *(*U16)(unsafe.Pointer(p + 20 /* &.exclMask */)) &= U16((^int32(mask))) + *(*U16)(unsafe.Pointer(p + 18 /* &.sharedMask */)) &= U16((^int32(mask))) + } } } else if (flags & SQLITE_SHM_SHARED) != 0 { - var allShared U16 = U16(0) // Union of locks held by connections other than "p" - // Find out which shared locks are already held by sibling connections. - // If any sibling already holds an exclusive lock, go ahead and return - // SQLITE_BUSY. - for pX = (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpFirst; pX != 0; pX = (*UnixShm)(unsafe.Pointer(pX)).FpNext { - if (int32((*UnixShm)(unsafe.Pointer(pX)).FexclMask) & int32(mask)) != 0 { + if (int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask) & int32(mask)) == 0 { + if *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4)) < 0 { rc = SQLITE_BUSY - break - } - allShared = U16(int32(allShared) | (int32((*UnixShm)(unsafe.Pointer(pX)).FsharedMask))) - } - - // Get shared locks at the system level, if necessary - if rc == SQLITE_OK { - if (int32(allShared) & int32(mask)) == 0 { + } else if *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4)) == 0 { rc = unixShmSystemLock(tls, pDbFd, F_RDLCK, (ofst + ((22 + SQLITE_SHM_NLOCK) * 4)), n) - } else { - rc = SQLITE_OK } - } - // Get the local shared locks - if rc == SQLITE_OK { - *(*U16)(unsafe.Pointer(p + 18 /* &.sharedMask */)) |= U16((int32(mask))) + // Get the local shared locks + if rc == SQLITE_OK { + *(*U16)(unsafe.Pointer(p + 18 /* &.sharedMask */)) |= U16((int32(mask))) + *(*int32)(unsafe.Pointer(aLock + uintptr(ofst)*4))++ + } } } else { // Make sure no sibling connections hold locks that will block this // lock. If any do, return SQLITE_BUSY right away. - for pX = (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpFirst; pX != 0; pX = (*UnixShm)(unsafe.Pointer(pX)).FpNext { - if ((int32((*UnixShm)(unsafe.Pointer(pX)).FexclMask) & int32(mask)) != 0) || ((int32((*UnixShm)(unsafe.Pointer(pX)).FsharedMask) & int32(mask)) != 0) { + var ii int32 + for ii = ofst; ii < (ofst + n); ii++ { + + if ((int32((*UnixShm)(unsafe.Pointer(p)).FexclMask) & (int32(1) << ii)) == 0) && (*(*int32)(unsafe.Pointer(aLock + uintptr(ii)*4)) != 0) { rc = SQLITE_BUSY break } } - // Get the exclusive locks at the system level. Then if successful - // also mark the local connection as being locked. + // Get the exclusive locks at the system level. Then if successful + // also update the in-memory values. if rc == SQLITE_OK { rc = unixShmSystemLock(tls, pDbFd, F_WRLCK, (ofst + ((22 + SQLITE_SHM_NLOCK) * 4)), n) if rc == SQLITE_OK { *(*U16)(unsafe.Pointer(p + 20 /* &.exclMask */)) |= U16((int32(mask))) + for ii = ofst; ii < (ofst + n); ii++ { + *(*int32)(unsafe.Pointer(aLock + uintptr(ii)*4)) = -1 + } } } } + Xsqlite3_mutex_leave(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) if Xsqlite3OSTrace != 0 { - Xsqlite3DebugPrintf(tls, ts+5302 /* "SHM-LOCK shmid-%..." */, libc.VaList(bp, int32((*UnixShm)(unsafe.Pointer(p)).Fid), libc.Xgetpid(tls), int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask), int32((*UnixShm)(unsafe.Pointer(p)).FexclMask))) + Xsqlite3DebugPrintf(tls, ts+5378 /* "SHM-LOCK shmid-%..." */, libc.VaList(bp, int32((*UnixShm)(unsafe.Pointer(p)).Fid), libc.Xgetpid(tls), int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask), int32((*UnixShm)(unsafe.Pointer(p)).FexclMask))) } return rc } @@ -24561,7 +24517,7 @@ func unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) in // // All loads and stores begun before the barrier must complete before // any load or store begun after the barrier. -func unixShmBarrier(tls *libc.TLS, fd uintptr) { /* sqlite3.c:38487:13: */ +func unixShmBarrier(tls *libc.TLS, fd uintptr) { /* sqlite3.c:38847:13: */ _ = fd // compiler-defined memory barrier @@ -24574,7 +24530,7 @@ func unixShmBarrier(tls *libc.TLS, fd uintptr) { /* sqlite3.c:38487:13: */ // // If there is no shared memory associated with the connection then this // routine is a harmless no-op. -func unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite3.c:38506:12: */ +func unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite3.c:38866:12: */ var p uintptr // The connection to be closed var pShmNode uintptr // The underlying shared-memory file var pp uintptr // For looping over sibling connections @@ -24617,7 +24573,7 @@ func unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite } // If it is currently memory mapped, unmap file pFd. -func unixUnmapfile(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38563:13: */ +func unixUnmapfile(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38923:13: */ if (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion != 0 { (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 23*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion, uint64((*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeActual)) @@ -24640,8 +24596,8 @@ func unixUnmapfile(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38563:13: */ // the three variables above are zeroed. In this case SQLite should // continue accessing the database using the xRead() and xWrite() // methods. -func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38588:13: */ - var zErr uintptr = ts + 4572 /* "mmap" */ +func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38948:13: */ + var zErr uintptr = ts + 4648 /* "mmap" */ var h int32 = (*UnixFile)(unsafe.Pointer(pFd)).Fh // File descriptor open on db file var pOrig uintptr = (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion // Pointer to current file mapping var nOrig I64 = (*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeActual // Size of pOrig region in bytes @@ -24658,7 +24614,7 @@ func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38588:13 } pNew = (*(*func(*libc.TLS, uintptr, Size_t, Size_t, int32, uintptr) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 24*24 + 8 /* &.pCurrent */))))(tls, pOrig, uint64(nReuse), uint64(nNew), MREMAP_MAYMOVE, 0) - zErr = ts + 4584 /* "mremap" */ + zErr = ts + 4660 /* "mremap" */ // The attempt to extend the existing mapping failed. Free it. if (pNew == (libc.UintptrFromInt32(-1))) || (pNew == uintptr(0)) { @@ -24674,7 +24630,7 @@ func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38588:13 if pNew == (libc.UintptrFromInt32(-1)) { pNew = uintptr(0) nNew = int64(0) - unixLogErrorAtLine(tls, SQLITE_OK, zErr, (*UnixFile)(unsafe.Pointer(pFd)).FzPath, 38653) + unixLogErrorAtLine(tls, SQLITE_OK, zErr, (*UnixFile)(unsafe.Pointer(pFd)).FzPath, 39013) // If the mmap() above failed, assume that all subsequent mmap() calls // will probably fail too. Fall back to using xRead/xWrite exclusively @@ -24699,7 +24655,7 @@ func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38588:13 // 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 *libc.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:38680:12: */ +func unixMapfile(tls *libc.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:39040:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -24736,7 +24692,7 @@ func unixMapfile(tls *libc.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:3868 // // If this function does return a pointer, the caller must eventually // release the reference by calling unixUnfetch(). -func unixFetch(tls *libc.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int32 { /* sqlite3.c:38717:12: */ +func unixFetch(tls *libc.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int32 { /* sqlite3.c:39077:12: */ var pFd uintptr = fd // The underlying database file *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0) @@ -24763,7 +24719,7 @@ func unixFetch(tls *libc.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int3 // 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 *libc.TLS, fd uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:38748:12: */ +func unixUnfetch(tls *libc.TLS, fd uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:39108:12: */ var pFd uintptr = fd // The underlying database file _ = iOff @@ -24824,33 +24780,33 @@ func unixUnfetch(tls *libc.TLS, fd uintptr, iOff I64, p uintptr) int32 { /* sqli // 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. -var posixIoMethods = Sqlite3_io_methods{FiVersion: 3 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xDeviceCapabilities */, FxShmMap: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:38850:1 */ +var posixIoMethods = Sqlite3_io_methods{FiVersion: 3 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xDeviceCapabilities */, FxShmMap: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:39210:1 */ -func posixIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:38850:1: */ +func posixIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:39210:1: */ _ = z _ = p return uintptr(unsafe.Pointer(&posixIoMethods)) } -var posixIoFinder uintptr = 0 /* sqlite3.c:38850:1 */ -var nolockIoMethods = Sqlite3_io_methods{FiVersion: 3 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:38860:1 */ +var posixIoFinder uintptr = 0 /* sqlite3.c:39210:1 */ +var nolockIoMethods = Sqlite3_io_methods{FiVersion: 3 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:39220:1 */ -func nolockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:38860:1: */ +func nolockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:39220:1: */ _ = z _ = p return uintptr(unsafe.Pointer(&nolockIoMethods)) } -var nolockIoFinder uintptr = 0 /* sqlite3.c:38860:1 */ -var dotlockIoMethods = Sqlite3_io_methods{FiVersion: 1 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:38870:1 */ +var nolockIoFinder uintptr = 0 /* sqlite3.c:39220:1 */ +var dotlockIoMethods = Sqlite3_io_methods{FiVersion: 1 /* iVersion */, FxClose: 0 /* xClose */, FxRead: 0 /* xRead */, FxWrite: 0 /* xWrite */, FxTruncate: 0 /* xTruncate */, FxSync: 0 /* xSync */, FxFileSize: 0 /* xFileSize */, FxLock: 0 /* xLock */, FxUnlock: 0 /* xUnlock */, FxCheckReservedLock: 0 /* xCheckReservedLock */, FxFileControl: 0 /* xFileControl */, FxSectorSize: 0 /* xSectorSize */, FxDeviceCharacteristics: 0 /* xShmMap */, FxShmLock: 0 /* xShmLock */, FxShmBarrier: 0 /* xShmBarrier */, FxShmUnmap: 0 /* xShmUnmap */, FxFetch: 0 /* xFetch */, FxUnfetch: 0 /* xUnfetch */} /* sqlite3.c:39230:1 */ -func dotlockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:38870:1: */ +func dotlockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:39230:1: */ _ = z _ = p return uintptr(unsafe.Pointer(&dotlockIoMethods)) } -var dotlockIoFinder uintptr = 0 /* sqlite3.c:38870:1 */ +var dotlockIoFinder uintptr = 0 /* sqlite3.c:39230:1 */ // The proxy locking method is a "super-method" in the sense that it // opens secondary file descriptors for the conch and lock files and @@ -24863,7 +24819,7 @@ var dotlockIoFinder uintptr = 0 /* sqlite3.c:38870:1 */ // nfs lockd on OSX 10.3+ doesn't clear write locks when a read lock is set // An abstract type for a pointer to an IO method finder function: -type Finder_type = uintptr /* sqlite3.c:39065:34 */ +type Finder_type = uintptr /* sqlite3.c:39425:34 */ // *************************************************************************** // @@ -24873,7 +24829,7 @@ type Finder_type = uintptr /* sqlite3.c:39065:34 */ // sqlite3_vfs object. // Initialize the contents of the unixFile structure pointed to by pId. -func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename uintptr, ctrlFlags int32) int32 { /* sqlite3.c:39078:12: */ +func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename uintptr, ctrlFlags int32) int32 { /* sqlite3.c:39438:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -24884,7 +24840,7 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename // No locking occurs in temporary files if Xsqlite3OSTrace != 0 { - Xsqlite3DebugPrintf(tls, ts+5343 /* "OPEN %-3d %s\n" */, libc.VaList(bp, h, zFilename)) + Xsqlite3DebugPrintf(tls, ts+5419 /* "OPEN %-3d %s\n" */, libc.VaList(bp, h, zFilename)) } (*UnixFile)(unsafe.Pointer(pNew)).Fh = h (*UnixFile)(unsafe.Pointer(pNew)).FpVfs = pVfs @@ -24897,10 +24853,10 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename } return uintptr(0) }(), - ts+5360 /* "psow" */, SQLITE_POWERSAFE_OVERWRITE) != 0 { + ts+5436 /* "psow" */, SQLITE_POWERSAFE_OVERWRITE) != 0 { *(*uint16)(unsafe.Pointer(pNew + 30 /* &.ctrlFlags */)) |= uint16((UNIXFILE_PSOW)) } - if libc.Xstrcmp(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName, ts+5365 /* "unix-excl" */) == 0 { + if libc.Xstrcmp(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName, ts+5441 /* "unix-excl" */) == 0 { *(*uint16)(unsafe.Pointer(pNew + 30 /* &.ctrlFlags */)) |= uint16((UNIXFILE_EXCL)) } @@ -24931,7 +24887,7 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename // If scenario (a) caused the error then things are not so safe. The // implicit assumption here is that if fstat() fails, things are in // such bad shape that dropping a lock or two doesn't matter much. - robust_close(tls, pNew, h, 39156) + robust_close(tls, pNew, h, 39516) h = -1 } unixLeaveMutex(tls) @@ -24946,7 +24902,7 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename if zLockFile == uintptr(0) { rc = SQLITE_NOMEM } else { - Xsqlite3_snprintf(tls, nFilename, zLockFile, ts+5375 /* "%s.lock" */, libc.VaList(bp+16, zFilename)) + Xsqlite3_snprintf(tls, nFilename, zLockFile, ts+5451 /* "%s.lock" */, libc.VaList(bp+16, zFilename)) } (*UnixFile)(unsafe.Pointer(pNew)).FlockingContext = zLockFile } @@ -24954,7 +24910,7 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename storeLastErrno(tls, pNew, 0) if rc != SQLITE_OK { if h >= 0 { - robust_close(tls, pNew, h, 39241) + robust_close(tls, pNew, h, 39601) } } else { (*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -24966,7 +24922,7 @@ func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename // 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 *libc.TLS) uintptr { /* sqlite3.c:39254:19: */ +func unixTempFileDir(tls *libc.TLS) uintptr { /* sqlite3.c:39614:19: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -24976,10 +24932,10 @@ func unixTempFileDir(tls *libc.TLS) uintptr { /* sqlite3.c:39254:19: */ var zDir uintptr = Xsqlite3_temp_directory if !(int32(azDirs[0]) != 0) { - azDirs[0] = libc.Xgetenv(tls, ts+5383 /* "SQLITE_TMPDIR" */) + azDirs[0] = libc.Xgetenv(tls, ts+5459 /* "SQLITE_TMPDIR" */) } if !(int32(azDirs[1]) != 0) { - azDirs[1] = libc.Xgetenv(tls, ts+5397 /* "TMPDIR" */) + azDirs[1] = libc.Xgetenv(tls, ts+5473 /* "TMPDIR" */) } for 1 != 0 { if (((zDir != uintptr(0)) && @@ -24999,16 +24955,16 @@ func unixTempFileDir(tls *libc.TLS) uintptr { /* sqlite3.c:39254:19: */ var azDirs = [6]uintptr{ uintptr(0), uintptr(0), - ts + 5404, /* "/var/tmp" */ - ts + 5413, /* "/usr/tmp" */ - ts + 5422, /* "/tmp" */ + ts + 5480, /* "/var/tmp" */ + ts + 5489, /* "/usr/tmp" */ + ts + 5498, /* "/tmp" */ ts + 813, /* "." */ -} /* sqlite3.c:39255:21 */ +} /* sqlite3.c:39615:21 */ // 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 *libc.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:39288:12: */ +func unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:39648:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -25034,7 +24990,7 @@ func unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3 Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U64(0))), bp+24 /* &r */) *(*int8)(unsafe.Pointer(zBuf + uintptr((nBuf - 2)))) = int8(0) - Xsqlite3_snprintf(tls, nBuf, zBuf, ts+5427, /* "%s/etilqs_%llx%c" */ + Xsqlite3_snprintf(tls, nBuf, zBuf, ts+5503, /* "%s/etilqs_%llx%c" */ libc.VaList(bp, zDir, *(*U64)(unsafe.Pointer(bp + 24 /* r */)), 0)) if (int32(*(*int8)(unsafe.Pointer(zBuf + uintptr((nBuf - 2))))) != 0) || ((libc.PostIncInt32(&iLimit, 1)) > 10) { return SQLITE_ERROR @@ -25057,7 +25013,7 @@ func unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3 // // If a suitable file descriptor is found, then it is returned. If no // such file descriptor is located, -1 is returned. -func findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) uintptr { /* sqlite3.c:39338:21: */ +func findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) uintptr { /* sqlite3.c:39698:21: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -25108,7 +25064,7 @@ func findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) uintptr { /* sqli } // Find the mode, uid and gid of file zFile. -func getFileMode(tls *libc.TLS, zFile uintptr, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:39388:12: */ +func getFileMode(tls *libc.TLS, zFile uintptr, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:39748:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -25144,7 +25100,7 @@ func getFileMode(tls *libc.TLS, zFile uintptr, pMode uintptr, pUid uintptr, pGid // 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. In 8_3_NAMES mode, leave *pMode set to zero. -func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:39427:12: */ +func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:39787:12: */ bp := tls.Alloc(513) defer tls.Free(513) @@ -25190,7 +25146,7 @@ func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr // filename, check for the "modeof" parameter. If present, interpret // its value as a filename and try to copy the mode, uid and gid from // that file. - var z uintptr = Xsqlite3_uri_parameter(tls, zPath, ts+5444 /* "modeof" */) + var z uintptr = Xsqlite3_uri_parameter(tls, zPath, ts+5520 /* "modeof" */) if z != 0 { rc = getFileMode(tls, z, pMode, pUid, pGid) } @@ -25218,7 +25174,7 @@ func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr // 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 *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:39504:12: */ +func unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:39864:12: */ bp := tls.Alloc(552) defer tls.Free(552) @@ -25388,7 +25344,7 @@ __14: if !(Xsqlite3OSTrace != 0) { goto __15 } - Xsqlite3DebugPrintf(tls, ts+5451 /* "OPENX %-3d %s ..." */, libc.VaList(bp, fd, zName, openFlags)) + Xsqlite3DebugPrintf(tls, ts+5527 /* "OPENX %-3d %s ..." */, libc.VaList(bp, fd, zName, openFlags)) __15: ; @@ -25422,7 +25378,7 @@ __16: if !(fd < 0) { goto __20 } - rc2 = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39655), ts+4414 /* "open" */, zName, 39655) + rc2 = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40015), ts+4490 /* "open" */, zName, 40015) if !(rc == SQLITE_OK) { goto __21 } @@ -25522,7 +25478,7 @@ __31: // Delete the file at zPath. If the dirSync argument is true, fsync() // the directory after deleting the file. -func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:39778:12: */ +func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:40138:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -25537,7 +25493,7 @@ func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) in if (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == ENOENT { rc = (SQLITE_IOERR | (int32(23) << 8)) } else { - rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(10) << 8)), ts+4524 /* "unlink" */, zPath, 39794) + rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(10) << 8)), ts+4600 /* "unlink" */, zPath, 40154) } return rc } @@ -25547,9 +25503,9 @@ func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) in rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 17*24 + 8 /* &.pCurrent */))))(tls, zPath, bp /* &fd */) if rc == SQLITE_OK { if full_fsync(tls, *(*int32)(unsafe.Pointer(bp /* fd */)), 0, 0) != 0 { - rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(5) << 8)), ts+5472 /* "fsync" */, zPath, 39804) + rc = unixLogErrorAtLine(tls, (SQLITE_IOERR | (int32(5) << 8)), ts+5548 /* "fsync" */, zPath, 40164) } - robust_close(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp /* fd */)), 39806) + robust_close(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp /* fd */)), 40166) } else { rc = SQLITE_OK @@ -25566,7 +25522,7 @@ func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) in // SQLITE_ACCESS_READONLY: Return 1 if the file is readable. // // Otherwise return 0. -func unixAccess(tls *libc.TLS, NotUsed uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:39826:12: */ +func unixAccess(tls *libc.TLS, NotUsed uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:40186:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -25589,16 +25545,41 @@ func unixAccess(tls *libc.TLS, NotUsed uintptr, zPath uintptr, flags int32, pRes return SQLITE_OK } +// If the last component of the pathname in z[0]..z[j-1] is something +// other than ".." then back it out and return true. If the last +// component is empty or if it is ".." then return false. +func unixBackupDir(tls *libc.TLS, z uintptr, pJ uintptr) int32 { /* sqlite3.c:40215:12: */ + var j int32 = *(*int32)(unsafe.Pointer(pJ)) + var i int32 + if j <= 0 { + return 0 + } + for i = (j - 1); (i > 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr((i - 1))))) != '/'); i-- { + } + if ((int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == '.') && (i == (j - 2))) && (int32(*(*int8)(unsafe.Pointer(z + uintptr((i + 1))))) == '.') { + return 0 + } + *(*int32)(unsafe.Pointer(pJ)) = (i - 1) + return 1 +} + +// Convert a relative pathname into a full pathname. Also +// simplify the pathname as follows: // -func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int32 { /* sqlite3.c:39853:12: */ - bp := tls.Alloc(8) - defer tls.Free(8) +// Remove all instances of /./ +// Remove all isntances of /X/../ for any X +func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int32 { /* sqlite3.c:40232:12: */ + bp := tls.Alloc(12) + defer tls.Free(12) var nPath int32 = Xsqlite3Strlen30(tls, zPath) var iOff int32 = 0 + var i int32 + // var j int32 at bp+8, 4 + if int32(*(*int8)(unsafe.Pointer(zPath))) != '/' { if (*(*func(*libc.TLS, uintptr, Size_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 3*24 + 8 /* &.pCurrent */))))(tls, zOut, (uint64(nOut-2))) == uintptr(0) { - return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39862), ts+4432 /* "getcwd" */, zPath, 39862) + return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40242), ts+4508 /* "getcwd" */, zPath, 40242) } iOff = Xsqlite3Strlen30(tls, zOut) *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&iOff, 1)))) = int8('/') @@ -25607,9 +25588,47 @@ func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int3 // SQLite assumes that xFullPathname() nul-terminates the output buffer // even if it returns an error. *(*int8)(unsafe.Pointer(zOut + uintptr(iOff))) = int8(0) - return Xsqlite3CantopenError(tls, 39871) + return Xsqlite3CantopenError(tls, 40251) } Xsqlite3_snprintf(tls, (nOut - iOff), (zOut + uintptr(iOff)), ts+824 /* "%s" */, libc.VaList(bp, zPath)) + + // Remove duplicate '/' characters. Except, two // at the beginning + // of a pathname is allowed since this is important on windows. + for i = libc.AssignPtrInt32(bp+8 /* j */, 1); *(*int8)(unsafe.Pointer(zOut + uintptr(i))) != 0; i++ { + *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 8 /* j */)), 1)))) = *(*int8)(unsafe.Pointer(zOut + uintptr(i))) + for (int32(*(*int8)(unsafe.Pointer(zOut + uintptr(i)))) == '/') && (int32(*(*int8)(unsafe.Pointer(zOut + uintptr((i + 1))))) == '/') { + i++ + } + } + *(*int8)(unsafe.Pointer(zOut + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* j */))))) = int8(0) + + for i = libc.AssignPtrInt32(bp+8 /* j */, 0); *(*int8)(unsafe.Pointer(zOut + uintptr(i))) != 0; i++ { + if int32(*(*int8)(unsafe.Pointer(zOut + uintptr(i)))) == '/' { + // Skip over internal "/." directory components + if (int32(*(*int8)(unsafe.Pointer(zOut + uintptr((i + 1))))) == '.') && (int32(*(*int8)(unsafe.Pointer(zOut + uintptr((i + 2))))) == '/') { + i = i + (1) + continue + } + + // If this is a "/.." directory component then back out the + // previous term of the directory if it is something other than "..". + if (((int32(*(*int8)(unsafe.Pointer(zOut + uintptr((i + 1))))) == '.') && + (int32(*(*int8)(unsafe.Pointer(zOut + uintptr((i + 2))))) == '.')) && + (int32(*(*int8)(unsafe.Pointer(zOut + uintptr((i + 3))))) == '/')) && + (unixBackupDir(tls, zOut, bp+8 /* &j */) != 0) { + i = i + (2) + continue + } + } + if *(*int32)(unsafe.Pointer(bp + 8 /* j */)) >= 0 { + *(*int8)(unsafe.Pointer(zOut + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* j */))))) = *(*int8)(unsafe.Pointer(zOut + uintptr(i))) + } + *(*int32)(unsafe.Pointer(bp + 8 /* j */))++ + } + if *(*int32)(unsafe.Pointer(bp + 8 /* j */)) == 0 { + *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 8 /* j */)), 1)))) = int8('/') + } + *(*int8)(unsafe.Pointer(zOut + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* j */))))) = int8(0) return SQLITE_OK } @@ -25620,7 +25639,7 @@ func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int3 // 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 *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:39886:12: */ +func unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:40301:12: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -25650,7 +25669,7 @@ func unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zO if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 27*24 + 8 /* &.pCurrent */))))(tls, zIn, bp /* &buf */) != 0 { if (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) != ENOENT { - rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39919), ts+4612 /* "lstat" */, zIn, 39919) + rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40334), ts+4688 /* "lstat" */, zIn, 40334) } } else { bLink = (libc.Bool32((((*stat)(unsafe.Pointer(bp /* &buf */)).Fst_mode) & X__mode_t(0170000)) == (X__mode_t(0120000)))) @@ -25664,20 +25683,20 @@ func unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zO rc = SQLITE_NOMEM } } else if nLink >= SQLITE_MAX_SYMLINKS { - rc = Xsqlite3CantopenError(tls, 39931) + rc = Xsqlite3CantopenError(tls, 40346) } if rc == SQLITE_OK { nByte = int32((*(*func(*libc.TLS, uintptr, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + 26*24 + 8 /* &.pCurrent */))))(tls, zIn, zDel, (uint64(nOut - 1)))) if nByte < 0 { - rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39937), ts+4603 /* "readlink" */, zIn, 39937) + rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 40352), ts+4679 /* "readlink" */, zIn, 40352) } else { if int32(*(*int8)(unsafe.Pointer(zDel))) != '/' { var n int32 for n = Xsqlite3Strlen30(tls, zIn); (n > 0) && (int32(*(*int8)(unsafe.Pointer(zIn + uintptr((n - 1))))) != '/'); n-- { } if ((nByte + n) + 1) > nOut { - rc = Xsqlite3CantopenError(tls, 39943) + rc = Xsqlite3CantopenError(tls, 40358) } else { libc.Xmemmove(tls, (zDel + uintptr(n)), zDel, (uint64(nByte + 1))) libc.Xmemcpy(tls, zDel, zIn, uint64(n)) @@ -25745,7 +25764,7 @@ type Dl_serinfo = struct { Fdls_serpath [1]Dl_serpath } /* dlfcn.h:184:3 */ -func unixDlOpen(tls *libc.TLS, NotUsed uintptr, zFilename uintptr) uintptr { /* sqlite3.c:39978:13: */ +func unixDlOpen(tls *libc.TLS, NotUsed uintptr, zFilename uintptr) uintptr { /* sqlite3.c:40393:13: */ _ = NotUsed return libc.Xdlopen(tls, zFilename, (RTLD_NOW | RTLD_GLOBAL)) } @@ -25755,7 +25774,7 @@ func unixDlOpen(tls *libc.TLS, NotUsed uintptr, zFilename uintptr) uintptr { /* // 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 *libc.TLS, NotUsed uintptr, nBuf int32, zBufOut uintptr) { /* sqlite3.c:39990:13: */ +func unixDlError(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBufOut uintptr) { /* sqlite3.c:40405:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -25769,7 +25788,7 @@ func unixDlError(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBufOut uintptr) { unixLeaveMutex(tls) } -func unixDlSym(tls *libc.TLS, NotUsed uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:40000:13: */ +func unixDlSym(tls *libc.TLS, NotUsed uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:40415:13: */ // GCC with -pedantic-errors says that C90 does not allow a void* to be // cast into a pointer to a function. And yet the library dlsym() routine // returns a void* which is really a pointer to a function. So how do we @@ -25793,13 +25812,13 @@ func unixDlSym(tls *libc.TLS, NotUsed uintptr, p uintptr, zSym uintptr) uintptr return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&x)))(tls, p, zSym) } -func unixDlClose(tls *libc.TLS, NotUsed uintptr, pHandle uintptr) { /* sqlite3.c:40023:13: */ +func unixDlClose(tls *libc.TLS, NotUsed uintptr, pHandle uintptr) { /* sqlite3.c:40438:13: */ _ = NotUsed libc.Xdlclose(tls, pHandle) } // Write nBuf bytes of random data to the supplied buffer zBuf. -func unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:40037:12: */ +func unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:40452:12: */ _ = NotUsed // We have to initialize zBuf to prevent valgrind from reporting @@ -25824,8 +25843,13 @@ func unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) in // 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 *libc.TLS, NotUsed uintptr, microseconds int32) int32 { /* sqlite3.c:40084:12: */ - libc.Xusleep(tls, uint32(microseconds)) +func unixSleep(tls *libc.TLS, NotUsed uintptr, microseconds int32) int32 { /* sqlite3.c:40499:12: */ + if microseconds >= 1000000 { + libc.Xsleep(tls, (uint32(microseconds / 1000000))) + } + if (microseconds % 1000000) != 0 { + libc.Xusleep(tls, (uint32(microseconds % 1000000))) + } _ = NotUsed return microseconds } @@ -25833,7 +25857,7 @@ func unixSleep(tls *libc.TLS, NotUsed uintptr, microseconds int32) int32 { /* sq // The following variable, if set to a non-zero value, is interpreted as // the number of seconds since 1970 and is used to set the result of // sqlite3OsCurrentTime() during testing. -var Xsqlite3_current_time int32 = 0 /* sqlite3.c:40111:16 */ +var Xsqlite3_current_time int32 = 0 /* sqlite3.c:40527:16 */ // Fake system time in seconds since 1970. @@ -25845,7 +25869,7 @@ var Xsqlite3_current_time int32 = 0 /* sqlite3.c:40111:16 */ // // On success, return SQLITE_OK. Return SQLITE_ERROR if the time and date // cannot be found. -func unixCurrentTimeInt64(tls *libc.TLS, NotUsed uintptr, piNow uintptr) int32 { /* sqlite3.c:40124:12: */ +func unixCurrentTimeInt64(tls *libc.TLS, NotUsed uintptr, piNow uintptr) int32 { /* sqlite3.c:40540:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -25862,12 +25886,12 @@ func unixCurrentTimeInt64(tls *libc.TLS, NotUsed uintptr, piNow uintptr) int32 { return rc } -var unixEpoch Sqlite3_int64 = (int64(24405875) * int64(8640000)) /* sqlite3.c:40125:30 */ +var unixEpoch Sqlite3_int64 = (int64(24405875) * int64(8640000)) /* sqlite3.c:40541:30 */ // 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 *libc.TLS, NotUsed uintptr, prNow uintptr) int32 { /* sqlite3.c:40156:12: */ +func unixCurrentTime(tls *libc.TLS, NotUsed uintptr, prNow uintptr) int32 { /* sqlite3.c:40572:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -25883,7 +25907,7 @@ func unixCurrentTime(tls *libc.TLS, NotUsed uintptr, prNow uintptr) int32 { /* s // low-level error message when operating-system problems come up // during SQLite operation. Only the integer return code is currently // used. -func unixGetLastError(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32, NotUsed3 uintptr) int32 { /* sqlite3.c:40174:12: */ +func unixGetLastError(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32, NotUsed3 uintptr) int32 { /* sqlite3.c:40590:12: */ _ = NotUsed _ = NotUsed2 _ = NotUsed3 @@ -26065,7 +26089,7 @@ func unixGetLastError(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32, NotUsed3 u // 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 *libc.TLS) int32 { /* sqlite3.c:41379:16: */ +func Xsqlite3_os_init(tls *libc.TLS) int32 { /* sqlite3.c:41795:16: */ var i uint32 // Loop counter // Double-check that the aSyscall[] array has been constructed @@ -26080,18 +26104,18 @@ func Xsqlite3_os_init(tls *libc.TLS) int32 { /* sqlite3.c:41379:16: */ } var aVfs = [4]Sqlite3_vfs{ - {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 5478 /* "unix" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, - {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 5483 /* "unix-none" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, - {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 5493 /* "unix-dotfile" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, - {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 5365 /* "unix-excl" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, -} /* sqlite3.c:41432:22 */ + {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 5554 /* "unix" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, + {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 5559 /* "unix-none" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, + {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 5569 /* "unix-dotfile" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, + {FiVersion: 3 /* iVersion */, FszOsFile: int32(unsafe.Sizeof(UnixFile{})) /* szOsFile */, FmxPathname: MAX_PATHNAME /* pNext */, FzName: ts + 5441 /* "unix-excl" */ /* zName */, FpAppData: 0 /* pAppData */, FxOpen: 0 /* xOpen */, FxDelete: 0 /* xDelete */, FxAccess: 0 /* xAccess */, FxFullPathname: 0 /* xFullPathname */, FxDlOpen: 0 /* xDlOpen */, FxDlError: 0 /* xDlError */, FxDlSym: 0 /* xDlSym */, FxDlClose: 0 /* xDlClose */, FxRandomness: 0 /* xRandomness */, FxSleep: 0 /* xSleep */, FxCurrentTime: 0 /* xCurrentTime */, FxGetLastError: 0 /* xGetLastError */, FxCurrentTimeInt64: 0 /* xCurrentTimeInt64 */, FxSetSystemCall: 0 /* xSetSystemCall */, FxGetSystemCall: 0 /* xGetSystemCall */, FxNextSystemCall: 0 /* xNextSystemCall */}, +} /* sqlite3.c:41848:22 */ // Shutdown the operating system interface. // // Some operating systems might need to do some cleanup in this routine, // to release dynamically allocated objects. But not on unix. // This routine is a no-op for unix. -func Xsqlite3_os_end(tls *libc.TLS) int32 { /* sqlite3.c:41479:16: */ +func Xsqlite3_os_end(tls *libc.TLS) int32 { /* sqlite3.c:41895:16: */ unixBigLock = uintptr(0) return SQLITE_OK } @@ -26133,7 +26157,7 @@ func Xsqlite3_os_end(tls *libc.TLS) int32 { /* sqlite3.c:41479:16: */ // #include "sqliteInt.h" // Forward declaration of objects used by this utility -type MemVfs = sqlite3_vfs /* sqlite3.c:47863:28 */ +type MemVfs = sqlite3_vfs /* sqlite3.c:48283:28 */ type MemFile1 = struct { Fbase Sqlite3_file Fsz Sqlite3_int64 @@ -26144,14 +26168,14 @@ type MemFile1 = struct { FmFlags uint32 FeLock int32 _ [4]byte -} /* sqlite3.c:47864:9 */ +} /* sqlite3.c:48284:9 */ -type MemFile = MemFile1 /* sqlite3.c:47864:24 */ +type MemFile = MemFile1 /* sqlite3.c:48284:24 */ var memdb_vfs = Sqlite3_vfs{ FiVersion: 2, // szOsFile (set when registered) FmxPathname: 1024, // pNext - FzName: ts + 5506, /* "memdb" */ // pAppData (set when registered) + FzName: ts + 5582, /* "memdb" */ // pAppData (set when registered) FxOpen: 0, /* memdbDelete, */ // xDelete FxAccess: 0, // xAccess FxFullPathname: 0, // xFullPathname @@ -26163,7 +26187,7 @@ var memdb_vfs = Sqlite3_vfs{ FxSleep: 0, /* memdbCurrentTime, */ // xCurrentTime FxGetLastError: 0, // xGetLastError FxCurrentTimeInt64: 0, // xCurrentTimeInt64 -} /* sqlite3.c:47917:20 */ +} /* sqlite3.c:48337:20 */ var memdb_io_methods = Sqlite3_io_methods{ FiVersion: 3, // iVersion @@ -26179,22 +26203,23 @@ var memdb_io_methods = Sqlite3_io_methods{ FxDeviceCharacteristics: 0, // xShmUnmap FxFetch: 0, // xFetch FxUnfetch: 0, // xUnfetch -} /* sqlite3.c:47939:33 */ +} /* sqlite3.c:48359:33 */ // Close an memdb-file. // // The pData pointer is owned by the application, so there is nothing -// to free. -func memdbClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:47969:12: */ +// to free. Unless the SQLITE_DESERIALIZE_FREEONCLOSE flag is set, +// in which case we own the pData pointer and need to free it. +func memdbClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:48390:12: */ var p uintptr = pFile - if ((*MemFile)(unsafe.Pointer(p)).FmFlags & SQLITE_DESERIALIZE_FREEONCLOSE) != 0 { + if ((*MemFile)(unsafe.Pointer(p)).FmFlags & uint32(SQLITE_DESERIALIZE_FREEONCLOSE)) != 0 { Xsqlite3_free(tls, (*MemFile)(unsafe.Pointer(p)).FaData) } return SQLITE_OK } // Read data from an memdb-file. -func memdbRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:47978:12: */ +func memdbRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:48401:12: */ var p uintptr = pFile if (iOfst + Sqlite_int64(iAmt)) > (*MemFile)(unsafe.Pointer(p)).Fsz { libc.Xmemset(tls, zBuf, 0, uint64(iAmt)) @@ -26208,9 +26233,9 @@ func memdbRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sql } // Try to enlarge the memory allocation to hold at least sz bytes -func memdbEnlarge(tls *libc.TLS, p uintptr, newSz Sqlite3_int64) int32 { /* sqlite3.c:47997:12: */ +func memdbEnlarge(tls *libc.TLS, p uintptr, newSz Sqlite3_int64) int32 { /* sqlite3.c:48420:12: */ var pNew uintptr - if (((*MemFile)(unsafe.Pointer(p)).FmFlags & SQLITE_DESERIALIZE_RESIZEABLE) == uint32(0)) || ((*MemFile)(unsafe.Pointer(p)).FnMmap > 0) { + if (((*MemFile)(unsafe.Pointer(p)).FmFlags & uint32(SQLITE_DESERIALIZE_RESIZEABLE)) == uint32(0)) || ((*MemFile)(unsafe.Pointer(p)).FnMmap > 0) { return SQLITE_FULL } if newSz > (*MemFile)(unsafe.Pointer(p)).FszMax { @@ -26230,9 +26255,9 @@ func memdbEnlarge(tls *libc.TLS, p uintptr, newSz Sqlite3_int64) int32 { /* sqli } // Write data to an memdb-file. -func memdbWrite(tls *libc.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:48017:12: */ +func memdbWrite(tls *libc.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:48440:12: */ var p uintptr = pFile - if ((*MemFile)(unsafe.Pointer(p)).FmFlags & SQLITE_DESERIALIZE_READONLY) != 0 { + if ((*MemFile)(unsafe.Pointer(p)).FmFlags & uint32(SQLITE_DESERIALIZE_READONLY)) != 0 { return SQLITE_READONLY } if (iOfst + Sqlite_int64(iAmt)) > (*MemFile)(unsafe.Pointer(p)).Fsz { @@ -26255,7 +26280,7 @@ func memdbWrite(tls *libc.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Sqlit // In rollback mode (which is always the case for memdb, as it does not // support WAL mode) the truncate() method is only used to reduce // the size of a file, never to increase the size. -func memdbTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sqlite3.c:48046:12: */ +func memdbTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sqlite3.c:48469:12: */ var p uintptr = pFile if size > (*MemFile)(unsafe.Pointer(p)).Fsz { return SQLITE_FULL @@ -26265,22 +26290,22 @@ func memdbTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* s } // Sync an memdb-file. -func memdbSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:48056:12: */ +func memdbSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:48479:12: */ return SQLITE_OK } // Return the current file-size of an memdb-file. -func memdbFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlite3.c:48063:12: */ +func memdbFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlite3.c:48486:12: */ var p uintptr = pFile *(*Sqlite_int64)(unsafe.Pointer(pSize)) = (*MemFile)(unsafe.Pointer(p)).Fsz return SQLITE_OK } // Lock an memdb-file. -func memdbLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:48072:12: */ +func memdbLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:48495:12: */ var p uintptr = pFile if (eLock > SQLITE_LOCK_SHARED) && - (((*MemFile)(unsafe.Pointer(p)).FmFlags & SQLITE_DESERIALIZE_READONLY) != uint32(0)) { + (((*MemFile)(unsafe.Pointer(p)).FmFlags & uint32(SQLITE_DESERIALIZE_READONLY)) != uint32(0)) { return SQLITE_READONLY } (*MemFile)(unsafe.Pointer(p)).FeLock = eLock @@ -26288,14 +26313,14 @@ func memdbLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:4 } // File control method. For custom operations on an memdb-file. -func memdbFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:48096:12: */ +func memdbFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:48519:12: */ bp := tls.Alloc(16) defer tls.Free(16) var p uintptr = pFile var rc int32 = SQLITE_NOTFOUND if op == SQLITE_FCNTL_VFSNAME { - *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+5512 /* "memdb(%p,%lld)" */, libc.VaList(bp, (*MemFile)(unsafe.Pointer(p)).FaData, (*MemFile)(unsafe.Pointer(p)).Fsz)) + *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+5588 /* "memdb(%p,%lld)" */, libc.VaList(bp, (*MemFile)(unsafe.Pointer(p)).FaData, (*MemFile)(unsafe.Pointer(p)).Fsz)) rc = SQLITE_OK } if op == SQLITE_FCNTL_SIZE_LIMIT { @@ -26315,12 +26340,12 @@ func memdbFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int3 } // Return the device characteristic flags supported by an memdb-file. -func memdbDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:48131:12: */ +func memdbDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:48554:12: */ return (((SQLITE_IOCAP_ATOMIC | SQLITE_IOCAP_POWERSAFE_OVERWRITE) | SQLITE_IOCAP_SAFE_APPEND) | SQLITE_IOCAP_SEQUENTIAL) } // Fetch a page of a memory-mapped file -func memdbFetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:48139:12: */ +func memdbFetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:48562:12: */ var p uintptr = pFile if (iOfst + Sqlite3_int64(iAmt)) > (*MemFile)(unsafe.Pointer(p)).Fsz { *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0) @@ -26332,14 +26357,14 @@ func memdbFetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, iAmt int32, p } // Release a memory-mapped page -func memdbUnfetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, pPage uintptr) int32 { /* sqlite3.c:48156:12: */ +func memdbUnfetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, pPage uintptr) int32 { /* sqlite3.c:48579:12: */ var p uintptr = pFile (*MemFile)(unsafe.Pointer(p)).FnMmap-- return SQLITE_OK } // Open an mem file handle. -func memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:48165:12: */ +func memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:48588:12: */ var p uintptr = pFile if (flags & SQLITE_OPEN_MAIN_DB) == 0 { return (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 40 /* &.xOpen */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zName, pFile, flags, pOutFlags) @@ -26357,7 +26382,7 @@ func memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags // is available, or false otherwise. // // With memdb, no files ever exist on disk. So always return false. -func memdbAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:48203:12: */ +func memdbAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:48626:12: */ *(*int32)(unsafe.Pointer(pResOut)) = 0 return SQLITE_OK } @@ -26365,7 +26390,7 @@ func memdbAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOu // Populate buffer zOut with the full canonical pathname corresponding // to the pathname in zPath. zOut is guaranteed to point to a buffer // of at least (INST_MAX_PATHNAME+1) bytes. -func memdbFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:48218:12: */ +func memdbFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:48641:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -26374,50 +26399,50 @@ func memdbFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z } // Open the dynamic library located at zPath and return a handle. -func memdbDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:48231:13: */ +func memdbDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:48654:13: */ return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 72 /* &.xDlOpen */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath) } // Populate the buffer zErrMsg (size nByte bytes) with a human readable // utf-8 string describing the most recent error encountered associated // with dynamic libraries. -func memdbDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* sqlite3.c:48240:13: */ +func memdbDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* sqlite3.c:48663:13: */ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 80 /* &.xDlError */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zErrMsg) } // Return a pointer to the symbol zSymbol in the dynamic library pHandle. -func memdbDlSym(tls *libc.TLS, pVfs uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:48247:13: */ +func memdbDlSym(tls *libc.TLS, pVfs uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:48670:13: */ return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 88 /* &.xDlSym */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p, zSym) } // Close the dynamic library handle pHandle. -func memdbDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:48254:13: */ +func memdbDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:48677:13: */ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 96 /* &.xDlClose */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, pHandle) } // Populate the buffer pointed to by zBufOut with nByte bytes of // random data. -func memdbRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:48262:12: */ +func memdbRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:48685:12: */ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 104 /* &.xRandomness */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zBufOut) } // Sleep for nMicro microseconds. Return the number of microseconds // actually slept. -func memdbSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:48270:12: */ +func memdbSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:48693:12: */ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 112 /* &.xSleep */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nMicro) } -func memdbGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* sqlite3.c:48283:12: */ +func memdbGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* sqlite3.c:48706:12: */ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 128 /* &.xGetLastError */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, a, b) } -func memdbCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, p uintptr) int32 { /* sqlite3.c:48286:12: */ +func memdbCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, p uintptr) int32 { /* sqlite3.c:48709:12: */ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 136 /* &.xCurrentTimeInt64 */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p) } // Translate a database connection pointer and schema name into a // MemFile pointer. -func memdbFromDbSchema(tls *libc.TLS, db uintptr, zSchema uintptr) uintptr { /* sqlite3.c:48294:16: */ +func memdbFromDbSchema(tls *libc.TLS, db uintptr, zSchema uintptr) uintptr { /* sqlite3.c:48717:16: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -26433,7 +26458,7 @@ func memdbFromDbSchema(tls *libc.TLS, db uintptr, zSchema uintptr) uintptr { /* } // Return the serialization of a database -func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintptr, mFlags uint32) uintptr { /* sqlite3.c:48305:26: */ +func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintptr, mFlags uint32) uintptr { /* sqlite3.c:48728:26: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -26462,7 +26487,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp if piSize != 0 { *(*Sqlite3_int64)(unsafe.Pointer(piSize)) = (*MemFile)(unsafe.Pointer(p)).Fsz } - if (mFlags & SQLITE_SERIALIZE_NOCOPY) != 0 { + if (mFlags & uint32(SQLITE_SERIALIZE_NOCOPY)) != 0 { pOut = (*MemFile)(unsafe.Pointer(p)).FaData } else { pOut = Xsqlite3_malloc64(tls, uint64((*MemFile)(unsafe.Pointer(p)).Fsz)) @@ -26477,7 +26502,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp return uintptr(0) } szPage = Xsqlite3BtreeGetPageSize(tls, pBt) - zSql = Xsqlite3_mprintf(tls, ts+5527 /* "PRAGMA \"%w\".page..." */, libc.VaList(bp, zSchema)) + zSql = Xsqlite3_mprintf(tls, ts+5603 /* "PRAGMA \"%w\".page..." */, libc.VaList(bp, zSchema)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+8 /* &pStmt */, uintptr(0)) } else { @@ -26495,7 +26520,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp if piSize != 0 { *(*Sqlite3_int64)(unsafe.Pointer(piSize)) = sz } - if (mFlags & SQLITE_SERIALIZE_NOCOPY) != 0 { + if (mFlags & uint32(SQLITE_SERIALIZE_NOCOPY)) != 0 { pOut = uintptr(0) } else { pOut = Xsqlite3_malloc64(tls, uint64(sz)) @@ -26522,7 +26547,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp } // Convert zSchema to a MemDB and initialize its content. -func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uintptr, szDb Sqlite3_int64, szBuf Sqlite3_int64, mFlags uint32) int32 { /* sqlite3.c:48384:16: */ +func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uintptr, szDb Sqlite3_int64, szBuf Sqlite3_int64, mFlags uint32) int32 { /* sqlite3.c:48807:16: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -26549,57 +26574,72 @@ __1: goto end_deserialize __2: ; - zSql = Xsqlite3_mprintf(tls, ts+5550 /* "ATTACH x AS %Q" */, libc.VaList(bp, zSchema)) - rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+8 /* &pStmt */, uintptr(0)) - Xsqlite3_free(tls, zSql) - if !(rc != 0) { + zSql = Xsqlite3_mprintf(tls, ts+5626 /* "ATTACH x AS %Q" */, libc.VaList(bp, zSchema)) + if !(zSql == uintptr(0)) { goto __3 } - goto end_deserialize + rc = SQLITE_NOMEM + goto __4 __3: + rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+8 /* &pStmt */, uintptr(0)) + Xsqlite3_free(tls, zSql) +__4: + ; + if !(rc != 0) { + goto __5 + } + goto end_deserialize +__5: ; (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(iDb) - libc.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.reopenMemdb */, uint32(1), 2, 0x4) + libc.SetBitFieldPtr8Uint32(db+184 /* &.init */ +8 /* &.reopenMemdb */, uint32(1), 2, 0x4) rc = Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */))) - libc.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.reopenMemdb */, uint32(0), 2, 0x4) + libc.SetBitFieldPtr8Uint32(db+184 /* &.init */ +8 /* &.reopenMemdb */, uint32(0), 2, 0x4) if !(rc != SQLITE_DONE) { - goto __4 + goto __6 } rc = SQLITE_ERROR goto end_deserialize -__4: +__6: ; p = memdbFromDbSchema(tls, db, zSchema) if !(p == uintptr(0)) { - goto __5 + goto __7 } rc = SQLITE_ERROR - goto __6 -__5: + goto __8 +__7: (*MemFile)(unsafe.Pointer(p)).FaData = pData + pData = uintptr(0) (*MemFile)(unsafe.Pointer(p)).Fsz = szDb (*MemFile)(unsafe.Pointer(p)).FszAlloc = szBuf (*MemFile)(unsafe.Pointer(p)).FszMax = szBuf if !((*MemFile)(unsafe.Pointer(p)).FszMax < Xsqlite3Config.FmxMemdbSize) { - goto __7 + goto __9 } (*MemFile)(unsafe.Pointer(p)).FszMax = Xsqlite3Config.FmxMemdbSize -__7: +__9: ; (*MemFile)(unsafe.Pointer(p)).FmFlags = mFlags rc = SQLITE_OK -__6: +__8: ; end_deserialize: Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */))) + if !((pData != 0) && ((mFlags & uint32(SQLITE_DESERIALIZE_FREEONCLOSE)) != uint32(0))) { + goto __10 + } + Xsqlite3_free(tls, pData) +__10: + ; Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return rc } // This routine is called when the extension is loaded. // Register the new VFS. -func Xsqlite3MemdbInit(tls *libc.TLS) int32 { /* sqlite3.c:48450:20: */ +func Xsqlite3MemdbInit(tls *libc.TLS) int32 { /* sqlite3.c:48881:20: */ var pLower uintptr = Xsqlite3_vfs_find(tls, uintptr(0)) var sz int32 = (*Sqlite3_vfs)(unsafe.Pointer(pLower)).FszOsFile memdb_vfs.FpAppData = pLower @@ -26617,7 +26657,7 @@ func Xsqlite3MemdbInit(tls *libc.TLS) int32 { /* sqlite3.c:48450:20: */ // 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 Xsqlite3BitvecCreate(tls *libc.TLS, iSize U32) uintptr { /* sqlite3.c:48580:23: */ +func Xsqlite3BitvecCreate(tls *libc.TLS, iSize U32) uintptr { /* sqlite3.c:49011:23: */ var p uintptr p = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Bitvec{}))) @@ -26630,7 +26670,7 @@ func Xsqlite3BitvecCreate(tls *libc.TLS, iSize U32) uintptr { /* sqlite3.c:48580 // 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 Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48595:20: */ +func Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:49026:20: */ i-- if i >= (*Bitvec)(unsafe.Pointer(p)).FiSize { @@ -26644,22 +26684,22 @@ func Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlit return 0 } } - if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM) { - return (libc.Bool32((int32(*(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / BITVEC_SZELEM))))) & (int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) != 0)) + if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM)) { + return (libc.Bool32((int32(*(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM)))))) & (int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) != 0)) } else { - var h U32 = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + var h U32 = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) for *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) != 0 { if *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) == i { return 1 } - h = (U32((uint64(h + U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + h = (U32((uint64(h + U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) } return 0 } return int32(0) } -func Xsqlite3BitvecTest(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48618:20: */ +func Xsqlite3BitvecTest(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:49049:20: */ return (libc.Bool32((p != uintptr(0)) && (Xsqlite3BitvecTestNotNull(tls, p, i) != 0))) } @@ -26673,7 +26713,7 @@ func Xsqlite3BitvecTest(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48 // 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 Xsqlite3BitvecSet(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48634:20: */ +func Xsqlite3BitvecSet(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:49065:20: */ var h U32 var bin U32 var j uint32 @@ -26688,7 +26728,7 @@ __1: i-- __2: - if !((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) > (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM)) && ((*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0)) { + if !((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) > (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM))) && ((*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0)) { goto __3 } bin = (i / (*Bitvec)(unsafe.Pointer(p)).FiDivisor) @@ -26709,21 +26749,21 @@ __4: goto __2 __3: ; - if !(uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM)) { + if !(uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM))) { goto __6 } - *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / BITVEC_SZELEM)))) |= U8((int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) + *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM))))) |= U8((int32(1) << (i & (U32(BITVEC_SZELEM - 1))))) return SQLITE_OK __6: ; - h = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + h = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) // if there wasn't a hash collision, and this doesn't // completely fill the hash, then just add it without // worring about sub-dividing and re-hashing. if !(!(int32(*(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4))) != 0)) { goto __7 } - if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) < (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) - uint64(1))) { + if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) < (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) - uint64(1))) { goto __8 } goto bitvec_set_end @@ -26744,7 +26784,7 @@ __10: __13: ; h++ - if !(uint64(h) >= ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { + if !(uint64(h) >= ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { goto __14 } h = U32(0) @@ -26762,7 +26802,7 @@ __12: // available free spot. check to see if this is going to // make our hash too "full". bitvec_set_rehash: - if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) >= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) / uint64(2))) { + if !(uint64((*Bitvec)(unsafe.Pointer(p)).FnSet) >= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) / uint64(2))) { goto __15 } aiValues = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(unsafe.Sizeof([124]U32{}))) @@ -26774,11 +26814,11 @@ bitvec_set_rehash: __16: libc.Xmemcpy(tls, aiValues, p+16 /* &.u */ /* &.aHash */, uint64(unsafe.Sizeof([124]U32{}))) libc.Xmemset(tls, p+16 /* &.u */ /* &.apSub */, 0, uint64(unsafe.Sizeof([62]uintptr{}))) - (*Bitvec)(unsafe.Pointer(p)).FiDivisor = (U32(((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) + ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0))))) - uint64(1)) / ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))))) + (*Bitvec)(unsafe.Pointer(p)).FiDivisor = (U32(((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) + ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0))))) - uint64(1)) / ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))))) rc = Xsqlite3BitvecSet(tls, p, i) j = uint32(0) __18: - if !(uint64(j) < ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { + if !(uint64(j) < ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))) { goto __20 } if !(*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0) { @@ -26810,7 +26850,7 @@ bitvec_set_end: // // pBuf must be a pointer to at least BITVEC_SZ bytes of temporary storage // that BitvecClear can use to rebuilt its hash table. -func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) { /* sqlite3.c:48705:21: */ +func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) { /* sqlite3.c:49136:21: */ if p == uintptr(0) { return } @@ -26824,21 +26864,21 @@ func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) { /* sql return } } - if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * BITVEC_SZELEM) { - *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / BITVEC_SZELEM)))) &= U8((^(int32(1) << (i & (U32(BITVEC_SZELEM - 1)))))) + if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(BITVEC_SZELEM)) { + *(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(BITVEC_SZELEM))))) &= U8((^(int32(1) << (i & (U32(BITVEC_SZELEM - 1)))))) } else { var j uint32 var aiValues uintptr = pBuf libc.Xmemcpy(tls, aiValues, p+16 /* &.u */ /* &.aHash */, uint64(unsafe.Sizeof([124]U32{}))) libc.Xmemset(tls, p+16 /* &.u */ /* &.aHash */, 0, uint64(unsafe.Sizeof([124]U32{}))) (*Bitvec)(unsafe.Pointer(p)).FnSet = U32(0) - for j = uint32(0); uint64(j) < ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))); j++ { + for j = uint32(0); uint64(j) < ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))); j++ { if (*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0) && (*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != (i + U32(1))) { - var h U32 = (U32((uint64((*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) - U32(1)) * U32(1))) % ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) + var h U32 = (U32((uint64((*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) - U32(1)) * U32(1))) % ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))))) (*Bitvec)(unsafe.Pointer(p)).FnSet++ for *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) != 0 { h++ - if uint64(h) >= ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) { + if uint64(h) >= ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))) { h = U32(0) } } @@ -26849,13 +26889,13 @@ func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) { /* sql } // Destroy a bitmap object. Reclaim all memory used. -func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:48742:21: */ +func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:49173:21: */ if p == uintptr(0) { return } if (*Bitvec)(unsafe.Pointer(p)).FiDivisor != 0 { var i uint32 - for i = uint32(0); uint64(i) < ((((BITVEC_SZ - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { + for i = uint32(0); uint64(i) < ((((uint64(BITVEC_SZ) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { Xsqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer((p + 16 /* &.u */ /* &.apSub */) + uintptr(i)*8))) } } @@ -26864,7 +26904,7 @@ func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:48742:21: */ // Return the value of the iSize parameter specified when Bitvec *p // was created. -func Xsqlite3BitvecSize(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:48757:20: */ +func Xsqlite3BitvecSize(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:49188:20: */ return (*Bitvec)(unsafe.Pointer(p)).FiSize } @@ -26901,7 +26941,7 @@ func Xsqlite3BitvecSize(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:48757:20: * // an error is returned. If they are the same, zero is returned. // // If a memory allocation error occurs, return -1. -func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32 { /* sqlite3.c:48802:20: */ +func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32 { /* sqlite3.c:49233:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -26922,7 +26962,7 @@ func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32 { /* // bits to act as the reference pBitvec = Xsqlite3BitvecCreate(tls, uint32(sz)) pV = Xsqlite3MallocZero(tls, (uint64(((sz + 7) / 8) + 1))) - pTmpSpace = Xsqlite3_malloc64(tls, BITVEC_SZ) + pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if !(((pBitvec == uintptr(0)) || (pV == uintptr(0))) || (pTmpSpace == uintptr(0))) { goto __1 } @@ -27064,7 +27104,7 @@ bitvec_end: // 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 *libc.TLS, pPage uintptr, addRemove U8) { /* sqlite3.c:49037:13: */ +func pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove U8) { /* sqlite3.c:49468:13: */ var p uintptr = (*PgHdr)(unsafe.Pointer(pPage)).FpCache if (int32(addRemove) & PCACHE_DIRTYLIST_REMOVE) != 0 { @@ -27126,7 +27166,7 @@ func pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove U8) { /* sqli // 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 *libc.TLS, p uintptr) { /* sqlite3.c:49107:13: */ +func pcacheUnpin(tls *libc.TLS, p uintptr) { /* sqlite3.c:49538:13: */ if (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FbPurgeable != 0 { (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 64 /* &.xUnpin */))))(tls, (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, 0) @@ -27136,7 +27176,7 @@ func pcacheUnpin(tls *libc.TLS, p uintptr) { /* sqlite3.c:49107:13: */ // Compute the number of pages of cache requested. p->szCache is the // cache size requested by the "PRAGMA cache_size" statement. -func numberOfCachePages(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:49119:12: */ +func numberOfCachePages(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:49550:12: */ if (*PCache)(unsafe.Pointer(p)).FszCache >= 0 { // IMPLEMENTATION-OF: R-42059-47211 If the argument N is positive then the // suggested cache size is set to N. @@ -27156,7 +27196,7 @@ func numberOfCachePages(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:49119:12: // // Initialize and shutdown the page cache subsystem. Neither of these // functions are threadsafe. -func Xsqlite3PcacheInitialize(tls *libc.TLS) int32 { /* sqlite3.c:49138:20: */ +func Xsqlite3PcacheInitialize(tls *libc.TLS) int32 { /* sqlite3.c:49569:20: */ if Xsqlite3Config.Fpcache2.FxInit == uintptr(0) { // IMPLEMENTATION-OF: R-26801-64137 If the xInit() method is NULL, then the // built-in default page cache is used instead of the application defined @@ -27167,7 +27207,7 @@ func Xsqlite3PcacheInitialize(tls *libc.TLS) int32 { /* sqlite3.c:49138:20: */ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 16 /* &.xInit */))))(tls, Xsqlite3Config.Fpcache2.FpArg) } -func Xsqlite3PcacheShutdown(tls *libc.TLS) { /* sqlite3.c:49148:21: */ +func Xsqlite3PcacheShutdown(tls *libc.TLS) { /* sqlite3.c:49579:21: */ if Xsqlite3Config.Fpcache2.FxShutdown != 0 { // IMPLEMENTATION-OF: R-26000-56589 The xShutdown() method may be NULL. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 24 /* &.xShutdown */))))(tls, Xsqlite3Config.Fpcache2.FpArg) @@ -27175,7 +27215,7 @@ func Xsqlite3PcacheShutdown(tls *libc.TLS) { /* sqlite3.c:49148:21: */ } // Return the size in bytes of a PCache object. -func Xsqlite3PcacheSize(tls *libc.TLS) int32 { /* sqlite3.c:49158:20: */ +func Xsqlite3PcacheSize(tls *libc.TLS) int32 { /* sqlite3.c:49589:20: */ return int32(unsafe.Sizeof(PCache{})) } @@ -27189,7 +27229,7 @@ func Xsqlite3PcacheSize(tls *libc.TLS) int32 { /* sqlite3.c:49158:20: */ // 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 Xsqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) int32 { /* sqlite3.c:49172:20: */ +func Xsqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) int32 { /* sqlite3.c:49603:20: */ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(PCache{}))) (*PCache)(unsafe.Pointer(p)).FszPage = 1 (*PCache)(unsafe.Pointer(p)).FszExtra = szExtra @@ -27206,7 +27246,7 @@ func Xsqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable i // Change the page size for PCache object. The caller must ensure that there // are no outstanding page references when this function is called. -func Xsqlite3PcacheSetPageSize(tls *libc.TLS, pCache uintptr, szPage int32) int32 { /* sqlite3.c:49198:20: */ +func Xsqlite3PcacheSetPageSize(tls *libc.TLS, pCache uintptr, szPage int32) int32 { /* sqlite3.c:49629:20: */ if (*PCache)(unsafe.Pointer(pCache)).FszPage != 0 { var pNew uintptr @@ -27249,7 +27289,7 @@ func Xsqlite3PcacheSetPageSize(tls *libc.TLS, pCache uintptr, szPage int32) int3 // 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 Xsqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno Pgno, createFlag int32) uintptr { /* sqlite3.c:49242:36: */ +func Xsqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno Pgno, createFlag int32) uintptr { /* sqlite3.c:49673:36: */ var eCreate int32 var pRes uintptr @@ -27275,7 +27315,7 @@ func Xsqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno Pgno, createFlag in // an OOM error. // // This routine should be invoked only after sqlite3PcacheFetch() fails. -func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage uintptr) int32 { /* sqlite3.c:49283:20: */ +func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage uintptr) int32 { /* sqlite3.c:49714:20: */ var pPg uintptr if int32((*PCache)(unsafe.Pointer(pCache)).FeCreate) == 2 { return 0 @@ -27322,7 +27362,7 @@ func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage // 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 *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:49339:30: */ +func pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:49770:30: */ var pPgHdr uintptr pPgHdr = (*Sqlite3_pcache_page)(unsafe.Pointer(pPage)).FpExtra @@ -27334,7 +27374,7 @@ func pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage u libc.Xmemset(tls, (*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra, 0, uint64(8)) (*PgHdr)(unsafe.Pointer(pPgHdr)).FpCache = pCache (*PgHdr)(unsafe.Pointer(pPgHdr)).Fpgno = pgno - (*PgHdr)(unsafe.Pointer(pPgHdr)).Fflags = PGHDR_CLEAN + (*PgHdr)(unsafe.Pointer(pPgHdr)).Fflags = U16(PGHDR_CLEAN) return Xsqlite3PcacheFetchFinish(tls, pCache, pgno, pPage) } @@ -27342,7 +27382,7 @@ func pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage u // sqlite3PcacheFetch() into an initialized PgHdr object. This routine // must be called after sqlite3PcacheFetch() in order to get a usable // result. -func Xsqlite3PcacheFetchFinish(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:49365:22: */ +func Xsqlite3PcacheFetchFinish(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:49796:22: */ var pPgHdr uintptr pPgHdr = (*Sqlite3_pcache_page)(unsafe.Pointer(pPage)).FpExtra @@ -27358,20 +27398,20 @@ func Xsqlite3PcacheFetchFinish(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage u // 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 Xsqlite3PcacheRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:49388:37: */ +func Xsqlite3PcacheRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:49819:37: */ (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum-- if (int32(libc.PreDecInt16(&(*PgHdr)(unsafe.Pointer(p)).FnRef, 1))) == 0 { if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_CLEAN) != 0 { pcacheUnpin(tls, p) } else { - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_FRONT) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT)) } } } // Increase the reference count of a supplied page by 1. -func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr) { /* sqlite3.c:49403:21: */ +func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr) { /* sqlite3.c:49834:21: */ (*PgHdr)(unsafe.Pointer(p)).FnRef++ (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum++ @@ -27380,10 +27420,10 @@ func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr) { /* sqlite3.c:49403:21: */ // 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 Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr) { /* sqlite3.c:49415:21: */ +func Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr) { /* sqlite3.c:49846:21: */ if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_DIRTY) != 0 { - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_REMOVE) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE)) } (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum-- (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 64 /* &.xUnpin */))))(tls, (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, 1) @@ -27391,14 +27431,14 @@ func Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr) { /* sqlite3.c:49415:21: */ // Make sure the page is marked as dirty. If it isn't dirty already, // make it so. -func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:49429:21: */ +func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:49860:21: */ if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & (PGHDR_CLEAN | PGHDR_DONT_WRITE)) != 0 { //OPTIMIZATION-IF-FALSE *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(PGHDR_DONT_WRITE))) if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_CLEAN) != 0 { *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) ^= U16((PGHDR_DIRTY | PGHDR_CLEAN)) - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_ADD) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_ADD)) } } @@ -27406,9 +27446,9 @@ func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:49429:21: // Make sure the page is marked as clean. If it isn't clean already, // make it so. -func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) { /* sqlite3.c:49448:21: */ +func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) { /* sqlite3.c:49879:21: */ - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_REMOVE) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_REMOVE)) *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((PGHDR_DIRTY | PGHDR_NEED_SYNC) | PGHDR_WRITEABLE)))) *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) |= U16((PGHDR_CLEAN)) @@ -27418,7 +27458,7 @@ func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) { /* sqlite3.c:49448:21: } // Make every page in the cache clean. -func Xsqlite3PcacheCleanAll(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49465:21: */ +func Xsqlite3PcacheCleanAll(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49896:21: */ var p uintptr for (libc.AssignUintptr(&p, (*PCache)(unsafe.Pointer(pCache)).FpDirty)) != uintptr(0) { @@ -27427,7 +27467,7 @@ func Xsqlite3PcacheCleanAll(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49465: } // Clear the PGHDR_NEED_SYNC and PGHDR_WRITEABLE flag from all dirty pages. -func Xsqlite3PcacheClearWritable(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49476:21: */ +func Xsqlite3PcacheClearWritable(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49907:21: */ var p uintptr for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext { @@ -27437,7 +27477,7 @@ func Xsqlite3PcacheClearWritable(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:4 } // Clear the PGHDR_NEED_SYNC flag from all dirty pages. -func Xsqlite3PcacheClearSyncFlags(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49488:21: */ +func Xsqlite3PcacheClearSyncFlags(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49919:21: */ var p uintptr for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext { *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(PGHDR_NEED_SYNC))) @@ -27446,13 +27486,13 @@ func Xsqlite3PcacheClearSyncFlags(tls *libc.TLS, pCache uintptr) { /* sqlite3.c: } // Change the page number of page p to newPgno. -func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:49499:21: */ +func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:49930:21: */ var pCache uintptr = (*PgHdr)(unsafe.Pointer(p)).FpCache (*(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 72 /* &.xRekey */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, (*PgHdr)(unsafe.Pointer(p)).Fpgno, newPgno) (*PgHdr)(unsafe.Pointer(p)).Fpgno = newPgno if ((int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_DIRTY) != 0) && ((int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & PGHDR_NEED_SYNC) != 0) { - pcacheManageDirtyList(tls, p, PCACHE_DIRTYLIST_FRONT) + pcacheManageDirtyList(tls, p, uint8(PCACHE_DIRTYLIST_FRONT)) } } @@ -27463,7 +27503,7 @@ func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:4 // 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 Xsqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno Pgno) { /* sqlite3.c:49521:21: */ +func Xsqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno Pgno) { /* sqlite3.c:49952:21: */ if (*PCache)(unsafe.Pointer(pCache)).FpCache != 0 { var p uintptr var pNext uintptr @@ -27493,19 +27533,19 @@ func Xsqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno Pgno) { /* sqlit } // Close a cache. -func Xsqlite3PcacheClose(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49554:21: */ +func Xsqlite3PcacheClose(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49985:21: */ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 88 /* &.xDestroy */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache) } // Discard the contents of the cache. -func Xsqlite3PcacheClear(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49563:21: */ +func Xsqlite3PcacheClear(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49994:21: */ Xsqlite3PcacheTruncate(tls, pCache, uint32(0)) } // Merge two lists of pages connected by pDirty and in pgno order. // Do not bother fixing the pDirtyPrev pointers. -func pcacheMergeDirtyList(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:49571:14: */ +func pcacheMergeDirtyList(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:50002:14: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -27544,7 +27584,7 @@ func pcacheMergeDirtyList(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sq // there cannot be more than 31 buckets required by the merge sorter. // One extra bucket is added to catch overflow in case something // ever changes to make the previous sentence incorrect. -func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:49608:14: */ +func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:50039:14: */ bp := tls.Alloc(256) defer tls.Free(256) @@ -27587,7 +27627,7 @@ func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:4960 } // Return a list of all dirty pages in the cache, sorted by page number. -func Xsqlite3PcacheDirtyList(tls *libc.TLS, pCache uintptr) uintptr { /* sqlite3.c:49643:22: */ +func Xsqlite3PcacheDirtyList(tls *libc.TLS, pCache uintptr) uintptr { /* sqlite3.c:50074:22: */ var p uintptr for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext { (*PgHdr)(unsafe.Pointer(p)).FpDirty = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext @@ -27599,28 +27639,28 @@ func Xsqlite3PcacheDirtyList(tls *libc.TLS, pCache uintptr) uintptr { /* sqlite3 // // This is not the total number of pages referenced, but the sum of the // reference count for all pages. -func Xsqlite3PcacheRefCount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:49657:20: */ +func Xsqlite3PcacheRefCount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50088:20: */ return (*PCache)(unsafe.Pointer(pCache)).FnRefSum } // Return the number of references to the page supplied as an argument. -func Xsqlite3PcachePageRefcount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:49664:20: */ +func Xsqlite3PcachePageRefcount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50095:20: */ return int32((*PgHdr)(unsafe.Pointer(p)).FnRef) } // Return the total number of pages in the cache. -func Xsqlite3PcachePagecount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:49671:20: */ +func Xsqlite3PcachePagecount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50102:20: */ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 48 /* &.xPagecount */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache) } // Get the suggested cache-size value. -func Xsqlite3PcacheGetCachesize(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:49680:20: */ +func Xsqlite3PcacheGetCachesize(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50111:20: */ return numberOfCachePages(tls, pCache) } // Set the suggested cache-size value. -func Xsqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32) { /* sqlite3.c:49688:21: */ +func Xsqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32) { /* sqlite3.c:50119:21: */ (*PCache)(unsafe.Pointer(pCache)).FszCache = mxPage (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 40 /* &.xCachesize */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, @@ -27630,7 +27670,7 @@ func Xsqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32) { / // 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 Xsqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:49700:20: */ +func Xsqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:50131:20: */ var res int32 if mxPage != 0 { @@ -27647,20 +27687,20 @@ func Xsqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) int32 { } // Free up as much memory as possible from the page cache. -func Xsqlite3PcacheShrink(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49717:21: */ +func Xsqlite3PcacheShrink(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50148:21: */ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 96 /* &.xShrink */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache) } // Return the size of the header added by this middleware layer // in the page-cache hierarchy. -func Xsqlite3HeaderSizePcache(tls *libc.TLS) int32 { /* sqlite3.c:49726:20: */ +func Xsqlite3HeaderSizePcache(tls *libc.TLS) int32 { /* sqlite3.c:50157:20: */ return (int32(((uint64(unsafe.Sizeof(PgHdr{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) } // Return the number of dirty pages currently in the cache, as a percentage // of the configured cache size. -func Xsqlite3PCachePercentDirty(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:49732:20: */ +func Xsqlite3PCachePercentDirty(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50163:20: */ var pDirty uintptr var nDirty int32 = 0 var nCache int32 = numberOfCachePages(tls, pCache) @@ -27775,7 +27815,7 @@ type PCache11 = struct { FapHash uintptr FpFree uintptr FpBulk uintptr -} /* sqlite3.c:49849:9 */ +} /* sqlite3.c:50280:9 */ //************* End of pcache.c ********************************************* //************* Begin file pcache1.c **************************************** @@ -27861,7 +27901,7 @@ type PCache11 = struct { // common workloads. // #include "sqliteInt.h" -type PCache1 = PCache11 /* sqlite3.c:49849:24 */ +type PCache1 = PCache11 /* sqlite3.c:50280:24 */ type PgHdr11 = struct { Fpage Sqlite3_pcache_page FiKey uint32 @@ -27871,12 +27911,12 @@ type PgHdr11 = struct { FpCache uintptr FpLruNext uintptr FpLruPrev uintptr -} /* sqlite3.c:49849:9 */ +} /* sqlite3.c:50280:9 */ -type PgHdr1 = PgHdr11 /* sqlite3.c:49850:23 */ -type PgFreeslot1 = struct{ FpNext uintptr } /* sqlite3.c:49851:9 */ +type PgHdr1 = PgHdr11 /* sqlite3.c:50281:23 */ +type PgFreeslot1 = struct{ FpNext uintptr } /* sqlite3.c:50282:9 */ -type PgFreeslot = PgFreeslot1 /* sqlite3.c:49851:27 */ +type PgFreeslot = PgFreeslot1 /* sqlite3.c:50282:27 */ type PGroup1 = struct { Fmutex uintptr FnMaxPage uint32 @@ -27884,9 +27924,9 @@ type PGroup1 = struct { FmxPinned uint32 FnPurgeable uint32 Flru PgHdr1 -} /* sqlite3.c:49849:9 */ +} /* sqlite3.c:50280:9 */ -type PGroup = PGroup1 /* sqlite3.c:49852:23 */ +type PGroup = PGroup1 /* sqlite3.c:50283:23 */ // Global data used by this cache. type PCacheGlobal = struct { @@ -27903,10 +27943,10 @@ type PCacheGlobal = struct { FpFree uintptr FnFreeSlot int32 FbUnderPressure int32 -} /* sqlite3.c:49969:19 */ +} /* sqlite3.c:50400:19 */ // Global data used by this cache. -var pcache1_g PCacheGlobal /* sqlite3.c:49993:3: */ +var pcache1_g PCacheGlobal /* sqlite3.c:50424:3: */ // All code in this file should access the global structure above via the // alias "pcache1". This ensures that the WSD emulation is used when @@ -27924,7 +27964,7 @@ var pcache1_g PCacheGlobal /* sqlite3.c:49993:3: */ // // This routine is called from sqlite3_initialize() and so it is guaranteed // to be serialized already. There is no need for further mutexing. -func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { /* sqlite3.c:50028:21: */ +func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { /* sqlite3.c:50459:21: */ if pcache1_g.FisInit != 0 { var p uintptr if pBuf == uintptr(0) { @@ -27957,7 +27997,7 @@ func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { // 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 *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50054:12: */ +func pcache1InitBulk(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50485:12: */ var szBulk I64 var zBulk uintptr if pcache1_g.FnInitPage == 0 { @@ -28002,7 +28042,7 @@ func pcache1InitBulk(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50054:1 // // Multiple threads can run this routine at the same time. Global variables // in pcache1 need to be protected via mutex. -func pcache1Alloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:50097:13: */ +func pcache1Alloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:50528:13: */ var p uintptr = uintptr(0) if nByte <= pcache1_g.FszSlot { @@ -28035,7 +28075,7 @@ func pcache1Alloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:50097:13: * } // Free an allocated buffer obtained from pcache1Alloc(). -func pcache1Free(tls *libc.TLS, p uintptr) { /* sqlite3.c:50135:13: */ +func pcache1Free(tls *libc.TLS, p uintptr) { /* sqlite3.c:50566:13: */ if p == uintptr(0) { return } @@ -28065,7 +28105,7 @@ func pcache1Free(tls *libc.TLS, p uintptr) { /* sqlite3.c:50135:13: */ } // Return the size of a pcache allocation -func pcache1MemSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50168:12: */ +func pcache1MemSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50599:12: */ if (p >= pcache1_g.FpStart) && (p < pcache1_g.FpEnd) { return pcache1_g.FszSlot } else { @@ -28079,7 +28119,7 @@ func pcache1MemSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50168:12: */ } // Allocate a new page object initially associated with cache pCache. -func pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) uintptr { /* sqlite3.c:50185:15: */ +func pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) uintptr { /* sqlite3.c:50616:15: */ var p uintptr = uintptr(0) var pPg uintptr @@ -28110,13 +28150,14 @@ func pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) uintptr (*PgHdr1)(unsafe.Pointer(p)).Fpage.FpExtra = (p + 1*56) (*PgHdr1)(unsafe.Pointer(p)).FisBulkLocal = U16(0) (*PgHdr1)(unsafe.Pointer(p)).FisAnchor = U16(0) + (*PgHdr1)(unsafe.Pointer(p)).FpLruPrev = uintptr(0) // Initializing this saves a valgrind error } (*(*uint32)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable)))++ return p } // Free a page object allocated by pcache1AllocPage(). -func pcache1FreePage(tls *libc.TLS, p uintptr) { /* sqlite3.c:50236:13: */ +func pcache1FreePage(tls *libc.TLS, p uintptr) { /* sqlite3.c:50668:13: */ var pCache uintptr pCache = (*PgHdr1)(unsafe.Pointer(p)).FpCache @@ -28133,13 +28174,13 @@ func pcache1FreePage(tls *libc.TLS, p uintptr) { /* sqlite3.c:50236:13: */ // 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 Xsqlite3PageMalloc(tls *libc.TLS, sz int32) uintptr { /* sqlite3.c:50258:21: */ +func Xsqlite3PageMalloc(tls *libc.TLS, sz int32) uintptr { /* sqlite3.c:50690:21: */ // These allocations are never very large return pcache1Alloc(tls, sz) } // Free an allocated buffer obtained from sqlite3PageMalloc(). -func Xsqlite3PageFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:50266:21: */ +func Xsqlite3PageFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:50698:21: */ pcache1Free(tls, p) } @@ -28157,7 +28198,7 @@ func Xsqlite3PageFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:50266:21: */ // 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 *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50287:12: */ +func pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50719:12: */ if (pcache1_g.FnSlot != 0) && (((*PCache1)(unsafe.Pointer(pCache)).FszPage + (*PCache1)(unsafe.Pointer(pCache)).FszExtra) <= pcache1_g.FszSlot) { return pcache1_g.FbUnderPressure } else { @@ -28173,7 +28214,7 @@ func pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) int32 { /* sqlite // as the first argument. // // The PCache mutex must be held when this function is called. -func pcache1ResizeHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:50304:13: */ +func pcache1ResizeHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:50736:13: */ var apNew uintptr var nNew uint32 var i uint32 @@ -28214,7 +28255,7 @@ func pcache1ResizeHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:50304:13: */ // LRU list, then this function is a no-op. // // The PGroup mutex must be held when this function is called. -func pcache1PinPage(tls *libc.TLS, pPage uintptr) uintptr { /* sqlite3.c:50345:15: */ +func pcache1PinPage(tls *libc.TLS, pPage uintptr) uintptr { /* sqlite3.c:50777:15: */ (*PgHdr1)(unsafe.Pointer((*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev)).FpLruNext = (*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext (*PgHdr1)(unsafe.Pointer((*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext)).FpLruPrev = (*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev @@ -28231,7 +28272,7 @@ func pcache1PinPage(tls *libc.TLS, pPage uintptr) uintptr { /* sqlite3.c:50345:1 // Also free the page if freePage is true. // // The PGroup mutex must be held when this function is called. -func pcache1RemoveFromHash(tls *libc.TLS, pPage uintptr, freeFlag int32) { /* sqlite3.c:50370:13: */ +func pcache1RemoveFromHash(tls *libc.TLS, pPage uintptr, freeFlag int32) { /* sqlite3.c:50802:13: */ var h uint32 var pCache uintptr = (*PgHdr1)(unsafe.Pointer(pPage)).FpCache var pp uintptr @@ -28249,7 +28290,7 @@ func pcache1RemoveFromHash(tls *libc.TLS, pPage uintptr, freeFlag int32) { /* sq // If there are currently more than nMaxPage pages allocated, try // to recycle pages to reduce the number allocated to nMaxPage. -func pcache1EnforceMaxPage(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50388:13: */ +func pcache1EnforceMaxPage(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50820:13: */ var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup var p uintptr @@ -28270,7 +28311,7 @@ func pcache1EnforceMaxPage(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50388:1 // criteria are unpinned before they are discarded. // // The PCache mutex must be held when this function is called. -func pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { /* sqlite3.c:50413:13: */ +func pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { /* sqlite3.c:50845:13: */ var h uint32 var iStop uint32 @@ -28318,7 +28359,7 @@ func pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { /* sq //******* sqlite3_pcache Methods ********************************************* // Implementation of the sqlite3_pcache.xInit method. -func pcache1Init(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:50464:12: */ +func pcache1Init(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:50896:12: */ _ = NotUsed libc.Xmemset(tls, uintptr(unsafe.Pointer(&pcache1_g)), 0, uint64(unsafe.Sizeof(pcache1_g))) @@ -28356,7 +28397,7 @@ func pcache1Init(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:50464: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 *libc.TLS, NotUsed uintptr) { /* sqlite3.c:50517:13: */ +func pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:50949:13: */ _ = NotUsed libc.Xmemset(tls, uintptr(unsafe.Pointer(&pcache1_g)), 0, uint64(unsafe.Sizeof(pcache1_g))) @@ -28365,7 +28406,7 @@ func pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:50517:13: */ // Implementation of the sqlite3_pcache.xCreate method. // // Allocate a new cache. -func pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) uintptr { /* sqlite3.c:50531:23: */ +func pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) uintptr { /* sqlite3.c:50963:23: */ var pCache uintptr // The newly created page cache var pGroup uintptr // The group the new page cache will belong to var sz int32 // Bytes of memory required to allocate the new cache @@ -28415,7 +28456,7 @@ func pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) // Implementation of the sqlite3_pcache.xCachesize method. // // Configure the cache_size limit for a cache. -func pcache1Cachesize(tls *libc.TLS, p uintptr, nMax int32) { /* sqlite3.c:50581:13: */ +func pcache1Cachesize(tls *libc.TLS, p uintptr, nMax int32) { /* sqlite3.c:51013:13: */ var pCache uintptr = p if (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 { var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup @@ -28432,7 +28473,7 @@ func pcache1Cachesize(tls *libc.TLS, p uintptr, nMax int32) { /* sqlite3.c:50581 // Implementation of the sqlite3_pcache.xShrink method. // // Free up as much memory as possible. -func pcache1Shrink(tls *libc.TLS, p uintptr) { /* sqlite3.c:50600:13: */ +func pcache1Shrink(tls *libc.TLS, p uintptr) { /* sqlite3.c:51032:13: */ var pCache uintptr = p if (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 { var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup @@ -28447,7 +28488,7 @@ func pcache1Shrink(tls *libc.TLS, p uintptr) { /* sqlite3.c:50600:13: */ } // Implementation of the sqlite3_pcache.xPagecount method. -func pcache1Pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50617:12: */ +func pcache1Pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:51049:12: */ var n int32 var pCache uintptr = p Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex) @@ -28462,7 +28503,7 @@ func pcache1Pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50617:12: * // 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 *libc.TLS, pCache uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50635:31: */ +func pcache1FetchStage2(tls *libc.TLS, pCache uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51067:31: */ var nPinned uint32 var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup var pPage uintptr = uintptr(0) @@ -28580,7 +28621,7 @@ func pcache1FetchStage2(tls *libc.TLS, pCache uintptr, iKey uint32, createFlag i // 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 *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50763:15: */ +func pcache1FetchNoMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51195:15: */ var pCache uintptr = p var pPage uintptr = uintptr(0) @@ -28609,7 +28650,7 @@ func pcache1FetchNoMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32 return uintptr(0) } -func pcache1FetchWithMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50793:15: */ +func pcache1FetchWithMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51225:15: */ var pCache uintptr = p var pPage uintptr @@ -28620,7 +28661,7 @@ func pcache1FetchWithMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int return pPage } -func pcache1Fetch(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50808:28: */ +func pcache1Fetch(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:51240:28: */ var pCache uintptr = p if (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex != 0 { @@ -28634,7 +28675,7 @@ func pcache1Fetch(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintp // Implementation of the sqlite3_pcache.xUnpin method. // // Mark a page as unpinned (eligible for asynchronous recycling). -func pcache1Unpin(tls *libc.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) { /* sqlite3.c:50839:13: */ +func pcache1Unpin(tls *libc.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) { /* sqlite3.c:51271:13: */ var pCache uintptr = p var pPage uintptr = pPg var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup @@ -28659,7 +28700,7 @@ func pcache1Unpin(tls *libc.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) { } // Implementation of the sqlite3_pcache.xRekey method. -func pcache1Rekey(tls *libc.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint32) { /* sqlite3.c:50874:13: */ +func pcache1Rekey(tls *libc.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint32) { /* sqlite3.c:51306:13: */ var pCache uintptr = p var pPage uintptr = pPg var pp uintptr @@ -28690,7 +28731,7 @@ func pcache1Rekey(tls *libc.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint3 // 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 *libc.TLS, p uintptr, iLimit uint32) { /* sqlite3.c:50914:13: */ +func pcache1Truncate(tls *libc.TLS, p uintptr, iLimit uint32) { /* sqlite3.c:51346:13: */ var pCache uintptr = p Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex) if iLimit <= (*PCache1)(unsafe.Pointer(pCache)).FiMaxKey { @@ -28703,7 +28744,7 @@ func pcache1Truncate(tls *libc.TLS, p uintptr, iLimit uint32) { /* sqlite3.c:509 // Implementation of the sqlite3_pcache.xDestroy method. // // Destroy a cache allocated using pcache1Create(). -func pcache1Destroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:50929:13: */ +func pcache1Destroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:51361:13: */ var pCache uintptr = p var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup @@ -28726,7 +28767,7 @@ func pcache1Destroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:50929:13: */ // 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 Xsqlite3PCacheSetDefault(tls *libc.TLS) { /* sqlite3.c:50952:21: */ +func Xsqlite3PCacheSetDefault(tls *libc.TLS) { /* sqlite3.c:51384:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -28746,16 +28787,16 @@ var defaultMethods1 = Sqlite3_pcache_methods2{ FxTruncate: 0, // xTruncate FxDestroy: 0, // xDestroy FxShrink: 0, // xShrink -} /* sqlite3.c:50953:40 */ +} /* sqlite3.c:51385:40 */ // Return the size of the header on each page of this PCACHE implementation. -func Xsqlite3HeaderSizePcache1(tls *libc.TLS) int32 { /* sqlite3.c:50974:20: */ +func Xsqlite3HeaderSizePcache1(tls *libc.TLS) int32 { /* sqlite3.c:51406:20: */ return (int32(((uint64(unsafe.Sizeof(PgHdr1{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) } // Return the global mutex used by this PCACHE implementation. The // sqlite3_status() routine needs access to this mutex. -func Xsqlite3Pcache1Mutex(tls *libc.TLS) uintptr { /* sqlite3.c:50980:30: */ +func Xsqlite3Pcache1Mutex(tls *libc.TLS) uintptr { /* sqlite3.c:51412:30: */ return pcache1_g.Fmutex } @@ -28766,7 +28807,7 @@ func Xsqlite3Pcache1Mutex(tls *libc.TLS) uintptr { /* sqlite3.c:50980:30: */ // nReq is the number of bytes of memory required. Once this much has // been released, the function returns. The return value is the total number // of bytes of memory released. -func Xsqlite3PcacheReleaseMemory(tls *libc.TLS, nReq int32) int32 { /* sqlite3.c:50994:20: */ +func Xsqlite3PcacheReleaseMemory(tls *libc.TLS, nReq int32) int32 { /* sqlite3.c:51426:20: */ var nFree int32 = 0 if Xsqlite3Config.FpPage == uintptr(0) { @@ -28787,7 +28828,7 @@ func Xsqlite3PcacheReleaseMemory(tls *libc.TLS, nReq int32) int32 { /* sqlite3.c // This function is used by test procedures to inspect the internal state // of the global cache. -func Xsqlite3PcacheStats(tls *libc.TLS, pnCurrent uintptr, pnMax uintptr, pnMin uintptr, pnRecyclable uintptr) { /* sqlite3.c:51024:21: */ +func Xsqlite3PcacheStats(tls *libc.TLS, pnCurrent uintptr, pnMax uintptr, pnMin uintptr, pnRecyclable uintptr) { /* sqlite3.c:51456:21: */ var p uintptr var nRecyclable int32 = 0 for p = pcache1_g.Fgrp.Flru.FpLruNext; (p != 0) && !(int32((*PgHdr1)(unsafe.Pointer(p)).FisAnchor) != 0); p = (*PgHdr1)(unsafe.Pointer(p)).FpLruNext { @@ -28879,7 +28920,7 @@ type RowSetEntry = struct { Fv I64 FpRight uintptr FpLeft uintptr -} /* sqlite3.c:14686:9 */ +} /* sqlite3.c:14807:9 */ // RowSetEntry objects are allocated in large chunks (instances of the // following structure) to reduce memory allocation overhead. The @@ -28892,13 +28933,13 @@ type RowSetChunk = struct { FpRight uintptr FpLeft uintptr } -} /* sqlite3.c:14686:9 */ +} /* sqlite3.c:14807:9 */ // Allowed values for RowSet.rsFlags // Allocate a RowSet object. Return NULL if a memory allocation // error occurs. -func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:51174:23: */ +func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:51606:23: */ var p uintptr = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(RowSet{}))) if p != 0 { var N int32 = Xsqlite3DbMallocSize(tls, db, p) @@ -28909,7 +28950,7 @@ func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:51174: (*RowSet)(unsafe.Pointer(p)).FpForest = uintptr(0) (*RowSet)(unsafe.Pointer(p)).FpFresh = (uintptr((((uint64(unsafe.Sizeof(RowSet{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) + p) (*RowSet)(unsafe.Pointer(p)).FnFresh = (U16((uint64(N) - (((uint64(unsafe.Sizeof(RowSet{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) / uint64(unsafe.Sizeof(RowSetEntry{})))) - (*RowSet)(unsafe.Pointer(p)).FrsFlags = ROWSET_SORTED + (*RowSet)(unsafe.Pointer(p)).FrsFlags = U16(ROWSET_SORTED) (*RowSet)(unsafe.Pointer(p)).FiBatch = 0 } return p @@ -28918,7 +28959,7 @@ func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:51174: // 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 Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51196:21: */ +func Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51628:21: */ var p uintptr = pArg var pChunk uintptr var pNextChunk uintptr @@ -28931,13 +28972,13 @@ func Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51196:21: * (*RowSet)(unsafe.Pointer(p)).FpEntry = uintptr(0) (*RowSet)(unsafe.Pointer(p)).FpLast = uintptr(0) (*RowSet)(unsafe.Pointer(p)).FpForest = uintptr(0) - (*RowSet)(unsafe.Pointer(p)).FrsFlags = ROWSET_SORTED + (*RowSet)(unsafe.Pointer(p)).FrsFlags = U16(ROWSET_SORTED) } // 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 Xsqlite3RowSetDelete(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51216:21: */ +func Xsqlite3RowSetDelete(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51648:21: */ Xsqlite3RowSetClear(tls, pArg) Xsqlite3DbFree(tls, (*RowSet)(unsafe.Pointer(pArg)).Fdb, pArg) } @@ -28948,7 +28989,7 @@ func Xsqlite3RowSetDelete(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51216:21: // // In an OOM situation, the RowSet.db->mallocFailed flag is set and this // routine returns NULL. -func rowSetEntryAlloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:51229:27: */ +func rowSetEntryAlloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:51661:27: */ if int32((*RowSet)(unsafe.Pointer(p)).FnFresh) == 0 { //OPTIMIZATION-IF-FALSE // We could allocate a fresh RowSetEntry each time one is needed, but it @@ -28971,7 +29012,7 @@ func rowSetEntryAlloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:51229:27: // // The mallocFailed flag of the database connection is set if a // memory allocation fails. -func Xsqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid I64) { /* sqlite3.c:51254:21: */ +func Xsqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid I64) { /* sqlite3.c:51686:21: */ var pEntry uintptr // The new entry var pLast uintptr // The last prior entry @@ -29001,7 +29042,7 @@ func Xsqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid I64) { /* sqlite3.c:51 // // The input lists are connected via pRight pointers and are // assumed to each already be in sorted order. -func rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:51285:27: */ +func rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:51717:27: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -29036,7 +29077,7 @@ func rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite // Sort all elements on the list of RowSetEntry objects into order of // increasing v. -func rowSetEntrySort(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:51320:27: */ +func rowSetEntrySort(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:51752:27: */ bp := tls.Alloc(320) defer tls.Free(320) @@ -29072,7 +29113,7 @@ func rowSetEntrySort(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:51320:27 // 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 *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintptr) { /* sqlite3.c:51349:13: */ +func rowSetTreeToList(tls *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintptr) { /* sqlite3.c:51781:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -29103,7 +29144,7 @@ func rowSetTreeToList(tls *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintpt // and leave *ppList set to NULL. // // Return a pointer to the root of the constructed binary tree. -func rowSetNDeepTree(tls *libc.TLS, ppList uintptr, iDepth int32) uintptr { /* sqlite3.c:51384:27: */ +func rowSetNDeepTree(tls *libc.TLS, ppList uintptr, iDepth int32) uintptr { /* sqlite3.c:51816:27: */ var p uintptr // Root of the new tree var pLeft uintptr // Left subtree if *(*uintptr)(unsafe.Pointer(ppList)) == uintptr(0) { //OPTIMIZATION-IF-TRUE @@ -29134,7 +29175,7 @@ func rowSetNDeepTree(tls *libc.TLS, ppList uintptr, iDepth int32) uintptr { /* s // 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 *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:51420:27: */ +func rowSetListToTree(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:51852:27: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = pList @@ -29167,7 +29208,7 @@ func rowSetListToTree(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:51420 // 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 Xsqlite3RowSetNext(tls *libc.TLS, p uintptr, pRowid uintptr) int32 { /* sqlite3.c:51452:20: */ +func Xsqlite3RowSetNext(tls *libc.TLS, p uintptr, pRowid uintptr) int32 { /* sqlite3.c:51884:20: */ // Cannot be used with sqlite3RowSetText() @@ -29200,7 +29241,7 @@ func Xsqlite3RowSetNext(tls *libc.TLS, p uintptr, pRowid uintptr) int32 { /* sql // 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 Xsqlite3RowSetTest(tls *libc.TLS, pRowSet uintptr, iBatch int32, iRowid Sqlite3_int64) int32 { /* sqlite3.c:51486:20: */ +func Xsqlite3RowSetTest(tls *libc.TLS, pRowSet uintptr, iBatch int32, iRowid Sqlite3_int64) int32 { /* sqlite3.c:51918:20: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -29339,7 +29380,7 @@ type Wal1 = struct { FnCkpt U32 _ [4]byte FpSnapshot uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ //************* End of rowset.c ********************************************* //************* Begin file pager.c ****************************************** @@ -29385,7 +29426,7 @@ type Wal1 = struct { // Connection to a write-ahead log (WAL) file. // There is one object of this type for each pager. -type Wal = Wal1 /* sqlite3.c:51628:20 */ +type Wal = Wal1 /* sqlite3.c:52060:20 */ //************* End of wal.h ************************************************ //************* Continuing where we left off in pager.c ********************* @@ -29766,13 +29807,15 @@ type Wal = Wal1 /* sqlite3.c:51628:20 */ // journal before the journal-header. This is required during savepoint // rollback (see pagerPlaybackSavepoint()). type PagerSavepoint1 = struct { - FiOffset I64 - FiHdrOffset I64 - FpInSavepoint uintptr - FnOrig Pgno - FiSubRec Pgno - FaWalData [4]U32 -} /* sqlite3.c:1297:9 */ + FiOffset I64 + FiHdrOffset I64 + FpInSavepoint uintptr + FnOrig Pgno + FiSubRec Pgno + FbTruncateOnRelease int32 + FaWalData [4]U32 + _ [4]byte +} /* sqlite3.c:1312:9 */ //************* End of wal.h ************************************************ //************* Continuing where we left off in pager.c ********************* @@ -30152,7 +30195,7 @@ type PagerSavepoint1 = struct { // immediately following the last journal record written into the main // journal before the journal-header. This is required during savepoint // rollback (see pagerPlaybackSavepoint()). -type PagerSavepoint = PagerSavepoint1 /* sqlite3.c:52139:31 */ +type PagerSavepoint = PagerSavepoint1 /* sqlite3.c:52571:31 */ // Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains // the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -30161,9 +30204,9 @@ type PagerSavepoint = PagerSavepoint1 /* sqlite3.c:52139:31 */ // The following global variables hold counters used for // testing purposes only. These variables do not exist in // a non-testing build. These variables are not thread-safe. -var Xsqlite3_pager_readdb_count int32 = 0 /* sqlite3.c:52426:16 */ // Number of full pages read from DB -var Xsqlite3_pager_writedb_count int32 = 0 /* sqlite3.c:52427:16 */ // Number of full pages written to DB -var Xsqlite3_pager_writej_count int32 = 0 /* sqlite3.c:52428:16 */ // Number of pages written to journal +var Xsqlite3_pager_readdb_count int32 = 0 /* sqlite3.c:52859:16 */ // Number of full pages read from DB +var Xsqlite3_pager_writedb_count int32 = 0 /* sqlite3.c:52860:16 */ // Number of full pages written to DB +var Xsqlite3_pager_writej_count int32 = 0 /* sqlite3.c:52861:16 */ // Number of pages written to journal // Journal files begin with the following magic string. The data // was obtained from /dev/random. It is used only as a sanity check. @@ -30188,11 +30231,11 @@ var Xsqlite3_pager_writej_count int32 = 0 /* sqlite3.c:52428:16 */ // Number of // is different for every journal, we minimize that risk. var aJournalMagic = [8]uint8{ uint8(0xd9), uint8(0xd5), uint8(0x05), uint8(0xf9), uint8(0x20), uint8(0xa1), uint8(0x63), uint8(0xd7), -} /* sqlite3.c:52459:28 */ +} /* sqlite3.c:52892:28 */ // Set the Pager.xGet method for the appropriate routine used to fetch // content from the pager. -func setGetterMethod(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:52752:13: */ +func setGetterMethod(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53185:13: */ if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 { (*Pager)(unsafe.Pointer(pPager)).FxGet = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32 @@ -30215,14 +30258,17 @@ func setGetterMethod(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:52752:13: */ // * 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 *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:52773:12: */ +func subjRequiresPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:53206:12: */ var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager var p uintptr var pgno Pgno = (*PgHdr)(unsafe.Pointer(pPg)).Fpgno var i int32 for i = 0; i < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; i++ { - p = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(i)*48) + p = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(i)*56) if ((*PagerSavepoint)(unsafe.Pointer(p)).FnOrig >= pgno) && (0 == Xsqlite3BitvecTestNotNull(tls, (*PagerSavepoint)(unsafe.Pointer(p)).FpInSavepoint, pgno)) { + for i = (i + 1); i < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; i++ { + (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(i)*56)).FbTruncateOnRelease = 0 + } return 1 } } @@ -30234,7 +30280,7 @@ func subjRequiresPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:52773:12: // error code is something goes wrong. // // All values are stored on disk as big-endian. -func read32bits(tls *libc.TLS, fd uintptr, offset I64, pRes uintptr) int32 { /* sqlite3.c:52803:12: */ +func read32bits(tls *libc.TLS, fd uintptr, offset I64, pRes uintptr) int32 { /* sqlite3.c:53239:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -30251,7 +30297,7 @@ func read32bits(tls *libc.TLS, fd uintptr, offset I64, pRes uintptr) int32 { /* // 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 *libc.TLS, fd uintptr, offset I64, val U32) int32 { /* sqlite3.c:52822:12: */ +func write32bits(tls *libc.TLS, fd uintptr, offset I64, val U32) int32 { /* sqlite3.c:53258:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -30268,7 +30314,7 @@ func write32bits(tls *libc.TLS, fd uintptr, offset I64, val U32) int32 { /* sqli // 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 *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:52837:12: */ +func pagerUnlockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:53273:12: */ var rc int32 = SQLITE_OK if (*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0) { @@ -30295,7 +30341,7 @@ func pagerUnlockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite // 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 *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:52865:12: */ +func pagerLockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:53301:12: */ var rc int32 = SQLITE_OK if (int32((*Pager)(unsafe.Pointer(pPager)).FeLock) < eLock) || (int32((*Pager)(unsafe.Pointer(pPager)).FeLock) == (EXCLUSIVE_LOCK + 1)) { @@ -30329,7 +30375,7 @@ func pagerLockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3. // returned in this case. // // If neither optimization can be used, 0 is returned. -func jrnlBufferSize(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:52898:12: */ +func jrnlBufferSize(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53334:12: */ _ = pPager @@ -30363,7 +30409,7 @@ func jrnlBufferSize(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:52898:12 // // If an error occurs while reading from the journal file, an SQLite // error code is returned. -func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32) int32 { /* sqlite3.c:53003:12: */ +func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32) int32 { /* sqlite3.c:53439:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -30422,7 +30468,7 @@ func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32) // 100 512 // 2000 2048 // -func journalHdrOffset(tls *libc.TLS, pPager uintptr) I64 { /* sqlite3.c:53059:12: */ +func journalHdrOffset(tls *libc.TLS, pPager uintptr) I64 { /* sqlite3.c:53495:12: */ var offset I64 = int64(0) var c I64 = (*Pager)(unsafe.Pointer(pPager)).FjournalOff if c != 0 { @@ -30451,7 +30497,7 @@ func journalHdrOffset(tls *libc.TLS, pPager uintptr) I64 { /* sqlite3.c:53059:12 // // If an IO error occurs, abandon processing and return the IO error code. // Otherwise, return SQLITE_OK. -func zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) int32 { /* sqlite3.c:53092:12: */ +func zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) int32 { /* sqlite3.c:53528:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -30486,7 +30532,7 @@ func zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) int32 { /* return rc } -var zeroHdr = [28]int8{0: int8(0)} /* sqlite3.c:53103:25 */ +var zeroHdr = [28]int8{0: int8(0)} /* sqlite3.c:53539:25 */ // 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 @@ -30501,7 +30547,7 @@ var zeroHdr = [28]int8{0: int8(0)} /* sqlite3.c:53103:25 */ // - 4 bytes: Database page size. // // Followed by (JOURNAL_HDR_SZ - 28) bytes of unused space. -func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53142:12: */ +func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53578:12: */ var rc int32 = SQLITE_OK // Return code var zHeader uintptr = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace // Temporary space used to build header var nHeader U32 = U32((*Pager)(unsafe.Pointer(pPager)).FpageSize) // Size of buffer pointed to by zHeader @@ -30518,8 +30564,8 @@ func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53142:1 // since the most recent journal header was written, update the // PagerSavepoint.iHdrOffset fields now. for ii = 0; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ { - if (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*48)).FiHdrOffset == int64(0) { - (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(ii)*48)).FiHdrOffset = (*Pager)(unsafe.Pointer(pPager)).FjournalOff + if (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*56)).FiHdrOffset == int64(0) { + (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(ii)*56)).FiHdrOffset = (*Pager)(unsafe.Pointer(pPager)).FjournalOff } } @@ -30611,7 +30657,7 @@ func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53142:1 // 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 *libc.TLS, pPager uintptr, isHot int32, journalSize I64, pNRec uintptr, pDbSize uintptr) int32 { /* sqlite3.c:53260:12: */ +func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64, pNRec uintptr, pDbSize uintptr) int32 { /* sqlite3.c:53696:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -30678,7 +30724,7 @@ func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64, // of two greater than or equal to 512 or 32, and not greater than their // respective compile time maximum limits. if (((((*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) < U32(512)) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) < U32(32))) || - (*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) > SQLITE_MAX_PAGE_SIZE)) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) > MAX_SECTOR_SIZE)) || + (*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) > U32(SQLITE_MAX_PAGE_SIZE))) || (*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) > U32(MAX_SECTOR_SIZE))) || (((*(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */)) - U32(1)) & *(*U32)(unsafe.Pointer(bp + 12 /* iPageSize */))) != U32(0))) || (((*(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */)) - U32(1)) & *(*U32)(unsafe.Pointer(bp + 8 /* iSectorSize */))) != U32(0)) { // If the either the page-size or sector-size in the journal-header is // invalid, then the process that wrote the journal-header must have @@ -30721,7 +30767,7 @@ func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64, // // If zSuper is a NULL pointer (occurs for a single database transaction), // this call is a no-op. -func writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:53385:12: */ +func writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:53821:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -30781,24 +30827,24 @@ func writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* } // Discard the entire contents of the in-memory page-cache. -func pager_reset(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53453:13: */ +func pager_reset(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53889:13: */ (*Pager)(unsafe.Pointer(pPager)).FiDataVersion++ Xsqlite3BackupRestart(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup) Xsqlite3PcacheClear(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) } // Return the pPager->iDataVersion value -func Xsqlite3PagerDataVersion(tls *libc.TLS, pPager uintptr) U32 { /* sqlite3.c:53462:20: */ +func Xsqlite3PagerDataVersion(tls *libc.TLS, pPager uintptr) U32 { /* sqlite3.c:53898:20: */ return (*Pager)(unsafe.Pointer(pPager)).FiDataVersion } // 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 *libc.TLS, pPager uintptr) { /* sqlite3.c:53471:13: */ +func releaseAllSavepoints(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53907:13: */ var ii int32 // Iterator for looping through Pager.aSavepoint for ii = 0; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ { - Xsqlite3BitvecDestroy(tls, (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*48)).FpInSavepoint) + Xsqlite3BitvecDestroy(tls, (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*56)).FpInSavepoint) } if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) || (Xsqlite3JournalIsInMemory(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd) != 0) { Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd) @@ -30812,12 +30858,12 @@ func releaseAllSavepoints(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53471:13 // 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 *libc.TLS, pPager uintptr, pgno Pgno) int32 { /* sqlite3.c:53490:12: */ +func addToSavepointBitvecs(tls *libc.TLS, pPager uintptr, pgno Pgno) int32 { /* sqlite3.c:53926:12: */ var ii int32 // Loop counter var rc int32 = SQLITE_OK // Result code for ii = 0; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ { - var p uintptr = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(ii)*48) + var p uintptr = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(ii)*56) if pgno <= (*PagerSavepoint)(unsafe.Pointer(p)).FnOrig { rc = rc | (Xsqlite3BitvecSet(tls, (*PagerSavepoint)(unsafe.Pointer(p)).FpInSavepoint, pgno)) @@ -30841,7 +30887,7 @@ func addToSavepointBitvecs(tls *libc.TLS, pPager uintptr, pgno Pgno) int32 { /* // 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 *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ +func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53958:13: */ Xsqlite3BitvecDestroy(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal) (*Pager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) @@ -30850,7 +30896,7 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) { Xsqlite3WalEndReadTransaction(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } else if !(int32((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode) != 0) { var rc int32 // Error code returned by pagerUnlockDb() var iDc int32 @@ -30883,7 +30929,7 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ // without clearing the error code. This is intentional - the error // code is cleared and the cache reset in the block below. - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } // If Pager.errCode is set, the contents of the pager cache cannot be @@ -30895,13 +30941,13 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 { pager_reset(tls, pPager) (*Pager)(unsafe.Pointer(pPager)).FchangeCountDone = U8(0) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } else { (*Pager)(unsafe.Pointer(pPager)).FeState = func() uint8 { if (*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0) { - return PAGER_OPEN + return uint8(PAGER_OPEN) } - return PAGER_READER + return uint8(PAGER_READER) }() } if (*Pager)(unsafe.Pointer(pPager)).FbUseFetch != 0 { @@ -30933,12 +30979,12 @@ func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */ // 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 *libc.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:53619:12: */ +func pager_error(tls *libc.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:54055:12: */ var rc2 int32 = (rc & 0xff) if (rc2 == SQLITE_FULL) || (rc2 == SQLITE_IOERR) { (*Pager)(unsafe.Pointer(pPager)).FerrCode = rc - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_ERROR + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_ERROR) setGetterMethod(tls, pPager) } return rc @@ -30958,7 +31004,7 @@ func pager_error(tls *libc.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:5 // 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 *libc.TLS, pPager uintptr, bCommit int32) int32 { /* sqlite3.c:53653:12: */ +func pagerFlushOnCommit(tls *libc.TLS, pPager uintptr, bCommit int32) int32 { /* sqlite3.c:54089:12: */ if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 { return 1 } @@ -31022,7 +31068,7 @@ func pagerFlushOnCommit(tls *libc.TLS, pPager uintptr, bCommit int32) int32 { /* // 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 *libc.TLS, pPager uintptr, hasSuper int32, bCommit int32) int32 { /* sqlite3.c:53713:12: */ +func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommit int32) int32 { /* sqlite3.c:54149:12: */ var rc int32 = SQLITE_OK // Error code from journal finalization operation var rc2 int32 = SQLITE_OK // Error code from db file unlock operation @@ -31123,7 +31169,7 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi (!((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) || (Xsqlite3WalExclusiveMode(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, 0) != 0)) { rc2 = pagerUnlockDb(tls, pPager, SHARED_LOCK) } - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_READER + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER) (*Pager)(unsafe.Pointer(pPager)).FsetSuper = U8(0) return func() int32 { @@ -31149,7 +31195,7 @@ func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommi // 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 *libc.TLS, pPager uintptr) { /* sqlite3.c:53860:13: */ +func pagerUnlockAndRollback(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54296:13: */ if (int32((*Pager)(unsafe.Pointer(pPager)).FeState) != PAGER_ERROR) && (int32((*Pager)(unsafe.Pointer(pPager)).FeState) != PAGER_OPEN) { if int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_LOCKED { @@ -31181,7 +31227,7 @@ func pagerUnlockAndRollback(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53860: // 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 *libc.TLS, pPager uintptr, aData uintptr) U32 { /* sqlite3.c:53894:12: */ +func pager_cksum(tls *libc.TLS, pPager uintptr, aData uintptr) U32 { /* sqlite3.c:54330:12: */ var cksum U32 = (*Pager)(unsafe.Pointer(pPager)).FcksumInit // Checksum value to return var i int32 = ((*Pager)(unsafe.Pointer(pPager)).FpageSize - 200) // Loop counter for i > 0 { @@ -31226,7 +31272,7 @@ func pager_cksum(tls *libc.TLS, pPager uintptr, aData uintptr) U32 { /* sqlite3. // 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 *libc.TLS, pPager uintptr, pOffset uintptr, pDone uintptr, isMainJrnl int32, isSavepnt int32) int32 { /* sqlite3.c:53941:12: */ +func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDone uintptr, isMainJrnl int32, isSavepnt int32) int32 { /* sqlite3.c:54377:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -31460,7 +31506,7 @@ func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDo // the entire contents of the super-journal file. This could be // a couple of kilobytes or so - potentially larger than the page // size. -func pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:54188:12: */ +func pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:54624:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -31473,6 +31519,7 @@ func pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sq // Size of super-journal file var zJournal uintptr // Pointer to one journal within MJ file var zSuperPtr uintptr // Space to hold super-journal filename + var zFree uintptr // Free this buffer var nSuperPtr int32 var flags int32 // One of the journals pointed to by the super-journal exists. @@ -31485,7 +31532,8 @@ func pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sq var flags1 int32 // var exists int32 at bp+8, 4 pVfs = (*Pager)(unsafe.Pointer(pPager)).FpVfs - zSuperJournal = uintptr(0) // Amount of space allocated to zSuperPtr[] + zSuperJournal = uintptr(0) + zFree = uintptr(0) // Amount of space allocated to zSuperPtr[] // Allocate space for both the pJournal and pSuper file descriptors. // If successful, open the super-journal file for reading. @@ -31521,14 +31569,16 @@ __3: __4: ; nSuperPtr = ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + 1) - zSuperJournal = Xsqlite3Malloc(tls, (uint64((*(*I64)(unsafe.Pointer(bp /* nSuperJournal */)) + I64(nSuperPtr)) + int64(2)))) - if !(!(zSuperJournal != 0)) { + zFree = Xsqlite3Malloc(tls, (uint64(((int64(4) + *(*I64)(unsafe.Pointer(bp /* nSuperJournal */))) + I64(nSuperPtr)) + int64(2)))) + if !(!(zFree != 0)) { goto __5 } rc = SQLITE_NOMEM goto delsuper_out __5: ; + *(*int8)(unsafe.Pointer(zFree)) = libc.AssignPtrInt8(zFree+1, libc.AssignPtrInt8(zFree+2, libc.AssignPtrInt8(zFree+3, int8(0)))) + zSuperJournal = (zFree + 4) zSuperPtr = (zSuperJournal + uintptr((*(*I64)(unsafe.Pointer(bp /* nSuperJournal */)) + int64(2)))) rc = Xsqlite3OsRead(tls, pSuper, zSuperJournal, int32(*(*I64)(unsafe.Pointer(bp /* nSuperJournal */))), int64(0)) if !(rc != SQLITE_OK) { @@ -31592,7 +31642,7 @@ __8: rc = Xsqlite3OsDelete(tls, pVfs, zSuper, 0) delsuper_out: - Xsqlite3_free(tls, zSuperJournal) + Xsqlite3_free(tls, zFree) if !(pSuper != 0) { goto __14 } @@ -31622,7 +31672,7 @@ __14: // // 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 *libc.TLS, pPager uintptr, nPage Pgno) int32 { /* sqlite3.c:54303:12: */ +func pager_truncate(tls *libc.TLS, pPager uintptr, nPage Pgno) int32 { /* sqlite3.c:54742:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -31657,7 +31707,7 @@ func pager_truncate(tls *libc.TLS, pPager uintptr, nPage Pgno) int32 { /* sqlite // 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 Xsqlite3SectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:54339:20: */ +func Xsqlite3SectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:54778:20: */ var iRet int32 = Xsqlite3OsSectorSize(tls, pFile) if iRet < 32 { iRet = 512 @@ -31689,7 +31739,7 @@ func Xsqlite3SectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:54339 // (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 *libc.TLS, pPager uintptr) { /* sqlite3.c:54373:13: */ +func setSectorSize(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54812:13: */ if ((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0) || ((Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd) & SQLITE_IOCAP_POWERSAFE_OVERWRITE) != 0) { @@ -31757,7 +31807,7 @@ func setSectorSize(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54373:13: */ // 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 *libc.TLS, pPager uintptr, isHot int32) int32 { /* sqlite3.c:54446:12: */ +func pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) int32 { /* sqlite3.c:54885:12: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -31983,7 +32033,11 @@ __22: if !(rc == SQLITE_OK) { goto __23 } - zSuper = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace + // Leave 4 bytes of space before the super-journal filename in memory. + // This is because it may end up being passed to sqlite3OsOpen(), in + // which case it requires 4 0x00 bytes in memory immediately before + // the filename. + zSuper = ((*Pager)(unsafe.Pointer(pPager)).FpTmpSpace + 4) rc = readSuperJournal(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, (uint32((*Sqlite3_vfs)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname + 1))) __23: @@ -32007,6 +32061,8 @@ __25: } // If there was a super-journal and this routine will return success, // see if it is possible to delete the super-journal. + + libc.Xmemset(tls, (zSuper + libc.UintptrFromInt32(-4)), 0, uint64(4)) rc = pager_delsuper(tls, pPager, zSuper) __26: @@ -32014,7 +32070,7 @@ __26: if !((isHot != 0) && (nPlayback != 0)) { goto __27 } - Xsqlite3_log(tls, (SQLITE_NOTICE | (int32(2) << 8)), ts+5565, /* "recovered %d pag..." */ + Xsqlite3_log(tls, (SQLITE_NOTICE | (int32(2) << 8)), ts+5641, /* "recovered %d pag..." */ libc.VaList(bp, nPlayback, (*Pager)(unsafe.Pointer(pPager)).FzJournal)) __27: ; @@ -32036,7 +32092,7 @@ __27: // // If an IO error occurs, then the IO error is returned to the caller. // Otherwise, SQLITE_OK is returned. -func readDbPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:54657:12: */ +func readDbPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:55102:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -32092,7 +32148,7 @@ func readDbPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:54657:12: */ // 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 *libc.TLS, pPg uintptr) { /* sqlite3.c:54720:13: */ +func pager_write_changecounter(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55165:13: */ var change_counter U32 // Increment the value just read and write it back to byte 24. @@ -32103,7 +32159,7 @@ func pager_write_changecounter(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:54720: // bytes 92..95 store the change counter for which the version number // is valid. Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(92)), change_counter) - Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(96)), SQLITE_VERSION_NUMBER) + Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(96)), uint32(SQLITE_VERSION_NUMBER)) } // This function is invoked once for each page that has already been @@ -32116,7 +32172,7 @@ func pager_write_changecounter(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:54720: // 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 *libc.TLS, pCtx uintptr, iPg Pgno) int32 { /* sqlite3.c:54747:12: */ +func pagerUndoCallback(tls *libc.TLS, pCtx uintptr, iPg Pgno) int32 { /* sqlite3.c:55192:12: */ var rc int32 = SQLITE_OK var pPager uintptr = pCtx var pPg uintptr @@ -32147,7 +32203,7 @@ func pagerUndoCallback(tls *libc.TLS, pCtx uintptr, iPg Pgno) int32 { /* sqlite3 } // This function is called to rollback a transaction on a WAL database. -func pagerRollbackWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54782:12: */ +func pagerRollbackWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55227:12: */ var rc int32 // Return Code var pList uintptr // List of dirty pages to revert @@ -32178,7 +32234,7 @@ func pagerRollbackWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54782: // // The list of pages passed into this routine is always sorted by page number. // Hence, if page 1 appears anywhere on the list, it will be the first page. -func pagerWalFrames(tls *libc.TLS, pPager uintptr, pList uintptr, nTruncate Pgno, isCommit int32) int32 { /* sqlite3.c:54814:12: */ +func pagerWalFrames(tls *libc.TLS, pPager uintptr, pList uintptr, nTruncate Pgno, isCommit int32) int32 { /* sqlite3.c:55259:12: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = pList @@ -32226,7 +32282,7 @@ func pagerWalFrames(tls *libc.TLS, pPager uintptr, pList uintptr, nTruncate Pgno // 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 *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54881:12: */ +func pagerBeginReadTransaction(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55326:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -32257,7 +32313,7 @@ func pagerBeginReadTransaction(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3 // 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 *libc.TLS, pPager uintptr, pnPage uintptr) int32 { /* sqlite3.c:54914:12: */ +func pagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) int32 { /* sqlite3.c:55359:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -32311,7 +32367,7 @@ func pagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) int32 { /* sq // 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 *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54974:12: */ +func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55419:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -32338,7 +32394,7 @@ func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5 rc = Xsqlite3PagerOpenWal(tls, pPager, uintptr(0)) } } else if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_WAL { - (*Pager)(unsafe.Pointer(pPager)).FjournalMode = PAGER_JOURNALMODE_DELETE + (*Pager)(unsafe.Pointer(pPager)).FjournalMode = U8(PAGER_JOURNALMODE_DELETE) } } } @@ -32379,7 +32435,7 @@ func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5 // 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 *libc.TLS, pPager uintptr, pSavepoint uintptr) int32 { /* sqlite3.c:55041:12: */ +func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) int32 { /* sqlite3.c:55486:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -32469,7 +32525,7 @@ func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) i *(*I64)(unsafe.Pointer(bp + 8 /* offset */)) = (I64((*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiSubRec) * (I64(4 + (*Pager)(unsafe.Pointer(pPager)).FpageSize))) if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) { - rc = Xsqlite3WalSavepointUndo(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSavepoint+32 /* &.aWalData */) + rc = Xsqlite3WalSavepointUndo(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSavepoint+36 /* &.aWalData */) } for ii = (*PagerSavepoint)(unsafe.Pointer(pSavepoint)).FiSubRec; (rc == SQLITE_OK) && (ii < (*Pager)(unsafe.Pointer(pPager)).FnSubRec); ii++ { @@ -32488,18 +32544,18 @@ func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) i // Change the maximum number of in-memory pages that are allowed // before attempting to recycle clean and unused pages. -func Xsqlite3PagerSetCachesize(tls *libc.TLS, pPager uintptr, mxPage int32) { /* sqlite3.c:55153:21: */ +func Xsqlite3PagerSetCachesize(tls *libc.TLS, pPager uintptr, mxPage int32) { /* sqlite3.c:55598:21: */ Xsqlite3PcacheSetCachesize(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, mxPage) } // Change the maximum number of in-memory pages that are allowed // before attempting to spill pages to journal. -func Xsqlite3PagerSetSpillsize(tls *libc.TLS, pPager uintptr, mxPage int32) int32 { /* sqlite3.c:55161:20: */ +func Xsqlite3PagerSetSpillsize(tls *libc.TLS, pPager uintptr, mxPage int32) int32 { /* sqlite3.c:55606:20: */ return Xsqlite3PcacheSetSpillsize(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, mxPage) } // Invoke SQLITE_FCNTL_MMAP_SIZE based on the current value of szMmap. -func pagerFixMaplimit(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55168:13: */ +func pagerFixMaplimit(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55613:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -32515,13 +32571,13 @@ func pagerFixMaplimit(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55168:13: */ } // Change the maximum size of any memory mapping made of the database file. -func Xsqlite3PagerSetMmapLimit(tls *libc.TLS, pPager uintptr, szMmap Sqlite3_int64) { /* sqlite3.c:55184:21: */ +func Xsqlite3PagerSetMmapLimit(tls *libc.TLS, pPager uintptr, szMmap Sqlite3_int64) { /* sqlite3.c:55629:21: */ (*Pager)(unsafe.Pointer(pPager)).FszMmap = szMmap pagerFixMaplimit(tls, pPager) } // Free as much memory as possible from the pager. -func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55192:21: */ +func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55637:21: */ Xsqlite3PcacheShrink(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) } @@ -32574,27 +32630,27 @@ func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55192:21: // // Numeric values associated with these states are OFF==1, NORMAL=2, // and FULL=3. -func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* sqlite3.c:55248:21: */ - var level uint32 = (pgFlags & PAGER_SYNCHRONOUS_MASK) +func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* sqlite3.c:55693:21: */ + var level uint32 = (pgFlags & uint32(PAGER_SYNCHRONOUS_MASK)) if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 { (*Pager)(unsafe.Pointer(pPager)).FnoSync = U8(1) (*Pager)(unsafe.Pointer(pPager)).FfullSync = U8(0) (*Pager)(unsafe.Pointer(pPager)).FextraSync = U8(0) } else { (*Pager)(unsafe.Pointer(pPager)).FnoSync = func() uint8 { - if level == PAGER_SYNCHRONOUS_OFF { + if level == uint32(PAGER_SYNCHRONOUS_OFF) { return uint8(1) } return uint8(0) }() (*Pager)(unsafe.Pointer(pPager)).FfullSync = func() uint8 { - if level >= PAGER_SYNCHRONOUS_FULL { + if level >= uint32(PAGER_SYNCHRONOUS_FULL) { return uint8(1) } return uint8(0) }() (*Pager)(unsafe.Pointer(pPager)).FextraSync = func() uint8 { - if level == PAGER_SYNCHRONOUS_EXTRA { + if level == uint32(PAGER_SYNCHRONOUS_EXTRA) { return uint8(1) } return uint8(0) @@ -32602,19 +32658,19 @@ func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* s } if (*Pager)(unsafe.Pointer(pPager)).FnoSync != 0 { (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(0) - } else if (pgFlags & PAGER_FULLFSYNC) != 0 { - (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = SQLITE_SYNC_FULL + } else if (pgFlags & uint32(PAGER_FULLFSYNC)) != 0 { + (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(SQLITE_SYNC_FULL) } else { - (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = SQLITE_SYNC_NORMAL + (*Pager)(unsafe.Pointer(pPager)).FsyncFlags = U8(SQLITE_SYNC_NORMAL) } (*Pager)(unsafe.Pointer(pPager)).FwalSyncFlags = (U8(int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags) << 2)) if (*Pager)(unsafe.Pointer(pPager)).FfullSync != 0 { *(*U8)(unsafe.Pointer(pPager + 15 /* &.walSyncFlags */)) |= U8((int32((*Pager)(unsafe.Pointer(pPager)).FsyncFlags))) } - if ((pgFlags & PAGER_CKPT_FULLFSYNC) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) { + if ((pgFlags & uint32(PAGER_CKPT_FULLFSYNC)) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) { *(*U8)(unsafe.Pointer(pPager + 15 /* &.walSyncFlags */)) |= U8((int32(SQLITE_SYNC_FULL) << 2)) } - if (pgFlags & PAGER_CACHESPILL) != 0 { + if (pgFlags & uint32(PAGER_CACHESPILL)) != 0 { *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) &= libc.Uint8FromInt32((libc.CplInt32(SPILLFLAG_OFF))) } else { *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) |= U8((SPILLFLAG_OFF)) @@ -32624,7 +32680,7 @@ func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* s // The following global variable is incremented whenever the library // attempts to open a temporary file. This information is used for // testing and analysis only. -var Xsqlite3_opentemp_count int32 = 0 /* sqlite3.c:55290:16 */ +var Xsqlite3_opentemp_count int32 = 0 /* sqlite3.c:55735:16 */ // Open a temporary file. // @@ -32639,7 +32695,7 @@ var Xsqlite3_opentemp_count int32 = 0 /* sqlite3.c:55290:16 */ // SQLITE_OPEN_CREATE // SQLITE_OPEN_EXCLUSIVE // SQLITE_OPEN_DELETEONCLOSE -func pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32) int32 { /* sqlite3.c:55308:12: */ +func pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32) int32 { /* sqlite3.c:55753:12: */ var rc int32 // Return code Xsqlite3_opentemp_count++ // Used for testing and analysis only @@ -32669,7 +32725,7 @@ func pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32) // 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 Xsqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { /* sqlite3.c:55347:21: */ +func Xsqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { /* sqlite3.c:55792:21: */ var ap uintptr (*Pager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler (*Pager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg @@ -32706,7 +32762,7 @@ func Xsqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uin // 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 Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, nReserve int32) int32 { /* sqlite3.c:55391:20: */ +func Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, nReserve int32) int32 { /* sqlite3.c:55836:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -32775,7 +32831,7 @@ func Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, // 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 Xsqlite3PagerTempSpace(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:55459:21: */ +func Xsqlite3PagerTempSpace(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:55904:21: */ return (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace } @@ -32784,7 +32840,7 @@ func Xsqlite3PagerTempSpace(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3. // maximum page count below the current size of the database. // // Regardless of mxPage, return the current maximum page count. -func Xsqlite3PagerMaxPageCount(tls *libc.TLS, pPager uintptr, mxPage Pgno) Pgno { /* sqlite3.c:55470:21: */ +func Xsqlite3PagerMaxPageCount(tls *libc.TLS, pPager uintptr, mxPage Pgno) Pgno { /* sqlite3.c:55915:21: */ if mxPage > Pgno(0) { (*Pager)(unsafe.Pointer(pPager)).FmxPgno = mxPage } @@ -32796,14 +32852,14 @@ func Xsqlite3PagerMaxPageCount(tls *libc.TLS, pPager uintptr, mxPage Pgno) Pgno return (*Pager)(unsafe.Pointer(pPager)).FmxPgno } -var saved_cnt int32 /* sqlite3.c:55493:12: */ +var saved_cnt int32 /* sqlite3.c:55938:12: */ -func Xdisable_simulated_io_errors(tls *libc.TLS) { /* sqlite3.c:55494:6: */ +func Xdisable_simulated_io_errors(tls *libc.TLS) { /* sqlite3.c:55939:6: */ libc.AtomicStoreInt32(&saved_cnt, int32(libc.AtomicLoadInt32(&Xsqlite3_io_error_pending))) libc.AtomicStoreInt32(&Xsqlite3_io_error_pending, int32(-1)) } -func Xenable_simulated_io_errors(tls *libc.TLS) { /* sqlite3.c:55498:6: */ +func Xenable_simulated_io_errors(tls *libc.TLS) { /* sqlite3.c:55943:6: */ libc.AtomicStoreInt32(&Xsqlite3_io_error_pending, int32(libc.AtomicLoadInt32(&saved_cnt))) } @@ -32819,7 +32875,7 @@ func Xenable_simulated_io_errors(tls *libc.TLS) { /* sqlite3.c:55498:6: */ // 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 Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest uintptr) int32 { /* sqlite3.c:55520:20: */ +func Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest uintptr) int32 { /* sqlite3.c:55965:20: */ var rc int32 = SQLITE_OK libc.Xmemset(tls, pDest, 0, uint64(N)) @@ -32842,7 +32898,7 @@ func Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest u // // However, if the file is between 1 and bytes in size, then // this is considered a 1 page file. -func Xsqlite3PagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) { /* sqlite3.c:55548:21: */ +func Xsqlite3PagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) { /* sqlite3.c:55993:21: */ *(*int32)(unsafe.Pointer(pnPage)) = int32((*Pager)(unsafe.Pointer(pPager)).FdbSize) } @@ -32859,7 +32915,7 @@ func Xsqlite3PagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) { /* // 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 *libc.TLS, pPager uintptr, locktype int32) int32 { /* sqlite3.c:55569:12: */ +func pager_wait_on_lock(tls *libc.TLS, pPager uintptr, locktype int32) int32 { /* sqlite3.c:56014:12: */ var rc int32 // Return code // Check that this is either a no-op (because the requested lock is @@ -32903,7 +32959,7 @@ func pager_wait_on_lock(tls *libc.TLS, pPager uintptr, locktype int32) int32 { / // 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 Xsqlite3PagerTruncateImage(tls *libc.TLS, pPager uintptr, nPage Pgno) { /* sqlite3.c:55633:21: */ +func Xsqlite3PagerTruncateImage(tls *libc.TLS, pPager uintptr, nPage Pgno) { /* sqlite3.c:56078:21: */ (*Pager)(unsafe.Pointer(pPager)).FdbSize = nPage @@ -32930,7 +32986,7 @@ func Xsqlite3PagerTruncateImage(tls *libc.TLS, pPager uintptr, nPage Pgno) { /* // // If everything goes as planned, SQLITE_OK is returned. Otherwise, // an SQLite error code. -func pagerSyncHotJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55664:12: */ +func pagerSyncHotJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56109:12: */ var rc int32 = SQLITE_OK if !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) { rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, SQLITE_SYNC_NORMAL) @@ -32949,7 +33005,7 @@ func pagerSyncHotJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:556 // // Page references obtained by calling this function should be released // by calling pagerReleaseMapPage(). -func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr, ppPage uintptr) int32 { /* sqlite3.c:55686:12: */ +func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr, ppPage uintptr) int32 { /* sqlite3.c:56131:12: */ var p uintptr // Memory mapped page to return if (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist != 0 { @@ -32965,7 +33021,7 @@ func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr return SQLITE_NOMEM } (*PgHdr)(unsafe.Pointer(p)).FpExtra = (p + 1*72) - (*PgHdr)(unsafe.Pointer(p)).Fflags = PGHDR_MMAP + (*PgHdr)(unsafe.Pointer(p)).Fflags = U16(PGHDR_MMAP) (*PgHdr)(unsafe.Pointer(p)).FnRef = int16(1) (*PgHdr)(unsafe.Pointer(p)).FpPager = pPager } @@ -32979,7 +33035,7 @@ func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr // Release a reference to page pPg. pPg must have been returned by an // earlier call to pagerAcquireMapPage(). -func pagerReleaseMapPage(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55730:13: */ +func pagerReleaseMapPage(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:56175:13: */ var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager (*Pager)(unsafe.Pointer(pPager)).FnMmapOut-- (*PgHdr)(unsafe.Pointer(pPg)).FpDirty = (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist @@ -32989,7 +33045,7 @@ func pagerReleaseMapPage(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55730:13: */ } // Free all PgHdr objects stored in the Pager.pMmapFreelist list. -func pagerFreeMapHdrs(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55743:13: */ +func pagerFreeMapHdrs(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:56188:13: */ var p uintptr var pNext uintptr for p = (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist; p != 0; p = pNext { @@ -33002,7 +33058,7 @@ func pagerFreeMapHdrs(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55743:13: */ // under the pager. Return SQLITE_OK if the database is still where 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 *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55757:12: */ +func databaseIsUnmoved(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56202:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -33040,7 +33096,7 @@ func databaseIsUnmoved(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55757 // 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 Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:55791:20: */ +func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:56236:20: */ var pTmp uintptr = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace Xdisable_simulated_io_errors(tls) @@ -33051,7 +33107,7 @@ func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sq { var a uintptr = uintptr(0) - if ((db != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_NoCkptOnClose))) && + if ((db != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NoCkptOnClose)))) && (SQLITE_OK == databaseIsUnmoved(tls, pPager)) { a = pTmp } @@ -33091,12 +33147,12 @@ func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sq } // Return the page number for page pPg. -func Xsqlite3PagerPagenumber(tls *libc.TLS, pPg uintptr) Pgno { /* sqlite3.c:55852:21: */ +func Xsqlite3PagerPagenumber(tls *libc.TLS, pPg uintptr) Pgno { /* sqlite3.c:56297:21: */ return (*DbPage)(unsafe.Pointer(pPg)).Fpgno } // Increment the reference count for page pPg. -func Xsqlite3PagerRef(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55860:21: */ +func Xsqlite3PagerRef(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:56305:21: */ Xsqlite3PcacheRef(tls, pPg) } @@ -33133,7 +33189,7 @@ func Xsqlite3PagerRef(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55860:21: */ // 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 *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3.c:55899:12: */ +func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3.c:56344:12: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -33242,12 +33298,12 @@ func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3 // successfully synced. Either way, clear the PGHDR_NEED_SYNC flag on // all pages. Xsqlite3PcacheClearSyncFlags(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_DBMOD + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_DBMOD) return SQLITE_OK } -var zerobyte U8 = U8(0) /* sqlite3.c:55950:27 */ +var zerobyte U8 = U8(0) /* sqlite3.c:56395:27 */ // 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 @@ -33279,7 +33335,7 @@ var zerobyte U8 = U8(0) /* sqlite3.c:55950:27 */ // 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 *libc.TLS, pPager uintptr, pList uintptr) int32 { /* sqlite3.c:56042:12: */ +func pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) int32 { /* sqlite3.c:56487:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -33360,7 +33416,7 @@ func pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) int32 { // 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 *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56133:12: */ +func openSubJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56578:12: */ var rc int32 = SQLITE_OK if !((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fsjfd))).FpMethods != uintptr(0)) { var flags int32 = ((((SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_READWRITE) | @@ -33384,7 +33440,7 @@ func openSubJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56133:12 // 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 *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:56159:12: */ +func subjournalPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:56604:12: */ var rc int32 = SQLITE_OK var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != PAGER_JOURNALMODE_OFF { @@ -33415,7 +33471,7 @@ func subjournalPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:56159:12: * return rc } -func subjournalPageIfRequired(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:56195:12: */ +func subjournalPageIfRequired(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:56640:12: */ if subjRequiresPage(tls, pPg) != 0 { return subjournalPage(tls, pPg) } else { @@ -33441,7 +33497,7 @@ func subjournalPageIfRequired(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:5 // 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 *libc.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:56222:12: */ +func pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:56667:12: */ var pPager uintptr = p var rc int32 = SQLITE_OK @@ -33503,7 +33559,7 @@ func pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:562 } // Flush all unreferenced dirty pages to disk. -func Xsqlite3PagerFlush(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56299:20: */ +func Xsqlite3PagerFlush(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56744:20: */ var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode if !(int32((*Pager)(unsafe.Pointer(pPager)).FmemDb) != 0) { var pList uintptr = Xsqlite3PcacheDirtyList(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) @@ -33550,7 +33606,7 @@ func Xsqlite3PagerFlush(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5629 // 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 Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) int32 { /* sqlite3.c:56348:20: */ +func Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) int32 { /* sqlite3.c:56793:20: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -33585,7 +33641,7 @@ func Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u nPathname = 0 useJournal = (libc.Bool32((flags & PAGER_OMIT_JOURNAL) == 0)) pcacheSize = Xsqlite3PcacheSize(tls) - *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = SQLITE_DEFAULT_PAGE_SIZE + *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = U32(SQLITE_DEFAULT_PAGE_SIZE) zUri = uintptr(0) nUriByte = 1 nUri = 0 // Number of URI parameters @@ -33675,7 +33731,7 @@ __11: // bytes in length. This means the database cannot be opened, // as it will not be possible to open the journal file or even // check for a hot-journal before reading. - rc = Xsqlite3CantopenError(tls, 56435) + rc = Xsqlite3CantopenError(tls, 56880) __12: ; if !(rc != SQLITE_OK) { @@ -33783,7 +33839,7 @@ __15: (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, ts+5592 /* "-journal" */, uint64(8)) + libc.Xmemcpy(tls, pPtr, ts+5668 /* "-journal" */, uint64(8)) pPtr += (uintptr(8 + 1)) goto __19 __18: @@ -33798,7 +33854,7 @@ __19: (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, ts+5601 /* "-wal" */, uint64(4)) + libc.Xmemcpy(tls, pPtr, ts+5677 /* "-wal" */, uint64(4)) pPtr += (uintptr(4 + 1)) goto __21 __20: @@ -33844,10 +33900,10 @@ __22: if !(*(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) < (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize) { goto __27 } - if !((*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize > SQLITE_MAX_DEFAULT_PAGE_SIZE) { + if !((*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize > U32(SQLITE_MAX_DEFAULT_PAGE_SIZE)) { goto __28 } - *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = SQLITE_MAX_DEFAULT_PAGE_SIZE + *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = U32(SQLITE_MAX_DEFAULT_PAGE_SIZE) goto __29 __28: *(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsectorSize @@ -33857,9 +33913,9 @@ __27: ; __26: ; - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+5606 /* "nolock" */, 0)) + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+5682 /* "nolock" */, 0)) if !(((iDc & SQLITE_IOCAP_IMMUTABLE) != 0) || - (Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+5613 /* "immutable" */, 0) != 0)) { + (Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+5689 /* "immutable" */, 0) != 0)) { goto __30 } vfsFlags = vfsFlags | (SQLITE_OPEN_READONLY) @@ -33881,9 +33937,9 @@ __23: // This branch also runs for files marked as immutable. act_like_temp_file: tempFile = 1 - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeState = PAGER_READER // Pretend we already have a lock - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeLock = EXCLUSIVE_LOCK // Pretend we are in EXCLUSIVE mode - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(1) // Do no locking + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeState = U8(PAGER_READER) // Pretend we already have a lock + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeLock = U8(EXCLUSIVE_LOCK) // Pretend we are in EXCLUSIVE mode + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(1) // Do no locking readOnly = (vfsFlags & SQLITE_OPEN_READONLY) __24: ; @@ -33935,7 +33991,7 @@ __33: // pPager->stmtSize = 0; // pPager->stmtJSize = 0; // pPager->nPage = 0; - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FmxPgno = SQLITE_MAX_PAGE_COUNT + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FmxPgno = Pgno(SQLITE_MAX_PAGE_COUNT) // pPager->state = PAGER_UNLOCK; // pPager->errMask = 0; (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FtempFile = U8(tempFile) @@ -33954,7 +34010,7 @@ __33: __34: (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FfullSync = U8(1) (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FextraSync = U8(0) - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsyncFlags = SQLITE_SYNC_NORMAL + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FsyncFlags = U8(SQLITE_SYNC_NORMAL) (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FwalSyncFlags = (U8(SQLITE_SYNC_NORMAL | (int32(SQLITE_SYNC_NORMAL) << 2))) __35: ; @@ -33968,13 +34024,13 @@ __35: if !(!(useJournal != 0)) { goto __36 } - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = PAGER_JOURNALMODE_OFF + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = U8(PAGER_JOURNALMODE_OFF) goto __37 __36: if !((memDb != 0) || (memJM != 0)) { goto __38 } - (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = PAGER_JOURNALMODE_MEMORY + (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FjournalMode = U8(PAGER_JOURNALMODE_MEMORY) __38: ; __37: @@ -33993,7 +34049,7 @@ __37: // Return the sqlite3_file for the main database given the name // of the corresonding WAL or Journal name as passed into // xOpen. -func Xsqlite3_database_file_object(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:56719:25: */ +func Xsqlite3_database_file_object(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:57164:25: */ var pPager uintptr for (((int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-1)))) != 0) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-2)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-3)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-4)))) != 0) { zName-- @@ -34031,7 +34087,7 @@ func Xsqlite3_database_file_object(tls *libc.TLS, zName uintptr) uintptr { /* sq // 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 *libc.TLS, pPager uintptr, pExists uintptr) int32 { /* sqlite3.c:56760:12: */ +func hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) int32 { /* sqlite3.c:57205:12: */ bp := tls.Alloc(17) defer tls.Free(17) @@ -34142,7 +34198,7 @@ func hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) int32 { /* sq // 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 Xsqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56880:20: */ +func Xsqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57325:20: */ bp := tls.Alloc(28) defer tls.Free(28) @@ -34268,7 +34324,7 @@ __7: if !((rc == SQLITE_OK) && ((*(*int32)(unsafe.Pointer(bp + 8 /* fout */)) & SQLITE_OPEN_READONLY) != 0)) { goto __10 } - rc = Xsqlite3CantopenError(tls, 56964) + rc = Xsqlite3CantopenError(tls, 57409) Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd) __10: ; @@ -34293,7 +34349,7 @@ __8: goto __13 } rc = pager_playback(tls, pPager, libc.BoolInt32(!((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0))) - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) __13: ; goto __12 @@ -34404,7 +34460,7 @@ failed: goto __24 __23: - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_READER + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER) (*Pager)(unsafe.Pointer(pPager)).FhasHeldSharedLock = U8(1) __24: ; @@ -34417,7 +34473,7 @@ __24: // Except, in locking_mode=EXCLUSIVE when there is nothing to in // the rollback journal, the unlock is not performed and there is // nothing to rollback, so this routine is a no-op. -func pagerUnlockIfUnused(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:57097:13: */ +func pagerUnlockIfUnused(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:57542:13: */ if Xsqlite3PcacheRefCount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) == 0 { // because page1 is never memory mapped pagerUnlockAndRollback(tls, pPager) @@ -34479,7 +34535,7 @@ func pagerUnlockIfUnused(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:57097:13: // 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 *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57161:12: */ +func getPageNormal(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57606:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -34492,7 +34548,7 @@ func getPageNormal(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, fla if !(pgno == Pgno(0)) { goto __1 } - return Xsqlite3CorruptError(tls, 57177) + return Xsqlite3CorruptError(tls, 57622) __1: ; *(*uintptr)(unsafe.Pointer(bp /* pBase */)) = Xsqlite3PcacheFetch(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, 3) @@ -34538,7 +34594,7 @@ __5: if !(pgno == (Pgno((Xsqlite3PendingByte / ((*Pager)(unsafe.Pointer(pPager)).FpageSize)) + 1))) { goto __7 } - rc = Xsqlite3CorruptError(tls, 57209) + rc = Xsqlite3CorruptError(tls, 57654) goto pager_acquire_err __7: ; @@ -34610,7 +34666,7 @@ __14: } // The page getter for when memory-mapped I/O is enabled -func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57263:12: */ +func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57708:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -34630,7 +34686,7 @@ func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags // test in the previous statement, and avoid testing pgno==0 in the // common case where pgno is large. if (pgno <= Pgno(1)) && (pgno == Pgno(0)) { - return Xsqlite3CorruptError(tls, 57288) + return Xsqlite3CorruptError(tls, 57733) } if (bMmapOk != 0) && ((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) { @@ -34668,7 +34724,7 @@ func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags } // The page getter method for when the pager is an error state -func getPageError(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57332:12: */ +func getPageError(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57777:12: */ _ = pgno _ = flags @@ -34677,7 +34733,7 @@ func getPageError(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flag } // Dispatch all page fetch requests to the appropriate getter method. -func Xsqlite3PagerGet(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57348:20: */ +func Xsqlite3PagerGet(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57793:20: */ return (*(*func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32)(unsafe.Pointer((pPager + 272 /* &.xGet */))))(tls, pPager, pgno, ppPage, flags) } @@ -34690,7 +34746,7 @@ func Xsqlite3PagerGet(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, // 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 Xsqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno Pgno) uintptr { /* sqlite3.c:57368:23: */ +func Xsqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno Pgno) uintptr { /* sqlite3.c:57813:23: */ var pPage uintptr pPage = Xsqlite3PcacheFetch(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, 0) @@ -34711,7 +34767,7 @@ func Xsqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno Pgno) uintptr { /* // Use sqlite3PagerUnrefPageOne() to release page1. This latter routine // checks the total number of outstanding pages and if the number of // pages reaches zero it drops the database lock. -func Xsqlite3PagerUnrefNotNull(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57391:21: */ +func Xsqlite3PagerUnrefNotNull(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57836:21: */ if (int32((*DbPage)(unsafe.Pointer(pPg)).Fflags) & PGHDR_MMAP) != 0 { // Page1 is never memory mapped @@ -34723,13 +34779,13 @@ func Xsqlite3PagerUnrefNotNull(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57391: } -func Xsqlite3PagerUnref(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57403:21: */ +func Xsqlite3PagerUnref(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57848:21: */ if pPg != 0 { Xsqlite3PagerUnrefNotNull(tls, pPg) } } -func Xsqlite3PagerUnrefPageOne(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57406:21: */ +func Xsqlite3PagerUnrefPageOne(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57851:21: */ var pPager uintptr // Page1 is never memory mapped @@ -34758,7 +34814,7 @@ func Xsqlite3PagerUnrefPageOne(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57406: // 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 *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57438:12: */ +func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57883:12: */ var rc int32 = SQLITE_OK // Return code var pVfs uintptr = (*Pager)(unsafe.Pointer(pPager)).FpVfs // Local cache of vfs pointer @@ -34819,7 +34875,7 @@ func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5743 (*Pager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) } else { - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_CACHEMOD + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_CACHEMOD) } return rc @@ -34840,7 +34896,7 @@ func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5743 // 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 Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemory int32) int32 { /* sqlite3.c:57527:20: */ +func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemory int32) int32 { /* sqlite3.c:57972:20: */ var rc int32 = SQLITE_OK if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 { @@ -34887,7 +34943,7 @@ func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemor // transactions may copy data from the sub-journal into the database // file as well as into the page cache. Which would be incorrect in // WAL mode. - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_LOCKED + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_LOCKED) (*Pager)(unsafe.Pointer(pPager)).FdbHintSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize (*Pager)(unsafe.Pointer(pPager)).FdbFileSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize = (*Pager)(unsafe.Pointer(pPager)).FdbSize @@ -34900,7 +34956,7 @@ func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemor } // Write page pPg onto the end of the rollback journal. -func pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57596:28: */ +func pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58041:28: */ var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager var rc int32 var cksum U32 @@ -34952,7 +35008,7 @@ func pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) int32 { /* sqlite // 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 *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57653:12: */ +func pager_write(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58098:12: */ var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager var rc int32 = SQLITE_OK @@ -35026,7 +35082,7 @@ func pager_write(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57653:12: */ // 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 *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57745:28: */ +func pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58190:28: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -35114,7 +35170,7 @@ func pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:5774 // // If an error occurs, SQLITE_NOMEM or an IO error code is returned // as appropriate. Otherwise, SQLITE_OK. -func Xsqlite3PagerWrite(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57839:20: */ +func Xsqlite3PagerWrite(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:58284:20: */ var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager if ((int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags) & PGHDR_WRITEABLE) != 0) && ((*Pager)(unsafe.Pointer(pPager)).FdbSize >= (*PgHdr)(unsafe.Pointer(pPg)).Fpgno) { @@ -35155,7 +35211,7 @@ func Xsqlite3PagerWrite(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57839:2 // 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 Xsqlite3PagerDontWrite(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57888:21: */ +func Xsqlite3PagerDontWrite(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:58333:21: */ var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager if (!(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && ((int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags) & PGHDR_DIRTY) != 0)) && ((*Pager)(unsafe.Pointer(pPager)).FnSavepoint == 0) { @@ -35185,7 +35241,7 @@ func Xsqlite3PagerDontWrite(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57888:21: // 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 *libc.TLS, pPager uintptr, isDirectMode int32) int32 { /* sqlite3.c:57922:12: */ +func pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32) int32 { /* sqlite3.c:58367:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -35255,7 +35311,7 @@ func pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32) // // 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 Xsqlite3PagerSync(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:58005:20: */ +func Xsqlite3PagerSync(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:58450:20: */ var rc int32 = SQLITE_OK var pArg uintptr = zSuper rc = Xsqlite3OsFileControl(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, SQLITE_FCNTL_SYNC, pArg) @@ -35278,7 +35334,7 @@ func Xsqlite3PagerSync(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* // 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 Xsqlite3PagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58028:20: */ +func Xsqlite3PagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58473:20: */ var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode if rc == SQLITE_OK { @@ -35314,7 +35370,7 @@ func Xsqlite3PagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite // 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 Xsqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, noSync int32) int32 { /* sqlite3.c:58070:20: */ +func Xsqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, noSync int32) int32 { /* sqlite3.c:58515:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -35485,7 +35541,7 @@ commit_phase_one_exit: if !((rc == SQLITE_OK) && !((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0))) { goto __19 } - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_WRITER_FINISHED + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_WRITER_FINISHED) __19: ; return rc @@ -35504,7 +35560,7 @@ __19: // // If an error occurs, an IO error code is returned and the pager // moves into the error state. Otherwise, SQLITE_OK is returned. -func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58300:20: */ +func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58745:20: */ var rc int32 = SQLITE_OK // Return code // This routine should not be called if a prior error has occurred. @@ -35529,7 +35585,7 @@ func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlit ((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0)) && (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == PAGER_JOURNALMODE_PERSIST) { - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_READER + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_READER) return SQLITE_OK } @@ -35561,7 +35617,7 @@ func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlit // 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 Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58366:20: */ +func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58811:20: */ var rc int32 = SQLITE_OK // Return code // PagerRollback() is a no-op if called in READER or OPEN state. If @@ -35590,7 +35646,7 @@ func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5 // state to indicate that the contents of the cache may not be trusted. // Any active readers will get SQLITE_ABORT. (*Pager)(unsafe.Pointer(pPager)).FerrCode = SQLITE_ABORT - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_ERROR + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_ERROR) setGetterMethod(tls, pPager) return rc } @@ -35605,13 +35661,13 @@ func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5 // Return TRUE if the database file is opened read-only. Return FALSE // if the database is (in theory) writable. -func Xsqlite3PagerIsreadonly(tls *libc.TLS, pPager uintptr) U8 { /* sqlite3.c:58416:19: */ +func Xsqlite3PagerIsreadonly(tls *libc.TLS, pPager uintptr) U8 { /* sqlite3.c:58861:19: */ return (*Pager)(unsafe.Pointer(pPager)).FreadOnly } // Return the approximate number of bytes of memory currently // used by the pager and its associated cache. -func Xsqlite3PagerMemUsed(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58433:20: */ +func Xsqlite3PagerMemUsed(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58878:20: */ var perPageSize int32 = (int32(((uint64((*Pager)(unsafe.Pointer(pPager)).FpageSize + int32((*Pager)(unsafe.Pointer(pPager)).FnExtra))) + uint64(unsafe.Sizeof(PgHdr{}))) + (uint64(5) * uint64(unsafe.Sizeof(uintptr(0)))))) return (((perPageSize * Xsqlite3PcachePagecount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)) + @@ -35620,12 +35676,12 @@ func Xsqlite3PagerMemUsed(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58 } // Return the number of references to the specified page. -func Xsqlite3PagerPageRefcount(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:58444:20: */ +func Xsqlite3PagerPageRefcount(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:58889:20: */ return Xsqlite3PcachePageRefcount(tls, pPage) } // This routine is used for testing and analysis only. -func Xsqlite3PagerStats(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58452:20: */ +func Xsqlite3PagerStats(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58897:20: */ a1[0] = Xsqlite3PcacheRefCount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) a1[1] = Xsqlite3PcachePagecount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) a1[2] = Xsqlite3PcacheGetCachesize(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) @@ -35645,7 +35701,7 @@ func Xsqlite3PagerStats(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58 return uintptr(unsafe.Pointer(&a1)) } -var a1 [11]int32 /* sqlite3.c:58453:14: */ +var a1 [11]int32 /* sqlite3.c:58898:14: */ // Parameter eStat must be one of SQLITE_DBSTATUS_CACHE_HIT, _MISS, _WRITE, // or _WRITE+1. The SQLITE_DBSTATUS_CACHE_WRITE+1 case is a translation @@ -35656,7 +35712,7 @@ var a1 [11]int32 /* sqlite3.c:58453:14: */ // 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 Xsqlite3PagerCacheStat(tls *libc.TLS, pPager uintptr, eStat int32, reset int32, pnVal uintptr) { /* sqlite3.c:58480:21: */ +func Xsqlite3PagerCacheStat(tls *libc.TLS, pPager uintptr, eStat int32, reset int32, pnVal uintptr) { /* sqlite3.c:58925:21: */ eStat = eStat - (SQLITE_DBSTATUS_CACHE_HIT) *(*int32)(unsafe.Pointer(pnVal)) += (*(*int32)(unsafe.Pointer((pPager + 240 /* &.aStat */) + uintptr(eStat)*4))) @@ -35666,7 +35722,7 @@ func Xsqlite3PagerCacheStat(tls *libc.TLS, pPager uintptr, eStat int32, reset in } // Return true if this is an in-memory or temp-file backed pager. -func Xsqlite3PagerIsMemdb(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58503:20: */ +func Xsqlite3PagerIsMemdb(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58948:20: */ return int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) } @@ -35678,7 +35734,7 @@ func Xsqlite3PagerIsMemdb(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58 // 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 *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:58517:28: */ +func pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:58962:28: */ var rc int32 = SQLITE_OK // Return code var nCurrent int32 = (*Pager)(unsafe.Pointer(pPager)).FnSavepoint // Current number of savepoints var ii int32 // Iterator variable @@ -35692,24 +35748,25 @@ func pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { if !(aNew != 0) { return SQLITE_NOMEM } - libc.Xmemset(tls, (aNew + uintptr(nCurrent)*48), 0, ((uint64(nSavepoint - nCurrent)) * uint64(unsafe.Sizeof(PagerSavepoint{})))) + libc.Xmemset(tls, (aNew + uintptr(nCurrent)*56), 0, ((uint64(nSavepoint - nCurrent)) * uint64(unsafe.Sizeof(PagerSavepoint{})))) (*Pager)(unsafe.Pointer(pPager)).FaSavepoint = aNew // Populate the PagerSavepoint structures just allocated. for ii = nCurrent; ii < nSavepoint; ii++ { - (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48)).FnOrig = (*Pager)(unsafe.Pointer(pPager)).FdbSize + (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FnOrig = (*Pager)(unsafe.Pointer(pPager)).FdbSize if ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0)) && ((*Pager)(unsafe.Pointer(pPager)).FjournalOff > int64(0)) { - (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48)).FiOffset = (*Pager)(unsafe.Pointer(pPager)).FjournalOff + (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FiOffset = (*Pager)(unsafe.Pointer(pPager)).FjournalOff } else { - (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48)).FiOffset = I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) + (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FiOffset = I64((*Pager)(unsafe.Pointer(pPager)).FsectorSize) } - (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48)).FiSubRec = (*Pager)(unsafe.Pointer(pPager)).FnSubRec - (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*48)).FpInSavepoint = Xsqlite3BitvecCreate(tls, (*Pager)(unsafe.Pointer(pPager)).FdbSize) - if !(int32((*PagerSavepoint)(unsafe.Pointer(aNew+uintptr(ii)*48)).FpInSavepoint) != 0) { + (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FiSubRec = (*Pager)(unsafe.Pointer(pPager)).FnSubRec + (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FpInSavepoint = Xsqlite3BitvecCreate(tls, (*Pager)(unsafe.Pointer(pPager)).FdbSize) + (*PagerSavepoint)(unsafe.Pointer(aNew + uintptr(ii)*56)).FbTruncateOnRelease = 1 + if !(int32((*PagerSavepoint)(unsafe.Pointer(aNew+uintptr(ii)*56)).FpInSavepoint) != 0) { return SQLITE_NOMEM } if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) { - Xsqlite3WalSavepoint(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, aNew+uintptr(ii)*48+32 /* &.aWalData */) + Xsqlite3WalSavepoint(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, aNew+uintptr(ii)*56+36 /* &.aWalData */) } (*Pager)(unsafe.Pointer(pPager)).FnSavepoint = (ii + 1) } @@ -35717,7 +35774,7 @@ func pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { return rc } -func Xsqlite3PagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:58562:20: */ +func Xsqlite3PagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:59008:20: */ if (nSavepoint > (*Pager)(unsafe.Pointer(pPager)).FnSavepoint) && ((*Pager)(unsafe.Pointer(pPager)).FuseJournal != 0) { return pagerOpenSavepoint(tls, pPager, nSavepoint) @@ -35755,7 +35812,7 @@ func Xsqlite3PagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) // This function may return SQLITE_NOMEM if a memory allocation fails, // or an IO error code if an IO error occurs while rolling back a // savepoint. If no errors occur, SQLITE_OK is returned. -func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:58604:20: */ +func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:59050:20: */ var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode if (rc == SQLITE_OK) && (iSavepoint < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint) { @@ -35772,27 +35829,29 @@ func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint return 1 }())) for ii = nNew; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ { - Xsqlite3BitvecDestroy(tls, (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*48)).FpInSavepoint) + Xsqlite3BitvecDestroy(tls, (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*56)).FpInSavepoint) } (*Pager)(unsafe.Pointer(pPager)).FnSavepoint = nNew // If this is a release of the outermost savepoint, truncate // the sub-journal to zero bytes in size. if op == SAVEPOINT_RELEASE { - if (nNew == 0) && ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fsjfd))).FpMethods != uintptr(0)) { + var pRel uintptr = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr(nNew)*56) + if ((*PagerSavepoint)(unsafe.Pointer(pRel)).FbTruncateOnRelease != 0) && ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fsjfd))).FpMethods != uintptr(0)) { // Only truncate if it is an in-memory sub-journal. if Xsqlite3JournalIsInMemory(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd) != 0 { - rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd, int64(0)) + var sz I64 = (I64((Pgno((*Pager)(unsafe.Pointer(pPager)).FpageSize + 4)) * (*PagerSavepoint)(unsafe.Pointer(pRel)).FiSubRec)) + rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fsjfd, sz) } - (*Pager)(unsafe.Pointer(pPager)).FnSubRec = U32(0) + (*Pager)(unsafe.Pointer(pPager)).FnSubRec = (*PagerSavepoint)(unsafe.Pointer(pRel)).FiSubRec } } else if ((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) || ((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0)) { var pSavepoint uintptr if nNew == 0 { pSavepoint = uintptr(0) } else { - pSavepoint = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr((nNew-1))*48) + pSavepoint = ((*Pager)(unsafe.Pointer(pPager)).FaSavepoint + uintptr((nNew-1))*56) } rc = pagerPlaybackSavepoint(tls, pPager, pSavepoint) @@ -35814,30 +35873,30 @@ func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint // // The return value to this routine is always safe to use with // sqlite3_uri_parameter() and sqlite3_filename_database() and friends. -func Xsqlite3PagerFilename(tls *libc.TLS, pPager uintptr, nullIfMemDb int32) uintptr { /* sqlite3.c:58683:27: */ +func Xsqlite3PagerFilename(tls *libc.TLS, pPager uintptr, nullIfMemDb int32) uintptr { /* sqlite3.c:59131:27: */ if (nullIfMemDb != 0) && ((*Pager)(unsafe.Pointer(pPager)).FmemDb != 0) { return (uintptr(unsafe.Pointer(&zFake)) + 4) } return (*Pager)(unsafe.Pointer(pPager)).FzFilename } -var zFake = [8]int8{int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:58684:21 */ +var zFake = [8]int8{int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:59132:21 */ // Return the VFS structure for the pager. -func Xsqlite3PagerVfs(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58691:28: */ +func Xsqlite3PagerVfs(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59139:28: */ return (*Pager)(unsafe.Pointer(pPager)).FpVfs } // 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 Xsqlite3PagerFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58700:29: */ +func Xsqlite3PagerFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59148:29: */ return (*Pager)(unsafe.Pointer(pPager)).Ffd } // Return the file handle for the journal file (if it exists). // This will be either the rollback journal or the WAL file. -func Xsqlite3PagerJrnlFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58708:29: */ +func Xsqlite3PagerJrnlFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59156:29: */ if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 { return Xsqlite3WalFile(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) } @@ -35845,7 +35904,7 @@ func Xsqlite3PagerJrnlFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c } // Return the full pathname of the journal file. -func Xsqlite3PagerJournalname(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58719:27: */ +func Xsqlite3PagerJournalname(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59167:27: */ return (*Pager)(unsafe.Pointer(pPager)).FzJournal } @@ -35872,7 +35931,7 @@ func Xsqlite3PagerJournalname(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite // // This function may return SQLITE_NOMEM or an IO error code if an error // occurs. Otherwise, it returns SQLITE_OK. -func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno, isCommit int32) int32 { /* sqlite3.c:58749:20: */ +func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno, isCommit int32) int32 { /* sqlite3.c:59197:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -35934,7 +35993,7 @@ func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno if pPgOld != 0 { if int32((*PgHdr)(unsafe.Pointer(pPgOld)).FnRef) > 1 { Xsqlite3PagerUnrefNotNull(tls, pPgOld) - return Xsqlite3CorruptError(tls, 58823) + return Xsqlite3CorruptError(tls, 59271) } *(*U16)(unsafe.Pointer(pPg + 52 /* &.flags */)) |= U16((int32((*PgHdr)(unsafe.Pointer(pPgOld)).Fflags) & PGHDR_NEED_SYNC)) if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 { @@ -35994,21 +36053,21 @@ func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno // 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 Xsqlite3PagerRekey(tls *libc.TLS, pPg uintptr, iNew Pgno, flags U16) { /* sqlite3.c:58887:21: */ +func Xsqlite3PagerRekey(tls *libc.TLS, pPg uintptr, iNew Pgno, flags U16) { /* sqlite3.c:59335:21: */ (*DbPage)(unsafe.Pointer(pPg)).Fflags = flags Xsqlite3PcacheMove(tls, pPg, iNew) } // Return a pointer to the data for the specified page. -func Xsqlite3PagerGetData(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:58896:21: */ +func Xsqlite3PagerGetData(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:59344:21: */ return (*DbPage)(unsafe.Pointer(pPg)).FpData } // Return a pointer to the Pager.nExtra bytes of "extra" space // allocated along with the specified page. -func Xsqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:58905:21: */ +func Xsqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:59353:21: */ return (*DbPage)(unsafe.Pointer(pPg)).FpExtra } @@ -36020,7 +36079,7 @@ func Xsqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:58 // The returned value is either PAGER_LOCKINGMODE_NORMAL or // PAGER_LOCKINGMODE_EXCLUSIVE, indicating the current (possibly updated) // locking-mode. -func Xsqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:58919:20: */ +func Xsqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:59367:20: */ if ((eMode >= 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0)) && !(Xsqlite3WalHeapMemory(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) != 0) { (*Pager)(unsafe.Pointer(pPager)).FexclusiveMode = U8(eMode) @@ -36046,7 +36105,7 @@ func Xsqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 // * Temporary databases cannot have _WAL journalmode. // // The returned indicate the current (possibly updated) journal-mode. -func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:58952:20: */ +func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:59400:20: */ var eOld U8 = (*Pager)(unsafe.Pointer(pPager)).FjournalMode // Prior journalmode // The eMode parameter is always valid @@ -36117,14 +36176,14 @@ func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int } // Return the current journal mode. -func Xsqlite3PagerGetJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59043:20: */ +func Xsqlite3PagerGetJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59491:20: */ return int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) } // 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 Xsqlite3PagerOkToChangeJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59052:20: */ +func Xsqlite3PagerOkToChangeJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59500:20: */ if int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= PAGER_WRITER_CACHEMOD { return 0 @@ -36139,7 +36198,7 @@ func Xsqlite3PagerOkToChangeJournalMode(tls *libc.TLS, pPager uintptr) int32 { / // // 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 Xsqlite3PagerJournalSizeLimit(tls *libc.TLS, pPager uintptr, iLimit I64) I64 { /* sqlite3.c:59065:20: */ +func Xsqlite3PagerJournalSizeLimit(tls *libc.TLS, pPager uintptr, iLimit I64) I64 { /* sqlite3.c:59513:20: */ if iLimit >= int64(-1) { (*Pager)(unsafe.Pointer(pPager)).FjournalSizeLimit = iLimit Xsqlite3WalLimit(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, iLimit) @@ -36151,12 +36210,12 @@ func Xsqlite3PagerJournalSizeLimit(tls *libc.TLS, pPager uintptr, iLimit I64) I6 // in backup.c maintains the content of this variable. This module // uses it opaquely as an argument to sqlite3BackupRestart() and // sqlite3BackupUpdate() only. -func Xsqlite3PagerBackupPtr(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59079:31: */ +func Xsqlite3PagerBackupPtr(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59527:31: */ return (pPager + 112 /* &.pBackup */) } // Unless this is an in-memory or temporary database, clear the pager cache. -func Xsqlite3PagerClearCache(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:59087:21: */ +func Xsqlite3PagerClearCache(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:59535:21: */ if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 { pager_reset(tls, pPager) @@ -36168,7 +36227,7 @@ func Xsqlite3PagerClearCache(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:59087 // or wal_blocking_checkpoint() API functions. // // Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART. -func Xsqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:59102:20: */ +func Xsqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:59550:20: */ var rc int32 = SQLITE_OK if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 { rc = Xsqlite3WalCheckpoint(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, db, eMode, @@ -36185,13 +36244,13 @@ func Xsqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in return rc } -func Xsqlite3PagerWalCallback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59121:20: */ +func Xsqlite3PagerWalCallback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59569:20: */ return Xsqlite3WalCallback(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) } // Return true if the underlying VFS for the given pager supports the // primitives necessary for write-ahead logging. -func Xsqlite3PagerWalSupported(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59129:20: */ +func Xsqlite3PagerWalSupported(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59577:20: */ var pMethods uintptr = (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods if (*Pager)(unsafe.Pointer(pPager)).FnoLock != 0 { return 0 @@ -36201,7 +36260,7 @@ func Xsqlite3PagerWalSupported(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3 // Attempt to take an exclusive lock on the database file. If a PENDING lock // is obtained instead, immediately release it. -func pagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59139:12: */ +func pagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59587:12: */ var rc int32 // Return code rc = pagerLockDb(tls, pPager, EXCLUSIVE_LOCK) @@ -36218,7 +36277,7 @@ func pagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:5913 // 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 *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59159:12: */ +func pagerOpenWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59607:12: */ var rc int32 = SQLITE_OK // If the pager is already in exclusive-mode, the WAL module will use @@ -36254,7 +36313,7 @@ func pagerOpenWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59159:12: // 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 Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 { /* sqlite3.c:59204:20: */ +func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 { /* sqlite3.c:59652:20: */ var rc int32 = SQLITE_OK // Return code if !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FpWal) != 0) { @@ -36267,8 +36326,8 @@ func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 { rc = pagerOpenWal(tls, pPager) if rc == SQLITE_OK { - (*Pager)(unsafe.Pointer(pPager)).FjournalMode = PAGER_JOURNALMODE_WAL - (*Pager)(unsafe.Pointer(pPager)).FeState = PAGER_OPEN + (*Pager)(unsafe.Pointer(pPager)).FjournalMode = U8(PAGER_JOURNALMODE_WAL) + (*Pager)(unsafe.Pointer(pPager)).FeState = U8(PAGER_OPEN) } } else { *(*int32)(unsafe.Pointer(pbOpen)) = 1 @@ -36284,7 +36343,7 @@ func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 { // 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 Xsqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:59243:20: */ +func Xsqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:59691:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -36324,7 +36383,7 @@ func Xsqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* // If this is a WAL database, obtain a snapshot handle for the snapshot // currently open. Otherwise, return an error. -func Xsqlite3PagerSnapshotGet(tls *libc.TLS, pPager uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:59312:20: */ +func Xsqlite3PagerSnapshotGet(tls *libc.TLS, pPager uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:59760:20: */ var rc int32 = SQLITE_ERROR if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 { rc = Xsqlite3WalSnapshotGet(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, ppSnapshot) @@ -36335,7 +36394,7 @@ func Xsqlite3PagerSnapshotGet(tls *libc.TLS, pPager uintptr, ppSnapshot uintptr) // If this is a WAL database, store a pointer to pSnapshot. Next time a // read transaction is opened, attempt to read from the snapshot it // identifies. If this is not a WAL database, return an error. -func Xsqlite3PagerSnapshotOpen(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:59325:20: */ +func Xsqlite3PagerSnapshotOpen(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:59773:20: */ var rc int32 = SQLITE_OK if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 { Xsqlite3WalSnapshotOpen(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSnapshot) @@ -36347,7 +36406,7 @@ func Xsqlite3PagerSnapshotOpen(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) // If this is a WAL database, call sqlite3WalSnapshotRecover(). If this // is not a WAL database, return an error. -func Xsqlite3PagerSnapshotRecover(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59342:20: */ +func Xsqlite3PagerSnapshotRecover(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59790:20: */ var rc int32 if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 { rc = Xsqlite3WalSnapshotRecover(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) @@ -36367,7 +36426,7 @@ func Xsqlite3PagerSnapshotRecover(tls *libc.TLS, pPager uintptr) int32 { /* sqli // the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error // occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER // lock is released before returning. -func Xsqlite3PagerSnapshotCheck(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:59364:20: */ +func Xsqlite3PagerSnapshotCheck(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:59812:20: */ var rc int32 if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 { rc = Xsqlite3WalSnapshotCheck(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSnapshot) @@ -36379,7 +36438,7 @@ func Xsqlite3PagerSnapshotCheck(tls *libc.TLS, pPager uintptr, pSnapshot uintptr // Release a lock obtained by an earlier successful call to // sqlite3PagerSnapshotCheck(). -func Xsqlite3PagerSnapshotUnlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:59378:21: */ +func Xsqlite3PagerSnapshotUnlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:59826:21: */ Xsqlite3WalSnapshotUnlock(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) } @@ -36673,7 +36732,7 @@ type WalIndexHdr1 = struct { FaFrameCksum [2]U32 FaSalt [2]U32 FaCksum [2]U32 -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ //************* End of pager.c ********************************************** //************* Begin file wal.c ******************************************** @@ -36952,7 +37011,7 @@ type WalIndexHdr1 = struct { // byte. // Object declarations -type WalIndexHdr = WalIndexHdr1 /* sqlite3.c:59703:28 */ +type WalIndexHdr = WalIndexHdr1 /* sqlite3.c:60151:28 */ type WalIterator1 = struct { FiPrior U32 FnSegment int32 @@ -36964,18 +37023,18 @@ type WalIterator1 = struct { FnEntry int32 FiZero int32 } -} /* sqlite3.c:59704:9 */ +} /* sqlite3.c:60152:9 */ -type WalIterator = WalIterator1 /* sqlite3.c:59704:28 */ +type WalIterator = WalIterator1 /* sqlite3.c:60152:28 */ type WalCkptInfo1 = struct { FnBackfill U32 FaReadMark [5]U32 FaLock [8]U8 FnBackfillAttempted U32 FnotUsed0 U32 -} /* sqlite3.c:59705:9 */ +} /* sqlite3.c:60153:9 */ -type WalCkptInfo = WalCkptInfo1 /* sqlite3.c:59705:28 */ +type WalCkptInfo = WalCkptInfo1 /* sqlite3.c:60153:28 */ // Candidate values for Wal.exclusiveMode. @@ -36983,7 +37042,7 @@ type WalCkptInfo = WalCkptInfo1 /* sqlite3.c:59705:28 */ // Each page of the wal-index mapping contains a hash-table made up of // an array of HASHTABLE_NSLOT elements of the following type. -type Ht_slot = U16 /* sqlite3.c:59896:13 */ +type Ht_slot = U16 /* sqlite3.c:60344:13 */ // This structure is used to implement an iterator that loops through // all frames in the WAL in database page order. Where two or more frames @@ -37005,7 +37064,7 @@ type WalSegment = struct { FaPgno uintptr FnEntry int32 FiZero int32 -} /* sqlite3.c:59704:9 */ +} /* sqlite3.c:60152:9 */ // Define the parameters of the hash tables in the wal-index file. There // is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -37032,7 +37091,7 @@ type WalSegment = struct { // 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 walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:59963:28: */ +func walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:60411:28: */ var rc int32 = SQLITE_OK // Enlarge the pWal->apWiData[] array if required @@ -37053,12 +37112,12 @@ func walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintpt // Request a pointer to the required page from the VFS if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE { - *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = Xsqlite3MallocZero(tls, ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))) + *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = Xsqlite3MallocZero(tls, ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))) if !(int32(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8))) != 0) { rc = SQLITE_NOMEM } } else { - rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, iPage, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))), + rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, iPage, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))), int32((*Wal)(unsafe.Pointer(pWal)).FwriteLock), ((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) if rc == SQLITE_OK { @@ -37078,7 +37137,7 @@ func walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintpt return rc } -func walIndexPage(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:60010:12: */ +func walIndexPage(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:60458:12: */ if ((*Wal)(unsafe.Pointer(pWal)).FnWiData <= iPage) || ((libc.AssignPtrUintptr(libc.AtomicLoadUintptr(&ppPage), *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)))) == uintptr(0)) { return walIndexPageRealloc(tls, pWal, iPage, libc.AtomicLoadUintptr(&ppPage)) } @@ -37086,13 +37145,13 @@ func walIndexPage(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int3 } // Return a pointer to the WalCkptInfo structure in the wal-index. -func walCkptInfo(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60024:29: */ +func walCkptInfo(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60472:29: */ return (*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) + 24*4) } // Return a pointer to the WalIndexHdr structure in the wal-index. -func walIndexHdr(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60032:29: */ +func walIndexHdr(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60480:29: */ return *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) } @@ -37110,7 +37169,7 @@ func walIndexHdr(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60032:29: * // The checksum is written back into aOut[] before returning. // // nByte must be a positive multiple of 8. -func walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, aIn uintptr, aOut uintptr) { /* sqlite3.c:60058:13: */ +func walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, aIn uintptr, aOut uintptr) { /* sqlite3.c:60506:13: */ var s1 U32 var s2 U32 var aData uintptr = a @@ -37142,7 +37201,7 @@ func walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, // If there is the possibility of concurrent access to the SHM file // from multiple threads and/or processes, then do a memory barrier. -func walShmBarrier(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60101:13: */ +func walShmBarrier(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60549:13: */ if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) != WAL_HEAPMEMORY_MODE { Xsqlite3OsShmBarrier(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd) } @@ -37157,12 +37216,12 @@ func walShmBarrier(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60101:13: */ // 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 *libc.TLS, pWal uintptr) { /* sqlite3.c:60125:28: */ +func walIndexWriteHdr(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60573:28: */ var aHdr uintptr = walIndexHdr(tls, pWal) var nCksum int32 = int32((uintptr(0) + 40 /* &.aCksum */)) (*Wal)(unsafe.Pointer(pWal)).Fhdr.FisInit = U8(1) - (*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion = WALINDEX_MAX_VERSION + (*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion = U32(WALINDEX_MAX_VERSION) walChecksumBytes(tls, 1, (pWal + 72 /* &.hdr */), nCksum, uintptr(0), pWal+72 /* &.hdr */ +40 /* &.aCksum */) // Possible TSAN false-positive. See tag-20200519-1 libc.Xmemcpy(tls, (libc.AtomicLoadUintptr(&aHdr) + 1*48), (pWal + 72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{}))) @@ -37181,7 +37240,7 @@ func walIndexWriteHdr(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60125:28: */ // 12: Salt-2 (copied from the wal-header) // 16: Checksum-1. // 20: Checksum-2. -func walEncodeFrame(tls *libc.TLS, pWal uintptr, iPage U32, nTruncate U32, aData uintptr, aFrame uintptr) { /* sqlite3.c:60152:13: */ +func walEncodeFrame(tls *libc.TLS, pWal uintptr, iPage U32, nTruncate U32, aData uintptr, aFrame uintptr) { /* sqlite3.c:60600:13: */ var nativeCksum int32 // True for native byte-order checksums var aCksum uintptr = pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */ @@ -37204,7 +37263,7 @@ func walEncodeFrame(tls *libc.TLS, pWal uintptr, iPage U32, nTruncate U32, aData // 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 *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uintptr, aData uintptr, aFrame uintptr) int32 { /* sqlite3.c:60183:12: */ +func walDecodeFrame(tls *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uintptr, aData uintptr, aFrame uintptr) int32 { /* sqlite3.c:60631:12: */ var nativeCksum int32 // True for native byte-order checksums var aCksum uintptr = pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */ var pgno U32 // Page number of the frame @@ -37246,7 +37305,7 @@ func walDecodeFrame(tls *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uint // through the unlocked state first. // // In locking_mode=EXCLUSIVE, all of these routines become no-ops. -func walLockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) int32 { /* sqlite3.c:60262:12: */ +func walLockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) int32 { /* sqlite3.c:60710:12: */ var rc int32 if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 { return SQLITE_OK @@ -37257,7 +37316,7 @@ func walLockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) int32 { /* sqlite return rc } -func walUnlockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) { /* sqlite3.c:60272:13: */ +func walUnlockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) { /* sqlite3.c:60720:13: */ if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 { return } @@ -37266,7 +37325,7 @@ func walUnlockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) { /* sqlite3.c: } -func walLockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:60278:12: */ +func walLockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:60726:12: */ var rc int32 if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 { return SQLITE_OK @@ -37277,7 +37336,7 @@ func walLockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) int32 return rc } -func walUnlockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) { /* sqlite3.c:60288:13: */ +func walUnlockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) { /* sqlite3.c:60736:13: */ if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 { return } @@ -37289,12 +37348,12 @@ func walUnlockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) { / // 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 *libc.TLS, iPage U32) int32 { /* sqlite3.c:60301:12: */ +func walHash(tls *libc.TLS, iPage U32) int32 { /* sqlite3.c:60749:12: */ - return (int32((iPage * HASHTABLE_HASH_1) & (U32((HASHTABLE_NPAGE * 2) - 1)))) + return (int32((iPage * U32(HASHTABLE_HASH_1)) & (U32((HASHTABLE_NPAGE * 2) - 1)))) } -func walNextHash(tls *libc.TLS, iPriorHash int32) int32 { /* sqlite3.c:60306:12: */ +func walNextHash(tls *libc.TLS, iPriorHash int32) int32 { /* sqlite3.c:60754:12: */ return ((iPriorHash + 1) & ((HASHTABLE_NPAGE * 2) - 1)) } @@ -37306,12 +37365,12 @@ type WalHashLoc1 = struct { FaPgno uintptr FiZero U32 _ [4]byte -} /* sqlite3.c:60315:9 */ +} /* sqlite3.c:60763:9 */ // An instance of the WalHashLoc object is used to describe the location // of a page hash table in the wal-index. This becomes the return value // from walHashGet(). -type WalHashLoc = WalHashLoc1 /* sqlite3.c:60315:27 */ +type WalHashLoc = WalHashLoc1 /* sqlite3.c:60763:27 */ // 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 @@ -37325,7 +37384,7 @@ type WalHashLoc = WalHashLoc1 /* sqlite3.c:60315:27 */ // // Finally, set pLoc->aPgno so that pLoc->aPgno[1] is the page number of the // first frame indexed by the hash table, frame (pLoc->iZero+1). -func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { /* sqlite3.c:60336:12: */ +func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { /* sqlite3.c:60784:12: */ var rc int32 // Return code rc = walIndexPage(tls, pWal, iHash, (pLoc + 8 /* &.aPgno */)) @@ -37336,7 +37395,7 @@ func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = ((*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + 34*4) (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = U32(0) } else { - (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = (U32((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iHash - 1) * HASHTABLE_NPAGE)))) + (*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = (U32((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iHash - 1) * HASHTABLE_NPAGE)))) } (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = ((*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + libc.UintptrFromInt32(-1)*4) } @@ -37347,19 +37406,19 @@ func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { // 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 *libc.TLS, iFrame U32) int32 { /* sqlite3.c:60365:12: */ - var iHash int32 = (int32((((uint64(iFrame + HASHTABLE_NPAGE)) - (HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0)))))) - uint64(1)) / HASHTABLE_NPAGE)) +func walFramePage(tls *libc.TLS, iFrame U32) int32 { /* sqlite3.c:60813:12: */ + var iHash int32 = (int32((((uint64(iFrame + U32(HASHTABLE_NPAGE))) - (uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0)))))) - uint64(1)) / uint64(HASHTABLE_NPAGE))) return iHash } // Return the page number associated with frame iFrame in this WAL. -func walFramePgno(tls *libc.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:60380:12: */ +func walFramePgno(tls *libc.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:60828:12: */ var iHash int32 = walFramePage(tls, iFrame) if iHash == 0 { return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData)) + uintptr((((((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2))+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))))+uint64(iFrame))-uint64(1)))*4)) } - return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iHash)*8)) + uintptr((((uint64(iFrame-U32(1)))-(HASHTABLE_NPAGE-(((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2))+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))))))%HASHTABLE_NPAGE))*4)) + return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iHash)*8)) + uintptr((((uint64(iFrame-U32(1)))-(uint64(HASHTABLE_NPAGE)-(((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2))+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))))))%uint64(HASHTABLE_NPAGE)))*4)) } // Remove entries from the hash table that point to WAL slots greater @@ -37372,7 +37431,7 @@ func walFramePgno(tls *libc.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:60 // 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 *libc.TLS, pWal uintptr) { /* sqlite3.c:60400:13: */ +func walCleanupHash(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60848:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -37415,7 +37474,7 @@ func walCleanupHash(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60400:13: */ // Set an entry in the wal-index that will map database page number // pPage into WAL frame iFrame. -func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { /* sqlite3.c:60462:12: */ +func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { /* sqlite3.c:60910:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -37456,7 +37515,7 @@ func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { nCollide = idx for iKey = walHash(tls, iPage); *(*Ht_slot)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash + uintptr(iKey)*2)) != 0; iKey = walNextHash(tls, iKey) { if (libc.PostDecInt32(&nCollide, 1)) == 0 { - return Xsqlite3CorruptError(tls, 60502) + return Xsqlite3CorruptError(tls, 60950) } } *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr(idx)*4)) = iPage @@ -37475,7 +37534,7 @@ func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { // 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 *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:60552:12: */ +func walIndexRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:61000:12: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -37538,7 +37597,7 @@ __1: __2: ; - if !(*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) > WAL_HDRSIZE) { + if !(*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) > int64(WAL_HDRSIZE)) { goto __3 } // Buffer to load WAL header into aPrivate = uintptr(0) // Heap copy of *-shm hash being populated @@ -37559,7 +37618,7 @@ __4: // WAL file. magic = Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */)) szPage = int32(Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */ + 8))) - if !(((((magic & 0xFFFFFFFE) != WAL_MAGIC) || + if !(((((magic & 0xFFFFFFFE) != U32(WAL_MAGIC)) || ((szPage & (szPage - 1)) != 0)) || (szPage > SQLITE_MAX_PAGE_SIZE)) || (szPage < 512)) { @@ -37587,17 +37646,17 @@ __6: // Verify that the version number on the WAL format is one that // are able to understand version = Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */ + 4)) - if !(version != WAL_MAX_VERSION) { + if !(version != U32(WAL_MAX_VERSION)) { goto __7 } - rc = Xsqlite3CantopenError(tls, 60635) + rc = Xsqlite3CantopenError(tls, 61083) goto finished __7: ; // Malloc a buffer to read frames into. szFrame = (szPage + WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, (uint64(uint64(szFrame) + ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))))) + aFrame = Xsqlite3_malloc64(tls, (uint64(uint64(szFrame) + ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))))) if !(!(aFrame != 0)) { goto __8 } @@ -37609,23 +37668,23 @@ __8: aPrivate = (aData + uintptr(szPage)) // Read all frames from the log file. - iLastFrame = (U32((*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) - WAL_HDRSIZE) / I64(szFrame))) + iLastFrame = (U32((*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) - int64(WAL_HDRSIZE)) / I64(szFrame))) iPg = U32(0) __9: if !(iPg <= U32(walFramePage(tls, iLastFrame))) { goto __11 } // Index of last frame read iLast = func() uint32 { - if (uint64(iLastFrame)) < ((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * HASHTABLE_NPAGE))) { + if (uint64(iLastFrame)) < ((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * U32(HASHTABLE_NPAGE)))) { return iLastFrame } - return (uint32((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * HASHTABLE_NPAGE)))) + return (uint32((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * U32(HASHTABLE_NPAGE))))) }() iFirst = (U32(uint64(1) + (func() uint64 { if iPg == U32(0) { return uint64(0) } - return ((HASHTABLE_NPAGE - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iPg - U32(1)) * HASHTABLE_NPAGE))) + return ((uint64(HASHTABLE_NPAGE) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iPg - U32(1)) * U32(HASHTABLE_NPAGE)))) }()))) rc = walIndexPage(tls, pWal, int32(iPg), bp+56 /* &aShare */) if !(rc != 0) { @@ -37641,7 +37700,7 @@ __13: if !(iFrame <= iLast) { goto __15 } - iOffset = (WAL_HDRSIZE + ((I64((iFrame) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) // dbsize field from frame header + iOffset = (int64(WAL_HDRSIZE) + ((I64((iFrame) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) // dbsize field from frame header // Read and decode the next log frame. rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aFrame, szFrame, iOffset) @@ -37700,7 +37759,7 @@ __15: // do that, according to the spec, but no memcpy() implementation that // we know of actually does that, which is why we say that memcpy() // is safe for this. Memcpy() is certainly a lot faster. - libc.Xmemcpy(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */)) + uintptr(nHdr32)*4), (aPrivate + uintptr(nHdr32)*4), (((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0))))) - uint64(nHdr))) + libc.Xmemcpy(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */)) + uintptr(nHdr32)*4), (aPrivate + uintptr(nHdr32)*4), (((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0))))) - uint64(nHdr))) if !(iFrame <= iLast) { goto __20 } @@ -37779,7 +37838,7 @@ __24: goto __30 } Xsqlite3_log(tls, (SQLITE_NOTICE | (int32(1) << 8)), - ts+5623, /* "recovered %d fra..." */ + ts+5699, /* "recovered %d fra..." */ libc.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame, (*Wal)(unsafe.Pointer(pWal)).FzWalName)) __30: ; @@ -37793,7 +37852,7 @@ recovery_error: } // Close an open wal-index. -func walIndexClose(tls *libc.TLS, pWal uintptr, isDelete int32) { /* sqlite3.c:60774:13: */ +func walIndexClose(tls *libc.TLS, pWal uintptr, isDelete int32) { /* sqlite3.c:61222:13: */ if (int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE) || ((*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0) { var i int32 for i = 0; i < (*Wal)(unsafe.Pointer(pWal)).FnWiData; i++ { @@ -37819,7 +37878,7 @@ func walIndexClose(tls *libc.TLS, pWal uintptr, isDelete int32) { /* sqlite3.c:6 // 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 Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintptr, bNoShm int32, mxWalSize I64, ppWal uintptr) int32 { /* sqlite3.c:60802:20: */ +func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintptr, bNoShm int32, mxWalSize I64, ppWal uintptr) int32 { /* sqlite3.c:61250:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -37851,16 +37910,16 @@ func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt (*Wal)(unsafe.Pointer(pRet)).FpadToSectorBoundary = U8(1) (*Wal)(unsafe.Pointer(pRet)).FexclusiveMode = func() uint8 { if bNoShm != 0 { - return WAL_HEAPMEMORY_MODE + return uint8(WAL_HEAPMEMORY_MODE) } - return WAL_NORMAL_MODE + return uint8(WAL_NORMAL_MODE) }() // Open file handle on the write-ahead log file. *(*int32)(unsafe.Pointer(bp /* flags */)) = ((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_WAL) rc = Xsqlite3OsOpen(tls, pVfs, zWalName, (*Wal)(unsafe.Pointer(pRet)).FpWalFd, *(*int32)(unsafe.Pointer(bp /* flags */)), bp /* &flags */) if (rc == SQLITE_OK) && ((*(*int32)(unsafe.Pointer(bp /* flags */)) & SQLITE_OPEN_READONLY) != 0) { - (*Wal)(unsafe.Pointer(pRet)).FreadOnly = WAL_RDONLY + (*Wal)(unsafe.Pointer(pRet)).FreadOnly = U8(WAL_RDONLY) } if rc != SQLITE_OK { @@ -37882,7 +37941,7 @@ func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt } // Change the size to which the WAL file is trucated on each reset. -func Xsqlite3WalLimit(tls *libc.TLS, pWal uintptr, iLimit I64) { /* sqlite3.c:60876:21: */ +func Xsqlite3WalLimit(tls *libc.TLS, pWal uintptr, iLimit I64) { /* sqlite3.c:61324:21: */ if pWal != 0 { (*Wal)(unsafe.Pointer(pWal)).FmxWalSize = iLimit } @@ -37896,7 +37955,7 @@ func Xsqlite3WalLimit(tls *libc.TLS, pWal uintptr, iLimit I64) { /* sqlite3.c:60 // // 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 *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr) int32 { /* sqlite3.c:60890:12: */ +func walIteratorNext(tls *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr) int32 { /* sqlite3.c:61338:12: */ var iMin U32 // Result pgno must be greater than iMin var iRet U32 = 0xFFFFFFFF // 0xffffffff is never a valid page number var i int32 // For looping through segments @@ -37943,7 +38002,7 @@ func walIteratorNext(tls *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr) // aLeft[X]!=aRight[Y] && aContent[aLeft[X]] == aContent[aRight[Y]] // // When that happens, omit the aLeft[X] and use the aRight[Y] index. -func walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRight uintptr, pnRight uintptr, aTmp uintptr) { /* sqlite3.c:60943:13: */ +func walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRight uintptr, pnRight uintptr, aTmp uintptr) { /* sqlite3.c:61391:13: */ var iLeft int32 = 0 // Current index in aLeft var iRight int32 = 0 // Current index in aRight var iOut int32 = 0 // Current index in output buffer @@ -37989,7 +38048,7 @@ func walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRig // // Keep the larger of the two values aList[X] and aList[Y] and discard // the smaller. -func walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintptr, pnList uintptr) { /* sqlite3.c:61000:13: */ +func walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintptr, pnList uintptr) { /* sqlite3.c:61448:13: */ bp := tls.Alloc(220) defer tls.Free(220) @@ -38035,10 +38094,10 @@ type Sublist = struct { FnList int32 _ [4]byte FaList uintptr -} /* sqlite3.c:61006:3 */ +} /* sqlite3.c:61454:3 */ // Free an iterator allocated by walIteratorInit(). -func walIteratorFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:61063:13: */ +func walIteratorFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:61511:13: */ Xsqlite3_free(tls, p) } @@ -38053,7 +38112,7 @@ func walIteratorFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:61063:13: */ // // The calling routine should invoke walIteratorFree() to destroy the // WalIterator object when it has finished with it. -func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int32 { /* sqlite3.c:61080:12: */ +func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int32 { /* sqlite3.c:61528:12: */ bp := tls.Alloc(28) defer tls.Free(28) @@ -38086,8 +38145,8 @@ func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int // of memory will be freed before this function returns. aTmp = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(Ht_slot(0))) * (func() uint64 { - if iLast > HASHTABLE_NPAGE { - return HASHTABLE_NPAGE + if iLast > U32(HASHTABLE_NPAGE) { + return uint64(HASHTABLE_NPAGE) } return uint64(iLast) }())))) @@ -38138,7 +38197,7 @@ func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int // 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 *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:61244:12: */ +func walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:61692:12: */ var rc int32 for ok := true; ok; ok = (((xBusy != 0) && (rc == SQLITE_BUSY)) && ((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&xBusy)))(tls, pBusyArg) != 0)) { rc = walLockExclusive(tls, pWal, lockIdx, n) @@ -38148,7 +38207,7 @@ func walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, l // 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 *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:61268:12: */ +func walPagesize(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:61716:12: */ return ((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) & 0xfe00) + ((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) & 0x0001) << 16)) } @@ -38167,7 +38226,7 @@ func walPagesize(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:61268:12: */ // 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 *libc.TLS, pWal uintptr, salt1 U32) { /* sqlite3.c:61289:13: */ +func walRestartHdr(tls *libc.TLS, pWal uintptr, salt1 U32) { /* sqlite3.c:61737:13: */ bp := tls.Alloc(4) defer tls.Free(4) *(*U32)(unsafe.Pointer(bp)) = salt1 @@ -38218,7 +38277,7 @@ func walRestartHdr(tls *libc.TLS, pWal uintptr, salt1 U32) { /* sqlite3.c:61289: // 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 *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) int32 { /* sqlite3.c:61336:12: */ +func walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) int32 { /* sqlite3.c:61784:12: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -38349,7 +38408,7 @@ __10: // database plus the amount of data in the wal file, plus the // maximum size of the pending-byte page (65536 bytes), then // must be corruption somewhere. - rc = Xsqlite3CorruptError(tls, 61420) + rc = Xsqlite3CorruptError(tls, 61868) goto __15 __14: Xsqlite3OsFileControlHint(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_FCNTL_SIZE_HINT, bp+16 /* &nReq */) @@ -38367,7 +38426,7 @@ __16: goto __17 } - if !(libc.AtomicLoadNInt32((db+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { + if !(libc.AtomicLoadNInt32((db+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { goto __18 } if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -38384,7 +38443,7 @@ __18: goto __16 __19: ; - iOffset = ((WAL_HDRSIZE + ((I64((*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + iOffset = ((int64(WAL_HDRSIZE) + ((I64((*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) // testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL file rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, zBuf, szPage, iOffset) if !(rc != SQLITE_OK) { @@ -38510,7 +38569,7 @@ walcheckpoint_out: // 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 *libc.TLS, pWal uintptr, nMax I64) { /* sqlite3.c:61522:13: */ +func walLimitSize(tls *libc.TLS, pWal uintptr, nMax I64) { /* sqlite3.c:61970:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -38524,12 +38583,12 @@ func walLimitSize(tls *libc.TLS, pWal uintptr, nMax I64) { /* sqlite3.c:61522:13 } Xsqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, ts+5660 /* "cannot limit WAL..." */, libc.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, ts+5736 /* "cannot limit WAL..." */, libc.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).FzWalName)) } } // Close a connection to a log file. -func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:61539:20: */ +func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:61987:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -38547,7 +38606,7 @@ func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, if (zBuf != uintptr(0)) && (SQLITE_OK == (libc.AssignInt32(&rc, Xsqlite3OsLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, SQLITE_LOCK_EXCLUSIVE)))) { if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE { - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_EXCLUSIVE_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE) } rc = Xsqlite3WalCheckpoint(tls, pWal, db, SQLITE_CHECKPOINT_PASSIVE, uintptr(0), uintptr(0), sync_flags, nBuf, zBuf, uintptr(0), uintptr(0)) @@ -38601,7 +38660,7 @@ func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, // // If the checksum cannot be verified return non-zero. If the header // is read successfully and the checksum verified, return zero. -func walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:61620:27: */ +func walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62068:27: */ bp := tls.Alloc(104) defer tls.Free(104) @@ -38670,7 +38729,7 @@ func walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sq // // If the wal-index header is successfully read, return SQLITE_OK. // Otherwise an SQLite error code. -func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:61690:12: */ +func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62138:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -38694,7 +38753,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s // and there is no writer on hand to fix it. (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable = U8(1) - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_HEAPMEMORY_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_HEAPMEMORY_MODE) *(*int32)(unsafe.Pointer(pChanged)) = 1 } else { return rc // Any other non-OK return is just an error @@ -38749,8 +38808,8 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s // If the header is read successfully, check the version number to make // sure the wal-index was not constructed with some future format that // this version of SQLite cannot understand. - if (badHdr == 0) && ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != WALINDEX_MAX_VERSION) { - rc = Xsqlite3CantopenError(tls, 61769) + if (badHdr == 0) && ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != U32(WALINDEX_MAX_VERSION)) { + rc = Xsqlite3CantopenError(tls, 62217) } if (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -38764,7 +38823,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s rc = -1 } } - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_NORMAL_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_NORMAL_MODE) } return rc @@ -38795,7 +38854,7 @@ func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* s // beginning (including attempting to map the *-shm file). // // If an error occurs, an SQLite error code is returned. -func walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:61814:12: */ +func walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62262:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -38858,7 +38917,7 @@ __1: // even if some external agent does a "chmod" to make the shared-memory // writable by us, until sqlite3OsShmUnmap() has been called. // This is a requirement on the VFS implementation. - rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 0, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (HASHTABLE_NPAGE * uint64(unsafe.Sizeof(U32(0)))))), 0, bp /* &pDummy */) + rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 0, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(HASHTABLE_NPAGE * 2))) + (uint64(HASHTABLE_NPAGE) * uint64(unsafe.Sizeof(U32(0)))))), 0, bp /* &pDummy */) // SQLITE_OK not possible for read-only connection if !(rc != (SQLITE_READONLY | (int32(5) << 8))) { goto __3 @@ -38887,7 +38946,7 @@ __3: goto begin_unreliable_shm_out __4: ; - if !(*(*I64)(unsafe.Pointer(bp + 8 /* szWal */)) < WAL_HDRSIZE) { + if !(*(*I64)(unsafe.Pointer(bp + 8 /* szWal */)) < int64(WAL_HDRSIZE)) { goto __5 } // If the wal file is too small to contain a wal-header and the @@ -38944,7 +39003,7 @@ __8: // the caller. *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) *(*U32)(unsafe.Pointer(bp + 48 /* &aSaveCksum[0] */ + 1*4)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) - iOffset = (WAL_HDRSIZE + ((I64(((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame + U32(1)) - U32(1))) * (I64((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)) + WAL_FRAME_HDRSIZE)))) + iOffset = (int64(WAL_HDRSIZE) + ((I64(((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame + U32(1)) - U32(1))) * (I64((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)) + WAL_FRAME_HDRSIZE)))) __9: if !((iOffset + I64(szFrame)) <= *(*I64)(unsafe.Pointer(bp + 8 /* szWal */))) { goto __11 @@ -39060,7 +39119,7 @@ __15: // 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 *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32, cnt int32) int32 { /* sqlite3.c:62009:12: */ +func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32, cnt int32) int32 { /* sqlite3.c:62457:12: */ var pInfo uintptr // Checkpoint information in wal-index var mxReadMark U32 // Largest aReadMark[] value var mxI int32 // Index of largest aReadMark[] value @@ -39277,7 +39336,7 @@ func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32 // SQLITE_OK is returned if successful, or an SQLite error code if an // error occurs. It is not an error if nBackfillAttempted cannot be // decreased at all. -func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62239:20: */ +func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62687:20: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -39313,7 +39372,7 @@ func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3. iDbOff = ((I64(pgno - U32(1))) * I64(szPage)) if (iDbOff + I64(szPage)) <= *(*I64)(unsafe.Pointer(bp /* szDb */)) { - iWalOff = ((WAL_HDRSIZE + ((I64((i) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + iWalOff = ((int64(WAL_HDRSIZE) + ((I64((i) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pBuf1, szPage, iWalOff) if rc == SQLITE_OK { @@ -39350,7 +39409,7 @@ func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3. // transaction, then *pChanged is set to 1 before returning. The // Pager layer will use this to know that its cache is stale and // needs to be flushed. -func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62309:20: */ +func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62757:20: */ var rc int32 // Return code var cnt int32 = 0 // Number of TryBeginRead attempts var bChanged int32 = 0 @@ -39438,7 +39497,7 @@ func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // Finish with a read transaction. All this does is release the // read-lock. -func Xsqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:62417:21: */ +func Xsqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:62865:21: */ Xsqlite3WalEndWriteTransaction(tls, pWal) if int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { walUnlockShared(tls, pWal, (3 + (int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)))) @@ -39452,7 +39511,7 @@ func Xsqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:6 // // 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 Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr) int32 { /* sqlite3.c:62433:20: */ +func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr) int32 { /* sqlite3.c:62881:20: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -39519,7 +39578,7 @@ func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr iRead = iFrame } if (libc.PostDecInt32(&nCollide, 1)) == 0 { - return Xsqlite3CorruptError(tls, 62503) + return Xsqlite3CorruptError(tls, 62951) } iKey = walNextHash(tls, iKey) } @@ -39535,13 +39594,13 @@ func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr // 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 Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 { /* sqlite3.c:62537:20: */ +func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 { /* sqlite3.c:62985:20: */ var sz int32 var iOffset I64 sz = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) sz = ((sz & 0xfe00) + ((sz & 0x0001) << 16)) - iOffset = ((WAL_HDRSIZE + ((I64((iRead) - U32(1))) * (I64((sz) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + iOffset = ((int64(WAL_HDRSIZE) + ((I64((iRead) - U32(1))) * (I64((sz) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) // testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL return Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pOut, func() int32 { if nOut > sz { @@ -39552,7 +39611,7 @@ func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pO } // Return the size of the database in pages (or zero, if unknown). -func Xsqlite3WalDbsize(tls *libc.TLS, pWal uintptr) Pgno { /* sqlite3.c:62557:21: */ +func Xsqlite3WalDbsize(tls *libc.TLS, pWal uintptr) Pgno { /* sqlite3.c:63005:21: */ if (pWal != 0) && (int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) >= 0) { return (*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage } @@ -39570,7 +39629,7 @@ func Xsqlite3WalDbsize(tls *libc.TLS, pWal uintptr) Pgno { /* sqlite3.c:62557:21 // returns SQLITE_BUSY in that case and no write transaction is started. // // There can only be a single writer active at a time. -func Xsqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62578:20: */ +func Xsqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63026:20: */ var rc int32 // Cannot start a write transaction without first holding a read @@ -39602,7 +39661,7 @@ func Xsqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sq // End a write transaction. The commit has already been done. This // routine merely releases the lock. -func Xsqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62626:20: */ +func Xsqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63074:20: */ if (*Wal)(unsafe.Pointer(pWal)).FwriteLock != 0 { walUnlockExclusive(tls, pWal, WAL_WRITE_LOCK, 1) (*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(0) @@ -39622,7 +39681,7 @@ func Xsqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqli // // Otherwise, if the callback function does not return an error, this // function returns SQLITE_OK. -func Xsqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) int32 { /* sqlite3.c:62648:20: */ +func Xsqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) int32 { /* sqlite3.c:63096:20: */ var rc int32 = SQLITE_OK if (*Wal)(unsafe.Pointer(pWal)).FwriteLock != 0 { var iMax Pgno = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame @@ -39657,7 +39716,7 @@ func Xsqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt // 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 Xsqlite3WalSavepoint(tls *libc.TLS, pWal uintptr, aWalData uintptr) { /* sqlite3.c:62688:21: */ +func Xsqlite3WalSavepoint(tls *libc.TLS, pWal uintptr, aWalData uintptr) { /* sqlite3.c:63136:21: */ *(*U32)(unsafe.Pointer(aWalData)) = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame *(*U32)(unsafe.Pointer(aWalData + 1*4)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) @@ -39669,7 +39728,7 @@ func Xsqlite3WalSavepoint(tls *libc.TLS, pWal uintptr, aWalData uintptr) { /* sq // 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 Xsqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) int32 { /* sqlite3.c:62702:20: */ +func Xsqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) int32 { /* sqlite3.c:63150:20: */ var rc int32 = SQLITE_OK if *(*U32)(unsafe.Pointer(aWalData + 3*4)) != (*Wal)(unsafe.Pointer(pWal)).FnCkpt { @@ -39700,7 +39759,7 @@ func Xsqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) int // 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 *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62739:12: */ +func walRestartLog(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63187:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -39754,12 +39813,12 @@ type WalWriter1 = struct { FiSyncPoint Sqlite3_int64 FsyncFlags int32 FszPage int32 -} /* sqlite3.c:62786:9 */ +} /* sqlite3.c:63234:9 */ // Information about the current state of the WAL file and where // the next fsync should occur - passed from sqlite3WalFrames() into // walWriteToLog(). -type WalWriter = WalWriter1 /* sqlite3.c:62792:3 */ +type WalWriter = WalWriter1 /* sqlite3.c:63240:3 */ // Write iAmt bytes of content into the WAL file beginning at iOffset. // Do a sync when crossing the p->iSyncPoint boundary. @@ -39767,7 +39826,7 @@ type WalWriter = WalWriter1 /* sqlite3.c:62792:3 */ // 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 *libc.TLS, p uintptr, pContent uintptr, iAmt int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:62802:12: */ +func walWriteToLog(tls *libc.TLS, p uintptr, pContent uintptr, iAmt int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:63250:12: */ var rc int32 if (iOffset < (*WalWriter)(unsafe.Pointer(p)).FiSyncPoint) && ((iOffset + Sqlite3_int64(iAmt)) >= (*WalWriter)(unsafe.Pointer(p)).FiSyncPoint) { var iFirstAmt int32 = (int32((*WalWriter)(unsafe.Pointer(p)).FiSyncPoint - iOffset)) @@ -39789,7 +39848,7 @@ func walWriteToLog(tls *libc.TLS, p uintptr, pContent uintptr, iAmt int32, iOffs } // Write out a single frame of the WAL -func walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:62827:12: */ +func walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:63275:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -39814,7 +39873,7 @@ func walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32, // with the earliest to have been overwritten. // // SQLITE_OK is returned if successful, or an SQLite error code otherwise. -func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqlite3.c:62853:12: */ +func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqlite3.c:63301:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -39840,7 +39899,7 @@ func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqli if (*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(1) { iCksumOff = int64(24) } else { - iCksumOff = ((WAL_HDRSIZE + ((I64(((*Wal)(unsafe.Pointer(pWal)).FiReCksum - U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(16)) + iCksumOff = ((int64(WAL_HDRSIZE) + ((I64(((*Wal)(unsafe.Pointer(pWal)).FiReCksum - U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(16)) } rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, (int32(uint64(unsafe.Sizeof(U32(0))) * uint64(2))), iCksumOff) *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) = Xsqlite3Get4byte(tls, aBuf) @@ -39849,7 +39908,7 @@ func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqli iRead = (*Wal)(unsafe.Pointer(pWal)).FiReCksum (*Wal)(unsafe.Pointer(pWal)).FiReCksum = U32(0) for ; (rc == SQLITE_OK) && (iRead <= iLast); iRead++ { - var iOff I64 = (WAL_HDRSIZE + ((I64((iRead) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + var iOff I64 = (int64(WAL_HDRSIZE) + ((I64((iRead) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aBuf, (szPage + WAL_FRAME_HDRSIZE), iOff) if rc == SQLITE_OK { var iPgno U32 @@ -39868,7 +39927,7 @@ func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqli // Write a set of frames to the log. The caller must hold the write-lock // on the log file (obtained using sqlite3WalBeginWriteTransaction()). -func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTruncate Pgno, isCommit int32, sync_flags int32) int32 { /* sqlite3.c:62902:20: */ +func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTruncate Pgno, isCommit int32, sync_flags int32) int32 { /* sqlite3.c:63350:20: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -39909,7 +39968,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // Checksum for wal-header Xsqlite3Put4byte(tls, (bp /* &aWalHdr */), (uint32(WAL_MAGIC | SQLITE_BIGENDIAN))) - Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 4), WAL_MAX_VERSION) + Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 4), uint32(WAL_MAX_VERSION)) Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 8), uint32(szPage)) Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 12), (*Wal)(unsafe.Pointer(pWal)).FnCkpt) if (*Wal)(unsafe.Pointer(pWal)).FnCkpt == U32(0) { @@ -39921,7 +39980,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + 28), *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + 1*4))) (*Wal)(unsafe.Pointer(pWal)).FszPage = U32(szPage) - (*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = SQLITE_BIGENDIAN + (*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = U8(SQLITE_BIGENDIAN) *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */))) = *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */)) *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + 1*4)) = *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + 1*4)) (*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit = U8(1) @@ -39952,7 +40011,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FiSyncPoint = int64(0) (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FsyncFlags = sync_flags (*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FszPage = szPage - iOffset = (WAL_HDRSIZE + ((I64((iFrame + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + iOffset = (int64(WAL_HDRSIZE) + ((I64((iFrame + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) szFrame = (szPage + WAL_FRAME_HDRSIZE) // Write all frames into the log file exactly once @@ -39968,7 +40027,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, Xsqlite3WalFindFrame(tls, pWal, (*PgHdr)(unsafe.Pointer(p)).Fpgno, bp+40 /* &iWrite */) if *(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) >= iFirst { - var iOff I64 = ((WAL_HDRSIZE + ((I64((*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + WAL_FRAME_HDRSIZE) + var iOff I64 = ((int64(WAL_HDRSIZE) + ((I64((*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */))) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + int64(WAL_FRAME_HDRSIZE)) var pData uintptr if ((*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(0)) || (*(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) < (*Wal)(unsafe.Pointer(pWal)).FiReCksum) { (*Wal)(unsafe.Pointer(pWal)).FiReCksum = *(*U32)(unsafe.Pointer(bp + 40 /* iWrite */)) @@ -40048,8 +40107,8 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // journal size limit, if possible. if ((isCommit != 0) && ((*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit != 0)) && ((*Wal)(unsafe.Pointer(pWal)).FmxWalSize >= int64(0)) { var sz I64 = (*Wal)(unsafe.Pointer(pWal)).FmxWalSize - if (WAL_HDRSIZE + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) > (*Wal)(unsafe.Pointer(pWal)).FmxWalSize { - sz = (WAL_HDRSIZE + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) + if (int64(WAL_HDRSIZE) + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) > (*Wal)(unsafe.Pointer(pWal)).FmxWalSize { + sz = (int64(WAL_HDRSIZE) + ((I64(((iFrame + U32(nExtra)) + U32(1)) - U32(1))) * (I64((szPage) + WAL_FRAME_HDRSIZE)))) } walLimitSize(tls, pWal, sz) (*Wal)(unsafe.Pointer(pWal)).FtruncateOnCommit = U8(0) @@ -40101,7 +40160,7 @@ func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // // 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 Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:63140:20: */ +func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:63588:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -40166,7 +40225,7 @@ func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, if rc == SQLITE_OK { if ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0) && (walPagesize(tls, pWal) != nBuf) { - rc = Xsqlite3CorruptError(tls, 63222) + rc = Xsqlite3CorruptError(tls, 63670) } else { rc = walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -40210,7 +40269,7 @@ func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, // 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 Xsqlite3WalCallback(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63265:20: */ +func Xsqlite3WalCallback(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63713:20: */ var ret U32 = U32(0) if pWal != 0 { ret = (*Wal)(unsafe.Pointer(pWal)).FiCallback @@ -40241,7 +40300,7 @@ func Xsqlite3WalCallback(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63265 // 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 Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* sqlite3.c:63298:20: */ +func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* sqlite3.c:63746:20: */ var rc int32 // pWal->readLock is usually set, but might be -1 if there was a @@ -40252,9 +40311,9 @@ func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* if op == 0 { if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) != WAL_NORMAL_MODE { - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_NORMAL_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_NORMAL_MODE) if walLockShared(tls, pWal, (3+(int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)))) != SQLITE_OK { - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_EXCLUSIVE_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE) } rc = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE)) } else { @@ -40264,7 +40323,7 @@ func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* } else if op > 0 { walUnlockShared(tls, pWal, (3 + (int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)))) - (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = WAL_EXCLUSIVE_MODE + (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(WAL_EXCLUSIVE_MODE) rc = 1 } else { rc = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_NORMAL_MODE)) @@ -40275,14 +40334,14 @@ func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* // 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 Xsqlite3WalHeapMemory(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63340:20: */ +func Xsqlite3WalHeapMemory(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63788:20: */ return (libc.Bool32((pWal != 0) && (int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == WAL_HEAPMEMORY_MODE))) } // Create a snapshot object. The content of a snapshot is opaque to // every other subsystem, so the WAL module can put whatever it needs // in the object. -func Xsqlite3WalSnapshotGet(tls *libc.TLS, pWal uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:63349:20: */ +func Xsqlite3WalSnapshotGet(tls *libc.TLS, pWal uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:63797:20: */ var rc int32 = SQLITE_OK var pRet uintptr @@ -40301,16 +40360,16 @@ func Xsqlite3WalSnapshotGet(tls *libc.TLS, pWal uintptr, ppSnapshot uintptr) int return rc } -var aZero = [4]U32{U32(0), U32(0), U32(0), U32(0)} /* sqlite3.c:63352:20 */ +var aZero = [4]U32{U32(0), U32(0), U32(0), U32(0)} /* sqlite3.c:63800:20 */ // Try to open on pSnapshot when the next read-transaction starts -func Xsqlite3WalSnapshotOpen(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) { /* sqlite3.c:63373:21: */ +func Xsqlite3WalSnapshotOpen(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) { /* sqlite3.c:63821:21: */ (*Wal)(unsafe.Pointer(pWal)).FpSnapshot = pSnapshot } // Return a +ve value if snapshot p1 is newer than p2. A -ve value if // p1 is older than p2 and zero if p1 and p2 are the same snapshot. -func Xsqlite3_snapshot_cmp(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:63384:16: */ +func Xsqlite3_snapshot_cmp(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:63832:16: */ var pHdr1 uintptr = p1 var pHdr2 uintptr = p2 @@ -40340,7 +40399,7 @@ func Xsqlite3_snapshot_cmp(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sql // the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error // occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER // lock is released before returning. -func Xsqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:63408:20: */ +func Xsqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:63856:20: */ var rc int32 rc = walLockShared(tls, pWal, WAL_CKPT_LOCK) if rc == SQLITE_OK { @@ -40356,13 +40415,13 @@ func Xsqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) in // Release a lock obtained by an earlier successful call to // sqlite3WalSnapshotCheck(). -func Xsqlite3WalSnapshotUnlock(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:63427:21: */ +func Xsqlite3WalSnapshotUnlock(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:63875:21: */ walUnlockShared(tls, pWal, WAL_CKPT_LOCK) } // Return the sqlite3_file object for the WAL file -func Xsqlite3WalFile(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:63449:29: */ +func Xsqlite3WalFile(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:63897:29: */ return (*Wal)(unsafe.Pointer(pWal)).FpWalFd } @@ -40638,7 +40697,7 @@ type MemPage1 = struct { FpDbPage uintptr FxCellSize uintptr FxParseCell uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ //************* End of wal.c ************************************************ //************* Begin file btmutex.c **************************************** @@ -40883,25 +40942,25 @@ type MemPage1 = struct { // small cells will be rare, but they are possible. // Forward declarations -type MemPage = MemPage1 /* sqlite3.c:63707:24 */ +type MemPage = MemPage1 /* sqlite3.c:64155:24 */ type BtLock1 = struct { FpBtree uintptr FiTable Pgno FeLock U8 _ [3]byte FpNext uintptr -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type BtLock = BtLock1 /* sqlite3.c:63708:23 */ +type BtLock = BtLock1 /* sqlite3.c:64156:23 */ type CellInfo1 = struct { FnKey I64 FpPayload uintptr FnPayload U32 FnLocal U16 FnSize U16 -} /* sqlite3.c:1297:9 */ +} /* sqlite3.c:1312:9 */ -type CellInfo = CellInfo1 /* sqlite3.c:63709:25 */ +type CellInfo = CellInfo1 /* sqlite3.c:64157:25 */ // Legal values for BtCursor.curFlags @@ -41011,7 +41070,7 @@ type IntegrityCk1 = struct { FerrMsg StrAccum Fheap uintptr Fdb uintptr -} /* sqlite3.c:64149:9 */ +} /* sqlite3.c:64615:9 */ // Legal values for BtCursor.curFlags @@ -41107,7 +41166,7 @@ type IntegrityCk1 = struct { // the database the corresponding bit is set. This allows integrity-check to // detect pages that are used twice and orphaned pages (both of which // indicate corruption). -type IntegrityCk = IntegrityCk1 /* sqlite3.c:64149:28 */ +type IntegrityCk = IntegrityCk1 /* sqlite3.c:64615:28 */ // Routines to read or write a two- and four-byte big-endian integer values. @@ -41121,7 +41180,7 @@ type IntegrityCk = IntegrityCk1 /* sqlite3.c:64149:28 */ // 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 *libc.TLS, p uintptr) { /* sqlite3.c:64199:13: */ +func lockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:64665:13: */ Xsqlite3_mutex_enter(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).Fmutex) (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).Fdb = (*Btree)(unsafe.Pointer(p)).Fdb @@ -41130,7 +41189,7 @@ func lockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:64199:13: */ // Release the BtShared mutex associated with B-Tree handle p and // clear the p->locked boolean. -func unlockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:64213:29: */ +func unlockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:64679:29: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3_mutex_leave(tls, (*BtShared)(unsafe.Pointer(pBt)).Fmutex) @@ -41151,7 +41210,7 @@ func unlockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:64213:29: */ // 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 Xsqlite3BtreeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:64243:21: */ +func Xsqlite3BtreeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:64709:21: */ // Some basic sanity checking on the Btree. The list of Btrees // connected by pNext and pPrev should be in sorted order by // Btree.pBt value. All elements of the list should belong to @@ -41179,7 +41238,7 @@ func Xsqlite3BtreeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:64243:21: */ // 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 *libc.TLS, p uintptr) { /* sqlite3.c:64277:29: */ +func btreeLockCarefully(tls *libc.TLS, p uintptr) { /* sqlite3.c:64743:29: */ var pLater uintptr // In most cases, we should be able to acquire the lock we @@ -41210,7 +41269,7 @@ func btreeLockCarefully(tls *libc.TLS, p uintptr) { /* sqlite3.c:64277:29: */ } // Exit the recursive mutex on a Btree. -func Xsqlite3BtreeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:64315:21: */ +func Xsqlite3BtreeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:64781:21: */ if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 { @@ -41233,7 +41292,7 @@ func Xsqlite3BtreeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:64315:21: */ // 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 *libc.TLS, db uintptr) { /* sqlite3.c:64358:29: */ +func btreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64824:29: */ var i int32 var skipOk int32 = 1 var p uintptr @@ -41248,13 +41307,13 @@ func btreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64358:29: */ (*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache = U8(skipOk) } -func Xsqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64372:21: */ +func Xsqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64838:21: */ if int32((*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 { btreeEnterAll(tls, db) } } -func btreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64375:29: */ +func btreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64841:29: */ var i int32 var p uintptr @@ -41266,7 +41325,7 @@ func btreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64375:29: */ } } -func Xsqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64384:21: */ +func Xsqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64850:21: */ if int32((*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 { btreeLeaveAll(tls, db) } @@ -41277,11 +41336,11 @@ func Xsqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64384:21: * // 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 Xsqlite3BtreeEnterCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:64470:21: */ +func Xsqlite3BtreeEnterCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:64936:21: */ Xsqlite3BtreeEnter(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree) } -func Xsqlite3BtreeLeaveCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:64474:21: */ +func Xsqlite3BtreeLeaveCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:64940:21: */ Xsqlite3BtreeLeave(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree) } @@ -41304,7 +41363,7 @@ func Xsqlite3BtreeLeaveCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:64474: // The header string that appears at the beginning of every // SQLite database. -var zMagicHeader = *(*[16]int8)(unsafe.Pointer(ts + 5686 /* "SQLite format 3" */)) /* sqlite3.c:64505:19 */ +var zMagicHeader = *(*[16]int8)(unsafe.Pointer(ts + 5762 /* "SQLite format 3" */)) /* sqlite3.c:64971:19 */ // Set this global variable to 1 to enable tracing using the TRACE // macro. @@ -41330,14 +41389,14 @@ var zMagicHeader = *(*[16]int8)(unsafe.Pointer(ts + 5686 /* "SQLite format 3" */ // test builds. // // Access to this variable is protected by SQLITE_MUTEX_STATIC_MAIN. -var Xsqlite3SharedCacheList uintptr = uintptr(0) /* sqlite3.c:64558:25 */ +var Xsqlite3SharedCacheList uintptr = uintptr(0) /* sqlite3.c:65024:25 */ // 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 *libc.TLS, enable int32) int32 { /* sqlite3.c:64572:16: */ +func Xsqlite3_enable_shared_cache(tls *libc.TLS, enable int32) int32 { /* sqlite3.c:65038:16: */ Xsqlite3Config.FsharedCacheEnabled = enable return SQLITE_OK } @@ -41354,7 +41413,7 @@ func Xsqlite3_enable_shared_cache(tls *libc.TLS, enable int32) int32 { /* sqlite // (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 *libc.TLS, p uintptr, iTab Pgno, eLock U8) int32 { /* sqlite3.c:64760:12: */ +func querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab Pgno, eLock U8) int32 { /* sqlite3.c:65237:12: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var pIter uintptr @@ -41411,7 +41470,7 @@ func querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab Pgno, eLock U8) in // // SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM // is returned if a malloc attempt fails. -func setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable Pgno, eLock U8) int32 { /* sqlite3.c:64832:12: */ +func setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable Pgno, eLock U8) int32 { /* sqlite3.c:65309:12: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var pLock uintptr = uintptr(0) var pIter uintptr @@ -41462,7 +41521,7 @@ func setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable Pgno, eLock U8) in // 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 *libc.TLS, p uintptr) { /* sqlite3.c:64896:13: */ +func clearAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:65373:13: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var ppIter uintptr = (pBt + 120 /* &.pLock */) @@ -41497,7 +41556,7 @@ func clearAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:6489 } // This function changes all write-locks held by Btree p into read-locks. -func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:64940:13: */ +func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:65417:13: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt if (*BtShared)(unsafe.Pointer(pBt)).FpWriter == p { var pLock uintptr @@ -41505,7 +41564,7 @@ func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c: *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((libc.CplInt32((BTS_EXCLUSIVE | BTS_PENDING)))) for pLock = (*BtShared)(unsafe.Pointer(pBt)).FpLock; pLock != 0; pLock = (*BtLock)(unsafe.Pointer(pLock)).FpNext { - (*BtLock)(unsafe.Pointer(pLock)).FeLock = READ_LOCK + (*BtLock)(unsafe.Pointer(pLock)).FeLock = U8(READ_LOCK) } } } @@ -41521,7 +41580,7 @@ func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c: // Invalidate the overflow page-list cache for all cursors opened // on the shared btree structure pBt. -func invalidateAllOverflowCache(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:64993:13: */ +func invalidateAllOverflowCache(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:65470:13: */ var p uintptr for p = (*BtShared)(unsafe.Pointer(pBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext { @@ -41540,7 +41599,7 @@ func invalidateAllOverflowCache(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:64993 // 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 *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRow I64, isClearTable int32) { /* sqlite3.c:65015:13: */ +func invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRow I64, isClearTable int32) { /* sqlite3.c:65492:13: */ var p uintptr if int32((*Btree)(unsafe.Pointer(pBtree)).FhasIncrblobCur) == 0 { return @@ -41551,7 +41610,7 @@ func invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRo if (int32((*BtCursor)(unsafe.Pointer(p)).FcurFlags) & BTCF_Incrblob) != 0 { (*Btree)(unsafe.Pointer(pBtree)).FhasIncrblobCur = U8(1) if ((*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == pgnoRoot) && ((isClearTable != 0) || ((*BtCursor)(unsafe.Pointer(p)).Finfo.FnKey == iRow)) { - (*BtCursor)(unsafe.Pointer(p)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(p)).FeState = U8(CURSOR_INVALID) } } } @@ -41590,7 +41649,7 @@ func invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRo // 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 *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:65075:12: */ +func btreeSetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:65552:12: */ var rc int32 = SQLITE_OK if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpHasContent) != 0) { @@ -41610,20 +41669,20 @@ func btreeSetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite // 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 *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:65097:12: */ +func btreeGetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:65574:12: */ var p uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpHasContent return (libc.Bool32((p != 0) && ((pgno > Xsqlite3BitvecSize(tls, p)) || (Xsqlite3BitvecTestNotNull(tls, p, pgno) != 0)))) } // Clear (destroy) the BtShared.pHasContent bitvec. This should be // invoked at the conclusion of each write-transaction. -func btreeClearHasContent(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:65106:13: */ +func btreeClearHasContent(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:65583:13: */ Xsqlite3BitvecDestroy(tls, (*BtShared)(unsafe.Pointer(pBt)).FpHasContent) (*BtShared)(unsafe.Pointer(pBt)).FpHasContent = uintptr(0) } // Release all of the apPage[] pages for a cursor. -func btreeReleaseAllCursorPages(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65114:13: */ +func btreeReleaseAllCursorPages(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65591:13: */ var i int32 if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) >= 0 { for i = 0; i < int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage); i++ { @@ -41645,7 +41704,7 @@ func btreeReleaseAllCursorPages(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:6511 // 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 *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65138:12: */ +func saveCursorKey(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65615:12: */ var rc int32 = SQLITE_OK if (*BtCursor)(unsafe.Pointer(pCur)).FcurIntKey != 0 { @@ -41682,14 +41741,14 @@ func saveCursorKey(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65138:12: * // // The caller must ensure that the cursor is valid (has eState==CURSOR_VALID) // prior to calling this routine. -func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65180:12: */ +func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65657:12: */ var rc int32 if (int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags) & BTCF_Pinned) != 0 { return (SQLITE_CONSTRAINT | (int32(11) << 8)) } if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_SKIPNEXT { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) } else { (*BtCursor)(unsafe.Pointer(pCur)).FskipNext = 0 } @@ -41697,7 +41756,7 @@ func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65180: rc = saveCursorKey(tls, pCur) if rc == SQLITE_OK { btreeReleaseAllCursorPages(tls, pCur) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_REQUIRESEEK + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK) } *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(((BTCF_ValidNKey | BTCF_ValidOvfl) | BTCF_AtLast)))) @@ -41723,7 +41782,7 @@ func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65180: // 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 *libc.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:65230:12: */ +func saveAllCursors(tls *libc.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:65707:12: */ var p uintptr for p = (*BtShared)(unsafe.Pointer(pBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext { @@ -41744,7 +41803,7 @@ func saveAllCursors(tls *libc.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int // 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 *libc.TLS, p uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:65247:28: */ +func saveCursorsOnList(tls *libc.TLS, p uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:65724:28: */ for ok := true; ok; ok = p != 0 { if (p != pExcept) && ((Pgno(0) == iRoot) || ((*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == iRoot)) { if (int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_VALID) || (int32((*BtCursor)(unsafe.Pointer(p)).FeState) == CURSOR_SKIPNEXT) { @@ -41763,17 +41822,17 @@ func saveCursorsOnList(tls *libc.TLS, p uintptr, iRoot Pgno, pExcept uintptr) in } // Clear the current cursor position. -func Xsqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65272:21: */ +func Xsqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65749:21: */ Xsqlite3_free(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey) (*BtCursor)(unsafe.Pointer(pCur)).FpKey = uintptr(0) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) } // 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 *libc.TLS, pCur uintptr, pKey uintptr, nKey I64, bias int32, pRes uintptr) int32 { /* sqlite3.c:65284:12: */ +func btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey I64, bias int32, pRes uintptr) int32 { /* sqlite3.c:65761:12: */ var rc int32 // Status code var pIdxKey uintptr var pKeyInfo uintptr // Unpacked index key @@ -41794,7 +41853,7 @@ __3: if !((int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0) || (int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField))) { goto __4 } - rc = Xsqlite3CorruptError(tls, 65301) + rc = Xsqlite3CorruptError(tls, 65778) goto moveto_done __4: ; @@ -41819,7 +41878,7 @@ __5: // saved position info stored by saveCursorPosition(), so there can be // at most one effective restoreCursorPosition() call after each // saveCursorPosition(). -func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65322:12: */ +func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65799:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -41829,7 +41888,7 @@ func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3. if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_FAULT { return (*BtCursor)(unsafe.Pointer(pCur)).FskipNext } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) if Xsqlite3FaultSim(tls, 410) != 0 { rc = SQLITE_IOERR } else { @@ -41843,7 +41902,7 @@ func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3. (*BtCursor)(unsafe.Pointer(pCur)).FskipNext = *(*int32)(unsafe.Pointer(bp /* skipNext */)) } if ((*BtCursor)(unsafe.Pointer(pCur)).FskipNext != 0) && (int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID) { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_SKIPNEXT + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_SKIPNEXT) } } return rc @@ -41859,7 +41918,7 @@ func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3. // // Use the separate sqlite3BtreeCursorRestore() routine to restore a cursor // back to where it ought to be if this routine returns true. -func Xsqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65365:20: */ +func Xsqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65842:20: */ return (libc.Bool32(CURSOR_VALID != int32(*(*U8)(unsafe.Pointer(pCur))))) } @@ -41867,12 +41926,12 @@ func Xsqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3 // Return a pointer to a fake BtCursor object that will always answer // false to the sqlite3BtreeCursorHasMoved() routine above. The fake // cursor returned must not be used with any other Btree interface. -func Xsqlite3BtreeFakeValidCursor(tls *libc.TLS) uintptr { /* sqlite3.c:65378:25: */ +func Xsqlite3BtreeFakeValidCursor(tls *libc.TLS) uintptr { /* sqlite3.c:65855:25: */ return uintptr(unsafe.Pointer(&fakeCursor)) } -var fakeCursor U8 = CURSOR_VALID /* sqlite3.c:65379:13 */ +var fakeCursor U8 = U8(CURSOR_VALID) /* sqlite3.c:65856:13 */ // 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 @@ -41885,7 +41944,7 @@ var fakeCursor U8 = CURSOR_VALID /* sqlite3.c:65379:13 */ // // This routine should only be called for a cursor that just returned // TRUE from sqlite3BtreeCursorHasMoved(). -func Xsqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintptr) int32 { /* sqlite3.c:65397:20: */ +func Xsqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintptr) int32 { /* sqlite3.c:65874:20: */ var rc int32 rc = func() int32 { @@ -41907,7 +41966,7 @@ func Xsqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintp } // Provide flag hints to the cursor. -func Xsqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32) { /* sqlite3.c:65429:21: */ +func Xsqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32) { /* sqlite3.c:65906:21: */ (*BtCursor)(unsafe.Pointer(pCur)).Fhints = U8(x) } @@ -41919,7 +41978,7 @@ func Xsqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32) { /* sq // 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 *libc.TLS, pBt uintptr, pgno Pgno) Pgno { /* sqlite3.c:65445:13: */ +func ptrmapPageno(tls *libc.TLS, pBt uintptr, pgno Pgno) Pgno { /* sqlite3.c:65922:13: */ var nPagesPerMapPage int32 var iPtrMap Pgno var ret Pgno @@ -41944,7 +42003,7 @@ func ptrmapPageno(tls *libc.TLS, pBt uintptr, pgno Pgno) Pgno { /* sqlite3.c:654 // 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 *libc.TLS, pBt uintptr, key Pgno, eType U8, parent Pgno, pRC uintptr) { /* sqlite3.c:65469:13: */ +func ptrmapPut(tls *libc.TLS, pBt uintptr, key Pgno, eType U8, parent Pgno, pRC uintptr) { /* sqlite3.c:65946:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -41967,7 +42026,7 @@ __1: if !(key == Pgno(0)) { goto __2 } - *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65484) + *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65961) return __2: ; @@ -41986,7 +42045,7 @@ __3: // The first byte of the extra data is the MemPage.isInit byte. // If that byte is set, it means this page is also being used // as a btree page. - *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65497) + *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65974) goto ptrmap_exit __4: ; @@ -41994,7 +42053,7 @@ __4: if !(offset < 0) { goto __5 } - *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65502) + *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65979) goto ptrmap_exit __5: ; @@ -42025,7 +42084,7 @@ ptrmap_exit: // 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 *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintptr) int32 { /* sqlite3.c:65528:12: */ +func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintptr) int32 { /* sqlite3.c:66005:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -42046,7 +42105,7 @@ func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintp offset = (int32(Pgno(5) * ((key - Pgno(iPtrmap)) - Pgno(1)))) if offset < 0 { Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */))) - return Xsqlite3CorruptError(tls, 65547) + return Xsqlite3CorruptError(tls, 66024) } *(*U8)(unsafe.Pointer(pEType)) = *(*U8)(unsafe.Pointer(pPtrmap + uintptr(offset))) @@ -42056,7 +42115,7 @@ func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintp Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */))) if (int32(*(*U8)(unsafe.Pointer(pEType))) < 1) || (int32(*(*U8)(unsafe.Pointer(pEType))) > 5) { - return Xsqlite3CorruptError(tls, 65555) + return Xsqlite3CorruptError(tls, 66032) } return SQLITE_OK } @@ -42074,7 +42133,7 @@ func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintp // 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 *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65587:29: */ +func btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66064:29: */ // If the payload will not fit completely on the local page, we have // to decide how much to store locally and how much to spill onto // overflow pages. The strategy is to minimize the amount of unused @@ -42099,6 +42158,26 @@ func btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell uin (*CellInfo)(unsafe.Pointer(pInfo)).FnSize = (U16(int32((U16((int64(((*CellInfo)(unsafe.Pointer(pInfo)).FpPayload + uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnLocal))) - int64(pCell)) / 1))) + 4)) } +// Given a record with nPayload bytes of payload stored within btree +// page pPage, return the number of bytes of payload stored locally. +func btreePayloadToLocal(tls *libc.TLS, pPage uintptr, nPayload I64) int32 { /* sqlite3.c:66099:12: */ + var maxLocal int32 // Maximum amount of payload held locally + maxLocal = int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal) + if nPayload <= I64(maxLocal) { + return int32(nPayload) + } else { + var minLocal int32 // Minimum amount of payload held locally + var surplus int32 // Overflow payload available for local storage + minLocal = int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal) + surplus = (int32(I64(minLocal) + ((nPayload - I64(minLocal)) % (I64((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32(4)))))) + if surplus <= maxLocal { + return surplus + } + return minLocal + } + return int32(0) +} + // The following routines are implementations of the MemPage.xParseCell() // method. // @@ -42111,7 +42190,7 @@ func btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell uin // 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 *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65632:13: */ +func btreeParseCellPtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66127:13: */ _ = pPage (*CellInfo)(unsafe.Pointer(pInfo)).FnSize = (U16(4 + int32(Xsqlite3GetVarint(tls, (pCell+4), (pInfo /* &.nKey */))))) @@ -42121,7 +42200,7 @@ func btreeParseCellPtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr, pIn return } -func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65649:13: */ +func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66144:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -42186,7 +42265,7 @@ func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintpt } } -func btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65717:13: */ +func btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:66212:13: */ var pIter uintptr // For scanning through pCell var nPayload U32 // Number of bytes of cell payload @@ -42217,7 +42296,7 @@ func btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo u } } -func btreeParseCell(tls *libc.TLS, pPage uintptr, iCell int32, pInfo uintptr) { /* sqlite3.c:65754:13: */ +func btreeParseCell(tls *libc.TLS, pPage uintptr, iCell int32, pInfo uintptr) { /* sqlite3.c:66249:13: */ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (iCell))))))))))), pInfo) } @@ -42231,7 +42310,7 @@ func btreeParseCell(tls *libc.TLS, pPage uintptr, iCell int32, pInfo uintptr) { // // cellSizePtrNoPayload() => table internal nodes // cellSizePtr() => all index nodes & table leaf nodes -func cellSizePtr(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:65774:12: */ +func cellSizePtr(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:66269:12: */ var pIter uintptr = (pCell + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) // For looping over bytes of pCell var pEnd uintptr // End mark for a varint var nSize U32 // Size value to return @@ -42272,7 +42351,7 @@ func cellSizePtr(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c return U16(nSize) } -func cellSizePtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:65822:12: */ +func cellSizePtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:66317:12: */ var pIter uintptr = (pCell + uintptr(4)) // For looping over bytes of pCell var pEnd uintptr // End mark for a varint @@ -42289,7 +42368,7 @@ func cellSizePtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* // of pPage. (pSrc and pPager are often the same.) If pCell contains a // pointer to an overflow page, insert an entry into the pointer-map for // the overflow page that will be valid after pCell has been moved to pPage. -func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, pRC uintptr) { /* sqlite3.c:65860:13: */ +func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, pRC uintptr) { /* sqlite3.c:66355:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -42304,11 +42383,11 @@ func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, var ovfl Pgno if (Uptr(((*MemPage)(unsafe.Pointer(pSrc)).FaDataEnd)) >= Uptr((pCell))) && (Uptr(((*MemPage)(unsafe.Pointer(pSrc)).FaDataEnd)) < Uptr((pCell + uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnLocal)))) { - *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65869) + *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 66364) return } ovfl = Xsqlite3Get4byte(tls, (pCell + uintptr((int32((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize) - 4)))) - ptrmapPut(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, ovfl, PTRMAP_OVERFLOW1, (*MemPage)(unsafe.Pointer(pPage)).Fpgno, pRC) + ptrmapPut(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, ovfl, uint8(PTRMAP_OVERFLOW1), (*MemPage)(unsafe.Pointer(pPage)).Fpgno, pRC) } } @@ -42322,7 +42401,7 @@ func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, // 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 *libc.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sqlite3.c:65891:12: */ +func defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sqlite3.c:66386:12: */ var i int32 // Loop counter var pc int32 // Address of the i-th cell var hdr int32 // Offset to the page header @@ -42367,7 +42446,7 @@ func defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sql if !(iFree > (usableSize - 4)) { goto __2 } - return Xsqlite3CorruptError(tls, 65927) + return Xsqlite3CorruptError(tls, 66422) __2: ; if !(iFree != 0) { @@ -42377,7 +42456,7 @@ __2: if !(iFree2 > (usableSize - 4)) { goto __4 } - return Xsqlite3CorruptError(tls, 65930) + return Xsqlite3CorruptError(tls, 66425) __4: ; if !((0 == iFree2) || ((int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0) && (int32(*(*uint8)(unsafe.Pointer(data + uintptr((iFree2 + 1))))) == 0))) { @@ -42390,7 +42469,7 @@ __4: if !(top >= iFree) { goto __6 } - return Xsqlite3CorruptError(tls, 65938) + return Xsqlite3CorruptError(tls, 66433) __6: ; if !(iFree2 != 0) { @@ -42399,14 +42478,14 @@ __6: if !((iFree + sz) > iFree2) { goto __9 } - return Xsqlite3CorruptError(tls, 65941) + return Xsqlite3CorruptError(tls, 66436) __9: ; sz2 = ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((iFree2 + 2)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((iFree2 + 2))) + 1)))) if !((iFree2 + sz2) > usableSize) { goto __10 } - return Xsqlite3CorruptError(tls, 65943) + return Xsqlite3CorruptError(tls, 66438) __10: ; libc.Xmemmove(tls, (data + uintptr(((iFree + sz) + sz2))), (data + uintptr((iFree + sz))), (uint64(iFree2 - (iFree + sz)))) @@ -42416,7 +42495,7 @@ __7: if !((iFree + sz) > usableSize) { goto __11 } - return Xsqlite3CorruptError(tls, 65947) + return Xsqlite3CorruptError(tls, 66442) __11: ; __8: @@ -42477,7 +42556,7 @@ __18: if !((pc < iCellFirst) || (pc > iCellLast)) { goto __21 } - return Xsqlite3CorruptError(tls, 65975) + return Xsqlite3CorruptError(tls, 66470) __21: ; @@ -42486,7 +42565,7 @@ __21: if !((cbrk < iCellFirst) || ((pc + size) > usableSize)) { goto __22 } - return Xsqlite3CorruptError(tls, 65981) + return Xsqlite3CorruptError(tls, 66476) __22: ; @@ -42522,7 +42601,7 @@ defragment_out: if !(((int32(*(*uint8)(unsafe.Pointer(data + uintptr((hdr + 7))))) + cbrk) - iCellFirst) != (*MemPage)(unsafe.Pointer(pPage)).FnFree) { goto __25 } - return Xsqlite3CorruptError(tls, 66002) + return Xsqlite3CorruptError(tls, 66497) __25: ; @@ -42547,7 +42626,7 @@ __25: // 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 *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr { /* sqlite3.c:66027:11: */ +func pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr { /* sqlite3.c:66522:11: */ var hdr int32 = int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset) // Offset to page header var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData // Page data var iAddr int32 = (hdr + 1) // Address of ptr to pc @@ -42576,7 +42655,7 @@ func pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr *(*U8)(unsafe.Pointer(aData + uintptr((hdr + 7)))) += U8((int32(U8(x)))) } else if (x + pc) > maxPC { // This slot extends off the end of the usable part of the page - *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66056) + *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66551) return uintptr(0) } else { // The slot remains on the free-list. Reduce its size to account @@ -42591,14 +42670,14 @@ func pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr if pc <= (iAddr + size) { if pc != 0 { // The next slot in the chain is not past the end of the current slot - *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66070) + *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66565) } return uintptr(0) } } if pc > ((maxPC + nByte) - 4) { // The free slot chain extends off the end of the page - *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66077) + *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66572) } return uintptr(0) } @@ -42614,7 +42693,7 @@ func pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr // 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 *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int32 { /* sqlite3.c:66095:12: */ +func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int32 { /* sqlite3.c:66590:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -42639,7 +42718,7 @@ func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int3 if (top == 0) && ((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == U32(65536)) { top = 65536 } else { - return Xsqlite3CorruptError(tls, 66124) + return Xsqlite3CorruptError(tls, 66619) } } @@ -42654,7 +42733,7 @@ func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int3 *(*int32)(unsafe.Pointer(pIdx)) = libc.AssignInt32(&g2, (int32((int64(pSpace) - int64(data)) / 1))) if g2 <= gap { - return Xsqlite3CorruptError(tls, 66142) + return Xsqlite3CorruptError(tls, 66637) } else { return SQLITE_OK } @@ -42705,7 +42784,7 @@ func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int3 // 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 *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sqlite3.c:66191:12: */ +func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sqlite3.c:66686:12: */ var iPtr U16 // Address of ptr to next freeblock var iFreeBlk U16 // Address of the next freeblock var hdr U8 // Page header size. 0 or 100 @@ -42729,12 +42808,12 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s if int32(iFreeBlk) == 0 { break } // TH3: corrupt082.100 - return Xsqlite3CorruptError(tls, 66220) + return Xsqlite3CorruptError(tls, 66715) } iPtr = iFreeBlk } if U32(iFreeBlk) > ((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32(4)) { // TH3: corrupt081.100 - return Xsqlite3CorruptError(tls, 66225) + return Xsqlite3CorruptError(tls, 66720) } // At this point: @@ -42745,11 +42824,11 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s if (iFreeBlk != 0) && ((iEnd + U32(3)) >= U32(iFreeBlk)) { nFrag = (U8(U32(iFreeBlk) - iEnd)) if iEnd > U32(iFreeBlk) { - return Xsqlite3CorruptError(tls, 66237) + return Xsqlite3CorruptError(tls, 66732) } iEnd = (U32(int32(iFreeBlk) + ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iFreeBlk) + 2)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iFreeBlk) + 2))) + 1)))))) if iEnd > (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return Xsqlite3CorruptError(tls, 66240) + return Xsqlite3CorruptError(tls, 66735) } iSize = (U16(iEnd - U32(iStart))) iFreeBlk = (U16((int32(*(*uint8)(unsafe.Pointer((data + uintptr(iFreeBlk))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr(iFreeBlk)) + 1))))) @@ -42762,7 +42841,7 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s var iPtrEnd int32 = (int32(iPtr) + ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iPtr) + 2)))))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iPtr) + 2))) + 1))))) if (iPtrEnd + 3) >= int32(iStart) { if iPtrEnd > int32(iStart) { - return Xsqlite3CorruptError(tls, 66253) + return Xsqlite3CorruptError(tls, 66748) } nFrag = U8(int32(nFrag) + (int32(iStart) - iPtrEnd)) iSize = (U16(iEnd - U32(iPtr))) @@ -42770,7 +42849,7 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s } } if int32(nFrag) > int32(*(*uint8)(unsafe.Pointer(data + uintptr((int32(hdr) + 7))))) { - return Xsqlite3CorruptError(tls, 66259) + return Xsqlite3CorruptError(tls, 66754) } *(*uint8)(unsafe.Pointer(data + uintptr((int32(hdr) + 7)))) -= uint8((int32(nFrag))) } @@ -42780,10 +42859,10 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s // so just extend the cell content area rather than create another // freelist entry if int32(iStart) < int32(x) { - return Xsqlite3CorruptError(tls, 66267) + return Xsqlite3CorruptError(tls, 66762) } if int32(iPtr) != (int32(hdr) + 1) { - return Xsqlite3CorruptError(tls, 66268) + return Xsqlite3CorruptError(tls, 66763) } *(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 1))))) = (U8((int32(iFreeBlk)) >> 8)) *(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 1))) + 1)) = U8(iFreeBlk) @@ -42817,7 +42896,7 @@ func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* s // PTF_ZERODATA | PTF_LEAF // PTF_LEAFDATA | PTF_INTKEY // PTF_LEAFDATA | PTF_INTKEY | PTF_LEAF -func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite3.c:66298:12: */ +func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite3.c:66793:12: */ var pBt uintptr // A copy of pPage->pBt (*MemPage)(unsafe.Pointer(pPage)).Fleaf = (U8(flagByte >> 3)) @@ -42868,7 +42947,7 @@ func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite } else { // EVIDENCE-OF: R-47608-56469 Any other value for the b-tree page type is // an error. - return Xsqlite3CorruptError(tls, 66341) + return Xsqlite3CorruptError(tls, 66836) } (*MemPage)(unsafe.Pointer(pPage)).Fmax1bytePayload = (*BtShared)(unsafe.Pointer(pBt)).Fmax1bytePayload return SQLITE_OK @@ -42876,7 +42955,7 @@ func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite // Compute the amount of freespace on the page. In other words, fill // in the pPage->nFree field. -func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66351:12: */ +func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66846:12: */ var pc int32 // Address of a freeblock within pPage->aData[] var hdr U8 // Offset to beginning of page header var data uintptr // Equal to pPage->aData @@ -42908,12 +42987,12 @@ func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66 if pc < top { // EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will // always be at least one cell before the first freeblock. - return Xsqlite3CorruptError(tls, 66392) + return Xsqlite3CorruptError(tls, 66887) } for 1 != 0 { if pc > iCellLast { // Freeblock off the end of the page - return Xsqlite3CorruptError(tls, 66397) + return Xsqlite3CorruptError(tls, 66892) } next = (U32((int32(*(*U8)(unsafe.Pointer((data + uintptr(pc))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr(pc)) + 1))))) size = (U32((int32(*(*U8)(unsafe.Pointer((data + uintptr((pc + 2)))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((pc + 2))) + 1))))) @@ -42925,11 +43004,11 @@ func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66 } if next > U32(0) { // Freeblock not in ascending order - return Xsqlite3CorruptError(tls, 66407) + return Xsqlite3CorruptError(tls, 66902) } if (U32(pc) + size) > uint32(usableSize) { // Last freeblock extends past page end - return Xsqlite3CorruptError(tls, 66411) + return Xsqlite3CorruptError(tls, 66906) } } @@ -42940,7 +43019,7 @@ func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66 // serves to verify that the offset to the start of the cell-content // area, according to the page header, lies within the page. if (nFree > usableSize) || (nFree < iCellFirst) { - return Xsqlite3CorruptError(tls, 66423) + return Xsqlite3CorruptError(tls, 66918) } (*MemPage)(unsafe.Pointer(pPage)).FnFree = int32((U16(nFree - iCellFirst))) return SQLITE_OK @@ -42948,7 +43027,7 @@ func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66 // Do additional sanity check after btreeInitPage() if // PRAGMA cell_size_check=ON -func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66433:28: */ +func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66928:28: */ var iCellFirst int32 // First allowable cell or freeblock offset var iCellLast int32 // Last possible cell or freeblock offset var i int32 // Index into the cell pointer array @@ -42970,12 +43049,12 @@ func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66433 pc = int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer((data + uintptr((cellOffset + (i * 2)))))))) if (pc < iCellFirst) || (pc > iCellLast) { - return Xsqlite3CorruptError(tls, 66454) + return Xsqlite3CorruptError(tls, 66949) } sz = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pPage + 120 /* &.xCellSize */))))(tls, pPage, (data + uintptr(pc)))) if (pc + sz) > usableSize { - return Xsqlite3CorruptError(tls, 66459) + return Xsqlite3CorruptError(tls, 66954) } } return SQLITE_OK @@ -42988,7 +43067,7 @@ func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66433 // SQLITE_CORRUPT. Note that a return of SQLITE_OK does not // guarantee that the page is well-formed. It only shows that // we failed to detect any corruption. -func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66474:12: */ +func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66969:12: */ var data uintptr // Equal to pPage->aData var pBt uintptr // The main btree structure @@ -42997,7 +43076,7 @@ func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66474:12: // EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating // the b-tree page type. if decodeFlags(tls, pPage, int32(*(*U8)(unsafe.Pointer(data)))) != 0 { - return Xsqlite3CorruptError(tls, 66491) + return Xsqlite3CorruptError(tls, 66986) } (*MemPage)(unsafe.Pointer(pPage)).FmaskPage = (U16((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1))) @@ -43011,7 +43090,7 @@ func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66474:12: (*MemPage)(unsafe.Pointer(pPage)).FnCell = (U16((int32(*(*U8)(unsafe.Pointer((data + 3)))) << 8) | int32(*(*U8)(unsafe.Pointer((data + 3) + 1))))) if U32((*MemPage)(unsafe.Pointer(pPage)).FnCell) > (((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(8)) / U32(6)) { // To many cells for a single page. The page must be corrupt - return Xsqlite3CorruptError(tls, 66505) + return Xsqlite3CorruptError(tls, 67000) } // EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only @@ -43021,7 +43100,7 @@ func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66474:12: (*MemPage)(unsafe.Pointer(pPage)).FnFree = -1 // Indicate that this value is yet uncomputed (*MemPage)(unsafe.Pointer(pPage)).FisInit = U8(1) - if ((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & SQLITE_CellSizeCk) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & uint64(SQLITE_CellSizeCk)) != 0 { return btreeCellSizeCheck(tls, pPage) } return SQLITE_OK @@ -43029,7 +43108,7 @@ func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66474:12: // Set up a raw page so that it looks like a database page holding // no entries. -func zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { /* sqlite3.c:66527:13: */ +func zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { /* sqlite3.c:67022:13: */ var data uintptr = (*MemPage)(unsafe.Pointer(pPage)).FaData var pBt uintptr = (*MemPage)(unsafe.Pointer(pPage)).FpBt var hdr U8 = (*MemPage)(unsafe.Pointer(pPage)).FhdrOffset @@ -43064,7 +43143,7 @@ func zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { /* sqlite3.c:66527:13 // Convert a DbPage obtained from the pager into a MemPage used by // the btree layer. -func btreePageFromDbPage(tls *libc.TLS, pDbPage uintptr, pgno Pgno, pBt uintptr) uintptr { /* sqlite3.c:66564:16: */ +func btreePageFromDbPage(tls *libc.TLS, pDbPage uintptr, pgno Pgno, pBt uintptr) uintptr { /* sqlite3.c:67059:16: */ var pPage uintptr = Xsqlite3PagerGetExtra(tls, pDbPage) if pgno != (*MemPage)(unsafe.Pointer(pPage)).Fpgno { (*MemPage)(unsafe.Pointer(pPage)).FaData = Xsqlite3PagerGetData(tls, pDbPage) @@ -43091,7 +43170,7 @@ func btreePageFromDbPage(tls *libc.TLS, pDbPage uintptr, pgno Pgno, pBt uintptr) // 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 *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:66588:12: */ +func btreeGetPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:67083:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -43109,7 +43188,7 @@ func btreeGetPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags i // 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 *libc.TLS, pBt uintptr, pgno Pgno) uintptr { /* sqlite3.c:66610:16: */ +func btreePageLookup(tls *libc.TLS, pBt uintptr, pgno Pgno) uintptr { /* sqlite3.c:67105:16: */ var pDbPage uintptr pDbPage = Xsqlite3PagerLookup(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pgno) @@ -43121,11 +43200,11 @@ func btreePageLookup(tls *libc.TLS, pBt uintptr, pgno Pgno) uintptr { /* sqlite3 // Return the size of the database file in pages. If there is any kind of // error, return ((unsigned int)-1). -func btreePagecount(tls *libc.TLS, pBt uintptr) Pgno { /* sqlite3.c:66624:13: */ +func btreePagecount(tls *libc.TLS, pBt uintptr) Pgno { /* sqlite3.c:67119:13: */ return (*BtShared)(unsafe.Pointer(pBt)).FnPage } -func Xsqlite3BtreeLastPage(tls *libc.TLS, p uintptr) Pgno { /* sqlite3.c:66627:21: */ +func Xsqlite3BtreeLastPage(tls *libc.TLS, p uintptr) Pgno { /* sqlite3.c:67122:21: */ return btreePagecount(tls, (*Btree)(unsafe.Pointer(p)).FpBt) } @@ -43141,7 +43220,7 @@ func Xsqlite3BtreeLastPage(tls *libc.TLS, p uintptr) Pgno { /* sqlite3.c:66627:2 // // If an error occurs, then *ppPage is undefined. It // may remain unchanged, or it may be set to an invalid value. -func getAndInitPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, pCur uintptr, bReadOnly int32) int32 { /* sqlite3.c:66645:12: */ +func getAndInitPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, pCur uintptr, bReadOnly int32) int32 { /* sqlite3.c:67140:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -43151,7 +43230,7 @@ func getAndInitPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, pCur if !(pgno > btreePagecount(tls, pBt)) { goto __1 } - rc = Xsqlite3CorruptError(tls, 66660) + rc = Xsqlite3CorruptError(tls, 67155) goto getAndInitPage_error1 __1: ; @@ -43182,7 +43261,7 @@ __3: if !((pCur != 0) && ((int32((*MemPage)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppPage))))).FnCell) < 1) || (int32((*MemPage)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppPage))))).FintKey) != int32((*BtCursor)(unsafe.Pointer(pCur)).FcurIntKey)))) { goto __5 } - rc = Xsqlite3CorruptError(tls, 66681) + rc = Xsqlite3CorruptError(tls, 67176) goto getAndInitPage_error2 __5: ; @@ -43206,18 +43285,18 @@ __6: // call to btreeGetPage. // // Page1 is a special case and must be released using releasePageOne(). -func releasePageNotNull(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:66704:13: */ +func releasePageNotNull(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:67199:13: */ Xsqlite3PagerUnrefNotNull(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage) } -func releasePage(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:66713:13: */ +func releasePage(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:67208:13: */ if pPage != 0 { releasePageNotNull(tls, pPage) } } -func releasePageOne(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:66716:13: */ +func releasePageOne(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:67211:13: */ Xsqlite3PagerUnrefPageOne(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage) } @@ -43229,13 +43308,13 @@ func releasePageOne(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:66716:13: */ // * 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 *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:66736:12: */ +func btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:67231:12: */ var rc int32 = btreeGetPage(tls, pBt, pgno, ppPage, flags) if rc == SQLITE_OK { if Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > 1 { releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return Xsqlite3CorruptError(tls, 66747) + return Xsqlite3CorruptError(tls, 67242) } (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = U8(0) } else { @@ -43250,7 +43329,7 @@ func btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, f // // This routine needs to reset the extra data section at the end of the // page to agree with the restored data. -func pageReinit(tls *libc.TLS, pData uintptr) { /* sqlite3.c:66765:13: */ +func pageReinit(tls *libc.TLS, pData uintptr) { /* sqlite3.c:67260:13: */ var pPage uintptr pPage = Xsqlite3PagerGetExtra(tls, pData) @@ -43270,10 +43349,10 @@ func pageReinit(tls *libc.TLS, pData uintptr) { /* sqlite3.c:66765:13: */ } // Invoke the busy handler for a btree. -func btreeInvokeBusyHandler(tls *libc.TLS, pArg uintptr) int32 { /* sqlite3.c:66787:12: */ +func btreeInvokeBusyHandler(tls *libc.TLS, pArg uintptr) int32 { /* sqlite3.c:67282:12: */ var pBt uintptr = pArg - return Xsqlite3InvokeBusyHandler(tls, ((*BtShared)(unsafe.Pointer(pBt)).Fdb + 624 /* &.busyHandler */)) + return Xsqlite3InvokeBusyHandler(tls, ((*BtShared)(unsafe.Pointer(pBt)).Fdb + 632 /* &.busyHandler */)) } // Open a database file. @@ -43295,7 +43374,7 @@ func btreeInvokeBusyHandler(tls *libc.TLS, pArg uintptr) int32 { /* sqlite3.c:66 // 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 Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintptr, ppBtree uintptr, flags int32, vfsFlags int32) int32 { /* sqlite3.c:66815:20: */ +func Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintptr, ppBtree uintptr, flags int32, vfsFlags int32) int32 { /* sqlite3.c:67310:20: */ bp := tls.Alloc(100) defer tls.Free(100) @@ -43327,7 +43406,7 @@ func Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt mutexOpen = uintptr(0) rc = SQLITE_OK isTempDb = (libc.Bool32((zFilename == uintptr(0)) || (int32(*(*int8)(unsafe.Pointer(zFilename))) == 0))) - isMemdb = (libc.Bool32((((zFilename != 0) && (libc.Xstrcmp(tls, zFilename, ts+5702 /* ":memory:" */) == 0)) || + isMemdb = (libc.Bool32((((zFilename != 0) && (libc.Xstrcmp(tls, zFilename, ts+5778 /* ":memory:" */) == 0)) || ((isTempDb != 0) && (Xsqlite3TempInMemory(tls, db) != 0))) || ((vfsFlags & SQLITE_OPEN_MEMORY) != 0))) @@ -43356,7 +43435,7 @@ __2: return SQLITE_NOMEM __3: ; - (*Btree)(unsafe.Pointer(p)).FinTrans = TRANS_NONE + (*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_NONE) (*Btree)(unsafe.Pointer(p)).Fdb = db (*Btree)(unsafe.Pointer(p)).Flock.FpBtree = p (*Btree)(unsafe.Pointer(p)).Flock.FiTable = Pgno(1) @@ -43516,7 +43595,7 @@ __24: // determined by the 2-byte integer located at an offset of 16 bytes from // the beginning of the database file. (*BtShared)(unsafe.Pointer(pBt)).FpageSize = (U32((int32(*(*uint8)(unsafe.Pointer(bp /* &zDbHeader[0] */ + 16))) << 8) | (int32(*(*uint8)(unsafe.Pointer(bp /* &zDbHeader[0] */ + 17))) << 16))) - if !((((*BtShared)(unsafe.Pointer(pBt)).FpageSize < U32(512)) || ((*BtShared)(unsafe.Pointer(pBt)).FpageSize > SQLITE_MAX_PAGE_SIZE)) || + if !((((*BtShared)(unsafe.Pointer(pBt)).FpageSize < U32(512)) || ((*BtShared)(unsafe.Pointer(pBt)).FpageSize > U32(SQLITE_MAX_PAGE_SIZE))) || ((((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1)) & (*BtShared)(unsafe.Pointer(pBt)).FpageSize) != U32(0))) { goto __25 } @@ -43688,7 +43767,7 @@ __44: if !(Xsqlite3BtreeSchema(tls, p, 0, uintptr(0)) == uintptr(0)) { goto __47 } - Xsqlite3PagerSetCachesize(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager, -2000) + Xsqlite3BtreeSetCacheSize(tls, p, -2000) __47: ; @@ -43716,7 +43795,7 @@ __49: // 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 *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:67113:12: */ +func removeFromSharingList(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:67608:12: */ var pMainMtx uintptr var pList uintptr var removed int32 = 0 @@ -43748,7 +43827,7 @@ func removeFromSharingList(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:6711 // 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 *libc.TLS, pBt uintptr) { /* sqlite3.c:67152:13: */ +func allocateTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67647:13: */ if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace) != 0) { (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace = Xsqlite3PageMalloc(tls, int32((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) @@ -43774,7 +43853,7 @@ func allocateTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67152:13: */ } // Free the pBt->pTmpSpace allocation -func freeTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67181:13: */ +func freeTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67676:13: */ if (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace != 0 { *(*uintptr)(unsafe.Pointer(pBt + 136 /* &.pTmpSpace */)) -= (uintptr(4)) Xsqlite3PageFree(tls, (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace) @@ -43783,7 +43862,7 @@ func freeTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67181:13: */ } // Close an open database and invalidate all cursors. -func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67192:20: */ +func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67687:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var pCur uintptr @@ -43840,7 +43919,7 @@ func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67192:20: // 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 Xsqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:67254:20: */ +func Xsqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:67749:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) @@ -43857,7 +43936,7 @@ func Xsqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { / // 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 Xsqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:67273:20: */ +func Xsqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:67768:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var res int32 @@ -43869,7 +43948,7 @@ func Xsqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { / // Change the limit on the amount of the database file that may be // memory mapped. -func Xsqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Sqlite3_int64) int32 { /* sqlite3.c:67288:20: */ +func Xsqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Sqlite3_int64) int32 { /* sqlite3.c:67783:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) @@ -43884,7 +43963,7 @@ func Xsqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Sqlite3_int64) i // there is a high probability of damage) Level 2 is the default. There // is a very low but non-zero probability of damage. Level 3 reduces the // probability of damage to near zero but with a write performance reduction. -func Xsqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) int32 { /* sqlite3.c:67307:20: */ +func Xsqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) int32 { /* sqlite3.c:67802:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) @@ -43911,7 +43990,7 @@ func Xsqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) int32 // // 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 Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve int32, iFix int32) int32 { /* sqlite3.c:67340:20: */ +func Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve int32, iFix int32) int32 { /* sqlite3.c:67835:20: */ var rc int32 = SQLITE_OK var x int32 var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt @@ -43929,6 +44008,9 @@ func Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve if ((pageSize >= 512) && (pageSize <= SQLITE_MAX_PAGE_SIZE)) && (((pageSize - 1) & pageSize) == 0) { + if (nReserve > 32) && (pageSize == 512) { + pageSize = 1024 + } (*BtShared)(unsafe.Pointer(pBt)).FpageSize = U32(pageSize) freeTempSpace(tls, pBt) } @@ -43942,7 +44024,7 @@ func Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve } // Return the currently defined page size -func Xsqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67371:20: */ +func Xsqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67867:20: */ return int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpageSize) } @@ -43955,7 +44037,7 @@ func Xsqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:673 // 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 Xsqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67386:20: */ +func Xsqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67882:20: */ var n int32 n = (int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpageSize - (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FusableSize)) @@ -43969,7 +44051,7 @@ func Xsqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) int32 { /* sqlite3 // The value returned is the larger of the current reserve size and // the latest reserve size requested by SQLITE_FILECTRL_RESERVE_BYTES. // The amount of reserve can only grow - never shrink. -func Xsqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67402:20: */ +func Xsqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67898:20: */ var n1 int32 var n2 int32 Xsqlite3BtreeEnter(tls, p) @@ -43985,7 +44067,7 @@ func Xsqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) int32 { /* sqlit // 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 Xsqlite3BtreeMaxPageCount(tls *libc.TLS, p uintptr, mxPage Pgno) Pgno { /* sqlite3.c:67417:21: */ +func Xsqlite3BtreeMaxPageCount(tls *libc.TLS, p uintptr, mxPage Pgno) Pgno { /* sqlite3.c:67913:21: */ var n Pgno Xsqlite3BtreeEnter(tls, p) n = Xsqlite3PagerMaxPageCount(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager, mxPage) @@ -44009,7 +44091,7 @@ func Xsqlite3BtreeMaxPageCount(tls *libc.TLS, p uintptr, mxPage Pgno) Pgno { /* // With BTS_SECURE_DELETE, operation is like BTS_OVERWRITE with the addition // that freelist leaf pages are written back into the database, increasing // the amount of disk I/O. -func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32 { /* sqlite3.c:67443:20: */ +func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32 { /* sqlite3.c:67939:20: */ var b int32 if p == uintptr(0) { return 0 @@ -44029,7 +44111,7 @@ func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32 { // 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 Xsqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) int32 { /* sqlite3.c:67464:20: */ +func Xsqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) int32 { /* sqlite3.c:67960:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var rc int32 = SQLITE_OK var av U8 = U8(autoVacuum) @@ -44062,7 +44144,7 @@ func Xsqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) int3 // Return the value of the 'auto-vacuum' property. If auto-vacuum is // enabled 1 is returned. Otherwise 0. -func Xsqlite3BtreeGetAutoVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67488:20: */ +func Xsqlite3BtreeGetAutoVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67984:20: */ var rc int32 Xsqlite3BtreeEnter(tls, p) rc = func() int32 { @@ -44087,7 +44169,7 @@ func Xsqlite3BtreeGetAutoVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:6 // 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 *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:67544:12: */ +func lockBtree(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68040:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -44131,7 +44213,7 @@ __2: nPage = *(*U32)(unsafe.Pointer(bp + 8 /* nPageFile */)) __3: ; - if !(((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & SQLITE_ResetDatabase) != uint64(0)) { + if !(((*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags & uint64(SQLITE_ResetDatabase)) != uint64(0)) { goto __4 } nPage = U32(0) @@ -44205,7 +44287,7 @@ __10: // // The original design allowed these amounts to vary, but as of // version 3.6.0, we require them to be fixed. - if !(libc.Xmemcmp(tls, (page1+21), ts+5711 /* "@ " */, uint64(3)) != 0) { + if !(libc.Xmemcmp(tls, (page1+21), ts+5787 /* "@ " */, uint64(3)) != 0) { goto __14 } goto page1_init_failed @@ -44218,7 +44300,7 @@ __14: // EVIDENCE-OF: R-25008-21688 The size of a page is a power of two // between 512 and 65536 inclusive. if !(((((pageSize - U32(1)) & pageSize) != U32(0)) || - (pageSize > SQLITE_MAX_PAGE_SIZE)) || + (pageSize > U32(SQLITE_MAX_PAGE_SIZE))) || (pageSize <= U32(256))) { goto __15 } @@ -44255,7 +44337,7 @@ __16: if !((Xsqlite3WritableSchema(tls, (*BtShared)(unsafe.Pointer(pBt)).Fdb) == 0) && (nPage > *(*U32)(unsafe.Pointer(bp + 8 /* nPageFile */)))) { goto __17 } - rc = Xsqlite3CorruptError(tls, 67669) + rc = Xsqlite3CorruptError(tls, 68165) goto page1_init_failed __17: ; @@ -44327,7 +44409,7 @@ page1_init_failed: // has the effect of releasing the read lock. // // If there is a transaction in progress, this routine is a no-op. -func unlockBtreeIfUnused(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67751:13: */ +func unlockBtreeIfUnused(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:68247:13: */ if (int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == TRANS_NONE) && ((*BtShared)(unsafe.Pointer(pBt)).FpPage1 != uintptr(0)) { var pPage1 uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpPage1 @@ -44340,7 +44422,7 @@ func unlockBtreeIfUnused(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67751:13: */ // 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 *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:67768:12: */ +func newDatabase(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68264:12: */ var pP1 uintptr var data uintptr var rc int32 @@ -44380,7 +44462,7 @@ func newDatabase(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:67768:12: */ // 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 Xsqlite3BtreeNewDb(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67812:20: */ +func Xsqlite3BtreeNewDb(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68308:20: */ var rc int32 Xsqlite3BtreeEnter(tls, p) (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FnPage = U32(0) @@ -44422,7 +44504,7 @@ func Xsqlite3BtreeNewDb(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67812:20: // 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 Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uintptr) int32 { /* sqlite3.c:67856:20: */ +func Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uintptr) int32 { /* sqlite3.c:68352:20: */ var pBt uintptr var pPager uintptr var rc int32 @@ -44445,7 +44527,7 @@ func Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVers __1: ; - if !((((*Sqlite3)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).Fdb)).Fflags & SQLITE_ResetDatabase) != 0) && + if !((((*Sqlite3)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).Fdb)).Fflags & uint64(SQLITE_ResetDatabase)) != 0) && (int32(Xsqlite3PagerIsreadonly(tls, pPager)) == 0)) { goto __2 } @@ -44511,7 +44593,7 @@ __11: // Any read-only or read-write transaction implies a read-lock on // page 1. So if some other shared-cache client already has a write-lock // on page 1, the transaction cannot be opened. - rc = querySharedCacheTableLock(tls, p, SCHEMA_ROOT, READ_LOCK) + rc = querySharedCacheTableLock(tls, p, uint32(SCHEMA_ROOT), uint8(READ_LOCK)) if !(SQLITE_OK != rc) { goto __12 } @@ -44602,7 +44684,7 @@ __16: goto __28 } - (*Btree)(unsafe.Pointer(p)).Flock.FeLock = READ_LOCK + (*Btree)(unsafe.Pointer(p)).Flock.FeLock = U8(READ_LOCK) (*Btree)(unsafe.Pointer(p)).Flock.FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpLock (*BtShared)(unsafe.Pointer(pBt)).FpLock = (p + 48 /* &.lock */) __28: @@ -44611,9 +44693,9 @@ __27: ; (*Btree)(unsafe.Pointer(p)).FinTrans = func() uint8 { if wrflag != 0 { - return TRANS_WRITE + return uint8(TRANS_WRITE) } - return TRANS_READ + return uint8(TRANS_READ) }() if !(int32((*Btree)(unsafe.Pointer(p)).FinTrans) > int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction)) { goto __29 @@ -44686,7 +44768,7 @@ __34: // 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 *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:68036:12: */ +func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:68532:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -44714,13 +44796,13 @@ func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:68036:12 if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) { var childPgno Pgno = Xsqlite3Get4byte(tls, pCell) - ptrmapPut(tls, pBt, childPgno, PTRMAP_BTREE, pgno, bp /* &rc */) + ptrmapPut(tls, pBt, childPgno, uint8(PTRMAP_BTREE), pgno, bp /* &rc */) } } if !(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0) { var childPgno Pgno = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8)))) - ptrmapPut(tls, pBt, childPgno, PTRMAP_BTREE, pgno, bp /* &rc */) + ptrmapPut(tls, pBt, childPgno, uint8(PTRMAP_BTREE), pgno, bp /* &rc */) } return *(*int32)(unsafe.Pointer(bp /* rc */)) @@ -44738,14 +44820,14 @@ func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:68036:12 // // PTRMAP_OVERFLOW2: pPage is an overflow-page. The pointer points at the next // overflow page in the list. -func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType U8) int32 { /* sqlite3.c:68081:12: */ +func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType U8) int32 { /* sqlite3.c:68577:12: */ bp := tls.Alloc(24) defer tls.Free(24) if int32(eType) == PTRMAP_OVERFLOW2 { // The pointer is always the first 4 bytes of the page in this case. if Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return Xsqlite3CorruptError(tls, 68087) + return Xsqlite3CorruptError(tls, 68583) } Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -44771,7 +44853,7 @@ func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, pCell, bp /* &info */) if U32((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnLocal) < (*CellInfo)(unsafe.Pointer(bp /* &info */)).FnPayload { if (pCell + uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize)) > ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)) { - return Xsqlite3CorruptError(tls, 68106) + return Xsqlite3CorruptError(tls, 68602) } if iFrom == Xsqlite3Get4byte(tls, ((pCell+uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize))-uintptr(4))) { Xsqlite3Put4byte(tls, ((pCell + uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize)) - uintptr(4)), iTo) @@ -44788,7 +44870,7 @@ func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType if i == nCell { if (int32(eType) != PTRMAP_BTREE) || (Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8)))) != iFrom) { - return Xsqlite3CorruptError(tls, 68124) + return Xsqlite3CorruptError(tls, 68620) } Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8))), iTo) } @@ -44803,7 +44885,7 @@ func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType // 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 *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPage Pgno, iFreePage Pgno, isCommit int32) int32 { /* sqlite3.c:68142:12: */ +func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPage Pgno, iFreePage Pgno, isCommit int32) int32 { /* sqlite3.c:68638:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -44814,7 +44896,7 @@ func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPag // var rc int32 at bp, 4 if iDbPage < Pgno(3) { - return Xsqlite3CorruptError(tls, 68159) + return Xsqlite3CorruptError(tls, 68655) } // Move page iDbPage from its current location to page number iFreePage @@ -44840,7 +44922,7 @@ func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPag } else { var nextOvfl Pgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pDbPage)).FaData) if nextOvfl != Pgno(0) { - ptrmapPut(tls, pBt, nextOvfl, PTRMAP_OVERFLOW2, iFreePage, bp /* &rc */) + ptrmapPut(tls, pBt, nextOvfl, uint8(PTRMAP_OVERFLOW2), iFreePage, bp /* &rc */) if *(*int32)(unsafe.Pointer(bp /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp /* rc */)) } @@ -44884,7 +44966,7 @@ func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPag // 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 *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit int32) int32 { /* sqlite3.c:68236:12: */ +func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit int32) int32 { /* sqlite3.c:68732:12: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -44906,7 +44988,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit return rc } if int32(*(*U8)(unsafe.Pointer(bp /* eType */))) == PTRMAP_ROOTPAGE { - return Xsqlite3CorruptError(tls, 68257) + return Xsqlite3CorruptError(tls, 68753) } if int32(*(*U8)(unsafe.Pointer(bp /* eType */))) == PTRMAP_FREEPAGE { @@ -44919,7 +45001,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // var pFreePg uintptr at bp+8, 8 - rc = allocateBtreePage(tls, pBt, bp+8 /* &pFreePg */, bp+16 /* &iFreePg */, iLastPg, BTALLOC_EXACT) + rc = allocateBtreePage(tls, pBt, bp+8 /* &pFreePg */, bp+16 /* &iFreePg */, iLastPg, uint8(BTALLOC_EXACT)) if rc != SQLITE_OK { return rc } @@ -44931,8 +45013,8 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // Index of free page to move pLastPg to // var pLastPg uintptr at bp+24, 8 - var eMode U8 = BTALLOC_ANY // Mode parameter for allocateBtreePage() - var iNear Pgno = Pgno(0) // nearby parameter for allocateBtreePage() + var eMode U8 = U8(BTALLOC_ANY) // Mode parameter for allocateBtreePage() + var iNear Pgno = Pgno(0) // nearby parameter for allocateBtreePage() rc = btreeGetPage(tls, pBt, iLastPg, bp+24 /* &pLastPg */, 0) if rc != SQLITE_OK { @@ -44946,7 +45028,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // looping until a free-page located within the first nFin pages // of the file is found. if bCommit == 0 { - eMode = BTALLOC_LE + eMode = U8(BTALLOC_LE) iNear = nFin } for ok := true; ok; ok = ((bCommit != 0) && (*(*Pgno)(unsafe.Pointer(bp + 40 /* iFreePg */)) > nFin)) { @@ -44981,7 +45063,7 @@ func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit // 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 *libc.TLS, pBt uintptr, nOrig Pgno, nFree Pgno) Pgno { /* sqlite3.c:68332:13: */ +func finalDbSize(tls *libc.TLS, pBt uintptr, nOrig Pgno, nFree Pgno) Pgno { /* sqlite3.c:68828:13: */ var nEntry int32 // Number of entries on one ptrmap page var nPtrmap Pgno // Number of PtrMap pages to be freed var nFin Pgno // Return value @@ -45005,7 +45087,7 @@ func finalDbSize(tls *libc.TLS, pBt uintptr, nOrig Pgno, nFree Pgno) Pgno { /* s // 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 Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68358:20: */ +func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68854:20: */ var rc int32 var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt @@ -45019,7 +45101,7 @@ func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:6835 var nFin Pgno = finalDbSize(tls, pBt, nOrig, nFree) if (nOrig < nFin) || (nFree >= nOrig) { - rc = Xsqlite3CorruptError(tls, 68372) + rc = Xsqlite3CorruptError(tls, 68868) } else if nFree > Pgno(0) { rc = saveAllCursors(tls, pBt, uint32(0), uintptr(0)) if rc == SQLITE_OK { @@ -45045,7 +45127,7 @@ func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:6835 // 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 *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68400:12: */ +func autoVacuumCommit(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68896:12: */ var rc int32 = SQLITE_OK var pPager uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpPager @@ -45062,13 +45144,13 @@ func autoVacuumCommit(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68400:12: // It is not possible to create a database for which the final page // is either a pointer-map page or the pending-byte page. If one // is encountered, this indicates corruption. - return Xsqlite3CorruptError(tls, 68420) + return Xsqlite3CorruptError(tls, 68916) } nFree = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + 36)) nFin = finalDbSize(tls, pBt, nOrig, nFree) if nFin > nOrig { - return Xsqlite3CorruptError(tls, 68425) + return Xsqlite3CorruptError(tls, 68921) } if nFin < nOrig { rc = saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -45116,7 +45198,7 @@ func autoVacuumCommit(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68400:12: // // 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 Xsqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) int32 { /* sqlite3.c:68479:20: */ +func Xsqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) int32 { /* sqlite3.c:68975:20: */ var rc int32 = SQLITE_OK if int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE { var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt @@ -45139,7 +45221,7 @@ func Xsqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) i // This function is called from both BtreeCommitPhaseTwo() and BtreeRollback() // at the conclusion of a transaction. -func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:68506:13: */ +func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:69002:13: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var db uintptr = (*Btree)(unsafe.Pointer(p)).Fdb @@ -45149,7 +45231,7 @@ func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:68506:13: */ // handle, downgrade to a read-only transaction. The other statements // may still be reading from the database. downgradeAllSharedCacheTableLocks(tls, p) - (*Btree)(unsafe.Pointer(p)).FinTrans = TRANS_READ + (*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_READ) } else { // If the handle had any kind of transaction open, decrement the // transaction count of the shared btree. If the transaction count @@ -45159,13 +45241,13 @@ func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:68506:13: */ clearAllSharedCacheTableLocks(tls, p) (*BtShared)(unsafe.Pointer(pBt)).FnTransaction-- if 0 == (*BtShared)(unsafe.Pointer(pBt)).FnTransaction { - (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = TRANS_NONE + (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_NONE) } } // Set the current transaction state to TRANS_NONE and unlock the // pager if this call closed the only read or write transaction. - (*Btree)(unsafe.Pointer(p)).FinTrans = TRANS_NONE + (*Btree)(unsafe.Pointer(p)).FinTrans = U8(TRANS_NONE) unlockBtreeIfUnused(tls, pBt) } @@ -45195,7 +45277,7 @@ func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:68506:13: */ // // This will release the write lock on the database file. If there // are no active cursors, it also releases the read lock. -func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 { /* sqlite3.c:68568:20: */ +func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 { /* sqlite3.c:69064:20: */ if int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_NONE { return SQLITE_OK @@ -45214,7 +45296,7 @@ func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 return rc } (*Btree)(unsafe.Pointer(p)).FiDataVersion-- // Compensate for pPager->iDataVersion++; - (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = TRANS_READ + (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_READ) btreeClearHasContent(tls, pBt) } @@ -45224,7 +45306,7 @@ func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 } // Do both phases of a commit. -func Xsqlite3BtreeCommit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68600:20: */ +func Xsqlite3BtreeCommit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:69096:20: */ var rc int32 Xsqlite3BtreeEnter(tls, p) rc = Xsqlite3BtreeCommitPhaseOne(tls, p, uintptr(0)) @@ -45259,7 +45341,7 @@ func Xsqlite3BtreeCommit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68600:20 // // SQLITE_OK is returned if successful, or if an error occurs while // saving a cursor position, an SQLite error code. -func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, writeOnly int32) int32 { /* sqlite3.c:68637:20: */ +func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, writeOnly int32) int32 { /* sqlite3.c:69133:20: */ var p uintptr var rc int32 = SQLITE_OK @@ -45276,7 +45358,7 @@ func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, w } } else { Xsqlite3BtreeClearCursor(tls, p) - (*BtCursor)(unsafe.Pointer(p)).FeState = CURSOR_FAULT + (*BtCursor)(unsafe.Pointer(p)).FeState = U8(CURSOR_FAULT) (*BtCursor)(unsafe.Pointer(p)).FskipNext = errCode } btreeReleaseAllCursorPages(tls, p) @@ -45288,7 +45370,7 @@ func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, w // Set the pBt->nPage field correctly, according to the current // state of the database. Assume pBt->pPage1 is valid. -func btreeSetNPage(tls *libc.TLS, pBt uintptr, pPage1 uintptr) { /* sqlite3.c:68669:13: */ +func btreeSetNPage(tls *libc.TLS, pBt uintptr, pPage1 uintptr) { /* sqlite3.c:69165:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -45310,7 +45392,7 @@ func btreeSetNPage(tls *libc.TLS, pBt uintptr, pPage1 uintptr) { /* sqlite3.c:68 // // This will release the write lock on the database file. If there // are no active cursors, it also releases the read lock. -func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly int32) int32 { /* sqlite3.c:68688:20: */ +func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly int32) int32 { /* sqlite3.c:69184:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -45351,7 +45433,7 @@ func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly i releasePageOne(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage1 */))) } - (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = TRANS_READ + (*BtShared)(unsafe.Pointer(pBt)).FinTransaction = U8(TRANS_READ) btreeClearHasContent(tls, pBt) } @@ -45376,7 +45458,7 @@ func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly i // are no active savepoints and no other statement-transactions open, // iStatement is 1. This anonymous savepoint can be released or rolled back // using the sqlite3BtreeSavepoint() function. -func Xsqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) int32 { /* sqlite3.c:68753:20: */ +func Xsqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) int32 { /* sqlite3.c:69249:20: */ var rc int32 var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) @@ -45400,7 +45482,7 @@ func Xsqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) int32 { // 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 Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:68784:20: */ +func Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:69280:20: */ var rc int32 = SQLITE_OK if (p != 0) && (int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE) { var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt @@ -45468,7 +45550,7 @@ func Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32 // // It is assumed that the sqlite3BtreeCursorZero() has been called // on pCur to initialize the memory space prior to invoking this routine. -func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:68855:12: */ +func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:69351:12: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt // Shared b-tree handle var pX uintptr // Looping over other all cursors @@ -45487,7 +45569,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u } if iTable <= Pgno(1) { if iTable < Pgno(1) { - return Xsqlite3CorruptError(tls, 68891) + return Xsqlite3CorruptError(tls, 69387) } else if btreePagecount(tls, pBt) == Pgno(0) { iTable = Pgno(0) @@ -45503,7 +45585,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u (*BtCursor)(unsafe.Pointer(pCur)).FpBt = pBt (*BtCursor)(unsafe.Pointer(pCur)).FcurFlags = func() uint8 { if wrFlag != 0 { - return BTCF_WriteFlag + return uint8(BTCF_WriteFlag) } return uint8(0) }() @@ -45511,7 +45593,7 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u if wrFlag != 0 { return uint8(0) } - return PAGER_GET_READONLY + return uint8(PAGER_GET_READONLY) }() // If there are two or more cursors on the same btree, then all such // cursors *must* have the BTCF_Multiple flag set. @@ -45523,11 +45605,11 @@ func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo u } (*BtCursor)(unsafe.Pointer(pCur)).FpNext = (*BtShared)(unsafe.Pointer(pBt)).FpCursor (*BtShared)(unsafe.Pointer(pBt)).FpCursor = pCur - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_OK } -func btreeCursorWithLock(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:68920:12: */ +func btreeCursorWithLock(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:69416:12: */ var rc int32 Xsqlite3BtreeEnter(tls, p) rc = btreeCursor(tls, p, iTable, wrFlag, pKeyInfo, pCur) @@ -45535,7 +45617,7 @@ func btreeCursorWithLock(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pK return rc } -func Xsqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:68933:20: */ +func Xsqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:69429:20: */ if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 { return btreeCursorWithLock(tls, p, iTable, wrFlag, pKeyInfo, pCur) } else { @@ -45550,7 +45632,7 @@ func Xsqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pK // 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 Xsqlite3BtreeCursorSize(tls *libc.TLS) int32 { /* sqlite3.c:68955:20: */ +func Xsqlite3BtreeCursorSize(tls *libc.TLS) int32 { /* sqlite3.c:69451:20: */ return (int32(((uint64(unsafe.Sizeof(BtCursor{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) } @@ -45560,13 +45642,13 @@ func Xsqlite3BtreeCursorSize(tls *libc.TLS) int32 { /* sqlite3.c:68955:20: */ // 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 Xsqlite3BtreeCursorZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:68967:21: */ +func Xsqlite3BtreeCursorZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:69463:21: */ libc.Xmemset(tls, p, 0, uint64((uintptr(0) + 32 /* &.pBt */))) } // Close a cursor. The read lock on the database file is released // when the last cursor is closed. -func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:68975:20: */ +func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69471:20: */ var pBtree uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBtree if pBtree != 0 { var pBt uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBt @@ -45600,7 +45682,7 @@ func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c: // // BtCursor.info is a cache of the information in the current cell. // Using this cache reduces the number of calls to btreeParseCell(). -func getCellInfo(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69029:29: */ +func getCellInfo(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69525:29: */ if int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize) == 0 { *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((BTCF_ValidNKey)) btreeParseCell(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpPage, int32((*BtCursor)(unsafe.Pointer(pCur)).Fix), (pCur + 48 /* &.info */)) @@ -45609,7 +45691,7 @@ func getCellInfo(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69029:29: */ } } -func Xsqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69048:20: */ +func Xsqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69544:20: */ return (libc.Bool32(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID)) } @@ -45618,26 +45700,26 @@ func Xsqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) int32 { /* sqlite // 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 Xsqlite3BtreeIntegerKey(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:69059:20: */ +func Xsqlite3BtreeIntegerKey(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:69555:20: */ getCellInfo(tls, pCur) return (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey } // Pin or unpin a cursor. -func Xsqlite3BtreeCursorPin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69070:21: */ +func Xsqlite3BtreeCursorPin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69566:21: */ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((BTCF_Pinned)) } -func Xsqlite3BtreeCursorUnpin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69074:21: */ +func Xsqlite3BtreeCursorUnpin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69570:21: */ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_Pinned))) } // Return the offset into the database file for the start of the // payload to which the cursor is pointing. -func Xsqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:69084:20: */ +func Xsqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:69580:20: */ getCellInfo(tls, pCur) return ((I64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize) * (I64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).Fpgno) - int64(1))) + (I64((int64((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload) - int64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaData)) / 1))) @@ -45650,7 +45732,7 @@ func Xsqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:69084:2 // The caller must guarantee that the cursor is pointing to a non-NULL // valid entry. In other words, the calling procedure must guarantee // that the cursor has Cursor.eState==CURSOR_VALID. -func Xsqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) U32 { /* sqlite3.c:69102:20: */ +func Xsqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) U32 { /* sqlite3.c:69598:20: */ getCellInfo(tls, pCur) return (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload @@ -45667,7 +45749,7 @@ func Xsqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) U32 { /* sqlite3.c:69 // // The current implementation merely returns the size of the underlying // database file. -func Xsqlite3BtreeMaxRecordSize(tls *libc.TLS, pCur uintptr) Sqlite3_int64 { /* sqlite3.c:69122:30: */ +func Xsqlite3BtreeMaxRecordSize(tls *libc.TLS, pCur uintptr) Sqlite3_int64 { /* sqlite3.c:69618:30: */ return (Sqlite3_int64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize) * Sqlite3_int64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage)) } @@ -45689,7 +45771,7 @@ func Xsqlite3BtreeMaxRecordSize(tls *libc.TLS, pCur uintptr) Sqlite3_int64 { /* // 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 *libc.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgnoNext uintptr) int32 { /* sqlite3.c:69147:12: */ +func getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgnoNext uintptr) int32 { /* sqlite3.c:69643:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -45757,7 +45839,7 @@ func getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgn // of data are copied from the buffer pBuf to pPayload. // // SQLITE_OK is returned on success, otherwise an error code. -func copyPayload(tls *libc.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eOp int32, pDbPage uintptr) int32 { /* sqlite3.c:69215:12: */ +func copyPayload(tls *libc.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eOp int32, pDbPage uintptr) int32 { /* sqlite3.c:69711:12: */ if eOp != 0 { // Copy data from buffer to page (a write operation) var rc int32 = Xsqlite3PagerWrite(tls, pDbPage) @@ -45799,7 +45881,7 @@ func copyPayload(tls *libc.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eOp // * An incremental vacuum, // * A commit in auto_vacuum="full" mode, // * Creating a table (may require moving an overflow page). -func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr, eOp int32) int32 { /* sqlite3.c:69265:12: */ +func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr, eOp int32) int32 { /* sqlite3.c:69761:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -45817,7 +45899,7 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt // conditional above is really: // &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] // but is recast into its current form to avoid integer overflow problems - return Xsqlite3CorruptError(tls, 69298) + return Xsqlite3CorruptError(tls, 69794) } // Check if data must be read/written to/from the btree page itself. @@ -45874,7 +45956,7 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt for *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) != 0 { // If required, populate the overflow page-list cache. if *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) > (*BtShared)(unsafe.Pointer(pBt)).FnPage { - return Xsqlite3CorruptError(tls, 69360) + return Xsqlite3CorruptError(tls, 69856) } *(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) @@ -45934,7 +46016,7 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt if (rc == SQLITE_OK) && (amt > U32(0)) { // Overflow chain ends prematurely - return Xsqlite3CorruptError(tls, 69445) + return Xsqlite3CorruptError(tls, 69941) } return rc } @@ -45954,7 +46036,7 @@ func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintpt // Return SQLITE_OK on success or an error code if anything goes // wrong. An error is returned if "offset+amt" is larger than // the available payload. -func Xsqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69467:20: */ +func Xsqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69963:20: */ return accessPayload(tls, pCur, offset, amt, pBuf, 0) } @@ -45962,7 +46044,7 @@ func Xsqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf // This variant of sqlite3BtreePayload() works even if the cursor has not // in the CURSOR_VALID state. It is only used by the sqlite3_blob_read() // interface. -func accessPayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69481:28: */ +func accessPayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69977:28: */ var rc int32 if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_INVALID { return SQLITE_ABORT @@ -45975,7 +46057,7 @@ func accessPayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf return accessPayload(tls, pCur, offset, amt, pBuf, 0) } -func Xsqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69495:20: */ +func Xsqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69991:20: */ if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_VALID { return accessPayload(tls, pCur, offset, amt, pBuf, 0) @@ -46002,7 +46084,7 @@ func Xsqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U3 // 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 *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:69524:19: */ +func fetchPayload(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:70020:19: */ var amt int32 amt = int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) @@ -46033,7 +46115,7 @@ func fetchPayload(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite // // These routines is used to get quick access to key and data // in the common case where no overflow pages are used. -func Xsqlite3BtreePayloadFetch(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:69563:27: */ +func Xsqlite3BtreePayloadFetch(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:70059:27: */ return fetchPayload(tls, pCur, pAmt) } @@ -46044,11 +46126,11 @@ func Xsqlite3BtreePayloadFetch(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintpt // the new child page does not match the flags field of the parent (i.e. // if an intkey page appears to be the parent of a non-intkey page, or // vice-versa). -func moveToChild(tls *libc.TLS, pCur uintptr, newPgno U32) int32 { /* sqlite3.c:69577:12: */ +func moveToChild(tls *libc.TLS, pCur uintptr, newPgno U32) int32 { /* sqlite3.c:70073:12: */ var pBt uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBt if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) >= (BTCURSOR_MAX_DEPTH - 1) { - return Xsqlite3CorruptError(tls, 69585) + return Xsqlite3CorruptError(tls, 70081) } (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0) *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32((BTCF_ValidNKey | BTCF_ValidOvfl)))) @@ -46065,7 +46147,7 @@ func moveToChild(tls *libc.TLS, pCur uintptr, newPgno U32) int32 { /* sqlite3.c: // 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 *libc.TLS, pCur uintptr) { /* sqlite3.c:69626:13: */ +func moveToParent(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:70122:13: */ var pLeaf uintptr (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0) @@ -46095,7 +46177,7 @@ func moveToParent(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69626:13: */ // 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 *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69667:12: */ +func moveToRoot(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70163:12: */ var pRoot uintptr var rc int32 var subpage Pgno @@ -46125,7 +46207,7 @@ __1: if !((*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot == Pgno(0)) { goto __6 } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_EMPTY goto __7 __6: @@ -46148,7 +46230,7 @@ __8: if !(rc != SQLITE_OK) { goto __10 } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return rc __10: ; @@ -46174,7 +46256,7 @@ __2: if !((int32((*MemPage)(unsafe.Pointer(pRoot)).FisInit) == 0) || ((libc.Bool32((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0))) != int32((*MemPage)(unsafe.Pointer(pRoot)).FintKey))) { goto __11 } - return Xsqlite3CorruptError(tls, 69723) + return Xsqlite3CorruptError(tls, 70219) __11: ; @@ -46187,7 +46269,7 @@ skip_init: if !(int32((*MemPage)(unsafe.Pointer(pRoot)).FnCell) > 0) { goto __12 } - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) goto __13 __12: if !(!(int32((*MemPage)(unsafe.Pointer(pRoot)).Fleaf) != 0)) { @@ -46196,15 +46278,15 @@ __12: if !((*MemPage)(unsafe.Pointer(pRoot)).Fpgno != Pgno(1)) { goto __16 } - return Xsqlite3CorruptError(tls, 69736) + return Xsqlite3CorruptError(tls, 70232) __16: ; subpage = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pRoot)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pRoot)).FhdrOffset) + 8)))) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) rc = moveToChild(tls, pCur, subpage) goto __15 __14: - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) rc = SQLITE_EMPTY __15: ; @@ -46218,7 +46300,7 @@ __13: // // The left-most leaf is the one with the smallest key - the first // in ascending order. -func moveToLeftmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69754:12: */ +func moveToLeftmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70250:12: */ var pgno Pgno var rc int32 = SQLITE_OK var pPage uintptr @@ -46239,7 +46321,7 @@ func moveToLeftmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69754:12: // // The right-most entry is the one with the largest key - the last // key in ascending order. -func moveToRightmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69779:12: */ +func moveToRightmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70275:12: */ var pgno Pgno var rc int32 = SQLITE_OK var pPage uintptr = uintptr(0) @@ -46260,7 +46342,7 @@ func moveToRightmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69779:12: // 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 Xsqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:69802:20: */ +func Xsqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:70298:20: */ var rc int32 rc = moveToRoot(tls, pCur) @@ -46279,7 +46361,7 @@ func Xsqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sq // Move the cursor to the last entry in the table. Return SQLITE_OK // on success. Set *pRes to 0 if the cursor actually points to something // or set *pRes to 1 if the table is empty. -func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:69824:20: */ +func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:70320:20: */ var rc int32 // If the cursor already points to the last entry, this is a no-op. @@ -46335,7 +46417,7 @@ func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sql // // For index tables, the pIdxKey->eqSeen field is set to 1 if there // exists an entry in the table that exactly matches pIdxKey. -func Xsqlite3BtreeMovetoUnpacked(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, intKey I64, biasRight int32, pRes uintptr) int32 { /* sqlite3.c:69894:20: */ +func Xsqlite3BtreeMovetoUnpacked(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, intKey I64, biasRight int32, pRes uintptr) int32 { /* sqlite3.c:70390:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -46484,7 +46566,7 @@ __24: if !(pCell >= (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd) { goto __26 } - return Xsqlite3CorruptError(tls, 69997) + return Xsqlite3CorruptError(tls, 70497) __26: ; goto __24 @@ -46591,7 +46673,7 @@ __40: if !((nCell < 2) || ((U32(nCell) / (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize) > (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage)) { goto __42 } - rc = Xsqlite3CorruptError(tls, 70072) + rc = Xsqlite3CorruptError(tls, 70572) goto moveto_finish __42: ; @@ -46640,7 +46722,7 @@ __47: if !((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0) { goto __49 } - rc = Xsqlite3CorruptError(tls, 70104) + rc = Xsqlite3CorruptError(tls, 70604) __49: ; goto moveto_finish @@ -46710,7 +46792,7 @@ moveto_finish: // TRUE will be returned after a call to sqlite3BtreeNext() moves // past the last entry in the table or sqlite3BtreePrev() moves past // the first entry. TRUE is also returned if the table is empty. -func Xsqlite3BtreeEof(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70145:20: */ +func Xsqlite3BtreeEof(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70645:20: */ // TODO: What if the cursor is in CURSOR_REQUIRESEEK but all table entries // have been deleted? This API will need to change to return an error code // as well as the boolean result value. @@ -46720,7 +46802,7 @@ func Xsqlite3BtreeEof(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70145:20 // 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 Xsqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:70158:20: */ +func Xsqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:70658:20: */ var n I64 var i U8 @@ -46759,7 +46841,7 @@ func Xsqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:70 // skipped if the SQL index had been a unique index. The F argument // is a hint to the implement. SQLite btree implementation does not use // this hint, but COMDB2 does. -func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ +func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70698:28: */ var rc int32 var idx int32 var pPage uintptr @@ -46779,7 +46861,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ return SQLITE_DONE } if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == CURSOR_SKIPNEXT { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) if (*BtCursor)(unsafe.Pointer(pCur)).FskipNext > 0 { return SQLITE_OK } @@ -46788,7 +46870,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage idx = int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1)) - if !(int32((*MemPage)(unsafe.Pointer(pPage)).FisInit) != 0) { + if !(int32((*MemPage)(unsafe.Pointer(pPage)).FisInit) != 0) || (Xsqlite3FaultSim(tls, 412) != 0) { // The only known way for this to happen is for there to be a // recursive SQL function that does a DELETE operation as part of a // SELECT which deletes content out from under an active cursor @@ -46796,7 +46878,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ // has pages in common with the table being queried. See TH3 // module cov1/btree78.test testcase 220 (2018-06-08) for an // example. - return Xsqlite3CorruptError(tls, 70229) + return Xsqlite3CorruptError(tls, 70729) } // If the database file is corrupt, it is possible for the value of idx @@ -46818,7 +46900,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ } for ok := true; ok; ok = (int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)) { if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_DONE } moveToParent(tls, pCur) @@ -46838,7 +46920,7 @@ func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */ return int32(0) } -func Xsqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:70268:20: */ +func Xsqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:70768:20: */ var pPage uintptr _ = flags // Used in COMDB2 but not native SQLite @@ -46878,7 +46960,7 @@ func Xsqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqli // skipped if the SQL index had been a unique index. The F argument is a // hint to the implement. The native SQLite btree implementation does not // use this hint, but COMDB2 does. -func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70308:28: */ +func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70808:28: */ var rc int32 var pPage uintptr @@ -46896,7 +46978,7 @@ func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70308:28: * return SQLITE_DONE } if CURSOR_SKIPNEXT == int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_VALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_VALID) if (*BtCursor)(unsafe.Pointer(pCur)).FskipNext < 0 { return SQLITE_OK } @@ -46915,7 +46997,7 @@ func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70308:28: * } else { for int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) == 0 { if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) == 0 { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) return SQLITE_DONE } moveToParent(tls, pCur) @@ -46932,7 +47014,7 @@ func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70308:28: * return rc } -func Xsqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:70357:20: */ +func Xsqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:70857:20: */ _ = flags // Used in COMDB2 but not native SQLite *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(((BTCF_AtLast | BTCF_ValidOvfl) | BTCF_ValidNKey)))) @@ -46966,7 +47048,7 @@ func Xsqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* // 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 *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintptr, nearby Pgno, eMode U8) int32 { /* sqlite3.c:70395:12: */ +func allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintptr, nearby Pgno, eMode U8) int32 { /* sqlite3.c:70895:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -47033,7 +47115,7 @@ func allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintptr if !(n >= mxPage) { goto __1 } - return Xsqlite3CorruptError(tls, 70419) + return Xsqlite3CorruptError(tls, 70919) __1: ; if !(n > U32(0)) { @@ -47114,7 +47196,7 @@ __15: if !((iTrunk > mxPage) || (libc.PostIncUint32(&nSearch, 1) > n)) { goto __16 } - rc = Xsqlite3CorruptError(tls, 70475) + rc = Xsqlite3CorruptError(tls, 70975) goto __17 __16: rc = btreeGetUnusedPage(tls, pBt, iTrunk, bp+8 /* &pTrunk */, 0) @@ -47156,7 +47238,7 @@ __19: goto __22 } // Value of k is out of range. Database corruption - rc = Xsqlite3CorruptError(tls, 70504) + rc = Xsqlite3CorruptError(tls, 71004) goto end_allocate_page goto __23 __22: @@ -47201,7 +47283,7 @@ __27: if !(iNewTrunk > mxPage) { goto __32 } - rc = Xsqlite3CorruptError(tls, 70538) + rc = Xsqlite3CorruptError(tls, 71038) goto end_allocate_page __32: ; @@ -47315,7 +47397,7 @@ __40: if !(iPage > mxPage) { goto __51 } - rc = Xsqlite3CorruptError(tls, 70603) + rc = Xsqlite3CorruptError(tls, 71103) goto end_allocate_page __51: ; @@ -47490,7 +47572,7 @@ end_allocate_page: // // 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 *libc.TLS, pBt uintptr, pMemPage uintptr, iPage Pgno) int32 { /* sqlite3.c:70717:12: */ +func freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage Pgno) int32 { /* sqlite3.c:71217:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -47511,7 +47593,7 @@ func freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage Pgno) int32 { if !((iPage < Pgno(2)) || (iPage > (*BtShared)(unsafe.Pointer(pBt)).FnPage)) { goto __1 } - return Xsqlite3CorruptError(tls, 70730) + return Xsqlite3CorruptError(tls, 71230) __1: ; if !(pMemPage != 0) { @@ -47557,7 +47639,7 @@ __5: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __7 } - ptrmapPut(tls, pBt, iPage, PTRMAP_FREEPAGE, uint32(0), bp+8 /* &rc */) + ptrmapPut(tls, pBt, iPage, uint8(PTRMAP_FREEPAGE), uint32(0), bp+8 /* &rc */) if !(*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0) { goto __8 } @@ -47581,7 +47663,7 @@ __7: if !(iTrunk > btreePagecount(tls, pBt)) { goto __10 } - *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3CorruptError(tls, 70777) + *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3CorruptError(tls, 71277) goto freepage_out __10: ; @@ -47598,7 +47680,7 @@ __11: if !(nLeaf > (((*BtShared)(unsafe.Pointer(pBt)).FusableSize / U32(4)) - U32(2))) { goto __12 } - *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3CorruptError(tls, 70788) + *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3CorruptError(tls, 71288) goto freepage_out __12: ; @@ -47679,7 +47761,7 @@ __18: return *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) } -func freePage(tls *libc.TLS, pPage uintptr, pRC uintptr) { /* sqlite3.c:70851:13: */ +func freePage(tls *libc.TLS, pPage uintptr, pRC uintptr) { /* sqlite3.c:71351:13: */ if (*(*int32)(unsafe.Pointer(pRC))) == SQLITE_OK { *(*int32)(unsafe.Pointer(pRC)) = freePage2(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, pPage, (*MemPage)(unsafe.Pointer(pPage)).Fpgno) } @@ -47687,7 +47769,7 @@ func freePage(tls *libc.TLS, pPage uintptr, pRC uintptr) { /* sqlite3.c:70851:13 // Free any overflow pages associated with the given Cell. Store // size information about the cell in pInfo. -func clearCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 { /* sqlite3.c:70861:12: */ +func clearCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 { /* sqlite3.c:71361:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -47704,7 +47786,7 @@ func clearCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 if (pCell + uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnSize)) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd { // Cell extends past end of page - return Xsqlite3CorruptError(tls, 70881) + return Xsqlite3CorruptError(tls, 71381) } ovflPgno = Xsqlite3Get4byte(tls, ((pCell + uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnSize)) - uintptr(4))) pBt = (*MemPage)(unsafe.Pointer(pPage)).FpBt @@ -47719,7 +47801,7 @@ func clearCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 // 0 is not a legal page number and page 1 cannot be an // overflow page. Therefore if ovflPgno<2 or past the end of the // file the database must be corrupt. - return Xsqlite3CorruptError(tls, 70898) + return Xsqlite3CorruptError(tls, 71398) } if nOvfl != 0 { rc = getOverflowPage(tls, pBt, ovflPgno, bp /* &pOvfl */, bp+8 /* &iNext */) @@ -47739,7 +47821,7 @@ func clearCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 // enabled. If this 'overflow' page happens to be a page that the // caller is iterating through or using in some other way, this // can be problematic. - rc = Xsqlite3CorruptError(tls, 70918) + rc = Xsqlite3CorruptError(tls, 71418) } else { rc = freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp /* pOvfl */)), ovflPgno) } @@ -47765,7 +47847,7 @@ func clearCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 // 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 *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize uintptr) int32 { /* sqlite3.c:70944:12: */ +func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize uintptr) int32 { /* sqlite3.c:71444:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -47908,9 +47990,9 @@ func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize if ((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) == SQLITE_OK) { var eType U8 = func() uint8 { if pgnoPtrmap != 0 { - return PTRMAP_OVERFLOW2 + return uint8(PTRMAP_OVERFLOW2) } - return PTRMAP_OVERFLOW1 + return uint8(PTRMAP_OVERFLOW1) }() ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoOvfl */)), eType, pgnoPtrmap, bp+12 /* &rc */) if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != 0 { @@ -47947,7 +48029,7 @@ func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize // removes the reference to the cell from pPage. // // "sz" must be the number of bytes in the cell. -func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { /* sqlite3.c:71134:13: */ +func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { /* sqlite3.c:71634:13: */ var pc U32 // Offset to cell content of cell being deleted var data uintptr // pPage->aData var ptr uintptr // Used to move bytes around within data[] @@ -47964,7 +48046,7 @@ func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { hdr = int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) if (pc + U32(sz)) > (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 71154) + *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 71654) return } rc = freeSpace(tls, pPage, uint16(pc), uint16(sz)) @@ -48000,7 +48082,7 @@ func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { // pPage->nOverflow is incremented. // // *pRC must be SQLITE_OK when this routine is called. -func insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, pTemp uintptr, iChild Pgno, pRC uintptr) { /* sqlite3.c:71190:13: */ +func insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, pTemp uintptr, iChild Pgno, pRC uintptr) { /* sqlite3.c:71690:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -48161,7 +48243,7 @@ type CellArray1 = struct { FszCell uintptr FapEnd [6]uintptr FixNx [6]int32 -} /* sqlite3.c:71365:9 */ +} /* sqlite3.c:71865:9 */ // The following parameters determine how many adjacent pages get involved // in a balancing operation. NN is the number of neighbors on either side @@ -48238,11 +48320,11 @@ type CellArray1 = struct { // cases, ixNx[] entries with higher indexes, and the corresponding apEnd[] // entries, shift down. The end result is that each ixNx[] entry should // be larger than the previous -type CellArray = CellArray1 /* sqlite3.c:71365:26 */ +type CellArray = CellArray1 /* sqlite3.c:71865:26 */ // Make sure the cell sizes at idx, idx+1, ..., idx+N-1 have been // computed. -func populateCellCache(tls *libc.TLS, p uintptr, idx int32, N int32) { /* sqlite3.c:71379:13: */ +func populateCellCache(tls *libc.TLS, p uintptr, idx int32, N int32) { /* sqlite3.c:71879:13: */ for N > 0 { @@ -48257,13 +48339,13 @@ func populateCellCache(tls *libc.TLS, p uintptr, idx int32, N int32) { /* sqlite } // Return the size of the Nth element of the cell array -func computeCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71397:28: */ +func computeCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71897:28: */ *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) = (*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer(((*CellArray)(unsafe.Pointer(p)).FpRef + 120 /* &.xCellSize */))))(tls, (*CellArray)(unsafe.Pointer(p)).FpRef, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FapCell + uintptr(N)*8))) return *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) } -func cachedCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71403:12: */ +func cachedCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71903:12: */ if *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) != 0 { return *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) @@ -48282,7 +48364,7 @@ func cachedCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71403: // // The MemPage.nFree field is invalidated by this function. It is the // responsibility of the caller to set it correctly. -func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg uintptr) int32 { /* sqlite3.c:71422:12: */ +func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg uintptr) int32 { /* sqlite3.c:71922:12: */ var hdr int32 = int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset) // Offset of header on pPg var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData // Pointer to data for pPg var usableSize int32 = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize) @@ -48313,12 +48395,12 @@ func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg if (Uptr((pCell)) >= Uptr((aData))) && (Uptr((pCell)) < Uptr((pEnd))) { if (Uptr((pCell + uintptr(sz)))) > Uptr(pEnd) { - return Xsqlite3CorruptError(tls, 71455) + return Xsqlite3CorruptError(tls, 71955) } pCell = (pTmp + uintptr(((int64(pCell) - int64(aData)) / 1))) } else if (Uptr((pCell + uintptr(sz))) > Uptr(pSrcEnd)) && (Uptr((pCell)) < Uptr(pSrcEnd)) { - return Xsqlite3CorruptError(tls, 71460) + return Xsqlite3CorruptError(tls, 71960) } pData -= uintptr(sz) @@ -48326,7 +48408,7 @@ func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*U8)(unsafe.Pointer((pCellptr) + 1)) = (U8((int64(pData) - int64(aData)) / 1)) pCellptr += uintptr(2) if pData < pCellptr { - return Xsqlite3CorruptError(tls, 71466) + return Xsqlite3CorruptError(tls, 71966) } libc.Xmemcpy(tls, pData, pCell, uint64(sz)) @@ -48376,7 +48458,7 @@ func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg // 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 *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr, pCellptr uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:71513:12: */ +func pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr, pCellptr uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:72013:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -48414,7 +48496,7 @@ func pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr, if (Uptr((*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)) + uintptr(sz))) > Uptr(pEnd)) && (Uptr((*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)))) < Uptr(pEnd)) { - Xsqlite3CorruptError(tls, 71552) + Xsqlite3CorruptError(tls, 72052) return 1 } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), uint64(sz)) @@ -48441,7 +48523,7 @@ func pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr, // 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 *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:71578:12: */ +func pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:72078:12: */ var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData var pEnd uintptr = (aData + uintptr((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize)) var pStart uintptr = (aData + uintptr(((int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset) + 8) + int32((*MemPage)(unsafe.Pointer(pPg)).FchildPtrSize)))) @@ -48493,7 +48575,7 @@ func pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArra // // The pPg->nFree field is invalid when this function returns. It is the // responsibility of the caller to set it correctly. -func editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, pCArray uintptr) int32 { /* sqlite3.c:71635:12: */ +func editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, pCArray uintptr) int32 { /* sqlite3.c:72135:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -48527,7 +48609,7 @@ func editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, pC if !(nShift > nCell) { goto __2 } - return Xsqlite3CorruptError(tls, 71661) + return Xsqlite3CorruptError(tls, 72161) __2: ; libc.Xmemmove(tls, (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx, ((*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr((nShift * 2))), (uint64(nCell * 2))) @@ -48661,7 +48743,7 @@ editpage_fail: // 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 *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr) int32 { /* sqlite3.c:71763:12: */ +func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr) int32 { /* sqlite3.c:72263:12: */ bp := tls.Alloc(140) defer tls.Free(140) @@ -48674,7 +48756,7 @@ func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr // Page number of pNew if int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return Xsqlite3CorruptError(tls, 71773) + return Xsqlite3CorruptError(tls, 72273) } // dbfuzz001.test // Allocate a new page. This page will become the right-sibling of @@ -48713,7 +48795,7 @@ func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr // be marked as dirty. Returning an error code will cause a // rollback, undoing any changes made to the parent page. if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { - ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoNew */)), PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+136 /* &rc */) + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoNew */)), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+136 /* &rc */) if int32(*(*U16)(unsafe.Pointer(bp + 24 /* szCell */))) > int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FminLocal) { ptrmapPutOvflPtr(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */)), *(*uintptr)(unsafe.Pointer(bp /* pNew */)), *(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)), bp+136 /* &rc */) } @@ -48770,7 +48852,7 @@ func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr // 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 *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { /* sqlite3.c:71918:13: */ +func copyNodeContent(tls *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { /* sqlite3.c:72418:13: */ if (*(*int32)(unsafe.Pointer(pRC))) == SQLITE_OK { var pBt uintptr = (*MemPage)(unsafe.Pointer(pFrom)).FpBt var aFrom uintptr = (*MemPage)(unsafe.Pointer(pFrom)).FaData @@ -48850,7 +48932,7 @@ func copyNodeContent(tls *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { / // // If aOvflSpace is set to a null pointer, this function returns // SQLITE_NOMEM. -func balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpace uintptr, isRoot int32, bBulk int32) int32 { /* sqlite3.c:72000:12: */ +func balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpace uintptr, isRoot int32, bBulk int32) int32 { /* sqlite3.c:72500:12: */ bp := tls.Alloc(352) defer tls.Free(352) @@ -49013,43 +49095,48 @@ __10: if !(1 != 0) { goto __11 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = getAndInitPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)), (bp + 8 /* &apOld */ + uintptr(i)*8), uintptr(0), 0) - if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { + if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) == SQLITE_OK) { goto __12 } + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = getAndInitPage(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)), (bp + 8 /* &apOld */ + uintptr(i)*8), uintptr(0), 0) +__12: + ; + if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { + goto __13 + } libc.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint64(i + 1)) * uint64(unsafe.Sizeof(uintptr(0))))) goto balance_cleanup -__12: +__13: ; if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*8)))).FnFree < 0) { - goto __13 + goto __14 } *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = btreeComputeFreeSpace(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*8))) if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { - goto __14 + goto __15 } libc.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint64(i)) * uint64(unsafe.Sizeof(uintptr(0))))) goto balance_cleanup +__15: + ; __14: ; -__13: - ; if !((libc.PostDecInt32(&i, 1)) == 0) { - goto __15 + goto __16 } goto __11 -__15: +__16: ; if !(((*MemPage)(unsafe.Pointer(pParent)).FnOverflow != 0) && ((i + nxDiv) == int32(*(*U16)(unsafe.Pointer((pParent + 28 /* &.aiOvfl */)))))) { - goto __16 + goto __17 } *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((pParent + 40 /* &.apOvfl */))) *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)) = Xsqlite3Get4byte(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8))) *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4)) = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pParent + 120 /* &.xCellSize */))))(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)))) (*MemPage)(unsafe.Pointer(pParent)).FnOverflow = U8(0) - goto __17 -__16: + goto __18 +__17: *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)) = ((*MemPage)(unsafe.Pointer((pParent))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pParent))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pParent))).FaCellIdx + uintptr((2 * ((i + nxDiv) - int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow)))))))))))) *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)) = Xsqlite3Get4byte(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8))) *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4)) = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pParent + 120 /* &.xCellSize */))))(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)))) @@ -49067,26 +49154,23 @@ __16: // buffer. It will be copied out again as soon as the aSpace[] buffer // is allocated. if !((int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & BTS_FAST_SECURE) != 0) { - goto __18 - } - - iOff = ((int32(*(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)))) - (int32((*MemPage)(unsafe.Pointer(pParent)).FaData))) - if !((iOff + *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4))) > int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize)) { goto __19 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72130) - libc.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint64(i + 1)) * uint64(unsafe.Sizeof(uintptr(0))))) - goto balance_cleanup - goto __20 -__19: + + // If the following if() condition is not true, the db is corrupted. + // The call to dropCell() below will detect this. + iOff = ((int32(*(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)))) - (int32((*MemPage)(unsafe.Pointer(pParent)).FaData))) + if !((iOff + *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4))) <= int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize)) { + goto __20 + } libc.Xmemcpy(tls, (aOvflSpace + uintptr(iOff)), *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)), uint64(*(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4)))) *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)) = (aOvflSpace + uintptr(((int64(*(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8))) - int64((*MemPage)(unsafe.Pointer(pParent)).FaData)) / 1))) __20: ; -__18: +__19: ; dropCell(tls, pParent, ((i + nxDiv) - int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow)), *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4)), bp+68 /* &rc */) -__17: +__18: ; goto __10 __11: @@ -49146,7 +49230,7 @@ __22: if !(int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pOld)).FaData))) != int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */)))).FaData)))) { goto __25 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72197) + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72697) goto balance_cleanup __25: ; @@ -49174,7 +49258,7 @@ __25: if !(limit < int32(*(*U16)(unsafe.Pointer((pOld + 28 /* &.aiOvfl */))))) { goto __27 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72221) + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72721) goto balance_cleanup __27: ; @@ -49351,7 +49435,7 @@ __52: if !(k > (NB + 2)) { goto __55 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72322) + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72822) goto balance_cleanup __55: ; @@ -49425,7 +49509,7 @@ __65: }())) { goto __67 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72355) + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72855) goto balance_cleanup __67: ; @@ -49498,7 +49582,7 @@ __73: }())) { goto __75 } - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72397) + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72897) goto balance_cleanup __75: ; @@ -49531,11 +49615,17 @@ __76: *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)))).FpDbPage) nNew++ - if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { + if !(Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)))).FpDbPage) != (1 + (libc.Bool32(i == (iParentIdx - nxDiv))))) { goto __81 } - goto balance_cleanup + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72928) __81: + ; + if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { + goto __82 + } + goto balance_cleanup +__82: ; goto __80 __79: @@ -49547,10 +49637,10 @@ __79: return *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)) }(), uint8(0)) if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { - goto __82 + goto __83 } goto balance_cleanup -__82: +__83: ; zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)), pageFlags) *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)) @@ -49559,16 +49649,16 @@ __82: // Set the pointer-map entry for the new sibling page. if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - goto __83 - } - ptrmapPut(tls, pBt, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)))).Fpgno, PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+68 /* &rc */) - if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != SQLITE_OK) { goto __84 } + ptrmapPut(tls, pBt, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)))).Fpgno, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pParent)).Fpgno, bp+68 /* &rc */) + if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != SQLITE_OK) { + goto __85 + } goto balance_cleanup -__84: +__85: ; -__83: +__84: ; __80: ; @@ -49591,19 +49681,19 @@ __78: // When NB==3, this one optimization makes the database about 25% faster // for large insertions and deletions. i = 0 -__85: +__86: if !(i < nNew) { - goto __87 + goto __88 } *(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(i)*4)) = libc.AssignPtrUint32(bp+296 /* &aPgno */ +uintptr(i)*4, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno) *(*U16)(unsafe.Pointer(bp + 316 /* &aPgFlags[0] */ + uintptr(i)*2)) = (*DbPage)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).FpDbPage)).Fflags j = 0 -__88: +__89: if !(j < i) { - goto __90 + goto __91 } if !(*(*Pgno)(unsafe.Pointer(bp + 296 /* &aPgno[0] */ + uintptr(j)*4)) == *(*Pgno)(unsafe.Pointer(bp + 296 /* &aPgno[0] */ + uintptr(i)*4))) { - goto __91 + goto __92 } // This branch is taken if the set of sibling pages somehow contains // duplicate entries. This can happen if the database is corrupt. @@ -49612,69 +49702,69 @@ __88: // cache with two separate objects associated with the same // page number. - *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72471) + *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72974) goto balance_cleanup -__91: +__92: ; - goto __89 -__89: - j++ - goto __88 goto __90 __90: + j++ + goto __89 + goto __91 +__91: ; - goto __86 -__86: - i++ - goto __85 goto __87 __87: + i++ + goto __86 + goto __88 +__88: ; i = 0 -__92: +__93: if !(i < nNew) { - goto __94 + goto __95 } iBest = 0 // aPgno[] index of page number to use j = 1 -__95: +__96: if !(j < nNew) { - goto __97 - } - if !(*(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(j)*4)) < *(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(iBest)*4))) { goto __98 } + if !(*(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(j)*4)) < *(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(iBest)*4))) { + goto __99 + } iBest = j -__98: +__99: ; - goto __96 -__96: - j++ - goto __95 goto __97 __97: + j++ + goto __96 + goto __98 +__98: ; *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)) = *(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(iBest)*4)) *(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(iBest)*4)) = 0xffffffff if !(iBest != i) { - goto __99 - } - if !(iBest > i) { goto __100 } + if !(iBest > i) { + goto __101 + } Xsqlite3PagerRekey(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(iBest)*8)))).FpDbPage, (((*BtShared)(unsafe.Pointer(pBt)).FnPage + U32(iBest)) + U32(1)), uint16(0)) -__100: +__101: ; Xsqlite3PagerRekey(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).FpDbPage, *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)), *(*U16)(unsafe.Pointer(bp + 316 /* &aPgFlags[0] */ + uintptr(iBest)*2))) (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno = *(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)) -__99: +__100: ; - goto __93 -__93: - i++ - goto __92 goto __94 __94: + i++ + goto __93 + goto __95 +__95: ; Xsqlite3Put4byte(tls, pRight, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr((nNew-1))*8)))).Fpgno) @@ -49683,7 +49773,7 @@ __94: // of the right-most new sibling page is set to the value that was // originally in the same field of the right-most old sibling page. if !(((pageFlags & PTF_LEAF) == 0) && (nOld != nNew)) { - goto __101 + goto __102 } pOld1 = *(*uintptr)(unsafe.Pointer(func() uintptr { if nNew > nOld { @@ -49692,7 +49782,7 @@ __94: return bp + 8 /* &apOld[0] */ }() + uintptr((nOld-1))*8)) libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr((nNew-1))*8)))).FaData + 8), ((*MemPage)(unsafe.Pointer(pOld1)).FaData + 8), uint64(4)) -__101: +__102: ; // Make any required updates to pointer map entries associated with @@ -49711,7 +49801,7 @@ __101: // updated. This happens below, after the sibling pages have been // populated, not here. if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - goto __102 + goto __103 } pNew1 = libc.AssignUintptr(&pOld2, *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */))) cntOldNext = (int32((*MemPage)(unsafe.Pointer(pNew1)).FnCell) + int32((*MemPage)(unsafe.Pointer(pNew1)).FnOverflow)) @@ -49719,14 +49809,14 @@ __101: iOld = 0 i = 0 -__103: +__104: if !(i < (*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FnCell) { - goto __105 + goto __106 } pCell = *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FapCell + uintptr(i)*8)) -__106: +__107: if !(i == cntOldNext) { - goto __107 + goto __108 } iOld++ @@ -49736,20 +49826,20 @@ __106: pOld2 = *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(iOld)*8)) } cntOldNext = cntOldNext + ((int32((*MemPage)(unsafe.Pointer(pOld2)).FnCell) + int32((*MemPage)(unsafe.Pointer(pOld2)).FnOverflow)) + libc.BoolInt32(!(leafData != 0))) - goto __106 -__107: + goto __107 +__108: ; if !(i == *(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr(iNew)*4))) { - goto __108 + goto __109 } pNew1 = *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(libc.PreIncInt32(&iNew, 1))*8)) if !(!(leafData != 0)) { - goto __109 + goto __110 } - goto __104 -__109: + goto __105 +__110: ; -__108: +__109: ; // Cell pCell is destined for new sibling page pNew. Originally, it @@ -49761,43 +49851,43 @@ __108: if !(((iOld >= nNew) || ((*MemPage)(unsafe.Pointer(pNew1)).Fpgno != *(*Pgno)(unsafe.Pointer(bp + 296 /* &aPgno[0] */ + uintptr(iOld)*4)))) || !((Uptr((pCell)) >= Uptr(((*MemPage)(unsafe.Pointer(pOld2)).FaData))) && (Uptr((pCell)) < Uptr(((*MemPage)(unsafe.Pointer(pOld2)).FaDataEnd))))) { - goto __110 - } - if !(!(leafCorrection != 0)) { goto __111 } - ptrmapPut(tls, pBt, Xsqlite3Get4byte(tls, pCell), PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pNew1)).Fpgno, bp+68 /* &rc */) -__111: - ; - if !(int32(cachedCellSize(tls, bp+96 /* &b */, i)) > int32((*MemPage)(unsafe.Pointer(pNew1)).FminLocal)) { + if !(!(leafCorrection != 0)) { goto __112 } - ptrmapPutOvflPtr(tls, pNew1, pOld2, pCell, bp+68 /* &rc */) + ptrmapPut(tls, pBt, Xsqlite3Get4byte(tls, pCell), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pNew1)).Fpgno, bp+68 /* &rc */) __112: ; - if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { + if !(int32(cachedCellSize(tls, bp+96 /* &b */, i)) > int32((*MemPage)(unsafe.Pointer(pNew1)).FminLocal)) { goto __113 } - goto balance_cleanup + ptrmapPutOvflPtr(tls, pNew1, pOld2, pCell, bp+68 /* &rc */) __113: ; -__110: + if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { + goto __114 + } + goto balance_cleanup +__114: + ; +__111: ; - goto __104 -__104: - i++ - goto __103 goto __105 __105: + i++ + goto __104 + goto __106 +__106: ; -__102: +__103: ; // Insert new divider cells into pParent. i = 0 -__114: +__115: if !(i < (nNew - 1)) { - goto __116 + goto __117 } pNew2 = *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)) j = *(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr(i)*4)) @@ -49806,21 +49896,21 @@ __114: sz2 = (int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FszCell + uintptr(j)*2))) + int32(leafCorrection)) pTemp1 = (aOvflSpace + uintptr(iOvflSpace)) if !(!(int32((*MemPage)(unsafe.Pointer(pNew2)).Fleaf) != 0)) { - goto __117 + goto __118 } libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pNew2)).FaData + 8), pCell1, uint64(4)) - goto __118 -__117: + goto __119 +__118: if !(leafData != 0) { - goto __119 + goto __120 } j-- (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pNew2 + 128 /* &.xParseCell */))))(tls, pNew2, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FapCell + uintptr(j)*8)), bp+328 /* &info */) pCell1 = pTemp1 sz2 = (4 + Xsqlite3PutVarint(tls, (pCell1+4), uint64((*CellInfo)(unsafe.Pointer(bp+328 /* &info */)).FnKey))) pTemp1 = uintptr(0) - goto __120 -__119: + goto __121 +__120: pCell1 -= uintptr(4) // Obscure case for non-leaf-data trees: If the cell at pCell was // previously stored on a leaf node, and its reported size was 4 @@ -49833,32 +49923,32 @@ __119: // and WITHOUT ROWID tables with exactly one column which is the // primary key. if !(int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FszCell + uintptr(j)*2))) == 4) { - goto __121 + goto __122 } sz2 = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pParent + 120 /* &.xCellSize */))))(tls, pParent, pCell1)) +__122: + ; __121: ; -__120: - ; -__118: +__119: ; iOvflSpace = iOvflSpace + (sz2) insertCell(tls, pParent, (nxDiv + i), pCell1, sz2, pTemp1, (*MemPage)(unsafe.Pointer(pNew2)).Fpgno, bp+68 /* &rc */) if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != SQLITE_OK) { - goto __122 + goto __123 } goto balance_cleanup -__122: +__123: ; - goto __115 -__115: - i++ - goto __114 goto __116 __116: + i++ + goto __115 + goto __117 +__117: ; // Now update the actual sibling pages. The order in which they are updated @@ -49883,9 +49973,9 @@ __116: // upwards pass simply processes pages that were missed on the downward // pass. i = (1 - nNew) -__123: +__124: if !(i < nNew) { - goto __125 + goto __126 } if i < 0 { iPg = -i @@ -49894,14 +49984,14 @@ __123: } if !(*(*U8)(unsafe.Pointer(bp /* &abDone[0] */ + uintptr(iPg))) != 0) { - goto __126 + goto __127 } - goto __124 -__126: + goto __125 +__127: ; // Skip pages already processed if !((i >= 0) || // On the upwards pass, or... (*(*int32)(unsafe.Pointer(bp + 72 /* &cntOld[0] */ + uintptr((iPg-1))*4)) >= *(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr((iPg-1))*4)))) { - goto __127 + goto __128 } // Verify condition (1): If cells are moving left, update iPg @@ -49911,12 +50001,12 @@ __126: // only after iPg+1 has already been updated. if !(iPg == 0) { - goto __128 + goto __129 } iNew1 = libc.AssignInt32(&iOld1, 0) nNewCell = *(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */)) - goto __129 -__128: + goto __130 +__129: if iPg < nOld { iOld1 = (*(*int32)(unsafe.Pointer(bp + 72 /* &cntOld[0] */ + uintptr((iPg-1))*4)) + libc.BoolInt32(!(leafData != 0))) } else { @@ -49924,33 +50014,33 @@ __128: } iNew1 = (*(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr((iPg-1))*4)) + libc.BoolInt32(!(leafData != 0))) nNewCell = (*(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr(iPg)*4)) - iNew1) -__129: +__130: ; *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = editPage(tls, *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(iPg)*8)), iOld1, iNew1, nNewCell, bp+96 /* &b */) if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) { - goto __130 + goto __131 } goto balance_cleanup -__130: +__131: ; *(*U8)(unsafe.Pointer(bp /* &abDone[0] */ + uintptr(iPg)))++ (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(iPg)*8)))).FnFree = (usableSpace - *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(iPg)*4))) -__127: +__128: ; - goto __124 -__124: - i++ - goto __123 goto __125 __125: + i++ + goto __124 + goto __126 +__126: ; // All pages have been processed exactly once if !(((isRoot != 0) && (int32((*MemPage)(unsafe.Pointer(pParent)).FnCell) == 0)) && (int32((*MemPage)(unsafe.Pointer(pParent)).FhdrOffset) <= (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */)))).FnFree)) { - goto __131 + goto __132 } // The root page of the b-tree now contains no cells. The only sibling // page is the right-child of the parent. Copy the contents of the @@ -49971,76 +50061,76 @@ __125: copyNodeContent(tls, *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */)), pParent, bp+68 /* &rc */) freePage(tls, *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */)), bp+68 /* &rc */) - goto __132 -__131: + goto __133 +__132: if !(((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && !(leafCorrection != 0)) { - goto __133 + goto __134 } // Fix the pointer map entries associated with the right-child of each // sibling page. All other pointer map entries have already been taken // care of. i = 0 -__134: +__135: if !(i < nNew) { - goto __136 + goto __137 } key = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).FaData + 8)) - ptrmapPut(tls, pBt, key, PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno, bp+68 /* &rc */) - goto __135 -__135: - i++ - goto __134 + ptrmapPut(tls, pBt, key, uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno, bp+68 /* &rc */) goto __136 __136: + i++ + goto __135 + goto __137 +__137: + ; +__134: ; __133: ; -__132: - ; // Free any old pages that were not reused as new pages. i = nNew -__137: +__138: if !(i < nOld) { - goto __139 + goto __140 } freePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*8)), bp+68 /* &rc */) - goto __138 -__138: - i++ - goto __137 goto __139 __139: + i++ + goto __138 + goto __140 +__140: ; // Cleanup before returning. balance_cleanup: Xsqlite3DbFree(tls, uintptr(0), (*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FapCell) i = 0 -__140: +__141: if !(i < nOld) { - goto __142 + goto __143 } releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*8))) - goto __141 -__141: - i++ - goto __140 goto __142 __142: + i++ + goto __141 + goto __143 +__143: ; i = 0 -__143: +__144: if !(i < nNew) { - goto __145 + goto __146 } releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8))) - goto __144 -__144: - i++ - goto __143 goto __145 __145: + i++ + goto __144 + goto __146 +__146: ; return *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) @@ -50063,7 +50153,7 @@ __145: // 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 *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sqlite3.c:72786:12: */ +func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sqlite3.c:73289:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -50081,7 +50171,7 @@ func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sq *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = allocateBtreePage(tls, pBt, bp /* &pChild */, bp+8 /* &pgnoChild */, (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, uint8(0)) copyNodeContent(tls, pRoot, *(*uintptr)(unsafe.Pointer(bp /* pChild */)), bp+12 /* &rc */) if (*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { - ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoChild */)), PTRMAP_BTREE, (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, bp+12 /* &rc */) + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoChild */)), uint8(PTRMAP_BTREE), (*MemPage)(unsafe.Pointer(pRoot)).Fpgno, bp+12 /* &rc */) } } if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != 0 { @@ -50114,13 +50204,13 @@ func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sq // table linked to the same b-tree. If the secondary insert causes a // rebalance, that can change content out from under the cursor on the // first SQL table, violating invariants on the first insert. -func anotherValidCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:72844:12: */ +func anotherValidCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:73347:12: */ var pOther uintptr for pOther = (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpCursor; pOther != 0; pOther = (*BtCursor)(unsafe.Pointer(pOther)).FpNext { if ((pOther != pCur) && (int32((*BtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID)) && ((*BtCursor)(unsafe.Pointer(pOther)).FpPage == (*BtCursor)(unsafe.Pointer(pCur)).FpPage) { - return Xsqlite3CorruptError(tls, 72851) + return Xsqlite3CorruptError(tls, 73354) } } return SQLITE_OK @@ -50134,7 +50224,7 @@ func anotherValidCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:72844: // balance_quick() // balance_deeper() // balance_nonroot() -func balance(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:72867:12: */ +func balance(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:73370:12: */ bp := tls.Alloc(13) defer tls.Free(13) @@ -50253,7 +50343,7 @@ func balance(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:72867:12: */ // Overwrite content from pX into pDest. Only do the write if the // content is different from what is already there. -func btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uintptr, iOffset int32, iAmt int32) int32 { /* sqlite3.c:72993:12: */ +func btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uintptr, iOffset int32, iAmt int32) int32 { /* sqlite3.c:73496:12: */ var nData int32 = ((*BtreePayload)(unsafe.Pointer(pX)).FnData - iOffset) if nData <= 0 { // Overwritting with zeros @@ -50295,7 +50385,7 @@ func btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uintp // Overwrite the cell that cursor pCur is pointing to with fresh content // contained in pX. -func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqlite3.c:73036:12: */ +func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqlite3.c:73539:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -50309,7 +50399,7 @@ func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqli if (((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload + uintptr((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)) > (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaDataEnd) || ((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData + uintptr((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FcellOffset))) { - return Xsqlite3CorruptError(tls, 73048) + return Xsqlite3CorruptError(tls, 73551) } // Overwrite the local portion first rc = btreeOverwriteContent(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)), (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload, pX, @@ -50333,7 +50423,7 @@ func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqli return rc } if Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage) != 1 { - rc = Xsqlite3CorruptError(tls, 73067) + rc = Xsqlite3CorruptError(tls, 73570) } else { if (U32(iOffset) + ovflPageSize) < U32(nTotal) { ovflPgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData) @@ -50380,15 +50470,15 @@ func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqli // 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 Xsqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, seekResult int32) int32 { /* sqlite3.c:73115:20: */ - bp := tls.Alloc(116) - defer tls.Free(116) +func Xsqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, seekResult int32) int32 { /* sqlite3.c:73618:20: */ + bp := tls.Alloc(136) + defer tls.Free(136) - // var rc int32 at bp+112, 4 + // var rc int32 at bp+104, 4 // var loc int32 at bp, 4 // -1: before desired location +1: after - // var szNew int32 at bp+80, 4 + // var szNew int32 at bp+108, 4 var idx int32 var pPage uintptr @@ -50400,9 +50490,12 @@ func Xsqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s // var x2 BtreePayload at bp+32, 48 - // var info CellInfo at bp+88, 24 + var ovfl Pgno + // var info CellInfo at bp+80, 24 + + // var info1 CellInfo at bp+112, 24 *(*int32)(unsafe.Pointer(bp /* loc */)) = seekResult - *(*int32)(unsafe.Pointer(bp + 80 /* szNew */)) = 0 + *(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) = 0 p = (*BtCursor)(unsafe.Pointer(pCur)).FpBtree pBt = (*Btree)(unsafe.Pointer(p)).FpBt newCell = uintptr(0) @@ -50434,11 +50527,11 @@ __1: if !((int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags) & BTCF_Multiple) != 0) { goto __2 } - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = saveAllCursors(tls, pBt, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur) - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = saveAllCursors(tls, pBt, (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot, pCur) + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { goto __3 } - return *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) + return *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) __3: ; __2: @@ -50481,11 +50574,11 @@ __6: // The cursor is *not* pointing to the cell to be overwritten, nor // to an adjacent cell. Move the cursor so that it is pointing either // to the cell to be overwritten or an adjacent cell. - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, uintptr(0), (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (libc.Bool32(flags != 0)), bp /* &loc */) - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, uintptr(0), (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (libc.Bool32(flags != 0)), bp /* &loc */) + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { goto __10 } - return *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) + return *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) __10: ; __9: @@ -50518,16 +50611,16 @@ __4: (*UnpackedRecord)(unsafe.Pointer(bp + 8 /* &r */)).Fr1 = int8(0) (*UnpackedRecord)(unsafe.Pointer(bp + 8 /* &r */)).Fr2 = int8(0) (*UnpackedRecord)(unsafe.Pointer(bp + 8 /* &r */)).FeqSeen = U8(0) - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, bp+8 /* &r */, int64(0), (libc.Bool32(flags != 0)), bp /* &loc */) + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, bp+8 /* &r */, int64(0), (libc.Bool32(flags != 0)), bp /* &loc */) goto __13 __12: - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = btreeMoveto(tls, pCur, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (libc.Bool32(flags != 0)), bp /* &loc */) + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = btreeMoveto(tls, pCur, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (libc.Bool32(flags != 0)), bp /* &loc */) __13: ; - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { goto __14 } - return *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) + return *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) __14: ; __11: @@ -50563,16 +50656,16 @@ __5: if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) > CURSOR_INVALID) { goto __18 } - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3CorruptError(tls, 73263) + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = Xsqlite3CorruptError(tls, 73767) goto __19 __18: - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = btreeComputeFreeSpace(tls, pPage) + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = btreeComputeFreeSpace(tls, pPage) __19: ; - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { goto __20 } - return *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) + return *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) __20: ; __17: @@ -50580,39 +50673,67 @@ __17: newCell = (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = fillInCell(tls, pPage, newCell, pX, bp+80 /* &szNew */) - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { + if !((flags & BTREE_PREFORMAT) != 0) { goto __21 } - goto end_insert + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) = (*BtShared)(unsafe.Pointer(pBt)).FnPreformatSize + if !(*(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) < 4) { + goto __23 + } + *(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) = 4 +__23: + ; + if !(((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) > int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal))) { + goto __24 + } + (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, newCell, bp+80 /* &info */) + if !((*CellInfo)(unsafe.Pointer(bp+80 /* &info */)).FnPayload != U32((*CellInfo)(unsafe.Pointer(bp+80 /* &info */)).FnLocal)) { + goto __25 + } + ovfl = Xsqlite3Get4byte(tls, (newCell + uintptr((*(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) - 4)))) + ptrmapPut(tls, pBt, ovfl, uint8(PTRMAP_OVERFLOW1), (*MemPage)(unsafe.Pointer(pPage)).Fpgno, bp+104 /* &rc */) +__25: + ; +__24: + ; + goto __22 __21: + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = fillInCell(tls, pPage, newCell, pX, bp+108 /* &szNew */) +__22: + ; + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { + goto __26 + } + goto end_insert +__26: ; idx = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) if !(*(*int32)(unsafe.Pointer(bp /* loc */)) == 0) { - goto __22 + goto __27 } - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage) - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { - goto __24 + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage) + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { + goto __29 } goto end_insert -__24: +__29: ; oldCell = ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (idx))))))))))) if !(!(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0)) { - goto __25 + goto __30 } libc.Xmemcpy(tls, newCell, oldCell, uint64(4)) -__25: +__30: ; - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = clearCell(tls, pPage, oldCell, bp+88 /* &info */) + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = clearCell(tls, pPage, oldCell, bp+112 /* &info1 */) *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_ValidOvfl))) - if !(((int32((*CellInfo)(unsafe.Pointer(bp+88 /* &info */)).FnSize) == *(*int32)(unsafe.Pointer(bp + 80 /* szNew */))) && (U32((*CellInfo)(unsafe.Pointer(bp+88 /* &info */)).FnLocal) == (*CellInfo)(unsafe.Pointer(bp+88 /* &info */)).FnPayload)) && - (!(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0) || (*(*int32)(unsafe.Pointer(bp + 80 /* szNew */)) < int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)))) { - goto __26 + if !(((int32((*CellInfo)(unsafe.Pointer(bp+112 /* &info1 */)).FnSize) == *(*int32)(unsafe.Pointer(bp + 108 /* szNew */))) && (U32((*CellInfo)(unsafe.Pointer(bp+112 /* &info1 */)).FnLocal) == (*CellInfo)(unsafe.Pointer(bp+112 /* &info1 */)).FnPayload)) && + (!(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0) || (*(*int32)(unsafe.Pointer(bp + 108 /* szNew */)) < int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)))) { + goto __31 } // Overwrite the old cell with the new if they are the same size. // We could also try to do this if the old cell is smaller, then add @@ -50625,44 +50746,44 @@ __25: // necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. // clearCell never fails when nLocal==nPayload if !(oldCell < (((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)) + uintptr(10))) { - goto __27 + goto __32 } - return Xsqlite3CorruptError(tls, 73309) -__27: + return Xsqlite3CorruptError(tls, 73827) +__32: ; - if !((oldCell + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* szNew */)))) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd) { - goto __28 + if !((oldCell + uintptr(*(*int32)(unsafe.Pointer(bp + 108 /* szNew */)))) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd) { + goto __33 } - return Xsqlite3CorruptError(tls, 73312) -__28: + return Xsqlite3CorruptError(tls, 73830) +__33: ; - libc.Xmemcpy(tls, oldCell, newCell, uint64(*(*int32)(unsafe.Pointer(bp + 80 /* szNew */)))) + libc.Xmemcpy(tls, oldCell, newCell, uint64(*(*int32)(unsafe.Pointer(bp + 108 /* szNew */)))) return SQLITE_OK -__26: +__31: ; - dropCell(tls, pPage, idx, int32((*CellInfo)(unsafe.Pointer(bp+88 /* &info */)).FnSize), bp+112 /* &rc */) - if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) { - goto __29 + dropCell(tls, pPage, idx, int32((*CellInfo)(unsafe.Pointer(bp+112 /* &info1 */)).FnSize), bp+104 /* &rc */) + if !(*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0) { + goto __34 } goto end_insert -__29: +__34: ; - goto __23 -__22: + goto __28 +__27: if !((*(*int32)(unsafe.Pointer(bp /* loc */)) < 0) && (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) > 0)) { - goto __30 + goto __35 } idx = int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1)) *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_ValidNKey))) - goto __31 -__30: + goto __36 +__35: ; -__31: +__36: ; -__23: +__28: ; - insertCell(tls, pPage, idx, newCell, *(*int32)(unsafe.Pointer(bp + 80 /* szNew */)), uintptr(0), uint32(0), bp+112 /* &rc */) + insertCell(tls, pPage, idx, newCell, *(*int32)(unsafe.Pointer(bp + 108 /* szNew */)), uintptr(0), uint32(0), bp+104 /* &rc */) // If no error has occurred and pPage has an overflow cell, call balance() // to redistribute the cells within the tree. Since balance() may move @@ -50685,47 +50806,177 @@ __23: // row without seeking the cursor. This can be a big performance boost. (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0) if !((*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0) { - goto __32 + goto __37 } *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((libc.CplInt32(BTCF_ValidNKey))) - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = balance(tls, pCur) + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = balance(tls, pCur) // Must make sure nOverflow is reset to zero even if the balance() // fails. Internal data structure corruption will result otherwise. // Also, set the cursor state to invalid. This stops saveCursorPosition() // from trying to save the current position of the cursor. (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnOverflow = U8(0) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_INVALID - if !(((flags & BTREE_SAVEPOSITION) != 0) && (*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) == SQLITE_OK)) { - goto __33 + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_INVALID) + if !(((flags & BTREE_SAVEPOSITION) != 0) && (*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) == SQLITE_OK)) { + goto __38 } btreeReleaseAllCursorPages(tls, pCur) if !((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo != 0) { - goto __34 + goto __39 } (*BtCursor)(unsafe.Pointer(pCur)).FpKey = Xsqlite3Malloc(tls, uint64((*BtreePayload)(unsafe.Pointer(pX)).FnKey)) if !((*BtCursor)(unsafe.Pointer(pCur)).FpKey == uintptr(0)) { - goto __35 + goto __40 } - *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = SQLITE_NOMEM - goto __36 -__35: + *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = SQLITE_NOMEM + goto __41 +__40: libc.Xmemcpy(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, uint64((*BtreePayload)(unsafe.Pointer(pX)).FnKey)) -__36: +__41: ; -__34: +__39: ; - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_REQUIRESEEK + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK) (*BtCursor)(unsafe.Pointer(pCur)).FnKey = (*BtreePayload)(unsafe.Pointer(pX)).FnKey -__33: +__38: ; -__32: +__37: ; end_insert: - return *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) + return *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) +} + +// This function is used as part of copying the current row from cursor +// pSrc into cursor pDest. If the cursors are open on intkey tables, then +// parameter iKey is used as the rowid value when the record is copied +// into pDest. Otherwise, the record is copied verbatim. +// +// This function does not actually write the new value to cursor pDest. +// Instead, it creates and populates any required overflow pages and +// writes the data for the new cell into the BtShared.pTmpSpace buffer +// for the destination database. The size of the cell, in bytes, is left +// in BtShared.nPreformatSize. The caller completes the insertion by +// calling sqlite3BtreeInsert() with the BTREE_PREFORMAT flag specified. +// +// SQLITE_OK is returned if successful, or an SQLite error code otherwise. +func Xsqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey I64) int32 { /* sqlite3.c:73916:20: */ + bp := tls.Alloc(24) + defer tls.Free(24) + + *(*int32)(unsafe.Pointer(bp + 20 /* rc */)) = SQLITE_OK + var pBt uintptr = (*BtCursor)(unsafe.Pointer(pDest)).FpBt + var aOut uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace // Pointer to next output buffer + var aIn uintptr // Pointer to next input buffer + var nIn U32 // Size of input buffer aIn[] + var nRem U32 // Bytes of data still to copy + + getCellInfo(tls, pSrc) + aOut += uintptr(func() uint8 { + if ((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload) < U32(0x80) { + return uint8(func() int32 { + *(*U8)(unsafe.Pointer(aOut)) = uint8((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload) + return 1 + }()) + } + return uint8(Xsqlite3PutVarint(tls, aOut, uint64((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) + }()) + if (*BtCursor)(unsafe.Pointer(pDest)).FpKeyInfo == uintptr(0) { + aOut += uintptr(Xsqlite3PutVarint(tls, aOut, uint64(iKey))) + } + nIn = U32((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) + aIn = (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload + if (aIn + uintptr(nIn)) > (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { + return Xsqlite3CorruptError(tls, 73930) + } + nRem = (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload + if (nIn == nRem) && (nIn < U32((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal)) { + libc.Xmemcpy(tls, aOut, aIn, uint64(nIn)) + (*BtShared)(unsafe.Pointer(pBt)).FnPreformatSize = (int32(int64(nIn) + ((int64(aOut) - int64((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) / 1))) + } else { + var pSrcPager uintptr = (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpBt)).FpPager + var pPgnoOut uintptr = uintptr(0) + var ovflIn Pgno = Pgno(0) + *(*uintptr)(unsafe.Pointer(bp /* pPageIn */)) = uintptr(0) + var pPageOut uintptr = uintptr(0) + var nOut U32 // Size of output buffer aOut[] + + nOut = U32(btreePayloadToLocal(tls, (*BtCursor)(unsafe.Pointer(pDest)).FpPage, int64((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) + (*BtShared)(unsafe.Pointer(pBt)).FnPreformatSize = (int32(int64(nOut) + ((int64(aOut) - int64((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) / 1))) + if nOut < (*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { + pPgnoOut = (aOut + uintptr(nOut)) + *(*int32)(unsafe.Pointer(pBt + 144 /* &.nPreformatSize */)) += (4) + } + + if nRem > nIn { + if ((aIn + uintptr(nIn)) + uintptr(4)) > (*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { + return Xsqlite3CorruptError(tls, 73953) + } + ovflIn = Xsqlite3Get4byte(tls, ((*BtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload + uintptr(nIn))) + } + + for ok := true; ok; ok = ((nRem > U32(0)) && (*(*int32)(unsafe.Pointer(bp + 20 /* rc */)) == SQLITE_OK)) { + nRem = nRem - (nOut) + for ok1 := true; ok1; ok1 = ((*(*int32)(unsafe.Pointer(bp + 20 /* rc */)) == SQLITE_OK) && (nOut > U32(0))) { + + if nIn > U32(0) { + var nCopy int32 = func() int32 { + if (nOut) < (nIn) { + return int32(nOut) + } + return int32(nIn) + }() + libc.Xmemcpy(tls, aOut, aIn, uint64(nCopy)) + nOut = nOut - (U32(nCopy)) + nIn = nIn - (U32(nCopy)) + aOut += uintptr(nCopy) + aIn += uintptr(nCopy) + } + if nOut > U32(0) { + Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pPageIn */))) + *(*uintptr)(unsafe.Pointer(bp /* pPageIn */)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 20 /* rc */)) = Xsqlite3PagerGet(tls, pSrcPager, ovflIn, bp /* &pPageIn */, PAGER_GET_READONLY) + if *(*int32)(unsafe.Pointer(bp + 20 /* rc */)) == SQLITE_OK { + aIn = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp /* pPageIn */))) + ovflIn = Xsqlite3Get4byte(tls, aIn) + aIn += uintptr(4) + nIn = ((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pSrc)).FpBt)).FusableSize - U32(4)) + } + } + } + + if (*(*int32)(unsafe.Pointer(bp + 20 /* rc */)) == SQLITE_OK) && (nRem > U32(0)) { + // var pgnoNew Pgno at bp+16, 4 + + *(*uintptr)(unsafe.Pointer(bp + 8 /* pNew */)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 20 /* rc */)) = allocateBtreePage(tls, pBt, bp+8 /* &pNew */, bp+16 /* &pgnoNew */, uint32(0), uint8(0)) + Xsqlite3Put4byte(tls, pPgnoOut, *(*Pgno)(unsafe.Pointer(bp + 16 /* pgnoNew */))) + if ((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (pPageOut != 0) { + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp + 16 /* pgnoNew */)), uint8(PTRMAP_OVERFLOW2), (*MemPage)(unsafe.Pointer(pPageOut)).Fpgno, bp+20 /* &rc */) + } + releasePage(tls, pPageOut) + pPageOut = *(*uintptr)(unsafe.Pointer(bp + 8 /* pNew */)) + if pPageOut != 0 { + pPgnoOut = (*MemPage)(unsafe.Pointer(pPageOut)).FaData + Xsqlite3Put4byte(tls, pPgnoOut, uint32(0)) + aOut = (pPgnoOut + 4) + nOut = func() uint32 { + if ((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)) < (nRem) { + return ((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4)) + } + return nRem + }() + } + } + } + + releasePage(tls, pPageOut) + Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pPageIn */))) + } + + return *(*int32)(unsafe.Pointer(bp + 20 /* rc */)) } // Delete the entry that the cursor is pointing to. @@ -50743,7 +50994,7 @@ end_insert: // 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 Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlite3.c:73400:20: */ +func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlite3.c:74026:20: */ bp := tls.Alloc(28) defer tls.Free(28) @@ -50866,7 +51117,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit } pCell = ((*MemPage)(unsafe.Pointer((pLeaf))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pLeaf))).FmaskPage) & int32(libc.X__builtin_bswap16(tls, *(*U16)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pLeaf))).FaCellIdx + uintptr((2 * (int32((*MemPage)(unsafe.Pointer(pLeaf)).FnCell) - 1))))))))))) if pCell < ((*MemPage)(unsafe.Pointer(pLeaf)).FaData + 4) { - return Xsqlite3CorruptError(tls, 73510) + return Xsqlite3CorruptError(tls, 74136) } nCell = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pLeaf + 120 /* &.xCellSize */))))(tls, pLeaf, pCell)) @@ -50911,7 +51162,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_OK { if bSkipnext != 0 { - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_SKIPNEXT + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_SKIPNEXT) if iCellIdx >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) { (*BtCursor)(unsafe.Pointer(pCur)).FskipNext = -1 (*BtCursor)(unsafe.Pointer(pCur)).Fix = (U16(int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1)) @@ -50922,7 +51173,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = moveToRoot(tls, pCur) if bPreserve != 0 { btreeReleaseAllCursorPages(tls, pCur) - (*BtCursor)(unsafe.Pointer(pCur)).FeState = CURSOR_REQUIRESEEK + (*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(CURSOR_REQUIRESEEK) } if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == SQLITE_EMPTY { *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = SQLITE_OK @@ -50941,7 +51192,7 @@ func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlit // // BTREE_INTKEY|BTREE_LEAFDATA Used for SQL tables with rowid keys // BTREE_ZERODATA Used for SQL indices -func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags int32) int32 { /* sqlite3.c:73584:12: */ +func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags int32) int32 { /* sqlite3.c:74210:12: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -50971,7 +51222,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags // created so far, so the new root-page is (meta[3]+1). Xsqlite3BtreeGetMeta(tls, p, BTREE_LARGEST_ROOT_PAGE, bp /* &pgnoRoot */) if *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)) > btreePagecount(tls, pBt) { - return Xsqlite3CorruptError(tls, 73618) + return Xsqlite3CorruptError(tls, 74244) } *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */))++ @@ -50984,7 +51235,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags // Allocate a page. The page that currently resides at pgnoRoot will // be moved to the allocated page (unless the allocated page happens // to reside at pgnoRoot). - *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = allocateBtreePage(tls, pBt, bp+8 /* &pPageMove */, bp+16 /* &pgnoMove */, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), BTALLOC_EXACT) + *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = allocateBtreePage(tls, pBt, bp+8 /* &pPageMove */, bp+16 /* &pgnoMove */, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), uint8(BTALLOC_EXACT)) if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } @@ -51014,7 +51265,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = ptrmapGet(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), bp+32 /* &eType */, bp+36 /* &iPtrPage */) if (int32(*(*U8)(unsafe.Pointer(bp + 32 /* eType */))) == PTRMAP_ROOTPAGE) || (int32(*(*U8)(unsafe.Pointer(bp + 32 /* eType */))) == PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = Xsqlite3CorruptError(tls, 73666) + *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = Xsqlite3CorruptError(tls, 74292) } if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != SQLITE_OK { releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */))) @@ -51042,7 +51293,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } // Update the pointer-map and meta-data with the new root-page number. - ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), PTRMAP_ROOTPAGE, uint32(0), bp+40 /* &rc */) + ptrmapPut(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), uint8(PTRMAP_ROOTPAGE), uint32(0), bp+40 /* &rc */) if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != 0 { releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */))) return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) @@ -51077,7 +51328,7 @@ func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags return SQLITE_OK } -func Xsqlite3BtreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, flags int32) int32 { /* sqlite3.c:73729:20: */ +func Xsqlite3BtreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, flags int32) int32 { /* sqlite3.c:74355:20: */ var rc int32 Xsqlite3BtreeEnter(tls, p) rc = btreeCreateTable(tls, p, piTable, flags) @@ -51087,7 +51338,7 @@ func Xsqlite3BtreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, flags i // Erase the given database page and all its children. Return // the page to the freelist. -func clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno Pgno, freePageFlag int32, pnChange uintptr) int32 { /* sqlite3.c:73741:12: */ +func clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno Pgno, freePageFlag int32, pnChange uintptr) int32 { /* sqlite3.c:74367:12: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -51103,7 +51354,7 @@ func clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno Pgno, freePageFlag int32 if !(pgno > btreePagecount(tls, pBt)) { goto __1 } - return Xsqlite3CorruptError(tls, 73756) + return Xsqlite3CorruptError(tls, 74382) __1: ; *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = getAndInitPage(tls, pBt, pgno, bp /* &pPage */, uintptr(0), 0) @@ -51116,7 +51367,7 @@ __2: if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FbBusy != 0) { goto __3 } - *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3CorruptError(tls, 73761) + *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3CorruptError(tls, 74387) goto cleardatabasepage_out __3: ; @@ -51207,7 +51458,7 @@ cleardatabasepage_out: // 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 Xsqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange uintptr) int32 { /* sqlite3.c:73808:20: */ +func Xsqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange uintptr) int32 { /* sqlite3.c:74434:20: */ var rc int32 var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) @@ -51228,7 +51479,7 @@ func Xsqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange ui // Delete all information from the single table that pCur is open on. // // This routine only work for pCur on an ephemeral table. -func Xsqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:73832:20: */ +func Xsqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:74458:20: */ return Xsqlite3BtreeClearTable(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree, int32((*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot), uintptr(0)) } @@ -51250,7 +51501,7 @@ func Xsqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) int32 { /* sql // 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 *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int32 { /* sqlite3.c:73856:12: */ +func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int32 { /* sqlite3.c:74482:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -51260,7 +51511,7 @@ func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int3 var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt if iTable > btreePagecount(tls, pBt) { - return Xsqlite3CorruptError(tls, 73865) + return Xsqlite3CorruptError(tls, 74491) } *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = btreeGetPage(tls, pBt, iTable, bp /* &pPage */, 0) @@ -51299,7 +51550,7 @@ func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int3 if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) } - *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 16 /* pMove */)), PTRMAP_ROOTPAGE, uint32(0), iTable, 0) + *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 16 /* pMove */)), uint8(PTRMAP_ROOTPAGE), uint32(0), iTable, 0) releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pMove */))) if *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) @@ -51332,7 +51583,7 @@ func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int3 return *(*int32)(unsafe.Pointer(bp + 12 /* rc */)) } -func Xsqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uintptr) int32 { /* sqlite3.c:73941:20: */ +func Xsqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uintptr) int32 { /* sqlite3.c:74567:20: */ var rc int32 Xsqlite3BtreeEnter(tls, p) rc = btreeDropTable(tls, p, uint32(iTable), piMoved) @@ -51358,7 +51609,7 @@ func Xsqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uint // 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 Xsqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr) { /* sqlite3.c:73970:21: */ +func Xsqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr) { /* sqlite3.c:74596:21: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) @@ -51377,7 +51628,7 @@ func Xsqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr) { // Write meta-information back into the database. Meta[0] is // read-only and may not be written. -func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int32 { /* sqlite3.c:74000:20: */ +func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int32 { /* sqlite3.c:74626:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt var pP1 uintptr var rc int32 @@ -51403,7 +51654,7 @@ func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int // 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 Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr) int32 { /* sqlite3.c:74032:20: */ +func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr) int32 { /* sqlite3.c:74658:20: */ var nEntry I64 = int64(0) // Value to return in *pnEntry var rc int32 // Return code @@ -51415,7 +51666,7 @@ func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr // Unless an error occurs, the following loop runs one iteration for each // page in the B-Tree structure (not including overflow pages). - for (rc == SQLITE_OK) && !(libc.AtomicLoadNInt32((db+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { + for (rc == SQLITE_OK) && !(libc.AtomicLoadNInt32((db+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { var iIdx int32 // Index of child node in parent var pPage uintptr // Current page of the b-tree @@ -51466,12 +51717,12 @@ func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr // Return the pager associated with a BTree. This routine is used for // testing and debugging only. -func Xsqlite3BtreePager(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:74101:22: */ +func Xsqlite3BtreePager(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:74727:22: */ return (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager } // Append a message to the error message string. -func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:74109:13: */ +func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:74735:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -51484,7 +51735,7 @@ func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*IntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, (pCheck + 56 /* &.errMsg */), ts+5715 /* "\n" */, 1) + Xsqlite3_str_append(tls, (pCheck + 56 /* &.errMsg */), ts+5791 /* "\n" */, 1) } if (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, (pCheck + 56 /* &.errMsg */), (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -51498,13 +51749,13 @@ func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) // Return non-zero if the bit in the IntegrityCk.aPgRef[] array that // corresponds to page iPg is already set. -func getPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) int32 { /* sqlite3.c:74139:12: */ +func getPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) int32 { /* sqlite3.c:74765:12: */ return (int32(*(*U8)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr((iPg / Pgno(8)))))) & (int32(1) << (iPg & Pgno(0x07)))) } // Set the bit in the IntegrityCk.aPgRef[] array that corresponds to page iPg. -func setPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) { /* sqlite3.c:74147:13: */ +func setPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) { /* sqlite3.c:74773:13: */ *(*U8)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr((iPg / Pgno(8))))) |= U8((int32(1) << (iPg & Pgno(0x07)))) } @@ -51515,19 +51766,19 @@ func setPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) { /* sqlite3.c:7 // if this is the first reference to the page. // // Also check that the page number is in bounds. -func checkRef(tls *libc.TLS, pCheck uintptr, iPage Pgno) int32 { /* sqlite3.c:74161:12: */ +func checkRef(tls *libc.TLS, pCheck uintptr, iPage Pgno) int32 { /* sqlite3.c:74787:12: */ bp := tls.Alloc(16) defer tls.Free(16) if (iPage > (*IntegrityCk)(unsafe.Pointer(pCheck)).FnPage) || (iPage == Pgno(0)) { - checkAppendMsg(tls, pCheck, ts+5717 /* "invalid page num..." */, libc.VaList(bp, iPage)) + checkAppendMsg(tls, pCheck, ts+5793 /* "invalid page num..." */, libc.VaList(bp, iPage)) return 1 } if getPageReferenced(tls, pCheck, iPage) != 0 { - checkAppendMsg(tls, pCheck, ts+5740 /* "2nd reference to..." */, libc.VaList(bp+8, iPage)) + checkAppendMsg(tls, pCheck, ts+5816 /* "2nd reference to..." */, libc.VaList(bp+8, iPage)) return 1 } - if libc.AtomicLoadNInt32(((*IntegrityCk)(unsafe.Pointer(pCheck)).Fdb+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0 { + if libc.AtomicLoadNInt32(((*IntegrityCk)(unsafe.Pointer(pCheck)).Fdb+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0 { return 1 } setPageReferenced(tls, pCheck, iPage) @@ -51537,7 +51788,7 @@ func checkRef(tls *libc.TLS, pCheck uintptr, iPage Pgno) int32 { /* sqlite3.c:74 // 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 *libc.TLS, pCheck uintptr, iChild Pgno, eType U8, iParent Pgno) { /* sqlite3.c:74181:13: */ +func checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild Pgno, eType U8, iParent Pgno) { /* sqlite3.c:74807:13: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -51551,20 +51802,20 @@ func checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild Pgno, eType U8, iParent P if (rc == SQLITE_NOMEM) || (rc == (SQLITE_IOERR | (int32(12) << 8))) { (*IntegrityCk)(unsafe.Pointer(pCheck)).FbOomFault = 1 } - checkAppendMsg(tls, pCheck, ts+5765 /* "Failed to read p..." */, libc.VaList(bp, iChild)) + checkAppendMsg(tls, pCheck, ts+5841 /* "Failed to read p..." */, libc.VaList(bp, iChild)) return } if (int32(*(*U8)(unsafe.Pointer(bp + 48 /* ePtrmapType */))) != int32(eType)) || (*(*Pgno)(unsafe.Pointer(bp + 52 /* iPtrmapParent */)) != iParent) { checkAppendMsg(tls, pCheck, - ts+5794, /* "Bad ptr map entr..." */ + ts+5870, /* "Bad ptr map entr..." */ libc.VaList(bp+8, iChild, int32(eType), iParent, int32(*(*U8)(unsafe.Pointer(bp + 48 /* ePtrmapType */))), *(*Pgno)(unsafe.Pointer(bp + 52 /* iPtrmapParent */)))) } } // 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 *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U32) { /* sqlite3.c:74210:13: */ +func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U32) { /* sqlite3.c:74836:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -51580,24 +51831,24 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 } N-- if Xsqlite3PagerGet(tls, (*IntegrityCk)(unsafe.Pointer(pCheck)).FpPager, iPage, bp+40 /* &pOvflPage */, 0) != 0 { - checkAppendMsg(tls, pCheck, ts+5848 /* "failed to get pa..." */, libc.VaList(bp, iPage)) + checkAppendMsg(tls, pCheck, ts+5924 /* "failed to get pa..." */, libc.VaList(bp, iPage)) break } pOvflData = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pOvflPage */))) if isFreeList != 0 { var n U32 = Xsqlite3Get4byte(tls, (pOvflData + 4)) if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 { - checkPtrmap(tls, pCheck, iPage, PTRMAP_FREEPAGE, uint32(0)) + checkPtrmap(tls, pCheck, iPage, uint8(PTRMAP_FREEPAGE), uint32(0)) } if n > (((*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize / U32(4)) - U32(2)) { checkAppendMsg(tls, pCheck, - ts+5870 /* "freelist leaf co..." */, libc.VaList(bp+8, iPage)) + ts+5946 /* "freelist leaf co..." */, libc.VaList(bp+8, iPage)) N-- } else { for i = 0; i < int32(n); i++ { var iFreePage Pgno = Xsqlite3Get4byte(tls, (pOvflData + uintptr((8 + (i * 4))))) if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 { - checkPtrmap(tls, pCheck, iFreePage, PTRMAP_FREEPAGE, uint32(0)) + checkPtrmap(tls, pCheck, iFreePage, uint8(PTRMAP_FREEPAGE), uint32(0)) } checkRef(tls, pCheck, iFreePage) } @@ -51609,7 +51860,7 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 // the following page matches iPage. if ((*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0) && (N > U32(0)) { i = int32(Xsqlite3Get4byte(tls, pOvflData)) - checkPtrmap(tls, pCheck, uint32(i), PTRMAP_OVERFLOW2, iPage) + checkPtrmap(tls, pCheck, uint32(i), uint8(PTRMAP_OVERFLOW2), iPage) } } iPage = Xsqlite3Get4byte(tls, pOvflData) @@ -51617,12 +51868,12 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 } if (N != 0) && (nErrAtStart == (*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr) { checkAppendMsg(tls, pCheck, - ts+5909, /* "%s is %d but sho..." */ + ts+5985, /* "%s is %d but sho..." */ libc.VaList(bp+16, func() uintptr { if isFreeList != 0 { - return ts + 5935 /* "size" */ + return ts + 6011 /* "size" */ } - return ts + 5940 /* "overflow list le..." */ + return ts + 6016 /* "overflow list le..." */ }(), (expected-N), expected)) } @@ -51648,7 +51899,7 @@ func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U3 // 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 *libc.TLS, aHeap uintptr, x U32) { /* sqlite3.c:74299:13: */ +func btreeHeapInsert(tls *libc.TLS, aHeap uintptr, x U32) { /* sqlite3.c:74925:13: */ var j U32 var i U32 = libc.PreIncUint32(&*(*U32)(unsafe.Pointer(aHeap)), 1) *(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4)) = x @@ -51660,7 +51911,7 @@ func btreeHeapInsert(tls *libc.TLS, aHeap uintptr, x U32) { /* sqlite3.c:74299:1 } } -func btreeHeapPull(tls *libc.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite3.c:74309:12: */ +func btreeHeapPull(tls *libc.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite3.c:74935:12: */ var j U32 var i U32 var x U32 @@ -51699,7 +51950,7 @@ func btreeHeapPull(tls *libc.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite // 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 *libc.TLS, pCheck uintptr, iPage Pgno, piMinKey uintptr, maxKey I64) int32 { /* sqlite3.c:74343:12: */ +func checkTreePage(tls *libc.TLS, pCheck uintptr, iPage Pgno, piMinKey uintptr, maxKey I64) int32 { /* sqlite3.c:74969:12: */ bp := tls.Alloc(140) defer tls.Free(140) *(*I64)(unsafe.Pointer(bp + 104)) = maxKey @@ -51766,13 +52017,13 @@ __1: return 0 __2: ; - (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 5961 /* "Page %u: " */ + (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 6037 /* "Page %u: " */ (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage if !((libc.AssignInt32(&rc, btreeGetPage(tls, pBt, iPage, bp+96 /* &pPage */, 0))) != 0) { goto __3 } checkAppendMsg(tls, pCheck, - ts+5971 /* "unable to get th..." */, libc.VaList(bp, rc)) + ts+6047 /* "unable to get th..." */, libc.VaList(bp, rc)) goto end_of_check __3: ; @@ -51786,7 +52037,7 @@ __3: } // The only possible error from InitPage checkAppendMsg(tls, pCheck, - ts+6009 /* "btreeInitPage() ..." */, libc.VaList(bp+8, rc)) + ts+6085 /* "btreeInitPage() ..." */, libc.VaList(bp+8, rc)) goto end_of_check __4: ; @@ -51794,7 +52045,7 @@ __4: goto __5 } - checkAppendMsg(tls, pCheck, ts+6047 /* "free space corru..." */, libc.VaList(bp+16, rc)) + checkAppendMsg(tls, pCheck, ts+6123 /* "free space corru..." */, libc.VaList(bp+16, rc)) goto end_of_check __5: ; @@ -51802,7 +52053,7 @@ __5: hdr = int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).FhdrOffset) // Set up for cell analysis - (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 6069 /* "On tree page %u ..." */ + (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 6145 /* "On tree page %u ..." */ contentOffset = (U32(((((int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5)))))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5))) + 1)))) - 1) & 0xffff) + 1)) // Enforced by btreeInitPage() @@ -51824,8 +52075,8 @@ __5: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __8 } - (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 6095 /* "On page %u at ri..." */ - checkPtrmap(tls, pCheck, uint32(pgno), PTRMAP_BTREE, iPage) + (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 6171 /* "On page %u at ri..." */ + checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage) __8: ; depth = checkTreePage(tls, pCheck, uint32(pgno), bp+104 /* &maxKey */, *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))) @@ -51855,7 +52106,7 @@ __9: if !((pc < contentOffset) || (pc > (usableSize - U32(4)))) { goto __12 } - checkAppendMsg(tls, pCheck, ts+6123, /* "Offset %d out of..." */ + checkAppendMsg(tls, pCheck, ts+6199, /* "Offset %d out of..." */ libc.VaList(bp+24, pc, contentOffset, (usableSize-U32(4)))) doCoverageCheck = 0 goto __10 @@ -51866,7 +52117,7 @@ __12: if !((pc + U32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnSize)) > usableSize) { goto __13 } - checkAppendMsg(tls, pCheck, ts+6153 /* "Extends off end ..." */, 0) + checkAppendMsg(tls, pCheck, ts+6229 /* "Extends off end ..." */, 0) doCoverageCheck = 0 goto __10 __13: @@ -51884,7 +52135,7 @@ __13: }() != 0) { goto __15 } - checkAppendMsg(tls, pCheck, ts+6177 /* "Rowid %lld out o..." */, libc.VaList(bp+48, (*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey)) + checkAppendMsg(tls, pCheck, ts+6253 /* "Rowid %lld out o..." */, libc.VaList(bp+48, (*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey)) __15: ; *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */)) = (*CellInfo)(unsafe.Pointer(bp + 112 /* &info */)).FnKey @@ -51902,7 +52153,7 @@ __14: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __17 } - checkPtrmap(tls, pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage) + checkPtrmap(tls, pCheck, pgnoOvfl, uint8(PTRMAP_OVERFLOW1), iPage) __17: ; checkList(tls, pCheck, 0, pgnoOvfl, nPage) @@ -51917,7 +52168,7 @@ __16: if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { goto __20 } - checkPtrmap(tls, pCheck, uint32(pgno), PTRMAP_BTREE, iPage) + checkPtrmap(tls, pCheck, uint32(pgno), uint8(PTRMAP_BTREE), iPage) __20: ; d2 = checkTreePage(tls, pCheck, uint32(pgno), bp+104 /* &maxKey */, *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))) @@ -51925,7 +52176,7 @@ __20: if !(d2 != depth) { goto __21 } - checkAppendMsg(tls, pCheck, ts+6201 /* "Child page depth..." */, 0) + checkAppendMsg(tls, pCheck, ts+6277 /* "Child page depth..." */, 0) depth = d2 __21: ; @@ -52023,7 +52274,7 @@ __29: goto __31 } checkAppendMsg(tls, pCheck, - ts+6226 /* "Multiple uses fo..." */, libc.VaList(bp+56, (*(*U32)(unsafe.Pointer(bp + 136 /* x */))>>16), iPage)) + ts+6302 /* "Multiple uses fo..." */, libc.VaList(bp+56, (*(*U32)(unsafe.Pointer(bp + 136 /* x */))>>16), iPage)) goto __30 goto __32 __31: @@ -52043,7 +52294,7 @@ __30: goto __33 } checkAppendMsg(tls, pCheck, - ts+6263, /* "Fragmentation of..." */ + ts+6339, /* "Fragmentation of..." */ libc.VaList(bp+72, nFrag, int32(*(*U8)(unsafe.Pointer(data + uintptr((hdr + 7))))), iPage)) __33: ; @@ -52084,7 +52335,7 @@ __34: // since obviously it is not possible to know which pages are covered by // the unverified btrees. Except, if aRoot[1] is 1, then the freelist // checks are still performed. -func Xsqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uintptr, nRoot int32, mxErr int32, pnErr uintptr) uintptr { /* sqlite3.c:74622:21: */ +func Xsqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uintptr, nRoot int32, mxErr int32, pnErr uintptr) uintptr { /* sqlite3.c:75248:21: */ bp := tls.Alloc(248) defer tls.Free(248) @@ -52135,7 +52386,7 @@ __1: (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FaPgRef = uintptr(0) (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).Fheap = uintptr(0) Xsqlite3StrAccumInit(tls, (bp + 32 /* &sCheck */ + 56 /* &.errMsg */), uintptr(0), bp+136 /* &zErr[0] */, int32(unsafe.Sizeof([100]int8{})), SQLITE_MAX_LENGTH) - (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FerrMsg.FprintfFlags = SQLITE_PRINTF_INTERNAL + (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FerrMsg.FprintfFlags = U8(SQLITE_PRINTF_INTERNAL) if !((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnPage == Pgno(0)) { goto __3 } @@ -52172,7 +52423,7 @@ __6: if !(bCkFreelist != 0) { goto __7 } - (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FzPfx = ts + 6315 /* "Main freelist: " */ + (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FzPfx = ts + 6391 /* "Main freelist: " */ checkList(tls, bp+32 /* &sCheck */, 1, Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32)), Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36))) (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FzPfx = uintptr(0) @@ -52210,7 +52461,7 @@ __13: goto __15 } checkAppendMsg(tls, bp+32, /* &sCheck */ - ts+6331, /* "max rootpage (%d..." */ + ts+6407, /* "max rootpage (%d..." */ libc.VaList(bp, mx, mxInHdr)) __15: ; @@ -52220,7 +52471,7 @@ __9: goto __16 } checkAppendMsg(tls, bp+32, /* &sCheck */ - ts+6376 /* "incremental_vacu..." */, 0) + ts+6452 /* "incremental_vacu..." */, 0) __16: ; __10: @@ -52228,7 +52479,7 @@ __10: __8: ; - *(*U64)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_CellSizeCk)) + *(*U64)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_CellSizeCk))) i = Pgno(0) __17: if !((int32(i) < nRoot) && ((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FmxErr != 0)) { @@ -52243,7 +52494,7 @@ __20: if !((((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)) > Pgno(1))) && !(bPartial != 0)) { goto __21 } - checkPtrmap(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), PTRMAP_ROOTPAGE, uint32(0)) + checkPtrmap(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), uint8(PTRMAP_ROOTPAGE), uint32(0)) __21: ; checkTreePage(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), bp+240 /* ¬Used */, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) @@ -52270,13 +52521,13 @@ __23: if !((getPageReferenced(tls, bp+32 /* &sCheck */, i) == 0) && ((ptrmapPageno(tls, pBt, i) != i) || !(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0))) { goto __26 } - checkAppendMsg(tls, bp+32 /* &sCheck */, ts+6431 /* "Page %d is never..." */, libc.VaList(bp+16, i)) + checkAppendMsg(tls, bp+32 /* &sCheck */, ts+6507 /* "Page %d is never..." */, libc.VaList(bp+16, i)) __26: ; if !((getPageReferenced(tls, bp+32 /* &sCheck */, i) != 0) && ((ptrmapPageno(tls, pBt, i) == i) && ((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0))) { goto __27 } - checkAppendMsg(tls, bp+32 /* &sCheck */, ts+6453 /* "Pointer map page..." */, libc.VaList(bp+24, i)) + checkAppendMsg(tls, bp+32 /* &sCheck */, ts+6529 /* "Pointer map page..." */, libc.VaList(bp+24, i)) __27: ; goto __24 @@ -52318,7 +52569,7 @@ __29: // // The pager filename is invariant as long as the pager is // open so it is safe to access without the BtShared mutex. -func Xsqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:74777:27: */ +func Xsqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:75403:27: */ return Xsqlite3PagerFilename(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager, 1) } @@ -52329,15 +52580,19 @@ func Xsqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:7 // // The pager journal filename is invariant as long as the pager is // open so it is safe to access without the BtShared mutex. -func Xsqlite3BtreeGetJournalname(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:74790:27: */ +func Xsqlite3BtreeGetJournalname(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:75416:27: */ return Xsqlite3PagerJournalname(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager) } -// Return non-zero if a transaction is active. -func Xsqlite3BtreeIsInTrans(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74798:20: */ +// Return one of SQLITE_TXN_NONE, SQLITE_TXN_READ, or SQLITE_TXN_WRITE +// to describe the current transaction state of Btree p. +func Xsqlite3BtreeTxnState(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75425:20: */ - return (libc.Bool32((p != 0) && (int32((*Btree)(unsafe.Pointer(p)).FinTrans) == TRANS_WRITE))) + if p != 0 { + return int32((*Btree)(unsafe.Pointer(p)).FinTrans) + } + return 0 } // Run a checkpoint on the Btree passed as the first argument. @@ -52346,7 +52601,7 @@ func Xsqlite3BtreeIsInTrans(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74798 // transaction on the shared-cache the argument Btree is connected to. // // Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART. -func Xsqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:74812:20: */ +func Xsqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:75439:20: */ var rc int32 = SQLITE_OK if p != 0 { var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt @@ -52361,13 +52616,8 @@ func Xsqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintpt return rc } -// Return non-zero if a read (or write) transaction is active. -func Xsqlite3BtreeIsInReadTrans(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74831:20: */ - - return (libc.Bool32(int32((*Btree)(unsafe.Pointer(p)).FinTrans) != TRANS_NONE)) -} - -func Xsqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74837:20: */ +// Return true if there is currently a backup running on Btree p. +func Xsqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75458:20: */ return (libc.Bool32((*Btree)(unsafe.Pointer(p)).FnBackup != 0)) } @@ -52390,7 +52640,7 @@ func Xsqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:7483 // 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 Xsqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) uintptr { /* sqlite3.c:74863:21: */ +func Xsqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) uintptr { /* sqlite3.c:75484:21: */ var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt Xsqlite3BtreeEnter(tls, p) if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpSchema) != 0) && (nBytes != 0) { @@ -52404,11 +52654,11 @@ func Xsqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) // Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared // btree as the argument handle holds an exclusive lock on the // sqlite_schema table. Otherwise SQLITE_OK. -func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74879:20: */ +func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75500:20: */ var rc int32 Xsqlite3BtreeEnter(tls, p) - rc = querySharedCacheTableLock(tls, p, SCHEMA_ROOT, READ_LOCK) + rc = querySharedCacheTableLock(tls, p, uint32(SCHEMA_ROOT), uint8(READ_LOCK)) Xsqlite3BtreeLeave(tls, p) return rc @@ -52417,7 +52667,7 @@ func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74 // 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 Xsqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock U8) int32 { /* sqlite3.c:74896:20: */ +func Xsqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock U8) int32 { /* sqlite3.c:75517:20: */ var rc int32 = SQLITE_OK if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 { @@ -52441,7 +52691,7 @@ func Xsqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock U8 // 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 Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z uintptr) int32 { /* sqlite3.c:74926:20: */ +func Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z uintptr) int32 { /* sqlite3.c:75547:20: */ var rc int32 rc = func() int32 { @@ -52481,7 +52731,7 @@ func Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z ui } // Mark this cursor as an incremental blob cursor. -func Xsqlite3BtreeIncrblobCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:74974:21: */ +func Xsqlite3BtreeIncrblobCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:75595:21: */ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((BTCF_Incrblob)) (*Btree)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBtree)).FhasIncrblobCur = U8(1) } @@ -52489,7 +52739,7 @@ func Xsqlite3BtreeIncrblobCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:749 // 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 Xsqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) int32 { /* sqlite3.c:74985:20: */ +func Xsqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) int32 { /* sqlite3.c:75606:20: */ var pBt uintptr = (*Btree)(unsafe.Pointer(pBtree)).FpBt var rc int32 // Return code @@ -52521,29 +52771,29 @@ func Xsqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) int3 // Return true if the cursor has a hint specified. This routine is // only used from within assert() statements -func Xsqlite3BtreeCursorHasHint(tls *libc.TLS, pCsr uintptr, mask uint32) int32 { /* sqlite3.c:75020:20: */ +func Xsqlite3BtreeCursorHasHint(tls *libc.TLS, pCsr uintptr, mask uint32) int32 { /* sqlite3.c:75641:20: */ return (libc.Bool32((uint32((*BtCursor)(unsafe.Pointer(pCsr)).Fhints) & mask) != uint32(0))) } // Return true if the given Btree is read-only. -func Xsqlite3BtreeIsReadonly(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75027:20: */ +func Xsqlite3BtreeIsReadonly(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75648:20: */ return (libc.Bool32((int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & BTS_READ_ONLY) != 0)) } // Return the size of the header added to each page by this module. -func Xsqlite3HeaderSizeBtree(tls *libc.TLS) int32 { /* sqlite3.c:75034:20: */ +func Xsqlite3HeaderSizeBtree(tls *libc.TLS) int32 { /* sqlite3.c:75655:20: */ return (int32(((uint64(unsafe.Sizeof(MemPage{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7)))) } // Return true if the Btree passed as the only argument is sharable. -func Xsqlite3BtreeSharable(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75040:20: */ +func Xsqlite3BtreeSharable(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75661:20: */ return int32((*Btree)(unsafe.Pointer(p)).Fsharable) } // 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 Xsqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75049:20: */ +func Xsqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75670:20: */ return (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FnRef } @@ -52583,14 +52833,14 @@ func Xsqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c // If the "temp" database is requested, it may need to be opened by this // function. If an error occurs while doing so, return 0 and write an // error message to pErrorDb. -func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintptr { /* sqlite3.c:75138:14: */ - bp := tls.Alloc(440) - defer tls.Free(440) +func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintptr { /* sqlite3.c:75759:14: */ + bp := tls.Alloc(424) + defer tls.Free(424) var i int32 = Xsqlite3FindDbName(tls, pDb, zDb) if i == 1 { - // var sParse Parse at bp+16, 424 + // var sParse Parse at bp+16, 408 var rc int32 = 0 libc.Xmemset(tls, bp+16 /* &sParse */, 0, uint64(unsafe.Sizeof(Parse{}))) @@ -52607,7 +52857,7 @@ func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintpt } if i < 0 { - Xsqlite3ErrorWithMsg(tls, pErrorDb, SQLITE_ERROR, ts+6487 /* "unknown database..." */, libc.VaList(bp+8, zDb)) + Xsqlite3ErrorWithMsg(tls, pErrorDb, SQLITE_ERROR, ts+6563 /* "unknown database..." */, libc.VaList(bp+8, zDb)) return uintptr(0) } @@ -52616,7 +52866,7 @@ func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintpt // Attempt to set the page size of the destination to match the page size // of the source. -func setDestPgsz(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75169:12: */ +func setDestPgsz(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75790:12: */ var rc int32 rc = Xsqlite3BtreeSetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, Xsqlite3BtreeGetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc), 0, 0) return rc @@ -52626,9 +52876,9 @@ func setDestPgsz(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75169:12: */ // second argument. If there is not, return SQLITE_OK. Otherwise, if there // is an open read-transaction, return SQLITE_ERROR and leave an error // message in database handle db. -func checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:75181:12: */ - if Xsqlite3BtreeIsInReadTrans(tls, p) != 0 { - Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+6507 /* "destination data..." */, 0) +func checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:75802:12: */ + if Xsqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { + Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+6583 /* "destination data..." */, 0) return SQLITE_ERROR } return SQLITE_OK @@ -52640,7 +52890,7 @@ func checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlit // // If an error occurs, NULL is returned and an error code and error message // stored in database handle pDestDb. -func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcDb uintptr, zSrcDb uintptr) uintptr { /* sqlite3.c:75197:27: */ +func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcDb uintptr, zSrcDb uintptr) uintptr { /* sqlite3.c:75818:27: */ var p uintptr // Value to return // Lock the source database handle. The destination database @@ -52655,7 +52905,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD if pSrcDb == pDestDb { Xsqlite3ErrorWithMsg(tls, - pDestDb, SQLITE_ERROR, ts+6538 /* "source and desti..." */, 0) + pDestDb, SQLITE_ERROR, ts+6614 /* "source and desti..." */, 0) p = uintptr(0) } else { // Allocate space for a new sqlite3_backup object... @@ -52700,14 +52950,14 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD // 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 *libc.TLS, rc int32) int32 { /* sqlite3.c:75274:12: */ +func isFatalError(tls *libc.TLS, rc int32) int32 { /* sqlite3.c:75895:12: */ return (libc.Bool32(((rc != SQLITE_OK) && (rc != SQLITE_BUSY)) && (rc != SQLITE_LOCKED))) } // 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 *libc.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpdate int32) int32 { /* sqlite3.c:75283:12: */ +func backupOnePage(tls *libc.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpdate int32) int32 { /* sqlite3.c:75904:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -52769,7 +53019,7 @@ func backupOnePage(tls *libc.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpd // // Return SQLITE_OK if everything is successful, or an SQLite error // code if an error occurs. -func backupTruncateFile(tls *libc.TLS, pFile uintptr, iSize I64) int32 { /* sqlite3.c:75352:12: */ +func backupTruncateFile(tls *libc.TLS, pFile uintptr, iSize I64) int32 { /* sqlite3.c:75973:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -52784,7 +53034,7 @@ func backupTruncateFile(tls *libc.TLS, pFile uintptr, iSize I64) int32 { /* sqli // Register this backup object with the associated source pager for // callbacks when pages are changed or the cache invalidated. -func attachBackupObject(tls *libc.TLS, p uintptr) { /* sqlite3.c:75365:13: */ +func attachBackupObject(tls *libc.TLS, p uintptr) { /* sqlite3.c:75986:13: */ var pp uintptr pp = Xsqlite3PagerBackupPtr(tls, Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)) @@ -52794,7 +53044,7 @@ func attachBackupObject(tls *libc.TLS, p uintptr) { /* sqlite3.c:75365:13: */ } // Copy nPage pages from the source b-tree to the destination. -func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqlite3.c:75377:16: */ +func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqlite3.c:75998:16: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -52828,7 +53078,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli // If there is no open read-transaction on the source database, open // one now. If a transaction is opened here, then it will be closed // before this function exits. - if (rc == SQLITE_OK) && (0 == Xsqlite3BtreeIsInReadTrans(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)) { + if (rc == SQLITE_OK) && (SQLITE_TXN_NONE == Xsqlite3BtreeTxnState(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc)) { rc = Xsqlite3BtreeBeginTrans(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc, 0, uintptr(0)) bCloseTrans = 1 } @@ -53032,7 +53282,7 @@ func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqli } // Release all resources associated with an sqlite3_backup* handle. -func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75631:16: */ +func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76252:16: */ var pp uintptr // Ptr to head of pagers backup list var pSrcDb uintptr // Source database connection var rc int32 // Value to return @@ -53090,13 +53340,13 @@ func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75631 // Return the number of pages still to be backed up as of the most recent // call to sqlite3_backup_step(). -func Xsqlite3_backup_remaining(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75685:16: */ +func Xsqlite3_backup_remaining(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76306:16: */ return int32((*Sqlite3_backup)(unsafe.Pointer(p)).FnRemaining) } // Return the total number of pages in the source database as of the most // recent call to sqlite3_backup_step(). -func Xsqlite3_backup_pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75699:16: */ +func Xsqlite3_backup_pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76320:16: */ return int32((*Sqlite3_backup)(unsafe.Pointer(p)).FnPagecount) } @@ -53110,7 +53360,7 @@ func Xsqlite3_backup_pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75 // It is assumed that the mutex associated with the BtShared object // corresponding to the source database is held when this function is // called. -func backupUpdate(tls *libc.TLS, p uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:75721:29: */ +func backupUpdate(tls *libc.TLS, p uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:76342:29: */ for ok := true; ok; ok = ((libc.AssignUintptr(&p, (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext)) != uintptr(0)) { @@ -53131,7 +53381,7 @@ func backupUpdate(tls *libc.TLS, p uintptr, iPage Pgno, aData uintptr) { /* sqli } } -func Xsqlite3BackupUpdate(tls *libc.TLS, pBackup uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:75746:21: */ +func Xsqlite3BackupUpdate(tls *libc.TLS, pBackup uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:76367:21: */ if pBackup != 0 { backupUpdate(tls, pBackup, iPage, aData) } @@ -53146,7 +53396,7 @@ func Xsqlite3BackupUpdate(tls *libc.TLS, pBackup uintptr, iPage Pgno, aData uint // It is assumed that the mutex associated with the BtShared object // corresponding to the source database is held when this function is // called. -func Xsqlite3BackupRestart(tls *libc.TLS, pBackup uintptr) { /* sqlite3.c:75761:21: */ +func Xsqlite3BackupRestart(tls *libc.TLS, pBackup uintptr) { /* sqlite3.c:76382:21: */ var p uintptr // Iterator variable for p = pBackup; p != 0; p = (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext { @@ -53160,7 +53410,7 @@ func Xsqlite3BackupRestart(tls *libc.TLS, pBackup uintptr) { /* sqlite3.c:75761: // 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 Xsqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:75778:20: */ +func Xsqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:76399:20: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -53254,7 +53504,7 @@ copy_finished: // Render a Mem object which is one of MEM_Int, MEM_Real, or MEM_IntReal // into a buffer. -func vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { /* sqlite3.c:75934:13: */ +func vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { /* sqlite3.c:76555:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -53269,7 +53519,7 @@ func vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { /* sql Xsqlite3Int64ToText(tls, *(*I64)(unsafe.Pointer(bp + 8 /* x */)), zBuf) } else { Xsqlite3StrAccumInit(tls, bp+16 /* &acc */, uintptr(0), zBuf, sz, 0) - Xsqlite3_str_appendf(tls, bp+16 /* &acc */, ts+6578, /* "%!.15g" */ + Xsqlite3_str_appendf(tls, bp+16 /* &acc */, ts+6654, /* "%!.15g" */ libc.VaList(bp, func() float64 { if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_IntReal) != 0 { return float64(*(*I64)(unsafe.Pointer(p /* &.u */))) @@ -53292,7 +53542,7 @@ func vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { /* sql // 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 Xsqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) int32 { /* sqlite3.c:76027:20: */ +func Xsqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) int32 { /* sqlite3.c:76648:20: */ var rc int32 if !((int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Str) != 0) || (int32((*Mem)(unsafe.Pointer(pMem)).Fenc) == desiredEnc) { @@ -53312,7 +53562,7 @@ func Xsqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) i // 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 Xsqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) int32 { /* sqlite3.c:76061:36: */ +func Xsqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) int32 { /* sqlite3.c:76682:36: */ // If the bPreserve flag is set to true, then the memory cell must already // contain a valid string or blob value. @@ -53368,7 +53618,7 @@ func Xsqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) // // Return SQLITE_OK on success or an error code (probably SQLITE_NOMEM) // if unable to complete the resizing. -func Xsqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) int32 { /* sqlite3.c:76122:20: */ +func Xsqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) int32 { /* sqlite3.c:76743:20: */ if (*Mem)(unsafe.Pointer(pMem)).FszMalloc < szNew { return Xsqlite3VdbeMemGrow(tls, pMem, szNew, 0) @@ -53386,7 +53636,7 @@ func Xsqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) int // to be a double-zero byte at an even byte boundary in order to // terminate a UTF16 string, even if the initial size of the buffer // is an odd number of bytes. -func vdbeMemAddTerminator(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76143:28: */ +func vdbeMemAddTerminator(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76764:28: */ if Xsqlite3VdbeMemGrow(tls, pMem, ((*Mem)(unsafe.Pointer(pMem)).Fn+3), 1) != 0 { return SQLITE_NOMEM } @@ -53401,7 +53651,7 @@ func vdbeMemAddTerminator(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:7614 // MEM.zMalloc, where it can be safely written. // // Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails. -func Xsqlite3VdbeMemMakeWriteable(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76160:20: */ +func Xsqlite3VdbeMemMakeWriteable(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76781:20: */ if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Str | MEM_Blob)) != 0 { if func() int32 { @@ -53426,7 +53676,7 @@ func Xsqlite3VdbeMemMakeWriteable(tls *libc.TLS, pMem uintptr) int32 { /* sqlite // If the given Mem* has a zero-filled tail, turn it into an ordinary // blob stored in dynamically allocated space. -func Xsqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76183:20: */ +func Xsqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76804:20: */ var nByte int32 // Set nByte to the number of bytes required to store the expanded blob. @@ -53448,7 +53698,7 @@ func Xsqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c } // Make sure the given Mem is \u0000 terminated. -func Xsqlite3VdbeMemNulTerminate(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76211:20: */ +func Xsqlite3VdbeMemNulTerminate(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76832:20: */ if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Term | MEM_Str)) != MEM_Str { return SQLITE_OK // Nothing to do @@ -53470,7 +53720,7 @@ func Xsqlite3VdbeMemNulTerminate(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3 // 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 Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) int32 { /* sqlite3.c:76236:20: */ +func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) int32 { /* sqlite3.c:76857:20: */ var nByte int32 = 32 if Xsqlite3VdbeMemClearAndResize(tls, pMem, nByte) != 0 { @@ -53481,7 +53731,7 @@ func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) in vdbeMemRenderNum(tls, nByte, (*Mem)(unsafe.Pointer(pMem)).Fz, pMem) (*Mem)(unsafe.Pointer(pMem)).Fn = (int32(libc.Xstrlen(tls, (*Mem)(unsafe.Pointer(pMem)).Fz) & uint64(0x3fffffff))) - (*Mem)(unsafe.Pointer(pMem)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(pMem)).Fenc = U8(SQLITE_UTF8) *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16((MEM_Str | MEM_Term)) if bForce != 0 { *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((MEM_Int | MEM_Real) | MEM_IntReal)))) @@ -53496,7 +53746,7 @@ func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) in // // Return SQLITE_ERROR if the finalizer reports an error. SQLITE_OK // otherwise. -func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 { /* sqlite3.c:76270:20: */ +func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 { /* sqlite3.c:76891:20: */ bp := tls.Alloc(112) defer tls.Free(112) @@ -53506,7 +53756,7 @@ func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 { libc.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(Sqlite3_context{}))) libc.Xmemset(tls, bp+56 /* &t */, 0, uint64(unsafe.Sizeof(Mem{}))) - (*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fdb = (*Mem)(unsafe.Pointer(pMem)).Fdb (*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpOut = bp + 56 /* &t */ (*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpMem = pMem @@ -53526,7 +53776,7 @@ func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 { // // SQLITE_ERROR is returned if xValue() reports an error. SQLITE_OK // otherwise. -func Xsqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) int32 { /* sqlite3.c:76300:20: */ +func Xsqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) int32 { /* sqlite3.c:76921:20: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -53548,7 +53798,7 @@ func Xsqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc // 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 *libc.TLS, p uintptr) { /* sqlite3.c:76325:29: */ +func vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:76946:29: */ if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Agg) != 0 { Xsqlite3VdbeMemFinalize(tls, p, *(*uintptr)(unsafe.Pointer(p /* &.u */))) @@ -53558,7 +53808,7 @@ func vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:76325 (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((p + 48 /* &.xDel */))))(tls, (*Mem)(unsafe.Pointer(p)).Fz) } - (*Mem)(unsafe.Pointer(p)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Null) } // Release memory held by the Mem p, both external memory cleared @@ -53567,7 +53817,7 @@ func vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:76325 // 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 *libc.TLS, p uintptr) { /* sqlite3.c:76348:29: */ +func vdbeMemClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:76969:29: */ if (int32((*Mem)(unsafe.Pointer((p))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { vdbeMemClearExternAndSetNull(tls, p) } @@ -53586,7 +53836,7 @@ func vdbeMemClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:76348:29: */ // // Use sqlite3VdbeMemSetNull() to release just the Mem.xDel space // prior to inserting new content into the Mem. -func Xsqlite3VdbeMemRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:76369:21: */ +func Xsqlite3VdbeMemRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:76990:21: */ if ((int32((*Mem)(unsafe.Pointer((p))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0) || ((*Mem)(unsafe.Pointer(p)).FszMalloc != 0) { vdbeMemClear(tls, p) @@ -53596,7 +53846,7 @@ func Xsqlite3VdbeMemRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:76369:21: * // 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 *libc.TLS, r float64) I64 { /* sqlite3.c:76381:28: */ +func doubleToInt64(tls *libc.TLS, r float64) I64 { /* sqlite3.c:77002:28: */ if r <= float64(minInt) { return minInt @@ -53608,8 +53858,8 @@ func doubleToInt64(tls *libc.TLS, r float64) I64 { /* sqlite3.c:76381:28: */ return I64(0) } -var maxInt I64 = (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) /* sqlite3.c:76393:20 */ -var minInt I64 = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) /* sqlite3.c:76394:20 */ +var maxInt I64 = (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) /* sqlite3.c:77014:20 */ +var minInt I64 = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) /* sqlite3.c:77015:20 */ // Return some kind of integer value which is the best we can do // at representing the value that *pMem describes as an integer. @@ -53620,7 +53870,7 @@ var minInt I64 = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) < // an SQL-NULL value, return 0. // // If pMem represents a string value, its encoding might be changed. -func memIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:76417:28: */ +func memIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:77038:28: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -53629,7 +53879,7 @@ func memIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:76417:28: */ return *(*I64)(unsafe.Pointer(bp /* value */)) } -func Xsqlite3VdbeIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:76422:20: */ +func Xsqlite3VdbeIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:77043:20: */ var flags int32 flags = int32((*Mem)(unsafe.Pointer(pMem)).Fflags) @@ -53650,7 +53900,7 @@ func Xsqlite3VdbeIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:76422: // 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 *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:76445:31: */ +func memRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:77066:31: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -53660,7 +53910,7 @@ func memRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:76445:31: return *(*float64)(unsafe.Pointer(bp /* val */)) } -func Xsqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:76451:23: */ +func Xsqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:77072:23: */ if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Real) != 0 { return *(*float64)(unsafe.Pointer(pMem /* &.u */)) @@ -53678,7 +53928,7 @@ func Xsqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:7 // Return 1 if pMem represents true, and return 0 if pMem represents false. // Return the value ifNull if pMem is NULL. -func Xsqlite3VdbeBooleanValue(tls *libc.TLS, pMem uintptr, ifNull int32) int32 { /* sqlite3.c:76471:20: */ +func Xsqlite3VdbeBooleanValue(tls *libc.TLS, pMem uintptr, ifNull int32) int32 { /* sqlite3.c:77092:20: */ if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Int | MEM_IntReal)) != 0 { return (libc.Bool32(*(*I64)(unsafe.Pointer(pMem /* &.u */)) != int64(0))) @@ -53691,7 +53941,7 @@ func Xsqlite3VdbeBooleanValue(tls *libc.TLS, pMem uintptr, ifNull int32) int32 { // The MEM structure is already a MEM_Real. Try to also make it a // MEM_Int if we can. -func Xsqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:76482:21: */ +func Xsqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:77103:21: */ var ix I64 ix = doubleToInt64(tls, *(*float64)(unsafe.Pointer(pMem /* &.u */))) @@ -53712,7 +53962,7 @@ func Xsqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:764 } // Convert pMem to type integer. Invalidate any prior representations. -func Xsqlite3VdbeMemIntegerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76510:20: */ +func Xsqlite3VdbeMemIntegerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77131:20: */ *(*I64)(unsafe.Pointer(pMem /* &.u */)) = Xsqlite3VdbeIntValue(tls, pMem) (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int)) @@ -53721,7 +53971,7 @@ func Xsqlite3VdbeMemIntegerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c // Convert pMem so that it is of type MEM_Real. // Invalidate any prior representations. -func Xsqlite3VdbeMemRealify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76524:20: */ +func Xsqlite3VdbeMemRealify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77145:20: */ *(*float64)(unsafe.Pointer(pMem /* &.u */)) = Xsqlite3VdbeRealValue(tls, pMem) (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Real)) @@ -53736,7 +53986,7 @@ func Xsqlite3VdbeMemRealify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76 // For some versions of GCC on 32-bit machines, if you do the more obvious // comparison of "r1==(double)i" you sometimes get an answer of false even // though the r1 and (double)i values are bit-for-bit the same. -func Xsqlite3RealSameAsInt(tls *libc.TLS, r1 float64, i Sqlite3_int64) int32 { /* sqlite3.c:76542:20: */ +func Xsqlite3RealSameAsInt(tls *libc.TLS, r1 float64, i Sqlite3_int64) int32 { /* sqlite3.c:77163:20: */ bp := tls.Alloc(16) defer tls.Free(16) *(*float64)(unsafe.Pointer(bp)) = r1 @@ -53753,7 +54003,7 @@ func Xsqlite3RealSameAsInt(tls *libc.TLS, r1 float64, i Sqlite3_int64) int32 { / // 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 Xsqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76557:20: */ +func Xsqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77178:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -53780,7 +54030,7 @@ func Xsqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:7 // 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 Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 { /* sqlite3.c:76589:20: */ +func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 { /* sqlite3.c:77210:20: */ if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Null) != 0 { return SQLITE_OK } @@ -53788,7 +54038,7 @@ func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 case SQLITE_AFF_BLOB: { // Really a cast to BLOB if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Blob) == 0 { - Xsqlite3ValueApplyAffinity(tls, pMem, SQLITE_AFF_TEXT, encoding) + Xsqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding) if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Str) != 0 { (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Blob)) @@ -53821,7 +54071,7 @@ func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 { *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16(((int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Blob) >> 3)) - Xsqlite3ValueApplyAffinity(tls, pMem, SQLITE_AFF_TEXT, encoding) + Xsqlite3ValueApplyAffinity(tls, pMem, uint8(SQLITE_AFF_TEXT), encoding) *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(((((MEM_Int | MEM_Real) | MEM_IntReal) | MEM_Blob) | MEM_Zero)))) return Xsqlite3VdbeChangeEncoding(tls, pMem, int32(encoding)) @@ -53834,7 +54084,7 @@ func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 // Initialize bulk memory to be a consistent Mem object. // // The minimum amount of initialization feasible is performed. -func Xsqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags U16) { /* sqlite3.c:76632:21: */ +func Xsqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags U16) { /* sqlite3.c:77253:21: */ (*Mem)(unsafe.Pointer(pMem)).Fflags = flags (*Mem)(unsafe.Pointer(pMem)).Fdb = db @@ -53851,21 +54101,21 @@ func Xsqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags U16) { / // 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 Xsqlite3VdbeMemSetNull(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:76652:21: */ +func Xsqlite3VdbeMemSetNull(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:77273:21: */ if (int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { vdbeMemClearExternAndSetNull(tls, pMem) } else { - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null) } } -func Xsqlite3ValueSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:76659:21: */ +func Xsqlite3ValueSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:77280:21: */ Xsqlite3VdbeMemSetNull(tls, p) } // Delete any previous value and set the value to be a BLOB of length // n containing all zeros. -func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlite3.c:76667:21: */ +func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlite3.c:77288:21: */ Xsqlite3VdbeMemRelease(tls, pMem) (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16(MEM_Blob | MEM_Zero)) (*Mem)(unsafe.Pointer(pMem)).Fn = 0 @@ -53873,38 +54123,38 @@ func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlit n = 0 } *(*int32)(unsafe.Pointer(pMem /* &.u */)) = n - (*Mem)(unsafe.Pointer(pMem)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(pMem)).Fenc = U8(SQLITE_UTF8) (*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0) } // 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 *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:76682:29: */ +func vdbeReleaseAndSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:77303:29: */ Xsqlite3VdbeMemSetNull(tls, pMem) *(*I64)(unsafe.Pointer(pMem /* &.u */)) = val - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) } // Delete any previous value and set the value stored in *pMem to val, // manifest type INTEGER. -func Xsqlite3VdbeMemSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:76692:21: */ +func Xsqlite3VdbeMemSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:77313:21: */ if (int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { vdbeReleaseAndSetInt64(tls, pMem, val) } else { *(*I64)(unsafe.Pointer(pMem /* &.u */)) = val - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) } } // A no-op destructor -func Xsqlite3NoopDestructor(tls *libc.TLS, p uintptr) { /* sqlite3.c:76702:21: */ +func Xsqlite3NoopDestructor(tls *libc.TLS, p uintptr) { /* sqlite3.c:77323:21: */ _ = p } // Set the value stored in *pMem should already be a NULL. // Also store a pointer to go with it. -func Xsqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:76708:21: */ +func Xsqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:77329:21: */ *(*uintptr)(unsafe.Pointer(pMem /* &.u */)) = func() uintptr { if zPType != 0 { @@ -53925,11 +54175,11 @@ func Xsqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType // Delete any previous value and set the value stored in *pMem to val, // manifest type REAL. -func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64) { /* sqlite3.c:76727:21: */ +func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64) { /* sqlite3.c:77348:21: */ Xsqlite3VdbeMemSetNull(tls, pMem) if !(Xsqlite3IsNaN(tls, val) != 0) { *(*float64)(unsafe.Pointer(pMem /* &.u */)) = val - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Real + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Real) } } @@ -53938,7 +54188,7 @@ func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64) { /* sql // // Return SQLITE_OK on success and SQLITE_NOMEM if a memory allocation // error occurs. -func Xsqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76754:20: */ +func Xsqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:77375:20: */ var db uintptr = (*Mem)(unsafe.Pointer(pMem)).Fdb var p uintptr @@ -53955,14 +54205,14 @@ func Xsqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c: // Return true if the Mem object contains a TEXT or BLOB that is // too large - whose size exceeds SQLITE_MAX_LENGTH. -func Xsqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76772:20: */ +func Xsqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:77393:20: */ if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & (MEM_Str | MEM_Blob)) != 0 { var n int32 = (*Mem)(unsafe.Pointer(p)).Fn if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Zero) != 0 { n = n + (*(*int32)(unsafe.Pointer(p /* &.u */))) } - return (libc.Bool32(n > *(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(p)).Fdb + 124 /* &.aLimit */))))) + return (libc.Bool32(n > *(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(p)).Fdb + 128 /* &.aLimit */))))) } return 0 } @@ -53971,13 +54221,13 @@ func Xsqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76772: // 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 *libc.TLS, pTo uintptr, pFrom uintptr, eType int32) { /* sqlite3.c:76828:29: */ +func vdbeClrCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, eType int32) { /* sqlite3.c:77449:29: */ vdbeMemClearExternAndSetNull(tls, pTo) Xsqlite3VdbeMemShallowCopy(tls, pTo, pFrom, eType) } -func Xsqlite3VdbeMemShallowCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, srcType int32) { /* sqlite3.c:76833:21: */ +func Xsqlite3VdbeMemShallowCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, srcType int32) { /* sqlite3.c:77454:21: */ if (int32((*Mem)(unsafe.Pointer((pTo))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { vdbeClrCopy(tls, pTo, pFrom, srcType) @@ -53993,7 +54243,7 @@ func Xsqlite3VdbeMemShallowCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, srcTy // Make a full copy of pFrom into pTo. Prior contents of pTo are // freed before the copy is made. -func Xsqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:76849:20: */ +func Xsqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:77470:20: */ var rc int32 = SQLITE_OK if (int32((*Mem)(unsafe.Pointer((pTo))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { @@ -54015,11 +54265,11 @@ func Xsqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* s // freed. If pFrom contains ephemeral data, a copy is made. // // pFrom contains an SQL NULL when this routine returns. -func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:76872:21: */ +func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:77493:21: */ Xsqlite3VdbeMemRelease(tls, pTo) libc.Xmemcpy(tls, pTo, pFrom, uint64(unsafe.Sizeof(Mem{}))) - (*Mem)(unsafe.Pointer(pFrom)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pFrom)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer(pFrom)).FszMalloc = 0 } @@ -54036,7 +54286,7 @@ func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3 // 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 Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n int32, enc U8, xDel uintptr) int32 { /* sqlite3.c:76898:20: */ +func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n int32, enc U8, xDel uintptr) int32 { /* sqlite3.c:77519:20: */ var nByte int32 = n // New value for pMem->n var iLimit int32 // Maximum allowed string or blob size var flags U16 = U16(0) // New value for pMem->flags @@ -54048,15 +54298,15 @@ func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n int32, enc } if (*Mem)(unsafe.Pointer(pMem)).Fdb != 0 { - iLimit = *(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(pMem)).Fdb + 124 /* &.aLimit */))) + iLimit = *(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(pMem)).Fdb + 128 /* &.aLimit */))) } else { iLimit = SQLITE_MAX_LENGTH } flags = func() uint16 { if int32(enc) == 0 { - return MEM_Blob + return uint16(MEM_Blob) } - return MEM_Str + return uint16(MEM_Str) }() if nByte < 0 { @@ -54145,17 +54395,17 @@ func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n int32, enc // // 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 Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pMem uintptr) int32 { /* sqlite3.c:77006:20: */ +func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pMem uintptr) int32 { /* sqlite3.c:77627:20: */ var rc int32 - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null) if Xsqlite3BtreeMaxRecordSize(tls, pCur) < (Sqlite3_int64(offset + amt)) { - return Xsqlite3CorruptError(tls, 77015) + return Xsqlite3CorruptError(tls, 77636) } if SQLITE_OK == (libc.AssignInt32(&rc, Xsqlite3VdbeMemClearAndResize(tls, pMem, (int32(amt+U32(1)))))) { rc = Xsqlite3BtreePayload(tls, pCur, offset, amt, (*Mem)(unsafe.Pointer(pMem)).Fz) if rc == SQLITE_OK { *(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(amt))) = int8(0) // Overrun area used when reading malformed records - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Blob + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Blob) (*Mem)(unsafe.Pointer(pMem)).Fn = int32(amt) } else { Xsqlite3VdbeMemRelease(tls, pMem) @@ -54164,7 +54414,7 @@ func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, return rc } -func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt U32, pMem uintptr) int32 { /* sqlite3.c:77029:20: */ +func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt U32, pMem uintptr) int32 { /* sqlite3.c:77650:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -54189,7 +54439,7 @@ func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt U32, pM // 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 *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:77061:35: */ +func valueToText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:77682:35: */ if (int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & (MEM_Blob | MEM_Str)) != 0 { if func() int32 { @@ -54234,7 +54484,7 @@ func valueToText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:770 // (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 Xsqlite3ValueText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:77104:27: */ +func Xsqlite3ValueText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:77725:27: */ if !(pVal != 0) { return uintptr(0) } @@ -54250,10 +54500,10 @@ func Xsqlite3ValueText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3 } // Create a new sqlite3_value object. -func Xsqlite3ValueNew(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:77122:30: */ +func Xsqlite3ValueNew(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:77743:30: */ var p uintptr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Mem{}))) if p != 0 { - (*Mem)(unsafe.Pointer(p)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer(p)).Fdb = db } return p @@ -54267,7 +54517,7 @@ type ValueNewStat4Ctx = struct { FppRec uintptr FiVal int32 _ [4]byte -} /* sqlite3.c:77135:1 */ +} /* sqlite3.c:77756:1 */ // Allocate and return a pointer to a new sqlite3_value object. If // the second argument to this function is NULL, the object is allocated @@ -54278,7 +54528,7 @@ type ValueNewStat4Ctx = struct { // 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 *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:77153:22: */ +func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:77774:22: */ if p != 0 { var pRec uintptr = *(*uintptr)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FppRec)) @@ -54296,7 +54546,7 @@ func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:77153 (*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem = (pRec + uintptr((((uint64(unsafe.Sizeof(UnpackedRecord{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7))))) for i = 0; i < nCol; i++ { - (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fflags = U16(MEM_Null) (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fdb = db } } else { @@ -54334,7 +54584,7 @@ func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:77153 // If the conditions above are not met, this function returns SQLITE_OK // and sets (*ppVal) to NULL. Or, if an error occurs, (*ppVal) is set to // NULL and an SQLite error code returned. -func valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc U8, aff U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:77215:12: */ +func valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc U8, aff U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:77836:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -54364,7 +54614,7 @@ __1: pFunc = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), nVal, enc, uint8(0)) if !((((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & (U32(SQLITE_FUNC_CONSTANT | SQLITE_FUNC_SLOCHNG))) == U32(0)) || - (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0)) { + (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0)) { goto __2 } return SQLITE_OK @@ -54424,7 +54674,7 @@ __9: Xsqlite3ErrorMsg(tls, (*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, ts+824 /* "%s" */, libc.VaList(bp, Xsqlite3_value_text(tls, pVal))) goto __11 __10: - Xsqlite3ValueApplyAffinity(tls, pVal, aff, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = Xsqlite3VdbeChangeEncoding(tls, pVal, int32(enc)) if !((rc == SQLITE_OK) && (Xsqlite3VdbeMemTooBig(tls, pVal) != 0)) { @@ -54477,7 +54727,7 @@ __14: // 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 *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:77309:12: */ +func valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:77930:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -54525,8 +54775,8 @@ __3: if !(*(*uintptr)(unsafe.Pointer(ppVal)) != 0) { goto __5 } - Xsqlite3VdbeMemCast(tls, *(*uintptr)(unsafe.Pointer(ppVal)), aff, SQLITE_UTF8) - Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(ppVal)), affinity, SQLITE_UTF8) + Xsqlite3VdbeMemCast(tls, *(*uintptr)(unsafe.Pointer(ppVal)), aff, uint8(SQLITE_UTF8)) + Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(ppVal)), affinity, uint8(SQLITE_UTF8)) __5: ; return rc @@ -54542,7 +54792,7 @@ __4: pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop) negInt = -1 - zNeg = ts + 6585 /* "-" */ + zNeg = ts + 6661 /* "-" */ __6: ; @@ -54556,29 +54806,29 @@ __6: goto no_mem __9: ; - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_IntValue)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_IntValue))) != U32(0)) { goto __10 } Xsqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), (I64(*(*int32)(unsafe.Pointer(pExpr + 8 /* &.u */))) * I64(negInt))) goto __11 __10: - zVal = Xsqlite3MPrintf(tls, db, ts+6587 /* "%s%s" */, libc.VaList(bp, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)))) + zVal = Xsqlite3MPrintf(tls, db, ts+6663 /* "%s%s" */, libc.VaList(bp, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)))) if !(zVal == uintptr(0)) { goto __12 } goto no_mem __12: ; - Xsqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), -1, zVal, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) + Xsqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), -1, zVal, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) __11: ; if !(((op == TK_INTEGER) || (op == TK_FLOAT)) && (int32(affinity) == SQLITE_AFF_BLOB)) { goto __13 } - Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), SQLITE_AFF_NUMERIC, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), uint8(SQLITE_AFF_NUMERIC), uint8(SQLITE_UTF8)) goto __14 __13: - Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), affinity, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), affinity, uint8(SQLITE_UTF8)) __14: ; @@ -54673,7 +54923,7 @@ __30: if !(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) != 0) { goto __33 } - (*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags = MEM_Int + (*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */)) = (I64(libc.Bool32(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + 4))) == 0))) __33: ; @@ -54719,7 +54969,7 @@ __35: // 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 Xsqlite3ValueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:77464:20: */ +func Xsqlite3ValueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:78085:20: */ if pExpr != 0 { return valueFromExpr(tls, db, pExpr, enc, affinity, ppVal, uintptr(0)) } @@ -54742,7 +54992,7 @@ func Xsqlite3ValueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, aff // // On success, *ppVal is made to point to the extracted value. The caller // is responsible for ensuring that the value is eventually freed. -func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, pAlloc uintptr, ppVal uintptr) int32 { /* sqlite3.c:77493:12: */ +func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, pAlloc uintptr, ppVal uintptr) int32 { /* sqlite3.c:78114:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -54758,7 +55008,7 @@ func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U if *(*uintptr)(unsafe.Pointer(bp /* pVal */)) != 0 { Xsqlite3VdbeMemSetNull(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) } - } else if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_EnableQPSG) == uint64(0)) { + } else if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableQPSG)) == uint64(0)) { var v uintptr var iBindVar int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iBindVar) @@ -54810,7 +55060,7 @@ func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U // Unless an error is encountered, SQLITE_OK is returned. It is not an // error if a value cannot be extracted from pExpr. If an error does // occur, an SQLite error code is returned. -func Xsqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppRec uintptr, pExpr uintptr, nElem int32, iVal int32, pnExtract uintptr) int32 { /* sqlite3.c:77568:20: */ +func Xsqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppRec uintptr, pExpr uintptr, nElem int32, iVal int32, pnExtract uintptr) int32 { /* sqlite3.c:78189:20: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -54855,7 +55105,7 @@ func Xsqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppR // (e.g. OOM), return SQLITE_OK and set *ppVal to NULL. Or, if an error // does occur, return an SQLite error code. The final value of *ppVal // is undefined in this case. -func Xsqlite3Stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:77613:20: */ +func Xsqlite3Stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:78234:20: */ return stat4ValueFromExpr(tls, pParse, pExpr, affinity, uintptr(0), ppVal) } @@ -54865,7 +55115,7 @@ func Xsqlite3Stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, af // // If *ppVal is initially NULL then the caller is responsible for // ensuring that the value written into *ppVal is eventually freed. -func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iCol int32, ppVal uintptr) int32 { /* sqlite3.c:77630:20: */ +func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iCol int32, ppVal uintptr) int32 { /* sqlite3.c:78251:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -54889,7 +55139,7 @@ func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC return Xsqlite3GetVarint32(tls, a, bp /* &nHdr */) }()) if (*(*int32)(unsafe.Pointer(bp /* nHdr */)) > nRec) || (iHdr >= *(*int32)(unsafe.Pointer(bp /* nHdr */))) { - return Xsqlite3CorruptError(tls, 77648) + return Xsqlite3CorruptError(tls, 78269) } iField = *(*int32)(unsafe.Pointer(bp /* nHdr */)) for i = 0; i <= iCol; i++ { @@ -54904,14 +55154,14 @@ func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC }())) if iHdr > *(*int32)(unsafe.Pointer(bp /* nHdr */)) { - return Xsqlite3CorruptError(tls, 77654) + return Xsqlite3CorruptError(tls, 78275) } szField = int32(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 4 /* t */)))) iField = iField + (szField) } if iField > nRec { - return Xsqlite3CorruptError(tls, 77660) + return Xsqlite3CorruptError(tls, 78281) } if pMem == uintptr(0) { pMem = libc.AssignPtrUintptr(ppVal, Xsqlite3ValueNew(tls, db)) @@ -54927,7 +55177,7 @@ func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC // Unless it is NULL, the argument must be an UnpackedRecord object returned // by an earlier call to sqlite3Stat4ProbeSetValue(). This call deletes // the object. -func Xsqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { /* sqlite3.c:77675:21: */ +func Xsqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { /* sqlite3.c:78296:21: */ if pRec != 0 { var i int32 var nCol int32 = int32((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo)).FnAllField) @@ -54942,14 +55192,14 @@ func Xsqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { /* sqlite3.c:77675:21 } // Change the string value of an sqlite3_value object -func Xsqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc U8, xDel uintptr) { /* sqlite3.c:77693:21: */ +func Xsqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc U8, xDel uintptr) { /* sqlite3.c:78314:21: */ if v != 0 { Xsqlite3VdbeMemSetStr(tls, v, z, n, enc, xDel) } } // Free an sqlite3_value object -func Xsqlite3ValueFree(tls *libc.TLS, v uintptr) { /* sqlite3.c:77706:21: */ +func Xsqlite3ValueFree(tls *libc.TLS, v uintptr) { /* sqlite3.c:78327:21: */ if !(v != 0) { return } @@ -54960,14 +55210,14 @@ func Xsqlite3ValueFree(tls *libc.TLS, v uintptr) { /* sqlite3.c:77706:21: */ // 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 *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:77717:28: */ +func valueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:78338:28: */ if valueToText(tls, pVal, enc) != uintptr(0) { return (*Sqlite3_value)(unsafe.Pointer(pVal)).Fn } return 0 } -func Xsqlite3ValueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:77720:20: */ +func Xsqlite3ValueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:78341:20: */ var p uintptr = pVal if ((int32((*Mem)(unsafe.Pointer(p)).Fflags) & MEM_Str) != 0) && (int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc)) { @@ -54987,7 +55237,7 @@ func Xsqlite3ValueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3. } // Create a new virtual database engine. -func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:77763:21: */ +func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:78384:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var p uintptr p = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(Vdbe{}))) @@ -55002,7 +55252,7 @@ func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:77 (*Vdbe)(unsafe.Pointer(p)).FpNext = (*Sqlite3)(unsafe.Pointer(db)).FpVdbe (*Vdbe)(unsafe.Pointer(p)).FpPrev = uintptr(0) (*Sqlite3)(unsafe.Pointer(db)).FpVdbe = p - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_INIT + (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic = U32(VDBE_MAGIC_INIT) (*Vdbe)(unsafe.Pointer(p)).FpParse = pParse (*Parse)(unsafe.Pointer(pParse)).FpVdbe = p @@ -55011,12 +55261,12 @@ func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:77 } // Return the Parse object that owns a Vdbe object. -func Xsqlite3VdbeParser(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:77790:22: */ +func Xsqlite3VdbeParser(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:78411:22: */ return (*Vdbe)(unsafe.Pointer(p)).FpParse } // Change the error string stored in Vdbe.zErrMsg -func Xsqlite3VdbeError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:77797:21: */ +func Xsqlite3VdbeError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:78418:21: */ var ap Va_list _ = ap Xsqlite3DbFree(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg) @@ -55026,7 +55276,7 @@ func Xsqlite3VdbeError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { } // Remember the SQL string for a prepared statement. -func Xsqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags U8) { /* sqlite3.c:77808:21: */ +func Xsqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags U8) { /* sqlite3.c:78429:21: */ if p == uintptr(0) { return } @@ -55039,7 +55289,7 @@ func Xsqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags } // Swap all content between two VDBE structures. -func Xsqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:77858:21: */ +func Xsqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:78479:21: */ var tmp Vdbe var pTmp uintptr var zTmp uintptr @@ -55070,7 +55320,7 @@ func Xsqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:7785 // SQLITE_NOMEM. In this case Vdbe.aOp and Vdbe.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 *libc.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:77895:12: */ +func growOpArray(tls *libc.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:78516:12: */ var pNew uintptr var p uintptr = (*Vdbe)(unsafe.Pointer(v)).FpParse @@ -55090,7 +55340,7 @@ func growOpArray(tls *libc.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:77895 _ = nOp // Ensure that the size of a VDBE does not grow too large - if nNew > Sqlite3_int64(*(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(p)).Fdb + 124 /* &.aLimit */) + 5*4))) { + if nNew > Sqlite3_int64(*(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(p)).Fdb + 128 /* &.aLimit */) + 5*4))) { Xsqlite3OomFault(tls, (*Parse)(unsafe.Pointer(p)).Fdb) return SQLITE_NOMEM } @@ -55123,7 +55373,7 @@ func growOpArray(tls *libc.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:77895 // Use the sqlite3VdbeResolveLabel() function to fix an address and // the sqlite3VdbeChangeP4() function to change the value of the P4 // operand. -func growOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:77966:28: */ +func growOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:78587:28: */ if growOpArray(tls, p, 1) != 0 { return 1 @@ -55132,7 +55382,7 @@ func growOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) i return Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3) } -func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:77972:20: */ +func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:78593:20: */ var i int32 var pOp uintptr @@ -55149,31 +55399,31 @@ func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = p2 (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = p3 *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0) - (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = P4_NOTUSED + (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(P4_NOTUSED) (*VdbeOp)(unsafe.Pointer(pOp)).FzComment = uintptr(0) return i } -func Xsqlite3VdbeAddOp0(tls *libc.TLS, p uintptr, op int32) int32 { /* sqlite3.c:78009:20: */ +func Xsqlite3VdbeAddOp0(tls *libc.TLS, p uintptr, op int32) int32 { /* sqlite3.c:78630:20: */ return Xsqlite3VdbeAddOp3(tls, p, op, 0, 0, 0) } -func Xsqlite3VdbeAddOp1(tls *libc.TLS, p uintptr, op int32, p1 int32) int32 { /* sqlite3.c:78012:20: */ +func Xsqlite3VdbeAddOp1(tls *libc.TLS, p uintptr, op int32, p1 int32) int32 { /* sqlite3.c:78633:20: */ return Xsqlite3VdbeAddOp3(tls, p, op, p1, 0, 0) } -func Xsqlite3VdbeAddOp2(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32) int32 { /* sqlite3.c:78015:20: */ +func Xsqlite3VdbeAddOp2(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32) int32 { /* sqlite3.c:78636:20: */ return Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, 0) } // Generate code for an unconditional jump to instruction iDest -func Xsqlite3VdbeGoto(tls *libc.TLS, p uintptr, iDest int32) int32 { /* sqlite3.c:78021:20: */ +func Xsqlite3VdbeGoto(tls *libc.TLS, p uintptr, iDest int32) int32 { /* sqlite3.c:78642:20: */ return Xsqlite3VdbeAddOp3(tls, p, OP_Goto, 0, iDest, 0) } // Generate code to cause the string zStr to be loaded into // register iDest -func Xsqlite3VdbeLoadString(tls *libc.TLS, p uintptr, iDest int32, zStr uintptr) int32 { /* sqlite3.c:78028:20: */ +func Xsqlite3VdbeLoadString(tls *libc.TLS, p uintptr, iDest int32, zStr uintptr) int32 { /* sqlite3.c:78649:20: */ return Xsqlite3VdbeAddOp4(tls, p, OP_String8, 0, iDest, 0, zStr, 0) } @@ -55186,7 +55436,7 @@ func Xsqlite3VdbeLoadString(tls *libc.TLS, p uintptr, iDest int32, zStr uintptr) // // If the input string does not end with "X" then an OP_ResultRow instruction // is generated for the values inserted. -func Xsqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr, va uintptr) { /* sqlite3.c:78043:21: */ +func Xsqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr, va uintptr) { /* sqlite3.c:78664:21: */ var ap Va_list _ = ap var i int32 @@ -55234,7 +55484,7 @@ skip_op_resultrow: } // Add an opcode that includes the p4 value as a pointer. -func Xsqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:78066:20: */ +func Xsqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:78687:20: */ var addr int32 = Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3) Xsqlite3VdbeChangeP4(tls, p, addr, zP4, p4type) return addr @@ -55248,7 +55498,7 @@ func Xsqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // NC_IdxExpr means called as part of an index expression. NC_PartIdx // means in the WHERE clause of a partial index. NC_GenCol means called // while computing a generated column value. 0 is the usual case. -func Xsqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) int32 { /* sqlite3.c:78090:20: */ +func Xsqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) int32 { /* sqlite3.c:78711:20: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var nByte int32 var addr int32 @@ -55280,7 +55530,7 @@ func Xsqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int // Add an opcode that includes the p4 value with a P4_INT64 or // P4_REAL type. -func Xsqlite3VdbeAddOp4Dup8(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:78127:20: */ +func Xsqlite3VdbeAddOp4Dup8(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:78748:20: */ var p4copy uintptr = Xsqlite3DbMallocRawNN(tls, Xsqlite3VdbeDb(tls, p), uint64(8)) if p4copy != 0 { libc.Xmemcpy(tls, p4copy, zP4, uint64(8)) @@ -55290,7 +55540,7 @@ func Xsqlite3VdbeAddOp4Dup8(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int // Return the address of the current EXPLAIN QUERY PLAN baseline. // 0 means "none". -func Xsqlite3VdbeExplainParent(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:78146:20: */ +func Xsqlite3VdbeExplainParent(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:78767:20: */ var pOp uintptr if (*Parse)(unsafe.Pointer(pParse)).FaddrExplain == 0 { return 0 @@ -55306,7 +55556,7 @@ func Xsqlite3VdbeExplainParent(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3 // // If the bPush flag is true, then make this opcode the parent for // subsequent Explains until sqlite3VdbeExplainPop() is called. -func Xsqlite3VdbeExplain(tls *libc.TLS, pParse uintptr, bPush U8, zFmt uintptr, va uintptr) { /* sqlite3.c:78170:21: */ +func Xsqlite3VdbeExplain(tls *libc.TLS, pParse uintptr, bPush U8, zFmt uintptr, va uintptr) { /* sqlite3.c:78791:21: */ // Always include the OP_Explain opcodes if SQLITE_DEBUG is defined. // But omit them (for performance) during production builds if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 { @@ -55330,7 +55580,7 @@ func Xsqlite3VdbeExplain(tls *libc.TLS, pParse uintptr, bPush U8, zFmt uintptr, } // Pop the EXPLAIN QUERY PLAN stack one level. -func Xsqlite3VdbeExplainPop(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:78198:21: */ +func Xsqlite3VdbeExplainPop(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:78819:21: */ (*Parse)(unsafe.Pointer(pParse)).FaddrExplain = Xsqlite3VdbeExplainParent(tls, pParse) } @@ -55341,16 +55591,18 @@ func Xsqlite3VdbeExplainPop(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:78198: // // The zWhere string must have been obtained from sqlite3_malloc(). // This routine will take ownership of the allocated memory. -func Xsqlite3VdbeAddParseSchemaOp(tls *libc.TLS, p uintptr, iDb int32, zWhere uintptr) { /* sqlite3.c:78212:21: */ +func Xsqlite3VdbeAddParseSchemaOp(tls *libc.TLS, p uintptr, iDb int32, zWhere uintptr, p5 U16) { /* sqlite3.c:78833:21: */ var j int32 Xsqlite3VdbeAddOp4(tls, p, OP_ParseSchema, iDb, 0, 0, zWhere, -7) + Xsqlite3VdbeChangeP5(tls, p, p5) for j = 0; j < (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FnDb; j++ { Xsqlite3VdbeUsesBtree(tls, p, j) } + Xsqlite3MayAbort(tls, (*Vdbe)(unsafe.Pointer(p)).FpParse) } // Add an opcode that includes the p4 value as an integer. -func Xsqlite3VdbeAddOp4Int(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, p4 int32) int32 { /* sqlite3.c:78221:20: */ +func Xsqlite3VdbeAddOp4Int(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, p4 int32) int32 { /* sqlite3.c:78844:20: */ var addr int32 = Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3) if int32((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed) == 0 { var pOp uintptr = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*32) @@ -55361,7 +55613,7 @@ func Xsqlite3VdbeAddOp4Int(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int3 } // Insert the end of a co-routine -func Xsqlite3VdbeEndCoroutine(tls *libc.TLS, v uintptr, regYield int32) { /* sqlite3.c:78240:21: */ +func Xsqlite3VdbeEndCoroutine(tls *libc.TLS, v uintptr, regYield int32) { /* sqlite3.c:78863:21: */ Xsqlite3VdbeAddOp1(tls, v, OP_EndCoroutine, regYield) // Clear the temporary register cache, thereby ensuring that each @@ -55396,14 +55648,14 @@ func Xsqlite3VdbeEndCoroutine(tls *libc.TLS, v uintptr, regYield int32) { /* sql // been issued. The negative is stored because // that gives a performance improvement over storing // the equivalent positive value. -func Xsqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:78278:20: */ +func Xsqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:78901:20: */ return libc.PreDecInt32(&(*Parse)(unsafe.Pointer(pParse)).FnLabel, 1) } // 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 resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { /* sqlite3.c:78287:29: */ +func resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { /* sqlite3.c:78910:29: */ var nNewSize int32 = (10 - (*Parse)(unsafe.Pointer(p)).FnLabel) (*Parse)(unsafe.Pointer(p)).FaLabel = Xsqlite3DbReallocOrFree(tls, (*Parse)(unsafe.Pointer(p)).Fdb, (*Parse)(unsafe.Pointer(p)).FaLabel, (uint64(uint64(nNewSize) * uint64(unsafe.Sizeof(int32(0)))))) @@ -55415,7 +55667,7 @@ func resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { /* sqlit } } -func Xsqlite3VdbeResolveLabel(tls *libc.TLS, v uintptr, x int32) { /* sqlite3.c:78302:21: */ +func Xsqlite3VdbeResolveLabel(tls *libc.TLS, v uintptr, x int32) { /* sqlite3.c:78925:21: */ var p uintptr = (*Vdbe)(unsafe.Pointer(v)).FpParse var j int32 = ^x @@ -55428,12 +55680,12 @@ func Xsqlite3VdbeResolveLabel(tls *libc.TLS, v uintptr, x int32) { /* sqlite3.c: } // Mark the VDBE as one that can only be run one time. -func Xsqlite3VdbeRunOnlyOnce(tls *libc.TLS, p uintptr) { /* sqlite3.c:78324:21: */ +func Xsqlite3VdbeRunOnlyOnce(tls *libc.TLS, p uintptr) { /* sqlite3.c:78947:21: */ libc.SetBitFieldPtr16Uint32(p+200 /* &.runOnlyOnce */, Bft(1), 5, 0x20) } // Mark the VDBE as one that can only be run multiple times. -func Xsqlite3VdbeReusable(tls *libc.TLS, p uintptr) { /* sqlite3.c:78331:21: */ +func Xsqlite3VdbeReusable(tls *libc.TLS, p uintptr) { /* sqlite3.c:78954:21: */ libc.SetBitFieldPtr16Uint32(p+200 /* &.runOnlyOnce */, Bft(0), 5, 0x20) } @@ -55456,7 +55708,7 @@ func Xsqlite3VdbeReusable(tls *libc.TLS, p uintptr) { /* sqlite3.c:78331:21: */ // 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 *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3.c:78527:13: */ +func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3.c:79150:13: */ var nMaxArgs int32 = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) var pOp uintptr var pParse uintptr = (*Vdbe)(unsafe.Pointer(p)).FpParse @@ -55585,7 +55837,7 @@ func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite } // Return the address of the next instruction to be inserted. -func Xsqlite3VdbeCurrentAddr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:78629:20: */ +func Xsqlite3VdbeCurrentAddr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79252:20: */ return (*Vdbe)(unsafe.Pointer(p)).FnOp } @@ -55616,7 +55868,7 @@ func Xsqlite3VdbeCurrentAddr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:7862 // 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 Xsqlite3VdbeTakeOpArray(tls *libc.TLS, p uintptr, pnOp uintptr, pnMaxArg uintptr) uintptr { /* sqlite3.c:78686:23: */ +func Xsqlite3VdbeTakeOpArray(tls *libc.TLS, p uintptr, pnOp uintptr, pnMaxArg uintptr) uintptr { /* sqlite3.c:79309:23: */ var aOp uintptr = (*Vdbe)(unsafe.Pointer(p)).FaOp // Check that sqlite3VdbeUsesBtree() was not called on this VM @@ -55632,7 +55884,7 @@ func Xsqlite3VdbeTakeOpArray(tls *libc.TLS, p uintptr, pnOp uintptr, pnMaxArg ui // // Non-zero P2 arguments to jump instructions are automatically adjusted // so that the jump target is relative to the first operation inserted. -func Xsqlite3VdbeAddOpList(tls *libc.TLS, p uintptr, nOp int32, aOp uintptr, iLineno int32) uintptr { /* sqlite3.c:78706:23: */ +func Xsqlite3VdbeAddOpList(tls *libc.TLS, p uintptr, nOp int32, aOp uintptr, iLineno int32) uintptr { /* sqlite3.c:79329:23: */ var i int32 var pOut uintptr var pFirst uintptr @@ -55655,7 +55907,7 @@ __1: *(*int32)(unsafe.Pointer(pOut + 8 /* &.p2 */)) += ((*Vdbe)(unsafe.Pointer(p)).FnOp) } (*VdbeOp)(unsafe.Pointer(pOut)).Fp3 = int32((*VdbeOpList)(unsafe.Pointer(aOp)).Fp3) - (*VdbeOp)(unsafe.Pointer(pOut)).Fp4type = P4_NOTUSED + (*VdbeOp)(unsafe.Pointer(pOut)).Fp4type = int8(P4_NOTUSED) *(*uintptr)(unsafe.Pointer(pOut + 16 /* &.p4 */)) = uintptr(0) (*VdbeOp)(unsafe.Pointer(pOut)).Fp5 = U16(0) (*VdbeOp)(unsafe.Pointer(pOut)).FzComment = uintptr(0) @@ -55677,23 +55929,23 @@ __3: // Change the value of the opcode, or P1, P2, P3, or P5 operands // for a specific instruction. -func Xsqlite3VdbeChangeOpcode(tls *libc.TLS, p uintptr, addr int32, iNewOpcode U8) { /* sqlite3.c:78782:21: */ +func Xsqlite3VdbeChangeOpcode(tls *libc.TLS, p uintptr, addr int32, iNewOpcode U8) { /* sqlite3.c:79405:21: */ (*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fopcode = iNewOpcode } -func Xsqlite3VdbeChangeP1(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:78785:21: */ +func Xsqlite3VdbeChangeP1(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:79408:21: */ (*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp1 = val } -func Xsqlite3VdbeChangeP2(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:78788:21: */ +func Xsqlite3VdbeChangeP2(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:79411:21: */ (*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp2 = val } -func Xsqlite3VdbeChangeP3(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:78791:21: */ +func Xsqlite3VdbeChangeP3(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:79414:21: */ (*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp3 = val } -func Xsqlite3VdbeChangeP5(tls *libc.TLS, p uintptr, p5 U16) { /* sqlite3.c:78794:21: */ +func Xsqlite3VdbeChangeP5(tls *libc.TLS, p uintptr, p5 U16) { /* sqlite3.c:79417:21: */ if (*Vdbe)(unsafe.Pointer(p)).FnOp > 0 { (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*32)).Fp5 = p5 @@ -55702,7 +55954,7 @@ func Xsqlite3VdbeChangeP5(tls *libc.TLS, p uintptr, p5 U16) { /* sqlite3.c:78794 // Change the P2 operand of instruction addr so that it points to // the address of the next instruction to be coded. -func Xsqlite3VdbeJumpHere(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:78803:21: */ +func Xsqlite3VdbeJumpHere(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:79426:21: */ Xsqlite3VdbeChangeP2(tls, p, addr, (*Vdbe)(unsafe.Pointer(p)).FnOp) } @@ -55717,7 +55969,7 @@ func Xsqlite3VdbeJumpHere(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:7 // // 7 Once 0 8 0 // 8 ... -func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:78820:21: */ +func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:79443:21: */ if addr == ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1) { (*Vdbe)(unsafe.Pointer(p)).FnOp-- @@ -55728,26 +55980,26 @@ func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { /* sq // If the input FuncDef structure is ephemeral, then free it. If // the FuncDef is not ephermal, then do nothing. -func freeEphemeralFunction(tls *libc.TLS, db uintptr, pDef uintptr) { /* sqlite3.c:78840:13: */ - if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_EPHEM) != U32(0) { +func freeEphemeralFunction(tls *libc.TLS, db uintptr, pDef uintptr) { /* sqlite3.c:79463:13: */ + if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_EPHEM)) != U32(0) { Xsqlite3DbFreeNN(tls, db, pDef) } } // Delete a P4 value if necessary. -func freeP4Mem(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:78849:29: */ +func freeP4Mem(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:79472:29: */ if (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 { Xsqlite3DbFree(tls, db, (*Mem)(unsafe.Pointer(p)).FzMalloc) } Xsqlite3DbFreeNN(tls, db, p) } -func freeP4FuncCtx(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:78853:29: */ +func freeP4FuncCtx(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:79476:29: */ freeEphemeralFunction(tls, db, (*Sqlite3_context)(unsafe.Pointer(p)).FpFunc) Xsqlite3DbFreeNN(tls, db, p) } -func freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { /* sqlite3.c:78857:13: */ +func freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { /* sqlite3.c:79480:13: */ switch p4type { case -16: @@ -55808,7 +56060,7 @@ func freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { /* sqlite3.c: // 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 *libc.TLS, db uintptr, aOp uintptr, nOp int32) { /* sqlite3.c:78906:13: */ +func vdbeFreeOpArray(tls *libc.TLS, db uintptr, aOp uintptr, nOp int32) { /* sqlite3.c:79529:13: */ if aOp != 0 { var pOp uintptr for pOp = (aOp + uintptr((nOp-1))*32); pOp >= aOp; pOp -= 32 { @@ -55824,18 +56076,18 @@ func vdbeFreeOpArray(tls *libc.TLS, db uintptr, aOp uintptr, nOp int32) { /* sql // 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 Xsqlite3VdbeLinkSubProgram(tls *libc.TLS, pVdbe uintptr, p uintptr) { /* sqlite3.c:78924:21: */ +func Xsqlite3VdbeLinkSubProgram(tls *libc.TLS, pVdbe uintptr, p uintptr) { /* sqlite3.c:79547:21: */ (*SubProgram)(unsafe.Pointer(p)).FpNext = (*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram (*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram = p } // Return true if the given Vdbe has any SubPrograms. -func Xsqlite3VdbeHasSubProgram(tls *libc.TLS, pVdbe uintptr) int32 { /* sqlite3.c:78932:20: */ +func Xsqlite3VdbeHasSubProgram(tls *libc.TLS, pVdbe uintptr) int32 { /* sqlite3.c:79555:20: */ return (libc.Bool32((*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram != uintptr(0))) } // Change the opcode at addr into OP_Noop -func Xsqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) int32 { /* sqlite3.c:78939:20: */ +func Xsqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) int32 { /* sqlite3.c:79562:20: */ var pOp uintptr if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 { return 0 @@ -55843,15 +56095,15 @@ func Xsqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) int32 { /* s pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*32) freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) - (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = P4_NOTUSED + (*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(P4_NOTUSED) *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0) - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Noop + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Noop) return 1 } // 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 Xsqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op U8) int32 { /* sqlite3.c:78955:20: */ +func Xsqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op U8) int32 { /* sqlite3.c:79578:20: */ if ((*Vdbe)(unsafe.Pointer(p)).FnOp > 0) && (int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*32)).Fopcode) == int32(op)) { return Xsqlite3VdbeChangeToNoop(tls, p, ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1)) } else { @@ -55875,7 +56127,7 @@ func Xsqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op U8) int32 { /* s // 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 *libc.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int32) { /* sqlite3.c:79015:29: */ +func vdbeChangeP4Full(tls *libc.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int32) { /* sqlite3.c:79638:29: */ if (*Op)(unsafe.Pointer(pOp)).Fp4type != 0 { freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*Op)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) (*Op)(unsafe.Pointer(pOp)).Fp4type = int8(0) @@ -55892,7 +56144,7 @@ func vdbeChangeP4Full(tls *libc.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int3 } } -func Xsqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, zP4 uintptr, n int32) { /* sqlite3.c:79034:21: */ +func Xsqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, zP4 uintptr, n int32) { /* sqlite3.c:79657:21: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = zP4 @@ -55939,7 +56191,7 @@ func Xsqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, zP4 uintptr, n i // 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 Xsqlite3VdbeAppendP4(tls *libc.TLS, p uintptr, pP4 uintptr, n int32) { /* sqlite3.c:79077:21: */ +func Xsqlite3VdbeAppendP4(tls *libc.TLS, p uintptr, pP4 uintptr, n int32) { /* sqlite3.c:79700:21: */ var pOp uintptr if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 { @@ -55955,7 +56207,7 @@ func Xsqlite3VdbeAppendP4(tls *libc.TLS, p uintptr, pP4 uintptr, n int32) { /* s // Set the P4 on the most recently added opcode to the KeyInfo for the // index given. -func Xsqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr) { /* sqlite3.c:79097:21: */ +func Xsqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr) { /* sqlite3.c:79720:21: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var pKeyInfo uintptr @@ -55969,7 +56221,7 @@ func Xsqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr) { /* // 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 *libc.TLS, p uintptr, zFormat uintptr, ap Va_list) { /* sqlite3.c:79113:13: */ +func vdbeVComment(tls *libc.TLS, p uintptr, zFormat uintptr, ap Va_list) { /* sqlite3.c:79736:13: */ if (*Vdbe)(unsafe.Pointer(p)).FnOp != 0 { @@ -55978,7 +56230,7 @@ func vdbeVComment(tls *libc.TLS, p uintptr, zFormat uintptr, ap Va_list) { /* sq } } -func Xsqlite3VdbeComment(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:79123:21: */ +func Xsqlite3VdbeComment(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:79746:21: */ var ap Va_list _ = ap if p != 0 { @@ -55988,7 +56240,7 @@ func Xsqlite3VdbeComment(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) } } -func Xsqlite3VdbeNoopComment(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:79131:21: */ +func Xsqlite3VdbeNoopComment(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:79754:21: */ var ap Va_list _ = ap if p != 0 { @@ -56010,7 +56262,7 @@ func Xsqlite3VdbeNoopComment(tls *libc.TLS, p uintptr, zFormat uintptr, va uintp // 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 Xsqlite3VdbeGetOp(tls *libc.TLS, p uintptr, addr int32) uintptr { /* sqlite3.c:79164:23: */ // Ignore the MSVC warning about no initializer +func Xsqlite3VdbeGetOp(tls *libc.TLS, p uintptr, addr int32) uintptr { /* sqlite3.c:79787:23: */ // Ignore the MSVC warning about no initializer if addr < 0 { addr = ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1) @@ -56024,11 +56276,11 @@ func Xsqlite3VdbeGetOp(tls *libc.TLS, p uintptr, addr int32) uintptr { /* sqlite return uintptr(0) } -var dummy VdbeOp /* sqlite3.c:79167:17: */ +var dummy VdbeOp /* sqlite3.c:79790:17: */ // Return an integer value for one of the parameters to the opcode pOp // determined by character c. -func translateP(tls *libc.TLS, c int8, pOp uintptr) int32 { /* sqlite3.c:79185:12: */ +func translateP(tls *libc.TLS, c int8, pOp uintptr) int32 { /* sqlite3.c:79808:12: */ if int32(c) == '1' { return (*Op)(unsafe.Pointer(pOp)).Fp1 } @@ -56055,7 +56307,7 @@ func translateP(tls *libc.TLS, c int8, pOp uintptr) int32 { /* sqlite3.c:79185:1 // "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 Xsqlite3VdbeDisplayComment(tls *libc.TLS, db uintptr, pOp uintptr, zP4 uintptr) uintptr { /* sqlite3.c:79206:21: */ +func Xsqlite3VdbeDisplayComment(tls *libc.TLS, db uintptr, pOp uintptr, zP4 uintptr) uintptr { /* sqlite3.c:79829:21: */ bp := tls.Alloc(162) defer tls.Free(162) @@ -56074,11 +56326,11 @@ func Xsqlite3VdbeDisplayComment(tls *libc.TLS, db uintptr, pOp uintptr, zP4 uint var seenCom int32 = 0 var c int8 zSynopsis = libc.AssignAddUintptr(&zOpName, (uintptr(nOpName + 1))) - if libc.Xstrncmp(tls, zSynopsis, ts+6592 /* "IF " */, uint64(3)) == 0 { + if libc.Xstrncmp(tls, zSynopsis, ts+6668 /* "IF " */, uint64(3)) == 0 { if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_STOREP2) != 0 { - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zAlt[0] */, ts+6596 /* "r[P2] = (%s)" */, libc.VaList(bp, (zSynopsis+uintptr(3)))) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zAlt[0] */, ts+6672 /* "r[P2] = (%s)" */, libc.VaList(bp, (zSynopsis+uintptr(3)))) } else { - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zAlt[0] */, ts+6609 /* "if %s goto P2" */, libc.VaList(bp+8, (zSynopsis+uintptr(3)))) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zAlt[0] */, ts+6685 /* "if %s goto P2" */, libc.VaList(bp+8, (zSynopsis+uintptr(3)))) } zSynopsis = bp + 112 /* &zAlt[0] */ } @@ -56093,33 +56345,33 @@ func Xsqlite3VdbeDisplayComment(tls *libc.TLS, db uintptr, pOp uintptr, zP4 uint } else { var v1 int32 = translateP(tls, c, pOp) var v2 int32 - if libc.Xstrncmp(tls, ((zSynopsis+uintptr(ii))+uintptr(1)), ts+6623 /* "@P" */, uint64(2)) == 0 { + if libc.Xstrncmp(tls, ((zSynopsis+uintptr(ii))+uintptr(1)), ts+6699 /* "@P" */, uint64(2)) == 0 { ii = ii + (3) v2 = translateP(tls, *(*int8)(unsafe.Pointer(zSynopsis + uintptr(ii))), pOp) - if libc.Xstrncmp(tls, ((zSynopsis+uintptr(ii))+uintptr(1)), ts+6626 /* "+1" */, uint64(2)) == 0 { + if libc.Xstrncmp(tls, ((zSynopsis+uintptr(ii))+uintptr(1)), ts+6702 /* "+1" */, uint64(2)) == 0 { ii = ii + (2) v2++ } if v2 < 2 { - Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6629 /* "%d" */, libc.VaList(bp+16, v1)) + Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6705 /* "%d" */, libc.VaList(bp+16, v1)) } else { - Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6632 /* "%d..%d" */, libc.VaList(bp+24, v1, ((v1+v2)-1))) + Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6708 /* "%d..%d" */, libc.VaList(bp+24, v1, ((v1+v2)-1))) } - } else if libc.Xstrncmp(tls, ((zSynopsis+uintptr(ii))+uintptr(1)), ts+6639 /* "@NP" */, uint64(3)) == 0 { + } else if libc.Xstrncmp(tls, ((zSynopsis+uintptr(ii))+uintptr(1)), ts+6715 /* "@NP" */, uint64(3)) == 0 { var pCtx uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) if (int32((*Op)(unsafe.Pointer(pOp)).Fp4type) != (-16)) || (int32((*Sqlite3_context)(unsafe.Pointer(pCtx)).Fargc) == 1) { - Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6629 /* "%d" */, libc.VaList(bp+40, v1)) + Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6705 /* "%d" */, libc.VaList(bp+40, v1)) } else if int32((*Sqlite3_context)(unsafe.Pointer(pCtx)).Fargc) > 1 { - Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6632 /* "%d..%d" */, libc.VaList(bp+48, v1, ((v1+int32((*Sqlite3_context)(unsafe.Pointer(pCtx)).Fargc))-1))) - } else { + Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6708 /* "%d..%d" */, libc.VaList(bp+48, v1, ((v1+int32((*Sqlite3_context)(unsafe.Pointer(pCtx)).Fargc))-1))) + } else if int32((*StrAccum)(unsafe.Pointer(bp+80 /* &x */)).FaccError) == 0 { *(*U32)(unsafe.Pointer(bp + 80 /* &x */ + 24 /* &.nChar */)) -= (U32(2)) ii++ } ii = ii + (3) } else { - Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6629 /* "%d" */, libc.VaList(bp+64, v1)) - if (libc.Xstrncmp(tls, ((zSynopsis+uintptr(ii))+uintptr(1)), ts+6643 /* "..P3" */, uint64(4)) == 0) && ((*Op)(unsafe.Pointer(pOp)).Fp3 == 0) { + Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6705 /* "%d" */, libc.VaList(bp+64, v1)) + if (libc.Xstrncmp(tls, ((zSynopsis+uintptr(ii))+uintptr(1)), ts+6719 /* "..P3" */, uint64(4)) == 0) && ((*Op)(unsafe.Pointer(pOp)).Fp3 == 0) { ii = ii + (4) } } @@ -56129,7 +56381,7 @@ func Xsqlite3VdbeDisplayComment(tls *libc.TLS, db uintptr, pOp uintptr, zP4 uint } } if !(seenCom != 0) && ((*Op)(unsafe.Pointer(pOp)).FzComment != 0) { - Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6648 /* "; %s" */, libc.VaList(bp+72, (*Op)(unsafe.Pointer(pOp)).FzComment)) + Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6724 /* "; %s" */, libc.VaList(bp+72, (*Op)(unsafe.Pointer(pOp)).FzComment)) } } else if (*Op)(unsafe.Pointer(pOp)).FzComment != 0 { Xsqlite3_str_appendall(tls, bp+80 /* &x */, (*Op)(unsafe.Pointer(pOp)).FzComment) @@ -56142,7 +56394,7 @@ func Xsqlite3VdbeDisplayComment(tls *libc.TLS, db uintptr, pOp uintptr, zP4 uint // Compute a string that describes the P4 parameter for an opcode. // Use zTemp for any required temporary buffer space. -func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* sqlite3.c:79371:21: */ +func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* sqlite3.c:79994:21: */ bp := tls.Alloc(176) defer tls.Free(176) @@ -56156,7 +56408,7 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* var j int32 var pKeyInfo uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6653 /* "k(%d" */, libc.VaList(bp, int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6729 /* "k(%d" */, libc.VaList(bp, int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) for j = 0; j < int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField); j++ { var pColl uintptr = *(*uintptr)(unsafe.Pointer((pKeyInfo + 32 /* &.aColl */) + uintptr(j)*8)) var zColl uintptr @@ -56166,24 +56418,24 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* zColl = ts + 800 /* "" */ } if libc.Xstrcmp(tls, zColl, ts+363 /* "BINARY" */) == 0 { - zColl = ts + 6658 /* "B" */ + zColl = ts + 6734 /* "B" */ } - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6660, /* ",%s%s%s" */ + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6736, /* ",%s%s%s" */ libc.VaList(bp+8, func() uintptr { if (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j)))) & KEYINFO_ORDER_DESC) != 0 { - return ts + 6585 /* "-" */ + return ts + 6661 /* "-" */ } return ts + 800 /* "" */ }(), func() uintptr { if (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j)))) & KEYINFO_ORDER_BIGNULL) != 0 { - return ts + 6668 /* "N." */ + return ts + 6744 /* "N." */ } return ts + 800 /* "" */ }(), zColl)) } - Xsqlite3_str_append(tls, bp+144 /* &x */, ts+6671 /* ")" */, 1) + Xsqlite3_str_append(tls, bp+144 /* &x */, ts+6747 /* ")" */, 1) break } @@ -56191,7 +56443,7 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* { var pColl uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6673 /* "%.18s-%s" */, libc.VaList(bp+32, (*CollSeq)(unsafe.Pointer(pColl)).FzName, + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6749 /* "%.18s-%s" */, libc.VaList(bp+32, (*CollSeq)(unsafe.Pointer(pColl)).FzName, encnames[(*CollSeq)(unsafe.Pointer(pColl)).Fenc])) break @@ -56199,26 +56451,26 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* case -8: { var pDef uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6682 /* "%s(%d)" */, libc.VaList(bp+48, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6758 /* "%s(%d)" */, libc.VaList(bp+48, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg))) break } case -16: { var pDef uintptr = (*Sqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpFunc - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6682 /* "%s(%d)" */, libc.VaList(bp+64, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6758 /* "%s(%d)" */, libc.VaList(bp+64, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg))) break } case -14: { - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6689 /* "%lld" */, libc.VaList(bp+80, *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))))) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6765 /* "%lld" */, libc.VaList(bp+80, *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))))) break } case -3: { - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6629 /* "%d" */, libc.VaList(bp+88, *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6705 /* "%d" */, libc.VaList(bp+88, *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) break } @@ -56234,14 +56486,14 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Str) != 0 { zP4 = (*Mem)(unsafe.Pointer(pMem)).Fz } else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (MEM_Int | MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6689 /* "%lld" */, libc.VaList(bp+104, *(*I64)(unsafe.Pointer(pMem /* &.u */)))) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6765 /* "%lld" */, libc.VaList(bp+104, *(*I64)(unsafe.Pointer(pMem /* &.u */)))) } else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Real) != 0 { Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+583 /* "%.16g" */, libc.VaList(bp+112, *(*float64)(unsafe.Pointer(pMem /* &.u */)))) } else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Null) != 0 { zP4 = ts + 801 /* "NULL" */ } else { - zP4 = ts + 6694 /* "(blob)" */ + zP4 = ts + 6770 /* "(blob)" */ } break @@ -56249,7 +56501,7 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* case -12: { var pVtab uintptr = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6701 /* "vtab:%p" */, libc.VaList(bp+120, pVtab)) + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6777 /* "vtab:%p" */, libc.VaList(bp+120, pVtab)) break } @@ -56260,20 +56512,20 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* var n U32 = *(*U32)(unsafe.Pointer(ai)) // The first element of an INTARRAY is always the // count of the number of elements to follow for i = U32(1); i <= n; i++ { - Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6709 /* "%c%u" */, libc.VaList(bp+128, func() int32 { + Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6785 /* "%c%u" */, libc.VaList(bp+128, func() int32 { if i == U32(1) { return '[' } return ',' }(), *(*U32)(unsafe.Pointer(ai + uintptr(i)*4)))) } - Xsqlite3_str_append(tls, bp+144 /* &x */, ts+6714 /* "]" */, 1) + Xsqlite3_str_append(tls, bp+144 /* &x */, ts+6790 /* "]" */, 1) break } case -4: { - zP4 = ts + 6716 /* "program" */ + zP4 = ts + 6792 /* "program" */ break } @@ -56305,7 +56557,7 @@ func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* return Xsqlite3StrAccumFinish(tls, bp+144 /* &x */) } -var encnames = [4]uintptr{ts + 6724 /* "?" */, ts + 6726 /* "8" */, ts + 6728 /* "16LE" */, ts + 6733 /* "16BE" */} /* sqlite3.c:79401:25 */ +var encnames = [4]uintptr{ts + 6800 /* "?" */, ts + 6802 /* "8" */, ts + 6804 /* "16LE" */, ts + 6809 /* "16BE" */} /* sqlite3.c:80024:25 */ // Declare to the Vdbe that the BTree object at db->aDb[i] is used. // @@ -56313,7 +56565,7 @@ var encnames = [4]uintptr{ts + 6724 /* "?" */, ts + 6726 /* "8" */, ts + 6728 /* // 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 Xsqlite3VdbeUsesBtree(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:79496:21: */ +func Xsqlite3VdbeUsesBtree(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:80119:21: */ *(*YDbMask)(unsafe.Pointer(p + 204 /* &.btreeMask */)) |= (YDbMask((YDbMask(1))) << (i)) if (i != 1) && (Xsqlite3BtreeSharable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FaDb+uintptr(i)*32)).FpBt) != 0) { @@ -56340,7 +56592,7 @@ func Xsqlite3VdbeUsesBtree(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:794 // 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 Xsqlite3VdbeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:79527:21: */ +func Xsqlite3VdbeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:80150:21: */ var i int32 var db uintptr var aDb uintptr @@ -56359,7 +56611,7 @@ func Xsqlite3VdbeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:79527:21: */ } // Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter(). -func vdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:79548:29: */ +func vdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:80171:29: */ var i int32 var db uintptr var aDb uintptr @@ -56374,7 +56626,7 @@ func vdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:79548:29: */ } } -func Xsqlite3VdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:79562:21: */ +func Xsqlite3VdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:80185:21: */ if ((*Vdbe)(unsafe.Pointer(p)).FlockMask) == YDbMask(0) { return } // The common case @@ -56382,7 +56634,7 @@ func Xsqlite3VdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:79562:21: */ } // Initialize an array of N Mem element. -func initMemArray(tls *libc.TLS, p uintptr, N int32, db uintptr, flags U16) { /* sqlite3.c:79604:13: */ +func initMemArray(tls *libc.TLS, p uintptr, N int32, db uintptr, flags U16) { /* sqlite3.c:80227:13: */ for (libc.PostDecInt32(&N, 1)) > 0 { (*Mem)(unsafe.Pointer(p)).Fdb = db (*Mem)(unsafe.Pointer(p)).Fflags = flags @@ -56392,7 +56644,7 @@ func initMemArray(tls *libc.TLS, p uintptr, N int32, db uintptr, flags U16) { /* } // Release an array of N Mem elements -func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:79619:13: */ +func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:80242:13: */ if (p != 0) && (N != 0) { var pEnd uintptr = (p + uintptr(N)*56) var db uintptr = (*Mem)(unsafe.Pointer(p)).Fdb @@ -56425,7 +56677,7 @@ func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:79619:13: (*Mem)(unsafe.Pointer(p)).FszMalloc = 0 } - (*Mem)(unsafe.Pointer(p)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(p)).Fflags = U16(MEM_Undefined) } } } @@ -56435,7 +56687,7 @@ func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:79619:13: // // This routine does not delete the Frame right away. It merely adds the // frame to a list of frames to be deleted when the Vdbe halts. -func Xsqlite3VdbeFrameMemDel(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:79681:21: */ +func Xsqlite3VdbeFrameMemDel(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:80304:21: */ var pFrame uintptr = pArg (*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent = (*Vdbe)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(pFrame)).Fv)).FpDelFrame @@ -56447,7 +56699,7 @@ func Xsqlite3VdbeFrameMemDel(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:79681:2 // // Return SQLITE_ROW on success. Return SQLITE_DONE if there are no // more opcodes to be displayed. -func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, piPc uintptr, piAddr uintptr, paOp uintptr) int32 { /* sqlite3.c:79696:20: */ +func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, piPc uintptr, piAddr uintptr, paOp uintptr) int32 { /* sqlite3.c:80319:20: */ var nRow int32 // Stop when row count reaches this var nSub int32 = 0 // Number of sub-vdbes seen so far var apSub uintptr = uintptr(0) // Array of sub-vdbes @@ -56556,7 +56808,7 @@ func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, // Delete a VdbeFrame object and its contents. VdbeFrame objects are // allocated by the OP_Program opcode in sqlite3VdbeExec(). -func Xsqlite3VdbeFrameDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:79808:21: */ +func Xsqlite3VdbeFrameDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:80431:21: */ var i int32 var aMem uintptr = ((p) + 112) var apCsr uintptr = (aMem + uintptr((*VdbeFrame)(unsafe.Pointer(p)).FnChildMem)*56) @@ -56585,7 +56837,7 @@ func Xsqlite3VdbeFrameDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:79808:21: // // When p->explain==1, first the main program is listed, then each of // the trigger subprograms are listed one by one. -func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: */ +func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80463:20: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -56595,7 +56847,7 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: * // Loop counter var rc int32 = SQLITE_OK // Return code var pMem uintptr = ((*Vdbe)(unsafe.Pointer(p)).FaMem + 1*56) // First Mem of result set - var bListSubprogs int32 = (libc.Bool32(((int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.explain */)) & 0xc >> 2)) == 1) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_TriggerEQP) != uint64(0)))) + var bListSubprogs int32 = (libc.Bool32(((int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.explain */)) & 0xc >> 2)) == 1) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_TriggerEQP)) != uint64(0)))) // var aOp uintptr at bp+8, 8 // Array of opcodes var pOp uintptr // Current opcode @@ -56629,7 +56881,7 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: * if rc == SQLITE_OK { pOp = (*(*uintptr)(unsafe.Pointer(bp + 8 /* aOp */)) + uintptr(*(*int32)(unsafe.Pointer(bp /* i */)))*32) - if libc.AtomicLoadNInt32((db+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0 { + if libc.AtomicLoadNInt32((db+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0 { (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_INTERRUPT rc = SQLITE_ERROR Xsqlite3VdbeError(tls, p, Xsqlite3ErrStr(tls, (*Vdbe)(unsafe.Pointer(p)).Frc), 0) @@ -56639,12 +56891,12 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: * Xsqlite3VdbeMemSetInt64(tls, pMem, int64((*Op)(unsafe.Pointer(pOp)).Fp1)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(1)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp2)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(2)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp3)) - Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(3)*56), zP4, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) + Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(3)*56), zP4, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) (*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(4) } else { Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(0)*56), int64(*(*int32)(unsafe.Pointer(bp /* i */)))) Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(1)*56), Xsqlite3OpcodeName(tls, int32((*Op)(unsafe.Pointer(pOp)).Fopcode)), - -1, SQLITE_UTF8, uintptr(0)) + -1, uint8(SQLITE_UTF8), uintptr(0)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(2)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp1)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(3)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp2)) Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(4)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp3)) @@ -56652,10 +56904,10 @@ func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: * Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(6)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp5)) { var zCom uintptr = Xsqlite3VdbeDisplayComment(tls, db, pOp, zP4) - Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(7)*56), zCom, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) + Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(7)*56), zCom, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) } - Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(5)*56), zP4, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) + Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(5)*56), zP4, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) (*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(8) } (*Vdbe)(unsafe.Pointer(p)).FpResultSet = pMem @@ -56678,7 +56930,7 @@ type ReusableSpace = struct { FpSpace uintptr FnFree Sqlite3_int64 FnNeeded Sqlite3_int64 -} /* sqlite3.c:79985:1 */ +} /* sqlite3.c:80608:1 */ // Try to allocate nByte bytes of 8-byte aligned bulk memory for pBuf // from the ReusableSpace object. Return a pointer to the allocated @@ -56693,7 +56945,7 @@ type ReusableSpace = struct { // 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 *libc.TLS, p uintptr, pBuf uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:80005:13: */ +func allocSpace(tls *libc.TLS, p uintptr, pBuf uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:80628:13: */ if pBuf == uintptr(0) { nByte = (((nByte) + int64(7)) & int64(libc.CplInt32(7))) @@ -56710,16 +56962,16 @@ func allocSpace(tls *libc.TLS, p uintptr, pBuf uintptr, nByte Sqlite3_int64) uin // Rewind the VDBE back to the beginning in preparation for // running it. -func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) { /* sqlite3.c:80028:21: */ +func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) { /* sqlite3.c:80651:21: */ // There should be at least one opcode. // Set the magic to VDBE_MAGIC_RUN sooner rather than later. - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_RUN + (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic = U32(VDBE_MAGIC_RUN) (*Vdbe)(unsafe.Pointer(p)).Fpc = -1 (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK - (*Vdbe)(unsafe.Pointer(p)).FerrorAction = OE_Abort + (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort) (*Vdbe)(unsafe.Pointer(p)).FnChange = 0 (*Vdbe)(unsafe.Pointer(p)).FcacheCtr = U32(1) (*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat = U8(255) @@ -56743,7 +56995,7 @@ func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) { /* sqlite3.c:80028:21: */ // // Use the sqlite3VdbeRewind() procedure to restore a virtual machine back // to its initial state after it has been run. -func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite3.c:80081:21: */ +func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite3.c:80704:21: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -56757,6 +57009,8 @@ func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite // var x ReusableSpace at bp+8, 24 // Reusable bulk memory + (*Vdbe)(unsafe.Pointer(p)).FpVList = (*Parse)(unsafe.Pointer(pParse)).FpVList + (*Parse)(unsafe.Pointer(pParse)).FpVList = uintptr(0) db = (*Vdbe)(unsafe.Pointer(p)).Fdb nVar = int32((*Parse)(unsafe.Pointer(pParse)).FnVar) @@ -56832,8 +57086,6 @@ func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite } } - (*Vdbe)(unsafe.Pointer(p)).FpVList = (*Parse)(unsafe.Pointer(pParse)).FpVList - (*Parse)(unsafe.Pointer(pParse)).FpVList = uintptr(0) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*Vdbe)(unsafe.Pointer(p)).FnVar = int16(0) (*Vdbe)(unsafe.Pointer(p)).FnCursor = 0 @@ -56841,22 +57093,22 @@ func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite } else { (*Vdbe)(unsafe.Pointer(p)).FnCursor = nCursor (*Vdbe)(unsafe.Pointer(p)).FnVar = YnVar(nVar) - initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, nVar, db, MEM_Null) + initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, nVar, db, uint16(MEM_Null)) (*Vdbe)(unsafe.Pointer(p)).FnMem = nMem - initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaMem, nMem, db, MEM_Undefined) + initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaMem, nMem, db, uint16(MEM_Undefined)) libc.Xmemset(tls, (*Vdbe)(unsafe.Pointer(p)).FapCsr, 0, (uint64(nCursor) * uint64(unsafe.Sizeof(uintptr(0))))) } Xsqlite3VdbeRewind(tls, p) } var azColName = [12]uintptr{ - ts + 6738 /* "addr" */, ts + 6743 /* "opcode" */, ts + 6750 /* "p1" */, ts + 6753 /* "p2" */, ts + 6756 /* "p3" */, ts + 6759 /* "p4" */, ts + 6762 /* "p5" */, ts + 6765, /* "comment" */ - ts + 6773 /* "id" */, ts + 6776 /* "parent" */, ts + 6783 /* "notused" */, ts + 6791, /* "detail" */ -} /* sqlite3.c:80127:23 */ + ts + 6814 /* "addr" */, ts + 6819 /* "opcode" */, ts + 6826 /* "p1" */, ts + 6829 /* "p2" */, ts + 6832 /* "p3" */, ts + 6835 /* "p4" */, ts + 6838 /* "p5" */, ts + 6841, /* "comment" */ + ts + 6849 /* "id" */, ts + 6852 /* "parent" */, ts + 6859 /* "notused" */, ts + 6867, /* "detail" */ +} /* sqlite3.c:80752:23 */ // Close a VDBE cursor and release all the resources that cursor // happens to hold. -func Xsqlite3VdbeFreeCursor(tls *libc.TLS, p uintptr, pCx uintptr) { /* sqlite3.c:80206:21: */ +func Xsqlite3VdbeFreeCursor(tls *libc.TLS, p uintptr, pCx uintptr) { /* sqlite3.c:80829:21: */ if pCx == uintptr(0) { return } @@ -56897,7 +57149,7 @@ func Xsqlite3VdbeFreeCursor(tls *libc.TLS, p uintptr, pCx uintptr) { /* sqlite3. } // Close all cursors in the current frame. -func closeCursorsInFrame(tls *libc.TLS, p uintptr) { /* sqlite3.c:80243:13: */ +func closeCursorsInFrame(tls *libc.TLS, p uintptr) { /* sqlite3.c:80866:13: */ if (*Vdbe)(unsafe.Pointer(p)).FapCsr != 0 { var i int32 for i = 0; i < (*Vdbe)(unsafe.Pointer(p)).FnCursor; i++ { @@ -56913,7 +57165,7 @@ func closeCursorsInFrame(tls *libc.TLS, p uintptr) { /* sqlite3.c:80243:13: */ // 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 Xsqlite3VdbeFrameRestore(tls *libc.TLS, pFrame uintptr) int32 { /* sqlite3.c:80261:20: */ +func Xsqlite3VdbeFrameRestore(tls *libc.TLS, pFrame uintptr) int32 { /* sqlite3.c:80884:20: */ var v uintptr = (*VdbeFrame)(unsafe.Pointer(pFrame)).Fv closeCursorsInFrame(tls, v) (*Vdbe)(unsafe.Pointer(v)).FaOp = (*VdbeFrame)(unsafe.Pointer(pFrame)).FaOp @@ -56937,7 +57189,7 @@ func Xsqlite3VdbeFrameRestore(tls *libc.TLS, pFrame uintptr) int32 { /* sqlite3. // 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 *libc.TLS, p uintptr) { /* sqlite3.c:80290:13: */ +func closeAllCursors(tls *libc.TLS, p uintptr) { /* sqlite3.c:80913:13: */ if (*Vdbe)(unsafe.Pointer(p)).FpFrame != 0 { var pFrame uintptr for pFrame = (*Vdbe)(unsafe.Pointer(p)).FpFrame; (*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent != 0; pFrame = (*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent { @@ -56968,7 +57220,7 @@ func closeAllCursors(tls *libc.TLS, p uintptr) { /* sqlite3.c:80290:13: */ // 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 Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sqlite3.c:80320:21: */ +func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sqlite3.c:80943:21: */ var n int32 var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb @@ -56982,7 +57234,7 @@ func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sql if (*Vdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } - initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, n, db, MEM_Null) + initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, n, db, uint16(MEM_Null)) } // Set the name of the idx'th column to be returned by the SQL statement. @@ -56993,7 +57245,7 @@ func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sql // 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 Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) int32 { /* sqlite3.c:80345:20: */ +func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) int32 { /* sqlite3.c:80968:20: */ var rc int32 var pColName uintptr @@ -57003,7 +57255,7 @@ func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa } pColName = ((*Vdbe)(unsafe.Pointer(p)).FaColName + uintptr((idx+(var1*int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn))))*56) - rc = Xsqlite3VdbeMemSetStr(tls, pColName, zName, -1, SQLITE_UTF8, xDel) + rc = Xsqlite3VdbeMemSetStr(tls, pColName, zName, -1, uint8(SQLITE_UTF8), xDel) return rc } @@ -57012,7 +57264,7 @@ func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa // 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 super-journal trickery. -func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80373:12: */ +func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80996:12: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -57037,7 +57289,7 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80373 // file is required for an atomic commit. for i = 0; (rc == SQLITE_OK) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb); i++ { var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt - if Xsqlite3BtreeIsInTrans(tls, pBt) != 0 { + if Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_WRITE { var pPager uintptr // Pager associated with pBt needXcommit = 1 Xsqlite3BtreeEnter(tls, pBt) @@ -57058,7 +57310,7 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80373 // If there are any write-transactions at all, invoke the commit hook if (needXcommit != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FxCommitCallback != 0) { - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 272 /* &.xCommitCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCommitArg) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 280 /* &.xCommitCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCommitArg) if rc != 0 { return (SQLITE_CONSTRAINT | (int32(2) << 8)) } @@ -57107,7 +57359,7 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80373 // Select a super-journal file name nMainFile = Xsqlite3Strlen30(tls, zMainFile) - zSuper = Xsqlite3MPrintf(tls, db, ts+6798 /* "%.4c%s%.16c" */, libc.VaList(bp, 0, zMainFile, 0)) + zSuper = Xsqlite3MPrintf(tls, db, ts+6874 /* "%.4c%s%.16c" */, libc.VaList(bp, 0, zMainFile, 0)) if zSuper == uintptr(0) { return SQLITE_NOMEM } @@ -57117,16 +57369,16 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80373 if retryCount != 0 { if retryCount > 100 { - Xsqlite3_log(tls, SQLITE_FULL, ts+6810 /* "MJ delete: %s" */, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, SQLITE_FULL, ts+6886 /* "MJ delete: %s" */, libc.VaList(bp+24, zSuper)) Xsqlite3OsDelete(tls, pVfs, zSuper, 0) break } else if retryCount == 1 { - Xsqlite3_log(tls, SQLITE_FULL, ts+6824 /* "MJ collide: %s" */, libc.VaList(bp+32, zSuper)) + Xsqlite3_log(tls, SQLITE_FULL, ts+6900 /* "MJ collide: %s" */, libc.VaList(bp+32, zSuper)) } } retryCount++ Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), bp+56 /* &iRandom */) - Xsqlite3_snprintf(tls, 13, (zSuper + uintptr(nMainFile)), ts+6839, /* "-mj%06X9%02X" */ + Xsqlite3_snprintf(tls, 13, (zSuper + uintptr(nMainFile)), ts+6915, /* "-mj%06X9%02X" */ libc.VaList(bp+40, ((*(*U32)(unsafe.Pointer(bp + 56 /* iRandom */))>>8)&U32(0xffffff)), (*(*U32)(unsafe.Pointer(bp + 56 /* iRandom */))&U32(0xff)))) // The antipenultimate character of the super-journal name must // be "9" to avoid name collisions when using 8+3 filenames. @@ -57150,7 +57402,7 @@ func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80373 // back independently if a failure occurs. for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt - if Xsqlite3BtreeIsInTrans(tls, pBt) != 0 { + if Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_WRITE { var zFile uintptr = Xsqlite3BtreeGetJournalname(tls, pBt) if zFile == uintptr(0) { continue // Ignore TEMP and :memory: databases @@ -57239,7 +57491,7 @@ var aMJNeeded = [6]U8{ /* TRUNCATE */ U8(1), /* MEMORY */ U8(0), /* WAL */ U8(0), -} /* sqlite3.c:80408:23 */ +} /* sqlite3.c:81031:23 */ // This routine checks that the sqlite3.nVdbeActive count variable // matches the number of vdbe's in the list sqlite3.pVdbe that are @@ -57257,7 +57509,7 @@ var aMJNeeded = [6]U8{ // // If an IO error occurs, an SQLITE_IOERR_XXX error code is returned. // Otherwise SQLITE_OK. -func vdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:80669:28: */ +func vdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:81292:28: */ var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb var rc int32 = SQLITE_OK var i int32 @@ -57300,7 +57552,7 @@ func vdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3. return rc } -func Xsqlite3VdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:80715:20: */ +func Xsqlite3VdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:81338:20: */ if ((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FnStatement != 0) && ((*Vdbe)(unsafe.Pointer(p)).FiStatement != 0) { return vdbeCloseStatement(tls, p, eOp) } @@ -57315,13 +57567,13 @@ func Xsqlite3VdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* // If there are outstanding FK violations and this function returns // SQLITE_ERROR, set the result of the VM to SQLITE_CONSTRAINT_FOREIGNKEY // and write an error message to it. Then return SQLITE_ERROR. -func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32 { /* sqlite3.c:80734:20: */ +func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32 { /* sqlite3.c:81357:20: */ var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb if ((deferred != 0) && (((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons + (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons) > int64(0))) || (!(deferred != 0) && ((*Vdbe)(unsafe.Pointer(p)).FnFkConstraint > int64(0))) { (*Vdbe)(unsafe.Pointer(p)).Frc = (SQLITE_CONSTRAINT | (int32(3) << 8)) - (*Vdbe)(unsafe.Pointer(p)).FerrorAction = OE_Abort - Xsqlite3VdbeError(tls, p, ts+6852 /* "FOREIGN KEY cons..." */, 0) + (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort) + Xsqlite3VdbeError(tls, p, ts+6928 /* "FOREIGN KEY cons..." */, 0) return SQLITE_ERROR } return SQLITE_OK @@ -57338,7 +57590,7 @@ func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32 { /* sq // 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 Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: */ +func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81384:20: */ var rc int32 // Used to store transient return codes var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb @@ -57357,7 +57609,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * // state. We need to rollback the statement transaction, if there is // one, or the complete transaction if there is no statement transaction. - if (*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_RUN { + if (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic != U32(VDBE_MAGIC_RUN) { return SQLITE_OK } if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -57443,7 +57695,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * } else { (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0) (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_DeferFKs)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_DeferFKs))) Xsqlite3CommitInternalChanges(tls, db) } } else { @@ -57510,7 +57762,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * } } - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_HALT + (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic = U32(VDBE_MAGIC_HALT) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM @@ -57533,7 +57785,7 @@ func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: * // 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 Xsqlite3VdbeResetStepResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:80962:21: */ +func Xsqlite3VdbeResetStepResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:81585:21: */ (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_OK } @@ -57543,7 +57795,7 @@ func Xsqlite3VdbeResetStepResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:80962: // // This function does not clear the VDBE error code or message, just // copies them to the database handle. -func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80974:20: */ +func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81597:20: */ var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb var rc int32 = (*Vdbe)(unsafe.Pointer(p)).Frc if (*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0 { @@ -57552,7 +57804,7 @@ func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80 if (*Sqlite3)(unsafe.Pointer(db)).FpErr == uintptr(0) { (*Sqlite3)(unsafe.Pointer(db)).FpErr = Xsqlite3ValueNew(tls, db) } - Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, SQLITE_UTF8, libc.UintptrFromInt32(-1)) + Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, uint8(SQLITE_UTF8), libc.UintptrFromInt32(-1)) Xsqlite3EndBenignMalloc(tls) (*Sqlite3)(unsafe.Pointer(db)).FbBenignMalloc-- } else if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 { @@ -57571,7 +57823,7 @@ func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80 // 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 Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81023:20: */ +func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81646:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -57617,15 +57869,15 @@ func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81023:20: (*Vdbe)(unsafe.Pointer(p)).FpResultSet = uintptr(0) // Save profiling information from this VDBE run. - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_RESET + (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic = U32(VDBE_MAGIC_RESET) return ((*Vdbe)(unsafe.Pointer(p)).Frc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask) } // Clean up and delete a VDBE after execution. Return an integer which is // the result code. Write any error message text into *pzErrMsg. -func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81120:20: */ +func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81743:20: */ var rc int32 = SQLITE_OK - if ((*Vdbe)(unsafe.Pointer(p)).Fmagic == VDBE_MAGIC_RUN) || ((*Vdbe)(unsafe.Pointer(p)).Fmagic == VDBE_MAGIC_HALT) { + if ((*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic == U32(VDBE_MAGIC_RUN)) || ((*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic == U32(VDBE_MAGIC_HALT)) { rc = Xsqlite3VdbeReset(tls, p) } @@ -57647,7 +57899,7 @@ func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81120:2 // // * the corresponding bit in argument mask is clear (where the first // function parameter corresponds to bit 0 etc.). -func Xsqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, mask int32) { /* sqlite3.c:81146:21: */ +func Xsqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, mask int32) { /* sqlite3.c:81769:21: */ for *(*uintptr)(unsafe.Pointer(pp)) != 0 { var pAux uintptr = *(*uintptr)(unsafe.Pointer(pp)) if (iOp < 0) || @@ -57672,7 +57924,7 @@ func Xsqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, // 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 Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:81174:21: */ +func Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:81797:21: */ var pSub uintptr var pNext uintptr @@ -57682,7 +57934,7 @@ func Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3. vdbeFreeOpArray(tls, db, (*SubProgram)(unsafe.Pointer(pSub)).FaOp, (*SubProgram)(unsafe.Pointer(pSub)).FnOp) Xsqlite3DbFree(tls, db, pSub) } - if (*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_INIT { + if (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic != U32(VDBE_MAGIC_INIT) { releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, int32((*Vdbe)(unsafe.Pointer(p)).FnVar)) Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FpVList) Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FpFree) @@ -57693,7 +57945,7 @@ func Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3. } // Delete an entire VDBE. -func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:81215:21: */ +func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:81838:21: */ var db uintptr db = (*Vdbe)(unsafe.Pointer(p)).Fdb @@ -57708,7 +57960,7 @@ func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:81215:21: */ if (*Vdbe)(unsafe.Pointer(p)).FpNext != 0 { (*Vdbe)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpNext)).FpPrev = (*Vdbe)(unsafe.Pointer(p)).FpPrev } - (*Vdbe)(unsafe.Pointer(p)).Fmagic = VDBE_MAGIC_DEAD + (*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic = U32(VDBE_MAGIC_DEAD) (*Vdbe)(unsafe.Pointer(p)).Fdb = uintptr(0) Xsqlite3DbFreeNN(tls, db, p) } @@ -57716,7 +57968,7 @@ func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:81215:21: */ // 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 Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81241:36: */ +func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81864:36: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -57729,11 +57981,11 @@ func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:812 return rc } if *(*int32)(unsafe.Pointer(bp /* res */)) != 0 { - return Xsqlite3CorruptError(tls, 81251) + return Xsqlite3CorruptError(tls, 81874) } atomic.AddInt32(&Xsqlite3_search_count, 1) (*VdbeCursor)(unsafe.Pointer(p)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = U32(CACHE_STALE) return SQLITE_OK } @@ -57742,7 +57994,7 @@ func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:812 // 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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:81267:28: */ +func handleMovedCursor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81890:28: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -57751,7 +58003,7 @@ func handleMovedCursor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81267:28: var rc int32 rc = Xsqlite3BtreeCursorRestore(tls, *(*uintptr)(unsafe.Pointer(p + 56 /* &.uc */)), bp /* &isDifferentRow */) - (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(p)).FcacheStatus = U32(CACHE_STALE) if *(*int32)(unsafe.Pointer(bp /* isDifferentRow */)) != 0 { (*VdbeCursor)(unsafe.Pointer(p)).FnullRow = U8(1) } @@ -57760,7 +58012,7 @@ func handleMovedCursor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81267:28: // Check to ensure that the cursor is valid. Restore the cursor // if need be. Return any I/O error from the restore operation. -func Xsqlite3VdbeCursorRestore(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81282:20: */ +func Xsqlite3VdbeCursorRestore(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81905:20: */ if Xsqlite3BtreeCursorHasMoved(tls, *(*uintptr)(unsafe.Pointer(p + 56 /* &.uc */))) != 0 { return handleMovedCursor(tls, p) @@ -57779,7 +58031,7 @@ func Xsqlite3VdbeCursorRestore(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81 // // 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 Xsqlite3VdbeCursorMoveto(tls *libc.TLS, pp uintptr, piCol uintptr) int32 { /* sqlite3.c:81303:20: */ +func Xsqlite3VdbeCursorMoveto(tls *libc.TLS, pp uintptr, piCol uintptr) int32 { /* sqlite3.c:81926:20: */ var p uintptr = *(*uintptr)(unsafe.Pointer(pp)) if (*VdbeCursor)(unsafe.Pointer(p)).FdeferredMoveto != 0 { @@ -57853,10 +58105,10 @@ var sqlite3SmallTypeSizes = [128]U8{ /* 100 */ U8(44), U8(44), U8(45), U8(45), U8(46), U8(46), U8(47), U8(47), U8(48), U8(48), /* 110 */ U8(49), U8(49), U8(50), U8(50), U8(51), U8(51), U8(52), U8(52), U8(53), U8(53), /* 120 */ U8(54), U8(54), U8(55), U8(55), U8(56), U8(56), U8(57), U8(57), -} /* sqlite3.c:81439:17 */ +} /* sqlite3.c:82062:17 */ // Return the length of the data corresponding to the supplied serial-type. -func Xsqlite3VdbeSerialTypeLen(tls *libc.TLS, serial_type U32) U32 { /* sqlite3.c:81459:20: */ +func Xsqlite3VdbeSerialTypeLen(tls *libc.TLS, serial_type U32) U32 { /* sqlite3.c:82082:20: */ if serial_type >= U32(128) { return ((serial_type - U32(12)) / U32(2)) } else { @@ -57866,7 +58118,7 @@ func Xsqlite3VdbeSerialTypeLen(tls *libc.TLS, serial_type U32) U32 { /* sqlite3. return U32(0) } -func Xsqlite3VdbeOneByteSerialTypeLen(tls *libc.TLS, serial_type U8) U8 { /* sqlite3.c:81468:19: */ +func Xsqlite3VdbeOneByteSerialTypeLen(tls *libc.TLS, serial_type U8) U8 { /* sqlite3.c:82091:19: */ return sqlite3SmallTypeSizes[serial_type] } @@ -57915,7 +58167,7 @@ func Xsqlite3VdbeOneByteSerialTypeLen(tls *libc.TLS, serial_type U8) U8 { /* sql // Return the number of bytes actually written into buf[]. The number // of bytes in the zero-filled tail is included in the return value only // if those bytes were zeroed in buf[]. -func Xsqlite3VdbeSerialPut(tls *libc.TLS, buf uintptr, pMem uintptr, serial_type U32) U32 { /* sqlite3.c:81539:20: */ +func Xsqlite3VdbeSerialPut(tls *libc.TLS, buf uintptr, pMem uintptr, serial_type U32) U32 { /* sqlite3.c:82162:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -57966,7 +58218,7 @@ func Xsqlite3VdbeSerialPut(tls *libc.TLS, buf uintptr, pMem uintptr, serial_type // The few cases that require local variables are broken out into a separate // routine so that in most cases the overhead of moving the stack pointer // is avoided. -func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:81593:12: */ +func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:82216:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -57977,7 +58229,7 @@ func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { // EVIDENCE-OF: R-29851-52272 Value is a big-endian 64-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*I64)(unsafe.Pointer(bp /* &x */)) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) } else { // EVIDENCE-OF: R-57343-49114 Value is a big-endian IEEE 754-2008 64-bit @@ -57986,15 +58238,15 @@ func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { libc.Xmemcpy(tls, (pMem /* &.u */ /* &.r */), bp /* &x */, uint64(unsafe.Sizeof(U64(0)))) (*Mem)(unsafe.Pointer(pMem)).Fflags = func() uint16 { if (((*(*U64)(unsafe.Pointer(bp /* x */))) & (U64((uint64(0x7ff))) << 52)) == (U64((uint64(0x7ff))) << 52)) && (((*(*U64)(unsafe.Pointer(bp /* x */))) & ((U64((uint64(1))) << 52) - uint64(1))) != uint64(0)) { - return MEM_Null + return uint16(MEM_Null) } - return MEM_Real + return uint16(MEM_Real) }() } return U32(8) } -func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:81629:20: */ +func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:82252:20: */ switch serial_type { case U32(10): { // Internal use only: NULL with virtual table @@ -58010,7 +58262,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin case U32(0): { // Null // EVIDENCE-OF: R-24078-09375 Value is a NULL. - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Null) break } @@ -58019,7 +58271,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-44885-25196 Value is an 8-bit twos-complement // integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = I64(I8(*(*uint8)(unsafe.Pointer((buf))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(1) @@ -58029,7 +58281,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-49794-35026 Value is a big-endian 16-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64((256 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | int32(*(*uint8)(unsafe.Pointer((buf) + 1))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(2) @@ -58039,7 +58291,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-37839-54301 Value is a big-endian 24-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64(((65536 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | (int32(*(*uint8)(unsafe.Pointer((buf) + 1))) << 8)) | int32(*(*uint8)(unsafe.Pointer((buf) + 2))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(3) @@ -58049,7 +58301,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-01849-26079 Value is a big-endian 32-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64((((16777216 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | (int32(*(*uint8)(unsafe.Pointer((buf) + 1))) << 16)) | (int32(*(*uint8)(unsafe.Pointer((buf) + 2))) << 8)) | int32(*(*uint8)(unsafe.Pointer((buf) + 3))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(4) @@ -58059,7 +58311,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-50385-09674 Value is a big-endian 48-bit // twos-complement integer. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = ((I64((((U32(*(*uint8)(unsafe.Pointer((buf + uintptr(2))))) << 24) | (U32(int32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 1))) << 16))) | (U32(int32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 2))) << 8))) | U32(*(*uint8)(unsafe.Pointer((buf + uintptr(2)) + 3))))) + ((I64((int64(1))) << 32) * (I64((256 * int32((I8(*(*uint8)(unsafe.Pointer((buf))))))) | int32(*(*uint8)(unsafe.Pointer((buf) + 1))))))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(6) @@ -58080,7 +58332,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin // EVIDENCE-OF: R-12976-22893 Value is the integer 0. // EVIDENCE-OF: R-18143-12121 Value is the integer 1. *(*I64)(unsafe.Pointer(pMem /* &.u */)) = (I64(serial_type - U32(8))) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Int) return U32(0) } @@ -58096,7 +58348,7 @@ func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uin return U32(0) } -var aFlag = [2]U16{(U16(MEM_Blob | MEM_Ephem)), (U16(MEM_Str | MEM_Ephem))} /* sqlite3.c:81711:24 */ +var aFlag = [2]U16{(U16(MEM_Blob | MEM_Ephem)), (U16(MEM_Str | MEM_Ephem))} /* sqlite3.c:82334:24 */ // This routine is used to allocate sufficient space for an UnpackedRecord // structure large enough to be used with sqlite3VdbeRecordUnpack() if @@ -58110,7 +58362,7 @@ var aFlag = [2]U16{(U16(MEM_Blob | MEM_Ephem)), (U16(MEM_Str | MEM_Ephem))} /* s // before returning. // // If an OOM error occurs, NULL is returned. -func Xsqlite3VdbeAllocUnpackedRecord(tls *libc.TLS, pKeyInfo uintptr) uintptr { /* sqlite3.c:81734:31: */ +func Xsqlite3VdbeAllocUnpackedRecord(tls *libc.TLS, pKeyInfo uintptr) uintptr { /* sqlite3.c:82357:31: */ var p uintptr // Unpacked record to return var nByte int32 // Number of bytes required for *p nByte = (int32((((uint64(unsafe.Sizeof(UnpackedRecord{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7))) + (uint64(unsafe.Sizeof(Mem{})) * (uint64(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField) + 1))))) @@ -58128,7 +58380,7 @@ func Xsqlite3VdbeAllocUnpackedRecord(tls *libc.TLS, pKeyInfo uintptr) uintptr { // Given the nKey-byte encoding of a record in pKey[], populate the // UnpackedRecord structure indicated by the fourth argument with the // contents of the decoded record. -func Xsqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr, p uintptr) { /* sqlite3.c:81754:21: */ +func Xsqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr, p uintptr) { /* sqlite3.c:82377:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -58191,7 +58443,7 @@ func Xsqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey // 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 *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr, prcErr uintptr) int32 { /* sqlite3.c:81949:12: */ +func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr, prcErr uintptr) int32 { /* sqlite3.c:82572:12: */ bp := tls.Alloc(112) defer tls.Free(112) @@ -58207,15 +58459,15 @@ func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uin // var c2 Mem at bp+56, 56 - Xsqlite3VdbeMemInit(tls, bp /* &c1 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, MEM_Null) - Xsqlite3VdbeMemInit(tls, bp+56 /* &c2 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, MEM_Null) + Xsqlite3VdbeMemInit(tls, bp /* &c1 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, uint16(MEM_Null)) + Xsqlite3VdbeMemInit(tls, bp+56 /* &c2 */, (*Mem)(unsafe.Pointer(pMem1)).Fdb, uint16(MEM_Null)) Xsqlite3VdbeMemShallowCopy(tls, bp /* &c1 */, pMem1, MEM_Ephem) Xsqlite3VdbeMemShallowCopy(tls, bp+56 /* &c2 */, pMem2, MEM_Ephem) v1 = Xsqlite3ValueText(tls, bp /* &c1 */, (*CollSeq)(unsafe.Pointer(pColl)).Fenc) v2 = Xsqlite3ValueText(tls, bp+56 /* &c2 */, (*CollSeq)(unsafe.Pointer(pColl)).Fenc) if (v1 == uintptr(0)) || (v2 == uintptr(0)) { if prcErr != 0 { - *(*U8)(unsafe.Pointer(prcErr)) = SQLITE_NOMEM + *(*U8)(unsafe.Pointer(prcErr)) = U8(SQLITE_NOMEM) } rc = 0 } else { @@ -58230,7 +58482,7 @@ func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uin // 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 *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:81986:12: */ +func isAllZero(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:82609:12: */ var i int32 for i = 0; i < n; i++ { if *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 { @@ -58243,7 +58495,7 @@ func isAllZero(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:81986:12: // 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 Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sqlite3.c:81999:36: */ +func Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sqlite3.c:82622:36: */ var c int32 var n1 int32 = (*Mem)(unsafe.Pointer(pB1)).Fn var n2 int32 = (*Mem)(unsafe.Pointer(pB2)).Fn @@ -58283,16 +58535,17 @@ func Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sql // 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 *libc.TLS, i I64, r float64) int32 { /* sqlite3.c:82032:12: */ +func sqlite3IntFloatCompare(tls *libc.TLS, i I64, r float64) int32 { /* sqlite3.c:82655:12: */ if uint64(unsafe.Sizeof(float64(0))) > uint64(8) { var x float64 = float64(i) + if x < r { return -1 } if x > r { return +1 - } - return 0 + } /*NO_TEST*/ // work around bugs in gcov + return 0 /*NO_TEST*/ // work around bugs in gcov } else { var y I64 var s float64 @@ -58328,7 +58581,7 @@ func sqlite3IntFloatCompare(tls *libc.TLS, i I64, r float64) int32 { /* sqlite3. // sequence pColl and finally blob's ordered by memcmp(). // // Two NULL values are considered equal by this function. -func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr) int32 { /* sqlite3.c:82062:20: */ +func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr) int32 { /* sqlite3.c:82688:20: */ var f1 int32 var f2 int32 var combined_flags int32 @@ -58422,7 +58675,7 @@ func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintp // 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 *libc.TLS, serial_type U32, aKey uintptr) I64 { /* sqlite3.c:82161:12: */ +func vdbeRecordDecodeInt(tls *libc.TLS, serial_type U32, aKey uintptr) I64 { /* sqlite3.c:82787:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -58485,7 +58738,7 @@ func vdbeRecordDecodeInt(tls *libc.TLS, serial_type U32, aKey uintptr) I64 { /* // 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 Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr, bSkip int32) int32 { /* sqlite3.c:82216:20: */ +func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr, bSkip int32) int32 { /* sqlite3.c:82842:20: */ bp := tls.Alloc(68) defer tls.Free(68) @@ -58533,7 +58786,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr i = 0 } if d1 > uint32(nKey1) { - (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82247)) + (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82873)) return 0 // Corruption } @@ -58598,12 +58851,12 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr if ((d1 + U32((*Mem)(unsafe.Pointer(bp+8 /* &mem1 */)).Fn)) > uint32(nKey1)) || (int32((*KeyInfo)(unsafe.Pointer((libc.AssignUintptr(&pKeyInfo, (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FpKeyInfo)))).FnAllField) <= i) { - (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82324)) + (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82950)) return 0 // Corruption } else if *(*uintptr)(unsafe.Pointer((pKeyInfo + 32 /* &.aColl */) + uintptr(i)*8)) != 0 { (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fenc = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fenc (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fdb = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb - (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fflags = MEM_Str + (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fflags = U16(MEM_Str) (*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fz = (aKey1 + uintptr(d1)) rc = vdbeCompareMemString(tls, bp+8 /* &mem1 */, pRhs, *(*uintptr)(unsafe.Pointer((pKeyInfo + 32 /* &.aColl */) + uintptr(i)*8)), (pPKey2 + 19 /* &.errCode */)) @@ -58633,7 +58886,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr var nStr int32 = (int32((*(*U32)(unsafe.Pointer(bp + 64 /* serial_type */)) - U32(12)) / U32(2))) if (d1 + U32(nStr)) > uint32(nKey1) { - (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82354)) + (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82980)) return 0 // Corruption } else if (int32((*Mem)(unsafe.Pointer(pRhs)).Fflags) & MEM_Zero) != 0 { if !(isAllZero(tls, (aKey1+uintptr(d1)), nStr) != 0) { @@ -58694,7 +58947,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr return int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fdefault_rc) } -func Xsqlite3VdbeRecordCompare(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:82413:20: */ +func Xsqlite3VdbeRecordCompare(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:83039:20: */ return Xsqlite3VdbeRecordCompareWithSkip(tls, nKey1, pKey1, pPKey2, 0) } @@ -58705,7 +58958,7 @@ func Xsqlite3VdbeRecordCompare(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 // // 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 *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:82430:12: */ +func vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:83056:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -58810,7 +59063,7 @@ func vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uint // 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 *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:82524:12: */ +func vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:83150:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -58834,7 +59087,7 @@ func vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 u nStr = ((*(*int32)(unsafe.Pointer(bp /* serial_type */)) - 12) / 2) if (szHdr + nStr) > nKey1 { - (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82549)) + (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 83175)) return 0 // Corruption } nCmp = func() int32 { @@ -58872,7 +59125,7 @@ func vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 u // Return a pointer to an sqlite3VdbeRecordCompare() compatible function // suitable for comparing serialized records to the unpacked record passed // as the only argument. -func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare { /* sqlite3.c:82588:30: */ +func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare { /* sqlite3.c:83214:30: */ // varintRecordCompareInt() and varintRecordCompareString() both assume // that the size-of-header varint that occurs at the start of each record // fits in a single byte (i.e. is 127 or less). varintRecordCompareInt() @@ -58926,7 +59179,7 @@ func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare { /* sqlite // // 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 Xsqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr) int32 { /* sqlite3.c:82639:20: */ +func Xsqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr) int32 { /* sqlite3.c:83265:20: */ bp := tls.Alloc(120) defer tls.Free(120) @@ -59011,7 +59264,7 @@ __6: idx_rowid_corruption: ; Xsqlite3VdbeMemRelease(tls, bp /* &m */) - return Xsqlite3CorruptError(tls, 82704) + return Xsqlite3CorruptError(tls, 83330) } // Compare the key of the index entry that cursor pC is pointing to against @@ -59023,7 +59276,7 @@ idx_rowid_corruption: // 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 Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked uintptr, res uintptr) int32 { /* sqlite3.c:82718:20: */ +func Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked uintptr, res uintptr) int32 { /* sqlite3.c:83344:20: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -59039,7 +59292,7 @@ func Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked // that btreeParseCellPtr() and sqlite3GetVarint32() are implemented if (nCellKey <= int64(0)) || (nCellKey > int64(0x7fffffff)) { *(*int32)(unsafe.Pointer(res)) = 0 - return Xsqlite3CorruptError(tls, 82737) + return Xsqlite3CorruptError(tls, 83363) } Xsqlite3VdbeMemInit(tls, bp /* &m */, db, uint16(0)) rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, U32(nCellKey), bp /* &m */) @@ -59053,15 +59306,15 @@ func Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked // This routine sets the value to be returned by subsequent calls to // sqlite3_changes() on the database handle 'db'. -func Xsqlite3VdbeSetChanges(tls *libc.TLS, db uintptr, nChange int32) { /* sqlite3.c:82753:21: */ +func Xsqlite3VdbeSetChanges(tls *libc.TLS, db uintptr, nChange int32) { /* sqlite3.c:83379:21: */ (*Sqlite3)(unsafe.Pointer(db)).FnChange = nChange - *(*int32)(unsafe.Pointer(db + 120 /* &.nTotalChange */)) += (nChange) + *(*int32)(unsafe.Pointer(db + 124 /* &.nTotalChange */)) += (nChange) } // Set a flag in the vdbe to update the change counter when it is finalised // or reset. -func Xsqlite3VdbeCountChanges(tls *libc.TLS, v uintptr) { /* sqlite3.c:82763:21: */ +func Xsqlite3VdbeCountChanges(tls *libc.TLS, v uintptr) { /* sqlite3.c:83389:21: */ libc.SetBitFieldPtr16Uint32(v+200 /* &.changeCntOn */, Bft(1), 4, 0x10) } @@ -59081,7 +59334,7 @@ func Xsqlite3VdbeCountChanges(tls *libc.TLS, v uintptr) { /* sqlite3.c:82763:21: // Internally, this function just sets the Vdbe.expired flag on all // prepared statements. The flag is set to 1 for an immediate expiration // and set to 2 for an advisory expiration. -func Xsqlite3ExpirePreparedStatements(tls *libc.TLS, db uintptr, iCode int32) { /* sqlite3.c:82785:21: */ +func Xsqlite3ExpirePreparedStatements(tls *libc.TLS, db uintptr, iCode int32) { /* sqlite3.c:83411:21: */ var p uintptr for p = (*Sqlite3)(unsafe.Pointer(db)).FpVdbe; p != 0; p = (*Vdbe)(unsafe.Pointer(p)).FpNext { libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, (Bft(iCode + 1)), 0, 0x3) @@ -59089,12 +59342,12 @@ func Xsqlite3ExpirePreparedStatements(tls *libc.TLS, db uintptr, iCode int32) { } // Return the database associated with the Vdbe. -func Xsqlite3VdbeDb(tls *libc.TLS, v uintptr) uintptr { /* sqlite3.c:82795:24: */ +func Xsqlite3VdbeDb(tls *libc.TLS, v uintptr) uintptr { /* sqlite3.c:83421:24: */ return (*Vdbe)(unsafe.Pointer(v)).Fdb } // Return the SQLITE_PREPARE flags for a Vdbe. -func Xsqlite3VdbePrepareFlags(tls *libc.TLS, v uintptr) U8 { /* sqlite3.c:82802:19: */ +func Xsqlite3VdbePrepareFlags(tls *libc.TLS, v uintptr) U8 { /* sqlite3.c:83428:19: */ return (*Vdbe)(unsafe.Pointer(v)).FprepFlags } @@ -59104,7 +59357,7 @@ func Xsqlite3VdbePrepareFlags(tls *libc.TLS, v uintptr) U8 { /* sqlite3.c:82802: // constants) to the value before returning it. // // The returned value must be freed by the caller using sqlite3ValueFree(). -func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uintptr { /* sqlite3.c:82814:30: */ +func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uintptr { /* sqlite3.c:83440:30: */ if v != 0 { var pMem uintptr = ((*Vdbe)(unsafe.Pointer(v)).FaVar + uintptr((iVar-1))*56) @@ -59113,7 +59366,7 @@ func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uin var pRet uintptr = Xsqlite3ValueNew(tls, (*Vdbe)(unsafe.Pointer(v)).Fdb) if pRet != 0 { Xsqlite3VdbeMemCopy(tls, pRet, pMem) - Xsqlite3ValueApplyAffinity(tls, pRet, aff, SQLITE_UTF8) + Xsqlite3ValueApplyAffinity(tls, pRet, aff, uint8(SQLITE_UTF8)) } return pRet } @@ -59124,7 +59377,7 @@ func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uin // 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 Xsqlite3VdbeSetVarmask(tls *libc.TLS, v uintptr, iVar int32) { /* sqlite3.c:82836:21: */ +func Xsqlite3VdbeSetVarmask(tls *libc.TLS, v uintptr, iVar int32) { /* sqlite3.c:83462:21: */ if iVar >= 32 { *(*U32)(unsafe.Pointer(v + 276 /* &.expmask */)) |= (0x80000000) @@ -59140,7 +59393,7 @@ func Xsqlite3VdbeSetVarmask(tls *libc.TLS, v uintptr, iVar int32) { /* sqlite3.c // throw an error if it is given inputs that would make it non-deterministic. // This routine is invoked by date/time functions that use non-deterministic // features such as 'now'. -func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:82855:20: */ +func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:83481:20: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -59153,13 +59406,13 @@ func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:82855 var zContext uintptr var zMsg uintptr if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5) & NC_IsCheck) != 0 { - zContext = ts + 6882 /* "a CHECK constrai..." */ + zContext = ts + 6958 /* "a CHECK constrai..." */ } else if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5) & NC_GenCol) != 0 { - zContext = ts + 6901 /* "a generated colu..." */ + zContext = ts + 6977 /* "a generated colu..." */ } else { - zContext = ts + 6920 /* "an index" */ + zContext = ts + 6996 /* "an index" */ } - zMsg = Xsqlite3_mprintf(tls, ts+6929, /* "non-deterministi..." */ + zMsg = Xsqlite3_mprintf(tls, ts+7005, /* "non-deterministi..." */ libc.VaList(bp, (*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -1) Xsqlite3_free(tls, zMsg) @@ -59171,7 +59424,7 @@ func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:82855 // 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 Xsqlite3VtabImportErrmsg(tls *libc.TLS, p uintptr, pVtab uintptr) { /* sqlite3.c:82886:21: */ +func Xsqlite3VtabImportErrmsg(tls *libc.TLS, p uintptr, pVtab uintptr) { /* sqlite3.c:83512:21: */ if (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg != 0 { var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg) @@ -59187,7 +59440,7 @@ func Xsqlite3VtabImportErrmsg(tls *libc.TLS, p uintptr, pVtab uintptr) { /* sqli // // This function is used to free UnpackedRecord structures allocated by // the vdbeUnpackRecord() function found in vdbeapi.c. -func vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { /* sqlite3.c:82907:13: */ +func vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { /* sqlite3.c:83533:13: */ if p != 0 { var i int32 for i = 0; i < nField; i++ { @@ -59204,7 +59457,7 @@ func vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { /* s // then cursor passed as the second argument should point to the row about // to be update or deleted. If the application calls sqlite3_preupdate_old(), // the required value will be read from the row the cursor points to. -func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, zDb uintptr, pTab uintptr, iKey1 I64, iReg int32) { /* sqlite3.c:82926:21: */ +func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, zDb uintptr, pTab uintptr, iKey1 I64, iReg int32) { /* sqlite3.c:83552:21: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -59215,7 +59468,7 @@ func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, var zTbl uintptr = (*Table)(unsafe.Pointer(pTab)).FzName libc.Xmemset(tls, bp /* &preupdate */, 0, uint64(unsafe.Sizeof(PreUpdate{}))) - if (libc.Bool32(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) == 0 { + if (libc.Bool32(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) == 0 { iKey1 = libc.AssignInt64(&iKey2, int64(0)) (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpPk = Xsqlite3PrimaryKeyIndex(tls, pTab) } else { @@ -59239,7 +59492,7 @@ func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpTab = pTab (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate = bp /* &preupdate */ - (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Sqlite3_int64, Sqlite3_int64))(unsafe.Pointer((db + 328 /* &.xPreUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) + (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Sqlite3_int64, Sqlite3_int64))(unsafe.Pointer((db + 336 /* &.xPreUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) Xsqlite3DbFree(tls, db, (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FaRecord) vdbeFreeUnpacked(tls, db, (int32((*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).Fkeyinfo.FnKeyField) + 1), (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpUnpacked) @@ -59253,7 +59506,7 @@ func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, } } -var fakeSortOrder U8 = U8(0) /* sqlite3.c:82939:19 */ +var fakeSortOrder U8 = U8(0) /* sqlite3.c:83565:19 */ //************* End of vdbeaux.c ******************************************** //************* Begin file vdbeapi.c **************************************** @@ -59279,7 +59532,7 @@ var fakeSortOrder U8 = U8(0) /* sqlite3.c:82939:19 */ // 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 *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83015:16: */ +func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83641:16: */ var p uintptr = pStmt return (libc.Bool32((p == uintptr(0)) || ((Bft(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.expired */)) & 0x3 >> 0))) != 0))) } @@ -59287,9 +59540,9 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83015:1 // 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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:83026:12: */ +func vdbeSafety(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83652:12: */ if (*Vdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, SQLITE_MISUSE, ts+6965 /* "API called with ..." */, 0) + Xsqlite3_log(tls, SQLITE_MISUSE, ts+7041 /* "API called with ..." */, 0) return 1 } else { return 0 @@ -59297,9 +59550,9 @@ func vdbeSafety(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83026:12: */ return int32(0) } -func vdbeSafetyNotNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83034:12: */ +func vdbeSafetyNotNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83660:12: */ if p == uintptr(0) { - Xsqlite3_log(tls, SQLITE_MISUSE, ts+7010 /* "API called with ..." */, 0) + Xsqlite3_log(tls, SQLITE_MISUSE, ts+7086 /* "API called with ..." */, 0) return 1 } else { return vdbeSafety(tls, p) @@ -59309,7 +59562,7 @@ func vdbeSafetyNotNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83034:12: // 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 *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:83048:29: */ +func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:83674:29: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -59320,10 +59573,10 @@ func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c: Xsqlite3OsCurrentTimeInt64(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, bp /* &iNow */) *(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */)) = ((*(*Sqlite3_int64)(unsafe.Pointer(bp /* iNow */)) - (*Vdbe)(unsafe.Pointer(p)).FstartTime) * int64(1000000)) if (*Sqlite3)(unsafe.Pointer(db)).FxProfile != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, U64))(unsafe.Pointer((db + 248 /* &.xProfile */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg, (*Vdbe)(unsafe.Pointer(p)).FzSql, uint64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */)))) + (*(*func(*libc.TLS, uintptr, uintptr, U64))(unsafe.Pointer((db + 256 /* &.xProfile */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg, (*Vdbe)(unsafe.Pointer(p)).FzSql, uint64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */)))) } if (int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_PROFILE) != 0 { - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_PROFILE, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8 /* &iElapse */) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 240 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_PROFILE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8 /* &iElapse */) } (*Vdbe)(unsafe.Pointer(p)).FstartTime = int64(0) } @@ -59338,7 +59591,7 @@ func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c: // // This routine sets the error code and string returned by // sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). -func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83086:16: */ +func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83712:16: */ var rc int32 if pStmt == uintptr(0) { // IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL @@ -59348,7 +59601,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83086: var v uintptr = pStmt var db uintptr = (*Vdbe)(unsafe.Pointer(v)).Fdb if vdbeSafety(tls, v) != 0 { - return Xsqlite3MisuseError(tls, 83095) + return Xsqlite3MisuseError(tls, 83721) } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if ((*Vdbe)(unsafe.Pointer(v)).FstartTime) > int64(0) { @@ -59368,7 +59621,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83086: // // This routine sets the error code and string returned by // sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). -func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83113:16: */ +func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83739:16: */ var rc int32 if pStmt == uintptr(0) { rc = SQLITE_OK @@ -59390,7 +59643,7 @@ func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83113:16: } // Set all the parameters in the compiled SQL statement to NULL. -func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83134:16: */ +func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83760:16: */ var i int32 var rc int32 = SQLITE_OK var p uintptr = pStmt @@ -59398,7 +59651,7 @@ func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c: Xsqlite3_mutex_enter(tls, mutex) for i = 0; i < int32((*Vdbe)(unsafe.Pointer(p)).FnVar); i++ { Xsqlite3VdbeMemRelease(tls, ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56)) - (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56)).Fflags = U16(MEM_Null) } if (*Vdbe)(unsafe.Pointer(p)).Fexpmask != 0 { @@ -59412,7 +59665,7 @@ func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c: // // The following routines extract information from a Mem or sqlite3_value // structure. -func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83159:23: */ +func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83785:23: */ var p uintptr = pVal if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & (MEM_Blob | MEM_Str)) != 0 { if (func() int32 { @@ -59435,27 +59688,27 @@ func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:831 return uintptr(0) } -func Xsqlite3_value_bytes(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83172:16: */ - return Xsqlite3ValueBytes(tls, pVal, SQLITE_UTF8) +func Xsqlite3_value_bytes(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83798:16: */ + return Xsqlite3ValueBytes(tls, pVal, uint8(SQLITE_UTF8)) } -func Xsqlite3_value_bytes16(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83175:16: */ - return Xsqlite3ValueBytes(tls, pVal, SQLITE_UTF16LE) +func Xsqlite3_value_bytes16(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83801:16: */ + return Xsqlite3ValueBytes(tls, pVal, uint8(SQLITE_UTF16LE)) } -func Xsqlite3_value_double(tls *libc.TLS, pVal uintptr) float64 { /* sqlite3.c:83178:19: */ +func Xsqlite3_value_double(tls *libc.TLS, pVal uintptr) float64 { /* sqlite3.c:83804:19: */ return Xsqlite3VdbeRealValue(tls, pVal) } -func Xsqlite3_value_int(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83181:16: */ +func Xsqlite3_value_int(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83807:16: */ return int32(Xsqlite3VdbeIntValue(tls, pVal)) } -func Xsqlite3_value_int64(tls *libc.TLS, pVal uintptr) Sqlite_int64 { /* sqlite3.c:83184:25: */ +func Xsqlite3_value_int64(tls *libc.TLS, pVal uintptr) Sqlite_int64 { /* sqlite3.c:83810:25: */ return Xsqlite3VdbeIntValue(tls, pVal) } -func Xsqlite3_value_subtype(tls *libc.TLS, pVal uintptr) uint32 { /* sqlite3.c:83187:25: */ +func Xsqlite3_value_subtype(tls *libc.TLS, pVal uintptr) uint32 { /* sqlite3.c:83813:25: */ var pMem uintptr = pVal return func() uint32 { if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & MEM_Subtype) != 0 { @@ -59465,7 +59718,7 @@ func Xsqlite3_value_subtype(tls *libc.TLS, pVal uintptr) uint32 { /* sqlite3.c:8 }() } -func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr { /* sqlite3.c:83191:17: */ +func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr { /* sqlite3.c:83817:17: */ var p uintptr = pVal if ((((int32((*Mem)(unsafe.Pointer(p)).Fflags) & ((MEM_TypeMask | MEM_Term) | MEM_Subtype)) == ((MEM_Null | MEM_Term) | MEM_Subtype)) && (zPType != uintptr(0))) && @@ -59478,108 +59731,108 @@ func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr return uintptr(0) } -func Xsqlite3_value_text(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83204:32: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF8) +func Xsqlite3_value_text(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83830:32: */ + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) } -func Xsqlite3_value_text16(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83208:23: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF16LE) +func Xsqlite3_value_text16(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83834:23: */ + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE)) } -func Xsqlite3_value_text16be(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83211:23: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF16BE) +func Xsqlite3_value_text16be(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83837:23: */ + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16BE)) } -func Xsqlite3_value_text16le(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83214:23: */ - return Xsqlite3ValueText(tls, pVal, SQLITE_UTF16LE) +func Xsqlite3_value_text16le(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83840:23: */ + return Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF16LE)) } // 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 *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83222:16: */ +func Xsqlite3_value_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83848:16: */ return int32(aType[(int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & MEM_AffMask)]) } var aType = [64]U8{ - SQLITE_BLOB, // 0x00 (not possible) - SQLITE_NULL, // 0x01 NULL - SQLITE_TEXT, // 0x02 TEXT - SQLITE_NULL, // 0x03 (not possible) - SQLITE_INTEGER, // 0x04 INTEGER - SQLITE_NULL, // 0x05 (not possible) - SQLITE_INTEGER, // 0x06 INTEGER + TEXT - SQLITE_NULL, // 0x07 (not possible) - SQLITE_FLOAT, // 0x08 FLOAT - SQLITE_NULL, // 0x09 (not possible) - SQLITE_FLOAT, // 0x0a FLOAT + TEXT - SQLITE_NULL, // 0x0b (not possible) - SQLITE_INTEGER, // 0x0c (not possible) - SQLITE_NULL, // 0x0d (not possible) - SQLITE_INTEGER, // 0x0e (not possible) - SQLITE_NULL, // 0x0f (not possible) - SQLITE_BLOB, // 0x10 BLOB - SQLITE_NULL, // 0x11 (not possible) - SQLITE_TEXT, // 0x12 (not possible) - SQLITE_NULL, // 0x13 (not possible) - SQLITE_INTEGER, // 0x14 INTEGER + BLOB - SQLITE_NULL, // 0x15 (not possible) - SQLITE_INTEGER, // 0x16 (not possible) - SQLITE_NULL, // 0x17 (not possible) - SQLITE_FLOAT, // 0x18 FLOAT + BLOB - SQLITE_NULL, // 0x19 (not possible) - SQLITE_FLOAT, // 0x1a (not possible) - SQLITE_NULL, // 0x1b (not possible) - SQLITE_INTEGER, // 0x1c (not possible) - SQLITE_NULL, // 0x1d (not possible) - SQLITE_INTEGER, // 0x1e (not possible) - SQLITE_NULL, // 0x1f (not possible) - SQLITE_FLOAT, // 0x20 INTREAL - SQLITE_NULL, // 0x21 (not possible) - SQLITE_TEXT, // 0x22 INTREAL + TEXT - SQLITE_NULL, // 0x23 (not possible) - SQLITE_FLOAT, // 0x24 (not possible) - SQLITE_NULL, // 0x25 (not possible) - SQLITE_FLOAT, // 0x26 (not possible) - SQLITE_NULL, // 0x27 (not possible) - SQLITE_FLOAT, // 0x28 (not possible) - SQLITE_NULL, // 0x29 (not possible) - SQLITE_FLOAT, // 0x2a (not possible) - SQLITE_NULL, // 0x2b (not possible) - SQLITE_FLOAT, // 0x2c (not possible) - SQLITE_NULL, // 0x2d (not possible) - SQLITE_FLOAT, // 0x2e (not possible) - SQLITE_NULL, // 0x2f (not possible) - SQLITE_BLOB, // 0x30 (not possible) - SQLITE_NULL, // 0x31 (not possible) - SQLITE_TEXT, // 0x32 (not possible) - SQLITE_NULL, // 0x33 (not possible) - SQLITE_FLOAT, // 0x34 (not possible) - SQLITE_NULL, // 0x35 (not possible) - SQLITE_FLOAT, // 0x36 (not possible) - SQLITE_NULL, // 0x37 (not possible) - SQLITE_FLOAT, // 0x38 (not possible) - SQLITE_NULL, // 0x39 (not possible) - SQLITE_FLOAT, // 0x3a (not possible) - SQLITE_NULL, // 0x3b (not possible) - SQLITE_FLOAT, // 0x3c (not possible) - SQLITE_NULL, // 0x3d (not possible) - SQLITE_FLOAT, // 0x3e (not possible) - SQLITE_NULL, // 0x3f (not possible) -} /* sqlite3.c:83223:19 */ + U8(SQLITE_BLOB), // 0x00 (not possible) + U8(SQLITE_NULL), // 0x01 NULL + U8(SQLITE_TEXT), // 0x02 TEXT + U8(SQLITE_NULL), // 0x03 (not possible) + U8(SQLITE_INTEGER), // 0x04 INTEGER + U8(SQLITE_NULL), // 0x05 (not possible) + U8(SQLITE_INTEGER), // 0x06 INTEGER + TEXT + U8(SQLITE_NULL), // 0x07 (not possible) + U8(SQLITE_FLOAT), // 0x08 FLOAT + U8(SQLITE_NULL), // 0x09 (not possible) + U8(SQLITE_FLOAT), // 0x0a FLOAT + TEXT + U8(SQLITE_NULL), // 0x0b (not possible) + U8(SQLITE_INTEGER), // 0x0c (not possible) + U8(SQLITE_NULL), // 0x0d (not possible) + U8(SQLITE_INTEGER), // 0x0e (not possible) + U8(SQLITE_NULL), // 0x0f (not possible) + U8(SQLITE_BLOB), // 0x10 BLOB + U8(SQLITE_NULL), // 0x11 (not possible) + U8(SQLITE_TEXT), // 0x12 (not possible) + U8(SQLITE_NULL), // 0x13 (not possible) + U8(SQLITE_INTEGER), // 0x14 INTEGER + BLOB + U8(SQLITE_NULL), // 0x15 (not possible) + U8(SQLITE_INTEGER), // 0x16 (not possible) + U8(SQLITE_NULL), // 0x17 (not possible) + U8(SQLITE_FLOAT), // 0x18 FLOAT + BLOB + U8(SQLITE_NULL), // 0x19 (not possible) + U8(SQLITE_FLOAT), // 0x1a (not possible) + U8(SQLITE_NULL), // 0x1b (not possible) + U8(SQLITE_INTEGER), // 0x1c (not possible) + U8(SQLITE_NULL), // 0x1d (not possible) + U8(SQLITE_INTEGER), // 0x1e (not possible) + U8(SQLITE_NULL), // 0x1f (not possible) + U8(SQLITE_FLOAT), // 0x20 INTREAL + U8(SQLITE_NULL), // 0x21 (not possible) + U8(SQLITE_TEXT), // 0x22 INTREAL + TEXT + U8(SQLITE_NULL), // 0x23 (not possible) + U8(SQLITE_FLOAT), // 0x24 (not possible) + U8(SQLITE_NULL), // 0x25 (not possible) + U8(SQLITE_FLOAT), // 0x26 (not possible) + U8(SQLITE_NULL), // 0x27 (not possible) + U8(SQLITE_FLOAT), // 0x28 (not possible) + U8(SQLITE_NULL), // 0x29 (not possible) + U8(SQLITE_FLOAT), // 0x2a (not possible) + U8(SQLITE_NULL), // 0x2b (not possible) + U8(SQLITE_FLOAT), // 0x2c (not possible) + U8(SQLITE_NULL), // 0x2d (not possible) + U8(SQLITE_FLOAT), // 0x2e (not possible) + U8(SQLITE_NULL), // 0x2f (not possible) + U8(SQLITE_BLOB), // 0x30 (not possible) + U8(SQLITE_NULL), // 0x31 (not possible) + U8(SQLITE_TEXT), // 0x32 (not possible) + U8(SQLITE_NULL), // 0x33 (not possible) + U8(SQLITE_FLOAT), // 0x34 (not possible) + U8(SQLITE_NULL), // 0x35 (not possible) + U8(SQLITE_FLOAT), // 0x36 (not possible) + U8(SQLITE_NULL), // 0x37 (not possible) + U8(SQLITE_FLOAT), // 0x38 (not possible) + U8(SQLITE_NULL), // 0x39 (not possible) + U8(SQLITE_FLOAT), // 0x3a (not possible) + U8(SQLITE_NULL), // 0x3b (not possible) + U8(SQLITE_FLOAT), // 0x3c (not possible) + U8(SQLITE_NULL), // 0x3d (not possible) + U8(SQLITE_FLOAT), // 0x3e (not possible) + U8(SQLITE_NULL), // 0x3f (not possible) +} /* sqlite3.c:83849:19 */ // Return true if a parameter to xUpdate represents an unchanged column -func Xsqlite3_value_nochange(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83308:16: */ +func Xsqlite3_value_nochange(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83934:16: */ return (libc.Bool32((int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & (MEM_Null | MEM_Zero)) == (MEM_Null | MEM_Zero))) } // Return true if a parameter value originated from an sqlite3_bind() -func Xsqlite3_value_frombind(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83313:16: */ +func Xsqlite3_value_frombind(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83939:16: */ return (libc.Bool32((int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & MEM_FromBind) != 0)) } // Make a copy of an sqlite3_value object -func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) uintptr { /* sqlite3.c:83319:26: */ +func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) uintptr { /* sqlite3.c:83945:26: */ var pNew uintptr if pOrig == uintptr(0) { return uintptr(0) @@ -59605,7 +59858,7 @@ func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) uintptr { /* sqlite3.c:833 // Destroy an sqlite3_value object previously obtained from // sqlite3_value_dup(). -func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:83342:17: */ +func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:83968:17: */ Xsqlite3ValueFree(tls, pOld) } @@ -59620,13 +59873,13 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:83342:17: * // // 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 *libc.TLS, pCtx uintptr, z uintptr, n int32, enc U8, xDel uintptr) { /* sqlite3.c:83358:13: */ +func setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc U8, xDel uintptr) { /* sqlite3.c:83984:13: */ if Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, enc, xDel) == SQLITE_TOOBIG { Xsqlite3_result_error_toobig(tls, pCtx) } } -func invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) int32 { /* sqlite3.c:83369:12: */ +func invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) int32 { /* sqlite3.c:83995:12: */ if xDel == uintptr(0) { // noop @@ -59641,12 +59894,12 @@ func invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) return SQLITE_TOOBIG } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83385:17: */ +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84011:17: */ setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr) { /* sqlite3.c:83395:17: */ +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr) { /* sqlite3.c:84021:17: */ if n > uint64(0x7fffffff) { invokeValueDestructor(tls, z, xDel, pCtx) @@ -59655,62 +59908,62 @@ func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_ui } } -func Xsqlite3_result_double(tls *libc.TLS, pCtx uintptr, rVal float64) { /* sqlite3.c:83409:17: */ +func Xsqlite3_result_double(tls *libc.TLS, pCtx uintptr, rVal float64) { /* sqlite3.c:84035:17: */ Xsqlite3VdbeMemSetDouble(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, rVal) } -func Xsqlite3_result_error(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:83413:17: */ +func Xsqlite3_result_error(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:84039:17: */ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_ERROR - Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, SQLITE_UTF8, libc.UintptrFromInt32(-1)) + Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, uint8(SQLITE_UTF8), libc.UintptrFromInt32(-1)) } -func Xsqlite3_result_error16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:83419:17: */ +func Xsqlite3_result_error16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:84045:17: */ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_ERROR - Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, SQLITE_UTF16LE, libc.UintptrFromInt32(-1)) + Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(-1)) } -func Xsqlite3_result_int(tls *libc.TLS, pCtx uintptr, iVal int32) { /* sqlite3.c:83425:17: */ +func Xsqlite3_result_int(tls *libc.TLS, pCtx uintptr, iVal int32) { /* sqlite3.c:84051:17: */ Xsqlite3VdbeMemSetInt64(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, I64(iVal)) } -func Xsqlite3_result_int64(tls *libc.TLS, pCtx uintptr, iVal I64) { /* sqlite3.c:83429:17: */ +func Xsqlite3_result_int64(tls *libc.TLS, pCtx uintptr, iVal I64) { /* sqlite3.c:84055:17: */ Xsqlite3VdbeMemSetInt64(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, iVal) } -func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83433:17: */ +func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84059:17: */ Xsqlite3VdbeMemSetNull(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:83437:17: */ +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:84063:17: */ var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut Xsqlite3VdbeMemRelease(tls, pOut) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) Xsqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) } -func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { /* sqlite3.c:83449:17: */ +func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { /* sqlite3.c:84075:17: */ var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut (*Mem)(unsafe.Pointer(pOut)).FeSubtype = (U8(eSubtype & uint32(0xff))) *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83455:17: */ +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84081:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF8, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr, enc uint8) { /* sqlite3.c:83464:17: */ +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr, enc uint8) { /* sqlite3.c:84090:17: */ if int32(enc) == SQLITE_UTF16 { - enc = SQLITE_UTF16LE + enc = uint8(SQLITE_UTF16LE) } if n > uint64(0x7fffffff) { invokeValueDestructor(tls, z, xDel, pCtx) @@ -59719,42 +59972,42 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_ui } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83481:17: */ +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84107:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF16LE, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16LE), xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83490:17: */ +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84116:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF16BE, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16BE), xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83499:17: */ +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:84125:17: */ - setResultStrOrError(tls, pCtx, z, n, SQLITE_UTF16LE, xDel) + setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF16LE), xDel) } -func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { /* sqlite3.c:83509:17: */ +func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { /* sqlite3.c:84135:17: */ Xsqlite3VdbeMemCopy(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, pValue) } -func Xsqlite3_result_zeroblob(tls *libc.TLS, pCtx uintptr, n int32) { /* sqlite3.c:83513:17: */ +func Xsqlite3_result_zeroblob(tls *libc.TLS, pCtx uintptr, n int32) { /* sqlite3.c:84139:17: */ Xsqlite3VdbeMemSetZeroBlob(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, n) } -func Xsqlite3_result_zeroblob64(tls *libc.TLS, pCtx uintptr, n U64) int32 { /* sqlite3.c:83517:16: */ +func Xsqlite3_result_zeroblob64(tls *libc.TLS, pCtx uintptr, n U64) int32 { /* sqlite3.c:84143:16: */ var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut - if n > U64(*(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(pOut)).Fdb + 124 /* &.aLimit */)))) { + if n > U64(*(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(pOut)).Fdb + 128 /* &.aLimit */)))) { return SQLITE_TOOBIG } Xsqlite3VdbeMemSetZeroBlob(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, int32(n)) return SQLITE_OK } -func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { /* sqlite3.c:83526:17: */ +func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { /* sqlite3.c:84152:17: */ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = func() int32 { if errCode != 0 { return errCode @@ -59763,20 +60016,20 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { /* }() if (int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags) & MEM_Null) != 0 { Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, Xsqlite3ErrStr(tls, errCode), -1, - SQLITE_UTF8, uintptr(0)) + uint8(SQLITE_UTF8), uintptr(0)) } } // Force an SQLITE_TOOBIG error. -func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83538:17: */ +func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84164:17: */ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_TOOBIG - Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, ts+7050 /* "string or blob t..." */, -1, - SQLITE_UTF8, uintptr(0)) + Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, ts+7126 /* "string or blob t..." */, -1, + uint8(SQLITE_UTF8), uintptr(0)) } // An SQLITE_NOMEM error. -func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83546:17: */ +func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84172:17: */ Xsqlite3VdbeMemSetNull(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = SQLITE_NOMEM @@ -59786,7 +60039,7 @@ func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:835 // Force the INT64 value currently stored as the result to be // a MEM_IntReal value. See the SQLITE_TESTCTRL_RESULT_INTREAL // test-control. -func Xsqlite3ResultIntReal(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83558:21: */ +func Xsqlite3ResultIntReal(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:84184:21: */ if (int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags) & MEM_Int) != 0 { *(*U16)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Int))) @@ -59796,7 +60049,7 @@ func Xsqlite3ResultIntReal(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83558:21: // This function is called after a transaction has been committed. It // invokes callbacks registered with sqlite3_wal_hook() as required. -func doWalCallbacks(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:83572:12: */ +func doWalCallbacks(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84198:12: */ var rc int32 = SQLITE_OK var i int32 for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { @@ -59807,7 +60060,7 @@ func doWalCallbacks(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:83572:12: */ nEntry = Xsqlite3PagerWalCallback(tls, Xsqlite3BtreePager(tls, pBt)) Xsqlite3BtreeLeave(tls, pBt) if ((nEntry > 0) && ((*Sqlite3)(unsafe.Pointer(db)).FxWalCallback != 0)) && (rc == SQLITE_OK) { - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer((db + 344 /* &.xWalCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpWalArg, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FzDbSName, nEntry) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer((db + 352 /* &.xWalCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpWalArg, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FzDbSName, nEntry) } } } @@ -59821,11 +60074,11 @@ func doWalCallbacks(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:83572:12: */ // 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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:83602:12: */ +func sqlite3Step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84228:12: */ var db uintptr var rc int32 - if !((*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_RUN) { + if !((*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic != U32(VDBE_MAGIC_RUN)) { goto __1 } // We used to require that sqlite3_reset() be called before retrying @@ -59883,7 +60136,7 @@ __3: if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0) { goto __6 } - libc.AtomicStoreNInt32((db + 392 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) + libc.AtomicStoreNInt32((db + 400 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) __6: ; @@ -59988,14 +60241,14 @@ end_of_step: // 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 *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83736:16: */ +func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84362:16: */ var rc int32 = SQLITE_OK // Result from sqlite3Step() var v uintptr = pStmt // the prepared statement var cnt int32 = 0 // Counter to prevent infinite loop of reprepares var db uintptr // The database connection if vdbeSafetyNotNull(tls, v) != 0 { - return Xsqlite3MisuseError(tls, 83743) + return Xsqlite3MisuseError(tls, 84369) } db = (*Vdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -60035,7 +60288,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83736:16: // Extract the user data from a sqlite3_context structure and return a // pointer to it. -func Xsqlite3_user_data(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:83785:17: */ +func Xsqlite3_user_data(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:84411:17: */ return (*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpFunc)).FpUserData } @@ -60048,7 +60301,7 @@ func Xsqlite3_user_data(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:83785:1 // parameter) of the sqlite3_create_function() and // sqlite3_create_function16() routines that originally registered the // application defined function. -func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:83800:20: */ +func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:84426:20: */ return (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpOut)).Fdb } @@ -60065,7 +60318,7 @@ func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c // Virtual table implements might use this routine to optimize their // performance by substituting a NULL result, or some other light-weight // value, as a signal to the xUpdate routine that the column is unchanged. -func Xsqlite3_vtab_nochange(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83819:16: */ +func Xsqlite3_vtab_nochange(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84445:16: */ return Xsqlite3_value_nochange(tls, (*Sqlite3_context)(unsafe.Pointer(p)).FpOut) } @@ -60075,7 +60328,7 @@ func Xsqlite3_vtab_nochange(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83819 // 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 Xsqlite3StmtCurrentTime(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:83831:30: */ +func Xsqlite3StmtCurrentTime(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:84457:30: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -60098,7 +60351,7 @@ func Xsqlite3StmtCurrentTime(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite // Create a new aggregate context for p and return a pointer to // its pMem->z element. -func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:83851:29: */ +func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:84477:29: */ var pMem uintptr = (*Sqlite3_context)(unsafe.Pointer(p)).FpMem if nByte <= 0 { @@ -60106,7 +60359,7 @@ func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite (*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0) } else { Xsqlite3VdbeMemClearAndResize(tls, pMem, nByte) - (*Mem)(unsafe.Pointer(pMem)).Fflags = MEM_Agg + (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(MEM_Agg) *(*uintptr)(unsafe.Pointer(pMem /* &.u */)) = (*Sqlite3_context)(unsafe.Pointer(p)).FpFunc if (*Mem)(unsafe.Pointer(pMem)).Fz != 0 { libc.Xmemset(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, 0, uint64(nByte)) @@ -60118,7 +60371,7 @@ func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite // 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 *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:83873:17: */ +func Xsqlite3_aggregate_context(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:84499:17: */ if (int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpMem)).Fflags) & MEM_Agg) == 0 { return createAggContext(tls, p, nByte) @@ -60136,7 +60389,7 @@ func Xsqlite3_aggregate_context(tls *libc.TLS, p uintptr, nByte int32) uintptr { // 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 *libc.TLS, pCtx uintptr, iArg int32) uintptr { /* sqlite3.c:83894:17: */ +func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) uintptr { /* sqlite3.c:84520:17: */ var pAuxData uintptr if (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe == uintptr(0) { @@ -60159,7 +60412,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) uintptr { /* // 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 *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { /* sqlite3.c:83922:17: */ +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { /* sqlite3.c:84548:17: */ var pAuxData uintptr var pVdbe uintptr pVdbe = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -60239,13 +60492,13 @@ __11: // 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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:83975:16: */ +func Xsqlite3_aggregate_count(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:84601:16: */ return (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpMem)).Fn } // Return the number of columns in the result set for the statement pStmt. -func Xsqlite3_column_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83984:16: */ +func Xsqlite3_column_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84610:16: */ var pVm uintptr = pStmt if pVm != 0 { return int32((*Vdbe)(unsafe.Pointer(pVm)).FnResColumn) @@ -60255,7 +60508,7 @@ func Xsqlite3_column_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83 // Return the number of values available from the current row of the // currently executing statement pStmt. -func Xsqlite3_data_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83993:16: */ +func Xsqlite3_data_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84619:16: */ var pVm uintptr = pStmt if (pVm == uintptr(0)) || ((*Vdbe)(unsafe.Pointer(pVm)).FpResultSet == uintptr(0)) { return 0 @@ -60264,19 +60517,19 @@ func Xsqlite3_data_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:8399 } // Return a pointer to static memory containing an SQL NULL value. -func columnNullValue(tls *libc.TLS) uintptr { /* sqlite3.c:84002:18: */ +func columnNullValue(tls *libc.TLS) uintptr { /* sqlite3.c:84628:18: */ return uintptr(unsafe.Pointer(&nullMem)) } var nullMem = Mem{ - /* .flags = */ Fflags: MEM_Null, -} /* sqlite3.c:84012:20 */ + /* .flags = */ Fflags: U16(MEM_Null), +} /* sqlite3.c:84638:20 */ // 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 *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84042:12: */ +func columnMem(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84668:12: */ var pVm uintptr var pOut uintptr @@ -60311,7 +60564,7 @@ func columnMem(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:840 // sqlite3_column_bytes() // sqlite3_column_bytes16() // sqiite3_column_blob() -func columnMallocFailure(tls *libc.TLS, pStmt uintptr) { /* sqlite3.c:84077:13: */ +func columnMallocFailure(tls *libc.TLS, pStmt uintptr) { /* sqlite3.c:84703:13: */ // If malloc() failed during an encoding conversion within an // sqlite3_column_XXX API, then set the return code of the statement to // SQLITE_NOMEM. The next call to _step() (if any) will return SQLITE_ERROR @@ -60328,7 +60581,7 @@ func columnMallocFailure(tls *libc.TLS, pStmt uintptr) { /* sqlite3.c:84077:13: // // The following routines are used to access elements of the current row // in the result set. -func Xsqlite3_column_blob(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84097:23: */ +func Xsqlite3_column_blob(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84723:23: */ var val uintptr val = Xsqlite3_value_blob(tls, columnMem(tls, pStmt, i)) // Even though there is no encoding conversion, value_blob() might @@ -60338,43 +60591,43 @@ func Xsqlite3_column_blob(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sq return val } -func Xsqlite3_column_bytes(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84107:16: */ +func Xsqlite3_column_bytes(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84733:16: */ var val int32 = Xsqlite3_value_bytes(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_bytes16(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84112:16: */ +func Xsqlite3_column_bytes16(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84738:16: */ var val int32 = Xsqlite3_value_bytes16(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_double(tls *libc.TLS, pStmt uintptr, i int32) float64 { /* sqlite3.c:84117:19: */ +func Xsqlite3_column_double(tls *libc.TLS, pStmt uintptr, i int32) float64 { /* sqlite3.c:84743:19: */ var val float64 = Xsqlite3_value_double(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_int(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84122:16: */ +func Xsqlite3_column_int(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84748:16: */ var val int32 = Xsqlite3_value_int(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_int64(tls *libc.TLS, pStmt uintptr, i int32) Sqlite_int64 { /* sqlite3.c:84127:25: */ +func Xsqlite3_column_int64(tls *libc.TLS, pStmt uintptr, i int32) Sqlite_int64 { /* sqlite3.c:84753:25: */ var val Sqlite_int64 = Xsqlite3_value_int64(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_text(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84132:32: */ +func Xsqlite3_column_text(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84758:32: */ var val uintptr = Xsqlite3_value_text(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_value(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84137:26: */ +func Xsqlite3_column_value(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84763:26: */ var pOut uintptr = columnMem(tls, pStmt, i) if (int32((*Mem)(unsafe.Pointer(pOut)).Fflags) & MEM_Static) != 0 { *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Static))) @@ -60384,13 +60637,13 @@ func Xsqlite3_column_value(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* s return pOut } -func Xsqlite3_column_text16(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84147:23: */ +func Xsqlite3_column_text16(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84773:23: */ var val uintptr = Xsqlite3_value_text16(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return val } -func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84153:16: */ +func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84779:16: */ var iType int32 = Xsqlite3_value_type(tls, columnMem(tls, pStmt, i)) columnMallocFailure(tls, pStmt) return iType @@ -60410,7 +60663,7 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqli // // 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 *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType int32) uintptr { /* sqlite3.c:84175:19: */ +func columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType int32) uintptr { /* sqlite3.c:84801:19: */ var ret uintptr var p uintptr var n int32 @@ -60442,11 +60695,11 @@ func columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType i // Return the name of the Nth column of the result set returned by SQL // statement pStmt. -func Xsqlite3_column_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84224:23: */ +func Xsqlite3_column_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84850:23: */ return columnName(tls, pStmt, N, 0, COLNAME_NAME) } -func Xsqlite3_column_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84228:23: */ +func Xsqlite3_column_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84854:23: */ return columnName(tls, pStmt, N, 1, COLNAME_NAME) } @@ -60455,44 +60708,44 @@ func Xsqlite3_column_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* // 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 *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84247:23: */ +func Xsqlite3_column_decltype(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84873:23: */ return columnName(tls, pStmt, N, 0, COLNAME_DECLTYPE) } -func Xsqlite3_column_decltype16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84251:23: */ +func Xsqlite3_column_decltype16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84877:23: */ return columnName(tls, pStmt, N, 1, COLNAME_DECLTYPE) } // Return the name of the database from which a result column derives. // NULL is returned if the result column is an expression or constant or // anything else which is not an unambiguous reference to a database column. -func Xsqlite3_column_database_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84263:23: */ +func Xsqlite3_column_database_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84889:23: */ return columnName(tls, pStmt, N, 0, COLNAME_DATABASE) } -func Xsqlite3_column_database_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84267:23: */ +func Xsqlite3_column_database_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84893:23: */ return columnName(tls, pStmt, N, 1, COLNAME_DATABASE) } // Return the name of the table from which a result column derives. // NULL is returned if the result column is an expression or constant or // anything else which is not an unambiguous reference to a database column. -func Xsqlite3_column_table_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84277:23: */ +func Xsqlite3_column_table_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84903:23: */ return columnName(tls, pStmt, N, 0, COLNAME_TABLE) } -func Xsqlite3_column_table_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84281:23: */ +func Xsqlite3_column_table_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84907:23: */ return columnName(tls, pStmt, N, 1, COLNAME_TABLE) } // Return the name of the table column from which a result column derives. // NULL is returned if the result column is an expression or constant or // anything else which is not an unambiguous reference to a database column. -func Xsqlite3_column_origin_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84291:23: */ +func Xsqlite3_column_origin_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84917:23: */ return columnName(tls, pStmt, N, 0, COLNAME_COLUMN) } -func Xsqlite3_column_origin_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84295:23: */ +func Xsqlite3_column_origin_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84921:23: */ return columnName(tls, pStmt, N, 1, COLNAME_COLUMN) } @@ -60509,21 +60762,21 @@ func Xsqlite3_column_origin_name16(tls *libc.TLS, pStmt uintptr, N int32) uintpt // // The error code stored in database p->db is overwritten with the return // value in any case. -func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84317:12: */ +func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84943:12: */ bp := tls.Alloc(8) defer tls.Free(8) var pVar uintptr if vdbeSafetyNotNull(tls, p) != 0 { - return Xsqlite3MisuseError(tls, 84320) + return Xsqlite3MisuseError(tls, 84946) } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - if ((*Vdbe)(unsafe.Pointer(p)).Fmagic != VDBE_MAGIC_RUN) || ((*Vdbe)(unsafe.Pointer(p)).Fpc >= 0) { + if ((*Vdbe)(unsafe.Pointer(p)).FiVdbeMagic != U32(VDBE_MAGIC_RUN)) || ((*Vdbe)(unsafe.Pointer(p)).Fpc >= 0) { Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, SQLITE_MISUSE) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) Xsqlite3_log(tls, SQLITE_MISUSE, - ts+7073 /* "bind on a busy p..." */, libc.VaList(bp, (*Vdbe)(unsafe.Pointer(p)).FzSql)) - return Xsqlite3MisuseError(tls, 84328) + ts+7149 /* "bind on a busy p..." */, libc.VaList(bp, (*Vdbe)(unsafe.Pointer(p)).FzSql)) + return Xsqlite3MisuseError(tls, 84954) } if (i < 1) || (i > int32((*Vdbe)(unsafe.Pointer(p)).FnVar)) { Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, SQLITE_RANGE) @@ -60533,7 +60786,7 @@ func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84317:12 i-- pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(i)*56) Xsqlite3VdbeMemRelease(tls, pVar) - (*Mem)(unsafe.Pointer(pVar)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pVar)).Fflags = U16(MEM_Null) (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FerrCode = SQLITE_OK // If the bit corresponding to this variable in Vdbe.expmask is set, then @@ -60557,7 +60810,7 @@ func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84317:12 } // Bind a text or BLOB value. -func bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr, encoding U8) int32 { /* sqlite3.c:84360:12: */ +func bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr, encoding U8) int32 { /* sqlite3.c:84986:12: */ var p uintptr = pStmt var pVar uintptr var rc int32 @@ -60583,11 +60836,11 @@ func bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, } // Bind a blob value to an SQL statement variable. -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84396:16: */ +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:85022:16: */ return bindText(tls, pStmt, i, zData, nData, xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr) int32 { /* sqlite3.c:84408:16: */ +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr) int32 { /* sqlite3.c:85034:16: */ if nData > uint64(0x7fffffff) { return invokeValueDestructor(tls, zData, xDel, uintptr(0)) @@ -60597,7 +60850,7 @@ func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, return int32(0) } -func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) int32 { /* sqlite3.c:84422:16: */ +func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) int32 { /* sqlite3.c:85048:16: */ var rc int32 var p uintptr = pStmt rc = vdbeUnbind(tls, p, i) @@ -60608,11 +60861,11 @@ func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) return rc } -func Xsqlite3_bind_int(tls *libc.TLS, p uintptr, i int32, iValue int32) int32 { /* sqlite3.c:84432:16: */ +func Xsqlite3_bind_int(tls *libc.TLS, p uintptr, i int32, iValue int32) int32 { /* sqlite3.c:85058:16: */ return Xsqlite3_bind_int64(tls, p, i, I64(iValue)) } -func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Sqlite_int64) int32 { /* sqlite3.c:84435:16: */ +func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Sqlite_int64) int32 { /* sqlite3.c:85061:16: */ var rc int32 var p uintptr = pStmt rc = vdbeUnbind(tls, p, i) @@ -60623,7 +60876,7 @@ func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Sqlite_in return rc } -func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84445:16: */ +func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:85071:16: */ var rc int32 var p uintptr = pStmt rc = vdbeUnbind(tls, p, i) @@ -60633,7 +60886,7 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) int32 { /* sqlite3.c:84454:16: */ +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) int32 { /* sqlite3.c:85080:16: */ var rc int32 var p uintptr = pStmt rc = vdbeUnbind(tls, p, i) @@ -60646,28 +60899,28 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84472:16: */ - return bindText(tls, pStmt, i, zData, nData, xDel, SQLITE_UTF8) +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:85098:16: */ + return bindText(tls, pStmt, i, zData, nData, xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr, enc uint8) int32 { /* sqlite3.c:84481:16: */ +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr, enc uint8) int32 { /* sqlite3.c:85107:16: */ if nData > uint64(0x7fffffff) { return invokeValueDestructor(tls, zData, xDel, uintptr(0)) } else { if int32(enc) == SQLITE_UTF16 { - enc = SQLITE_UTF16LE + enc = uint8(SQLITE_UTF16LE) } return bindText(tls, pStmt, i, zData, int32(nData), xDel, enc) } return int32(0) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84498:16: */ - return bindText(tls, pStmt, i, zData, nData, xDel, SQLITE_UTF16LE) +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:85124:16: */ + return bindText(tls, pStmt, i, zData, nData, xDel, uint8(SQLITE_UTF16LE)) } -func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) int32 { /* sqlite3.c:84508:16: */ +func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) int32 { /* sqlite3.c:85134:16: */ var rc int32 switch Xsqlite3_value_type(tls, pValue) { case SQLITE_INTEGER: @@ -60709,7 +60962,7 @@ func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) return rc } -func Xsqlite3_bind_zeroblob(tls *libc.TLS, pStmt uintptr, i int32, n int32) int32 { /* sqlite3.c:84539:16: */ +func Xsqlite3_bind_zeroblob(tls *libc.TLS, pStmt uintptr, i int32, n int32) int32 { /* sqlite3.c:85165:16: */ var rc int32 var p uintptr = pStmt rc = vdbeUnbind(tls, p, i) @@ -60720,11 +60973,11 @@ func Xsqlite3_bind_zeroblob(tls *libc.TLS, pStmt uintptr, i int32, n int32) int3 return rc } -func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Sqlite3_uint64) int32 { /* sqlite3.c:84549:16: */ +func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Sqlite3_uint64) int32 { /* sqlite3.c:85175:16: */ var rc int32 var p uintptr = pStmt Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - if n > U64(*(*int32)(unsafe.Pointer(((*Vdbe)(unsafe.Pointer(p)).Fdb + 124 /* &.aLimit */)))) { + if n > U64(*(*int32)(unsafe.Pointer(((*Vdbe)(unsafe.Pointer(p)).Fdb + 128 /* &.aLimit */)))) { rc = SQLITE_TOOBIG } else { @@ -60737,7 +60990,7 @@ func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Sqlite3_u // 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 *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84568:16: */ +func Xsqlite3_bind_parameter_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85194:16: */ var p uintptr = pStmt if p != 0 { return int32((*Vdbe)(unsafe.Pointer(p)).FnVar) @@ -60749,7 +61002,7 @@ func Xsqlite3_bind_parameter_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqli // is out of range or if the wildcard is unnamed. // // The result is always UTF-8. -func Xsqlite3_bind_parameter_name(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84579:23: */ +func Xsqlite3_bind_parameter_name(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:85205:23: */ var p uintptr = pStmt if p == uintptr(0) { return uintptr(0) @@ -60760,19 +61013,19 @@ func Xsqlite3_bind_parameter_name(tls *libc.TLS, pStmt uintptr, i int32) uintptr // 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 Xsqlite3VdbeParameterIndex(tls *libc.TLS, p uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:84590:20: */ +func Xsqlite3VdbeParameterIndex(tls *libc.TLS, p uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:85216:20: */ if (p == uintptr(0)) || (zName == uintptr(0)) { return 0 } return Xsqlite3VListNameToNum(tls, (*Vdbe)(unsafe.Pointer(p)).FpVList, zName, nName) } -func Xsqlite3_bind_parameter_index(tls *libc.TLS, pStmt uintptr, zName uintptr) int32 { /* sqlite3.c:84594:16: */ +func Xsqlite3_bind_parameter_index(tls *libc.TLS, pStmt uintptr, zName uintptr) int32 { /* sqlite3.c:85220:16: */ return Xsqlite3VdbeParameterIndex(tls, pStmt, zName, Xsqlite3Strlen30(tls, zName)) } // Transfer all bindings from the first statement over to the second. -func Xsqlite3TransferBindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:84601:20: */ +func Xsqlite3TransferBindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:85227:20: */ var pFrom uintptr = pFromStmt var pTo uintptr = pToStmt var i int32 @@ -60795,7 +61048,7 @@ func Xsqlite3TransferBindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) // 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 *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:84628:16: */ +func Xsqlite3_transfer_bindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:85254:16: */ var pFrom uintptr = pFromStmt var pTo uintptr = pToStmt if int32((*Vdbe)(unsafe.Pointer(pFrom)).FnVar) != int32((*Vdbe)(unsafe.Pointer(pTo)).FnVar) { @@ -60816,7 +61069,7 @@ func Xsqlite3_transfer_bindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintpt // 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 *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84652:20: */ +func Xsqlite3_db_handle(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:85278:20: */ if pStmt != 0 { return (*Vdbe)(unsafe.Pointer(pStmt)).Fdb } @@ -60825,7 +61078,7 @@ func Xsqlite3_db_handle(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:846 // Return true if the prepared statement is guaranteed to not modify the // database. -func Xsqlite3_stmt_readonly(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84660:16: */ +func Xsqlite3_stmt_readonly(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85286:16: */ if pStmt != 0 { return (int32(*(*uint16)(unsafe.Pointer(pStmt + 200 /* &.readOnly */)) & 0x80 >> 7)) } @@ -60834,7 +61087,7 @@ func Xsqlite3_stmt_readonly(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:8 // Return 1 if the statement is an EXPLAIN and return 2 if the // statement is an EXPLAIN QUERY PLAN -func Xsqlite3_stmt_isexplain(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84668:16: */ +func Xsqlite3_stmt_isexplain(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85294:16: */ if pStmt != 0 { return (int32(*(*uint16)(unsafe.Pointer(pStmt + 200 /* &.explain */)) & 0xc >> 2)) } @@ -60842,16 +61095,16 @@ func Xsqlite3_stmt_isexplain(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c: } // Return true if the prepared statement is in need of being reset. -func Xsqlite3_stmt_busy(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84675:16: */ +func Xsqlite3_stmt_busy(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:85301:16: */ var v uintptr = pStmt - return (libc.Bool32(((v != uintptr(0)) && ((*Vdbe)(unsafe.Pointer(v)).Fmagic == VDBE_MAGIC_RUN)) && ((*Vdbe)(unsafe.Pointer(v)).Fpc >= 0))) + return (libc.Bool32(((v != uintptr(0)) && ((*Vdbe)(unsafe.Pointer(v)).FiVdbeMagic == U32(VDBE_MAGIC_RUN))) && ((*Vdbe)(unsafe.Pointer(v)).Fpc >= 0))) } // Return a pointer to the next prepared statement after pStmt associated // with database connection pDb. If pStmt is NULL, return the first // prepared statement for the database connection. Return NULL if there // are no more. -func Xsqlite3_next_stmt(tls *libc.TLS, pDb uintptr, pStmt uintptr) uintptr { /* sqlite3.c:84686:25: */ +func Xsqlite3_next_stmt(tls *libc.TLS, pDb uintptr, pStmt uintptr) uintptr { /* sqlite3.c:85312:25: */ var pNext uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(pDb)).Fmutex) if pStmt == uintptr(0) { @@ -60864,7 +61117,7 @@ func Xsqlite3_next_stmt(tls *libc.TLS, pDb uintptr, pStmt uintptr) uintptr { /* } // Return the value of a status counter for a prepared statement -func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int32) int32 { /* sqlite3.c:84707:16: */ +func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int32) int32 { /* sqlite3.c:85333:16: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -60890,7 +61143,7 @@ func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int3 } // Return the SQL associated with a prepared statement -func Xsqlite3_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84737:23: */ +func Xsqlite3_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:85363:23: */ var p uintptr = pStmt if p != 0 { return (*Vdbe)(unsafe.Pointer(p)).FzSql @@ -60905,7 +61158,7 @@ func Xsqlite3_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84737:23: // // The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of // expanded bound parameters. -func Xsqlite3_expanded_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84751:17: */ +func Xsqlite3_expanded_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:85377:17: */ var z uintptr = uintptr(0) var zSql uintptr = Xsqlite3_sql(tls, pStmt) if zSql != 0 { @@ -60920,7 +61173,7 @@ func Xsqlite3_expanded_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c: // Allocate and populate an UnpackedRecord structure based on the serialized // record in nKey/pKey. Return a pointer to the new UnpackedRecord structure // if successful, or a NULL pointer if an OOM error is encountered. -func vdbeUnpackRecord(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr) uintptr { /* sqlite3.c:84789:23: */ +func vdbeUnpackRecord(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr) uintptr { /* sqlite3.c:85415:23: */ var pRet uintptr // Return value pRet = Xsqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo) @@ -60933,7 +61186,7 @@ func vdbeUnpackRecord(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr) // This function is called from within a pre-update callback to retrieve // a field of the row currently being updated or deleted. -func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:84808:16: */ +func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:85434:16: */ var p uintptr var pMem uintptr var rc int32 @@ -60947,7 +61200,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if !(!(p != 0) || ((*PreUpdate)(unsafe.Pointer(p)).Fop == SQLITE_INSERT)) { goto __1 } - rc = Xsqlite3MisuseError(tls, 84816) + rc = Xsqlite3MisuseError(tls, 85442) goto preupdate_old_out __1: ; @@ -61039,7 +61292,7 @@ preupdate_old_out: // This function is called from within a pre-update callback to retrieve // the number of columns in the row being updated, deleted or inserted. -func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84871:16: */ +func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:85497:16: */ var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate return func() int32 { if p != 0 { @@ -61058,7 +61311,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84 // // For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL // or SET DEFAULT action is considered a trigger. -func Xsqlite3_preupdate_depth(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84889:16: */ +func Xsqlite3_preupdate_depth(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:85515:16: */ var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate return func() int32 { if p != 0 { @@ -61070,7 +61323,7 @@ func Xsqlite3_preupdate_depth(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84 // This function is called from within a pre-update callback to retrieve // a field of the row currently being updated or inserted. -func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:84900:16: */ +func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:85526:16: */ var p uintptr var rc int32 var pMem uintptr @@ -61084,7 +61337,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if !(!(p != 0) || ((*PreUpdate)(unsafe.Pointer(p)).Fop == SQLITE_DELETE)) { goto __1 } - rc = Xsqlite3MisuseError(tls, 84906) + rc = Xsqlite3MisuseError(tls, 85532) goto preupdate_new_out __1: ; @@ -61225,7 +61478,7 @@ preupdate_new_out: // 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 *libc.TLS, zSql uintptr, pnToken uintptr) int32 { /* sqlite3.c:85070:12: */ +func findNextHostParameter(tls *libc.TLS, zSql uintptr, pnToken uintptr) int32 { /* sqlite3.c:85696:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -61270,7 +61523,7 @@ func findNextHostParameter(tls *libc.TLS, zSql uintptr, pnToken uintptr) int32 { // 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 Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { /* sqlite3.c:85113:21: */ +func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { /* sqlite3.c:85739:21: */ bp := tls.Alloc(248) defer tls.Free(248) @@ -61291,13 +61544,13 @@ func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { db = (*Vdbe)(unsafe.Pointer(p)).Fdb Xsqlite3StrAccumInit(tls, bp+48 /* &out */, uintptr(0), bp+80 /* &zBase[0] */, int32(unsafe.Sizeof([100]int8{})), - *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) + *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 1 { for *(*int8)(unsafe.Pointer(zRawSql)) != 0 { var zStart uintptr = zRawSql for (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zRawSql, 1)))) != '\n') && (*(*int8)(unsafe.Pointer(zRawSql)) != 0) { } - Xsqlite3_str_append(tls, bp+48 /* &out */, ts+7113 /* "-- " */, 3) + Xsqlite3_str_append(tls, bp+48 /* &out */, ts+7189 /* "-- " */, 3) Xsqlite3_str_append(tls, bp+48 /* &out */, zStart, (int32((int64(zRawSql) - int64(zStart)) / 1))) } @@ -61326,15 +61579,20 @@ func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { } zRawSql += uintptr(*(*int32)(unsafe.Pointer(bp + 180 /* nToken */))) - nextIndex = (*(*int32)(unsafe.Pointer(bp + 184 /* idx */)) + 1) + nextIndex = func() int32 { + if (*(*int32)(unsafe.Pointer(bp + 184 /* idx */)) + 1) > (nextIndex) { + return (*(*int32)(unsafe.Pointer(bp + 184 /* idx */)) + 1) + } + return nextIndex + }() pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr((*(*int32)(unsafe.Pointer(bp + 184 /* idx */))-1))*56) if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & MEM_Null) != 0 { Xsqlite3_str_append(tls, bp+48 /* &out */, ts+801 /* "NULL" */, 4) } else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & (MEM_Int | MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+6689 /* "%lld" */, libc.VaList(bp, *(*I64)(unsafe.Pointer(pVar /* &.u */)))) + Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+6765 /* "%lld" */, libc.VaList(bp, *(*I64)(unsafe.Pointer(pVar /* &.u */)))) } else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+6578 /* "%!.15g" */, libc.VaList(bp+8, *(*float64)(unsafe.Pointer(pVar /* &.u */)))) + Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+6654 /* "%!.15g" */, libc.VaList(bp+8, *(*float64)(unsafe.Pointer(pVar /* &.u */)))) } else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & MEM_Str) != 0 { var nOut int32 // Number of bytes of the string text to include in output var enc U8 = (*Sqlite3)(unsafe.Pointer(db)).Fenc @@ -61343,27 +61601,27 @@ func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { (*Mem)(unsafe.Pointer(bp + 192 /* &utf8 */)).Fdb = db Xsqlite3VdbeMemSetStr(tls, bp+192 /* &utf8 */, (*Mem)(unsafe.Pointer(pVar)).Fz, (*Mem)(unsafe.Pointer(pVar)).Fn, enc, uintptr(0)) if SQLITE_NOMEM == Xsqlite3VdbeChangeEncoding(tls, bp+192 /* &utf8 */, SQLITE_UTF8) { - (*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FaccError = SQLITE_NOMEM + (*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FaccError = U8(SQLITE_NOMEM) (*StrAccum)(unsafe.Pointer(bp + 48 /* &out */)).FnAlloc = U32(0) } pVar = bp + 192 /* &utf8 */ } nOut = (*Mem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+7117 /* "'%.*q'" */, libc.VaList(bp+16, nOut, (*Mem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+7193 /* "'%.*q'" */, libc.VaList(bp+16, nOut, (*Mem)(unsafe.Pointer(pVar)).Fz)) if int32(enc) != SQLITE_UTF8 { Xsqlite3VdbeMemRelease(tls, bp+192 /* &utf8 */) } } else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+7124 /* "zeroblob(%d)" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pVar /* &.u */)))) + Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+7200 /* "zeroblob(%d)" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pVar /* &.u */)))) } else { var nOut int32 // Number of bytes of the blob to include in output - Xsqlite3_str_append(tls, bp+48 /* &out */, ts+7137 /* "x'" */, 2) + Xsqlite3_str_append(tls, bp+48 /* &out */, ts+7213 /* "x'" */, 2) nOut = (*Mem)(unsafe.Pointer(pVar)).Fn for i = 0; i < nOut; i++ { - Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+7140 /* "%02x" */, libc.VaList(bp+40, (int32(*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&0xff))) + Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+7216 /* "%02x" */, libc.VaList(bp+40, (int32(*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&0xff))) } - Xsqlite3_str_append(tls, bp+48 /* &out */, ts+7145 /* "'" */, 1) + Xsqlite3_str_append(tls, bp+48 /* &out */, ts+7221 /* "'" */, 1) } } } @@ -61409,7 +61667,7 @@ func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { // procedures use this information to make sure that indices are // working correctly. This variable has no function other than to // help verify the correct operation of the library. -var Xsqlite3_search_count int32 = 0 /* sqlite3.c:85285:16 */ +var Xsqlite3_search_count int32 = 0 /* sqlite3.c:85911:16 */ // When this global variable is positive, it gets decremented once before // each instruction in the VDBE. When it reaches zero, the u1.isInterrupted @@ -61417,23 +61675,23 @@ var Xsqlite3_search_count int32 = 0 /* sqlite3.c:85285:16 */ // // This facility is used for testing purposes only. It does not function // in an ordinary build. -var Xsqlite3_interrupt_count int32 = 0 /* sqlite3.c:85297:16 */ +var Xsqlite3_interrupt_count int32 = 0 /* sqlite3.c:85923:16 */ // The next global variable is incremented each type the OP_Sort opcode // is executed. The test procedures use this information to make sure that // sorting is occurring or not occurring at appropriate times. This variable // has no function other than to help verify the correct operation of the // library. -var Xsqlite3_sort_count int32 = 0 /* sqlite3.c:85308:16 */ +var Xsqlite3_sort_count int32 = 0 /* sqlite3.c:85934:16 */ // The next global variable records the size of the largest MEM_Blob // or MEM_Str that has been used by a VDBE opcode. The test procedures // use this information to make sure that the zero-blob functionality // is working correctly. This variable has no function other than to // help verify the correct operation of the library. -var Xsqlite3_max_blobsize int32 = 0 /* sqlite3.c:85319:16 */ +var Xsqlite3_max_blobsize int32 = 0 /* sqlite3.c:85945:16 */ -func updateMaxBlobsize(tls *libc.TLS, p uintptr) { /* sqlite3.c:85320:13: */ +func updateMaxBlobsize(tls *libc.TLS, p uintptr) { /* sqlite3.c:85946:13: */ if ((int32((*Mem)(unsafe.Pointer(p)).Fflags) & (MEM_Str | MEM_Blob)) != 0) && ((*Mem)(unsafe.Pointer(p)).Fn > Xsqlite3_max_blobsize) { Xsqlite3_max_blobsize = (*Mem)(unsafe.Pointer(p)).Fn } @@ -61447,7 +61705,7 @@ func updateMaxBlobsize(tls *libc.TLS, p uintptr) { /* sqlite3.c:85320:13: */ // operation implemented using OP_FkIsZero is working. This variable // has no function other than to help verify the correct operation of the // library. -var Xsqlite3_found_count int32 = 0 /* sqlite3.c:85345:16 */ +var Xsqlite3_found_count int32 = 0 /* sqlite3.c:85971:16 */ // Test a register to see if it exceeds the current maximum blob size. // If it does, record the new maximum blob size. @@ -61502,7 +61760,7 @@ var Xsqlite3_found_count int32 = 0 /* sqlite3.c:85345:16 */ // Allocate VdbeCursor number iCur. Return a pointer to it. Return NULL // if we run out of memory. -func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, iDb int32, eCurType U8) uintptr { /* sqlite3.c:85478:19: */ +func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, iDb int32, eCurType U8) uintptr { /* sqlite3.c:86104:19: */ // Find the memory cell that will be used to store the blob of memory // required for this VdbeCursor structure. It is convenient to use a // vdbe memory cell to manage the memory allocation required for a @@ -61565,7 +61823,7 @@ func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, iDb int3 // floating point value of rValue. Return true and set *piValue to the // integer value if the string is in range to be an integer. Otherwise, // return false. -func alsoAnInt(tls *libc.TLS, pRec uintptr, rValue float64, piValue uintptr) int32 { /* sqlite3.c:85543:12: */ +func alsoAnInt(tls *libc.TLS, pRec uintptr, rValue float64, piValue uintptr) int32 { /* sqlite3.c:86169:12: */ var iValue I64 = I64(rValue) if Xsqlite3RealSameAsInt(tls, rValue, iValue) != 0 { *(*I64)(unsafe.Pointer(piValue)) = iValue @@ -61587,7 +61845,7 @@ func alsoAnInt(tls *libc.TLS, pRec uintptr, rValue float64, piValue uintptr) int // 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 *libc.TLS, pRec uintptr, bTryForInt int32) { /* sqlite3.c:85567:13: */ +func applyNumericAffinity(tls *libc.TLS, pRec uintptr, bTryForInt int32) { /* sqlite3.c:86193:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -61633,7 +61891,7 @@ func applyNumericAffinity(tls *libc.TLS, pRec uintptr, bTryForInt int32) { /* sq // SQLITE_AFF_BLOB: // SQLITE_AFF_NONE: // No-op. pRec is unchanged. -func applyAffinity(tls *libc.TLS, pRec uintptr, affinity int8, enc U8) { /* sqlite3.c:85607:13: */ +func applyAffinity(tls *libc.TLS, pRec uintptr, affinity int8, enc U8) { /* sqlite3.c:86233:13: */ if int32(affinity) >= SQLITE_AFF_NUMERIC { if (int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Int) == 0 { //OPTIMIZATION-IF-FALSE @@ -61665,7 +61923,7 @@ func applyAffinity(tls *libc.TLS, pRec uintptr, affinity int8, enc U8) { /* sqli // 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 *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:85646:16: */ +func Xsqlite3_value_numeric_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:86272:16: */ var eType int32 = Xsqlite3_value_type(tls, pVal) if eType == SQLITE_TEXT { var pMem uintptr = pVal @@ -61677,7 +61935,7 @@ func Xsqlite3_value_numeric_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3 // Exported version of applyAffinity(). This one works on sqlite3_value*, // not the internal Mem* type. -func Xsqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity U8, enc U8) { /* sqlite3.c:85660:21: */ +func Xsqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity U8, enc U8) { /* sqlite3.c:86286:21: */ applyAffinity(tls, pVal, int8(affinity), enc) } @@ -61685,7 +61943,7 @@ func Xsqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity U8, enc U8 // 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 *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85674:28: */ +func computeNumericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:86300:28: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -61700,15 +61958,15 @@ func computeNumericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85674:28 if rc <= 0 { if (rc == 0) && (Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &ix */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) <= 1) { *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */)) - return MEM_Int + return U16(MEM_Int) } else { - return MEM_Real + return U16(MEM_Real) } } else if (rc == 1) && (Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &ix */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) == 0) { *(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */)) - return MEM_Int + return U16(MEM_Int) } - return MEM_Real + return U16(MEM_Real) } // Return the numeric type for pMem, either MEM_Int or MEM_Real or both or @@ -61716,7 +61974,7 @@ func computeNumericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85674:28 // // Unlike applyNumericAffinity(), this routine does not modify pMem->flags. // But it does set pMem->u.r and pMem->u.i appropriately. -func numericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85702:12: */ +func numericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:86328:12: */ if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & ((MEM_Int | MEM_Real) | MEM_IntReal)) != 0 { return (U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & ((MEM_Int | MEM_Real) | MEM_IntReal))) @@ -61730,13 +61988,13 @@ func numericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85702:12: */ // Return the register of pOp->p2 after first preparing it to be // overwritten with an integer value. -func out2PrereleaseWithClear(tls *libc.TLS, pOut uintptr) uintptr { /* sqlite3.c:85961:28: */ +func out2PrereleaseWithClear(tls *libc.TLS, pOut uintptr) uintptr { /* sqlite3.c:86587:28: */ Xsqlite3VdbeMemSetNull(tls, pOut) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) return pOut } -func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3.c:85966:12: */ +func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3.c:86592:12: */ var pOut uintptr pOut = ((*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*VdbeOp)(unsafe.Pointer(pOp)).Fp2)*56) @@ -61744,7 +62002,7 @@ func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3. if (int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0 { //OPTIMIZATION-IF-FALSE return out2PrereleaseWithClear(tls, pOut) } else { - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) return pOut } return uintptr(0) @@ -61752,9 +62010,9 @@ func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3. // Execute as much of a VDBE program as we can. // This is the core of sqlite3_step(). -func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: */ - bp := tls.Alloc(848) - defer tls.Free(848) +func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:86611:20: */ + bp := tls.Alloc(936) + defer tls.Free(936) var aOp uintptr // Copy of p->aOp var pOp uintptr // Current operation @@ -61911,119 +62169,131 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: * var nField2 int32 // Number of columns or fields in the key var iKey I64 // The rowid we are to seek to var eqOnly int32 - var pC4 uintptr // jump, in3 + var pC4 uintptr + // var res3 int32 at bp+352, 4 + + var nStep int32 + // var r1 UnpackedRecord at bp+328, 24 + var pC5 uintptr // jump, in3 + var pC6 uintptr // jump, in3 var alreadyExists int32 var takeJump int32 var ii1 int32 - var pC6 uintptr - // var res3 int32 at bp+352, 4 + var pC7 uintptr + // var res4 int32 at bp+384, 4 var pFree uintptr var pIdxKey uintptr - // var r1 UnpackedRecord at bp+328, 24 + // var r2 UnpackedRecord at bp+360, 24 // If pIn3->u.i does not contain an integer, compute iKey as the // integer value of pIn3. Jump to P2 if pIn3 cannot be converted // into an integer without loss of information. Take care to avoid // changing the datatype of pIn3, however, as it is used by other // parts of the prepared statement. - // var x Mem at bp+360, 56 + // var x Mem at bp+392, 56 // jump, in3 - var pC7 uintptr + var pC8 uintptr var pCrsr2 uintptr - // var res4 int32 at bp+416, 4 + // var res5 int32 at bp+448, 4 var iKey1 U64 // out2 - // var v I64 at bp+424, 8 + // var v I64 at bp+456, 8 // The new rowid - var pC8 uintptr // Cursor of table to get the new rowid - // var res5 int32 at bp+420, 4 + var pC9 uintptr // Cursor of table to get the new rowid + // var res6 int32 at bp+452, 4 // Result of an sqlite3BtreeLast() var cnt1 int32 // Counter to limit the number of searches var pMem1 uintptr // Register holding largest rowid for AUTOINCREMENT var pFrame1 uintptr var pData uintptr // MEM cell holding data for the record to be inserted var pKey uintptr // MEM cell holding key for the record - var pC9 uintptr // Cursor to table into which insert is written + var pC10 uintptr // Cursor to table into which insert is written var seekResult int32 // Result of prior seek or 0 if no USESEEKRESULT flag var zDb uintptr // database name - used by the update hook var pTab uintptr // Table structure - used by update and pre-update hooks - // var x1 BtreePayload at bp+432, 48 + // var x1 BtreePayload at bp+464, 48 - var pC10 uintptr + var pDest1 uintptr // Cursor to write to + var pSrc uintptr // Cursor to read from + var iKey2 I64 + var pC11 uintptr var zDb1 uintptr var pTab1 uintptr var opflags int32 - var pC11 uintptr - // var res6 int32 at bp+480, 4 + var pC12 uintptr + // var res7 int32 at bp+512, 4 var nKeyCol int32 - var pC12 uintptr var pC13 uintptr + var pC14 uintptr var pCrsr3 uintptr var n3 U32 // out2 - var pC14 uintptr - // var v3 I64 at bp+488, 8 + var pC15 uintptr + // var v3 I64 at bp+520, 8 var pVtab uintptr var pModule uintptr - var pC15 uintptr // jump - var pC16 uintptr - var pCrsr4 uintptr - // var res7 int32 at bp+496, 4 - // jump + var pC16 uintptr // jump var pC17 uintptr + var pCrsr4 uintptr + // var res8 int32 at bp+528, 4 + // jump + var pC18 uintptr var pCrsr5 uintptr - // var res8 int32 at bp+500, 4 + // var res9 int32 at bp+532, 4 var sz I64 // jump - var pC18 uintptr + var pC19 uintptr var pCrsr6 uintptr - // var res9 int32 at bp+504, 4 + // var res10 int32 at bp+536, 4 // jump - var pC19 uintptr // in2 - var pC20 uintptr - // var x2 BtreePayload at bp+512, 48 - // in2 + var pC20 uintptr // in2 var pC21 uintptr + // var x2 BtreePayload at bp+544, 48 + // in2 var pC22 uintptr + var pC23 uintptr var pCrsr7 uintptr - // var res10 int32 at bp+584, 4 + // var res11 int32 at bp+616, 4 - // var r2 UnpackedRecord at bp+560, 24 + // var r3 UnpackedRecord at bp+592, 24 // out2 - var pC23 uintptr // The P1 index cursor + var pC24 uintptr // The P1 index cursor var pTabCur uintptr // The P2 table cursor (OP_DeferredSeek only) - // var rowid I64 at bp+592, 8 + // var rowid I64 at bp+624, 8 - var pC24 uintptr // jump var pC25 uintptr - // var res11 int32 at bp+624, 4 - - // var r3 UnpackedRecord at bp+600, 24 + var nCellKey I64 + var pCur1 uintptr + // var m Mem at bp+632, 56 + // jump + var pC26 uintptr + var res12 int32 + // var r4 UnpackedRecord at bp+688, 24 // out2 - // var iMoved int32 at bp+628, 4 + // var iMoved int32 at bp+712, 4 var iDb2 int32 - // var nChange int32 at bp+632, 4 + // var nChange int32 at bp+716, 4 - var pC26 uintptr // out2 - // var pgno Pgno at bp+636, 4 + var pC27 uintptr // out2 + // var pgno Pgno at bp+720, 4 var pDb2 uintptr var iDb3 int32 var zSchema uintptr var zSql uintptr - // var initData InitData at bp+640, 40 + // var initData InitData at bp+728, 40 var nRoot int32 // Number of tables to check. (Number of root pages.) var aRoot uintptr // Array of rootpage numbers for tables to be checked - // var nErr int32 at bp+680, 4 + // var nErr int32 at bp+768, 4 // Number of errors reported var z uintptr // Text of the error report var pnErr uintptr // jump, in1, out3 - // var val I64 at bp+688, 8 + // var val I64 at bp+776, 8 // jump, in1, in3 var iSet int32 var exists int32 // jump @@ -62038,7 +62308,7 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: * var pFrame3 uintptr var pIn uintptr // in2 var pFrame4 uintptr // in1, out2, in3 - // var x3 I64 at bp+696, 8 + // var x3 I64 at bp+784, 8 var n4 int32 var pCtx uintptr @@ -62047,7 +62317,7 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: * var pMem3 uintptr var pMem4 uintptr var i5 int32 // Loop counter - // var aRes [3]int32 at bp+704, 12 + // var aRes [3]int32 at bp+792, 12 // Results var pMem5 uintptr // out2 var pBt1 uintptr // Btree to change journal mode of @@ -62056,17 +62326,17 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: * var eOld int32 // The old journal mode var zFilename uintptr // jump var pBt2 uintptr - var pC27 uintptr var pC28 uintptr + var pC29 uintptr var z1 uintptr var p13 int32 var isWriteLock U8 var pVTab uintptr - // var sMem1 Mem at bp+720, 56 + // var sMem1 Mem at bp+808, 56 // For storing the record being decoded var zTab uintptr - var pCur1 uintptr - // var pVCur uintptr at bp+776, 8 + var pCur2 uintptr + // var pVCur uintptr at bp+864, 8 var pVtab1 uintptr var pModule1 uintptr // jump @@ -62077,20 +62347,20 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: * var pArgc uintptr var pVCur1 uintptr var pVtab2 uintptr - var pCur2 uintptr - var res12 int32 + var pCur3 uintptr + var res13 int32 var i6 int32 var apArg uintptr var pVtab3 uintptr var pModule3 uintptr - var pDest1 uintptr - // var sContext Sqlite3_context at bp+784, 56 + var pDest2 uintptr + // var sContext Sqlite3_context at bp+872, 56 - var pCur3 uintptr // jump + var pCur4 uintptr // jump var pVtab4 uintptr var pModule4 uintptr - var res13 int32 - var pCur4 uintptr + var res14 int32 + var pCur5 uintptr var pVtab5 uintptr var pName uintptr var isLegacy int32 @@ -62099,7 +62369,7 @@ func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: * var pModule5 uintptr var nArg1 int32 var i7 int32 - // var rowid1 Sqlite_int64 at bp+840, 8 + // var rowid1 Sqlite_int64 at bp+928, 8 var apArg1 uintptr var pX1 uintptr // out2 @@ -62154,7 +62424,7 @@ __3: (*Vdbe)(unsafe.Pointer(p)).FpResultSet = uintptr(0) (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 - if !(libc.AtomicLoadNInt32((db+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { + if !(libc.AtomicLoadNInt32((db+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { goto __4 } goto abort_due_to_interrupt @@ -62471,6 +62741,19 @@ __8: case OP_IntCopy: goto __31 + // Opcode: ChngCntRow P1 P2 * * * + // Synopsis: output=r[P1] + // + // Output value in register P1 as the chance count for a DML statement, + // due to the "PRAGMA count_changes=ON" setting. Or, if there was a + // foreign key error in the statement, trigger the error now. + // + // This opcode is a variant of OP_ResultRow that checks the foreign key + // immediate constraint count and throws an error if the count is + // non-zero. The P2 opcode must be 1. + case OP_ChngCntRow: + goto __32 + // Opcode: ResultRow P1 P2 * * * // Synopsis: output=r[P1@P2] // @@ -62480,7 +62763,7 @@ __8: // structure to provide access to the r(P1)..r(P1+P2-1) values as // the result row. case OP_ResultRow: - goto __32 + goto __33 // Opcode: Concat P1 P2 P3 * * // Synopsis: r[P3]=r[P2]+r[P1] @@ -62495,7 +62778,7 @@ __8: // if P3 is the same register as P2, the implementation is able // to avoid a memcpy(). case OP_Concat: - goto __33 + goto __34 // Opcode: Add P1 P2 P3 * * // Synopsis: r[P3]=r[P1]+r[P2] @@ -62531,15 +62814,15 @@ __8: // If the value in register P1 is zero the result is NULL. // If either operand is NULL, the result is NULL. case OP_Add: - goto __34 // same as TK_PLUS, in1, in2, out3 + goto __35 // same as TK_PLUS, in1, in2, out3 case OP_Subtract: - goto __35 // same as TK_MINUS, in1, in2, out3 + goto __36 // same as TK_MINUS, in1, in2, out3 case OP_Multiply: - goto __36 // same as TK_STAR, in1, in2, out3 + goto __37 // same as TK_STAR, in1, in2, out3 case OP_Divide: - goto __37 // same as TK_SLASH, in1, in2, out3 + goto __38 // same as TK_SLASH, in1, in2, out3 case OP_Remainder: - goto __38 + goto __39 // Opcode: CollSeq P1 * * P4 // @@ -62556,7 +62839,7 @@ __8: // to retrieve the collation sequence set by this opcode is not available // publicly. Only built-in functions have access to this feature. case OP_CollSeq: - goto __39 + goto __40 // Opcode: BitAnd P1 P2 P3 * * // Synopsis: r[P3]=r[P1]&r[P2] @@ -62585,13 +62868,13 @@ __8: // Store the result in register P3. // If either input is NULL, the result is NULL. case OP_BitAnd: - goto __40 // same as TK_BITAND, in1, in2, out3 + goto __41 // same as TK_BITAND, in1, in2, out3 case OP_BitOr: - goto __41 // same as TK_BITOR, in1, in2, out3 + goto __42 // same as TK_BITOR, in1, in2, out3 case OP_ShiftLeft: - goto __42 // same as TK_LSHIFT, in1, in2, out3 + goto __43 // same as TK_LSHIFT, in1, in2, out3 case OP_ShiftRight: - goto __43 + goto __44 // Opcode: AddImm P1 P2 * * * // Synopsis: r[P1]=r[P1]+P2 @@ -62601,7 +62884,7 @@ __8: // // To force any register to be an integer, just add 0. case OP_AddImm: - goto __44 + goto __45 // Opcode: MustBeInt P1 P2 * * * // @@ -62610,7 +62893,7 @@ __8: // without data loss, then jump immediately to P2, or if P2==0 // raise an SQLITE_MISMATCH exception. case OP_MustBeInt: - goto __45 + goto __46 // Opcode: RealAffinity P1 * * * * // @@ -62621,7 +62904,7 @@ __8: // integers, for space efficiency, but after extraction we want them // to have only a real value. case OP_RealAffinity: - goto __46 + goto __47 // Opcode: Cast P1 P2 * * * // Synopsis: affinity(r[P1]) @@ -62638,7 +62921,7 @@ __8: // // A NULL value is not changed by this routine. It remains NULL. case OP_Cast: - goto __47 + goto __48 // Opcode: Eq P1 P2 P3 P4 P5 // Synopsis: IF r[P3]==r[P1] @@ -62731,17 +63014,17 @@ __8: // the content of register P3 is greater than or equal to the content of // register P1. See the Lt opcode for additional information. case OP_Eq: - goto __48 // same as TK_EQ, jump, in1, in3 + goto __49 // same as TK_EQ, jump, in1, in3 case OP_Ne: - goto __49 // same as TK_NE, jump, in1, in3 + goto __50 // same as TK_NE, jump, in1, in3 case OP_Lt: - goto __50 // same as TK_LT, jump, in1, in3 + goto __51 // same as TK_LT, jump, in1, in3 case OP_Le: - goto __51 // same as TK_LE, jump, in1, in3 + goto __52 // same as TK_LE, jump, in1, in3 case OP_Gt: - goto __52 // same as TK_GT, jump, in1, in3 + goto __53 // same as TK_GT, jump, in1, in3 case OP_Ge: - goto __53 + goto __54 // Opcode: ElseNotEq * P2 * * * // @@ -62756,7 +63039,7 @@ __8: // jump to P2. If the result of an OP_Eq comparison on the two previous // operands would have been true (1), then fall through. case OP_ElseNotEq: - goto __54 + goto __55 // Opcode: Permutation * * * P4 * // @@ -62770,7 +63053,7 @@ __8: // The first integer in the P4 integer array is the length of the array // and does not become part of the permutation. case OP_Permutation: - goto __55 + goto __56 // Opcode: Compare P1 P2 P3 P4 P5 // Synopsis: r[P1@P3] <-> r[P2@P3] @@ -62792,7 +63075,7 @@ __8: // NULLs are less than numbers, numbers are less than strings, // and strings are less than blobs. case OP_Compare: - goto __56 + goto __57 // Opcode: Jump P1 P2 P3 * * // @@ -62800,7 +63083,7 @@ __8: // in the most recent OP_Compare instruction the P1 vector was less than // equal to, or greater than the P2 vector, respectively. case OP_Jump: - goto __57 + goto __58 // Opcode: And P1 P2 P3 * * // Synopsis: r[P3]=(r[P1] && r[P2]) @@ -62821,9 +63104,9 @@ __8: // even if the other input is NULL. A NULL and false or two NULLs // give a NULL output. case OP_And: - goto __58 // same as TK_AND, in1, in2, out3 + goto __59 // same as TK_AND, in1, in2, out3 case OP_Or: - goto __59 + goto __60 // Opcode: IsTrue P1 P2 P3 P4 * // Synopsis: r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4 @@ -62845,7 +63128,7 @@ __8: //
  • If P3==1 and P4==0 then r[P2] := r[P1] IS NOT FALSE // case OP_IsTrue: - goto __60 + goto __61 // Opcode: Not P1 P2 * * * // Synopsis: r[P2]= !r[P1] @@ -62854,7 +63137,7 @@ __8: // boolean complement in register P2. If the value in register P1 is // NULL, then a NULL is stored in P2. case OP_Not: - goto __61 + goto __62 // Opcode: BitNot P1 P2 * * * // Synopsis: r[P2]= ~r[P1] @@ -62863,7 +63146,7 @@ __8: // ones-complement of the P1 value into register P2. If P1 holds // a NULL then store a NULL in P2. case OP_BitNot: - goto __62 + goto __63 // Opcode: Once P1 P2 * * * // @@ -62882,7 +63165,7 @@ __8: // because the self-altering code trick does not work for recursive // triggers. case OP_Once: - goto __63 + goto __64 // Opcode: If P1 P2 P3 * * // @@ -62890,7 +63173,7 @@ __8: // is considered true if it is numeric and non-zero. If the value // in P1 is NULL then take the jump if and only if P3 is non-zero. case OP_If: - goto __64 + goto __65 // Opcode: IfNot P1 P2 P3 * * // @@ -62898,21 +63181,21 @@ __8: // is considered false if it has a numeric value of zero. If the value // in P1 is NULL then take the jump if and only if P3 is non-zero. case OP_IfNot: - goto __65 + goto __66 // Opcode: IsNull P1 P2 * * * // Synopsis: if r[P1]==NULL goto P2 // // Jump to P2 if the value in register P1 is NULL. case OP_IsNull: - goto __66 + goto __67 // Opcode: NotNull P1 P2 * * * // Synopsis: if r[P1]!=NULL goto P2 // // Jump to P2 if the value in register P1 is not NULL. case OP_NotNull: - goto __67 + goto __68 // Opcode: IfNullRow P1 P2 P3 * * // Synopsis: if P1.nullRow then r[P3]=NULL, goto P2 @@ -62922,7 +63205,7 @@ __8: // If P1 is not on a NULL row, then fall through without making any // changes. case OP_IfNullRow: - goto __68 + goto __69 // Opcode: Offset P1 P2 P3 * * // Synopsis: r[P3] = sqlite_offset(P1) @@ -62939,7 +63222,7 @@ __8: // This opcode is only available if SQLite is compiled with the // -DSQLITE_ENABLE_OFFSET_SQL_FUNC option. case OP_Offset: - goto __69 + goto __70 // Opcode: Column P1 P2 P3 P4 P5 // Synopsis: r[P3]=PX @@ -62961,7 +63244,7 @@ __8: // or typeof() function, respectively. The loading of large blobs can be // skipped for length() and all content loading can be skipped for typeof(). case OP_Column: - goto __70 + goto __71 // Opcode: Affinity P1 P2 * P4 * // Synopsis: affinity(r[P1@P2]) @@ -62972,7 +63255,7 @@ __8: // string indicates the column affinity that should be used for the N-th // memory cell in the range. case OP_Affinity: - goto __71 + goto __72 // Opcode: MakeRecord P1 P2 P3 P4 * // Synopsis: r[P3]=mkrec(r[P1@P2]) @@ -63001,7 +63284,7 @@ __8: // accept no-change records with serial_type 10. This value is // only used inside an assert() and does not affect the end result. case OP_MakeRecord: - goto __72 + goto __73 // Opcode: Count P1 P2 p3 * * // Synopsis: r[P2]=count() @@ -63013,7 +63296,7 @@ __8: // every btree page of the table. But if P3 is non-zero, an estimate // is returned based on the current cursor position. case OP_Count: - goto __73 + goto __74 // Opcode: Savepoint P1 * * P4 * // @@ -63022,7 +63305,7 @@ __8: // To release (commit) an existing savepoint set P1==1 (SAVEPOINT_RELEASE). // To rollback an existing savepoint set P1==2 (SAVEPOINT_ROLLBACK). case OP_Savepoint: - goto __74 + goto __75 // Opcode: AutoCommit P1 P2 * * * // @@ -63033,7 +63316,7 @@ __8: // // This instruction causes the VM to halt. case OP_AutoCommit: - goto __75 + goto __76 // Opcode: Transaction P1 P2 P3 P4 P5 // @@ -63041,7 +63324,8 @@ __8: // active. // If P2 is non-zero, then a write-transaction is started, or if a // read-transaction is already active, it is upgraded to a write-transaction. - // If P2 is zero, then a read-transaction is started. + // If P2 is zero, then a read-transaction is started. If P2 is 2 or more + // then an exclusive transaction is started. // // P1 is the index of the database file on which the transaction is // started. Index 0 is the main database file and index 1 is the @@ -63069,7 +63353,7 @@ __8: // halts. The sqlite3_step() wrapper function might then reprepare the // statement and rerun it from the beginning. case OP_Transaction: - goto __76 + goto __77 // Opcode: ReadCookie P1 P2 P3 * * // @@ -63083,7 +63367,7 @@ __8: // must be started or there must be an open cursor) before // executing this instruction. case OP_ReadCookie: - goto __77 + goto __78 // Opcode: SetCookie P1 P2 P3 * P5 // @@ -63100,7 +63384,7 @@ __8: // has P5 set to 1, so that the internal schema version will be different // from the database schema version, resulting in a schema reset. case OP_SetCookie: - goto __78 + goto __79 // Opcode: OpenRead P1 P2 P3 P4 P5 // Synopsis: root=P2 iDb=P3 @@ -63184,13 +63468,13 @@ __8: // // See also: OP_OpenRead, OP_ReopenIdx case OP_ReopenIdx: - goto __79 + goto __80 // If the cursor is not currently open or is open on a different // index, then fall through into OP_OpenRead to force a reopen case OP_OpenRead: - goto __80 - case OP_OpenWrite: goto __81 + case OP_OpenWrite: + goto __82 // Opcode: OpenDup P1 P2 * * * // @@ -63200,9 +63484,9 @@ __8: // // Duplicate ephemeral cursors are used for self-joins of materialized views. case OP_OpenDup: - goto __82 + goto __83 - // Opcode: OpenEphemeral P1 P2 * P4 P5 + // Opcode: OpenEphemeral P1 P2 P3 P4 P5 // Synopsis: nColumn=P2 // // Open a new cursor P1 to a transient table. @@ -63222,6 +63506,10 @@ __8: // in btree.h. These flags control aspects of the operation of // the btree. The BTREE_OMIT_JOURNAL and BTREE_SINGLE flags are // added automatically. + // + // If P3 is positive, then reg[P3] is modified slightly so that it + // can be used as zero-length data for OP_Insert. This is an optimization + // that avoids an extra OP_Blob opcode to initialize that register. // Opcode: OpenAutoindex P1 P2 * P4 * // Synopsis: nColumn=P2 // @@ -63230,9 +63518,9 @@ __8: // by this opcode will be used for automatically created transient // indices in joins. case OP_OpenAutoindex: - goto __83 - case OP_OpenEphemeral: goto __84 + case OP_OpenEphemeral: + goto __85 // Opcode: SorterOpen P1 P2 P3 P4 * // @@ -63244,7 +63532,7 @@ __8: // assume that a stable sort considering the first P3 fields of each // key is sufficient to produce the required results. case OP_SorterOpen: - goto __85 + goto __86 // Opcode: SequenceTest P1 P2 * * * // Synopsis: if( cursor[P1].ctr++ ) pc = P2 @@ -63253,7 +63541,7 @@ __8: // to P2. Regardless of whether or not the jump is taken, increment the // the sequence value. case OP_SequenceTest: - goto __86 + goto __87 // Opcode: OpenPseudo P1 P2 P3 * * // Synopsis: P3 columns in r[P2] @@ -63271,14 +63559,14 @@ __8: // P3 is the number of fields in the records that will be stored by // the pseudo-table. case OP_OpenPseudo: - goto __87 + goto __88 // Opcode: Close P1 * * * * // // Close a cursor previously opened as P1. If P1 is not // currently open, this instruction is a no-op. case OP_Close: - goto __88 + goto __89 // Opcode: SeekGE P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] @@ -63367,31 +63655,84 @@ __8: // // See also: Found, NotFound, SeekGt, SeekGe, SeekLt case OP_SeekLT: - goto __89 // jump, in3, group - case OP_SeekLE: goto __90 // jump, in3, group - case OP_SeekGE: + case OP_SeekLE: goto __91 // jump, in3, group + case OP_SeekGE: + goto __92 // jump, in3, group case OP_SeekGT: - goto __92 - - // Opcode: SeekHit P1 P2 * * * - // Synopsis: seekHit=P2 - // - // Set the seekHit flag on cursor P1 to the value in P2. - // The seekHit flag is used by the IfNoHope opcode. - // - // P1 must be a valid b-tree cursor. P2 must be a boolean value, - // either 0 or 1. - case OP_SeekHit: goto __93 + // Opcode: SeekScan P1 P2 * * * + // Synopsis: Scan-ahead up to P1 rows + // + // This opcode is a prefix opcode to OP_SeekGE. In other words, this + // opcode must be immediately followed by OP_SeekGE. This constraint is + // checked by assert() statements. + // + // This opcode uses the P1 through P4 operands of the subsequent + // OP_SeekGE. In the text that follows, the operands of the subsequent + // OP_SeekGE opcode are denoted as SeekOP.P1 through SeekOP.P4. Only + // the P1 and P2 operands of this opcode are also used, and are called + // This.P1 and This.P2. + // + // This opcode helps to optimize IN operators on a multi-column index + // where the IN operator is on the later terms of the index by avoiding + // unnecessary seeks on the btree, substituting steps to the next row + // of the b-tree instead. A correct answer is obtained if this opcode + // is omitted or is a no-op. + // + // The SeekGE.P3 and SeekGE.P4 operands identify an unpacked key which + // is the desired entry that we want the cursor SeekGE.P1 to be pointing + // to. Call this SeekGE.P4/P5 row the "target". + // + // If the SeekGE.P1 cursor is not currently pointing to a valid row, + // then this opcode is a no-op and control passes through into the OP_SeekGE. + // + // If the SeekGE.P1 cursor is pointing to a valid row, then that row + // might be the target row, or it might be near and slightly before the + // target row. This opcode attempts to position the cursor on the target + // row by, perhaps by invoking sqlite3BtreeStep() on the cursor + // between 0 and This.P1 times. + // + // There are three possible outcomes from this opcode:
      + // + //
    1. If after This.P1 steps, the cursor is still point to a place that + // is earlier in the btree than the target row, + // then fall through into the subsquence OP_SeekGE opcode. + // + //
    2. If the cursor is successfully moved to the target row by 0 or more + // sqlite3BtreeNext() calls, then jump to This.P2, which will land just + // past the OP_IdxGT opcode that follows the OP_SeekGE. + // + //
    3. If the cursor ends up past the target row (indicating the the target + // row does not exist in the btree) then jump to SeekOP.P2. + //
    + case OP_SeekScan: + goto __94 + + // Opcode: SeekHit P1 P2 P3 * * + // Synopsis: set P2<=seekHit<=P3 + // + // Increase or decrease the seekHit value for cursor P1, if necessary, + // so that it is no less than P2 and no greater than P3. + // + // The seekHit integer represents the maximum of terms in an index for which + // there is known to be at least one match. If the seekHit value is smaller + // than the total number of equality terms in an index lookup, then the + // OP_IfNoHope opcode might run to see if the IN loop can be abandoned + // early, thus saving work. This is part of the IN-early-out optimization. + // + // P1 must be a valid b-tree cursor. + case OP_SeekHit: + goto __95 + // Opcode: IfNotOpen P1 P2 * * * // Synopsis: if( !csr[P1] ) goto P2 // // If cursor P1 is not open, jump to instruction P2. Otherwise, fall through. case OP_IfNotOpen: - goto __94 + goto __96 // Opcode: Found P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] @@ -63431,16 +63772,20 @@ __8: // Synopsis: key=r[P3@P4] // // Register P3 is the first of P4 registers that form an unpacked - // record. + // record. Cursor P1 is an index btree. P2 is a jump destination. + // In other words, the operands to this opcode are the same as the + // operands to OP_NotFound and OP_IdxGT. // - // Cursor P1 is on an index btree. If the seekHit flag is set on P1, then - // this opcode is a no-op. But if the seekHit flag of P1 is clear, then - // check to see if there is any entry in P1 that matches the - // prefix identified by P3 and P4. If no entry matches the prefix, - // jump to P2. Otherwise fall through. + // This opcode is an optimization attempt only. If this opcode always + // falls through, the correct answer is still obtained, but extra works + // is performed. // - // This opcode behaves like OP_NotFound if the seekHit - // flag is clear and it behaves like OP_Noop if the seekHit flag is set. + // A value of N in the seekHit flag of cursor P1 means that there exists + // a key P3:N that will match some record in the index. We want to know + // if it is possible for a record P3:P4 to match some record in the + // index. If it is not possible, we can skips some work. So if seekHit + // is less than P4, attempt to find out if a match is possible by running + // OP_NotFound. // // This opcode is used in IN clause processing for a multi-column key. // If an IN clause is attached to an element of the key other than the @@ -63476,13 +63821,13 @@ __8: // // See also: NotFound, Found, NotExists case OP_IfNoHope: - goto __95 + goto __97 case OP_NoConflict: - goto __96 // jump, in3 + goto __98 // jump, in3 case OP_NotFound: - goto __97 // jump, in3 + goto __99 // jump, in3 case OP_Found: - goto __98 + goto __100 // Opcode: SeekRowid P1 P2 P3 * * // Synopsis: intkey=r[P3] @@ -63530,9 +63875,9 @@ __8: // // See also: Found, NotFound, NoConflict, SeekRowid case OP_SeekRowid: - goto __99 + goto __101 case OP_NotExists: - goto __100 + goto __102 // Opcode: Sequence P1 P2 * * * // Synopsis: r[P2]=cursor[P1].ctr++ @@ -63542,7 +63887,7 @@ __8: // The sequence number on the cursor is incremented after this // instruction. case OP_Sequence: - goto __101 + goto __103 // Opcode: NewRowid P1 P2 P3 * * // Synopsis: r[P2]=rowid @@ -63559,7 +63904,7 @@ __8: // generated record number. This P3 mechanism is used to help implement the // AUTOINCREMENT feature. case OP_NewRowid: - goto __102 + goto __104 // Opcode: Insert P1 P2 P3 P4 P5 // Synopsis: intkey=r[P3] data=r[P2] @@ -63598,7 +63943,20 @@ __8: // This instruction only works on tables. The equivalent instruction // for indices is OP_IdxInsert. case OP_Insert: - goto __103 + goto __105 + + // Opcode: RowCell P1 P2 P3 * * + // + // P1 and P2 are both open cursors. Both must be opened on the same type + // of table - intkey or index. This opcode is used as part of copying + // the current row from P2 into P1. If the cursors are opened on intkey + // tables, register P3 contains the rowid to use with the new record in + // P1. If they are opened on index tables, P3 is not used. + // + // This opcode must be followed by either an Insert or InsertIdx opcode + // with the OPFLAG_PREFORMAT flag set to complete the insert operation. + case OP_RowCell: + goto __106 // Opcode: Delete P1 P2 P3 P4 P5 // @@ -63635,7 +63993,7 @@ __8: // of the memory cell that contains the value that the rowid of the row will // be set to by the update. case OP_Delete: - goto __104 + goto __107 // Opcode: ResetCount * * * * * // // The value of the change counter is copied to the database handle @@ -63643,7 +64001,7 @@ __8: // Then the VMs internal change counter resets to 0. // This is used by trigger programs. case OP_ResetCount: - goto __105 + goto __108 // Opcode: SorterCompare P1 P2 P3 P4 // Synopsis: if key(P1)!=trim(r[P3],P4) goto P2 @@ -63660,7 +64018,7 @@ __8: // Fall through to next instruction if the two records compare equal to // each other. Jump to P2 if they are different. case OP_SorterCompare: - goto __106 + goto __109 // Opcode: SorterData P1 P2 P3 * * // Synopsis: r[P2]=data @@ -63674,7 +64032,7 @@ __8: // parameter P3. Clearing the P3 column cache as part of this opcode saves // us from having to issue a separate NullRow instruction to clear that cache. case OP_SorterData: - goto __107 + goto __110 // Opcode: RowData P1 P2 P3 * * // Synopsis: r[P2]=data @@ -63704,7 +64062,7 @@ __8: // The P2 register content is invalidated by opcodes like OP_Function or // by any use of another cursor pointing to the same table. case OP_RowData: - goto __108 + goto __111 // Opcode: Rowid P1 P2 * * * // Synopsis: r[P2]=rowid @@ -63716,7 +64074,7 @@ __8: // be a separate OP_VRowid opcode for use with virtual tables, but this // one opcode now works for both table types. case OP_Rowid: - goto __109 + goto __112 // Opcode: NullRow P1 * * * * // @@ -63724,7 +64082,7 @@ __8: // that occur while the cursor is on the null row will always // write a NULL. case OP_NullRow: - goto __110 + goto __113 // Opcode: SeekEnd P1 * * * * // @@ -63747,16 +64105,16 @@ __8: // from the end toward the beginning. In other words, the cursor is // configured to use Prev, not Next. case OP_SeekEnd: - goto __111 + goto __114 case OP_Last: - goto __112 + goto __115 // Opcode: IfSmaller P1 P2 P3 * * // // Estimate the number of rows in the table P1. Jump to P2 if that // estimate is less than approximately 2**(0.1*P3). case OP_IfSmaller: - goto __113 + goto __116 // Opcode: SorterSort P1 P2 * * * // @@ -63778,9 +64136,9 @@ __8: // regression tests can determine whether or not the optimizer is // correctly optimizing out sorts. case OP_SorterSort: - goto __114 // jump + goto __117 // jump case OP_Sort: - goto __115 + goto __118 // Opcode: Rewind P1 P2 * * * // // The next use of the Rowid or Column or Next instruction for P1 @@ -63793,7 +64151,7 @@ __8: // from the beginning toward the end. In other words, the cursor is // configured to use Next, not Prev. case OP_Rewind: - goto __116 + goto __119 // Opcode: Next P1 P2 P3 P4 P5 // @@ -63853,11 +64211,11 @@ __8: // invoked. This opcode advances the cursor to the next sorted // record, or jumps to P2 if there are no more sorted records. case OP_SorterNext: - goto __117 + goto __120 case OP_Prev: - goto __118 // jump + goto __121 // jump case OP_Next: - goto __119 + goto __122 // Opcode: IdxInsert P1 P2 P3 P4 P5 // Synopsis: key=r[P2] @@ -63887,7 +64245,7 @@ __8: // This instruction only works for indices. The equivalent instruction // for tables is OP_Insert. case OP_IdxInsert: - goto __120 + goto __123 // Opcode: SorterInsert P1 P2 * * * // Synopsis: key=r[P2] @@ -63896,7 +64254,7 @@ __8: // MakeRecord instructions. This opcode writes that key // into the sorter P1. Data for the entry is nil. case OP_SorterInsert: - goto __121 + goto __124 // Opcode: IdxDelete P1 P2 P3 * P5 // Synopsis: key=r[P2@P3] @@ -63912,7 +64270,7 @@ __8: // (example: the EXCEPT operator) it does not matter that no matching // entry is found. For those cases, P5 is zero. case OP_IdxDelete: - goto __122 + goto __125 // Opcode: DeferredSeek P1 * P3 P4 * // Synopsis: Move P3 to P1.rowid if needed @@ -63941,9 +64299,9 @@ __8: // // See also: Rowid, MakeRecord. case OP_DeferredSeek: - goto __123 + goto __126 case OP_IdxRowid: - goto __124 + goto __127 // Opcode: FinishSeek P1 * * * * // @@ -63951,9 +64309,9 @@ __8: // seek operation now, without further delay. If the cursor seek has // already occurred, this instruction is a no-op. case OP_FinishSeek: - goto __125 + goto __128 - // Opcode: IdxGE P1 P2 P3 P4 P5 + // Opcode: IdxGE P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -63963,7 +64321,7 @@ __8: // // If the P1 index entry is greater than or equal to the key value // then jump to P2. Otherwise fall through to the next instruction. - // Opcode: IdxGT P1 P2 P3 P4 P5 + // Opcode: IdxGT P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -63973,7 +64331,7 @@ __8: // // If the P1 index entry is greater than the key value // then jump to P2. Otherwise fall through to the next instruction. - // Opcode: IdxLT P1 P2 P3 P4 P5 + // Opcode: IdxLT P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -63983,7 +64341,7 @@ __8: // // If the P1 index entry is less than the key value then jump to P2. // Otherwise fall through to the next instruction. - // Opcode: IdxLE P1 P2 P3 P4 P5 + // Opcode: IdxLE P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -63994,13 +64352,13 @@ __8: // If the P1 index entry is less than or equal to the key value then jump // to P2. Otherwise fall through to the next instruction. case OP_IdxLE: - goto __126 // jump + goto __129 // jump case OP_IdxGT: - goto __127 // jump + goto __130 // jump case OP_IdxLT: - goto __128 // jump + goto __131 // jump case OP_IdxGE: - goto __129 + goto __132 // Opcode: Destroy P1 P2 P3 * * // @@ -64029,7 +64387,7 @@ __8: // // See also: Clear case OP_Destroy: - goto __130 + goto __133 // Opcode: Clear P1 P2 P3 // @@ -64049,7 +64407,7 @@ __8: // // See also: Destroy case OP_Clear: - goto __131 + goto __134 // Opcode: ResetSorter P1 * * * * // @@ -64059,7 +64417,7 @@ __8: // This opcode only works for cursors used for sorting and // opened with OP_OpenEphemeral or OP_SorterOpen. case OP_ResetSorter: - goto __132 + goto __135 // Opcode: CreateBtree P1 P2 P3 * * // Synopsis: r[P2]=root iDb=P1 flags=P3 @@ -64070,13 +64428,13 @@ __8: // it must be 2 (BTREE_BLOBKEY) for an index or WITHOUT ROWID table. // The root page number of the new b-tree is stored in register P2. case OP_CreateBtree: - goto __133 + goto __136 // Opcode: SqlExec * * * P4 * // // Run the SQL statement or statements specified in the P4 string. case OP_SqlExec: - goto __134 + goto __137 // Opcode: ParseSchema P1 * * P4 * // @@ -64087,7 +64445,7 @@ __8: // This opcode invokes the parser to create a new virtual machine, // then runs the new virtual machine. It is thus a re-entrant opcode. case OP_ParseSchema: - goto __135 + goto __138 // Opcode: LoadAnalysis P1 * * * * // @@ -64095,7 +64453,7 @@ __8: // of that table into the internal index hash table. This will cause // the analysis to be used when preparing all subsequent queries. case OP_LoadAnalysis: - goto __136 + goto __139 // Opcode: DropTable P1 * * P4 * // @@ -64105,7 +64463,7 @@ __8: // the internal representation of the // schema consistent with what is on disk. case OP_DropTable: - goto __137 + goto __140 // Opcode: DropIndex P1 * * P4 * // @@ -64115,7 +64473,7 @@ __8: // in order to keep the internal representation of the // schema consistent with what is on disk. case OP_DropIndex: - goto __138 + goto __141 // Opcode: DropTrigger P1 * * P4 * // @@ -64125,7 +64483,7 @@ __8: // the internal representation of the // schema consistent with what is on disk. case OP_DropTrigger: - goto __139 + goto __142 // Opcode: IntegrityCk P1 P2 P3 P4 P5 // @@ -64146,7 +64504,7 @@ __8: // // This opcode is used to implement the integrity_check pragma. case OP_IntegrityCk: - goto __140 + goto __143 // Opcode: RowSetAdd P1 P2 * * * // Synopsis: rowset(P1)=r[P2] @@ -64156,7 +64514,7 @@ __8: // // An assertion fails if P2 is not an integer. case OP_RowSetAdd: - goto __141 + goto __144 // Opcode: RowSetRead P1 P2 P3 * * // Synopsis: r[P3]=rowset(P1) @@ -64166,7 +64524,7 @@ __8: // Or, if RowSet object P1 is initially empty, leave P3 // unchanged and jump to instruction P2. case OP_RowSetRead: - goto __142 + goto __145 // Opcode: RowSetTest P1 P2 P3 P4 // Synopsis: if r[P3] in rowset(P1) goto P2 @@ -64191,7 +64549,7 @@ __8: // previously inserted as part of set X (only if it was previously // inserted as part of some other set). case OP_RowSetTest: - goto __143 + goto __146 // Opcode: Program P1 P2 P3 P4 P5 // @@ -64208,7 +64566,7 @@ __8: // // If P5 is non-zero, then recursive program invocation is enabled. case OP_Program: - goto __144 + goto __147 // Opcode: Param P1 P2 * * * // @@ -64222,7 +64580,7 @@ __8: // the value of the P1 argument to the value of the P1 argument to the // calling OP_Program instruction. case OP_Param: - goto __145 + goto __148 // Opcode: FkCounter P1 P2 * * * // Synopsis: fkctr[P1]+=P2 @@ -64232,7 +64590,7 @@ __8: // (deferred foreign key constraints). Otherwise, if P1 is zero, the // statement counter is incremented (immediate foreign key constraints). case OP_FkCounter: - goto __146 + goto __149 // Opcode: FkIfZero P1 P2 * * * // Synopsis: if fkctr[P1]==0 goto P2 @@ -64246,7 +64604,7 @@ __8: // zero, the jump is taken if the statement constraint-counter is zero // (immediate foreign key constraint violations). case OP_FkIfZero: - goto __147 + goto __150 // Opcode: MemMax P1 P2 * * * // Synopsis: r[P1]=max(r[P1],r[P2]) @@ -64259,7 +64617,7 @@ __8: // This instruction throws an error if the memory cell is not initially // an integer. case OP_MemMax: - goto __148 + goto __151 // Opcode: IfPos P1 P2 P3 * * // Synopsis: if r[P1]>0 then r[P1]-=P3, goto P2 @@ -64271,7 +64629,7 @@ __8: // If the initial value of register P1 is less than 1, then the // value is unchanged and control passes through to the next instruction. case OP_IfPos: - goto __149 + goto __152 // Opcode: OffsetLimit P1 P2 P3 * * // Synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) @@ -64291,7 +64649,7 @@ __8: // // Otherwise, r[P2] is set to the sum of r[P1] and r[P3]. case OP_OffsetLimit: - goto __150 + goto __153 // Opcode: IfNotZero P1 P2 * * * // Synopsis: if r[P1]!=0 then r[P1]--, goto P2 @@ -64301,7 +64659,7 @@ __8: // If it is non-zero (negative or positive) and then also jump to P2. // If register P1 is initially zero, leave it unchanged and fall through. case OP_IfNotZero: - goto __151 + goto __154 // Opcode: DecrJumpZero P1 P2 * * * // Synopsis: if (--r[P1])==0 goto P2 @@ -64309,7 +64667,7 @@ __8: // Register P1 must hold an integer. Decrement the value in P1 // and jump to P2 if the new value is exactly zero. case OP_DecrJumpZero: - goto __152 + goto __155 // Opcode: AggStep * P2 P3 P4 P5 // Synopsis: accum=r[P3] step(r[P2@P5]) @@ -64348,11 +64706,11 @@ __8: // sqlite3_context only happens once, instead of on each call to the // step function. case OP_AggInverse: - goto __153 + goto __156 case OP_AggStep: - goto __154 + goto __157 case OP_AggStep1: - goto __155 + goto __158 // Opcode: AggFinal P1 P2 * P4 * // Synopsis: accum=r[P1] N=P2 @@ -64379,9 +64737,9 @@ __8: // P4 argument is only needed for the case where // the step function was not previously called. case OP_AggValue: - goto __156 + goto __159 case OP_AggFinal: - goto __157 + goto __160 // Opcode: Checkpoint P1 P2 P3 * * // @@ -64394,7 +64752,7 @@ __8: // completes into mem[P3+2]. However on an error, mem[P3+1] and // mem[P3+2] are initialized to -1. case OP_Checkpoint: - goto __158 + goto __161 // Opcode: JournalMode P1 P2 P3 * * // @@ -64407,7 +64765,7 @@ __8: // // Write a string containing the final journal-mode to register P2. case OP_JournalMode: - goto __159 + goto __162 // Opcode: Vacuum P1 P2 * * * // @@ -64418,7 +64776,7 @@ __8: // the file into which the result of vacuum should be written. When // P2 is zero, the vacuum overwrites the original database. case OP_Vacuum: - goto __160 + goto __163 // Opcode: IncrVacuum P1 P2 * * * // @@ -64426,7 +64784,7 @@ __8: // the P1 database. If the vacuum has finished, jump to instruction // P2. Otherwise, fall through to the next instruction. case OP_IncrVacuum: - goto __161 + goto __164 // Opcode: Expire P1 P2 * * * // @@ -64444,21 +64802,21 @@ __8: // that might help the statement run faster but which does not affect the // correctness of operation. case OP_Expire: - goto __162 + goto __165 // Opcode: CursorLock P1 * * * * // // Lock the btree to which cursor P1 is pointing so that the btree cannot be // written by an other cursor. case OP_CursorLock: - goto __163 + goto __166 // Opcode: CursorUnlock P1 * * * * // // Unlock the btree to which cursor P1 is pointing so that it can be // written by other cursors. case OP_CursorUnlock: - goto __164 + goto __167 // Opcode: TableLock P1 P2 P3 P4 * // Synopsis: iDb=P1 root=P2 write=P3 @@ -64475,7 +64833,7 @@ __8: // P4 contains a pointer to the name of the table being locked. This is only // used to generate an error message if the lock cannot be obtained. case OP_TableLock: - goto __165 + goto __168 // Opcode: VBegin * * * P4 * // @@ -64486,21 +64844,21 @@ __8: // within a callback to a virtual table xSync() method. If it is, the error // code will be set to SQLITE_LOCKED. case OP_VBegin: - goto __166 + goto __169 // Opcode: VCreate P1 P2 * * * // // P2 is a register that holds the name of a virtual table in database // P1. Call the xCreate method for that table. case OP_VCreate: - goto __167 + goto __170 // Opcode: VDestroy P1 * * P4 * // // P4 is the name of a virtual table in database P1. Call the xDestroy method // of that table. case OP_VDestroy: - goto __168 + goto __171 // Opcode: VOpen P1 * * P4 * // @@ -64508,7 +64866,7 @@ __8: // P1 is a cursor number. This opcode opens a cursor to the virtual // table and stores that cursor in P1. case OP_VOpen: - goto __169 + goto __172 // Opcode: VFilter P1 P2 P3 P4 * // Synopsis: iplan=r[P3] zplan='P4' @@ -64529,7 +64887,7 @@ __8: // // A jump is made to P2 if the result set after filtering would be empty. case OP_VFilter: - goto __170 + goto __173 // Opcode: VColumn P1 P2 P3 * P5 // Synopsis: r[P3]=vcolumn(P2) @@ -64545,7 +64903,7 @@ __8: // bits (OPFLAG_LENGTHARG or OPFLAG_TYPEOFARG) but those bits are // unused by OP_VColumn. case OP_VColumn: - goto __171 + goto __174 // Opcode: VNext P1 P2 * * * // @@ -64553,7 +64911,7 @@ __8: // jump to instruction P2. Or, if the virtual table has reached // the end of its result set, then fall through to the next instruction. case OP_VNext: - goto __172 + goto __175 // Opcode: VRename P1 * * P4 * // @@ -64561,7 +64919,7 @@ __8: // This opcode invokes the corresponding xRename method. The value // in register P1 is passed as the zName argument to the xRename method. case OP_VRename: - goto __173 + goto __176 // Opcode: VUpdate P1 P2 P3 P4 P5 // Synopsis: data=r[P3@P2] @@ -64590,13 +64948,13 @@ __8: // P5 is the error actions (OE_Replace, OE_Fail, OE_Ignore, etc) to // apply in the case of a constraint failure on an insert or update. case OP_VUpdate: - goto __174 + goto __177 // Opcode: Pagecount P1 P2 * * * // // Write the current number of pages in database P1 to memory cell P2. case OP_Pagecount: - goto __175 + goto __178 // Opcode: MaxPgcnt P1 P2 P3 * * // @@ -64606,7 +64964,7 @@ __8: // // Store the maximum page count after the change in register P2. case OP_MaxPgcnt: - goto __176 + goto __179 // Opcode: Function P1 P2 P3 P4 * // Synopsis: r[P3]=func(r[P2@NP]) @@ -64653,9 +65011,9 @@ __8: // // See also: AggStep, AggFinal, Function case OP_PureFunc: - goto __177 // group + goto __180 // group case OP_Function: - goto __178 + goto __181 // Opcode: Trace P1 P2 * P4 * // @@ -64681,9 +65039,9 @@ __8: // If P3 is not zero, then it is an address to jump to if an SQLITE_CORRUPT // error is encountered. case OP_Trace: - goto __179 + goto __182 case OP_Init: - goto __180 + goto __183 // Opcode: Noop * * * * * // @@ -64694,7 +65052,7 @@ __8: // This opcode records information from the optimizer. It is the // the same as a no-op. This opcodesnever appears in a real VM program. default: - goto __181 + goto __184 } goto __10 @@ -64761,33 +65119,33 @@ jump_to_p2_and_check_for_interrupt: // checks on every opcode. This helps sqlite3_step() to run about 1.5% // faster according to "valgrind --tool=cachegrind" check_for_interrupt: - if !(libc.AtomicLoadNInt32((db+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { - goto __182 + if !(libc.AtomicLoadNInt32((db+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0) { + goto __185 } goto abort_due_to_interrupt -__182: +__185: ; // Call the progress callback if it is configured and the required number // of VDBE ops have been executed (either since this invocation of // sqlite3VdbeExec() or since last time the progress callback was called). // If the progress callback returns non-zero, exit the virtual machine with // a return code SQLITE_ABORT. -__183: +__186: if !((nVmStep >= nProgressLimit) && ((*Sqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0))) { - goto __184 + goto __187 } nProgressLimit = nProgressLimit + (U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)) - if !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 504 /* &.xProgress */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) { - goto __185 + if !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 512 /* &.xProgress */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) { + goto __188 } nProgressLimit = (uint64(0xffffffff) | (U64((uint64(0xffffffff))) << 32)) rc = SQLITE_INTERRUPT goto abort_due_to_error -__185: +__188: ; - goto __183 -__184: + goto __186 +__187: ; goto __10 @@ -64800,7 +65158,7 @@ __12: // jump ; pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64((int32((int64(pOp) - int64(aOp)) / 32))) // Most jump operations do a goto to this spot in order to update @@ -64817,7 +65175,7 @@ __13: // in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pOp = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*32) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Undefined) goto __10 // Opcode: InitCoroutine P1 P2 P3 * * @@ -64836,12 +65194,12 @@ __14: // jump pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = (I64((*Op)(unsafe.Pointer(pOp)).Fp3 - 1)) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) if !((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) { - goto __186 + goto __189 } goto jump_to_p2 -__186: +__189: ; goto __10 @@ -64858,7 +65216,7 @@ __15: pCaller = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*32) pOp = (aOp + uintptr(((*VdbeOp)(unsafe.Pointer(pCaller)).Fp2-1))*32) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Undefined) goto __10 // Opcode: Yield P1 P2 * * * @@ -64876,7 +65234,7 @@ __15: __16: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) - (*Mem)(unsafe.Pointer(pIn1)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(MEM_Int) pcDest = int32(*(*I64)(unsafe.Pointer(pIn1 /* &.u */))) *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64((int32((int64(pOp) - int64(aOp)) / 32))) @@ -64893,10 +65251,10 @@ __16: __17: // in3 pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !((int32((*Mem)(unsafe.Pointer(pIn3)).Fflags) & MEM_Null) == 0) { - goto __187 + goto __190 } goto __10 -__187: +__190: ; // Opcode: Halt P1 P2 * P4 P5 @@ -64932,7 +65290,7 @@ __18: pcx = (int32((int64(pOp) - int64(aOp)) / 32)) if !(((*Op)(unsafe.Pointer(pOp)).Fp1 == SQLITE_OK) && ((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0)) { - goto __188 + goto __191 } // Halt the sub-program. Return control to the parent frame. pFrame = (*Vdbe)(unsafe.Pointer(p)).FpFrame @@ -64941,7 +65299,7 @@ __18: Xsqlite3VdbeSetChanges(tls, db, (*Vdbe)(unsafe.Pointer(p)).FnChange) pcx = Xsqlite3VdbeFrameRestore(tls, pFrame) if !((*Op)(unsafe.Pointer(pOp)).Fp2 == OE_Ignore) { - goto __189 + goto __192 } // Instruction pcx is the OP_Program that invoked the sub-program // currently being halted. If the p2 instruction of this OP_Halt @@ -64949,48 +65307,48 @@ __18: // an IGNORE exception. In this case jump to the address specified // as the p2 of the calling OP_Program. pcx = ((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(pcx)*32)).Fp2 - 1) -__189: +__192: ; aOp = (*Vdbe)(unsafe.Pointer(p)).FaOp aMem = (*Vdbe)(unsafe.Pointer(p)).FaMem pOp = (aOp + uintptr(pcx)*32) goto __10 -__188: +__191: ; (*Vdbe)(unsafe.Pointer(p)).Frc = (*Op)(unsafe.Pointer(pOp)).Fp1 (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8((*Op)(unsafe.Pointer(pOp)).Fp2) (*Vdbe)(unsafe.Pointer(p)).Fpc = pcx if !((*Vdbe)(unsafe.Pointer(p)).Frc != 0) { - goto __190 - } - if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) { - goto __191 - } - - Xsqlite3VdbeError(tls, p, ts+7147 /* "%s constraint fa..." */, libc.VaList(bp, azType[(int32((*Op)(unsafe.Pointer(pOp)).Fp5)-1)])) - if !(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) != 0) { goto __193 } - (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+7168 /* "%z: %s" */, libc.VaList(bp+8, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) -__193: + if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) { + goto __194 + } + + Xsqlite3VdbeError(tls, p, ts+7223 /* "%s constraint fa..." */, libc.VaList(bp, azType[(int32((*Op)(unsafe.Pointer(pOp)).Fp5)-1)])) + if !(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) != 0) { + goto __196 + } + (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+7244 /* "%z: %s" */, libc.VaList(bp+8, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) +__196: ; - goto __192 -__191: + goto __195 +__194: Xsqlite3VdbeError(tls, p, ts+824 /* "%s" */, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) -__192: +__195: ; - Xsqlite3_log(tls, (*Op)(unsafe.Pointer(pOp)).Fp1, ts+7175 /* "abort at %d in [..." */, libc.VaList(bp+32, pcx, (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)) -__190: + Xsqlite3_log(tls, (*Op)(unsafe.Pointer(pOp)).Fp1, ts+7251 /* "abort at %d in [..." */, libc.VaList(bp+32, pcx, (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)) +__193: ; rc = Xsqlite3VdbeHalt(tls, p) if !(rc == SQLITE_BUSY) { - goto __194 + goto __197 } (*Vdbe)(unsafe.Pointer(p)).Frc = SQLITE_BUSY - goto __195 -__194: + goto __198 +__197: ; if (*Vdbe)(unsafe.Pointer(p)).Frc != 0 { @@ -64998,7 +65356,7 @@ __194: } else { rc = SQLITE_DONE } -__195: +__198: ; goto vdbe_return @@ -65029,7 +65387,7 @@ __20: // out2 // Write that value into register P2. __21: // same as TK_FLOAT, out2 pOut = out2Prerelease(tls, p, pOp) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Real + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Real) *(*float64)(unsafe.Pointer(pOut /* &.u */)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) goto __10 @@ -65047,43 +65405,43 @@ __22: // same as TK_STRING, out2 (*Op)(unsafe.Pointer(pOp)).Fp1 = Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) if !(int32(encoding) != SQLITE_UTF8) { - goto __196 - } - rc = Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), -1, SQLITE_UTF8, uintptr(0)) - - if !(rc != 0) { - goto __197 - } - goto too_big -__197: - ; - if !(SQLITE_OK != Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding))) { - goto __198 - } - goto no_mem -__198: - ; - - (*Mem)(unsafe.Pointer(pOut)).FszMalloc = 0 - *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Static)) - if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-7)) { goto __199 } - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) -__199: - ; - (*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-7) - *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = (*Mem)(unsafe.Pointer(pOut)).Fz - (*Op)(unsafe.Pointer(pOp)).Fp1 = (*Mem)(unsafe.Pointer(pOut)).Fn -__196: - ; - if !((*Op)(unsafe.Pointer(pOp)).Fp1 > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) { + rc = Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), -1, uint8(SQLITE_UTF8), uintptr(0)) + + if !(rc != 0) { goto __200 } goto too_big __200: ; - (*Op)(unsafe.Pointer(pOp)).Fopcode = OP_String + if !(SQLITE_OK != Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding))) { + goto __201 + } + goto no_mem +__201: + ; + + (*Mem)(unsafe.Pointer(pOut)).FszMalloc = 0 + *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Static)) + if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-7)) { + goto __202 + } + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) +__202: + ; + (*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-7) + *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = (*Mem)(unsafe.Pointer(pOut)).Fz + (*Op)(unsafe.Pointer(pOp)).Fp1 = (*Mem)(unsafe.Pointer(pOut)).Fn +__199: + ; + if !((*Op)(unsafe.Pointer(pOp)).Fp1 > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) { + goto __203 + } + goto too_big +__203: + ; + (*Op)(unsafe.Pointer(pOp)).Fopcode = U8(OP_String) // Opcode: String P1 P2 P3 P4 P5 // Synopsis: r[P2]='P4' (len=P1) @@ -65125,12 +65483,12 @@ __24: if (*Op)(unsafe.Pointer(pOp)).Fp1 != 0 { return (uint16(MEM_Null | MEM_Cleared)) } - return MEM_Null + return uint16(MEM_Null) }()) (*Mem)(unsafe.Pointer(pOut)).Fn = 0 -__201: +__204: if !(cnt > 0) { - goto __202 + goto __205 } pOut += 56 @@ -65138,8 +65496,8 @@ __201: (*Mem)(unsafe.Pointer(pOut)).Fflags = nullFlag (*Mem)(unsafe.Pointer(pOut)).Fn = 0 cnt-- - goto __201 -__202: + goto __204 +__205: ; goto __10 @@ -65182,17 +65540,17 @@ __27: // Value being transferred pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1-1))*56) if !(Xsqlite3VdbeMemTooBig(tls, pVar) != 0) { - goto __203 + goto __206 } goto too_big -__203: +__206: ; pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) if !((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0) { - goto __204 + goto __207 } Xsqlite3VdbeMemSetNull(tls, pOut) -__204: +__207: ; libc.Xmemcpy(tls, pOut, pVar, uint64((uintptr(0) + 24 /* &.zMalloc */))) *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32((MEM_Dyn | MEM_Ephem)))) @@ -65216,26 +65574,26 @@ __28: // Register to copy to pIn1 = (aMem + uintptr(p1)*56) pOut = (aMem + uintptr(p2)*56) -__205: +__208: ; Xsqlite3VdbeMemMove(tls, pOut, pIn1) if !(((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & MEM_Ephem) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0)) { - goto __208 + goto __211 } goto no_mem -__208: +__211: ; pIn1 += 56 pOut += 56 - goto __206 -__206: + goto __209 +__209: if libc.PreDecInt32(&n, 1) != 0 { - goto __205 + goto __208 } - goto __207 -__207: + goto __210 +__210: ; goto __10 @@ -65252,29 +65610,29 @@ __29: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) -__209: +__212: if !(1 != 0) { - goto __210 + goto __213 } Xsqlite3VdbeMemShallowCopy(tls, pOut, pIn1, MEM_Ephem) if !(((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & MEM_Ephem) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0)) { - goto __211 + goto __214 } goto no_mem -__211: +__214: ; if !((libc.PostDecInt32(&n1, 1)) == 0) { - goto __212 + goto __215 } - goto __210 -__212: + goto __213 +__215: ; pOut += 56 pIn1 += 56 - goto __209 -__210: + goto __212 +__213: ; goto __10 @@ -65311,6 +65669,25 @@ __31: // out2 Xsqlite3VdbeMemSetInt64(tls, pOut, *(*I64)(unsafe.Pointer(pIn1 /* &.u */))) goto __10 + // Opcode: ChngCntRow P1 P2 * * * + // Synopsis: output=r[P1] + // + // Output value in register P1 as the chance count for a DML statement, + // due to the "PRAGMA count_changes=ON" setting. Or, if there was a + // foreign key error in the statement, trigger the error now. + // + // This opcode is a variant of OP_ResultRow that checks the foreign key + // immediate constraint count and throws an error if the count is + // non-zero. The P2 opcode must be 1. +__32: + ; + if !((libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 0))) != SQLITE_OK) { + goto __216 + } + goto abort_due_to_error +__216: + ; + // Opcode: ResultRow P1 P2 * * * // Synopsis: output=r[P1@P2] // @@ -65319,37 +65696,9 @@ __31: // out2 // with an SQLITE_ROW return code and it sets up the sqlite3_stmt // structure to provide access to the r(P1)..r(P1+P2-1) values as // the result row. -__32: +__33: ; - // If this statement has violated immediate foreign key constraints, do - // not return the number of rows modified. And do not RELEASE the statement - // transaction. It needs to be rolled back. - if !(SQLITE_OK != (libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 0)))) { - goto __213 - } - - goto abort_due_to_error -__213: - ; - - // If the SQLITE_CountRows flag is set in sqlite3.flags mask, then - // DML statements invoke this opcode to return the number of rows - // modified to the user. This is the only way that a VM that - // opens a statement transaction may invoke this opcode. - // - // In case this is such a statement, close any statement transaction - // opened by this VM before returning control to the user. This is to - // ensure that statement-transactions are always nested, not overlapping. - // If the open statement-transaction is not closed here, then the user - // may step another VM that opens its own statement transaction. This - // may lead to overlapping statement transactions. - // - // The statement transaction is never a top-level transaction. Hence - // the RELEASE call below can never fail. - - rc = Xsqlite3VdbeCloseStatement(tls, p, SAVEPOINT_RELEASE) - // Invalidate all ephemeral cursor row caches (*Vdbe)(unsafe.Pointer(p)).FcacheCtr = (((*Vdbe)(unsafe.Pointer(p)).FcacheCtr + U32(2)) | U32(1)) @@ -65358,39 +65707,39 @@ __213: // a side effect. pMem = libc.AssignPtrUintptr(p+160 /* &.pResultSet */, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)) i = 0 -__214: +__217: if !(i < (*Op)(unsafe.Pointer(pOp)).Fp2) { - goto __216 + goto __219 } if !(((int32((*Mem)(unsafe.Pointer((pMem + uintptr(i)*56))).Fflags) & MEM_Ephem) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, (pMem+uintptr(i)*56)) != 0)) { - goto __217 + goto __220 } goto no_mem -__217: +__220: ; Xsqlite3VdbeMemNulTerminate(tls, (pMem + uintptr(i)*56)) - goto __215 -__215: + goto __218 +__218: i++ - goto __214 - goto __216 -__216: + goto __217 + goto __219 +__219: ; if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - goto __218 + goto __221 } goto no_mem -__218: +__221: ; if !((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_ROW) != 0) { - goto __219 + goto __222 } - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_ROW, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0)) -__219: + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 240 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_ROW), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0)) +__222: ; // Return SQLITE_ROW @@ -65410,7 +65759,7 @@ __219: // It is illegal for P1 and P3 to be the same register. Sometimes, // if P3 is the same register as P2, the implementation is able // to avoid a memcpy(). -__33: // Initial flags for P2 +__34: // Initial flags for P2 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) @@ -65419,86 +65768,86 @@ __33: // Initial flags for P2 flags1 = (*Mem)(unsafe.Pointer(pIn1)).Fflags if !(((int32(flags1) | int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)) & MEM_Null) != 0) { - goto __220 + goto __223 } Xsqlite3VdbeMemSetNull(tls, pOut) goto __10 -__220: - ; - if !((int32(flags1) & (MEM_Str | MEM_Blob)) == 0) { - goto __221 - } - if !(Xsqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(0)) != 0) { - goto __223 - } - goto no_mem __223: ; - flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str))) - goto __222 -__221: - if !((int32(flags1) & MEM_Zero) != 0) { + if !((int32(flags1) & (MEM_Str | MEM_Blob)) == 0) { goto __224 } - if !(Xsqlite3VdbeMemExpandBlob(tls, pIn1) != 0) { - goto __225 - } - goto no_mem -__225: - ; - flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str))) -__224: - ; -__222: - ; - flags2 = (*Mem)(unsafe.Pointer(pIn2)).Fflags - if !((int32(flags2) & (MEM_Str | MEM_Blob)) == 0) { + if !(Xsqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(0)) != 0) { goto __226 } - if !(Xsqlite3VdbeMemStringify(tls, pIn2, encoding, uint8(0)) != 0) { + goto no_mem +__226: + ; + flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str))) + goto __225 +__224: + if !((int32(flags1) & MEM_Zero) != 0) { + goto __227 + } + if !(Xsqlite3VdbeMemExpandBlob(tls, pIn1) != 0) { goto __228 } goto no_mem __228: ; - flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str))) - goto __227 -__226: - if !((int32(flags2) & MEM_Zero) != 0) { - goto __229 - } - if !(Xsqlite3VdbeMemExpandBlob(tls, pIn2) != 0) { - goto __230 - } - goto no_mem -__230: - ; - flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str))) -__229: - ; + flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_Str))) __227: ; - nByte = (I64((*Mem)(unsafe.Pointer(pIn1)).Fn + (*Mem)(unsafe.Pointer(pIn2)).Fn)) - if !(nByte > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */))))) { +__225: + ; + flags2 = (*Mem)(unsafe.Pointer(pIn2)).Fflags + if !((int32(flags2) & (MEM_Str | MEM_Blob)) == 0) { + goto __229 + } + if !(Xsqlite3VdbeMemStringify(tls, pIn2, encoding, uint8(0)) != 0) { goto __231 } - goto too_big + goto no_mem __231: ; - if !(Xsqlite3VdbeMemGrow(tls, pOut, (int32(nByte)+3), (libc.Bool32(pOut == pIn2))) != 0) { + flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str))) + goto __230 +__229: + if !((int32(flags2) & MEM_Zero) != 0) { goto __232 } + if !(Xsqlite3VdbeMemExpandBlob(tls, pIn2) != 0) { + goto __233 + } goto no_mem +__233: + ; + flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & libc.CplInt32(MEM_Str))) __232: ; +__230: + ; + nByte = (I64((*Mem)(unsafe.Pointer(pIn1)).Fn + (*Mem)(unsafe.Pointer(pIn2)).Fn)) + if !(nByte > I64(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */))))) { + goto __234 + } + goto too_big +__234: + ; + if !(Xsqlite3VdbeMemGrow(tls, pOut, (int32(nByte)+3), (libc.Bool32(pOut == pIn2))) != 0) { + goto __235 + } + goto no_mem +__235: + ; (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Str)) if !(pOut != pIn2) { - goto __233 + goto __236 } libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pOut)).Fz, (*Mem)(unsafe.Pointer(pIn2)).Fz, uint64((*Mem)(unsafe.Pointer(pIn2)).Fn)) (*Mem)(unsafe.Pointer(pIn2)).Fflags = flags2 -__233: +__236: ; libc.Xmemcpy(tls, ((*Mem)(unsafe.Pointer(pOut)).Fz + uintptr((*Mem)(unsafe.Pointer(pIn2)).Fn)), (*Mem)(unsafe.Pointer(pIn1)).Fz, uint64((*Mem)(unsafe.Pointer(pIn1)).Fn)) @@ -65545,11 +65894,11 @@ __233: // register P1 and store the result in register P3. // If the value in register P1 is zero the result is NULL. // If either operand is NULL, the result is NULL. -__34: // same as TK_PLUS, in1, in2, out3 -__35: // same as TK_MINUS, in1, in2, out3 -__36: // same as TK_STAR, in1, in2, out3 -__37: // same as TK_SLASH, in1, in2, out3 -__38: // Real value of right operand +__35: // same as TK_PLUS, in1, in2, out3 +__36: // same as TK_MINUS, in1, in2, out3 +__37: // same as TK_STAR, in1, in2, out3 +__38: // same as TK_SLASH, in1, in2, out3 +__39: // Real value of right operand pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) type1 = numericType(tls, pIn1) @@ -65558,158 +65907,158 @@ __38: // Real value of right operand pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) flags = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) | int32((*Mem)(unsafe.Pointer(pIn2)).Fflags))) if !(((int32(type1) & int32(type2)) & MEM_Int) != 0) { - goto __234 + goto __237 } iA = *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) = *(*I64)(unsafe.Pointer(pIn2 /* &.u */)) switch int32((*Op)(unsafe.Pointer(pOp)).Fopcode) { case OP_Add: - goto __237 - case OP_Subtract: - goto __238 - case OP_Multiply: - goto __239 - case OP_Divide: goto __240 - default: + case OP_Subtract: goto __241 - } - goto __236 -__237: - if !(Xsqlite3AddInt64(tls, bp+176 /* &iB */, iA) != 0) { + case OP_Multiply: goto __242 - } - goto fp_math -__242: - ; - goto __236 -__238: - if !(Xsqlite3SubInt64(tls, bp+176 /* &iB */, iA) != 0) { + case OP_Divide: goto __243 - } - goto fp_math -__243: - ; - goto __236 -__239: - if !(Xsqlite3MulInt64(tls, bp+176 /* &iB */, iA) != 0) { + default: goto __244 } - goto fp_math -__244: - ; - goto __236 + goto __239 __240: - if !(iA == int64(0)) { + if !(Xsqlite3AddInt64(tls, bp+176 /* &iB */, iA) != 0) { goto __245 } - goto arithmetic_result_is_null + goto fp_math __245: ; - if !((iA == int64(-1)) && (*(*I64)(unsafe.Pointer(bp + 176 /* iB */)) == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))) { + goto __239 +__241: + if !(Xsqlite3SubInt64(tls, bp+176 /* &iB */, iA) != 0) { goto __246 } goto fp_math __246: ; - *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) /= iA - goto __236 - -__241: - if !(iA == int64(0)) { + goto __239 +__242: + if !(Xsqlite3MulInt64(tls, bp+176 /* &iB */, iA) != 0) { goto __247 } - goto arithmetic_result_is_null + goto fp_math __247: ; - if !(iA == int64(-1)) { + goto __239 +__243: + if !(iA == int64(0)) { goto __248 } - iA = int64(1) + goto arithmetic_result_is_null __248: ; - *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) %= iA - goto __236 + if !((iA == int64(-1)) && (*(*I64)(unsafe.Pointer(bp + 176 /* iB */)) == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))) { + goto __249 + } + goto fp_math +__249: + ; + *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) /= iA + goto __239 -__236: +__244: + if !(iA == int64(0)) { + goto __250 + } + goto arithmetic_result_is_null +__250: + ; + if !(iA == int64(-1)) { + goto __251 + } + iA = int64(1) +__251: + ; + *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) %= iA + goto __239 + +__239: ; *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int)) - goto __235 -__234: + goto __238 +__237: if !((int32(flags) & MEM_Null) != 0) { - goto __249 + goto __252 } goto arithmetic_result_is_null - goto __250 -__249: + goto __253 +__252: fp_math: rA = Xsqlite3VdbeRealValue(tls, pIn1) rB = Xsqlite3VdbeRealValue(tls, pIn2) switch int32((*Op)(unsafe.Pointer(pOp)).Fopcode) { case OP_Add: - goto __252 - case OP_Subtract: - goto __253 - case OP_Multiply: - goto __254 - case OP_Divide: goto __255 - default: + case OP_Subtract: goto __256 - } - goto __251 -__252: - rB = rB + (rA) - goto __251 -__253: - rB = rB - (rA) - goto __251 -__254: - rB = rB * (rA) - goto __251 -__255: - // (double)0 In case of SQLITE_OMIT_FLOATING_POINT... - if !(rA == float64(0)) { + case OP_Multiply: goto __257 - } - goto arithmetic_result_is_null -__257: - ; - rB = rB / (rA) - goto __251 - -__256: - iA = Xsqlite3VdbeIntValue(tls, pIn1) - *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) = Xsqlite3VdbeIntValue(tls, pIn2) - if !(iA == int64(0)) { + case OP_Divide: goto __258 - } - goto arithmetic_result_is_null -__258: - ; - if !(iA == int64(-1)) { + default: goto __259 } - iA = int64(1) -__259: - ; - rB = (float64(*(*I64)(unsafe.Pointer(bp + 176 /* iB */)) % iA)) - goto __251 - -__251: - ; - if !(Xsqlite3IsNaN(tls, rB) != 0) { + goto __254 +__255: + rB = rB + (rA) + goto __254 +__256: + rB = rB - (rA) + goto __254 +__257: + rB = rB * (rA) + goto __254 +__258: + // (double)0 In case of SQLITE_OMIT_FLOATING_POINT... + if !(rA == float64(0)) { goto __260 } goto arithmetic_result_is_null __260: + ; + rB = rB / (rA) + goto __254 + +__259: + iA = Xsqlite3VdbeIntValue(tls, pIn1) + *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) = Xsqlite3VdbeIntValue(tls, pIn2) + if !(iA == int64(0)) { + goto __261 + } + goto arithmetic_result_is_null +__261: + ; + if !(iA == int64(-1)) { + goto __262 + } + iA = int64(1) +__262: + ; + rB = (float64(*(*I64)(unsafe.Pointer(bp + 176 /* iB */)) % iA)) + goto __254 + +__254: + ; + if !(Xsqlite3IsNaN(tls, rB) != 0) { + goto __263 + } + goto arithmetic_result_is_null +__263: ; *(*float64)(unsafe.Pointer(pOut /* &.u */)) = rB (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Real)) -__250: +__253: ; -__235: +__238: ; goto __10 @@ -65731,13 +66080,13 @@ arithmetic_result_is_null: // The interface used by the implementation of the aforementioned functions // to retrieve the collation sequence set by this opcode is not available // publicly. Only built-in functions have access to this feature. -__39: +__40: ; if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) { - goto __261 + goto __264 } Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56), int64(0)) -__261: +__264: ; goto __10 @@ -65767,43 +66116,43 @@ __261: // number of bits specified by the integer in register P1. // Store the result in register P3. // If either input is NULL, the result is NULL. -__40: // same as TK_BITAND, in1, in2, out3 -__41: // same as TK_BITOR, in1, in2, out3 -__42: // same as TK_LSHIFT, in1, in2, out3 -__43: +__41: // same as TK_BITAND, in1, in2, out3 +__42: // same as TK_BITOR, in1, in2, out3 +__43: // same as TK_LSHIFT, in1, in2, out3 +__44: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !(((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) | int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)) & MEM_Null) != 0) { - goto __262 + goto __265 } Xsqlite3VdbeMemSetNull(tls, pOut) goto __10 -__262: +__265: ; *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) = Xsqlite3VdbeIntValue(tls, pIn2) iB1 = Xsqlite3VdbeIntValue(tls, pIn1) op = (*Op)(unsafe.Pointer(pOp)).Fopcode if !(int32(op) == OP_BitAnd) { - goto __263 + goto __266 } *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) &= iB1 - goto __264 -__263: + goto __267 +__266: if !(int32(op) == OP_BitOr) { - goto __265 + goto __268 } *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) |= iB1 - goto __266 -__265: + goto __269 +__268: if !(iB1 != int64(0)) { - goto __267 + goto __270 } // If shifting by a negative amount, shift in the other direction if !(iB1 < int64(0)) { - goto __268 + goto __271 } op = (U8(((2 * OP_ShiftLeft) + 1) - int32(op))) @@ -65812,45 +66161,45 @@ __265: } else { iB1 = int64(64) } -__268: +__271: ; if !(iB1 >= int64(64)) { - goto __269 + goto __272 } if (*(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) >= int64(0)) || (int32(op) == OP_ShiftLeft) { *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) = int64(0) } else { *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) = int64(-1) } - goto __270 -__269: + goto __273 +__272: libc.Xmemcpy(tls, bp+184 /* &uA */, bp+192 /* &iA1 */, uint64(unsafe.Sizeof(U64(0)))) if !(int32(op) == OP_ShiftLeft) { - goto __271 + goto __274 } *(*U64)(unsafe.Pointer(bp + 184 /* uA */)) <<= iB1 - goto __272 -__271: + goto __275 +__274: *(*U64)(unsafe.Pointer(bp + 184 /* uA */)) >>= iB1 // Sign-extend on a right shift of a negative number if !(*(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) < int64(0)) { - goto __273 + goto __276 } *(*U64)(unsafe.Pointer(bp + 184 /* uA */)) |= (U64(((U64((uint64(0xffffffff))) << 32) | uint64(0xffffffff))) << (int64(64) - iB1)) -__273: +__276: ; -__272: +__275: ; libc.Xmemcpy(tls, bp+192 /* &iA1 */, bp+184 /* &uA */, uint64(unsafe.Sizeof(I64(0)))) +__273: + ; __270: ; +__269: + ; __267: ; -__266: - ; -__264: - ; *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int)) goto __10 @@ -65862,7 +66211,7 @@ __264: // The result is always an integer. // // To force any register to be an integer, just add 0. -__44: // in1 +__45: // in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) Xsqlite3VdbeMemIntegerify(tls, pIn1) @@ -65875,30 +66224,30 @@ __44: // in1 // in P1 is not an integer and cannot be converted into an integer // without data loss, then jump immediately to P2, or if P2==0 // raise an SQLITE_MISMATCH exception. -__45: // jump, in1 +__46: // jump, in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Int) == 0) { - goto __274 + goto __277 } - applyAffinity(tls, pIn1, SQLITE_AFF_NUMERIC, encoding) + applyAffinity(tls, pIn1, int8(SQLITE_AFF_NUMERIC), encoding) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Int) == 0) { - goto __275 + goto __278 } if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 0) { - goto __276 + goto __279 } rc = SQLITE_MISMATCH goto abort_due_to_error - goto __277 -__276: + goto __280 +__279: goto jump_to_p2 +__280: + ; +__278: + ; __277: ; -__275: - ; -__274: - ; (*Mem)(unsafe.Pointer(pIn1)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pIn1))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int)) goto __10 @@ -65911,15 +66260,15 @@ __274: // has REAL affinity. Such column values may still be stored as // integers, for space efficiency, but after extraction we want them // to have only a real value. -__46: // in1 +__47: // in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & (MEM_Int | MEM_IntReal)) != 0) { - goto __278 + goto __281 } Xsqlite3VdbeMemRealify(tls, pIn1) -__278: +__281: ; goto __10 @@ -65937,7 +66286,7 @@ __278: // // // A NULL value is not changed by this routine. It remains NULL. -__47: // in1 +__48: // in1 ; pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) @@ -65949,17 +66298,17 @@ __47: // in1 return 0 }() if !(rc != 0) { - goto __279 + goto __282 } goto abort_due_to_error -__279: +__282: ; rc = Xsqlite3VdbeMemCast(tls, pIn1, uint8((*Op)(unsafe.Pointer(pOp)).Fp2), encoding) if !(rc != 0) { - goto __280 + goto __283 } goto abort_due_to_error -__280: +__283: ; updateMaxBlobsize(tls, pIn1) @@ -66055,23 +66404,23 @@ __280: // This works just like the Lt opcode except that the jump is taken if // the content of register P3 is greater than or equal to the content of // register P1. See the Lt opcode for additional information. -__48: // same as TK_EQ, jump, in1, in3 -__49: // same as TK_NE, jump, in1, in3 -__50: // same as TK_LT, jump, in1, in3 -__51: // same as TK_LE, jump, in1, in3 -__52: // same as TK_GT, jump, in1, in3 -__53: // Copy of initial value of pIn3->flags +__49: // same as TK_EQ, jump, in1, in3 +__50: // same as TK_NE, jump, in1, in3 +__51: // same as TK_LT, jump, in1, in3 +__52: // same as TK_LE, jump, in1, in3 +__53: // same as TK_GT, jump, in1, in3 +__54: // Copy of initial value of pIn3->flags pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) flags11 = (*Mem)(unsafe.Pointer(pIn1)).Fflags flags3 = (*Mem)(unsafe.Pointer(pIn3)).Fflags if !(((int32(flags11) | int32(flags3)) & MEM_Null) != 0) { - goto __281 + goto __284 } // One or both operands are NULL if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_NULLEQ) != 0) { - goto __283 + goto __286 } // If SQLITE_NULLEQ is set (which will only happen if the operator is // OP_Eq or OP_Ne) then take the jump or not depending on whether @@ -66079,131 +66428,131 @@ __53: // Copy of initial value of pIn3->flags if !((((int32(flags11) & int32(flags3)) & MEM_Null) != 0) && ((int32(flags3) & MEM_Cleared) == 0)) { - goto __285 + goto __288 } res = 0 // Operands are equal - goto __286 -__285: + goto __289 +__288: res = func() int32 { if (int32(flags3) & MEM_Null) != 0 { return -1 } return +1 }() // Operands are not equal -__286: +__289: ; - goto __284 -__283: + goto __287 +__286: // SQLITE_NULLEQ is clear and at least one operand is NULL, // then the result is always NULL. // The jump is taken if the SQLITE_JUMPIFNULL bit is set. if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_STOREP2) != 0) { - goto __287 + goto __290 } pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) iCompare = 1 // Operands are not equal (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Null)) - goto __288 -__287: + goto __291 +__290: ; if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_JUMPIFNULL) != 0) { - goto __289 + goto __292 } goto jump_to_p2 -__289: +__292: ; -__288: +__291: ; goto __10 -__284: +__287: ; - goto __282 -__281: + goto __285 +__284: // Neither operand is NULL. Do a comparison. affinity = (int8(int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_AFF_MASK)) if !(int32(affinity) >= SQLITE_AFF_NUMERIC) { - goto __290 + goto __293 } if !(((int32(flags11) | int32(flags3)) & MEM_Str) != 0) { - goto __292 + goto __295 } if !((int32(flags11) & (((MEM_Int | MEM_IntReal) | MEM_Real) | MEM_Str)) == MEM_Str) { - goto __293 + goto __296 } applyNumericAffinity(tls, pIn1, 0) flags3 = (*Mem)(unsafe.Pointer(pIn3)).Fflags -__293: +__296: ; if !((int32(flags3) & (((MEM_Int | MEM_IntReal) | MEM_Real) | MEM_Str)) == MEM_Str) { - goto __294 + goto __297 } applyNumericAffinity(tls, pIn3, 0) -__294: +__297: ; -__292: +__295: ; // Handle the common case of integer comparison here, as an // optimization, to avoid a call to sqlite3MemCompare() if !(((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & int32((*Mem)(unsafe.Pointer(pIn3)).Fflags)) & MEM_Int) != 0) { - goto __295 + goto __298 } if !(*(*I64)(unsafe.Pointer(pIn3 /* &.u */)) > *(*I64)(unsafe.Pointer(pIn1 /* &.u */))) { - goto __296 + goto __299 } res = +1 goto compare_op -__296: +__299: ; if !(*(*I64)(unsafe.Pointer(pIn3 /* &.u */)) < *(*I64)(unsafe.Pointer(pIn1 /* &.u */))) { - goto __297 + goto __300 } res = -1 goto compare_op -__297: +__300: ; res = 0 goto compare_op -__295: +__298: ; - goto __291 -__290: + goto __294 +__293: if !(int32(affinity) == SQLITE_AFF_TEXT) { - goto __298 + goto __301 } if !(((int32(flags11) & MEM_Str) == 0) && ((int32(flags11) & ((MEM_Int | MEM_Real) | MEM_IntReal)) != 0)) { - goto __299 + goto __302 } Xsqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(1)) flags11 = (U16((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & libc.CplInt32(MEM_TypeMask)) | (int32(flags11) & MEM_TypeMask))) if !(pIn1 == pIn3) { - goto __300 + goto __303 } flags3 = (U16(int32(flags11) | MEM_Str)) -__300: +__303: ; -__299: +__302: ; if !(((int32(flags3) & MEM_Str) == 0) && ((int32(flags3) & ((MEM_Int | MEM_Real) | MEM_IntReal)) != 0)) { - goto __301 + goto __304 } Xsqlite3VdbeMemStringify(tls, pIn3, encoding, uint8(1)) flags3 = (U16((int32((*Mem)(unsafe.Pointer(pIn3)).Fflags) & libc.CplInt32(MEM_TypeMask)) | (int32(flags3) & MEM_TypeMask))) +__304: + ; __301: ; -__298: - ; -__291: +__294: ; res = Xsqlite3MemCompare(tls, pIn3, pIn1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) -__282: +__285: ; compare_op: // At this point, res is negative, zero, or positive if reg[P1] is @@ -66215,21 +66564,21 @@ compare_op: ; if !(res < 0) { - goto __302 + goto __305 } res2 = int32(aLTb[(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) - OP_Ne)]) - goto __303 -__302: + goto __306 +__305: if !(res == 0) { - goto __304 + goto __307 } res2 = int32(aEQb[(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) - OP_Ne)]) - goto __305 -__304: + goto __308 +__307: res2 = int32(aGTb[(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) - OP_Ne)]) -__305: +__308: ; -__303: +__306: ; // Undo any changes made by applyAffinity() to the input registers. @@ -66239,12 +66588,12 @@ __303: (*Mem)(unsafe.Pointer(pIn1)).Fflags = flags11 if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_STOREP2) != 0) { - goto __306 + goto __309 } pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) iCompare = res if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & SQLITE_KEEPNULL) != 0) { - goto __308 + goto __311 } // The KEEPNULL flag prevents OP_Eq from overwriting a NULL with 1 // and prevents OP_Ne from overwriting NULL with 0. This flag @@ -66255,27 +66604,27 @@ __303: // NULL. if !((libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_Eq)) == res2) { - goto __309 + goto __312 } goto __10 -__309: +__312: ; -__308: +__311: ; (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int)) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(res2) - goto __307 -__306: + goto __310 +__309: ; if !(res2 != 0) { - goto __310 + goto __313 } goto jump_to_p2 -__310: +__313: ; -__307: +__310: ; goto __10 @@ -66291,14 +66640,14 @@ __307: // prior OP_Lt or OP_Gt would have been NULL or false (0), then then // jump to P2. If the result of an OP_Eq comparison on the two previous // operands would have been true (1), then fall through. -__54: // same as TK_ESCAPE, jump +__55: // same as TK_ESCAPE, jump ; if !(iCompare != 0) { - goto __311 + goto __314 } goto jump_to_p2 -__311: +__314: ; goto __10 @@ -66313,7 +66662,7 @@ __311: // // The first integer in the P4 integer array is the length of the array // and does not become part of the permutation. -__55: +__56: ; goto __10 @@ -66337,19 +66686,19 @@ __55: // The comparison is a sort comparison, so NULLs compare equal, // NULLs are less than numbers, numbers are less than strings, // and strings are less than blobs. -__56: // The permutation +__57: // The permutation if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_PERMUTE) == 0) { - goto __312 + goto __315 } aPermute = uintptr(0) - goto __313 -__312: + goto __316 +__315: ; aPermute = (*(*uintptr)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*32 + 16 /* &.p4 */)) + uintptr(1)*4) -__313: +__316: ; n2 = (*Op)(unsafe.Pointer(pOp)).Fp3 pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) @@ -66357,9 +66706,9 @@ __313: p11 = (*Op)(unsafe.Pointer(pOp)).Fp1 p21 = (*Op)(unsafe.Pointer(pOp)).Fp2 i1 = 0 -__314: +__317: if !(i1 < n2) { - goto __316 + goto __319 } if aPermute != 0 { idx = *(*U32)(unsafe.Pointer(aPermute + uintptr(i1)*4)) @@ -66371,30 +66720,30 @@ __314: bRev = (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i1)))) & KEYINFO_ORDER_DESC) iCompare = Xsqlite3MemCompare(tls, (aMem + uintptr((U32(p11)+idx))*56), (aMem + uintptr((U32(p21)+idx))*56), pColl) if !(iCompare != 0) { - goto __317 + goto __320 } if !(((int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i1)))) & KEYINFO_ORDER_BIGNULL) != 0) && (((int32((*Mem)(unsafe.Pointer(aMem+uintptr((U32(p11)+idx))*56)).Fflags) & MEM_Null) != 0) || ((int32((*Mem)(unsafe.Pointer(aMem+uintptr((U32(p21)+idx))*56)).Fflags) & MEM_Null) != 0))) { - goto __318 + goto __321 } iCompare = -iCompare -__318: +__321: ; if !(bRev != 0) { - goto __319 + goto __322 } iCompare = -iCompare -__319: +__322: ; - goto __316 -__317: + goto __319 +__320: ; - goto __315 -__315: + goto __318 +__318: i1++ - goto __314 - goto __316 -__316: + goto __317 + goto __319 +__319: ; goto __10 @@ -66403,24 +66752,24 @@ __316: // Jump to the instruction at address P1, P2, or P3 depending on whether // in the most recent OP_Compare instruction the P1 vector was less than // equal to, or greater than the P2 vector, respectively. -__57: // jump +__58: // jump if !(iCompare < 0) { - goto __320 + goto __323 } pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1-1))*32) - goto __321 -__320: + goto __324 +__323: if !(iCompare == 0) { - goto __322 + goto __325 } pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2-1))*32) - goto __323 -__322: + goto __326 +__325: ; pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp3-1))*32) -__323: +__326: ; -__321: +__324: ; goto __10 @@ -66442,30 +66791,30 @@ __321: // If either P1 or P2 is nonzero (true) then the result is 1 (true) // even if the other input is NULL. A NULL and false or two NULLs // give a NULL output. -__58: // same as TK_AND, in1, in2, out3 -__59: // Right operand: 0==FALSE, 1==TRUE, 2==UNKNOWN or NULL +__59: // same as TK_AND, in1, in2, out3 +__60: // Right operand: 0==FALSE, 1==TRUE, 2==UNKNOWN or NULL v1 = Xsqlite3VdbeBooleanValue(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56), 2) v2 = Xsqlite3VdbeBooleanValue(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56), 2) if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_And) { - goto __324 + goto __327 } v1 = int32(and_logic[((v1 * 3) + v2)]) - goto __325 -__324: + goto __328 +__327: v1 = int32(or_logic[((v1 * 3) + v2)]) -__325: +__328: ; pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !(v1 == 2) { - goto __326 + goto __329 } (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Null)) - goto __327 -__326: + goto __330 +__329: *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(v1) (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Int)) -__327: +__330: ; goto __10 @@ -66488,7 +66837,7 @@ __327: //
  • If P3==0 and P4==1 then r[P2] := r[P1] IS NOT TRUE //
  • If P3==1 and P4==0 then r[P2] := r[P1] IS NOT FALSE // -__60: // in1, out2 +__61: // in1, out2 ; Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56), @@ -66501,17 +66850,17 @@ __60: // in1, out2 // Interpret the value in register P1 as a boolean value. Store the // boolean complement in register P2. If the value in register P1 is // NULL, then a NULL is stored in P2. -__61: // same as TK_NOT, in1, out2 +__62: // same as TK_NOT, in1, out2 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) == 0) { - goto __328 + goto __331 } Xsqlite3VdbeMemSetInt64(tls, pOut, libc.BoolInt64(!(Xsqlite3VdbeBooleanValue(tls, pIn1, 0) != 0))) - goto __329 -__328: + goto __332 +__331: Xsqlite3VdbeMemSetNull(tls, pOut) -__329: +__332: ; goto __10 @@ -66521,16 +66870,16 @@ __329: // Interpret the content of register P1 as an integer. Store the // ones-complement of the P1 value into register P2. If P1 holds // a NULL then store a NULL in P2. -__62: // same as TK_BITNOT, in1, out2 +__63: // same as TK_BITNOT, in1, out2 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) Xsqlite3VdbeMemSetNull(tls, pOut) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) == 0) { - goto __330 + goto __333 } - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = ^Xsqlite3VdbeIntValue(tls, pIn1) -__330: +__333: ; goto __10 @@ -66550,30 +66899,30 @@ __330: // whether or not the jump should be taken. The bitmask is necessary // because the self-altering code trick does not work for recursive // triggers. -__63: // Address of this instruction +__64: // Address of this instruction ; if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) { - goto __331 + goto __334 } iAddr = U32((int32((int64(pOp) - int64((*Vdbe)(unsafe.Pointer(p)).FaOp)) / 32))) if !((int32(*(*U8)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr((iAddr / U32(8)))))) & (int32(1) << (iAddr & U32(7)))) != 0) { - goto __333 + goto __336 } goto jump_to_p2 -__333: +__336: ; *(*U8)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr((iAddr / U32(8))))) |= U8((int32(1) << (iAddr & U32(7)))) - goto __332 -__331: + goto __335 +__334: if !((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp)).Fp1 == (*Op)(unsafe.Pointer(pOp)).Fp1) { - goto __334 + goto __337 } goto jump_to_p2 -__334: +__337: ; -__332: +__335: ; (*Op)(unsafe.Pointer(pOp)).Fp1 = (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp)).Fp1 @@ -66584,14 +66933,14 @@ __332: // Jump to P2 if the value in register P1 is true. The value // is considered true if it is numeric and non-zero. If the value // in P1 is NULL then take the jump if and only if P3 is non-zero. -__64: +__65: c = Xsqlite3VdbeBooleanValue(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56), (*Op)(unsafe.Pointer(pOp)).Fp3) if !(c != 0) { - goto __335 + goto __338 } goto jump_to_p2 -__335: +__338: ; goto __10 @@ -66600,14 +66949,14 @@ __335: // Jump to P2 if the value in register P1 is False. The value // is considered false if it has a numeric value of zero. If the value // in P1 is NULL then take the jump if and only if P3 is non-zero. -__65: +__66: c1 = libc.BoolInt32(!(Xsqlite3VdbeBooleanValue(tls, (aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56), libc.BoolInt32(!((*Op)(unsafe.Pointer(pOp)).Fp3 != 0))) != 0)) if !(c1 != 0) { - goto __336 + goto __339 } goto jump_to_p2 -__336: +__339: ; goto __10 @@ -66615,14 +66964,14 @@ __336: // Synopsis: if r[P1]==NULL goto P2 // // Jump to P2 if the value in register P1 is NULL. -__66: // same as TK_ISNULL, jump, in1 +__67: // same as TK_ISNULL, jump, in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) != 0) { - goto __337 + goto __340 } goto jump_to_p2 -__337: +__340: ; goto __10 @@ -66630,14 +66979,14 @@ __337: // Synopsis: if r[P1]!=NULL goto P2 // // Jump to P2 if the value in register P1 is not NULL. -__67: // same as TK_NOTNULL, jump, in1 +__68: // same as TK_NOTNULL, jump, in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Null) == 0) { - goto __338 + goto __341 } goto jump_to_p2 -__338: +__341: ; goto __10 @@ -66648,15 +66997,15 @@ __338: // If it is, then set register P3 to NULL and jump immediately to P2. // If P1 is not on a NULL row, then fall through without making any // changes. -__68: // jump +__69: // jump ; if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)))).FnullRow != 0) { - goto __339 + goto __342 } Xsqlite3VdbeMemSetNull(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)) goto jump_to_p2 -__339: +__342: ; goto __10 @@ -66674,18 +67023,18 @@ __339: // // This opcode is only available if SQLite is compiled with the // -DSQLITE_ENABLE_OFFSET_SQL_FUNC option. -__69: // The VDBE cursor +__70: // The VDBE cursor ; pC = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) pOut = ((*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !((pC == uintptr(0)) || (int32((*VdbeCursor)(unsafe.Pointer(pC)).FeCurType) != CURTYPE_BTREE)) { - goto __340 + goto __343 } Xsqlite3VdbeMemSetNull(tls, pOut) - goto __341 -__340: + goto __344 +__343: Xsqlite3VdbeMemSetInt64(tls, pOut, Xsqlite3BtreeOffset(tls, *(*uintptr)(unsafe.Pointer(pC + 56 /* &.uc */)))) -__341: +__344: ; goto __10 @@ -66708,7 +67057,7 @@ __341: // the result is guaranteed to only be used as the argument of a length() // or typeof() function, respectively. The loading of large blobs can be // skipped for length() and all content loading can be skipped for typeof(). -__70: // PseudoTable input register +__71: // PseudoTable input register ; *(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) @@ -66720,10 +67069,10 @@ __70: // PseudoTable input register // B-Tree seek. rc = Xsqlite3VdbeCursorMoveto(tls, bp+200 /* &pC1 */, bp+208 /* &p22 */) if !(rc != 0) { - goto __342 + goto __345 } goto abort_due_to_error -__342: +__345: ; pDest = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) @@ -66731,13 +67080,13 @@ __342: aOffset = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaOffset if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FcacheStatus != (*Vdbe)(unsafe.Pointer(p)).FcacheCtr) { - goto __343 + goto __346 } //OPTIMIZATION-IF-FALSE if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnullRow != 0) { - goto __344 + goto __347 } if !(int32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FeCurType) == CURTYPE_PSEUDO) { - goto __346 + goto __349 } // For the special case of as pseudo-cursor, the seekResult field // identifies the register that holds the record @@ -66746,27 +67095,27 @@ __342: (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize = libc.AssignPtrUint32(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */))+116 /* &.szRow */, U32((*Mem)(unsafe.Pointer(pReg)).Fn)) (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow = (*Mem)(unsafe.Pointer(pReg)).Fz - goto __347 -__346: + goto __350 +__349: Xsqlite3VdbeMemSetNull(tls, pDest) goto op_column_out -__347: +__350: ; - goto __345 -__344: + goto __348 +__347: pCrsr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 56 /* &.uc */)) (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize = Xsqlite3BtreePayloadSize(tls, pCrsr) (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow = Xsqlite3BtreePayloadFetch(tls, pCrsr, (*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 116 /* &.szRow */)) // Maximum page size is 64KiB - if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize > U32(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */))))) { - goto __348 + if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize > U32(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */))))) { + goto __351 } goto too_big -__348: +__351: ; -__345: +__348: ; (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FcacheStatus = (*Vdbe)(unsafe.Pointer(p)).FcacheCtr (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset = U32(func() uint8 { @@ -66781,7 +67130,7 @@ __345: (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed = U16(0) if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FszRow < *(*U32)(unsafe.Pointer(aOffset))) { - goto __349 + goto __352 } //OPTIMIZATION-IF-FALSE // pC->aRow does not have to hold the entire row, but it does at least // need to cover the header of the record. If pC->aRow does not contain @@ -66799,13 +67148,13 @@ __345: // 3-byte type for each of the maximum of 32768 columns plus three // extra bytes for the header length itself. 32768*3 + 3 = 98307. if !((*(*U32)(unsafe.Pointer(aOffset)) > U32(98307)) || (*(*U32)(unsafe.Pointer(aOffset)) > (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize)) { - goto __351 + goto __354 } goto op_column_corrupt -__351: +__354: ; - goto __350 -__349: + goto __353 +__352: // This is an optimization. By skipping over the first few tests // (ex: pC->nHdrParsed<=p2) in the next section, we achieve a // measurable performance gain. @@ -66822,38 +67171,38 @@ __349: // Conditional skipped goto op_column_read_header -__350: +__353: ; -__343: +__346: ; // Make sure at least the first p2+1 entries of the header have been // parsed and valid information is in aOffset[] and pC->aType[]. if !(U32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed) <= *(*U32)(unsafe.Pointer(bp + 208 /* p22 */))) { - goto __352 + goto __355 } // If there is more header available for parsing in the record, try // to extract additional fields up through the p2+1-th field if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset < *(*U32)(unsafe.Pointer(aOffset))) { - goto __354 + goto __357 } // Make sure zData points to enough of the record to cover the header. if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow == uintptr(0)) { - goto __356 + goto __359 } libc.Xmemset(tls, bp+216 /* &sMem */, 0, uint64(unsafe.Sizeof(Mem{}))) rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 56 /* &.uc */)), *(*U32)(unsafe.Pointer(aOffset)), bp+216 /* &sMem */) if !(rc != SQLITE_OK) { - goto __358 + goto __361 } goto abort_due_to_error -__358: +__361: ; zData = (*Mem)(unsafe.Pointer(bp + 216 /* &sMem */)).Fz - goto __357 -__356: + goto __360 +__359: zData = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow -__357: +__360: ; // Fill in pC->aType[i] and aOffset[i] values through the p2-th field. @@ -66863,27 +67212,27 @@ op_column_read_header: zHdr = (zData + uintptr((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset)) zEndHdr = (zData + uintptr(*(*U32)(unsafe.Pointer(aOffset)))) -__359: +__362: if !((libc.AssignPtrUint32((*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */))+120 /* &.aType */)+uintptr(i2)*4, libc.AssignPtrUint32(bp+272 /* t */, U32(*(*U8)(unsafe.Pointer(zHdr)))))) < U32(0x80)) { - goto __362 + goto __365 } zHdr++ offset64 = offset64 + (U64(Xsqlite3VdbeOneByteSerialTypeLen(tls, uint8(*(*U32)(unsafe.Pointer(bp + 272 /* t */)))))) - goto __363 -__362: + goto __366 +__365: zHdr += uintptr(Xsqlite3GetVarint32(tls, zHdr, bp+272 /* &t */)) *(*U32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 120 /* &.aType */) + uintptr(i2)*4)) = *(*U32)(unsafe.Pointer(bp + 272 /* t */)) offset64 = offset64 + (U64(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 272 /* t */))))) -__363: +__366: ; *(*U32)(unsafe.Pointer(aOffset + uintptr(libc.PreIncInt32(&i2, 1))*4)) = (U32(offset64 & uint64(0xffffffff))) - goto __360 -__360: + goto __363 +__363: if (U32(i2) <= *(*U32)(unsafe.Pointer(bp + 208 /* p22 */))) && (zHdr < zEndHdr) { - goto __359 + goto __362 } - goto __361 -__361: + goto __364 +__364: ; // The record is corrupt if any of the following are true: @@ -66892,63 +67241,63 @@ __361: // (3) the end of the data extends beyond the end of the record. if !(((zHdr >= zEndHdr) && ((zHdr > zEndHdr) || (offset64 != U64((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize)))) || (offset64 > U64((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize))) { - goto __364 + goto __367 } if !(*(*U32)(unsafe.Pointer(aOffset)) == U32(0)) { - goto __365 + goto __368 } i2 = 0 zHdr = zEndHdr - goto __366 -__365: + goto __369 +__368: if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow == uintptr(0)) { - goto __367 + goto __370 } Xsqlite3VdbeMemRelease(tls, bp+216 /* &sMem */) -__367: +__370: ; goto op_column_corrupt -__366: +__369: ; -__364: +__367: ; (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed = U16(i2) (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset = (U32((int64(zHdr) - int64(zData)) / 1)) if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow == uintptr(0)) { - goto __368 + goto __371 } Xsqlite3VdbeMemRelease(tls, bp+216 /* &sMem */) -__368: +__371: ; - goto __355 -__354: + goto __358 +__357: *(*U32)(unsafe.Pointer(bp + 272 /* t */)) = U32(0) -__355: +__358: ; // If after trying to extract new entries from the header, nHdrParsed is // still not up to p2, that means that the record has fewer than p2 // columns. So the result will be either the default value or a NULL. if !(U32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed) <= *(*U32)(unsafe.Pointer(bp + 208 /* p22 */))) { - goto __369 + goto __372 } if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-11)) { - goto __370 + goto __373 } Xsqlite3VdbeMemShallowCopy(tls, pDest, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), MEM_Static) - goto __371 -__370: + goto __374 +__373: Xsqlite3VdbeMemSetNull(tls, pDest) -__371: +__374: ; goto op_column_out -__369: +__372: ; - goto __353 -__352: + goto __356 +__355: *(*U32)(unsafe.Pointer(bp + 272 /* t */)) = *(*U32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 120 /* &.aType */) + uintptr(*(*U32)(unsafe.Pointer(bp + 208 /* p22 */)))*4)) -__353: +__356: ; // Extract the content for the p2+1-th column. Control can only @@ -66956,55 +67305,55 @@ __353: // all valid. if !((int32((*Mem)(unsafe.Pointer((pDest))).Fflags) & (MEM_Agg | MEM_Dyn)) != 0) { - goto __372 + goto __375 } Xsqlite3VdbeMemSetNull(tls, pDest) -__372: +__375: ; if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FszRow >= *(*U32)(unsafe.Pointer(aOffset + uintptr((*(*U32)(unsafe.Pointer(bp + 208 /* p22 */))+U32(1)))*4))) { - goto __373 + goto __376 } // This is the common case where the desired content fits on the original // page - where the content is not on an overflow page zData = ((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow + uintptr(*(*U32)(unsafe.Pointer(aOffset + uintptr(*(*U32)(unsafe.Pointer(bp + 208 /* p22 */)))*4)))) if !(*(*U32)(unsafe.Pointer(bp + 272 /* t */)) < U32(12)) { - goto __375 + goto __378 } Xsqlite3VdbeSerialGet(tls, zData, *(*U32)(unsafe.Pointer(bp + 272 /* t */)), pDest) - goto __376 -__375: + goto __379 +__378: (*Mem)(unsafe.Pointer(pDest)).Fn = libc.AssignInt32(&len, (int32((*(*U32)(unsafe.Pointer(bp + 272 /* t */)) - U32(12)) / U32(2)))) (*Mem)(unsafe.Pointer(pDest)).Fenc = encoding if !((*Mem)(unsafe.Pointer(pDest)).FszMalloc < (len + 2)) { - goto __377 + goto __380 } - (*Mem)(unsafe.Pointer(pDest)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pDest)).Fflags = U16(MEM_Null) if !(Xsqlite3VdbeMemGrow(tls, pDest, (len+2), 0) != 0) { - goto __379 + goto __382 } goto no_mem -__379: +__382: ; - goto __378 -__377: + goto __381 +__380: (*Mem)(unsafe.Pointer(pDest)).Fz = (*Mem)(unsafe.Pointer(pDest)).FzMalloc -__378: +__381: ; libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pDest)).Fz, zData, uint64(len)) *(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pDest)).Fz + uintptr(len))) = int8(0) *(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pDest)).Fz + uintptr((len + 1)))) = int8(0) (*Mem)(unsafe.Pointer(pDest)).Fflags = aFlag1[(*(*U32)(unsafe.Pointer(bp + 272 /* t */)) & U32(1))] -__376: +__379: ; - goto __374 -__373: + goto __377 +__376: (*Mem)(unsafe.Pointer(pDest)).Fenc = encoding // This branch happens only when content is on overflow pages if !((((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (OPFLAG_LENGTHARG | OPFLAG_TYPEOFARG)) != 0) && (((*(*U32)(unsafe.Pointer(bp + 272 /* t */)) >= U32(12)) && ((*(*U32)(unsafe.Pointer(bp + 272 /* t */)) & U32(1)) == U32(0))) || ((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_TYPEOFARG) != 0))) || ((libc.AssignInt32(&len, int32(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 272 /* t */)))))) == 0)) { - goto __380 + goto __383 } // Content is irrelevant for // 1. the typeof() function, @@ -67019,20 +67368,20 @@ __373: // as that array is 256 bytes long (plenty for VdbeMemPrettyPrint()) // and it begins with a bunch of zeros. Xsqlite3VdbeSerialGet(tls, uintptr(uintptr(unsafe.Pointer(&Xsqlite3CtypeMap))), *(*U32)(unsafe.Pointer(bp + 272 /* t */)), pDest) - goto __381 -__380: + goto __384 +__383: rc = Xsqlite3VdbeMemFromBtree(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 56 /* &.uc */)), *(*U32)(unsafe.Pointer(aOffset + uintptr(*(*U32)(unsafe.Pointer(bp + 208 /* p22 */)))*4)), uint32(len), pDest) if !(rc != SQLITE_OK) { - goto __382 + goto __385 } goto abort_due_to_error -__382: +__385: ; Xsqlite3VdbeSerialGet(tls, (*Mem)(unsafe.Pointer(pDest)).Fz, *(*U32)(unsafe.Pointer(bp + 272 /* t */)), pDest) *(*U16)(unsafe.Pointer(pDest + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Ephem))) -__381: +__384: ; -__374: +__377: ; op_column_out: @@ -67042,15 +67391,15 @@ op_column_out: op_column_corrupt: if !((*Op)(unsafe.Pointer(aOp)).Fp3 > 0) { - goto __383 + goto __386 } pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(aOp)).Fp3-1))*32) goto __10 - goto __384 -__383: - rc = Xsqlite3CorruptError(tls, 88187) + goto __387 +__386: + rc = Xsqlite3CorruptError(tls, 88805) goto abort_due_to_error -__384: +__387: ; // Opcode: Affinity P1 P2 * P4 * @@ -67061,19 +67410,19 @@ __384: // P4 is a string that is P2 characters long. The N-th character of the // string indicates the column affinity that should be used for the N-th // memory cell in the range. -__71: // The affinity to be applied +__72: // The affinity to be applied zAffinity = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) -__385: +__388: if !(1 != 0) { - goto __386 + goto __389 } applyAffinity(tls, pIn1, *(*int8)(unsafe.Pointer(zAffinity)), encoding) if !((int32(*(*int8)(unsafe.Pointer(zAffinity))) == SQLITE_AFF_REAL) && ((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Int) != 0)) { - goto __387 + goto __390 } // When applying REAL affinity, if the result is still an MEM_Int // that will fit in 6 bytes, then change the type to MEM_IntReal @@ -67081,30 +67430,30 @@ __385: // the type really wants to be REAL. if !((*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) <= 140737488355327) && (*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) >= -140737488355328)) { - goto __388 + goto __391 } *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) |= U16((MEM_IntReal)) *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Int))) - goto __389 -__388: + goto __392 +__391: *(*float64)(unsafe.Pointer(pIn1 /* &.u */)) = float64(*(*I64)(unsafe.Pointer(pIn1 /* &.u */))) *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) |= U16((MEM_Real)) *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Int))) -__389: +__392: ; -__387: +__390: ; zAffinity++ if !(int32(*(*int8)(unsafe.Pointer(zAffinity))) == 0) { - goto __390 + goto __393 } - goto __386 -__390: + goto __389 +__393: ; pIn1 += 56 - goto __385 -__386: + goto __388 +__389: ; goto __10 @@ -67134,7 +67483,7 @@ __386: // OPFLAG_NOCHNG_MAGIC if the OP_MakeRecord opcode is allowed to // accept no-change records with serial_type 10. This value is // only used inside an assert() and does not affect the end result. -__72: // Where to write next byte of the payload +__73: // Where to write next byte of the payload // Assuming the record contains N fields, the record format looks // like this: @@ -67168,31 +67517,31 @@ __72: // Where to write next byte of the payload // Apply the requested affinity to all inputs if !(zAffinity1 != 0) { - goto __391 + goto __394 } pRec = pData0 -__392: +__395: applyAffinity(tls, pRec, *(*int8)(unsafe.Pointer(zAffinity1)), encoding) if !((int32(*(*int8)(unsafe.Pointer(zAffinity1))) == SQLITE_AFF_REAL) && ((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Int) != 0)) { - goto __395 + goto __398 } *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) |= U16((MEM_IntReal)) *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_Int))) -__395: +__398: ; zAffinity1++ pRec += 56 - goto __393 -__393: + goto __396 +__396: if *(*int8)(unsafe.Pointer(zAffinity1)) != 0 { - goto __392 + goto __395 } - goto __394 -__394: + goto __397 +__397: ; -__391: +__394: ; // Loop through the elements that will make up the record to figure @@ -67221,13 +67570,13 @@ __391: // nData Number of bytes of data space needed for the record // nZero Zero bytes at the end of the record pRec = pLast -__396: +__399: ; if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Null) != 0) { - goto __399 + goto __402 } if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Zero) != 0) { - goto __401 + goto __404 } // Values with MEM_Null and MEM_Zero are created by xColumn virtual // table methods that never invoke sqlite3_result_xxxxx() while @@ -67237,77 +67586,77 @@ __396: // a true sqlite3_value_nochange(). (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(10) - goto __402 -__401: + goto __405 +__404: (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(0) -__402: +__405: ; nHdr++ - goto __400 -__399: + goto __403 +__402: if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & (MEM_Int | MEM_IntReal)) != 0) { - goto __403 + goto __406 } // Figure out whether to use 1, 2, 4, 6 or 8 bytes. i3 = *(*I64)(unsafe.Pointer(pRec /* &.u */)) if !(i3 < int64(0)) { - goto __405 + goto __408 } uu = U64(^i3) - goto __406 -__405: + goto __409 +__408: uu = U64(i3) -__406: +__409: ; nHdr++ if !(uu <= uint64(127)) { - goto __407 + goto __410 } if !(((i3 & int64(1)) == i3) && (file_format >= 4)) { - goto __409 + goto __412 } (*Mem)(unsafe.Pointer(pRec)).FuTemp = (U32(8) + U32(uu)) - goto __410 -__409: + goto __413 +__412: nData++ (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(1) -__410: +__413: ; - goto __408 -__407: + goto __411 +__410: if !(uu <= uint64(32767)) { - goto __411 + goto __414 } nData = nData + (uint64(2)) (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(2) - goto __412 -__411: + goto __415 +__414: if !(uu <= uint64(8388607)) { - goto __413 + goto __416 } nData = nData + (uint64(3)) (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(3) - goto __414 -__413: + goto __417 +__416: if !(uu <= uint64(2147483647)) { - goto __415 + goto __418 } nData = nData + (uint64(4)) (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(4) - goto __416 -__415: + goto __419 +__418: if !(uu <= uint64(140737488355327)) { - goto __417 + goto __420 } nData = nData + (uint64(6)) (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(5) - goto __418 -__417: + goto __421 +__420: nData = nData + (uint64(8)) if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_IntReal) != 0) { - goto __419 + goto __422 } // If the value is IntReal and is going to take up 8 bytes to store // as an integer, then we might as well make it an 8-byte floating @@ -67316,79 +67665,79 @@ __417: *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= libc.Uint16FromInt32((libc.CplInt32(MEM_IntReal))) *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) |= U16((MEM_Real)) (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(7) - goto __420 -__419: + goto __423 +__422: (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(6) -__420: +__423: ; -__418: +__421: ; -__416: +__419: ; -__414: +__417: ; -__412: +__415: ; -__408: +__411: ; - goto __404 -__403: + goto __407 +__406: if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Real) != 0) { - goto __421 + goto __424 } nHdr++ nData = nData + (uint64(8)) (*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(7) - goto __422 -__421: + goto __425 +__424: ; len1 = U32((*Mem)(unsafe.Pointer(pRec)).Fn) serial_type = (((len1 * U32(2)) + U32(12)) + (U32(libc.Bool32((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Str) != 0)))) if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & MEM_Zero) != 0) { - goto __423 + goto __426 } serial_type = serial_type + (U32(*(*int32)(unsafe.Pointer(pRec /* &.u */)) * 2)) if !(nData != 0) { - goto __424 + goto __427 } if !(Xsqlite3VdbeMemExpandBlob(tls, pRec) != 0) { - goto __426 + goto __429 } goto no_mem -__426: +__429: ; len1 = len1 + (U32(*(*int32)(unsafe.Pointer(pRec /* &.u */)))) - goto __425 -__424: + goto __428 +__427: nZero = nZero + (I64(*(*int32)(unsafe.Pointer(pRec /* &.u */)))) -__425: +__428: ; -__423: +__426: ; nData = nData + (U64(len1)) nHdr = nHdr + (Xsqlite3VarintLen(tls, uint64(serial_type))) (*Mem)(unsafe.Pointer(pRec)).FuTemp = serial_type -__422: +__425: ; -__404: +__407: ; -__400: +__403: ; if !(pRec == pData0) { - goto __427 + goto __430 } - goto __398 -__427: + goto __401 +__430: ; pRec -= 56 - goto __397 -__397: + goto __400 +__400: if 1 != 0 { - goto __396 + goto __399 } - goto __398 -__398: + goto __401 +__401: ; // EVIDENCE-OF: R-22564-11647 The header begins with a single varint @@ -67397,22 +67746,22 @@ __398: // itself. if !(nHdr <= 126) { - goto __428 + goto __431 } // The common case nHdr = nHdr + (1) - goto __429 -__428: + goto __432 +__431: // Rare case of a really large header nVarint = Xsqlite3VarintLen(tls, uint64(nHdr)) nHdr = nHdr + (nVarint) if !(nVarint < Xsqlite3VarintLen(tls, uint64(nHdr))) { - goto __430 + goto __433 } nHdr++ -__430: +__433: ; -__429: +__432: ; nByte1 = (I64(U64(nHdr) + nData)) @@ -67421,37 +67770,37 @@ __429: // be one of the input registers (because the following call to // sqlite3VdbeMemClearAndResize() could clobber the value before it is used). if !((nByte1 + nZero) <= I64((*Mem)(unsafe.Pointer(pOut)).FszMalloc)) { - goto __431 + goto __434 } // The output register is already large enough to hold the record. // No error checks or buffer enlargement is required (*Mem)(unsafe.Pointer(pOut)).Fz = (*Mem)(unsafe.Pointer(pOut)).FzMalloc - goto __432 -__431: + goto __435 +__434: // Need to make sure that the output is not too big and then enlarge // the output register to hold the full result - if !((nByte1 + nZero) > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */))))) { - goto __433 + if !((nByte1 + nZero) > I64(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */))))) { + goto __436 } goto too_big -__433: +__436: ; if !(Xsqlite3VdbeMemClearAndResize(tls, pOut, int32(nByte1)) != 0) { - goto __434 + goto __437 } goto no_mem -__434: +__437: ; -__432: +__435: ; (*Mem)(unsafe.Pointer(pOut)).Fn = int32(nByte1) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Blob + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Blob) if !(nZero != 0) { - goto __435 + goto __438 } *(*int32)(unsafe.Pointer(pOut /* &.u */)) = int32(nZero) *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((MEM_Zero)) -__435: +__438: ; updateMaxBlobsize(tls, pOut) zHdr1 = (*Mem)(unsafe.Pointer(pOut)).Fz @@ -67466,7 +67815,7 @@ __435: }()) pRec = pData0 -__436: +__439: serial_type = (*Mem)(unsafe.Pointer(pRec)).FuTemp // EVIDENCE-OF: R-06529-47362 Following the size varint are one or more // additional varints, one per column. @@ -67479,13 +67828,13 @@ __436: // EVIDENCE-OF: R-64536-51728 The values for each column in the record // immediately follow the header. zPayload += uintptr(Xsqlite3VdbeSerialPut(tls, zPayload, pRec, serial_type)) // content - goto __437 -__437: + goto __440 +__440: if (libc.PreIncUintptr(&pRec, 56)) <= pLast { - goto __436 + goto __439 } - goto __438 -__438: + goto __441 +__441: ; goto __10 @@ -67499,25 +67848,25 @@ __438: // If P3==0, then an exact count is obtained, which involves visiting // every btree page of the table. But if P3 is non-zero, an estimate // is returned based on the current cursor position. -__73: +__74: ; pCrsr1 = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + 56 /* &.uc */)) if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) { - goto __439 + goto __442 } *(*I64)(unsafe.Pointer(bp + 280 /* nEntry */)) = Xsqlite3BtreeRowCountEst(tls, pCrsr1) - goto __440 -__439: + goto __443 +__442: *(*I64)(unsafe.Pointer(bp + 280 /* nEntry */)) = int64(0) // Not needed. Only used to silence a warning. rc = Xsqlite3BtreeCount(tls, db, pCrsr1, bp+280 /* &nEntry */) if !(rc != 0) { - goto __441 + goto __444 } goto abort_due_to_error -__441: +__444: ; -__440: +__443: ; pOut = out2Prerelease(tls, p, pOp) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 280 /* nEntry */)) @@ -67529,7 +67878,7 @@ __440: // on the value of P1. To open a new savepoint set P1==0 (SAVEPOINT_BEGIN). // To release (commit) an existing savepoint set P1==1 (SAVEPOINT_RELEASE). // To rollback an existing savepoint set P1==2 (SAVEPOINT_ROLLBACK). -__74: +__75: p12 = (*Op)(unsafe.Pointer(pOp)).Fp1 zName = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) @@ -67538,17 +67887,17 @@ __74: // transaction, then there cannot be any savepoints. if !(p12 == SAVEPOINT_BEGIN) { - goto __442 + goto __445 } if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0) { - goto __444 + goto __447 } // A new savepoint cannot be created if there are active write // statements (i.e. open read/write incremental blob handles). - Xsqlite3VdbeError(tls, p, ts+7199 /* "cannot open save..." */, 0) + Xsqlite3VdbeError(tls, p, ts+7275 /* "cannot open save..." */, 0) rc = SQLITE_BUSY - goto __445 -__444: + goto __448 +__447: nName = Xsqlite3Strlen30(tls, zName) // This call is Ok even if this savepoint is actually a transaction @@ -67559,16 +67908,16 @@ __444: rc = Xsqlite3VtabSavepoint(tls, db, SAVEPOINT_BEGIN, ((*Sqlite3)(unsafe.Pointer(db)).FnStatement + (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint)) if !(rc != SQLITE_OK) { - goto __446 + goto __449 } goto abort_due_to_error -__446: +__449: ; // Create a new savepoint structure. pNew = Xsqlite3DbMallocRawNN(tls, db, (uint64((uint64(unsafe.Sizeof(Savepoint{})) + uint64(nName)) + uint64(1)))) if !(pNew != 0) { - goto __447 + goto __450 } (*Savepoint)(unsafe.Pointer(pNew)).FzName = (pNew + 1*32) libc.Xmemcpy(tls, (*Savepoint)(unsafe.Pointer(pNew)).FzName, zName, (uint64(nName + 1))) @@ -67576,14 +67925,14 @@ __446: // If there is no open transaction, then mark this as a special // "transaction savepoint". if !((*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - goto __448 + goto __451 } (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0) (*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint = U8(1) - goto __449 -__448: + goto __452 +__451: (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint++ -__449: +__452: ; // Link the new savepoint into the database handle's list. @@ -67591,163 +67940,163 @@ __449: (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = pNew (*Savepoint)(unsafe.Pointer(pNew)).FnDeferredCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons (*Savepoint)(unsafe.Pointer(pNew)).FnDeferredImmCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons -__447: +__450: ; +__448: + ; + goto __446 __445: - ; - goto __443 -__442: ; iSavepoint = 0 // Find the named savepoint. If there is no such savepoint, then an // an error is returned to the user. pSavepoint = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint -__450: +__453: if !((pSavepoint != 0) && (Xsqlite3StrICmp(tls, (*Savepoint)(unsafe.Pointer(pSavepoint)).FzName, zName) != 0)) { - goto __452 + goto __455 } iSavepoint++ - goto __451 -__451: + goto __454 +__454: pSavepoint = (*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext - goto __450 - goto __452 -__452: + goto __453 + goto __455 +__455: ; if !(!(pSavepoint != 0)) { - goto __453 + goto __456 } - Xsqlite3VdbeError(tls, p, ts+7250 /* "no such savepoin..." */, libc.VaList(bp+56, zName)) + Xsqlite3VdbeError(tls, p, ts+7326 /* "no such savepoin..." */, libc.VaList(bp+56, zName)) rc = SQLITE_ERROR - goto __454 -__453: + goto __457 +__456: if !(((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0) && (p12 == SAVEPOINT_RELEASE)) { - goto __455 + goto __458 } // It is not possible to release (commit) a savepoint if there are // active write statements. Xsqlite3VdbeError(tls, p, - ts+7272 /* "cannot release s..." */, 0) + ts+7348 /* "cannot release s..." */, 0) rc = SQLITE_BUSY - goto __456 -__455: + goto __459 +__458: // Determine whether or not this is a transaction savepoint. If so, // and this is a RELEASE command, then the current transaction // is committed. isTransaction = (libc.Bool32(((*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext == uintptr(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint != 0))) if !((isTransaction != 0) && (p12 == SAVEPOINT_RELEASE)) { - goto __457 + goto __460 } if !((libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1))) != SQLITE_OK) { - goto __459 + goto __462 } goto vdbe_return -__459: +__462: ; (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1) if !(Xsqlite3VdbeHalt(tls, p) == SQLITE_BUSY) { - goto __460 + goto __463 } (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32((int64(pOp) - int64(aOp)) / 32)) (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0) (*Vdbe)(unsafe.Pointer(p)).Frc = libc.AssignInt32(&rc, SQLITE_BUSY) goto vdbe_return -__460: +__463: ; rc = (*Vdbe)(unsafe.Pointer(p)).Frc if !(rc != 0) { - goto __461 + goto __464 } (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0) - goto __462 -__461: + goto __465 +__464: (*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint = U8(0) -__462: +__465: ; - goto __458 -__457: + goto __461 +__460: iSavepoint = (((*Sqlite3)(unsafe.Pointer(db)).FnSavepoint - iSavepoint) - 1) if !(p12 == SAVEPOINT_ROLLBACK) { - goto __463 + goto __466 } - isSchemaChange = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaChange) != U32(0))) + isSchemaChange = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != U32(0))) ii = 0 -__465: +__468: if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) { - goto __467 + goto __470 } rc = Xsqlite3BtreeTripAllCursors(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii)*32)).FpBt, (SQLITE_ABORT | (int32(2) << 8)), (libc.Bool32(isSchemaChange == 0))) if !(rc != SQLITE_OK) { - goto __468 + goto __471 } goto abort_due_to_error -__468: +__471: ; - goto __466 -__466: + goto __469 +__469: ii++ - goto __465 - goto __467 -__467: + goto __468 + goto __470 +__470: ; - goto __464 -__463: + goto __467 +__466: ; isSchemaChange = 0 -__464: +__467: ; ii = 0 -__469: +__472: if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) { - goto __471 + goto __474 } rc = Xsqlite3BtreeSavepoint(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii)*32)).FpBt, p12, iSavepoint) if !(rc != SQLITE_OK) { - goto __472 + goto __475 } goto abort_due_to_error -__472: +__475: ; - goto __470 -__470: + goto __473 +__473: ii++ - goto __469 - goto __471 -__471: + goto __472 + goto __474 +__474: ; if !(isSchemaChange != 0) { - goto __473 + goto __476 } Xsqlite3ExpirePreparedStatements(tls, db, 0) Xsqlite3ResetAllSchemasOfConnection(tls, db) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) -__473: + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) +__476: ; -__458: +__461: ; if !(rc != 0) { - goto __474 + goto __477 } goto abort_due_to_error -__474: +__477: ; // Regardless of whether this is a RELEASE or ROLLBACK, destroy all // savepoints nested inside of the savepoint being operated on. -__475: +__478: if !((*Sqlite3)(unsafe.Pointer(db)).FpSavepoint != pSavepoint) { - goto __476 + goto __479 } pTmp = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pTmp)).FpNext Xsqlite3DbFree(tls, db, pTmp) (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint-- - goto __475 -__476: + goto __478 +__479: ; // If it is a RELEASE, then destroy the savepoint being operated on @@ -67755,48 +68104,48 @@ __476: // constraint violations present in the database to the value stored // when the savepoint was created. if !(p12 == SAVEPOINT_RELEASE) { - goto __477 + goto __480 } (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext Xsqlite3DbFree(tls, db, pSavepoint) if !(!(isTransaction != 0)) { - goto __479 + goto __482 } (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint-- -__479: +__482: ; - goto __478 -__477: + goto __481 +__480: ; (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = (*Savepoint)(unsafe.Pointer(pSavepoint)).FnDeferredCons (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = (*Savepoint)(unsafe.Pointer(pSavepoint)).FnDeferredImmCons -__478: +__481: ; if !(!(isTransaction != 0) || (p12 == SAVEPOINT_ROLLBACK)) { - goto __480 + goto __483 } rc = Xsqlite3VtabSavepoint(tls, db, p12, iSavepoint) if !(rc != SQLITE_OK) { - goto __481 + goto __484 } goto abort_due_to_error -__481: +__484: ; -__480: +__483: ; -__456: +__459: ; -__454: +__457: ; -__443: +__446: ; if !(rc != 0) { - goto __482 + goto __485 } goto abort_due_to_error -__482: +__485: ; goto __10 @@ -67809,7 +68158,7 @@ __482: // there are active writing VMs or active VMs that use shared cache. // // This instruction causes the VM to halt. -__75: +__76: desiredAutoCommit = (*Op)(unsafe.Pointer(pOp)).Fp1 iRollback = (*Op)(unsafe.Pointer(pOp)).Fp2 @@ -67817,78 +68166,78 @@ __75: // At least this one VM is active if !(desiredAutoCommit != int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit)) { - goto __483 + goto __486 } if !(iRollback != 0) { - goto __485 + goto __488 } Xsqlite3RollbackAll(tls, db, (SQLITE_ABORT | (int32(2) << 8))) (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1) - goto __486 -__485: + goto __489 +__488: if !((desiredAutoCommit != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0)) { - goto __487 + goto __490 } // If this instruction implements a COMMIT and other VMs are writing // return an error indicating that the other VMs must complete first. Xsqlite3VdbeError(tls, p, - ts+7326 /* "cannot commit tr..." */, 0) + ts+7402 /* "cannot commit tr..." */, 0) rc = SQLITE_BUSY goto abort_due_to_error - goto __488 -__487: + goto __491 +__490: if !((libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1))) != SQLITE_OK) { - goto __489 + goto __492 } goto vdbe_return - goto __490 -__489: + goto __493 +__492: (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(desiredAutoCommit) -__490: +__493: ; -__488: +__491: ; -__486: +__489: ; if !(Xsqlite3VdbeHalt(tls, p) == SQLITE_BUSY) { - goto __491 + goto __494 } (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32((int64(pOp) - int64(aOp)) / 32)) (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = (U8(1 - desiredAutoCommit)) (*Vdbe)(unsafe.Pointer(p)).Frc = libc.AssignInt32(&rc, SQLITE_BUSY) goto vdbe_return -__491: +__494: ; Xsqlite3CloseSavepoints(tls, db) if !((*Vdbe)(unsafe.Pointer(p)).Frc == SQLITE_OK) { - goto __492 + goto __495 } rc = SQLITE_DONE - goto __493 -__492: + goto __496 +__495: rc = SQLITE_ERROR -__493: +__496: ; goto vdbe_return - goto __484 -__483: + goto __487 +__486: Xsqlite3VdbeError(tls, p, func() uintptr { if !(desiredAutoCommit != 0) { - return ts + 7381 /* "cannot start a t..." */ + return ts + 7457 /* "cannot start a t..." */ } return func() uintptr { if iRollback != 0 { - return ts + 7429 /* "cannot rollback ..." */ + return ts + 7505 /* "cannot rollback ..." */ } - return ts + 7472 /* "cannot commit - ..." */ + return ts + 7548 /* "cannot commit - ..." */ }() }(), 0) rc = SQLITE_ERROR goto abort_due_to_error -__484: +__487: ; /*NOTREACHED*/ @@ -67898,7 +68247,8 @@ __484: // active. // If P2 is non-zero, then a write-transaction is started, or if a // read-transaction is already active, it is upgraded to a write-transaction. - // If P2 is zero, then a read-transaction is started. + // If P2 is zero, then a read-transaction is started. If P2 is 2 or more + // then an exclusive transaction is started. // // P1 is the index of the database file on which the transaction is // started. Index 0 is the main database file and index 1 is the @@ -67925,59 +68275,59 @@ __484: // generation counter, then an SQLITE_SCHEMA error is raised and execution // halts. The sqlite3_step() wrapper function might then reprepare the // statement and rerun it from the beginning. -__76: +__77: *(*int32)(unsafe.Pointer(bp + 288 /* iMeta */)) = 0 - if !(((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_QueryOnly) != uint64(0))) { - goto __494 + if !(((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_QueryOnly)) != uint64(0))) { + goto __497 } rc = SQLITE_READONLY goto abort_due_to_error -__494: +__497: ; pBt = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt if !(pBt != 0) { - goto __495 + goto __498 } rc = Xsqlite3BtreeBeginTrans(tls, pBt, (*Op)(unsafe.Pointer(pOp)).Fp2, bp+288 /* &iMeta */) if !(rc != SQLITE_OK) { - goto __496 + goto __499 } if !((rc & 0xff) == SQLITE_BUSY) { - goto __497 + goto __500 } (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32((int64(pOp) - int64(aOp)) / 32)) (*Vdbe)(unsafe.Pointer(p)).Frc = rc goto vdbe_return -__497: +__500: ; goto abort_due_to_error -__496: +__499: ; if !((((Bft(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.usesStmtJournal */)) & 0x40 >> 6))) != 0) && ((*Op)(unsafe.Pointer(pOp)).Fp2 != 0)) && ((int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0) || ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1))) { - goto __498 + goto __501 } if !((*Vdbe)(unsafe.Pointer(p)).FiStatement == 0) { - goto __499 + goto __502 } (*Sqlite3)(unsafe.Pointer(db)).FnStatement++ (*Vdbe)(unsafe.Pointer(p)).FiStatement = ((*Sqlite3)(unsafe.Pointer(db)).FnSavepoint + (*Sqlite3)(unsafe.Pointer(db)).FnStatement) -__499: +__502: ; rc = Xsqlite3VtabSavepoint(tls, db, SAVEPOINT_BEGIN, ((*Vdbe)(unsafe.Pointer(p)).FiStatement - 1)) if !(rc == SQLITE_OK) { - goto __500 + goto __503 } rc = Xsqlite3BtreeBeginStmt(tls, pBt, (*Vdbe)(unsafe.Pointer(p)).FiStatement) -__500: +__503: ; // Store the current value of the database handles deferred constraint @@ -67985,21 +68335,21 @@ __500: // the value of this counter needs to be restored too. (*Vdbe)(unsafe.Pointer(p)).FnStmtDefCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons (*Vdbe)(unsafe.Pointer(p)).FnStmtDefImmCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons -__498: +__501: ; -__495: +__498: ; if !(((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) && ((*(*int32)(unsafe.Pointer(bp + 288 /* iMeta */)) != (*Op)(unsafe.Pointer(pOp)).Fp3) || ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpSchema)).FiGeneration != *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))))) { - goto __501 + goto __504 } // IMPLEMENTATION-OF: R-03189-51135 As each SQL statement runs, the schema // version is checked to ensure that the schema has not changed since the // SQL statement was prepared. Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg) - (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3DbStrDup(tls, db, ts+7513 /* "database schema ..." */) + (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3DbStrDup(tls, db, ts+7589 /* "database schema ..." */) // If the schema-cookie from the database file matches the cookie // stored with the in-memory representation of the schema, do // not reload the schema from the database file. @@ -68013,20 +68363,20 @@ __495: // to be invalidated whenever sqlite3_step() is called from within // a v-table method. if !((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpSchema)).Fschema_cookie != *(*int32)(unsafe.Pointer(bp + 288 /* iMeta */))) { - goto __502 + goto __505 } Xsqlite3ResetOneSchema(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1) -__502: +__505: ; libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(1), 0, 0x3) rc = SQLITE_SCHEMA -__501: +__504: ; if !(rc != 0) { - goto __503 + goto __506 } goto abort_due_to_error -__503: +__506: ; goto __10 @@ -68041,7 +68391,7 @@ __503: // There must be a read-lock on the database (either a transaction // must be started or there must be an open cursor) before // executing this instruction. -__77: +__78: ; iDb = (*Op)(unsafe.Pointer(pOp)).Fp1 iCookie = (*Op)(unsafe.Pointer(pOp)).Fp3 @@ -68065,7 +68415,7 @@ __77: // schema version is set to P3-P5. The "PRAGMA schema_version=N" statement // has P5 set to 1, so that the internal schema version will be different // from the database schema version, resulting in a schema reset. -__78: +__79: ; pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32) @@ -68073,36 +68423,36 @@ __78: // See note about index shifting on OP_ReadCookie rc = Xsqlite3BtreeUpdateMeta(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp2, uint32((*Op)(unsafe.Pointer(pOp)).Fp3)) if !((*Op)(unsafe.Pointer(pOp)).Fp2 == BTREE_SCHEMA_VERSION) { - goto __504 + goto __507 } // When the schema cookie changes, record the new cookie internally (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fschema_cookie = ((*Op)(unsafe.Pointer(pOp)).Fp3 - int32((*Op)(unsafe.Pointer(pOp)).Fp5)) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) - goto __505 -__504: + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) + goto __508 +__507: if !((*Op)(unsafe.Pointer(pOp)).Fp2 == BTREE_FILE_FORMAT) { - goto __506 + goto __509 } // Record changes in the file format (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = U8((*Op)(unsafe.Pointer(pOp)).Fp3) -__506: +__509: ; -__505: +__508: ; if !((*Op)(unsafe.Pointer(pOp)).Fp1 == 1) { - goto __507 + goto __510 } // Invalidate all prepared statements whenever the TEMP database // schema is changed. Ticket #1644 Xsqlite3ExpirePreparedStatements(tls, db, 0) libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3) -__507: +__510: ; if !(rc != 0) { - goto __508 + goto __511 } goto abort_due_to_error -__508: +__511: ; goto __10 @@ -68187,29 +68537,29 @@ __508: // in read/write mode. // // See also: OP_OpenRead, OP_ReopenIdx -__79: +__80: ; pCur = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) if !((pCur != 0) && ((*VdbeCursor)(unsafe.Pointer(pCur)).FpgnoRoot == U32((*Op)(unsafe.Pointer(pOp)).Fp2))) { - goto __509 + goto __512 } // Guaranteed by the code generator goto open_cursor_set_hints -__509: +__512: ; // If the cursor is not currently open or is open on a different // index, then fall through into OP_OpenRead to force a reopen -__80: __81: +__82: ; if !((int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.expired */)) & 0x3 >> 0)) == 1) { - goto __510 + goto __513 } rc = (SQLITE_ABORT | (int32(2) << 8)) goto abort_due_to_error -__510: +__513: ; nField1 = 0 @@ -68221,24 +68571,24 @@ __510: pX = (*Db)(unsafe.Pointer(pDb1)).FpBt if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_OpenWrite) { - goto __511 + goto __514 } wrFlag = (BTREE_WRCSR | (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_FORDELETE)) if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb1)).FpSchema)).Ffile_format) < int32((*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat)) { - goto __513 + goto __516 } (*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb1)).FpSchema)).Ffile_format -__513: +__516: ; - goto __512 -__511: + goto __515 +__514: wrFlag = 0 -__512: +__515: ; if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_P2ISREG) != 0) { - goto __514 + goto __517 } pIn2 = (aMem + uintptr(p23)*56) @@ -68250,32 +68600,32 @@ __512: // If there were a failure, the prepared statement would have halted // before reaching this instruction. -__514: +__517: ; if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-9)) { - goto __515 + goto __518 } pKeyInfo1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) nField1 = int32((*KeyInfo)(unsafe.Pointer(pKeyInfo1)).FnAllField) - goto __516 -__515: + goto __519 +__518: if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-3)) { - goto __517 + goto __520 } nField1 = *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)) -__517: +__520: ; -__516: +__519: ; // Table with INTEGER PRIMARY KEY and nothing else - pCur = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, nField1, iDb1, CURTYPE_BTREE) + pCur = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, nField1, iDb1, uint8(CURTYPE_BTREE)) if !(pCur == uintptr(0)) { - goto __518 + goto __521 } goto no_mem -__518: +__521: ; (*VdbeCursor)(unsafe.Pointer(pCur)).FnullRow = U8(1) libc.SetBitFieldPtr8Uint32(pCur+8 /* &.isOrdered */, Bool(1), 2, 0x4) @@ -68294,10 +68644,10 @@ open_cursor_set_hints: Xsqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 56 /* &.uc */)), (uint32(int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (OPFLAG_BULKCSR | OPFLAG_SEEKEQ)))) if !(rc != 0) { - goto __519 + goto __522 } goto abort_due_to_error -__519: +__522: ; goto __10 @@ -68308,18 +68658,18 @@ __519: // opcode. Only ephemeral cursors may be duplicated. // // Duplicate ephemeral cursors are used for self-joins of materialized views. -__82: // The new cursor +__83: // The new cursor pOrig = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*8)) // Only ephemeral cursors can be duplicated - pCx = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, int32((*VdbeCursor)(unsafe.Pointer(pOrig)).FnField), -1, CURTYPE_BTREE) + pCx = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, int32((*VdbeCursor)(unsafe.Pointer(pOrig)).FnField), -1, uint8(CURTYPE_BTREE)) if !(pCx == uintptr(0)) { - goto __520 + goto __523 } goto no_mem -__520: +__523: ; (*VdbeCursor)(unsafe.Pointer(pCx)).FnullRow = U8(1) libc.SetBitFieldPtr8Uint32(pCx+8 /* &.isEphemeral */, Bool(1), 0, 0x1) @@ -68335,7 +68685,7 @@ __520: goto __10 - // Opcode: OpenEphemeral P1 P2 * P4 P5 + // Opcode: OpenEphemeral P1 P2 P3 P4 P5 // Synopsis: nColumn=P2 // // Open a new cursor P1 to a transient table. @@ -68355,6 +68705,10 @@ __520: // in btree.h. These flags control aspects of the operation of // the btree. The BTREE_OMIT_JOURNAL and BTREE_SINGLE flags are // added automatically. + // + // If P3 is positive, then reg[P3] is modified slightly so that it + // can be used as zero-length data for OP_Insert. This is an optimization + // that avoids an extra OP_Blob opcode to initialize that register. // Opcode: OpenAutoindex P1 P2 * P4 * // Synopsis: nColumn=P2 // @@ -68362,79 +68716,90 @@ __520: // different name to distinguish its use. Tables created using // by this opcode will be used for automatically created transient // indices in joins. -__83: __84: +__85: ; + if !((*Op)(unsafe.Pointer(pOp)).Fp3 > 0) { + goto __524 + } + // Make register reg[P3] into a value that can be used as the data + // form sqlite3BtreeInsert() where the length of the data is zero. + // Only used when number of columns is zero + + (*Mem)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)).Fn = 0 + (*Mem)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)).Fz = ts + 800 /* "" */ +__524: + ; pCx1 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) if !((pCx1 != 0) && ((*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx != 0)) { - goto __521 + goto __525 } // If the ephermeral table is already open, erase all existing content // so that the table is empty again, rather than creating a new table. (*VdbeCursor)(unsafe.Pointer(pCx1)).FseqCount = int64(0) - (*VdbeCursor)(unsafe.Pointer(pCx1)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pCx1)).FcacheStatus = U32(CACHE_STALE) rc = Xsqlite3BtreeClearTable(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, int32((*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot), uintptr(0)) - goto __522 -__521: - pCx1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, CURTYPE_BTREE) + goto __526 +__525: + pCx1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, uint8(CURTYPE_BTREE)) if !(pCx1 == uintptr(0)) { - goto __523 + goto __527 } goto no_mem -__523: +__527: ; libc.SetBitFieldPtr8Uint32(pCx1+8 /* &.isEphemeral */, Bool(1), 0, 0x1) rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, (pCx1 + 16 /* &.pBtx */), ((BTREE_OMIT_JOURNAL | BTREE_SINGLE) | int32((*Op)(unsafe.Pointer(pOp)).Fp5)), vfsFlags) if !(rc == SQLITE_OK) { - goto __524 + goto __528 } rc = Xsqlite3BtreeBeginTrans(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, 1, uintptr(0)) -__524: +__528: ; if !(rc == SQLITE_OK) { - goto __525 + goto __529 } // If a transient index is required, create it by calling // sqlite3BtreeCreateTable() with the BTREE_BLOBKEY flag before // opening it. If a transient table is required, just use the // automatically created table with root-page 1 (an BLOB_INTKEY table). if !((libc.AssignPtrUintptr(pCx1+64 /* &.pKeyInfo */, libc.AssignUintptr(&pKeyInfo2, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))) != uintptr(0)) { - goto __526 + goto __530 } rc = Xsqlite3BtreeCreateTable(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, (pCx1 + 76 /* &.pgnoRoot */), (BTREE_BLOBKEY | int32((*Op)(unsafe.Pointer(pOp)).Fp5))) if !(rc == SQLITE_OK) { - goto __528 + goto __532 } rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot, BTREE_WRCSR, pKeyInfo2, *(*uintptr)(unsafe.Pointer(pCx1 + 56 /* &.uc */))) -__528: +__532: ; (*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(0) - goto __527 -__526: - (*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot = SCHEMA_ROOT - rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, SCHEMA_ROOT, BTREE_WRCSR, + goto __531 +__530: + (*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot = Pgno(SCHEMA_ROOT) + rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, uint32(SCHEMA_ROOT), BTREE_WRCSR, uintptr(0), *(*uintptr)(unsafe.Pointer(pCx1 + 56 /* &.uc */))) (*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(1) -__527: +__531: ; -__525: +__529: ; libc.SetBitFieldPtr8Uint32(pCx1+8 /* &.isOrdered */, (Bool(libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fp5) != BTREE_UNORDERED))), 2, 0x4) -__522: +__526: ; if !(rc != 0) { - goto __529 + goto __533 } goto abort_due_to_error -__529: +__533: ; (*VdbeCursor)(unsafe.Pointer(pCx1)).FnullRow = U8(1) goto __10 @@ -68448,24 +68813,24 @@ __529: // If argument P3 is non-zero, then it indicates that the sorter may // assume that a stable sort considering the first P3 fields of each // key is sufficient to produce the required results. -__85: +__86: ; - pCx2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, CURTYPE_SORTER) + pCx2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, uint8(CURTYPE_SORTER)) if !(pCx2 == uintptr(0)) { - goto __530 + goto __534 } goto no_mem -__530: +__534: ; (*VdbeCursor)(unsafe.Pointer(pCx2)).FpKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) rc = Xsqlite3VdbeSorterInit(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp3, pCx2) if !(rc != 0) { - goto __531 + goto __535 } goto abort_due_to_error -__531: +__535: ; goto __10 @@ -68475,15 +68840,15 @@ __531: // P1 is a sorter cursor. If the sequence counter is currently zero, jump // to P2. Regardless of whether or not the jump is taken, increment the // the sequence value. -__86: +__87: ; pC2 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) if !((libc.PostIncInt64(&(*VdbeCursor)(unsafe.Pointer(pC2)).FseqCount, 1)) == int64(0)) { - goto __532 + goto __536 } goto jump_to_p2 -__532: +__536: ; goto __10 @@ -68502,15 +68867,15 @@ __532: // // P3 is the number of fields in the records that will be stored by // the pseudo-table. -__87: +__88: ; - pCx3 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp3, -1, CURTYPE_PSEUDO) + pCx3 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp3, -1, uint8(CURTYPE_PSEUDO)) if !(pCx3 == uintptr(0)) { - goto __533 + goto __537 } goto no_mem -__533: +__537: ; (*VdbeCursor)(unsafe.Pointer(pCx3)).FnullRow = U8(1) (*VdbeCursor)(unsafe.Pointer(pCx3)).FseekResult = (*Op)(unsafe.Pointer(pOp)).Fp2 @@ -68527,7 +68892,7 @@ __533: // // Close a cursor previously opened as P1. If P1 is not // currently open, this instruction is a no-op. -__88: +__89: ; Xsqlite3VdbeFreeCursor(tls, p, *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))) *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) = uintptr(0) @@ -68619,10 +68984,10 @@ __88: // is an equality search. // // See also: Found, NotFound, SeekGt, SeekGe, SeekLt -__89: // jump, in3, group __90: // jump, in3, group __91: // jump, in3, group -__92: // Only interested in == results +__92: // jump, in3, group +__93: // Only interested in == results ; @@ -68633,9 +68998,9 @@ __92: // Only interested in == results (*VdbeCursor)(unsafe.Pointer(pC3)).FnullRow = U8(0) (*VdbeCursor)(unsafe.Pointer(pC3)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus = U32(CACHE_STALE) if !((*VdbeCursor)(unsafe.Pointer(pC3)).FisTable != 0) { - goto __534 + goto __538 } // The OPFLAG_SEEKEQ/BTREE_SEEK_EQ flag is only set on index cursors @@ -68645,10 +69010,10 @@ __92: // Only interested in == results pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) flags31 = (*Mem)(unsafe.Pointer(pIn3)).Fflags if !((int32(flags31) & (((MEM_Int | MEM_Real) | MEM_IntReal) | MEM_Str)) == MEM_Str) { - goto __536 + goto __540 } applyNumericAffinity(tls, pIn3, 0) -__536: +__540: ; iKey = Xsqlite3VdbeIntValue(tls, pIn3) // Get the integer key value newType = (*Mem)(unsafe.Pointer(pIn3)).Fflags // Record the type after applying numeric affinity @@ -68657,30 +69022,30 @@ __536: // If the P3 value could not be converted into an integer without // loss of information, then special processing is required... if !((int32(newType) & (MEM_Int | MEM_IntReal)) == 0) { - goto __537 + goto __541 } if !((int32(newType) & MEM_Real) == 0) { - goto __538 + goto __542 } if !(((int32(newType) & MEM_Null) != 0) || (oc >= OP_SeekGE)) { - goto __540 + goto __544 } goto jump_to_p2 - goto __541 -__540: + goto __545 +__544: rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), bp+296 /* &res1 */) if !(rc != SQLITE_OK) { - goto __542 + goto __546 } goto abort_due_to_error -__542: +__546: ; goto seek_not_found -__541: +__545: ; - goto __539 -__538: + goto __543 +__542: // If the approximation iKey is larger than the actual real search // term, substitute >= for > and < for <=. e.g. if the search term @@ -68689,55 +69054,55 @@ __538: // (x > 4.9) -> (x >= 5) // (x <= 4.9) -> (x < 5) if !(*(*float64)(unsafe.Pointer(pIn3 /* &.u */)) < float64(iKey)) { - goto __543 + goto __547 } if !((oc & 0x0001) == (OP_SeekGT & 0x0001)) { - goto __545 + goto __549 } oc-- -__545: +__549: ; - goto __544 -__543: + goto __548 +__547: if !(*(*float64)(unsafe.Pointer(pIn3 /* &.u */)) > float64(iKey)) { - goto __546 + goto __550 } if !((oc & 0x0001) == (OP_SeekLT & 0x0001)) { - goto __547 + goto __551 } oc++ -__547: +__551: ; -__546: +__550: ; -__544: +__548: ; -__539: +__543: ; -__537: +__541: ; rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), uintptr(0), int64(U64(iKey)), 0, bp+296 /* &res1 */) (*VdbeCursor)(unsafe.Pointer(pC3)).FmovetoTarget = iKey // Used by OP_Delete if !(rc != SQLITE_OK) { - goto __548 + goto __552 } goto abort_due_to_error -__548: +__552: ; - goto __535 -__534: + goto __539 +__538: // For a cursor with the OPFLAG_SEEKEQ/BTREE_SEEK_EQ hint, only the // OP_SeekGE and OP_SeekLE opcodes are allowed, and these must be // immediately followed by an OP_IdxGT or OP_IdxLT opcode, respectively, // with the same key. - if !(Xsqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), BTREE_SEEK_EQ) != 0) { - goto __549 + if !(Xsqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), uint32(BTREE_SEEK_EQ)) != 0) { + goto __553 } eqOnly = 1 -__549: +__553: ; nField2 = *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)) @@ -68762,128 +69127,270 @@ __549: (*UnpackedRecord)(unsafe.Pointer(bp + 304 /* &r */)).FeqSeen = U8(0) rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), bp+304 /* &r */, int64(0), 0, bp+296 /* &res1 */) if !(rc != SQLITE_OK) { - goto __550 + goto __554 } goto abort_due_to_error -__550: +__554: ; if !((eqOnly != 0) && (int32((*UnpackedRecord)(unsafe.Pointer(bp+304 /* &r */)).FeqSeen) == 0)) { - goto __551 + goto __555 } goto seek_not_found -__551: +__555: ; -__535: +__539: ; atomic.AddInt32(&Xsqlite3_search_count, 1) if !(oc >= OP_SeekGE) { - goto __552 + goto __556 } if !((*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) < 0) || ((*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) == 0) && (oc == OP_SeekGT))) { - goto __554 + goto __558 } *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 0 rc = Xsqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), 0) if !(rc != SQLITE_OK) { - goto __556 + goto __560 } if !(rc == SQLITE_DONE) { - goto __557 + goto __561 } rc = SQLITE_OK *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 1 - goto __558 -__557: + goto __562 +__561: goto abort_due_to_error -__558: +__562: ; +__560: + ; + goto __559 +__558: + *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 0 +__559: + ; + goto __557 __556: - ; - goto __555 -__554: - *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 0 -__555: - ; - goto __553 -__552: ; if !((*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) > 0) || ((*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) == 0) && (oc == OP_SeekLT))) { - goto __559 + goto __563 } *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 0 rc = Xsqlite3BtreePrevious(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), 0) if !(rc != SQLITE_OK) { - goto __561 + goto __565 } if !(rc == SQLITE_DONE) { - goto __562 + goto __566 } rc = SQLITE_OK *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 1 - goto __563 -__562: + goto __567 +__566: goto abort_due_to_error +__567: + ; +__565: + ; + goto __564 __563: - ; -__561: - ; - goto __560 -__559: // res might be negative because the table is empty. Check to // see if this is the case. *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = Xsqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */))) -__560: +__564: ; -__553: +__557: ; seek_not_found: ; if !(*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) != 0) { - goto __564 + goto __568 } goto jump_to_p2 - goto __565 -__564: + goto __569 +__568: if !(eqOnly != 0) { - goto __566 + goto __570 } pOp += 32 // Skip the OP_IdxLt or OP_IdxGT that follows -__566: +__570: ; -__565: +__569: ; goto __10 - // Opcode: SeekHit P1 P2 * * * - // Synopsis: seekHit=P2 + // Opcode: SeekScan P1 P2 * * * + // Synopsis: Scan-ahead up to P1 rows // - // Set the seekHit flag on cursor P1 to the value in P2. - // The seekHit flag is used by the IfNoHope opcode. + // This opcode is a prefix opcode to OP_SeekGE. In other words, this + // opcode must be immediately followed by OP_SeekGE. This constraint is + // checked by assert() statements. // - // P1 must be a valid b-tree cursor. P2 must be a boolean value, - // either 0 or 1. -__93: + // This opcode uses the P1 through P4 operands of the subsequent + // OP_SeekGE. In the text that follows, the operands of the subsequent + // OP_SeekGE opcode are denoted as SeekOP.P1 through SeekOP.P4. Only + // the P1 and P2 operands of this opcode are also used, and are called + // This.P1 and This.P2. + // + // This opcode helps to optimize IN operators on a multi-column index + // where the IN operator is on the later terms of the index by avoiding + // unnecessary seeks on the btree, substituting steps to the next row + // of the b-tree instead. A correct answer is obtained if this opcode + // is omitted or is a no-op. + // + // The SeekGE.P3 and SeekGE.P4 operands identify an unpacked key which + // is the desired entry that we want the cursor SeekGE.P1 to be pointing + // to. Call this SeekGE.P4/P5 row the "target". + // + // If the SeekGE.P1 cursor is not currently pointing to a valid row, + // then this opcode is a no-op and control passes through into the OP_SeekGE. + // + // If the SeekGE.P1 cursor is pointing to a valid row, then that row + // might be the target row, or it might be near and slightly before the + // target row. This opcode attempts to position the cursor on the target + // row by, perhaps by invoking sqlite3BtreeStep() on the cursor + // between 0 and This.P1 times. + // + // There are three possible outcomes from this opcode:
      + // + //
    1. If after This.P1 steps, the cursor is still point to a place that + // is earlier in the btree than the target row, + // then fall through into the subsquence OP_SeekGE opcode. + // + //
    2. If the cursor is successfully moved to the target row by 0 or more + // sqlite3BtreeNext() calls, then jump to This.P2, which will land just + // past the OP_IdxGT opcode that follows the OP_SeekGE. + // + //
    3. If the cursor ends up past the target row (indicating the the target + // row does not exist in the btree) then jump to SeekOP.P2. + //
    +__94: ; - pC4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - libc.SetBitFieldPtr8Uint32(pC4+8 /* &.seekHit */, (Bool((*Op)(unsafe.Pointer(pOp)).Fp2 & 1)), 3, 0x8) + // pOp->p2 points to the first instruction past the OP_IdxGT that + // follows the OP_SeekGE. + + pC4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp+1*32)).Fp1)*8)) + + if !(!(Xsqlite3BtreeCursorIsValidNN(tls, *(*uintptr)(unsafe.Pointer(pC4 + 56 /* &.uc */))) != 0)) { + goto __571 + } + goto __10 +__571: + ; + nStep = (*Op)(unsafe.Pointer(pOp)).Fp1 + + (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC4)).FpKeyInfo + (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 1*32 + 16 /* &.p4 */))) + (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).Fdefault_rc = int8(0) + (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp+1*32)).Fp3)*56) + *(*int32)(unsafe.Pointer(bp + 352 /* res3 */)) = 0 // Not needed. Only used to silence a warning. +__572: + if !(1 != 0) { + goto __573 + } + rc = Xsqlite3VdbeIdxKeyCompare(tls, db, pC4, bp+328 /* &r1 */, bp+352 /* &res3 */) + if !(rc != 0) { + goto __574 + } + goto abort_due_to_error +__574: + ; + if !(*(*int32)(unsafe.Pointer(bp + 352 /* res3 */)) > 0) { + goto __575 + } +seekscan_search_fail: + ; + pOp += 32 + goto jump_to_p2 +__575: + ; + if !(*(*int32)(unsafe.Pointer(bp + 352 /* res3 */)) == 0) { + goto __576 + } + + goto jump_to_p2 + goto __573 +__576: + ; + if !(nStep <= 0) { + goto __577 + } + + goto __573 +__577: + ; + nStep-- + rc = Xsqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC4 + 56 /* &.uc */)), 0) + if !(rc != 0) { + goto __578 + } + if !(rc == SQLITE_DONE) { + goto __579 + } + rc = SQLITE_OK + goto seekscan_search_fail + goto __580 +__579: + goto abort_due_to_error +__580: + ; +__578: + ; + goto __572 +__573: + ; + + goto __10 + + // Opcode: SeekHit P1 P2 P3 * * + // Synopsis: set P2<=seekHit<=P3 + // + // Increase or decrease the seekHit value for cursor P1, if necessary, + // so that it is no less than P2 and no greater than P3. + // + // The seekHit integer represents the maximum of terms in an index for which + // there is known to be at least one match. If the seekHit value is smaller + // than the total number of equality terms in an index lookup, then the + // OP_IfNoHope opcode might run to see if the IN loop can be abandoned + // early, thus saving work. This is part of the IN-early-out optimization. + // + // P1 must be a valid b-tree cursor. +__95: + ; + pC5 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + + if !(int32((*VdbeCursor)(unsafe.Pointer(pC5)).FseekHit) < (*Op)(unsafe.Pointer(pOp)).Fp2) { + goto __581 + } + (*VdbeCursor)(unsafe.Pointer(pC5)).FseekHit = U16((*Op)(unsafe.Pointer(pOp)).Fp2) + goto __582 +__581: + if !(int32((*VdbeCursor)(unsafe.Pointer(pC5)).FseekHit) > (*Op)(unsafe.Pointer(pOp)).Fp3) { + goto __583 + } + (*VdbeCursor)(unsafe.Pointer(pC5)).FseekHit = U16((*Op)(unsafe.Pointer(pOp)).Fp3) +__583: + ; +__582: + ; goto __10 // Opcode: IfNotOpen P1 P2 * * * // Synopsis: if( !csr[P1] ) goto P2 // // If cursor P1 is not open, jump to instruction P2. Otherwise, fall through. -__94: // jump +__96: // jump ; if !(!(int32(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))) != 0)) { - goto __567 + goto __584 } goto jump_to_p2_and_check_for_interrupt -__567: +__584: ; goto __10 @@ -68925,16 +69432,20 @@ __567: // Synopsis: key=r[P3@P4] // // Register P3 is the first of P4 registers that form an unpacked - // record. + // record. Cursor P1 is an index btree. P2 is a jump destination. + // In other words, the operands to this opcode are the same as the + // operands to OP_NotFound and OP_IdxGT. // - // Cursor P1 is on an index btree. If the seekHit flag is set on P1, then - // this opcode is a no-op. But if the seekHit flag of P1 is clear, then - // check to see if there is any entry in P1 that matches the - // prefix identified by P3 and P4. If no entry matches the prefix, - // jump to P2. Otherwise fall through. + // This opcode is an optimization attempt only. If this opcode always + // falls through, the correct answer is still obtained, but extra works + // is performed. // - // This opcode behaves like OP_NotFound if the seekHit - // flag is clear and it behaves like OP_Noop if the seekHit flag is set. + // A value of N in the seekHit flag of cursor P1 means that there exists + // a key P3:N that will match some record in the index. We want to know + // if it is possible for a record P3:P4 to match some record in the + // index. If it is not possible, we can skips some work. So if seekHit + // is less than P4, attempt to find out if a match is possible by running + // OP_NotFound. // // This opcode is used in IN clause processing for a multi-column key. // If an IN clause is attached to an element of the key other than the @@ -68969,42 +69480,42 @@ __567: // opcodes do not work after this operation. // // See also: NotFound, Found, NotExists -__95: +__97: ; - pC5 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC6 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - if !((Bool(int32(*(*uint8)(unsafe.Pointer(pC5 + 8 /* &.seekHit */)) & 0x8 >> 3))) != 0) { - goto __568 + if !(int32((*VdbeCursor)(unsafe.Pointer(pC6)).FseekHit) >= *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) { + goto __585 } goto __10 -__568: +__585: ; -__96: // jump, in3 -__97: // jump, in3 -__98: +__98: // jump, in3 +__99: // jump, in3 +__100: if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) != OP_NoConflict) { - goto __569 + goto __586 } Xsqlite3_found_count++ -__569: +__586: ; - pC6 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC7 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)) > 0) { - goto __570 + goto __587 } - (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC6)).FpKeyInfo - (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) - (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FaMem = pIn3 - pIdxKey = bp + 328 /* &r1 */ + (*UnpackedRecord)(unsafe.Pointer(bp + 360 /* &r2 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC7)).FpKeyInfo + (*UnpackedRecord)(unsafe.Pointer(bp + 360 /* &r2 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) + (*UnpackedRecord)(unsafe.Pointer(bp + 360 /* &r2 */)).FaMem = pIn3 + pIdxKey = bp + 360 /* &r2 */ pFree = uintptr(0) - goto __571 -__570: + goto __588 +__587: ; rc = func() int32 { if (int32((*Mem)(unsafe.Pointer((pIn3))).Fflags) & MEM_Zero) != 0 { @@ -69014,88 +69525,94 @@ __570: }() if !(rc != 0) { - goto __572 + goto __589 } goto no_mem -__572: +__589: ; - pFree = libc.AssignUintptr(&pIdxKey, Xsqlite3VdbeAllocUnpackedRecord(tls, (*VdbeCursor)(unsafe.Pointer(pC6)).FpKeyInfo)) + pFree = libc.AssignUintptr(&pIdxKey, Xsqlite3VdbeAllocUnpackedRecord(tls, (*VdbeCursor)(unsafe.Pointer(pC7)).FpKeyInfo)) if !(pIdxKey == uintptr(0)) { - goto __573 + goto __590 } goto no_mem -__573: +__590: ; - Xsqlite3VdbeRecordUnpack(tls, (*VdbeCursor)(unsafe.Pointer(pC6)).FpKeyInfo, (*Mem)(unsafe.Pointer(pIn3)).Fn, (*Mem)(unsafe.Pointer(pIn3)).Fz, pIdxKey) -__571: + Xsqlite3VdbeRecordUnpack(tls, (*VdbeCursor)(unsafe.Pointer(pC7)).FpKeyInfo, (*Mem)(unsafe.Pointer(pIn3)).Fn, (*Mem)(unsafe.Pointer(pIn3)).Fz, pIdxKey) +__588: ; (*UnpackedRecord)(unsafe.Pointer(pIdxKey)).Fdefault_rc = int8(0) takeJump = 0 if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_NoConflict) { - goto __574 + goto __591 } // For the OP_NoConflict opcode, take the jump if any of the // input fields are NULL, since any key with a NULL will not // conflict ii1 = 0 -__575: +__592: if !(ii1 < int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField)) { - goto __577 + goto __594 } if !((int32((*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FaMem+uintptr(ii1)*56)).Fflags) & MEM_Null) != 0) { - goto __578 + goto __595 } takeJump = 1 - goto __577 -__578: + goto __594 +__595: ; - goto __576 -__576: + goto __593 +__593: ii1++ - goto __575 - goto __577 -__577: + goto __592 + goto __594 +__594: ; -__574: +__591: ; - rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC6 + 56 /* &.uc */)), pIdxKey, int64(0), 0, bp+352 /* &res3 */) + rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC7 + 56 /* &.uc */)), pIdxKey, int64(0), 0, bp+384 /* &res4 */) if !(pFree != 0) { - goto __579 + goto __596 } Xsqlite3DbFreeNN(tls, db, pFree) -__579: +__596: ; if !(rc != SQLITE_OK) { - goto __580 + goto __597 } goto abort_due_to_error -__580: +__597: ; - (*VdbeCursor)(unsafe.Pointer(pC6)).FseekResult = *(*int32)(unsafe.Pointer(bp + 352 /* res3 */)) - alreadyExists = (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 352 /* res3 */)) == 0)) - (*VdbeCursor)(unsafe.Pointer(pC6)).FnullRow = (U8(1 - alreadyExists)) - (*VdbeCursor)(unsafe.Pointer(pC6)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC6)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC7)).FseekResult = *(*int32)(unsafe.Pointer(bp + 384 /* res4 */)) + alreadyExists = (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 384 /* res4 */)) == 0)) + (*VdbeCursor)(unsafe.Pointer(pC7)).FnullRow = (U8(1 - alreadyExists)) + (*VdbeCursor)(unsafe.Pointer(pC7)).FdeferredMoveto = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC7)).FcacheStatus = U32(CACHE_STALE) if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_Found) { - goto __581 + goto __598 } if !(alreadyExists != 0) { - goto __583 + goto __600 } goto jump_to_p2 -__583: +__600: ; - goto __582 -__581: + goto __599 +__598: ; if !((takeJump != 0) || !(alreadyExists != 0)) { - goto __584 + goto __601 } goto jump_to_p2 -__584: +__601: ; -__582: + if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_IfNoHope) { + goto __602 + } + (*VdbeCursor)(unsafe.Pointer(pC7)).FseekHit = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) +__602: + ; +__599: ; goto __10 @@ -69144,68 +69661,68 @@ __582: // not work following this opcode. // // See also: Found, NotFound, NoConflict, SeekRowid -__99: +__101: pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !((int32((*Mem)(unsafe.Pointer(pIn3)).Fflags) & (MEM_Int | MEM_IntReal)) == 0) { - goto __585 + goto __603 } // If pIn3->u.i does not contain an integer, compute iKey as the // integer value of pIn3. Jump to P2 if pIn3 cannot be converted // into an integer without loss of information. Take care to avoid // changing the datatype of pIn3, however, as it is used by other // parts of the prepared statement. - *(*Mem)(unsafe.Pointer(bp + 360 /* x */)) = *(*Mem)(unsafe.Pointer(pIn3)) - applyAffinity(tls, bp+360 /* &x */, SQLITE_AFF_NUMERIC, encoding) - if !((int32((*Mem)(unsafe.Pointer(bp+360 /* &x */)).Fflags) & MEM_Int) == 0) { - goto __586 + *(*Mem)(unsafe.Pointer(bp + 392 /* x */)) = *(*Mem)(unsafe.Pointer(pIn3)) + applyAffinity(tls, bp+392 /* &x */, int8(SQLITE_AFF_NUMERIC), encoding) + if !((int32((*Mem)(unsafe.Pointer(bp+392 /* &x */)).Fflags) & MEM_Int) == 0) { + goto __604 } goto jump_to_p2 -__586: +__604: ; - iKey1 = U64(*(*I64)(unsafe.Pointer(bp + 360 /* &x */ /* &.u */))) + iKey1 = U64(*(*I64)(unsafe.Pointer(bp + 392 /* &x */ /* &.u */))) goto notExistsWithKey -__585: +__603: ; -__100: // jump, in3 +__102: // jump, in3 pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) iKey1 = U64(*(*I64)(unsafe.Pointer(pIn3 /* &.u */))) notExistsWithKey: - pC7 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC8 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pCrsr2 = *(*uintptr)(unsafe.Pointer(pC7 + 56 /* &.uc */)) + pCrsr2 = *(*uintptr)(unsafe.Pointer(pC8 + 56 /* &.uc */)) - *(*int32)(unsafe.Pointer(bp + 416 /* res4 */)) = 0 - rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr2, uintptr(0), int64(iKey1), 0, bp+416 /* &res4 */) + *(*int32)(unsafe.Pointer(bp + 448 /* res5 */)) = 0 + rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr2, uintptr(0), int64(iKey1), 0, bp+448 /* &res5 */) - (*VdbeCursor)(unsafe.Pointer(pC7)).FmovetoTarget = I64(iKey1) // Used by OP_Delete - (*VdbeCursor)(unsafe.Pointer(pC7)).FnullRow = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC7)).FcacheStatus = CACHE_STALE - (*VdbeCursor)(unsafe.Pointer(pC7)).FdeferredMoveto = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC8)).FmovetoTarget = I64(iKey1) // Used by OP_Delete + (*VdbeCursor)(unsafe.Pointer(pC8)).FnullRow = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC8)).FcacheStatus = U32(CACHE_STALE) + (*VdbeCursor)(unsafe.Pointer(pC8)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC7)).FseekResult = *(*int32)(unsafe.Pointer(bp + 416 /* res4 */)) - if !(*(*int32)(unsafe.Pointer(bp + 416 /* res4 */)) != 0) { - goto __587 + (*VdbeCursor)(unsafe.Pointer(pC8)).FseekResult = *(*int32)(unsafe.Pointer(bp + 448 /* res5 */)) + if !(*(*int32)(unsafe.Pointer(bp + 448 /* res5 */)) != 0) { + goto __605 } if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 0) { - goto __588 + goto __606 } - rc = Xsqlite3CorruptError(tls, 90022) - goto __589 -__588: + rc = Xsqlite3CorruptError(tls, 90810) + goto __607 +__606: goto jump_to_p2 -__589: +__607: ; -__587: +__605: ; if !(rc != 0) { - goto __590 + goto __608 } goto abort_due_to_error -__590: +__608: ; goto __10 @@ -69216,7 +69733,7 @@ __590: // Write the sequence number into register P2. // The sequence number on the cursor is incremented after this // instruction. -__101: // out2 +__103: // out2 ; pOut = out2Prerelease(tls, p, pOp) @@ -69237,13 +69754,13 @@ __101: // out2 // an SQLITE_FULL error is generated. The P3 register is updated with the ' // generated record number. This P3 mechanism is used to help implement the // AUTOINCREMENT feature. -__102: // Root frame of VDBE +__104: // Root frame of VDBE - *(*I64)(unsafe.Pointer(bp + 424 /* v */)) = int64(0) - *(*int32)(unsafe.Pointer(bp + 420 /* res5 */)) = 0 + *(*I64)(unsafe.Pointer(bp + 456 /* v */)) = int64(0) + *(*int32)(unsafe.Pointer(bp + 452 /* res6 */)) = 0 pOut = out2Prerelease(tls, p, pOp) - pC8 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC9 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) // The next rowid or record number (different terms for the same // thing) is obtained in a two-step algorithm. @@ -69262,90 +69779,90 @@ __102: // Root frame of VDBE // Others complain about 0x7ffffffffffffffffLL. The following macro seems // to provide the constant while making all compilers happy. - if !(!((int32(*(*uint8)(unsafe.Pointer(pC8 + 8 /* &.useRandomRowid */)) & 0x2 >> 1)) != 0)) { - goto __591 + if !(!((int32(*(*uint8)(unsafe.Pointer(pC9 + 8 /* &.useRandomRowid */)) & 0x2 >> 1)) != 0)) { + goto __609 } - rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC8 + 56 /* &.uc */)), bp+420 /* &res5 */) + rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC9 + 56 /* &.uc */)), bp+452 /* &res6 */) if !(rc != SQLITE_OK) { - goto __592 + goto __610 } goto abort_due_to_error -__592: +__610: ; - if !(*(*int32)(unsafe.Pointer(bp + 420 /* res5 */)) != 0) { - goto __593 + if !(*(*int32)(unsafe.Pointer(bp + 452 /* res6 */)) != 0) { + goto __611 } - *(*I64)(unsafe.Pointer(bp + 424 /* v */)) = int64(1) // IMP: R-61914-48074 - goto __594 -__593: + *(*I64)(unsafe.Pointer(bp + 456 /* v */)) = int64(1) // IMP: R-61914-48074 + goto __612 +__611: ; - *(*I64)(unsafe.Pointer(bp + 424 /* v */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC8 + 56 /* &.uc */))) - if !(*(*I64)(unsafe.Pointer(bp + 424 /* v */)) >= (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) { - goto __595 + *(*I64)(unsafe.Pointer(bp + 456 /* v */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC9 + 56 /* &.uc */))) + if !(*(*I64)(unsafe.Pointer(bp + 456 /* v */)) >= (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) { + goto __613 } - libc.SetBitFieldPtr8Uint32(pC8+8 /* &.useRandomRowid */, Bool(1), 1, 0x2) - goto __596 -__595: - *(*I64)(unsafe.Pointer(bp + 424 /* v */))++ // IMP: R-29538-34987 -__596: + libc.SetBitFieldPtr8Uint32(pC9+8 /* &.useRandomRowid */, Bool(1), 1, 0x2) + goto __614 +__613: + *(*I64)(unsafe.Pointer(bp + 456 /* v */))++ // IMP: R-29538-34987 +__614: ; -__594: +__612: ; -__591: +__609: ; if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) { - goto __597 + goto __615 } // Assert that P3 is a valid memory cell. if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) { - goto __598 + goto __616 } pFrame1 = (*Vdbe)(unsafe.Pointer(p)).FpFrame -__600: +__618: if !((*VdbeFrame)(unsafe.Pointer(pFrame1)).FpParent != 0) { - goto __602 + goto __620 } - goto __601 -__601: + goto __619 +__619: pFrame1 = (*VdbeFrame)(unsafe.Pointer(pFrame1)).FpParent - goto __600 - goto __602 -__602: + goto __618 + goto __620 +__620: ; // Assert that P3 is a valid memory cell. pMem1 = ((*VdbeFrame)(unsafe.Pointer(pFrame1)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - goto __599 -__598: + goto __617 +__616: // Assert that P3 is a valid memory cell. ; pMem1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) -__599: +__617: ; Xsqlite3VdbeMemIntegerify(tls, pMem1) // mem(P3) holds an integer - if !((*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) == (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) || ((Bool(int32(*(*uint8)(unsafe.Pointer(pC8 + 8 /* &.useRandomRowid */)) & 0x2 >> 1))) != 0)) { - goto __603 + if !((*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) == (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) || ((Bool(int32(*(*uint8)(unsafe.Pointer(pC9 + 8 /* &.useRandomRowid */)) & 0x2 >> 1))) != 0)) { + goto __621 } rc = SQLITE_FULL // IMP: R-17817-00630 goto abort_due_to_error -__603: +__621: ; - if !(*(*I64)(unsafe.Pointer(bp + 424 /* v */)) < (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1))) { - goto __604 + if !(*(*I64)(unsafe.Pointer(bp + 456 /* v */)) < (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1))) { + goto __622 } - *(*I64)(unsafe.Pointer(bp + 424 /* v */)) = (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1)) -__604: + *(*I64)(unsafe.Pointer(bp + 456 /* v */)) = (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1)) +__622: ; - *(*I64)(unsafe.Pointer(pMem1 /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 424 /* v */)) -__597: + *(*I64)(unsafe.Pointer(pMem1 /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 456 /* v */)) +__615: ; - if !((Bool(int32(*(*uint8)(unsafe.Pointer(pC8 + 8 /* &.useRandomRowid */)) & 0x2 >> 1))) != 0) { - goto __605 + if !((Bool(int32(*(*uint8)(unsafe.Pointer(pC9 + 8 /* &.useRandomRowid */)) & 0x2 >> 1))) != 0) { + goto __623 } // IMPLEMENTATION-OF: R-07677-41881 If the largest ROWID is equal to the // largest possible integer (9223372036854775807) then the database @@ -69354,41 +69871,41 @@ __597: // We cannot be in random rowid mode if this is // an AUTOINCREMENT table. cnt1 = 0 -__606: - Xsqlite3_randomness(tls, int32(unsafe.Sizeof(I64(0))), bp+424 /* &v */) - *(*I64)(unsafe.Pointer(bp + 424 /* v */)) &= (I64((int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) >> 1) - *(*I64)(unsafe.Pointer(bp + 424 /* v */))++ // Ensure that v is greater than zero - goto __607 -__607: - if (((libc.AssignInt32(&rc, Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC8 + 56 /* &.uc */)), uintptr(0), int64(U64(*(*I64)(unsafe.Pointer(bp + 424 /* v */)))), - 0, bp+420 /* &res5 */))) == SQLITE_OK) && - (*(*int32)(unsafe.Pointer(bp + 420 /* res5 */)) == 0)) && +__624: + Xsqlite3_randomness(tls, int32(unsafe.Sizeof(I64(0))), bp+456 /* &v */) + *(*I64)(unsafe.Pointer(bp + 456 /* v */)) &= (I64((int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) >> 1) + *(*I64)(unsafe.Pointer(bp + 456 /* v */))++ // Ensure that v is greater than zero + goto __625 +__625: + if (((libc.AssignInt32(&rc, Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC9 + 56 /* &.uc */)), uintptr(0), int64(U64(*(*I64)(unsafe.Pointer(bp + 456 /* v */)))), + 0, bp+452 /* &res6 */))) == SQLITE_OK) && + (*(*int32)(unsafe.Pointer(bp + 452 /* res6 */)) == 0)) && (libc.PreIncInt32(&cnt1, 1) < 100) { - goto __606 + goto __624 } - goto __608 -__608: + goto __626 +__626: ; if !(rc != 0) { - goto __609 + goto __627 } goto abort_due_to_error -__609: +__627: ; - if !(*(*int32)(unsafe.Pointer(bp + 420 /* res5 */)) == 0) { - goto __610 + if !(*(*int32)(unsafe.Pointer(bp + 452 /* res6 */)) == 0) { + goto __628 } rc = SQLITE_FULL // IMP: R-38219-53002 goto abort_due_to_error -__610: +__628: ; // EV: R-40812-03570 -__605: +__623: ; - (*VdbeCursor)(unsafe.Pointer(pC8)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC8)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC9)).FdeferredMoveto = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC9)).FcacheStatus = U32(CACHE_STALE) - *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 424 /* v */)) + *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 456 /* v */)) goto __10 // Opcode: Insert P1 P2 P3 P4 P5 @@ -69427,112 +69944,142 @@ __605: // // This instruction only works on tables. The equivalent instruction // for indices is OP_IdxInsert. -__103: // Payload to be inserted +__105: // Payload to be inserted pData = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) - pC9 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC10 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) pKey = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnKey = *(*I64)(unsafe.Pointer(pKey /* &.u */)) + (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FnKey = *(*I64)(unsafe.Pointer(pKey /* &.u */)) if !((int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-6)) && (((*Sqlite3)(unsafe.Pointer((db))).FxPreUpdateCallback != 0) || ((*Sqlite3)(unsafe.Pointer((db))).FxUpdateCallback != 0))) { - goto __611 + goto __629 } - zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC9)).FiDb)*32)).FzDbSName + zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC10)).FiDb)*32)).FzDbSName pTab = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - goto __612 -__611: + goto __630 +__629: pTab = uintptr(0) zDb = uintptr(0) // Not needed. Silence a compiler warning. -__612: +__630: ; // Invoke the pre-update hook, if any if !(pTab != 0) { - goto __613 + goto __631 } if !(((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0) && !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_ISUPDATE) != 0)) { - goto __614 + goto __632 } - Xsqlite3VdbePreUpdateHook(tls, p, pC9, SQLITE_INSERT, zDb, pTab, (*BtreePayload)(unsafe.Pointer(bp+432 /* &x1 */)).FnKey, (*Op)(unsafe.Pointer(pOp)).Fp2) -__614: + Xsqlite3VdbePreUpdateHook(tls, p, pC10, SQLITE_INSERT, zDb, pTab, (*BtreePayload)(unsafe.Pointer(bp+464 /* &x1 */)).FnKey, (*Op)(unsafe.Pointer(pOp)).Fp2) +__632: ; if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback == uintptr(0)) || ((*Table)(unsafe.Pointer(pTab)).FaCol == uintptr(0))) { - goto __615 + goto __633 } // Prevent post-update hook from running in cases when it should not pTab = uintptr(0) -__615: +__633: ; -__613: +__631: ; if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_ISNOOP) != 0) { - goto __616 + goto __634 } goto __10 -__616: +__634: ; if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_NCHANGE) != 0) { - goto __617 + goto __635 } (*Vdbe)(unsafe.Pointer(p)).FnChange++ -__617: +__635: ; if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_LASTROWID) != 0) { - goto __618 + goto __636 } - (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnKey -__618: + (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FnKey +__636: ; - (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FpData = (*Mem)(unsafe.Pointer(pData)).Fz - (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnData = (*Mem)(unsafe.Pointer(pData)).Fn + (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FpData = (*Mem)(unsafe.Pointer(pData)).Fz + (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FnData = (*Mem)(unsafe.Pointer(pData)).Fn seekResult = func() int32 { if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_USESEEKRESULT) != 0 { - return (*VdbeCursor)(unsafe.Pointer(pC9)).FseekResult + return (*VdbeCursor)(unsafe.Pointer(pC10)).FseekResult } return 0 }() if !((int32((*Mem)(unsafe.Pointer(pData)).Fflags) & MEM_Zero) != 0) { - goto __619 + goto __637 } - (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnZero = *(*int32)(unsafe.Pointer(pData /* &.u */)) - goto __620 -__619: - (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnZero = 0 -__620: + (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FnZero = *(*int32)(unsafe.Pointer(pData /* &.u */)) + goto __638 +__637: + (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FnZero = 0 +__638: ; - (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FpKey = uintptr(0) - rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC9 + 56 /* &.uc */)), bp+432, /* &x1 */ - (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (OPFLAG_APPEND | OPFLAG_SAVEPOSITION)), seekResult) - (*VdbeCursor)(unsafe.Pointer(pC9)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC9)).FcacheStatus = CACHE_STALE + (*BtreePayload)(unsafe.Pointer(bp + 464 /* &x1 */)).FpKey = uintptr(0) + rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC10 + 56 /* &.uc */)), bp+464, /* &x1 */ + (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & ((OPFLAG_APPEND | OPFLAG_SAVEPOSITION) | OPFLAG_PREFORMAT)), + seekResult) + (*VdbeCursor)(unsafe.Pointer(pC10)).FdeferredMoveto = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC10)).FcacheStatus = U32(CACHE_STALE) // Invoke the update-hook if required. if !(rc != 0) { - goto __621 + goto __639 } goto abort_due_to_error -__621: +__639: ; if !(pTab != 0) { - goto __622 + goto __640 } - (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 304 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, + (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 312 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, func() int32 { if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_ISUPDATE) != 0 { return SQLITE_UPDATE } return SQLITE_INSERT }(), - zDb, (*Table)(unsafe.Pointer(pTab)).FzName, (*BtreePayload)(unsafe.Pointer(bp+432 /* &x1 */)).FnKey) -__622: + zDb, (*Table)(unsafe.Pointer(pTab)).FzName, (*BtreePayload)(unsafe.Pointer(bp+464 /* &x1 */)).FnKey) +__640: + ; + goto __10 + + // Opcode: RowCell P1 P2 P3 * * + // + // P1 and P2 are both open cursors. Both must be opened on the same type + // of table - intkey or index. This opcode is used as part of copying + // the current row from P2 into P1. If the cursors are opened on intkey + // tables, register P3 contains the rowid to use with the new record in + // P1. If they are opened on index tables, P3 is not used. + // + // This opcode must be followed by either an Insert or InsertIdx opcode + // with the OPFLAG_PREFORMAT flag set to complete the insert operation. +__106: // Rowid value to insert with + ; + + pDest1 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pSrc = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*8)) + if (*Op)(unsafe.Pointer(pOp)).Fp3 != 0 { + iKey2 = *(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56 /* &.u */)) + } else { + iKey2 = int64(0) + } + rc = Xsqlite3BtreeTransferRow(tls, *(*uintptr)(unsafe.Pointer(pDest1 + 56 /* &.uc */)), *(*uintptr)(unsafe.Pointer(pSrc + 56 /* &.uc */)), iKey2) + if !(rc != SQLITE_OK) { + goto __641 + } + goto abort_due_to_error +__641: ; goto __10 @@ -69570,11 +70117,11 @@ __622: // If the OPFLAG_ISUPDATE flag is set in P2, then P3 contains the address // of the memory cell that contains the value that the rowid of the row will // be set to by the update. -__104: +__107: opflags = (*Op)(unsafe.Pointer(pOp)).Fp2 - pC10 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC11 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) // If the update-hook or pre-update-hook will be invoked, set zDb to // the name of the db to pass as to it. Also set local pTab to a copy @@ -69582,73 +70129,73 @@ __104: // last moved with OP_Next or OP_Prev, not Seek or NotFound, set // VdbeCursor.movetoTarget to the current rowid. if !((int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-6)) && (((*Sqlite3)(unsafe.Pointer((db))).FxPreUpdateCallback != 0) || ((*Sqlite3)(unsafe.Pointer((db))).FxUpdateCallback != 0))) { - goto __623 + goto __642 } - zDb1 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC10)).FiDb)*32)).FzDbSName + zDb1 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC11)).FiDb)*32)).FzDbSName pTab1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - if !(((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_SAVEPOSITION) != 0) && ((*VdbeCursor)(unsafe.Pointer(pC10)).FisTable != 0)) { - goto __625 + if !(((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_SAVEPOSITION) != 0) && ((*VdbeCursor)(unsafe.Pointer(pC11)).FisTable != 0)) { + goto __644 } - (*VdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC10 + 56 /* &.uc */))) -__625: + (*VdbeCursor)(unsafe.Pointer(pC11)).FmovetoTarget = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC11 + 56 /* &.uc */))) +__644: ; - goto __624 -__623: + goto __643 +__642: zDb1 = uintptr(0) // Not needed. Silence a compiler warning. pTab1 = uintptr(0) // Not needed. Silence a compiler warning. -__624: +__643: ; // Invoke the pre-update-hook if required. if !(((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0) && (*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) != 0)) { - goto __626 + goto __645 } - Xsqlite3VdbePreUpdateHook(tls, p, pC10, + Xsqlite3VdbePreUpdateHook(tls, p, pC11, func() int32 { if (opflags & OPFLAG_ISUPDATE) != 0 { return SQLITE_UPDATE } return SQLITE_DELETE }(), - zDb1, pTab1, (*VdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget, + zDb1, pTab1, (*VdbeCursor)(unsafe.Pointer(pC11)).FmovetoTarget, (*Op)(unsafe.Pointer(pOp)).Fp3) -__626: +__645: ; if !((opflags & OPFLAG_ISNOOP) != 0) { - goto __627 + goto __646 } goto __10 -__627: +__646: ; // Only flags that can be set are SAVEPOISTION and AUXDELETE - rc = Xsqlite3BtreeDelete(tls, *(*uintptr)(unsafe.Pointer(pC10 + 56 /* &.uc */)), uint8((*Op)(unsafe.Pointer(pOp)).Fp5)) - (*VdbeCursor)(unsafe.Pointer(pC10)).FcacheStatus = CACHE_STALE - (*VdbeCursor)(unsafe.Pointer(pC10)).FseekResult = 0 + rc = Xsqlite3BtreeDelete(tls, *(*uintptr)(unsafe.Pointer(pC11 + 56 /* &.uc */)), uint8((*Op)(unsafe.Pointer(pOp)).Fp5)) + (*VdbeCursor)(unsafe.Pointer(pC11)).FcacheStatus = U32(CACHE_STALE) + (*VdbeCursor)(unsafe.Pointer(pC11)).FseekResult = 0 if !(rc != 0) { - goto __628 + goto __647 } goto abort_due_to_error -__628: +__647: ; // Invoke the update-hook if required. if !((opflags & OPFLAG_NCHANGE) != 0) { - goto __629 + goto __648 } (*Vdbe)(unsafe.Pointer(p)).FnChange++ - if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0) && (((*Table)(unsafe.Pointer((pTab1))).FtabFlags & TF_WithoutRowid) == U32(0))) { - goto __630 + if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0) && (((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { + goto __649 } - (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 304 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, SQLITE_DELETE, zDb1, (*Table)(unsafe.Pointer(pTab1)).FzName, - (*VdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget) + (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 312 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, SQLITE_DELETE, zDb1, (*Table)(unsafe.Pointer(pTab1)).FzName, + (*VdbeCursor)(unsafe.Pointer(pC11)).FmovetoTarget) -__630: +__649: ; -__629: +__648: ; goto __10 @@ -69659,7 +70206,7 @@ __629: // change counter (returned by subsequent calls to sqlite3_changes()). // Then the VMs internal change counter resets to 0. // This is used by trigger programs. -__105: +__108: Xsqlite3VdbeSetChanges(tls, db, (*Vdbe)(unsafe.Pointer(p)).FnChange) (*Vdbe)(unsafe.Pointer(p)).FnChange = 0 goto __10 @@ -69678,26 +70225,26 @@ __105: // // Fall through to next instruction if the two records compare equal to // each other. Jump to P2 if they are different. -__106: +__109: - pC11 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC12 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) nKeyCol = *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - *(*int32)(unsafe.Pointer(bp + 480 /* res6 */)) = 0 - rc = Xsqlite3VdbeSorterCompare(tls, pC11, pIn3, nKeyCol, bp+480 /* &res6 */) + *(*int32)(unsafe.Pointer(bp + 512 /* res7 */)) = 0 + rc = Xsqlite3VdbeSorterCompare(tls, pC12, pIn3, nKeyCol, bp+512 /* &res7 */) if !(rc != 0) { - goto __631 + goto __650 } goto abort_due_to_error -__631: +__650: ; - if !(*(*int32)(unsafe.Pointer(bp + 480 /* res6 */)) != 0) { - goto __632 + if !(*(*int32)(unsafe.Pointer(bp + 512 /* res7 */)) != 0) { + goto __651 } goto jump_to_p2 -__632: +__651: ; goto __10 @@ -69712,20 +70259,20 @@ __632: // OpenPseudo. That pseudo-table cursor is the one that is identified by // parameter P3. Clearing the P3 column cache as part of this opcode saves // us from having to issue a separate NullRow instruction to clear that cache. -__107: +__110: pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) - pC12 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC13 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - rc = Xsqlite3VdbeSorterRowkey(tls, pC12, pOut) + rc = Xsqlite3VdbeSorterRowkey(tls, pC13, pOut) if !(rc != 0) { - goto __633 + goto __652 } goto abort_due_to_error -__633: +__652: ; - (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8)))).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8)))).FcacheStatus = U32(CACHE_STALE) goto __10 // Opcode: RowData P1 P2 P3 * * @@ -69755,13 +70302,13 @@ __633: // in OP_Result and any OP_Result will invalidate the P2 register content. // The P2 register content is invalidated by opcodes like OP_Function or // by any use of another cursor pointing to the same table. -__108: +__111: pOut = out2Prerelease(tls, p, pOp) - pC13 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC14 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pCrsr3 = *(*uintptr)(unsafe.Pointer(pC13 + 56 /* &.uc */)) + pCrsr3 = *(*uintptr)(unsafe.Pointer(pC14 + 56 /* &.uc */)) // The OP_RowData opcodes always follow OP_NotExists or // OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions @@ -69772,30 +70319,30 @@ __108: // sqlite3VdbeCursorMoveto(). n3 = Xsqlite3BtreePayloadSize(tls, pCrsr3) - if !(n3 > U32(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */))))) { - goto __634 + if !(n3 > U32(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */))))) { + goto __653 } goto too_big -__634: +__653: ; rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCrsr3, n3, pOut) if !(rc != 0) { - goto __635 + goto __654 } goto abort_due_to_error -__635: +__654: ; if !(!((*Op)(unsafe.Pointer(pOp)).Fp3 != 0)) { - goto __636 + goto __655 } if !(((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & MEM_Ephem) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0)) { - goto __637 + goto __656 } goto no_mem -__637: +__656: ; -__636: +__655: ; updateMaxBlobsize(tls, pOut) @@ -69811,66 +70358,66 @@ __636: // P1 can be either an ordinary table or a virtual table. There used to // be a separate OP_VRowid opcode for use with virtual tables, but this // one opcode now works for both table types. -__109: +__112: pOut = out2Prerelease(tls, p, pOp) - pC14 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC15 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - if !((*VdbeCursor)(unsafe.Pointer(pC14)).FnullRow != 0) { - goto __638 + if !((*VdbeCursor)(unsafe.Pointer(pC15)).FnullRow != 0) { + goto __657 } - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) goto __10 - goto __639 -__638: - if !((*VdbeCursor)(unsafe.Pointer(pC14)).FdeferredMoveto != 0) { - goto __640 + goto __658 +__657: + if !((*VdbeCursor)(unsafe.Pointer(pC15)).FdeferredMoveto != 0) { + goto __659 } - *(*I64)(unsafe.Pointer(bp + 488 /* v3 */)) = (*VdbeCursor)(unsafe.Pointer(pC14)).FmovetoTarget - goto __641 -__640: - if !(int32((*VdbeCursor)(unsafe.Pointer(pC14)).FeCurType) == CURTYPE_VTAB) { - goto __642 + *(*I64)(unsafe.Pointer(bp + 520 /* v3 */)) = (*VdbeCursor)(unsafe.Pointer(pC15)).FmovetoTarget + goto __660 +__659: + if !(int32((*VdbeCursor)(unsafe.Pointer(pC15)).FeCurType) == CURTYPE_VTAB) { + goto __661 } - pVtab = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pC14 + 56 /* &.uc */)))).FpVtab + pVtab = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pC15 + 56 /* &.uc */)))).FpVtab pModule = (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule - rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pModule + 96 /* &.xRowid */))))(tls, *(*uintptr)(unsafe.Pointer(pC14 + 56 /* &.uc */)), bp+488 /* &v3 */) + rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pModule + 96 /* &.xRowid */))))(tls, *(*uintptr)(unsafe.Pointer(pC15 + 56 /* &.uc */)), bp+520 /* &v3 */) Xsqlite3VtabImportErrmsg(tls, p, pVtab) if !(rc != 0) { - goto __644 + goto __663 } goto abort_due_to_error -__644: +__663: ; - goto __643 -__642: + goto __662 +__661: ; - rc = Xsqlite3VdbeCursorRestore(tls, pC14) + rc = Xsqlite3VdbeCursorRestore(tls, pC15) if !(rc != 0) { - goto __645 + goto __664 } goto abort_due_to_error -__645: +__664: ; - if !((*VdbeCursor)(unsafe.Pointer(pC14)).FnullRow != 0) { - goto __646 + if !((*VdbeCursor)(unsafe.Pointer(pC15)).FnullRow != 0) { + goto __665 } - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) goto __10 -__646: +__665: ; - *(*I64)(unsafe.Pointer(bp + 488 /* v3 */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC14 + 56 /* &.uc */))) -__643: + *(*I64)(unsafe.Pointer(bp + 520 /* v3 */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC15 + 56 /* &.uc */))) +__662: ; -__641: +__660: ; -__639: +__658: ; - *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 488 /* v3 */)) + *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 520 /* v3 */)) goto __10 // Opcode: NullRow P1 * * * * @@ -69878,18 +70425,18 @@ __639: // Move the cursor P1 to a null row. Any OP_Column operations // that occur while the cursor is on the null row will always // write a NULL. -__110: +__113: ; - pC15 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC16 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - (*VdbeCursor)(unsafe.Pointer(pC15)).FnullRow = U8(1) - (*VdbeCursor)(unsafe.Pointer(pC15)).FcacheStatus = CACHE_STALE - if !(int32((*VdbeCursor)(unsafe.Pointer(pC15)).FeCurType) == CURTYPE_BTREE) { - goto __647 + (*VdbeCursor)(unsafe.Pointer(pC16)).FnullRow = U8(1) + (*VdbeCursor)(unsafe.Pointer(pC16)).FcacheStatus = U32(CACHE_STALE) + if !(int32((*VdbeCursor)(unsafe.Pointer(pC16)).FeCurType) == CURTYPE_BTREE) { + goto __666 } - Xsqlite3BtreeClearCursor(tls, *(*uintptr)(unsafe.Pointer(pC15 + 56 /* &.uc */))) -__647: + Xsqlite3BtreeClearCursor(tls, *(*uintptr)(unsafe.Pointer(pC16 + 56 /* &.uc */))) +__666: ; goto __10 @@ -69913,48 +70460,48 @@ __647: // This opcode leaves the cursor configured to move in reverse order, // from the end toward the beginning. In other words, the cursor is // configured to use Prev, not Next. -__111: -__112: +__114: +__115: ; - pC16 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC17 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pCrsr4 = *(*uintptr)(unsafe.Pointer(pC16 + 56 /* &.uc */)) - *(*int32)(unsafe.Pointer(bp + 496 /* res7 */)) = 0 + pCrsr4 = *(*uintptr)(unsafe.Pointer(pC17 + 56 /* &.uc */)) + *(*int32)(unsafe.Pointer(bp + 528 /* res8 */)) = 0 if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_SeekEnd) { - goto __648 + goto __667 } - (*VdbeCursor)(unsafe.Pointer(pC16)).FseekResult = -1 + (*VdbeCursor)(unsafe.Pointer(pC17)).FseekResult = -1 if !(Xsqlite3BtreeCursorIsValidNN(tls, pCrsr4) != 0) { - goto __649 + goto __668 } goto __10 -__649: +__668: ; -__648: +__667: ; - rc = Xsqlite3BtreeLast(tls, pCrsr4, bp+496 /* &res7 */) - (*VdbeCursor)(unsafe.Pointer(pC16)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 496 /* res7 */))) - (*VdbeCursor)(unsafe.Pointer(pC16)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC16)).FcacheStatus = CACHE_STALE + rc = Xsqlite3BtreeLast(tls, pCrsr4, bp+528 /* &res8 */) + (*VdbeCursor)(unsafe.Pointer(pC17)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 528 /* res8 */))) + (*VdbeCursor)(unsafe.Pointer(pC17)).FdeferredMoveto = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC17)).FcacheStatus = U32(CACHE_STALE) if !(rc != 0) { - goto __650 + goto __669 } goto abort_due_to_error -__650: +__669: ; if !((*Op)(unsafe.Pointer(pOp)).Fp2 > 0) { - goto __651 + goto __670 } - if !(*(*int32)(unsafe.Pointer(bp + 496 /* res7 */)) != 0) { - goto __652 + if !(*(*int32)(unsafe.Pointer(bp + 528 /* res8 */)) != 0) { + goto __671 } goto jump_to_p2 -__652: +__671: ; -__651: +__670: ; goto __10 @@ -69962,37 +70509,37 @@ __651: // // Estimate the number of rows in the table P1. Jump to P2 if that // estimate is less than approximately 2**(0.1*P3). -__113: +__116: ; - pC17 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC18 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pCrsr5 = *(*uintptr)(unsafe.Pointer(pC17 + 56 /* &.uc */)) + pCrsr5 = *(*uintptr)(unsafe.Pointer(pC18 + 56 /* &.uc */)) - rc = Xsqlite3BtreeFirst(tls, pCrsr5, bp+500 /* &res8 */) + rc = Xsqlite3BtreeFirst(tls, pCrsr5, bp+532 /* &res9 */) if !(rc != 0) { - goto __653 + goto __672 } goto abort_due_to_error -__653: +__672: ; - if !(*(*int32)(unsafe.Pointer(bp + 500 /* res8 */)) == 0) { - goto __654 + if !(*(*int32)(unsafe.Pointer(bp + 532 /* res9 */)) == 0) { + goto __673 } sz = Xsqlite3BtreeRowCountEst(tls, pCrsr5) if !((sz >= int64(0)) && (int32(Xsqlite3LogEst(tls, U64(sz))) < (*Op)(unsafe.Pointer(pOp)).Fp3)) { - goto __655 + goto __674 } - *(*int32)(unsafe.Pointer(bp + 500 /* res8 */)) = 1 -__655: + *(*int32)(unsafe.Pointer(bp + 532 /* res9 */)) = 1 +__674: ; -__654: +__673: ; - if !(*(*int32)(unsafe.Pointer(bp + 500 /* res8 */)) != 0) { - goto __656 + if !(*(*int32)(unsafe.Pointer(bp + 532 /* res9 */)) != 0) { + goto __675 } goto jump_to_p2 -__656: +__675: ; goto __10 @@ -70015,8 +70562,8 @@ __656: // rewinding so that the global variable will be incremented and // regression tests can determine whether or not the optimizer is // correctly optimizing out sorts. -__114: // jump -__115: // jump +__117: // jump +__118: // jump atomic.AddInt32(&Xsqlite3_sort_count, 1) atomic.AddInt32(&Xsqlite3_search_count, -1) *(*U32)(unsafe.Pointer((p + 212 /* &.aCounter */) + 2*4))++ @@ -70032,39 +70579,39 @@ __115: // jump // This opcode leaves the cursor configured to move in forward order, // from the beginning toward the end. In other words, the cursor is // configured to use Next, not Prev. -__116: +__119: ; - pC18 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC19 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - *(*int32)(unsafe.Pointer(bp + 504 /* res9 */)) = 1 - if !(int32((*VdbeCursor)(unsafe.Pointer((pC18))).FeCurType) == CURTYPE_SORTER) { - goto __657 + *(*int32)(unsafe.Pointer(bp + 536 /* res10 */)) = 1 + if !(int32((*VdbeCursor)(unsafe.Pointer((pC19))).FeCurType) == CURTYPE_SORTER) { + goto __676 } - rc = Xsqlite3VdbeSorterRewind(tls, pC18, bp+504 /* &res9 */) - goto __658 -__657: + rc = Xsqlite3VdbeSorterRewind(tls, pC19, bp+536 /* &res10 */) + goto __677 +__676: ; - pCrsr6 = *(*uintptr)(unsafe.Pointer(pC18 + 56 /* &.uc */)) + pCrsr6 = *(*uintptr)(unsafe.Pointer(pC19 + 56 /* &.uc */)) - rc = Xsqlite3BtreeFirst(tls, pCrsr6, bp+504 /* &res9 */) - (*VdbeCursor)(unsafe.Pointer(pC18)).FdeferredMoveto = U8(0) - (*VdbeCursor)(unsafe.Pointer(pC18)).FcacheStatus = CACHE_STALE -__658: + rc = Xsqlite3BtreeFirst(tls, pCrsr6, bp+536 /* &res10 */) + (*VdbeCursor)(unsafe.Pointer(pC19)).FdeferredMoveto = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC19)).FcacheStatus = U32(CACHE_STALE) +__677: ; if !(rc != 0) { - goto __659 + goto __678 } goto abort_due_to_error -__659: +__678: ; - (*VdbeCursor)(unsafe.Pointer(pC18)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 504 /* res9 */))) + (*VdbeCursor)(unsafe.Pointer(pC19)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 536 /* res10 */))) - if !(*(*int32)(unsafe.Pointer(bp + 504 /* res9 */)) != 0) { - goto __660 + if !(*(*int32)(unsafe.Pointer(bp + 536 /* res10 */)) != 0) { + goto __679 } goto jump_to_p2 -__660: +__679: ; goto __10 @@ -70125,42 +70672,42 @@ __660: // sorter object for which the OP_SorterSort opcode has been // invoked. This opcode advances the cursor to the next sorted // record, or jumps to P2 if there are no more sorted records. -__117: +__120: - pC19 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC20 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - rc = Xsqlite3VdbeSorterNext(tls, db, pC19) + rc = Xsqlite3VdbeSorterNext(tls, db, pC20) goto next_tail -__118: // jump -__119: // jump +__121: // jump +__122: // jump ; - pC19 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC20 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) // The Next opcode is only used after SeekGT, SeekGE, Rewind, and Found. // The Prev opcode is only used after SeekLT, SeekLE, and Last. - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pOp + 16 /* &.p4 */ /* &.xAdvance */))))(tls, *(*uintptr)(unsafe.Pointer(pC19 + 56 /* &.uc */)), (*Op)(unsafe.Pointer(pOp)).Fp3) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pOp + 16 /* &.p4 */ /* &.xAdvance */))))(tls, *(*uintptr)(unsafe.Pointer(pC20 + 56 /* &.uc */)), (*Op)(unsafe.Pointer(pOp)).Fp3) next_tail: - (*VdbeCursor)(unsafe.Pointer(pC19)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC20)).FcacheStatus = U32(CACHE_STALE) if !(rc == SQLITE_OK) { - goto __661 + goto __680 } - (*VdbeCursor)(unsafe.Pointer(pC19)).FnullRow = U8(0) + (*VdbeCursor)(unsafe.Pointer(pC20)).FnullRow = U8(0) *(*U32)(unsafe.Pointer((p + 212 /* &.aCounter */) + uintptr((*Op)(unsafe.Pointer(pOp)).Fp5)*4))++ atomic.AddInt32(&Xsqlite3_search_count, 1) goto jump_to_p2_and_check_for_interrupt -__661: +__680: ; if !(rc != SQLITE_DONE) { - goto __662 + goto __681 } goto abort_due_to_error -__662: +__681: ; rc = SQLITE_OK - (*VdbeCursor)(unsafe.Pointer(pC19)).FnullRow = U8(1) + (*VdbeCursor)(unsafe.Pointer(pC20)).FnullRow = U8(1) goto check_for_interrupt // Opcode: IdxInsert P1 P2 P3 P4 P5 @@ -70190,17 +70737,17 @@ __662: // // This instruction only works for indices. The equivalent instruction // for tables is OP_Insert. -__120: +__123: ; - pC20 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC21 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_NCHANGE) != 0) { - goto __663 + goto __682 } (*Vdbe)(unsafe.Pointer(p)).FnChange++ -__663: +__682: ; rc = func() int32 { @@ -70210,30 +70757,30 @@ __663: return 0 }() if !(rc != 0) { - goto __664 + goto __683 } goto abort_due_to_error -__664: +__683: ; - (*BtreePayload)(unsafe.Pointer(bp + 512 /* &x2 */)).FnKey = Sqlite3_int64((*Mem)(unsafe.Pointer(pIn2)).Fn) - (*BtreePayload)(unsafe.Pointer(bp + 512 /* &x2 */)).FpKey = (*Mem)(unsafe.Pointer(pIn2)).Fz - (*BtreePayload)(unsafe.Pointer(bp + 512 /* &x2 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - (*BtreePayload)(unsafe.Pointer(bp + 512 /* &x2 */)).FnMem = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) - rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC20 + 56 /* &.uc */)), bp+512, /* &x2 */ - (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (OPFLAG_APPEND | OPFLAG_SAVEPOSITION)), + (*BtreePayload)(unsafe.Pointer(bp + 544 /* &x2 */)).FnKey = Sqlite3_int64((*Mem)(unsafe.Pointer(pIn2)).Fn) + (*BtreePayload)(unsafe.Pointer(bp + 544 /* &x2 */)).FpKey = (*Mem)(unsafe.Pointer(pIn2)).Fz + (*BtreePayload)(unsafe.Pointer(bp + 544 /* &x2 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) + (*BtreePayload)(unsafe.Pointer(bp + 544 /* &x2 */)).FnMem = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) + rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC21 + 56 /* &.uc */)), bp+544, /* &x2 */ + (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & ((OPFLAG_APPEND | OPFLAG_SAVEPOSITION) | OPFLAG_PREFORMAT)), func() int32 { if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_USESEEKRESULT) != 0 { - return (*VdbeCursor)(unsafe.Pointer(pC20)).FseekResult + return (*VdbeCursor)(unsafe.Pointer(pC21)).FseekResult } return 0 }()) - (*VdbeCursor)(unsafe.Pointer(pC20)).FcacheStatus = CACHE_STALE + (*VdbeCursor)(unsafe.Pointer(pC21)).FcacheStatus = U32(CACHE_STALE) if !(rc != 0) { - goto __665 + goto __684 } goto abort_due_to_error -__665: +__684: ; goto __10 @@ -70243,9 +70790,9 @@ __665: // Register P2 holds an SQL index key made using the // MakeRecord instructions. This opcode writes that key // into the sorter P1. Data for the entry is nil. -__121: +__124: ; - pC21 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC22 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) @@ -70256,17 +70803,17 @@ __121: return 0 }() if !(rc != 0) { - goto __666 + goto __685 } goto abort_due_to_error -__666: +__685: ; - rc = Xsqlite3VdbeSorterWrite(tls, pC21, pIn2) + rc = Xsqlite3VdbeSorterWrite(tls, pC22, pIn2) if !(rc != 0) { - goto __667 + goto __686 } goto abort_due_to_error -__667: +__686: ; goto __10 @@ -70283,48 +70830,48 @@ __667: // or deleted is not found. For some uses of IdxDelete // (example: the EXCEPT operator) it does not matter that no matching // entry is found. For those cases, P5 is zero. -__122: +__125: ; - pC22 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC23 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pCrsr7 = *(*uintptr)(unsafe.Pointer(pC22 + 56 /* &.uc */)) + pCrsr7 = *(*uintptr)(unsafe.Pointer(pC23 + 56 /* &.uc */)) - (*UnpackedRecord)(unsafe.Pointer(bp + 560 /* &r2 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC22)).FpKeyInfo - (*UnpackedRecord)(unsafe.Pointer(bp + 560 /* &r2 */)).FnField = U16((*Op)(unsafe.Pointer(pOp)).Fp3) - (*UnpackedRecord)(unsafe.Pointer(bp + 560 /* &r2 */)).Fdefault_rc = int8(0) - (*UnpackedRecord)(unsafe.Pointer(bp + 560 /* &r2 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) - rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr7, bp+560 /* &r2 */, int64(0), 0, bp+584 /* &res10 */) + (*UnpackedRecord)(unsafe.Pointer(bp + 592 /* &r3 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC23)).FpKeyInfo + (*UnpackedRecord)(unsafe.Pointer(bp + 592 /* &r3 */)).FnField = U16((*Op)(unsafe.Pointer(pOp)).Fp3) + (*UnpackedRecord)(unsafe.Pointer(bp + 592 /* &r3 */)).Fdefault_rc = int8(0) + (*UnpackedRecord)(unsafe.Pointer(bp + 592 /* &r3 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) + rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr7, bp+592 /* &r3 */, int64(0), 0, bp+616 /* &res11 */) if !(rc != 0) { - goto __668 + goto __687 } goto abort_due_to_error -__668: +__687: ; - if !(*(*int32)(unsafe.Pointer(bp + 584 /* res10 */)) == 0) { - goto __669 + if !(*(*int32)(unsafe.Pointer(bp + 616 /* res11 */)) == 0) { + goto __688 } - rc = Xsqlite3BtreeDelete(tls, pCrsr7, BTREE_AUXDELETE) + rc = Xsqlite3BtreeDelete(tls, pCrsr7, uint8(BTREE_AUXDELETE)) if !(rc != 0) { - goto __671 + goto __690 } goto abort_due_to_error -__671: +__690: ; - goto __670 -__669: + goto __689 +__688: if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) { - goto __672 + goto __691 } - rc = (SQLITE_CORRUPT | (int32(3) << 8)) + rc = Xsqlite3ReportError(tls, (SQLITE_CORRUPT | (int32(3) << 8)), 91860, ts+7617 /* "index corruption" */) goto abort_due_to_error -__672: +__691: ; -__670: +__689: ; - (*VdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = CACHE_STALE - (*VdbeCursor)(unsafe.Pointer(pC22)).FseekResult = 0 + (*VdbeCursor)(unsafe.Pointer(pC23)).FcacheStatus = U32(CACHE_STALE) + (*VdbeCursor)(unsafe.Pointer(pC23)).FseekResult = 0 goto __10 // Opcode: DeferredSeek P1 * P3 P4 * @@ -70353,60 +70900,60 @@ __670: // the rowid of the table entry to which this index entry points. // // See also: Rowid, MakeRecord. -__123: -__124: // Rowid that P1 current points to +__126: +__127: // Rowid that P1 current points to ; - pC23 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC24 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) // The IdxRowid and Seek opcodes are combined because of the commonality // of sqlite3VdbeCursorRestore() and sqlite3VdbeIdxRowid(). - rc = Xsqlite3VdbeCursorRestore(tls, pC23) + rc = Xsqlite3VdbeCursorRestore(tls, pC24) // sqlite3VbeCursorRestore() can only fail if the record has been deleted // out from under the cursor. That will never happens for an IdxRowid // or Seek opcode if !(rc != SQLITE_OK) { - goto __673 + goto __692 } goto abort_due_to_error -__673: +__692: ; - if !(!(int32((*VdbeCursor)(unsafe.Pointer(pC23)).FnullRow) != 0)) { - goto __674 + if !(!(int32((*VdbeCursor)(unsafe.Pointer(pC24)).FnullRow) != 0)) { + goto __693 } - *(*I64)(unsafe.Pointer(bp + 592 /* rowid */)) = int64(0) // Not needed. Only used to silence a warning. - rc = Xsqlite3VdbeIdxRowid(tls, db, *(*uintptr)(unsafe.Pointer(pC23 + 56 /* &.uc */)), bp+592 /* &rowid */) + *(*I64)(unsafe.Pointer(bp + 624 /* rowid */)) = int64(0) // Not needed. Only used to silence a warning. + rc = Xsqlite3VdbeIdxRowid(tls, db, *(*uintptr)(unsafe.Pointer(pC24 + 56 /* &.uc */)), bp+624 /* &rowid */) if !(rc != SQLITE_OK) { - goto __676 + goto __695 } goto abort_due_to_error -__676: +__695: ; if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_DeferredSeek) { - goto __677 + goto __696 } pTabCur = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8)) (*VdbeCursor)(unsafe.Pointer(pTabCur)).FnullRow = U8(0) - (*VdbeCursor)(unsafe.Pointer(pTabCur)).FmovetoTarget = *(*I64)(unsafe.Pointer(bp + 592 /* rowid */)) + (*VdbeCursor)(unsafe.Pointer(pTabCur)).FmovetoTarget = *(*I64)(unsafe.Pointer(bp + 624 /* rowid */)) (*VdbeCursor)(unsafe.Pointer(pTabCur)).FdeferredMoveto = U8(1) (*VdbeCursor)(unsafe.Pointer(pTabCur)).FaAltMap = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - (*VdbeCursor)(unsafe.Pointer(pTabCur)).FpAltCursor = pC23 - goto __678 -__677: + (*VdbeCursor)(unsafe.Pointer(pTabCur)).FpAltCursor = pC24 + goto __697 +__696: pOut = out2Prerelease(tls, p, pOp) - *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 592 /* rowid */)) -__678: + *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 624 /* rowid */)) +__697: ; - goto __675 -__674: + goto __694 +__693: ; Xsqlite3VdbeMemSetNull(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)) -__675: +__694: ; goto __10 @@ -70415,25 +70962,25 @@ __675: // If cursor P1 was previously moved via OP_DeferredSeek, complete that // seek operation now, without further delay. If the cursor seek has // already occurred, this instruction is a no-op. -__125: // The P1 index cursor +__128: // The P1 index cursor ; - pC24 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - if !((*VdbeCursor)(unsafe.Pointer(pC24)).FdeferredMoveto != 0) { - goto __679 + pC25 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + if !((*VdbeCursor)(unsafe.Pointer(pC25)).FdeferredMoveto != 0) { + goto __698 } - rc = Xsqlite3VdbeFinishMoveto(tls, pC24) + rc = Xsqlite3VdbeFinishMoveto(tls, pC25) if !(rc != 0) { - goto __680 + goto __699 } goto abort_due_to_error -__680: +__699: ; -__679: +__698: ; goto __10 - // Opcode: IdxGE P1 P2 P3 P4 P5 + // Opcode: IdxGE P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -70443,7 +70990,7 @@ __679: // // If the P1 index entry is greater than or equal to the key value // then jump to P2. Otherwise fall through to the next instruction. - // Opcode: IdxGT P1 P2 P3 P4 P5 + // Opcode: IdxGT P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -70453,7 +71000,7 @@ __679: // // If the P1 index entry is greater than the key value // then jump to P2. Otherwise fall through to the next instruction. - // Opcode: IdxLT P1 P2 P3 P4 P5 + // Opcode: IdxLT P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -70463,7 +71010,7 @@ __679: // // If the P1 index entry is less than the key value then jump to P2. // Otherwise fall through to the next instruction. - // Opcode: IdxLE P1 P2 P3 P4 P5 + // Opcode: IdxLE P1 P2 P3 P4 * // Synopsis: key=r[P3@P4] // // The P4 register values beginning with P3 form an unpacked index @@ -70473,53 +71020,74 @@ __679: // // If the P1 index entry is less than or equal to the key value then jump // to P2. Otherwise fall through to the next instruction. -__126: // jump -__127: // jump -__128: // jump -__129: +__129: // jump +__130: // jump +__131: // jump +__132: ; - pC25 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC26 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC25)).FpKeyInfo - (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) + (*UnpackedRecord)(unsafe.Pointer(bp + 688 /* &r4 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC26)).FpKeyInfo + (*UnpackedRecord)(unsafe.Pointer(bp + 688 /* &r4 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))) if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) < OP_IdxLT) { - goto __681 + goto __700 } - (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).Fdefault_rc = int8(-1) - goto __682 -__681: + (*UnpackedRecord)(unsafe.Pointer(bp + 688 /* &r4 */)).Fdefault_rc = int8(-1) + goto __701 +__700: ; - (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).Fdefault_rc = int8(0) -__682: + (*UnpackedRecord)(unsafe.Pointer(bp + 688 /* &r4 */)).Fdefault_rc = int8(0) +__701: ; - (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - *(*int32)(unsafe.Pointer(bp + 624 /* res11 */)) = 0 // Not needed. Only used to silence a warning. - rc = Xsqlite3VdbeIdxKeyCompare(tls, db, pC25, bp+600 /* &r3 */, bp+624 /* &res11 */) + (*UnpackedRecord)(unsafe.Pointer(bp + 688 /* &r4 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - if !((int32((*Op)(unsafe.Pointer(pOp)).Fopcode) & 1) == (OP_IdxLT & 1)) { - goto __683 + /* Inlined version of sqlite3VdbeIdxKeyCompare() */ + + nCellKey = int64(0) + + pCur1 = *(*uintptr)(unsafe.Pointer(pC26 + 56 /* &.uc */)) + + nCellKey = I64(Xsqlite3BtreePayloadSize(tls, pCur1)) + // nCellKey will always be between 0 and 0xffffffff because of the way + // that btreeParseCellPtr() and sqlite3GetVarint32() are implemented + if !((nCellKey <= int64(0)) || (nCellKey > int64(0x7fffffff))) { + goto __702 } - - *(*int32)(unsafe.Pointer(bp + 624 /* res11 */)) = -*(*int32)(unsafe.Pointer(bp + 624 /* res11 */)) - goto __684 -__683: + rc = Xsqlite3CorruptError(tls, 92062) + goto abort_due_to_error +__702: ; - *(*int32)(unsafe.Pointer(bp + 624 /* res11 */))++ -__684: - ; - + Xsqlite3VdbeMemInit(tls, bp+632 /* &m */, db, uint16(0)) + rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCur1, U32(nCellKey), bp+632 /* &m */) if !(rc != 0) { - goto __685 + goto __703 } goto abort_due_to_error -__685: +__703: ; - if !(*(*int32)(unsafe.Pointer(bp + 624 /* res11 */)) > 0) { - goto __686 + res12 = Xsqlite3VdbeRecordCompareWithSkip(tls, (*Mem)(unsafe.Pointer(bp+632 /* &m */)).Fn, (*Mem)(unsafe.Pointer(bp+632 /* &m */)).Fz, bp+688 /* &r4 */, 0) + Xsqlite3VdbeMemRelease(tls, bp+632 /* &m */) + + // End of inlined sqlite3VdbeIdxKeyCompare() + + if !((int32((*Op)(unsafe.Pointer(pOp)).Fopcode) & 1) == (OP_IdxLT & 1)) { + goto __704 + } + + res12 = -res12 + goto __705 +__704: + ; + res12++ +__705: + ; + + if !(res12 > 0) { + goto __706 } goto jump_to_p2 -__686: +__706: ; goto __10 @@ -70549,41 +71117,41 @@ __686: // and non-autovacuum modes. // // See also: Clear -__130: +__133: ; pOut = out2Prerelease(tls, p, pOp) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Null) if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > ((*Sqlite3)(unsafe.Pointer(db)).FnVDestroy + 1)) { - goto __687 + goto __707 } rc = SQLITE_LOCKED - (*Vdbe)(unsafe.Pointer(p)).FerrorAction = OE_Abort + (*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(OE_Abort) goto abort_due_to_error - goto __688 -__687: + goto __708 +__707: iDb2 = (*Op)(unsafe.Pointer(pOp)).Fp3 - *(*int32)(unsafe.Pointer(bp + 628 /* iMoved */)) = 0 // Not needed. Only to silence a warning. - rc = Xsqlite3BtreeDropTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb2)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp1, bp+628 /* &iMoved */) - (*Mem)(unsafe.Pointer(pOut)).Fflags = MEM_Int - *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*int32)(unsafe.Pointer(bp + 628 /* iMoved */))) + *(*int32)(unsafe.Pointer(bp + 712 /* iMoved */)) = 0 // Not needed. Only to silence a warning. + rc = Xsqlite3BtreeDropTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb2)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp1, bp+712 /* &iMoved */) + (*Mem)(unsafe.Pointer(pOut)).Fflags = U16(MEM_Int) + *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*int32)(unsafe.Pointer(bp + 712 /* iMoved */))) if !(rc != 0) { - goto __689 + goto __709 } goto abort_due_to_error -__689: +__709: ; - if !(*(*int32)(unsafe.Pointer(bp + 628 /* iMoved */)) != 0) { - goto __690 + if !(*(*int32)(unsafe.Pointer(bp + 712 /* iMoved */)) != 0) { + goto __710 } - Xsqlite3RootPageMoved(tls, db, iDb2, uint32(*(*int32)(unsafe.Pointer(bp + 628 /* iMoved */))), uint32((*Op)(unsafe.Pointer(pOp)).Fp1)) + Xsqlite3RootPageMoved(tls, db, iDb2, uint32(*(*int32)(unsafe.Pointer(bp + 712 /* iMoved */))), uint32((*Op)(unsafe.Pointer(pOp)).Fp1)) // All OP_Destroy operations occur on the same btree resetSchemaOnFault = (U8(iDb2 + 1)) -__690: +__710: ; -__688: +__708: ; goto __10 @@ -70604,35 +71172,35 @@ __688: // also incremented by the number of rows in the table being cleared. // // See also: Destroy -__131: +__134: ; - *(*int32)(unsafe.Pointer(bp + 632 /* nChange */)) = 0 + *(*int32)(unsafe.Pointer(bp + 716 /* nChange */)) = 0 rc = Xsqlite3BtreeClearTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*32)).FpBt, int32(U32((*Op)(unsafe.Pointer(pOp)).Fp1)), func() uintptr { if (*Op)(unsafe.Pointer(pOp)).Fp3 != 0 { - return bp + 632 /* &nChange */ + return bp + 716 /* &nChange */ } return uintptr(0) }()) if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) { - goto __691 + goto __711 } - *(*int32)(unsafe.Pointer(p + 60 /* &.nChange */)) += (*(*int32)(unsafe.Pointer(bp + 632 /* nChange */))) + *(*int32)(unsafe.Pointer(p + 60 /* &.nChange */)) += (*(*int32)(unsafe.Pointer(bp + 716 /* nChange */))) if !((*Op)(unsafe.Pointer(pOp)).Fp3 > 0) { - goto __692 + goto __712 } - *(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56 /* &.u */ /* &.i */)) += (I64(*(*int32)(unsafe.Pointer(bp + 632 /* nChange */)))) -__692: + *(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56 /* &.u */ /* &.i */)) += (I64(*(*int32)(unsafe.Pointer(bp + 716 /* nChange */)))) +__712: ; -__691: +__711: ; if !(rc != 0) { - goto __693 + goto __713 } goto abort_due_to_error -__693: +__713: ; goto __10 @@ -70643,26 +71211,26 @@ __693: // // This opcode only works for cursors used for sorting and // opened with OP_OpenEphemeral or OP_SorterOpen. -__132: +__135: ; - pC26 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC27 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - if !(int32((*VdbeCursor)(unsafe.Pointer((pC26))).FeCurType) == CURTYPE_SORTER) { - goto __694 + if !(int32((*VdbeCursor)(unsafe.Pointer((pC27))).FeCurType) == CURTYPE_SORTER) { + goto __714 } - Xsqlite3VdbeSorterReset(tls, db, *(*uintptr)(unsafe.Pointer(pC26 + 56 /* &.uc */))) - goto __695 -__694: + Xsqlite3VdbeSorterReset(tls, db, *(*uintptr)(unsafe.Pointer(pC27 + 56 /* &.uc */))) + goto __715 +__714: ; - rc = Xsqlite3BtreeClearTableOfCursor(tls, *(*uintptr)(unsafe.Pointer(pC26 + 56 /* &.uc */))) + rc = Xsqlite3BtreeClearTableOfCursor(tls, *(*uintptr)(unsafe.Pointer(pC27 + 56 /* &.uc */))) if !(rc != 0) { - goto __696 + goto __716 } goto abort_due_to_error -__696: +__716: ; -__695: +__715: ; goto __10 @@ -70674,36 +71242,36 @@ __695: // P1>1. The P3 argument must be 1 (BTREE_INTKEY) for a rowid table // it must be 2 (BTREE_BLOBKEY) for an index or WITHOUT ROWID table. // The root page number of the new b-tree is stored in register P2. -__133: +__136: ; pOut = out2Prerelease(tls, p, pOp) - *(*Pgno)(unsafe.Pointer(bp + 636 /* pgno */)) = Pgno(0) + *(*Pgno)(unsafe.Pointer(bp + 720 /* pgno */)) = Pgno(0) pDb2 = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32) - rc = Xsqlite3BtreeCreateTable(tls, (*Db)(unsafe.Pointer(pDb2)).FpBt, bp+636 /* &pgno */, (*Op)(unsafe.Pointer(pOp)).Fp3) + rc = Xsqlite3BtreeCreateTable(tls, (*Db)(unsafe.Pointer(pDb2)).FpBt, bp+720 /* &pgno */, (*Op)(unsafe.Pointer(pOp)).Fp3) if !(rc != 0) { - goto __697 + goto __717 } goto abort_due_to_error -__697: +__717: ; - *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*Pgno)(unsafe.Pointer(bp + 636 /* pgno */))) + *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*Pgno)(unsafe.Pointer(bp + 720 /* pgno */))) goto __10 // Opcode: SqlExec * * * P4 * // // Run the SQL statement or statements specified in the P4 string. -__134: +__137: ; (*Sqlite3)(unsafe.Pointer(db)).FnSqlExec++ rc = Xsqlite3_exec(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), uintptr(0), uintptr(0), uintptr(0)) (*Sqlite3)(unsafe.Pointer(db)).FnSqlExec-- if !(rc != 0) { - goto __698 + goto __718 } goto abort_due_to_error -__698: +__718: ; goto __10 @@ -70715,7 +71283,7 @@ __698: // // This opcode invokes the parser to create a new virtual machine, // then runs the new virtual machine. It is thus a re-entrant opcode. -__135: +__138: // Any prepared statement that invokes this opcode will hold mutexes // on every btree. This is a prerequisite for invoking @@ -70724,72 +71292,72 @@ __135: iDb3 = (*Op)(unsafe.Pointer(pOp)).Fp1 if !(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) == uintptr(0)) { - goto __699 + goto __719 } Xsqlite3SchemaClear(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FpSchema) *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk))) - rc = Xsqlite3InitOne(tls, db, iDb3, (p + 168 /* &.zErrMsg */), INITFLAG_AlterTable) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + rc = Xsqlite3InitOne(tls, db, iDb3, (p + 168 /* &.zErrMsg */), uint32((*Op)(unsafe.Pointer(pOp)).Fp5)) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3) - goto __700 -__699: + goto __720 +__719: - zSchema = ts + 7541 /* "sqlite_master" */ - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).Fdb = db - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FiDb = iDb3 - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FpzErrMsg = (p + 168 /* &.zErrMsg */) - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FmInitFlags = U32(0) - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FmxPage = Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FpBt) + zSchema = ts + 7634 /* "sqlite_master" */ + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).Fdb = db + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).FiDb = iDb3 + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).FpzErrMsg = (p + 168 /* &.zErrMsg */) + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).FmInitFlags = U32(0) + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).FmxPage = Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FpBt) zSql = Xsqlite3MPrintf(tls, db, - ts+7555, /* "SELECT*FROM\"%w\"...." */ + ts+7648, /* "SELECT*FROM\"%w\"...." */ libc.VaList(bp+64, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))) if !(zSql == uintptr(0)) { - goto __701 + goto __721 } rc = SQLITE_NOMEM - goto __702 -__701: + goto __722 +__721: ; (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(1) - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).Frc = SQLITE_OK - (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FnInitRow = U32(0) + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).Frc = SQLITE_OK + (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).FnInitRow = U32(0) rc = Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 - }{Xsqlite3InitCallback})), bp+640 /* &initData */, uintptr(0)) + }{Xsqlite3InitCallback})), bp+728 /* &initData */, uintptr(0)) if !(rc == SQLITE_OK) { - goto __703 + goto __723 } - rc = (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).Frc -__703: + rc = (*InitData)(unsafe.Pointer(bp + 728 /* &initData */)).Frc +__723: ; - if !((rc == SQLITE_OK) && ((*InitData)(unsafe.Pointer(bp+640 /* &initData */)).FnInitRow == U32(0))) { - goto __704 + if !((rc == SQLITE_OK) && ((*InitData)(unsafe.Pointer(bp+728 /* &initData */)).FnInitRow == U32(0))) { + goto __724 } // The OP_ParseSchema opcode with a non-NULL P4 argument should parse // at least one SQL statement. Any less than that indicates that // the sqlite_schema table is corrupt. - rc = Xsqlite3CorruptError(tls, 91475) -__704: + rc = Xsqlite3CorruptError(tls, 92315) +__724: ; Xsqlite3DbFreeNN(tls, db, zSql) (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(0) -__702: +__722: ; -__700: +__720: ; if !(rc != 0) { - goto __705 + goto __725 } Xsqlite3ResetAllSchemasOfConnection(tls, db) if !(rc == SQLITE_NOMEM) { - goto __706 + goto __726 } goto no_mem -__706: +__726: ; goto abort_due_to_error -__705: +__725: ; goto __10 @@ -70798,14 +71366,14 @@ __705: // Read the sqlite_stat1 table for database P1 and load the content // of that table into the internal index hash table. This will cause // the analysis to be used when preparing all subsequent queries. -__136: +__139: ; rc = Xsqlite3AnalysisLoad(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1) if !(rc != 0) { - goto __707 + goto __727 } goto abort_due_to_error -__707: +__727: ; goto __10 @@ -70816,7 +71384,7 @@ __707: // is dropped from disk (using the Destroy opcode) in order to keep // the internal representation of the // schema consistent with what is on disk. -__137: +__140: ; Xsqlite3UnlinkAndDeleteTable(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) goto __10 @@ -70828,7 +71396,7 @@ __137: // is dropped from disk (using the Destroy opcode) // in order to keep the internal representation of the // schema consistent with what is on disk. -__138: +__141: ; Xsqlite3UnlinkAndDeleteIndex(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) goto __10 @@ -70840,7 +71408,7 @@ __138: // is dropped from disk (using the Destroy opcode) in order to keep // the internal representation of the // schema consistent with what is on disk. -__139: +__142: ; Xsqlite3UnlinkAndDeleteTrigger(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) goto __10 @@ -70863,7 +71431,7 @@ __139: // file, not the main database file. // // This opcode is used to implement the integrity_check pragma. -__140: // Register keeping track of errors remaining +__143: // Register keeping track of errors remaining ; nRoot = (*Op)(unsafe.Pointer(pOp)).Fp2 @@ -70874,25 +71442,25 @@ __140: // Register keeping track of errors remaining pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) z = Xsqlite3BtreeIntegrityCheck(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp5)*32)).FpBt, (aRoot + 1*4), nRoot, - (int32(*(*I64)(unsafe.Pointer(pnErr /* &.u */))) + 1), bp+680 /* &nErr */) + (int32(*(*I64)(unsafe.Pointer(pnErr /* &.u */))) + 1), bp+768 /* &nErr */) Xsqlite3VdbeMemSetNull(tls, pIn1) - if !(*(*int32)(unsafe.Pointer(bp + 680 /* nErr */)) == 0) { - goto __708 + if !(*(*int32)(unsafe.Pointer(bp + 768 /* nErr */)) == 0) { + goto __728 } - goto __709 -__708: + goto __729 +__728: if !(z == uintptr(0)) { - goto __710 + goto __730 } goto no_mem - goto __711 -__710: - *(*I64)(unsafe.Pointer(pnErr /* &.u */ /* &.i */)) -= (I64(*(*int32)(unsafe.Pointer(bp + 680 /* nErr */)) - 1)) - Xsqlite3VdbeMemSetStr(tls, pIn1, z, -1, SQLITE_UTF8, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) -__711: + goto __731 +__730: + *(*I64)(unsafe.Pointer(pnErr /* &.u */ /* &.i */)) -= (I64(*(*int32)(unsafe.Pointer(bp + 768 /* nErr */)) - 1)) + Xsqlite3VdbeMemSetStr(tls, pIn1, z, -1, uint8(SQLITE_UTF8), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) +__731: ; -__709: +__729: ; updateMaxBlobsize(tls, pIn1) Xsqlite3VdbeChangeEncoding(tls, pIn1, int32(encoding)) @@ -70905,20 +71473,20 @@ __709: // held in register P1. // // An assertion fails if P2 is not an integer. -__141: // in1, in2 +__144: // in1, in2 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Blob) == 0) { - goto __712 + goto __732 } if !(Xsqlite3VdbeMemSetRowSet(tls, pIn1) != 0) { - goto __713 + goto __733 } goto no_mem -__713: +__733: ; -__712: +__732: ; Xsqlite3RowSetInsert(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, *(*I64)(unsafe.Pointer(pIn2 /* &.u */))) @@ -70931,24 +71499,24 @@ __712: // and put that value into register P3. // Or, if RowSet object P1 is initially empty, leave P3 // unchanged and jump to instruction P2. -__142: +__145: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !(((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Blob) == 0) || - (Xsqlite3RowSetNext(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, bp+688 /* &val */) == 0)) { - goto __714 + (Xsqlite3RowSetNext(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, bp+776 /* &val */) == 0)) { + goto __734 } // The boolean index is empty Xsqlite3VdbeMemSetNull(tls, pIn1) goto jump_to_p2_and_check_for_interrupt - goto __715 -__714: + goto __735 +__734: // A value was pulled from the index ; - Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56), *(*I64)(unsafe.Pointer(bp + 688 /* val */))) -__715: + Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56), *(*I64)(unsafe.Pointer(bp + 776 /* val */))) +__735: ; goto check_for_interrupt @@ -70974,7 +71542,7 @@ __715: // inserted, there is no need to search to see if the same value was // previously inserted as part of set X (only if it was previously // inserted as part of some other set). -__143: +__146: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) @@ -70983,35 +71551,35 @@ __143: // If there is anything other than a rowset object in memory cell P1, // delete it now and initialize P1 with an empty rowset if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & MEM_Blob) == 0) { - goto __716 + goto __736 } if !(Xsqlite3VdbeMemSetRowSet(tls, pIn1) != 0) { - goto __717 + goto __737 } goto no_mem -__717: +__737: ; -__716: +__736: ; if !(iSet != 0) { - goto __718 + goto __738 } exists = Xsqlite3RowSetTest(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, iSet, *(*I64)(unsafe.Pointer(pIn3 /* &.u */))) if !(exists != 0) { - goto __719 + goto __739 } goto jump_to_p2 -__719: +__739: ; -__718: +__738: ; if !(iSet >= 0) { - goto __720 + goto __740 } Xsqlite3RowSetInsert(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, *(*I64)(unsafe.Pointer(pIn3 /* &.u */))) -__720: +__740: ; goto __10 @@ -71029,7 +71597,7 @@ __720: // P4 is a pointer to the VM containing the trigger program. // // If P5 is non-zero, then recursive program invocation is enabled. -__144: // Token identifying trigger +__147: // Token identifying trigger pProgram = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) pRt = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) @@ -71046,37 +71614,37 @@ __144: // Token identifying trigger // single trigger all have the same value for the SubProgram.token // variable. if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) { - goto __721 + goto __741 } t1 = (*SubProgram)(unsafe.Pointer(pProgram)).Ftoken pFrame2 = (*Vdbe)(unsafe.Pointer(p)).FpFrame -__722: +__742: if !((pFrame2 != 0) && ((*VdbeFrame)(unsafe.Pointer(pFrame2)).Ftoken != t1)) { - goto __724 + goto __744 } - goto __723 -__723: + goto __743 +__743: pFrame2 = (*VdbeFrame)(unsafe.Pointer(pFrame2)).FpParent - goto __722 - goto __724 -__724: + goto __742 + goto __744 +__744: ; if !(pFrame2 != 0) { - goto __725 + goto __745 } goto __10 -__725: +__745: ; -__721: +__741: ; - if !((*Vdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 10*4))) { - goto __726 + if !((*Vdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 10*4))) { + goto __746 } rc = SQLITE_ERROR - Xsqlite3VdbeError(tls, p, ts+7598 /* "too many levels ..." */, 0) + Xsqlite3VdbeError(tls, p, ts+7691 /* "too many levels ..." */, 0) goto abort_due_to_error -__726: +__746: ; // Register pRt is used to store the memory required to save the state @@ -71084,7 +71652,7 @@ __726: // the trigger program. If this trigger has been fired before, then pRt // is already allocated. Otherwise, it must be initialized. if !((int32((*Mem)(unsafe.Pointer(pRt)).Fflags) & MEM_Blob) == 0) { - goto __727 + goto __747 } // SubProgram.nMem is set to the number of memory cells used by the // program stored in SubProgram.aOp. As well as these, one memory @@ -71093,10 +71661,10 @@ __726: nMem = ((*SubProgram)(unsafe.Pointer(pProgram)).FnMem + (*SubProgram)(unsafe.Pointer(pProgram)).FnCsr) if !((*SubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0) { - goto __729 + goto __749 } nMem++ -__729: +__749: ; nByte2 = (int32((((((uint64(unsafe.Sizeof(VdbeFrame{}))) + uint64(7)) & libc.Uint64FromInt32(libc.CplInt32(7))) + (uint64(nMem) * uint64(unsafe.Sizeof(Mem{})))) + @@ -71104,10 +71672,10 @@ __729: (uint64(((*SubProgram)(unsafe.Pointer(pProgram)).FnOp + 7) / 8)))) pFrame2 = Xsqlite3DbMallocZero(tls, db, uint64(nByte2)) if !(!(pFrame2 != 0)) { - goto __730 + goto __750 } goto no_mem -__730: +__750: ; Xsqlite3VdbeMemRelease(tls, pRt) (*Mem)(unsafe.Pointer(pRt)).Fflags = (U16(MEM_Blob | MEM_Dyn)) @@ -71129,24 +71697,24 @@ __730: pEnd = (((pFrame2) + 112) + uintptr((*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem)*56) pMem2 = ((pFrame2) + 112) -__731: +__751: if !(pMem2 != pEnd) { - goto __733 + goto __753 } - (*Mem)(unsafe.Pointer(pMem2)).Fflags = MEM_Undefined + (*Mem)(unsafe.Pointer(pMem2)).Fflags = U16(MEM_Undefined) (*Mem)(unsafe.Pointer(pMem2)).Fdb = db - goto __732 -__732: + goto __752 +__752: pMem2 += 56 - goto __731 - goto __733 -__733: + goto __751 + goto __753 +__753: ; - goto __728 -__727: + goto __748 +__747: pFrame2 = (*Mem)(unsafe.Pointer(pRt)).Fz -__728: +__748: ; (*Vdbe)(unsafe.Pointer(p)).FnFrame++ @@ -71181,7 +71749,7 @@ __728: // The address of the cell in the parent frame is determined by adding // the value of the P1 argument to the value of the P1 argument to the // calling OP_Program instruction. -__145: +__148: pOut = out2Prerelease(tls, p, pOp) pFrame3 = (*Vdbe)(unsafe.Pointer(p)).FpFrame pIn = ((*VdbeFrame)(unsafe.Pointer(pFrame3)).FaMem + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1+(*Op)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(pFrame3)).FaOp+uintptr((*VdbeFrame)(unsafe.Pointer(pFrame3)).Fpc)*32)).Fp1))*56) @@ -71195,23 +71763,23 @@ __145: // If P1 is non-zero, the database constraint counter is incremented // (deferred foreign key constraints). Otherwise, if P1 is zero, the // statement counter is incremented (immediate foreign key constraints). -__146: - if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0) { - goto __734 +__149: + if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) { + goto __754 } - *(*I64)(unsafe.Pointer(db + 744 /* &.nDeferredImmCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2)) - goto __735 -__734: + *(*I64)(unsafe.Pointer(db + 752 /* &.nDeferredImmCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2)) + goto __755 +__754: if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) { - goto __736 + goto __756 } - *(*I64)(unsafe.Pointer(db + 736 /* &.nDeferredCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2)) - goto __737 -__736: + *(*I64)(unsafe.Pointer(db + 744 /* &.nDeferredCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2)) + goto __757 +__756: *(*I64)(unsafe.Pointer(p + 80 /* &.nFkConstraint */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2)) -__737: +__757: ; -__735: +__755: ; goto __10 @@ -71226,27 +71794,27 @@ __735: // is zero (the one that counts deferred constraint violations). If P1 is // zero, the jump is taken if the statement constraint-counter is zero // (immediate foreign key constraint violations). -__147: // jump +__150: // jump if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) { - goto __738 + goto __758 } if !(((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons == int64(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons == int64(0))) { - goto __740 + goto __760 } goto jump_to_p2 -__740: +__760: ; - goto __739 -__738: + goto __759 +__758: ; if !(((*Vdbe)(unsafe.Pointer(p)).FnFkConstraint == int64(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons == int64(0))) { - goto __741 + goto __761 } goto jump_to_p2 -__741: +__761: ; -__739: +__759: ; goto __10 @@ -71260,37 +71828,37 @@ __739: // // This instruction throws an error if the memory cell is not initially // an integer. -__148: +__151: if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) { - goto __742 + goto __762 } pFrame4 = (*Vdbe)(unsafe.Pointer(p)).FpFrame -__744: +__764: if !((*VdbeFrame)(unsafe.Pointer(pFrame4)).FpParent != 0) { - goto __746 + goto __766 } - goto __745 -__745: + goto __765 +__765: pFrame4 = (*VdbeFrame)(unsafe.Pointer(pFrame4)).FpParent - goto __744 - goto __746 -__746: + goto __764 + goto __766 +__766: ; pIn1 = ((*VdbeFrame)(unsafe.Pointer(pFrame4)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) - goto __743 -__742: + goto __763 +__762: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) -__743: +__763: ; Xsqlite3VdbeMemIntegerify(tls, pIn1) pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56) Xsqlite3VdbeMemIntegerify(tls, pIn2) if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) < *(*I64)(unsafe.Pointer(pIn2 /* &.u */))) { - goto __747 + goto __767 } *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = *(*I64)(unsafe.Pointer(pIn2 /* &.u */)) -__747: +__767: ; goto __10 @@ -71303,15 +71871,15 @@ __747: // // If the initial value of register P1 is less than 1, then the // value is unchanged and control passes through to the next instruction. -__149: // jump, in1 +__152: // jump, in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) > int64(0)) { - goto __748 + goto __768 } *(*I64)(unsafe.Pointer(pIn1 /* &.u */ /* &.i */)) -= (I64((*Op)(unsafe.Pointer(pOp)).Fp3)) goto jump_to_p2 -__748: +__768: ; goto __10 @@ -71332,19 +71900,19 @@ __748: // and r[P2] is set to -1. // // Otherwise, r[P2] is set to the sum of r[P1] and r[P3]. -__150: +__153: pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) pOut = out2Prerelease(tls, p, pOp) - *(*I64)(unsafe.Pointer(bp + 696 /* x3 */)) = *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) - if !((*(*I64)(unsafe.Pointer(bp + 696 /* x3 */)) <= int64(0)) || (Xsqlite3AddInt64(tls, bp+696 /* &x3 */, func() int64 { + *(*I64)(unsafe.Pointer(bp + 784 /* x3 */)) = *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) + if !((*(*I64)(unsafe.Pointer(bp + 784 /* x3 */)) <= int64(0)) || (Xsqlite3AddInt64(tls, bp+784 /* &x3 */, func() int64 { if *(*I64)(unsafe.Pointer(pIn3 /* &.u */)) > int64(0) { return *(*I64)(unsafe.Pointer(pIn3 /* &.u */)) } return int64(0) }()) != 0)) { - goto __749 + goto __769 } // If the LIMIT is less than or equal to zero, loop forever. This // is documented. But also, if the LIMIT+OFFSET exceeds 2^63 then @@ -71354,10 +71922,10 @@ __150: // it would take nearly 300 years to actually reach the limit. So // looping forever is a reasonable approximation. *(*I64)(unsafe.Pointer(pOut /* &.u */)) = int64(-1) - goto __750 -__749: - *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 696 /* x3 */)) -__750: + goto __770 +__769: + *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 784 /* x3 */)) +__770: ; goto __10 @@ -71368,20 +71936,20 @@ __750: // initially greater than zero, then decrement the value in register P1. // If it is non-zero (negative or positive) and then also jump to P2. // If register P1 is initially zero, leave it unchanged and fall through. -__151: // jump, in1 +__154: // jump, in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) != 0) { - goto __751 + goto __771 } if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) > int64(0)) { - goto __752 + goto __772 } *(*I64)(unsafe.Pointer(pIn1 /* &.u */))-- -__752: +__772: ; goto jump_to_p2 -__751: +__771: ; goto __10 @@ -71390,21 +71958,21 @@ __751: // // Register P1 must hold an integer. Decrement the value in P1 // and jump to P2 if the new value is exactly zero. -__152: // jump, in1 +__155: // jump, in1 pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) > ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))) { - goto __753 + goto __773 } *(*I64)(unsafe.Pointer(pIn1 /* &.u */))-- -__753: +__773: ; if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) == int64(0)) { - goto __754 + goto __774 } goto jump_to_p2 -__754: +__774: ; goto __10 @@ -71444,21 +72012,21 @@ __754: // the opcode is changed. In this way, the initialization of the // sqlite3_context only happens once, instead of on each call to the // step function. -__153: -__154: +__156: +__157: ; n4 = int32((*Op)(unsafe.Pointer(pOp)).Fp5) pCtx = Xsqlite3DbMallocRawNN(tls, db, (uint64((uint64(n4) * uint64(unsafe.Sizeof(uintptr(0)))) + ((uint64(unsafe.Sizeof(Sqlite3_context{})) + uint64(unsafe.Sizeof(Mem{}))) - uint64(unsafe.Sizeof(uintptr(0))))))) if !(pCtx == uintptr(0)) { - goto __755 + goto __775 } goto no_mem -__755: +__775: ; (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpMem = uintptr(0) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut = ((pCtx + 48 /* &.argv */) + uintptr(n4)*8) - Xsqlite3VdbeMemInit(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, db, MEM_Null) + Xsqlite3VdbeMemInit(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, db, uint16(MEM_Null)) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp = (int32((int64(pOp) - int64(aOp)) / 32)) (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe = p @@ -71470,9 +72038,9 @@ __755: // OP_AggInverse must have P1==1 and OP_AggStep must have P1==0 - (*Op)(unsafe.Pointer(pOp)).Fopcode = OP_AggStep1 + (*Op)(unsafe.Pointer(pOp)).Fopcode = U8(OP_AggStep1) -__155: +__158: ; pCtx1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) pMem3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) @@ -71482,71 +72050,71 @@ __155: // checks to see if the register array has changed, and if so it // reinitializes the relavant parts of the sqlite3_context object if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpMem != pMem3) { - goto __756 + goto __776 } (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpMem = pMem3 i4 = (int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc) - 1) -__757: +__777: if !(i4 >= 0) { - goto __759 + goto __779 } *(*uintptr)(unsafe.Pointer((pCtx1 + 48 /* &.argv */) + uintptr(i4)*8)) = (aMem + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2+i4))*56) - goto __758 -__758: + goto __778 +__778: i4-- - goto __757 - goto __759 -__759: + goto __777 + goto __779 +__779: ; -__756: +__776: ; (*Mem)(unsafe.Pointer(pMem3)).Fn++ if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) { - goto __760 + goto __780 } (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc + 48 /* &.xInverse */))))(tls, pCtx1, int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48 /* &.argv */) - goto __761 -__760: + goto __781 +__780: (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc + 24 /* &.xSFunc */))))(tls, pCtx1, int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48 /* &.argv */) -__761: +__781: ; // IMP: R-24505-23230 if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0) { - goto __762 + goto __782 } if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0) { - goto __763 + goto __783 } Xsqlite3VdbeError(tls, p, ts+824 /* "%s" */, libc.VaList(bp+88, Xsqlite3_value_text(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError -__763: +__783: ; if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0) { - goto __764 + goto __784 } i4 = (*Op)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*32)).Fp1 if !(i4 != 0) { - goto __765 + goto __785 } Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr(i4)*56), int64(1)) -__765: +__785: ; (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag = U8(0) -__764: +__784: ; Xsqlite3VdbeMemRelease(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut) - (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)).Fflags = MEM_Null + (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)).Fflags = U16(MEM_Null) (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError = 0 if !(rc != 0) { - goto __766 + goto __786 } goto abort_due_to_error -__766: +__786: ; -__762: +__782: ; goto __10 @@ -71575,39 +72143,39 @@ __762: // functions that can take varying numbers of arguments. The // P4 argument is only needed for the case where // the step function was not previously called. -__156: -__157: +__159: +__160: ; pMem4 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) { - goto __767 + goto __787 } rc = Xsqlite3VdbeMemAggValue(tls, pMem4, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) pMem4 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - goto __768 -__767: + goto __788 +__787: rc = Xsqlite3VdbeMemFinalize(tls, pMem4, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) -__768: +__788: ; if !(rc != 0) { - goto __769 + goto __789 } Xsqlite3VdbeError(tls, p, ts+824 /* "%s" */, libc.VaList(bp+96, Xsqlite3_value_text(tls, pMem4))) goto abort_due_to_error -__769: +__789: ; Xsqlite3VdbeChangeEncoding(tls, pMem4, int32(encoding)) updateMaxBlobsize(tls, pMem4) if !(Xsqlite3VdbeMemTooBig(tls, pMem4) != 0) { - goto __770 + goto __790 } goto too_big -__770: +__790: ; goto __10 @@ -71621,40 +72189,40 @@ __770: // in the WAL that have been checkpointed after the checkpoint // completes into mem[P3+2]. However on an error, mem[P3+1] and // mem[P3+2] are initialized to -1. -__158: // Write results here +__161: // Write results here ; - *(*int32)(unsafe.Pointer(bp + 704 /* &aRes[0] */)) = 0 - *(*int32)(unsafe.Pointer(bp + 704 /* &aRes[0] */ + 1*4)) = libc.AssignPtrInt32(bp+704 /* &aRes */ +2*4, -1) + *(*int32)(unsafe.Pointer(bp + 792 /* &aRes[0] */)) = 0 + *(*int32)(unsafe.Pointer(bp + 792 /* &aRes[0] */ + 1*4)) = libc.AssignPtrInt32(bp+792 /* &aRes */ +2*4, -1) - rc = Xsqlite3Checkpoint(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, (bp + 704 /* &aRes */ + 1*4), (bp + 704 /* &aRes */ + 2*4)) + rc = Xsqlite3Checkpoint(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, (bp + 792 /* &aRes */ + 1*4), (bp + 792 /* &aRes */ + 2*4)) if !(rc != 0) { - goto __771 + goto __791 } if !(rc != SQLITE_BUSY) { - goto __772 + goto __792 } goto abort_due_to_error -__772: +__792: ; rc = SQLITE_OK - *(*int32)(unsafe.Pointer(bp + 704 /* &aRes[0] */)) = 1 -__771: + *(*int32)(unsafe.Pointer(bp + 792 /* &aRes[0] */)) = 1 +__791: ; i5 = 0 pMem5 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) -__773: +__793: if !(i5 < 3) { - goto __775 + goto __795 } - Xsqlite3VdbeMemSetInt64(tls, pMem5, I64(*(*int32)(unsafe.Pointer(bp + 704 /* &aRes[0] */ + uintptr(i5)*4)))) - goto __774 -__774: + Xsqlite3VdbeMemSetInt64(tls, pMem5, I64(*(*int32)(unsafe.Pointer(bp + 792 /* &aRes[0] */ + uintptr(i5)*4)))) + goto __794 +__794: i5++ pMem5 += 56 - goto __773 - goto __775 -__775: + goto __793 + goto __795 +__795: ; goto __10 @@ -71668,7 +72236,7 @@ __775: // If changing into or out of WAL mode the procedure is more complicated. // // Write a string containing the final journal-mode to register P2. -__159: // Name of database file for pPager +__162: // Name of database file for pPager pOut = out2Prerelease(tls, p, pOp) eNew = (*Op)(unsafe.Pointer(pOp)).Fp3 @@ -71677,16 +72245,16 @@ __159: // Name of database file for pPager pPager = Xsqlite3BtreePager(tls, pBt1) eOld = Xsqlite3PagerGetJournalMode(tls, pPager) if !(eNew == (-1)) { - goto __776 + goto __796 } eNew = eOld -__776: +__796: ; if !(!(Xsqlite3PagerOkToChangeJournalMode(tls, pPager) != 0)) { - goto __777 + goto __797 } eNew = eOld -__777: +__797: ; zFilename = Xsqlite3PagerFilename(tls, pPager, 1) @@ -71696,34 +72264,34 @@ __777: if !((eNew == PAGER_JOURNALMODE_WAL) && ((Xsqlite3Strlen30(tls, zFilename) == 0) || // Temp file !(Xsqlite3PagerWalSupported(tls, pPager) != 0))) { - goto __778 + goto __798 } eNew = eOld -__778: +__798: ; if !((eNew != eOld) && ((eOld == PAGER_JOURNALMODE_WAL) || (eNew == PAGER_JOURNALMODE_WAL))) { - goto __779 + goto __799 } if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1)) { - goto __780 + goto __800 } rc = SQLITE_ERROR Xsqlite3VdbeError(tls, p, - ts+7635, /* "cannot change %s..." */ + ts+7728, /* "cannot change %s..." */ libc.VaList(bp+104, func() uintptr { if eNew == PAGER_JOURNALMODE_WAL { - return ts + 7687 /* "into" */ + return ts + 7780 /* "into" */ } - return ts + 7692 /* "out of" */ + return ts + 7785 /* "out of" */ }())) goto abort_due_to_error - goto __781 -__780: + goto __801 +__800: if !(eOld == PAGER_JOURNALMODE_WAL) { - goto __782 + goto __802 } // If leaving WAL mode, close the log file. If successful, the call // to PagerCloseWal() checkpoints and deletes the write-ahead-log @@ -71731,29 +72299,29 @@ __780: // after a successful return. rc = Xsqlite3PagerCloseWal(tls, pPager, db) if !(rc == SQLITE_OK) { - goto __784 + goto __804 } Xsqlite3PagerSetJournalMode(tls, pPager, eNew) -__784: +__804: ; - goto __783 -__782: + goto __803 +__802: if !(eOld == PAGER_JOURNALMODE_MEMORY) { - goto __785 + goto __805 } // Cannot transition directly from MEMORY to WAL. Use mode OFF // as an intermediate Xsqlite3PagerSetJournalMode(tls, pPager, PAGER_JOURNALMODE_OFF) -__785: +__805: ; -__783: +__803: ; // Open a transaction on the database file. Regardless of the journal // mode, this transaction always uses a rollback journal. if !(rc == SQLITE_OK) { - goto __786 + goto __806 } rc = Xsqlite3BtreeSetVersion(tls, pBt1, func() int32 { if eNew == PAGER_JOURNALMODE_WAL { @@ -71761,31 +72329,31 @@ __783: } return 1 }()) -__786: +__806: ; -__781: +__801: ; -__779: +__799: ; if !(rc != 0) { - goto __787 + goto __807 } eNew = eOld -__787: +__807: ; eNew = Xsqlite3PagerSetJournalMode(tls, pPager, eNew) (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((MEM_Str | MEM_Static) | MEM_Term)) (*Mem)(unsafe.Pointer(pOut)).Fz = Xsqlite3JournalModename(tls, eNew) (*Mem)(unsafe.Pointer(pOut)).Fn = Xsqlite3Strlen30(tls, (*Mem)(unsafe.Pointer(pOut)).Fz) - (*Mem)(unsafe.Pointer(pOut)).Fenc = SQLITE_UTF8 + (*Mem)(unsafe.Pointer(pOut)).Fenc = U8(SQLITE_UTF8) Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding)) if !(rc != 0) { - goto __788 + goto __808 } goto abort_due_to_error -__788: +__808: ; goto __10 @@ -71797,7 +72365,7 @@ __788: // If P2 is not zero, then it is a register holding a string which is // the file into which the result of vacuum should be written. When // P2 is zero, the vacuum overwrites the original database. -__160: +__163: ; rc = Xsqlite3RunVacuum(tls, (p + 168 /* &.zErrMsg */), db, (*Op)(unsafe.Pointer(pOp)).Fp1, func() uintptr { @@ -71807,10 +72375,10 @@ __160: return uintptr(0) }()) if !(rc != 0) { - goto __789 + goto __809 } goto abort_due_to_error -__789: +__809: ; goto __10 @@ -71819,24 +72387,24 @@ __789: // Perform a single step of the incremental vacuum procedure on // the P1 database. If the vacuum has finished, jump to instruction // P2. Otherwise, fall through to the next instruction. -__161: +__164: ; pBt2 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt rc = Xsqlite3BtreeIncrVacuum(tls, pBt2) if !(rc != 0) { - goto __790 + goto __810 } if !(rc != SQLITE_DONE) { - goto __791 + goto __811 } goto abort_due_to_error -__791: +__811: ; rc = SQLITE_OK goto jump_to_p2 -__790: +__810: ; goto __10 @@ -71855,16 +72423,16 @@ __790: // The P2==1 case occurs when a CREATE INDEX or similar schema change happens // that might help the statement run faster but which does not affect the // correctness of operation. -__162: +__165: ; if !(!((*Op)(unsafe.Pointer(pOp)).Fp1 != 0)) { - goto __792 + goto __812 } Xsqlite3ExpirePreparedStatements(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp2) - goto __793 -__792: + goto __813 +__812: libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, (Bft((*Op)(unsafe.Pointer(pOp)).Fp2 + 1)), 0, 0x3) -__793: +__813: ; goto __10 @@ -71872,22 +72440,22 @@ __793: // // Lock the btree to which cursor P1 is pointing so that the btree cannot be // written by an other cursor. -__163: +__166: ; - pC27 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC28 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - Xsqlite3BtreeCursorPin(tls, *(*uintptr)(unsafe.Pointer(pC27 + 56 /* &.uc */))) + Xsqlite3BtreeCursorPin(tls, *(*uintptr)(unsafe.Pointer(pC28 + 56 /* &.uc */))) goto __10 // Opcode: CursorUnlock P1 * * * * // // Unlock the btree to which cursor P1 is pointing so that it can be // written by other cursors. -__164: +__167: ; - pC28 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pC29 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - Xsqlite3BtreeCursorUnpin(tls, *(*uintptr)(unsafe.Pointer(pC28 + 56 /* &.uc */))) + Xsqlite3BtreeCursorUnpin(tls, *(*uintptr)(unsafe.Pointer(pC29 + 56 /* &.uc */))) goto __10 // Opcode: TableLock P1 P2 P3 P4 * @@ -71904,28 +72472,28 @@ __164: // // P4 contains a pointer to the name of the table being locked. This is only // used to generate an error message if the lock cannot be obtained. -__165: +__168: isWriteLock = U8((*Op)(unsafe.Pointer(pOp)).Fp3) - if !((isWriteLock != 0) || (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ReadUncommit))) { - goto __794 + if !((isWriteLock != 0) || (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ReadUncommit)))) { + goto __814 } p13 = (*Op)(unsafe.Pointer(pOp)).Fp1 rc = Xsqlite3BtreeLockTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(p13)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp2, isWriteLock) if !(rc != 0) { - goto __795 + goto __815 } if !((rc & 0xFF) == SQLITE_LOCKED) { - goto __796 + goto __816 } z1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) - Xsqlite3VdbeError(tls, p, ts+7699 /* "database table i..." */, libc.VaList(bp+112, z1)) -__796: + Xsqlite3VdbeError(tls, p, ts+7792 /* "database table i..." */, libc.VaList(bp+112, z1)) +__816: ; goto abort_due_to_error -__795: +__815: ; -__794: +__814: ; goto __10 @@ -71937,20 +72505,20 @@ __794: // Also, whether or not P4 is set, check that this is not being called from // within a callback to a virtual table xSync() method. If it is, the error // code will be set to SQLITE_LOCKED. -__166: +__169: pVTab = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) rc = Xsqlite3VtabBegin(tls, db, pVTab) if !(pVTab != 0) { - goto __797 + goto __817 } Xsqlite3VtabImportErrmsg(tls, p, (*VTable)(unsafe.Pointer(pVTab)).FpVtab) -__797: +__817: ; if !(rc != 0) { - goto __798 + goto __818 } goto abort_due_to_error -__798: +__818: ; goto __10 @@ -71958,29 +72526,29 @@ __798: // // P2 is a register that holds the name of a virtual table in database // P1. Call the xCreate method for that table. -__167: // Name of the virtual table +__170: // Name of the virtual table - libc.Xmemset(tls, bp+720 /* &sMem1 */, 0, uint64(unsafe.Sizeof(Mem{}))) - (*Mem)(unsafe.Pointer(bp + 720 /* &sMem1 */)).Fdb = db + libc.Xmemset(tls, bp+808 /* &sMem1 */, 0, uint64(unsafe.Sizeof(Mem{}))) + (*Mem)(unsafe.Pointer(bp + 808 /* &sMem1 */)).Fdb = db // Because P2 is always a static string, it is impossible for the // sqlite3VdbeMemCopy() to fail - rc = Xsqlite3VdbeMemCopy(tls, bp+720 /* &sMem1 */, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)) + rc = Xsqlite3VdbeMemCopy(tls, bp+808 /* &sMem1 */, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)) - zTab = Xsqlite3_value_text(tls, bp+720 /* &sMem1 */) + zTab = Xsqlite3_value_text(tls, bp+808 /* &sMem1 */) if !(zTab != 0) { - goto __799 + goto __819 } rc = Xsqlite3VtabCallCreate(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, zTab, (p + 168 /* &.zErrMsg */)) -__799: +__819: ; - Xsqlite3VdbeMemRelease(tls, bp+720 /* &sMem1 */) + Xsqlite3VdbeMemRelease(tls, bp+808 /* &sMem1 */) if !(rc != 0) { - goto __800 + goto __820 } goto abort_due_to_error -__800: +__820: ; goto __10 @@ -71988,16 +72556,16 @@ __800: // // P4 is the name of a virtual table in database P1. Call the xDestroy method // of that table. -__168: +__171: (*Sqlite3)(unsafe.Pointer(db)).FnVDestroy++ rc = Xsqlite3VtabCallDestroy(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))) (*Sqlite3)(unsafe.Pointer(db)).FnVDestroy-- if !(rc != 0) { - goto __801 + goto __821 } goto abort_due_to_error -__801: +__821: ; goto __10 @@ -72006,44 +72574,44 @@ __801: // P4 is a pointer to a virtual table object, an sqlite3_vtab structure. // P1 is a cursor number. This opcode opens a cursor to the virtual // table and stores that cursor in P1. -__169: +__172: ; - pCur1 = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */)) = uintptr(0) + pCur2 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 864 /* pVCur */)) = uintptr(0) pVtab1 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab if !((pVtab1 == uintptr(0)) || ((*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FpModule == uintptr(0))) { - goto __802 + goto __822 } rc = SQLITE_LOCKED goto abort_due_to_error -__802: +__822: ; pModule1 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FpModule - rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pModule1 + 48 /* &.xOpen */))))(tls, pVtab1, bp+776 /* &pVCur */) + rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pModule1 + 48 /* &.xOpen */))))(tls, pVtab1, bp+864 /* &pVCur */) Xsqlite3VtabImportErrmsg(tls, p, pVtab1) if !(rc != 0) { - goto __803 + goto __823 } goto abort_due_to_error -__803: +__823: ; // Initialize sqlite3_vtab_cursor base class - (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */)))).FpVtab = pVtab1 + (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 864 /* pVCur */)))).FpVtab = pVtab1 // Initialize vdbe cursor object - pCur1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, 0, -1, CURTYPE_VTAB) - if !(pCur1 != 0) { - goto __804 + pCur2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, 0, -1, uint8(CURTYPE_VTAB)) + if !(pCur2 != 0) { + goto __824 } - *(*uintptr)(unsafe.Pointer(pCur1 + 56 /* &.uc */)) = *(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */)) + *(*uintptr)(unsafe.Pointer(pCur2 + 56 /* &.uc */)) = *(*uintptr)(unsafe.Pointer(bp + 864 /* pVCur */)) (*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FnRef++ - goto __805 -__804: + goto __825 +__824: ; - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule1 + 56 /* &.xClose */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */))) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule1 + 56 /* &.xClose */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 864 /* pVCur */))) goto no_mem -__805: +__825: ; goto __10 @@ -72065,13 +72633,13 @@ __805: // xFilter as argv. Register P3+2 becomes argv[0] when passed to xFilter. // // A jump is made to P2 if the result set after filtering would be empty. -__170: +__173: pQuery = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) pArgc = (pQuery + 1*56) - pCur2 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pCur3 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pVCur1 = *(*uintptr)(unsafe.Pointer(pCur2 + 56 /* &.uc */)) + pVCur1 = *(*uintptr)(unsafe.Pointer(pCur3 + 56 /* &.uc */)) pVtab2 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVCur1)).FpVtab pModule2 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab2)).FpModule @@ -72081,37 +72649,37 @@ __170: iQuery = int32(*(*I64)(unsafe.Pointer(pQuery /* &.u */))) // Invoke the xFilter method - res12 = 0 + res13 = 0 apArg = (*Vdbe)(unsafe.Pointer(p)).FapArg i6 = 0 -__806: +__826: if !(i6 < nArg) { - goto __808 + goto __828 } *(*uintptr)(unsafe.Pointer(apArg + uintptr(i6)*8)) = (pArgc + uintptr((i6+1))*56) - goto __807 -__807: + goto __827 +__827: i6++ - goto __806 - goto __808 -__808: + goto __826 + goto __828 +__828: ; rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer((pModule2 + 64 /* &.xFilter */))))(tls, pVCur1, iQuery, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), nArg, apArg) Xsqlite3VtabImportErrmsg(tls, p, pVtab2) if !(rc != 0) { - goto __809 + goto __829 } goto abort_due_to_error -__809: +__829: ; - res12 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule2 + 80 /* &.xEof */))))(tls, pVCur1) - (*VdbeCursor)(unsafe.Pointer(pCur2)).FnullRow = U8(0) + res13 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule2 + 80 /* &.xEof */))))(tls, pVCur1) + (*VdbeCursor)(unsafe.Pointer(pCur3)).FnullRow = U8(0) - if !(res12 != 0) { - goto __810 + if !(res13 != 0) { + goto __830 } goto jump_to_p2 -__810: +__830: ; goto __10 @@ -72128,60 +72696,60 @@ __810: // table implementation. The P5 column might also contain other // bits (OPFLAG_LENGTHARG or OPFLAG_TYPEOFARG) but those bits are // unused by OP_VColumn. -__171: +__174: - pCur3 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + pCur4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - pDest1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) + pDest2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) - if !((*VdbeCursor)(unsafe.Pointer(pCur3)).FnullRow != 0) { - goto __811 + if !((*VdbeCursor)(unsafe.Pointer(pCur4)).FnullRow != 0) { + goto __831 } - Xsqlite3VdbeMemSetNull(tls, pDest1) + Xsqlite3VdbeMemSetNull(tls, pDest2) goto __10 -__811: +__831: ; - pVtab3 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur3 + 56 /* &.uc */)))).FpVtab + pVtab3 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */)))).FpVtab pModule3 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab3)).FpModule - libc.Xmemset(tls, bp+784 /* &sContext */, 0, uint64(unsafe.Sizeof(Sqlite3_context{}))) - (*Sqlite3_context)(unsafe.Pointer(bp + 784 /* &sContext */)).FpOut = pDest1 + libc.Xmemset(tls, bp+872 /* &sContext */, 0, uint64(unsafe.Sizeof(Sqlite3_context{}))) + (*Sqlite3_context)(unsafe.Pointer(bp + 872 /* &sContext */)).FpOut = pDest2 if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & OPFLAG_NOCHNG) != 0) { - goto __812 + goto __832 } - Xsqlite3VdbeMemSetNull(tls, pDest1) - (*Mem)(unsafe.Pointer(pDest1)).Fflags = (U16(MEM_Null | MEM_Zero)) - *(*int32)(unsafe.Pointer(pDest1 /* &.u */)) = 0 - goto __813 -__812: - (*Mem)(unsafe.Pointer(pDest1)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pDest1))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Null)) -__813: + Xsqlite3VdbeMemSetNull(tls, pDest2) + (*Mem)(unsafe.Pointer(pDest2)).Fflags = (U16(MEM_Null | MEM_Zero)) + *(*int32)(unsafe.Pointer(pDest2 /* &.u */)) = 0 + goto __833 +__832: + (*Mem)(unsafe.Pointer(pDest2)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pDest2))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Null)) +__833: ; - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pModule3 + 88 /* &.xColumn */))))(tls, *(*uintptr)(unsafe.Pointer(pCur3 + 56 /* &.uc */)), bp+784 /* &sContext */, (*Op)(unsafe.Pointer(pOp)).Fp2) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pModule3 + 88 /* &.xColumn */))))(tls, *(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */)), bp+872 /* &sContext */, (*Op)(unsafe.Pointer(pOp)).Fp2) Xsqlite3VtabImportErrmsg(tls, p, pVtab3) - if !((*Sqlite3_context)(unsafe.Pointer(bp+784 /* &sContext */)).FisError > 0) { - goto __814 + if !((*Sqlite3_context)(unsafe.Pointer(bp+872 /* &sContext */)).FisError > 0) { + goto __834 } - Xsqlite3VdbeError(tls, p, ts+824 /* "%s" */, libc.VaList(bp+120, Xsqlite3_value_text(tls, pDest1))) - rc = (*Sqlite3_context)(unsafe.Pointer(bp + 784 /* &sContext */)).FisError -__814: + Xsqlite3VdbeError(tls, p, ts+824 /* "%s" */, libc.VaList(bp+120, Xsqlite3_value_text(tls, pDest2))) + rc = (*Sqlite3_context)(unsafe.Pointer(bp + 872 /* &sContext */)).FisError +__834: ; - Xsqlite3VdbeChangeEncoding(tls, pDest1, int32(encoding)) + Xsqlite3VdbeChangeEncoding(tls, pDest2, int32(encoding)) - updateMaxBlobsize(tls, pDest1) + updateMaxBlobsize(tls, pDest2) - if !(Xsqlite3VdbeMemTooBig(tls, pDest1) != 0) { - goto __815 + if !(Xsqlite3VdbeMemTooBig(tls, pDest2) != 0) { + goto __835 } goto too_big -__815: +__835: ; if !(rc != 0) { - goto __816 + goto __836 } goto abort_due_to_error -__816: +__836: ; goto __10 @@ -72190,18 +72758,18 @@ __816: // Advance virtual table P1 to the next row in its result set and // jump to instruction P2. Or, if the virtual table has reached // the end of its result set, then fall through to the next instruction. -__172: +__175: - res13 = 0 - pCur4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + res14 = 0 + pCur5 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) - if !((*VdbeCursor)(unsafe.Pointer(pCur4)).FnullRow != 0) { - goto __817 + if !((*VdbeCursor)(unsafe.Pointer(pCur5)).FnullRow != 0) { + goto __837 } goto __10 -__817: +__837: ; - pVtab4 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */)))).FpVtab + pVtab4 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 56 /* &.uc */)))).FpVtab pModule4 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule // Invoke the xNext() method of the module. There is no way for the @@ -72209,22 +72777,22 @@ __817: // xNext(). Instead, if an error occurs, true is returned (indicating that // data is available) and the error code returned when xColumn or // some other method is next invoked on the save virtual table cursor. - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule4 + 72 /* &.xNext */))))(tls, *(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */))) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule4 + 72 /* &.xNext */))))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 56 /* &.uc */))) Xsqlite3VtabImportErrmsg(tls, p, pVtab4) if !(rc != 0) { - goto __818 + goto __838 } goto abort_due_to_error -__818: +__838: ; - res13 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule4 + 80 /* &.xEof */))))(tls, *(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */))) + res14 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule4 + 80 /* &.xEof */))))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 56 /* &.uc */))) - if !(!(res13 != 0)) { - goto __819 + if !(!(res14 != 0)) { + goto __839 } // If there is data, jump to P2 goto jump_to_p2_and_check_for_interrupt -__819: +__839: ; goto check_for_interrupt @@ -72233,34 +72801,34 @@ __819: // P4 is a pointer to a virtual table object, an sqlite3_vtab structure. // This opcode invokes the corresponding xRename method. The value // in register P1 is passed as the zName argument to the xRename method. -__173: +__176: - isLegacy = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyAlter)) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (SQLITE_LegacyAlter) + isLegacy = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_LegacyAlter)) pVtab5 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab pName = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56) rc = Xsqlite3VdbeChangeEncoding(tls, pName, SQLITE_UTF8) if !(rc != 0) { - goto __820 + goto __840 } goto abort_due_to_error -__820: +__840: ; rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vtab)(unsafe.Pointer(pVtab5)).FpModule + 152 /* &.xRename */))))(tls, pVtab5, (*Mem)(unsafe.Pointer(pName)).Fz) if !(isLegacy == 0) { - goto __821 + goto __841 } - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_LegacyAlter)) -__821: + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_LegacyAlter))) +__841: ; Xsqlite3VtabImportErrmsg(tls, p, pVtab5) libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3) if !(rc != 0) { - goto __822 + goto __842 } goto abort_due_to_error -__822: +__842: ; goto __10 @@ -72290,95 +72858,95 @@ __822: // // P5 is the error actions (OE_Replace, OE_Fail, OE_Ignore, etc) to // apply in the case of a constraint failure on an insert or update. -__174: +__177: ; if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - goto __823 + goto __843 } goto no_mem -__823: +__843: ; pVtab6 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab if !((pVtab6 == uintptr(0)) || ((*Sqlite3_vtab)(unsafe.Pointer(pVtab6)).FpModule == uintptr(0))) { - goto __824 + goto __844 } rc = SQLITE_LOCKED goto abort_due_to_error -__824: +__844: ; pModule5 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab6)).FpModule nArg1 = (*Op)(unsafe.Pointer(pOp)).Fp2 if !((*Sqlite3_module)(unsafe.Pointer(pModule5)).FxUpdate != 0) { - goto __825 + goto __845 } vtabOnConflict = (*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict apArg1 = (*Vdbe)(unsafe.Pointer(p)).FapArg pX1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) i7 = 0 -__826: +__846: if !(i7 < nArg1) { - goto __828 + goto __848 } *(*uintptr)(unsafe.Pointer(apArg1 + uintptr(i7)*8)) = pX1 pX1 += 56 - goto __827 -__827: + goto __847 +__847: i7++ - goto __826 - goto __828 -__828: + goto __846 + goto __848 +__848: ; (*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict = U8((*Op)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pModule5 + 104 /* &.xUpdate */))))(tls, pVtab6, nArg1, apArg1, bp+840 /* &rowid1 */) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pModule5 + 104 /* &.xUpdate */))))(tls, pVtab6, nArg1, apArg1, bp+928 /* &rowid1 */) (*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict Xsqlite3VtabImportErrmsg(tls, p, pVtab6) if !((rc == SQLITE_OK) && ((*Op)(unsafe.Pointer(pOp)).Fp1 != 0)) { - goto __829 + goto __849 } - (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Sqlite_int64)(unsafe.Pointer(bp + 840 /* rowid1 */)) -__829: + (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Sqlite_int64)(unsafe.Pointer(bp + 928 /* rowid1 */)) +__849: ; if !(((rc & 0xff) == SQLITE_CONSTRAINT) && ((*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FbConstraint != 0)) { - goto __830 + goto __850 } if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5) == OE_Ignore) { - goto __832 + goto __852 } rc = SQLITE_OK - goto __833 -__832: + goto __853 +__852: (*Vdbe)(unsafe.Pointer(p)).FerrorAction = func() uint8 { if int32((*Op)(unsafe.Pointer(pOp)).Fp5) == OE_Replace { - return OE_Abort + return uint8(OE_Abort) } return uint8((*Op)(unsafe.Pointer(pOp)).Fp5) }() -__833: +__853: ; - goto __831 -__830: + goto __851 +__850: (*Vdbe)(unsafe.Pointer(p)).FnChange++ -__831: +__851: ; if !(rc != 0) { - goto __834 + goto __854 } goto abort_due_to_error -__834: +__854: ; -__825: +__845: ; goto __10 // Opcode: Pagecount P1 P2 * * * // // Write the current number of pages in database P1 to memory cell P2. -__175: // out2 +__178: // out2 pOut = out2Prerelease(tls, p, pOp) *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt)) goto __10 @@ -72390,22 +72958,22 @@ __175: // out2 // do not change the maximum page count value if P3==0. // // Store the maximum page count after the change in register P2. -__176: +__179: pOut = out2Prerelease(tls, p, pOp) pBt3 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt newMax = uint32(0) if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) { - goto __835 + goto __855 } newMax = Xsqlite3BtreeLastPage(tls, pBt3) if !(newMax < uint32((*Op)(unsafe.Pointer(pOp)).Fp3)) { - goto __836 + goto __856 } newMax = uint32((*Op)(unsafe.Pointer(pOp)).Fp3) -__836: +__856: ; -__835: +__855: ; *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(Xsqlite3BtreeMaxPageCount(tls, pBt3, newMax)) goto __10 @@ -72454,8 +73022,8 @@ __835: // if they were, they throw an error. // // See also: AggStep, AggFinal, Function -__177: // group -__178: +__180: // group +__181: ; pCtx2 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) @@ -72465,24 +73033,24 @@ __178: // reinitializes the relavant parts of the sqlite3_context object pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56) if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpOut != pOut) { - goto __837 + goto __857 } (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpVdbe = p (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpOut = pOut i8 = (int32((*Sqlite3_context)(unsafe.Pointer(pCtx2)).Fargc) - 1) -__838: +__858: if !(i8 >= 0) { - goto __840 + goto __860 } *(*uintptr)(unsafe.Pointer((pCtx2 + 48 /* &.argv */) + uintptr(i8)*8)) = (aMem + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2+i8))*56) - goto __839 -__839: + goto __859 +__859: i8-- - goto __838 - goto __840 -__840: + goto __858 + goto __860 +__860: ; -__837: +__857: ; (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & libc.CplInt32((MEM_TypeMask | MEM_Zero))) | MEM_Null)) @@ -72491,38 +73059,38 @@ __837: // If the function returned an error, throw an exception if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0) { - goto __841 + goto __861 } if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0) { - goto __842 + goto __862 } Xsqlite3VdbeError(tls, p, ts+824 /* "%s" */, libc.VaList(bp+128, Xsqlite3_value_text(tls, pOut))) rc = (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError -__842: +__862: ; Xsqlite3VdbeDeleteAuxData(tls, db, (p + 288 /* &.pAuxData */), (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*Op)(unsafe.Pointer(pOp)).Fp1) (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError = 0 if !(rc != 0) { - goto __843 + goto __863 } goto abort_due_to_error -__843: +__863: ; -__841: +__861: ; // Copy the result of the function into register P3 if !((int32((*Mem)(unsafe.Pointer(pOut)).Fflags) & (MEM_Str | MEM_Blob)) != 0) { - goto __844 + goto __864 } Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding)) if !(Xsqlite3VdbeMemTooBig(tls, pOut) != 0) { - goto __845 + goto __865 } goto too_big -__845: +__865: ; -__844: +__864: ; updateMaxBlobsize(tls, pOut) @@ -72551,8 +73119,8 @@ __844: // // If P3 is not zero, then it is an address to jump to if an SQLITE_CORRUPT // error is encountered. -__179: -__180: +__182: +__183: // If the P4 argument is not NULL, then it must be an SQL comment string. // The "--" string is broken up to prevent false-positives with srcck1.c. @@ -72574,61 +73142,61 @@ __180: } return (*Vdbe)(unsafe.Pointer(p)).FzSql }())) != uintptr(0))) { - goto __846 + goto __866 } if !((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_LEGACY) != 0) { - goto __847 + goto __867 } z2 = Xsqlite3VdbeExpandSql(tls, p, zTrace) - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((db + 232 /* &.trace */ /* &.xLegacy */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, z2) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((db + 240 /* &.trace */ /* &.xLegacy */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, z2) Xsqlite3_free(tls, z2) - goto __848 -__847: + goto __868 +__867: if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 1) { - goto __849 + goto __869 } - z3 = Xsqlite3MPrintf(tls, db, ts+7728 /* "-- %s" */, libc.VaList(bp+136, zTrace)) - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_STMT, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) + z3 = Xsqlite3MPrintf(tls, db, ts+7821 /* "-- %s" */, libc.VaList(bp+136, zTrace)) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 240 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) Xsqlite3DbFree(tls, db, z3) - goto __850 -__849: - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_STMT, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, zTrace) -__850: + goto __870 +__869: + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 240 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_STMT), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, zTrace) +__870: ; -__848: +__868: ; -__846: +__866: ; if !((*Op)(unsafe.Pointer(pOp)).Fp1 >= Xsqlite3Config.FiOnceResetThreshold) { - goto __851 + goto __871 } if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == OP_Trace) { - goto __852 + goto __872 } goto __10 -__852: +__872: ; i9 = 1 -__853: +__873: if !(i9 < (*Vdbe)(unsafe.Pointer(p)).FnOp) { - goto __855 + goto __875 } if !(int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(i9)*32)).Fopcode) == OP_Once) { - goto __856 + goto __876 } (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(i9)*32)).Fp1 = 0 -__856: +__876: ; - goto __854 -__854: + goto __874 +__874: i9++ - goto __853 - goto __855 -__855: + goto __873 + goto __875 +__875: ; (*Op)(unsafe.Pointer(pOp)).Fp1 = 0 -__851: +__871: ; (*Op)(unsafe.Pointer(pOp)).Fp1++ *(*U32)(unsafe.Pointer((p + 212 /* &.aCounter */) + 6*4))++ @@ -72642,7 +73210,7 @@ __851: // is to say when the EXPLAIN QUERY PLAN syntax is used.) // This opcode records information from the optimizer. It is the // the same as a no-op. This opcodesnever appears in a real VM program. -__181: // This is really OP_Noop, OP_Explain +__184: // This is really OP_Noop, OP_Explain ; goto __10 @@ -72673,57 +73241,65 @@ __7: // an error of some kind. abort_due_to_error: if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - goto __857 + goto __877 } rc = SQLITE_NOMEM -__857: + goto __878 +__877: + if !(rc == (SQLITE_IOERR | (int32(33) << 8))) { + goto __879 + } + rc = Xsqlite3CorruptError(tls, 94151) +__879: + ; +__878: ; if !(((*Vdbe)(unsafe.Pointer(p)).FzErrMsg == uintptr(0)) && (rc != (SQLITE_IOERR | (int32(12) << 8)))) { - goto __858 + goto __880 } Xsqlite3VdbeError(tls, p, ts+824 /* "%s" */, libc.VaList(bp+144, Xsqlite3ErrStr(tls, rc))) -__858: +__880: ; (*Vdbe)(unsafe.Pointer(p)).Frc = rc Xsqlite3SystemError(tls, db, rc) - Xsqlite3_log(tls, rc, ts+7734, /* "statement aborts..." */ + Xsqlite3_log(tls, rc, ts+7827, /* "statement aborts..." */ libc.VaList(bp+152, (int32((int64(pOp)-int64(aOp))/32)), (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)) Xsqlite3VdbeHalt(tls, p) if !(rc == (SQLITE_IOERR | (int32(12) << 8))) { - goto __859 + goto __881 } Xsqlite3OomFault(tls, db) -__859: +__881: ; rc = SQLITE_ERROR if !(int32(resetSchemaOnFault) > 0) { - goto __860 + goto __882 } Xsqlite3ResetOneSchema(tls, db, (int32(resetSchemaOnFault) - 1)) -__860: +__882: ; // This is the only way out of this procedure. We have to // release the mutexes on btrees that were acquired at the // top. vdbe_return: -__861: +__883: if !((nVmStep >= nProgressLimit) && ((*Sqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0))) { - goto __862 + goto __884 } nProgressLimit = nProgressLimit + (U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)) - if !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 504 /* &.xProgress */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) { - goto __863 + if !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 512 /* &.xProgress */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) { + goto __885 } nProgressLimit = (uint64(0xffffffff) | (U64((uint64(0xffffffff))) << 32)) rc = SQLITE_INTERRUPT goto abort_due_to_error -__863: +__885: ; - goto __861 -__862: + goto __883 +__884: ; *(*U32)(unsafe.Pointer((p + 212 /* &.aCounter */) + 4*4)) += (U32(int32(nVmStep))) Xsqlite3VdbeLeave(tls, p) @@ -72733,14 +73309,14 @@ __862: // Jump to here if a string or blob larger than SQLITE_MAX_LENGTH // is encountered. too_big: - Xsqlite3VdbeError(tls, p, ts+7050 /* "string or blob t..." */, 0) + Xsqlite3VdbeError(tls, p, ts+7126 /* "string or blob t..." */, 0) rc = SQLITE_TOOBIG goto abort_due_to_error // Jump to here if a malloc() fails. no_mem: Xsqlite3OomFault(tls, db) - Xsqlite3VdbeError(tls, p, ts+7766 /* "out of memory" */, 0) + Xsqlite3VdbeError(tls, p, ts+7859 /* "out of memory" */, 0) rc = SQLITE_NOMEM goto abort_due_to_error @@ -72753,15 +73329,15 @@ abort_due_to_interrupt: return int32(0) } -var azType = [4]uintptr{ts + 7780 /* "NOT NULL" */, ts + 7789 /* "UNIQUE" */, ts + 7796, /* "CHECK" */ - ts + 7802 /* "FOREIGN KEY" */} /* sqlite3.c:86430:25 */ -var aLTb = [6]uint8{uint8(1), uint8(0), uint8(0), uint8(1), uint8(1), uint8(0)} /* sqlite3.c:87455:32 */ -var aEQb = [6]uint8{uint8(0), uint8(1), uint8(0), uint8(1), uint8(0), uint8(1)} /* sqlite3.c:87458:32 */ -var aGTb = [6]uint8{uint8(1), uint8(0), uint8(1), uint8(0), uint8(0), uint8(1)} /* sqlite3.c:87461:32 */ -var and_logic = [9]uint8{uint8(0), uint8(0), uint8(0), uint8(0), uint8(1), uint8(2), uint8(0), uint8(2), uint8(2)} /* sqlite3.c:87681:32 */ -var or_logic = [9]uint8{uint8(0), uint8(1), uint8(2), uint8(1), uint8(1), uint8(1), uint8(2), uint8(1), uint8(2)} /* sqlite3.c:87684:32 */ -var aFlag1 = [2]U16{MEM_Blob, (U16(MEM_Str | MEM_Term))} /* sqlite3.c:88134:24 */ -var vfsFlags int32 = ((((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) | SQLITE_OPEN_TRANSIENT_DB) /* sqlite3.c:89263:20 */ +var azType = [4]uintptr{ts + 7873 /* "NOT NULL" */, ts + 7882 /* "UNIQUE" */, ts + 7889, /* "CHECK" */ + ts + 7895 /* "FOREIGN KEY" */} /* sqlite3.c:87056:25 */ +var aLTb = [6]uint8{uint8(1), uint8(0), uint8(0), uint8(1), uint8(1), uint8(0)} /* sqlite3.c:88073:32 */ +var aEQb = [6]uint8{uint8(0), uint8(1), uint8(0), uint8(1), uint8(0), uint8(1)} /* sqlite3.c:88076:32 */ +var aGTb = [6]uint8{uint8(1), uint8(0), uint8(1), uint8(0), uint8(0), uint8(1)} /* sqlite3.c:88079:32 */ +var and_logic = [9]uint8{uint8(0), uint8(0), uint8(0), uint8(0), uint8(1), uint8(2), uint8(0), uint8(2), uint8(2)} /* sqlite3.c:88299:32 */ +var or_logic = [9]uint8{uint8(0), uint8(1), uint8(2), uint8(1), uint8(1), uint8(1), uint8(2), uint8(1), uint8(2)} /* sqlite3.c:88302:32 */ +var aFlag1 = [2]U16{U16(MEM_Blob), (U16(MEM_Str | MEM_Term))} /* sqlite3.c:88752:24 */ +var vfsFlags int32 = ((((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) | SQLITE_OPEN_TRANSIENT_DB) /* sqlite3.c:89887:20 */ //************* End of vdbe.c *********************************************** //************* Begin file vdbeblob.c *************************************** @@ -72792,7 +73368,7 @@ type Incrblob1 = struct { Fdb uintptr FzDb uintptr FpTab uintptr -} /* sqlite3.c:93397:9 */ +} /* sqlite3.c:94241:9 */ //************* End of vdbe.c *********************************************** //************* Begin file vdbeblob.c *************************************** @@ -72813,7 +73389,7 @@ type Incrblob1 = struct { // #include "vdbeInt.h" // Valid sqlite3_blob* handles point to Incrblob structures. -type Incrblob = Incrblob1 /* sqlite3.c:93397:25 */ +type Incrblob = Incrblob1 /* sqlite3.c:94241:25 */ // 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. @@ -72830,7 +73406,7 @@ type Incrblob = Incrblob1 /* sqlite3.c:93397:25 */ // 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 *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) int32 { /* sqlite3.c:93427:12: */ +func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) int32 { /* sqlite3.c:94271:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -72840,7 +73416,7 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) // Set the value of register r[1] in the SQL statement to integer iRow. // This is done directly as a performance optimization - (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56)).Fflags = MEM_Int + (*Mem)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56)).Fflags = U16(MEM_Int) *(*I64)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + 1*56 /* &.u */)) = iRow // If the statement has been run before (and is paused at the OP_ResultRow) @@ -72864,16 +73440,16 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) } if type1 < U32(12) { - zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+7814, /* "cannot open valu..." */ + zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+7907, /* "cannot open valu..." */ libc.VaList(bp, func() uintptr { if type1 == U32(0) { - return ts + 7843 /* "null" */ + return ts + 7936 /* "null" */ } return func() uintptr { if type1 == U32(7) { - return ts + 7848 /* "real" */ + return ts + 7941 /* "real" */ } - return ts + 7853 /* "integer" */ + return ts + 7946 /* "integer" */ }() }())) rc = SQLITE_ERROR @@ -72893,7 +73469,7 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) rc = Xsqlite3_finalize(tls, (*Incrblob)(unsafe.Pointer(p)).FpStmt) (*Incrblob)(unsafe.Pointer(p)).FpStmt = uintptr(0) if rc == SQLITE_OK { - zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+7861 /* "no such rowid: %..." */, libc.VaList(bp+8, iRow)) + zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+7954 /* "no such rowid: %..." */, libc.VaList(bp+8, iRow)) rc = SQLITE_ERROR } else { zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+824 /* "%s" */, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb))) @@ -72905,18 +73481,18 @@ func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) } // Open a blob handle. -func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, zColumn uintptr, iRow Sqlite_int64, wrFlag int32, ppBlob uintptr) int32 { /* sqlite3.c:93492:16: */ - bp := tls.Alloc(480) - defer tls.Free(480) +func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, zColumn uintptr, iRow Sqlite_int64, wrFlag int32, ppBlob uintptr) int32 { /* sqlite3.c:94336:16: */ + bp := tls.Alloc(464) + defer tls.Free(464) var nAttempt int32 var iCol int32 // Index of zColumn in row-record var rc int32 - // var zErr uintptr at bp+472, 8 + // var zErr uintptr at bp+456, 8 var pTab uintptr var pBlob uintptr - // var sParse Parse at bp+48, 424 + // var sParse Parse at bp+48, 408 var j int32 // Check that the column is not part of an FK child key definition. It @@ -72932,7 +73508,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, var aOp uintptr nAttempt = 0 rc = SQLITE_OK - *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)) = uintptr(0) pBlob = uintptr(0) *(*uintptr)(unsafe.Pointer(ppBlob)) = uintptr(0) @@ -72950,8 +73526,8 @@ __1: __4: ; (*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).Fdb = db - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */))) - *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = uintptr(0) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */))) + *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)) = uintptr(0) Xsqlite3BtreeEnterAll(tls, db) pTab = Xsqlite3LocateTable(tls, bp+48 /* &sParse */, uint32(0), zTable, zDb) @@ -72959,21 +73535,21 @@ __4: goto __5 } pTab = uintptr(0) - Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+7881 /* "cannot open virt..." */, libc.VaList(bp, zTable)) + Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+7974 /* "cannot open virt..." */, libc.VaList(bp, zTable)) __5: ; - if !((pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !((pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __6 } pTab = uintptr(0) - Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+7911 /* "cannot open tabl..." */, libc.VaList(bp+8, zTable)) + Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+8004 /* "cannot open tabl..." */, libc.VaList(bp+8, zTable)) __6: ; if !((pTab != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) { goto __7 } pTab = uintptr(0) - Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+7947 /* "cannot open view..." */, libc.VaList(bp+16, zTable)) + Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+8040 /* "cannot open view..." */, libc.VaList(bp+16, zTable)) __7: ; if !(!(pTab != 0)) { @@ -72982,8 +73558,8 @@ __7: if !((*Parse)(unsafe.Pointer(bp+48 /* &sParse */)).FzErrMsg != 0) { goto __9 } - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */))) - *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = (*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FzErrMsg + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */))) + *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)) = (*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FzErrMsg (*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FzErrMsg = uintptr(0) __9: ; @@ -73017,8 +73593,8 @@ __12: if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { goto __14 } - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */))) - *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+7968 /* "no such column: ..." */, libc.VaList(bp+24, zColumn)) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */))) + *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+8061 /* "no such column: ..." */, libc.VaList(bp+24, zColumn)) rc = SQLITE_ERROR Xsqlite3BtreeLeaveAll(tls, db) goto blob_open_out @@ -73031,7 +73607,7 @@ __14: goto __15 } zFault = uintptr(0) - if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) { + if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) { goto __16 } pFKey = (*Table)(unsafe.Pointer(pTab)).FpFKey @@ -73047,7 +73623,7 @@ __20: if !((*sColMap)(unsafe.Pointer((pFKey+64 /* &.aCol */)+uintptr(j)*16)).FiFrom == iCol) { goto __23 } - zFault = ts + 7989 /* "foreign key" */ + zFault = ts + 8082 /* "foreign key" */ __23: ; goto __21 @@ -73080,7 +73656,7 @@ __27: if !((int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == iCol) || (int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == (-2))) { goto __30 } - zFault = ts + 8001 /* "indexed" */ + zFault = ts + 8094 /* "indexed" */ __30: ; goto __28 @@ -73100,8 +73676,8 @@ __26: if !(zFault != 0) { goto __31 } - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */))) - *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+8009 /* "cannot open %s c..." */, libc.VaList(bp+32, zFault)) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */))) + *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+8102 /* "cannot open %s c..." */, libc.VaList(bp+32, zFault)) rc = SQLITE_ERROR Xsqlite3BtreeLeaveAll(tls, db) goto blob_open_out @@ -73148,7 +73724,7 @@ __33: if !(wrFlag != 0) { goto __35 } - (*VdbeOp)(unsafe.Pointer(aOp + 1*32)).Fopcode = OP_OpenWrite + (*VdbeOp)(unsafe.Pointer(aOp + 1*32)).Fopcode = U8(OP_OpenWrite) __35: ; (*VdbeOp)(unsafe.Pointer(aOp + 1*32)).Fp2 = int32((*Table)(unsafe.Pointer(pTab)).Ftnum) @@ -73182,7 +73758,7 @@ __32: goto blob_open_out __36: ; - rc = blobSeekToRow(tls, pBlob, iRow, bp+472 /* &zErr */) + rc = blobSeekToRow(tls, pBlob, iRow, bp+456 /* &zErr */) goto __2 __2: if ((libc.PreIncInt32(&nAttempt, 1)) < SQLITE_MAX_SCHEMA_RETRY) && (rc == SQLITE_SCHEMA) { @@ -73209,32 +73785,32 @@ __39: __38: ; Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr { - if *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) != 0 { + if *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)) != 0 { return ts + 824 /* "%s" */ } return uintptr(0) - }(), libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)))) - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */))) + }(), libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */)))) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 456 /* zErr */))) Xsqlite3ParserReset(tls, bp+48 /* &sParse */) rc = Xsqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return rc } -var iLn int32 = 0 /* sqlite3.c:93635:24 */ +var iLn int32 = 0 /* sqlite3.c:94479:24 */ var openBlob = [6]VdbeOpList{ - {Fopcode: OP_TableLock}, // 0: Acquire a read or write lock - {Fopcode: OP_OpenRead}, // 1: Open a cursor + {Fopcode: U8(OP_TableLock)}, // 0: Acquire a read or write lock + {Fopcode: U8(OP_OpenRead)}, // 1: Open a cursor // blobSeekToRow() will initialize r[1] to the desired rowid - {Fopcode: OP_NotExists, Fp2: int8(5), Fp3: int8(1)}, // 2: Seek the cursor to rowid=r[1] - {Fopcode: OP_Column, Fp3: int8(1)}, // 3 - {Fopcode: OP_ResultRow, Fp1: int8(1)}, // 4 - {Fopcode: OP_Halt}, // 5 -} /* sqlite3.c:93636:31 */ + {Fopcode: U8(OP_NotExists), Fp2: int8(5), Fp3: int8(1)}, // 2: Seek the cursor to rowid=r[1] + {Fopcode: U8(OP_Column), Fp3: int8(1)}, // 3 + {Fopcode: U8(OP_ResultRow), Fp1: int8(1)}, // 4 + {Fopcode: U8(OP_Halt)}, // 5 +} /* sqlite3.c:94480:31 */ // Close a blob handle that was previously created using // sqlite3_blob_open(). -func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:93725:16: */ +func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:94569:16: */ var p uintptr = pBlob var rc int32 var db uintptr @@ -73253,14 +73829,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:9372 } // Perform a read or write operation on a blob -func blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) int32 { /* sqlite3.c:93746:12: */ +func blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) int32 { /* sqlite3.c:94590:12: */ var rc int32 var p uintptr = pBlob var v uintptr var db uintptr if p == uintptr(0) { - return Xsqlite3MisuseError(tls, 93758) + return Xsqlite3MisuseError(tls, 94602) } db = (*Incrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -73316,14 +73892,14 @@ func blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int } // Read data from a blob handle. -func Xsqlite3_blob_read(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:93819:16: */ +func Xsqlite3_blob_read(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:94663:16: */ return blobReadWrite(tls, pBlob, z, n, iOffset, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, U32, U32, uintptr) int32 }{Xsqlite3BtreePayloadChecked}))) } // Write data to a blob handle. -func Xsqlite3_blob_write(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:93826:16: */ +func Xsqlite3_blob_write(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:94670:16: */ return blobReadWrite(tls, pBlob, z, n, iOffset, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, U32, U32, uintptr) int32 }{Xsqlite3BtreePutData}))) @@ -73333,7 +73909,7 @@ func Xsqlite3_blob_write(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffs // // The Incrblob.nByte field is fixed for the lifetime of the Incrblob // so no mutex is required for access. -func Xsqlite3_blob_bytes(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:93836:16: */ +func Xsqlite3_blob_bytes(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:94680:16: */ var p uintptr = pBlob if (p != 0) && ((*Incrblob)(unsafe.Pointer(p)).FpStmt != 0) { return (*Incrblob)(unsafe.Pointer(p)).FnByte @@ -73349,7 +73925,7 @@ func Xsqlite3_blob_bytes(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:9383 // 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 *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int32 { /* sqlite3.c:93851:16: */ +func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int32 { /* sqlite3.c:94695:16: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -73358,7 +73934,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int3 var db uintptr if p == uintptr(0) { - return Xsqlite3MisuseError(tls, 93856) + return Xsqlite3MisuseError(tls, 94700) } db = (*Incrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -73544,7 +74120,7 @@ type MergeEngine1 = struct { FpTask uintptr FaTree uintptr FaReadr uintptr -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ //************* End of vdbeblob.c ******************************************* //************* Begin file vdbesort.c *************************************** @@ -73695,7 +74271,7 @@ type MergeEngine1 = struct { // overflows. 512MiB. // Private objects used by the sorter -type MergeEngine = MergeEngine1 /* sqlite3.c:94044:28 */ // Merge PMAs together +type MergeEngine = MergeEngine1 /* sqlite3.c:94888:28 */ // Merge PMAs together type PmaReader1 = struct { FiReadOff I64 FiEof I64 @@ -73709,10 +74285,10 @@ type PmaReader1 = struct { _ [4]byte FaMap uintptr FpIncr uintptr -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // Merge PMAs together -type PmaReader = PmaReader1 /* sqlite3.c:94045:26 */ // Incrementally read one PMA +type PmaReader = PmaReader1 /* sqlite3.c:94889:26 */ // Incrementally read one PMA type PmaWriter1 = struct { FeFWErr int32 _ [4]byte @@ -73723,18 +74299,18 @@ type PmaWriter1 = struct { _ [4]byte FiWriteOff I64 FpFd uintptr -} /* sqlite3.c:94046:9 */ +} /* sqlite3.c:94890:9 */ // Incrementally read one PMA -type PmaWriter = PmaWriter1 /* sqlite3.c:94046:26 */ // Incrementally write one PMA +type PmaWriter = PmaWriter1 /* sqlite3.c:94890:26 */ // Incrementally write one PMA type SorterRecord1 = struct { FnVal int32 _ [4]byte Fu struct{ FpNext uintptr } -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // Incrementally write one PMA -type SorterRecord = SorterRecord1 /* sqlite3.c:94047:29 */ // A record being sorted +type SorterRecord = SorterRecord1 /* sqlite3.c:94891:29 */ // A record being sorted type SortSubtask1 = struct { FpThread uintptr FbDone int32 @@ -73747,26 +74323,26 @@ type SortSubtask1 = struct { FxCompare SorterCompare Ffile SorterFile Ffile2 SorterFile -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // A record being sorted -type SortSubtask = SortSubtask1 /* sqlite3.c:94048:28 */ // A sub-task in the sort process +type SortSubtask = SortSubtask1 /* sqlite3.c:94892:28 */ // A sub-task in the sort process type SorterFile1 = struct { FpFd uintptr FiEof I64 -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // A sub-task in the sort process -type SorterFile = SorterFile1 /* sqlite3.c:94049:27 */ // Temporary file object wrapper +type SorterFile = SorterFile1 /* sqlite3.c:94893:27 */ // Temporary file object wrapper type SorterList1 = struct { FpList uintptr FaMemory uintptr FszPMA int32 _ [4]byte -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // Temporary file object wrapper -type SorterList = SorterList1 /* sqlite3.c:94050:27 */ // In-memory list of records +type SorterList = SorterList1 /* sqlite3.c:94894:27 */ // In-memory list of records type IncrMerger1 = struct { FpTask uintptr FpMerger uintptr @@ -73776,10 +74352,10 @@ type IncrMerger1 = struct { FbUseThread int32 _ [4]byte FaFile [2]SorterFile -} /* sqlite3.c:20763:9 */ +} /* sqlite3.c:21036:9 */ // In-memory list of records -type IncrMerger = IncrMerger1 /* sqlite3.c:94051:27 */ +type IncrMerger = IncrMerger1 /* sqlite3.c:94895:27 */ // This object represents a single thread of control in a sort operation. // Exactly VdbeSorter.nTask instances of this object are allocated @@ -73810,11 +74386,11 @@ type IncrMerger = IncrMerger1 /* sqlite3.c:94051:27 */ // In both cases, the effects of the main thread seeing (bDone==0) even // after the thread has finished are not dire. So we don't worry about // memory barriers and such here. -type SorterCompare = uintptr /* sqlite3.c:94178:13 */ +type SorterCompare = uintptr /* sqlite3.c:95022:13 */ // Free all memory belonging to the PmaReader object passed as the // argument. All structure fields are set to zero before returning. -func vdbePmaReaderClear(tls *libc.TLS, pReadr uintptr) { /* sqlite3.c:94353:13: */ +func vdbePmaReaderClear(tls *libc.TLS, pReadr uintptr) { /* sqlite3.c:95197:13: */ Xsqlite3_free(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FaAlloc) Xsqlite3_free(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer) if (*PmaReader)(unsafe.Pointer(pReadr)).FaMap != 0 { @@ -73831,7 +74407,7 @@ func vdbePmaReaderClear(tls *libc.TLS, pReadr uintptr) { /* sqlite3.c:94353:13: // // The buffer returned in *ppOut is only valid until the // next call to this function. -func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32 { /* sqlite3.c:94370:12: */ +func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32 { /* sqlite3.c:95214:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -73935,7 +74511,7 @@ func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32 // Read a varint from the stream of data accessed by p. Set *pnOut to // the value read. -func vdbePmaReadVarint(tls *libc.TLS, p uintptr, pnOut uintptr) int32 { /* sqlite3.c:94464:12: */ +func vdbePmaReadVarint(tls *libc.TLS, p uintptr, pnOut uintptr) int32 { /* sqlite3.c:95308:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -73975,7 +74551,7 @@ func vdbePmaReadVarint(tls *libc.TLS, p uintptr, pnOut uintptr) int32 { /* sqlit // // Or, if an error occurs, return an SQLite error code. The final value of // *pp is undefined in this case. -func vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) int32 { /* sqlite3.c:94497:12: */ +func vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) int32 { /* sqlite3.c:95341:12: */ var rc int32 = SQLITE_OK if (*SorterFile)(unsafe.Pointer(pFile)).FiEof <= (I64((*Sqlite3)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap)) { var pFd uintptr = (*SorterFile)(unsafe.Pointer(pFile)).FpFd @@ -73990,7 +74566,7 @@ func vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) // 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 *libc.TLS, pTask uintptr, pReadr uintptr, pFile uintptr, iOff I64) int32 { /* sqlite3.c:94514:12: */ +func vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uintptr, iOff I64) int32 { /* sqlite3.c:95358:12: */ var rc int32 = SQLITE_OK if Xsqlite3FaultSim(tls, 201) != 0 { @@ -74031,7 +74607,7 @@ func vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uintp // 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 *libc.TLS, pReadr uintptr) int32 { /* sqlite3.c:94561:12: */ +func vdbePmaReaderNext(tls *libc.TLS, pReadr uintptr) int32 { /* sqlite3.c:95405:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -74077,7 +74653,7 @@ func vdbePmaReaderNext(tls *libc.TLS, pReadr uintptr) int32 { /* sqlite3.c:94561 // // 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 *libc.TLS, pTask uintptr, pFile uintptr, iStart I64, pReadr uintptr, pnByte uintptr) int32 { /* sqlite3.c:94608:12: */ +func vdbePmaReaderInit(tls *libc.TLS, pTask uintptr, pFile uintptr, iStart I64, pReadr uintptr, pnByte uintptr) int32 { /* sqlite3.c:95452:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -74100,7 +74676,7 @@ func vdbePmaReaderInit(tls *libc.TLS, pTask uintptr, pFile uintptr, iStart I64, // 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 *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94641:12: */ +func vdbeSorterCompareTail(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:95485:12: */ var r2 uintptr = (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked if *(*int32)(unsafe.Pointer(pbKey2Cached)) == 0 { Xsqlite3VdbeRecordUnpack(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo, nKey2, pKey2, r2) @@ -74120,7 +74696,7 @@ func vdbeSorterCompareTail(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, p // // If an OOM error is encountered, (pTask->pUnpacked->error_rc) is set // to SQLITE_NOMEM. -func vdbeSorterCompare(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94668:12: */ +func vdbeSorterCompare(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:95512:12: */ var r2 uintptr = (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked if !(*(*int32)(unsafe.Pointer(pbKey2Cached)) != 0) { Xsqlite3VdbeRecordUnpack(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo, nKey2, pKey2, r2) @@ -74132,7 +74708,7 @@ func vdbeSorterCompare(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 // 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 *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94687:12: */ +func vdbeSorterCompareText(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:95531:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -74182,7 +74758,7 @@ func vdbeSorterCompareText(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, p // A specially optimized version of vdbeSorterCompare() that assumes that // the first field of each key is an INTEGER value. -func vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94729:12: */ +func vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:95573:12: */ var p1 uintptr = pKey1 var p2 uintptr = pKey2 var s1 int32 = int32(*(*U8)(unsafe.Pointer(p1 + 1))) // Left hand serial type @@ -74242,7 +74818,7 @@ func vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pK return res } -var aLen = [10]U8{U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(0), U8(0), U8(0)} /* sqlite3.c:94748:21 */ +var aLen = [10]U8{U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(0), U8(0), U8(0)} /* sqlite3.c:95592:21 */ // Initialize the temporary index cursor just opened as a sorter cursor. // @@ -74261,7 +74837,7 @@ var aLen = [10]U8{U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(0), U8(0), // mode, but not in multi-threaded mode. // // SQLITE_OK is returned if successful, or an SQLite error code otherwise. -func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) int32 { /* sqlite3.c:94812:20: */ +func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) int32 { /* sqlite3.c:95656:20: */ var pgsz int32 // Page size of main database var i int32 // Used to iterate through aTask[] var pSorter uintptr // The new sorter @@ -74275,7 +74851,7 @@ func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt if (Xsqlite3TempInMemory(tls, db) != 0) || (int32(Xsqlite3Config.FbCoreMutex) == 0) { nWorker = 0 } else { - nWorker = *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 11*4)) + nWorker = *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 11*4)) } // Do not allow the total number of threads (main thread + all workers) @@ -74289,13 +74865,16 @@ func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt if pSorter == uintptr(0) { rc = SQLITE_NOMEM } else { + var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt (*VdbeSorter)(unsafe.Pointer(pSorter)).FpKeyInfo = libc.AssignUintptr(&pKeyInfo, (pSorter + uintptr(sz))) libc.Xmemcpy(tls, pKeyInfo, (*VdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo, uint64(szKeyInfo)) (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb = uintptr(0) if (nField != 0) && (nWorker == 0) { (*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField = U16(nField) } - (*VdbeSorter)(unsafe.Pointer(pSorter)).Fpgsz = libc.AssignInt32(&pgsz, Xsqlite3BtreeGetPageSize(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt)) + Xsqlite3BtreeEnter(tls, pBt) + (*VdbeSorter)(unsafe.Pointer(pSorter)).Fpgsz = libc.AssignInt32(&pgsz, Xsqlite3BtreeGetPageSize(tls, pBt)) + Xsqlite3BtreeLeave(tls, pBt) (*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask = (U8(nWorker + 1)) (*VdbeSorter)(unsafe.Pointer(pSorter)).FiPrev = (U8(nWorker - 1)) (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads = (U8(libc.Bool32(int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) > 1))) @@ -74354,7 +74933,7 @@ func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } // Free the list of sorted records starting at pRecord. -func vdbeSorterRecordFree(tls *libc.TLS, db uintptr, pRecord uintptr) { /* sqlite3.c:94914:13: */ +func vdbeSorterRecordFree(tls *libc.TLS, db uintptr, pRecord uintptr) { /* sqlite3.c:95761:13: */ var p uintptr var pNext uintptr for p = pRecord; p != 0; p = pNext { @@ -74365,7 +74944,7 @@ func vdbeSorterRecordFree(tls *libc.TLS, db uintptr, pRecord uintptr) { /* sqlit // Free all resources owned by the object indicated by argument pTask. All // fields of *pTask are zeroed before returning. -func vdbeSortSubtaskCleanup(tls *libc.TLS, db uintptr, pTask uintptr) { /* sqlite3.c:94927:13: */ +func vdbeSortSubtaskCleanup(tls *libc.TLS, db uintptr, pTask uintptr) { /* sqlite3.c:95774:13: */ Xsqlite3DbFree(tls, db, (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked) // pTask->list.aMemory can only be non-zero if it was handed memory // from the main thread. That only occurs SQLITE_MAX_WORKER_THREADS>0 @@ -74385,13 +74964,13 @@ func vdbeSortSubtaskCleanup(tls *libc.TLS, db uintptr, pTask uintptr) { /* sqlit } // Join thread pTask->thread. -func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:94992:12: */ +func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:95839:12: */ bp := tls.Alloc(8) defer tls.Free(8) var rc int32 = SQLITE_OK if (*SortSubtask)(unsafe.Pointer(pTask)).FpThread != 0 { - *(*uintptr)(unsafe.Pointer(bp /* pRet */)) = uintptr(SQLITE_ERROR) + *(*uintptr)(unsafe.Pointer(bp /* pRet */)) = uintptr(int64(SQLITE_ERROR)) Xsqlite3ThreadJoin(tls, (*SortSubtask)(unsafe.Pointer(pTask)).FpThread, bp /* &pRet */) @@ -74404,14 +74983,14 @@ func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:949 } // Launch a background thread to run xTask(pIn). -func vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:95013:12: */ +func vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:95860:12: */ return Xsqlite3ThreadCreate(tls, (pTask /* &.pThread */), xTask, pIn) } // Join all outstanding threads launched by SorterWrite() to create // level-0 PMAs. -func vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) int32 { /* sqlite3.c:95026:12: */ +func vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) int32 { /* sqlite3.c:95873:12: */ var rc int32 = rcin var i int32 @@ -74437,7 +75016,7 @@ func vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) int32 { /* sq // // 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 *libc.TLS, nReader int32) uintptr { /* sqlite3.c:95056:20: */ +func vdbeMergeEngineNew(tls *libc.TLS, nReader int32) uintptr { /* sqlite3.c:95903:20: */ var N int32 = 2 // Smallest power of two >= nReader var nByte int32 // Total bytes of space to allocate var pNew uintptr // Pointer to allocated object to return @@ -74462,7 +75041,7 @@ func vdbeMergeEngineNew(tls *libc.TLS, nReader int32) uintptr { /* sqlite3.c:950 } // Free the MergeEngine object passed as the only argument. -func vdbeMergeEngineFree(tls *libc.TLS, pMerger uintptr) { /* sqlite3.c:95079:13: */ +func vdbeMergeEngineFree(tls *libc.TLS, pMerger uintptr) { /* sqlite3.c:95926:13: */ var i int32 if pMerger != 0 { for i = 0; i < (*MergeEngine)(unsafe.Pointer(pMerger)).FnTree; i++ { @@ -74474,7 +75053,7 @@ func vdbeMergeEngineFree(tls *libc.TLS, pMerger uintptr) { /* sqlite3.c:95079:13 // Free all resources associated with the IncrMerger object indicated by // the first argument. -func vdbeIncrFree(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:95093:13: */ +func vdbeIncrFree(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:95940:13: */ if pIncr != 0 { if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 { vdbeSorterJoinThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask) @@ -74491,7 +75070,7 @@ func vdbeIncrFree(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:95093:13: */ } // Reset a sorting cursor back to its original empty state. -func Xsqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { /* sqlite3.c:95110:21: */ +func Xsqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { /* sqlite3.c:95957:21: */ var i int32 vdbeSorterJoinAll(tls, pSorter, SQLITE_OK) @@ -74520,7 +75099,7 @@ func Xsqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { /* sq } // Free any cursor components allocated by sqlite3VdbeSorterXXX routines. -func Xsqlite3VdbeSorterClose(tls *libc.TLS, db uintptr, pCsr uintptr) { /* sqlite3.c:95143:21: */ +func Xsqlite3VdbeSorterClose(tls *libc.TLS, db uintptr, pCsr uintptr) { /* sqlite3.c:95990:21: */ var pSorter uintptr pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 56 /* &.uc */)) @@ -74539,7 +75118,7 @@ func Xsqlite3VdbeSorterClose(tls *libc.TLS, db uintptr, pCsr uintptr) { /* sqlit // // Whether or not the file does end up memory mapped of course depends on // the specific VFS implementation. -func vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, nByte I64) { /* sqlite3.c:95165:13: */ +func vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, nByte I64) { /* sqlite3.c:96012:13: */ bp := tls.Alloc(24) defer tls.Free(24) *(*I64)(unsafe.Pointer(bp + 8)) = nByte @@ -74557,7 +75136,7 @@ func vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, nByte I64) { / // 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 *libc.TLS, db uintptr, nExtend I64, ppFd uintptr) int32 { /* sqlite3.c:95184:12: */ +func vdbeSorterOpenTempFile(tls *libc.TLS, db uintptr, nExtend I64, ppFd uintptr) int32 { /* sqlite3.c:96031:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -74569,7 +75148,7 @@ func vdbeSorterOpenTempFile(tls *libc.TLS, db uintptr, nExtend I64, ppFd uintptr *(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3OsOpenMalloc(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), ppFd, ((((SQLITE_OPEN_TEMP_JOURNAL | SQLITE_OPEN_READWRITE) | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE), bp /* &rc */) if *(*int32)(unsafe.Pointer(bp /* rc */)) == SQLITE_OK { - *(*I64)(unsafe.Pointer(bp + 8 /* max */)) = SQLITE_MAX_MMAP_SIZE + *(*I64)(unsafe.Pointer(bp + 8 /* max */)) = int64(SQLITE_MAX_MMAP_SIZE) Xsqlite3OsFileControlHint(tls, *(*uintptr)(unsafe.Pointer(ppFd)), SQLITE_FCNTL_MMAP_SIZE, bp+8 /* &max */) if nExtend > int64(0) { vdbeSorterExtendFile(tls, db, *(*uintptr)(unsafe.Pointer(ppFd)), nExtend) @@ -74581,7 +75160,7 @@ func vdbeSorterOpenTempFile(tls *libc.TLS, db uintptr, nExtend I64, ppFd uintptr // 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 *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:95211:12: */ +func vdbeSortAllocUnpacked(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:96058:12: */ if (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked == uintptr(0) { (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked = Xsqlite3VdbeAllocUnpackedRecord(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo) if (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked == uintptr(0) { @@ -74594,7 +75173,7 @@ func vdbeSortAllocUnpacked(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:95 } // Merge the two sorted lists p1 and p2 into a single list. -func vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:95225:21: */ +func vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:96072:21: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -74631,7 +75210,7 @@ func vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintp // Return the SorterCompare function to compare values collected by the // sorter object passed as the only argument. -func vdbeSorterGetCompare(tls *libc.TLS, p uintptr) SorterCompare { /* sqlite3.c:95267:22: */ +func vdbeSorterGetCompare(tls *libc.TLS, p uintptr) SorterCompare { /* sqlite3.c:96114:22: */ if int32((*VdbeSorter)(unsafe.Pointer(p)).FtypeMask) == SORTER_TYPE_INTEGER { return *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32 @@ -74649,7 +75228,7 @@ func vdbeSorterGetCompare(tls *libc.TLS, p uintptr) SorterCompare { /* sqlite3.c // 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 *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:95281:12: */ +func vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:96128:12: */ bp := tls.Alloc(512) defer tls.Free(512) @@ -74706,7 +75285,7 @@ func vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqli } // Initialize a PMA-writer object. -func vdbePmaWriterInit(tls *libc.TLS, pFd uintptr, p uintptr, nBuf int32, iStart I64) { /* sqlite3.c:95332:13: */ +func vdbePmaWriterInit(tls *libc.TLS, pFd uintptr, p uintptr, nBuf int32, iStart I64) { /* sqlite3.c:96179:13: */ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(PmaWriter{}))) (*PmaWriter)(unsafe.Pointer(p)).FaBuffer = Xsqlite3Malloc(tls, uint64(nBuf)) if !(int32((*PmaWriter)(unsafe.Pointer(p)).FaBuffer) != 0) { @@ -74721,7 +75300,7 @@ func vdbePmaWriterInit(tls *libc.TLS, pFd uintptr, p uintptr, nBuf int32, iStart // 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 *libc.TLS, p uintptr, pData uintptr, nData int32) { /* sqlite3.c:95354:13: */ +func vdbePmaWriteBlob(tls *libc.TLS, p uintptr, pData uintptr, nData int32) { /* sqlite3.c:96201:13: */ var nRem int32 = nData for (nRem > 0) && ((*PmaWriter)(unsafe.Pointer(p)).FeFWErr == 0) { var nCopy int32 = nRem @@ -74750,7 +75329,7 @@ func vdbePmaWriteBlob(tls *libc.TLS, p uintptr, pData uintptr, nData int32) { /* // // Before returning, set *piEof to the offset immediately following the // last byte written to the file. -func vdbePmaWriterFinish(tls *libc.TLS, p uintptr, piEof uintptr) int32 { /* sqlite3.c:95387:12: */ +func vdbePmaWriterFinish(tls *libc.TLS, p uintptr, piEof uintptr) int32 { /* sqlite3.c:96234:12: */ var rc int32 if (((*PmaWriter)(unsafe.Pointer(p)).FeFWErr == 0) && ((*PmaWriter)(unsafe.Pointer(p)).FaBuffer != 0)) && ((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd > (*PmaWriter)(unsafe.Pointer(p)).FiBufStart) { (*PmaWriter)(unsafe.Pointer(p)).FeFWErr = Xsqlite3OsWrite(tls, (*PmaWriter)(unsafe.Pointer(p)).FpFd, @@ -74766,7 +75345,7 @@ func vdbePmaWriterFinish(tls *libc.TLS, p uintptr, piEof uintptr) int32 { /* sql // 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 *libc.TLS, p uintptr, iVal U64) { /* sqlite3.c:95406:13: */ +func vdbePmaWriteVarint(tls *libc.TLS, p uintptr, iVal U64) { /* sqlite3.c:96253:13: */ bp := tls.Alloc(10) defer tls.Free(10) @@ -74789,7 +75368,7 @@ func vdbePmaWriteVarint(tls *libc.TLS, p uintptr, iVal U64) { /* sqlite3.c:95406 // * 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 *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:95427:12: */ +func vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:96274:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -74844,7 +75423,7 @@ func vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* // 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 *libc.TLS, pMerger uintptr, pbEof uintptr) int32 { /* sqlite3.c:95491:12: */ +func vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) int32 { /* sqlite3.c:96338:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -74918,7 +75497,7 @@ func vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) int32 { } // The main routine for background threads that write level-0 PMAs. -func vdbeSorterFlushThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:95562:13: */ +func vdbeSorterFlushThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:96409:13: */ var pTask uintptr = pCtx var rc int32 // Return code @@ -74929,7 +75508,7 @@ func vdbeSorterFlushThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:9 // Flush the current contents of VdbeSorter.list to a new PMA, possibly // using a background thread. -func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:95576:12: */ +func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:96423:12: */ var rc int32 = SQLITE_OK var i int32 var pTask uintptr = uintptr(0) // Thread context used to create new PMA @@ -74993,7 +75572,7 @@ func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:955 } // Add a record to the sorter. -func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 { /* sqlite3.c:95646:20: */ +func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 { /* sqlite3.c:96493:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -75109,7 +75688,7 @@ func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 { // 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 *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95758:12: */ +func vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:96605:12: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -75155,7 +75734,7 @@ func vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95758:1 // The main routine for background threads that populate aFile[1] of // multi-threaded IncrMerger objects. -func vdbeIncrPopulateThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:95800:13: */ +func vdbeIncrPopulateThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:96647:13: */ var pIncr uintptr = pCtx var pRet uintptr = uintptr(int64(vdbeIncrPopulate(tls, pIncr))) (*SortSubtask)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer(pIncr)).FpTask)).FbDone = 1 @@ -75163,7 +75742,7 @@ func vdbeIncrPopulateThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c: } // Launch a background thread to populate aFile[1] of pIncr. -func vdbeIncrBgPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95810:12: */ +func vdbeIncrBgPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:96657:12: */ var p uintptr = pIncr return vdbeSorterCreateThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask, *(*uintptr)(unsafe.Pointer(&struct { @@ -75186,7 +75765,7 @@ func vdbeIncrBgPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95810 // to populate the new aFile[1]. // // SQLITE_OK is returned on success, or an SQLite error code otherwise. -func vdbeIncrSwap(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95834:12: */ +func vdbeIncrSwap(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:96681:12: */ var rc int32 = SQLITE_OK if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 { @@ -75220,7 +75799,7 @@ func vdbeIncrSwap(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95834:12: * // // If an OOM condition is encountered, return NULL. In this case free the // pMerger argument before returning. -func vdbeIncrMergerNew(tls *libc.TLS, pTask uintptr, pMerger uintptr, ppOut uintptr) int32 { /* sqlite3.c:95873:12: */ +func vdbeIncrMergerNew(tls *libc.TLS, pTask uintptr, pMerger uintptr, ppOut uintptr) int32 { /* sqlite3.c:96720:12: */ var rc int32 = SQLITE_OK var pIncr uintptr = libc.AssignPtrUintptr(ppOut, func() uintptr { if Xsqlite3FaultSim(tls, 100) != 0 { @@ -75246,7 +75825,7 @@ func vdbeIncrMergerNew(tls *libc.TLS, pTask uintptr, pMerger uintptr, ppOut uint } // Set the "use-threads" flag on object pIncr. -func vdbeIncrMergerSetThreads(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:95897:13: */ +func vdbeIncrMergerSetThreads(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:96744:13: */ (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread = 1 *(*I64)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer(pIncr)).FpTask + 88 /* &.file2 */ + 8 /* &.iEof */)) -= (I64((*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz)) } @@ -75254,7 +75833,7 @@ func vdbeIncrMergerSetThreads(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:95897 // 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 *libc.TLS, pMerger uintptr, iOut int32) { /* sqlite3.c:95910:13: */ +func vdbeMergeEngineCompare(tls *libc.TLS, pMerger uintptr, iOut int32) { /* sqlite3.c:96757:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -75312,7 +75891,7 @@ func vdbeMergeEngineCompare(tls *libc.TLS, pMerger uintptr, iOut int32) { /* sql // to pMerger. // // SQLITE_OK is returned if successful, or an SQLite error code otherwise. -func vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode int32) int32 { /* sqlite3.c:95992:12: */ +func vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode int32) int32 { /* sqlite3.c:96839:12: */ var rc int32 = SQLITE_OK // Return code var i int32 // For looping over PmaReader objects var nTree int32 // Number of subtrees to merge @@ -75382,7 +75961,7 @@ func vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode in // 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 *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:96068:12: */ +func vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:96915:12: */ var rc int32 = SQLITE_OK var pIncr uintptr = (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr var pTask uintptr = (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask @@ -75439,7 +76018,7 @@ func vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) int3 // The main routine for vdbePmaReaderIncrMergeInit() operations run in // background threads. -func vdbePmaReaderBgIncrInit(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:96135:13: */ +func vdbePmaReaderBgIncrInit(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:96982:13: */ var pReader uintptr = pCtx var pRet uintptr = uintptr(int64(vdbePmaReaderIncrMergeInit(tls, pReader, INCRINIT_TASK))) (*SortSubtask)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer((*PmaReader)(unsafe.Pointer(pReader)).FpIncr)).FpTask)).FbDone = 1 @@ -75455,7 +76034,7 @@ func vdbePmaReaderBgIncrInit(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c // 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 *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:96156:12: */ +func vdbePmaReaderIncrInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:97003:12: */ var pIncr uintptr = (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr // Incremental merger var rc int32 = SQLITE_OK // Return code if pIncr != 0 { @@ -75482,7 +76061,7 @@ func vdbePmaReaderIncrInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 { / // 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 *libc.TLS, pTask uintptr, nPMA int32, piOffset uintptr, ppOut uintptr) int32 { /* sqlite3.c:96186:12: */ +func vdbeMergeEngineLevel0(tls *libc.TLS, pTask uintptr, nPMA int32, piOffset uintptr, ppOut uintptr) int32 { /* sqlite3.c:97033:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -75519,11 +76098,11 @@ func vdbeMergeEngineLevel0(tls *libc.TLS, pTask uintptr, nPMA int32, piOffset ui // nPMA<=16 -> TreeDepth() == 0 // nPMA<=256 -> TreeDepth() == 1 // nPMA<=65536 -> TreeDepth() == 2 -func vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) int32 { /* sqlite3.c:96225:12: */ +func vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) int32 { /* sqlite3.c:97072:12: */ var nDepth int32 = 0 - var nDiv I64 = SORTER_MAX_MERGE_COUNT + var nDiv I64 = int64(SORTER_MAX_MERGE_COUNT) for nDiv < I64(nPMA) { - nDiv = (nDiv * SORTER_MAX_MERGE_COUNT) + nDiv = (nDiv * int64(SORTER_MAX_MERGE_COUNT)) nDepth++ } return nDepth @@ -75535,7 +76114,7 @@ func vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) int32 { /* sqlite3.c:96225:1 // // If successful, SQLITE_OK is returned. If an error occurs, an SQLite error // code is returned and pLeaf is freed. -func vdbeSorterAddToTree(tls *libc.TLS, pTask uintptr, nDepth int32, iSeq int32, pRoot uintptr, pLeaf uintptr) int32 { /* sqlite3.c:96243:12: */ +func vdbeSorterAddToTree(tls *libc.TLS, pTask uintptr, nDepth int32, iSeq int32, pRoot uintptr, pLeaf uintptr) int32 { /* sqlite3.c:97090:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -75586,7 +76165,7 @@ func vdbeSorterAddToTree(tls *libc.TLS, pTask uintptr, nDepth int32, iSeq int32, // 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 *libc.TLS, pSorter uintptr, ppOut uintptr) int32 { /* sqlite3.c:96299:12: */ +func vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) int32 { /* sqlite3.c:97146:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -75667,7 +76246,7 @@ func vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) int // all records stored in the sorter. // // SQLITE_OK is returned if successful, or an SQLite error code otherwise. -func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:96378:12: */ +func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:97225:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -75742,7 +76321,7 @@ func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:9 // 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 Xsqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) int32 { /* sqlite3.c:96460:20: */ +func Xsqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) int32 { /* sqlite3.c:97307:20: */ var pSorter uintptr var rc int32 = SQLITE_OK // Return code @@ -75787,7 +76366,7 @@ func Xsqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) int32 // SQLITE_OK success // SQLITE_DONE end of data // otherwise some kind of error. -func Xsqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) int32 { /* sqlite3.c:96512:20: */ +func Xsqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) int32 { /* sqlite3.c:97359:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -75829,7 +76408,7 @@ func Xsqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) int32 { /* // Return a pointer to a buffer owned by the sorter that contains the // current key. -func vdbeSorterRowkey(tls *libc.TLS, pSorter uintptr, pnKey uintptr) uintptr { /* sqlite3.c:96550:13: */ +func vdbeSorterRowkey(tls *libc.TLS, pSorter uintptr, pnKey uintptr) uintptr { /* sqlite3.c:97397:13: */ var pKey uintptr if (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA != 0 { var pReader uintptr @@ -75848,7 +76427,7 @@ func vdbeSorterRowkey(tls *libc.TLS, pSorter uintptr, pnKey uintptr) uintptr { / } // Copy the current sorter key into the memory cell pOut. -func Xsqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) int32 { /* sqlite3.c:96577:20: */ +func Xsqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) int32 { /* sqlite3.c:97424:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -75883,7 +76462,7 @@ func Xsqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) int32 { // // This routine forms the core of the OP_SorterCompare opcode, which in // turn is used to verify uniqueness when constructing a UNIQUE INDEX. -func Xsqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCol int32, pRes uintptr) int32 { /* sqlite3.c:96610:20: */ +func Xsqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCol int32, pRes uintptr) int32 { /* sqlite3.c:97457:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -75943,7 +76522,7 @@ type bytecodevtab = struct { Fdb uintptr FbTablesUsed int32 _ [4]byte -} /* sqlite3.c:96669:9 */ +} /* sqlite3.c:97516:9 */ //************* End of vdbesort.c ******************************************* //************* Begin file vdbevtab.c *************************************** @@ -75964,7 +76543,7 @@ type bytecodevtab = struct { // #include "vdbeInt.h" // An instance of the bytecode() table-valued function. -type Bytecodevtab = bytecodevtab /* sqlite3.c:96669:29 */ +type Bytecodevtab = bytecodevtab /* sqlite3.c:97516:29 */ // A cursor for scanning through the bytecode type bytecodevtab_cursor = struct { @@ -75980,13 +76559,13 @@ type bytecodevtab_cursor = struct { FzSchema uintptr FzName uintptr Fsub Mem -} /* sqlite3.c:96678:9 */ +} /* sqlite3.c:97525:9 */ // A cursor for scanning through the bytecode -type Bytecodevtab_cursor = bytecodevtab_cursor /* sqlite3.c:96678:36 */ +type Bytecodevtab_cursor = bytecodevtab_cursor /* sqlite3.c:97525:36 */ // Create a new bytecode() table-valued function. -func bytecodevtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:96697:12: */ +func bytecodevtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:97544:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -75996,11 +76575,11 @@ func bytecodevtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, ar *(*[2]uintptr)(unsafe.Pointer(bp /* azSchema */)) = [2]uintptr{ // bytecode() schema - ts + 8043, /* "CREATE TABLE x(a..." */ + ts + 8136, /* "CREATE TABLE x(a..." */ // Tables_used() schema - ts + 8155, /* "CREATE TABLE x(t..." */ + ts + 8248, /* "CREATE TABLE x(t..." */ } rc = Xsqlite3_declare_vtab(tls, db, *(*uintptr)(unsafe.Pointer(bp /* &azSchema[0] */ + uintptr(isTabUsed)*8))) @@ -76018,14 +76597,14 @@ func bytecodevtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, ar } // This method is the destructor for bytecodevtab objects. -func bytecodevtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:96748:12: */ +func bytecodevtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:97595:12: */ var p uintptr = pVtab Xsqlite3_free(tls, p) return SQLITE_OK } // Constructor for a new bytecodevtab_cursor object. -func bytecodevtabOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:96757:12: */ +func bytecodevtabOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:97604:12: */ var pVTab uintptr = p var pCur uintptr pCur = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Bytecodevtab_cursor{}))) @@ -76039,7 +76618,7 @@ func bytecodevtabOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sql } // Clear all internal content from a bytecodevtab cursor. -func bytecodevtabCursorClear(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:96771:13: */ +func bytecodevtabCursorClear(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:97618:13: */ Xsqlite3_free(tls, (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzP4) (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzP4 = uintptr(0) Xsqlite3VdbeMemRelease(tls, (pCur + 72 /* &.sub */)) @@ -76055,7 +76634,7 @@ func bytecodevtabCursorClear(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:96771:1 } // Destructor for a bytecodevtab_cursor. -func bytecodevtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:96789:12: */ +func bytecodevtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:97636:12: */ var pCur uintptr = cur bytecodevtabCursorClear(tls, pCur) Xsqlite3_free(tls, pCur) @@ -76063,7 +76642,7 @@ func bytecodevtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:96789:12 } // Advance a bytecodevtab_cursor to its next row of output. -func bytecodevtabNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:96800:12: */ +func bytecodevtabNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:97647:12: */ var pCur uintptr = cur var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab var rc int32 @@ -76097,14 +76676,14 @@ func bytecodevtabNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:96800:12: // Return TRUE if the cursor has been moved off of the last // row of output. -func bytecodevtabEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:96831:12: */ +func bytecodevtabEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:97678:12: */ var pCur uintptr = cur return (libc.Bool32((*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FaOp == uintptr(0))) } // Return values of columns for the row at which the bytecodevtab_cursor // is currently pointing. -func bytecodevtabColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:96840:12: */ +func bytecodevtabColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:97687:12: */ var pCur uintptr = cur var pVTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab var pOp uintptr = ((*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FaOp + uintptr((*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FiAddr)*32) @@ -76124,7 +76703,7 @@ func bytecodevtabColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 var pTab uintptr = (*HashElem)(unsafe.Pointer(k)).Fdata if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) && ((*Table)(unsafe.Pointer(pTab)).Ftnum == iRoot) { (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzName = (*Table)(unsafe.Pointer(pTab)).FzName - (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzType = ts + 8236 /* "table" */ + (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzType = ts + 8329 /* "table" */ break } } @@ -76133,7 +76712,7 @@ func bytecodevtabColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 var pIdx uintptr = (*HashElem)(unsafe.Pointer(k)).Fdata if (*Index)(unsafe.Pointer(pIdx)).Ftnum == iRoot { (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzName = (*Index)(unsafe.Pointer(pIdx)).FzName - (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzType = ts + 8242 /* "index" */ + (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzType = ts + 8335 /* "index" */ } } } @@ -76183,7 +76762,7 @@ func bytecodevtabColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 } else if *(*uintptr)(unsafe.Pointer(aOp + 16 /* &.p4 */)) != uintptr(0) { Xsqlite3_result_text(tls, ctx, (*(*uintptr)(unsafe.Pointer(aOp + 16 /* &.p4 */)) + uintptr(3)), -1, uintptr(0)) } else { - Xsqlite3_result_text(tls, ctx, ts+8248 /* "(FK)" */, 4, uintptr(0)) + Xsqlite3_result_text(tls, ctx, ts+8341 /* "(FK)" */, 4, uintptr(0)) } break @@ -76206,7 +76785,7 @@ func bytecodevtabColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 // Return the rowid for the current row. In this implementation, the // rowid is the same as the output value. -func bytecodevtabRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:96948:12: */ +func bytecodevtabRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:97795:12: */ var pCur uintptr = cur *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = Sqlite_int64((*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FiRowid) return SQLITE_OK @@ -76216,7 +76795,7 @@ func bytecodevtabRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sq // // idxNum==0 means show all subprograms // idxNum==1 means show only the main bytecode and omit subprograms. -func bytecodevtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:96960:12: */ +func bytecodevtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:97807:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -76238,16 +76817,16 @@ func bytecodevtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FneedFinalize = 1 } } else { - (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FpStmt = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+8253 /* "stmt-pointer" */) + (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FpStmt = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+8346 /* "stmt-pointer" */) } if (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FpStmt == uintptr(0) { (*Bytecodevtab)(unsafe.Pointer(pVTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, - ts+8266, /* "argument to %s()..." */ + ts+8359, /* "argument to %s()..." */ libc.VaList(bp, func() uintptr { if (*Bytecodevtab)(unsafe.Pointer(pVTab)).FbTablesUsed != 0 { - return ts + 8312 /* "tables_used" */ + return ts + 8405 /* "tables_used" */ } - return ts + 8324 /* "bytecode" */ + return ts + 8417 /* "bytecode" */ }())) rc = SQLITE_ERROR } else { @@ -76259,7 +76838,7 @@ func bytecodevtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr // We must have a single stmt=? constraint that will be passed through // into the xFilter method. If there is no valid stmt=? constraint, // then return an SQLITE_CONSTRAINT error. -func bytecodevtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:97002:12: */ +func bytecodevtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:97849:12: */ var i int32 var rc int32 = SQLITE_CONSTRAINT var p uintptr @@ -76318,17 +76897,17 @@ var bytecodevtabModule = Sqlite3_module{ /* xEof */ FxEof: 0, /* xColumn */ FxColumn: 0, /* xRowid */ FxRowid: 0, -} /* sqlite3.c:97033:23 */ +} /* sqlite3.c:97880:23 */ -func Xsqlite3VdbeBytecodeVtabInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:97061:20: */ +func Xsqlite3VdbeBytecodeVtabInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:97908:20: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = db var rc int32 - rc = Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+8324 /* "bytecode" */, uintptr(unsafe.Pointer(&bytecodevtabModule)), uintptr(0)) + rc = Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+8417 /* "bytecode" */, uintptr(unsafe.Pointer(&bytecodevtabModule)), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+8312 /* "tables_used" */, uintptr(unsafe.Pointer(&bytecodevtabModule)), bp /* &db */) + rc = Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+8405 /* "tables_used" */, uintptr(unsafe.Pointer(&bytecodevtabModule)), bp /* &db */) } return rc } @@ -76365,8 +76944,6 @@ type MemJournal1 = struct { FpMethod uintptr FnChunkSize int32 FnSpill int32 - FnSize int32 - _ [4]byte FpFirst uintptr Fendpoint FilePoint Freadpoint FilePoint @@ -76374,7 +76951,7 @@ type MemJournal1 = struct { _ [4]byte FpVfs uintptr FzJournal uintptr -} /* sqlite3.c:97103:9 */ +} /* sqlite3.c:97950:9 */ //************* End of vdbevtab.c ******************************************* //************* Begin file memjournal.c ************************************* @@ -76404,23 +76981,23 @@ type MemJournal1 = struct { // #include "sqliteInt.h" // Forward references to internal structures -type MemJournal = MemJournal1 /* sqlite3.c:97103:27 */ +type MemJournal = MemJournal1 /* sqlite3.c:97950:27 */ type FilePoint1 = struct { FiOffset Sqlite3_int64 FpChunk uintptr -} /* sqlite3.c:97103:9 */ +} /* sqlite3.c:97950:9 */ -type FilePoint = FilePoint1 /* sqlite3.c:97104:26 */ +type FilePoint = FilePoint1 /* sqlite3.c:97951:26 */ type FileChunk1 = struct { FpNext uintptr FzChunk [8]U8 -} /* sqlite3.c:97103:9 */ +} /* sqlite3.c:97950:9 */ -type FileChunk = FileChunk1 /* sqlite3.c:97105:26 */ +type FileChunk = FileChunk1 /* sqlite3.c:97952:26 */ // Read data from the in-memory journal file. This is the implementation // of the sqlite3_vfs.xRead method. -func memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:97161:12: */ +func memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:98007:12: */ var p uintptr = pJfd var zOut uintptr = zBuf var nRead int32 = iAmt @@ -76467,34 +77044,30 @@ func memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sq } // Free the list of FileChunk structures headed at MemJournal.pFirst. -func memjrnlFreeChunks(tls *libc.TLS, p uintptr) { /* sqlite3.c:97208:13: */ +func memjrnlFreeChunks(tls *libc.TLS, pFirst uintptr) { /* sqlite3.c:98054:13: */ var pIter uintptr var pNext uintptr - for pIter = (*MemJournal)(unsafe.Pointer(p)).FpFirst; pIter != 0; pIter = pNext { + for pIter = pFirst; pIter != 0; pIter = pNext { pNext = (*FileChunk)(unsafe.Pointer(pIter)).FpNext Xsqlite3_free(tls, pIter) } - (*MemJournal)(unsafe.Pointer(p)).FpFirst = uintptr(0) } // Flush the contents of memory to a real file on disk. -func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:97221:12: */ - bp := tls.Alloc(88) - defer tls.Free(88) - +func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98066:12: */ var rc int32 var pReal uintptr = p - *(*MemJournal)(unsafe.Pointer(bp /* copy */)) = *(*MemJournal)(unsafe.Pointer(p)) + var copy = *(*MemJournal)(unsafe.Pointer(p)) libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(MemJournal{}))) - rc = Xsqlite3OsOpen(tls, (*MemJournal)(unsafe.Pointer(bp /* © */)).FpVfs, (*MemJournal)(unsafe.Pointer(bp /* © */)).FzJournal, pReal, (*MemJournal)(unsafe.Pointer(bp /* © */)).Fflags, uintptr(0)) + rc = Xsqlite3OsOpen(tls, copy.FpVfs, copy.FzJournal, pReal, copy.Fflags, uintptr(0)) if rc == SQLITE_OK { - var nChunk int32 = (*MemJournal)(unsafe.Pointer(bp /* © */)).FnChunkSize + var nChunk int32 = copy.FnChunkSize var iOff I64 = int64(0) var pIter uintptr - for pIter = (*MemJournal)(unsafe.Pointer(bp /* © */)).FpFirst; pIter != 0; pIter = (*FileChunk)(unsafe.Pointer(pIter)).FpNext { - if (iOff + I64(nChunk)) > (*MemJournal)(unsafe.Pointer(bp /* © */)).Fendpoint.FiOffset { - nChunk = (int32((*MemJournal)(unsafe.Pointer(bp /* © */)).Fendpoint.FiOffset - iOff)) + for pIter = copy.FpFirst; pIter != 0; pIter = (*FileChunk)(unsafe.Pointer(pIter)).FpNext { + if (iOff + I64(nChunk)) > copy.Fendpoint.FiOffset { + nChunk = (int32(copy.Fendpoint.FiOffset - iOff)) } rc = Xsqlite3OsWrite(tls, pReal, pIter+8 /* &.zChunk */, nChunk, iOff) if rc != 0 { @@ -76504,7 +77077,7 @@ func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:97221:12: } if rc == SQLITE_OK { // No error has occurred. Free the in-memory buffers. - memjrnlFreeChunks(tls, bp /* © */) + memjrnlFreeChunks(tls, copy.FpFirst) } } if rc != SQLITE_OK { @@ -76513,13 +77086,13 @@ func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:97221:12: // journal data to roll back changes made to the internal page-cache // before this function was called. Xsqlite3OsClose(tls, pReal) - *(*MemJournal)(unsafe.Pointer(p)) = *(*MemJournal)(unsafe.Pointer(bp /* copy */)) + *(*MemJournal)(unsafe.Pointer(p)) = copy } return rc } // Write data to the file. -func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:97260:12: */ +func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:98105:12: */ var p uintptr = pJfd var nWrite int32 = iAmt var zWrite uintptr = zBuf @@ -76570,9 +77143,8 @@ func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst S libc.Xmemcpy(tls, ((*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk + 8 /* &.zChunk */ + uintptr(iChunkOffset)), zWrite, uint64(iSpace)) zWrite += uintptr(iSpace) nWrite = nWrite - (iSpace) - *(*Sqlite3_int64)(unsafe.Pointer(p + 32 /* &.endpoint */ /* &.iOffset */)) += (Sqlite3_int64(iSpace)) + *(*Sqlite3_int64)(unsafe.Pointer(p + 24 /* &.endpoint */ /* &.iOffset */)) += (Sqlite3_int64(iSpace)) } - (*MemJournal)(unsafe.Pointer(p)).FnSize = (int32(Sqlite_int64(iAmt) + iOfst)) } } @@ -76580,28 +77152,36 @@ func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst S return SQLITE_OK } -// 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 *libc.TLS, pJfd uintptr, size Sqlite_int64) int32 { /* sqlite3.c:97339:12: */ +// Truncate the in-memory file. +func memjrnlTruncate(tls *libc.TLS, pJfd uintptr, size Sqlite_int64) int32 { /* sqlite3.c:98179:12: */ var p uintptr = pJfd + var pIter uintptr = uintptr(0) + if size == int64(0) { - memjrnlFreeChunks(tls, p) - (*MemJournal)(unsafe.Pointer(p)).FnSize = 0 - (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk = uintptr(0) - (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset = int64(0) - (*MemJournal)(unsafe.Pointer(p)).Freadpoint.FpChunk = uintptr(0) - (*MemJournal)(unsafe.Pointer(p)).Freadpoint.FiOffset = int64(0) + memjrnlFreeChunks(tls, (*MemJournal)(unsafe.Pointer(p)).FpFirst) + (*MemJournal)(unsafe.Pointer(p)).FpFirst = uintptr(0) + } else { + var iOff I64 = I64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize) + for pIter = (*MemJournal)(unsafe.Pointer(p)).FpFirst; (pIter != 0) && (iOff <= size); pIter = (*FileChunk)(unsafe.Pointer(pIter)).FpNext { + iOff = iOff + (I64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize)) + } + if pIter != 0 { + memjrnlFreeChunks(tls, (*FileChunk)(unsafe.Pointer(pIter)).FpNext) + (*FileChunk)(unsafe.Pointer(pIter)).FpNext = uintptr(0) + } } + + (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk = pIter + (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset = size + (*MemJournal)(unsafe.Pointer(p)).Freadpoint.FpChunk = uintptr(0) + (*MemJournal)(unsafe.Pointer(p)).Freadpoint.FiOffset = int64(0) return SQLITE_OK } // Close the file. -func memjrnlClose(tls *libc.TLS, pJfd uintptr) int32 { /* sqlite3.c:97355:12: */ +func memjrnlClose(tls *libc.TLS, pJfd uintptr) int32 { /* sqlite3.c:98207:12: */ var p uintptr = pJfd - memjrnlFreeChunks(tls, p) + memjrnlFreeChunks(tls, (*MemJournal)(unsafe.Pointer(p)).FpFirst) return SQLITE_OK } @@ -76609,14 +77189,14 @@ func memjrnlClose(tls *libc.TLS, pJfd uintptr) int32 { /* sqlite3.c:97355:12: */ // // If the real file has been created, call its xSync method. Otherwise, // syncing an in-memory journal is a no-op. -func memjrnlSync(tls *libc.TLS, pJfd uintptr, flags int32) int32 { /* sqlite3.c:97367:12: */ +func memjrnlSync(tls *libc.TLS, pJfd uintptr, flags int32) int32 { /* sqlite3.c:98219:12: */ _ = pJfd _ = flags return SQLITE_OK } // Query the size of the file in bytes. -func memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) int32 { /* sqlite3.c:97375:12: */ +func memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) int32 { /* sqlite3.c:98227:12: */ var p uintptr = pJfd *(*Sqlite_int64)(unsafe.Pointer(pSize)) = (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset return SQLITE_OK @@ -76631,7 +77211,7 @@ var sMemJournalMethods = sqlite3_io_methods{ FxTruncate: 0, // xTruncate FxSync: 0, // xSync FxFileSize: 0, // xUnfetch -} /* sqlite3.c:97384:40 */ +} /* sqlite3.c:98236:40 */ // Open a journal file. // @@ -76643,7 +77223,7 @@ var sMemJournalMethods = sqlite3_io_methods{ // 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 Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintptr, flags int32, nSpill int32) int32 { /* sqlite3.c:97418:20: */ +func Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintptr, flags int32, nSpill int32) int32 { /* sqlite3.c:98270:20: */ var p uintptr = pJfd // Zero the file-handle object. If nSpill was passed zero, initialize @@ -76671,20 +77251,20 @@ func Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintpt } // Open an in-memory journal file. -func Xsqlite3MemJournalOpen(tls *libc.TLS, pJfd uintptr) { /* sqlite3.c:97454:21: */ +func Xsqlite3MemJournalOpen(tls *libc.TLS, pJfd uintptr) { /* sqlite3.c:98306:21: */ Xsqlite3JournalOpen(tls, uintptr(0), uintptr(0), pJfd, 0, -1) } // 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 Xsqlite3JournalIsInMemory(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:97493:20: */ +func Xsqlite3JournalIsInMemory(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98345:20: */ return (libc.Bool32((*Sqlite3_file)(unsafe.Pointer(p)).FpMethods == uintptr(unsafe.Pointer(&sMemJournalMethods)))) } // Return the number of bytes required to store a JournalFile that uses vfs // pVfs to create the underlying on-disk files. -func Xsqlite3JournalSize(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:97501:20: */ +func Xsqlite3JournalSize(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:98353:20: */ return func() int32 { if ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile) > (int32(unsafe.Sizeof(MemJournal{}))) { return (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile @@ -76713,7 +77293,7 @@ func Xsqlite3JournalSize(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:97501 // Walk all expressions linked into the list of Window objects passed // as the second argument. -func walkWindowList(tls *libc.TLS, pWalker uintptr, pList uintptr) int32 { /* sqlite3.c:97531:12: */ +func walkWindowList(tls *libc.TLS, pWalker uintptr, pList uintptr, bOneOnly int32) int32 { /* sqlite3.c:98383:12: */ var pWin uintptr for pWin = pList; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { var rc int32 @@ -76742,6 +77322,9 @@ func walkWindowList(tls *libc.TLS, pWalker uintptr, pList uintptr) int32 { /* sq if rc != 0 { return WRC_Abort } + if bOneOnly != 0 { + break + } } return WRC_Continue } @@ -76763,7 +77346,7 @@ func walkWindowList(tls *libc.TLS, pWalker uintptr, pList uintptr) int32 { /* sq // // The return value from this routine is WRC_Abort to abandon the tree walk // and WRC_Continue to continue. -func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:97574:28: */ +func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:98427:28: */ var rc int32 for 1 != 0 { @@ -76780,7 +77363,7 @@ func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3. pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpRight continue - } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { if Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0 { return WRC_Abort @@ -76791,8 +77374,8 @@ func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3. return WRC_Abort } } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { - if walkWindowList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */))) != 0 { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { + if walkWindowList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)), 1) != 0 { return WRC_Abort } } @@ -76803,7 +77386,7 @@ func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3. return WRC_Continue } -func Xsqlite3WalkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:97606:20: */ +func Xsqlite3WalkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:98459:20: */ if pExpr != 0 { return walkExpr(tls, pWalker, pExpr) } @@ -76812,7 +77395,7 @@ func Xsqlite3WalkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* // Call sqlite3WalkExpr() for every expression in list p or until // an abort request is seen. -func Xsqlite3WalkExprList(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97614:20: */ +func Xsqlite3WalkExprList(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:98467:20: */ var i int32 var pItem uintptr if p != 0 { @@ -76843,7 +77426,7 @@ func Xsqlite3WalkExprList(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* // 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 Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97631:20: */ +func Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:98484:20: */ if Xsqlite3WalkExprList(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpEList) != 0 { return WRC_Abort } @@ -76867,7 +77450,7 @@ func Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { / if (pParse != 0) && (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { // The following may return WRC_Abort if there are unresolvable // symbols (e.g. a table that does not exist) in a window definition. - var rc int32 = walkWindowList(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpWinDefn) + var rc int32 = walkWindowList(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpWinDefn, 0) return rc } @@ -76880,7 +77463,7 @@ func Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { / // 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 Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97659:20: */ +func Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:98512:20: */ var pSrc uintptr var i int32 var pItem uintptr @@ -76894,7 +77477,7 @@ func Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { / goto __3 } { - if ((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (Xsqlite3WalkSelect(tls, pWalker, (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect) != 0) { + if ((*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0) && (Xsqlite3WalkSelect(tls, pWalker, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect) != 0) { return WRC_Abort } if ((uint32(int32(*(*uint8)(unsafe.Pointer((pItem + 60 /* &.fg */) + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0) && @@ -76929,7 +77512,7 @@ func Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { / // // If the Walker does not have an xSelectCallback() then this routine // is a no-op returning WRC_Continue. -func Xsqlite3WalkSelect(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97697:20: */ +func Xsqlite3WalkSelect(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:98550:20: */ var rc int32 if p == uintptr(0) { return WRC_Continue @@ -76956,13 +77539,13 @@ func Xsqlite3WalkSelect(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sq // Increase the walkerDepth when entering a subquery, and // descrease when leaving the subquery. -func Xsqlite3WalkerDepthIncrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:97720:20: */ +func Xsqlite3WalkerDepthIncrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:98573:20: */ _ = pSelect (*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth++ return WRC_Continue } -func Xsqlite3WalkerDepthDecrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:97725:21: */ +func Xsqlite3WalkerDepthDecrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:98578:21: */ _ = pSelect (*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth-- } @@ -76974,7 +77557,7 @@ func Xsqlite3WalkerDepthDecrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr // 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 Xsqlite3ExprWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:97740:20: */ +func Xsqlite3ExprWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:98593:20: */ _ = NotUsed _ = NotUsed2 return WRC_Continue @@ -76982,7 +77565,7 @@ func Xsqlite3ExprWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int3 // No-op routine for the parse-tree walker for SELECT statements. // subquery in the parser tree. -func Xsqlite3SelectWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:97749:20: */ +func Xsqlite3SelectWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:98602:20: */ _ = NotUsed _ = NotUsed2 return WRC_Continue @@ -77017,14 +77600,14 @@ func Xsqlite3SelectWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) in // is a helper function - a callback for the tree walker. // // See also the sqlite3WindowExtraAggFuncDepth() routine in window.c -func incrAggDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:97790:12: */ +func incrAggDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:98643:12: */ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_FUNCTION { *(*U8)(unsafe.Pointer(pExpr + 2 /* &.op2 */)) += U8((*(*int32)(unsafe.Pointer(pWalker + 40 /* &.u */)))) } return WRC_Continue } -func incrAggFunctionDepth(tls *libc.TLS, pExpr uintptr, N int32) { /* sqlite3.c:97794:13: */ +func incrAggFunctionDepth(tls *libc.TLS, pExpr uintptr, N int32) { /* sqlite3.c:98647:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -77057,7 +77640,7 @@ func incrAggFunctionDepth(tls *libc.TLS, pExpr uintptr, N int32) { /* sqlite3.c: // 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 *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pExpr uintptr, zType uintptr, nSubquery int32) { /* sqlite3.c:97823:13: */ +func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pExpr uintptr, nSubquery int32) { /* sqlite3.c:98676:13: */ var pOrig uintptr // The iCol-th column of the result set var pDup uintptr // Copy of pOrig var db uintptr // The database connection @@ -77067,9 +77650,7 @@ func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pEx db = (*Parse)(unsafe.Pointer(pParse)).Fdb pDup = Xsqlite3ExprDup(tls, db, pOrig, 0) if pDup != uintptr(0) { - if int32(*(*int8)(unsafe.Pointer(zType))) != 'G' { - incrAggFunctionDepth(tls, pDup, nSubquery) - } + incrAggFunctionDepth(tls, pDup, nSubquery) if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLLATE { pDup = Xsqlite3ExprAddCollateString(tls, pParse, pDup, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))) } @@ -77080,15 +77661,15 @@ func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pEx // The pExpr->u.zToken might point into memory that will be freed by the // sqlite3DbFree(db, pDup) on the last line of this block, so be sure to // make a copy of the token before doing the sqlite3DbFree(). - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Static) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Static)) Xsqlite3ExprDelete(tls, db, pExpr) libc.Xmemcpy(tls, pExpr, pDup, uint64(unsafe.Sizeof(Expr{}))) - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_IntValue)) != U32(0)) && (*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) != uintptr(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) != uintptr(0)) { *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_MemToken) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_MemToken)) } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { if *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) != uintptr(0) { (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpOwner = pExpr } else { @@ -77097,14 +77678,13 @@ func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pEx } Xsqlite3DbFree(tls, db, pDup) } - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Alias) } // 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 *libc.TLS, pUsing uintptr, zCol uintptr) int32 { /* sqlite3.c:97880:12: */ +func nameInUsingClause(tls *libc.TLS, pUsing uintptr, zCol uintptr) int32 { /* sqlite3.c:98731:12: */ if pUsing != 0 { var k int32 for k = 0; k < (*IdList)(unsafe.Pointer(pUsing)).FnId; k++ { @@ -77121,7 +77701,7 @@ func nameInUsingClause(tls *libc.TLS, pUsing uintptr, zCol uintptr) int32 { /* s // 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 Xsqlite3MatchEName(tls *libc.TLS, pItem uintptr, zCol uintptr, zTab uintptr, zDb uintptr) int32 { /* sqlite3.c:97897:20: */ +func Xsqlite3MatchEName(tls *libc.TLS, pItem uintptr, zCol uintptr, zTab uintptr, zDb uintptr) int32 { /* sqlite3.c:98748:20: */ var n int32 var zSpan uintptr if (int32(*(*uint8)(unsafe.Pointer(pItem + 20 /* &.eEName */)) & 0x3 >> 0)) != ENAME_TAB { @@ -77147,33 +77727,33 @@ func Xsqlite3MatchEName(tls *libc.TLS, pItem uintptr, zCol uintptr, zTab uintptr } // Return TRUE if the double-quoted string mis-feature should be supported. -func areDoubleQuotedStringsEnabled(tls *libc.TLS, db uintptr, pTopNC uintptr) int32 { /* sqlite3.c:97926:12: */ +func areDoubleQuotedStringsEnabled(tls *libc.TLS, db uintptr, pTopNC uintptr) int32 { /* sqlite3.c:98777:12: */ if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 { return 1 } // Always support for legacy schemas if ((*NameContext)(unsafe.Pointer(pTopNC)).FncFlags & NC_IsDDL) != 0 { // Currently parsing a DDL statement - if (Xsqlite3WritableSchema(tls, db) != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DqsDML) != uint64(0)) { + if (Xsqlite3WritableSchema(tls, db) != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDML)) != uint64(0)) { return 1 } - return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DqsDDL) != uint64(0))) + return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDDL)) != uint64(0))) } else { // Currently parsing a DML statement - return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DqsDML) != uint64(0))) + return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DqsDML)) != uint64(0))) } return int32(0) } // The argument is guaranteed to be a non-NULL Expr node of type TK_COLUMN. // return the appropriate colUsed mask. -func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:97944:24: */ +func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:98795:24: */ var n int32 var pExTab uintptr n = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) pExTab = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) - if (((*Table)(unsafe.Pointer(pExTab)).FtabFlags & TF_HasGenerated) != U32(0)) && + if (((*Table)(unsafe.Pointer(pExTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pExTab)).FaCol+uintptr(n)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { if int32((*Table)(unsafe.Pointer(pExTab)).FnCol) >= (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) { @@ -77215,7 +77795,7 @@ func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:97 // // 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 *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol uintptr, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:97992:12: */ +func lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol uintptr, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:98843:12: */ bp := tls.Alloc(96) defer tls.Free(96) @@ -77297,7 +77877,7 @@ __5: goto __6 __6: ; - if !((i == (*Sqlite3)(unsafe.Pointer(db)).FnDb) && (Xsqlite3StrICmp(tls, ts+8333 /* "main" */, zDb) == 0)) { + if !((i == (*Sqlite3)(unsafe.Pointer(db)).FnDb) && (Xsqlite3StrICmp(tls, ts+8426 /* "main" */, zDb) == 0)) { goto __8 } // This branch is taken when the main database has been renamed @@ -77325,13 +77905,13 @@ __13: if !(i < (*SrcList)(unsafe.Pointer(pSrcList)).FnSrc) { goto __15 } - pTab = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab + pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab - if !(((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & SF_NestedFrom) != U32(0))) { + if !(((*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & U32(SF_NestedFrom)) != U32(0))) { goto __16 } hit = 0 - pEList = (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FpEList + pEList = (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpEList j = 0 __17: if !(j < (*ExprList)(unsafe.Pointer(pEList)).FnExpr) { @@ -77371,8 +77951,8 @@ __22: if !(zTab != 0) { goto __23 } - if (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias != 0 { - zTabName = (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias + if (*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 { + zTabName = (*SrcItem)(unsafe.Pointer(pItem)).FzAlias } else { zTabName = (*Table)(unsafe.Pointer(pTab)).FzName } @@ -77383,7 +77963,7 @@ __22: goto __14 __24: ; - if !((int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*SrcList_item)(unsafe.Pointer(pItem)).FzAlias != 0)) { + if !((int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0)) { goto __25 } Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (pExpr + 64 /* &.y */ /* &.pTab */)) @@ -77413,13 +77993,13 @@ __27: if !(cnt == 1) { goto __31 } - if !((int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_NATURAL) != 0) { + if !((int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_NATURAL) != 0) { goto __32 } goto __28 __32: ; - if !(nameInUsingClause(tls, (*SrcList_item)(unsafe.Pointer(pItem)).FpUsing, zCol) != 0) { + if !(nameInUsingClause(tls, (*SrcItem)(unsafe.Pointer(pItem)).FpUsing, zCol) != 0) { goto __33 } goto __28 @@ -77458,14 +78038,14 @@ __15: if !(pMatch != 0) { goto __34 } - (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcList_item)(unsafe.Pointer(pMatch)).FiCursor - *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = (*SrcList_item)(unsafe.Pointer(pMatch)).FpTab + (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcItem)(unsafe.Pointer(pMatch)).FiCursor + *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = (*SrcItem)(unsafe.Pointer(pMatch)).FpTab // RIGHT JOIN not (yet) supported - if !((int32((*SrcList_item)(unsafe.Pointer(pMatch)).Ffg.Fjointype) & JT_LEFT) != 0) { + if !((int32((*SrcItem)(unsafe.Pointer(pMatch)).Ffg.Fjointype) & JT_LEFT) != 0) { goto __35 } - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_CanBeNull) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_CanBeNull)) __35: ; pSchema = (*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpSchema @@ -77476,8 +78056,9 @@ __12: // If we have not already resolved the name, then maybe // it is a new.* or old.* trigger argument reference. Or - // maybe it is an excluded.* from an upsert. - if !(((zDb == uintptr(0)) && (zTab != uintptr(0))) && (cntTab == 0)) { + // maybe it is an excluded.* from an upsert. Or maybe it is + // a reference in the RETURNING clause to a table being modified. + if !((cnt == 0) && (zDb == uintptr(0))) { goto __36 } pTab = uintptr(0) @@ -77486,139 +78067,157 @@ __12: } op = int32((*Parse)(unsafe.Pointer(pParse)).FeTriggerOp) - if !((op != TK_DELETE) && (Xsqlite3StrICmp(tls, ts+8338 /* "new" */, zTab) == 0)) { + if !(((op != TK_DELETE) && (zTab != 0)) && (Xsqlite3StrICmp(tls, ts+8431 /* "new" */, zTab) == 0)) { goto __38 } (*Expr)(unsafe.Pointer(pExpr)).FiTable = 1 pTab = (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab goto __39 __38: - if !((op != TK_INSERT) && (Xsqlite3StrICmp(tls, ts+8342 /* "old" */, zTab) == 0)) { + if !(((op != TK_INSERT) && (zTab != 0)) && (Xsqlite3StrICmp(tls, ts+8435 /* "old" */, zTab) == 0)) { goto __40 } (*Expr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab + goto __41 __40: + if !(((*Parse)(unsafe.Pointer(pParse)).FbReturning != 0) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_UBaseReg) != 0)) { + goto __42 + } + (*Expr)(unsafe.Pointer(pExpr)).FiTable = (libc.Bool32(op != TK_DELETE)) + pTab = (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab +__42: + ; +__41: ; __39: ; __37: ; - if !(((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_UUpsert) != 0) { - goto __41 + if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_UUpsert) != 0) && (zTab != uintptr(0))) { + goto __43 } pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16 /* &.uNC */)) - if !((pUpsert != 0) && (Xsqlite3StrICmp(tls, ts+8346 /* "excluded" */, zTab) == 0)) { - goto __42 + if !((pUpsert != 0) && (Xsqlite3StrICmp(tls, ts+8439 /* "excluded" */, zTab) == 0)) { + goto __44 } - pTab = (*SrcList_item)(unsafe.Pointer(((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8 /* &.a */))).FpTab + pTab = (*SrcItem)(unsafe.Pointer(((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8 /* &.a */))).FpTab (*Expr)(unsafe.Pointer(pExpr)).FiTable = EXCLUDED_TABLE_NUMBER -__42: +__44: ; -__41: +__43: ; if !(pTab != 0) { - goto __43 + goto __45 } hCol1 = Xsqlite3StrIHash(tls, zCol) pSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema cntTab++ iCol = 0 pCol = (*Table)(unsafe.Pointer(pTab)).FaCol -__44: +__46: if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __46 - } - if !((int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(hCol1)) && (Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzName, zCol) == 0)) { - goto __47 - } - if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) { goto __48 } + if !((int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(hCol1)) && (Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzName, zCol) == 0)) { + goto __49 + } + if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) { + goto __50 + } iCol = -1 -__48: +__50: ; - goto __46 + goto __48 +__49: + ; + goto __47 __47: - ; - goto __45 -__45: iCol++ pCol += 32 - goto __44 goto __46 -__46: + goto __48 +__48: ; - if !(((iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) && (Xsqlite3IsRowid(tls, zCol) != 0)) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_NoVisibleRowid) == U32(0))) { - goto __49 + if !(((iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) && (Xsqlite3IsRowid(tls, zCol) != 0)) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_NoVisibleRowid)) == U32(0))) { + goto __51 } // IMP: R-51414-32910 iCol = -1 -__49: +__51: ; if !(iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __50 + goto __52 } cnt++ + pMatch = uintptr(0) if !((*Expr)(unsafe.Pointer(pExpr)).FiTable == EXCLUDED_TABLE_NUMBER) { - goto __51 + goto __53 } if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { - goto __53 + goto __55 } (*Expr)(unsafe.Pointer(pExpr)).FiColumn = YnVar(iCol) *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = pTab eNewExprOp = TK_COLUMN - goto __54 -__53: - (*Expr)(unsafe.Pointer(pExpr)).FiTable = ((*Upsert)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNC + 16 /* &.uNC */)))).FregData + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))) - eNewExprOp = TK_REGISTER - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Alias) -__54: - ; - goto __52 -__51: - - if !(iCol < 0) { - goto __55 - } - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER goto __56 __55: - if !((*Expr)(unsafe.Pointer(pExpr)).FiTable == 0) { - goto __57 - } - - *(*U32)(unsafe.Pointer(pParse + 200 /* &.oldmask */)) |= (func() uint32 { - if iCol >= 32 { - return 0xffffffff - } - return (U32((U32(1))) << iCol) - }()) - goto __58 -__57: - ; - - *(*U32)(unsafe.Pointer(pParse + 204 /* &.newmask */)) |= (func() uint32 { - if iCol >= 32 { - return 0xffffffff - } - return (U32((U32(1))) << iCol) - }()) -__58: - ; + (*Expr)(unsafe.Pointer(pExpr)).FiTable = ((*Upsert)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNC + 16 /* &.uNC */)))).FregData + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))) + eNewExprOp = TK_REGISTER __56: ; + goto __54 +__53: + *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = pTab + if !((*Parse)(unsafe.Pointer(pParse)).FbReturning != 0) { + goto __57 + } + eNewExprOp = TK_REGISTER + (*Expr)(unsafe.Pointer(pExpr)).FiTable = (((*(*int32)(unsafe.Pointer(pNC + 16 /* &.uNC */)) + ((int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1) * (*Expr)(unsafe.Pointer(pExpr)).FiTable)) + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol)))) + 1) + goto __58 +__57: (*Expr)(unsafe.Pointer(pExpr)).FiColumn = I16(iCol) eNewExprOp = TK_TRIGGER + if !(iCol < 0) { + goto __59 + } + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) + goto __60 +__59: + if !((*Expr)(unsafe.Pointer(pExpr)).FiTable == 0) { + goto __61 + } + + *(*U32)(unsafe.Pointer(pParse + 196 /* &.oldmask */)) |= (func() uint32 { + if iCol >= 32 { + return 0xffffffff + } + return (U32((U32(1))) << iCol) + }()) + goto __62 +__61: + ; + + *(*U32)(unsafe.Pointer(pParse + 200 /* &.newmask */)) |= (func() uint32 { + if iCol >= 32 { + return 0xffffffff + } + return (U32((U32(1))) << iCol) + }()) +__62: + ; +__60: + ; +__58: + ; +__54: + ; __52: ; -__50: - ; -__43: +__45: ; __36: ; @@ -77629,13 +78228,13 @@ __36: (pMatch != 0)) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_IdxExpr | NC_GenCol)) == 0)) && (Xsqlite3IsRowid(tls, zCol) != 0)) && - (((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer(pMatch)).FpTab))).FtabFlags & TF_NoVisibleRowid) == U32(0))) { - goto __59 + (((*Table)(unsafe.Pointer(((*SrcItem)(unsafe.Pointer(pMatch)).FpTab))).FtabFlags & U32(TF_NoVisibleRowid)) == U32(0))) { + goto __63 } cnt = 1 (*Expr)(unsafe.Pointer(pExpr)).FiColumn = int16(-1) - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER -__59: + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) +__63: ; // If the input is of the form Z (not Y.Z or X.Y.Z) then the name Z @@ -77657,74 +78256,74 @@ __59: if !(((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_UEList) != 0) && (cnt == 0)) && (zTab == uintptr(0))) { - goto __60 + goto __64 } pEList = *(*uintptr)(unsafe.Pointer(pNC + 16 /* &.uNC */)) j = 0 -__61: +__65: if !(j < (*ExprList)(unsafe.Pointer(pEList)).FnExpr) { - goto __63 + goto __67 } zAs = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(j)*32)).FzEName if !(((int32(*(*uint8)(unsafe.Pointer(((pEList + 8 /* &.a */) + uintptr(j)*32) + 20 /* &.eEName */)) & 0x3 >> 0)) == ENAME_NAME) && (Xsqlite3_stricmp(tls, zAs, zCol) == 0)) { - goto __64 + goto __68 } pOrig = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(j)*32)).FpExpr - if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0) && (((*Expr)(unsafe.Pointer((pOrig))).Fflags & (EP_Agg)) != U32(0))) { - goto __65 + if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0) && (((*Expr)(unsafe.Pointer((pOrig))).Fflags & (U32(EP_Agg))) != U32(0))) { + goto __69 } - Xsqlite3ErrorMsg(tls, pParse, ts+8355 /* "misuse of aliase..." */, libc.VaList(bp, zAs)) + Xsqlite3ErrorMsg(tls, pParse, ts+8448 /* "misuse of aliase..." */, libc.VaList(bp, zAs)) return WRC_Abort -__65: +__69: ; - if !((((*Expr)(unsafe.Pointer((pOrig))).Fflags & (EP_Win)) != U32(0)) && + if !((((*Expr)(unsafe.Pointer((pOrig))).Fflags & (U32(EP_Win))) != U32(0)) && ((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowWin) == 0) || (pNC != pTopNC))) { - goto __66 + goto __70 } - Xsqlite3ErrorMsg(tls, pParse, ts+8386 /* "misuse of aliase..." */, libc.VaList(bp+8, zAs)) + Xsqlite3ErrorMsg(tls, pParse, ts+8479 /* "misuse of aliase..." */, libc.VaList(bp+8, zAs)) return WRC_Abort -__66: +__70: ; if !(Xsqlite3ExprVectorSize(tls, pOrig) != 1) { - goto __67 + goto __71 } - Xsqlite3ErrorMsg(tls, pParse, ts+8423 /* "row value misuse..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+8516 /* "row value misuse..." */, 0) return WRC_Abort -__67: +__71: ; - resolveAlias(tls, pParse, pEList, j, pExpr, ts+800 /* "" */, nSubquery) + resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) cnt = 1 pMatch = uintptr(0) if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { - goto __68 + goto __72 } Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr) -__68: +__72: ; goto lookupname_end -__64: +__68: ; - goto __62 -__62: + goto __66 +__66: j++ - goto __61 - goto __63 -__63: + goto __65 + goto __67 +__67: ; -__60: +__64: ; // Advance to the next name context. The loop will exit when either // we have a match (cnt>0) or when we run out of name contexts. if !(cnt != 0) { - goto __69 + goto __73 } goto __11 -__69: +__73: ; pNC = (*NameContext)(unsafe.Pointer(pNC)).FpNext nSubquery++ @@ -77746,12 +78345,12 @@ __11: // Because no reference was made to outer contexts, the pNC->nRef // fields are not changed in any context. if !((cnt == 0) && (zTab == uintptr(0))) { - goto __70 + goto __74 } - if !((((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_DblQuoted)) != U32(0)) && + if !((((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_DblQuoted))) != U32(0)) && (areDoubleQuotedStringsEnabled(tls, db, pTopNC) != 0)) { - goto __71 + goto __75 } // If a double-quoted identifier does not match any known column name, // then treat it as a string. @@ -77767,51 +78366,51 @@ __11: // a huge amount of legacy SQL that uses it. So for now, we just // issue a warning. Xsqlite3_log(tls, SQLITE_WARNING, - ts+8441 /* "double-quoted st..." */, libc.VaList(bp+16, zCol)) - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_STRING + ts+8534 /* "double-quoted st..." */, libc.VaList(bp+16, zCol)) + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_STRING) *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = uintptr(0) return WRC_Prune -__71: +__75: ; if !(Xsqlite3ExprIdToTrueFalse(tls, pExpr) != 0) { - goto __72 + goto __76 } return WRC_Prune -__72: +__76: ; -__70: +__74: ; // cnt==0 means there was not match. cnt>1 means there were two or // more matches. Either way, we have an error. if !(cnt != 1) { - goto __73 + goto __77 } if cnt == 0 { - zErr = ts + 8476 /* "no such column" */ + zErr = ts + 8569 /* "no such column" */ } else { - zErr = ts + 8491 /* "ambiguous column..." */ + zErr = ts + 8584 /* "ambiguous column..." */ } if !(zDb != 0) { - goto __74 + goto __78 } - Xsqlite3ErrorMsg(tls, pParse, ts+8513 /* "%s: %s.%s.%s" */, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) - goto __75 -__74: + Xsqlite3ErrorMsg(tls, pParse, ts+8606 /* "%s: %s.%s.%s" */, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + goto __79 +__78: if !(zTab != 0) { - goto __76 + goto __80 } - Xsqlite3ErrorMsg(tls, pParse, ts+8526 /* "%s: %s.%s" */, libc.VaList(bp+56, zErr, zTab, zCol)) - goto __77 -__76: - Xsqlite3ErrorMsg(tls, pParse, ts+8536 /* "%s: %s" */, libc.VaList(bp+80, zErr, zCol)) -__77: + Xsqlite3ErrorMsg(tls, pParse, ts+8619 /* "%s: %s.%s" */, libc.VaList(bp+56, zErr, zTab, zCol)) + goto __81 +__80: + Xsqlite3ErrorMsg(tls, pParse, ts+8629 /* "%s: %s" */, libc.VaList(bp+80, zErr, zCol)) +__81: ; -__75: +__79: ; (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) (*NameContext)(unsafe.Pointer(pTopNC)).FnErr++ -__73: +__77: ; // If a column from a table in pSrcList is referenced, then record @@ -77828,73 +78427,79 @@ __73: // If a generated column is referenced, set bits for every column // of the table. if !((int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0) && (pMatch != uintptr(0))) { - goto __78 + goto __82 } *(*Bitmask)(unsafe.Pointer(pMatch + 88 /* &.colUsed */)) |= (Xsqlite3ExprColUsed(tls, pExpr)) -__78: +__82: ; // Clean up and return + if !(!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0))) { + goto __83 + } Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) (*Expr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) Xsqlite3ExprDelete(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpRight) (*Expr)(unsafe.Pointer(pExpr)).FpRight = uintptr(0) +__83: + ; (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(eNewExprOp) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Leaf) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Leaf)) lookupname_end: if !(cnt == 1) { - goto __79 + goto __84 } - if !(!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Alias)) != U32(0))) { - goto __81 + if !(((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FxAuth != 0) && + ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_TRIGGER))) { + goto __86 } Xsqlite3AuthRead(tls, pParse, pExpr, pSchema, (*NameContext)(unsafe.Pointer(pNC)).FpSrcList) -__81: +__86: ; // Increment the nRef value on all name contexts from TopNC up to // the point where the name matched. -__82: +__87: ; (*NameContext)(unsafe.Pointer(pTopNC)).FnRef++ if !(pTopNC == pNC) { - goto __85 + goto __90 } - goto __84 -__85: + goto __89 +__90: ; pTopNC = (*NameContext)(unsafe.Pointer(pTopNC)).FpNext - goto __83 -__83: - goto __82 - goto __84 -__84: + goto __88 +__88: + goto __87 + goto __89 +__89: ; return WRC_Prune - goto __80 -__79: + goto __85 +__84: return WRC_Abort -__80: +__85: ; return int32(0) } // Allocate and return a pointer to an expression to load the column iCol // from datasource iSrc in SrcList pSrc. -func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int32, iCol int32) uintptr { /* sqlite3.c:98406:21: */ +func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int32, iCol int32) uintptr { /* sqlite3.c:99273:21: */ var p uintptr = Xsqlite3ExprAlloc(tls, db, TK_COLUMN, uintptr(0), 0) if p != 0 { var pItem uintptr = ((pSrc + 8 /* &.a */) + uintptr(iSrc)*112) - var pTab uintptr = libc.AssignPtrUintptr(p+64 /* &.y */ /* &.pTab */, (*SrcList_item)(unsafe.Pointer(pItem)).FpTab) - (*Expr)(unsafe.Pointer(p)).FiTable = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor + var pTab uintptr = libc.AssignPtrUintptr(p+64 /* &.y */ /* &.pTab */, (*SrcItem)(unsafe.Pointer(pItem)).FpTab) + (*Expr)(unsafe.Pointer(p)).FiTable = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor if int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)))).FiPKey) == iCol { (*Expr)(unsafe.Pointer(p)).FiColumn = int16(-1) } else { (*Expr)(unsafe.Pointer(p)).FiColumn = YnVar(iCol) - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != U32(0)) && + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { - (*SrcList_item)(unsafe.Pointer(pItem)).FcolUsed = func() uint64 { + (*SrcItem)(unsafe.Pointer(pItem)).FcolUsed = func() uint64 { if int32((*Table)(unsafe.Pointer(pTab)).FnCol) >= 64 { return libc.Uint64(libc.Uint64FromInt32(-1)) } @@ -77928,28 +78533,28 @@ func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int3 // As an optimization, since the conditional is almost always false // (because errors are rare), the conditional is moved outside of the // function call using a macro. -func notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pExpr uintptr) { /* sqlite3.c:98448:13: */ +func notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pExpr uintptr) { /* sqlite3.c:99315:13: */ bp := tls.Alloc(16) defer tls.Free(16) - var zIn uintptr = ts + 8543 /* "partial index WH..." */ + var zIn uintptr = ts + 8636 /* "partial index WH..." */ if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_IdxExpr) != 0 { - zIn = ts + 8571 /* "index expression..." */ + zIn = ts + 8664 /* "index expression..." */ } else if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_IsCheck) != 0 { - zIn = ts + 8589 /* "CHECK constraint..." */ + zIn = ts + 8682 /* "CHECK constraint..." */ } else if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_GenCol) != 0 { - zIn = ts + 8607 /* "generated column..." */ + zIn = ts + 8700 /* "generated column..." */ } - Xsqlite3ErrorMsg(tls, pParse, ts+8625 /* "%s prohibited in..." */, libc.VaList(bp, zMsg, zIn)) + Xsqlite3ErrorMsg(tls, pParse, ts+8718 /* "%s prohibited in..." */, libc.VaList(bp, zMsg, zIn)) if pExpr != 0 { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } } // 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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:98474:12: */ +func exprProbability(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:99341:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -77957,7 +78562,7 @@ func exprProbability(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98474:12: */ if int32((*Expr)(unsafe.Pointer(p)).Fop) != TK_FLOAT { return -1 } - Xsqlite3AtoF(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), bp /* &r */, Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))), SQLITE_UTF8) + Xsqlite3AtoF(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), bp /* &r */, Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))), uint8(SQLITE_UTF8)) if *(*float64)(unsafe.Pointer(bp /* r */)) > 1.0 { return -1 @@ -77974,9 +78579,9 @@ func exprProbability(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98474:12: */ // 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 *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:98494:12: */ - bp := tls.Alloc(96) - defer tls.Free(96) +func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99361:12: */ + bp := tls.Alloc(128) + defer tls.Free(128) var pNC uintptr var pParse uintptr @@ -77997,15 +78602,89 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s var pItem uintptr pItem = pSrcList + 8 /* &.a */ - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_COLUMN - *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab - (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN) + *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = (*SrcItem)(unsafe.Pointer(pItem)).FpTab + (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor (*Expr)(unsafe.Pointer(pExpr)).FiColumn-- - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) break } + // An optimization: Attempt to convert + // + // "expr IS NOT NULL" --> "TRUE" + // "expr IS NULL" --> "FALSE" + // + // if we can prove that "expr" is never NULL. Call this the + // "NOT NULL strength reduction optimization". + // + // If this optimization occurs, also restore the NameContext ref-counts + // to the state they where in before the "column" LHS expression was + // resolved. This prevents "column" from being counted as having been + // referenced, which might prevent a SELECT from being erroneously + // marked as correlated. + case TK_NOTNULL: + fallthrough + case TK_ISNULL: + { + // var anRef [8]int32 at bp+96, 32 + + var p uintptr + var i int32 + i = 0 + p = pNC + __1: + if !((p != 0) && (i < (int32(uint64(unsafe.Sizeof([8]int32{})) / uint64(unsafe.Sizeof(int32(0))))))) { + goto __3 + } + { + *(*int32)(unsafe.Pointer(bp + 96 /* &anRef[0] */ + uintptr(i)*4)) = (*NameContext)(unsafe.Pointer(p)).FnRef + + } + goto __2 + __2: + p = (*NameContext)(unsafe.Pointer(p)).FpNext + i++ + goto __1 + goto __3 + __3: + ; + Xsqlite3WalkExpr(tls, pWalker, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) + if (0 == Xsqlite3ExprCanBeNull(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { + if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL { + *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = ts + 8738 /* "true" */ + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_IsTrue)) + } else { + *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = ts + 8743 /* "false" */ + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_IsFalse)) + } + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUEFALSE) + i = 0 + p = pNC + __4: + if !((p != 0) && (i < (int32(uint64(unsafe.Sizeof([8]int32{})) / uint64(unsafe.Sizeof(int32(0))))))) { + goto __6 + } + { + (*NameContext)(unsafe.Pointer(p)).FnRef = *(*int32)(unsafe.Pointer(bp + 96 /* &anRef[0] */ + uintptr(i)*4)) + + } + goto __5 + __5: + p = (*NameContext)(unsafe.Pointer(p)).FpNext + i++ + goto __4 + goto __6 + __6: + ; + Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) + (*Expr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) + } + return WRC_Prune + + } + // A column name: ID // Or table name and column name: ID.ID // Or a database, table and column: ID.ID.ID @@ -78030,7 +78709,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (NC_IdxExpr | NC_GenCol)) != 0 { - notValidImpl(tls, pParse, pNC, ts+8645 /* "the \".\" operator" */, uintptr(0)) + notValidImpl(tls, pParse, pNC, ts+8749 /* "the \".\" operator" */, uintptr(0)) } pRight = (*Expr)(unsafe.Pointer(pExpr)).FpRight @@ -78072,7 +78751,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s var enc U8 = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fenc // The database encoding var savedAllowFlags int32 = ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_AllowAgg | NC_AllowWin)) var pWin uintptr = func() uintptr { - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) && (int32((*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FeFrmType) != TK_FILTER) { + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) && (int32((*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FeFrmType) != TK_FILTER) { return *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) } return uintptr(0) @@ -78090,14 +78769,14 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s } } else { is_agg = (libc.Bool32((*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0))) - if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_UNLIKELY) != 0 { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Unlikely) + if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_UNLIKELY)) != 0 { + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Unlikely)) if n == 2 { (*Expr)(unsafe.Pointer(pExpr)).FiTable = exprProbability(tls, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+1*32)).FpExpr) if (*Expr)(unsafe.Pointer(pExpr)).FiTable < 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+8662 /* "second argument ..." */, 0) + ts+8766 /* "second argument ..." */, 0) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } } else { @@ -78122,11 +78801,11 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s var auth int32 = Xsqlite3AuthCheck(tls, pParse, SQLITE_FUNCTION, uintptr(0), (*FuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == SQLITE_DENY { - Xsqlite3ErrorMsg(tls, pParse, ts+8733, /* "not authorized t..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+8837, /* "not authorized t..." */ libc.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) return WRC_Prune } @@ -78136,9 +78815,9 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s // functions and other functions that change slowly are considered // constant because they are constant for the duration of one query. // This allows them to be factored out of inner loops. - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_ConstFunc) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_ConstFunc)) } - if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_CONSTANT) == U32(0) { + if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_CONSTANT)) == U32(0) { // Clearly non-deterministic functions like random(), but also // date/time functions that use 'now', and other functions like // sqlite_version() that might change over time cannot be used @@ -78146,19 +78825,19 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s // in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all // all this. if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & ((NC_IdxExpr | NC_PartIdx) | NC_GenCol)) != 0 { - notValidImpl(tls, pParse, pNC, ts+8768 /* "non-deterministi..." */, uintptr(0)) + notValidImpl(tls, pParse, pNC, ts+8872 /* "non-deterministi..." */, uintptr(0)) } } else { // Must fit in 8 bits (*Expr)(unsafe.Pointer(pExpr)).Fop2 = (U8((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_SelfRef)) if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_FromDDL) != 0 { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FromDDL) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL)) } } - if ((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_INTERNAL) != U32(0)) && + if ((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_INTERNAL)) != U32(0)) && (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)) && - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & DBFLAG_InternalFunc) == U32(0)) { + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & U32(DBFLAG_InternalFunc)) == U32(0)) { // Internal-use-only functions are disallowed unless the // SQL is being compiled using sqlite3NestedParse() or // the SQLITE_TESTCTRL_INTERNAL_FUNCTIONS test-control has be @@ -78175,30 +78854,30 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s if ((pDef != 0) && ((*FuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0))) && (pWin != 0) { Xsqlite3ErrorMsg(tls, pParse, - ts+8796 /* "%.*s() may not b..." */, libc.VaList(bp+8, nId, zId)) + ts+8900 /* "%.*s() may not b..." */, libc.VaList(bp+8, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } else if (((is_agg != 0) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowAgg) == 0)) || - (((is_agg != 0) && (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_WINDOW) != 0)) && !(pWin != 0))) || + (((is_agg != 0) && (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0)) && !(pWin != 0))) || (((is_agg != 0) && (pWin != 0)) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & NC_AllowWin) == 0)) { var zType uintptr - if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_WINDOW) != 0) || (pWin != 0) { - zType = ts + 8840 /* "window" */ + if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0) || (pWin != 0) { + zType = ts + 8944 /* "window" */ } else { - zType = ts + 8847 /* "aggregate" */ + zType = ts + 8951 /* "aggregate" */ } - Xsqlite3ErrorMsg(tls, pParse, ts+8857 /* "misuse of %s fun..." */, libc.VaList(bp+24, zType, nId, zId)) + Xsqlite3ErrorMsg(tls, pParse, ts+8961 /* "misuse of %s fun..." */, libc.VaList(bp+24, zType, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ is_agg = 0 } else if (no_such_func != 0) && (int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+8886 /* "no such function..." */, libc.VaList(bp+48, nId, zId)) + Xsqlite3ErrorMsg(tls, pParse, ts+8990 /* "no such function..." */, libc.VaList(bp+48, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } else if wrong_num_args != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+8909, /* "wrong number of ..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+9013, /* "wrong number of ..." */ libc.VaList(bp+64, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ - } else if (is_agg == 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + } else if (is_agg == 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { Xsqlite3ErrorMsg(tls, pParse, - ts+8954, /* "FILTER may not b..." */ + ts+9058, /* "FILTER may not b..." */ libc.VaList(bp+80, nId, zId)) (*NameContext)(unsafe.Pointer(pNC)).FnErr++ } @@ -78213,7 +78892,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s return 0 }()))) } - } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { is_agg = 1 } Xsqlite3WalkExprList(tls, pWalker, pList) @@ -78228,6 +78907,9 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s } return uintptr(0) }(), pWin, pDef) + if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { + break + } } Xsqlite3WalkExprList(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpPartition) Xsqlite3WalkExprList(tls, pWalker, (*Window)(unsafe.Pointer(pWin)).FpOrderBy) @@ -78236,9 +78918,9 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) |= (NC_HasWin) } else { var pNC2 uintptr = pNC - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_AGG_FUNCTION + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_AGG_FUNCTION) (*Expr)(unsafe.Pointer(pExpr)).Fop2 = U8(0) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { Xsqlite3WalkExpr(tls, pWalker, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter) } for (pNC2 != 0) && !(Xsqlite3FunctionUsesThisSrc(tls, pExpr, (*NameContext)(unsafe.Pointer(pNC2)).FpSrcList) != 0) { @@ -78248,7 +78930,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s if (pNC2 != 0) && (pDef != 0) { - *(*int32)(unsafe.Pointer(pNC2 + 40 /* &.ncFlags */)) |= int32((NC_HasAgg | ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_MINMAX))) + *(*int32)(unsafe.Pointer(pNC2 + 40 /* &.ncFlags */)) |= int32((U32(NC_HasAgg) | ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)))) } } @@ -78266,17 +78948,17 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s case TK_IN: { - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { var nRef int32 = (*NameContext)(unsafe.Pointer(pNC)).FnRef if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (((NC_IsCheck | NC_PartIdx) | NC_IdxExpr) | NC_GenCol)) != 0 { - notValidImpl(tls, pParse, pNC, ts+9003 /* "subqueries" */, pExpr) + notValidImpl(tls, pParse, pNC, ts+9107 /* "subqueries" */, pExpr) } Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) if nRef != (*NameContext)(unsafe.Pointer(pNC)).FnRef { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_VarSelect) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_VarSelect)) *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) |= (NC_VarSelect) } } @@ -78287,7 +78969,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s { if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (((NC_IsCheck | NC_PartIdx) | NC_IdxExpr) | NC_GenCol)) != 0 { - notValidImpl(tls, pParse, pNC, ts+9014 /* "parameters" */, pExpr) + notValidImpl(tls, pParse, pNC, ts+9118 /* "parameters" */, pExpr) } break @@ -78301,14 +78983,14 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s // Handle special cases of "x IS TRUE", "x IS FALSE", "x IS NOT TRUE", // and "x IS NOT FALSE". - if (pRight != 0) && (int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_ID) { + if (pRight != 0) && ((int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_ID) || (int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_TRUEFALSE)) { var rc int32 = resolveExprStep(tls, pWalker, pRight) if rc == WRC_Abort { return WRC_Abort } if int32((*Expr)(unsafe.Pointer(pRight)).Fop) == TK_TRUEFALSE { (*Expr)(unsafe.Pointer(pExpr)).Fop2 = (*Expr)(unsafe.Pointer(pExpr)).Fop - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_TRUTH + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUTH) return WRC_Continue } } @@ -78347,7 +79029,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s } if nLeft != nRight { - Xsqlite3ErrorMsg(tls, pParse, ts+8423 /* "row value misuse..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+8516 /* "row value misuse..." */, 0) } break @@ -78369,7 +79051,7 @@ func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s // return 0. // // pEList has been resolved. pE has not. -func resolveAsName(tls *libc.TLS, pParse uintptr, pEList uintptr, pE uintptr) int32 { /* sqlite3.c:98894:12: */ +func resolveAsName(tls *libc.TLS, pParse uintptr, pEList uintptr, pE uintptr) int32 { /* sqlite3.c:99803:12: */ var i int32 // Loop counter _ = pParse @@ -78402,7 +79084,7 @@ func resolveAsName(tls *libc.TLS, pParse uintptr, pEList uintptr, pE uintptr) in // the column. // // If there is no match, return 0. Return -1 if an error occurs. -func resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintptr, pE uintptr) int32 { /* sqlite3.c:98934:12: */ +func resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintptr, pE uintptr) int32 { /* sqlite3.c:99843:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -78448,13 +79130,13 @@ func resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintptr } // Generate an ORDER BY or GROUP BY term out-of-range error. -func resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32) { /* sqlite3.c:98981:13: */ +func resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32) { /* sqlite3.c:99890:13: */ bp := tls.Alloc(24) defer tls.Free(24) Xsqlite3ErrorMsg(tls, pParse, - ts+9025 /* "%r %s BY term ou..." */, libc.VaList(bp, i, zType, mx)) + ts+9129 /* "%r %s BY term ou..." */, libc.VaList(bp, i, zType, mx)) } // Analyze the ORDER BY clause in a compound SELECT statement. Modify @@ -78470,7 +79152,7 @@ func resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int3 // the integer column number. // // Return the number of errors seen. -func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int32 { /* sqlite3.c:99007:12: */ +func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int32 { /* sqlite3.c:99916:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -78485,8 +79167,8 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3 return 0 } db = (*Parse)(unsafe.Pointer(pParse)).Fdb - if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 2*4)) { - Xsqlite3ErrorMsg(tls, pParse, ts+9081 /* "too many terms i..." */, 0) + if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 2*4)) { + Xsqlite3ErrorMsg(tls, pParse, ts+9185 /* "too many terms i..." */, 0) return 1 } for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ { @@ -78516,9 +79198,12 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3 goto __2 } pE = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr) + if pE == uintptr(0) { + goto __2 + } if Xsqlite3ExprIsInteger(tls, pE, bp+8 /* &iCol */) != 0 { if (*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) <= 0) || (*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) > (*ExprList)(unsafe.Pointer(pEList)).FnExpr) { - resolveOutOfRangeError(tls, pParse, ts+9115 /* "ORDER" */, (i + 1), (*ExprList)(unsafe.Pointer(pEList)).FnExpr) + resolveOutOfRangeError(tls, pParse, ts+9219 /* "ORDER" */, (i + 1), (*ExprList)(unsafe.Pointer(pEList)).FnExpr) return 1 } } else { @@ -78559,7 +79244,7 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3 if pNew == uintptr(0) { return 1 } - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_IntValue) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_IntValue)) *(*int32)(unsafe.Pointer(pNew + 8 /* &.u */)) = *(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) if (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr == pE { (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = pNew @@ -78594,7 +79279,7 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3 for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ { if (int32(*(*uint8)(unsafe.Pointer(((pOrderBy + 8 /* &.a */) + uintptr(i)*32) + 20 /* &.done */)) & 0x4 >> 2)) == 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+9121 /* "%r ORDER BY term..." */, libc.VaList(bp, (i+1))) + ts+9225 /* "%r ORDER BY term..." */, libc.VaList(bp, (i+1))) return 1 } } @@ -78609,7 +79294,7 @@ func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int3 // // If any errors are detected, add an error message to pParse and // return non-zero. Return zero if no errors are seen. -func Xsqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:99124:20: */ +func Xsqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:100034:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -78621,8 +79306,8 @@ func Xsqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, if ((pOrderBy == uintptr(0)) || ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0)) || (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { return 0 } - if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 2*4)) { - Xsqlite3ErrorMsg(tls, pParse, ts+9182 /* "too many terms i..." */, libc.VaList(bp, zType)) + if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 2*4)) { + Xsqlite3ErrorMsg(tls, pParse, ts+9286 /* "too many terms i..." */, libc.VaList(bp, zType)) return 1 } pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList @@ -78639,8 +79324,7 @@ __1: resolveOutOfRangeError(tls, pParse, zType, (i + 1), (*ExprList)(unsafe.Pointer(pEList)).FnExpr) return 1 } - resolveAlias(tls, pParse, pEList, (int32(*(*U16)(unsafe.Pointer((pItem + 24 /* &.u */ /* &.x */) /* &.iOrderByCol */))) - 1), (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr, - zType, 0) + resolveAlias(tls, pParse, pEList, (int32(*(*U16)(unsafe.Pointer((pItem + 24 /* &.u */ /* &.x */) /* &.iOrderByCol */))) - 1), (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr, 0) } } @@ -78656,9 +79340,9 @@ __3: } // Walker callback for windowRemoveExprFromSelect(). -func resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99159:12: */ +func resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:100068:12: */ _ = pWalker - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) Xsqlite3WindowUnlinkFromSelect(tls, pWin) } @@ -78667,7 +79351,7 @@ func resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 // Remove any Window objects owned by the expression pExpr from the // Select.pWin list of Select object pSelect. -func windowRemoveExprFromSelect(tls *libc.TLS, pSelect uintptr, pExpr uintptr) { /* sqlite3.c:99172:13: */ +func windowRemoveExprFromSelect(tls *libc.TLS, pSelect uintptr, pExpr uintptr) { /* sqlite3.c:100081:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -78699,7 +79383,7 @@ func windowRemoveExprFromSelect(tls *libc.TLS, pSelect uintptr, pExpr uintptr) { // 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 *libc.TLS, pNC uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:99203:12: */ +func resolveOrderGroupBy(tls *libc.TLS, pNC uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:100112:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -78725,6 +79409,9 @@ __1: { var pE uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr var pE2 uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pE) + if pE2 == uintptr(0) { + goto __2 + } if int32(*(*int8)(unsafe.Pointer(zType))) != 'G' { *(*int32)(unsafe.Pointer(bp /* iCol */)) = resolveAsName(tls, pParse, (*Select)(unsafe.Pointer(pSelect)).FpEList, pE2) if *(*int32)(unsafe.Pointer(bp /* iCol */)) > 0 { @@ -78776,7 +79463,7 @@ __3: } // Resolve names in the SELECT statement p and all of its descendants. -func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:99265:12: */ +func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:100175:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -78791,7 +79478,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql var pLeftmost uintptr // Left-most of SELECT of a compound var db uintptr // Database connection - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Resolved) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Resolved)) != 0 { return WRC_Prune } pOuterNC = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) @@ -78805,7 +79492,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // sqlite3SelectPrep() do all of the processing for this SELECT. // sqlite3SelectPrep() will invoke both sqlite3SelectExpand() and // this routine in the correct order. - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Expanded) == U32(0) { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Expanded)) == U32(0) { Xsqlite3SelectPrep(tls, pParse, p, pOuterNC) if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { return WRC_Abort @@ -78818,7 +79505,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql pLeftmost = p for p != 0 { - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Resolved) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Resolved)) // Resolve the expressions in the LIMIT and OFFSET clauses. These // are not allowed to refer to any names, so pass an empty NameContext. @@ -78835,8 +79522,8 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // as if it were part of the sub-query, not the parent. This block // moves the pOrderBy down to the sub-query. It will be moved back // after the names have been resolved. - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Converted) != 0 { - var pSub uintptr = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Converted)) != 0 { + var pSub uintptr = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect (*Select)(unsafe.Pointer(pSub)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy (*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) @@ -78845,34 +79532,34 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // Recursively resolve names in all subqueries for i = 0; i < (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc; i++ { var pItem uintptr = (((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(i)*112) - if ((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & SF_Resolved) == U32(0)) { - var pNC uintptr // Used to iterate name contexts - var nRef int32 = 0 // Refcount for pOuterNC and outer contexts + if ((*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0) && (((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & U32(SF_Resolved)) == U32(0)) { + var nRef int32 + if pOuterNC != 0 { + nRef = (*NameContext)(unsafe.Pointer(pOuterNC)).FnRef + } else { + nRef = 0 + } var zSavedContext uintptr = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext - // Count the total number of references to pOuterNC and all of its - // parent contexts. After resolving references to expressions in - // pItem->pSelect, check if this value has changed. If so, then - // SELECT statement pItem->pSelect must be correlated. Set the - // pItem->fg.isCorrelated flag if this is the case. - for pNC = pOuterNC; pNC != 0; pNC = (*NameContext)(unsafe.Pointer(pNC)).FpNext { - nRef = nRef + ((*NameContext)(unsafe.Pointer(pNC)).FnRef) + if (*SrcItem)(unsafe.Pointer(pItem)).FzName != 0 { + (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcItem)(unsafe.Pointer(pItem)).FzName } - - if (*SrcList_item)(unsafe.Pointer(pItem)).FzName != 0 { - (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcList_item)(unsafe.Pointer(pItem)).FzName - } - Xsqlite3ResolveSelectNames(tls, pParse, (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect, pOuterNC) + Xsqlite3ResolveSelectNames(tls, pParse, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect, pOuterNC) (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedContext if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { return WRC_Abort } - for pNC = pOuterNC; pNC != 0; pNC = (*NameContext)(unsafe.Pointer(pNC)).FpNext { - nRef = nRef - ((*NameContext)(unsafe.Pointer(pNC)).FnRef) - } + // If the number of references to the outer context changed when + // expressions in the sub-select were resolved, the sub-select + // is correlated. It is not required to check the refcount on any + // but the innermost outer context object, as lookupName() increments + // the refcount on all contexts between the current one and the + // context containing the column when it resolves a name. + if pOuterNC != 0 { - libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isCorrelated */, (uint32(libc.Bool32(nRef != 0))), 3, 0x8) + libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isCorrelated */, (uint32(libc.Bool32((*NameContext)(unsafe.Pointer(pOuterNC)).FnRef > nRef))), 3, 0x8) + } } } @@ -78901,7 +79588,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // If a HAVING clause is present, then there must be a GROUP BY clause. if ((*Select)(unsafe.Pointer(p)).FpHaving != 0) && !(pGroupBy != 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+9213 /* "a GROUP BY claus..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+9317 /* "a GROUP BY claus..." */, 0) return WRC_Abort } @@ -78941,8 +79628,8 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // within the ORDER BY clause has been transformed to an integer value. // These integers will be replaced by copies of the corresponding result // set expressions by the call to resolveOrderGroupBy() below. - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Converted) != 0 { - var pSub uintptr = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Converted)) != 0 { + var pSub uintptr = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect (*Select)(unsafe.Pointer(p)).FpOrderBy = (*Select)(unsafe.Pointer(pSub)).FpOrderBy (*Select)(unsafe.Pointer(pSub)).FpOrderBy = uintptr(0) } @@ -78957,7 +79644,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // is not detected until much later, and so we need to go ahead and // resolve those symbols on the incorrect ORDER BY for consistency. if (isCompound <= nCompound) && // Defer right-most ORDER BY of a compound - (resolveOrderGroupBy(tls, bp /* &sNC */, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+9115 /* "ORDER" */) != 0) { + (resolveOrderGroupBy(tls, bp /* &sNC */, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+9219 /* "ORDER" */) != 0) { return WRC_Abort } if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -78970,7 +79657,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql if pGroupBy != 0 { var pItem uintptr - if (resolveOrderGroupBy(tls, bp /* &sNC */, p, pGroupBy, ts+9257 /* "GROUP" */) != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + if (resolveOrderGroupBy(tls, bp /* &sNC */, p, pGroupBy, ts+9361 /* "GROUP" */) != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { return WRC_Abort } i = 0 @@ -78980,9 +79667,9 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql goto __3 } { - if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer(pItem)).FpExpr))).Fflags & (EP_Agg)) != U32(0) { + if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer(pItem)).FpExpr))).Fflags & (U32(EP_Agg))) != U32(0) { Xsqlite3ErrorMsg(tls, pParse, - ts+9263 /* "aggregate functi..." */, 0) + ts+9367 /* "aggregate functi..." */, 0) return WRC_Abort } @@ -79073,7 +79760,7 @@ func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sql // // An error message is left in pParse if anything is amiss. The number // if errors is returned. -func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:99550:20: */ +func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:100459:20: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -79094,12 +79781,12 @@ func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 { }{resolveSelectStep})) (*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = uintptr(0) *(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = pNC - *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 292 /* &.nHeight */)) += ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) + *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 284 /* &.nHeight */)) += ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) if Xsqlite3ExprCheckHeight(tls, (*Walker)(unsafe.Pointer(bp /* &w */)).FpParse, (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse)).FnHeight) != 0 { return SQLITE_ERROR } Xsqlite3WalkExpr(tls, bp /* &w */, pExpr) - *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 292 /* &.nHeight */)) -= ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) + *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 284 /* &.nHeight */)) -= ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_HasWin))) *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) |= (savedHasAgg) @@ -79109,7 +79796,7 @@ func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 { // 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 Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int32 { /* sqlite3.c:99589:20: */ +func Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int32 { /* sqlite3.c:100498:20: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -79136,12 +79823,12 @@ func Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int if pExpr == uintptr(0) { continue } - *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 292 /* &.nHeight */)) += ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) + *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 284 /* &.nHeight */)) += ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) if Xsqlite3ExprCheckHeight(tls, (*Walker)(unsafe.Pointer(bp /* &w */)).FpParse, (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse)).FnHeight) != 0 { return WRC_Abort } Xsqlite3WalkExpr(tls, bp /* &w */, pExpr) - *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 292 /* &.nHeight */)) -= ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) + *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 284 /* &.nHeight */)) -= ((*Expr)(unsafe.Pointer(pExpr)).FnHeight) if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & ((NC_HasAgg | NC_MinMaxAgg) | NC_HasWin)) != 0 { *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (NC_HasAgg | NC_HasWin))) @@ -79166,7 +79853,7 @@ func Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int // // All SELECT statements should have been expanded using // sqlite3SelectExpand() prior to invoking this routine. -func Xsqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:99644:21: */ +func Xsqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:100553:21: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -79200,7 +79887,7 @@ func Xsqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter // set to the column number. In case (4), TK_COLUMN nodes cause an error. // // Any errors cause an error message to be set in pParse. -func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) int32 { /* sqlite3.c:99678:20: */ +func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) int32 { /* sqlite3.c:100587:20: */ bp := tls.Alloc(176) defer tls.Free(176) @@ -79214,9 +79901,9 @@ func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, t libc.Xmemset(tls, bp+56 /* &sSrc */, 0, uint64(unsafe.Sizeof(SrcList{}))) if pTab != 0 { (*SrcList)(unsafe.Pointer(bp + 56 /* &sSrc */)).FnSrc = 1 - (*SrcList_item)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */))).FzName = (*Table)(unsafe.Pointer(pTab)).FzName - (*SrcList_item)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */))).FpTab = pTab - (*SrcList_item)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */))).FiCursor = -1 + (*SrcItem)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */))).FzName = (*Table)(unsafe.Pointer(pTab)).FzName + (*SrcItem)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */))).FpTab = pTab + (*SrcItem)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */))).FiCursor = -1 if (*Table)(unsafe.Pointer(pTab)).FpSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+1*32)).FpSchema { // Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP // schema elements @@ -79236,12 +79923,12 @@ func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, t } // Return the affinity character for a single column of a table. -func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) int8 { /* sqlite3.c:99738:21: */ +func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) int8 { /* sqlite3.c:100647:21: */ if iCol >= 0 { return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).Faffinity } - return SQLITE_AFF_INTEGER + return int8(SQLITE_AFF_INTEGER) } // Return the 'affinity' of the expression pExpr if any. @@ -79258,9 +79945,9 @@ func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) int8 { // SELECT * FROM t1 WHERE a; // SELECT a AS b FROM t1 WHERE b; // SELECT * FROM t1 WHERE (select a from t1); -func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:99759:21: */ +func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:100668:21: */ var op int32 - for ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Skip)) != U32(0) { + for ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip | EP_IfNullRow))) != U32(0) { pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft @@ -79297,8 +79984,21 @@ func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:9975 // // If a memory allocation error occurs, that fact is recorded in pParse->db // and the pExpr parameter is returned unchanged. -func Xsqlite3ExprAddCollateToken(tls *libc.TLS, pParse uintptr, pExpr uintptr, pCollName uintptr, dequote int32) uintptr { /* sqlite3.c:99804:21: */ - if (*Token)(unsafe.Pointer(pCollName)).Fn > uint32(0) { +func Xsqlite3ExprAddCollateToken(tls *libc.TLS, pParse uintptr, pExpr uintptr, pCollName uintptr, dequote int32) uintptr { /* sqlite3.c:100715:21: */ + + if pExpr == uintptr(0) { + return uintptr(0) + } + if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VECTOR { + var pList uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + if pList != uintptr(0) { + var i int32 + for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ { + (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32)).FpExpr = Xsqlite3ExprAddCollateToken(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*32)).FpExpr, + pCollName, dequote) + } + } + } else if (*Token)(unsafe.Pointer(pCollName)).Fn > uint32(0) { var pNew uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_COLLATE, pCollName, dequote) if pNew != 0 { (*Expr)(unsafe.Pointer(pNew)).FpLeft = pExpr @@ -79309,7 +80009,7 @@ func Xsqlite3ExprAddCollateToken(tls *libc.TLS, pParse uintptr, pExpr uintptr, p return pExpr } -func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, zC uintptr) uintptr { /* sqlite3.c:99820:21: */ +func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, zC uintptr) uintptr { /* sqlite3.c:100742:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -79320,8 +80020,8 @@ func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, } // Skip over any TK_COLLATE operators. -func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:99830:21: */ - for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Skip)) != U32(0)) { +func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:100752:21: */ + for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip))) != U32(0)) { pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft } @@ -79331,9 +80031,9 @@ func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3. // Skip over any TK_COLLATE operators and/or any unlikely() // or likelihood() or likely() functions at the root of an // expression. -func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:99843:21: */ +func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:100765:21: */ for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Skip | EP_Unlikely))) != U32(0)) { - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Unlikely)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Unlikely))) != U32(0) { pExpr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + 8 /* &.a */))).FpExpr } else { @@ -79356,7 +80056,7 @@ func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr { /* // 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 Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:99872:24: */ +func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:100794:24: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pColl uintptr = uintptr(0) var p uintptr = pExpr @@ -79388,8 +80088,8 @@ func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { pColl = Xsqlite3GetCollSeq(tls, pParse, (*Sqlite3)(unsafe.Pointer(db)).Fenc, uintptr(0), *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) break } - if ((*Expr)(unsafe.Pointer(p)).Fflags & EP_Collate) != 0 { - if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) && (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fflags & EP_Collate) != U32(0)) { + if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_Collate)) != 0 { + if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) && (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fflags & U32(EP_Collate)) != U32(0)) { p = (*Expr)(unsafe.Pointer(p)).FpLeft } else { var pNext uintptr = (*Expr)(unsafe.Pointer(p)).FpRight @@ -79397,10 +80097,10 @@ func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { if ((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != uintptr(0)) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0)) && - (!(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0))) { + (!(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0))) { var i int32 for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)))).FnExpr; i++ { - if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr))).Fflags & (EP_Collate)) != U32(0) { + if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr))).Fflags & (U32(EP_Collate))) != U32(0) { pNext = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr break } @@ -79426,7 +80126,7 @@ func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { // // The sqlite3ExprCollSeq() routine works the same except that it // returns NULL if there is no defined collation. -func Xsqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:99944:24: */ +func Xsqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:100866:24: */ var p uintptr = Xsqlite3ExprCollSeq(tls, pParse, pExpr) if p == uintptr(0) { p = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl @@ -79436,7 +80136,7 @@ func Xsqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr } // Return TRUE if the two expressions have equivalent collating sequences. -func Xsqlite3ExprCollSeqMatch(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr) int32 { /* sqlite3.c:99954:20: */ +func Xsqlite3ExprCollSeqMatch(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr) int32 { /* sqlite3.c:100876:20: */ var pColl1 uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, pE1) var pColl2 uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, pE2) return (libc.Bool32(Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl1)).FzName, (*CollSeq)(unsafe.Pointer(pColl2)).FzName) == 0)) @@ -79445,15 +80145,15 @@ func Xsqlite3ExprCollSeqMatch(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 ui // 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 Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) int8 { /* sqlite3.c:99965:21: */ +func Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) int8 { /* sqlite3.c:100887:21: */ var aff1 int8 = Xsqlite3ExprAffinity(tls, pExpr) if (int32(aff1) > SQLITE_AFF_NONE) && (int32(aff2) > SQLITE_AFF_NONE) { // Both sides of the comparison are columns. If one has numeric // affinity, use that. Otherwise use no affinity. if ((int32(aff1)) >= SQLITE_AFF_NUMERIC) || ((int32(aff2)) >= SQLITE_AFF_NUMERIC) { - return SQLITE_AFF_NUMERIC + return int8(SQLITE_AFF_NUMERIC) } else { - return SQLITE_AFF_BLOB + return int8(SQLITE_AFF_BLOB) } } else { // One side is a column, the other is not. Use the columns affinity. @@ -79470,16 +80170,16 @@ func Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) int8 { /* // pExpr is a comparison operator. Return the type affinity that should // be applied to both operands prior to doing the comparison. -func comparisonAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:99987:13: */ +func comparisonAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:100909:13: */ var aff int8 aff = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) if (*Expr)(unsafe.Pointer(pExpr)).FpRight != 0 { aff = Xsqlite3CompareAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight, aff) - } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { aff = Xsqlite3CompareAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList + 8 /* &.a */))).FpExpr, aff) } else if int32(aff) == 0 { - aff = SQLITE_AFF_BLOB + aff = int8(SQLITE_AFF_BLOB) } return aff } @@ -79488,7 +80188,7 @@ func comparisonAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:99987: // 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 Xsqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity int8) int32 { /* sqlite3.c:100010:20: */ +func Xsqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity int8) int32 { /* sqlite3.c:100932:20: */ var aff int8 = comparisonAffinity(tls, pExpr) if int32(aff) < SQLITE_AFF_TEXT { return 1 @@ -79501,7 +80201,7 @@ func Xsqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity int8) in // 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 *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull int32) U8 { /* sqlite3.c:100025:11: */ +func binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull int32) U8 { /* sqlite3.c:100947:11: */ var aff U8 = U8(Xsqlite3ExprAffinity(tls, pExpr2)) aff = (U8(int32(U8(Xsqlite3CompareAffinity(tls, pExpr1, int8(aff)))) | int32(U8(jumpIfNull)))) return aff @@ -79517,12 +80217,12 @@ func binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull i // // Argument pRight (but not pLeft) may be a null pointer. In this case, // it is not considered. -func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100047:24: */ +func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100969:24: */ var pColl uintptr - if ((*Expr)(unsafe.Pointer(pLeft)).Fflags & EP_Collate) != 0 { + if ((*Expr)(unsafe.Pointer(pLeft)).Fflags & U32(EP_Collate)) != 0 { pColl = Xsqlite3ExprCollSeq(tls, pParse, pLeft) - } else if (pRight != 0) && (((*Expr)(unsafe.Pointer(pRight)).Fflags & EP_Collate) != U32(0)) { + } else if (pRight != 0) && (((*Expr)(unsafe.Pointer(pRight)).Fflags & U32(EP_Collate)) != U32(0)) { pColl = Xsqlite3ExprCollSeq(tls, pParse, pRight) } else { pColl = Xsqlite3ExprCollSeq(tls, pParse, pLeft) @@ -79540,8 +80240,8 @@ func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, // However, if the OP_Commuted flag is set, then the order of the operands // is reversed in the sqlite3BinaryCompareCollSeq() call so that the // correct collating sequence is found. -func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:100075:24: */ - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Commuted)) != U32(0) { +func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:100997:24: */ + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Commuted))) != U32(0) { return Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpRight, (*Expr)(unsafe.Pointer(p)).FpLeft) } else { return Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpLeft, (*Expr)(unsafe.Pointer(p)).FpRight) @@ -79550,7 +80250,7 @@ func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintpt } // Generate code for a comparison operator. -func codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, opcode int32, in1 int32, in2 int32, dest int32, jumpIfNull int32, isCommuted int32) int32 { /* sqlite3.c:100086:12: */ +func codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, opcode int32, in1 int32, in2 int32, dest int32, jumpIfNull int32, isCommuted int32) int32 { /* sqlite3.c:101008:12: */ var p5 int32 var addr int32 var p4 uintptr @@ -79577,7 +80277,7 @@ func codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, o // 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 Xsqlite3ExprIsVector(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:100122:20: */ +func Xsqlite3ExprIsVector(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101044:20: */ return (libc.Bool32(Xsqlite3ExprVectorSize(tls, pExpr) > 1)) } @@ -79585,7 +80285,7 @@ func Xsqlite3ExprIsVector(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:100 // 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 Xsqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:100132:20: */ +func Xsqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101054:20: */ var op U8 = (*Expr)(unsafe.Pointer(pExpr)).Fop if int32(op) == TK_REGISTER { op = (*Expr)(unsafe.Pointer(pExpr)).Fop2 @@ -79613,7 +80313,7 @@ func Xsqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:1 // 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 Xsqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) uintptr { /* sqlite3.c:100159:21: */ +func Xsqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) uintptr { /* sqlite3.c:101081:21: */ if Xsqlite3ExprIsVector(tls, pVector) != 0 { @@ -79645,7 +80345,7 @@ func Xsqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) uintptr // 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 Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32) uintptr { /* sqlite3.c:100193:21: */ +func Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32) uintptr { /* sqlite3.c:101115:21: */ var pRet uintptr if int32((*Expr)(unsafe.Pointer(pVector)).Fop) == TK_SELECT { @@ -79686,7 +80386,7 @@ func Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, // of registers in which the result is stored). // // If pExpr is not a TK_SELECT expression, return 0. -func exprCodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:100239:12: */ +func exprCodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:101161:12: */ var reg int32 = 0 if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT { reg = Xsqlite3CodeSubselect(tls, pParse, pExpr) @@ -79710,7 +80410,7 @@ func exprCodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* // // Before returning, output parameter (*ppExpr) is set to point to the // Expr object corresponding to element iElem of the vector. -func exprVectorRegister(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32, regSelect int32, ppExpr uintptr, pRegFree uintptr) int32 { /* sqlite3.c:100267:12: */ +func exprVectorRegister(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32, regSelect int32, ppExpr uintptr, pRegFree uintptr) int32 { /* sqlite3.c:101189:12: */ var op U8 = (*Expr)(unsafe.Pointer(pVector)).Fop if int32(op) == TK_REGISTER { @@ -79734,7 +80434,7 @@ func exprVectorRegister(tls *libc.TLS, pParse uintptr, pVector uintptr, iField i // 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 *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, op U8, p5 U8) { /* sqlite3.c:100300:13: */ +func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, op U8, p5 U8) { /* sqlite3.c:101222:13: */ bp := tls.Alloc(28) defer tls.Free(28) @@ -79747,22 +80447,22 @@ func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, var regRight int32 = 0 var opx U8 = op var addrDone int32 = Xsqlite3VdbeMakeLabel(tls, pParse) - var isCommuted int32 = (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0))) + var isCommuted int32 = (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0))) if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return } if nLeft != Xsqlite3ExprVectorSize(tls, pRight) { - Xsqlite3ErrorMsg(tls, pParse, ts+8423 /* "row value misuse..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+8516 /* "row value misuse..." */, 0) return } p5 = U8(int32(p5) | (SQLITE_STOREP2)) if int32(opx) == TK_LE { - opx = TK_LT + opx = U8(TK_LT) } if int32(opx) == TK_GE { - opx = TK_GT + opx = U8(TK_GT) } regLeft = exprCodeSubselect(tls, pParse, pLeft) @@ -79808,15 +80508,15 @@ func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, // Check that argument nHeight is less than or equal to the maximum // expression depth allowed. If it is not, leave an error message in // pParse. -func Xsqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) int32 { /* sqlite3.c:100385:20: */ +func Xsqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) int32 { /* sqlite3.c:101307:20: */ bp := tls.Alloc(8) defer tls.Free(8) var rc int32 = SQLITE_OK - var mxHeight int32 = *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + 3*4)) + var mxHeight int32 = *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 128 /* &.aLimit */) + 3*4)) if nHeight > mxHeight { Xsqlite3ErrorMsg(tls, pParse, - ts+9322 /* "Expression tree ..." */, libc.VaList(bp, mxHeight)) + ts+9426 /* "Expression tree ..." */, libc.VaList(bp, mxHeight)) rc = SQLITE_ERROR } return rc @@ -79830,7 +80530,7 @@ func Xsqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) int32 // 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 *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:100406:13: */ +func heightOfExpr(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:101328:13: */ if p != 0 { if (*Expr)(unsafe.Pointer(p)).FnHeight > *(*int32)(unsafe.Pointer(pnHeight)) { *(*int32)(unsafe.Pointer(pnHeight)) = (*Expr)(unsafe.Pointer(p)).FnHeight @@ -79838,7 +80538,7 @@ func heightOfExpr(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:100 } } -func heightOfExprList(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:100413:13: */ +func heightOfExprList(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:101335:13: */ if p != 0 { var i int32 for i = 0; i < (*ExprList)(unsafe.Pointer(p)).FnExpr; i++ { @@ -79847,7 +80547,7 @@ func heightOfExprList(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c } } -func heightOfSelect(tls *libc.TLS, pSelect uintptr, pnHeight uintptr) { /* sqlite3.c:100421:13: */ +func heightOfSelect(tls *libc.TLS, pSelect uintptr, pnHeight uintptr) { /* sqlite3.c:101343:13: */ var p uintptr for p = pSelect; p != 0; p = (*Select)(unsafe.Pointer(p)).FpPrior { heightOfExpr(tls, (*Select)(unsafe.Pointer(p)).FpWhere, pnHeight) @@ -79867,14 +80567,14 @@ func heightOfSelect(tls *libc.TLS, pSelect uintptr, pnHeight uintptr) { /* sqlit // // Also propagate EP_Propagate flags up from Expr.x.pList to Expr.flags, // if appropriate. -func exprSetHeight(tls *libc.TLS, p uintptr) { /* sqlite3.c:100443:13: */ +func exprSetHeight(tls *libc.TLS, p uintptr) { /* sqlite3.c:101365:13: */ bp := tls.Alloc(4) defer tls.Free(4) *(*int32)(unsafe.Pointer(bp /* nHeight */)) = 0 heightOfExpr(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, bp /* &nHeight */) heightOfExpr(tls, (*Expr)(unsafe.Pointer(p)).FpRight, bp /* &nHeight */) - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { heightOfSelect(tls, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), bp /* &nHeight */) } else if *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0 { heightOfExprList(tls, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), bp /* &nHeight */) @@ -79889,7 +80589,7 @@ func exprSetHeight(tls *libc.TLS, p uintptr) { /* sqlite3.c:100443:13: */ // // Also propagate all EP_Propagate flags from the Expr.x.pList into // Expr.flags. -func Xsqlite3ExprSetHeightAndFlags(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:100464:21: */ +func Xsqlite3ExprSetHeightAndFlags(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:101386:21: */ if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return } @@ -79899,7 +80599,7 @@ func Xsqlite3ExprSetHeightAndFlags(tls *libc.TLS, pParse uintptr, p uintptr) { / // Return the maximum height of any expression tree referenced // by the select statement passed as an argument. -func Xsqlite3SelectExprHeight(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:100474:20: */ +func Xsqlite3SelectExprHeight(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101396:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -79926,7 +80626,7 @@ func Xsqlite3SelectExprHeight(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:100 // 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 Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequote int32) uintptr { /* sqlite3.c:100512:21: */ +func Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequote int32) uintptr { /* sqlite3.c:101435:21: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -79974,7 +80674,7 @@ func Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ // Allocate a new expression node from a zero-terminated token that has // already been dequoted. -func Xsqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) uintptr { /* sqlite3.c:100560:21: */ +func Xsqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) uintptr { /* sqlite3.c:101483:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -79989,7 +80689,7 @@ func Xsqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) uintptr { // // If pRoot==NULL that means that a memory allocation error has occurred. // In that case, delete the subtrees pLeft and pRight. -func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft uintptr, pRight uintptr) { /* sqlite3.c:100577:21: */ +func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft uintptr, pRight uintptr) { /* sqlite3.c:101500:21: */ if pRoot == uintptr(0) { Xsqlite3ExprDelete(tls, db, pLeft) @@ -80012,7 +80712,7 @@ func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft // 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 Xsqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100607:21: */ +func Xsqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:101530:21: */ var p uintptr p = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Expr{}))) if p != 0 { @@ -80030,7 +80730,7 @@ func Xsqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRigh // 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 Xsqlite3PExprAddSelect(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSelect uintptr) { /* sqlite3.c:100632:21: */ +func Xsqlite3PExprAddSelect(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSelect uintptr) { /* sqlite3.c:101555:21: */ if pExpr != 0 { *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) = pSelect *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_xIsSelect | EP_Subquery)) @@ -80047,17 +80747,17 @@ func Xsqlite3PExprAddSelect(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSelec // 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 Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100652:21: */ +func Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:101575:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if pLeft == uintptr(0) { return pRight } else if pRight == uintptr(0) { return pLeft - } else if ((((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse)) && + } else if ((((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse))) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { Xsqlite3ExprDelete(tls, db, pLeft) Xsqlite3ExprDelete(tls, db, pRight) - return Xsqlite3Expr(tls, db, TK_INTEGER, ts+9370 /* "0" */) + return Xsqlite3Expr(tls, db, TK_INTEGER, ts+9474 /* "0" */) } else { return Xsqlite3PExpr(tls, pParse, TK_AND, pLeft, pRight) } @@ -80066,7 +80766,7 @@ func Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt // Construct a new expression node for a function with multiple // arguments. -func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr, eDistinct int32) uintptr { /* sqlite3.c:100673:21: */ +func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr, eDistinct int32) uintptr { /* sqlite3.c:101596:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -80078,15 +80778,15 @@ func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u Xsqlite3ExprListDelete(tls, db, pList) // Avoid memory leak when malloc fails return uintptr(0) } - if (pList != 0) && ((*ExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + 6*4))) { - Xsqlite3ErrorMsg(tls, pParse, ts+9372 /* "too many argumen..." */, libc.VaList(bp, pToken)) + if (pList != 0) && ((*ExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 128 /* &.aLimit */) + 6*4))) { + Xsqlite3ErrorMsg(tls, pParse, ts+9476 /* "too many argumen..." */, libc.VaList(bp, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32 /* &.x */)) = pList - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_HasFunc) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_HasFunc)) Xsqlite3ExprSetHeightAndFlags(tls, pParse, pNew) if eDistinct == SF_Distinct { - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_Distinct) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_Distinct)) } return pNew } @@ -80100,20 +80800,20 @@ func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u // top-level SQL // // If the function is not usable, create an error. -func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pDef uintptr) { /* sqlite3.c:100709:21: */ +func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pDef uintptr) { /* sqlite3.c:101632:21: */ bp := tls.Alloc(8) defer tls.Free(8) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromDDL)) != U32(0) { - if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_DIRECT) != U32(0)) || - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_TrustedSchema) == uint64(0)) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromDDL))) != U32(0) { + if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_DIRECT)) != U32(0)) || + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_TrustedSchema)) == uint64(0)) { // Functions prohibited in triggers and views if: // (1) tagged with SQLITE_DIRECTONLY // (2) not tagged with SQLITE_INNOCUOUS (which means it // is tagged with SQLITE_FUNC_UNSAFE) and // SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning // that the schema is possibly tainted). - Xsqlite3ErrorMsg(tls, pParse, ts+9406 /* "unsafe use of %s..." */, libc.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+9510 /* "unsafe use of %s..." */, libc.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName)) } } } @@ -80132,7 +80832,7 @@ func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD // 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 Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n U32) { /* sqlite3.c:100748:21: */ +func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n U32) { /* sqlite3.c:101671:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -80162,12 +80862,12 @@ func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n *(*I64)(unsafe.Pointer(bp + 8 /* i */)) = (I64(int32(*(*int8)(unsafe.Pointer(z + 1))) - '0')) // The common case of ?N for a single digit N bOk = 1 } else { - bOk = (libc.Bool32(0 == Xsqlite3Atoi64(tls, (z+1), bp+8 /* &i */, (int32(n-U32(1))), SQLITE_UTF8))) + bOk = (libc.Bool32(0 == Xsqlite3Atoi64(tls, (z+1), bp+8 /* &i */, (int32(n-U32(1))), uint8(SQLITE_UTF8)))) } - if ((bOk == 0) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) < int64(1))) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 9*4)))) { - Xsqlite3ErrorMsg(tls, pParse, ts+9425, /* "variable number ..." */ - libc.VaList(bp, *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 9*4)))) + if ((bOk == 0) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) < int64(1))) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) > I64(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 9*4)))) { + Xsqlite3ErrorMsg(tls, pParse, ts+9529, /* "variable number ..." */ + libc.VaList(bp, *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 9*4)))) return } x = YnVar(*(*I64)(unsafe.Pointer(bp + 8 /* i */))) @@ -80192,13 +80892,13 @@ func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } } (*Expr)(unsafe.Pointer(pExpr)).FiColumn = x - if int32(x) > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 9*4)) { - Xsqlite3ErrorMsg(tls, pParse, ts+9468 /* "too many SQL var..." */, 0) + if int32(x) > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 9*4)) { + Xsqlite3ErrorMsg(tls, pParse, ts+9572 /* "too many SQL var..." */, 0) } } // Recursively delete an expression tree. -func sqlite3ExprDeleteNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:100816:29: */ +func sqlite3ExprDeleteNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:101739:29: */ // Sanity check: Assert that the IntValue is non-negative if it exists @@ -80211,25 +80911,25 @@ func sqlite3ExprDeleteNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:10 if (*Expr)(unsafe.Pointer(p)).FpRight != 0 { sqlite3ExprDeleteNN(tls, db, (*Expr)(unsafe.Pointer(p)).FpRight) - } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { Xsqlite3SelectDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */))) } else { Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */))) - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0) { Xsqlite3WindowDelete(tls, db, *(*uintptr)(unsafe.Pointer(p + 64 /* &.y */))) } } } - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_MemToken)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_MemToken))) != U32(0) { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) } - if !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Static)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Static))) != U32(0)) { Xsqlite3DbFreeNN(tls, db, p) } } -func Xsqlite3ExprDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:100855:21: */ +func Xsqlite3ExprDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:101778:21: */ if p != 0 { sqlite3ExprDeleteNN(tls, db, p) } @@ -80237,7 +80937,7 @@ func Xsqlite3ExprDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:100 // Invoke sqlite3RenameExprUnmap() and sqlite3ExprDelete() on the // expression. -func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:100862:21: */ +func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:101785:21: */ if p != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { Xsqlite3RenameExprUnmap(tls, pParse, p) @@ -80249,11 +80949,11 @@ func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { /* s // 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 *libc.TLS, p uintptr) int32 { /* sqlite3.c:100876:12: */ - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_TokenOnly)) != U32(0) { +func exprStructSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101799:12: */ + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_TokenOnly))) != U32(0) { return int32((uintptr(0) + 16 /* &.pLeft */)) } - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Reduced)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Reduced))) != U32(0) { return int32((uintptr(0) + 44 /* &.iTable */)) } return int32(unsafe.Sizeof(Expr{})) @@ -80291,20 +80991,20 @@ func exprStructSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:100876:12: */ // 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 *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100916:12: */ +func dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:101839:12: */ var nSize int32 // Only one flag value allowed if ((0 == flags) || (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_SELECT_COLUMN)) || - (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_WinFunc)) != U32(0)) { + (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0)) { nSize = int32(unsafe.Sizeof(Expr{})) } else { if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) || (*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0) { - nSize = (int32((uint64((uintptr(0) + 44 /* &.iTable */))) | EP_Reduced)) + nSize = (int32((uint64((uintptr(0) + 44 /* &.iTable */))) | uint64(EP_Reduced))) } else { - nSize = (int32((uint64((uintptr(0) + 16 /* &.pLeft */))) | EP_TokenOnly)) + nSize = (int32((uint64((uintptr(0) + 16 /* &.pLeft */))) | uint64(EP_TokenOnly))) } } return nSize @@ -80313,9 +81013,9 @@ func dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlit // 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 *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100947:12: */ +func dupedExprNodeSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:101870:12: */ var nByte int32 = (dupedExprStructSize(tls, p, flags) & 0xfff) - if !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_IntValue)) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { + if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { nByte = int32(Size_t(nByte) + ((libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) & uint64(0x3fffffff)) + uint64(1))) } return (((nByte) + 7) & libc.CplInt32(7)) @@ -80332,7 +81032,7 @@ func dupedExprNodeSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3 // 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 *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100968:12: */ +func dupedExprSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:101891:12: */ var nByte int32 = 0 if p != 0 { nByte = dupedExprNodeSize(tls, p, flags) @@ -80349,7 +81049,7 @@ func dupedExprSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:1 // (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 *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uintptr) uintptr { /* sqlite3.c:100987:13: */ +func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uintptr) uintptr { /* sqlite3.c:101910:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -80361,7 +81061,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint // Figure out where to write the new Expr structure. if pzBuffer != 0 { *(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) = *(*uintptr)(unsafe.Pointer(pzBuffer)) - staticFlag = EP_Static + staticFlag = U32(EP_Static) } else { *(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) = Xsqlite3DbMallocRawNN(tls, db, uint64(dupedExprSize(tls, p, dupFlags))) staticFlag = U32(0) @@ -80376,7 +81076,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint var nStructSize uint32 = uint32(dupedExprStructSize(tls, p, dupFlags)) var nNewSize int32 = (int32(nStructSize & uint32(0xfff))) var nToken int32 - if !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_IntValue)) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { + if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_IntValue))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) { nToken = (Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) + 1) } else { nToken = 0 @@ -80409,7 +81109,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint if U32(0) == (((*Expr)(unsafe.Pointer(p)).Fflags | (*Expr)(unsafe.Pointer(pNew)).Fflags) & (U32(EP_TokenOnly | EP_Leaf))) { // Fill in the pNew->x.pSelect or pNew->x.pList member. - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { *(*uintptr)(unsafe.Pointer(pNew + 32 /* &.x */)) = Xsqlite3SelectDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), dupFlags) } else { *(*uintptr)(unsafe.Pointer(pNew + 32 /* &.x */)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), dupFlags) @@ -80433,7 +81133,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint return uintptr(0) }() } - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_WinFunc))) != U32(0) { *(*uintptr)(unsafe.Pointer(pNew + 64 /* &.y */)) = Xsqlite3WindowDup(tls, db, pNew, *(*uintptr)(unsafe.Pointer(p + 64 /* &.y */))) } @@ -80458,7 +81158,7 @@ func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uint // Create and return a deep copy of the object passed as the second // argument. If an OOM condition is encountered, NULL is returned // and the db->mallocFailed flag set. -func withDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:101096:13: */ +func withDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:102019:13: */ var pRet uintptr = uintptr(0) if p != 0 { var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(With{})) + (uint64(unsafe.Sizeof(Cte{})) * (uint64((*With)(unsafe.Pointer(p)).FnCte - 1))))) @@ -80467,9 +81167,9 @@ func withDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:101096 var i int32 (*With)(unsafe.Pointer(pRet)).FnCte = (*With)(unsafe.Pointer(p)).FnCte for i = 0; i < (*With)(unsafe.Pointer(p)).FnCte; i++ { - (*Cte)(unsafe.Pointer((pRet + 16 /* &.a */) + uintptr(i)*32)).FpSelect = Xsqlite3SelectDup(tls, db, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*32)).FpSelect, 0) - (*Cte)(unsafe.Pointer((pRet + 16 /* &.a */) + uintptr(i)*32)).FpCols = Xsqlite3ExprListDup(tls, db, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*32)).FpCols, 0) - (*Cte)(unsafe.Pointer((pRet + 16 /* &.a */) + uintptr(i)*32)).FzName = Xsqlite3DbStrDup(tls, db, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*32)).FzName) + (*Cte)(unsafe.Pointer((pRet + 16 /* &.a */) + uintptr(i)*48)).FpSelect = Xsqlite3SelectDup(tls, db, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*48)).FpSelect, 0) + (*Cte)(unsafe.Pointer((pRet + 16 /* &.a */) + uintptr(i)*48)).FpCols = Xsqlite3ExprListDup(tls, db, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*48)).FpCols, 0) + (*Cte)(unsafe.Pointer((pRet + 16 /* &.a */) + uintptr(i)*48)).FzName = Xsqlite3DbStrDup(tls, db, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*48)).FzName) } } } @@ -80480,8 +81180,8 @@ func withDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:101096 // gatherSelectWindowsCallback() are used to scan all the expressions // an a newly duplicated SELECT statement and gather all of the Window // objects found there, assembling them onto the linked list at Select->pWin. -func gatherSelectWindowsCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101124:12: */ - if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { +func gatherSelectWindowsCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:102047:12: */ + if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) @@ -80490,14 +81190,14 @@ func gatherSelectWindowsCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) return WRC_Continue } -func gatherSelectWindowsSelectCallback(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:101135:12: */ +func gatherSelectWindowsSelectCallback(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:102058:12: */ if p == *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) { return WRC_Continue } return WRC_Prune } -func gatherSelectWindows(tls *libc.TLS, p uintptr) { /* sqlite3.c:101138:13: */ +func gatherSelectWindows(tls *libc.TLS, p uintptr) { /* sqlite3.c:102061:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -80530,7 +81230,7 @@ func gatherSelectWindows(tls *libc.TLS, p uintptr) { /* sqlite3.c:101138:13: */ // 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 Xsqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:101167:21: */ +func Xsqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:102090:21: */ if p != 0 { return exprDup(tls, db, p, flags, uintptr(0)) @@ -80538,7 +81238,7 @@ func Xsqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr return uintptr(0) } -func Xsqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:101171:25: */ +func Xsqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:102094:25: */ var pNew uintptr var pItem uintptr var pOldItem uintptr @@ -80601,7 +81301,7 @@ __3: // the build, then none of the following routines, except for // sqlite3SelectDup(), can be called. sqlite3SelectDup() is sometimes // called with a NULL argument. -func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:101222:24: */ +func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:102145:24: */ var pNew uintptr var i int32 var nByte int32 @@ -80611,7 +81311,7 @@ func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintp } nByte = (int32(uint64(unsafe.Sizeof(SrcList{})) + (func() uint64 { if (*SrcList)(unsafe.Pointer(p)).FnSrc > 0 { - return (uint64(unsafe.Sizeof(SrcList_item{})) * (uint64((*SrcList)(unsafe.Pointer(p)).FnSrc - 1))) + return (uint64(unsafe.Sizeof(SrcItem{})) * (uint64((*SrcList)(unsafe.Pointer(p)).FnSrc - 1))) } return uint64(0) }()))) @@ -80624,34 +81324,37 @@ func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintp var pNewItem uintptr = ((pNew + 8 /* &.a */) + uintptr(i)*112) var pOldItem uintptr = ((p + 8 /* &.a */) + uintptr(i)*112) var pTab uintptr - (*SrcList_item)(unsafe.Pointer(pNewItem)).FpSchema = (*SrcList_item)(unsafe.Pointer(pOldItem)).FpSchema - (*SrcList_item)(unsafe.Pointer(pNewItem)).FzDatabase = Xsqlite3DbStrDup(tls, db, (*SrcList_item)(unsafe.Pointer(pOldItem)).FzDatabase) - (*SrcList_item)(unsafe.Pointer(pNewItem)).FzName = Xsqlite3DbStrDup(tls, db, (*SrcList_item)(unsafe.Pointer(pOldItem)).FzName) - (*SrcList_item)(unsafe.Pointer(pNewItem)).FzAlias = Xsqlite3DbStrDup(tls, db, (*SrcList_item)(unsafe.Pointer(pOldItem)).FzAlias) - (*SrcList_item)(unsafe.Pointer(pNewItem)).Ffg = (*SrcList_item)(unsafe.Pointer(pOldItem)).Ffg - (*SrcList_item)(unsafe.Pointer(pNewItem)).FiCursor = (*SrcList_item)(unsafe.Pointer(pOldItem)).FiCursor - (*SrcList_item)(unsafe.Pointer(pNewItem)).FaddrFillSub = (*SrcList_item)(unsafe.Pointer(pOldItem)).FaddrFillSub - (*SrcList_item)(unsafe.Pointer(pNewItem)).FregReturn = (*SrcList_item)(unsafe.Pointer(pOldItem)).FregReturn + (*SrcItem)(unsafe.Pointer(pNewItem)).FpSchema = (*SrcItem)(unsafe.Pointer(pOldItem)).FpSchema + (*SrcItem)(unsafe.Pointer(pNewItem)).FzDatabase = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FzDatabase) + (*SrcItem)(unsafe.Pointer(pNewItem)).FzName = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FzName) + (*SrcItem)(unsafe.Pointer(pNewItem)).FzAlias = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FzAlias) + (*SrcItem)(unsafe.Pointer(pNewItem)).Ffg = (*SrcItem)(unsafe.Pointer(pOldItem)).Ffg + (*SrcItem)(unsafe.Pointer(pNewItem)).FiCursor = (*SrcItem)(unsafe.Pointer(pOldItem)).FiCursor + (*SrcItem)(unsafe.Pointer(pNewItem)).FaddrFillSub = (*SrcItem)(unsafe.Pointer(pOldItem)).FaddrFillSub + (*SrcItem)(unsafe.Pointer(pNewItem)).FregReturn = (*SrcItem)(unsafe.Pointer(pOldItem)).FregReturn if (uint32(int32(*(*uint8)(unsafe.Pointer(pNewItem + 60 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 { *(*uintptr)(unsafe.Pointer(pNewItem + 96 /* &.u1 */)) = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 96 /* &.u1 */))) } - (*SrcList_item)(unsafe.Pointer(pNewItem)).FpIBIndex = (*SrcList_item)(unsafe.Pointer(pOldItem)).FpIBIndex + (*SrcItem)(unsafe.Pointer(pNewItem)).Fu2 = (*SrcItem)(unsafe.Pointer(pOldItem)).Fu2 + if (uint32(int32(*(*uint8)(unsafe.Pointer(pNewItem + 60 /* &.fg */ + 4 /* &.isCte */)) & 0x80 >> 7))) != 0 { + (*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 104 /* &.u2 */)))).FnUse++ + } if (uint32(int32(*(*uint8)(unsafe.Pointer(pNewItem + 60 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 { *(*uintptr)(unsafe.Pointer(pNewItem + 96 /* &.u1 */)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 96 /* &.u1 */)), flags) } - pTab = libc.AssignPtrUintptr(pNewItem+32 /* &.pTab */, (*SrcList_item)(unsafe.Pointer(pOldItem)).FpTab) + pTab = libc.AssignPtrUintptr(pNewItem+32 /* &.pTab */, (*SrcItem)(unsafe.Pointer(pOldItem)).FpTab) if pTab != 0 { (*Table)(unsafe.Pointer(pTab)).FnTabRef++ } - (*SrcList_item)(unsafe.Pointer(pNewItem)).FpSelect = Xsqlite3SelectDup(tls, db, (*SrcList_item)(unsafe.Pointer(pOldItem)).FpSelect, flags) - (*SrcList_item)(unsafe.Pointer(pNewItem)).FpOn = Xsqlite3ExprDup(tls, db, (*SrcList_item)(unsafe.Pointer(pOldItem)).FpOn, flags) - (*SrcList_item)(unsafe.Pointer(pNewItem)).FpUsing = Xsqlite3IdListDup(tls, db, (*SrcList_item)(unsafe.Pointer(pOldItem)).FpUsing) - (*SrcList_item)(unsafe.Pointer(pNewItem)).FcolUsed = (*SrcList_item)(unsafe.Pointer(pOldItem)).FcolUsed + (*SrcItem)(unsafe.Pointer(pNewItem)).FpSelect = Xsqlite3SelectDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FpSelect, flags) + (*SrcItem)(unsafe.Pointer(pNewItem)).FpOn = Xsqlite3ExprDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FpOn, flags) + (*SrcItem)(unsafe.Pointer(pNewItem)).FpUsing = Xsqlite3IdListDup(tls, db, (*SrcItem)(unsafe.Pointer(pOldItem)).FpUsing) + (*SrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*SrcItem)(unsafe.Pointer(pOldItem)).FcolUsed } return pNew } -func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:101263:23: */ +func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:102189:23: */ var pNew uintptr var i int32 @@ -80680,7 +81383,7 @@ func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite return pNew } -func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uintptr { /* sqlite3.c:101287:23: */ +func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uintptr { /* sqlite3.c:102213:23: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -80738,7 +81441,7 @@ func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uin // 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 Xsqlite3ExprListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pExpr uintptr) uintptr { /* sqlite3.c:101350:25: */ +func Xsqlite3ExprListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pExpr uintptr) uintptr { /* sqlite3.c:102276:25: */ var pItem uintptr var db uintptr var pNew uintptr @@ -80795,7 +81498,7 @@ no_mem: // 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 Xsqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, pColumns uintptr, pExpr uintptr) uintptr { /* sqlite3.c:101398:25: */ +func Xsqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, pColumns uintptr, pExpr uintptr) uintptr { /* sqlite3.c:102324:25: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -80833,7 +81536,7 @@ __2: if !((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_SELECT) && ((*IdList)(unsafe.Pointer(pColumns)).FnId != (libc.AssignInt32(&n, Xsqlite3ExprVectorSize(tls, pExpr))))) { goto __3 } - Xsqlite3ErrorMsg(tls, pParse, ts+9491, /* "%d columns assig..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+9595, /* "%d columns assig..." */ libc.VaList(bp, (*IdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error __3: @@ -80893,7 +81596,7 @@ vector_append_error: } // Set the sort order for the last element on the given ExprList. -func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eNulls int32) { /* sqlite3.c:101462:21: */ +func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eNulls int32) { /* sqlite3.c:102388:21: */ var pItem uintptr if p == uintptr(0) { return @@ -80920,7 +81623,7 @@ func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eN // 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 Xsqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName uintptr, dequote int32) { /* sqlite3.c:101500:21: */ +func Xsqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName uintptr, dequote int32) { /* sqlite3.c:102426:21: */ if pList != 0 { var pItem uintptr @@ -80946,7 +81649,7 @@ func Xsqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName // 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 Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:101535:21: */ +func Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:102461:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if pList != 0 { @@ -80954,26 +81657,26 @@ func Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStar if (*ExprList_item)(unsafe.Pointer(pItem)).FzEName == uintptr(0) { (*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbSpanDup(tls, db, zStart, zEnd) - libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, ENAME_SPAN, 0, 0x3) + libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, uint32(ENAME_SPAN), 0, 0x3) } } } // If the expression list pEList contains more than iLimit elements, // leave an error message in pParse. -func Xsqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, zObject uintptr) { /* sqlite3.c:101557:21: */ +func Xsqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, zObject uintptr) { /* sqlite3.c:102483:21: */ bp := tls.Alloc(8) defer tls.Free(8) - var mx int32 = *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + 2*4)) + var mx int32 = *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 128 /* &.aLimit */) + 2*4)) if (pEList != 0) && ((*ExprList)(unsafe.Pointer(pEList)).FnExpr > mx) { - Xsqlite3ErrorMsg(tls, pParse, ts+9521 /* "too many columns..." */, libc.VaList(bp, zObject)) + Xsqlite3ErrorMsg(tls, pParse, ts+9625 /* "too many columns..." */, libc.VaList(bp, zObject)) } } // Delete an entire expression list. -func exprListDeleteNN(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:101573:29: */ +func exprListDeleteNN(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:102499:29: */ var i int32 = (*ExprList)(unsafe.Pointer(pList)).FnExpr var pItem uintptr = pList + 8 /* &.a */ @@ -80985,7 +81688,7 @@ func exprListDeleteNN(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:1 Xsqlite3DbFreeNN(tls, db, pList) } -func Xsqlite3ExprListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:101584:21: */ +func Xsqlite3ExprListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:102510:21: */ if pList != 0 { exprListDeleteNN(tls, db, pList) } @@ -80993,7 +81696,7 @@ func Xsqlite3ExprListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlit // Return the bitwise-OR of all Expr.flags fields in the given // ExprList. -func Xsqlite3ExprListFlags(tls *libc.TLS, pList uintptr) U32 { /* sqlite3.c:101592:20: */ +func Xsqlite3ExprListFlags(tls *libc.TLS, pList uintptr) U32 { /* sqlite3.c:102518:20: */ var i int32 var m U32 = U32(0) @@ -81010,7 +81713,7 @@ func Xsqlite3ExprListFlags(tls *libc.TLS, pList uintptr) U32 { /* sqlite3.c:1015 // pWalker->eCode to zero and abort. // // This callback is used by multiple expression walkers. -func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int32 { /* sqlite3.c:101611:20: */ +func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int32 { /* sqlite3.c:102537:20: */ _ = NotUsed (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort @@ -81022,12 +81725,12 @@ func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int // "true" EP_IsTrue // "false" EP_IsFalse // anything else 0 -func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:101625:20: */ - if Xsqlite3StrICmp(tls, zIn, ts+9544 /* "true" */) == 0 { - return EP_IsTrue +func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:102551:20: */ + if Xsqlite3StrICmp(tls, zIn, ts+8738 /* "true" */) == 0 { + return U32(EP_IsTrue) } - if Xsqlite3StrICmp(tls, zIn, ts+9549 /* "false" */) == 0 { - return EP_IsFalse + if Xsqlite3StrICmp(tls, zIn, ts+8743 /* "false" */) == 0 { + return U32(EP_IsFalse) } return U32(0) } @@ -81035,12 +81738,12 @@ func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:101625 // If the input expression is an ID with the name "true" or "false" // then convert it into an TK_TRUEFALSE term. Return non-zero if // the conversion happened, and zero if the expression is unaltered. -func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101637:20: */ +func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:102563:20: */ var v U32 - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Quoted)) != U32(0)) && + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Quoted))) != U32(0)) && ((libc.AssignUint32(&v, Xsqlite3IsTrueOrFalse(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))) != U32(0)) { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_TRUEFALSE + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUEFALSE) *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (v) return 1 } @@ -81049,7 +81752,7 @@ func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3. // The argument must be a TK_TRUEFALSE Expr node. Return 1 if it is TRUE // and 0 if it is FALSE. -func Xsqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101654:20: */ +func Xsqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:102580:20: */ pExpr = Xsqlite3ExprSkipCollate(tls, pExpr) return (libc.Bool32(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + 4))) == 0)) @@ -81066,18 +81769,18 @@ func Xsqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:1 // (x<10) AND (y=22 OR false) => (x<10) AND (y=22) // (x<10) AND (y=22 OR true) => (x<10) // (y=22) OR true => true -func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:101675:21: */ +func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:102601:21: */ if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_OR) { var pRight uintptr = Xsqlite3ExprSimplifiedAndOr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) var pLeft uintptr = Xsqlite3ExprSimplifiedAndOr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) - if (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + if (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) || (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND { pExpr = pRight } else { pExpr = pLeft } - } else if (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) || (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + } else if (((*Expr)(unsafe.Pointer((pRight))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) || (((*Expr)(unsafe.Pointer((pLeft))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND { pExpr = pLeft } else { @@ -81112,12 +81815,12 @@ func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr { /* sqli // 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 *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101716:12: */ +func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:102642:12: */ // If pWalker->eCode is 2 then any term of the expression that comes from // the ON or USING clauses of a left join disqualifies the expression // from being considered constant. - if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort } @@ -81127,10 +81830,10 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / // and either pWalker->eCode==4 or 5 or the function has the // SQLITE_FUNC_CONST flag. case TK_FUNCTION: - if ((int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) >= 4) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_ConstFunc)) != U32(0))) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if ((int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) >= 4) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_ConstFunc))) != U32(0))) && + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 5 { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FromDDL) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL)) } return WRC_Continue } else { @@ -81151,7 +81854,7 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / fallthrough case TK_AGG_COLUMN: - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FixedCol)) != U32(0)) && (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) != 2) { + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) && (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) != 2) { return WRC_Continue } if (int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 3) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == *(*int32)(unsafe.Pointer(pWalker + 40 /* &.u */))) { @@ -81171,7 +81874,7 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / // Silently convert bound parameters that appear inside of CREATE // statements into a NULL when parsing the CREATE statement text out // of the sqlite_schema table - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } else if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 4 { // A bound parameter in a CREATE statement that originates from // sqlite3_prepare() causes an error @@ -81187,7 +81890,7 @@ func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / return int32(0) } -func exprIsConst(tls *libc.TLS, p uintptr, initFlag int32, iCur int32) int32 { /* sqlite3.c:101788:12: */ +func exprIsConst(tls *libc.TLS, p uintptr, initFlag int32, iCur int32) int32 { /* sqlite3.c:102714:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -81211,7 +81914,7 @@ func exprIsConst(tls *libc.TLS, p uintptr, initFlag int32, iCur int32) int32 { / // 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 Xsqlite3ExprIsConstant(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101809:20: */ +func Xsqlite3ExprIsConstant(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:102735:20: */ return exprIsConst(tls, p, 1, 0) } @@ -81226,7 +81929,7 @@ func Xsqlite3ExprIsConstant(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:10180 // When this routine returns true, it indicates that the expression // can be added to the pParse->pConstExpr list and evaluated once when // the prepared statement starts up. See sqlite3ExprCodeRunJustOnce(). -func Xsqlite3ExprIsConstantNotJoin(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101826:20: */ +func Xsqlite3ExprIsConstantNotJoin(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:102752:20: */ return exprIsConst(tls, p, 2, 0) } @@ -81234,12 +81937,12 @@ func Xsqlite3ExprIsConstantNotJoin(tls *libc.TLS, p uintptr) int32 { /* sqlite3. // 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 Xsqlite3ExprIsTableConstant(tls *libc.TLS, p uintptr, iCur int32) int32 { /* sqlite3.c:101836:20: */ +func Xsqlite3ExprIsTableConstant(tls *libc.TLS, p uintptr, iCur int32) int32 { /* sqlite3.c:102762:20: */ return exprIsConst(tls, p, 3, iCur) } // sqlite3WalkExpr() callback used by sqlite3ExprIsConstantOrGroupBy(). -func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101844:12: */ +func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:102770:12: */ var pGroupBy uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var i int32 @@ -81256,7 +81959,7 @@ func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) } // Check if pExpr is a sub-select. If so, consider it variable. - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort } @@ -81281,7 +81984,7 @@ func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) // 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 Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, pGroupBy uintptr) int32 { /* sqlite3.c:101888:20: */ +func Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, pGroupBy uintptr) int32 { /* sqlite3.c:102814:20: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -81317,7 +82020,7 @@ func Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, p // 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 Xsqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit U8) int32 { /* sqlite3.c:101920:20: */ +func Xsqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit U8) int32 { /* sqlite3.c:102846:20: */ return exprIsConst(tls, p, (4 + int32(isInit)), 0) } @@ -81326,7 +82029,7 @@ func Xsqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit U8) int32 // 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 Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /* sqlite3.c:101949:20: */ +func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /* sqlite3.c:102875:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -81338,7 +82041,7 @@ func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /* // If an expression is an integer literal that fits in a signed 32-bit // integer, then the EP_IntValue flag will have already been set - if ((*Expr)(unsafe.Pointer(p)).Fflags & EP_IntValue) != 0 { + if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_IntValue)) != 0 { *(*int32)(unsafe.Pointer(pValue)) = *(*int32)(unsafe.Pointer(p + 8 /* &.u */)) return 1 } @@ -81379,7 +82082,7 @@ func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /* // 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 Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101995:20: */ +func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:102921:20: */ var op U8 for (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UPLUS) || (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_UMINUS) { p = (*Expr)(unsafe.Pointer(p)).FpLeft @@ -81398,7 +82101,7 @@ func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101995 case TK_BLOB: return 0 case TK_COLUMN: - return (libc.Bool32(((((*Expr)(unsafe.Pointer((p))).Fflags & (EP_CanBeNull)) != U32(0)) || (*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) == uintptr(0))) || (((int32((*Expr)(unsafe.Pointer(p)).FiColumn) >= 0) && + return (libc.Bool32(((((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_CanBeNull))) != U32(0)) || (*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) == uintptr(0))) || (((int32((*Expr)(unsafe.Pointer(p)).FiColumn) >= 0) && ((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)))).FaCol != uintptr(0))) && // Defense against OOM problems (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)))).FaCol+uintptr((*Expr)(unsafe.Pointer(p)).FiColumn)*32)).FnotNull) == 0)))) default: @@ -81415,7 +82118,7 @@ func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101995 // can be omitted. When in doubt return FALSE. A false negative // is harmless. A false positive, however, can result in the wrong // answer. -func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) int32 { /* sqlite3.c:102029:20: */ +func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) int32 { /* sqlite3.c:102955:20: */ var op U8 var unaryMinus int32 = 0 if int32(aff) == SQLITE_AFF_BLOB { @@ -81468,14 +82171,14 @@ func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) int32 } // Return TRUE if the given string is a row-id column name. -func Xsqlite3IsRowid(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:102065:20: */ - if Xsqlite3StrICmp(tls, z, ts+9555 /* "_ROWID_" */) == 0 { +func Xsqlite3IsRowid(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:102991:20: */ + if Xsqlite3StrICmp(tls, z, ts+9648 /* "_ROWID_" */) == 0 { return 1 } - if Xsqlite3StrICmp(tls, z, ts+9563 /* "ROWID" */) == 0 { + if Xsqlite3StrICmp(tls, z, ts+9656 /* "ROWID" */) == 0 { return 1 } - if Xsqlite3StrICmp(tls, z, ts+9569 /* "OID" */) == 0 { + if Xsqlite3StrICmp(tls, z, ts+9662 /* "OID" */) == 0 { return 1 } return 0 @@ -81486,16 +82189,16 @@ func Xsqlite3IsRowid(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:102065:20: * // a pointer to the SELECT statement. If pX is not a SELECT statement, // or if the SELECT statement needs to be manifested into a transient // table, then return NULL. -func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:102080:15: */ +func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:103006:15: */ var p uintptr var pSrc uintptr var pEList uintptr var pTab uintptr var i int32 - if !(((*Expr)(unsafe.Pointer((pX))).Fflags & (EP_xIsSelect)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_xIsSelect))) != U32(0)) { return uintptr(0) } // Not a subquery - if ((*Expr)(unsafe.Pointer((pX))).Fflags & (EP_VarSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_VarSelect))) != U32(0) { return uintptr(0) } // Correlated subq p = *(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)) @@ -81518,10 +82221,10 @@ func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:10208 if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc != 1 { return uintptr(0) } // Single term in FROM clause - if (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpSelect != 0 { + if (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpSelect != 0 { return uintptr(0) } // FROM is not a subquery or view - pTab = (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab + pTab = (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab // FROM clause is not a view if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { @@ -81544,7 +82247,7 @@ func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:10208 // it contains any NULL entries. Cause the register at regHasNull to be set // to a non-NULL value if iCur contains no NULLs. Cause register regHasNull // to be set to NULL if iCur contains one or more NULL values. -func sqlite3SetHasNullFlag(tls *libc.TLS, v uintptr, iCur int32, regHasNull int32) { /* sqlite3.c:102125:13: */ +func sqlite3SetHasNullFlag(tls *libc.TLS, v uintptr, iCur int32, regHasNull int32) { /* sqlite3.c:103051:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -81552,14 +82255,14 @@ func sqlite3SetHasNullFlag(tls *libc.TLS, v uintptr, iCur int32, regHasNull int3 Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regHasNull) addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iCur) Xsqlite3VdbeAddOp3(tls, v, OP_Column, iCur, 0, regHasNull) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_TYPEOFARG) - Xsqlite3VdbeComment(tls, v, ts+9573 /* "first_entry_in(%..." */, libc.VaList(bp, iCur)) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG)) + Xsqlite3VdbeComment(tls, v, ts+9666 /* "first_entry_in(%..." */, libc.VaList(bp, iCur)) Xsqlite3VdbeJumpHere(tls, v, addr1) } // The argument is an IN operator with a list (not a subquery) on the // right-hand side. Return TRUE if that list is constant. -func sqlite3InRhsIsConstant(tls *libc.TLS, pIn uintptr) int32 { /* sqlite3.c:102142:12: */ +func sqlite3InRhsIsConstant(tls *libc.TLS, pIn uintptr) int32 { /* sqlite3.c:103068:12: */ var pLHS uintptr var res int32 @@ -81648,7 +82351,7 @@ func sqlite3InRhsIsConstant(tls *libc.TLS, pIn uintptr) int32 { /* sqlite3.c:102 // CREATE INDEX i1 ON t1(b, c, a); // // then aiMap[] is populated with {2, 0, 1}. -func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, prRhsHasNull uintptr, aiMap uintptr, piTab uintptr) int32 { /* sqlite3.c:102235:20: */ +func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, prRhsHasNull uintptr, aiMap uintptr, piTab uintptr) int32 { /* sqlite3.c:103161:20: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -81658,14 +82361,14 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, var mustBeUnique int32 // True if RHS must be unique var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Virtual machine being coded - mustBeUnique = (libc.Bool32((inFlags & IN_INDEX_LOOP) != U32(0))) + mustBeUnique = (libc.Bool32((inFlags & U32(IN_INDEX_LOOP)) != U32(0))) // If the RHS of this IN(...) operator is a SELECT, and if it matters // whether or not the SELECT result contains NULL values, check whether // or not NULL is actually possible (it may not be, for example, due // to NOT NULL constraints in the schema). If no NULL values are possible, // set prRhsHasNull to 0 before continuing. - if (prRhsHasNull != 0) && (((*Expr)(unsafe.Pointer(pX)).Fflags & EP_xIsSelect) != 0) { + if (prRhsHasNull != 0) && (((*Expr)(unsafe.Pointer(pX)).Fflags & U32(EP_xIsSelect)) != 0) { var i int32 var pEList uintptr = (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FpEList for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ { @@ -81691,7 +82394,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, // Because of isCandidateForInOpt(p) // Because of isCandidateForInOpt(p) // Because of isCandidateForInOpt(p) - pTab = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab + pTab = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab // Code an OP_Transaction and OP_TableLock for
  • . iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) @@ -81706,7 +82409,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, Xsqlite3OpenTable(tls, pParse, iTab, iDb, pTab, OP_OpenRead) eType = IN_INDEX_ROWID - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9592 /* "USING ROWID SEAR..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9685 /* "USING ROWID SEAR..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) Xsqlite3VdbeJumpHere(tls, v, iAddr) } else { var pIdx uintptr // Iterator variable @@ -81797,7 +82500,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, if colUsed == ((Bitmask((uint64(1))) << (nExpr)) - uint64(1)) { // If we reach this point, that means the index pIdx is usable var iAddr int32 = Xsqlite3VdbeAddOp0(tls, v, OP_Once) - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9639 /* "USING INDEX %s F..." */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIdx)).FzName)) + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9732 /* "USING INDEX %s F..." */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIdx)).FzName)) Xsqlite3VdbeAddOp3(tls, v, OP_OpenRead, iTab, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb) Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx) Xsqlite3VdbeComment(tls, v, ts+824 /* "%s" */, libc.VaList(bp+16, (*Index)(unsafe.Pointer(pIdx)).FzName)) @@ -81824,8 +82527,8 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, // then it is not worth creating an ephemeral table to evaluate // the IN operator so return IN_INDEX_NOOP. if (((eType == 0) && - ((inFlags & IN_INDEX_NOOP_OK) != 0)) && - !(((*Expr)(unsafe.Pointer((pX))).Fflags & (EP_xIsSelect)) != U32(0))) && + ((inFlags & U32(IN_INDEX_NOOP_OK)) != 0)) && + !(((*Expr)(unsafe.Pointer((pX))).Fflags & (U32(EP_xIsSelect))) != U32(0))) && (!(sqlite3InRhsIsConstant(tls, pX) != 0) || ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FnExpr <= 2)) { eType = IN_INDEX_NOOP } @@ -81836,7 +82539,7 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, var savedNQueryLoop U32 = (*Parse)(unsafe.Pointer(pParse)).FnQueryLoop var rMayHaveNull int32 = 0 eType = IN_INDEX_EPH - if (inFlags & IN_INDEX_LOOP) != 0 { + if (inFlags & U32(IN_INDEX_LOOP)) != 0 { (*Parse)(unsafe.Pointer(pParse)).FnQueryLoop = U32(0) } else if prRhsHasNull != 0 { *(*int32)(unsafe.Pointer(prRhsHasNull)) = libc.AssignInt32(&rMayHaveNull, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)) @@ -81867,11 +82570,11 @@ func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, // // It is the responsibility of the caller to ensure that the returned // string is eventually freed using sqlite3DbFree(). -func exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:102458:13: */ +func exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:103384:13: */ var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft var nVal int32 = Xsqlite3ExprVectorSize(tls, pLeft) var pSelect uintptr - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_xIsSelect)) != 0 { pSelect = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) } else { pSelect = uintptr(0) @@ -81899,12 +82602,12 @@ func exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* s // message of the form: // // "sub-select returns N columns - expected M" -func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpect int32) { /* sqlite3.c:102490:21: */ +func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpect int32) { /* sqlite3.c:103416:21: */ bp := tls.Alloc(16) defer tls.Free(16) if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 { - var zFmt uintptr = ts + 9670 /* "sub-select retur..." */ + var zFmt uintptr = ts + 9763 /* "sub-select retur..." */ Xsqlite3ErrorMsg(tls, pParse, zFmt, libc.VaList(bp, nActual, nExpect)) } } @@ -81918,11 +82621,11 @@ func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpec // Or, if it is a regular scalar vector: // // "row value misused" -func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:102509:21: */ - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_xIsSelect) != 0 { +func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:103435:21: */ + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_xIsSelect)) != 0 { Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList)).FnExpr, 1) } else { - Xsqlite3ErrorMsg(tls, pParse, ts+8423 /* "row value misuse..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+8516 /* "row value misuse..." */, 0) } } @@ -81946,7 +82649,7 @@ func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* s // if either column has NUMERIC or INTEGER affinity. If neither // 'x' nor the SELECT... statement are columns, then numeric affinity // is used. -func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int32) { /* sqlite3.c:102543:21: */ +func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int32) { /* sqlite3.c:103469:21: */ bp := tls.Alloc(73) defer tls.Free(73) @@ -81968,14 +82671,14 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 // // If all of the above are false, then we can compute the RHS just once // and reuse it many names. - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_VarSelect)) != U32(0)) && ((*Parse)(unsafe.Pointer(pParse)).FiSelfTab == 0) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_VarSelect))) != U32(0)) && ((*Parse)(unsafe.Pointer(pParse)).FiSelfTab == 0) { // Reuse of the RHS is allowed // If this routine has already been coded, but the previous code // might not have been invoked yet, so invoke it now as a subroutine. - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Subrtn)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subrtn))) != U32(0) { addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9714 /* "REUSE LIST SUBQU..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FselId)) + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9807 /* "REUSE LIST SUBQU..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FselId)) } Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)), *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */))) @@ -81985,11 +82688,11 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 } // Begin coding the subroutine - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Subrtn) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Subrtn)) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */)) = (Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */))) + 1) - Xsqlite3VdbeComment(tls, v, ts+9737 /* "return address" */, 0) + Xsqlite3VdbeComment(tls, v, ts+9830 /* "return address" */, 0) addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once) } @@ -82002,14 +82705,14 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 // RHS of the IN operator. (*Expr)(unsafe.Pointer(pExpr)).FiTable = iTab addr = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Expr)(unsafe.Pointer(pExpr)).FiTable, nVal) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { - Xsqlite3VdbeComment(tls, v, ts+9752 /* "Result of SELECT..." */, libc.VaList(bp+8, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FselId)) + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { + Xsqlite3VdbeComment(tls, v, ts+9845 /* "Result of SELECT..." */, libc.VaList(bp+8, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FselId)) } else { - Xsqlite3VdbeComment(tls, v, ts+9772 /* "RHS of IN operat..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+9865 /* "RHS of IN operat..." */, 0) } pKeyInfo = Xsqlite3KeyInfoAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, nVal, 1) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { // Case 1: expr IN (SELECT ...) // // Generate code to write the results of the select into the temporary @@ -82017,11 +82720,11 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) var pEList uintptr = (*Select)(unsafe.Pointer(pSelect)).FpEList - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+9791 /* "%sLIST SUBQUERY ..." */, libc.VaList(bp+16, func() uintptr { + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+9884 /* "%sLIST SUBQUERY ..." */, libc.VaList(bp+16, func() uintptr { if addrOnce != 0 { return ts + 800 /* "" */ } - return ts + 9810 /* "CORRELATED " */ + return ts + 9903 /* "CORRELATED " */ }(), (*Select)(unsafe.Pointer(pSelect)).FselId)) // If the LHS and RHS of the IN operator do not match, that // error will have been caught long before we reach this point. @@ -82064,9 +82767,9 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 var r2 int32 *(*int8)(unsafe.Pointer(bp + 72 /* affinity */)) = Xsqlite3ExprAffinity(tls, pLeft) if int32(*(*int8)(unsafe.Pointer(bp + 72 /* affinity */))) <= SQLITE_AFF_NONE { - *(*int8)(unsafe.Pointer(bp + 72 /* affinity */)) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(bp + 72 /* affinity */)) = int8(SQLITE_AFF_BLOB) } else if int32(*(*int8)(unsafe.Pointer(bp + 72 /* affinity */))) == SQLITE_AFF_REAL { - *(*int8)(unsafe.Pointer(bp + 72 /* affinity */)) = SQLITE_AFF_NUMERIC + *(*int8)(unsafe.Pointer(bp + 72 /* affinity */)) = int8(SQLITE_AFF_NUMERIC) } if pKeyInfo != 0 { @@ -82136,7 +82839,7 @@ func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 // the result is stored in a contiguous array of registers and the // return value is the register of the left-most result column. // Return 0 if an error occurs. -func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:102731:20: */ +func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:103657:20: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -82161,21 +82864,21 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { // // If all of the above are false, then we can run this code just once // save the results, and reuse the same result on subsequent invocations. - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_VarSelect)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_VarSelect))) != U32(0)) { // If this routine has already been coded, then invoke it as a // subroutine. - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Subrtn)) != U32(0) { - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9822 /* "REUSE SUBQUERY %..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId)) + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subrtn))) != U32(0) { + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9915 /* "REUSE SUBQUERY %..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId)) Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)), *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */))) return (*Expr)(unsafe.Pointer(pExpr)).FiTable } // Begin coding the subroutine - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Subrtn) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Subrtn)) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ /* &.iAddr */)) = (Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, *(*int32)(unsafe.Pointer(pExpr + 64 /* &.y */ /* &.sub */ + 4 /* &.regReturn */))) + 1) - Xsqlite3VdbeComment(tls, v, ts+9737 /* "return address" */, 0) + Xsqlite3VdbeComment(tls, v, ts+9830 /* "return address" */, 0) addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once) } @@ -82189,11 +82892,11 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { // // In both cases, the query is augmented with "LIMIT 1". Any // preexisting limit is discarded in place of the new LIMIT 1. - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+9840 /* "%sSCALAR SUBQUER..." */, libc.VaList(bp+8, func() uintptr { + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+9933 /* "%sSCALAR SUBQUER..." */, libc.VaList(bp+8, func() uintptr { if addrOnce != 0 { return ts + 800 /* "" */ } - return ts + 9810 /* "CORRELATED " */ + return ts + 9903 /* "CORRELATED " */ }(), (*Select)(unsafe.Pointer(pSel)).FselId)) if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT { nReg = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpEList)).FnExpr @@ -82203,23 +82906,23 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { Xsqlite3SelectDestInit(tls, bp+24 /* &dest */, 0, ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)) *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (nReg) if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_SELECT { - (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = SRT_Mem + (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = U8(SRT_Mem) (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FiSdst = (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FiSDParm (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FnSdst = nReg Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm, (((*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm + nReg) - 1)) - Xsqlite3VdbeComment(tls, v, ts+9861 /* "Init subquery re..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+9954 /* "Init subquery re..." */, 0) } else { - (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = SRT_Exists + (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = U8(SRT_Exists) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm) - Xsqlite3VdbeComment(tls, v, ts+9882 /* "Init EXISTS resu..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+9975 /* "Init EXISTS resu..." */, 0) } if (*Select)(unsafe.Pointer(pSel)).FpLimit != 0 { // The subquery already has a limit. If the pre-existing limit is X // then make the new limit X<>0 so that the new limit is either 1 or 0 var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - pLimit = Xsqlite3Expr(tls, db, TK_INTEGER, ts+9370 /* "0" */) + pLimit = Xsqlite3Expr(tls, db, TK_INTEGER, ts+9474 /* "0" */) if pLimit != 0 { - (*Expr)(unsafe.Pointer(pLimit)).FaffExpr = SQLITE_AFF_NUMERIC + (*Expr)(unsafe.Pointer(pLimit)).FaffExpr = int8(SQLITE_AFF_NUMERIC) pLimit = Xsqlite3PExpr(tls, pParse, TK_NE, Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) } @@ -82227,7 +82930,7 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { // If there is no pre-existing limit add a limit of 1 - pLimit = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, ts+9901 /* "1" */) + pLimit = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, ts+9994 /* "1" */) (*Select)(unsafe.Pointer(pSel)).FpLimit = Xsqlite3PExpr(tls, pParse, TK_LIMIT, pLimit, uintptr(0)) } (*Select)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -82252,9 +82955,9 @@ func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { // 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 Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32 { /* sqlite3.c:102846:20: */ +func Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32 { /* sqlite3.c:103772:20: */ var nVector int32 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pIn)).FpLeft) - if ((*Expr)(unsafe.Pointer(pIn)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pIn)).Fflags & U32(EP_xIsSelect)) != 0 { if nVector != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 32 /* &.x */)))).FpEList)).FnExpr { Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 32 /* &.x */)))).FpEList)).FnExpr, nVector) return 1 @@ -82289,7 +82992,7 @@ func Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32 { /* // // See the separate in-operator.md documentation file in the canonical // SQLite source tree for additional information. -func sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFalse int32, destIfNull int32) { /* sqlite3.c:102887:13: */ +func sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFalse int32, destIfNull int32) { /* sqlite3.c:103813:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -82359,7 +83062,7 @@ __2: // the RHS has not yet been coded. v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // OOM detected prior to this routine - Xsqlite3VdbeNoopComment(tls, v, ts+9903 /* "begin IN expr" */, 0) + Xsqlite3VdbeNoopComment(tls, v, ts+9996 /* "begin IN expr" */, 0) eType = Xsqlite3FindInIndex(tls, pParse, pExpr, (uint32(IN_INDEX_MEMBERSHIP | IN_INDEX_NOOP_OK)), func() uintptr { @@ -82658,7 +83361,7 @@ sqlite3ExprCodeIN_finished: Xsqlite3ReleaseTempReg(tls, pParse, rLhs) __39: ; - Xsqlite3VdbeComment(tls, v, ts+9917 /* "end IN expr" */, 0) + Xsqlite3VdbeComment(tls, v, ts+10010 /* "end IN expr" */, 0) sqlite3ExprCodeIN_oom_error: Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, aiMap) Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, zAff) @@ -82670,14 +83373,14 @@ sqlite3ExprCodeIN_oom_error: // 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 *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32) { /* sqlite3.c:103143:13: */ +func codeReal(tls *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32) { /* sqlite3.c:104069:13: */ bp := tls.Alloc(8) defer tls.Free(8) if z != uintptr(0) { // var value float64 at bp, 8 - Xsqlite3AtoF(tls, z, bp /* &value */, Xsqlite3Strlen30(tls, z), SQLITE_UTF8) + Xsqlite3AtoF(tls, z, bp /* &value */, Xsqlite3Strlen30(tls, z), uint8(SQLITE_UTF8)) // The new AtoF never returns NaN if negateFlag != 0 { *(*float64)(unsafe.Pointer(bp /* value */)) = -*(*float64)(unsafe.Pointer(bp /* value */)) @@ -82690,12 +83393,12 @@ func codeReal(tls *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32) // text z[0..n-1] into register iMem. // // Expr.u.zToken is always UTF8 and zero-terminated. -func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iMem int32) { /* sqlite3.c:103161:13: */ +func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iMem int32) { /* sqlite3.c:104087:13: */ bp := tls.Alloc(24) defer tls.Free(24) var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_IntValue) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_IntValue)) != 0 { var i int32 = *(*int32)(unsafe.Pointer(pExpr + 8 /* &.u */)) if negFlag != 0 { @@ -82710,10 +83413,10 @@ func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iM c = Xsqlite3DecOrHexToI64(tls, z, bp+16 /* &value */) if (((c == 3) && !(negFlag != 0)) || (c == 2)) || ((negFlag != 0) && (*(*I64)(unsafe.Pointer(bp + 16 /* value */)) == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))) { - if Xsqlite3_strnicmp(tls, z, ts+9929 /* "0x" */, 2) == 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+9932 /* "hex literal too ..." */, libc.VaList(bp, func() uintptr { + if Xsqlite3_strnicmp(tls, z, ts+10022 /* "0x" */, 2) == 0 { + Xsqlite3ErrorMsg(tls, pParse, ts+10025 /* "hex literal too ..." */, libc.VaList(bp, func() uintptr { if negFlag != 0 { - return ts + 6585 /* "-" */ + return ts + 6661 /* "-" */ } return ts + 800 /* "" */ }(), z)) @@ -82735,7 +83438,7 @@ func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iM // Generate code that will load into register regOut a value that is // appropriate for the iIdxCol-th column of index pIdx. -func Xsqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr, iTabCur int32, iIdxCol int32, regOut int32) { /* sqlite3.c:103198:21: */ +func Xsqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr, iTabCur int32, iIdxCol int32, regOut int32) { /* sqlite3.c:104124:21: */ var iTabCol I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iIdxCol)*2)) if int32(iTabCol) == (-2) { @@ -82750,7 +83453,7 @@ func Xsqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr // Generate code that will compute the value of generated column pCol // and store the result in register regOut -func Xsqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pCol uintptr, regOut int32) { /* sqlite3.c:103223:21: */ +func Xsqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pCol uintptr, regOut int32) { /* sqlite3.c:104149:21: */ var iAddr int32 var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe @@ -82769,7 +83472,7 @@ func Xsqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pCol uintptr } // Generate code to extract the value of the iCol-th column of a table. -func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iTabCur int32, iCol int32, regOut int32) { /* sqlite3.c:103248:21: */ +func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iTabCur int32, iCol int32, regOut int32) { /* sqlite3.c:104174:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -82790,7 +83493,7 @@ func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT } else if (int32((*Column)(unsafe.Pointer((libc.AssignUintptr(&pCol, ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32))))).FcolFlags) & COLFLAG_VIRTUAL) != 0 { var pParse uintptr = Xsqlite3VdbeParser(tls, v) if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_BUSY) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+9958 /* "generated column..." */, libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+10051 /* "generated column..." */, libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName)) } else { var savedSelfTab int32 = (*Parse)(unsafe.Pointer(pParse)).FiSelfTab *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) |= U16((COLFLAG_BUSY)) @@ -82800,7 +83503,7 @@ func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(COLFLAG_BUSY))) } return - } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { x = int32(Xsqlite3TableColumnToIndex(tls, Xsqlite3PrimaryKeyIndex(tls, pTab), int16(iCol))) op = OP_Column @@ -82819,7 +83522,7 @@ func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT // // 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 Xsqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iColumn int32, iTable int32, iReg int32, p5 U8) int32 { /* sqlite3.c:103305:20: */ +func Xsqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iColumn int32, iTable int32, iReg int32, p5 U8) int32 { /* sqlite3.c:104231:20: */ Xsqlite3ExprCodeGetColumnOfTable(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iTable, iColumn, iReg) if p5 != 0 { @@ -82833,17 +83536,20 @@ func Xsqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iCol // Generate code to move content from registers iFrom...iFrom+nReg-1 // over to iTo..iTo+nReg-1. -func Xsqlite3ExprCodeMove(tls *libc.TLS, pParse uintptr, iFrom int32, iTo int32, nReg int32) { /* sqlite3.c:103326:21: */ +func Xsqlite3ExprCodeMove(tls *libc.TLS, pParse uintptr, iFrom int32, iTo int32, nReg int32) { /* sqlite3.c:104252:21: */ Xsqlite3VdbeAddOp3(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Move, iFrom, iTo, nReg) } // 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 *libc.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:103335:13: */ +func exprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:104261:13: */ var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr) + if p == uintptr(0) { + return + } (*Expr)(unsafe.Pointer(p)).Fop2 = (*Expr)(unsafe.Pointer(p)).Fop - (*Expr)(unsafe.Pointer(p)).Fop = TK_REGISTER + (*Expr)(unsafe.Pointer(p)).Fop = U8(TK_REGISTER) (*Expr)(unsafe.Pointer(p)).FiTable = iReg *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Skip))) } @@ -82856,7 +83562,7 @@ func exprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:103 // 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 *libc.TLS, pParse uintptr, p uintptr, piFreeable uintptr) int32 { /* sqlite3.c:103353:12: */ +func exprCodeVector(tls *libc.TLS, pParse uintptr, p uintptr, piFreeable uintptr) int32 { /* sqlite3.c:104280:12: */ var iResult int32 var nResult int32 = Xsqlite3ExprVectorSize(tls, p) if nResult == 1 { @@ -82879,7 +83585,7 @@ func exprCodeVector(tls *libc.TLS, pParse uintptr, p uintptr, piFreeable uintptr // If the last opcode is a OP_Copy, then set the do-not-merge flag (p5) // so that a subsequent copy will not be merged into this one. -func setDoNotMergeFlagOnCopy(tls *libc.TLS, v uintptr) { /* sqlite3.c:103382:13: */ +func setDoNotMergeFlagOnCopy(tls *libc.TLS, v uintptr) { /* sqlite3.c:104309:13: */ if int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, -1))).Fopcode) == OP_Copy { Xsqlite3VdbeChangeP5(tls, v, uint16(1)) // Tag trailing OP_Copy as not mergable } @@ -82887,7 +83593,7 @@ func setDoNotMergeFlagOnCopy(tls *libc.TLS, v uintptr) { /* sqlite3.c:103382:13: // Generate code to implement special SQL functions that are implemented // in-line rather than by using the usual callbacks. -func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncId int32, target int32) int32 { /* sqlite3.c:103392:12: */ +func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncId int32, target int32) int32 { /* sqlite3.c:104319:12: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -82921,7 +83627,7 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI // var caseExpr Expr at bp, 72 libc.Xmemset(tls, bp /* &caseExpr */, 0, uint64(unsafe.Sizeof(Expr{}))) - (*Expr)(unsafe.Pointer(bp /* &caseExpr */)).Fop = TK_CASE + (*Expr)(unsafe.Pointer(bp /* &caseExpr */)).Fop = U8(TK_CASE) *(*uintptr)(unsafe.Pointer(bp /* &caseExpr */ + 32 /* &.x */)) = pFarg return Xsqlite3ExprCodeTarget(tls, pParse, bp /* &caseExpr */, target) @@ -82993,7 +83699,7 @@ func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncI // 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 Xsqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) int32 { /* sqlite3.c:103508:20: */ +func Xsqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) int32 { /* sqlite3.c:104435:20: */ bp := tls.Alloc(240) defer tls.Free(240) @@ -83278,10 +83984,10 @@ __56: if !(int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn) < 0) { goto __59 } - Xsqlite3VdbeComment(tls, v, ts+9988 /* "%s.rowid" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3VdbeComment(tls, v, ts+10081 /* "%s.rowid" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) goto __60 __59: - Xsqlite3VdbeComment(tls, v, ts+9997 /* "%s.%s" */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn)*32)).FzName)) + Xsqlite3VdbeComment(tls, v, ts+10090 /* "%s.%s" */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn)*32)).FzName)) if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn)*32)).Faffinity) == SQLITE_AFF_REAL) { goto __61 } @@ -83298,7 +84004,7 @@ __57: __5: iTab = (*Expr)(unsafe.Pointer(pExpr)).FiTable - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FixedCol)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) { goto __62 } iReg = Xsqlite3ExprCodeTarget(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, target) @@ -83346,7 +84052,7 @@ __69: if !((int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags) & COLFLAG_BUSY) != 0) { goto __72 } - Xsqlite3ErrorMsg(tls, pParse, ts+9958, /* "generated column..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+10051, /* "generated column..." */ libc.VaList(bp+24, (*Column)(unsafe.Pointer(pCol1)).FzName)) return 0 __72: @@ -83490,7 +84196,7 @@ __79: r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+92 /* ®Free2 */) codeCompare(tls, pParse, pLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, r1, r2, inReg, (SQLITE_STOREP2 | p5), - (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0)))) + (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0)))) __80: ; @@ -83534,7 +84240,7 @@ __81: return target goto __84 __83: - (*Expr)(unsafe.Pointer(bp + 96 /* &tempX */)).Fop = TK_INTEGER + (*Expr)(unsafe.Pointer(bp + 96 /* &tempX */)).Fop = U8(TK_INTEGER) (*Expr)(unsafe.Pointer(bp + 96 /* &tempX */)).Fflags = (U32(EP_IntValue | EP_TokenOnly)) *(*int32)(unsafe.Pointer(bp + 96 /* &tempX */ + 8 /* &.u */)) = 0 @@ -83587,7 +84293,7 @@ __41: goto __85 } - Xsqlite3ErrorMsg(tls, pParse, ts+10003 /* "misuse of aggreg..." */, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)))) + Xsqlite3ErrorMsg(tls, pParse, ts+10096 /* "misuse of aggreg..." */, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)))) goto __86 __85: return (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pInfo)).FaFunc + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiAgg)*24)).FiMem @@ -83601,7 +84307,7 @@ __42: // The function name enc = (*Sqlite3)(unsafe.Pointer(db)).Fenc // The text encoding used by this database pColl = uintptr(0) // A collating sequence - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { goto __87 } return (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FregResult @@ -83629,11 +84335,11 @@ __88: if !((pDef == uintptr(0)) || ((*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0))) { goto __89 } - Xsqlite3ErrorMsg(tls, pParse, ts+10029 /* "unknown function..." */, libc.VaList(bp+40, zId)) + Xsqlite3ErrorMsg(tls, pParse, ts+10122 /* "unknown function..." */, libc.VaList(bp+40, zId)) goto __3 __89: ; - if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_INLINE) != 0) { + if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_INLINE)) != 0) { goto __90 } @@ -83662,7 +84368,7 @@ __93: constMask = constMask | (uint32((uint32(1))) << (i)) __96: ; - if !((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != U32(0)) && !(pColl != 0)) { + if !((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != U32(0)) && !(pColl != 0)) { goto __97 } pColl = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+uintptr(i)*32)).FpExpr) @@ -83726,7 +84432,7 @@ __99: // function. The expression "A glob B" is equivalent to // "glob(B,A). We want to use the A in "A glob B" to test // for function overloading. But we use the B term in "glob(B,A)". - if !((nFarg >= 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_InfixFunc)) != U32(0))) { + if !((nFarg >= 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_InfixFunc))) != U32(0))) { goto __104 } pDef = Xsqlite3VtabOverloadFunction(tls, db, pDef, nFarg, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+1*32)).FpExpr) @@ -83740,7 +84446,7 @@ __106: ; __105: ; - if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0) { + if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0) { goto __107 } if !(!(pColl != 0)) { @@ -83752,7 +84458,7 @@ __108: Xsqlite3VdbeAddOp4(tls, v, OP_CollSeq, 0, 0, 0, pColl, -2) __107: ; - if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_OFFSET) != 0) { + if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_OFFSET)) != 0) { goto __109 } pArg = (*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */))).FpExpr @@ -83823,7 +84529,7 @@ __120: ((*Expr)(unsafe.Pointer(pExpr)).FiTable != (libc.AssignInt32(&n1, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))))) { goto __121 } - Xsqlite3ErrorMsg(tls, pParse, ts+9491, /* "%d columns assig..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+9595, /* "%d columns assig..." */ libc.VaList(bp+48, (*Expr)(unsafe.Pointer(pExpr)).FiTable, n1)) __121: ; @@ -83890,14 +84596,14 @@ __51: int32(Xsqlite3TableColumnToStorage(tls, pTab2, int16(iCol1)))) Xsqlite3VdbeAddOp2(tls, v, OP_Param, p1, target) - Xsqlite3VdbeComment(tls, v, ts+10052 /* "r[%d]=%s.%s" */, libc.VaList(bp+64, target, func() uintptr { + Xsqlite3VdbeComment(tls, v, ts+10145 /* "r[%d]=%s.%s" */, libc.VaList(bp+64, target, func() uintptr { if (*Expr)(unsafe.Pointer(pExpr)).FiTable != 0 { - return ts + 8338 /* "new" */ + return ts + 8431 /* "new" */ } - return ts + 8342 /* "old" */ + return ts + 8435 /* "old" */ }(), func() uintptr { if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 { - return ts + 10064 /* "rowid" */ + return ts + 10157 /* "rowid" */ } return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FaCol + uintptr(iCol1)*32)).FzName }())) @@ -83916,7 +84622,7 @@ __122: goto __3 __52: - Xsqlite3ErrorMsg(tls, pParse, ts+8423 /* "row value misuse..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+8516 /* "row value misuse..." */, 0) goto __3 // TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions @@ -83981,7 +84687,7 @@ __124: exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+88 /* ®Free1 */)) libc.Xmemset(tls, bp+168 /* &opCompare */, 0, uint64(unsafe.Sizeof(Expr{}))) - (*Expr)(unsafe.Pointer(bp + 168 /* &opCompare */)).Fop = TK_EQ + (*Expr)(unsafe.Pointer(bp + 168 /* &opCompare */)).Fop = U8(TK_EQ) (*Expr)(unsafe.Pointer(bp + 168 /* &opCompare */)).FpLeft = pDel pTest = bp + 168 /* &opCompare */ // Ticket b351d95f9cd5ef17e9d9dbae18f5ca8611190001: @@ -84040,7 +84746,7 @@ __55: goto __132 } Xsqlite3ErrorMsg(tls, pParse, - ts+10070 /* "RAISE() may only..." */, 0) + ts+10163 /* "RAISE() may only..." */, 0) return 0 __132: ; @@ -84079,7 +84785,7 @@ __3: return inReg } -var zAff = *(*[8]int8)(unsafe.Pointer(ts + 10120 /* "B\x00C\x00D\x00E" */)) /* sqlite3.c:103573:29 */ +var zAff = *(*[8]int8)(unsafe.Pointer(ts + 10213 /* "B\x00C\x00D\x00E" */)) /* sqlite3.c:104500:29 */ // Generate code that will evaluate expression pExpr just one time // per prepared statement execution. @@ -84096,7 +84802,7 @@ var zAff = *(*[8]int8)(unsafe.Pointer(ts + 10120 /* "B\x00C\x00D\x00E" */)) /* s // code to the same register, if they do not contain function calls and hence // are factored out into the initialization section at the end of the // prepared statement. -func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, regDest int32) int32 { /* sqlite3.c:104263:20: */ +func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, regDest int32) int32 { /* sqlite3.c:105190:20: */ var p uintptr p = (*Parse)(unsafe.Pointer(pParse)).FpConstExpr @@ -84124,7 +84830,7 @@ func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r __3: } pExpr = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0) - if (pExpr != uintptr(0)) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_HasFunc)) != U32(0)) { + if (pExpr != uintptr(0)) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_HasFunc))) != U32(0)) { var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var addr int32 @@ -84165,10 +84871,11 @@ func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r // 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 Xsqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uintptr) int32 { /* sqlite3.c:104320:20: */ +func Xsqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uintptr) int32 { /* sqlite3.c:105247:20: */ var r2 int32 pExpr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0) && + if ((((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0) && + (pExpr != uintptr(0))) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_REGISTER)) && (Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0) { *(*int32)(unsafe.Pointer(pReg)) = 0 @@ -84189,7 +84896,7 @@ func Xsqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin // Generate code that will evaluate expression pExpr and store the // results in register target. The results are guaranteed to appear // in register target. -func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:104347:21: */ +func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:105275:21: */ var inReg int32 if (*Parse)(unsafe.Pointer(pParse)).FpVdbe == uintptr(0) { @@ -84198,10 +84905,10 @@ func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32 inReg = Xsqlite3ExprCodeTarget(tls, pParse, pExpr, target) if inReg != target { var op U8 - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Subquery)) != U32(0) { - op = OP_Copy + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Subquery))) != U32(0) { + op = U8(OP_Copy) } else { - op = OP_SCopy + op = U8(OP_SCopy) } Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, int32(op), inReg, target) } @@ -84210,7 +84917,7 @@ func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32 // Make a transient copy of expression pExpr and then code it using // sqlite3ExprCode(). This routine works just like sqlite3ExprCode() // except that the input expression is guaranteed to be unchanged. -func Xsqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:104371:21: */ +func Xsqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:105299:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb pExpr = Xsqlite3ExprDup(tls, db, pExpr, 0) if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { @@ -84223,7 +84930,7 @@ func Xsqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // 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 Xsqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:104384:21: */ +func Xsqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:105312:21: */ if ((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0) && (Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0) { Xsqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { @@ -84249,16 +84956,16 @@ func Xsqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, ta // in registers at srcReg, and so the value can be copied from there. // If SQLITE_ECEL_OMITREF is also set, then the values with u.x.iOrderByCol>0 // are simply omitted rather than being copied from srcReg. -func Xsqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, target int32, srcReg int32, flags U8) int32 { /* sqlite3.c:104412:20: */ +func Xsqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, target int32, srcReg int32, flags U8) int32 { /* sqlite3.c:105340:20: */ var pItem uintptr var i int32 var j int32 var n int32 var copyOp U8 if (int32(flags) & SQLITE_ECEL_DUP) != 0 { - copyOp = OP_Copy + copyOp = uint8(OP_Copy) } else { - copyOp = OP_SCopy + copyOp = uint8(OP_SCopy) } var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe @@ -84331,7 +85038,7 @@ __3: // sqlite3ExprIfFalse: Jump to dest if false // // The jumpIfNull parameter is ignored if xJumpIf is NULL. -func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { /* sqlite3.c:104487:13: */ +func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { /* sqlite3.c:105415:13: */ bp := tls.Alloc(220) defer tls.Free(220) @@ -84351,13 +85058,13 @@ func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, x pDel = Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, 0) if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { - (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).Fop = TK_AND + (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).Fop = U8(TK_AND) (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).FpLeft = bp /* &compLeft */ (*Expr)(unsafe.Pointer(bp + 144 /* &exprAnd */)).FpRight = bp + 72 /* &compRight */ - (*Expr)(unsafe.Pointer(bp /* &compLeft */)).Fop = TK_GE + (*Expr)(unsafe.Pointer(bp /* &compLeft */)).Fop = U8(TK_GE) (*Expr)(unsafe.Pointer(bp /* &compLeft */)).FpLeft = pDel (*Expr)(unsafe.Pointer(bp /* &compLeft */)).FpRight = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + 8 /* &.a */))).FpExpr - (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).Fop = TK_LE + (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).Fop = U8(TK_LE) (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).FpLeft = pDel (*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).FpRight = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + 8 /* &.a */) + 1*32)).FpExpr exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+216 /* ®Free1 */)) @@ -84369,7 +85076,7 @@ func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, x // it into the Parse.pConstExpr list. We should use a new bit for this, // for clarity, but we are out of bits in the Expr.flags field so we // have to reuse the EP_FromJoin bit. Bummer. - *(*U32)(unsafe.Pointer(pDel + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(pDel + 4 /* &.flags */)) |= (U32(EP_FromJoin)) Xsqlite3ExprCodeTarget(tls, pParse, bp+144 /* &exprAnd */, dest) } Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 216 /* regFree1 */))) @@ -84392,7 +85099,7 @@ func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, x // 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 Xsqlite3ExprIfTrue(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:104559:21: */ +func Xsqlite3ExprIfTrue(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:105487:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -84554,7 +85261,7 @@ __27: r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp /* ®Free1 */) r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4 /* ®Free2 */) codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, - r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0)))) + r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0)))) goto __3 @@ -84588,13 +85295,13 @@ __19: __20: default_expr: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) { goto __28 } Xsqlite3VdbeGoto(tls, v, dest) goto __29 __28: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { goto __30 } // No-op @@ -84622,7 +85329,7 @@ __3: // 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 Xsqlite3ExprIfFalse(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:104701:21: */ +func Xsqlite3ExprIfFalse(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:105629:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -84806,7 +85513,7 @@ __27: r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp /* ®Free1 */) r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4 /* ®Free2 */) codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op, - r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_Commuted)) != U32(0)))) + r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Commuted))) != U32(0)))) goto __3 @@ -84840,13 +85547,13 @@ __29: __20: default_expr: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == EP_IsFalse) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse)) { goto __30 } Xsqlite3VdbeGoto(tls, v, dest) goto __31 __30: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == EP_IsTrue) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsTrue))) == U32(EP_IsTrue)) { goto __32 } // no-op @@ -84870,7 +85577,7 @@ __3: // 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 Xsqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:104873:21: */ +func Xsqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:105801:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pCopy uintptr = Xsqlite3ExprDup(tls, db, pExpr, 0) if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -84890,7 +85597,7 @@ func Xsqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest i // same as that currently bound to variable pVar, non-zero is returned. // Otherwise, if the values are not the same or if pExpr is not a simple // SQL value, zero is returned. -func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uintptr) int32 { /* sqlite3.c:104895:12: */ +func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uintptr) int32 { /* sqlite3.c:105823:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -84899,11 +85606,11 @@ func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uint var pL uintptr *(*uintptr)(unsafe.Pointer(bp /* pR */)) = uintptr(0) - Xsqlite3ValueFromExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, SQLITE_UTF8, SQLITE_AFF_BLOB, bp /* &pR */) + Xsqlite3ValueFromExpr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp /* &pR */) if *(*uintptr)(unsafe.Pointer(bp /* pR */)) != 0 { iVar = int32((*Expr)(unsafe.Pointer(pVar)).FiColumn) Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iVar) - pL = Xsqlite3VdbeGetBoundValue(tls, (*Parse)(unsafe.Pointer(pParse)).FpReprepare, iVar, SQLITE_AFF_BLOB) + pL = Xsqlite3VdbeGetBoundValue(tls, (*Parse)(unsafe.Pointer(pParse)).FpReprepare, iVar, uint8(SQLITE_AFF_BLOB)) if pL != 0 { if Xsqlite3_value_type(tls, pL) == SQLITE_TEXT { Xsqlite3_value_text(tls, pL) // Make sure the encoding is UTF-8 @@ -84944,7 +85651,7 @@ func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uint // If pParse is NULL (the normal case) then any TK_VARIABLE term in // Argument pParse should normally be NULL. If it is not NULL and pA or // pB causes a return value of 2. -func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:104947:20: */ +func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:105875:20: */ var combinedFlags U32 if (pA == uintptr(0)) || (pB == uintptr(0)) { if pB == pA { @@ -84956,8 +85663,8 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, return 0 } combinedFlags = ((*Expr)(unsafe.Pointer(pA)).Fflags | (*Expr)(unsafe.Pointer(pB)).Fflags) - if (combinedFlags & EP_IntValue) != 0 { - if ((((*Expr)(unsafe.Pointer(pA)).Fflags & (*Expr)(unsafe.Pointer(pB)).Fflags) & EP_IntValue) != U32(0)) && (*(*int32)(unsafe.Pointer(pA + 8 /* &.u */)) == *(*int32)(unsafe.Pointer(pB + 8 /* &.u */))) { + if (combinedFlags & U32(EP_IntValue)) != 0 { + if ((((*Expr)(unsafe.Pointer(pA)).Fflags & (*Expr)(unsafe.Pointer(pB)).Fflags) & U32(EP_IntValue)) != U32(0)) && (*(*int32)(unsafe.Pointer(pA + 8 /* &.u */)) == *(*int32)(unsafe.Pointer(pB + 8 /* &.u */))) { return 0 } return 2 @@ -84977,10 +85684,10 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, return 2 } - if (libc.Bool32(((*Expr)(unsafe.Pointer((pA))).Fflags & (EP_WinFunc)) != U32(0))) != (libc.Bool32(((*Expr)(unsafe.Pointer((pB))).Fflags & (EP_WinFunc)) != U32(0))) { + if (libc.Bool32(((*Expr)(unsafe.Pointer((pA))).Fflags & (U32(EP_WinFunc))) != U32(0))) != (libc.Bool32(((*Expr)(unsafe.Pointer((pB))).Fflags & (U32(EP_WinFunc))) != U32(0))) { return 2 } - if ((*Expr)(unsafe.Pointer((pA))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pA))).Fflags & (U32(EP_WinFunc))) != U32(0) { if Xsqlite3WindowCompare(tls, pParse, *(*uintptr)(unsafe.Pointer(pA + 64 /* &.y */)), *(*uintptr)(unsafe.Pointer(pB + 64 /* &.y */)), 1) != 0 { return 2 } @@ -84999,11 +85706,11 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, ((*Expr)(unsafe.Pointer(pB)).Fflags & (U32(EP_Distinct | EP_Commuted))) { return 2 } - if (combinedFlags & EP_TokenOnly) == U32(0) { - if (combinedFlags & EP_xIsSelect) != 0 { + if (combinedFlags & U32(EP_TokenOnly)) == U32(0) { + if (combinedFlags & U32(EP_xIsSelect)) != 0 { return 2 } - if ((combinedFlags & EP_FixedCol) == U32(0)) && + if ((combinedFlags & U32(EP_FixedCol)) == U32(0)) && (Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer(pA)).FpLeft, (*Expr)(unsafe.Pointer(pB)).FpLeft, iTab) != 0) { return 2 } @@ -85015,7 +85722,7 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, } if ((int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_STRING) && (int32((*Expr)(unsafe.Pointer(pA)).Fop) != TK_TRUEFALSE)) && - ((combinedFlags & EP_Reduced) == U32(0)) { + ((combinedFlags & U32(EP_Reduced)) == U32(0)) { if int32((*Expr)(unsafe.Pointer(pA)).FiColumn) != int32((*Expr)(unsafe.Pointer(pB)).FiColumn) { return 2 } @@ -85044,7 +85751,7 @@ func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, // // Two NULL pointers are considered to be the same. But a NULL pointer // always differs from a non-NULL pointer. -func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:105031:20: */ +func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:105959:20: */ var i int32 if (pA == uintptr(0)) && (pB == uintptr(0)) { return 0 @@ -85071,7 +85778,7 @@ func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) // Like sqlite3ExprCompare() except COLLATE operators at the top-level // are ignored. -func Xsqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:105050:20: */ +func Xsqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:105978:20: */ return Xsqlite3ExprCompare(tls, uintptr(0), Xsqlite3ExprSkipCollateAndLikely(tls, pA), Xsqlite3ExprSkipCollateAndLikely(tls, pB), @@ -85082,7 +85789,7 @@ func Xsqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) // // Or if seenNot is true, return non-zero if Expr p can only be // non-NULL if pNN is not NULL -func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, iTab int32, seenNot int32) int32 { /* sqlite3.c:105063:12: */ +func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, iTab int32, seenNot int32) int32 { /* sqlite3.c:105991:12: */ if Xsqlite3ExprCompare(tls, pParse, p, pNN, iTab) == 0 { return (libc.Bool32(int32((*Expr)(unsafe.Pointer(pNN)).Fop) != TK_NULL)) @@ -85090,7 +85797,7 @@ func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, i switch int32((*Expr)(unsafe.Pointer(p)).Fop) { case TK_IN: { - if (seenNot != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0)) { + if (seenNot != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0)) { return 0 } @@ -85206,7 +85913,7 @@ func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, i // 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 Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr, iTab int32) int32 { /* sqlite3.c:105159:20: */ +func Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr, iTab int32) int32 { /* sqlite3.c:106087:20: */ if Xsqlite3ExprCompare(tls, pParse, pE1, pE2, iTab) == 0 { return 1 } @@ -85229,9 +85936,9 @@ func Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uin // This routine controls an optimization. False positives (setting // pWalker->eCode to 1 when it should not be) are deadly, but false-negatives // (never setting pWalker->eCode) is a harmless missed optimization. -func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105186:12: */ +func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106114:12: */ - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { return WRC_Prune } switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) { @@ -85335,7 +86042,7 @@ func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* // clause requires that some column of the right table of the LEFT JOIN // be non-NULL, then the LEFT JOIN can be safely converted into an // ordinary join. -func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32 { /* sqlite3.c:105291:20: */ +func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32 { /* sqlite3.c:106219:20: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -85369,7 +86076,7 @@ func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32 { // 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 *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105329:12: */ +func exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106257:12: */ if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*IdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FiCur)) && (int32(Xsqlite3TableColumnToIndex(tls, (*IdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FpIdx, (*Expr)(unsafe.Pointer(pExpr)).FiColumn)) < 0) { @@ -85387,7 +86094,7 @@ func exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqli // 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 Xsqlite3ExprCoveredByIndex(tls *libc.TLS, pExpr uintptr, iCur int32, pIdx uintptr) int32 { /* sqlite3.c:105350:20: */ +func Xsqlite3ExprCoveredByIndex(tls *libc.TLS, pExpr uintptr, iCur int32, pIdx uintptr) int32 { /* sqlite3.c:106278:20: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -85410,16 +86117,16 @@ func Xsqlite3ExprCoveredByIndex(tls *libc.TLS, pExpr uintptr, iCur int32, pIdx u // SELECT with a FROM clause encountered during this iteration, set // SrcCount.iSrcInner to the cursor number of the leftmost object in // the FROM cause. -func selectSrcCount(tls *libc.TLS, pWalker uintptr, pSel uintptr) int32 { /* sqlite3.c:105386:12: */ +func selectSrcCount(tls *libc.TLS, pWalker uintptr, pSel uintptr) int32 { /* sqlite3.c:106314:12: */ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) if (((*SrcCount)(unsafe.Pointer(p)).FiSrcInner == 0x7FFFFFFF) && ((*Select)(unsafe.Pointer(pSel)).FpSrc != 0)) && ((*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpSrc)).FnSrc != 0) { - (*SrcCount)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FiSrcInner = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSel)).FpSrc + 8 /* &.a */))).FiCursor + (*SrcCount)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FiSrcInner = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSel)).FpSrc + 8 /* &.a */))).FiCursor } return WRC_Continue } // Count the number of references to columns. -func exprSrcCount(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105397:12: */ +func exprSrcCount(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106325:12: */ // There was once a NEVER() on the second term on the grounds that // sqlite3FunctionUsesThisSrc() was always called before // sqlite3ExprAnalyzeAggregates() and so the TK_COLUMNs have not yet @@ -85437,7 +86144,7 @@ func exprSrcCount(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqli nSrc = 0 } for i = 0; i < nSrc; i++ { - if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FiCursor { + if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FiCursor { break } } @@ -85457,7 +86164,7 @@ func exprSrcCount(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqli // 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 Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) int32 { /* sqlite3.c:105430:20: */ +func Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) int32 { /* sqlite3.c:106358:20: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -85476,14 +86183,14 @@ func Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) (*SrcCount)(unsafe.Pointer(bp + 48 /* &cnt */)).FpSrc = pSrcList (*SrcCount)(unsafe.Pointer(bp + 48 /* &cnt */)).FiSrcInner = func() int32 { if (pSrcList != 0) && ((*SrcList)(unsafe.Pointer(pSrcList)).FnSrc != 0) { - return (*SrcList_item)(unsafe.Pointer((pSrcList + 8 /* &.a */))).FiCursor + return (*SrcItem)(unsafe.Pointer((pSrcList + 8 /* &.a */))).FiCursor } return 0x7FFFFFFF }() (*SrcCount)(unsafe.Pointer(bp + 48 /* &cnt */)).FnThis = 0 (*SrcCount)(unsafe.Pointer(bp + 48 /* &cnt */)).FnOther = 0 Xsqlite3WalkExprList(tls, bp /* &w */, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { Xsqlite3WalkExpr(tls, bp /* &w */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter) } return (libc.Bool32(((*SrcCount)(unsafe.Pointer(bp+48 /* &cnt */)).FnThis > 0) || ((*SrcCount)(unsafe.Pointer(bp+48 /* &cnt */)).FnOther == 0))) @@ -85500,7 +86207,7 @@ func Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) // This will cause the expression to be deleted automatically when the // Parse object is destroyed, but the zero register number means that it // will not generate any code in the preamble. -func agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105464:12: */ +func agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106392:12: */ if (!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_TokenOnly | EP_Reduced))) != U32(0))) && ((*Expr)(unsafe.Pointer(pExpr)).FpAggInfo != uintptr(0)) { var pAggInfo uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo @@ -85533,7 +86240,7 @@ func agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { // Initialize a Walker object so that will persist AggInfo entries referenced // by the tree that is walked. -func Xsqlite3AggInfoPersistWalkerInit(tls *libc.TLS, pWalker uintptr, pParse uintptr) { /* sqlite3.c:105502:21: */ +func Xsqlite3AggInfoPersistWalkerInit(tls *libc.TLS, pWalker uintptr, pParse uintptr) { /* sqlite3.c:106430:21: */ libc.Xmemset(tls, pWalker, 0, uint64(unsafe.Sizeof(Walker{}))) (*Walker)(unsafe.Pointer(pWalker)).FpParse = pParse (*Walker)(unsafe.Pointer(pWalker)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { @@ -85546,7 +86253,7 @@ func Xsqlite3AggInfoPersistWalkerInit(tls *libc.TLS, pWalker uintptr, pParse uin // 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 *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:105513:12: */ +func addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:106441:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -85563,7 +86270,7 @@ func addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlit // 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 *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:105529:12: */ +func addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:106457:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -85581,7 +86288,7 @@ func addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3 // This is the xExprCallback for a tree walker. It is used to // implement sqlite3ExprAnalyzeAggregates(). See sqlite3ExprAnalyzeAggregates // for additional information. -func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105546:12: */ +func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106474:12: */ var i int32 var pNC uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pParse uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpParse @@ -85606,7 +86313,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* { var pCol uintptr - if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor { + if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer(pItem)).FiCursor { // If we reach this point, it means that pExpr refers to a table // that is in the FROM clause of the aggregate query. // @@ -85679,7 +86386,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* // pAggInfo->aCol[] entry. (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_AGG_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_AGG_COLUMN) (*Expr)(unsafe.Pointer(pExpr)).FiAgg = I16(k) goto __3 } // endif pExpr->iTable==pItem->iCursor @@ -85740,7 +86447,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* } return 0 }(), enc, uint8(0)) - if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_Distinct) != 0 { + if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_Distinct)) != 0 { (*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) } else { (*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = -1 @@ -85768,7 +86475,7 @@ func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* // // This routine should only be called after the expression has been // analyzed by sqlite3ResolveExprNames(). -func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr) { /* sqlite3.c:105682:21: */ +func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr) { /* sqlite3.c:106610:21: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -85794,7 +86501,7 @@ func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr) { // expression list. Return the number of errors. // // If an error is found, the analysis is cut short. -func Xsqlite3ExprAnalyzeAggList(tls *libc.TLS, pNC uintptr, pList uintptr) { /* sqlite3.c:105700:21: */ +func Xsqlite3ExprAnalyzeAggList(tls *libc.TLS, pNC uintptr, pList uintptr) { /* sqlite3.c:106628:21: */ var pItem uintptr var i int32 if pList != 0 { @@ -85819,26 +86526,26 @@ func Xsqlite3ExprAnalyzeAggList(tls *libc.TLS, pNC uintptr, pList uintptr) { /* } // Allocate a single new register for use to hold some intermediate result. -func Xsqlite3GetTempReg(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:105713:20: */ +func Xsqlite3GetTempReg(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:106641:20: */ if int32((*Parse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { return libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) } - return *(*int32)(unsafe.Pointer((pParse + 212 /* &.aTempReg */) + uintptr(libc.PreDecUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4)) + return *(*int32)(unsafe.Pointer((pParse + 208 /* &.aTempReg */) + uintptr(libc.PreDecUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4)) } // Deallocate a register, making available for reuse for some other // purpose. -func Xsqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { /* sqlite3.c:105724:21: */ +func Xsqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { /* sqlite3.c:106652:21: */ if iReg != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FnTempReg) < (int32(uint64(unsafe.Sizeof([8]int32{})) / uint64(unsafe.Sizeof(int32(0))))) { - *(*int32)(unsafe.Pointer((pParse + 212 /* &.aTempReg */) + uintptr(libc.PostIncUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4)) = iReg + *(*int32)(unsafe.Pointer((pParse + 208 /* &.aTempReg */) + uintptr(libc.PostIncUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4)) = iReg } } } // Allocate or deallocate a block of nReg consecutive registers. -func Xsqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) int32 { /* sqlite3.c:105736:20: */ +func Xsqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) int32 { /* sqlite3.c:106664:20: */ var i int32 var n int32 if nReg == 1 { @@ -85856,7 +86563,7 @@ func Xsqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) int32 { /* return i } -func Xsqlite3ReleaseTempRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { /* sqlite3.c:105750:21: */ +func Xsqlite3ReleaseTempRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { /* sqlite3.c:106678:21: */ if nReg == 1 { Xsqlite3ReleaseTempReg(tls, pParse, iReg) return @@ -85874,7 +86581,7 @@ func Xsqlite3ReleaseTempRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg in // that might be invoked from other parts of the code, to ensure that // the sub/co-routine does not use registers in common with the code that // invokes the sub/co-routine. -func Xsqlite3ClearTempRegCache(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:105770:21: */ +func Xsqlite3ClearTempRegCache(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:106698:21: */ (*Parse)(unsafe.Pointer(pParse)).FnTempReg = U8(0) (*Parse)(unsafe.Pointer(pParse)).FnRangeReg = 0 } @@ -85908,14 +86615,14 @@ func Xsqlite3ClearTempRegCache(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:105 // 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 isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:105830:12: */ +func isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:106758:12: */ bp := tls.Alloc(8) defer tls.Free(8) - if (0 == Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10128 /* "sqlite_" */, 7)) || - ((((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Shadow) != U32(0)) && + if (0 == Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10221 /* "sqlite_" */, 7)) || + ((((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Shadow)) != U32(0)) && (Xsqlite3ReadOnlyShadowTables(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb) != 0)) { - Xsqlite3ErrorMsg(tls, pParse, ts+10136 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+10229 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) return 1 } return 0 @@ -85926,40 +86633,41 @@ func isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sq // called at the end of the generation of an ALTER TABLE ... RENAME ... // statement to ensure that the operation has not rendered any schema // objects unusable. -func renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { /* sqlite3.c:105851:13: */ - bp := tls.Alloc(32) - defer tls.Free(32) +func renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr) { /* sqlite3.c:106779:13: */ + bp := tls.Alloc(48) + defer tls.Free(48) + (*Parse)(unsafe.Pointer(pParse)).FcolNamesSet = U8(1) Xsqlite3NestedParse(tls, pParse, - ts+10164, /* "SELECT 1 FROM \"%..." */ + ts+10257, /* "SELECT 1 FROM \"%..." */ libc.VaList(bp, zDb, - zDb, bTemp)) + zDb, bTemp, zWhen)) if bTemp == 0 { Xsqlite3NestedParse(tls, pParse, - ts+10331, /* "SELECT 1 FROM te..." */ - libc.VaList(bp+24, zDb)) + ts+10428, /* "SELECT 1 FROM te..." */ + libc.VaList(bp+32, zDb, zWhen)) } } // Generate code to reload the schema for database iDb. And, if iDb!=1, for // the temp database as well. -func renameReloadSchema(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:105878:13: */ +func renameReloadSchema(tls *libc.TLS, pParse uintptr, iDb int32, p5 U16) { /* sqlite3.c:106812:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe if v != 0 { Xsqlite3ChangeCookie(tls, pParse, iDb) - Xsqlite3VdbeAddParseSchemaOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iDb, uintptr(0)) + Xsqlite3VdbeAddParseSchemaOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iDb, uintptr(0), p5) if iDb != 1 { - Xsqlite3VdbeAddParseSchemaOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, 1, uintptr(0)) + Xsqlite3VdbeAddParseSchemaOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, 1, uintptr(0), p5) } } } // Generate code to implement the "ALTER TABLE xxx RENAME TO yyy" // command. -func Xsqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr) { /* sqlite3.c:105891:21: */ +func Xsqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr) { /* sqlite3.c:106825:21: */ bp := tls.Alloc(184) defer tls.Free(184) @@ -85995,7 +86703,7 @@ __2: ; iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema) zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_PreferBuiltin) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_PreferBuiltin)) // Get a NULL terminated version of the new table name. zName = Xsqlite3NameFromToken(tls, db, pName) @@ -86014,7 +86722,7 @@ __3: goto __4 } Xsqlite3ErrorMsg(tls, pParse, - ts+10497 /* "there is already..." */, libc.VaList(bp, zName)) + ts+10598 /* "there is already..." */, libc.VaList(bp, zName)) goto exit_rename_table __4: ; @@ -86027,7 +86735,7 @@ __4: goto exit_rename_table __5: ; - if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+8236 /* "table" */, zName)) { + if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+8329 /* "table" */, zName)) { goto __6 } goto exit_rename_table @@ -86037,7 +86745,7 @@ __6: if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) { goto __7 } - Xsqlite3ErrorMsg(tls, pParse, ts+10556 /* "view %s may not ..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+10657 /* "view %s may not ..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table __7: ; @@ -86090,24 +86798,24 @@ __12: // the schema to use the new table name. Xsqlite3NestedParse(tls, pParse, - ts+10583 /* "UPDATE \"%w\".sqli..." */, libc.VaList(bp+16, zDb, zDb, zTabName, zName, (libc.Bool32(iDb == 1)), zTabName)) + ts+10684 /* "UPDATE \"%w\".sqli..." */, libc.VaList(bp+16, zDb, zDb, zTabName, zName, (libc.Bool32(iDb == 1)), zTabName)) // Update the tbl_name and name columns of the sqlite_schema table // as required. Xsqlite3NestedParse(tls, pParse, - ts+10767, /* "UPDATE %Q.sqlite..." */ + ts+10868, /* "UPDATE %Q.sqlite..." */ libc.VaList(bp+64, zDb, zName, zName, zName, nTabName, zTabName)) // If the sqlite_sequence table exists in this database, then update // it with the new table name. - if !(Xsqlite3FindTable(tls, db, ts+11072 /* "sqlite_sequence" */, zDb) != 0) { + if !(Xsqlite3FindTable(tls, db, ts+11173 /* "sqlite_sequence" */, zDb) != 0) { goto __13 } Xsqlite3NestedParse(tls, pParse, - ts+11088, /* "UPDATE \"%w\".sqli..." */ + ts+11189, /* "UPDATE \"%w\".sqli..." */ libc.VaList(bp+112, zDb, zName, (*Table)(unsafe.Pointer(pTab)).FzName)) __13: ; @@ -86120,7 +86828,7 @@ __13: } Xsqlite3NestedParse(tls, pParse, - ts+11146 /* "UPDATE sqlite_te..." */, libc.VaList(bp+136, zDb, zTabName, zName, zTabName, zDb, zName)) + ts+11247 /* "UPDATE sqlite_te..." */, libc.VaList(bp+136, zDb, zTabName, zName, zTabName, zDb, zName)) __14: ; @@ -86137,8 +86845,8 @@ __14: __15: ; - renameReloadSchema(tls, pParse, iDb) - renameTestSchema(tls, pParse, zDb, (libc.Bool32(iDb == 1))) + renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) + renameTestSchema(tls, pParse, zDb, (libc.Bool32(iDb == 1)), ts+11511 /* "after rename" */) exit_rename_table: Xsqlite3SrcListDelete(tls, db, pSrc) @@ -86148,12 +86856,12 @@ exit_rename_table: // Write code that will raise an error if the table described by // zDb and zTab is not empty. -func sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { /* sqlite3.c:106064:13: */ +func sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { /* sqlite3.c:106998:13: */ bp := tls.Alloc(24) defer tls.Free(24) Xsqlite3NestedParse(tls, pParse, - ts+11400, /* "SELECT raise(ABO..." */ + ts+11524, /* "SELECT raise(ABO..." */ libc.VaList(bp, zErr, zDb, zTab)) } @@ -86163,7 +86871,7 @@ func sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uin // // The Table structure pParse->pNewTable was extended to include // the new column during parsing. -func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr) { /* sqlite3.c:106084:21: */ +func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr) { /* sqlite3.c:107018:21: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -86201,12 +86909,12 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr // If there is a NOT NULL constraint, then the default value for the // column must not be NULL. if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_PRIMKEY) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+11438 /* "Cannot add a PRI..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+11562 /* "Cannot add a PRI..." */, 0) return } if (*Table)(unsafe.Pointer(pNew)).FpIndex != 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+11470 /* "Cannot add a UNI..." */, 0) + ts+11594 /* "Cannot add a UNI..." */, 0) return } if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_GENERATED) == 0 { @@ -86217,13 +86925,13 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr if (pDflt != 0) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pDflt)).FpLeft)).Fop) == TK_NULL) { pDflt = uintptr(0) } - if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) && ((*Table)(unsafe.Pointer(pNew)).FpFKey != 0)) && (pDflt != 0) { + if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) && ((*Table)(unsafe.Pointer(pNew)).FpFKey != 0)) && (pDflt != 0) { sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, - ts+11497 /* "Cannot add a REF..." */) + ts+11621 /* "Cannot add a REF..." */) } if ((*Column)(unsafe.Pointer(pCol)).FnotNull != 0) && !(pDflt != 0) { sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, - ts+11556 /* "Cannot add a NOT..." */) + ts+11680 /* "Cannot add a NOT..." */) } // Ensure the default expression is something that sqlite3ValueFromExpr() @@ -86231,7 +86939,7 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr if pDflt != 0 { *(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */)) = uintptr(0) var rc int32 - rc = Xsqlite3ValueFromExpr(tls, db, pDflt, SQLITE_UTF8, SQLITE_AFF_BLOB, bp+40 /* &pVal */) + rc = Xsqlite3ValueFromExpr(tls, db, pDflt, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp+40 /* &pVal */) if rc != SQLITE_OK { @@ -86239,12 +86947,12 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } if !(*(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */)) != 0) { sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, - ts+11609 /* "Cannot add a col..." */) + ts+11733 /* "Cannot add a col..." */) } Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */))) } } else if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_STORED) != 0 { - sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, ts+11655 /* "cannot add a STO..." */) + sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, ts+11779 /* "cannot add a STO..." */) } // Modify the CREATE TABLE statement. @@ -86255,11 +86963,13 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr for (zEnd > zCol) && ((int32(*(*int8)(unsafe.Pointer(zEnd))) == ';') || ((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zEnd)))]) & 0x01) != 0)) { *(*int8)(unsafe.Pointer(libc.PostDecUintptr(&zEnd, 1))) = int8(0) } - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_PreferBuiltin) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_PreferBuiltin)) + // substr() operations on characters, but addColOffset is in bytes. So we + // have to use printf() to translate between these units: Xsqlite3NestedParse(tls, pParse, - ts+11682, /* "UPDATE \"%w\".sqli..." */ - libc.VaList(bp, zDb, (*Table)(unsafe.Pointer(pNew)).FaddColOffset, zCol, ((*Table)(unsafe.Pointer(pNew)).FaddColOffset+1), + ts+11806, /* "UPDATE \"%w\".sqli..." */ + libc.VaList(bp, zDb, (*Table)(unsafe.Pointer(pNew)).FaddColOffset, zCol, (*Table)(unsafe.Pointer(pNew)).FaddColOffset, zTab)) Xsqlite3DbFree(tls, db, zCol) (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags = savedDbFlags @@ -86281,7 +86991,7 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } // Reload the table definition - renameReloadSchema(tls, pParse, iDb) + renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) } // This function is called by the parser after the table-name in @@ -86297,7 +87007,7 @@ func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr // // Routine sqlite3AlterFinishAddColumn() will be called to complete // coding the "ALTER TABLE ... ADD" statement. -func Xsqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { /* sqlite3.c:106229:21: */ +func Xsqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { /* sqlite3.c:107166:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -86329,7 +87039,7 @@ __2: if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { goto __3 } - Xsqlite3ErrorMsg(tls, pParse, ts+11802 /* "virtual tables m..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+11952 /* "virtual tables m..." */, 0) goto exit_begin_add_column __3: ; @@ -86338,7 +87048,7 @@ __3: if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) { goto __4 } - Xsqlite3ErrorMsg(tls, pParse, ts+11836 /* "Cannot add a col..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+11986 /* "Cannot add a col..." */, 0) goto exit_begin_add_column __4: ; @@ -86373,7 +87083,7 @@ __6: nAlloc = ((((int32((*Table)(unsafe.Pointer(pNew)).FnCol) - 1) / 8) * 8) + 8) (*Table)(unsafe.Pointer(pNew)).FaCol = Xsqlite3DbMallocZero(tls, db, (uint64(uint64(unsafe.Sizeof(Column{})) * uint64(nAlloc)))) - (*Table)(unsafe.Pointer(pNew)).FzName = Xsqlite3MPrintf(tls, db, ts+11866 /* "sqlite_altertab_..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + (*Table)(unsafe.Pointer(pNew)).FzName = Xsqlite3MPrintf(tls, db, ts+12016 /* "sqlite_altertab_..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) if !(!(int32((*Table)(unsafe.Pointer(pNew)).FaCol) != 0) || !(int32((*Table)(unsafe.Pointer(pNew)).FzName) != 0)) { goto __7 } @@ -86414,20 +87124,26 @@ exit_begin_add_column: // it loads an error message into pParse and returns non-zero. // // Or, if pTab is not a view or virtual table, zero is returned. -func isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:106311:12: */ - bp := tls.Alloc(16) - defer tls.Free(16) +func isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) int32 { /* sqlite3.c:107248:12: */ + bp := tls.Alloc(24) + defer tls.Free(24) var zType uintptr = uintptr(0) if (*Table)(unsafe.Pointer(pTab)).FpSelect != 0 { - zType = ts + 11885 /* "view" */ + zType = ts + 12035 /* "view" */ } if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { - zType = ts + 11890 /* "virtual table" */ + zType = ts + 12040 /* "virtual table" */ } if zType != 0 { - Xsqlite3ErrorMsg(tls, - pParse, ts+11904 /* "cannot rename co..." */, libc.VaList(bp, zType, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+12054, /* "cannot %s %s \"%s..." */ + libc.VaList(bp, func() uintptr { + if bDrop != 0 { + return ts + 12072 /* "drop column from" */ + } + return ts + 12089 /* "rename columns o..." */ + }(), + zType, (*Table)(unsafe.Pointer(pTab)).FzName)) return 1 } return 0 @@ -86436,7 +87152,7 @@ func isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3 // Handles the following parser reduction: // // cmd ::= ALTER TABLE pSrc RENAME COLUMN pOld TO pNew -func Xsqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld uintptr, pNew uintptr) { /* sqlite3.c:106340:21: */ +func Xsqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld uintptr, pNew uintptr) { /* sqlite3.c:107278:21: */ bp := tls.Alloc(112) defer tls.Free(112) @@ -86468,7 +87184,7 @@ __1: goto exit_rename_column __2: ; - if !(SQLITE_OK != isRealTable(tls, pParse, pTab)) { + if !(SQLITE_OK != isRealTable(tls, pParse, pTab, 0)) { goto __3 } goto exit_rename_column @@ -86518,7 +87234,7 @@ __8: if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { goto __10 } - Xsqlite3ErrorMsg(tls, pParse, ts+7968 /* "no such column: ..." */, libc.VaList(bp, zOld)) + Xsqlite3ErrorMsg(tls, pParse, ts+8061 /* "no such column: ..." */, libc.VaList(bp, zOld)) goto exit_rename_column __10: ; @@ -86538,19 +87254,19 @@ __11: bQuote = (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(pNew)).Fz)))]) & 0x80) Xsqlite3NestedParse(tls, pParse, - ts+11937, /* "UPDATE \"%w\".sqli..." */ + ts+12107, /* "UPDATE \"%w\".sqli..." */ libc.VaList(bp+8, zDb, zDb, (*Table)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, (libc.Bool32(iSchema == 1)), (*Table)(unsafe.Pointer(pTab)).FzName)) Xsqlite3NestedParse(tls, pParse, - ts+12155, /* "UPDATE temp.sqli..." */ + ts+12325, /* "UPDATE temp.sqli..." */ libc.VaList(bp+72, zDb, (*Table)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) // Drop and reload the database schema. - renameReloadSchema(tls, pParse, iSchema) - renameTestSchema(tls, pParse, zDb, (libc.Bool32(iSchema == 1))) + renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) + renameTestSchema(tls, pParse, zDb, (libc.Bool32(iSchema == 1)), ts+11511 /* "after rename" */) exit_rename_column: Xsqlite3SrcListDelete(tls, db, pSrc) @@ -86561,7 +87277,7 @@ exit_rename_column: // The context of an ALTER TABLE RENAME COLUMN operation that gets passed // down into the Walker. -type RenameCtx = RenameCtx1 /* sqlite3.c:106452:26 */ +type RenameCtx = RenameCtx1 /* sqlite3.c:107390:26 */ // Remember that the parser tree element pPtr was created using // the token pToken. @@ -86573,7 +87289,7 @@ type RenameCtx = RenameCtx1 /* sqlite3.c:106452:26 */ // The pPtr argument is returned so that this routine can be used // with tail recursion in tokenExpr() routine, for a small performance // improvement. -func Xsqlite3RenameTokenMap(tls *libc.TLS, pParse uintptr, pPtr uintptr, pToken uintptr) uintptr { /* sqlite3.c:106513:21: */ +func Xsqlite3RenameTokenMap(tls *libc.TLS, pParse uintptr, pPtr uintptr, pToken uintptr) uintptr { /* sqlite3.c:107451:21: */ var pNew uintptr if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_UNMAP { @@ -86592,7 +87308,7 @@ func Xsqlite3RenameTokenMap(tls *libc.TLS, pParse uintptr, pPtr uintptr, pToken // It is assumed that there is already a RenameToken object associated // with parse tree element pFrom. This function remaps the associated token // to parse tree element pTo. -func Xsqlite3RenameTokenRemap(tls *libc.TLS, pParse uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:106535:21: */ +func Xsqlite3RenameTokenRemap(tls *libc.TLS, pParse uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:107473:21: */ var p uintptr for p = (*Parse)(unsafe.Pointer(pParse)).FpRename; p != 0; p = (*RenameToken)(unsafe.Pointer(p)).FpNext { @@ -86604,7 +87320,7 @@ func Xsqlite3RenameTokenRemap(tls *libc.TLS, pParse uintptr, pTo uintptr, pFrom } // Walker callback used by sqlite3RenameExprUnmap(). -func renameUnmapExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106549:12: */ +func renameUnmapExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107487:12: */ var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr) return WRC_Continue @@ -86612,7 +87328,7 @@ func renameUnmapExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* // Iterate through the Select objects that are part of WITH clauses attached // to select statement pSelect. -func renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:106559:13: */ +func renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:107497:13: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -86620,20 +87336,20 @@ func renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite if pWith != 0 { var i int32 for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ { - var p uintptr = (*Cte)(unsafe.Pointer((pWith + 16 /* &.a */) + uintptr(i)*32)).FpSelect + var p uintptr = (*Cte)(unsafe.Pointer((pWith + 16 /* &.a */) + uintptr(i)*48)).FpSelect // var sNC NameContext at bp, 56 libc.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = (*Walker)(unsafe.Pointer(pWalker)).FpParse Xsqlite3SelectPrep(tls, (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse, p, bp /* &sNC */) Xsqlite3WalkSelect(tls, pWalker, p) - Xsqlite3RenameExprlistUnmap(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, (*Cte)(unsafe.Pointer((pWith+16 /* &.a */)+uintptr(i)*32)).FpCols) + Xsqlite3RenameExprlistUnmap(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, (*Cte)(unsafe.Pointer((pWith+16 /* &.a */)+uintptr(i)*48)).FpCols) } } } // Unmap all tokens in the IdList object passed as the second argument. -func unmapColumnIdlistNames(tls *libc.TLS, pParse uintptr, pIdList uintptr) { /* sqlite3.c:106578:13: */ +func unmapColumnIdlistNames(tls *libc.TLS, pParse uintptr, pIdList uintptr) { /* sqlite3.c:107516:13: */ if pIdList != 0 { var ii int32 for ii = 0; ii < (*IdList)(unsafe.Pointer(pIdList)).FnId; ii++ { @@ -86643,13 +87359,13 @@ func unmapColumnIdlistNames(tls *libc.TLS, pParse uintptr, pIdList uintptr) { /* } // Walker callback used by sqlite3RenameExprUnmap(). -func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:106593:12: */ +func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:107531:12: */ var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse var i int32 if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return WRC_Abort } - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_View) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_View)) != 0 { return WRC_Prune } if (*Select)(unsafe.Pointer(p)).FpEList != 0 { @@ -86663,11 +87379,11 @@ func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* s if (*Select)(unsafe.Pointer(p)).FpSrc != 0 { // Every Select as a SrcList, even if it is empty var pSrc uintptr = (*Select)(unsafe.Pointer(p)).FpSrc for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ { - Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FzName) - if Xsqlite3WalkExpr(tls, pWalker, (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpOn) != 0 { + Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FzName) + if Xsqlite3WalkExpr(tls, pWalker, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpOn) != 0 { return WRC_Abort } - unmapColumnIdlistNames(tls, pParse, (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpUsing) + unmapColumnIdlistNames(tls, pParse, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpUsing) } } @@ -86676,7 +87392,7 @@ func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* s } // Remove all nodes that are part of expression pExpr from the rename list. -func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:106622:21: */ +func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:107560:21: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -86691,14 +87407,14 @@ func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* (*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 }{renameUnmapSelectCb})) - (*Parse)(unsafe.Pointer(pParse)).FeParseMode = PARSE_MODE_UNMAP + (*Parse)(unsafe.Pointer(pParse)).FeParseMode = U8(PARSE_MODE_UNMAP) Xsqlite3WalkExpr(tls, bp /* &sWalker */, pExpr) (*Parse)(unsafe.Pointer(pParse)).FeParseMode = eMode } // Remove all nodes that are part of expression-list pEList from the // rename list. -func Xsqlite3RenameExprlistUnmap(tls *libc.TLS, pParse uintptr, pEList uintptr) { /* sqlite3.c:106638:21: */ +func Xsqlite3RenameExprlistUnmap(tls *libc.TLS, pParse uintptr, pEList uintptr) { /* sqlite3.c:107576:21: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -86721,7 +87437,7 @@ func Xsqlite3RenameExprlistUnmap(tls *libc.TLS, pParse uintptr, pEList uintptr) } // Free the list of RenameToken objects given in the second argument -func renameTokenFree(tls *libc.TLS, db uintptr, pToken uintptr) { /* sqlite3.c:106657:13: */ +func renameTokenFree(tls *libc.TLS, db uintptr, pToken uintptr) { /* sqlite3.c:107595:13: */ var pNext uintptr var p uintptr for p = pToken; p != 0; p = pNext { @@ -86731,29 +87447,35 @@ func renameTokenFree(tls *libc.TLS, db uintptr, pToken uintptr) { /* sqlite3.c:1 } // Search the Parse object passed as the first argument for a RenameToken -// object associated with parse tree element pPtr. If found, remove it -// from the Parse object and add it to the list maintained by the -// RenameCtx object passed as the second argument. -func renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) { /* sqlite3.c:106672:13: */ +// object associated with parse tree element pPtr. If found, return a pointer +// to it. Otherwise, return NULL. +// +// If the second argument passed to this function is not NULL and a matching +// RenameToken object is found, remove it from the Parse object and add it to +// the list maintained by the RenameCtx object. +func renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) uintptr { /* sqlite3.c:107613:20: */ var pp uintptr - for pp = (pParse + 416 /* &.pRename */); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 24 /* &.pNext */) { + for pp = (pParse + 400 /* &.pRename */); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 24 /* &.pNext */) { if (*RenameToken)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).Fp == pPtr { var pToken uintptr = *(*uintptr)(unsafe.Pointer(pp)) - *(*uintptr)(unsafe.Pointer(pp)) = (*RenameToken)(unsafe.Pointer(pToken)).FpNext - (*RenameToken)(unsafe.Pointer(pToken)).FpNext = (*RenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*RenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*RenameCtx1)(unsafe.Pointer(pCtx)).FnList++ - break + if pCtx != 0 { + *(*uintptr)(unsafe.Pointer(pp)) = (*RenameToken)(unsafe.Pointer(pToken)).FpNext + (*RenameToken)(unsafe.Pointer(pToken)).FpNext = (*RenameCtx1)(unsafe.Pointer(pCtx)).FpList + (*RenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken + (*RenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + } + return pToken } } + return uintptr(0) } // This is a Walker select callback. It does nothing. It is only required // because without a dummy callback, sqlite3WalkExpr() and similar do not // descend into sub-select statements. -func renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:106692:12: */ - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_View) != 0 { +func renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:107640:12: */ + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_View)) != 0 { return WRC_Prune } renameWalkWith(tls, pWalker, p) @@ -86767,7 +87489,7 @@ func renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* // ALTER TABLE statement. If it is, then attach its associated // RenameToken object to the list of RenameToken objects being // constructed in RenameCtx object at pWalker->u.pRename. -func renameColumnExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106707:12: */ +func renameColumnExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107655:12: */ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_TRIGGER) && (int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*RenameCtx)(unsafe.Pointer(p)).FiCol)) && @@ -86788,7 +87510,7 @@ func renameColumnExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { / // the input SQL is parsed from left to right. Repeated calls to this routine // return all column name tokens in the order that they are encountered // in the SQL statement. -func renameColumnTokenNext(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:106732:20: */ +func renameColumnTokenNext(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:107680:20: */ var pBest uintptr = (*RenameCtx)(unsafe.Pointer(pCtx)).FpList var pToken uintptr var pp uintptr @@ -86810,21 +87532,21 @@ func renameColumnTokenNext(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:1 // ALTER TABLE RENAME COLUMN program. The error message emitted by the // sub-routine is currently stored in pParse->zErrMsg. This function // adds context to the error message and then stores it in pCtx. -func renameColumnParseError(tls *libc.TLS, pCtx uintptr, bPost int32, pType uintptr, pObject uintptr, pParse uintptr) { /* sqlite3.c:106753:13: */ - bp := tls.Alloc(32) - defer tls.Free(32) +func renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType uintptr, pObject uintptr, pParse uintptr) { /* sqlite3.c:107701:13: */ + bp := tls.Alloc(40) + defer tls.Free(40) var zT uintptr = Xsqlite3_value_text(tls, pType) var zN uintptr = Xsqlite3_value_text(tls, pObject) var zErr uintptr - zErr = Xsqlite3_mprintf(tls, ts+12286, /* "error in %s %s%s..." */ + zErr = Xsqlite3_mprintf(tls, ts+12456, /* "error in %s %s%s..." */ libc.VaList(bp, zT, zN, func() uintptr { - if bPost != 0 { - return ts + 12307 /* " after rename" */ + if *(*int8)(unsafe.Pointer(zWhen)) != 0 { + return ts + 12479 /* " " */ } return ts + 800 /* "" */ - }(), + }(), zWhen, (*Parse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -1) Xsqlite3_free(tls, zErr) @@ -86834,7 +87556,7 @@ func renameColumnParseError(tls *libc.TLS, pCtx uintptr, bPost int32, pType uint // pEList->a[i].zName) that matches the string in zOld, extract the // corresponding rename-token from Parse object pParse and add it // to the RenameCtx pCtx. -func renameColumnElistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pEList uintptr, zOld uintptr) { /* sqlite3.c:106778:13: */ +func renameColumnElistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pEList uintptr, zOld uintptr) { /* sqlite3.c:107726:13: */ if pEList != 0 { var i int32 for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ { @@ -86851,7 +87573,7 @@ func renameColumnElistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pEList // For each name in the the id-list pIdList (i.e. each pIdList->a[i].zName) // that matches the string in zOld, extract the corresponding rename-token // from Parse object pParse and add it to the RenameCtx pCtx. -func renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdList uintptr, zOld uintptr) { /* sqlite3.c:106803:13: */ +func renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdList uintptr, zOld uintptr) { /* sqlite3.c:107751:13: */ if pIdList != 0 { var i int32 for i = 0; i < (*IdList)(unsafe.Pointer(pIdList)).FnId; i++ { @@ -86865,7 +87587,7 @@ func renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLis // Parse the SQL statement zSql using Parse object (*p). The Parse object // is initialized by this function before it is used. -func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) int32 { /* sqlite3.c:106825:12: */ +func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) int32 { /* sqlite3.c:107773:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -86883,10 +87605,14 @@ func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uint // occurs and the parse does not result in a new table, index or // trigger object, the database must be corrupt. libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Parse{}))) - (*Parse)(unsafe.Pointer(p)).FeParseMode = PARSE_MODE_RENAME + (*Parse)(unsafe.Pointer(p)).FeParseMode = U8(PARSE_MODE_RENAME) (*Parse)(unsafe.Pointer(p)).Fdb = db (*Parse)(unsafe.Pointer(p)).FnQueryLoop = U32(1) - rc = Xsqlite3RunParser(tls, p, zSql, bp /* &zErr */) + if zSql != 0 { + rc = Xsqlite3RunParser(tls, p, zSql, bp /* &zErr */) + } else { + rc = SQLITE_NOMEM + } (*Parse)(unsafe.Pointer(p)).FzErrMsg = *(*uintptr)(unsafe.Pointer(bp /* zErr */)) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -86894,7 +87620,7 @@ func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uint } if (((rc == SQLITE_OK) && ((*Parse)(unsafe.Pointer(p)).FpNewTable == uintptr(0))) && ((*Parse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0))) && ((*Parse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = Xsqlite3CorruptError(tls, 106852) + rc = Xsqlite3CorruptError(tls, 107800) } (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(0) @@ -86908,7 +87634,7 @@ func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uint // // Or, if an error occurs (i.e. an OOM condition), an error is left in // pCtx and an SQLite error code returned. -func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zNew uintptr, bQuote int32) int32 { /* sqlite3.c:106880:12: */ +func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zNew uintptr, bQuote int32) int32 { /* sqlite3.c:107828:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -86925,7 +87651,7 @@ func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, z // ALTER TABLE statement was quoted (bQuote==1), then set zNew to // point to zQuot so that all substitutions are made using the // quoted version of the new column name. - zQuot = Xsqlite3MPrintf(tls, db, ts+12321 /* "\"%w\"" */, libc.VaList(bp, zNew)) + zQuot = Xsqlite3MPrintf(tls, db, ts+12481 /* "\"%w\"" */, libc.VaList(bp, zNew)) if zQuot == uintptr(0) { return SQLITE_NOMEM } else { @@ -86983,7 +87709,7 @@ func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, z // it was read from the schema of database zDb. Return SQLITE_OK if // successful. Otherwise, return an SQLite error code and leave an error // message in the Parse object. -func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:106962:12: */ +func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:107910:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -87024,13 +87750,20 @@ func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:10 var i int32 for i = 0; (i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc) && (rc == SQLITE_OK); i++ { var p uintptr = ((pSrc + 8 /* &.a */) + uintptr(i)*112) - (*SrcList_item)(unsafe.Pointer(p)).FpTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), p) - (*SrcList_item)(unsafe.Pointer(p)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) - if (*SrcList_item)(unsafe.Pointer(p)).FpTab == uintptr(0) { - rc = SQLITE_ERROR + (*SrcItem)(unsafe.Pointer(p)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + if (*SrcItem)(unsafe.Pointer(p)).FpSelect != 0 { + Xsqlite3SelectPrep(tls, pParse, (*SrcItem)(unsafe.Pointer(p)).FpSelect, uintptr(0)) + Xsqlite3ExpandSubquery(tls, pParse, p) + + Xsqlite3SelectPrep(tls, pParse, (*SrcItem)(unsafe.Pointer(((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom+8 /* &.a */)+uintptr((i-1))*112)).FpSelect, uintptr(0)) } else { - (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(p)).FpTab)).FnTabRef++ - rc = Xsqlite3ViewGetColumnNames(tls, pParse, (*SrcList_item)(unsafe.Pointer(p)).FpTab) + (*SrcItem)(unsafe.Pointer(p)).FpTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), p) + if (*SrcItem)(unsafe.Pointer(p)).FpTab == uintptr(0) { + rc = SQLITE_ERROR + } else { + (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(p)).FpTab)).FnTabRef++ + rc = Xsqlite3ViewGetColumnNames(tls, pParse, (*SrcItem)(unsafe.Pointer(p)).FpTab) + } } } (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = pSrc @@ -87041,9 +87774,8 @@ func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:10 rc = Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList) } - if (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0 { + if ((*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0) && (rc == SQLITE_OK) { var pUpsert uintptr = (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert - (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc = pSrc *(*uintptr)(unsafe.Pointer(bp /* &sNC */ + 16 /* &.uNC */)) = pUpsert (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags = NC_UUpsert @@ -87072,7 +87804,7 @@ func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:10 // Invoke sqlite3WalkExpr() or sqlite3WalkSelect() on all Select or Expr // objects that are part of the trigger passed as the second argument. -func renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) { /* sqlite3.c:107048:13: */ +func renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) { /* sqlite3.c:108003:13: */ var pStep uintptr // Find tokens to edit in WHEN clause @@ -87090,12 +87822,18 @@ func renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) { /* sq Xsqlite3WalkExpr(tls, pWalker, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertWhere) Xsqlite3WalkExpr(tls, pWalker, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere) } + if (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 { + var i int32 + for i = 0; i < (*SrcList)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom)).FnSrc; i++ { + Xsqlite3WalkSelect(tls, pWalker, (*SrcItem)(unsafe.Pointer(((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom+8 /* &.a */)+uintptr(i)*112)).FpSelect) + } + } } } // Free the contents of Parse object (*pParse). Do not free the memory // occupied by the Parse object itself. -func renameParseCleanup(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:107073:13: */ +func renameParseCleanup(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:108034:13: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pIdx uintptr if (*Parse)(unsafe.Pointer(pParse)).FpVdbe != 0 { @@ -87133,9 +87871,9 @@ func renameParseCleanup(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:107073:13: // This function is used internally by the ALTER TABLE RENAME COLUMN command. // It is only accessible to SQL created using sqlite3NestedParse(). It is // not reachable from ordinary SQL passed into sqlite3_prepare(). -func renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:107113:13: */ - bp := tls.Alloc(504) - defer tls.Free(504) +func renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:108074:13: */ + bp := tls.Alloc(488) + defer tls.Free(488) var db uintptr // var sCtx RenameCtx at bp, 32 @@ -87149,9 +87887,9 @@ func renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt var bTemp int32 var zOld uintptr var rc int32 - // var sParse Parse at bp+32, 424 + // var sParse Parse at bp+32, 408 - // var sWalker Walker at bp+456, 48 + // var sWalker Walker at bp+440, 48 var pIdx uintptr var i int32 @@ -87222,15 +87960,15 @@ __5: rc = renameParseSql(tls, bp+32 /* &sParse */, zDb, db, zSql, bTemp) // Find tokens that need to be replaced. - libc.Xmemset(tls, bp+456 /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{}))) - (*Walker)(unsafe.Pointer(bp + 456 /* &sWalker */)).FpParse = bp + 32 /* &sParse */ - (*Walker)(unsafe.Pointer(bp + 456 /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { + libc.Xmemset(tls, bp+440 /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{}))) + (*Walker)(unsafe.Pointer(bp + 440 /* &sWalker */)).FpParse = bp + 32 /* &sParse */ + (*Walker)(unsafe.Pointer(bp + 440 /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 }{renameColumnExprCb})) - (*Walker)(unsafe.Pointer(bp + 456 /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { + (*Walker)(unsafe.Pointer(bp + 440 /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 }{renameColumnSelectCb})) - *(*uintptr)(unsafe.Pointer(bp + 456 /* &sWalker */ + 40 /* &.u */)) = bp /* &sCtx */ + *(*uintptr)(unsafe.Pointer(bp + 440 /* &sWalker */ + 40 /* &.u */)) = bp /* &sCtx */ (*RenameCtx)(unsafe.Pointer(bp /* &sCtx */)).FpTab = pTab if !(rc != SQLITE_OK) { @@ -87258,7 +87996,7 @@ __6: if !(rc == SQLITE_OK) { goto __11 } - Xsqlite3WalkSelect(tls, bp+456 /* &sWalker */, pSelect) + Xsqlite3WalkSelect(tls, bp+440 /* &sWalker */, pSelect) __11: ; if !(rc != SQLITE_OK) { @@ -87284,13 +88022,13 @@ __9: renameTokenFind(tls, bp+32 /* &sParse */, bp /* &sCtx */, ((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTable + 68 /* &.iPKey */)) __14: ; - Xsqlite3WalkExprList(tls, bp+456 /* &sWalker */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTable)).FpCheck) + Xsqlite3WalkExprList(tls, bp+440 /* &sWalker */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTable)).FpCheck) pIdx = (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp + 32 /* &sParse */)).FpNewTable)).FpIndex __15: if !(pIdx != 0) { goto __17 } - Xsqlite3WalkExprList(tls, bp+456 /* &sWalker */, (*Index)(unsafe.Pointer(pIdx)).FaColExpr) + Xsqlite3WalkExprList(tls, bp+440 /* &sWalker */, (*Index)(unsafe.Pointer(pIdx)).FaColExpr) goto __16 __16: pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext @@ -87303,7 +88041,7 @@ __18: if !(pIdx != 0) { goto __20 } - Xsqlite3WalkExprList(tls, bp+456 /* &sWalker */, (*Index)(unsafe.Pointer(pIdx)).FaColExpr) + Xsqlite3WalkExprList(tls, bp+440 /* &sWalker */, (*Index)(unsafe.Pointer(pIdx)).FaColExpr) goto __19 __19: pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext @@ -87318,7 +88056,7 @@ __21: if !(i < int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTable)).FnCol)) { goto __23 } - Xsqlite3WalkExpr(tls, bp+456 /* &sWalker */, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTable)).FaCol+uintptr(i)*32)).FpDflt) + Xsqlite3WalkExpr(tls, bp+440 /* &sWalker */, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTable)).FaCol+uintptr(i)*32)).FpDflt) goto __22 __22: i++ @@ -87371,8 +88109,8 @@ __7: if !((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewIndex != 0) { goto __32 } - Xsqlite3WalkExprList(tls, bp+456 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewIndex)).FaColExpr) - Xsqlite3WalkExpr(tls, bp+456 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewIndex)).FpPartIdxWhere) + Xsqlite3WalkExprList(tls, bp+440 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewIndex)).FaColExpr) + Xsqlite3WalkExpr(tls, bp+440 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewIndex)).FpPartIdxWhere) goto __33 __32: rc = renameResolveTrigger(tls, bp+32 /* &sParse */) @@ -87425,7 +88163,7 @@ __41: ; // Find tokens to edit in various expressions and selects - renameWalkTrigger(tls, bp+456 /* &sWalker */, (*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTrigger) + renameWalkTrigger(tls, bp+440 /* &sWalker */, (*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewTrigger) __33: ; __8: @@ -87440,7 +88178,7 @@ renameColumnFunc_done: if !((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FzErrMsg != 0) { goto __43 } - renameColumnParseError(tls, context, 0, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32 /* &sParse */) + renameColumnParseError(tls, context, ts+800 /* "" */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32 /* &sParse */) goto __44 __43: Xsqlite3_result_error_code(tls, context, rc) @@ -87456,7 +88194,7 @@ __42: } // Walker expression callback used by "RENAME TABLE". -func renameTableExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107274:12: */ +func renameTableExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:108235:12: */ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && ((*RenameCtx)(unsafe.Pointer(p)).FpTab == *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */))) { renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, (pExpr + 64 /* &.y */ /* &.pTab */)) @@ -87465,11 +88203,11 @@ func renameTableExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* } // Walker select callback used by "RENAME TABLE". -func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:107285:12: */ +func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:108246:12: */ var i int32 var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pSrc uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc - if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & SF_View) != 0 { + if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_View)) != 0 { return WRC_Prune } if pSrc == uintptr(0) { @@ -87478,8 +88216,8 @@ func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 } for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ { var pItem uintptr = ((pSrc + 8 /* &.a */) + uintptr(i)*112) - if (*SrcList_item)(unsafe.Pointer(pItem)).FpTab == (*RenameCtx)(unsafe.Pointer(p)).FpTab { - renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, (*SrcList_item)(unsafe.Pointer(pItem)).FzName) + if (*SrcItem)(unsafe.Pointer(pItem)).FpTab == (*RenameCtx)(unsafe.Pointer(p)).FpTab { + renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, (*SrcItem)(unsafe.Pointer(pItem)).FzName) } } renameWalkWith(tls, pWalker, pSelect) @@ -87504,9 +88242,9 @@ func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 // // sqlite_rename_table('main', 'CREATE TABLE t1(a REFERENCES t2)','t2','t3',0) // -> 'CREATE TABLE t1(a REFERENCES t3)' -func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:107325:13: */ - bp := tls.Alloc(560) - defer tls.Free(560) +func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:108286:13: */ + bp := tls.Alloc(544) + defer tls.Free(544) var db uintptr = Xsqlite3_context_db_handle(tls, context) var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -87517,7 +88255,7 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr _ = NotUsed if ((zInput != 0) && (zOld != 0)) && (zNew != 0) { - // var sParse Parse at bp+80, 424 + // var sParse Parse at bp+80, 408 var rc int32 var bQuote int32 = 1 @@ -87545,20 +88283,20 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr rc = renameParseSql(tls, bp+80 /* &sParse */, zDb, db, zInput, bTemp) if rc == SQLITE_OK { - var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyAlter)) + var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))) if (*Parse)(unsafe.Pointer(bp+80 /* &sParse */)).FpNewTable != 0 { var pTab uintptr = (*Parse)(unsafe.Pointer(bp + 80 /* &sParse */)).FpNewTable if (*Table)(unsafe.Pointer(pTab)).FpSelect != 0 { if isLegacy == 0 { var pSelect uintptr = (*Table)(unsafe.Pointer(pTab)).FpSelect - // var sNC NameContext at bp+504, 56 + // var sNC NameContext at bp+488, 56 - libc.Xmemset(tls, bp+504 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) - (*NameContext)(unsafe.Pointer(bp + 504 /* &sNC */)).FpParse = bp + 80 /* &sParse */ + libc.Xmemset(tls, bp+488 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) + (*NameContext)(unsafe.Pointer(bp + 488 /* &sNC */)).FpParse = bp + 80 /* &sParse */ *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_View))) - Xsqlite3SelectPrep(tls, bp+80 /* &sParse */, (*Table)(unsafe.Pointer(pTab)).FpSelect, bp+504 /* &sNC */) + Xsqlite3SelectPrep(tls, bp+80 /* &sParse */, (*Table)(unsafe.Pointer(pTab)).FpSelect, bp+488 /* &sNC */) if (*Parse)(unsafe.Pointer(bp+80 /* &sParse */)).FnErr != 0 { rc = (*Parse)(unsafe.Pointer(bp + 80 /* &sParse */)).Frc } else { @@ -87567,7 +88305,7 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr } } else { // Modify any FK definitions to point to the new table. - if (isLegacy == 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) { + if (isLegacy == 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) { var pFKey uintptr for pFKey = (*Table)(unsafe.Pointer(pTab)).FpFKey; pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextFrom { if Xsqlite3_stricmp(tls, (*FKey)(unsafe.Pointer(pFKey)).FzTo, zOld) == 0 { @@ -87619,7 +88357,7 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr } if rc != SQLITE_OK { if (*Parse)(unsafe.Pointer(bp+80 /* &sParse */)).FzErrMsg != 0 { - renameColumnParseError(tls, context, 0, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+80 /* &sParse */) + renameColumnParseError(tls, context, ts+800 /* "" */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+80 /* &sParse */) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -87645,21 +88383,23 @@ func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr // 2: Object type ("view", "table", "trigger" or "index"). // 3: Object name. // 4: True if object is from temp schema. +// 5: "when" part of error message. // // Unless it finds an error, this function normally returns NULL. However, it // returns integer value 1 if: // // * the SQL argument creates a trigger, and // * the table that the trigger is attached to is in database zDb. -func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:107482:13: */ - bp := tls.Alloc(480) - defer tls.Free(480) +func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:108444:13: */ + bp := tls.Alloc(464) + defer tls.Free(464) var db uintptr = Xsqlite3_context_db_handle(tls, context) var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) var zInput uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) var bTemp int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8))) - var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyAlter)) + var isLegacy int32 = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyAlter))) + var zWhen uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 5*8))) var xAuth Sqlite3_xauth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth (*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) @@ -87667,16 +88407,16 @@ func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr _ = NotUsed if (zDb != 0) && (zInput != 0) { var rc int32 - // var sParse Parse at bp, 424 + // var sParse Parse at bp, 408 rc = renameParseSql(tls, bp /* &sParse */, zDb, db, zInput, bTemp) if rc == SQLITE_OK { if ((isLegacy == 0) && ((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable != 0)) && ((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FpSelect != 0) { - // var sNC NameContext at bp+424, 56 + // var sNC NameContext at bp+408, 56 - libc.Xmemset(tls, bp+424 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) - (*NameContext)(unsafe.Pointer(bp + 424 /* &sNC */)).FpParse = bp /* &sParse */ - Xsqlite3SelectPrep(tls, bp /* &sParse */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FpSelect, bp+424 /* &sNC */) + libc.Xmemset(tls, bp+408 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) + (*NameContext)(unsafe.Pointer(bp + 408 /* &sNC */)).FpParse = bp /* &sParse */ + Xsqlite3SelectPrep(tls, bp /* &sParse */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FpSelect, bp+408 /* &sNC */) if (*Parse)(unsafe.Pointer(bp /* &sParse */)).FnErr != 0 { rc = (*Parse)(unsafe.Pointer(bp /* &sParse */)).Frc } @@ -87694,8 +88434,8 @@ func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr } } - if rc != SQLITE_OK { - renameColumnParseError(tls, context, 1, *(*uintptr)(unsafe.Pointer(argv + 2*8)), *(*uintptr)(unsafe.Pointer(argv + 3*8)), bp /* &sParse */) + if (rc != SQLITE_OK) && (zWhen != 0) { + renameColumnParseError(tls, context, zWhen, *(*uintptr)(unsafe.Pointer(argv + 2*8)), *(*uintptr)(unsafe.Pointer(argv + 3*8)), bp /* &sParse */) } renameParseCleanup(tls, bp /* &sParse */) } @@ -87703,15 +88443,296 @@ func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth } +// The implementation of internal UDF sqlite_drop_column(). +// +// Arguments: +// +// argv[0]: An integer - the index of the schema containing the table +// argv[1]: CREATE TABLE statement to modify. +// argv[2]: An integer - the index of the column to remove. +// +// The value returned is a string containing the CREATE TABLE statement +// with column argv[2] removed. +func dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:108510:13: */ + bp := tls.Alloc(432) + defer tls.Free(432) + + var db uintptr + var iSchema int32 + var zSql uintptr + var iCol int32 + var zDb uintptr + var rc int32 + // var sParse Parse at bp+24, 408 + + var pCol uintptr + var pTab uintptr + var zEnd uintptr + var zNew uintptr + var xAuth Sqlite3_xauth + var pEnd uintptr + db = Xsqlite3_context_db_handle(tls, context) + iSchema = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))) + zSql = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + iCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) + zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iSchema)*32)).FzDbSName + zNew = uintptr(0) + xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth + (*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) + + _ = NotUsed + rc = renameParseSql(tls, bp+24 /* &sParse */, zDb, db, zSql, (libc.Bool32(iSchema == 1))) + if !(rc != SQLITE_OK) { + goto __1 + } + goto drop_column_done +__1: + ; + pTab = (*Parse)(unsafe.Pointer(bp + 24 /* &sParse */)).FpNewTable + if !(((pTab == uintptr(0)) || (int32((*Table)(unsafe.Pointer(pTab)).FnCol) == 1)) || (iCol >= int32((*Table)(unsafe.Pointer(pTab)).FnCol))) { + goto __2 + } + // This can happen if the sqlite_schema table is corrupt + rc = Xsqlite3CorruptError(tls, 108538) + goto drop_column_done +__2: + ; + + pCol = renameTokenFind(tls, bp+24 /* &sParse */, uintptr(0), (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*32)).FzName) + if !(iCol < (int32((*Table)(unsafe.Pointer(pTab)).FnCol) - 1)) { + goto __3 + } + pEnd = renameTokenFind(tls, bp+24 /* &sParse */, uintptr(0), (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((iCol+1))*32)).FzName) + zEnd = (*RenameToken)(unsafe.Pointer(pEnd)).Ft.Fz + goto __4 +__3: + zEnd = (zSql + uintptr((*Table)(unsafe.Pointer(pTab)).FaddColOffset)) +__5: + if !((int32(*(*int8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz))) != 0) && (int32(*(*int8)(unsafe.Pointer((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz))) != ',')) { + goto __6 + } + (*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- + goto __5 +__6: + ; +__4: + ; + + zNew = Xsqlite3MPrintf(tls, db, ts+12486 /* "%.*s%s" */, libc.VaList(bp, ((int64((*RenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql))/1), zSql, zEnd)) + Xsqlite3_result_text(tls, context, zNew, -1, libc.UintptrFromInt32(-1)) + Xsqlite3_free(tls, zNew) + +drop_column_done: + renameParseCleanup(tls, bp+24 /* &sParse */) + (*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + if !(rc != SQLITE_OK) { + goto __7 + } + Xsqlite3_result_error_code(tls, context, rc) +__7: +} + +// This function is called by the parser upon parsing an +// +// ALTER TABLE pSrc DROP COLUMN pName +// +// statement. Argument pSrc contains the possibly qualified name of the +// table being edited, and token pName the name of the column to drop. +func Xsqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr) { /* sqlite3.c:108574:21: */ + bp := tls.Alloc(64) + defer tls.Free(64) + + var db uintptr // Database handle + var pTab uintptr // Table to modify + var iDb int32 // Index of db containing pTab in aDb[] + var zDb uintptr // Database containing pTab ("main" etc.) + var zCol uintptr // Name of column to drop + var iCol int32 + var iPos int32 + var iColPos int32 + var regOut int32 + var i int32 + var addr int32 + var reg int32 + var regRec int32 + var pPk uintptr + var nField int32 // Number of non-virtual columns after drop + var iCur int32 + var v uintptr + db = (*Parse)(unsafe.Pointer(pParse)).Fdb + zCol = uintptr(0) // Index of column zCol in pTab->aCol[] + + // Look up the table being altered. + + if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + goto __1 + } + goto exit_drop_column +__1: + ; + pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), (pSrc + 8 /* &.a */)) + if !(!(pTab != 0)) { + goto __2 + } + goto exit_drop_column +__2: + ; + + // Make sure this is not an attempt to ALTER a view, virtual table or + // system table. + if !(SQLITE_OK != isAlterableTable(tls, pParse, pTab)) { + goto __3 + } + goto exit_drop_column +__3: + ; + if !(SQLITE_OK != isRealTable(tls, pParse, pTab, 1)) { + goto __4 + } + goto exit_drop_column +__4: + ; + + // Find the index of the column being dropped. + zCol = Xsqlite3NameFromToken(tls, db, pName) + if !(zCol == uintptr(0)) { + goto __5 + } + + goto exit_drop_column +__5: + ; + iCol = Xsqlite3ColumnIndex(tls, pTab, zCol) + if !(iCol < 0) { + goto __6 + } + Xsqlite3ErrorMsg(tls, pParse, ts+8061 /* "no such column: ..." */, libc.VaList(bp, zCol)) + goto exit_drop_column +__6: + ; + + // Do not allow the user to drop a PRIMARY KEY column or a column + // constrained by a UNIQUE constraint. + if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*32)).FcolFlags) & (COLFLAG_PRIMKEY | COLFLAG_UNIQUE)) != 0) { + goto __7 + } + Xsqlite3ErrorMsg(tls, pParse, ts+12493, /* "cannot drop %s c..." */ + libc.VaList(bp+8, func() uintptr { + if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*32)).FcolFlags) & COLFLAG_PRIMKEY) != 0 { + return ts + 12521 /* "PRIMARY KEY" */ + } + return ts + 7882 /* "UNIQUE" */ + }(), + zCol)) + goto exit_drop_column +__7: + ; + + // Do not allow the number of columns to go to zero + if !(int32((*Table)(unsafe.Pointer(pTab)).FnCol) <= 1) { + goto __8 + } + Xsqlite3ErrorMsg(tls, pParse, ts+12533 /* "cannot drop colu..." */, libc.VaList(bp+24, zCol)) + goto exit_drop_column +__8: + ; + + // Edit the sqlite_schema table + iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) + + zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName + renameTestSchema(tls, pParse, zDb, (libc.Bool32(iDb == 1)), ts+800 /* "" */) + Xsqlite3NestedParse(tls, pParse, + + ts+12581 /* "UPDATE \"%w\".sqli..." */, libc.VaList(bp+32, zDb, iDb, iCol, (*Table)(unsafe.Pointer(pTab)).FzName)) + + // Drop and reload the database schema. + renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) + renameTestSchema(tls, pParse, zDb, (libc.Bool32(iDb == 1)), ts+12702 /* "after drop colum..." */) + + // Edit rows of table on disk + if !(((*Parse)(unsafe.Pointer(pParse)).FnErr == 0) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*32)).FcolFlags) & COLFLAG_VIRTUAL) == 0)) { + goto __9 + } + pPk = uintptr(0) + nField = 0 + v = Xsqlite3GetVdbe(tls, pParse) + iCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + Xsqlite3OpenTable(tls, pParse, iCur, iDb, pTab, OP_OpenWrite) + addr = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iCur) + reg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) + *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (int32((*Table)(unsafe.Pointer(pTab)).FnCol)) + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { + goto __10 + } + Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCur, reg) + goto __11 +__10: + pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) +__11: + ; + i = 0 +__12: + if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { + goto __14 + } + if !((i != iCol) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) == 0)) { + goto __15 + } + if !(pPk != 0) { + goto __16 + } + iPos = int32(Xsqlite3TableColumnToIndex(tls, pPk, int16(i))) + iColPos = int32(Xsqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + regOut = (((reg + 1) + iPos) - (libc.Bool32(iPos > iColPos))) + goto __17 +__16: + regOut = ((reg + 1) + nField) +__17: + ; + Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, i, regOut) + nField++ +__15: + ; + goto __13 +__13: + i++ + goto __12 + goto __14 +__14: + ; + regRec = (reg + int32((*Table)(unsafe.Pointer(pTab)).FnCol)) + Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (reg + 1), nField, regRec) + if !(pPk != 0) { + goto __18 + } + Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iCur, regRec, (reg + 1), int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)) + goto __19 +__18: + Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iCur, regRec, reg) +__19: + ; + + Xsqlite3VdbeAddOp2(tls, v, OP_Next, iCur, (addr + 1)) + Xsqlite3VdbeJumpHere(tls, v, addr) +__9: + ; + +exit_drop_column: + Xsqlite3DbFree(tls, db, zCol) + Xsqlite3SrcListDelete(tls, db, pSrc) +} + // Register built-in functions used to help implement ALTER TABLE -func Xsqlite3AlterFunctions(tls *libc.TLS) { /* sqlite3.c:107538:21: */ +func Xsqlite3AlterFunctions(tls *libc.TLS) { /* sqlite3.c:108692:21: */ Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aAlterTableFuncs)), (int32(uint64(unsafe.Sizeof(aAlterTableFuncs)) / uint64(unsafe.Sizeof(FuncDef{}))))) } -var aAlterTableFuncs = [3]FuncDef{ - {FnArg: int8(9), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 12326 /* "sqlite_rename_co..." */}, - {FnArg: int8(7), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 12347 /* "sqlite_rename_ta..." */}, - {FnArg: int8(5), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 12367 /* "sqlite_rename_te..." */}} /* sqlite3.c:107539:18 */ +var aAlterTableFuncs = [4]FuncDef{ + {FnArg: int8(9), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 12720 /* "sqlite_rename_co..." */}, + {FnArg: int8(7), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 12741 /* "sqlite_rename_ta..." */}, + {FnArg: int8(6), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 12761 /* "sqlite_rename_te..." */}, + {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_INTERNAL | SQLITE_UTF8) | SQLITE_FUNC_CONSTANT)), FxSFunc: 0, FzName: ts + 12780 /* "sqlite_drop_colu..." */}} /* sqlite3.c:108693:18 */ //************* End of alter.c ********************************************** //************* Begin file analyze.c **************************************** @@ -87867,7 +88888,7 @@ var aAlterTableFuncs = [3]FuncDef{ // 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 *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWhere uintptr, zWhereType uintptr) { /* sqlite3.c:107715:13: */ +func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWhere uintptr, zWhereType uintptr) { /* sqlite3.c:108870:13: */ bp := tls.Alloc(88) defer tls.Free(88) @@ -87880,7 +88901,7 @@ func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWh // var aCreateTbl [3]U8 at bp+72, 3 var nToOpen int32 - if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0 { + if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0) { nToOpen = 2 } else { nToOpen = 1 @@ -87908,9 +88929,9 @@ func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWh // of the new table in register pParse->regRoot. This is important // because the OpenWrite opcode below will be needing it. Xsqlite3NestedParse(tls, pParse, - ts+12386 /* "CREATE TABLE %Q...." */, libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, aTable[i].FzCols)) + ts+12799 /* "CREATE TABLE %Q...." */, libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, aTable[i].FzCols)) *(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4)) = U32((*Parse)(unsafe.Pointer(pParse)).FregRoot) - *(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i))) = OPFLAG_P2ISREG + *(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i))) = U8(OPFLAG_P2ISREG) } } else { // The table already exists. If zWhere is not NULL, delete all entries @@ -87920,10 +88941,10 @@ func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWh Xsqlite3TableLock(tls, pParse, iDb, *(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4)), uint8(1), zTab) if zWhere != 0 { Xsqlite3NestedParse(tls, pParse, - ts+12409, /* "DELETE FROM %Q.%..." */ + ts+12822, /* "DELETE FROM %Q.%..." */ libc.VaList(bp+24, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else if (*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - Xsqlite3NestedParse(tls, pParse, ts+12439 /* "DELETE FROM %Q.%..." */, libc.VaList(bp+56, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + Xsqlite3NestedParse(tls, pParse, ts+12852 /* "DELETE FROM %Q.%..." */, libc.VaList(bp+56, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { // The sqlite_stat[134] table already exists. Delete all rows. Xsqlite3VdbeAddOp2(tls, v, OP_Clear, int32(*(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4))), iDb) @@ -87944,10 +88965,10 @@ var aTable = [3]struct { FzName uintptr FzCols uintptr }{ - {FzName: ts + 12457 /* "sqlite_stat1" */, FzCols: ts + 12470 /* "tbl,idx,stat" */}, - {FzName: ts + 12483 /* "sqlite_stat4" */, FzCols: ts + 12496 /* "tbl,idx,neq,nlt,..." */}, - {FzName: ts + 12524 /* "sqlite_stat3" */}, -} /* sqlite3.c:107725:5 */ + {FzName: ts + 12870 /* "sqlite_stat1" */, FzCols: ts + 12883 /* "tbl,idx,stat" */}, + {FzName: ts + 12896 /* "sqlite_stat4" */, FzCols: ts + 12909 /* "tbl,idx,neq,nlt,..." */}, + {FzName: ts + 12937 /* "sqlite_stat3" */}, +} /* sqlite3.c:108880:5 */ // Recommended number of samples for sqlite_stat4 @@ -87974,14 +88995,14 @@ type StatAccum1 = struct { FnMaxEqZero int32 FiGet int32 Fa uintptr -} /* sqlite3.c:107813:9 */ +} /* sqlite3.c:108968:9 */ // Recommended number of samples for sqlite_stat4 // Three SQL functions - stat_init(), stat_push(), and stat_get() - // share an instance of the following structure to hold their state // information. -type StatAccum = StatAccum1 /* sqlite3.c:107813:26 */ +type StatAccum = StatAccum1 /* sqlite3.c:108968:26 */ type StatSample1 = struct { FanEq uintptr FanDLt uintptr @@ -87992,12 +89013,12 @@ type StatSample1 = struct { _ [3]byte FiCol int32 FiHash U32 -} /* sqlite3.c:107813:9 */ +} /* sqlite3.c:108968:9 */ -type StatSample = StatSample1 /* sqlite3.c:107814:27 */ +type StatSample = StatSample1 /* sqlite3.c:108969:27 */ // Reclaim memory used by a StatSample -func sampleClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:107855:13: */ +func sampleClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:109010:13: */ if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */))) @@ -88006,7 +89027,7 @@ func sampleClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:107855:13: } // Initialize the BLOB value of a ROWID -func sampleSetRowid(tls *libc.TLS, db uintptr, p uintptr, n int32, pData uintptr) { /* sqlite3.c:107867:13: */ +func sampleSetRowid(tls *libc.TLS, db uintptr, p uintptr, n int32, pData uintptr) { /* sqlite3.c:109022:13: */ if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */))) @@ -88021,7 +89042,7 @@ func sampleSetRowid(tls *libc.TLS, db uintptr, p uintptr, n int32, pData uintptr } // Initialize the INTEGER value of a ROWID. -func sampleSetRowidInt64(tls *libc.TLS, db uintptr, p uintptr, iRowid I64) { /* sqlite3.c:107883:13: */ +func sampleSetRowidInt64(tls *libc.TLS, db uintptr, p uintptr, iRowid I64) { /* sqlite3.c:109038:13: */ if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */))) @@ -88031,7 +89052,7 @@ func sampleSetRowidInt64(tls *libc.TLS, db uintptr, p uintptr, iRowid I64) { /* } // Copy the contents of object (*pFrom) into (*pTo). -func sampleCopy(tls *libc.TLS, p uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:107896:13: */ +func sampleCopy(tls *libc.TLS, p uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:109051:13: */ (*StatSample)(unsafe.Pointer(pTo)).FisPSample = (*StatSample)(unsafe.Pointer(pFrom)).FisPSample (*StatSample)(unsafe.Pointer(pTo)).FiCol = (*StatSample)(unsafe.Pointer(pFrom)).FiCol (*StatSample)(unsafe.Pointer(pTo)).FiHash = (*StatSample)(unsafe.Pointer(pFrom)).FiHash @@ -88046,7 +89067,7 @@ func sampleCopy(tls *libc.TLS, p uintptr, pTo uintptr, pFrom uintptr) { /* sqlit } // Reclaim all memory of a StatAccum structure. -func statAccumDestructor(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:107914:13: */ +func statAccumDestructor(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:109069:13: */ var p uintptr = pOld if (*StatAccum)(unsafe.Pointer(p)).FmxSample != 0 { var i int32 @@ -88081,7 +89102,7 @@ func statAccumDestructor(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:107914:13: // value is a pointer to the StatAccum object. The datatype of the // return value is BLOB, but it is really just a pointer to the StatAccum // object. -func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:107949:13: */ +func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:109104:13: */ var p uintptr var nCol int32 // Number of columns in index being sampled var nKeyCol int32 // Number of key columns @@ -88090,7 +89111,7 @@ func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql var db uintptr = Xsqlite3_context_db_handle(tls, context) // Database connection // Maximum number of samples. 0 if STAT4 data is not collected var mxSample int32 - if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0 { + if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0) { mxSample = SQLITE_STAT4_SAMPLES } else { mxSample = 0 @@ -88175,9 +89196,9 @@ func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql var statInitFuncdef = FuncDef{ FnArg: int8(4), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse - FzName: ts + 12537 /* "stat_init" */} /* sqlite3.c:108036:22 */ + FzName: ts + 12950 /* "stat_init" */} /* sqlite3.c:109191:22 */ // pNew and pOld are both candidate non-periodic samples selected for // the same column (pNew->iCol==pOld->iCol). Ignoring this column and @@ -88188,7 +89209,7 @@ var statInitFuncdef = FuncDef{ // // This function assumes that for each argument sample, the contents of // the anEq[] array from pSample->anEq[pSample->iCol+1] onwards are valid. -func sampleIsBetterPost(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:108060:12: */ +func sampleIsBetterPost(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:109215:12: */ var nCol int32 = (*StatAccum)(unsafe.Pointer(pAccum)).FnCol var i int32 @@ -88210,7 +89231,7 @@ func sampleIsBetterPost(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintpt // // This function assumes that for each argument sample, the contents of // the anEq[] array from pSample->anEq[pSample->iCol] onwards are valid. -func sampleIsBetter(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:108084:12: */ +func sampleIsBetter(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:109239:12: */ var nEqNew TRowcnt = *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pNew)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pNew)).FiCol)*4)) var nEqOld TRowcnt = *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pOld)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pOld)).FiCol)*4)) @@ -88228,7 +89249,7 @@ func sampleIsBetter(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) i // Copy the contents of sample *pNew into the p->a[] array. If necessary, // remove the least desirable sample from p->a[] to make room. -func sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { /* sqlite3.c:108107:13: */ +func sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { /* sqlite3.c:109262:13: */ var pSample uintptr var i int32 var pOld uintptr @@ -88371,7 +89392,7 @@ __11: // 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 *libc.TLS, p uintptr, iChng int32) { /* sqlite3.c:108199:13: */ +func samplePushPrevious(tls *libc.TLS, p uintptr, iChng int32) { /* sqlite3.c:109354:13: */ var i int32 // Check if any samples from the aBest[] array should be pushed @@ -88423,7 +89444,7 @@ func samplePushPrevious(tls *libc.TLS, p uintptr, iChng int32) { /* sqlite3.c:10 // if it wants the byte-code to do special processing. // // The R parameter is only used for STAT4 -func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:108251:13: */ +func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:109406:13: */ var i int32 // The three function arguments @@ -88493,9 +89514,9 @@ func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql var statPushFuncdef = FuncDef{ FnArg: (int8(2 + IsStat4)), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse - FzName: ts + 12547 /* "stat_push" */} /* sqlite3.c:108326:22 */ + FzName: ts + 12960 /* "stat_push" */} /* sqlite3.c:109481:22 */ // Implementation of the stat_get(P,J) SQL function. This routine is // used to query statistical information that has been gathered into @@ -88514,7 +89535,7 @@ var statPushFuncdef = FuncDef{ // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:108363:13: */ +func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:109518:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -88552,7 +89573,7 @@ func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli return } - Xsqlite3_snprintf(tls, 24, zRet, ts+12557, /* "%llu" */ + Xsqlite3_snprintf(tls, 24, zRet, ts+12970, /* "%llu" */ libc.VaList(bp, func() uint64 { if (*StatAccum)(unsafe.Pointer(p)).FnSkipAhead != 0 { return U64((*StatAccum)(unsafe.Pointer(p)).FnEst) @@ -88563,7 +89584,7 @@ func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnKeyCol; i++ { var nDistinct U64 = (U64(*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(i)*4)) + TRowcnt(1))) var iVal U64 = (((U64((*StatAccum)(unsafe.Pointer(p)).FnRow) + nDistinct) - uint64(1)) / nDistinct) - Xsqlite3_snprintf(tls, 24, z, ts+12562 /* " %llu" */, libc.VaList(bp+8, iVal)) + Xsqlite3_snprintf(tls, 24, z, ts+12975 /* " %llu" */, libc.VaList(bp+8, iVal)) z += uintptr(Xsqlite3Strlen30(tls, z)) } @@ -88612,7 +89633,7 @@ func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli var i int32 var z uintptr = zRet for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnCol; i++ { - Xsqlite3_snprintf(tls, 24, z, ts+12568 /* "%llu " */, libc.VaList(bp+16, U64(*(*TRowcnt)(unsafe.Pointer(aCnt + uintptr(i)*4))))) + Xsqlite3_snprintf(tls, 24, z, ts+12981 /* "%llu " */, libc.VaList(bp+16, U64(*(*TRowcnt)(unsafe.Pointer(aCnt + uintptr(i)*4))))) z += uintptr(Xsqlite3Strlen30(tls, z)) } @@ -88627,11 +89648,11 @@ func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli var statGetFuncdef = FuncDef{ FnArg: (int8(1 + IsStat4)), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse - FzName: ts + 12574 /* "stat_get" */} /* sqlite3.c:108478:22 */ + FzName: ts + 12987 /* "stat_get" */} /* sqlite3.c:109633:22 */ -func callStatGet(tls *libc.TLS, pParse uintptr, regStat int32, iParam int32, regOut int32) { /* sqlite3.c:108490:13: */ +func callStatGet(tls *libc.TLS, pParse uintptr, regStat int32, iParam int32, regOut int32) { /* sqlite3.c:109645:13: */ Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Integer, iParam, (regStat + 1)) Xsqlite3VdbeAddFunctionCall(tls, pParse, 0, regStat, regOut, (1 + IsStat4), @@ -88640,7 +89661,7 @@ func callStatGet(tls *libc.TLS, pParse uintptr, regStat int32, iParam int32, reg // Add a comment to the most recent VDBE opcode that is the name // of the k-th column of the pIdx index. -func analyzeVdbeCommentIndexWithColumnName(tls *libc.TLS, v uintptr, pIdx uintptr, k int32) { /* sqlite3.c:108507:13: */ +func analyzeVdbeCommentIndexWithColumnName(tls *libc.TLS, v uintptr, pIdx uintptr, k int32) { /* sqlite3.c:109662:13: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -88648,17 +89669,17 @@ func analyzeVdbeCommentIndexWithColumnName(tls *libc.TLS, v uintptr, pIdx uintpt i = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(k)*2))) if i == (-1) { - Xsqlite3VdbeComment(tls, v, ts+9988 /* "%s.rowid" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName)) + Xsqlite3VdbeComment(tls, v, ts+10081 /* "%s.rowid" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName)) } else if i == (-2) { - Xsqlite3VdbeComment(tls, v, ts+12583 /* "%s.expr(%d)" */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIdx)).FzName, k)) + Xsqlite3VdbeComment(tls, v, ts+12996 /* "%s.expr(%d)" */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIdx)).FzName, k)) } else { - Xsqlite3VdbeComment(tls, v, ts+9997 /* "%s.%s" */, libc.VaList(bp+24, (*Index)(unsafe.Pointer(pIdx)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol+uintptr(i)*32)).FzName)) + Xsqlite3VdbeComment(tls, v, ts+10090 /* "%s.%s" */, libc.VaList(bp+24, (*Index)(unsafe.Pointer(pIdx)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol+uintptr(i)*32)).FzName)) } } // Generate code to do an analysis of all indices associated with // a single table. -func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr, iStatCur int32, iMem int32, iTab int32) { /* sqlite3.c:108531:13: */ +func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr, iStatCur int32, iMem int32, iTab int32) { /* sqlite3.c:109686:13: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -88697,7 +89718,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp // Do not gather statistics on views or virtual tables return } - if Xsqlite3_strlike(tls, ts+12595 /* "sqlite\\_%" */, (*Table)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, ts+13008 /* "sqlite\\_%" */, (*Table)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { // Do not gather statistics on system tables return } @@ -88714,8 +89735,8 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp if pStat1 == uintptr(0) { return } - (*Table)(unsafe.Pointer(pStat1)).FzName = (pStat1 + 1*128) - libc.Xmemcpy(tls, (*Table)(unsafe.Pointer(pStat1)).FzName, ts+12457 /* "sqlite_stat1" */, uint64(13)) + (*Table)(unsafe.Pointer(pStat1)).FzName = (pStat1 + 1*120) + libc.Xmemcpy(tls, (*Table)(unsafe.Pointer(pStat1)).FzName, ts+12870 /* "sqlite_stat1" */, uint64(13)) (*Table)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*Table)(unsafe.Pointer(pStat1)).FiPKey = int16(-1) Xsqlite3VdbeAddOp4(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_Noop, 0, 0, 0, pStat1, -17) @@ -88750,7 +89771,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) { needTableCnt = U8(0) } - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { nCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) zIdxName = (*Table)(unsafe.Pointer(pTab)).FzName nColTest = (nCol - 1) @@ -88766,7 +89787,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp // Populate the register containing the index name. Xsqlite3VdbeLoadString(tls, v, regIdxname, zIdxName) - Xsqlite3VdbeComment(tls, v, ts+12605 /* "Analysis for %s...." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, zIdxName)) + Xsqlite3VdbeComment(tls, v, ts+13018 /* "Analysis for %s...." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, zIdxName)) // Pseudo-code for loop that calls stat_push(): // @@ -88824,7 +89845,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp Xsqlite3VdbeAddOp2(tls, v, OP_Integer, nCol, (regStat + 1)) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol), regRowid) - if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0 { + if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_Count, iIdxCur, regTemp) addrRewind = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iIdxCur) @@ -88879,7 +89900,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp Xsqlite3VdbeAddOp3(tls, v, OP_Column, iIdxCur, i, regTemp) analyzeVdbeCommentIndexWithColumnName(tls, v, pIdx, i) *(*int32)(unsafe.Pointer(aGotoChng + uintptr(i)*4)) = Xsqlite3VdbeAddOp4(tls, v, OP_Ne, regTemp, 0, (regPrev + i), pColl, -2) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NULLEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ)) } Xsqlite3VdbeAddOp2(tls, v, OP_Integer, nColTest, regChng) @@ -88905,9 +89926,9 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp // stat_push(P, regChng, regRowid) // 3rd parameter STAT4 only // Next csr // if !eof(csr) goto next_row; - if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0 { + if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0) { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iIdxCur, regRowid) } else { var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable) @@ -88950,14 +89971,14 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp // Add the entry to the stat1 table. callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+12624 /* "BBB" */, 0) + Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+13037 /* "BBB" */, 0) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur, regNewRowid) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur, regTemp, regNewRowid) Xsqlite3VdbeChangeP4(tls, v, -1, pStat1, -6) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) // Add the entries to the stat4 table. - if ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0) && ((*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit == 0) { + if (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit == 0) { var regEq int32 = regStat1 var regLt int32 = (regStat1 + 1) var regDLt int32 = (regStat1 + 2) @@ -88967,10 +89988,10 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp var addrNext int32 var addrIsNull int32 var seekOp U8 - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { - seekOp = OP_NotExists + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + seekOp = uint8(OP_NotExists) } else { - seekOp = OP_NotFound + seekOp = uint8(OP_NotFound) } (*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 { @@ -89012,10 +90033,10 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp jZeroRows = Xsqlite3VdbeAddOp1(tls, v, OP_IfNot, regStat1) Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regIdxname) - Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+12624 /* "BBB" */, 0) + Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, regTabname, 3, regTemp, ts+13037 /* "BBB" */, 0) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iStatCur, regNewRowid) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iStatCur, regTemp, regNewRowid) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3VdbeChangeP4(tls, v, -1, pStat1, -6) Xsqlite3VdbeJumpHere(tls, v, jZeroRows) } @@ -89023,7 +90044,7 @@ func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintp // 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 *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:108893:13: */ +func loadAnalysis(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:110048:13: */ var v uintptr = Xsqlite3GetVdbe(tls, pParse) if v != 0 { Xsqlite3VdbeAddOp1(tls, v, OP_LoadAnalysis, iDb) @@ -89031,7 +90052,7 @@ func loadAnalysis(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:10889 } // Generate code that will do an analysis of an entire database -func analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:108903:13: */ +func analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:110058:13: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema // Schema of database iDb var k uintptr @@ -89056,7 +90077,7 @@ func analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:10 // 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 *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) { /* sqlite3.c:108930:13: */ +func analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) { /* sqlite3.c:110085:13: */ var iDb int32 var iStatCur int32 @@ -89065,9 +90086,9 @@ func analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) iStatCur = (*Parse)(unsafe.Pointer(pParse)).FnTab *(*int32)(unsafe.Pointer(pParse + 52 /* &.nTab */)) += (3) if pOnlyIdx != 0 { - openStatTable(tls, pParse, iDb, iStatCur, (*Index)(unsafe.Pointer(pOnlyIdx)).FzName, ts+12628 /* "idx" */) + openStatTable(tls, pParse, iDb, iStatCur, (*Index)(unsafe.Pointer(pOnlyIdx)).FzName, ts+13041 /* "idx" */) } else { - openStatTable(tls, pParse, iDb, iStatCur, (*Table)(unsafe.Pointer(pTab)).FzName, ts+12632 /* "tbl" */) + openStatTable(tls, pParse, iDb, iStatCur, (*Table)(unsafe.Pointer(pTab)).FzName, ts+13045 /* "tbl" */) } analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1), (*Parse)(unsafe.Pointer(pParse)).FnTab) loadAnalysis(tls, pParse, iDb) @@ -89083,7 +90104,7 @@ func analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) // 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 Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:108961:21: */ +func Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:110116:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -89146,16 +90167,16 @@ func Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintp type analysisInfo = struct { Fdb uintptr FzDatabase uintptr -} /* sqlite3.c:109013:9 */ +} /* sqlite3.c:110168:9 */ // Used to pass information from the analyzer reader through to the // callback routine. -type AnalysisInfo = analysisInfo /* sqlite3.c:109013:29 */ +type AnalysisInfo = analysisInfo /* sqlite3.c:110168:29 */ // 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 *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, aLog uintptr, pIndex uintptr) { /* sqlite3.c:109024:13: */ +func decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, aLog uintptr, pIndex uintptr) { /* sqlite3.c:110179:13: */ var z uintptr = zIntArray var c int32 var i int32 @@ -89184,15 +90205,15 @@ func decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.bUnordered */, uint32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.noSkipScan */, uint32(0), 6, 0x40) for *(*int8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, ts+12636 /* "unordered*" */, z) == 0 { + if Xsqlite3_strglob(tls, ts+13049 /* "unordered*" */, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.bUnordered */, uint32(1), 2, 0x4) - } else if Xsqlite3_strglob(tls, ts+12647 /* "sz=[0-9]*" */, z) == 0 { + } else if Xsqlite3_strglob(tls, ts+13060 /* "sz=[0-9]*" */, z) == 0 { var sz int32 = Xsqlite3Atoi(tls, (z + uintptr(3))) if sz < 2 { sz = 2 } (*Index)(unsafe.Pointer(pIndex)).FszIdxRow = Xsqlite3LogEst(tls, uint64(sz)) - } else if Xsqlite3_strglob(tls, ts+12657 /* "noskipscan*" */, z) == 0 { + } else if Xsqlite3_strglob(tls, ts+13070 /* "noskipscan*" */, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.noSkipScan */, uint32(1), 6, 0x40) } for (int32(*(*int8)(unsafe.Pointer(z))) != 0) && (int32(*(*int8)(unsafe.Pointer(z))) != ' ') { @@ -89214,7 +90235,7 @@ func decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, // // Entries for which argv[1]==NULL simply record the number of rows in // the table. -func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:109097:12: */ +func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:110252:12: */ bp := tls.Alloc(152) defer tls.Free(152) @@ -89260,7 +90281,7 @@ func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotU libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.hasStat1 */, uint32(1), 7, 0x80) if (*Index)(unsafe.Pointer(pIndex)).FpPartIdxWhere == uintptr(0) { (*Table)(unsafe.Pointer(pTable)).FnRowLogEst = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiRowLogEst)) - *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (TF_HasStat1) + *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (U32(TF_HasStat1)) } } else { // var fakeIdx Index at bp, 152 @@ -89268,7 +90289,7 @@ func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotU (*Index)(unsafe.Pointer(bp /* &fakeIdx */)).FszIdxRow = (*Table)(unsafe.Pointer(pTable)).FszTabRow decodeIntArray(tls, z, 1, uintptr(0), (pTable + 74 /* &.nRowLogEst */), bp /* &fakeIdx */) (*Table)(unsafe.Pointer(pTable)).FszTabRow = (*Index)(unsafe.Pointer(bp /* &fakeIdx */)).FszIdxRow - *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (TF_HasStat1) + *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (U32(TF_HasStat1)) } return 0 @@ -89276,7 +90297,7 @@ func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotU // If the Index.aSample variable is not NULL, delete the aSample[] array // and its contents. -func Xsqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr) { /* sqlite3.c:109160:21: */ +func Xsqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr) { /* sqlite3.c:110315:21: */ if (*Index)(unsafe.Pointer(pIdx)).FaSample != 0 { var j int32 for j = 0; j < (*Index)(unsafe.Pointer(pIdx)).FnSample; j++ { @@ -89293,7 +90314,7 @@ func Xsqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr) { /* sq // Populate the pIdx->aAvgEq[] array based on the samples currently // stored in pIdx->aSample[]. -func initAvgEq(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:109185:13: */ +func initAvgEq(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:110340:13: */ if pIdx != 0 { var aSample uintptr = (*Index)(unsafe.Pointer(pIdx)).FaSample var pFinal uintptr = (aSample + uintptr(((*Index)(unsafe.Pointer(pIdx)).FnSample-1))*40) @@ -89351,11 +90372,11 @@ func initAvgEq(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:109185:13: */ // Look up an index by name. Or, if the name of a WITHOUT ROWID table // is supplied instead, find the PRIMARY KEY index for that table. -func findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:109244:14: */ +func findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:110399:14: */ var pIdx uintptr = Xsqlite3FindIndex(tls, db, zName, zDb) if pIdx == uintptr(0) { var pTab uintptr = Xsqlite3FindTable(tls, db, zName, zDb) - if (pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if (pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab) } } @@ -89372,7 +90393,7 @@ func findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr // zSql2: SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4 // // where %Q is replaced with the database name before the SQL is executed. -func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb uintptr) int32 { /* sqlite3.c:109269:12: */ +func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb uintptr) int32 { /* sqlite3.c:110424:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -89413,7 +90434,7 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui continue } - if !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + if !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) } else { nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) @@ -89431,6 +90452,7 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui pSpace = ((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(nSample)*40) (*Index)(unsafe.Pointer(pIdx)).FaAvgEq = pSpace pSpace += 4 * (uintptr(nIdxCol)) + *(*U32)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable + 64 /* &.tabFlags */)) |= (U32(TF_HasStat4)) for i = 0; i < nSample; i++ { (*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(i)*40)).FanEq = pSpace pSpace += 4 * (uintptr(nIdxCol)) @@ -89507,13 +90529,13 @@ func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb ui // Load content from the sqlite_stat4 table into // the Index.aSample[] arrays of all indices. -func loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:109389:12: */ +func loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:110545:12: */ var rc int32 = SQLITE_OK // Result codes from subroutines - if Xsqlite3FindTable(tls, db, ts+12483 /* "sqlite_stat4" */, zDb) != 0 { + if Xsqlite3FindTable(tls, db, ts+12896 /* "sqlite_stat4" */, zDb) != 0 { rc = loadStatTbl(tls, db, - ts+12669, /* "SELECT idx,count..." */ - ts+12723, /* "SELECT idx,neq,n..." */ + ts+13082, /* "SELECT idx,count..." */ + ts+13136, /* "SELECT idx,neq,n..." */ zDb) } return rc @@ -89537,7 +90559,7 @@ func loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:1093 // 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 Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlite3.c:109424:20: */ +func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlite3.c:110580:20: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -89564,9 +90586,9 @@ func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlit // Load new statistics out of the sqlite_stat1 table (*AnalysisInfo)(unsafe.Pointer(bp + 8 /* &sInfo */)).Fdb = db (*AnalysisInfo)(unsafe.Pointer(bp + 8 /* &sInfo */)).FzDatabase = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName - if Xsqlite3FindTable(tls, db, ts+12457 /* "sqlite_stat1" */, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase) != uintptr(0) { + if Xsqlite3FindTable(tls, db, ts+12870 /* "sqlite_stat1" */, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase) != uintptr(0) { zSql = Xsqlite3MPrintf(tls, db, - ts+12775 /* "SELECT tbl,idx,s..." */, libc.VaList(bp, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase)) + ts+13188 /* "SELECT tbl,idx,s..." */, libc.VaList(bp, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase)) if zSql == uintptr(0) { rc = SQLITE_NOMEM } else { @@ -89642,13 +90664,13 @@ func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlit // ATTACH DATABASE abc||def AS 'db2' // // will fail because neither abc or def can be resolved. -func resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) int32 { /* sqlite3.c:109529:12: */ +func resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) int32 { /* sqlite3.c:110685:12: */ var rc int32 = SQLITE_OK if pExpr != 0 { if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_ID { rc = Xsqlite3ResolveExprNames(tls, pName, pExpr) } else { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_STRING + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_STRING) } } return rc @@ -89656,9 +90678,9 @@ func resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) int32 { /* s // Return true if zName points to a name that may be used to refer to // database iDb attached to handle db. -func Xsqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) int32 { /* sqlite3.c:109546:20: */ +func Xsqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) int32 { /* sqlite3.c:110702:20: */ return (libc.Bool32((Xsqlite3StrICmp(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zName) == 0) || - ((iDb == 0) && (Xsqlite3StrICmp(tls, ts+8333 /* "main" */, zName) == 0)))) + ((iDb == 0) && (Xsqlite3StrICmp(tls, ts+8426 /* "main" */, zName) == 0)))) } // An SQL user-function registered to do the work of an ATTACH statement. The @@ -89674,7 +90696,7 @@ func Xsqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) int3 // If the db->init.reopenMemdb flags is set, then instead of attaching a // new database, close the database on db->init.iDb and reopen it as an // empty MemDB. -func attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109568:13: */ +func attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:110724:13: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -89719,13 +90741,13 @@ __1: __2: ; - if !((uint32(int32(*(*uint8)(unsafe.Pointer(db + 176 /* &.init */ + 8 /* &.reopenMemdb */)) & 0x4 >> 2))) != 0) { + if !((uint32(int32(*(*uint8)(unsafe.Pointer(db + 184 /* &.init */ + 8 /* &.reopenMemdb */)) & 0x4 >> 2))) != 0) { goto __3 } // This is not a real ATTACH. Instead, this routine is being called // from sqlite3_deserialize() to close database db->init.iDb and // reopen it as a MemDB - *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)) = Xsqlite3_vfs_find(tls, ts+5506 /* "memdb" */) + *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)) = Xsqlite3_vfs_find(tls, ts+5582 /* "memdb" */) if !(*(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)) == uintptr(0)) { goto __5 } @@ -89741,7 +90763,7 @@ __6: ; (*Db)(unsafe.Pointer(pNew)).FpBt = uintptr(0) (*Db)(unsafe.Pointer(pNew)).FpSchema = uintptr(0) - rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)), ts+12816 /* "x\x00" */, db, (pNew + 8 /* &.pBt */), 0, SQLITE_OPEN_MAIN_DB) + rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)), ts+13229 /* "x\x00" */, db, (pNew + 8 /* &.pBt */), 0, SQLITE_OPEN_MAIN_DB) goto __4 __3: // This is a real ATTACH @@ -89751,11 +90773,11 @@ __3: // * Too many attached databases, // * Transaction currently open // * Specified database name already being used. - if !((*Sqlite3)(unsafe.Pointer(db)).FnDb >= (*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 7*4)) + 2)) { + if !((*Sqlite3)(unsafe.Pointer(db)).FnDb >= (*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 7*4)) + 2)) { goto __7 } - *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+12819, /* "too many attache..." */ - libc.VaList(bp, *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+13232, /* "too many attache..." */ + libc.VaList(bp, *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 7*4)))) goto attach_error __7: ; @@ -89768,7 +90790,7 @@ __8: if !(Xsqlite3DbIsNamed(tls, db, i, zName) != 0) { goto __11 } - *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+12856 /* "database %s is a..." */, libc.VaList(bp+8, zName)) + *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+13269 /* "database %s is a..." */, libc.VaList(bp+8, zName)) goto attach_error __11: ; @@ -89782,7 +90804,7 @@ __10: // Allocate the new entry in the db->aDb[] array and initialize the schema // hash tables. - if !((*Sqlite3)(unsafe.Pointer(db)).FaDb == db+648 /* &.aDbStatic */) { + if !((*Sqlite3)(unsafe.Pointer(db)).FaDb == db+656 /* &.aDbStatic */) { goto __12 } aNew = Xsqlite3DbMallocRawNN(tls, db, (uint64(unsafe.Sizeof(Db{})) * uint64(3))) @@ -89828,7 +90850,7 @@ __17: __16: ; - *(*uint32)(unsafe.Pointer(bp + 24 /* flags */)) |= SQLITE_OPEN_MAIN_DB + *(*uint32)(unsafe.Pointer(bp + 24 /* flags */)) |= uint32(SQLITE_OPEN_MAIN_DB) rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)), *(*uintptr)(unsafe.Pointer(bp + 40 /* zPath */)), db, (pNew + 8 /* &.pBt */), 0, int32(*(*uint32)(unsafe.Pointer(bp + 24 /* flags */)))) (*Sqlite3)(unsafe.Pointer(db)).FnDb++ (*Db)(unsafe.Pointer(pNew)).FzDbSName = Xsqlite3DbStrDup(tls, db, zName) @@ -89839,7 +90861,7 @@ __4: goto __18 } rc = SQLITE_ERROR - *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+12886 /* "database is alre..." */, 0) + *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+13299 /* "database is alre..." */, 0) goto __19 __18: if !(rc == SQLITE_OK) { @@ -89856,7 +90878,7 @@ __21: goto __23 } *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, - ts+12915 /* "attached databas..." */, 0) + ts+13328 /* "attached databas..." */, 0) rc = SQLITE_ERROR __23: ; @@ -89868,7 +90890,7 @@ __22: Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer(pNew)).FpBt, Xsqlite3BtreeSecureDelete(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpBt, -1)) Xsqlite3BtreeSetPagerFlags(tls, (*Db)(unsafe.Pointer(pNew)).FpBt, - (uint32(PAGER_SYNCHRONOUS_FULL | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & PAGER_FLAGS_MASK)))) + (uint32(uint64(PAGER_SYNCHRONOUS_FULL) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(PAGER_FLAGS_MASK))))) Xsqlite3BtreeLeave(tls, (*Db)(unsafe.Pointer(pNew)).FpBt) __20: ; @@ -89893,7 +90915,7 @@ __24: Xsqlite3BtreeEnterAll(tls, db) (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(0) *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaKnownOk))) - if !(!((int32(*(*uint8)(unsafe.Pointer(db + 176 /* &.init */ + 8 /* &.reopenMemdb */)) & 0x4 >> 2)) != 0)) { + if !(!((int32(*(*uint8)(unsafe.Pointer(db + 184 /* &.init */ + 8 /* &.reopenMemdb */)) & 0x4 >> 2)) != 0)) { goto __26 } rc = Xsqlite3Init(tls, db, bp+56 /* &zErrDyn */) @@ -89906,7 +90928,7 @@ __25: if !(rc != 0) { goto __27 } - if !(!((int32(*(*uint8)(unsafe.Pointer(db + 176 /* &.init */ + 8 /* &.reopenMemdb */)) & 0x4 >> 2)) != 0)) { + if !(!((int32(*(*uint8)(unsafe.Pointer(db + 184 /* &.init */ + 8 /* &.reopenMemdb */)) & 0x4 >> 2)) != 0)) { goto __28 } iDb = ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1) @@ -89926,13 +90948,13 @@ __29: } Xsqlite3OomFault(tls, db) Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */))) - *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+7766 /* "out of memory" */, 0) + *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+7859 /* "out of memory" */, 0) goto __31 __30: if !(*(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) == uintptr(0)) { goto __32 } - *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+12983 /* "unable to open d..." */, libc.VaList(bp+16, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+13396 /* "unable to open d..." */, libc.VaList(bp+16, zFile)) __32: ; __31: @@ -89967,7 +90989,7 @@ __34: // DETACH DATABASE x // // SELECT sqlite_detach(x) -func detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109761:13: */ +func detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:110917:13: */ bp := tls.Alloc(152) defer tls.Free(152) @@ -90020,21 +91042,22 @@ __4: if !(i >= (*Sqlite3)(unsafe.Pointer(db)).FnDb) { goto __7 } - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+13011 /* "no such database..." */, libc.VaList(bp, zName)) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+13424 /* "no such database..." */, libc.VaList(bp, zName)) goto detach_error __7: ; if !(i < 2) { goto __8 } - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+13032 /* "cannot detach da..." */, libc.VaList(bp+8, zName)) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+13445 /* "cannot detach da..." */, libc.VaList(bp+8, zName)) goto detach_error __8: ; - if !((Xsqlite3BtreeIsInReadTrans(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != 0) || (Xsqlite3BtreeIsInBackup(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != 0)) { + if !((Xsqlite3BtreeTxnState(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE) || + (Xsqlite3BtreeIsInBackup(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != 0)) { goto __9 } - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+13058 /* "database %s is l..." */, libc.VaList(bp+16, zName)) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+13471 /* "database %s is l..." */, libc.VaList(bp+16, zName)) goto detach_error __9: ; @@ -90071,7 +91094,7 @@ detach_error: // This procedure generates VDBE code for a single invocation of either the // sqlite_detach() or sqlite_attach() SQL user functions. -func codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAuthArg uintptr, pFilename uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:109821:13: */ +func codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAuthArg uintptr, pFilename uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:110979:13: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -90149,35 +91172,110 @@ attach_end: // Called by the parser to compile a DETACH statement. // // DETACH pDbname -func Xsqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { /* sqlite3.c:109892:21: */ +func Xsqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { /* sqlite3.c:111050:21: */ codeAttach(tls, pParse, SQLITE_DETACH, uintptr(unsafe.Pointer(&detach_func)), pDbname, uintptr(0), uintptr(0), pDbname) } var detach_func = FuncDef{ FnArg: int8(1), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse - FzName: ts + 13080 /* "sqlite_detach" */} /* sqlite3.c:109893:24 */ + FzName: ts + 13493 /* "sqlite_detach" */} /* sqlite3.c:111051:24 */ // Called by the parser to compile an ATTACH statement. // // ATTACH p AS pDbname KEY pKey -func Xsqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:109912:21: */ +func Xsqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:111070:21: */ codeAttach(tls, pParse, SQLITE_ATTACH, uintptr(unsafe.Pointer(&attach_func)), p, p, pDbname, pKey) } var attach_func = FuncDef{ FnArg: int8(3), // nArg - FfuncFlags: SQLITE_UTF8, // pNext + FfuncFlags: U32(SQLITE_UTF8), // pNext FxSFunc: 0, // xValue, xInverse - FzName: ts + 13094 /* "sqlite_attach" */} /* sqlite3.c:109913:24 */ + FzName: ts + 13507 /* "sqlite_attach" */} /* sqlite3.c:111071:24 */ + +// Expression callback used by sqlite3FixAAAA() routines. +func fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:111089:12: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + var pFix uintptr = *(*uintptr)(unsafe.Pointer(p + 40 /* &.u */)) + if !(int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) != 0) { + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FromDDL)) + } + if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE { + if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit.Fbusy != 0 { + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) + } else { + Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, ts+13521 /* "%s cannot use va..." */, libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType)) + return WRC_Abort + } + } + return WRC_Continue +} + +// Select callback used by sqlite3FixAAAA() routines. +func fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) int32 { /* sqlite3.c:111106:12: */ + bp := tls.Alloc(24) + defer tls.Free(24) + + var pFix uintptr = *(*uintptr)(unsafe.Pointer(p + 40 /* &.u */)) + var i int32 + var pItem uintptr + var db uintptr = (*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb + var iDb int32 = Xsqlite3FindDbName(tls, db, (*DbFixer)(unsafe.Pointer(pFix)).FzDb) + var pList uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc + + if pList == uintptr(0) { + return WRC_Continue + } + i = 0 + pItem = pList + 8 /* &.a */ +__1: + if !(i < (*SrcList)(unsafe.Pointer(pList)).FnSrc) { + goto __3 + } + { + if int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 { + if ((*SrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0) && (iDb != Xsqlite3FindDbName(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase)) { + Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, + ts+13545, /* "%s %T cannot ref..." */ + libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType, (*DbFixer)(unsafe.Pointer(pFix)).FpName, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase)) + return WRC_Abort + } + Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase) + (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0) + (*SrcItem)(unsafe.Pointer(pItem)).FpSchema = (*DbFixer)(unsafe.Pointer(pFix)).FpSchema + libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.fromDDL */, uint32(1), 6, 0x40) + } + if Xsqlite3WalkExpr(tls, (pFix+8 /* &.w */), (*SrcItem)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*112)).FpOn) != 0 { + return WRC_Abort + } + + } + goto __2 +__2: + i++ + pItem += 112 + goto __1 + goto __3 +__3: + ; + if (*Select)(unsafe.Pointer(pSelect)).FpWith != 0 { + for i = 0; i < (*With)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpWith)).FnCte; i++ { + if Xsqlite3WalkSelect(tls, p, (*Cte)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpWith+16 /* &.a */)+uintptr(i)*48)).FpSelect) != 0 { + return WRC_Abort + } + } + } + return WRC_Continue +} // Initialize a DbFixer structure. This routine must be called prior // to passing the structure to one of the sqliteFixAAAA() routines below. -func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zType uintptr, pName uintptr) { /* sqlite3.c:109932:21: */ - var db uintptr - - db = (*Parse)(unsafe.Pointer(pParse)).Fdb +func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zType uintptr, pName uintptr) { /* sqlite3.c:111146:21: */ + var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb (*DbFixer)(unsafe.Pointer(pFix)).FpParse = pParse (*DbFixer)(unsafe.Pointer(pFix)).FzDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName @@ -90185,6 +91283,17 @@ func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zTy (*DbFixer)(unsafe.Pointer(pFix)).FzType = zType (*DbFixer)(unsafe.Pointer(pFix)).FpName = pName (*DbFixer)(unsafe.Pointer(pFix)).FbTemp = (U8(libc.Bool32(iDb == 1))) + (*DbFixer)(unsafe.Pointer(pFix)).Fw.FpParse = pParse + (*DbFixer)(unsafe.Pointer(pFix)).Fw.FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) int32 + }{fixExprCb})) + (*DbFixer)(unsafe.Pointer(pFix)).Fw.FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) int32 + }{fixSelectCb})) + (*DbFixer)(unsafe.Pointer(pFix)).Fw.FxSelectCallback2 = uintptr(0) + (*DbFixer)(unsafe.Pointer(pFix)).Fw.FwalkerDepth = 0 + (*DbFixer)(unsafe.Pointer(pFix)).Fw.FeCode = U16(0) + *(*uintptr)(unsafe.Pointer(pFix + 8 /* &.w */ + 40 /* &.u */)) = pFix } // The following set of routines walk through the parse tree and assign @@ -90199,186 +91308,49 @@ func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zTy // 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 Xsqlite3FixSrcList(tls *libc.TLS, pFix uintptr, pList uintptr) int32 { /* sqlite3.c:109965:20: */ - bp := tls.Alloc(24) - defer tls.Free(24) +func Xsqlite3FixSrcList(tls *libc.TLS, pFix uintptr, pList uintptr) int32 { /* sqlite3.c:111184:20: */ + bp := tls.Alloc(128) + defer tls.Free(128) - var i int32 - var pItem uintptr - var db uintptr = (*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb - var iDb int32 = Xsqlite3FindDbName(tls, db, (*DbFixer)(unsafe.Pointer(pFix)).FzDb) + var res int32 = 0 + if pList != 0 { + // var s Select at bp, 128 - if pList == uintptr(0) { - return 0 + libc.Xmemset(tls, bp /* &s */, 0, uint64(unsafe.Sizeof(Select{}))) + (*Select)(unsafe.Pointer(bp /* &s */)).FpSrc = pList + res = Xsqlite3WalkSelect(tls, (pFix + 8 /* &.w */), bp /* &s */) } - - i = 0 - pItem = pList + 8 /* &.a */ -__1: - if !(i < (*SrcList)(unsafe.Pointer(pList)).FnSrc) { - goto __3 - } - { - if int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 { - if ((*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase != 0) && (iDb != Xsqlite3FindDbName(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase)) { - Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, - ts+13108, /* "%s %T cannot ref..." */ - libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType, (*DbFixer)(unsafe.Pointer(pFix)).FpName, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase)) - return 1 - } - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase) - (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0) - (*SrcList_item)(unsafe.Pointer(pItem)).FpSchema = (*DbFixer)(unsafe.Pointer(pFix)).FpSchema - libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.fromDDL */, uint32(1), 6, 0x40) - } - if Xsqlite3FixSelect(tls, pFix, (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect) != 0 { - return 1 - } - if Xsqlite3FixExpr(tls, pFix, (*SrcList_item)(unsafe.Pointer(pItem)).FpOn) != 0 { - return 1 - } - if ((uint32(int32(*(*uint8)(unsafe.Pointer((pItem + 60 /* &.fg */) + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0) && (Xsqlite3FixExprList(tls, pFix, *(*uintptr)(unsafe.Pointer(pItem + 96 /* &.u1 */))) != 0) { - return 1 - } - - } - goto __2 -__2: - i++ - pItem += 112 - goto __1 - goto __3 -__3: - ; - return 0 + return res } -func Xsqlite3FixSelect(tls *libc.TLS, pFix uintptr, pSelect uintptr) int32 { /* sqlite3.c:110000:20: */ - for pSelect != 0 { - if Xsqlite3FixExprList(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpEList) != 0 { - return 1 - } - if Xsqlite3FixSrcList(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpSrc) != 0 { - return 1 - } - if Xsqlite3FixExpr(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpWhere) != 0 { - return 1 - } - if Xsqlite3FixExprList(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpGroupBy) != 0 { - return 1 - } - if Xsqlite3FixExpr(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpHaving) != 0 { - return 1 - } - if Xsqlite3FixExprList(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpOrderBy) != 0 { - return 1 - } - if Xsqlite3FixExpr(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpLimit) != 0 { - return 1 - } - if (*Select)(unsafe.Pointer(pSelect)).FpWith != 0 { - var i int32 - for i = 0; i < (*With)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpWith)).FnCte; i++ { - if Xsqlite3FixSelect(tls, pFix, (*Cte)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpWith+16 /* &.a */)+uintptr(i)*32)).FpSelect) != 0 { - return 1 - } - } - } - pSelect = (*Select)(unsafe.Pointer(pSelect)).FpPrior - } - return 0 +func Xsqlite3FixSelect(tls *libc.TLS, pFix uintptr, pSelect uintptr) int32 { /* sqlite3.c:111198:20: */ + return Xsqlite3WalkSelect(tls, (pFix + 8 /* &.w */), pSelect) } -func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqlite3.c:110038:20: */ - bp := tls.Alloc(8) - defer tls.Free(8) - - for pExpr != 0 { - if !(int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) != 0) { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FromDDL) - } - if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_VARIABLE { - if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit.Fbusy != 0 { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL - } else { - Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, ts+13154 /* "%s cannot use va..." */, libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType)) - return 1 - } - } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0) { - break - } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { - if Xsqlite3FixSelect(tls, pFix, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0 { - return 1 - } - } else { - if Xsqlite3FixExprList(tls, pFix, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0 { - return 1 - } - } - if Xsqlite3FixExpr(tls, pFix, (*Expr)(unsafe.Pointer(pExpr)).FpRight) != 0 { - return 1 - } - pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft - } - return 0 +func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqlite3.c:111204:20: */ + return Xsqlite3WalkExpr(tls, (pFix + 8 /* &.w */), pExpr) } -func Xsqlite3FixExprList(tls *libc.TLS, pFix uintptr, pList uintptr) int32 { /* sqlite3.c:110065:20: */ - var i int32 - var pItem uintptr - if pList == uintptr(0) { - return 0 - } - i = 0 - pItem = pList + 8 /* &.a */ -__1: - if !(i < (*ExprList)(unsafe.Pointer(pList)).FnExpr) { - goto __3 - } - { - if Xsqlite3FixExpr(tls, pFix, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr) != 0 { - return 1 - } - - } - goto __2 -__2: - i++ - pItem += 32 - goto __1 - goto __3 -__3: - ; - return 0 -} - -func Xsqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) int32 { /* sqlite3.c:110082:20: */ +func Xsqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) int32 { /* sqlite3.c:111213:20: */ for pStep != 0 { - if Xsqlite3FixSelect(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect) != 0 { - return 1 - } - if Xsqlite3FixExpr(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere) != 0 { - return 1 - } - if Xsqlite3FixExprList(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList) != 0 { - return 1 - } - if ((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0) && (Xsqlite3FixSrcList(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom) != 0) { + if (((Xsqlite3WalkSelect(tls, (pFix+8 /* &.w */), (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect) != 0) || + (Xsqlite3WalkExpr(tls, (pFix+8 /* &.w */), (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere) != 0)) || + (Xsqlite3WalkExprList(tls, (pFix+8 /* &.w */), (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList) != 0)) || + (Xsqlite3FixSrcList(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom) != 0) { return 1 } if (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0 { var pUp uintptr = (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert - if (((Xsqlite3FixExprList(tls, pFix, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTarget) != 0) || - (Xsqlite3FixExpr(tls, pFix, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTargetWhere) != 0)) || - (Xsqlite3FixExprList(tls, pFix, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertSet) != 0)) || - (Xsqlite3FixExpr(tls, pFix, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertWhere) != 0) { + if (((Xsqlite3WalkExprList(tls, (pFix+8 /* &.w */), (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTarget) != 0) || + (Xsqlite3WalkExpr(tls, (pFix+8 /* &.w */), (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTargetWhere) != 0)) || + (Xsqlite3WalkExprList(tls, (pFix+8 /* &.w */), (*Upsert)(unsafe.Pointer(pUp)).FpUpsertSet) != 0)) || + (Xsqlite3WalkExpr(tls, (pFix+8 /* &.w */), (*Upsert)(unsafe.Pointer(pUp)).FpUpsertWhere) != 0) { return 1 } } pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext } + return 0 } @@ -90446,7 +91418,7 @@ func Xsqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) int32 { // // Setting the auth function to NULL disables this hook. The default // setting of the auth function is NULL. -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) int32 { /* sqlite3.c:110188:16: */ +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) int32 { /* sqlite3.c:111315:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg @@ -90459,8 +91431,8 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // Write an error message into pParse->zErrMsg that explains that the // user-supplied authorization function returned an illegal value. -func sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110208:13: */ - Xsqlite3ErrorMsg(tls, pParse, ts+13178 /* "authorizer malfu..." */, 0) +func sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:111335:13: */ + Xsqlite3ErrorMsg(tls, pParse, ts+13591 /* "authorizer malfu..." */, 0) (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR } @@ -90471,7 +91443,7 @@ func sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:11020 // 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 Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintptr, iDb int32) int32 { /* sqlite3.c:110222:20: */ +func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintptr, iDb int32) int32 { /* sqlite3.c:111349:20: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -90482,13 +91454,13 @@ func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 { return SQLITE_OK } - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 488 /* &.xAuth */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, SQLITE_READ, zTab, zCol, zDb, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 496 /* &.xAuth */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, SQLITE_READ, zTab, zCol, zDb, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == SQLITE_DENY { - var z uintptr = Xsqlite3_mprintf(tls, ts+9997 /* "%s.%s" */, libc.VaList(bp, zTab, zCol)) + var z uintptr = Xsqlite3_mprintf(tls, ts+10090 /* "%s.%s" */, libc.VaList(bp, zTab, zCol)) if ((*Sqlite3)(unsafe.Pointer(db)).FnDb > 2) || (iDb != 0) { - z = Xsqlite3_mprintf(tls, ts+13201 /* "%s.%z" */, libc.VaList(bp+16, zDb, z)) + z = Xsqlite3_mprintf(tls, ts+13614 /* "%s.%z" */, libc.VaList(bp+16, zDb, z)) } - Xsqlite3ErrorMsg(tls, pParse, ts+13207 /* "access to %z is ..." */, libc.VaList(bp+32, z)) + Xsqlite3ErrorMsg(tls, pParse, ts+13620 /* "access to %z is ..." */, libc.VaList(bp+32, z)) (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_AUTH } else if (rc != SQLITE_IGNORE) && (rc != SQLITE_OK) { sqliteAuthBadReturnCode(tls, pParse) @@ -90503,17 +91475,13 @@ func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp // 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 Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uintptr, pTabList uintptr) { /* sqlite3.c:110258:21: */ - var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb +func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uintptr, pTabList uintptr) { /* sqlite3.c:111385:21: */ var pTab uintptr = uintptr(0) // The table being read var zCol uintptr // Name of the column of the table var iSrc int32 // Index in pTabList->a[] of table being read var iDb int32 // The index of the database the expression refers to var iCol int32 // Index of column in table - if (*Sqlite3)(unsafe.Pointer(db)).FxAuth == uintptr(0) { - return - } iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pSchema) if iDb < 0 { // An attempt to read a column out of a subquery or other @@ -90526,8 +91494,8 @@ func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint } else { for iSrc = 0; iSrc < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc; iSrc++ { - if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(iSrc)*112)).FiCursor { - pTab = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(iSrc)*112)).FpTab + if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(iSrc)*112)).FiCursor { + pTab = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(iSrc)*112)).FpTab break } } @@ -90544,11 +91512,11 @@ func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*32)).FzName } else { - zCol = ts + 9563 /* "ROWID" */ + zCol = ts + 9656 /* "ROWID" */ } if SQLITE_IGNORE == Xsqlite3AuthReadCol(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } } @@ -90556,18 +91524,14 @@ func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint // 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 Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, zArg2 uintptr, zArg3 uintptr) int32 { /* sqlite3.c:110316:20: */ +func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, zArg2 uintptr, zArg3 uintptr) int32 { /* sqlite3.c:111442:20: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var rc int32 // Don't do any authorization checks if the database is initialising // or if the parser is being invoked from within sqlite3_declare_vtab. - if ((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) || (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL) { - return SQLITE_OK - } - - if (*Sqlite3)(unsafe.Pointer(db)).FxAuth == uintptr(0) { + if (((*Sqlite3)(unsafe.Pointer(db)).FxAuth == uintptr(0)) || ((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0)) || (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL) { return SQLITE_OK } @@ -90578,9 +91542,9 @@ func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, // The following testcase() macros show that any of the 3rd through 6th // parameters can be either NULL or a string. - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 488 /* &.xAuth */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 496 /* &.xAuth */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == SQLITE_DENY { - Xsqlite3ErrorMsg(tls, pParse, ts+13234 /* "not authorized" */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+13647 /* "not authorized" */, 0) (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_AUTH } else if (rc != SQLITE_OK) && (rc != SQLITE_IGNORE) { rc = SQLITE_DENY @@ -90592,7 +91556,7 @@ func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, // Push an authorization context. After this routine is called, the // zArg3 argument to authorization callbacks will be zContext until // popped. Or if pParse==0, this routine is a no-op. -func Xsqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zContext uintptr) { /* sqlite3.c:110369:21: */ +func Xsqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zContext uintptr) { /* sqlite3.c:111491:21: */ (*AuthContext)(unsafe.Pointer(pContext)).FpParse = pParse (*AuthContext)(unsafe.Pointer(pContext)).FzAuthContext = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext @@ -90601,7 +91565,7 @@ func Xsqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zC // Pop an authorization context that was previously pushed // by sqlite3AuthContextPush -func Xsqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { /* sqlite3.c:110384:21: */ +func Xsqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { /* sqlite3.c:111506:21: */ if (*AuthContext)(unsafe.Pointer(pContext)).FpParse != 0 { (*Parse)(unsafe.Pointer((*AuthContext)(unsafe.Pointer(pContext)).FpParse)).FzAuthContext = (*AuthContext)(unsafe.Pointer(pContext)).FzAuthContext (*AuthContext)(unsafe.Pointer(pContext)).FpParse = uintptr(0) @@ -90616,13 +91580,8 @@ func Xsqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { /* sqlite3.c:1103 // 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 Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock U8, zName uintptr) { /* sqlite3.c:110443:21: */ - var pToplevel uintptr = func() uintptr { - if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { - return (*Parse)(unsafe.Pointer(pParse)).FpToplevel - } - return pParse - }() +func Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock U8, zName uintptr) { /* sqlite3.c:111565:21: */ + var pToplevel uintptr var i int32 var nBytes int32 var p uintptr @@ -90633,6 +91592,12 @@ func Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWr if !(Xsqlite3BtreeSharable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+uintptr(iDb)*32)).FpBt) != 0) { return } + pToplevel = func() uintptr { + if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { + return (*Parse)(unsafe.Pointer(pParse)).FpToplevel + } + return pParse + }() for i = 0; i < (*Parse)(unsafe.Pointer(pToplevel)).FnTableLock; i++ { p = ((*Parse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(i)*24) if ((*TableLock)(unsafe.Pointer(p)).FiDb == iDb) && ((*TableLock)(unsafe.Pointer(p)).FiTab == iTab) { @@ -90657,12 +91622,9 @@ func Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWr // Code an OP_TableLock instruction for each table locked by the // statement (configured by calls to sqlite3TableLock()). -func codeTableLocks(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110485:13: */ +func codeTableLocks(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:111608:13: */ var i int32 - var pVdbe uintptr - - pVdbe = Xsqlite3GetVdbe(tls, pParse) - // sqlite3GetVdbe cannot fail: VDBE already allocated + var pVdbe uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe for i = 0; i < (*Parse)(unsafe.Pointer(pParse)).FnTableLock; i++ { var p uintptr = ((*Parse)(unsafe.Pointer(pParse)).FaTableLock + uintptr(i)*24) @@ -90684,7 +91646,7 @@ func codeTableLocks(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110485:13: */ // // Note that if an error occurred, it might be the case that // no VDBE code was generated. -func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110526:21: */ +func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:111647:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -90704,9 +91666,36 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110526:2 // Begin by generating some termination code at the end of the // vdbe program - v = Xsqlite3GetVdbe(tls, pParse) + v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe + if v == uintptr(0) { + if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 { + (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_DONE + return + } + v = Xsqlite3GetVdbe(tls, pParse) + if v == uintptr(0) { + (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR + } + } if v != 0 { + if (*Parse)(unsafe.Pointer(pParse)).FbReturning != 0 { + var pReturning uintptr = *(*uintptr)(unsafe.Pointer(pParse + 184 /* &.u1 */)) + var addrRewind int32 + var i int32 + var reg int32 + + addrRewind = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur) + + reg = (*Returning)(unsafe.Pointer(pReturning)).FiRetReg + for i = 0; i < (*Returning)(unsafe.Pointer(pReturning)).FnRetCol; i++ { + Xsqlite3VdbeAddOp3(tls, v, OP_Column, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, i, (reg + i)) + } + Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, reg, i) + Xsqlite3VdbeAddOp2(tls, v, OP_Next, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, (addrRewind + 1)) + + Xsqlite3VdbeJumpHere(tls, v, addrRewind) + } Xsqlite3VdbeAddOp0(tls, v, OP_Halt) // The cookie mask contains one bit for each database file open. @@ -90736,7 +91725,7 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110526:2 if int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0 { Xsqlite3VdbeChangeP5(tls, v, uint16(1)) } - Xsqlite3VdbeComment(tls, v, ts+13249 /* "usesStmtJournal=..." */, libc.VaList(bp, (libc.Bool32(((*Parse)(unsafe.Pointer(pParse)).FmayAbort != 0) && ((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite != 0))))) + Xsqlite3VdbeComment(tls, v, ts+13662 /* "usesStmtJournal=..." */, libc.VaList(bp, (libc.Bool32(((*Parse)(unsafe.Pointer(pParse)).FmayAbort != 0) && ((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite != 0))))) } for i = 0; i < (*Parse)(unsafe.Pointer(pParse)).FnVtabLock; i++ { var vtab uintptr = Xsqlite3GetVTable(tls, db, *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FapVtabLock + uintptr(i)*8))) @@ -90769,6 +91758,11 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110526:2 } } + if (*Parse)(unsafe.Pointer(pParse)).FbReturning != 0 { + var pRet uintptr = *(*uintptr)(unsafe.Pointer(pParse + 184 /* &.u1 */)) + Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Returning)(unsafe.Pointer(pRet)).FiRetCur, (*Returning)(unsafe.Pointer(pRet)).FnRetCol) + } + // Finally, jump back to the beginning of the executable code. Xsqlite3VdbeGoto(tls, v, 1) } @@ -90796,16 +91790,16 @@ func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110526:2 // Not everything is nestable. This facility is designed to permit // INSERT, UPDATE, and DELETE operations against the schema table. Use // care if you decide to try to use this routine for some other purposes. -func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:110653:21: */ - bp := tls.Alloc(168) - defer tls.Free(168) +func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:111804:21: */ + bp := tls.Alloc(160) + defer tls.Free(160) var ap Va_list _ = ap var zSql uintptr - *(*uintptr)(unsafe.Pointer(bp + 160 /* zErrMsg */)) = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 152 /* zErrMsg */)) = uintptr(0) var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - // var saveBuf [160]int8 at bp, 160 + // var saveBuf [152]int8 at bp, 152 if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return @@ -90825,12 +91819,12 @@ func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uint return } (*Parse)(unsafe.Pointer(pParse)).Fnested++ - libc.Xmemcpy(tls, bp /* &saveBuf[0] */, ((pParse) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */))))) - libc.Xmemset(tls, ((pParse) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), 0, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */))))) - Xsqlite3RunParser(tls, pParse, zSql, bp+160 /* &zErrMsg */) - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 160 /* zErrMsg */))) + libc.Xmemcpy(tls, bp /* &saveBuf[0] */, ((pParse) + uintptr((uint64((uintptr(0) + 256 /* &.sLastToken */))))), (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 256 /* &.sLastToken */))))) + libc.Xmemset(tls, ((pParse) + uintptr((uint64((uintptr(0) + 256 /* &.sLastToken */))))), 0, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 256 /* &.sLastToken */))))) + Xsqlite3RunParser(tls, pParse, zSql, bp+152 /* &zErrMsg */) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 152 /* zErrMsg */))) Xsqlite3DbFree(tls, db, zSql) - libc.Xmemcpy(tls, ((pParse) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), bp /* &saveBuf[0] */, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */))))) + libc.Xmemcpy(tls, ((pParse) + uintptr((uint64((uintptr(0) + 256 /* &.sLastToken */))))), bp /* &saveBuf[0] */, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 256 /* &.sLastToken */))))) (*Parse)(unsafe.Pointer(pParse)).Fnested-- } @@ -90844,7 +91838,7 @@ func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uint // auxiliary databases added using the ATTACH command. // // See also sqlite3LocateTable(). -func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintptr) uintptr { /* sqlite3.c:110705:22: */ +func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintptr) uintptr { /* sqlite3.c:111856:22: */ var p uintptr = uintptr(0) var i int32 @@ -90859,25 +91853,25 @@ func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Sqlite3)(unsafe.Pointer(db)).FnDb { // No match against the official names. But always match "main" // to schema 0 as a legacy fallback. - if Xsqlite3StrICmp(tls, zDatabase, ts+8333 /* "main" */) == 0 { + if Xsqlite3StrICmp(tls, zDatabase, ts+8426 /* "main" */) == 0 { i = 0 } else { return uintptr(0) } } p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema + 8 /* &.tblHash */), zName) - if (p == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+10128 /* "sqlite_" */, 7) == 0) { + if (p == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+10221 /* "sqlite_" */, 7) == 0) { if i == 1 { - if ((Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13268 /* "sqlite_temp_sche..." */ +7)) == 0) || - (Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13287 /* "sqlite_schema" */ +7)) == 0)) || - (Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+7541 /* "sqlite_master" */ +7)) == 0) { + if ((Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13681 /* "sqlite_temp_sche..." */ +7)) == 0) || + (Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13700 /* "sqlite_schema" */ +7)) == 0)) || + (Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+7634 /* "sqlite_master" */ +7)) == 0) { p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema + 8 /* &.tblHash */), - ts+13301 /* "sqlite_temp_mast..." */) + ts+13714 /* "sqlite_temp_mast..." */) } } else { - if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13287 /* "sqlite_schema" */ +7)) == 0 { + if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13700 /* "sqlite_schema" */ +7)) == 0 { p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema + 8 /* &.tblHash */), - ts+7541 /* "sqlite_master" */) + ts+7634 /* "sqlite_master" */) } } } @@ -90900,12 +91894,12 @@ func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp break } } - if (p == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+10128 /* "sqlite_" */, 7) == 0) { - if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13287 /* "sqlite_schema" */ +7)) == 0 { - p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema + 8 /* &.tblHash */), ts+7541 /* "sqlite_master" */) - } else if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13268 /* "sqlite_temp_sche..." */ +7)) == 0 { + if (p == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+10221 /* "sqlite_" */, 7) == 0) { + if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13700 /* "sqlite_schema" */ +7)) == 0 { + p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FpSchema + 8 /* &.tblHash */), ts+7634 /* "sqlite_master" */) + } else if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13681 /* "sqlite_temp_sche..." */ +7)) == 0 { p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema + 8 /* &.tblHash */), - ts+13301 /* "sqlite_temp_mast..." */) + ts+13714 /* "sqlite_temp_mast..." */) } } } @@ -90920,7 +91914,7 @@ func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp // The difference between this routine and sqlite3FindTable() is that this // routine leaves an error message in pParse->zErrMsg where // sqlite3FindTable() does not. -func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr, zDbase uintptr) uintptr { /* sqlite3.c:110783:22: */ +func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr, zDbase uintptr) uintptr { /* sqlite3.c:111934:22: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -90929,7 +91923,7 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr // Read the database schema. If an error occurs, leave an error message // and code in pParse and return NULL. - if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaKnownOk) == U32(0)) && + if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaKnownOk)) == U32(0)) && (SQLITE_OK != Xsqlite3ReadSchema(tls, pParse)) { return uintptr(0) } @@ -90940,15 +91934,15 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr // CREATE, then check to see if it is the name of an virtual table that // can be an eponymous virtual table. if int32((*Parse)(unsafe.Pointer(pParse)).FdisableVtab) == 0 { - var pMod uintptr = Xsqlite3HashFind(tls, (db + 528 /* &.aModule */), zName) - if (pMod == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+13320 /* "pragma_" */, 7) == 0) { + var pMod uintptr = Xsqlite3HashFind(tls, (db + 536 /* &.aModule */), zName) + if (pMod == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+13733 /* "pragma_" */, 7) == 0) { pMod = Xsqlite3PragmaVtabRegister(tls, db, zName) } if (pMod != 0) && (Xsqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0) { return (*Module)(unsafe.Pointer(pMod)).FpEpoTab } } - if (flags & LOCATE_NOERR) != 0 { + if (flags & U32(LOCATE_NOERR)) != 0 { return uintptr(0) } (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) @@ -90958,15 +91952,15 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr if p == uintptr(0) { var zMsg uintptr - if (flags & LOCATE_VIEW) != 0 { - zMsg = ts + 13328 /* "no such view" */ + if (flags & U32(LOCATE_VIEW)) != 0 { + zMsg = ts + 13741 /* "no such view" */ } else { - zMsg = ts + 13341 /* "no such table" */ + zMsg = ts + 13754 /* "no such table" */ } if zDbase != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+8526 /* "%s: %s.%s" */, libc.VaList(bp, zMsg, zDbase, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+8619 /* "%s: %s.%s" */, libc.VaList(bp, zMsg, zDbase, zName)) } else { - Xsqlite3ErrorMsg(tls, pParse, ts+8536 /* "%s: %s" */, libc.VaList(bp+24, zMsg, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+8629 /* "%s: %s" */, libc.VaList(bp+24, zMsg, zName)) } } @@ -90980,16 +91974,16 @@ func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr // 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 Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr) uintptr { /* sqlite3.c:110843:22: */ +func Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr) uintptr { /* sqlite3.c:111994:22: */ var zDb uintptr - if (*SrcList_item)(unsafe.Pointer(p)).FpSchema != 0 { - var iDb int32 = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcList_item)(unsafe.Pointer(p)).FpSchema) + if (*SrcItem)(unsafe.Pointer(p)).FpSchema != 0 { + var iDb int32 = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcItem)(unsafe.Pointer(p)).FpSchema) zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32)).FzDbSName } else { - zDb = (*SrcList_item)(unsafe.Pointer(p)).FzDatabase + zDb = (*SrcItem)(unsafe.Pointer(p)).FzDatabase } - return Xsqlite3LocateTable(tls, pParse, flags, (*SrcList_item)(unsafe.Pointer(p)).FzName, zDb) + return Xsqlite3LocateTable(tls, pParse, flags, (*SrcItem)(unsafe.Pointer(p)).FzName, zDb) } // Locate the in-memory structure that describes @@ -91002,7 +91996,7 @@ func Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr // for duplicate index names is done.) The search order is // TEMP first, then MAIN, then any auxiliary databases added // using the ATTACH command. -func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:110871:22: */ +func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:112022:22: */ var p uintptr = uintptr(0) var i int32 // All mutexes are required for schema access. Make sure we hold them. @@ -91029,7 +92023,7 @@ func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) ui } // Reclaim the memory used by an index -func Xsqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:110891:21: */ +func Xsqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:112042:21: */ Xsqlite3DeleteIndexSamples(tls, db, p) Xsqlite3ExprDelete(tls, db, (*Index)(unsafe.Pointer(p)).FpPartIdxWhere) Xsqlite3ExprListDelete(tls, db, (*Index)(unsafe.Pointer(p)).FaColExpr) @@ -91045,7 +92039,7 @@ func Xsqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:1108 // 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 Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName uintptr) { /* sqlite3.c:110911:21: */ +func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName uintptr) { /* sqlite3.c:112062:21: */ var pIndex uintptr var pHash uintptr @@ -91068,7 +92062,7 @@ func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName } Xsqlite3FreeIndex(tls, db, pIndex) } - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) } // Look through the list of open database files in db->aDb[] and if @@ -91077,7 +92071,7 @@ func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName // // Entry 0 (the "main" database) and entry 1 (the "temp" database) // are never candidates for being collapsed. -func Xsqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { /* sqlite3.c:110944:21: */ +func Xsqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { /* sqlite3.c:112095:21: */ var i int32 var j int32 for i = libc.AssignInt32(&j, 2); i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { @@ -91093,17 +92087,17 @@ func Xsqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { /* sqlite3.c:110 j++ } (*Sqlite3)(unsafe.Pointer(db)).FnDb = j - if ((*Sqlite3)(unsafe.Pointer(db)).FnDb <= 2) && ((*Sqlite3)(unsafe.Pointer(db)).FaDb != db+648 /* &.aDbStatic */) { - libc.Xmemcpy(tls, db+648 /* &.aDbStatic */, (*Sqlite3)(unsafe.Pointer(db)).FaDb, (uint64(2) * uint64(unsafe.Sizeof(Db{})))) + if ((*Sqlite3)(unsafe.Pointer(db)).FnDb <= 2) && ((*Sqlite3)(unsafe.Pointer(db)).FaDb != db+656 /* &.aDbStatic */) { + libc.Xmemcpy(tls, db+656 /* &.aDbStatic */, (*Sqlite3)(unsafe.Pointer(db)).FaDb, (uint64(2) * uint64(unsafe.Sizeof(Db{})))) Xsqlite3DbFree(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaDb) - (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 648 /* &.aDbStatic */ + (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 656 /* &.aDbStatic */ } } // Reset the schema for the database at index iDb. Also reset the // TEMP schema. The reset is deferred if db->nSchemaLock is not zero. // Deferred resets may be run by calling with iDb<0. -func Xsqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32) { /* sqlite3.c:110971:21: */ +func Xsqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32) { /* sqlite3.c:112122:21: */ var i int32 if iDb >= 0 { @@ -91124,7 +92118,7 @@ func Xsqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32) { /* sqlite3.c // Erase all schema information from all attached databases (including // "main" and "temp") for a single database connection. -func Xsqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr) { /* sqlite3.c:110995:21: */ +func Xsqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr) { /* sqlite3.c:112146:21: */ var i int32 Xsqlite3BtreeEnterAll(tls, db) for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { @@ -91146,13 +92140,13 @@ func Xsqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr) { /* sqlite3 } // This routine is called when a commit occurs. -func Xsqlite3CommitInternalChanges(tls *libc.TLS, db uintptr) { /* sqlite3.c:111019:21: */ +func Xsqlite3CommitInternalChanges(tls *libc.TLS, db uintptr) { /* sqlite3.c:112170:21: */ *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_SchemaChange))) } // Delete memory allocated for the column names of a table or view (the // Table.aCol[] array). -func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:111027:21: */ +func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:112178:21: */ var i int32 var pCol uintptr @@ -91194,7 +92188,7 @@ func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { /* s // 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 *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:111057:29: */ +func deleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:112208:29: */ var pIndex uintptr var pNext uintptr @@ -91227,7 +92221,7 @@ func deleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:11105 } -func Xsqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:111108:21: */ +func Xsqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:112259:21: */ // Do not delete the table until the reference count reaches zero. if !(pTable != 0) { return @@ -91240,7 +92234,7 @@ func Xsqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3 // Unlink the given table from the hash tables and the delete the // table structure with all its indices and foreign keys. -func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName uintptr) { /* sqlite3.c:111120:21: */ +func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName uintptr) { /* sqlite3.c:112271:21: */ var p uintptr var pDb uintptr @@ -91248,7 +92242,7 @@ func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32) p = Xsqlite3HashInsert(tls, ((*Db)(unsafe.Pointer(pDb)).FpSchema + 8 /* &.tblHash */), zTabName, uintptr(0)) Xsqlite3DeleteTable(tls, db, p) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) } // Given a token, return a string that consists of the text of that @@ -91262,7 +92256,7 @@ func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName // 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 Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr { /* sqlite3.c:111148:21: */ +func Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr { /* sqlite3.c:112299:21: */ var zName uintptr if pName != 0 { zName = Xsqlite3DbStrNDup(tls, db, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn)) @@ -91275,9 +92269,9 @@ func Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr { / // Open the sqlite_schema table stored in database number iDb for // writing. The table is opened using cursor 0. -func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { /* sqlite3.c:111163:21: */ +func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { /* sqlite3.c:112314:21: */ var v uintptr = Xsqlite3GetVdbe(tls, p) - Xsqlite3TableLock(tls, p, iDb, SCHEMA_ROOT, uint8(1), ts+7541 /* "sqlite_master" */) + Xsqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), ts+7634 /* "sqlite_master" */) Xsqlite3VdbeAddOp4Int(tls, v, OP_OpenWrite, 0, SCHEMA_ROOT, iDb, 5) if (*Parse)(unsafe.Pointer(p)).FnTab == 0 { (*Parse)(unsafe.Pointer(p)).FnTab = 1 @@ -91288,7 +92282,7 @@ func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { /* sqlite3.c // 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 Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:111178:20: */ +func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:112329:20: */ var i int32 = -1 // Database number if zName != 0 { var pDb uintptr @@ -91304,7 +92298,7 @@ func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sql } // "main" is always an acceptable alias for the primary database // even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. - if (i == 0) && (0 == Xsqlite3_stricmp(tls, ts+8333 /* "main" */, zName)) { + if (i == 0) && (0 == Xsqlite3_stricmp(tls, ts+8426 /* "main" */, zName)) { goto __3 } @@ -91324,7 +92318,7 @@ func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sql // "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 Xsqlite3FindDb(tls *libc.TLS, db uintptr, pName uintptr) int32 { /* sqlite3.c:111198:20: */ +func Xsqlite3FindDb(tls *libc.TLS, db uintptr, pName uintptr) int32 { /* sqlite3.c:112349:20: */ var i int32 // Database number var zName uintptr // Name we are searching for zName = Xsqlite3NameFromToken(tls, db, pName) @@ -91348,7 +92342,7 @@ func Xsqlite3FindDb(tls *libc.TLS, db uintptr, pName uintptr) int32 { /* sqlite3 // 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 Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pUnqual uintptr) int32 { /* sqlite3.c:111223:20: */ +func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pUnqual uintptr) int32 { /* sqlite3.c:112374:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -91357,13 +92351,13 @@ func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if (*Token)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+13355 /* "corrupt database" */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+13768 /* "corrupt database" */, 0) return -1 } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = Xsqlite3FindDb(tls, db, pName1) if iDb < 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+13372 /* "unknown database..." */, libc.VaList(bp, pName1)) + Xsqlite3ErrorMsg(tls, pParse, ts+13785 /* "unknown database..." */, libc.VaList(bp, pName1)) return -1 } } else { @@ -91375,9 +92369,9 @@ func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } // True if PRAGMA writable_schema is ON -func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:111256:20: */ +func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:112407:20: */ - return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (uint64(SQLITE_WriteSchema | SQLITE_Defensive))) == SQLITE_WriteSchema)) + return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (uint64(SQLITE_WriteSchema | SQLITE_Defensive))) == uint64(SQLITE_WriteSchema))) } // This routine is used to check if the UTF-8 string zName is a legal @@ -91389,13 +92383,13 @@ func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:1112 // When parsing the sqlite_schema table, this routine also checks to // make sure the "type", "name", and "tbl_name" columns are consistent // with the SQL. -func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType uintptr, zTblName uintptr) int32 { /* sqlite3.c:111278:20: */ +func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType uintptr, zTblName uintptr) int32 { /* sqlite3.c:112429:20: */ bp := tls.Alloc(8) defer tls.Free(8) var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if ((Xsqlite3WritableSchema(tls, db) != 0) || - ((uint32(int32(*(*uint8)(unsafe.Pointer((db + 176 /* &.init */) + 8 /* &.imposterTable */)) & 0x2 >> 1))) != 0)) || + ((uint32(int32(*(*uint8)(unsafe.Pointer((db + 184 /* &.init */) + 8 /* &.imposterTable */)) & 0x2 >> 1))) != 0)) || !(int32(Xsqlite3Config.FbExtraSchemaChecks) != 0) { // Skip these error checks for writable_schema=ON return SQLITE_OK @@ -91408,9 +92402,9 @@ func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType return SQLITE_ERROR } } else { - if ((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && (0 == Xsqlite3_strnicmp(tls, zName, ts+10128 /* "sqlite_" */, 7))) || + if ((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && (0 == Xsqlite3_strnicmp(tls, zName, ts+10221 /* "sqlite_" */, 7))) || ((Xsqlite3ReadOnlyShadowTables(tls, db) != 0) && (Xsqlite3ShadowTableName(tls, db, zName) != 0)) { - Xsqlite3ErrorMsg(tls, pParse, ts+13392, /* "object name rese..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+13805, /* "object name rese..." */ libc.VaList(bp, zName)) return SQLITE_ERROR } @@ -91420,7 +92414,7 @@ func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType } // Return the PRIMARY KEY index of a table -func Xsqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:111316:22: */ +func Xsqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:112467:22: */ var p uintptr for p = (*Table)(unsafe.Pointer(pTab)).FpIndex; (p != 0) && !((int32(*(*uint16)(unsafe.Pointer((p) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY); p = (*Index)(unsafe.Pointer(p)).FpNext { } @@ -91431,7 +92425,7 @@ func Xsqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c // for the column iCol in the table (as defined by the CREATE TABLE statement) // find the (first) offset of that column in index pIdx. Or return -1 // if column iCol is not used in index pIdx. -func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16 { /* sqlite3.c:111328:20: */ +func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16 { /* sqlite3.c:112479:20: */ var i int32 for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ { if int32(iCol) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { @@ -91451,8 +92445,8 @@ func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16 { /* // and only there are VIRTUAL columns to the left. // // If SQLITE_OMIT_GENERATED_COLUMNS, this routine is a no-op macro. -func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:111348:20: */ - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasVirtual) != 0 { +func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:112499:20: */ + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasVirtual)) != 0 { var i int32 for i = 0; i <= int32(iCol); i++ { if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) != 0 { @@ -91498,11 +92492,11 @@ func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16 { / // this routine is a no-op macro. If the pTab does not have any virtual // columns, then this routine is no-op that always return iCol. If iCol // is negative (indicating the ROWID column) then this routine return iCol. -func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:111396:20: */ +func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:112547:20: */ var i int32 var n I16 - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasVirtual) == U32(0)) || (int32(iCol) < 0) { + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasVirtual)) == U32(0)) || (int32(iCol) < 0) { return iCol } i = 0 @@ -91536,7 +92530,7 @@ func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16 { / // 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 Xsqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, isTemp int32, isView int32, isVirtual int32, noErr int32) { /* sqlite3.c:111430:21: */ +func Xsqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, isTemp int32, isView int32, isVirtual int32, noErr int32) { /* sqlite3.c:112581:21: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -91564,9 +92558,9 @@ func Xsqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui iDb = int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) zName = Xsqlite3DbStrDup(tls, db, func() uintptr { if (!(0 != 0)) && (iDb == 1) { - return ts + 13301 /* "sqlite_temp_mast..." */ + return ts + 13714 /* "sqlite_temp_mast..." */ } - return ts + 7541 /* "sqlite_master" */ + return ts + 7634 /* "sqlite_master" */ }()) *(*uintptr)(unsafe.Pointer(bp + 16 /* pName */)) = pName1 goto __2 @@ -91584,7 +92578,7 @@ __3: } // If creating a temp table, the name may not be qualified. Unless // the database name is "temp" anyway. - Xsqlite3ErrorMsg(tls, pParse, ts+13434 /* "temporary table ..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+13847 /* "temporary table ..." */, 0) return __4: ; @@ -91612,9 +92606,9 @@ __7: ; if !(Xsqlite3CheckObjectName(tls, pParse, zName, func() uintptr { if isView != 0 { - return ts + 11885 /* "view" */ + return ts + 12035 /* "view" */ } - return ts + 8236 /* "table" */ + return ts + 8329 /* "table" */ }(), zName) != 0) { goto __8 } @@ -91631,9 +92625,9 @@ __9: zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr { if (!(0 != 0)) && (isTemp == 1) { - return ts + 13301 /* "sqlite_temp_mast..." */ + return ts + 13714 /* "sqlite_temp_mast..." */ } - return ts + 7541 /* "sqlite_master" */ + return ts + 7634 /* "sqlite_master" */ }(), uintptr(0), zDb) != 0) { goto __10 } @@ -91671,7 +92665,7 @@ __13: if !(!(noErr != 0)) { goto __15 } - Xsqlite3ErrorMsg(tls, pParse, ts+13475 /* "table %T already..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 16 /* pName */)))) + Xsqlite3ErrorMsg(tls, pParse, ts+13888 /* "table %T already..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 16 /* pName */)))) goto __16 __15: ; @@ -91684,7 +92678,7 @@ __14: if !(Xsqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0)) { goto __17 } - Xsqlite3ErrorMsg(tls, pParse, ts+13499 /* "there is already..." */, libc.VaList(bp+8, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+13912 /* "there is already..." */, libc.VaList(bp+8, zName)) goto begin_table_error __17: ; @@ -91712,7 +92706,7 @@ __18: // If this is the magic sqlite_sequence table used by autoincrement, // then record a pointer to this table in the main database structure // so that INSERT can find the table easily. - if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) && (libc.Xstrcmp(tls, zName, ts+11072 /* "sqlite_sequence" */) == 0)) { + if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) && (libc.Xstrcmp(tls, zName, ts+11173 /* "sqlite_sequence" */) == 0)) { goto __19 } @@ -91747,7 +92741,7 @@ __21: Xsqlite3VdbeAddOp3(tls, v, OP_ReadCookie, iDb, reg3, BTREE_FILE_FORMAT) Xsqlite3VdbeUsesBtree(tls, v, iDb) addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_If, reg3) - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LegacyFileFmt) != uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LegacyFileFmt)) != uint64(0) { fileFormat = 1 } else { fileFormat = SQLITE_MAX_FILE_FORMAT @@ -91770,15 +92764,15 @@ __21: Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, reg2) goto __23 __22: - - (*Parse)(unsafe.Pointer(pParse)).FaddrCrTab = Xsqlite3VdbeAddOp3(tls, v, OP_CreateBtree, iDb, reg2, BTREE_INTKEY) + ; + *(*int32)(unsafe.Pointer(pParse + 184 /* &.u1 */)) = Xsqlite3VdbeAddOp3(tls, v, OP_CreateBtree, iDb, reg2, BTREE_INTKEY) __23: ; Xsqlite3OpenSchemaTable(tls, pParse, iDb) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, 0, reg1) Xsqlite3VdbeAddOp4(tls, v, OP_Blob, 6, reg3, 0, uintptr(unsafe.Pointer(&nullRow)), -1) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, 0, reg3, reg1) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3VdbeAddOp0(tls, v, OP_Close) __20: ; @@ -91793,23 +92787,93 @@ begin_table_error: } var aCode = [4]U8{ - SQLITE_CREATE_TABLE, - SQLITE_CREATE_TEMP_TABLE, - SQLITE_CREATE_VIEW, - SQLITE_CREATE_TEMP_VIEW, -} /* sqlite3.c:111477:21 */ -var nullRow = [6]int8{int8(6), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:111565:23 */ + U8(SQLITE_CREATE_TABLE), + U8(SQLITE_CREATE_TEMP_TABLE), + U8(SQLITE_CREATE_VIEW), + U8(SQLITE_CREATE_TEMP_VIEW), +} /* sqlite3.c:112628:21 */ +var nullRow = [6]int8{int8(6), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:112716:23 */ // Set properties of a table column based on the (magical) // name of the column. +// Name of the special TEMP trigger used to implement RETURNING. The +// name begins with "sqlite_" so that it is guaranteed not to collide +// with any application-generated triggers. + +// Clean up the data structures associated with the RETURNING clause. +func sqlite3DeleteReturning(tls *libc.TLS, db uintptr, pRet uintptr) { /* sqlite3.c:112800:13: */ + var pHash uintptr + pHash = ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema + 56 /* &.trigHash */) + Xsqlite3HashInsert(tls, pHash, ts+13947 /* "sqlite_returning" */, uintptr(0)) + Xsqlite3ExprListDelete(tls, db, (*Returning)(unsafe.Pointer(pRet)).FpReturnEL) + Xsqlite3DbFree(tls, db, pRet) +} + +// Add the RETURNING clause to the parse currently underway. +// +// This routine creates a special TEMP trigger that will fire for each row +// of the DML statement. That TEMP trigger contains a single SELECT +// statement with a result set that is the argument of the RETURNING clause. +// The trigger has the Trigger.bReturning flag and an opcode of +// TK_RETURNING instead of TK_SELECT, so that the trigger code generator +// knows to handle it specially. The TEMP trigger is automatically +// removed at the end of the parse. +// +// When this routine is called, we do not yet know if the RETURNING clause +// is attached to a DELETE, INSERT, or UPDATE, so construct it as a +// RETURNING trigger instead. It will then be converted into the appropriate +// type on the first call to sqlite3TriggersExist(). +func Xsqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sqlite3.c:112824:21: */ + var pRet uintptr + var pHash uintptr + var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb + if (*Parse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { + Xsqlite3ErrorMsg(tls, pParse, ts+13964 /* "cannot use RETUR..." */, 0) + } else { + + } + (*Parse)(unsafe.Pointer(pParse)).FbReturning = U8(1) + pRet = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Returning{}))) + if pRet == uintptr(0) { + Xsqlite3ExprListDelete(tls, db, pList) + return + } + *(*uintptr)(unsafe.Pointer(pParse + 184 /* &.u1 */)) = pRet + (*Returning)(unsafe.Pointer(pRet)).FpParse = pParse + (*Returning)(unsafe.Pointer(pRet)).FpReturnEL = pList + Xsqlite3ParserAddCleanup(tls, pParse, + *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{sqlite3DeleteReturning})), pRet) + + if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + return + } + (*Returning)(unsafe.Pointer(pRet)).FretTrig.FzName = ts + 13947 /* "sqlite_returning" */ + (*Returning)(unsafe.Pointer(pRet)).FretTrig.Fop = U8(TK_RETURNING) + (*Returning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = U8(TRIGGER_AFTER) + (*Returning)(unsafe.Pointer(pRet)).FretTrig.FbReturning = U8(1) + (*Returning)(unsafe.Pointer(pRet)).FretTrig.FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FpSchema + (*Returning)(unsafe.Pointer(pRet)).FretTrig.Fstep_list = (pRet + 88 /* &.retTStep */) + (*Returning)(unsafe.Pointer(pRet)).FretTStep.Fop = U8(TK_RETURNING) + (*Returning)(unsafe.Pointer(pRet)).FretTStep.FpTrig = (pRet + 16 /* &.retTrig */) + (*Returning)(unsafe.Pointer(pRet)).FretTStep.FpExprList = pList + pHash = ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema + 56 /* &.trigHash */) + + if Xsqlite3HashInsert(tls, pHash, ts+13947 /* "sqlite_returning" */, (pRet+16 /* &.retTrig */)) == + (pRet + 16 /* &.retTrig */) { + Xsqlite3OomFault(tls, db) + } +} + // 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 Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintptr) { /* sqlite3.c:111646:21: */ +func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintptr) { /* sqlite3.c:112871:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -91819,11 +92883,13 @@ func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintp var zType uintptr var pCol uintptr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb + var hName U8 + if (libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0) { return } - if (int32((*Table)(unsafe.Pointer(p)).FnCol) + 1) > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 2*4)) { - Xsqlite3ErrorMsg(tls, pParse, ts+13534 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName)) + if (int32((*Table)(unsafe.Pointer(p)).FnCol) + 1) > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 2*4)) { + Xsqlite3ErrorMsg(tls, pParse, ts+13998 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName)) return } z = Xsqlite3DbMallocRaw(tls, db, (uint64(((*Token)(unsafe.Pointer(pName)).Fn + (*Token)(unsafe.Pointer(pType)).Fn) + uint32(2)))) @@ -91836,9 +92902,10 @@ func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintp libc.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn)) *(*int8)(unsafe.Pointer(z + uintptr((*Token)(unsafe.Pointer(pName)).Fn))) = int8(0) Xsqlite3Dequote(tls, z) + hName = Xsqlite3StrIHash(tls, z) for i = 0; i < int32((*Table)(unsafe.Pointer(p)).FnCol); i++ { - if Xsqlite3_stricmp(tls, z, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*32)).FzName) == 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+13557 /* "duplicate column..." */, libc.VaList(bp+8, z)) + if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*32)).FhName) == int32(hName)) && (Xsqlite3StrICmp(tls, z, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*32)).FzName) == 0) { + Xsqlite3ErrorMsg(tls, pParse, ts+14021 /* "duplicate column..." */, libc.VaList(bp+8, z)) Xsqlite3DbFree(tls, db, z) return } @@ -91855,12 +92922,12 @@ func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintp pCol = ((*Table)(unsafe.Pointer(p)).FaCol + uintptr((*Table)(unsafe.Pointer(p)).FnCol)*32) libc.Xmemset(tls, pCol, 0, uint64(unsafe.Sizeof(Column{}))) (*Column)(unsafe.Pointer(pCol)).FzName = z - (*Column)(unsafe.Pointer(pCol)).FhName = Xsqlite3StrIHash(tls, z) + (*Column)(unsafe.Pointer(pCol)).FhName = hName if (*Token)(unsafe.Pointer(pType)).Fn == uint32(0) { // If there is no type specified, columns have the default affinity // 'BLOB' with a default size of 4 bytes. - (*Column)(unsafe.Pointer(pCol)).Faffinity = SQLITE_AFF_BLOB + (*Column)(unsafe.Pointer(pCol)).Faffinity = int8(SQLITE_AFF_BLOB) (*Column)(unsafe.Pointer(pCol)).FszEst = U8(1) } else { zType = ((z + uintptr(Xsqlite3Strlen30(tls, z))) + uintptr(1)) @@ -91879,7 +92946,7 @@ func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintp // 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 Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlite3.c:111715:21: */ +func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlite3.c:112943:21: */ var p uintptr var pCol uintptr p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable @@ -91888,7 +92955,7 @@ func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlit } pCol = ((*Table)(unsafe.Pointer(p)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(p)).FnCol)-1))*32) (*Column)(unsafe.Pointer(pCol)).FnotNull = U8(onError) - *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (TF_HasNotNull) + *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_HasNotNull)) // Set the uniqNotNull flag on any UNIQUE or PK indexes already created // on this column. @@ -91926,41 +92993,41 @@ func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlit // // If none of the substrings in the above table are found, // SQLITE_AFF_NUMERIC is returned. -func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) int8 { /* sqlite3.c:111762:21: */ +func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) int8 { /* sqlite3.c:112990:21: */ bp := tls.Alloc(4) defer tls.Free(4) var h U32 = U32(0) - var aff int8 = SQLITE_AFF_NUMERIC + var aff int8 = int8(SQLITE_AFF_NUMERIC) var zChar uintptr = uintptr(0) for *(*int8)(unsafe.Pointer(zIn)) != 0 { h = ((h << 8) + U32(Xsqlite3UpperToLower[((int32(*(*int8)(unsafe.Pointer(zIn))))&0xff)])) zIn++ if h == (U32((((int32('c') << 24) + (int32('h') << 16)) + (int32('a') << 8)) + 'r')) { // CHAR - aff = SQLITE_AFF_TEXT + aff = int8(SQLITE_AFF_TEXT) zChar = zIn } else if h == (U32((((int32('c') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'b')) { // CLOB - aff = SQLITE_AFF_TEXT + aff = int8(SQLITE_AFF_TEXT) } else if h == (U32((((int32('t') << 24) + (int32('e') << 16)) + (int32('x') << 8)) + 't')) { // TEXT - aff = SQLITE_AFF_TEXT + aff = int8(SQLITE_AFF_TEXT) } else if (h == (U32((((int32('b') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'b'))) && // BLOB ((int32(aff) == SQLITE_AFF_NUMERIC) || (int32(aff) == SQLITE_AFF_REAL)) { - aff = SQLITE_AFF_BLOB + aff = int8(SQLITE_AFF_BLOB) if int32(*(*int8)(unsafe.Pointer(zIn))) == '(' { zChar = zIn } } else if (h == (U32((((int32('r') << 24) + (int32('e') << 16)) + (int32('a') << 8)) + 'l'))) && // REAL (int32(aff) == SQLITE_AFF_NUMERIC) { - aff = SQLITE_AFF_REAL + aff = int8(SQLITE_AFF_REAL) } else if (h == (U32((((int32('f') << 24) + (int32('l') << 16)) + (int32('o') << 8)) + 'a'))) && // FLOA (int32(aff) == SQLITE_AFF_NUMERIC) { - aff = SQLITE_AFF_REAL + aff = int8(SQLITE_AFF_REAL) } else if (h == (U32((((int32('d') << 24) + (int32('o') << 16)) + (int32('u') << 8)) + 'b'))) && // DOUB (int32(aff) == SQLITE_AFF_NUMERIC) { - aff = SQLITE_AFF_REAL + aff = int8(SQLITE_AFF_REAL) } else if (h & U32(0x00FFFFFF)) == (U32(((int32('i') << 16) + (int32('n') << 8)) + 't')) { // INT - aff = SQLITE_AFF_INTEGER + aff = int8(SQLITE_AFF_INTEGER) break } } @@ -92000,7 +93067,7 @@ func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) int8 { /* sq // // This routine is called by the parser while in the middle of // parsing a CREATE TABLE statement. -func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:111839:21: */ +func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:113067:21: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -92012,11 +93079,11 @@ func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar var isInit int32 = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) != 1))) pCol = ((*Table)(unsafe.Pointer(p)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(p)).FnCol)-1))*32) if !(Xsqlite3ExprIsConstantOrFunction(tls, pExpr, uint8(isInit)) != 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+13583, /* "default value of..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+14047, /* "default value of..." */ libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName)) } else if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_GENERATED) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+13628 /* "cannot use DEFAU..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+14092 /* "cannot use DEFAU..." */, 0) } else { // A copy of pExpr is used instead of the original, as pExpr contains // tokens that point to volatile memory. @@ -92024,10 +93091,10 @@ func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar Xsqlite3ExprDelete(tls, db, (*Column)(unsafe.Pointer(pCol)).FpDflt) libc.Xmemset(tls, bp+8 /* &x */, 0, uint64(unsafe.Sizeof(Expr{}))) - (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fop = TK_SPAN + (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fop = U8(TK_SPAN) *(*uintptr)(unsafe.Pointer(bp + 8 /* &x */ + 8 /* &.u */)) = Xsqlite3DbSpanDup(tls, db, zStart, zEnd) (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).FpLeft = pExpr - (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fflags = EP_Skip + (*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fflags = U32(EP_Skip) (*Column)(unsafe.Pointer(pCol)).FpDflt = Xsqlite3ExprDup(tls, db, bp+8 /* &x */, EXPRDUP_REDUCE) Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 /* &x */ + 8 /* &.u */))) } @@ -92052,21 +93119,21 @@ func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar // if the expression is just a TK_STRING with an optional COLLATE clause. // If the expression is anything other than TK_STRING, the expression is // unchanged. -func sqlite3StringToId(tls *libc.TLS, p uintptr) { /* sqlite3.c:111898:13: */ +func sqlite3StringToId(tls *libc.TLS, p uintptr) { /* sqlite3.c:113126:13: */ if int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_STRING { - (*Expr)(unsafe.Pointer(p)).Fop = TK_ID + (*Expr)(unsafe.Pointer(p)).Fop = U8(TK_ID) } else if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLLATE) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop) == TK_STRING) { - (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop = TK_ID + (*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop = U8(TK_ID) } } // Tag the given column as being part of the PRIMARY KEY -func makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { /* sqlite3.c:111909:13: */ +func makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { /* sqlite3.c:113137:13: */ *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) |= U16((COLFLAG_PRIMKEY)) if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_GENERATED) != 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+13669 /* "generated column..." */, 0) + ts+14133 /* "generated column..." */, 0) } } @@ -92086,7 +93153,7 @@ func makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { / // // 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 Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError int32, autoInc int32, sortOrder int32) { /* sqlite3.c:111939:21: */ +func Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError int32, autoInc int32, sortOrder int32) { /* sqlite3.c:113167:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -92107,15 +93174,15 @@ func Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit __1: ; - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasPrimaryKey) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasPrimaryKey)) != 0) { goto __2 } Xsqlite3ErrorMsg(tls, pParse, - ts+13721 /* "table \"%s\" has m..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + ts+14185 /* "table \"%s\" has m..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit __2: ; - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_HasPrimaryKey) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_HasPrimaryKey)) if !(pList == uintptr(0)) { goto __3 } @@ -92171,7 +93238,7 @@ __4: ; if !((((nTerm == 1) && (pCol != 0)) && - (Xsqlite3StrICmp(tls, Xsqlite3ColumnType(tls, pCol, ts+800 /* "" */), ts+13762 /* "INTEGER" */) == 0)) && + (Xsqlite3StrICmp(tls, Xsqlite3ColumnType(tls, pCol, ts+800 /* "" */), ts+14226 /* "INTEGER" */) == 0)) && (sortOrder != SQLITE_SO_DESC)) { goto __13 } @@ -92199,11 +93266,11 @@ __13: goto __17 } Xsqlite3ErrorMsg(tls, pParse, - ts+13770 /* "AUTOINCREMENT is..." */, 0) + ts+14234 /* "AUTOINCREMENT is..." */, 0) goto __18 __17: Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), - uintptr(0), sortOrder, 0, SQLITE_IDXTYPE_PRIMARYKEY) + uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) __18: ; @@ -92216,7 +93283,10 @@ primary_key_exit: } // Add a new CHECK constraint to the table currently under construction. -func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintptr) { /* sqlite3.c:112014:21: */ +func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:113242:21: */ + bp := tls.Alloc(16) + defer tls.Free(16) + var pTab uintptr = (*Parse)(unsafe.Pointer(pParse)).FpNewTable var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if ((pTab != 0) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB)) && @@ -92224,6 +93294,17 @@ func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt (*Table)(unsafe.Pointer(pTab)).FpCheck = Xsqlite3ExprListAppend(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) if (*Parse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { Xsqlite3ExprListSetName(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FpCheck, (pParse + 96 /* &.constraintName */), 1) + } else { + // var t Token at bp, 16 + + for zStart++; (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zStart)))]) & 0x01) != 0; zStart++ { + } + for (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zEnd + libc.UintptrFromInt32(-1))))]) & 0x01) != 0 { + zEnd-- + } + (*Token)(unsafe.Pointer(bp /* &t */)).Fz = zStart + (*Token)(unsafe.Pointer(bp /* &t */)).Fn = uint32((int32((int64(zEnd) - int64((*Token)(unsafe.Pointer(bp /* &t */)).Fz)) / 1))) + Xsqlite3ExprListSetName(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FpCheck, bp /* &t */, 1) } } else { Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pCheckExpr) @@ -92232,13 +93313,13 @@ func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt // Set the collation function of the most recently parsed table column // to the CollSeq given. -func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) { /* sqlite3.c:112039:21: */ +func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) { /* sqlite3.c:113276:21: */ var p uintptr var i int32 var zColl uintptr // Dequoted name of collation sequence var db uintptr - if (libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0) { + if ((libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0)) || (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { return } i = (int32((*Table)(unsafe.Pointer(p)).FnCol) - 1) @@ -92269,14 +93350,14 @@ func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) { /* // Change the most recently parsed column to be a GENERATED ALWAYS AS // column. -func Xsqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType uintptr) { /* sqlite3.c:112074:21: */ +func Xsqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType uintptr) { /* sqlite3.c:113311:21: */ bp := tls.Alloc(8) defer tls.Free(8) var eType U8 var pTab uintptr var pCol uintptr - eType = COLFLAG_VIRTUAL + eType = U8(COLFLAG_VIRTUAL) pTab = (*Parse)(unsafe.Pointer(pParse)).FpNewTable if !(pTab == uintptr(0)) { goto __1 @@ -92289,7 +93370,7 @@ __1: if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == PARSE_MODE_DECLARE_VTAB) { goto __2 } - Xsqlite3ErrorMsg(tls, pParse, ts+13826 /* "virtual tables c..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+14290 /* "virtual tables c..." */, 0) goto generated_done __2: ; @@ -92302,16 +93383,16 @@ __3: if !(pType != 0) { goto __4 } - if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(7)) && (Xsqlite3_strnicmp(tls, ts+13869 /* "virtual" */, (*Token)(unsafe.Pointer(pType)).Fz, 7) == 0)) { + if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(7)) && (Xsqlite3_strnicmp(tls, ts+14333 /* "virtual" */, (*Token)(unsafe.Pointer(pType)).Fz, 7) == 0)) { goto __5 } // no-op goto __6 __5: - if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(6)) && (Xsqlite3_strnicmp(tls, ts+13877 /* "stored" */, (*Token)(unsafe.Pointer(pType)).Fz, 6) == 0)) { + if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(6)) && (Xsqlite3_strnicmp(tls, ts+14341 /* "stored" */, (*Token)(unsafe.Pointer(pType)).Fz, 6) == 0)) { goto __7 } - eType = COLFLAG_STORED + eType = U8(COLFLAG_STORED) goto __8 __7: goto generated_error @@ -92341,7 +93422,7 @@ __10: goto generated_done generated_error: - Xsqlite3ErrorMsg(tls, pParse, ts+13884, /* "error in generat..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+14348, /* "error in generat..." */ libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName)) generated_done: Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr) @@ -92364,7 +93445,7 @@ generated_done: // // IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments // the schema-version whenever the schema changes. -func Xsqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:112142:21: */ +func Xsqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:113379:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe @@ -92378,7 +93459,7 @@ func Xsqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3 // // The estimate is conservative. It might be larger that what is // really needed. -func identLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:112158:12: */ +func identLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:113395:12: */ var n int32 n = 0 __1: @@ -92413,7 +93494,7 @@ __3: // 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 *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /* sqlite3.c:112179:13: */ +func identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /* sqlite3.c:113416:13: */ var zIdent uintptr = zSignedIdent var i int32 var j int32 @@ -92449,7 +93530,7 @@ func identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /* // 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 *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:112207:13: */ +func createTableStmt(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:113444:13: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -92484,12 +93565,12 @@ __3: n = n + (identLength(tls, (*Table)(unsafe.Pointer(p)).FzName)) if n < 50 { zSep = ts + 800 /* "" */ - zSep2 = ts + 13915 /* "," */ - zEnd = ts + 6671 /* ")" */ + zSep2 = ts + 14379 /* "," */ + zEnd = ts + 6747 /* ")" */ } else { - zSep = ts + 13917 /* "\n " */ - zSep2 = ts + 13921 /* ",\n " */ - zEnd = ts + 13926 /* "\n)" */ + zSep = ts + 14381 /* "\n " */ + zSep2 = ts + 14385 /* ",\n " */ + zEnd = ts + 14390 /* "\n)" */ } n = n + (35 + (6 * int32((*Table)(unsafe.Pointer(p)).FnCol))) zStmt = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(n)) @@ -92497,7 +93578,7 @@ __3: Xsqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, ts+13929 /* "CREATE TABLE " */, 0) + Xsqlite3_snprintf(tls, n, zStmt, ts+14393 /* "CREATE TABLE " */, 0) *(*int32)(unsafe.Pointer(bp + 8 /* k */)) = Xsqlite3Strlen30(tls, zStmt) identPut(tls, zStmt, bp+8 /* &k */, (*Table)(unsafe.Pointer(p)).FzName) *(*int8)(unsafe.Pointer(zStmt + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 8 /* k */)), 1)))) = int8('(') @@ -92537,22 +93618,22 @@ __6: var azType1 = [5]uintptr{ /* SQLITE_AFF_BLOB */ ts + 800, /* "" */ - /* SQLITE_AFF_TEXT */ ts + 13943, /* " TEXT" */ - /* SQLITE_AFF_NUMERIC */ ts + 13949, /* " NUM" */ - /* SQLITE_AFF_INTEGER */ ts + 13954, /* " INT" */ - /* SQLITE_AFF_REAL */ ts + 13959, /* " REAL" */ -} /* sqlite3.c:112237:23 */ + /* SQLITE_AFF_TEXT */ ts + 14407, /* " TEXT" */ + /* SQLITE_AFF_NUMERIC */ ts + 14413, /* " NUM" */ + /* SQLITE_AFF_INTEGER */ ts + 14418, /* " INT" */ + /* SQLITE_AFF_REAL */ ts + 14423, /* " REAL" */ +} /* sqlite3.c:113474:23 */ // Resize an Index object to hold N columns total. Return SQLITE_OK // on success and SQLITE_NOMEM on an OOM error. -func resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) int32 { /* sqlite3.c:112275:12: */ +func resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) int32 { /* sqlite3.c:113512:12: */ var zExtra uintptr var nByte int32 if int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = (int32(((uint64(unsafe.Sizeof(uintptr(0))) + uint64(unsafe.Sizeof(I16(0)))) + uint64(1)) * uint64(N))) + nByte = (int32((((uint64(unsafe.Sizeof(uintptr(0))) + uint64(unsafe.Sizeof(LogEst(0)))) + uint64(unsafe.Sizeof(I16(0)))) + uint64(1)) * uint64(N))) zExtra = Xsqlite3DbMallocZero(tls, db, uint64(nByte)) if zExtra == uintptr(0) { return SQLITE_NOMEM @@ -92560,6 +93641,9 @@ func resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) int32 { libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FazColl, (uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Index)(unsafe.Pointer(pIdx)).FnColumn))) (*Index)(unsafe.Pointer(pIdx)).FazColl = zExtra zExtra += (uintptr(uint64(unsafe.Sizeof(uintptr(0))) * uint64(N))) + libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst, (uint64(unsafe.Sizeof(LogEst(0))) * (uint64(int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) + 1)))) + (*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst = zExtra + zExtra += (uintptr(uint64(unsafe.Sizeof(LogEst(0))) * uint64(N))) libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaiColumn, (uint64(unsafe.Sizeof(I16(0))) * uint64((*Index)(unsafe.Pointer(pIdx)).FnColumn))) (*Index)(unsafe.Pointer(pIdx)).FaiColumn = zExtra zExtra += (uintptr(uint64(unsafe.Sizeof(I16(0))) * uint64(N))) @@ -92571,7 +93655,7 @@ func resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) int32 { } // Estimate the total row width for a table. -func estimateTableWidth(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:112299:13: */ +func estimateTableWidth(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:113539:13: */ var wTable uint32 = uint32(0) var pTabCol uintptr var i int32 @@ -92600,7 +93684,7 @@ __3: } // Estimate the average size of a row for an index. -func estimateIndexWidth(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:112313:13: */ +func estimateIndexWidth(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:113553:13: */ var wIndex uint32 = uint32(0) var i int32 var aCol uintptr = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol @@ -92620,7 +93704,7 @@ func estimateIndexWidth(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:112313:13: * // Return true if column number x is any of the first nCol entries of aiCol[]. // This is used to determine if the column number x appears in any of the // first nCol entries of an index. -func hasColumn(tls *libc.TLS, aiCol uintptr, nCol int32, x int32) int32 { /* sqlite3.c:112329:12: */ +func hasColumn(tls *libc.TLS, aiCol uintptr, nCol int32, x int32) int32 { /* sqlite3.c:113569:12: */ for libc.PostDecInt32(&nCol, 1) > 0 { if x == int32(*(*I16)(unsafe.Pointer(libc.PostIncUintptr(&aiCol, 2)))) { @@ -92641,7 +93725,7 @@ func hasColumn(tls *libc.TLS, aiCol uintptr, nCol int32, x int32) int32 { /* sql // This routine differs from hasColumn() in that both the column and the // collating sequence must match for this routine, but for hasColumn() only // the column name must match. -func isDupColumn(tls *libc.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int32) int32 { /* sqlite3.c:112352:12: */ +func isDupColumn(tls *libc.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int32) int32 { /* sqlite3.c:113592:12: */ var i int32 var j int32 @@ -92674,7 +93758,7 @@ func isDupColumn(tls *libc.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int3 // // The colNotIdxed mask is AND-ed with the SrcList.a[].colUsed mask // to determine if the index is covering index. -func recomputeColumnsNotIndexed(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:112391:13: */ +func recomputeColumnsNotIndexed(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:113631:13: */ var m Bitmask = uint64(0) var j int32 var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable @@ -92713,7 +93797,7 @@ func recomputeColumnsNotIndexed(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:1123 // indices with the PRIMARY KEY columns. // // For virtual tables, only (1) is performed. -func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:112431:13: */ +func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:113671:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -92727,20 +93811,21 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Mark every PRIMARY KEY column as NOT NULL (except for imposter tables) - if !((int32(*(*uint8)(unsafe.Pointer(db + 176 /* &.init */ + 8 /* &.imposterTable */)) & 0x2 >> 1)) != 0) { + if !((int32(*(*uint8)(unsafe.Pointer(db + 184 /* &.init */ + 8 /* &.imposterTable */)) & 0x2 >> 1)) != 0) { for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ { if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_PRIMKEY) != 0 { - (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)).FnotNull = OE_Abort + (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)).FnotNull = U8(OE_Abort) } } - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_HasNotNull) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_HasNotNull)) } // Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY // into BTREE_BLOBKEY. - if (*Parse)(unsafe.Pointer(pParse)).FaddrCrTab != 0 { - Xsqlite3VdbeChangeP3(tls, v, (*Parse)(unsafe.Pointer(pParse)).FaddrCrTab, BTREE_BLOBKEY) + if *(*int32)(unsafe.Pointer(pParse + 184 /* &.u1 */)) != 0 { + + Xsqlite3VdbeChangeP3(tls, v, *(*int32)(unsafe.Pointer(pParse + 184 /* &.u1 */)), BTREE_BLOBKEY) } // Locate the PRIMARY KEY index. Or, if this table was originally @@ -92762,7 +93847,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / (*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1) Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, int32((*Table)(unsafe.Pointer(pTab)).FkeyConf), uintptr(0), uintptr(0), 0, 0, - SQLITE_IDXTYPE_PRIMARYKEY) + uint8(SQLITE_IDXTYPE_PRIMARYKEY)) if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) { return } @@ -92788,7 +93873,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / } libc.SetBitFieldPtr16Uint32(pPk+100 /* &.isCovering */, uint32(1), 5, 0x20) - if !((int32(*(*uint8)(unsafe.Pointer(db + 176 /* &.init */ + 8 /* &.imposterTable */)) & 0x2 >> 1)) != 0) { + if !((int32(*(*uint8)(unsafe.Pointer(db + 184 /* &.init */ + 8 /* &.imposterTable */)) & 0x2 >> 1)) != 0) { libc.SetBitFieldPtr16Uint32(pPk+100 /* &.uniqNotNull */, uint32(1), 3, 0x8) } nPk = int32(libc.AssignPtrUint16(pPk+96 /* &.nColumn */, (*Index)(unsafe.Pointer(pPk)).FnKeyCol)) @@ -92799,7 +93884,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / // a database schema). if (v != 0) && ((*Index)(unsafe.Pointer(pPk)).Ftnum > Pgno(0)) { - Xsqlite3VdbeChangeOpcode(tls, v, int32((*Index)(unsafe.Pointer(pPk)).Ftnum), OP_Goto) + Xsqlite3VdbeChangeOpcode(tls, v, int32((*Index)(unsafe.Pointer(pPk)).Ftnum), uint8(OP_Goto)) } // The root page of the PRIMARY KEY is the table root page @@ -92871,7 +93956,7 @@ func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { / // Return true if pTab is a virtual table and zName is a shadow table name // for that virtual table. -func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uintptr) int32 { /* sqlite3.c:112581:20: */ +func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uintptr) int32 { /* sqlite3.c:113822:20: */ var nName int32 // Length of zName var pMod uintptr // Module for the virtual table @@ -92885,7 +93970,7 @@ func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uint if int32(*(*int8)(unsafe.Pointer(zName + uintptr(nName)))) != '_' { return 0 } - pMod = Xsqlite3HashFind(tls, (db + 528 /* &.aModule */), *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg))) + pMod = Xsqlite3HashFind(tls, (db + 536 /* &.aModule */), *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg))) if pMod == uintptr(0) { return 0 } @@ -92903,7 +93988,7 @@ func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uint // // zName is temporarily modified while this routine is running, but is // restored to its original value prior to this routine returning. -func Xsqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:112605:20: */ +func Xsqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:113846:20: */ var zTail uintptr // Pointer to the last "_" in zName var pTab uintptr // Table that zName is a shadow of zTail = libc.Xstrrchr(tls, zName, '_') @@ -92940,7 +94025,7 @@ func Xsqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) int32 { / // 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 Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr, tabOpts U8, pSelect uintptr) { /* sqlite3.c:112666:21: */ +func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr, tabOpts U8, pSelect uintptr) { /* sqlite3.c:113907:21: */ bp := tls.Alloc(144) defer tls.Free(144) @@ -92959,7 +94044,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } if (pSelect == uintptr(0)) && (Xsqlite3ShadowTableName(tls, db, (*Table)(unsafe.Pointer(p)).FzName) != 0) { - *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (TF_Shadow) + *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_Shadow)) } // If the db->init.busy is 1 it means we are reading the SQL off the @@ -92977,19 +94062,19 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } (*Table)(unsafe.Pointer(p)).Ftnum = (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum if (*Table)(unsafe.Pointer(p)).Ftnum == Pgno(1) { - *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (TF_Readonly) + *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_Readonly)) } } // Special processing for WITHOUT ROWID Tables if (int32(tabOpts) & TF_WithoutRowid) != 0 { - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_Autoincrement) != 0 { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_Autoincrement)) != 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+13965 /* "AUTOINCREMENT no..." */, 0) + ts+14429 /* "AUTOINCREMENT no..." */, 0) return } - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_HasPrimaryKey) == U32(0) { - Xsqlite3ErrorMsg(tls, pParse, ts+14015 /* "PRIMARY KEY miss..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName)) + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_HasPrimaryKey)) == U32(0) { + Xsqlite3ErrorMsg(tls, pParse, ts+14479 /* "PRIMARY KEY miss..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName)) return } *(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(TF_WithoutRowid | TF_NoVisibleRowid)) @@ -93009,13 +94094,13 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } } - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_HasGenerated) != 0 { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_HasGenerated)) != 0 { var ii int32 var nNG int32 = 0 for ii = 0; ii < int32((*Table)(unsafe.Pointer(p)).FnCol); ii++ { var colFlags U32 = U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*32)).FcolFlags) - if (colFlags & COLFLAG_GENERATED) != U32(0) { + if (colFlags & U32(COLFLAG_GENERATED)) != U32(0) { var pX uintptr = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol + uintptr(ii)*32)).FpDflt if Xsqlite3ResolveSelfReference(tls, pParse, p, NC_GenCol, pX, uintptr(0)) != 0 { @@ -93033,7 +94118,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } } if nNG == 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+14047 /* "must have at lea..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+14511 /* "must have at lea..." */, 0) return } } @@ -93066,12 +94151,12 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr // Initialize zType for the new view or table. if (*Table)(unsafe.Pointer(p)).FpSelect == uintptr(0) { // A regular table - zType = ts + 8236 /* "table" */ - zType2 = ts + 14091 /* "TABLE" */ + zType = ts + 8329 /* "table" */ + zType2 = ts + 14555 /* "TABLE" */ } else { // A view - zType = ts + 11885 /* "view" */ - zType2 = ts + 14097 /* "VIEW" */ + zType = ts + 12035 /* "view" */ + zType2 = ts + 14561 /* "VIEW" */ } // If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT @@ -93102,14 +94187,14 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr Xsqlite3MayAbort(tls, pParse) Xsqlite3VdbeAddOp3(tls, v, OP_OpenWrite, 1, (*Parse)(unsafe.Pointer(pParse)).FregRoot, iDb) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_P2ISREG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) (*Parse)(unsafe.Pointer(pParse)).FnTab = 2 addrTop = (Xsqlite3VdbeCurrentAddr(tls, v) + 1) Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, addrTop) if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return } - pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSelect, SQLITE_AFF_BLOB) + pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSelect, int8(SQLITE_AFF_BLOB)) if pSelTab == uintptr(0) { return } @@ -93143,7 +94228,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr } else { var pEnd2 uintptr if tabOpts != 0 { - pEnd2 = (pParse + 264 /* &.sLastToken */) + pEnd2 = (pParse + 256 /* &.sLastToken */) } else { pEnd2 = pEnd } @@ -93152,7 +94237,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr n = int32(uint32(n) + ((*Token)(unsafe.Pointer(pEnd2)).Fn)) } zStmt = Xsqlite3MPrintf(tls, db, - ts+14102 /* "CREATE %s %.*s" */, libc.VaList(bp+8, zType2, n, (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + ts+14566 /* "CREATE %s %.*s" */, libc.VaList(bp+8, zType2, n, (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } // A slot for the record has already been allocated in the @@ -93160,7 +94245,7 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr // the information we've collected. Xsqlite3NestedParse(tls, pParse, - ts+14117, /* "UPDATE %Q.sqlite..." */ + ts+14581, /* "UPDATE %Q.sqlite..." */ libc.VaList(bp+32, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zType, (*Table)(unsafe.Pointer(p)).FzName, @@ -93173,19 +94258,19 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr // Check to see if we need to create an sqlite_sequence table for // keeping track of autoincrement keys. - if ((*Table)(unsafe.Pointer(p)).FtabFlags & TF_Autoincrement) != U32(0) { + if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(TF_Autoincrement)) != U32(0) { var pDb uintptr = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32) if (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { Xsqlite3NestedParse(tls, pParse, - ts+14215, /* "CREATE TABLE %Q...." */ + ts+14679, /* "CREATE TABLE %Q...." */ libc.VaList(bp+88, (*Db)(unsafe.Pointer(pDb)).FzDbSName)) } } // Reparse everything to update our internal data structures Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb, - Xsqlite3MPrintf(tls, db, ts+14257 /* "tbl_name='%q' AN..." */, libc.VaList(bp+96, (*Table)(unsafe.Pointer(p)).FzName))) + Xsqlite3MPrintf(tls, db, ts+14721 /* "tbl_name='%q' AN..." */, libc.VaList(bp+96, (*Table)(unsafe.Pointer(p)).FzName)), uint16(0)) } // Add the table to the in-memory representation of the database. @@ -93200,32 +94285,29 @@ func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr return } (*Parse)(unsafe.Pointer(pParse)).FpNewTable = uintptr(0) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) + } - if !(int32((*Table)(unsafe.Pointer(p)).FpSelect) != 0) { - var zName uintptr = (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz - var nName int32 + if !(pSelect != 0) && !(int32((*Table)(unsafe.Pointer(p)).FpSelect) != 0) { - if (*Token)(unsafe.Pointer(pCons)).Fz == uintptr(0) { - pCons = pEnd - } - nName = (int32((int64((*Token)(unsafe.Pointer(pCons)).Fz) - int64(zName)) / 1)) - (*Table)(unsafe.Pointer(p)).FaddColOffset = (13 + Xsqlite3Utf8CharLen(tls, zName, nName)) + if (*Token)(unsafe.Pointer(pCons)).Fz == uintptr(0) { + pCons = pEnd } + (*Table)(unsafe.Pointer(p)).FaddColOffset = (13 + (int32((int64((*Token)(unsafe.Pointer(pCons)).Fz) - int64((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) / 1))) } } // The parser calls this routine in order to create a new VIEW -func Xsqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 uintptr, pName2 uintptr, pCNames uintptr, pSelect uintptr, isTemp int32, noErr int32) { /* sqlite3.c:112957:21: */ - bp := tls.Alloc(72) - defer tls.Free(72) +func Xsqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 uintptr, pName2 uintptr, pCNames uintptr, pSelect uintptr, isTemp int32, noErr int32) { /* sqlite3.c:114195:21: */ + bp := tls.Alloc(120) + defer tls.Free(120) var p uintptr var n int32 var z uintptr - // var sEnd Token at bp+56, 16 + // var sEnd Token at bp+104, 16 - // var sFix DbFixer at bp+8, 48 + // var sFix DbFixer at bp+8, 96 // var pName uintptr at bp, 8 @@ -93237,7 +94319,7 @@ func Xsqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui if !(int32((*Parse)(unsafe.Pointer(pParse)).FnVar) > 0) { goto __1 } - Xsqlite3ErrorMsg(tls, pParse, ts+14291 /* "parameters are n..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+14755 /* "parameters are n..." */, 0) goto create_view_fail __1: ; @@ -93251,7 +94333,7 @@ __2: ; Xsqlite3TwoPartName(tls, pParse, pName1, pName2, bp /* &pName */) iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(p)).FpSchema) - Xsqlite3FixInit(tls, bp+8 /* &sFix */, pParse, iDb, ts+11885 /* "view" */, *(*uintptr)(unsafe.Pointer(bp /* pName */))) + Xsqlite3FixInit(tls, bp+8 /* &sFix */, pParse, iDb, ts+12035 /* "view" */, *(*uintptr)(unsafe.Pointer(bp /* pName */))) if !(Xsqlite3FixSelect(tls, bp+8 /* &sFix */, pSelect) != 0) { goto __3 } @@ -93263,7 +94345,7 @@ __3: // This will force all the Expr.token.z values to be dynamically // allocated rather than point to the input string - which means that // they will persist after the current sqlite3_exec() call returns. - *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) |= (SF_View) + *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) |= (U32(SF_View)) if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { goto __4 } @@ -93284,16 +94366,16 @@ __6: // Locate the end of the CREATE VIEW statement. Make sEnd point to // the end. - *(*Token)(unsafe.Pointer(bp + 56 /* sEnd */)) = (*Parse)(unsafe.Pointer(pParse)).FsLastToken + *(*Token)(unsafe.Pointer(bp + 104 /* sEnd */)) = (*Parse)(unsafe.Pointer(pParse)).FsLastToken - if !(int32(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fz))) != ';') { + if !(int32(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp + 104 /* &sEnd */)).Fz))) != ';') { goto __7 } - *(*uintptr)(unsafe.Pointer(bp + 56 /* &sEnd */ /* &.z */)) += (uintptr((*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fn)) + *(*uintptr)(unsafe.Pointer(bp + 104 /* &sEnd */ /* &.z */)) += (uintptr((*Token)(unsafe.Pointer(bp + 104 /* &sEnd */)).Fn)) __7: ; - (*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fn = uint32(0) - n = (int32((int64((*Token)(unsafe.Pointer(bp+56 /* &sEnd */)).Fz) - int64((*Token)(unsafe.Pointer(pBegin)).Fz)) / 1)) + (*Token)(unsafe.Pointer(bp + 104 /* &sEnd */)).Fn = uint32(0) + n = (int32((int64((*Token)(unsafe.Pointer(bp+104 /* &sEnd */)).Fz) - int64((*Token)(unsafe.Pointer(pBegin)).Fz)) / 1)) z = (*Token)(unsafe.Pointer(pBegin)).Fz __8: @@ -93304,11 +94386,11 @@ __8: goto __8 __9: ; - (*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fz = (z + uintptr((n - 1))) - (*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fn = uint32(1) + (*Token)(unsafe.Pointer(bp + 104 /* &sEnd */)).Fz = (z + uintptr((n - 1))) + (*Token)(unsafe.Pointer(bp + 104 /* &sEnd */)).Fn = uint32(1) // Use sqlite3EndTable() to add the view to the schema table - Xsqlite3EndTable(tls, pParse, uintptr(0), bp+56 /* &sEnd */, uint8(0), uintptr(0)) + Xsqlite3EndTable(tls, pParse, uintptr(0), bp+104 /* &sEnd */, uint8(0), uintptr(0)) create_view_fail: Xsqlite3SelectDelete(tls, db, pSelect) @@ -93325,7 +94407,7 @@ __10: // 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 Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) int32 { /* sqlite3.c:113038:20: */ +func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) int32 { /* sqlite3.c:114276:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -93368,7 +94450,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i // CREATE TEMP VIEW ex1 AS SELECT a FROM ex1; // SELECT * FROM temp.ex1; if int32((*Table)(unsafe.Pointer(pTable)).FnCol) < 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+14327 /* "view %s is circu..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+14791 /* "view %s is circu..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName)) return 1 } @@ -93382,7 +94464,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i pSel = Xsqlite3SelectDup(tls, db, (*Table)(unsafe.Pointer(pTable)).FpSelect, 0) if pSel != 0 { var eParseMode U8 = (*Parse)(unsafe.Pointer(pParse)).FeParseMode - (*Parse)(unsafe.Pointer(pParse)).FeParseMode = PARSE_MODE_NORMAL + (*Parse)(unsafe.Pointer(pParse)).FeParseMode = U8(PARSE_MODE_NORMAL) n = (*Parse)(unsafe.Pointer(pParse)).FnTab Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer(pSel)).FpSrc) (*Table)(unsafe.Pointer(pTable)).FnCol = int16(-1) @@ -93390,7 +94472,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0) xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth (*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) - pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSel, SQLITE_AFF_NONE) + pSelTab = Xsqlite3ResultSetOfSelect(tls, pParse, pSel, int8(SQLITE_AFF_NONE)) (*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth (*Parse)(unsafe.Pointer(pParse)).FnTab = n if pSelTab == uintptr(0) { @@ -93408,7 +94490,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0)) && (int32((*Table)(unsafe.Pointer(pTable)).FnCol) == (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpEList)).FnExpr) { Xsqlite3SelectAddColumnTypeAndCollation(tls, pParse, pTable, pSel, - SQLITE_AFF_NONE) + int8(SQLITE_AFF_NONE)) } } else { // CREATE VIEW name AS... without an argument list. Construct @@ -93416,6 +94498,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i (*Table)(unsafe.Pointer(pTable)).FnCol = (*Table)(unsafe.Pointer(pSelTab)).FnCol (*Table)(unsafe.Pointer(pTable)).FaCol = (*Table)(unsafe.Pointer(pSelTab)).FaCol + *(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= ((*Table)(unsafe.Pointer(pSelTab)).FtabFlags & U32(COLFLAG_NOINSERT)) (*Table)(unsafe.Pointer(pSelTab)).FnCol = int16(0) (*Table)(unsafe.Pointer(pSelTab)).FaCol = uintptr(0) @@ -93444,7 +94527,7 @@ func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) i } // Clear the column names from every VIEW in database idx. -func sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) { /* sqlite3.c:113168:13: */ +func sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) { /* sqlite3.c:114407:13: */ var i uintptr if !((int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(idx)*32)).FpSchema)).FschemaFlags) & (DB_UnresetViews)) == (DB_UnresetViews)) { @@ -93476,7 +94559,7 @@ func sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) { /* sqlite3.c:113 // We must continue looping until all tables and indices with // rootpage==iFrom have been converted to have a rootpage of iTo // in order to be certain that we got the right one. -func Xsqlite3RootPageMoved(tls *libc.TLS, db uintptr, iDb int32, iFrom Pgno, iTo Pgno) { /* sqlite3.c:113204:21: */ +func Xsqlite3RootPageMoved(tls *libc.TLS, db uintptr, iDb int32, iFrom Pgno, iTo Pgno) { /* sqlite3.c:114443:21: */ var pElem uintptr var pHash uintptr var pDb uintptr @@ -93502,14 +94585,14 @@ func Xsqlite3RootPageMoved(tls *libc.TLS, db uintptr, iDb int32, iFrom Pgno, iTo // Also write code to modify the sqlite_schema table and internal schema // if a root-page of another table is moved by the btree-layer whilst // erasing iTable (this can happen with an auto-vacuum database). -func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { /* sqlite3.c:113234:13: */ +func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { /* sqlite3.c:114473:13: */ bp := tls.Alloc(32) defer tls.Free(32) var v uintptr = Xsqlite3GetVdbe(tls, pParse) var r1 int32 = Xsqlite3GetTempReg(tls, pParse) if iTable < 2 { - Xsqlite3ErrorMsg(tls, pParse, ts+14357 /* "corrupt schema" */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+14821 /* "corrupt schema" */, 0) } Xsqlite3VdbeAddOp3(tls, v, OP_Destroy, iTable, r1, iDb) Xsqlite3MayAbort(tls, pParse) @@ -93523,7 +94606,7 @@ func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { / // token for additional information. Xsqlite3NestedParse(tls, pParse, - ts+14372, /* "UPDATE %Q.sqlite..." */ + ts+14836, /* "UPDATE %Q.sqlite..." */ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+uintptr(iDb)*32)).FzDbSName, iTable, r1, r1)) Xsqlite3ReleaseTempReg(tls, pParse, r1) } @@ -93532,7 +94615,7 @@ func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { / // Code to update the sqlite_schema 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 *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:113264:13: */ +func destroyTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:114503:13: */ // If the database may be auto-vacuum capable (if SQLITE_OMIT_AUTOVACUUM // is not defined), then it is important to call OP_Destroy on the // table and index root-pages in order, starting with the numerically @@ -93578,7 +94661,7 @@ func destroyTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:11 // Remove entries from the sqlite_statN tables (for N in (1,2,3)) // after a DROP INDEX or DROP TABLE command. -func sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uintptr, zName uintptr) { /* sqlite3.c:113313:13: */ +func sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uintptr, zName uintptr) { /* sqlite3.c:114552:13: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -93587,17 +94670,17 @@ func sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uint for i = 1; i <= 4; i++ { // var zTab [24]int8 at bp+40, 24 - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([24]int8{})), bp+40 /* &zTab[0] */, ts+14439 /* "sqlite_stat%d" */, libc.VaList(bp, i)) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([24]int8{})), bp+40 /* &zTab[0] */, ts+14903 /* "sqlite_stat%d" */, libc.VaList(bp, i)) if Xsqlite3FindTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, bp+40 /* &zTab[0] */, zDbName) != 0 { Xsqlite3NestedParse(tls, pParse, - ts+12409, /* "DELETE FROM %Q.%..." */ + ts+12822, /* "DELETE FROM %Q.%..." */ libc.VaList(bp+8, zDbName, bp+40 /* &zTab[0] */, zType, zName)) } } } // Generate code to drop a table. -func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int32, isView int32) { /* sqlite3.c:113336:21: */ +func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int32, isView int32) { /* sqlite3.c:114575:21: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -93628,9 +94711,9 @@ func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 // the table being dropped. This is done before the table is dropped // at the btree level, in case the sqlite_sequence table needs to // move as a result of the drop (can happen in auto-vacuum mode). - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Autoincrement) != 0 { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != 0 { Xsqlite3NestedParse(tls, pParse, - ts+14453, /* "DELETE FROM %Q.s..." */ + ts+14917, /* "DELETE FROM %Q.s..." */ libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName)) } @@ -93642,7 +94725,7 @@ func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 // database. Xsqlite3NestedParse(tls, pParse, - ts+14498, /* "DELETE FROM %Q.s..." */ + ts+14962, /* "DELETE FROM %Q.s..." */ libc.VaList(bp+16, (*Db)(unsafe.Pointer(pDb)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { destroyTable(tls, pParse, pTab) @@ -93661,8 +94744,8 @@ func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 // Return TRUE if shadow tables should be read-only in the current // context. -func Xsqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:113409:20: */ - if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_Defensive) != uint64(0)) && +func Xsqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:114648:20: */ + if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_Defensive)) != uint64(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx == uintptr(0))) && ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0) { return 1 @@ -93671,17 +94754,17 @@ func Xsqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) int32 { /* sqlite3. } // Return true if it is not allowed to drop the given table -func tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) int32 { /* sqlite3.c:113424:12: */ - if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10128 /* "sqlite_" */, 7) == 0 { - if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+4439 /* "stat" */, 4) == 0 { +func tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) int32 { /* sqlite3.c:114663:12: */ + if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10221 /* "sqlite_" */, 7) == 0 { + if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+4515 /* "stat" */, 4) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+9014 /* "parameters" */, 10) == 0 { + if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+9118 /* "parameters" */, 10) == 0 { return 0 } return 1 } - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Shadow) != U32(0)) && (Xsqlite3ReadOnlyShadowTables(tls, db) != 0) { + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Shadow)) != U32(0)) && (Xsqlite3ReadOnlyShadowTables(tls, db) != 0) { return 1 } return 0 @@ -93689,7 +94772,7 @@ func tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) int32 { /* sq // This routine is called to do the work of a DROP TABLE statement. // pName is the name of the table to be dropped. -func Xsqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int32, noErr int32) { /* sqlite3.c:113440:21: */ +func Xsqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int32, noErr int32) { /* sqlite3.c:114679:21: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -93737,7 +94820,7 @@ __4: if !(noErr != 0) { goto __6 } - Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcList_item)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase) + Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase) __6: ; goto exit_drop_table @@ -93756,9 +94839,9 @@ __7: zTab = func() uintptr { if (!(0 != 0)) && (iDb == 1) { - return ts + 13301 /* "sqlite_temp_mast..." */ + return ts + 13714 /* "sqlite_temp_mast..." */ } - return ts + 7541 /* "sqlite_master" */ + return ts + 7634 /* "sqlite_master" */ }() zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName zArg2 = uintptr(0) @@ -93818,7 +94901,7 @@ __18: if !(tableMayNotBeDropped(tls, db, pTab) != 0) { goto __19 } - Xsqlite3ErrorMsg(tls, pParse, ts+14565 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+15029 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table __19: ; @@ -93828,14 +94911,14 @@ __19: if !((isView != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0))) { goto __20 } - Xsqlite3ErrorMsg(tls, pParse, ts+14593 /* "use DROP TABLE t..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+15057 /* "use DROP TABLE t..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table __20: ; if !(!(isView != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) { goto __21 } - Xsqlite3ErrorMsg(tls, pParse, ts+14627 /* "use DROP VIEW to..." */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+15091 /* "use DROP VIEW to..." */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table __21: ; @@ -93850,7 +94933,7 @@ __21: if !(!(isView != 0)) { goto __23 } - sqlite3ClearStatTables(tls, pParse, iDb, ts+12632 /* "tbl" */, (*Table)(unsafe.Pointer(pTab)).FzName) + sqlite3ClearStatTables(tls, pParse, iDb, ts+13045 /* "tbl" */, (*Table)(unsafe.Pointer(pTab)).FzName) Xsqlite3FkDropTable(tls, pParse, pName, pTab) __23: ; @@ -93876,7 +94959,7 @@ exit_drop_table: // // The foreign key is set for IMMEDIATE processing. A subsequent call // to sqlite3DeferForeignKey() might change this to DEFERRED. -func Xsqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, pTo uintptr, pToCol uintptr, flags int32) { /* sqlite3.c:113557:21: */ +func Xsqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, pTo uintptr, pToCol uintptr, flags int32) { /* sqlite3.c:114796:21: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -93915,7 +94998,7 @@ __4: goto __5 } Xsqlite3ErrorMsg(tls, pParse, - ts+14659, /* "foreign key on %..." */ + ts+15123, /* "foreign key on %..." */ libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(iCol)*32)).FzName, pTo)) goto fk_end __5: @@ -93928,7 +95011,7 @@ __2: } Xsqlite3ErrorMsg(tls, pParse, - ts+14722 /* "number of column..." */, 0) + ts+15186 /* "number of column..." */, 0) goto fk_end goto __7 __6: @@ -94012,7 +95095,7 @@ __21: goto __23 } Xsqlite3ErrorMsg(tls, pParse, - ts+14816, /* "unknown column \"..." */ + ts+15280, /* "unknown column \"..." */ libc.VaList(bp+16, (*ExprList_item)(unsafe.Pointer((pFromCol+8 /* &.a */)+uintptr(i)*32)).FzEName)) goto fk_end __23: @@ -94097,7 +95180,7 @@ fk_end: // parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE. // The behavior of the most recently created foreign key is adjusted // accordingly. -func Xsqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) { /* sqlite3.c:113687:21: */ +func Xsqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) { /* sqlite3.c:114926:21: */ var pTab uintptr var pFKey uintptr if ((libc.AssignUintptr(&pTab, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0)) || ((libc.AssignUintptr(&pFKey, (*Table)(unsafe.Pointer(pTab)).FpFKey)) == uintptr(0)) { @@ -94116,7 +95199,7 @@ func Xsqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) { // 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 *libc.TLS, pParse uintptr, pIndex uintptr, memRootPage int32) { /* sqlite3.c:113708:13: */ +func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPage int32) { /* sqlite3.c:114947:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -94213,7 +95296,7 @@ func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPa Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iIdx) } Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, iIdx, regRecord) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) Xsqlite3ReleaseTempReg(tls, pParse, regRecord) Xsqlite3VdbeAddOp2(tls, v, OP_SorterNext, iSorter, addr2) Xsqlite3VdbeJumpHere(tls, v, addr1) @@ -94228,7 +95311,7 @@ func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPa // 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 Xsqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol I16, nExtra int32, ppExtra uintptr) uintptr { /* sqlite3.c:113814:22: */ +func Xsqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol I16, nExtra int32, ppExtra uintptr) uintptr { /* sqlite3.c:115053:22: */ var p uintptr // Allocated index object var nByte int32 // Bytes of space for Index object + arrays @@ -94253,7 +95336,7 @@ func Xsqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol I16, nExtra int // If expression list pList contains an expression that was parsed with // an explicit "NULLS FIRST" or "NULLS LAST" clause, leave an error in // pParse and return non-zero. Otherwise, return zero. -func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int32 { /* sqlite3.c:113847:20: */ +func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int32 { /* sqlite3.c:115086:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -94262,12 +95345,12 @@ func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int3 for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ { if (uint32(int32(*(*uint8)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32 + 20 /* &.bNulls */)) & 0x20 >> 5))) != 0 { var sf U8 = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32)).FsortFlags - Xsqlite3ErrorMsg(tls, pParse, ts+14862, /* "unsupported use ..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+15326, /* "unsupported use ..." */ libc.VaList(bp, func() uintptr { if (int32(sf) == 0) || (int32(sf) == 3) { - return ts + 14890 /* "FIRST" */ + return ts + 15354 /* "FIRST" */ } - return ts + 14896 /* "LAST" */ + return ts + 15360 /* "LAST" */ }())) return 1 } @@ -94286,9 +95369,9 @@ func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int3 // 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 Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pTblName uintptr, pList uintptr, onError int32, pStart uintptr, pPIWhere uintptr, sortOrder int32, ifNotExist int32, idxType U8) { /* sqlite3.c:113875:21: */ - bp := tls.Alloc(208) - defer tls.Free(208) +func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pTblName uintptr, pList uintptr, onError int32, pStart uintptr, pPIWhere uintptr, sortOrder int32, ifNotExist int32, idxType U8) { /* sqlite3.c:115114:21: */ + bp := tls.Alloc(256) + defer tls.Free(256) var pTab uintptr // Table to be indexed var pIndex uintptr // The index to be created @@ -94296,7 +95379,7 @@ func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u var nName int32 // Number of characters in zName var i int32 var j int32 - // var sFix DbFixer at bp+136, 48 + // var sFix DbFixer at bp+136, 96 // For assigning database names to pTable var sortOrderMask int32 // 1 to honor DESC in index. 0 to ignore. var db uintptr @@ -94307,13 +95390,13 @@ func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u var pListItem uintptr // For looping over pList var nExtra int32 // Space allocated for zExtra[] var nExtraCol int32 // Number of extra columns needed - // var zExtra uintptr at bp+200, 8 + // var zExtra uintptr at bp+248, 8 // Extra space after the Index object var pPk uintptr var n int32 var pLoop uintptr var zDb uintptr - // var prevCol Token at bp+184, 16 + // var prevCol Token at bp+232, 16 var pCol uintptr var pExpr uintptr @@ -94360,7 +95443,7 @@ func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*Parse)(unsafe.Pointer(pParse)).Fdb *(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)) = uintptr(0) nExtra = 0 - *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)) = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 248 /* zExtra */)) = uintptr(0) pPk = uintptr(0) // PRIMARY KEY index for WITHOUT ROWID tables if !(((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || ((*Parse)(unsafe.Pointer(pParse)).FnErr > 0)) { @@ -94421,7 +95504,7 @@ __9: __8: ; - Xsqlite3FixInit(tls, bp+136 /* &sFix */, pParse, iDb, ts+8242 /* "index" */, *(*uintptr)(unsafe.Pointer(bp + 128 /* pName */))) + Xsqlite3FixInit(tls, bp+136 /* &sFix */, pParse, iDb, ts+8335 /* "index" */, *(*uintptr)(unsafe.Pointer(bp + 128 /* pName */))) if !(Xsqlite3FixSrcList(tls, bp+136 /* &sFix */, pTblName) != 0) { goto __10 } @@ -94442,12 +95525,12 @@ __11: goto __12 } Xsqlite3ErrorMsg(tls, pParse, - ts+14901, /* "cannot create a ..." */ + ts+15365, /* "cannot create a ..." */ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index __12: ; - if !(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __13 } pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) @@ -94469,26 +95552,26 @@ __6: ; pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32) - if !(((Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10128 /* "sqlite_" */, 7) == 0) && + if !(((Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10221 /* "sqlite_" */, 7) == 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0)) && (pTblName != uintptr(0))) { goto __15 } - Xsqlite3ErrorMsg(tls, pParse, ts+14951 /* "table %s may not..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+15415 /* "table %s may not..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index __15: ; if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) { goto __16 } - Xsqlite3ErrorMsg(tls, pParse, ts+14979 /* "views may not be..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+15443 /* "views may not be..." */, 0) goto exit_create_index __16: ; if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { goto __17 } - Xsqlite3ErrorMsg(tls, pParse, ts+15004 /* "virtual tables m..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+15468 /* "virtual tables m..." */, 0) goto exit_create_index __17: ; @@ -94515,7 +95598,7 @@ __17: __20: ; - if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+8242 /* "index" */, (*Table)(unsafe.Pointer(pTab)).FzName)) { + if !(SQLITE_OK != Xsqlite3CheckObjectName(tls, pParse, zName, ts+8335 /* "index" */, (*Table)(unsafe.Pointer(pTab)).FzName)) { goto __21 } goto exit_create_index @@ -94530,7 +95613,7 @@ __21: if !(Xsqlite3FindTable(tls, db, zName, uintptr(0)) != uintptr(0)) { goto __24 } - Xsqlite3ErrorMsg(tls, pParse, ts+15038 /* "there is already..." */, libc.VaList(bp+16, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+15502 /* "there is already..." */, libc.VaList(bp+16, zName)) goto exit_create_index __24: ; @@ -94542,7 +95625,7 @@ __23: if !(!(ifNotExist != 0)) { goto __26 } - Xsqlite3ErrorMsg(tls, pParse, ts+15072 /* "index %s already..." */, libc.VaList(bp+24, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+15536 /* "index %s already..." */, libc.VaList(bp+24, zName)) goto __27 __26: ; @@ -94570,7 +95653,7 @@ __29: goto __30 __30: ; - zName = Xsqlite3MPrintf(tls, db, ts+15096 /* "sqlite_autoindex..." */, libc.VaList(bp+32, (*Table)(unsafe.Pointer(pTab)).FzName, n)) + zName = Xsqlite3MPrintf(tls, db, ts+15560 /* "sqlite_autoindex..." */, libc.VaList(bp+32, (*Table)(unsafe.Pointer(pTab)).FzName, n)) if !(zName == uintptr(0)) { goto __31 } @@ -94599,9 +95682,9 @@ __19: zDb = (*Db)(unsafe.Pointer(pDb)).FzDbSName if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr { if (!(0 != 0)) && (iDb == 1) { - return ts + 13301 /* "sqlite_temp_mast..." */ + return ts + 13714 /* "sqlite_temp_mast..." */ } - return ts + 7541 /* "sqlite_master" */ + return ts + 7634 /* "sqlite_master" */ }(), uintptr(0), zDb) != 0) { goto __34 } @@ -94632,9 +95715,9 @@ __33: } pCol = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(pTab)).FnCol)-1))*32) *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) |= U16((COLFLAG_UNIQUE)) - Xsqlite3TokenInit(tls, bp+184 /* &prevCol */, (*Column)(unsafe.Pointer(pCol)).FzName) + Xsqlite3TokenInit(tls, bp+232 /* &prevCol */, (*Column)(unsafe.Pointer(pCol)).FzName) pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), - Xsqlite3ExprAlloc(tls, db, TK_ID, bp+184 /* &prevCol */, 0)) + Xsqlite3ExprAlloc(tls, db, TK_ID, bp+232 /* &prevCol */, 0)) if !(pList == uintptr(0)) { goto __39 } @@ -94645,7 +95728,7 @@ __39: Xsqlite3ExprListSetSortOrder(tls, pList, sortOrder, -1) goto __38 __37: - Xsqlite3ExprListCheckLength(tls, pParse, pList, ts+8242 /* "index" */) + Xsqlite3ExprListCheckLength(tls, pParse, pList, ts+8335 /* "index" */) if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) { goto __40 } @@ -94687,7 +95770,7 @@ __43: } pIndex = Xsqlite3AllocateIndexObject(tls, db, (int16((*ExprList)(unsafe.Pointer(pList)).FnExpr + nExtraCol)), - ((nName + nExtra) + 1), bp+200 /* &zExtra */) + ((nName + nExtra) + 1), bp+248 /* &zExtra */) if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { goto __45 } @@ -94695,8 +95778,8 @@ __43: __45: ; - (*Index)(unsafe.Pointer(pIndex)).FzName = *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)) - *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)) += (uintptr(nName + 1)) + (*Index)(unsafe.Pointer(pIndex)).FzName = *(*uintptr)(unsafe.Pointer(bp + 248 /* zExtra */)) + *(*uintptr)(unsafe.Pointer(bp + 248 /* zExtra */)) += (uintptr(nName + 1)) libc.Xmemcpy(tls, (*Index)(unsafe.Pointer(pIndex)).FzName, zName, (uint64(nName + 1))) (*Index)(unsafe.Pointer(pIndex)).FpTable = pTab (*Index)(unsafe.Pointer(pIndex)).FonError = U8(onError) @@ -94762,7 +95845,7 @@ __53: goto __56 } Xsqlite3ErrorMsg(tls, pParse, - ts+15119 /* "expressions proh..." */, 0) + ts+15583 /* "expressions proh..." */, 0) goto exit_create_index __56: ; @@ -94810,9 +95893,9 @@ __55: zColl = *(*uintptr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pListItem)).FpExpr + 8 /* &.u */)) nColl = (Xsqlite3Strlen30(tls, zColl) + 1) - libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)), zColl, uint64(nColl)) - zColl = *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)) - *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)) += uintptr(nColl) + libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 248 /* zExtra */)), zColl, uint64(nColl)) + zColl = *(*uintptr)(unsafe.Pointer(bp + 248 /* zExtra */)) + *(*uintptr)(unsafe.Pointer(bp + 248 /* zExtra */)) += uintptr(nColl) nExtra = nExtra - (nColl) goto __63 __62: @@ -94991,7 +96074,7 @@ __88: goto __93 } Xsqlite3ErrorMsg(tls, pParse, - ts+15180 /* "conflicting ON C..." */, libc.VaList(bp+48, 0)) + ts+15644 /* "conflicting ON C..." */, libc.VaList(bp+48, 0)) __93: ; if !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) == OE_Default) { @@ -95047,8 +96130,8 @@ __81: if !(Xsqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0) { goto __101 } - Xsqlite3ErrorMsg(tls, pParse, ts+15222 /* "invalid rootpage" */, 0) - (*Parse)(unsafe.Pointer(pParse)).Frc = Xsqlite3CorruptError(tls, 114327) + Xsqlite3ErrorMsg(tls, pParse, ts+15686 /* "invalid rootpage" */, 0) + (*Parse)(unsafe.Pointer(pParse)).Frc = Xsqlite3CorruptError(tls, 115566) goto exit_create_index __101: ; @@ -95064,10 +96147,10 @@ __100: goto exit_create_index __102: ; - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) goto __99 __98: - if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) || (pTblName != uintptr(0))) { + if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || (pTblName != uintptr(0))) { goto __103 } iMem = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) @@ -95105,12 +96188,12 @@ __104: __107: ; // A named index with an explicit CREATE INDEX statement - zStmt = Xsqlite3MPrintf(tls, db, ts+15239, /* "CREATE%s INDEX %..." */ + zStmt = Xsqlite3MPrintf(tls, db, ts+15703, /* "CREATE%s INDEX %..." */ libc.VaList(bp+56, func() uintptr { if onError == OE_None { return ts + 800 /* "" */ } - return ts + 15259 /* " UNIQUE" */ + return ts + 15723 /* " UNIQUE" */ }(), n1, (*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)))).Fz)) goto __106 __105: @@ -95122,7 +96205,7 @@ __106: // Add an entry in sqlite_schema for this index Xsqlite3NestedParse(tls, pParse, - ts+15267, /* "INSERT INTO %Q.s..." */ + ts+15731, /* "INSERT INTO %Q.s..." */ libc.VaList(bp+80, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Index)(unsafe.Pointer(pIndex)).FzName, (*Table)(unsafe.Pointer(pTab)).FzName, @@ -95138,7 +96221,7 @@ __106: sqlite3RefillIndex(tls, pParse, pIndex, iMem) Xsqlite3ChangeCookie(tls, pParse, iDb) Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb, - Xsqlite3MPrintf(tls, db, ts+15326 /* "name='%q' AND ty..." */, libc.VaList(bp+120, (*Index)(unsafe.Pointer(pIndex)).FzName))) + Xsqlite3MPrintf(tls, db, ts+15790 /* "name='%q' AND ty..." */, libc.VaList(bp+120, (*Index)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) Xsqlite3VdbeAddOp2(tls, v, OP_Expire, 0, 1) __108: ; @@ -95235,7 +96318,7 @@ __113: // 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 Xsqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:114468:21: */ +func Xsqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:115707:21: */ var a uintptr = (*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst var x LogEst var nCopy int32 = func() int32 { @@ -95279,11 +96362,11 @@ func Xsqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:114468:21 } } -var aVal = [5]LogEst{int16(33), int16(32), int16(30), int16(28), int16(26)} /* sqlite3.c:114470:23 */ +var aVal = [5]LogEst{int16(33), int16(32), int16(30), int16(28), int16(26)} /* sqlite3.c:115709:23 */ // This routine will drop an existing named index. This routine // implements the DROP INDEX statement. -func Xsqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists int32) { /* sqlite3.c:114512:21: */ +func Xsqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists int32) { /* sqlite3.c:115751:21: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -95311,17 +96394,17 @@ __1: goto exit_drop_index __2: ; - pIndex = Xsqlite3FindIndex(tls, db, (*SrcList_item)(unsafe.Pointer((pName + 8 /* &.a */))).FzName, (*SrcList_item)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase) + pIndex = Xsqlite3FindIndex(tls, db, (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzName, (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase) if !(pIndex == uintptr(0)) { goto __3 } if !(!(ifExists != 0)) { goto __4 } - Xsqlite3ErrorMsg(tls, pParse, ts+15353 /* "no such index: %..." */, libc.VaList(bp, pName, 0)) + Xsqlite3ErrorMsg(tls, pParse, ts+15817 /* "no such index: %..." */, libc.VaList(bp, pName, 0)) goto __5 __4: - Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcList_item)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase) + Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase) __5: ; (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) @@ -95332,7 +96415,7 @@ __3: goto __6 } Xsqlite3ErrorMsg(tls, pParse, - ts+15371 /* "index associated..." */, libc.VaList(bp+16, 0)) + ts+15835 /* "index associated..." */, libc.VaList(bp+16, 0)) goto exit_drop_index __6: ; @@ -95343,9 +96426,9 @@ __6: zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName zTab = func() uintptr { if (!(0 != 0)) && (iDb == 1) { - return ts + 13301 /* "sqlite_temp_mast..." */ + return ts + 13714 /* "sqlite_temp_mast..." */ } - return ts + 7541 /* "sqlite_master" */ + return ts + 7634 /* "sqlite_master" */ }() if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_DELETE, zTab, uintptr(0), zDb) != 0) { goto __7 @@ -95373,9 +96456,9 @@ __9: } Xsqlite3BeginWriteOperation(tls, pParse, 1, iDb) Xsqlite3NestedParse(tls, pParse, - ts+15444, /* "DELETE FROM %Q.s..." */ + ts+15908, /* "DELETE FROM %Q.s..." */ libc.VaList(bp+24, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Index)(unsafe.Pointer(pIndex)).FzName)) - sqlite3ClearStatTables(tls, pParse, iDb, ts+12628 /* "idx" */, (*Index)(unsafe.Pointer(pIndex)).FzName) + sqlite3ClearStatTables(tls, pParse, iDb, ts+13041 /* "idx" */, (*Index)(unsafe.Pointer(pIndex)).FzName) Xsqlite3ChangeCookie(tls, pParse, iDb) destroyRootPage(tls, pParse, int32((*Index)(unsafe.Pointer(pIndex)).Ftnum), iDb) Xsqlite3VdbeAddOp4(tls, v, OP_DropIndex, iDb, 0, 0, (*Index)(unsafe.Pointer(pIndex)).FzName, 0) @@ -95401,7 +96484,7 @@ exit_drop_index: // // Otherwise, if the realloc() fails, *pIdx is set to -1, *pnEntry remains // unchanged and a copy of pArray returned. -func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry int32, pnEntry uintptr, pIdx uintptr) uintptr { /* sqlite3.c:114593:21: */ +func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry int32, pnEntry uintptr, pIdx uintptr) uintptr { /* sqlite3.c:115832:21: */ var z uintptr var n Sqlite3_int64 = Sqlite3_int64(libc.AssignPtrInt32(pIdx, *(*int32)(unsafe.Pointer(pnEntry)))) if (n & (n - int64(1))) == int64(0) { @@ -95428,7 +96511,7 @@ func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry in // need be. // // A new IdList is returned, or NULL if malloc() fails. -func Xsqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr) uintptr { /* sqlite3.c:114623:23: */ +func Xsqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr) uintptr { /* sqlite3.c:115862:23: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -95459,7 +96542,7 @@ func Xsqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } // Delete an IdList. -func Xsqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:114651:21: */ +func Xsqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:115890:21: */ var i int32 if pList == uintptr(0) { return @@ -95473,7 +96556,7 @@ func Xsqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3 // Return the index in pList of the identifier named zId. Return -1 // if not found. -func Xsqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) int32 { /* sqlite3.c:114665:20: */ +func Xsqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) int32 { /* sqlite3.c:115904:20: */ var i int32 if pList == uintptr(0) { return -1 @@ -95511,7 +96594,7 @@ func Xsqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) int32 { /* // If a memory allocation fails or the SrcList becomes too large, leave // the original SrcList unchanged, return NULL, and leave an error message // in pParse. -func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra int32, iStart int32) uintptr { /* sqlite3.c:114706:24: */ +func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra int32, iStart int32) uintptr { /* sqlite3.c:115945:24: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -95526,15 +96609,15 @@ func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc + nExtra) >= SQLITE_MAX_SRCLIST { - Xsqlite3ErrorMsg(tls, pParse, ts+15504, /* "too many FROM cl..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+15968, /* "too many FROM cl..." */ libc.VaList(bp, SQLITE_MAX_SRCLIST)) return uintptr(0) } - if nAlloc > SQLITE_MAX_SRCLIST { - nAlloc = SQLITE_MAX_SRCLIST + if nAlloc > int64(SQLITE_MAX_SRCLIST) { + nAlloc = int64(SQLITE_MAX_SRCLIST) } pNew = Xsqlite3DbRealloc(tls, db, pSrc, - (uint64(unsafe.Sizeof(SrcList{})) + ((uint64(nAlloc - int64(1))) * uint64(unsafe.Sizeof(SrcList_item{}))))) + (uint64(unsafe.Sizeof(SrcList{})) + ((uint64(nAlloc - int64(1))) * uint64(unsafe.Sizeof(SrcItem{}))))) if pNew == uintptr(0) { return uintptr(0) @@ -95546,14 +96629,14 @@ func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra // Move existing slots that come after the newly inserted slots // out of the way for i = ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc - 1); i >= iStart; i-- { - *(*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr((i+nExtra))*112)) = *(*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112)) + *(*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr((i+nExtra))*112)) = *(*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112)) } *(*int32)(unsafe.Pointer(pSrc /* &.nSrc */)) += (nExtra) // Zero the newly allocated slots - libc.Xmemset(tls, ((pSrc + 8 /* &.a */) + uintptr(iStart)*112), 0, (uint64(unsafe.Sizeof(SrcList_item{})) * uint64(nExtra))) + libc.Xmemset(tls, ((pSrc + 8 /* &.a */) + uintptr(iStart)*112), 0, (uint64(unsafe.Sizeof(SrcItem{})) * uint64(nExtra))) for i = iStart; i < (iStart + nExtra); i++ { - (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor = -1 + (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor = -1 } // Return a pointer to the enlarged SrcList @@ -95593,7 +96676,7 @@ func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra // // Both pTable and pDatabase are assumed to be quoted. They are dequoted // before being added to the SrcList. -func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable uintptr, pDatabase uintptr) uintptr { /* sqlite3.c:114795:24: */ +func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable uintptr, pDatabase uintptr) uintptr { /* sqlite3.c:116034:24: */ var pItem uintptr var db uintptr // Cannot have C without B @@ -95606,8 +96689,8 @@ func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable } (*SrcList)(unsafe.Pointer(pList)).FnAlloc = U32(1) (*SrcList)(unsafe.Pointer(pList)).FnSrc = 1 - libc.Xmemset(tls, (pList + 8 /* &.a */), 0, uint64(unsafe.Sizeof(SrcList_item{}))) - (*SrcList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FiCursor = -1 + libc.Xmemset(tls, (pList + 8 /* &.a */), 0, uint64(unsafe.Sizeof(SrcItem{}))) + (*SrcItem)(unsafe.Pointer((pList + 8 /* &.a */))).FiCursor = -1 } else { var pNew uintptr = Xsqlite3SrcListEnlarge(tls, pParse, pList, 1, (*SrcList)(unsafe.Pointer(pList)).FnSrc) if pNew == uintptr(0) { @@ -95622,17 +96705,17 @@ func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable pDatabase = uintptr(0) } if pDatabase != 0 { - (*SrcList_item)(unsafe.Pointer(pItem)).FzName = Xsqlite3NameFromToken(tls, db, pDatabase) - (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase = Xsqlite3NameFromToken(tls, db, pTable) + (*SrcItem)(unsafe.Pointer(pItem)).FzName = Xsqlite3NameFromToken(tls, db, pDatabase) + (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase = Xsqlite3NameFromToken(tls, db, pTable) } else { - (*SrcList_item)(unsafe.Pointer(pItem)).FzName = Xsqlite3NameFromToken(tls, db, pTable) - (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0) + (*SrcItem)(unsafe.Pointer(pItem)).FzName = Xsqlite3NameFromToken(tls, db, pTable) + (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0) } return pList } // Assign VdbeCursor index numbers to all tables in a SrcList -func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sqlite3.c:114840:21: */ +func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sqlite3.c:116079:21: */ var i int32 var pItem uintptr @@ -95644,12 +96727,12 @@ func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) goto __3 } { - if (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor >= 0 { - goto __3 + if (*SrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { + goto __2 } - (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) - if (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0 { - Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FpSrc) + (*SrcItem)(unsafe.Pointer(pItem)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 { + Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpSrc) } } @@ -95664,7 +96747,7 @@ func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) } // Delete an entire SrcList including all its substructure. -func Xsqlite3SrcListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:114858:21: */ +func Xsqlite3SrcListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:116097:21: */ var i int32 var pItem uintptr if pList == uintptr(0) { @@ -95677,19 +96760,29 @@ __1: goto __3 } { - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase) - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FzName) - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias) + if (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0 { + Xsqlite3DbFreeNN(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzDatabase) + } + Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzName) + if (*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 { + Xsqlite3DbFreeNN(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FzAlias) + } if (uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 60 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 96 /* &.u1 */))) } if (uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 60 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 { Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 96 /* &.u1 */))) } - Xsqlite3DeleteTable(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FpTab) - Xsqlite3SelectDelete(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect) - Xsqlite3ExprDelete(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FpOn) - Xsqlite3IdListDelete(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FpUsing) + Xsqlite3DeleteTable(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FpTab) + if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 { + Xsqlite3SelectDelete(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect) + } + if (*SrcItem)(unsafe.Pointer(pItem)).FpOn != 0 { + Xsqlite3ExprDelete(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FpOn) + } + if (*SrcItem)(unsafe.Pointer(pItem)).FpUsing != 0 { + Xsqlite3IdListDelete(tls, db, (*SrcItem)(unsafe.Pointer(pItem)).FpUsing) + } } goto __2 @@ -95717,7 +96810,7 @@ __3: // // Return a new SrcList which encodes is the FROM with the new // term added. -func Xsqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTable uintptr, pDatabase uintptr, pAlias uintptr, pSubquery uintptr, pOn uintptr, pUsing uintptr) uintptr { /* sqlite3.c:114892:24: */ +func Xsqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTable uintptr, pDatabase uintptr, pAlias uintptr, pSubquery uintptr, pOn uintptr, pUsing uintptr) uintptr { /* sqlite3.c:116131:24: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -95728,12 +96821,12 @@ func Xsqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa if !(!(p != 0) && ((pOn != 0) || (pUsing != 0))) { goto __1 } - Xsqlite3ErrorMsg(tls, pParse, ts+15540, /* "a JOIN clause is..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+16004, /* "a JOIN clause is..." */ libc.VaList(bp, func() uintptr { if pOn != 0 { - return ts + 15576 /* "ON" */ + return ts + 16040 /* "ON" */ } - return ts + 15579 /* "USING" */ + return ts + 16043 /* "USING" */ }())) goto append_from_error __1: @@ -95748,7 +96841,7 @@ __2: pItem = ((p + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(p)).FnSrc-1))*112) - if !((int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*SrcList_item)(unsafe.Pointer(pItem)).FzName != 0)) { + if !((int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*SrcItem)(unsafe.Pointer(pItem)).FzName != 0)) { goto __3 } if (pDatabase != 0) && ((*Token)(unsafe.Pointer(pDatabase)).Fz != 0) { @@ -95756,19 +96849,19 @@ __2: } else { pToken = pTable } - Xsqlite3RenameTokenMap(tls, pParse, (*SrcList_item)(unsafe.Pointer(pItem)).FzName, pToken) + Xsqlite3RenameTokenMap(tls, pParse, (*SrcItem)(unsafe.Pointer(pItem)).FzName, pToken) __3: ; if !((*Token)(unsafe.Pointer(pAlias)).Fn != 0) { goto __4 } - (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias = Xsqlite3NameFromToken(tls, db, pAlias) + (*SrcItem)(unsafe.Pointer(pItem)).FzAlias = Xsqlite3NameFromToken(tls, db, pAlias) __4: ; - (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect = pSubquery - (*SrcList_item)(unsafe.Pointer(pItem)).FpOn = pOn - (*SrcList_item)(unsafe.Pointer(pItem)).FpUsing = pUsing + (*SrcItem)(unsafe.Pointer(pItem)).FpSelect = pSubquery + (*SrcItem)(unsafe.Pointer(pItem)).FpOn = pOn + (*SrcItem)(unsafe.Pointer(pItem)).FpUsing = pUsing return p append_from_error: @@ -95781,7 +96874,7 @@ append_from_error: // Add an INDEXED BY or NOT INDEXED clause to the most recently added // element of the source-list passed as the second argument. -func Xsqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexedBy uintptr) { /* sqlite3.c:114943:21: */ +func Xsqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexedBy uintptr) { /* sqlite3.c:116182:21: */ if (p != 0) && ((*Token)(unsafe.Pointer(pIndexedBy)).Fn > uint32(0)) { var pItem uintptr @@ -95802,7 +96895,7 @@ func Xsqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexed // Append the contents of SrcList p2 to SrcList p1 and return the resulting // SrcList. Or, if an error occurs, return NULL. In all cases, p1 and p2 // are deleted by this function. -func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:114968:24: */ +func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:116207:24: */ if p2 != 0 { var pNew uintptr = Xsqlite3SrcListEnlarge(tls, pParse, p1, (*SrcList)(unsafe.Pointer(p2)).FnSrc, 1) @@ -95810,7 +96903,7 @@ func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uin Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p2) } else { p1 = pNew - libc.Xmemcpy(tls, ((p1 + 8 /* &.a */) + 1*112), p2+8 /* &.a */, (uint64((*SrcList)(unsafe.Pointer(p2)).FnSrc) * uint64(unsafe.Sizeof(SrcList_item{})))) + libc.Xmemcpy(tls, ((p1 + 8 /* &.a */) + 1*112), p2+8 /* &.a */, (uint64((*SrcList)(unsafe.Pointer(p2)).FnSrc) * uint64(unsafe.Sizeof(SrcItem{})))) Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p2) } } @@ -95819,7 +96912,7 @@ func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uin // Add the list of function arguments to the SrcList entry for a // table-valued-function. -func Xsqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uintptr) { /* sqlite3.c:114987:21: */ +func Xsqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uintptr) { /* sqlite3.c:116226:21: */ if p != 0 { var pItem uintptr = ((p + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(p)).FnSrc-1))*112) @@ -95843,25 +96936,25 @@ func Xsqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uin // 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 Xsqlite3SrcListShiftJoinType(tls *libc.TLS, p uintptr) { /* sqlite3.c:115015:21: */ +func Xsqlite3SrcListShiftJoinType(tls *libc.TLS, p uintptr) { /* sqlite3.c:116254:21: */ if p != 0 { var i int32 for i = ((*SrcList)(unsafe.Pointer(p)).FnSrc - 1); i > 0; i-- { - (*SrcList_item)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(i)*112)).Ffg.Fjointype = (*SrcList_item)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((i-1))*112)).Ffg.Fjointype + (*SrcItem)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(i)*112)).Ffg.Fjointype = (*SrcItem)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((i-1))*112)).Ffg.Fjointype } - (*SrcList_item)(unsafe.Pointer((p + 8 /* &.a */))).Ffg.Fjointype = U8(0) + (*SrcItem)(unsafe.Pointer((p + 8 /* &.a */))).Ffg.Fjointype = U8(0) } } // Generate VDBE code for a BEGIN statement. -func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { /* sqlite3.c:115028:21: */ +func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { /* sqlite3.c:116267:21: */ var db uintptr var v uintptr var i int32 db = (*Parse)(unsafe.Pointer(pParse)).Fdb - if Xsqlite3AuthCheck(tls, pParse, SQLITE_TRANSACTION, ts+15585 /* "BEGIN" */, uintptr(0), uintptr(0)) != 0 { + if Xsqlite3AuthCheck(tls, pParse, SQLITE_TRANSACTION, ts+16049 /* "BEGIN" */, uintptr(0), uintptr(0)) != 0 { return } v = Xsqlite3GetVdbe(tls, pParse) @@ -95870,7 +96963,16 @@ func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { /* s } if type1 != TK_DEFERRED { for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { - Xsqlite3VdbeAddOp2(tls, v, OP_Transaction, i, ((libc.Bool32(type1 == TK_EXCLUSIVE)) + 1)) + var eTxnType int32 + var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt + if (pBt != 0) && (Xsqlite3BtreeIsReadonly(tls, pBt) != 0) { + eTxnType = 0 // Read txn + } else if type1 == TK_EXCLUSIVE { + eTxnType = 2 // Exclusive txn + } else { + eTxnType = 1 // Write txn + } + Xsqlite3VdbeAddOp2(tls, v, OP_Transaction, i, eTxnType) Xsqlite3VdbeUsesBtree(tls, v, i) } } @@ -95880,7 +96982,7 @@ func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { /* s // Generate VDBE code for a COMMIT or ROLLBACK statement. // Code for ROLLBACK is generated if eType==TK_ROLLBACK. Otherwise // code is generated for a COMMIT. -func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { /* sqlite3.c:115055:21: */ +func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { /* sqlite3.c:116303:21: */ var v uintptr var isRollback int32 @@ -95888,9 +96990,9 @@ func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { /* sql if Xsqlite3AuthCheck(tls, pParse, SQLITE_TRANSACTION, func() uintptr { if isRollback != 0 { - return ts + 15591 /* "ROLLBACK" */ + return ts + 16055 /* "ROLLBACK" */ } - return ts + 15600 /* "COMMIT" */ + return ts + 16064 /* "COMMIT" */ }(), uintptr(0), uintptr(0)) != 0 { return } @@ -95902,7 +97004,7 @@ func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { /* sql // This function is called by the parser when it parses a command to create, // release or rollback an SQL savepoint. -func Xsqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { /* sqlite3.c:115077:21: */ +func Xsqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { /* sqlite3.c:116325:21: */ var zName uintptr = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pName) if zName != 0 { var v uintptr = Xsqlite3GetVdbe(tls, pParse) @@ -95915,11 +97017,11 @@ func Xsqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } } -var az = [3]uintptr{ts + 15585 /* "BEGIN" */, ts + 15607 /* "RELEASE" */, ts + 15591 /* "ROLLBACK" */} /* sqlite3.c:115082:23 */ +var az = [3]uintptr{ts + 16049 /* "BEGIN" */, ts + 16071 /* "RELEASE" */, ts + 16055 /* "ROLLBACK" */} /* sqlite3.c:116330:23 */ // Make sure the TEMP database is open and available for use. Return // the number of errors. Leave any error messages in the pParse structure. -func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:115097:20: */ +func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:116345:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -95931,7 +97033,7 @@ func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3. rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp /* &pBt */, 0, flags) if rc != SQLITE_OK { Xsqlite3ErrorMsg(tls, pParse, - ts+15615 /* "unable to open a..." */, 0) + ts+16079 /* "unable to open a..." */, 0) (*Parse)(unsafe.Pointer(pParse)).Frc = rc return 1 } @@ -95945,19 +97047,13 @@ func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3. return 0 } -var flags int32 = ((((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) | SQLITE_OPEN_TEMP_DB) /* sqlite3.c:115102:22 */ +var flags int32 = ((((SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) | SQLITE_OPEN_TEMP_DB) /* sqlite3.c:116350:22 */ // 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 Xsqlite3CodeVerifySchema(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:115132:21: */ - var pToplevel uintptr = func() uintptr { - if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { - return (*Parse)(unsafe.Pointer(pParse)).FpToplevel - } - return pParse - }() +func sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { /* sqlite3.c:116380:13: */ if (libc.Bool32((((*Parse)(unsafe.Pointer(pToplevel)).FcookieMask) & (YDbMask((YDbMask(1))) << (iDb))) != YDbMask(0))) == 0 { *(*YDbMask)(unsafe.Pointer(pToplevel + 116 /* &.cookieMask */)) |= (YDbMask((YDbMask(1))) << (iDb)) @@ -95967,9 +97063,18 @@ func Xsqlite3CodeVerifySchema(tls *libc.TLS, pParse uintptr, iDb int32) { /* sql } } +func Xsqlite3CodeVerifySchema(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:116392:21: */ + sqlite3CodeVerifySchemaAtToplevel(tls, func() uintptr { + if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { + return (*Parse)(unsafe.Pointer(pParse)).FpToplevel + } + return pParse + }(), iDb) +} + // If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each // attached database. Otherwise, invoke it for the database named zDb only. -func Xsqlite3CodeVerifyNamedSchema(tls *libc.TLS, pParse uintptr, zDb uintptr) { /* sqlite3.c:115151:21: */ +func Xsqlite3CodeVerifyNamedSchema(tls *libc.TLS, pParse uintptr, zDb uintptr) { /* sqlite3.c:116401:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var i int32 for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { @@ -95991,14 +97096,14 @@ func Xsqlite3CodeVerifyNamedSchema(tls *libc.TLS, pParse uintptr, zDb uintptr) { // 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 Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int32, iDb int32) { /* sqlite3.c:115175:21: */ +func Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int32, iDb int32) { /* sqlite3.c:116425:21: */ var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel } return pParse }() - Xsqlite3CodeVerifySchema(tls, pParse, iDb) + sqlite3CodeVerifySchemaAtToplevel(tls, pToplevel, iDb) *(*YDbMask)(unsafe.Pointer(pToplevel + 112 /* &.writeMask */)) |= (YDbMask((YDbMask(1))) << (iDb)) *(*U8)(unsafe.Pointer(pToplevel + 32 /* &.isMultiWrite */)) |= U8((setStatement)) } @@ -96008,7 +97113,7 @@ func Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int // 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 Xsqlite3MultiWrite(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:115189:21: */ +func Xsqlite3MultiWrite(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:116439:21: */ var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -96032,7 +97137,7 @@ func Xsqlite3MultiWrite(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:115189:21: // 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 Xsqlite3MayAbort(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:115210:21: */ +func Xsqlite3MayAbort(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:116460:21: */ var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -96045,8 +97150,10 @@ func Xsqlite3MayAbort(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:115210:21: * // 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 Xsqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onError int32, p4 uintptr, p4type I8, p5Errmsg U8) { /* sqlite3.c:115220:21: */ - var v uintptr = Xsqlite3GetVdbe(tls, pParse) +func Xsqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onError int32, p4 uintptr, p4type I8, p5Errmsg U8) { /* sqlite3.c:116470:21: */ + var v uintptr + + v = Xsqlite3GetVdbe(tls, pParse) if onError == OE_Abort { Xsqlite3MayAbort(tls, pParse) @@ -96056,7 +97163,7 @@ func Xsqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onErro } // Code an OP_Halt due to UNIQUE or PRIMARY KEY constraint violation. -func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx uintptr) { /* sqlite3.c:115240:21: */ +func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx uintptr) { /* sqlite3.c:116492:21: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -96067,16 +97174,16 @@ func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable Xsqlite3StrAccumInit(tls, bp+8 /* &errMsg */, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), 0, - *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */)))) + *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 128 /* &.aLimit */)))) if (*Index)(unsafe.Pointer(pIdx)).FaColExpr != 0 { - Xsqlite3_str_appendf(tls, bp+8 /* &errMsg */, ts+15685 /* "index '%q'" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName)) + Xsqlite3_str_appendf(tls, bp+8 /* &errMsg */, ts+16149 /* "index '%q'" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName)) } else { for j = 0; j < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); j++ { var zCol uintptr zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)))*32)).FzName if j != 0 { - Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+15696 /* ", " */, 2) + Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+16160 /* ", " */, 2) } Xsqlite3_str_appendall(tls, bp+8 /* &errMsg */, (*Table)(unsafe.Pointer(pTab)).FzName) Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+813 /* "." */, 1) @@ -96091,31 +97198,31 @@ func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx } return (SQLITE_CONSTRAINT | (int32(8) << 8)) }(), - onError, zErr, int8(-7), P5_ConstraintUnique) + onError, zErr, int8(-7), uint8(P5_ConstraintUnique)) } // Code an OP_Halt due to non-unique rowid. -func Xsqlite3RowidConstraint(tls *libc.TLS, pParse uintptr, onError int32, pTab uintptr) { /* sqlite3.c:115276:21: */ +func Xsqlite3RowidConstraint(tls *libc.TLS, pParse uintptr, onError int32, pTab uintptr) { /* sqlite3.c:116528:21: */ bp := tls.Alloc(24) defer tls.Free(24) var zMsg uintptr var rc int32 if int32((*Table)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+9997 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, + zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+10090 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*32)).FzName)) rc = (SQLITE_CONSTRAINT | (int32(6) << 8)) } else { - zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+9988 /* "%s.rowid" */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName)) + zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+10081 /* "%s.rowid" */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName)) rc = (SQLITE_CONSTRAINT | (int32(10) << 8)) } Xsqlite3HaltConstraint(tls, pParse, rc, onError, zMsg, int8(-7), - P5_ConstraintUnique) + uint8(P5_ConstraintUnique)) } // Check to see if pIndex uses the collating sequence pColl. Return // true if it does and false if it does not. -func collationMatch(tls *libc.TLS, zColl uintptr, pIndex uintptr) int32 { /* sqlite3.c:115300:12: */ +func collationMatch(tls *libc.TLS, zColl uintptr, pIndex uintptr) int32 { /* sqlite3.c:116552:12: */ var i int32 for i = 0; i < int32((*Index)(unsafe.Pointer(pIndex)).FnColumn); i++ { @@ -96130,7 +97237,7 @@ func collationMatch(tls *libc.TLS, zColl uintptr, pIndex uintptr) int32 { /* sql // Recompute all indices of pTab that use the collating sequence pColl. // If pColl==0 then recompute all indices of pTab. -func reindexTable(tls *libc.TLS, pParse uintptr, pTab uintptr, zColl uintptr) { /* sqlite3.c:115319:13: */ +func reindexTable(tls *libc.TLS, pParse uintptr, pTab uintptr, zColl uintptr) { /* sqlite3.c:116571:13: */ if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { var pIndex uintptr // An index associated with pTab @@ -96147,7 +97254,7 @@ func reindexTable(tls *libc.TLS, pParse uintptr, pTab uintptr, zColl uintptr) { // Recompute all indices of all tables in all databases where the // indices use the collating sequence pColl. If pColl==0 then recompute // all indices everywhere. -func reindexDatabases(tls *libc.TLS, pParse uintptr, zColl uintptr) { /* sqlite3.c:115340:13: */ +func reindexDatabases(tls *libc.TLS, pParse uintptr, zColl uintptr) { /* sqlite3.c:116592:13: */ var pDb uintptr // A single database var iDb int32 // The database index number var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // The database connection @@ -96189,7 +97296,7 @@ __3: // Form 2 rebuilds all indices in all databases that use the named // collating function. Forms 3 and 4 rebuild the named index or all // indices associated with the named table. -func Xsqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:115372:21: */ +func Xsqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:116624:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -96249,14 +97356,14 @@ func Xsqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintp sqlite3RefillIndex(tls, pParse, pIndex, -1) return } - Xsqlite3ErrorMsg(tls, pParse, ts+15699 /* "unable to identi..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+16163 /* "unable to identi..." */, 0) } // 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 Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr { /* sqlite3.c:115432:24: */ +func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr { /* sqlite3.c:116684:24: */ var i int32 var nCol int32 = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) var nKey int32 = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) @@ -96301,9 +97408,46 @@ func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr return pKey } +// Create a new CTE object +func Xsqlite3CteNew(tls *libc.TLS, pParse uintptr, pName uintptr, pArglist uintptr, pQuery uintptr, eM10d U8) uintptr { /* sqlite3.c:116728:20: */ + var pNew uintptr + var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb + + pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Cte{}))) + + if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + Xsqlite3ExprListDelete(tls, db, pArglist) + Xsqlite3SelectDelete(tls, db, pQuery) + } else { + (*Cte)(unsafe.Pointer(pNew)).FpSelect = pQuery + (*Cte)(unsafe.Pointer(pNew)).FpCols = pArglist + (*Cte)(unsafe.Pointer(pNew)).FzName = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pName) + (*Cte)(unsafe.Pointer(pNew)).FeM10d = eM10d + } + return pNew +} + +// Clear information from a Cte object, but do not deallocate storage +// for the object itself. +func cteClear(tls *libc.TLS, db uintptr, pCte uintptr) { /* sqlite3.c:116757:13: */ + + Xsqlite3ExprListDelete(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpCols) + Xsqlite3SelectDelete(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpSelect) + Xsqlite3DbFree(tls, db, (*Cte)(unsafe.Pointer(pCte)).FzName) +} + +// Free the contents of the CTE object passed as the second argument. +func Xsqlite3CteDelete(tls *libc.TLS, db uintptr, pCte uintptr) { /* sqlite3.c:116767:21: */ + + cteClear(tls, db, pCte) + Xsqlite3DbFree(tls, db, pCte) +} + // This routine is invoked once per CTE by the parser while parsing a -// WITH clause. -func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pName uintptr, pArglist uintptr, pQuery uintptr) uintptr { /* sqlite3.c:115477:21: */ +// WITH clause. The CTE described by teh third argument is added to +// the WITH clause of the second argument. If the second argument is +// NULL, then a new WITH argument is created. +func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pCte uintptr) uintptr { /* sqlite3.c:116779:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -96311,14 +97455,18 @@ func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pName uintptr var pNew uintptr var zName uintptr + if pCte == uintptr(0) { + return pWith + } + // Check that the CTE name is unique within this WITH clause. If // not, store an error in the Parse structure. - zName = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pName) + zName = (*Cte)(unsafe.Pointer(pCte)).FzName if (zName != 0) && (pWith != 0) { var i int32 for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ { - if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer((pWith+16 /* &.a */)+uintptr(i)*32)).FzName) == 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+15745 /* "duplicate WITH t..." */, libc.VaList(bp, zName)) + if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer((pWith+16 /* &.a */)+uintptr(i)*48)).FzName) == 0 { + Xsqlite3ErrorMsg(tls, pParse, ts+16209 /* "duplicate WITH t..." */, libc.VaList(bp, zName)) } } } @@ -96331,30 +97479,22 @@ func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pName uintptr } if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - Xsqlite3ExprListDelete(tls, db, pArglist) - Xsqlite3SelectDelete(tls, db, pQuery) - Xsqlite3DbFree(tls, db, zName) + Xsqlite3CteDelete(tls, db, pCte) pNew = pWith } else { - (*Cte)(unsafe.Pointer((pNew + 16 /* &.a */) + uintptr((*With)(unsafe.Pointer(pNew)).FnCte)*32)).FpSelect = pQuery - (*Cte)(unsafe.Pointer((pNew + 16 /* &.a */) + uintptr((*With)(unsafe.Pointer(pNew)).FnCte)*32)).FpCols = pArglist - (*Cte)(unsafe.Pointer((pNew + 16 /* &.a */) + uintptr((*With)(unsafe.Pointer(pNew)).FnCte)*32)).FzName = zName - (*Cte)(unsafe.Pointer((pNew + 16 /* &.a */) + uintptr((*With)(unsafe.Pointer(pNew)).FnCte)*32)).FzCteErr = uintptr(0) - (*With)(unsafe.Pointer(pNew)).FnCte++ + *(*Cte)(unsafe.Pointer((pNew + 16 /* &.a */) + uintptr(libc.PostIncInt32(&(*With)(unsafe.Pointer(pNew)).FnCte, 1))*48)) = *(*Cte)(unsafe.Pointer(pCte)) + Xsqlite3DbFree(tls, db, pCte) } return pNew } // Free the contents of the With object passed as the second argument. -func Xsqlite3WithDelete(tls *libc.TLS, db uintptr, pWith uintptr) { /* sqlite3.c:115527:21: */ +func Xsqlite3WithDelete(tls *libc.TLS, db uintptr, pWith uintptr) { /* sqlite3.c:116826:21: */ if pWith != 0 { var i int32 for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ { - var pCte uintptr = ((pWith + 16 /* &.a */) + uintptr(i)*32) - Xsqlite3ExprListDelete(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpCols) - Xsqlite3SelectDelete(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpSelect) - Xsqlite3DbFree(tls, db, (*Cte)(unsafe.Pointer(pCte)).FzName) + cteClear(tls, db, ((pWith + 16 /* &.a */) + uintptr(i)*48)) } Xsqlite3DbFree(tls, db, pWith) } @@ -96380,23 +97520,23 @@ func Xsqlite3WithDelete(tls *libc.TLS, db uintptr, pWith uintptr) { /* sqlite3.c // Invoke the 'collation needed' callback to request a collation sequence // in the encoding enc of name zName, length nName. -func callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { /* sqlite3.c:115565:13: */ +func callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { /* sqlite3.c:116861:13: */ if (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded != 0 { var zExternal uintptr = Xsqlite3DbStrDup(tls, db, zName) if !(zExternal != 0) { return } - (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 360 /* &.xCollNeeded */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, enc, zExternal) + (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 368 /* &.xCollNeeded */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, enc, zExternal) Xsqlite3DbFree(tls, db, zExternal) } if (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 != 0 { var zExternal uintptr var pTmp uintptr = Xsqlite3ValueNew(tls, db) - Xsqlite3ValueSetStr(tls, pTmp, -1, zName, SQLITE_UTF8, uintptr(0)) - zExternal = Xsqlite3ValueText(tls, pTmp, SQLITE_UTF16LE) + Xsqlite3ValueSetStr(tls, pTmp, -1, zName, uint8(SQLITE_UTF8), uintptr(0)) + zExternal = Xsqlite3ValueText(tls, pTmp, uint8(SQLITE_UTF16LE)) if zExternal != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 368 /* &.xCollNeeded16 */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, int32((*Sqlite3)(unsafe.Pointer(db)).Fenc), zExternal) + (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 376 /* &.xCollNeeded16 */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, int32((*Sqlite3)(unsafe.Pointer(db)).Fenc), zExternal) } Xsqlite3ValueFree(tls, pTmp) } @@ -96407,7 +97547,7 @@ func callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { /* sq // 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 *libc.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c:115594:12: */ +func synthCollSeq(tls *libc.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c:116890:12: */ var pColl2 uintptr var z uintptr = (*CollSeq)(unsafe.Pointer(pColl)).FzName var i int32 @@ -96422,7 +97562,7 @@ func synthCollSeq(tls *libc.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c return SQLITE_ERROR } -var aEnc = [3]U8{SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8} /* sqlite3.c:115598:19 */ +var aEnc = [3]U8{U8(SQLITE_UTF16BE), U8(SQLITE_UTF16LE), U8(SQLITE_UTF8)} /* sqlite3.c:116894: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 @@ -96433,7 +97573,7 @@ var aEnc = [3]U8{SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8} /* sqlite3.c:11559 // 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 Xsqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) int32 { /* sqlite3.c:115621:20: */ +func Xsqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) int32 { /* sqlite3.c:116917:20: */ if (pColl != 0) && ((*CollSeq)(unsafe.Pointer(pColl)).FxCmp == uintptr(0)) { var zName uintptr = (*CollSeq)(unsafe.Pointer(pColl)).FzName var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb @@ -96457,9 +97597,9 @@ func Xsqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) int32 { // 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 *libc.TLS, db uintptr, zName uintptr, create int32) uintptr { /* sqlite3.c:115649:16: */ +func findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) uintptr { /* sqlite3.c:116945:16: */ var pColl uintptr - pColl = Xsqlite3HashFind(tls, (db + 600 /* &.aCollSeq */), zName) + pColl = Xsqlite3HashFind(tls, (db + 608 /* &.aCollSeq */), zName) if (uintptr(0) == pColl) && (create != 0) { var nName int32 = (Xsqlite3Strlen30(tls, zName) + 1) @@ -96467,13 +97607,13 @@ func findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) ui if pColl != 0 { var pDel uintptr = uintptr(0) (*CollSeq)(unsafe.Pointer(pColl)).FzName = (pColl + 3*40) - (*CollSeq)(unsafe.Pointer(pColl)).Fenc = SQLITE_UTF8 + (*CollSeq)(unsafe.Pointer(pColl)).Fenc = U8(SQLITE_UTF8) (*CollSeq)(unsafe.Pointer(pColl + 1*40)).FzName = (pColl + 3*40) - (*CollSeq)(unsafe.Pointer(pColl + 1*40)).Fenc = SQLITE_UTF16LE + (*CollSeq)(unsafe.Pointer(pColl + 1*40)).Fenc = U8(SQLITE_UTF16LE) (*CollSeq)(unsafe.Pointer(pColl + 2*40)).FzName = (pColl + 3*40) - (*CollSeq)(unsafe.Pointer(pColl + 2*40)).Fenc = SQLITE_UTF16BE + (*CollSeq)(unsafe.Pointer(pColl + 2*40)).Fenc = U8(SQLITE_UTF16BE) libc.Xmemcpy(tls, (*CollSeq)(unsafe.Pointer(pColl)).FzName, zName, uint64(nName)) - pDel = Xsqlite3HashInsert(tls, (db + 600 /* &.aCollSeq */), (*CollSeq)(unsafe.Pointer(pColl)).FzName, pColl) + pDel = Xsqlite3HashInsert(tls, (db + 608 /* &.aCollSeq */), (*CollSeq)(unsafe.Pointer(pColl)).FzName, pColl) // If a malloc() failure occurred in sqlite3HashInsert(), it will // return the pColl pointer to be deleted (because it wasn't added @@ -96502,7 +97642,7 @@ func findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) ui // cannot be found. // // See also: sqlite3LocateCollSeq(), sqlite3GetCollSeq() -func Xsqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc U8, zName uintptr, create int32) uintptr { /* sqlite3.c:115701:24: */ +func Xsqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc U8, zName uintptr, create int32) uintptr { /* sqlite3.c:116997:24: */ var pColl uintptr if zName != 0 { @@ -96518,7 +97658,7 @@ func Xsqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc U8, zName uintptr, creat // Change the text encoding for a database connection. This means that // the pDfltColl must change as well. -func Xsqlite3SetTextEncoding(tls *libc.TLS, db uintptr, enc U8) { /* sqlite3.c:115723:21: */ +func Xsqlite3SetTextEncoding(tls *libc.TLS, db uintptr, enc U8) { /* sqlite3.c:117019:21: */ (*Sqlite3)(unsafe.Pointer(db)).Fenc = enc // EVIDENCE-OF: R-08308-17224 The default collating function for all @@ -96538,7 +97678,7 @@ func Xsqlite3SetTextEncoding(tls *libc.TLS, db uintptr, enc U8) { /* sqlite3.c:1 // sequence can be found. If no collation is found, leave an error message. // // See also: sqlite3LocateCollSeq(), sqlite3FindCollSeq() -func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zName uintptr) uintptr { /* sqlite3.c:115746:24: */ +func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zName uintptr) uintptr { /* sqlite3.c:117042:24: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -96560,7 +97700,7 @@ func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zN } if p == uintptr(0) { - Xsqlite3ErrorMsg(tls, pParse, ts+15775 /* "no such collatio..." */, libc.VaList(bp, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+16239 /* "no such collatio..." */, libc.VaList(bp, zName)) (*Parse)(unsafe.Pointer(pParse)).Frc = (SQLITE_ERROR | (int32(1) << 8)) } return p @@ -96584,7 +97724,7 @@ func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zN // and generates an error message. // // See also: sqlite3FindCollSeq(), sqlite3GetCollSeq() -func Xsqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) uintptr { /* sqlite3.c:115797:24: */ +func Xsqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) uintptr { /* sqlite3.c:117093:24: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var enc U8 = (*Sqlite3)(unsafe.Pointer(db)).Fenc var initbusy U8 = (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy @@ -96625,7 +97765,7 @@ func Xsqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) uintptr // If nArg==(-2) then any function with a non-null xSFunc is // a perfect match and any function with xSFunc NULL is // a non-match. -func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlite3.c:115840:12: */ +func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlite3.c:117136:12: */ var match int32 // Wrong number of arguments means "no match" @@ -96650,7 +97790,7 @@ func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlit } // Bonus points if the text encoding matches - if U32(enc) == ((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_ENCMASK) { + if U32(enc) == ((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) { match = match + (2) // Exact encoding match } else if ((U32(enc) & (*FuncDef)(unsafe.Pointer(p)).FfuncFlags) & U32(2)) != U32(0) { match = match + (1) // Both are UTF16, but with different byte orders @@ -96661,7 +97801,7 @@ func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlit // 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 Xsqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) uintptr { /* sqlite3.c:115876:24: */ +func Xsqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) uintptr { /* sqlite3.c:117172:24: */ var p uintptr for p = *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) /* &.a */) + uintptr(h)*8)); p != 0; p = *(*uintptr)(unsafe.Pointer(p + 64 /* &.u */)) { if Xsqlite3StrICmp(tls, (*FuncDef)(unsafe.Pointer(p)).FzName, zFunc) == 0 { @@ -96672,7 +97812,7 @@ func Xsqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) uintptr { /* } // Insert a new FuncDef into a FuncDefHash hash table. -func Xsqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32) { /* sqlite3.c:115892:21: */ +func Xsqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32) { /* sqlite3.c:117188:21: */ var i int32 for i = 0; i < nDef; i++ { var pOther uintptr @@ -96710,7 +97850,7 @@ func Xsqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32) { /* sq // 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 Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, enc U8, createFlag U8) uintptr { /* sqlite3.c:115937:24: */ +func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, enc U8, createFlag U8) uintptr { /* sqlite3.c:117233:24: */ var p uintptr // Iterator variable var pBest uintptr = uintptr(0) // Best match found so far var bestScore int32 = 0 // Score of best match @@ -96720,7 +97860,7 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, nName = Xsqlite3Strlen30(tls, zName) // First search for a match amongst the application-defined functions. - p = Xsqlite3HashFind(tls, (db + 576 /* &.aFunc */), zName) + p = Xsqlite3HashFind(tls, (db + 584 /* &.aFunc */), zName) for p != 0 { var score int32 = matchQuality(tls, p, nArg, enc) if score > bestScore { @@ -96741,7 +97881,7 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, // have fields overwritten with new information appropriate for the // new function. But the FuncDefs for built-in functions are read-only. // So we must not search for built-ins when creating a new function. - if !(createFlag != 0) && ((pBest == uintptr(0)) || (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_PreferBuiltin) != U32(0))) { + if !(createFlag != 0) && ((pBest == uintptr(0)) || (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_PreferBuiltin)) != U32(0))) { bestScore = 0 h = (((int32(Xsqlite3UpperToLower[U8(*(*int8)(unsafe.Pointer(zName)))])) + (nName)) % SQLITE_FUNC_HASH_SZ) p = Xsqlite3FunctionSearch(tls, h, zName) @@ -96768,7 +97908,7 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, for z = (*FuncDef)(unsafe.Pointer(pBest)).FzName; *(*U8)(unsafe.Pointer(z)) != 0; z++ { *(*U8)(unsafe.Pointer(z)) = Xsqlite3UpperToLower[*(*U8)(unsafe.Pointer(z))] } - pOther = Xsqlite3HashInsert(tls, (db + 576 /* &.aFunc */), (*FuncDef)(unsafe.Pointer(pBest)).FzName, pBest) + pOther = Xsqlite3HashInsert(tls, (db + 584 /* &.aFunc */), (*FuncDef)(unsafe.Pointer(pBest)).FzName, pBest) if pOther == pBest { Xsqlite3DbFree(tls, db, pBest) Xsqlite3OomFault(tls, db) @@ -96790,7 +97930,7 @@ func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, // of the schema hash tables). // // The Schema.cache_size variable is not cleared. -func Xsqlite3SchemaClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:116029:21: */ +func Xsqlite3SchemaClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:117325:21: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -96825,7 +97965,7 @@ func Xsqlite3SchemaClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:116029:21: */ // Find and return the schema associated with a BTree. Create // a new one if necessary. -func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqlite3.c:116061:23: */ +func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqlite3.c:117357:23: */ var p uintptr if pBt != 0 { p = Xsqlite3BtreeSchema(tls, pBt, int32(unsafe.Sizeof(Schema{})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3SchemaClear}))) @@ -96839,7 +97979,7 @@ func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqli Xsqlite3HashInit(tls, (p + 32 /* &.idxHash */)) Xsqlite3HashInit(tls, (p + 56 /* &.trigHash */)) Xsqlite3HashInit(tls, (p + 80 /* &.fkeyHash */)) - (*Schema)(unsafe.Pointer(p)).Fenc = SQLITE_UTF8 + (*Schema)(unsafe.Pointer(p)).Fenc = U8(SQLITE_UTF8) } return p } @@ -96872,18 +98012,18 @@ func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqli // pSrc->a[0].pTab Pointer to the Table object // pSrc->a[0].pIndex Pointer to the INDEXED BY index, if there is one // -func Xsqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) uintptr { /* sqlite3.c:116112:22: */ +func Xsqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) uintptr { /* sqlite3.c:117408:22: */ var pItem uintptr = pSrc + 8 /* &.a */ var pTab uintptr pTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), pItem) - Xsqlite3DeleteTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcList_item)(unsafe.Pointer(pItem)).FpTab) - (*SrcList_item)(unsafe.Pointer(pItem)).FpTab = pTab + Xsqlite3DeleteTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcItem)(unsafe.Pointer(pItem)).FpTab) + (*SrcItem)(unsafe.Pointer(pItem)).FpTab = pTab if pTab != 0 { (*Table)(unsafe.Pointer(pTab)).FnTabRef++ - } - if Xsqlite3IndexedByLookup(tls, pParse, pItem) != 0 { - pTab = uintptr(0) + if ((uint32(int32(*(*uint8)(unsafe.Pointer((pItem + 60 /* &.fg */) + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0) && (Xsqlite3IndexedByLookup(tls, pParse, pItem) != 0) { + pTab = uintptr(0) + } } return pTab } @@ -96902,7 +98042,7 @@ func Xsqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) uintptr // 3) The table is a shadow table, the database connection is in // defensive mode, and the current sqlite3_prepare() // is for a top-level SQL statement. -func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:116143:12: */ +func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:117439:12: */ var db uintptr if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { return (libc.Bool32((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pTab))).FpMod)).FpModule)).FxUpdate == uintptr(0))) @@ -96911,7 +98051,7 @@ func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlit return 0 } db = (*Parse)(unsafe.Pointer(pParse)).Fdb - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Readonly) != U32(0) { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Readonly)) != U32(0) { return (libc.Bool32((Xsqlite3WritableSchema(tls, db) == 0) && (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0))) } @@ -96921,16 +98061,16 @@ func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlit // 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 Xsqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, viewOk int32) int32 { /* sqlite3.c:116162:20: */ +func Xsqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, viewOk int32) int32 { /* sqlite3.c:117458:20: */ bp := tls.Alloc(16) defer tls.Free(16) if tabIsReadOnly(tls, pParse, pTab) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+15806 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+16270 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) return 1 } if !(viewOk != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+15835 /* "cannot modify %s..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+16299 /* "cannot modify %s..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) return 1 } return 0 @@ -96939,7 +98079,7 @@ func Xsqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, viewOk int3 // 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 Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr, iCur int32) { /* sqlite3.c:116183:21: */ +func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr, iCur int32) { /* sqlite3.c:117479:21: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -96953,12 +98093,12 @@ func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWher pFrom = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) if pFrom != 0 { - (*SrcList_item)(unsafe.Pointer((pFrom + 8 /* &.a */))).FzName = Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pView)).FzName) - (*SrcList_item)(unsafe.Pointer((pFrom + 8 /* &.a */))).FzDatabase = Xsqlite3DbStrDup(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName) + (*SrcItem)(unsafe.Pointer((pFrom + 8 /* &.a */))).FzName = Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pView)).FzName) + (*SrcItem)(unsafe.Pointer((pFrom + 8 /* &.a */))).FzDatabase = Xsqlite3DbStrDup(tls, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName) } pSel = Xsqlite3SelectNew(tls, pParse, uintptr(0), pFrom, pWhere, uintptr(0), uintptr(0), pOrderBy, - SF_IncludeHidden, pLimit) + uint32(SF_IncludeHidden), pLimit) Xsqlite3SelectDestInit(tls, bp /* &dest */, SRT_EphemTab, iCur) Xsqlite3Select(tls, pParse, pSel, bp /* &dest */) Xsqlite3SelectDelete(tls, db, pSel) @@ -96971,7 +98111,7 @@ func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWher // DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL; // \________/ \________________/ // pTabList pWhere -func Xsqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:116315:21: */ +func Xsqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:117617:21: */ bp := tls.Alloc(88) defer tls.Free(88) @@ -97156,9 +98296,10 @@ __13: // Initialize the counter of the number of rows deleted, if // we are counting rows. - if !(((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) && + if !((((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) && - !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) { + !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) && + !(int32((*Parse)(unsafe.Pointer(pParse)).FbReturning) != 0)) { goto __14 } memCnt = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) @@ -97185,7 +98326,7 @@ __14: } Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(1), (*Table)(unsafe.Pointer(pTab)).FzName) - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __17 } Xsqlite3VdbeAddOp4(tls, v, OP_Clear, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, func() int32 { @@ -97214,7 +98355,7 @@ __20: goto __16 __15: - wcf = (U16((WHERE_ONEPASS_DESIRED | WHERE_DUPLICATES_OK) | WHERE_SEEK_TABLE)) + wcf = (U16(WHERE_ONEPASS_DESIRED | WHERE_DUPLICATES_OK)) if !(((*NameContext)(unsafe.Pointer(bp+16 /* &sNC */)).FncFlags & NC_VarSelect) != 0) { goto __21 } @@ -97227,7 +98368,7 @@ __21: } return WHERE_ONEPASS_MULTIROW }())) - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __22 } // For a rowid table, initialize the RowSet to an empty set @@ -97272,44 +98413,50 @@ __24: Xsqlite3MultiWrite(tls, pParse) __25: ; + if !(Xsqlite3WhereUsesDeferredSeek(tls, pWInfo) != 0) { + goto __26 + } + Xsqlite3VdbeAddOp1(tls, v, OP_FinishSeek, iTabCur) +__26: + ; // Keep track of the number of rows to be deleted if !(memCnt != 0) { - goto __26 + goto __27 } Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, memCnt, 1) -__26: +__27: ; // Extract the rowid or primary key for the current row if !(pPk != 0) { - goto __27 + goto __28 } i = 0 -__29: +__30: if !(i < int32(nPk)) { - goto __31 + goto __32 } Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iTabCur, int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), (iPk + i)) - goto __30 -__30: - i++ - goto __29 goto __31 __31: + i++ + goto __30 + goto __32 +__32: ; iKey = iPk - goto __28 -__27: + goto __29 +__28: iKey = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iTabCur, -1, iKey) -__28: +__29: ; if !(eOnePass != ONEPASS_OFF) { - goto __32 + goto __33 } // For ONEPASS, no need to store the rowid/primary-key. There is only // one, so just keep it in its register(s) and fall through to the @@ -97317,63 +98464,53 @@ __28: nKey = nPk // OP_Found will use an unpacked key aToOpen = Xsqlite3DbMallocRawNN(tls, db, (uint64(nIdx + 2))) if !(aToOpen == uintptr(0)) { - goto __34 + goto __35 } Xsqlite3WhereEnd(tls, pWInfo) goto delete_from_cleanup -__34: +__35: ; libc.Xmemset(tls, aToOpen, 1, (uint64(nIdx + 1))) *(*U8)(unsafe.Pointer(aToOpen + uintptr((nIdx + 1)))) = U8(0) if !(*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */)) >= 0) { - goto __35 - } - *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */)) - iTabCur)))) = U8(0) -__35: - ; - if !(*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4)) >= 0) { goto __36 } - *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4)) - iTabCur)))) = U8(0) + *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */)) - iTabCur)))) = U8(0) __36: ; - if !(addrEphOpen != 0) { + if !(*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4)) >= 0) { goto __37 } - Xsqlite3VdbeChangeToNoop(tls, v, addrEphOpen) + *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4)) - iTabCur)))) = U8(0) __37: ; - goto __33 -__32: - if !(pPk != 0) { + if !(addrEphOpen != 0) { goto __38 } + Xsqlite3VdbeChangeToNoop(tls, v, addrEphOpen) +__38: + ; + addrBypass = Xsqlite3VdbeMakeLabel(tls, pParse) + goto __34 +__33: + if !(pPk != 0) { + goto __39 + } // Add the PK key for this row to the temporary table iKey = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) nKey = int16(0) // Zero tells OP_Found to use a composite key Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, iPk, int32(nPk), iKey, Xsqlite3IndexAffinityStr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pPk), int32(nPk)) Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iEphCur, iKey, iPk, int32(nPk)) - goto __39 -__38: + goto __40 +__39: // Add the rowid of the row to be deleted to the RowSet nKey = int16(1) // OP_DeferredSeek always uses a single rowid Xsqlite3VdbeAddOp2(tls, v, OP_RowSetAdd, iRowSet, iKey) -__39: - ; -__33: - ; - - // If this DELETE cannot use the ONEPASS strategy, this is the - // end of the WHERE loop - if !(eOnePass != ONEPASS_OFF) { - goto __40 - } - addrBypass = Xsqlite3VdbeMakeLabel(tls, pParse) - goto __41 __40: + ; Xsqlite3WhereEnd(tls, pWInfo) -__41: +__34: ; // Unless this is a view, open cursors for the table we are @@ -97381,118 +98518,118 @@ __41: // only effect this statement has is to fire the INSTEAD OF // triggers. if !(!(isView != 0)) { - goto __42 + goto __41 } iAddrOnce = 0 if !(eOnePass == ONEPASS_MULTI) { - goto __43 + goto __42 } iAddrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once) -__43: +__42: ; - Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, OPFLAG_FORDELETE, + Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, uint8(OPFLAG_FORDELETE), iTabCur, aToOpen, bp+80 /* &iDataCur */, bp+84 /* &iIdxCur */) if !(eOnePass == ONEPASS_MULTI) { - goto __44 + goto __43 } Xsqlite3VdbeJumpHereOrPopInst(tls, v, iAddrOnce) -__44: +__43: ; -__42: +__41: ; // Set up a loop over the rowids/primary-keys that were found in the // where-clause loop above. if !(eOnePass != ONEPASS_OFF) { - goto __45 + goto __44 } // OP_Found will use an unpacked key if !(!((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) && (*(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 80 /* iDataCur */)) - iTabCur)))) != 0)) { - goto __47 + goto __46 } Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, *(*int32)(unsafe.Pointer(bp + 80 /* iDataCur */)), addrBypass, iKey, int32(nKey)) -__47: +__46: ; - goto __46 -__45: + goto __45 +__44: if !(pPk != 0) { - goto __48 + goto __47 } addrLoop = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, iEphCur) if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { - goto __50 + goto __49 } Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEphCur, 0, iKey) - goto __51 -__50: + goto __50 +__49: Xsqlite3VdbeAddOp2(tls, v, OP_RowData, iEphCur, iKey) -__51: +__50: ; // OP_Found will use a composite key - goto __49 -__48: + goto __48 +__47: addrLoop = Xsqlite3VdbeAddOp3(tls, v, OP_RowSetRead, iRowSet, 0, iKey) -__49: +__48: ; -__46: +__45: ; // Delete the row if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { - goto __52 + goto __51 } pVTab = Xsqlite3GetVTable(tls, db, pTab) Xsqlite3VtabMakeWritable(tls, pParse, pTab) Xsqlite3MayAbort(tls, pParse) if !(eOnePass == ONEPASS_SINGLE) { - goto __54 + goto __53 } Xsqlite3VdbeAddOp1(tls, v, OP_Close, iTabCur) if !((*Parse)(unsafe.Pointer((pParse))).FpToplevel == uintptr(0)) { - goto __55 + goto __54 } (*Parse)(unsafe.Pointer(pParse)).FisMultiWrite = U8(0) -__55: - ; __54: ; +__53: + ; Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 0, 1, iKey, pVTab, -12) - Xsqlite3VdbeChangeP5(tls, v, OE_Abort) - goto __53 -__52: + Xsqlite3VdbeChangeP5(tls, v, uint16(OE_Abort)) + goto __52 +__51: count = (libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)) // True to count changes Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, *(*int32)(unsafe.Pointer(bp + 80 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 84 /* iIdxCur */)), - iKey, nKey, uint8(count), OE_Default, uint8(eOnePass), *(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4))) -__53: + iKey, nKey, uint8(count), uint8(OE_Default), uint8(eOnePass), *(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + 1*4))) +__52: ; // End of the loop over all rowids/primary-keys. if !(eOnePass != ONEPASS_OFF) { - goto __56 + goto __55 } Xsqlite3VdbeResolveLabel(tls, v, addrBypass) Xsqlite3WhereEnd(tls, pWInfo) - goto __57 -__56: + goto __56 +__55: if !(pPk != 0) { - goto __58 + goto __57 } Xsqlite3VdbeAddOp2(tls, v, OP_Next, iEphCur, (addrLoop + 1)) Xsqlite3VdbeJumpHere(tls, v, addrLoop) - goto __59 -__58: + goto __58 +__57: Xsqlite3VdbeGoto(tls, v, addrLoop) Xsqlite3VdbeJumpHere(tls, v, addrLoop) -__59: +__58: ; -__57: +__56: ; __16: ; // End non-truncate path @@ -97501,22 +98638,22 @@ __16: // maximum rowid counter values recorded while inserting into // autoincrement tables. if !((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && ((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0))) { - goto __60 + goto __59 } Xsqlite3AutoincrementEnd(tls, pParse) -__60: +__59: ; // Return the number of rows that were deleted. If this routine is // generating code because of a call to sqlite3NestedParse(), do not // invoke the callback function. if !(memCnt != 0) { - goto __61 + goto __60 } - Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, memCnt, 1) + Xsqlite3VdbeAddOp2(tls, v, OP_ChngCntRow, memCnt, 1) Xsqlite3VdbeSetNumCols(tls, v, 1) - Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+15873 /* "rows deleted" */, uintptr(0)) -__61: + Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+16337 /* "rows deleted" */, uintptr(0)) +__60: ; delete_from_cleanup: @@ -97570,7 +98707,7 @@ delete_from_cleanup: // 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 Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger uintptr, iDataCur int32, iIdxCur int32, iPk int32, nPk I16, count U8, onconf U8, eMode U8, iIdxNoSeek int32) { /* sqlite3.c:116762:21: */ +func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger uintptr, iDataCur int32, iIdxCur int32, iPk int32, nPk I16, count U8, onconf U8, eMode U8, iIdxNoSeek int32) { /* sqlite3.c:118062:21: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Vdbe var iOld int32 = 0 // First register in OLD.* array var iLabel int32 // Label resolved to end of generated code @@ -97582,10 +98719,10 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri // (this can happen if a trigger program has already deleted it), do // not attempt to delete it or fire any DELETE triggers. iLabel = Xsqlite3VdbeMakeLabel(tls, pParse) - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { - opSeek = OP_NotExists + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + opSeek = uint8(OP_NotExists) } else { - opSeek = OP_NotFound + opSeek = uint8(OP_NotFound) } if int32(eMode) == ONEPASS_OFF { Xsqlite3VdbeAddOp4Int(tls, v, int32(opSeek), iDataCur, iLabel, iPk, int32(nPk)) @@ -97660,11 +98797,11 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri } return 0 }()) - if (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) || (0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+12457 /* "sqlite_stat1" */)) { + if (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) || (0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+12870 /* "sqlite_stat1" */)) { Xsqlite3VdbeAppendP4(tls, v, pTab, -6) } if int32(eMode) != ONEPASS_OFF { - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_AUXDELETE) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_AUXDELETE)) } if (iIdxNoSeek >= 0) && (iIdxNoSeek != iDataCur) { Xsqlite3VdbeAddOp1(tls, v, OP_Delete, iIdxNoSeek) @@ -97707,7 +98844,7 @@ func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri // // 3. The "iDataCur" cursor must be already be positioned on the row // that is to be deleted. -func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, aRegIdx uintptr, iIdxNoSeek int32) { /* sqlite3.c:116914:21: */ +func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, aRegIdx uintptr, iIdxNoSeek int32) { /* sqlite3.c:118214:21: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -97721,7 +98858,7 @@ func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, var pPk uintptr // PRIMARY KEY index, or NULL for rowid tables v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk = uintptr(0) } else { pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) @@ -97796,7 +98933,7 @@ __3: // 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 Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iDataCur int32, regOut int32, prefixOnly int32, piPartIdxLabel uintptr, pPrior uintptr, regPrior int32) int32 { /* sqlite3.c:116979:20: */ +func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iDataCur int32, regOut int32, prefixOnly int32, piPartIdxLabel uintptr, pPrior uintptr, regPrior int32) int32 { /* sqlite3.c:118279:20: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var j int32 var regBase int32 @@ -97838,14 +98975,10 @@ func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iData // But we are getting ready to store this value back into an index, where // it should be converted by to INTEGER again. So omit the OP_RealAffinity // opcode if it is present - Xsqlite3VdbeDeletePriorOpcode(tls, v, OP_RealAffinity) + Xsqlite3VdbeDeletePriorOpcode(tls, v, uint8(OP_RealAffinity)) } if regOut != 0 { Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regBase, nCol, regOut) - if (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FpSelect != 0 { - var zAff uintptr = Xsqlite3IndexAffinityStr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIdx) - Xsqlite3VdbeChangeP4(tls, v, -1, zAff, P4_TRANSIENT) - } } Xsqlite3ReleaseTempRange(tls, pParse, regBase, nCol) return regBase @@ -97854,7 +98987,7 @@ func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iData // 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 Xsqlite3ResolvePartIdxLabel(tls *libc.TLS, pParse uintptr, iLabel int32) { /* sqlite3.c:117043:21: */ +func Xsqlite3ResolvePartIdxLabel(tls *libc.TLS, pParse uintptr, iLabel int32) { /* sqlite3.c:118339:21: */ if iLabel != 0 { Xsqlite3VdbeResolveLabel(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iLabel) } @@ -97882,7 +99015,7 @@ func Xsqlite3ResolvePartIdxLabel(tls *libc.TLS, pParse uintptr, iLabel int32) { // #include "vdbeInt.h" // Return the collating function associated with a function. -func sqlite3GetFuncCollSeq(tls *libc.TLS, context uintptr) uintptr { /* sqlite3.c:117077:16: */ +func sqlite3GetFuncCollSeq(tls *libc.TLS, context uintptr) uintptr { /* sqlite3.c:118373:16: */ var pOp uintptr pOp = ((*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(context)).FpVdbe)).FaOp + uintptr(((*Sqlite3_context)(unsafe.Pointer(context)).FiOp-1))*32) @@ -97892,14 +99025,14 @@ func sqlite3GetFuncCollSeq(tls *libc.TLS, context uintptr) uintptr { /* sqlite3. // Indicate that the accumulator load should be skipped on this // iteration of the aggregate loop. -func sqlite3SkipAccumulatorLoad(tls *libc.TLS, context uintptr) { /* sqlite3.c:117090:13: */ +func sqlite3SkipAccumulatorLoad(tls *libc.TLS, context uintptr) { /* sqlite3.c:118386:13: */ (*Sqlite3_context)(unsafe.Pointer(context)).FisError = -1 (*Sqlite3_context)(unsafe.Pointer(context)).FskipFlag = U8(1) } // Implementation of the non-aggregate min() and max() functions -func minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117099:13: */ +func minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118395:13: */ var i int32 var mask int32 // 0 for min() or 0xffffffff for max() var iBest int32 @@ -97929,7 +99062,7 @@ func minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s } // Return the type of the argument. -func typeofFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:117129:13: */ +func typeofFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:118425:13: */ var i int32 = (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) - 1) _ = NotUsed @@ -97940,10 +99073,10 @@ func typeofFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { / Xsqlite3_result_text(tls, context, azType2[i], -1, uintptr(0)) } -var azType2 = [5]uintptr{ts + 7853 /* "integer" */, ts + 7848 /* "real" */, ts + 15886 /* "text" */, ts + 15891 /* "blob" */, ts + 7843 /* "null" */} /* sqlite3.c:117134:21 */ +var azType2 = [5]uintptr{ts + 7946 /* "integer" */, ts + 7941 /* "real" */, ts + 16350 /* "text" */, ts + 16355 /* "blob" */, ts + 7936 /* "null" */} /* sqlite3.c:118430:21 */ // Implementation of the length() function -func lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117154:13: */ +func lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118450:13: */ _ = argc switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) { @@ -97992,7 +99125,7 @@ func lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s // // IMP: R-23979-26855 The abs(X) function returns the absolute value of // the numeric argument X. -func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117196:13: */ +func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118492:13: */ _ = argc switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) { @@ -98004,7 +99137,7 @@ func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli // IMP: R-31676-45509 If X is the integer -9223372036854775808 // then abs(X) throws an integer overflow error since there is no // equivalent positive 64-bit two complement value. - Xsqlite3_result_error(tls, context, ts+15896 /* "integer overflow" */, -1) + Xsqlite3_result_error(tls, context, ts+16360 /* "integer overflow" */, -1) return } iVal = -iVal @@ -98046,7 +99179,7 @@ func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117245:13: */ +func instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118541:13: */ var zHaystack uintptr var zNeedle uintptr var nHaystack int32 @@ -98161,7 +99294,7 @@ endInstrOOM: } // Implementation of the printf() function. -func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117313:13: */ +func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118609:13: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -98177,8 +99310,8 @@ func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s (*PrintfArguments)(unsafe.Pointer(bp + 40 /* &x */)).FnArg = (argc - 1) (*PrintfArguments)(unsafe.Pointer(bp + 40 /* &x */)).FnUsed = 0 (*PrintfArguments)(unsafe.Pointer(bp + 40 /* &x */)).FapArg = (argv + uintptr(1)*8) - Xsqlite3StrAccumInit(tls, bp+8 /* &str */, db, uintptr(0), 0, *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) - (*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FprintfFlags = SQLITE_PRINTF_SQLFUNC + Xsqlite3StrAccumInit(tls, bp+8 /* &str */, db, uintptr(0), 0, *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) + (*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FprintfFlags = U8(SQLITE_PRINTF_SQLFUNC) Xsqlite3_str_appendf(tls, bp+8 /* &str */, zFormat, libc.VaList(bp, bp+40 /* &x */)) n = int32((*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FnChar) Xsqlite3_result_text(tls, context, Xsqlite3StrAccumFinish(tls, bp+8 /* &str */), n, @@ -98196,7 +99329,7 @@ func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117349:13: */ +func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118645:13: */ var z uintptr var z2 uintptr var len int32 @@ -98244,7 +99377,7 @@ func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s negP2 = 1 } } else { - p2 = I64(*(*int32)(unsafe.Pointer((Xsqlite3_context_db_handle(tls, context) + 124 /* &.aLimit */)))) + p2 = I64(*(*int32)(unsafe.Pointer((Xsqlite3_context_db_handle(tls, context) + 128 /* &.aLimit */)))) } if p1 < int64(0) { p1 = p1 + (I64(len)) @@ -98291,7 +99424,7 @@ func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s } Xsqlite3_result_text64(tls, context, z, (uint64((int64(z2) - int64(z)) / 1)), libc.UintptrFromInt32(-1), - SQLITE_UTF8) + uint8(SQLITE_UTF8)) } else { if (p1 + p2) > I64(len) { p2 = (I64(len) - p1) @@ -98304,7 +99437,7 @@ func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s } // Implementation of the round() function -func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117444:13: */ +func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118740:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -98342,12 +99475,12 @@ func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq return +0.5 }())))) } else { - zBuf = Xsqlite3_mprintf(tls, ts+15913 /* "%.*f" */, libc.VaList(bp, n, *(*float64)(unsafe.Pointer(bp + 16 /* r */)))) + zBuf = Xsqlite3_mprintf(tls, ts+16377 /* "%.*f" */, libc.VaList(bp, n, *(*float64)(unsafe.Pointer(bp + 16 /* r */)))) if zBuf == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return } - Xsqlite3AtoF(tls, zBuf, bp+16 /* &r */, Xsqlite3Strlen30(tls, zBuf), SQLITE_UTF8) + Xsqlite3AtoF(tls, zBuf, bp+16 /* &r */, Xsqlite3Strlen30(tls, zBuf), uint8(SQLITE_UTF8)) Xsqlite3_free(tls, zBuf) } Xsqlite3_result_double(tls, context, *(*float64)(unsafe.Pointer(bp + 16 /* r */))) @@ -98358,11 +99491,11 @@ func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq // 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 *libc.TLS, context uintptr, nByte I64) uintptr { /* sqlite3.c:117485:13: */ +func contextMalloc(tls *libc.TLS, context uintptr, nByte I64) uintptr { /* sqlite3.c:118781:13: */ var z uintptr var db uintptr = Xsqlite3_context_db_handle(tls, context) - if nByte > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) { + if nByte > I64(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) { Xsqlite3_result_error_toobig(tls, context) z = uintptr(0) } else { @@ -98375,7 +99508,7 @@ func contextMalloc(tls *libc.TLS, context uintptr, nByte I64) uintptr { /* sqlit } // Implementation of the upper() and lower() SQL functions. -func upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117506:13: */ +func upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118802:13: */ var z1 uintptr var z2 uintptr var i int32 @@ -98396,7 +99529,7 @@ func upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq } } -func lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117525:13: */ +func lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118821:13: */ var z1 uintptr var z2 uintptr var i int32 @@ -98425,7 +99558,7 @@ func lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq // is. We might as well use the "version()" function as a substitute. // Implementation of random(). Return a random integer. -func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117558:13: */ +func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:118854:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -98449,7 +99582,7 @@ func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) // Implementation of randomblob(N). Return a random blob // that is N bytes long. -func randomBlob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117584:13: */ +func randomBlob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118880:13: */ var n Sqlite3_int64 var p uintptr @@ -98467,7 +99600,7 @@ func randomBlob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s // 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 *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117608:13: */ +func last_insert_rowid(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:118904:13: */ var db uintptr = Xsqlite3_context_db_handle(tls, context) _ = NotUsed _ = NotUsed2 @@ -98482,7 +99615,7 @@ func last_insert_rowid(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 u // 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 *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117628:13: */ +func changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:118924:13: */ var db uintptr = Xsqlite3_context_db_handle(tls, context) _ = NotUsed _ = NotUsed2 @@ -98491,7 +99624,7 @@ func changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { // Implementation of the total_changes() SQL function. The return value is // the same as the sqlite3_total_changes() API function. -func total_changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117642:13: */ +func total_changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:118938:13: */ var db uintptr = Xsqlite3_context_db_handle(tls, context) _ = NotUsed _ = NotUsed2 @@ -98506,20 +99639,20 @@ type compareInfo = struct { FmatchOne U8 FmatchSet U8 FnoCase U8 -} /* sqlite3.c:117657:1 */ +} /* sqlite3.c:118953:1 */ // For LIKE and GLOB matching on EBCDIC machines, assume that every // character is exactly one byte in size. Also, provde the Utf8Read() // macro for fast reading of the next character in the common case where // the next character is ASCII. -var globInfo = compareInfo{FmatchAll: U8('*'), FmatchOne: U8('?'), FmatchSet: U8('[')} /* sqlite3.c:117677:33 */ +var globInfo = compareInfo{FmatchAll: U8('*'), FmatchOne: U8('?'), FmatchSet: U8('[')} /* sqlite3.c:118973:33 */ // The correct SQL-92 behavior is for the LIKE operator to ignore // case. Thus 'a' LIKE 'A' would be true. -var likeInfoNorm = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_'), FnoCase: U8(1)} /* sqlite3.c:117680:33 */ +var likeInfoNorm = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_'), FnoCase: U8(1)} /* sqlite3.c:118976:33 */ // If SQLITE_CASE_SENSITIVE_LIKE is defined, then the LIKE operator // is case sensitive causing 'a' LIKE 'A' to be false -var likeInfoAlt = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_')} /* sqlite3.c:117683:33 */ +var likeInfoAlt = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_')} /* sqlite3.c:118979:33 */ // Possible error returns from patternMatch() @@ -98559,7 +99692,7 @@ var likeInfoAlt = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_')} /* sqlite3 // 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 *libc.TLS, zPattern uintptr, zString uintptr, pInfo uintptr, matchOther U32) int32 { /* sqlite3.c:117730:12: */ +func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uintptr, matchOther U32) int32 { /* sqlite3.c:119026:12: */ bp := tls.Alloc(19) defer tls.Free(19) *(*uintptr)(unsafe.Pointer(bp)) = zPattern @@ -98587,7 +99720,8 @@ func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uint return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp /* zPattern */)), 1)))) } return Xsqlite3Utf8Read(tls, bp /* &zPattern */) - }())) == matchAll) || (c == matchOne) { + }())) == matchAll) || + ((c == matchOne) && (matchOne != U32(0))) { if (c == matchOne) && (Xsqlite3Utf8Read(tls, bp+8 /* &zString */) == U32(0)) { return SQLITE_NOWILDCARDMATCH } @@ -98744,20 +99878,20 @@ func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uint // The sqlite3_strglob() interface. Return 0 on a match (like strcmp()) and // non-zero if there is no match. -func Xsqlite3_strglob(tls *libc.TLS, zGlobPattern uintptr, zString uintptr) int32 { /* sqlite3.c:117862:16: */ +func Xsqlite3_strglob(tls *libc.TLS, zGlobPattern uintptr, zString uintptr) int32 { /* sqlite3.c:119159:16: */ return patternCompare(tls, zGlobPattern, zString, uintptr(unsafe.Pointer(&globInfo)), uint32('[')) } // The sqlite3_strlike() interface. Return 0 on a match and non-zero for // a miss - like strcmp(). -func Xsqlite3_strlike(tls *libc.TLS, zPattern uintptr, zStr uintptr, esc uint32) int32 { /* sqlite3.c:117870:16: */ +func Xsqlite3_strlike(tls *libc.TLS, zPattern uintptr, zStr uintptr, esc uint32) int32 { /* sqlite3.c:119167:16: */ return patternCompare(tls, zPattern, zStr, uintptr(unsafe.Pointer(&likeInfoNorm)), esc) } // Count the number of times that the LIKE operator (or GLOB which is // just a variation of LIKE) gets called. This is used for testing // only. -var Xsqlite3_like_count int32 = 0 /* sqlite3.c:117880:16 */ +var Xsqlite3_like_count int32 = 0 /* sqlite3.c:119177:16 */ // Implementation of the like() SQL function. This function implements // the build-in LIKE operator. The first argument to the function is the @@ -98769,7 +99903,7 @@ var Xsqlite3_like_count int32 = 0 /* sqlite3.c:117880:16 */ // // This same function (with a different compareInfo structure) computes // the GLOB operator. -func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117896:13: */ +func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119193:13: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -98792,8 +99926,8 @@ func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql // of deep recursion and N*N behavior in patternCompare(). nPat = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) - if nPat > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 8*4)) { - Xsqlite3_result_error(tls, context, ts+15918 /* "LIKE or GLOB pat..." */, -1) + if nPat > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 8*4)) { + Xsqlite3_result_error(tls, context, ts+16382 /* "LIKE or GLOB pat..." */, -1) return } if argc == 3 { @@ -98805,7 +99939,7 @@ func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql } if Xsqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp /* zEsc */)), -1) != 1 { Xsqlite3_result_error(tls, context, - ts+15951 /* "ESCAPE expressio..." */, -1) + ts+16415 /* "ESCAPE expressio..." */, -1) return } escape = Xsqlite3Utf8Read(tls, bp /* &zEsc */) @@ -98834,7 +99968,7 @@ func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql // 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 *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:117967:13: */ +func nullifFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:119264:13: */ var pColl uintptr = sqlite3GetFuncCollSeq(tls, context) _ = NotUsed if Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(argv)), *(*uintptr)(unsafe.Pointer(argv + 1*8)), pColl) != 0 { @@ -98844,7 +99978,7 @@ func nullifFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { / // Implementation of the sqlite_version() function. The result is the version // of the SQLite library that is running. -func versionFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117983:13: */ +func versionFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:119280:13: */ _ = NotUsed _ = NotUsed2 // IMP: R-48699-48617 This function is an SQL wrapper around the @@ -98855,7 +99989,7 @@ func versionFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr // 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 *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117999:13: */ +func sourceidFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:119296:13: */ _ = NotUsed _ = NotUsed2 // IMP: R-24470-31136 This function is an SQL wrapper around the @@ -98866,7 +100000,7 @@ func sourceidFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintpt // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118015:13: */ +func errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119312:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -98878,7 +100012,7 @@ func errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s // Implementation of the sqlite_compileoption_used() function. // The result is an integer that identifies if the compiler option // was used to build SQLite. -func compileoptionusedFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118031:13: */ +func compileoptionusedFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119328:13: */ var zOptName uintptr _ = argc @@ -98893,7 +100027,7 @@ func compileoptionusedFunc(tls *libc.TLS, context uintptr, argc int32, argv uint // Implementation of the sqlite_compileoption_get() function. // The result is a string that identifies the compiler options // used to build SQLite. -func compileoptiongetFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118055:13: */ +func compileoptiongetFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119352:13: */ var n int32 _ = argc @@ -98908,14 +100042,14 @@ func compileoptiongetFunc(tls *libc.TLS, context uintptr, argc int32, argv uintp var hexdigits = [16]int8{ int8('0'), int8('1'), int8('2'), int8('3'), int8('4'), int8('5'), int8('6'), int8('7'), int8('8'), int8('9'), int8('A'), int8('B'), int8('C'), int8('D'), int8('E'), int8('F'), -} /* sqlite3.c:118073:19 */ +} /* sqlite3.c:119370:19 */ // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118085:13: */ +func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119382:13: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -98929,10 +100063,10 @@ func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq // var zBuf [50]int8 at bp+16, 50 r1 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))) - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+6578 /* "%!.15g" */, libc.VaList(bp, r1)) - Xsqlite3AtoF(tls, bp+16 /* &zBuf[0] */, bp+72 /* &r2 */, 20, SQLITE_UTF8) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+6654 /* "%!.15g" */, libc.VaList(bp, r1)) + Xsqlite3AtoF(tls, bp+16 /* &zBuf[0] */, bp+72 /* &r2 */, 20, uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp + 72 /* r2 */)) { - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+15996 /* "%!.20e" */, libc.VaList(bp+8, r1)) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+16460 /* "%!.20e" */, libc.VaList(bp+8, r1)) } Xsqlite3_result_text(tls, context, bp+16 /* &zBuf[0] */, -1, libc.UintptrFromInt32(-1)) break @@ -99015,7 +100149,7 @@ func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq // The unicode() function. Return the integer unicode code-point value // for the first character of the input string. -func unicodeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118161:13: */ +func unicodeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119458:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -99029,7 +100163,7 @@ func unicodeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118176:13: */ +func charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119473:13: */ var z uintptr var zOut uintptr var i int32 @@ -99062,12 +100196,12 @@ func charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F)))))) } } - Xsqlite3_result_text64(tls, context, z, (uint64((int64(zOut) - int64(z)) / 1)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})), SQLITE_UTF8) + Xsqlite3_result_text64(tls, context, z, (uint64((int64(zOut) - int64(z)) / 1)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})), uint8(SQLITE_UTF8)) } // The hex() function. Interpret the argument as a blob. Return // a hexadecimal rendering as text. -func hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118217:13: */ +func hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119514:13: */ var i int32 var n int32 var pBlob uintptr @@ -99105,7 +100239,7 @@ func hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli } // The zeroblob(N) function returns a zero-filled blob of size N bytes. -func zeroblobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118245:13: */ +func zeroblobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119542:13: */ var n I64 var rc int32 @@ -99124,7 +100258,7 @@ func zeroblobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118268:13: */ +func replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119565:13: */ var zStr uintptr // The input string A var zPattern uintptr // The pattern string B var zRep uintptr // The replacement string C @@ -99179,7 +100313,7 @@ func replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* if nRep > nPattern { nOut = nOut + (I64(nRep - nPattern)) - if (nOut - int64(1)) > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) { + if (nOut - int64(1)) > I64(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) { Xsqlite3_result_error_toobig(tls, context) Xsqlite3_free(tls, zOut) return @@ -99213,7 +100347,7 @@ func replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118361:13: */ +func trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119658:13: */ var zIn uintptr // Input string var zCharSet uintptr // Set of characters to trim var nIn int32 // Number of bytes in input @@ -99315,8 +100449,8 @@ func trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sql Xsqlite3_result_text(tls, context, zIn, nIn, libc.UintptrFromInt32(-1)) } -var lenOne = [1]uint8{uint8(1)} /* sqlite3.c:118383:32 */ -var azOne = [1]uintptr{uintptr(ts + 16003 /* " " */)} /* sqlite3.c:118384:26 */ +var lenOne = [1]uint8{uint8(1)} /* sqlite3.c:119680:32 */ +var azOne = [1]uintptr{uintptr(ts + 12479 /* " " */)} /* sqlite3.c:119681:26 */ // IMP: R-25361-16150 This function is omitted from SQLite by default. It // is only available if the SQLITE_SOUNDEX compile-time option is used @@ -99325,7 +100459,7 @@ var azOne = [1]uintptr{uintptr(ts + 16003 /* " " */)} /* sqlite3.c:118384:26 */ // // IMP: R-59782-00072 The soundex(X) function returns a string that is the // soundex encoding of the string X. -func soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118473:13: */ +func soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119770:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -99363,7 +100497,7 @@ func soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* } else { // IMP: R-64894-50321 The string "?000" is returned if the argument // is NULL or contains no ASCII alphabetic characters. - Xsqlite3_result_text(tls, context, ts+16005 /* "?000" */, 4, uintptr(0)) + Xsqlite3_result_text(tls, context, ts+16467 /* "?000" */, 4, uintptr(0)) } } @@ -99376,10 +100510,10 @@ var iCode = [128]uint8{ uint8(1), uint8(2), uint8(6), uint8(2), uint8(3), uint8(0), uint8(1), uint8(0), uint8(2), uint8(0), uint8(2), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(1), uint8(2), uint8(3), uint8(0), uint8(1), uint8(2), uint8(0), uint8(0), uint8(2), uint8(2), uint8(4), uint8(5), uint8(5), uint8(0), uint8(1), uint8(2), uint8(6), uint8(2), uint8(3), uint8(0), uint8(1), uint8(0), uint8(2), uint8(0), uint8(2), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), -} /* sqlite3.c:118481:30 */ +} /* sqlite3.c:119778:30 */ // A function that loads a shared-library extension then returns NULL. -func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118526:13: */ +func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119823:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -99390,8 +100524,8 @@ func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli // Disallow the load_extension() SQL function unless the SQLITE_LoadExtFunc // flag is set. See the sqlite3_enable_load_extension() API. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, ts+13234 /* "not authorized" */, -1) + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LoadExtFunc)) == uint64(0) { + Xsqlite3_result_error(tls, context, ts+13647 /* "not authorized" */, -1) return } @@ -99415,11 +100549,11 @@ type SumCtx1 = struct { Foverflow U8 Fapprox U8 _ [6]byte -} /* sqlite3.c:118557:9 */ +} /* sqlite3.c:119854:9 */ // An instance of the following structure holds the context of a // sum() or avg() aggregate computation. -type SumCtx = SumCtx1 /* sqlite3.c:118557:23 */ +type SumCtx = SumCtx1 /* sqlite3.c:119854:23 */ // Routines used to compute the sum, average, and total. // @@ -99429,7 +100563,7 @@ type SumCtx = SumCtx1 /* sqlite3.c:118557:23 */ // 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 *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118576:13: */ +func sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119873:13: */ var p uintptr var type1 int32 @@ -99451,7 +100585,7 @@ func sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqli } } -func sumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118598:13: */ +func sumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119895:13: */ var p uintptr var type1 int32 @@ -99474,12 +100608,12 @@ func sumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* s } } -func sumFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118623:13: */ +func sumFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:119920:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, context, 0) if (p != 0) && ((*SumCtx)(unsafe.Pointer(p)).Fcnt > int64(0)) { if (*SumCtx)(unsafe.Pointer(p)).Foverflow != 0 { - Xsqlite3_result_error(tls, context, ts+15896 /* "integer overflow" */, -1) + Xsqlite3_result_error(tls, context, ts+16360 /* "integer overflow" */, -1) } else if (*SumCtx)(unsafe.Pointer(p)).Fapprox != 0 { Xsqlite3_result_double(tls, context, (*SumCtx)(unsafe.Pointer(p)).FrSum) } else { @@ -99488,7 +100622,7 @@ func sumFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118623:13: */ } } -func avgFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118636:13: */ +func avgFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:119933:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, context, 0) if (p != 0) && ((*SumCtx)(unsafe.Pointer(p)).Fcnt > int64(0)) { @@ -99496,7 +100630,7 @@ func avgFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118636:13: */ } } -func totalFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118643:13: */ +func totalFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:119940:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, context, 0) // (double)0 In case of SQLITE_OMIT_FLOATING_POINT... @@ -99510,14 +100644,14 @@ func totalFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118643:13: */ // The following structure keeps track of state information for the // count() aggregate function. -type CountCtx1 = struct{ Fn I64 } /* sqlite3.c:118654:9 */ +type CountCtx1 = struct{ Fn I64 } /* sqlite3.c:119951:9 */ // The following structure keeps track of state information for the // count() aggregate function. -type CountCtx = CountCtx1 /* sqlite3.c:118654:25 */ +type CountCtx = CountCtx1 /* sqlite3.c:119951:25 */ // Routines to implement the count() aggregate function. -func countStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118665:13: */ +func countStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:119962:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(CountCtx{}))) if ((argc == 0) || (SQLITE_NULL != Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))))) && (p != 0) { @@ -99531,7 +100665,7 @@ func countStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sq } -func countFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118681:13: */ +func countFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:119978:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, context, 0) Xsqlite3_result_int64(tls, context, func() int64 { @@ -99542,7 +100676,7 @@ func countFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118681:13: */ }()) } -func countInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:118687:13: */ +func countInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:119984:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(CountCtx{}))) // p is always non-NULL since countStep() will have been called first @@ -99552,7 +100686,7 @@ func countInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sql } // Routines to implement min() and max() aggregate functions. -func minmaxStep(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:118705:13: */ +func minmaxStep(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:120002:13: */ var pArg uintptr = *(*uintptr)(unsafe.Pointer(argv)) var pBest uintptr _ = NotUsed @@ -99590,7 +100724,7 @@ func minmaxStep(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { / } } -func minMaxValueFinalize(tls *libc.TLS, context uintptr, bValue int32) { /* sqlite3.c:118743:13: */ +func minMaxValueFinalize(tls *libc.TLS, context uintptr, bValue int32) { /* sqlite3.c:120040:13: */ var pRes uintptr pRes = Xsqlite3_aggregate_context(tls, context, 0) if pRes != 0 { @@ -99603,16 +100737,16 @@ func minMaxValueFinalize(tls *libc.TLS, context uintptr, bValue int32) { /* sqli } } -func minMaxValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:118754:13: */ +func minMaxValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:120051:13: */ minMaxValueFinalize(tls, context, 1) } -func minMaxFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118760:13: */ +func minMaxFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:120057:13: */ minMaxValueFinalize(tls, context, 0) } // group_concat(EXPR, ?SEPARATOR?) -func groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118767:13: */ +func groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120064:13: */ var zVal uintptr var pAccum uintptr var zSep uintptr @@ -99627,13 +100761,13 @@ func groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if pAccum != 0 { var db uintptr = Xsqlite3_context_db_handle(tls, context) var firstTerm int32 = (libc.Bool32((*StrAccum)(unsafe.Pointer(pAccum)).FmxAlloc == U32(0))) - (*StrAccum)(unsafe.Pointer(pAccum)).FmxAlloc = U32(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */)))) + (*StrAccum)(unsafe.Pointer(pAccum)).FmxAlloc = U32(*(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */)))) if !(firstTerm != 0) { if argc == 2 { zSep = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) nSep = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) } else { - zSep = ts + 13915 /* "," */ + zSep = ts + 14379 /* "," */ nSep = 1 } if zSep != 0 { @@ -99648,7 +100782,7 @@ func groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } -func groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118800:13: */ +func groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120097:13: */ var n int32 var pAccum uintptr @@ -99677,7 +100811,7 @@ func groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr } } -func groupConcatFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118831:13: */ +func groupConcatFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:120128:13: */ var pAccum uintptr pAccum = Xsqlite3_aggregate_context(tls, context, 0) if pAccum != 0 { @@ -99692,7 +100826,7 @@ func groupConcatFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118831:1 } } -func groupConcatValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:118846:13: */ +func groupConcatValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:120143:13: */ var pAccum uintptr pAccum = Xsqlite3_aggregate_context(tls, context, 0) if pAccum != 0 { @@ -99710,8 +100844,8 @@ func groupConcatValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:118846: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 Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { /* sqlite3.c:118869:21: */ - var rc int32 = Xsqlite3_overload_function(tls, db, ts+16010 /* "MATCH" */, 2) +func Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { /* sqlite3.c:120166:21: */ + var rc int32 = Xsqlite3_overload_function(tls, db, ts+16472 /* "MATCH" */, 2) if rc == SQLITE_NOMEM { Xsqlite3OomFault(tls, db) @@ -99721,7 +100855,7 @@ func Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { // Re-register the built-in LIKE functions. The caseSensitive // parameter determines whether or not the LIKE operator is case // sensitive. -func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int32) { /* sqlite3.c:118882:21: */ +func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int32) { /* sqlite3.c:120179:21: */ var pInfo uintptr var flags int32 if caseSensitive != 0 { @@ -99731,14 +100865,14 @@ func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 pInfo = uintptr(unsafe.Pointer(&likeInfoNorm)) flags = SQLITE_FUNC_LIKE } - Xsqlite3CreateFunc(tls, db, ts+16016 /* "like" */, 2, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct { + Xsqlite3CreateFunc(tls, db, ts+16478 /* "like" */, 2, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{likeFunc})), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3CreateFunc(tls, db, ts+16016 /* "like" */, 3, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct { + Xsqlite3CreateFunc(tls, db, ts+16478 /* "like" */, 3, SQLITE_UTF8, pInfo, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{likeFunc})), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+16016 /* "like" */, 2, SQLITE_UTF8, uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) - *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+16016 /* "like" */, 3, SQLITE_UTF8, uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) + *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+16478 /* "like" */, 2, uint8(SQLITE_UTF8), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) + *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+16478 /* "like" */, 3, uint8(SQLITE_UTF8), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags)) } // pExpr points to an expression which implements a function. If @@ -99756,16 +100890,17 @@ func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 // 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 Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase uintptr, aWc uintptr) int32 { /* sqlite3.c:118915:20: */ +func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase uintptr, aWc uintptr) int32 { /* sqlite3.c:120212:20: */ var pDef uintptr var nExpr int32 - if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_FUNCTION) || !(int32(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0) { + + if !(int32(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0) { return 0 } nExpr = (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FnExpr - pDef = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), nExpr, SQLITE_UTF8, uint8(0)) - if (pDef == uintptr(0)) || (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_LIKE) == U32(0)) { + pDef = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), nExpr, uint8(SQLITE_UTF8), uint8(0)) + if (pDef == uintptr(0)) || (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_LIKE)) == U32(0)) { return 0 } @@ -99795,16 +100930,44 @@ func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase *(*int8)(unsafe.Pointer(aWc + 3)) = *(*int8)(unsafe.Pointer(zEscape)) } - *(*int32)(unsafe.Pointer(pIsNocase)) = (libc.Bool32(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & SQLITE_FUNC_CASE) == U32(0))) + *(*int32)(unsafe.Pointer(pIsNocase)) = (libc.Bool32(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(SQLITE_FUNC_CASE)) == U32(0))) return 1 } +// Mathematical Constants + +// Extra math functions that require linking with -lm + +// Implementation of sign(X) function. +func signFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:120438:13: */ + var type0 int32 + var x float64 + _ = argc + + type0 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv))) + if (type0 != SQLITE_INTEGER) && (type0 != SQLITE_FLOAT) { + return + } + x = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv))) + Xsqlite3_result_int(tls, context, func() int32 { + if x < 0.0 { + return -1 + } + return func() int32 { + if x > 0.0 { + return +1 + } + return 0 + }() + }()) +} + // 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 Xsqlite3RegisterBuiltinFunctions(tls *libc.TLS) { /* sqlite3.c:118964:21: */ +func Xsqlite3RegisterBuiltinFunctions(tls *libc.TLS) { /* sqlite3.c:120460:21: */ Xsqlite3AlterFunctions(tls) Xsqlite3WindowFunctions(tls) Xsqlite3RegisterDateTimeFunctions(tls) @@ -99812,75 +100975,78 @@ func Xsqlite3RegisterBuiltinFunctions(tls *libc.TLS) { /* sqlite3.c:118964:21: * } -var aBuiltinFunc = [65]FuncDef{ +var aBuiltinFunc = [68]FuncDef{ //**** Functions only available with SQLITE_TESTCTRL_INTERNAL_FUNCTIONS **** - {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_implies_nonnull_row), FxSFunc: 0, FzName: ts + 16021 /* "implies_nonnull_..." */}, - {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_expr_compare), FxSFunc: 0, FzName: ts + 16041 /* "expr_compare" */}, - {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_expr_implies_expr), FxSFunc: 0, FzName: ts + 16054 /* "expr_implies_exp..." */}, + {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_implies_nonnull_row)), FxSFunc: 0, FzName: ts + 16483 /* "implies_nonnull_..." */}, + {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_expr_compare)), FxSFunc: 0, FzName: ts + 16503 /* "expr_compare" */}, + {FnArg: int8(2), FfuncFlags: (U32(((((SQLITE_UTF8 | SQLITE_FUNC_INTERNAL) | SQLITE_FUNC_TEST) | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_expr_implies_expr)), FxSFunc: 0, FzName: ts + 16516 /* "expr_implies_exp..." */}, //**** Regular functions **** - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16072 /* "soundex" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 16080 /* "load_extension" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 16080 /* "load_extension" */}, - {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 16095 /* "sqlite_compileop..." */}, - {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 16121 /* "sqlite_compileop..." */}, - {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 16146 /* "unlikely" */}, - {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 16155 /* "likelihood" */}, - {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(INLINEFUNC_unlikely), FxSFunc: 0, FzName: ts + 16166 /* "likely" */}, - {FnArg: int8(1), FfuncFlags: (U32((((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_OFFSET) | SQLITE_FUNC_TYPEOF)), FxSFunc: 0, FzName: ts + 16173 /* "sqlite_offset" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 16187 /* "ltrim" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 16187 /* "ltrim" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(2)), FxSFunc: 0, FzName: ts + 16193 /* "rtrim" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(2)), FxSFunc: 0, FzName: ts + 16193 /* "rtrim" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(3)), FxSFunc: 0, FzName: ts + 16199 /* "trim" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(3)), FxSFunc: 0, FzName: ts + 16199 /* "trim" */}, - {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16204 /* "min" */}, - {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 16204 /* "min" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (1 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_MINMAX)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 16204 /* "min" */}, - {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 16208 /* "max" */}, - {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FzName: ts + 16208 /* "max" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (1 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_MINMAX)), FpUserData: uintptr(int64(1)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 16208 /* "max" */}, - {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_TYPEOF)), FxSFunc: 0, FzName: ts + 16212 /* "typeof" */}, - {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_LENGTH)), FxSFunc: 0, FzName: ts + 16219 /* "length" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16226 /* "instr" */}, - {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16232 /* "printf" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16239 /* "unicode" */}, - {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16247 /* "char" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16252 /* "abs" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16256 /* "round" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16256 /* "round" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16262 /* "upper" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16268 /* "lower" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16274 /* "hex" */}, - {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FxSFunc: 0, FzName: ts + 16278 /* "ifnull" */}, - {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16285 /* "random" */}, - {FnArg: int8(1), FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16292 /* "randomblob" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16303 /* "nullif" */}, - {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 16310 /* "sqlite_version" */}, - {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 16325 /* "sqlite_source_id" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16342 /* "sqlite_log" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16353 /* "quote" */}, - {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16359 /* "last_insert_rowi..." */}, - {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16377 /* "changes" */}, - {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16385 /* "total_changes" */}, - {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16399 /* "replace" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16407 /* "zeroblob" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16416 /* "substr" */}, - {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16416 /* "substr" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16423 /* "sum" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16427 /* "total" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16433 /* "avg" */}, - {FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_COUNT)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16437 /* "count" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16437 /* "count" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16443 /* "group_concat" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16443 /* "group_concat" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16534 /* "soundex" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 16542 /* "load_extension" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_DIRECTONLY) | SQLITE_FUNC_UNSAFE)), FxSFunc: 0, FzName: ts + 16542 /* "load_extension" */}, + {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 16557 /* "sqlite_compileop..." */}, + {FnArg: int8(1), FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 16583 /* "sqlite_compileop..." */}, + {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 16608 /* "unlikely" */}, + {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 16617 /* "likelihood" */}, + {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (SQLITE_FUNC_UNLIKELY))), FpUserData: uintptr(int64(INLINEFUNC_unlikely)), FxSFunc: 0, FzName: ts + 16628 /* "likely" */}, + {FnArg: int8(1), FfuncFlags: (U32((((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_OFFSET) | SQLITE_FUNC_TYPEOF)), FxSFunc: 0, FzName: ts + 16635 /* "sqlite_offset" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 16649 /* "ltrim" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 16649 /* "ltrim" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(2)), FxSFunc: 0, FzName: ts + 16655 /* "rtrim" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(2)), FxSFunc: 0, FzName: ts + 16655 /* "rtrim" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(3)), FxSFunc: 0, FzName: ts + 16661 /* "trim" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(3)), FxSFunc: 0, FzName: ts + 16661 /* "trim" */}, + {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16666 /* "min" */}, + {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 16666 /* "min" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (1 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_MINMAX)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 16666 /* "min" */}, + {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FxSFunc: 0, FzName: ts + 16670 /* "max" */}, + {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FpUserData: uintptr(int64(1)), FzName: ts + 16670 /* "max" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (1 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_MINMAX)), FpUserData: uintptr(int64(1)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FzName: ts + 16670 /* "max" */}, + {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_TYPEOF)), FxSFunc: 0, FzName: ts + 16674 /* "typeof" */}, + {FnArg: int8(1), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_LENGTH)), FxSFunc: 0, FzName: ts + 16681 /* "length" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16688 /* "instr" */}, + {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16694 /* "printf" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16701 /* "unicode" */}, + {FnArg: int8(-1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16709 /* "char" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16714 /* "abs" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16718 /* "round" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16718 /* "round" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16724 /* "upper" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16730 /* "lower" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16736 /* "hex" */}, + {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FxSFunc: 0, FzName: ts + 16740 /* "ifnull" */}, + {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16747 /* "random" */}, + {FnArg: int8(1), FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16754 /* "randomblob" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (1 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16765 /* "nullif" */}, + {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 16772 /* "sqlite_version" */}, + {FfuncFlags: (U32(SQLITE_FUNC_SLOCHNG | SQLITE_UTF8)), FxSFunc: 0, FzName: ts + 16787 /* "sqlite_source_id" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16804 /* "sqlite_log" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16815 /* "quote" */}, + {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16821 /* "last_insert_rowi..." */}, + {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16839 /* "changes" */}, + {FfuncFlags: (U32(SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16847 /* "total_changes" */}, + {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16861 /* "replace" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16869 /* "zeroblob" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16878 /* "substr" */}, + {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16878 /* "substr" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16885 /* "substring" */}, + {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16885 /* "substring" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16895 /* "sum" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16899 /* "total" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16905 /* "avg" */}, + {FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | SQLITE_FUNC_COUNT)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16909 /* "count" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16909 /* "count" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16915 /* "group_concat" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | (0 * SQLITE_FUNC_NEEDCOLL)) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16915 /* "group_concat" */}, - {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE) | SQLITE_FUNC_CASE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 16456 /* "glob" */}, - {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 16016 /* "like" */}, - {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 16016 /* "like" */}, - {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 16461 /* "coalesce" */}, - {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 16461 /* "coalesce" */}, - {FnArg: int8(-1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FxSFunc: 0, FzName: ts + 16461 /* "coalesce" */}, - {FnArg: int8(3), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(INLINEFUNC_iif), FxSFunc: 0, FzName: ts + 16470 /* "iif" */}} /* sqlite3.c:118975:18 */ + {FnArg: int8(2), FfuncFlags: (U32(((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE) | SQLITE_FUNC_CASE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 16928 /* "glob" */}, + {FnArg: int8(2), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 16478 /* "like" */}, + {FnArg: int8(3), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | SQLITE_FUNC_LIKE)), FpUserData: 0, FxSFunc: 0, FzName: ts + 16478 /* "like" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 16933 /* "coalesce" */}, + {FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FzName: ts + 16933 /* "coalesce" */}, + {FnArg: int8(1), FfuncFlags: (U32((SQLITE_FUNC_CONSTANT | SQLITE_UTF8) | (0 * SQLITE_FUNC_NEEDCOLL))), FxSFunc: 0, FzName: ts + 16942 /* "sign" */}, + {FnArg: int8(-1), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FxSFunc: 0, FzName: ts + 16933 /* "coalesce" */}, + {FnArg: int8(3), FfuncFlags: (U32(((SQLITE_UTF8 | SQLITE_FUNC_INLINE) | SQLITE_FUNC_CONSTANT) | (0))), FpUserData: uintptr(int64(INLINEFUNC_iif)), FxSFunc: 0, FzName: ts + 16947 /* "iif" */}} /* sqlite3.c:120471:18 */ //************* End of func.c *********************************************** //************* Begin file fkey.c ******************************************* @@ -100055,7 +101221,7 @@ var aBuiltinFunc = [65]FuncDef{ // 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 Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey uintptr, ppIdx uintptr, paiCol uintptr) int32 { /* sqlite3.c:119284:20: */ +func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey uintptr, ppIdx uintptr, paiCol uintptr) int32 { /* sqlite3.c:120819:20: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -100166,7 +101332,7 @@ func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey if !(pIdx != 0) { if !(int32((*Parse)(unsafe.Pointer(pParse)).FdisableTriggers) != 0) { Xsqlite3ErrorMsg(tls, pParse, - ts+16474, /* "foreign key mism..." */ + ts+16951, /* "foreign key mism..." */ libc.VaList(bp, (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*FKey)(unsafe.Pointer(pFKey)).FzTo)) } Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, aiCol) @@ -100201,7 +101367,7 @@ func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey // // These operations are identified in the comment at the top of this file // (fkey.c) as "I.1" and "D.1". -func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32, isIgnore int32) { /* sqlite3.c:119419:13: */ +func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32, isIgnore int32) { /* sqlite3.c:120954:13: */ var i int32 // Iterator variable var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Vdbe to add code to var iCur int32 = ((*Parse)(unsafe.Pointer(pParse)).FnTab - 1) // Cursor number to use @@ -100245,7 +101411,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx // increment the constraint-counter. if (pTab == (*FKey)(unsafe.Pointer(pFKey)).FpFrom) && (nIncr == 1) { Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regData, iOk, regTemp) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } Xsqlite3OpenTable(tls, pParse, iCur, iDb, pTab, OP_OpenRead) @@ -100290,7 +101456,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx iParent = regData } Xsqlite3VdbeAddOp3(tls, v, OP_Ne, iChild, iJump, iParent) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_JUMPIFNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_JUMPIFNULL)) } Xsqlite3VdbeGoto(tls, v, iOk) } @@ -100304,7 +101470,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx } } - if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_DeferFKs) != 0)) && + if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_DeferFKs)) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite) != 0) { // Special case: If this is an INSERT statement that will insert exactly @@ -100313,7 +101479,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx // generated for will not open a statement transaction. Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(3) << 8)), - OE_Abort, uintptr(0), int8(-1), P5_ConstraintFK) + OE_Abort, uintptr(0), int8(-1), uint8(P5_ConstraintFK)) } else { if (nIncr > 0) && (int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) == 0) { Xsqlite3MayAbort(tls, pParse) @@ -100331,7 +101497,7 @@ func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx // 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 *libc.TLS, pParse uintptr, pTab uintptr, regBase int32, iCol I16) uintptr { /* sqlite3.c:119572:13: */ +func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int32, iCol I16) uintptr { /* sqlite3.c:121107:13: */ var pExpr uintptr var pCol uintptr var zColl uintptr @@ -100350,7 +101516,7 @@ func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int3 pExpr = Xsqlite3ExprAddCollateString(tls, pParse, pExpr, zColl) } else { (*Expr)(unsafe.Pointer(pExpr)).FiTable = regBase - (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = SQLITE_AFF_INTEGER + (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(SQLITE_AFF_INTEGER) } } return pExpr @@ -100358,7 +101524,7 @@ func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int3 // Return an Expr object that refers to column iCol of table pTab which // has cursor iCur. -func exprTableColumn(tls *libc.TLS, db uintptr, pTab uintptr, iCursor int32, iCol I16) uintptr { /* sqlite3.c:119604:13: */ +func exprTableColumn(tls *libc.TLS, db uintptr, pTab uintptr, iCursor int32, iCol I16) uintptr { /* sqlite3.c:121139:13: */ var pExpr uintptr = Xsqlite3Expr(tls, db, TK_COLUMN, uintptr(0)) if pExpr != 0 { *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = pTab @@ -100398,7 +101564,7 @@ func exprTableColumn(tls *libc.TLS, db uintptr, pTab uintptr, iCursor int32, iCo // // These operations are identified in the comment at the top of this file // (fkey.c) as "I.2" and "D.2". -func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32) { /* sqlite3.c:119651:13: */ +func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32) { /* sqlite3.c:121186:13: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -100465,9 +101631,9 @@ func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, p var pNe uintptr // Expression (pLeft != pRight) var pLeft uintptr // Value from parent table row var pRight uintptr // Column ref to child table - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pLeft = exprTableRegister(tls, pParse, pTab, regData, int16(-1)) - pRight = exprTableColumn(tls, db, pTab, (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor, int16(-1)) + pRight = exprTableColumn(tls, db, pTab, (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor, int16(-1)) pNe = Xsqlite3PExpr(tls, pParse, TK_NE, pLeft, pRight) } else { var pEq uintptr @@ -100522,7 +101688,7 @@ func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, p // "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 Xsqlite3FkReferences(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:119780:21: */ +func Xsqlite3FkReferences(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:121315:21: */ return Xsqlite3HashFind(tls, ((*Table)(unsafe.Pointer(pTab)).FpSchema + 80 /* &.fkeyHash */), (*Table)(unsafe.Pointer(pTab)).FzName) } @@ -100532,7 +101698,7 @@ func Xsqlite3FkReferences(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:11 // // The Trigger structure or any of its sub-components may be allocated from // the lookaside buffer belonging to database handle dbMem. -func fkTriggerDelete(tls *libc.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:119792:13: */ +func fkTriggerDelete(tls *libc.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:121327:13: */ if p != 0 { var pStep uintptr = (*Trigger)(unsafe.Pointer(p)).Fstep_list Xsqlite3ExprDelete(tls, dbMem, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere) @@ -100558,9 +101724,9 @@ func fkTriggerDelete(tls *libc.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:119 // 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 Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uintptr) { /* sqlite3.c:119820:21: */ +func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uintptr) { /* sqlite3.c:121355:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { + if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { var iSkip int32 = 0 var v uintptr = Xsqlite3GetVdbe(tls, pParse) @@ -100574,7 +101740,7 @@ func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint // when this statement is run. var p uintptr for p = (*Table)(unsafe.Pointer(pTab)).FpFKey; p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom { - if ((*FKey)(unsafe.Pointer(p)).FisDeferred != 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0) { + if ((*FKey)(unsafe.Pointer(p)).FisDeferred != 0) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) { break } } @@ -100597,12 +101763,12 @@ func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint // If the SQLITE_DeferFKs flag is set, then this is not required, as // the statement transaction will not be rolled back even if FK // constraints are violated. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) == uint64(0) { Xsqlite3VdbeAddOp2(tls, v, OP_FkIfZero, 0, (Xsqlite3VdbeCurrentAddr(tls, v) + 2)) Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(3) << 8)), - OE_Abort, uintptr(0), int8(-1), P5_ConstraintFK) + OE_Abort, uintptr(0), int8(-1), uint8(P5_ConstraintFK)) } if iSkip != 0 { @@ -100621,7 +101787,7 @@ func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uint // // 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 *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:119883:12: */ +func fkChildIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:121418:12: */ var i int32 for i = 0; i < (*FKey)(unsafe.Pointer(p)).FnCol; i++ { var iChildKey int32 = (*sColMap)(unsafe.Pointer((p + 64 /* &.aCol */) + uintptr(i)*16)).FiFrom @@ -100645,7 +101811,7 @@ func fkChildIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, // // 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 *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:119910:12: */ +func fkParentIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:121445:12: */ var i int32 for i = 0; i < (*FKey)(unsafe.Pointer(p)).FnCol; i++ { var zKey uintptr = (*sColMap)(unsafe.Pointer((p + 64 /* &.aCol */) + uintptr(i)*16)).FzCol @@ -100669,7 +101835,7 @@ func fkParentIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, // 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 *libc.TLS, pParse uintptr, pFKey uintptr) int32 { /* sqlite3.c:119939:12: */ +func isSetNullAction(tls *libc.TLS, pParse uintptr, pFKey uintptr) int32 { /* sqlite3.c:121474:12: */ var pTop uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -100704,7 +101870,7 @@ func isSetNullAction(tls *libc.TLS, pParse uintptr, pFKey uintptr) int32 { /* sq // 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 Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, regNew int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:119972:21: */ +func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, regNew int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:121507:21: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -100717,7 +101883,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, // Exactly one of regOld and regNew should be non-zero. // If foreign-keys are disabled, this function is a no-op. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) == uint64(0) { return } @@ -100842,7 +102008,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, continue } - if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0)) && + if ((!(int32((*FKey)(unsafe.Pointer(pFKey)).FisDeferred) != 0) && !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FpToplevel) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite) != 0) { // Inserting a single row into a parent table cannot cause (or fix) @@ -100862,10 +102028,10 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, pSrc = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) if pSrc != 0 { var pItem uintptr = pSrc + 8 /* &.a */ - (*SrcList_item)(unsafe.Pointer(pItem)).FpTab = (*FKey)(unsafe.Pointer(pFKey)).FpFrom - (*SrcList_item)(unsafe.Pointer(pItem)).FzName = (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName - (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpTab)).FnTabRef++ - (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + (*SrcItem)(unsafe.Pointer(pItem)).FpTab = (*FKey)(unsafe.Pointer(pFKey)).FpFrom + (*SrcItem)(unsafe.Pointer(pItem)).FzName = (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName + (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FnTabRef++ + (*SrcItem)(unsafe.Pointer(pItem)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) if regNew != 0 { fkScanChildren(tls, pParse, pSrc, pTab, *(*uintptr)(unsafe.Pointer(bp + 24 /* pIdx */)), pFKey, *(*uintptr)(unsafe.Pointer(bp + 32 /* aiCol */)), regNew, -1) @@ -100894,7 +102060,7 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, Xsqlite3MayAbort(tls, pParse) } } - (*SrcList_item)(unsafe.Pointer(pItem)).FzName = uintptr(0) + (*SrcItem)(unsafe.Pointer(pItem)).FzName = uintptr(0) Xsqlite3SrcListDelete(tls, db, pSrc) } Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 32 /* aiCol */))) @@ -100903,12 +102069,12 @@ func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, // This function is called before generating code to update or delete a // row contained in table pTab. -func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sqlite3.c:120174:20: */ +func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sqlite3.c:121709:20: */ bp := tls.Alloc(8) defer tls.Free(8) var mask U32 = U32(0) - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_ForeignKeys) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 { var p uintptr var i int32 for p = (*Table)(unsafe.Pointer(pTab)).FpFKey; p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom { @@ -100955,19 +102121,22 @@ func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sql // // For an UPDATE, this function returns 2 if: // -// * There are any FKs for which pTab is the child and the parent table, or +// * There are any FKs for which pTab is the child and the parent table +// and any FK processing at all is required (even of a different FK), 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 Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uintptr, chngRowid int32) int32 { /* sqlite3.c:120222:20: */ - var eRet int32 = 0 - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_ForeignKeys) != 0 { +func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uintptr, chngRowid int32) int32 { /* sqlite3.c:121759:20: */ + var eRet int32 = 1 // Value to return if bHaveFK is true + var bHaveFK int32 = 0 // If FK processing is required + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 { if !(aChange != 0) { // A DELETE operation. Foreign key processing is required if the // table in question is either the child or parent table for any // foreign key constraint. - eRet = (libc.Bool32((Xsqlite3FkReferences(tls, pTab) != 0) || ((*Table)(unsafe.Pointer(pTab)).FpFKey != 0))) + bHaveFK = (libc.Bool32((Xsqlite3FkReferences(tls, pTab) != 0) || ((*Table)(unsafe.Pointer(pTab)).FpFKey != 0))) } else { // This is an UPDATE. Foreign key processing is only required if the // operation modifies one or more child or parent key columns. @@ -100975,11 +102144,11 @@ func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uin // Check if any child key columns are being modified. for p = (*Table)(unsafe.Pointer(pTab)).FpFKey; p != 0; p = (*FKey)(unsafe.Pointer(p)).FpNextFrom { - if 0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, (*FKey)(unsafe.Pointer(p)).FzTo) { - return 2 - } if fkChildIsModified(tls, pTab, p, aChange, chngRowid) != 0 { - eRet = 1 + if 0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, (*FKey)(unsafe.Pointer(p)).FzTo) { + eRet = 2 + } + bHaveFK = 1 } } @@ -100989,12 +102158,15 @@ func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uin if int32(*(*U8)(unsafe.Pointer((p + 45 /* &.aAction */) + 1))) != OE_None { return 2 } - eRet = 1 + bHaveFK = 1 } } } } - return eRet + if bHaveFK != 0 { + return eRet + } + return 0 } // This function is called when an UPDATE or DELETE operation is being @@ -101024,7 +102196,7 @@ func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uin // 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 *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, pChanges uintptr) uintptr { /* sqlite3.c:120289:16: */ +func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, pChanges uintptr) uintptr { /* sqlite3.c:121827:16: */ bp := tls.Alloc(96) defer tls.Free(96) @@ -101034,7 +102206,7 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, var iAction int32 = (libc.Bool32(pChanges != uintptr(0))) // 1 for UPDATE, 0 for DELETE action = int32(*(*U8)(unsafe.Pointer((pFKey + 45 /* &.aAction */) + uintptr(iAction)))) - if (action == OE_Restrict) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_DeferFKs) != 0) { + if (action == OE_Restrict) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_DeferFKs)) != 0) { return uintptr(0) } pTrigger = *(*uintptr)(unsafe.Pointer((pFKey + 48 /* &.apTrigger */) + uintptr(iAction)*8)) @@ -101056,8 +102228,8 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, } for i = 0; i < (*FKey)(unsafe.Pointer(pFKey)).FnCol; i++ { - *(*Token)(unsafe.Pointer(bp + 48 /* tOld */)) = Token{Fz: ts + 8342 /* "old" */, Fn: uint32(3)} // Literal "old" token - *(*Token)(unsafe.Pointer(bp + 64 /* tNew */)) = Token{Fz: ts + 8338 /* "new" */, Fn: uint32(3)} // Literal "new" token + *(*Token)(unsafe.Pointer(bp + 48 /* tOld */)) = Token{Fz: ts + 8435 /* "old" */, Fn: uint32(3)} // Literal "old" token + *(*Token)(unsafe.Pointer(bp + 64 /* tNew */)) = Token{Fz: ts + 8431 /* "new" */, Fn: uint32(3)} // Literal "new" token // var tFromCol Token at bp+32, 16 // Name of column in child table // var tToCol Token at bp+16, 16 @@ -101145,9 +102317,9 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, (*Token)(unsafe.Pointer(bp + 80 /* &tFrom */)).Fz = zFrom (*Token)(unsafe.Pointer(bp + 80 /* &tFrom */)).Fn = uint32(nFrom) - pRaise = Xsqlite3Expr(tls, db, TK_RAISE, ts+6852 /* "FOREIGN KEY cons..." */) + pRaise = Xsqlite3Expr(tls, db, TK_RAISE, ts+6928 /* "FOREIGN KEY cons..." */) if pRaise != 0 { - (*Expr)(unsafe.Pointer(pRaise)).FaffExpr = OE_Abort + (*Expr)(unsafe.Pointer(pRaise)).FaffExpr = int8(OE_Abort) } pSelect = Xsqlite3SelectNew(tls, pParse, Xsqlite3ExprListAppend(tls, pParse, uintptr(0), pRaise), @@ -101197,17 +102369,17 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, switch action { case OE_Restrict: - (*TriggerStep)(unsafe.Pointer(pStep)).Fop = TK_SELECT + (*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_SELECT) break fallthrough case OE_Cascade: if !(pChanges != 0) { - (*TriggerStep)(unsafe.Pointer(pStep)).Fop = TK_DELETE + (*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_DELETE) break } fallthrough default: - (*TriggerStep)(unsafe.Pointer(pStep)).Fop = TK_UPDATE + (*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(TK_UPDATE) } (*TriggerStep)(unsafe.Pointer(pStep)).FpTrig = pTrigger (*Trigger)(unsafe.Pointer(pTrigger)).FpSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema @@ -101215,9 +102387,9 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, *(*uintptr)(unsafe.Pointer((pFKey + 48 /* &.apTrigger */) + uintptr(iAction)*8)) = pTrigger (*Trigger)(unsafe.Pointer(pTrigger)).Fop = func() uint8 { if pChanges != 0 { - return TK_UPDATE + return uint8(TK_UPDATE) } - return TK_DELETE + return uint8(TK_DELETE) }() } @@ -101226,12 +102398,12 @@ func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, // This function is called when deleting or updating a row to implement // any required CASCADE, SET NULL or SET DEFAULT actions. -func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uintptr, regOld int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:120481:21: */ +func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uintptr, regOld int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:122019:21: */ // If foreign-key support is enabled, iterate through all FKs that // refer to table pTab. If there is an action associated with the FK // for this operation (either update or delete), invoke the associated // trigger sub-program. - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_ForeignKeys) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_ForeignKeys)) != 0 { var pFKey uintptr // Iterator variable for pFKey = Xsqlite3FkReferences(tls, pTab); pFKey != 0; pFKey = (*FKey)(unsafe.Pointer(pFKey)).FpNextTo { if (aChange == uintptr(0)) || (fkParentIsModified(tls, pTab, pFKey, aChange, bChngRowid) != 0) { @@ -101247,7 +102419,7 @@ func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uin // Free all memory associated with foreign key definitions attached to // table pTab. Remove the deleted foreign keys from the Schema.fkeyHash // hash table. -func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:120513:21: */ +func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:122051:21: */ var pFKey uintptr // Iterator variable var pNext uintptr // Copy of pFKey->pNextFrom @@ -101307,13 +102479,13 @@ func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:12 // // If pTab is a WITHOUT ROWID table, then it is the PRIMARY KEY index // for that table that is actually opened. -func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTab uintptr, opcode int32) { /* sqlite3.c:120579:21: */ +func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTab uintptr, opcode int32) { /* sqlite3.c:122117:21: */ bp := tls.Alloc(16) defer tls.Free(16) var v uintptr - v = Xsqlite3GetVdbe(tls, pParse) + v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, func() uint8 { @@ -101322,7 +102494,7 @@ func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTa } return uint8(0) }(), (*Table)(unsafe.Pointer(pTab)).FzName) - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp4Int(tls, v, opcode, iCur, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol)) Xsqlite3VdbeComment(tls, v, ts+824 /* "%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) } else { @@ -101352,7 +102524,7 @@ func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTa // 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 Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr { /* sqlite3.c:120625:27: */ +func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr { /* sqlite3.c:122164:27: */ if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) { // The first time a column affinity string for a particular index is // required, it is allocated and populated here. It is then stored as @@ -101374,16 +102546,16 @@ func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr { if int32(x) >= 0 { aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(x)*32)).Faffinity } else if int32(x) == (-1) { - aff = SQLITE_AFF_INTEGER + aff = int8(SQLITE_AFF_INTEGER) } else { aff = Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8 /* &.a */)+uintptr(n)*32)).FpExpr) } if int32(aff) < SQLITE_AFF_BLOB { - aff = SQLITE_AFF_BLOB + aff = int8(SQLITE_AFF_BLOB) } if int32(aff) > SQLITE_AFF_NUMERIC { - aff = SQLITE_AFF_NUMERIC + aff = int8(SQLITE_AFF_NUMERIC) } *(*int8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FzColAff + uintptr(n))) = aff } @@ -101411,7 +102583,7 @@ func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr { // 'C' NUMERIC // 'D' INTEGER // 'E' REAL -func Xsqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) { /* sqlite3.c:120684:21: */ +func Xsqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) { /* sqlite3.c:122223:21: */ var i int32 var j int32 var zColAff uintptr = (*Table)(unsafe.Pointer(pTab)).FzColAff @@ -101449,7 +102621,7 @@ func Xsqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) { // 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 *libc.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:120723:12: */ +func readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:122262:12: */ var v uintptr = Xsqlite3GetVdbe(tls, p) var i int32 var iEnd int32 = Xsqlite3VdbeCurrentAddr(tls, v) @@ -101485,7 +102657,7 @@ func readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sq // This walker callback will compute the union of colFlags flags for all // referenced columns in a CHECK constraint or generated column expression. -func exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:120760:12: */ +func exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:122299:12: */ if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && (int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0) { *(*U16)(unsafe.Pointer(pWalker + 36 /* &.eCode */)) |= U16((int32((*Column)(unsafe.Pointer((*Table1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FaCol + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*32)).FcolFlags))) @@ -101498,7 +102670,7 @@ func exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { // or VIRTUAL columns have not yet been initialized. This routine goes // back and computes the values for those columns based on the previously // computed normal columns. -func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore int32, pTab uintptr) { /* sqlite3.c:120776:21: */ +func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore int32, pTab uintptr) { /* sqlite3.c:122315:21: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -101512,7 +102684,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in // Before computing generated columns, first go through and make sure // that appropriate affinity has been applied to the regular columns Xsqlite3TableAffinity(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iRegStore) - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasStored) != U32(0)) && + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasStored)) != U32(0)) && (int32((*VdbeOp)(unsafe.Pointer((libc.AssignUintptr(&pOp, Xsqlite3VdbeGetOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, -1))))).Fopcode) == OP_Affinity) { // Change the OP_Affinity argument to '@' (NONE) for all stored // columns. '@' is the no-op affinity and those columns have not @@ -101526,7 +102698,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in continue } if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(ii)*32)).FcolFlags) & COLFLAG_STORED) != 0 { - *(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) = SQLITE_AFF_NONE + *(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) = int8(SQLITE_AFF_NONE) } jj++ } @@ -101578,7 +102750,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+9958 /* "generated column..." */, libc.VaList(bp, (*Column)(unsafe.Pointer(pRedo)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+10051 /* "generated column..." */, libc.VaList(bp, (*Column)(unsafe.Pointer(pRedo)).FzName)) } (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -101604,11 +102776,11 @@ func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in // // The 2nd register is the one that is returned. That is all the // insert routine needs to know about. -func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:120894:12: */ +func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:122433:12: */ var memId int32 = 0 // Register holding maximum rowid - if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Autoincrement) != U32(0)) && - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & DBFLAG_Vacuum) == U32(0)) { + if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != U32(0)) && + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0)) { var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -101622,7 +102794,7 @@ func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 // rowid table with exactly two columns. // Ticket d8dc2b3a58cd5dc2918a1d4acb 2018-05-23 if (((pSeqTab == uintptr(0)) || - !(((*Table)(unsafe.Pointer((pSeqTab))).FtabFlags & TF_WithoutRowid) == U32(0))) || + !(((*Table)(unsafe.Pointer((pSeqTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) || ((*Table)(unsafe.Pointer(pSeqTab)).FnModuleArg != 0)) || (int32((*Table)(unsafe.Pointer(pSeqTab)).FnCol) != 2) { (*Parse)(unsafe.Pointer(pParse)).FnErr++ @@ -101636,7 +102808,11 @@ func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 } if pInfo == uintptr(0) { pInfo = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(AutoincInfo{}))) - if pInfo == uintptr(0) { + Xsqlite3ParserAddCleanup(tls, pToplevel, *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{Xsqlite3DbFree})), pInfo) + + if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return 0 } (*AutoincInfo)(unsafe.Pointer(pInfo)).FpNext = (*Parse)(unsafe.Pointer(pToplevel)).FpAinc @@ -101654,7 +102830,7 @@ func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 // This routine generates code that will initialize all of the // register used by the autoincrement tracker. -func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:120943:21: */ +func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:122484:21: */ var p uintptr // Information about an AUTOINCREMENT var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // The database connection var pDb uintptr // Database only autoinc table @@ -101681,7 +102857,7 @@ func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:12 (*VdbeOp)(unsafe.Pointer(aOp + 2*32)).Fp3 = memId (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp1 = (memId - 1) (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp3 = memId - (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp5 = SQLITE_JUMPIFNULL + (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp5 = U16(SQLITE_JUMPIFNULL) (*VdbeOp)(unsafe.Pointer(aOp + 4*32)).Fp2 = (memId + 1) (*VdbeOp)(unsafe.Pointer(aOp + 5*32)).Fp3 = memId (*VdbeOp)(unsafe.Pointer(aOp + 6*32)).Fp1 = memId @@ -101694,21 +102870,21 @@ func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:12 } } -var iLn1 int32 = 0 /* sqlite3.c:120957:22 */ +var iLn1 int32 = 0 /* sqlite3.c:122498:22 */ var autoInc = [12]VdbeOpList{ - /* 0 */ {Fopcode: OP_Null}, - /* 1 */ {Fopcode: OP_Rewind, Fp2: int8(10)}, - /* 2 */ {Fopcode: OP_Column}, - /* 3 */ {Fopcode: OP_Ne, Fp2: int8(9)}, - /* 4 */ {Fopcode: OP_Rowid}, - /* 5 */ {Fopcode: OP_Column, Fp2: int8(1)}, - /* 6 */ {Fopcode: OP_AddImm}, - /* 7 */ {Fopcode: OP_Copy}, - /* 8 */ {Fopcode: OP_Goto, Fp2: int8(11)}, - /* 9 */ {Fopcode: OP_Next, Fp2: int8(2)}, - /* 10 */ {Fopcode: OP_Integer}, - /* 11 */ {Fopcode: OP_Close}, -} /* sqlite3.c:120958:29 */ + /* 0 */ {Fopcode: U8(OP_Null)}, + /* 1 */ {Fopcode: U8(OP_Rewind), Fp2: int8(10)}, + /* 2 */ {Fopcode: U8(OP_Column)}, + /* 3 */ {Fopcode: U8(OP_Ne), Fp2: int8(9)}, + /* 4 */ {Fopcode: U8(OP_Rowid)}, + /* 5 */ {Fopcode: U8(OP_Column), Fp2: int8(1)}, + /* 6 */ {Fopcode: U8(OP_AddImm)}, + /* 7 */ {Fopcode: U8(OP_Copy)}, + /* 8 */ {Fopcode: U8(OP_Goto), Fp2: int8(11)}, + /* 9 */ {Fopcode: U8(OP_Next), Fp2: int8(2)}, + /* 10 */ {Fopcode: U8(OP_Integer)}, + /* 11 */ {Fopcode: U8(OP_Close)}, +} /* sqlite3.c:122499:29 */ // Update the maximum rowid for an autoincrement calculation. // @@ -101716,7 +102892,7 @@ var autoInc = [12]VdbeOpList{ // 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 *libc.TLS, pParse uintptr, memId int32, regRowid int32) { /* sqlite3.c:121004:13: */ +func autoIncStep(tls *libc.TLS, pParse uintptr, memId int32, regRowid int32) { /* sqlite3.c:122545:13: */ if memId > 0 { Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, OP_MemMax, memId, regRowid) } @@ -101727,7 +102903,7 @@ func autoIncStep(tls *libc.TLS, pParse uintptr, memId int32, regRowid int32) { / // 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 *libc.TLS, pParse uintptr) { /* sqlite3.c:121017:29: */ +func autoIncrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:122558:29: */ var p uintptr var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb @@ -101753,21 +102929,21 @@ func autoIncrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:121017:29: * (*VdbeOp)(unsafe.Pointer(aOp + 2*32)).Fp3 = iRec (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp2 = iRec (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp3 = (memId + 1) - (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp5 = OPFLAG_APPEND + (*VdbeOp)(unsafe.Pointer(aOp + 3*32)).Fp5 = U16(OPFLAG_APPEND) Xsqlite3ReleaseTempReg(tls, pParse, iRec) } } -var iLn2 int32 = 0 /* sqlite3.c:121024:22 */ +var iLn2 int32 = 0 /* sqlite3.c:122565:22 */ var autoIncEnd = [5]VdbeOpList{ - /* 0 */ {Fopcode: OP_NotNull, Fp2: int8(2)}, - /* 1 */ {Fopcode: OP_NewRowid}, - /* 2 */ {Fopcode: OP_MakeRecord, Fp2: int8(2)}, - /* 3 */ {Fopcode: OP_Insert}, - /* 4 */ {Fopcode: OP_Close}, -} /* sqlite3.c:121025:29 */ + /* 0 */ {Fopcode: U8(OP_NotNull), Fp2: int8(2)}, + /* 1 */ {Fopcode: U8(OP_NewRowid)}, + /* 2 */ {Fopcode: U8(OP_MakeRecord), Fp2: int8(2)}, + /* 3 */ {Fopcode: U8(OP_Insert)}, + /* 4 */ {Fopcode: U8(OP_Close)}, +} /* sqlite3.c:122566:29 */ -func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:121054:21: */ +func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:122595:21: */ if (*Parse)(unsafe.Pointer(pParse)).FpAinc != 0 { autoIncrementEnd(tls, pParse) } @@ -101868,7 +103044,7 @@ func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:1210 // transfer values form intermediate table into
    // end loop // D: cleanup -func Xsqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { /* sqlite3.c:121173:21: */ +func Xsqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { /* sqlite3.c:122714:21: */ bp := tls.Alloc(204) defer tls.Free(204) @@ -101934,6 +103110,7 @@ func Xsqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin // var sNC NameContext at bp+136, 56 var nIdx int32 + var pNx uintptr var k int32 var colFlags U32 var addr1 int32 @@ -101971,7 +103148,7 @@ __1: // If the Select object is really just a simple VALUES() list with a // single row (the common case) then keep that one row of values // and discard the other (unused) parts of the pSelect object - if !(((pSelect != 0) && (((*Select)(unsafe.Pointer(pSelect)).FselFlags & SF_Values) != U32(0))) && ((*Select)(unsafe.Pointer(pSelect)).FpPrior == uintptr(0))) { + if !(((pSelect != 0) && (((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_Values)) != U32(0))) && ((*Select)(unsafe.Pointer(pSelect)).FpPrior == uintptr(0))) { goto __2 } pList = (*Select)(unsafe.Pointer(pSelect)).FpEList @@ -101999,7 +103176,7 @@ __3: goto insert_cleanup __4: ; - withoutRowid = libc.BoolUint8(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) + withoutRowid = libc.BoolUint8(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) // Figure out if we have any triggers and if the table being // inserted into is a view @@ -102137,7 +103314,7 @@ __23: goto __24 } Xsqlite3ErrorMsg(tls, pParse, - ts+16519, /* "cannot INSERT in..." */ + ts+16996, /* "cannot INSERT in..." */ libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*32)).FzName)) goto insert_cleanup __24: @@ -102162,7 +103339,7 @@ __20: bIdListInOrder = U8(0) goto __27 __26: - Xsqlite3ErrorMsg(tls, pParse, ts+16560, /* "table %S has no ..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+17037, /* "table %S has no ..." */ libc.VaList(bp+8, pTabList, 0, (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(i)*16)).FzName)) (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) goto insert_cleanup @@ -102276,7 +103453,7 @@ __29: goto __36 } ipkColumn = int32((*Table)(unsafe.Pointer(pTab)).FiPKey) - if !((ipkColumn >= 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != U32(0))) { + if !((ipkColumn >= 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0))) { goto __37 } @@ -102301,131 +103478,149 @@ __40: ; __37: ; -__36: - ; // Make sure the number of columns in the source data matches the number // of columns to be inserted into the table. - i = 0 -__42: - if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __44 + + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & (U32(TF_HasGenerated | TF_HasHidden))) != U32(0)) { + goto __42 } - if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_NOINSERT) != 0) { + i = 0 +__43: + if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { goto __45 } - nHidden++ -__45: - ; - goto __43 -__43: - i++ - goto __42 - goto __44 -__44: - ; - if !(((pColumn == uintptr(0)) && (nColumn != 0)) && (nColumn != (int32((*Table)(unsafe.Pointer(pTab)).FnCol) - nHidden))) { + if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_NOINSERT) != 0) { goto __46 } - Xsqlite3ErrorMsg(tls, pParse, - ts+16592, /* "table %S has %d ..." */ - libc.VaList(bp+32, pTabList, 0, (int32((*Table)(unsafe.Pointer(pTab)).FnCol)-nHidden), nColumn)) - goto insert_cleanup + nHidden++ __46: ; - if !((pColumn != uintptr(0)) && (nColumn != (*IdList)(unsafe.Pointer(pColumn)).FnId)) { + goto __44 +__44: + i++ + goto __43 + goto __45 +__45: + ; +__42: + ; + if !(nColumn != (int32((*Table)(unsafe.Pointer(pTab)).FnCol) - nHidden)) { goto __47 } - Xsqlite3ErrorMsg(tls, pParse, ts+16644 /* "%d values for %d..." */, libc.VaList(bp+64, nColumn, (*IdList)(unsafe.Pointer(pColumn)).FnId)) + Xsqlite3ErrorMsg(tls, pParse, + ts+17069, /* "table %S has %d ..." */ + libc.VaList(bp+32, pTabList, 0, (int32((*Table)(unsafe.Pointer(pTab)).FnCol)-nHidden), nColumn)) goto insert_cleanup __47: ; +__36: + ; + if !((pColumn != uintptr(0)) && (nColumn != (*IdList)(unsafe.Pointer(pColumn)).FnId)) { + goto __48 + } + Xsqlite3ErrorMsg(tls, pParse, ts+17121 /* "%d values for %d..." */, libc.VaList(bp+64, nColumn, (*IdList)(unsafe.Pointer(pColumn)).FnId)) + goto insert_cleanup +__48: + ; // Initialize the count of rows to be inserted - if !(((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) && + if !((((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) && - !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) { - goto __48 + !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) && + !(int32((*Parse)(unsafe.Pointer(pParse)).FbReturning) != 0)) { + goto __49 } regRowCount = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regRowCount) -__48: +__49: ; // If this is not a view, open the table and and all indices if !(!(isView != 0)) { - goto __49 + goto __50 } nIdx = Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, uint8(0), -1, uintptr(0), bp+192 /* &iDataCur */, bp+196 /* &iIdxCur */) aRegIdx = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint64(unsafe.Sizeof(int32(0))) * (uint64(nIdx + 2))))) if !(aRegIdx == uintptr(0)) { - goto __50 + goto __51 } goto insert_cleanup -__50: +__51: ; i = 0 pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex -__51: +__52: if !(i < nIdx) { - goto __53 + goto __54 } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)) - goto __52 -__52: - pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext - i++ - goto __51 goto __53 __53: + pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext + i++ + goto __52 + goto __54 +__54: ; *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Register to store the table record -__49: +__50: ; if !(pUpsert != 0) { - goto __54 - } - if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { goto __55 } - Xsqlite3ErrorMsg(tls, pParse, ts+16669, /* "UPSERT not imple..." */ - libc.VaList(bp+80, (*Table)(unsafe.Pointer(pTab)).FzName)) - goto insert_cleanup -__55: - ; - if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) { + if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { goto __56 } - Xsqlite3ErrorMsg(tls, pParse, ts+16715 /* "cannot UPSERT a ..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+17146, /* "UPSERT not imple..." */ + libc.VaList(bp+80, (*Table)(unsafe.Pointer(pTab)).FzName)) goto insert_cleanup __56: ; - if !(Xsqlite3HasExplicitNulls(tls, pParse, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget) != 0) { + if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) { goto __57 } + Xsqlite3ErrorMsg(tls, pParse, ts+17192 /* "cannot UPSERT a ..." */, 0) goto insert_cleanup __57: ; - (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor = *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)) - (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc = pTabList - (*Upsert)(unsafe.Pointer(pUpsert)).FregData = regData - (*Upsert)(unsafe.Pointer(pUpsert)).FiDataCur = *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)) - (*Upsert)(unsafe.Pointer(pUpsert)).FiIdxCur = *(*int32)(unsafe.Pointer(bp + 196 /* iIdxCur */)) - if !((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget != 0) { + if !(Xsqlite3HasExplicitNulls(tls, pParse, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget) != 0) { goto __58 } - Xsqlite3UpsertAnalyzeTarget(tls, pParse, pTabList, pUpsert) + goto insert_cleanup __58: ; -__54: + (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor = *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)) + pNx = pUpsert +__59: + (*Upsert)(unsafe.Pointer(pNx)).FpUpsertSrc = pTabList + (*Upsert)(unsafe.Pointer(pNx)).FregData = regData + (*Upsert)(unsafe.Pointer(pNx)).FiDataCur = *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)) + (*Upsert)(unsafe.Pointer(pNx)).FiIdxCur = *(*int32)(unsafe.Pointer(bp + 196 /* iIdxCur */)) + if !((*Upsert)(unsafe.Pointer(pNx)).FpUpsertTarget != 0) { + goto __62 + } + Xsqlite3UpsertAnalyzeTarget(tls, pParse, pTabList, pNx) +__62: + ; + pNx = (*Upsert)(unsafe.Pointer(pNx)).FpNextUpsert + goto __60 +__60: + if pNx != uintptr(0) { + goto __59 + } + goto __61 +__61: + ; +__55: ; // This is the top of the main insertion loop if !(useTempTable != 0) { - goto __59 + goto __63 } // This block codes the top of loop only. The complete loop is the // following pseudocode (template 4): @@ -102437,10 +103632,10 @@ __54: // D: ... addrInsTop = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, srcTab) addrCont = Xsqlite3VdbeCurrentAddr(tls, v) - goto __60 -__59: + goto __64 +__63: if !(pSelect != 0) { - goto __61 + goto __65 } // This block codes the top of loop only. The complete loop is the // following pseudocode (template 3): @@ -102453,17 +103648,17 @@ __59: addrInsTop = libc.AssignInt32(&addrCont, Xsqlite3VdbeAddOp1(tls, v, OP_Yield, (*SelectDest)(unsafe.Pointer(bp+96 /* &dest */)).FiSDParm)) if !(ipkColumn >= 0) { - goto __62 + goto __66 } // tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the // SELECT, go ahead and copy the value into the rowid slot now, so that // the value does not get overwritten by a NULL at tag-20191021-002. Xsqlite3VdbeAddOp2(tls, v, OP_Copy, (regFromSelect + ipkColumn), regRowid) -__62: +__66: ; -__61: +__65: ; -__60: +__64: ; // Compute data for ordinary columns of the new entry. Values @@ -102475,143 +103670,143 @@ __60: nHidden = 0 iRegStore = regData i = 0 -__63: +__67: if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __65 + goto __69 } if !(i == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) { - goto __66 + goto __70 } // tag-20191021-002: References to the INTEGER PRIMARY KEY are filled // using the rowid. So put a NULL in the IPK slot of the record to avoid // using excess space. The file format definition requires this extra // NULL - we cannot optimize further by skipping the column completely Xsqlite3VdbeAddOp1(tls, v, OP_SoftNull, iRegStore) - goto __64 -__66: + goto __68 +__70: ; - if !(((libc.AssignUint32(&colFlags, U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags))) & COLFLAG_NOINSERT) != U32(0)) { - goto __67 + if !(((libc.AssignUint32(&colFlags, U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags))) & U32(COLFLAG_NOINSERT)) != U32(0)) { + goto __71 } nHidden++ - if !((colFlags & COLFLAG_VIRTUAL) != U32(0)) { - goto __68 + if !((colFlags & U32(COLFLAG_VIRTUAL)) != U32(0)) { + goto __72 } // Virtual columns do not participate in OP_MakeRecord. So back up // iRegStore by one slot to compensate for the iRegStore++ in the // outer for() loop iRegStore-- - goto __64 - goto __69 -__68: - if !((colFlags & COLFLAG_STORED) != U32(0)) { - goto __70 + goto __68 + goto __73 +__72: + if !((colFlags & U32(COLFLAG_STORED)) != U32(0)) { + goto __74 } // Stored columns are computed later. But if there are BEFORE // triggers, the slots used for stored columns will be OP_Copy-ed // to a second block of registers, so the register needs to be // initialized to NULL to avoid an uninitialized register read if !((*(*int32)(unsafe.Pointer(bp + 88 /* tmask */)) & TRIGGER_BEFORE) != 0) { - goto __72 + goto __76 } Xsqlite3VdbeAddOp1(tls, v, OP_SoftNull, iRegStore) -__72: +__76: ; - goto __64 - goto __71 -__70: + goto __68 + goto __75 +__74: if !(pColumn == uintptr(0)) { - goto __73 + goto __77 } // Hidden columns that are not explicitly named in the INSERT // get there default value Xsqlite3ExprCodeFactorable(tls, pParse, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FpDflt, iRegStore) - goto __64 + goto __68 +__77: + ; +__75: + ; __73: ; __71: ; -__69: - ; -__67: - ; if !(pColumn != 0) { - goto __74 - } - j = 0 -__76: - if !((j < (*IdList)(unsafe.Pointer(pColumn)).FnId) && ((*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(j)*16)).Fidx != i)) { goto __78 } - goto __77 -__77: + j = 0 +__80: + if !((j < (*IdList)(unsafe.Pointer(pColumn)).FnId) && ((*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(j)*16)).Fidx != i)) { + goto __82 + } + goto __81 +__81: j++ - goto __76 - goto __78 -__78: + goto __80 + goto __82 +__82: ; if !(j >= (*IdList)(unsafe.Pointer(pColumn)).FnId) { - goto __79 + goto __83 } // A column not named in the insert column list gets its // default value Xsqlite3ExprCodeFactorable(tls, pParse, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FpDflt, iRegStore) - goto __64 -__79: + goto __68 +__83: ; k = j - goto __75 -__74: + goto __79 +__78: if !(nColumn == 0) { - goto __80 + goto __84 } // This is INSERT INTO ... DEFAULT VALUES. Load the default value. Xsqlite3ExprCodeFactorable(tls, pParse, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FpDflt, iRegStore) - goto __64 - goto __81 -__80: + goto __68 + goto __85 +__84: k = (i - nHidden) -__81: +__85: ; -__75: +__79: ; if !(useTempTable != 0) { - goto __82 - } - Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, k, iRegStore) - goto __83 -__82: - if !(pSelect != 0) { - goto __84 - } - if !(regFromSelect != regData) { goto __86 } - Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, (regFromSelect + k), iRegStore) + Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, k, iRegStore) + goto __87 __86: + if !(pSelect != 0) { + goto __88 + } + if !(regFromSelect != regData) { + goto __90 + } + Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, (regFromSelect + k), iRegStore) +__90: ; - goto __85 -__84: + goto __89 +__88: Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(k)*32)).FpExpr, iRegStore) -__85: +__89: ; -__83: +__87: ; - goto __64 -__64: + goto __68 +__68: i++ iRegStore++ - goto __63 - goto __65 -__65: + goto __67 + goto __69 +__69: ; // Run the BEFORE and INSTEAD OF triggers, if there are any endOfLoop = Xsqlite3VdbeMakeLabel(tls, pParse) if !((*(*int32)(unsafe.Pointer(bp + 88 /* tmask */)) & TRIGGER_BEFORE) != 0) { - goto __87 + goto __91 } regCols = Xsqlite3GetTempRange(tls, pParse, (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1)) @@ -102621,32 +103816,29 @@ __65: // we do not know what the unique ID will be (because the insert has // not happened yet) so we substitute a rowid of -1 if !(ipkColumn < 0) { - goto __88 + goto __92 } Xsqlite3VdbeAddOp2(tls, v, OP_Integer, -1, regCols) - goto __89 -__88: + goto __93 +__92: ; if !(useTempTable != 0) { - goto __90 + goto __94 } Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, ipkColumn, regCols) - goto __91 -__90: + goto __95 +__94: ; // Otherwise useTempTable is true Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(ipkColumn)*32)).FpExpr, regCols) -__91: +__95: ; addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, regCols) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, -1, regCols) Xsqlite3VdbeJumpHere(tls, v, addr1) Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, regCols) -__89: +__93: ; - // Cannot have triggers on a virtual table. If it were possible, - // this block would have to account for hidden column. - // Copy the new data already generated. Xsqlite3VdbeAddOp3(tls, v, OP_Copy, (regRowid + 1), (regCols + 1), (int32((*Table)(unsafe.Pointer(pTab)).FnNVCol) - 1)) @@ -102655,12 +103847,12 @@ __89: // columns have already been computed. This must be done after // computing the ROWID in case one of the generated columns // refers to the ROWID. - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { - goto __92 + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { + goto __96 } Xsqlite3ComputeGeneratedColumns(tls, pParse, (regCols + 1), pTab) -__92: +__96: ; // If this is an INSERT on a view with an INSTEAD OF INSERT trigger, @@ -102668,10 +103860,10 @@ __92: // If this is a real table, attempt conversions as required by the // table column affinities. if !(!(isView != 0)) { - goto __93 + goto __97 } Xsqlite3TableAffinity(tls, v, pTab, (regCols + 1)) -__93: +__97: ; // Fire BEFORE or INSTEAD OF triggers @@ -102679,83 +103871,83 @@ __93: pTab, ((regCols - int32((*Table)(unsafe.Pointer(pTab)).FnCol)) - 1), onError, endOfLoop) Xsqlite3ReleaseTempRange(tls, pParse, regCols, (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1)) -__87: +__91: ; if !(!(isView != 0)) { - goto __94 + goto __98 } if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { - goto __95 + goto __99 } // The row that the VUpdate opcode will delete: none Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regIns) -__95: +__99: ; if !(ipkColumn >= 0) { - goto __96 + goto __100 } // Compute the new rowid if !(useTempTable != 0) { - goto __98 + goto __102 } Xsqlite3VdbeAddOp3(tls, v, OP_Column, srcTab, ipkColumn, regRowid) - goto __99 -__98: + goto __103 +__102: if !(pSelect != 0) { - goto __100 + goto __104 } // Rowid already initialized at tag-20191021-001 - goto __101 -__100: + goto __105 +__104: pIpk = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(ipkColumn)*32)).FpExpr if !((int32((*Expr)(unsafe.Pointer(pIpk)).Fop) == TK_NULL) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0)) { - goto __102 + goto __106 } Xsqlite3VdbeAddOp3(tls, v, OP_NewRowid, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), regRowid, regAutoinc) appendFlag = U8(1) - goto __103 -__102: + goto __107 +__106: Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(ipkColumn)*32)).FpExpr, regRowid) +__107: + ; +__105: + ; __103: ; -__101: - ; -__99: - ; // If the PRIMARY KEY expression is NULL, then use OP_NewRowid // to generate a unique primary key value. if !(!(appendFlag != 0)) { - goto __104 + goto __108 } if !(!((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0)) { - goto __105 + goto __109 } addr11 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, regRowid) Xsqlite3VdbeAddOp3(tls, v, OP_NewRowid, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), regRowid, regAutoinc) Xsqlite3VdbeJumpHere(tls, v, addr11) - goto __106 -__105: + goto __110 +__109: addr11 = Xsqlite3VdbeCurrentAddr(tls, v) Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, regRowid, (addr11 + 2)) -__106: +__110: ; Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, regRowid) -__104: - ; - goto __97 -__96: - if !(((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) || (withoutRowid != 0)) { - goto __107 - } - Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regRowid) - goto __108 -__107: - Xsqlite3VdbeAddOp3(tls, v, OP_NewRowid, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), regRowid, regAutoinc) - appendFlag = U8(1) __108: ; -__97: + goto __101 +__100: + if !(((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) || (withoutRowid != 0)) { + goto __111 + } + Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regRowid) + goto __112 +__111: + Xsqlite3VdbeAddOp3(tls, v, OP_NewRowid, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), regRowid, regAutoinc) + appendFlag = U8(1) +__112: + ; +__101: ; autoIncStep(tls, pParse, regAutoinc, regRowid) @@ -102763,30 +103955,30 @@ __97: // columns have already been computed. This must be done after // computing the ROWID in case one of the generated columns // is derived from the INTEGER PRIMARY KEY. - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { - goto __109 + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { + goto __113 } Xsqlite3ComputeGeneratedColumns(tls, pParse, (regRowid + 1), pTab) -__109: +__113: ; // Generate code to check constraints and generate index keys and // do the insertion. if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { - goto __110 + goto __114 } pVTab = Xsqlite3GetVTable(tls, db, pTab) Xsqlite3VtabMakeWritable(tls, pParse, pTab) Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 1, (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 2), regIns, pVTab, -12) Xsqlite3VdbeChangeP5(tls, v, func() uint16 { if onError == OE_Default { - return OE_Abort + return uint16(OE_Abort) } return uint16(onError) }()) Xsqlite3MayAbort(tls, pParse) - goto __111 -__110: + goto __115 +__114: // True to use OPFLAG_SEEKRESULT Xsqlite3GenerateConstraintChecks(tls, pParse, pTab, aRegIdx, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 196 /* iIdxCur */)), regIns, 0, (uint8(libc.Bool32(ipkColumn >= 0))), uint8(onError), endOfLoop, bp+200 /* &isReplace */, uintptr(0), pUpsert) @@ -102803,47 +103995,47 @@ __110: bUseSeek = (libc.Bool32((*(*int32)(unsafe.Pointer(bp + 200 /* isReplace */)) == 0) || !(Xsqlite3VdbeHasSubProgram(tls, v) != 0))) Xsqlite3CompleteInsertion(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 196 /* iIdxCur */)), regIns, aRegIdx, 0, int32(appendFlag), bUseSeek) -__111: +__115: ; -__94: +__98: ; // Update the count of rows that are inserted if !(regRowCount != 0) { - goto __112 + goto __116 } Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, regRowCount, 1) -__112: +__116: ; if !(pTrigger != 0) { - goto __113 + goto __117 } // Code AFTER triggers Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, TK_INSERT, uintptr(0), TRIGGER_AFTER, pTab, ((regData - 2) - int32((*Table)(unsafe.Pointer(pTab)).FnCol)), onError, endOfLoop) -__113: +__117: ; // The bottom of the main insertion loop, if the data source // is a SELECT statement. Xsqlite3VdbeResolveLabel(tls, v, endOfLoop) if !(useTempTable != 0) { - goto __114 + goto __118 } Xsqlite3VdbeAddOp2(tls, v, OP_Next, srcTab, addrCont) Xsqlite3VdbeJumpHere(tls, v, addrInsTop) Xsqlite3VdbeAddOp1(tls, v, OP_Close, srcTab) - goto __115 -__114: + goto __119 +__118: if !(pSelect != 0) { - goto __116 + goto __120 } Xsqlite3VdbeGoto(tls, v, addrCont) Xsqlite3VdbeJumpHere(tls, v, addrInsTop) -__116: +__120: ; -__115: +__119: ; insert_end: @@ -102851,22 +104043,22 @@ insert_end: // maximum rowid counter values recorded while inserting into // autoincrement tables. if !((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && ((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0))) { - goto __117 + goto __121 } Xsqlite3AutoincrementEnd(tls, pParse) -__117: +__121: ; // Return the number of rows inserted. If this routine is // generating code because of a call to sqlite3NestedParse(), do not // invoke the callback function. if !(regRowCount != 0) { - goto __118 + goto __122 } - Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, regRowCount, 1) + Xsqlite3VdbeAddOp2(tls, v, OP_ChngCntRow, regRowCount, 1) Xsqlite3VdbeSetNumCols(tls, v, 1) - Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+16736 /* "rows inserted" */, uintptr(0)) -__118: + Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+17213 /* "rows inserted" */, uintptr(0)) +__122: ; insert_cleanup: @@ -102889,7 +104081,7 @@ insert_cleanup: // Set bit 0x01 of pWalker->eCode if pWalker->eCode to 0 and if this // expression node references any of the // columns that are being modifed by an UPDATE statement. -func checkConstraintExprNode(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:121903:12: */ +func checkConstraintExprNode(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:123452:12: */ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN { if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { @@ -102916,7 +104108,7 @@ func checkConstraintExprNode(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int3 // The operation of this routine is the same - return true if an only if // the expression uses one or more of columns identified by the second and // third arguments. -func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng uintptr, chngRowid int32) int32 { /* sqlite3.c:121932:20: */ +func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng uintptr, chngRowid int32) int32 { /* sqlite3.c:123481:20: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -102937,6 +104129,73 @@ func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng ui return (libc.Bool32(int32((*Walker)(unsafe.Pointer(bp /* &w */)).FeCode) != 0)) } +// The sqlite3GenerateConstraintChecks() routine usually wants to visit +// the indexes of a table in the order provided in the Table->pIndex list. +// However, sometimes (rarely - when there is an upsert) it wants to visit +// the indexes in a different order. The following data structures accomplish +// this. +// +// The IndexIterator object is used to walk through all of the indexes +// of a table in either Index.pNext order, or in some other order established +// by an array of IndexListTerm objects. +type IndexListTerm1 = struct { + Fp uintptr + Fix int32 + _ [4]byte +} /* sqlite3.c:123514:9 */ + +// The sqlite3GenerateConstraintChecks() routine usually wants to visit +// the indexes of a table in the order provided in the Table->pIndex list. +// However, sometimes (rarely - when there is an upsert) it wants to visit +// the indexes in a different order. The following data structures accomplish +// this. +// +// The IndexIterator object is used to walk through all of the indexes +// of a table in either Index.pNext order, or in some other order established +// by an array of IndexListTerm objects. +type IndexListTerm = IndexListTerm1 /* sqlite3.c:123514:30 */ +type IndexIterator1 = struct { + FeType int32 + Fi int32 + Fu struct { + Flx struct{ FpIdx uintptr } + _ [8]byte + } +} /* sqlite3.c:123515:9 */ + +type IndexIterator = IndexIterator1 /* sqlite3.c:123515:30 */ + +// Return the first index on the list +func indexIteratorFirst(tls *libc.TLS, pIter uintptr, pIx uintptr) uintptr { /* sqlite3.c:123539:14: */ + + if (*IndexIterator)(unsafe.Pointer(pIter)).FeType != 0 { + *(*int32)(unsafe.Pointer(pIx)) = (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)))).Fix + return (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)))).Fp + } else { + *(*int32)(unsafe.Pointer(pIx)) = 0 + return *(*uintptr)(unsafe.Pointer(pIter + 8 /* &.u */ /* &.lx */ /* &.pIdx */)) + } + return uintptr(0) +} + +// Return the next index from the list. Return NULL when out of indexes +func indexIteratorNext(tls *libc.TLS, pIter uintptr, pIx uintptr) uintptr { /* sqlite3.c:123551:14: */ + if (*IndexIterator)(unsafe.Pointer(pIter)).FeType != 0 { + var i int32 = libc.PreIncInt32(&(*IndexIterator)(unsafe.Pointer(pIter)).Fi, 1) + if i >= *(*int32)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) /* &.nIdx */)) { + *(*int32)(unsafe.Pointer(pIx)) = i + return uintptr(0) + } + *(*int32)(unsafe.Pointer(pIx)) = (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(i)*16)).Fix + return (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pIter + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(i)*16)).Fp + } else { + (*(*int32)(unsafe.Pointer(pIx)))++ + *(*uintptr)(unsafe.Pointer(pIter + 8 /* &.u */ /* &.lx */ /* &.pIdx */)) = (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIter + 8 /* &.u */ /* &.lx */ /* &.pIdx */)))).FpNext + return *(*uintptr)(unsafe.Pointer(pIter + 8 /* &.u */ /* &.lx */ /* &.pIdx */)) + } + return uintptr(0) +} + // Generate code to do constraint checks prior to an INSERT or an UPDATE // on table pTab. // @@ -103026,27 +104285,28 @@ func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng ui // 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 Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintptr, aRegIdx uintptr, iDataCur int32, iIdxCur int32, regNewData int32, regOldData int32, pkChng U8, overrideError U8, ignoreDest int32, pbMayReplace uintptr, aiChng uintptr, pUpsert uintptr) { /* sqlite3.c:122045:21: */ - bp := tls.Alloc(104) - defer tls.Free(104) +func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintptr, aRegIdx uintptr, iDataCur int32, iIdxCur int32, regNewData int32, regOldData int32, pkChng U8, overrideError U8, ignoreDest int32, pbMayReplace uintptr, aiChng uintptr, pUpsert uintptr) { /* sqlite3.c:123658:21: */ + bp := tls.Alloc(136) + defer tls.Free(136) - var v uintptr // VDBE under constrution - var pIdx uintptr // Pointer to one of the indices - var pPk uintptr = uintptr(0) // The PRIMARY KEY index - var db uintptr // Database connection - var i int32 // loop counter - var ix int32 // Index loop counter - var nCol int32 // Number of columns - var onError int32 // Conflict resolution strategy - var seenReplace int32 = 0 // True if REPLACE is used to resolve INT PK conflict - var nPkField int32 // Number of fields in PRIMARY KEY. 1 for ROWID tables - var pUpIdx uintptr = uintptr(0) // Index to which to apply the upsert - var isUpdate U8 // True if this is an UPDATE operation - var bAffinityDone U8 = U8(0) // True if the OP_Affinity operation has been run - var upsertBypass int32 = 0 // Address of Goto to bypass upsert subroutine - var upsertJump int32 = 0 // Address of Goto that jumps into upsert subroutine - var ipkTop int32 = 0 // Top of the IPK uniqueness check - var ipkBottom int32 = 0 // OP_Goto at the end of the IPK uniqueness check + var v uintptr // VDBE under constrution + var pIdx uintptr // Pointer to one of the indices + var pPk uintptr = uintptr(0) // The PRIMARY KEY index for WITHOUT ROWID tables + var db uintptr // Database connection + var i int32 // loop counter + // var ix int32 at bp+96, 4 + // Index loop counter + var nCol int32 // Number of columns + var onError int32 // Conflict resolution strategy + var seenReplace int32 = 0 // True if REPLACE is used to resolve INT PK conflict + var nPkField int32 // Number of fields in PRIMARY KEY. 1 for ROWID tables + var pUpsertClause uintptr = uintptr(0) // The specific ON CONFLICT clause for pIdx + var isUpdate U8 // True if this is an UPDATE operation + var bAffinityDone U8 = U8(0) // True if the OP_Affinity operation has been run + var upsertIpkReturn int32 = 0 // Address of Goto at end of IPK uniqueness check + var upsertIpkDelay int32 = 0 // Address of Goto to bypass initial IPK check + var ipkTop int32 = 0 // Top of the IPK uniqueness check + var ipkBottom int32 = 0 // OP_Goto at the end of the IPK uniqueness check // Variables associated with retesting uniqueness constraints after // replace triggers fire have run var regTrigCnt int32 // Register used to count replace trigger invocations @@ -103054,10 +104314,12 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt var lblRecheckOk int32 = 0 // Each recheck jumps to this label if it passes var pTrigger uintptr // List of DELETE triggers on the table pTab var nReplaceTrig int32 = 0 // Number of replace triggers coded + // var sIdxIter IndexIterator at bp+72, 24 + // Index iterator isUpdate = (U8(libc.Bool32(regOldData != 0))) db = (*Parse)(unsafe.Pointer(pParse)).Fdb - v = Xsqlite3GetVdbe(tls, pParse) + v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // This table is not a VIEW nCol = int32((*Table)(unsafe.Pointer(pTab)).FnCol) @@ -103066,7 +104328,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // normal rowid tables. nPkField is the number of key fields in the // pPk index or 1 for a rowid table. In other words, nPkField is the // number of fields in the true primary key of the table. - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk = uintptr(0) nPkField = 1 } else { @@ -103077,7 +104339,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // Record that this module has started // Test all NOT NULL constraints. - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasNotNull) != 0 { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasNotNull)) != 0 { var b2ndPass int32 = 0 // True if currently running 2nd pass var nSeenReplace int32 = 0 // Number of ON CONFLICT REPLACE operations var nGenerated int32 = 0 // Number of generated columns with NOT NULL @@ -103139,12 +104401,12 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt fallthrough case OE_Fail: { - var zMsg uintptr = Xsqlite3MPrintf(tls, db, ts+9997 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, + var zMsg uintptr = Xsqlite3MPrintf(tls, db, ts+10090 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer(pCol)).FzName)) Xsqlite3VdbeAddOp3(tls, v, OP_HaltIfNull, (SQLITE_CONSTRAINT | (int32(5) << 8)), onError, iReg) Xsqlite3VdbeAppendP4(tls, v, zMsg, -7) - Xsqlite3VdbeChangeP5(tls, v, P5_ConstraintNotNull) + Xsqlite3VdbeChangeP5(tls, v, uint16(P5_ConstraintNotNull)) break @@ -103170,7 +104432,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt break } // Never need more than 2 passes b2ndPass = 1 - if (nSeenReplace > 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != U32(0)) { + if (nSeenReplace > 0) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != U32(0)) { // If any NOT NULL ON CONFLICT REPLACE constraints fired on the // first pass, recomputed values for all generated columns, as // those values might depend on columns affected by the REPLACE. @@ -103180,7 +104442,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } // end if( has-not-null-constraints ) // Test all CHECK constraints - if ((*Table)(unsafe.Pointer(pTab)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_IgnoreChecks) == uint64(0)) { + if ((*Table)(unsafe.Pointer(pTab)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_IgnoreChecks)) == uint64(0)) { var pCheck uintptr = (*Table)(unsafe.Pointer(pTab)).FpCheck (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + 1) if int32(overrideError) != OE_Default { @@ -103213,15 +104475,13 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt Xsqlite3VdbeGoto(tls, v, ignoreDest) } else { var zName uintptr = (*ExprList_item)(unsafe.Pointer((pCheck + 8 /* &.a */) + uintptr(i)*32)).FzEName - if zName == uintptr(0) { - zName = (*Table)(unsafe.Pointer(pTab)).FzName - } + if onError == OE_Replace { onError = OE_Abort } // IMP: R-26383-51744 Xsqlite3HaltConstraint(tls, pParse, (SQLITE_CONSTRAINT | (int32(1) << 8)), - onError, zName, P4_TRANSIENT, - P5_ConstraintCheck) + onError, zName, int8(P4_TRANSIENT), + uint8(P5_ConstraintCheck)) } Xsqlite3VdbeResolveLabel(tls, v, allOk) } @@ -103255,19 +104515,104 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // The ordering of (2) and (3) is accomplished by making sure the linked // list of indexes attached to a table puts all OE_Replace indexes last // in the list. See sqlite3CreateIndex() for where that happens. - + (*IndexIterator)(unsafe.Pointer(bp + 72 /* &sIdxIter */)).FeType = 0 + (*IndexIterator)(unsafe.Pointer(bp + 72 /* &sIdxIter */)).Fi = 0 + *(*uintptr)(unsafe.Pointer(bp + 72 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */ + 8 /* &.aIdx */)) = uintptr(0) // Silence harmless compiler warning + *(*uintptr)(unsafe.Pointer(bp + 72 /* &sIdxIter */ + 8 /* &.u */ /* &.lx */ /* &.pIdx */)) = (*Table)(unsafe.Pointer(pTab)).FpIndex if pUpsert != 0 { if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget == uintptr(0) { - // An ON CONFLICT DO NOTHING clause, without a constraint-target. - // Make all unique constraint resolution be OE_Ignore + // There is just on ON CONFLICT clause and it has no constraint-target + + if int32((*Upsert)(unsafe.Pointer(pUpsert)).FisDoUpdate) == 0 { + // A single ON CONFLICT DO NOTHING clause, without a constraint-target. + // Make all unique constraint resolution be OE_Ignore + overrideError = U8(OE_Ignore) + pUpsert = uintptr(0) + } else { + // A single ON CONFLICT DO UPDATE. Make all resolutions OE_Update + overrideError = U8(OE_Update) + } + } else if (*Table)(unsafe.Pointer(pTab)).FpIndex != uintptr(0) { + // Otherwise, we'll need to run the IndexListTerm array version of the + // iterator to ensure that all of the ON CONFLICT conditions are + // checked first and in order. + var nIdx int32 + var jj int32 + var nByte U64 + var pTerm uintptr + var bUsed uintptr + nIdx = 0 + pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex + __1: + if !(pIdx != 0) { + goto __3 + } + { + + } + goto __2 + __2: + pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext + nIdx++ + goto __1 + goto __3 + __3: + ; + (*IndexIterator)(unsafe.Pointer(bp + 72 /* &sIdxIter */)).FeType = 1 + *(*int32)(unsafe.Pointer(bp + 72 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */ /* &.nIdx */)) = nIdx + nByte = (U64(((uint64(unsafe.Sizeof(IndexListTerm{})) + uint64(1)) * uint64(nIdx)) + uint64(nIdx))) + *(*uintptr)(unsafe.Pointer(bp + 72 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */ + 8 /* &.aIdx */)) = Xsqlite3DbMallocZero(tls, db, nByte) + if *(*uintptr)(unsafe.Pointer((bp + 72 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) == uintptr(0) { + return + } // OOM + bUsed = (*(*uintptr)(unsafe.Pointer((bp + 72 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(nIdx)*16) + (*Upsert)(unsafe.Pointer(pUpsert)).FpToFree = *(*uintptr)(unsafe.Pointer(bp + 72 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */ + 8 /* &.aIdx */)) + i = 0 + pTerm = pUpsert + for ; pTerm != 0; pTerm = (*Upsert)(unsafe.Pointer(pTerm)).FpNextUpsert { + if (*Upsert)(unsafe.Pointer(pTerm)).FpUpsertTarget == uintptr(0) { + break + } + if (*Upsert)(unsafe.Pointer(pTerm)).FpUpsertIdx == uintptr(0) { + continue + } // Skip ON CONFLICT for the IPK + jj = 0 + pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex + for (pIdx != uintptr(0)) && (pIdx != (*Upsert)(unsafe.Pointer(pTerm)).FpUpsertIdx) { + pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext + jj++ + } + if *(*U8)(unsafe.Pointer(bUsed + uintptr(jj))) != 0 { + continue + } // Duplicate ON CONFLICT clause ignored + *(*U8)(unsafe.Pointer(bUsed + uintptr(jj))) = U8(1) + (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((bp + 72 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(i)*16)).Fp = pIdx + (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((bp + 72 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(i)*16)).Fix = jj + i++ + } + jj = 0 + pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex + __4: + if !(pIdx != 0) { + goto __6 + } + { + if *(*U8)(unsafe.Pointer(bUsed + uintptr(jj))) != 0 { + goto __5 + } + (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((bp + 72 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(i)*16)).Fp = pIdx + (*IndexListTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((bp + 72 /* &sIdxIter */ + 8 /* &.u */ /* &.ax */) + 8 /* &.aIdx */)) + uintptr(i)*16)).Fix = jj + i++ + + } + goto __5 + __5: + pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext + jj++ + goto __4 + goto __6 + __6: - overrideError = OE_Ignore - pUpsert = uintptr(0) - } else if (libc.AssignUintptr(&pUpIdx, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx)) != uintptr(0) { - // If the constraint-target uniqueness check must be run first. - // Jump to that uniqueness check now - upsertJump = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) - Xsqlite3VdbeComment(tls, v, ts+16750 /* "UPSERT constrain..." */, 0) } } @@ -103296,7 +104641,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt pTrigger = uintptr(0) regTrigCnt = 0 } else { - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_RecTriggers) != 0 { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_RecTriggers)) != 0 { pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, TK_DELETE, uintptr(0), uintptr(0)) regTrigCnt = (libc.Bool32((pTrigger != uintptr(0)) || (Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0))) } else { @@ -103308,7 +104653,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // initialize it to zero. regTrigCnt = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regTrigCnt) - Xsqlite3VdbeComment(tls, v, ts+16779 /* "trigger count" */, 0) + Xsqlite3VdbeComment(tls, v, ts+17227 /* "trigger count" */, 0) lblRecheckOk = Xsqlite3VdbeMakeLabel(tls, pParse) addrRecheck = lblRecheckOk } @@ -103328,11 +104673,20 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } // figure out whether or not upsert applies in this case - if (pUpsert != 0) && ((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx == uintptr(0)) { - if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet == uintptr(0) { - onError = OE_Ignore // DO NOTHING is the same as INSERT OR IGNORE - } else { - onError = OE_Update // DO UPDATE + if pUpsert != 0 { + pUpsertClause = Xsqlite3UpsertOfIndex(tls, pUpsert, uintptr(0)) + if pUpsertClause != uintptr(0) { + if int32((*Upsert)(unsafe.Pointer(pUpsertClause)).FisDoUpdate) == 0 { + onError = OE_Ignore // DO NOTHING is the same as INSERT OR IGNORE + } else { + onError = OE_Update // DO UPDATE + } + } + if pUpsertClause != pUpsert { + // The first ON CONFLICT clause has a conflict target other than + // the IPK. We have to jump ahead to that first ON CONFLICT clause + // and then come back here and deal with the IPK afterwards + upsertIpkDelay = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) } } @@ -103341,10 +104695,10 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // to defer the running of the rowid conflict checking until after // the UNIQUE constraints have run. if ((onError == OE_Replace) && // IPK rule is REPLACE - (onError != int32(overrideError))) && // Rules for other contraints are different + (onError != int32(overrideError))) && // Rules for other constraints are different ((*Table)(unsafe.Pointer(pTab)).FpIndex != 0) { ipkTop = (Xsqlite3VdbeAddOp0(tls, v, OP_Goto) + 1) - Xsqlite3VdbeComment(tls, v, ts+16793 /* "defer IPK REPLAC..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+17241 /* "defer IPK REPLAC..." */, 0) } if isUpdate != 0 { @@ -103352,13 +104706,13 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // it might have changed. Skip the conflict logic below if the rowid // is unchanged. Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regNewData, addrRowidOk, regOldData) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } // Check to see if the new rowid already exists in the table. Skip // the following conflict logic if it does not. - Xsqlite3VdbeNoopComment(tls, v, ts+16822 /* "uniqueness check..." */, 0) + Xsqlite3VdbeNoopComment(tls, v, ts+17270 /* "uniqueness check..." */, 0) Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, addrRowidOk, regNewData) @@ -103407,7 +104761,7 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt if regTrigCnt != 0 { Xsqlite3MultiWrite(tls, pParse) Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur, - regNewData, int16(1), uint8(0), OE_Replace, uint8(1), -1) + regNewData, int16(1), uint8(0), uint8(OE_Replace), uint8(1), -1) Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, regTrigCnt, 1) // incr trigger cnt nReplaceTrig++ } else { @@ -103443,7 +104797,9 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt } } Xsqlite3VdbeResolveLabel(tls, v, addrRowidOk) - if ipkTop != 0 { + if (pUpsert != 0) && (pUpsertClause != pUpsert) { + upsertIpkReturn = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) + } else if ipkTop != 0 { ipkBottom = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) Xsqlite3VdbeJumpHere(tls, v, (ipkTop - 1)) } @@ -103455,40 +104811,33 @@ func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt // // This loop also handles the case of the PRIMARY KEY index for a // WITHOUT ROWID table. - ix = 0 - pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex -__1: - if !(pIdx != 0) { - goto __3 - } - { + for pIdx = indexIteratorFirst(tls, bp+72 /* &sIdxIter */, bp+96 /* &ix */); pIdx != 0; pIdx = indexIteratorNext(tls, bp+72 /* &sIdxIter */, bp+96 /* &ix */) { var regIdx int32 // Range of registers hold conent for pIdx var regR int32 // Range of registers holding conflicting PK var iThisCur int32 // Cursor for this UNIQUE index var addrUniqueOk int32 // Jump here if the UNIQUE constraint is satisfied var addrConflictCk int32 // First opcode in the conflict check logic - if *(*int32)(unsafe.Pointer(aRegIdx + uintptr(ix)*4)) == 0 { - goto __2 + if *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 96 /* ix */)))*4)) == 0 { + continue } // Skip indices that do not change - if pUpIdx == pIdx { - addrUniqueOk = (upsertJump + 1) - upsertBypass = Xsqlite3VdbeGoto(tls, v, 0) - Xsqlite3VdbeComment(tls, v, ts+16849 /* "Skip upsert subr..." */, 0) - Xsqlite3VdbeJumpHere(tls, v, upsertJump) - } else { - addrUniqueOk = Xsqlite3VdbeMakeLabel(tls, pParse) + if pUpsert != 0 { + pUpsertClause = Xsqlite3UpsertOfIndex(tls, pUpsert, pIdx) + if (upsertIpkDelay != 0) && (pUpsertClause == pUpsert) { + Xsqlite3VdbeJumpHere(tls, v, upsertIpkDelay) + } } - if (int32(bAffinityDone) == 0) && ((pUpIdx == uintptr(0)) || (pUpIdx == pIdx)) { + addrUniqueOk = Xsqlite3VdbeMakeLabel(tls, pParse) + if int32(bAffinityDone) == 0 { Xsqlite3TableAffinity(tls, v, pTab, (regNewData + 1)) bAffinityDone = U8(1) } - Xsqlite3VdbeNoopComment(tls, v, ts+16872 /* "prep index %s" */, libc.VaList(bp+16, (*Index)(unsafe.Pointer(pIdx)).FzName)) - iThisCur = (iIdxCur + ix) + Xsqlite3VdbeNoopComment(tls, v, ts+17297 /* "prep index %s" */, libc.VaList(bp+16, (*Index)(unsafe.Pointer(pIdx)).FzName)) + iThisCur = (iIdxCur + *(*int32)(unsafe.Pointer(bp + 96 /* ix */))) // Skip partial indices for which the WHERE clause is not true if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { - Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(ix)*4))) + Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 96 /* ix */)))*4))) (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + 1) Xsqlite3ExprIfFalseDup(tls, pParse, (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere, addrUniqueOk, SQLITE_JUMPIFNULL) @@ -103497,7 +104846,7 @@ __1: // Create a record for this index entry as it should appear after // the insert or update. Store that record in the aRegIdx[ix] register - regIdx = (*(*int32)(unsafe.Pointer(aRegIdx + uintptr(ix)*4)) + 1) + regIdx = (*(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 96 /* ix */)))*4)) + 1) for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ { var iField int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) var x int32 @@ -103505,11 +104854,11 @@ __1: (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + 1) Xsqlite3ExprCodeCopy(tls, pParse, (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8 /* &.a */)+uintptr(i)*32)).FpExpr, (regIdx + i)) (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - Xsqlite3VdbeComment(tls, v, ts+16886 /* "%s column %d" */, libc.VaList(bp+24, (*Index)(unsafe.Pointer(pIdx)).FzName, i)) + Xsqlite3VdbeComment(tls, v, ts+17311 /* "%s column %d" */, libc.VaList(bp+24, (*Index)(unsafe.Pointer(pIdx)).FzName, i)) } else if (iField == (-1)) || (iField == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) { x = regNewData Xsqlite3VdbeAddOp2(tls, v, OP_IntCopy, x, (regIdx + i)) - Xsqlite3VdbeComment(tls, v, ts+10064 /* "rowid" */, 0) + Xsqlite3VdbeComment(tls, v, ts+10157 /* "rowid" */, 0) } else { x = ((int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iField))) + regNewData) + 1) @@ -103517,8 +104866,8 @@ __1: Xsqlite3VdbeComment(tls, v, ts+824 /* "%s" */, libc.VaList(bp+40, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iField)*32)).FzName)) } } - Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regIdx, int32((*Index)(unsafe.Pointer(pIdx)).FnColumn), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(ix)*4))) - Xsqlite3VdbeComment(tls, v, ts+16899 /* "for %s" */, libc.VaList(bp+48, (*Index)(unsafe.Pointer(pIdx)).FzName)) + Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regIdx, int32((*Index)(unsafe.Pointer(pIdx)).FnColumn), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 96 /* ix */)))*4))) + Xsqlite3VdbeComment(tls, v, ts+17324 /* "for %s" */, libc.VaList(bp+48, (*Index)(unsafe.Pointer(pIdx)).FzName)) // In an UPDATE operation, if this index is the PRIMARY KEY index // of a WITHOUT ROWID table and there has been no change the @@ -103526,14 +104875,14 @@ __1: // logic below can all be skipped. if ((isUpdate != 0) && (pPk == pIdx)) && (int32(pkChng) == 0) { Xsqlite3VdbeResolveLabel(tls, v, addrUniqueOk) - goto __2 + continue } // Find out what action to take in case there is a uniqueness conflict onError = int32((*Index)(unsafe.Pointer(pIdx)).FonError) if onError == OE_None { Xsqlite3VdbeResolveLabel(tls, v, addrUniqueOk) - goto __2 // pIdx is not a UNIQUE index + continue // pIdx is not a UNIQUE index } if int32(overrideError) != OE_Default { onError = int32(overrideError) @@ -103542,8 +104891,8 @@ __1: } // Figure out if the upsert clause applies to this index - if pUpIdx == pIdx { - if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet == uintptr(0) { + if pUpsertClause != 0 { + if int32((*Upsert)(unsafe.Pointer(pUpsertClause)).FisDoUpdate) == 0 { onError = OE_Ignore // DO NOTHING is the same as INSERT OR IGNORE } else { onError = OE_Update // DO UPDATE @@ -103573,13 +104922,13 @@ __1: regR = Xsqlite3GetTempRange(tls, pParse, nPkField) } if (isUpdate != 0) || (onError == OE_Replace) { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iThisCur, regR) // Conflict only if the rowid of the existing index entry // is different from old-rowid if isUpdate != 0 { Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regR, addrUniqueOk, regOldData) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } } else { @@ -103591,7 +104940,7 @@ __1: x = int32(Xsqlite3TableColumnToIndex(tls, pIdx, *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) Xsqlite3VdbeAddOp3(tls, v, OP_Column, iThisCur, x, (regR + i)) - Xsqlite3VdbeComment(tls, v, ts+9997 /* "%s.%s" */, libc.VaList(bp+56, (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))*32)).FzName)) + Xsqlite3VdbeComment(tls, v, ts+10090 /* "%s.%s" */, libc.VaList(bp+56, (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))*32)).FzName)) } } if isUpdate != 0 { @@ -103622,7 +104971,7 @@ __1: x = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(x))) Xsqlite3VdbeAddOp4(tls, v, op, ((regOldData + 1) + x), addrJump, (regCmp + i), p4, -2) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } } @@ -103645,7 +104994,7 @@ __1: } case OE_Update: { - Xsqlite3UpsertDoUpdate(tls, pParse, pUpsert, pTab, pIdx, (iIdxCur + ix)) + Xsqlite3UpsertDoUpdate(tls, pParse, pUpsert, pTab, pIdx, (iIdxCur + *(*int32)(unsafe.Pointer(bp + 96 /* ix */)))) } fallthrough @@ -103670,12 +105019,12 @@ __1: Xsqlite3VdbeAddOp1(tls, v, OP_CursorLock, iDataCur) } Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, iDataCur, iIdxCur, - regR, int16(nPkField), uint8(0), OE_Replace, + regR, int16(nPkField), uint8(0), uint8(OE_Replace), func() uint8 { if pIdx == pPk { - return ONEPASS_SINGLE + return uint8(ONEPASS_SINGLE) } - return ONEPASS_OFF + return uint8(ONEPASS_OFF) }(), iThisCur) if (pTrigger != 0) && (isUpdate != 0) { Xsqlite3VdbeAddOp1(tls, v, OP_CursorUnlock, iDataCur) @@ -103685,7 +105034,7 @@ __1: Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, regTrigCnt, 1) // incr trigger cnt addrBypass = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) // Bypass recheck - Xsqlite3VdbeComment(tls, v, ts+16906 /* "bypass recheck" */, 0) + Xsqlite3VdbeComment(tls, v, ts+17331 /* "bypass recheck" */, 0) // Here we insert code that will be invoked after all constraint // checks have run, if and only if one or more replace triggers @@ -103702,27 +105051,27 @@ __1: // the constraint-ok jump destination to be the address of // the next retest block for nConflictCk > 0 { - // var x VdbeOp at bp+72, 32 + // var x VdbeOp at bp+104, 32 // Conflict check opcode to copy // The sqlite3VdbeAddOp4() call might reallocate the opcode array. // Hence, make a complete copy of the opcode, rather than using // a pointer to the opcode. - *(*VdbeOp)(unsafe.Pointer(bp + 72 /* x */)) = *(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, addrConflictCk))) - if int32((*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fopcode) != OP_IdxRowid { + *(*VdbeOp)(unsafe.Pointer(bp + 104 /* x */)) = *(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, addrConflictCk))) + if int32((*VdbeOp)(unsafe.Pointer(bp+104 /* &x */)).Fopcode) != OP_IdxRowid { var p2 int32 // New P2 value for copied conflict check opcode var zP4 uintptr - if (int32(Xsqlite3OpcodeProperty[(*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fopcode]) & OPFLG_JUMP) != 0 { + if (int32(Xsqlite3OpcodeProperty[(*VdbeOp)(unsafe.Pointer(bp+104 /* &x */)).Fopcode]) & OPFLG_JUMP) != 0 { p2 = lblRecheckOk } else { - p2 = (*VdbeOp)(unsafe.Pointer(bp + 72 /* &x */)).Fp2 + p2 = (*VdbeOp)(unsafe.Pointer(bp + 104 /* &x */)).Fp2 } - if int32((*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fp4type) == (-3) { - zP4 = uintptr(int64(*(*int32)(unsafe.Pointer(bp + 72 /* &x */ + 16 /* &.p4 */)))) + if int32((*VdbeOp)(unsafe.Pointer(bp+104 /* &x */)).Fp4type) == (-3) { + zP4 = uintptr(int64(*(*int32)(unsafe.Pointer(bp + 104 /* &x */ + 16 /* &.p4 */)))) } else { - zP4 = *(*uintptr)(unsafe.Pointer(bp + 72 /* &x */ + 16 /* &.p4 */)) + zP4 = *(*uintptr)(unsafe.Pointer(bp + 104 /* &x */ + 16 /* &.p4 */)) } - Xsqlite3VdbeAddOp4(tls, v, int32((*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fopcode), (*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fp1, p2, (*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fp3, zP4, int32((*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fp4type)) - Xsqlite3VdbeChangeP5(tls, v, (*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fp5) + Xsqlite3VdbeAddOp4(tls, v, int32((*VdbeOp)(unsafe.Pointer(bp+104 /* &x */)).Fopcode), (*VdbeOp)(unsafe.Pointer(bp+104 /* &x */)).Fp1, p2, (*VdbeOp)(unsafe.Pointer(bp+104 /* &x */)).Fp3, zP4, int32((*VdbeOp)(unsafe.Pointer(bp+104 /* &x */)).Fp4type)) + Xsqlite3VdbeChangeP5(tls, v, (*VdbeOp)(unsafe.Pointer(bp+104 /* &x */)).Fp5) } nConflictCk-- @@ -103738,30 +105087,23 @@ __1: } } - if pUpIdx == pIdx { - Xsqlite3VdbeGoto(tls, v, (upsertJump + 1)) - Xsqlite3VdbeJumpHere(tls, v, upsertBypass) - } else { - Xsqlite3VdbeResolveLabel(tls, v, addrUniqueOk) - } + Xsqlite3VdbeResolveLabel(tls, v, addrUniqueOk) if regR != regIdx { Xsqlite3ReleaseTempRange(tls, pParse, regR, nPkField) } - + if ((pUpsertClause != 0) && + (upsertIpkReturn != 0)) && + (Xsqlite3UpsertNextIsIPK(tls, pUpsertClause) != 0) { + Xsqlite3VdbeGoto(tls, v, (upsertIpkDelay + 1)) + Xsqlite3VdbeJumpHere(tls, v, upsertIpkReturn) + upsertIpkReturn = 0 + } } - goto __2 -__2: - pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext - ix++ - goto __1 - goto __3 -__3: - ; // If the IPK constraint is a REPLACE, run it last if ipkTop != 0 { Xsqlite3VdbeGoto(tls, v, ipkTop) - Xsqlite3VdbeComment(tls, v, ts+16921 /* "Do IPK REPLACE" */, 0) + Xsqlite3VdbeComment(tls, v, ts+17346 /* "Do IPK REPLACE" */, 0) Xsqlite3VdbeJumpHere(tls, v, ipkBottom) } @@ -103773,7 +105115,7 @@ __3: if !(pPk != 0) { if isUpdate != 0 { Xsqlite3VdbeAddOp3(tls, v, OP_Eq, regNewData, addrRecheck, regOldData) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) } Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, addrRecheck, regNewData) @@ -103786,8 +105128,8 @@ __3: } // Generate the table record - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { - var regRec int32 = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(ix)*4)) + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + var regRec int32 = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(*(*int32)(unsafe.Pointer(bp + 96 /* ix */)))*4)) Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (regNewData + 1), int32((*Table)(unsafe.Pointer(pTab)).FnNVCol), regRec) if !(bAffinityDone != 0) { @@ -103799,6 +105141,20 @@ __3: } +// Table pTab is a WITHOUT ROWID table that is being written to. The cursor +// number is iCur, and register regData contains the new record for the +// PK index. This function adds code to invoke the pre-update hook, +// if one is registered. +func codeWithoutRowidPreupdate(tls *libc.TLS, pParse uintptr, pTab uintptr, iCur int32, regData int32) { /* sqlite3.c:124511:13: */ + var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe + var r int32 = Xsqlite3GetTempReg(tls, pParse) + + Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, r) + Xsqlite3VdbeAddOp4(tls, v, OP_Insert, iCur, regData, r, pTab, -6) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_ISNOOP)) + Xsqlite3ReleaseTempReg(tls, pParse, r) +} + // 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 @@ -103806,13 +105162,13 @@ __3: // // The arguments to this routine should be the same as the first six // arguments to sqlite3GenerateConstraintChecks. -func Xsqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, regNewData int32, aRegIdx uintptr, update_flags int32, appendBias int32, useSeekResult int32) { /* sqlite3.c:122839:21: */ +func Xsqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, regNewData int32, aRegIdx uintptr, update_flags int32, appendBias int32, useSeekResult int32) { /* sqlite3.c:124539:21: */ var v uintptr // Prepared statements under construction var pIdx uintptr // An index being inserted or updated var pik_flags U8 // flag values passed to the btree insert var i int32 // Loop counter - v = Xsqlite3GetVdbe(tls, pParse) + v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // This table is not a VIEW i = 0 @@ -103833,21 +105189,16 @@ __1: } pik_flags = func() uint8 { if useSeekResult != 0 { - return OPFLAG_USESEEKRESULT + return uint8(OPFLAG_USESEEKRESULT) } return uint8(0) }() - if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { pik_flags = U8(int32(pik_flags) | (OPFLAG_NCHANGE)) pik_flags = U8(int32(pik_flags) | (update_flags & OPFLAG_SAVEPOSITION)) if update_flags == 0 { - var r int32 = Xsqlite3GetTempReg(tls, pParse) - Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, r) - Xsqlite3VdbeAddOp4(tls, v, OP_Insert, - (iIdxCur + i), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), r, pTab, -6) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_ISNOOP) - Xsqlite3ReleaseTempReg(tls, pParse, r) + codeWithoutRowidPreupdate(tls, pParse, pTab, (iIdxCur + i), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4))) } } Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, (iIdxCur + i), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), @@ -103869,13 +105220,13 @@ __2: goto __3 __3: ; - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { return } if (*Parse)(unsafe.Pointer(pParse)).Fnested != 0 { pik_flags = U8(0) } else { - pik_flags = OPFLAG_NCHANGE + pik_flags = U8(OPFLAG_NCHANGE) pik_flags = U8(int32(pik_flags) | (func() int32 { if update_flags != 0 { return update_flags @@ -103915,7 +105266,7 @@ __3: // // If pTab is a virtual table, then this routine is a no-op and the // *piDataCur and *piIdxCur values are left uninitialized. -func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, p5 U8, iBase int32, aToOpen uintptr, piDataCur uintptr, piIdxCur uintptr) int32 { /* sqlite3.c:122936:20: */ +func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, p5 U8, iBase int32, aToOpen uintptr, piDataCur uintptr, piIdxCur uintptr) int32 { /* sqlite3.c:124628:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -103932,7 +105283,7 @@ func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op return 0 } iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema) - v = Xsqlite3GetVdbe(tls, pParse) + v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe if iBase < 0 { iBase = (*Parse)(unsafe.Pointer(pParse)).FnTab @@ -103941,7 +105292,7 @@ func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op if piDataCur != 0 { *(*int32)(unsafe.Pointer(piDataCur)) = iDataCur } - if (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((aToOpen == uintptr(0)) || (*(*U8)(unsafe.Pointer(aToOpen)) != 0)) { + if (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((aToOpen == uintptr(0)) || (*(*U8)(unsafe.Pointer(aToOpen)) != 0)) { Xsqlite3OpenTable(tls, pParse, iDataCur, iDb, pTab, op) } else { Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, (uint8(libc.Bool32(op == OP_OpenWrite))), (*Table)(unsafe.Pointer(pTab)).FzName) @@ -103958,7 +105309,7 @@ __1: { var iIdxCur int32 = libc.PostIncInt32(&iBase, 1) - if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { if piDataCur != 0 { *(*int32)(unsafe.Pointer(piDataCur)) = iIdxCur } @@ -103990,7 +105341,7 @@ __3: // transfer optimization is used. This is used for testing // purposes only - to make sure the transfer optimization really // is happening when it is supposed to. -var Xsqlite3_xferopt_count int32 /* sqlite3.c:122998:16: */ +var Xsqlite3_xferopt_count int32 /* sqlite3.c:124690:16: */ // Check to see if index pSrc is compatible as a source of data // for index pDest in an insert transfer optimization. The rules @@ -104001,7 +105352,7 @@ var Xsqlite3_xferopt_count int32 /* sqlite3.c:122998:16: */ // * 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 *libc.TLS, pDest uintptr, pSrc uintptr) int32 { /* sqlite3.c:123014:12: */ +func xferCompatibleIndex(tls *libc.TLS, pDest uintptr, pSrc uintptr) int32 { /* sqlite3.c:124706:12: */ var i int32 if (int32((*Index)(unsafe.Pointer(pDest)).FnKeyCol) != int32((*Index)(unsafe.Pointer(pSrc)).FnKeyCol)) || (int32((*Index)(unsafe.Pointer(pDest)).FnColumn) != int32((*Index)(unsafe.Pointer(pSrc)).FnColumn)) { @@ -104059,7 +105410,7 @@ func xferCompatibleIndex(tls *libc.TLS, pDest uintptr, pSrc uintptr) int32 { /* // is no chance that the xfer optimization can be applied. // // This optimization is particularly useful at making VACUUM run faster. -func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uintptr, onError int32, iDbDest int32) int32 { /* sqlite3.c:123075:12: */ +func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uintptr, onError int32, iDbDest int32) int32 { /* sqlite3.c:124767:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -104110,7 +105461,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint if (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSelect)).FpSrc)).FnSrc != 1 { return 0 // FROM clause must have exactly one term } - if (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpSrc + 8 /* &.a */))).FpSelect != 0 { + if (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpSrc + 8 /* &.a */))).FpSelect != 0 { return 0 // FROM clause cannot contain a subquery } if (*Select)(unsafe.Pointer(pSelect)).FpWhere != 0 { @@ -104130,7 +105481,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint if (*Select)(unsafe.Pointer(pSelect)).FpPrior != 0 { return 0 // SELECT may not be a compound query } - if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & SF_Distinct) != 0 { + if ((*Select)(unsafe.Pointer(pSelect)).FselFlags & U32(SF_Distinct)) != 0 { return 0 // SELECT may not be DISTINCT } pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList @@ -104155,7 +105506,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint // Possible due to bad sqlite_schema.rootpage return 0 // tab1 and tab2 may not be the same table } - if (libc.Bool32(((*Table)(unsafe.Pointer((pDest))).FtabFlags & TF_WithoutRowid) == U32(0))) != (libc.Bool32(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if (libc.Bool32(((*Table)(unsafe.Pointer((pDest))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) != (libc.Bool32(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { return 0 // source and destination must both be WITHOUT ROWID or not } if (*Table)(unsafe.Pointer(pSrc)).FnModuleArg != 0 { @@ -104248,7 +105599,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint // command, and the VACUUM command disables foreign key constraints. So // the extra complication to make this rule less restrictive is probably // not worth the effort. Ticket [6284df89debdfa61db8073e062908af0c9b6118e] - if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ForeignKeys) != uint64(0)) && ((*Table)(unsafe.Pointer(pDest)).FpFKey != uintptr(0)) { + if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ForeignKeys)) != uint64(0)) && ((*Table)(unsafe.Pointer(pDest)).FpFKey != uintptr(0)) { return 0 } if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0) { @@ -104266,10 +105617,11 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint iDest = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) regAutoinc = autoIncBegin(tls, pParse, iDbDest, pDest) regData = Xsqlite3GetTempReg(tls, pParse) + Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regData) regRowid = Xsqlite3GetTempReg(tls, pParse) Xsqlite3OpenTable(tls, pParse, iDest, iDbDest, pDest, OP_OpenWrite) - if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_Vacuum) == U32(0)) && ((((int32((*Table)(unsafe.Pointer(pDest)).FiPKey) < 0) && ((*Table)(unsafe.Pointer(pDest)).FpIndex != uintptr(0))) || // (1) + if (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0)) && ((((int32((*Table)(unsafe.Pointer(pDest)).FiPKey) < 0) && ((*Table)(unsafe.Pointer(pDest)).FpIndex != uintptr(0))) || // (1) (destHasUniqueIdx != 0)) || // (2) ((onError != OE_Abort) && (onError != OE_Rollback))) { // In some circumstances, we are able to run the xfer optimization @@ -104292,34 +105644,45 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint emptyDestTest = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) Xsqlite3VdbeJumpHere(tls, v, addr1) } - if ((*Table)(unsafe.Pointer((pSrc))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { var insFlags U8 Xsqlite3OpenTable(tls, pParse, iSrc, iDbSrc, pSrc, OP_OpenRead) emptySrcTest = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iSrc, 0) if int32((*Table)(unsafe.Pointer(pDest)).FiPKey) >= 0 { addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iSrc, regRowid) + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0) { - addr2 = Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDest, 0, regRowid) + addr2 = Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDest, 0, regRowid) - Xsqlite3RowidConstraint(tls, pParse, onError, pDest) - Xsqlite3VdbeJumpHere(tls, v, addr2) + Xsqlite3RowidConstraint(tls, pParse, onError, pDest) + Xsqlite3VdbeJumpHere(tls, v, addr2) + } autoIncStep(tls, pParse, regAutoinc, regRowid) - } else if ((*Table)(unsafe.Pointer(pDest)).FpIndex == uintptr(0)) && !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_VacuumInto) != 0) { + } else if ((*Table)(unsafe.Pointer(pDest)).FpIndex == uintptr(0)) && !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_VacuumInto)) != 0) { addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iDest, regRowid) } else { addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iSrc, regRowid) } - if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_Vacuum) != 0 { + + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) != 0 { Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iDest) - insFlags = (U8(OPFLAG_APPEND | OPFLAG_USESEEKRESULT)) + insFlags = (U8((OPFLAG_APPEND | OPFLAG_USESEEKRESULT) | OPFLAG_PREFORMAT)) } else { - insFlags = (U8((OPFLAG_NCHANGE | OPFLAG_LASTROWID) | OPFLAG_APPEND)) + insFlags = (U8(((OPFLAG_NCHANGE | OPFLAG_LASTROWID) | OPFLAG_APPEND) | OPFLAG_PREFORMAT)) + } + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0) { + Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1) + insFlags = libc.Uint8FromInt32(int32(insFlags) & (libc.CplInt32(OPFLAG_PREFORMAT))) + } else { + Xsqlite3VdbeAddOp3(tls, v, OP_RowCell, iDest, iSrc, regRowid) + } + Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iDest, regData, regRowid) + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0) { + Xsqlite3VdbeChangeP4(tls, v, -1, pDest, -6) } - Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1) - Xsqlite3VdbeAddOp4(tls, v, OP_Insert, iDest, regData, regRowid, - pDest, -6) Xsqlite3VdbeChangeP5(tls, v, uint16(insFlags)) + Xsqlite3VdbeAddOp2(tls, v, OP_Next, iSrc, addr1) Xsqlite3VdbeAddOp2(tls, v, OP_Close, iSrc, 0) Xsqlite3VdbeAddOp2(tls, v, OP_Close, iDest, 0) @@ -104340,10 +105703,10 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint Xsqlite3VdbeComment(tls, v, ts+824 /* "%s" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pSrcIdx)).FzName)) Xsqlite3VdbeAddOp3(tls, v, OP_OpenWrite, iDest, int32((*Index)(unsafe.Pointer(pDestIdx)).Ftnum), iDbDest) Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pDestIdx) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_BULKCSR) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_BULKCSR)) Xsqlite3VdbeComment(tls, v, ts+824 /* "%s" */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pDestIdx)).FzName)) addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iSrc, 0) - if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_Vacuum) != 0 { + if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) != 0 { // This INSERT command is part of a VACUUM operation, which guarantees // that the destination table is empty. If all indexed columns use // collation sequence BINARY, then it can also be assumed that the @@ -104365,13 +105728,21 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint } } if i == int32((*Index)(unsafe.Pointer(pSrcIdx)).FnColumn) { - idxInsFlags = OPFLAG_USESEEKRESULT + idxInsFlags = (U8(OPFLAG_USESEEKRESULT | OPFLAG_PREFORMAT)) Xsqlite3VdbeAddOp1(tls, v, OP_SeekEnd, iDest) + Xsqlite3VdbeAddOp2(tls, v, OP_RowCell, iDest, iSrc) } - } else if !(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer(pDestIdx + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + } else if !(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer(pDestIdx + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { idxInsFlags = U8(int32(idxInsFlags) | (OPFLAG_NCHANGE)) } - Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1) + if int32(idxInsFlags) != (OPFLAG_USESEEKRESULT | OPFLAG_PREFORMAT) { + Xsqlite3VdbeAddOp3(tls, v, OP_RowData, iSrc, regData, 1) + if ((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_Vacuum)) == U32(0)) && + !(((*Table)(unsafe.Pointer((pDest))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) && + ((int32(*(*uint16)(unsafe.Pointer((pDestIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + codeWithoutRowidPreupdate(tls, pParse, pDest, iDest, regData) + } + } Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, iDest, regData) Xsqlite3VdbeChangeP5(tls, v, (uint16(int32(idxInsFlags) | OPFLAG_APPEND))) Xsqlite3VdbeAddOp2(tls, v, OP_Next, iSrc, (addr1 + 1)) @@ -104423,7 +105794,7 @@ func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uint // 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 *libc.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_callback, pArg uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:123461:16: */ +func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_callback, pArg uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:125177:16: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -104444,7 +105815,7 @@ func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_ca if !(!(Xsqlite3SafetyCheckOk(tls, db) != 0)) { goto __1 } - return Xsqlite3MisuseError(tls, 123474) + return Xsqlite3MisuseError(tls, 125190) __1: ; if !(zSql == uintptr(0)) { @@ -104490,7 +105861,7 @@ __7: // Invoke the callback function if required if !((xCallback != 0) && ((SQLITE_ROW == rc) || (((SQLITE_DONE == rc) && !(callbackIsInit != 0)) && - (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_NullCallback) != 0)))) { + (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NullCallback)) != 0)))) { goto __9 } if !(!(callbackIsInit != 0)) { @@ -104631,7 +106002,7 @@ __26: // This is the function signature used for all extension entry points. It // is also defined in the file "loadext.c". -type Sqlite3_loadext_entry = uintptr /* sqlite3.c:123939:13 */ +type Sqlite3_loadext_entry = uintptr /* sqlite3.c:125657:13 */ // The following macros redefine the API routines so that they are // redirected through the global sqlite3_api structure. @@ -104951,7 +106322,9 @@ var sqlite3Apis = Sqlite3_api_routines{ Fcreate_filename: 0, Ffree_filename: 0, Fdatabase_file_object: 0, -} /* sqlite3.c:124371:35 */ + // Version 3.34.0 and later + Ftxn_state: 0, +} /* sqlite3.c:126091:35 */ // True if x is the directory separator character @@ -104965,7 +106338,7 @@ var sqlite3Apis = Sqlite3_api_routines{ // 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 *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:124741:12: */ +func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:126463:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -104990,9 +106363,9 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt // must call either sqlite3_enable_load_extension(db) or // sqlite3_db_config(db, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, 0) // to turn on extension loading. - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_LoadExtension) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_LoadExtension)) == uint64(0) { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+13234 /* "not authorized" */, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+13647 /* "not authorized" */, 0) } return SQLITE_ERROR } @@ -105000,12 +106373,12 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt if zProc != 0 { zEntry = zProc } else { - zEntry = ts + 16936 /* "sqlite3_extensio..." */ + zEntry = ts + 17361 /* "sqlite3_extensio..." */ } handle = Xsqlite3OsDlOpen(tls, pVfs, zFile) for ii = 0; (ii < (int32(uint64(unsafe.Sizeof(azEndings)) / uint64(unsafe.Sizeof(uintptr(0)))))) && (handle == uintptr(0)); ii++ { - var zAltFile uintptr = Xsqlite3_mprintf(tls, ts+9997 /* "%s.%s" */, libc.VaList(bp, zFile, azEndings[ii])) + var zAltFile uintptr = Xsqlite3_mprintf(tls, ts+10090 /* "%s.%s" */, libc.VaList(bp, zFile, azEndings[ii])) if zAltFile == uintptr(0) { return SQLITE_NOMEM } @@ -105017,7 +106390,7 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt *(*uintptr)(unsafe.Pointer(pzErrMsg)) = libc.AssignPtrUintptr(bp+48 /* zErrmsg */, Xsqlite3_malloc64(tls, nMsg)) if *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)) != 0 { Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)), - ts+16959 /* "unable to open s..." */, libc.VaList(bp+16, zFile)) + ts+17384 /* "unable to open s..." */, libc.VaList(bp+16, zFile)) Xsqlite3OsDlError(tls, pVfs, (int32(nMsg - uint64(1))), *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */))) } } @@ -105045,11 +106418,11 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt Xsqlite3OsDlClose(tls, pVfs, handle) return SQLITE_NOMEM } - libc.Xmemcpy(tls, zAltEntry, ts+16994 /* "sqlite3_" */, uint64(8)) + libc.Xmemcpy(tls, zAltEntry, ts+17419 /* "sqlite3_" */, uint64(8)) for iFile = (ncFile - 1); (iFile >= 0) && !((int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile))))) == '/'); iFile-- { } iFile++ - if Xsqlite3_strnicmp(tls, (zFile+uintptr(iFile)), ts+17003 /* "lib" */, 3) == 0 { + if Xsqlite3_strnicmp(tls, (zFile+uintptr(iFile)), ts+17428 /* "lib" */, 3) == 0 { iFile = iFile + (3) } for iEntry = 8; ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))))) != 0) && (c != '.'); iFile++ { @@ -105057,7 +106430,7 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt *(*int8)(unsafe.Pointer(zAltEntry + uintptr(libc.PostIncInt32(&iEntry, 1)))) = int8(Xsqlite3UpperToLower[uint32(c)]) } } - libc.Xmemcpy(tls, (zAltEntry + uintptr(iEntry)), ts+17007 /* "_init" */, uint64(6)) + libc.Xmemcpy(tls, (zAltEntry + uintptr(iEntry)), ts+17432 /* "_init" */, uint64(6)) zEntry = zAltEntry xInit = Xsqlite3OsDlSym(tls, pVfs, handle, zEntry) } @@ -105067,7 +106440,7 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt *(*uintptr)(unsafe.Pointer(pzErrMsg)) = libc.AssignPtrUintptr(bp+48 /* zErrmsg */, Xsqlite3_malloc64(tls, nMsg)) if *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)) != 0 { Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)), - ts+17013 /* "no entry point [..." */, libc.VaList(bp+24, zEntry, zFile)) + ts+17438 /* "no entry point [..." */, libc.VaList(bp+24, zEntry, zFile)) Xsqlite3OsDlError(tls, pVfs, (int32(nMsg - uint64(1))), *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */))) } } @@ -105082,7 +106455,7 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+17056 /* "error during ini..." */, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+17481 /* "error during ini..." */, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */))) Xsqlite3OsDlClose(tls, pVfs, handle) @@ -105105,10 +106478,10 @@ func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintpt } var azEndings = [1]uintptr{ - ts + 17088, /* "so" */ -} /* sqlite3.c:124759:21 */ + ts + 17513, /* "so" */ +} /* sqlite3.c:126481:21 */ -func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:124882:16: */ +func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:126604:16: */ var rc int32 Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) rc = sqlite3LoadExtension(tls, db, zFile, zProc, pzErrMsg) @@ -105119,7 +106492,7 @@ func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uin // Call this routine when the database connection is closing in order // to clean up loaded extensions -func Xsqlite3CloseExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:124900:21: */ +func Xsqlite3CloseExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:126622:21: */ var i int32 for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnExtension; i++ { @@ -105130,7 +106503,7 @@ func Xsqlite3CloseExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:124900:21 // 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 *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:124913:16: */ +func Xsqlite3_enable_load_extension(tls *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:126635:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if onoff != 0 { *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_LoadExtension | SQLITE_LoadExtFunc)) @@ -105150,15 +106523,15 @@ type sqlite3AutoExtList = struct { FnExt U32 _ [4]byte FaExt uintptr -} /* sqlite3.c:124933:9 */ +} /* sqlite3.c:126655:9 */ // The following object holds the list of automatically loaded // extensions. // // This list is shared across threads. The SQLITE_MUTEX_STATIC_MAIN // mutex must be held while accessing this list. -type Sqlite3AutoExtList = sqlite3AutoExtList /* sqlite3.c:124933:35 */ -var sqlite3Autoext = sqlite3AutoExtList{} /* sqlite3.c:124937:3 */ +type Sqlite3AutoExtList = sqlite3AutoExtList /* sqlite3.c:126655:35 */ +var sqlite3Autoext = sqlite3AutoExtList{} /* sqlite3.c:126659:3 */ // The "wsdAutoext" macro will resolve to the autoextension // state vector. If writable static data is unsupported on the target, @@ -105168,7 +106541,7 @@ var sqlite3Autoext = sqlite3AutoExtList{} /* sqlite3.c:124937:3 */ // Register a statically linked extension that is automatically // loaded by every new database connection. -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:124959:16: */ +func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:126681:16: */ var rc int32 = SQLITE_OK rc = Xsqlite3_initialize(tls) if rc != 0 { @@ -105209,7 +106582,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c: // // 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 *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:125006:16: */ +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:126728:16: */ var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN) var i int32 var n int32 = 0 @@ -105228,7 +106601,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sql } // Reset the automatic extension loading mechanism. -func Xsqlite3_reset_auto_extension(tls *libc.TLS) { /* sqlite3.c:125031:17: */ +func Xsqlite3_reset_auto_extension(tls *libc.TLS) { /* sqlite3.c:126753:17: */ if Xsqlite3_initialize(tls) == SQLITE_OK { var mutex uintptr = Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN) @@ -105243,7 +106616,7 @@ func Xsqlite3_reset_auto_extension(tls *libc.TLS) { /* sqlite3.c:125031:17: */ // Load all automatic extensions. // // If anything goes wrong, set an error in the database connection. -func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:125053:21: */ +func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:126775:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -105272,7 +106645,7 @@ func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:125053 *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */)) = uintptr(0) if (xInit != 0) && ((libc.AssignInt32(&rc, (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&xInit)))(tls, db, bp+8 /* &zErrmsg */, pThunk))) != 0) { Xsqlite3ErrorWithMsg(tls, db, rc, - ts+17091 /* "automatic extens..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */)))) + ts+17516 /* "automatic extens..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */))) @@ -105317,62 +106690,62 @@ func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:125053 // or that return single-column results where the name of the // result column is different from the name of the pragma var pragCName = [51]uintptr{ - /* 0 */ ts + 6773, /* "id" */ // Used by: foreign_key_list - /* 1 */ ts + 17130, /* "seq" */ - /* 2 */ ts + 8236, /* "table" */ - /* 3 */ ts + 17134, /* "from" */ - /* 4 */ ts + 17139, /* "to" */ - /* 5 */ ts + 17142, /* "on_update" */ - /* 6 */ ts + 17152, /* "on_delete" */ - /* 7 */ ts + 17162, /* "match" */ - /* 8 */ ts + 17168, /* "cid" */ // Used by: table_xinfo - /* 9 */ ts + 17172, /* "name" */ - /* 10 */ ts + 17177, /* "type" */ - /* 11 */ ts + 17182, /* "notnull" */ - /* 12 */ ts + 17190, /* "dflt_value" */ - /* 13 */ ts + 17201, /* "pk" */ - /* 14 */ ts + 17204, /* "hidden" */ + /* 0 */ ts + 6849, /* "id" */ // Used by: foreign_key_list + /* 1 */ ts + 17555, /* "seq" */ + /* 2 */ ts + 8329, /* "table" */ + /* 3 */ ts + 17559, /* "from" */ + /* 4 */ ts + 17564, /* "to" */ + /* 5 */ ts + 17567, /* "on_update" */ + /* 6 */ ts + 17577, /* "on_delete" */ + /* 7 */ ts + 17587, /* "match" */ + /* 8 */ ts + 17593, /* "cid" */ // Used by: table_xinfo + /* 9 */ ts + 17597, /* "name" */ + /* 10 */ ts + 17602, /* "type" */ + /* 11 */ ts + 17607, /* "notnull" */ + /* 12 */ ts + 17615, /* "dflt_value" */ + /* 13 */ ts + 17626, /* "pk" */ + /* 14 */ ts + 17629, /* "hidden" */ // table_info reuses 8 - /* 15 */ ts + 17211, /* "seqno" */ // Used by: index_xinfo - /* 16 */ ts + 17168, /* "cid" */ - /* 17 */ ts + 17172, /* "name" */ - /* 18 */ ts + 17217, /* "desc" */ - /* 19 */ ts + 17222, /* "coll" */ - /* 20 */ ts + 17227, /* "key" */ - /* 21 */ ts + 17172, /* "name" */ // Used by: function_list - /* 22 */ ts + 17231, /* "builtin" */ - /* 23 */ ts + 17177, /* "type" */ - /* 24 */ ts + 17239, /* "enc" */ - /* 25 */ ts + 17243, /* "narg" */ - /* 26 */ ts + 17248, /* "flags" */ - /* 27 */ ts + 12632, /* "tbl" */ // Used by: stats - /* 28 */ ts + 12628, /* "idx" */ - /* 29 */ ts + 17254, /* "wdth" */ - /* 30 */ ts + 17259, /* "hght" */ - /* 31 */ ts + 17264, /* "flgs" */ - /* 32 */ ts + 17130, /* "seq" */ // Used by: index_list - /* 33 */ ts + 17172, /* "name" */ - /* 34 */ ts + 17269, /* "unique" */ - /* 35 */ ts + 17276, /* "origin" */ - /* 36 */ ts + 17283, /* "partial" */ - /* 37 */ ts + 8236, /* "table" */ // Used by: foreign_key_check - /* 38 */ ts + 10064, /* "rowid" */ - /* 39 */ ts + 6776, /* "parent" */ - /* 40 */ ts + 17291, /* "fkid" */ + /* 15 */ ts + 17636, /* "seqno" */ // Used by: index_xinfo + /* 16 */ ts + 17593, /* "cid" */ + /* 17 */ ts + 17597, /* "name" */ + /* 18 */ ts + 17642, /* "desc" */ + /* 19 */ ts + 17647, /* "coll" */ + /* 20 */ ts + 17652, /* "key" */ + /* 21 */ ts + 17597, /* "name" */ // Used by: function_list + /* 22 */ ts + 17656, /* "builtin" */ + /* 23 */ ts + 17602, /* "type" */ + /* 24 */ ts + 17664, /* "enc" */ + /* 25 */ ts + 17668, /* "narg" */ + /* 26 */ ts + 17673, /* "flags" */ + /* 27 */ ts + 13045, /* "tbl" */ // Used by: stats + /* 28 */ ts + 13041, /* "idx" */ + /* 29 */ ts + 17679, /* "wdth" */ + /* 30 */ ts + 17684, /* "hght" */ + /* 31 */ ts + 17689, /* "flgs" */ + /* 32 */ ts + 17555, /* "seq" */ // Used by: index_list + /* 33 */ ts + 17597, /* "name" */ + /* 34 */ ts + 17694, /* "unique" */ + /* 35 */ ts + 17701, /* "origin" */ + /* 36 */ ts + 17708, /* "partial" */ + /* 37 */ ts + 8329, /* "table" */ // Used by: foreign_key_check + /* 38 */ ts + 10157, /* "rowid" */ + /* 39 */ ts + 6852, /* "parent" */ + /* 40 */ ts + 17716, /* "fkid" */ // index_info reuses 15 - /* 41 */ ts + 17130, /* "seq" */ // Used by: database_list - /* 42 */ ts + 17172, /* "name" */ - /* 43 */ ts + 17296, /* "file" */ - /* 44 */ ts + 17301, /* "busy" */ // Used by: wal_checkpoint - /* 45 */ ts + 17306, /* "log" */ - /* 46 */ ts + 17310, /* "checkpointed" */ + /* 41 */ ts + 17555, /* "seq" */ // Used by: database_list + /* 42 */ ts + 17597, /* "name" */ + /* 43 */ ts + 17721, /* "file" */ + /* 44 */ ts + 17726, /* "busy" */ // Used by: wal_checkpoint + /* 45 */ ts + 17731, /* "log" */ + /* 46 */ ts + 17735, /* "checkpointed" */ // collation_list reuses 32 - /* 47 */ ts + 17323, /* "database" */ // Used by: lock_status - /* 48 */ ts + 17332, /* "status" */ - /* 49 */ ts + 17339, /* "cache_size" */ // Used by: default_cache_size + /* 47 */ ts + 17748, /* "database" */ // Used by: lock_status + /* 48 */ ts + 17757, /* "status" */ + /* 49 */ ts + 17764, /* "cache_size" */ // Used by: default_cache_size // module_list pragma_list reuses 9 - /* 50 */ ts + 17350, /* "timeout" */ // Used by: busy_timeout -} /* sqlite3.c:125193:19 */ + /* 50 */ ts + 17775, /* "timeout" */ // Used by: busy_timeout +} /* sqlite3.c:126915:19 */ // Definitions of all built-in pragmas type PragmaName1 = struct { @@ -105383,247 +106756,247 @@ type PragmaName1 = struct { FnPragCName U8 _ [4]byte FiArg U64 -} /* sqlite3.c:125252:9 */ +} /* sqlite3.c:126974:9 */ // Definitions of all built-in pragmas -type PragmaName = PragmaName1 /* sqlite3.c:125259:3 */ +type PragmaName = PragmaName1 /* sqlite3.c:126981:3 */ var aPragmaName = [66]PragmaName{ - { /* zName: */ FzName: ts + 17358, /* "analysis_limit" */ - /* ePragTyp: */ FePragTyp: PragTyp_ANALYSIS_LIMIT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, - { /* zName: */ FzName: ts + 17373, /* "application_id" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + { /* zName: */ FzName: ts + 17783, /* "analysis_limit" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_ANALYSIS_LIMIT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, + { /* zName: */ FzName: ts + 17798, /* "application_id" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_APPLICATION_ID}, - { /* zName: */ FzName: ts + 17388, /* "auto_vacuum" */ - /* ePragTyp: */ FePragTyp: PragTyp_AUTO_VACUUM, + /* iArg: */ FiArg: uint64(BTREE_APPLICATION_ID)}, + { /* zName: */ FzName: ts + 17813, /* "auto_vacuum" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_AUTO_VACUUM), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 17400, /* "automatic_index" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 17825, /* "automatic_index" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_AutoIndex}, - { /* zName: */ FzName: ts + 17416, /* "busy_timeout" */ - /* ePragTyp: */ FePragTyp: PragTyp_BUSY_TIMEOUT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* iArg: */ FiArg: uint64(SQLITE_AutoIndex)}, + { /* zName: */ FzName: ts + 17841, /* "busy_timeout" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_BUSY_TIMEOUT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(50), FnPragCName: U8(1)}, - { /* zName: */ FzName: ts + 17339, /* "cache_size" */ - /* ePragTyp: */ FePragTyp: PragTyp_CACHE_SIZE, + { /* zName: */ FzName: ts + 17764, /* "cache_size" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_CACHE_SIZE), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 17429, /* "cache_spill" */ - /* ePragTyp: */ FePragTyp: PragTyp_CACHE_SPILL, + { /* zName: */ FzName: ts + 17854, /* "cache_spill" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_CACHE_SPILL), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_Result0 | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 17441, /* "case_sensitive_l..." */ - /* ePragTyp: */ FePragTyp: PragTyp_CASE_SENSITIVE_LIKE, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns}, - { /* zName: */ FzName: ts + 17461, /* "cell_size_check" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 17866, /* "case_sensitive_l..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_CASE_SENSITIVE_LIKE), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns)}, + { /* zName: */ FzName: ts + 17886, /* "cell_size_check" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_CellSizeCk}, - { /* zName: */ FzName: ts + 17477, /* "checkpoint_fullf..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* iArg: */ FiArg: uint64(SQLITE_CellSizeCk)}, + { /* zName: */ FzName: ts + 17902, /* "checkpoint_fullf..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_CkptFullFSync}, - { /* zName: */ FzName: ts + 17498, /* "collation_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_COLLATION_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* iArg: */ FiArg: uint64(SQLITE_CkptFullFSync)}, + { /* zName: */ FzName: ts + 17923, /* "collation_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_COLLATION_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(32), FnPragCName: U8(2)}, - { /* zName: */ FzName: ts + 17513, /* "compile_options" */ - /* ePragTyp: */ FePragTyp: PragTyp_COMPILE_OPTIONS, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, - { /* zName: */ FzName: ts + 17529, /* "count_changes" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 17938, /* "compile_options" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_COMPILE_OPTIONS), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, + { /* zName: */ FzName: ts + 17954, /* "count_changes" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), /* iArg: */ FiArg: (U64((uint64(0x00001))) << 32)}, - { /* zName: */ FzName: ts + 17543, /* "data_version" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + { /* zName: */ FzName: ts + 17968, /* "data_version" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_ReadOnly | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_DATA_VERSION}, - { /* zName: */ FzName: ts + 17556, /* "database_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_DATABASE_LIST, + /* iArg: */ FiArg: uint64(BTREE_DATA_VERSION)}, + { /* zName: */ FzName: ts + 17981, /* "database_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_DATABASE_LIST), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NeedSchema | PragFlg_Result0)), /* ColNames: */ FiPragCName: U8(41), FnPragCName: U8(3)}, - { /* zName: */ FzName: ts + 17570, /* "default_cache_si..." */ - /* ePragTyp: */ FePragTyp: PragTyp_DEFAULT_CACHE_SIZE, + { /* zName: */ FzName: ts + 17995, /* "default_cache_si..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_DEFAULT_CACHE_SIZE), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1)), /* ColNames: */ FiPragCName: U8(49), FnPragCName: U8(1)}, - { /* zName: */ FzName: ts + 17589, /* "defer_foreign_ke..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 18014, /* "defer_foreign_ke..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_DeferFKs}, - { /* zName: */ FzName: ts + 17608, /* "empty_result_cal..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* iArg: */ FiArg: uint64(SQLITE_DeferFKs)}, + { /* zName: */ FzName: ts + 18033, /* "empty_result_cal..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_NullCallback}, - { /* zName: */ FzName: ts + 17631, /* "encoding" */ - /* ePragTyp: */ FePragTyp: PragTyp_ENCODING, + /* iArg: */ FiArg: uint64(SQLITE_NullCallback)}, + { /* zName: */ FzName: ts + 18056, /* "encoding" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_ENCODING), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 17640, /* "foreign_key_chec..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FOREIGN_KEY_CHECK, + { /* zName: */ FzName: ts + 18065, /* "foreign_key_chec..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FOREIGN_KEY_CHECK), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(37), FnPragCName: U8(4)}, - { /* zName: */ FzName: ts + 17658, /* "foreign_key_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_FOREIGN_KEY_LIST, + { /* zName: */ FzName: ts + 18083, /* "foreign_key_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FOREIGN_KEY_LIST), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), FnPragCName: U8(8)}, - { /* zName: */ FzName: ts + 17675, /* "foreign_keys" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 18100, /* "foreign_keys" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ForeignKeys}, - { /* zName: */ FzName: ts + 17688, /* "freelist_count" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* iArg: */ FiArg: uint64(SQLITE_ForeignKeys)}, + { /* zName: */ FzName: ts + 18113, /* "freelist_count" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_ReadOnly | PragFlg_Result0))}, - { /* zName: */ FzName: ts + 17703, /* "full_column_name..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 18128, /* "full_column_name..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_FullColNames}, - { /* zName: */ FzName: ts + 17721, /* "fullfsync" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* iArg: */ FiArg: uint64(SQLITE_FullColNames)}, + { /* zName: */ FzName: ts + 18146, /* "fullfsync" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_FullFSync}, - { /* zName: */ FzName: ts + 17731, /* "function_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_FUNCTION_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* iArg: */ FiArg: uint64(SQLITE_FullFSync)}, + { /* zName: */ FzName: ts + 18156, /* "function_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FUNCTION_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(21), FnPragCName: U8(6)}, - { /* zName: */ FzName: ts + 17745, /* "hard_heap_limit" */ - /* ePragTyp: */ FePragTyp: PragTyp_HARD_HEAP_LIMIT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, - { /* zName: */ FzName: ts + 17761, /* "ignore_check_con..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 18170, /* "hard_heap_limit" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_HARD_HEAP_LIMIT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, + { /* zName: */ FzName: ts + 18186, /* "ignore_check_con..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_IgnoreChecks}, - { /* zName: */ FzName: ts + 17786, /* "incremental_vacu..." */ - /* ePragTyp: */ FePragTyp: PragTyp_INCREMENTAL_VACUUM, + /* iArg: */ FiArg: uint64(SQLITE_IgnoreChecks)}, + { /* zName: */ FzName: ts + 18211, /* "incremental_vacu..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_INCREMENTAL_VACUUM), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NeedSchema | PragFlg_NoColumns))}, - { /* zName: */ FzName: ts + 17805, /* "index_info" */ - /* ePragTyp: */ FePragTyp: PragTyp_INDEX_INFO, + { /* zName: */ FzName: ts + 18230, /* "index_info" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(15), FnPragCName: U8(3)}, - { /* zName: */ FzName: ts + 17816, /* "index_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_INDEX_LIST, + { /* zName: */ FzName: ts + 18241, /* "index_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_LIST), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(32), FnPragCName: U8(5)}, - { /* zName: */ FzName: ts + 17827, /* "index_xinfo" */ - /* ePragTyp: */ FePragTyp: PragTyp_INDEX_INFO, + { /* zName: */ FzName: ts + 18252, /* "index_xinfo" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_INDEX_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(15), FnPragCName: U8(6), /* iArg: */ FiArg: uint64(1)}, - { /* zName: */ FzName: ts + 17839, /* "integrity_check" */ - /* ePragTyp: */ FePragTyp: PragTyp_INTEGRITY_CHECK, + { /* zName: */ FzName: ts + 18264, /* "integrity_check" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_INTEGRITY_CHECK), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1))}, - { /* zName: */ FzName: ts + 17855, /* "journal_mode" */ - /* ePragTyp: */ FePragTyp: PragTyp_JOURNAL_MODE, + { /* zName: */ FzName: ts + 18280, /* "journal_mode" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_JOURNAL_MODE), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))}, - { /* zName: */ FzName: ts + 17868, /* "journal_size_lim..." */ - /* ePragTyp: */ FePragTyp: PragTyp_JOURNAL_SIZE_LIMIT, + { /* zName: */ FzName: ts + 18293, /* "journal_size_lim..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_JOURNAL_SIZE_LIMIT), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_SchemaReq))}, - { /* zName: */ FzName: ts + 17887, /* "legacy_alter_tab..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 18312, /* "legacy_alter_tab..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_LegacyAlter}, - { /* zName: */ FzName: ts + 17906, /* "lock_status" */ - /* ePragTyp: */ FePragTyp: PragTyp_LOCK_STATUS, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + /* iArg: */ FiArg: uint64(SQLITE_LegacyAlter)}, + { /* zName: */ FzName: ts + 18331, /* "lock_status" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_LOCK_STATUS), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(47), FnPragCName: U8(2)}, - { /* zName: */ FzName: ts + 17918, /* "locking_mode" */ - /* ePragTyp: */ FePragTyp: PragTyp_LOCKING_MODE, + { /* zName: */ FzName: ts + 18343, /* "locking_mode" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_LOCKING_MODE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_SchemaReq))}, - { /* zName: */ FzName: ts + 17931, /* "max_page_count" */ - /* ePragTyp: */ FePragTyp: PragTyp_PAGE_COUNT, + { /* zName: */ FzName: ts + 18356, /* "max_page_count" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_COUNT), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))}, - { /* zName: */ FzName: ts + 17946, /* "mmap_size" */ - /* ePragTyp: */ FePragTyp: PragTyp_MMAP_SIZE}, - { /* zName: */ FzName: ts + 17956, /* "module_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_MODULE_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + { /* zName: */ FzName: ts + 18371, /* "mmap_size" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_MMAP_SIZE)}, + { /* zName: */ FzName: ts + 18381, /* "module_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_MODULE_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(9), FnPragCName: U8(1)}, - { /* zName: */ FzName: ts + 17968, /* "optimize" */ - /* ePragTyp: */ FePragTyp: PragTyp_OPTIMIZE, + { /* zName: */ FzName: ts + 18393, /* "optimize" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_OPTIMIZE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result1 | PragFlg_NeedSchema))}, - { /* zName: */ FzName: ts + 17977, /* "page_count" */ - /* ePragTyp: */ FePragTyp: PragTyp_PAGE_COUNT, + { /* zName: */ FzName: ts + 18402, /* "page_count" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_COUNT), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq))}, - { /* zName: */ FzName: ts + 17988, /* "page_size" */ - /* ePragTyp: */ FePragTyp: PragTyp_PAGE_SIZE, + { /* zName: */ FzName: ts + 18413, /* "page_size" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_PAGE_SIZE), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_Result0 | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 17998, /* "pragma_list" */ - /* ePragTyp: */ FePragTyp: PragTyp_PRAGMA_LIST, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0, + { /* zName: */ FzName: ts + 18423, /* "pragma_list" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_PRAGMA_LIST), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0), /* ColNames: */ FiPragCName: U8(9), FnPragCName: U8(1)}, - { /* zName: */ FzName: ts + 18010, /* "query_only" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 18435, /* "query_only" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_QueryOnly}, - { /* zName: */ FzName: ts + 18021, /* "quick_check" */ - /* ePragTyp: */ FePragTyp: PragTyp_INTEGRITY_CHECK, + /* iArg: */ FiArg: uint64(SQLITE_QueryOnly)}, + { /* zName: */ FzName: ts + 18446, /* "quick_check" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_INTEGRITY_CHECK), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_Result1))}, - { /* zName: */ FzName: ts + 18033, /* "read_uncommitted" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 18458, /* "read_uncommitted" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ReadUncommit}, - { /* zName: */ FzName: ts + 18050, /* "recursive_trigge..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* iArg: */ FiArg: uint64(SQLITE_ReadUncommit)}, + { /* zName: */ FzName: ts + 18475, /* "recursive_trigge..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_RecTriggers}, - { /* zName: */ FzName: ts + 18069, /* "reverse_unordere..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* iArg: */ FiArg: uint64(SQLITE_RecTriggers)}, + { /* zName: */ FzName: ts + 18494, /* "reverse_unordere..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ReverseOrder}, - { /* zName: */ FzName: ts + 18095, /* "schema_version" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* iArg: */ FiArg: uint64(SQLITE_ReverseOrder)}, + { /* zName: */ FzName: ts + 18520, /* "schema_version" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_SCHEMA_VERSION}, - { /* zName: */ FzName: ts + 18110, /* "secure_delete" */ - /* ePragTyp: */ FePragTyp: PragTyp_SECURE_DELETE, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, - { /* zName: */ FzName: ts + 18124, /* "short_column_nam..." */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + /* iArg: */ FiArg: uint64(BTREE_SCHEMA_VERSION)}, + { /* zName: */ FzName: ts + 18535, /* "secure_delete" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_SECURE_DELETE), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, + { /* zName: */ FzName: ts + 18549, /* "short_column_nam..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_ShortColNames}, - { /* zName: */ FzName: ts + 18143, /* "shrink_memory" */ - /* ePragTyp: */ FePragTyp: PragTyp_SHRINK_MEMORY, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns}, - { /* zName: */ FzName: ts + 18157, /* "soft_heap_limit" */ - /* ePragTyp: */ FePragTyp: PragTyp_SOFT_HEAP_LIMIT, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, - { /* zName: */ FzName: ts + 18173, /* "synchronous" */ - /* ePragTyp: */ FePragTyp: PragTyp_SYNCHRONOUS, + /* iArg: */ FiArg: uint64(SQLITE_ShortColNames)}, + { /* zName: */ FzName: ts + 18568, /* "shrink_memory" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_SHRINK_MEMORY), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns)}, + { /* zName: */ FzName: ts + 18582, /* "soft_heap_limit" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_SOFT_HEAP_LIMIT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, + { /* zName: */ FzName: ts + 18598, /* "synchronous" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_SYNCHRONOUS), /* ePragFlg: */ FmPragFlg: (U8(((PragFlg_NeedSchema | PragFlg_Result0) | PragFlg_SchemaReq) | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 18185, /* "table_info" */ - /* ePragTyp: */ FePragTyp: PragTyp_TABLE_INFO, + { /* zName: */ FzName: ts + 18610, /* "table_info" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_TABLE_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(8), FnPragCName: U8(6)}, - { /* zName: */ FzName: ts + 18196, /* "table_xinfo" */ - /* ePragTyp: */ FePragTyp: PragTyp_TABLE_INFO, + { /* zName: */ FzName: ts + 18621, /* "table_xinfo" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_TABLE_INFO), /* ePragFlg: */ FmPragFlg: (U8((PragFlg_NeedSchema | PragFlg_Result1) | PragFlg_SchemaOpt)), /* ColNames: */ FiPragCName: U8(8), FnPragCName: U8(7), /* iArg: */ FiArg: uint64(1)}, - { /* zName: */ FzName: ts + 18208, /* "temp_store" */ - /* ePragTyp: */ FePragTyp: PragTyp_TEMP_STORE, + { /* zName: */ FzName: ts + 18633, /* "temp_store" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_TEMP_STORE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1))}, - { /* zName: */ FzName: ts + 18219, /* "temp_store_direc..." */ - /* ePragTyp: */ FePragTyp: PragTyp_TEMP_STORE_DIRECTORY, - /* ePragFlg: */ FmPragFlg: PragFlg_NoColumns1}, - { /* zName: */ FzName: ts + 18240, /* "threads" */ - /* ePragTyp: */ FePragTyp: PragTyp_THREADS, - /* ePragFlg: */ FmPragFlg: PragFlg_Result0}, - { /* zName: */ FzName: ts + 18248, /* "trusted_schema" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 18644, /* "temp_store_direc..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_TEMP_STORE_DIRECTORY), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NoColumns1)}, + { /* zName: */ FzName: ts + 18665, /* "threads" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_THREADS), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_Result0)}, + { /* zName: */ FzName: ts + 18673, /* "trusted_schema" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), - /* iArg: */ FiArg: SQLITE_TrustedSchema}, - { /* zName: */ FzName: ts + 18263, /* "user_version" */ - /* ePragTyp: */ FePragTyp: PragTyp_HEADER_VALUE, + /* iArg: */ FiArg: uint64(SQLITE_TrustedSchema)}, + { /* zName: */ FzName: ts + 18688, /* "user_version" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_HEADER_VALUE), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_NoColumns1 | PragFlg_Result0)), - /* iArg: */ FiArg: BTREE_USER_VERSION}, - { /* zName: */ FzName: ts + 18276, /* "wal_autocheckpoi..." */ - /* ePragTyp: */ FePragTyp: PragTyp_WAL_AUTOCHECKPOINT}, - { /* zName: */ FzName: ts + 18295, /* "wal_checkpoint" */ - /* ePragTyp: */ FePragTyp: PragTyp_WAL_CHECKPOINT, - /* ePragFlg: */ FmPragFlg: PragFlg_NeedSchema, + /* iArg: */ FiArg: uint64(BTREE_USER_VERSION)}, + { /* zName: */ FzName: ts + 18701, /* "wal_autocheckpoi..." */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_WAL_AUTOCHECKPOINT)}, + { /* zName: */ FzName: ts + 18720, /* "wal_checkpoint" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_WAL_CHECKPOINT), + /* ePragFlg: */ FmPragFlg: U8(PragFlg_NeedSchema), /* ColNames: */ FiPragCName: U8(44), FnPragCName: U8(3)}, - { /* zName: */ FzName: ts + 18310, /* "writable_schema" */ - /* ePragTyp: */ FePragTyp: PragTyp_FLAG, + { /* zName: */ FzName: ts + 18735, /* "writable_schema" */ + /* ePragTyp: */ FePragTyp: U8(PragTyp_FLAG), /* ePragFlg: */ FmPragFlg: (U8(PragFlg_Result0 | PragFlg_NoColumns1)), /* iArg: */ FiArg: (uint64(SQLITE_WriteSchema | SQLITE_NoSchemaError))}, -} /* sqlite3.c:125260:25 */ +} /* sqlite3.c:126982:25 */ // Number of pragmas: 67 on by default, 77 total. @@ -105639,7 +107012,7 @@ var aPragmaName = [66]PragmaName{ // 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 *libc.TLS, z uintptr, omitFull int32, dflt U8) U8 { /* sqlite3.c:125789:11: */ +func getSafetyLevel(tls *libc.TLS, z uintptr, omitFull int32, dflt U8) U8 { /* sqlite3.c:127511:11: */ // on no off false yes true extra full var i int32 var n int32 @@ -105656,13 +107029,13 @@ func getSafetyLevel(tls *libc.TLS, z uintptr, omitFull int32, dflt U8) U8 { /* s return dflt } -var zText = *(*[25]int8)(unsafe.Pointer(ts + 18326 /* "onoffalseyestrue..." */)) /* sqlite3.c:125791:21 */ -var iOffset = [8]U8{U8(0), U8(1), U8(2), U8(4), U8(9), U8(12), U8(15), U8(20)} /* sqlite3.c:125792:19 */ -var iLength = [8]U8{U8(2), U8(2), U8(3), U8(5), U8(3), U8(4), U8(5), U8(4)} /* sqlite3.c:125793:19 */ -var iValue = [8]U8{U8(1), U8(0), U8(0), U8(0), U8(1), U8(1), U8(3), U8(2)} /* sqlite3.c:125794:19 */ +var zText = *(*[25]int8)(unsafe.Pointer(ts + 18751 /* "onoffalseyestrue..." */)) /* sqlite3.c:127513:21 */ +var iOffset = [8]U8{U8(0), U8(1), U8(2), U8(4), U8(9), U8(12), U8(15), U8(20)} /* sqlite3.c:127514:19 */ +var iLength = [8]U8{U8(2), U8(2), U8(3), U8(5), U8(3), U8(4), U8(5), U8(4)} /* sqlite3.c:127515:19 */ +var iValue = [8]U8{U8(1), U8(0), U8(0), U8(0), U8(1), U8(1), U8(3), U8(2)} /* sqlite3.c:127516:19 */ // Interpret the given string as a boolean value. -func Xsqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt U8) U8 { /* sqlite3.c:125814:19: */ +func Xsqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt U8) U8 { /* sqlite3.c:127536:19: */ return (U8(libc.Bool32(int32(getSafetyLevel(tls, z, 1, dflt)) != 0))) } @@ -105671,12 +107044,12 @@ func Xsqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt U8) U8 { /* sqlite3.c:125 // the rest of the file if PRAGMAs are omitted from the build. // Interpret the given string as a locking mode value. -func getLockingMode(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:125827:12: */ +func getLockingMode(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:127549:12: */ if z != 0 { - if 0 == Xsqlite3StrICmp(tls, z, ts+18351 /* "exclusive" */) { + if 0 == Xsqlite3StrICmp(tls, z, ts+18776 /* "exclusive" */) { return PAGER_LOCKINGMODE_EXCLUSIVE } - if 0 == Xsqlite3StrICmp(tls, z, ts+18361 /* "normal" */) { + if 0 == Xsqlite3StrICmp(tls, z, ts+18786 /* "normal" */) { return PAGER_LOCKINGMODE_NORMAL } } @@ -105687,15 +107060,15 @@ func getLockingMode(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:125827:12: */ // // The following strings, "none", "full" and "incremental" are // acceptable, as are their numeric equivalents: 0, 1 and 2 respectively. -func getAutoVacuum(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:125842:12: */ +func getAutoVacuum(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:127564:12: */ var i int32 - if 0 == Xsqlite3StrICmp(tls, z, ts+18368 /* "none" */) { + if 0 == Xsqlite3StrICmp(tls, z, ts+18793 /* "none" */) { return BTREE_AUTOVACUUM_NONE } - if 0 == Xsqlite3StrICmp(tls, z, ts+18373 /* "full" */) { + if 0 == Xsqlite3StrICmp(tls, z, ts+18798 /* "full" */) { return BTREE_AUTOVACUUM_FULL } - if 0 == Xsqlite3StrICmp(tls, z, ts+18378 /* "incremental" */) { + if 0 == Xsqlite3StrICmp(tls, z, ts+18803 /* "incremental" */) { return BTREE_AUTOVACUUM_INCR } i = Xsqlite3Atoi(tls, z) @@ -105710,12 +107083,12 @@ func getAutoVacuum(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:125842:12: */ // 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 *libc.TLS, z uintptr) int32 { /* sqlite3.c:125858:12: */ +func getTempStore(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:127580:12: */ if (int32(*(*int8)(unsafe.Pointer(z))) >= '0') && (int32(*(*int8)(unsafe.Pointer(z))) <= '2') { return (int32(*(*int8)(unsafe.Pointer(z))) - '0') - } else if Xsqlite3StrICmp(tls, z, ts+17296 /* "file" */) == 0 { + } else if Xsqlite3StrICmp(tls, z, ts+17721 /* "file" */) == 0 { return 1 - } else if Xsqlite3StrICmp(tls, z, ts+18390 /* "memory" */) == 0 { + } else if Xsqlite3StrICmp(tls, z, ts+18815 /* "memory" */) == 0 { return 2 } else { return 0 @@ -105725,12 +107098,13 @@ func getTempStore(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:125858:12: */ // 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 *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:125876:12: */ +func invalidateTempStorage(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:127598:12: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpBt != uintptr(0) { - if !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) || (Xsqlite3BtreeIsInReadTrans(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpBt) != 0) { + if !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) || + (Xsqlite3BtreeTxnState(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpBt) != SQLITE_TXN_NONE) { Xsqlite3ErrorMsg(tls, pParse, - ts+18397 /* "temporary storag..." */, 0) + ts+18822 /* "temporary storag..." */, 0) return SQLITE_ERROR } Xsqlite3BtreeClose(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpBt) @@ -105743,7 +107117,7 @@ func invalidateTempStorage(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:1 // 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 *libc.TLS, pParse uintptr, zStorageType uintptr) int32 { /* sqlite3.c:125898:12: */ +func changeTempStorage(tls *libc.TLS, pParse uintptr, zStorageType uintptr) int32 { /* sqlite3.c:127622:12: */ var ts int32 = getTempStore(tls, zStorageType) var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == ts { @@ -105757,7 +107131,7 @@ func changeTempStorage(tls *libc.TLS, pParse uintptr, zStorageType uintptr) int3 } // Set result column names for a pragma. -func setPragmaResultColumnNames(tls *libc.TLS, v uintptr, pPragma uintptr) { /* sqlite3.c:125913:13: */ +func setPragmaResultColumnNames(tls *libc.TLS, v uintptr, pPragma uintptr) { /* sqlite3.c:127637:13: */ var n U8 = (*PragmaName)(unsafe.Pointer(pPragma)).FnPragCName Xsqlite3VdbeSetNumCols(tls, v, func() int32 { if int32(n) == 0 { @@ -105791,7 +107165,7 @@ func setPragmaResultColumnNames(tls *libc.TLS, v uintptr, pPragma uintptr) { /* } // Generate code to return a single integer value. -func returnSingleInt(tls *libc.TLS, v uintptr, value I64) { /* sqlite3.c:125932:13: */ +func returnSingleInt(tls *libc.TLS, v uintptr, value I64) { /* sqlite3.c:127656:13: */ bp := tls.Alloc(8) defer tls.Free(8) *(*I64)(unsafe.Pointer(bp)) = value @@ -105801,7 +107175,7 @@ func returnSingleInt(tls *libc.TLS, v uintptr, value I64) { /* sqlite3.c:125932: } // Generate code to return a single text value. -func returnSingleText(tls *libc.TLS, v uintptr, zValue uintptr) { /* sqlite3.c:125940:13: */ +func returnSingleText(tls *libc.TLS, v uintptr, zValue uintptr) { /* sqlite3.c:127664:13: */ if zValue != 0 { Xsqlite3VdbeLoadString(tls, v, 1, zValue) Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 1, 1) @@ -105810,7 +107184,7 @@ func returnSingleText(tls *libc.TLS, v uintptr, zValue uintptr) { /* sqlite3.c:1 // Set the safety_level and pager flags for pager iDb. Or if iDb<0 // set these values for all pagers. -func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:125956:13: */ +func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:127680:13: */ if (*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0 { var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb var n int32 = (*Sqlite3)(unsafe.Pointer(db)).FnDb @@ -105818,7 +107192,7 @@ func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:125956:13: */ for (libc.PostDecInt32(&n, 1)) > 0 { if (*Db)(unsafe.Pointer(pDb)).FpBt != 0 { Xsqlite3BtreeSetPagerFlags(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, - (uint32(U64((*Db)(unsafe.Pointer(pDb)).Fsafety_level) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & PAGER_FLAGS_MASK)))) + (uint32(U64((*Db)(unsafe.Pointer(pDb)).Fsafety_level) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(PAGER_FLAGS_MASK))))) } pDb += 32 } @@ -105826,23 +107200,23 @@ func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:125956:13: */ } // Return a human-readable name for a constraint resolution action. -func actionName(tls *libc.TLS, action U8) uintptr { /* sqlite3.c:125984:19: */ +func actionName(tls *libc.TLS, action U8) uintptr { /* sqlite3.c:127708:19: */ var zName uintptr switch int32(action) { case OE_SetNull: - zName = ts + 18459 /* "SET NULL" */ + zName = ts + 18884 /* "SET NULL" */ break case OE_SetDflt: - zName = ts + 18468 /* "SET DEFAULT" */ + zName = ts + 18893 /* "SET DEFAULT" */ break case OE_Cascade: - zName = ts + 18480 /* "CASCADE" */ + zName = ts + 18905 /* "CASCADE" */ break case OE_Restrict: - zName = ts + 18488 /* "RESTRICT" */ + zName = ts + 18913 /* "RESTRICT" */ break default: - zName = ts + 18497 /* "NO ACTION" */ + zName = ts + 18922 /* "NO ACTION" */ break } return zName @@ -105851,7 +107225,7 @@ func actionName(tls *libc.TLS, action U8) uintptr { /* sqlite3.c:125984:19: */ // 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 Xsqlite3JournalModename(tls *libc.TLS, eMode int32) uintptr { /* sqlite3.c:126004:27: */ +func Xsqlite3JournalModename(tls *libc.TLS, eMode int32) uintptr { /* sqlite3.c:127728:27: */ if eMode == (int32(uint64(unsafe.Sizeof(azModeName)) / uint64(unsafe.Sizeof(uintptr(0))))) { return uintptr(0) @@ -105860,11 +107234,11 @@ func Xsqlite3JournalModename(tls *libc.TLS, eMode int32) uintptr { /* sqlite3.c: } var azModeName = [6]uintptr{ - ts + 18507 /* "delete" */, ts + 18514 /* "persist" */, ts + 18522 /* "off" */, ts + 18526 /* "truncate" */, ts + 18390 /* "memory" */, ts + 18535, /* "wal" */ -} /* sqlite3.c:126005:15 */ + ts + 18932 /* "delete" */, ts + 18939 /* "persist" */, ts + 18947 /* "off" */, ts + 18951 /* "truncate" */, ts + 18815 /* "memory" */, ts + 18960, /* "wal" */ +} /* sqlite3.c:127729:15 */ // Locate a pragma in the aPragmaName[] array. -func pragmaLocate(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:126026:25: */ +func pragmaLocate(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:127750:25: */ var upr int32 var lwr int32 var mid int32 = 0 @@ -105891,7 +107265,7 @@ func pragmaLocate(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:126026:25 // Create zero or more entries in the output for the SQL functions // defined by FuncDef p. -func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, showInternFuncs int32) { /* sqlite3.c:126047:13: */ +func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, showInternFuncs int32) { /* sqlite3.c:127771:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -105901,34 +107275,34 @@ func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, sh if (*FuncDef)(unsafe.Pointer(p)).FxSFunc == uintptr(0) { continue } - if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_INTERNAL) != U32(0)) && + if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_INTERNAL)) != U32(0)) && (showInternFuncs == 0) { continue } if (*FuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = ts + 18539 /* "w" */ + zType = ts + 18964 /* "w" */ } else if (*FuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = ts + 18541 /* "a" */ + zType = ts + 18966 /* "a" */ } else { - zType = ts + 18543 /* "s" */ + zType = ts + 18968 /* "s" */ } - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18545, /* "sissii" */ + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18970, /* "sissii" */ libc.VaList(bp, (*FuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, - zType, azEnc[((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&SQLITE_FUNC_ENCMASK)], + zType, azEnc[((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(SQLITE_FUNC_ENCMASK))], int32((*FuncDef)(unsafe.Pointer(p)).FnArg), - (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&mask)^SQLITE_INNOCUOUS))) + (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&mask)^U32(SQLITE_INNOCUOUS)))) } } -var mask U32 = (U32((((SQLITE_DETERMINISTIC | SQLITE_DIRECTONLY) | SQLITE_SUBTYPE) | SQLITE_INNOCUOUS) | SQLITE_FUNC_INTERNAL)) /* sqlite3.c:126055:22 */ -var azEnc = [4]uintptr{uintptr(0), ts + 18552 /* "utf8" */, ts + 18557 /* "utf16le" */, ts + 18565 /* "utf16be" */} /* sqlite3.c:126062:23 */ +var mask U32 = (U32((((SQLITE_DETERMINISTIC | SQLITE_DIRECTONLY) | SQLITE_SUBTYPE) | SQLITE_INNOCUOUS) | SQLITE_FUNC_INTERNAL)) /* sqlite3.c:127779:22 */ +var azEnc = [4]uintptr{uintptr(0), ts + 18977 /* "utf8" */, ts + 18982 /* "utf16le" */, ts + 18990 /* "utf16be" */} /* sqlite3.c:127786:23 */ // Helper subroutine for PRAGMA integrity_check: // // Generate code to output a single-column result row with a value of the // string held in register 3. Decrement the result count in register 1 // and halt if the maximum number of result rows have been issued. -func integrityCheckResultRow(tls *libc.TLS, v uintptr) int32 { /* sqlite3.c:126099:12: */ +func integrityCheckResultRow(tls *libc.TLS, v uintptr) int32 { /* sqlite3.c:127823:12: */ var addr int32 Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, 3, 1) addr = Xsqlite3VdbeAddOp3(tls, v, OP_IfPos, 1, (Xsqlite3VdbeCurrentAddr(tls, v) + 2), 1) @@ -105950,7 +107324,7 @@ func integrityCheckResultRow(tls *libc.TLS, v uintptr) int32 { /* sqlite3.c:1260 // 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 Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pValue uintptr, minusFlag int32) { /* sqlite3.c:126123:21: */ +func Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pValue uintptr, minusFlag int32) { /* sqlite3.c:127847:21: */ bp := tls.Alloc(548) defer tls.Free(548) @@ -106189,7 +107563,7 @@ __4: if !(minusFlag != 0) { goto __5 } - zRight = Xsqlite3MPrintf(tls, db, ts+18573 /* "-%T" */, libc.VaList(bp, pValue)) + zRight = Xsqlite3MPrintf(tls, db, ts+18998 /* "-%T" */, libc.VaList(bp, pValue)) goto __6 __5: zRight = Xsqlite3NameFromToken(tls, db, pValue) @@ -106820,7 +108194,7 @@ __18: if !(zRight != 0) { goto __63 } - if !(Xsqlite3_stricmp(tls, zRight, ts+18577 /* "fast" */) == 0) { + if !(Xsqlite3_stricmp(tls, zRight, ts+19002 /* "fast" */) == 0) { goto __64 } b = 2 @@ -106909,7 +108283,7 @@ __71: // PRAGMA [schema.]locking_mode // PRAGMA [schema.]locking_mode = (normal|exclusive) __20: - zRet = ts + 18361 /* "normal" */ + zRet = ts + 18786 /* "normal" */ eMode = getLockingMode(tls, zRight) if !(((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) && (eMode == -1)) { @@ -106950,7 +108324,7 @@ __78: if !(eMode == PAGER_LOCKINGMODE_EXCLUSIVE) { goto __83 } - zRet = ts + 18351 /* "exclusive" */ + zRet = ts + 18776 /* "exclusive" */ __83: ; returnSingleText(tls, v, zRet) @@ -106996,7 +108370,7 @@ __88: eMode1 = -1 __90: ; - if !((eMode1 == PAGER_JOURNALMODE_OFF) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_Defensive) != uint64(0))) { + if !((eMode1 == PAGER_JOURNALMODE_OFF) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_Defensive)) != uint64(0))) { goto __91 } // Do not allow journal-mode "OFF" in defensive since the database @@ -107175,7 +108549,7 @@ __26: } returnSingleInt(tls, v, func() int64 { - if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_CacheSpill) == uint64(0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_CacheSpill)) == uint64(0) { return int64(0) } return int64(Xsqlite3BtreeSetSpillSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, 0)) @@ -107192,10 +108566,10 @@ __108: if !(Xsqlite3GetBoolean(tls, zRight, (uint8(libc.Bool32(*(*int32)(unsafe.Pointer(bp + 436 /* size3 */)) != 0)))) != 0) { goto __109 } - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (SQLITE_CacheSpill) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_CacheSpill)) goto __110 __109: - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_CacheSpill)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_CacheSpill))) __110: ; setAllPagerFlags(tls, db) @@ -107315,7 +108689,7 @@ __123: if !((rc != SQLITE_OK) || (*(*int32)(unsafe.Pointer(bp + 448 /* res */)) == 0)) { goto __126 } - Xsqlite3ErrorMsg(tls, pParse, ts+18582 /* "not a writable d..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+19007 /* "not a writable d..." */, 0) goto pragma_out __126: ; @@ -107361,7 +108735,7 @@ __130: goto __132 } Xsqlite3ErrorMsg(tls, pParse, - ts+18607 /* "Safety level may..." */, 0) + ts+19032 /* "Safety level may..." */, 0) goto __133 __132: if !(iDb != 1) { @@ -107410,7 +108784,7 @@ __138: goto __140 __139: *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^mask) - if !(mask == SQLITE_DeferFKs) { + if !(mask == uint64(SQLITE_DeferFKs)) { goto __141 } (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0) @@ -107444,7 +108818,7 @@ __32: goto __142 } Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb) - pTab = Xsqlite3LocateTable(tls, pParse, LOCATE_NOERR, zRight, zDb) + pTab = Xsqlite3LocateTable(tls, pParse, uint32(LOCATE_NOERR), zRight, zDb) if !(pTab != 0) { goto __143 } @@ -107520,9 +108894,9 @@ __154: Xsqlite3VdbeMultiLoad(tls, v, 1, func() uintptr { if (*PragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - return ts + 18660 /* "issisii" */ + return ts + 19085 /* "issisii" */ } - return ts + 18668 /* "issisi" */ + return ts + 19093 /* "issisi" */ }(), libc.VaList(bp+24, (i-nHidden), (*Column)(unsafe.Pointer(pCol)).FzName, @@ -107566,8 +108940,8 @@ __33: // If there is no index named zRight, check to see if there is a // WITHOUT ROWID table named zRight, and if there is, show the // structure of the PRIMARY KEY index for that table. - pTab1 = Xsqlite3LocateTable(tls, pParse, LOCATE_NOERR, zRight, zDb) - if !((pTab1 != 0) && !(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & TF_WithoutRowid) == U32(0))) { + pTab1 = Xsqlite3LocateTable(tls, pParse, uint32(LOCATE_NOERR), zRight, zDb) + if !((pTab1 != 0) && !(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __162 } pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab1) @@ -107601,7 +108975,7 @@ __166: goto __168 } cnum = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i1)*2)) - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18675 /* "iisX" */, libc.VaList(bp+80, i1, int32(cnum), + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+19100 /* "iisX" */, libc.VaList(bp+80, i1, int32(cnum), func() uintptr { if int32(cnum) < 0 { return uintptr(0) @@ -107611,7 +108985,7 @@ __166: if !((*PragmaName)(unsafe.Pointer(pPragma)).FiArg != 0) { goto __169 } - Xsqlite3VdbeMultiLoad(tls, v, 4, ts+18680, /* "isiX" */ + Xsqlite3VdbeMultiLoad(tls, v, 4, ts+19105, /* "isiX" */ libc.VaList(bp+104, int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), (libc.Bool32(i1 < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol))))) @@ -107648,8 +109022,8 @@ __172: if !(pIdx1 != 0) { goto __174 } - *(*[3]uintptr)(unsafe.Pointer(bp + 456 /* azOrigin */)) = [3]uintptr{ts + 18685 /* "c" */, ts + 18687 /* "u" */, ts + 17201 /* "pk" */} - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18689, /* "isisi" */ + *(*[3]uintptr)(unsafe.Pointer(bp + 456 /* azOrigin */)) = [3]uintptr{ts + 19110 /* "c" */, ts + 19112 /* "u" */, ts + 17626 /* "pk" */} + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+19114, /* "isisi" */ libc.VaList(bp+128, i2, (*Index)(unsafe.Pointer(pIdx1)).FzName, (libc.Bool32(int32((*Index)(unsafe.Pointer((pIdx1))).FonError) != OE_None)), @@ -107683,7 +109057,7 @@ __175: __178: ; - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18695, /* "iss" */ + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+19120, /* "iss" */ libc.VaList(bp+168, i3, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i3)*32)).FzDbSName, Xsqlite3BtreeGetFilename(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i3)*32)).FpBt))) @@ -107700,13 +109074,13 @@ __177: __36: i4 = 0 (*Parse)(unsafe.Pointer(pParse)).FnMem = 2 - p = (*Hash)(unsafe.Pointer((db + 600 /* &.aCollSeq */))).Ffirst + p = (*Hash)(unsafe.Pointer((db + 608 /* &.aCollSeq */))).Ffirst __179: if !(p != 0) { goto __181 } pColl = (*HashElem)(unsafe.Pointer(p)).Fdata - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18699 /* "is" */, libc.VaList(bp+192, libc.PostIncInt32(&i4, 1), (*CollSeq)(unsafe.Pointer(pColl)).FzName)) + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+19124 /* "is" */, libc.VaList(bp+192, libc.PostIncInt32(&i4, 1), (*CollSeq)(unsafe.Pointer(pColl)).FzName)) goto __180 __180: p = (*HashElem)(unsafe.Pointer(p)).Fnext @@ -107718,7 +109092,7 @@ __181: goto __15 __37: - showInternFunc = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_InternalFunc) != U32(0))) + showInternFunc = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_InternalFunc)) != U32(0))) (*Parse)(unsafe.Pointer(pParse)).FnMem = 6 i5 = 0 __182: @@ -107745,7 +109119,7 @@ __183: goto __184 __184: ; - j = (*Hash)(unsafe.Pointer((db + 576 /* &.aFunc */))).Ffirst + j = (*Hash)(unsafe.Pointer((db + 584 /* &.aFunc */))).Ffirst __188: if !(j != 0) { goto __190 @@ -107764,13 +109138,13 @@ __190: __38: (*Parse)(unsafe.Pointer(pParse)).FnMem = 1 - j1 = (*Hash)(unsafe.Pointer((db + 528 /* &.aModule */))).Ffirst + j1 = (*Hash)(unsafe.Pointer((db + 536 /* &.aModule */))).Ffirst __191: if !(j1 != 0) { goto __193 } pMod = (*HashElem)(unsafe.Pointer(j1)).Fdata - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18543 /* "s" */, libc.VaList(bp+208, (*Module)(unsafe.Pointer(pMod)).FzName)) + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18968 /* "s" */, libc.VaList(bp+208, (*Module)(unsafe.Pointer(pMod)).FzName)) goto __192 __192: j1 = (*HashElem)(unsafe.Pointer(j1)).Fnext @@ -107787,7 +109161,7 @@ __194: if !(i6 < (int32(uint64(unsafe.Sizeof(aPragmaName)) / uint64(unsafe.Sizeof(PragmaName{}))))) { goto __196 } - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18543 /* "s" */, libc.VaList(bp+216, aPragmaName[i6].FzName)) + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18968 /* "s" */, libc.VaList(bp+216, aPragmaName[i6].FzName)) goto __195 __195: i6++ @@ -107823,7 +109197,7 @@ __202: if !(j2 < (*FKey)(unsafe.Pointer(pFK)).FnCol) { goto __204 } - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18702, /* "iissssss" */ + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+19127, /* "iissssss" */ libc.VaList(bp+224, i7, j2, (*FKey)(unsafe.Pointer(pFK)).FzTo, @@ -107831,7 +109205,7 @@ __202: (*sColMap)(unsafe.Pointer((pFK+64 /* &.aCol */)+uintptr(j2)*16)).FzCol, actionName(tls, *(*U8)(unsafe.Pointer((pFK + 45 /* &.aAction */) + 1))), // ON UPDATE actionName(tls, *(*U8)(unsafe.Pointer((pFK + 45 /* &.aAction */)))), // ON DELETE - ts+4677 /* "NONE" */)) + ts+4753 /* "NONE" */)) goto __203 __203: j2++ @@ -108015,7 +109389,7 @@ __229: ; // Generate code to report an FK violation to the caller. - if !(((*Table)(unsafe.Pointer((pTab4))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab4))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __231 } Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, 0, (regResult + 1)) @@ -108024,7 +109398,7 @@ __231: Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (regResult + 1)) __232: ; - Xsqlite3VdbeMultiLoad(tls, v, (regResult + 2), ts+18711 /* "siX" */, libc.VaList(bp+288, (*FKey)(unsafe.Pointer(pFK1)).FzTo, (i8-1))) + Xsqlite3VdbeMultiLoad(tls, v, (regResult + 2), ts+19136 /* "siX" */, libc.VaList(bp+288, (*FKey)(unsafe.Pointer(pFK1)).FzTo, (i8-1))) Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, regResult, 4) Xsqlite3VdbeResolveLabel(tls, v, addrOk) Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 488 /* aiCols */))) @@ -108176,7 +109550,7 @@ __244: goto __245 __247: ; - if !(((*Table)(unsafe.Pointer((pTab5))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab5))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __248 } cnt++ @@ -108248,7 +109622,7 @@ __257: goto __258 __260: ; - if !(((*Table)(unsafe.Pointer((pTab6))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab6))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __261 } *(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = int32((*Table)(unsafe.Pointer(pTab6)).Ftnum) @@ -108290,7 +109664,7 @@ __259: Xsqlite3VdbeChangeP5(tls, v, uint16(U8(i9))) addr1 = Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, 2) Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, - Xsqlite3MPrintf(tls, db, ts+18715 /* "*** in database ..." */, libc.VaList(bp+304, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i9)*32)).FzDbSName)), + Xsqlite3MPrintf(tls, db, ts+19140 /* "*** in database ..." */, libc.VaList(bp+304, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i9)*32)).FzDbSName)), -7) Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 2, 3, 3) integrityCheckResultRow(tls, v) @@ -108318,7 +109692,7 @@ __268: goto __266 __269: ; - if ((*Table)(unsafe.Pointer((pTab7))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab7))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk1 = uintptr(0) } else { pPk1 = Xsqlite3PrimaryKeyIndex(tls, pTab7) @@ -108351,7 +109725,7 @@ __272: } // Sanity check on record header decoding Xsqlite3VdbeAddOp3(tls, v, OP_Column, *(*int32)(unsafe.Pointer(bp + 500 /* iDataCur */)), (int32((*Table)(unsafe.Pointer(pTab7)).FnNVCol) - 1), 3) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_TYPEOFARG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG)) __273: ; // Verify that all NOT NULL columns really are NOT NULL @@ -108376,11 +109750,11 @@ __278: if !(int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, -1))).Fopcode) == OP_Column) { goto __279 } - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_TYPEOFARG) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_TYPEOFARG)) __279: ; jmp2 = Xsqlite3VdbeAddOp1(tls, v, OP_NotNull, 3) - zErr = Xsqlite3MPrintf(tls, db, ts+18739 /* "NULL value in %s..." */, libc.VaList(bp+312, (*Table)(unsafe.Pointer(pTab7)).FzName, + zErr = Xsqlite3MPrintf(tls, db, ts+19164 /* "NULL value in %s..." */, libc.VaList(bp+312, (*Table)(unsafe.Pointer(pTab7)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab7)).FaCol+uintptr(j4)*32)).FzName)) Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, zErr, -7) integrityCheckResultRow(tls, v) @@ -108393,7 +109767,7 @@ __275: __276: ; // Verify CHECK constraints - if !(((*Table)(unsafe.Pointer(pTab7)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_IgnoreChecks) == uint64(0))) { + if !(((*Table)(unsafe.Pointer(pTab7)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_IgnoreChecks)) == uint64(0))) { goto __280 } pCheck = Xsqlite3ExprListDup(tls, db, (*Table)(unsafe.Pointer(pTab7)).FpCheck, 0) @@ -108420,7 +109794,7 @@ __284: SQLITE_JUMPIFNULL) Xsqlite3VdbeResolveLabel(tls, v, addrCkFault) (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr1 = Xsqlite3MPrintf(tls, db, ts+18759, /* "CHECK constraint..." */ + zErr1 = Xsqlite3MPrintf(tls, db, ts+19184, /* "CHECK constraint..." */ libc.VaList(bp+328, (*Table)(unsafe.Pointer(pTab7)).FzName)) Xsqlite3VdbeAddOp4(tls, v, OP_String8, 0, 3, 0, zErr1, -7) integrityCheckResultRow(tls, v) @@ -108454,9 +109828,9 @@ __289: // Verify that an index entry exists for the current table row jmp21 = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, (*(*int32)(unsafe.Pointer(bp + 504 /* iIdxCur */)) + j4), ckUniq, r1, int32((*Index)(unsafe.Pointer(pIdx5)).FnColumn)) - Xsqlite3VdbeLoadString(tls, v, 3, ts+18789 /* "row " */) + Xsqlite3VdbeLoadString(tls, v, 3, ts+19214 /* "row " */) Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 7, 3, 3) - Xsqlite3VdbeLoadString(tls, v, 4, ts+18794 /* " missing from in..." */) + Xsqlite3VdbeLoadString(tls, v, 4, ts+19219 /* " missing from in..." */) Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 3, 3) jmp5 = Xsqlite3VdbeLoadString(tls, v, 4, (*Index)(unsafe.Pointer(pIdx5)).FzName) Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 3, 3) @@ -108496,7 +109870,7 @@ __293: Xsqlite3VdbeJumpHere(tls, v, jmp6) Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxGT, (*(*int32)(unsafe.Pointer(bp + 504 /* iIdxCur */)) + j4), uniqOk, r1, int32((*Index)(unsafe.Pointer(pIdx5)).FnKeyCol)) - Xsqlite3VdbeLoadString(tls, v, 3, ts+18815 /* "non-unique entry..." */) + Xsqlite3VdbeLoadString(tls, v, 3, ts+19240 /* "non-unique entry..." */) Xsqlite3VdbeGoto(tls, v, jmp5) Xsqlite3VdbeResolveLabel(tls, v, uniqOk) __290: @@ -108518,7 +109892,7 @@ __285: if !(!(isQuick != 0)) { goto __295 } - Xsqlite3VdbeLoadString(tls, v, 2, ts+18842 /* "wrong # of entri..." */) + Xsqlite3VdbeLoadString(tls, v, 2, ts+19267 /* "wrong # of entri..." */) j4 = 0 pIdx5 = (*Table)(unsafe.Pointer(pTab7)).FpIndex __296: @@ -108533,7 +109907,7 @@ __299: ; Xsqlite3VdbeAddOp2(tls, v, OP_Count, (*(*int32)(unsafe.Pointer(bp + 504 /* iIdxCur */)) + j4), 3) addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_Eq, (8 + j4), 0, 3) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NOTNULL) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NOTNULL)) Xsqlite3VdbeLoadString(tls, v, 4, (*Index)(unsafe.Pointer(pIdx5)).FzName) Xsqlite3VdbeAddOp3(tls, v, OP_Concat, 4, 2, 3) integrityCheckResultRow(tls, v) @@ -108569,7 +109943,7 @@ __241: } (*VdbeOp)(unsafe.Pointer(aOp2)).Fp2 = (1 - *(*int32)(unsafe.Pointer(bp + 496 /* mxErr */))) (*VdbeOp)(unsafe.Pointer(aOp2 + 2*32)).Fp4type = int8(-1) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*32 + 16 /* &.p4 */)) = ts + 4999 /* "ok" */ + *(*uintptr)(unsafe.Pointer(aOp2 + 2*32 + 16 /* &.p4 */)) = ts + 5075 /* "ok" */ (*VdbeOp)(unsafe.Pointer(aOp2 + 5*32)).Fp4type = int8(-1) *(*uintptr)(unsafe.Pointer(aOp2 + 5*32 + 16 /* &.p4 */)) = Xsqlite3ErrStr(tls, SQLITE_CORRUPT) __300: @@ -108616,7 +109990,7 @@ __301: // "PRAGMA encoding = XXX" // initialized. If the main database exists, the new sqlite.enc value // will be overwritten when the schema is next loaded. If it does not // already exists, it will be created to use the new encoding value. - if !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_EncodingFixed) == U32(0)) { + if !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) == U32(0)) { goto __304 } pEnc = (uintptr(unsafe.Pointer(&encnames1))) @@ -108630,7 +110004,7 @@ __305: if (*EncName)(unsafe.Pointer(pEnc)).Fenc != 0 { enc = (*EncName)(unsafe.Pointer(pEnc)).Fenc } else { - enc = SQLITE_UTF16LE + enc = uint8(SQLITE_UTF16LE) } ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb)).FpSchema)).Fenc) = enc Xsqlite3SetTextEncoding(tls, db, enc) @@ -108647,7 +110021,7 @@ __307: if !(!(int32((*EncName)(unsafe.Pointer(pEnc)).FzName) != 0)) { goto __309 } - Xsqlite3ErrorMsg(tls, pParse, ts+18871 /* "unsupported enco..." */, libc.VaList(bp+336, zRight)) + Xsqlite3ErrorMsg(tls, pParse, ts+19296 /* "unsupported enco..." */, libc.VaList(bp+336, zRight)) __309: ; __304: @@ -108753,25 +110127,25 @@ __47: if (*Token)(unsafe.Pointer(pId2)).Fz != 0 { return iDb } - return SQLITE_MAX_ATTACHED + return (SQLITE_MAX_ATTACHED + 2) }() eMode2 = SQLITE_CHECKPOINT_PASSIVE if !(zRight != 0) { goto __316 } - if !(Xsqlite3StrICmp(tls, zRight, ts+18373 /* "full" */) == 0) { + if !(Xsqlite3StrICmp(tls, zRight, ts+18798 /* "full" */) == 0) { goto __317 } eMode2 = SQLITE_CHECKPOINT_FULL goto __318 __317: - if !(Xsqlite3StrICmp(tls, zRight, ts+18896 /* "restart" */) == 0) { + if !(Xsqlite3StrICmp(tls, zRight, ts+19321 /* "restart" */) == 0) { goto __319 } eMode2 = SQLITE_CHECKPOINT_RESTART goto __320 __319: - if !(Xsqlite3StrICmp(tls, zRight, ts+18526 /* "truncate" */) == 0) { + if !(Xsqlite3StrICmp(tls, zRight, ts+18951 /* "truncate" */) == 0) { goto __321 } eMode2 = SQLITE_CHECKPOINT_TRUNCATE @@ -108921,7 +110295,7 @@ __330: // If table pTab has not been used in a way that would benefit from // having analysis statistics during the current session, then skip it. // This also has the effect of skipping virtual tables and views - if !(((*Table)(unsafe.Pointer(pTab8)).FtabFlags & TF_StatsUsed) == U32(0)) { + if !(((*Table)(unsafe.Pointer(pTab8)).FtabFlags & U32(TF_StatsUsed)) == U32(0)) { goto __333 } goto __331 @@ -108958,7 +110332,7 @@ __336: __338: ; - zSubSql = Xsqlite3MPrintf(tls, db, ts+18904, /* "ANALYZE \"%w\".\"%w..." */ + zSubSql = Xsqlite3MPrintf(tls, db, ts+19329, /* "ANALYZE \"%w\".\"%w..." */ libc.VaList(bp+344, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Table)(unsafe.Pointer(pTab8)).FzName)) if !((opMask & U32(0x01)) != 0) { goto __339 @@ -109093,7 +110467,7 @@ __347: if !(i11 < (*Sqlite3)(unsafe.Pointer(db)).FnDb) { goto __349 } - zState = ts + 18922 /* "unknown" */ + zState = ts + 19347 /* "unknown" */ if !((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i11)*32)).FzDbSName == uintptr(0)) { goto __350 } @@ -109104,7 +110478,7 @@ __350: if !((pBt3 == uintptr(0)) || (Xsqlite3BtreePager(tls, pBt3) == uintptr(0))) { goto __351 } - zState = ts + 18930 /* "closed" */ + zState = ts + 19355 /* "closed" */ goto __352 __351: if !(Xsqlite3_file_control(tls, db, func() uintptr { @@ -109121,7 +110495,7 @@ __353: ; __352: ; - Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18937 /* "ss" */, libc.VaList(bp+360, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i11)*32)).FzDbSName, zState)) + Xsqlite3VdbeMultiLoad(tls, v, 1, ts+19362 /* "ss" */, libc.VaList(bp+360, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i11)*32)).FzDbSName, zState)) goto __348 __348: i11++ @@ -109155,61 +110529,61 @@ type EncName = struct { FzName uintptr Fenc U8 _ [7]byte -} /* sqlite3.c:127572:18 */ +} /* sqlite3.c:129296:18 */ -var iLn3 int32 = 0 /* sqlite3.c:126248:22 */ +var iLn3 int32 = 0 /* sqlite3.c:127972:22 */ var getCacheSize = [9]VdbeOpList{ - {Fopcode: OP_Transaction}, // 0 - {Fopcode: OP_ReadCookie, Fp2: int8(1), Fp3: BTREE_DEFAULT_CACHE_SIZE}, // 1 - {Fopcode: OP_IfPos, Fp1: int8(1), Fp2: int8(8)}, - {Fopcode: OP_Integer, Fp2: int8(2)}, - {Fopcode: OP_Subtract, Fp1: int8(1), Fp2: int8(2), Fp3: int8(1)}, - {Fopcode: OP_IfPos, Fp1: int8(1), Fp2: int8(8)}, - {Fopcode: OP_Integer, Fp2: int8(1)}, // 6 - {Fopcode: OP_Noop}, - {Fopcode: OP_ResultRow, Fp1: int8(1), Fp2: int8(1)}, -} /* sqlite3.c:126249:29 */ -var iLn4 int32 = 0 /* sqlite3.c:126517:26 */ + {Fopcode: U8(OP_Transaction)}, // 0 + {Fopcode: U8(OP_ReadCookie), Fp2: int8(1), Fp3: int8(BTREE_DEFAULT_CACHE_SIZE)}, // 1 + {Fopcode: U8(OP_IfPos), Fp1: int8(1), Fp2: int8(8)}, + {Fopcode: U8(OP_Integer), Fp2: int8(2)}, + {Fopcode: U8(OP_Subtract), Fp1: int8(1), Fp2: int8(2), Fp3: int8(1)}, + {Fopcode: U8(OP_IfPos), Fp1: int8(1), Fp2: int8(8)}, + {Fopcode: U8(OP_Integer), Fp2: int8(1)}, // 6 + {Fopcode: U8(OP_Noop)}, + {Fopcode: U8(OP_ResultRow), Fp1: int8(1), Fp2: int8(1)}, +} /* sqlite3.c:127973:29 */ +var iLn4 int32 = 0 /* sqlite3.c:128241:26 */ var setMeta6 = [5]VdbeOpList{ - {Fopcode: OP_Transaction, Fp2: int8(1)}, // 0 - {Fopcode: OP_ReadCookie, Fp2: int8(1), Fp3: BTREE_LARGEST_ROOT_PAGE}, - {Fopcode: OP_If, Fp1: int8(1)}, // 2 - {Fopcode: OP_Halt, Fp2: OE_Abort}, // 3 - {Fopcode: OP_SetCookie, Fp2: BTREE_INCR_VACUUM}, // 4 -} /* sqlite3.c:126518:33 */ -var iLn5 int32 = 0 /* sqlite3.c:127522:24 */ + {Fopcode: U8(OP_Transaction), Fp2: int8(1)}, // 0 + {Fopcode: U8(OP_ReadCookie), Fp2: int8(1), Fp3: int8(BTREE_LARGEST_ROOT_PAGE)}, + {Fopcode: U8(OP_If), Fp1: int8(1)}, // 2 + {Fopcode: U8(OP_Halt), Fp2: int8(OE_Abort)}, // 3 + {Fopcode: U8(OP_SetCookie), Fp2: int8(BTREE_INCR_VACUUM)}, // 4 +} /* sqlite3.c:128242:33 */ +var iLn5 int32 = 0 /* sqlite3.c:129246:24 */ var endCode = [7]VdbeOpList{ - {Fopcode: OP_AddImm, Fp1: int8(1)}, // 0 - {Fopcode: OP_IfNotZero, Fp1: int8(1), Fp2: int8(4)}, // 1 - {Fopcode: OP_String8, Fp2: int8(3)}, // 2 - {Fopcode: OP_ResultRow, Fp1: int8(3), Fp2: int8(1)}, // 3 - {Fopcode: OP_Halt}, // 4 - {Fopcode: OP_String8, Fp2: int8(3)}, // 5 - {Fopcode: OP_Goto, Fp2: int8(3)}, // 6 -} /* sqlite3.c:127523:31 */ + {Fopcode: U8(OP_AddImm), Fp1: int8(1)}, // 0 + {Fopcode: U8(OP_IfNotZero), Fp1: int8(1), Fp2: int8(4)}, // 1 + {Fopcode: U8(OP_String8), Fp2: int8(3)}, // 2 + {Fopcode: U8(OP_ResultRow), Fp1: int8(3), Fp2: int8(1)}, // 3 + {Fopcode: U8(OP_Halt)}, // 4 + {Fopcode: U8(OP_String8), Fp2: int8(3)}, // 5 + {Fopcode: U8(OP_Goto), Fp2: int8(3)}, // 6 +} /* sqlite3.c:129247:31 */ var encnames1 = [9]EncName{ - {FzName: ts + 18940 /* "UTF8" */, Fenc: SQLITE_UTF8}, - {FzName: ts + 18945 /* "UTF-8" */, Fenc: SQLITE_UTF8}, // Must be element [1] - {FzName: ts + 18951 /* "UTF-16le" */, Fenc: SQLITE_UTF16LE}, // Must be element [2] - {FzName: ts + 18960 /* "UTF-16be" */, Fenc: SQLITE_UTF16BE}, // Must be element [3] - {FzName: ts + 18969 /* "UTF16le" */, Fenc: SQLITE_UTF16LE}, - {FzName: ts + 18977 /* "UTF16be" */, Fenc: SQLITE_UTF16BE}, - {FzName: ts + 18985 /* "UTF-16" */}, // SQLITE_UTF16NATIVE - {FzName: ts + 18992 /* "UTF16" */}, // SQLITE_UTF16NATIVE + {FzName: ts + 19365 /* "UTF8" */, Fenc: U8(SQLITE_UTF8)}, + {FzName: ts + 19370 /* "UTF-8" */, Fenc: U8(SQLITE_UTF8)}, // Must be element [1] + {FzName: ts + 19376 /* "UTF-16le" */, Fenc: U8(SQLITE_UTF16LE)}, // Must be element [2] + {FzName: ts + 19385 /* "UTF-16be" */, Fenc: U8(SQLITE_UTF16BE)}, // Must be element [3] + {FzName: ts + 19394 /* "UTF16le" */, Fenc: U8(SQLITE_UTF16LE)}, + {FzName: ts + 19402 /* "UTF16be" */, Fenc: U8(SQLITE_UTF16BE)}, + {FzName: ts + 19410 /* "UTF-16" */}, // SQLITE_UTF16NATIVE + {FzName: ts + 19417 /* "UTF16" */}, // SQLITE_UTF16NATIVE {}, -} /* sqlite3.c:127575:7 */ +} /* sqlite3.c:129299:7 */ var setCookie = [2]VdbeOpList{ - {Fopcode: OP_Transaction, Fp2: int8(1)}, // 0 - {Fopcode: OP_SetCookie}, // 1 -} /* sqlite3.c:127655:31 */ + {Fopcode: U8(OP_Transaction), Fp2: int8(1)}, // 0 + {Fopcode: U8(OP_SetCookie)}, // 1 +} /* sqlite3.c:129379:31 */ var readCookie = [3]VdbeOpList{ - {Fopcode: OP_Transaction}, // 0 - {Fopcode: OP_ReadCookie, Fp2: int8(1)}, // 1 - {Fopcode: OP_ResultRow, Fp1: int8(1), Fp2: int8(1)}, -} /* sqlite3.c:127670:31 */ + {Fopcode: U8(OP_Transaction)}, // 0 + {Fopcode: U8(OP_ReadCookie), Fp2: int8(1)}, // 1 + {Fopcode: U8(OP_ResultRow), Fp1: int8(1), Fp2: int8(1)}, +} /* sqlite3.c:129394:31 */ var azLockName = [5]uintptr{ - ts + 18998 /* "unlocked" */, ts + 19007 /* "shared" */, ts + 19014 /* "reserved" */, ts + 19023 /* "pending" */, ts + 18351, /* "exclusive" */ -} /* sqlite3.c:127978:23 */ + ts + 19423 /* "unlocked" */, ts + 19432 /* "shared" */, ts + 19439 /* "reserved" */, ts + 19448 /* "pending" */, ts + 18776, /* "exclusive" */ +} /* sqlite3.c:129702:23 */ // **************************************************************************** // // Implementation of an eponymous virtual table that runs a pragma. @@ -109221,24 +110595,24 @@ type PragmaVtab1 = struct { FnHidden U8 FiHidden U8 _ [6]byte -} /* sqlite3.c:128030:9 */ +} /* sqlite3.c:129754:9 */ // **************************************************************************** // // Implementation of an eponymous virtual table that runs a pragma. // -type PragmaVtab = PragmaVtab1 /* sqlite3.c:128030:27 */ +type PragmaVtab = PragmaVtab1 /* sqlite3.c:129754:27 */ type PragmaVtabCursor1 = struct { Fbase Sqlite3_vtab_cursor FpPragma uintptr FiRowid Sqlite_int64 FazArg [2]uintptr -} /* sqlite3.c:128031:9 */ +} /* sqlite3.c:129755:9 */ -type PragmaVtabCursor = PragmaVtabCursor1 /* sqlite3.c:128031:33 */ +type PragmaVtabCursor = PragmaVtabCursor1 /* sqlite3.c:129755:33 */ // Pragma virtual table module xConnect method. -func pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:128049:12: */ +func pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:129773:12: */ bp := tls.Alloc(264) defer tls.Free(264) @@ -109255,7 +110629,7 @@ func pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argc _ = argv Xsqlite3StrAccumInit(tls, bp+32 /* &acc */, uintptr(0), bp+64 /* &zBuf[0] */, int32(unsafe.Sizeof([200]int8{})), 0) - Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+19031 /* "CREATE TABLE x" */) + Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+19456 /* "CREATE TABLE x" */) i = 0 j = int32((*PragmaName)(unsafe.Pointer(pPragma)).FiPragCName) __1: @@ -109263,7 +110637,7 @@ __1: goto __3 } { - Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+19046 /* "%c\"%s\"" */, libc.VaList(bp, int32(cSep), pragCName[j])) + Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+19471 /* "%c\"%s\"" */, libc.VaList(bp, int32(cSep), pragCName[j])) cSep = int8(',') } @@ -109276,19 +110650,19 @@ __2: __3: ; if i == 0 { - Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+19053 /* "(\"%s\"" */, libc.VaList(bp+16, (*PragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+19478 /* "(\"%s\"" */, libc.VaList(bp+16, (*PragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if (int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+19059 /* ",arg HIDDEN" */) + Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+19484 /* ",arg HIDDEN" */) j++ } if (int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & (PragFlg_SchemaOpt | PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+19071 /* ",schema HIDDEN" */) + Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+19496 /* ",schema HIDDEN" */) j++ } - Xsqlite3_str_append(tls, bp+32 /* &acc */, ts+6671 /* ")" */, 1) + Xsqlite3_str_append(tls, bp+32 /* &acc */, ts+6747 /* ")" */, 1) Xsqlite3StrAccumFinish(tls, bp+32 /* &acc */) rc = Xsqlite3_declare_vtab(tls, db, bp+64 /* &zBuf[0] */) @@ -109312,7 +110686,7 @@ __3: } // Pragma virtual table module xDisconnect method. -func pragmaVtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:128111:12: */ +func pragmaVtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:129835:12: */ var pTab uintptr = pVtab Xsqlite3_free(tls, pTab) return SQLITE_OK @@ -109324,7 +110698,7 @@ func pragmaVtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:128 // 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 *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:128124:12: */ +func pragmaVtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:129848:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -109389,7 +110763,7 @@ __3: } // Create a new cursor for the pragma virtual table -func pragmaVtabOpen(tls *libc.TLS, pVtab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:128161:12: */ +func pragmaVtabOpen(tls *libc.TLS, pVtab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:129885:12: */ var pCsr uintptr pCsr = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(PragmaVtabCursor{}))) if pCsr == uintptr(0) { @@ -109402,7 +110776,7 @@ func pragmaVtabOpen(tls *libc.TLS, pVtab uintptr, ppCursor uintptr) int32 { /* s } // Clear all content from pragma virtual table cursor. -func pragmaVtabCursorClear(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:128172:13: */ +func pragmaVtabCursorClear(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:129896:13: */ var i int32 Xsqlite3_finalize(tls, (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma) (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma = uintptr(0) @@ -109413,7 +110787,7 @@ func pragmaVtabCursorClear(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:128172:13 } // Close a pragma virtual table cursor -func pragmaVtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:128183:12: */ +func pragmaVtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:129907:12: */ var pCsr uintptr = cur pragmaVtabCursorClear(tls, pCsr) Xsqlite3_free(tls, pCsr) @@ -109421,7 +110795,7 @@ func pragmaVtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:128183:12: } // Advance the pragma virtual table cursor to the next row -func pragmaVtabNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:128191:12: */ +func pragmaVtabNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:129915:12: */ var pCsr uintptr = pVtabCursor var rc int32 = SQLITE_OK @@ -109437,7 +110811,7 @@ func pragmaVtabNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:128 } // Pragma virtual table module xFilter method. -func pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:128209:12: */ +func pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:129933:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -109482,14 +110856,14 @@ __2: goto __3 __3: ; - Xsqlite3StrAccumInit(tls, bp+32 /* &acc */, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer(((*PragmaVtab)(unsafe.Pointer(pTab)).Fdb + 124 /* &.aLimit */) + 1*4))) - Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+19086 /* "PRAGMA " */) + Xsqlite3StrAccumInit(tls, bp+32 /* &acc */, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer(((*PragmaVtab)(unsafe.Pointer(pTab)).Fdb + 128 /* &.aLimit */) + 1*4))) + Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+19511 /* "PRAGMA " */) if *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+19094 /* "%Q." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + 1*8)))) + Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+19519 /* "%Q." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + 1*8)))) } Xsqlite3_str_appendall(tls, bp+32 /* &acc */, (*PragmaName)(unsafe.Pointer((*PragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */))) != 0 { - Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+19098 /* "=%Q" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */))))) + Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+19523 /* "=%Q" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */))))) } zSql = Xsqlite3StrAccumFinish(tls, bp+32 /* &acc */) if zSql == uintptr(0) { @@ -109505,14 +110879,14 @@ __3: } // Pragma virtual table module xEof method. -func pragmaVtabEof(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:128259:12: */ +func pragmaVtabEof(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:129983:12: */ var pCsr uintptr = pVtabCursor return (libc.Bool32((*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma == uintptr(0))) } // The xColumn method simply returns the corresponding column from // the PRAGMA. -func pragmaVtabColumn(tls *libc.TLS, pVtabCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:128267:12: */ +func pragmaVtabColumn(tls *libc.TLS, pVtabCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:129991:12: */ var pCsr uintptr = pVtabCursor var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab if i < int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden) { @@ -109524,7 +110898,7 @@ func pragmaVtabColumn(tls *libc.TLS, pVtabCursor uintptr, ctx uintptr, i int32) } // Pragma virtual table module xRowid method. -func pragmaVtabRowid(tls *libc.TLS, pVtabCursor uintptr, p uintptr) int32 { /* sqlite3.c:128285:12: */ +func pragmaVtabRowid(tls *libc.TLS, pVtabCursor uintptr, p uintptr) int32 { /* sqlite3.c:130009:12: */ var pCsr uintptr = pVtabCursor *(*Sqlite_int64)(unsafe.Pointer(p)) = (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FiRowid return SQLITE_OK @@ -109542,12 +110916,12 @@ var pragmaVtabModule = Sqlite3_module{ // xCreate - create a table FxEof: 0, // xEof FxColumn: 0, // xColumn - read data FxRowid: 0, // xShadowName -} /* sqlite3.c:128292:29 */ +} /* sqlite3.c:130016:29 */ // 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 Xsqlite3PragmaVtabRegister(tls *libc.TLS, db uintptr, zName uintptr) uintptr { /* sqlite3.c:128324:23: */ +func Xsqlite3PragmaVtabRegister(tls *libc.TLS, db uintptr, zName uintptr) uintptr { /* sqlite3.c:130048:23: */ var pName uintptr pName = pragmaLocate(tls, (zName + uintptr(7))) @@ -109580,38 +110954,49 @@ func Xsqlite3PragmaVtabRegister(tls *libc.TLS, db uintptr, zName uintptr) uintpt // Fill the InitData structure with an error message that indicates // that the database is corrupt. -func corruptSchema(tls *libc.TLS, pData uintptr, zObj uintptr, zExtra uintptr) { /* sqlite3.c:128361:13: */ - bp := tls.Alloc(24) - defer tls.Free(24) +func corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) { /* sqlite3.c:130085:13: */ + bp := tls.Alloc(56) + defer tls.Free(56) var db uintptr = (*InitData)(unsafe.Pointer(pData)).Fdb if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*InitData)(unsafe.Pointer(pData)).Frc = SQLITE_NOMEM } else if *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) != uintptr(0) { // A error message has already been generated. Do not overwrite it - } else if ((*InitData)(unsafe.Pointer(pData)).FmInitFlags & INITFLAG_AlterTable) != 0 { - *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = Xsqlite3DbStrDup(tls, db, zExtra) + } else if ((*InitData)(unsafe.Pointer(pData)).FmInitFlags & (U32(INITFLAG_AlterRename | INITFLAG_AlterDrop))) != 0 { + *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = Xsqlite3MPrintf(tls, db, + ts+19527 /* "error in %s %s a..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), + func() uintptr { + if ((*InitData)(unsafe.Pointer(pData)).FmInitFlags & U32(INITFLAG_AlterRename)) != 0 { + return ts + 19555 /* "rename" */ + } + return ts + 19562 /* "drop column" */ + }(), + zExtra)) (*InitData)(unsafe.Pointer(pData)).Frc = SQLITE_ERROR - } else if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_WriteSchema) != 0 { - (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 128375) + } else if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_WriteSchema)) != 0 { + (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 130103) } else { var z uintptr - if zObj == uintptr(0) { - zObj = ts + 6724 /* "?" */ + var zObj uintptr + if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { + zObj = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) + } else { + zObj = ts + 6800 /* "?" */ } - z = Xsqlite3MPrintf(tls, db, ts+19102 /* "malformed databa..." */, libc.VaList(bp, zObj)) + z = Xsqlite3MPrintf(tls, db, ts+19574 /* "malformed databa..." */, libc.VaList(bp+32, zObj)) if (zExtra != 0) && (*(*int8)(unsafe.Pointer(zExtra)) != 0) { - z = Xsqlite3MPrintf(tls, db, ts+19133 /* "%z - %s" */, libc.VaList(bp+8, z, zExtra)) + z = Xsqlite3MPrintf(tls, db, ts+19605 /* "%z - %s" */, libc.VaList(bp+40, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 128382) + (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 130110) } } // Check to see if any sibling index (another index on the same table) // of pIndex has the same root page number, and if it does, return true. // This would indicate a corrupt schema. -func Xsqlite3IndexHasDuplicateRootPage(tls *libc.TLS, pIndex uintptr) int32 { /* sqlite3.c:128391:20: */ +func Xsqlite3IndexHasDuplicateRootPage(tls *libc.TLS, pIndex uintptr) int32 { /* sqlite3.c:130119:20: */ var p uintptr for p = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FpIndex; p != 0; p = (*Index)(unsafe.Pointer(p)).FpNext { if ((*Index)(unsafe.Pointer(p)).Ftnum == (*Index)(unsafe.Pointer(pIndex)).Ftnum) && (p != pIndex) { @@ -109633,7 +111018,7 @@ func Xsqlite3IndexHasDuplicateRootPage(tls *libc.TLS, pIndex uintptr) int32 { /* // argv[3] = root page number for table or index. 0 for trigger or view. // argv[4] = SQL text for the CREATE statement. // -func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:128425:20: */ +func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:130153:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -109644,10 +111029,10 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr _ = NotUsed _ = argc - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_EncodingFixed) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_EncodingFixed)) (*InitData)(unsafe.Pointer(pData)).FnInitRow++ if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0)) + corruptSchema(tls, pData, argv, uintptr(0)) return 1 } @@ -109655,12 +111040,19 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr return 0 } // Might happen if EMPTY_RESULT_CALLBACKS are on if *(*uintptr)(unsafe.Pointer(argv + 3*8)) == uintptr(0) { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0)) - } else if Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(argv + 4*8)), ts+19141 /* "create " */, 7) == 0 { + corruptSchema(tls, pData, argv, uintptr(0)) + } else if ((*(*uintptr)(unsafe.Pointer(argv + 4*8)) != 0) && + ('c' == int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*8)))))]))) && + ('r' == int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*8)) + 1)))])) { // Call the parser to process a CREATE TABLE, INDEX or VIEW. // But because db->init.busy is set to 1, no VDBE code is generated // or executed. All the parser does is build the internal data // structures that describe the table, index, or view. + // + // No other valid SQL statement, other than the variable CREATE statements, + // can begin with the letters "C" and "R". Thus, it is not possible run + // any other kind of statement while parsing the schema, even a corrupt + // schema. var rc int32 var saved_iDb U8 = (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb // var pStmt uintptr at bp, 8 @@ -109668,13 +111060,13 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr // Return code from sqlite3_prepare() (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(iDb) - if (Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), (db+176 /* &.init */ /* &.newTnum */)) == 0) || + if (Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), (db+184 /* &.init */ /* &.newTnum */)) == 0) || (((*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum > (*InitData)(unsafe.Pointer(pData)).FmxPage) && ((*InitData)(unsafe.Pointer(pData)).FmxPage > Pgno(0))) { if Xsqlite3Config.FbExtraSchemaChecks != 0 { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+15222 /* "invalid rootpage" */) + corruptSchema(tls, pData, argv, ts+15686 /* "invalid rootpage" */) } } - libc.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.orphanTrigger */, uint32(0), 0, 0x1) + libc.SetBitFieldPtr8Uint32(db+184 /* &.init */ +8 /* &.orphanTrigger */, uint32(0), 0, 0x1) (*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit = argv *(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = uintptr(0) sqlite3Prepare(tls, db, *(*uintptr)(unsafe.Pointer(argv + 4*8)), -1, uint32(0), uintptr(0), bp /* &pStmt */, uintptr(0)) @@ -109683,7 +111075,7 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = saved_iDb // assert( saved_iDb==0 || (db->mDbFlags & DBFLAG_Vacuum)!=0 ); if SQLITE_OK != rc { - if (uint32(int32(*(*uint8)(unsafe.Pointer(db + 176 /* &.init */ + 8 /* &.orphanTrigger */)) & 0x1 >> 0))) != 0 { + if (uint32(int32(*(*uint8)(unsafe.Pointer(db + 184 /* &.init */ + 8 /* &.orphanTrigger */)) & 0x1 >> 0))) != 0 { } else { if rc > (*InitData)(unsafe.Pointer(pData)).Frc { @@ -109692,13 +111084,13 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr if rc == SQLITE_NOMEM { Xsqlite3OomFault(tls, db) } else if (rc != SQLITE_INTERRUPT) && ((rc & 0xFF) != SQLITE_LOCKED) { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), Xsqlite3_errmsg(tls, db)) + corruptSchema(tls, pData, argv, Xsqlite3_errmsg(tls, db)) } } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) } else if (*(*uintptr)(unsafe.Pointer(argv + 1*8)) == uintptr(0)) || ((*(*uintptr)(unsafe.Pointer(argv + 4*8)) != uintptr(0)) && (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + 4*8))))) != 0)) { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0)) + corruptSchema(tls, pData, argv, uintptr(0)) } else { // If the SQL column is blank it means this is an index that // was created to be the PRIMARY KEY or to fulfill a UNIQUE @@ -109708,13 +111100,13 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr var pIndex uintptr pIndex = Xsqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName) if pIndex == uintptr(0) { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+19149 /* "orphan index" */) + corruptSchema(tls, pData, argv, ts+19613 /* "orphan index" */) } else if (((Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), (pIndex+88 /* &.tnum */)) == 0) || ((*Index)(unsafe.Pointer(pIndex)).Ftnum < Pgno(2))) || ((*Index)(unsafe.Pointer(pIndex)).Ftnum > (*InitData)(unsafe.Pointer(pData)).FmxPage)) || (Xsqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0) { if Xsqlite3Config.FbExtraSchemaChecks != 0 { - corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + 1*8)), ts+15222 /* "invalid rootpage" */) + corruptSchema(tls, pData, argv, ts+15686 /* "invalid rootpage" */) } } } @@ -109727,7 +111119,7 @@ func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr // 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 Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFlags U32) int32 { /* sqlite3.c:128520:20: */ +func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFlags U32) int32 { /* sqlite3.c:130255:20: */ bp := tls.Alloc(124) defer tls.Free(124) @@ -109748,7 +111140,7 @@ func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl var xAuth Sqlite3_xauth var zSql uintptr openedTransaction = 0 - mask = (int32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_EncodingFixed) | libc.Uint32FromInt32(libc.CplInt32(DBFLAG_EncodingFixed)))) + mask = (int32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) | libc.Uint32FromInt32(libc.CplInt32(DBFLAG_EncodingFixed)))) (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(1) @@ -109757,16 +111149,16 @@ func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl // table name will be inserted automatically by the parser so we can just // use the abbreviation "x" here. The parser will also automatically tag // the schema table as read-only. - *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */)) = ts + 8236 /* "table" */ + *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */)) = ts + 8329 /* "table" */ *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 1*8)) = libc.AssignUintptr(&zSchemaTabName, func() uintptr { if (!(0 != 0)) && (iDb == 1) { - return ts + 13301 /* "sqlite_temp_mast..." */ + return ts + 13714 /* "sqlite_temp_mast..." */ } - return ts + 7541 /* "sqlite_master" */ + return ts + 7634 /* "sqlite_master" */ }()) *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 2*8)) = *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 1*8)) - *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 3*8)) = ts + 9901 /* "1" */ - *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 4*8)) = ts + 19162 /* "CREATE TABLE x(t..." */ + *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 3*8)) = ts + 9994 /* "1" */ + *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 4*8)) = ts + 19626 /* "CREATE TABLE x(t..." */ *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + 5*8)) = uintptr(0) (*InitData)(unsafe.Pointer(bp + 64 /* &initData */)).Fdb = db (*InitData)(unsafe.Pointer(bp + 64 /* &initData */)).FiDb = iDb @@ -109801,7 +111193,7 @@ __2: // on the b-tree database, open one now. If a transaction is opened, it // will be closed before this function returns. Xsqlite3BtreeEnter(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) - if !(!(Xsqlite3BtreeIsInReadTrans(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != 0)) { + if !(Xsqlite3BtreeTxnState(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) == SQLITE_TXN_NONE) { goto __3 } rc = Xsqlite3BtreeBeginTrans(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, 0, uintptr(0)) @@ -109845,7 +111237,7 @@ __6: goto __7 __7: ; - if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ResetDatabase) != uint64(0)) { + if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ResetDatabase)) != uint64(0)) { goto __8 } libc.Xmemset(tls, bp+104 /* &meta[0] */, 0, uint64(unsafe.Sizeof([5]int32{}))) @@ -109860,7 +111252,7 @@ __8: if !(*(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + 4*4)) != 0) { goto __9 } // text encoding - if !((iDb == 0) && (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_EncodingFixed) == U32(0))) { + if !((iDb == 0) && (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_EncodingFixed)) == U32(0))) { goto __10 } // If opening the main database, set ENC(db). @@ -109868,7 +111260,7 @@ __8: if !(int32(encoding) == 0) { goto __12 } - encoding = SQLITE_UTF8 + encoding = U8(SQLITE_UTF8) __12: ; Xsqlite3SetTextEncoding(tls, db, encoding) @@ -109879,7 +111271,7 @@ __10: goto __13 } Xsqlite3SetString(tls, pzErrMsg, db, - ts+12915 /* "attached databas..." */) + ts+13328 /* "attached databas..." */) rc = SQLITE_ERROR goto initone_error_out __13: @@ -109919,7 +111311,7 @@ __16: if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > SQLITE_MAX_FILE_FORMAT) { goto __17 } - Xsqlite3SetString(tls, pzErrMsg, db, ts+19234 /* "unsupported file..." */) + Xsqlite3SetString(tls, pzErrMsg, db, ts+19698 /* "unsupported file..." */) rc = SQLITE_ERROR goto initone_error_out __17: @@ -109932,7 +111324,7 @@ __17: if !((iDb == 0) && (*(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + 1*4)) >= 4)) { goto __18 } - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_LegacyFileFmt)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_LegacyFileFmt))) __18: ; @@ -109941,7 +111333,7 @@ __18: (*InitData)(unsafe.Pointer(bp + 64 /* &initData */)).FmxPage = Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) zSql = Xsqlite3MPrintf(tls, db, - ts+19258, /* "SELECT*FROM\"%w\"...." */ + ts+19722, /* "SELECT*FROM\"%w\"...." */ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zSchemaTabName)) xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth @@ -109972,7 +111364,7 @@ __20: Xsqlite3ResetAllSchemasOfConnection(tls, db) __21: ; - if !((rc == SQLITE_OK) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_NoSchemaError) != 0)) { + if !((rc == SQLITE_OK) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_NoSchemaError)) != 0)) { goto __22 } // Black magic: If the SQLITE_NoSchemaError flag is set, then consider @@ -110023,10 +111415,10 @@ __24: // // After a database is initialized, the DB_SchemaLoaded bit is set // bit is set in the flags field of the Db structure. -func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:128755:20: */ +func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:130490:20: */ var i int32 var rc int32 - var commit_internal int32 = libc.BoolInt32(!(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaChange) != 0)) + var commit_internal int32 = libc.BoolInt32(!(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != 0)) ((*Sqlite3)(unsafe.Pointer(db)).Fenc) = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb)).FpSchema)).Fenc @@ -110055,7 +111447,7 @@ func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite // This routine is a no-op if the database schema is already initialized. // Otherwise, the schema is loaded. An error code is returned. -func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:128787:20: */ +func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:130522:20: */ var rc int32 = SQLITE_OK var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb @@ -110065,7 +111457,7 @@ func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:1287 (*Parse)(unsafe.Pointer(pParse)).Frc = rc (*Parse)(unsafe.Pointer(pParse)).FnErr++ } else if (*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache != 0 { - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaKnownOk) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaKnownOk)) } } return rc @@ -110074,7 +111466,7 @@ func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:1287 // 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 *libc.TLS, pParse uintptr) { /* sqlite3.c:128809:13: */ +func schemaIsValid(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:130544:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -110093,7 +111485,7 @@ func schemaIsValid(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:128809:13: */ // If there is not already a read-only (or read-write) transaction opened // on the b-tree database, open one now. If a transaction is opened, it // will be closed immediately after reading the meta-value. - if !(Xsqlite3BtreeIsInReadTrans(tls, pBt) != 0) { + if Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_NONE { rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0)) if (rc == SQLITE_NOMEM) || (rc == (SQLITE_IOERR | (int32(12) << 8))) { Xsqlite3OomFault(tls, db) @@ -110126,7 +111518,7 @@ func schemaIsValid(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:128809:13: */ // // If the same database is attached more than once, the first // attached database is returned. -func Xsqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) int32 { /* sqlite3.c:128858:20: */ +func Xsqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) int32 { /* sqlite3.c:130593:20: */ var i int32 = -32768 // If pSchema is NULL, then return -32768. This happens when code in @@ -110152,27 +111544,22 @@ func Xsqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) int32 { / return i } -// Deallocate a single AggInfo object -func agginfoFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:128888:13: */ - Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaCol) - Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaFunc) - Xsqlite3DbFree(tls, db, p) -} - // Free all memory allocations in the pParse object -func Xsqlite3ParserReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:128897:21: */ +func Xsqlite3ParserReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:130623:21: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - var pThis uintptr = (*Parse)(unsafe.Pointer(pParse)).FpAggList - for pThis != 0 { - var pNext uintptr = (*AggInfo)(unsafe.Pointer(pThis)).FpNext - agginfoFree(tls, db, pThis) - pThis = pNext + for (*Parse)(unsafe.Pointer(pParse)).FpCleanup != 0 { + var pCleanup uintptr = (*Parse)(unsafe.Pointer(pParse)).FpCleanup + (*Parse)(unsafe.Pointer(pParse)).FpCleanup = (*ParseCleanup)(unsafe.Pointer(pCleanup)).FpNext + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pCleanup + 16 /* &.xCleanup */))))(tls, db, (*ParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr) + Xsqlite3DbFreeNN(tls, db, pCleanup) } Xsqlite3DbFree(tls, db, (*Parse)(unsafe.Pointer(pParse)).FaLabel) - Xsqlite3ExprListDelete(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpConstExpr) + if (*Parse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { + Xsqlite3ExprListDelete(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpConstExpr) + } if db != 0 { - *(*U32)(unsafe.Pointer(db + 400 /* &.lookaside */ /* &.bDisable */)) -= (U32((*Parse)(unsafe.Pointer(pParse)).FdisableLookaside)) + *(*U32)(unsafe.Pointer(db + 408 /* &.lookaside */ /* &.bDisable */)) -= (U32((*Parse)(unsafe.Pointer(pParse)).FdisableLookaside)) (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 { if (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 { return uint16(0) @@ -110183,34 +111570,74 @@ func Xsqlite3ParserReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:128897:21 (*Parse)(unsafe.Pointer(pParse)).FdisableLookaside = U8(0) } -// Compile the UTF-8 encoded SQL statement zSql into a statement handle. -func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pReprepare uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:128918:12: */ - bp := tls.Alloc(448) - defer tls.Free(448) +// Add a new cleanup operation to a Parser. The cleanup should happen when +// the parser object is destroyed. But, beware: the cleanup might happen +// immediately. +// +// Use this mechanism for uncommon cleanups. There is a higher setup +// cost for this mechansim (an extra malloc), so it should not be used +// for common cleanups that happen on most calls. But for less +// common cleanups, we save a single NULL-pointer comparison in +// sqlite3ParserReset(), which reduces the total CPU cycle count. +// +// If a memory allocation error occurs, then the cleanup happens immediately. +// When either SQLITE_DEBUG or SQLITE_COVERAGE_TEST are defined, the +// pParse->earlyCleanup flag is set in that case. Calling code show verify +// that test cases exist for which this happens, to guard against possible +// use-after-free errors following an OOM. The preferred way to do this is +// to immediately follow the call to this routine with: +// +// testcase( pParse->earlyCleanup ); +// +// This routine returns a copy of its pPtr input (the third parameter) +// except if an early cleanup occurs, in which case it returns NULL. So +// another way to check for early cleanup is to check the return value. +// Or, stop using the pPtr parameter with this call and use only its +// return value thereafter. Something like this: +// +// pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); +func Xsqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) uintptr { /* sqlite3.c:130671:21: */ + var pCleanup uintptr = Xsqlite3DbMallocRaw(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(ParseCleanup{}))) + if pCleanup != 0 { + (*ParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*Parse)(unsafe.Pointer(pParse)).FpCleanup + (*Parse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup + (*ParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr + (*ParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + } else { + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&xCleanup)))(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pPtr) + pPtr = uintptr(0) + } + return pPtr +} - // var zErrMsg uintptr at bp+440, 8 +// Compile the UTF-8 encoded SQL statement zSql into a statement handle. +func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pReprepare uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:130695:12: */ + bp := tls.Alloc(432) + defer tls.Free(432) + + // var zErrMsg uintptr at bp+424, 8 // Error message var rc int32 // Result code var i int32 // Loop counter - // var sParse Parse at bp+16, 424 + // var sParse Parse at bp+16, 408 var zDb uintptr var pBt uintptr var zSqlCopy uintptr var mxLen int32 var pT uintptr - *(*uintptr)(unsafe.Pointer(bp + 440 /* zErrMsg */)) = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 424 /* zErrMsg */)) = uintptr(0) rc = SQLITE_OK // Parsing context - libc.Xmemset(tls, bp+16 /* &sParse */, 0, uint64((uintptr(0) + 212 /* &.aTempReg */))) - libc.Xmemset(tls, ((bp + 16 /* &sParse */) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), 0, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */))))) + libc.Xmemset(tls, bp+16 /* &sParse */, 0, uint64((uintptr(0) + 208 /* &.aTempReg */))) + libc.Xmemset(tls, ((bp + 16 /* &sParse */) + uintptr((uint64((uintptr(0) + 256 /* &.sLastToken */))))), 0, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 256 /* &.sLastToken */))))) (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FpReprepare = pReprepare // assert( !db->mallocFailed ); // not true with SQLITE_USE_ALLOCA // For a long-term use prepared statement avoid the use of // lookaside memory. - if !((prepFlags & SQLITE_PREPARE_PERSISTENT) != 0) { + if !((prepFlags & U32(SQLITE_PREPARE_PERSISTENT)) != 0) { goto __1 } (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FdisableLookaside++ @@ -110218,7 +111645,7 @@ func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepF (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0) __1: ; - (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FdisableVtab = (U8(libc.Bool32((prepFlags & SQLITE_PREPARE_NO_VTAB) != U32(0)))) + (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FdisableVtab = (U8(libc.Bool32((prepFlags & U32(SQLITE_PREPARE_NO_VTAB)) != U32(0)))) // Check to verify that it is possible to get a read lock on all // database schemas. The inability to get a read lock indicates that @@ -110260,7 +111687,7 @@ __3: goto __7 } zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FzDbSName - Xsqlite3ErrorWithMsg(tls, db, rc, ts+19292 /* "database schema ..." */, libc.VaList(bp, zDb)) + Xsqlite3ErrorWithMsg(tls, db, rc, ts+19756 /* "database schema ..." */, libc.VaList(bp, zDb)) goto end_prepare __7: @@ -110283,12 +111710,12 @@ __2: if !((nBytes >= 0) && ((nBytes == 0) || (int32(*(*int8)(unsafe.Pointer(zSql + uintptr((nBytes - 1))))) != 0))) { goto __8 } - mxLen = *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 1*4)) + mxLen = *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 1*4)) if !(nBytes > mxLen) { goto __10 } - Xsqlite3ErrorWithMsg(tls, db, SQLITE_TOOBIG, ts+19322 /* "statement too lo..." */, 0) + Xsqlite3ErrorWithMsg(tls, db, SQLITE_TOOBIG, ts+19786 /* "statement too lo..." */, 0) rc = Xsqlite3ApiExit(tls, db, SQLITE_TOOBIG) goto end_prepare __10: @@ -110297,7 +111724,7 @@ __10: if !(zSqlCopy != 0) { goto __11 } - Xsqlite3RunParser(tls, bp+16 /* &sParse */, zSqlCopy, bp+440 /* &zErrMsg */) + Xsqlite3RunParser(tls, bp+16 /* &sParse */, zSqlCopy, bp+424 /* &zErrMsg */) (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FzTail = (zSql + uintptr(((int64((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzTail) - int64(zSqlCopy)) / 1))) Xsqlite3DbFree(tls, db, zSqlCopy) goto __12 @@ -110307,79 +111734,75 @@ __12: ; goto __9 __8: - Xsqlite3RunParser(tls, bp+16 /* &sParse */, zSql, bp+440 /* &zErrMsg */) + Xsqlite3RunParser(tls, bp+16 /* &sParse */, zSql, bp+424 /* &zErrMsg */) __9: ; - if !((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc == SQLITE_DONE) { + if !(pzTail != 0) { goto __13 } - (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).Frc = SQLITE_OK -__13: - ; - if !((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FcheckSchema != 0) { - goto __14 - } - schemaIsValid(tls, bp+16 /* &sParse */) -__14: - ; - if !(pzTail != 0) { - goto __15 - } *(*uintptr)(unsafe.Pointer(pzTail)) = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FzTail -__15: +__13: ; if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0) { - goto __16 + goto __14 } Xsqlite3VdbeSetSql(tls, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FpVdbe, zSql, (int32((int64((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzTail) - int64(zSql)) / 1)), uint8(prepFlags)) -__16: +__14: ; if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - goto __17 + goto __15 } (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).Frc = SQLITE_NOMEM -__17: +__15: ; - rc = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).Frc - if !(rc != SQLITE_OK) { + if !(((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc != SQLITE_OK) && ((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc != SQLITE_DONE)) { + goto __16 + } + if !((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FcheckSchema != 0) { goto __18 } + schemaIsValid(tls, bp+16 /* &sParse */) +__18: + ; if !((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FpVdbe != 0) { - goto __20 + goto __19 } Xsqlite3VdbeFinalize(tls, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FpVdbe) -__20: - ; - - goto __19 -__18: - *(*uintptr)(unsafe.Pointer(ppStmt)) = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FpVdbe __19: ; - if !(*(*uintptr)(unsafe.Pointer(bp + 440 /* zErrMsg */)) != 0) { - goto __21 + rc = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).Frc + if !(*(*uintptr)(unsafe.Pointer(bp + 424 /* zErrMsg */)) != 0) { + goto __20 } - Xsqlite3ErrorWithMsg(tls, db, rc, ts+824 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 440 /* zErrMsg */)))) - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 440 /* zErrMsg */))) - goto __22 -__21: + Xsqlite3ErrorWithMsg(tls, db, rc, ts+824 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 424 /* zErrMsg */)))) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 424 /* zErrMsg */))) + goto __21 +__20: Xsqlite3Error(tls, db, rc) -__22: +__21: + ; + goto __17 +__16: + ; + *(*uintptr)(unsafe.Pointer(ppStmt)) = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FpVdbe + rc = SQLITE_OK + Xsqlite3ErrorClear(tls, db) +__17: ; // Delete any TriggerPrg structures allocated while parsing this statement. -__23: +__22: if !((*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FpTriggerPrg != 0) { - goto __24 + goto __23 } pT = (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FpTriggerPrg (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FpTriggerPrg = (*TriggerPrg)(unsafe.Pointer(pT)).FpNext Xsqlite3DbFree(tls, db, pT) - goto __23 -__24: + goto __22 +__23: ; end_prepare: @@ -110388,13 +111811,13 @@ end_prepare: return rc } -func sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pOld uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129056:12: */ +func sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pOld uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:130835:12: */ var rc int32 var cnt int32 = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(Xsqlite3SafetyCheckOk(tls, db) != 0) || (zSql == uintptr(0)) { - return Xsqlite3MisuseError(tls, 129073) + return Xsqlite3MisuseError(tls, 130852) } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) Xsqlite3BtreeEnterAll(tls, db) @@ -110409,6 +111832,7 @@ func sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32 Xsqlite3BtreeLeaveAll(tls, db) rc = Xsqlite3ApiExit(tls, db, rc) + (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return rc } @@ -110419,7 +111843,7 @@ func sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32 // if the statement cannot be recompiled because another connection has // locked the sqlite3_schema table, return SQLITE_LOCKED. If any other error // occurs, return SQLITE_SCHEMA. -func Xsqlite3Reprepare(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:129101:20: */ +func Xsqlite3Reprepare(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:130881:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -110458,27 +111882,27 @@ func Xsqlite3Reprepare(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:129101:20: // 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 *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129140:16: */ +func Xsqlite3_prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:130920:16: */ var rc int32 rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, uint32(0), uintptr(0), ppStmt, pzTail) // VERIFY: F13021 return rc } -func Xsqlite3_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129152:16: */ +func Xsqlite3_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:130932:16: */ var rc int32 // EVIDENCE-OF: R-37923-12173 The sqlite3_prepare_v2() interface works // exactly the same as sqlite3_prepare_v3() with a zero prepFlags // parameter. // // Proof in that the 5th parameter to sqlite3LockAndPrepare is 0 - rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, SQLITE_PREPARE_SAVESQL, uintptr(0), + rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL), uintptr(0), ppStmt, pzTail) return rc } -func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129170:16: */ +func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:130950:16: */ var rc int32 // EVIDENCE-OF: R-56861-42673 sqlite3_prepare_v3() differs from // sqlite3_prepare_v2() only in having the extra prepFlags parameter, @@ -110488,14 +111912,14 @@ func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, // Proof by comparison to the implementation of sqlite3_prepare_v2() // directly above. rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, - (SQLITE_PREPARE_SAVESQL | (prepFlags & SQLITE_PREPARE_MASK)), + (uint32(SQLITE_PREPARE_SAVESQL) | (prepFlags & uint32(SQLITE_PREPARE_MASK))), uintptr(0), ppStmt, pzTail) return rc } // Compile the UTF-16 encoded SQL statement zSql into a statement handle. -func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129198:12: */ +func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:130978:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -110508,7 +111932,7 @@ func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pre *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(Xsqlite3SafetyCheckOk(tls, db) != 0) || (zSql == uintptr(0)) { - return Xsqlite3MisuseError(tls, 129219) + return Xsqlite3MisuseError(tls, 130999) } if nBytes >= 0 { var sz int32 @@ -110518,7 +111942,7 @@ func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pre nBytes = sz } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - zSql8 = Xsqlite3Utf16to8(tls, db, zSql, nBytes, SQLITE_UTF16LE) + zSql8 = Xsqlite3Utf16to8(tls, db, zSql, nBytes, uint8(SQLITE_UTF16LE)) if zSql8 != 0 { rc = sqlite3LockAndPrepare(tls, db, zSql8, -1, prepFlags, uintptr(0), ppStmt, bp /* &zTail8 */) } @@ -110543,24 +111967,24 @@ func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pre // 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 *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129256:16: */ +func Xsqlite3_prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:131036:16: */ var rc int32 rc = sqlite3Prepare16(tls, db, zSql, nBytes, uint32(0), ppStmt, pzTail) // VERIFY: F13021 return rc } -func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129268:16: */ +func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:131048:16: */ var rc int32 - rc = sqlite3Prepare16(tls, db, zSql, nBytes, SQLITE_PREPARE_SAVESQL, ppStmt, pzTail) + rc = sqlite3Prepare16(tls, db, zSql, nBytes, uint32(SQLITE_PREPARE_SAVESQL), ppStmt, pzTail) // VERIFY: F13021 return rc } -func Xsqlite3_prepare16_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129280:16: */ +func Xsqlite3_prepare16_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:131060:16: */ var rc int32 rc = sqlite3Prepare16(tls, db, zSql, nBytes, - (SQLITE_PREPARE_SAVESQL | (prepFlags & SQLITE_PREPARE_MASK)), + (uint32(SQLITE_PREPARE_SAVESQL) | (prepFlags & uint32(SQLITE_PREPARE_MASK))), ppStmt, pzTail) // VERIFY: F13021 return rc @@ -110591,7 +112015,7 @@ type DistinctCtx1 = struct { _ [2]byte FtabTnct int32 FaddrTnct int32 -} /* sqlite3.c:129321:9 */ +} /* sqlite3.c:131101:9 */ //************* End of prepare.c ******************************************** //************* Begin file select.c ***************************************** @@ -110612,7 +112036,7 @@ type DistinctCtx1 = struct { // An instance of the following object is used to record information about // how to process the DISTINCT keyword, to simplify passing that information // into the selectInnerLoop() routine. -type DistinctCtx = DistinctCtx1 /* sqlite3.c:129321:28 */ +type DistinctCtx = DistinctCtx1 /* sqlite3.c:131101:28 */ // An instance of the following object is used to record information about // the ORDER BY (or GROUP BY) clause of query is being coded. @@ -110642,7 +112066,7 @@ type SortCtx1 = struct { FsortFlags U8 _ [3]byte FpDeferredRowLoad uintptr -} /* sqlite3.c:129347:9 */ +} /* sqlite3.c:131127:9 */ // An instance of the following object is used to record information about // the ORDER BY (or GROUP BY) clause of query is being coded. @@ -110660,19 +112084,19 @@ type SortCtx1 = struct { // When the sorter-reference optimization is used, there is one entry in the // aDefer[] array for each database table that may be read as values are // extracted from the sorter. -type SortCtx = SortCtx1 /* sqlite3.c:129347:24 */ +type SortCtx = SortCtx1 /* sqlite3.c:131127:24 */ type RowLoadInfo1 = struct { FregResult int32 FecelFlags U8 _ [3]byte -} /* sqlite3.c:129347:9 */ +} /* sqlite3.c:131127:9 */ // Delete all the content of a Select structure. Deallocate the structure // itself depending on the value of bFree // // If bFree==1, call sqlite3DbFree() on the p object. // If bFree==0, Leave the first Select object unfreed -func clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3.c:129377:13: */ +func clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3.c:131157:13: */ for p != 0 { var pPrior uintptr = (*Select)(unsafe.Pointer(p)).FpPrior Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpEList) @@ -110682,11 +112106,15 @@ func clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3 Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpHaving) Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpOrderBy) Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit) + if (*Select)(unsafe.Pointer(p)).FpWith != 0 { + Xsqlite3WithDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpWith) + } if (*Select)(unsafe.Pointer(p)).FpWinDefn != 0 { Xsqlite3WindowListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpWinDefn) } - if (*Select)(unsafe.Pointer(p)).FpWith != 0 { - Xsqlite3WithDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpWith) + for (*Select)(unsafe.Pointer(p)).FpWin != 0 { + + Xsqlite3WindowUnlinkFromSelect(tls, (*Select)(unsafe.Pointer(p)).FpWin) } if bFree != 0 { Xsqlite3DbFreeNN(tls, db, p) @@ -110697,7 +112125,7 @@ func clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3 } // Initialize a SelectDest structure. -func Xsqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int32) { /* sqlite3.c:129402:21: */ +func Xsqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int32) { /* sqlite3.c:131186:21: */ (*SelectDest)(unsafe.Pointer(pDest)).FeDest = U8(eDest) (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm = iParm (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = 0 @@ -110708,7 +112136,7 @@ func Xsqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int // Allocate a new Select structure and return a pointer to that // structure. -func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintptr, pWhere uintptr, pGroupBy uintptr, pHaving uintptr, pOrderBy uintptr, selFlags U32, pLimit uintptr) uintptr { /* sqlite3.c:129416:23: */ +func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintptr, pWhere uintptr, pGroupBy uintptr, pHaving uintptr, pOrderBy uintptr, selFlags U32, pLimit uintptr) uintptr { /* sqlite3.c:131200:23: */ bp := tls.Alloc(128) defer tls.Free(128) @@ -110726,7 +112154,7 @@ func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ASTERISK, uintptr(0))) } (*Select)(unsafe.Pointer(pNew)).FpEList = pEList - (*Select)(unsafe.Pointer(pNew)).Fop = TK_SELECT + (*Select)(unsafe.Pointer(pNew)).Fop = U8(TK_SELECT) (*Select)(unsafe.Pointer(pNew)).FselFlags = selFlags (*Select)(unsafe.Pointer(pNew)).FiLimit = 0 (*Select)(unsafe.Pointer(pNew)).FiOffset = 0 @@ -110758,14 +112186,14 @@ func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp } // Delete the given Select structure and all of its substructures. -func Xsqlite3SelectDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:129474:21: */ +func Xsqlite3SelectDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:131258:21: */ if p != 0 { clearSelect(tls, db, p, 1) } } // Return a pointer to the right-most SELECT statement in a compound. -func findRightmost(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:129481:15: */ +func findRightmost(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:131265:15: */ for (*Select)(unsafe.Pointer(p)).FpNext != 0 { p = (*Select)(unsafe.Pointer(p)).FpNext } @@ -110787,7 +112215,7 @@ func findRightmost(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:129481:15: * // // If an illegal or unsupported join type is seen, then still return // a join type, but put an error in the pParse structure. -func Xsqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC uintptr) int32 { /* sqlite3.c:129503:20: */ +func Xsqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC uintptr) int32 { /* sqlite3.c:131287:20: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -110824,41 +112252,41 @@ func Xsqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC } } if ((jointype & (JT_INNER | JT_OUTER)) == (JT_INNER | JT_OUTER)) || ((jointype & JT_ERROR) != 0) { - var zSp uintptr = ts + 16003 /* " " */ + var zSp uintptr = ts + 12479 /* " " */ if pC == uintptr(0) { zSp++ } Xsqlite3ErrorMsg(tls, pParse, - ts+19341 /* "unknown or unsup..." */, libc.VaList(bp, pA, pB, zSp, pC)) + ts+19805 /* "unknown or unsup..." */, libc.VaList(bp, pA, pB, zSp, pC)) jointype = JT_INNER } else if ((jointype & JT_OUTER) != 0) && ((jointype & (JT_LEFT | JT_RIGHT)) != JT_LEFT) { Xsqlite3ErrorMsg(tls, pParse, - ts+19385 /* "RIGHT and FULL O..." */, 0) + ts+19849 /* "RIGHT and FULL O..." */, 0) jointype = JT_INNER } return jointype } -var zKeyText = *(*[34]int8)(unsafe.Pointer(ts + 19440 /* "naturaleftouteri..." */)) /* sqlite3.c:129508:21 */ +var zKeyText = *(*[34]int8)(unsafe.Pointer(ts + 19904 /* "naturaleftouteri..." */)) /* sqlite3.c:131292:21 */ var aKeyword = [7]struct { Fi U8 FnChar U8 Fcode U8 }{ - /* natural */ {FnChar: U8(7), Fcode: JT_NATURAL}, + /* natural */ {FnChar: U8(7), Fcode: U8(JT_NATURAL)}, /* left */ {Fi: U8(6), FnChar: U8(4), Fcode: (U8(JT_LEFT | JT_OUTER))}, - /* outer */ {Fi: U8(10), FnChar: U8(5), Fcode: JT_OUTER}, + /* outer */ {Fi: U8(10), FnChar: U8(5), Fcode: U8(JT_OUTER)}, /* right */ {Fi: U8(14), FnChar: U8(5), Fcode: (U8(JT_RIGHT | JT_OUTER))}, /* full */ {Fi: U8(19), FnChar: U8(4), Fcode: (U8((JT_LEFT | JT_RIGHT) | JT_OUTER))}, - /* inner */ {Fi: U8(23), FnChar: U8(5), Fcode: JT_INNER}, + /* inner */ {Fi: U8(23), FnChar: U8(5), Fcode: U8(JT_INNER)}, /* cross */ {Fi: U8(28), FnChar: U8(5), Fcode: (U8(JT_INNER | JT_CROSS))}, -} /* sqlite3.c:129513:5 */ +} /* sqlite3.c:131297:5 */ // Return the index of a column in a table. Return -1 if the column // is not contained in the table. -func columnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) int32 { /* sqlite3.c:129564:12: */ +func Xsqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) int32 { /* sqlite3.c:131348:20: */ var i int32 var h U8 = Xsqlite3StrIHash(tls, zCol) var pCol uintptr @@ -110892,15 +112320,15 @@ __3: // of the matching column and return TRUE. // // If not found, return FALSE. -func tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, N int32, zCol uintptr, piTab uintptr, piCol uintptr, bIgnoreHidden int32) int32 { /* sqlite3.c:129583:12: */ +func tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, N int32, zCol uintptr, piTab uintptr, piCol uintptr, bIgnoreHidden int32) int32 { /* sqlite3.c:131367:12: */ var i int32 // For looping over tables in pSrc var iCol int32 // Index of column matching zCol // Both or neither are NULL for i = 0; i < N; i++ { - iCol = columnIndex(tls, (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpTab, zCol) + iCol = Xsqlite3ColumnIndex(tls, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpTab, zCol) if (iCol >= 0) && - ((bIgnoreHidden == 0) || ((libc.Bool32((int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpTab)).FaCol + uintptr(iCol)*32))).FcolFlags) & COLFLAG_HIDDEN) != 0)) == 0)) { + ((bIgnoreHidden == 0) || ((libc.Bool32((int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpTab)).FaCol + uintptr(iCol)*32))).FcolFlags) & COLFLAG_HIDDEN) != 0)) == 0)) { if piTab != 0 { *(*int32)(unsafe.Pointer(piTab)) = i *(*int32)(unsafe.Pointer(piCol)) = iCol @@ -110920,7 +112348,7 @@ func tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, N int32, zCol uintptr, piT // 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 *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iColLeft int32, iRight int32, iColRight int32, isOuterJoin int32, ppWhere uintptr) { /* sqlite3.c:129621:13: */ +func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iColLeft int32, iRight int32, iColRight int32, isOuterJoin int32, ppWhere uintptr) { /* sqlite3.c:131405:13: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pE1 uintptr var pE2 uintptr @@ -110931,9 +112359,9 @@ func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iCol pEq = Xsqlite3PExpr(tls, pParse, TK_EQ, pE1, pE2) if (pEq != 0) && (isOuterJoin != 0) { - *(*U32)(unsafe.Pointer(pEq + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(pEq + 4 /* &.flags */)) |= (U32(EP_FromJoin)) - (*Expr)(unsafe.Pointer(pEq)).FiRightJoinTable = I16((*Expr)(unsafe.Pointer(pE2)).FiTable) + (*Expr)(unsafe.Pointer(pEq)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pE2)).FiTable } *(*uintptr)(unsafe.Pointer(ppWhere)) = Xsqlite3ExprAnd(tls, pParse, *(*uintptr)(unsafe.Pointer(ppWhere)), pEq) } @@ -110962,11 +112390,11 @@ func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iCol // 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 Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:129680:21: */ +func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:131464:21: */ for p != 0 { - *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (EP_FromJoin) + *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (U32(EP_FromJoin)) - (*Expr)(unsafe.Pointer(p)).FiRightJoinTable = I16(iTable) + (*Expr)(unsafe.Pointer(p)).FiRightJoinTable = iTable if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION) && (*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0) { var i int32 for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)))).FnExpr; i++ { @@ -110983,12 +112411,15 @@ func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c: // an ordinary term that omits the EP_FromJoin mark. // // This happens when a LEFT JOIN is simplified into an ordinary JOIN. -func unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:129703:13: */ +func unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:131487:13: */ for p != 0 { - if (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_FromJoin)) != U32(0)) && - ((iTable < 0) || (int32((*Expr)(unsafe.Pointer(p)).FiRightJoinTable) == iTable)) { + if (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_FromJoin))) != U32(0)) && + ((iTable < 0) || ((*Expr)(unsafe.Pointer(p)).FiRightJoinTable == iTable)) { *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_FromJoin))) } + if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(p)).FiTable == iTable) { + *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_CanBeNull))) + } if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_FUNCTION) && (*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0) { var i int32 for i = 0; i < (*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)))).FnExpr; i++ { @@ -111012,7 +112443,7 @@ func unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:129703 // also attached to the left entry. // // This routine returns the number of errors encountered. -func sqliteProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:129734:12: */ +func sqliteProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:131521:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -111031,20 +112462,20 @@ __1: goto __3 } { - var pRightTab uintptr = (*SrcList_item)(unsafe.Pointer(pRight)).FpTab + var pRightTab uintptr = (*SrcItem)(unsafe.Pointer(pRight)).FpTab var isOuter int32 - if ((*SrcList_item)(unsafe.Pointer(pLeft)).FpTab == uintptr(0)) || (pRightTab == uintptr(0)) { + if ((*SrcItem)(unsafe.Pointer(pLeft)).FpTab == uintptr(0)) || (pRightTab == uintptr(0)) { goto __2 } - isOuter = (libc.Bool32((int32((*SrcList_item)(unsafe.Pointer(pRight)).Ffg.Fjointype) & JT_OUTER) != 0)) + isOuter = (libc.Bool32((int32((*SrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype) & JT_OUTER) != 0)) // When the NATURAL keyword is present, add WHERE clause terms for // every column that the two tables have in common. - if (int32((*SrcList_item)(unsafe.Pointer(pRight)).Ffg.Fjointype) & JT_NATURAL) != 0 { - if ((*SrcList_item)(unsafe.Pointer(pRight)).FpOn != 0) || ((*SrcList_item)(unsafe.Pointer(pRight)).FpUsing != 0) { + if (int32((*SrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype) & JT_NATURAL) != 0 { + if ((*SrcItem)(unsafe.Pointer(pRight)).FpOn != 0) || ((*SrcItem)(unsafe.Pointer(pRight)).FpUsing != 0) { Xsqlite3ErrorMsg(tls, pParse, - ts+19474 /* "a NATURAL join m..." */, libc.VaList(bp, 0)) + ts+19938 /* "a NATURAL join m..." */, libc.VaList(bp, 0)) return 1 } for j = 0; j < int32((*Table)(unsafe.Pointer(pRightTab)).FnCol); j++ { @@ -111066,20 +112497,20 @@ __1: } // Disallow both ON and USING clauses in the same join - if ((*SrcList_item)(unsafe.Pointer(pRight)).FpOn != 0) && ((*SrcList_item)(unsafe.Pointer(pRight)).FpUsing != 0) { + if ((*SrcItem)(unsafe.Pointer(pRight)).FpOn != 0) && ((*SrcItem)(unsafe.Pointer(pRight)).FpUsing != 0) { Xsqlite3ErrorMsg(tls, pParse, - ts+19524 /* "cannot have both..." */, 0) + ts+19988 /* "cannot have both..." */, 0) return 1 } // Add the ON clause to the end of the WHERE clause, connected by // an AND operator. - if (*SrcList_item)(unsafe.Pointer(pRight)).FpOn != 0 { + if (*SrcItem)(unsafe.Pointer(pRight)).FpOn != 0 { if isOuter != 0 { - Xsqlite3SetJoinExpr(tls, (*SrcList_item)(unsafe.Pointer(pRight)).FpOn, (*SrcList_item)(unsafe.Pointer(pRight)).FiCursor) + Xsqlite3SetJoinExpr(tls, (*SrcItem)(unsafe.Pointer(pRight)).FpOn, (*SrcItem)(unsafe.Pointer(pRight)).FiCursor) } - (*Select)(unsafe.Pointer(p)).FpWhere = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcList_item)(unsafe.Pointer(pRight)).FpOn) - (*SrcList_item)(unsafe.Pointer(pRight)).FpOn = uintptr(0) + (*Select)(unsafe.Pointer(p)).FpWhere = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pRight)).FpOn) + (*SrcItem)(unsafe.Pointer(pRight)).FpOn = uintptr(0) } // Create extra terms on the WHERE clause for each column named @@ -111088,8 +112519,8 @@ __1: // to the WHERE clause: A.X=B.X AND A.Y=B.Y AND A.Z=B.Z // Report an error if any column mentioned in the USING clause is // not contained in both tables to be joined. - if (*SrcList_item)(unsafe.Pointer(pRight)).FpUsing != 0 { - var pList uintptr = (*SrcList_item)(unsafe.Pointer(pRight)).FpUsing + if (*SrcItem)(unsafe.Pointer(pRight)).FpUsing != 0 { + var pList uintptr = (*SrcItem)(unsafe.Pointer(pRight)).FpUsing for j = 0; j < (*IdList)(unsafe.Pointer(pList)).FnId; j++ { var zName uintptr // Name of the term in the USING clause // var iLeft int32 at bp+24, 4 @@ -111099,11 +112530,11 @@ __1: var iRightCol int32 // Column number of matching column on the right zName = (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pList)).Fa + uintptr(j)*16)).FzName - iRightCol = columnIndex(tls, pRightTab, zName) + iRightCol = Xsqlite3ColumnIndex(tls, pRightTab, zName) if (iRightCol < 0) || !(tableAndColumnIndex(tls, pSrc, (i+1), zName, bp+24 /* &iLeft */, bp+28 /* &iLeftCol */, 0) != 0) { Xsqlite3ErrorMsg(tls, pParse, - ts+19579 /* "cannot join usin..." */, libc.VaList(bp+8, zName)) + ts+20043 /* "cannot join usin..." */, libc.VaList(bp+8, zName)) return 1 } addWhereTerm(tls, pParse, pSrc, *(*int32)(unsafe.Pointer(bp + 24 /* iLeft */)), *(*int32)(unsafe.Pointer(bp + 28 /* iLeftCol */)), (i + 1), iRightCol, @@ -111126,11 +112557,11 @@ __3: // An instance of this object holds information (beyond pParse and pSelect) // needed to load the next result row that is to be added to the sorter. -type RowLoadInfo = RowLoadInfo1 /* sqlite3.c:129826:28 */ +type RowLoadInfo = RowLoadInfo1 /* sqlite3.c:131613:28 */ // This routine does the work of loading query data into an array of // registers so that it can be added to the sorter. -func innerLoopLoadRow(tls *libc.TLS, pParse uintptr, pSelect uintptr, pInfo uintptr) { /* sqlite3.c:129840:13: */ +func innerLoopLoadRow(tls *libc.TLS, pParse uintptr, pSelect uintptr, pInfo uintptr) { /* sqlite3.c:131627:13: */ Xsqlite3ExprCodeExprList(tls, pParse, (*Select)(unsafe.Pointer(pSelect)).FpEList, (*RowLoadInfo)(unsafe.Pointer(pInfo)).FregResult, 0, (*RowLoadInfo)(unsafe.Pointer(pInfo)).FecelFlags) } @@ -111139,7 +112570,7 @@ func innerLoopLoadRow(tls *libc.TLS, pParse uintptr, pSelect uintptr, pInfo uint // added into the sorter. // // Return the register in which the result is stored. -func makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regBase int32, nBase int32) int32 { /* sqlite3.c:129861:12: */ +func makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regBase int32, nBase int32) int32 { /* sqlite3.c:131648:12: */ var nOBSat int32 = (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var regOut int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) @@ -111152,7 +112583,7 @@ func makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uint // Generate code that will push the record in registers regData // through regData+nData-1 onto the sorter. -func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regData int32, regOrigData int32, nData int32, nPrefixReg int32) { /* sqlite3.c:129882:13: */ +func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regData int32, regOrigData int32, nData int32, nPrefixReg int32) { /* sqlite3.c:131669:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Stmt under construction var bSeq int32 = (libc.Bool32((int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags) & SORTFLAG_UseSorter) == 0)) var nExpr int32 = (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy)).FnExpr // No. of ORDER BY terms @@ -111295,10 +112726,10 @@ func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintpt } // Add code to implement the OFFSET -func codeOffset(tls *libc.TLS, v uintptr, iOffset int32, iContinue int32) { /* sqlite3.c:130024:13: */ +func codeOffset(tls *libc.TLS, v uintptr, iOffset int32, iContinue int32) { /* sqlite3.c:131811:13: */ if iOffset > 0 { Xsqlite3VdbeAddOp3(tls, v, OP_IfPos, iOffset, iContinue, 1) - Xsqlite3VdbeComment(tls, v, ts+19643 /* "OFFSET" */, 0) + Xsqlite3VdbeComment(tls, v, ts+20107 /* "OFFSET" */, 0) } } @@ -111309,7 +112740,7 @@ func codeOffset(tls *libc.TLS, v uintptr, iOffset int32, iContinue int32) { /* s // // 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 *libc.TLS, pParse uintptr, iTab int32, addrRepeat int32, N int32, iMem int32) { /* sqlite3.c:130044:13: */ +func codeDistinct(tls *libc.TLS, pParse uintptr, iTab int32, addrRepeat int32, N int32, iMem int32) { /* sqlite3.c:131831:13: */ var v uintptr var r1 int32 @@ -111318,7 +112749,7 @@ func codeDistinct(tls *libc.TLS, pParse uintptr, iTab int32, addrRepeat int32, N Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iTab, addrRepeat, iMem, N) Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, iMem, N, r1) Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iTab, r1, iMem, N) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) Xsqlite3ReleaseTempReg(tls, pParse, r1) } @@ -111329,7 +112760,7 @@ func codeDistinct(tls *libc.TLS, pParse uintptr, iTab int32, addrRepeat int32, N // are evaluated in order to get the data for this row. If srcTab is // zero or more, then data is pulled from srcTab and p->pEList is used only // to get the number of columns and the collation sequence for each column. -func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSort uintptr, pDistinct uintptr, pDest uintptr, iContinue int32, iBreak int32) { /* sqlite3.c:130153:13: */ +func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSort uintptr, pDistinct uintptr, pDest uintptr, iContinue int32, iBreak int32) { /* sqlite3.c:131940:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -111398,7 +112829,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo var ecelFlags U8 // "ecel" is an abbreviation of "ExprCodeExprList" var pEList uintptr if ((eDest == SRT_Mem) || (eDest == SRT_Output)) || (eDest == SRT_Coroutine) { - ecelFlags = SQLITE_ECEL_DUP + ecelFlags = U8(SQLITE_ECEL_DUP) } else { ecelFlags = U8(0) } @@ -111464,7 +112895,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo // row is all NULLs. Xsqlite3VdbeChangeToNoop(tls, v, (*DistinctCtx)(unsafe.Pointer(pDistinct)).FaddrTnct) pOp = Xsqlite3VdbeGetOp(tls, v, (*DistinctCtx)(unsafe.Pointer(pDistinct)).FaddrTnct) - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Null + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Null) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = 1 (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = regPrev pOp = uintptr(0) // Ensure pOp is not used after sqlite3VdbeAddOp() @@ -111480,7 +112911,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo } Xsqlite3VdbeChangeP4(tls, v, -1, pColl, -2) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NULLEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ)) } Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regResult, regPrev, (nResultCol - 1)) @@ -111566,7 +112997,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo var r2 int32 = Xsqlite3GetTempReg(tls, pParse) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iParm, r2) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, r1, r2) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3ReleaseTempReg(tls, pParse, r2) } Xsqlite3ReleaseTempRange(tls, pParse, r1, (nPrefixReg + 1)) @@ -111699,7 +113130,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regResult, nResultCol, r3) if eDest == SRT_DistQueue { Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, (iParm + 1), r3) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) } for i = 0; i < nKey; i++ { Xsqlite3VdbeAddOp2(tls, v, OP_SCopy, @@ -111740,7 +113171,7 @@ func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSo // Allocate a KeyInfo object sufficient for an index of N key columns and // X extra columns. -func Xsqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) uintptr { /* sqlite3.c:130595:24: */ +func Xsqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) uintptr { /* sqlite3.c:132382:24: */ var nExtra int32 = (int32(((uint64(N + X)) * (uint64(unsafe.Sizeof(uintptr(0))) + uint64(1))) - uint64(unsafe.Sizeof(uintptr(0))))) var p uintptr = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint64(unsafe.Sizeof(KeyInfo{})) + uint64(nExtra)))) if p != 0 { @@ -111758,7 +113189,7 @@ func Xsqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) uintptr { } // Deallocate a KeyInfo object -func Xsqlite3KeyInfoUnref(tls *libc.TLS, p uintptr) { /* sqlite3.c:130615:21: */ +func Xsqlite3KeyInfoUnref(tls *libc.TLS, p uintptr) { /* sqlite3.c:132402:21: */ if p != 0 { (*KeyInfo)(unsafe.Pointer(p)).FnRef-- @@ -111769,7 +113200,7 @@ func Xsqlite3KeyInfoUnref(tls *libc.TLS, p uintptr) { /* sqlite3.c:130615:21: */ } // Make a new pointer to a KeyInfo object -func Xsqlite3KeyInfoRef(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:130626:24: */ +func Xsqlite3KeyInfoRef(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:132413:24: */ if p != 0 { (*KeyInfo)(unsafe.Pointer(p)).FnRef++ @@ -111789,7 +113220,7 @@ func Xsqlite3KeyInfoRef(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:130626: // Space to hold the KeyInfo structure is obtained from malloc. The calling // function is responsible for seeing that this structure is eventually // freed. -func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, iStart int32, nExtra int32) uintptr { /* sqlite3.c:130658:24: */ +func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, iStart int32, nExtra int32) uintptr { /* sqlite3.c:132445:24: */ var nExpr int32 var pInfo uintptr var pItem uintptr @@ -111823,20 +113254,20 @@ func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, i } // Name of the connection operator, used for error messages. -func selectOpName(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:130685:19: */ +func Xsqlite3SelectOpName(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:132472:27: */ var z uintptr switch id { case TK_ALL: - z = ts + 19650 /* "UNION ALL" */ + z = ts + 20114 /* "UNION ALL" */ break case TK_INTERSECT: - z = ts + 19660 /* "INTERSECT" */ + z = ts + 20124 /* "INTERSECT" */ break case TK_EXCEPT: - z = ts + 19670 /* "EXCEPT" */ + z = ts + 20134 /* "EXCEPT" */ break default: - z = ts + 19677 /* "UNION" */ + z = ts + 20141 /* "UNION" */ break } return z @@ -111850,11 +113281,11 @@ func selectOpName(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:130685:19: */ // // where xxx is one of "DISTINCT", "ORDER BY" or "GROUP BY". Exactly which // is determined by the zUsage argument. -func explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { /* sqlite3.c:130707:13: */ +func explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { /* sqlite3.c:132494:13: */ bp := tls.Alloc(8) defer tls.Free(8) - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+19683 /* "USE TEMP B-TREE ..." */, libc.VaList(bp, zUsage)) + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+20147 /* "USE TEMP B-TREE ..." */, libc.VaList(bp, zUsage)) } // Assign expression b to lvalue a. A second, no-op, version of this macro @@ -111867,7 +113298,7 @@ func explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { /* sqlite // 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 *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nColumn int32, pDest uintptr) { /* sqlite3.c:130733:13: */ +func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nColumn int32, pDest uintptr) { /* sqlite3.c:132520:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -111960,7 +113391,7 @@ func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, n Xsqlite3VdbeAddOp3(tls, v, OP_Column, iSortTab, (nKey + bSeq), regRow) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, iParm, regRowid) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iParm, regRow, regRowid) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) break } @@ -112047,7 +113478,7 @@ func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, n // // This routine has either 3 or 6 parameters depending on whether or not // the SQLITE_ENABLE_COLUMN_METADATA compile-time option is used. -func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, pzOrigTab uintptr, pzOrigCol uintptr) uintptr { /* sqlite3.c:130958:19: */ +func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, pzOrigTab uintptr, pzOrigCol uintptr) uintptr { /* sqlite3.c:132745:19: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -112068,11 +113499,11 @@ func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, var iCol int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) // Index of column in pTab for (pNC != 0) && !(pTab != 0) { var pTabList uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpSrcList - for j = 0; (j < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) && ((*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(j)*112)).FiCursor != (*Expr)(unsafe.Pointer(pExpr)).FiTable); j++ { + for j = 0; (j < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) && ((*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(j)*112)).FiCursor != (*Expr)(unsafe.Pointer(pExpr)).FiTable); j++ { } if j < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc { - pTab = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(j)*112)).FpTab - pS = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(j)*112)).FpSelect + pTab = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(j)*112)).FpTab + pS = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(j)*112)).FpSelect } else { pNC = (*NameContext)(unsafe.Pointer(pNC)).FpNext } @@ -112123,8 +113554,8 @@ func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, } if iCol < 0 { - zType = ts + 13762 /* "INTEGER" */ - *(*uintptr)(unsafe.Pointer(bp + 72 /* zOrigCol */)) = ts + 10064 /* "rowid" */ + zType = ts + 14226 /* "INTEGER" */ + *(*uintptr)(unsafe.Pointer(bp + 72 /* zOrigCol */)) = ts + 10157 /* "rowid" */ } else { *(*uintptr)(unsafe.Pointer(bp + 72 /* zOrigCol */)) = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).FzName zType = Xsqlite3ColumnType(tls, ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32), uintptr(0)) @@ -112168,7 +113599,7 @@ func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, // Generate code that will tell the VDBE the declaration types of columns // in the result set. -func generateColumnTypes(tls *libc.TLS, pParse uintptr, pTabList uintptr, pEList uintptr) { /* sqlite3.c:131101:13: */ +func generateColumnTypes(tls *libc.TLS, pParse uintptr, pTabList uintptr, pEList uintptr) { /* sqlite3.c:132888:13: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -112225,7 +113656,7 @@ func generateColumnTypes(tls *libc.TLS, pParse uintptr, pTabList uintptr, pEList // full=ON, short=ANY: If the result refers directly to a table column, // then the result column name with the table name // prefix, ex: TABLE.COLUMN. Otherwise use zSpan. -func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:131168:13: */ +func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:132955:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -112255,8 +113686,8 @@ func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sq pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList (*Parse)(unsafe.Pointer(pParse)).FcolNamesSet = U8(1) - fullName = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_FullColNames) != uint64(0))) - srcName = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ShortColNames) != uint64(0)) || (fullName != 0))) + fullName = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_FullColNames)) != uint64(0))) + srcName = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ShortColNames)) != uint64(0)) || (fullName != 0))) Xsqlite3VdbeSetNumCols(tls, v, (*ExprList)(unsafe.Pointer(pEList)).FnExpr) for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ { var p uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*32)).FpExpr @@ -112277,13 +113708,13 @@ func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sq } if iCol < 0 { - zCol = ts + 10064 /* "rowid" */ + zCol = ts + 10157 /* "rowid" */ } else { zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).FzName } if fullName != 0 { var zName uintptr = uintptr(0) - zName = Xsqlite3MPrintf(tls, db, ts+9997 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, zCol)) + zName = Xsqlite3MPrintf(tls, db, ts+10090 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, zCol)) Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) } else { Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, libc.UintptrFromInt32(-1)) @@ -112291,7 +113722,7 @@ func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sq } else { var z uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*32)).FzEName if z == uintptr(0) { - z = Xsqlite3MPrintf(tls, db, ts+19706 /* "column%d" */, libc.VaList(bp+16, (i+1))) + z = Xsqlite3MPrintf(tls, db, ts+20170 /* "column%d" */, libc.VaList(bp+16, (i+1))) } else { z = Xsqlite3DbStrDup(tls, db, z) } @@ -112321,7 +113752,7 @@ func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sq // when modifying this routine to avoid breaking legacy. // // See Also: generateColumnNames() -func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, pnCol uintptr, paCol uintptr) int32 { /* sqlite3.c:131260:20: */ +func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, pnCol uintptr, paCol uintptr) int32 { /* sqlite3.c:133047:20: */ bp := tls.Alloc(60) defer tls.Free(60) @@ -112337,6 +113768,7 @@ func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, var nName int32 // Size of name in zName[] // var ht Hash at bp+32, 24 // Hash table of column names + var pTab uintptr Xsqlite3HashInit(tls, bp+32 /* &ht */) if pEList != 0 { @@ -112366,22 +113798,20 @@ __1: // If the column contains an "AS " phrase, use as the name } else { var pColExpr uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*32)).FpExpr) - for int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_DOT { + for (pColExpr != uintptr(0)) && (int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_DOT) { pColExpr = (*Expr)(unsafe.Pointer(pColExpr)).FpRight } - if int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_COLUMN { + if (int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_COLUMN) && ((libc.AssignUintptr(&pTab, *(*uintptr)(unsafe.Pointer(pColExpr + 64 /* &.y */)))) != uintptr(0)) { // For columns use the column name name var iCol int32 = int32((*Expr)(unsafe.Pointer(pColExpr)).FiColumn) - var pTab uintptr = *(*uintptr)(unsafe.Pointer(pColExpr + 64 /* &.y */)) - if iCol < 0 { iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey) } if iCol >= 0 { zName = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).FzName } else { - zName = ts + 10064 /* "rowid" */ + zName = ts + 10157 /* "rowid" */ } } else if int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == TK_ID { @@ -112394,7 +113824,7 @@ __1: if (zName != 0) && !(Xsqlite3IsTrueOrFalse(tls, zName) != 0) { zName = Xsqlite3DbStrDup(tls, db, zName) } else { - zName = Xsqlite3MPrintf(tls, db, ts+19706 /* "column%d" */, libc.VaList(bp, (i+1))) + zName = Xsqlite3MPrintf(tls, db, ts+20170 /* "column%d" */, libc.VaList(bp, (i+1))) } // Make sure the column name is unique. If the name is not unique, @@ -112409,7 +113839,7 @@ __1: nName = j } } - zName = Xsqlite3MPrintf(tls, db, ts+19715 /* "%.*z:%u" */, libc.VaList(bp+8, nName, zName, libc.PreIncUint32(&*(*U32)(unsafe.Pointer(bp + 56 /* cnt */)), 1))) + zName = Xsqlite3MPrintf(tls, db, ts+20179 /* "%.*z:%u" */, libc.VaList(bp+8, nName, zName, libc.PreIncUint32(&*(*U32)(unsafe.Pointer(bp + 56 /* cnt */)), 1))) if *(*U32)(unsafe.Pointer(bp + 56 /* cnt */)) > U32(3) { Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), bp+56 /* &cnt */) } @@ -112452,7 +113882,7 @@ __3: // // This routine requires that all identifiers in the SELECT // statement be resolved. -func Xsqlite3SelectAddColumnTypeAndCollation(tls *libc.TLS, pParse uintptr, pTab uintptr, pSelect uintptr, aff int8) { /* sqlite3.c:131365:21: */ +func Xsqlite3SelectAddColumnTypeAndCollation(tls *libc.TLS, pParse uintptr, pTab uintptr, pSelect uintptr, aff int8) { /* sqlite3.c:133151:21: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -112481,6 +113911,7 @@ __1: var zType uintptr var n int32 var m int32 + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_NOINSERT)) p = (*ExprList_item)(unsafe.Pointer(a + uintptr(i)*32)).FpExpr zType = columnTypeImpl(tls, bp /* &sNC */, p, uintptr(0), uintptr(0), uintptr(0)) // pCol->szEst = ... // Column size est for SELECT tables never used @@ -112516,14 +113947,14 @@ __3: // Given a SELECT statement, generate a Table structure that describes // the result set of that SELECT. -func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, aff int8) uintptr { /* sqlite3.c:131415:22: */ +func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, aff int8) uintptr { /* sqlite3.c:133202:22: */ var pTab uintptr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var savedFlags U64 savedFlags = (*Sqlite3)(unsafe.Pointer(db)).Fflags - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_FullColNames)) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (SQLITE_ShortColNames) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_FullColNames))) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(SQLITE_ShortColNames)) Xsqlite3SelectPrep(tls, pParse, pSelect, uintptr(0)) (*Sqlite3)(unsafe.Pointer(db)).Fflags = savedFlags if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -112551,12 +113982,12 @@ func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a // 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 Xsqlite3GetVdbe(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:131448:21: */ +func Xsqlite3GetVdbe(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:133235:21: */ if (*Parse)(unsafe.Pointer(pParse)).FpVdbe != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpVdbe } if ((*Parse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0)) && - ((int32((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags) & (SQLITE_FactorOutConst)) == 0) { + (((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags & (U32(SQLITE_FactorOutConst))) == U32(0)) { (*Parse)(unsafe.Pointer(pParse)).FokConstFactor = U8(1) } return Xsqlite3VdbeCreate(tls, pParse) @@ -112583,7 +114014,7 @@ func Xsqlite3GetVdbe(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:13144 // 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 *libc.TLS, pParse uintptr, p uintptr, iBreak int32) { /* sqlite3.c:131484:13: */ +func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int32) { /* sqlite3.c:133271:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -112609,17 +114040,17 @@ func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int3 if Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer(pLimit)).FpLeft, bp /* &n */) != 0 { Xsqlite3VdbeAddOp2(tls, v, OP_Integer, *(*int32)(unsafe.Pointer(bp /* n */)), iLimit) - Xsqlite3VdbeComment(tls, v, ts+19723 /* "LIMIT counter" */, 0) + Xsqlite3VdbeComment(tls, v, ts+20187 /* "LIMIT counter" */, 0) if *(*int32)(unsafe.Pointer(bp /* n */)) == 0 { Xsqlite3VdbeGoto(tls, v, iBreak) } else if (*(*int32)(unsafe.Pointer(bp /* n */)) >= 0) && (int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp /* n */)))))) { (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp /* n */)))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_FixedLimit) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_FixedLimit)) } } else { Xsqlite3ExprCode(tls, pParse, (*Expr)(unsafe.Pointer(pLimit)).FpLeft, iLimit) Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, iLimit) - Xsqlite3VdbeComment(tls, v, ts+19723 /* "LIMIT counter" */, 0) + Xsqlite3VdbeComment(tls, v, ts+20187 /* "LIMIT counter" */, 0) Xsqlite3VdbeAddOp2(tls, v, OP_IfNot, iLimit, iBreak) } if (*Expr)(unsafe.Pointer(pLimit)).FpRight != 0 { @@ -112627,9 +114058,9 @@ func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int3 (*Parse)(unsafe.Pointer(pParse)).FnMem++ // Allocate an extra register for limit+offset Xsqlite3ExprCode(tls, pParse, (*Expr)(unsafe.Pointer(pLimit)).FpRight, iOffset) Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, iOffset) - Xsqlite3VdbeComment(tls, v, ts+19737 /* "OFFSET counter" */, 0) + Xsqlite3VdbeComment(tls, v, ts+20201 /* "OFFSET counter" */, 0) Xsqlite3VdbeAddOp3(tls, v, OP_OffsetLimit, iLimit, (iOffset + 1), iOffset) - Xsqlite3VdbeComment(tls, v, ts+19752 /* "LIMIT+OFFSET" */, 0) + Xsqlite3VdbeComment(tls, v, ts+20216 /* "LIMIT+OFFSET" */, 0) } } } @@ -112640,7 +114071,7 @@ func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int3 // // 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 *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:131541:16: */ +func multiSelectCollSeq(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:133328:16: */ var pRet uintptr if (*Select)(unsafe.Pointer(p)).FpPrior != 0 { pRet = multiSelectCollSeq(tls, pParse, (*Select)(unsafe.Pointer(p)).FpPrior, iCol) @@ -112664,7 +114095,7 @@ func multiSelectCollSeq(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) ui // 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 *libc.TLS, pParse uintptr, p uintptr, nExtra int32) uintptr { /* sqlite3.c:131567:16: */ +func multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra int32) uintptr { /* sqlite3.c:133354:16: */ var pOrderBy uintptr = (*Select)(unsafe.Pointer(p)).FpOrderBy var nOrderBy int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb @@ -112676,7 +114107,7 @@ func multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra var pTerm uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr var pColl uintptr - if ((*Expr)(unsafe.Pointer(pTerm)).Fflags & EP_Collate) != 0 { + if ((*Expr)(unsafe.Pointer(pTerm)).Fflags & U32(EP_Collate)) != 0 { pColl = Xsqlite3ExprCollSeq(tls, pParse, pTerm) } else { pColl = multiSelectCollSeq(tls, pParse, p, (int32(*(*U16)(unsafe.Pointer((pItem + 24 /* &.u */ /* &.x */) /* &.iOrderByCol */))) - 1)) @@ -112728,15 +114159,16 @@ func multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra // 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 *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) { /* sqlite3.c:131633:13: */ +func generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) { /* sqlite3.c:133420:13: */ bp := tls.Alloc(40) defer tls.Free(40) - var pSrc uintptr // The FROM clause of the recursive query - var nCol int32 // Number of columns in the recursive table - var v uintptr // The prepared statement under construction - var pSetup uintptr // The setup query - var addrTop int32 // Top of the loop + var pSrc uintptr // The FROM clause of the recursive query + var nCol int32 // Number of columns in the recursive table + var v uintptr // The prepared statement under construction + var pSetup uintptr // The setup query + var pFirstRec uintptr // Left-most recursive term + var addrTop int32 // Top of the loop var addrCont int32 var addrBreak int32 // CONTINUE and BREAK addresses var iCurrent int32 // The Current table @@ -112764,7 +114196,7 @@ func generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest if !((*Select)(unsafe.Pointer(p)).FpWin != 0) { goto __1 } - Xsqlite3ErrorMsg(tls, pParse, ts+19765 /* "cannot use windo..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+20229 /* "cannot use windo..." */, 0) return __1: ; @@ -112797,7 +114229,7 @@ __3: if !((uint32(int32(*(*uint8)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112 + 60 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5))) != 0) { goto __6 } - iCurrent = (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor + iCurrent = (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor goto __5 __6: ; @@ -112848,28 +114280,63 @@ __9: Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, iQueue, nCol) __10: ; - Xsqlite3VdbeComment(tls, v, ts+19814 /* "Queue table" */, 0) + Xsqlite3VdbeComment(tls, v, ts+20278 /* "Queue table" */, 0) if !(iDistinct != 0) { goto __11 } *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, iDistinct, 0) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_UsesEphemeral) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral)) __11: ; // Detach the ORDER BY clause from the compound SELECT (*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) + // Figure out how many elements of the compound SELECT are part of the + // recursive query. Make sure no recursive elements use aggregate + // functions. Mark the recursive elements as UNION ALL even if they + // are really UNION because the distinctness will be enforced by the + // iDistinct table. pFirstRec is left pointing to the left-most + // recursive term of the CTE. + pFirstRec = p + pFirstRec = p +__12: + if !(pFirstRec != uintptr(0)) { + goto __14 + } + if !(((*Select)(unsafe.Pointer(pFirstRec)).FselFlags & U32(SF_Aggregate)) != 0) { + goto __15 + } + Xsqlite3ErrorMsg(tls, pParse, ts+20290 /* "recursive aggreg..." */, 0) + goto end_of_recursive_query +__15: + ; + (*Select)(unsafe.Pointer(pFirstRec)).Fop = U8(TK_ALL) + if !(((*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(pFirstRec)).FpPrior)).FselFlags & U32(SF_Recursive)) == U32(0)) { + goto __16 + } + goto __14 +__16: + ; + goto __13 +__13: + pFirstRec = (*Select)(unsafe.Pointer(pFirstRec)).FpPrior + goto __12 + goto __14 +__14: + ; + // Store the results of the setup-query in Queue. + pSetup = (*Select)(unsafe.Pointer(pFirstRec)).FpPrior (*Select)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19826 /* "SETUP" */, 0) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20332 /* "SETUP" */, 0) rc = Xsqlite3Select(tls, pParse, pSetup, bp /* &destQueue */) (*Select)(unsafe.Pointer(pSetup)).FpNext = p if !(rc != 0) { - goto __12 + goto __17 } goto end_of_recursive_query -__12: +__17: ; // Find the next row in the Queue and output that row @@ -112878,13 +114345,13 @@ __12: // Transfer the next row in Queue over to Current Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, iCurrent) // To reset column cache if !(pOrderBy != 0) { - goto __13 + goto __18 } Xsqlite3VdbeAddOp3(tls, v, OP_Column, iQueue, ((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr + 1), regCurrent) - goto __14 -__13: + goto __19 +__18: Xsqlite3VdbeAddOp2(tls, v, OP_RowData, iQueue, regCurrent) -__14: +__19: ; Xsqlite3VdbeAddOp1(tls, v, OP_Delete, iQueue) @@ -112894,29 +114361,21 @@ __14: selectInnerLoop(tls, pParse, p, iCurrent, uintptr(0), uintptr(0), pDest, addrCont, addrBreak) if !(regLimit != 0) { - goto __15 + goto __20 } Xsqlite3VdbeAddOp2(tls, v, OP_DecrJumpZero, regLimit, addrBreak) -__15: +__20: ; Xsqlite3VdbeResolveLabel(tls, v, addrCont) // Execute the recursive SELECT taking the single row in Current as // the value for the recursive-table. Store the results in the Queue. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Aggregate) != 0) { - goto __16 - } - Xsqlite3ErrorMsg(tls, pParse, ts+19832 /* "recursive aggreg..." */, 0) - goto __17 -__16: - (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19874 /* "RECURSIVE STEP" */, 0) + (*Select)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20338 /* "RECURSIVE STEP" */, 0) Xsqlite3Select(tls, pParse, p, bp /* &destQueue */) - (*Select)(unsafe.Pointer(p)).FpPrior = pSetup -__17: - ; + (*Select)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup // Keep running the loop until the Queue is empty Xsqlite3VdbeGoto(tls, v, addrTop) @@ -112943,7 +114402,7 @@ end_of_recursive_query: // clause occurs within scalar expression (ex: "SELECT (VALUES(1),(2),(3))"). // The sqlite3CodeSubselect will have added the LIMIT 1 clause in tht case. // Since the limit is exactly 1, we only need to evalutes the left-most VALUES. -func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:131795:12: */ +func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:133597:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -112963,11 +114422,11 @@ func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) p = (*Select)(unsafe.Pointer(p)).FpPrior nRow = nRow + (bShowAll) } - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+19889 /* "SCAN %d CONSTANT..." */, libc.VaList(bp, nRow, func() uintptr { + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+20353 /* "SCAN %d CONSTANT..." */, libc.VaList(bp, nRow, func() uintptr { if nRow == 1 { return ts + 800 /* "" */ } - return ts + 19912 /* "S" */ + return ts + 20376 /* "S" */ }())) for p != 0 { selectInnerLoop(tls, pParse, p, -1, uintptr(0), uintptr(0), pDest, 1, 1) @@ -112980,6 +114439,16 @@ func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) return rc } +// Return true if the SELECT statement which is known to be the recursive +// part of a recursive CTE still has its anchor terms attached. If the +// anchor terms have already been removed, then return false. +func hasAnchor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:133634:12: */ + for (p != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Recursive)) != U32(0)) { + p = (*Select)(unsafe.Pointer(p)).FpPrior + } + return (libc.Bool32(p != uintptr(0))) +} + // This routine is called to process a compound query form from // two or more separate queries using UNION, UNION ALL, EXCEPT, or // INTERSECT @@ -113009,19 +114478,19 @@ func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) // // Notice that because of the way SQLite parses compound SELECTs, the // individual selects always group from left to right. -func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:131858:12: */ - bp := tls.Alloc(160) - defer tls.Free(160) +func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:133670:12: */ + bp := tls.Alloc(144) + defer tls.Free(144) var rc int32 // Success code from a subroutine var pPrior uintptr // Another SELECT immediately to our left var v uintptr // Generate code to this VDBE - // var dest SelectDest at bp+32, 40 + // var dest SelectDest at bp+16, 40 // Alternative data destination var pDelete uintptr // Chain of simple selects to delete var db uintptr var addr int32 - // var nLimit int32 at bp+72, 4 + // var nLimit int32 at bp+56, 4 var iCont int32 var iBreak int32 @@ -113031,7 +114500,7 @@ func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 var priorOp int32 // The SRT_ operation to apply to prior selects var pLimit uintptr // Saved values of p->nLimit var addr1 int32 - // var uniondest SelectDest at bp+80, 40 + // var uniondest SelectDest at bp+64, 40 var tab1 int32 var tab2 int32 @@ -113040,7 +114509,7 @@ func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 var iStart1 int32 var pLimit1 uintptr var addr2 int32 - // var intersectdest SelectDest at bp+120, 40 + // var intersectdest SelectDest at bp+104, 40 var r1 int32 var addr3 int32 @@ -113058,155 +114527,141 @@ func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 db = (*Parse)(unsafe.Pointer(pParse)).Fdb pPrior = (*Select)(unsafe.Pointer(p)).FpPrior - *(*SelectDest)(unsafe.Pointer(bp + 32 /* dest */)) = *(*SelectDest)(unsafe.Pointer(pDest)) - if !(((*Select)(unsafe.Pointer(pPrior)).FpOrderBy != 0) || ((*Select)(unsafe.Pointer(pPrior)).FpLimit != 0)) { - goto __1 - } - Xsqlite3ErrorMsg(tls, pParse, ts+19914, /* "%s clause should..." */ - libc.VaList(bp, func() uintptr { - if (*Select)(unsafe.Pointer(pPrior)).FpOrderBy != uintptr(0) { - return ts + 19956 /* "ORDER BY" */ - } - return ts + 19965 /* "LIMIT" */ - }(), selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) - rc = 1 - goto multi_select_end -__1: - ; + *(*SelectDest)(unsafe.Pointer(bp + 16 /* dest */)) = *(*SelectDest)(unsafe.Pointer(pDest)) v = Xsqlite3GetVdbe(tls, pParse) // The VDBE already created by calling function // Create the destination temporary table if necessary - if !(int32((*SelectDest)(unsafe.Pointer(bp+32 /* &dest */)).FeDest) == SRT_EphemTab) { - goto __2 + if !(int32((*SelectDest)(unsafe.Pointer(bp+16 /* &dest */)).FeDest) == SRT_EphemTab) { + goto __1 } - Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*SelectDest)(unsafe.Pointer(bp+32 /* &dest */)).FiSDParm, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr) - (*SelectDest)(unsafe.Pointer(bp + 32 /* &dest */)).FeDest = SRT_Table -__2: + Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*SelectDest)(unsafe.Pointer(bp+16 /* &dest */)).FiSDParm, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr) + (*SelectDest)(unsafe.Pointer(bp + 16 /* &dest */)).FeDest = U8(SRT_Table) +__1: ; // Special handling for a compound-select that originates as a VALUES clause. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_MultiValue) != 0) { + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_MultiValue)) != 0) { + goto __2 + } + rc = multiSelectValues(tls, pParse, p, bp+16 /* &dest */) + if !(rc >= 0) { goto __3 } - rc = multiSelectValues(tls, pParse, p, bp+32 /* &dest */) - if !(rc >= 0) { - goto __4 - } goto multi_select_end -__4: +__3: ; rc = SQLITE_OK -__3: +__2: ; // Make sure all SELECTs in the statement have the same number of elements // in their result sets. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Recursive) != 0) { - goto __5 + if !((((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Recursive)) != U32(0)) && (hasAnchor(tls, p) != 0)) { + goto __4 } - generateWithRecursiveQuery(tls, pParse, p, bp+32 /* &dest */) - goto __6 -__5: + generateWithRecursiveQuery(tls, pParse, p, bp+16 /* &dest */) + goto __5 +__4: // Compound SELECTs that have an ORDER BY clause are handled separately. if !((*Select)(unsafe.Pointer(p)).FpOrderBy != 0) { - goto __7 + goto __6 } return multiSelectOrderBy(tls, pParse, p, pDest) - goto __8 -__7: + goto __7 +__6: if !((*Select)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0)) { - goto __9 + goto __8 } - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19971 /* "COMPOUND QUERY" */, 0) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19986 /* "LEFT-MOST SUBQUE..." */, 0) -__9: + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20378 /* "COMPOUND QUERY" */, 0) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20393 /* "LEFT-MOST SUBQUE..." */, 0) +__8: ; // Generate code for the left and right SELECT statements. switch int32((*Select)(unsafe.Pointer(p)).Fop) { case TK_ALL: - goto __11 + goto __10 case TK_EXCEPT: - goto __12 + goto __11 case TK_UNION: - goto __13 + goto __12 default: - goto __14 + goto __13 } - goto __10 -__11: + goto __9 +__10: addr = 0 (*Select)(unsafe.Pointer(pPrior)).FiLimit = (*Select)(unsafe.Pointer(p)).FiLimit (*Select)(unsafe.Pointer(pPrior)).FiOffset = (*Select)(unsafe.Pointer(p)).FiOffset (*Select)(unsafe.Pointer(pPrior)).FpLimit = (*Select)(unsafe.Pointer(p)).FpLimit - rc = Xsqlite3Select(tls, pParse, pPrior, bp+32 /* &dest */) - (*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0) + rc = Xsqlite3Select(tls, pParse, pPrior, bp+16 /* &dest */) + (*Select)(unsafe.Pointer(pPrior)).FpLimit = uintptr(0) if !(rc != 0) { - goto __15 + goto __14 } goto multi_select_end -__15: +__14: ; (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) (*Select)(unsafe.Pointer(p)).FiLimit = (*Select)(unsafe.Pointer(pPrior)).FiLimit (*Select)(unsafe.Pointer(p)).FiOffset = (*Select)(unsafe.Pointer(pPrior)).FiOffset if !((*Select)(unsafe.Pointer(p)).FiLimit != 0) { - goto __16 + goto __15 } addr = Xsqlite3VdbeAddOp1(tls, v, OP_IfNot, (*Select)(unsafe.Pointer(p)).FiLimit) - Xsqlite3VdbeComment(tls, v, ts+20005 /* "Jump ahead if LI..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+20412 /* "Jump ahead if LI..." */, 0) if !((*Select)(unsafe.Pointer(p)).FiOffset != 0) { - goto __17 + goto __16 } Xsqlite3VdbeAddOp3(tls, v, OP_OffsetLimit, (*Select)(unsafe.Pointer(p)).FiLimit, ((*Select)(unsafe.Pointer(p)).FiOffset + 1), (*Select)(unsafe.Pointer(p)).FiOffset) -__17: - ; __16: ; - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19650 /* "UNION ALL" */, 0) - rc = Xsqlite3Select(tls, pParse, p, bp+32 /* &dest */) +__15: + ; + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20114 /* "UNION ALL" */, 0) + rc = Xsqlite3Select(tls, pParse, p, bp+16 /* &dest */) pDelete = (*Select)(unsafe.Pointer(p)).FpPrior (*Select)(unsafe.Pointer(p)).FpPrior = pPrior (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEstAdd(tls, (*Select)(unsafe.Pointer(p)).FnSelectRow, (*Select)(unsafe.Pointer(pPrior)).FnSelectRow) - if !(((((*Select)(unsafe.Pointer(pPrior)).FpLimit != 0) && - (Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pPrior)).FpLimit)).FpLeft, bp+72 /* &nLimit */) != 0)) && - (*(*int32)(unsafe.Pointer(bp + 72 /* nLimit */)) > 0)) && (int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 72 /* nLimit */))))))) { - goto __18 + if !(((((*Select)(unsafe.Pointer(p)).FpLimit != 0) && + (Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpLimit)).FpLeft, bp+56 /* &nLimit */) != 0)) && + (*(*int32)(unsafe.Pointer(bp + 56 /* nLimit */)) > 0)) && (int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 56 /* nLimit */))))))) { + goto __17 } - (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 72 /* nLimit */)))) -__18: + (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 56 /* nLimit */)))) +__17: ; if !(addr != 0) { - goto __19 + goto __18 } Xsqlite3VdbeJumpHere(tls, v, addr) -__19: +__18: ; - goto __10 + goto __9 -__12: -__13: // Cursor number of the temp table holding result +__11: +__12: // Cursor number of the temp table holding result op = U8(0) priorOp = SRT_Union - if !(int32((*SelectDest)(unsafe.Pointer(bp+32 /* &dest */)).FeDest) == priorOp) { - goto __20 + if !(int32((*SelectDest)(unsafe.Pointer(bp+16 /* &dest */)).FeDest) == priorOp) { + goto __19 } // We can reuse a temporary table generated by a SELECT to our // right. // Not allowed on leftward elements - unionTab = (*SelectDest)(unsafe.Pointer(bp + 32 /* &dest */)).FiSDParm - goto __21 -__20: + unionTab = (*SelectDest)(unsafe.Pointer(bp + 16 /* &dest */)).FiSDParm + goto __20 +__19: // We will need to create our own temporary table to hold the // intermediate results. unionTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) @@ -113214,48 +114669,48 @@ __20: addr1 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, unionTab, 0) *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = addr1 - *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (SF_UsesEphemeral) + *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral)) -__21: +__20: ; // Code the SELECT statements to our left - Xsqlite3SelectDestInit(tls, bp+80 /* &uniondest */, priorOp, unionTab) - rc = Xsqlite3Select(tls, pParse, pPrior, bp+80 /* &uniondest */) + Xsqlite3SelectDestInit(tls, bp+64 /* &uniondest */, priorOp, unionTab) + rc = Xsqlite3Select(tls, pParse, pPrior, bp+64 /* &uniondest */) if !(rc != 0) { - goto __22 + goto __21 } goto multi_select_end -__22: +__21: ; // Code the current SELECT statement if !(int32((*Select)(unsafe.Pointer(p)).Fop) == TK_EXCEPT) { - goto __23 + goto __22 } - op = SRT_Except - goto __24 -__23: + op = U8(SRT_Except) + goto __23 +__22: ; - op = SRT_Union -__24: + op = U8(SRT_Union) +__23: ; (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) pLimit = (*Select)(unsafe.Pointer(p)).FpLimit (*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0) - (*SelectDest)(unsafe.Pointer(bp + 80 /* &uniondest */)).FeDest = op - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20033 /* "%s USING TEMP B-..." */, libc.VaList(bp+16, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) - rc = Xsqlite3Select(tls, pParse, p, bp+80 /* &uniondest */) + (*SelectDest)(unsafe.Pointer(bp + 64 /* &uniondest */)).FeDest = op + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20440 /* "%s USING TEMP B-..." */, libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) + rc = Xsqlite3Select(tls, pParse, p, bp+64 /* &uniondest */) pDelete = (*Select)(unsafe.Pointer(p)).FpPrior (*Select)(unsafe.Pointer(p)).FpPrior = pPrior (*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) if !(int32((*Select)(unsafe.Pointer(p)).Fop) == TK_UNION) { - goto __25 + goto __24 } (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEstAdd(tls, (*Select)(unsafe.Pointer(p)).FnSelectRow, (*Select)(unsafe.Pointer(pPrior)).FnSelectRow) -__25: +__24: ; Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit) (*Select)(unsafe.Pointer(p)).FpLimit = pLimit @@ -113265,8 +114720,8 @@ __25: // Convert the data in the temporary table into whatever form // it is that we currently need. - if !((int32((*SelectDest)(unsafe.Pointer(bp+32 /* &dest */)).FeDest) != priorOp) && (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0)) { - goto __26 + if !((int32((*SelectDest)(unsafe.Pointer(bp+16 /* &dest */)).FeDest) != priorOp) && (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0)) { + goto __25 } iBreak = Xsqlite3VdbeMakeLabel(tls, pParse) iCont = Xsqlite3VdbeMakeLabel(tls, pParse) @@ -113274,16 +114729,16 @@ __25: Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, unionTab, iBreak) iStart = Xsqlite3VdbeCurrentAddr(tls, v) selectInnerLoop(tls, pParse, p, unionTab, - uintptr(0), uintptr(0), bp+32 /* &dest */, iCont, iBreak) + uintptr(0), uintptr(0), bp+16 /* &dest */, iCont, iBreak) Xsqlite3VdbeResolveLabel(tls, v, iCont) Xsqlite3VdbeAddOp2(tls, v, OP_Next, unionTab, iStart) Xsqlite3VdbeResolveLabel(tls, v, iBreak) Xsqlite3VdbeAddOp2(tls, v, OP_Close, unionTab, 0) -__26: +__25: ; - goto __10 + goto __9 -__14: +__13: ; // INTERSECT is different from the others since it requires @@ -113295,16 +114750,16 @@ __14: addr2 = Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, tab1, 0) *(*int32)(unsafe.Pointer((p + 20 /* &.addrOpenEphm */))) = addr2 - *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (SF_UsesEphemeral) + *(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (U32(SF_UsesEphemeral)) // Code the SELECTs to our left into temporary table "tab1". - Xsqlite3SelectDestInit(tls, bp+120 /* &intersectdest */, SRT_Union, tab1) - rc = Xsqlite3Select(tls, pParse, pPrior, bp+120 /* &intersectdest */) + Xsqlite3SelectDestInit(tls, bp+104 /* &intersectdest */, SRT_Union, tab1) + rc = Xsqlite3Select(tls, pParse, pPrior, bp+104 /* &intersectdest */) if !(rc != 0) { - goto __27 + goto __26 } goto multi_select_end -__27: +__26: ; // Code the current SELECT into temporary table "tab2" @@ -113314,17 +114769,17 @@ __27: (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) pLimit1 = (*Select)(unsafe.Pointer(p)).FpLimit (*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0) - (*SelectDest)(unsafe.Pointer(bp + 120 /* &intersectdest */)).FiSDParm = tab2 - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20033 /* "%s USING TEMP B-..." */, libc.VaList(bp+24, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) - rc = Xsqlite3Select(tls, pParse, p, bp+120 /* &intersectdest */) + (*SelectDest)(unsafe.Pointer(bp + 104 /* &intersectdest */)).FiSDParm = tab2 + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20440 /* "%s USING TEMP B-..." */, libc.VaList(bp+8, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) + rc = Xsqlite3Select(tls, pParse, p, bp+104 /* &intersectdest */) pDelete = (*Select)(unsafe.Pointer(p)).FpPrior (*Select)(unsafe.Pointer(p)).FpPrior = pPrior if !(int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32((*Select)(unsafe.Pointer(pPrior)).FnSelectRow)) { - goto __28 + goto __27 } (*Select)(unsafe.Pointer(p)).FnSelectRow = (*Select)(unsafe.Pointer(pPrior)).FnSelectRow -__28: +__27: ; Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit) (*Select)(unsafe.Pointer(p)).FpLimit = pLimit1 @@ -113332,10 +114787,10 @@ __28: // Generate code to take the intersection of the two temporary // tables. if !(rc != 0) { - goto __29 + goto __28 } - goto __10 -__29: + goto __9 +__28: ; iBreak1 = Xsqlite3VdbeMakeLabel(tls, pParse) @@ -113348,32 +114803,32 @@ __29: Xsqlite3ReleaseTempReg(tls, pParse, r1) selectInnerLoop(tls, pParse, p, tab1, - uintptr(0), uintptr(0), bp+32 /* &dest */, iCont1, iBreak1) + uintptr(0), uintptr(0), bp+16 /* &dest */, iCont1, iBreak1) Xsqlite3VdbeResolveLabel(tls, v, iCont1) Xsqlite3VdbeAddOp2(tls, v, OP_Next, tab1, iStart1) Xsqlite3VdbeResolveLabel(tls, v, iBreak1) Xsqlite3VdbeAddOp2(tls, v, OP_Close, tab2, 0) Xsqlite3VdbeAddOp2(tls, v, OP_Close, tab1, 0) - goto __10 + goto __9 -__10: +__9: ; if !((*Select)(unsafe.Pointer(p)).FpNext == uintptr(0)) { - goto __30 + goto __29 } Xsqlite3VdbeExplainPop(tls, pParse) -__30: +__29: ; -__8: +__7: ; -__6: +__5: ; if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) { - goto __31 + goto __30 } goto multi_select_end -__31: +__30: ; // Compute collating sequences used by @@ -113384,101 +114839,102 @@ __31: // SELECT statements to the left always skip this part. The right-most // SELECT might also skip this part if it has no ORDER BY clause and // no temp tables are required. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_UsesEphemeral) != 0) { - goto __32 + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_UsesEphemeral)) != 0) { + goto __31 } // Number of columns in result set nCol = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr pKeyInfo = Xsqlite3KeyInfoAlloc(tls, db, nCol, 1) if !(!(pKeyInfo != 0)) { - goto __33 + goto __32 } rc = SQLITE_NOMEM goto multi_select_end -__33: +__32: ; i = 0 apColl = pKeyInfo + 32 /* &.aColl */ -__34: +__33: if !(i < nCol) { - goto __36 + goto __35 } *(*uintptr)(unsafe.Pointer(apColl)) = multiSelectCollSeq(tls, pParse, p, i) if !(uintptr(0) == *(*uintptr)(unsafe.Pointer(apColl))) { - goto __37 + goto __36 } *(*uintptr)(unsafe.Pointer(apColl)) = (*Sqlite3)(unsafe.Pointer(db)).FpDfltColl -__37: +__36: ; - goto __35 -__35: + goto __34 +__34: i++ apColl += 8 - goto __34 - goto __36 -__36: + goto __33 + goto __35 +__35: ; pLoop = p -__38: +__37: if !(pLoop != 0) { - goto __40 + goto __39 } i = 0 -__41: +__40: if !(i < 2) { - goto __43 + goto __42 } addr3 = *(*int32)(unsafe.Pointer((pLoop + 20 /* &.addrOpenEphm */) + uintptr(i)*4)) if !(addr3 < 0) { - goto __44 + goto __43 } // If [0] is unused then [1] is also unused. So we can // always safely abort as soon as the first unused slot is found - goto __43 -__44: + goto __42 +__43: ; Xsqlite3VdbeChangeP2(tls, v, addr3, nCol) Xsqlite3VdbeChangeP4(tls, v, addr3, Xsqlite3KeyInfoRef(tls, pKeyInfo), -9) *(*int32)(unsafe.Pointer((pLoop + 20 /* &.addrOpenEphm */) + uintptr(i)*4)) = -1 + goto __41 +__41: + i++ + goto __40 goto __42 __42: - i++ - goto __41 - goto __43 -__43: ; + goto __38 +__38: + pLoop = (*Select)(unsafe.Pointer(pLoop)).FpPrior + goto __37 goto __39 __39: - pLoop = (*Select)(unsafe.Pointer(pLoop)).FpPrior - goto __38 - goto __40 -__40: ; Xsqlite3KeyInfoUnref(tls, pKeyInfo) -__32: +__31: ; multi_select_end: - (*SelectDest)(unsafe.Pointer(pDest)).FiSdst = (*SelectDest)(unsafe.Pointer(bp + 32 /* &dest */)).FiSdst - (*SelectDest)(unsafe.Pointer(pDest)).FnSdst = (*SelectDest)(unsafe.Pointer(bp + 32 /* &dest */)).FnSdst + (*SelectDest)(unsafe.Pointer(pDest)).FiSdst = (*SelectDest)(unsafe.Pointer(bp + 16 /* &dest */)).FiSdst + (*SelectDest)(unsafe.Pointer(pDest)).FnSdst = (*SelectDest)(unsafe.Pointer(bp + 16 /* &dest */)).FnSdst Xsqlite3SelectDelete(tls, db, pDelete) return rc } // Error message for when two or more terms of a compound select have different // size result sets. -func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:132206:21: */ +func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:134015:21: */ bp := tls.Alloc(8) defer tls.Free(8) - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_Values) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+20054 /* "all VALUES must ..." */, 0) + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Values)) != 0 { + Xsqlite3ErrorMsg(tls, pParse, ts+20461 /* "all VALUES must ..." */, 0) } else { Xsqlite3ErrorMsg(tls, pParse, - ts+20100 /* "SELECTs to the l..." */, libc.VaList(bp, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) + ts+20507, /* "SELECTs to the l..." */ + libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) } } @@ -113500,7 +114956,7 @@ func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) // // If the LIMIT found in p->iLimit is reached, jump immediately to // iBreak. -func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uintptr, pDest uintptr, regReturn int32, regPrev int32, pKeyInfo uintptr, iBreak int32) int32 { /* sqlite3.c:132235:12: */ +func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uintptr, pDest uintptr, regReturn int32, regPrev int32, pKeyInfo uintptr, iBreak int32) int32 { /* sqlite3.c:134045:12: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var iContinue int32 var addr int32 @@ -113536,7 +114992,7 @@ func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uint Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst, r1) Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, r2) Xsqlite3VdbeAddOp3(tls, v, OP_Insert, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, r1, r2) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_APPEND) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) Xsqlite3ReleaseTempReg(tls, pParse, r2) Xsqlite3ReleaseTempReg(tls, pParse, r1) break @@ -113564,10 +115020,8 @@ func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uint // if it is the RHS of a row-value IN operator. case SRT_Mem: { - if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 { - Xsqlite3ExprCodeMove(tls, pParse, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst) - } + Xsqlite3ExprCodeMove(tls, pParse, (*SelectDest)(unsafe.Pointer(pIn)).FiSdst, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, (*SelectDest)(unsafe.Pointer(pIn)).FnSdst) // The LIMIT clause will jump out of the loop for us break @@ -113698,7 +115152,7 @@ func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uint // actually called using Gosub and they do not Return. EofA and EofB loop // until all data is exhausted then jump to the "end" labe. AltB, AeqB, // and AgtB jump to either L2 or to one of EofA or EofB. -func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:132445:12: */ +func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:134253:12: */ bp := tls.Alloc(88) defer tls.Free(88) @@ -113787,7 +115241,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if pNew == uintptr(0) { return SQLITE_NOMEM } - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_IntValue) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_IntValue)) *(*int32)(unsafe.Pointer(pNew + 8 /* &.u */)) = i (*Select)(unsafe.Pointer(p)).FpOrderBy = libc.AssignUintptr(&pOrderBy, Xsqlite3ExprListAppend(tls, pParse, pOrderBy, pNew)) if pOrderBy != 0 { @@ -113859,9 +115313,9 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) // Separate the left and the right query from one another (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) (*Select)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) - Xsqlite3ResolveOrderGroupBy(tls, pParse, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+9115 /* "ORDER" */) + Xsqlite3ResolveOrderGroupBy(tls, pParse, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+9219 /* "ORDER" */) if (*Select)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - Xsqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*Select)(unsafe.Pointer(pPrior)).FpOrderBy, ts+9115 /* "ORDER" */) + Xsqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*Select)(unsafe.Pointer(pPrior)).FpOrderBy, ts+9219 /* "ORDER" */) } // Compute the limit registers @@ -113890,15 +115344,15 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) Xsqlite3SelectDestInit(tls, bp+8 /* &destA */, SRT_Coroutine, regAddrA) Xsqlite3SelectDestInit(tls, bp+48 /* &destB */, SRT_Coroutine, regAddrB) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20182 /* "MERGE (%s)" */, libc.VaList(bp, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20589 /* "MERGE (%s)" */, libc.VaList(bp, Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop)))) // Generate a coroutine to evaluate the SELECT statement to the // left of the compound operator - the "A" select. addrSelectA = (Xsqlite3VdbeCurrentAddr(tls, v) + 1) addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regAddrA, 0, addrSelectA) - Xsqlite3VdbeComment(tls, v, ts+20193 /* "left SELECT" */, 0) + Xsqlite3VdbeComment(tls, v, ts+20600 /* "left SELECT" */, 0) (*Select)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20205 /* "LEFT" */, 0) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20612 /* "LEFT" */, 0) Xsqlite3Select(tls, pParse, pPrior, bp+8 /* &destA */) Xsqlite3VdbeEndCoroutine(tls, v, regAddrA) Xsqlite3VdbeJumpHere(tls, v, addr1) @@ -113907,12 +115361,12 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) // the right - the "B" select addrSelectB = (Xsqlite3VdbeCurrentAddr(tls, v) + 1) addr1 = Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regAddrB, 0, addrSelectB) - Xsqlite3VdbeComment(tls, v, ts+20210 /* "right SELECT" */, 0) + Xsqlite3VdbeComment(tls, v, ts+20617 /* "right SELECT" */, 0) savedLimit = (*Select)(unsafe.Pointer(p)).FiLimit savedOffset = (*Select)(unsafe.Pointer(p)).FiOffset (*Select)(unsafe.Pointer(p)).FiLimit = regLimitB (*Select)(unsafe.Pointer(p)).FiOffset = 0 - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20223 /* "RIGHT" */, 0) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20630 /* "RIGHT" */, 0) Xsqlite3Select(tls, pParse, p, bp+48 /* &destB */) (*Select)(unsafe.Pointer(p)).FiLimit = savedLimit (*Select)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -113920,7 +115374,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) // Generate a subroutine that outputs the current row of the A // select as the next output row of the compound select. - Xsqlite3VdbeNoopComment(tls, v, ts+20229 /* "Output routine f..." */, 0) + Xsqlite3VdbeNoopComment(tls, v, ts+20636 /* "Output routine f..." */, 0) addrOutA = generateOutputSubroutine(tls, pParse, p, bp+8 /* &destA */, pDest, regOutA, regPrev, pKeyDup, labelEnd) @@ -113928,7 +115382,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) // Generate a subroutine that outputs the current row of the B // select as the next output row of the compound select. if (op == TK_ALL) || (op == TK_UNION) { - Xsqlite3VdbeNoopComment(tls, v, ts+20250 /* "Output routine f..." */, 0) + Xsqlite3VdbeNoopComment(tls, v, ts+20657 /* "Output routine f..." */, 0) addrOutB = generateOutputSubroutine(tls, pParse, p, bp+48 /* &destB */, pDest, regOutB, regPrev, pKeyDup, labelEnd) @@ -113940,7 +115394,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if (op == TK_EXCEPT) || (op == TK_INTERSECT) { addrEofA_noB = libc.AssignInt32(&addrEofA, labelEnd) } else { - Xsqlite3VdbeNoopComment(tls, v, ts+20271 /* "eof-A subroutine" */, 0) + Xsqlite3VdbeNoopComment(tls, v, ts+20678 /* "eof-A subroutine" */, 0) addrEofA = Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regOutB, addrOutB) addrEofA_noB = Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regAddrB, labelEnd) @@ -113956,14 +115410,14 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (*Select)(unsafe.Pointer(p)).FnSelectRow = (*Select)(unsafe.Pointer(pPrior)).FnSelectRow } } else { - Xsqlite3VdbeNoopComment(tls, v, ts+20288 /* "eof-B subroutine" */, 0) + Xsqlite3VdbeNoopComment(tls, v, ts+20695 /* "eof-B subroutine" */, 0) addrEofB = Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regOutA, addrOutA) Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regAddrA, labelEnd) Xsqlite3VdbeGoto(tls, v, addrEofB) } // Generate code to handle the case of AB - Xsqlite3VdbeNoopComment(tls, v, ts+20341 /* "A-gt-B subroutin..." */, 0) + Xsqlite3VdbeNoopComment(tls, v, ts+20748 /* "A-gt-B subroutin..." */, 0) addrAgtB = Xsqlite3VdbeCurrentAddr(tls, v) if (op == TK_ALL) || (op == TK_UNION) { Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regOutB, addrOutB) @@ -113999,7 +115453,7 @@ func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) Xsqlite3VdbeAddOp4(tls, v, OP_Permutation, 0, 0, 0, aPermute, -15) Xsqlite3VdbeAddOp4(tls, v, OP_Compare, (*SelectDest)(unsafe.Pointer(bp+8 /* &destA */)).FiSdst, (*SelectDest)(unsafe.Pointer(bp+48 /* &destB */)).FiSdst, nOrderBy, pKeyMerge, -9) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_PERMUTE) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_PERMUTE)) Xsqlite3VdbeAddOp3(tls, v, OP_Jump, addrAltB, addrAeqB, addrAgtB) // Jump to the this point in order to terminate the query. @@ -114031,14 +115485,14 @@ type SubstContext1 = struct { FisLeftJoin int32 _ [4]byte FpEList uintptr -} /* sqlite3.c:132752:9 */ +} /* sqlite3.c:134560:9 */ // An instance of the SubstContext object describes an substitution edit // to be performed on a parse tree. // // All references to columns in table iTable are to be replaced by corresponding // expressions in pEList. -type SubstContext = SubstContext1 /* sqlite3.c:132758:3 */ +type SubstContext = SubstContext1 /* sqlite3.c:134566:3 */ // Scan through the expression pExpr. Replace every reference to // a column in table number iTable with a copy of the iColumn-th @@ -114051,22 +115505,22 @@ type SubstContext = SubstContext1 /* sqlite3.c:132758:3 */ // 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 *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite3.c:132777:13: */ +func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite3.c:134585:13: */ bp := tls.Alloc(72) defer tls.Free(72) if pExpr == uintptr(0) { return uintptr(0) } - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) && - (int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable) { - (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable = I16((*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable) + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) && + ((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable) { + (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable = (*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable } if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SubstContext)(unsafe.Pointer(pSubst)).FiTable)) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FixedCol)) != U32(0)) { + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FixedCol))) != U32(0)) { if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 { - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_NULL) } else { var pNew uintptr var pCopy uintptr = (*ExprList_item)(unsafe.Pointer(((*SubstContext)(unsafe.Pointer(pSubst)).FpEList + 8 /* &.a */) + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*32)).FpExpr @@ -114078,20 +115532,19 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite var db uintptr = (*Parse)(unsafe.Pointer((*SubstContext)(unsafe.Pointer(pSubst)).FpParse)).Fdb if ((*SubstContext)(unsafe.Pointer(pSubst)).FisLeftJoin != 0) && (int32((*Expr)(unsafe.Pointer(pCopy)).Fop) != TK_COLUMN) { libc.Xmemset(tls, bp /* &ifNullRow */, 0, uint64(unsafe.Sizeof(Expr{}))) - (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fop = TK_IF_NULL_ROW + (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fop = U8(TK_IF_NULL_ROW) (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).FpLeft = pCopy (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).FiTable = (*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable - (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fflags = EP_Skip + (*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fflags = U32(EP_IfNullRow) pCopy = bp /* &ifNullRow */ } pNew = Xsqlite3ExprDup(tls, db, pCopy, 0) if (pNew != 0) && ((*SubstContext)(unsafe.Pointer(pSubst)).FisLeftJoin != 0) { - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_CanBeNull) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(EP_CanBeNull)) } - if (pNew != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) { - (*Expr)(unsafe.Pointer(pNew)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable - *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (EP_FromJoin) + if (pNew != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { + Xsqlite3SetJoinExpr(tls, pNew, (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) } Xsqlite3ExprDelete(tls, db, pExpr) pExpr = pNew @@ -114119,12 +115572,12 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite } (*Expr)(unsafe.Pointer(pExpr)).FpLeft = substExpr(tls, pSubst, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) (*Expr)(unsafe.Pointer(pExpr)).FpRight = substExpr(tls, pSubst, (*Expr)(unsafe.Pointer(pExpr)).FpRight) - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { substSelect(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)), 1) } else { substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) (*Window)(unsafe.Pointer(pWin)).FpFilter = substExpr(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpFilter) substExprList(tls, pSubst, (*Window)(unsafe.Pointer(pWin)).FpPartition) @@ -114134,7 +115587,7 @@ func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite return pExpr } -func substExprList(tls *libc.TLS, pSubst uintptr, pList uintptr) { /* sqlite3.c:132858:13: */ +func substExprList(tls *libc.TLS, pSubst uintptr, pList uintptr) { /* sqlite3.c:134665:13: */ var i int32 if pList == uintptr(0) { return @@ -114144,7 +115597,7 @@ func substExprList(tls *libc.TLS, pSubst uintptr, pList uintptr) { /* sqlite3.c: } } -func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* sqlite3.c:132868:13: */ +func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* sqlite3.c:134675:13: */ var pSrc uintptr var pItem uintptr var i int32 @@ -114166,7 +115619,7 @@ func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* s goto __3 } { - substSelect(tls, pSubst, (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect, 1) + substSelect(tls, pSubst, (*SrcItem)(unsafe.Pointer(pItem)).FpSelect, 1) if (uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 60 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 { substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pItem + 96 /* &.u1 */))) } @@ -114187,13 +115640,13 @@ func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* s // // This routine scans the entire SELECT statement and recomputes the // pSrcItem->colUsed mask. -func recomputeColumnsUsedExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:132903:12: */ +func recomputeColumnsUsedExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:134710:12: */ var pItem uintptr if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN { return WRC_Continue } pItem = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) - if (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor != (*Expr)(unsafe.Pointer(pExpr)).FiTable { + if (*SrcItem)(unsafe.Pointer(pItem)).FiCursor != (*Expr)(unsafe.Pointer(pExpr)).FiTable { return WRC_Continue } if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 { @@ -114203,13 +115656,13 @@ func recomputeColumnsUsedExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int return WRC_Continue } -func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* sqlite3.c:132912:13: */ +func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* sqlite3.c:134719:13: */ bp := tls.Alloc(48) defer tls.Free(48) // var w Walker at bp, 48 - if (*SrcList_item)(unsafe.Pointer(pSrcItem)).FpTab == uintptr(0) { + if (*SrcItem)(unsafe.Pointer(pSrcItem)).FpTab == uintptr(0) { return } libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{}))) @@ -114220,10 +115673,97 @@ func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* f func(*libc.TLS, uintptr, uintptr) int32 }{Xsqlite3SelectWalkNoop})) *(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = pSrcItem - (*SrcList_item)(unsafe.Pointer(pSrcItem)).FcolUsed = uint64(0) + (*SrcItem)(unsafe.Pointer(pSrcItem)).FcolUsed = uint64(0) Xsqlite3WalkSelect(tls, bp /* &w */, pSelect) } +// Assign new cursor numbers to each of the items in pSrc. For each +// new cursor number assigned, set an entry in the aCsrMap[] array +// to map the old cursor number to the new: +// +// aCsrMap[iOld] = iNew; +// +// The array is guaranteed by the caller to be large enough for all +// existing cursor numbers in pSrc. +// +// If pSrc contains any sub-selects, call this routine recursively +// on the FROM clause of each such sub-select, with iExcept set to -1. +func srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSrc uintptr, iExcept int32) { /* sqlite3.c:134748:13: */ + var i int32 + var pItem uintptr + i = 0 + pItem = pSrc + 8 /* &.a */ +__1: + if !(i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc) { + goto __3 + } + { + if i != iExcept { + var p uintptr + (*SrcItem)(unsafe.Pointer(pItem)).FiCursor = libc.AssignPtrInt32(aCsrMap+uintptr((*SrcItem)(unsafe.Pointer(pItem)).FiCursor)*4, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)) + for p = (*SrcItem)(unsafe.Pointer(pItem)).FpSelect; p != 0; p = (*Select)(unsafe.Pointer(p)).FpPrior { + srclistRenumberCursors(tls, pParse, aCsrMap, (*Select)(unsafe.Pointer(p)).FpSrc, -1) + } + } + + } + goto __2 +__2: + i++ + pItem += 112 + goto __1 + goto __3 +__3: +} + +// Expression walker callback used by renumberCursors() to update +// Expr objects to match newly assigned cursor numbers. +func renumberCursorsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:134771:12: */ + var aCsrMap uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) + var op int32 = int32((*Expr)(unsafe.Pointer(pExpr)).Fop) + if ((op == TK_COLUMN) || (op == TK_IF_NULL_ROW)) && (*(*int32)(unsafe.Pointer(aCsrMap + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiTable)*4)) != 0) { + (*Expr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiTable)*4)) + } + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) && (*(*int32)(unsafe.Pointer(aCsrMap + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable)*4)) != 0) { + (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable = *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable)*4)) + } + return WRC_Continue +} + +// Assign a new cursor number to each cursor in the FROM clause (Select.pSrc) +// of the SELECT statement passed as the second argument, and to each +// cursor in the FROM clause of any FROM clause sub-selects, recursively. +// Except, do not assign a new cursor number to the iExcept'th element in +// the FROM clause of (*p). Update all expressions and other references +// to refer to the new cursor numbers. +// +// Argument aCsrMap is an array that may be used for temporary working +// space. Two guarantees are made by the caller: +// +// * the array is larger than the largest cursor number used within the +// select statement passed as an argument, and +// +// * the array entries for all cursor numbers that do *not* appear in +// FROM clauses of the select statement as described above are +// initialized to zero. +func renumberCursors(tls *libc.TLS, pParse uintptr, p uintptr, iExcept int32, aCsrMap uintptr) { /* sqlite3.c:134801:13: */ + bp := tls.Alloc(48) + defer tls.Free(48) + + // var w Walker at bp, 48 + + srclistRenumberCursors(tls, pParse, aCsrMap, (*Select)(unsafe.Pointer(p)).FpSrc, iExcept) + libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{}))) + *(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = aCsrMap + (*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) int32 + }{renumberCursorsCb})) + (*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) int32 + }{Xsqlite3SelectWalkNoop})) + Xsqlite3WalkSelect(tls, bp /* &w */, p) +} + // This routine attempts to flatten subqueries as a performance optimization. // This routine returns 1 if it makes changes and 0 if no flattening occurs. // @@ -114316,9 +115856,9 @@ func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* // (17c) every term within the subquery compound must have a FROM clause // (17d) the outer query may not be // (17d1) aggregate, or -// (17d2) DISTINCT, or -// (17d3) a join. -// (17e) the subquery may not contain window functions +// (17d2) DISTINCT +// (17e) the subquery may not contain window functions, and +// (17f) the subquery must not be the RHS of a LEFT JOIN. // // The parent and sub-query may contain WHERE clauses. Subject to // rules (11), (13) and (14), they may also contain ORDER BY, @@ -114334,8 +115874,8 @@ func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* // 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. +// ORDER BY clause of the parent must be copies of a term returned +// by the parent query. // // (19) If the subquery uses LIMIT then the outer query may not // have a WHERE clause. @@ -114351,9 +115891,8 @@ func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* // // (22) The subquery may not be a recursive CTE. // -// (**) Subsumed into restriction (17d3). Was: If the outer query is -// a recursive CTE, then the sub-query may not be a compound query. -// This restriction is because transforming the +// (23) If the outer query is a recursive CTE, then the sub-query may not be +// a compound query. This restriction is because transforming the // parent to a compound query confuses the code that handles // recursive queries in multiSelect(). // @@ -114377,7 +115916,7 @@ func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* // // All of the expression analysis must occur on both the outer query and // the subquery before this routine runs. -func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAgg int32) int32 { /* sqlite3.c:133083:12: */ +func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAgg int32) int32 { /* sqlite3.c:134972:12: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -114396,17 +115935,18 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // var w Walker at bp+32, 48 // Walker to persist agginfo data + var aCsrMap uintptr = uintptr(0) // Check to see if flattening is permitted. Return 0 if not. - if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_QueryFlattener)) != 0 { + if ((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_QueryFlattener))) != U32(0) { return 0 } pSrc = (*Select)(unsafe.Pointer(p)).FpSrc pSubitem = ((pSrc + 8 /* &.a */) + uintptr(iFrom)*112) - iParent = (*SrcList_item)(unsafe.Pointer(pSubitem)).FiCursor - pSub = (*SrcList_item)(unsafe.Pointer(pSubitem)).FpSelect + iParent = (*SrcItem)(unsafe.Pointer(pSubitem)).FiCursor + pSub = (*SrcItem)(unsafe.Pointer(pSubitem)).FpSelect if ((*Select)(unsafe.Pointer(p)).FpWin != 0) || ((*Select)(unsafe.Pointer(pSub)).FpWin != 0) { return 0 @@ -114425,13 +115965,13 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && ((*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpLimit)).FpRight != 0) { return 0 } // Restriction (14) - if (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Compound) != U32(0)) && ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) { + if (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Compound)) != U32(0)) && ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) { return 0 // Restriction (15) } if (*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc == 0 { return 0 } // Restriction (7) - if ((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_Distinct) != 0 { + if ((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Distinct)) != 0 { return 0 } // Restriction (4) if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1) || (isAgg != 0)) { @@ -114446,10 +115986,10 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && ((*Select)(unsafe.Pointer(p)).FpWhere != 0) { return 0 } // Restriction (19) - if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0)) { + if ((*Select)(unsafe.Pointer(pSub)).FpLimit != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)) { return 0 // Restriction (21) } - if ((*Select)(unsafe.Pointer(pSub)).FselFlags & (SF_Recursive)) != 0 { + if ((*Select)(unsafe.Pointer(pSub)).FselFlags & (U32(SF_Recursive))) != 0 { return 0 // Restrictions (22) } @@ -114471,12 +116011,12 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg // the LEFT JOIN table should be all-NULL. // // See also tickets #306, #350, and #3300. - if (int32((*SrcList_item)(unsafe.Pointer(pSubitem)).Ffg.Fjointype) & JT_OUTER) != 0 { + if (int32((*SrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype) & JT_OUTER) != 0 { isLeftJoin = 1 if ((((*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc > 1) || // (3a) (isAgg != 0)) || // (3b) - ((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pSubSrc + 8 /* &.a */))).FpTab)).FnModuleArg != 0)) || // (3c) - (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0)) { + ((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pSubSrc + 8 /* &.a */))).FpTab)).FnModuleArg != 0)) || // (3c) + (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)) { return 0 } } @@ -114489,8 +116029,8 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg if (*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0 { return 0 // Restriction (20) } - if ((isAgg != 0) || (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0))) || ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc != 1) { - return 0 // (17d1), (17d2), or (17d3) + if ((isAgg != 0) || (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0))) || (isLeftJoin > 0) { + return 0 // (17d1), (17d2), or (17f) } for pSub1 = pSub; pSub1 != 0; pSub1 = (*Select)(unsafe.Pointer(pSub1)).FpPrior { @@ -114512,22 +116052,35 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg } } } - } - // Ex-restriction (23): - // The only way that the recursive part of a CTE can contain a compound - // subquery is for the subquery to be one term of a join. But if the - // subquery is a join, then the flattening has already been stopped by - // restriction (17d3) + // Restriction (23) + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Recursive)) != 0 { + return 0 + } + + if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1 { + aCsrMap = Xsqlite3DbMallocZero(tls, db, (uint64(uint64((*Parse)(unsafe.Pointer(pParse)).FnTab) * uint64(unsafe.Sizeof(int32(0)))))) + } + } //**** If we reach this point, flattening is permitted. **** // Authorize the subquery - (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcList_item)(unsafe.Pointer(pSubitem)).FzName + (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcItem)(unsafe.Pointer(pSubitem)).FzName Xsqlite3AuthCheck(tls, pParse, SQLITE_SELECT, uintptr(0), uintptr(0), uintptr(0)) (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedAuthContext + // Delete the transient structures associated with thesubquery + pSub1 = (*SrcItem)(unsafe.Pointer(pSubitem)).FpSelect + Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pSubitem)).FzDatabase) + Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pSubitem)).FzName) + Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer(pSubitem)).FzAlias) + (*SrcItem)(unsafe.Pointer(pSubitem)).FzDatabase = uintptr(0) + (*SrcItem)(unsafe.Pointer(pSubitem)).FzName = uintptr(0) + (*SrcItem)(unsafe.Pointer(pSubitem)).FzAlias = uintptr(0) + (*SrcItem)(unsafe.Pointer(pSubitem)).FpSelect = uintptr(0) + // If the sub-query is a compound SELECT statement, then (by restrictions // 17 and 18 above) it must be a UNION ALL and the parent query must // be of the form: @@ -114565,18 +116118,22 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg var pOrderBy uintptr = (*Select)(unsafe.Pointer(p)).FpOrderBy var pLimit uintptr = (*Select)(unsafe.Pointer(p)).FpLimit var pPrior uintptr = (*Select)(unsafe.Pointer(p)).FpPrior + var pItemTab uintptr = (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab + (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab = uintptr(0) (*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) - (*Select)(unsafe.Pointer(p)).FpSrc = uintptr(0) (*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0) (*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0) pNew = Xsqlite3SelectDup(tls, db, p, 0) (*Select)(unsafe.Pointer(p)).FpLimit = pLimit (*Select)(unsafe.Pointer(p)).FpOrderBy = pOrderBy - (*Select)(unsafe.Pointer(p)).FpSrc = pSrc - (*Select)(unsafe.Pointer(p)).Fop = TK_ALL + (*Select)(unsafe.Pointer(p)).Fop = U8(TK_ALL) + (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab = pItemTab if pNew == uintptr(0) { (*Select)(unsafe.Pointer(p)).FpPrior = pPrior } else { + if (aCsrMap != 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) { + renumberCursors(tls, pParse, pNew, iFrom, aCsrMap) + } (*Select)(unsafe.Pointer(pNew)).FpPrior = pPrior if pPrior != 0 { (*Select)(unsafe.Pointer(pPrior)).FpNext = pNew @@ -114585,24 +116142,13 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg (*Select)(unsafe.Pointer(p)).FpPrior = pNew } - if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - return 1 - } + + } + Xsqlite3DbFree(tls, db, aCsrMap) + if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + (*SrcItem)(unsafe.Pointer(pSubitem)).FpSelect = pSub1 + return 1 } - - // Begin flattening the iFrom-th entry of the FROM clause - // in the outer query. - pSub = libc.AssignUintptr(&pSub1, (*SrcList_item)(unsafe.Pointer(pSubitem)).FpSelect) - - // Delete the transient table structure associated with the - // subquery - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pSubitem)).FzDatabase) - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pSubitem)).FzName) - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pSubitem)).FzAlias) - (*SrcList_item)(unsafe.Pointer(pSubitem)).FzDatabase = uintptr(0) - (*SrcList_item)(unsafe.Pointer(pSubitem)).FzName = uintptr(0) - (*SrcList_item)(unsafe.Pointer(pSubitem)).FzAlias = uintptr(0) - (*SrcList_item)(unsafe.Pointer(pSubitem)).FpSelect = uintptr(0) // Defer deleting the Table object associated with the // subquery until code generation is @@ -114610,8 +116156,8 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg // refer to the subquery even after flattening. Ticket #3346. // // pSubitem->pTab is always non-NULL by test restrictions and tests above. - if (*SrcList_item)(unsafe.Pointer(pSubitem)).FpTab != uintptr(0) { - var pTabToDel uintptr = (*SrcList_item)(unsafe.Pointer(pSubitem)).FpTab + if (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab != uintptr(0) { + var pTabToDel uintptr = (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab if (*Table)(unsafe.Pointer(pTabToDel)).FnTabRef == U32(1) { var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { @@ -114619,12 +116165,16 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg } return pParse }() - (*Table)(unsafe.Pointer(pTabToDel)).FpNextZombie = (*Parse)(unsafe.Pointer(pToplevel)).FpZombieTab - (*Parse)(unsafe.Pointer(pToplevel)).FpZombieTab = pTabToDel + Xsqlite3ParserAddCleanup(tls, pToplevel, + *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{Xsqlite3DeleteTable})), + pTabToDel) + } else { (*Table)(unsafe.Pointer(pTabToDel)).FnTabRef-- } - (*SrcList_item)(unsafe.Pointer(pSubitem)).FpTab = uintptr(0) + (*SrcItem)(unsafe.Pointer(pSubitem)).FpTab = uintptr(0) } // The following loop runs once for each term in a compound-subquery @@ -114639,6 +116189,7 @@ func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAg // will scan expressions looking for iParent references and replace // those references with expressions that resolve to the subquery FROM // elements we are now copying in. + pSub = pSub1 pParent = p __1: if !(pParent != 0) { @@ -114652,16 +116203,8 @@ __1: nSubSrc = (*SrcList)(unsafe.Pointer(pSubSrc)).FnSrc // Number of terms in subquery FROM clause pSrc = (*Select)(unsafe.Pointer(pParent)).FpSrc // FROM clause of the outer query - if pSrc != 0 { - // First time through the loop - jointype = (*SrcList_item)(unsafe.Pointer(pSubitem)).Ffg.Fjointype - } else { - // 2nd and subsequent times through the loop - pSrc = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) - if pSrc == uintptr(0) { - goto __3 - } - (*Select)(unsafe.Pointer(pParent)).FpSrc = pSrc + if pParent == p { + jointype = (*SrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype // First time through the loop } // The subquery uses a single slot of the FROM clause of the outer @@ -114689,13 +116232,13 @@ __1: // Transfer the FROM clause terms from the subquery into the // outer query. for i = 0; i < nSubSrc; i++ { - Xsqlite3IdListDelete(tls, db, (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr((i+iFrom))*112)).FpUsing) + Xsqlite3IdListDelete(tls, db, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr((i+iFrom))*112)).FpUsing) - *(*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr((i+iFrom))*112)) = *(*SrcList_item)(unsafe.Pointer((pSubSrc + 8 /* &.a */) + uintptr(i)*112)) - iNewParent = (*SrcList_item)(unsafe.Pointer((pSubSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor - libc.Xmemset(tls, ((pSubSrc + 8 /* &.a */) + uintptr(i)*112), 0, uint64(unsafe.Sizeof(SrcList_item{}))) + *(*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr((i+iFrom))*112)) = *(*SrcItem)(unsafe.Pointer((pSubSrc + 8 /* &.a */) + uintptr(i)*112)) + iNewParent = (*SrcItem)(unsafe.Pointer((pSubSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor + libc.Xmemset(tls, ((pSubSrc + 8 /* &.a */) + uintptr(i)*112), 0, uint64(unsafe.Sizeof(SrcItem{}))) } - (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(iFrom)*112)).Ffg.Fjointype = jointype + (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(iFrom)*112)).Ffg.Fjointype = jointype // Now begin substituting subquery result set expressions for // references to the iParent in the outer query. @@ -114708,7 +116251,7 @@ __1: // // We look at every expression in the outer query and every place we see // "a" we substitute "x*3" and every place we see "b" we substitute "y+10". - if ((*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0) && (((*Select)(unsafe.Pointer(pParent)).FselFlags & SF_NoopOrderBy) == U32(0)) { + if ((*Select)(unsafe.Pointer(pSub)).FpOrderBy != 0) && (((*Select)(unsafe.Pointer(pParent)).FselFlags & U32(SF_NoopOrderBy)) == U32(0)) { // At this point, any non-zero iOrderByCol values indicate that the // ORDER BY column expression is identical to the iOrderByCol'th // expression returned by SELECT statement pSub. Since these values @@ -114752,7 +116295,7 @@ __1: // The flattened query is a compound if either the inner or the // outer query is a compound. - *(*U32)(unsafe.Pointer(pParent + 4 /* &.selFlags */)) |= ((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_Compound) + *(*U32)(unsafe.Pointer(pParent + 4 /* &.selFlags */)) |= ((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Compound)) // restriction (17b) // SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y; @@ -114791,7 +116334,7 @@ __3: // A structure to keep track of all of the column values that are fixed to // a known value due to WHERE clause constraints of the form COLUMN=VALUE. -type WhereConst = WhereConst1 /* sqlite3.c:133502:27 */ +type WhereConst = WhereConst1 /* sqlite3.c:135393:27 */ // Add a new entry to the pConst object. Except, do not add duplicate // pColumn entires. Also, do not add if doing so would not be appropriate. @@ -114799,10 +116342,10 @@ type WhereConst = WhereConst1 /* sqlite3.c:133502:27 */ // The caller guarantees the pColumn is a column and pValue is a constant. // This routine has to do some additional checks before completing the // insert. -func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr, pExpr uintptr) { /* sqlite3.c:133518:13: */ +func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr, pExpr uintptr) { /* sqlite3.c:135409:13: */ var i int32 - if ((*Expr)(unsafe.Pointer((pColumn))).Fflags & (EP_FixedCol)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pColumn))).Fflags & (U32(EP_FixedCol))) != U32(0) { return } if int32(Xsqlite3ExprAffinity(tls, pValue)) != 0 { @@ -114838,13 +116381,13 @@ func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr, // is a constant expression and where the term must be true because it // is part of the AND-connected terms of the expression. For each term // found, add it to the pConst structure. -func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3.c:133563:13: */ +func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3.c:135454:13: */ var pRight uintptr var pLeft uintptr if pExpr == uintptr(0) { return } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { return } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AND { @@ -114870,7 +116413,7 @@ func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3 // to be replaced by a value. If pExpr is equivalent to one of the // columns named in pWalker->u.pConst, then overwrite it with its // corresponding value. -func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:133591:12: */ +func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:135482:12: */ var i int32 var pConst uintptr if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN { @@ -114895,7 +116438,7 @@ func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) // A match is found. Add the EP_FixedCol property (*WhereConst)(unsafe.Pointer(pConst)).FnChng++ *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Leaf))) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_FixedCol) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_FixedCol)) (*Expr)(unsafe.Pointer(pExpr)).FpLeft = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(((i*2)+1))*8)), 0) break @@ -114937,7 +116480,7 @@ func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) // routines know to generate the constant "123" instead of looking up the // column value. Also, to avoid collation problems, this optimization is // only attempted if the "a=123" term uses the default BINARY collation. -func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:133653:12: */ +func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:135544:12: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -114972,6 +116515,27 @@ func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sql return nChng } +// This function is called to determine whether or not it is safe to +// push WHERE clause expression pExpr down to FROM clause sub-query +// pSubq, which contains at least one window function. Return 1 +// if it is safe and the expression should be pushed down, or 0 +// otherwise. +// +// It is only safe to push the expression down if it consists only +// of constants and copies of expressions that appear in the PARTITION +// BY clause of all window function used by the sub-query. It is safe +// to filter out entire partitions, but not rows within partitions, as +// this may change the results of the window functions. +// +// At the time this function is called it is guaranteed that +// +// * the sub-query uses only one distinct window frame, and +// * that the window frame has a PARTITION BY clase. +func pushDownWindowCheck(tls *libc.TLS, pParse uintptr, pSubq uintptr, pExpr uintptr) int32 { /* sqlite3.c:135593:12: */ + + return Xsqlite3ExprIsConstantOrGroupBy(tls, pParse, pExpr, (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSubq)).FpWin)).FpPartition) +} + // Make copies of relevant WHERE clause terms of the outer query into // the WHERE clause of subquery. Example: // @@ -115017,30 +116581,51 @@ func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sql // But if the (b2=2) term were to be pushed down into the bb subquery, // then the (1,1,NULL) row would be suppressed. // -// (6) The inner query features one or more window-functions (since -// changes to the WHERE clause of the inner query could change the -// window over which window functions are calculated). +// (6) Window functions make things tricky as changes to the WHERE clause +// of the inner query could change the window over which window +// functions are calculated. Therefore, do not attempt the optimization +// if: +// +// (6a) The inner query uses multiple incompatible window partitions. +// +// (6b) The inner query is a compound and uses window-functions. +// +// (6c) The WHERE clause does not consist entirely of constants and +// copies of expressions found in the PARTITION BY clause of +// all window-functions used by the sub-query. It is safe to +// filter out entire partitions, as this does not change the +// window over which any window-function is calculated. +// +// (7) The inner query is a Common Table Expression (CTE) that should +// be materialized. (This restriction is implemented in the calling +// routine.) // // 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 *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uintptr, iCursor int32, isLeftJoin int32) int32 { /* sqlite3.c:133736:12: */ +func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uintptr, iCursor int32, isLeftJoin int32) int32 { /* sqlite3.c:135671:12: */ bp := tls.Alloc(32) defer tls.Free(32) var pNew uintptr var nChng int32 = 0 - var pSel uintptr if pWhere == uintptr(0) { return 0 } - if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & SF_Recursive) != 0 { + if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & (U32(SF_Recursive | SF_MultiPart))) != 0 { return 0 - } // restriction (2) + } - for pSel = pSubq; pSel != 0; pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior { - if (*Select)(unsafe.Pointer(pSel)).FpWin != 0 { + if (*Select)(unsafe.Pointer(pSubq)).FpPrior != 0 { + var pSel uintptr + for pSel = pSubq; pSel != 0; pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior { + if (*Select)(unsafe.Pointer(pSel)).FpWin != 0 { + return 0 + } // restriction (6b) + } + } else { + if ((*Select)(unsafe.Pointer(pSubq)).FpWin != 0) && ((*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSubq)).FpWin)).FpPartition == uintptr(0)) { return 0 - } // restriction (6) + } } if (*Select)(unsafe.Pointer(pSubq)).FpLimit != uintptr(0) { @@ -115052,15 +116637,16 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin pWhere = (*Expr)(unsafe.Pointer(pWhere)).FpLeft } if (isLeftJoin != 0) && - (((libc.Bool32(((*Expr)(unsafe.Pointer((pWhere))).Fflags & (EP_FromJoin)) != U32(0))) == 0) || - (int32((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable) != iCursor)) { + (((libc.Bool32(((*Expr)(unsafe.Pointer((pWhere))).Fflags & (U32(EP_FromJoin))) != U32(0))) == 0) || + ((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable != iCursor)) { return 0 // restriction (4) } - if (((*Expr)(unsafe.Pointer((pWhere))).Fflags & (EP_FromJoin)) != U32(0)) && (int32((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable) != iCursor) { + if (((*Expr)(unsafe.Pointer((pWhere))).Fflags & (U32(EP_FromJoin))) != U32(0)) && ((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable != iCursor) { return 0 // restriction (5) } if Xsqlite3ExprIsTableConstant(tls, pWhere, iCursor) != 0 { nChng++ + *(*U32)(unsafe.Pointer(pSubq + 4 /* &.selFlags */)) |= (U32(SF_PushDown)) for pSubq != 0 { // var x SubstContext at bp, 32 @@ -115072,7 +116658,13 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin (*SubstContext)(unsafe.Pointer(bp /* &x */)).FisLeftJoin = 0 (*SubstContext)(unsafe.Pointer(bp /* &x */)).FpEList = (*Select)(unsafe.Pointer(pSubq)).FpEList pNew = substExpr(tls, bp /* &x */, pNew) - if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & SF_Aggregate) != 0 { + if ((*Select)(unsafe.Pointer(pSubq)).FpWin != 0) && (0 == pushDownWindowCheck(tls, pParse, pSubq, pNew)) { + // Restriction 6c has prevented push-down in this case + Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pNew) + nChng-- + break + } + if ((*Select)(unsafe.Pointer(pSubq)).FselFlags & U32(SF_Aggregate)) != 0 { (*Select)(unsafe.Pointer(pSubq)).FpHaving = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(pSubq)).FpHaving, pNew) } else { (*Select)(unsafe.Pointer(pSubq)).FpWhere = Xsqlite3ExprAnd(tls, pParse, (*Select)(unsafe.Pointer(pSubq)).FpWhere, pNew) @@ -115097,25 +116689,28 @@ func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uin // This routine must be called after aggregate functions have been // located but before their arguments have been subjected to aggregate // analysis. -func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 { /* sqlite3.c:133825:11: */ +func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 { /* sqlite3.c:135773:11: */ var eRet int32 = WHERE_ORDERBY_NORMAL // Return value var pEList uintptr = *(*uintptr)(unsafe.Pointer(pFunc + 32 /* &.x */)) // Arguments to agg function var zFunc uintptr // Name of aggregate function pFunc var pOrderBy uintptr var sortFlags U8 = U8(0) - if ((pEList == uintptr(0)) || ((*ExprList)(unsafe.Pointer(pEList)).FnExpr != 1)) || (((*Expr)(unsafe.Pointer((pFunc))).Fflags & (EP_WinFunc)) != U32(0)) { + if (((pEList == uintptr(0)) || + ((*ExprList)(unsafe.Pointer(pEList)).FnExpr != 1)) || + (((*Expr)(unsafe.Pointer((pFunc))).Fflags & (U32(EP_WinFunc))) != U32(0))) || + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_MinMaxOpt))) != U32(0)) { return U8(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8 /* &.u */)) - if Xsqlite3StrICmp(tls, zFunc, ts+16204 /* "min" */) == 0 { + if Xsqlite3StrICmp(tls, zFunc, ts+16666 /* "min" */) == 0 { eRet = WHERE_ORDERBY_MIN if Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */))).FpExpr) != 0 { - sortFlags = KEYINFO_ORDER_BIGNULL + sortFlags = U8(KEYINFO_ORDER_BIGNULL) } - } else if Xsqlite3StrICmp(tls, zFunc, ts+16208 /* "max" */) == 0 { + } else if Xsqlite3StrICmp(tls, zFunc, ts+16670 /* "max" */) == 0 { eRet = WHERE_ORDERBY_MAX - sortFlags = KEYINFO_ORDER_DESC + sortFlags = U8(KEYINFO_ORDER_DESC) } else { return U8(eRet) } @@ -115136,15 +116731,15 @@ func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 // 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 *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqlite3.c:133867:14: */ +func isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqlite3.c:135819:14: */ var pTab uintptr var pExpr uintptr if ((((*Select)(unsafe.Pointer(p)).FpWhere != 0) || ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr != 1)) || - ((*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc != 1)) || ((*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect != 0) { + ((*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc != 1)) || ((*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect != 0) { return uintptr(0) } - pTab = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab + pTab = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab pExpr = (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpEList + 8 /* &.a */))).FpExpr if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { @@ -115156,7 +116751,7 @@ func isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqli if (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 0 { return uintptr(0) } - if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFunc)).FfuncFlags & SQLITE_FUNC_COUNT) == U32(0) { + if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_COUNT)) == U32(0) { return uintptr(0) } if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_Distinct | EP_WinFunc))) != U32(0) { @@ -115171,23 +116766,22 @@ func isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqli // 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 Xsqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:133898:20: */ +func Xsqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:135850:20: */ bp := tls.Alloc(16) defer tls.Free(16) - if ((*SrcList_item)(unsafe.Pointer(pFrom)).FpTab != 0) && ((uint32(int32(*(*uint8)(unsafe.Pointer((pFrom + 60 /* &.fg */) + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0) { - var pTab uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab - var zIndexedBy uintptr = *(*uintptr)(unsafe.Pointer(pFrom + 96 /* &.u1 */)) - var pIdx uintptr - for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; (pIdx != 0) && (Xsqlite3StrICmp(tls, (*Index)(unsafe.Pointer(pIdx)).FzName, zIndexedBy) != 0); pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext { - } - if !(pIdx != 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+20359 /* "no such index: %..." */, libc.VaList(bp, zIndexedBy, 0)) - (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) - return SQLITE_ERROR - } - (*SrcList_item)(unsafe.Pointer(pFrom)).FpIBIndex = pIdx + var pTab uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab + var zIndexedBy uintptr = *(*uintptr)(unsafe.Pointer(pFrom + 96 /* &.u1 */)) + var pIdx uintptr + + for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; (pIdx != 0) && (Xsqlite3StrICmp(tls, (*Index)(unsafe.Pointer(pIdx)).FzName, zIndexedBy) != 0); pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext { } + if !(pIdx != 0) { + Xsqlite3ErrorMsg(tls, pParse, ts+20766 /* "no such index: %..." */, libc.VaList(bp, zIndexedBy, 0)) + (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) + return SQLITE_ERROR + } + *(*uintptr)(unsafe.Pointer(pFrom + 104 /* &.u2 */)) = pIdx return SQLITE_OK } @@ -115210,7 +116804,7 @@ func Xsqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 // 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 *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:133937:12: */ +func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:135891:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -115244,7 +116838,7 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) return WRC_Continue } for i = ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr - 1); i >= 0; i-- { - if ((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(a+uintptr(i)*32)).FpExpr)).Fflags & EP_Collate) != 0 { + if ((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(a+uintptr(i)*32)).FpExpr)).Fflags & U32(EP_Collate)) != 0 { break } } @@ -115268,7 +116862,7 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) *(*Select)(unsafe.Pointer(pNew)) = *(*Select)(unsafe.Pointer(p)) (*Select)(unsafe.Pointer(p)).FpSrc = pNewSrc (*Select)(unsafe.Pointer(p)).FpEList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), Xsqlite3Expr(tls, db, TK_ASTERISK, uintptr(0))) - (*Select)(unsafe.Pointer(p)).Fop = TK_SELECT + (*Select)(unsafe.Pointer(p)).Fop = U8(TK_SELECT) (*Select)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*Select)(unsafe.Pointer(pNew)).FpGroupBy = uintptr(0) (*Select)(unsafe.Pointer(pNew)).FpHaving = uintptr(0) @@ -115279,7 +116873,7 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*Select)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Compound))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Converted) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Converted)) (*Select)(unsafe.Pointer((*Select)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*Select)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -115289,12 +116883,12 @@ func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) // 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 *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:134002:12: */ +func cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:135956:12: */ bp := tls.Alloc(8) defer tls.Free(8) if (uint32(int32(*(*uint8)(unsafe.Pointer(pFrom + 60 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+20377 /* "'%s' is not a fu..." */, libc.VaList(bp, (*SrcList_item)(unsafe.Pointer(pFrom)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+20784 /* "'%s' is not a fu..." */, libc.VaList(bp, (*SrcItem)(unsafe.Pointer(pFrom)).FzName)) return 1 } return 0 @@ -115308,17 +116902,16 @@ func cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* s // // If a non-NULL value is returned, set *ppContext to point to the With // object that the returned CTE belongs to. -func searchWith(tls *libc.TLS, pWith uintptr, pItem uintptr, ppContext uintptr) uintptr { /* sqlite3.c:134021:19: */ - var zName uintptr - if ((*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase == uintptr(0)) && ((libc.AssignUintptr(&zName, (*SrcList_item)(unsafe.Pointer(pItem)).FzName)) != uintptr(0)) { - var p uintptr - for p = pWith; p != 0; p = (*With)(unsafe.Pointer(p)).FpOuter { - var i int32 - for i = 0; i < (*With)(unsafe.Pointer(p)).FnCte; i++ { - if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*32)).FzName) == 0 { - *(*uintptr)(unsafe.Pointer(ppContext)) = p - return ((p + 16 /* &.a */) + uintptr(i)*32) - } +func searchWith(tls *libc.TLS, pWith uintptr, pItem uintptr, ppContext uintptr) uintptr { /* sqlite3.c:135975:19: */ + var zName uintptr = (*SrcItem)(unsafe.Pointer(pItem)).FzName + var p uintptr + + for p = pWith; p != 0; p = (*With)(unsafe.Pointer(p)).FpOuter { + var i int32 + for i = 0; i < (*With)(unsafe.Pointer(p)).FnCte; i++ { + if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer((p+16 /* &.a */)+uintptr(i)*48)).FzName) == 0 { + *(*uintptr)(unsafe.Pointer(ppContext)) = p + return ((p + 16 /* &.a */) + uintptr(i)*48) } } } @@ -115334,53 +116927,63 @@ func searchWith(tls *libc.TLS, pWith uintptr, pItem uintptr, ppContext uintptr) // 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 Xsqlite3WithPush(tls *libc.TLS, pParse uintptr, pWith uintptr, bFree U8) { /* sqlite3.c:134052:21: */ - +func Xsqlite3WithPush(tls *libc.TLS, pParse uintptr, pWith uintptr, bFree U8) { /* sqlite3.c:136006:21: */ if pWith != 0 { (*With)(unsafe.Pointer(pWith)).FpOuter = (*Parse)(unsafe.Pointer(pParse)).FpWith (*Parse)(unsafe.Pointer(pParse)).FpWith = pWith if bFree != 0 { - (*Parse)(unsafe.Pointer(pParse)).FpWithToFree = pWith + Xsqlite3ParserAddCleanup(tls, pParse, + *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{Xsqlite3WithDelete})), + pWith) + } } } // 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. +// a WITH clause on the stack currently maintained by the parser (on the +// pParse->pWith linked list). And if currently processing a CTE +// CTE expression, through routine checks to see if the reference is +// a recursive reference to the 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. +// If pFrom matches a CTE according to either of these two above, pFrom->pTab +// and other fields are populated accordingly. // -// 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 *libc.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3.c:134077:12: */ +// Return 0 if no match is found. +// Return 1 if a match is found. +// Return 2 if an error condition is detected. +func resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3.c:136034:12: */ bp := tls.Alloc(48) defer tls.Free(48) - var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse - var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pCte uintptr // Matched CTE (or NULL if no match) // var pWith uintptr at bp+40, 8 - // WITH clause that pCte belongs to + // The matching WITH - if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { - return SQLITE_ERROR + if (*Parse)(unsafe.Pointer(pParse)).FpWith == uintptr(0) { + // There are no WITH clauses in the stack. No match is possible + return 0 + } + if (*SrcItem)(unsafe.Pointer(pFrom)).FzDatabase != uintptr(0) { + // The FROM term contains a schema qualifier (ex: main.t1) and so + // it cannot possibly be a CTE reference. + return 0 } - pCte = searchWith(tls, (*Parse)(unsafe.Pointer(pParse)).FpWith, pFrom, bp+40 /* &pWith */) if pCte != 0 { + var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTab uintptr var pEList uintptr var pSel uintptr var pLeft uintptr // Left-most SELECT statement + var pRecTerm uintptr // Left-most recursive term var bMayRecursive int32 // True if compound joined by UNION [ALL] var pSavedWith uintptr // Initial value of pParse->pWith + var iRecTab int32 = -1 // Cursor for recursive table + var pCteUse uintptr // If pCte->zCteErr is non-NULL at this point, then this is an illegal // recursive reference to CTE pCte. Leave an error in pParse and return @@ -115388,61 +116991,87 @@ func withExpand(tls *libc.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite // In this case, proceed. if (*Cte)(unsafe.Pointer(pCte)).FzCteErr != 0 { Xsqlite3ErrorMsg(tls, pParse, (*Cte)(unsafe.Pointer(pCte)).FzCteErr, libc.VaList(bp, (*Cte)(unsafe.Pointer(pCte)).FzName)) - return SQLITE_ERROR + return 2 } if cannotBeFunction(tls, pParse, pFrom) != 0 { - return SQLITE_ERROR + return 2 } - (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{})))) + pTab = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{}))) if pTab == uintptr(0) { - return WRC_Abort + return 2 } + pCteUse = (*Cte)(unsafe.Pointer(pCte)).FpUse + if pCteUse == uintptr(0) { + (*Cte)(unsafe.Pointer(pCte)).FpUse = libc.AssignUintptr(&pCteUse, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(CteUse{})))) + if (pCteUse == uintptr(0)) || + (Xsqlite3ParserAddCleanup(tls, pParse, *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{Xsqlite3DbFree})), pCteUse) == uintptr(0)) { + Xsqlite3DbFree(tls, db, pTab) + return 2 + } + (*CteUse)(unsafe.Pointer(pCteUse)).FeM10d = (*Cte)(unsafe.Pointer(pCte)).FeM10d + } + (*SrcItem)(unsafe.Pointer(pFrom)).FpTab = pTab (*Table)(unsafe.Pointer(pTab)).FnTabRef = U32(1) (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3DbStrDup(tls, db, (*Cte)(unsafe.Pointer(pCte)).FzName) (*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1) (*Table)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200) *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral | TF_NoVisibleRowid)) - (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpSelect, 0) + (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, (*Cte)(unsafe.Pointer(pCte)).FpSelect, 0) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - return SQLITE_NOMEM + return 2 + } + + libc.SetBitFieldPtr8Uint32(pFrom+60 /* &.fg */ +4 /* &.isCte */, uint32(1), 7, 0x80) + *(*uintptr)(unsafe.Pointer(pFrom + 104 /* &.u2 */)) = pCteUse + (*CteUse)(unsafe.Pointer(pCteUse)).FnUse++ + if ((*CteUse)(unsafe.Pointer(pCteUse)).FnUse >= 2) && (int32((*CteUse)(unsafe.Pointer(pCteUse)).FeM10d) == M10d_Any) { + (*CteUse)(unsafe.Pointer(pCteUse)).FeM10d = U8(M10d_Yes) } // Check if this is a recursive CTE. - pSel = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect + pRecTerm = libc.AssignUintptr(&pSel, (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect) bMayRecursive = (libc.Bool32((int32((*Select)(unsafe.Pointer(pSel)).Fop) == TK_ALL) || (int32((*Select)(unsafe.Pointer(pSel)).Fop) == TK_UNION))) - if bMayRecursive != 0 { + for (bMayRecursive != 0) && (int32((*Select)(unsafe.Pointer(pRecTerm)).Fop) == int32((*Select)(unsafe.Pointer(pSel)).Fop)) { var i int32 - var pSrc uintptr = (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect)).FpSrc + var pSrc uintptr = (*Select)(unsafe.Pointer(pRecTerm)).FpSrc + for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ { var pItem uintptr = ((pSrc + 8 /* &.a */) + uintptr(i)*112) - if (((*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase == uintptr(0)) && - ((*SrcList_item)(unsafe.Pointer(pItem)).FzName != uintptr(0))) && - (0 == Xsqlite3StrICmp(tls, (*SrcList_item)(unsafe.Pointer(pItem)).FzName, (*Cte)(unsafe.Pointer(pCte)).FzName)) { - (*SrcList_item)(unsafe.Pointer(pItem)).FpTab = pTab - libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isRecursive */, uint32(1), 5, 0x20) + if (((*SrcItem)(unsafe.Pointer(pItem)).FzDatabase == uintptr(0)) && + ((*SrcItem)(unsafe.Pointer(pItem)).FzName != uintptr(0))) && + (0 == Xsqlite3StrICmp(tls, (*SrcItem)(unsafe.Pointer(pItem)).FzName, (*Cte)(unsafe.Pointer(pCte)).FzName)) { + (*SrcItem)(unsafe.Pointer(pItem)).FpTab = pTab (*Table)(unsafe.Pointer(pTab)).FnTabRef++ - *(*U32)(unsafe.Pointer(pSel + 4 /* &.selFlags */)) |= (SF_Recursive) + libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isRecursive */, uint32(1), 5, 0x20) + if ((*Select)(unsafe.Pointer(pRecTerm)).FselFlags & U32(SF_Recursive)) != 0 { + Xsqlite3ErrorMsg(tls, pParse, + ts+20807 /* "multiple referen..." */, libc.VaList(bp+8, (*Cte)(unsafe.Pointer(pCte)).FzName)) + return 2 + } + *(*U32)(unsafe.Pointer(pRecTerm + 4 /* &.selFlags */)) |= (U32(SF_Recursive)) + if iRecTab < 0 { + iRecTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + } + (*SrcItem)(unsafe.Pointer(pItem)).FiCursor = iRecTab } } + if ((*Select)(unsafe.Pointer(pRecTerm)).FselFlags & U32(SF_Recursive)) == U32(0) { + break + } + pRecTerm = (*Select)(unsafe.Pointer(pRecTerm)).FpPrior } - // Only one recursive reference is permitted. - if (*Table)(unsafe.Pointer(pTab)).FnTabRef > U32(2) { - Xsqlite3ErrorMsg(tls, - pParse, ts+20400 /* "multiple referen..." */, libc.VaList(bp+8, (*Cte)(unsafe.Pointer(pCte)).FzName)) - return SQLITE_ERROR - } - - (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 20443 /* "circular referen..." */ + (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 20850 /* "circular referen..." */ pSavedWith = (*Parse)(unsafe.Pointer(pParse)).FpWith (*Parse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp + 40 /* pWith */)) - if bMayRecursive != 0 { - var pPrior uintptr = (*Select)(unsafe.Pointer(pSel)).FpPrior + if ((*Select)(unsafe.Pointer(pSel)).FselFlags & U32(SF_Recursive)) != 0 { - (*Select)(unsafe.Pointer(pPrior)).FpWith = (*Select)(unsafe.Pointer(pSel)).FpWith - Xsqlite3WalkSelect(tls, pWalker, pPrior) - (*Select)(unsafe.Pointer(pPrior)).FpWith = uintptr(0) + (*Select)(unsafe.Pointer(pRecTerm)).FpWith = (*Select)(unsafe.Pointer(pSel)).FpWith + Xsqlite3WalkSelect(tls, pWalker, pRecTerm) + (*Select)(unsafe.Pointer(pRecTerm)).FpWith = uintptr(0) } else { Xsqlite3WalkSelect(tls, pWalker, pSel) } @@ -115453,28 +117082,28 @@ func withExpand(tls *libc.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite pEList = (*Select)(unsafe.Pointer(pLeft)).FpEList if (*Cte)(unsafe.Pointer(pCte)).FpCols != 0 { if (pEList != 0) && ((*ExprList)(unsafe.Pointer(pEList)).FnExpr != (*ExprList)(unsafe.Pointer((*Cte)(unsafe.Pointer(pCte)).FpCols)).FnExpr) { - Xsqlite3ErrorMsg(tls, pParse, ts+20466, /* "table %s has %d ..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+20873, /* "table %s has %d ..." */ libc.VaList(bp+16, (*Cte)(unsafe.Pointer(pCte)).FzName, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, (*ExprList)(unsafe.Pointer((*Cte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*Parse)(unsafe.Pointer(pParse)).FpWith = pSavedWith - return SQLITE_ERROR + return 2 } pEList = (*Cte)(unsafe.Pointer(pCte)).FpCols } Xsqlite3ColumnsFromExprList(tls, pParse, pEList, (pTab + 70 /* &.nCol */), (pTab + 8 /* &.aCol */)) if bMayRecursive != 0 { - if ((*Select)(unsafe.Pointer(pSel)).FselFlags & SF_Recursive) != 0 { - (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 20504 /* "multiple recursi..." */ + if ((*Select)(unsafe.Pointer(pSel)).FselFlags & U32(SF_Recursive)) != 0 { + (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 20911 /* "multiple recursi..." */ } else { - (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 20538 /* "recursive refere..." */ + (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 20945 /* "recursive refere..." */ } Xsqlite3WalkSelect(tls, pWalker, pSel) } (*Cte)(unsafe.Pointer(pCte)).FzCteErr = uintptr(0) (*Parse)(unsafe.Pointer(pParse)).FpWith = pSavedWith + return 1 // Success } - - return SQLITE_OK + return 0 // No match } // If the SELECT passed as the second argument has an associated WITH @@ -115483,7 +117112,7 @@ func withExpand(tls *libc.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite // 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 *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:134205:13: */ +func selectPopWith(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:136192:13: */ var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse if ((*Parse)(unsafe.Pointer(pParse)).FpWith != 0) && ((*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0)) { var pWith uintptr = (*Select)(unsafe.Pointer(findRightmost(tls, p))).FpWith @@ -115499,22 +117128,22 @@ func selectPopWith(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:134 // allocates and populates the SrcList_item.pTab object. If successful, // SQLITE_OK is returned. Otherwise, if an OOM error is encountered, // SQLITE_NOMEM. -func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:134226:20: */ +func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:136213:20: */ bp := tls.Alloc(8) defer tls.Free(8) - var pSel uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect + var pSel uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect var pTab uintptr - (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Table{})))) + (*SrcItem)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Table{})))) if pTab == uintptr(0) { return SQLITE_NOMEM } (*Table)(unsafe.Pointer(pTab)).FnTabRef = U32(1) - if (*SrcList_item)(unsafe.Pointer(pFrom)).FzAlias != 0 { - (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3DbStrDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcList_item)(unsafe.Pointer(pFrom)).FzAlias) + if (*SrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { + (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3DbStrDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+20576 /* "subquery_%u" */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId)) + (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+20983 /* "subquery_%u" */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId)) } for (*Select)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior @@ -115522,7 +117151,7 @@ func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 Xsqlite3ColumnsFromExprList(tls, pParse, (*Select)(unsafe.Pointer(pSel)).FpEList, (pTab + 70 /* &.nCol */), (pTab + 8 /* &.aCol */)) (*Table)(unsafe.Pointer(pTab)).FiPKey = int16(-1) (*Table)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200) - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_Ephemeral) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral)) if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 { return SQLITE_ERROR @@ -115552,7 +117181,7 @@ func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 // If found, expand each "*" to be every column in every table // and TABLE.* to be every column in TABLE. // -func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:134272:12: */ +func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:136259:12: */ bp := tls.Alloc(88) defer tls.Free(88) @@ -115560,6 +117189,7 @@ func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite var i int32 var j int32 var k int32 + var rc int32 var pTabList uintptr var pEList uintptr var pFrom uintptr @@ -115570,7 +117200,7 @@ func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite var selFlags U16 = U16((*Select)(unsafe.Pointer(p)).FselFlags) var elistFlags U32 = U32(0) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Expanded) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Expanded)) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return WRC_Abort } @@ -115602,16 +117232,12 @@ __1: { var pTab uintptr - if (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab != 0 { + if (*SrcItem)(unsafe.Pointer(pFrom)).FpTab != 0 { goto __2 } - if withExpand(tls, pWalker, pFrom) != 0 { - return WRC_Abort - } - if (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab != 0 { - } else if (*SrcList_item)(unsafe.Pointer(pFrom)).FzName == uintptr(0) { - var pSel uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect + if (*SrcItem)(unsafe.Pointer(pFrom)).FzName == uintptr(0) { + var pSel uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect // A sub-query in the FROM clause of a SELECT if Xsqlite3WalkSelect(tls, pWalker, pSel) != 0 { @@ -115620,17 +117246,23 @@ __1: if Xsqlite3ExpandSubquery(tls, pParse, pFrom) != 0 { return WRC_Abort } + } else if (libc.AssignInt32(&rc, resolveFromTermToCte(tls, pParse, pWalker, pFrom))) != 0 { + if rc > 1 { + return WRC_Abort + } + pTab = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab + } else { // An ordinary table or view name in the FROM clause - (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3LocateTableItem(tls, pParse, uint32(0), pFrom)) + (*SrcItem)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3LocateTableItem(tls, pParse, uint32(0), pFrom)) if pTab == uintptr(0) { return WRC_Abort } if (*Table)(unsafe.Pointer(pTab)).FnTabRef >= U32(0xffff) { - Xsqlite3ErrorMsg(tls, pParse, ts+20588, /* "too many referen..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+20995, /* "too many referen..." */ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) - (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = uintptr(0) + (*SrcItem)(unsafe.Pointer(pFrom)).FpTab = uintptr(0) return WRC_Abort } (*Table)(unsafe.Pointer(pTab)).FnTabRef++ @@ -115644,29 +117276,31 @@ __1: return WRC_Abort } - if ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_EnableView) == uint64(0)) { - Xsqlite3ErrorMsg(tls, pParse, ts+20627, /* "access to view \"..." */ + if (((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) && + (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableView)) == uint64(0))) && + ((*Table)(unsafe.Pointer(pTab)).FpSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema) { + Xsqlite3ErrorMsg(tls, pParse, ts+21034, /* "access to view \"..." */ libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName)) } if ((((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) && ((uint32(int32(*(*uint8)(unsafe.Pointer((pFrom + 60 /* &.fg */) + 4 /* &.fromDDL */)) & 0x40 >> 6))) != 0)) && ((*Table)(unsafe.Pointer(pTab)).FpVTable != uintptr(0))) && - (int32((*VTable)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpVTable)).FeVtabRisk) > (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_TrustedSchema) != uint64(0)))) { - Xsqlite3ErrorMsg(tls, pParse, ts+20658, /* "unsafe use of vi..." */ + (int32((*VTable)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpVTable)).FeVtabRisk) > (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_TrustedSchema)) != uint64(0)))) { + Xsqlite3ErrorMsg(tls, pParse, ts+21065, /* "unsafe use of vi..." */ libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName)) } - (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSelect, 0) + (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSelect, 0) nCol = (*Table)(unsafe.Pointer(pTab)).FnCol (*Table)(unsafe.Pointer(pTab)).FnCol = int16(-1) (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(1) // Turn on Select.selId renumbering - Xsqlite3WalkSelect(tls, pWalker, (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect) + Xsqlite3WalkSelect(tls, pWalker, (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect) (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(eCodeOrig) (*Table)(unsafe.Pointer(pTab)).FnCol = nCol } } // Locate the index named by the INDEXED BY clause, if any. - if Xsqlite3IndexedByLookup(tls, pParse, pFrom) != 0 { + if ((uint32(int32(*(*uint8)(unsafe.Pointer((pFrom + 60 /* &.fg */) + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0) && (Xsqlite3IndexedByLookup(tls, pParse, pFrom) != 0) { return WRC_Abort } @@ -115747,9 +117381,9 @@ __3: goto __6 } { - var pTab uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab - var pSub uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect - var zTabName uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FzAlias + var pTab uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab + var pSub uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect + var zTabName uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FzAlias var zSchemaName uintptr = uintptr(0) var iDb int32 if zTabName == uintptr(0) { @@ -115758,7 +117392,7 @@ __3: if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto __6 } - if (pSub == uintptr(0)) || (((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_NestedFrom) == U32(0)) { + if (pSub == uintptr(0)) || (((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_NestedFrom)) == U32(0)) { pSub = uintptr(0) if (zTName != 0) && (Xsqlite3StrICmp(tls, zTName, zTabName) != 0) { goto __5 @@ -115767,7 +117401,7 @@ __3: if iDb >= 0 { zSchemaName = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName } else { - zSchemaName = ts + 20691 /* "*" */ + zSchemaName = ts + 21098 /* "*" */ } } for j = 0; j < int32((*Table)(unsafe.Pointer(pTab)).FnCol); j++ { @@ -115785,20 +117419,20 @@ __3: // If a column is marked as 'hidden', omit it from the expanded // result-set list unless the SELECT has the SF_IncludeHidden // bit set. - if (((*Select)(unsafe.Pointer(p)).FselFlags & SF_IncludeHidden) == U32(0)) && + if (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_IncludeHidden)) == U32(0)) && ((int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*32))).FcolFlags) & COLFLAG_HIDDEN) != 0) { continue } tableSeen = 1 if (i > 0) && (zTName == uintptr(0)) { - if ((int32((*SrcList_item)(unsafe.Pointer(pFrom)).Ffg.Fjointype) & JT_NATURAL) != 0) && + if ((int32((*SrcItem)(unsafe.Pointer(pFrom)).Ffg.Fjointype) & JT_NATURAL) != 0) && (tableAndColumnIndex(tls, pTabList, i, zName, uintptr(0), uintptr(0), 1) != 0) { // In a NATURAL join, omit the join columns from the // table to the right of the join continue } - if Xsqlite3IdListIndex(tls, (*SrcList_item)(unsafe.Pointer(pFrom)).FpUsing, zName) >= 0 { + if Xsqlite3IdListIndex(tls, (*SrcItem)(unsafe.Pointer(pFrom)).FpUsing, zName) >= 0 { // In a join with a USING clause, omit columns in the // using clause from the table on the right. continue @@ -115816,7 +117450,7 @@ __3: pExpr = Xsqlite3PExpr(tls, pParse, TK_DOT, pLeft, pExpr) } if longNames != 0 { - zColname = Xsqlite3MPrintf(tls, db, ts+9997 /* "%s.%s" */, libc.VaList(bp+24, zTabName, zName)) + zColname = Xsqlite3MPrintf(tls, db, ts+10090 /* "%s.%s" */, libc.VaList(bp+24, zTabName, zName)) zToFree = zColname } } else { @@ -115825,18 +117459,18 @@ __3: pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pExpr) Xsqlite3TokenInit(tls, bp+72 /* &sColname */, zColname) Xsqlite3ExprListSetName(tls, pParse, pNew, bp+72 /* &sColname */, 0) - if ((pNew != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_NestedFrom) != U32(0))) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { + if ((pNew != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_NestedFrom)) != U32(0))) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { var pX uintptr = ((pNew + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*32) Xsqlite3DbFree(tls, db, (*ExprList_item)(unsafe.Pointer(pX)).FzEName) if pSub != 0 { (*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSub)).FpEList+8 /* &.a */)+uintptr(j)*32)).FzEName) } else { - (*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3MPrintf(tls, db, ts+20693, /* "%s.%s.%s" */ + (*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3MPrintf(tls, db, ts+21100, /* "%s.%s.%s" */ libc.VaList(bp+40, zSchemaName, zTabName, zColname)) } - libc.SetBitFieldPtr8Uint32(pX+20 /* &.eEName */, ENAME_TAB, 0, 0x3) + libc.SetBitFieldPtr8Uint32(pX+20 /* &.eEName */, uint32(ENAME_TAB), 0, 0x3) } Xsqlite3DbFree(tls, db, zToFree) } @@ -115852,9 +117486,9 @@ __3: ; if !(tableSeen != 0) { if zTName != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+20702 /* "no such table: %..." */, libc.VaList(bp+64, zTName)) + Xsqlite3ErrorMsg(tls, pParse, ts+21109 /* "no such table: %..." */, libc.VaList(bp+64, zTName)) } else { - Xsqlite3ErrorMsg(tls, pParse, ts+20720 /* "no tables specif..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+21127 /* "no tables specif..." */, 0) } } } @@ -115863,12 +117497,12 @@ __3: (*Select)(unsafe.Pointer(p)).FpEList = pNew } if (*Select)(unsafe.Pointer(p)).FpEList != 0 { - if (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 2*4)) { - Xsqlite3ErrorMsg(tls, pParse, ts+20740 /* "too many columns..." */, 0) + if (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 2*4)) { + Xsqlite3ErrorMsg(tls, pParse, ts+21147 /* "too many columns..." */, 0) return WRC_Abort } if (elistFlags & (U32(EP_HasFunc | EP_Subquery))) != U32(0) { - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_ComplexResult) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_ComplexResult)) } } return WRC_Continue @@ -115885,7 +117519,7 @@ __3: // 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 *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:134582:13: */ +func sqlite3SelectExpand(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:136574:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -115923,16 +117557,16 @@ func sqlite3SelectExpand(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sq // 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 *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:134612:13: */ +func selectAddSubqueryTypeInfo(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:136604:13: */ var pParse uintptr var i int32 var pTabList uintptr var pFrom uintptr - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_HasTypeInfo) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_HasTypeInfo)) != 0 { return } - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_HasTypeInfo) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_HasTypeInfo)) pParse = (*Walker)(unsafe.Pointer(pWalker)).FpParse pTabList = (*Select)(unsafe.Pointer(p)).FpSrc i = 0 @@ -115942,17 +117576,17 @@ __1: goto __3 } { - var pTab uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab + var pTab uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpTab - if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Ephemeral) != U32(0) { + if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) != U32(0) { // A sub-query in the FROM clause of a SELECT - var pSel uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect + var pSel uintptr = (*SrcItem)(unsafe.Pointer(pFrom)).FpSelect if pSel != 0 { for (*Select)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior } Xsqlite3SelectAddColumnTypeAndCollation(tls, pParse, pTab, pSel, - SQLITE_AFF_NONE) + int8(SQLITE_AFF_NONE)) } } @@ -115971,7 +117605,7 @@ __3: // SELECT statement. // // Use this routine after name resolution. -func sqlite3SelectAddTypeInfo(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:134647:13: */ +func sqlite3SelectAddTypeInfo(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:136639:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -116000,12 +117634,12 @@ func sqlite3SelectAddTypeInfo(tls *libc.TLS, pParse uintptr, pSelect uintptr) { // * Identifiers in expression are matched to tables. // // This routine acts recursively on all subqueries within the SELECT. -func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:134671:21: */ +func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:136663:21: */ if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return } - if ((*Select)(unsafe.Pointer(p)).FselFlags & SF_HasTypeInfo) != 0 { + if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_HasTypeInfo)) != 0 { return } sqlite3SelectExpand(tls, pParse, p) @@ -116025,7 +117659,7 @@ func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintp // intermediate results while calculating an aggregate. This // routine generates code that stores NULLs in all of those memory // cells. -func resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:134694:13: */ +func resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:136686:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var i int32 var pFunc uintptr @@ -116049,7 +117683,7 @@ __1: if (*(*uintptr)(unsafe.Pointer(pE + 32 /* &.x */)) == uintptr(0)) || ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32 /* &.x */)))).FnExpr != 1) { Xsqlite3ErrorMsg(tls, pParse, - ts+20771 /* "DISTINCT aggrega..." */, 0) + ts+21178 /* "DISTINCT aggrega..." */, 0) (*AggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -1 } else { var pKeyInfo uintptr = Xsqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32 /* &.x */)), 0, 0) @@ -116070,7 +117704,7 @@ __3: // Invoke the OP_AggFinalize opcode for every aggregate function // in the AggInfo structure. -func finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:134736:13: */ +func finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:136728:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var i int32 var pF uintptr @@ -116108,7 +117742,7 @@ __3: // in pAggInfo, then only populate the pAggInfo->nAccumulator accumulator // registers if register regAcc contains 0. The caller will take care // of setting and clearing regAcc. -func updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo uintptr) { /* sqlite3.c:134758:13: */ +func updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo uintptr) { /* sqlite3.c:136750:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var i int32 var regHit int32 = 0 @@ -116129,10 +117763,10 @@ __1: var regAgg int32 var pList uintptr = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 32 /* &.x */)) - if ((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr))).Fflags & (EP_WinFunc)) != U32(0) { + if ((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr))).Fflags & (U32(EP_WinFunc))) != U32(0) { var pFilter uintptr = (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 64 /* &.y */)))).FpFilter if (((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) && - (((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0)) && + (((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0)) && (regAcc != 0) { // If regAcc==0, there there exists some min() or max() function // without a FILTER clause that will ensure the magnet registers @@ -116155,7 +117789,7 @@ __1: if pList != 0 { nArg = (*ExprList)(unsafe.Pointer(pList)).FnExpr regAgg = Xsqlite3GetTempRange(tls, pParse, nArg) - Xsqlite3ExprCodeExprList(tls, pParse, pList, regAgg, 0, SQLITE_ECEL_DUP) + Xsqlite3ExprCodeExprList(tls, pParse, pList, regAgg, 0, uint8(SQLITE_ECEL_DUP)) } else { nArg = 0 regAgg = 0 @@ -116168,7 +117802,7 @@ __1: // Also an error codeDistinct(tls, pParse, (*AggInfo_func)(unsafe.Pointer(pF)).FiDistinct, addrNext, 1, regAgg) } - if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0 { + if ((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0 { var pColl uintptr = uintptr(0) var pItem uintptr var j int32 @@ -116249,17 +117883,17 @@ __9: // Add a single OP_Explain instruction to the VDBE to explain a simple // count(*) query ("SELECT count(*) FROM pTab"). -func explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintptr) { /* sqlite3.c:134855:13: */ +func explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintptr) { /* sqlite3.c:136847:13: */ bp := tls.Alloc(24) defer tls.Free(24) if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 { - var bCover int32 = (libc.Bool32((pIdx != uintptr(0)) && ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)))) - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+20822, /* "SCAN TABLE %s%s%..." */ + var bCover int32 = (libc.Bool32((pIdx != uintptr(0)) && ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)))) + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+21229, /* "SCAN TABLE %s%s%..." */ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, func() uintptr { if bCover != 0 { - return ts + 20840 /* " USING COVERING ..." */ + return ts + 21247 /* " USING COVERING ..." */ } return ts + 800 /* "" */ }(), @@ -116281,12 +117915,13 @@ func explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintpt // 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 *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:134884:12: */ +func havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:136876:12: */ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_AND { var pS uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) - if Xsqlite3ExprIsConstantOrGroupBy(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*Select)(unsafe.Pointer(pS)).FpGroupBy) != 0 { + if (Xsqlite3ExprIsConstantOrGroupBy(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*Select)(unsafe.Pointer(pS)).FpGroupBy) != 0) && + ((libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin | EP_IsFalse))) == U32(EP_IsFalse))) == 0) { var db uintptr = (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - var pNew uintptr = Xsqlite3Expr(tls, db, TK_INTEGER, ts+9901 /* "1" */) + var pNew uintptr = Xsqlite3Expr(tls, db, TK_INTEGER, ts+9994 /* "1" */) if pNew != 0 { var pWhere uintptr = (*Select)(unsafe.Pointer(pS)).FpWhere { @@ -116318,7 +117953,7 @@ func havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { // 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 *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:134918:13: */ +func havingToWhere(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:136912:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -116336,34 +117971,37 @@ func havingToWhere(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:1349 // 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 *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /* sqlite3.c:134938:28: */ +func isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /* sqlite3.c:136932:16: */ var pItem uintptr + + if ((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pThis)).FpSelect)).FselFlags & U32(SF_PushDown)) != 0 { + return uintptr(0) + } for pItem = pTabList + 8; /* &.a */ pItem < pThis; pItem += 112 { var pS1 uintptr - if (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect == uintptr(0) { + if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect == uintptr(0) { continue } if (uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 60 /* &.fg */ + 4 /* &.viaCoroutine */)) & 0x10 >> 4))) != 0 { continue } - if (*SrcList_item)(unsafe.Pointer(pItem)).FzName == uintptr(0) { + if (*SrcItem)(unsafe.Pointer(pItem)).FzName == uintptr(0) { continue } - if (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpTab)).FpSchema != (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pThis)).FpTab)).FpSchema { + if (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FpSchema != (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pThis)).FpTab)).FpSchema { continue } - if Xsqlite3_stricmp(tls, (*SrcList_item)(unsafe.Pointer(pItem)).FzName, (*SrcList_item)(unsafe.Pointer(pThis)).FzName) != 0 { + if Xsqlite3_stricmp(tls, (*SrcItem)(unsafe.Pointer(pItem)).FzName, (*SrcItem)(unsafe.Pointer(pThis)).FzName) != 0 { continue } - pS1 = (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect - if ((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpTab)).FpSchema == uintptr(0)) && ((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pThis)).FpSelect)).FselId != (*Select)(unsafe.Pointer(pS1)).FselId) { + pS1 = (*SrcItem)(unsafe.Pointer(pItem)).FpSelect + if ((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FpSchema == uintptr(0)) && ((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pThis)).FpSelect)).FselId != (*Select)(unsafe.Pointer(pS1)).FselId) { // The query flattener left two different CTE tables with identical // names in the same FROM clause. continue } - if (Xsqlite3ExprCompare(tls, uintptr(0), (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pThis)).FpSelect)).FpWhere, (*Select)(unsafe.Pointer(pS1)).FpWhere, -1) != 0) || - (Xsqlite3ExprCompare(tls, uintptr(0), (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pThis)).FpSelect)).FpHaving, (*Select)(unsafe.Pointer(pS1)).FpHaving, -1) != 0) { + if ((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags & U32(SF_PushDown)) != 0 { // The view was modified by some other optimization such as // pushDownWhereTerms() continue @@ -116373,6 +118011,13 @@ func isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /* return uintptr(0) } +// Deallocate a single AggInfo object +func agginfoFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:136967:13: */ + Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaCol) + Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaFunc) + Xsqlite3DbFreeNN(tls, db, p) +} + // Generate code for the SELECT statement given in the p argument. // // The results are returned according to the SelectDest structure. @@ -116384,7 +118029,7 @@ func isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /* // // This routine does NOT free the Select structure passed in. The // calling function needs to do that. -func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:135070:20: */ +func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:137073:20: */ bp := tls.Alloc(248) defer tls.Free(248) @@ -116417,15 +118062,18 @@ func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int // Implement a co-routine that will return a single row of the result // set on each invocation. var addrTop int32 - // Generate a subroutine that will fill an ephemeral table with - // the content of this subquery. pItem->addrFillSub will point - // to the address of the generated subroutine. pItem->regReturn - // is a register allocated to hold the subroutine return address + // This is a CTE for which materialization code has already been + // generated. Invoke the subroutine to compute the materialization, + // the make the pItem->iCursor be a copy of the ephemerial table that + // holds the result of the materialization. + var pCteUse uintptr + var pCteUse1 uintptr + // Generate a subroutine that will materialize the view. var topAddr int32 var onceAddr int32 var retAddr int32 - var pPrior uintptr var pItem1 uintptr + var pPrior uintptr // var dest SelectDest at bp+128, 40 var pSub1 uintptr @@ -116480,8 +118128,7 @@ func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int var pKeyInfo2 uintptr // Keyinfo for scanned index var pBest uintptr // Best index found so far var iRoot Pgno - var regAcc int32 // "populate accumulators" flag - var addrSkip int32 + var regAcc int32 var pTab1 uintptr // This case when there exist aggregate functions or a GROUP BY clause // or both @@ -116522,90 +118169,99 @@ __2: goto __3 } - // If ORDER BY makes no difference in the output then neither does - // DISTINCT so it can be removed too. - Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpOrderBy) + // All of these destinations are also able to ignore the ORDER BY clause + if !((*Select)(unsafe.Pointer(p)).FpOrderBy != 0) { + goto __4 + } + Xsqlite3ParserAddCleanup(tls, pParse, + *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{Xsqlite3ExprListDelete})), + (*Select)(unsafe.Pointer(p)).FpOrderBy) + (*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) +__4: + ; *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Distinct))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_NoopOrderBy) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_NoopOrderBy)) __3: ; Xsqlite3SelectPrep(tls, pParse, p, uintptr(0)) if !(((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) { - goto __4 + goto __5 } goto select_end -__4: +__5: ; // If the SF_UpdateFrom flag is set, then this function is being called // as part of populating the temp table for an UPDATE...FROM statement. // In this case, it is an error if the target object (pSrc->a[0]) name // or alias is duplicated within FROM clause (pSrc->a[1..n]). - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_UpdateFrom) != 0) { - goto __5 + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_UpdateFrom)) != 0) { + goto __6 } p0 = ((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) i = 1 -__6: +__7: if !(i < (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc) { - goto __8 - } - p1 = (((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(i)*112) - if !(((*SrcList_item)(unsafe.Pointer(p0)).FpTab == (*SrcList_item)(unsafe.Pointer(p1)).FpTab) && (0 == Xsqlite3_stricmp(tls, (*SrcList_item)(unsafe.Pointer(p0)).FzAlias, (*SrcList_item)(unsafe.Pointer(p1)).FzAlias))) { goto __9 } + p1 = (((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(i)*112) + if !(((*SrcItem)(unsafe.Pointer(p0)).FpTab == (*SrcItem)(unsafe.Pointer(p1)).FpTab) && (0 == Xsqlite3_stricmp(tls, (*SrcItem)(unsafe.Pointer(p0)).FzAlias, (*SrcItem)(unsafe.Pointer(p1)).FzAlias))) { + goto __10 + } Xsqlite3ErrorMsg(tls, pParse, - ts+20863, /* "target object/al..." */ + ts+21270, /* "target object/al..." */ libc.VaList(bp, func() uintptr { - if (*SrcList_item)(unsafe.Pointer(p0)).FzAlias != 0 { - return (*SrcList_item)(unsafe.Pointer(p0)).FzAlias + if (*SrcItem)(unsafe.Pointer(p0)).FzAlias != 0 { + return (*SrcItem)(unsafe.Pointer(p0)).FzAlias } - return (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(p0)).FpTab)).FzName + return (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(p0)).FpTab)).FzName }())) goto select_end -__9: +__10: ; - goto __7 -__7: - i++ - goto __6 goto __8 __8: + i++ + goto __7 + goto __9 +__9: ; -__5: +__6: ; if !(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) == SRT_Output) { - goto __10 + goto __11 } generateColumnNames(tls, pParse, p) -__10: +__11: ; rc = Xsqlite3WindowRewrite(tls, pParse, p) if !(rc != 0) { - goto __11 + goto __12 } goto select_end -__11: +__12: ; pTabList = (*Select)(unsafe.Pointer(p)).FpSrc - isAgg = (libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Aggregate) != U32(0))) + isAgg = (libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Aggregate)) != U32(0))) libc.Xmemset(tls, bp+80 /* &sSort */, 0, uint64(unsafe.Sizeof(SortCtx{}))) (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy // Try to do various optimizations (flattening subqueries, and strength // reduction of join operators) in the FROM clause up into the main query i = 0 -__12: +__13: if !(!(int32((*Select)(unsafe.Pointer(p)).FpPrior) != 0) && (i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc)) { - goto __14 + goto __15 } pItem = ((pTabList + 8 /* &.a */) + uintptr(i)*112) - pSub = (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect - pTab = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab + pSub = (*SrcItem)(unsafe.Pointer(pItem)).FpSelect + pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab // The expander should have already created transient Table objects // even for FROM clause elements such as subqueries that do not correspond @@ -116613,34 +118269,34 @@ __12: // Convert LEFT JOIN into JOIN if there are terms of the right table // of the LEFT JOIN used in the WHERE clause. - if !((((int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) != 0) && - (Xsqlite3ExprImpliesNonNullRow(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor) != 0)) && - ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_SimplifyJoin)) == 0)) { - goto __15 + if !((((int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) != 0) && + (Xsqlite3ExprImpliesNonNullRow(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor) != 0)) && + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_SimplifyJoin))) == U32(0))) { + goto __16 } *(*U8)(unsafe.Pointer(pItem + 60 /* &.fg */ /* &.jointype */)) &= libc.Uint8FromInt32((libc.CplInt32((JT_LEFT | JT_OUTER)))) - unsetJoinExpr(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor) -__15: + unsetJoinExpr(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor) +__16: ; // No futher action if this term of the FROM clause is no a subquery if !(pSub == uintptr(0)) { - goto __16 + goto __17 } - goto __13 -__16: + goto __14 +__17: ; // Catch mismatch in the declared columns of a view and the number of // columns in the SELECT on the RHS if !(int32((*Table)(unsafe.Pointer(pTab)).FnCol) != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpEList)).FnExpr) { - goto __17 + goto __18 } - Xsqlite3ErrorMsg(tls, pParse, ts+20917, /* "expected %d colu..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+21324, /* "expected %d colu..." */ libc.VaList(bp+8, int32((*Table)(unsafe.Pointer(pTab)).FnCol), (*Table)(unsafe.Pointer(pTab)).FzName, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end -__17: +__18: ; // Do not try to flatten an aggregate subquery. @@ -116649,11 +118305,11 @@ __17: // is not a join. But if the outer query is not a join, then the subquery // will be implemented as a co-routine and there is no advantage to // flattening in that case. - if !(((*Select)(unsafe.Pointer(pSub)).FselFlags & SF_Aggregate) != U32(0)) { - goto __18 + if !(((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(SF_Aggregate)) != U32(0)) { + goto __19 } - goto __13 -__18: + goto __14 +__19: ; // If the outer query contains a "complex" result set (that is, @@ -116675,63 +118331,63 @@ __18: // SELECT x FROM (SELECT x FROM tab ORDER BY y LIMIT 10); if !(((((*Select)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0)) && (i == 0)) && - (((*Select)(unsafe.Pointer(p)).FselFlags & SF_ComplexResult) != U32(0))) && + (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_ComplexResult)) != U32(0))) && (((*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1) || - ((int32((*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+1*112)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0))) { - goto __19 + ((int32((*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+1*112)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0))) { + goto __20 } - goto __13 -__19: + goto __14 +__20: ; if !(flattenSubquery(tls, pParse, p, i, isAgg) != 0) { - goto __20 - } - if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) { goto __21 } - goto select_end -__21: - ; - // This subquery can be absorbed into its parent. - i = -1 -__20: - ; - pTabList = (*Select)(unsafe.Pointer(p)).FpSrc - if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) { goto __22 } goto select_end __22: ; - if !(!((int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest)) <= SRT_DistQueue)) { + // This subquery can be absorbed into its parent. + i = -1 +__21: + ; + pTabList = (*Select)(unsafe.Pointer(p)).FpSrc + if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { goto __23 } - (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy + goto select_end __23: ; - goto __13 -__13: - i++ - goto __12 + if !(!((int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest)) <= SRT_Fifo)) { + goto __24 + } + (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy +__24: + ; goto __14 __14: + i++ + goto __13 + goto __15 +__15: ; // Handle compound SELECT statements using the separate multiSelect() // procedure. if !((*Select)(unsafe.Pointer(p)).FpPrior != 0) { - goto __24 + goto __25 } rc = multiSelect(tls, pParse, p, pDest) if !((*Select)(unsafe.Pointer(p)).FpNext == uintptr(0)) { - goto __25 + goto __26 } Xsqlite3VdbeExplainPop(tls, pParse) -__25: +__26: ; return rc -__24: +__25: ; // Do the WHERE-clause constant propagation optimization if this is @@ -116739,23 +118395,23 @@ __24: // as the equivalent optimization will be handled by query planner in // sqlite3WhereBegin(). if !((((*SrcList)(unsafe.Pointer(pTabList)).FnSrc > 1) && - ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_PropagateConst)) == 0)) && + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_PropagateConst))) == U32(0))) && (propagateConstants(tls, pParse, p) != 0)) { - goto __26 + goto __27 } - goto __27 -__26: - ; + goto __28 __27: ; +__28: + ; // For each term in the FROM clause, do two things: // (1) Authorized unreferenced tables // (2) Generate code for all sub-queries i = 0 -__28: +__29: if !(i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) { - goto __30 + goto __31 } pItem1 = ((pTabList + 8 /* &.a */) + uintptr(i)*112) @@ -116774,20 +118430,20 @@ __28: // which would be unambiguous. But legacy authorization callbacks might // assume the column name is non-NULL and segfault. The use of an empty // string for the fake column name seems safer. - if !(((*SrcList_item)(unsafe.Pointer(pItem1)).FcolUsed == uint64(0)) && ((*SrcList_item)(unsafe.Pointer(pItem1)).FzName != uintptr(0))) { - goto __31 + if !(((*SrcItem)(unsafe.Pointer(pItem1)).FcolUsed == uint64(0)) && ((*SrcItem)(unsafe.Pointer(pItem1)).FzName != uintptr(0))) { + goto __32 } - Xsqlite3AuthCheck(tls, pParse, SQLITE_READ, (*SrcList_item)(unsafe.Pointer(pItem1)).FzName, ts+800 /* "" */, (*SrcList_item)(unsafe.Pointer(pItem1)).FzDatabase) -__31: + Xsqlite3AuthCheck(tls, pParse, SQLITE_READ, (*SrcItem)(unsafe.Pointer(pItem1)).FzName, ts+800 /* "" */, (*SrcItem)(unsafe.Pointer(pItem1)).FzDatabase) +__32: ; // Generate code for all sub-queries in the FROM clause - pSub1 = (*SrcList_item)(unsafe.Pointer(pItem1)).FpSelect + pSub1 = (*SrcItem)(unsafe.Pointer(pItem1)).FpSelect if !(pSub1 == uintptr(0)) { - goto __32 + goto __33 } - goto __29 -__32: + goto __30 +__33: ; // The code for a subquery should only be generated once, though it is @@ -116808,116 +118464,156 @@ __32: // (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit // more conservative than necessary, but much easier than enforcing // an exact limit. - *(*int32)(unsafe.Pointer(pParse + 292 /* &.nHeight */)) += (Xsqlite3SelectExprHeight(tls, p)) + *(*int32)(unsafe.Pointer(pParse + 284 /* &.nHeight */)) += (Xsqlite3SelectExprHeight(tls, p)) // Make copies of constant WHERE-clause terms in the outer query down // inside the subquery. This can help the subquery to run more efficiently. - if !(((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_PushDown)) == 0) && - (pushDownWhereTerms(tls, pParse, pSub1, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcList_item)(unsafe.Pointer(pItem1)).FiCursor, - (libc.Bool32((int32((*SrcList_item)(unsafe.Pointer(pItem1)).Ffg.Fjointype)&JT_OUTER) != 0))) != 0)) { - goto __33 + if !(((((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_PushDown))) == U32(0)) && + (((int32(*(*uint8)(unsafe.Pointer((pItem1 + 60 /* &.fg */) + 4 /* &.isCte */)) & 0x80 >> 7)) == 0) || (int32((*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 104 /* &.u2 */)))).FeM10d) != M10d_Yes))) && + (pushDownWhereTerms(tls, pParse, pSub1, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor, + (libc.Bool32((int32((*SrcItem)(unsafe.Pointer(pItem1)).Ffg.Fjointype)&JT_OUTER) != 0))) != 0)) { + goto __34 } - goto __34 -__33: - ; + + goto __35 __34: ; +__35: + ; zSavedAuthContext = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext - (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcList_item)(unsafe.Pointer(pItem1)).FzName + (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = (*SrcItem)(unsafe.Pointer(pItem1)).FzName // Generate code to implement the subquery // - // The subquery is implemented as a co-routine if the subquery is - // guaranteed to be the outer loop (so that it does not need to be - // computed more than once) + // The subquery is implemented as a co-routine if: + // (1) the subquery is guaranteed to be the outer loop (so that + // it does not need to be computed more than once), and + // (2) the subquery is not a CTE that should be materialized // - // TODO: Are there other reasons beside (1) to use a co-routine + // TODO: Are there other reasons beside (1) and (2) to use a co-routine // implementation? - if !((i == 0) && + if !(((i == 0) && (((*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1) || - ((int32((*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+1*112)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0))) { - goto __35 + ((int32((*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+1*112)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0))) && // (1) + (((int32(*(*uint8)(unsafe.Pointer((pItem1 + 60 /* &.fg */) + 4 /* &.isCte */)) & 0x80 >> 7)) == 0) || (int32((*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 104 /* &.u2 */)))).FeM10d) != M10d_Yes))) { + goto __36 } // Implement a co-routine that will return a single row of the result // set on each invocation. addrTop = (Xsqlite3VdbeCurrentAddr(tls, v) + 1) - (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) - Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn, 0, addrTop) - Xsqlite3VdbeComment(tls, v, ts+824 /* "%s" */, libc.VaList(bp+32, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FzName)) - (*SrcList_item)(unsafe.Pointer(pItem1)).FaddrFillSub = addrTop - Xsqlite3SelectDestInit(tls, bp+128 /* &dest */, SRT_Coroutine, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20957 /* "CO-ROUTINE %u" */, libc.VaList(bp+40, (*Select)(unsafe.Pointer(pSub1)).FselId)) + (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) + Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn, 0, addrTop) + Xsqlite3VdbeComment(tls, v, ts+824 /* "%s" */, libc.VaList(bp+32, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem1)).FpTab)).FzName)) + (*SrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub = addrTop + Xsqlite3SelectDestInit(tls, bp+128 /* &dest */, SRT_Coroutine, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+21364 /* "CO-ROUTINE %u" */, libc.VaList(bp+40, (*Select)(unsafe.Pointer(pSub1)).FselId)) Xsqlite3Select(tls, pParse, pSub1, bp+128 /* &dest */) - (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow + (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr8Uint32(pItem1+60 /* &.fg */ +4 /* &.viaCoroutine */, uint32(1), 4, 0x10) - (*SrcList_item)(unsafe.Pointer(pItem1)).FregResult = (*SelectDest)(unsafe.Pointer(bp + 128 /* &dest */)).FiSdst - Xsqlite3VdbeEndCoroutine(tls, v, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn) + (*SrcItem)(unsafe.Pointer(pItem1)).FregResult = (*SelectDest)(unsafe.Pointer(bp + 128 /* &dest */)).FiSdst + Xsqlite3VdbeEndCoroutine(tls, v, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn) Xsqlite3VdbeJumpHere(tls, v, (addrTop - 1)) Xsqlite3ClearTempRegCache(tls, pParse) - goto __36 -__35: + goto __37 +__36: + if !(((uint32(int32(*(*uint8)(unsafe.Pointer((pItem1 + 60 /* &.fg */) + 4 /* &.isCte */)) & 0x80 >> 7))) != 0) && ((*CteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 104 /* &.u2 */)))).FaddrM9e > 0)) { + goto __38 + } + // This is a CTE for which materialization code has already been + // generated. Invoke the subroutine to compute the materialization, + // the make the pItem->iCursor be a copy of the ephemerial table that + // holds the result of the materialization. + pCteUse = *(*uintptr)(unsafe.Pointer(pItem1 + 104 /* &.u2 */)) + Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*CteUse)(unsafe.Pointer(pCteUse)).FregRtn, (*CteUse)(unsafe.Pointer(pCteUse)).FaddrM9e) + if !((*SrcItem)(unsafe.Pointer(pItem1)).FiCursor != (*CteUse)(unsafe.Pointer(pCteUse)).FiCur) { + goto __40 + } + Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor, (*CteUse)(unsafe.Pointer(pCteUse)).FiCur) +__40: + ; + (*Select)(unsafe.Pointer(pSub1)).FnSelectRow = (*CteUse)(unsafe.Pointer(pCteUse)).FnRowEst + goto __39 +__38: + if !((libc.AssignUintptr(&pPrior, isSelfJoinView(tls, pTabList, pItem1))) != uintptr(0)) { + goto __41 + } + // This view has already been materialized by a prior entry in + // this same FROM clause. Reuse it. + if !((*SrcItem)(unsafe.Pointer(pPrior)).FaddrFillSub != 0) { + goto __43 + } + Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, (*SrcItem)(unsafe.Pointer(pPrior)).FregReturn, (*SrcItem)(unsafe.Pointer(pPrior)).FaddrFillSub) +__43: + ; + Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor, (*SrcItem)(unsafe.Pointer(pPrior)).FiCursor) + (*Select)(unsafe.Pointer(pSub1)).FnSelectRow = (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pPrior)).FpSelect)).FnSelectRow + goto __42 +__41: onceAddr = 0 // Ticket c52b09c7f38903b1311 - (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) - topAddr = Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn) - (*SrcList_item)(unsafe.Pointer(pItem1)).FaddrFillSub = (topAddr + 1) + (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) + topAddr = Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn) + (*SrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub = (topAddr + 1) if !((int32(*(*uint8)(unsafe.Pointer((pItem1 + 60 /* &.fg */) + 4 /* &.isCorrelated */)) & 0x8 >> 3)) == 0) { - goto __37 + goto __44 } // If the subquery is not correlated and if we are not inside of // a trigger, then we only need to compute the value of the subquery // once. onceAddr = Xsqlite3VdbeAddOp0(tls, v, OP_Once) - Xsqlite3VdbeComment(tls, v, ts+20971 /* "materialize \"%s\"" */, libc.VaList(bp+48, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FzName)) - goto __38 -__37: - Xsqlite3VdbeNoopComment(tls, v, ts+20971 /* "materialize \"%s\"" */, libc.VaList(bp+56, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FzName)) -__38: + Xsqlite3VdbeComment(tls, v, ts+21378 /* "materialize \"%s\"" */, libc.VaList(bp+48, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem1)).FpTab)).FzName)) + goto __45 +__44: + Xsqlite3VdbeNoopComment(tls, v, ts+21378 /* "materialize \"%s\"" */, libc.VaList(bp+56, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem1)).FpTab)).FzName)) +__45: ; - pPrior = isSelfJoinView(tls, pTabList, pItem1) - if !(pPrior != 0) { - goto __39 - } - Xsqlite3VdbeAddOp2(tls, v, OP_OpenDup, (*SrcList_item)(unsafe.Pointer(pItem1)).FiCursor, (*SrcList_item)(unsafe.Pointer(pPrior)).FiCursor) - - (*Select)(unsafe.Pointer(pSub1)).FnSelectRow = (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pPrior)).FpSelect)).FnSelectRow - goto __40 -__39: - Xsqlite3SelectDestInit(tls, bp+128 /* &dest */, SRT_EphemTab, (*SrcList_item)(unsafe.Pointer(pItem1)).FiCursor) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20988 /* "MATERIALIZE %u" */, libc.VaList(bp+64, (*Select)(unsafe.Pointer(pSub1)).FselId)) + Xsqlite3SelectDestInit(tls, bp+128 /* &dest */, SRT_EphemTab, (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+21395 /* "MATERIALIZE %u" */, libc.VaList(bp+64, (*Select)(unsafe.Pointer(pSub1)).FselId)) Xsqlite3Select(tls, pParse, pSub1, bp+128 /* &dest */) -__40: - ; - (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow + (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow if !(onceAddr != 0) { - goto __41 + goto __46 } Xsqlite3VdbeJumpHere(tls, v, onceAddr) -__41: +__46: ; - retAddr = Xsqlite3VdbeAddOp1(tls, v, OP_Return, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn) - Xsqlite3VdbeComment(tls, v, ts+21003 /* "end %s" */, libc.VaList(bp+72, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FzName)) + retAddr = Xsqlite3VdbeAddOp1(tls, v, OP_Return, (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn) + Xsqlite3VdbeComment(tls, v, ts+21410 /* "end %s" */, libc.VaList(bp+72, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem1)).FpTab)).FzName)) Xsqlite3VdbeChangeP1(tls, v, topAddr, retAddr) Xsqlite3ClearTempRegCache(tls, pParse) -__36: - ; - if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - goto __42 + if !((uint32(int32(*(*uint8)(unsafe.Pointer(pItem1 + 60 /* &.fg */ + 4 /* &.isCte */)) & 0x80 >> 7))) != 0) { + goto __47 } - goto select_end + pCteUse1 = *(*uintptr)(unsafe.Pointer(pItem1 + 104 /* &.u2 */)) + (*CteUse)(unsafe.Pointer(pCteUse1)).FaddrM9e = (*SrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub + (*CteUse)(unsafe.Pointer(pCteUse1)).FregRtn = (*SrcItem)(unsafe.Pointer(pItem1)).FregReturn + (*CteUse)(unsafe.Pointer(pCteUse1)).FiCur = (*SrcItem)(unsafe.Pointer(pItem1)).FiCursor + (*CteUse)(unsafe.Pointer(pCteUse1)).FnRowEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow +__47: + ; __42: ; - *(*int32)(unsafe.Pointer(pParse + 292 /* &.nHeight */)) -= (Xsqlite3SelectExprHeight(tls, p)) +__39: + ; +__37: + ; + if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + goto __48 + } + goto select_end +__48: + ; + *(*int32)(unsafe.Pointer(pParse + 284 /* &.nHeight */)) -= (Xsqlite3SelectExprHeight(tls, p)) (*Parse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedAuthContext - goto __29 -__29: - i++ - goto __28 goto __30 __30: + i++ + goto __29 + goto __31 +__31: ; // Various elements of the SELECT copied into local variables for @@ -116926,7 +118622,7 @@ __30: pWhere = (*Select)(unsafe.Pointer(p)).FpWhere pGroupBy = (*Select)(unsafe.Pointer(p)).FpGroupBy pHaving = (*Select)(unsafe.Pointer(p)).FpHaving - (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FisTnct = (U8(libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != U32(0)))) + (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FisTnct = (U8(libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != U32(0)))) // If the query is DISTINCT with an ORDER BY but is not an aggregate, and // if the select-list is the same as the ORDER BY list, then this query @@ -116942,19 +118638,19 @@ __30: // used for both the ORDER BY and DISTINCT processing. As originally // written the query must use a temp-table for at least one of the ORDER // BY and DISTINCT, and an index or separate temp-table for the other. - if !(((((*Select)(unsafe.Pointer(p)).FselFlags & (U32(SF_Distinct | SF_Aggregate))) == SF_Distinct) && + if !(((((*Select)(unsafe.Pointer(p)).FselFlags & (U32(SF_Distinct | SF_Aggregate))) == U32(SF_Distinct)) && (Xsqlite3ExprListCompare(tls, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy, pEList, -1) == 0)) && ((*Select)(unsafe.Pointer(p)).FpWin == uintptr(0))) { - goto __43 + goto __49 } *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Distinct))) pGroupBy = libc.AssignPtrUintptr(p+56 /* &.pGroupBy */, Xsqlite3ExprListDup(tls, db, pEList, 0)) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_Aggregate) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_Aggregate)) // Notice that even thought SF_Distinct has been cleared from p->selFlags, // the sDistinct.isTnct is still set. Hence, isTnct represents the // original setting of the SF_Distinct flag, not the current setting -__43: +__49: ; // If there is an ORDER BY clause, then create an ephemeral index to @@ -116965,7 +118661,7 @@ __43: // not needed. The sSort.addrSortIndex variable is used to facilitate // that change. if !((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy != 0) { - goto __44 + goto __50 } pKeyInfo = Xsqlite3KeyInfoFromExprList(tls, pParse, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy, 0, (*ExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -116973,71 +118669,71 @@ __43: (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FaddrSortIndex = Xsqlite3VdbeAddOp4(tls, v, OP_OpenEphemeral, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FiECursor, (((*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy)).FnExpr + 1) + (*ExprList)(unsafe.Pointer(pEList)).FnExpr), 0, pKeyInfo, -9) - goto __45 -__44: + goto __51 +__50: (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FaddrSortIndex = -1 -__45: +__51: ; // If the output is destined for a temporary table, open that table. if !(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) == SRT_EphemTab) { - goto __46 + goto __52 } Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, (*ExprList)(unsafe.Pointer(pEList)).FnExpr) -__46: +__52: ; // Set the limiter. iEnd = Xsqlite3VdbeMakeLabel(tls, pParse) - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_FixedLimit) == U32(0)) { - goto __47 + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_FixedLimit)) == U32(0)) { + goto __53 } (*Select)(unsafe.Pointer(p)).FnSelectRow = int16(320) // 4 billion rows -__47: +__53: ; computeLimitRegisters(tls, pParse, p, iEnd) if !(((*Select)(unsafe.Pointer(p)).FiLimit == 0) && ((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex >= 0)) { - goto __48 + goto __54 } - Xsqlite3VdbeChangeOpcode(tls, v, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex, OP_SorterOpen) + Xsqlite3VdbeChangeOpcode(tls, v, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex, uint8(OP_SorterOpen)) *(*U8)(unsafe.Pointer(bp + 80 /* &sSort */ + 36 /* &.sortFlags */)) |= U8((SORTFLAG_UseSorter)) -__48: +__54: ; // Open an ephemeral index to use for the distinct set. - if !(((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) != 0) { - goto __49 + if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) != 0) { + goto __55 } (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FtabTnct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FaddrTnct = Xsqlite3VdbeAddOp4(tls, v, OP_OpenEphemeral, (*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FtabTnct, 0, 0, Xsqlite3KeyInfoFromExprList(tls, pParse, (*Select)(unsafe.Pointer(p)).FpEList, 0, 0), -9) - Xsqlite3VdbeChangeP5(tls, v, BTREE_UNORDERED) - (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FeTnctType = WHERE_DISTINCT_UNORDERED - goto __50 -__49: - (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FeTnctType = WHERE_DISTINCT_NOOP -__50: + Xsqlite3VdbeChangeP5(tls, v, uint16(BTREE_UNORDERED)) + (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FeTnctType = U8(WHERE_DISTINCT_UNORDERED) + goto __56 +__55: + (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FeTnctType = U8(WHERE_DISTINCT_NOOP) +__56: ; if !(!(isAgg != 0) && (pGroupBy == uintptr(0))) { - goto __51 + goto __57 } // No aggregate functions and no GROUP BY clause wctrlFlags = (U16((func() uint32 { if (*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FisTnct != 0 { - return WHERE_WANT_DISTINCT + return uint32(WHERE_WANT_DISTINCT) } return uint32(0) }()) | - ((*Select)(unsafe.Pointer(p)).FselFlags & SF_FixedLimit))) + ((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_FixedLimit)))) pWin = (*Select)(unsafe.Pointer(p)).FpWin // Main window object (or NULL) if !(pWin != 0) { - goto __53 + goto __59 } Xsqlite3WindowCodeInit(tls, pParse, p) -__53: +__59: ; // Begin the database scan. @@ -117045,49 +118741,49 @@ __53: pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy, (*Select)(unsafe.Pointer(p)).FpEList, wctrlFlags, int32((*Select)(unsafe.Pointer(p)).FnSelectRow)) if !(pWInfo == uintptr(0)) { - goto __54 + goto __60 } goto select_end -__54: +__60: ; if !(int32(Xsqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*Select)(unsafe.Pointer(p)).FnSelectRow)) { - goto __55 + goto __61 } (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3WhereOutputRowCount(tls, pWInfo) -__55: +__61: ; if !(((*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FisTnct != 0) && (Xsqlite3WhereIsDistinct(tls, pWInfo) != 0)) { - goto __56 + goto __62 } (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FeTnctType = U8(Xsqlite3WhereIsDistinct(tls, pWInfo)) -__56: +__62: ; if !((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy != 0) { - goto __57 + goto __63 } (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FnOBSat = Xsqlite3WhereIsOrdered(tls, pWInfo) (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FlabelOBLopt = Xsqlite3WhereOrderByLimitOptLabel(tls, pWInfo) if !((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FnOBSat == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy)).FnExpr) { - goto __58 + goto __64 } (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FpOrderBy = uintptr(0) -__58: +__64: ; -__57: +__63: ; // If sorting index that was created by a prior OP_OpenEphemeral // instruction ended up not being needed, then change the OP_OpenEphemeral // into an OP_Noop. if !(((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex >= 0) && ((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy == uintptr(0))) { - goto __59 + goto __65 } Xsqlite3VdbeChangeToNoop(tls, v, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex) -__59: +__65: ; if !(pWin != 0) { - goto __60 + goto __66 } addrGosub = Xsqlite3VdbeMakeLabel(tls, pParse) iCont = Xsqlite3VdbeMakeLabel(tls, pParse) @@ -117098,15 +118794,15 @@ __59: Xsqlite3VdbeAddOp2(tls, v, OP_Goto, 0, iBreak) Xsqlite3VdbeResolveLabel(tls, v, addrGosub) - Xsqlite3VdbeNoopComment(tls, v, ts+21010 /* "inner-loop subro..." */, 0) + Xsqlite3VdbeNoopComment(tls, v, ts+21417 /* "inner-loop subro..." */, 0) (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FlabelOBLopt = 0 selectInnerLoop(tls, pParse, p, -1, bp+80 /* &sSort */, bp+168 /* &sDistinct */, pDest, iCont, iBreak) Xsqlite3VdbeResolveLabel(tls, v, iCont) Xsqlite3VdbeAddOp1(tls, v, OP_Return, regGosub) - Xsqlite3VdbeComment(tls, v, ts+21032 /* "end inner-loop s..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+21439 /* "end inner-loop s..." */, 0) Xsqlite3VdbeResolveLabel(tls, v, iBreak) - goto __61 -__60: + goto __67 +__66: // Use the standard inner loop. selectInnerLoop(tls, pParse, p, -1, bp+80 /* &sSort */, bp+168 /* &sDistinct */, pDest, @@ -117114,11 +118810,12 @@ __60: Xsqlite3WhereBreakLabel(tls, pWInfo)) // End the database scan loop. + Xsqlite3WhereEnd(tls, pWInfo) -__61: +__67: ; - goto __52 -__51: // End of processing for this SELECT + goto __58 +__57: // End of processing for this SELECT sortPTab = 0 // Pseudotable used to decode sorting results sortOut = 0 // Output register from the sorter orderByGrp = 0 // True if the GROUP BY and ORDER BY are the same @@ -117126,45 +118823,45 @@ __51: // End of processing for this SELECT // Remove any and all aliases between the result set and the // GROUP BY clause. if !(pGroupBy != 0) { - goto __62 + goto __68 } // For looping over expression in a list k = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr pItem2 = (*Select)(unsafe.Pointer(p)).FpEList + 8 /* &.a */ -__64: +__70: if !(k > 0) { - goto __66 + goto __72 } *(*U16)(unsafe.Pointer(pItem2 + 24 /* &.u */ /* &.x */ + 2 /* &.iAlias */)) = U16(0) - goto __65 -__65: + goto __71 +__71: k-- pItem2 += 32 - goto __64 - goto __66 -__66: + goto __70 + goto __72 +__72: ; k = (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr pItem2 = pGroupBy + 8 /* &.a */ -__67: +__73: if !(k > 0) { - goto __69 + goto __75 } *(*U16)(unsafe.Pointer(pItem2 + 24 /* &.u */ /* &.x */ + 2 /* &.iAlias */)) = U16(0) - goto __68 -__68: + goto __74 +__74: k-- pItem2 += 32 - goto __67 - goto __69 -__69: + goto __73 + goto __75 +__75: ; if !(int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > 66) { - goto __70 + goto __76 } (*Select)(unsafe.Pointer(p)).FnSelectRow = int16(66) -__70: +__76: ; // If there is both a GROUP BY and an ORDER BY clause and they are @@ -117176,7 +118873,7 @@ __70: // ORDER BY and GROUP BY clauses are the same by setting the orderByGrp // variable. if !(((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy != 0) && ((*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy)).FnExpr)) { - goto __71 + goto __77 } // The GROUP BY processing doesn't care whether rows are delivered in // ASC or DESC order - only that each group is returned contiguously. @@ -117184,32 +118881,32 @@ __70: // ORDER BY to maximize the chances of rows being delivered in an // order that makes the ORDER BY redundant. ii = 0 -__72: +__78: if !(ii < (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) { - goto __74 + goto __80 } sortFlags = (U8(int32((*ExprList_item)(unsafe.Pointer(((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy+8 /* &.a */)+uintptr(ii)*32)).FsortFlags) & KEYINFO_ORDER_DESC)) (*ExprList_item)(unsafe.Pointer((pGroupBy + 8 /* &.a */) + uintptr(ii)*32)).FsortFlags = sortFlags - goto __73 -__73: + goto __79 +__79: ii++ - goto __72 - goto __74 -__74: + goto __78 + goto __80 +__80: ; if !(Xsqlite3ExprListCompare(tls, pGroupBy, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy, -1) == 0) { - goto __75 + goto __81 } orderByGrp = 1 -__75: +__81: ; -__71: +__77: ; - goto __63 -__62: + goto __69 +__68: ; (*Select)(unsafe.Pointer(p)).FnSelectRow = int16(0) -__63: +__69: ; // Create a label to jump to when we want to abort the query @@ -117219,14 +118916,22 @@ __63: // sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the // SELECT statement. pAggInfo = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(AggInfo{}))) - if !(pAggInfo == uintptr(0)) { - goto __76 + if !(pAggInfo != 0) { + goto __82 + } + Xsqlite3ParserAddCleanup(tls, pParse, + *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) + }{agginfoFree})), pAggInfo) + +__82: + ; + if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + goto __83 } goto select_end -__76: +__83: ; - (*AggInfo)(unsafe.Pointer(pAggInfo)).FpNext = (*Parse)(unsafe.Pointer(pParse)).FpAggList - (*Parse)(unsafe.Pointer(pParse)).FpAggList = pAggInfo (*AggInfo)(unsafe.Pointer(pAggInfo)).FselId = (*Select)(unsafe.Pointer(p)).FselId libc.Xmemset(tls, bp+184 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) (*NameContext)(unsafe.Pointer(bp + 184 /* &sNC */)).FpParse = pParse @@ -117244,65 +118949,65 @@ __76: Xsqlite3ExprAnalyzeAggList(tls, bp+184 /* &sNC */, pEList) Xsqlite3ExprAnalyzeAggList(tls, bp+184 /* &sNC */, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy) if !(pHaving != 0) { - goto __77 + goto __84 } if !(pGroupBy != 0) { - goto __78 + goto __85 } havingToWhere(tls, pParse, p) pWhere = (*Select)(unsafe.Pointer(p)).FpWhere -__78: +__85: ; Xsqlite3ExprAnalyzeAggregates(tls, bp+184 /* &sNC */, pHaving) -__77: +__84: ; (*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator = (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn if !((((*Select)(unsafe.Pointer(p)).FpGroupBy == uintptr(0)) && ((*Select)(unsafe.Pointer(p)).FpHaving == uintptr(0))) && ((*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 1)) { - goto __79 + goto __86 } minMaxFlag = minMaxQuery(tls, db, (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FpFExpr, bp+240 /* &pMinMaxOrderBy */) - goto __80 -__79: - minMaxFlag = WHERE_ORDERBY_NORMAL -__80: + goto __87 +__86: + minMaxFlag = U8(WHERE_ORDERBY_NORMAL) +__87: ; i = 0 -__81: +__88: if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { - goto __83 + goto __90 } pExpr = (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpFExpr *(*int32)(unsafe.Pointer(bp + 184 /* &sNC */ + 40 /* &.ncFlags */)) |= (NC_InAggFunc) Xsqlite3ExprAnalyzeAggList(tls, bp+184 /* &sNC */, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { - goto __84 + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { + goto __91 } Xsqlite3ExprAnalyzeAggregates(tls, bp+184 /* &sNC */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter) -__84: +__91: ; *(*int32)(unsafe.Pointer(bp + 184 /* &sNC */ + 40 /* &.ncFlags */)) &= (libc.CplInt32(NC_InAggFunc)) - goto __82 -__82: + goto __89 +__89: i++ - goto __81 - goto __83 -__83: + goto __88 + goto __90 +__90: ; (*AggInfo)(unsafe.Pointer(pAggInfo)).FmxReg = (*Parse)(unsafe.Pointer(pParse)).FnMem if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - goto __85 + goto __92 } goto select_end -__85: +__92: ; // Processing for aggregates with GROUP BY is very different and // much more complex than aggregates without a GROUP BY. if !(pGroupBy != 0) { - goto __86 + goto __93 } // Return address register for reset subroutine // If there is a GROUP BY clause we might need a sorting index to @@ -117328,7 +119033,7 @@ __85: iBMem = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1) *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += ((*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, iAbortFlag) - Xsqlite3VdbeComment(tls, v, ts+21058 /* "clear abort flag" */, 0) + Xsqlite3VdbeComment(tls, v, ts+21465 /* "clear abort flag" */, 0) Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, iAMem, ((iAMem + (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) - 1)) // Begin a loop that will extract all source rows in GROUP BY order. @@ -117345,27 +119050,28 @@ __85: return 0 }()))), 0) if !(pWInfo == uintptr(0)) { - goto __88 + goto __95 } goto select_end -__88: +__95: ; + if !(Xsqlite3WhereIsOrdered(tls, pWInfo) == (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) { - goto __89 + goto __96 } // The optimizer is able to deliver rows in group by order so // we do not have to sort. The OP_OpenEphemeral table will be // cancelled later because we still need to use the pKeyInfo groupBySort = 0 - goto __90 -__89: + goto __97 +__96: explainTempTable(tls, pParse, func() uintptr { - if ((*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FisTnct != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_Distinct) == U32(0)) { - return ts + 21075 /* "DISTINCT" */ + if ((*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FisTnct != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_Distinct)) == U32(0)) { + return ts + 21482 /* "DISTINCT" */ } - return ts + 21084 /* "GROUP BY" */ + return ts + 21491 /* "GROUP BY" */ }()) groupBySort = 1 @@ -117373,62 +119079,63 @@ __89: nCol = nGroupBy j = nGroupBy i = 0 -__91: +__98: if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { - goto __93 + goto __100 } if !(int32((*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol+uintptr(i)*32)).FiSorterColumn) >= j) { - goto __94 + goto __101 } nCol++ j++ -__94: +__101: ; - goto __92 -__92: + goto __99 +__99: i++ - goto __91 - goto __93 -__93: + goto __98 + goto __100 +__100: ; regBase = Xsqlite3GetTempRange(tls, pParse, nCol) Xsqlite3ExprCodeExprList(tls, pParse, pGroupBy, regBase, 0, uint8(0)) j = nGroupBy i = 0 -__95: +__102: if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { - goto __97 + goto __104 } pCol = ((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32) if !(int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j) { - goto __98 + goto __105 } r1 = (j + regBase) Xsqlite3ExprCodeGetColumnOfTable(tls, v, (*AggInfo_col)(unsafe.Pointer(pCol)).FpTab, (*AggInfo_col)(unsafe.Pointer(pCol)).FiTable, int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn), r1) j++ -__98: +__105: ; - goto __96 -__96: + goto __103 +__103: i++ - goto __95 - goto __97 -__97: + goto __102 + goto __104 +__104: ; regRecord = Xsqlite3GetTempReg(tls, pParse) Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, regBase, nCol, regRecord) Xsqlite3VdbeAddOp2(tls, v, OP_SorterInsert, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, regRecord) Xsqlite3ReleaseTempReg(tls, pParse, regRecord) Xsqlite3ReleaseTempRange(tls, pParse, regBase, nCol) + Xsqlite3WhereEnd(tls, pWInfo) (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = libc.AssignInt32(&sortPTab, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)) sortOut = Xsqlite3GetTempReg(tls, pParse) Xsqlite3VdbeAddOp3(tls, v, OP_OpenPseudo, sortPTab, sortOut, nCol) Xsqlite3VdbeAddOp2(tls, v, OP_SorterSort, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) - Xsqlite3VdbeComment(tls, v, ts+21093 /* "GROUP BY sort" */, 0) + Xsqlite3VdbeComment(tls, v, ts+21500 /* "GROUP BY sort" */, 0) (*AggInfo)(unsafe.Pointer(pAggInfo)).FuseSortingIdx = U8(1) -__90: +__97: ; // If the index or temporary table used by the GROUP BY sort @@ -117438,13 +119145,13 @@ __90: // This is an optimization - the correct answer should result regardless. // Use the SQLITE_GroupByOrder flag with SQLITE_TESTCTRL_OPTIMIZER to // disable this optimization for testing purposes. - if !(((orderByGrp != 0) && ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_GroupByOrder)) == 0)) && + if !(((orderByGrp != 0) && (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_GroupByOrder))) == U32(0))) && ((groupBySort != 0) || (Xsqlite3WhereIsSorted(tls, pWInfo) != 0))) { - goto __99 + goto __106 } (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FpOrderBy = uintptr(0) Xsqlite3VdbeChangeToNoop(tls, v, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex) -__99: +__106: ; // Evaluate the current GROUP BY terms and store in b0, b1, b2... @@ -117453,33 +119160,33 @@ __99: // from the previous row currently stored in a0, a1, a2... addrTopOfLoop = Xsqlite3VdbeCurrentAddr(tls, v) if !(groupBySort != 0) { - goto __100 + goto __107 } Xsqlite3VdbeAddOp3(tls, v, OP_SorterData, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, sortOut, sortPTab) -__100: +__107: ; j = 0 -__101: +__108: if !(j < (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) { - goto __103 + goto __110 } if !(groupBySort != 0) { - goto __104 + goto __111 } Xsqlite3VdbeAddOp3(tls, v, OP_Column, sortPTab, j, (iBMem + j)) - goto __105 -__104: + goto __112 +__111: (*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = U8(1) Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pGroupBy+8 /* &.a */)+uintptr(j)*32)).FpExpr, (iBMem + j)) -__105: +__112: ; - goto __102 -__102: + goto __109 +__109: j++ - goto __101 - goto __103 -__103: + goto __108 + goto __110 +__110: ; Xsqlite3VdbeAddOp4(tls, v, OP_Compare, iAMem, iBMem, (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr, Xsqlite3KeyInfoRef(tls, pKeyInfo1), -9) @@ -117496,35 +119203,36 @@ __103: // for the next GROUP BY batch. Xsqlite3ExprCodeMove(tls, pParse, iBMem, iAMem, (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regOutputRow, addrOutputRow) - Xsqlite3VdbeComment(tls, v, ts+21107 /* "output one row" */, 0) + Xsqlite3VdbeComment(tls, v, ts+21514 /* "output one row" */, 0) Xsqlite3VdbeAddOp2(tls, v, OP_IfPos, iAbortFlag, addrEnd) - Xsqlite3VdbeComment(tls, v, ts+21122 /* "check abort flag" */, 0) + Xsqlite3VdbeComment(tls, v, ts+21529 /* "check abort flag" */, 0) Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regReset, addrReset) - Xsqlite3VdbeComment(tls, v, ts+21139 /* "reset accumulato..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+21546 /* "reset accumulato..." */, 0) // Update the aggregate accumulators based on the content of // the current row Xsqlite3VdbeJumpHere(tls, v, addr1) updateAccumulator(tls, pParse, iUseFlag, pAggInfo) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, iUseFlag) - Xsqlite3VdbeComment(tls, v, ts+21157 /* "indicate data in..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+21564 /* "indicate data in..." */, 0) // End of the loop if !(groupBySort != 0) { - goto __106 + goto __113 } Xsqlite3VdbeAddOp2(tls, v, OP_SorterNext, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrTopOfLoop) - goto __107 -__106: + goto __114 +__113: + ; Xsqlite3WhereEnd(tls, pWInfo) Xsqlite3VdbeChangeToNoop(tls, v, addrSortingIdx) -__107: +__114: ; // Output the final row of result Xsqlite3VdbeAddOp2(tls, v, OP_Gosub, regOutputRow, addrOutputRow) - Xsqlite3VdbeComment(tls, v, ts+21186 /* "output final row" */, 0) + Xsqlite3VdbeComment(tls, v, ts+21593 /* "output final row" */, 0) // Jump over the subroutines Xsqlite3VdbeGoto(tls, v, addrEnd) @@ -117537,13 +119245,13 @@ __107: // order to signal the caller to abort. addrSetAbort = Xsqlite3VdbeCurrentAddr(tls, v) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, iAbortFlag) - Xsqlite3VdbeComment(tls, v, ts+21203 /* "set abort flag" */, 0) + Xsqlite3VdbeComment(tls, v, ts+21610 /* "set abort flag" */, 0) Xsqlite3VdbeAddOp1(tls, v, OP_Return, regOutputRow) Xsqlite3VdbeResolveLabel(tls, v, addrOutputRow) addrOutputRow = Xsqlite3VdbeCurrentAddr(tls, v) Xsqlite3VdbeAddOp2(tls, v, OP_IfPos, iUseFlag, (addrOutputRow + 2)) - Xsqlite3VdbeComment(tls, v, ts+21218 /* "Groupby result g..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+21625 /* "Groupby result g..." */, 0) Xsqlite3VdbeAddOp1(tls, v, OP_Return, regOutputRow) finalizeAggFunctions(tls, pParse, pAggInfo) Xsqlite3ExprIfFalse(tls, pParse, pHaving, (addrOutputRow + 1), SQLITE_JUMPIFNULL) @@ -117551,19 +119259,19 @@ __107: bp+168 /* &sDistinct */, pDest, (addrOutputRow + 1), addrSetAbort) Xsqlite3VdbeAddOp1(tls, v, OP_Return, regOutputRow) - Xsqlite3VdbeComment(tls, v, ts+21255 /* "end groupby resu..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+21662 /* "end groupby resu..." */, 0) // Generate a subroutine that will reset the group-by accumulator Xsqlite3VdbeResolveLabel(tls, v, addrReset) resetAccumulator(tls, pParse, pAggInfo) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, iUseFlag) - Xsqlite3VdbeComment(tls, v, ts+21284 /* "indicate accumul..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+21691 /* "indicate accumul..." */, 0) Xsqlite3VdbeAddOp1(tls, v, OP_Return, regReset) - goto __87 -__86: + goto __94 +__93: if !((libc.AssignUintptr(&pTab1, isSimpleCount(tls, p, pAggInfo))) != uintptr(0)) { - goto __108 + goto __115 } // If isSimpleCount() returns a pointer to a Table structure, then // the SQL statement is of the form: @@ -117594,60 +119302,60 @@ __86: // // In practice the KeyInfo structure will not be used. It is only // passed to keep OP_OpenRead happy. - if !(!(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & TF_WithoutRowid) == U32(0))) { - goto __110 + if !(!(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { + goto __117 } pBest = Xsqlite3PrimaryKeyIndex(tls, pTab1) -__110: +__117: ; if !(!((int32(*(*uint8)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + 60 /* &.fg */ + 4 /* &.notIndexed */)) & 0x1 >> 0)) != 0)) { - goto __111 + goto __118 } pIdx = (*Table)(unsafe.Pointer(pTab1)).FpIndex -__112: +__119: if !(pIdx != 0) { - goto __114 + goto __121 } if !(((((int32(*(*uint16)(unsafe.Pointer(pIdx + 100 /* &.bUnordered */)) & 0x4 >> 2)) == 0) && (int32((*Index)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*Table)(unsafe.Pointer(pTab1)).FszTabRow))) && ((*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0))) && (!(pBest != 0) || (int32((*Index)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*Index)(unsafe.Pointer(pBest)).FszIdxRow)))) { - goto __115 + goto __122 } pBest = pIdx -__115: +__122: ; - goto __113 -__113: + goto __120 +__120: pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext - goto __112 - goto __114 -__114: + goto __119 + goto __121 +__121: ; -__111: +__118: ; if !(pBest != 0) { - goto __116 + goto __123 } iRoot = (*Index)(unsafe.Pointer(pBest)).Ftnum pKeyInfo2 = Xsqlite3KeyInfoOfIndex(tls, pParse, pBest) -__116: +__123: ; // Open a read-only cursor, execute the OP_Count, close the cursor. Xsqlite3VdbeAddOp4Int(tls, v, OP_OpenRead, iCsr, int32(iRoot), iDb, 1) if !(pKeyInfo2 != 0) { - goto __117 + goto __124 } Xsqlite3VdbeChangeP4(tls, v, -1, pKeyInfo2, -9) -__117: +__124: ; Xsqlite3VdbeAddOp2(tls, v, OP_Count, iCsr, (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc)).FiMem) Xsqlite3VdbeAddOp1(tls, v, OP_Close, iCsr) explainSimpleCount(tls, pParse, pTab1, pBest) - goto __109 -__108: - regAcc = 0 + goto __116 +__115: + regAcc = 0 // "populate accumulators" flag // If there are accumulator registers but no min() or max() functions // without FILTER clauses, allocate register regAcc. Register regAcc @@ -117659,40 +119367,40 @@ __108: // least once even if the FILTER clause means the min() or max() // function visits zero rows. if !((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) { - goto __118 + goto __125 } i = 0 -__119: +__126: if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { - goto __121 + goto __128 } - if !(((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpFExpr))).Fflags & (EP_WinFunc)) != U32(0)) { - goto __122 + if !(((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpFExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { + goto __129 } - goto __120 -__122: + goto __127 +__129: ; - if !(((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*24)).FpFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0) { - goto __123 + if !(((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*24)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0) { + goto __130 } - goto __121 -__123: + goto __128 +__130: ; - goto __120 -__120: + goto __127 +__127: i++ - goto __119 - goto __121 -__121: + goto __126 + goto __128 +__128: ; if !(i == (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { - goto __124 + goto __131 } regAcc = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, regAcc) -__124: +__131: ; -__118: +__125: ; // This case runs if the aggregate has no GROUP BY clause. The @@ -117709,63 +119417,64 @@ __118: pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, *(*uintptr)(unsafe.Pointer(bp + 240 /* pMinMaxOrderBy */)), uintptr(0), uint16(minMaxFlag), 0) if !(pWInfo == uintptr(0)) { - goto __125 + goto __132 } goto select_end -__125: +__132: ; + updateAccumulator(tls, pParse, regAcc, pAggInfo) if !(regAcc != 0) { - goto __126 + goto __133 } Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, regAcc) -__126: +__133: ; - addrSkip = Xsqlite3WhereOrderByLimitOptLabel(tls, pWInfo) - if !(addrSkip != Xsqlite3WhereContinueLabel(tls, pWInfo)) { - goto __127 + if !(minMaxFlag != 0) { + goto __134 } - Xsqlite3VdbeGoto(tls, v, addrSkip) -__127: + Xsqlite3WhereMinMaxOptEarlyOut(tls, v, pWInfo) +__134: ; + Xsqlite3WhereEnd(tls, pWInfo) finalizeAggFunctions(tls, pParse, pAggInfo) -__109: +__116: ; (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FpOrderBy = uintptr(0) Xsqlite3ExprIfFalse(tls, pParse, pHaving, addrEnd, SQLITE_JUMPIFNULL) selectInnerLoop(tls, pParse, p, -1, uintptr(0), uintptr(0), pDest, addrEnd, addrEnd) -__87: +__94: ; Xsqlite3VdbeResolveLabel(tls, v, addrEnd) -__52: +__58: ; // endif aggregate query if !(int32((*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FeTnctType) == WHERE_DISTINCT_UNORDERED) { - goto __128 + goto __135 } - explainTempTable(tls, pParse, ts+21075 /* "DISTINCT" */) -__128: + explainTempTable(tls, pParse, ts+21482 /* "DISTINCT" */) +__135: ; // If there is an ORDER BY clause, then we need to sort the results // and send them to the callback one by one. if !((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy != 0) { - goto __129 + goto __136 } explainTempTable(tls, pParse, func() uintptr { if (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FnOBSat > 0 { - return ts + 21311 /* "RIGHT PART OF OR..." */ + return ts + 21718 /* "RIGHT PART OF OR..." */ } - return ts + 19956 /* "ORDER BY" */ + return ts + 21741 /* "ORDER BY" */ }()) generateSortTail(tls, pParse, p, bp+80 /* &sSort */, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, pDest) -__129: +__136: ; // Jump here to skip this query @@ -117815,7 +119524,7 @@ type TabResult1 = struct { FnData U32 Frc int32 _ [4]byte -} /* sqlite3.c:136216:9 */ +} /* sqlite3.c:138257:9 */ //************* End of select.c ********************************************* //************* Begin file table.c ****************************************** @@ -117839,12 +119548,12 @@ type TabResult1 = struct { // This structure is used to pass data from sqlite3_get_table() through // to the callback function is uses to build the result. -type TabResult = TabResult1 /* sqlite3.c:136224:3 */ +type TabResult = TabResult1 /* sqlite3.c:138265:3 */ // 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 *libc.TLS, pArg uintptr, nCol int32, argv uintptr, colv uintptr) int32 { /* sqlite3.c:136231:12: */ +func sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr, colv uintptr) int32 { /* sqlite3.c:138272:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -117915,7 +119624,7 @@ __5: } Xsqlite3_free(tls, (*TabResult)(unsafe.Pointer(p)).FzErrMsg) (*TabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, - ts+21334 /* "sqlite3_get_tabl..." */, 0) + ts+21750 /* "sqlite3_get_tabl..." */, 0) (*TabResult)(unsafe.Pointer(p)).Frc = SQLITE_ERROR return 1 __11: @@ -117975,7 +119684,7 @@ malloc_failed: // 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 *libc.TLS, db uintptr, zSql uintptr, pazResult uintptr, pnRow uintptr, pnColumn uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:136305:16: */ +func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintptr, pnRow uintptr, pnColumn uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:138346:16: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -118047,7 +119756,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp } // This routine frees the space the sqlite3_get_table() malloced. -func Xsqlite3_free_table(tls *libc.TLS, azResult uintptr) { /* sqlite3.c:136374:17: */ +func Xsqlite3_free_table(tls *libc.TLS, azResult uintptr) { /* sqlite3.c:138415:17: */ if azResult != 0 { var i int32 var n int32 @@ -118078,7 +119787,7 @@ func Xsqlite3_free_table(tls *libc.TLS, azResult uintptr) { /* sqlite3.c:136374: // #include "sqliteInt.h" // Delete a linked list of TriggerStep structures. -func Xsqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr) { /* sqlite3.c:136409:21: */ +func Xsqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr) { /* sqlite3.c:138450:21: */ for pTriggerStep != 0 { var pTmp uintptr = pTriggerStep pTriggerStep = (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpNext @@ -118107,38 +119816,38 @@ func Xsqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr) // 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 Xsqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) uintptr { /* sqlite3.c:136440:24: */ - var pTmpSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32)).FpSchema - var pList uintptr = uintptr(0) // List of triggers to return +func Xsqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) uintptr { /* sqlite3.c:138481:24: */ + var pTmpSchema uintptr // Schema of the pTab table + var pList uintptr // List of triggers to return + var p uintptr // Loop variable for TEMP triggers if (*Parse)(unsafe.Pointer(pParse)).FdisableTriggers != 0 { return uintptr(0) } - + pTmpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32)).FpSchema + p = (*Hash)(unsafe.Pointer((pTmpSchema + 56 /* &.trigHash */))).Ffirst + if p == uintptr(0) { + return (*Table)(unsafe.Pointer(pTab)).FpTrigger + } + pList = (*Table)(unsafe.Pointer(pTab)).FpTrigger if pTmpSchema != (*Table)(unsafe.Pointer(pTab)).FpSchema { - var p uintptr - - for p = (*Hash)(unsafe.Pointer((pTmpSchema + 56 /* &.trigHash */))).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext { + for p != 0 { var pTrig uintptr = (*HashElem)(unsafe.Pointer(p)).Fdata if ((*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema == (*Table)(unsafe.Pointer(pTab)).FpSchema) && (0 == Xsqlite3StrICmp(tls, (*Trigger)(unsafe.Pointer(pTrig)).Ftable, (*Table)(unsafe.Pointer(pTab)).FzName)) { - (*Trigger)(unsafe.Pointer(pTrig)).FpNext = func() uintptr { - if pList != 0 { - return pList - } - return (*Table)(unsafe.Pointer(pTab)).FpTrigger - }() + (*Trigger)(unsafe.Pointer(pTrig)).FpNext = pList + pList = pTrig + } else if int32((*Trigger)(unsafe.Pointer(pTrig)).Fop) == TK_RETURNING { + + (*Trigger)(unsafe.Pointer(pTrig)).Ftable = (*Table)(unsafe.Pointer(pTab)).FzName + (*Trigger)(unsafe.Pointer(pTrig)).FpTabSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema + (*Trigger)(unsafe.Pointer(pTrig)).FpNext = pList pList = pTrig } + p = (*HashElem)(unsafe.Pointer(p)).Fnext } } - - return func() uintptr { - if pList != 0 { - return pList - } - return (*Table)(unsafe.Pointer(pTab)).FpTrigger - }() + return pList } // This is called by the parser when it sees a CREATE TRIGGER statement @@ -118147,9 +119856,9 @@ func Xsqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) uintptr { // in pParse->pNewTrigger. After the trigger actions have been parsed, the // sqlite3FinishTrigger() function is called to complete the trigger // construction process. -func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, tr_tm int32, op int32, pColumns uintptr, pTableName uintptr, pWhen uintptr, isTemp int32, noErr int32) { /* sqlite3.c:136473:21: */ - bp := tls.Alloc(104) - defer tls.Free(104) +func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, tr_tm int32, op int32, pColumns uintptr, pTableName uintptr, pWhen uintptr, isTemp int32, noErr int32) { /* sqlite3.c:138525:21: */ + bp := tls.Alloc(152) + defer tls.Free(152) var pTrigger uintptr // The new trigger var pTab uintptr // Table that the trigger fires off of @@ -118158,7 +119867,7 @@ func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 var iDb int32 // The database to store the trigger in // var pName uintptr at bp+48, 8 // The unqualified db name - // var sFix DbFixer at bp+56, 48 + // var sFix DbFixer at bp+56, 96 var iTabDb int32 var code int32 @@ -118177,7 +119886,7 @@ func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if !((*Token)(unsafe.Pointer(pName2)).Fn > uint32(0)) { goto __3 } - Xsqlite3ErrorMsg(tls, pParse, ts+21399 /* "temporary trigge..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+21815 /* "temporary trigge..." */, 0) goto trigger_cleanup __3: ; @@ -118212,8 +119921,8 @@ __5: if !(((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) && (iDb != 1)) { goto __6 } - Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzDatabase) - (*SrcList_item)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzDatabase = uintptr(0) + Xsqlite3DbFree(tls, db, (*SrcItem)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzDatabase) + (*SrcItem)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzDatabase = uintptr(0) __6: ; @@ -118238,7 +119947,7 @@ __7: __8: ; - Xsqlite3FixInit(tls, bp+56 /* &sFix */, pParse, iDb, ts+21445 /* "trigger" */, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */))) + Xsqlite3FixInit(tls, bp+56 /* &sFix */, pParse, iDb, ts+21861 /* "trigger" */, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */))) if !(Xsqlite3FixSrcList(tls, bp+56 /* &sFix */, pTableName) != 0) { goto __9 } @@ -118250,104 +119959,91 @@ __9: goto __10 } // The table does not exist. - if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) == 1) { - goto __11 - } - // Ticket #3810. - // Normally, whenever a table is dropped, all associated triggers are - // dropped too. But if a TEMP trigger is created on a non-TEMP table - // and the table is dropped by a different database connection, the - // trigger is not visible to the database connection that does the - // drop so the trigger cannot be dropped. This results in an - // "orphaned trigger" - a trigger whose associated table is missing. - libc.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.orphanTrigger */, uint32(1), 0, 0x1) -__11: - ; - goto trigger_cleanup + goto trigger_orphan_error __10: ; if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { - goto __12 + goto __11 } - Xsqlite3ErrorMsg(tls, pParse, ts+21453 /* "cannot create tr..." */, 0) - goto trigger_cleanup -__12: + Xsqlite3ErrorMsg(tls, pParse, ts+21869 /* "cannot create tr..." */, 0) + goto trigger_orphan_error +__11: ; // Check that the trigger name is not reserved and that no trigger of the // specified name exists zName = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */))) if !(zName == uintptr(0)) { - goto __13 + goto __12 } + goto trigger_cleanup +__12: + ; + if !(Xsqlite3CheckObjectName(tls, pParse, zName, ts+21861 /* "trigger" */, (*Table)(unsafe.Pointer(pTab)).FzName) != 0) { + goto __13 + } goto trigger_cleanup __13: ; - if !(Xsqlite3CheckObjectName(tls, pParse, zName, ts+21445 /* "trigger" */, (*Table)(unsafe.Pointer(pTab)).FzName) != 0) { + + if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME)) { goto __14 } + if !(Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema+56 /* &.trigHash */), zName) != 0) { + goto __15 + } + if !(!(noErr != 0)) { + goto __16 + } + Xsqlite3ErrorMsg(tls, pParse, ts+21910 /* "trigger %T alrea..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */)))) + goto __17 +__16: + ; + Xsqlite3CodeVerifySchema(tls, pParse, iDb) +__17: + ; goto trigger_cleanup +__15: + ; __14: ; - if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME)) { - goto __15 - } - if !(Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema+56 /* &.trigHash */), zName) != 0) { - goto __16 - } - if !(!(noErr != 0)) { - goto __17 - } - Xsqlite3ErrorMsg(tls, pParse, ts+21494 /* "trigger %T alrea..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */)))) - goto __18 -__17: - ; - Xsqlite3CodeVerifySchema(tls, pParse, iDb) -__18: - ; - goto trigger_cleanup -__16: - ; -__15: - ; - // Do not create a trigger on a system table - if !(Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10128 /* "sqlite_" */, 7) == 0) { - goto __19 + if !(Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10221 /* "sqlite_" */, 7) == 0) { + goto __18 } - Xsqlite3ErrorMsg(tls, pParse, ts+21520 /* "cannot create tr..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+21936 /* "cannot create tr..." */, 0) goto trigger_cleanup -__19: +__18: ; // INSTEAD of triggers are only for views and views only support INSTEAD // of triggers. if !(((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) && (tr_tm != TK_INSTEAD)) { - goto __20 + goto __19 } - Xsqlite3ErrorMsg(tls, pParse, ts+21558, /* "cannot create %s..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+21974, /* "cannot create %s..." */ libc.VaList(bp+8, func() uintptr { if tr_tm == TK_BEFORE { - return ts + 21595 /* "BEFORE" */ + return ts + 22011 /* "BEFORE" */ } - return ts + 21602 /* "AFTER" */ + return ts + 22018 /* "AFTER" */ }(), pTableName, 0)) - goto trigger_cleanup -__20: + goto trigger_orphan_error +__19: ; if !(!(int32((*Table)(unsafe.Pointer(pTab)).FpSelect) != 0) && (tr_tm == TK_INSTEAD)) { - goto __21 + goto __20 } Xsqlite3ErrorMsg(tls, pParse, - ts+21608 /* "cannot create IN..." */, libc.VaList(bp+32, pTableName, 0)) - goto trigger_cleanup -__21: + ts+22024 /* "cannot create IN..." */, libc.VaList(bp+32, pTableName, 0)) + goto trigger_orphan_error +__20: ; if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME)) { - goto __22 + goto __21 } iTabDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) code = SQLITE_CREATE_TRIGGER @@ -118358,29 +120054,29 @@ __21: zDbTrig = zDb } if !((iTabDb == 1) || (isTemp != 0)) { - goto __23 + goto __22 } code = SQLITE_CREATE_TEMP_TRIGGER -__23: +__22: ; if !(Xsqlite3AuthCheck(tls, pParse, code, zName, (*Table)(unsafe.Pointer(pTab)).FzName, zDbTrig) != 0) { + goto __23 + } + goto trigger_cleanup +__23: + ; + if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr { + if (!(0 != 0)) && (iTabDb == 1) { + return ts + 13714 /* "sqlite_temp_mast..." */ + } + return ts + 7634 /* "sqlite_master" */ + }(), uintptr(0), zDb) != 0) { goto __24 } goto trigger_cleanup __24: ; - if !(Xsqlite3AuthCheck(tls, pParse, SQLITE_INSERT, func() uintptr { - if (!(0 != 0)) && (iTabDb == 1) { - return ts + 13301 /* "sqlite_temp_mast..." */ - } - return ts + 7541 /* "sqlite_master" */ - }(), uintptr(0), zDb) != 0) { - goto __25 - } - goto trigger_cleanup -__25: - ; -__22: +__21: ; // INSTEAD OF triggers can only appear on views and BEFORE triggers @@ -118388,42 +120084,42 @@ __22: // INSTEAD OF trigger into a BEFORE trigger. It simplifies code // elsewhere. if !(tr_tm == TK_INSTEAD) { - goto __26 + goto __25 } tr_tm = TK_BEFORE -__26: +__25: ; // Build the Trigger object pTrigger = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Trigger{}))) if !(pTrigger == uintptr(0)) { - goto __27 + goto __26 } goto trigger_cleanup -__27: +__26: ; (*Trigger)(unsafe.Pointer(pTrigger)).FzName = zName zName = uintptr(0) - (*Trigger)(unsafe.Pointer(pTrigger)).Ftable = Xsqlite3DbStrDup(tls, db, (*SrcList_item)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzName) + (*Trigger)(unsafe.Pointer(pTrigger)).Ftable = Xsqlite3DbStrDup(tls, db, (*SrcItem)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzName) (*Trigger)(unsafe.Pointer(pTrigger)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema (*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema = (*Table)(unsafe.Pointer(pTab)).FpSchema (*Trigger)(unsafe.Pointer(pTrigger)).Fop = U8(op) (*Trigger)(unsafe.Pointer(pTrigger)).Ftr_tm = func() uint8 { if tr_tm == TK_BEFORE { - return TRIGGER_BEFORE + return uint8(TRIGGER_BEFORE) } - return TRIGGER_AFTER + return uint8(TRIGGER_AFTER) }() if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { - goto __28 + goto __27 } - Xsqlite3RenameTokenRemap(tls, pParse, (*Trigger)(unsafe.Pointer(pTrigger)).Ftable, (*SrcList_item)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzName) + Xsqlite3RenameTokenRemap(tls, pParse, (*Trigger)(unsafe.Pointer(pTrigger)).Ftable, (*SrcItem)(unsafe.Pointer((pTableName + 8 /* &.a */))).FzName) (*Trigger)(unsafe.Pointer(pTrigger)).FpWhen = pWhen pWhen = uintptr(0) - goto __29 -__28: + goto __28 +__27: (*Trigger)(unsafe.Pointer(pTrigger)).FpWhen = Xsqlite3ExprDup(tls, db, pWhen, EXPRDUP_REDUCE) -__29: +__28: ; (*Trigger)(unsafe.Pointer(pTrigger)).FpColumns = pColumns pColumns = uintptr(0) @@ -118436,25 +120132,45 @@ trigger_cleanup: Xsqlite3IdListDelete(tls, db, pColumns) Xsqlite3ExprDelete(tls, db, pWhen) if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FpNewTrigger) != 0)) { - goto __30 + goto __29 } Xsqlite3DeleteTrigger(tls, db, pTrigger) - goto __31 + goto __30 +__29: + ; __30: ; + return + +trigger_orphan_error: + if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) == 1) { + goto __31 + } + // Ticket #3810. + // Normally, whenever a table is dropped, all associated triggers are + // dropped too. But if a TEMP trigger is created on a non-TEMP table + // and the table is dropped by a different database connection, the + // trigger is not visible to the database connection that does the + // drop so the trigger cannot be dropped. This results in an + // "orphaned trigger" - a trigger whose associated table is missing. + // + // 2020-11-05 see also https://sqlite.org/forum/forumpost/157dc791df + libc.SetBitFieldPtr8Uint32(db+184 /* &.init */ +8 /* &.orphanTrigger */, uint32(1), 0, 0x1) __31: + ; + goto trigger_cleanup } // This routine is called after all of the trigger actions have been parsed // in order to complete the process of building the trigger. -func Xsqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAll uintptr) { /* sqlite3.c:136674:21: */ - bp := tls.Alloc(104) - defer tls.Free(104) +func Xsqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAll uintptr) { /* sqlite3.c:138732:21: */ + bp := tls.Alloc(152) + defer tls.Free(152) var pTrig uintptr // Trigger being finished var zName uintptr // Name of trigger var db uintptr // The database - // var sFix DbFixer at bp+56, 48 + // var sFix DbFixer at bp+56, 96 // Fixer object var iDb int32 // Database containing the trigger // var nameToken Token at bp+40, 16 @@ -118487,7 +120203,7 @@ __2: __3: ; Xsqlite3TokenInit(tls, bp+40 /* &nameToken */, (*Trigger)(unsafe.Pointer(pTrig)).FzName) - Xsqlite3FixInit(tls, bp+56 /* &sFix */, pParse, iDb, ts+21445 /* "trigger" */, bp+40 /* &nameToken */) + Xsqlite3FixInit(tls, bp+56 /* &sFix */, pParse, iDb, ts+21861 /* "trigger" */, bp+40 /* &nameToken */) if !((Xsqlite3FixTriggerStep(tls, bp+56 /* &sFix */, (*Trigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0) || (Xsqlite3FixExpr(tls, bp+56 /* &sFix */, (*Trigger)(unsafe.Pointer(pTrig)).FpWhen) != 0)) { goto __4 @@ -118524,13 +120240,13 @@ __8: Xsqlite3NestedParse(tls, pParse, - ts+21654, /* "INSERT INTO %Q.s..." */ + ts+22070, /* "INSERT INTO %Q.s..." */ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zName, (*Trigger)(unsafe.Pointer(pTrig)).Ftable, z)) Xsqlite3DbFree(tls, db, z) Xsqlite3ChangeCookie(tls, pParse, iDb) Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb, - Xsqlite3MPrintf(tls, db, ts+21729 /* "type='trigger' A..." */, libc.VaList(bp+32, zName))) + Xsqlite3MPrintf(tls, db, ts+22145 /* "type='trigger' A..." */, libc.VaList(bp+32, zName)), uint16(0)) __7: ; __6: @@ -118571,7 +120287,7 @@ triggerfinish_cleanup: // Duplicate a range of text from an SQL statement, then convert all // whitespace characters into ordinary space characters. -func triggerSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136762:13: */ +func triggerSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:138820:13: */ var z uintptr = Xsqlite3DbSpanDup(tls, db, zStart, zEnd) var i int32 if z != 0 { @@ -118589,15 +120305,15 @@ func triggerSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uin // // The parser calls this routine when it finds a SELECT statement in // body of a TRIGGER. -func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136776:28: */ +func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:138834:28: */ var pTriggerStep uintptr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(TriggerStep{}))) if pTriggerStep == uintptr(0) { Xsqlite3SelectDelete(tls, db, pSelect) return uintptr(0) } - (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Fop = TK_SELECT + (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Fop = U8(TK_SELECT) (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpSelect = pSelect - (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = OE_Default + (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = U8(OE_Default) (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FzSpan = triggerSpanDup(tls, db, zStart, zEnd) return pTriggerStep } @@ -118606,7 +120322,7 @@ func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStar // 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 *libc.TLS, pParse uintptr, op U8, pName uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136800:20: */ +func triggerStepAllocate(tls *libc.TLS, pParse uintptr, op U8, pName uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:138858:20: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr @@ -118630,11 +120346,11 @@ func triggerStepAllocate(tls *libc.TLS, pParse uintptr, op U8, pName uintptr, zS // // The parser calls this routine when it sees an INSERT inside the // body of a trigger. -func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pColumn uintptr, pSelect uintptr, orconf U8, pUpsert uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136832:28: */ +func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pColumn uintptr, pSelect uintptr, orconf U8, pUpsert uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:138890:28: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr - pTriggerStep = triggerStepAllocate(tls, pParse, TK_INSERT, pTableName, zStart, zEnd) + pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_INSERT), pTableName, zStart, zEnd) if pTriggerStep != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpSelect = pSelect @@ -118662,11 +120378,11 @@ func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr // 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 Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pFrom uintptr, pEList uintptr, pWhere uintptr, orconf U8, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136877:28: */ +func Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pFrom uintptr, pEList uintptr, pWhere uintptr, orconf U8, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:138935:28: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr - pTriggerStep = triggerStepAllocate(tls, pParse, TK_UPDATE, pTableName, zStart, zEnd) + pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_UPDATE), pTableName, zStart, zEnd) if pTriggerStep != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpExprList = pEList @@ -118691,11 +120407,11 @@ func Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr // 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 Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pWhere uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136917:28: */ +func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pWhere uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:138975:28: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pTriggerStep uintptr - pTriggerStep = triggerStepAllocate(tls, pParse, TK_DELETE, pTableName, zStart, zEnd) + pTriggerStep = triggerStepAllocate(tls, pParse, uint8(TK_DELETE), pTableName, zStart, zEnd) if pTriggerStep != 0 { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = pWhere @@ -118703,15 +120419,15 @@ func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr } else { (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = Xsqlite3ExprDup(tls, db, pWhere, EXPRDUP_REDUCE) } - (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = OE_Default + (*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = U8(OE_Default) } Xsqlite3ExprDelete(tls, db, pWhere) return pTriggerStep } // Recursively delete a Trigger structure -func Xsqlite3DeleteTrigger(tls *libc.TLS, db uintptr, pTrigger uintptr) { /* sqlite3.c:136944:21: */ - if pTrigger == uintptr(0) { +func Xsqlite3DeleteTrigger(tls *libc.TLS, db uintptr, pTrigger uintptr) { /* sqlite3.c:139002:21: */ + if (pTrigger == uintptr(0)) || ((*Trigger)(unsafe.Pointer(pTrigger)).FbReturning != 0) { return } Xsqlite3DeleteTriggerStep(tls, db, (*Trigger)(unsafe.Pointer(pTrigger)).Fstep_list) @@ -118730,7 +120446,7 @@ func Xsqlite3DeleteTrigger(tls *libc.TLS, db uintptr, pTrigger uintptr) { /* sql // same job as this routine except it takes a pointer to the trigger // instead of the trigger name. // -func Xsqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int32) { /* sqlite3.c:136962:21: */ +func Xsqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int32) { /* sqlite3.c:139020:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -118756,8 +120472,8 @@ __1: __2: ; - zDb = (*SrcList_item)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase - zName = (*SrcList_item)(unsafe.Pointer((pName + 8 /* &.a */))).FzName + zDb = (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzDatabase + zName = (*SrcItem)(unsafe.Pointer((pName + 8 /* &.a */))).FzName i = OMIT_TEMPDB __3: @@ -118796,7 +120512,7 @@ __5: if !(!(noErr != 0)) { goto __9 } - Xsqlite3ErrorMsg(tls, pParse, ts+21758 /* "no such trigger:..." */, libc.VaList(bp, pName, 0)) + Xsqlite3ErrorMsg(tls, pParse, ts+22174 /* "no such trigger:..." */, libc.VaList(bp, pName, 0)) goto __10 __9: Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb) @@ -118814,12 +120530,12 @@ drop_trigger_cleanup: // Return a pointer to the Table structure for the table that a trigger // is set on. -func tableOfTrigger(tls *libc.TLS, pTrigger uintptr) uintptr { /* sqlite3.c:137004:14: */ +func tableOfTrigger(tls *libc.TLS, pTrigger uintptr) uintptr { /* sqlite3.c:139062:14: */ return Xsqlite3HashFind(tls, ((*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema + 8 /* &.tblHash */), (*Trigger)(unsafe.Pointer(pTrigger)).Ftable) } // Drop a trigger given a pointer to that trigger. -func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { /* sqlite3.c:137012:21: */ +func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { /* sqlite3.c:139070:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -118837,9 +120553,9 @@ func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { / var zDb uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName var zTab uintptr = func() uintptr { if (!(0 != 0)) && (iDb == 1) { - return ts + 13301 /* "sqlite_temp_mast..." */ + return ts + 13714 /* "sqlite_temp_mast..." */ } - return ts + 7541 /* "sqlite_master" */ + return ts + 7634 /* "sqlite_master" */ }() if iDb == 1 { code = SQLITE_DROP_TEMP_TRIGGER @@ -118852,7 +120568,7 @@ func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { / // Generate code to destroy the database record of the trigger. if (libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse))) != uintptr(0) { Xsqlite3NestedParse(tls, pParse, - ts+21778, /* "DELETE FROM %Q.s..." */ + ts+22194, /* "DELETE FROM %Q.s..." */ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Trigger)(unsafe.Pointer(pTrigger)).FzName)) Xsqlite3ChangeCookie(tls, pParse, iDb) Xsqlite3VdbeAddOp4(tls, v, OP_DropTrigger, iDb, 0, 0, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, 0) @@ -118860,7 +120576,7 @@ func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { / } // Remove a trigger from the hash tables of the sqlite* pointer. -func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) { /* sqlite3.c:137050:21: */ +func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) { /* sqlite3.c:139108:21: */ var pTrigger uintptr var pHash uintptr @@ -118880,7 +120596,7 @@ func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName } } Xsqlite3DeleteTrigger(tls, db, pTrigger) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_SchemaChange) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_SchemaChange)) } } @@ -118891,7 +120607,7 @@ func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName // 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 *libc.TLS, pIdList uintptr, pEList uintptr) int32 { /* sqlite3.c:137084:12: */ +func checkColumnOverlap(tls *libc.TLS, pIdList uintptr, pEList uintptr) int32 { /* sqlite3.c:139142:12: */ var e int32 if (pIdList == uintptr(0)) || (pEList == uintptr(0)) { return 1 @@ -118908,23 +120624,117 @@ func checkColumnOverlap(tls *libc.TLS, pIdList uintptr, pEList uintptr) int32 { // 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 Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, pChanges uintptr, pMask uintptr) uintptr { /* sqlite3.c:137099:24: */ - var mask int32 = 0 - var pList uintptr = uintptr(0) +func Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, pChanges uintptr, pMask uintptr) uintptr { /* sqlite3.c:139157:24: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + var mask int32 + var pList uintptr var p uintptr + mask = 0 + pList = uintptr(0) - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_EnableTrigger) != uint64(0) { - pList = Xsqlite3TriggerList(tls, pParse, pTab) - } + pList = Xsqlite3TriggerList(tls, pParse, pTab) - for p = pList; p != 0; p = (*Trigger)(unsafe.Pointer(p)).FpNext { - if (int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) && (checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0) { - mask = mask | (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)) - } + if !(pList != uintptr(0)) { + goto __1 } - if pMask != 0 { - *(*int32)(unsafe.Pointer(pMask)) = mask + p = pList + if !((((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_EnableTrigger)) == uint64(0)) && + ((*Table)(unsafe.Pointer(pTab)).FpTrigger != uintptr(0))) { + goto __2 } + // The SQLITE_DBCONFIG_ENABLE_TRIGGER setting is off. That means that + // only TEMP triggers are allowed. Truncate the pList so that it + // includes only TEMP triggers + if !(pList == (*Table)(unsafe.Pointer(pTab)).FpTrigger) { + goto __3 + } + pList = uintptr(0) + goto exit_triggers_exist +__3: + ; +__4: + if !(((*Trigger)(unsafe.Pointer(p)).FpNext != 0) && ((*Trigger)(unsafe.Pointer(p)).FpNext != (*Table)(unsafe.Pointer(pTab)).FpTrigger)) { + goto __5 + } + p = (*Trigger)(unsafe.Pointer(p)).FpNext + goto __4 +__5: + ; + (*Trigger)(unsafe.Pointer(p)).FpNext = uintptr(0) + p = pList +__2: + ; +__6: + if !((int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) && (checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0)) { + goto __9 + } + mask = mask | (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)) + goto __10 +__9: + if !(int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_RETURNING) { + goto __11 + } + // The first time a RETURNING trigger is seen, the "op" value tells + // us what time of trigger it should be. + + (*Trigger)(unsafe.Pointer(p)).Fop = U8(op) + if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) { + goto __13 + } + if !(op != TK_INSERT) { + goto __15 + } + Xsqlite3ErrorMsg(tls, pParse, + ts+22256, /* "%s RETURNING is ..." */ + libc.VaList(bp, func() uintptr { + if op == TK_DELETE { + return ts + 22304 /* "DELETE" */ + } + return ts + 22311 /* "UPDATE" */ + }())) +__15: + ; + (*Trigger)(unsafe.Pointer(p)).Ftr_tm = U8(TRIGGER_BEFORE) + goto __14 +__13: + (*Trigger)(unsafe.Pointer(p)).Ftr_tm = U8(TRIGGER_AFTER) +__14: + ; + mask = mask | (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)) + goto __12 +__11: + if !(((((*Trigger)(unsafe.Pointer(p)).FbReturning != 0) && (int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_INSERT)) && (op == TK_UPDATE)) && + ((*Parse)(unsafe.Pointer((pParse))).FpToplevel == uintptr(0))) { + goto __16 + } + // Also fire a RETURNING trigger for an UPSERT + mask = mask | (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)) +__16: + ; +__12: + ; +__10: + ; + p = (*Trigger)(unsafe.Pointer(p)).FpNext + goto __7 +__7: + if p != 0 { + goto __6 + } + goto __8 +__8: + ; +__1: + ; +exit_triggers_exist: + if !(pMask != 0) { + goto __17 + } + *(*int32)(unsafe.Pointer(pMask)) = mask +__17: + ; return func() uintptr { if mask != 0 { return pList @@ -118941,7 +120751,7 @@ func Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32 // 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 Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintptr { /* sqlite3.c:137135:24: */ +func Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintptr { /* sqlite3.c:139231:24: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pSrc uintptr // SrcList to be returned var zName uintptr = Xsqlite3DbStrDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget) @@ -118949,9 +120759,9 @@ func Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintpt if pSrc != 0 { var pSchema uintptr = (*Trigger)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpTrig)).FpSchema - (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FzName = zName + (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FzName = zName if pSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+1*32)).FpSchema { - (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpSchema = pSchema + (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpSchema = pSchema } if (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 { var pDup uintptr = Xsqlite3SrcListDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom, 0) @@ -118963,9 +120773,104 @@ func Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintpt return pSrc } +// The input list pList is the list of result set terms from a RETURNING +// clause. The table that we are returning from is pTab. +// +// This routine makes a copy of the pList, and at the same time expands +// any "*" wildcards to be the complete set of columns from pTab. +func sqlite3ExpandReturning(tls *libc.TLS, pParse uintptr, pList uintptr, pTab uintptr) uintptr { /* sqlite3.c:139263:17: */ + var pNew uintptr = uintptr(0) + var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb + var i int32 + + for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ { + var pOldExpr uintptr = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32)).FpExpr + if (pOldExpr != uintptr(0)) && (int32((*Expr)(unsafe.Pointer(pOldExpr)).Fop) == TK_ASTERISK) { + var jj int32 + for jj = 0; jj < int32((*Table)(unsafe.Pointer(pTab)).FnCol); jj++ { + var pNewExpr uintptr + if (int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(jj)*32))).FcolFlags) & COLFLAG_HIDDEN) != 0 { + continue + } + pNewExpr = Xsqlite3Expr(tls, db, TK_ID, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*32)).FzName) + pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pNewExpr) + if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { + var pItem uintptr = ((pNew + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*32) + (*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrDup(tls, db, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(jj)*32)).FzName) + libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, uint32(ENAME_NAME), 0, 0x3) + } + } + } else { + var pNewExpr uintptr = Xsqlite3ExprDup(tls, db, pOldExpr, 0) + pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, pNewExpr) + if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) && ((*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*32)).FzEName != uintptr(0)) { + var pItem uintptr = ((pNew + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*32) + (*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*32)).FzEName) + libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, (uint32(int32(*(*uint8)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32 + 20 /* &.eEName */)) & 0x3 >> 0))), 0, 0x3) + } + } + } + if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { + var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe + + Xsqlite3VdbeSetNumCols(tls, v, (*ExprList)(unsafe.Pointer(pNew)).FnExpr) + for i = 0; i < (*ExprList)(unsafe.Pointer(pNew)).FnExpr; i++ { + Xsqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, (*ExprList_item)(unsafe.Pointer((pNew+8 /* &.a */)+uintptr(i)*32)).FzEName, + libc.UintptrFromInt32(-1)) + } + } + return pNew +} + +// Generate code for the RETURNING trigger. Unlike other triggers +// that invoke a subprogram in the bytecode, the code for RETURNING +// is generated in-line. +func codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { /* sqlite3.c:139314:13: */ + bp := tls.Alloc(56) + defer tls.Free(56) + + var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe + var pNew uintptr + var pReturning uintptr + + pReturning = *(*uintptr)(unsafe.Pointer(pParse + 184 /* &.u1 */)) + + pNew = sqlite3ExpandReturning(tls, pParse, (*Returning)(unsafe.Pointer(pReturning)).FpReturnEL, pTab) + if pNew != 0 { + // var sNC NameContext at bp, 56 + + libc.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) + if (*Returning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { + (*Returning)(unsafe.Pointer(pReturning)).FnRetCol = (*ExprList)(unsafe.Pointer(pNew)).FnExpr + (*Returning)(unsafe.Pointer(pReturning)).FiRetCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + } + (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = pParse + *(*int32)(unsafe.Pointer(bp /* &sNC */ + 16 /* &.uNC */)) = regIn + (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags = NC_UBaseReg + (*Parse)(unsafe.Pointer(pParse)).FeTriggerOp = (*Trigger)(unsafe.Pointer(pTrigger)).Fop + (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab = pTab + if Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, pNew) == SQLITE_OK { + var i int32 + var nCol int32 = (*ExprList)(unsafe.Pointer(pNew)).FnExpr + var reg int32 = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1) + *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (nCol + 2) + (*Returning)(unsafe.Pointer(pReturning)).FiRetReg = reg + for i = 0; i < nCol; i++ { + Xsqlite3ExprCodeFactorable(tls, pParse, (*ExprList_item)(unsafe.Pointer((pNew+8 /* &.a */)+uintptr(i)*32)).FpExpr, (reg + i)) + } + Xsqlite3VdbeAddOp3(tls, v, OP_MakeRecord, reg, i, (reg + i)) + Xsqlite3VdbeAddOp2(tls, v, OP_NewRowid, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, ((reg + i) + 1)) + Xsqlite3VdbeAddOp3(tls, v, OP_Insert, (*Returning)(unsafe.Pointer(pReturning)).FiRetCur, (reg + i), ((reg + i) + 1)) + } + Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pNew) + (*Parse)(unsafe.Pointer(pParse)).FeTriggerOp = U8(0) + (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab = uintptr(0) + } +} + // Generate VDBE code for the statements inside the body of a single // trigger. -func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf int32) int32 { /* sqlite3.c:137165:12: */ +func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf int32) int32 { /* sqlite3.c:139366:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -118995,7 +120900,7 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf if (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { Xsqlite3VdbeAddOp4(tls, v, OP_Trace, 0x7fffffff, 1, 0, - Xsqlite3MPrintf(tls, db, ts+7728 /* "-- %s" */, libc.VaList(bp, (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan)), + Xsqlite3MPrintf(tls, db, ts+7821 /* "-- %s" */, libc.VaList(bp, (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -7) } @@ -119007,6 +120912,7 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf Xsqlite3ExprListDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList, 0), Xsqlite3ExprDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere, 0), int32((*Parse)(unsafe.Pointer(pParse)).FeOrconf), uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3VdbeAddOp0(tls, v, OP_ResetCount) break } @@ -119018,6 +120924,7 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf Xsqlite3IdListDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpIdList), int32((*Parse)(unsafe.Pointer(pParse)).FeOrconf), Xsqlite3UpsertDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert)) + Xsqlite3VdbeAddOp0(tls, v, OP_ResetCount) break } @@ -119026,6 +120933,7 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf Xsqlite3DeleteFrom(tls, pParse, Xsqlite3TriggerStepSrc(tls, pParse, pStep), Xsqlite3ExprDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere, 0), uintptr(0), uintptr(0)) + Xsqlite3VdbeAddOp0(tls, v, OP_ResetCount) break } @@ -119041,9 +120949,6 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf } } - if int32((*TriggerStep)(unsafe.Pointer(pStep)).Fop) != TK_SELECT { - Xsqlite3VdbeAddOp0(tls, v, OP_ResetCount) - } } return 0 @@ -119051,28 +120956,28 @@ func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf // 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 *libc.TLS, onError int32) uintptr { /* sqlite3.c:137251:19: */ +func onErrorText(tls *libc.TLS, onError int32) uintptr { /* sqlite3.c:139452:19: */ switch onError { case OE_Abort: - return ts + 21840 /* "abort" */ + return ts + 22318 /* "abort" */ case OE_Rollback: - return ts + 21846 /* "rollback" */ + return ts + 22324 /* "rollback" */ case OE_Fail: - return ts + 21855 /* "fail" */ + return ts + 22333 /* "fail" */ case OE_Replace: - return ts + 16399 /* "replace" */ + return ts + 16861 /* "replace" */ case OE_Ignore: - return ts + 21860 /* "ignore" */ + return ts + 22338 /* "ignore" */ case OE_Default: - return ts + 21867 /* "default" */ + return ts + 22345 /* "default" */ } - return ts + 21875 /* "n/a" */ + return ts + 22353 /* "n/a" */ } // 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 *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:137269:13: */ +func transferParseError(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:139470:13: */ if (*Parse)(unsafe.Pointer(pTo)).FnErr == 0 { (*Parse)(unsafe.Pointer(pTo)).FzErrMsg = (*Parse)(unsafe.Pointer(pFrom)).FzErrMsg @@ -119085,7 +120990,7 @@ func transferParseError(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3. // Create and populate a new TriggerPrg object with a sub-program // implementing trigger pTrigger with ON CONFLICT policy orconf. -func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:137285:19: */ +func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:139486:19: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -119142,30 +121047,30 @@ func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintpt v = Xsqlite3GetVdbe(tls, pSubParse) if v != 0 { - Xsqlite3VdbeComment(tls, v, ts+21879 /* "Start: %s.%s (%s..." */, libc.VaList(bp, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, onErrorText(tls, orconf), func() uintptr { + Xsqlite3VdbeComment(tls, v, ts+22357 /* "Start: %s.%s (%s..." */, libc.VaList(bp, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, onErrorText(tls, orconf), func() uintptr { if int32((*Trigger)(unsafe.Pointer(pTrigger)).Ftr_tm) == TRIGGER_BEFORE { - return ts + 21595 /* "BEFORE" */ + return ts + 22011 /* "BEFORE" */ } - return ts + 21602 /* "AFTER" */ + return ts + 22018 /* "AFTER" */ }(), func() uintptr { if int32((*Trigger)(unsafe.Pointer(pTrigger)).Fop) == TK_UPDATE { - return ts + 21910 /* "UPDATE" */ + return ts + 22311 /* "UPDATE" */ } return ts + 800 /* "" */ }(), func() uintptr { if int32((*Trigger)(unsafe.Pointer(pTrigger)).Fop) == TK_INSERT { - return ts + 21917 /* "INSERT" */ + return ts + 22388 /* "INSERT" */ } return ts + 800 /* "" */ }(), func() uintptr { if int32((*Trigger)(unsafe.Pointer(pTrigger)).Fop) == TK_DELETE { - return ts + 21924 /* "DELETE" */ + return ts + 22304 /* "DELETE" */ } return ts + 800 /* "" */ }(), (*Table)(unsafe.Pointer(pTab)).FzName)) if (*Trigger)(unsafe.Pointer(pTrigger)).FzName != 0 { Xsqlite3VdbeChangeP4(tls, v, -1, - Xsqlite3MPrintf(tls, db, ts+21931 /* "-- TRIGGER %s" */, libc.VaList(bp+56, (*Trigger)(unsafe.Pointer(pTrigger)).FzName)), -7) + Xsqlite3MPrintf(tls, db, ts+22395 /* "-- TRIGGER %s" */, libc.VaList(bp+56, (*Trigger)(unsafe.Pointer(pTrigger)).FzName)), -7) } // If one was specified, code the WHEN clause. If it evaluates to false @@ -119189,7 +121094,7 @@ func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintpt Xsqlite3VdbeResolveLabel(tls, v, iEndTrigger) } Xsqlite3VdbeAddOp0(tls, v, OP_Halt) - Xsqlite3VdbeComment(tls, v, ts+21945 /* "End: %s.%s" */, libc.VaList(bp+64, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, onErrorText(tls, orconf))) + Xsqlite3VdbeComment(tls, v, ts+22409 /* "End: %s.%s" */, libc.VaList(bp+64, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, onErrorText(tls, orconf))) transferParseError(tls, pParse, pSubParse) if (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) && ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0) { @@ -119213,7 +121118,7 @@ func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintpt // 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 *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:137401:19: */ +func getRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:139601:19: */ var pRoot uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -119241,7 +121146,7 @@ func getRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr // 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 Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:137435:21: */ +func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:139635:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -119252,15 +121157,15 @@ func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab // Code the OP_Program opcode in the parent VDBE. P4 of the OP_Program // is a pointer to the sub-vdbe containing the trigger program. if pPrg != 0 { - var bRecursive int32 = (libc.Bool32(((*Trigger)(unsafe.Pointer(p)).FzName != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_RecTriggers)))) + var bRecursive int32 = (libc.Bool32(((*Trigger)(unsafe.Pointer(p)).FzName != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_RecTriggers))))) Xsqlite3VdbeAddOp4(tls, v, OP_Program, reg, ignoreJump, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1), (*TriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -4) - Xsqlite3VdbeComment(tls, v, ts+21956 /* "Call: %s.%s" */, libc.VaList(bp, func() uintptr { + Xsqlite3VdbeComment(tls, v, ts+22420 /* "Call: %s.%s" */, libc.VaList(bp, func() uintptr { if (*Trigger)(unsafe.Pointer(p)).FzName != 0 { return (*Trigger)(unsafe.Pointer(p)).FzName } - return ts + 21968 /* "fkey" */ + return ts + 22432 /* "fkey" */ }(), onErrorText(tls, orconf))) // Set the P5 operand of the OP_Program instruction to non-zero if @@ -119293,7 +121198,7 @@ func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, 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+2 NEW.* value of left-most column of pTab // ... ... // reg+N+N+1 NEW.* value of right-most column of pTab // @@ -119310,7 +121215,7 @@ func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab // 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 Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op int32, pChanges uintptr, tr_tm int32, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:137507:21: */ +func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op int32, pChanges uintptr, tr_tm int32, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:139707:21: */ var p uintptr // Used to iterate through pTrigger list for p = pTrigger; p != 0; p = (*Trigger)(unsafe.Pointer(p)).FpNext { @@ -119319,11 +121224,18 @@ func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op // always defined. The trigger must be in the same schema as the table // or else it must be a TEMP trigger. - // Determine whether we should code this trigger - if ((int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) && + // Determine whether we should code this trigger. One of two choices: + // 1. The trigger is an exact match to the current DML statement + // 2. This is a RETURNING trigger for INSERT but we are currently + // doing the UPDATE part of an UPSERT. + if (((int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) || ((((*Trigger)(unsafe.Pointer(p)).FbReturning != 0) && (int32((*Trigger)(unsafe.Pointer(p)).Fop) == TK_INSERT)) && (op == TK_UPDATE))) && (int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm) == tr_tm)) && (checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0) { - Xsqlite3CodeRowTriggerDirect(tls, pParse, p, pTab, reg, orconf, ignoreJump) + if !(int32((*Trigger)(unsafe.Pointer(p)).FbReturning) != 0) { + Xsqlite3CodeRowTriggerDirect(tls, pParse, p, pTab, reg, orconf, ignoreJump) + } else if (*Parse)(unsafe.Pointer((pParse))).FpToplevel == uintptr(0) { + codeReturningTrigger(tls, pParse, p, pTab, reg) + } } } } @@ -119351,7 +121263,7 @@ func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op // 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 Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pChanges uintptr, isNew int32, tr_tm int32, pTab uintptr, orconf int32) U32 { /* sqlite3.c:137569:20: */ +func Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pChanges uintptr, isNew int32, tr_tm int32, pTab uintptr, orconf int32) U32 { /* sqlite3.c:139777:20: */ var op int32 if pChanges != 0 { op = TK_UPDATE @@ -119362,12 +121274,17 @@ func Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pCh var p uintptr for p = pTrigger; p != 0; p = (*Trigger)(unsafe.Pointer(p)).FpNext { - if ((int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) && ((tr_tm & int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)) != 0)) && + if ((int32((*Trigger)(unsafe.Pointer(p)).Fop) == op) && + ((tr_tm & int32((*Trigger)(unsafe.Pointer(p)).Ftr_tm)) != 0)) && (checkColumnOverlap(tls, (*Trigger)(unsafe.Pointer(p)).FpColumns, pChanges) != 0) { - var pPrg uintptr - pPrg = getRowTrigger(tls, pParse, p, pTab, orconf) - if pPrg != 0 { - mask = mask | (*(*U32)(unsafe.Pointer((pPrg + 28 /* &.aColmask */) + uintptr(isNew)*4))) + if (*Trigger)(unsafe.Pointer(p)).FbReturning != 0 { + mask = 0xffffffff + } else { + var pPrg uintptr + pPrg = getRowTrigger(tls, pParse, p, pTab, orconf) + if pPrg != 0 { + mask = mask | (*(*U32)(unsafe.Pointer((pPrg + 28 /* &.aColmask */) + uintptr(isNew)*4))) + } } } } @@ -119403,7 +121320,7 @@ func Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pCh // (not a virtual table) then the value might have been stored as an // integer. In that case, add an OP_RealAffinity opcode to make sure // it has been converted into REAL. -func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg int32) { /* sqlite3.c:137662:21: */ +func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg int32) { /* sqlite3.c:139875:21: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -119411,7 +121328,7 @@ func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg *(*uintptr)(unsafe.Pointer(bp + 16 /* pValue */)) = uintptr(0) var enc U8 = (*Sqlite3)(unsafe.Pointer(Xsqlite3VdbeDb(tls, v))).Fenc var pCol uintptr = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32) - Xsqlite3VdbeComment(tls, v, ts+9997 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer(pCol)).FzName)) + Xsqlite3VdbeComment(tls, v, ts+10090 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer(pCol)).FzName)) Xsqlite3ValueFromExpr(tls, Xsqlite3VdbeDb(tls, v), (*Column)(unsafe.Pointer(pCol)).FpDflt, enc, uint8((*Column)(unsafe.Pointer(pCol)).Faffinity), bp+16 /* &pValue */) @@ -119433,7 +121350,7 @@ func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg // aXRef[j] will be non-negative if column j of the original table is // being updated. chngRowid will be true if the rowid of the table is // being updated. -func indexColumnIsBeingUpdated(tls *libc.TLS, pIdx uintptr, iCol int32, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:137694:12: */ +func indexColumnIsBeingUpdated(tls *libc.TLS, pIdx uintptr, iCol int32, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:139907:12: */ var iIdxCol I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2)) // Cannot index rowid if int32(iIdxCol) >= 0 { @@ -119454,7 +121371,7 @@ func indexColumnIsBeingUpdated(tls *libc.TLS, pIdx uintptr, iCol int32, aXRef ui // aXRef[j] will be non-negative if column j of the original table is // being updated. chngRowid will be true if the rowid of the table is // being updated. -func indexWhereClauseMightChange(tls *libc.TLS, pIdx uintptr, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:137724:12: */ +func indexWhereClauseMightChange(tls *libc.TLS, pIdx uintptr, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:139937:12: */ if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) { return 0 } @@ -119466,7 +121383,7 @@ func indexWhereClauseMightChange(tls *libc.TLS, pIdx uintptr, aXRef uintptr, chn // Expr.iColumn set to value (iCol+1). The resolver will modify the // expression to be a TK_COLUMN reading column iCol of the first // table in the source-list (pSrc->a[0]). -func exprRowColumn(tls *libc.TLS, pParse uintptr, iCol int32) uintptr { /* sqlite3.c:137740:13: */ +func exprRowColumn(tls *libc.TLS, pParse uintptr, iCol int32) uintptr { /* sqlite3.c:139953:13: */ var pRet uintptr = Xsqlite3PExpr(tls, pParse, TK_ROW, uintptr(0), uintptr(0)) if pRet != 0 { (*Expr)(unsafe.Pointer(pRet)).FiColumn = (YnVar(iCol + 1)) @@ -119510,7 +121427,7 @@ func exprRowColumn(tls *libc.TLS, pParse uintptr, iCol int32) uintptr { /* sqlit // records with automatically assigned integer keys For intkey tables, the // rowid value in is used as the integer key, and the // remaining fields make up the table record. -func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pChanges uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:137784:13: */ +func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pChanges uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:139997:13: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -119523,7 +121440,7 @@ func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pC var pLimit2 uintptr = uintptr(0) var pOrderBy2 uintptr = uintptr(0) var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - var pTab uintptr = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab + var pTab uintptr = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab var pSrc uintptr var pWhere2 uintptr var eDest int32 @@ -119535,16 +121452,20 @@ func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pC pWhere2 = Xsqlite3ExprDup(tls, db, pWhere, 0) if pSrc != 0 { - (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor = -1 - (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab)).FnTabRef-- - (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab = uintptr(0) + (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor = -1 + (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab)).FnTabRef-- + (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FpTab = uintptr(0) } if pPk != 0 { for i = 0; i < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); i++ { var pNew uintptr = exprRowColumn(tls, pParse, int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) pList = Xsqlite3ExprListAppend(tls, pParse, pList, pNew) } - eDest = SRT_Upfrom + if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { + eDest = SRT_Table + } else { + eDest = SRT_Upfrom + } } else if (*Table)(unsafe.Pointer(pTab)).FpSelect != 0 { for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ { pList = Xsqlite3ExprListAppend(tls, pParse, pList, exprRowColumn(tls, pParse, i)) @@ -119584,7 +121505,7 @@ func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pC // onError | pChanges | pWhere // \_______________________/ // pTabList -func Xsqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { /* sqlite3.c:137878:21: */ +func Xsqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { /* sqlite3.c:140091:21: */ bp := tls.Alloc(108) defer tls.Free(108) @@ -119734,7 +121655,7 @@ __4: // allocate enough space, just in case. iBaseCur = libc.AssignInt32(&iDataCur, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)) iIdxCur = (iDataCur + 1) - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { pPk = uintptr(0) } else { pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) @@ -119770,7 +121691,7 @@ __7: (*Parse)(unsafe.Pointer(pParse)).FnTab = iBaseCur __9: ; - (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor = iDataCur + (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor = iDataCur // Allocate space for aXRef[], aRegIdx[], and aToOpen[]. // Initialize aXRef[] and aToOpen[] to their default values. @@ -119861,7 +121782,7 @@ __25: } Xsqlite3ErrorMsg(tls, pParse, - ts+21973, /* "cannot UPDATE ge..." */ + ts+22437, /* "cannot UPDATE ge..." */ libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*32)).FzName)) goto update_cleanup __27: @@ -119893,7 +121814,7 @@ __21: iRowidExpr = i goto __30 __29: - Xsqlite3ErrorMsg(tls, pParse, ts+22009 /* "no such column: ..." */, libc.VaList(bp+8, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*32)).FzEName)) + Xsqlite3ErrorMsg(tls, pParse, ts+22473 /* "no such column: ..." */, libc.VaList(bp+8, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*32)).FzEName)) (*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1) goto update_cleanup __30: @@ -119904,7 +121825,7 @@ __28: rc = Xsqlite3AuthCheck(tls, pParse, SQLITE_UPDATE, (*Table)(unsafe.Pointer(pTab)).FzName, func() uintptr { if j < 0 { - return ts + 9563 /* "ROWID" */ + return ts + 9656 /* "ROWID" */ } return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*32)).FzName }(), @@ -119940,7 +121861,7 @@ __17: // is non-negative, so the value of aXRef[] for generated columns can be // set to any non-negative number. We use 99999 so that the value is // obvious when looking at aXRef[] in a symbolic debugger. - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { goto __34 } @@ -119993,7 +121914,7 @@ __34: // So reset the colUsed mask. Unless this is a virtual table. In that // case, set all bits of the colUsed mask (to ensure that the virtual // table implementation makes all columns available). - (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FcolUsed = func() uint64 { + (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FcolUsed = func() uint64 { if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { return libc.Uint64(libc.Uint64FromInt32(-1)) } @@ -120161,9 +122082,10 @@ __64: // Not an UPSERT. Normal processing. Begin by // initialize the count of updated rows - if !((((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) && + if !(((((((*Sqlite3)(unsafe.Pointer(db)).Fflags & (U64((uint64(0x00001))) << 32)) != uint64(0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) && !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) && + !(int32((*Parse)(unsafe.Pointer(pParse)).FbReturning) != 0)) && (pUpsert == uintptr(0))) { goto __65 } @@ -120172,10 +122094,12 @@ __64: __65: ; - if !((nChangeFrom == 0) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) { + if !((nChangeFrom == 0) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) { goto __66 } Xsqlite3VdbeAddOp3(tls, v, OP_Null, 0, regRowSet, regOldRowid) + iEph = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) + addrOpen = Xsqlite3VdbeAddOp3(tls, v, OP_OpenEphemeral, iEph, 0, regRowSet) goto __67 __66: ; @@ -120265,7 +122189,7 @@ __76: // be deleted as a result of REPLACE conflict handling. Any of these // things might disturb a cursor being used to scan through the table // or index, causing a single-pass approach to malfunction. - flags = (WHERE_ONEPASS_DESIRED | WHERE_SEEK_UNIQ_TABLE) + flags = WHERE_ONEPASS_DESIRED if !((((!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) && !(pTrigger != 0)) && !(hasFK != 0)) && !(chngKey != 0)) && !(*(*int32)(unsafe.Pointer(bp + 104 /* bReplace */)) != 0)) { goto __78 } @@ -120314,7 +122238,7 @@ __80: __77: ; - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { goto __83 } // Read the rowid of the current row of the WHERE scan. In ONEPASS_OFF @@ -120324,10 +122248,17 @@ __77: if !(eOnePass == ONEPASS_OFF) { goto __85 } - // We need to use regRowSet, so reallocate aRegIdx[nAllIdx] *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) - Xsqlite3VdbeAddOp2(tls, v, OP_RowSetAdd, regRowSet, regOldRowid) + Xsqlite3VdbeAddOp3(tls, v, OP_Insert, iEph, regRowSet, regOldRowid) + goto __86 __85: + if !(addrOpen != 0) { + goto __87 + } + Xsqlite3VdbeChangeToNoop(tls, v, addrOpen) +__87: + ; +__86: ; goto __84 __83: @@ -120337,37 +122268,37 @@ __83: // the OP_OpenEphemeral instruction to a Noop (the ephemeral table // is not required) and leave the PK fields in the array of registers. i = 0 -__86: +__88: if !(i < int32(nPk)) { - goto __88 + goto __90 } Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), (iPk + i)) - goto __87 -__87: + goto __89 +__89: i++ - goto __86 goto __88 -__88: + goto __90 +__90: ; if !(eOnePass != 0) { - goto __89 - } - if !(addrOpen != 0) { goto __91 } + if !(addrOpen != 0) { + goto __93 + } Xsqlite3VdbeChangeToNoop(tls, v, addrOpen) -__91: +__93: ; nKey = int32(nPk) regKey = iPk - goto __90 -__89: + goto __92 +__91: Xsqlite3VdbeAddOp4(tls, v, OP_MakeRecord, iPk, int32(nPk), regKey, Xsqlite3IndexAffinityStr(tls, db, pPk), int32(nPk)) Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, iEph, regKey, iPk, int32(nPk)) -__90: +__92: ; __84: ; @@ -120375,73 +122306,73 @@ __75: ; if !(pUpsert == uintptr(0)) { - goto __92 + goto __94 } if !((nChangeFrom == 0) && (eOnePass != ONEPASS_MULTI)) { - goto __93 + goto __95 } Xsqlite3WhereEnd(tls, pWInfo) -__93: +__95: ; if !(!(isView != 0)) { - goto __94 + goto __96 } addrOnce = 0 // Open every index that needs updating. if !(eOnePass != ONEPASS_OFF) { - goto __95 - } - if !(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */)) >= 0) { - goto __96 - } - *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */)) - iBaseCur)))) = U8(0) -__96: - ; - if !(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + 1*4)) >= 0) { goto __97 } - *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + 1*4)) - iBaseCur)))) = U8(0) -__97: + if !(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */)) >= 0) { + goto __98 + } + *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */)) - iBaseCur)))) = U8(0) +__98: ; -__95: + if !(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + 1*4)) >= 0) { + goto __99 + } + *(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + 1*4)) - iBaseCur)))) = U8(0) +__99: + ; +__97: ; if !((eOnePass == ONEPASS_MULTI) && ((nIdx - (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + 1*4)) >= 0))) > 0)) { - goto __98 + goto __100 } addrOnce = Xsqlite3VdbeAddOp0(tls, v, OP_Once) -__98: +__100: ; Xsqlite3OpenTableAndIndices(tls, pParse, pTab, OP_OpenWrite, uint8(0), iBaseCur, aToOpen, uintptr(0), uintptr(0)) if !(addrOnce != 0) { - goto __99 + goto __101 } Xsqlite3VdbeJumpHereOrPopInst(tls, v, addrOnce) -__99: +__101: ; -__94: +__96: ; // Top of the update loop if !(eOnePass != ONEPASS_OFF) { - goto __100 + goto __102 } if !((!(isView != 0) && (*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */)) != iDataCur)) && (*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + 1*4)) != iDataCur)) { - goto __102 + goto __104 } Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelBreak, regKey, nKey) -__102: +__104: ; if !(eOnePass != ONEPASS_SINGLE) { - goto __103 + goto __105 } labelContinue = Xsqlite3VdbeMakeLabel(tls, pParse) -__103: +__105: ; Xsqlite3VdbeAddOp2(tls, v, OP_IsNull, func() int32 { if pPk != 0 { @@ -120450,66 +122381,67 @@ __103: return regOldRowid }(), labelBreak) - goto __101 -__100: + goto __103 +__102: if !((pPk != 0) || (nChangeFrom != 0)) { - goto __104 + goto __106 } labelContinue = Xsqlite3VdbeMakeLabel(tls, pParse) Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iEph, labelBreak) addrTop = Xsqlite3VdbeCurrentAddr(tls, v) if !(nChangeFrom != 0) { - goto __106 - } - if !(!(isView != 0)) { goto __108 } + if !(!(isView != 0)) { + goto __110 + } if !(pPk != 0) { - goto __109 + goto __111 } i = 0 -__111: +__113: if !(i < int32(nPk)) { - goto __113 + goto __115 } Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, i, (iPk + i)) - goto __112 -__112: + goto __114 +__114: i++ - goto __111 goto __113 -__113: + goto __115 +__115: ; Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelContinue, iPk, int32(nPk)) - goto __110 -__109: + goto __112 +__111: Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iEph, regOldRowid) Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, labelContinue, regOldRowid) +__112: + ; __110: ; + goto __109 __108: - ; - goto __107 -__106: Xsqlite3VdbeAddOp2(tls, v, OP_RowData, iEph, regKey) Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelContinue, regKey, 0) -__107: +__109: ; - goto __105 -__104: - labelContinue = Xsqlite3VdbeAddOp3(tls, v, OP_RowSetRead, regRowSet, labelBreak, - regOldRowid) + goto __107 +__106: + Xsqlite3VdbeAddOp2(tls, v, OP_Rewind, iEph, labelBreak) + labelContinue = Xsqlite3VdbeMakeLabel(tls, pParse) + addrTop = Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iEph, regOldRowid) Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, labelContinue, regOldRowid) -__105: +__107: ; -__101: +__103: ; -__92: +__94: ; // If the rowid value will change, set register regNewRowid to @@ -120518,26 +122450,26 @@ __92: // already populated. if !(chngRowid != 0) { - goto __114 + goto __116 } if !(nChangeFrom == 0) { - goto __115 + goto __117 } Xsqlite3ExprCode(tls, pParse, pRowidExpr, regNewRowid) - goto __116 -__115: + goto __118 +__117: Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, iRowidExpr, regNewRowid) -__116: +__118: ; Xsqlite3VdbeAddOp1(tls, v, OP_MustBeInt, regNewRowid) -__114: +__116: ; // Compute the old pre-UPDATE content of the row being changed, if that // information is needed if !(((chngPk != 0) || (hasFK != 0)) || (pTrigger != 0)) { - goto __117 + goto __119 } oldmask = func() uint32 { if hasFK != 0 { @@ -120548,38 +122480,38 @@ __114: oldmask = oldmask | (Xsqlite3TriggerColmask(tls, pParse, pTrigger, pChanges, 0, (TRIGGER_BEFORE | TRIGGER_AFTER), pTab, onError)) i = 0 -__118: +__120: if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __120 + goto __122 } colFlags = U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)).FcolFlags) k = (int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + regOld) if !(((oldmask == 0xffffffff) || ((i < 32) && ((oldmask & (uint32((uint32(1))) << (i))) != U32(0)))) || - ((colFlags & COLFLAG_PRIMKEY) != U32(0))) { - goto __121 + ((colFlags & U32(COLFLAG_PRIMKEY)) != U32(0))) { + goto __123 } Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) - goto __122 -__121: + goto __124 +__123: Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, k) +__124: + ; + goto __121 +__121: + i++ + goto __120 + goto __122 __122: - ; - goto __119 -__119: - i++ - goto __118 - goto __120 -__120: ; if !((int32(chngRowid) == 0) && (pPk == uintptr(0))) { - goto __123 + goto __125 } Xsqlite3VdbeAddOp2(tls, v, OP_Copy, regOldRowid, regNewRowid) -__123: +__125: ; -__117: +__119: ; // Populate the array of registers beginning at regNew with the new @@ -120598,33 +122530,33 @@ __117: pParse, pTrigger, pChanges, 1, TRIGGER_BEFORE, pTab, onError)) i = 0 k = regNew -__124: +__126: if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __126 + goto __128 } if !(i == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) { - goto __127 - } - Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, k) - goto __128 -__127: - if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { goto __129 } - if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) != 0) { - goto __131 - } - k-- -__131: - ; + Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, k) goto __130 __129: + if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { + goto __131 + } + if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) != 0) { + goto __133 + } + k-- +__133: + ; + goto __132 +__131: j = *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) if !(j >= 0) { - goto __132 + goto __134 } if !(nChangeFrom != 0) { - goto __134 + goto __136 } nOff = func() int32 { if isView != 0 { @@ -120634,15 +122566,15 @@ __129: }() Xsqlite3VdbeAddOp3(tls, v, OP_Column, iEph, (nOff + j), k) + goto __137 +__136: + Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(j)*32)).FpExpr, k) +__137: + ; goto __135 __134: - Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(j)*32)).FpExpr, k) -__135: - ; - goto __133 -__132: if !(((0 == (*(*int32)(unsafe.Pointer(bp + 32 /* tmask */)) & TRIGGER_BEFORE)) || (i > 31)) || ((uint32(newmask) & (uint32((uint32(1))) << (i))) != 0)) { - goto __136 + goto __138 } // This branch loads the value of a column that will not be changed // into a register. This is done if there are no BEFORE triggers, or @@ -120651,44 +122583,44 @@ __132: Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) bFinishSeek = 0 - goto __137 -__136: + goto __139 +__138: Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, k) -__137: +__139: ; -__133: +__135: + ; +__132: ; __130: ; -__128: - ; - goto __125 -__125: + goto __127 +__127: i++ k++ - goto __124 goto __126 -__126: + goto __128 +__128: ; - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { - goto __138 + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { + goto __140 } Xsqlite3ComputeGeneratedColumns(tls, pParse, regNew, pTab) -__138: +__140: ; // Fire any BEFORE UPDATE triggers. This happens before constraints are // verified. One could argue that this is wrong. if !((*(*int32)(unsafe.Pointer(bp + 32 /* tmask */)) & TRIGGER_BEFORE) != 0) { - goto __139 + goto __141 } Xsqlite3TableAffinity(tls, v, pTab, regNew) Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, TK_UPDATE, pChanges, TRIGGER_BEFORE, pTab, regOldRowid, onError, labelContinue) if !(!(isView != 0)) { - goto __140 + goto __142 } // The row-trigger may have deleted the row being updated. In this // case, jump to the next row. No updates or AFTER triggers are @@ -120696,15 +122628,15 @@ __138: // is deleted or renamed by a BEFORE trigger - is left undefined in the // documentation. if !(pPk != 0) { - goto __141 + goto __143 } Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelContinue, regKey, nKey) - goto __142 -__141: + goto __144 +__143: Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, labelContinue, regOldRowid) -__142: +__144: ; // After-BEFORE-trigger-reload-loop: @@ -120717,51 +122649,51 @@ __142: // for an example. i = 0 k = regNew -__143: +__145: if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { - goto __145 + goto __147 } if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_GENERATED) != 0) { - goto __146 - } - if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) != 0) { goto __148 } + if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & COLFLAG_VIRTUAL) != 0) { + goto __150 + } k-- -__148: +__150: ; - goto __147 -__146: + goto __149 +__148: if !((*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) < 0) && (i != int32((*Table)(unsafe.Pointer(pTab)).FiPKey))) { - goto __149 + goto __151 } Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) +__151: + ; __149: ; -__147: - ; - goto __144 -__144: + goto __146 +__146: i++ k++ - goto __143 goto __145 -__145: + goto __147 +__147: ; - if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_HasGenerated) != 0) { - goto __150 + if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasGenerated)) != 0) { + goto __152 } Xsqlite3ComputeGeneratedColumns(tls, pParse, regNew, pTab) -__150: +__152: ; -__140: +__142: ; -__139: +__141: ; if !(!(isView != 0)) { - goto __151 + goto __153 } // Do constraint checks. @@ -120773,27 +122705,27 @@ __139: // row is changing, then the GenerateConstraintChecks() above may have // moved cursor iDataCur. Reseek it. if !((*(*int32)(unsafe.Pointer(bp + 104 /* bReplace */)) != 0) || (chngKey != 0)) { - goto __152 + goto __154 } if !(pPk != 0) { - goto __153 + goto __155 } Xsqlite3VdbeAddOp4Int(tls, v, OP_NotFound, iDataCur, labelContinue, regKey, nKey) - goto __154 -__153: + goto __156 +__155: Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iDataCur, labelContinue, regOldRowid) -__154: +__156: ; -__152: +__154: ; // Do FK constraint checks. if !(hasFK != 0) { - goto __155 + goto __157 } Xsqlite3FkCheck(tls, pParse, pTab, regOldRowid, 0, aXRef, int32(chngKey)) -__155: +__157: ; // Delete the index entries associated with the current record. @@ -120805,10 +122737,10 @@ __155: // we want to avoid the OP_FinishSeek if possible, as running it // costs CPU cycles. if !(bFinishSeek != 0) { - goto __156 + goto __158 } Xsqlite3VdbeAddOp1(tls, v, OP_FinishSeek, iDataCur) -__156: +__158: ; // If changing the rowid value, or if there are foreign key constraints @@ -120829,24 +122761,24 @@ __156: }())), regNewRowid) if !(eOnePass == ONEPASS_MULTI) { - goto __157 + goto __159 } - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_SAVEPOSITION) -__157: + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) +__159: ; if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) { - goto __158 + goto __160 } Xsqlite3VdbeAppendP4(tls, v, pTab, -6) -__158: +__160: ; if !(hasFK != 0) { - goto __159 + goto __161 } Xsqlite3FkCheck(tls, pParse, pTab, 0, regNewRowid, aXRef, int32(chngKey)) -__159: +__161: ; // Insert the new index entries and the new record. @@ -120864,20 +122796,20 @@ __159: // handle rows (possibly in other tables) that refer via a foreign key // to the row just updated. if !(hasFK != 0) { - goto __160 + goto __162 } Xsqlite3FkActions(tls, pParse, pTab, pChanges, regOldRowid, aXRef, int32(chngKey)) -__160: +__162: ; -__151: +__153: ; // Increment the row counter if !(regRowCount != 0) { - goto __161 + goto __163 } Xsqlite3VdbeAddOp2(tls, v, OP_AddImm, regRowCount, 1) -__161: +__163: ; Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, TK_UPDATE, pChanges, @@ -120886,32 +122818,24 @@ __161: // Repeat the above with the next record to be updated, until // all record selected by the WHERE clause have been updated. if !(eOnePass == ONEPASS_SINGLE) { - goto __162 - } - // Nothing to do at end-of-loop for a single-pass - goto __163 -__162: - if !(eOnePass == ONEPASS_MULTI) { goto __164 } - Xsqlite3VdbeResolveLabel(tls, v, labelContinue) - Xsqlite3WhereEnd(tls, pWInfo) + // Nothing to do at end-of-loop for a single-pass goto __165 __164: - if !((pPk != 0) || (nChangeFrom != 0)) { + if !(eOnePass == ONEPASS_MULTI) { goto __166 } Xsqlite3VdbeResolveLabel(tls, v, labelContinue) - Xsqlite3VdbeAddOp2(tls, v, OP_Next, iEph, addrTop) + Xsqlite3WhereEnd(tls, pWInfo) goto __167 __166: - Xsqlite3VdbeGoto(tls, v, labelContinue) + Xsqlite3VdbeResolveLabel(tls, v, labelContinue) + Xsqlite3VdbeAddOp2(tls, v, OP_Next, iEph, addrTop) __167: ; __165: ; -__163: - ; Xsqlite3VdbeResolveLabel(tls, v, labelBreak) // Update the sqlite_sequence table by storing the content of the @@ -120929,9 +122853,9 @@ __168: if !(regRowCount != 0) { goto __169 } - Xsqlite3VdbeAddOp2(tls, v, OP_ResultRow, regRowCount, 1) + Xsqlite3VdbeAddOp2(tls, v, OP_ChngCntRow, regRowCount, 1) Xsqlite3VdbeSetNumCols(tls, v, 1) - Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+22028 /* "rows updated" */, uintptr(0)) + Xsqlite3VdbeSetColName(tls, v, 0, COLNAME_NAME, ts+22492 /* "rows updated" */, uintptr(0)) __169: ; @@ -120967,7 +122891,7 @@ update_cleanup: // 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 *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pChanges uintptr, pRowid uintptr, aXRef uintptr, pWhere uintptr, onError int32) { /* sqlite3.c:138757:13: */ +func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pChanges uintptr, pRowid uintptr, aXRef uintptr, pWhere uintptr, onError int32) { /* sqlite3.c:140973:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -120977,11 +122901,11 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database connection var pVTab uintptr = Xsqlite3GetVTable(tls, db, pTab) var pWInfo uintptr = uintptr(0) - var nArg int32 = (2 + int32((*Table)(unsafe.Pointer(pTab)).FnCol)) // Number of arguments to VUpdate - var regArg int32 // First register in VUpdate arg array - var regRec int32 // Register in which to assemble record - var regRowid int32 // Register for ephem table rowid - var iCsr int32 = (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor // Cursor used for virtual table scan + var nArg int32 = (2 + int32((*Table)(unsafe.Pointer(pTab)).FnCol)) // Number of arguments to VUpdate + var regArg int32 // First register in VUpdate arg array + var regRec int32 // Register in which to assemble record + var regRowid int32 // Register for ephem table rowid + var iCsr int32 = (*SrcItem)(unsafe.Pointer((pSrc + 8 /* &.a */))).FiCursor // Cursor used for virtual table scan // var aDummy [2]int32 at bp, 8 // Unused arg for sqlite3WhereOkOnePass() var eOnePass int32 // True to use onepass strategy @@ -120996,12 +122920,25 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt regArg = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1) *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (nArg) if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1 { + var pPk uintptr = uintptr(0) var pRow uintptr var pList uintptr - if pRowid != 0 { - pRow = Xsqlite3ExprDup(tls, db, pRowid, 0) + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + if pRowid != 0 { + pRow = Xsqlite3ExprDup(tls, db, pRowid, 0) + } else { + pRow = Xsqlite3PExpr(tls, pParse, TK_ROW, uintptr(0), uintptr(0)) + } } else { - pRow = Xsqlite3PExpr(tls, pParse, TK_ROW, uintptr(0), uintptr(0)) + var iPk I16 // PRIMARY KEY column + pPk = Xsqlite3PrimaryKeyIndex(tls, pTab) + + iPk = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn)) + if *(*int32)(unsafe.Pointer(aXRef + uintptr(iPk)*4)) >= 0 { + pRow = Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(iPk)*4)))*32)).FpExpr, 0) + } else { + pRow = exprRowColumn(tls, pParse, int32(iPk)) + } } pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), pRow) @@ -121014,7 +122951,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt } } - updateFromSelect(tls, pParse, ephemTab, uintptr(0), pList, pSrc, pWhere, uintptr(0), uintptr(0)) + updateFromSelect(tls, pParse, ephemTab, pPk, pList, pSrc, pWhere, uintptr(0), uintptr(0)) Xsqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { @@ -121022,7 +122959,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt regRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Start scanning the virtual table - pWInfo = Xsqlite3WhereBegin(tls, pParse, pSrc, pWhere, uintptr(0), uintptr(0), WHERE_ONEPASS_DESIRED, 0) + pWInfo = Xsqlite3WhereBegin(tls, pParse, pSrc, pWhere, uintptr(0), uintptr(0), uint16(WHERE_ONEPASS_DESIRED), 0) if pWInfo == uintptr(0) { return } @@ -121034,10 +122971,10 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*32)).FpExpr, ((regArg + 2) + i)) } else { Xsqlite3VdbeAddOp3(tls, v, OP_VColumn, iCsr, i, ((regArg + 2) + i)) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_NOCHNG) // For sqlite3_vtab_nochange() + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_NOCHNG)) // For sqlite3_vtab_nochange() } } - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3VdbeAddOp2(tls, v, OP_Rowid, iCsr, regArg) if pRowid != 0 { Xsqlite3ExprCode(tls, pParse, pRowid, (regArg + 1)) @@ -121092,7 +123029,7 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt Xsqlite3VdbeAddOp4(tls, v, OP_VUpdate, 0, nArg, regArg, pVTab, -12) Xsqlite3VdbeChangeP5(tls, v, func() uint16 { if onError == OE_Default { - return OE_Abort + return uint16(OE_Abort) } return uint16(onError) }()) @@ -121126,18 +123063,27 @@ func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintpt // #include "sqliteInt.h" // Free a list of Upsert objects -func Xsqlite3UpsertDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:138929:21: */ - if p != 0 { +func upsertDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:141159:29: */ + for ok := true; ok; ok = p != 0 { + var pNext uintptr = (*Upsert)(unsafe.Pointer(p)).FpNextUpsert Xsqlite3ExprListDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTarget) Xsqlite3ExprDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTargetWhere) Xsqlite3ExprListDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertSet) Xsqlite3ExprDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertWhere) + Xsqlite3DbFree(tls, db, (*Upsert)(unsafe.Pointer(p)).FpToFree) Xsqlite3DbFree(tls, db, p) + p = pNext + } +} + +func Xsqlite3UpsertDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:141171:21: */ + if p != 0 { + upsertDelete(tls, db, p) } } // Duplicate an Upsert object. -func Xsqlite3UpsertDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:138942:23: */ +func Xsqlite3UpsertDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:141179:23: */ if p == uintptr(0) { return uintptr(0) } @@ -121145,25 +123091,28 @@ func Xsqlite3UpsertDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite Xsqlite3ExprListDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTarget, 0), Xsqlite3ExprDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTargetWhere, 0), Xsqlite3ExprListDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertSet, 0), - Xsqlite3ExprDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertWhere, 0)) + Xsqlite3ExprDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertWhere, 0), + Xsqlite3UpsertDup(tls, db, (*Upsert)(unsafe.Pointer(p)).FpNextUpsert)) } // Create a new Upsert object. -func Xsqlite3UpsertNew(tls *libc.TLS, db uintptr, pTarget uintptr, pTargetWhere uintptr, pSet uintptr, pWhere uintptr) uintptr { /* sqlite3.c:138955:23: */ +func Xsqlite3UpsertNew(tls *libc.TLS, db uintptr, pTarget uintptr, pTargetWhere uintptr, pSet uintptr, pWhere uintptr, pNext uintptr) uintptr { /* sqlite3.c:141193:23: */ var pNew uintptr - pNew = Xsqlite3DbMallocRaw(tls, db, uint64(unsafe.Sizeof(Upsert{}))) + pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Upsert{}))) if pNew == uintptr(0) { Xsqlite3ExprListDelete(tls, db, pTarget) Xsqlite3ExprDelete(tls, db, pTargetWhere) Xsqlite3ExprListDelete(tls, db, pSet) Xsqlite3ExprDelete(tls, db, pWhere) + Xsqlite3UpsertDelete(tls, db, pNext) return uintptr(0) } else { (*Upsert)(unsafe.Pointer(pNew)).FpUpsertTarget = pTarget (*Upsert)(unsafe.Pointer(pNew)).FpUpsertTargetWhere = pTargetWhere (*Upsert)(unsafe.Pointer(pNew)).FpUpsertSet = pSet (*Upsert)(unsafe.Pointer(pNew)).FpUpsertWhere = pWhere - (*Upsert)(unsafe.Pointer(pNew)).FpUpsertIdx = uintptr(0) + (*Upsert)(unsafe.Pointer(pNew)).FisDoUpdate = (U8(libc.Bool32(pSet != uintptr(0)))) + (*Upsert)(unsafe.Pointer(pNew)).FpNextUpsert = pNext } return pNew } @@ -121173,9 +123122,9 @@ func Xsqlite3UpsertNew(tls *libc.TLS, db uintptr, pTarget uintptr, pTargetWhere // // Return SQLITE_OK if everything works, or an error code is something // is wrong. -func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr, pUpsert uintptr) int32 { /* sqlite3.c:138987:20: */ - bp := tls.Alloc(200) - defer tls.Free(200) +func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr, pUpsert uintptr) int32 { /* sqlite3.c:141228:20: */ + bp := tls.Alloc(232) + defer tls.Free(232) var pTab uintptr // That table into which we are inserting var rc int32 // Result code @@ -121183,107 +123132,167 @@ func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr var pIdx uintptr // One of the indexes of pTab var pTarget uintptr // The conflict-target clause var pTerm uintptr // One term of the conflict-target clause - // var sNC NameContext at bp, 56 + // var sNC NameContext at bp+16, 56 // Context for resolving symbolic names - // var sCol [2]Expr at bp+56, 144 + // var sCol [2]Expr at bp+72, 144 // Index column converted into an Expr + var nClause int32 = 0 // Counter of ON CONFLICT clauses // Resolve all symbolic names in the conflict-target clause, which // includes both the list of columns and the optional partial-index // WHERE clause. - libc.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) - (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = pParse - (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = pTabList - rc = Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget) - if rc != 0 { - return rc + libc.Xmemset(tls, bp+16 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{}))) + (*NameContext)(unsafe.Pointer(bp + 16 /* &sNC */)).FpParse = pParse + (*NameContext)(unsafe.Pointer(bp + 16 /* &sNC */)).FpSrcList = pTabList +__1: + if !((pUpsert != 0) && ((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget != 0)) { + goto __3 } - rc = Xsqlite3ResolveExprNames(tls, bp /* &sNC */, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere) - if rc != 0 { - return rc - } - - // Check to see if the conflict target matches the rowid. - pTab = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab - pTarget = (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget - iCursor = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor - if (((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && - ((*ExprList)(unsafe.Pointer(pTarget)).FnExpr == 1)) && - (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pTerm, (*ExprList_item)(unsafe.Pointer((pTarget + 8 /* &.a */))).FpExpr)))).Fop) == TK_COLUMN)) && - (int32((*Expr)(unsafe.Pointer(pTerm)).FiColumn) == (-1)) { - // The conflict-target is the rowid of the primary table - - return SQLITE_OK - } - - // Initialize sCol[0..1] to be an expression parse tree for a - // single column of an index. The sCol[0] node will be the TK_COLLATE - // operator and sCol[1] will be the TK_COLUMN operator. Code below - // will populate the specific collation and column number values - // prior to comparing against the conflict-target expression. - libc.Xmemset(tls, bp+56 /* &sCol[0] */, 0, uint64(unsafe.Sizeof([2]Expr{}))) - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).Fop = TK_COLLATE - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).FpLeft = (bp + 56 /* &sCol */ + 1*72) - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + 1*72)).Fop = TK_COLUMN - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + 1*72)).FiTable = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor - - // Check for matches against other indexes - for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext { - var ii int32 - var jj int32 - var nn int32 - if !(int32((*Index)(unsafe.Pointer((pIdx))).FonError) != OE_None) { - continue + { + rc = Xsqlite3ResolveExprListNames(tls, bp+16 /* &sNC */, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget) + if rc != 0 { + return rc } - if (*ExprList)(unsafe.Pointer(pTarget)).FnExpr != int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) { - continue + rc = Xsqlite3ResolveExprNames(tls, bp+16 /* &sNC */, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere) + if rc != 0 { + return rc } - if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { - if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere == uintptr(0) { + + // Check to see if the conflict target matches the rowid. + pTab = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab + pTarget = (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget + iCursor = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor + if (((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && + ((*ExprList)(unsafe.Pointer(pTarget)).FnExpr == 1)) && + (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pTerm, (*ExprList_item)(unsafe.Pointer((pTarget + 8 /* &.a */))).FpExpr)))).Fop) == TK_COLUMN)) && + (int32((*Expr)(unsafe.Pointer(pTerm)).FiColumn) == (-1)) { + // The conflict-target is the rowid of the primary table + + goto __2 + } + + // Initialize sCol[0..1] to be an expression parse tree for a + // single column of an index. The sCol[0] node will be the TK_COLLATE + // operator and sCol[1] will be the TK_COLUMN operator. Code below + // will populate the specific collation and column number values + // prior to comparing against the conflict-target expression. + libc.Xmemset(tls, bp+72 /* &sCol[0] */, 0, uint64(unsafe.Sizeof([2]Expr{}))) + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */)).Fop = U8(TK_COLLATE) + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */)).FpLeft = (bp + 72 /* &sCol */ + 1*72) + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */ + 1*72)).Fop = U8(TK_COLUMN) + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */ + 1*72)).FiTable = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor + + // Check for matches against other indexes + for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext { + var ii int32 + var jj int32 + var nn int32 + if !(int32((*Index)(unsafe.Pointer((pIdx))).FonError) != OE_None) { continue } - if Xsqlite3ExprCompare(tls, pParse, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere, - (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCursor) != 0 { + if (*ExprList)(unsafe.Pointer(pTarget)).FnExpr != int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) { continue } - } - nn = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) - for ii = 0; ii < nn; ii++ { - var pExpr uintptr - *(*uintptr)(unsafe.Pointer(bp + 56 /* &sCol */ + 8 /* &.u */)) = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(ii)*8)) - if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2))) == (-2) { - - pExpr = (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr + 8 /* &.a */) + uintptr(ii)*32)).FpExpr - if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLLATE { - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).FpLeft = pExpr - pExpr = (bp + 56 /* &sCol */) + if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere == uintptr(0) { + continue } + if Xsqlite3ExprCompare(tls, pParse, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere, + (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCursor) != 0 { + continue + } + } + nn = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) + for ii = 0; ii < nn; ii++ { + var pExpr uintptr + *(*uintptr)(unsafe.Pointer(bp + 72 /* &sCol */ + 8 /* &.u */)) = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(ii)*8)) + if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2))) == (-2) { + + pExpr = (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr + 8 /* &.a */) + uintptr(ii)*32)).FpExpr + if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLLATE { + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */)).FpLeft = pExpr + pExpr = (bp + 72 /* &sCol */) + } + } else { + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */)).FpLeft = (bp + 72 /* &sCol */ + 1*72) + (*Expr)(unsafe.Pointer(bp + 72 /* &sCol */ + 1*72)).FiColumn = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2)) + pExpr = (bp + 72 /* &sCol */) + } + for jj = 0; jj < nn; jj++ { + if Xsqlite3ExprCompare(tls, pParse, (*ExprList_item)(unsafe.Pointer((pTarget+8 /* &.a */)+uintptr(jj)*32)).FpExpr, pExpr, iCursor) < 2 { + break // Column ii of the index matches column jj of target + } + } + if jj >= nn { + // The target contains no match for column jj of the index + break + } + } + if ii < nn { + // Column ii of the index did not match any term of the conflict target. + // Continue the search with the next index. + continue + } + (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx = pIdx + break + } + if (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx == uintptr(0) { + // var zWhich [16]int8 at bp+216, 16 + + if (nClause == 0) && ((*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0)) { + *(*int8)(unsafe.Pointer(bp + 216 /* &zWhich[0] */)) = int8(0) } else { - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */)).FpLeft = (bp + 56 /* &sCol */ + 1*72) - (*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + 1*72)).FiColumn = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(ii)*2)) - pExpr = (bp + 56 /* &sCol */) - } - for jj = 0; jj < nn; jj++ { - if Xsqlite3ExprCompare(tls, pParse, (*ExprList_item)(unsafe.Pointer((pTarget+8 /* &.a */)+uintptr(jj)*32)).FpExpr, pExpr, iCursor) < 2 { - break // Column ii of the index matches column jj of target - } - } - if jj >= nn { - // The target contains no match for column jj of the index - break + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([16]int8{})), bp+216 /* &zWhich[0] */, ts+22505 /* "%r " */, libc.VaList(bp, (nClause+1))) } + Xsqlite3ErrorMsg(tls, pParse, + ts+22509 /* "%sON CONFLICT cl..." */, libc.VaList(bp+8, bp+216 /* &zWhich[0] */)) + return SQLITE_ERROR } - if ii < nn { - // Column ii of the index did not match any term of the conflict target. - // Continue the search with the next index. - continue - } - (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx = pIdx - return SQLITE_OK + } - Xsqlite3ErrorMsg(tls, pParse, - ts+22041 /* "ON CONFLICT clau..." */, 0) - return SQLITE_ERROR + goto __2 +__2: + pUpsert = (*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert + nClause++ + goto __1 + goto __3 +__3: + ; + return SQLITE_OK +} + +// Return true if pUpsert is the last ON CONFLICT clause with a +// conflict target, or if pUpsert is followed by another ON CONFLICT +// clause that targets the INTEGER PRIMARY KEY. +func Xsqlite3UpsertNextIsIPK(tls *libc.TLS, pUpsert uintptr) int32 { /* sqlite3.c:141355:20: */ + var pNext uintptr + if pUpsert == uintptr(0) { + return 0 + } + pNext = (*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert + if pNext == uintptr(0) { + return 1 + } + if (*Upsert)(unsafe.Pointer(pNext)).FpUpsertTarget == uintptr(0) { + return 1 + } + if (*Upsert)(unsafe.Pointer(pNext)).FpUpsertIdx == uintptr(0) { + return 1 + } + return 0 +} + +// Given the list of ON CONFLICT clauses described by pUpsert, and +// a particular index pIdx, return a pointer to the particular ON CONFLICT +// clause that applies to the index. Or, if the index is not subject to +// any ON CONFLICT clause, return NULL. +func Xsqlite3UpsertOfIndex(tls *libc.TLS, pUpsert uintptr, pIdx uintptr) uintptr { /* sqlite3.c:141371:23: */ + for ((pUpsert != 0) && + ((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget != uintptr(0))) && + ((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx != pIdx) { + pUpsert = (*Upsert)(unsafe.Pointer(pUpsert)).FpNextUpsert + } + return pUpsert } // Generate bytecode that does an UPDATE as part of an upsert. @@ -121293,7 +123302,7 @@ func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr // currently points to the conflicting table row. Otherwise, if pIdx // is not NULL, then pIdx is the constraint that failed and iCur is a // cursor points to the conflicting row. -func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab uintptr, pIdx uintptr, iCur int32) { /* sqlite3.c:139105:21: */ +func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab uintptr, pIdx uintptr, iCur int32) { /* sqlite3.c:141391:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -121302,11 +123311,13 @@ func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab var pSrc uintptr // FROM clause for the UPDATE var iDataCur int32 var i int32 + var pTop uintptr = pUpsert - Xsqlite3VdbeNoopComment(tls, v, ts+22112 /* "Begin DO UPDATE ..." */, 0) iDataCur = (*Upsert)(unsafe.Pointer(pUpsert)).FiDataCur + pUpsert = Xsqlite3UpsertOfIndex(tls, pTop, pIdx) + Xsqlite3VdbeNoopComment(tls, v, ts+22582 /* "Begin DO UPDATE ..." */, 0) if (pIdx != 0) && (iCur != iDataCur) { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { var regRowid int32 = Xsqlite3GetTempReg(tls, pParse) Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iCur, regRowid) Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, iDataCur, 0, regRowid) @@ -121322,31 +123333,29 @@ func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab k = int32(Xsqlite3TableColumnToIndex(tls, pIdx, *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) Xsqlite3VdbeAddOp3(tls, v, OP_Column, iCur, k, (iPk + i)) - Xsqlite3VdbeComment(tls, v, ts+9997 /* "%s.%s" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))*32)).FzName)) + Xsqlite3VdbeComment(tls, v, ts+10090 /* "%s.%s" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))*32)).FzName)) } i = Xsqlite3VdbeAddOp4Int(tls, v, OP_Found, iDataCur, 0, iPk, nPk) Xsqlite3VdbeAddOp4(tls, v, OP_Halt, SQLITE_CORRUPT, OE_Abort, 0, - ts+13355 /* "corrupt database" */, -1) + ts+13768 /* "corrupt database" */, -1) Xsqlite3MayAbort(tls, pParse) Xsqlite3VdbeJumpHere(tls, v, i) } } - // pUpsert does not own pUpsertSrc - the outer INSERT statement does. So - // we have to make a copy before passing it down into sqlite3Update() - pSrc = Xsqlite3SrcListDup(tls, db, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc, 0) + // pUpsert does not own pTop->pUpsertSrc - the outer INSERT statement does. + // So we have to make a copy before passing it down into sqlite3Update() + pSrc = Xsqlite3SrcListDup(tls, db, (*Upsert)(unsafe.Pointer(pTop)).FpUpsertSrc, 0) // excluded.* columns of type REAL need to be converted to a hard real for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ { if int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).Faffinity) == SQLITE_AFF_REAL { - Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, ((*Upsert)(unsafe.Pointer(pUpsert)).FregData + i)) + Xsqlite3VdbeAddOp1(tls, v, OP_RealAffinity, ((*Upsert)(unsafe.Pointer(pTop)).FregData + i)) } } - Xsqlite3Update(tls, pParse, pSrc, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet, - (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertWhere, OE_Abort, uintptr(0), uintptr(0), pUpsert) - (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet = uintptr(0) // Will have been deleted by sqlite3Update() - (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertWhere = uintptr(0) // Will have been deleted by sqlite3Update() - Xsqlite3VdbeNoopComment(tls, v, ts+22138 /* "End DO UPDATE of..." */, 0) + Xsqlite3Update(tls, pParse, pSrc, Xsqlite3ExprListDup(tls, db, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet, 0), + Xsqlite3ExprDup(tls, db, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertWhere, 0), OE_Abort, uintptr(0), uintptr(0), pUpsert) + Xsqlite3VdbeNoopComment(tls, v, ts+22608 /* "End DO UPDATE of..." */, 0) } //************* End of upsert.c ********************************************* @@ -121376,7 +123385,7 @@ func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab // // The execSqlF() routine does the same thing, except it accepts // a format string as its third argument -func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { /* sqlite3.c:139202:12: */ +func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { /* sqlite3.c:141488:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -121398,7 +123407,7 @@ func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { // then run VACUUM to get those statements to execute at inappropriate // times. if (zSubSql != 0) && - ((libc.Xstrncmp(tls, zSubSql, ts+22162 /* "CRE" */, uint64(3)) == 0) || (libc.Xstrncmp(tls, zSubSql, ts+22166 /* "INS" */, uint64(3)) == 0)) { + ((libc.Xstrncmp(tls, zSubSql, ts+22632 /* "CRE" */, uint64(3)) == 0) || (libc.Xstrncmp(tls, zSubSql, ts+22636 /* "INS" */, uint64(3)) == 0)) { rc = execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -121416,7 +123425,7 @@ func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { return rc } -func execSqlF(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr, va uintptr) int32 { /* sqlite3.c:139232:12: */ +func execSqlF(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr, va uintptr) int32 { /* sqlite3.c:141518:12: */ var z uintptr var ap Va_list _ = ap @@ -121460,7 +123469,7 @@ func execSqlF(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr, va uint // 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 Xsqlite3Vacuum(tls *libc.TLS, pParse uintptr, pNm uintptr, pInto uintptr) { /* sqlite3.c:139275:21: */ +func Xsqlite3Vacuum(tls *libc.TLS, pParse uintptr, pNm uintptr, pInto uintptr) { /* sqlite3.c:141561:21: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = pNm @@ -121517,7 +123526,7 @@ build_vacuum_end: } // This routine implements the OP_Vacuum opcode of the VDBE. -func Xsqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, pOut uintptr) int32 { /* sqlite3.c:139313:36: */ +func Xsqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, pOut uintptr) int32 { /* sqlite3.c:141599:36: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -121548,14 +123557,14 @@ func Xsqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) { goto __1 } - Xsqlite3SetString(tls, pzErrMsg, db, ts+22170 /* "cannot VACUUM fr..." */) + Xsqlite3SetString(tls, pzErrMsg, db, ts+22640 /* "cannot VACUUM fr..." */) return SQLITE_ERROR // IMP: R-12218-18073 __1: ; if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive > 1) { goto __2 } - Xsqlite3SetString(tls, pzErrMsg, db, ts+22210 /* "cannot VACUUM - ..." */) + Xsqlite3SetString(tls, pzErrMsg, db, ts+22680 /* "cannot VACUUM - ..." */) return SQLITE_ERROR // IMP: R-15610-35227 __2: ; @@ -121566,7 +123575,7 @@ __2: if !(Xsqlite3_value_type(tls, pOut) != SQLITE_TEXT) { goto __5 } - Xsqlite3SetString(tls, pzErrMsg, db, ts+22253 /* "non-text filenam..." */) + Xsqlite3SetString(tls, pzErrMsg, db, ts+22723 /* "non-text filenam..." */) return SQLITE_ERROR __5: ; @@ -121611,7 +123620,7 @@ __4: // time to parse and run the PRAGMA to turn journalling off than it does // to write the journal header file. nDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb - rc = execSqlF(tls, db, pzErrMsg, ts+22271 /* "ATTACH %Q AS vac..." */, libc.VaList(bp, zOut)) + rc = execSqlF(tls, db, pzErrMsg, ts+22741 /* "ATTACH %Q AS vac..." */, libc.VaList(bp, zOut)) (*Sqlite3)(unsafe.Pointer(db)).FopenFlags = saved_openFlags if !(rc != SQLITE_OK) { goto __6 @@ -121632,11 +123641,11 @@ __6: goto __8 } rc = SQLITE_ERROR - Xsqlite3SetString(tls, pzErrMsg, db, ts+22294 /* "output file alre..." */) + Xsqlite3SetString(tls, pzErrMsg, db, ts+22764 /* "output file alre..." */) goto end_of_vacuum __8: ; - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (DBFLAG_VacuumInto) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(DBFLAG_VacuumInto)) __7: ; nRes = Xsqlite3BtreeGetRequestedReserve(tls, pMain) @@ -121648,7 +123657,7 @@ __7: // Begin a transaction and take an exclusive lock on the main database // file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, // to ensure that we do not try to change the page-size on a WAL database. - rc = execSql(tls, db, pzErrMsg, ts+15585 /* "BEGIN" */) + rc = execSql(tls, db, pzErrMsg, ts+16049 /* "BEGIN" */) if !(rc != SQLITE_OK) { goto __9 } @@ -121699,7 +123708,7 @@ __12: (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(nDb) // force new CREATE statements into vacuum_db rc = execSqlF(tls, db, pzErrMsg, - ts+22321, /* "SELECT sql FROM ..." */ + ts+22791, /* "SELECT sql FROM ..." */ libc.VaList(bp+8, zDbMain)) if !(rc != SQLITE_OK) { goto __13 @@ -121709,7 +123718,7 @@ __13: ; rc = execSqlF(tls, db, pzErrMsg, - ts+22429, /* "SELECT sql FROM ..." */ + ts+22899, /* "SELECT sql FROM ..." */ libc.VaList(bp+16, zDbMain)) if !(rc != SQLITE_OK) { goto __14 @@ -121724,7 +123733,7 @@ __14: // the contents to the temporary database. rc = execSqlF(tls, db, pzErrMsg, - ts+22483, /* "SELECT'INSERT IN..." */ + ts+22953, /* "SELECT'INSERT IN..." */ libc.VaList(bp+24, zDbMain)) *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(DBFLAG_Vacuum))) @@ -121741,7 +123750,7 @@ __15: // from the schema table. rc = execSqlF(tls, db, pzErrMsg, - ts+22634, /* "INSERT INTO vacu..." */ + ts+23104, /* "INSERT INTO vacu..." */ libc.VaList(bp+32, zDbMain)) if !(rc != 0) { goto __16 @@ -121849,12 +123858,12 @@ __26: } var aCopy = [10]uint8{ - BTREE_SCHEMA_VERSION, uint8(1), // Add one to the old schema cookie - BTREE_DEFAULT_CACHE_SIZE, uint8(0), // Preserve the default page cache size - BTREE_TEXT_ENCODING, uint8(0), // Preserve the text encoding - BTREE_USER_VERSION, uint8(0), // Preserve the user version - BTREE_APPLICATION_ID, uint8(0), // Preserve the application id -} /* sqlite3.c:139504:32 */ + uint8(BTREE_SCHEMA_VERSION), uint8(1), // Add one to the old schema cookie + uint8(BTREE_DEFAULT_CACHE_SIZE), uint8(0), // Preserve the default page cache size + uint8(BTREE_TEXT_ENCODING), uint8(0), // Preserve the text encoding + uint8(BTREE_USER_VERSION), uint8(0), // Preserve the user version + uint8(BTREE_APPLICATION_ID), uint8(0), // Preserve the application id +} /* sqlite3.c:141790:32 */ // Construct and install a Module object for a virtual table. When this // routine is called, it is guaranteed that all appropriate locks are held @@ -121862,7 +123871,7 @@ var aCopy = [10]uint8{ // // If there already exists a module with zName, replace it with the new one. // If pModule==0, then delete the module zName if it exists. -func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) uintptr { /* sqlite3.c:139616:23: */ +func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) uintptr { /* sqlite3.c:141902:23: */ var pMod uintptr var pDel uintptr var zCopy uintptr @@ -121885,7 +123894,7 @@ func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*Module)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*Module)(unsafe.Pointer(pMod)).FnRefModule = 1 } - pDel = Xsqlite3HashInsert(tls, (db + 528 /* &.aModule */), zCopy, pMod) + pDel = Xsqlite3HashInsert(tls, (db + 536 /* &.aModule */), zCopy, pMod) if pDel != 0 { if pDel == pMod { Xsqlite3OomFault(tls, db) @@ -121902,7 +123911,7 @@ func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // 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 *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:139664:12: */ +func createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:141950:12: */ var rc int32 = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -121916,21 +123925,21 @@ func createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAu } // External API function used to create a new virtual-table module. -func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr) int32 { /* sqlite3.c:139685:16: */ +func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr) int32 { /* sqlite3.c:141971:16: */ return createModule(tls, db, zName, pModule, pAux, uintptr(0)) } // External API function used to create a new virtual-table module. -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:139700:16: */ +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:141986:16: */ return createModule(tls, db, zName, pModule, pAux, xDestroy) } // External API to drop all virtual-table modules, except those named // on the azNames list. -func Xsqlite3_drop_modules(tls *libc.TLS, db uintptr, azNames uintptr) int32 { /* sqlite3.c:139717:16: */ +func Xsqlite3_drop_modules(tls *libc.TLS, db uintptr, azNames uintptr) int32 { /* sqlite3.c:142003:16: */ var pThis uintptr var pNext uintptr - for pThis = (*Hash)(unsafe.Pointer((db + 528 /* &.aModule */))).Ffirst; pThis != 0; pThis = pNext { + for pThis = (*Hash)(unsafe.Pointer((db + 536 /* &.aModule */))).Ffirst; pThis != 0; pThis = pNext { var pMod uintptr = (*HashElem)(unsafe.Pointer(pThis)).Fdata pNext = (*HashElem)(unsafe.Pointer(pThis)).Fnext if azNames != 0 { @@ -121948,7 +123957,7 @@ func Xsqlite3_drop_modules(tls *libc.TLS, db uintptr, azNames uintptr) int32 { / // Decrement the reference count on a Module object. Destroy the // module when the reference count reaches zero. -func Xsqlite3VtabModuleUnref(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:139739:21: */ +func Xsqlite3VtabModuleUnref(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:142025:21: */ (*Module)(unsafe.Pointer(pMod)).FnRefModule-- if (*Module)(unsafe.Pointer(pMod)).FnRefModule == 0 { @@ -121966,14 +123975,14 @@ func Xsqlite3VtabModuleUnref(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlit // // If a disconnect is attempted while a virtual table is locked, // the disconnect is deferred until all locks have been removed. -func Xsqlite3VtabLock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:139759:21: */ +func Xsqlite3VtabLock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:142045:21: */ (*VTable)(unsafe.Pointer(pVTab)).FnRef++ } // 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 Xsqlite3GetVTable(tls *libc.TLS, db uintptr, pTab uintptr) uintptr { /* sqlite3.c:139769:23: */ +func Xsqlite3GetVTable(tls *libc.TLS, db uintptr, pTab uintptr) uintptr { /* sqlite3.c:142055:23: */ var pVtab uintptr for pVtab = (*Table)(unsafe.Pointer(pTab)).FpVTable; (pVtab != 0) && ((*VTable)(unsafe.Pointer(pVtab)).Fdb != db); pVtab = (*VTable)(unsafe.Pointer(pVtab)).FpNext { @@ -121983,7 +123992,7 @@ func Xsqlite3GetVTable(tls *libc.TLS, db uintptr, pTab uintptr) uintptr { /* sql // Decrement the ref-count on a virtual table object. When the ref-count // reaches zero, call the xDisconnect() method to delete the object. -func Xsqlite3VtabUnlock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:139780:21: */ +func Xsqlite3VtabUnlock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:142066:21: */ var db uintptr = (*VTable)(unsafe.Pointer(pVTab)).Fdb (*VTable)(unsafe.Pointer(pVTab)).FnRef-- @@ -122002,7 +124011,7 @@ func Xsqlite3VtabUnlock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:139780:21: // 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 *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:139805:15: */ +func vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:142091:15: */ var pRet uintptr = uintptr(0) var pVTable uintptr = (*Table)(unsafe.Pointer(p)).FpVTable (*Table)(unsafe.Pointer(p)).FpVTable = uintptr(0) @@ -122037,7 +124046,7 @@ func vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite // 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 Xsqlite3VtabDisconnect(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:139845:21: */ +func Xsqlite3VtabDisconnect(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:142131:21: */ var ppVTab uintptr for ppVTab = (p + 96 /* &.pVTable */); *(*uintptr)(unsafe.Pointer(ppVTab)) != 0; ppVTab = (*(*uintptr)(unsafe.Pointer(ppVTab)) + 40 /* &.pNext */) { @@ -122068,7 +124077,7 @@ func Xsqlite3VtabDisconnect(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c // // As a result, a sqlite3.pDisconnect cannot be accessed simultaneously // by multiple threads. It is thread-safe. -func Xsqlite3VtabUnlockList(tls *libc.TLS, db uintptr) { /* sqlite3.c:139883:21: */ +func Xsqlite3VtabUnlockList(tls *libc.TLS, db uintptr) { /* sqlite3.c:142169:21: */ var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpDisconnect if p != 0 { @@ -122094,7 +124103,7 @@ func Xsqlite3VtabUnlockList(tls *libc.TLS, db uintptr) { /* sqlite3.c:139883:21: // 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 Xsqlite3VtabClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:139914:21: */ +func Xsqlite3VtabClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:142200:21: */ if !(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0)) { vtabDisconnectAll(tls, uintptr(0), p) } @@ -122113,15 +124122,15 @@ func Xsqlite3VtabClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:1399 // The string is not copied - the pointer is stored. The // string will be freed automatically when the table is // deleted. -func addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uintptr) { /* sqlite3.c:139931:13: */ +func addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uintptr) { /* sqlite3.c:142217:13: */ bp := tls.Alloc(8) defer tls.Free(8) var nBytes Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * (uint64(2 + (*Table)(unsafe.Pointer(pTable)).FnModuleArg)))) var azModuleArg uintptr var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb - if ((*Table)(unsafe.Pointer(pTable)).FnModuleArg + 3) >= *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 2*4)) { - Xsqlite3ErrorMsg(tls, pParse, ts+13534 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName)) + if ((*Table)(unsafe.Pointer(pTable)).FnModuleArg + 3) >= *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 2*4)) { + Xsqlite3ErrorMsg(tls, pParse, ts+13998 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = Xsqlite3DbRealloc(tls, db, (*Table)(unsafe.Pointer(pTable)).FazModuleArg, uint64(nBytes)) if azModuleArg == uintptr(0) { @@ -122137,7 +124146,7 @@ func addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uintp // 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 Xsqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pModuleName uintptr, ifNotExists int32) { /* sqlite3.c:139954:21: */ +func Xsqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pModuleName uintptr, ifNotExists int32) { /* sqlite3.c:142240:21: */ var pTable uintptr // The new virtual table var db uintptr // Database connection @@ -122170,7 +124179,7 @@ func Xsqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName // 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 *libc.TLS, pParse uintptr) { /* sqlite3.c:140002:13: */ +func addArgumentToVtab(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:142288:13: */ if ((*Parse)(unsafe.Pointer(pParse)).FsArg.Fz != 0) && ((*Parse)(unsafe.Pointer(pParse)).FpNewTable != 0) { var z uintptr = (*Parse)(unsafe.Pointer(pParse)).FsArg.Fz var n int32 = int32((*Parse)(unsafe.Pointer(pParse)).FsArg.Fn) @@ -122181,7 +124190,7 @@ func addArgumentToVtab(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:140002:13: // The parser calls this routine after the CREATE VIRTUAL TABLE statement // has been completely parsed. -func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* sqlite3.c:140015:21: */ +func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* sqlite3.c:142301:21: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -122215,7 +124224,7 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s if pEnd != 0 { (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fn = (uint32((int32((int64((*Token)(unsafe.Pointer(pEnd)).Fz) - int64((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) / 1))) + (*Token)(unsafe.Pointer(pEnd)).Fn) } - zStmt = Xsqlite3MPrintf(tls, db, ts+22764 /* "CREATE VIRTUAL T..." */, libc.VaList(bp, (pParse+248 /* &.sNameToken */))) + zStmt = Xsqlite3MPrintf(tls, db, ts+23234 /* "CREATE VIRTUAL T..." */, libc.VaList(bp, (pParse+240 /* &.sNameToken */))) // A slot for the record has already been allocated in the // schema table. We just need to update that slot with all @@ -122227,7 +124236,7 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) Xsqlite3NestedParse(tls, pParse, - ts+22788, /* "UPDATE %Q.sqlite..." */ + ts+23258, /* "UPDATE %Q.sqlite..." */ libc.VaList(bp+8, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName, (*Table)(unsafe.Pointer(pTab)).FzName, @@ -122237,8 +124246,8 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s Xsqlite3ChangeCookie(tls, pParse, iDb) Xsqlite3VdbeAddOp0(tls, v, OP_Expire) - zWhere = Xsqlite3MPrintf(tls, db, ts+22887 /* "name=%Q AND sql=..." */, libc.VaList(bp+48, (*Table)(unsafe.Pointer(pTab)).FzName, zStmt)) - Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere) + zWhere = Xsqlite3MPrintf(tls, db, ts+23357 /* "name=%Q AND sql=..." */, libc.VaList(bp+48, (*Table)(unsafe.Pointer(pTab)).FzName, zStmt)) + Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) Xsqlite3DbFree(tls, db, zStmt) iReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) @@ -122261,7 +124270,7 @@ func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* s // 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 Xsqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:140101:21: */ +func Xsqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:142387:21: */ addArgumentToVtab(tls, pParse) (*Parse)(unsafe.Pointer(pParse)).FsArg.Fz = uintptr(0) (*Parse)(unsafe.Pointer(pParse)).FsArg.Fn = uint32(0) @@ -122269,8 +124278,8 @@ func Xsqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:140101:21 // 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 Xsqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:140111:21: */ - var pArg uintptr = (pParse + 360 /* &.sArg */) +func Xsqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:142397:21: */ + var pArg uintptr = (pParse + 352 /* &.sArg */) if (*Token)(unsafe.Pointer(pArg)).Fz == uintptr(0) { (*Token)(unsafe.Pointer(pArg)).Fz = (*Token)(unsafe.Pointer(p)).Fz (*Token)(unsafe.Pointer(pArg)).Fn = (*Token)(unsafe.Pointer(p)).Fn @@ -122283,7 +124292,7 @@ func Xsqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite // 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 *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) int32 { /* sqlite3.c:140127:12: */ +func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) int32 { /* sqlite3.c:142413:12: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -122302,7 +124311,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, for pCtx = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx; pCtx != 0; pCtx = (*VtabCtx)(unsafe.Pointer(pCtx)).FpPrior { if (*VtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, - ts+22906 /* "vtable construct..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) + ts+23376 /* "vtable construct..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName)) return SQLITE_LOCKED } } @@ -122320,7 +124329,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } (*VTable)(unsafe.Pointer(pVTable)).Fdb = db (*VTable)(unsafe.Pointer(pVTable)).FpMod = pMod - (*VTable)(unsafe.Pointer(pVTable)).FeVtabRisk = SQLITE_VTABRISK_Normal + (*VTable)(unsafe.Pointer(pVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_Normal) iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg + 1*8)) = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName @@ -122340,7 +124349,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+22948 /* "vtable construct..." */, libc.VaList(bp+8, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+23418 /* "vtable construct..." */, libc.VaList(bp+8, zModuleName)) } else { *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+824 /* "%s" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */))) @@ -122354,7 +124363,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*Module)(unsafe.Pointer(pMod)).FnRefModule++ (*VTable)(unsafe.Pointer(pVTable)).FnRef = 1 if (*VtabCtx)(unsafe.Pointer(bp+32 /* &sCtx */)).FbDeclared == 0 { - var zFormat uintptr = ts + 22978 /* "vtable construct..." */ + var zFormat uintptr = ts + 23448 /* "vtable construct..." */ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+24, (*Table)(unsafe.Pointer(pTab)).FzName)) Xsqlite3VtabUnlock(tls, pVTable) rc = SQLITE_ERROR @@ -122375,7 +124384,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, var i int32 = 0 nType = Xsqlite3Strlen30(tls, zType) for i = 0; i < nType; i++ { - if ((0 == Xsqlite3_strnicmp(tls, ts+17204 /* "hidden" */, (zType+uintptr(i)), 6)) && + if ((0 == Xsqlite3_strnicmp(tls, ts+17629 /* "hidden" */, (zType+uintptr(i)), 6)) && ((i == 0) || (int32(*(*int8)(unsafe.Pointer(zType + uintptr((i - 1))))) == ' '))) && ((int32(*(*int8)(unsafe.Pointer(zType + uintptr((i + 6))))) == 0) || (int32(*(*int8)(unsafe.Pointer(zType + uintptr((i + 6))))) == ' ')) { break @@ -122397,7 +124406,8 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, *(*int8)(unsafe.Pointer(zType + uintptr((i - 1)))) = int8(0) } *(*U16)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32 + 28 /* &.colFlags */)) |= U16((COLFLAG_HIDDEN)) - oooHidden = TF_OOOHidden + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_HasHidden)) + oooHidden = U16(TF_OOOHidden) } else { *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(oooHidden)) } @@ -122414,7 +124424,7 @@ func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, // and an error left in pParse. // // This call is a no-op if table pTab is not a virtual table. -func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:140259:20: */ +func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:142546:20: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -122429,11 +124439,11 @@ func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 // Locate the required virtual table module zMod = *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg)) - pMod = Xsqlite3HashFind(tls, (db + 528 /* &.aModule */), zMod) + pMod = Xsqlite3HashFind(tls, (db + 536 /* &.aModule */), zMod) if !(pMod != 0) { var zModule uintptr = *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg)) - Xsqlite3ErrorMsg(tls, pParse, ts+23024 /* "no such module: ..." */, libc.VaList(bp, zModule)) + Xsqlite3ErrorMsg(tls, pParse, ts+23494 /* "no such module: ..." */, libc.VaList(bp, zModule)) rc = SQLITE_ERROR } else { *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)) = uintptr(0) @@ -122450,7 +124460,7 @@ func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 // 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 *libc.TLS, db uintptr) int32 { /* sqlite3.c:140294:12: */ +func growVTrans(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:142581:12: */ var ARRAY_INCR int32 = 5 // Grow the sqlite3.aVTrans array if required @@ -122470,7 +124480,7 @@ func growVTrans(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140294:12: */ // Add the virtual table pVTab to the array sqlite3.aVTrans[]. Space should // have already been reserved using growVTrans(). -func addToVTrans(tls *libc.TLS, db uintptr, pVTab uintptr) { /* sqlite3.c:140317:13: */ +func addToVTrans(tls *libc.TLS, db uintptr, pVTab uintptr) { /* sqlite3.c:142604:13: */ // Add pVtab to the end of sqlite3.aVTrans *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaVTrans + uintptr(libc.PostIncInt32(&(*Sqlite3)(unsafe.Pointer(db)).FnVTrans, 1))*8)) = pVTab Xsqlite3VtabLock(tls, pVTab) @@ -122482,7 +124492,7 @@ func addToVTrans(tls *libc.TLS, db uintptr, pVTab uintptr) { /* sqlite3.c:140317 // 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 Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:140331:20: */ +func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:142618:20: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -122495,13 +124505,13 @@ func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, // Locate the required virtual table module zMod = *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg)) - pMod = Xsqlite3HashFind(tls, (db + 528 /* &.aModule */), zMod) + pMod = Xsqlite3HashFind(tls, (db + 536 /* &.aModule */), zMod) // If the module has been registered and includes a Create method, // invoke it now. If the module has not been registered, return an // error. Otherwise, do nothing. if ((pMod == uintptr(0)) || ((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0))) || ((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0)) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+23024 /* "no such module: ..." */, libc.VaList(bp, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+23494 /* "no such module: ..." */, libc.VaList(bp, zMod)) rc = SQLITE_ERROR } else { rc = vtabCallConstructor(tls, db, pTab, pMod, (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -122522,30 +124532,30 @@ func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, // 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 *libc.TLS, db uintptr, zCreateTable uintptr) int32 { /* sqlite3.c:140372:16: */ - bp := tls.Alloc(440) - defer tls.Free(440) +func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int32 { /* sqlite3.c:142659:16: */ + bp := tls.Alloc(424) + defer tls.Free(424) var pCtx uintptr var rc int32 = SQLITE_OK var pTab uintptr - *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */)) = uintptr(0) - // var sParse Parse at bp+8, 424 + *(*uintptr)(unsafe.Pointer(bp + 416 /* zErr */)) = uintptr(0) + // var sParse Parse at bp+8, 408 Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || ((*VtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0) { Xsqlite3Error(tls, db, SQLITE_MISUSE) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - return Xsqlite3MisuseError(tls, 140389) + return Xsqlite3MisuseError(tls, 142676) } pTab = (*VtabCtx)(unsafe.Pointer(pCtx)).FpTab libc.Xmemset(tls, bp+8 /* &sParse */, 0, uint64(unsafe.Sizeof(Parse{}))) - (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = PARSE_MODE_DECLARE_VTAB + (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = U8(PARSE_MODE_DECLARE_VTAB) (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).Fdb = db (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FnQueryLoop = U32(1) - if ((((SQLITE_OK == Xsqlite3RunParser(tls, bp+8 /* &sParse */, zCreateTable, bp+432 /* &zErr */)) && + if ((((SQLITE_OK == Xsqlite3RunParser(tls, bp+8 /* &sParse */, zCreateTable, bp+416 /* &zErr */)) && ((*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpNewTable != 0)) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0)) && !(int32((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpNewTable)).FpSelect) != 0)) && @@ -122554,12 +124564,12 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3 var pNew uintptr = (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FpNewTable var pIdx uintptr (*Table)(unsafe.Pointer(pTab)).FaCol = (*Table)(unsafe.Pointer(pNew)).FaCol - (*Table)(unsafe.Pointer(pTab)).FnCol = (*Table)(unsafe.Pointer(pNew)).FnCol + (*Table)(unsafe.Pointer(pTab)).FnNVCol = libc.AssignPtrInt16(pTab+70 /* &.nCol */, (*Table)(unsafe.Pointer(pNew)).FnCol) *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= ((*Table)(unsafe.Pointer(pNew)).FtabFlags & (U32(TF_WithoutRowid | TF_NoVisibleRowid))) (*Table)(unsafe.Pointer(pNew)).FnCol = int16(0) (*Table)(unsafe.Pointer(pNew)).FaCol = uintptr(0) - if (!(((*Table)(unsafe.Pointer((pNew))).FtabFlags & TF_WithoutRowid) == U32(0)) && + if (!(((*Table)(unsafe.Pointer((pNew))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(pCtx)).FpVTable)).FpMod)).FpModule)).FxUpdate != uintptr(0))) && (int32((*Index)(unsafe.Pointer(Xsqlite3PrimaryKeyIndex(tls, pNew))).FnKeyCol) != 1) { // WITHOUT ROWID virtual tables must either be read-only (xUpdate==0) @@ -122577,15 +124587,15 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3 (*VtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = 1 } else { Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, func() uintptr { - if *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */)) != 0 { + if *(*uintptr)(unsafe.Pointer(bp + 416 /* zErr */)) != 0 { return ts + 824 /* "%s" */ } return uintptr(0) - }(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */)))) - Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */))) + }(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 416 /* zErr */)))) + Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 416 /* zErr */))) rc = SQLITE_ERROR } - (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = PARSE_MODE_NORMAL + (*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = U8(PARSE_MODE_NORMAL) if (*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpVdbe != 0 { Xsqlite3VdbeFinalize(tls, (*Parse)(unsafe.Pointer(bp+8 /* &sParse */)).FpVdbe) @@ -122603,7 +124613,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int3 // when a DROP TABLE is mentioned. // // This call is a no-op if zTab is not a virtual table. -func Xsqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) int32 { /* sqlite3.c:140457:20: */ +func Xsqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) int32 { /* sqlite3.c:142744:20: */ var rc int32 = SQLITE_OK var pTab uintptr @@ -122644,7 +124654,7 @@ func Xsqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) // the offset of the method to call in the sqlite3_module structure. // // The array is cleared after invoking the callbacks. -func callFinaliser(tls *libc.TLS, db uintptr, offset int32) { /* sqlite3.c:140498:13: */ +func callFinaliser(tls *libc.TLS, db uintptr, offset int32) { /* sqlite3.c:142785:13: */ var i int32 if (*Sqlite3)(unsafe.Pointer(db)).FaVTrans != 0 { var aVTrans uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaVTrans @@ -122672,7 +124682,7 @@ func callFinaliser(tls *libc.TLS, db uintptr, offset int32) { /* sqlite3.c:14049 // SQLITE_OK if all xSync operations are successful. // // If an error message is available, leave it in p->zErrMsg. -func Xsqlite3VtabSync(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:140526:20: */ +func Xsqlite3VtabSync(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:142813:20: */ var i int32 var rc int32 = SQLITE_OK var aVTrans uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaVTrans @@ -122692,14 +124702,14 @@ func Xsqlite3VtabSync(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c // Invoke the xRollback method of all virtual tables in the // sqlite3.aVTrans array. Then clear the array itself. -func Xsqlite3VtabRollback(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140548:20: */ +func Xsqlite3VtabRollback(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:142835:20: */ callFinaliser(tls, db, int32((uintptr(0) + 136 /* &.xRollback */))) return SQLITE_OK } // Invoke the xCommit method of all virtual tables in the // sqlite3.aVTrans array. Then clear the array itself. -func Xsqlite3VtabCommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140557:20: */ +func Xsqlite3VtabCommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:142844:20: */ callFinaliser(tls, db, int32((uintptr(0) + 128 /* &.xCommit */))) return SQLITE_OK } @@ -122710,7 +124720,7 @@ func Xsqlite3VtabCommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140557:2 // // If the xBegin call is successful, place the sqlite3_vtab pointer // in the sqlite3.aVTrans array. -func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32 { /* sqlite3.c:140570:20: */ +func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32 { /* sqlite3.c:142857:20: */ var rc int32 = SQLITE_OK var pModule uintptr @@ -122767,7 +124777,7 @@ func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32 { /* sqli // 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 Xsqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:140630:20: */ +func Xsqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:142917:20: */ var rc int32 = SQLITE_OK if (*Sqlite3)(unsafe.Pointer(db)).FaVTrans != 0 { @@ -122813,7 +124823,7 @@ func Xsqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32 // 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 Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg int32, pExpr uintptr) uintptr { /* sqlite3.c:140678:24: */ +func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg int32, pExpr uintptr) uintptr { /* sqlite3.c:142965:24: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -122869,7 +124879,7 @@ func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg libc.Xmemcpy(tls, (pNew + 1*72), (*FuncDef)(unsafe.Pointer(pDef)).FzName, (uint64(Xsqlite3Strlen30(tls, (*FuncDef)(unsafe.Pointer(pDef)).FzName) + 1))) (*FuncDef)(unsafe.Pointer(pNew)).FxSFunc = *(*uintptr)(unsafe.Pointer(bp /* xSFunc */)) (*FuncDef)(unsafe.Pointer(pNew)).FpUserData = *(*uintptr)(unsafe.Pointer(bp + 8 /* pArg */)) - *(*U32)(unsafe.Pointer(pNew + 4 /* &.funcFlags */)) |= (SQLITE_FUNC_EPHEM) + *(*U32)(unsafe.Pointer(pNew + 4 /* &.funcFlags */)) |= (U32(SQLITE_FUNC_EPHEM)) return pNew } @@ -122877,7 +124887,7 @@ func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg // 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 Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:140747:21: */ +func Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:143034:21: */ var pToplevel uintptr = func() uintptr { if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 { return (*Parse)(unsafe.Pointer(pParse)).FpToplevel @@ -122915,7 +124925,7 @@ func Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* // // Any virtual table module for which xConnect and xCreate are the same // method can have an eponymous virtual table instance. -func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) int32 { /* sqlite3.c:140780:20: */ +func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) int32 { /* sqlite3.c:143067:20: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -122959,13 +124969,13 @@ func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) // Erase the eponymous virtual table instance associated with // virtual table module pMod, if it exists. -func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:140817:21: */ +func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:143104:21: */ var pTab uintptr = (*Module)(unsafe.Pointer(pMod)).FpEpoTab if pTab != uintptr(0) { // Mark the table as Ephemeral prior to deleting it, so that the // sqlite3DeleteTable() routine will know that it is not stored in // the schema. - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_Ephemeral) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral)) Xsqlite3DeleteTable(tls, db, pTab) (*Module)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) } @@ -122976,19 +124986,19 @@ func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) { // // The results of this routine are undefined unless it is called from // within an xUpdate method. -func Xsqlite3_vtab_on_conflict(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140836:16: */ +func Xsqlite3_vtab_on_conflict(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:143123:16: */ return int32(aMap[(int32((*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict) - 1)]) } var aMap = [5]uint8{ - SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE, -} /* sqlite3.c:140837:30 */ + uint8(SQLITE_ROLLBACK), uint8(SQLITE_ABORT), uint8(SQLITE_FAIL), uint8(SQLITE_IGNORE), uint8(SQLITE_REPLACE), +} /* sqlite3.c:143124:30 */ // 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 *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:140854:16: */ +func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:143141:16: */ var ap Va_list _ = ap var rc int32 = SQLITE_OK @@ -122997,7 +125007,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = Xsqlite3MisuseError(tls, 140865) + rc = Xsqlite3MisuseError(tls, 143152) } else { ap = va @@ -123011,21 +125021,21 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 fallthrough case SQLITE_VTAB_INNOCUOUS: { - (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = SQLITE_VTABRISK_Low + (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_Low) break } fallthrough case SQLITE_VTAB_DIRECTONLY: { - (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = SQLITE_VTABRISK_High + (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FeVtabRisk = U8(SQLITE_VTABRISK_High) break } fallthrough default: { - rc = Xsqlite3MisuseError(tls, 140883) + rc = Xsqlite3MisuseError(tls, 143170) break } @@ -123040,6 +125050,43 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 return rc } +//************* End of vtab.c *********************************************** +//************* Begin file wherecode.c ************************************** +// 2015-06-06 +// +// The author disclaims copyright to this source code. In place of +// a legal notice, here is a blessing: +// +// May you do good and not evil. +// May you find forgiveness for yourself and forgive others. +// May you share freely, never taking more than you give. +// +// +// This module contains C code that generates VDBE code used to process +// the WHERE clause of SQL statements. +// +// This file was split off from where.c on 2015-06-06 in order to reduce the +// size of where.c and make it easier to edit. This file contains the routines +// that actually generate the bulk of the WHERE loop code. The original where.c +// file retains the code that does query planning and analysis. +// #include "sqliteInt.h" +//************* Include whereInt.h in the middle of wherecode.c ************* +//************* Begin file whereInt.h *************************************** +// 2013-11-12 +// +// The author disclaims copyright to this source code. In place of +// a legal notice, here is a blessing: +// +// May you do good and not evil. +// May you find forgiveness for yourself and forgive others. +// May you share freely, never taking more than you give. +// +// +// +// This file contains structure and macro definitions for the query +// planner logic in "where.c". These definitions are broken out into +// a separate source file for easier editing. + // Forward references type WhereClause1 = struct { FpWInfo uintptr @@ -123052,26 +125099,63 @@ type WhereClause1 = struct { _ [4]byte Fa uintptr FaStatic [8]WhereTerm -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ + +//************* End of vtab.c *********************************************** +//************* Begin file wherecode.c ************************************** +// 2015-06-06 +// +// The author disclaims copyright to this source code. In place of +// a legal notice, here is a blessing: +// +// May you do good and not evil. +// May you find forgiveness for yourself and forgive others. +// May you share freely, never taking more than you give. +// +// +// This module contains C code that generates VDBE code used to process +// the WHERE clause of SQL statements. +// +// This file was split off from where.c on 2015-06-06 in order to reduce the +// size of where.c and make it easier to edit. This file contains the routines +// that actually generate the bulk of the WHERE loop code. The original where.c +// file retains the code that does query planning and analysis. +// #include "sqliteInt.h" +//************* Include whereInt.h in the middle of wherecode.c ************* +//************* Begin file whereInt.h *************************************** +// 2013-11-12 +// +// The author disclaims copyright to this source code. In place of +// a legal notice, here is a blessing: +// +// May you do good and not evil. +// May you find forgiveness for yourself and forgive others. +// May you share freely, never taking more than you give. +// +// +// +// This file contains structure and macro definitions for the query +// planner logic in "where.c". These definitions are broken out into +// a separate source file for easier editing. // Forward references -type WhereClause = WhereClause1 /* sqlite3.c:140956:28 */ +type WhereClause = WhereClause1 /* sqlite3.c:143230:28 */ type WhereMaskSet1 = struct { FbVarSelect int32 Fn int32 Fix [64]int32 -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ -type WhereMaskSet = WhereMaskSet1 /* sqlite3.c:140957:29 */ +type WhereMaskSet = WhereMaskSet1 /* sqlite3.c:143231:29 */ type WhereOrInfo1 = struct { Fwc WhereClause Findexable Bitmask -} /* sqlite3.c:140958:9 */ +} /* sqlite3.c:143232:9 */ -type WhereOrInfo = WhereOrInfo1 /* sqlite3.c:140958:28 */ -type WhereAndInfo1 = struct{ Fwc WhereClause } /* sqlite3.c:140959:9 */ +type WhereOrInfo = WhereOrInfo1 /* sqlite3.c:143232:28 */ +type WhereAndInfo1 = struct{ Fwc WhereClause } /* sqlite3.c:143233:9 */ -type WhereAndInfo = WhereAndInfo1 /* sqlite3.c:140959:29 */ +type WhereAndInfo = WhereAndInfo1 /* sqlite3.c:143233:29 */ type WhereLevel1 = struct { FiLeftJoin int32 FiTabCur int32 @@ -123099,9 +125183,9 @@ type WhereLevel1 = struct { } FpWLoop uintptr FnotReady Bitmask -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ -type WhereLevel = WhereLevel1 /* sqlite3.c:140960:27 */ +type WhereLevel = WhereLevel1 /* sqlite3.c:143234:27 */ type WhereLoop1 = struct { Fprereq Bitmask FmaskSelf Bitmask @@ -123127,9 +125211,9 @@ type WhereLoop1 = struct { FaLTerm uintptr FpNextLoop uintptr FaLTermSpace [3]uintptr -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ -type WhereLoop = WhereLoop1 /* sqlite3.c:140961:26 */ +type WhereLoop = WhereLoop1 /* sqlite3.c:143235:26 */ type WherePath1 = struct { FmaskLoop Bitmask FrevLoop Bitmask @@ -123139,9 +125223,9 @@ type WherePath1 = struct { FisOrdered I8 _ [1]byte FaLoop uintptr -} /* sqlite3.c:140962:9 */ +} /* sqlite3.c:143236:9 */ -type WherePath = WherePath1 /* sqlite3.c:140962:26 */ +type WherePath = WherePath1 /* sqlite3.c:143236:26 */ type WhereTerm1 = struct { FpExpr uintptr FpWC uintptr @@ -123152,18 +125236,18 @@ type WhereTerm1 = struct { FeMatchOp U8 FiParent int32 FleftCursor int32 - FiField int32 - _ [4]byte Fu struct { - _ [0]uint64 - FleftColumn int32 - _ [4]byte + _ [0]uint64 + Fx struct { + FleftColumn int32 + FiField int32 + } } FprereqRight Bitmask FprereqAll Bitmask -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ -type WhereTerm = WhereTerm1 /* sqlite3.c:140963:26 */ +type WhereTerm = WhereTerm1 /* sqlite3.c:143237:26 */ type WhereLoopBuilder1 = struct { FpWInfo uintptr FpWC uintptr @@ -123177,9 +125261,9 @@ type WhereLoopBuilder1 = struct { _ [2]byte FiPlanLimit uint32 _ [4]byte -} /* sqlite3.c:140964:9 */ +} /* sqlite3.c:143238:9 */ -type WhereLoopBuilder = WhereLoopBuilder1 /* sqlite3.c:140964:33 */ +type WhereLoopBuilder = WhereLoopBuilder1 /* sqlite3.c:143238:33 */ type WhereScan1 = struct { FpOrigWC uintptr FpWC uintptr @@ -123194,24 +125278,24 @@ type WhereScan1 = struct { FaiCur [11]int32 FaiColumn [11]I16 _ [2]byte -} /* sqlite3.c:140965:9 */ +} /* sqlite3.c:143239:9 */ -type WhereScan = WhereScan1 /* sqlite3.c:140965:26 */ +type WhereScan = WhereScan1 /* sqlite3.c:143239:26 */ type WhereOrCost1 = struct { Fprereq Bitmask FrRun LogEst FnOut LogEst _ [4]byte -} /* sqlite3.c:140964:9 */ +} /* sqlite3.c:143238:9 */ -type WhereOrCost = WhereOrCost1 /* sqlite3.c:140966:28 */ +type WhereOrCost = WhereOrCost1 /* sqlite3.c:143240:28 */ type WhereOrSet1 = struct { Fn U16 _ [6]byte Fa [3]WhereOrCost -} /* sqlite3.c:140964:9 */ +} /* sqlite3.c:143238:9 */ -type WhereOrSet = WhereOrSet1 /* sqlite3.c:140967:27 */ +type WhereOrSet = WhereOrSet1 /* sqlite3.c:143241:27 */ // This object contains information needed to implement a single nested // loop in WHERE clause. @@ -123233,7 +125317,7 @@ type InLoop = struct { FnPrefix int32 FeEndLoopOp U8 _ [3]byte -} /* sqlite3.c:141006:7 */ +} /* sqlite3.c:143280:7 */ // Allowed values for WhereLoopBuider.bldFlags @@ -123259,7 +125343,7 @@ type WhereExprMod1 = struct { FpNext uintptr FpExpr uintptr Forig Expr -} /* sqlite3.c:14705:9 */ +} /* sqlite3.c:14827:9 */ // Allowed values for WhereLoopBuider.bldFlags @@ -123281,7 +125365,7 @@ type WhereExprMod1 = struct { // of an index rather than an expression or a virtual column. All // such transformations need to be undone at the end of WHERE clause // processing. -type WhereExprMod = WhereExprMod1 /* sqlite3.c:141372:29 */ +type WhereExprMod = WhereExprMod1 /* sqlite3.c:143644:29 */ // Bitmasks for the operators on WhereTerm objects. These are all // operators that are of interest to the query planner. An @@ -123303,13 +125387,13 @@ type WhereExprMod = WhereExprMod1 /* sqlite3.c:141372:29 */ //************* Continuing where we left off in wherecode.c ***************** // Return the name of the i-th column of the pIdx index. -func explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) uintptr { /* sqlite3.c:141550:19: */ +func explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) uintptr { /* sqlite3.c:143824:19: */ i = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == (-2) { - return ts + 23043 /* "" */ + return ts + 23513 /* "" */ } if i == (-1) { - return ts + 10064 /* "rowid" */ + return ts + 10157 /* "rowid" */ } return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*32)).FzName } @@ -123320,39 +125404,39 @@ func explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) uintptr { /* s // 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 *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, iTerm int32, bAnd int32, zOp uintptr) { /* sqlite3.c:141565:13: */ +func explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, iTerm int32, bAnd int32, zOp uintptr) { /* sqlite3.c:143839:13: */ var i int32 if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, ts+23050 /* " AND " */, 5) + Xsqlite3_str_append(tls, pStr, ts+23520 /* " AND " */, 5) } if nTerm > 1 { - Xsqlite3_str_append(tls, pStr, ts+23056 /* "(" */, 1) + Xsqlite3_str_append(tls, pStr, ts+23526 /* "(" */, 1) } for i = 0; i < nTerm; i++ { if i != 0 { - Xsqlite3_str_append(tls, pStr, ts+13915 /* "," */, 1) + Xsqlite3_str_append(tls, pStr, ts+14379 /* "," */, 1) } Xsqlite3_str_appendall(tls, pStr, explainIndexColumnName(tls, pIdx, (iTerm+i))) } if nTerm > 1 { - Xsqlite3_str_append(tls, pStr, ts+6671 /* ")" */, 1) + Xsqlite3_str_append(tls, pStr, ts+6747 /* ")" */, 1) } Xsqlite3_str_append(tls, pStr, zOp, 1) if nTerm > 1 { - Xsqlite3_str_append(tls, pStr, ts+23056 /* "(" */, 1) + Xsqlite3_str_append(tls, pStr, ts+23526 /* "(" */, 1) } for i = 0; i < nTerm; i++ { if i != 0 { - Xsqlite3_str_append(tls, pStr, ts+13915 /* "," */, 1) + Xsqlite3_str_append(tls, pStr, ts+14379 /* "," */, 1) } - Xsqlite3_str_append(tls, pStr, ts+6724 /* "?" */, 1) + Xsqlite3_str_append(tls, pStr, ts+6800 /* "?" */, 1) } if nTerm > 1 { - Xsqlite3_str_append(tls, pStr, ts+6671 /* ")" */, 1) + Xsqlite3_str_append(tls, pStr, ts+6747 /* ")" */, 1) } } @@ -123368,7 +125452,7 @@ func explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i // string similar to: // // "a=? AND b>?" -func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3.c:141609:13: */ +func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3.c:143883:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -123381,29 +125465,29 @@ func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3. if (int32(nEq) == 0) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_BTM_LIMIT | WHERE_TOP_LIMIT))) == U32(0)) { return } - Xsqlite3_str_append(tls, pStr, ts+23058 /* " (" */, 2) + Xsqlite3_str_append(tls, pStr, ts+23528 /* " (" */, 2) for i = 0; i < int32(nEq); i++ { var z uintptr = explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, ts+23050 /* " AND " */, 5) + Xsqlite3_str_append(tls, pStr, ts+23520 /* " AND " */, 5) } Xsqlite3_str_appendf(tls, pStr, func() uintptr { if i >= int32(nSkip) { - return ts + 23061 /* "%s=?" */ + return ts + 23531 /* "%s=?" */ } - return ts + 23066 /* "ANY(%s)" */ + return ts + 23536 /* "ANY(%s)" */ }(), libc.VaList(bp, z)) } j = i - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BTM_LIMIT) != 0 { - explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */))), j, i, ts+23074 /* ">" */) + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { + explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */))), j, i, ts+23544 /* ">" */) i = 1 } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_TOP_LIMIT) != 0 { - explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */))), j, i, ts+23076 /* "<" */) + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 { + explainAppendTerm(tls, pStr, pIndex, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */))), j, i, ts+23546 /* "<" */) } - Xsqlite3_str_append(tls, pStr, ts+6671 /* ")" */, 1) + Xsqlite3_str_append(tls, pStr, ts+6747 /* ")" */, 1) } // This function is a no-op unless currently processing an EXPLAIN QUERY PLAN @@ -123413,7 +125497,7 @@ func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3. // // 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 Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr, pLevel uintptr, wctrlFlags U16) int32 { /* sqlite3.c:141643:20: */ +func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr, pLevel uintptr, wctrlFlags U16) int32 { /* sqlite3.c:143917:20: */ bp := tls.Alloc(188) defer tls.Free(188) @@ -123438,29 +125522,29 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop flags = (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags - if ((flags & WHERE_MULTI_OR) != 0) || ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0) { + if ((flags & U32(WHERE_MULTI_OR)) != 0) || ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0) { return 0 } isSearch = (libc.Bool32((((flags & (U32(WHERE_BTM_LIMIT | WHERE_TOP_LIMIT))) != U32(0)) || - (((flags & WHERE_VIRTUALTABLE) == U32(0)) && (int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) > 0))) || + (((flags & U32(WHERE_VIRTUALTABLE)) == U32(0)) && (int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) > 0))) || ((int32(wctrlFlags) & (WHERE_ORDERBY_MIN | WHERE_ORDERBY_MAX)) != 0))) Xsqlite3StrAccumInit(tls, bp+56 /* &str */, db, bp+88 /* &zBuf[0] */, int32(unsafe.Sizeof([100]int8{})), SQLITE_MAX_LENGTH) Xsqlite3_str_appendall(tls, bp+56 /* &str */, func() uintptr { if isSearch != 0 { - return ts + 23078 /* "SEARCH" */ + return ts + 23548 /* "SEARCH" */ } - return ts + 23085 /* "SCAN" */ + return ts + 23555 /* "SCAN" */ }()) - if (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0 { - Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+23090 /* " SUBQUERY %u" */, libc.VaList(bp, (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselId)) + if (*SrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 { + Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+23560 /* " SUBQUERY %u" */, libc.VaList(bp, (*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselId)) } else { - Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+23103 /* " TABLE %s" */, libc.VaList(bp+8, (*SrcList_item)(unsafe.Pointer(pItem)).FzName)) + Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+23573 /* " TABLE %s" */, libc.VaList(bp+8, (*SrcItem)(unsafe.Pointer(pItem)).FzName)) } - if (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias != 0 { - Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+23113 /* " AS %s" */, libc.VaList(bp+16, (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias)) + if (*SrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 { + Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+23583 /* " AS %s" */, libc.VaList(bp+16, (*SrcItem)(unsafe.Pointer(pItem)).FzAlias)) } if (flags & (U32(WHERE_IPK | WHERE_VIRTUALTABLE))) == U32(0) { var zFmt uintptr = uintptr(0) @@ -123468,40 +125552,40 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) - if !(((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer(pItem)).FpTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { + if !(((*Table)(unsafe.Pointer(((*SrcItem)(unsafe.Pointer(pItem)).FpTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = ts + 23120 /* "PRIMARY KEY" */ + zFmt = ts + 12521 /* "PRIMARY KEY" */ } - } else if (flags & WHERE_PARTIALIDX) != 0 { - zFmt = ts + 23132 /* "AUTOMATIC PARTIA..." */ - } else if (flags & WHERE_AUTO_INDEX) != 0 { - zFmt = ts + 23165 /* "AUTOMATIC COVERI..." */ - } else if (flags & WHERE_IDX_ONLY) != 0 { - zFmt = ts + 23190 /* "COVERING INDEX %..." */ + } else if (flags & U32(WHERE_PARTIALIDX)) != 0 { + zFmt = ts + 23590 /* "AUTOMATIC PARTIA..." */ + } else if (flags & U32(WHERE_AUTO_INDEX)) != 0 { + zFmt = ts + 23623 /* "AUTOMATIC COVERI..." */ + } else if (flags & U32(WHERE_IDX_ONLY)) != 0 { + zFmt = ts + 23648 /* "COVERING INDEX %..." */ } else { - zFmt = ts + 23208 /* "INDEX %s" */ + zFmt = ts + 23666 /* "INDEX %s" */ } if zFmt != 0 { - Xsqlite3_str_append(tls, bp+56 /* &str */, ts+23217 /* " USING " */, 7) + Xsqlite3_str_append(tls, bp+56 /* &str */, ts+23675 /* " USING " */, 7) Xsqlite3_str_appendf(tls, bp+56 /* &str */, zFmt, libc.VaList(bp+24, (*Index)(unsafe.Pointer(pIdx)).FzName)) explainIndexRange(tls, bp+56 /* &str */, pLoop) } - } else if ((flags & WHERE_IPK) != U32(0)) && ((flags & WHERE_CONSTRAINT) != U32(0)) { + } else if ((flags & U32(WHERE_IPK)) != U32(0)) && ((flags & U32(WHERE_CONSTRAINT)) != U32(0)) { var zRangeOp uintptr if (flags & (U32(WHERE_COLUMN_EQ | WHERE_COLUMN_IN))) != 0 { - zRangeOp = ts + 23225 /* "=" */ - } else if (flags & WHERE_BOTH_LIMIT) == WHERE_BOTH_LIMIT { - zRangeOp = ts + 23227 /* ">? AND rowid<" */ - } else if (flags & WHERE_BTM_LIMIT) != 0 { - zRangeOp = ts + 23074 /* ">" */ + zRangeOp = ts + 23683 /* "=" */ + } else if (flags & U32(WHERE_BOTH_LIMIT)) == U32(WHERE_BOTH_LIMIT) { + zRangeOp = ts + 23685 /* ">? AND rowid<" */ + } else if (flags & U32(WHERE_BTM_LIMIT)) != 0 { + zRangeOp = ts + 23544 /* ">" */ } else { - zRangeOp = ts + 23076 /* "<" */ + zRangeOp = ts + 23546 /* "<" */ } Xsqlite3_str_appendf(tls, bp+56, /* &str */ - ts+23241 /* " USING INTEGER P..." */, libc.VaList(bp+32, zRangeOp)) - } else if (flags & WHERE_VIRTUALTABLE) != U32(0) { - Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+23279, /* " VIRTUAL TABLE I..." */ + ts+23699 /* " USING INTEGER P..." */, libc.VaList(bp+32, zRangeOp)) + } else if (flags & U32(WHERE_VIRTUALTABLE)) != U32(0) { + Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+23737, /* " VIRTUAL TABLE I..." */ libc.VaList(bp+40, *(*int32)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ /* &.idxNum */)), *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)))) } zMsg = Xsqlite3StrAccumFinish(tls, bp+56 /* &str */) @@ -123552,11 +125636,11 @@ func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr // 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 *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:141818:13: */ +func disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:144092:13: */ var nLoop int32 = 0 for (((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_CODED) == 0) && - (((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0) || (((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)))) && + (((*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0) || (((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)))) && (((*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady & (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll) == uint64(0)) { if (nLoop != 0) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_LIKE) != 0) { *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_LIKECOND)) @@ -123566,7 +125650,7 @@ func disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:14 if (*WhereTerm)(unsafe.Pointer(pTerm)).FiParent < 0 { break } - pTerm = ((*WhereClause)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpWC)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pTerm)).FiParent)*64) + pTerm = ((*WhereClause)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpWC)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pTerm)).FiParent)*56) (*WhereTerm)(unsafe.Pointer(pTerm)).FnChild-- if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FnChild) != 0 { @@ -123585,7 +125669,7 @@ func disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:14 // // This routine makes its own copy of zAff so that the caller is free // to modify zAff after this routine returns. -func codeApplyAffinity(tls *libc.TLS, pParse uintptr, base int32, n int32, zAff uintptr) { /* sqlite3.c:141850:13: */ +func codeApplyAffinity(tls *libc.TLS, pParse uintptr, base int32, n int32, zAff uintptr) { /* sqlite3.c:144124:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe if zAff == uintptr(0) { @@ -123618,13 +125702,13 @@ func codeApplyAffinity(tls *libc.TLS, pParse uintptr, base int32, n int32, zAff // // * the comparison will be performed with no affinity, or // * the affinity change in zAff is guaranteed not to change the value. -func updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintptr) { /* sqlite3.c:141887:13: */ +func updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintptr) { /* sqlite3.c:144161:13: */ var i int32 for i = 0; i < n; i++ { var p uintptr = Xsqlite3VectorFieldSubexpr(tls, pRight, i) if (int32(Xsqlite3CompareAffinity(tls, p, *(*int8)(unsafe.Pointer(zAff + uintptr(i))))) == SQLITE_AFF_BLOB) || (Xsqlite3ExprNeedsNoAffinityChange(tls, p, *(*int8)(unsafe.Pointer(zAff + uintptr(i)))) != 0) { - *(*int8)(unsafe.Pointer(zAff + uintptr(i))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(i))) = int8(SQLITE_AFF_BLOB) } } } @@ -123656,7 +125740,7 @@ func updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintptr // The reduced pX is different from the original (obviously) and thus is // only used for indexing, to improve performance. The original unaltered // IN expression must also be run on each output row for correctness. -func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pLoop uintptr, pX uintptr) uintptr { /* sqlite3.c:141933:13: */ +func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pLoop uintptr, pX uintptr) uintptr { /* sqlite3.c:144207:13: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pNew uintptr pNew = Xsqlite3ExprDup(tls, db, pX, 0) @@ -123670,7 +125754,7 @@ func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pL for i = iEq; i < int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm); i++ { if (*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX { - var iField int32 = ((*WhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FiField - 1) + var iField int32 = (*(*int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32 /* &.u */ /* &.x */) + 4 /* &.iField */)) - 1) if (*ExprList_item)(unsafe.Pointer((pOrigRhs+8 /* &.a */)+uintptr(iField)*32)).FpExpr == uintptr(0) { continue } // Duplicate PK column @@ -123726,7 +125810,7 @@ func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pL // 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 *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) int32 { /* sqlite3.c:142015:12: */ +func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) int32 { /* sqlite3.c:144289:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -123749,7 +125833,7 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp var nEq int32 = 0 var aiMap uintptr = uintptr(0) - if ((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0)) && + if ((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0)) && (*(*uintptr)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0))) && (*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)))).FaSortOrder + uintptr(iEq))) != 0) { @@ -123772,15 +125856,15 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp } *(*int32)(unsafe.Pointer(bp /* iTab */)) = 0 - if (((*Expr)(unsafe.Pointer(pX)).Fflags & EP_xIsSelect) == U32(0)) || ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FpEList)).FnExpr == 1) { - eType = Xsqlite3FindInIndex(tls, pParse, pX, IN_INDEX_LOOP, uintptr(0), uintptr(0), bp /* &iTab */) + if (((*Expr)(unsafe.Pointer(pX)).Fflags & U32(EP_xIsSelect)) == U32(0)) || ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32 /* &.x */)))).FpEList)).FnExpr == 1) { + eType = Xsqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp /* &iTab */) } else { var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb pX = removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { aiMap = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (uint64(uint64(unsafe.Sizeof(int32(0))) * uint64(nEq)))) - eType = Xsqlite3FindInIndex(tls, pParse, pX, IN_INDEX_LOOP, uintptr(0), aiMap, bp /* &iTab */) + eType = Xsqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp /* &iTab */) (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiTable = *(*int32)(unsafe.Pointer(bp /* iTab */)) } Xsqlite3ExprDelete(tls, db, pX) @@ -123798,10 +125882,13 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp return OP_Rewind }(), *(*int32)(unsafe.Pointer(bp /* iTab */)), 0) - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_IN_ABLE) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_IN_ABLE)) if *(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) == 0 { (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt = Xsqlite3VdbeMakeLabel(tls, pParse) } + if (iEq > 0) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_SEEKSCAN)) == U32(0)) { + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_IN_EARLYOUT)) + } i = *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */)) *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */)) += (nEq) @@ -123830,23 +125917,27 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp *(*int32)(unsafe.Pointer(pIn /* &.iCur */)) = *(*int32)(unsafe.Pointer(bp /* iTab */)) *(*U8)(unsafe.Pointer(pIn + 16 /* &.eEndLoopOp */)) = func() uint8 { if bRev != 0 { - return OP_Prev + return uint8(OP_Prev) } - return OP_Next + return uint8(OP_Next) }() if iEq > 0 { *(*int32)(unsafe.Pointer(pIn + 8 /* &.iBase */)) = (iReg - i) *(*int32)(unsafe.Pointer(pIn + 12 /* &.nPrefix */)) = i - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_IN_EARLYOUT) } else { *(*int32)(unsafe.Pointer(pIn + 12 /* &.nPrefix */)) = 0 } } else { - *(*U8)(unsafe.Pointer(pIn + 16 /* &.eEndLoopOp */)) = OP_Noop + *(*U8)(unsafe.Pointer(pIn + 16 /* &.eEndLoopOp */)) = U8(OP_Noop) } pIn += 20 } } + + if (iEq > 0) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_IN_SEEKSCAN | WHERE_VIRTUALTABLE))) == U32(0)) { + Xsqlite3VdbeAddOp3(tls, v, OP_SeekHit, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, 0, iEq) + } } else { *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */)) = 0 } @@ -123899,7 +125990,7 @@ func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintp // 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 *libc.TLS, pParse uintptr, pLevel uintptr, bRev int32, nExtraReg int32, pzAff uintptr) int32 { /* sqlite3.c:142186:12: */ +func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev int32, nExtraReg int32, pzAff uintptr) int32 { /* sqlite3.c:144470:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -123937,7 +126028,7 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in return OP_Rewind }(), iIdxCur) - Xsqlite3VdbeComment(tls, v, ts+23306 /* "begin skip-scan ..." */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName)) + Xsqlite3VdbeComment(tls, v, ts+23764 /* "begin skip-scan ..." */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName)) j = Xsqlite3VdbeAddOp0(tls, v, OP_Goto) (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip = Xsqlite3VdbeAddOp4Int(tls, v, func() int32 { if bRev != 0 { @@ -123974,13 +126065,13 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in } } if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IN) != 0 { - if ((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags & U32(EP_xIsSelect)) != 0 { // No affinity ever needs to be (or should be) applied to a value // from the RHS of an "? IN (SELECT ...)" expression. The // sqlite3FindInIndex() routine has already ensured that the // affinity of the comparison has been applied to the value. if zAff != 0 { - *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB) } } } else if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_ISNULL) == 0 { @@ -123991,10 +126082,10 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in } if zAff != 0 { if int32(Xsqlite3CompareAffinity(tls, pRight, *(*int8)(unsafe.Pointer(zAff + uintptr(j))))) == SQLITE_AFF_BLOB { - *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB) } if Xsqlite3ExprNeedsNoAffinityChange(tls, pRight, *(*int8)(unsafe.Pointer(zAff + uintptr(j)))) != 0 { - *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = SQLITE_AFF_BLOB + *(*int8)(unsafe.Pointer(zAff + uintptr(j))) = int8(SQLITE_AFF_BLOB) } } } @@ -124019,7 +126110,7 @@ func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev in // 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 *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, iIdxCur int32) { /* sqlite3.c:142558:13: */ +func codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, iIdxCur int32) { /* sqlite3.c:144842:13: */ var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse // Parse context var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Vdbe to generate code within @@ -124060,10 +126151,10 @@ func codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, i // 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 *libc.TLS, pParse uintptr, p uintptr, iReg int32, nReg int32) { /* sqlite3.c:142602:13: */ +func codeExprOrVector(tls *libc.TLS, pParse uintptr, p uintptr, iReg int32, nReg int32) { /* sqlite3.c:144886:13: */ if (p != 0) && (Xsqlite3ExprIsVector(tls, p) != 0) { - if ((*Expr)(unsafe.Pointer(p)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_xIsSelect)) != 0 { var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var iSelect int32 @@ -124086,10 +126177,10 @@ func codeExprOrVector(tls *libc.TLS, pParse uintptr, p uintptr, iReg int32, nReg // An instance of the IdxExprTrans object carries information about a // mapping from an expression on table columns into a column in an index // down through the Walker. -type IdxExprTrans = IdxExprTrans1 /* sqlite3.c:142640:3 */ +type IdxExprTrans = IdxExprTrans1 /* sqlite3.c:144924:3 */ // Preserve pExpr on the WhereETrans list of the WhereInfo. -func preserveExpr(tls *libc.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:142645:13: */ +func preserveExpr(tls *libc.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:144929:13: */ var pNew uintptr pNew = Xsqlite3DbMallocRaw(tls, (*IdxExprTrans)(unsafe.Pointer(pTrans)).Fdb, uint64(unsafe.Sizeof(WhereExprMod{}))) if pNew == uintptr(0) { @@ -124106,12 +126197,12 @@ func preserveExpr(tls *libc.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:1 // // If pExpr matches, then transform it into a reference to the index column // that contains the value of pExpr. -func whereIndexExprTransNode(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:142661:12: */ +func whereIndexExprTransNode(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:144945:12: */ var pX uintptr = *(*uintptr)(unsafe.Pointer(p + 40 /* &.u */)) if Xsqlite3ExprCompare(tls, uintptr(0), pExpr, (*IdxExprTrans)(unsafe.Pointer(pX)).FpIdxExpr, (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCur) == 0 { preserveExpr(tls, pX, pExpr) (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = Xsqlite3ExprAffinity(tls, pExpr) - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN) (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*IdxExprTrans)(unsafe.Pointer(pX)).FiIdxCur (*Expr)(unsafe.Pointer(pExpr)).FiColumn = YnVar((*IdxExprTrans)(unsafe.Pointer(pX)).FiIdxCol) *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = uintptr(0) @@ -124126,7 +126217,7 @@ func whereIndexExprTransNode(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* // A walker node callback that translates a column reference to a table // into a corresponding column reference of an index. -func whereIndexExprTransColumn(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:142683:12: */ +func whereIndexExprTransColumn(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:144967:12: */ if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN { var pX uintptr = *(*uintptr)(unsafe.Pointer(p + 40 /* &.u */)) if ((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCur) && (int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCol) { @@ -124148,7 +126239,7 @@ func whereIndexExprTransColumn(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { // 2019-10-24: Updated to also translate references to a VIRTUAL column in // the table into references to the corresponding (stored) column of the // index. -func whereIndexExprTrans(tls *libc.TLS, pIdx uintptr, iTabCur int32, iIdxCur int32, pWInfo uintptr) { /* sqlite3.c:142708:13: */ +func whereIndexExprTrans(tls *libc.TLS, pIdx uintptr, iTabCur int32, iIdxCur int32, pWInfo uintptr) { /* sqlite3.c:144992:13: */ bp := tls.Alloc(88) defer tls.Free(88) @@ -124212,7 +126303,7 @@ func whereIndexExprTrans(tls *libc.TLS, pIdx uintptr, iTabCur int32, iIdxCur int // WHERE clause terms on the query, and if any of those terms must be // true because pTruth is true, then mark those WHERE clause terms as // coded. -func whereApplyPartialIndexConstraints(tls *libc.TLS, pTruth uintptr, iTabCur int32, pWC uintptr) { /* sqlite3.c:142771:13: */ +func whereApplyPartialIndexConstraints(tls *libc.TLS, pTruth uintptr, iTabCur int32, pWC uintptr) { /* sqlite3.c:145055:13: */ var i int32 var pTerm uintptr for int32((*Expr)(unsafe.Pointer(pTruth)).Fop) == TK_AND { @@ -124239,7 +126330,7 @@ __1: goto __2 __2: i++ - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -124247,7 +126338,7 @@ __3: // Generate code for the start of the iLevel-th loop in the WHERE clause // implementation described by pWInfo. -func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWInfo uintptr, iLevel int32, pLevel uintptr, notReady Bitmask) Bitmask { /* sqlite3.c:142796:24: */ +func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWInfo uintptr, iLevel int32, pLevel uintptr, notReady Bitmask) Bitmask { /* sqlite3.c:145080:24: */ bp := tls.Alloc(104) defer tls.Free(104) @@ -124273,8 +126364,8 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI db = (*Parse)(unsafe.Pointer(pParse)).Fdb pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112) - iCur = (*SrcList_item)(unsafe.Pointer(pTabItem)).FiCursor - (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady = (notReady & ^Xsqlite3WhereGetMask(tls, (pWInfo+656 /* &.sMaskSet */), iCur)) + iCur = (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor + (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady = (notReady & ^Xsqlite3WhereGetMask(tls, (pWInfo+592 /* &.sMaskSet */), iCur)) bRev = (int32(((*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask >> iLevel) & uint64(1))) // Create labels for the "break" and "continue" instructions @@ -124293,27 +126384,27 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // initialize a memory cell that records if this table matches any // row of the left table of the join. - if (int32((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0) && ((int32((*SrcList_item)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) { + if (int32((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0) && ((int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) { (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin) - Xsqlite3VdbeComment(tls, v, ts+23328 /* "init LEFT JOIN n..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+23786 /* "init LEFT JOIN n..." */, 0) } // Compute a safe address to jump to if we discover that the table for // this loop is empty and can never contribute content. - for j = iLevel; (j > 0) && ((*WhereLevel)(unsafe.Pointer((pWInfo+920 /* &.a */)+uintptr(j)*88)).FiLeftJoin == 0); j-- { + for j = iLevel; (j > 0) && ((*WhereLevel)(unsafe.Pointer((pWInfo+856 /* &.a */)+uintptr(j)*88)).FiLeftJoin == 0); j-- { } - addrHalt = (*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */) + uintptr(j)*88)).FaddrBrk + addrHalt = (*WhereLevel)(unsafe.Pointer((pWInfo + 856 /* &.a */) + uintptr(j)*88)).FaddrBrk // Special case of a FROM clause subquery implemented as a co-routine if (uint32(int32(*(*uint8)(unsafe.Pointer(pTabItem + 60 /* &.fg */ + 4 /* &.viaCoroutine */)) & 0x10 >> 4))) != 0 { - var regYield int32 = (*SrcList_item)(unsafe.Pointer(pTabItem)).FregReturn - Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, (*SrcList_item)(unsafe.Pointer(pTabItem)).FaddrFillSub) + var regYield int32 = (*SrcItem)(unsafe.Pointer(pTabItem)).FregReturn + Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, (*SrcItem)(unsafe.Pointer(pTabItem)).FaddrFillSub) (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeAddOp2(tls, v, OP_Yield, regYield, addrBrk) - Xsqlite3VdbeComment(tls, v, ts+23357 /* "next row of %s" */, libc.VaList(bp, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab)).FzName)) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Goto - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) != U32(0) { + Xsqlite3VdbeComment(tls, v, ts+23815 /* "next row of %s" */, libc.VaList(bp, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pTabItem)).FpTab)).FzName)) + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Goto) + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0) { // Case 1: The table is a virtual-table. Use the VFilter and VNext // to access the data. var iReg int32 // P3 Value for OP_VFilter @@ -124349,12 +126440,17 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI }()) *(*U8)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) + // An OOM inside of AddOp4(OP_VFilter) instruction above might have freed + // the u.vtab.idxStr. NULL it out to prevent a use-after-free + if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)) = uintptr(0) + } (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = func() uint8 { if (*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass != 0 { - return OP_Noop + return uint8(OP_Noop) } - return OP_VNext + return uint8(OP_VNext) }() (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeCurrentAddr(tls, v) iIn = *(*int32)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ /* &.nIn */)) @@ -124407,7 +126503,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // simpler and safer to simply not reuse the registers. // // sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2); - } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IPK) != U32(0)) && + } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != U32(0)) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_COLUMN_IN | WHERE_COLUMN_EQ))) != U32(0)) { // Case 2: We can directly reference a single row using an // equality comparison against the ROWID field. Or @@ -124424,12 +126520,12 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI addrNxt = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt Xsqlite3VdbeAddOp3(tls, v, OP_SeekRowid, iCur, addrNxt, iRowidReg) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Noop + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop) if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady) == uint64(0) { *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_CODED)) } - } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IPK) != U32(0)) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_COLUMN_RANGE) != U32(0)) { + } else if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != U32(0)) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != U32(0)) { // Case 3: We have an inequality comparison against the ROWID field. var testOp int32 = OP_Noop var start int32 @@ -124439,10 +126535,10 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI j = 0 pStart = libc.AssignUintptr(&pEnd, uintptr(0)) - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { pStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_TOP_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 { pEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) } @@ -124462,10 +126558,10 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // The following constant maps TK_xx codes into corresponding // seek opcodes. It depends on a particular ordering of TK_xx *(*[4]U8)(unsafe.Pointer(bp + 16 /* aMoveOp */)) = [4]U8{ - /* TK_GT */ OP_SeekGT, - /* TK_LE */ OP_SeekLE, - /* TK_LT */ OP_SeekLT, - /* TK_GE */ OP_SeekGE, + /* TK_GT */ U8(OP_SeekGT), + /* TK_LE */ U8(OP_SeekLE), + /* TK_LT */ U8(OP_SeekLT), + /* TK_GE */ U8(OP_SeekGE), } // Make sure the ordering.. // ... of the TK_xx values... @@ -124486,7 +126582,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI op = int32(*(*U8)(unsafe.Pointer(bp + 16 /* &aMoveOp[0] */ + uintptr((int32((*Expr)(unsafe.Pointer(pX)).Fop) - TK_GT))))) } Xsqlite3VdbeAddOp3(tls, v, op, iCur, addrBrk, r1) - Xsqlite3VdbeComment(tls, v, ts+17201 /* "pk" */, 0) + Xsqlite3VdbeComment(tls, v, ts+17626 /* "pk" */, 0) Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 20 /* rTemp */))) } else { @@ -124527,9 +126623,9 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI start = Xsqlite3VdbeCurrentAddr(tls, v) (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = func() uint8 { if bRev != 0 { - return OP_Prev + return uint8(OP_Prev) } - return OP_Next + return uint8(OP_Next) }() (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start @@ -124541,7 +126637,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI Xsqlite3VdbeChangeP5(tls, v, (uint16(SQLITE_AFF_NUMERIC | SQLITE_JUMPIFNULL))) } - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_INDEXED) != 0 { + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != 0 { var nEq U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)) // Number of == or IN terms var nBtm U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)) // Length of BTM vector var nTop U16 = *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) // Length of TOP vector @@ -124562,6 +126658,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI var bStopAtNull U8 = U8(0) // Add condition to terminate at NULLs var omitTable int32 // True if we use the index only var regBignull int32 = 0 // big-null flag register + var addrSeekScan int32 = 0 // Opcode of the OP_SeekScan, if any pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) iIdxCur = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -124569,7 +126666,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // Find any inequality constraint terms for the start and end // of the range. j = int32(nEq) - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { pRangeStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) nExtraReg = func() int32 { if (nExtraReg) > (int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)))) { @@ -124580,7 +126677,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // Like optimization range constraints always occur in pairs } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_TOP_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_TOP_LIMIT)) != 0 { pRangeEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8)) nExtraReg = func() int32 { if (nExtraReg) > (int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)))) { @@ -124603,7 +126700,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // it is not. For an ASC sort, the non-NULL entries are scanned first. // For DESC, NULL entries are scanned first. if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_TOP_LIMIT | WHERE_BTM_LIMIT))) == U32(0)) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BIGNULL_SORT) != U32(0)) { + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BIGNULL_SORT)) != U32(0)) { nExtraReg = 1 bSeekPastNull = U8(1) @@ -124639,6 +126736,12 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } + if (iLevel > 0) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_SEEKSCAN)) != U32(0)) { + // In case OP_SeekScan is used, ensure that the index cursor does not + // point to a valid row for the first iteration of this loop. + Xsqlite3VdbeAddOp1(tls, v, OP_NullRow, iIdxCur) + } + // Generate code to evaluate all constraint terms using == or IN // and store the values of those terms in an array of registers // starting at regBase. @@ -124697,16 +126800,27 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // above has already left the cursor sitting on the correct row, // so no further seeking is needed } else { - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IN_EARLYOUT) != 0 { - Xsqlite3VdbeAddOp1(tls, v, OP_SeekHit, iIdxCur) - } if regBignull != 0 { Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, regBignull) - Xsqlite3VdbeComment(tls, v, ts+23372 /* "NULL-scan pass c..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+23830 /* "NULL-scan pass c..." */, 0) } op = int32(aStartOp[(((start_constraints << 2) + (startEq << 1)) + bRev)]) + if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_SEEKSCAN)) != U32(0)) && (op == OP_SeekGE) { + + // TUNING: The OP_SeekScan opcode seeks to reduce the number + // of expensive seek operations by replacing a single seek with + // 1 or more step operations. The question is, how many steps + // should we try before giving up and going with a seek. The cost + // of a seek is proportional to the logarithm of the of the number + // of entries in the tree, so basing the number of steps to try + // on the estimated number of rows in the btree seems like a good + // guess. + addrSeekScan = Xsqlite3VdbeAddOp1(tls, v, OP_SeekScan, + ((int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst))) + 9) / 10)) + + } Xsqlite3VdbeAddOp4Int(tls, v, op, iIdxCur, addrNxt, regBase, nConstraint) if regBignull != 0 { @@ -124762,19 +126876,22 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if regBignull != 0 { // Except, skip the end-of-range check while doing the NULL-scan Xsqlite3VdbeAddOp2(tls, v, OP_IfNot, regBignull, (Xsqlite3VdbeCurrentAddr(tls, v) + 3)) - Xsqlite3VdbeComment(tls, v, ts+23391 /* "If NULL-scan 2nd..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+23849 /* "If NULL-scan 2nd..." */, 0) } op = int32(aEndOp[((bRev * 2) + endEq)]) Xsqlite3VdbeAddOp4Int(tls, v, op, iIdxCur, addrNxt, regBase, nConstraint) + if addrSeekScan != 0 { + Xsqlite3VdbeJumpHere(tls, v, addrSeekScan) + } } if regBignull != 0 { // During a NULL-scan, check to see if we have reached the end of // the NULLs Xsqlite3VdbeAddOp2(tls, v, OP_If, regBignull, (Xsqlite3VdbeCurrentAddr(tls, v) + 2)) - Xsqlite3VdbeComment(tls, v, ts+23413 /* "If NULL-scan 1st..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+23871 /* "If NULL-scan 1st..." */, 0) op = int32(aEndOp[((bRev * 2) + int32(bSeekPastNull))]) Xsqlite3VdbeAddOp4Int(tls, v, op, iIdxCur, addrNxt, regBase, @@ -124782,26 +126899,17 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IN_EARLYOUT) != 0 { - Xsqlite3VdbeAddOp2(tls, v, OP_SeekHit, iIdxCur, 1) + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_EARLYOUT)) != U32(0) { + Xsqlite3VdbeAddOp3(tls, v, OP_SeekHit, iIdxCur, int32(nEq), int32(nEq)) } // Seek the table cursor, if required - omitTable = (libc.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IDX_ONLY) != U32(0)) && + omitTable = (libc.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IDX_ONLY)) != U32(0)) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_OR_SUBCLAUSE) == 0))) if omitTable != 0 { // pIdx is a covering index. No need to access the main table. - } else if ((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & TF_WithoutRowid) == U32(0) { - if ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_SEEK_TABLE) != 0) || - (((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_SEEK_UNIQ_TABLE) != 0) && - ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_SINGLE) || (int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) == 0))) { - iRowidReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) - Xsqlite3VdbeAddOp2(tls, v, OP_IdxRowid, iIdxCur, iRowidReg) - Xsqlite3VdbeAddOp3(tls, v, OP_NotExists, iCur, 0, iRowidReg) - - } else { - codeDeferredSeek(tls, pWInfo, pIdx, iCur, iIdxCur) - } + } else if ((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { + codeDeferredSeek(tls, pWInfo, pIdx, iCur, iIdxCur) } else if iCur != iIdxCur { var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable) iRowidReg = Xsqlite3GetTempRange(tls, pParse, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)) @@ -124852,29 +126960,29 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } // Record the instruction used to terminate the loop. - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_ONEROW) != 0 { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Noop + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) != 0 { + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop) } else if bRev != 0 { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Prev + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Prev) } else { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Next + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Next) } (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iIdxCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fp3 = func() uint8 { - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_UNQ_WANTED) != U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_UNQ_WANTED)) != U32(0) { return uint8(1) } return uint8(0) }() - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_CONSTRAINT) == U32(0) { - (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = SQLITE_STMTSTATUS_FULLSCAN_STEP + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_CONSTRAINT)) == U32(0) { + (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = U8(SQLITE_STMTSTATUS_FULLSCAN_STEP) } else { } if omitTable != 0 { pIdx = uintptr(0) } - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_MULTI_OR) != 0 { + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_MULTI_OR)) != 0 { // Case 5: Two or more separately indexed terms connected by OR // // Example: @@ -124929,14 +127037,13 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI var iRetInit int32 // Address of regReturn init var untestedTerms int32 = 0 // Some terms not completely tested var ii int32 // Loop counter - var wctrlFlags U16 // Flags for sub-WHERE clause var pAndExpr uintptr = uintptr(0) // An ".. AND (...)" expression - var pTab uintptr = (*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab + var pTab uintptr = (*SrcItem)(unsafe.Pointer(pTabItem)).FpTab pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - pOrWc = (*(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)) /* &.wc */) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Return + pOrWc = (*(*uintptr)(unsafe.Pointer(pTerm + 32 /* &.u */)) /* &.wc */) + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Return) (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = regReturn // Set up a new SrcList in pOrTab containing the table being scanned @@ -124946,16 +127053,16 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI var nNotReady int32 // The number of notReady tables var origSrc uintptr // Original list of tables nNotReady = ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel) - 1) - pOrTab = Xsqlite3DbMallocRaw(tls, db, (uint64(uint64(unsafe.Sizeof(SrcList{})) + (uint64(nNotReady) * uint64(unsafe.Sizeof(SrcList_item{})))))) + pOrTab = Xsqlite3DbMallocRaw(tls, db, (uint64(uint64(unsafe.Sizeof(SrcList{})) + (uint64(nNotReady) * uint64(unsafe.Sizeof(SrcItem{})))))) if pOrTab == uintptr(0) { return notReady } (*SrcList)(unsafe.Pointer(pOrTab)).FnAlloc = U32((U8(nNotReady + 1))) (*SrcList)(unsafe.Pointer(pOrTab)).FnSrc = int32((*SrcList)(unsafe.Pointer(pOrTab)).FnAlloc) - libc.Xmemcpy(tls, pOrTab+8 /* &.a */, pTabItem, uint64(unsafe.Sizeof(SrcList_item{}))) + libc.Xmemcpy(tls, pOrTab+8 /* &.a */, pTabItem, uint64(unsafe.Sizeof(SrcItem{}))) origSrc = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */ for k = 1; k <= nNotReady; k++ { - libc.Xmemcpy(tls, ((pOrTab + 8 /* &.a */) + uintptr(k)*112), (origSrc + uintptr((*WhereLevel)(unsafe.Pointer(pLevel+uintptr(k)*88)).FiFrom)*112), uint64(unsafe.Sizeof(SrcList_item{}))) + libc.Xmemcpy(tls, ((pOrTab + 8 /* &.a */) + uintptr(k)*112), (origSrc + uintptr((*WhereLevel)(unsafe.Pointer(pLevel+uintptr(k)*88)).FiFrom)*112), uint64(unsafe.Sizeof(SrcItem{}))) } } else { pOrTab = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList @@ -124973,7 +127080,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // fall through to the next instruction, just as an OP_Next does if // called on an uninitialized cursor. if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DUPLICATES_OK) == 0 { - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { regRowset = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, regRowset) } else { @@ -125002,15 +127109,15 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*WhereClause)(unsafe.Pointer(pWC)).FnTerm > 1 { var iTerm int32 for iTerm = 0; iTerm < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm; iTerm++ { - var pExpr uintptr = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*64)).FpExpr - if ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*64) == pTerm { + var pExpr uintptr = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*56)).FpExpr + if ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iTerm)*56) == pTerm { continue } - if (int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*64)).FwtFlags) & (TERM_VIRTUAL | TERM_CODED)) != 0 { + if (int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*56)).FwtFlags) & (TERM_VIRTUAL | TERM_CODED)) != 0 { continue } - if (int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*64)).FeOperator) & WO_ALL) == 0 { + if (int32((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iTerm)*56)).FeOperator) & WO_ALL) == 0 { continue } @@ -125030,10 +127137,9 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // Run a separate WHERE clause for each term of the OR clause. After // eliminating duplicates from other WHERE clauses, the action for each // sub-WHERE clause is to to invoke the main loop body as a subroutine. - wctrlFlags = (U16(WHERE_OR_SUBCLAUSE | (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_SEEK_TABLE))) - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+23435 /* "MULTI-INDEX OR" */, 0) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+23893 /* "MULTI-INDEX OR" */, 0) for ii = 0; ii < (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm; ii++ { - var pOrTerm uintptr = ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr(ii)*64) + var pOrTerm uintptr = ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr(ii)*56) if ((*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur) || ((int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator) & WO_AND) != 0) { var pSubWInfo uintptr // Info for single OR-term scan var pOrExpr uintptr = (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr // Current OR clause term @@ -125044,15 +127150,15 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } // Loop through table entries that match term pOrTerm. - Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+23450 /* "INDEX %d" */, libc.VaList(bp+8, (ii+1))) + Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+23908 /* "INDEX %d" */, libc.VaList(bp+8, (ii+1))) pSubWInfo = Xsqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), - wctrlFlags, iCovCur) + uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { var pSubLoop uintptr var addrExplain int32 = Xsqlite3WhereExplainOneScan(tls, - pParse, pOrTab, (pSubWInfo + 920 /* &.a */), uint16(0)) + pParse, pOrTab, (pSubWInfo + 856 /* &.a */), uint16(0)) _ = addrExplain _ = addrExplain @@ -125067,7 +127173,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } return ii }() - if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0) { + if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0) { Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, -1, regRowid) jmp1 = Xsqlite3VdbeAddOp4Int(tls, v, OP_RowSetTest, regRowset, 0, regRowid, iSet) @@ -125105,7 +127211,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI Xsqlite3VdbeAddOp4Int(tls, v, OP_IdxInsert, regRowset, regRowid, r, nPk) if iSet != 0 { - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) } } @@ -125142,16 +127248,19 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI // terms, set pCov to the candidate covering index. Otherwise, set // pCov to NULL to indicate that no candidate covering index will // be available. - pSubLoop = (*WhereLevel)(unsafe.Pointer((pSubWInfo + 920 /* &.a */))).FpWLoop + pSubLoop = (*WhereLevel)(unsafe.Pointer((pSubWInfo + 856 /* &.a */))).FpWLoop - if ((((*WhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags & WHERE_INDEXED) != U32(0)) && + if ((((*WhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags & U32(WHERE_INDEXED)) != U32(0)) && ((ii == 0) || (*(*uintptr)(unsafe.Pointer((pSubLoop + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) == pCov))) && - ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) { + ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) { pCov = *(*uintptr)(unsafe.Pointer(pSubLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) } else { pCov = uintptr(0) } + if Xsqlite3WhereUsesDeferredSeek(tls, pSubWInfo) != 0 { + libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bDeferredSeek */, uint32(1), 0, 0x1) + } // Finish the loop through table entries that match term pOrTerm. Xsqlite3WhereEnd(tls, pSubWInfo) @@ -125183,14 +127292,14 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (uint32(int32(*(*uint8)(unsafe.Pointer(pTabItem + 60 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5))) != 0 { // Tables marked isRecursive have only a single row that is stored in // a pseudo-cursor. No need to Rewind or Next such cursors. - (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = OP_Noop + (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(OP_Noop) } else { (*WhereLevel)(unsafe.Pointer(pLevel)).Fop = aStep[bRev] (*WhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = (1 + Xsqlite3VdbeAddOp2(tls, v, int32(aStart[bRev]), iCur, addrHalt)) - (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = SQLITE_STMTSTATUS_FULLSCAN_STEP + (*WhereLevel)(unsafe.Pointer(pLevel)).Fp5 = U8(SQLITE_STMTSTATUS_FULLSCAN_STEP) } } @@ -125235,7 +127344,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } pE = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if ((int32((*SrcList_item)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) && !(((*Expr)(unsafe.Pointer((pE))).Fflags & (EP_FromJoin)) != U32(0)) { + if ((int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0) && !(((*Expr)(unsafe.Pointer((pE))).Fflags & (U32(EP_FromJoin))) != U32(0)) { goto __2 } @@ -125268,7 +127377,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI goto __2 __2: j-- - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -125306,12 +127415,12 @@ __4: if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != iCur { goto __5 } - if (int32((*SrcList_item)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0 { + if (int32((*SrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype) & JT_LEFT) != 0 { goto __5 } pE = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - pAlt = Xsqlite3WhereFindTerm(tls, pWC, iCur, *(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)), notReady, + pAlt = Xsqlite3WhereFindTerm(tls, pWC, iCur, *(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)), notReady, (uint32((WO_EQ | WO_IN) | WO_IS)), uintptr(0)) if pAlt == uintptr(0) { goto __5 @@ -125320,7 +127429,7 @@ __4: goto __5 } if (((int32((*WhereTerm)(unsafe.Pointer(pAlt)).FeOperator) & WO_IN) != 0) && - (((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr)).Fflags & EP_xIsSelect) != 0)) && + (((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr)).Fflags & U32(EP_xIsSelect)) != 0)) && ((*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr + 32 /* &.x */)))).FpEList)).FnExpr > 1) { goto __5 } @@ -125333,7 +127442,7 @@ __4: goto __5 __5: j-- - pTerm += 64 + pTerm += 56 goto __4 goto __6 __6: @@ -125344,7 +127453,7 @@ __6: if (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin != 0 { (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrFirst = Xsqlite3VdbeCurrentAddr(tls, v) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 1, (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin) - Xsqlite3VdbeComment(tls, v, ts+23459 /* "record LEFT JOIN..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+23917 /* "record LEFT JOIN..." */, 0) pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa j = 0 __7: @@ -125368,7 +127477,7 @@ __6: goto __8 __8: j++ - pTerm += 64 + pTerm += 56 goto __7 goto __9 __9: @@ -125380,30 +127489,30 @@ __6: var aStartOp = [8]U8{ U8(0), U8(0), - OP_Rewind, // 2: (!start_constraints && startEq && !bRev) - OP_Last, // 3: (!start_constraints && startEq && bRev) - OP_SeekGT, // 4: (start_constraints && !startEq && !bRev) - OP_SeekLT, // 5: (start_constraints && !startEq && bRev) - OP_SeekGE, // 6: (start_constraints && startEq && !bRev) - OP_SeekLE, // 7: (start_constraints && startEq && bRev) -} /* sqlite3.c:143140:21 */ + U8(OP_Rewind), // 2: (!start_constraints && startEq && !bRev) + U8(OP_Last), // 3: (!start_constraints && startEq && bRev) + U8(OP_SeekGT), // 4: (start_constraints && !startEq && !bRev) + U8(OP_SeekLT), // 5: (start_constraints && !startEq && bRev) + U8(OP_SeekGE), // 6: (start_constraints && startEq && !bRev) + U8(OP_SeekLE), // 7: (start_constraints && startEq && bRev) +} /* sqlite3.c:145427:21 */ var aEndOp = [4]U8{ - OP_IdxGE, // 0: (end_constraints && !bRev && !endEq) - OP_IdxGT, // 1: (end_constraints && !bRev && endEq) - OP_IdxLE, // 2: (end_constraints && bRev && !endEq) - OP_IdxLT, // 3: (end_constraints && bRev && endEq) -} /* sqlite3.c:143150:21 */ -var aStep = [2]U8{OP_Next, OP_Prev} /* sqlite3.c:143816:21 */ -var aStart = [2]U8{OP_Rewind, OP_Last} /* sqlite3.c:143817:21 */ + U8(OP_IdxGE), // 0: (end_constraints && !bRev && !endEq) + U8(OP_IdxGT), // 1: (end_constraints && !bRev && endEq) + U8(OP_IdxLE), // 2: (end_constraints && bRev && !endEq) + U8(OP_IdxLT), // 3: (end_constraints && bRev && endEq) +} /* sqlite3.c:145437:21 */ +var aStep = [2]U8{U8(OP_Next), U8(OP_Prev)} /* sqlite3.c:146113:21 */ +var aStart = [2]U8{U8(OP_Rewind), U8(OP_Last)} /* sqlite3.c:146114:21 */ // Deallocate all memory associated with a WhereOrInfo object. -func whereOrInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:144024:13: */ +func whereOrInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:146321:13: */ Xsqlite3WhereClauseClear(tls, (p /* &.wc */)) Xsqlite3DbFree(tls, db, p) } // Deallocate all memory associated with a WhereAndInfo object. -func whereAndInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:144032:13: */ +func whereAndInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:146329:13: */ Xsqlite3WhereClauseClear(tls, (p /* &.wc */)) Xsqlite3DbFree(tls, db, p) } @@ -125425,7 +127534,7 @@ func whereAndInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:144 // 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 *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 { /* sqlite3.c:144056:12: */ +func whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 { /* sqlite3.c:146353:12: */ var pTerm uintptr var idx int32 @@ -125446,8 +127555,8 @@ func whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 } (*WhereClause)(unsafe.Pointer(pWC)).FnSlot = (int32(uint64(Xsqlite3DbMallocSize(tls, db, (*WhereClause)(unsafe.Pointer(pWC)).Fa)) / uint64(unsafe.Sizeof(WhereTerm{})))) } - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(libc.AssignInt32(&idx, libc.PostIncInt32(&(*WhereClause)(unsafe.Pointer(pWC)).FnTerm, 1)))*64) - if (p != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (EP_Unlikely)) != U32(0)) { + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(libc.AssignInt32(&idx, libc.PostIncInt32(&(*WhereClause)(unsafe.Pointer(pWC)).FnTerm, 1)))*56) + if (p != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_Unlikely))) != U32(0)) { (*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = (LogEst(int32(Xsqlite3LogEst(tls, uint64((*Expr)(unsafe.Pointer(p)).FiTable))) - 270)) } else { (*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = int16(1) @@ -125464,18 +127573,18 @@ func whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 // 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 *libc.TLS, op int32) int32 { /* sqlite3.c:144097:12: */ +func allowedOp(tls *libc.TLS, op int32) int32 { /* sqlite3.c:146394:12: */ return (libc.Bool32((((op == TK_IN) || ((op >= TK_EQ) && (op <= TK_GE))) || (op == TK_ISNULL)) || (op == TK_IS))) } // Commute a comparison operator. Expressions of the form "X op Y" // are converted into "Y op X". -func exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3.c:144109:12: */ +func exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3.c:146406:12: */ if ((int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR) || (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fop) == TK_VECTOR)) || (Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight) != Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) { - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) ^= (EP_Commuted) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) ^= (U32(EP_Commuted)) } { var t uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpRight @@ -125491,15 +127600,15 @@ func exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3. } // Translate from TK_xx operator to WO_xx bitmask. -func operatorMask(tls *libc.TLS, op int32) U16 { /* sqlite3.c:144132:12: */ +func operatorMask(tls *libc.TLS, op int32) U16 { /* sqlite3.c:146429:12: */ var c U16 if op == TK_IN { - c = WO_IN + c = U16(WO_IN) } else if op == TK_ISNULL { - c = WO_ISNULL + c = U16(WO_ISNULL) } else if op == TK_IS { - c = WO_IS + c = U16(WO_IS) } else { c = (U16(int32(WO_EQ) << (op - TK_EQ))) @@ -125518,7 +127627,7 @@ func operatorMask(tls *libc.TLS, op int32) U16 { /* sqlite3.c:144132:12: */ // 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 *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr, pisComplete uintptr, pnoCase uintptr) int32 { /* sqlite3.c:144170:12: */ +func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr, pisComplete uintptr, pnoCase uintptr) int32 { /* sqlite3.c:146467:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -125543,10 +127652,10 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr pRight = Xsqlite3ExprSkipCollate(tls, (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */))).FpExpr) op = int32((*Expr)(unsafe.Pointer(pRight)).Fop) - if (op == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_EnableQPSG) == uint64(0)) { + if (op == TK_VARIABLE) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_EnableQPSG)) == uint64(0)) { var pReprepare uintptr = (*Parse)(unsafe.Pointer(pParse)).FpReprepare var iCol int32 = int32((*Expr)(unsafe.Pointer(pRight)).FiColumn) - pVal = Xsqlite3VdbeGetBoundValue(tls, pReprepare, iCol, SQLITE_AFF_BLOB) + pVal = Xsqlite3VdbeGetBoundValue(tls, pReprepare, iCol, uint8(SQLITE_AFF_BLOB)) if (pVal != 0) && (Xsqlite3_value_type(tls, pVal) == SQLITE_TEXT) { z = Xsqlite3_value_text(tls, pVal) } @@ -125613,13 +127722,13 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr var isNum int32 // var rDummy float64 at bp+8, 8 - isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, SQLITE_UTF8) + isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, uint8(SQLITE_UTF8)) if isNum <= 0 { if (iTo == 1) && (int32(*(*int8)(unsafe.Pointer(zNew))) == '-') { isNum = +1 } else { *(*int8)(unsafe.Pointer(zNew + uintptr((iTo - 1))))++ - isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, SQLITE_UTF8) + isNum = Xsqlite3AtoF(tls, zNew, bp+8 /* &rDummy */, iTo, uint8(SQLITE_UTF8)) *(*int8)(unsafe.Pointer(zNew + uintptr((iTo - 1))))-- } } @@ -125683,7 +127792,7 @@ func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr // of virtual table in forms (5) or (7) then return 2. // // If the expression matches none of the patterns above, return 0. -func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uintptr, ppLeft uintptr, ppRight uintptr) int32 { /* sqlite3.c:144342:12: */ +func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uintptr, ppLeft uintptr, ppRight uintptr) int32 { /* sqlite3.c:146639:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -125768,13 +127877,13 @@ func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uin *(*uintptr)(unsafe.Pointer(ppLeft)) = pLeft *(*uintptr)(unsafe.Pointer(ppRight)) = pRight if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NE { - *(*uint8)(unsafe.Pointer(peOp2)) = SQLITE_INDEX_CONSTRAINT_NE + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_NE) } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_ISNOT { - *(*uint8)(unsafe.Pointer(peOp2)) = SQLITE_INDEX_CONSTRAINT_ISNOT + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOT) } if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL { - *(*uint8)(unsafe.Pointer(peOp2)) = SQLITE_INDEX_CONSTRAINT_ISNOTNULL + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOTNULL) } return res } @@ -125785,43 +127894,43 @@ type Op2 = struct { FzOp uintptr FeOp2 uint8 _ [7]byte -} /* sqlite3.c:144350:18 */ +} /* sqlite3.c:146647:18 */ var aOp = [4]Op2{ - {FzOp: ts + 17162 /* "match" */, FeOp2: SQLITE_INDEX_CONSTRAINT_MATCH}, - {FzOp: ts + 16456 /* "glob" */, FeOp2: SQLITE_INDEX_CONSTRAINT_GLOB}, - {FzOp: ts + 16016 /* "like" */, FeOp2: SQLITE_INDEX_CONSTRAINT_LIKE}, - {FzOp: ts + 23480 /* "regexp" */, FeOp2: SQLITE_INDEX_CONSTRAINT_REGEXP}, -} /* sqlite3.c:144353:7 */ + {FzOp: ts + 17587 /* "match" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH)}, + {FzOp: ts + 16928 /* "glob" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB)}, + {FzOp: ts + 16478 /* "like" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE)}, + {FzOp: ts + 23938 /* "regexp" */, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP)}, +} /* sqlite3.c:146650:7 */ // 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 *libc.TLS, pDerived uintptr, pBase uintptr) { /* sqlite3.c:144447:13: */ +func transferJoinMarkings(tls *libc.TLS, pDerived uintptr, pBase uintptr) { /* sqlite3.c:146744:13: */ if pDerived != 0 { - *(*U32)(unsafe.Pointer(pDerived + 4 /* &.flags */)) |= ((*Expr)(unsafe.Pointer(pBase)).Fflags & EP_FromJoin) + *(*U32)(unsafe.Pointer(pDerived + 4 /* &.flags */)) |= ((*Expr)(unsafe.Pointer(pBase)).Fflags & U32(EP_FromJoin)) (*Expr)(unsafe.Pointer(pDerived)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pBase)).FiRightJoinTable } } // Mark term iChild as being a child of term iParent -func markTermAsChild(tls *libc.TLS, pWC uintptr, iChild int32, iParent int32) { /* sqlite3.c:144457:13: */ - (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*64)).FiParent = iParent - (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*64)).FtruthProb = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iParent)*64)).FtruthProb - (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iParent)*64)).FnChild++ +func markTermAsChild(tls *libc.TLS, pWC uintptr, iChild int32, iParent int32) { /* sqlite3.c:146754:13: */ + (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*56)).FiParent = iParent + (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*56)).FtruthProb = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iParent)*56)).FtruthProb + (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iParent)*56)).FnChild++ } // 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 *libc.TLS, pTerm uintptr, N int32) uintptr { /* sqlite3.c:144468:18: */ +func whereNthSubterm(tls *libc.TLS, pTerm uintptr, N int32) uintptr { /* sqlite3.c:146765:18: */ if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) != WO_AND { if N == 0 { return pTerm } return uintptr(0) } - if N < (*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)))).Fwc.FnTerm { - return ((*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)))).Fwc.Fa + uintptr(N)*64) + if N < (*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 32 /* &.u */)))).Fwc.FnTerm { + return ((*WhereAndInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 32 /* &.u */)))).Fwc.Fa + uintptr(N)*56) } return uintptr(0) } @@ -125844,7 +127953,7 @@ func whereNthSubterm(tls *libc.TLS, pTerm uintptr, N int32) uintptr { /* sqlite3 // The following is NOT generated: // // xy --> x!=y -func whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintptr, pTwo uintptr) { /* sqlite3.c:144498:13: */ +func whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintptr, pTwo uintptr) { /* sqlite3.c:146795:13: */ var eOp U16 = (U16(int32((*WhereTerm)(unsafe.Pointer(pOne)).FeOperator) | int32((*WhereTerm)(unsafe.Pointer(pTwo)).FeOperator))) var db uintptr // Database connection (for malloc) var pNew uintptr // New virtual expression @@ -125974,11 +128083,11 @@ func whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintpt // // 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 *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:144624:13: */ +func exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:146921:13: */ var pWInfo uintptr = (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo // WHERE clause processing context var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse // Parser context var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database connection - var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) // The term to be analyzed + var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) // The term to be analyzed var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr // The expression of the term var i int32 // Loop counters var pOrWc uintptr // Breakup of pTerm into subterms @@ -125991,7 +128100,7 @@ func exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // stored in a WhereClause structure containing within the WhereOrInfo // object that is attached to the original OR clause term. - *(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)) = libc.AssignUintptr(&pOrInfo, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(WhereOrInfo{})))) + *(*uintptr)(unsafe.Pointer(pTerm + 32 /* &.u */)) = libc.AssignUintptr(&pOrInfo, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(WhereOrInfo{})))) if pOrInfo == uintptr(0) { return } @@ -125999,7 +128108,7 @@ func exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) pOrWc = (pOrInfo /* &.wc */) libc.Xmemset(tls, pOrWc+40 /* &.aStatic */, 0, uint64(unsafe.Sizeof([8]WhereTerm{}))) Xsqlite3WhereClauseInit(tls, pOrWc, pWInfo) - Xsqlite3WhereSplit(tls, pOrWc, pExpr, TK_OR) + Xsqlite3WhereSplit(tls, pOrWc, pExpr, uint8(TK_OR)) Xsqlite3WhereExprAnalyze(tls, pSrc, pOrWc) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return @@ -126025,13 +128134,13 @@ __1: var pAndTerm uintptr var j int32 var b Bitmask = uint64(0) - *(*uintptr)(unsafe.Pointer(pOrTerm + 40 /* &.u */)) = pAndInfo + *(*uintptr)(unsafe.Pointer(pOrTerm + 32 /* &.u */)) = pAndInfo *(*U16)(unsafe.Pointer(pOrTerm + 18 /* &.wtFlags */)) |= U16((TERM_ANDINFO)) - (*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator = WO_AND + (*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator = U16(WO_AND) pAndWC = (pAndInfo /* &.wc */) libc.Xmemset(tls, pAndWC+40 /* &.aStatic */, 0, uint64(unsafe.Sizeof([8]WhereTerm{}))) Xsqlite3WhereClauseInit(tls, pAndWC, (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo) - Xsqlite3WhereSplit(tls, pAndWC, (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr, TK_AND) + Xsqlite3WhereSplit(tls, pAndWC, (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr, uint8(TK_AND)) Xsqlite3WhereExprAnalyze(tls, pSrc, pAndWC) (*WhereClause)(unsafe.Pointer(pAndWC)).FpOuter = pWC if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { @@ -126045,14 +128154,14 @@ __1: if (allowedOp(tls, int32((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAndTerm)).FpExpr)).Fop)) != 0) || (int32((*WhereTerm)(unsafe.Pointer(pAndTerm)).FeOperator) == WO_AUX) { - b = b | (Xsqlite3WhereGetMask(tls, (pWInfo + 656 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pAndTerm)).FleftCursor)) + b = b | (Xsqlite3WhereGetMask(tls, (pWInfo + 592 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pAndTerm)).FleftCursor)) } } goto __5 __5: j++ - pAndTerm += 64 + pAndTerm += 56 goto __4 goto __6 __6: @@ -126064,10 +128173,10 @@ __1: // corresponding TERM_VIRTUAL term } else { var b Bitmask - b = Xsqlite3WhereGetMask(tls, (pWInfo + 656 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor) + b = Xsqlite3WhereGetMask(tls, (pWInfo + 592 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor) if (int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FwtFlags) & TERM_VIRTUAL) != 0 { - var pOther uintptr = ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pOrTerm)).FiParent)*64) - b = b | (Xsqlite3WhereGetMask(tls, (pWInfo + 656 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pOther)).FleftCursor)) + var pOther uintptr = ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pOrTerm)).FiParent)*56) + b = b | (Xsqlite3WhereGetMask(tls, (pWInfo + 592 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pOther)).FleftCursor)) } indexable = indexable & (b) if (int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator) & WO_EQ) == 0 { @@ -126081,7 +128190,7 @@ __1: goto __2 __2: i-- - pOrTerm += 64 + pOrTerm += 56 goto __1 goto __3 __3: @@ -126091,10 +128200,10 @@ __3: // empty. (*WhereOrInfo)(unsafe.Pointer(pOrInfo)).Findexable = indexable if indexable != 0 { - (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = WO_OR + (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_OR) (*WhereClause)(unsafe.Pointer(pWC)).FhasOr = U8(1) } else { - (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = WO_OR + (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(WO_OR) } // For a two-way OR, attempt to implementation case 2. @@ -126104,7 +128213,7 @@ __3: for (libc.AssignUintptr(&pOne, whereNthSubterm(tls, ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa), libc.PostIncInt32(&iOne, 1)))) != uintptr(0) { var iTwo int32 = 0 var pTwo uintptr - for (libc.AssignUintptr(&pTwo, whereNthSubterm(tls, ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa+1*64), libc.PostIncInt32(&iTwo, 1)))) != uintptr(0) { + for (libc.AssignUintptr(&pTwo, whereNthSubterm(tls, ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa+1*56), libc.PostIncInt32(&iTwo, 1)))) != uintptr(0) { whereCombineDisjuncts(tls, pSrc, pWC, pOne, pTwo) } } @@ -126157,7 +128266,7 @@ __3: goto __8 } - if (chngToIN & Xsqlite3WhereGetMask(tls, (pWInfo+656 /* &.sMaskSet */), + if (chngToIN & Xsqlite3WhereGetMask(tls, (pWInfo+592 /* &.sMaskSet */), (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor)) == uint64(0) { // This term must be of the form t1.a==t2.b where t2 is in the // chngToIN set but t1 is not. This term will be either preceded @@ -126166,7 +128275,7 @@ __3: goto __8 } - iColumn = *(*int32)(unsafe.Pointer(pOrTerm + 40 /* &.u */)) + iColumn = *(*int32)(unsafe.Pointer(pOrTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) iCursor = (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor pLeft = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft goto __9 @@ -126175,7 +128284,7 @@ __3: goto __8 __8: i-- - pOrTerm += 64 + pOrTerm += 56 goto __7 goto __9 __9: @@ -126198,7 +128307,7 @@ __3: if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor != iCursor { *(*U16)(unsafe.Pointer(pOrTerm + 18 /* &.wtFlags */)) &= libc.Uint16FromInt32((libc.CplInt32(TERM_OR_OK))) - } else if (*(*int32)(unsafe.Pointer(pOrTerm + 40 /* &.u */)) != iColumn) || ((iColumn == (-2)) && + } else if (*(*int32)(unsafe.Pointer((pOrTerm + 32 /* &.u */ /* &.x */) /* &.leftColumn */)) != iColumn) || ((iColumn == (-2)) && (Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft, pLeft, -1) != 0)) { okToChngToIN = 0 } else { @@ -126220,7 +128329,7 @@ __3: goto __11 __11: i-- - pOrTerm += 64 + pOrTerm += 56 goto __10 goto __12 __12: @@ -126254,7 +128363,7 @@ __3: goto __14 __14: i-- - pOrTerm += 64 + pOrTerm += 56 goto __13 goto __15 __15: @@ -126292,17 +128401,17 @@ __3: // 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 *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:144895:12: */ +func termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:147192:12: */ var aff1 int8 var aff2 int8 var pColl uintptr - if !((int32((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags) & (SQLITE_Transitive)) == 0) { + if !(((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags & (U32(SQLITE_Transitive))) == U32(0)) { return 0 } if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_EQ) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_IS) { return 0 } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { return 0 } aff1 = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) @@ -126321,7 +128430,7 @@ func termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* // Recursively walk the expressions of a SELECT statement and generate // a bitmask indicating which tables are used in that expression // tree. -func exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* sqlite3.c:144918:16: */ +func exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* sqlite3.c:147215:16: */ var mask Bitmask = uint64(0) for pS != 0 { var pSrc uintptr = (*Select)(unsafe.Pointer(pS)).FpSrc @@ -126333,8 +128442,8 @@ func exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* s if pSrc != uintptr(0) { var i int32 for i = 0; i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; i++ { - mask = mask | (exprSelectUsage(tls, pMaskSet, (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpSelect)) - mask = mask | (Xsqlite3WhereExprUsage(tls, pMaskSet, (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpOn)) + mask = mask | (exprSelectUsage(tls, pMaskSet, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpSelect)) + mask = mask | (Xsqlite3WhereExprUsage(tls, pMaskSet, (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpOn)) if (uint32(int32(*(*uint8)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112 + 60 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 { mask = mask | (Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112 + 96 /* &.u1 */)))) } @@ -126356,7 +128465,7 @@ func exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* s // 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 *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr) int32 { /* sqlite3.c:144955:28: */ +func exprMightBeIndexed2(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr) int32 { /* sqlite3.c:147252:28: */ var pIdx uintptr var i int32 var iCur int32 @@ -126375,8 +128484,8 @@ __2: goto __3 __3: ; - iCur = (*SrcList_item)(unsafe.Pointer((pFrom + 8 /* &.a */) + uintptr(i)*112)).FiCursor - for pIdx = (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pFrom + 8 /* &.a */) + uintptr(i)*112)).FpTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext { + iCur = (*SrcItem)(unsafe.Pointer((pFrom + 8 /* &.a */) + uintptr(i)*112)).FiCursor + for pIdx = (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pFrom + 8 /* &.a */) + uintptr(i)*112)).FpTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext { if (*Index)(unsafe.Pointer(pIdx)).FaColExpr == uintptr(0) { continue } @@ -126394,7 +128503,7 @@ __3: return 0 } -func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr, op int32) int32 { /* sqlite3.c:144979:12: */ +func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr, op int32) int32 { /* sqlite3.c:147276:12: */ // If this expression is a vector to the left or right of a // inequality constraint (>, <, >= or <=), perform the processing // on the first element of the vector. @@ -126417,6 +128526,299 @@ func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol return exprMightBeIndexed2(tls, pFrom, mPrereq, aiCurCol, pExpr) } +// Expression callback for exprUsesSrclist(). +func exprUsesSrclistCb(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:147306:12: */ + if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN { + var pSrc uintptr = *(*uintptr)(unsafe.Pointer(p + 40 /* &.u */)) + var iCsr int32 = (*Expr)(unsafe.Pointer(pExpr)).FiTable + var ii int32 + for ii = 0; ii < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc; ii++ { + if (*SrcItem)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(ii)*112)).FiCursor == iCsr { + if (*Walker)(unsafe.Pointer(p)).FeCode != 0 { + return WRC_Abort + } + return WRC_Continue + } + } + if (*Walker)(unsafe.Pointer(p)).FeCode != 0 { + return WRC_Continue + } + return WRC_Abort + } + return WRC_Continue +} + +// Select callback for exprUsesSrclist(). +func exprUsesSrclistSelectCb(tls *libc.TLS, NotUsed1 uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:147324:12: */ + _ = NotUsed1 + _ = NotUsed2 + return WRC_Abort +} + +// This function always returns true if expression pExpr contains +// a sub-select. +// +// If there is no sub-select in pExpr, then return true if pExpr +// contains a TK_COLUMN node for a table that is (bUses==1) +// or is not (bUses==0) in pSrc. +// +// Said another way: +// +// bUses Return Meaning +// -------- ------ ------------------------------------------------ +// +// bUses==1 true pExpr contains either a sub-select or a +// TK_COLUMN referencing pSrc. +// +// bUses==1 false pExpr contains no sub-selects and all TK_COLUMN +// nodes reference tables not found in pSrc +// +// bUses==0 true pExpr contains either a sub-select or a TK_COLUMN +// that references a table not in pSrc. +// +// bUses==0 false pExpr contains no sub-selects and all TK_COLUMN +// nodes reference pSrc +func exprUsesSrclist(tls *libc.TLS, pSrc uintptr, pExpr uintptr, bUses int32) int32 { /* sqlite3.c:147355:12: */ + bp := tls.Alloc(48) + defer tls.Free(48) + + // var sWalker Walker at bp, 48 + + libc.Xmemset(tls, bp /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{}))) + (*Walker)(unsafe.Pointer(bp /* &sWalker */)).FeCode = U16(bUses) + *(*uintptr)(unsafe.Pointer(bp /* &sWalker */ + 40 /* &.u */)) = pSrc + (*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) int32 + }{exprUsesSrclistCb})) + (*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr) int32 + }{exprUsesSrclistSelectCb})) + return (libc.Bool32(Xsqlite3WalkExpr(tls, bp /* &sWalker */, pExpr) == WRC_Abort)) +} + +// Context object used by exprExistsToInIter() as it iterates through an +// expression tree. +type ExistsToInCtx = struct { + FpSrc uintptr + FpInLhs uintptr + FpEq uintptr + FppAnd uintptr + FppParent uintptr +} /* sqlite3.c:147369:1 */ + +// Iterate through all AND connected nodes in the expression tree +// headed by (*ppExpr), populating the structure passed as the first +// argument with the values required by exprAnalyzeExistsFindEq(). +// +// This function returns non-zero if the expression tree does not meet +// the two conditions described by the header comment for +// exprAnalyzeExistsFindEq(), or zero if it does. +func exprExistsToInIter(tls *libc.TLS, p uintptr, ppExpr uintptr) int32 { /* sqlite3.c:147386:12: */ + var pExpr uintptr = *(*uintptr)(unsafe.Pointer(ppExpr)) + switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) { + case TK_AND: + (*ExistsToInCtx)(unsafe.Pointer(p)).FppParent = ppExpr + if exprExistsToInIter(tls, p, (pExpr+16 /* &.pLeft */)) != 0 { + return 1 + } + (*ExistsToInCtx)(unsafe.Pointer(p)).FppParent = ppExpr + if exprExistsToInIter(tls, p, (pExpr+24 /* &.pRight */)) != 0 { + return 1 + } + break + case TK_EQ: + { + var bLeft int32 = exprUsesSrclist(tls, (*ExistsToInCtx)(unsafe.Pointer(p)).FpSrc, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, 0) + var bRight int32 = exprUsesSrclist(tls, (*ExistsToInCtx)(unsafe.Pointer(p)).FpSrc, (*Expr)(unsafe.Pointer(pExpr)).FpRight, 0) + if (bLeft != 0) || (bRight != 0) { + if ((bLeft != 0) && (bRight != 0)) || ((*ExistsToInCtx)(unsafe.Pointer(p)).FpInLhs != 0) { + return 1 + } + (*ExistsToInCtx)(unsafe.Pointer(p)).FpInLhs = func() uintptr { + if bLeft != 0 { + return (*Expr)(unsafe.Pointer(pExpr)).FpLeft + } + return (*Expr)(unsafe.Pointer(pExpr)).FpRight + }() + if exprUsesSrclist(tls, (*ExistsToInCtx)(unsafe.Pointer(p)).FpSrc, (*ExistsToInCtx)(unsafe.Pointer(p)).FpInLhs, 1) != 0 { + return 1 + } + (*ExistsToInCtx)(unsafe.Pointer(p)).FpEq = pExpr + (*ExistsToInCtx)(unsafe.Pointer(p)).FppAnd = (*ExistsToInCtx)(unsafe.Pointer(p)).FppParent + } + break + + } + default: + if exprUsesSrclist(tls, (*ExistsToInCtx)(unsafe.Pointer(p)).FpSrc, pExpr, 0) != 0 { + return 1 + } + break + } + + return 0 +} + +// This function is used by exprAnalyzeExists() when creating virtual IN(...) +// terms equivalent to user-supplied EXIST(...) clauses. It splits the WHERE +// clause of the Select object passed as the first argument into one or more +// expressions joined by AND operators, and then tests if the following are +// true: +// +// 1. Exactly one of the AND separated terms refers to the outer +// query, and it is an == (TK_EQ) expression. +// +// 2. Only one side of the == expression refers to the outer query, and +// it does not refer to any columns from the inner query. +// +// If both these conditions are true, then a pointer to the side of the == +// expression that refers to the outer query is returned. The caller will +// use this expression as the LHS of the IN(...) virtual term. Or, if one +// or both of the above conditions are not true, NULL is returned. +// +// If non-NULL is returned and ppEq is non-NULL, *ppEq is set to point +// to the == expression node before returning. If pppAnd is non-NULL and +// the == node is not the root of the WHERE clause, then *pppAnd is set +// to point to the pointer to the AND node that is the parent of the == +// node within the WHERE expression tree. +func exprAnalyzeExistsFindEq(tls *libc.TLS, pSel uintptr, ppEq uintptr, pppAnd uintptr) uintptr { /* sqlite3.c:147441:13: */ + bp := tls.Alloc(40) + defer tls.Free(40) + + // var ctx ExistsToInCtx at bp, 40 + + libc.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(ExistsToInCtx{}))) + (*ExistsToInCtx)(unsafe.Pointer(bp /* &ctx */)).FpSrc = (*Select)(unsafe.Pointer(pSel)).FpSrc + if exprExistsToInIter(tls, bp /* &ctx */, (pSel+48 /* &.pWhere */)) != 0 { + return uintptr(0) + } + if ppEq != 0 { + *(*uintptr)(unsafe.Pointer(ppEq)) = (*ExistsToInCtx)(unsafe.Pointer(bp /* &ctx */)).FpEq + } + if pppAnd != 0 { + *(*uintptr)(unsafe.Pointer(pppAnd)) = (*ExistsToInCtx)(unsafe.Pointer(bp /* &ctx */)).FppAnd + } + return (*ExistsToInCtx)(unsafe.Pointer(bp /* &ctx */)).FpInLhs +} + +// Term idxTerm of the WHERE clause passed as the second argument is an +// EXISTS expression with a correlated SELECT statement on the RHS. +// This function analyzes the SELECT statement, and if possible adds an +// equivalent "? IN(SELECT...)" virtual term to the WHERE clause. +// +// For an EXISTS term such as the following: +// +// EXISTS (SELECT ... FROM WHERE = AND ) +// +// The virtual IN() term added is: +// +// IN (SELECT FROM WHERE ) +// +// The virtual term is only added if the following conditions are met: +// +// 1. The sub-select must not be an aggregate or use window functions, +// +// 2. The sub-select must not be a compound SELECT, +// +// 3. Expression must refer to at least one column from the outer +// query, and must not refer to any column from the inner query +// (i.e. from ). +// +// 4. and must not refer to any values from the outer query. +// In other words, once has been removed, the inner query +// must not be correlated. +// +func exprAnalyzeExists(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:147486:13: */ + bp := tls.Alloc(16) + defer tls.Free(16) + + var pParse uintptr = (*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse + var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) + var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr + var pSel uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + var pDup uintptr = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp /* pEq */)) = uintptr(0) + var pRet uintptr = uintptr(0) + var pInLhs uintptr = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 8 /* ppAnd */)) = uintptr(0) + var idxNew int32 + var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb + + if ((*Select)(unsafe.Pointer(pSel)).FselFlags & U32(SF_Aggregate)) != 0 { + return + } + if (*Select)(unsafe.Pointer(pSel)).FpWin != 0 { + return + } + if (*Select)(unsafe.Pointer(pSel)).FpPrior != 0 { + return + } + if (*Select)(unsafe.Pointer(pSel)).FpWhere == uintptr(0) { + return + } + if uintptr(0) == exprAnalyzeExistsFindEq(tls, pSel, uintptr(0), uintptr(0)) { + return + } + + pDup = Xsqlite3ExprDup(tls, db, pExpr, 0) + if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + Xsqlite3ExprDelete(tls, db, pDup) + return + } + pSel = *(*uintptr)(unsafe.Pointer(pDup + 32 /* &.x */)) + Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(pSel)).FpEList) + (*Select)(unsafe.Pointer(pSel)).FpEList = uintptr(0) + + pInLhs = exprAnalyzeExistsFindEq(tls, pSel, bp /* &pEq */, bp+8 /* &ppAnd */) + + if pInLhs == (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pEq */)))).FpLeft { + pRet = (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pEq */)))).FpRight + } else { + var p uintptr = Xsqlite3ExprCompareCollSeq(tls, pParse, *(*uintptr)(unsafe.Pointer(bp /* pEq */))) + pInLhs = Xsqlite3ExprAddCollateString(tls, pParse, pInLhs, func() uintptr { + if p != 0 { + return (*CollSeq)(unsafe.Pointer(p)).FzName + } + return ts + 363 /* "BINARY" */ + }()) + pRet = (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pEq */)))).FpLeft + } + + (*Expr)(unsafe.Pointer(pDup)).Fop = U8(TK_IN) + (*Expr)(unsafe.Pointer(pDup)).FpLeft = pInLhs + *(*U32)(unsafe.Pointer(pDup + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_VarSelect))) + if int32((*Expr)(unsafe.Pointer(pRet)).Fop) == TK_VECTOR { + (*Select)(unsafe.Pointer(pSel)).FpEList = *(*uintptr)(unsafe.Pointer(pRet + 32 /* &.x */)) + *(*uintptr)(unsafe.Pointer(pRet + 32 /* &.x */)) = uintptr(0) + Xsqlite3ExprDelete(tls, db, pRet) + } else { + (*Select)(unsafe.Pointer(pSel)).FpEList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), pRet) + } + (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pEq */)))).FpLeft = uintptr(0) + (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pEq */)))).FpRight = uintptr(0) + if *(*uintptr)(unsafe.Pointer(bp + 8 /* ppAnd */)) != 0 { + var pAnd uintptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* ppAnd */)))) + var pOther uintptr + if (*Expr)(unsafe.Pointer(pAnd)).FpLeft == *(*uintptr)(unsafe.Pointer(bp /* pEq */)) { + pOther = (*Expr)(unsafe.Pointer(pAnd)).FpRight + } else { + pOther = (*Expr)(unsafe.Pointer(pAnd)).FpLeft + } + (*Expr)(unsafe.Pointer(pAnd)).FpLeft = libc.AssignPtrUintptr(pAnd+24 /* &.pRight */, uintptr(0)) + Xsqlite3ExprDelete(tls, db, pAnd) + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* ppAnd */)))) = pOther + } else { + + (*Select)(unsafe.Pointer(pSel)).FpWhere = uintptr(0) + } + Xsqlite3ExprDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp /* pEq */))) + + idxNew = whereClauseInsert(tls, pWC, pDup, (uint16(TERM_VIRTUAL | TERM_DYNAMIC))) + exprAnalyze(tls, pSrc, pWC, idxNew) + markTermAsChild(tls, pWC, idxNew, idxTerm) + *(*U16)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56 + 18 /* &.wtFlags */)) |= U16((TERM_COPIED)) +} + // 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 @@ -126433,7 +128835,7 @@ func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol // 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 *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:145024:13: */ +func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:147591:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -126456,8 +128858,8 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) - pMaskSet = (pWInfo + 656 /* &.sMaskSet */) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) + pMaskSet = (pWInfo + 592 /* &.sMaskSet */) pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr prereqLeft = Xsqlite3WhereExprUsage(tls, pMaskSet, (*Expr)(unsafe.Pointer(pExpr)).FpLeft) @@ -126467,7 +128869,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if Xsqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) } else { (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight = Xsqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) @@ -126482,13 +128884,13 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect != 0 { *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_VARSELECT)) } - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0) { - var x Bitmask = Xsqlite3WhereGetMask(tls, pMaskSet, int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable)) + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0) { + var x Bitmask = Xsqlite3WhereGetMask(tls, pMaskSet, (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) prereqAll = prereqAll | (x) extraRight = (x - uint64(1)) // ON clause terms may not be used with an index // on left table of a LEFT JOIN. Ticket #3015 if (prereqAll >> 1) >= x { - Xsqlite3ErrorMsg(tls, pParse, ts+23487 /* "ON clause refere..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+23945 /* "ON clause refere..." */, 0) return } } @@ -126503,19 +128905,19 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s var pRight uintptr = Xsqlite3ExprSkipCollate(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) var opMask U16 if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & prereqLeft) == uint64(0) { - opMask = WO_ALL + opMask = uint16(WO_ALL) } else { - opMask = WO_EQUIV + opMask = uint16(WO_EQUIV) } - if (*WhereTerm)(unsafe.Pointer(pTerm)).FiField > 0 { + if *(*int32)(unsafe.Pointer((pTerm + 32 /* &.u */ /* &.x */) + 4 /* &.iField */)) > 0 { - pLeft = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pLeft + 32 /* &.x */)) + 8 /* &.a */) + uintptr(((*WhereTerm)(unsafe.Pointer(pTerm)).FiField-1))*32)).FpExpr + pLeft = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pLeft + 32 /* &.x */)) + 8 /* &.a */) + uintptr((*(*int32)(unsafe.Pointer((pTerm + 32 /* &.u */ /* &.x */) + 4 /* &.iField */))-1))*32)).FpExpr } if exprMightBeIndexed(tls, pSrc, prereqLeft, bp /* &aiCurCol[0] */, pLeft, op) != 0 { (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */)) - *(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)) = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */ + 1*4)) + *(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */ + 1*4)) (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = (U16(int32(operatorMask(tls, op)) & int32(opMask))) } if op == TK_IS { @@ -126538,17 +128940,17 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s if idxNew == 0 { return } - pNew = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*64) + pNew = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*56) markTermAsChild(tls, pWC, idxNew, idxTerm) if op == TK_IS { *(*U16)(unsafe.Pointer(pNew + 18 /* &.wtFlags */)) |= U16((TERM_IS)) } - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_COPIED)) if termIsEquivalence(tls, pParse, pDup) != 0 { *(*U16)(unsafe.Pointer(pTerm + 20 /* &.eOperator */)) |= U16((WO_EQUIV)) - eExtraOp = WO_EQUIV + eExtraOp = U16(WO_EQUIV) } } else { pDup = pExpr @@ -126556,11 +128958,17 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s } *(*U16)(unsafe.Pointer(pNew + 18 /* &.wtFlags */)) |= U16((int32(exprCommute(tls, pParse, pDup)))) (*WhereTerm)(unsafe.Pointer(pNew)).FleftCursor = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */)) - *(*int32)(unsafe.Pointer(pNew + 40 /* &.u */)) = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */ + 1*4)) + *(*int32)(unsafe.Pointer(pNew + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) = *(*int32)(unsafe.Pointer(bp /* &aiCurCol[0] */ + 1*4)) (*WhereTerm)(unsafe.Pointer(pNew)).FprereqRight = (prereqLeft | extraRight) (*WhereTerm)(unsafe.Pointer(pNew)).FprereqAll = prereqAll (*WhereTerm)(unsafe.Pointer(pNew)).FeOperator = (U16((int32(operatorMask(tls, int32((*Expr)(unsafe.Pointer(pDup)).Fop))) + int32(eExtraOp)) & int32(opMask))) + } else if (op == TK_ISNULL) && (0 == Xsqlite3ExprCanBeNull(tls, pLeft)) { + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_TRUEFALSE) + *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = ts + 8743 /* "false" */ + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_IsFalse)) + (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) + (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(0) } } else if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_BETWEEN) && (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) { var pList uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) @@ -126576,28 +128984,48 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s idxNew = whereClauseInsert(tls, pWC, pNewExpr, (uint16(TERM_VIRTUAL | TERM_DYNAMIC))) exprAnalyze(tls, pSrc, pWC, idxNew) - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) markTermAsChild(tls, pWC, idxNew, idxTerm) } } else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_OR { exprAnalyzeOrTerm(tls, pSrc, pWC, idxTerm) - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) - } + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) + } else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_EXISTS { + // Perhaps treat an EXISTS operator as an IN operator + if (((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_VarSelect)) != U32(0)) && + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_ExistsToIN))) == U32(0)) { + exprAnalyzeExists(tls, pSrc, pWC, idxTerm) + } + } else if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL { + if ((int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_COLUMN) && + (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiColumn) >= 0)) && + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { + var pNewExpr uintptr + var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft + var idxNew int32 + var pNewTerm uintptr - // Add constraints to reduce the search space on a LIKE or GLOB - // operator. - // - // A like pattern of the form "x LIKE 'aBc%'" is changed into constraints - // - // x>='ABC' AND x<'abd' AND x LIKE 'aBc%' - // - // The last character of the prefix "abc" is incremented to form the - // termination condition "abd". If case is not significant (the default - // for LIKE) then the lower-bound is made all uppercase and the upper- - // bound is made all lowercase so that the bounds also work when comparing - // BLOBs. - if (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) && + pNewExpr = Xsqlite3PExpr(tls, pParse, TK_GT, + Xsqlite3ExprDup(tls, db, pLeft, 0), + Xsqlite3ExprAlloc(tls, db, TK_NULL, uintptr(0), 0)) + + idxNew = whereClauseInsert(tls, pWC, pNewExpr, + (uint16((TERM_VIRTUAL | TERM_DYNAMIC) | TERM_VNULL))) + if idxNew != 0 { + pNewTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*56) + (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = uint64(0) + (*WhereTerm)(unsafe.Pointer(pNewTerm)).FleftCursor = (*Expr)(unsafe.Pointer(pLeft)).FiTable + *(*int32)(unsafe.Pointer(pNewTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) = int32((*Expr)(unsafe.Pointer(pLeft)).FiColumn) + (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = (U16(int32(WO_EQ) << (TK_GT - TK_EQ))) + markTermAsChild(tls, pWC, idxNew, idxTerm) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) + *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_COPIED)) + (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqAll = (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll + } + } + } else if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && + (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND)) && (isLikeOrGlob(tls, pParse, pExpr, bp+8 /* &pStr1 */, bp+16 /* &isComplete */, bp+20 /* &noCase */) != 0) { var pLeft uintptr // LHS of LIKE/GLOB operator var pStr2 uintptr // Copy of pStr1 - RHS of LIKE/GLOB operator @@ -126644,7 +129072,7 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s } zCollSeqName = func() uintptr { if *(*int32)(unsafe.Pointer(bp + 20 /* noCase */)) != 0 { - return ts + 23528 /* "NOCASE" */ + return ts + 23986 /* "NOCASE" */ } return uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)) }() @@ -126664,22 +129092,56 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s idxNew2 = whereClauseInsert(tls, pWC, pNewExpr2, wtFlags) exprAnalyze(tls, pSrc, pWC, idxNew2) - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) if *(*int32)(unsafe.Pointer(bp + 16 /* isComplete */)) != 0 { markTermAsChild(tls, pWC, idxNew1, idxTerm) markTermAsChild(tls, pWC, idxNew2, idxTerm) } } - // Add a WO_AUX auxiliary term to the constraint set if the - // current expression is of the form "column OP expr" where OP - // is an operator that gets passed into virtual tables but which is - // not normally optimized for ordinary tables. In other words, OP - // is one of MATCH, LIKE, GLOB, REGEXP, !=, IS, IS NOT, or NOT NULL. - // This information is used by the xBestIndex methods of - // virtual tables. The native query optimizer does not attempt - // to do anything with MATCH functions. - if int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND { + // If there is a vector == or IS term - e.g. "(a, b) == (?, ?)" - create + // new terms for each component comparison - "a = ?" and "b = ?". The + // new terms completely replace the original vector comparison, which is + // no longer used. + // + // This is only required if at least one side of the comparison operation + // is not a sub-select. + if (((((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_EQ) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IS)) && + ((libc.AssignInt32(&nLeft, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))) > 1)) && + (Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) == nLeft)) && + ((((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags & U32(EP_xIsSelect)) == U32(0)) || + (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fflags & U32(EP_xIsSelect)) == U32(0)))) && + (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) { + var i int32 + for i = 0; i < nLeft; i++ { + var idxNew int32 + var pNew uintptr + var pLeft uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, i) + var pRight uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, i) + + pNew = Xsqlite3PExpr(tls, pParse, int32((*Expr)(unsafe.Pointer(pExpr)).Fop), pLeft, pRight) + transferJoinMarkings(tls, pNew, pExpr) + idxNew = whereClauseInsert(tls, pWC, pNew, uint16(TERM_DYNAMIC)) + exprAnalyze(tls, pSrc, pWC, idxNew) + } + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) + *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_CODED | TERM_VIRTUAL)) // Disable the original + (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(0) + } else if (((((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IN) && + (*(*int32)(unsafe.Pointer((pTerm + 32 /* &.u */ /* &.x */) + 4 /* &.iField */)) == 0)) && + (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR)) && + ((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpPrior == uintptr(0))) && + ((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpWin == uintptr(0))) && + (int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) { + var i int32 + for i = 0; i < Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft); i++ { + var idxNew int32 + idxNew = whereClauseInsert(tls, pWC, pExpr, uint16(TERM_VIRTUAL)) + *(*int32)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*56 + 32 /* &.u */ /* &.x */ + 4 /* &.iField */)) = (i + 1) + exprAnalyze(tls, pSrc, pWC, idxNew) + markTermAsChild(tls, pWC, idxNew, idxTerm) + } + } else if int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND { *(*uintptr)(unsafe.Pointer(bp + 40 /* pRight */)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 32 /* pLeft */)) = uintptr(0) var res int32 = isAuxiliaryVtabOperator(tls, db, pExpr, bp+24 /* &eOp2 */, bp+32 /* &pLeft */, bp+40 /* &pRight */) @@ -126695,20 +129157,20 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s var pNewExpr uintptr pNewExpr = Xsqlite3PExpr(tls, pParse, TK_MATCH, uintptr(0), Xsqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40 /* pRight */)), 0)) - if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) && (pNewExpr != 0) { - *(*U32)(unsafe.Pointer(pNewExpr + 4 /* &.flags */)) |= (EP_FromJoin) + if (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) && (pNewExpr != 0) { + *(*U32)(unsafe.Pointer(pNewExpr + 4 /* &.flags */)) |= (U32(EP_FromJoin)) (*Expr)(unsafe.Pointer(pNewExpr)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable } idxNew = whereClauseInsert(tls, pWC, pNewExpr, (uint16(TERM_VIRTUAL | TERM_DYNAMIC))) - pNewTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*64) + pNewTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*56) (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = prereqExpr (*WhereTerm)(unsafe.Pointer(pNewTerm)).FleftCursor = (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pLeft */)))).FiTable - *(*int32)(unsafe.Pointer(pNewTerm + 40 /* &.u */)) = int32((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pLeft */)))).FiColumn) - (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = WO_AUX + *(*int32)(unsafe.Pointer(pNewTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) = int32((*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pLeft */)))).FiColumn) + (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = U16(WO_AUX) (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeMatchOp = *(*uint8)(unsafe.Pointer(bp + 24 /* eOp2 */)) markTermAsChild(tls, pWC, idxNew, idxTerm) - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_COPIED)) (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqAll = (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll } @@ -126721,101 +129183,14 @@ func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* s } } - // If there is a vector == or IS term - e.g. "(a, b) == (?, ?)" - create - // new terms for each component comparison - "a = ?" and "b = ?". The - // new terms completely replace the original vector comparison, which is - // no longer used. - // - // This is only required if at least one side of the comparison operation - // is not a sub-select. - if ((((int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) && - ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_EQ) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IS))) && - ((libc.AssignInt32(&nLeft, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))) > 1)) && - (Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) == nLeft)) && - ((((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags & EP_xIsSelect) == U32(0)) || - (((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fflags & EP_xIsSelect) == U32(0))) { - var i int32 - for i = 0; i < nLeft; i++ { - var idxNew int32 - var pNew uintptr - var pLeft uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, i) - var pRight uintptr = Xsqlite3ExprForVectorField(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, i) - - pNew = Xsqlite3PExpr(tls, pParse, int32((*Expr)(unsafe.Pointer(pExpr)).Fop), pLeft, pRight) - transferJoinMarkings(tls, pNew, pExpr) - idxNew = whereClauseInsert(tls, pWC, pNew, TERM_DYNAMIC) - exprAnalyze(tls, pSrc, pWC, idxNew) - } - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) - *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_CODED | TERM_VIRTUAL)) // Disable the original - (*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator = U16(0) - } - - // If there is a vector IN term - e.g. "(a, b) IN (SELECT ...)" - create - // a virtual term for each vector component. The expression object - // used by each such virtual term is pExpr (the full vector IN(...) - // expression). The WhereTerm.iField variable identifies the index within - // the vector on the LHS that the virtual term represents. - // - // This only works if the RHS is a simple SELECT (not a compound) that does - // not use window functions. - if (((((int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == TK_AND) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_IN)) && ((*WhereTerm)(unsafe.Pointer(pTerm)).FiField == 0)) && - (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_VECTOR)) && - ((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpPrior == uintptr(0))) && - ((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpWin == uintptr(0)) { - var i int32 - for i = 0; i < Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft); i++ { - var idxNew int32 - idxNew = whereClauseInsert(tls, pWC, pExpr, TERM_VIRTUAL) - (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*64)).FiField = (i + 1) - exprAnalyze(tls, pSrc, pWC, idxNew) - markTermAsChild(tls, pWC, idxNew, idxTerm) - } - } - - // When sqlite_stat4 histogram data is available an operator of the - // form "x IS NOT NULL" can sometimes be evaluated more efficiently - // as "x>NULL" if x is not an INTEGER PRIMARY KEY. So construct a - // virtual term of that form. - // - // Note that the virtual term must be tagged with TERM_VNULL. - if ((((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_NOTNULL) && - (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == TK_COLUMN)) && - (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiColumn) >= 0)) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0))) && - ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0) { - var pNewExpr uintptr - var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft - var idxNew int32 - var pNewTerm uintptr - - pNewExpr = Xsqlite3PExpr(tls, pParse, TK_GT, - Xsqlite3ExprDup(tls, db, pLeft, 0), - Xsqlite3ExprAlloc(tls, db, TK_NULL, uintptr(0), 0)) - - idxNew = whereClauseInsert(tls, pWC, pNewExpr, - (uint16((TERM_VIRTUAL | TERM_DYNAMIC) | TERM_VNULL))) - if idxNew != 0 { - pNewTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*64) - (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = uint64(0) - (*WhereTerm)(unsafe.Pointer(pNewTerm)).FleftCursor = (*Expr)(unsafe.Pointer(pLeft)).FiTable - *(*int32)(unsafe.Pointer(pNewTerm + 40 /* &.u */)) = int32((*Expr)(unsafe.Pointer(pLeft)).FiColumn) - (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = (U16(int32(WO_EQ) << (TK_GT - TK_EQ))) - markTermAsChild(tls, pWC, idxNew, idxTerm) - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) - *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((TERM_COPIED)) - (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqAll = (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll - } - } - // Prevent ON clause terms of a LEFT JOIN from being used to drive // an index for tables to the left of the join. - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64) - *(*Bitmask)(unsafe.Pointer(pTerm + 48 /* &.prereqRight */)) |= (extraRight) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56) + *(*Bitmask)(unsafe.Pointer(pTerm + 40 /* &.prereqRight */)) |= (extraRight) } -var ops = [2]U8{TK_GE, TK_LE} /* sqlite3.c:145161:21 */ +var ops = [2]U8{U8(TK_GE), U8(TK_LE)} /* sqlite3.c:147734:21 */ // ************************************************************************** // @@ -126838,9 +129213,10 @@ var ops = [2]U8{TK_GE, TK_LE} /* sqlite3.c:145161:21 */ // 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 Xsqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op U8) { /* sqlite3.c:145447:21: */ +func Xsqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op U8) { /* sqlite3.c:148030:21: */ var pE2 uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr) (*WhereClause)(unsafe.Pointer(pWC)).Fop = op + if pE2 == uintptr(0) { return } @@ -126853,7 +129229,7 @@ func Xsqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op U8) { /* s } // Initialize a preallocated WhereClause structure. -func Xsqlite3WhereClauseInit(tls *libc.TLS, pWC uintptr, pWInfo uintptr) { /* sqlite3.c:145462:21: */ +func Xsqlite3WhereClauseInit(tls *libc.TLS, pWC uintptr, pWInfo uintptr) { /* sqlite3.c:148046:21: */ (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo = pWInfo (*WhereClause)(unsafe.Pointer(pWC)).FhasOr = U8(0) (*WhereClause)(unsafe.Pointer(pWC)).FpOuter = uintptr(0) @@ -126865,7 +129241,7 @@ func Xsqlite3WhereClauseInit(tls *libc.TLS, pWC uintptr, pWInfo uintptr) { /* sq // Deallocate a WhereClause structure. The WhereClause structure // itself is not freed. This routine is the inverse of // sqlite3WhereClauseInit(). -func Xsqlite3WhereClauseClear(tls *libc.TLS, pWC uintptr) { /* sqlite3.c:145479:21: */ +func Xsqlite3WhereClauseClear(tls *libc.TLS, pWC uintptr) { /* sqlite3.c:148063:21: */ var i int32 var a uintptr var db uintptr = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb @@ -126880,16 +129256,16 @@ __1: Xsqlite3ExprDelete(tls, db, (*WhereTerm)(unsafe.Pointer(a)).FpExpr) } if (int32((*WhereTerm)(unsafe.Pointer(a)).FwtFlags) & TERM_ORINFO) != 0 { - whereOrInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 40 /* &.u */))) + whereOrInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 32 /* &.u */))) } else if (int32((*WhereTerm)(unsafe.Pointer(a)).FwtFlags) & TERM_ANDINFO) != 0 { - whereAndInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 40 /* &.u */))) + whereAndInfoDelete(tls, db, *(*uintptr)(unsafe.Pointer(a + 32 /* &.u */))) } } goto __2 __2: i-- - a += 64 + a += 56 goto __1 goto __3 __3: @@ -126902,9 +129278,9 @@ __3: // These routines walk (recursively) an expression tree and generate // a bitmask indicating which tables are used in that expression // tree. -func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:145504:24: */ +func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:148088:24: */ var mask Bitmask - if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && !(((*Expr)(unsafe.Pointer((p))).Fflags & (EP_FixedCol)) != U32(0)) { + if (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_FixedCol))) != U32(0)) { return Xsqlite3WhereGetMask(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FiTable) } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_TokenOnly | EP_Leaf))) != U32(0) { @@ -126921,8 +129297,8 @@ func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmas if (*Expr)(unsafe.Pointer(p)).FpRight != 0 { mask = mask | (Xsqlite3WhereExprUsageNN(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FpRight)) - } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_xIsSelect)) != U32(0) { - if ((*Expr)(unsafe.Pointer((p))).Fflags & (EP_VarSelect)) != U32(0) { + } else if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_xIsSelect))) != U32(0) { + if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(EP_VarSelect))) != U32(0) { (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).FbVarSelect = 1 } mask = mask | (exprSelectUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)))) @@ -126937,14 +129313,14 @@ func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmas return mask } -func Xsqlite3WhereExprUsage(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:145532:24: */ +func Xsqlite3WhereExprUsage(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:148116:24: */ if p != 0 { return Xsqlite3WhereExprUsageNN(tls, pMaskSet, p) } return uint64(0) } -func Xsqlite3WhereExprListUsage(tls *libc.TLS, pMaskSet uintptr, pList uintptr) Bitmask { /* sqlite3.c:145535:24: */ +func Xsqlite3WhereExprListUsage(tls *libc.TLS, pMaskSet uintptr, pList uintptr) Bitmask { /* sqlite3.c:148119:24: */ var i int32 var mask Bitmask = uint64(0) if pList != 0 { @@ -126961,7 +129337,7 @@ func Xsqlite3WhereExprListUsage(tls *libc.TLS, pMaskSet uintptr, pList uintptr) // 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 Xsqlite3WhereExprAnalyze(tls *libc.TLS, pTabList uintptr, pWC uintptr) { /* sqlite3.c:145555:21: */ +func Xsqlite3WhereExprAnalyze(tls *libc.TLS, pTabList uintptr, pWC uintptr) { /* sqlite3.c:148139:21: */ var i int32 for i = ((*WhereClause)(unsafe.Pointer(pWC)).FnTerm - 1); i >= 0; i-- { exprAnalyze(tls, pTabList, pWC, i) @@ -126973,7 +129349,7 @@ func Xsqlite3WhereExprAnalyze(tls *libc.TLS, pTabList uintptr, pWC uintptr) { /* // // Each function argument translates into an equality constraint against // a HIDDEN column in the table. -func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC uintptr) { /* sqlite3.c:145572:21: */ +func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC uintptr) { /* sqlite3.c:148156:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -126986,7 +129362,7 @@ func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC if (int32(*(*uint8)(unsafe.Pointer((pItem + 60 /* &.fg */) + 4 /* &.isTabFunc */)) & 0x4 >> 2)) == 0 { return } - pTab = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab + pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab pArgs = *(*uintptr)(unsafe.Pointer(pItem + 96 /* &.u1 */)) if pArgs == uintptr(0) { @@ -126998,7 +129374,7 @@ func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*Table)(unsafe.Pointer(pTab)).FnCol) { - Xsqlite3ErrorMsg(tls, pParse, ts+23535, /* "too many argumen..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+23993, /* "too many argumen..." */ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, j)) return } @@ -127006,16 +129382,16 @@ func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC if pColRef == uintptr(0) { return } - (*Expr)(unsafe.Pointer(pColRef)).FiTable = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor + (*Expr)(unsafe.Pointer(pColRef)).FiTable = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor (*Expr)(unsafe.Pointer(pColRef)).FiColumn = YnVar(libc.PostIncInt32(&k, 1)) *(*uintptr)(unsafe.Pointer(pColRef + 64 /* &.y */)) = pTab pRhs = Xsqlite3PExpr(tls, pParse, TK_UPLUS, Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*ExprList_item)(unsafe.Pointer((pArgs+8 /* &.a */)+uintptr(j)*32)).FpExpr, 0), uintptr(0)) pTerm = Xsqlite3PExpr(tls, pParse, TK_EQ, pColRef, pRhs) - if (int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) != 0 { - Xsqlite3SetJoinExpr(tls, pTerm, (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor) + if (int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) != 0 { + Xsqlite3SetJoinExpr(tls, pTerm, (*SrcItem)(unsafe.Pointer(pItem)).FiCursor) } - whereClauseInsert(tls, pWC, pTerm, TERM_DYNAMIC) + whereClauseInsert(tls, pWC, pTerm, uint16(TERM_DYNAMIC)) } } @@ -127050,7 +129426,7 @@ func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC type HiddenIndexInfo1 = struct { FpWC uintptr FpParse uintptr -} /* sqlite3.c:145642:9 */ +} /* sqlite3.c:148226:9 */ //************* End of whereexpr.c ****************************************** //************* Begin file where.c ****************************************** @@ -127080,20 +129456,16 @@ type HiddenIndexInfo1 = struct { // This object is not an API and can be changed from one release to the // next. As long as allocateIndexInfo() and sqlite3_vtab_collation() // agree on the structure, all will be well. -type HiddenIndexInfo = HiddenIndexInfo1 /* sqlite3.c:145642:32 */ - -// Test variable that can be set to enable WHERE tracing -/***/ -var Xsqlite3WhereTrace int32 = 0 /* sqlite3.c:145653:11 */ +type HiddenIndexInfo = HiddenIndexInfo1 /* sqlite3.c:148226:32 */ // Return the estimated number of output rows from a WHERE clause -func Xsqlite3WhereOutputRowCount(tls *libc.TLS, pWInfo uintptr) LogEst { /* sqlite3.c:145660:23: */ +func Xsqlite3WhereOutputRowCount(tls *libc.TLS, pWInfo uintptr) LogEst { /* sqlite3.c:148238:23: */ return (*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut } // Return one of the WHERE_DISTINCT_xxxxx values to indicate how this // WHERE clause returns outputs for DISTINCT processing. -func Xsqlite3WhereIsDistinct(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145668:20: */ +func Xsqlite3WhereIsDistinct(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:148246:20: */ return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) } @@ -127103,7 +129475,7 @@ func Xsqlite3WhereIsDistinct(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c // terms means that no sorting is needed at all. A return that // is positive but less than the number of ORDER BY terms means that // block sorting is required. -func Xsqlite3WhereIsOrdered(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145680:20: */ +func Xsqlite3WhereIsOrdered(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:148258:20: */ return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) } @@ -127128,28 +129500,56 @@ func Xsqlite3WhereIsOrdered(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c: // Returning the continuation the second inner loop is an optimization // that might make the code run a little faster, but should not change // the final answer. -func Xsqlite3WhereOrderByLimitOptLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145707:20: */ +func Xsqlite3WhereOrderByLimitOptLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:148285:20: */ var pInner uintptr if !((int32(*(*uint8)(unsafe.Pointer(pWInfo + 68 /* &.bOrderedInnerLoop */)) & 0x4 >> 2)) != 0) { // The ORDER BY LIMIT optimization does not apply. Jump to the // continuation of the inner-most loop. return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiContinue } - pInner = ((pWInfo + 920 /* &.a */) + uintptr((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-1))*88) + pInner = ((pWInfo + 856 /* &.a */) + uintptr((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-1))*88) return (*WhereLevel)(unsafe.Pointer(pInner)).FaddrNxt } +// While generating code for the min/max optimization, after handling +// the aggregate-step call to min() or max(), check to see if any +// additional looping is required. If the output order is such that +// we are certain that the correct answer has already been found, then +// code an OP_Goto to by pass subsequent processing. +// +// Any extra OP_Goto that is coded here is an optimization. The +// correct answer should be obtained regardless. This OP_Goto just +// makes the answer appear faster. +func Xsqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { /* sqlite3.c:148308:21: */ + var pInner uintptr + var i int32 + if !((int32(*(*uint8)(unsafe.Pointer(pWInfo + 68 /* &.bOrderedInnerLoop */)) & 0x4 >> 2)) != 0) { + return + } + if int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == 0 { + return + } + for i = (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1); i >= 0; i-- { + pInner = ((pWInfo + 856 /* &.a */) + uintptr(i)*88) + if ((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags & U32(WHERE_COLUMN_IN)) != U32(0) { + Xsqlite3VdbeGoto(tls, v, (*WhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) + return + } + } + Xsqlite3VdbeGoto(tls, v, (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak) +} + // Return the VDBE address or label to jump to in order to continue // immediately with the next row of a WHERE clause. -func Xsqlite3WhereContinueLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145723:20: */ +func Xsqlite3WhereContinueLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:148327:20: */ return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiContinue } // Return the VDBE address or label to jump to in order to break // out of a WHERE loop. -func Xsqlite3WhereBreakLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145732:20: */ +func Xsqlite3WhereBreakLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:148336:20: */ return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak } @@ -127168,19 +129568,19 @@ func Xsqlite3WhereBreakLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c // // aiCur[0] and aiCur[1] both get -1 if the where-clause logic is // unable to use the ONEPASS optimization. -func Xsqlite3WhereOkOnePass(tls *libc.TLS, pWInfo uintptr, aiCur uintptr) int32 { /* sqlite3.c:145753:20: */ +func Xsqlite3WhereOkOnePass(tls *libc.TLS, pWInfo uintptr, aiCur uintptr) int32 { /* sqlite3.c:148357:20: */ libc.Xmemcpy(tls, aiCur, pWInfo+40 /* &.aiCurOnePass */, (uint64(unsafe.Sizeof(int32(0))) * uint64(2))) return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) } // Return TRUE if the WHERE loop uses the OP_DeferredSeek opcode to move // the data cursor to the row selected by the index cursor. -func Xsqlite3WhereUsesDeferredSeek(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145769:20: */ +func Xsqlite3WhereUsesDeferredSeek(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:148373:20: */ return (int32(*(*uint8)(unsafe.Pointer(pWInfo + 68 /* &.bDeferredSeek */)) & 0x1 >> 0)) } // Move the content of pSrc into pDest -func whereOrMove(tls *libc.TLS, pDest uintptr, pSrc uintptr) { /* sqlite3.c:145776:13: */ +func whereOrMove(tls *libc.TLS, pDest uintptr, pSrc uintptr) { /* sqlite3.c:148380:13: */ (*WhereOrSet)(unsafe.Pointer(pDest)).Fn = (*WhereOrSet)(unsafe.Pointer(pSrc)).Fn libc.Xmemcpy(tls, pDest+8 /* &.a */, pSrc+8 /* &.a */, (uint64((*WhereOrSet)(unsafe.Pointer(pDest)).Fn) * uint64(unsafe.Sizeof(WhereOrCost{})))) } @@ -127190,7 +129590,7 @@ func whereOrMove(tls *libc.TLS, pDest uintptr, pSrc uintptr) { /* sqlite3.c:1457 // 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 *libc.TLS, pSet uintptr, prereq Bitmask, rRun LogEst, nOut LogEst) int32 { /* sqlite3.c:145788:12: */ +func whereOrInsert(tls *libc.TLS, pSet uintptr, prereq Bitmask, rRun LogEst, nOut LogEst) int32 { /* sqlite3.c:148392:12: */ var i U16 var p uintptr i = (*WhereOrSet)(unsafe.Pointer(pSet)).Fn @@ -127267,7 +129667,7 @@ __13: // Return the bitmask for the given cursor number. Return 0 if // iCursor is not in the set. -func Xsqlite3WhereGetMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) Bitmask { /* sqlite3.c:145825:24: */ +func Xsqlite3WhereGetMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) Bitmask { /* sqlite3.c:148429:24: */ var i int32 for i = 0; i < (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn; i++ { @@ -127284,15 +129684,25 @@ func Xsqlite3WhereGetMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) Bitmas // tables in the FROM clause is limited by a test early in the // sqlite3WhereBegin() routine. So we know that the pMaskSet->ix[] // array will never overflow. -func createMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) { /* sqlite3.c:145844:13: */ +func createMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) { /* sqlite3.c:148448:13: */ *(*int32)(unsafe.Pointer((pMaskSet + 8 /* &.ix */) + uintptr(libc.PostIncInt32(&(*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn, 1))*4)) = iCursor } +// If the right-hand branch of the expression is a TK_COLUMN, then return +// a pointer to the right-hand branch. Otherwise, return NULL. +func whereRightSubexprIsColumn(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:148457:13: */ + p = Xsqlite3ExprSkipCollateAndLikely(tls, (*Expr)(unsafe.Pointer(p)).FpRight) + if (p != uintptr(0)) && (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) { + return p + } + return uintptr(0) +} + // 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 *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145854:18: */ +func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:148468:18: */ var iCur int32 // The cursor on the LHS of the term var iColumn I16 // The column on the LHS of the term. -1 for IPK var pX uintptr // An expression being tested @@ -127306,22 +129716,21 @@ func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145854:1 iCur = *(*int32)(unsafe.Pointer((pScan + 44 /* &.aiCur */) + uintptr((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv)-1))*4)) for ok := true; ok; ok = (pWC != uintptr(0)) { - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(k)*64) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(k)*56) __1: if !(k < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm) { goto __3 } { if ((((*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor == iCur) && - (*(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)) == int32(iColumn))) && + (*(*int32)(unsafe.Pointer((pTerm + 32 /* &.u */ /* &.x */) /* &.leftColumn */)) == int32(iColumn))) && ((int32(iColumn) != (-2)) || (Xsqlite3ExprCompareSkip(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft, (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr, iCur) == 0))) && - ((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= 1) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0))) { + ((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= 1) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) { if (((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_EQUIV) != 0) && (int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv) < (int32(uint64(unsafe.Sizeof([11]int32{})) / uint64(unsafe.Sizeof(int32(0))))))) && - (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pX, Xsqlite3ExprSkipCollateAndLikely(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight))))).Fop) == - TK_COLUMN) { + ((libc.AssignUintptr(&pX, whereRightSubexprIsColumn(tls, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))) != uintptr(0)) { var j int32 for j = 0; j < int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv); j++ { if (*(*int32)(unsafe.Pointer((pScan + 44 /* &.aiCur */) + uintptr(j)*4)) == (*Expr)(unsafe.Pointer(pX)).FiTable) && @@ -127370,7 +129779,7 @@ func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145854:1 goto __2 __2: k++ - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -127392,7 +129801,7 @@ func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145854:1 // It is factored out into a separate tail-recursion subroutine so that // the normal whereScanInit() routine, which is a high-runner, does not // need to push registers onto the stack as part of its prologue. -func whereScanInitIndexExpr(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145942:34: */ +func whereScanInitIndexExpr(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:148555:34: */ (*WhereScan)(unsafe.Pointer(pScan)).Fidxaff = Xsqlite3ExprAffinity(tls, (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr) return whereScanNext(tls, pScan) } @@ -127414,7 +129823,7 @@ func whereScanInitIndexExpr(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c // // If X is not the INTEGER PRIMARY KEY then X must be compatible with // index pIdx. -func whereScanInit(tls *libc.TLS, pScan uintptr, pWC uintptr, iCur int32, iColumn int32, opMask U32, pIdx uintptr) uintptr { /* sqlite3.c:145966:18: */ +func whereScanInit(tls *libc.TLS, pScan uintptr, pWC uintptr, iCur int32, iColumn int32, opMask U32, pIdx uintptr) uintptr { /* sqlite3.c:148579:18: */ (*WhereScan)(unsafe.Pointer(pScan)).FpOrigWC = pWC (*WhereScan)(unsafe.Pointer(pScan)).FpWC = pWC (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr = uintptr(0) @@ -127469,7 +129878,7 @@ func whereScanInit(tls *libc.TLS, pScan uintptr, pWC uintptr, iCur int32, iColum // 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 Xsqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32, notReady Bitmask, op U32, pIdx uintptr) uintptr { /* sqlite3.c:146030:26: */ +func Xsqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32, notReady Bitmask, op U32, pIdx uintptr) uintptr { /* sqlite3.c:148643:26: */ bp := tls.Alloc(112) defer tls.Free(112) @@ -127499,13 +129908,14 @@ func Xsqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32 // // If such an expression is found, its index in pList->a[] is returned. If // no expression is found, -1 is returned. -func findIndexCol(tls *libc.TLS, pParse uintptr, pList uintptr, iBase int32, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:146064:12: */ +func findIndexCol(tls *libc.TLS, pParse uintptr, pList uintptr, iBase int32, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:148677:12: */ var i int32 var zColl uintptr = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(iCol)*8)) for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ { var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*32)).FpExpr) - if ((int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && + if (((p != uintptr(0)) && + (int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN)) && (int32((*Expr)(unsafe.Pointer(p)).FiColumn) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2))))) && ((*Expr)(unsafe.Pointer(p)).FiTable == iBase) { var pColl uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*32)).FpExpr) @@ -127519,7 +129929,7 @@ func findIndexCol(tls *libc.TLS, pParse uintptr, pList uintptr, iBase int32, pId } // Return TRUE if the iCol-th column of index pIdx is NOT NULL -func indexColumnNotNull(tls *libc.TLS, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:146093:12: */ +func indexColumnNotNull(tls *libc.TLS, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:148707:12: */ var j int32 j = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2))) @@ -127540,7 +129950,7 @@ func indexColumnNotNull(tls *libc.TLS, pIdx uintptr, iCol int32) int32 { /* sqli // // 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 *libc.TLS, pParse uintptr, pTabList uintptr, pWC uintptr, pDistinct uintptr) int32 { /* sqlite3.c:146116:12: */ +func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC uintptr, pDistinct uintptr) int32 { /* sqlite3.c:148730:12: */ var pTab uintptr var pIdx uintptr var i int32 @@ -127552,14 +129962,17 @@ func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC ui if (*SrcList)(unsafe.Pointer(pTabList)).FnSrc != 1 { return 0 } - iBase = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor - pTab = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab + iBase = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FiCursor + pTab = (*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab // If any of the expressions is an IPK column on table iBase, then return // true. Note: The (p->iTable==iBase) part of this test may be false if the // current SELECT is a correlated sub-query. for i = 0; i < (*ExprList)(unsafe.Pointer(pDistinct)).FnExpr; i++ { var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pDistinct+8 /* &.a */)+uintptr(i)*32)).FpExpr) + if p == uintptr(0) { + continue + } if ((int32((*Expr)(unsafe.Pointer(p)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(p)).FiTable == iBase)) && (int32((*Expr)(unsafe.Pointer(p)).FiColumn) < 0) { return 1 } @@ -127582,7 +129995,7 @@ func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC ui continue } for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); i++ { - if uintptr(0) == Xsqlite3WhereFindTerm(tls, pWC, iBase, i, libc.CplUint64(uint64(0)), WO_EQ, pIdx) { + if uintptr(0) == Xsqlite3WhereFindTerm(tls, pWC, iBase, i, libc.CplUint64(uint64(0)), uint32(WO_EQ), pIdx) { if findIndexCol(tls, pParse, pDistinct, iBase, pIdx, i) < 0 { break } @@ -127601,7 +130014,7 @@ func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC ui } // Estimate the logarithm of the input value to base 2. -func estLog(tls *libc.TLS, N LogEst) LogEst { /* sqlite3.c:146177:15: */ +func estLog(tls *libc.TLS, N LogEst) LogEst { /* sqlite3.c:148792:15: */ if int32(N) <= 10 { return int16(0) } @@ -127618,7 +130031,7 @@ func estLog(tls *libc.TLS, N LogEst) LogEst { /* sqlite3.c:146177:15: */ // cursor iTabCur are transformed into OP_Sequence opcode for the // iAutoidxCur cursor, in order to generate unique rowids for the // automatic index being generated. -func translateColumnToCopy(tls *libc.TLS, pParse uintptr, iStart int32, iTabCur int32, iRegister int32, iAutoidxCur int32) { /* sqlite3.c:146193:13: */ +func translateColumnToCopy(tls *libc.TLS, pParse uintptr, iStart int32, iTabCur int32, iRegister int32, iAutoidxCur int32) { /* sqlite3.c:148808:13: */ var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe var pOp uintptr = Xsqlite3VdbeGetOp(tls, v, iStart) var iEnd int32 = Xsqlite3VdbeCurrentAddr(tls, v) @@ -127634,16 +130047,16 @@ __1: goto __2 } if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column { - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Copy + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Copy) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = ((*VdbeOp)(unsafe.Pointer(pOp)).Fp2 + iRegister) (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = 0 } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Rowid { if iAutoidxCur != 0 { - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Sequence + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Sequence) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = iAutoidxCur } else { - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_Null + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_Null) (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = 0 (*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = 0 } @@ -127667,16 +130080,16 @@ __3: // 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 *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitmask) int32 { /* sqlite3.c:146275:12: */ +func termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitmask) int32 { /* sqlite3.c:148890:12: */ var aff int8 - if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor { + if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor { return 0 } if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & (WO_EQ | WO_IS)) == 0 { return 0 } - if (((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && - !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0))) && + if (((int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && + !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_IS) != 0) { // Cannot use an IS term from the WHERE clause as an index driver for // the RHS of a LEFT JOIN. Such a term can only be used if it is from @@ -127686,10 +130099,10 @@ func termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitm if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & notReady) != uint64(0) { return 0 } - if *(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)) < 0 { + if *(*int32)(unsafe.Pointer((pTerm + 32 /* &.u */ /* &.x */) /* &.leftColumn */)) < 0 { return 0 } - aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FaCol + uintptr(*(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)))*32)).Faffinity + aff = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FaCol + uintptr(*(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)))*32)).Faffinity if !(Xsqlite3IndexAffinityOk(tls, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr, aff) != 0) { return 0 } @@ -127700,7 +130113,7 @@ func termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitm // 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 *libc.TLS, pParse uintptr, pWC uintptr, pSrc uintptr, notReady Bitmask, pLevel uintptr) { /* sqlite3.c:146308:13: */ +func constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, pSrc uintptr, notReady Bitmask, pLevel uintptr) { /* sqlite3.c:148923:13: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -127749,8 +130162,8 @@ func constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, pSrc ui // Count the number of columns that will be added to the index // and used to match WHERE clause constraints nKeyCol = 0 - pTable = (*SrcList_item)(unsafe.Pointer(pSrc)).FpTab - pWCEnd = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*64) + pTable = (*SrcItem)(unsafe.Pointer(pSrc)).FpTab + pWCEnd = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*56) pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop idxCols = uint64(0) pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa @@ -127762,8 +130175,8 @@ __1: // table of a LEFT JOIN if !(((((*WhereLoop)(unsafe.Pointer(pLoop)).Fprereq == uint64(0)) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_VIRTUAL) == 0)) && - !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0))) && - (Xsqlite3ExprIsTableConstant(tls, pExpr, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor) != 0)) { + !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0))) && + (Xsqlite3ExprIsTableConstant(tls, pExpr, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor) != 0)) { goto __4 } pPartial = Xsqlite3ExprAnd(tls, pParse, pPartial, @@ -127773,7 +130186,7 @@ __4: if !(termCanDriveIndex(tls, pTerm, pSrc, notReady) != 0) { goto __5 } - iCol = *(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)) + iCol = *(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) if iCol >= (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) { cMask = (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1)) } else { @@ -127784,7 +130197,7 @@ __4: goto __6 } Xsqlite3_log(tls, (SQLITE_WARNING | (int32(1) << 8)), - ts+23571 /* "automatic index ..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName, + ts+24029 /* "automatic index ..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTable)).FaCol+uintptr(iCol)*32)).FzName)) sentWarning = U8(1) __6: @@ -127806,7 +130219,7 @@ __5: ; goto __2 __2: - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -127823,7 +130236,7 @@ __3: // be a covering index because the index will not be updated if the // original table changes and the index and table cannot both be used // if they go out of sync. - extraCols = ((*SrcList_item)(unsafe.Pointer(pSrc)).FcolUsed & (^idxCols | (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1)))) + extraCols = ((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (^idxCols | (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1)))) mxBitCol = func() int32 { if ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1) < (int32((*Table)(unsafe.Pointer(pTable)).FnCol)) { return ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1) @@ -127849,7 +130262,7 @@ __10: goto __11 __11: ; - if !(((*SrcList_item)(unsafe.Pointer(pSrc)).FcolUsed & (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1))) != 0) { + if !(((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1))) != 0) { goto __13 } nKeyCol = nKeyCol + ((int32((*Table)(unsafe.Pointer(pTable)).FnCol) - (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8)))) + 1) @@ -127865,7 +130278,7 @@ __13: __14: ; *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = pIdx - (*Index)(unsafe.Pointer(pIdx)).FzName = ts + 23597 /* "auto-index" */ + (*Index)(unsafe.Pointer(pIdx)).FzName = ts + 24055 /* "auto-index" */ (*Index)(unsafe.Pointer(pIdx)).FpTable = pTable n = 0 idxCols = uint64(0) @@ -127877,7 +130290,7 @@ __15: if !(termCanDriveIndex(tls, pTerm, pSrc, notReady) != 0) { goto __18 } - iCol1 = *(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)) + iCol1 = *(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) if iCol1 >= (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) { cMask1 = (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1)) } else { @@ -127889,7 +130302,7 @@ __15: } pX = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr idxCols = idxCols | (cMask1) - *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = I16(*(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */))) + *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = I16(*(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */))) pColl = Xsqlite3ExprCompareCollSeq(tls, pParse, pX) // TH3 collate01.800 *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*8)) = func() uintptr { @@ -127905,7 +130318,7 @@ __18: ; goto __16 __16: - pTerm += 64 + pTerm += 56 goto __15 goto __17 __17: @@ -127933,7 +130346,7 @@ __21: goto __22 __22: ; - if !(((*SrcList_item)(unsafe.Pointer(pSrc)).FcolUsed & (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1))) != 0) { + if !(((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (Bitmask((uint64(1))) << ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1))) != 0) { goto __24 } i = ((int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) - 1) @@ -127962,19 +130375,19 @@ __24: (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) Xsqlite3VdbeAddOp2(tls, v, OP_OpenAutoindex, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, (nKeyCol + 1)) Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx) - Xsqlite3VdbeComment(tls, v, ts+16899 /* "for %s" */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTable)).FzName)) + Xsqlite3VdbeComment(tls, v, ts+17324 /* "for %s" */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTable)).FzName)) // Fill the automatic index with content pTabItem = (((*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112) if !((uint32(int32(*(*uint8)(unsafe.Pointer(pTabItem + 60 /* &.fg */ + 4 /* &.viaCoroutine */)) & 0x10 >> 4))) != 0) { goto __28 } - regYield = (*SrcList_item)(unsafe.Pointer(pTabItem)).FregReturn + regYield = (*SrcItem)(unsafe.Pointer(pTabItem)).FregReturn addrCounter = Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, 0) - Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, (*SrcList_item)(unsafe.Pointer(pTabItem)).FaddrFillSub) + Xsqlite3VdbeAddOp3(tls, v, OP_InitCoroutine, regYield, 0, (*SrcItem)(unsafe.Pointer(pTabItem)).FaddrFillSub) addrTop = Xsqlite3VdbeAddOp1(tls, v, OP_Yield, regYield) - Xsqlite3VdbeComment(tls, v, ts+23357 /* "next row of %s" */, libc.VaList(bp+24, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab)).FzName)) + Xsqlite3VdbeComment(tls, v, ts+23815 /* "next row of %s" */, libc.VaList(bp+24, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pTabItem)).FpTab)).FzName)) goto __29 __28: addrTop = Xsqlite3VdbeAddOp1(tls, v, OP_Rewind, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur) @@ -127985,14 +130398,14 @@ __29: } iContinue = Xsqlite3VdbeMakeLabel(tls, pParse) Xsqlite3ExprIfFalse(tls, pParse, pPartial, iContinue, SQLITE_JUMPIFNULL) - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_PARTIALIDX) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_PARTIALIDX)) __30: ; regRecord = Xsqlite3GetTempReg(tls, pParse) regBase = Xsqlite3GenerateIndexKey(tls, pParse, pIdx, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, regRecord, 0, uintptr(0), uintptr(0), 0) Xsqlite3VdbeAddOp2(tls, v, OP_IdxInsert, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, regRecord) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_USESEEKRESULT) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) if !(pPartial != 0) { goto __31 } @@ -128005,13 +130418,13 @@ __31: Xsqlite3VdbeChangeP2(tls, v, addrCounter, (regBase + n)) translateColumnToCopy(tls, pParse, addrTop, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, - (*SrcList_item)(unsafe.Pointer(pTabItem)).FregResult, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur) + (*SrcItem)(unsafe.Pointer(pTabItem)).FregResult, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur) Xsqlite3VdbeGoto(tls, v, addrTop) libc.SetBitFieldPtr8Uint32(pTabItem+60 /* &.fg */ +4 /* &.viaCoroutine */, uint32(0), 4, 0x10) goto __33 __32: Xsqlite3VdbeAddOp2(tls, v, OP_Next, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, (addrTop + 1)) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_STMTSTATUS_AUTOINDEX) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_STMTSTATUS_AUTOINDEX)) __33: ; Xsqlite3VdbeJumpHere(tls, v, addrTop) @@ -128027,7 +130440,7 @@ end_auto_index_create: // 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 *libc.TLS, pParse uintptr, pWC uintptr, mUnusable Bitmask, pSrc uintptr, pOrderBy uintptr, pmNoOmit uintptr) uintptr { /* sqlite3.c:146515:27: */ +func allocateIndexInfo(tls *libc.TLS, pParse uintptr, pWC uintptr, mUnusable Bitmask, pSrc uintptr, pOrderBy uintptr, pmNoOmit uintptr) uintptr { /* sqlite3.c:149130:27: */ var i int32 var j int32 var nTerm int32 @@ -128049,7 +130462,7 @@ __1: goto __3 } { - if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor { + if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor { goto __2 } if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & mUnusable) != 0 { @@ -128069,7 +130482,7 @@ __1: goto __2 __2: i++ - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -128083,7 +130496,7 @@ __3: var n int32 = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr for i = 0; i < n; i++ { var pExpr uintptr = (*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(i)*32)).FpExpr - if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN) || ((*Expr)(unsafe.Pointer(pExpr)).FiTable != (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor) { + if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != TK_COLUMN) || ((*Expr)(unsafe.Pointer(pExpr)).FiTable != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor) { break } if (int32((*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*32)).FsortFlags) & KEYINFO_ORDER_BIGNULL) != 0 { @@ -128100,7 +130513,7 @@ __3: ((uint64(unsafe.Sizeof(sqlite3_index_constraint{})) + uint64(unsafe.Sizeof(sqlite3_index_constraint_usage{}))) * uint64(nTerm))) + (uint64(unsafe.Sizeof(sqlite3_index_orderby{})) * uint64(nOrderBy))) + uint64(unsafe.Sizeof(HiddenIndexInfo1{}))))) if pIdxInfo == uintptr(0) { - Xsqlite3ErrorMsg(tls, pParse, ts+7766 /* "out of memory" */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+7859 /* "out of memory" */, 0) return uintptr(0) } pHidden = (pIdxInfo + 1*96) @@ -128121,7 +130534,7 @@ __4: } { var op U16 - if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor { + if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor { goto __5 } if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & mUnusable) != 0 { @@ -128138,24 +130551,24 @@ __4: // tag-20191211-002: WHERE-clause constraints are not useful to the // right-hand table of a LEFT JOIN. See tag-20191211-001 for the // equivalent restriction for ordinary tables. - if ((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && - !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + if ((int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && + !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { goto __5 } - (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).FiColumn = *(*int32)(unsafe.Pointer(pTerm + 40 /* &.u */)) + (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).FiColumn = *(*int32)(unsafe.Pointer(pTerm + 32 /* &.u */ /* &.x */ /* &.leftColumn */)) (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).FiTermOffset = i op = (U16(int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_ALL)) if int32(op) == WO_IN { - op = WO_EQ + op = U16(WO_EQ) } if int32(op) == WO_AUX { (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = (*WhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp } else if (int32(op) & (WO_ISNULL | WO_IS)) != 0 { if int32(op) == WO_ISNULL { - (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = SQLITE_INDEX_CONSTRAINT_ISNULL + (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(SQLITE_INDEX_CONSTRAINT_ISNULL) } else { - (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = SQLITE_INDEX_CONSTRAINT_IS + (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = uint8(SQLITE_INDEX_CONSTRAINT_IS) } } else { (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12)).Fop = U8(op) @@ -128184,7 +130597,7 @@ __4: goto __5 __5: i++ - pTerm += 64 + pTerm += 56 goto __4 goto __6 __6: @@ -128214,7 +130627,7 @@ __6: // 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 *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) int32 { /* sqlite3.c:146670:12: */ +func vtabBestIndex(tls *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) int32 { /* sqlite3.c:149285:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -128248,7 +130661,7 @@ func vtabBestIndex(tls *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) int32 // into the aSample[] array - it is an index into a virtual set of samples // based on the contents of aSample[] and the number of fields in record // pRec. -func whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, roundUp int32, aStat uintptr) int32 { /* sqlite3.c:146707:12: */ +func whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, roundUp int32, aStat uintptr) int32 { /* sqlite3.c:149322:12: */ var aSample uintptr = (*Index)(unsafe.Pointer(pIdx)).FaSample var iCol int32 // Index of required stats in anEq[] etc. var i int32 // Index of first sample >= pRec @@ -128387,7 +130800,7 @@ func whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, ro // 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 *libc.TLS, pTerm uintptr, nNew LogEst) LogEst { /* sqlite3.c:146899:15: */ +func whereRangeAdjust(tls *libc.TLS, pTerm uintptr, nNew LogEst) LogEst { /* sqlite3.c:149514:15: */ var nRet LogEst = nNew if pTerm != 0 { if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0 { @@ -128400,11 +130813,11 @@ func whereRangeAdjust(tls *libc.TLS, pTerm uintptr, nNew LogEst) LogEst { /* sql } // Return the affinity for a single column of an index. -func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol int32) int8 { /* sqlite3.c:146916:21: */ +func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol int32) int8 { /* sqlite3.c:149531:21: */ if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) { if Xsqlite3IndexAffinityStr(tls, db, pIdx) == uintptr(0) { - return SQLITE_AFF_BLOB + return int8(SQLITE_AFF_BLOB) } } @@ -128444,7 +130857,7 @@ func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol i // // If an error occurs, an SQLite error code is returned. Otherwise, // SQLITE_OK. -func whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUpper uintptr, pLoop uintptr, pbDone uintptr) int32 { /* sqlite3.c:146963:12: */ +func whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUpper uintptr, pLoop uintptr, pbDone uintptr) int32 { /* sqlite3.c:149578:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -128559,7 +130972,7 @@ func whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUpper // used, a single range inequality reduces the search space by a factor of 4. // and a pair of constraints (x>? AND x 0) && (nEq < (*Index)(unsafe.Pointer(p)).FnSampleCol)) && - ((int32((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags) & (SQLITE_Stat4)) == 0) { + (((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0)) { if nEq == (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid { *(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)) = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec // var a [2]TRowcnt at bp, 8 @@ -128755,7 +131168,7 @@ func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower u // required for string comparison, or if unable to allocate memory // for a UTF conversion required for comparison. The error is stored // in the pParse structure. -func whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr uintptr, pnRow uintptr) int32 { /* sqlite3.c:147256:12: */ +func whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr uintptr, pnRow uintptr) int32 { /* sqlite3.c:149871:12: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -128811,7 +131224,7 @@ func whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr ui // required for string comparison, or if unable to allocate memory // for a UTF conversion required for comparison. The error is stored // in the pParse structure. -func whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uintptr, pnRow uintptr) int32 { /* sqlite3.c:147320:12: */ +func whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uintptr, pnRow uintptr) int32 { /* sqlite3.c:149935:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -128844,7 +131257,7 @@ func whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uintp // Convert bulk memory into a valid WhereLoop that can be passed // to whereLoopClear harmlessly. -func whereLoopInit(tls *libc.TLS, p uintptr) { /* sqlite3.c:147466:13: */ +func whereLoopInit(tls *libc.TLS, p uintptr) { /* sqlite3.c:150081:13: */ (*WhereLoop)(unsafe.Pointer(p)).FaLTerm = p + 72 /* &.aLTermSpace */ (*WhereLoop)(unsafe.Pointer(p)).FnLTerm = U16(0) (*WhereLoop)(unsafe.Pointer(p)).FnLSlot = U16((int32(uint64(unsafe.Sizeof([3]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0)))))) @@ -128852,13 +131265,13 @@ func whereLoopInit(tls *libc.TLS, p uintptr) { /* sqlite3.c:147466:13: */ } // Clear the WhereLoop.u union. Leave WhereLoop.pLTerm intact. -func whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147476:13: */ +func whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:150091:13: */ if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & (U32(WHERE_VIRTUALTABLE | WHERE_AUTO_INDEX))) != 0 { - if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_VIRTUALTABLE) != U32(0)) && (*(*U8)(unsafe.Pointer((p + 24 /* &.u */ /* &.vtab */) + 4 /* &.needFree */)) != 0) { + if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0)) && (*(*U8)(unsafe.Pointer((p + 24 /* &.u */ /* &.vtab */) + 4 /* &.needFree */)) != 0) { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */))) *(*U8)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.vtab */ + 8 /* &.idxStr */)) = uintptr(0) - } else if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) && (*(*uintptr)(unsafe.Pointer((p + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0)) { + } else if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && (*(*uintptr)(unsafe.Pointer((p + 24 /* &.u */ /* &.btree */) + 8 /* &.pIndex */)) != uintptr(0)) { Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))).FzColAff) Xsqlite3DbFreeNN(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */))) *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0) @@ -128867,7 +131280,7 @@ func whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:14 } // Deallocate internal memory used by a WhereLoop object -func whereLoopClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147493:13: */ +func whereLoopClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:150108:13: */ if (*WhereLoop)(unsafe.Pointer(p)).FaLTerm != p+72 /* &.aLTermSpace */ { Xsqlite3DbFreeNN(tls, db, (*WhereLoop)(unsafe.Pointer(p)).FaLTerm) } @@ -128876,7 +131289,7 @@ func whereLoopClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147493: } // Increase the memory allocation for pLoop->aLTerm[] to be at least n. -func whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) int32 { /* sqlite3.c:147502:12: */ +func whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) int32 { /* sqlite3.c:150117:12: */ var paNew uintptr if int32((*WhereLoop)(unsafe.Pointer(p)).FnLSlot) >= n { return SQLITE_OK @@ -128896,7 +131309,7 @@ func whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) int32 { /* s } // Transfer content from the second pLoop into the first. -func whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:147518:12: */ +func whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:150133:12: */ whereLoopClearUnion(tls, db, pTo) if whereLoopResize(tls, db, pTo, int32((*WhereLoop)(unsafe.Pointer(pFrom)).FnLTerm)) != 0 { libc.Xmemset(tls, (pTo + 24 /* &.u */), 0, uint64(unsafe.Sizeof(struct { @@ -128912,27 +131325,27 @@ func whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 } libc.Xmemcpy(tls, pTo, pFrom, uint64((uintptr(0) + 48 /* &.nLSlot */))) libc.Xmemcpy(tls, (*WhereLoop)(unsafe.Pointer(pTo)).FaLTerm, (*WhereLoop)(unsafe.Pointer(pFrom)).FaLTerm, (uint64((*WhereLoop)(unsafe.Pointer(pTo)).FnLTerm) * uint64(unsafe.Sizeof(uintptr(0))))) - if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & WHERE_VIRTUALTABLE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != 0 { *(*U8)(unsafe.Pointer(pFrom + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) - } else if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & WHERE_AUTO_INDEX) != U32(0) { + } else if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0) { *(*uintptr)(unsafe.Pointer(pFrom + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0) } return SQLITE_OK } // Delete a WhereLoop object -func whereLoopDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147537:13: */ +func whereLoopDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:150152:13: */ whereLoopClear(tls, db, p) Xsqlite3DbFreeNN(tls, db, p) } // Free a WhereInfo structure -func whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:147545:13: */ +func whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:150160:13: */ var i int32 for i = 0; i < int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel); i++ { - var pLevel uintptr = ((pWInfo + 920 /* &.a */) + uintptr(i)*88) - if ((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop != 0) && (((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & WHERE_IN_ABLE) != 0) { + var pLevel uintptr = ((pWInfo + 856 /* &.a */) + uintptr(i)*88) + if ((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop != 0) && (((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & U32(WHERE_IN_ABLE)) != 0) { Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */ /* &.in */ + 8 /* &.aInLoop */))) } } @@ -128962,7 +131375,7 @@ func whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:147 // deserve a lower cost even if it is a proper subset of Y. Constraint (5) // was added because a covering index probably deserves to have a lower cost // than a non-covering index even if it is a proper subset. -func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { /* sqlite3.c:147582:12: */ +func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { /* sqlite3.c:150197:12: */ var i int32 var j int32 if (int32((*WhereLoop)(unsafe.Pointer(pX)).FnLTerm) - int32((*WhereLoop)(unsafe.Pointer(pX)).FnSkip)) >= (int32((*WhereLoop)(unsafe.Pointer(pY)).FnLTerm) - int32((*WhereLoop)(unsafe.Pointer(pY)).FnSkip)) { @@ -128992,8 +131405,8 @@ func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { return 0 } // X not a subset of Y since term X[i] not used by Y } - if (((*WhereLoop)(unsafe.Pointer(pX)).FwsFlags & WHERE_IDX_ONLY) != U32(0)) && - (((*WhereLoop)(unsafe.Pointer(pY)).FwsFlags & WHERE_IDX_ONLY) == U32(0)) { + if (((*WhereLoop)(unsafe.Pointer(pX)).FwsFlags & U32(WHERE_IDX_ONLY)) != U32(0)) && + (((*WhereLoop)(unsafe.Pointer(pY)).FwsFlags & U32(WHERE_IDX_ONLY)) == U32(0)) { return 0 // Constraint (5) } return 1 // All conditions meet @@ -129011,15 +131424,15 @@ func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { // 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 *libc.TLS, p uintptr, pTemplate uintptr) { /* sqlite3.c:147623:13: */ - if ((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & WHERE_INDEXED) == U32(0) { +func whereLoopAdjustCost(tls *libc.TLS, p uintptr, pTemplate uintptr) { /* sqlite3.c:150238:13: */ + if ((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_INDEXED)) == U32(0) { return } for ; p != 0; p = (*WhereLoop)(unsafe.Pointer(p)).FpNextLoop { if int32((*WhereLoop)(unsafe.Pointer(p)).FiTab) != int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FiTab) { continue } - if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_INDEXED) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_INDEXED)) == U32(0) { continue } if whereLoopCheaperProperSubset(tls, p, pTemplate) != 0 { @@ -129050,7 +131463,7 @@ func whereLoopAdjustCost(tls *libc.TLS, p uintptr, pTemplate uintptr) { /* sqlit // If pTemplate cannot replace any existing element of the list but needs // to be added to the list as a new entry, then return a pointer to the // tail of the list. -func whereLoopFindLesser(tls *libc.TLS, ppPrev uintptr, pTemplate uintptr) uintptr { /* sqlite3.c:147660:18: */ +func whereLoopFindLesser(tls *libc.TLS, ppPrev uintptr, pTemplate uintptr) uintptr { /* sqlite3.c:150275:18: */ var p uintptr p = *(*uintptr)(unsafe.Pointer(ppPrev)) __1: @@ -129075,10 +131488,10 @@ __1: // Any loop using an appliation-defined index (or PRIMARY KEY or // UNIQUE constraint) with one or more == constraints is better // than an automatic index. Unless it is a skip-scan. - if ((((((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) && + if ((((((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && ((int32((*WhereLoop)(unsafe.Pointer(pTemplate)).FnSkip)) == 0)) && - (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & WHERE_INDEXED) != U32(0))) && - (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & WHERE_COLUMN_EQ) != U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_INDEXED)) != U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(WHERE_COLUMN_EQ)) != U32(0))) && (((*WhereLoop)(unsafe.Pointer(p)).Fprereq & (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq) == (*WhereLoop)(unsafe.Pointer(pTemplate)).Fprereq) { goto __3 } @@ -129139,7 +131552,7 @@ __3: // (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 *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 { /* sqlite3.c:147748:12: */ +func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 { /* sqlite3.c:150363:12: */ var ppPrev uintptr var p uintptr var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo @@ -129210,7 +131623,7 @@ func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 { } } rc = whereLoopXfer(tls, db, p, pTemplate) - if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0) { var pIndex uintptr = *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) if (pIndex != 0) && ((int32(*(*uint16)(unsafe.Pointer(pIndex + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_IPK) { *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = uintptr(0) @@ -129246,7 +131659,7 @@ func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 { // "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 *libc.TLS, pWC uintptr, pLoop uintptr, nRow LogEst) { /* sqlite3.c:147885:13: */ +func whereLoopOutputAdjust(tls *libc.TLS, pWC uintptr, pLoop uintptr, nRow LogEst) { /* sqlite3.c:150500:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -129282,7 +131695,7 @@ __1: if pX == pTerm { break } - if ((*WhereTerm)(unsafe.Pointer(pX)).FiParent >= 0) && (((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pX)).FiParent)*64) == pTerm) { + if ((*WhereTerm)(unsafe.Pointer(pX)).FiParent >= 0) && (((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereTerm)(unsafe.Pointer(pX)).FiParent)*56) == pTerm) { break } } @@ -129317,7 +131730,7 @@ __1: goto __2 __2: i-- - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -129342,7 +131755,7 @@ __3: // // then this function would be invoked with nEq=1. The value returned in // this case is 3. -func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr, nEq int32, pTerm uintptr) int32 { /* sqlite3.c:147955:12: */ +func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr, nEq int32, pTerm uintptr) int32 { /* sqlite3.c:150570:12: */ var nCmp int32 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft) var i int32 @@ -129360,7 +131773,7 @@ func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr var pColl uintptr // Comparison collation sequence var pLhs uintptr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr var pRhs uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight - if ((*Expr)(unsafe.Pointer(pRhs)).Fflags & EP_xIsSelect) != 0 { + if ((*Expr)(unsafe.Pointer(pRhs)).Fflags & U32(EP_xIsSelect)) != 0 { pRhs = (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRhs + 32 /* &.x */)))).FpEList + 8 /* &.a */) + uintptr(i)*32)).FpExpr } else { pRhs = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pRhs + 32 /* &.x */)) + 8 /* &.a */) + uintptr(i)*32)).FpExpr @@ -129407,7 +131820,7 @@ func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr // // If pProbe->idxType==SQLITE_IDXTYPE_IPK, that means pIndex is // a fake index used for the INTEGER PRIMARY KEY. -func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProbe uintptr, nInMul LogEst) int32 { /* sqlite3.c:148026:12: */ +func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProbe uintptr, nInMul LogEst) int32 { /* sqlite3.c:150641:12: */ bp := tls.Alloc(116) defer tls.Free(116) @@ -129438,7 +131851,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb return SQLITE_NOMEM } - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_BTM_LIMIT) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_BTM_LIMIT)) != 0 { opMask = ((int32(WO_EQ) << (TK_LT - TK_EQ)) | (int32(WO_EQ) << (TK_LE - TK_EQ))) } else { @@ -129456,7 +131869,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb saved_wsFlags = (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags saved_prereq = (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq saved_nOut = (*WhereLoop)(unsafe.Pointer(pNew)).FnOut - pTerm = whereScanInit(tls, bp /* &scan */, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor, int32(saved_nEq), + pTerm = whereScanInit(tls, bp /* &scan */, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, int32(saved_nEq), uint32(opMask), pProbe) (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0) rSize = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -129484,8 +131897,8 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // tag-20191211-001: Do not allow constraints from the WHERE clause to // be used by the right table of a LEFT JOIN. Only constraints in the // ON clause are allowed. See tag-20191211-002 for the vtab equivalent. - if ((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && - !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)) { + if ((int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_LEFT) != 0) && + !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) { continue } @@ -129507,7 +131920,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb if (int32(eOp) & WO_IN) != 0 { var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_xIsSelect)) != U32(0) { + if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0) { // "x IN (SELECT ...)": TUNING: the SELECT returns 25 rows var i int32 nIn = 46 @@ -129526,7 +131939,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // "x IN (value, value, ...)" nIn = int32(Xsqlite3LogEst(tls, uint64((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FnExpr))) } - if (uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.hasStat1 */)) & 0x80 >> 7))) != 0 { + if ((uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.hasStat1 */)) & 0x80 >> 7))) != 0) && (int32(rLogSize) >= 10) { var M LogEst var logK LogEst var safetyMargin LogEst @@ -129547,59 +131960,60 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // a safety margin of 2 (LogEst: 10) that favors using the IN operator // with the index, as using an index has better worst-case behavior. // If we do not have real sqlite_stat1 data, always prefer to use - // the index. + // the index. Do not bother with this optimization on very small + // tables (less than 2 rows) as it is pointless in that case. M = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2)) logK = estLog(tls, int16(nIn)) safetyMargin = int16(10) // TUNING: extra weight for indexed IN if ((int32(M) + int32(logK)) + int32(safetyMargin)) < (nIn + int32(rLogSize)) { - continue + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_IN_SEEKSCAN)) } else { } } - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_COLUMN_IN) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_IN)) } else if (int32(eOp) & (WO_EQ | WO_IS)) != 0 { var iCol int32 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiColumn + uintptr(saved_nEq)*2))) - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_COLUMN_EQ) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_EQ)) if (iCol == (-1)) || (((iCol >= 0) && (int32(nInMul) == 0)) && (int32(saved_nEq) == (int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) - 1))) { if ((iCol == (-1)) || ((uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.uniqNotNull */)) & 0x8 >> 3))) != 0)) || (((int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) == 1) && ((*Index)(unsafe.Pointer(pProbe)).FonError != 0)) && (int32(eOp) == WO_EQ)) { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_ONEROW) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_ONEROW)) } else { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_UNQ_WANTED) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_UNQ_WANTED)) } } } else if (int32(eOp) & WO_ISNULL) != 0 { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_COLUMN_NULL) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_NULL)) } else if (int32(eOp) & ((int32(WO_EQ) << (TK_GT - TK_EQ)) | (int32(WO_EQ) << (TK_GE - TK_EQ)))) != 0 { *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_RANGE | WHERE_BTM_LIMIT)) *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 2 /* &.nBtm */)) = U16(whereRangeVectorLen(tls, - pParse, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm)) + pParse, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm)) pBtm = pTerm pTop = uintptr(0) if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & TERM_LIKEOPT) != 0 { - // Range contraints that come from the LIKE optimization are + // Range constraints that come from the LIKE optimization are // always used in pairs. - pTop = (pTerm + 1*64) + pTop = (pTerm + 1*56) if whereLoopResize(tls, db, pNew, (int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1)) != 0 { break } // OOM *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = pTop - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_TOP_LIMIT) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_TOP_LIMIT)) *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) = U16(1) } } else { *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_COLUMN_RANGE | WHERE_TOP_LIMIT)) *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 4 /* &.nTop */)) = U16(whereRangeVectorLen(tls, - pParse, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm)) + pParse, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, pProbe, int32(saved_nEq), pTerm)) pTop = pTerm - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_BTM_LIMIT) != U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_BTM_LIMIT)) != U32(0) { pBtm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr((int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-2))*8)) } else { pBtm = uintptr(0) @@ -129612,7 +132026,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // "x IN(...)" terms are replaced with "x = ?". This block updates // the value of pNew->nOut to account for pTerm (but not nIn/nInMul). - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_COLUMN_RANGE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != 0 { // Adjust nOut using stat4 data. Or, if there is no stat4 // data, using some other estimate. whereRangeScanEst(tls, pParse, pBuilder, pBtm, pTop, pNew) @@ -129628,8 +132042,8 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb if ((((int32(nInMul) == 0) && ((*Index)(unsafe.Pointer(pProbe)).FnSample != 0)) && (int32(*(*U16)(unsafe.Pointer((pNew + 24 /* &.u */ /* &.btree */) /* &.nEq */))) <= (*Index)(unsafe.Pointer(pProbe)).FnSampleCol)) && - (((int32(eOp) & WO_IN) == 0) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_xIsSelect)) != U32(0)))) && - ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_Stat4)) == 0) { + (((int32(eOp) & WO_IN) == 0) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_xIsSelect))) != U32(0)))) && + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_Stat4))) == U32(0)) { var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (int32(eOp) & ((WO_EQ | WO_ISNULL) | WO_IS)) != 0 { @@ -129681,7 +132095,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // seek only. Then, if this is a non-covering index, add the cost of // visiting the rows in the main table. - rCostIdx = (LogEst((int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) + 1) + ((15 * int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow)) / int32((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FszTabRow)))) + rCostIdx = (LogEst((int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) + 1) + ((15 * int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow)) / int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FszTabRow)))) (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, rLogSize, rCostIdx) if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & (U32(WHERE_IDX_ONLY | WHERE_IPK))) == U32(0) { (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, (*WhereLoop)(unsafe.Pointer(pNew)).FrRun, (int16(int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) + 16))) @@ -129693,13 +132107,13 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb whereLoopOutputAdjust(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC, pNew, rSize) rc = whereLoopInsert(tls, pBuilder, pNew) - if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_COLUMN_RANGE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_COLUMN_RANGE)) != 0 { (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut } else { (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = nOutUnadjusted } - if (((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & WHERE_TOP_LIMIT) == U32(0)) && + if (((*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags & U32(WHERE_TOP_LIMIT)) == U32(0)) && (int32(*(*U16)(unsafe.Pointer((pNew + 24 /* &.u */ /* &.btree */) /* &.nEq */))) < int32((*Index)(unsafe.Pointer(pProbe)).FnColumn)) { whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, (int16(int32(nInMul) + nIn))) } @@ -129731,14 +132145,14 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb (int32(saved_nEq) == int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm))) && ((int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.noSkipScan */)) & 0x40 >> 6)) == 0)) && ((int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.hasStat1 */)) & 0x80 >> 7)) != 0)) && - ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_SkipScan)) == 0)) && + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_SkipScan))) == U32(0))) && (int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr((int32(saved_nEq)+1))*2))) >= 42)) && // TUNING: Minimum for skip-scan ((libc.AssignInt32(&rc, whereLoopResize(tls, db, pNew, (int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1)))) == SQLITE_OK) { var nIter LogEst *(*U16)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ /* &.nEq */))++ (*WhereLoop)(unsafe.Pointer(pNew)).FnSkip++ *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = uintptr(0) - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_SKIPSCAN) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_SKIPSCAN)) nIter = (LogEst(int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))) - int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr((int32(saved_nEq)+1))*2))))) *(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) -= LogEst((int32(nIter))) // TUNING: Because uncertainties in the estimates for skip-scan queries, @@ -129760,7 +132174,7 @@ func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProb // 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 *libc.TLS, pBuilder uintptr, pIndex uintptr, iCursor int32) int32 { /* sqlite3.c:148411:12: */ +func indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr, iCursor int32) int32 { /* sqlite3.c:151027:12: */ var pOB uintptr var aColExpr uintptr var ii int32 @@ -129774,6 +132188,9 @@ func indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr, } for ii = 0; ii < (*ExprList)(unsafe.Pointer(pOB)).FnExpr; ii++ { var pExpr uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pOB+8 /* &.a */)+uintptr(ii)*32)).FpExpr) + if pExpr == uintptr(0) { + continue + } if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_COLUMN) && ((*Expr)(unsafe.Pointer(pExpr)).FiTable == iCursor) { if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 { return 1 @@ -129799,7 +132216,7 @@ func indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr, // 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 *libc.TLS, iTab int32, isLeft int32, pWC uintptr, pWhere uintptr) int32 { /* sqlite3.c:148444:12: */ +func whereUsablePartialIndex(tls *libc.TLS, iTab int32, isLeft int32, pWC uintptr, pWhere uintptr) int32 { /* sqlite3.c:151061:12: */ var i int32 var pTerm uintptr var pParse uintptr = (*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse @@ -129809,7 +132226,7 @@ func whereUsablePartialIndex(tls *libc.TLS, iTab int32, isLeft int32, pWC uintpt } pWhere = (*Expr)(unsafe.Pointer(pWhere)).FpRight } - if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & SQLITE_EnableQPSG) != 0 { + if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(SQLITE_EnableQPSG)) != 0 { pParse = uintptr(0) } i = 0 @@ -129821,8 +132238,8 @@ __1: { var pExpr uintptr pExpr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if ((!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)) || (int32((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable) == iTab)) && - ((isLeft == 0) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_FromJoin)) != U32(0)))) && + if ((!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) || ((*Expr)(unsafe.Pointer(pExpr)).FiRightJoinTable == iTab)) && + ((isLeft == 0) || (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)))) && (Xsqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0) { return 1 } @@ -129831,7 +132248,7 @@ __1: goto __2 __2: i++ - pTerm += 64 + pTerm += 56 goto __1 goto __3 __3: @@ -129873,7 +132290,7 @@ __3: // 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 *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { /* sqlite3.c:148507:12: */ +func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { /* sqlite3.c:151124:12: */ bp := tls.Alloc(158) defer tls.Free(158) @@ -129899,13 +132316,13 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { pWInfo = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo pTabList = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList pSrc = ((pTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*112) - pTab = (*SrcList_item)(unsafe.Pointer(pSrc)).FpTab + pTab = (*SrcItem)(unsafe.Pointer(pSrc)).FpTab pWC = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC - if (*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex != 0 { + if (uint32(int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 { // An INDEXED BY clause specifies a particular index to use - pProbe = (*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex - } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + pProbe = *(*uintptr)(unsafe.Pointer(pSrc + 104 /* &.u2 */)) + } else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { pProbe = (*Table)(unsafe.Pointer(pTab)).FpIndex } else { // There is no INDEXED BY clause. Create a fake Index object in local @@ -129918,13 +132335,13 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { (*Index)(unsafe.Pointer(bp /* &sPk */)).FnColumn = U16(1) (*Index)(unsafe.Pointer(bp /* &sPk */)).FaiColumn = bp + 152 /* &aiColumnPk */ (*Index)(unsafe.Pointer(bp /* &sPk */)).FaiRowLogEst = bp + 154 /* &aiRowEstPk[0] */ - (*Index)(unsafe.Pointer(bp /* &sPk */)).FonError = OE_Replace + (*Index)(unsafe.Pointer(bp /* &sPk */)).FonError = U8(OE_Replace) (*Index)(unsafe.Pointer(bp /* &sPk */)).FpTable = pTab (*Index)(unsafe.Pointer(bp /* &sPk */)).FszIdxRow = (*Table)(unsafe.Pointer(pTab)).FszTabRow - libc.SetBitFieldPtr16Uint32(bp /* &sPk */ +100 /* &.idxType */, SQLITE_IDXTYPE_IPK, 0, 0x3) + libc.SetBitFieldPtr16Uint32(bp /* &sPk */ +100 /* &.idxType */, uint32(SQLITE_IDXTYPE_IPK), 0, 0x3) *(*LogEst)(unsafe.Pointer(bp + 154 /* &aiRowEstPk[0] */)) = (*Table)(unsafe.Pointer(pTab)).FnRowLogEst *(*LogEst)(unsafe.Pointer(bp + 154 /* &aiRowEstPk[0] */ + 1*2)) = int16(0) - pFirst = (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FpIndex + pFirst = (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FpIndex if (int32(*(*uint8)(unsafe.Pointer((pSrc + 60 /* &.fg */) + 4 /* &.notIndexed */)) & 0x1 >> 0)) == 0 { // The real indices of the table are only considered if the // NOT INDEXED qualifier is omitted from the FROM clause @@ -129938,16 +132355,16 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { // Automatic indexes if ((((((!(int32((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet) != 0) && // Not part of an OR optimization ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_OR_SUBCLAUSE) == 0)) && - (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags & SQLITE_AutoIndex) != uint64(0))) && - ((*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex == uintptr(0))) && // Has no INDEXED BY clause + (((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags & uint64(SQLITE_AutoIndex)) != uint64(0))) && + !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1)) != 0)) && // Has no INDEXED BY clause !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.notIndexed */)) & 0x1 >> 0)) != 0)) && // Has no NOT INDEXED clause - (((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) && // Not WITHOUT ROWID table. (FIXME: Why not?) + (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) && // Not WITHOUT ROWID table. (FIXME: Why not?) !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isCorrelated */)) & 0x8 >> 3)) != 0)) && // Not a correlated subquery !((int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isRecursive */)) & 0x20 >> 5)) != 0) { // Generate auto-index WhereLoops var pTerm uintptr - var pWCEnd uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*64) - for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; (rc == SQLITE_OK) && (pTerm < pWCEnd); pTerm += 64 { + var pWCEnd uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*56) + for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; (rc == SQLITE_OK) && (pTerm < pWCEnd); pTerm += 56 { if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf) != 0 { continue } @@ -129966,7 +132383,7 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { // those objects, since there is no opportunity to add schema // indexes on subqueries and views. (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = (LogEst(int32(rLogSize) + int32(rSize))) - if ((*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0)) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Ephemeral) == U32(0)) { + if ((*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0)) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) == U32(0)) { *(*LogEst)(unsafe.Pointer(pNew + 18 /* &.rSetup */)) += int16((28)) } else { *(*LogEst)(unsafe.Pointer(pNew + 18 /* &.rSetup */)) -= int16((10)) @@ -129981,7 +132398,7 @@ func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { // not be unreasonable to make this value much larger. (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = int16(43) (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = Xsqlite3LogEstAdd(tls, rLogSize, (*WhereLoop)(unsafe.Pointer(pNew)).FnOut) - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_AUTO_INDEX + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_AUTO_INDEX) (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = (mPrereq | (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) rc = whereLoopInsert(tls, pBuilder, pNew) } @@ -129995,9 +132412,9 @@ __1: goto __3 } { - var isLeft int32 = (libc.Bool32((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_OUTER) != 0)) + var isLeft int32 = (libc.Bool32((int32((*SrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & JT_OUTER) != 0)) if ((*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0)) && - !(whereUsablePartialIndex(tls, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor, isLeft, pWC, + !(whereUsablePartialIndex(tls, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor, isLeft, pWC, (*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere) != 0) { // See ticket [98d973b8f5] goto __2 // Partial index inappropriate for this query @@ -130016,13 +132433,13 @@ __1: (*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = mPrereq (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = rSize *(*uintptr)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) = pProbe - b = indexMightHelpWithOrderBy(tls, pBuilder, pProbe, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor) + b = indexMightHelpWithOrderBy(tls, pBuilder, pProbe, (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor) // The ONEPASS_DESIRED flags never occurs together with ORDER BY if (int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_IPK { // Integer primary key index - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_IPK + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_IPK) // Full table scan (*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = func() uint8 { @@ -130031,8 +132448,18 @@ __1: } return uint8(0) }() - // TUNING: Cost of full table scan is (N*3.0). - (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = (LogEst(int32(rSize) + 16)) + // TUNING: Cost of full table scan is 3.0*N. The 3.0 factor is an + // extra cost designed to discourage the use of full table scans, + // since index lookups have better worst-case performance if our + // stat guesses are wrong. Reduce the 3.0 penalty slightly + // (to 2.75) if we have valid STAT4 information for the table. + // At 2.75, a full table scan is preferred over using an index on + // a column with just two distinct values where each value has about + // an equal number of appearances. Without STAT4 data, we still want + // to use an index in that case, since the constraint might be for + // the scarcer of the two values, and in that case an index lookup is + // better. + (*WhereLoop)(unsafe.Pointer(pNew)).FrRun = (LogEst((int32(rSize) + 16) - (2 * (libc.Bool32(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_HasStat4)) != U32(0)))))) whereLoopOutputAdjust(tls, pWC, pNew, rSize) rc = whereLoopInsert(tls, pBuilder, pNew) @@ -130046,18 +132473,18 @@ __1: (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = (U32(WHERE_IDX_ONLY | WHERE_INDEXED)) m = uint64(0) } else { - m = ((*SrcList_item)(unsafe.Pointer(pSrc)).FcolUsed & (*Index)(unsafe.Pointer(pProbe)).FcolNotIdxed) + m = ((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (*Index)(unsafe.Pointer(pProbe)).FcolNotIdxed) (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = func() uint32 { if m == uint64(0) { return (uint32(WHERE_IDX_ONLY | WHERE_INDEXED)) } - return WHERE_INDEXED + return uint32(WHERE_INDEXED) }() } // Full scan via index if ((((b != 0) || - !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0))) || + !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0))) || ((*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0))) || ((uint32(int32(*(*uint8)(unsafe.Pointer((pSrc + 60 /* &.fg */) + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0)) || ((((((m == uint64(0)) && @@ -130065,7 +132492,7 @@ __1: (int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow) < int32((*Table)(unsafe.Pointer(pTab)).FszTabRow))) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_ONEPASS_DESIRED) == 0)) && (Xsqlite3Config.FbUseCis != 0)) && - ((int32((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb))).FdbOptFlags) & (SQLITE_CoverIdxScan)) == 0)) { + (((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb))).FdbOptFlags & (U32(SQLITE_CoverIdxScan))) == U32(0))) { (*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = func() uint8 { if b != 0 { return uint8(iSortIdx) @@ -130085,10 +132512,10 @@ __1: // table lookup. var nLookup LogEst = (LogEst(int32(rSize) + 16)) // Base cost: N*3 var ii int32 - var iCur int32 = (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor + var iCur int32 = (*SrcItem)(unsafe.Pointer(pSrc)).FiCursor var pWC2 uintptr = (pWInfo + 104 /* &.sWC */) for ii = 0; ii < (*WhereClause)(unsafe.Pointer(pWC2)).FnTerm; ii++ { - var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC2)).Fa + uintptr(ii)*64) + var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC2)).Fa + uintptr(ii)*56) if !(Xsqlite3ExprCoveredByIndex(tls, (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr, iCur, pProbe) != 0) { break } @@ -130123,7 +132550,7 @@ __1: // unique index is used (making the index functionally non-unique) // then the sqlite_stat1 data becomes important for scoring the // plan - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_StatsUsed) + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_StatsUsed)) } Xsqlite3Stat4ProbeFree(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec) (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = 0 @@ -130133,7 +132560,7 @@ __1: goto __2 __2: pProbe = func() uintptr { - if (*SrcList_item)(unsafe.Pointer(pSrc)).FpIBIndex != 0 { + if (uint32(int32(*(*uint8)(unsafe.Pointer(pSrc + 60 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 { return uintptr(0) } return (*Index)(unsafe.Pointer(pProbe)).FpNext @@ -130164,7 +132591,7 @@ __3: // // 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 *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUsable Bitmask, mExclude U16, pIdxInfo uintptr, mNoOmit U16, pbIn uintptr) int32 { /* sqlite3.c:148766:12: */ +func whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUsable Bitmask, mExclude U16, pIdxInfo uintptr, mNoOmit U16, pbIn uintptr) int32 { /* sqlite3.c:151398:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -130191,7 +132618,7 @@ __1: goto __3 } { - var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset)*64) + var pTerm uintptr = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset)*56) (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable = uint8(0) if (((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight & mUsable) == (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) && ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & int32(mExclude)) == 0) { @@ -130217,10 +132644,10 @@ __3: (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = (float64((1e99)) / float64(2)) (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(25) (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags = 0 - (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FcolUsed = Sqlite3_uint64(Sqlite3_int64((*SrcList_item)(unsafe.Pointer(pSrc)).FcolUsed)) + (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FcolUsed = Sqlite3_uint64(Sqlite3_int64((*SrcItem)(unsafe.Pointer(pSrc)).FcolUsed)) // Invoke the virtual table xBestIndex() method - rc = vtabBestIndex(tls, pParse, (*SrcList_item)(unsafe.Pointer(pSrc)).FpTab, pIdxInfo) + rc = vtabBestIndex(tls, pParse, (*SrcItem)(unsafe.Pointer(pSrc)).FpTab, pIdxInfo) if rc != 0 { if rc == SQLITE_CONSTRAINT { // If the xBestIndex method returns SQLITE_CONSTRAINT, that means @@ -130254,12 +132681,12 @@ __4: (j >= (*WhereClause)(unsafe.Pointer(pWC)).FnTerm)) || (*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0))) || (int32((*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+23608 /* "%s.xBestIndex ma..." */, libc.VaList(bp, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+24066 /* "%s.xBestIndex ma..." */, libc.VaList(bp, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FzName)) return SQLITE_ERROR } - pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(j)*64) + pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(j)*56) *(*Bitmask)(unsafe.Pointer(pNew /* &.prereq */)) |= ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) = pTerm @@ -130302,7 +132729,7 @@ __6: if *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { // The non-zero argvIdx values must be contiguous. Raise an // error if they are not - Xsqlite3ErrorMsg(tls, pParse, ts+23608 /* "%s.xBestIndex ma..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FzName)) + Xsqlite3ErrorMsg(tls, pParse, ts+24066 /* "%s.xBestIndex ma..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pSrc)).FpTab)).FzName)) return SQLITE_ERROR } @@ -130325,7 +132752,7 @@ __6: // Set the WHERE_ONEROW flag if the xBestIndex() method indicated // that the scan will visit at most one row. Clear it otherwise. if ((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags & SQLITE_INDEX_SCAN_UNIQUE) != 0 { - *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (WHERE_ONEROW) + *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(WHERE_ONEROW)) } else { *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(WHERE_ONEROW))) } @@ -130343,13 +132770,13 @@ __6: // sequence associated with element iCons of the sqlite3_index_info.aConstraint // array. Or, if iCons is out of range or there is no active xBestIndex // call, return NULL. -func Xsqlite3_vtab_collation(tls *libc.TLS, pIdxInfo uintptr, iCons int32) uintptr { /* sqlite3.c:148926:23: */ +func Xsqlite3_vtab_collation(tls *libc.TLS, pIdxInfo uintptr, iCons int32) uintptr { /* sqlite3.c:151558:23: */ var pHidden uintptr = (pIdxInfo + 1*96) var zRet uintptr = uintptr(0) if (iCons >= 0) && (iCons < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) { var pC uintptr = uintptr(0) var iTerm int32 = (*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12)).FiTermOffset - var pX uintptr = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer((*HiddenIndexInfo)(unsafe.Pointer(pHidden)).FpWC)).Fa + uintptr(iTerm)*64)).FpExpr + var pX uintptr = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer((*HiddenIndexInfo)(unsafe.Pointer(pHidden)).FpWC)).Fa + uintptr(iTerm)*56)).FpExpr if (*Expr)(unsafe.Pointer(pX)).FpLeft != 0 { pC = Xsqlite3ExprCompareCollSeq(tls, (*HiddenIndexInfo)(unsafe.Pointer(pHidden)).FpParse, pX) } @@ -130386,7 +132813,7 @@ func Xsqlite3_vtab_collation(tls *libc.TLS, pIdxInfo uintptr, iCons int32) uintp // 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 *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:148966:12: */ +func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:151598:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -130415,7 +132842,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus return SQLITE_NOMEM } (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0) - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_VIRTUALTABLE + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_VIRTUALTABLE) (*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(0) *(*U8)(unsafe.Pointer(pNew + 24 /* &.u */ /* &.vtab */ + 4 /* &.needFree */)) = U8(0) nConstraint = (*Sqlite3_index_info)(unsafe.Pointer(p)).FnConstraint @@ -130444,7 +132871,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus if *(*int32)(unsafe.Pointer(bp + 4 /* bIn */)) != 0 { rc = whereLoopAddVirtualOne(tls, - pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), WO_IN, p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) + pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), uint16(WO_IN), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) mBestNoIn = ((*WhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq) if mBestNoIn == uint64(0) { @@ -130460,7 +132887,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus var mNext Bitmask = libc.Uint64(libc.Uint64FromInt32(-1)) for i = 0; i < nConstraint; i++ { - var mThis Bitmask = ((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr((*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(p)).FaConstraint+uintptr(i)*12)).FiTermOffset)*64)).FprereqRight & ^mPrereq) + var mThis Bitmask = ((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr((*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(p)).FaConstraint+uintptr(i)*12)).FiTermOffset)*56)).FprereqRight & ^mPrereq) if (mThis > mPrev) && (mThis < mNext) { mNext = mThis } @@ -130501,7 +132928,7 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus if (rc == SQLITE_OK) && (seenZeroNoIN == 0) { rc = whereLoopAddVirtualOne(tls, - pBuilder, mPrereq, mPrereq, WO_IN, p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) + pBuilder, mPrereq, mPrereq, uint16(WO_IN), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */) } } @@ -130515,9 +132942,9 @@ func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnus // Add WhereLoop entries to handle OR terms. This works for either // btrees or virtual tables. -func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:149089:12: */ - bp := tls.Alloc(784) - defer tls.Free(784) +func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:151721:12: */ + bp := tls.Alloc(720) + defer tls.Free(720) var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo var pWC uintptr @@ -130526,9 +132953,9 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable var pWCEnd uintptr var rc int32 = SQLITE_OK var iCur int32 - // var tempWC WhereClause at bp+112, 552 + // var tempWC WhereClause at bp+112, 488 - // var sSubBuild WhereLoopBuilder at bp+664, 64 + // var sSubBuild WhereLoopBuilder at bp+600, 64 // var sSum WhereOrSet at bp, 56 @@ -130537,47 +132964,47 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable var pItem uintptr pWC = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC - pWCEnd = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*64) + pWCEnd = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*56) pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew libc.Xmemset(tls, bp /* &sSum */, 0, uint64(unsafe.Sizeof(WhereOrSet{}))) pItem = (((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*112) - iCur = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor + iCur = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor - for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; (pTerm < pWCEnd) && (rc == SQLITE_OK); pTerm += 64 { + for pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa; (pTerm < pWCEnd) && (rc == SQLITE_OK); pTerm += 56 { if ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & WO_OR) != 0) && - (((*WhereOrInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)))).Findexable & (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf) != uint64(0)) { - var pOrWC uintptr = (*(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)) /* &.wc */) - var pOrWCEnd uintptr = ((*WhereClause)(unsafe.Pointer(pOrWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pOrWC)).FnTerm)*64) + (((*WhereOrInfo)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTerm + 32 /* &.u */)))).Findexable & (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf) != uint64(0)) { + var pOrWC uintptr = (*(*uintptr)(unsafe.Pointer(pTerm + 32 /* &.u */)) /* &.wc */) + var pOrWCEnd uintptr = ((*WhereClause)(unsafe.Pointer(pOrWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pOrWC)).FnTerm)*56) var pOrTerm uintptr var once int32 = 1 var i int32 var j int32 - *(*WhereLoopBuilder)(unsafe.Pointer(bp + 664 /* sSubBuild */)) = *(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)) - (*WhereLoopBuilder)(unsafe.Pointer(bp + 664 /* &sSubBuild */)).FpOrderBy = uintptr(0) - (*WhereLoopBuilder)(unsafe.Pointer(bp + 664 /* &sSubBuild */)).FpOrSet = bp + 56 /* &sCur */ + *(*WhereLoopBuilder)(unsafe.Pointer(bp + 600 /* sSubBuild */)) = *(*WhereLoopBuilder)(unsafe.Pointer(pBuilder)) + (*WhereLoopBuilder)(unsafe.Pointer(bp + 600 /* &sSubBuild */)).FpOrderBy = uintptr(0) + (*WhereLoopBuilder)(unsafe.Pointer(bp + 600 /* &sSubBuild */)).FpOrSet = bp + 56 /* &sCur */ - for pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWC)).Fa; pOrTerm < pOrWCEnd; pOrTerm += 64 { + for pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWC)).Fa; pOrTerm < pOrWCEnd; pOrTerm += 56 { if (int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator) & WO_AND) != 0 { - (*WhereLoopBuilder)(unsafe.Pointer(bp + 664 /* &sSubBuild */)).FpWC = (*(*uintptr)(unsafe.Pointer(pOrTerm + 40 /* &.u */)) /* &.wc */) + (*WhereLoopBuilder)(unsafe.Pointer(bp + 600 /* &sSubBuild */)).FpWC = (*(*uintptr)(unsafe.Pointer(pOrTerm + 32 /* &.u */)) /* &.wc */) } else if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur { (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FpWInfo = (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FpOuter = pWC - (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).Fop = TK_AND + (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).Fop = U8(TK_AND) (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).FnTerm = 1 (*WhereClause)(unsafe.Pointer(bp + 112 /* &tempWC */)).Fa = pOrTerm - (*WhereLoopBuilder)(unsafe.Pointer(bp + 664 /* &sSubBuild */)).FpWC = bp + 112 /* &tempWC */ + (*WhereLoopBuilder)(unsafe.Pointer(bp + 600 /* &sSubBuild */)).FpWC = bp + 112 /* &tempWC */ } else { continue } (*WhereOrSet)(unsafe.Pointer(bp + 56 /* &sCur */)).Fn = U16(0) - if (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpTab)).FnModuleArg != 0 { - rc = whereLoopAddVirtual(tls, bp+664 /* &sSubBuild */, mPrereq, mUnusable) + if (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FnModuleArg != 0 { + rc = whereLoopAddVirtual(tls, bp+600 /* &sSubBuild */, mPrereq, mUnusable) } else { - rc = whereLoopAddBtree(tls, bp+664 /* &sSubBuild */, mPrereq) + rc = whereLoopAddBtree(tls, bp+600 /* &sSubBuild */, mPrereq) } if rc == SQLITE_OK { - rc = whereLoopAddOr(tls, bp+664 /* &sSubBuild */, mPrereq, mUnusable) + rc = whereLoopAddOr(tls, bp+600 /* &sSubBuild */, mPrereq, mUnusable) } if int32((*WhereOrSet)(unsafe.Pointer(bp+56 /* &sCur */)).Fn) == 0 { @@ -130587,22 +133014,22 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable whereOrMove(tls, bp /* &sSum */, bp+56 /* &sCur */) once = 0 } else { - // var sPrev WhereOrSet at bp+728, 56 + // var sPrev WhereOrSet at bp+664, 56 - whereOrMove(tls, bp+728 /* &sPrev */, bp /* &sSum */) + whereOrMove(tls, bp+664 /* &sPrev */, bp /* &sSum */) (*WhereOrSet)(unsafe.Pointer(bp /* &sSum */)).Fn = U16(0) - for i = 0; i < int32((*WhereOrSet)(unsafe.Pointer(bp+728 /* &sPrev */)).Fn); i++ { + for i = 0; i < int32((*WhereOrSet)(unsafe.Pointer(bp+664 /* &sPrev */)).Fn); i++ { for j = 0; j < int32((*WhereOrSet)(unsafe.Pointer(bp+56 /* &sCur */)).Fn); j++ { - whereOrInsert(tls, bp /* &sSum */, ((*WhereOrCost)(unsafe.Pointer((bp+728 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).Fprereq | (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).Fprereq), - Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+728 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FrRun, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FrRun), - Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+728 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FnOut, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FnOut)) + whereOrInsert(tls, bp /* &sSum */, ((*WhereOrCost)(unsafe.Pointer((bp+664 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).Fprereq | (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).Fprereq), + Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+664 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FrRun, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FrRun), + Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+664 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FnOut, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FnOut)) } } } } (*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm = U16(1) *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm)) = pTerm - (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = WHERE_MULTI_OR + (*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(WHERE_MULTI_OR) (*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0) (*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = U8(0) libc.Xmemset(tls, (pNew + 24 /* &.u */), 0, uint64(unsafe.Sizeof(struct { @@ -130639,7 +133066,7 @@ func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable } // Add all WhereLoop objects for all tables -func whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:149213:12: */ +func whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:151845:12: */ var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo var mPrereq Bitmask = uint64(0) var mPrior Bitmask = uint64(0) @@ -130654,7 +133081,7 @@ func whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:14921 // Loop over the tables in the join, from left to right pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew whereLoopInit(tls, pNew) - (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FiPlanLimit = SQLITE_QUERY_PLANNER_LIMIT + (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FiPlanLimit = uint32(SQLITE_QUERY_PLANNER_LIMIT) iTab = 0 pItem = pTabList + 8 /* &.a */ __1: @@ -130664,20 +133091,20 @@ __1: { var mUnusable Bitmask = uint64(0) (*WhereLoop)(unsafe.Pointer(pNew)).FiTab = U8(iTab) - *(*uint32)(unsafe.Pointer(pBuilder + 56 /* &.iPlanLimit */)) += (SQLITE_QUERY_PLANNER_LIMIT_INCR) - (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf = Xsqlite3WhereGetMask(tls, (pWInfo + 656 /* &.sMaskSet */), (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor) - if (int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0 { + *(*uint32)(unsafe.Pointer(pBuilder + 56 /* &.iPlanLimit */)) += (uint32(SQLITE_QUERY_PLANNER_LIMIT_INCR)) + (*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf = Xsqlite3WhereGetMask(tls, (pWInfo + 592 /* &.sMaskSet */), (*SrcItem)(unsafe.Pointer(pItem)).FiCursor) + if (int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0 { // This condition is true when pItem is the FROM clause term on the // right-hand-side of a LEFT or CROSS JOIN. mPrereq = mPrior } else { mPrereq = uint64(0) } - if (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpTab)).FnModuleArg != 0 { + if (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pItem)).FpTab)).FnModuleArg != 0 { var p uintptr for p = (pItem + 1*112); p < pEnd; p += 112 { - if (mUnusable != 0) || ((int32((*SrcList_item)(unsafe.Pointer(p)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0) { - mUnusable = mUnusable | (Xsqlite3WhereGetMask(tls, (pWInfo + 656 /* &.sMaskSet */), (*SrcList_item)(unsafe.Pointer(p)).FiCursor)) + if (mUnusable != 0) || ((int32((*SrcItem)(unsafe.Pointer(p)).Ffg.Fjointype) & (JT_LEFT | JT_CROSS)) != 0) { + mUnusable = mUnusable | (Xsqlite3WhereGetMask(tls, (pWInfo + 592 /* &.sMaskSet */), (*SrcItem)(unsafe.Pointer(p)).FiCursor)) } } rc = whereLoopAddVirtual(tls, pBuilder, mPrereq, mUnusable) @@ -130691,7 +133118,7 @@ __1: if (rc != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { if rc == SQLITE_DONE { // We hit the query planner search limit set by iPlanLimit - Xsqlite3_log(tls, SQLITE_WARNING, ts+23634 /* "abbreviated quer..." */, 0) + Xsqlite3_log(tls, SQLITE_WARNING, ts+24092 /* "abbreviated quer..." */, 0) rc = SQLITE_OK } else { goto __3 @@ -130727,7 +133154,7 @@ __3: // 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 *libc.TLS, pWInfo uintptr, pOrderBy uintptr, pPath uintptr, wctrlFlags U16, nLoop U16, pLast uintptr, pRevMask uintptr) I8 { /* sqlite3.c:149291:11: */ +func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, pPath uintptr, wctrlFlags U16, nLoop U16, pLast uintptr, pRevMask uintptr) I8 { /* sqlite3.c:151923:11: */ var revSet U8 // True if rev is known var rev U8 // Composite sort order var revIdx U8 // Index sort order @@ -130774,7 +133201,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, // rowid appears in the ORDER BY clause, the corresponding WhereLoop is // automatically order-distinct. - if (nLoop != 0) && ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_OrderByIdxJoin)) != 0) { + if (nLoop != 0) && (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_OrderByIdxJoin))) != U32(0)) { return int8(0) } @@ -130803,7 +133230,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } else { pLoop = pLast } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != 0 { if (*(*I8)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.vtab */) + 5 /* &.isOrdered */)) != 0) && ((int32(wctrlFlags) & WHERE_DISTINCTBY) == 0) { obSat = obDone } @@ -130811,7 +133238,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } else if (int32(wctrlFlags) & WHERE_DISTINCTBY) != 0 { *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 6 /* &.nDistinctCol */)) = U16(0) } - iCur = (*SrcList_item)(unsafe.Pointer(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*112)).FiCursor + iCur = (*SrcItem)(unsafe.Pointer(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*112)).FiCursor // Mark off any ORDER BY term X that is a column in the table of // the current loop for which there is term in the WHERE @@ -130822,6 +133249,9 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, continue } pOBExpr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*32)).FpExpr) + if pOBExpr == uintptr(0) { + continue + } if int32((*Expr)(unsafe.Pointer(pOBExpr)).Fop) != TK_COLUMN { continue } @@ -130857,8 +133287,8 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, obSat = obSat | (Bitmask((uint64(1))) << (i)) } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_ONEROW) == U32(0) { - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IPK) != 0 { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) == U32(0) { + if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IPK)) != 0 { pIndex = uintptr(0) nKeyCol = U16(0) nColumn = U16(1) @@ -130869,7 +133299,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, nColumn = (*Index)(unsafe.Pointer(pIndex)).FnColumn isOrderDistinct = (U8(libc.Bool32((int32((*Index)(unsafe.Pointer((pIndex))).FonError) != OE_None) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_SKIPSCAN) == U32(0))))) + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_SKIPSCAN)) == U32(0))))) } // Loop through all columns of the index and deal with the ones @@ -130946,6 +133376,9 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } pOBExpr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*32)).FpExpr) + if pOBExpr == uintptr(0) { + continue + } if (int32(wctrlFlags) & (WHERE_GROUPBY | WHERE_DISTINCTBY)) == 0 { bOnce = U8(0) } @@ -130994,7 +133427,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } if (isMatch != 0) && ((int32((*ExprList_item)(unsafe.Pointer((pOrderBy+8 /* &.a */)+uintptr(i)*32)).FsortFlags) & KEYINFO_ORDER_BIGNULL) != 0) { if j == int32(*(*U16)(unsafe.Pointer((pLoop + 24 /* &.u */ /* &.btree */) /* &.nEq */))) { - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_BIGNULL_SORT) + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_BIGNULL_SORT)) } else { isMatch = U8(0) } @@ -131030,7 +133463,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, continue } p = (*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(i)*32)).FpExpr - mTerm = Xsqlite3WhereExprUsage(tls, (pWInfo + 656 /* &.sMaskSet */), p) + mTerm = Xsqlite3WhereExprUsage(tls, (pWInfo + 592 /* &.sMaskSet */), p) if (mTerm == uint64(0)) && !(Xsqlite3ExprIsConstant(tls, p) != 0) { continue } @@ -131076,7 +133509,7 @@ func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, // // 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 Xsqlite3WhereIsSorted(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:149626:20: */ +func Xsqlite3WhereIsSorted(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:152260:20: */ return (int32(*(*uint8)(unsafe.Pointer(pWInfo + 68 /* &.sorted */)) & 0x8 >> 3)) } @@ -131084,7 +133517,7 @@ func Xsqlite3WhereIsSorted(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:1 // 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 *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32, nSorted int32) LogEst { /* sqlite3.c:149649:15: */ +func whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32, nSorted int32) LogEst { /* sqlite3.c:152283:15: */ // TUNING: Estimated cost of a full external sort, where N is // the number of rows to sort is: // @@ -131105,9 +133538,17 @@ func whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32 rSortCost = (LogEst((int32(nRow) + int32(rScale)) + 16)) // Multiple by log(M) where M is the number of output rows. - // Use the LIMIT for M if it is smaller + // Use the LIMIT for M if it is smaller. Or if this sort is for + // a DISTINCT operator, M will be the number of distinct output + // rows, so fudge it downwards a bit. if ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_USE_LIMIT) != 0) && (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FiLimit) < int32(nRow)) { nRow = (*WhereInfo)(unsafe.Pointer(pWInfo)).FiLimit + } else if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_WANT_DISTINCT) != 0 { + // TUNING: In the sort for a DISTINCT operator, assume that the DISTINCT + // reduces the number of output rows by a factor of 2 + if int32(nRow) > 10 { + nRow = int16(int32(nRow) - (10)) + } } rSortCost = LogEst(int32(rSortCost) + (int32(estLog(tls, nRow)))) return rSortCost @@ -131123,7 +133564,7 @@ func whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32 // // Return SQLITE_OK on success or SQLITE_NOMEM of a memory allocation // error occurs. -func wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst LogEst) int32 { /* sqlite3.c:149694:12: */ +func wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst LogEst) int32 { /* sqlite3.c:152336:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -131273,7 +133714,7 @@ __3: if ((*WhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf & (*WherePath)(unsafe.Pointer(pFrom)).FmaskLoop) != uint64(0) { continue } - if (((*WhereLoop)(unsafe.Pointer(pWLoop)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) && (int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) < 3) { + if (((*WhereLoop)(unsafe.Pointer(pWLoop)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) && (int32((*WherePath)(unsafe.Pointer(pFrom)).FnRow) < 3) { // Do not use an automatic index if the this loop is expected // to run less than 1.25 times. It is tempting to also exclude // automatic index usage on an outer loop, but sometimes an automatic @@ -131438,7 +133879,7 @@ __3: } if nFrom == 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+23669 /* "no query solutio..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+24127 /* "no query solutio..." */, 0) Xsqlite3DbFreeNN(tls, db, pSpace) return SQLITE_ERROR } @@ -131453,10 +133894,10 @@ __3: // Load the lowest cost path into pWInfo for iLoop = 0; iLoop < nLoop; iLoop++ { - var pLevel uintptr = ((pWInfo + 920 /* &.a */) + uintptr(iLoop)*88) + var pLevel uintptr = ((pWInfo + 856 /* &.a */) + uintptr(iLoop)*88) (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop = libc.AssignUintptr(&pWLoop, *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(iLoop)*8))) (*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom = (*WhereLoop)(unsafe.Pointer(pWLoop)).FiTab - (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur = (*SrcList_item)(unsafe.Pointer(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112)).FiCursor + (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur = (*SrcItem)(unsafe.Pointer(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112)).FiCursor } if ((((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_WANT_DISTINCT) != 0) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DISTINCTBY) == 0)) && @@ -131465,16 +133906,16 @@ __3: // var notUsed Bitmask at bp+8, 8 var rc int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet, pFrom, - WHERE_DISTINCTBY, (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+8 /* ¬Used */)) + uint16(WHERE_DISTINCTBY), (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+8 /* ¬Used */)) if rc == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet)).FnExpr { - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_ORDERED + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_ORDERED) } } libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bOrderedInnerLoop */, uint32(0), 2, 0x4) if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 { if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_DISTINCTBY) != 0 { if int32((*WherePath)(unsafe.Pointer(pFrom)).FisOrdered) == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr { - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_ORDERED + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_ORDERED) } } else { (*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = (*WherePath)(unsafe.Pointer(pFrom)).FisOrdered @@ -131483,11 +133924,11 @@ __3: (*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = int8(0) if nLoop > 0 { var wsFlags U32 = (*WhereLoop)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)))).FwsFlags - if ((wsFlags & WHERE_ONEROW) == U32(0)) && + if ((wsFlags & U32(WHERE_ONEROW)) == U32(0)) && ((wsFlags & (U32(WHERE_IPK | WHERE_COLUMN_IN))) != (U32(WHERE_IPK | WHERE_COLUMN_IN))) { *(*Bitmask)(unsafe.Pointer(bp + 16 /* m */)) = uint64(0) var rc int32 = int32(wherePathSatisfiesOrderBy(tls, pWInfo, (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy, pFrom, - WHERE_ORDERBY_LIMIT, (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+16 /* &m */)) + uint16(WHERE_ORDERBY_LIMIT), (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+16 /* &m */)) if rc == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr { libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bOrderedInnerLoop */, uint32(1), 2, 0x4) @@ -131530,7 +133971,7 @@ __3: // 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 *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086:12: */ +func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:152728:12: */ var pWInfo uintptr var pItem uintptr var pWC uintptr @@ -131547,14 +133988,14 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: } pItem = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */ - pTab = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab + pTab = (*SrcItem)(unsafe.Pointer(pItem)).FpTab if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 { return 0 } if (uint32(int32(*(*uint8)(unsafe.Pointer(pItem + 60 /* &.fg */ + 4 /* &.isIndexedBy */)) & 0x2 >> 1))) != 0 { return 0 } - iCur = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor + iCur = (*SrcItem)(unsafe.Pointer(pItem)).FiCursor pWC = (pWInfo + 104 /* &.sWC */) pLoop = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = U32(0) @@ -131594,8 +134035,8 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: continue } (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = (U32((WHERE_COLUMN_EQ | WHERE_ONEROW) | WHERE_INDEXED)) - if ((uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100 /* &.isCovering */)) & 0x20 >> 5))) != 0) || (((*SrcList_item)(unsafe.Pointer(pItem)).FcolUsed & (*Index)(unsafe.Pointer(pIdx)).FcolNotIdxed) == uint64(0)) { - *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (WHERE_IDX_ONLY) + if ((uint32(int32(*(*uint16)(unsafe.Pointer(pIdx + 100 /* &.isCovering */)) & 0x20 >> 5))) != 0) || (((*SrcItem)(unsafe.Pointer(pItem)).FcolUsed & (*Index)(unsafe.Pointer(pIdx)).FcolNotIdxed) == uint64(0)) { + *(*U32)(unsafe.Pointer(pLoop + 40 /* &.wsFlags */)) |= (U32(WHERE_IDX_ONLY)) } (*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = U16(j) *(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ /* &.nEq */)) = U16(j) @@ -131607,16 +134048,16 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: } if (*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags != 0 { (*WhereLoop)(unsafe.Pointer(pLoop)).FnOut = int16(1) - (*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */))).FpWLoop = pLoop + (*WhereLevel)(unsafe.Pointer((pWInfo + 856 /* &.a */))).FpWLoop = pLoop (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf = uint64(1) // sqlite3WhereGetMask(&pWInfo->sMaskSet, iCur); - (*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */))).FiTabCur = iCur + (*WhereLevel)(unsafe.Pointer((pWInfo + 856 /* &.a */))).FiTabCur = iCur (*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut = int16(1) if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 { (*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = I8((*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr) } if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_WANT_DISTINCT) != 0 { - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_UNIQUE + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE) } return 1 } @@ -131624,8 +134065,8 @@ func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086: } // Helper function for exprIsDeterministic(). -func exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:150168:12: */ - if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && ((libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_ConstFunc)) != U32(0))) == 0) { +func exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:152810:12: */ + if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_FUNCTION) && ((libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_ConstFunc))) != U32(0))) == 0) { (*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0) return WRC_Abort } @@ -131635,7 +134076,7 @@ func exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int3 // Return true if the expression contains no non-deterministic SQL // functions. Do not consider non-deterministic SQL functions that are // part of sub-select statements. -func exprIsDeterministic(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:150181:12: */ +func exprIsDeterministic(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:152823:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -131739,7 +134180,7 @@ func exprIsDeterministic(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:150181:1 // 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 Xsqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pResultSet uintptr, wctrlFlags U16, iAuxArg int32) uintptr { /* sqlite3.c:150301:26: */ +func Xsqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pResultSet uintptr, wctrlFlags U16, iAuxArg int32) uintptr { /* sqlite3.c:152943:26: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -131806,7 +134247,7 @@ __1: // Disable the DISTINCT optimization if SQLITE_DistinctOpt is set via // sqlite3_test_ctrl(SQLITE_TESTCTRL_OPTIMIZATIONS,...) - if !((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_DistinctOpt)) != 0) { + if !(((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_DistinctOpt))) != U32(0)) { goto __2 } wctrlFlags = libc.Uint16FromInt32(int32(wctrlFlags) & (libc.CplInt32(WHERE_WANT_DISTINCT))) @@ -131819,7 +134260,7 @@ __2: if !((*SrcList)(unsafe.Pointer(pTabList)).FnSrc > (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8)))) { goto __3 } - Xsqlite3ErrorMsg(tls, pParse, ts+23687 /* "at most %d table..." */, libc.VaList(bp, (int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))))) + Xsqlite3ErrorMsg(tls, pParse, ts+24145 /* "at most %d table..." */, libc.VaList(bp, (int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8))))) return uintptr(0) __3: ; @@ -131863,9 +134304,9 @@ __4: (*WhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop = int32((*Parse)(unsafe.Pointer(pParse)).FnQueryLoop) libc.Xmemset(tls, (pWInfo + 65 /* &.nOBSat */), 0, ((uint64((uintptr(0) + 104 /* &.sWC */))) - (uint64((uintptr(0) + 65 /* &.nOBSat */))))) - libc.Xmemset(tls, (pWInfo + 920 /* &.a */), 0, (uint64(unsafe.Sizeof(WhereLoop{})) + (uint64(nTabList) * uint64(unsafe.Sizeof(WhereLevel{}))))) + libc.Xmemset(tls, (pWInfo + 856 /* &.a */), 0, (uint64(unsafe.Sizeof(WhereLoop{})) + (uint64(nTabList) * uint64(unsafe.Sizeof(WhereLevel{}))))) // ONEPASS defaults to OFF - pMaskSet = (pWInfo + 656 /* &.sMaskSet */) + pMaskSet = (pWInfo + 592 /* &.sMaskSet */) (*WhereLoopBuilder)(unsafe.Pointer(bp + 16 /* &sWLB */)).FpWInfo = pWInfo (*WhereLoopBuilder)(unsafe.Pointer(bp + 16 /* &sWLB */)).FpWC = (pWInfo + 104 /* &.sWC */) (*WhereLoopBuilder)(unsafe.Pointer(bp + 16 /* &sWLB */)).FpNew = ((pWInfo) + uintptr(nByteWInfo)) @@ -131876,7 +134317,7 @@ __4: // subexpression is separated by an AND operator. (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn = 0 Xsqlite3WhereClauseInit(tls, (pWInfo + 104 /* &.sWC */), pWInfo) - Xsqlite3WhereSplit(tls, (pWInfo + 104 /* &.sWC */), pWhere, TK_AND) + Xsqlite3WhereSplit(tls, (pWInfo + 104 /* &.sWC */), pWhere, uint8(TK_AND)) // Special case: No FROM clause if !(nTabList == 0) { @@ -131891,10 +134332,10 @@ __7: if !((int32(wctrlFlags) & WHERE_WANT_DISTINCT) != 0) { goto __8 } - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_UNIQUE + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE) __8: ; - Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+23715 /* "SCAN CONSTANT RO..." */, 0) + Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+24173 /* "SCAN CONSTANT RO..." */, 0) goto __6 __5: // Assign a bit from the bitmask to every term in the FROM clause. @@ -131912,7 +134353,7 @@ __5: // WHERE_OR_SUBCLAUSE flag is set. ii = 0 __9: - createMask(tls, pMaskSet, (*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(ii)*112)).FiCursor) + createMask(tls, pMaskSet, (*SrcItem)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(ii)*112)).FiCursor) Xsqlite3WhereTabFuncArgs(tls, pParse, ((pTabList + 8 /* &.a */) + uintptr(ii)*112), (pWInfo + 104 /* &.sWC */)) goto __10 __10: @@ -131949,7 +134390,7 @@ __13: if !(ii < (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpWC)).FnTerm) { goto __15 } - pT = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpWC)).Fa + uintptr(ii)*64) + pT = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpWC)).Fa + uintptr(ii)*56) if !((int32((*WhereTerm)(unsafe.Pointer(pT)).FwtFlags) & TERM_VIRTUAL) != 0) { goto __16 } @@ -131978,7 +134419,7 @@ __15: goto __19 } // The DISTINCT marking is pointless. Ignore it. - (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = WHERE_DISTINCT_UNIQUE + (*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(WHERE_DISTINCT_UNIQUE) goto __20 __19: if !(pOrderBy == uintptr(0)) { @@ -132057,7 +134498,7 @@ __29: ; __22: ; - if !(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0)) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & SQLITE_ReverseOrder) != uint64(0))) { + if !(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0)) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(SQLITE_ReverseOrder)) != uint64(0))) { goto __31 } (*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = libc.Uint64(libc.Uint64FromInt32(-1)) @@ -132101,7 +134542,7 @@ __32: notReady = libc.CplUint64(uint64(0)) if !(((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= 2) && (pResultSet != uintptr(0))) && // guarantees condition (1) above - ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (SQLITE_OmitNoopJoin)) == 0)) { + (((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags & (U32(SQLITE_OmitNoopJoin))) == U32(0))) { goto __33 } tabUsed = Xsqlite3WhereExprListUsage(tls, pMaskSet, pResultSet) @@ -132116,16 +134557,16 @@ __35: if !(i >= 1) { goto __37 } - pLoop = (*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */) + uintptr(i)*88)).FpWLoop + pLoop = (*WhereLevel)(unsafe.Pointer((pWInfo + 856 /* &.a */) + uintptr(i)*88)).FpWLoop pItem = (((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*112) - if !((int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) == 0) { + if !((int32((*SrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype) & JT_LEFT) == 0) { goto __38 } goto __36 __38: ; if !(((int32(wctrlFlags) & WHERE_WANT_DISTINCT) == 0) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_ONEROW) == U32(0))) { + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_ONEROW)) == U32(0))) { goto __39 } goto __36 @@ -132137,7 +134578,7 @@ __39: goto __36 __40: ; - pEnd = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpWC)).FnTerm)*64) + pEnd = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpWC)).FnTerm)*56) pTerm = (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp + 16 /* &sWLB */)).FpWC)).Fa __41: if !(pTerm < pEnd) { @@ -132146,8 +134587,8 @@ __41: if !(((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf) != uint64(0)) { goto __44 } - if !(!(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (EP_FromJoin)) != U32(0)) || - (int32((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiRightJoinTable) != (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor)) { + if !(!(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(EP_FromJoin))) != U32(0)) || + ((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiRightJoinTable != (*SrcItem)(unsafe.Pointer(pItem)).FiCursor)) { goto __45 } goto __43 @@ -132157,7 +134598,7 @@ __44: ; goto __42 __42: - pTerm += 64 + pTerm += 56 goto __41 goto __43 __43: @@ -132183,7 +134624,7 @@ __50: ; goto __48 __48: - pTerm += 64 + pTerm += 56 goto __47 goto __49 __49: @@ -132192,7 +134633,7 @@ __49: goto __51 } nByte = (int32((uint64((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1) - i)) * uint64(unsafe.Sizeof(WhereLevel{})))) - libc.Xmemmove(tls, ((pWInfo + 920 /* &.a */) + uintptr(i)*88), ((pWInfo + 920 /* &.a */) + uintptr((i+1))*88), uint64(nByte)) + libc.Xmemmove(tls, ((pWInfo + 856 /* &.a */) + uintptr(i)*88), ((pWInfo + 856 /* &.a */) + uintptr((i+1))*88), uint64(nByte)) __51: ; (*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel-- @@ -132206,7 +134647,7 @@ __37: ; __33: ; - *(*U32)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 196 /* &.nQueryLoop */)) += (U32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) + *(*U32)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 192 /* &.nQueryLoop */)) += (U32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) // If the caller is an UPDATE or DELETE statement that is requesting // to use a one-pass algorithm, determine if this is appropriate. @@ -132230,30 +134671,30 @@ __33: if !((int32(wctrlFlags) & WHERE_ONEPASS_DESIRED) != 0) { goto __52 } - wsFlags = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */))).FpWLoop)).FwsFlags) + wsFlags = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 856 /* &.a */))).FpWLoop)).FwsFlags) bOnerow = (libc.Bool32((wsFlags & WHERE_ONEROW) != 0)) if !((bOnerow != 0) || (((0 != (int32(wctrlFlags) & WHERE_ONEPASS_MULTIROW)) && - !((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab)).FnModuleArg != 0)) && + !((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab)).FnModuleArg != 0)) && ((0 == (wsFlags & WHERE_MULTI_OR)) || ((int32(wctrlFlags) & WHERE_DUPLICATES_OK) != 0)))) { goto __53 } (*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass = func() uint8 { if bOnerow != 0 { - return ONEPASS_SINGLE + return uint8(ONEPASS_SINGLE) } - return ONEPASS_MULTI + return uint8(ONEPASS_MULTI) }() - if !((((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((wsFlags & WHERE_IDX_ONLY) != 0)) { + if !((((*Table)(unsafe.Pointer(((*SrcItem)(unsafe.Pointer((pTabList + 8 /* &.a */))).FpTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((wsFlags & WHERE_IDX_ONLY) != 0)) { goto __54 } if !((int32(wctrlFlags) & WHERE_ONEPASS_MULTIROW) != 0) { goto __55 } - bFordelete = OPFLAG_FORDELETE + bFordelete = U8(OPFLAG_FORDELETE) __55: ; - (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */))).FpWLoop)).FwsFlags = (U32(wsFlags & libc.CplInt32(WHERE_IDX_ONLY))) + (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 856 /* &.a */))).FpWLoop)).FwsFlags = (U32(wsFlags & libc.CplInt32(WHERE_IDX_ONLY))) __54: ; __53: @@ -132264,27 +134705,27 @@ __52: // Open all tables in the pTabList and any indices selected for // searching those tables. ii = 0 - pLevel = pWInfo + 920 /* &.a */ + pLevel = pWInfo + 856 /* &.a */ __56: if !(ii < nTabList) { goto __58 } pTabItem = ((pTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112) - pTab = (*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab + pTab = (*SrcItem)(unsafe.Pointer(pTabItem)).FpTab iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema) pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop - if !((((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Ephemeral) != U32(0)) || ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) { + if !((((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Ephemeral)) != U32(0)) || ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) { goto __59 } // Do nothing goto __60 __59: - if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) != U32(0)) { + if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) != U32(0)) { goto __61 } pVTab = Xsqlite3GetVTable(tls, db, pTab) - iCur = (*SrcList_item)(unsafe.Pointer(pTabItem)).FiCursor + iCur = (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor Xsqlite3VdbeAddOp4(tls, v, OP_VOpen, iCur, 0, 0, pVTab, -12) goto __62 __61: @@ -132294,7 +134735,7 @@ __61: // noop goto __64 __63: - if !((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IDX_ONLY) == U32(0)) && + if !((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IDX_ONLY)) == U32(0)) && ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) == 0)) { goto __65 } @@ -132303,11 +134744,11 @@ __63: goto __67 } op = OP_OpenWrite - *(*int32)(unsafe.Pointer((pWInfo + 40 /* &.aiCurOnePass */))) = (*SrcList_item)(unsafe.Pointer(pTabItem)).FiCursor + *(*int32)(unsafe.Pointer((pWInfo + 40 /* &.aiCurOnePass */))) = (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor __67: ; - Xsqlite3OpenTable(tls, pParse, (*SrcList_item)(unsafe.Pointer(pTabItem)).FiCursor, iDb, pTab, op) + Xsqlite3OpenTable(tls, pParse, (*SrcItem)(unsafe.Pointer(pTabItem)).FiCursor, iDb, pTab, op) if !(((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF) && (int32((*Table)(unsafe.Pointer(pTab)).FnCol) < (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))))) && @@ -132317,7 +134758,7 @@ __67: // If we know that only a prefix of the record will be used, // it is advantageous to reduce the "column count" field in // the P4 operand of the OP_OpenRead/Write opcode. - b = (*SrcList_item)(unsafe.Pointer(pTabItem)).FcolUsed + b = (*SrcItem)(unsafe.Pointer(pTabItem)).FcolUsed n = 0 __69: if !(b != 0) { @@ -132349,14 +134790,14 @@ __62: ; __60: ; - if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_INDEXED) != 0) { + if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != 0) { goto __72 } pIx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) op1 = OP_OpenRead // iAuxArg is always set to a positive value if ONEPASS is possible - if !((!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) && + if !((!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && ((int32(*(*uint16)(unsafe.Pointer((pIx) + 100 /* &.idxType */)) & 0x3 >> 0)) == SQLITE_IDXTYPE_PRIMARYKEY)) && ((int32(wctrlFlags) & WHERE_OR_SUBCLAUSE) != 0)) { goto __73 } @@ -132369,7 +134810,7 @@ __73: if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) != ONEPASS_OFF) { goto __75 } - pJ = (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab)).FpIndex + pJ = (*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(pTabItem)).FpTab)).FpIndex iIndexCur = iAuxArg __77: @@ -132406,14 +134847,15 @@ __74: } Xsqlite3VdbeAddOp3(tls, v, op1, iIndexCur, int32((*Index)(unsafe.Pointer(pIx)).Ftnum), iDb) Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIx) - if !(((((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_CONSTRAINT) != U32(0)) && + if !((((((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_CONSTRAINT)) != U32(0)) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_COLUMN_RANGE | WHERE_SKIPSCAN))) == U32(0))) && - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_BIGNULL_SORT) == U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_BIGNULL_SORT)) == U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_SEEKSCAN)) == U32(0))) && ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & WHERE_ORDERBY_MIN) == 0)) && (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) != WHERE_DISTINCT_ORDERED)) { goto __82 } - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_SEEKEQ) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SEEKEQ)) __82: ; Xsqlite3VdbeComment(tls, v, ts+824 /* "%s" */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIx)).FzName)) @@ -132451,9 +134893,9 @@ __85: if !(ii < nTabList) { goto __87 } - pLevel = ((pWInfo + 920 /* &.a */) + uintptr(ii)*88) + pLevel = ((pWInfo + 856 /* &.a */) + uintptr(ii)*88) wsFlags1 = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) - if !(((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & WHERE_AUTO_INDEX) != U32(0)) { + if !(((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & U32(WHERE_AUTO_INDEX)) != U32(0)) { goto __88 } constructAutomaticIndex(tls, pParse, (pWInfo + 104 /* &.sWC */), @@ -132487,6 +134929,7 @@ __87: // Done. + (*WhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere = Xsqlite3VdbeCurrentAddr(tls, v) return pWInfo // Jump here if malloc fails @@ -132508,7 +134951,7 @@ __91: // Generate the end of the WHERE loop. See comments on // sqlite3WhereBegin() for additional information. -func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: */ +func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:153539:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -132519,12 +134962,13 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * var pLoop uintptr var pTabList uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb + var iEnd int32 = Xsqlite3VdbeCurrentAddr(tls, v) // Generate loop termination code. for i = (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1); i >= 0; i-- { var addr int32 - pLevel = ((pWInfo + 920 /* &.a */) + uintptr(i)*88) + pLevel = ((pWInfo + 856 /* &.a */) + uintptr(i)*88) pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if int32((*WhereLevel)(unsafe.Pointer(pLevel)).Fop) != OP_Noop { var addrSeek int32 = 0 @@ -132532,7 +134976,7 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * var n int32 if (((((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == WHERE_DISTINCT_ORDERED) && (i == (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1))) && // Ticket [ef9318757b152e3] 2017-10-21 - (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_INDEXED) != U32(0))) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_INDEXED)) != U32(0))) && ((uint32(int32(*(*uint16)(unsafe.Pointer((libc.AssignUintptr(&pIdx, *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))) + 100 /* &.hasStat1 */)) & 0x80 >> 7))) != 0)) && ((libc.AssignInt32(&n, int32(*(*U16)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 6 /* &.nDistinctCol */))))) > 0)) && (int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst + uintptr(n)*2))) >= 36) { @@ -132568,7 +135012,7 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * } else { Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont) } - if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_IN_ABLE) != 0) && (*(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) > 0) { + if (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_ABLE)) != 0) && (*(*int32)(unsafe.Pointer((pLevel + 56 /* &.u */ /* &.in */) /* &.nIn */)) > 0) { var pIn uintptr var j int32 Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt) @@ -132582,7 +135026,8 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * Xsqlite3VdbeJumpHere(tls, v, ((*InLoop)(unsafe.Pointer(pIn)).FaddrInTop + 1)) if int32((*InLoop)(unsafe.Pointer(pIn)).FeEndLoopOp) != OP_Noop { if (*InLoop)(unsafe.Pointer(pIn)).FnPrefix != 0 { - + var bEarlyOut int32 = (libc.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_VIRTUALTABLE)) == U32(0)) && + (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_IN_EARLYOUT)) != U32(0)))) if (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin != 0 { // For LEFT JOIN queries, cursor pIn->iCur may not have been // opened yet. This occurs for WHERE clauses such as @@ -132593,10 +135038,10 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * // jump over the OP_Next or OP_Prev instruction about to // be coded. Xsqlite3VdbeAddOp2(tls, v, OP_IfNotOpen, (*InLoop)(unsafe.Pointer(pIn)).FiCur, - ((Xsqlite3VdbeCurrentAddr(tls, v) + 2) + (libc.Bool32(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0))))) + ((Xsqlite3VdbeCurrentAddr(tls, v) + 2) + bEarlyOut)) } - if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_VIRTUALTABLE) == U32(0) { + if bEarlyOut != 0 { Xsqlite3VdbeAddOp4Int(tls, v, OP_IfNoHope, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, (Xsqlite3VdbeCurrentAddr(tls, v) + 2), (*InLoop)(unsafe.Pointer(pIn)).FiBase, (*InLoop)(unsafe.Pointer(pIn)).FnPrefix) @@ -132620,7 +135065,7 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk) if (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip != 0 { Xsqlite3VdbeGoto(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip) - Xsqlite3VdbeComment(tls, v, ts+23733 /* "next skip-scan o..." */, libc.VaList(bp, (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))).FzName)) + Xsqlite3VdbeComment(tls, v, ts+24191 /* "next skip-scan o..." */, libc.VaList(bp, (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)))).FzName)) Xsqlite3VdbeJumpHere(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip) Xsqlite3VdbeJumpHere(tls, v, ((*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip - 2)) } @@ -132651,7 +135096,7 @@ func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: * Xsqlite3VdbeResolveLabel(tls, v, (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak) i = 0 - pLevel = pWInfo + 920 /* &.a */ + pLevel = pWInfo + 856 /* &.a */ __4: if !(i < int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)) { goto __6 @@ -132660,9 +135105,10 @@ __4: var k int32 var last int32 var pOp uintptr + var pLastOp uintptr var pIdx uintptr = uintptr(0) var pTabItem uintptr = ((pTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112) - var pTab uintptr = (*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab + var pTab uintptr = (*SrcItem)(unsafe.Pointer(pTabItem)).FpTab pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -132672,7 +135118,7 @@ __4: if (uint32(int32(*(*uint8)(unsafe.Pointer(pTabItem + 60 /* &.fg */ + 4 /* &.viaCoroutine */)) & 0x10 >> 4))) != 0 { translateColumnToCopy(tls, pParse, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, - (*SrcList_item)(unsafe.Pointer(pTabItem)).FregResult, 0) + (*SrcItem)(unsafe.Pointer(pTabItem)).FregResult, 0) goto __5 } @@ -132688,28 +135134,28 @@ __4: // reference the index. if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(WHERE_INDEXED | WHERE_IDX_ONLY))) != 0 { pIdx = *(*uintptr)(unsafe.Pointer(pLoop + 24 /* &.u */ /* &.btree */ + 8 /* &.pIndex */)) - } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & WHERE_MULTI_OR) != 0 { + } else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(WHERE_MULTI_OR)) != 0 { pIdx = *(*uintptr)(unsafe.Pointer(pLevel + 56 /* &.u */)) } - if ((pIdx != 0) && - ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF) || !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & TF_WithoutRowid) == U32(0)))) && + if (pIdx != 0) && !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) { - last = Xsqlite3VdbeCurrentAddr(tls, v) - k = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody - pOp = Xsqlite3VdbeGetOp(tls, v, k) - __7: - if !(k < last) { - goto __9 + if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == ONEPASS_OFF) || !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { + last = iEnd + } else { + last = (*WhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - { + k = ((*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBody + 1) + pOp = Xsqlite3VdbeGetOp(tls, v, k) + pLastOp = (pOp + uintptr((last-k))*32) + + for ok := true; ok; ok = ((libc.PreIncUintptr(&pOp, 32)) < pLastOp) { if (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 != (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur { - goto __8 - } - if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column) || + // no-op + } else if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Column) || (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Offset) { var x int32 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp2 - if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) { + if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) { var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, pTab) x = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(x)*2))) @@ -132726,21 +135172,13 @@ __4: } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_Rowid { (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur - (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = OP_IdxRowid + (*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(OP_IdxRowid) } else if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == OP_IfNullRow { (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur } - } - goto __8 - __8: - k++ - pOp += 32 - goto __7 - goto __9 - __9: } } @@ -132907,7 +135345,7 @@ __6: // window frame has been coerced to: // // ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW -func row_numberStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151312:13: */ +func row_numberStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:153971:13: */ var p uintptr = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(I64(0)))) if p != 0 { (*(*I64)(unsafe.Pointer(p)))++ @@ -132916,7 +135354,7 @@ func row_numberStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = apArg } -func row_numberValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151322:13: */ +func row_numberValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:153981:13: */ var p uintptr = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(I64(0)))) Xsqlite3_result_int64(tls, pCtx, func() int64 { if p != 0 { @@ -132932,13 +135370,13 @@ type CallCount = struct { FnValue I64 FnStep I64 FnTotal I64 -} /* sqlite3.c:151331:1 */ +} /* sqlite3.c:153990:1 */ // Implementation of built-in window function dense_rank(). Assumes that // the window frame has been set to: // // RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW -func dense_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151343:13: */ +func dense_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154002:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{}))) if p != 0 { @@ -132948,7 +135386,7 @@ func dense_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = apArg } -func dense_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151354:13: */ +func dense_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154013:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{}))) if p != 0 { @@ -132966,9 +135404,9 @@ func dense_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151354:13: type NthValueCtx = struct { FnStep I64 FpValue uintptr -} /* sqlite3.c:151371:1 */ +} /* sqlite3.c:154030:1 */ -func nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151375:13: */ +func nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154034:13: */ var p uintptr var fVal float64 var iVal I64 @@ -133031,10 +135469,10 @@ __1: error_out: Xsqlite3_result_error(tls, - pCtx, ts+23754 /* "second argument ..." */, -1) + pCtx, ts+24212 /* "second argument ..." */, -1) } -func nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151416:13: */ +func nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154075:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, 0) if (p != 0) && ((*NthValueCtx)(unsafe.Pointer(p)).FpValue != 0) { @@ -133044,7 +135482,7 @@ func nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151416:13 } } -func first_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151428:13: */ +func first_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154087:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NthValueCtx{}))) if (p != 0) && ((*NthValueCtx)(unsafe.Pointer(p)).FpValue == uintptr(0)) { @@ -133057,7 +135495,7 @@ func first_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) _ = apArg } -func first_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151444:13: */ +func first_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154103:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NthValueCtx{}))) if (p != 0) && ((*NthValueCtx)(unsafe.Pointer(p)).FpValue != 0) { @@ -133071,7 +135509,7 @@ func first_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151444: // the window frame has been set to: // // RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW -func rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151462:13: */ +func rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154121:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{}))) if p != 0 { @@ -133084,7 +135522,7 @@ func rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* s _ = apArg } -func rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151478:13: */ +func rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154137:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{}))) if p != 0 { @@ -133097,7 +135535,7 @@ func rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151478:13: */ // the window frame has been set to: // // GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING -func percent_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151493:13: */ +func percent_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154152:13: */ var p uintptr _ = nArg _ = apArg @@ -133107,7 +135545,7 @@ func percent_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr } } -func percent_rankInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151506:13: */ +func percent_rankInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154165:13: */ var p uintptr _ = nArg _ = apArg @@ -133115,7 +135553,7 @@ func percent_rankInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) (*CallCount)(unsafe.Pointer(p)).FnStep++ } -func percent_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151517:13: */ +func percent_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154176:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{}))) if p != 0 { @@ -133133,7 +135571,7 @@ func percent_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151517:13 // the window frame has been set to: // // GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING -func cume_distStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151538:13: */ +func cume_distStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154197:13: */ var p uintptr _ = nArg _ = apArg @@ -133143,7 +135581,7 @@ func cume_distStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { } } -func cume_distInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151551:13: */ +func cume_distInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154210:13: */ var p uintptr _ = nArg _ = apArg @@ -133151,7 +135589,7 @@ func cume_distInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { (*CallCount)(unsafe.Pointer(p)).FnStep++ } -func cume_distValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151562:13: */ +func cume_distValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154221:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, 0) if p != 0 { @@ -133165,13 +135603,13 @@ type NtileCtx = struct { FnTotal I64 FnParam I64 FiRow I64 -} /* sqlite3.c:151575:1 */ +} /* sqlite3.c:154234:1 */ // Implementation of ntile(). This assumes that the window frame has // been coerced to: // // ROWS CURRENT ROW AND UNBOUNDED FOLLOWING -func ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151587:13: */ +func ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154246:13: */ var p uintptr _ = nArg p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NtileCtx{}))) @@ -133180,14 +135618,14 @@ func ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* (*NtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*NtileCtx)(unsafe.Pointer(p)).FnParam <= int64(0) { Xsqlite3_result_error(tls, - pCtx, ts+23810 /* "argument of ntil..." */, -1) + pCtx, ts+24268 /* "argument of ntil..." */, -1) } } (*NtileCtx)(unsafe.Pointer(p)).FnTotal++ } } -func ntileInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151607:13: */ +func ntileInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154266:13: */ var p uintptr _ = nArg _ = apArg @@ -133195,7 +135633,7 @@ func ntileInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* s (*NtileCtx)(unsafe.Pointer(p)).FiRow++ } -func ntileValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151618:13: */ +func ntileValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154277:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NtileCtx{}))) if (p != 0) && ((*NtileCtx)(unsafe.Pointer(p)).FnParam > int64(0)) { @@ -133221,10 +135659,10 @@ type LastValueCtx = struct { FpVal uintptr FnVal int32 _ [4]byte -} /* sqlite3.c:151645:1 */ +} /* sqlite3.c:154304:1 */ // Implementation of last_value(). -func last_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151653:13: */ +func last_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154312:13: */ var p uintptr _ = nArg p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(LastValueCtx{}))) @@ -133239,7 +135677,7 @@ func last_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) } } -func last_valueInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151671:13: */ +func last_valueInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:154330:13: */ var p uintptr _ = nArg _ = apArg @@ -133253,7 +135691,7 @@ func last_valueInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { } } -func last_valueValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151688:13: */ +func last_valueValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154347:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, 0) if (p != 0) && ((*LastValueCtx)(unsafe.Pointer(p)).FpVal != 0) { @@ -133261,7 +135699,7 @@ func last_valueValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151688:13: } } -func last_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151695:13: */ +func last_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:154354:13: */ var p uintptr p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(LastValueCtx{}))) if (p != 0) && ((*LastValueCtx)(unsafe.Pointer(p)).FpVal != 0) { @@ -133277,17 +135715,17 @@ func last_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151695:1 // comparison of the zName pointer. Example: // // if( pFuncDef->zName==row_valueName ){ ... } -var row_numberName = *(*[11]int8)(unsafe.Pointer(ts + 23855 /* "row_number" */)) /* sqlite3.c:151713:19 */ -var dense_rankName = *(*[11]int8)(unsafe.Pointer(ts + 23866 /* "dense_rank" */)) /* sqlite3.c:151714:19 */ -var rankName = *(*[5]int8)(unsafe.Pointer(ts + 23877 /* "rank" */)) /* sqlite3.c:151715:19 */ -var percent_rankName = *(*[13]int8)(unsafe.Pointer(ts + 23882 /* "percent_rank" */)) /* sqlite3.c:151716:19 */ -var cume_distName = *(*[10]int8)(unsafe.Pointer(ts + 23895 /* "cume_dist" */)) /* sqlite3.c:151717:19 */ -var ntileName = *(*[6]int8)(unsafe.Pointer(ts + 23905 /* "ntile" */)) /* sqlite3.c:151718:19 */ -var last_valueName = *(*[11]int8)(unsafe.Pointer(ts + 23911 /* "last_value" */)) /* sqlite3.c:151719:19 */ -var nth_valueName = *(*[10]int8)(unsafe.Pointer(ts + 23922 /* "nth_value" */)) /* sqlite3.c:151720:19 */ -var first_valueName = *(*[12]int8)(unsafe.Pointer(ts + 23932 /* "first_value" */)) /* sqlite3.c:151721:19 */ -var leadName = *(*[5]int8)(unsafe.Pointer(ts + 23944 /* "lead" */)) /* sqlite3.c:151722:19 */ -var lagName = *(*[4]int8)(unsafe.Pointer(ts + 23949 /* "lag" */)) /* sqlite3.c:151723:19 */ +var row_numberName = *(*[11]int8)(unsafe.Pointer(ts + 24313 /* "row_number" */)) /* sqlite3.c:154372:19 */ +var dense_rankName = *(*[11]int8)(unsafe.Pointer(ts + 24324 /* "dense_rank" */)) /* sqlite3.c:154373:19 */ +var rankName = *(*[5]int8)(unsafe.Pointer(ts + 24335 /* "rank" */)) /* sqlite3.c:154374:19 */ +var percent_rankName = *(*[13]int8)(unsafe.Pointer(ts + 24340 /* "percent_rank" */)) /* sqlite3.c:154375:19 */ +var cume_distName = *(*[10]int8)(unsafe.Pointer(ts + 24353 /* "cume_dist" */)) /* sqlite3.c:154376:19 */ +var ntileName = *(*[6]int8)(unsafe.Pointer(ts + 24363 /* "ntile" */)) /* sqlite3.c:154377:19 */ +var last_valueName = *(*[11]int8)(unsafe.Pointer(ts + 24369 /* "last_value" */)) /* sqlite3.c:154378:19 */ +var nth_valueName = *(*[10]int8)(unsafe.Pointer(ts + 24380 /* "nth_value" */)) /* sqlite3.c:154379:19 */ +var first_valueName = *(*[12]int8)(unsafe.Pointer(ts + 24390 /* "first_value" */)) /* sqlite3.c:154380:19 */ +var leadName = *(*[5]int8)(unsafe.Pointer(ts + 24402 /* "lead" */)) /* sqlite3.c:154381:19 */ +var lagName = *(*[4]int8)(unsafe.Pointer(ts + 24407 /* "lag" */)) /* sqlite3.c:154382:19 */ // No-op implementations of xStep() and xFinalize(). Used as place-holders // for built-in window functions that never call those interfaces. @@ -133296,7 +135734,7 @@ var lagName = *(*[4]int8)(unsafe.Pointer(ts + 23949 /* "lag" */)) // noopStepFunc() is never called, and so it is marked with NO_TEST to // let the test coverage routine know not to expect this function to be // invoked. -func noopStepFunc(tls *libc.TLS, p uintptr, n int32, a uintptr) { /* sqlite3.c:151734:13: */ //NO_TEST +func noopStepFunc(tls *libc.TLS, p uintptr, n int32, a uintptr) { /* sqlite3.c:154393:13: */ //NO_TEST _ = p //NO_TEST _ = n //NO_TEST _ = a //NO_TEST @@ -133304,7 +135742,7 @@ func noopStepFunc(tls *libc.TLS, p uintptr, n int32, a uintptr) { /* sqlite3.c:1 } //NO_TEST -func noopValueFunc(tls *libc.TLS, p uintptr) { /* sqlite3.c:151744:13: */ +func noopValueFunc(tls *libc.TLS, p uintptr) { /* sqlite3.c:154403:13: */ _ = p /*no-op*/ } @@ -133319,7 +135757,7 @@ func noopValueFunc(tls *libc.TLS, p uintptr) { /* sqlite3.c:151744:13: */ // xInverse. // Register those built-in window functions that are not also aggregates. -func Xsqlite3WindowFunctions(tls *libc.TLS) { /* sqlite3.c:151775:21: */ +func Xsqlite3WindowFunctions(tls *libc.TLS) { /* sqlite3.c:154434:21: */ Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aWindowFuncs)), (int32(uint64(unsafe.Sizeof(aWindowFuncs)) / uint64(unsafe.Sizeof(FuncDef{}))))) } @@ -133338,9 +135776,9 @@ var aWindowFuncs = [15]FuncDef{ {FnArg: int8(3), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0}, {FnArg: int8(1), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0}, {FnArg: int8(2), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0}, - {FnArg: int8(3), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0}} /* sqlite3.c:151776:18 */ + {FnArg: int8(3), FfuncFlags: (U32((SQLITE_UTF8 | SQLITE_FUNC_WINDOW) | 0)), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0}} /* sqlite3.c:154435:18 */ -func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uintptr { /* sqlite3.c:151796:15: */ +func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uintptr { /* sqlite3.c:154455:15: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -133351,7 +135789,7 @@ func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uin } } if p == uintptr(0) { - Xsqlite3ErrorMsg(tls, pParse, ts+23953 /* "no such window: ..." */, libc.VaList(bp, zName)) + Xsqlite3ErrorMsg(tls, pParse, ts+24411 /* "no such window: ..." */, libc.VaList(bp, zName)) } return p } @@ -133371,7 +135809,7 @@ func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uin // * If the function is a built-in window function that requires the // window to be coerced (see "BUILT-IN WINDOW FUNCTIONS" at the top // of this file), pWin is updated here. -func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uintptr, pFunc uintptr) { /* sqlite3.c:151824:21: */ +func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uintptr, pFunc uintptr) { /* sqlite3.c:154483:21: */ bp := tls.Alloc(192) defer tls.Free(192) @@ -133395,12 +135833,12 @@ func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (((*Window)(unsafe.Pointer(pWin)).FpStart != 0) || ((*Window)(unsafe.Pointer(pWin)).FpEnd != 0))) && (((*Window)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0)) || ((*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != 1)) { Xsqlite3ErrorMsg(tls, pParse, - ts+23972 /* "RANGE with offse..." */, 0) - } else if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_WINDOW) != 0 { + ts+24430 /* "RANGE with offse..." */, 0) + } else if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_WINDOW)) != 0 { var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if (*Window)(unsafe.Pointer(pWin)).FpFilter != 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+24043 /* "FILTER clause ma..." */, 0) + ts+24501 /* "FILTER clause ma..." */, 0) } else { *(*[8]WindowUpdate)(unsafe.Pointer(bp /* aUp */)) = [8]WindowUpdate{ {FzFunc: uintptr(unsafe.Pointer(&row_numberName)), FeFrmType: TK_ROWS, FeStart: TK_UNBOUNDED, FeEnd: TK_CURRENT}, @@ -133423,7 +135861,7 @@ func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*Window)(unsafe.Pointer(pWin)).FeEnd = U8((*WindowUpdate)(unsafe.Pointer(bp /* &aUp */ + uintptr(i)*24)).FeEnd) (*Window)(unsafe.Pointer(pWin)).FeExclude = U8(0) if int32((*Window)(unsafe.Pointer(pWin)).FeStart) == TK_FOLLOWING { - (*Window)(unsafe.Pointer(pWin)).FpStart = Xsqlite3Expr(tls, db, TK_INTEGER, ts+9901 /* "1" */) + (*Window)(unsafe.Pointer(pWin)).FpStart = Xsqlite3Expr(tls, db, TK_INTEGER, ts+9994 /* "1" */) } break } @@ -133439,16 +135877,16 @@ type WindowUpdate = struct { FeStart int32 FeEnd int32 _ [4]byte -} /* sqlite3.c:151859:7 */ +} /* sqlite3.c:154518:7 */ // Context object passed through sqlite3WalkExprList() to // selectWindowRewriteExprCb() by selectWindowRewriteEList(). -type WindowRewrite = WindowRewrite1 /* sqlite3.c:151899:30 */ +type WindowRewrite = WindowRewrite1 /* sqlite3.c:154558:30 */ // Callback function used by selectWindowRewriteEList(). If necessary, // this function appends to the output expression-list and updates // expression (*ppExpr) in place. -func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:151913:12: */ +func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:154572:12: */ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse @@ -133464,7 +135902,7 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in var nSrc int32 = (*SrcList)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc var i int32 for i = 0; i < nSrc; i++ { - if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcList_item)(unsafe.Pointer(((*WindowRewrite1)(unsafe.Pointer(p)).FpSrc+8 /* &.a */)+uintptr(i)*112)).FiCursor { + if (*Expr)(unsafe.Pointer(pExpr)).FiTable == (*SrcItem)(unsafe.Pointer(((*WindowRewrite1)(unsafe.Pointer(p)).FpSrc+8 /* &.a */)+uintptr(i)*112)).FiCursor { break } } @@ -133477,7 +135915,7 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) { case TK_FUNCTION: - if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (EP_WinFunc)) != U32(0)) { + if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(EP_WinFunc))) != U32(0)) { break } else { var pWin uintptr @@ -133507,19 +135945,19 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in if iCol < 0 { var pDup uintptr = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr, 0) if (pDup != 0) && (int32((*Expr)(unsafe.Pointer(pDup)).Fop) == TK_AGG_FUNCTION) { - (*Expr)(unsafe.Pointer(pDup)).Fop = TK_FUNCTION + (*Expr)(unsafe.Pointer(pDup)).Fop = U8(TK_FUNCTION) } (*WindowRewrite1)(unsafe.Pointer(p)).FpSub = Xsqlite3ExprListAppend(tls, pParse, (*WindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) } if (*WindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { - var f int32 = (int32((*Expr)(unsafe.Pointer(pExpr)).Fflags & EP_Collate)) + var f int32 = (int32((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(EP_Collate))) - *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (EP_Static) + *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(EP_Static)) Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr) *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(EP_Static))) libc.Xmemset(tls, pExpr, 0, uint64(unsafe.Sizeof(Expr{}))) - (*Expr)(unsafe.Pointer(pExpr)).Fop = TK_COLUMN + (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(TK_COLUMN) (*Expr)(unsafe.Pointer(pExpr)).FiColumn = func() int16 { if iCol < 0 { return (int16((*ExprList)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - 1)) @@ -133544,7 +135982,7 @@ func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) in return WRC_Continue } -func selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:151994:12: */ +func selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:154653:12: */ var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) var pSave uintptr = (*WindowRewrite1)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { @@ -133568,7 +136006,7 @@ func selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr // with a TK_COLUMN that reads the (N-1)th element of table // pWin->iEphCsr, where N is the number of elements in (*ppSub) after // appending the new one. -func selectWindowRewriteEList(tls *libc.TLS, pParse uintptr, pWin uintptr, pSrc uintptr, pEList uintptr, pTab uintptr, ppSub uintptr) { /* sqlite3.c:152021:13: */ +func selectWindowRewriteEList(tls *libc.TLS, pParse uintptr, pWin uintptr, pSrc uintptr, pEList uintptr, pTab uintptr, ppSub uintptr) { /* sqlite3.c:154680:13: */ bp := tls.Alloc(88) defer tls.Free(88) @@ -133600,7 +136038,7 @@ func selectWindowRewriteEList(tls *libc.TLS, pParse uintptr, pWin uintptr, pSrc // Append a copy of each expression in expression-list pAppend to // expression list pList. Return a pointer to the result list. -func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend uintptr, bIntToNull int32) uintptr { /* sqlite3.c:152055:17: */ +func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend uintptr, bIntToNull int32) uintptr { /* sqlite3.c:154714:17: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -133619,11 +136057,11 @@ func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend ui // var iDummy int32 at bp, 4 var pSub uintptr - for pSub = pDup; ((*Expr)(unsafe.Pointer((pSub))).Fflags & (EP_Skip)) != U32(0); pSub = (*Expr)(unsafe.Pointer(pSub)).FpLeft { + for pSub = pDup; ((*Expr)(unsafe.Pointer((pSub))).Fflags & (U32(EP_Skip))) != U32(0); pSub = (*Expr)(unsafe.Pointer(pSub)).FpLeft { } if Xsqlite3ExprIsInteger(tls, pSub, bp /* &iDummy */) != 0 { - (*Expr)(unsafe.Pointer(pSub)).Fop = TK_NULL + (*Expr)(unsafe.Pointer(pSub)).Fop = U8(TK_NULL) *(*U32)(unsafe.Pointer(pSub + 4 /* &.flags */)) &= (libc.Uint32FromInt32(libc.CplInt32(((EP_IntValue | EP_IsTrue) | EP_IsFalse)))) *(*uintptr)(unsafe.Pointer(pSub + 8 /* &.u */)) = uintptr(0) } @@ -133643,7 +136081,7 @@ func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend ui // due to the extra subquery layer that was added. // // See also the incrAggDepth() routine in resolve.c -func sqlite3WindowExtraAggFuncDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:152094:12: */ +func sqlite3WindowExtraAggFuncDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:154753:12: */ if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == TK_AGG_FUNCTION) && (int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) >= (*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth) { (*Expr)(unsafe.Pointer(pExpr)).Fop2++ @@ -133656,12 +136094,12 @@ func sqlite3WindowExtraAggFuncDepth(tls *libc.TLS, pWalker uintptr, pExpr uintpt // rewrites the SELECT statement so that window function xStep functions // are invoked in the correct order as described under "SELECT REWRITING" // at the top of this file. -func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:152110:20: */ +func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:154769:20: */ bp := tls.Alloc(56) defer tls.Free(56) var rc int32 = SQLITE_OK - if (((*Select)(unsafe.Pointer(p)).FpWin != 0) && ((*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0))) && (((*Select)(unsafe.Pointer(p)).FselFlags & SF_WinRewrite) == U32(0)) { + if (((*Select)(unsafe.Pointer(p)).FpWin != 0) && ((*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0))) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_WinRewrite)) == U32(0)) { var v uintptr = Xsqlite3GetVdbe(tls, pParse) var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb var pSub uintptr = uintptr(0) // The subquery @@ -133691,7 +136129,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* (*Select)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*Select)(unsafe.Pointer(p)).FpHaving = uintptr(0) *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_Aggregate))) - *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (SF_WinRewrite) + *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(SF_WinRewrite)) // Create the ORDER BY clause for the sub-select. This is the concatenation // of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -133735,7 +136173,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* // results. for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { var pArgs uintptr = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32 /* &.x */)) - if ((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & SQLITE_FUNC_SUBTYPE) != 0 { + if ((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_SUBTYPE)) != 0 { selectWindowRewriteEList(tls, pParse, pMWin, pSrc, pArgs, pTab, bp+48 /* &pSublist */) (*Window)(unsafe.Pointer(pWin)).FiArgCol = func() int32 { if *(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)) != 0 { @@ -133769,7 +136207,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* // keep everything legal in this case. if *(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), - Xsqlite3Expr(tls, db, TK_INTEGER, ts+9370 /* "0" */)) + Xsqlite3Expr(tls, db, TK_INTEGER, ts+9474 /* "0" */)) } pSub = Xsqlite3SelectNew(tls, @@ -133778,11 +136216,11 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* (*Select)(unsafe.Pointer(p)).FpSrc = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) if (*Select)(unsafe.Pointer(p)).FpSrc != 0 { var pTab2 uintptr - (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect = pSub + (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpSelect = pSub Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer(p)).FpSrc) - *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (SF_Expanded) - pTab2 = Xsqlite3ResultSetOfSelect(tls, pParse, pSub, SQLITE_AFF_NONE) - *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (selFlags & SF_Aggregate) + *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (U32(SF_Expanded)) + pTab2 = Xsqlite3ResultSetOfSelect(tls, pParse, pSub, int8(SQLITE_AFF_NONE)) + *(*U32)(unsafe.Pointer(pSub + 4 /* &.selFlags */)) |= (selFlags & U32(SF_Aggregate)) if pTab2 == uintptr(0) { // Might actually be some other kind of error, but in that case // pParse->nErr will be set, so if SQLITE_NOMEM is set, we will get @@ -133790,8 +136228,8 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* rc = SQLITE_NOMEM } else { libc.Xmemcpy(tls, pTab, pTab2, uint64(unsafe.Sizeof(Table{}))) - *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (TF_Ephemeral) - (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab = pTab + *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(TF_Ephemeral)) + (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab = pTab pTab = pTab2 libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{}))) (*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct { @@ -133825,7 +136263,7 @@ func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* // Unlink the Window object from the Select to which it is attached, // if it is attached. -func Xsqlite3WindowUnlinkFromSelect(tls *libc.TLS, p uintptr) { /* sqlite3.c:152260:21: */ +func Xsqlite3WindowUnlinkFromSelect(tls *libc.TLS, p uintptr) { /* sqlite3.c:154919:21: */ if (*Window)(unsafe.Pointer(p)).FppThis != 0 { *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(p)).FppThis)) = (*Window)(unsafe.Pointer(p)).FpNextWin if (*Window)(unsafe.Pointer(p)).FpNextWin != 0 { @@ -133836,7 +136274,7 @@ func Xsqlite3WindowUnlinkFromSelect(tls *libc.TLS, p uintptr) { /* sqlite3.c:152 } // Free the Window object passed as the second argument. -func Xsqlite3WindowDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:152271:21: */ +func Xsqlite3WindowDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:154930:21: */ if p != 0 { Xsqlite3WindowUnlinkFromSelect(tls, p) Xsqlite3ExprDelete(tls, db, (*Window)(unsafe.Pointer(p)).FpFilter) @@ -133851,7 +136289,7 @@ func Xsqlite3WindowDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:1 } // Free the linked list of Window objects starting at the second argument. -func Xsqlite3WindowListDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:152288:21: */ +func Xsqlite3WindowListDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:154947:21: */ for p != 0 { var pNext uintptr = (*Window)(unsafe.Pointer(p)).FpNextWin Xsqlite3WindowDelete(tls, db, p) @@ -133864,7 +136302,7 @@ func Xsqlite3WindowListDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3 // constant, change it to NULL. The fact that it is then a non-negative // integer will be caught later. But it is important not to leave // variable values in the expression tree. -func sqlite3WindowOffsetExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:152303:13: */ +func sqlite3WindowOffsetExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:154962:13: */ if 0 == Xsqlite3ExprIsConstant(tls, pExpr) { if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME { Xsqlite3RenameExprUnmap(tls, pParse, pExpr) @@ -133876,7 +136314,7 @@ func sqlite3WindowOffsetExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintp } // Allocate and return a new Window object describing a Window Definition. -func Xsqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int32, pStart uintptr, eEnd int32, pEnd uintptr, eExclude U8) uintptr { /* sqlite3.c:152315:23: */ +func Xsqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int32, pStart uintptr, eEnd int32, pEnd uintptr, eExclude U8) uintptr { /* sqlite3.c:154974:23: */ var pWin uintptr var bImplicitFrame int32 pWin = uintptr(0) @@ -133909,7 +136347,7 @@ __1: ((eStart == TK_FOLLOWING) && ((eEnd == TK_PRECEDING) || (eEnd == TK_CURRENT)))) { goto __2 } - Xsqlite3ErrorMsg(tls, pParse, ts+24106 /* "unsupported fram..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+24564 /* "unsupported fram..." */, 0) goto windowAllocErr __2: ; @@ -133924,10 +136362,10 @@ __3: (*Window)(unsafe.Pointer(pWin)).FeFrmType = U8(eType) (*Window)(unsafe.Pointer(pWin)).FeStart = U8(eStart) (*Window)(unsafe.Pointer(pWin)).FeEnd = U8(eEnd) - if !((int32(eExclude) == 0) && ((int32((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags) & (SQLITE_WindowFunc)) != 0)) { + if !((int32(eExclude) == 0) && (((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags & (U32(SQLITE_WindowFunc))) != U32(0))) { goto __4 } - eExclude = TK_NO + eExclude = U8(TK_NO) __4: ; (*Window)(unsafe.Pointer(pWin)).FeExclude = eExclude @@ -133945,7 +136383,7 @@ windowAllocErr: // Attach PARTITION and ORDER BY clauses pPartition and pOrderBy to window // pWin. Also, if parameter pBase is not NULL, set pWin->zBase to the // equivalent nul-terminated string. -func Xsqlite3WindowAssemble(tls *libc.TLS, pParse uintptr, pWin uintptr, pPartition uintptr, pOrderBy uintptr, pBase uintptr) uintptr { /* sqlite3.c:152387:23: */ +func Xsqlite3WindowAssemble(tls *libc.TLS, pParse uintptr, pWin uintptr, pPartition uintptr, pOrderBy uintptr, pBase uintptr) uintptr { /* sqlite3.c:155046:23: */ if pWin != 0 { (*Window)(unsafe.Pointer(pWin)).FpPartition = pPartition (*Window)(unsafe.Pointer(pWin)).FpOrderBy = pOrderBy @@ -133964,7 +136402,7 @@ func Xsqlite3WindowAssemble(tls *libc.TLS, pParse uintptr, pWin uintptr, pPartit // stored in the linked list starting at pWin->pNextWin. This function // either updates *pWin according to the base specification, or else // leaves an error in pParse. -func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uintptr) { /* sqlite3.c:152414:21: */ +func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uintptr) { /* sqlite3.c:155073:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -133975,15 +136413,15 @@ func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint var zErr uintptr = uintptr(0) // Check for errors if (*Window)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = ts + 24138 /* "PARTITION clause" */ + zErr = ts + 24596 /* "PARTITION clause" */ } else if ((*Window)(unsafe.Pointer(pExist)).FpOrderBy != 0) && ((*Window)(unsafe.Pointer(pWin)).FpOrderBy != 0) { - zErr = ts + 24155 /* "ORDER BY clause" */ + zErr = ts + 24613 /* "ORDER BY clause" */ } else if int32((*Window)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = ts + 24171 /* "frame specificat..." */ + zErr = ts + 24629 /* "frame specificat..." */ } if zErr != 0 { Xsqlite3ErrorMsg(tls, pParse, - ts+24191 /* "cannot override ..." */, libc.VaList(bp, zErr, (*Window)(unsafe.Pointer(pWin)).FzBase)) + ts+24649 /* "cannot override ..." */, libc.VaList(bp, zErr, (*Window)(unsafe.Pointer(pWin)).FzBase)) } else { (*Window)(unsafe.Pointer(pWin)).FpPartition = Xsqlite3ExprListDup(tls, db, (*Window)(unsafe.Pointer(pExist)).FpPartition, 0) if (*Window)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -133998,15 +136436,15 @@ func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint } // Attach window object pWin to expression p. -func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr) { /* sqlite3.c:152448:21: */ +func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr) { /* sqlite3.c:155107:21: */ if p != 0 { *(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) = pWin - *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (EP_WinFunc) + *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (U32(EP_WinFunc)) (*Window)(unsafe.Pointer(pWin)).FpOwner = p - if (((*Expr)(unsafe.Pointer(p)).Fflags & EP_Distinct) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) != TK_FILTER) { + if (((*Expr)(unsafe.Pointer(p)).Fflags & U32(EP_Distinct)) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) != TK_FILTER) { Xsqlite3ErrorMsg(tls, pParse, - ts+24224 /* "DISTINCT is not ..." */, 0) + ts+24682 /* "DISTINCT is not ..." */, 0) } } else { Xsqlite3WindowDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -134017,22 +136455,27 @@ func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr // to be processed as part of SELECT statement pSel). The window is linked // in if either (a) there are no other windows already linked to this // SELECT, or (b) the windows already linked use a compatible window frame. -func Xsqlite3WindowLink(tls *libc.TLS, pSel uintptr, pWin uintptr) { /* sqlite3.c:152471:21: */ - if (pSel != uintptr(0)) && - ((uintptr(0) == (*Select)(unsafe.Pointer(pSel)).FpWin) || (0 == Xsqlite3WindowCompare(tls, uintptr(0), (*Select)(unsafe.Pointer(pSel)).FpWin, pWin, 0))) { - (*Window)(unsafe.Pointer(pWin)).FpNextWin = (*Select)(unsafe.Pointer(pSel)).FpWin - if (*Select)(unsafe.Pointer(pSel)).FpWin != 0 { - (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpWin)).FppThis = (pWin + 64 /* &.pNextWin */) +func Xsqlite3WindowLink(tls *libc.TLS, pSel uintptr, pWin uintptr) { /* sqlite3.c:155130:21: */ + if pSel != 0 { + if (uintptr(0) == (*Select)(unsafe.Pointer(pSel)).FpWin) || (0 == Xsqlite3WindowCompare(tls, uintptr(0), (*Select)(unsafe.Pointer(pSel)).FpWin, pWin, 0)) { + (*Window)(unsafe.Pointer(pWin)).FpNextWin = (*Select)(unsafe.Pointer(pSel)).FpWin + if (*Select)(unsafe.Pointer(pSel)).FpWin != 0 { + (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpWin)).FppThis = (pWin + 64 /* &.pNextWin */) + } + (*Select)(unsafe.Pointer(pSel)).FpWin = pWin + (*Window)(unsafe.Pointer(pWin)).FppThis = (pSel + 112 /* &.pWin */) + } else { + if Xsqlite3ExprListCompare(tls, (*Window)(unsafe.Pointer(pWin)).FpPartition, (*Window)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpWin)).FpPartition, -1) != 0 { + *(*U32)(unsafe.Pointer(pSel + 4 /* &.selFlags */)) |= (U32(SF_MultiPart)) + } } - (*Select)(unsafe.Pointer(pSel)).FpWin = pWin - (*Window)(unsafe.Pointer(pWin)).FppThis = (pSel + 112 /* &.pWin */) } } // Return 0 if the two window objects are identical, 1 if they are // different, or 2 if it cannot be determined if the objects are identical // or not. Identical window objects can be processed in a single scan. -func Xsqlite3WindowCompare(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr, bFilter int32) int32 { /* sqlite3.c:152489:20: */ +func Xsqlite3WindowCompare(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr, bFilter int32) int32 { /* sqlite3.c:155152:20: */ var res int32 if (p1 == uintptr(0)) || (p2 == uintptr(0)) { return 1 @@ -134072,8 +136515,8 @@ func Xsqlite3WindowCompare(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr // This is called by code in select.c before it calls sqlite3WhereBegin() // to begin iterating through the sub-query results. It is used to allocate // and initialize registers and cursors used by sqlite3WindowCodeStep(). -func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:152518:21: */ - var nEphExpr int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpSrc + 8 /* &.a */))).FpSelect)).FpEList)).FnExpr +func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:155181:21: */ + var nEphExpr int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpSrc + 8 /* &.a */))).FpSelect)).FpEList)).FnExpr var pMWin uintptr = (*Select)(unsafe.Pointer(pSelect)).FpWin var pWin uintptr var v uintptr = Xsqlite3GetVdbe(tls, pParse) @@ -134107,7 +136550,7 @@ func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { var p uintptr = (*Window)(unsafe.Pointer(pWin)).FpFunc - if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { + if (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { // The inline versions of min() and max() require a single ephemeral // table and 3 registers. The registers are used as follows: // @@ -134121,7 +136564,7 @@ func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (3) if (pKeyInfo != 0) && (int32(*(*int8)(unsafe.Pointer((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FzName + 1))) == 'i') { - *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = KEYINFO_ORDER_DESC + *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = U8(KEYINFO_ORDER_DESC) } Xsqlite3VdbeAddOp2(tls, v, OP_OpenEphemeral, (*Window)(unsafe.Pointer(pWin)).FcsrApp, 2) Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -9) @@ -134145,7 +136588,7 @@ func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* // evaluated and the result left in register reg. This function generates VM // code to check that the value is a non-negative integer and throws an // exception if it is not. -func windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { /* sqlite3.c:152602:13: */ +func windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { /* sqlite3.c:155265:13: */ var v uintptr = Xsqlite3GetVdbe(tls, pParse) var regZero int32 = Xsqlite3GetTempReg(tls, pParse) @@ -134173,17 +136616,17 @@ func windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { / } var azErr = [5]uintptr{ - ts + 24271, /* "frame starting o..." */ - ts + 24324, /* "frame ending off..." */ - ts + 23754, /* "second argument ..." */ - ts + 24375, /* "frame starting o..." */ - ts + 24427, /* "frame ending off..." */ -} /* sqlite3.c:152603:21 */ -var aOp1 = [5]int32{OP_Ge, OP_Ge, OP_Gt, OP_Ge, OP_Ge} /* sqlite3.c:152610:14 */ + ts + 24729, /* "frame starting o..." */ + ts + 24782, /* "frame ending off..." */ + ts + 24212, /* "second argument ..." */ + ts + 24833, /* "frame starting o..." */ + ts + 24885, /* "frame ending off..." */ +} /* sqlite3.c:155266:21 */ +var aOp1 = [5]int32{OP_Ge, OP_Ge, OP_Gt, OP_Ge, OP_Ge} /* sqlite3.c:155273:14 */ // Return the number of arguments passed to the window-function associated // with the object passed as the only argument to this function. -func windowArgCount(tls *libc.TLS, pWin uintptr) int32 { /* sqlite3.c:152648:12: */ +func windowArgCount(tls *libc.TLS, pWin uintptr) int32 { /* sqlite3.c:155311:12: */ var pList uintptr = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32 /* &.x */)) return func() int32 { if pList != 0 { @@ -134204,19 +136647,19 @@ type WindowCodeArg1 = struct { Fstart WindowCsrAndReg Fcurrent WindowCsrAndReg Fend WindowCsrAndReg -} /* sqlite3.c:152653:9 */ +} /* sqlite3.c:155316:9 */ -type WindowCodeArg = WindowCodeArg1 /* sqlite3.c:152653:30 */ +type WindowCodeArg = WindowCodeArg1 /* sqlite3.c:155316:30 */ type WindowCsrAndReg1 = struct { Fcsr int32 Freg int32 -} /* sqlite3.c:152653:9 */ +} /* sqlite3.c:155316:9 */ -type WindowCsrAndReg = WindowCsrAndReg1 /* sqlite3.c:152654:32 */ +type WindowCsrAndReg = WindowCsrAndReg1 /* sqlite3.c:155317:32 */ // Generate VM code to read the window frames peer values from cursor csr into // an array of registers starting at reg. -func windowReadPeerValues(tls *libc.TLS, p uintptr, csr int32, reg int32) { /* sqlite3.c:152737:13: */ +func windowReadPeerValues(tls *libc.TLS, p uintptr, csr int32, reg int32) { /* sqlite3.c:155400:13: */ var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin var pOrderBy uintptr = (*Window)(unsafe.Pointer(pMWin)).FpOrderBy if pOrderBy != 0 { @@ -134252,7 +136695,7 @@ func windowReadPeerValues(tls *libc.TLS, p uintptr, csr int32, reg int32) { /* s // // If argument regPartSize is non-zero, then it is a register containing the // number of rows in the current partition. -func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse int32, reg int32) { /* sqlite3.c:152774:13: */ +func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse int32, reg int32) { /* sqlite3.c:155437:13: */ var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse var v uintptr = Xsqlite3GetVdbe(tls, pParse) var pWin uintptr @@ -134280,7 +136723,7 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse regArg = reg if (((*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0) && - (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0)) && + (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0)) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { var addrIsNull int32 = Xsqlite3VdbeAddOp1(tls, v, OP_IsNull, regArg) @@ -134329,7 +136772,7 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse } } } - if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_NEEDCOLL) != 0 { + if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_NEEDCOLL)) != 0 { var pColl uintptr pColl = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32 /* &.x */)) + 8 /* &.a */))).FpExpr) @@ -134360,7 +136803,7 @@ func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse // (bFin==1) for each window function in the linked list starting at // pMWin. Or, for built-in window-functions that do not use the standard // API, generate the equivalent VM code. -func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:152888:13: */ +func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:155551:13: */ var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin var v uintptr = Xsqlite3GetVdbe(tls, pParse) @@ -134368,7 +136811,7 @@ func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:152888: for pWin = pMWin; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin { if (((*Window)(unsafe.Pointer(pMWin)).FregStartRowid == 0) && - (((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0)) && + (((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0)) && (int32((*Window)(unsafe.Pointer(pWin)).FeStart) != TK_UNBOUNDED) { Xsqlite3VdbeAddOp2(tls, v, OP_Null, 0, (*Window)(unsafe.Pointer(pWin)).FregResult) Xsqlite3VdbeAddOp1(tls, v, OP_Last, (*Window)(unsafe.Pointer(pWin)).FcsrApp) @@ -134396,7 +136839,7 @@ func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:152888: // p->pMWin list by doing a full scan of the current window frame. Store the // results in the Window.regResult registers, ready to return the upper // layer. -func windowFullScan(tls *libc.TLS, p uintptr) { /* sqlite3.c:152927:13: */ +func windowFullScan(tls *libc.TLS, p uintptr) { /* sqlite3.c:155590:13: */ var pWin uintptr var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin @@ -134503,7 +136946,7 @@ func windowFullScan(tls *libc.TLS, p uintptr) { /* sqlite3.c:152927:13: */ // first_value() // lag() // lead() -func windowReturnOneRow(tls *libc.TLS, p uintptr) { /* sqlite3.c:153033:13: */ +func windowReturnOneRow(tls *libc.TLS, p uintptr) { /* sqlite3.c:155696:13: */ var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin var v uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpVdbe @@ -134585,7 +137028,7 @@ func windowReturnOneRow(tls *libc.TLS, p uintptr) { /* sqlite3.c:153033:13: */ // in the linked list passed as the second argument to NULL. And perform // any equivalent initialization required by any built-in window functions // in the list. -func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sqlite3.c:153109:12: */ +func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sqlite3.c:155772:12: */ var v uintptr = Xsqlite3GetVdbe(tls, pParse) var regArg int32 var nArg int32 = 0 @@ -134606,7 +137049,7 @@ func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sq Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, ((*Window)(unsafe.Pointer(pWin)).FregApp + 1)) } - if (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & SQLITE_FUNC_MINMAX) != 0) && ((*Window)(unsafe.Pointer(pWin)).FcsrApp != 0) { + if (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(SQLITE_FUNC_MINMAX)) != 0) && ((*Window)(unsafe.Pointer(pWin)).FcsrApp != 0) { Xsqlite3VdbeAddOp1(tls, v, OP_ResetSorter, (*Window)(unsafe.Pointer(pWin)).FcsrApp) Xsqlite3VdbeAddOp2(tls, v, OP_Integer, 0, ((*Window)(unsafe.Pointer(pWin)).FregApp + 1)) @@ -134620,7 +137063,7 @@ func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sq // Return true if the current frame should be cached in the ephemeral table, // even if there are no xInverse() calls required. -func windowCacheFrame(tls *libc.TLS, pMWin uintptr) int32 { /* sqlite3.c:153141:12: */ +func windowCacheFrame(tls *libc.TLS, pMWin uintptr) int32 { /* sqlite3.c:155804:12: */ var pWin uintptr if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid != 0 { return 1 @@ -134645,7 +137088,7 @@ func windowCacheFrame(tls *libc.TLS, pMWin uintptr) int32 { /* sqlite3.c:153141: // If the two arrays are not equal, the contents of regNew is copied to // regOld and control falls through. Otherwise, if the contents of the arrays // are equal, an OP_Goto is executed. The address of the OP_Goto is returned. -func windowIfNewPeer(tls *libc.TLS, pParse uintptr, pOrderBy uintptr, regNew int32, regOld int32, addr int32) { /* sqlite3.c:153167:13: */ +func windowIfNewPeer(tls *libc.TLS, pParse uintptr, pOrderBy uintptr, regNew int32, regOld int32, addr int32) { /* sqlite3.c:155830:13: */ var v uintptr = Xsqlite3GetVdbe(tls, pParse) if pOrderBy != 0 { var nVal int32 = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr @@ -134682,7 +137125,7 @@ func windowIfNewPeer(tls *libc.TLS, pParse uintptr, pOrderBy uintptr, regNew int // A special type of arithmetic is used such that if csr1.peerVal is not // a numeric type (real or integer), then the result of the addition addition // or subtraction is a a copy of csr1.peerVal. -func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal int32, csr2 int32, lbl int32) { /* sqlite3.c:153213:13: */ +func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal int32, csr2 int32, lbl int32) { /* sqlite3.c:155876:13: */ var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse var v uintptr = Xsqlite3GetVdbe(tls, pParse) var pOrderBy uintptr = (*Window)(unsafe.Pointer((*WindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy // ORDER BY clause for window @@ -134691,6 +137134,7 @@ func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal var regString int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Reg. for constant value '' var arith int32 = OP_Add // OP_Add or OP_Subtract var addrGe int32 // Jump destination + var pColl uintptr if (int32((*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */))).FsortFlags) & KEYINFO_ORDER_DESC) != 0 { switch op { @@ -134786,7 +137230,9 @@ func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal // control skips over this test if the BIGNULL flag is set and either // reg1 or reg2 contain a NULL value. Xsqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1) - Xsqlite3VdbeChangeP5(tls, v, SQLITE_NULLEQ) + pColl = Xsqlite3ExprNNCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */))).FpExpr) + Xsqlite3VdbeAppendP4(tls, v, pColl, -2) + Xsqlite3VdbeChangeP5(tls, v, uint16(SQLITE_NULLEQ)) Xsqlite3ReleaseTempReg(tls, pParse, reg1) Xsqlite3ReleaseTempReg(tls, pParse, reg2) @@ -134797,7 +137243,7 @@ func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal // generates VM code for a single RETURN_ROW, AGGSTEP or AGGINVERSE // operation. Refer to the header comment for sqlite3WindowCodeStep() for // details. -func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOnEof int32) int32 { /* sqlite3.c:153338:12: */ +func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOnEof int32) int32 { /* sqlite3.c:156004:12: */ var csr int32 var reg int32 var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse @@ -134894,7 +137340,7 @@ func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOn if op == (*WindowCodeArg)(unsafe.Pointer(p)).FeDelete { Xsqlite3VdbeAddOp1(tls, v, OP_Delete, csr) - Xsqlite3VdbeChangeP5(tls, v, OPFLAG_SAVEPOSITION) + Xsqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } if jumpOnEof != 0 { @@ -134937,7 +137383,7 @@ func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOn // Allocate and return a duplicate of the Window object indicated by the // third argument. Set the Window.pOwner field of the new object to // pOwner. -func Xsqlite3WindowDup(tls *libc.TLS, db uintptr, pOwner uintptr, p uintptr) uintptr { /* sqlite3.c:153479:23: */ +func Xsqlite3WindowDup(tls *libc.TLS, db uintptr, pOwner uintptr, p uintptr) uintptr { /* sqlite3.c:156145:23: */ var pNew uintptr = uintptr(0) if p != 0 { pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Window{}))) @@ -134968,7 +137414,7 @@ func Xsqlite3WindowDup(tls *libc.TLS, db uintptr, pOwner uintptr, p uintptr) uin // Return a copy of the linked list of Window objects passed as the // second argument. -func Xsqlite3WindowListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:153512:23: */ +func Xsqlite3WindowListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:156178:23: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -134993,14 +137439,14 @@ func Xsqlite3WindowListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sq // // If an OOM error occurs, this function sets the Parse.db.mallocFailed // flag and returns zero. -func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:153534:12: */ +func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:156200:12: */ bp := tls.Alloc(8) defer tls.Free(8) var ret int32 = 0 var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb *(*uintptr)(unsafe.Pointer(bp /* pVal */)) = uintptr(0) - Xsqlite3ValueFromExpr(tls, db, pExpr, (*Sqlite3)(unsafe.Pointer(db)).Fenc, SQLITE_AFF_NUMERIC, bp /* &pVal */) + Xsqlite3ValueFromExpr(tls, db, pExpr, (*Sqlite3)(unsafe.Pointer(db)).Fenc, uint8(SQLITE_AFF_NUMERIC), bp /* &pVal */) if (*(*uintptr)(unsafe.Pointer(bp /* pVal */)) != 0) && (Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */))) > 0) { ret = 1 } @@ -135341,27 +137787,27 @@ func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* s // // The text above leaves out many details. Refer to the code and comments // below for a more complete picture. -func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uintptr, regGosub int32, addrGosub int32) { /* sqlite3.c:153881:21: */ +func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uintptr, regGosub int32, addrGosub int32) { /* sqlite3.c:156547:21: */ bp := tls.Alloc(64) defer tls.Free(64) var pMWin uintptr = (*Select)(unsafe.Pointer(p)).FpWin var pOrderBy uintptr = (*Window)(unsafe.Pointer(pMWin)).FpOrderBy var v uintptr = Xsqlite3GetVdbe(tls, pParse) - var csrWrite int32 // Cursor used to write to eph. table - var csrInput int32 = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FiCursor // Cursor of sub-select - var nInput int32 = int32((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab)).FnCol) // Number of cols returned by sub - var iInput int32 // To iterate through sub cols - var addrNe int32 // Address of OP_Ne - var addrGosubFlush int32 = 0 // Address of OP_Gosub to flush: - var addrInteger int32 = 0 // Address of OP_Integer - var addrEmpty int32 // Address of OP_Rewind in flush: - var regNew int32 // Array of registers holding new input row - var regRecord int32 // regNew array in record form - var regRowid int32 // Rowid for regRecord in eph table - var regNewPeer int32 = 0 // Peer values for new row (part of regNew) - var regPeer int32 = 0 // Peer values for current row - var regFlushPart int32 = 0 // Register for "Gosub flush_partition" + var csrWrite int32 // Cursor used to write to eph. table + var csrInput int32 = (*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FiCursor // Cursor of sub-select + var nInput int32 = int32((*Table)(unsafe.Pointer((*SrcItem)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */))).FpTab)).FnCol) // Number of cols returned by sub + var iInput int32 // To iterate through sub cols + var addrNe int32 // Address of OP_Ne + var addrGosubFlush int32 = 0 // Address of OP_Gosub to flush: + var addrInteger int32 = 0 // Address of OP_Integer + var addrEmpty int32 // Address of OP_Rewind in flush: + var regNew int32 // Array of registers holding new input row + var regRecord int32 // regNew array in record form + var regRowid int32 // Rowid for regRecord in eph table + var regNewPeer int32 = 0 // Peer values for new row (part of regNew) + var regPeer int32 = 0 // Peer values for current row + var regFlushPart int32 = 0 // Register for "Gosub flush_partition" // var s WindowCodeArg at bp, 64 // Context object for sub-routines var lblWhereEnd int32 // Label just before sqlite3WhereEnd() code @@ -135480,7 +137926,7 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin Xsqlite3VdbeAddOp3(tls, v, OP_Jump, (addr + 2), (addr + 4), (addr + 2)) addrGosubFlush = Xsqlite3VdbeAddOp1(tls, v, OP_Gosub, regFlushPart) - Xsqlite3VdbeComment(tls, v, ts+24477 /* "call flush_parti..." */, 0) + Xsqlite3VdbeComment(tls, v, ts+24935 /* "call flush_parti..." */, 0) Xsqlite3VdbeAddOp3(tls, v, OP_Copy, regNewPart, (*Window)(unsafe.Pointer(pMWin)).FregPart, (nPart - 1)) } @@ -135685,7 +138131,9 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin //************* End of window.c ********************************************* //************* Begin file parse.c ****************************************** -// 2000-05-29 +// This file is automatically generated by Lemon from input grammar +// source file "parse.y". +// 2001-09-15 // // The author disclaims copyright to this source code. In place of // a legal notice, here is a blessing: @@ -135695,21 +138143,14 @@ func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin // May you share freely, never taking more than you give. // // -// Driver template for the LEMON parser generator. +// This file contains SQLite's SQL parser. // -// The "lemon" program processes an LALR(1) input grammar file, then uses -// this template to construct a parser. The "lemon" program inserts text -// at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the -// interstitial "-" characters) contained in this template is changed into -// the value of the %name directive from the grammar. Otherwise, the content -// of this template is copied straight through into the generate parser -// source file. -// -// The following is the concatenation of all %include directives from the -// input grammar file: -// #include -// #include -//*********** Begin %include sections from the grammar *********************** +// The canonical source code to this file ("parse.y") is a Lemon grammar +// file that specifies the input grammar and actions to take while parsing. +// That input file is processed by Lemon to generate a C-language +// implementation of a parser for the given grammer. You might be reading +// this comment as part of the translated C-code. Edits should be made +// to the original parse.y sources. // #include "sqliteInt.h" @@ -135743,17 +138184,17 @@ type TrigEvent = struct { Fa int32 _ [4]byte Fb uintptr -} /* sqlite3.c:154286:1 */ +} /* sqlite3.c:156947:1 */ type FrameBound = struct { FeType int32 _ [4]byte FpExpr uintptr -} /* sqlite3.c:154288:1 */ +} /* sqlite3.c:156949:1 */ // Disable lookaside memory allocation for objects that might be // shared across database connections. -func disableLookaside(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:154294:13: */ +func disableLookaside(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:156955:13: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb (*Parse)(unsafe.Pointer(pParse)).FdisableLookaside++ (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ @@ -135763,43 +138204,60 @@ func disableLookaside(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:154294:13: * // For a compound SELECT statement, make sure p->pPrior->pNext==p for // all elements in the list. And make sure list length does not exceed // SQLITE_LIMIT_COMPOUND_SELECT. -func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:154327:15: */ +func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:156988:15: */ + bp := tls.Alloc(16) + defer tls.Free(16) if (*Select)(unsafe.Pointer(p)).FpPrior != 0 { var pNext uintptr = uintptr(0) - var pLoop uintptr + var pLoop uintptr = p var mxSelect int32 - var cnt int32 = 0 - pLoop = p - __1: - if !(pLoop != 0) { - goto __3 - } - { + var cnt int32 = 1 + for 1 != 0 { (*Select)(unsafe.Pointer(pLoop)).FpNext = pNext - *(*U32)(unsafe.Pointer(pLoop + 4 /* &.selFlags */)) |= (SF_Compound) - + *(*U32)(unsafe.Pointer(pLoop + 4 /* &.selFlags */)) |= (U32(SF_Compound)) + pNext = pLoop + pLoop = (*Select)(unsafe.Pointer(pLoop)).FpPrior + if pLoop == uintptr(0) { + break + } + cnt++ + if ((*Select)(unsafe.Pointer(pLoop)).FpOrderBy != 0) || ((*Select)(unsafe.Pointer(pLoop)).FpLimit != 0) { + Xsqlite3ErrorMsg(tls, pParse, ts+24956, /* "%s clause should..." */ + libc.VaList(bp, func() uintptr { + if (*Select)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { + return ts + 21741 /* "ORDER BY" */ + } + return ts + 24998 /* "LIMIT" */ + }(), + Xsqlite3SelectOpName(tls, int32((*Select)(unsafe.Pointer(pNext)).Fop)))) + break + } } - goto __2 - __2: - pNext = pLoop - pLoop = (*Select)(unsafe.Pointer(pLoop)).FpPrior - cnt++ - goto __1 - goto __3 - __3: - ; - if ((((*Select)(unsafe.Pointer(p)).FselFlags & SF_MultiValue) == U32(0)) && ((libc.AssignInt32(&mxSelect, *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + 4*4)))) > 0)) && (cnt > mxSelect) { - Xsqlite3ErrorMsg(tls, pParse, ts+24498 /* "too many terms i..." */, 0) + if ((((*Select)(unsafe.Pointer(p)).FselFlags & U32(SF_MultiValue)) == U32(0)) && ((libc.AssignInt32(&mxSelect, *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 128 /* &.aLimit */) + 4*4)))) > 0)) && (cnt > mxSelect) { + Xsqlite3ErrorMsg(tls, pParse, ts+25004 /* "too many terms i..." */, 0) } } } +// Attach a With object describing the WITH clause to a Select +// object describing the query for which the WITH clause is a prefix. +func attachWithToSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, pWith uintptr) uintptr { /* sqlite3.c:157019:17: */ + if pSelect != 0 { + (*Select)(unsafe.Pointer(pSelect)).FpWith = pWith + parserDoubleLinkSelect(tls, pParse, pSelect) + } else { + Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pWith) + } + return pSelect + +} + // Construct a new Expr object from a single identifier. Use the // new Expr to populate pOut. Set the span of pOut to be the identifier // that created the expression. -func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sqlite3.c:154350:15: */ +func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sqlite3.c:157034:15: */ bp := tls.Alloc(16) defer tls.Free(16) *(*Token)(unsafe.Pointer(bp)) = t @@ -135809,7 +138267,7 @@ func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sq // memset(p, 0, sizeof(Expr)); (*Expr)(unsafe.Pointer(p)).Fop = U8(op) (*Expr)(unsafe.Pointer(p)).FaffExpr = int8(0) - (*Expr)(unsafe.Pointer(p)).Fflags = EP_Leaf + (*Expr)(unsafe.Pointer(p)).Fflags = U32(EP_Leaf) (*Expr)(unsafe.Pointer(p)).FiAgg = int16(-1) (*Expr)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+24 /* &.pRight */, uintptr(0)) @@ -135836,7 +138294,7 @@ func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sq // A routine to convert a binary TK_IS or TK_ISNOT expression into a // unary TK_ISNULL or TK_NOTNULL expression. -func binaryToUnaryIfNull(tls *libc.TLS, pParse uintptr, pY uintptr, pA uintptr, op int32) { /* sqlite3.c:154385:15: */ +func binaryToUnaryIfNull(tls *libc.TLS, pParse uintptr, pY uintptr, pA uintptr, op int32) { /* sqlite3.c:157069:15: */ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb if (((pA != 0) && (pY != 0)) && (int32((*Expr)(unsafe.Pointer(pY)).Fop) == TK_NULL)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { (*Expr)(unsafe.Pointer(pA)).Fop = U8(op) @@ -135850,14 +138308,14 @@ func binaryToUnaryIfNull(tls *libc.TLS, pParse uintptr, pY uintptr, pA uintptr, // list of identifiers. Report an error if the ID list contains // a COLLATE clause or an ASC or DESC keyword, except ignore the // error while parsing a legacy schema. -func parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pIdToken uintptr, hasCollate int32, sortOrder int32) uintptr { /* sqlite3.c:154399:19: */ +func parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pIdToken uintptr, hasCollate int32, sortOrder int32) uintptr { /* sqlite3.c:157083:19: */ bp := tls.Alloc(16) defer tls.Free(16) var p uintptr = Xsqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if ((hasCollate != 0) || (sortOrder != -1)) && (int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0) { - Xsqlite3ErrorMsg(tls, pParse, ts+24532, /* "syntax error aft..." */ + Xsqlite3ErrorMsg(tls, pParse, ts+25038, /* "syntax error aft..." */ libc.VaList(bp, (*Token)(unsafe.Pointer(pIdToken)).Fn, (*Token)(unsafe.Pointer(pIdToken)).Fz)) } Xsqlite3ExprListSetName(tls, pParse, p, pIdToken, 1) @@ -135866,11 +138324,9 @@ func parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pIdT } //*************** End of %include directives ********************************* -// These constants specify the various numeric values for terminal symbols -// in a format understandable to "makeheaders". This section is blank unless -// "lemon" is run with the "-m" command-line option. -// Begin makeheaders token definitions ************************ -//*************** End makeheaders token definitions ************************** +// These constants specify the various numeric values for terminal symbols. +// Begin token definitions ************************************ +//*************** End token definitions ************************************** // The next sections is a series of control #defines. // various aspects of the generated parser. @@ -135927,7 +138383,7 @@ type YYMINORTYPE = struct { _ [0]uint64 Fyyinit int32 _ [12]byte -} /* sqlite3.c:154505:3 */ +} /* sqlite3.c:157372:3 */ //************ End control #defines ****************************************** // Define the yytestcase() macro to be a no-op if is not already defined @@ -135988,580 +138444,594 @@ type YYMINORTYPE = struct { // yy_default[] Default action for each state. // // Begin parsing tables ********************************************* -var yy_action = [1962]uint16{ - /* 0 */ uint16(546), uint16(1222), uint16(546), uint16(451), uint16(1260), uint16(546), uint16(1239), uint16(546), uint16(114), uint16(111), - /* 10 */ uint16(211), uint16(546), uint16(1537), uint16(546), uint16(1260), uint16(523), uint16(114), uint16(111), uint16(211), uint16(392), - /* 20 */ uint16(1232), uint16(344), uint16(42), uint16(42), uint16(42), uint16(42), uint16(1225), uint16(42), uint16(42), uint16(71), - /* 30 */ uint16(71), uint16(937), uint16(1224), uint16(71), uint16(71), uint16(71), uint16(71), uint16(1462), uint16(1493), uint16(938), - /* 40 */ uint16(820), uint16(453), uint16(6), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), - /* 50 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(1543), uint16(392), - /* 60 */ uint16(1358), uint16(1517), uint16(552), uint16(2), uint16(1193), uint16(194), uint16(528), uint16(436), uint16(143), uint16(291), - /* 70 */ uint16(528), uint16(136), uint16(528), uint16(371), uint16(261), uint16(504), uint16(272), uint16(385), uint16(1273), uint16(527), - /* 80 */ uint16(503), uint16(493), uint16(164), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), - /* 90 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(1358), uint16(442), - /* 100 */ uint16(1514), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), - /* 110 */ uint16(115), uint16(424), uint16(266), uint16(266), uint16(266), uint16(266), uint16(1498), uint16(358), uint16(1500), uint16(435), - /* 120 */ uint16(357), uint16(1498), uint16(517), uint16(524), uint16(1485), uint16(543), uint16(1114), uint16(543), uint16(1114), uint16(392), - /* 130 */ uint16(405), uint16(241), uint16(208), uint16(114), uint16(111), uint16(211), uint16(98), uint16(290), uint16(537), uint16(221), - /* 140 */ uint16(1029), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), - /* 150 */ uint16(115), uint16(424), uint16(1142), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), - /* 160 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(406), uint16(428), - /* 170 */ uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(1418), uint16(468), uint16(123), - /* 180 */ uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), - /* 190 */ uint16(424), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(540), uint16(540), uint16(540), uint16(392), - /* 200 */ uint16(505), uint16(120), uint16(120), uint16(120), uint16(120), uint16(113), uint16(1051), uint16(1142), uint16(1143), uint16(1144), - /* 210 */ uint16(1051), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), - /* 220 */ uint16(115), uint16(424), uint16(1461), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), - /* 230 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(392), uint16(444), - /* 240 */ uint16(316), uint16(83), uint16(463), uint16(81), uint16(359), uint16(382), uint16(1142), uint16(80), uint16(118), uint16(118), - /* 250 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(179), - /* 260 */ uint16(434), uint16(424), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), - /* 270 */ uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(434), uint16(433), uint16(266), - /* 280 */ uint16(266), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), - /* 290 */ uint16(115), uint16(424), uint16(543), uint16(1109), uint16(903), uint16(506), uint16(1142), uint16(114), uint16(111), uint16(211), - /* 300 */ uint16(1431), uint16(1142), uint16(1143), uint16(1144), uint16(206), uint16(491), uint16(1109), uint16(392), uint16(449), uint16(1109), - /* 310 */ uint16(545), uint16(330), uint16(120), uint16(120), uint16(120), uint16(120), uint16(298), uint16(1431), uint16(1433), uint16(17), - /* 320 */ uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), - /* 330 */ uint16(424), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), - /* 340 */ uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(392), uint16(1358), uint16(434), uint16(1142), - /* 350 */ uint16(482), uint16(1142), uint16(1143), uint16(1144), uint16(996), uint16(996), uint16(1007), uint16(1010), uint16(445), uint16(118), - /* 360 */ uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), - /* 370 */ uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), - /* 380 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(1054), uint16(1054), uint16(465), uint16(1431), uint16(118), - /* 390 */ uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), - /* 400 */ uint16(1142), uint16(451), uint16(546), uint16(1426), uint16(1142), uint16(1143), uint16(1144), uint16(233), uint16(966), uint16(1142), - /* 410 */ uint16(481), uint16(478), uint16(477), uint16(171), uint16(360), uint16(392), uint16(164), uint16(407), uint16(414), uint16(842), - /* 420 */ uint16(476), uint16(164), uint16(185), uint16(334), uint16(71), uint16(71), uint16(1243), uint16(1000), uint16(118), uint16(118), - /* 430 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(121), - /* 440 */ uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), - /* 450 */ uint16(120), uint16(120), uint16(120), uint16(120), uint16(392), uint16(1142), uint16(1143), uint16(1144), uint16(835), uint16(12), - /* 460 */ uint16(314), uint16(509), uint16(163), uint16(356), uint16(1142), uint16(1143), uint16(1144), uint16(114), uint16(111), uint16(211), - /* 470 */ uint16(508), uint16(290), uint16(537), uint16(546), uint16(276), uint16(180), uint16(290), uint16(537), uint16(121), uint16(122), - /* 480 */ uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), - /* 490 */ uint16(120), uint16(120), uint16(120), uint16(345), uint16(484), uint16(71), uint16(71), uint16(118), uint16(118), uint16(118), - /* 500 */ uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(1142), uint16(209), - /* 510 */ uint16(411), uint16(523), uint16(1142), uint16(1109), uint16(1571), uint16(378), uint16(252), uint16(269), uint16(342), uint16(487), - /* 520 */ uint16(337), uint16(486), uint16(238), uint16(392), uint16(513), uint16(364), uint16(1109), uint16(1127), uint16(333), uint16(1109), - /* 530 */ uint16(191), uint16(409), uint16(286), uint16(32), uint16(457), uint16(443), uint16(118), uint16(118), uint16(118), uint16(118), - /* 540 */ uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(121), uint16(122), uint16(112), - /* 550 */ uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), - /* 560 */ uint16(120), uint16(120), uint16(392), uint16(1142), uint16(1143), uint16(1144), uint16(987), uint16(1142), uint16(1143), uint16(1144), - /* 570 */ uint16(1142), uint16(233), uint16(492), uint16(1492), uint16(481), uint16(478), uint16(477), uint16(6), uint16(163), uint16(546), - /* 580 */ uint16(512), uint16(546), uint16(115), uint16(424), uint16(476), uint16(5), uint16(121), uint16(122), uint16(112), uint16(1165), - /* 590 */ uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), - /* 600 */ uint16(120), uint16(13), uint16(13), uint16(13), uint16(13), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), - /* 610 */ uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(403), uint16(502), uint16(408), uint16(546), - /* 620 */ uint16(1486), uint16(544), uint16(1142), uint16(892), uint16(892), uint16(1142), uint16(1143), uint16(1144), uint16(1473), uint16(1142), - /* 630 */ uint16(275), uint16(392), uint16(808), uint16(809), uint16(810), uint16(971), uint16(422), uint16(422), uint16(422), uint16(16), - /* 640 */ uint16(16), uint16(55), uint16(55), uint16(1242), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), - /* 650 */ uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), - /* 660 */ uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), - /* 670 */ uint16(392), uint16(1189), uint16(1), uint16(1), uint16(552), uint16(2), uint16(1193), uint16(1142), uint16(1143), uint16(1144), - /* 680 */ uint16(194), uint16(291), uint16(898), uint16(136), uint16(1142), uint16(1143), uint16(1144), uint16(897), uint16(521), uint16(1492), - /* 690 */ uint16(1273), uint16(3), uint16(380), uint16(6), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), - /* 700 */ uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(858), - /* 710 */ uint16(546), uint16(924), uint16(546), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), - /* 720 */ uint16(116), uint16(116), uint16(115), uint16(424), uint16(266), uint16(266), uint16(1092), uint16(1569), uint16(1142), uint16(551), - /* 730 */ uint16(1569), uint16(1193), uint16(13), uint16(13), uint16(13), uint16(13), uint16(291), uint16(543), uint16(136), uint16(392), - /* 740 */ uint16(485), uint16(421), uint16(420), uint16(966), uint16(344), uint16(1273), uint16(468), uint16(410), uint16(859), uint16(279), - /* 750 */ uint16(140), uint16(221), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), - /* 760 */ uint16(116), uint16(115), uint16(424), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), - /* 770 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(546), uint16(266), - /* 780 */ uint16(266), uint16(428), uint16(392), uint16(1142), uint16(1143), uint16(1144), uint16(1172), uint16(830), uint16(1172), uint16(468), - /* 790 */ uint16(431), uint16(145), uint16(543), uint16(1146), uint16(401), uint16(314), uint16(439), uint16(302), uint16(838), uint16(1490), - /* 800 */ uint16(71), uint16(71), uint16(412), uint16(6), uint16(1090), uint16(473), uint16(221), uint16(100), uint16(112), uint16(1165), - /* 810 */ uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), - /* 820 */ uint16(120), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), - /* 830 */ uint16(115), uint16(424), uint16(237), uint16(1425), uint16(546), uint16(451), uint16(428), uint16(287), uint16(986), uint16(546), - /* 840 */ uint16(236), uint16(235), uint16(234), uint16(830), uint16(97), uint16(529), uint16(429), uint16(1265), uint16(1265), uint16(1146), - /* 850 */ uint16(494), uint16(307), uint16(430), uint16(838), uint16(977), uint16(546), uint16(71), uint16(71), uint16(976), uint16(1241), - /* 860 */ uint16(546), uint16(51), uint16(51), uint16(300), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), - /* 870 */ uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(194), uint16(103), uint16(70), uint16(70), uint16(266), - /* 880 */ uint16(266), uint16(546), uint16(71), uint16(71), uint16(266), uint16(266), uint16(30), uint16(391), uint16(344), uint16(976), - /* 890 */ uint16(976), uint16(978), uint16(543), uint16(528), uint16(1109), uint16(328), uint16(392), uint16(543), uint16(495), uint16(397), - /* 900 */ uint16(1470), uint16(195), uint16(530), uint16(13), uint16(13), uint16(1358), uint16(240), uint16(1109), uint16(277), uint16(280), - /* 910 */ uint16(1109), uint16(280), uint16(304), uint16(457), uint16(306), uint16(333), uint16(392), uint16(31), uint16(188), uint16(419), - /* 920 */ uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), - /* 930 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(142), uint16(392), uint16(365), uint16(457), uint16(986), - /* 940 */ uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), - /* 950 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(977), uint16(323), uint16(1142), uint16(326), uint16(976), - /* 960 */ uint16(121), uint16(110), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), - /* 970 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(464), uint16(377), uint16(1185), uint16(118), uint16(118), - /* 980 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(1142), - /* 990 */ uint16(976), uint16(976), uint16(978), uint16(305), uint16(9), uint16(366), uint16(244), uint16(362), uint16(118), uint16(118), - /* 1000 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(313), - /* 1010 */ uint16(546), uint16(344), uint16(1142), uint16(1143), uint16(1144), uint16(299), uint16(290), uint16(537), uint16(118), uint16(118), - /* 1020 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(1263), - /* 1030 */ uint16(1263), uint16(1163), uint16(13), uint16(13), uint16(278), uint16(421), uint16(420), uint16(468), uint16(392), uint16(923), - /* 1040 */ uint16(260), uint16(260), uint16(289), uint16(1169), uint16(1142), uint16(1143), uint16(1144), uint16(189), uint16(1171), uint16(266), - /* 1050 */ uint16(266), uint16(468), uint16(390), uint16(543), uint16(1186), uint16(546), uint16(1170), uint16(263), uint16(144), uint16(489), - /* 1060 */ uint16(922), uint16(546), uint16(543), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), - /* 1070 */ uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(71), uint16(71), uint16(1142), - /* 1080 */ uint16(1172), uint16(1272), uint16(1172), uint16(13), uint16(13), uint16(898), uint16(1070), uint16(1163), uint16(546), uint16(468), - /* 1090 */ uint16(897), uint16(107), uint16(538), uint16(1491), uint16(4), uint16(1268), uint16(1109), uint16(6), uint16(525), uint16(1049), - /* 1100 */ uint16(12), uint16(1071), uint16(1092), uint16(1570), uint16(312), uint16(455), uint16(1570), uint16(520), uint16(541), uint16(1109), - /* 1110 */ uint16(56), uint16(56), uint16(1109), uint16(1489), uint16(423), uint16(1358), uint16(1072), uint16(6), uint16(345), uint16(285), - /* 1120 */ uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), - /* 1130 */ uint16(424), uint16(425), uint16(1271), uint16(321), uint16(1142), uint16(1143), uint16(1144), uint16(878), uint16(266), uint16(266), - /* 1140 */ uint16(1277), uint16(107), uint16(538), uint16(535), uint16(4), uint16(1488), uint16(293), uint16(879), uint16(1211), uint16(6), - /* 1150 */ uint16(210), uint16(543), uint16(543), uint16(164), uint16(294), uint16(496), uint16(416), uint16(204), uint16(541), uint16(267), - /* 1160 */ uint16(267), uint16(1214), uint16(398), uint16(511), uint16(499), uint16(204), uint16(266), uint16(266), uint16(396), uint16(531), - /* 1170 */ uint16(8), uint16(986), uint16(543), uint16(519), uint16(546), uint16(922), uint16(458), uint16(105), uint16(105), uint16(543), - /* 1180 */ uint16(1090), uint16(425), uint16(266), uint16(266), uint16(106), uint16(417), uint16(425), uint16(548), uint16(547), uint16(266), - /* 1190 */ uint16(266), uint16(976), uint16(518), uint16(535), uint16(1373), uint16(543), uint16(15), uint16(15), uint16(266), uint16(266), - /* 1200 */ uint16(456), uint16(1120), uint16(543), uint16(266), uint16(266), uint16(1070), uint16(1372), uint16(515), uint16(290), uint16(537), - /* 1210 */ uint16(546), uint16(543), uint16(514), uint16(97), uint16(444), uint16(316), uint16(543), uint16(546), uint16(922), uint16(125), - /* 1220 */ uint16(1071), uint16(986), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(105), uint16(105), uint16(401), - /* 1230 */ uint16(343), uint16(1511), uint16(44), uint16(44), uint16(106), uint16(1072), uint16(425), uint16(548), uint16(547), uint16(57), - /* 1240 */ uint16(57), uint16(976), uint16(343), uint16(1511), uint16(107), uint16(538), uint16(546), uint16(4), uint16(462), uint16(401), - /* 1250 */ uint16(214), uint16(1120), uint16(459), uint16(297), uint16(377), uint16(1091), uint16(534), uint16(1309), uint16(546), uint16(539), - /* 1260 */ uint16(398), uint16(541), uint16(290), uint16(537), uint16(104), uint16(244), uint16(102), uint16(526), uint16(58), uint16(58), - /* 1270 */ uint16(546), uint16(199), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(1516), uint16(1131), uint16(427), - /* 1280 */ uint16(59), uint16(59), uint16(270), uint16(237), uint16(425), uint16(138), uint16(95), uint16(375), uint16(375), uint16(374), - /* 1290 */ uint16(255), uint16(372), uint16(60), uint16(60), uint16(817), uint16(1180), uint16(535), uint16(546), uint16(273), uint16(546), - /* 1300 */ uint16(1163), uint16(1308), uint16(389), uint16(388), uint16(546), uint16(438), uint16(546), uint16(215), uint16(210), uint16(296), - /* 1310 */ uint16(515), uint16(849), uint16(546), uint16(265), uint16(208), uint16(516), uint16(1476), uint16(295), uint16(274), uint16(61), - /* 1320 */ uint16(61), uint16(62), uint16(62), uint16(308), uint16(986), uint16(109), uint16(45), uint16(45), uint16(46), uint16(46), - /* 1330 */ uint16(105), uint16(105), uint16(1186), uint16(922), uint16(47), uint16(47), uint16(341), uint16(106), uint16(546), uint16(425), - /* 1340 */ uint16(548), uint16(547), uint16(1542), uint16(546), uint16(976), uint16(867), uint16(340), uint16(217), uint16(546), uint16(937), - /* 1350 */ uint16(397), uint16(107), uint16(538), uint16(218), uint16(4), uint16(156), uint16(1163), uint16(938), uint16(158), uint16(546), - /* 1360 */ uint16(49), uint16(49), uint16(1162), uint16(546), uint16(268), uint16(50), uint16(50), uint16(546), uint16(541), uint16(1450), - /* 1370 */ uint16(63), uint16(63), uint16(546), uint16(1449), uint16(216), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), - /* 1380 */ uint16(446), uint16(64), uint16(64), uint16(546), uint16(460), uint16(65), uint16(65), uint16(546), uint16(318), uint16(14), - /* 1390 */ uint16(14), uint16(425), uint16(1305), uint16(546), uint16(66), uint16(66), uint16(1087), uint16(546), uint16(141), uint16(379), - /* 1400 */ uint16(38), uint16(546), uint16(963), uint16(535), uint16(322), uint16(127), uint16(127), uint16(546), uint16(393), uint16(67), - /* 1410 */ uint16(67), uint16(546), uint16(325), uint16(290), uint16(537), uint16(52), uint16(52), uint16(515), uint16(546), uint16(68), - /* 1420 */ uint16(68), uint16(845), uint16(514), uint16(69), uint16(69), uint16(399), uint16(165), uint16(857), uint16(856), uint16(53), - /* 1430 */ uint16(53), uint16(986), uint16(311), uint16(151), uint16(151), uint16(97), uint16(432), uint16(105), uint16(105), uint16(327), - /* 1440 */ uint16(152), uint16(152), uint16(526), uint16(1048), uint16(106), uint16(1048), uint16(425), uint16(548), uint16(547), uint16(1131), - /* 1450 */ uint16(427), uint16(976), uint16(1032), uint16(270), uint16(968), uint16(239), uint16(329), uint16(243), uint16(375), uint16(375), - /* 1460 */ uint16(374), uint16(255), uint16(372), uint16(940), uint16(941), uint16(817), uint16(1296), uint16(546), uint16(220), uint16(546), - /* 1470 */ uint16(107), uint16(538), uint16(546), uint16(4), uint16(546), uint16(1256), uint16(199), uint16(845), uint16(215), uint16(1036), - /* 1480 */ uint16(296), uint16(1530), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(541), uint16(295), uint16(76), - /* 1490 */ uint16(76), uint16(54), uint16(54), uint16(980), uint16(72), uint16(72), uint16(128), uint16(128), uint16(864), uint16(865), - /* 1500 */ uint16(107), uint16(538), uint16(546), uint16(4), uint16(1047), uint16(546), uint16(1047), uint16(533), uint16(469), uint16(546), - /* 1510 */ uint16(425), uint16(546), uint16(450), uint16(1240), uint16(546), uint16(243), uint16(546), uint16(541), uint16(217), uint16(546), - /* 1520 */ uint16(452), uint16(197), uint16(535), uint16(243), uint16(73), uint16(73), uint16(156), uint16(129), uint16(129), uint16(158), - /* 1530 */ uint16(336), uint16(130), uint16(130), uint16(126), uint16(126), uint16(1036), uint16(150), uint16(150), uint16(149), uint16(149), - /* 1540 */ uint16(425), uint16(134), uint16(134), uint16(317), uint16(474), uint16(216), uint16(97), uint16(239), uint16(331), uint16(980), - /* 1550 */ uint16(986), uint16(97), uint16(535), uint16(346), uint16(347), uint16(546), uint16(105), uint16(105), uint16(902), uint16(931), - /* 1560 */ uint16(546), uint16(895), uint16(243), uint16(106), uint16(109), uint16(425), uint16(548), uint16(547), uint16(546), uint16(1505), - /* 1570 */ uint16(976), uint16(828), uint16(99), uint16(538), uint16(139), uint16(4), uint16(546), uint16(133), uint16(133), uint16(393), - /* 1580 */ uint16(986), uint16(1317), uint16(131), uint16(131), uint16(290), uint16(537), uint16(105), uint16(105), uint16(1357), uint16(541), - /* 1590 */ uint16(132), uint16(132), uint16(1292), uint16(106), uint16(1303), uint16(425), uint16(548), uint16(547), uint16(75), uint16(75), - /* 1600 */ uint16(976), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(546), uint16(432), uint16(896), uint16(1289), - /* 1610 */ uint16(532), uint16(109), uint16(425), uint16(1363), uint16(546), uint16(1221), uint16(1213), uint16(1202), uint16(258), uint16(546), - /* 1620 */ uint16(349), uint16(546), uint16(1201), uint16(11), uint16(535), uint16(1203), uint16(1524), uint16(351), uint16(77), uint16(77), - /* 1630 */ uint16(376), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(74), uint16(74), uint16(353), uint16(213), - /* 1640 */ uint16(301), uint16(43), uint16(43), uint16(48), uint16(48), uint16(437), uint16(310), uint16(201), uint16(303), uint16(1350), - /* 1650 */ uint16(315), uint16(355), uint16(986), uint16(454), uint16(479), uint16(1239), uint16(339), uint16(192), uint16(105), uint16(105), - /* 1660 */ uint16(1422), uint16(1421), uint16(193), uint16(536), uint16(205), uint16(106), uint16(1527), uint16(425), uint16(548), uint16(547), - /* 1670 */ uint16(1180), uint16(167), uint16(976), uint16(270), uint16(247), uint16(1469), uint16(1467), uint16(1177), uint16(375), uint16(375), - /* 1680 */ uint16(374), uint16(255), uint16(372), uint16(200), uint16(369), uint16(817), uint16(400), uint16(83), uint16(79), uint16(82), - /* 1690 */ uint16(1427), uint16(448), uint16(177), uint16(95), uint16(1342), uint16(161), uint16(169), uint16(1339), uint16(215), uint16(440), - /* 1700 */ uint16(296), uint16(172), uint16(173), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(295), uint16(174), - /* 1710 */ uint16(175), uint16(441), uint16(472), uint16(223), uint16(1347), uint16(383), uint16(35), uint16(381), uint16(36), uint16(461), - /* 1720 */ uint16(88), uint16(1353), uint16(181), uint16(447), uint16(384), uint16(1416), uint16(227), uint16(467), uint16(259), uint16(229), - /* 1730 */ uint16(186), uint16(488), uint16(470), uint16(324), uint16(1250), uint16(230), uint16(231), uint16(320), uint16(217), uint16(1204), - /* 1740 */ uint16(1438), uint16(1259), uint16(386), uint16(1258), uint16(413), uint16(90), uint16(156), uint16(849), uint16(1541), uint16(158), - /* 1750 */ uint16(206), uint16(415), uint16(1540), uint16(507), uint16(1300), uint16(1257), uint16(94), uint16(348), uint16(1229), uint16(1301), - /* 1760 */ uint16(387), uint16(1510), uint16(1228), uint16(338), uint16(1227), uint16(216), uint16(350), uint16(1539), uint16(498), uint16(283), - /* 1770 */ uint16(284), uint16(1249), uint16(501), uint16(1299), uint16(352), uint16(245), uint16(246), uint16(418), uint16(1298), uint16(354), - /* 1780 */ uint16(1496), uint16(1495), uint16(124), uint16(10), uint16(526), uint16(363), uint16(101), uint16(1324), uint16(253), uint16(96), - /* 1790 */ uint16(510), uint16(1210), uint16(34), uint16(549), uint16(1137), uint16(254), uint16(256), uint16(257), uint16(166), uint16(393), - /* 1800 */ uint16(550), uint16(1199), uint16(1282), uint16(361), uint16(290), uint16(537), uint16(1281), uint16(196), uint16(367), uint16(368), - /* 1810 */ uint16(1194), uint16(153), uint16(1454), uint16(137), uint16(281), uint16(1323), uint16(1455), uint16(804), uint16(154), uint16(426), - /* 1820 */ uint16(198), uint16(155), uint16(1453), uint16(1452), uint16(292), uint16(212), uint16(202), uint16(432), uint16(1402), uint16(203), - /* 1830 */ uint16(271), uint16(135), uint16(288), uint16(78), uint16(1046), uint16(1044), uint16(960), uint16(168), uint16(157), uint16(881), - /* 1840 */ uint16(170), uint16(219), uint16(309), uint16(222), uint16(1060), uint16(176), uint16(964), uint16(159), uint16(402), uint16(84), - /* 1850 */ uint16(178), uint16(404), uint16(85), uint16(86), uint16(87), uint16(160), uint16(1063), uint16(224), uint16(394), uint16(395), - /* 1860 */ uint16(225), uint16(1059), uint16(146), uint16(18), uint16(226), uint16(319), uint16(243), uint16(1174), uint16(466), uint16(228), - /* 1870 */ uint16(1052), uint16(182), uint16(183), uint16(37), uint16(819), uint16(471), uint16(340), uint16(232), uint16(332), uint16(483), - /* 1880 */ uint16(184), uint16(89), uint16(162), uint16(19), uint16(20), uint16(475), uint16(91), uint16(480), uint16(847), uint16(335), - /* 1890 */ uint16(147), uint16(860), uint16(282), uint16(92), uint16(490), uint16(93), uint16(1125), uint16(148), uint16(1012), uint16(1095), - /* 1900 */ uint16(39), uint16(497), uint16(1096), uint16(40), uint16(500), uint16(262), uint16(207), uint16(264), uint16(930), uint16(187), - /* 1910 */ uint16(925), uint16(109), uint16(1111), uint16(1115), uint16(1113), uint16(7), uint16(1099), uint16(242), uint16(33), uint16(1119), - /* 1920 */ uint16(21), uint16(522), uint16(22), uint16(23), uint16(24), uint16(1118), uint16(25), uint16(190), uint16(97), uint16(26), - /* 1930 */ uint16(1027), uint16(1013), uint16(1011), uint16(1015), uint16(1069), uint16(1016), uint16(1068), uint16(249), uint16(248), uint16(28), - /* 1940 */ uint16(41), uint16(891), uint16(981), uint16(829), uint16(108), uint16(29), uint16(250), uint16(542), uint16(251), uint16(370), - /* 1950 */ uint16(373), uint16(1133), uint16(1132), uint16(1190), uint16(1190), uint16(1190), uint16(1190), uint16(1190), uint16(1190), uint16(1190), - /* 1960 */ uint16(1532), uint16(1531), -} /* sqlite3.c:154599:27 */ -var yy_lookahead = [2143]uint16{ - /* 0 */ uint16(189), uint16(211), uint16(189), uint16(189), uint16(218), uint16(189), uint16(220), uint16(189), uint16(267), uint16(268), - /* 10 */ uint16(269), uint16(189), uint16(210), uint16(189), uint16(228), uint16(189), uint16(267), uint16(268), uint16(269), uint16(19), - /* 20 */ uint16(218), uint16(189), uint16(211), uint16(212), uint16(211), uint16(212), uint16(211), uint16(211), uint16(212), uint16(211), - /* 30 */ uint16(212), uint16(31), uint16(211), uint16(211), uint16(212), uint16(211), uint16(212), uint16(288), uint16(300), uint16(39), - /* 40 */ uint16(21), uint16(189), uint16(304), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), - /* 50 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(225), uint16(19), - /* 60 */ uint16(189), uint16(183), uint16(184), uint16(185), uint16(186), uint16(189), uint16(248), uint16(263), uint16(236), uint16(191), - /* 70 */ uint16(248), uint16(193), uint16(248), uint16(197), uint16(208), uint16(257), uint16(262), uint16(201), uint16(200), uint16(257), - /* 80 */ uint16(200), uint16(257), uint16(81), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), - /* 90 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(189), uint16(80), - /* 100 */ uint16(189), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), - /* 110 */ uint16(110), uint16(111), uint16(234), uint16(235), uint16(234), uint16(235), uint16(305), uint16(306), uint16(305), uint16(118), - /* 120 */ uint16(307), uint16(305), uint16(306), uint16(297), uint16(298), uint16(247), uint16(86), uint16(247), uint16(88), uint16(19), - /* 130 */ uint16(259), uint16(251), uint16(252), uint16(267), uint16(268), uint16(269), uint16(26), uint16(136), uint16(137), uint16(261), - /* 140 */ uint16(121), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), - /* 150 */ uint16(110), uint16(111), uint16(59), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), - /* 160 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(259), uint16(291), - /* 170 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(158), uint16(189), uint16(69), - /* 180 */ uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), - /* 190 */ uint16(111), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(205), uint16(206), uint16(207), uint16(19), - /* 200 */ uint16(19), uint16(54), uint16(55), uint16(56), uint16(57), uint16(58), uint16(29), uint16(114), uint16(115), uint16(116), - /* 210 */ uint16(33), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), - /* 220 */ uint16(110), uint16(111), uint16(233), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), - /* 230 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(126), - /* 240 */ uint16(127), uint16(148), uint16(65), uint16(24), uint16(214), uint16(200), uint16(59), uint16(67), uint16(101), uint16(102), - /* 250 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(22), - /* 260 */ uint16(189), uint16(111), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), - /* 270 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(206), uint16(207), uint16(234), - /* 280 */ uint16(235), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), - /* 290 */ uint16(110), uint16(111), uint16(247), uint16(76), uint16(107), uint16(114), uint16(59), uint16(267), uint16(268), uint16(269), - /* 300 */ uint16(189), uint16(114), uint16(115), uint16(116), uint16(162), uint16(163), uint16(89), uint16(19), uint16(263), uint16(92), - /* 310 */ uint16(189), uint16(23), uint16(54), uint16(55), uint16(56), uint16(57), uint16(189), uint16(206), uint16(207), uint16(22), - /* 320 */ uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), - /* 330 */ uint16(111), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), - /* 340 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(189), uint16(277), uint16(59), - /* 350 */ uint16(23), uint16(114), uint16(115), uint16(116), uint16(46), uint16(47), uint16(48), uint16(49), uint16(61), uint16(101), - /* 360 */ uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), - /* 370 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), - /* 380 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(125), uint16(126), uint16(127), uint16(277), uint16(101), - /* 390 */ uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), - /* 400 */ uint16(59), uint16(189), uint16(189), uint16(276), uint16(114), uint16(115), uint16(116), uint16(117), uint16(73), uint16(59), - /* 410 */ uint16(120), uint16(121), uint16(122), uint16(72), uint16(214), uint16(19), uint16(81), uint16(259), uint16(19), uint16(23), - /* 420 */ uint16(130), uint16(81), uint16(72), uint16(24), uint16(211), uint16(212), uint16(221), uint16(119), uint16(101), uint16(102), - /* 430 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(43), +var yy_action = [2020]uint16{ + /* 0 */ uint16(563), uint16(1295), uint16(563), uint16(1274), uint16(168), uint16(361), uint16(115), uint16(112), uint16(218), uint16(373), + /* 10 */ uint16(563), uint16(1295), uint16(374), uint16(563), uint16(488), uint16(563), uint16(115), uint16(112), uint16(218), uint16(406), + /* 20 */ uint16(1300), uint16(1300), uint16(41), uint16(41), uint16(41), uint16(41), uint16(514), uint16(1504), uint16(520), uint16(1298), + /* 30 */ uint16(1298), uint16(959), uint16(41), uint16(41), uint16(1257), uint16(71), uint16(71), uint16(51), uint16(51), uint16(960), + /* 40 */ uint16(557), uint16(557), uint16(557), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), + /* 50 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(414), uint16(406), + /* 60 */ uint16(273), uint16(273), uint16(273), uint16(273), uint16(115), uint16(112), uint16(218), uint16(115), uint16(112), uint16(218), + /* 70 */ uint16(197), uint16(268), uint16(545), uint16(560), uint16(515), uint16(560), uint16(1260), uint16(563), uint16(385), uint16(248), + /* 80 */ uint16(215), uint16(521), uint16(399), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), + /* 90 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(540), uint16(13), + /* 100 */ uint16(13), uint16(1259), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), + /* 110 */ uint16(117), uint16(116), uint16(441), uint16(1176), uint16(419), uint16(1531), uint16(446), uint16(137), uint16(512), uint16(1539), + /* 120 */ uint16(1545), uint16(372), uint16(1547), uint16(6), uint16(371), uint16(1176), uint16(1148), uint16(1584), uint16(1148), uint16(406), + /* 130 */ uint16(1545), uint16(534), uint16(115), uint16(112), uint16(218), uint16(1267), uint16(99), uint16(441), uint16(121), uint16(121), + /* 140 */ uint16(121), uint16(121), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), + /* 150 */ uint16(117), uint16(116), uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), + /* 160 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(197), uint16(1176), + /* 170 */ uint16(1177), uint16(1178), uint16(241), uint16(304), uint16(554), uint16(501), uint16(498), uint16(497), uint16(473), uint16(124), + /* 180 */ uint16(394), uint16(1176), uint16(1177), uint16(1178), uint16(1176), uint16(496), uint16(119), uint16(119), uint16(119), uint16(119), + /* 190 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(139), uint16(540), uint16(406), + /* 200 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(114), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), + /* 210 */ uint16(541), uint16(1532), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), + /* 220 */ uint16(117), uint16(116), uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), + /* 230 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(406), uint16(320), + /* 240 */ uint16(1176), uint16(1177), uint16(1178), uint16(81), uint16(342), uint16(1590), uint16(396), uint16(80), uint16(119), uint16(119), + /* 250 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(1176), + /* 260 */ uint16(211), uint16(450), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), + /* 270 */ uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(251), uint16(450), uint16(449), + /* 280 */ uint16(273), uint16(273), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), + /* 290 */ uint16(117), uint16(116), uint16(441), uint16(560), uint16(1224), uint16(1), uint16(1), uint16(569), uint16(2), uint16(1228), + /* 300 */ uint16(317), uint16(1176), uint16(319), uint16(1561), uint16(305), uint16(337), uint16(140), uint16(340), uint16(406), uint16(430), + /* 310 */ uint16(469), uint16(1533), uint16(1197), uint16(1308), uint16(348), uint16(1176), uint16(1177), uint16(1178), uint16(168), uint16(462), + /* 320 */ uint16(330), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), + /* 330 */ uint16(116), uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), + /* 340 */ uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(273), uint16(273), uint16(563), + /* 350 */ uint16(83), uint16(450), uint16(416), uint16(1564), uint16(569), uint16(2), uint16(1228), uint16(1176), uint16(1177), uint16(1178), + /* 360 */ uint16(560), uint16(305), uint16(471), uint16(140), uint16(944), uint16(995), uint16(860), uint16(563), uint16(467), uint16(1197), + /* 370 */ uint16(1308), uint16(13), uint16(13), uint16(137), uint16(229), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), + /* 380 */ uint16(116), uint16(441), uint16(96), uint16(318), uint16(946), uint16(504), uint16(424), uint16(361), uint16(562), uint16(71), + /* 390 */ uint16(71), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), + /* 400 */ uint16(116), uint16(441), uint16(427), uint16(205), uint16(273), uint16(273), uint16(445), uint16(1015), uint16(259), uint16(276), + /* 410 */ uint16(356), uint16(507), uint16(351), uint16(506), uint16(246), uint16(406), uint16(959), uint16(560), uint16(328), uint16(344), + /* 420 */ uint16(347), uint16(315), uint16(860), uint16(1006), uint16(960), uint16(126), uint16(545), uint16(1005), uint16(313), uint16(304), + /* 430 */ uint16(554), uint16(229), uint16(538), uint16(1539), uint16(148), uint16(544), uint16(281), uint16(6), uint16(203), uint16(122), + /* 440 */ uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), + /* 450 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(563), uint16(217), uint16(563), uint16(12), uint16(406), uint16(1005), + /* 460 */ uint16(1005), uint16(1007), uint16(502), uint16(445), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), + /* 470 */ uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(452), uint16(71), uint16(71), uint16(70), uint16(70), + /* 480 */ uint16(944), uint16(137), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), + /* 490 */ uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(1530), uint16(119), uint16(119), + /* 500 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(403), + /* 510 */ uint16(402), uint16(241), uint16(1176), uint16(545), uint16(501), uint16(498), uint16(497), uint16(1468), uint16(1143), uint16(451), + /* 520 */ uint16(267), uint16(267), uint16(513), uint16(1540), uint16(496), uint16(142), uint16(1176), uint16(6), uint16(406), uint16(530), + /* 530 */ uint16(194), uint16(1143), uint16(864), uint16(560), uint16(1143), uint16(461), uint16(182), uint16(304), uint16(554), uint16(32), + /* 540 */ uint16(379), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), + /* 550 */ uint16(116), uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), + /* 560 */ uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(406), uint16(1176), uint16(1177), + /* 570 */ uint16(1178), uint16(857), uint16(568), uint16(1176), uint16(1228), uint16(925), uint16(1176), uint16(454), uint16(361), uint16(305), + /* 580 */ uint16(189), uint16(140), uint16(1176), uint16(1177), uint16(1178), uint16(519), uint16(529), uint16(404), uint16(1308), uint16(183), + /* 590 */ uint16(1015), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), + /* 600 */ uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(1006), uint16(16), uint16(16), uint16(370), + /* 610 */ uint16(1005), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), + /* 620 */ uint16(116), uint16(441), uint16(273), uint16(273), uint16(1537), uint16(150), uint16(1176), uint16(98), uint16(6), uint16(1176), + /* 630 */ uint16(1177), uint16(1178), uint16(1176), uint16(1177), uint16(1178), uint16(560), uint16(380), uint16(406), uint16(376), uint16(438), + /* 640 */ uint16(437), uint16(1161), uint16(1005), uint16(1005), uint16(1007), uint16(1025), uint16(1025), uint16(1036), uint16(1039), uint16(229), + /* 650 */ uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), + /* 660 */ uint16(441), uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), + /* 670 */ uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(406), uint16(1143), uint16(1619), uint16(392), + /* 680 */ uint16(1016), uint16(445), uint16(1176), uint16(1177), uint16(1178), uint16(1207), uint16(525), uint16(1207), uint16(1530), uint16(995), + /* 690 */ uint16(1143), uint16(304), uint16(554), uint16(1143), uint16(5), uint16(563), uint16(543), uint16(3), uint16(361), uint16(216), + /* 700 */ uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), + /* 710 */ uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(143), uint16(563), uint16(13), uint16(13), uint16(1029), + /* 720 */ uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), + /* 730 */ uint16(441), uint16(1176), uint16(426), uint16(563), uint16(1176), uint16(563), uint16(274), uint16(274), uint16(13), uint16(13), + /* 740 */ uint16(1078), uint16(1176), uint16(328), uint16(457), uint16(316), uint16(147), uint16(406), uint16(211), uint16(361), uint16(560), + /* 750 */ uint16(1000), uint16(213), uint16(511), uint16(293), uint16(477), uint16(55), uint16(55), uint16(71), uint16(71), uint16(119), + /* 760 */ uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), + /* 770 */ uint16(122), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), + /* 780 */ uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(406), uint16(455), uint16(1176), uint16(1177), uint16(1178), + /* 790 */ uint16(1176), uint16(1177), uint16(1178), uint16(471), uint16(526), uint16(149), uint16(404), uint16(1176), uint16(1177), uint16(1178), + /* 800 */ uint16(105), uint16(270), uint16(103), uint16(563), uint16(944), uint16(563), uint16(116), uint16(441), uint16(1530), uint16(122), + /* 810 */ uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), + /* 820 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(945), uint16(13), uint16(13), uint16(13), uint16(13), uint16(119), + /* 830 */ uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), + /* 840 */ uint16(191), uint16(563), uint16(192), uint16(563), uint16(416), uint16(439), uint16(439), uint16(439), uint16(1083), uint16(1083), + /* 850 */ uint16(485), uint16(561), uint16(285), uint16(914), uint16(914), uint16(406), uint16(462), uint16(330), uint16(1530), uint16(830), + /* 860 */ uint16(831), uint16(832), uint16(206), uint16(71), uint16(71), uint16(71), uint16(71), uint16(286), uint16(119), uint16(119), + /* 870 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(122), + /* 880 */ uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), + /* 890 */ uint16(121), uint16(121), uint16(121), uint16(121), uint16(563), uint16(217), uint16(563), uint16(1122), uint16(1617), uint16(406), + /* 900 */ uint16(300), uint16(1617), uint16(301), uint16(416), uint16(1278), uint16(1473), uint16(244), uint16(243), uint16(242), uint16(1249), + /* 910 */ uint16(412), uint16(556), uint16(412), uint16(282), uint16(842), uint16(279), uint16(71), uint16(71), uint16(71), uint16(71), + /* 920 */ uint16(944), uint16(1415), uint16(1473), uint16(1475), uint16(101), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), + /* 930 */ uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(119), uint16(119), + /* 940 */ uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(273), + /* 950 */ uint16(273), uint16(1099), uint16(563), uint16(436), uint16(1143), uint16(440), uint16(563), uint16(1122), uint16(1618), uint16(357), + /* 960 */ uint16(1558), uint16(1618), uint16(560), uint16(546), uint16(488), uint16(197), uint16(1100), uint16(1143), uint16(378), uint16(290), + /* 970 */ uint16(1143), uint16(1306), uint16(284), uint16(460), uint16(71), uint16(71), uint16(1120), uint16(405), uint16(13), uint16(13), + /* 980 */ uint16(145), uint16(1101), uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), + /* 990 */ uint16(117), uint16(116), uint16(441), uint16(542), uint16(104), uint16(1473), uint16(509), uint16(273), uint16(273), uint16(294), + /* 1000 */ uint16(1514), uint16(294), uint16(900), uint16(273), uint16(273), uint16(273), uint16(273), uint16(563), uint16(1503), uint16(563), + /* 1010 */ uint16(560), uint16(545), uint16(901), uint16(464), uint16(406), uint16(1058), uint16(560), uint16(852), uint16(560), uint16(198), + /* 1020 */ uint16(547), uint16(1080), uint16(920), uint16(404), uint16(1400), uint16(1080), uint16(146), uint16(919), uint16(38), uint16(56), + /* 1030 */ uint16(56), uint16(15), uint16(15), uint16(563), uint16(406), uint16(12), uint16(1120), uint16(471), uint16(122), uint16(123), + /* 1040 */ uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), + /* 1050 */ uint16(121), uint16(121), uint16(121), uint16(1460), uint16(406), uint16(43), uint16(43), uint16(483), uint16(122), uint16(123), + /* 1060 */ uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), + /* 1070 */ uint16(121), uint16(121), uint16(121), uint16(563), uint16(852), uint16(9), uint16(471), uint16(251), uint16(122), uint16(111), + /* 1080 */ uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), uint16(120), uint16(120), uint16(121), + /* 1090 */ uint16(121), uint16(121), uint16(121), uint16(563), uint16(421), uint16(57), uint16(57), uint16(119), uint16(119), uint16(119), + /* 1100 */ uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(1176), uint16(493), + /* 1110 */ uint16(563), uint16(289), uint16(1197), uint16(478), uint16(1516), uint16(44), uint16(44), uint16(119), uint16(119), uint16(119), + /* 1120 */ uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(880), uint16(563), + /* 1130 */ uint16(536), uint16(563), uint16(58), uint16(58), uint16(488), uint16(1414), uint16(245), uint16(119), uint16(119), uint16(119), + /* 1140 */ uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), uint16(441), uint16(563), uint16(535), + /* 1150 */ uint16(291), uint16(59), uint16(59), uint16(60), uint16(60), uint16(438), uint16(437), uint16(406), uint16(1154), uint16(505), + /* 1160 */ uint16(304), uint16(554), uint16(477), uint16(1204), uint16(1176), uint16(1177), uint16(1178), uint16(881), uint16(1206), uint16(1197), + /* 1170 */ uint16(61), uint16(61), uint16(1246), uint16(357), uint16(1558), uint16(1538), uint16(1205), uint16(563), uint16(1467), uint16(6), + /* 1180 */ uint16(1176), uint16(488), uint16(123), uint16(113), uint16(1200), uint16(1200), uint16(1035), uint16(1038), uint16(1028), uint16(1028), + /* 1190 */ uint16(120), uint16(120), uint16(121), uint16(121), uint16(121), uint16(121), uint16(1400), uint16(1143), uint16(410), uint16(62), + /* 1200 */ uint16(62), uint16(1207), uint16(1099), uint16(1207), uint16(411), uint16(447), uint16(273), uint16(273), uint16(537), uint16(1154), + /* 1210 */ uint16(1143), uint16(108), uint16(555), uint16(1143), uint16(4), uint16(391), uint16(1220), uint16(1100), uint16(1512), uint16(560), + /* 1220 */ uint16(347), uint16(516), uint16(428), uint16(548), uint16(308), uint16(1307), uint16(1536), uint16(1077), uint16(558), uint16(1077), + /* 1230 */ uint16(6), uint16(488), uint16(1101), uint16(1400), uint16(488), uint16(309), uint16(1176), uint16(1177), uint16(1178), uint16(563), + /* 1240 */ uint16(119), uint16(119), uint16(119), uint16(119), uint16(118), uint16(118), uint16(117), uint16(117), uint16(117), uint16(116), + /* 1250 */ uint16(441), uint16(442), uint16(278), uint16(551), uint16(563), uint16(273), uint16(273), uint16(273), uint16(273), uint16(563), + /* 1260 */ uint16(327), uint16(45), uint16(45), uint16(552), uint16(563), uint16(528), uint16(422), uint16(563), uint16(560), uint16(1400), + /* 1270 */ uint16(560), uint16(108), uint16(555), uint16(137), uint16(4), uint16(1303), uint16(46), uint16(46), uint16(335), uint16(563), + /* 1280 */ uint16(482), uint16(47), uint16(47), uint16(477), uint16(479), uint16(307), uint16(49), uint16(49), uint16(558), uint16(50), + /* 1290 */ uint16(50), uint16(563), uint16(1015), uint16(563), uint16(1221), uint16(563), uint16(1400), uint16(563), uint16(106), uint16(106), + /* 1300 */ uint16(8), uint16(63), uint16(63), uint16(423), uint16(563), uint16(107), uint16(312), uint16(442), uint16(565), uint16(564), + /* 1310 */ uint16(563), uint16(442), uint16(1005), uint16(64), uint16(64), uint16(65), uint16(65), uint16(14), uint16(14), uint16(66), + /* 1320 */ uint16(66), uint16(391), uint16(1121), uint16(552), uint16(1312), uint16(1180), uint16(128), uint16(128), uint16(563), uint16(304), + /* 1330 */ uint16(554), uint16(563), uint16(67), uint16(67), uint16(563), uint16(359), uint16(560), uint16(532), uint16(563), uint16(484), + /* 1340 */ uint16(563), uint16(1196), uint16(531), uint16(222), uint16(1005), uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(522), + /* 1350 */ uint16(52), uint16(52), uint16(1015), uint16(68), uint16(68), uint16(563), uint16(69), uint16(69), uint16(106), uint16(106), + /* 1360 */ uint16(53), uint16(53), uint16(156), uint16(156), uint16(563), uint16(107), uint16(434), uint16(442), uint16(565), uint16(564), + /* 1370 */ uint16(272), uint16(215), uint16(1005), uint16(425), uint16(563), uint16(359), uint16(563), uint16(157), uint16(157), uint16(563), + /* 1380 */ uint16(1535), uint16(292), uint16(1180), uint16(98), uint16(6), uint16(1344), uint16(76), uint16(76), uint16(1215), uint16(475), + /* 1390 */ uint16(413), uint16(169), uint16(226), uint16(563), uint16(245), uint16(563), uint16(54), uint16(54), uint16(72), uint16(72), + /* 1400 */ uint16(1221), uint16(129), uint16(129), uint16(1343), uint16(1005), uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(1563), + /* 1410 */ uint16(1165), uint16(444), uint16(456), uint16(433), uint16(277), uint16(73), uint16(73), uint16(130), uint16(130), uint16(389), + /* 1420 */ uint16(389), uint16(388), uint16(262), uint16(386), uint16(1165), uint16(444), uint16(839), uint16(1519), uint16(277), uint16(108), + /* 1430 */ uint16(555), uint16(321), uint16(4), uint16(389), uint16(389), uint16(388), uint16(262), uint16(386), uint16(563), uint16(223), + /* 1440 */ uint16(839), uint16(311), uint16(468), uint16(84), uint16(202), uint16(523), uint16(558), uint16(1492), uint16(303), uint16(310), + /* 1450 */ uint16(563), uint16(110), uint16(404), uint16(223), uint16(563), uint16(311), uint16(206), uint16(30), uint16(404), uint16(277), + /* 1460 */ uint16(131), uint16(131), uint16(411), uint16(310), uint16(389), uint16(389), uint16(388), uint16(262), uint16(386), uint16(442), + /* 1470 */ uint16(920), uint16(839), uint16(127), uint16(127), uint16(563), uint16(919), uint16(155), uint16(155), uint16(1491), uint16(225), + /* 1480 */ uint16(563), uint16(552), uint16(871), uint16(563), uint16(223), uint16(476), uint16(311), uint16(161), uint16(31), uint16(563), + /* 1490 */ uint16(135), uint16(563), uint16(480), uint16(225), uint16(310), uint16(532), uint16(154), uint16(154), uint16(332), uint16(17), + /* 1500 */ uint16(533), uint16(161), uint16(136), uint16(136), uint16(135), uint16(134), uint16(134), uint16(224), uint16(228), uint16(355), + /* 1510 */ uint16(1015), uint16(132), uint16(132), uint16(133), uint16(133), uint16(1589), uint16(106), uint16(106), uint16(889), uint16(354), + /* 1520 */ uint16(563), uint16(224), uint16(563), uint16(107), uint16(225), uint16(442), uint16(565), uint16(564), uint16(1117), uint16(275), + /* 1530 */ uint16(1005), uint16(393), uint16(161), uint16(518), uint16(563), uint16(135), uint16(108), uint16(555), uint16(417), uint16(4), + /* 1540 */ uint16(1340), uint16(407), uint16(75), uint16(75), uint16(77), uint16(77), uint16(304), uint16(554), uint16(867), uint16(563), + /* 1550 */ uint16(336), uint16(563), uint16(224), uint16(558), uint16(463), uint16(407), uint16(74), uint16(74), uint16(465), uint16(1065), + /* 1560 */ uint16(304), uint16(554), uint16(1005), uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(962), uint16(963), uint16(543), + /* 1570 */ uint16(448), uint16(42), uint16(42), uint16(48), uint16(48), uint16(326), uint16(442), uint16(325), uint16(98), uint16(997), + /* 1580 */ uint16(470), uint16(287), uint16(250), uint16(250), uint16(448), uint16(1009), uint16(407), uint16(472), uint16(552), uint16(339), + /* 1590 */ uint16(250), uint16(304), uint16(554), uint16(879), uint16(878), uint16(331), uint16(108), uint16(555), uint16(98), uint16(4), + /* 1600 */ uint16(1277), uint16(494), uint16(532), uint16(345), uint16(247), uint16(867), uint16(98), uint16(531), uint16(341), uint16(886), + /* 1610 */ uint16(887), uint16(1126), uint16(1076), uint16(558), uint16(1076), uint16(448), uint16(1065), uint16(1015), uint16(1061), uint16(953), + /* 1620 */ uint16(343), uint16(247), uint16(250), uint16(106), uint16(106), uint16(1291), uint16(917), uint16(1276), uint16(850), uint16(110), + /* 1630 */ uint16(107), uint16(144), uint16(442), uint16(565), uint16(564), uint16(918), uint16(442), uint16(1005), uint16(110), uint16(1275), + /* 1640 */ uint16(350), uint16(360), uint16(1009), uint16(1331), uint16(1352), uint16(299), uint16(1399), uint16(1577), uint16(552), uint16(1327), + /* 1650 */ uint16(1552), uint16(550), uint16(1338), uint16(549), uint16(1405), uint16(1256), uint16(1248), uint16(1237), uint16(1236), uint16(1238), + /* 1660 */ uint16(1571), uint16(489), uint16(265), uint16(200), uint16(1324), uint16(363), uint16(365), uint16(367), uint16(11), uint16(1005), + /* 1670 */ uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(390), uint16(221), uint16(1386), uint16(1015), uint16(280), uint16(1391), + /* 1680 */ uint16(1381), uint16(208), uint16(323), uint16(106), uint16(106), uint16(924), uint16(1374), uint16(453), uint16(283), uint16(324), + /* 1690 */ uint16(107), uint16(474), uint16(442), uint16(565), uint16(564), uint16(1390), uint16(499), uint16(1005), uint16(212), uint16(288), + /* 1700 */ uint16(1274), uint16(397), uint16(353), uint16(108), uint16(555), uint16(195), uint16(4), uint16(1464), uint16(369), uint16(1463), + /* 1710 */ uint16(1574), uint16(1215), uint16(1212), uint16(329), uint16(553), uint16(171), uint16(207), uint16(383), uint16(1511), uint16(196), + /* 1720 */ uint16(558), uint16(254), uint16(1509), uint16(415), uint16(100), uint16(555), uint16(83), uint16(4), uint16(204), uint16(1005), + /* 1730 */ uint16(1005), uint16(1007), uint16(1008), uint16(27), uint16(219), uint16(79), uint16(82), uint16(1469), uint16(180), uint16(166), + /* 1740 */ uint16(173), uint16(558), uint16(458), uint16(442), uint16(175), uint16(176), uint16(177), uint16(178), uint16(35), uint16(1387), + /* 1750 */ uint16(492), uint16(459), uint16(231), uint16(1395), uint16(96), uint16(552), uint16(1393), uint16(1392), uint16(395), uint16(184), + /* 1760 */ uint16(481), uint16(466), uint16(36), uint16(235), uint16(442), uint16(89), uint16(398), uint16(266), uint16(487), uint16(1480), + /* 1770 */ uint16(1458), uint16(237), uint16(188), uint16(338), uint16(508), uint16(429), uint16(552), uint16(490), uint16(400), uint16(238), + /* 1780 */ uint16(334), uint16(1239), uint16(239), uint16(1294), uint16(1015), uint16(1293), uint16(1292), uint16(1285), uint16(91), uint16(871), + /* 1790 */ uint16(106), uint16(106), uint16(213), uint16(431), uint16(1588), uint16(432), uint16(524), uint16(107), uint16(517), uint16(442), + /* 1800 */ uint16(565), uint16(564), uint16(401), uint16(1264), uint16(1005), uint16(1015), uint16(1263), uint16(1587), uint16(352), uint16(1262), + /* 1810 */ uint16(1557), uint16(106), uint16(106), uint16(1586), uint16(1284), uint16(297), uint16(298), uint16(358), uint16(107), uint16(1335), + /* 1820 */ uint16(442), uint16(565), uint16(564), uint16(95), uint16(362), uint16(1005), uint16(253), uint16(252), uint16(435), uint16(125), + /* 1830 */ uint16(543), uint16(10), uint16(1444), uint16(1543), uint16(377), uint16(1542), uint16(1005), uint16(1005), uint16(1007), uint16(1008), + /* 1840 */ uint16(27), uint16(302), uint16(102), uint16(97), uint16(527), uint16(1336), uint16(260), uint16(1317), uint16(364), uint16(1245), + /* 1850 */ uint16(1334), uint16(34), uint16(566), uint16(1171), uint16(366), uint16(381), uint16(375), uint16(1005), uint16(1005), uint16(1007), + /* 1860 */ uint16(1008), uint16(27), uint16(1333), uint16(1359), uint16(368), uint16(1316), uint16(199), uint16(382), uint16(261), uint16(263), + /* 1870 */ uint16(264), uint16(1358), uint16(158), uint16(1496), uint16(141), uint16(1497), uint16(1495), uint16(567), uint16(1234), uint16(1229), + /* 1880 */ uint16(1494), uint16(295), uint16(159), uint16(209), uint16(210), uint16(78), uint16(826), uint16(443), uint16(201), uint16(306), + /* 1890 */ uint16(220), uint16(1075), uint16(138), uint16(1073), uint16(160), uint16(314), uint16(162), uint16(172), uint16(1196), uint16(174), + /* 1900 */ uint16(903), uint16(227), uint16(230), uint16(322), uint16(1089), uint16(179), uint16(163), uint16(164), uint16(418), uint16(85), + /* 1910 */ uint16(420), uint16(181), uint16(170), uint16(408), uint16(409), uint16(86), uint16(87), uint16(165), uint16(88), uint16(1092), + /* 1920 */ uint16(232), uint16(233), uint16(1088), uint16(151), uint16(18), uint16(234), uint16(1081), uint16(250), uint16(333), uint16(185), + /* 1930 */ uint16(1209), uint16(486), uint16(236), uint16(186), uint16(37), uint16(841), uint16(491), uint16(354), uint16(240), uint16(346), + /* 1940 */ uint16(503), uint16(187), uint16(90), uint16(167), uint16(19), uint16(495), uint16(20), uint16(869), uint16(500), uint16(349), + /* 1950 */ uint16(92), uint16(882), uint16(296), uint16(152), uint16(93), uint16(510), uint16(1127), uint16(1159), uint16(153), uint16(1041), + /* 1960 */ uint16(214), uint16(1128), uint16(39), uint16(94), uint16(269), uint16(271), uint16(952), uint16(190), uint16(947), uint16(110), + /* 1970 */ uint16(1149), uint16(1145), uint16(1153), uint16(249), uint16(1133), uint16(1147), uint16(7), uint16(33), uint16(21), uint16(193), + /* 1980 */ uint16(22), uint16(23), uint16(24), uint16(25), uint16(1152), uint16(539), uint16(98), uint16(1056), uint16(26), uint16(1042), + /* 1990 */ uint16(1040), uint16(1044), uint16(1098), uint16(1045), uint16(1097), uint16(256), uint16(255), uint16(28), uint16(40), uint16(387), + /* 2000 */ uint16(1010), uint16(851), uint16(109), uint16(29), uint16(1167), uint16(559), uint16(384), uint16(257), uint16(913), uint16(258), + /* 2010 */ uint16(1166), uint16(1579), uint16(1225), uint16(1225), uint16(1225), uint16(1225), uint16(1225), uint16(1225), uint16(1225), uint16(1578), +} /* sqlite3.c:157466:27 */ +var yy_lookahead = [2203]uint16{ + /* 0 */ uint16(191), uint16(220), uint16(191), uint16(222), uint16(191), uint16(191), uint16(271), uint16(272), uint16(273), uint16(216), + /* 10 */ uint16(191), uint16(230), uint16(216), uint16(191), uint16(191), uint16(191), uint16(271), uint16(272), uint16(273), uint16(19), + /* 20 */ uint16(232), uint16(233), uint16(213), uint16(214), uint16(213), uint16(214), uint16(202), uint16(292), uint16(202), uint16(232), + /* 30 */ uint16(233), uint16(31), uint16(213), uint16(214), uint16(213), uint16(213), uint16(214), uint16(213), uint16(214), uint16(39), + /* 40 */ uint16(207), uint16(208), uint16(209), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), + /* 50 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(235), uint16(19), + /* 60 */ uint16(236), uint16(237), uint16(236), uint16(237), uint16(271), uint16(272), uint16(273), uint16(271), uint16(272), uint16(273), + /* 70 */ uint16(191), uint16(210), uint16(250), uint16(249), uint16(250), uint16(249), uint16(213), uint16(191), uint16(199), uint16(253), + /* 80 */ uint16(254), uint16(259), uint16(203), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), + /* 90 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(191), uint16(213), + /* 100 */ uint16(214), uint16(213), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), + /* 110 */ uint16(110), uint16(111), uint16(112), uint16(59), uint16(228), uint16(301), uint16(293), uint16(81), uint16(305), uint16(306), + /* 120 */ uint16(311), uint16(312), uint16(311), uint16(310), uint16(313), uint16(59), uint16(86), uint16(212), uint16(88), uint16(19), + /* 130 */ uint16(311), uint16(312), uint16(271), uint16(272), uint16(273), uint16(220), uint16(26), uint16(112), uint16(54), uint16(55), + /* 140 */ uint16(56), uint16(57), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), + /* 150 */ uint16(110), uint16(111), uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), + /* 160 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(191), uint16(115), + /* 170 */ uint16(116), uint16(117), uint16(118), uint16(137), uint16(138), uint16(121), uint16(122), uint16(123), uint16(191), uint16(69), + /* 180 */ uint16(203), uint16(115), uint16(116), uint16(117), uint16(59), uint16(131), uint16(102), uint16(103), uint16(104), uint16(105), + /* 190 */ uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(72), uint16(191), uint16(19), + /* 200 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(58), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), + /* 210 */ uint16(303), uint16(304), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), + /* 220 */ uint16(110), uint16(111), uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), + /* 230 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(16), + /* 240 */ uint16(115), uint16(116), uint16(117), uint16(24), uint16(16), uint16(227), uint16(202), uint16(67), uint16(102), uint16(103), + /* 250 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(59), + /* 260 */ uint16(26), uint16(191), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), + /* 270 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(24), uint16(208), uint16(209), + /* 280 */ uint16(236), uint16(237), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), + /* 290 */ uint16(110), uint16(111), uint16(112), uint16(249), uint16(183), uint16(184), uint16(185), uint16(186), uint16(187), uint16(188), + /* 300 */ uint16(77), uint16(59), uint16(79), uint16(191), uint16(193), uint16(77), uint16(195), uint16(79), uint16(19), uint16(19), + /* 310 */ uint16(266), uint16(304), uint16(59), uint16(202), uint16(24), uint16(115), uint16(116), uint16(117), uint16(191), uint16(127), + /* 320 */ uint16(128), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), + /* 330 */ uint16(111), uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), + /* 340 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(236), uint16(237), uint16(191), + /* 350 */ uint16(150), uint16(281), uint16(191), uint16(185), uint16(186), uint16(187), uint16(188), uint16(115), uint16(116), uint16(117), + /* 360 */ uint16(249), uint16(193), uint16(191), uint16(195), uint16(26), uint16(73), uint16(59), uint16(191), uint16(114), uint16(116), + /* 370 */ uint16(202), uint16(213), uint16(214), uint16(81), uint16(263), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), + /* 380 */ uint16(111), uint16(112), uint16(148), uint16(160), uint16(142), uint16(95), uint16(228), uint16(191), uint16(191), uint16(213), + /* 390 */ uint16(214), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), + /* 400 */ uint16(111), uint16(112), uint16(112), uint16(149), uint16(236), uint16(237), uint16(295), uint16(100), uint16(118), uint16(119), + /* 410 */ uint16(120), uint16(121), uint16(122), uint16(123), uint16(124), uint16(19), uint16(31), uint16(249), uint16(126), uint16(23), + /* 420 */ uint16(130), uint16(260), uint16(115), uint16(116), uint16(39), uint16(22), uint16(250), uint16(120), uint16(191), uint16(137), + /* 430 */ uint16(138), uint16(263), uint16(305), uint16(306), uint16(238), uint16(259), uint16(265), uint16(310), uint16(149), uint16(43), /* 440 */ uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), - /* 450 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(114), uint16(115), uint16(116), uint16(23), uint16(208), - /* 460 */ uint16(125), uint16(248), uint16(189), uint16(189), uint16(114), uint16(115), uint16(116), uint16(267), uint16(268), uint16(269), - /* 470 */ uint16(189), uint16(136), uint16(137), uint16(189), uint16(262), uint16(22), uint16(136), uint16(137), uint16(43), uint16(44), - /* 480 */ uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), - /* 490 */ uint16(55), uint16(56), uint16(57), uint16(189), uint16(95), uint16(211), uint16(212), uint16(101), uint16(102), uint16(103), - /* 500 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(59), uint16(189), - /* 510 */ uint16(111), uint16(189), uint16(59), uint16(76), uint16(294), uint16(295), uint16(117), uint16(118), uint16(119), uint16(120), - /* 520 */ uint16(121), uint16(122), uint16(123), uint16(19), uint16(87), uint16(189), uint16(89), uint16(23), uint16(129), uint16(92), - /* 530 */ uint16(279), uint16(227), uint16(248), uint16(22), uint16(189), uint16(284), uint16(101), uint16(102), uint16(103), uint16(104), - /* 540 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(43), uint16(44), uint16(45), - /* 550 */ uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), - /* 560 */ uint16(56), uint16(57), uint16(19), uint16(114), uint16(115), uint16(116), uint16(23), uint16(114), uint16(115), uint16(116), - /* 570 */ uint16(59), uint16(117), uint16(299), uint16(300), uint16(120), uint16(121), uint16(122), uint16(304), uint16(189), uint16(189), - /* 580 */ uint16(143), uint16(189), uint16(110), uint16(111), uint16(130), uint16(22), uint16(43), uint16(44), uint16(45), uint16(46), - /* 590 */ uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), - /* 600 */ uint16(57), uint16(211), uint16(212), uint16(211), uint16(212), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), - /* 610 */ uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(226), uint16(189), uint16(226), uint16(189), - /* 620 */ uint16(298), uint16(132), uint16(59), uint16(134), uint16(135), uint16(114), uint16(115), uint16(116), uint16(189), uint16(59), - /* 630 */ uint16(285), uint16(19), uint16(7), uint16(8), uint16(9), uint16(23), uint16(205), uint16(206), uint16(207), uint16(211), - /* 640 */ uint16(212), uint16(211), uint16(212), uint16(221), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), - /* 650 */ uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), - /* 660 */ uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), - /* 670 */ uint16(19), uint16(181), uint16(182), uint16(183), uint16(184), uint16(185), uint16(186), uint16(114), uint16(115), uint16(116), - /* 680 */ uint16(189), uint16(191), uint16(133), uint16(193), uint16(114), uint16(115), uint16(116), uint16(138), uint16(299), uint16(300), - /* 690 */ uint16(200), uint16(22), uint16(201), uint16(304), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), - /* 700 */ uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(35), - /* 710 */ uint16(189), uint16(141), uint16(189), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), - /* 720 */ uint16(108), uint16(109), uint16(110), uint16(111), uint16(234), uint16(235), uint16(22), uint16(23), uint16(59), uint16(184), - /* 730 */ uint16(26), uint16(186), uint16(211), uint16(212), uint16(211), uint16(212), uint16(191), uint16(247), uint16(193), uint16(19), - /* 740 */ uint16(66), uint16(105), uint16(106), uint16(73), uint16(189), uint16(200), uint16(189), uint16(226), uint16(74), uint16(226), - /* 750 */ uint16(22), uint16(261), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), - /* 760 */ uint16(109), uint16(110), uint16(111), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), - /* 770 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(189), uint16(234), - /* 780 */ uint16(235), uint16(291), uint16(19), uint16(114), uint16(115), uint16(116), uint16(150), uint16(59), uint16(152), uint16(189), - /* 790 */ uint16(233), uint16(236), uint16(247), uint16(59), uint16(189), uint16(125), uint16(126), uint16(127), uint16(59), uint16(300), - /* 800 */ uint16(211), uint16(212), uint16(128), uint16(304), uint16(100), uint16(19), uint16(261), uint16(156), uint16(45), uint16(46), - /* 810 */ uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), - /* 820 */ uint16(57), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), - /* 830 */ uint16(110), uint16(111), uint16(46), uint16(233), uint16(189), uint16(189), uint16(291), uint16(248), uint16(99), uint16(189), - /* 840 */ uint16(125), uint16(126), uint16(127), uint16(115), uint16(26), uint16(200), uint16(289), uint16(230), uint16(231), uint16(115), - /* 850 */ uint16(200), uint16(16), uint16(189), uint16(114), uint16(115), uint16(189), uint16(211), uint16(212), uint16(119), uint16(221), - /* 860 */ uint16(189), uint16(211), uint16(212), uint16(258), uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), - /* 870 */ uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(189), uint16(156), uint16(211), uint16(212), uint16(234), - /* 880 */ uint16(235), uint16(189), uint16(211), uint16(212), uint16(234), uint16(235), uint16(22), uint16(201), uint16(189), uint16(150), - /* 890 */ uint16(151), uint16(152), uint16(247), uint16(248), uint16(76), uint16(16), uint16(19), uint16(247), uint16(248), uint16(113), - /* 900 */ uint16(189), uint16(24), uint16(257), uint16(211), uint16(212), uint16(189), uint16(26), uint16(89), uint16(262), uint16(223), - /* 910 */ uint16(92), uint16(225), uint16(77), uint16(189), uint16(79), uint16(129), uint16(19), uint16(53), uint16(226), uint16(248), - /* 920 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), - /* 930 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(236), uint16(19), uint16(271), uint16(189), uint16(99), - /* 940 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), - /* 950 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(115), uint16(77), uint16(59), uint16(79), uint16(119), - /* 960 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), - /* 970 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(259), uint16(22), uint16(23), uint16(101), uint16(102), - /* 980 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(59), - /* 990 */ uint16(150), uint16(151), uint16(152), uint16(158), uint16(22), uint16(244), uint16(24), uint16(246), uint16(101), uint16(102), - /* 1000 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(285), - /* 1010 */ uint16(189), uint16(189), uint16(114), uint16(115), uint16(116), uint16(200), uint16(136), uint16(137), uint16(101), uint16(102), - /* 1020 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(230), - /* 1030 */ uint16(231), uint16(59), uint16(211), uint16(212), uint16(285), uint16(105), uint16(106), uint16(189), uint16(19), uint16(141), - /* 1040 */ uint16(234), uint16(235), uint16(239), uint16(113), uint16(114), uint16(115), uint16(116), uint16(226), uint16(118), uint16(234), - /* 1050 */ uint16(235), uint16(189), uint16(249), uint16(247), uint16(100), uint16(189), uint16(126), uint16(23), uint16(236), uint16(107), - /* 1060 */ uint16(26), uint16(189), uint16(247), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), - /* 1070 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(211), uint16(212), uint16(59), - /* 1080 */ uint16(150), uint16(233), uint16(152), uint16(211), uint16(212), uint16(133), uint16(12), uint16(115), uint16(189), uint16(189), - /* 1090 */ uint16(138), uint16(19), uint16(20), uint16(300), uint16(22), uint16(233), uint16(76), uint16(304), uint16(226), uint16(11), - /* 1100 */ uint16(208), uint16(27), uint16(22), uint16(23), uint16(200), uint16(19), uint16(26), uint16(87), uint16(36), uint16(89), - /* 1110 */ uint16(211), uint16(212), uint16(92), uint16(300), uint16(248), uint16(189), uint16(42), uint16(304), uint16(189), uint16(250), - /* 1120 */ uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), - /* 1130 */ uint16(111), uint16(59), uint16(200), uint16(233), uint16(114), uint16(115), uint16(116), uint16(63), uint16(234), uint16(235), - /* 1140 */ uint16(235), uint16(19), uint16(20), uint16(71), uint16(22), uint16(300), uint16(189), uint16(73), uint16(200), uint16(304), - /* 1150 */ uint16(116), uint16(247), uint16(247), uint16(81), uint16(189), uint16(200), uint16(227), uint16(26), uint16(36), uint16(234), - /* 1160 */ uint16(235), uint16(203), uint16(204), uint16(143), uint16(200), uint16(26), uint16(234), uint16(235), uint16(194), uint16(200), - /* 1170 */ uint16(48), uint16(99), uint16(247), uint16(66), uint16(189), uint16(141), uint16(284), uint16(105), uint16(106), uint16(247), - /* 1180 */ uint16(100), uint16(59), uint16(234), uint16(235), uint16(112), uint16(259), uint16(114), uint16(115), uint16(116), uint16(234), - /* 1190 */ uint16(235), uint16(119), uint16(85), uint16(71), uint16(266), uint16(247), uint16(211), uint16(212), uint16(234), uint16(235), - /* 1200 */ uint16(114), uint16(94), uint16(247), uint16(234), uint16(235), uint16(12), uint16(266), uint16(85), uint16(136), uint16(137), - /* 1210 */ uint16(189), uint16(247), uint16(90), uint16(26), uint16(126), uint16(127), uint16(247), uint16(189), uint16(26), uint16(22), - /* 1220 */ uint16(27), uint16(99), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(105), uint16(106), uint16(189), - /* 1230 */ uint16(302), uint16(303), uint16(211), uint16(212), uint16(112), uint16(42), uint16(114), uint16(115), uint16(116), uint16(211), - /* 1240 */ uint16(212), uint16(119), uint16(302), uint16(303), uint16(19), uint16(20), uint16(189), uint16(22), uint16(274), uint16(189), - /* 1250 */ uint16(15), uint16(144), uint16(278), uint16(189), uint16(22), uint16(23), uint16(63), uint16(189), uint16(189), uint16(203), - /* 1260 */ uint16(204), uint16(36), uint16(136), uint16(137), uint16(155), uint16(24), uint16(157), uint16(143), uint16(211), uint16(212), - /* 1270 */ uint16(189), uint16(140), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(0), uint16(1), uint16(2), - /* 1280 */ uint16(211), uint16(212), uint16(5), uint16(46), uint16(59), uint16(161), uint16(147), uint16(10), uint16(11), uint16(12), - /* 1290 */ uint16(13), uint16(14), uint16(211), uint16(212), uint16(17), uint16(60), uint16(71), uint16(189), uint16(258), uint16(189), - /* 1300 */ uint16(59), uint16(189), uint16(105), uint16(106), uint16(189), uint16(189), uint16(189), uint16(30), uint16(116), uint16(32), - /* 1310 */ uint16(85), uint16(124), uint16(189), uint16(251), uint16(252), uint16(90), uint16(189), uint16(40), uint16(258), uint16(211), - /* 1320 */ uint16(212), uint16(211), uint16(212), uint16(189), uint16(99), uint16(26), uint16(211), uint16(212), uint16(211), uint16(212), - /* 1330 */ uint16(105), uint16(106), uint16(100), uint16(141), uint16(211), uint16(212), uint16(119), uint16(112), uint16(189), uint16(114), - /* 1340 */ uint16(115), uint16(116), uint16(23), uint16(189), uint16(119), uint16(26), uint16(129), uint16(70), uint16(189), uint16(31), - /* 1350 */ uint16(113), uint16(19), uint16(20), uint16(24), uint16(22), uint16(78), uint16(115), uint16(39), uint16(81), uint16(189), - /* 1360 */ uint16(211), uint16(212), uint16(26), uint16(189), uint16(22), uint16(211), uint16(212), uint16(189), uint16(36), uint16(189), - /* 1370 */ uint16(211), uint16(212), uint16(189), uint16(189), uint16(97), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), - /* 1380 */ uint16(127), uint16(211), uint16(212), uint16(189), uint16(189), uint16(211), uint16(212), uint16(189), uint16(189), uint16(211), - /* 1390 */ uint16(212), uint16(59), uint16(189), uint16(189), uint16(211), uint16(212), uint16(23), uint16(189), uint16(22), uint16(26), - /* 1400 */ uint16(24), uint16(189), uint16(149), uint16(71), uint16(189), uint16(211), uint16(212), uint16(189), uint16(131), uint16(211), - /* 1410 */ uint16(212), uint16(189), uint16(189), uint16(136), uint16(137), uint16(211), uint16(212), uint16(85), uint16(189), uint16(211), - /* 1420 */ uint16(212), uint16(59), uint16(90), uint16(211), uint16(212), uint16(292), uint16(293), uint16(118), uint16(119), uint16(211), - /* 1430 */ uint16(212), uint16(99), uint16(23), uint16(211), uint16(212), uint16(26), uint16(159), uint16(105), uint16(106), uint16(189), - /* 1440 */ uint16(211), uint16(212), uint16(143), uint16(150), uint16(112), uint16(152), uint16(114), uint16(115), uint16(116), uint16(1), - /* 1450 */ uint16(2), uint16(119), uint16(23), uint16(5), uint16(23), uint16(26), uint16(189), uint16(26), uint16(10), uint16(11), - /* 1460 */ uint16(12), uint16(13), uint16(14), uint16(83), uint16(84), uint16(17), uint16(253), uint16(189), uint16(139), uint16(189), - /* 1470 */ uint16(19), uint16(20), uint16(189), uint16(22), uint16(189), uint16(189), uint16(140), uint16(115), uint16(30), uint16(59), - /* 1480 */ uint16(32), uint16(139), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(36), uint16(40), uint16(211), - /* 1490 */ uint16(212), uint16(211), uint16(212), uint16(59), uint16(211), uint16(212), uint16(211), uint16(212), uint16(7), uint16(8), - /* 1500 */ uint16(19), uint16(20), uint16(189), uint16(22), uint16(150), uint16(189), uint16(152), uint16(231), uint16(281), uint16(189), - /* 1510 */ uint16(59), uint16(189), uint16(23), uint16(189), uint16(189), uint16(26), uint16(189), uint16(36), uint16(70), uint16(189), - /* 1520 */ uint16(23), uint16(237), uint16(71), uint16(26), uint16(211), uint16(212), uint16(78), uint16(211), uint16(212), uint16(81), - /* 1530 */ uint16(189), uint16(211), uint16(212), uint16(211), uint16(212), uint16(115), uint16(211), uint16(212), uint16(211), uint16(212), - /* 1540 */ uint16(59), uint16(211), uint16(212), uint16(23), uint16(23), uint16(97), uint16(26), uint16(26), uint16(23), uint16(115), - /* 1550 */ uint16(99), uint16(26), uint16(71), uint16(189), uint16(189), uint16(189), uint16(105), uint16(106), uint16(107), uint16(23), - /* 1560 */ uint16(189), uint16(23), uint16(26), uint16(112), uint16(26), uint16(114), uint16(115), uint16(116), uint16(189), uint16(309), - /* 1570 */ uint16(119), uint16(23), uint16(19), uint16(20), uint16(26), uint16(22), uint16(189), uint16(211), uint16(212), uint16(131), - /* 1580 */ uint16(99), uint16(189), uint16(211), uint16(212), uint16(136), uint16(137), uint16(105), uint16(106), uint16(189), uint16(36), - /* 1590 */ uint16(211), uint16(212), uint16(189), uint16(112), uint16(189), uint16(114), uint16(115), uint16(116), uint16(211), uint16(212), - /* 1600 */ uint16(119), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(189), uint16(159), uint16(23), uint16(250), - /* 1610 */ uint16(189), uint16(26), uint16(59), uint16(189), uint16(189), uint16(189), uint16(189), uint16(189), uint16(280), uint16(189), - /* 1620 */ uint16(250), uint16(189), uint16(189), uint16(238), uint16(71), uint16(189), uint16(189), uint16(250), uint16(211), uint16(212), - /* 1630 */ uint16(187), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(211), uint16(212), uint16(250), uint16(290), - /* 1640 */ uint16(240), uint16(211), uint16(212), uint16(211), uint16(212), uint16(254), uint16(286), uint16(209), uint16(254), uint16(241), - /* 1650 */ uint16(240), uint16(254), uint16(99), uint16(286), uint16(215), uint16(220), uint16(214), uint16(244), uint16(105), uint16(106), - /* 1660 */ uint16(214), uint16(214), uint16(244), uint16(273), uint16(224), uint16(112), uint16(192), uint16(114), uint16(115), uint16(116), - /* 1670 */ uint16(60), uint16(290), uint16(119), uint16(5), uint16(139), uint16(196), uint16(196), uint16(38), uint16(10), uint16(11), - /* 1680 */ uint16(12), uint16(13), uint16(14), uint16(238), uint16(240), uint16(17), uint16(196), uint16(148), uint16(287), uint16(287), - /* 1690 */ uint16(276), uint16(113), uint16(22), uint16(147), uint16(241), uint16(43), uint16(229), uint16(241), uint16(30), uint16(18), - /* 1700 */ uint16(32), uint16(232), uint16(232), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(40), uint16(232), - /* 1710 */ uint16(232), uint16(196), uint16(18), uint16(195), uint16(265), uint16(265), uint16(264), uint16(241), uint16(264), uint16(196), - /* 1720 */ uint16(155), uint16(229), uint16(229), uint16(241), uint16(241), uint16(241), uint16(195), uint16(62), uint16(196), uint16(195), - /* 1730 */ uint16(22), uint16(113), uint16(216), uint16(196), uint16(222), uint16(195), uint16(195), uint16(282), uint16(70), uint16(196), - /* 1740 */ uint16(283), uint16(213), uint16(216), uint16(213), uint16(64), uint16(22), uint16(78), uint16(124), uint16(219), uint16(81), - /* 1750 */ uint16(162), uint16(111), uint16(219), uint16(142), uint16(256), uint16(213), uint16(113), uint16(255), uint16(213), uint16(256), - /* 1760 */ uint16(216), uint16(303), uint16(215), uint16(213), uint16(213), uint16(97), uint16(255), uint16(213), uint16(216), uint16(275), - /* 1770 */ uint16(275), uint16(222), uint16(216), uint16(256), uint16(255), uint16(196), uint16(91), uint16(82), uint16(256), uint16(255), - /* 1780 */ uint16(308), uint16(308), uint16(146), uint16(22), uint16(143), uint16(196), uint16(155), uint16(260), uint16(25), uint16(145), - /* 1790 */ uint16(144), uint16(199), uint16(26), uint16(198), uint16(13), uint16(190), uint16(190), uint16(6), uint16(293), uint16(131), - /* 1800 */ uint16(188), uint16(188), uint16(245), uint16(244), uint16(136), uint16(137), uint16(245), uint16(243), uint16(242), uint16(241), - /* 1810 */ uint16(188), uint16(202), uint16(208), uint16(217), uint16(217), uint16(260), uint16(208), uint16(4), uint16(202), uint16(3), - /* 1820 */ uint16(22), uint16(202), uint16(208), uint16(208), uint16(160), uint16(15), uint16(209), uint16(159), uint16(270), uint16(209), - /* 1830 */ uint16(98), uint16(16), uint16(272), uint16(208), uint16(23), uint16(23), uint16(137), uint16(148), uint16(128), uint16(20), - /* 1840 */ uint16(140), uint16(24), uint16(16), uint16(142), uint16(1), uint16(140), uint16(149), uint16(128), uint16(61), uint16(53), - /* 1850 */ uint16(148), uint16(37), uint16(53), uint16(53), uint16(53), uint16(128), uint16(114), uint16(34), uint16(296), uint16(296), - /* 1860 */ uint16(139), uint16(1), uint16(5), uint16(22), uint16(113), uint16(158), uint16(26), uint16(75), uint16(41), uint16(139), - /* 1870 */ uint16(68), uint16(68), uint16(113), uint16(24), uint16(20), uint16(19), uint16(129), uint16(123), uint16(23), uint16(96), - /* 1880 */ uint16(22), uint16(22), uint16(37), uint16(22), uint16(22), uint16(67), uint16(22), uint16(67), uint16(59), uint16(24), - /* 1890 */ uint16(23), uint16(28), uint16(67), uint16(147), uint16(22), uint16(26), uint16(23), uint16(23), uint16(23), uint16(23), - /* 1900 */ uint16(22), uint16(24), uint16(23), uint16(22), uint16(24), uint16(23), uint16(139), uint16(23), uint16(114), uint16(22), - /* 1910 */ uint16(141), uint16(26), uint16(88), uint16(75), uint16(86), uint16(44), uint16(23), uint16(34), uint16(22), uint16(75), - /* 1920 */ uint16(34), uint16(24), uint16(34), uint16(34), uint16(34), uint16(93), uint16(34), uint16(26), uint16(26), uint16(34), - /* 1930 */ uint16(23), uint16(23), uint16(23), uint16(23), uint16(23), uint16(11), uint16(23), uint16(22), uint16(26), uint16(22), - /* 1940 */ uint16(22), uint16(133), uint16(23), uint16(23), uint16(22), uint16(22), uint16(139), uint16(26), uint16(139), uint16(23), - /* 1950 */ uint16(15), uint16(1), uint16(1), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 1960 */ uint16(139), uint16(139), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 1970 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 1980 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 1990 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2000 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2010 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2020 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2030 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2040 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2050 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2060 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2070 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2080 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2090 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2100 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2110 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2120 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2130 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), - /* 2140 */ uint16(310), uint16(310), uint16(310), -} /* sqlite3.c:154798:25 */ -var yy_shift_ofst = [553]uint16{ - /* 0 */ uint16(1448), uint16(1277), uint16(1668), uint16(1072), uint16(1072), uint16(340), uint16(1122), uint16(1225), uint16(1332), uint16(1481), - /* 10 */ uint16(1481), uint16(1481), uint16(335), uint16(0), uint16(0), uint16(180), uint16(897), uint16(1481), uint16(1481), uint16(1481), - /* 20 */ uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), - /* 30 */ uint16(930), uint16(930), uint16(1020), uint16(1020), uint16(290), uint16(1), uint16(340), uint16(340), uint16(340), uint16(340), - /* 40 */ uint16(340), uint16(340), uint16(40), uint16(110), uint16(219), uint16(288), uint16(327), uint16(396), uint16(435), uint16(504), - /* 50 */ uint16(543), uint16(612), uint16(651), uint16(720), uint16(877), uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), - /* 60 */ uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), uint16(897), - /* 70 */ uint16(897), uint16(897), uint16(897), uint16(917), uint16(897), uint16(1019), uint16(763), uint16(763), uint16(1451), uint16(1481), - /* 80 */ uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), - /* 90 */ uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), - /* 100 */ uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), - /* 110 */ uint16(1481), uint16(1481), uint16(1553), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), - /* 120 */ uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(147), uint16(258), uint16(258), uint16(258), - /* 130 */ uint16(258), uint16(258), uint16(79), uint16(65), uint16(84), uint16(449), uint16(19), uint16(786), uint16(449), uint16(636), - /* 140 */ uint16(636), uint16(449), uint16(880), uint16(880), uint16(880), uint16(880), uint16(113), uint16(142), uint16(142), uint16(472), - /* 150 */ uint16(150), uint16(1962), uint16(1962), uint16(399), uint16(399), uint16(399), uint16(93), uint16(237), uint16(341), uint16(237), - /* 160 */ uint16(237), uint16(1074), uint16(1074), uint16(437), uint16(350), uint16(704), uint16(1080), uint16(449), uint16(449), uint16(449), - /* 170 */ uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), - /* 180 */ uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(818), uint16(818), - /* 190 */ uint16(449), uint16(1088), uint16(217), uint16(217), uint16(734), uint16(734), uint16(1124), uint16(1126), uint16(1962), uint16(1962), - /* 200 */ uint16(1962), uint16(739), uint16(840), uint16(840), uint16(453), uint16(454), uint16(511), uint16(187), uint16(563), uint16(570), - /* 210 */ uint16(898), uint16(669), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), - /* 220 */ uint16(449), uint16(670), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), - /* 230 */ uint16(449), uint16(449), uint16(449), uint16(449), uint16(674), uint16(674), uint16(674), uint16(449), uint16(449), uint16(449), - /* 240 */ uint16(449), uint16(1034), uint16(449), uint16(449), uint16(449), uint16(972), uint16(1107), uint16(449), uint16(449), uint16(1193), - /* 250 */ uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(260), uint16(177), - /* 260 */ uint16(489), uint16(1241), uint16(1241), uint16(1241), uint16(1241), uint16(1192), uint16(489), uint16(489), uint16(952), uint16(1197), - /* 270 */ uint16(625), uint16(1235), uint16(1131), uint16(181), uint16(181), uint16(1086), uint16(1139), uint16(1131), uint16(1086), uint16(1187), - /* 280 */ uint16(1319), uint16(1237), uint16(1318), uint16(1318), uint16(1318), uint16(181), uint16(1299), uint16(1299), uint16(1109), uint16(1336), - /* 290 */ uint16(549), uint16(1376), uint16(1610), uint16(1535), uint16(1535), uint16(1639), uint16(1639), uint16(1535), uint16(1539), uint16(1578), - /* 300 */ uint16(1670), uint16(1546), uint16(1652), uint16(1546), uint16(1681), uint16(1681), uint16(1681), uint16(1681), uint16(1535), uint16(1694), - /* 310 */ uint16(1546), uint16(1546), uint16(1578), uint16(1670), uint16(1652), uint16(1546), uint16(1652), uint16(1546), uint16(1535), uint16(1694), - /* 320 */ uint16(1565), uint16(1665), uint16(1535), uint16(1694), uint16(1708), uint16(1535), uint16(1694), uint16(1535), uint16(1694), uint16(1708), - /* 330 */ uint16(1618), uint16(1618), uint16(1618), uint16(1680), uint16(1723), uint16(1723), uint16(1708), uint16(1618), uint16(1623), uint16(1618), - /* 340 */ uint16(1680), uint16(1618), uint16(1618), uint16(1588), uint16(1708), uint16(1640), uint16(1640), uint16(1708), uint16(1611), uint16(1643), - /* 350 */ uint16(1611), uint16(1643), uint16(1611), uint16(1643), uint16(1611), uint16(1643), uint16(1535), uint16(1685), uint16(1685), uint16(1695), - /* 360 */ uint16(1695), uint16(1636), uint16(1641), uint16(1761), uint16(1535), uint16(1631), uint16(1636), uint16(1644), uint16(1646), uint16(1546), - /* 370 */ uint16(1763), uint16(1766), uint16(1781), uint16(1781), uint16(1791), uint16(1791), uint16(1791), uint16(1962), uint16(1962), uint16(1962), - /* 380 */ uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), - /* 390 */ uint16(1962), uint16(1962), uint16(308), uint16(835), uint16(954), uint16(1232), uint16(879), uint16(715), uint16(728), uint16(1373), - /* 400 */ uint16(864), uint16(1329), uint16(1253), uint16(1409), uint16(297), uint16(1431), uint16(1489), uint16(1497), uint16(1520), uint16(1521), - /* 410 */ uint16(1525), uint16(1362), uint16(1309), uint16(1491), uint16(1217), uint16(1420), uint16(1429), uint16(1536), uint16(1380), uint16(1538), - /* 420 */ uint16(1293), uint16(1354), uint16(1548), uint16(1585), uint16(1434), uint16(1342), uint16(1813), uint16(1816), uint16(1798), uint16(1664), - /* 430 */ uint16(1810), uint16(1732), uint16(1815), uint16(1811), uint16(1812), uint16(1699), uint16(1689), uint16(1710), uint16(1817), uint16(1700), - /* 440 */ uint16(1819), uint16(1701), uint16(1826), uint16(1843), uint16(1705), uint16(1697), uint16(1719), uint16(1787), uint16(1814), uint16(1702), - /* 450 */ uint16(1796), uint16(1799), uint16(1800), uint16(1801), uint16(1727), uint16(1742), uint16(1823), uint16(1721), uint16(1860), uint16(1857), - /* 460 */ uint16(1841), uint16(1751), uint16(1707), uint16(1802), uint16(1840), uint16(1803), uint16(1792), uint16(1827), uint16(1730), uint16(1759), - /* 470 */ uint16(1849), uint16(1854), uint16(1856), uint16(1747), uint16(1754), uint16(1858), uint16(1818), uint16(1859), uint16(1861), uint16(1855), - /* 480 */ uint16(1862), uint16(1820), uint16(1829), uint16(1865), uint16(1783), uint16(1863), uint16(1864), uint16(1825), uint16(1845), uint16(1867), - /* 490 */ uint16(1746), uint16(1872), uint16(1873), uint16(1874), uint16(1875), uint16(1869), uint16(1876), uint16(1878), uint16(1877), uint16(1879), - /* 500 */ uint16(1881), uint16(1880), uint16(1767), uint16(1882), uint16(1884), uint16(1794), uint16(1883), uint16(1887), uint16(1769), uint16(1885), - /* 510 */ uint16(1886), uint16(1888), uint16(1889), uint16(1890), uint16(1824), uint16(1838), uint16(1828), uint16(1871), uint16(1844), uint16(1832), - /* 520 */ uint16(1892), uint16(1893), uint16(1896), uint16(1897), uint16(1901), uint16(1902), uint16(1895), uint16(1907), uint16(1885), uint16(1908), - /* 530 */ uint16(1909), uint16(1910), uint16(1911), uint16(1912), uint16(1913), uint16(1915), uint16(1924), uint16(1917), uint16(1918), uint16(1919), - /* 540 */ uint16(1920), uint16(1922), uint16(1923), uint16(1921), uint16(1808), uint16(1807), uint16(1809), uint16(1821), uint16(1822), uint16(1926), - /* 550 */ uint16(1935), uint16(1950), uint16(1951), -} /* sqlite3.c:155018:33 */ -var yy_reduce_ofst = [392]int16{ - /* 0 */ int16(490), int16(-122), int16(545), int16(645), int16(650), int16(-120), int16(-189), int16(-187), int16(-184), int16(-182), - /* 10 */ int16(-178), int16(-176), int16(45), int16(30), int16(200), int16(-251), int16(-134), int16(390), int16(392), int16(521), - /* 20 */ int16(523), int16(213), int16(692), int16(821), int16(284), int16(589), int16(872), int16(666), int16(671), int16(866), - /* 30 */ int16(71), int16(111), int16(273), int16(389), int16(686), int16(815), int16(904), int16(932), int16(948), int16(955), - /* 40 */ int16(964), int16(969), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), - /* 50 */ int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), - /* 60 */ int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), - /* 70 */ int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(428), int16(430), - /* 80 */ int16(899), int16(985), int16(1021), int16(1028), int16(1057), int16(1069), int16(1081), int16(1108), int16(1110), int16(1115), - /* 90 */ int16(1117), int16(1123), int16(1149), int16(1154), int16(1159), int16(1170), int16(1174), int16(1178), int16(1183), int16(1194), - /* 100 */ int16(1198), int16(1204), int16(1208), int16(1212), int16(1218), int16(1222), int16(1229), int16(1278), int16(1280), int16(1283), - /* 110 */ int16(1285), int16(1313), int16(1316), int16(1320), int16(1322), int16(1325), int16(1327), int16(1330), int16(1366), int16(1371), - /* 120 */ int16(1379), int16(1387), int16(1417), int16(1425), int16(1430), int16(1432), int16(-259), int16(-259), int16(-259), int16(-259), - /* 130 */ int16(-259), int16(-259), int16(-259), int16(-259), int16(-259), int16(557), int16(974), int16(-214), int16(-174), int16(-9), - /* 140 */ int16(431), int16(-124), int16(806), int16(925), int16(806), int16(925), int16(251), int16(928), int16(940), int16(-259), - /* 150 */ int16(-259), int16(-259), int16(-259), int16(-198), int16(-198), int16(-198), int16(127), int16(-186), int16(-168), int16(212), - /* 160 */ int16(646), int16(617), int16(799), int16(-262), int16(555), int16(220), int16(220), int16(491), int16(605), int16(1040), - /* 170 */ int16(1060), int16(699), int16(-11), int16(600), int16(848), int16(862), int16(345), int16(-129), int16(724), int16(-91), - /* 180 */ int16(158), int16(749), int16(716), int16(900), int16(304), int16(822), int16(929), int16(926), int16(499), int16(793), - /* 190 */ int16(322), int16(892), int16(813), int16(845), int16(958), int16(1056), int16(751), int16(905), int16(1133), int16(1062), - /* 200 */ int16(803), int16(-210), int16(-185), int16(-179), int16(-148), int16(-167), int16(-89), int16(121), int16(274), int16(281), - /* 210 */ int16(320), int16(336), int16(439), int16(663), int16(711), int16(957), int16(965), int16(1064), int16(1068), int16(1112), - /* 220 */ int16(1116), int16(-196), int16(1127), int16(1134), int16(1180), int16(1184), int16(1195), int16(1199), int16(1203), int16(1215), - /* 230 */ int16(1223), int16(1250), int16(1267), int16(1286), int16(205), int16(422), int16(638), int16(1324), int16(1341), int16(1364), - /* 240 */ int16(1365), int16(1213), int16(1392), int16(1399), int16(1403), int16(869), int16(1260), int16(1405), int16(1421), int16(1276), - /* 250 */ int16(1424), int16(121), int16(1426), int16(1427), int16(1428), int16(1433), int16(1436), int16(1437), int16(1227), int16(1338), - /* 260 */ int16(1284), int16(1359), int16(1370), int16(1377), int16(1388), int16(1213), int16(1284), int16(1284), int16(1385), int16(1438), - /* 270 */ int16(1443), int16(1349), int16(1400), int16(1391), int16(1394), int16(1360), int16(1408), int16(1410), int16(1367), int16(1439), - /* 280 */ int16(1440), int16(1435), int16(1442), int16(1446), int16(1447), int16(1397), int16(1413), int16(1418), int16(1390), int16(1444), - /* 290 */ int16(1445), int16(1474), int16(1381), int16(1479), int16(1480), int16(1401), int16(1402), int16(1490), int16(1414), int16(1449), - /* 300 */ int16(1452), int16(1453), int16(1467), int16(1456), int16(1469), int16(1470), int16(1477), int16(1478), int16(1515), int16(1518), - /* 310 */ int16(1476), int16(1482), int16(1450), int16(1454), int16(1492), int16(1483), int16(1493), int16(1484), int16(1523), int16(1531), - /* 320 */ int16(1457), int16(1455), int16(1532), int16(1534), int16(1516), int16(1537), int16(1540), int16(1543), int16(1541), int16(1526), - /* 330 */ int16(1528), int16(1530), int16(1542), int16(1512), int16(1529), int16(1533), int16(1544), int16(1545), int16(1547), int16(1550), - /* 340 */ int16(1549), int16(1551), int16(1554), int16(1458), int16(1552), int16(1494), int16(1495), int16(1556), int16(1498), int16(1502), - /* 350 */ int16(1503), int16(1511), int16(1517), int16(1519), int16(1522), int16(1524), int16(1579), int16(1472), int16(1473), int16(1527), - /* 360 */ int16(1555), int16(1557), int16(1559), int16(1558), int16(1589), int16(1560), int16(1561), int16(1564), int16(1566), int16(1568), - /* 370 */ int16(1592), int16(1595), int16(1605), int16(1606), int16(1612), int16(1613), int16(1622), int16(1562), int16(1563), int16(1505), - /* 380 */ int16(1609), int16(1604), int16(1608), int16(1614), int16(1615), int16(1616), int16(1596), int16(1597), int16(1617), int16(1620), - /* 390 */ int16(1625), int16(1619), -} /* sqlite3.c:155079:20 */ -var yy_default = [553]uint16{ - /* 0 */ uint16(1575), uint16(1575), uint16(1575), uint16(1411), uint16(1188), uint16(1297), uint16(1188), uint16(1188), uint16(1188), uint16(1411), - /* 10 */ uint16(1411), uint16(1411), uint16(1188), uint16(1327), uint16(1327), uint16(1464), uint16(1219), uint16(1188), uint16(1188), uint16(1188), - /* 20 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1410), uint16(1188), uint16(1188), - /* 30 */ uint16(1188), uint16(1188), uint16(1494), uint16(1494), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 40 */ uint16(1188), uint16(1188), uint16(1188), uint16(1336), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 50 */ uint16(1412), uint16(1413), uint16(1188), uint16(1188), uint16(1188), uint16(1463), uint16(1465), uint16(1428), uint16(1346), uint16(1345), - /* 60 */ uint16(1344), uint16(1343), uint16(1446), uint16(1314), uint16(1341), uint16(1334), uint16(1338), uint16(1406), uint16(1407), uint16(1405), - /* 70 */ uint16(1409), uint16(1413), uint16(1412), uint16(1188), uint16(1337), uint16(1377), uint16(1391), uint16(1376), uint16(1188), uint16(1188), - /* 80 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 90 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 100 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 110 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 120 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1385), uint16(1390), uint16(1396), uint16(1389), - /* 130 */ uint16(1386), uint16(1379), uint16(1378), uint16(1380), uint16(1381), uint16(1188), uint16(1209), uint16(1261), uint16(1188), uint16(1188), - /* 140 */ uint16(1188), uint16(1188), uint16(1482), uint16(1481), uint16(1188), uint16(1188), uint16(1219), uint16(1371), uint16(1370), uint16(1382), - /* 150 */ uint16(1383), uint16(1393), uint16(1392), uint16(1471), uint16(1529), uint16(1528), uint16(1429), uint16(1188), uint16(1188), uint16(1188), - /* 160 */ uint16(1188), uint16(1188), uint16(1188), uint16(1494), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 170 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 180 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1494), uint16(1494), - /* 190 */ uint16(1188), uint16(1219), uint16(1494), uint16(1494), uint16(1215), uint16(1215), uint16(1321), uint16(1188), uint16(1477), uint16(1297), - /* 200 */ uint16(1288), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 210 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1468), uint16(1466), uint16(1188), uint16(1188), uint16(1188), - /* 220 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 230 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 240 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1293), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 250 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1523), uint16(1188), uint16(1441), - /* 260 */ uint16(1275), uint16(1293), uint16(1293), uint16(1293), uint16(1293), uint16(1295), uint16(1276), uint16(1274), uint16(1287), uint16(1220), - /* 270 */ uint16(1195), uint16(1567), uint16(1294), uint16(1316), uint16(1316), uint16(1564), uint16(1340), uint16(1294), uint16(1564), uint16(1236), - /* 280 */ uint16(1545), uint16(1231), uint16(1327), uint16(1327), uint16(1327), uint16(1316), uint16(1321), uint16(1321), uint16(1408), uint16(1294), - /* 290 */ uint16(1287), uint16(1188), uint16(1567), uint16(1302), uint16(1302), uint16(1566), uint16(1566), uint16(1302), uint16(1429), uint16(1349), - /* 300 */ uint16(1355), uint16(1340), uint16(1264), uint16(1340), uint16(1270), uint16(1270), uint16(1270), uint16(1270), uint16(1302), uint16(1206), - /* 310 */ uint16(1340), uint16(1340), uint16(1349), uint16(1355), uint16(1264), uint16(1340), uint16(1264), uint16(1340), uint16(1302), uint16(1206), - /* 320 */ uint16(1445), uint16(1561), uint16(1302), uint16(1206), uint16(1419), uint16(1302), uint16(1206), uint16(1302), uint16(1206), uint16(1419), - /* 330 */ uint16(1262), uint16(1262), uint16(1262), uint16(1251), uint16(1188), uint16(1188), uint16(1419), uint16(1262), uint16(1236), uint16(1262), - /* 340 */ uint16(1251), uint16(1262), uint16(1262), uint16(1512), uint16(1419), uint16(1423), uint16(1423), uint16(1419), uint16(1320), uint16(1315), - /* 350 */ uint16(1320), uint16(1315), uint16(1320), uint16(1315), uint16(1320), uint16(1315), uint16(1302), uint16(1504), uint16(1504), uint16(1330), - /* 360 */ uint16(1330), uint16(1335), uint16(1321), uint16(1414), uint16(1302), uint16(1188), uint16(1335), uint16(1333), uint16(1331), uint16(1340), - /* 370 */ uint16(1212), uint16(1254), uint16(1526), uint16(1526), uint16(1522), uint16(1522), uint16(1522), uint16(1572), uint16(1572), uint16(1477), - /* 380 */ uint16(1538), uint16(1219), uint16(1219), uint16(1219), uint16(1219), uint16(1538), uint16(1238), uint16(1238), uint16(1220), uint16(1220), - /* 390 */ uint16(1219), uint16(1538), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1533), uint16(1188), - /* 400 */ uint16(1430), uint16(1306), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 410 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 420 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1360), uint16(1188), uint16(1191), uint16(1474), uint16(1188), - /* 430 */ uint16(1188), uint16(1472), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1307), uint16(1188), - /* 440 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 450 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1563), uint16(1188), uint16(1188), - /* 460 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1444), uint16(1443), uint16(1188), uint16(1188), uint16(1304), uint16(1188), - /* 470 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 480 */ uint16(1188), uint16(1188), uint16(1234), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 490 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 500 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1332), - /* 510 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 520 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1509), uint16(1322), uint16(1188), uint16(1188), uint16(1554), uint16(1188), - /* 530 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), - /* 540 */ uint16(1188), uint16(1188), uint16(1188), uint16(1549), uint16(1278), uint16(1362), uint16(1188), uint16(1361), uint16(1365), uint16(1188), - /* 550 */ uint16(1200), uint16(1188), uint16(1188), -} /* sqlite3.c:155121:27 */ + /* 450 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(191), uint16(117), uint16(191), uint16(210), uint16(19), uint16(152), + /* 460 */ uint16(153), uint16(154), uint16(23), uint16(295), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), + /* 470 */ uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(266), uint16(213), uint16(214), uint16(213), uint16(214), + /* 480 */ uint16(142), uint16(81), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), + /* 490 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(301), uint16(102), uint16(103), + /* 500 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(106), + /* 510 */ uint16(107), uint16(118), uint16(59), uint16(250), uint16(121), uint16(122), uint16(123), uint16(280), uint16(76), uint16(119), + /* 520 */ uint16(236), uint16(237), uint16(259), uint16(306), uint16(131), uint16(72), uint16(59), uint16(310), uint16(19), uint16(87), + /* 530 */ uint16(283), uint16(89), uint16(23), uint16(249), uint16(92), uint16(288), uint16(22), uint16(137), uint16(138), uint16(22), + /* 540 */ uint16(275), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), + /* 550 */ uint16(111), uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), + /* 560 */ uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(115), uint16(116), + /* 570 */ uint16(117), uint16(23), uint16(186), uint16(59), uint16(188), uint16(108), uint16(59), uint16(241), uint16(191), uint16(193), + /* 580 */ uint16(26), uint16(195), uint16(115), uint16(116), uint16(117), uint16(191), uint16(144), uint16(251), uint16(202), uint16(22), + /* 590 */ uint16(100), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), + /* 600 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(116), uint16(213), uint16(214), uint16(191), + /* 610 */ uint16(120), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), + /* 620 */ uint16(111), uint16(112), uint16(236), uint16(237), uint16(306), uint16(238), uint16(59), uint16(26), uint16(310), uint16(115), + /* 630 */ uint16(116), uint16(117), uint16(115), uint16(116), uint16(117), uint16(249), uint16(246), uint16(19), uint16(248), uint16(106), + /* 640 */ uint16(107), uint16(23), uint16(152), uint16(153), uint16(154), uint16(46), uint16(47), uint16(48), uint16(49), uint16(263), + /* 650 */ uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), + /* 660 */ uint16(112), uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), + /* 670 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(76), uint16(298), uint16(299), + /* 680 */ uint16(23), uint16(295), uint16(115), uint16(116), uint16(117), uint16(152), uint16(191), uint16(154), uint16(301), uint16(73), + /* 690 */ uint16(89), uint16(137), uint16(138), uint16(92), uint16(22), uint16(191), uint16(144), uint16(22), uint16(191), uint16(191), + /* 700 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), + /* 710 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(163), uint16(191), uint16(213), uint16(214), uint16(120), + /* 720 */ uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), + /* 730 */ uint16(112), uint16(59), uint16(228), uint16(191), uint16(59), uint16(191), uint16(236), uint16(237), uint16(213), uint16(214), + /* 740 */ uint16(11), uint16(59), uint16(126), uint16(127), uint16(128), uint16(238), uint16(19), uint16(26), uint16(191), uint16(249), + /* 750 */ uint16(23), uint16(164), uint16(165), uint16(228), uint16(191), uint16(213), uint16(214), uint16(213), uint16(214), uint16(102), + /* 760 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), + /* 770 */ uint16(43), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), + /* 780 */ uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(19), uint16(241), uint16(115), uint16(116), uint16(117), + /* 790 */ uint16(115), uint16(116), uint16(117), uint16(191), uint16(250), uint16(238), uint16(251), uint16(115), uint16(116), uint16(117), + /* 800 */ uint16(157), uint16(23), uint16(159), uint16(191), uint16(26), uint16(191), uint16(111), uint16(112), uint16(301), uint16(43), + /* 810 */ uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), + /* 820 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(142), uint16(213), uint16(214), uint16(213), uint16(214), uint16(102), + /* 830 */ uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), + /* 840 */ uint16(228), uint16(191), uint16(228), uint16(191), uint16(191), uint16(207), uint16(208), uint16(209), uint16(126), uint16(127), + /* 850 */ uint16(128), uint16(133), uint16(289), uint16(135), uint16(136), uint16(19), uint16(127), uint16(128), uint16(301), uint16(7), + /* 860 */ uint16(8), uint16(9), uint16(141), uint16(213), uint16(214), uint16(213), uint16(214), uint16(265), uint16(102), uint16(103), + /* 870 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(43), + /* 880 */ uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), + /* 890 */ uint16(54), uint16(55), uint16(56), uint16(57), uint16(191), uint16(117), uint16(191), uint16(22), uint16(23), uint16(19), + /* 900 */ uint16(250), uint16(26), uint16(250), uint16(191), uint16(223), uint16(191), uint16(126), uint16(127), uint16(128), uint16(205), + /* 910 */ uint16(206), uint16(205), uint16(206), uint16(260), uint16(21), uint16(202), uint16(213), uint16(214), uint16(213), uint16(214), + /* 920 */ uint16(142), uint16(270), uint16(208), uint16(209), uint16(158), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), + /* 930 */ uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(102), uint16(103), + /* 940 */ uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(236), + /* 950 */ uint16(237), uint16(12), uint16(191), uint16(250), uint16(76), uint16(250), uint16(191), uint16(22), uint16(23), uint16(308), + /* 960 */ uint16(309), uint16(26), uint16(249), uint16(202), uint16(191), uint16(191), uint16(27), uint16(89), uint16(191), uint16(202), + /* 970 */ uint16(92), uint16(202), uint16(260), uint16(80), uint16(213), uint16(214), uint16(101), uint16(203), uint16(213), uint16(214), + /* 980 */ uint16(22), uint16(42), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), + /* 990 */ uint16(110), uint16(111), uint16(112), uint16(228), uint16(158), uint16(281), uint16(108), uint16(236), uint16(237), uint16(225), + /* 1000 */ uint16(191), uint16(227), uint16(63), uint16(236), uint16(237), uint16(236), uint16(237), uint16(191), uint16(235), uint16(191), + /* 1010 */ uint16(249), uint16(250), uint16(73), uint16(241), uint16(19), uint16(122), uint16(249), uint16(59), uint16(249), uint16(24), + /* 1020 */ uint16(259), uint16(29), uint16(134), uint16(251), uint16(191), uint16(33), uint16(22), uint16(139), uint16(24), uint16(213), + /* 1030 */ uint16(214), uint16(213), uint16(214), uint16(191), uint16(19), uint16(210), uint16(101), uint16(191), uint16(43), uint16(44), + /* 1040 */ uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), + /* 1050 */ uint16(55), uint16(56), uint16(57), uint16(160), uint16(19), uint16(213), uint16(214), uint16(65), uint16(43), uint16(44), + /* 1060 */ uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), + /* 1070 */ uint16(55), uint16(56), uint16(57), uint16(191), uint16(116), uint16(22), uint16(191), uint16(24), uint16(43), uint16(44), + /* 1080 */ uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), uint16(52), uint16(53), uint16(54), + /* 1090 */ uint16(55), uint16(56), uint16(57), uint16(191), uint16(261), uint16(213), uint16(214), uint16(102), uint16(103), uint16(104), + /* 1100 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(59), uint16(19), + /* 1110 */ uint16(191), uint16(265), uint16(59), uint16(288), uint16(191), uint16(213), uint16(214), uint16(102), uint16(103), uint16(104), + /* 1120 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(35), uint16(191), + /* 1130 */ uint16(66), uint16(191), uint16(213), uint16(214), uint16(191), uint16(270), uint16(46), uint16(102), uint16(103), uint16(104), + /* 1140 */ uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), uint16(112), uint16(191), uint16(85), + /* 1150 */ uint16(265), uint16(213), uint16(214), uint16(213), uint16(214), uint16(106), uint16(107), uint16(19), uint16(94), uint16(66), + /* 1160 */ uint16(137), uint16(138), uint16(191), uint16(114), uint16(115), uint16(116), uint16(117), uint16(74), uint16(119), uint16(116), + /* 1170 */ uint16(213), uint16(214), uint16(202), uint16(308), uint16(309), uint16(306), uint16(127), uint16(191), uint16(235), uint16(310), + /* 1180 */ uint16(59), uint16(191), uint16(44), uint16(45), uint16(46), uint16(47), uint16(48), uint16(49), uint16(50), uint16(51), + /* 1190 */ uint16(52), uint16(53), uint16(54), uint16(55), uint16(56), uint16(57), uint16(191), uint16(76), uint16(196), uint16(213), + /* 1200 */ uint16(214), uint16(152), uint16(12), uint16(154), uint16(114), uint16(191), uint16(236), uint16(237), uint16(87), uint16(145), + /* 1210 */ uint16(89), uint16(19), uint16(20), uint16(92), uint16(22), uint16(22), uint16(23), uint16(27), uint16(191), uint16(249), + /* 1220 */ uint16(130), uint16(202), uint16(129), uint16(202), uint16(191), uint16(235), uint16(306), uint16(152), uint16(36), uint16(154), + /* 1230 */ uint16(310), uint16(191), uint16(42), uint16(191), uint16(191), uint16(191), uint16(115), uint16(116), uint16(117), uint16(191), + /* 1240 */ uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110), uint16(111), + /* 1250 */ uint16(112), uint16(59), uint16(99), uint16(63), uint16(191), uint16(236), uint16(237), uint16(236), uint16(237), uint16(191), + /* 1260 */ uint16(289), uint16(213), uint16(214), uint16(71), uint16(191), uint16(144), uint16(261), uint16(191), uint16(249), uint16(191), + /* 1270 */ uint16(249), uint16(19), uint16(20), uint16(81), uint16(22), uint16(235), uint16(213), uint16(214), uint16(235), uint16(191), + /* 1280 */ uint16(278), uint16(213), uint16(214), uint16(191), uint16(282), uint16(132), uint16(213), uint16(214), uint16(36), uint16(213), + /* 1290 */ uint16(214), uint16(191), uint16(100), uint16(191), uint16(101), uint16(191), uint16(191), uint16(191), uint16(106), uint16(107), + /* 1300 */ uint16(48), uint16(213), uint16(214), uint16(261), uint16(191), uint16(113), uint16(191), uint16(115), uint16(116), uint16(117), + /* 1310 */ uint16(191), uint16(59), uint16(120), uint16(213), uint16(214), uint16(213), uint16(214), uint16(213), uint16(214), uint16(213), + /* 1320 */ uint16(214), uint16(22), uint16(23), uint16(71), uint16(237), uint16(59), uint16(213), uint16(214), uint16(191), uint16(137), + /* 1330 */ uint16(138), uint16(191), uint16(213), uint16(214), uint16(191), uint16(191), uint16(249), uint16(85), uint16(191), uint16(261), + /* 1340 */ uint16(191), uint16(26), uint16(90), uint16(15), uint16(152), uint16(153), uint16(154), uint16(155), uint16(156), uint16(19), + /* 1350 */ uint16(213), uint16(214), uint16(100), uint16(213), uint16(214), uint16(191), uint16(213), uint16(214), uint16(106), uint16(107), + /* 1360 */ uint16(213), uint16(214), uint16(213), uint16(214), uint16(191), uint16(113), uint16(261), uint16(115), uint16(116), uint16(117), + /* 1370 */ uint16(253), uint16(254), uint16(120), uint16(229), uint16(191), uint16(191), uint16(191), uint16(213), uint16(214), uint16(191), + /* 1380 */ uint16(306), uint16(289), uint16(116), uint16(26), uint16(310), uint16(191), uint16(213), uint16(214), uint16(60), uint16(19), + /* 1390 */ uint16(296), uint16(297), uint16(24), uint16(191), uint16(46), uint16(191), uint16(213), uint16(214), uint16(213), uint16(214), + /* 1400 */ uint16(101), uint16(213), uint16(214), uint16(191), uint16(152), uint16(153), uint16(154), uint16(155), uint16(156), uint16(0), + /* 1410 */ uint16(1), uint16(2), uint16(191), uint16(229), uint16(5), uint16(213), uint16(214), uint16(213), uint16(214), uint16(10), + /* 1420 */ uint16(11), uint16(12), uint16(13), uint16(14), uint16(1), uint16(2), uint16(17), uint16(191), uint16(5), uint16(19), + /* 1430 */ uint16(20), uint16(191), uint16(22), uint16(10), uint16(11), uint16(12), uint16(13), uint16(14), uint16(191), uint16(30), + /* 1440 */ uint16(17), uint16(32), uint16(241), uint16(148), uint16(149), uint16(115), uint16(36), uint16(191), uint16(241), uint16(40), + /* 1450 */ uint16(191), uint16(26), uint16(251), uint16(30), uint16(191), uint16(32), uint16(141), uint16(22), uint16(251), uint16(5), + /* 1460 */ uint16(213), uint16(214), uint16(114), uint16(40), uint16(10), uint16(11), uint16(12), uint16(13), uint16(14), uint16(59), + /* 1470 */ uint16(134), uint16(17), uint16(213), uint16(214), uint16(191), uint16(139), uint16(213), uint16(214), uint16(191), uint16(70), + /* 1480 */ uint16(191), uint16(71), uint16(125), uint16(191), uint16(30), uint16(115), uint16(32), uint16(78), uint16(53), uint16(191), + /* 1490 */ uint16(81), uint16(191), uint16(191), uint16(70), uint16(40), uint16(85), uint16(213), uint16(214), uint16(191), uint16(22), + /* 1500 */ uint16(90), uint16(78), uint16(213), uint16(214), uint16(81), uint16(213), uint16(214), uint16(98), uint16(140), uint16(120), + /* 1510 */ uint16(100), uint16(213), uint16(214), uint16(213), uint16(214), uint16(23), uint16(106), uint16(107), uint16(26), uint16(130), + /* 1520 */ uint16(191), uint16(98), uint16(191), uint16(113), uint16(70), uint16(115), uint16(116), uint16(117), uint16(23), uint16(22), + /* 1530 */ uint16(120), uint16(26), uint16(78), uint16(19), uint16(191), uint16(81), uint16(19), uint16(20), uint16(61), uint16(22), + /* 1540 */ uint16(191), uint16(132), uint16(213), uint16(214), uint16(213), uint16(214), uint16(137), uint16(138), uint16(59), uint16(191), + /* 1550 */ uint16(191), uint16(191), uint16(98), uint16(36), uint16(128), uint16(132), uint16(213), uint16(214), uint16(128), uint16(59), + /* 1560 */ uint16(137), uint16(138), uint16(152), uint16(153), uint16(154), uint16(155), uint16(156), uint16(83), uint16(84), uint16(144), + /* 1570 */ uint16(161), uint16(213), uint16(214), uint16(213), uint16(214), uint16(23), uint16(59), uint16(151), uint16(26), uint16(23), + /* 1580 */ uint16(23), uint16(151), uint16(26), uint16(26), uint16(161), uint16(59), uint16(132), uint16(23), uint16(71), uint16(191), + /* 1590 */ uint16(26), uint16(137), uint16(138), uint16(119), uint16(120), uint16(23), uint16(19), uint16(20), uint16(26), uint16(22), + /* 1600 */ uint16(223), uint16(23), uint16(85), uint16(23), uint16(26), uint16(116), uint16(26), uint16(90), uint16(191), uint16(7), + /* 1610 */ uint16(8), uint16(97), uint16(152), uint16(36), uint16(154), uint16(161), uint16(116), uint16(100), uint16(23), uint16(23), + /* 1620 */ uint16(191), uint16(26), uint16(26), uint16(106), uint16(107), uint16(191), uint16(23), uint16(223), uint16(23), uint16(26), + /* 1630 */ uint16(113), uint16(26), uint16(115), uint16(116), uint16(117), uint16(23), uint16(59), uint16(120), uint16(26), uint16(191), + /* 1640 */ uint16(191), uint16(191), uint16(116), uint16(255), uint16(191), uint16(252), uint16(191), uint16(140), uint16(71), uint16(191), + /* 1650 */ uint16(315), uint16(233), uint16(191), uint16(191), uint16(191), uint16(191), uint16(191), uint16(191), uint16(191), uint16(191), + /* 1660 */ uint16(191), uint16(285), uint16(284), uint16(239), uint16(252), uint16(252), uint16(252), uint16(252), uint16(240), uint16(152), + /* 1670 */ uint16(153), uint16(154), uint16(155), uint16(156), uint16(189), uint16(294), uint16(268), uint16(100), uint16(242), uint16(268), + /* 1680 */ uint16(264), uint16(211), uint16(290), uint16(106), uint16(107), uint16(108), uint16(264), uint16(256), uint16(256), uint16(243), + /* 1690 */ uint16(113), uint16(290), uint16(115), uint16(116), uint16(117), uint16(268), uint16(217), uint16(120), uint16(226), uint16(243), + /* 1700 */ uint16(222), uint16(268), uint16(216), uint16(19), uint16(20), uint16(246), uint16(22), uint16(216), uint16(256), uint16(216), + /* 1710 */ uint16(194), uint16(60), uint16(38), uint16(242), uint16(277), uint16(294), uint16(240), uint16(242), uint16(198), uint16(246), + /* 1720 */ uint16(36), uint16(140), uint16(198), uint16(198), uint16(19), uint16(20), uint16(150), uint16(22), uint16(149), uint16(152), + /* 1730 */ uint16(153), uint16(154), uint16(155), uint16(156), uint16(294), uint16(291), uint16(291), uint16(280), uint16(22), uint16(43), + /* 1740 */ uint16(231), uint16(36), uint16(18), uint16(59), uint16(234), uint16(234), uint16(234), uint16(234), uint16(267), uint16(269), + /* 1750 */ uint16(18), uint16(198), uint16(197), uint16(231), uint16(148), uint16(71), uint16(269), uint16(269), uint16(243), uint16(231), + /* 1760 */ uint16(198), uint16(243), uint16(267), uint16(197), uint16(59), uint16(157), uint16(243), uint16(198), uint16(62), uint16(287), + /* 1770 */ uint16(243), uint16(197), uint16(22), uint16(198), uint16(114), uint16(64), uint16(71), uint16(218), uint16(218), uint16(197), + /* 1780 */ uint16(286), uint16(198), uint16(197), uint16(215), uint16(100), uint16(215), uint16(215), uint16(224), uint16(22), uint16(125), + /* 1790 */ uint16(106), uint16(107), uint16(164), uint16(24), uint16(221), uint16(112), uint16(143), uint16(113), uint16(302), uint16(115), + /* 1800 */ uint16(116), uint16(117), uint16(218), uint16(215), uint16(120), uint16(100), uint16(217), uint16(221), uint16(215), uint16(215), + /* 1810 */ uint16(309), uint16(106), uint16(107), uint16(215), uint16(224), uint16(279), uint16(279), uint16(218), uint16(113), uint16(258), + /* 1820 */ uint16(115), uint16(116), uint16(117), uint16(114), uint16(257), uint16(120), uint16(91), uint16(198), uint16(82), uint16(147), + /* 1830 */ uint16(144), uint16(22), uint16(274), uint16(314), uint16(198), uint16(314), uint16(152), uint16(153), uint16(154), uint16(155), + /* 1840 */ uint16(156), uint16(276), uint16(157), uint16(146), uint16(145), uint16(258), uint16(25), uint16(247), uint16(257), uint16(201), + /* 1850 */ uint16(258), uint16(26), uint16(200), uint16(13), uint16(257), uint16(244), uint16(246), uint16(152), uint16(153), uint16(154), + /* 1860 */ uint16(155), uint16(156), uint16(258), uint16(262), uint16(257), uint16(247), uint16(245), uint16(243), uint16(192), uint16(192), + /* 1870 */ uint16(6), uint16(262), uint16(204), uint16(210), uint16(219), uint16(210), uint16(210), uint16(190), uint16(190), uint16(190), + /* 1880 */ uint16(210), uint16(219), uint16(204), uint16(211), uint16(211), uint16(210), uint16(4), uint16(3), uint16(22), uint16(162), + /* 1890 */ uint16(15), uint16(23), uint16(16), uint16(23), uint16(204), uint16(138), uint16(129), uint16(150), uint16(26), uint16(141), + /* 1900 */ uint16(20), uint16(24), uint16(143), uint16(16), uint16(1), uint16(141), uint16(129), uint16(129), uint16(61), uint16(53), + /* 1910 */ uint16(37), uint16(150), uint16(297), uint16(300), uint16(300), uint16(53), uint16(53), uint16(129), uint16(53), uint16(115), + /* 1920 */ uint16(34), uint16(140), uint16(1), uint16(5), uint16(22), uint16(114), uint16(68), uint16(26), uint16(160), uint16(68), + /* 1930 */ uint16(75), uint16(41), uint16(140), uint16(114), uint16(24), uint16(20), uint16(19), uint16(130), uint16(124), uint16(23), + /* 1940 */ uint16(96), uint16(22), uint16(22), uint16(37), uint16(22), uint16(67), uint16(22), uint16(59), uint16(67), uint16(24), + /* 1950 */ uint16(22), uint16(28), uint16(67), uint16(23), uint16(148), uint16(22), uint16(97), uint16(23), uint16(23), uint16(23), + /* 1960 */ uint16(140), uint16(23), uint16(22), uint16(26), uint16(23), uint16(23), uint16(115), uint16(22), uint16(142), uint16(26), + /* 1970 */ uint16(75), uint16(88), uint16(75), uint16(34), uint16(23), uint16(86), uint16(44), uint16(22), uint16(34), uint16(26), + /* 1980 */ uint16(34), uint16(34), uint16(34), uint16(34), uint16(93), uint16(24), uint16(26), uint16(23), uint16(34), uint16(23), + /* 1990 */ uint16(23), uint16(23), uint16(23), uint16(11), uint16(23), uint16(22), uint16(26), uint16(22), uint16(22), uint16(15), + /* 2000 */ uint16(23), uint16(23), uint16(22), uint16(22), uint16(1), uint16(26), uint16(23), uint16(140), uint16(134), uint16(140), + /* 2010 */ uint16(1), uint16(140), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(140), + /* 2020 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2030 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2040 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2050 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2060 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2070 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2080 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2090 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2100 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2110 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2120 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2130 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2140 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2150 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2160 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2170 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2180 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2190 */ uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), uint16(316), + /* 2200 */ uint16(316), uint16(316), uint16(316), +} /* sqlite3.c:157670:25 */ +var yy_shift_ofst = [570]uint16{ + /* 0 */ uint16(1423), uint16(1409), uint16(1454), uint16(1192), uint16(1192), uint16(36), uint16(1252), uint16(1410), uint16(1517), uint16(1684), + /* 10 */ uint16(1684), uint16(1684), uint16(292), uint16(0), uint16(0), uint16(180), uint16(1015), uint16(1684), uint16(1684), uint16(1684), + /* 20 */ uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), + /* 30 */ uint16(1049), uint16(1049), uint16(1121), uint16(1121), uint16(54), uint16(400), uint16(36), uint16(36), uint16(36), uint16(36), + /* 40 */ uint16(36), uint16(40), uint16(110), uint16(219), uint16(289), uint16(396), uint16(439), uint16(509), uint16(548), uint16(618), + /* 50 */ uint16(657), uint16(727), uint16(766), uint16(836), uint16(995), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), + /* 60 */ uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), uint16(1015), + /* 70 */ uint16(1015), uint16(1015), uint16(1015), uint16(1035), uint16(1015), uint16(1138), uint16(880), uint16(880), uint16(1577), uint16(1684), + /* 80 */ uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), + /* 90 */ uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), + /* 100 */ uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), + /* 110 */ uint16(1684), uint16(1684), uint16(1684), uint16(1705), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), + /* 120 */ uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(1684), uint16(146), uint16(84), uint16(84), + /* 130 */ uint16(84), uint16(84), uint16(84), uint16(362), uint16(269), uint16(125), uint16(97), uint16(453), uint16(66), uint16(66), + /* 140 */ uint16(893), uint16(1090), uint16(66), uint16(66), uint16(533), uint16(533), uint16(66), uint16(554), uint16(554), uint16(554), + /* 150 */ uint16(554), uint16(192), uint16(587), uint16(587), uint16(695), uint16(25), uint16(2020), uint16(2020), uint16(290), uint16(290), + /* 160 */ uint16(290), uint16(200), uint16(514), uint16(514), uint16(514), uint16(514), uint16(939), uint16(939), uint16(442), uint16(875), + /* 170 */ uint16(935), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), + /* 180 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), + /* 190 */ uint16(66), uint16(601), uint16(601), uint16(66), uint16(729), uint16(878), uint16(878), uint16(1266), uint16(1266), uint16(552), + /* 200 */ uint16(1023), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(307), uint16(490), + /* 210 */ uint16(490), uint16(567), uint16(393), uint16(517), uint16(467), uint16(672), uint16(242), uint16(682), uint16(675), uint16(66), + /* 220 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(616), + /* 230 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), + /* 240 */ uint16(66), uint16(66), uint16(1093), uint16(1093), uint16(1093), uint16(66), uint16(66), uint16(66), uint16(778), uint16(66), + /* 250 */ uint16(66), uint16(66), uint16(1053), uint16(1064), uint16(66), uint16(66), uint16(1190), uint16(66), uint16(66), uint16(66), + /* 260 */ uint16(66), uint16(66), uint16(66), uint16(66), uint16(66), uint16(722), uint16(992), uint16(718), uint16(253), uint16(253), + /* 270 */ uint16(253), uint16(253), uint16(338), uint16(718), uint16(718), uint16(888), uint16(403), uint16(852), uint16(1328), uint16(254), + /* 280 */ uint16(1295), uint16(721), uint16(1330), uint16(1295), uint16(1330), uint16(1370), uint16(234), uint16(254), uint16(254), uint16(234), + /* 290 */ uint16(254), uint16(721), uint16(1370), uint16(1357), uint16(1492), uint16(1348), uint16(385), uint16(385), uint16(385), uint16(1330), + /* 300 */ uint16(1425), uint16(1425), uint16(643), uint16(1315), uint16(1336), uint16(1004), uint16(1651), uint16(1651), uint16(1581), uint16(1581), + /* 310 */ uint16(1674), uint16(1674), uint16(1581), uint16(1576), uint16(1579), uint16(1716), uint16(1696), uint16(1724), uint16(1724), uint16(1724), + /* 320 */ uint16(1724), uint16(1581), uint16(1732), uint16(1606), uint16(1579), uint16(1579), uint16(1606), uint16(1716), uint16(1696), uint16(1606), + /* 330 */ uint16(1696), uint16(1606), uint16(1581), uint16(1732), uint16(1608), uint16(1706), uint16(1581), uint16(1732), uint16(1750), uint16(1581), + /* 340 */ uint16(1732), uint16(1581), uint16(1732), uint16(1750), uint16(1660), uint16(1660), uint16(1660), uint16(1711), uint16(1766), uint16(1766), + /* 350 */ uint16(1750), uint16(1660), uint16(1664), uint16(1660), uint16(1711), uint16(1660), uint16(1660), uint16(1628), uint16(1769), uint16(1683), + /* 360 */ uint16(1683), uint16(1750), uint16(1653), uint16(1709), uint16(1653), uint16(1709), uint16(1653), uint16(1709), uint16(1653), uint16(1709), + /* 370 */ uint16(1581), uint16(1735), uint16(1735), uint16(1746), uint16(1746), uint16(1682), uint16(1686), uint16(1809), uint16(1581), uint16(1685), + /* 380 */ uint16(1682), uint16(1697), uint16(1699), uint16(1606), uint16(1821), uint16(1825), uint16(1840), uint16(1840), uint16(1864), uint16(1864), + /* 390 */ uint16(1864), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), + /* 400 */ uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(2020), uint16(599), uint16(223), uint16(1193), uint16(1299), + /* 410 */ uint16(228), uint16(780), uint16(958), uint16(1505), uint16(1153), uint16(1435), uint16(1368), uint16(1426), uint16(1430), uint16(1552), + /* 420 */ uint16(1477), uint16(1556), uint16(1557), uint16(1564), uint16(1572), uint16(1578), uint16(1580), uint16(1489), uint16(1474), uint16(1602), + /* 430 */ uint16(1389), uint16(1514), uint16(1500), uint16(1595), uint16(1596), uint16(1484), uint16(1603), uint16(1075), uint16(1460), uint16(1605), + /* 440 */ uint16(1612), uint16(1526), uint16(1507), uint16(1882), uint16(1884), uint16(1866), uint16(1727), uint16(1875), uint16(1876), uint16(1868), + /* 450 */ uint16(1870), uint16(1757), uint16(1747), uint16(1767), uint16(1872), uint16(1872), uint16(1877), uint16(1758), uint16(1880), uint16(1759), + /* 460 */ uint16(1887), uint16(1903), uint16(1764), uint16(1777), uint16(1872), uint16(1778), uint16(1847), uint16(1873), uint16(1872), uint16(1761), + /* 470 */ uint16(1856), uint16(1862), uint16(1863), uint16(1865), uint16(1788), uint16(1804), uint16(1886), uint16(1781), uint16(1921), uint16(1918), + /* 480 */ uint16(1902), uint16(1811), uint16(1768), uint16(1858), uint16(1901), uint16(1861), uint16(1855), uint16(1890), uint16(1792), uint16(1819), + /* 490 */ uint16(1910), uint16(1915), uint16(1917), uint16(1807), uint16(1814), uint16(1919), uint16(1878), uint16(1920), uint16(1922), uint16(1916), + /* 500 */ uint16(1924), uint16(1881), uint16(1888), uint16(1925), uint16(1844), uint16(1923), uint16(1928), uint16(1885), uint16(1906), uint16(1930), + /* 510 */ uint16(1806), uint16(1933), uint16(1934), uint16(1935), uint16(1936), uint16(1937), uint16(1938), uint16(1940), uint16(1859), uint16(1820), + /* 520 */ uint16(1941), uint16(1942), uint16(1851), uint16(1939), uint16(1945), uint16(1826), uint16(1943), uint16(1944), uint16(1946), uint16(1947), + /* 530 */ uint16(1948), uint16(1883), uint16(1895), uint16(1889), uint16(1932), uint16(1897), uint16(1891), uint16(1949), uint16(1951), uint16(1955), + /* 540 */ uint16(1961), uint16(1953), uint16(1960), uint16(1954), uint16(1964), uint16(1943), uint16(1966), uint16(1967), uint16(1968), uint16(1969), + /* 550 */ uint16(1970), uint16(1971), uint16(1973), uint16(1982), uint16(1975), uint16(1976), uint16(1977), uint16(1978), uint16(1980), uint16(1981), + /* 560 */ uint16(1979), uint16(1874), uint16(1867), uint16(1869), uint16(1871), uint16(1879), uint16(1983), uint16(1984), uint16(2003), uint16(2009), +} /* sqlite3.c:157896:33 */ +var yy_reduce_ofst = [406]int16{ + /* 0 */ int16(111), int16(168), int16(386), int16(761), int16(-176), int16(-174), int16(-191), int16(-189), int16(-181), int16(-178), + /* 10 */ int16(176), int16(263), int16(44), int16(-207), int16(-204), int16(-265), int16(-139), int16(-114), int16(158), int16(504), + /* 20 */ int16(525), int16(544), int16(612), int16(614), int16(650), int16(652), int16(765), int16(265), int16(703), int16(705), + /* 30 */ int16(70), int16(714), int16(-187), int16(127), int16(774), int16(713), int16(767), int16(769), int16(970), int16(1019), + /* 40 */ int16(1021), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), + /* 50 */ int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), + /* 60 */ int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), + /* 70 */ int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(394), int16(542), + /* 80 */ int16(816), int16(818), int16(842), int16(882), int16(902), int16(919), int16(938), int16(940), int16(957), int16(986), + /* 90 */ int16(1048), int16(1063), int16(1068), int16(1073), int16(1076), int16(1088), int16(1100), int16(1102), int16(1104), int16(1106), + /* 100 */ int16(1113), int16(1119), int16(1137), int16(1140), int16(1143), int16(1147), int16(1149), int16(1164), int16(1173), int16(1183), + /* 110 */ int16(1185), int16(1188), int16(1202), int16(1204), int16(1247), int16(1259), int16(1263), int16(1283), int16(1289), int16(1292), + /* 120 */ int16(1298), int16(1300), int16(1329), int16(1331), int16(1343), int16(1358), int16(1360), int16(-255), int16(-255), int16(-255), + /* 130 */ int16(-255), int16(-255), int16(-255), int16(-255), int16(-255), int16(196), int16(-255), int16(387), int16(-177), int16(507), + /* 140 */ int16(1002), int16(-219), int16(557), int16(-93), int16(-167), int16(638), int16(-121), int16(284), int16(500), int16(284), + /* 150 */ int16(500), int16(247), int16(651), int16(865), int16(-255), int16(-255), int16(-255), int16(-255), int16(-85), int16(-85), + /* 160 */ int16(-85), int16(237), int16(171), int16(602), int16(846), int16(885), int16(-212), int16(-203), int16(217), int16(380), + /* 170 */ int16(380), int16(-23), int16(161), int16(653), int16(712), int16(773), int16(943), int16(990), int16(1040), int16(563), + /* 180 */ int16(833), int16(971), int16(1005), int16(1042), int16(1092), int16(1078), int16(1043), int16(1144), int16(1184), int16(-186), + /* 190 */ int16(1105), int16(318), int16(869), int16(7), int16(825), int16(920), int16(1074), int16(704), int16(706), int16(390), + /* 200 */ int16(1087), int16(1094), int16(336), int16(545), int16(772), int16(1201), int16(1117), int16(1207), int16(-179), int16(-137), + /* 210 */ int16(-112), int16(-13), int16(18), int16(112), int16(197), int16(418), int16(495), int16(508), int16(777), int16(809), + /* 220 */ int16(923), int16(1014), int16(1027), int16(1033), int16(1044), int16(1115), int16(1194), int16(1212), int16(1221), int16(209), + /* 230 */ int16(1236), int16(1240), int16(1256), int16(1287), int16(1301), int16(1307), int16(1349), int16(1359), int16(1398), int16(1417), + /* 240 */ int16(1429), int16(1434), int16(681), int16(1377), int16(1404), int16(1448), int16(1449), int16(1450), int16(1388), int16(1453), + /* 250 */ int16(1455), int16(1458), int16(1393), int16(1335), int16(1461), int16(1462), int16(1418), int16(1463), int16(197), int16(1464), + /* 260 */ int16(1465), int16(1466), int16(1467), int16(1468), int16(1469), int16(1376), int16(1378), int16(1424), int16(1412), int16(1413), + /* 270 */ int16(1414), int16(1415), int16(1388), int16(1424), int16(1424), int16(1428), int16(1470), int16(1485), int16(1381), int16(1408), + /* 280 */ int16(1416), int16(1436), int16(1431), int16(1422), int16(1432), int16(1392), int16(1446), int16(1411), int16(1427), int16(1456), + /* 290 */ int16(1433), int16(1471), int16(1401), int16(1479), int16(1472), int16(1478), int16(1486), int16(1491), int16(1493), int16(1452), + /* 300 */ int16(1459), int16(1473), int16(1437), int16(1475), int16(1476), int16(1516), int16(1421), int16(1440), int16(1520), int16(1524), + /* 310 */ int16(1444), int16(1445), int16(1525), int16(1457), int16(1480), int16(1481), int16(1509), int16(1510), int16(1511), int16(1512), + /* 320 */ int16(1513), int16(1553), int16(1555), int16(1515), int16(1487), int16(1488), int16(1518), int16(1495), int16(1522), int16(1523), + /* 330 */ int16(1528), int16(1527), int16(1562), int16(1566), int16(1482), int16(1494), int16(1569), int16(1574), int16(1559), int16(1575), + /* 340 */ int16(1582), int16(1583), int16(1585), int16(1560), int16(1568), int16(1570), int16(1571), int16(1563), int16(1573), int16(1586), + /* 350 */ int16(1584), int16(1588), int16(1589), int16(1593), int16(1590), int16(1594), int16(1598), int16(1501), int16(1496), int16(1536), + /* 360 */ int16(1537), int16(1599), int16(1561), int16(1567), int16(1587), int16(1591), int16(1592), int16(1597), int16(1604), int16(1607), + /* 370 */ int16(1629), int16(1519), int16(1521), int16(1601), int16(1609), int16(1600), int16(1610), int16(1558), int16(1636), int16(1565), + /* 380 */ int16(1618), int16(1621), int16(1611), int16(1624), int16(1648), int16(1652), int16(1676), int16(1677), int16(1687), int16(1688), + /* 390 */ int16(1689), int16(1613), int16(1614), int16(1615), int16(1668), int16(1663), int16(1665), int16(1666), int16(1670), int16(1678), + /* 400 */ int16(1655), int16(1662), int16(1672), int16(1673), int16(1675), int16(1690), +} /* sqlite3.c:157958:20 */ +var yy_default = [570]uint16{ + /* 0 */ uint16(1623), uint16(1623), uint16(1623), uint16(1453), uint16(1223), uint16(1332), uint16(1223), uint16(1223), uint16(1223), uint16(1453), + /* 10 */ uint16(1453), uint16(1453), uint16(1223), uint16(1362), uint16(1362), uint16(1506), uint16(1254), uint16(1223), uint16(1223), uint16(1223), + /* 20 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1452), uint16(1223), uint16(1223), + /* 30 */ uint16(1223), uint16(1223), uint16(1541), uint16(1541), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 40 */ uint16(1223), uint16(1223), uint16(1371), uint16(1223), uint16(1378), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 50 */ uint16(1454), uint16(1455), uint16(1223), uint16(1223), uint16(1223), uint16(1505), uint16(1507), uint16(1470), uint16(1385), uint16(1384), + /* 60 */ uint16(1383), uint16(1382), uint16(1488), uint16(1349), uint16(1376), uint16(1369), uint16(1373), uint16(1448), uint16(1449), uint16(1447), + /* 70 */ uint16(1451), uint16(1455), uint16(1454), uint16(1223), uint16(1372), uint16(1419), uint16(1433), uint16(1418), uint16(1223), uint16(1223), + /* 80 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 90 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 100 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 110 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 120 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1427), uint16(1432), uint16(1438), + /* 130 */ uint16(1431), uint16(1428), uint16(1421), uint16(1420), uint16(1422), uint16(1223), uint16(1423), uint16(1223), uint16(1223), uint16(1223), + /* 140 */ uint16(1244), uint16(1296), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1525), uint16(1524), uint16(1223), + /* 150 */ uint16(1223), uint16(1254), uint16(1413), uint16(1412), uint16(1424), uint16(1425), uint16(1435), uint16(1434), uint16(1513), uint16(1576), + /* 160 */ uint16(1575), uint16(1471), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1541), uint16(1223), + /* 170 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 180 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 190 */ uint16(1223), uint16(1541), uint16(1541), uint16(1223), uint16(1254), uint16(1541), uint16(1541), uint16(1250), uint16(1250), uint16(1356), + /* 200 */ uint16(1223), uint16(1520), uint16(1323), uint16(1323), uint16(1323), uint16(1323), uint16(1332), uint16(1323), uint16(1223), uint16(1223), + /* 210 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 220 */ uint16(1223), uint16(1223), uint16(1223), uint16(1510), uint16(1508), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 230 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 240 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 250 */ uint16(1223), uint16(1223), uint16(1328), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 260 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1570), uint16(1223), uint16(1483), uint16(1310), uint16(1328), uint16(1328), + /* 270 */ uint16(1328), uint16(1328), uint16(1330), uint16(1311), uint16(1309), uint16(1322), uint16(1255), uint16(1230), uint16(1615), uint16(1388), + /* 280 */ uint16(1377), uint16(1329), uint16(1351), uint16(1377), uint16(1351), uint16(1612), uint16(1375), uint16(1388), uint16(1388), uint16(1375), + /* 290 */ uint16(1388), uint16(1329), uint16(1612), uint16(1271), uint16(1592), uint16(1266), uint16(1362), uint16(1362), uint16(1362), uint16(1351), + /* 300 */ uint16(1356), uint16(1356), uint16(1450), uint16(1329), uint16(1322), uint16(1223), uint16(1615), uint16(1615), uint16(1337), uint16(1337), + /* 310 */ uint16(1614), uint16(1614), uint16(1337), uint16(1471), uint16(1599), uint16(1397), uint16(1299), uint16(1305), uint16(1305), uint16(1305), + /* 320 */ uint16(1305), uint16(1337), uint16(1241), uint16(1375), uint16(1599), uint16(1599), uint16(1375), uint16(1397), uint16(1299), uint16(1375), + /* 330 */ uint16(1299), uint16(1375), uint16(1337), uint16(1241), uint16(1487), uint16(1609), uint16(1337), uint16(1241), uint16(1461), uint16(1337), + /* 340 */ uint16(1241), uint16(1337), uint16(1241), uint16(1461), uint16(1297), uint16(1297), uint16(1297), uint16(1286), uint16(1223), uint16(1223), + /* 350 */ uint16(1461), uint16(1297), uint16(1271), uint16(1297), uint16(1286), uint16(1297), uint16(1297), uint16(1559), uint16(1223), uint16(1465), + /* 360 */ uint16(1465), uint16(1461), uint16(1355), uint16(1350), uint16(1355), uint16(1350), uint16(1355), uint16(1350), uint16(1355), uint16(1350), + /* 370 */ uint16(1337), uint16(1551), uint16(1551), uint16(1365), uint16(1365), uint16(1370), uint16(1356), uint16(1456), uint16(1337), uint16(1223), + /* 380 */ uint16(1370), uint16(1368), uint16(1366), uint16(1375), uint16(1247), uint16(1289), uint16(1573), uint16(1573), uint16(1569), uint16(1569), + /* 390 */ uint16(1569), uint16(1620), uint16(1620), uint16(1520), uint16(1585), uint16(1254), uint16(1254), uint16(1254), uint16(1254), uint16(1585), + /* 400 */ uint16(1273), uint16(1273), uint16(1255), uint16(1255), uint16(1254), uint16(1585), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 410 */ uint16(1223), uint16(1223), uint16(1580), uint16(1223), uint16(1515), uint16(1472), uint16(1341), uint16(1223), uint16(1223), uint16(1223), + /* 420 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 430 */ uint16(1223), uint16(1526), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 440 */ uint16(1223), uint16(1223), uint16(1402), uint16(1223), uint16(1226), uint16(1517), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 450 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1379), uint16(1380), uint16(1342), uint16(1223), uint16(1223), uint16(1223), + /* 460 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1394), uint16(1223), uint16(1223), uint16(1223), uint16(1389), uint16(1223), + /* 470 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1611), uint16(1223), uint16(1223), + /* 480 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1486), uint16(1485), uint16(1223), uint16(1223), uint16(1339), uint16(1223), + /* 490 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 500 */ uint16(1223), uint16(1223), uint16(1269), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 510 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 520 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1367), uint16(1223), uint16(1223), uint16(1223), + /* 530 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 540 */ uint16(1223), uint16(1556), uint16(1357), uint16(1223), uint16(1223), uint16(1602), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 550 */ uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), uint16(1223), + /* 560 */ uint16(1596), uint16(1313), uint16(1404), uint16(1223), uint16(1403), uint16(1407), uint16(1223), uint16(1235), uint16(1223), uint16(1223), +} /* sqlite3.c:158001:27 */ //********* End of lemon-generated parsing tables **************************** // The next table maps tokens (terminal symbols) into fallback tokens. @@ -136577,7 +139047,7 @@ var yy_default = [553]uint16{ // This feature can be used, for example, to cause some keywords in a language // to revert to identifiers if they keyword does not apply in the context where // it appears. -var yyFallback = [181]uint16{ +var yyFallback = [183]uint16{ uint16(0), // $ => nothing uint16(0), // SEMI => nothing uint16(59), // EXPLAIN => ID @@ -136675,6 +139145,7 @@ var yyFallback = [181]uint16{ uint16(59), // TIES => ID uint16(59), // GENERATED => ID uint16(59), // ALWAYS => ID + uint16(59), // MATERIALIZED => ID uint16(59), // REINDEX => ID uint16(59), // RENAME => ID uint16(59), // CTIME_KW => ID @@ -136726,6 +139197,7 @@ var yyFallback = [181]uint16{ uint16(0), // HAVING => nothing uint16(0), // LIMIT => nothing uint16(0), // WHERE => nothing + uint16(0), // RETURNING => nothing uint16(0), // INTO => nothing uint16(0), // NOTHING => nothing uint16(0), // FLOAT => nothing @@ -136759,7 +139231,7 @@ var yyFallback = [181]uint16{ uint16(0), // SPAN => nothing uint16(0), // SPACE => nothing uint16(0), // ILLEGAL => nothing -} /* sqlite3.c:155196:25 */ +} /* sqlite3.c:158077:25 */ // The following structure represents a single element of the // parser's stack. Information stored includes: @@ -136781,9 +139253,9 @@ type yyStackEntry = struct { Fmajor uint16 _ [4]byte Fminor YYMINORTYPE -} /* sqlite3.c:155397:1 */ +} /* sqlite3.c:158280:1 */ -type YyStackEntry = yyStackEntry /* sqlite3.c:155404:29 */ +type YyStackEntry = yyStackEntry /* sqlite3.c:158287:29 */ // The state of the parser is completely contained in an instance of // the following structure @@ -136792,9 +139264,9 @@ type yyParser = struct { FpParse uintptr Fyystack [100]YyStackEntry FyystackEnd uintptr -} /* sqlite3.c:155408:1 */ +} /* sqlite3.c:158291:1 */ -type YyParser = yyParser /* sqlite3.c:155427:25 */ +type YyParser = yyParser /* sqlite3.c:158310:25 */ // Datatype of the argument to the memory allocated passed as the // second argument to sqlite3ParserAlloc() below. This can be changed by @@ -136802,7 +139274,7 @@ type YyParser = yyParser /* sqlite3.c:155427:25 */ // grammar. // Initialize a new parser that has already been allocated. -func Xsqlite3ParserInit(tls *libc.TLS, yypRawParser uintptr, pParse uintptr) { /* sqlite3.c:156215:21: */ +func Xsqlite3ParserInit(tls *libc.TLS, yypRawParser uintptr, pParse uintptr) { /* sqlite3.c:159118:21: */ var yypParser uintptr = yypRawParser (*YyParser)(unsafe.Pointer(yypParser)).FpParse = pParse (*YyParser)(unsafe.Pointer(yypParser)).Fyytos = yypParser + 16 /* &.yystack */ @@ -136817,7 +139289,7 @@ func Xsqlite3ParserInit(tls *libc.TLS, yypRawParser uintptr, pParse uintptr) { / // 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 *libc.TLS, yypParser uintptr, yymajor uint16, yypminor uintptr) { /* sqlite3.c:156273:13: */ +func yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor uintptr) { /* sqlite3.c:159176:13: */ var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse switch int32(yymajor) { @@ -136831,135 +139303,137 @@ func yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor ui // which appear on the RHS of the rule, but which are *not* used // inside the C code. //******** Begin destructor definitions ************************************** - case 200: + case 202: fallthrough // select - case 234: + case 236: fallthrough // selectnowith - case 235: + case 237: fallthrough // oneselect - case 247: /* values */ + case 249: /* values */ { - Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy539 */))) + Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy307 */))) } break - case 211: + case 213: fallthrough // term - case 212: + case 214: fallthrough // expr - case 241: - fallthrough // where_opt case 243: + fallthrough // where_opt + case 245: fallthrough // having_opt - case 255: - fallthrough // on_opt - case 271: - fallthrough // case_operand - case 273: - fallthrough // case_else - case 276: - fallthrough // vinto - case 283: - fallthrough // when_clause - case 288: - fallthrough // key_opt - case 302: /* filter_clause */ - { - Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy202 */))) - } - break - case 216: - fallthrough // eidlist_opt - case 226: - fallthrough // sortlist - case 227: - fallthrough // eidlist - case 239: - fallthrough // selcollist - case 242: - fallthrough // groupby_opt - case 244: - fallthrough // orderby_opt - case 248: - fallthrough // nexprlist - case 249: - fallthrough // sclp case 257: - fallthrough // exprlist - case 262: - fallthrough // setlist - case 270: - fallthrough // paren_exprlist - case 272: - fallthrough // case_exprlist - case 301: /* part_opt */ + fallthrough // on_opt + case 264: + fallthrough // where_opt_ret + case 275: + fallthrough // case_operand + case 277: + fallthrough // case_else + case 280: + fallthrough // vinto + case 287: + fallthrough // when_clause + case 292: + fallthrough // key_opt + case 308: /* filter_clause */ { - Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy242 */))) - } - break - case 233: - fallthrough // fullname - case 240: - fallthrough // from - case 251: - fallthrough // seltablist - case 252: - fallthrough // stl_prefix - case 258: /* xfullname */ - { - Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy47 */))) - } - break - case 236: /* wqlist */ - { - Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy131 */))) + Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy602 */))) } break + case 218: + fallthrough // eidlist_opt + case 228: + fallthrough // sortlist + case 229: + fallthrough // eidlist + case 241: + fallthrough // selcollist + case 244: + fallthrough // groupby_opt case 246: - fallthrough // window_clause - case 297: /* windowdefn_list */ - { - Xsqlite3WindowListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy303 */))) - } - break - case 256: - fallthrough // using_opt + fallthrough // orderby_opt + case 250: + fallthrough // nexprlist + case 251: + fallthrough // sclp case 259: + fallthrough // exprlist + case 265: + fallthrough // setlist + case 274: + fallthrough // paren_exprlist + case 276: + fallthrough // case_exprlist + case 307: /* part_opt */ + { + Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy338 */))) + } + break + case 235: + fallthrough // fullname + case 242: + fallthrough // from + case 253: + fallthrough // seltablist + case 254: + fallthrough // stl_prefix + case 260: /* xfullname */ + { + Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy291 */))) + } + break + case 238: /* wqlist */ + { + Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy195 */))) + } + break + case 248: + fallthrough // window_clause + case 303: /* windowdefn_list */ + { + Xsqlite3WindowListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy19 */))) + } + break + case 258: + fallthrough // using_opt + case 261: fallthrough // idlist - case 264: /* idlist_opt */ + case 267: /* idlist_opt */ { - Xsqlite3IdListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy600 */))) + Xsqlite3IdListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy288 */))) } break - case 266: + case 270: fallthrough // filter_over - case 298: + case 304: fallthrough // windowdefn - case 299: + case 305: fallthrough // window - case 300: + case 306: fallthrough // frame_opt - case 303: /* over_clause */ + case 309: /* over_clause */ { - Xsqlite3WindowDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy303 */))) + Xsqlite3WindowDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy19 */))) } break - case 279: + case 283: fallthrough // trigger_cmd_list - case 284: /* trigger_cmd */ + case 288: /* trigger_cmd */ { - Xsqlite3DeleteTriggerStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy447 */))) + Xsqlite3DeleteTriggerStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor /* .Fyy483 */))) } break - case 281: /* trigger_event */ + case 285: /* trigger_event */ { Xsqlite3IdListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*TrigEvent)(unsafe.Pointer(yypminor)).Fb) } break - case 305: + case 311: fallthrough // frame_bound - case 306: + case 312: fallthrough // frame_bound_s - case 307: /* frame_bound_e */ + case 313: /* frame_bound_e */ { Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*FrameBound)(unsafe.Pointer(yypminor)).FpExpr) } @@ -136974,7 +139448,7 @@ func yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor ui // // 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 *libc.TLS, pParser uintptr) { /* sqlite3.c:156397:13: */ +func yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:159301:13: */ var yytos uintptr yytos = libc.PostDecUintptr(&(*YyParser)(unsafe.Pointer(pParser)).Fyytos, 24) @@ -136982,7 +139456,7 @@ func yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:156397:1 } // Clear all secondary memory allocations from the parser -func Xsqlite3ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:156415:21: */ +func Xsqlite3ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:159319:21: */ var pParser uintptr = p for (*YyParser)(unsafe.Pointer(pParser)).Fyytos > pParser+16 /* &.yystack */ { yy_pop_parser_stack(tls, pParser) @@ -137005,7 +139479,7 @@ func Xsqlite3ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:156415:21: // Find the appropriate action for a parser given the terminal // look-ahead token iLookAhead. -func yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) uint16 { /* sqlite3.c:156495:21: */ +func yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) uint16 { /* sqlite3.c:159399:21: */ var i int32 if int32(stateno) > YY_MAX_SHIFT { @@ -137045,7 +139519,7 @@ func yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) uint // Find the appropriate action for a parser given the non-terminal // look-ahead token iLookAhead. -func yy_find_reduce_action(tls *libc.TLS, stateno uint16, iLookAhead uint16) uint16 { /* sqlite3.c:156560:21: */ +func yy_find_reduce_action(tls *libc.TLS, stateno uint16, iLookAhead uint16) uint16 { /* sqlite3.c:159464:21: */ var i int32 i = int32(yy_reduce_ofst[stateno]) @@ -137056,7 +139530,7 @@ func yy_find_reduce_action(tls *libc.TLS, stateno uint16, iLookAhead uint16) uin } // The following routine is called if the stack overflows. -func yyStackOverflow(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:156589:13: */ +func yyStackOverflow(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:159493:13: */ var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse for (*YyParser)(unsafe.Pointer(yypParser)).Fyytos > yypParser+16 /* &.yystack */ { @@ -137066,7 +139540,7 @@ func yyStackOverflow(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:156589:13: // stack every overflows //******* Begin %stack_overflow code ***************************************** - Xsqlite3ErrorMsg(tls, pParse, ts+24570 /* "parser stack ove..." */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+25076 /* "parser stack ove..." */, 0) //******* End %stack_overflow code ******************************************* (*YyParser)(unsafe.Pointer(yypParser)).FpParse = pParse @@ -137075,7 +139549,7 @@ func yyStackOverflow(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:156589:13: // Print tracing information for a SHIFT action // Perform a shift action. -func yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint16, yyMinor Token) { /* sqlite3.c:156632:13: */ +func yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint16, yyMinor Token) { /* sqlite3.c:159536:13: */ var yytos uintptr (*YyParser)(unsafe.Pointer(yypParser)).Fyytos += 24 if (*YyParser)(unsafe.Pointer(yypParser)).Fyytos > (*YyParser)(unsafe.Pointer(yypParser)).FyystackEnd { @@ -137095,397 +139569,410 @@ func yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint1 // For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side // of that rule -var yyRuleInfoLhs = [385]uint16{ - uint16(185), // (0) explain ::= EXPLAIN - uint16(185), // (1) explain ::= EXPLAIN QUERY PLAN - uint16(184), // (2) cmdx ::= cmd - uint16(186), // (3) cmd ::= BEGIN transtype trans_opt - uint16(187), // (4) transtype ::= - uint16(187), // (5) transtype ::= DEFERRED - uint16(187), // (6) transtype ::= IMMEDIATE - uint16(187), // (7) transtype ::= EXCLUSIVE - uint16(186), // (8) cmd ::= COMMIT|END trans_opt - uint16(186), // (9) cmd ::= ROLLBACK trans_opt - uint16(186), // (10) cmd ::= SAVEPOINT nm - uint16(186), // (11) cmd ::= RELEASE savepoint_opt nm - uint16(186), // (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm - uint16(191), // (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm - uint16(193), // (14) createkw ::= CREATE - uint16(195), // (15) ifnotexists ::= - uint16(195), // (16) ifnotexists ::= IF NOT EXISTS - uint16(194), // (17) temp ::= TEMP - uint16(194), // (18) temp ::= - uint16(192), // (19) create_table_args ::= LP columnlist conslist_opt RP table_options - uint16(192), // (20) create_table_args ::= AS select - uint16(199), // (21) table_options ::= - uint16(199), // (22) table_options ::= WITHOUT nm - uint16(201), // (23) columnname ::= nm typetoken - uint16(203), // (24) typetoken ::= - uint16(203), // (25) typetoken ::= typename LP signed RP - uint16(203), // (26) typetoken ::= typename LP signed COMMA signed RP - uint16(204), // (27) typename ::= typename ID|STRING - uint16(208), // (28) scanpt ::= - uint16(209), // (29) scantok ::= - uint16(210), // (30) ccons ::= CONSTRAINT nm - uint16(210), // (31) ccons ::= DEFAULT scantok term - uint16(210), // (32) ccons ::= DEFAULT LP expr RP - uint16(210), // (33) ccons ::= DEFAULT PLUS scantok term - uint16(210), // (34) ccons ::= DEFAULT MINUS scantok term - uint16(210), // (35) ccons ::= DEFAULT scantok ID|INDEXED - uint16(210), // (36) ccons ::= NOT NULL onconf - uint16(210), // (37) ccons ::= PRIMARY KEY sortorder onconf autoinc - uint16(210), // (38) ccons ::= UNIQUE onconf - uint16(210), // (39) ccons ::= CHECK LP expr RP - uint16(210), // (40) ccons ::= REFERENCES nm eidlist_opt refargs - uint16(210), // (41) ccons ::= defer_subclause - uint16(210), // (42) ccons ::= COLLATE ID|STRING - uint16(219), // (43) generated ::= LP expr RP - uint16(219), // (44) generated ::= LP expr RP ID - uint16(215), // (45) autoinc ::= - uint16(215), // (46) autoinc ::= AUTOINCR - uint16(217), // (47) refargs ::= - uint16(217), // (48) refargs ::= refargs refarg - uint16(220), // (49) refarg ::= MATCH nm - uint16(220), // (50) refarg ::= ON INSERT refact - uint16(220), // (51) refarg ::= ON DELETE refact - uint16(220), // (52) refarg ::= ON UPDATE refact - uint16(221), // (53) refact ::= SET NULL - uint16(221), // (54) refact ::= SET DEFAULT - uint16(221), // (55) refact ::= CASCADE - uint16(221), // (56) refact ::= RESTRICT - uint16(221), // (57) refact ::= NO ACTION - uint16(218), // (58) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt - uint16(218), // (59) defer_subclause ::= DEFERRABLE init_deferred_pred_opt - uint16(222), // (60) init_deferred_pred_opt ::= - uint16(222), // (61) init_deferred_pred_opt ::= INITIALLY DEFERRED - uint16(222), // (62) init_deferred_pred_opt ::= INITIALLY IMMEDIATE - uint16(198), // (63) conslist_opt ::= - uint16(224), // (64) tconscomma ::= COMMA - uint16(225), // (65) tcons ::= CONSTRAINT nm - uint16(225), // (66) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf - uint16(225), // (67) tcons ::= UNIQUE LP sortlist RP onconf - uint16(225), // (68) tcons ::= CHECK LP expr RP onconf - uint16(225), // (69) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt - uint16(228), // (70) defer_subclause_opt ::= - uint16(213), // (71) onconf ::= - uint16(213), // (72) onconf ::= ON CONFLICT resolvetype - uint16(229), // (73) orconf ::= - uint16(229), // (74) orconf ::= OR resolvetype - uint16(230), // (75) resolvetype ::= IGNORE - uint16(230), // (76) resolvetype ::= REPLACE - uint16(186), // (77) cmd ::= DROP TABLE ifexists fullname - uint16(232), // (78) ifexists ::= IF EXISTS - uint16(232), // (79) ifexists ::= - uint16(186), // (80) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select - uint16(186), // (81) cmd ::= DROP VIEW ifexists fullname - uint16(186), // (82) cmd ::= select - uint16(200), // (83) select ::= WITH wqlist selectnowith - uint16(200), // (84) select ::= WITH RECURSIVE wqlist selectnowith - uint16(200), // (85) select ::= selectnowith - uint16(234), // (86) selectnowith ::= selectnowith multiselect_op oneselect - uint16(237), // (87) multiselect_op ::= UNION - uint16(237), // (88) multiselect_op ::= UNION ALL - uint16(237), // (89) multiselect_op ::= EXCEPT|INTERSECT - uint16(235), // (90) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt - uint16(235), // (91) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt - uint16(247), // (92) values ::= VALUES LP nexprlist RP - uint16(247), // (93) values ::= values COMMA LP nexprlist RP - uint16(238), // (94) distinct ::= DISTINCT - uint16(238), // (95) distinct ::= ALL - uint16(238), // (96) distinct ::= - uint16(249), // (97) sclp ::= - uint16(239), // (98) selcollist ::= sclp scanpt expr scanpt as - uint16(239), // (99) selcollist ::= sclp scanpt STAR - uint16(239), // (100) selcollist ::= sclp scanpt nm DOT STAR - uint16(250), // (101) as ::= AS nm - uint16(250), // (102) as ::= - uint16(240), // (103) from ::= - uint16(240), // (104) from ::= FROM seltablist - uint16(252), // (105) stl_prefix ::= seltablist joinop - uint16(252), // (106) stl_prefix ::= - uint16(251), // (107) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt - uint16(251), // (108) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt - uint16(251), // (109) seltablist ::= stl_prefix LP select RP as on_opt using_opt - uint16(251), // (110) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt - uint16(196), // (111) dbnm ::= - uint16(196), // (112) dbnm ::= DOT nm - uint16(233), // (113) fullname ::= nm - uint16(233), // (114) fullname ::= nm DOT nm - uint16(258), // (115) xfullname ::= nm - uint16(258), // (116) xfullname ::= nm DOT nm - uint16(258), // (117) xfullname ::= nm DOT nm AS nm - uint16(258), // (118) xfullname ::= nm AS nm - uint16(253), // (119) joinop ::= COMMA|JOIN - uint16(253), // (120) joinop ::= JOIN_KW JOIN - uint16(253), // (121) joinop ::= JOIN_KW nm JOIN - uint16(253), // (122) joinop ::= JOIN_KW nm nm JOIN - uint16(255), // (123) on_opt ::= ON expr - uint16(255), // (124) on_opt ::= - uint16(254), // (125) indexed_opt ::= - uint16(254), // (126) indexed_opt ::= INDEXED BY nm - uint16(254), // (127) indexed_opt ::= NOT INDEXED - uint16(256), // (128) using_opt ::= USING LP idlist RP - uint16(256), // (129) using_opt ::= - uint16(244), // (130) orderby_opt ::= - uint16(244), // (131) orderby_opt ::= ORDER BY sortlist - uint16(226), // (132) sortlist ::= sortlist COMMA expr sortorder nulls - uint16(226), // (133) sortlist ::= expr sortorder nulls - uint16(214), // (134) sortorder ::= ASC - uint16(214), // (135) sortorder ::= DESC - uint16(214), // (136) sortorder ::= - uint16(260), // (137) nulls ::= NULLS FIRST - uint16(260), // (138) nulls ::= NULLS LAST - uint16(260), // (139) nulls ::= - uint16(242), // (140) groupby_opt ::= - uint16(242), // (141) groupby_opt ::= GROUP BY nexprlist - uint16(243), // (142) having_opt ::= - uint16(243), // (143) having_opt ::= HAVING expr - uint16(245), // (144) limit_opt ::= - uint16(245), // (145) limit_opt ::= LIMIT expr - uint16(245), // (146) limit_opt ::= LIMIT expr OFFSET expr - uint16(245), // (147) limit_opt ::= LIMIT expr COMMA expr - uint16(186), // (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt - uint16(241), // (149) where_opt ::= - uint16(241), // (150) where_opt ::= WHERE expr - uint16(186), // (151) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt - uint16(262), // (152) setlist ::= setlist COMMA nm EQ expr - uint16(262), // (153) setlist ::= setlist COMMA LP idlist RP EQ expr - uint16(262), // (154) setlist ::= nm EQ expr - uint16(262), // (155) setlist ::= LP idlist RP EQ expr - uint16(186), // (156) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert - uint16(186), // (157) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES - uint16(265), // (158) upsert ::= - uint16(265), // (159) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt - uint16(265), // (160) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING - uint16(265), // (161) upsert ::= ON CONFLICT DO NOTHING - uint16(263), // (162) insert_cmd ::= INSERT orconf - uint16(263), // (163) insert_cmd ::= REPLACE - uint16(264), // (164) idlist_opt ::= - uint16(264), // (165) idlist_opt ::= LP idlist RP - uint16(259), // (166) idlist ::= idlist COMMA nm - uint16(259), // (167) idlist ::= nm - uint16(212), // (168) expr ::= LP expr RP - uint16(212), // (169) expr ::= ID|INDEXED - uint16(212), // (170) expr ::= JOIN_KW - uint16(212), // (171) expr ::= nm DOT nm - uint16(212), // (172) expr ::= nm DOT nm DOT nm - uint16(211), // (173) term ::= NULL|FLOAT|BLOB - uint16(211), // (174) term ::= STRING - uint16(211), // (175) term ::= INTEGER - uint16(212), // (176) expr ::= VARIABLE - uint16(212), // (177) expr ::= expr COLLATE ID|STRING - uint16(212), // (178) expr ::= CAST LP expr AS typetoken RP - uint16(212), // (179) expr ::= ID|INDEXED LP distinct exprlist RP - uint16(212), // (180) expr ::= ID|INDEXED LP STAR RP - uint16(212), // (181) expr ::= ID|INDEXED LP distinct exprlist RP filter_over - uint16(212), // (182) expr ::= ID|INDEXED LP STAR RP filter_over - uint16(211), // (183) term ::= CTIME_KW - uint16(212), // (184) expr ::= LP nexprlist COMMA expr RP - uint16(212), // (185) expr ::= expr AND expr - uint16(212), // (186) expr ::= expr OR expr - uint16(212), // (187) expr ::= expr LT|GT|GE|LE expr - uint16(212), // (188) expr ::= expr EQ|NE expr - uint16(212), // (189) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr - uint16(212), // (190) expr ::= expr PLUS|MINUS expr - uint16(212), // (191) expr ::= expr STAR|SLASH|REM expr - uint16(212), // (192) expr ::= expr CONCAT expr - uint16(267), // (193) likeop ::= NOT LIKE_KW|MATCH - uint16(212), // (194) expr ::= expr likeop expr - uint16(212), // (195) expr ::= expr likeop expr ESCAPE expr - uint16(212), // (196) expr ::= expr ISNULL|NOTNULL - uint16(212), // (197) expr ::= expr NOT NULL - uint16(212), // (198) expr ::= expr IS expr - uint16(212), // (199) expr ::= expr IS NOT expr - uint16(212), // (200) expr ::= NOT expr - uint16(212), // (201) expr ::= BITNOT expr - uint16(212), // (202) expr ::= PLUS|MINUS expr - uint16(268), // (203) between_op ::= BETWEEN - uint16(268), // (204) between_op ::= NOT BETWEEN - uint16(212), // (205) expr ::= expr between_op expr AND expr - uint16(269), // (206) in_op ::= IN - uint16(269), // (207) in_op ::= NOT IN - uint16(212), // (208) expr ::= expr in_op LP exprlist RP - uint16(212), // (209) expr ::= LP select RP - uint16(212), // (210) expr ::= expr in_op LP select RP - uint16(212), // (211) expr ::= expr in_op nm dbnm paren_exprlist - uint16(212), // (212) expr ::= EXISTS LP select RP - uint16(212), // (213) expr ::= CASE case_operand case_exprlist case_else END - uint16(272), // (214) case_exprlist ::= case_exprlist WHEN expr THEN expr - uint16(272), // (215) case_exprlist ::= WHEN expr THEN expr - uint16(273), // (216) case_else ::= ELSE expr - uint16(273), // (217) case_else ::= - uint16(271), // (218) case_operand ::= expr - uint16(271), // (219) case_operand ::= - uint16(257), // (220) exprlist ::= - uint16(248), // (221) nexprlist ::= nexprlist COMMA expr - uint16(248), // (222) nexprlist ::= expr - uint16(270), // (223) paren_exprlist ::= - uint16(270), // (224) paren_exprlist ::= LP exprlist RP - uint16(186), // (225) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt - uint16(274), // (226) uniqueflag ::= UNIQUE - uint16(274), // (227) uniqueflag ::= - uint16(216), // (228) eidlist_opt ::= - uint16(216), // (229) eidlist_opt ::= LP eidlist RP - uint16(227), // (230) eidlist ::= eidlist COMMA nm collate sortorder - uint16(227), // (231) eidlist ::= nm collate sortorder - uint16(275), // (232) collate ::= - uint16(275), // (233) collate ::= COLLATE ID|STRING - uint16(186), // (234) cmd ::= DROP INDEX ifexists fullname - uint16(186), // (235) cmd ::= VACUUM vinto - uint16(186), // (236) cmd ::= VACUUM nm vinto - uint16(276), // (237) vinto ::= INTO expr - uint16(276), // (238) vinto ::= - uint16(186), // (239) cmd ::= PRAGMA nm dbnm - uint16(186), // (240) cmd ::= PRAGMA nm dbnm EQ nmnum - uint16(186), // (241) cmd ::= PRAGMA nm dbnm LP nmnum RP - uint16(186), // (242) cmd ::= PRAGMA nm dbnm EQ minus_num - uint16(186), // (243) cmd ::= PRAGMA nm dbnm LP minus_num RP - uint16(206), // (244) plus_num ::= PLUS INTEGER|FLOAT - uint16(207), // (245) minus_num ::= MINUS INTEGER|FLOAT - uint16(186), // (246) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END - uint16(278), // (247) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause - uint16(280), // (248) trigger_time ::= BEFORE|AFTER - uint16(280), // (249) trigger_time ::= INSTEAD OF - uint16(280), // (250) trigger_time ::= - uint16(281), // (251) trigger_event ::= DELETE|INSERT - uint16(281), // (252) trigger_event ::= UPDATE - uint16(281), // (253) trigger_event ::= UPDATE OF idlist - uint16(283), // (254) when_clause ::= - uint16(283), // (255) when_clause ::= WHEN expr - uint16(279), // (256) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI - uint16(279), // (257) trigger_cmd_list ::= trigger_cmd SEMI - uint16(285), // (258) trnm ::= nm DOT nm - uint16(286), // (259) tridxby ::= INDEXED BY nm - uint16(286), // (260) tridxby ::= NOT INDEXED - uint16(284), // (261) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt - uint16(284), // (262) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt - uint16(284), // (263) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt - uint16(284), // (264) trigger_cmd ::= scanpt select scanpt - uint16(212), // (265) expr ::= RAISE LP IGNORE RP - uint16(212), // (266) expr ::= RAISE LP raisetype COMMA nm RP - uint16(231), // (267) raisetype ::= ROLLBACK - uint16(231), // (268) raisetype ::= ABORT - uint16(231), // (269) raisetype ::= FAIL - uint16(186), // (270) cmd ::= DROP TRIGGER ifexists fullname - uint16(186), // (271) cmd ::= ATTACH database_kw_opt expr AS expr key_opt - uint16(186), // (272) cmd ::= DETACH database_kw_opt expr - uint16(288), // (273) key_opt ::= - uint16(288), // (274) key_opt ::= KEY expr - uint16(186), // (275) cmd ::= REINDEX - uint16(186), // (276) cmd ::= REINDEX nm dbnm - uint16(186), // (277) cmd ::= ANALYZE - uint16(186), // (278) cmd ::= ANALYZE nm dbnm - uint16(186), // (279) cmd ::= ALTER TABLE fullname RENAME TO nm - uint16(186), // (280) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist - uint16(289), // (281) add_column_fullname ::= fullname - uint16(186), // (282) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm - uint16(186), // (283) cmd ::= create_vtab - uint16(186), // (284) cmd ::= create_vtab LP vtabarglist RP - uint16(291), // (285) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm - uint16(293), // (286) vtabarg ::= - uint16(294), // (287) vtabargtoken ::= ANY - uint16(294), // (288) vtabargtoken ::= lp anylist RP - uint16(295), // (289) lp ::= LP - uint16(261), // (290) with ::= WITH wqlist - uint16(261), // (291) with ::= WITH RECURSIVE wqlist - uint16(236), // (292) wqlist ::= nm eidlist_opt AS LP select RP - uint16(236), // (293) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP - uint16(297), // (294) windowdefn_list ::= windowdefn - uint16(297), // (295) windowdefn_list ::= windowdefn_list COMMA windowdefn - uint16(298), // (296) windowdefn ::= nm AS LP window RP - uint16(299), // (297) window ::= PARTITION BY nexprlist orderby_opt frame_opt - uint16(299), // (298) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt - uint16(299), // (299) window ::= ORDER BY sortlist frame_opt - uint16(299), // (300) window ::= nm ORDER BY sortlist frame_opt - uint16(299), // (301) window ::= frame_opt - uint16(299), // (302) window ::= nm frame_opt - uint16(300), // (303) frame_opt ::= - uint16(300), // (304) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt - uint16(300), // (305) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt - uint16(304), // (306) range_or_rows ::= RANGE|ROWS|GROUPS - uint16(306), // (307) frame_bound_s ::= frame_bound - uint16(306), // (308) frame_bound_s ::= UNBOUNDED PRECEDING - uint16(307), // (309) frame_bound_e ::= frame_bound - uint16(307), // (310) frame_bound_e ::= UNBOUNDED FOLLOWING - uint16(305), // (311) frame_bound ::= expr PRECEDING|FOLLOWING - uint16(305), // (312) frame_bound ::= CURRENT ROW - uint16(308), // (313) frame_exclude_opt ::= - uint16(308), // (314) frame_exclude_opt ::= EXCLUDE frame_exclude - uint16(309), // (315) frame_exclude ::= NO OTHERS - uint16(309), // (316) frame_exclude ::= CURRENT ROW - uint16(309), // (317) frame_exclude ::= GROUP|TIES - uint16(246), // (318) window_clause ::= WINDOW windowdefn_list - uint16(266), // (319) filter_over ::= filter_clause over_clause - uint16(266), // (320) filter_over ::= over_clause - uint16(266), // (321) filter_over ::= filter_clause - uint16(303), // (322) over_clause ::= OVER LP window RP - uint16(303), // (323) over_clause ::= OVER nm - uint16(302), // (324) filter_clause ::= FILTER LP WHERE expr RP - uint16(181), // (325) input ::= cmdlist - uint16(182), // (326) cmdlist ::= cmdlist ecmd - uint16(182), // (327) cmdlist ::= ecmd - uint16(183), // (328) ecmd ::= SEMI - uint16(183), // (329) ecmd ::= cmdx SEMI - uint16(183), // (330) ecmd ::= explain cmdx SEMI - uint16(188), // (331) trans_opt ::= - uint16(188), // (332) trans_opt ::= TRANSACTION - uint16(188), // (333) trans_opt ::= TRANSACTION nm - uint16(190), // (334) savepoint_opt ::= SAVEPOINT - uint16(190), // (335) savepoint_opt ::= - uint16(186), // (336) cmd ::= create_table create_table_args - uint16(197), // (337) columnlist ::= columnlist COMMA columnname carglist - uint16(197), // (338) columnlist ::= columnname carglist - uint16(189), // (339) nm ::= ID|INDEXED - uint16(189), // (340) nm ::= STRING - uint16(189), // (341) nm ::= JOIN_KW - uint16(203), // (342) typetoken ::= typename - uint16(204), // (343) typename ::= ID|STRING - uint16(205), // (344) signed ::= plus_num - uint16(205), // (345) signed ::= minus_num - uint16(202), // (346) carglist ::= carglist ccons - uint16(202), // (347) carglist ::= - uint16(210), // (348) ccons ::= NULL onconf - uint16(210), // (349) ccons ::= GENERATED ALWAYS AS generated - uint16(210), // (350) ccons ::= AS generated - uint16(198), // (351) conslist_opt ::= COMMA conslist - uint16(223), // (352) conslist ::= conslist tconscomma tcons - uint16(223), // (353) conslist ::= tcons - uint16(224), // (354) tconscomma ::= - uint16(228), // (355) defer_subclause_opt ::= defer_subclause - uint16(230), // (356) resolvetype ::= raisetype - uint16(234), // (357) selectnowith ::= oneselect - uint16(235), // (358) oneselect ::= values - uint16(249), // (359) sclp ::= selcollist COMMA - uint16(250), // (360) as ::= ID|STRING - uint16(212), // (361) expr ::= term - uint16(267), // (362) likeop ::= LIKE_KW|MATCH - uint16(257), // (363) exprlist ::= nexprlist - uint16(277), // (364) nmnum ::= plus_num - uint16(277), // (365) nmnum ::= nm - uint16(277), // (366) nmnum ::= ON - uint16(277), // (367) nmnum ::= DELETE - uint16(277), // (368) nmnum ::= DEFAULT - uint16(206), // (369) plus_num ::= INTEGER|FLOAT - uint16(282), // (370) foreach_clause ::= - uint16(282), // (371) foreach_clause ::= FOR EACH ROW - uint16(285), // (372) trnm ::= nm - uint16(286), // (373) tridxby ::= - uint16(287), // (374) database_kw_opt ::= DATABASE - uint16(287), // (375) database_kw_opt ::= - uint16(290), // (376) kwcolumn_opt ::= - uint16(290), // (377) kwcolumn_opt ::= COLUMNKW - uint16(292), // (378) vtabarglist ::= vtabarg - uint16(292), // (379) vtabarglist ::= vtabarglist COMMA vtabarg - uint16(293), // (380) vtabarg ::= vtabarg vtabargtoken - uint16(296), // (381) anylist ::= - uint16(296), // (382) anylist ::= anylist LP anylist RP - uint16(296), // (383) anylist ::= anylist ANY - uint16(261), // (384) with ::= -} /* sqlite3.c:156673:25 */ +var yyRuleInfoLhs = [398]uint16{ + uint16(187), // (0) explain ::= EXPLAIN + uint16(187), // (1) explain ::= EXPLAIN QUERY PLAN + uint16(186), // (2) cmdx ::= cmd + uint16(188), // (3) cmd ::= BEGIN transtype trans_opt + uint16(189), // (4) transtype ::= + uint16(189), // (5) transtype ::= DEFERRED + uint16(189), // (6) transtype ::= IMMEDIATE + uint16(189), // (7) transtype ::= EXCLUSIVE + uint16(188), // (8) cmd ::= COMMIT|END trans_opt + uint16(188), // (9) cmd ::= ROLLBACK trans_opt + uint16(188), // (10) cmd ::= SAVEPOINT nm + uint16(188), // (11) cmd ::= RELEASE savepoint_opt nm + uint16(188), // (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm + uint16(193), // (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm + uint16(195), // (14) createkw ::= CREATE + uint16(197), // (15) ifnotexists ::= + uint16(197), // (16) ifnotexists ::= IF NOT EXISTS + uint16(196), // (17) temp ::= TEMP + uint16(196), // (18) temp ::= + uint16(194), // (19) create_table_args ::= LP columnlist conslist_opt RP table_options + uint16(194), // (20) create_table_args ::= AS select + uint16(201), // (21) table_options ::= + uint16(201), // (22) table_options ::= WITHOUT nm + uint16(203), // (23) columnname ::= nm typetoken + uint16(205), // (24) typetoken ::= + uint16(205), // (25) typetoken ::= typename LP signed RP + uint16(205), // (26) typetoken ::= typename LP signed COMMA signed RP + uint16(206), // (27) typename ::= typename ID|STRING + uint16(210), // (28) scanpt ::= + uint16(211), // (29) scantok ::= + uint16(212), // (30) ccons ::= CONSTRAINT nm + uint16(212), // (31) ccons ::= DEFAULT scantok term + uint16(212), // (32) ccons ::= DEFAULT LP expr RP + uint16(212), // (33) ccons ::= DEFAULT PLUS scantok term + uint16(212), // (34) ccons ::= DEFAULT MINUS scantok term + uint16(212), // (35) ccons ::= DEFAULT scantok ID|INDEXED + uint16(212), // (36) ccons ::= NOT NULL onconf + uint16(212), // (37) ccons ::= PRIMARY KEY sortorder onconf autoinc + uint16(212), // (38) ccons ::= UNIQUE onconf + uint16(212), // (39) ccons ::= CHECK LP expr RP + uint16(212), // (40) ccons ::= REFERENCES nm eidlist_opt refargs + uint16(212), // (41) ccons ::= defer_subclause + uint16(212), // (42) ccons ::= COLLATE ID|STRING + uint16(221), // (43) generated ::= LP expr RP + uint16(221), // (44) generated ::= LP expr RP ID + uint16(217), // (45) autoinc ::= + uint16(217), // (46) autoinc ::= AUTOINCR + uint16(219), // (47) refargs ::= + uint16(219), // (48) refargs ::= refargs refarg + uint16(222), // (49) refarg ::= MATCH nm + uint16(222), // (50) refarg ::= ON INSERT refact + uint16(222), // (51) refarg ::= ON DELETE refact + uint16(222), // (52) refarg ::= ON UPDATE refact + uint16(223), // (53) refact ::= SET NULL + uint16(223), // (54) refact ::= SET DEFAULT + uint16(223), // (55) refact ::= CASCADE + uint16(223), // (56) refact ::= RESTRICT + uint16(223), // (57) refact ::= NO ACTION + uint16(220), // (58) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt + uint16(220), // (59) defer_subclause ::= DEFERRABLE init_deferred_pred_opt + uint16(224), // (60) init_deferred_pred_opt ::= + uint16(224), // (61) init_deferred_pred_opt ::= INITIALLY DEFERRED + uint16(224), // (62) init_deferred_pred_opt ::= INITIALLY IMMEDIATE + uint16(200), // (63) conslist_opt ::= + uint16(226), // (64) tconscomma ::= COMMA + uint16(227), // (65) tcons ::= CONSTRAINT nm + uint16(227), // (66) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf + uint16(227), // (67) tcons ::= UNIQUE LP sortlist RP onconf + uint16(227), // (68) tcons ::= CHECK LP expr RP onconf + uint16(227), // (69) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt + uint16(230), // (70) defer_subclause_opt ::= + uint16(215), // (71) onconf ::= + uint16(215), // (72) onconf ::= ON CONFLICT resolvetype + uint16(231), // (73) orconf ::= + uint16(231), // (74) orconf ::= OR resolvetype + uint16(232), // (75) resolvetype ::= IGNORE + uint16(232), // (76) resolvetype ::= REPLACE + uint16(188), // (77) cmd ::= DROP TABLE ifexists fullname + uint16(234), // (78) ifexists ::= IF EXISTS + uint16(234), // (79) ifexists ::= + uint16(188), // (80) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select + uint16(188), // (81) cmd ::= DROP VIEW ifexists fullname + uint16(188), // (82) cmd ::= select + uint16(202), // (83) select ::= WITH wqlist selectnowith + uint16(202), // (84) select ::= WITH RECURSIVE wqlist selectnowith + uint16(202), // (85) select ::= selectnowith + uint16(236), // (86) selectnowith ::= selectnowith multiselect_op oneselect + uint16(239), // (87) multiselect_op ::= UNION + uint16(239), // (88) multiselect_op ::= UNION ALL + uint16(239), // (89) multiselect_op ::= EXCEPT|INTERSECT + uint16(237), // (90) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt + uint16(237), // (91) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt + uint16(249), // (92) values ::= VALUES LP nexprlist RP + uint16(249), // (93) values ::= values COMMA LP nexprlist RP + uint16(240), // (94) distinct ::= DISTINCT + uint16(240), // (95) distinct ::= ALL + uint16(240), // (96) distinct ::= + uint16(251), // (97) sclp ::= + uint16(241), // (98) selcollist ::= sclp scanpt expr scanpt as + uint16(241), // (99) selcollist ::= sclp scanpt STAR + uint16(241), // (100) selcollist ::= sclp scanpt nm DOT STAR + uint16(252), // (101) as ::= AS nm + uint16(252), // (102) as ::= + uint16(242), // (103) from ::= + uint16(242), // (104) from ::= FROM seltablist + uint16(254), // (105) stl_prefix ::= seltablist joinop + uint16(254), // (106) stl_prefix ::= + uint16(253), // (107) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt + uint16(253), // (108) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt + uint16(253), // (109) seltablist ::= stl_prefix LP select RP as on_opt using_opt + uint16(253), // (110) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt + uint16(198), // (111) dbnm ::= + uint16(198), // (112) dbnm ::= DOT nm + uint16(235), // (113) fullname ::= nm + uint16(235), // (114) fullname ::= nm DOT nm + uint16(260), // (115) xfullname ::= nm + uint16(260), // (116) xfullname ::= nm DOT nm + uint16(260), // (117) xfullname ::= nm DOT nm AS nm + uint16(260), // (118) xfullname ::= nm AS nm + uint16(255), // (119) joinop ::= COMMA|JOIN + uint16(255), // (120) joinop ::= JOIN_KW JOIN + uint16(255), // (121) joinop ::= JOIN_KW nm JOIN + uint16(255), // (122) joinop ::= JOIN_KW nm nm JOIN + uint16(257), // (123) on_opt ::= ON expr + uint16(257), // (124) on_opt ::= + uint16(256), // (125) indexed_opt ::= + uint16(256), // (126) indexed_opt ::= INDEXED BY nm + uint16(256), // (127) indexed_opt ::= NOT INDEXED + uint16(258), // (128) using_opt ::= USING LP idlist RP + uint16(258), // (129) using_opt ::= + uint16(246), // (130) orderby_opt ::= + uint16(246), // (131) orderby_opt ::= ORDER BY sortlist + uint16(228), // (132) sortlist ::= sortlist COMMA expr sortorder nulls + uint16(228), // (133) sortlist ::= expr sortorder nulls + uint16(216), // (134) sortorder ::= ASC + uint16(216), // (135) sortorder ::= DESC + uint16(216), // (136) sortorder ::= + uint16(262), // (137) nulls ::= NULLS FIRST + uint16(262), // (138) nulls ::= NULLS LAST + uint16(262), // (139) nulls ::= + uint16(244), // (140) groupby_opt ::= + uint16(244), // (141) groupby_opt ::= GROUP BY nexprlist + uint16(245), // (142) having_opt ::= + uint16(245), // (143) having_opt ::= HAVING expr + uint16(247), // (144) limit_opt ::= + uint16(247), // (145) limit_opt ::= LIMIT expr + uint16(247), // (146) limit_opt ::= LIMIT expr OFFSET expr + uint16(247), // (147) limit_opt ::= LIMIT expr COMMA expr + uint16(188), // (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret + uint16(243), // (149) where_opt ::= + uint16(243), // (150) where_opt ::= WHERE expr + uint16(264), // (151) where_opt_ret ::= + uint16(264), // (152) where_opt_ret ::= WHERE expr + uint16(264), // (153) where_opt_ret ::= RETURNING selcollist + uint16(264), // (154) where_opt_ret ::= WHERE expr RETURNING selcollist + uint16(188), // (155) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret + uint16(265), // (156) setlist ::= setlist COMMA nm EQ expr + uint16(265), // (157) setlist ::= setlist COMMA LP idlist RP EQ expr + uint16(265), // (158) setlist ::= nm EQ expr + uint16(265), // (159) setlist ::= LP idlist RP EQ expr + uint16(188), // (160) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert + uint16(188), // (161) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning + uint16(268), // (162) upsert ::= + uint16(268), // (163) upsert ::= RETURNING selcollist + uint16(268), // (164) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert + uint16(268), // (165) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert + uint16(268), // (166) upsert ::= ON CONFLICT DO NOTHING returning + uint16(268), // (167) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning + uint16(269), // (168) returning ::= RETURNING selcollist + uint16(266), // (169) insert_cmd ::= INSERT orconf + uint16(266), // (170) insert_cmd ::= REPLACE + uint16(267), // (171) idlist_opt ::= + uint16(267), // (172) idlist_opt ::= LP idlist RP + uint16(261), // (173) idlist ::= idlist COMMA nm + uint16(261), // (174) idlist ::= nm + uint16(214), // (175) expr ::= LP expr RP + uint16(214), // (176) expr ::= ID|INDEXED + uint16(214), // (177) expr ::= JOIN_KW + uint16(214), // (178) expr ::= nm DOT nm + uint16(214), // (179) expr ::= nm DOT nm DOT nm + uint16(213), // (180) term ::= NULL|FLOAT|BLOB + uint16(213), // (181) term ::= STRING + uint16(213), // (182) term ::= INTEGER + uint16(214), // (183) expr ::= VARIABLE + uint16(214), // (184) expr ::= expr COLLATE ID|STRING + uint16(214), // (185) expr ::= CAST LP expr AS typetoken RP + uint16(214), // (186) expr ::= ID|INDEXED LP distinct exprlist RP + uint16(214), // (187) expr ::= ID|INDEXED LP STAR RP + uint16(214), // (188) expr ::= ID|INDEXED LP distinct exprlist RP filter_over + uint16(214), // (189) expr ::= ID|INDEXED LP STAR RP filter_over + uint16(213), // (190) term ::= CTIME_KW + uint16(214), // (191) expr ::= LP nexprlist COMMA expr RP + uint16(214), // (192) expr ::= expr AND expr + uint16(214), // (193) expr ::= expr OR expr + uint16(214), // (194) expr ::= expr LT|GT|GE|LE expr + uint16(214), // (195) expr ::= expr EQ|NE expr + uint16(214), // (196) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr + uint16(214), // (197) expr ::= expr PLUS|MINUS expr + uint16(214), // (198) expr ::= expr STAR|SLASH|REM expr + uint16(214), // (199) expr ::= expr CONCAT expr + uint16(271), // (200) likeop ::= NOT LIKE_KW|MATCH + uint16(214), // (201) expr ::= expr likeop expr + uint16(214), // (202) expr ::= expr likeop expr ESCAPE expr + uint16(214), // (203) expr ::= expr ISNULL|NOTNULL + uint16(214), // (204) expr ::= expr NOT NULL + uint16(214), // (205) expr ::= expr IS expr + uint16(214), // (206) expr ::= expr IS NOT expr + uint16(214), // (207) expr ::= NOT expr + uint16(214), // (208) expr ::= BITNOT expr + uint16(214), // (209) expr ::= PLUS|MINUS expr + uint16(272), // (210) between_op ::= BETWEEN + uint16(272), // (211) between_op ::= NOT BETWEEN + uint16(214), // (212) expr ::= expr between_op expr AND expr + uint16(273), // (213) in_op ::= IN + uint16(273), // (214) in_op ::= NOT IN + uint16(214), // (215) expr ::= expr in_op LP exprlist RP + uint16(214), // (216) expr ::= LP select RP + uint16(214), // (217) expr ::= expr in_op LP select RP + uint16(214), // (218) expr ::= expr in_op nm dbnm paren_exprlist + uint16(214), // (219) expr ::= EXISTS LP select RP + uint16(214), // (220) expr ::= CASE case_operand case_exprlist case_else END + uint16(276), // (221) case_exprlist ::= case_exprlist WHEN expr THEN expr + uint16(276), // (222) case_exprlist ::= WHEN expr THEN expr + uint16(277), // (223) case_else ::= ELSE expr + uint16(277), // (224) case_else ::= + uint16(275), // (225) case_operand ::= expr + uint16(275), // (226) case_operand ::= + uint16(259), // (227) exprlist ::= + uint16(250), // (228) nexprlist ::= nexprlist COMMA expr + uint16(250), // (229) nexprlist ::= expr + uint16(274), // (230) paren_exprlist ::= + uint16(274), // (231) paren_exprlist ::= LP exprlist RP + uint16(188), // (232) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt + uint16(278), // (233) uniqueflag ::= UNIQUE + uint16(278), // (234) uniqueflag ::= + uint16(218), // (235) eidlist_opt ::= + uint16(218), // (236) eidlist_opt ::= LP eidlist RP + uint16(229), // (237) eidlist ::= eidlist COMMA nm collate sortorder + uint16(229), // (238) eidlist ::= nm collate sortorder + uint16(279), // (239) collate ::= + uint16(279), // (240) collate ::= COLLATE ID|STRING + uint16(188), // (241) cmd ::= DROP INDEX ifexists fullname + uint16(188), // (242) cmd ::= VACUUM vinto + uint16(188), // (243) cmd ::= VACUUM nm vinto + uint16(280), // (244) vinto ::= INTO expr + uint16(280), // (245) vinto ::= + uint16(188), // (246) cmd ::= PRAGMA nm dbnm + uint16(188), // (247) cmd ::= PRAGMA nm dbnm EQ nmnum + uint16(188), // (248) cmd ::= PRAGMA nm dbnm LP nmnum RP + uint16(188), // (249) cmd ::= PRAGMA nm dbnm EQ minus_num + uint16(188), // (250) cmd ::= PRAGMA nm dbnm LP minus_num RP + uint16(208), // (251) plus_num ::= PLUS INTEGER|FLOAT + uint16(209), // (252) minus_num ::= MINUS INTEGER|FLOAT + uint16(188), // (253) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END + uint16(282), // (254) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause + uint16(284), // (255) trigger_time ::= BEFORE|AFTER + uint16(284), // (256) trigger_time ::= INSTEAD OF + uint16(284), // (257) trigger_time ::= + uint16(285), // (258) trigger_event ::= DELETE|INSERT + uint16(285), // (259) trigger_event ::= UPDATE + uint16(285), // (260) trigger_event ::= UPDATE OF idlist + uint16(287), // (261) when_clause ::= + uint16(287), // (262) when_clause ::= WHEN expr + uint16(283), // (263) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI + uint16(283), // (264) trigger_cmd_list ::= trigger_cmd SEMI + uint16(289), // (265) trnm ::= nm DOT nm + uint16(290), // (266) tridxby ::= INDEXED BY nm + uint16(290), // (267) tridxby ::= NOT INDEXED + uint16(288), // (268) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt + uint16(288), // (269) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt + uint16(288), // (270) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt + uint16(288), // (271) trigger_cmd ::= scanpt select scanpt + uint16(214), // (272) expr ::= RAISE LP IGNORE RP + uint16(214), // (273) expr ::= RAISE LP raisetype COMMA nm RP + uint16(233), // (274) raisetype ::= ROLLBACK + uint16(233), // (275) raisetype ::= ABORT + uint16(233), // (276) raisetype ::= FAIL + uint16(188), // (277) cmd ::= DROP TRIGGER ifexists fullname + uint16(188), // (278) cmd ::= ATTACH database_kw_opt expr AS expr key_opt + uint16(188), // (279) cmd ::= DETACH database_kw_opt expr + uint16(292), // (280) key_opt ::= + uint16(292), // (281) key_opt ::= KEY expr + uint16(188), // (282) cmd ::= REINDEX + uint16(188), // (283) cmd ::= REINDEX nm dbnm + uint16(188), // (284) cmd ::= ANALYZE + uint16(188), // (285) cmd ::= ANALYZE nm dbnm + uint16(188), // (286) cmd ::= ALTER TABLE fullname RENAME TO nm + uint16(188), // (287) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist + uint16(188), // (288) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm + uint16(293), // (289) add_column_fullname ::= fullname + uint16(188), // (290) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm + uint16(188), // (291) cmd ::= create_vtab + uint16(188), // (292) cmd ::= create_vtab LP vtabarglist RP + uint16(295), // (293) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm + uint16(297), // (294) vtabarg ::= + uint16(298), // (295) vtabargtoken ::= ANY + uint16(298), // (296) vtabargtoken ::= lp anylist RP + uint16(299), // (297) lp ::= LP + uint16(263), // (298) with ::= WITH wqlist + uint16(263), // (299) with ::= WITH RECURSIVE wqlist + uint16(302), // (300) wqas ::= AS + uint16(302), // (301) wqas ::= AS MATERIALIZED + uint16(302), // (302) wqas ::= AS NOT MATERIALIZED + uint16(301), // (303) wqitem ::= nm eidlist_opt wqas LP select RP + uint16(238), // (304) wqlist ::= wqitem + uint16(238), // (305) wqlist ::= wqlist COMMA wqitem + uint16(303), // (306) windowdefn_list ::= windowdefn + uint16(303), // (307) windowdefn_list ::= windowdefn_list COMMA windowdefn + uint16(304), // (308) windowdefn ::= nm AS LP window RP + uint16(305), // (309) window ::= PARTITION BY nexprlist orderby_opt frame_opt + uint16(305), // (310) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt + uint16(305), // (311) window ::= ORDER BY sortlist frame_opt + uint16(305), // (312) window ::= nm ORDER BY sortlist frame_opt + uint16(305), // (313) window ::= frame_opt + uint16(305), // (314) window ::= nm frame_opt + uint16(306), // (315) frame_opt ::= + uint16(306), // (316) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt + uint16(306), // (317) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt + uint16(310), // (318) range_or_rows ::= RANGE|ROWS|GROUPS + uint16(312), // (319) frame_bound_s ::= frame_bound + uint16(312), // (320) frame_bound_s ::= UNBOUNDED PRECEDING + uint16(313), // (321) frame_bound_e ::= frame_bound + uint16(313), // (322) frame_bound_e ::= UNBOUNDED FOLLOWING + uint16(311), // (323) frame_bound ::= expr PRECEDING|FOLLOWING + uint16(311), // (324) frame_bound ::= CURRENT ROW + uint16(314), // (325) frame_exclude_opt ::= + uint16(314), // (326) frame_exclude_opt ::= EXCLUDE frame_exclude + uint16(315), // (327) frame_exclude ::= NO OTHERS + uint16(315), // (328) frame_exclude ::= CURRENT ROW + uint16(315), // (329) frame_exclude ::= GROUP|TIES + uint16(248), // (330) window_clause ::= WINDOW windowdefn_list + uint16(270), // (331) filter_over ::= filter_clause over_clause + uint16(270), // (332) filter_over ::= over_clause + uint16(270), // (333) filter_over ::= filter_clause + uint16(309), // (334) over_clause ::= OVER LP window RP + uint16(309), // (335) over_clause ::= OVER nm + uint16(308), // (336) filter_clause ::= FILTER LP WHERE expr RP + uint16(183), // (337) input ::= cmdlist + uint16(184), // (338) cmdlist ::= cmdlist ecmd + uint16(184), // (339) cmdlist ::= ecmd + uint16(185), // (340) ecmd ::= SEMI + uint16(185), // (341) ecmd ::= cmdx SEMI + uint16(185), // (342) ecmd ::= explain cmdx SEMI + uint16(190), // (343) trans_opt ::= + uint16(190), // (344) trans_opt ::= TRANSACTION + uint16(190), // (345) trans_opt ::= TRANSACTION nm + uint16(192), // (346) savepoint_opt ::= SAVEPOINT + uint16(192), // (347) savepoint_opt ::= + uint16(188), // (348) cmd ::= create_table create_table_args + uint16(199), // (349) columnlist ::= columnlist COMMA columnname carglist + uint16(199), // (350) columnlist ::= columnname carglist + uint16(191), // (351) nm ::= ID|INDEXED + uint16(191), // (352) nm ::= STRING + uint16(191), // (353) nm ::= JOIN_KW + uint16(205), // (354) typetoken ::= typename + uint16(206), // (355) typename ::= ID|STRING + uint16(207), // (356) signed ::= plus_num + uint16(207), // (357) signed ::= minus_num + uint16(204), // (358) carglist ::= carglist ccons + uint16(204), // (359) carglist ::= + uint16(212), // (360) ccons ::= NULL onconf + uint16(212), // (361) ccons ::= GENERATED ALWAYS AS generated + uint16(212), // (362) ccons ::= AS generated + uint16(200), // (363) conslist_opt ::= COMMA conslist + uint16(225), // (364) conslist ::= conslist tconscomma tcons + uint16(225), // (365) conslist ::= tcons + uint16(226), // (366) tconscomma ::= + uint16(230), // (367) defer_subclause_opt ::= defer_subclause + uint16(232), // (368) resolvetype ::= raisetype + uint16(236), // (369) selectnowith ::= oneselect + uint16(237), // (370) oneselect ::= values + uint16(251), // (371) sclp ::= selcollist COMMA + uint16(252), // (372) as ::= ID|STRING + uint16(269), // (373) returning ::= + uint16(214), // (374) expr ::= term + uint16(271), // (375) likeop ::= LIKE_KW|MATCH + uint16(259), // (376) exprlist ::= nexprlist + uint16(281), // (377) nmnum ::= plus_num + uint16(281), // (378) nmnum ::= nm + uint16(281), // (379) nmnum ::= ON + uint16(281), // (380) nmnum ::= DELETE + uint16(281), // (381) nmnum ::= DEFAULT + uint16(208), // (382) plus_num ::= INTEGER|FLOAT + uint16(286), // (383) foreach_clause ::= + uint16(286), // (384) foreach_clause ::= FOR EACH ROW + uint16(289), // (385) trnm ::= nm + uint16(290), // (386) tridxby ::= + uint16(291), // (387) database_kw_opt ::= DATABASE + uint16(291), // (388) database_kw_opt ::= + uint16(294), // (389) kwcolumn_opt ::= + uint16(294), // (390) kwcolumn_opt ::= COLUMNKW + uint16(296), // (391) vtabarglist ::= vtabarg + uint16(296), // (392) vtabarglist ::= vtabarglist COMMA vtabarg + uint16(297), // (393) vtabarg ::= vtabarg vtabargtoken + uint16(300), // (394) anylist ::= + uint16(300), // (395) anylist ::= anylist LP anylist RP + uint16(300), // (396) anylist ::= anylist ANY + uint16(263), // (397) with ::= +} /* sqlite3.c:159577:25 */ // For rule J, yyRuleInfoNRhs[J] contains the negative of the number // of symbols on the right-hand side of that rule. -var yyRuleInfoNRhs = [385]int8{ +var yyRuleInfoNRhs = [398]int8{ int8(-1), // (0) explain ::= EXPLAIN int8(-3), // (1) explain ::= EXPLAIN QUERY PLAN int8(-1), // (2) cmdx ::= cmd @@ -137634,244 +140121,257 @@ var yyRuleInfoNRhs = [385]int8{ int8(-2), // (145) limit_opt ::= LIMIT expr int8(-4), // (146) limit_opt ::= LIMIT expr OFFSET expr int8(-4), // (147) limit_opt ::= LIMIT expr COMMA expr - int8(-6), // (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt + int8(-6), // (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret int8(0), // (149) where_opt ::= int8(-2), // (150) where_opt ::= WHERE expr - int8(-9), // (151) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt - int8(-5), // (152) setlist ::= setlist COMMA nm EQ expr - int8(-7), // (153) setlist ::= setlist COMMA LP idlist RP EQ expr - int8(-3), // (154) setlist ::= nm EQ expr - int8(-5), // (155) setlist ::= LP idlist RP EQ expr - int8(-7), // (156) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert - int8(-7), // (157) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES - int8(0), // (158) upsert ::= - int8(-11), // (159) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt - int8(-8), // (160) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING - int8(-4), // (161) upsert ::= ON CONFLICT DO NOTHING - int8(-2), // (162) insert_cmd ::= INSERT orconf - int8(-1), // (163) insert_cmd ::= REPLACE - int8(0), // (164) idlist_opt ::= - int8(-3), // (165) idlist_opt ::= LP idlist RP - int8(-3), // (166) idlist ::= idlist COMMA nm - int8(-1), // (167) idlist ::= nm - int8(-3), // (168) expr ::= LP expr RP - int8(-1), // (169) expr ::= ID|INDEXED - int8(-1), // (170) expr ::= JOIN_KW - int8(-3), // (171) expr ::= nm DOT nm - int8(-5), // (172) expr ::= nm DOT nm DOT nm - int8(-1), // (173) term ::= NULL|FLOAT|BLOB - int8(-1), // (174) term ::= STRING - int8(-1), // (175) term ::= INTEGER - int8(-1), // (176) expr ::= VARIABLE - int8(-3), // (177) expr ::= expr COLLATE ID|STRING - int8(-6), // (178) expr ::= CAST LP expr AS typetoken RP - int8(-5), // (179) expr ::= ID|INDEXED LP distinct exprlist RP - int8(-4), // (180) expr ::= ID|INDEXED LP STAR RP - int8(-6), // (181) expr ::= ID|INDEXED LP distinct exprlist RP filter_over - int8(-5), // (182) expr ::= ID|INDEXED LP STAR RP filter_over - int8(-1), // (183) term ::= CTIME_KW - int8(-5), // (184) expr ::= LP nexprlist COMMA expr RP - int8(-3), // (185) expr ::= expr AND expr - int8(-3), // (186) expr ::= expr OR expr - int8(-3), // (187) expr ::= expr LT|GT|GE|LE expr - int8(-3), // (188) expr ::= expr EQ|NE expr - int8(-3), // (189) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr - int8(-3), // (190) expr ::= expr PLUS|MINUS expr - int8(-3), // (191) expr ::= expr STAR|SLASH|REM expr - int8(-3), // (192) expr ::= expr CONCAT expr - int8(-2), // (193) likeop ::= NOT LIKE_KW|MATCH - int8(-3), // (194) expr ::= expr likeop expr - int8(-5), // (195) expr ::= expr likeop expr ESCAPE expr - int8(-2), // (196) expr ::= expr ISNULL|NOTNULL - int8(-3), // (197) expr ::= expr NOT NULL - int8(-3), // (198) expr ::= expr IS expr - int8(-4), // (199) expr ::= expr IS NOT expr - int8(-2), // (200) expr ::= NOT expr - int8(-2), // (201) expr ::= BITNOT expr - int8(-2), // (202) expr ::= PLUS|MINUS expr - int8(-1), // (203) between_op ::= BETWEEN - int8(-2), // (204) between_op ::= NOT BETWEEN - int8(-5), // (205) expr ::= expr between_op expr AND expr - int8(-1), // (206) in_op ::= IN - int8(-2), // (207) in_op ::= NOT IN - int8(-5), // (208) expr ::= expr in_op LP exprlist RP - int8(-3), // (209) expr ::= LP select RP - int8(-5), // (210) expr ::= expr in_op LP select RP - int8(-5), // (211) expr ::= expr in_op nm dbnm paren_exprlist - int8(-4), // (212) expr ::= EXISTS LP select RP - int8(-5), // (213) expr ::= CASE case_operand case_exprlist case_else END - int8(-5), // (214) case_exprlist ::= case_exprlist WHEN expr THEN expr - int8(-4), // (215) case_exprlist ::= WHEN expr THEN expr - int8(-2), // (216) case_else ::= ELSE expr - int8(0), // (217) case_else ::= - int8(-1), // (218) case_operand ::= expr - int8(0), // (219) case_operand ::= - int8(0), // (220) exprlist ::= - int8(-3), // (221) nexprlist ::= nexprlist COMMA expr - int8(-1), // (222) nexprlist ::= expr - int8(0), // (223) paren_exprlist ::= - int8(-3), // (224) paren_exprlist ::= LP exprlist RP - int8(-12), // (225) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt - int8(-1), // (226) uniqueflag ::= UNIQUE - int8(0), // (227) uniqueflag ::= - int8(0), // (228) eidlist_opt ::= - int8(-3), // (229) eidlist_opt ::= LP eidlist RP - int8(-5), // (230) eidlist ::= eidlist COMMA nm collate sortorder - int8(-3), // (231) eidlist ::= nm collate sortorder - int8(0), // (232) collate ::= - int8(-2), // (233) collate ::= COLLATE ID|STRING - int8(-4), // (234) cmd ::= DROP INDEX ifexists fullname - int8(-2), // (235) cmd ::= VACUUM vinto - int8(-3), // (236) cmd ::= VACUUM nm vinto - int8(-2), // (237) vinto ::= INTO expr - int8(0), // (238) vinto ::= - int8(-3), // (239) cmd ::= PRAGMA nm dbnm - int8(-5), // (240) cmd ::= PRAGMA nm dbnm EQ nmnum - int8(-6), // (241) cmd ::= PRAGMA nm dbnm LP nmnum RP - int8(-5), // (242) cmd ::= PRAGMA nm dbnm EQ minus_num - int8(-6), // (243) cmd ::= PRAGMA nm dbnm LP minus_num RP - int8(-2), // (244) plus_num ::= PLUS INTEGER|FLOAT - int8(-2), // (245) minus_num ::= MINUS INTEGER|FLOAT - int8(-5), // (246) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END - int8(-11), // (247) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause - int8(-1), // (248) trigger_time ::= BEFORE|AFTER - int8(-2), // (249) trigger_time ::= INSTEAD OF - int8(0), // (250) trigger_time ::= - int8(-1), // (251) trigger_event ::= DELETE|INSERT - int8(-1), // (252) trigger_event ::= UPDATE - int8(-3), // (253) trigger_event ::= UPDATE OF idlist - int8(0), // (254) when_clause ::= - int8(-2), // (255) when_clause ::= WHEN expr - int8(-3), // (256) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI - int8(-2), // (257) trigger_cmd_list ::= trigger_cmd SEMI - int8(-3), // (258) trnm ::= nm DOT nm - int8(-3), // (259) tridxby ::= INDEXED BY nm - int8(-2), // (260) tridxby ::= NOT INDEXED - int8(-9), // (261) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt - int8(-8), // (262) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt - int8(-6), // (263) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt - int8(-3), // (264) trigger_cmd ::= scanpt select scanpt - int8(-4), // (265) expr ::= RAISE LP IGNORE RP - int8(-6), // (266) expr ::= RAISE LP raisetype COMMA nm RP - int8(-1), // (267) raisetype ::= ROLLBACK - int8(-1), // (268) raisetype ::= ABORT - int8(-1), // (269) raisetype ::= FAIL - int8(-4), // (270) cmd ::= DROP TRIGGER ifexists fullname - int8(-6), // (271) cmd ::= ATTACH database_kw_opt expr AS expr key_opt - int8(-3), // (272) cmd ::= DETACH database_kw_opt expr - int8(0), // (273) key_opt ::= - int8(-2), // (274) key_opt ::= KEY expr - int8(-1), // (275) cmd ::= REINDEX - int8(-3), // (276) cmd ::= REINDEX nm dbnm - int8(-1), // (277) cmd ::= ANALYZE - int8(-3), // (278) cmd ::= ANALYZE nm dbnm - int8(-6), // (279) cmd ::= ALTER TABLE fullname RENAME TO nm - int8(-7), // (280) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist - int8(-1), // (281) add_column_fullname ::= fullname - int8(-8), // (282) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm - int8(-1), // (283) cmd ::= create_vtab - int8(-4), // (284) cmd ::= create_vtab LP vtabarglist RP - int8(-8), // (285) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm - int8(0), // (286) vtabarg ::= - int8(-1), // (287) vtabargtoken ::= ANY - int8(-3), // (288) vtabargtoken ::= lp anylist RP - int8(-1), // (289) lp ::= LP - int8(-2), // (290) with ::= WITH wqlist - int8(-3), // (291) with ::= WITH RECURSIVE wqlist - int8(-6), // (292) wqlist ::= nm eidlist_opt AS LP select RP - int8(-8), // (293) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP - int8(-1), // (294) windowdefn_list ::= windowdefn - int8(-3), // (295) windowdefn_list ::= windowdefn_list COMMA windowdefn - int8(-5), // (296) windowdefn ::= nm AS LP window RP - int8(-5), // (297) window ::= PARTITION BY nexprlist orderby_opt frame_opt - int8(-6), // (298) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt - int8(-4), // (299) window ::= ORDER BY sortlist frame_opt - int8(-5), // (300) window ::= nm ORDER BY sortlist frame_opt - int8(-1), // (301) window ::= frame_opt - int8(-2), // (302) window ::= nm frame_opt - int8(0), // (303) frame_opt ::= - int8(-3), // (304) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt - int8(-6), // (305) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt - int8(-1), // (306) range_or_rows ::= RANGE|ROWS|GROUPS - int8(-1), // (307) frame_bound_s ::= frame_bound - int8(-2), // (308) frame_bound_s ::= UNBOUNDED PRECEDING - int8(-1), // (309) frame_bound_e ::= frame_bound - int8(-2), // (310) frame_bound_e ::= UNBOUNDED FOLLOWING - int8(-2), // (311) frame_bound ::= expr PRECEDING|FOLLOWING - int8(-2), // (312) frame_bound ::= CURRENT ROW - int8(0), // (313) frame_exclude_opt ::= - int8(-2), // (314) frame_exclude_opt ::= EXCLUDE frame_exclude - int8(-2), // (315) frame_exclude ::= NO OTHERS - int8(-2), // (316) frame_exclude ::= CURRENT ROW - int8(-1), // (317) frame_exclude ::= GROUP|TIES - int8(-2), // (318) window_clause ::= WINDOW windowdefn_list - int8(-2), // (319) filter_over ::= filter_clause over_clause - int8(-1), // (320) filter_over ::= over_clause - int8(-1), // (321) filter_over ::= filter_clause - int8(-4), // (322) over_clause ::= OVER LP window RP - int8(-2), // (323) over_clause ::= OVER nm - int8(-5), // (324) filter_clause ::= FILTER LP WHERE expr RP - int8(-1), // (325) input ::= cmdlist - int8(-2), // (326) cmdlist ::= cmdlist ecmd - int8(-1), // (327) cmdlist ::= ecmd - int8(-1), // (328) ecmd ::= SEMI - int8(-2), // (329) ecmd ::= cmdx SEMI - int8(-3), // (330) ecmd ::= explain cmdx SEMI - int8(0), // (331) trans_opt ::= - int8(-1), // (332) trans_opt ::= TRANSACTION - int8(-2), // (333) trans_opt ::= TRANSACTION nm - int8(-1), // (334) savepoint_opt ::= SAVEPOINT - int8(0), // (335) savepoint_opt ::= - int8(-2), // (336) cmd ::= create_table create_table_args - int8(-4), // (337) columnlist ::= columnlist COMMA columnname carglist - int8(-2), // (338) columnlist ::= columnname carglist - int8(-1), // (339) nm ::= ID|INDEXED - int8(-1), // (340) nm ::= STRING - int8(-1), // (341) nm ::= JOIN_KW - int8(-1), // (342) typetoken ::= typename - int8(-1), // (343) typename ::= ID|STRING - int8(-1), // (344) signed ::= plus_num - int8(-1), // (345) signed ::= minus_num - int8(-2), // (346) carglist ::= carglist ccons - int8(0), // (347) carglist ::= - int8(-2), // (348) ccons ::= NULL onconf - int8(-4), // (349) ccons ::= GENERATED ALWAYS AS generated - int8(-2), // (350) ccons ::= AS generated - int8(-2), // (351) conslist_opt ::= COMMA conslist - int8(-3), // (352) conslist ::= conslist tconscomma tcons - int8(-1), // (353) conslist ::= tcons - int8(0), // (354) tconscomma ::= - int8(-1), // (355) defer_subclause_opt ::= defer_subclause - int8(-1), // (356) resolvetype ::= raisetype - int8(-1), // (357) selectnowith ::= oneselect - int8(-1), // (358) oneselect ::= values - int8(-2), // (359) sclp ::= selcollist COMMA - int8(-1), // (360) as ::= ID|STRING - int8(-1), // (361) expr ::= term - int8(-1), // (362) likeop ::= LIKE_KW|MATCH - int8(-1), // (363) exprlist ::= nexprlist - int8(-1), // (364) nmnum ::= plus_num - int8(-1), // (365) nmnum ::= nm - int8(-1), // (366) nmnum ::= ON - int8(-1), // (367) nmnum ::= DELETE - int8(-1), // (368) nmnum ::= DEFAULT - int8(-1), // (369) plus_num ::= INTEGER|FLOAT - int8(0), // (370) foreach_clause ::= - int8(-3), // (371) foreach_clause ::= FOR EACH ROW - int8(-1), // (372) trnm ::= nm - int8(0), // (373) tridxby ::= - int8(-1), // (374) database_kw_opt ::= DATABASE - int8(0), // (375) database_kw_opt ::= - int8(0), // (376) kwcolumn_opt ::= - int8(-1), // (377) kwcolumn_opt ::= COLUMNKW - int8(-1), // (378) vtabarglist ::= vtabarg - int8(-3), // (379) vtabarglist ::= vtabarglist COMMA vtabarg - int8(-2), // (380) vtabarg ::= vtabarg vtabargtoken - int8(0), // (381) anylist ::= - int8(-4), // (382) anylist ::= anylist LP anylist RP - int8(-2), // (383) anylist ::= anylist ANY - int8(0), // (384) with ::= -} /* sqlite3.c:157063:26 */ + int8(0), // (151) where_opt_ret ::= + int8(-2), // (152) where_opt_ret ::= WHERE expr + int8(-2), // (153) where_opt_ret ::= RETURNING selcollist + int8(-4), // (154) where_opt_ret ::= WHERE expr RETURNING selcollist + int8(-9), // (155) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret + int8(-5), // (156) setlist ::= setlist COMMA nm EQ expr + int8(-7), // (157) setlist ::= setlist COMMA LP idlist RP EQ expr + int8(-3), // (158) setlist ::= nm EQ expr + int8(-5), // (159) setlist ::= LP idlist RP EQ expr + int8(-7), // (160) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert + int8(-8), // (161) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning + int8(0), // (162) upsert ::= + int8(-2), // (163) upsert ::= RETURNING selcollist + int8(-12), // (164) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert + int8(-9), // (165) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert + int8(-5), // (166) upsert ::= ON CONFLICT DO NOTHING returning + int8(-8), // (167) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning + int8(-2), // (168) returning ::= RETURNING selcollist + int8(-2), // (169) insert_cmd ::= INSERT orconf + int8(-1), // (170) insert_cmd ::= REPLACE + int8(0), // (171) idlist_opt ::= + int8(-3), // (172) idlist_opt ::= LP idlist RP + int8(-3), // (173) idlist ::= idlist COMMA nm + int8(-1), // (174) idlist ::= nm + int8(-3), // (175) expr ::= LP expr RP + int8(-1), // (176) expr ::= ID|INDEXED + int8(-1), // (177) expr ::= JOIN_KW + int8(-3), // (178) expr ::= nm DOT nm + int8(-5), // (179) expr ::= nm DOT nm DOT nm + int8(-1), // (180) term ::= NULL|FLOAT|BLOB + int8(-1), // (181) term ::= STRING + int8(-1), // (182) term ::= INTEGER + int8(-1), // (183) expr ::= VARIABLE + int8(-3), // (184) expr ::= expr COLLATE ID|STRING + int8(-6), // (185) expr ::= CAST LP expr AS typetoken RP + int8(-5), // (186) expr ::= ID|INDEXED LP distinct exprlist RP + int8(-4), // (187) expr ::= ID|INDEXED LP STAR RP + int8(-6), // (188) expr ::= ID|INDEXED LP distinct exprlist RP filter_over + int8(-5), // (189) expr ::= ID|INDEXED LP STAR RP filter_over + int8(-1), // (190) term ::= CTIME_KW + int8(-5), // (191) expr ::= LP nexprlist COMMA expr RP + int8(-3), // (192) expr ::= expr AND expr + int8(-3), // (193) expr ::= expr OR expr + int8(-3), // (194) expr ::= expr LT|GT|GE|LE expr + int8(-3), // (195) expr ::= expr EQ|NE expr + int8(-3), // (196) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr + int8(-3), // (197) expr ::= expr PLUS|MINUS expr + int8(-3), // (198) expr ::= expr STAR|SLASH|REM expr + int8(-3), // (199) expr ::= expr CONCAT expr + int8(-2), // (200) likeop ::= NOT LIKE_KW|MATCH + int8(-3), // (201) expr ::= expr likeop expr + int8(-5), // (202) expr ::= expr likeop expr ESCAPE expr + int8(-2), // (203) expr ::= expr ISNULL|NOTNULL + int8(-3), // (204) expr ::= expr NOT NULL + int8(-3), // (205) expr ::= expr IS expr + int8(-4), // (206) expr ::= expr IS NOT expr + int8(-2), // (207) expr ::= NOT expr + int8(-2), // (208) expr ::= BITNOT expr + int8(-2), // (209) expr ::= PLUS|MINUS expr + int8(-1), // (210) between_op ::= BETWEEN + int8(-2), // (211) between_op ::= NOT BETWEEN + int8(-5), // (212) expr ::= expr between_op expr AND expr + int8(-1), // (213) in_op ::= IN + int8(-2), // (214) in_op ::= NOT IN + int8(-5), // (215) expr ::= expr in_op LP exprlist RP + int8(-3), // (216) expr ::= LP select RP + int8(-5), // (217) expr ::= expr in_op LP select RP + int8(-5), // (218) expr ::= expr in_op nm dbnm paren_exprlist + int8(-4), // (219) expr ::= EXISTS LP select RP + int8(-5), // (220) expr ::= CASE case_operand case_exprlist case_else END + int8(-5), // (221) case_exprlist ::= case_exprlist WHEN expr THEN expr + int8(-4), // (222) case_exprlist ::= WHEN expr THEN expr + int8(-2), // (223) case_else ::= ELSE expr + int8(0), // (224) case_else ::= + int8(-1), // (225) case_operand ::= expr + int8(0), // (226) case_operand ::= + int8(0), // (227) exprlist ::= + int8(-3), // (228) nexprlist ::= nexprlist COMMA expr + int8(-1), // (229) nexprlist ::= expr + int8(0), // (230) paren_exprlist ::= + int8(-3), // (231) paren_exprlist ::= LP exprlist RP + int8(-12), // (232) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt + int8(-1), // (233) uniqueflag ::= UNIQUE + int8(0), // (234) uniqueflag ::= + int8(0), // (235) eidlist_opt ::= + int8(-3), // (236) eidlist_opt ::= LP eidlist RP + int8(-5), // (237) eidlist ::= eidlist COMMA nm collate sortorder + int8(-3), // (238) eidlist ::= nm collate sortorder + int8(0), // (239) collate ::= + int8(-2), // (240) collate ::= COLLATE ID|STRING + int8(-4), // (241) cmd ::= DROP INDEX ifexists fullname + int8(-2), // (242) cmd ::= VACUUM vinto + int8(-3), // (243) cmd ::= VACUUM nm vinto + int8(-2), // (244) vinto ::= INTO expr + int8(0), // (245) vinto ::= + int8(-3), // (246) cmd ::= PRAGMA nm dbnm + int8(-5), // (247) cmd ::= PRAGMA nm dbnm EQ nmnum + int8(-6), // (248) cmd ::= PRAGMA nm dbnm LP nmnum RP + int8(-5), // (249) cmd ::= PRAGMA nm dbnm EQ minus_num + int8(-6), // (250) cmd ::= PRAGMA nm dbnm LP minus_num RP + int8(-2), // (251) plus_num ::= PLUS INTEGER|FLOAT + int8(-2), // (252) minus_num ::= MINUS INTEGER|FLOAT + int8(-5), // (253) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END + int8(-11), // (254) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause + int8(-1), // (255) trigger_time ::= BEFORE|AFTER + int8(-2), // (256) trigger_time ::= INSTEAD OF + int8(0), // (257) trigger_time ::= + int8(-1), // (258) trigger_event ::= DELETE|INSERT + int8(-1), // (259) trigger_event ::= UPDATE + int8(-3), // (260) trigger_event ::= UPDATE OF idlist + int8(0), // (261) when_clause ::= + int8(-2), // (262) when_clause ::= WHEN expr + int8(-3), // (263) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI + int8(-2), // (264) trigger_cmd_list ::= trigger_cmd SEMI + int8(-3), // (265) trnm ::= nm DOT nm + int8(-3), // (266) tridxby ::= INDEXED BY nm + int8(-2), // (267) tridxby ::= NOT INDEXED + int8(-9), // (268) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt + int8(-8), // (269) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt + int8(-6), // (270) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt + int8(-3), // (271) trigger_cmd ::= scanpt select scanpt + int8(-4), // (272) expr ::= RAISE LP IGNORE RP + int8(-6), // (273) expr ::= RAISE LP raisetype COMMA nm RP + int8(-1), // (274) raisetype ::= ROLLBACK + int8(-1), // (275) raisetype ::= ABORT + int8(-1), // (276) raisetype ::= FAIL + int8(-4), // (277) cmd ::= DROP TRIGGER ifexists fullname + int8(-6), // (278) cmd ::= ATTACH database_kw_opt expr AS expr key_opt + int8(-3), // (279) cmd ::= DETACH database_kw_opt expr + int8(0), // (280) key_opt ::= + int8(-2), // (281) key_opt ::= KEY expr + int8(-1), // (282) cmd ::= REINDEX + int8(-3), // (283) cmd ::= REINDEX nm dbnm + int8(-1), // (284) cmd ::= ANALYZE + int8(-3), // (285) cmd ::= ANALYZE nm dbnm + int8(-6), // (286) cmd ::= ALTER TABLE fullname RENAME TO nm + int8(-7), // (287) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist + int8(-6), // (288) cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm + int8(-1), // (289) add_column_fullname ::= fullname + int8(-8), // (290) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm + int8(-1), // (291) cmd ::= create_vtab + int8(-4), // (292) cmd ::= create_vtab LP vtabarglist RP + int8(-8), // (293) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm + int8(0), // (294) vtabarg ::= + int8(-1), // (295) vtabargtoken ::= ANY + int8(-3), // (296) vtabargtoken ::= lp anylist RP + int8(-1), // (297) lp ::= LP + int8(-2), // (298) with ::= WITH wqlist + int8(-3), // (299) with ::= WITH RECURSIVE wqlist + int8(-1), // (300) wqas ::= AS + int8(-2), // (301) wqas ::= AS MATERIALIZED + int8(-3), // (302) wqas ::= AS NOT MATERIALIZED + int8(-6), // (303) wqitem ::= nm eidlist_opt wqas LP select RP + int8(-1), // (304) wqlist ::= wqitem + int8(-3), // (305) wqlist ::= wqlist COMMA wqitem + int8(-1), // (306) windowdefn_list ::= windowdefn + int8(-3), // (307) windowdefn_list ::= windowdefn_list COMMA windowdefn + int8(-5), // (308) windowdefn ::= nm AS LP window RP + int8(-5), // (309) window ::= PARTITION BY nexprlist orderby_opt frame_opt + int8(-6), // (310) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt + int8(-4), // (311) window ::= ORDER BY sortlist frame_opt + int8(-5), // (312) window ::= nm ORDER BY sortlist frame_opt + int8(-1), // (313) window ::= frame_opt + int8(-2), // (314) window ::= nm frame_opt + int8(0), // (315) frame_opt ::= + int8(-3), // (316) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt + int8(-6), // (317) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt + int8(-1), // (318) range_or_rows ::= RANGE|ROWS|GROUPS + int8(-1), // (319) frame_bound_s ::= frame_bound + int8(-2), // (320) frame_bound_s ::= UNBOUNDED PRECEDING + int8(-1), // (321) frame_bound_e ::= frame_bound + int8(-2), // (322) frame_bound_e ::= UNBOUNDED FOLLOWING + int8(-2), // (323) frame_bound ::= expr PRECEDING|FOLLOWING + int8(-2), // (324) frame_bound ::= CURRENT ROW + int8(0), // (325) frame_exclude_opt ::= + int8(-2), // (326) frame_exclude_opt ::= EXCLUDE frame_exclude + int8(-2), // (327) frame_exclude ::= NO OTHERS + int8(-2), // (328) frame_exclude ::= CURRENT ROW + int8(-1), // (329) frame_exclude ::= GROUP|TIES + int8(-2), // (330) window_clause ::= WINDOW windowdefn_list + int8(-2), // (331) filter_over ::= filter_clause over_clause + int8(-1), // (332) filter_over ::= over_clause + int8(-1), // (333) filter_over ::= filter_clause + int8(-4), // (334) over_clause ::= OVER LP window RP + int8(-2), // (335) over_clause ::= OVER nm + int8(-5), // (336) filter_clause ::= FILTER LP WHERE expr RP + int8(-1), // (337) input ::= cmdlist + int8(-2), // (338) cmdlist ::= cmdlist ecmd + int8(-1), // (339) cmdlist ::= ecmd + int8(-1), // (340) ecmd ::= SEMI + int8(-2), // (341) ecmd ::= cmdx SEMI + int8(-3), // (342) ecmd ::= explain cmdx SEMI + int8(0), // (343) trans_opt ::= + int8(-1), // (344) trans_opt ::= TRANSACTION + int8(-2), // (345) trans_opt ::= TRANSACTION nm + int8(-1), // (346) savepoint_opt ::= SAVEPOINT + int8(0), // (347) savepoint_opt ::= + int8(-2), // (348) cmd ::= create_table create_table_args + int8(-4), // (349) columnlist ::= columnlist COMMA columnname carglist + int8(-2), // (350) columnlist ::= columnname carglist + int8(-1), // (351) nm ::= ID|INDEXED + int8(-1), // (352) nm ::= STRING + int8(-1), // (353) nm ::= JOIN_KW + int8(-1), // (354) typetoken ::= typename + int8(-1), // (355) typename ::= ID|STRING + int8(-1), // (356) signed ::= plus_num + int8(-1), // (357) signed ::= minus_num + int8(-2), // (358) carglist ::= carglist ccons + int8(0), // (359) carglist ::= + int8(-2), // (360) ccons ::= NULL onconf + int8(-4), // (361) ccons ::= GENERATED ALWAYS AS generated + int8(-2), // (362) ccons ::= AS generated + int8(-2), // (363) conslist_opt ::= COMMA conslist + int8(-3), // (364) conslist ::= conslist tconscomma tcons + int8(-1), // (365) conslist ::= tcons + int8(0), // (366) tconscomma ::= + int8(-1), // (367) defer_subclause_opt ::= defer_subclause + int8(-1), // (368) resolvetype ::= raisetype + int8(-1), // (369) selectnowith ::= oneselect + int8(-1), // (370) oneselect ::= values + int8(-2), // (371) sclp ::= selcollist COMMA + int8(-1), // (372) as ::= ID|STRING + int8(0), // (373) returning ::= + int8(-1), // (374) expr ::= term + int8(-1), // (375) likeop ::= LIKE_KW|MATCH + int8(-1), // (376) exprlist ::= nexprlist + int8(-1), // (377) nmnum ::= plus_num + int8(-1), // (378) nmnum ::= nm + int8(-1), // (379) nmnum ::= ON + int8(-1), // (380) nmnum ::= DELETE + int8(-1), // (381) nmnum ::= DEFAULT + int8(-1), // (382) plus_num ::= INTEGER|FLOAT + int8(0), // (383) foreach_clause ::= + int8(-3), // (384) foreach_clause ::= FOR EACH ROW + int8(-1), // (385) trnm ::= nm + int8(0), // (386) tridxby ::= + int8(-1), // (387) database_kw_opt ::= DATABASE + int8(0), // (388) database_kw_opt ::= + int8(0), // (389) kwcolumn_opt ::= + int8(-1), // (390) kwcolumn_opt ::= COLUMNKW + int8(-1), // (391) vtabarglist ::= vtabarg + int8(-3), // (392) vtabarglist ::= vtabarglist COMMA vtabarg + int8(-2), // (393) vtabarg ::= vtabarg vtabargtoken + int8(0), // (394) anylist ::= + int8(-4), // (395) anylist ::= anylist LP anylist RP + int8(-2), // (396) anylist ::= anylist ANY + int8(0), // (397) with ::= +} /* sqlite3.c:159980:26 */ // Forward Declaration @@ -137883,7 +140383,7 @@ var yyRuleInfoNRhs = [385]int8{ // if the lookahead token has already been consumed. As this procedure is // only called from one place, optimizing compilers will in-line it, which // means that the extra parameters have no performance impact. -func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken Token, pParse uintptr) uint16 { /* sqlite3.c:157463:21: */ +func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken Token, pParse uintptr) uint16 { /* sqlite3.c:160393:21: */ bp := tls.Alloc(128) defer tls.Free(128) @@ -137896,19 +140396,6 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in _ = yyLookaheadToken yymsp = (*YyParser)(unsafe.Pointer(yypParser)).Fyytos - // Check that the stack is large enough to grow by a single entry - // if the RHS of the rule is empty. This ensures that there is room - // enough on the stack to push the LHS value - if int32(yyRuleInfoNRhs[yyruleno]) == 0 { - if (*YyParser)(unsafe.Pointer(yypParser)).Fyytos >= (*YyParser)(unsafe.Pointer(yypParser)).FyystackEnd { - yyStackOverflow(tls, yypParser) - // The call to yyStackOverflow() above pops the stack until it is - // empty, causing the main parser loop to exit. So the return value - // is never used and does not matter. - return uint16(0) - } - } - switch yyruleno { // Beginning here are the reduction cases. A typical example // follows: @@ -137951,7 +140438,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough case uint32(7): /* transtype ::= EXCLUSIVE */ fallthrough - case uint32(306): /* range_or_rows ::= RANGE|ROWS|GROUPS */ + case uint32(318): /* range_or_rows ::= RANGE|ROWS|GROUPS */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/ } @@ -138004,7 +140491,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough case uint32(96): /* distinct ::= */ fallthrough - case uint32(232): /* collate ::= */ + case uint32(239): /* collate ::= */ { *(*int32)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = 0 } @@ -138034,11 +140521,11 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(22): /* table_options ::= WITHOUT nm */ { - if ((*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fn == uint32(5)) && (Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fz, ts+10064 /* "rowid" */, 5) == 0) { + if ((*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fn == uint32(5)) && (Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fz, ts+10157 /* "rowid" */, 5) == 0) { *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = (TF_WithoutRowid | TF_NoVisibleRowid) } else { *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 0 - Xsqlite3ErrorMsg(tls, pParse, ts+24592 /* "unknown table op..." */, libc.VaList(bp, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fn, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fz)) + Xsqlite3ErrorMsg(tls, pParse, ts+25098 /* "unknown table op..." */, libc.VaList(bp, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fn, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fz)) } } break @@ -138135,12 +140622,12 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in case uint32(38): /* ccons ::= UNIQUE onconf */ { Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), uintptr(0), *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), uintptr(0), 0, 0, - SQLITE_IDXTYPE_UNIQUE) + uint8(SQLITE_IDXTYPE_UNIQUE)) } break case uint32(39): /* ccons ::= CHECK LP expr RP */ { - Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) + Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*24+8 /* &.minor */)).Fz, (*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fz) } break case uint32(40): /* ccons ::= REFERENCES nm eidlist_opt refargs */ @@ -138175,31 +140662,31 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(48): /* refargs ::= refargs refarg */ { - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = ((*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) & ^*(*int32)(unsafe.Pointer((yymsp + 8 /* &.minor */ /* &.yy207 */) + 4 /* &.mask */))) | *(*int32)(unsafe.Pointer((yymsp + 8 /* &.minor */ /* &.yy207 */) /* &.value */))) + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = ((*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) & ^*(*int32)(unsafe.Pointer((yymsp + 8 /* &.minor */ /* &.yy615 */) + 4 /* &.mask */))) | *(*int32)(unsafe.Pointer((yymsp + 8 /* &.minor */ /* &.yy615 */) /* &.value */))) } break case uint32(49): /* refarg ::= MATCH nm */ { - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy207 */ /* &.value */)) = 0 - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy207 */ + 4 /* &.mask */)) = 0x000000 + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy615 */ /* &.value */)) = 0 + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy615 */ + 4 /* &.mask */)) = 0x000000 } break case uint32(50): /* refarg ::= ON INSERT refact */ { - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy207 */ /* &.value */)) = 0 - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy207 */ + 4 /* &.mask */)) = 0x000000 + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy615 */ /* &.value */)) = 0 + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy615 */ + 4 /* &.mask */)) = 0x000000 } break case uint32(51): /* refarg ::= ON DELETE refact */ { - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy207 */ /* &.value */)) = *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy207 */ + 4 /* &.mask */)) = 0x0000ff + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy615 */ /* &.value */)) = *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy615 */ + 4 /* &.mask */)) = 0x0000ff } break case uint32(52): /* refarg ::= ON UPDATE refact */ { - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy207 */ /* &.value */)) = (*(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) << 8) - *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy207 */ + 4 /* &.mask */)) = 0x00ff00 + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy615 */ /* &.value */)) = (*(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) << 8) + *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy615 */ + 4 /* &.mask */)) = 0x00ff00 } break case uint32(53): /* refact ::= SET NULL */ @@ -138236,7 +140723,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough // defer_subclause ::= DEFERRABLE init_deferred_pred_opt case uint32(74): /* orconf ::= OR resolvetype */ fallthrough - case uint32(162): /* insert_cmd ::= INSERT orconf */ + case uint32(169): /* insert_cmd ::= INSERT orconf */ { *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } @@ -138245,11 +140732,11 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough // init_deferred_pred_opt ::= INITIALLY DEFERRED case uint32(78): /* ifexists ::= IF EXISTS */ fallthrough - case uint32(204): /* between_op ::= NOT BETWEEN */ + case uint32(211): /* between_op ::= NOT BETWEEN */ fallthrough - case uint32(207): /* in_op ::= NOT IN */ + case uint32(214): /* in_op ::= NOT IN */ fallthrough - case uint32(233): /* collate ::= COLLATE ID|STRING */ + case uint32(240): /* collate ::= COLLATE ID|STRING */ { *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 1 } @@ -138272,12 +140759,12 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in case uint32(67): /* tcons ::= UNIQUE LP sortlist RP onconf */ { Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), uintptr(0), 0, 0, - SQLITE_IDXTYPE_UNIQUE) + uint8(SQLITE_IDXTYPE_UNIQUE)) } break case uint32(68): /* tcons ::= CHECK LP expr RP onconf */ { - Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) + Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */)).Fz, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz) } break case uint32(69): /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */ @@ -138305,7 +140792,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(76): fallthrough // resolvetype ::= REPLACE - case uint32(163): /* insert_cmd ::= REPLACE */ + case uint32(170): /* insert_cmd ::= REPLACE */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = OE_Replace } @@ -138327,33 +140814,19 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(82): /* cmd ::= select */ { - *(*SelectDest)(unsafe.Pointer(bp + 24 /* dest */)) = SelectDest{FeDest: SRT_Output} + *(*SelectDest)(unsafe.Pointer(bp + 24 /* dest */)) = SelectDest{FeDest: U8(SRT_Output)} Xsqlite3Select(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), bp+24 /* &dest */) Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break case uint32(83): /* select ::= WITH wqlist selectnowith */ { - var p uintptr = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) - if p != 0 { - (*Select)(unsafe.Pointer(p)).FpWith = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) - parserDoubleLinkSelect(tls, pParse, p) - } else { - Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) - } - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = p + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = attachWithToSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) } break case uint32(84): /* select ::= WITH RECURSIVE wqlist selectnowith */ { - var p uintptr = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) - if p != 0 { - (*Select)(unsafe.Pointer(p)).FpWith = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) - parserDoubleLinkSelect(tls, pParse, p) - } else { - Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) - } - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = p + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = attachWithToSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) } break case uint32(85): /* select ::= selectnowith */ @@ -138423,7 +140896,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(92): /* values ::= VALUES LP nexprlist RP */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), SF_Values, uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) } break case uint32(93): /* values ::= values COMMA LP nexprlist RP */ @@ -138435,7 +140908,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*U32)(unsafe.Pointer(pLeft + 4 /* &.selFlags */)) &= (libc.Uint32FromInt32(libc.CplInt32(SF_MultiValue))) } if pRight != 0 { - (*Select)(unsafe.Pointer(pRight)).Fop = TK_ALL + (*Select)(unsafe.Pointer(pRight)).Fop = U8(TK_ALL) (*Select)(unsafe.Pointer(pRight)).FpPrior = pLeft *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = pRight } else { @@ -138459,11 +140932,11 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough case uint32(140): /* groupby_opt ::= */ fallthrough - case uint32(220): /* exprlist ::= */ + case uint32(227): /* exprlist ::= */ fallthrough - case uint32(223): /* paren_exprlist ::= */ + case uint32(230): /* paren_exprlist ::= */ fallthrough - case uint32(228): /* eidlist_opt ::= */ + case uint32(235): /* eidlist_opt ::= */ { *(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = uintptr(0) } @@ -138495,9 +140968,9 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough // as ::= AS nm case uint32(112): /* dbnm ::= DOT nm */ fallthrough - case uint32(244): /* plus_num ::= PLUS INTEGER|FLOAT */ + case uint32(251): /* plus_num ::= PLUS INTEGER|FLOAT */ fallthrough - case uint32(245): /* minus_num ::= MINUS INTEGER|FLOAT */ + case uint32(252): /* minus_num ::= MINUS INTEGER|FLOAT */ { *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } @@ -138518,7 +140991,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in case uint32(105): /* stl_prefix ::= seltablist joinop */ { if (*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0) && ((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnSrc > 0) { - (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnSrc-1))*112)).Ffg.Fjointype = U8(*(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */))) + (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnSrc-1))*112)).Ffg.Fjointype = U8(*(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } } break @@ -138549,23 +141022,23 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) != 0 { var pNew uintptr = ((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)))).FnSrc-1))*112) var pOld uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 8 /* &.a */ - (*SrcList_item)(unsafe.Pointer(pNew)).FzName = (*SrcList_item)(unsafe.Pointer(pOld)).FzName - (*SrcList_item)(unsafe.Pointer(pNew)).FzDatabase = (*SrcList_item)(unsafe.Pointer(pOld)).FzDatabase - (*SrcList_item)(unsafe.Pointer(pNew)).FpSelect = (*SrcList_item)(unsafe.Pointer(pOld)).FpSelect + (*SrcItem)(unsafe.Pointer(pNew)).FzName = (*SrcItem)(unsafe.Pointer(pOld)).FzName + (*SrcItem)(unsafe.Pointer(pNew)).FzDatabase = (*SrcItem)(unsafe.Pointer(pOld)).FzDatabase + (*SrcItem)(unsafe.Pointer(pNew)).FpSelect = (*SrcItem)(unsafe.Pointer(pOld)).FpSelect if (uint32(int32(*(*uint8)(unsafe.Pointer(pOld + 60 /* &.fg */ + 4 /* &.isTabFunc */)) & 0x4 >> 2))) != 0 { *(*uintptr)(unsafe.Pointer(pNew + 96 /* &.u1 */)) = *(*uintptr)(unsafe.Pointer(pOld + 96 /* &.u1 */)) *(*uintptr)(unsafe.Pointer(pOld + 96 /* &.u1 */)) = uintptr(0) libc.SetBitFieldPtr8Uint32(pOld+60 /* &.fg */ +4 /* &.isTabFunc */, uint32(0), 2, 0x4) libc.SetBitFieldPtr8Uint32(pNew+60 /* &.fg */ +4 /* &.isTabFunc */, uint32(1), 2, 0x4) } - (*SrcList_item)(unsafe.Pointer(pOld)).FzName = libc.AssignPtrUintptr(pOld+8 /* &.zDatabase */, uintptr(0)) - (*SrcList_item)(unsafe.Pointer(pOld)).FpSelect = uintptr(0) + (*SrcItem)(unsafe.Pointer(pOld)).FzName = libc.AssignPtrUintptr(pOld+8 /* &.zDatabase */, uintptr(0)) + (*SrcItem)(unsafe.Pointer(pOld)).FpSelect = uintptr(0) } Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */))) } else { var pSubquery uintptr Xsqlite3SrcListShiftJoinType(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */))) - pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), SF_NestedFrom, uintptr(0)) + pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_NestedFrom), uintptr(0)) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), pSubquery, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } @@ -138583,7 +141056,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + 8 /* &.minor */ /* &.yy0 */), uintptr(0)) if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && (*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) != 0) { - Xsqlite3RenameTokenMap(tls, pParse, (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) + 8 /* &.a */))).FzName, (yymsp + 8 /* &.minor */ /* &.yy0 */)) + Xsqlite3RenameTokenMap(tls, pParse, (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) + 8 /* &.a */))).FzName, (yymsp + 8 /* &.minor */ /* &.yy0 */)) } } *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) @@ -138592,7 +141065,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */)) if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && (*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) != 0) { - Xsqlite3RenameTokenMap(tls, pParse, (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) + 8 /* &.a */))).FzName, (yymsp + 8 /* &.minor */ /* &.yy0 */)) + Xsqlite3RenameTokenMap(tls, pParse, (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) + 8 /* &.a */))).FzName, (yymsp + 8 /* &.minor */ /* &.yy0 */)) } } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) @@ -138611,7 +141084,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */)) //A-overwrites-X if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 { - (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 8 /* &.a */))).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + 8 /* &.minor */ /* &.yy0 */)) + (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 8 /* &.a */))).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + 8 /* &.minor */ /* &.yy0 */)) } } break @@ -138619,7 +141092,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0)) //A-overwrites-X if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) != 0 { - (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 8 /* &.a */))).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + 8 /* &.minor */ /* &.yy0 */)) + (*SrcItem)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 8 /* &.a */))).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + 8 /* &.minor */ /* &.yy0 */)) } } break @@ -138649,9 +141122,11 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough case uint32(150): /* where_opt ::= WHERE expr */ fallthrough - case uint32(216): /* case_else ::= ELSE expr */ + case uint32(152): /* where_opt_ret ::= WHERE expr */ fallthrough - case uint32(237): /* vinto ::= INTO expr */ + case uint32(223): /* case_else ::= ELSE expr */ + fallthrough + case uint32(244): /* vinto ::= INTO expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } @@ -138664,11 +141139,13 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in fallthrough case uint32(149): /* where_opt ::= */ fallthrough - case uint32(217): /* case_else ::= */ + case uint32(151): /* where_opt_ret ::= */ fallthrough - case uint32(219): /* case_operand ::= */ + case uint32(224): /* case_else ::= */ fallthrough - case uint32(238): /* vinto ::= */ + case uint32(226): /* case_operand ::= */ + fallthrough + case uint32(245): /* vinto ::= */ { *(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = uintptr(0) } @@ -138691,7 +141168,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in break case uint32(129): fallthrough // using_opt ::= - case uint32(164): /* idlist_opt ::= */ + case uint32(171): /* idlist_opt ::= */ { *(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = uintptr(0) } @@ -138757,101 +141234,129 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_LIMIT, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) } break - case uint32(148): /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt */ + case uint32(148): /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */ { Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */)) Xsqlite3DeleteFrom(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), uintptr(0)) } break - case uint32(151): /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt */ + case uint32(153): /* where_opt_ret ::= RETURNING selcollist */ + { + Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = uintptr(0) + } + break + case uint32(154): /* where_opt_ret ::= WHERE expr RETURNING selcollist */ + { + Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + } + break + case uint32(155): /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ { Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */)) - Xsqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), ts+24619 /* "set list" */) + Xsqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), ts+25125 /* "set list" */) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendList(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) Xsqlite3Update(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0)) } break - case uint32(152): /* setlist ::= setlist COMMA nm EQ expr */ + case uint32(156): /* setlist ::= setlist COMMA nm EQ expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1) } break - case uint32(153): /* setlist ::= setlist COMMA LP idlist RP EQ expr */ + case uint32(157): /* setlist ::= setlist COMMA LP idlist RP EQ expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppendVector(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(154): /* setlist ::= nm EQ expr */ + case uint32(158): /* setlist ::= nm EQ expr */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(155): /* setlist ::= LP idlist RP EQ expr */ + case uint32(159): /* setlist ::= LP idlist RP EQ expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppendVector(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(156): /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */ + case uint32(160): /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */ { Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(157): /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */ + case uint32(161): /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */ { - Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), uintptr(0)) + Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0)) } break - case uint32(158): /* upsert ::= */ + case uint32(162): /* upsert ::= */ { *(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = uintptr(0) } break - case uint32(159): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */ + case uint32(163): /* upsert ::= RETURNING selcollist */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = uintptr(0) + Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(160): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */ + case uint32(164): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-11)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(161): /* upsert ::= ON CONFLICT DO NOTHING */ + case uint32(165): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(165): /* idlist_opt ::= LP idlist RP */ + case uint32(166): /* upsert ::= ON CONFLICT DO NOTHING returning */ + { + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + } + break + case uint32(167): /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */ + { + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0)) + } + break + case uint32(168): /* returning ::= RETURNING selcollist */ + { + Xsqlite3AddReturning(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) + } + break + case uint32(172): /* idlist_opt ::= LP idlist RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break - case uint32(166): /* idlist ::= idlist COMMA nm */ + case uint32(173): /* idlist ::= idlist COMMA nm */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3IdListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(167): /* idlist ::= nm */ + case uint32(174): /* idlist ::= nm */ { *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = Xsqlite3IdListAppend(tls, pParse, uintptr(0), (yymsp + 8 /* &.minor */ /* &.yy0 */)) /*A-overwrites-Y*/ } break - case uint32(168): /* expr ::= LP expr RP */ + case uint32(175): /* expr ::= LP expr RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break - case uint32(169): + case uint32(176): fallthrough // expr ::= ID|INDEXED - case uint32(170): /* expr ::= JOIN_KW */ + case uint32(177): /* expr ::= JOIN_KW */ { *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = tokenExpr(tls, pParse, TK_ID, *(*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */))) /*A-overwrites-X*/ } break - case uint32(171): /* expr ::= nm DOT nm */ + case uint32(178): /* expr ::= nm DOT nm */ { var temp1 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1) var temp2 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + 8 /* &.minor */ /* &.yy0 */), 1) @@ -138863,7 +141368,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(172): /* expr ::= nm DOT nm DOT nm */ + case uint32(179): /* expr ::= nm DOT nm DOT nm */ { var temp1 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), 1) var temp2 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_ID, (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1) @@ -138877,20 +141382,20 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(173): + case uint32(180): fallthrough // term ::= NULL|FLOAT|BLOB - case uint32(174): /* term ::= STRING */ + case uint32(181): /* term ::= STRING */ { *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = tokenExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor), *(*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */))) /*A-overwrites-X*/ } break - case uint32(175): /* term ::= INTEGER */ + case uint32(182): /* term ::= INTEGER */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, (yymsp + 8 /* &.minor */ /* &.yy0 */), 1) } *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(176): /* expr ::= VARIABLE */ + case uint32(183): /* expr ::= VARIABLE */ { if !((int32(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */)).Fz))) == '#') && ((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(yymsp+8 /* &.minor */)).Fz + 1)))]) & 0x04) != 0)) { var n U32 = (*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */)).Fn @@ -138903,7 +141408,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*Token)(unsafe.Pointer(bp + 96 /* t */)) = *(*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */)) //A-overwrites-X if int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+24628 /* "near \"%T\": synta..." */, libc.VaList(bp+16, bp+96 /* &t */)) + Xsqlite3ErrorMsg(tls, pParse, ts+25134 /* "near \"%T\": synta..." */, libc.VaList(bp+16, bp+96 /* &t */)) *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = uintptr(0) } else { *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_REGISTER, uintptr(0), uintptr(0)) @@ -138914,50 +141419,50 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } } break - case uint32(177): /* expr ::= expr COLLATE ID|STRING */ + case uint32(184): /* expr ::= expr COLLATE ID|STRING */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprAddCollateToken(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + 8 /* &.minor */ /* &.yy0 */), 1) } break - case uint32(178): /* expr ::= CAST LP expr AS typetoken RP */ + case uint32(185): /* expr ::= CAST LP expr AS typetoken RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_CAST, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 1) Xsqlite3ExprAttachSubtrees(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0)) } break - case uint32(179): /* expr ::= ID|INDEXED LP distinct exprlist RP */ + case uint32(186): /* expr ::= ID|INDEXED LP distinct exprlist RP */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(180): /* expr ::= ID|INDEXED LP STAR RP */ + case uint32(187): /* expr ::= ID|INDEXED LP STAR RP */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), 0) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(181): /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */ + case uint32(188): /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */))) Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(182): /* expr ::= ID|INDEXED LP STAR RP filter_over */ + case uint32(189): /* expr ::= ID|INDEXED LP STAR RP filter_over */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), 0) Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(183): /* term ::= CTIME_KW */ + case uint32(190): /* term ::= CTIME_KW */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + 8 /* &.minor */ /* &.yy0 */), 0) } *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(184): /* expr ::= LP nexprlist COMMA expr RP */ + case uint32(191): /* expr ::= LP nexprlist COMMA expr RP */ { var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_VECTOR, uintptr(0), uintptr(0)) @@ -138971,35 +141476,35 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } } break - case uint32(185): /* expr ::= expr AND expr */ + case uint32(192): /* expr ::= expr AND expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprAnd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(186): + case uint32(193): fallthrough // expr ::= expr OR expr - case uint32(187): /* expr ::= expr LT|GT|GE|LE expr */ + case uint32(194): /* expr ::= expr LT|GT|GE|LE expr */ fallthrough - case uint32(188): /* expr ::= expr EQ|NE expr */ + case uint32(195): /* expr ::= expr EQ|NE expr */ fallthrough - case uint32(189): /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ + case uint32(196): /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ fallthrough - case uint32(190): /* expr ::= expr PLUS|MINUS expr */ + case uint32(197): /* expr ::= expr PLUS|MINUS expr */ fallthrough - case uint32(191): /* expr ::= expr STAR|SLASH|REM expr */ + case uint32(198): /* expr ::= expr STAR|SLASH|REM expr */ fallthrough - case uint32(192): /* expr ::= expr CONCAT expr */ + case uint32(199): /* expr ::= expr CONCAT expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(193): /* likeop ::= NOT LIKE_KW|MATCH */ + case uint32(200): /* likeop ::= NOT LIKE_KW|MATCH */ { *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */)) *(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */ + 8 /* &.n */)) |= (0x80000000) /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/ } break - case uint32(194): /* expr ::= expr likeop expr */ + case uint32(201): /* expr ::= expr likeop expr */ { var pList uintptr var bNot int32 = (int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fn & 0x80000000)) @@ -139011,11 +141516,11 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0)) } if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) != 0 { - *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (EP_InfixFunc) + *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (U32(EP_InfixFunc)) } } break - case uint32(195): /* expr ::= expr likeop expr ESCAPE expr */ + case uint32(202): /* expr ::= expr likeop expr ESCAPE expr */ { var pList uintptr var bNot int32 = (int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */)).Fn & 0x80000000)) @@ -139028,40 +141533,40 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0)) } if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 { - *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (EP_InfixFunc) + *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (U32(EP_InfixFunc)) } } break - case uint32(196): /* expr ::= expr ISNULL|NOTNULL */ + case uint32(203): /* expr ::= expr ISNULL|NOTNULL */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0)) } break - case uint32(197): /* expr ::= expr NOT NULL */ + case uint32(204): /* expr ::= expr NOT NULL */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_NOTNULL, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0)) } break - case uint32(198): /* expr ::= expr IS expr */ + case uint32(205): /* expr ::= expr IS expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_IS, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), TK_ISNULL) } break - case uint32(199): /* expr ::= expr IS NOT expr */ + case uint32(206): /* expr ::= expr IS NOT expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_ISNOT, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), TK_NOTNULL) } break - case uint32(200): + case uint32(207): fallthrough // expr ::= NOT expr - case uint32(201): /* expr ::= BITNOT expr */ + case uint32(208): /* expr ::= BITNOT expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0)) /*A-overwrites-B*/ } break - case uint32(202): /* expr ::= PLUS|MINUS expr */ + case uint32(209): /* expr ::= PLUS|MINUS expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, func() int32 { if int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor) == TK_PLUS { @@ -139072,14 +141577,14 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in //A-overwrites-B } break - case uint32(203): + case uint32(210): fallthrough // between_op ::= BETWEEN - case uint32(206): /* in_op ::= IN */ + case uint32(213): /* in_op ::= IN */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = 0 } break - case uint32(205): /* expr ::= expr between_op expr AND expr */ + case uint32(212): /* expr ::= expr between_op expr AND expr */ { var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) @@ -139094,7 +141599,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } } break - case uint32(208): /* expr ::= expr in_op LP exprlist RP */ + case uint32(215): /* expr ::= expr in_op LP exprlist RP */ { if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) == uintptr(0) { // Expressions of the form @@ -139107,9 +141612,9 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in Xsqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */))) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_INTEGER, func() uintptr { if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 { - return ts + 9901 /* "1" */ + return ts + 9994 /* "1" */ } - return ts + 9370 /* "0" */ + return ts + 9474 /* "0" */ }()) } else if ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnExpr == 1) && (Xsqlite3ExprIsConstant(tls, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))+8 /* &.a */))).FpExpr) != 0) { var pRHS uintptr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) + 8 /* &.a */))).FpExpr @@ -139135,14 +141640,14 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } break - case uint32(209): /* expr ::= LP select RP */ + case uint32(216): /* expr ::= LP select RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_SELECT, uintptr(0), uintptr(0)) Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) } break - case uint32(210): /* expr ::= expr in_op LP select RP */ + case uint32(217): /* expr ::= expr in_op LP select RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_IN, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0)) Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) @@ -139152,7 +141657,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } break - case uint32(211): /* expr ::= expr in_op nm dbnm paren_exprlist */ + case uint32(218): /* expr ::= expr in_op nm dbnm paren_exprlist */ { var pSrc uintptr = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */)) var pSelect uintptr = Xsqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) @@ -139172,15 +141677,15 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } break - case uint32(212): /* expr ::= EXISTS LP select RP */ + case uint32(219): /* expr ::= EXISTS LP select RP */ { var p uintptr - p = libc.AssignPtrUintptr(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */ /* &.yy202 */, Xsqlite3PExpr(tls, pParse, TK_EXISTS, uintptr(0), uintptr(0))) + p = libc.AssignPtrUintptr(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */ /* &.yy602 */, Xsqlite3PExpr(tls, pParse, TK_EXISTS, uintptr(0), uintptr(0))) Xsqlite3PExprAddSelect(tls, pParse, p, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) } break - case uint32(213): /* expr ::= CASE case_operand case_exprlist case_else END */ + case uint32(220): /* expr ::= CASE case_operand case_exprlist case_else END */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_CASE, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 { @@ -139197,113 +141702,113 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } } break - case uint32(214): /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ + case uint32(221): /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(215): /* case_exprlist ::= WHEN expr THEN expr */ + case uint32(222): /* case_exprlist ::= WHEN expr THEN expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(218): /* case_operand ::= expr */ + case uint32(225): /* case_operand ::= expr */ { *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) /*A-overwrites-X*/ } break - case uint32(221): /* nexprlist ::= nexprlist COMMA expr */ + case uint32(228): /* nexprlist ::= nexprlist COMMA expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(222): /* nexprlist ::= expr */ + case uint32(229): /* nexprlist ::= expr */ { *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) /*A-overwrites-Y*/ } break - case uint32(224): + case uint32(231): fallthrough // paren_exprlist ::= LP exprlist RP - case uint32(229): /* eidlist_opt ::= LP eidlist RP */ + case uint32(236): /* eidlist_opt ::= LP eidlist RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break - case uint32(225): /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ + case uint32(232): /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ { Xsqlite3CreateIndex(tls, pParse, (yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */), Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */ /* &.yy0 */), uintptr(0)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)), - (yymsp + libc.UintptrFromInt32(-11)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), SQLITE_SO_ASC, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), SQLITE_IDXTYPE_APPDEF) + (yymsp + libc.UintptrFromInt32(-11)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), SQLITE_SO_ASC, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), uint8(SQLITE_IDXTYPE_APPDEF)) if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) && ((*Parse)(unsafe.Pointer(pParse)).FpNewIndex != 0) { Xsqlite3RenameTokenMap(tls, pParse, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpNewIndex)).FzName, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */)) } } break - case uint32(226): + case uint32(233): fallthrough // uniqueflag ::= UNIQUE - case uint32(268): /* raisetype ::= ABORT */ + case uint32(275): /* raisetype ::= ABORT */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = OE_Abort } break - case uint32(227): /* uniqueflag ::= */ + case uint32(234): /* uniqueflag ::= */ { *(*int32)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = OE_None } break - case uint32(230): /* eidlist ::= eidlist COMMA nm collate sortorder */ + case uint32(237): /* eidlist ::= eidlist COMMA nm collate sortorder */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = parserAddExprIdListTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(231): /* eidlist ::= nm collate sortorder */ + case uint32(238): /* eidlist ::= nm collate sortorder */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = parserAddExprIdListTerm(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */))) //A-overwrites-Y } break - case uint32(234): /* cmd ::= DROP INDEX ifexists fullname */ + case uint32(241): /* cmd ::= DROP INDEX ifexists fullname */ { Xsqlite3DropIndex(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) } break - case uint32(235): /* cmd ::= VACUUM vinto */ + case uint32(242): /* cmd ::= VACUUM vinto */ { Xsqlite3Vacuum(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(236): /* cmd ::= VACUUM nm vinto */ + case uint32(243): /* cmd ::= VACUUM nm vinto */ { Xsqlite3Vacuum(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(239): /* cmd ::= PRAGMA nm dbnm */ + case uint32(246): /* cmd ::= PRAGMA nm dbnm */ { Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */), uintptr(0), 0) } break - case uint32(240): /* cmd ::= PRAGMA nm dbnm EQ nmnum */ + case uint32(247): /* cmd ::= PRAGMA nm dbnm EQ nmnum */ { Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */), 0) } break - case uint32(241): /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ + case uint32(248): /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ { Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 0) } break - case uint32(242): /* cmd ::= PRAGMA nm dbnm EQ minus_num */ + case uint32(249): /* cmd ::= PRAGMA nm dbnm EQ minus_num */ { Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */), 1) } break - case uint32(243): /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ + case uint32(250): /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ { Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 1) } break - case uint32(246): /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ + case uint32(253): /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ { // var all Token at bp+112, 16 @@ -139312,7 +141817,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in Xsqlite3FinishTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), bp+112 /* &all */) } break - case uint32(247): /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ + case uint32(254): /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ { Xsqlite3BeginTrigger(tls, pParse, (yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (*TrigEvent)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fa, (*TrigEvent)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */))) *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)) = func() Token1 { @@ -139323,117 +141828,117 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in }() //A-overwrites-T } break - case uint32(248): /* trigger_time ::= BEFORE|AFTER */ + case uint32(255): /* trigger_time ::= BEFORE|AFTER */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/ } break - case uint32(249): /* trigger_time ::= INSTEAD OF */ + case uint32(256): /* trigger_time ::= INSTEAD OF */ { *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = TK_INSTEAD } break - case uint32(250): /* trigger_time ::= */ + case uint32(257): /* trigger_time ::= */ { *(*int32)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = TK_BEFORE } break - case uint32(251): + case uint32(258): fallthrough // trigger_event ::= DELETE|INSERT - case uint32(252): /* trigger_event ::= UPDATE */ + case uint32(259): /* trigger_event ::= UPDATE */ { (*TrigEvent)(unsafe.Pointer(yymsp + 8 /* &.minor */)).Fa = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/ (*TrigEvent)(unsafe.Pointer(yymsp + 8 /* &.minor */)).Fb = uintptr(0) } break - case uint32(253): /* trigger_event ::= UPDATE OF idlist */ + case uint32(260): /* trigger_event ::= UPDATE OF idlist */ { (*TrigEvent)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fa = TK_UPDATE (*TrigEvent)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fb = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } break - case uint32(254): + case uint32(261): fallthrough // when_clause ::= - case uint32(273): /* key_opt ::= */ + case uint32(280): /* key_opt ::= */ { *(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = uintptr(0) } break - case uint32(255): + case uint32(262): fallthrough // when_clause ::= WHEN expr - case uint32(274): /* key_opt ::= KEY expr */ + case uint32(281): /* key_opt ::= KEY expr */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } break - case uint32(256): /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ + case uint32(263): /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ { (*TriggerStep)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))).FpLast)).FpNext = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) (*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break - case uint32(257): /* trigger_cmd_list ::= trigger_cmd SEMI */ + case uint32(264): /* trigger_cmd_list ::= trigger_cmd SEMI */ { (*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break - case uint32(258): /* trnm ::= nm DOT nm */ + case uint32(265): /* trnm ::= nm DOT nm */ { *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + 8 /* &.minor */)) Xsqlite3ErrorMsg(tls, pParse, - ts+24652 /* "qualified table ..." */, 0) + ts+25158 /* "qualified table ..." */, 0) } break - case uint32(259): /* tridxby ::= INDEXED BY nm */ + case uint32(266): /* tridxby ::= INDEXED BY nm */ { Xsqlite3ErrorMsg(tls, pParse, - ts+24747 /* "the INDEXED BY c..." */, 0) + ts+25253 /* "the INDEXED BY c..." */, 0) } break - case uint32(260): /* tridxby ::= NOT INDEXED */ + case uint32(267): /* tridxby ::= NOT INDEXED */ { Xsqlite3ErrorMsg(tls, pParse, - ts+24831 /* "the NOT INDEXED ..." */, 0) + ts+25337 /* "the NOT INDEXED ..." */, 0) } break - case uint32(261): /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ + case uint32(268): /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerUpdateStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */))), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-8)*24+8 /* &.minor */)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(262): /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ + case uint32(269): /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ { - *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerInsertStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */))), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) //yylhsminor.yy447-overwrites-yymsp[-6].minor.yy192 + *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerInsertStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */))), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) //yylhsminor.yy483-overwrites-yymsp[-6].minor.yy60 } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(263): /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ + case uint32(270): /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerDeleteStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-5)*24+8 /* &.minor */)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(264): /* trigger_cmd ::= scanpt select scanpt */ + case uint32(271): /* trigger_cmd ::= scanpt select scanpt */ { - *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerSelectStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) /*yylhsminor.yy447-overwrites-yymsp[-1].minor.yy539*/ + *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerSelectStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) /*yylhsminor.yy483-overwrites-yymsp[-1].minor.yy307*/ } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(265): /* expr ::= RAISE LP IGNORE RP */ + case uint32(272): /* expr ::= RAISE LP IGNORE RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, TK_RAISE, uintptr(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 { - (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))).FaffExpr = OE_Ignore + (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))).FaffExpr = int8(OE_Ignore) } } break - case uint32(266): /* expr ::= RAISE LP raisetype COMMA nm RP */ + case uint32(273): /* expr ::= RAISE LP raisetype COMMA nm RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, TK_RAISE, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 1) if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) != 0 { @@ -139441,126 +141946,151 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } } break - case uint32(267): /* raisetype ::= ROLLBACK */ + case uint32(274): /* raisetype ::= ROLLBACK */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = OE_Rollback } break - case uint32(269): /* raisetype ::= FAIL */ + case uint32(276): /* raisetype ::= FAIL */ { *(*int32)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = OE_Fail } break - case uint32(270): /* cmd ::= DROP TRIGGER ifexists fullname */ + case uint32(277): /* cmd ::= DROP TRIGGER ifexists fullname */ { Xsqlite3DropTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) } break - case uint32(271): /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ + case uint32(278): /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ { Xsqlite3Attach(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(272): /* cmd ::= DETACH database_kw_opt expr */ + case uint32(279): /* cmd ::= DETACH database_kw_opt expr */ { Xsqlite3Detach(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(275): /* cmd ::= REINDEX */ + case uint32(282): /* cmd ::= REINDEX */ { Xsqlite3Reindex(tls, pParse, uintptr(0), uintptr(0)) } break - case uint32(276): /* cmd ::= REINDEX nm dbnm */ + case uint32(283): /* cmd ::= REINDEX nm dbnm */ { Xsqlite3Reindex(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(277): /* cmd ::= ANALYZE */ + case uint32(284): /* cmd ::= ANALYZE */ { Xsqlite3Analyze(tls, pParse, uintptr(0), uintptr(0)) } break - case uint32(278): /* cmd ::= ANALYZE nm dbnm */ + case uint32(285): /* cmd ::= ANALYZE nm dbnm */ { Xsqlite3Analyze(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(279): /* cmd ::= ALTER TABLE fullname RENAME TO nm */ + case uint32(286): /* cmd ::= ALTER TABLE fullname RENAME TO nm */ { Xsqlite3AlterRenameTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(280): /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ + case uint32(287): /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */ { (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fn = (uint32((int32((int64((*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fz) - int64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz)) / 1))) + (*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fn) Xsqlite3AlterFinishAddColumn(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(281): /* add_column_fullname ::= fullname */ + case uint32(288): /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */ + { + Xsqlite3AlterDropColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), (yymsp + 8 /* &.minor */ /* &.yy0 */)) + } + break + case uint32(289): /* add_column_fullname ::= fullname */ { disableLookaside(tls, pParse) Xsqlite3AlterBeginAddColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } break - case uint32(282): /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */ + case uint32(290): /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */ { Xsqlite3AlterRenameColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(283): /* cmd ::= create_vtab */ + case uint32(291): /* cmd ::= create_vtab */ { Xsqlite3VtabFinishParse(tls, pParse, uintptr(0)) } break - case uint32(284): /* cmd ::= create_vtab LP vtabarglist RP */ + case uint32(292): /* cmd ::= create_vtab LP vtabarglist RP */ { Xsqlite3VtabFinishParse(tls, pParse, (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(285): /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ + case uint32(293): /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ { Xsqlite3VtabBeginParse(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */))) } break - case uint32(286): /* vtabarg ::= */ + case uint32(294): /* vtabarg ::= */ { Xsqlite3VtabArgInit(tls, pParse) } break - case uint32(287): + case uint32(295): fallthrough // vtabargtoken ::= ANY - case uint32(288): /* vtabargtoken ::= lp anylist RP */ + case uint32(296): /* vtabargtoken ::= lp anylist RP */ fallthrough - case uint32(289): /* lp ::= LP */ + case uint32(297): /* lp ::= LP */ { Xsqlite3VtabArgExtend(tls, pParse, (yymsp + 8 /* &.minor */ /* &.yy0 */)) } break - case uint32(290): + case uint32(298): fallthrough // with ::= WITH wqlist - case uint32(291): /* with ::= WITH RECURSIVE wqlist */ + case uint32(299): /* with ::= WITH RECURSIVE wqlist */ { Xsqlite3WithPush(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uint8(1)) } break - case uint32(292): /* wqlist ::= nm eidlist_opt AS LP select RP */ + case uint32(300): /* wqas ::= AS */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) //A-overwrites-X + *(*U8)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = U8(M10d_Any) } break - case uint32(293): /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */ + case uint32(301): /* wqas ::= AS MATERIALIZED */ { - *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) + *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = U8(M10d_Yes) } break - case uint32(294): /* windowdefn_list ::= windowdefn */ + case uint32(302): /* wqas ::= AS NOT MATERIALIZED */ + { + *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = U8(M10d_No) + } + break + case uint32(303): /* wqitem ::= nm eidlist_opt wqas LP select RP */ + { + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3CteNew(tls, pParse, (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */))) //A-overwrites-X + } + break + case uint32(304): /* wqlist ::= wqitem */ + { + *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) //A-overwrites-X + } + break + case uint32(305): /* wqlist ::= wqlist COMMA wqitem */ + { + *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) + } + break + case uint32(306): /* windowdefn_list ::= windowdefn */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(295): /* windowdefn_list ::= windowdefn_list COMMA windowdefn */ + case uint32(307): /* windowdefn_list ::= windowdefn_list COMMA windowdefn */ { Xsqlite3WindowChain(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) @@ -139569,7 +142099,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(296): /* windowdefn ::= nm AS LP window RP */ + case uint32(308): /* windowdefn ::= nm AS LP window RP */ { if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0 { (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FzName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fz, uint64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fn)) @@ -139578,124 +142108,124 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(297): /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */ + case uint32(309): /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0)) } break - case uint32(298): /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */ + case uint32(310): /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */)) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(299): /* window ::= ORDER BY sortlist frame_opt */ + case uint32(311): /* window ::= ORDER BY sortlist frame_opt */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0)) } break - case uint32(300): /* window ::= nm ORDER BY sortlist frame_opt */ + case uint32(312): /* window ::= nm ORDER BY sortlist frame_opt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */)) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(301): + case uint32(313): fallthrough // window ::= frame_opt - case uint32(320): /* filter_over ::= over_clause */ + case uint32(332): /* filter_over ::= over_clause */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(302): /* window ::= nm frame_opt */ + case uint32(314): /* window ::= nm frame_opt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */)) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(303): /* frame_opt ::= */ + case uint32(315): /* frame_opt ::= */ { *(*uintptr)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = Xsqlite3WindowAlloc(tls, pParse, 0, TK_UNBOUNDED, uintptr(0), TK_CURRENT, uintptr(0), uint8(0)) } break - case uint32(304): /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */ + case uint32(316): /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).FpExpr, TK_CURRENT, uintptr(0), *(*U8)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(305): /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */ + case uint32(317): /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */)).FpExpr, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).FpExpr, *(*U8)(unsafe.Pointer(yymsp + 8 /* &.minor */))) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(307): + case uint32(319): fallthrough // frame_bound_s ::= frame_bound - case uint32(309): /* frame_bound_e ::= frame_bound */ + case uint32(321): /* frame_bound_e ::= frame_bound */ { *(*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*FrameBound)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } *(*FrameBound)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(308): + case uint32(320): fallthrough // frame_bound_s ::= UNBOUNDED PRECEDING - case uint32(310): /* frame_bound_e ::= UNBOUNDED FOLLOWING */ + case uint32(322): /* frame_bound_e ::= UNBOUNDED FOLLOWING */ fallthrough - case uint32(312): /* frame_bound ::= CURRENT ROW */ + case uint32(324): /* frame_bound ::= CURRENT ROW */ { (*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24)).Fmajor) (*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)).FpExpr = uintptr(0) } *(*FrameBound)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(311): /* frame_bound ::= expr PRECEDING|FOLLOWING */ + case uint32(323): /* frame_bound ::= expr PRECEDING|FOLLOWING */ { (*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) (*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)).FpExpr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } *(*FrameBound)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(313): /* frame_exclude_opt ::= */ + case uint32(325): /* frame_exclude_opt ::= */ { *(*U8)(unsafe.Pointer(yymsp + 1*24 + 8 /* &.minor */)) = U8(0) } break - case uint32(314): /* frame_exclude_opt ::= EXCLUDE frame_exclude */ + case uint32(326): /* frame_exclude_opt ::= EXCLUDE frame_exclude */ { *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*U8)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } break - case uint32(315): + case uint32(327): fallthrough // frame_exclude ::= NO OTHERS - case uint32(316): /* frame_exclude ::= CURRENT ROW */ + case uint32(328): /* frame_exclude ::= CURRENT ROW */ { *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = U8((*YyStackEntry)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24)).Fmajor) /*A-overwrites-X*/ } break - case uint32(317): /* frame_exclude ::= GROUP|TIES */ + case uint32(329): /* frame_exclude ::= GROUP|TIES */ { *(*U8)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = U8((*YyStackEntry)(unsafe.Pointer(yymsp)).Fmajor) /*A-overwrites-X*/ } break - case uint32(318): /* window_clause ::= WINDOW windowdefn_list */ + case uint32(330): /* window_clause ::= WINDOW windowdefn_list */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } break - case uint32(319): /* filter_over ::= filter_clause over_clause */ + case uint32(331): /* filter_over ::= filter_clause over_clause */ { (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(321): /* filter_over ::= filter_clause */ + case uint32(333): /* filter_over ::= filter_clause */ { *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{}))) if *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) != 0 { - (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FeFrmType = TK_FILTER + (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FeFrmType = U8(TK_FILTER) (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) } else { Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */))) @@ -139703,13 +142233,13 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } *(*uintptr)(unsafe.Pointer(yymsp + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) break - case uint32(322): /* over_clause ::= OVER LP window RP */ + case uint32(334): /* over_clause ::= OVER LP window RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break - case uint32(323): /* over_clause ::= OVER nm */ + case uint32(335): /* over_clause ::= OVER nm */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{}))) if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0 { @@ -139717,72 +142247,73 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in } } break - case uint32(324): /* filter_clause ::= FILTER LP WHERE expr RP */ + case uint32(336): /* filter_clause ::= FILTER LP WHERE expr RP */ { *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) } break default: - /* (325) input ::= cmdlist */ - /* (326) cmdlist ::= cmdlist ecmd */ - /* (327) cmdlist ::= ecmd (OPTIMIZED OUT) */ - /* (328) ecmd ::= SEMI */ - /* (329) ecmd ::= cmdx SEMI */ - /* (330) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ - /* (331) trans_opt ::= */ - /* (332) trans_opt ::= TRANSACTION */ - /* (333) trans_opt ::= TRANSACTION nm */ - /* (334) savepoint_opt ::= SAVEPOINT */ - /* (335) savepoint_opt ::= */ - /* (336) cmd ::= create_table create_table_args */ - /* (337) columnlist ::= columnlist COMMA columnname carglist */ - /* (338) columnlist ::= columnname carglist */ - /* (339) nm ::= ID|INDEXED */ - /* (340) nm ::= STRING */ - /* (341) nm ::= JOIN_KW */ - /* (342) typetoken ::= typename */ - /* (343) typename ::= ID|STRING */ - /* (344) signed ::= plus_num (OPTIMIZED OUT) */ - /* (345) signed ::= minus_num (OPTIMIZED OUT) */ - /* (346) carglist ::= carglist ccons */ - /* (347) carglist ::= */ - /* (348) ccons ::= NULL onconf */ - /* (349) ccons ::= GENERATED ALWAYS AS generated */ - /* (350) ccons ::= AS generated */ - /* (351) conslist_opt ::= COMMA conslist */ - /* (352) conslist ::= conslist tconscomma tcons */ - /* (353) conslist ::= tcons (OPTIMIZED OUT) */ - /* (354) tconscomma ::= */ - /* (355) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ - /* (356) resolvetype ::= raisetype (OPTIMIZED OUT) */ - /* (357) selectnowith ::= oneselect (OPTIMIZED OUT) */ - /* (358) oneselect ::= values */ - /* (359) sclp ::= selcollist COMMA */ - /* (360) as ::= ID|STRING */ - /* (361) expr ::= term (OPTIMIZED OUT) */ - /* (362) likeop ::= LIKE_KW|MATCH */ - /* (363) exprlist ::= nexprlist */ - /* (364) nmnum ::= plus_num (OPTIMIZED OUT) */ - /* (365) nmnum ::= nm (OPTIMIZED OUT) */ - /* (366) nmnum ::= ON */ - /* (367) nmnum ::= DELETE */ - /* (368) nmnum ::= DEFAULT */ - /* (369) plus_num ::= INTEGER|FLOAT */ - /* (370) foreach_clause ::= */ - /* (371) foreach_clause ::= FOR EACH ROW */ - /* (372) trnm ::= nm */ - /* (373) tridxby ::= */ - /* (374) database_kw_opt ::= DATABASE */ - /* (375) database_kw_opt ::= */ - /* (376) kwcolumn_opt ::= */ - /* (377) kwcolumn_opt ::= COLUMNKW */ - /* (378) vtabarglist ::= vtabarg */ - /* (379) vtabarglist ::= vtabarglist COMMA vtabarg */ - /* (380) vtabarg ::= vtabarg vtabargtoken */ - /* (381) anylist ::= */ - /* (382) anylist ::= anylist LP anylist RP */ - /* (383) anylist ::= anylist ANY */ - /* (384) with ::= */ + /* (337) input ::= cmdlist */ + /* (338) cmdlist ::= cmdlist ecmd */ + /* (339) cmdlist ::= ecmd (OPTIMIZED OUT) */ + /* (340) ecmd ::= SEMI */ + /* (341) ecmd ::= cmdx SEMI */ + /* (342) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ + /* (343) trans_opt ::= */ + /* (344) trans_opt ::= TRANSACTION */ + /* (345) trans_opt ::= TRANSACTION nm */ + /* (346) savepoint_opt ::= SAVEPOINT */ + /* (347) savepoint_opt ::= */ + /* (348) cmd ::= create_table create_table_args */ + /* (349) columnlist ::= columnlist COMMA columnname carglist */ + /* (350) columnlist ::= columnname carglist */ + /* (351) nm ::= ID|INDEXED */ + /* (352) nm ::= STRING */ + /* (353) nm ::= JOIN_KW */ + /* (354) typetoken ::= typename */ + /* (355) typename ::= ID|STRING */ + /* (356) signed ::= plus_num (OPTIMIZED OUT) */ + /* (357) signed ::= minus_num (OPTIMIZED OUT) */ + /* (358) carglist ::= carglist ccons */ + /* (359) carglist ::= */ + /* (360) ccons ::= NULL onconf */ + /* (361) ccons ::= GENERATED ALWAYS AS generated */ + /* (362) ccons ::= AS generated */ + /* (363) conslist_opt ::= COMMA conslist */ + /* (364) conslist ::= conslist tconscomma tcons */ + /* (365) conslist ::= tcons (OPTIMIZED OUT) */ + /* (366) tconscomma ::= */ + /* (367) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ + /* (368) resolvetype ::= raisetype (OPTIMIZED OUT) */ + /* (369) selectnowith ::= oneselect (OPTIMIZED OUT) */ + /* (370) oneselect ::= values */ + /* (371) sclp ::= selcollist COMMA */ + /* (372) as ::= ID|STRING */ + /* (373) returning ::= */ + /* (374) expr ::= term (OPTIMIZED OUT) */ + /* (375) likeop ::= LIKE_KW|MATCH */ + /* (376) exprlist ::= nexprlist */ + /* (377) nmnum ::= plus_num (OPTIMIZED OUT) */ + /* (378) nmnum ::= nm (OPTIMIZED OUT) */ + /* (379) nmnum ::= ON */ + /* (380) nmnum ::= DELETE */ + /* (381) nmnum ::= DEFAULT */ + /* (382) plus_num ::= INTEGER|FLOAT */ + /* (383) foreach_clause ::= */ + /* (384) foreach_clause ::= FOR EACH ROW */ + /* (385) trnm ::= nm */ + /* (386) tridxby ::= */ + /* (387) database_kw_opt ::= DATABASE */ + /* (388) database_kw_opt ::= */ + /* (389) kwcolumn_opt ::= */ + /* (390) kwcolumn_opt ::= COLUMNKW */ + /* (391) vtabarglist ::= vtabarg */ + /* (392) vtabarglist ::= vtabarglist COMMA vtabarg */ + /* (393) vtabarg ::= vtabarg vtabargtoken */ + /* (394) anylist ::= */ + /* (395) anylist ::= anylist LP anylist RP */ + /* (396) anylist ::= anylist ANY */ + /* (397) with ::= */ break //********* End reduce actions *********************************************** } @@ -139807,7 +142338,7 @@ func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead in // The following code executes when the parse fails // The following code executes when a syntax error first occurs. -func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:159012:13: */ +func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:161913:13: */ bp := tls.Alloc(24) defer tls.Free(24) *(*Token)(unsafe.Pointer(bp + 8)) = yyminor @@ -139817,9 +142348,9 @@ func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor To _ = yymajor // Silence some compiler warnings if *(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp + 8 /* &yyminor */)).Fz)) != 0 { - Xsqlite3ErrorMsg(tls, pParse, ts+24628 /* "near \"%T\": synta..." */, libc.VaList(bp, bp+8 /* &yyminor */)) + Xsqlite3ErrorMsg(tls, pParse, ts+25134 /* "near \"%T\": synta..." */, libc.VaList(bp, bp+8 /* &yyminor */)) } else { - Xsqlite3ErrorMsg(tls, pParse, ts+24916 /* "incomplete input" */, 0) + Xsqlite3ErrorMsg(tls, pParse, ts+25422 /* "incomplete input" */, 0) } //*********** End %syntax_error code ***************************************** @@ -139827,7 +142358,7 @@ func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor To } // The following is executed when the parser accepts -func yy_accept(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:159036:13: */ +func yy_accept(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:161937:13: */ var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse @@ -139857,7 +142388,7 @@ func yy_accept(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:159036:13: */ // // Outputs: // None. -func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:159077:21: */ +func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:161978:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -139869,12 +142400,22 @@ func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) { yyact = (*YyStackEntry)(unsafe.Pointer((*YyParser)(unsafe.Pointer(yypParser)).Fyytos)).Fstateno - for ok := true; ok; ok = ((*YyParser)(unsafe.Pointer(yypParser)).Fyytos > yypParser+16 /* &.yystack */) { + for 1 != 0 { // Exit by "break" yyact = yy_find_shift_action(tls, uint16(yymajor), yyact) if int32(yyact) >= YY_MIN_REDUCE { - yyact = yy_reduce(tls, yypParser, (uint32(int32(yyact) - YY_MIN_REDUCE)), yymajor, - yyminor, pParse) + var yyruleno uint32 = (uint32(int32(yyact) - YY_MIN_REDUCE)) // Reduce by this rule + + // Check that the stack is large enough to grow by a single entry + // if the RHS of the rule is empty. This ensures that there is room + // enough on the stack to push the LHS value + if int32(yyRuleInfoNRhs[yyruleno]) == 0 { + if (*YyParser)(unsafe.Pointer(yypParser)).Fyytos >= (*YyParser)(unsafe.Pointer(yypParser)).FyystackEnd { + yyStackOverflow(tls, yypParser) + break + } + } + yyact = yy_reduce(tls, yypParser, yyruleno, yymajor, yyminor, pParse) } else if int32(yyact) <= YY_MAX_SHIFTREDUCE { yy_shift(tls, yypParser, yyact, uint16(yymajor), yyminor) break @@ -139901,7 +142442,7 @@ func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) { // Return the fallback token corresponding to canonical token iToken, or // 0 if iToken has no fallback. -func Xsqlite3ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:159251:20: */ +func Xsqlite3ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:162196:20: */ return int32(yyFallback[iToken]) } @@ -139936,14 +142477,14 @@ func Xsqlite3ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:15 var aiClass = [256]uint8{ // x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf - /* 0x */ uint8(28), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(7), uint8(7), uint8(27), uint8(7), uint8(7), uint8(27), uint8(27), - /* 1x */ uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), + /* 0x */ uint8(29), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(7), uint8(7), uint8(28), uint8(7), uint8(7), uint8(28), uint8(28), + /* 1x */ uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), uint8(28), /* 2x */ uint8(7), uint8(15), uint8(8), uint8(5), uint8(4), uint8(22), uint8(24), uint8(8), uint8(17), uint8(18), uint8(21), uint8(20), uint8(23), uint8(11), uint8(26), uint8(16), /* 3x */ uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(5), uint8(19), uint8(12), uint8(14), uint8(13), uint8(6), /* 4x */ uint8(5), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), - /* 5x */ uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(1), uint8(1), uint8(9), uint8(27), uint8(27), uint8(27), uint8(1), + /* 5x */ uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(2), uint8(2), uint8(9), uint8(28), uint8(28), uint8(28), uint8(2), /* 6x */ uint8(8), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), - /* 7x */ uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(1), uint8(1), uint8(27), uint8(10), uint8(27), uint8(25), uint8(27), + /* 7x */ uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(2), uint8(2), uint8(28), uint8(10), uint8(28), uint8(25), uint8(28), /* 8x */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), /* 9x */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), /* Ax */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), @@ -139952,7 +142493,7 @@ var aiClass = [256]uint8{ /* Dx */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), /* Ex */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), /* Fx */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), -} /* sqlite3.c:159321:28 */ +} /* sqlite3.c:162267:28 */ // The charMap() macro maps alphabetic characters (only) into their // lower-case ASCII equivalent. On ASCII machines, this is just @@ -139986,20 +142527,21 @@ var aiClass = [256]uint8{ // 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: 227 -// zKWText[] encodes 984 bytes of keyword text in 648 bytes +// Hash score: 231 +// zKWText[] encodes 1007 bytes of keyword text in 667 bytes // REINDEXEDESCAPEACHECKEYBEFOREIGNOREGEXPLAINSTEADDATABASELECT // ABLEFTHENDEFERRABLELSEXCLUDELETEMPORARYISNULLSAVEPOINTERSECT // IESNOTNULLIKEXCEPTRANSACTIONATURALTERAISEXCLUSIVEXISTS // CONSTRAINTOFFSETRIGGERANGENERATEDETACHAVINGLOBEGINNEREFERENCES // UNIQUERYWITHOUTERELEASEATTACHBETWEENOTHINGROUPSCASCADEFAULT // CASECOLLATECREATECURRENT_DATEIMMEDIATEJOINSERTMATCHPLANALYZE -// PRAGMABORTUPDATEVALUESVIRTUALWAYSWHENWHERECURSIVEAFTERENAMEAND -// EFERREDISTINCTAUTOINCREMENTCASTCOLUMNCOMMITCONFLICTCROSS -// CURRENT_TIMESTAMPARTITIONDROPRECEDINGFAILASTFILTEREPLACEFIRST -// FOLLOWINGFROMFULLIMITIFORDERESTRICTOTHERSOVERIGHTROLLBACKROWS -// UNBOUNDEDUNIONUSINGVACUUMVIEWINDOWBYINITIALLYPRIMARY -var zKWText = [647]int8{ +// PRAGMATERIALIZEDEFERREDISTINCTUPDATEVALUESVIRTUALWAYSWHENWHERE +// CURSIVEABORTAFTERENAMEANDROPARTITIONAUTOINCREMENTCASTCOLUMN +// COMMITCONFLICTCROSSCURRENT_TIMESTAMPRECEDINGFAILASTFILTER +// EPLACEFIRSTFOLLOWINGFROMFULLIMITIFORDERESTRICTOTHERSOVER +// ETURNINGRIGHTROLLBACKROWSUNBOUNDEDUNIONUSINGVACUUMVIEWINDOWBY +// INITIALLYPRIMARY +var zKWText = [666]int8{ int8('R'), int8('E'), int8('I'), int8('N'), int8('D'), int8('E'), int8('X'), int8('E'), int8('D'), int8('E'), int8('S'), int8('C'), int8('A'), int8('P'), int8('E'), int8('A'), int8('C'), int8('H'), int8('E'), int8('C'), int8('K'), int8('E'), int8('Y'), int8('B'), int8('E'), int8('F'), int8('O'), int8('R'), int8('E'), int8('I'), int8('G'), int8('N'), int8('O'), int8('R'), int8('E'), int8('G'), int8('E'), int8('X'), int8('P'), int8('L'), int8('A'), int8('I'), int8('N'), int8('S'), int8('T'), int8('E'), int8('A'), int8('D'), int8('D'), int8('A'), int8('T'), int8('A'), int8('B'), int8('A'), @@ -140020,116 +142562,118 @@ var zKWText = [647]int8{ int8('C'), int8('R'), int8('E'), int8('A'), int8('T'), int8('E'), int8('C'), int8('U'), int8('R'), int8('R'), int8('E'), int8('N'), int8('T'), int8('_'), int8('D'), int8('A'), int8('T'), int8('E'), int8('I'), int8('M'), int8('M'), int8('E'), int8('D'), int8('I'), int8('A'), int8('T'), int8('E'), int8('J'), int8('O'), int8('I'), int8('N'), int8('S'), int8('E'), int8('R'), int8('T'), int8('M'), int8('A'), int8('T'), int8('C'), int8('H'), int8('P'), int8('L'), int8('A'), int8('N'), int8('A'), int8('L'), int8('Y'), int8('Z'), int8('E'), int8('P'), int8('R'), int8('A'), int8('G'), int8('M'), - int8('A'), int8('B'), int8('O'), int8('R'), int8('T'), int8('U'), int8('P'), int8('D'), int8('A'), int8('T'), int8('E'), int8('V'), int8('A'), int8('L'), int8('U'), int8('E'), int8('S'), int8('V'), - int8('I'), int8('R'), int8('T'), int8('U'), int8('A'), int8('L'), int8('W'), int8('A'), int8('Y'), int8('S'), int8('W'), int8('H'), int8('E'), int8('N'), int8('W'), int8('H'), int8('E'), int8('R'), - int8('E'), int8('C'), int8('U'), int8('R'), int8('S'), int8('I'), int8('V'), int8('E'), int8('A'), int8('F'), int8('T'), int8('E'), int8('R'), int8('E'), int8('N'), int8('A'), int8('M'), int8('E'), - int8('A'), int8('N'), int8('D'), int8('E'), int8('F'), int8('E'), int8('R'), int8('R'), int8('E'), int8('D'), int8('I'), int8('S'), int8('T'), int8('I'), int8('N'), int8('C'), int8('T'), int8('A'), - int8('U'), int8('T'), int8('O'), int8('I'), int8('N'), int8('C'), int8('R'), int8('E'), int8('M'), int8('E'), int8('N'), int8('T'), int8('C'), int8('A'), int8('S'), int8('T'), int8('C'), int8('O'), - int8('L'), int8('U'), int8('M'), int8('N'), int8('C'), int8('O'), int8('M'), int8('M'), int8('I'), int8('T'), int8('C'), int8('O'), int8('N'), int8('F'), int8('L'), int8('I'), int8('C'), int8('T'), - int8('C'), int8('R'), int8('O'), int8('S'), int8('S'), int8('C'), int8('U'), int8('R'), int8('R'), int8('E'), int8('N'), int8('T'), int8('_'), int8('T'), int8('I'), int8('M'), int8('E'), int8('S'), - int8('T'), int8('A'), int8('M'), int8('P'), int8('A'), int8('R'), int8('T'), int8('I'), int8('T'), int8('I'), int8('O'), int8('N'), int8('D'), int8('R'), int8('O'), int8('P'), int8('R'), int8('E'), - int8('C'), int8('E'), int8('D'), int8('I'), int8('N'), int8('G'), int8('F'), int8('A'), int8('I'), int8('L'), int8('A'), int8('S'), int8('T'), int8('F'), int8('I'), int8('L'), int8('T'), int8('E'), - int8('R'), int8('E'), int8('P'), int8('L'), int8('A'), int8('C'), int8('E'), int8('F'), int8('I'), int8('R'), int8('S'), int8('T'), int8('F'), int8('O'), int8('L'), int8('L'), int8('O'), int8('W'), - int8('I'), int8('N'), int8('G'), int8('F'), int8('R'), int8('O'), int8('M'), int8('F'), int8('U'), int8('L'), int8('L'), int8('I'), int8('M'), int8('I'), int8('T'), int8('I'), int8('F'), int8('O'), - int8('R'), int8('D'), int8('E'), int8('R'), int8('E'), int8('S'), int8('T'), int8('R'), int8('I'), int8('C'), int8('T'), int8('O'), int8('T'), int8('H'), int8('E'), int8('R'), int8('S'), int8('O'), - int8('V'), int8('E'), int8('R'), int8('I'), int8('G'), int8('H'), int8('T'), int8('R'), int8('O'), int8('L'), int8('L'), int8('B'), int8('A'), int8('C'), int8('K'), int8('R'), int8('O'), int8('W'), - int8('S'), int8('U'), int8('N'), int8('B'), int8('O'), int8('U'), int8('N'), int8('D'), int8('E'), int8('D'), int8('U'), int8('N'), int8('I'), int8('O'), int8('N'), int8('U'), int8('S'), int8('I'), - int8('N'), int8('G'), int8('V'), int8('A'), int8('C'), int8('U'), int8('U'), int8('M'), int8('V'), int8('I'), int8('E'), int8('W'), int8('I'), int8('N'), int8('D'), int8('O'), int8('W'), int8('B'), - int8('Y'), int8('I'), int8('N'), int8('I'), int8('T'), int8('I'), int8('A'), int8('L'), int8('L'), int8('Y'), int8('P'), int8('R'), int8('I'), int8('M'), int8('A'), int8('R'), int8('Y'), -} /* sqlite3.c:159436:19 */ + int8('A'), int8('T'), int8('E'), int8('R'), int8('I'), int8('A'), int8('L'), int8('I'), int8('Z'), int8('E'), int8('D'), int8('E'), int8('F'), int8('E'), int8('R'), int8('R'), int8('E'), int8('D'), + int8('I'), int8('S'), int8('T'), int8('I'), int8('N'), int8('C'), int8('T'), int8('U'), int8('P'), int8('D'), int8('A'), int8('T'), int8('E'), int8('V'), int8('A'), int8('L'), int8('U'), int8('E'), + int8('S'), int8('V'), int8('I'), int8('R'), int8('T'), int8('U'), int8('A'), int8('L'), int8('W'), int8('A'), int8('Y'), int8('S'), int8('W'), int8('H'), int8('E'), int8('N'), int8('W'), int8('H'), + int8('E'), int8('R'), int8('E'), int8('C'), int8('U'), int8('R'), int8('S'), int8('I'), int8('V'), int8('E'), int8('A'), int8('B'), int8('O'), int8('R'), int8('T'), int8('A'), int8('F'), int8('T'), + int8('E'), int8('R'), int8('E'), int8('N'), int8('A'), int8('M'), int8('E'), int8('A'), int8('N'), int8('D'), int8('R'), int8('O'), int8('P'), int8('A'), int8('R'), int8('T'), int8('I'), int8('T'), + int8('I'), int8('O'), int8('N'), int8('A'), int8('U'), int8('T'), int8('O'), int8('I'), int8('N'), int8('C'), int8('R'), int8('E'), int8('M'), int8('E'), int8('N'), int8('T'), int8('C'), int8('A'), + int8('S'), int8('T'), int8('C'), int8('O'), int8('L'), int8('U'), int8('M'), int8('N'), int8('C'), int8('O'), int8('M'), int8('M'), int8('I'), int8('T'), int8('C'), int8('O'), int8('N'), int8('F'), + int8('L'), int8('I'), int8('C'), int8('T'), int8('C'), int8('R'), int8('O'), int8('S'), int8('S'), int8('C'), int8('U'), int8('R'), int8('R'), int8('E'), int8('N'), int8('T'), int8('_'), int8('T'), + int8('I'), int8('M'), int8('E'), int8('S'), int8('T'), int8('A'), int8('M'), int8('P'), int8('R'), int8('E'), int8('C'), int8('E'), int8('D'), int8('I'), int8('N'), int8('G'), int8('F'), int8('A'), + int8('I'), int8('L'), int8('A'), int8('S'), int8('T'), int8('F'), int8('I'), int8('L'), int8('T'), int8('E'), int8('R'), int8('E'), int8('P'), int8('L'), int8('A'), int8('C'), int8('E'), int8('F'), + int8('I'), int8('R'), int8('S'), int8('T'), int8('F'), int8('O'), int8('L'), int8('L'), int8('O'), int8('W'), int8('I'), int8('N'), int8('G'), int8('F'), int8('R'), int8('O'), int8('M'), int8('F'), + int8('U'), int8('L'), int8('L'), int8('I'), int8('M'), int8('I'), int8('T'), int8('I'), int8('F'), int8('O'), int8('R'), int8('D'), int8('E'), int8('R'), int8('E'), int8('S'), int8('T'), int8('R'), + int8('I'), int8('C'), int8('T'), int8('O'), int8('T'), int8('H'), int8('E'), int8('R'), int8('S'), int8('O'), int8('V'), int8('E'), int8('R'), int8('E'), int8('T'), int8('U'), int8('R'), int8('N'), + int8('I'), int8('N'), int8('G'), int8('R'), int8('I'), int8('G'), int8('H'), int8('T'), int8('R'), int8('O'), int8('L'), int8('L'), int8('B'), int8('A'), int8('C'), int8('K'), int8('R'), int8('O'), + int8('W'), int8('S'), int8('U'), int8('N'), int8('B'), int8('O'), int8('U'), int8('N'), int8('D'), int8('E'), int8('D'), int8('U'), int8('N'), int8('I'), int8('O'), int8('N'), int8('U'), int8('S'), + int8('I'), int8('N'), int8('G'), int8('V'), int8('A'), int8('C'), int8('U'), int8('U'), int8('M'), int8('V'), int8('I'), int8('E'), int8('W'), int8('I'), int8('N'), int8('D'), int8('O'), int8('W'), + int8('B'), int8('Y'), int8('I'), int8('N'), int8('I'), int8('T'), int8('I'), int8('A'), int8('L'), int8('L'), int8('Y'), int8('P'), int8('R'), int8('I'), int8('M'), int8('A'), int8('R'), int8('Y'), +} /* sqlite3.c:162383:19 */ // aKWHash[i] is the hash value for the i-th keyword var aKWHash = [127]uint8{ - uint8(84), uint8(102), uint8(132), uint8(82), uint8(114), uint8(29), uint8(0), uint8(0), uint8(91), uint8(0), uint8(85), uint8(72), uint8(0), - uint8(53), uint8(35), uint8(86), uint8(15), uint8(0), uint8(42), uint8(94), uint8(54), uint8(126), uint8(133), uint8(19), uint8(0), uint8(0), - uint8(138), uint8(0), uint8(40), uint8(128), uint8(0), uint8(22), uint8(104), uint8(0), uint8(9), uint8(0), uint8(0), uint8(122), uint8(80), - uint8(0), uint8(78), uint8(6), uint8(0), uint8(65), uint8(99), uint8(145), uint8(0), uint8(134), uint8(112), uint8(0), uint8(0), uint8(48), - uint8(0), uint8(100), uint8(24), uint8(0), uint8(17), uint8(0), uint8(27), uint8(70), uint8(23), uint8(26), uint8(5), uint8(60), uint8(140), - uint8(107), uint8(121), uint8(0), uint8(73), uint8(101), uint8(71), uint8(143), uint8(61), uint8(119), uint8(74), uint8(0), uint8(49), uint8(0), - uint8(11), uint8(41), uint8(0), uint8(110), uint8(0), uint8(0), uint8(0), uint8(106), uint8(10), uint8(108), uint8(113), uint8(124), uint8(14), - uint8(50), uint8(123), uint8(0), uint8(89), uint8(0), uint8(18), uint8(120), uint8(142), uint8(56), uint8(129), uint8(137), uint8(88), uint8(83), - uint8(37), uint8(30), uint8(125), uint8(0), uint8(0), uint8(105), uint8(51), uint8(130), uint8(127), uint8(0), uint8(34), uint8(0), uint8(0), - uint8(44), uint8(0), uint8(95), uint8(38), uint8(39), uint8(0), uint8(20), uint8(45), uint8(116), uint8(90), -} /* sqlite3.c:159475:28 */ + uint8(84), uint8(92), uint8(134), uint8(82), uint8(105), uint8(29), uint8(0), uint8(0), uint8(94), uint8(0), uint8(85), uint8(72), uint8(0), + uint8(53), uint8(35), uint8(86), uint8(15), uint8(0), uint8(42), uint8(97), uint8(54), uint8(89), uint8(135), uint8(19), uint8(0), uint8(0), + uint8(140), uint8(0), uint8(40), uint8(129), uint8(0), uint8(22), uint8(107), uint8(0), uint8(9), uint8(0), uint8(0), uint8(123), uint8(80), + uint8(0), uint8(78), uint8(6), uint8(0), uint8(65), uint8(103), uint8(147), uint8(0), uint8(136), uint8(115), uint8(0), uint8(0), uint8(48), + uint8(0), uint8(90), uint8(24), uint8(0), uint8(17), uint8(0), uint8(27), uint8(70), uint8(23), uint8(26), uint8(5), uint8(60), uint8(142), + uint8(110), uint8(122), uint8(0), uint8(73), uint8(91), uint8(71), uint8(145), uint8(61), uint8(120), uint8(74), uint8(0), uint8(49), uint8(0), + uint8(11), uint8(41), uint8(0), uint8(113), uint8(0), uint8(0), uint8(0), uint8(109), uint8(10), uint8(111), uint8(116), uint8(125), uint8(14), + uint8(50), uint8(124), uint8(0), uint8(100), uint8(0), uint8(18), uint8(121), uint8(144), uint8(56), uint8(130), uint8(139), uint8(88), uint8(83), + uint8(37), uint8(30), uint8(126), uint8(0), uint8(0), uint8(108), uint8(51), uint8(131), uint8(128), uint8(0), uint8(34), uint8(0), uint8(0), + uint8(132), uint8(0), uint8(98), uint8(38), uint8(39), uint8(0), uint8(20), uint8(45), uint8(117), uint8(93), +} /* sqlite3.c:162423:28 */ // aKWNext[] forms the hash collision chain. If aKWHash[i]==0 // then the i-th keyword has no more hash collisions. Otherwise, // the next keyword with the same hash is aKWHash[i]-1. -var aKWNext = [145]uint8{ - uint8(0), uint8(0), uint8(0), uint8(0), uint8(4), uint8(0), uint8(43), uint8(0), uint8(0), uint8(103), uint8(111), uint8(0), uint8(0), - uint8(0), uint8(2), uint8(0), uint8(0), uint8(141), uint8(0), uint8(0), uint8(0), uint8(13), uint8(0), uint8(0), uint8(0), uint8(0), - uint8(139), uint8(0), uint8(0), uint8(118), uint8(52), uint8(0), uint8(0), uint8(135), uint8(12), uint8(0), uint8(0), uint8(62), uint8(0), - uint8(136), uint8(0), uint8(131), uint8(0), uint8(0), uint8(36), uint8(0), uint8(0), uint8(28), uint8(77), uint8(0), uint8(0), uint8(0), +var aKWNext = [147]uint8{ + uint8(0), uint8(0), uint8(0), uint8(0), uint8(4), uint8(0), uint8(43), uint8(0), uint8(0), uint8(106), uint8(114), uint8(0), uint8(0), + uint8(0), uint8(2), uint8(0), uint8(0), uint8(143), uint8(0), uint8(0), uint8(0), uint8(13), uint8(0), uint8(0), uint8(0), uint8(0), + uint8(141), uint8(0), uint8(0), uint8(119), uint8(52), uint8(0), uint8(0), uint8(137), uint8(12), uint8(0), uint8(0), uint8(62), uint8(0), + uint8(138), uint8(0), uint8(133), uint8(0), uint8(0), uint8(36), uint8(0), uint8(0), uint8(28), uint8(77), uint8(0), uint8(0), uint8(0), uint8(0), uint8(59), uint8(0), uint8(47), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), - uint8(0), uint8(69), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(144), uint8(3), uint8(0), uint8(58), uint8(0), uint8(1), - uint8(75), uint8(0), uint8(0), uint8(0), uint8(31), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(64), uint8(66), - uint8(63), uint8(0), uint8(0), uint8(0), uint8(0), uint8(46), uint8(0), uint8(16), uint8(0), uint8(115), uint8(0), uint8(0), uint8(0), - uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(81), uint8(97), uint8(0), uint8(8), uint8(0), uint8(109), - uint8(21), uint8(7), uint8(67), uint8(0), uint8(79), uint8(93), uint8(117), uint8(0), uint8(0), uint8(68), uint8(0), uint8(0), uint8(96), - uint8(0), uint8(55), uint8(0), uint8(76), uint8(0), uint8(92), uint8(32), uint8(33), uint8(57), uint8(25), uint8(0), uint8(98), uint8(0), - uint8(0), uint8(87), -} /* sqlite3.c:159490:28 */ + uint8(0), uint8(69), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(146), uint8(3), uint8(0), uint8(58), uint8(0), uint8(1), + uint8(75), uint8(0), uint8(0), uint8(0), uint8(31), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(127), uint8(0), uint8(104), + uint8(0), uint8(64), uint8(66), uint8(63), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(46), uint8(0), uint8(16), uint8(8), + uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(81), uint8(101), uint8(0), + uint8(112), uint8(21), uint8(7), uint8(67), uint8(0), uint8(79), uint8(96), uint8(118), uint8(0), uint8(0), uint8(68), uint8(0), uint8(0), + uint8(99), uint8(44), uint8(0), uint8(55), uint8(0), uint8(76), uint8(0), uint8(95), uint8(32), uint8(33), uint8(57), uint8(25), uint8(0), + uint8(102), uint8(0), uint8(0), uint8(87), +} /* sqlite3.c:162438:28 */ // aKWLen[i] is the length (in bytes) of the i-th keyword -var aKWLen = [145]uint8{ +var aKWLen = [147]uint8{ uint8(7), uint8(7), uint8(5), uint8(4), uint8(6), uint8(4), uint8(5), uint8(3), uint8(6), uint8(7), uint8(3), uint8(6), uint8(6), uint8(7), uint8(7), uint8(3), uint8(8), uint8(2), uint8(6), uint8(5), uint8(4), uint8(4), uint8(3), uint8(10), uint8(4), uint8(7), uint8(6), uint8(9), uint8(4), uint8(2), uint8(6), uint8(5), uint8(9), uint8(9), uint8(4), uint8(7), uint8(3), uint8(2), uint8(4), uint8(4), uint8(6), uint8(11), uint8(6), uint8(2), uint8(7), uint8(5), uint8(5), uint8(9), uint8(6), uint8(10), uint8(4), uint8(6), uint8(2), uint8(3), uint8(7), uint8(5), uint8(9), uint8(6), uint8(6), uint8(4), uint8(5), uint8(5), uint8(10), uint8(6), uint8(5), uint8(7), uint8(4), uint8(5), uint8(7), uint8(6), uint8(7), uint8(7), uint8(6), uint8(5), uint8(7), uint8(3), uint8(7), uint8(4), - uint8(7), uint8(6), uint8(12), uint8(9), uint8(4), uint8(6), uint8(5), uint8(4), uint8(7), uint8(6), uint8(5), uint8(6), uint8(6), - uint8(7), uint8(6), uint8(4), uint8(5), uint8(9), uint8(5), uint8(6), uint8(3), uint8(8), uint8(8), uint8(2), uint8(13), uint8(2), - uint8(2), uint8(4), uint8(6), uint8(6), uint8(8), uint8(5), uint8(17), uint8(12), uint8(7), uint8(9), uint8(4), uint8(9), uint8(4), - uint8(4), uint8(6), uint8(7), uint8(5), uint8(9), uint8(4), uint8(4), uint8(5), uint8(2), uint8(5), uint8(8), uint8(6), uint8(4), - uint8(5), uint8(8), uint8(4), uint8(3), uint8(9), uint8(5), uint8(5), uint8(6), uint8(4), uint8(6), uint8(2), uint8(2), uint8(9), - uint8(3), uint8(7), -} /* sqlite3.c:159505:28 */ + uint8(7), uint8(6), uint8(12), uint8(9), uint8(4), uint8(6), uint8(5), uint8(4), uint8(7), uint8(6), uint8(12), uint8(8), uint8(8), + uint8(2), uint8(6), uint8(6), uint8(7), uint8(6), uint8(4), uint8(5), uint8(9), uint8(5), uint8(5), uint8(6), uint8(3), uint8(4), + uint8(9), uint8(13), uint8(2), uint8(2), uint8(4), uint8(6), uint8(6), uint8(8), uint8(5), uint8(17), uint8(12), uint8(7), uint8(9), + uint8(4), uint8(4), uint8(6), uint8(7), uint8(5), uint8(9), uint8(4), uint8(4), uint8(5), uint8(2), uint8(5), uint8(8), uint8(6), + uint8(4), uint8(9), uint8(5), uint8(8), uint8(4), uint8(3), uint8(9), uint8(5), uint8(5), uint8(6), uint8(4), uint8(6), uint8(2), + uint8(2), uint8(9), uint8(3), uint8(7), +} /* sqlite3.c:162453:28 */ // aKWOffset[i] is the index into zKWText[] of the start of // the text for the i-th keyword. -var aKWOffset = [145]uint16{ +var aKWOffset = [147]uint16{ uint16(0), uint16(2), uint16(2), uint16(8), uint16(9), uint16(14), uint16(16), uint16(20), uint16(23), uint16(25), uint16(25), uint16(29), uint16(33), uint16(36), uint16(41), uint16(46), uint16(48), uint16(53), uint16(54), uint16(59), uint16(62), uint16(65), uint16(67), uint16(69), uint16(78), uint16(81), uint16(86), uint16(90), uint16(90), uint16(94), uint16(99), uint16(101), uint16(105), uint16(111), uint16(119), uint16(123), uint16(123), uint16(123), uint16(126), uint16(129), uint16(132), uint16(137), uint16(142), uint16(146), uint16(147), uint16(152), uint16(156), uint16(160), uint16(168), uint16(174), uint16(181), uint16(184), uint16(184), uint16(187), uint16(189), uint16(195), uint16(198), uint16(206), uint16(211), uint16(216), uint16(219), uint16(222), uint16(226), uint16(236), uint16(239), uint16(244), uint16(244), uint16(248), uint16(252), uint16(259), uint16(265), uint16(271), uint16(277), uint16(277), uint16(283), uint16(284), uint16(288), uint16(295), - uint16(299), uint16(306), uint16(312), uint16(324), uint16(333), uint16(335), uint16(341), uint16(346), uint16(348), uint16(355), uint16(360), uint16(365), uint16(371), - uint16(377), uint16(382), uint16(388), uint16(392), uint16(395), uint16(404), uint16(408), uint16(414), uint16(416), uint16(423), uint16(424), uint16(431), uint16(433), - uint16(435), uint16(444), uint16(448), uint16(454), uint16(460), uint16(468), uint16(473), uint16(473), uint16(473), uint16(489), uint16(498), uint16(501), uint16(510), - uint16(513), uint16(517), uint16(522), uint16(529), uint16(534), uint16(543), uint16(547), uint16(550), uint16(555), uint16(557), uint16(561), uint16(569), uint16(575), - uint16(578), uint16(583), uint16(591), uint16(591), uint16(595), uint16(604), uint16(609), uint16(614), uint16(620), uint16(623), uint16(626), uint16(629), uint16(631), - uint16(636), uint16(640), -} /* sqlite3.c:159521:33 */ + uint16(299), uint16(306), uint16(312), uint16(324), uint16(333), uint16(335), uint16(341), uint16(346), uint16(348), uint16(355), uint16(359), uint16(370), uint16(377), + uint16(378), uint16(385), uint16(391), uint16(397), uint16(402), uint16(408), uint16(412), uint16(415), uint16(424), uint16(429), uint16(433), uint16(439), uint16(441), + uint16(444), uint16(453), uint16(455), uint16(457), uint16(466), uint16(470), uint16(476), uint16(482), uint16(490), uint16(495), uint16(495), uint16(495), uint16(511), + uint16(520), uint16(523), uint16(527), uint16(532), uint16(539), uint16(544), uint16(553), uint16(557), uint16(560), uint16(565), uint16(567), uint16(571), uint16(579), + uint16(585), uint16(588), uint16(597), uint16(602), uint16(610), uint16(610), uint16(614), uint16(623), uint16(628), uint16(633), uint16(639), uint16(642), uint16(645), + uint16(648), uint16(650), uint16(655), uint16(659), +} /* sqlite3.c:162469:33 */ // aKWCode[i] is the parser symbol code for the i-th keyword -var aKWCode = [145]uint8{ - TK_REINDEX, TK_INDEXED, TK_INDEX, TK_DESC, TK_ESCAPE, - TK_EACH, TK_CHECK, TK_KEY, TK_BEFORE, TK_FOREIGN, - TK_FOR, TK_IGNORE, TK_LIKE_KW, TK_EXPLAIN, TK_INSTEAD, - TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, TK_TABLE, - TK_JOIN_KW, TK_THEN, TK_END, TK_DEFERRABLE, TK_ELSE, - TK_EXCLUDE, TK_DELETE, TK_TEMP, TK_TEMP, TK_OR, - TK_ISNULL, TK_NULLS, TK_SAVEPOINT, TK_INTERSECT, TK_TIES, - TK_NOTNULL, TK_NOT, TK_NO, TK_NULL, TK_LIKE_KW, - TK_EXCEPT, TK_TRANSACTION, TK_ACTION, TK_ON, TK_JOIN_KW, - TK_ALTER, TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_CONSTRAINT, - TK_INTO, TK_OFFSET, TK_OF, TK_SET, TK_TRIGGER, - TK_RANGE, TK_GENERATED, TK_DETACH, TK_HAVING, TK_LIKE_KW, - TK_BEGIN, TK_JOIN_KW, TK_REFERENCES, TK_UNIQUE, TK_QUERY, - TK_WITHOUT, TK_WITH, TK_JOIN_KW, TK_RELEASE, TK_ATTACH, - TK_BETWEEN, TK_NOTHING, TK_GROUPS, TK_GROUP, TK_CASCADE, - TK_ASC, TK_DEFAULT, TK_CASE, TK_COLLATE, TK_CREATE, - TK_CTIME_KW, TK_IMMEDIATE, TK_JOIN, TK_INSERT, TK_MATCH, - TK_PLAN, TK_ANALYZE, TK_PRAGMA, TK_ABORT, TK_UPDATE, - TK_VALUES, TK_VIRTUAL, TK_ALWAYS, TK_WHEN, TK_WHERE, - TK_RECURSIVE, TK_AFTER, TK_RENAME, TK_AND, TK_DEFERRED, - TK_DISTINCT, TK_IS, TK_AUTOINCR, TK_TO, TK_IN, - TK_CAST, TK_COLUMNKW, TK_COMMIT, TK_CONFLICT, TK_JOIN_KW, - TK_CTIME_KW, TK_CTIME_KW, TK_CURRENT, TK_PARTITION, TK_DROP, - TK_PRECEDING, TK_FAIL, TK_LAST, TK_FILTER, TK_REPLACE, - TK_FIRST, TK_FOLLOWING, TK_FROM, TK_JOIN_KW, TK_LIMIT, - TK_IF, TK_ORDER, TK_RESTRICT, TK_OTHERS, TK_OVER, - TK_JOIN_KW, TK_ROLLBACK, TK_ROWS, TK_ROW, TK_UNBOUNDED, - TK_UNION, TK_USING, TK_VACUUM, TK_VIEW, TK_WINDOW, - TK_DO, TK_BY, TK_INITIALLY, TK_ALL, TK_PRIMARY, -} /* sqlite3.c:159536:28 */ +var aKWCode = [147]uint8{ + uint8(TK_REINDEX), uint8(TK_INDEXED), uint8(TK_INDEX), uint8(TK_DESC), uint8(TK_ESCAPE), + uint8(TK_EACH), uint8(TK_CHECK), uint8(TK_KEY), uint8(TK_BEFORE), uint8(TK_FOREIGN), + uint8(TK_FOR), uint8(TK_IGNORE), uint8(TK_LIKE_KW), uint8(TK_EXPLAIN), uint8(TK_INSTEAD), + uint8(TK_ADD), uint8(TK_DATABASE), uint8(TK_AS), uint8(TK_SELECT), uint8(TK_TABLE), + uint8(TK_JOIN_KW), uint8(TK_THEN), uint8(TK_END), uint8(TK_DEFERRABLE), uint8(TK_ELSE), + uint8(TK_EXCLUDE), uint8(TK_DELETE), uint8(TK_TEMP), uint8(TK_TEMP), uint8(TK_OR), + uint8(TK_ISNULL), uint8(TK_NULLS), uint8(TK_SAVEPOINT), uint8(TK_INTERSECT), uint8(TK_TIES), + uint8(TK_NOTNULL), uint8(TK_NOT), uint8(TK_NO), uint8(TK_NULL), uint8(TK_LIKE_KW), + uint8(TK_EXCEPT), uint8(TK_TRANSACTION), uint8(TK_ACTION), uint8(TK_ON), uint8(TK_JOIN_KW), + uint8(TK_ALTER), uint8(TK_RAISE), uint8(TK_EXCLUSIVE), uint8(TK_EXISTS), uint8(TK_CONSTRAINT), + uint8(TK_INTO), uint8(TK_OFFSET), uint8(TK_OF), uint8(TK_SET), uint8(TK_TRIGGER), + uint8(TK_RANGE), uint8(TK_GENERATED), uint8(TK_DETACH), uint8(TK_HAVING), uint8(TK_LIKE_KW), + uint8(TK_BEGIN), uint8(TK_JOIN_KW), uint8(TK_REFERENCES), uint8(TK_UNIQUE), uint8(TK_QUERY), + uint8(TK_WITHOUT), uint8(TK_WITH), uint8(TK_JOIN_KW), uint8(TK_RELEASE), uint8(TK_ATTACH), + uint8(TK_BETWEEN), uint8(TK_NOTHING), uint8(TK_GROUPS), uint8(TK_GROUP), uint8(TK_CASCADE), + uint8(TK_ASC), uint8(TK_DEFAULT), uint8(TK_CASE), uint8(TK_COLLATE), uint8(TK_CREATE), + uint8(TK_CTIME_KW), uint8(TK_IMMEDIATE), uint8(TK_JOIN), uint8(TK_INSERT), uint8(TK_MATCH), + uint8(TK_PLAN), uint8(TK_ANALYZE), uint8(TK_PRAGMA), uint8(TK_MATERIALIZED), uint8(TK_DEFERRED), + uint8(TK_DISTINCT), uint8(TK_IS), uint8(TK_UPDATE), uint8(TK_VALUES), uint8(TK_VIRTUAL), + uint8(TK_ALWAYS), uint8(TK_WHEN), uint8(TK_WHERE), uint8(TK_RECURSIVE), uint8(TK_ABORT), + uint8(TK_AFTER), uint8(TK_RENAME), uint8(TK_AND), uint8(TK_DROP), uint8(TK_PARTITION), + uint8(TK_AUTOINCR), uint8(TK_TO), uint8(TK_IN), uint8(TK_CAST), uint8(TK_COLUMNKW), + uint8(TK_COMMIT), uint8(TK_CONFLICT), uint8(TK_JOIN_KW), uint8(TK_CTIME_KW), uint8(TK_CTIME_KW), + uint8(TK_CURRENT), uint8(TK_PRECEDING), uint8(TK_FAIL), uint8(TK_LAST), uint8(TK_FILTER), + uint8(TK_REPLACE), uint8(TK_FIRST), uint8(TK_FOLLOWING), uint8(TK_FROM), uint8(TK_JOIN_KW), + uint8(TK_LIMIT), uint8(TK_IF), uint8(TK_ORDER), uint8(TK_RESTRICT), uint8(TK_OTHERS), + uint8(TK_OVER), uint8(TK_RETURNING), uint8(TK_JOIN_KW), uint8(TK_ROLLBACK), uint8(TK_ROWS), + uint8(TK_ROW), uint8(TK_UNBOUNDED), uint8(TK_UNION), uint8(TK_USING), uint8(TK_VACUUM), + uint8(TK_VIEW), uint8(TK_WINDOW), uint8(TK_DO), uint8(TK_BY), uint8(TK_INITIALLY), + uint8(TK_ALL), uint8(TK_PRIMARY), +} /* sqlite3.c:162484:28 */ // Hash table decoded: // 0: INSERT @@ -140153,7 +142697,7 @@ var aKWCode = [145]uint8{ // 18: TRANSACTION RIGHT // 19: WHEN // 20: SET HAVING -// 21: IF +// 21: MATERIALIZED IF // 22: ROWS // 23: SELECT // 24: @@ -140249,7 +142793,7 @@ var aKWCode = [145]uint8{ // 114: INTERSECT UNBOUNDED // 115: // 116: -// 117: ON +// 117: RETURNING ON // 118: // 119: WHERE // 120: NO INNER @@ -140262,12 +142806,12 @@ var aKWCode = [145]uint8{ // Check to see if z[0..n-1] is a keyword. If it is, write the // parser symbol code for that keyword into *pType. Always // return the integer n (the length of the token). -func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sqlite3.c:159699:12: */ +func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sqlite3.c:162648:12: */ var i int32 var j int32 var zKW uintptr if n >= 2 { - i = ((((int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z)))]) * 4) ^ (int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z + uintptr((n - 1)))))]) * 3)) ^ n) % 127) + i = ((((int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z)))]) * 4) ^ (int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z + uintptr((n - 1)))))]) * 3)) ^ (n * 1)) % 127) for i = ((int32(aKWHash[i])) - 1); i >= 0; i = ((int32(aKWNext[i])) - 1) { if int32(aKWLen[i]) != n { continue @@ -140374,7 +142918,10 @@ func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sq // PLAN // ANALYZE // PRAGMA - // ABORT + // MATERIALIZED + // DEFERRED + // DISTINCT + // IS // UPDATE // VALUES // VIRTUAL @@ -140382,12 +142929,12 @@ func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sq // WHEN // WHERE // RECURSIVE + // ABORT // AFTER // RENAME // AND - // DEFERRED - // DISTINCT - // IS + // DROP + // PARTITION // AUTOINCREMENT // TO // IN @@ -140399,8 +142946,6 @@ func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sq // CURRENT_TIMESTAMP // CURRENT_TIME // CURRENT - // PARTITION - // DROP // PRECEDING // FAIL // LAST @@ -140416,6 +142961,7 @@ func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sq // RESTRICT // OTHERS // OVER + // RETURNING // RIGHT // ROLLBACK // ROWS @@ -140438,7 +142984,7 @@ func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sq return n } -func Xsqlite3KeywordCode(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:159871:20: */ +func Xsqlite3KeywordCode(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:162822:20: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -140447,7 +142993,7 @@ func Xsqlite3KeywordCode(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c return *(*int32)(unsafe.Pointer(bp /* id */)) } -func Xsqlite3_keyword_name(tls *libc.TLS, i int32, pzName uintptr, pnName uintptr) int32 { /* sqlite3.c:159877:16: */ +func Xsqlite3_keyword_name(tls *libc.TLS, i int32, pzName uintptr, pnName uintptr) int32 { /* sqlite3.c:162828:16: */ if (i < 0) || (i >= SQLITE_N_KEYWORD) { return SQLITE_ERROR } @@ -140456,11 +143002,11 @@ func Xsqlite3_keyword_name(tls *libc.TLS, i int32, pzName uintptr, pnName uintpt return SQLITE_OK } -func Xsqlite3_keyword_count(tls *libc.TLS) int32 { /* sqlite3.c:159883:16: */ +func Xsqlite3_keyword_count(tls *libc.TLS) int32 { /* sqlite3.c:162834:16: */ return SQLITE_N_KEYWORD } -func Xsqlite3_keyword_check(tls *libc.TLS, zName uintptr, nName int32) int32 { /* sqlite3.c:159884:16: */ +func Xsqlite3_keyword_check(tls *libc.TLS, zName uintptr, nName int32) int32 { /* sqlite3.c:162835:16: */ return (libc.Bool32(TK_ID != Xsqlite3KeywordCode(tls, zName, nName))) } @@ -140483,13 +143029,13 @@ func Xsqlite3_keyword_check(tls *libc.TLS, zName uintptr, nName int32) int32 { / // But the feature is undocumented. // Make the IdChar function accessible from ctime.c and alter.c -func Xsqlite3IsIdChar(tls *libc.TLS, c U8) int32 { /* sqlite3.c:159931:20: */ +func Xsqlite3IsIdChar(tls *libc.TLS, c U8) int32 { /* sqlite3.c:162882:20: */ return (libc.Bool32((int32(Xsqlite3CtypeMap[c]) & 0x46) != 0)) } // Return the id of the next token in string (*pz). Before returning, set // (*pz) to point to the byte following the parsed token. -func getToken(tls *libc.TLS, pz uintptr) int32 { /* sqlite3.c:159938:12: */ +func getToken(tls *libc.TLS, pz uintptr) int32 { /* sqlite3.c:162889:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -140539,7 +143085,7 @@ func getToken(tls *libc.TLS, pz uintptr) int32 { /* sqlite3.c:159938:12: */ // // * the previous token was TK_RP, and // * the next token is TK_LP. -func analyzeWindowKeyword(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:159987:12: */ +func analyzeWindowKeyword(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:162938:12: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = z @@ -140556,7 +143102,7 @@ func analyzeWindowKeyword(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:159987: return TK_WINDOW } -func analyzeOverKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:159995:12: */ +func analyzeOverKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:162946:12: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = z @@ -140570,7 +143116,7 @@ func analyzeOverKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sq return TK_ID } -func analyzeFilterKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:160002:12: */ +func analyzeFilterKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:162953:12: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = z @@ -140583,7 +143129,7 @@ func analyzeFilterKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* // Return the length (in bytes) of the token that begins at z[0]. // Store the token type in *tokenType before returning. -func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sqlite3.c:160014:20: */ +func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sqlite3.c:162965:20: */ var i int32 var c int32 switch int32(aiClass[*(*uint8)(unsafe.Pointer(z))]) { // Switch on the character-class of the first byte @@ -140867,7 +143413,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq return i } - case CC_KYWD: + case CC_KYWD0: { for i = 1; int32(aiClass[*(*uint8)(unsafe.Pointer(z + uintptr(i)))]) <= CC_KYWD; i++ { } @@ -140903,6 +143449,8 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq } fallthrough + case CC_KYWD: + fallthrough case CC_ID: { i = 1 @@ -140934,7 +143482,7 @@ func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sq // 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 Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:160300:20: */ +func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:163252:20: */ bp := tls.Alloc(2468) defer tls.Free(2468) @@ -140949,9 +143497,9 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin // var sEngine YyParser at bp+40, 2424 // Space to hold the Lemon-generated Parser object - mxSqlLen = *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 1*4)) + mxSqlLen = *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 1*4)) if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 { - libc.AtomicStoreNInt32((db + 392 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) + libc.AtomicStoreNInt32((db + 400 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) } (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_OK (*Parse)(unsafe.Pointer(pParse)).FzTail = zSql @@ -140970,7 +143518,7 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin } if *(*int32)(unsafe.Pointer(bp + 2464 /* tokenType */)) >= TK_WINDOW { - if libc.AtomicLoadNInt32((db+392 /* &.u1 */ /* &.isInterrupted */), 0) != 0 { + if libc.AtomicLoadNInt32((db+400 /* &.u1 */ /* &.isInterrupted */), 0) != 0 { (*Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_INTERRUPT break } @@ -140999,7 +143547,7 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin *(*int32)(unsafe.Pointer(bp + 2464 /* tokenType */)) = analyzeFilterKeyword(tls, (zSql + 6), lastTokenParsed) } else { - Xsqlite3ErrorMsg(tls, pParse, ts+24933 /* "unrecognized tok..." */, libc.VaList(bp, n, zSql)) + Xsqlite3ErrorMsg(tls, pParse, ts+25439 /* "unrecognized tok..." */, libc.VaList(bp, n, zSql)) break } } @@ -141024,7 +143572,7 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin if (*Parse)(unsafe.Pointer(pParse)).FzErrMsg != 0 { *(*uintptr)(unsafe.Pointer(pzErrMsg)) = (*Parse)(unsafe.Pointer(pParse)).FzErrMsg - Xsqlite3_log(tls, (*Parse)(unsafe.Pointer(pParse)).Frc, ts+24960, /* "%s in \"%s\"" */ + Xsqlite3_log(tls, (*Parse)(unsafe.Pointer(pParse)).Frc, ts+25466, /* "%s in \"%s\"" */ libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(pzErrMsg)), (*Parse)(unsafe.Pointer(pParse)).FzTail)) (*Parse)(unsafe.Pointer(pParse)).FzErrMsg = uintptr(0) nErr++ @@ -141050,21 +143598,7 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= PARSE_MODE_RENAME) { Xsqlite3DeleteTrigger(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpNewTrigger) } - - if (*Parse)(unsafe.Pointer(pParse)).FpWithToFree != 0 { - Xsqlite3WithDelete(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpWithToFree) - } Xsqlite3DbFree(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpVList) - for (*Parse)(unsafe.Pointer(pParse)).FpAinc != 0 { - var p uintptr = (*Parse)(unsafe.Pointer(pParse)).FpAinc - (*Parse)(unsafe.Pointer(pParse)).FpAinc = (*AutoincInfo)(unsafe.Pointer(p)).FpNext - Xsqlite3DbFreeNN(tls, db, p) - } - for (*Parse)(unsafe.Pointer(pParse)).FpZombieTab != 0 { - var p uintptr = (*Parse)(unsafe.Pointer(pParse)).FpZombieTab - (*Parse)(unsafe.Pointer(pParse)).FpZombieTab = (*Table)(unsafe.Pointer(p)).FpNextZombie - Xsqlite3DeleteTable(tls, db, p) - } (*Sqlite3)(unsafe.Pointer(db)).FpParse = (*Parse)(unsafe.Pointer(pParse)).FpParentParse (*Parse)(unsafe.Pointer(pParse)).FpParentParse = uintptr(0) @@ -141147,7 +143681,7 @@ func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uin // 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 *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716:16: */ +func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:163656:16: */ var state U8 = U8(0) // Current state, using numbers defined in header comment var token U8 @@ -141155,7 +143689,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: switch int32(*(*int8)(unsafe.Pointer(zSql))) { case ';': { // A semicolon - token = TkSEMI + token = U8(TkSEMI) break } @@ -141169,14 +143703,14 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough case '\f': { // White space is ignored - token = TkWS + token = U8(TkWS) break } case '/': { // C-style comments if int32(*(*int8)(unsafe.Pointer(zSql + 1))) != '*' { - token = TkOTHER + token = U8(TkOTHER) break } zSql += uintptr(2) @@ -141187,14 +143721,14 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: return 0 } zSql++ - token = TkWS + token = U8(TkWS) break } case '-': { // SQL-style comments from "--" to end of line if int32(*(*int8)(unsafe.Pointer(zSql + 1))) != '-' { - token = TkOTHER + token = U8(TkOTHER) break } for (*(*int8)(unsafe.Pointer(zSql)) != 0) && (int32(*(*int8)(unsafe.Pointer(zSql))) != '\n') { @@ -141203,7 +143737,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { return (libc.Bool32(int32(state) == 1)) } - token = TkWS + token = U8(TkWS) break } @@ -141216,7 +143750,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { return 0 } - token = TkOTHER + token = U8(TkOTHER) break } @@ -141234,7 +143768,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 { return 0 } - token = TkOTHER + token = U8(TkOTHER) break } @@ -141250,10 +143784,10 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough case 'C': { - if (nId == 6) && (Xsqlite3_strnicmp(tls, zSql, ts+24971 /* "create" */, 6) == 0) { - token = TkCREATE + if (nId == 6) && (Xsqlite3_strnicmp(tls, zSql, ts+25477 /* "create" */, 6) == 0) { + token = U8(TkCREATE) } else { - token = TkOTHER + token = U8(TkOTHER) } break @@ -141263,14 +143797,14 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough case 'T': { - if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+21445 /* "trigger" */, 7) == 0) { - token = TkTRIGGER - } else if (nId == 4) && (Xsqlite3_strnicmp(tls, zSql, ts+24978 /* "temp" */, 4) == 0) { - token = TkTEMP - } else if (nId == 9) && (Xsqlite3_strnicmp(tls, zSql, ts+24983 /* "temporary" */, 9) == 0) { - token = TkTEMP + if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+21861 /* "trigger" */, 7) == 0) { + token = U8(TkTRIGGER) + } else if (nId == 4) && (Xsqlite3_strnicmp(tls, zSql, ts+25484 /* "temp" */, 4) == 0) { + token = U8(TkTEMP) + } else if (nId == 9) && (Xsqlite3_strnicmp(tls, zSql, ts+25489 /* "temporary" */, 9) == 0) { + token = U8(TkTEMP) } else { - token = TkOTHER + token = U8(TkOTHER) } break @@ -141280,12 +143814,12 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough case 'E': { - if (nId == 3) && (Xsqlite3_strnicmp(tls, zSql, ts+24993 /* "end" */, 3) == 0) { - token = TkEND - } else if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+24997 /* "explain" */, 7) == 0) { - token = TkEXPLAIN + if (nId == 3) && (Xsqlite3_strnicmp(tls, zSql, ts+25499 /* "end" */, 3) == 0) { + token = U8(TkEND) + } else if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+25503 /* "explain" */, 7) == 0) { + token = U8(TkEXPLAIN) } else { - token = TkOTHER + token = U8(TkOTHER) } break @@ -141293,7 +143827,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: fallthrough default: { - token = TkOTHER + token = U8(TkOTHER) break } @@ -141301,7 +143835,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716: zSql += (uintptr(nId - 1)) } else { // Operators and special symbols - token = TkOTHER + token = U8(TkOTHER) } break @@ -141324,12 +143858,12 @@ var trans = [8][8]U8{ /* 5 TRIGGER: */ {U8(6), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5)}, /* 6 SEMI: */ {U8(6), U8(6), U8(5), U8(5), U8(5), U8(5), U8(5), U8(7)}, /* 7 END: */ {U8(1), U8(7), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5)}, -} /* sqlite3.c:160724:19 */ +} /* sqlite3.c:163664:19 */ // 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 *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160881:16: */ +func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:163821:16: */ var pVal uintptr var zSql8 uintptr var rc int32 @@ -141339,8 +143873,8 @@ func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:16088 return rc } pVal = Xsqlite3ValueNew(tls, uintptr(0)) - Xsqlite3ValueSetStr(tls, pVal, -1, zSql, SQLITE_UTF16LE, uintptr(0)) - zSql8 = Xsqlite3ValueText(tls, pVal, SQLITE_UTF8) + Xsqlite3ValueSetStr(tls, pVal, -1, zSql, uint8(SQLITE_UTF16LE), uintptr(0)) + zSql8 = Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) if zSql8 != 0 { rc = Xsqlite3_complete(tls, zSql8) } else { @@ -141356,7 +143890,7 @@ func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:16088 // This is an extension initializer that is a no-op and always // succeeds, except that it fails if the fault-simulation is set // to 500. -func sqlite3TestExtInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:161033:12: */ +func sqlite3TestExtInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163973:12: */ _ = db return Xsqlite3FaultSim(tls, 500) } @@ -141372,11 +143906,11 @@ var sqlite3BuiltinExtensions = [8]uintptr{ 0, 0, 0, -} /* sqlite3.c:161063:12 */ +} /* sqlite3.c:164003:12 */ // IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns // a pointer to the to the sqlite3_version[] string constant. -func Xsqlite3_libversion(tls *libc.TLS) uintptr { /* sqlite3.c:161110:23: */ +func Xsqlite3_libversion(tls *libc.TLS) uintptr { /* sqlite3.c:164050:23: */ return uintptr(unsafe.Pointer(&Xsqlite3_version)) } @@ -141389,35 +143923,35 @@ func Xsqlite3_libversion(tls *libc.TLS) uintptr { /* sqlite3.c:161110:23: */ // IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function // returns an integer equal to SQLITE_VERSION_NUMBER. -func Xsqlite3_libversion_number(tls *libc.TLS) int32 { /* sqlite3.c:161123:16: */ +func Xsqlite3_libversion_number(tls *libc.TLS) int32 { /* sqlite3.c:164063:16: */ return SQLITE_VERSION_NUMBER } // 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 *libc.TLS) int32 { /* sqlite3.c:161129:16: */ +func Xsqlite3_threadsafe(tls *libc.TLS) int32 { /* sqlite3.c:164069:16: */ return SQLITE_THREADSAFE } // When compiling the test fixture or with debugging enabled (on Win32), // this variable being set to non-zero will cause OSTRACE macros to emit // extra diagnostic information. -var Xsqlite3OSTrace int32 = SQLITE_DEBUG_OS_TRACE /* sqlite3.c:161140:7 */ +var Xsqlite3OSTrace int32 = SQLITE_DEBUG_OS_TRACE /* sqlite3.c:164080:7 */ // If the following global variable points to a string which is the // name of a directory, then that directory will be used to store // temporary files. // // See also the "PRAGMA temp_store_directory" SQL command. -var Xsqlite3_temp_directory uintptr = uintptr(0) /* sqlite3.c:161160:17 */ +var Xsqlite3_temp_directory uintptr = uintptr(0) /* sqlite3.c:164100:17 */ // If the following global variable points to a string which is the // name of a directory, then that directory will be used to store // all database files specified with a relative pathname. // // See also the "PRAGMA data_store_directory" SQL command. -var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:161169:17 */ +var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:164109:17 */ // Initialize SQLite. // @@ -141448,7 +143982,7 @@ var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:161169:17 */ // // * Recursive calls to this routine from thread X return immediately // without blocking. -func Xsqlite3_initialize(tls *libc.TLS) int32 { /* sqlite3.c:161202:16: */ +func Xsqlite3_initialize(tls *libc.TLS) int32 { /* sqlite3.c:164142:16: */ var pMainMtx uintptr // The main static mutex var rc int32 // Result code @@ -141574,7 +144108,7 @@ func Xsqlite3_initialize(tls *libc.TLS) int32 { /* sqlite3.c:161202:16: */ // routine is not threadsafe. But it is safe to invoke this routine // on when SQLite is already shut down. If SQLite is already shut down // when this routine is invoked, then this routine is a harmless no-op. -func Xsqlite3_shutdown(tls *libc.TLS) int32 { /* sqlite3.c:161377:16: */ +func Xsqlite3_shutdown(tls *libc.TLS) int32 { /* sqlite3.c:164317:16: */ if Xsqlite3Config.FisInit != 0 { Xsqlite3_os_end(tls) @@ -141613,7 +144147,7 @@ func Xsqlite3_shutdown(tls *libc.TLS) int32 { /* sqlite3.c:161377:16: */ // database connections or memory allocations. This routine is not // threadsafe. Failure to heed these warnings can lead to unpredictable // behavior. -func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:161431:16: */ +func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:164371:16: */ var ap Va_list _ = ap var rc int32 = SQLITE_OK @@ -141621,7 +144155,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:1 // sqlite3_config() shall return SQLITE_MISUSE if it is invoked while // the SQLite library is in use. if Xsqlite3Config.FisInit != 0 { - return Xsqlite3MisuseError(tls, 161437) + return Xsqlite3MisuseError(tls, 164377) } ap = va @@ -141835,11 +144369,11 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:1 // silently truncated if necessary so that it does not exceed the // compile-time maximum mmap size set by the SQLITE_MAX_MMAP_SIZE // compile-time option. - if (mxMmap < int64(0)) || (mxMmap > SQLITE_MAX_MMAP_SIZE) { - mxMmap = SQLITE_MAX_MMAP_SIZE + if (mxMmap < int64(0)) || (mxMmap > int64(SQLITE_MAX_MMAP_SIZE)) { + mxMmap = int64(SQLITE_MAX_MMAP_SIZE) } if szMmap < int64(0) { - szMmap = SQLITE_DEFAULT_MMAP_SIZE + szMmap = int64(SQLITE_DEFAULT_MMAP_SIZE) } if szMmap > mxMmap { szMmap = mxMmap @@ -141891,7 +144425,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:1 // 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 *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32) int32 { /* sqlite3.c:161749:12: */ +func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32) int32 { /* sqlite3.c:164689:12: */ var pStart uintptr var szAlloc Sqlite3_int64 = (Sqlite3_int64(sz) * Sqlite3_int64(cnt)) var nBig int32 // Number of full-size slots @@ -141930,10 +144464,10 @@ func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32 } if sz >= (LOOKASIDE_SMALL * 3) { nBig = (int32(szAlloc / (Sqlite3_int64((3 * LOOKASIDE_SMALL) + sz)))) - nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / LOOKASIDE_SMALL)) + nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / int64(LOOKASIDE_SMALL))) } else if sz >= (LOOKASIDE_SMALL * 2) { nBig = (int32(szAlloc / (Sqlite3_int64(LOOKASIDE_SMALL + sz)))) - nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / LOOKASIDE_SMALL)) + nSm = (int32((szAlloc - (Sqlite3_int64(sz * nBig))) / int64(LOOKASIDE_SMALL))) } else if sz > 0 { nBig = (int32(szAlloc / Sqlite3_int64(sz))) nSm = 0 @@ -141989,13 +144523,13 @@ func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32 } // Return the mutex associated with a database connection. -func Xsqlite3_db_mutex(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:161849:26: */ +func Xsqlite3_db_mutex(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:164789:26: */ return (*Sqlite3)(unsafe.Pointer(db)).Fmutex } // Free up as much memory as we can from the given database // connection. -func Xsqlite3_db_release_memory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:161863:16: */ +func Xsqlite3_db_release_memory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:164803:16: */ var i int32 Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -142014,7 +144548,7 @@ func Xsqlite3_db_release_memory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c: // Flush any dirty pages in the pager-cache for any attached database // to disk. -func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:161887:16: */ +func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:164827:16: */ var i int32 var rc int32 = SQLITE_OK var bSeenBusy int32 = 0 @@ -142023,7 +144557,7 @@ func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:1618 Xsqlite3BtreeEnterAll(tls, db) for i = 0; (rc == SQLITE_OK) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb); i++ { var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt - if (pBt != 0) && (Xsqlite3BtreeIsInTrans(tls, pBt) != 0) { + if (pBt != 0) && (Xsqlite3BtreeTxnState(tls, pBt) == SQLITE_TXN_WRITE) { var pPager uintptr = Xsqlite3BtreePager(tls, pBt) rc = Xsqlite3PagerFlush(tls, pPager) if rc == SQLITE_BUSY { @@ -142043,7 +144577,7 @@ func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:1618 } // Configuration settings for an individual database connection -func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:161916:16: */ +func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:164856:16: */ var ap Va_list _ = ap var rc int32 @@ -142106,27 +144640,27 @@ var aFlagOp = [16]struct { Fop int32 Fmask U32 }{ - {Fop: SQLITE_DBCONFIG_ENABLE_FKEY, Fmask: SQLITE_ForeignKeys}, - {Fop: SQLITE_DBCONFIG_ENABLE_TRIGGER, Fmask: SQLITE_EnableTrigger}, + {Fop: SQLITE_DBCONFIG_ENABLE_FKEY, Fmask: U32(SQLITE_ForeignKeys)}, + {Fop: SQLITE_DBCONFIG_ENABLE_TRIGGER, Fmask: U32(SQLITE_EnableTrigger)}, {Fop: SQLITE_DBCONFIG_ENABLE_VIEW, Fmask: SQLITE_EnableView}, - {Fop: SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, Fmask: SQLITE_Fts3Tokenizer}, - {Fop: SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, Fmask: SQLITE_LoadExtension}, - {Fop: SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, Fmask: SQLITE_NoCkptOnClose}, - {Fop: SQLITE_DBCONFIG_ENABLE_QPSG, Fmask: SQLITE_EnableQPSG}, - {Fop: SQLITE_DBCONFIG_TRIGGER_EQP, Fmask: SQLITE_TriggerEQP}, - {Fop: SQLITE_DBCONFIG_RESET_DATABASE, Fmask: SQLITE_ResetDatabase}, - {Fop: SQLITE_DBCONFIG_DEFENSIVE, Fmask: SQLITE_Defensive}, + {Fop: SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, Fmask: U32(SQLITE_Fts3Tokenizer)}, + {Fop: SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, Fmask: U32(SQLITE_LoadExtension)}, + {Fop: SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, Fmask: U32(SQLITE_NoCkptOnClose)}, + {Fop: SQLITE_DBCONFIG_ENABLE_QPSG, Fmask: U32(SQLITE_EnableQPSG)}, + {Fop: SQLITE_DBCONFIG_TRIGGER_EQP, Fmask: U32(SQLITE_TriggerEQP)}, + {Fop: SQLITE_DBCONFIG_RESET_DATABASE, Fmask: U32(SQLITE_ResetDatabase)}, + {Fop: SQLITE_DBCONFIG_DEFENSIVE, Fmask: U32(SQLITE_Defensive)}, {Fop: SQLITE_DBCONFIG_WRITABLE_SCHEMA, Fmask: (U32(SQLITE_WriteSchema | SQLITE_NoSchemaError))}, - {Fop: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, Fmask: SQLITE_LegacyAlter}, - {Fop: SQLITE_DBCONFIG_DQS_DDL, Fmask: SQLITE_DqsDDL}, - {Fop: SQLITE_DBCONFIG_DQS_DML, Fmask: SQLITE_DqsDML}, - {Fop: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, Fmask: SQLITE_LegacyFileFmt}, - {Fop: SQLITE_DBCONFIG_TRUSTED_SCHEMA, Fmask: SQLITE_TrustedSchema}, -} /* sqlite3.c:161939:9 */ + {Fop: SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, Fmask: U32(SQLITE_LegacyAlter)}, + {Fop: SQLITE_DBCONFIG_DQS_DDL, Fmask: U32(SQLITE_DqsDDL)}, + {Fop: SQLITE_DBCONFIG_DQS_DML, Fmask: U32(SQLITE_DqsDML)}, + {Fop: SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, Fmask: U32(SQLITE_LegacyFileFmt)}, + {Fop: SQLITE_DBCONFIG_TRUSTED_SCHEMA, Fmask: U32(SQLITE_TrustedSchema)}, +} /* sqlite3.c:164879:9 */ // This is the default collating function named "BINARY" which is always // available. -func binCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:161991:12: */ +func binCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:164931:12: */ var rc int32 var n int32 _ = NotUsed @@ -142148,7 +144682,7 @@ func binCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKe // This is the collating function named "RTRIM" which is always // available. Ignore trailing spaces. -func rtrimCollFunc(tls *libc.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:162014:12: */ +func rtrimCollFunc(tls *libc.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:164954:12: */ var pK1 uintptr = pKey1 var pK2 uintptr = pKey2 for (nKey1 != 0) && (int32(*(*U8)(unsafe.Pointer(pK1 + uintptr((nKey1 - 1))))) == ' ') { @@ -142161,7 +144695,7 @@ func rtrimCollFunc(tls *libc.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nKe } // Return true if CollSeq is the default built-in BINARY. -func Xsqlite3IsBinary(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:162029:20: */ +func Xsqlite3IsBinary(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:164969:20: */ return (libc.Bool32((p == uintptr(0)) || ((*CollSeq)(unsafe.Pointer(p)).FxCmp == *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 @@ -142175,7 +144709,7 @@ func Xsqlite3IsBinary(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:162029:20: // extends only to the 26 characters used in the English language. // // At the moment there is only a UTF-8 implementation. -func nocaseCollatingFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:162043:12: */ +func nocaseCollatingFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:164983:12: */ var r int32 = Xsqlite3_strnicmp(tls, pKey1, pKey2, func() int32 { if nKey1 < nKey2 { @@ -142191,31 +144725,31 @@ func nocaseCollatingFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uint } // Return the ROWID of the most recent insert -func Xsqlite3_last_insert_rowid(tls *libc.TLS, db uintptr) Sqlite_int64 { /* sqlite3.c:162060:25: */ +func Xsqlite3_last_insert_rowid(tls *libc.TLS, db uintptr) Sqlite_int64 { /* sqlite3.c:165000:25: */ return (*Sqlite3)(unsafe.Pointer(db)).FlastRowid } // Set the value returned by the sqlite3_last_insert_rowid() API function. -func Xsqlite3_set_last_insert_rowid(tls *libc.TLS, db uintptr, iRowid Sqlite3_int64) { /* sqlite3.c:162073:17: */ +func Xsqlite3_set_last_insert_rowid(tls *libc.TLS, db uintptr, iRowid Sqlite3_int64) { /* sqlite3.c:165013:17: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = iRowid Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) } // Return the number of changes in the most recent call to sqlite3_exec(). -func Xsqlite3_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162088:16: */ +func Xsqlite3_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:165028:16: */ return (*Sqlite3)(unsafe.Pointer(db)).FnChange } // Return the number of changes since the database handle was opened. -func Xsqlite3_total_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162101:16: */ +func Xsqlite3_total_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:165041:16: */ return (*Sqlite3)(unsafe.Pointer(db)).FnTotalChange } // 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 Xsqlite3CloseSavepoints(tls *libc.TLS, db uintptr) { /* sqlite3.c:162116:21: */ +func Xsqlite3CloseSavepoints(tls *libc.TLS, db uintptr) { /* sqlite3.c:165056:21: */ for (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint != 0 { var pTmp uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pTmp)).FpNext @@ -142230,7 +144764,7 @@ func Xsqlite3CloseSavepoints(tls *libc.TLS, db uintptr) { /* sqlite3.c:162116:21 // 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 *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:162133:13: */ +func functionDestroy(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:165073:13: */ var pDestructor uintptr = *(*uintptr)(unsafe.Pointer(p + 64 /* &.u */)) if pDestructor != 0 { (*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef-- @@ -142243,7 +144777,7 @@ func functionDestroy(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:162133 // Disconnect all sqlite3_vtab objects that belong to database connection // db. This is called when db is being closed. -func disconnectAllVtab(tls *libc.TLS, db uintptr) { /* sqlite3.c:162148:13: */ +func disconnectAllVtab(tls *libc.TLS, db uintptr) { /* sqlite3.c:165088:13: */ var i int32 var p uintptr Xsqlite3BtreeEnterAll(tls, db) @@ -142258,7 +144792,7 @@ func disconnectAllVtab(tls *libc.TLS, db uintptr) { /* sqlite3.c:162148:13: */ } } } - for p = (*Hash)(unsafe.Pointer((db + 528 /* &.aModule */))).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext { + for p = (*Hash)(unsafe.Pointer((db + 536 /* &.aModule */))).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext { var pMod uintptr = (*HashElem)(unsafe.Pointer(p)).Fdata if (*Module)(unsafe.Pointer(pMod)).FpEpoTab != 0 { Xsqlite3VtabDisconnect(tls, db, (*Module)(unsafe.Pointer(pMod)).FpEpoTab) @@ -142270,7 +144804,7 @@ func disconnectAllVtab(tls *libc.TLS, db uintptr) { /* sqlite3.c:162148:13: */ // Return TRUE if database connection db has unfinalized prepared // statements or unfinished sqlite3_backup objects. -func connectionIsBusy(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162179:12: */ +func connectionIsBusy(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:165119:12: */ var j int32 if (*Sqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { @@ -142286,18 +144820,18 @@ func connectionIsBusy(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162179:12: } // Close an existing SQLite database -func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlite3.c:162193:12: */ +func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlite3.c:165133:12: */ if !(db != 0) { // EVIDENCE-OF: R-63257-11740 Calling sqlite3_close() or // sqlite3_close_v2() with a NULL pointer argument is a harmless no-op. return SQLITE_OK } if !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return Xsqlite3MisuseError(tls, 162200) + return Xsqlite3MisuseError(tls, 165140) } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if (int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & SQLITE_TRACE_CLOSE) != 0 { - (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, SQLITE_TRACE_CLOSE, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0)) + (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 240 /* &.trace */ /* &.xV2 */))))(tls, uint32(SQLITE_TRACE_CLOSE), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0)) } // Force xDisconnect calls on all virtual tables @@ -142315,17 +144849,49 @@ func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlit // SQLITE_BUSY if the connection can not be closed immediately. if !(forceZombie != 0) && (connectionIsBusy(tls, db) != 0) { Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY, - ts+25005 /* "unable to close ..." */, 0) + ts+25511 /* "unable to close ..." */, 0) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_BUSY } // Convert the connection into a zombie and then close it. - (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_ZOMBIE + (*Sqlite3)(unsafe.Pointer(db)).Fmagic = U32(SQLITE_MAGIC_ZOMBIE) Xsqlite3LeaveMutexAndCloseZombie(tls, db) return SQLITE_OK } +// Return the transaction state for a single databse, or the maximum +// transaction state over all attached databases if zSchema is null. +func Xsqlite3_txn_state(tls *libc.TLS, db uintptr, zSchema uintptr) int32 { /* sqlite3.c:165187:16: */ + var iDb int32 + var nDb int32 + var iTxn int32 = -1 + Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) + if zSchema != 0 { + nDb = libc.AssignInt32(&iDb, Xsqlite3FindDbName(tls, db, zSchema)) + if iDb < 0 { + nDb-- + } + } else { + iDb = 0 + nDb = ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1) + } + for ; iDb <= nDb; iDb++ { + var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt + var x int32 + if pBt != uintptr(0) { + x = Xsqlite3BtreeTxnState(tls, pBt) + } else { + x = SQLITE_TXN_NONE + } + if x > iTxn { + iTxn = x + } + } + Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) + return iTxn +} + // 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 @@ -142333,11 +144899,11 @@ func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlit // 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 *libc.TLS, db uintptr) int32 { /* sqlite3.c:162252:16: */ +func Xsqlite3_close(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:165222:16: */ return sqlite3Close(tls, db, 0) } -func Xsqlite3_close_v2(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162253:16: */ +func Xsqlite3_close_v2(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:165223:16: */ return sqlite3Close(tls, db, 1) } @@ -142347,14 +144913,14 @@ func Xsqlite3_close_v2(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162253:16 // 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 Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c:162264:21: */ +func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c:165234:21: */ var i uintptr // Hash table iterator var j int32 // If there are outstanding sqlite3_stmt or sqlite3_backup objects // or if the connection has not yet been closed by sqlite3_close_v2(), // then just leave the mutex and return. - if ((*Sqlite3)(unsafe.Pointer(db)).Fmagic != SQLITE_MAGIC_ZOMBIE) || (connectionIsBusy(tls, db) != 0) { + if ((*Sqlite3)(unsafe.Pointer(db)).Fmagic != U32(SQLITE_MAGIC_ZOMBIE)) || (connectionIsBusy(tls, db) != 0) { Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return } @@ -142397,7 +144963,7 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c: // locks and does not require any further unlock-notify callbacks. Xsqlite3ConnectionClosed(tls, db) - for i = (*Hash)(unsafe.Pointer((db + 576 /* &.aFunc */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext { + for i = (*Hash)(unsafe.Pointer((db + 584 /* &.aFunc */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext { var pNext uintptr var p uintptr p = (*HashElem)(unsafe.Pointer(i)).Fdata @@ -142408,8 +144974,8 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c: p = pNext } } - Xsqlite3HashClear(tls, (db + 576 /* &.aFunc */)) - for i = (*Hash)(unsafe.Pointer((db + 600 /* &.aCollSeq */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext { + Xsqlite3HashClear(tls, (db + 584 /* &.aFunc */)) + for i = (*Hash)(unsafe.Pointer((db + 608 /* &.aCollSeq */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext { var pColl uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata // Invoke any destructors registered for collation sequence user data. for j = 0; j < 3; j++ { @@ -142419,13 +144985,13 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c: } Xsqlite3DbFree(tls, db, pColl) } - Xsqlite3HashClear(tls, (db + 600 /* &.aCollSeq */)) - for i = (*Hash)(unsafe.Pointer((db + 528 /* &.aModule */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext { + Xsqlite3HashClear(tls, (db + 608 /* &.aCollSeq */)) + for i = (*Hash)(unsafe.Pointer((db + 536 /* &.aModule */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext { var pMod uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata Xsqlite3VtabEponymousTableClear(tls, db, pMod) Xsqlite3VtabModuleUnref(tls, db, pMod) } - Xsqlite3HashClear(tls, (db + 528 /* &.aModule */)) + Xsqlite3HashClear(tls, (db + 536 /* &.aModule */)) Xsqlite3Error(tls, db, SQLITE_OK) // Deallocates any cached error strings. Xsqlite3ValueFree(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr) @@ -142454,7 +145020,7 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c: // 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 Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3.c:162384:21: */ +func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3.c:165354:21: */ var i int32 var inTrans int32 = 0 var schemaChange int32 @@ -142468,12 +145034,12 @@ func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3 // the database rollback and schema reset, which can cause false // corruption reports in some cases. Xsqlite3BtreeEnterAll(tls, db) - schemaChange = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & DBFLAG_SchemaChange) != U32(0)) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0))) + schemaChange = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(DBFLAG_SchemaChange)) != U32(0)) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0))) for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ { var p uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt if p != 0 { - if Xsqlite3BtreeIsInTrans(tls, p) != 0 { + if Xsqlite3BtreeTxnState(tls, p) == SQLITE_TXN_WRITE { inTrans = 1 } Xsqlite3BtreeRollback(tls, p, tripCode, libc.BoolInt32(!(schemaChange != 0))) @@ -142491,17 +145057,17 @@ func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3 // Any deferred constraint violations have now been resolved. (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0) (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0) - *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(SQLITE_DeferFKs)) + *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (libc.CplUint64(uint64(SQLITE_DeferFKs))) // If one has been configured, invoke the rollback-hook callback if ((*Sqlite3)(unsafe.Pointer(db)).FxRollbackCallback != 0) && ((inTrans != 0) || !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((db + 288 /* &.xRollbackCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpRollbackArg) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((db + 296 /* &.xRollbackCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpRollbackArg) } } // Return a static string containing the name corresponding to the error code // specified in the argument. -func Xsqlite3ErrName(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:162434:27: */ +func Xsqlite3ErrName(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:165404:27: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -142516,259 +145082,259 @@ __1: { switch rc { case SQLITE_OK: - zName = ts + 25073 /* "SQLITE_OK" */ + zName = ts + 25579 /* "SQLITE_OK" */ break case SQLITE_ERROR: - zName = ts + 25083 /* "SQLITE_ERROR" */ + zName = ts + 25589 /* "SQLITE_ERROR" */ break case (SQLITE_ERROR | (int32(3) << 8)): - zName = ts + 25096 /* "SQLITE_ERROR_SNA..." */ + zName = ts + 25602 /* "SQLITE_ERROR_SNA..." */ break case SQLITE_INTERNAL: - zName = ts + 25118 /* "SQLITE_INTERNAL" */ + zName = ts + 25624 /* "SQLITE_INTERNAL" */ break case SQLITE_PERM: - zName = ts + 25134 /* "SQLITE_PERM" */ + zName = ts + 25640 /* "SQLITE_PERM" */ break case SQLITE_ABORT: - zName = ts + 25146 /* "SQLITE_ABORT" */ + zName = ts + 25652 /* "SQLITE_ABORT" */ break case (SQLITE_ABORT | (int32(2) << 8)): - zName = ts + 25159 /* "SQLITE_ABORT_ROL..." */ + zName = ts + 25665 /* "SQLITE_ABORT_ROL..." */ break case SQLITE_BUSY: - zName = ts + 25181 /* "SQLITE_BUSY" */ + zName = ts + 25687 /* "SQLITE_BUSY" */ break case (SQLITE_BUSY | (int32(1) << 8)): - zName = ts + 25193 /* "SQLITE_BUSY_RECO..." */ + zName = ts + 25699 /* "SQLITE_BUSY_RECO..." */ break case (SQLITE_BUSY | (int32(2) << 8)): - zName = ts + 25214 /* "SQLITE_BUSY_SNAP..." */ + zName = ts + 25720 /* "SQLITE_BUSY_SNAP..." */ break case SQLITE_LOCKED: - zName = ts + 25235 /* "SQLITE_LOCKED" */ + zName = ts + 25741 /* "SQLITE_LOCKED" */ break case (SQLITE_LOCKED | (int32(1) << 8)): - zName = ts + 25249 /* "SQLITE_LOCKED_SH..." */ + zName = ts + 25755 /* "SQLITE_LOCKED_SH..." */ break case SQLITE_NOMEM: - zName = ts + 25275 /* "SQLITE_NOMEM" */ + zName = ts + 25781 /* "SQLITE_NOMEM" */ break case SQLITE_READONLY: - zName = ts + 25288 /* "SQLITE_READONLY" */ + zName = ts + 25794 /* "SQLITE_READONLY" */ break case (SQLITE_READONLY | (int32(1) << 8)): - zName = ts + 25304 /* "SQLITE_READONLY_..." */ + zName = ts + 25810 /* "SQLITE_READONLY_..." */ break case (SQLITE_READONLY | (int32(5) << 8)): - zName = ts + 25329 /* "SQLITE_READONLY_..." */ + zName = ts + 25835 /* "SQLITE_READONLY_..." */ break case (SQLITE_READONLY | (int32(3) << 8)): - zName = ts + 25354 /* "SQLITE_READONLY_..." */ + zName = ts + 25860 /* "SQLITE_READONLY_..." */ break case (SQLITE_READONLY | (int32(4) << 8)): - zName = ts + 25379 /* "SQLITE_READONLY_..." */ + zName = ts + 25885 /* "SQLITE_READONLY_..." */ break case (SQLITE_READONLY | (int32(6) << 8)): - zName = ts + 25403 /* "SQLITE_READONLY_..." */ + zName = ts + 25909 /* "SQLITE_READONLY_..." */ break case SQLITE_INTERRUPT: - zName = ts + 25429 /* "SQLITE_INTERRUPT" */ + zName = ts + 25935 /* "SQLITE_INTERRUPT" */ break case SQLITE_IOERR: - zName = ts + 25446 /* "SQLITE_IOERR" */ + zName = ts + 25952 /* "SQLITE_IOERR" */ break case (SQLITE_IOERR | (int32(1) << 8)): - zName = ts + 25459 /* "SQLITE_IOERR_REA..." */ + zName = ts + 25965 /* "SQLITE_IOERR_REA..." */ break case (SQLITE_IOERR | (int32(2) << 8)): - zName = ts + 25477 /* "SQLITE_IOERR_SHO..." */ + zName = ts + 25983 /* "SQLITE_IOERR_SHO..." */ break case (SQLITE_IOERR | (int32(3) << 8)): - zName = ts + 25501 /* "SQLITE_IOERR_WRI..." */ + zName = ts + 26007 /* "SQLITE_IOERR_WRI..." */ break case (SQLITE_IOERR | (int32(4) << 8)): - zName = ts + 25520 /* "SQLITE_IOERR_FSY..." */ + zName = ts + 26026 /* "SQLITE_IOERR_FSY..." */ break case (SQLITE_IOERR | (int32(5) << 8)): - zName = ts + 25539 /* "SQLITE_IOERR_DIR..." */ + zName = ts + 26045 /* "SQLITE_IOERR_DIR..." */ break case (SQLITE_IOERR | (int32(6) << 8)): - zName = ts + 25562 /* "SQLITE_IOERR_TRU..." */ + zName = ts + 26068 /* "SQLITE_IOERR_TRU..." */ break case (SQLITE_IOERR | (int32(7) << 8)): - zName = ts + 25584 /* "SQLITE_IOERR_FST..." */ + zName = ts + 26090 /* "SQLITE_IOERR_FST..." */ break case (SQLITE_IOERR | (int32(8) << 8)): - zName = ts + 25603 /* "SQLITE_IOERR_UNL..." */ + zName = ts + 26109 /* "SQLITE_IOERR_UNL..." */ break case (SQLITE_IOERR | (int32(9) << 8)): - zName = ts + 25623 /* "SQLITE_IOERR_RDL..." */ + zName = ts + 26129 /* "SQLITE_IOERR_RDL..." */ break case (SQLITE_IOERR | (int32(10) << 8)): - zName = ts + 25643 /* "SQLITE_IOERR_DEL..." */ + zName = ts + 26149 /* "SQLITE_IOERR_DEL..." */ break case (SQLITE_IOERR | (int32(12) << 8)): - zName = ts + 25663 /* "SQLITE_IOERR_NOM..." */ + zName = ts + 26169 /* "SQLITE_IOERR_NOM..." */ break case (SQLITE_IOERR | (int32(13) << 8)): - zName = ts + 25682 /* "SQLITE_IOERR_ACC..." */ + zName = ts + 26188 /* "SQLITE_IOERR_ACC..." */ break case (SQLITE_IOERR | (int32(14) << 8)): - zName = ts + 25702 /* "SQLITE_IOERR_CHE..." */ + zName = ts + 26208 /* "SQLITE_IOERR_CHE..." */ break case (SQLITE_IOERR | (int32(15) << 8)): - zName = ts + 25733 /* "SQLITE_IOERR_LOC..." */ + zName = ts + 26239 /* "SQLITE_IOERR_LOC..." */ break case (SQLITE_IOERR | (int32(16) << 8)): - zName = ts + 25751 /* "SQLITE_IOERR_CLO..." */ + zName = ts + 26257 /* "SQLITE_IOERR_CLO..." */ break case (SQLITE_IOERR | (int32(17) << 8)): - zName = ts + 25770 /* "SQLITE_IOERR_DIR..." */ + zName = ts + 26276 /* "SQLITE_IOERR_DIR..." */ break case (SQLITE_IOERR | (int32(18) << 8)): - zName = ts + 25793 /* "SQLITE_IOERR_SHM..." */ + zName = ts + 26299 /* "SQLITE_IOERR_SHM..." */ break case (SQLITE_IOERR | (int32(19) << 8)): - zName = ts + 25814 /* "SQLITE_IOERR_SHM..." */ + zName = ts + 26320 /* "SQLITE_IOERR_SHM..." */ break case (SQLITE_IOERR | (int32(20) << 8)): - zName = ts + 25835 /* "SQLITE_IOERR_SHM..." */ + zName = ts + 26341 /* "SQLITE_IOERR_SHM..." */ break case (SQLITE_IOERR | (int32(21) << 8)): - zName = ts + 25856 /* "SQLITE_IOERR_SHM..." */ + zName = ts + 26362 /* "SQLITE_IOERR_SHM..." */ break case (SQLITE_IOERR | (int32(22) << 8)): - zName = ts + 25876 /* "SQLITE_IOERR_SEE..." */ + zName = ts + 26382 /* "SQLITE_IOERR_SEE..." */ break case (SQLITE_IOERR | (int32(23) << 8)): - zName = ts + 25894 /* "SQLITE_IOERR_DEL..." */ + zName = ts + 26400 /* "SQLITE_IOERR_DEL..." */ break case (SQLITE_IOERR | (int32(24) << 8)): - zName = ts + 25920 /* "SQLITE_IOERR_MMA..." */ + zName = ts + 26426 /* "SQLITE_IOERR_MMA..." */ break case (SQLITE_IOERR | (int32(25) << 8)): - zName = ts + 25938 /* "SQLITE_IOERR_GET..." */ + zName = ts + 26444 /* "SQLITE_IOERR_GET..." */ break case (SQLITE_IOERR | (int32(26) << 8)): - zName = ts + 25963 /* "SQLITE_IOERR_CON..." */ + zName = ts + 26469 /* "SQLITE_IOERR_CON..." */ break case SQLITE_CORRUPT: - zName = ts + 25985 /* "SQLITE_CORRUPT" */ + zName = ts + 26491 /* "SQLITE_CORRUPT" */ break case (SQLITE_CORRUPT | (int32(1) << 8)): - zName = ts + 26000 /* "SQLITE_CORRUPT_V..." */ + zName = ts + 26506 /* "SQLITE_CORRUPT_V..." */ break case SQLITE_NOTFOUND: - zName = ts + 26020 /* "SQLITE_NOTFOUND" */ + zName = ts + 26526 /* "SQLITE_NOTFOUND" */ break case SQLITE_FULL: - zName = ts + 26036 /* "SQLITE_FULL" */ + zName = ts + 26542 /* "SQLITE_FULL" */ break case SQLITE_CANTOPEN: - zName = ts + 26048 /* "SQLITE_CANTOPEN" */ + zName = ts + 26554 /* "SQLITE_CANTOPEN" */ break case (SQLITE_CANTOPEN | (int32(1) << 8)): - zName = ts + 26064 /* "SQLITE_CANTOPEN_..." */ + zName = ts + 26570 /* "SQLITE_CANTOPEN_..." */ break case (SQLITE_CANTOPEN | (int32(2) << 8)): - zName = ts + 26090 /* "SQLITE_CANTOPEN_..." */ + zName = ts + 26596 /* "SQLITE_CANTOPEN_..." */ break case (SQLITE_CANTOPEN | (int32(3) << 8)): - zName = ts + 26112 /* "SQLITE_CANTOPEN_..." */ + zName = ts + 26618 /* "SQLITE_CANTOPEN_..." */ break case (SQLITE_CANTOPEN | (int32(4) << 8)): - zName = ts + 26137 /* "SQLITE_CANTOPEN_..." */ + zName = ts + 26643 /* "SQLITE_CANTOPEN_..." */ break case (SQLITE_CANTOPEN | (int32(6) << 8)): - zName = ts + 26162 /* "SQLITE_CANTOPEN_..." */ + zName = ts + 26668 /* "SQLITE_CANTOPEN_..." */ break case SQLITE_PROTOCOL: - zName = ts + 26186 /* "SQLITE_PROTOCOL" */ + zName = ts + 26692 /* "SQLITE_PROTOCOL" */ break case SQLITE_EMPTY: - zName = ts + 26202 /* "SQLITE_EMPTY" */ + zName = ts + 26708 /* "SQLITE_EMPTY" */ break case SQLITE_SCHEMA: - zName = ts + 26215 /* "SQLITE_SCHEMA" */ + zName = ts + 26721 /* "SQLITE_SCHEMA" */ break case SQLITE_TOOBIG: - zName = ts + 26229 /* "SQLITE_TOOBIG" */ + zName = ts + 26735 /* "SQLITE_TOOBIG" */ break case SQLITE_CONSTRAINT: - zName = ts + 26243 /* "SQLITE_CONSTRAIN..." */ + zName = ts + 26749 /* "SQLITE_CONSTRAIN..." */ break case (SQLITE_CONSTRAINT | (int32(8) << 8)): - zName = ts + 26261 /* "SQLITE_CONSTRAIN..." */ + zName = ts + 26767 /* "SQLITE_CONSTRAIN..." */ break case (SQLITE_CONSTRAINT | (int32(7) << 8)): - zName = ts + 26286 /* "SQLITE_CONSTRAIN..." */ + zName = ts + 26792 /* "SQLITE_CONSTRAIN..." */ break case (SQLITE_CONSTRAINT | (int32(3) << 8)): - zName = ts + 26312 /* "SQLITE_CONSTRAIN..." */ + zName = ts + 26818 /* "SQLITE_CONSTRAIN..." */ break case (SQLITE_CONSTRAINT | (int32(1) << 8)): - zName = ts + 26341 /* "SQLITE_CONSTRAIN..." */ + zName = ts + 26847 /* "SQLITE_CONSTRAIN..." */ break case (SQLITE_CONSTRAINT | (int32(6) << 8)): - zName = ts + 26365 /* "SQLITE_CONSTRAIN..." */ + zName = ts + 26871 /* "SQLITE_CONSTRAIN..." */ break case (SQLITE_CONSTRAINT | (int32(5) << 8)): - zName = ts + 26394 /* "SQLITE_CONSTRAIN..." */ + zName = ts + 26900 /* "SQLITE_CONSTRAIN..." */ break case (SQLITE_CONSTRAINT | (int32(2) << 8)): - zName = ts + 26420 /* "SQLITE_CONSTRAIN..." */ + zName = ts + 26926 /* "SQLITE_CONSTRAIN..." */ break case (SQLITE_CONSTRAINT | (int32(9) << 8)): - zName = ts + 26449 /* "SQLITE_CONSTRAIN..." */ + zName = ts + 26955 /* "SQLITE_CONSTRAIN..." */ break case (SQLITE_CONSTRAINT | (int32(4) << 8)): - zName = ts + 26472 /* "SQLITE_CONSTRAIN..." */ + zName = ts + 26978 /* "SQLITE_CONSTRAIN..." */ break case (SQLITE_CONSTRAINT | (int32(10) << 8)): - zName = ts + 26499 /* "SQLITE_CONSTRAIN..." */ + zName = ts + 27005 /* "SQLITE_CONSTRAIN..." */ break case SQLITE_MISMATCH: - zName = ts + 26523 /* "SQLITE_MISMATCH" */ + zName = ts + 27029 /* "SQLITE_MISMATCH" */ break case SQLITE_MISUSE: - zName = ts + 26539 /* "SQLITE_MISUSE" */ + zName = ts + 27045 /* "SQLITE_MISUSE" */ break case SQLITE_NOLFS: - zName = ts + 26553 /* "SQLITE_NOLFS" */ + zName = ts + 27059 /* "SQLITE_NOLFS" */ break case SQLITE_AUTH: - zName = ts + 26566 /* "SQLITE_AUTH" */ + zName = ts + 27072 /* "SQLITE_AUTH" */ break case SQLITE_FORMAT: - zName = ts + 26578 /* "SQLITE_FORMAT" */ + zName = ts + 27084 /* "SQLITE_FORMAT" */ break case SQLITE_RANGE: - zName = ts + 26592 /* "SQLITE_RANGE" */ + zName = ts + 27098 /* "SQLITE_RANGE" */ break case SQLITE_NOTADB: - zName = ts + 26605 /* "SQLITE_NOTADB" */ + zName = ts + 27111 /* "SQLITE_NOTADB" */ break case SQLITE_ROW: - zName = ts + 26619 /* "SQLITE_ROW" */ + zName = ts + 27125 /* "SQLITE_ROW" */ break case SQLITE_NOTICE: - zName = ts + 26630 /* "SQLITE_NOTICE" */ + zName = ts + 27136 /* "SQLITE_NOTICE" */ break case (SQLITE_NOTICE | (int32(1) << 8)): - zName = ts + 26644 /* "SQLITE_NOTICE_RE..." */ + zName = ts + 27150 /* "SQLITE_NOTICE_RE..." */ break case (SQLITE_NOTICE | (int32(2) << 8)): - zName = ts + 26670 /* "SQLITE_NOTICE_RE..." */ + zName = ts + 27176 /* "SQLITE_NOTICE_RE..." */ break case SQLITE_WARNING: - zName = ts + 26701 /* "SQLITE_WARNING" */ + zName = ts + 27207 /* "SQLITE_WARNING" */ break case (SQLITE_WARNING | (int32(1) << 8)): - zName = ts + 26716 /* "SQLITE_WARNING_A..." */ + zName = ts + 27222 /* "SQLITE_WARNING_A..." */ break case SQLITE_DONE: - zName = ts + 26741 /* "SQLITE_DONE" */ + zName = ts + 27247 /* "SQLITE_DONE" */ break } @@ -142782,34 +145348,34 @@ __2: __3: ; if zName == uintptr(0) { - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof(zBuf)), uintptr(unsafe.Pointer(&zBuf)), ts+26753 /* "SQLITE_UNKNOWN(%..." */, libc.VaList(bp, origRc)) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof(zBuf)), uintptr(unsafe.Pointer(&zBuf)), ts+27259 /* "SQLITE_UNKNOWN(%..." */, libc.VaList(bp, origRc)) zName = uintptr(unsafe.Pointer(&zBuf)) } return zName } -var zBuf [50]int8 /* sqlite3.c:162533:17: */ +var zBuf [50]int8 /* sqlite3.c:165503:17: */ // Return a static string that describes the kind of error specified in the // argument. -func Xsqlite3ErrStr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:162545:27: */ - var zErr uintptr = ts + 26772 /* "unknown error" */ +func Xsqlite3ErrStr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:165515:27: */ + var zErr uintptr = ts + 27278 /* "unknown error" */ switch rc { case (SQLITE_ABORT | (int32(2) << 8)): { - zErr = ts + 26786 /* "abort due to ROL..." */ + zErr = ts + 27292 /* "abort due to ROL..." */ break } case SQLITE_ROW: { - zErr = ts + 26808 /* "another row avai..." */ + zErr = ts + 27314 /* "another row avai..." */ break } case SQLITE_DONE: { - zErr = ts + 26830 /* "no more rows ava..." */ + zErr = ts + 27336 /* "no more rows ava..." */ break } @@ -142827,36 +145393,36 @@ func Xsqlite3ErrStr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:162545:27: * } var aMsg = [29]uintptr{ - /* SQLITE_OK */ ts + 26853, /* "not an error" */ - /* SQLITE_ERROR */ ts + 26866, /* "SQL logic error" */ + /* SQLITE_OK */ ts + 27359, /* "not an error" */ + /* SQLITE_ERROR */ ts + 27372, /* "SQL logic error" */ /* SQLITE_INTERNAL */ uintptr(0), - /* SQLITE_PERM */ ts + 26882, /* "access permissio..." */ - /* SQLITE_ABORT */ ts + 26907, /* "query aborted" */ - /* SQLITE_BUSY */ ts + 26921, /* "database is lock..." */ - /* SQLITE_LOCKED */ ts + 26940, /* "database table i..." */ - /* SQLITE_NOMEM */ ts + 7766, /* "out of memory" */ - /* SQLITE_READONLY */ ts + 26965, /* "attempt to write..." */ - /* SQLITE_INTERRUPT */ ts + 27002, /* "interrupted" */ - /* SQLITE_IOERR */ ts + 27014, /* "disk I/O error" */ - /* SQLITE_CORRUPT */ ts + 27029, /* "database disk im..." */ - /* SQLITE_NOTFOUND */ ts + 27062, /* "unknown operatio..." */ - /* SQLITE_FULL */ ts + 27080, /* "database or disk..." */ - /* SQLITE_CANTOPEN */ ts + 27105, /* "unable to open d..." */ - /* SQLITE_PROTOCOL */ ts + 27134, /* "locking protocol" */ + /* SQLITE_PERM */ ts + 27388, /* "access permissio..." */ + /* SQLITE_ABORT */ ts + 27413, /* "query aborted" */ + /* SQLITE_BUSY */ ts + 27427, /* "database is lock..." */ + /* SQLITE_LOCKED */ ts + 27446, /* "database table i..." */ + /* SQLITE_NOMEM */ ts + 7859, /* "out of memory" */ + /* SQLITE_READONLY */ ts + 27471, /* "attempt to write..." */ + /* SQLITE_INTERRUPT */ ts + 27508, /* "interrupted" */ + /* SQLITE_IOERR */ ts + 27520, /* "disk I/O error" */ + /* SQLITE_CORRUPT */ ts + 27535, /* "database disk im..." */ + /* SQLITE_NOTFOUND */ ts + 27568, /* "unknown operatio..." */ + /* SQLITE_FULL */ ts + 27586, /* "database or disk..." */ + /* SQLITE_CANTOPEN */ ts + 27611, /* "unable to open d..." */ + /* SQLITE_PROTOCOL */ ts + 27640, /* "locking protocol" */ /* SQLITE_EMPTY */ uintptr(0), - /* SQLITE_SCHEMA */ ts + 7513, /* "database schema ..." */ - /* SQLITE_TOOBIG */ ts + 7050, /* "string or blob t..." */ - /* SQLITE_CONSTRAINT */ ts + 27151, /* "constraint faile..." */ - /* SQLITE_MISMATCH */ ts + 27169, /* "datatype mismatc..." */ - /* SQLITE_MISUSE */ ts + 27187, /* "bad parameter or..." */ + /* SQLITE_SCHEMA */ ts + 7589, /* "database schema ..." */ + /* SQLITE_TOOBIG */ ts + 7126, /* "string or blob t..." */ + /* SQLITE_CONSTRAINT */ ts + 27657, /* "constraint faile..." */ + /* SQLITE_MISMATCH */ ts + 27675, /* "datatype mismatc..." */ + /* SQLITE_MISUSE */ ts + 27693, /* "bad parameter or..." */ /* SQLITE_NOLFS */ uintptr(0), - /* SQLITE_AUTH */ ts + 27221, /* "authorization de..." */ + /* SQLITE_AUTH */ ts + 27727, /* "authorization de..." */ /* SQLITE_FORMAT */ uintptr(0), - /* SQLITE_RANGE */ ts + 27242, /* "column index out..." */ - /* SQLITE_NOTADB */ ts + 27268, /* "file is not a da..." */ - /* SQLITE_NOTICE */ ts + 27291, /* "notification mes..." */ - /* SQLITE_WARNING */ ts + 27312, /* "warning message" */ -} /* sqlite3.c:162546:20 */ + /* SQLITE_RANGE */ ts + 27748, /* "column index out..." */ + /* SQLITE_NOTADB */ ts + 27774, /* "file is not a da..." */ + /* SQLITE_NOTICE */ ts + 27797, /* "notification mes..." */ + /* SQLITE_WARNING */ ts + 27818, /* "warning message" */ +} /* sqlite3.c:165516:20 */ // This routine implements a busy callback that sleeps and tries // again until a timeout value is reached. The timeout value is @@ -142865,7 +145431,7 @@ var aMsg = [29]uintptr{ // // Return non-zero to retry the lock. Return zero to stop trying // and cause SQLite to return SQLITE_BUSY. -func sqliteDefaultBusyCallback(tls *libc.TLS, ptr uintptr, count int32) int32 { /* sqlite3.c:162615:12: */ +func sqliteDefaultBusyCallback(tls *libc.TLS, ptr uintptr, count int32) int32 { /* sqlite3.c:165585:12: */ var db uintptr = ptr var tmout int32 = (*Sqlite3)(unsafe.Pointer(db)).FbusyTimeout var delay int32 @@ -142888,8 +145454,8 @@ func sqliteDefaultBusyCallback(tls *libc.TLS, ptr uintptr, count int32) int32 { return 1 } -var delays = [12]U8{U8(1), U8(2), U8(5), U8(10), U8(15), U8(20), U8(25), U8(25), U8(25), U8(50), U8(50), U8(100)} /* sqlite3.c:162622:19 */ -var totals = [12]U8{U8(0), U8(1), U8(3), U8(8), U8(18), U8(33), U8(53), U8(78), U8(103), U8(128), U8(178), U8(228)} /* sqlite3.c:162624:19 */ +var delays = [12]U8{U8(1), U8(2), U8(5), U8(10), U8(15), U8(20), U8(25), U8(25), U8(25), U8(50), U8(50), U8(100)} /* sqlite3.c:165592:19 */ +var totals = [12]U8{U8(0), U8(1), U8(3), U8(8), U8(18), U8(33), U8(53), U8(78), U8(103), U8(128), U8(178), U8(228)} /* sqlite3.c:165594:19 */ // Invoke the given busy handler. // @@ -142898,7 +145464,7 @@ var totals = [12]U8{U8(0), U8(1), U8(3), U8(8), U8(18), U8(33), U8(53), U8(78), // // If this routine returns non-zero, the lock is retried. If it // returns 0, the operation aborts with an SQLITE_BUSY error. -func Xsqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:162667:20: */ +func Xsqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:165637:20: */ var rc int32 if ((*BusyHandler)(unsafe.Pointer(p)).FxBusyHandler == uintptr(0)) || ((*BusyHandler)(unsafe.Pointer(p)).FnBusy < 0) { return 0 @@ -142914,7 +145480,7 @@ func Xsqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:16 // This routine sets the busy callback for an Sqlite database to the // given callback function with the given argument. -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) int32 { /* sqlite3.c:162683:16: */ +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) int32 { /* sqlite3.c:165653:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg @@ -142927,7 +145493,7 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // 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 *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { /* sqlite3.c:162706:17: */ +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { /* sqlite3.c:165676:17: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { (*Sqlite3)(unsafe.Pointer(db)).FxProgress = xProgress @@ -142943,7 +145509,7 @@ func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress // This routine installs a default busy handler that waits for the // specified number of milliseconds before returning 0. -func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) int32 { /* sqlite3.c:162737:16: */ +func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) int32 { /* sqlite3.c:165707:16: */ if ms > 0 { Xsqlite3_busy_handler(tls, db, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32) int32 @@ -142957,15 +145523,15 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) int32 { /* sqlit } // Cause any pending operation to stop at its earliest opportunity. -func Xsqlite3_interrupt(tls *libc.TLS, db uintptr) { /* sqlite3.c:162754:17: */ - libc.AtomicStoreNInt32((db + 392 /* &.u1 */ /* &.isInterrupted */), int32(1), 0) +func Xsqlite3_interrupt(tls *libc.TLS, db uintptr) { /* sqlite3.c:165724:17: */ + libc.AtomicStoreNInt32((db + 400 /* &.u1 */ /* &.isInterrupted */), int32(1), 0) } // 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 Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) int32 { /* sqlite3.c:162771:20: */ +func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) int32 { /* sqlite3.c:165741:20: */ var p uintptr var nName int32 _ = nName @@ -142977,7 +145543,7 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i ((libc.Bool32(xValue == uintptr(0))) != (libc.Bool32(xInverse == uintptr(0))))) || // Both or neither of xValue, xInverse ((nArg < -1) || (nArg > SQLITE_MAX_FUNCTION_ARG))) || (255 < (libc.AssignInt32(&nName, Xsqlite3Strlen30(tls, zFunctionName)))) { - return Xsqlite3MisuseError(tls, 162797) + return Xsqlite3MisuseError(tls, 165767) } extraFlags = (enc & (((SQLITE_DETERMINISTIC | SQLITE_DIRECTONLY) | SQLITE_SUBTYPE) | SQLITE_INNOCUOUS)) @@ -143017,10 +145583,10 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // is being overridden/deleted but there are no active VMs, allow the // operation to continue but invalidate all precompiled statements. p = Xsqlite3FindFunction(tls, db, zFunctionName, nArg, U8(enc), uint8(0)) - if ((p != 0) && (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_ENCMASK) == U32(enc))) && (int32((*FuncDef)(unsafe.Pointer(p)).FnArg) == nArg) { + if ((p != 0) && (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) == U32(enc))) && (int32((*FuncDef)(unsafe.Pointer(p)).FnArg) == nArg) { if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY, - ts+27328 /* "unable to delete..." */, 0) + ts+27834 /* "unable to delete..." */, 0) return SQLITE_BUSY } else { @@ -143042,7 +145608,7 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i (*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef++ } *(*uintptr)(unsafe.Pointer(p + 64 /* &.u */)) = pDestructor - (*FuncDef)(unsafe.Pointer(p)).FfuncFlags = (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & SQLITE_FUNC_ENCMASK) | U32(extraFlags)) + (*FuncDef)(unsafe.Pointer(p)).FfuncFlags = (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(SQLITE_FUNC_ENCMASK)) | U32(extraFlags)) (*FuncDef)(unsafe.Pointer(p)).FxSFunc = func() uintptr { if xSFunc != 0 { @@ -143063,7 +145629,7 @@ func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // sqlite3_create_function() // sqlite3_create_function_v2() // sqlite3_create_window_function() -func createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:162891:12: */ +func createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:165861:12: */ var rc int32 var pArg uintptr rc = SQLITE_ERROR @@ -143105,28 +145671,28 @@ out: } // Create new user functions. -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:162942:16: */ +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:165912:16: */ return createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) int32 { /* sqlite3.c:162955:16: */ +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) int32 { /* sqlite3.c:165925:16: */ return createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:162969:16: */ +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:165939:16: */ return createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:162986:16: */ +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:165956:16: */ var rc int32 var zFunc8 uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - zFunc8 = Xsqlite3Utf16to8(tls, db, zFunctionName, -1, SQLITE_UTF16LE) + zFunc8 = Xsqlite3Utf16to8(tls, db, zFunctionName, -1, uint8(SQLITE_UTF16LE)) rc = Xsqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3DbFree(tls, db, zFunc8) rc = Xsqlite3ApiExit(tls, db, rc) @@ -143140,7 +145706,7 @@ func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr // 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 *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:163022:13: */ +func sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:165992:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -143149,7 +145715,7 @@ func sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotUs _ = NotUsed _ = NotUsed2 zErr = Xsqlite3_mprintf(tls, - ts+27391 /* "unable to use fu..." */, libc.VaList(bp, zName)) + ts+27897 /* "unable to use fu..." */, libc.VaList(bp, zName)) Xsqlite3_result_error(tls, context, zErr, -1) Xsqlite3_free(tls, zErr) } @@ -143164,12 +145730,12 @@ func sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotUs // 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 *libc.TLS, db uintptr, zName uintptr, nArg int32) int32 { /* sqlite3.c:163048:16: */ +func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg int32) int32 { /* sqlite3.c:166018:16: */ var rc int32 var zCopy uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - rc = (libc.Bool32(Xsqlite3FindFunction(tls, db, zName, nArg, SQLITE_UTF8, uint8(0)) != uintptr(0))) + rc = (libc.Bool32(Xsqlite3FindFunction(tls, db, zName, nArg, uint8(SQLITE_UTF8), uint8(0)) != uintptr(0))) Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if rc != 0 { return SQLITE_OK @@ -143190,25 +145756,25 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // A NULL trace function means that no tracing is executes. A non-NULL // trace is a pointer to a function that is invoked at the start of each // SQL statement. -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) uintptr { /* sqlite3.c:163081:17: */ +func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) uintptr { /* sqlite3.c:166051:17: */ var pOld uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg (*Sqlite3)(unsafe.Pointer(db)).FmTrace = func() uint8 { if xTrace != 0 { - return SQLITE_TRACE_LEGACY + return uint8(SQLITE_TRACE_LEGACY) } return uint8(0) }() - *(*uintptr)(unsafe.Pointer(db + 232 /* &.trace */)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 240 /* &.trace */)) = xTrace (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } // Register a trace callback using the version-2 interface. -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) int32 { /* sqlite3.c:163102:16: */ +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) int32 { /* sqlite3.c:166072:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { xTrace = uintptr(0) @@ -143217,7 +145783,7 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, mTrace = uint32(0) } (*Sqlite3)(unsafe.Pointer(db)).FmTrace = U8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 232 /* &.trace */)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 240 /* &.trace */)) = xTrace (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -143229,16 +145795,16 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // 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 *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) uintptr { /* sqlite3.c:163132:17: */ +func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) uintptr { /* sqlite3.c:166102:17: */ var pOld uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg (*Sqlite3)(unsafe.Pointer(db)).FxProfile = xProfile (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg - *(*U8)(unsafe.Pointer(db + 104 /* &.mTrace */)) &= U8((SQLITE_TRACE_NONLEGACY_MASK)) + *(*U8)(unsafe.Pointer(db + 106 /* &.mTrace */)) &= U8((SQLITE_TRACE_NONLEGACY_MASK)) if (*Sqlite3)(unsafe.Pointer(db)).FxProfile != 0 { - *(*U8)(unsafe.Pointer(db + 104 /* &.mTrace */)) |= U8((SQLITE_TRACE_XPROFILE)) + *(*U8)(unsafe.Pointer(db + 106 /* &.mTrace */)) |= U8((SQLITE_TRACE_XPROFILE)) } Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) return pOld @@ -143247,7 +145813,7 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // 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 *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163162:17: */ +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:166132:17: */ var pOld uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -143260,7 +145826,7 @@ func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uin // Register a callback to be invoked each time a row is updated, // inserted or deleted using this database connection. -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163187:17: */ +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:166157:17: */ var pRet uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -143273,7 +145839,7 @@ func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uin // Register a callback to be invoked each time a transaction is rolled // back by this database connection. -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163212:17: */ +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:166182:17: */ var pRet uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -143286,7 +145852,7 @@ func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg u // Register a callback to be invoked each time a row is updated, // inserted or deleted using this database connection. -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163238:17: */ +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:166208:17: */ var pRet uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg @@ -143300,7 +145866,7 @@ func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg // Invoke sqlite3_wal_checkpoint if the number of frames in the log file // is greater than sqlite3.pWalArg cast to an integer (the value configured by // wal_autocheckpoint()). -func Xsqlite3WalDefaultHook(tls *libc.TLS, pClientData uintptr, db uintptr, zDb uintptr, nFrame int32) int32 { /* sqlite3.c:163261:20: */ +func Xsqlite3WalDefaultHook(tls *libc.TLS, pClientData uintptr, db uintptr, zDb uintptr, nFrame int32) int32 { /* sqlite3.c:166231:20: */ if nFrame >= (int32(pClientData)) { Xsqlite3BeginBenignMalloc(tls) Xsqlite3_wal_checkpoint(tls, db, zDb) @@ -143318,7 +145884,7 @@ func Xsqlite3WalDefaultHook(tls *libc.TLS, pClientData uintptr, db uintptr, zDb // 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 *libc.TLS, db uintptr, nFrame int32) int32 { /* sqlite3.c:163287:16: */ +func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) int32 { /* sqlite3.c:166257:16: */ if nFrame > 0 { Xsqlite3_wal_hook(tls, db, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 @@ -143331,7 +145897,7 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) int32 // 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 *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163308:17: */ +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:166278:17: */ var pRet uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Sqlite3)(unsafe.Pointer(db)).FpWalArg @@ -143342,12 +145908,12 @@ func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintpt } // Checkpoint database zDb. -func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:163335:16: */ +func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:166305:16: */ bp := tls.Alloc(8) defer tls.Free(8) - var rc int32 // Return code - var iDb int32 = SQLITE_MAX_ATTACHED // sqlite3.aDb[] index of db to checkpoint + var rc int32 // Return code + var iDb int32 // Schema to checkpoint // Initialize the output variables to -1 in case an error occurs. if pnLog != 0 { @@ -143366,10 +145932,12 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if (zDb != 0) && (*(*int8)(unsafe.Pointer(zDb)) != 0) { iDb = Xsqlite3FindDbName(tls, db, zDb) + } else { + iDb = (SQLITE_MAX_ATTACHED + 2) // This means process all schemas } if iDb < 0 { rc = SQLITE_ERROR - Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+27442 /* "unknown database..." */, libc.VaList(bp, zDb)) + Xsqlite3ErrorWithMsg(tls, db, SQLITE_ERROR, ts+27948 /* "unknown database..." */, libc.VaList(bp, zDb)) } else { (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = Xsqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -143380,7 +145948,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in // If there are no active statements, clear the interrupt flag at this // point. if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 { - libc.AtomicStoreNInt32((db + 392 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) + libc.AtomicStoreNInt32((db + 400 /* &.u1 */ /* &.isInterrupted */), int32(0), 0) } Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -143390,7 +145958,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in // 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 *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:163397:16: */ +func Xsqlite3_wal_checkpoint(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:166369:16: */ // EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to // sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). return Xsqlite3_wal_checkpoint_v2(tls, db, zDb, SQLITE_CHECKPOINT_PASSIVE, uintptr(0), uintptr(0)) @@ -143408,19 +145976,21 @@ func Xsqlite3_wal_checkpoint(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* // 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 +// If iDb is passed SQLITE_MAX_DB then all attached databases are // checkpointed. If an error is encountered it is returned immediately - // no attempt is made to checkpoint any remaining databases. // // Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL, RESTART // or TRUNCATE. -func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:163424:20: */ +func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:166396:20: */ var rc int32 = SQLITE_OK // Return code var i int32 // Used to iterate through attached dbs var bBusy int32 = 0 // True if SQLITE_BUSY has been encountered + // See forum post a006d86f72 + for i = 0; (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb) && (rc == SQLITE_OK); i++ { - if (i == iDb) || (iDb == SQLITE_MAX_ATTACHED) { + if (i == iDb) || (iDb == (SQLITE_MAX_ATTACHED + 2)) { rc = Xsqlite3BtreeCheckpoint(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpBt, eMode, pnLog, pnCkpt) pnLog = uintptr(0) pnCkpt = uintptr(0) @@ -143454,19 +146024,19 @@ func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog // 2 2 memory (return 1) // 2 0 memory (return 1) // 3 any memory (return 1) -func Xsqlite3TempInMemory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163468:20: */ +func Xsqlite3TempInMemory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166442:20: */ return (libc.Bool32(int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == 2)) } // Return UTF-8 encoded English language explanation of the most recent // error. -func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:163489:23: */ +func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:166463:23: */ var z uintptr if !(db != 0) { return Xsqlite3ErrStr(tls, SQLITE_NOMEM) } if !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return Xsqlite3ErrStr(tls, Xsqlite3MisuseError(tls, 163495)) + return Xsqlite3ErrStr(tls, Xsqlite3MisuseError(tls, 166469)) } Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -143489,7 +146059,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:163489:23 // Return UTF-16 encoded English language explanation of the most recent // error. -func Xsqlite3_errmsg16(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:163517:23: */ +func Xsqlite3_errmsg16(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:166491:23: */ var z uintptr if !(db != 0) { return uintptr(uintptr(unsafe.Pointer(&outOfMem))) @@ -143518,18 +146088,18 @@ func Xsqlite3_errmsg16(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:163517: var outOfMem = [14]U16{ U16('o'), U16('u'), U16('t'), U16(' '), U16('o'), U16('f'), U16(' '), U16('m'), U16('e'), U16('m'), U16('o'), U16('r'), U16('y'), U16(0), -} /* sqlite3.c:163518:20 */ +} /* sqlite3.c:166492:20 */ var misuse = [34]U16{ U16('b'), U16('a'), U16('d'), U16(' '), U16('p'), U16('a'), U16('r'), U16('a'), U16('m'), U16('e'), U16('t'), U16('e'), U16('r'), U16(' '), U16('o'), U16('r'), U16(' '), U16('o'), U16('t'), U16('h'), U16('e'), U16('r'), U16(' '), U16('A'), U16('P'), U16('I'), U16(' '), U16('m'), U16('i'), U16('s'), U16('u'), U16('s'), U16('e'), U16(0), -} /* sqlite3.c:163521:20 */ +} /* sqlite3.c:166495:20 */ // 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 *libc.TLS, db uintptr) int32 { /* sqlite3.c:163559:16: */ +func Xsqlite3_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166533:16: */ if (db != 0) && !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return Xsqlite3MisuseError(tls, 163561) + return Xsqlite3MisuseError(tls, 166535) } if !(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { return SQLITE_NOMEM @@ -143537,9 +146107,9 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163559:16: return ((*Sqlite3)(unsafe.Pointer(db)).FerrCode & (*Sqlite3)(unsafe.Pointer(db)).FerrMask) } -func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163568:16: */ +func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166542:16: */ if (db != 0) && !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return Xsqlite3MisuseError(tls, 163570) + return Xsqlite3MisuseError(tls, 166544) } if !(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { return SQLITE_NOMEM @@ -143547,7 +146117,7 @@ func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:1 return (*Sqlite3)(unsafe.Pointer(db)).FerrCode } -func Xsqlite3_system_errno(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163577:16: */ +func Xsqlite3_system_errno(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:166551:16: */ if db != 0 { return (*Sqlite3)(unsafe.Pointer(db)).FiSysErrno } @@ -143557,13 +146127,13 @@ func Xsqlite3_system_errno(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:16357 // 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 *libc.TLS, rc int32) uintptr { /* sqlite3.c:163586:23: */ +func Xsqlite3_errstr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:166560:23: */ return Xsqlite3ErrStr(tls, rc) } // Create a new collating function for database "db". The name is zName // and the encoding is enc. -func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:163594:12: */ +func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:166568:12: */ var pColl uintptr var enc2 int32 @@ -143576,7 +146146,7 @@ func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uint enc2 = SQLITE_UTF16LE } if (enc2 < SQLITE_UTF8) || (enc2 > SQLITE_UTF16BE) { - return Xsqlite3MisuseError(tls, 163618) + return Xsqlite3MisuseError(tls, 166592) } // Check if this call is removing or replacing an existing collation @@ -143586,7 +146156,7 @@ func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uint if (pColl != 0) && ((*CollSeq)(unsafe.Pointer(pColl)).FxCmp != 0) { if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { Xsqlite3ErrorWithMsg(tls, db, SQLITE_BUSY, - ts+27463 /* "unable to delete..." */, 0) + ts+27969 /* "unable to delete..." */, 0) return SQLITE_BUSY } Xsqlite3ExpirePreparedStatements(tls, db, 0) @@ -143597,7 +146167,7 @@ func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uint // Also, collation destructor - CollSeq.xDel() - function may need // to be called. if (int32((*CollSeq)(unsafe.Pointer(pColl)).Fenc) & libc.CplInt32(SQLITE_UTF16_ALIGNED)) == enc2 { - var aColl uintptr = Xsqlite3HashFind(tls, (db + 600 /* &.aCollSeq */), zName) + var aColl uintptr = Xsqlite3HashFind(tls, (db + 608 /* &.aCollSeq */), zName) var j int32 for j = 0; j < 3; j++ { var p uintptr = (aColl + uintptr(j)*40) @@ -143639,7 +146209,7 @@ var aHardLimit = [12]int32{ SQLITE_MAX_VARIABLE_NUMBER, // IMP: R-38091-32352 SQLITE_MAX_TRIGGER_DEPTH, SQLITE_MAX_WORKER_THREADS, -} /* sqlite3.c:163671:18 */ +} /* sqlite3.c:166645:18 */ // Make sure the hard limits are set to reasonable values @@ -143651,7 +146221,7 @@ var aHardLimit = [12]int32{ // A new lower limit does not shrink existing constructs. // It merely prevents new constructs that exceed the limit // from forming. -func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) int32 { /* sqlite3.c:163734:16: */ +func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) int32 { /* sqlite3.c:166708:16: */ var oldLimit int32 // EVIDENCE-OF: R-30189-54097 For each limit category SQLITE_LIMIT_NAME @@ -143662,12 +146232,12 @@ func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) in if (limitId < 0) || (limitId >= (SQLITE_LIMIT_WORKER_THREADS + 1)) { return -1 } - oldLimit = *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(limitId)*4)) + oldLimit = *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + uintptr(limitId)*4)) if newLimit >= 0 { // IMP: R-52476-28732 if newLimit > aHardLimit[limitId] { newLimit = aHardLimit[limitId] // IMP: R-51463-25634 } - *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(limitId)*4)) = newLimit + *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + uintptr(limitId)*4)) = newLimit } return oldLimit // IMP: R-53341-35419 } @@ -143696,7 +146266,7 @@ func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) in // 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 Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags uintptr, ppVfs uintptr, pzFile uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:163804:20: */ +func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags uintptr, ppVfs uintptr, pzFile uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:166778:20: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -143727,9 +146297,9 @@ func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u zVfs = zDefaultVfs nUri = Xsqlite3Strlen30(tls, zUri) - if !(((((flags & SQLITE_OPEN_URI) != 0) || // IMP: R-48725-32206 + if !(((((flags & uint32(SQLITE_OPEN_URI)) != 0) || // IMP: R-48725-32206 (Xsqlite3Config.FbOpenUri != 0)) && // IMP: R-51689-46548 - (nUri >= 5)) && (libc.Xmemcmp(tls, zUri, ts+27531 /* "file:" */, uint64(5)) == 0)) { + (nUri >= 5)) && (libc.Xmemcmp(tls, zUri, ts+28037 /* "file:" */, uint64(5)) == 0)) { goto __1 } // Input character index iOut = 0 // Output character index @@ -143737,7 +146307,7 @@ func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u // Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen // method that there may be extra parameters following the file-name. - flags = flags | (SQLITE_OPEN_URI) + flags = flags | (uint32(SQLITE_OPEN_URI)) iIn = 0 __3: @@ -143777,10 +146347,10 @@ __8: goto __8 __9: ; - if !((iIn != 7) && ((iIn != 16) || (libc.Xmemcmp(tls, ts+27537 /* "localhost" */, (zUri+7), uint64(9)) != 0))) { + if !((iIn != 7) && ((iIn != 16) || (libc.Xmemcmp(tls, ts+28043 /* "localhost" */, (zUri+7), uint64(9)) != 0))) { goto __10 } - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+27547, /* "invalid uri auth..." */ + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+28053, /* "invalid uri auth..." */ libc.VaList(bp, (iIn-7), (zUri+7))) rc = SQLITE_ERROR goto parse_uri_out @@ -143902,7 +146472,7 @@ __27: zVal = (zOpt + uintptr((nOpt + 1))) nVal = Xsqlite3Strlen30(tls, zVal) - if !((nOpt == 3) && (libc.Xmemcmp(tls, ts+27575 /* "vfs" */, zOpt, uint64(3)) == 0)) { + if !((nOpt == 3) && (libc.Xmemcmp(tls, ts+28081 /* "vfs" */, zOpt, uint64(3)) == 0)) { goto __29 } zVfs = zVal @@ -143913,17 +146483,17 @@ __29: mask = 0 limit = 0 - if !((nOpt == 5) && (libc.Xmemcmp(tls, ts+27579 /* "cache" */, zOpt, uint64(5)) == 0)) { + if !((nOpt == 5) && (libc.Xmemcmp(tls, ts+28085 /* "cache" */, zOpt, uint64(5)) == 0)) { goto __31 } mask = (SQLITE_OPEN_SHAREDCACHE | SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&aCacheMode)) limit = mask - zModeType = ts + 27579 /* "cache" */ + zModeType = ts + 28085 /* "cache" */ __31: ; - if !((nOpt == 4) && (libc.Xmemcmp(tls, ts+27585 /* "mode" */, zOpt, uint64(4)) == 0)) { + if !((nOpt == 4) && (libc.Xmemcmp(tls, ts+28091 /* "mode" */, zOpt, uint64(4)) == 0)) { goto __32 } @@ -143931,7 +146501,7 @@ __31: SQLITE_OPEN_CREATE) | SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&aOpenMode)) limit = (int32(uint32(mask) & flags)) - zModeType = ts + 4425 /* "access" */ + zModeType = ts + 4501 /* "access" */ __32: ; @@ -143962,7 +146532,7 @@ __36: if !(mode == 0) { goto __38 } - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+27590 /* "no such %s mode:..." */, libc.VaList(bp+16, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+28096 /* "no such %s mode:..." */, libc.VaList(bp+16, zModeType, zVal)) rc = SQLITE_ERROR goto parse_uri_out __38: @@ -143970,7 +146540,7 @@ __38: if !((mode & libc.CplInt32(SQLITE_OPEN_MEMORY)) > limit) { goto __39 } - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+27610, /* "%s mode not allo..." */ + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+28116, /* "%s mode not allo..." */ libc.VaList(bp+32, zModeType, zVal)) rc = SQLITE_PERM goto parse_uri_out @@ -144013,7 +146583,7 @@ __2: if !(*(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0)) { goto __42 } - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+27634 /* "no such vfs: %s" */, libc.VaList(bp+48, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+28140 /* "no such vfs: %s" */, libc.VaList(bp+48, zVfs)) rc = SQLITE_ERROR __42: ; @@ -144034,24 +146604,24 @@ type OpenMode = struct { Fz uintptr Fmode int32 _ [4]byte -} /* sqlite3.c:163946:9 */ +} /* sqlite3.c:166920:9 */ var aCacheMode = [3]OpenMode{ - {Fz: ts + 19007 /* "shared" */, Fmode: SQLITE_OPEN_SHAREDCACHE}, - {Fz: ts + 27650 /* "private" */, Fmode: SQLITE_OPEN_PRIVATECACHE}, + {Fz: ts + 19432 /* "shared" */, Fmode: SQLITE_OPEN_SHAREDCACHE}, + {Fz: ts + 28156 /* "private" */, Fmode: SQLITE_OPEN_PRIVATECACHE}, {}, -} /* sqlite3.c:163955:34 */ +} /* sqlite3.c:166929:34 */ var aOpenMode = [5]OpenMode{ - {Fz: ts + 27658 /* "ro" */, Fmode: SQLITE_OPEN_READONLY}, - {Fz: ts + 27661 /* "rw" */, Fmode: SQLITE_OPEN_READWRITE}, - {Fz: ts + 27664 /* "rwc" */, Fmode: (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)}, - {Fz: ts + 18390 /* "memory" */, Fmode: SQLITE_OPEN_MEMORY}, + {Fz: ts + 28164 /* "ro" */, Fmode: SQLITE_OPEN_READONLY}, + {Fz: ts + 28167 /* "rw" */, Fmode: SQLITE_OPEN_READWRITE}, + {Fz: ts + 28170 /* "rwc" */, Fmode: (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)}, + {Fz: ts + 18815 /* "memory" */, Fmode: SQLITE_OPEN_MEMORY}, {}, -} /* sqlite3.c:163967:34 */ +} /* sqlite3.c:166941:34 */ // This routine does the core work of extracting URI parameters from a // database filename for the sqlite3_uri_parameter() interface. -func uriParameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:164041:19: */ +func uriParameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:167015:19: */ zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)) for *(*int8)(unsafe.Pointer(zFilename)) != 0 { var x int32 = libc.Xstrcmp(tls, zFilename, zParam) @@ -144067,7 +146637,7 @@ func uriParameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* // 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 *libc.TLS, zFilename uintptr, ppDb uintptr, flags uint32, zVfs uintptr) int32 { /* sqlite3.c:164059:12: */ +func openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, flags uint32, zVfs uintptr) int32 { /* sqlite3.c:167033:12: */ bp := tls.Alloc(32) defer tls.Free(32) *(*uint32)(unsafe.Pointer(bp + 8)) = flags @@ -144098,13 +146668,13 @@ __1: isThreadsafe = 0 goto __3 __2: - if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & SQLITE_OPEN_NOMUTEX) != 0) { + if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_NOMUTEX)) != 0) { goto __4 } isThreadsafe = 0 goto __5 __4: - if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & SQLITE_OPEN_FULLMUTEX) != 0) { + if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_FULLMUTEX)) != 0) { goto __6 } isThreadsafe = 1 @@ -144118,7 +146688,7 @@ __5: __3: ; - if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & SQLITE_OPEN_PRIVATECACHE) != 0) { + if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(SQLITE_OPEN_PRIVATECACHE)) != 0) { goto __8 } *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) &= libc.Uint32FromInt32(libc.CplInt32(SQLITE_OPEN_SHAREDCACHE)) @@ -144127,7 +146697,7 @@ __8: if !(Xsqlite3Config.FsharedCacheEnabled != 0) { goto __10 } - *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) |= SQLITE_OPEN_SHAREDCACHE + *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) |= uint32(SQLITE_OPEN_SHAREDCACHE) __10: ; __9: @@ -144175,12 +146745,12 @@ __12: (*Sqlite3)(unsafe.Pointer(db)).FerrMask = 0xff (*Sqlite3)(unsafe.Pointer(db)).FnDb = 2 (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_BUSY - (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 648 /* &.aDbStatic */ + (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 656 /* &.aDbStatic */ (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable = U32(1) (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0) - libc.Xmemcpy(tls, db+124 /* &.aLimit */, uintptr(unsafe.Pointer(&aHardLimit)), uint64(unsafe.Sizeof([12]int32{}))) - *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + 11*4)) = SQLITE_DEFAULT_WORKER_THREADS + libc.Xmemcpy(tls, db+128 /* &.aLimit */, uintptr(unsafe.Pointer(&aHardLimit)), uint64(unsafe.Sizeof([12]int32{}))) + *(*int32)(unsafe.Pointer((db + 128 /* &.aLimit */) + 11*4)) = SQLITE_DEFAULT_WORKER_THREADS (*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1) (*Sqlite3)(unsafe.Pointer(db)).FnextAutovac = int8(-1) (*Sqlite3)(unsafe.Pointer(db)).FszMmap = Xsqlite3Config.FszMmap @@ -144189,8 +146759,8 @@ __12: *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(((((((uint32(SQLITE_ShortColNames | SQLITE_EnableTrigger)) | SQLITE_EnableView) | - SQLITE_CacheSpill) | - SQLITE_TrustedSchema) | + uint32(SQLITE_CacheSpill)) | + uint32(SQLITE_TrustedSchema)) | // The SQLITE_DQS compile-time option determines the default settings // for SQLITE_DBCONFIG_DQS_DDL and SQLITE_DBCONFIG_DQS_DML. // @@ -144205,12 +146775,12 @@ __12: // Legacy behavior is 3 (double-quoted string literals are allowed anywhere) // and so that is the default. But developers are encouranged to use // -DSQLITE_DQS=0 (best) or -DSQLITE_DQS=1 (second choice) if possible. - SQLITE_DqsDML) | - SQLITE_DqsDDL) | + uint32(SQLITE_DqsDML)) | + uint32(SQLITE_DqsDDL)) | - SQLITE_AutoIndex)) - Xsqlite3HashInit(tls, (db + 600 /* &.aCollSeq */)) - Xsqlite3HashInit(tls, (db + 528 /* &.aModule */)) + uint32(SQLITE_AutoIndex))) + Xsqlite3HashInit(tls, (db + 608 /* &.aCollSeq */)) + Xsqlite3HashInit(tls, (db + 536 /* &.aModule */)) // Add the default collation sequence BINARY. BINARY works for both UTF-8 // and UTF-16, so add a version for each to avoid any unnecessary @@ -144218,19 +146788,19 @@ __12: // // EVIDENCE-OF: R-52786-44878 SQLite defines three built-in collating // functions: - createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{binCollFunc})), uintptr(0)) - createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), SQLITE_UTF16BE, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{binCollFunc})), uintptr(0)) - createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), SQLITE_UTF16LE, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{binCollFunc})), uintptr(0)) - createCollation(tls, db, ts+23528 /* "NOCASE" */, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, ts+23986 /* "NOCASE" */, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{nocaseCollatingFunc})), uintptr(0)) - createCollation(tls, db, ts+27668 /* "RTRIM" */, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + createCollation(tls, db, ts+28174 /* "RTRIM" */, uint8(SQLITE_UTF8), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 }{rtrimCollFunc})), uintptr(0)) if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { @@ -144259,7 +146829,7 @@ __15: if !(((int32(1) << (*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(7))) & 0x46) == 0) { goto __16 } - rc = Xsqlite3MisuseError(tls, 164264) // IMP: R-18321-05872 + rc = Xsqlite3MisuseError(tls, 167238) // IMP: R-18321-05872 goto __17 __16: rc = Xsqlite3ParseUri(tls, zVfs, zFilename, bp+8 /* &flags */, (db /* &.pVfs */), bp+16 /* &zOpen */, bp+24 /* &zErrMsg */) @@ -144287,7 +146857,7 @@ __18: // Open the backend database driver rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, *(*uintptr)(unsafe.Pointer(bp + 16 /* zOpen */)), db, ((*Sqlite3)(unsafe.Pointer(db)).FaDb + 8 /* &.pBt */), 0, - (int32(*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) | SQLITE_OPEN_MAIN_DB))) + (int32(*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) | uint32(SQLITE_OPEN_MAIN_DB)))) if !(rc != SQLITE_OK) { goto __20 } @@ -144314,10 +146884,10 @@ __22: // The default safety_level for the main database is FULL; for the temp // database it is OFF. This matches the pager layer defaults. - (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FzDbSName = ts + 8333 /* "main" */ + (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).FzDbSName = ts + 8426 /* "main" */ (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb)).Fsafety_level = (U8(SQLITE_DEFAULT_SYNCHRONOUS + 1)) - (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FzDbSName = ts + 24978 /* "temp" */ - (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).Fsafety_level = PAGER_SYNCHRONOUS_OFF + (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).FzDbSName = ts + 25484 /* "temp" */ + (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + 1*32)).Fsafety_level = U8(PAGER_SYNCHRONOUS_OFF) (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_OPEN if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { @@ -144402,7 +146972,7 @@ __31: if !(rc != SQLITE_OK) { goto __33 } - (*Sqlite3)(unsafe.Pointer(db)).Fmagic = SQLITE_MAGIC_SICK + (*Sqlite3)(unsafe.Pointer(db)).Fmagic = U32(SQLITE_MAGIC_SICK) __33: ; __32: @@ -144413,17 +146983,17 @@ __32: } // Open a new database handle. -func Xsqlite3_open(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:164386:16: */ +func Xsqlite3_open(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:167360:16: */ return openDatabase(tls, zFilename, ppDb, (uint32(SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)), uintptr(0)) } -func Xsqlite3_open_v2(tls *libc.TLS, filename uintptr, ppDb uintptr, flags int32, zVfs uintptr) int32 { /* sqlite3.c:164393:16: */ +func Xsqlite3_open_v2(tls *libc.TLS, filename uintptr, ppDb uintptr, flags int32, zVfs uintptr) int32 { /* sqlite3.c:167367:16: */ return openDatabase(tls, filename, ppDb, uint32(flags), zVfs) } // Open a new database handle. -func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:164406:16: */ +func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:167380:16: */ var zFilename8 uintptr // zFilename encoded in UTF-8 instead of UTF-16 var pVal uintptr var rc int32 @@ -144434,17 +147004,17 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* return rc } if zFilename == uintptr(0) { - zFilename = ts + 27674 /* "\x00\x00" */ + zFilename = ts + 28180 /* "\x00\x00" */ } pVal = Xsqlite3ValueNew(tls, uintptr(0)) - Xsqlite3ValueSetStr(tls, pVal, -1, zFilename, SQLITE_UTF16LE, uintptr(0)) - zFilename8 = Xsqlite3ValueText(tls, pVal, SQLITE_UTF8) + Xsqlite3ValueSetStr(tls, pVal, -1, zFilename, uint8(SQLITE_UTF16LE), uintptr(0)) + zFilename8 = Xsqlite3ValueText(tls, pVal, uint8(SQLITE_UTF8)) if zFilename8 != 0 { rc = openDatabase(tls, zFilename8, ppDb, (uint32(SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)), uintptr(0)) if (rc == SQLITE_OK) && !((int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).FschemaFlags) & (DB_SchemaLoaded)) == (DB_SchemaLoaded)) { - ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).Fenc) = libc.AssignPtrUint8(*(*uintptr)(unsafe.Pointer(ppDb))+94 /* &.enc */, SQLITE_UTF16LE) + ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb)).FpSchema)).Fenc) = libc.AssignPtrUint8(*(*uintptr)(unsafe.Pointer(ppDb))+96 /* &.enc */, U8(SQLITE_UTF16LE)) } } else { rc = SQLITE_NOMEM @@ -144455,12 +147025,12 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* } // Register a new collation sequence with the database handle db. -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:164445:16: */ +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:167419:16: */ return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) } // Register a new collation sequence with the database handle db. -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:164458:16: */ +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:167432:16: */ var rc int32 Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -144472,13 +147042,13 @@ func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc } // Register a new collation sequence with the database handle db. -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:164483:16: */ +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:167457:16: */ var rc int32 = SQLITE_OK var zName8 uintptr Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) - zName8 = Xsqlite3Utf16to8(tls, db, zName, -1, SQLITE_UTF16LE) + zName8 = Xsqlite3Utf16to8(tls, db, zName, -1, uint8(SQLITE_UTF16LE)) if zName8 != 0 { rc = createCollation(tls, db, zName8, U8(enc), pCtx, xCompare, uintptr(0)) Xsqlite3DbFree(tls, db, zName8) @@ -144490,7 +147060,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i // Register a collation sequence factory callback with the database handle // db. Replace any previously installed collation sequence factory. -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) int32 { /* sqlite3.c:164513:16: */ +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) int32 { /* sqlite3.c:167487:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) @@ -144501,7 +147071,7 @@ func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr // Register a collation sequence factory callback with the database handle // db. Replace any previously installed collation sequence factory. -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) int32 { /* sqlite3.c:164534:16: */ +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) int32 { /* sqlite3.c:167508:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 @@ -144512,7 +147082,7 @@ func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintp // This function is now an anachronism. It used to be used to recover from a // malloc() failure, but SQLite now does this automatically. -func Xsqlite3_global_recover(tls *libc.TLS) int32 { /* sqlite3.c:164556:16: */ +func Xsqlite3_global_recover(tls *libc.TLS) int32 { /* sqlite3.c:167530:16: */ return SQLITE_OK } @@ -144520,7 +147090,7 @@ func Xsqlite3_global_recover(tls *libc.TLS) int32 { /* sqlite3.c:164556:16: */ // 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 *libc.TLS, db uintptr) int32 { /* sqlite3.c:164567:16: */ +func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:167541:16: */ return int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) } @@ -144533,28 +147103,28 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:164 // // 2. Invoke sqlite3_log() to provide the source code location where // a low-level error is first detected. -func Xsqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) int32 { /* sqlite3.c:164588:20: */ +func Xsqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) int32 { /* sqlite3.c:167562:20: */ bp := tls.Alloc(24) defer tls.Free(24) - Xsqlite3_log(tls, iErr, ts+27677, /* "%s at line %d of..." */ + Xsqlite3_log(tls, iErr, ts+28183, /* "%s at line %d of..." */ libc.VaList(bp, zType, lineno, (uintptr(20)+Xsqlite3_sourceid(tls)))) return iErr } -func Xsqlite3CorruptError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:164593:20: */ +func Xsqlite3CorruptError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:167567:20: */ - return Xsqlite3ReportError(tls, SQLITE_CORRUPT, lineno, ts+27702 /* "database corrupt..." */) + return Xsqlite3ReportError(tls, SQLITE_CORRUPT, lineno, ts+28208 /* "database corrupt..." */) } -func Xsqlite3MisuseError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:164597:20: */ +func Xsqlite3MisuseError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:167571:20: */ - return Xsqlite3ReportError(tls, SQLITE_MISUSE, lineno, ts+27722 /* "misuse" */) + return Xsqlite3ReportError(tls, SQLITE_MISUSE, lineno, ts+28228 /* "misuse" */) } -func Xsqlite3CantopenError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:164601:20: */ +func Xsqlite3CantopenError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:167575:20: */ - return Xsqlite3ReportError(tls, SQLITE_CANTOPEN, lineno, ts+27729 /* "cannot open file" */) + return Xsqlite3ReportError(tls, SQLITE_CANTOPEN, lineno, ts+28235 /* "cannot open file" */) } // This is a convenience routine that makes sure that all thread-specific @@ -144562,12 +147132,12 @@ func Xsqlite3CantopenError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:164 // // 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 *libc.TLS) { /* sqlite3.c:164632:17: */ +func Xsqlite3_thread_cleanup(tls *libc.TLS) { /* sqlite3.c:167606:17: */ } // 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 *libc.TLS, db uintptr, zDbName uintptr, zTableName uintptr, zColumnName uintptr, pzDataType uintptr, pzCollSeq uintptr, pNotNull uintptr, pPrimaryKey uintptr, pAutoinc uintptr) int32 { /* sqlite3.c:164640:16: */ +func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, zTableName uintptr, zColumnName uintptr, pzDataType uintptr, pzCollSeq uintptr, pNotNull uintptr, pPrimaryKey uintptr, pAutoinc uintptr) int32 { /* sqlite3.c:167614:16: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -144642,7 +147212,7 @@ __7: if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) { goto __9 } - if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & TF_WithoutRowid) == U32(0)) && (Xsqlite3IsRowid(tls, zColumnName) != 0)) { + if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(TF_WithoutRowid)) == U32(0)) && (Xsqlite3IsRowid(tls, zColumnName) != 0)) { goto __10 } iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey) @@ -144678,10 +147248,10 @@ __4: zCollSeq = (*Column)(unsafe.Pointer(pCol)).FzColl notnull = (libc.Bool32(int32((*Column)(unsafe.Pointer(pCol)).FnotNull) != 0)) primarykey = (libc.Bool32((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & COLFLAG_PRIMKEY) != 0)) - autoinc = (libc.Bool32((int32((*Table)(unsafe.Pointer(pTab)).FiPKey) == iCol) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & TF_Autoincrement) != U32(0)))) + autoinc = (libc.Bool32((int32((*Table)(unsafe.Pointer(pTab)).FiPKey) == iCol) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(TF_Autoincrement)) != U32(0)))) goto __13 __12: - zDataType = ts + 13762 /* "INTEGER" */ + zDataType = ts + 14226 /* "INTEGER" */ primarykey = 1 __13: ; @@ -144733,7 +147303,7 @@ __19: goto __20 } Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */))) - *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) = Xsqlite3MPrintf(tls, db, ts+27746 /* "no such table co..." */, libc.VaList(bp, zTableName, + *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) = Xsqlite3MPrintf(tls, db, ts+28252 /* "no such table co..." */, libc.VaList(bp, zTableName, zColumnName)) rc = SQLITE_ERROR __20: @@ -144751,7 +147321,7 @@ __20: } // Sleep for a little while. Return the amount of time slept. -func Xsqlite3_sleep(tls *libc.TLS, ms int32) int32 { /* sqlite3.c:164758:16: */ +func Xsqlite3_sleep(tls *libc.TLS, ms int32) int32 { /* sqlite3.c:167732:16: */ var pVfs uintptr var rc int32 pVfs = Xsqlite3_vfs_find(tls, uintptr(0)) @@ -144766,7 +147336,7 @@ func Xsqlite3_sleep(tls *libc.TLS, ms int32) int32 { /* sqlite3.c:164758:16: */ } // Enable or disable the extended result codes. -func Xsqlite3_extended_result_codes(tls *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:164774:16: */ +func Xsqlite3_extended_result_codes(tls *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:167748:16: */ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).FerrMask = func() int32 { if onoff != 0 { @@ -144779,7 +147349,7 @@ func Xsqlite3_extended_result_codes(tls *libc.TLS, db uintptr, onoff int32) int3 } // Invoke the xFileControl method on a particular database. -func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:164787:16: */ +func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:167761:16: */ var rc int32 = SQLITE_ERROR var pBtree uintptr @@ -144813,7 +147383,9 @@ func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, } rc = SQLITE_OK } else { + var nSave int32 = (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy rc = Xsqlite3OsFileControl(tls, fd, op, pArg) + (*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = nSave } Xsqlite3BtreeLeave(tls, pBtree) } @@ -144822,7 +147394,7 @@ func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, } // Interface to the testing logic. -func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:164835:16: */ +func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:167811:16: */ var rc int32 = 0 var ap Va_list _ = ap @@ -145034,7 +147606,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit case SQLITE_TESTCTRL_OPTIMIZATIONS: { var db uintptr = libc.VaUintptr(&ap) - (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags = (U16((int32(libc.VaInt32(&ap))) & 0xffff)) + (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags = U32(libc.VaUint32(&ap)) break } @@ -145057,7 +147629,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: { var db uintptr = libc.VaUintptr(&ap) - *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) ^= (DBFLAG_InternalFunc) + *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) ^= (U32(DBFLAG_InternalFunc)) break } @@ -145157,7 +147729,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit var db uintptr = libc.VaUintptr(&ap) Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(Xsqlite3FindDbName(tls, db, libc.VaUintptr(&ap))) - (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(libc.AssignBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.imposterTable */, uint32(libc.VaInt32(&ap)), 1, 1, 0x2)) + (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(libc.AssignBitFieldPtr8Uint32(db+184 /* &.init */ +8 /* &.imposterTable */, uint32(libc.VaInt32(&ap)), 1, 1, 0x2)) (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum = Pgno(libc.VaInt32(&ap)) if (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0) && ((*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum > Pgno(0)) { Xsqlite3ResetAllSchemasOfConnection(tls, db) @@ -145183,6 +147755,55 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit break } + + // sqlite3_test_control(SQLITE_TESTCTRL_SEEK_COUNT, + // sqlite3 *db, // Database connection + // u64 *pnSeek // Write seek count here + // ); + // + // This test-control queries the seek-counter on the "main" database + // file. The seek-counter is written into *pnSeek and is then reset. + // The seek-count is only available if compiled with SQLITE_DEBUG. + case SQLITE_TESTCTRL_SEEK_COUNT: + { + var db uintptr = libc.VaUintptr(&ap) + _ = db + var pn uintptr = libc.VaUintptr(&ap) + *(*U64)(unsafe.Pointer(pn)) = uint64(0) + _ = db // Silence harmless unused variable warning + break + + } + + // sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, op, ptr) + // + // "ptr" is a pointer to a u32. + // + // op==0 Store the current sqlite3SelectTrace in *ptr + // op==1 Set sqlite3SelectTrace to the value *ptr + // op==3 Store the current sqlite3WhereTrace in *ptr + // op==3 Set sqlite3WhereTrace to the value *ptr + case SQLITE_TESTCTRL_TRACEFLAGS: + { + var opTrace int32 = int32(libc.VaInt32(&ap)) + var ptr uintptr = libc.VaUintptr(&ap) + switch opTrace { + case 0: + *(*U32)(unsafe.Pointer(ptr)) = Xsqlite3SelectTrace + break + case 1: + Xsqlite3SelectTrace = *(*U32)(unsafe.Pointer(ptr)) + break + case 2: + *(*U32)(unsafe.Pointer(ptr)) = Xsqlite3WhereTrace + break + case 3: + Xsqlite3WhereTrace = *(*U32)(unsafe.Pointer(ptr)) + break + } + break + + } } _ = ap return rc @@ -145194,7 +147815,7 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlit // backwards for the first byte following four consecutive zero bytes. // // This only works if the filename passed in was obtained from the Pager. -func databaseName(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:165221:19: */ +func databaseName(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:168235:19: */ for (((int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-1)))) != 0) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-2)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-3)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-4)))) != 0) { zName-- } @@ -145203,7 +147824,7 @@ func databaseName(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:165221:19 // Append text z[] to the end of p[]. Return a pointer to the first // character after then zero terminator on the new text in p[]. -func appendText(tls *libc.TLS, p uintptr, z uintptr) uintptr { /* sqlite3.c:165232:13: */ +func appendText(tls *libc.TLS, p uintptr, z uintptr) uintptr { /* sqlite3.c:168246:13: */ var n Size_t = libc.Xstrlen(tls, z) libc.Xmemcpy(tls, p, z, (n + uint64(1))) return ((p + uintptr(n)) + uintptr(1)) @@ -145216,7 +147837,7 @@ func appendText(tls *libc.TLS, p uintptr, z uintptr) uintptr { /* sqlite3.c:1652 // // Memory layout must be compatible with that generated by the pager // and expected by sqlite3_uri_parameter() and databaseName(). -func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr, zWal uintptr, nParam int32, azParam uintptr) uintptr { /* sqlite3.c:165247:17: */ +func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr, zWal uintptr, nParam int32, azParam uintptr) uintptr { /* sqlite3.c:168261:17: */ var nByte Sqlite3_int64 var i int32 var pResult uintptr @@ -145247,7 +147868,7 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr // Free memory obtained from sqlite3_create_filename(). It is a severe // error to call this routine with any parameter other than a pointer // previously obtained from sqlite3_create_filename() or a NULL pointer. -func Xsqlite3_free_filename(tls *libc.TLS, p uintptr) { /* sqlite3.c:165283:17: */ +func Xsqlite3_free_filename(tls *libc.TLS, p uintptr) { /* sqlite3.c:168297:17: */ if p == uintptr(0) { return } @@ -145264,7 +147885,7 @@ func Xsqlite3_free_filename(tls *libc.TLS, p uintptr) { /* sqlite3.c:165283:17: // 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 *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:165301:23: */ +func Xsqlite3_uri_parameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:168315:23: */ if (zFilename == uintptr(0)) || (zParam == uintptr(0)) { return uintptr(0) } @@ -145273,7 +147894,7 @@ func Xsqlite3_uri_parameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) ui } // Return a pointer to the name of Nth query parameter of the filename. -func Xsqlite3_uri_key(tls *libc.TLS, zFilename uintptr, N int32) uintptr { /* sqlite3.c:165310:23: */ +func Xsqlite3_uri_key(tls *libc.TLS, zFilename uintptr, N int32) uintptr { /* sqlite3.c:168324:23: */ if (zFilename == uintptr(0)) || (N < 0) { return uintptr(0) } @@ -145290,7 +147911,7 @@ func Xsqlite3_uri_key(tls *libc.TLS, zFilename uintptr, N int32) uintptr { /* sq } // Return a boolean value for a query parameter. -func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt int32) int32 { /* sqlite3.c:165324:16: */ +func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt int32) int32 { /* sqlite3.c:168338:16: */ var z uintptr = Xsqlite3_uri_parameter(tls, zFilename, zParam) bDflt = (libc.Bool32(bDflt != 0)) if z != 0 { @@ -145300,7 +147921,7 @@ func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDfl } // Return a 64-bit integer value for a query parameter. -func Xsqlite3_uri_int64(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:165333:26: */ +func Xsqlite3_uri_int64(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:168347:26: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -145321,11 +147942,11 @@ func Xsqlite3_uri_int64(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt // passing free() a pointer that was not obtained from malloc() - it is // an error that we cannot easily detect but that will likely cause memory // corruption. -func Xsqlite3_filename_database(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:165356:23: */ +func Xsqlite3_filename_database(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:168370:23: */ return databaseName(tls, zFilename) } -func Xsqlite3_filename_journal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:165359:23: */ +func Xsqlite3_filename_journal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:168373:23: */ zFilename = databaseName(tls, zFilename) zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)) for *(*int8)(unsafe.Pointer(zFilename)) != 0 { @@ -145335,14 +147956,14 @@ func Xsqlite3_filename_journal(tls *libc.TLS, zFilename uintptr) uintptr { /* sq return (zFilename + uintptr(1)) } -func Xsqlite3_filename_wal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:165368:23: */ +func Xsqlite3_filename_wal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:168382:23: */ zFilename = Xsqlite3_filename_journal(tls, zFilename) zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1)) return zFilename } // Return the Btree pointer identified by zDbName. Return NULL if not found. -func Xsqlite3DbNameToBtree(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:165381:22: */ +func Xsqlite3DbNameToBtree(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:168395:22: */ var iDb int32 if zDbName != 0 { iDb = Xsqlite3FindDbName(tls, db, zDbName) @@ -145357,7 +147978,7 @@ func Xsqlite3DbNameToBtree(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { // Return the filename of the database associated with a database // connection. -func Xsqlite3_db_filename(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:165390:23: */ +func Xsqlite3_db_filename(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:168404:23: */ var pBt uintptr pBt = Xsqlite3DbNameToBtree(tls, db, zDbName) if pBt != 0 { @@ -145368,7 +147989,7 @@ func Xsqlite3_db_filename(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { // Return 1 if database is read-only or 0 if read/write. Return -1 if // no such database exists. -func Xsqlite3_db_readonly(tls *libc.TLS, db uintptr, zDbName uintptr) int32 { /* sqlite3.c:165406:16: */ +func Xsqlite3_db_readonly(tls *libc.TLS, db uintptr, zDbName uintptr) int32 { /* sqlite3.c:168420:16: */ var pBt uintptr pBt = Xsqlite3DbNameToBtree(tls, db, zDbName) if pBt != 0 { @@ -145379,7 +148000,7 @@ func Xsqlite3_db_readonly(tls *libc.TLS, db uintptr, zDbName uintptr) int32 { /* // Obtain a snapshot handle for the snapshot of database zDb currently // being read by handle db. -func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:165423:16: */ +func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:168437:16: */ var rc int32 = SQLITE_ERROR Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -145388,7 +148009,7 @@ func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot ui var iDb int32 = Xsqlite3FindDbName(tls, db, zDb) if (iDb == 0) || (iDb > 1) { var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt - if 0 == Xsqlite3BtreeIsInTrans(tls, pBt) { + if SQLITE_TXN_WRITE != Xsqlite3BtreeTxnState(tls, pBt) { rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0)) if rc == SQLITE_OK { rc = Xsqlite3PagerSnapshotGet(tls, Xsqlite3BtreePager(tls, pBt), ppSnapshot) @@ -145402,7 +148023,7 @@ func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot ui } // Open a read-transaction on the snapshot idendified by pSnapshot. -func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:165459:16: */ +func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:168473:16: */ var rc int32 = SQLITE_ERROR Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex) @@ -145411,10 +148032,10 @@ func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot ui iDb = Xsqlite3FindDbName(tls, db, zDb) if (iDb == 0) || (iDb > 1) { var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt - if Xsqlite3BtreeIsInTrans(tls, pBt) == 0 { + if Xsqlite3BtreeTxnState(tls, pBt) != SQLITE_TXN_WRITE { var pPager uintptr = Xsqlite3BtreePager(tls, pBt) var bUnlock int32 = 0 - if Xsqlite3BtreeIsInReadTrans(tls, pBt) != 0 { + if Xsqlite3BtreeTxnState(tls, pBt) != SQLITE_TXN_NONE { if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 { rc = Xsqlite3PagerSnapshotCheck(tls, pPager, pSnapshot) if rc == SQLITE_OK { @@ -145445,7 +148066,7 @@ func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot ui // Recover as many snapshots as possible from the wal file associated with // schema zDb of database db. -func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:165515:16: */ +func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:168529:16: */ var rc int32 = SQLITE_ERROR var iDb int32 @@ -145453,7 +148074,7 @@ func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32 { / iDb = Xsqlite3FindDbName(tls, db, zDb) if (iDb == 0) || (iDb > 1) { var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt - if 0 == Xsqlite3BtreeIsInReadTrans(tls, pBt) { + if SQLITE_TXN_NONE == Xsqlite3BtreeTxnState(tls, pBt) { rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0)) if rc == SQLITE_OK { rc = Xsqlite3PagerSnapshotRecover(tls, Xsqlite3BtreePager(tls, pBt)) @@ -145466,7 +148087,7 @@ func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32 { / } // Free a snapshot handle obtained from sqlite3_snapshot_get(). -func Xsqlite3_snapshot_free(tls *libc.TLS, pSnapshot uintptr) { /* sqlite3.c:165546:17: */ +func Xsqlite3_snapshot_free(tls *libc.TLS, pSnapshot uintptr) { /* sqlite3.c:168560:17: */ Xsqlite3_free(tls, pSnapshot) } @@ -145475,7 +148096,7 @@ func Xsqlite3_snapshot_free(tls *libc.TLS, pSnapshot uintptr) { /* sqlite3.c:165 // // The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix // is not required for a match. -func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sqlite3.c:165559:16: */ +func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sqlite3.c:168573:16: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -145487,7 +148108,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sql azCompileOpt = Xsqlite3CompileOptions(tls, bp /* &nOpt */) - if Xsqlite3_strnicmp(tls, zOptName, ts+27774 /* "SQLITE_" */, 7) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, ts+28280 /* "SQLITE_" */, 7) == 0 { zOptName += uintptr(7) } n = Xsqlite3Strlen30(tls, zOptName) @@ -145505,7 +148126,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sql // Return the N-th compile-time option string. If N is out of range, // return a NULL pointer. -func Xsqlite3_compileoption_get(tls *libc.TLS, N int32) uintptr { /* sqlite3.c:165592:23: */ +func Xsqlite3_compileoption_get(tls *libc.TLS, N int32) uintptr { /* sqlite3.c:168606:23: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -145550,14 +148171,14 @@ func Xsqlite3_compileoption_get(tls *libc.TLS, N int32) uintptr { /* sqlite3.c:1 // for which either sqlite3.pBlockingConnection or sqlite3.pUnlockConnection // is not NULL. This variable may only accessed while the STATIC_MAIN // mutex is held. -var sqlite3BlockedList uintptr = uintptr(0) /* sqlite3.c:165644:16 */ +var sqlite3BlockedList uintptr = uintptr(0) /* sqlite3.c:168658:16 */ // Remove connection db from the blocked connections list. If connection // db is not currently a part of the list, this function is a no-op. -func removeFromBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:165687:13: */ +func removeFromBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:168701:13: */ var pp uintptr - for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 792 /* &.pNextBlocked */) { + for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 800 /* &.pNextBlocked */) { if *(*uintptr)(unsafe.Pointer(pp)) == db { *(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNextBlocked break @@ -145567,23 +148188,23 @@ func removeFromBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:165687:13: // Add connection db to the blocked connections list. It is assumed // that it is not already a part of the list. -func addToBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:165702:13: */ +func addToBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:168716:13: */ var pp uintptr - for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).FxUnlockNotify != (*Sqlite3)(unsafe.Pointer(db)).FxUnlockNotify); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 792 /* &.pNextBlocked */) { + for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).FxUnlockNotify != (*Sqlite3)(unsafe.Pointer(db)).FxUnlockNotify); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 800 /* &.pNextBlocked */) { } (*Sqlite3)(unsafe.Pointer(db)).FpNextBlocked = *(*uintptr)(unsafe.Pointer(pp)) *(*uintptr)(unsafe.Pointer(pp)) = db } // Obtain the STATIC_MAIN mutex. -func enterMutex(tls *libc.TLS) { /* sqlite3.c:165717:13: */ +func enterMutex(tls *libc.TLS) { /* sqlite3.c:168731:13: */ Xsqlite3_mutex_enter(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)) } // Release the STATIC_MAIN mutex. -func leaveMutex(tls *libc.TLS) { /* sqlite3.c:165725:13: */ +func leaveMutex(tls *libc.TLS) { /* sqlite3.c:168739:13: */ Xsqlite3_mutex_leave(tls, Xsqlite3MutexAlloc(tls, SQLITE_MUTEX_STATIC_MAIN)) } @@ -145607,7 +148228,7 @@ func leaveMutex(tls *libc.TLS) { /* sqlite3.c:165725:13: */ // Each call to this routine overrides any prior callbacks registered // on the same "db". If xNotify==0 then any prior callbacks are immediately // cancelled. -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uintptr) int32 { /* sqlite3.c:165752:16: */ +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uintptr) int32 { /* sqlite3.c:168766:16: */ bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = pArg @@ -145648,7 +148269,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uin Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr { if rc != 0 { - return ts + 27782 /* "database is dead..." */ + return ts + 28288 /* "database is dead..." */ } return uintptr(0) }(), 0) @@ -145660,7 +148281,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uin // associated with connection db. The operation will return SQLITE_LOCKED // to the user because it requires a lock that will not be available // until connection pBlocker concludes its current transaction. -func Xsqlite3ConnectionBlocked(tls *libc.TLS, db uintptr, pBlocker uintptr) { /* sqlite3.c:165802:21: */ +func Xsqlite3ConnectionBlocked(tls *libc.TLS, db uintptr, pBlocker uintptr) { /* sqlite3.c:168816:21: */ enterMutex(tls) if ((*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection == uintptr(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FpUnlockConnection == uintptr(0)) { addToBlockedList(tls, db) @@ -145686,7 +148307,7 @@ func Xsqlite3ConnectionBlocked(tls *libc.TLS, db uintptr, pBlocker uintptr) { /* // 3) If the two steps above mean that pBlockingConnection==0 and // pUnlockConnection==0, remove the entry from the blocked connections // list. -func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:165830:21: */ +func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:168844:21: */ bp := tls.Alloc(128) defer tls.Free(128) @@ -145771,7 +148392,7 @@ func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:165830 *(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3)(unsafe.Pointer(p)).FpNextBlocked (*Sqlite3)(unsafe.Pointer(p)).FpNextBlocked = uintptr(0) } else { - pp = (p + 792 /* &.pNextBlocked */) + pp = (p + 800 /* &.pNextBlocked */) } } @@ -145784,7 +148405,7 @@ func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:165830 // This is called when the database connection passed as an argument is // being closed. The connection is removed from the blocked list. -func Xsqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { /* sqlite3.c:165929:21: */ +func Xsqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { /* sqlite3.c:168943:21: */ Xsqlite3ConnectionUnlocked(tls, db) enterMutex(tls) removeFromBlockedList(tls, db) @@ -146401,7 +149022,7 @@ var jsonIsSpace = [256]int8{ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), -} /* sqlite3.c:185497:19 */ +} /* sqlite3.c:188520:19 */ // Objects type JsonString1 = struct { @@ -146413,19 +149034,19 @@ type JsonString1 = struct { FbErr U8 FzSpace [100]int8 _ [2]byte -} /* sqlite3.c:185527:9 */ +} /* sqlite3.c:188550:9 */ // Objects -type JsonString = JsonString1 /* sqlite3.c:185527:27 */ +type JsonString = JsonString1 /* sqlite3.c:188550:27 */ type JsonNode1 = struct { FeType U8 FjnFlags U8 _ [2]byte Fn U32 Fu struct{ FzJContent uintptr } -} /* sqlite3.c:185528:9 */ +} /* sqlite3.c:188551:9 */ -type JsonNode = JsonNode1 /* sqlite3.c:185528:25 */ +type JsonNode = JsonNode1 /* sqlite3.c:188551:25 */ type JsonParse1 = struct { FnNode U32 FnAlloc U32 @@ -146438,9 +149059,9 @@ type JsonParse1 = struct { FnJson int32 FiHold U32 _ [4]byte -} /* sqlite3.c:185529:9 */ +} /* sqlite3.c:188552:9 */ -type JsonParse = JsonParse1 /* sqlite3.c:185529:26 */ +type JsonParse = JsonParse1 /* sqlite3.c:188552:26 */ // JSON type values @@ -146448,8 +149069,8 @@ type JsonParse = JsonParse1 /* sqlite3.c:185529:26 */ // Names of the various JSON types: var jsonType = [8]uintptr{ - ts + 7843 /* "null" */, ts + 9544 /* "true" */, ts + 9549 /* "false" */, ts + 7853 /* "integer" */, ts + 7848 /* "real" */, ts + 15886 /* "text" */, ts + 27805 /* "array" */, ts + 27811, /* "object" */ -} /* sqlite3.c:185562:19 */ + ts + 7936 /* "null" */, ts + 8738 /* "true" */, ts + 8743 /* "false" */, ts + 7946 /* "integer" */, ts + 7941 /* "real" */, ts + 16350 /* "text" */, ts + 28311 /* "array" */, ts + 28317, /* "object" */ +} /* sqlite3.c:188585:19 */ // Maximum nesting depth of JSON for this implementation. // @@ -146463,7 +149084,7 @@ var jsonType = [8]uintptr{ // // Set the JsonString object to an empty string -func jsonZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:185622:13: */ +func jsonZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:188645:13: */ (*JsonString)(unsafe.Pointer(p)).FzBuf = p + 34 /* &.zSpace */ (*JsonString)(unsafe.Pointer(p)).FnAlloc = U64(unsafe.Sizeof([100]int8{})) (*JsonString)(unsafe.Pointer(p)).FnUsed = uint64(0) @@ -146471,7 +149092,7 @@ func jsonZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:185622:13: */ } // Initialize the JsonString object -func jsonInit(tls *libc.TLS, p uintptr, pCtx uintptr) { /* sqlite3.c:185631:13: */ +func jsonInit(tls *libc.TLS, p uintptr, pCtx uintptr) { /* sqlite3.c:188654:13: */ (*JsonString)(unsafe.Pointer(p)).FpCtx = pCtx (*JsonString)(unsafe.Pointer(p)).FbErr = U8(0) jsonZero(tls, p) @@ -146479,7 +149100,7 @@ func jsonInit(tls *libc.TLS, p uintptr, pCtx uintptr) { /* sqlite3.c:185631:13: // Free all allocated memory and reset the JsonString object back to its // initial state. -func jsonReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:185641:13: */ +func jsonReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:188664:13: */ if !(int32((*JsonString)(unsafe.Pointer(p)).FbStatic) != 0) { Xsqlite3_free(tls, (*JsonString)(unsafe.Pointer(p)).FzBuf) } @@ -146487,7 +149108,7 @@ func jsonReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:185641:13: */ } // Report an out-of-memory (OOM) condition -func jsonOom(tls *libc.TLS, p uintptr) { /* sqlite3.c:185649:13: */ +func jsonOom(tls *libc.TLS, p uintptr) { /* sqlite3.c:188672:13: */ (*JsonString)(unsafe.Pointer(p)).FbErr = U8(1) Xsqlite3_result_error_nomem(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx) jsonReset(tls, p) @@ -146495,7 +149116,7 @@ func jsonOom(tls *libc.TLS, p uintptr) { /* sqlite3.c:185649:13: */ // Enlarge pJson->zBuf so that it can hold at least N more bytes. // Return zero on success. Return non-zero on an OOM error -func jsonGrow(tls *libc.TLS, p uintptr, N U32) int32 { /* sqlite3.c:185658:12: */ +func jsonGrow(tls *libc.TLS, p uintptr, N U32) int32 { /* sqlite3.c:188681:12: */ var nTotal U64 if U64(N) < (*JsonString)(unsafe.Pointer(p)).FnAlloc { nTotal = ((*JsonString)(unsafe.Pointer(p)).FnAlloc * uint64(2)) @@ -146528,7 +149149,7 @@ func jsonGrow(tls *libc.TLS, p uintptr, N U32) int32 { /* sqlite3.c:185658:12: * } // Append N bytes from zIn onto the end of the JsonString string. -func jsonAppendRaw(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:185685:13: */ +func jsonAppendRaw(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:188708:13: */ if N == U32(0) { return } @@ -146540,7 +149161,7 @@ func jsonAppendRaw(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c: } // Append formatted text (not to exceed N bytes) to the JsonString. -func jsonPrintf(tls *libc.TLS, N int32, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:185694:13: */ +func jsonPrintf(tls *libc.TLS, N int32, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:188717:13: */ var ap Va_list _ = ap if (((*JsonString)(unsafe.Pointer(p)).FnUsed + U64(N)) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, uint32(N)) != 0) { @@ -146553,7 +149174,7 @@ func jsonPrintf(tls *libc.TLS, N int32, p uintptr, zFormat uintptr, va uintptr) } // Append a single character -func jsonAppendChar(tls *libc.TLS, p uintptr, c int8) { /* sqlite3.c:185705:13: */ +func jsonAppendChar(tls *libc.TLS, p uintptr, c int8) { /* sqlite3.c:188728:13: */ if ((*JsonString)(unsafe.Pointer(p)).FnUsed >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, uint32(1)) != 0) { return } @@ -146562,7 +149183,7 @@ func jsonAppendChar(tls *libc.TLS, p uintptr, c int8) { /* sqlite3.c:185705:13: // Append a comma separator to the output buffer, if the previous // character is not '[' or '{'. -func jsonAppendSeparator(tls *libc.TLS, p uintptr) { /* sqlite3.c:185713:13: */ +func jsonAppendSeparator(tls *libc.TLS, p uintptr) { /* sqlite3.c:188736:13: */ var c int8 if (*JsonString)(unsafe.Pointer(p)).FnUsed == uint64(0) { return @@ -146577,7 +149198,7 @@ func jsonAppendSeparator(tls *libc.TLS, p uintptr) { /* sqlite3.c:185713:13: */ // under construction. Enclose the string in "..." and escape // any double-quotes or backslash characters contained within the // string. -func jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:185725:13: */ +func jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:188748:13: */ var i U32 var c uint8 if !((((U64(N) + (*JsonString)(unsafe.Pointer(p)).FnUsed) + uint64(2)) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, (N+U32(2))) != 0)) { @@ -146628,7 +149249,7 @@ __10: *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('0') *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('0') *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = (int8('0' + (int32(c) >> 4))) - c = uint8(*(*int8)(unsafe.Pointer(ts + 27818 /* "0123456789abcdef" */ + uintptr((int32(c) & 0xf))))) + c = uint8(*(*int8)(unsafe.Pointer(ts + 28324 /* "0123456789abcdef" */ + uintptr((int32(c) & 0xf))))) __8: ; __6: @@ -146648,15 +149269,15 @@ __4: var aSpecial = [32]int8{ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8('b'), int8('t'), int8('n'), int8(0), int8('f'), int8('r'), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), -} /* sqlite3.c:185736:25 */ +} /* sqlite3.c:188759:25 */ // Append a function parameter value to the JSON string under // construction. -func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:185768:13: */ +func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:188791:13: */ switch Xsqlite3_value_type(tls, pValue) { case SQLITE_NULL: { - jsonAppendRaw(tls, p, ts+7843 /* "null" */, uint32(4)) + jsonAppendRaw(tls, p, ts+7936 /* "null" */, uint32(4)) break } @@ -146674,7 +149295,7 @@ func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:18 { var z uintptr = Xsqlite3_value_text(tls, pValue) var n U32 = U32(Xsqlite3_value_bytes(tls, pValue)) - if Xsqlite3_value_subtype(tls, pValue) == JSON_SUBTYPE { + if Xsqlite3_value_subtype(tls, pValue) == uint32(JSON_SUBTYPE) { jsonAppendRaw(tls, p, z, n) } else { jsonAppendString(tls, p, z, n) @@ -146685,7 +149306,7 @@ func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:18 default: { if int32((*JsonString)(unsafe.Pointer(p)).FbErr) == 0 { - Xsqlite3_result_error(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx, ts+27835 /* "JSON cannot hold..." */, -1) + Xsqlite3_result_error(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx, ts+28341 /* "JSON cannot hold..." */, -1) (*JsonString)(unsafe.Pointer(p)).FbErr = U8(2) jsonReset(tls, p) } @@ -146696,7 +149317,7 @@ func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:18 } // Make the JSON in p the result of the SQL function. -func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:185808:13: */ +func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:188831:13: */ if int32((*JsonString)(unsafe.Pointer(p)).FbErr) == 0 { Xsqlite3_result_text64(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx, (*JsonString)(unsafe.Pointer(p)).FzBuf, (*JsonString)(unsafe.Pointer(p)).FnUsed, func() uintptr { @@ -146705,7 +149326,7 @@ func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:185808:13: */ } return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})) }(), - SQLITE_UTF8) + uint8(SQLITE_UTF8)) jsonZero(tls, p) } @@ -146723,7 +149344,7 @@ func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:185808:13: */ // Appended elements are not counted. The value returned is the number // by which the JsonNode counter should increment in order to go to the // next peer value. -func jsonNodeSize(tls *libc.TLS, pNode uintptr) U32 { /* sqlite3.c:185831:12: */ +func jsonNodeSize(tls *libc.TLS, pNode uintptr) U32 { /* sqlite3.c:188854:12: */ if int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) >= JSON_ARRAY { return ((*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1)) } @@ -146732,7 +149353,7 @@ func jsonNodeSize(tls *libc.TLS, pNode uintptr) U32 { /* sqlite3.c:185831:12: */ // Reclaim all memory allocated by a JsonParse object. But do not // delete the JsonParse object itself. -func jsonParseReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:185839:13: */ +func jsonParseReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:188862:13: */ Xsqlite3_free(tls, (*JsonParse)(unsafe.Pointer(pParse)).FaNode) (*JsonParse)(unsafe.Pointer(pParse)).FaNode = uintptr(0) (*JsonParse)(unsafe.Pointer(pParse)).FnNode = U32(0) @@ -146742,7 +149363,7 @@ func jsonParseReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:185839:13: */ } // Free a JsonParse object that was obtained from sqlite3_malloc(). -func jsonParseFree(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:185851:13: */ +func jsonParseFree(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:188874:13: */ jsonParseReset(tls, pParse) Xsqlite3_free(tls, pParse) } @@ -146750,7 +149371,7 @@ func jsonParseFree(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:185851:13: */ // Convert the JsonNode pNode into a pure JSON string and // append to pOut. Subsubstructure is also included. Return // the number of JsonNode objects that are encoded. -func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr) { /* sqlite3.c:185861:13: */ +func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr) { /* sqlite3.c:188884:13: */ if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & (JNODE_REPLACE | JNODE_PATCH)) != 0 { if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & JNODE_REPLACE) != 0 { jsonAppendValue(tls, pOut, *(*uintptr)(unsafe.Pointer(aReplace + uintptr(*(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)))*8))) @@ -146762,19 +149383,19 @@ func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr default: { - jsonAppendRaw(tls, pOut, ts+7843 /* "null" */, uint32(4)) + jsonAppendRaw(tls, pOut, ts+7936 /* "null" */, uint32(4)) break } case JSON_TRUE: { - jsonAppendRaw(tls, pOut, ts+9544 /* "true" */, uint32(4)) + jsonAppendRaw(tls, pOut, ts+8738 /* "true" */, uint32(4)) break } case JSON_FALSE: { - jsonAppendRaw(tls, pOut, ts+9549 /* "false" */, uint32(5)) + jsonAppendRaw(tls, pOut, ts+8743 /* "false" */, uint32(5)) break } @@ -146845,7 +149466,7 @@ func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr } // Return a JsonNode and all its descendents as a JSON string. -func jsonReturnJson(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:185943:13: */ +func jsonReturnJson(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:188966:13: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -146854,20 +149475,20 @@ func jsonReturnJson(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr jsonInit(tls, bp /* &s */, pCtx) jsonRenderNode(tls, pNode, bp /* &s */, aReplace) jsonResult(tls, bp /* &s */) - Xsqlite3_result_subtype(tls, pCtx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, pCtx, uint32(JSON_SUBTYPE)) } // 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 jsonHexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:185960:11: */ +func jsonHexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:188983:11: */ h = h + (9 * (1 & (h >> 6))) return (U8(h & 0xf)) } // Convert a 4-byte hex string into an integer -func jsonHexToInt4(tls *libc.TLS, z uintptr) U32 { /* sqlite3.c:185973:12: */ +func jsonHexToInt4(tls *libc.TLS, z uintptr) U32 { /* sqlite3.c:188996:12: */ var v U32 v = (U32((((int32(jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z))))) << 12) + @@ -146878,7 +149499,7 @@ func jsonHexToInt4(tls *libc.TLS, z uintptr) U32 { /* sqlite3.c:185973:12: */ } // Make the JsonNode the return value of the function. -func jsonReturn(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:185989:13: */ +func jsonReturn(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:189012:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -146999,7 +149620,7 @@ int_as_real: __6: z1 = *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)) - Xsqlite3AtoF(tls, z1, bp /* &r */, Xsqlite3Strlen30(tls, z1), SQLITE_UTF8) + Xsqlite3AtoF(tls, z1, bp /* &r */, Xsqlite3Strlen30(tls, z1), uint8(SQLITE_UTF8)) Xsqlite3_result_double(tls, pCtx, *(*float64)(unsafe.Pointer(bp /* r */))) goto __1 @@ -147155,7 +149776,7 @@ __1: // A macro to hint to the compiler that a function should not be // inlined. -func jsonParseAddNodeExpand(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:186153:26: */ +func jsonParseAddNodeExpand(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:189176:26: */ var nNew U32 var pNew uintptr @@ -147177,7 +149798,7 @@ func jsonParseAddNodeExpand(tls *libc.TLS, pParse uintptr, eType U32, n U32, zCo // Create a new JsonNode instance based on the arguments and append that // instance to the JsonParse. Return the index in pParse->aNode[] of the // new node, or -1 if a memory allocation fails. -func jsonParseAddNode(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:186180:12: */ +func jsonParseAddNode(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:189203:12: */ var p uintptr if (*JsonParse)(unsafe.Pointer(pParse)).FnNode >= (*JsonParse)(unsafe.Pointer(pParse)).FnAlloc { return jsonParseAddNodeExpand(tls, pParse, eType, n, zContent) @@ -147191,7 +149812,7 @@ func jsonParseAddNode(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent } // Return true if z[] begins with 4 (or more) hexadecimal digits -func jsonIs4Hex(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:186201:12: */ +func jsonIs4Hex(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:189224:12: */ var i int32 for i = 0; i < 4; i++ { if !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))]) & 0x08) != 0) { @@ -147207,7 +149828,7 @@ func jsonIs4Hex(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:186201:12: */ // Return negative for a syntax error. Special cases: return -2 if the // first non-whitespace character is '}' and return -3 if the first // non-whitespace character is ']'. -func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:186215:12: */ +func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:189238:12: */ var c int8 var j U32 var iThis int32 @@ -147219,7 +149840,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } if (int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(z + uintptr(i)))))) == '{' { // Parse object - iThis = jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(0), uintptr(0)) + iThis = jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(0), uintptr(0)) if iThis < 0 { return -1 } @@ -147276,7 +149897,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 return (int32(j + U32(1))) } else if int32(c) == '[' { // Parse array - iThis = jsonParseAddNode(tls, pParse, JSON_ARRAY, uint32(0), uintptr(0)) + iThis = jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(0), uintptr(0)) if iThis < 0 { return -1 } @@ -147325,7 +149946,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 if ((((((((int32(c) == '"') || (int32(c) == '\\')) || (int32(c) == '/')) || (int32(c) == 'b')) || (int32(c) == 'f')) || (int32(c) == 'n')) || (int32(c) == 'r')) || (int32(c) == 't')) || ((int32(c) == 'u') && (jsonIs4Hex(tls, ((z+uintptr(j))+uintptr(1))) != 0)) { - jnFlags = JNODE_ESCAPE + jnFlags = U8(JNODE_ESCAPE) } else { return -1 } @@ -147334,25 +149955,25 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } j++ } - jsonParseAddNode(tls, pParse, JSON_STRING, ((j + U32(1)) - i), (z + uintptr(i))) + jsonParseAddNode(tls, pParse, uint32(JSON_STRING), ((j + U32(1)) - i), (z + uintptr(i))) if !(int32((*JsonParse)(unsafe.Pointer(pParse)).Foom) != 0) { (*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*16)).FjnFlags = jnFlags } return (int32(j + U32(1))) } else if ((int32(c) == 'n') && - (libc.Xstrncmp(tls, (z+uintptr(i)), ts+7843 /* "null" */, uint64(4)) == 0)) && + (libc.Xstrncmp(tls, (z+uintptr(i)), ts+7936 /* "null" */, uint64(4)) == 0)) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(4))))))]) & 0x06) != 0) { - jsonParseAddNode(tls, pParse, JSON_NULL, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_NULL), uint32(0), uintptr(0)) return (int32(i + U32(4))) } else if ((int32(c) == 't') && - (libc.Xstrncmp(tls, (z+uintptr(i)), ts+9544 /* "true" */, uint64(4)) == 0)) && + (libc.Xstrncmp(tls, (z+uintptr(i)), ts+8738 /* "true" */, uint64(4)) == 0)) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(4))))))]) & 0x06) != 0) { - jsonParseAddNode(tls, pParse, JSON_TRUE, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_TRUE), uint32(0), uintptr(0)) return (int32(i + U32(4))) } else if ((int32(c) == 'f') && - (libc.Xstrncmp(tls, (z+uintptr(i)), ts+9549 /* "false" */, uint64(5)) == 0)) && + (libc.Xstrncmp(tls, (z+uintptr(i)), ts+8743 /* "false" */, uint64(5)) == 0)) && !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(5))))))]) & 0x06) != 0) { - jsonParseAddNode(tls, pParse, JSON_FALSE, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_FALSE), uint32(0), uintptr(0)) return (int32(i + U32(5))) } else if (int32(c) == '-') || ((int32(c) >= '0') && (int32(c) <= '9')) { // Parse number @@ -147410,9 +150031,9 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 } jsonParseAddNode(tls, pParse, func() uint32 { if seenDP != 0 { - return JSON_REAL + return uint32(JSON_REAL) } - return JSON_INT + return uint32(JSON_INT) }(), (j - i), (z + uintptr(i))) return int32(j) @@ -147433,7 +150054,7 @@ func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:1 // pParse. // // pParse is uninitialized when this routine is called. -func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32 { /* sqlite3.c:186375:12: */ +func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32 { /* sqlite3.c:189398:12: */ var i int32 libc.Xmemset(tls, pParse, 0, uint64(unsafe.Sizeof(JsonParse{}))) if zJson == uintptr(0) { @@ -147458,7 +150079,7 @@ func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32 if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, ts+27864 /* "malformed JSON" */, -1) + Xsqlite3_result_error(tls, pCtx, ts+28370 /* "malformed JSON" */, -1) } } jsonParseReset(tls, pParse) @@ -147469,7 +150090,7 @@ func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32 // Mark node i of pParse as being a child of iParent. Call recursively // to fill in all the descendants of node i. -func jsonParseFillInParentage(tls *libc.TLS, pParse uintptr, i U32, iParent U32) { /* sqlite3.c:186408:13: */ +func jsonParseFillInParentage(tls *libc.TLS, pParse uintptr, i U32, iParent U32) { /* sqlite3.c:189431:13: */ var pNode uintptr = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(i)*16) var j U32 *(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaUp + uintptr(i)*4)) = iParent @@ -147500,7 +150121,7 @@ func jsonParseFillInParentage(tls *libc.TLS, pParse uintptr, i U32, iParent U32) } // Compute the parentage of all nodes in a completed parse. -func jsonParseFindParents(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:186435:12: */ +func jsonParseFindParents(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:189458:12: */ var aUp uintptr aUp = libc.AssignPtrUintptr(pParse+24 /* &.aUp */, Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(U32(0)))*uint64((*JsonParse)(unsafe.Pointer(pParse)).FnNode))))) @@ -147520,7 +150141,7 @@ func jsonParseFindParents(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:18 // is no longer valid, parse the JSON again and return the new parse, // and also register the new parse so that it will be available for // future sqlite3_get_auxdata() calls. -func jsonParseCached(tls *libc.TLS, pCtx uintptr, argv uintptr, pErrCtx uintptr) uintptr { /* sqlite3.c:186461:18: */ +func jsonParseCached(tls *libc.TLS, pCtx uintptr, argv uintptr, pErrCtx uintptr) uintptr { /* sqlite3.c:189484:18: */ var zJson uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) var nJson int32 = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) var p uintptr @@ -147577,7 +150198,7 @@ func jsonParseCached(tls *libc.TLS, pCtx uintptr, argv uintptr, pErrCtx uintptr) // Compare the OBJECT label at pNode against zKey,nKey. Return true on // a match. -func jsonLabelCompare(tls *libc.TLS, pNode uintptr, zKey uintptr, nKey U32) int32 { /* sqlite3.c:186523:12: */ +func jsonLabelCompare(tls *libc.TLS, pNode uintptr, zKey uintptr, nKey U32) int32 { /* sqlite3.c:189546:12: */ if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & JNODE_RAW) != 0 { if (*JsonNode)(unsafe.Pointer(pNode)).Fn != nKey { return 0 @@ -147599,7 +150220,7 @@ func jsonLabelCompare(tls *libc.TLS, pNode uintptr, zKey uintptr, nKey U32) int3 // If pApnd!=0, then try to append new nodes to complete zPath if it is // possible to do so and if no existing node corresponds to zPath. If // new nodes are appended *pApnd is set to 1. -func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:186545:17: */ +func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:189568:17: */ var i U32 var j U32 var nKey U32 @@ -147657,8 +150278,8 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp var iStart U32 var iLabel U32 var pNode uintptr - iStart = U32(jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(2), uintptr(0))) - iLabel = U32(jsonParseAddNode(tls, pParse, JSON_STRING, nKey, zKey)) + iStart = U32(jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(2), uintptr(0))) + iLabel = U32(jsonParseAddNode(tls, pParse, uint32(JSON_STRING), nKey, zKey)) zPath += uintptr(i) pNode = jsonLookupAppend(tls, pParse, zPath, pApnd, pzErr) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { @@ -147747,7 +150368,7 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp if (i == U32(0)) && (pApnd != 0) { var iStart U32 var pNode uintptr - iStart = U32(jsonParseAddNode(tls, pParse, JSON_ARRAY, uint32(1), uintptr(0))) + iStart = U32(jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(1), uintptr(0))) pNode = jsonLookupAppend(tls, pParse, zPath, pApnd, pzErr) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return uintptr(0) @@ -147767,19 +150388,19 @@ func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pAp // Append content to pParse that will complete zPath. Return a pointer // to the inserted node, or return NULL if the append fails. -func jsonLookupAppend(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:186690:17: */ +func jsonLookupAppend(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:189713:17: */ *(*int32)(unsafe.Pointer(pApnd)) = 1 if int32(*(*int8)(unsafe.Pointer(zPath))) == 0 { - jsonParseAddNode(tls, pParse, JSON_NULL, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_NULL), uint32(0), uintptr(0)) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return uintptr(0) } return ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*16) } if int32(*(*int8)(unsafe.Pointer(zPath))) == '.' { - jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(0), uintptr(0)) - } else if libc.Xstrncmp(tls, zPath, ts+27879 /* "[0]" */, uint64(3)) == 0 { - jsonParseAddNode(tls, pParse, JSON_ARRAY, uint32(0), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(0), uintptr(0)) + } else if libc.Xstrncmp(tls, zPath, ts+28385 /* "[0]" */, uint64(3)) == 0 { + jsonParseAddNode(tls, pParse, uint32(JSON_ARRAY), uint32(0), uintptr(0)) } else { return uintptr(0) } @@ -147791,11 +150412,11 @@ func jsonLookupAppend(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintpt // Return the text of a syntax error message on a JSON path. Space is // obtained from sqlite3_malloc(). -func jsonPathSyntaxError(tls *libc.TLS, zErr uintptr) uintptr { /* sqlite3.c:186716:13: */ +func jsonPathSyntaxError(tls *libc.TLS, zErr uintptr) uintptr { /* sqlite3.c:189739:13: */ bp := tls.Alloc(8) defer tls.Free(8) - return Xsqlite3_mprintf(tls, ts+27883 /* "JSON path error ..." */, libc.VaList(bp, zErr)) + return Xsqlite3_mprintf(tls, ts+28389 /* "JSON path error ..." */, libc.VaList(bp, zErr)) } // Do a node lookup using zPath. Return a pointer to the node on success. @@ -147806,7 +150427,7 @@ func jsonPathSyntaxError(tls *libc.TLS, zErr uintptr) uintptr { /* sqlite3.c:186 // // If pApnd!=NULL then try to append missing nodes and set *pApnd = 1 if // nodes are appended. -func jsonLookup(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pCtx uintptr) uintptr { /* sqlite3.c:186730:17: */ +func jsonLookup(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pCtx uintptr) uintptr { /* sqlite3.c:189753:17: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -147858,18 +150479,18 @@ __5: // Report the wrong number of arguments for json_insert(), json_replace() // or json_set(). -func jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { /* sqlite3.c:186767:13: */ +func jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { /* sqlite3.c:189790:13: */ bp := tls.Alloc(8) defer tls.Free(8) - var zMsg uintptr = Xsqlite3_mprintf(tls, ts+27909, /* "json_%s() needs ..." */ + var zMsg uintptr = Xsqlite3_mprintf(tls, ts+28415, /* "json_%s() needs ..." */ libc.VaList(bp, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -1) Xsqlite3_free(tls, zMsg) } // Mark all NULL entries in the Object passed in as JNODE_REMOVE. -func jsonRemoveAllNulls(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:186780:13: */ +func jsonRemoveAllNulls(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:189803:13: */ var i int32 var n int32 @@ -147900,7 +150521,7 @@ func jsonRemoveAllNulls(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:186780:13: // corresponding to the SQL value input. Mostly this means putting // double-quotes around strings and returning the unquoted string "null" // when given a NULL input. -func jsonQuoteFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:186865:13: */ +func jsonQuoteFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:189888:13: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -147911,13 +150532,13 @@ func jsonQuoteFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq jsonInit(tls, bp /* &jx */, ctx) jsonAppendValue(tls, bp /* &jx */, *(*uintptr)(unsafe.Pointer(argv))) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } // Implementation of the json_array(VALUE,...) function. Return a JSON // array that contains all values given in arguments. Or if any argument // is a BLOB, throw an error. -func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:186884:13: */ +func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:189907:13: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -147932,7 +150553,7 @@ func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq } jsonAppendChar(tls, bp /* &jx */, int8(']')) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } // json_array_length(JSON) @@ -147940,7 +150561,7 @@ func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq // // Return the number of elements in the top-level JSON array. // Return 0 if the input is not a well-formed JSON array. -func jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:186911:13: */ +func jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:189934:13: */ var p uintptr // The parse var n Sqlite3_int64 = int64(0) var i U32 @@ -147975,7 +150596,7 @@ func jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { // PATH element. If there are multiple PATHs, then return a JSON array // with the result from each path. Throw an error if the JSON or any PATH // is malformed. -func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:186950:13: */ +func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:189973:13: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -148006,7 +150627,7 @@ func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* if pNode != 0 { jsonRenderNode(tls, pNode, bp /* &jx */, uintptr(0)) } else { - jsonAppendRaw(tls, bp /* &jx */, ts+7843 /* "null" */, uint32(4)) + jsonAppendRaw(tls, bp /* &jx */, ts+7936 /* "null" */, uint32(4)) } } else if pNode != 0 { jsonReturn(tls, pNode, ctx, uintptr(0)) @@ -148015,13 +150636,13 @@ func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* if (argc > 2) && (i == argc) { jsonAppendChar(tls, bp /* &jx */, int8(']')) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } jsonReset(tls, bp /* &jx */) } // This is the RFC 7396 MergePatch algorithm. -func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) uintptr { /* sqlite3.c:186991:17: */ +func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) uintptr { /* sqlite3.c:190014:17: */ var i U32 var j U32 var iRoot U32 @@ -148069,9 +150690,9 @@ func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) if (j >= (*JsonNode)(unsafe.Pointer(pTarget)).Fn) && (int32((*JsonNode)(unsafe.Pointer(pPatch+uintptr((i+U32(1)))*16)).FeType) != JSON_NULL) { var iStart int32 var iPatch int32 - iStart = jsonParseAddNode(tls, pParse, JSON_OBJECT, uint32(2), uintptr(0)) - jsonParseAddNode(tls, pParse, JSON_STRING, nKey, zKey) - iPatch = jsonParseAddNode(tls, pParse, JSON_TRUE, uint32(0), uintptr(0)) + iStart = jsonParseAddNode(tls, pParse, uint32(JSON_OBJECT), uint32(2), uintptr(0)) + jsonParseAddNode(tls, pParse, uint32(JSON_STRING), nKey, zKey) + iPatch = jsonParseAddNode(tls, pParse, uint32(JSON_TRUE), uint32(0), uintptr(0)) if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 { return uintptr(0) } @@ -148090,7 +150711,7 @@ func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) // Implementation of the json_mergepatch(JSON1,JSON2) function. Return a JSON // object that is the result of running the RFC 7396 MergePatch() algorithm // on the two arguments. -func jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187061:13: */ +func jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190084:13: */ bp := tls.Alloc(96) defer tls.Free(96) @@ -148122,7 +150743,7 @@ func jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq // Implementation of the json_object(NAME,VALUE,...) function. Return a JSON // object that contains all name/value given in arguments. Or if any name // is not a string or if any value is a BLOB, throw an error. -func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187093:13: */ +func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190116:13: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -148134,14 +150755,14 @@ func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* s if (argc & 1) != 0 { Xsqlite3_result_error(tls, ctx, - ts+27952 /* "json_object() re..." */, -1) + ts+28458 /* "json_object() re..." */, -1) return } jsonInit(tls, bp /* &jx */, ctx) jsonAppendChar(tls, bp /* &jx */, int8('{')) for i = 0; i < argc; i = i + (2) { if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != SQLITE_TEXT { - Xsqlite3_result_error(tls, ctx, ts+28003 /* "json_object() la..." */, -1) + Xsqlite3_result_error(tls, ctx, ts+28509 /* "json_object() la..." */, -1) jsonReset(tls, bp /* &jx */) return } @@ -148154,14 +150775,14 @@ func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* s } jsonAppendChar(tls, bp /* &jx */, int8('}')) jsonResult(tls, bp /* &jx */) - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } // json_remove(JSON, PATH, ...) // // Remove the named elements from JSON and return the result. malformed // JSON or PATH arguments result in an error. -func jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187135:13: */ +func jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190158:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -148230,7 +150851,7 @@ remove_done: // // Replace the value at PATH with VALUE. If PATH does not already exist, // this routine is a no-op. If JSON or PATH is malformed, throw an error. -func jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187168:13: */ +func jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190191:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -148249,7 +150870,7 @@ __1: if !((argc & 1) == 0) { goto __2 } - jsonWrongNumArgs(tls, ctx, ts+16399 /* "replace" */) + jsonWrongNumArgs(tls, ctx, ts+16861 /* "replace" */) return __2: ; @@ -148276,7 +150897,7 @@ __7: if !(pNode != 0) { goto __8 } - *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(JNODE_REPLACE))) + *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(U8(JNODE_REPLACE)))) *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = (i + U32(1)) __8: ; @@ -148310,7 +150931,7 @@ replace_err: // // Create PATH and initialize it to VALUE. If PATH already exists, this // routine is a no-op. If JSON or PATH is malformed, throw an error. -func jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187215:13: */ +func jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190238:13: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -148335,9 +150956,9 @@ __1: } jsonWrongNumArgs(tls, ctx, func() uintptr { if bIsSet != 0 { - return ts + 28037 /* "set" */ + return ts + 28543 /* "set" */ } - return ts + 28041 /* "insert" */ + return ts + 28547 /* "insert" */ }()) return __2: @@ -148373,7 +150994,7 @@ __9: if !((pNode != 0) && ((*(*int32)(unsafe.Pointer(bp + 48 /* bApnd */)) != 0) || (bIsSet != 0))) { goto __11 } - *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(JNODE_REPLACE))) + *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(U8(JNODE_REPLACE)))) *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = (i + U32(1)) __11: ; @@ -148406,7 +151027,7 @@ jsonSetDone: // // Return the top-level "type" of a JSON string. Throw an error if // either the JSON or PATH inputs are not well-formed. -func jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187264:13: */ +func jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190287:13: */ var p uintptr // The parse var zPath uintptr var pNode uintptr @@ -148430,7 +151051,7 @@ func jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sql // // Return 1 if JSON is a well-formed JSON string according to RFC-7159. // Return 0 otherwise. -func jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187292:13: */ +func jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190315:13: */ var p uintptr // The parse _ = argc p = jsonParseCached(tls, ctx, argv, uintptr(0)) @@ -148444,7 +151065,7 @@ func jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq // json_group_array(VALUE) // // Return a JSON array composed of all values in the aggregate. -func jsonArrayStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187312:13: */ +func jsonArrayStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190335:13: */ var pStr uintptr _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(JsonString{}))) @@ -148460,7 +151081,7 @@ func jsonArrayStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sq } } -func jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:187331:13: */ +func jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:190354:13: */ var pStr uintptr pStr = Xsqlite3_aggregate_context(tls, ctx, 0) if pStr != 0 { @@ -148485,16 +151106,16 @@ func jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c: (*JsonString)(unsafe.Pointer(pStr)).FnUsed-- } } else { - Xsqlite3_result_text(tls, ctx, ts+28048 /* "[]" */, 2, uintptr(0)) + Xsqlite3_result_text(tls, ctx, ts+28554 /* "[]" */, 2, uintptr(0)) } - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } -func jsonArrayValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187353:13: */ +func jsonArrayValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:190376:13: */ jsonArrayCompute(tls, ctx, 0) } -func jsonArrayFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187356:13: */ +func jsonArrayFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:190379:13: */ jsonArrayCompute(tls, ctx, 1) } @@ -148502,7 +151123,7 @@ func jsonArrayFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187356:13: */ // It works by removing the first element of the group by searching forward // to the first comma (",") that is not within a string and deleting all // text through that comma. -func jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187367:13: */ +func jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190390:13: */ var i uint32 var inStr int32 = 0 var nNest int32 = 0 @@ -148543,7 +151164,7 @@ func jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* // json_group_obj(NAME,VALUE) // // Return a JSON object composed of all names and values in the aggregate. -func jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187414:13: */ +func jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:190437:13: */ var pStr uintptr var z uintptr var n U32 @@ -148565,7 +151186,7 @@ func jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* s } } -func jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:187439:13: */ +func jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:190462:13: */ var pStr uintptr pStr = Xsqlite3_aggregate_context(tls, ctx, 0) if pStr != 0 { @@ -148589,16 +151210,16 @@ func jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c (*JsonString)(unsafe.Pointer(pStr)).FnUsed-- } } else { - Xsqlite3_result_text(tls, ctx, ts+28051 /* "{}" */, 2, uintptr(0)) + Xsqlite3_result_text(tls, ctx, ts+28557 /* "{}" */, 2, uintptr(0)) } - Xsqlite3_result_subtype(tls, ctx, JSON_SUBTYPE) + Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } -func jsonObjectValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187460:13: */ +func jsonObjectValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:190483:13: */ jsonObjectCompute(tls, ctx, 0) } -func jsonObjectFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187463:13: */ +func jsonObjectFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:190486:13: */ jsonObjectCompute(tls, ctx, 1) } @@ -148618,16 +151239,16 @@ type JsonEachCursor1 = struct { FzJson uintptr FzRoot uintptr FsParse JsonParse -} /* sqlite3.c:187473:9 */ +} /* sqlite3.c:190496:9 */ // *************************************************************************** // // The json_each virtual table // -type JsonEachCursor = JsonEachCursor1 /* sqlite3.c:187473:31 */ +type JsonEachCursor = JsonEachCursor1 /* sqlite3.c:190496:31 */ // Constructor for the json_each virtual table -func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:187488:12: */ +func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:190511:12: */ var pNew uintptr var rc int32 @@ -148642,7 +151263,7 @@ func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv u _ = pAux rc = Xsqlite3_declare_vtab(tls, db, - ts+28054 /* "CREATE TABLE x(k..." */) + ts+28560 /* "CREATE TABLE x(k..." */) if rc == SQLITE_OK { pNew = libc.AssignPtrUintptr(ppVtab, Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Sqlite3_vtab{})))) if pNew == uintptr(0) { @@ -148655,13 +151276,13 @@ func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv u } // destructor for json_each virtual table -func jsonEachDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:187530:12: */ +func jsonEachDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:190553:12: */ Xsqlite3_free(tls, pVtab) return SQLITE_OK } // constructor for a JsonEachCursor object for json_each(). -func jsonEachOpenEach(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:187536:12: */ +func jsonEachOpenEach(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:190559:12: */ var pCur uintptr _ = p @@ -148675,7 +151296,7 @@ func jsonEachOpenEach(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sql } // constructor for a JsonEachCursor object for json_tree(). -func jsonEachOpenTree(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:187548:12: */ +func jsonEachOpenTree(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:190571:12: */ var rc int32 = jsonEachOpenEach(tls, p, ppCursor) if rc == SQLITE_OK { var pCur uintptr = *(*uintptr)(unsafe.Pointer(ppCursor)) @@ -148686,7 +151307,7 @@ func jsonEachOpenTree(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sql // Reset a JsonEachCursor back to its original state. Free any memory // held. -func jsonEachCursorReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:187559:13: */ +func jsonEachCursorReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:190582:13: */ Xsqlite3_free(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzJson) Xsqlite3_free(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot) jsonParseReset(tls, (p + 48 /* &.sParse */)) @@ -148699,7 +151320,7 @@ func jsonEachCursorReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:187559:13: */ } // Destructor for a jsonEachCursor object -func jsonEachClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:187572:12: */ +func jsonEachClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:190595:12: */ var p uintptr = cur jsonEachCursorReset(tls, p) Xsqlite3_free(tls, cur) @@ -148708,13 +151329,13 @@ func jsonEachClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:187572:12: * // Return TRUE if the jsonEachCursor object has been advanced off the end // of the JSON object -func jsonEachEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:187581:12: */ +func jsonEachEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:190604:12: */ var p uintptr = cur return (libc.Bool32((*JsonEachCursor)(unsafe.Pointer(p)).Fi >= (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd)) } // Advance the cursor to the next element for json_tree() -func jsonEachNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:187587:12: */ +func jsonEachNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:190610:12: */ var p uintptr = cur if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 { if (int32((*JsonNode)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*16)).FjnFlags) & JNODE_LABEL) != 0 { @@ -148764,7 +151385,7 @@ func jsonEachNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:187587:12: */ } // Append the name of the path for element i to pStr -func jsonEachComputePath(tls *libc.TLS, p uintptr, pStr uintptr, i U32) { /* sqlite3.c:187628:13: */ +func jsonEachComputePath(tls *libc.TLS, p uintptr, pStr uintptr, i U32) { /* sqlite3.c:190651:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -148780,19 +151401,19 @@ func jsonEachComputePath(tls *libc.TLS, p uintptr, pStr uintptr, i U32) { /* sql pNode = ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(i)*16) pUp = ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(iUp)*16) if int32((*JsonNode)(unsafe.Pointer(pUp)).FeType) == JSON_ARRAY { - jsonPrintf(tls, 30, pStr, ts+28137 /* "[%d]" */, libc.VaList(bp, *(*U32)(unsafe.Pointer(pUp + 8 /* &.u */)))) + jsonPrintf(tls, 30, pStr, ts+28643 /* "[%d]" */, libc.VaList(bp, *(*U32)(unsafe.Pointer(pUp + 8 /* &.u */)))) } else { if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & JNODE_LABEL) == 0 { pNode -= 16 } - jsonPrintf(tls, (int32((*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1))), pStr, ts+28142 /* ".%.*s" */, libc.VaList(bp+8, ((*JsonNode)(unsafe.Pointer(pNode)).Fn-U32(2)), (*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))+uintptr(1)))) + jsonPrintf(tls, (int32((*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1))), pStr, ts+28648 /* ".%.*s" */, libc.VaList(bp+8, ((*JsonNode)(unsafe.Pointer(pNode)).Fn-U32(2)), (*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))+uintptr(1)))) } } // Return the value of a column -func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:187655:12: */ +func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:190678:12: */ bp := tls.Alloc(296) defer tls.Free(296) @@ -148880,9 +151501,9 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* jsonAppendChar(tls, bp+24 /* &x */, int8('$')) } if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == JSON_ARRAY { - jsonPrintf(tls, 30, bp+24 /* &x */, ts+28137 /* "[%d]" */, libc.VaList(bp, (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid)) + jsonPrintf(tls, 30, bp+24 /* &x */, ts+28643 /* "[%d]" */, libc.VaList(bp, (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid)) } else if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == JSON_OBJECT { - jsonPrintf(tls, int32((*JsonNode)(unsafe.Pointer(pThis)).Fn), bp+24 /* &x */, ts+28142 /* ".%.*s" */, libc.VaList(bp+8, ((*JsonNode)(unsafe.Pointer(pThis)).Fn-U32(2)), (*(*uintptr)(unsafe.Pointer(pThis + 8 /* &.u */))+uintptr(1)))) + jsonPrintf(tls, int32((*JsonNode)(unsafe.Pointer(pThis)).Fn), bp+24 /* &x */, ts+28648 /* ".%.*s" */, libc.VaList(bp+8, ((*JsonNode)(unsafe.Pointer(pThis)).Fn-U32(2)), (*(*uintptr)(unsafe.Pointer(pThis + 8 /* &.u */))+uintptr(1)))) } } jsonResult(tls, bp+24 /* &x */) @@ -148906,7 +151527,7 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* { var zRoot uintptr = (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot if zRoot == uintptr(0) { - zRoot = ts + 28148 /* "$" */ + zRoot = ts + 28654 /* "$" */ } Xsqlite3_result_text(tls, ctx, zRoot, -1, uintptr(0)) break @@ -148924,7 +151545,7 @@ func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* } // Return the current rowid value -func jsonEachRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:187754:12: */ +func jsonEachRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:190777:12: */ var p uintptr = cur *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = Sqlite_int64((*JsonEachCursor)(unsafe.Pointer(p)).FiRowid) return SQLITE_OK @@ -148934,7 +151555,7 @@ func jsonEachRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite // column. Without such a constraint, the table cannot operate. idxNum is // 1 if the constraint is found, 3 if the constraint and zRoot are found, // and 0 otherwise. -func jsonEachBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:187765:12: */ +func jsonEachBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:190788:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -149009,7 +151630,7 @@ __3: } // Start a search on a new JSON string -func jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:187823:12: */ +func jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:190846:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -149038,7 +151659,7 @@ func jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, ar var rc int32 = SQLITE_NOMEM if int32((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.Foom) == 0 { Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+27864 /* "malformed JSON" */, 0) + (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+28370 /* "malformed JSON" */, 0) if (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { rc = SQLITE_ERROR } @@ -149113,7 +151734,7 @@ var jsonEachModule = Sqlite3_module{ // xCreate FxEof: 0, // xEof - check for end of scan FxColumn: 0, // xColumn - read data FxRowid: 0, // xShadowName -} /* sqlite3.c:187902:23 */ +} /* sqlite3.c:190925:23 */ // The methods of the json_tree virtual table. var jsonTreeModule = Sqlite3_module{ // xCreate @@ -149127,7 +151748,7 @@ var jsonTreeModule = Sqlite3_module{ // xCreate FxEof: 0, // xEof - check for end of scan FxColumn: 0, // xColumn - read data FxRowid: 0, // xShadowName -} /* sqlite3.c:187930:23 */ +} /* sqlite3.c:190953:23 */ // *************************************************************************** // @@ -149136,7 +151757,7 @@ var jsonTreeModule = Sqlite3_module{ // xCreate // functions and the virtual table implemented by this file. // -func Xsqlite3Json1Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:187964:20: */ +func Xsqlite3Json1Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:190987:20: */ var rc int32 = SQLITE_OK var i uint32 for i = uint32(0); (uint64(i) < (uint64(unsafe.Sizeof(aFunc)) / uint64(unsafe.Sizeof(struct { @@ -149179,22 +151800,22 @@ var aFunc = [15]struct { Fflag int32 FxFunc uintptr }{ - {FzName: ts + 28150 /* "json" */, FnArg: 1, FxFunc: 0}, - {FzName: ts + 28155 /* "json_array" */, FnArg: -1, FxFunc: 0}, - {FzName: ts + 28166 /* "json_array_lengt..." */, FnArg: 1, FxFunc: 0}, - {FzName: ts + 28166 /* "json_array_lengt..." */, FnArg: 2, FxFunc: 0}, - {FzName: ts + 28184 /* "json_extract" */, FnArg: -1, FxFunc: 0}, - {FzName: ts + 28197 /* "json_insert" */, FnArg: -1, FxFunc: 0}, - {FzName: ts + 28209 /* "json_object" */, FnArg: -1, FxFunc: 0}, - {FzName: ts + 28221 /* "json_patch" */, FnArg: 2, FxFunc: 0}, - {FzName: ts + 28232 /* "json_quote" */, FnArg: 1, FxFunc: 0}, - {FzName: ts + 28243 /* "json_remove" */, FnArg: -1, FxFunc: 0}, - {FzName: ts + 28255 /* "json_replace" */, FnArg: -1, FxFunc: 0}, - {FzName: ts + 28268 /* "json_set" */, FnArg: -1, Fflag: 1, FxFunc: 0}, - {FzName: ts + 28277 /* "json_type" */, FnArg: 1, FxFunc: 0}, - {FzName: ts + 28277 /* "json_type" */, FnArg: 2, FxFunc: 0}, - {FzName: ts + 28287 /* "json_valid" */, FnArg: 1, FxFunc: 0}, -} /* sqlite3.c:187972:5 */ + {FzName: ts + 28656 /* "json" */, FnArg: 1, FxFunc: 0}, + {FzName: ts + 28661 /* "json_array" */, FnArg: -1, FxFunc: 0}, + {FzName: ts + 28672 /* "json_array_lengt..." */, FnArg: 1, FxFunc: 0}, + {FzName: ts + 28672 /* "json_array_lengt..." */, FnArg: 2, FxFunc: 0}, + {FzName: ts + 28690 /* "json_extract" */, FnArg: -1, FxFunc: 0}, + {FzName: ts + 28703 /* "json_insert" */, FnArg: -1, FxFunc: 0}, + {FzName: ts + 28715 /* "json_object" */, FnArg: -1, FxFunc: 0}, + {FzName: ts + 28727 /* "json_patch" */, FnArg: 2, FxFunc: 0}, + {FzName: ts + 28738 /* "json_quote" */, FnArg: 1, FxFunc: 0}, + {FzName: ts + 28749 /* "json_remove" */, FnArg: -1, FxFunc: 0}, + {FzName: ts + 28761 /* "json_replace" */, FnArg: -1, FxFunc: 0}, + {FzName: ts + 28774 /* "json_set" */, FnArg: -1, Fflag: 1, FxFunc: 0}, + {FzName: ts + 28783 /* "json_type" */, FnArg: 1, FxFunc: 0}, + {FzName: ts + 28783 /* "json_type" */, FnArg: 2, FxFunc: 0}, + {FzName: ts + 28793 /* "json_valid" */, FnArg: 1, FxFunc: 0}, +} /* sqlite3.c:190995:5 */ var aAgg = [2]struct { FzName uintptr FnArg int32 @@ -149203,19 +151824,19 @@ var aAgg = [2]struct { FxFinal uintptr FxValue uintptr }{ - {FzName: ts + 28298 /* "json_group_array" */, FnArg: 1, + {FzName: ts + 28804 /* "json_group_array" */, FnArg: 1, FxStep: 0, FxFinal: 0, FxValue: 0}, - {FzName: ts + 28315 /* "json_group_objec..." */, FnArg: 2, + {FzName: ts + 28821 /* "json_group_objec..." */, FnArg: 2, FxStep: 0, FxFinal: 0, FxValue: 0}, -} /* sqlite3.c:188001:5 */ +} /* sqlite3.c:191024:5 */ var aMod = [2]struct { FzName uintptr FpModule uintptr }{ - {FzName: ts + 28333 /* "json_each" */, FpModule: 0}, - {FzName: ts + 28343 /* "json_tree" */, FpModule: 0}, -} /* sqlite3.c:188011:5 */ -var enc int32 = ((SQLITE_UTF8 | SQLITE_DETERMINISTIC) | SQLITE_INNOCUOUS) /* sqlite3.c:188016:20 */ // In the SQLite core + {FzName: ts + 28839 /* "json_each" */, FpModule: 0}, + {FzName: ts + 28849 /* "json_tree" */, FpModule: 0}, +} /* sqlite3.c:191034:5 */ +var enc int32 = ((SQLITE_UTF8 | SQLITE_DETERMINISTIC) | SQLITE_INNOCUOUS) /* sqlite3.c:191039:20 */ // In the SQLite core // #include // #include @@ -149259,7 +151880,7 @@ type Rtree1 = struct { FpDeleteParent uintptr FpWriteAux uintptr FaHash [97]uintptr -} /* sqlite3.c:188152:9 */ +} /* sqlite3.c:191175:9 */ // In the SQLite core @@ -149270,7 +151891,7 @@ type Rtree1 = struct { // The following macro is used to suppress compiler warnings. -type Rtree = Rtree1 /* sqlite3.c:188152:22 */ +type Rtree = Rtree1 /* sqlite3.c:191175:22 */ type RtreeCursor1 = struct { Fbase Sqlite3_vtab_cursor FatEOF U8 @@ -149291,9 +151912,9 @@ type RtreeCursor1 = struct { FaNode [5]uintptr FanQueue [41]U32 _ [4]byte -} /* sqlite3.c:188153:9 */ +} /* sqlite3.c:191176:9 */ -type RtreeCursor = RtreeCursor1 /* sqlite3.c:188153:28 */ +type RtreeCursor = RtreeCursor1 /* sqlite3.c:191176:28 */ type RtreeNode1 = struct { FpParent uintptr FiNode I64 @@ -149301,23 +151922,23 @@ type RtreeNode1 = struct { FisDirty int32 FzData uintptr FpNext uintptr -} /* sqlite3.c:188152:9 */ +} /* sqlite3.c:191175:9 */ -type RtreeNode = RtreeNode1 /* sqlite3.c:188154:26 */ +type RtreeNode = RtreeNode1 /* sqlite3.c:191177:26 */ type RtreeCell1 = struct { FiRowid I64 FaCoord [10]RtreeCoord -} /* sqlite3.c:188155:9 */ +} /* sqlite3.c:191178:9 */ -type RtreeCell = RtreeCell1 /* sqlite3.c:188155:26 */ +type RtreeCell = RtreeCell1 /* sqlite3.c:191178:26 */ type RtreeConstraint1 = struct { FiCoord int32 Fop int32 Fu struct{ FrValue RtreeDValue } FpInfo uintptr -} /* sqlite3.c:188153:9 */ +} /* sqlite3.c:191176:9 */ -type RtreeConstraint = RtreeConstraint1 /* sqlite3.c:188156:32 */ +type RtreeConstraint = RtreeConstraint1 /* sqlite3.c:191179:32 */ type RtreeMatchArg1 = struct { FiSize U32 _ [4]byte @@ -149326,20 +151947,20 @@ type RtreeMatchArg1 = struct { _ [4]byte FapSqlParam uintptr FaParam [1]RtreeDValue -} /* sqlite3.c:188157:9 */ +} /* sqlite3.c:191180:9 */ -type RtreeMatchArg = RtreeMatchArg1 /* sqlite3.c:188157:30 */ +type RtreeMatchArg = RtreeMatchArg1 /* sqlite3.c:191180:30 */ type RtreeGeomCallback1 = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr -} /* sqlite3.c:188157:9 */ +} /* sqlite3.c:191180:9 */ -type RtreeGeomCallback = RtreeGeomCallback1 /* sqlite3.c:188158:34 */ -type RtreeCoord1 = struct{ Ff RtreeValue } /* sqlite3.c:188155:9 */ +type RtreeGeomCallback = RtreeGeomCallback1 /* sqlite3.c:191181:34 */ +type RtreeCoord1 = struct{ Ff RtreeValue } /* sqlite3.c:191178:9 */ -type RtreeCoord = RtreeCoord1 /* sqlite3.c:188159:26 */ +type RtreeCoord = RtreeCoord1 /* sqlite3.c:191182:26 */ type RtreeSearchPoint1 = struct { FrScore RtreeDValue Fid Sqlite3_int64 @@ -149347,17 +151968,17 @@ type RtreeSearchPoint1 = struct { FeWithin U8 FiCell U8 _ [5]byte -} /* sqlite3.c:188153:9 */ +} /* sqlite3.c:191176:9 */ -type RtreeSearchPoint = RtreeSearchPoint1 /* sqlite3.c:188160:33 */ +type RtreeSearchPoint = RtreeSearchPoint1 /* sqlite3.c:191183:33 */ // Possible values for Rtree.eCoordType: // If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will // only deal with integer coordinates. No floating point operations // will be done. -type RtreeDValue = float64 /* sqlite3.c:188255:18 */ // High accuracy coordinate -type RtreeValue = float32 /* sqlite3.c:188256:17 */ +type RtreeDValue = float64 /* sqlite3.c:191278:18 */ // High accuracy coordinate +type RtreeValue = float32 /* sqlite3.c:191279:17 */ // What version of GCC is being used. 0 means GCC is not being used . // Note that the GCC_VERSION macro will also be set correctly when using @@ -149383,16 +152004,16 @@ type RtreeValue = float32 /* sqlite3.c:188256:17 */ // Functions to deserialize a 16 bit integer, 32 bit real number and // 64 bit integer. The deserialized value is returned. -func readInt16(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:188535:12: */ +func readInt16(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:191558:12: */ return ((int32(*(*U8)(unsafe.Pointer(p))) << 8) + int32(*(*U8)(unsafe.Pointer(p + 1)))) } -func readCoord(tls *libc.TLS, p uintptr, pCoord uintptr) { /* sqlite3.c:188538:13: */ +func readCoord(tls *libc.TLS, p uintptr, pCoord uintptr) { /* sqlite3.c:191561:13: */ // p is always 4-byte aligned (*(*U32)(unsafe.Pointer(pCoord /* .Fu */))) = libc.X__builtin_bswap32(tls, *(*U32)(unsafe.Pointer(p))) } -func readInt64(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:188555:12: */ +func readInt64(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:191578:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -149405,12 +152026,12 @@ func readInt64(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:188555:12: */ // Functions to serialize a 16 bit integer, 32 bit real number and // 64 bit integer. The value returned is the number of bytes written // to the argument buffer (always 2, 4 and 8 respectively). -func writeInt16(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:188587:13: */ +func writeInt16(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:191610:13: */ *(*U8)(unsafe.Pointer(p)) = (U8((i >> 8) & 0xFF)) *(*U8)(unsafe.Pointer(p + 1)) = (U8((i >> 0) & 0xFF)) } -func writeCoord(tls *libc.TLS, p uintptr, pCoord uintptr) int32 { /* sqlite3.c:188591:12: */ +func writeCoord(tls *libc.TLS, p uintptr, pCoord uintptr) int32 { /* sqlite3.c:191614:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -149423,7 +152044,7 @@ func writeCoord(tls *libc.TLS, p uintptr, pCoord uintptr) int32 { /* sqlite3.c:1 return 4 } -func writeInt64(tls *libc.TLS, p uintptr, i I64) int32 { /* sqlite3.c:188614:12: */ +func writeInt64(tls *libc.TLS, p uintptr, i I64) int32 { /* sqlite3.c:191637:12: */ bp := tls.Alloc(8) defer tls.Free(8) *(*I64)(unsafe.Pointer(bp)) = i @@ -149434,7 +152055,7 @@ func writeInt64(tls *libc.TLS, p uintptr, i I64) int32 { /* sqlite3.c:188614:12: } // Increment the reference count of node p. -func nodeReference(tls *libc.TLS, p uintptr) { /* sqlite3.c:188639:13: */ +func nodeReference(tls *libc.TLS, p uintptr) { /* sqlite3.c:191662:13: */ if p != 0 { (*RtreeNode)(unsafe.Pointer(p)).FnRef++ @@ -149442,20 +152063,20 @@ func nodeReference(tls *libc.TLS, p uintptr) { /* sqlite3.c:188639:13: */ } // Clear the content of node p (set all bytes to 0x00). -func nodeZero(tls *libc.TLS, pRtree uintptr, p uintptr) { /* sqlite3.c:188649:13: */ +func nodeZero(tls *libc.TLS, pRtree uintptr, p uintptr) { /* sqlite3.c:191672:13: */ libc.Xmemset(tls, ((*RtreeNode)(unsafe.Pointer(p)).FzData + 2), 0, (uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize - 2))) (*RtreeNode)(unsafe.Pointer(p)).FisDirty = 1 } // Given a node number iNode, return the corresponding key to use // in the Rtree.aHash table. -func nodeHash(tls *libc.TLS, iNode I64) uint32 { /* sqlite3.c:188658:21: */ - return ((uint32(iNode)) % HASHSIZE) +func nodeHash(tls *libc.TLS, iNode I64) uint32 { /* sqlite3.c:191681:21: */ + return ((uint32(iNode)) % uint32(HASHSIZE)) } // Search the node hash table for node iNode. If found, return a pointer // to it. Otherwise, return 0. -func nodeHashLookup(tls *libc.TLS, pRtree uintptr, iNode I64) uintptr { /* sqlite3.c:188666:18: */ +func nodeHashLookup(tls *libc.TLS, pRtree uintptr, iNode I64) uintptr { /* sqlite3.c:191689:18: */ var p uintptr for p = *(*uintptr)(unsafe.Pointer((pRtree + 192 /* &.aHash */) + uintptr(nodeHash(tls, iNode))*8)); (p != 0) && ((*RtreeNode)(unsafe.Pointer(p)).FiNode != iNode); p = (*RtreeNode)(unsafe.Pointer(p)).FpNext { } @@ -149463,7 +152084,7 @@ func nodeHashLookup(tls *libc.TLS, pRtree uintptr, iNode I64) uintptr { /* sqlit } // Add node pNode to the node hash table. -func nodeHashInsert(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:188675:13: */ +func nodeHashInsert(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:191698:13: */ var iHash int32 iHash = int32(nodeHash(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)) @@ -149472,7 +152093,7 @@ func nodeHashInsert(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c } // Remove node pNode from the node hash table. -func nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:188686:13: */ +func nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:191709:13: */ var pp uintptr if (*RtreeNode)(unsafe.Pointer(pNode)).FiNode != int64(0) { pp = ((pRtree + 192 /* &.aHash */) + uintptr(nodeHash(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode))*8) @@ -149487,7 +152108,7 @@ func nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c // indicating that node has not yet been assigned a node number. It is // assigned a node number when nodeWrite() is called to write the // node contents out to the database. -func nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) uintptr { /* sqlite3.c:188702:18: */ +func nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) uintptr { /* sqlite3.c:191725:18: */ var pNode uintptr pNode = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(RtreeNode{})) + uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize)))) if pNode != 0 { @@ -149503,7 +152124,7 @@ func nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) uintptr { /* sqlite } // Clear the Rtree.pNodeBlob object -func nodeBlobReset(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:188720:13: */ +func nodeBlobReset(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:191743:13: */ if (((*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob != 0) && (int32((*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans) == 0)) && ((*Rtree)(unsafe.Pointer(pRtree)).FnCursor == U32(0)) { var pBlob uintptr = (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob = uintptr(0) @@ -149513,7 +152134,7 @@ func nodeBlobReset(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:188720:13: */ // Check to see if pNode is the same as pParent or any of the parents // of pParent. -func nodeInParentChain(tls *libc.TLS, pNode uintptr, pParent uintptr) int32 { /* sqlite3.c:188732:12: */ +func nodeInParentChain(tls *libc.TLS, pNode uintptr, pParent uintptr) int32 { /* sqlite3.c:191755:12: */ for ok := true; ok; ok = pParent != 0 { if pNode == pParent { return 1 @@ -149524,7 +152145,7 @@ func nodeInParentChain(tls *libc.TLS, pNode uintptr, pParent uintptr) int32 { /* } // Obtain a reference to an r-tree node. -func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNode uintptr) int32 { /* sqlite3.c:188743:12: */ +func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNode uintptr) int32 { /* sqlite3.c:191766:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -149563,11 +152184,11 @@ func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNo } } if (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - var zTab uintptr = Xsqlite3_mprintf(tls, ts+28353 /* "%s_node" */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) + var zTab uintptr = Xsqlite3_mprintf(tls, ts+28859 /* "%s_node" */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) if zTab == uintptr(0) { return SQLITE_NOMEM } - rc = Xsqlite3_blob_open(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, zTab, ts+28361 /* "data" */, iNode, 0, + rc = Xsqlite3_blob_open(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, zTab, ts+28867 /* "data" */, iNode, 0, (pRtree + 112 /* &.pNodeBlob */)) Xsqlite3_free(tls, zTab) } @@ -149602,7 +152223,7 @@ func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNo // the root node. A height of one means the children of the root node // are the leaves, and so on. If the depth as specified on the root node // is greater than RTREE_MAX_DEPTH, the r-tree structure must be corrupt. - if (pNode != 0) && (iNode == int64(1)) { + if ((pNode != 0) && (rc == SQLITE_OK)) && (iNode == int64(1)) { (*Rtree)(unsafe.Pointer(pRtree)).FiDepth = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData) if (*Rtree)(unsafe.Pointer(pRtree)).FiDepth > RTREE_MAX_DEPTH { rc = (SQLITE_CORRUPT | (int32(1) << 8)) @@ -149641,7 +152262,7 @@ func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNo } // Overwrite cell iCell of node pNode with the contents of pCell. -func nodeOverwriteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iCell int32) { /* sqlite3.c:188863:13: */ +func nodeOverwriteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iCell int32) { /* sqlite3.c:191886:13: */ var ii int32 var p uintptr = ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell)))) p += uintptr(writeInt64(tls, p, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid)) @@ -149652,7 +152273,7 @@ func nodeOverwriteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintp } // Remove the cell with index iCell from node pNode. -func nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) { /* sqlite3.c:188881:13: */ +func nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) { /* sqlite3.c:191904:13: */ var pDst uintptr = ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell)))) var pSrc uintptr = (pDst + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)) var nByte int32 = (((readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+2)) - iCell) - 1) * int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)) @@ -149665,7 +152286,7 @@ func nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) { // is successful, return SQLITE_OK. // // If there is not enough free space in pNode, return SQLITE_FULL. -func nodeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:188896:12: */ +func nodeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:191919:12: */ var nCell int32 // Current number of cells in pNode var nMaxCell int32 // Maximum number of cells for pNode @@ -149682,7 +152303,7 @@ func nodeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) } // If the node is dirty, write it out to the database. -func nodeWrite(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:188920:12: */ +func nodeWrite(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:191943:12: */ var rc int32 = SQLITE_OK if (*RtreeNode)(unsafe.Pointer(pNode)).FisDirty != 0 { var p uintptr = (*Rtree)(unsafe.Pointer(pRtree)).FpWriteNode @@ -149706,7 +152327,7 @@ func nodeWrite(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3. // Release a reference to a node. If the node is dirty and the reference // count drops to zero, the node data is written to the database. -func nodeRelease(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:188946:12: */ +func nodeRelease(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:191969:12: */ var rc int32 = SQLITE_OK if pNode != 0 { @@ -149732,19 +152353,19 @@ func nodeRelease(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite // Return the 64-bit integer value associated with cell iCell of // node pNode. If pNode is a leaf node, this is a rowid. If it is // an internal node, then the 64-bit integer is a child page number. -func nodeGetRowid(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) I64 { /* sqlite3.c:188975:12: */ +func nodeGetRowid(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) I64 { /* sqlite3.c:191998:12: */ return readInt64(tls, ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell))))) } // Return coordinate iCoord from cell iCell in node pNode. -func nodeGetCoord(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iCoord int32, pCoord uintptr) { /* sqlite3.c:188987:13: */ +func nodeGetCoord(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iCoord int32, pCoord uintptr) { /* sqlite3.c:192010:13: */ readCoord(tls, ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(((12 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell)) + (4 * iCoord)))), pCoord) } // Deserialize cell iCell of node pNode. Populate the structure pointed // to by pCell with the results. -func nodeGetCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, pCell uintptr) { /* sqlite3.c:189001:13: */ +func nodeGetCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, pCell uintptr) { /* sqlite3.c:192024:13: */ var pData uintptr var pCoord uintptr var ii int32 = 0 @@ -149760,23 +152381,23 @@ func nodeGetCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, pCel } // Rtree virtual table module xCreate method. -func rtreeCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:189032:12: */ +func rtreeCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:192055:12: */ return rtreeInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 1) } // Rtree virtual table module xConnect method. -func rtreeConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:189045:12: */ +func rtreeConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:192068:12: */ return rtreeInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 0) } // Increment the r-tree reference count. -func rtreeReference(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:189058:13: */ +func rtreeReference(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:192081:13: */ (*Rtree)(unsafe.Pointer(pRtree)).FnBusy++ } // Decrement the r-tree reference count. When the reference count reaches // zero the structure is deleted. -func rtreeRelease(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:189066:13: */ +func rtreeRelease(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:192089:13: */ (*Rtree)(unsafe.Pointer(pRtree)).FnBusy-- if (*Rtree)(unsafe.Pointer(pRtree)).FnBusy == U32(0) { (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = U8(0) @@ -149798,13 +152419,13 @@ func rtreeRelease(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:189066:13: */ } // Rtree virtual table module xDisconnect method. -func rtreeDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:189090:12: */ +func rtreeDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:192113:12: */ rtreeRelease(tls, pVtab) return SQLITE_OK } // Rtree virtual table module xDestroy method. -func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:189098:12: */ +func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:192121:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -149812,7 +152433,7 @@ func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:189098:12: var rc int32 var zCreate uintptr = Xsqlite3_mprintf(tls, - ts+28366, /* "DROP TABLE '%q'...." */ + ts+28872, /* "DROP TABLE '%q'...." */ libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) @@ -149831,7 +152452,7 @@ func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:189098:12: } // Rtree virtual table module xOpen method. -func rtreeOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:189126:12: */ +func rtreeOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:192149:12: */ var rc int32 = SQLITE_NOMEM var pRtree uintptr = pVTab var pCsr uintptr @@ -149849,7 +152470,7 @@ func rtreeOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite } // Reset a cursor back to its initial state. -func resetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:189147:13: */ +func resetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:192170:13: */ var pRtree uintptr = (*RtreeCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab var ii int32 var pStmt uintptr @@ -149879,7 +152500,7 @@ func resetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:189147:13: */ } // Rtree virtual table module xClose method. -func rtreeClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:189175:12: */ +func rtreeClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:192198:12: */ var pRtree uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab var pCsr uintptr = cur @@ -149895,7 +152516,7 @@ func rtreeClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:189175:12: */ // // Return non-zero if the cursor does not currently point to a valid // record (i.e if the scan has finished), or zero otherwise. -func rtreeEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:189193:12: */ +func rtreeEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:192216:12: */ var pCsr uintptr = cur return int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FatEOF) } @@ -149912,7 +152533,7 @@ func rtreeEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:189193:12: */ // Check the RTree node or entry given by pCellData and p against the MATCH // constraint pConstraint. -func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCellData uintptr, pSearch uintptr, prScore uintptr, peWithin uintptr) int32 { /* sqlite3.c:189248:12: */ +func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCellData uintptr, pSearch uintptr, prScore uintptr, peWithin uintptr) int32 { /* sqlite3.c:192271:12: */ bp := tls.Alloc(92) defer tls.Free(92) @@ -150020,7 +152641,7 @@ func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCe // Check the internal RTree node given by pCellData against constraint p. // If this constraint cannot be satisfied by any child within the node, // set *peWithin to NOT_WITHIN. -func rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:189324:13: */ +func rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:192347:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -150091,7 +152712,7 @@ func rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uint // // The op is given by p->op. The xN is p->iCoord-th coordinate in // pCellData. $val is given by p->u.rValue. -func rtreeLeafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:189372:13: */ +func rtreeLeafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:192395:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -150146,7 +152767,7 @@ func rtreeLeafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr // One of the cells in node pNode is guaranteed to have a 64-bit // integer value equal to iRowid. Return the index of this cell. -func nodeRowidIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, iRowid I64, piIndex uintptr) int32 { /* sqlite3.c:189402:12: */ +func nodeRowidIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, iRowid I64, piIndex uintptr) int32 { /* sqlite3.c:192425:12: */ var ii int32 var nCell int32 = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + 2)) @@ -150162,7 +152783,7 @@ func nodeRowidIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, iRowid I64, pi // Return the index of the cell containing a pointer to node pNode // in its parent. If pNode is the root node, return -1. -func nodeParentIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, piIndex uintptr) int32 { /* sqlite3.c:189425:12: */ +func nodeParentIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, piIndex uintptr) int32 { /* sqlite3.c:192448:12: */ var pParent uintptr = (*RtreeNode)(unsafe.Pointer(pNode)).FpParent if pParent != 0 { return nodeRowidIndex(tls, pRtree, pParent, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode, piIndex) @@ -150179,7 +152800,7 @@ func nodeParentIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, piIndex uintp // iLevel values coming first. In this way, if rScore is the same for all // SearchPoints, then iLevel becomes the deciding factor and the result // is a depth-first search, which is the desired default behavior. -func rtreeSearchPointCompare(tls *libc.TLS, pA uintptr, pB uintptr) int32 { /* sqlite3.c:189444:12: */ +func rtreeSearchPointCompare(tls *libc.TLS, pA uintptr, pB uintptr) int32 { /* sqlite3.c:192467:12: */ if (*RtreeSearchPoint)(unsafe.Pointer(pA)).FrScore < (*RtreeSearchPoint)(unsafe.Pointer(pB)).FrScore { return -1 } @@ -150196,7 +152817,7 @@ func rtreeSearchPointCompare(tls *libc.TLS, pA uintptr, pB uintptr) int32 { /* s } // Interchange two search points in a cursor. -func rtreeSearchPointSwap(tls *libc.TLS, p uintptr, i int32, j int32) { /* sqlite3.c:189458:13: */ +func rtreeSearchPointSwap(tls *libc.TLS, p uintptr, i int32, j int32) { /* sqlite3.c:192481:13: */ var t = *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(i)*24)) *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(i)*24)) = *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(j)*24)) @@ -150216,7 +152837,7 @@ func rtreeSearchPointSwap(tls *libc.TLS, p uintptr, i int32, j int32) { /* sqlit } // Return the search point with the lowest current score. -func rtreeSearchPointFirst(tls *libc.TLS, pCur uintptr) uintptr { /* sqlite3.c:189479:25: */ +func rtreeSearchPointFirst(tls *libc.TLS, pCur uintptr) uintptr { /* sqlite3.c:192502:25: */ if (*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint != 0 { return (pCur + 64 /* &.sPoint */) } @@ -150227,7 +152848,7 @@ func rtreeSearchPointFirst(tls *libc.TLS, pCur uintptr) uintptr { /* sqlite3.c:1 } // Get the RtreeNode for the search point with the lowest score. -func rtreeNodeOfFirstSearchPoint(tls *libc.TLS, pCur uintptr, pRC uintptr) uintptr { /* sqlite3.c:189486:18: */ +func rtreeNodeOfFirstSearchPoint(tls *libc.TLS, pCur uintptr, pRC uintptr) uintptr { /* sqlite3.c:192509:18: */ var id Sqlite3_int64 var ii int32 = (1 - int32((*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint)) @@ -150244,7 +152865,7 @@ func rtreeNodeOfFirstSearchPoint(tls *libc.TLS, pCur uintptr, pRC uintptr) uintp } // Push a new element onto the priority queue -func rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:189502:25: */ +func rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:192525:25: */ var i int32 var j int32 var pNew uintptr @@ -150278,7 +152899,7 @@ func rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) ui // Allocate a new RtreeSearchPoint and return a pointer to it. Return // NULL if malloc fails. -func rtreeSearchPointNew(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:189537:25: */ +func rtreeSearchPointNew(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:192560:25: */ var pNew uintptr var pFirst uintptr pFirst = rtreeSearchPointFirst(tls, pCur) @@ -150313,7 +152934,7 @@ func rtreeSearchPointNew(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel } // Remove the search point with the lowest current score. -func rtreeSearchPointPop(tls *libc.TLS, p uintptr) { /* sqlite3.c:189604:13: */ +func rtreeSearchPointPop(tls *libc.TLS, p uintptr) { /* sqlite3.c:192627:13: */ var i int32 var j int32 var k int32 @@ -150361,7 +152982,7 @@ func rtreeSearchPointPop(tls *libc.TLS, p uintptr) { /* sqlite3.c:189604:13: */ // contains an entry suitable for returning as a result-set row, // or until the RtreeSearchPoint queue is empty, indicating that the // query has completed. -func rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:189652:12: */ +func rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:192675:12: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -150454,7 +153075,7 @@ func rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:189652:12 } // Rtree virtual table module xNext method. -func rtreeNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:189733:12: */ +func rtreeNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:192756:12: */ var pCsr uintptr = pVtabCursor var rc int32 = SQLITE_OK @@ -150470,7 +153091,7 @@ func rtreeNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:189733:1 } // Rtree virtual table module xRowid method. -func rtreeRowid(tls *libc.TLS, pVtabCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:189751:12: */ +func rtreeRowid(tls *libc.TLS, pVtabCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:192774:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -150485,7 +153106,7 @@ func rtreeRowid(tls *libc.TLS, pVtabCursor uintptr, pRowid uintptr) int32 { /* s } // Rtree virtual table module xColumn method. -func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:189765:12: */ +func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:192788:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -150546,7 +153167,7 @@ func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sq // return SQLITE_OK. If there is no such record in the table, set // *ppLeaf to 0 and return SQLITE_OK. If an error occurs, set *ppLeaf // to zero and return an SQLite error code. -func findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid I64, ppLeaf uintptr, piNode uintptr) int32 { /* sqlite3.c:189819:12: */ +func findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid I64, ppLeaf uintptr, piNode uintptr) int32 { /* sqlite3.c:192842:12: */ var rc int32 *(*uintptr)(unsafe.Pointer(ppLeaf)) = uintptr(0) Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid, 1, iRowid) @@ -150567,12 +153188,12 @@ func findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid I64, ppLeaf uintptr, piN // as the second argument for a MATCH constraint. The value passed as the // first argument to this function is the right-hand operand to the MATCH // operator. -func deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) int32 { /* sqlite3.c:189845:12: */ +func deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) int32 { /* sqlite3.c:192868:12: */ var pBlob uintptr var pSrc uintptr // BLOB returned by geometry function var pInfo uintptr // Callback information - pSrc = Xsqlite3_value_pointer(tls, pValue, ts+28448 /* "RtreeMatchArg" */) + pSrc = Xsqlite3_value_pointer(tls, pValue, ts+28954 /* "RtreeMatchArg" */) if pSrc == uintptr(0) { return SQLITE_ERROR } @@ -150599,7 +153220,7 @@ func deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) int32 { / } // Rtree virtual table module xFilter method. -func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:189875:12: */ +func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:192898:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -150636,7 +153257,7 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt // Always returns pCsr->sPoint *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8 /* iNode */)) - (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(PARTLY_WITHIN) rc = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)), iRowid, bp+16 /* &iCell */) (*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = U8(*(*int32)(unsafe.Pointer(bp + 16 /* iCell */))) @@ -150695,7 +153316,7 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt } (*RtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1) (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0) - (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(PARTLY_WITHIN) *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) = uintptr(0) @@ -150741,7 +153362,7 @@ func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt // The second of each pair of bytes identifies the coordinate column // to which the constraint applies. The leftmost coordinate column // is 'a', the second from the left 'b' etc. -func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:190025:12: */ +func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:193048:12: */ bp := tls.Alloc(49) defer tls.Free(49) @@ -150798,27 +153419,27 @@ func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sql var op U8 switch int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) { case SQLITE_INDEX_CONSTRAINT_EQ: - op = RTREE_EQ + op = U8(RTREE_EQ) break fallthrough case SQLITE_INDEX_CONSTRAINT_GT: - op = RTREE_GT + op = U8(RTREE_GT) break fallthrough case SQLITE_INDEX_CONSTRAINT_LE: - op = RTREE_LE + op = U8(RTREE_LE) break fallthrough case SQLITE_INDEX_CONSTRAINT_LT: - op = RTREE_LT + op = U8(RTREE_LT) break fallthrough case SQLITE_INDEX_CONSTRAINT_GE: - op = RTREE_GE + op = U8(RTREE_GE) break fallthrough case SQLITE_INDEX_CONSTRAINT_MATCH: - op = RTREE_MATCH + op = U8(RTREE_MATCH) break fallthrough default: @@ -150848,7 +153469,7 @@ func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sql } // Return the N-dimensional volumn of the cell stored in *p. -func cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:190114:20: */ +func cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:193137:20: */ var area RtreeDValue = RtreeDValue(1) if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { @@ -150891,7 +153512,7 @@ func cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3 // Return the margin length of cell p. The margin length is the sum // of the objects size in each dimension. -func cellMargin(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:190144:20: */ +func cellMargin(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:193167:20: */ var margin RtreeDValue = RtreeDValue(0) var ii int32 = (int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) - 2) for ok := true; ok; ok = (ii >= 0) { @@ -150912,7 +153533,7 @@ func cellMargin(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlit } // Store the union of cells p1 and p2 in p1. -func cellUnion(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) { /* sqlite3.c:190157:13: */ +func cellUnion(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) { /* sqlite3.c:193180:13: */ var ii int32 = 0 if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_REAL32 { for ok := true; ok; ok = (ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)) { @@ -150951,7 +153572,7 @@ func cellUnion(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) { /* sqlit // Return true if the area covered by p2 is a subset of the area covered // by p1. False otherwise. -func cellContains(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:190178:12: */ +func cellContains(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:193201:12: */ var ii int32 var isInt int32 = (libc.Bool32(int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == RTREE_COORD_INT32)) for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2); ii = ii + (2) { @@ -150966,7 +153587,7 @@ func cellContains(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) int32 { } // Return the amount cell p would grow by if it were unioned with pCell. -func cellGrowth(tls *libc.TLS, pRtree uintptr, p uintptr, pCell uintptr) RtreeDValue { /* sqlite3.c:190196:20: */ +func cellGrowth(tls *libc.TLS, pRtree uintptr, p uintptr, pCell uintptr) RtreeDValue { /* sqlite3.c:193219:20: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -150979,7 +153600,7 @@ func cellGrowth(tls *libc.TLS, pRtree uintptr, p uintptr, pCell uintptr) RtreeDV return (cellArea(tls, pRtree, bp /* &cell */) - area) } -func cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell int32) RtreeDValue { /* sqlite3.c:190205:20: */ +func cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell int32) RtreeDValue { /* sqlite3.c:193228:20: */ var ii int32 var overlap RtreeDValue = 0.0 for ii = 0; ii < nCell; ii++ { @@ -151054,7 +153675,7 @@ func cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell // This function implements the ChooseLeaf algorithm from Gutman[84]. // ChooseSubTree in r*tree terminology. -func sChooseLeaf(tls *libc.TLS, pRtree uintptr, pCell uintptr, iHeight int32, ppLeaf uintptr) int32 { /* sqlite3.c:190237:12: */ +func sChooseLeaf(tls *libc.TLS, pRtree uintptr, pCell uintptr, iHeight int32, ppLeaf uintptr) int32 { /* sqlite3.c:193260:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -151110,7 +153731,7 @@ func sChooseLeaf(tls *libc.TLS, pRtree uintptr, pCell uintptr, iHeight int32, pp // A cell with the same content as pCell has just been inserted into // the node pNode. This function updates the bounding box cells in // all ancestor elements. -func sAdjustTree(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:190297:12: */ +func sAdjustTree(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:193320:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -151139,7 +153760,7 @@ func sAdjustTree(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) in } // Write mapping (iRowid->iNode) to the _rowid table. -func rowidWrite(tls *libc.TLS, pRtree uintptr, iRowid Sqlite3_int64, iNode Sqlite3_int64) int32 { /* sqlite3.c:190328:12: */ +func rowidWrite(tls *libc.TLS, pRtree uintptr, iRowid Sqlite3_int64, iNode Sqlite3_int64) int32 { /* sqlite3.c:193351:12: */ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 1, iRowid) Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 2, iNode) Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid) @@ -151147,7 +153768,7 @@ func rowidWrite(tls *libc.TLS, pRtree uintptr, iRowid Sqlite3_int64, iNode Sqlit } // Write mapping (iNode->iPar) to the _parent table. -func parentWrite(tls *libc.TLS, pRtree uintptr, iNode Sqlite3_int64, iPar Sqlite3_int64) int32 { /* sqlite3.c:190338:12: */ +func parentWrite(tls *libc.TLS, pRtree uintptr, iNode Sqlite3_int64, iPar Sqlite3_int64) int32 { /* sqlite3.c:193361:12: */ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent, 1, iNode) Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent, 2, iPar) Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent) @@ -151169,7 +153790,7 @@ func parentWrite(tls *libc.TLS, pRtree uintptr, iNode Sqlite3_int64, iPar Sqlite // // The aSpare array is used as temporary working space by the // sorting algorithm. -func sSortByDistance(tls *libc.TLS, aIdx uintptr, nIdx int32, aDistance uintptr, aSpare uintptr) { /* sqlite3.c:190365:13: */ +func sSortByDistance(tls *libc.TLS, aIdx uintptr, nIdx int32, aDistance uintptr, aSpare uintptr) { /* sqlite3.c:193388:13: */ if nIdx > 1 { var iLeft int32 = 0 var iRight int32 = 0 @@ -151217,7 +153838,7 @@ func sSortByDistance(tls *libc.TLS, aIdx uintptr, nIdx int32, aDistance uintptr, // // The aSpare array is used as temporary working space by the // sorting algorithm. -func sSortByDimension(tls *libc.TLS, pRtree uintptr, aIdx uintptr, nIdx int32, iDim int32, aCell uintptr, aSpare uintptr) { /* sqlite3.c:190431:13: */ +func sSortByDimension(tls *libc.TLS, pRtree uintptr, aIdx uintptr, nIdx int32, iDim int32, aCell uintptr, aSpare uintptr) { /* sqlite3.c:193454:13: */ if nIdx > 1 { var iLeft int32 = 0 @@ -151273,7 +153894,7 @@ func sSortByDimension(tls *libc.TLS, pRtree uintptr, aIdx uintptr, nIdx int32, i } // Implementation of the R*-tree variant of SplitNode from Beckman[1990]. -func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32, pLeft uintptr, pRight uintptr, pBboxLeft uintptr, pBboxRight uintptr) int32 { /* sqlite3.c:190490:12: */ +func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32, pLeft uintptr, pRight uintptr, pBboxLeft uintptr, pBboxRight uintptr) int32 { /* sqlite3.c:193513:12: */ bp := tls.Alloc(96) defer tls.Free(96) @@ -151372,7 +153993,7 @@ func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32 return SQLITE_OK } -func updateMapping(tls *libc.TLS, pRtree uintptr, iRowid I64, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:190588:12: */ +func updateMapping(tls *libc.TLS, pRtree uintptr, iRowid I64, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:193611:12: */ var xSetMapping uintptr xSetMapping = func() uintptr { if iHeight == 0 { @@ -151395,7 +154016,7 @@ func updateMapping(tls *libc.TLS, pRtree uintptr, iRowid I64, pNode uintptr, iHe return (*(*func(*libc.TLS, uintptr, Sqlite3_int64, Sqlite3_int64) int32)(unsafe.Pointer(&xSetMapping)))(tls, pRtree, iRowid, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode) } -func sSplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:190607:12: */ +func sSplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:193630:12: */ bp := tls.Alloc(100) defer tls.Free(100) @@ -151629,7 +154250,7 @@ splitnode_out: // rowid of the row to delete, which can be used to find the leaf on which // the entry resides (argument pLeaf). Once the leaf is located, this // function is called to determine its ancestry. -func fixLeafParent(tls *libc.TLS, pRtree uintptr, pLeaf uintptr) int32 { /* sqlite3.c:190754:12: */ +func fixLeafParent(tls *libc.TLS, pRtree uintptr, pLeaf uintptr) int32 { /* sqlite3.c:193777:12: */ var rc int32 = SQLITE_OK var pChild uintptr = pLeaf for ((rc == SQLITE_OK) && ((*RtreeNode)(unsafe.Pointer(pChild)).FiNode != int64(1))) && ((*RtreeNode)(unsafe.Pointer(pChild)).FpParent == uintptr(0)) { @@ -151664,7 +154285,7 @@ func fixLeafParent(tls *libc.TLS, pRtree uintptr, pLeaf uintptr) int32 { /* sqli return rc } -func removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:190789:12: */ +func removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:193812:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -151713,7 +154334,7 @@ func removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) int return SQLITE_OK } -func fixBoundingBox(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:190838:12: */ +func fixBoundingBox(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:193861:12: */ bp := tls.Alloc(100) defer tls.Free(100) @@ -151744,7 +154365,7 @@ func fixBoundingBox(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sql // Delete the cell at index iCell of node pNode. After removing the // cell, adjust the r-tree data structure if required. -func deleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iHeight int32) int32 { /* sqlite3.c:190865:12: */ +func deleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iHeight int32) int32 { /* sqlite3.c:193888:12: */ var pParent uintptr var rc int32 @@ -151773,7 +154394,7 @@ func deleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iHeig return rc } -func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:190896:12: */ +func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:193919:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -151789,7 +154410,7 @@ func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHei var rc int32 = SQLITE_OK var n int32 - libc.Xmemset(tls, bp /* &aCenterCoord[0] */, 0, (uint64(unsafe.Sizeof(RtreeDValue(0))) * RTREE_MAX_DIMENSIONS)) + libc.Xmemset(tls, bp /* &aCenterCoord[0] */, 0, (uint64(unsafe.Sizeof(RtreeDValue(0))) * uint64(RTREE_MAX_DIMENSIONS))) nCell = (readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+2)) + 1) n = ((nCell + 1) & (libc.CplInt32(1))) @@ -151888,7 +154509,7 @@ func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHei // Insert cell pCell into node pNode. Node pNode is the head of a // subtree iHeight high (leaf nodes have iHeight==0). -func rtreeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:191001:12: */ +func rtreeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:194024:12: */ var rc int32 = SQLITE_OK if iHeight > 0 { var pChild uintptr = nodeHashLookup(tls, pRtree, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid) @@ -151918,7 +154539,7 @@ func rtreeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr return rc } -func reinsertNodeContent(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:191036:12: */ +func reinsertNodeContent(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:194059:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -151949,7 +154570,7 @@ func reinsertNodeContent(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { / } // Select a currently unused rowid for a new r-tree record. -func rtreeNewRowid(tls *libc.TLS, pRtree uintptr, piRowid uintptr) int32 { /* sqlite3.c:191065:12: */ +func rtreeNewRowid(tls *libc.TLS, pRtree uintptr, piRowid uintptr) int32 { /* sqlite3.c:194088:12: */ var rc int32 Xsqlite3_bind_null(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 1) Xsqlite3_bind_null(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 2) @@ -151960,7 +154581,7 @@ func rtreeNewRowid(tls *libc.TLS, pRtree uintptr, piRowid uintptr) int32 { /* sq } // Remove the entry with rowid=iDelete from the r-tree structure. -func rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Sqlite3_int64) int32 { /* sqlite3.c:191078:12: */ +func rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Sqlite3_int64) int32 { /* sqlite3.c:194101:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -152049,7 +154670,7 @@ func rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Sqlite3_int64) int3 // Convert an sqlite3_value into an RtreeValue (presumably a float) // while taking care to round toward negative or positive, respectively. -func rtreeValueDown(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:191175:19: */ +func rtreeValueDown(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:194198:19: */ var d float64 = Xsqlite3_value_double(tls, v) var f float32 = float32(d) if float64(f) > d { @@ -152063,7 +154684,7 @@ func rtreeValueDown(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:191175:1 return f } -func rtreeValueUp(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:191183:19: */ +func rtreeValueUp(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:194206:19: */ var d float64 = Xsqlite3_value_double(tls, v) var f float32 = float32(d) if float64(f) < d { @@ -152088,7 +154709,7 @@ func rtreeValueUp(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:191183:19: // (c1<=c2) constraint on columns iCol and iCol+1 that has failed. // // If an OOM occurs, SQLITE_NOMEM is returned instead of SQLITE_CONSTRAINT. -func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /* sqlite3.c:191206:12: */ +func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /* sqlite3.c:194229:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -152096,7 +154717,7 @@ func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /* var zSql uintptr var rc int32 - zSql = Xsqlite3_mprintf(tls, ts+28462 /* "SELECT * FROM %Q..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, ts+28968 /* "SELECT * FROM %Q..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -1, bp+56 /* &pStmt */, uintptr(0)) } else { @@ -152108,12 +154729,12 @@ func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /* if iCol == 0 { var zCol uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), 0) (*Rtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, - ts+28482 /* "UNIQUE constrain..." */, libc.VaList(bp+16, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + ts+28988 /* "UNIQUE constrain..." */, libc.VaList(bp+16, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { var zCol1 uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), iCol) var zCol2 uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), (iCol + 1)) (*Rtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, - ts+28514 /* "rtree constraint..." */, libc.VaList(bp+32, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + ts+29020 /* "rtree constraint..." */, libc.VaList(bp+32, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } @@ -152127,7 +154748,7 @@ func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /* } // The xUpdate method for rtree module virtual tables. -func rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:191244:12: */ +func rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:194267:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -152356,7 +154977,7 @@ constraint: } // Called when a transaction starts. -func rtreeBeginTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:191392:12: */ +func rtreeBeginTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:194415:12: */ var pRtree uintptr = pVtab (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans++ @@ -152365,7 +154986,7 @@ func rtreeBeginTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:19 // Called when a transaction completes (either by COMMIT or ROLLBACK). // The sqlite3_blob object should be released at this point. -func rtreeEndTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:191403:12: */ +func rtreeEndTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:194426:12: */ var pRtree uintptr = pVtab (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = U8(0) nodeBlobReset(tls, pRtree) @@ -152373,7 +154994,7 @@ func rtreeEndTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:1914 } // The xRename method for rtree module virtual tables. -func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 { /* sqlite3.c:191413:12: */ +func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 { /* sqlite3.c:194436:12: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -152381,7 +155002,7 @@ func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 { /* sqli var rc int32 = SQLITE_NOMEM var zSql uintptr = Xsqlite3_mprintf(tls, - ts+28551 /* "ALTER TABLE %Q.'..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + ts+29057 /* "ALTER TABLE %Q.'..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -152402,7 +155023,7 @@ func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 { /* sqli // INSERT INTO rtree... // DROP TABLE ; -- Would fail with SQLITE_LOCKED // COMMIT; -func rtreeSavepoint(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:191446:12: */ +func rtreeSavepoint(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:194469:12: */ var pRtree uintptr = pVtab var iwt U8 = (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans _ = iSavepoint @@ -152415,11 +155036,11 @@ func rtreeSavepoint(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* s // This function populates the pRtree->nRowEst variable with an estimate // of the number of rows in the virtual table. If possible, this is based // on sqlite_stat1 data. Otherwise, use RTREE_DEFAULT_ROWEST. -func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlite3.c:191461:12: */ +func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlite3.c:194484:12: */ bp := tls.Alloc(24) defer tls.Free(24) - var zFmt uintptr = ts + 28696 /* "SELECT stat FROM..." */ + var zFmt uintptr = ts + 29202 /* "SELECT stat FROM..." */ var zSql uintptr // var p uintptr at bp+16, 8 @@ -152427,9 +155048,9 @@ func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlit var nRow I64 = int64(0) rc = Xsqlite3_table_column_metadata(tls, - db, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, ts+12457 /* "sqlite_stat1" */, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + db, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, ts+12870 /* "sqlite_stat1" */, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { - (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = RTREE_DEFAULT_ROWEST + (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == SQLITE_ERROR { return SQLITE_OK } @@ -152451,13 +155072,13 @@ func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlit if rc == SQLITE_OK { if nRow == int64(0) { - (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = RTREE_DEFAULT_ROWEST + (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) } else { (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = func() int64 { - if (nRow) > (RTREE_MIN_ROWEST) { + if (nRow) > (int64(RTREE_MIN_ROWEST)) { return nRow } - return RTREE_MIN_ROWEST + return int64(RTREE_MIN_ROWEST) }() } } @@ -152469,7 +155090,7 @@ func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlit // Return true if zName is the extension on one of the shadow tables used // by this module. -func rtreeShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:191505:12: */ +func rtreeShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:194528:12: */ var i uint32 for i = uint32(0); uint64(i) < (uint64(unsafe.Sizeof(azName1)) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { if Xsqlite3_stricmp(tls, zName, azName1[i]) == 0 { @@ -152480,8 +155101,8 @@ func rtreeShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:191505:1 } var azName1 = [3]uintptr{ - ts + 28752 /* "node" */, ts + 6776 /* "parent" */, ts + 10064, /* "rowid" */ -} /* sqlite3.c:191506:21 */ + ts + 29258 /* "node" */, ts + 6852 /* "parent" */, ts + 10157, /* "rowid" */ +} /* sqlite3.c:194529:21 */ var rtreeModule = Sqlite3_module{ FiVersion: 3, // iVersion @@ -152505,9 +155126,9 @@ var rtreeModule = Sqlite3_module{ FxRename: 0, // xRename - rename the table FxSavepoint: 0, // xRollbackTo FxShadowName: 0, // xShadowName -} /* sqlite3.c:191516:23 */ +} /* sqlite3.c:194539:23 */ -func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefix uintptr, isCreate int32) int32 { /* sqlite3.c:191543:12: */ +func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefix uintptr, isCreate int32) int32 { /* sqlite3.c:194566:12: */ bp := tls.Alloc(232) defer tls.Free(232) @@ -152524,19 +155145,19 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi var p uintptr = Xsqlite3_str_new(tls, db) var ii int32 Xsqlite3_str_appendf(tls, p, - ts+28757, /* "CREATE TABLE \"%w..." */ + ts+29263, /* "CREATE TABLE \"%w..." */ libc.VaList(bp, zDb, zPrefix)) for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux); ii++ { - Xsqlite3_str_appendf(tls, p, ts+28819 /* ",a%d" */, libc.VaList(bp+16, ii)) + Xsqlite3_str_appendf(tls, p, ts+29325 /* ",a%d" */, libc.VaList(bp+16, ii)) } Xsqlite3_str_appendf(tls, p, - ts+28824, /* ");CREATE TABLE \"..." */ + ts+29330, /* ");CREATE TABLE \"..." */ libc.VaList(bp+24, zDb, zPrefix)) Xsqlite3_str_appendf(tls, p, - ts+28888, /* "CREATE TABLE \"%w..." */ + ts+29394, /* "CREATE TABLE \"%w..." */ libc.VaList(bp+40, zDb, zPrefix)) Xsqlite3_str_appendf(tls, p, - ts+28958, /* "INSERT INTO \"%w\"..." */ + ts+29464, /* "INSERT INTO \"%w\"..." */ libc.VaList(bp+56, zDb, zPrefix, (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { @@ -152567,7 +155188,7 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi } else { // An UPSERT is very slightly slower than REPLACE, but it is needed // if there are auxiliary columns - zFormat = ts + 29007 /* "INSERT INTO\"%w\"...." */ + zFormat = ts + 29513 /* "INSERT INTO\"%w\"...." */ } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+80, zDb, zPrefix)) if zSql != 0 { @@ -152579,7 +155200,7 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi } if (*Rtree)(unsafe.Pointer(pRtree)).FnAux != 0 { (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, - ts+29115, /* "SELECT * FROM \"%..." */ + ts+29621, /* "SELECT * FROM \"%..." */ libc.VaList(bp+96, zDb, zPrefix)) if (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = SQLITE_NOMEM @@ -152587,18 +155208,18 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi var p uintptr = Xsqlite3_str_new(tls, db) var ii int32 var zSql uintptr - Xsqlite3_str_appendf(tls, p, ts+29160 /* "UPDATE \"%w\".\"%w_..." */, libc.VaList(bp+112, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, ts+29666 /* "UPDATE \"%w\".\"%w_..." */, libc.VaList(bp+112, zDb, zPrefix)) for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux); ii++ { if ii != 0 { - Xsqlite3_str_append(tls, p, ts+13915 /* "," */, 1) + Xsqlite3_str_append(tls, p, ts+14379 /* "," */, 1) } if ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p, ts+29187 /* "a%d=coalesce(?%d..." */, libc.VaList(bp+128, ii, (ii+2), ii)) + Xsqlite3_str_appendf(tls, p, ts+29693 /* "a%d=coalesce(?%d..." */, libc.VaList(bp+128, ii, (ii+2), ii)) } else { - Xsqlite3_str_appendf(tls, p, ts+29209 /* "a%d=?%d" */, libc.VaList(bp+152, ii, (ii+2))) + Xsqlite3_str_appendf(tls, p, ts+29715 /* "a%d=?%d" */, libc.VaList(bp+152, ii, (ii+2))) } } - Xsqlite3_str_appendf(tls, p, ts+29217 /* " WHERE rowid=?1" */, 0) + Xsqlite3_str_appendf(tls, p, ts+29723 /* " WHERE rowid=?1" */, 0) zSql = Xsqlite3_str_finish(tls, p) if zSql == uintptr(0) { rc = SQLITE_NOMEM @@ -152614,26 +155235,26 @@ func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefi var azSql = [8]uintptr{ // Write the xxx_node table - ts + 29233, /* "INSERT OR REPLAC..." */ - ts + 29286, /* "DELETE FROM '%q'..." */ + ts + 29739, /* "INSERT OR REPLAC..." */ + ts + 29792, /* "DELETE FROM '%q'..." */ // Read and write the xxx_rowid table - ts + 29331, /* "SELECT nodeno FR..." */ - ts + 29383, /* "INSERT OR REPLAC..." */ - ts + 29437, /* "DELETE FROM '%q'..." */ + ts + 29837, /* "SELECT nodeno FR..." */ + ts + 29889, /* "INSERT OR REPLAC..." */ + ts + 29943, /* "DELETE FROM '%q'..." */ // Read and write the xxx_parent table - ts + 29482, /* "SELECT parentnod..." */ - ts + 29540, /* "INSERT OR REPLAC..." */ - ts + 29595, /* "DELETE FROM '%q'..." */ -} /* sqlite3.c:191553:21 */ + ts + 29988, /* "SELECT parentnod..." */ + ts + 30046, /* "INSERT OR REPLAC..." */ + ts + 30101, /* "DELETE FROM '%q'..." */ +} /* sqlite3.c:194576:21 */ // The second argument to this function contains the text of an SQL statement // that returns a single integer value. The statement is compiled and executed // using database connection db. If successful, the integer value returned // is written to *piVal and SQLITE_OK returned. Otherwise, an SQLite error // code is returned and the value of *piVal after returning is not defined. -func getIntFromStmt(tls *libc.TLS, db uintptr, zSql uintptr, piVal uintptr) int32 { /* sqlite3.c:191673:12: */ +func getIntFromStmt(tls *libc.TLS, db uintptr, zSql uintptr, piVal uintptr) int32 { /* sqlite3.c:194696:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -152664,7 +155285,7 @@ func getIntFromStmt(tls *libc.TLS, db uintptr, zSql uintptr, piVal uintptr) int3 // This ensures that each node is stored on a single database page. If the // database page-size is so large that more than RTREE_MAXCELLS entries // would fit in a single node, use a smaller node-size. -func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzErr uintptr) int32 { /* sqlite3.c:191703:12: */ +func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzErr uintptr) int32 { /* sqlite3.c:194726:12: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -152672,7 +155293,7 @@ func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzEr var zSql uintptr if isCreate != 0 { *(*int32)(unsafe.Pointer(bp + 48 /* iPageSize */)) = 0 - zSql = Xsqlite3_mprintf(tls, ts+29642 /* "PRAGMA %Q.page_s..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, ts+30148 /* "PRAGMA %Q.page_s..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb)) rc = getIntFromStmt(tls, db, zSql, bp+48 /* &iPageSize */) if rc == SQLITE_OK { (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize = (*(*int32)(unsafe.Pointer(bp + 48 /* iPageSize */)) - 64) @@ -152684,7 +155305,7 @@ func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzEr } } else { zSql = Xsqlite3_mprintf(tls, - ts+29662, /* "SELECT length(da..." */ + ts+30168, /* "SELECT length(da..." */ libc.VaList(bp+16, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) rc = getIntFromStmt(tls, db, zSql, (pRtree + 32 /* &.iNodeSize */)) if rc != SQLITE_OK { @@ -152692,7 +155313,7 @@ func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzEr } else if (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize < (512 - 64) { rc = (SQLITE_CORRUPT | (int32(1) << 8)) - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+29719, /* "undersize RTree ..." */ + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+30225, /* "undersize RTree ..." */ libc.VaList(bp+40, (*Rtree)(unsafe.Pointer(pRtree)).FzName)) } } @@ -152702,7 +155323,7 @@ func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzEr } // Return the length of a token -func rtreeTokenLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:191746:12: */ +func rtreeTokenLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:194769:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -152717,7 +155338,7 @@ func rtreeTokenLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:191746:12: // argv[1] -> database name // argv[2] -> table name // argv[...] -> column names... -func rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:191760:12: */ +func rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:194783:12: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -152743,10 +155364,10 @@ func rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr ii = 4 *(*[5]uintptr)(unsafe.Pointer(bp + 96 /* aErrMsg */)) = [5]uintptr{ uintptr(0), // 0 - ts + 29754, /* "Wrong number of ..." */ // 1 - ts + 29797, /* "Too few columns ..." */ // 2 - ts + 29832, /* "Too many columns..." */ // 3 - ts + 29868, /* "Auxiliary rtree ..." */ // 4 + ts + 30260, /* "Wrong number of ..." */ // 1 + ts + 30303, /* "Too few columns ..." */ // 2 + ts + 30338, /* "Too many columns..." */ // 3 + ts + 30374, /* "Auxiliary rtree ..." */ // 4 } // Aux columns counted by a u8 @@ -152783,7 +155404,7 @@ __2: // that is successful, call sqlite3_declare_vtab() to configure // the r-tree table schema. pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, ts+29905, /* "CREATE TABLE x(%..." */ + Xsqlite3_str_appendf(tls, pSql, ts+30411, /* "CREATE TABLE x(%..." */ libc.VaList(bp+16, rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = 4 __3: @@ -152795,7 +155416,7 @@ __3: goto __6 } (*Rtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, ts+29929 /* ",%.*s" */, libc.VaList(bp+32, rtreeTokenLength(tls, (zArg+uintptr(1))), (zArg+uintptr(1)))) + Xsqlite3_str_appendf(tls, pSql, ts+30435 /* ",%.*s" */, libc.VaList(bp+32, rtreeTokenLength(tls, (zArg+uintptr(1))), (zArg+uintptr(1)))) goto __7 __6: if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux) > 0) { @@ -152818,7 +155439,7 @@ __4: goto __5 __5: ; - Xsqlite3_str_appendf(tls, pSql, ts+29935 /* ");" */, 0) + Xsqlite3_str_appendf(tls, pSql, ts+30441 /* ");" */, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(!(zSql != 0)) { goto __10 @@ -152917,7 +155538,7 @@ __25: return rc } -var azFormat = [2]uintptr{ts + 29938 /* ",%.*s REAL" */, ts + 29949 /* ",%.*s INT" */} /* sqlite3.c:191826:25 */ +var azFormat = [2]uintptr{ts + 30444 /* ",%.*s REAL" */, ts + 30455 /* ",%.*s INT" */} /* sqlite3.c:194849:25 */ // Implementation of a scalar function that decodes r-tree nodes to // human readable strings. This can be used for debugging and analysis. @@ -152933,7 +155554,7 @@ var azFormat = [2]uintptr{ts + 29938 /* ",%.*s REAL" */, ts + 29949 /* ",%.*s IN // entry for each cell in the r-tree node. Each entry is itself a // list, containing the 8-byte rowid/pageno followed by the // *2 coordinates. -func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:191897:13: */ +func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:194920:13: */ bp := tls.Alloc(1072) defer tls.Free(1072) @@ -152972,13 +155593,13 @@ func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlit nodeGetCell(tls, bp+56 /* &tree */, bp+16 /* &node */, ii, bp+1024 /* &cell */) if ii > 0 { - Xsqlite3_str_append(tls, pOut, ts+16003 /* " " */, 1) + Xsqlite3_str_append(tls, pOut, ts+12479 /* " " */, 1) } - Xsqlite3_str_appendf(tls, pOut, ts+29959 /* "{%lld" */, libc.VaList(bp, (*RtreeCell)(unsafe.Pointer(bp+1024 /* &cell */)).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, ts+30465 /* "{%lld" */, libc.VaList(bp, (*RtreeCell)(unsafe.Pointer(bp+1024 /* &cell */)).FiRowid)) for jj = 0; jj < int32((*Rtree)(unsafe.Pointer(bp+56 /* &tree */)).FnDim2); jj++ { - Xsqlite3_str_appendf(tls, pOut, ts+29965 /* " %g" */, libc.VaList(bp+8, float64(*(*RtreeValue)(unsafe.Pointer((bp + 1024 /* &cell */ + 8 /* &.aCoord */) + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, ts+30471 /* " %g" */, libc.VaList(bp+8, float64(*(*RtreeValue)(unsafe.Pointer((bp + 1024 /* &cell */ + 8 /* &.aCoord */) + uintptr(jj)*4))))) } - Xsqlite3_str_append(tls, pOut, ts+29969 /* "}" */, 1) + Xsqlite3_str_append(tls, pOut, ts+30475 /* "}" */, 1) } errCode = Xsqlite3_str_errcode(tls, pOut) Xsqlite3_result_text(tls, ctx, Xsqlite3_str_finish(tls, pOut), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) @@ -152993,11 +155614,11 @@ func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlit // The depth value is 0 for all nodes other than the root node, and the root // node always has nodeno=1, so the example above is the primary use for this // routine. This routine is intended for testing and analysis only. -func rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:191948:13: */ +func rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:194971:13: */ _ = nArg if (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != SQLITE_BLOB) || (Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < 2) { - Xsqlite3_result_error(tls, ctx, ts+29971 /* "Invalid argument..." */, -1) + Xsqlite3_result_error(tls, ctx, ts+30477 /* "Invalid argument..." */, -1) } else { var zBlob uintptr = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) Xsqlite3_result_int(tls, ctx, readInt16(tls, zBlob)) @@ -153021,15 +155642,15 @@ type RtreeCheck1 = struct { FzReport uintptr FnErr int32 _ [4]byte -} /* sqlite3.c:191964:9 */ +} /* sqlite3.c:194987:9 */ // Context object passed between the various routines that make up the // implementation of integrity-check function rtreecheck(). -type RtreeCheck = RtreeCheck1 /* sqlite3.c:191964:27 */ +type RtreeCheck = RtreeCheck1 /* sqlite3.c:194987:27 */ // Reset SQL statement pStmt. If the sqlite3_reset() call returns an error, // and RtreeCheck.rc==SQLITE_OK, set RtreeCheck.rc to the error code. -func rtreeCheckReset(tls *libc.TLS, pCheck uintptr, pStmt uintptr) { /* sqlite3.c:191986:13: */ +func rtreeCheckReset(tls *libc.TLS, pCheck uintptr, pStmt uintptr) { /* sqlite3.c:195009:13: */ var rc int32 = Xsqlite3_reset(tls, pStmt) if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = rc @@ -153042,7 +155663,7 @@ func rtreeCheckReset(tls *libc.TLS, pCheck uintptr, pStmt uintptr) { /* sqlite3. // // If successful, a pointer to the new SQL statement is returned. Otherwise, // NULL is returned and an error code left in RtreeCheck.rc. -func rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:191999:21: */ +func rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:195022:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -153070,7 +155691,7 @@ func rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // The second and subsequent arguments to this function are a printf() // style format string and arguments. This function formats the string and // appends it to the report being accumuated in pCheck. -func rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:192028:13: */ +func rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:195051:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -153082,10 +155703,10 @@ func rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr if z == uintptr(0) { (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = SQLITE_NOMEM } else { - (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, ts+30004, /* "%z%s%z" */ + (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, ts+30510, /* "%z%s%z" */ libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport, func() uintptr { if (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - return ts + 5715 /* "\n" */ + return ts + 5791 /* "\n" */ } return ts + 800 /* "" */ }(), z)) @@ -153110,7 +155731,7 @@ func rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr // Or, if an error does occur, NULL is returned and an error code left // in the RtreeCheck object. The final value of *pnNode is undefined in // this case. -func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) uintptr { /* sqlite3.c:192062:11: */ +func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) uintptr { /* sqlite3.c:195085:11: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -153118,7 +155739,7 @@ func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) if ((*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK) && ((*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0)) { (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = rtreeCheckPrepare(tls, pCheck, - ts+30011, /* "SELECT data FROM..." */ + ts+30517, /* "SELECT data FROM..." */ libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } @@ -153137,7 +155758,7 @@ func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) } rtreeCheckReset(tls, pCheck, (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if ((*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK) && (pRet == uintptr(0)) { - rtreeCheckAppendMsg(tls, pCheck, ts+30056 /* "Node %lld missin..." */, libc.VaList(bp+16, iNode)) + rtreeCheckAppendMsg(tls, pCheck, ts+30562 /* "Node %lld missin..." */, libc.VaList(bp+16, iNode)) } } @@ -153154,15 +155775,15 @@ func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) // In both cases, this function checks that there exists an entry with // IPK value iKey and the second column set to iVal. // -func rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey I64, iVal I64) { /* sqlite3.c:192106:13: */ +func rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey I64, iVal I64) { /* sqlite3.c:195129:13: */ bp := tls.Alloc(96) defer tls.Free(96) var rc int32 var pStmt uintptr *(*[2]uintptr)(unsafe.Pointer(bp + 80 /* azSql */)) = [2]uintptr{ - ts + 30088, /* "SELECT parentnod..." */ - ts + 30142, /* "SELECT nodeno FR..." */ + ts + 30594, /* "SELECT parentnod..." */ + ts + 30648, /* "SELECT nodeno FR..." */ } if *(*uintptr)(unsafe.Pointer((pCheck + 40 /* &.aCheckMapping */) + uintptr(bLeaf)*8)) == uintptr(0) { @@ -153177,23 +155798,23 @@ func rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey I64, iVa Xsqlite3_bind_int64(tls, pStmt, 1, iKey) rc = Xsqlite3_step(tls, pStmt) if rc == SQLITE_DONE { - rtreeCheckAppendMsg(tls, pCheck, ts+30190, /* "Mapping (%lld ->..." */ + rtreeCheckAppendMsg(tls, pCheck, ts+30696, /* "Mapping (%lld ->..." */ libc.VaList(bp+16, iKey, iVal, func() uintptr { if bLeaf != 0 { - return ts + 30235 /* "%_rowid" */ + return ts + 30741 /* "%_rowid" */ } - return ts + 30243 /* "%_parent" */ + return ts + 30749 /* "%_parent" */ }())) } else if rc == SQLITE_ROW { var ii I64 = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { rtreeCheckAppendMsg(tls, pCheck, - ts+30252, /* "Found (%lld -> %..." */ + ts+30758, /* "Found (%lld -> %..." */ libc.VaList(bp+40, iKey, ii, func() uintptr { if bLeaf != 0 { - return ts + 30235 /* "%_rowid" */ + return ts + 30741 /* "%_rowid" */ } - return ts + 30243 /* "%_parent" */ + return ts + 30749 /* "%_parent" */ }(), iKey, iVal)) } } @@ -153210,7 +155831,7 @@ func rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey I64, iVa // containing pCell. In this case it is also verified that the two // sets of coordinates are mutually consistent and an error message added // to the RtreeCheck object if they are not. -func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, pCell uintptr, pParent uintptr) { /* sqlite3.c:192158:13: */ +func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, pCell uintptr, pParent uintptr) { /* sqlite3.c:195181:13: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -153236,7 +155857,7 @@ func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, return (libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 48 /* &c1 */)) > *(*RtreeValue)(unsafe.Pointer(bp + 52 /* &c2 */)))) }() != 0 { rtreeCheckAppendMsg(tls, pCheck, - ts+30310 /* "Dimension %d of ..." */, libc.VaList(bp, i, iCell, iNode)) + ts+30816 /* "Dimension %d of ..." */, libc.VaList(bp, i, iCell, iNode)) } if pParent != 0 { @@ -153256,7 +155877,7 @@ func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, return (libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 52 /* &c2 */)) > *(*RtreeValue)(unsafe.Pointer(bp + 60 /* &p2 */)))) }() != 0) { rtreeCheckAppendMsg(tls, pCheck, - ts+30358 /* "Dimension %d of ..." */, libc.VaList(bp+24, i, iCell, iNode)) + ts+30864 /* "Dimension %d of ..." */, libc.VaList(bp+24, i, iCell, iNode)) } } } @@ -153268,7 +155889,7 @@ func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, // // If any problems are discovered, an error message is appended to the // report accumulated in the RtreeCheck object. -func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr, iNode I64) { /* sqlite3.c:192204:13: */ +func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr, iNode I64) { /* sqlite3.c:195227:13: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -153279,14 +155900,14 @@ func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr if aNode != 0 { if *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)) < 4 { rtreeCheckAppendMsg(tls, pCheck, - ts+30425 /* "Node %lld is too..." */, libc.VaList(bp, iNode, *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)))) + ts+30931 /* "Node %lld is too..." */, libc.VaList(bp, iNode, *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)))) } else { var nCell int32 // Number of cells on page var i int32 // Used to iterate through cells if aParent == uintptr(0) { iDepth = readInt16(tls, aNode) if iDepth > RTREE_MAX_DEPTH { - rtreeCheckAppendMsg(tls, pCheck, ts+30459 /* "Rtree depth out ..." */, libc.VaList(bp+16, iDepth)) + rtreeCheckAppendMsg(tls, pCheck, ts+30965 /* "Rtree depth out ..." */, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } @@ -153294,7 +155915,7 @@ func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr nCell = readInt16(tls, (aNode + 2)) if (4 + (nCell * (8 + (((*RtreeCheck)(unsafe.Pointer(pCheck)).FnDim * 2) * 4)))) > *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)) { rtreeCheckAppendMsg(tls, pCheck, - ts+30489, /* "Node %lld is too..." */ + ts+30995, /* "Node %lld is too..." */ libc.VaList(bp+24, iNode, nCell, *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)))) } else { for i = 0; i < nCell; i++ { @@ -153322,20 +155943,20 @@ func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr // %_rowid or %_parent table is exactly nExpect. If not, it adds // an error message to the report in the RtreeCheck object indicated // by the first argument. -func rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect I64) { /* sqlite3.c:192267:13: */ +func rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect I64) { /* sqlite3.c:195290:13: */ bp := tls.Alloc(48) defer tls.Free(48) if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { var pCount uintptr - pCount = rtreeCheckPrepare(tls, pCheck, ts+30544, /* "SELECT count(*) ..." */ + pCount = rtreeCheckPrepare(tls, pCheck, ts+31050, /* "SELECT count(*) ..." */ libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == SQLITE_ROW { var nActual I64 = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { rtreeCheckAppendMsg(tls, pCheck, - ts+30575 /* "Wrong number of ..." */, libc.VaList(bp+24, zTbl, nExpect, nActual)) + ts+31081 /* "Wrong number of ..." */, libc.VaList(bp+24, zTbl, nExpect, nActual)) } } (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -153345,7 +155966,7 @@ func rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect I64) { // This function does the bulk of the work for the rtree integrity-check. // It is called by rtreecheck(), which is the SQL function implementation. -func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzReport uintptr) int32 { /* sqlite3.c:192291:12: */ +func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzReport uintptr) int32 { /* sqlite3.c:195314:12: */ bp := tls.Alloc(120) defer tls.Free(120) @@ -153365,13 +155986,13 @@ func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRep // to ensure that the queries run as part of this integrity-check operate // on a consistent snapshot. if Xsqlite3_get_autocommit(tls, db) != 0 { - (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = Xsqlite3_exec(tls, db, ts+15585 /* "BEGIN" */, uintptr(0), uintptr(0), uintptr(0)) + (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = Xsqlite3_exec(tls, db, ts+16049 /* "BEGIN" */, uintptr(0), uintptr(0), uintptr(0)) bEnd = 1 } // Find the number of auxiliary columns if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).Frc == SQLITE_OK { - pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+30642 /* "SELECT * FROM %Q..." */, libc.VaList(bp, zDb, zTab)) + pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+31148 /* "SELECT * FROM %Q..." */, libc.VaList(bp, zDb, zTab)) if pStmt != 0 { nAux = (Xsqlite3_column_count(tls, pStmt) - 2) Xsqlite3_finalize(tls, pStmt) @@ -153380,12 +156001,12 @@ func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRep } // Find number of dimensions in the rtree table. - pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+28462 /* "SELECT * FROM %Q..." */, libc.VaList(bp+16, zDb, zTab)) + pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+28968 /* "SELECT * FROM %Q..." */, libc.VaList(bp+16, zDb, zTab)) if pStmt != 0 { var rc int32 (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).FnDim = (((Xsqlite3_column_count(tls, pStmt) - 1) - nAux) / 2) if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnDim < 1 { - rtreeCheckAppendMsg(tls, bp+32 /* &check */, ts+30670 /* "Schema corrupt o..." */, 0) + rtreeCheckAppendMsg(tls, bp+32 /* &check */, ts+31176 /* "Schema corrupt o..." */, 0) } else if SQLITE_ROW == Xsqlite3_step(tls, pStmt) { (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).FbInt = (libc.Bool32(Xsqlite3_column_type(tls, pStmt, 1) == SQLITE_INTEGER)) } @@ -153400,8 +156021,8 @@ func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRep if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).Frc == SQLITE_OK { rtreeCheckNode(tls, bp+32 /* &check */, 0, uintptr(0), int64(1)) } - rtreeCheckCount(tls, bp+32 /* &check */, ts+30701 /* "_rowid" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnLeaf)) - rtreeCheckCount(tls, bp+32 /* &check */, ts+30708 /* "_parent" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnNonLeaf)) + rtreeCheckCount(tls, bp+32 /* &check */, ts+31207 /* "_rowid" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnLeaf)) + rtreeCheckCount(tls, bp+32 /* &check */, ts+31214 /* "_parent" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnNonLeaf)) } // Finalize SQL statements used by the integrity-check @@ -153411,7 +156032,7 @@ func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRep // If one was opened, close the transaction if bEnd != 0 { - var rc int32 = Xsqlite3_exec(tls, db, ts+30716 /* "END" */, uintptr(0), uintptr(0), uintptr(0)) + var rc int32 = Xsqlite3_exec(tls, db, ts+31222 /* "END" */, uintptr(0), uintptr(0), uintptr(0)) if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).Frc == SQLITE_OK { (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = rc } @@ -153451,13 +156072,13 @@ func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRep // as there are non-leaf cells in the r-tree structure, and that // there is a non-leaf cell that corresponds to each entry in the // %_parent table. -func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:192396:13: */ +func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:195419:13: */ bp := tls.Alloc(8) defer tls.Free(8) if (nArg != 1) && (nArg != 2) { Xsqlite3_result_error(tls, ctx, - ts+30720 /* "wrong number of ..." */, -1) + ts+31226 /* "wrong number of ..." */, -1) } else { var rc int32 *(*uintptr)(unsafe.Pointer(bp /* zReport */)) = uintptr(0) @@ -153465,7 +156086,7 @@ func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqli var zTab uintptr if nArg == 1 { zTab = zDb - zDb = ts + 8333 /* "main" */ + zDb = ts + 8426 /* "main" */ } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -153475,7 +156096,7 @@ func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqli if *(*uintptr)(unsafe.Pointer(bp /* zReport */)) != 0 { return *(*uintptr)(unsafe.Pointer(bp /* zReport */)) } - return ts + 4999 /* "ok" */ + return ts + 5075 /* "ok" */ }(), -1, libc.UintptrFromInt32(-1)) } else { Xsqlite3_result_error_code(tls, ctx, rc) @@ -153510,7 +156131,7 @@ func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqli // Compiler and version // Datatype for coordinates -type GeoCoord = float32 /* sqlite3.c:192520:15 */ +type GeoCoord = float32 /* sqlite3.c:195543:15 */ // Internal representation of a polygon. // @@ -153536,7 +156157,7 @@ type GeoPoly1 = struct { FnVertex int32 Fhdr [4]uint8 Fa [8]GeoCoord -} /* sqlite3.c:192544:9 */ +} /* sqlite3.c:195567:9 */ // Internal representation of a polygon. // @@ -153558,7 +156179,7 @@ type GeoPoly1 = struct { // warnings coming from some compiler (notably, clang). In reality, the size // of each GeoPoly memory allocate is adjusted as necessary so that the // GeoPoly.a[] array at the end is the appropriate size. -type GeoPoly = GeoPoly1 /* sqlite3.c:192544:24 */ +type GeoPoly = GeoPoly1 /* sqlite3.c:195567:24 */ // The size of a memory allocation needed for a GeoPoly object sufficient // to hold N coordinate pairs. @@ -153575,7 +156196,7 @@ type GeoParse1 = struct { FnErr int32 _ [4]byte Fa uintptr -} /* sqlite3.c:192567:9 */ +} /* sqlite3.c:195590:9 */ // The size of a memory allocation needed for a GeoPoly object sufficient // to hold N coordinate pairs. @@ -153585,10 +156206,10 @@ type GeoParse1 = struct { // to silence (incorrect) UBSAN warnings if the array index is too large. // State of a parse of a GeoJSON input. -type GeoParse = GeoParse1 /* sqlite3.c:192567:25 */ +type GeoParse = GeoParse1 /* sqlite3.c:195590:25 */ // Do a 4-byte byte swap -func geopolySwab32(tls *libc.TLS, a uintptr) { /* sqlite3.c:192577:13: */ +func geopolySwab32(tls *libc.TLS, a uintptr) { /* sqlite3.c:195600:13: */ var t uint8 = *(*uint8)(unsafe.Pointer(a)) *(*uint8)(unsafe.Pointer(a)) = *(*uint8)(unsafe.Pointer(a + 3)) *(*uint8)(unsafe.Pointer(a + 3)) = t @@ -153598,7 +156219,7 @@ func geopolySwab32(tls *libc.TLS, a uintptr) { /* sqlite3.c:192577:13: */ } // Skip whitespace. Return the next non-whitespace character. -func geopolySkipSpace(tls *libc.TLS, p uintptr) int8 { /* sqlite3.c:192587:13: */ +func geopolySkipSpace(tls *libc.TLS, p uintptr) int8 { /* sqlite3.c:195610:13: */ for jsonIsSpace[*(*uint8)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(p)).Fz))] != 0 { (*GeoParse)(unsafe.Pointer(p)).Fz++ } @@ -153607,7 +156228,7 @@ func geopolySkipSpace(tls *libc.TLS, p uintptr) int8 { /* sqlite3.c:192587:13: * // Parse out a number. Write the value into *pVal if pVal!=0. // return non-zero on success and zero if the next token is not a number. -func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlite3.c:192595:12: */ +func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlite3.c:195618:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -153666,7 +156287,7 @@ func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlit // is available // var r float64 at bp, 8 - Xsqlite3AtoF(tls, (*GeoParse)(unsafe.Pointer(p)).Fz, bp /* &r */, j, SQLITE_UTF8) + Xsqlite3AtoF(tls, (*GeoParse)(unsafe.Pointer(p)).Fz, bp /* &r */, j, uint8(SQLITE_UTF8)) *(*GeoCoord)(unsafe.Pointer(pVal)) = GeoCoord(*(*float64)(unsafe.Pointer(bp /* r */))) } *(*uintptr)(unsafe.Pointer(p /* &.z */)) += (uintptr(j)) @@ -153679,7 +156300,7 @@ func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlit // that object. // // If any error occurs, return NULL. -func geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) uintptr { /* sqlite3.c:192653:16: */ +func geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) uintptr { /* sqlite3.c:195676:16: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -153824,7 +156445,7 @@ __16: // in the binary format or JSON text. Compute a GeoPoly object and // return a pointer to that object. Or if the input is not a well-formed // polygon, put an error message in sqlite3_context and return NULL. -func geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) uintptr { /* sqlite3.c:192730:16: */ +func geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) uintptr { /* sqlite3.c:195753:16: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -153886,7 +156507,7 @@ func geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ui // If the input is a well-formed Geopoly BLOB or JSON string // then return the BLOB representation of the polygon. Otherwise // return NULL. -func geopolyBlobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192786:13: */ +func geopolyBlobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:195809:13: */ var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) if p != 0 { Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */ @@ -153899,7 +156520,7 @@ func geopolyBlobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // // Interpret X as a polygon and render it as a JSON array // of coordinates. Or, if X is not a valid polygon, return NULL. -func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192805:13: */ +func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:195828:13: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -153908,11 +156529,11 @@ func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db uintptr = Xsqlite3_context_db_handle(tls, context) var x uintptr = Xsqlite3_str_new(tls, db) var i int32 - Xsqlite3_str_append(tls, x, ts+30771 /* "[" */, 1) + Xsqlite3_str_append(tls, x, ts+31277 /* "[" */, 1) for i = 0; i < (*GeoPoly)(unsafe.Pointer(p)).FnVertex; i++ { - Xsqlite3_str_appendf(tls, x, ts+30773 /* "[%!g,%!g]," */, libc.VaList(bp, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((i)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((i)*2)+1))*4))))) + Xsqlite3_str_appendf(tls, x, ts+31279 /* "[%!g,%!g]," */, libc.VaList(bp, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((i)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((i)*2)+1))*4))))) } - Xsqlite3_str_appendf(tls, x, ts+30784 /* "[%!g,%!g]]" */, libc.VaList(bp+16, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */)))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + 1*4))))) + Xsqlite3_str_appendf(tls, x, ts+31290 /* "[%!g,%!g]]" */, libc.VaList(bp+16, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */)))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + 1*4))))) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) Xsqlite3_free(tls, p) } @@ -153922,7 +156543,7 @@ func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // // Interpret X as a polygon and render it as a SVG . // Additional arguments are added as attributes to the . -func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192831:13: */ +func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:195854:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -153936,19 +156557,19 @@ func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var x uintptr = Xsqlite3_str_new(tls, db) var i int32 var cSep int8 = int8('\'') - Xsqlite3_str_appendf(tls, x, ts+30795 /* "" */, 0) + Xsqlite3_str_appendf(tls, x, ts+31339 /* ">" */, 0) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) Xsqlite3_free(tls, p) } @@ -153968,7 +156589,7 @@ func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // Rotate by R around the point (0,0): // // geopoly_xform(poly, cos(R), sin(R), -sin(R), cos(R), 0, 0) -func geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192878:13: */ +func geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:195901:13: */ var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) var A float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) var B float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) @@ -154001,7 +156622,7 @@ func geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) // This routine can also be used to detect polygons that rotate in // the wrong direction. Polygons are suppose to be counter-clockwise (CCW). // This routine returns a negative value for clockwise (CW) polygons. -func geopolyArea(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:192914:15: */ +func geopolyArea(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:195937:15: */ var rArea float64 = 0.0 var ii int32 for ii = 0; ii < ((*GeoPoly)(unsafe.Pointer(p)).FnVertex - 1); ii++ { @@ -154021,7 +156642,7 @@ func geopolyArea(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:192914:15: */ // enclosed by the polygon. If the polygon circulates clockwise instead // of counterclockwise (as it should) then return the negative of the // enclosed area. Otherwise return NULL. -func geopolyAreaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192936:13: */ +func geopolyAreaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:195959:13: */ var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) if p != 0 { Xsqlite3_result_double(tls, context, geopolyArea(tls, p)) @@ -154040,7 +156661,7 @@ func geopolyAreaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // // Use this routine to sanitize historical inputs that that sometimes // contain polygons that wind in the wrong direction. -func geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192961:13: */ +func geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:195984:13: */ var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) if p != 0 { if geopolyArea(tls, p) < 0.0 { @@ -154076,7 +156697,7 @@ func geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } // Fast approximation for sine(X) for X between -0.5*pi and 2*pi -func geopolySine(tls *libc.TLS, r float64) float64 { /* sqlite3.c:192989:15: */ +func geopolySine(tls *libc.TLS, r float64) float64 { /* sqlite3.c:196012:15: */ if r >= (float64(1.5) * 3.1415926535897932385) { r = r - (float64(2.0) * 3.1415926535897932385) @@ -154096,7 +156717,7 @@ func geopolySine(tls *libc.TLS, r float64) float64 { /* sqlite3.c:192989:15: */ // // Construct a simple, convex, regular polygon centered at X, Y // with circumradius R and with N sides. -func geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193010:13: */ +func geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196033:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -154141,7 +156762,7 @@ func geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // // If pPoly is NULL but aCoord is not NULL, then compute a new GeoPoly from // the bounding box in aCoord and return a pointer to that GeoPoly. -func geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, pRc uintptr) uintptr { /* sqlite3.c:193053:16: */ +func geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, pRc uintptr) uintptr { /* sqlite3.c:196076:16: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -154277,7 +156898,7 @@ __4: } // Implementation of the geopoly_bbox(X) SQL function. -func geopolyBBoxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193124:13: */ +func geopolyBBoxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196147:13: */ var p uintptr = geopolyBBox(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0), uintptr(0)) if p != 0 { Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */ @@ -154290,13 +156911,13 @@ func geopolyBBoxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { type GeoBBox1 = struct { FisInit int32 Fa [4]RtreeCoord -} /* sqlite3.c:193140:9 */ +} /* sqlite3.c:196163:9 */ // State vector for the geopoly_group_bbox() aggregate function. -type GeoBBox = GeoBBox1 /* sqlite3.c:193140:24 */ +type GeoBBox = GeoBBox1 /* sqlite3.c:196163:24 */ // Implementation of the geopoly_group_bbox(X) aggregate SQL function. -func geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193150:13: */ +func geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196173:13: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -154330,7 +156951,7 @@ func geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } -func geopolyBBoxFinal(tls *libc.TLS, context uintptr) { /* sqlite3.c:193173:13: */ +func geopolyBBoxFinal(tls *libc.TLS, context uintptr) { /* sqlite3.c:196196:13: */ var p uintptr var pBBox uintptr pBBox = Xsqlite3_aggregate_context(tls, context, 0) @@ -154357,7 +156978,7 @@ func geopolyBBoxFinal(tls *libc.TLS, context uintptr) { /* sqlite3.c:193173:13: // // The left-most coordinate min(x1,x2) is not considered to be part of // the line segment for the purposes of this analysis. -func pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 float64, x2 float64, y2 float64) int32 { /* sqlite3.c:193203:12: */ +func pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 float64, x2 float64, y2 float64) int32 { /* sqlite3.c:196226:12: */ var y float64 if (x0 == x1) && (y0 == y1) { return 2 @@ -154398,7 +157019,7 @@ func pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 floa // Return +2 if point X,Y is within polygon P. // Return +1 if point X,Y is on the polygon boundary. // Return 0 if point X,Y is outside the polygon -func geopolyContainsPointFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193234:13: */ +func geopolyContainsPointFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196257:13: */ var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) var x0 float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) var y0 float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) @@ -154436,7 +157057,7 @@ func geopolyContainsPointFunc(tls *libc.TLS, context uintptr, argc int32, argv u // Return +1 if P2 is contained within P1 // Return 0 if any part of P2 is on the outside of P1 // -func geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193277:13: */ +func geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196300:13: */ var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) var p2 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0)) if (p1 != 0) && (p2 != 0) { @@ -154468,10 +157089,10 @@ type GeoEvent1 = struct { _ [4]byte FpSeg uintptr FpNext uintptr -} /* sqlite3.c:193297:9 */ +} /* sqlite3.c:196320:9 */ // Objects used by the overlap algorihm. -type GeoEvent = GeoEvent1 /* sqlite3.c:193297:25 */ +type GeoEvent = GeoEvent1 /* sqlite3.c:196320:25 */ type GeoSegment1 = struct { FC float64 FB float64 @@ -154482,20 +157103,20 @@ type GeoSegment1 = struct { Fidx uint32 _ [4]byte FpNext uintptr -} /* sqlite3.c:193297:9 */ +} /* sqlite3.c:196320:9 */ -type GeoSegment = GeoSegment1 /* sqlite3.c:193298:27 */ +type GeoSegment = GeoSegment1 /* sqlite3.c:196321:27 */ type GeoOverlap1 = struct { FaEvent uintptr FaSegment uintptr FnEvent int32 FnSegment int32 -} /* sqlite3.c:193299:9 */ +} /* sqlite3.c:196322:9 */ -type GeoOverlap = GeoOverlap1 /* sqlite3.c:193299:27 */ +type GeoOverlap = GeoOverlap1 /* sqlite3.c:196322:27 */ // Add a single segment and its associated events. -func geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 GeoCoord, y0 GeoCoord, x1 GeoCoord, y1 GeoCoord, side uint8, idx uint32) { /* sqlite3.c:193324:13: */ +func geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 GeoCoord, y0 GeoCoord, x1 GeoCoord, y1 GeoCoord, side uint8, idx uint32) { /* sqlite3.c:196347:13: */ var pSeg uintptr var pEvent uintptr if x0 == x1 { @@ -154529,7 +157150,7 @@ func geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 GeoCoord, y0 GeoCoord, x1 } // Insert all segments and events for polygon pPoly. -func geopolyAddSegments(tls *libc.TLS, p uintptr, pPoly uintptr, side uint8) { /* sqlite3.c:193368:13: */ +func geopolyAddSegments(tls *libc.TLS, p uintptr, pPoly uintptr, side uint8) { /* sqlite3.c:196391:13: */ var i uint32 var x uintptr for i = uint32(0); i < (uint32((*GeoPoly)(unsafe.Pointer(pPoly)).FnVertex) - uint32(1)); i++ { @@ -154541,7 +157162,7 @@ func geopolyAddSegments(tls *libc.TLS, p uintptr, pPoly uintptr, side uint8) { / } // Merge two lists of sorted events by X coordinate -func geopolyEventMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:193386:17: */ +func geopolyEventMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:196409:17: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -154571,7 +157192,7 @@ func geopolyEventMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { / } // Sort an array of nEvent event objects into a list. -func geopolySortEventsByX(tls *libc.TLS, aEvent uintptr, nEvent int32) uintptr { /* sqlite3.c:193408:17: */ +func geopolySortEventsByX(tls *libc.TLS, aEvent uintptr, nEvent int32) uintptr { /* sqlite3.c:196431:17: */ bp := tls.Alloc(400) defer tls.Free(400) @@ -154601,7 +157222,7 @@ func geopolySortEventsByX(tls *libc.TLS, aEvent uintptr, nEvent int32) uintptr { } // Merge two lists of sorted segments by Y, and then by C. -func geopolySegmentMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:193433:19: */ +func geopolySegmentMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:196456:19: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -154636,7 +157257,7 @@ func geopolySegmentMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { // Sort a list of GeoSegments in order of increasing Y and in the event of // a tie, increasing C (slope). -func geopolySortSegmentsByYAndC(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:193458:19: */ +func geopolySortSegmentsByYAndC(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:196481:19: */ bp := tls.Alloc(400) defer tls.Free(400) @@ -154666,7 +157287,7 @@ func geopolySortSegmentsByYAndC(tls *libc.TLS, pList uintptr) uintptr { /* sqlit } // Determine the overlap between two polygons -func geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:193484:12: */ +func geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:196507:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -154705,7 +157326,7 @@ __1: geopolyAddSegments(tls, p, p1, uint8(1)) geopolyAddSegments(tls, p, p2, uint8(2)) pThisEvent = geopolySortEventsByX(tls, (*GeoOverlap)(unsafe.Pointer(p)).FaEvent, (*GeoOverlap)(unsafe.Pointer(p)).FnEvent) - if (*GeoEvent)(unsafe.Pointer(pThisEvent)).Fx == 0.0 { + if (pThisEvent != 0) && ((*GeoEvent)(unsafe.Pointer(pThisEvent)).Fx == 0.0) { rX = -1.0 } else { rX = 0.0 @@ -154893,7 +157514,7 @@ geopolyOverlapDone: // 3 P2 is completely contained within P1 // 4 P1 and P2 are the same polygon // NULL Either P1 or P2 or both are not valid polygons -func geopolyOverlapFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193607:13: */ +func geopolyOverlapFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196630:13: */ var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv)), uintptr(0)) var p2 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uintptr(0)) if (p1 != 0) && (p2 != 0) { @@ -154909,7 +157530,7 @@ func geopolyOverlapFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr } // Enable or disable debugging output -func geopolyDebugFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193629:13: */ +func geopolyDebugFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196652:13: */ } // This function is the implementation of both the xConnect and xCreate @@ -154919,7 +157540,7 @@ func geopolyDebugFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) // argv[1] -> database name // argv[2] -> table name // argv[...] -> column names... -func geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:193648:12: */ +func geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:196671:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -154949,7 +157570,7 @@ __1: (*Rtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&rtreeModule)) (*Rtree)(unsafe.Pointer(pRtree)).FzDb = (pRtree + 1*968) (*Rtree)(unsafe.Pointer(pRtree)).FzName = ((*Rtree)(unsafe.Pointer(pRtree)).FzDb + uintptr((nDb + int64(1)))) - (*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = RTREE_COORD_REAL32 + (*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = U8(RTREE_COORD_REAL32) (*Rtree)(unsafe.Pointer(pRtree)).FnDim = U8(2) (*Rtree)(unsafe.Pointer(pRtree)).FnDim2 = U8(4) libc.Xmemcpy(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(nDb)) @@ -154959,7 +157580,7 @@ __1: // that is successful, call sqlite3_declare_vtab() to configure // the r-tree table schema. pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, ts+30846 /* "CREATE TABLE x(_..." */, 0) + Xsqlite3_str_appendf(tls, pSql, ts+31352 /* "CREATE TABLE x(_..." */, 0) (*Rtree)(unsafe.Pointer(pRtree)).FnAux = U8(1) // Add one for _shape (*Rtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = U8(1) // The _shape column is always not-null ii = 3 @@ -154968,7 +157589,7 @@ __2: goto __4 } (*Rtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, ts+30868 /* ",%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, ts+31374 /* ",%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto __3 __3: ii++ @@ -154976,7 +157597,7 @@ __3: goto __4 __4: ; - Xsqlite3_str_appendf(tls, pSql, ts+29935 /* ");" */, 0) + Xsqlite3_str_appendf(tls, pSql, ts+30441 /* ");" */, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(!(zSql != 0)) { goto __5 @@ -155034,12 +157655,12 @@ __11: } // GEOPOLY virtual table module xCreate method. -func geopolyCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:193732:12: */ +func geopolyCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:196755:12: */ return geopolyInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 1) } // GEOPOLY virtual table module xConnect method. -func geopolyConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:193745:12: */ +func geopolyConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:196768:12: */ return geopolyInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 0) } @@ -155053,7 +157674,7 @@ func geopolyConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv ui // 3 search for objects overlapping the same bounding box // that contains polygon argv[0] // 4 full table scan -func geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:193768:12: */ +func geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:196791:12: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -155101,7 +157722,7 @@ func geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uint // Always returns pCsr->sPoint *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8 /* iNode */)) - (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(PARTLY_WITHIN) *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)), iRowid, bp+16 /* &iCell */) (*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = U8(*(*int32)(unsafe.Pointer(bp + 16 /* iCell */))) @@ -155192,7 +157813,7 @@ __12: ; (*RtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1) (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0) - (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = PARTLY_WITHIN + (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(PARTLY_WITHIN) *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */))) = *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) = uintptr(0) @@ -155220,7 +157841,7 @@ geopoly_filter_end: // 3 "rtree" R-tree within query using geopoly_within() // 4 "fullscan" full-table scan. // ------------------------------------------------ -func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:193899:12: */ +func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:196922:12: */ var ii int32 var iRowidTerm int32 = -1 var iFuncTerm int32 = -1 @@ -155246,7 +157867,7 @@ func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* s if iRowidTerm >= 0 { (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 1 - (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 10064 /* "rowid" */ + (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 10157 /* "rowid" */ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8)).FargvIndex = 1 (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8)).Fomit = uint8(1) (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 30.0 @@ -155256,7 +157877,7 @@ func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* s } if iFuncTerm >= 0 { (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 30872 /* "rtree" */ + (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 31378 /* "rtree" */ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8)).FargvIndex = 1 (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8)).Fomit = uint8(0) (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 300.0 @@ -155264,14 +157885,14 @@ func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* s return SQLITE_OK } (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 4 - (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 30878 /* "fullscan" */ + (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 31384 /* "fullscan" */ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 3000000.0 (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK } // GEOPOLY virtual table module xColumn method. -func geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:193951:12: */ +func geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:196974:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -155336,7 +157957,7 @@ func geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* // argv[1] = rowid after the change. Never NULL // argv[2] = new value for _shape // argv[3] = new value for first application-defined column.... -func geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:194006:12: */ +func geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:197029:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -155402,7 +158023,7 @@ __1: if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == SQLITE_ERROR) { goto __4 } - (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+30887 /* "_shape does not ..." */, 0) + (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+31393 /* "_shape does not ..." */, 0) __4: ; goto geopoly_update_end @@ -155546,15 +158167,15 @@ geopoly_update_end: // Report that geopoly_overlap() is an overloaded function suitable // for use in xBestIndex. -func geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:194142:12: */ - if Xsqlite3_stricmp(tls, zName, ts+30927 /* "geopoly_overlap" */) == 0 { +func geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:197165:12: */ + if Xsqlite3_stricmp(tls, zName, ts+31433 /* "geopoly_overlap" */) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{geopolyOverlapFunc})) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return SQLITE_INDEX_CONSTRAINT_FUNCTION } - if Xsqlite3_stricmp(tls, zName, ts+30943 /* "geopoly_within" */) == 0 { + if Xsqlite3_stricmp(tls, zName, ts+31449 /* "geopoly_within" */) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{geopolyWithinFunc})) @@ -155587,9 +158208,9 @@ var geopolyModule = Sqlite3_module{ FxRename: 0, // xRename - rename the table FxSavepoint: 0, // xRollbackTo FxShadowName: 0, // xShadowName -} /* sqlite3.c:194163:23 */ +} /* sqlite3.c:197186:23 */ -func sqlite3_geopoly_init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:194190:12: */ +func sqlite3_geopoly_init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:197213:12: */ var rc int32 = SQLITE_OK var i int32 for i = 0; (uint64(i) < (uint64(unsafe.Sizeof(aFunc1)) / uint64(unsafe.Sizeof(struct { @@ -155619,7 +158240,7 @@ func sqlite3_geopoly_init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:194190 uintptr(0), aAgg1[i].FxStep, aAgg1[i].FxFinal) } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, ts+30958 /* "geopoly" */, uintptr(unsafe.Pointer(&geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, ts+31464 /* "geopoly" */, uintptr(unsafe.Pointer(&geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -155631,26 +158252,26 @@ var aFunc1 = [12]struct { _ [6]byte FzName uintptr }{ - {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 30966 /* "geopoly_area" */}, - {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 30979 /* "geopoly_blob" */}, - {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 30992 /* "geopoly_json" */}, - {FxFunc: 0, FnArg: int8(-1), FbPure: uint8(1), FzName: ts + 31005 /* "geopoly_svg" */}, - {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 30943 /* "geopoly_within" */}, - {FxFunc: 0, FnArg: int8(3), FbPure: uint8(1), FzName: ts + 31017 /* "geopoly_contains..." */}, - {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 30927 /* "geopoly_overlap" */}, - {FxFunc: 0, FnArg: int8(1), FzName: ts + 31040 /* "geopoly_debug" */}, - {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 31054 /* "geopoly_bbox" */}, - {FxFunc: 0, FnArg: int8(7), FbPure: uint8(1), FzName: ts + 31067 /* "geopoly_xform" */}, - {FxFunc: 0, FnArg: int8(4), FbPure: uint8(1), FzName: ts + 31081 /* "geopoly_regular" */}, - {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 31097 /* "geopoly_ccw" */}, -} /* sqlite3.c:194197:5 */ + {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 31472 /* "geopoly_area" */}, + {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 31485 /* "geopoly_blob" */}, + {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 31498 /* "geopoly_json" */}, + {FxFunc: 0, FnArg: int8(-1), FbPure: uint8(1), FzName: ts + 31511 /* "geopoly_svg" */}, + {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 31449 /* "geopoly_within" */}, + {FxFunc: 0, FnArg: int8(3), FbPure: uint8(1), FzName: ts + 31523 /* "geopoly_contains..." */}, + {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 31433 /* "geopoly_overlap" */}, + {FxFunc: 0, FnArg: int8(1), FzName: ts + 31546 /* "geopoly_debug" */}, + {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 31560 /* "geopoly_bbox" */}, + {FxFunc: 0, FnArg: int8(7), FbPure: uint8(1), FzName: ts + 31573 /* "geopoly_xform" */}, + {FxFunc: 0, FnArg: int8(4), FbPure: uint8(1), FzName: ts + 31587 /* "geopoly_regular" */}, + {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 31603 /* "geopoly_ccw" */}, +} /* sqlite3.c:197220:5 */ var aAgg1 = [1]struct { FxStep uintptr FxFinal uintptr FzName uintptr }{ - {FxStep: 0, FxFinal: 0, FzName: ts + 31109 /* "geopoly_group_bb..." */}, -} /* sqlite3.c:194215:5 */ + {FxStep: 0, FxFinal: 0, FzName: ts + 31615 /* "geopoly_group_bb..." */}, +} /* sqlite3.c:197238:5 */ //************* End of geopoly.c ******************************************** //************* Continuing where we left off in rtree.c ********************* @@ -155658,30 +158279,30 @@ var aAgg1 = [1]struct { // Register the r-tree module with database handle db. This creates the // virtual table module "rtree" and the debugging/analysis scalar // function "rtreenode". -func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:194250:20: */ +func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:197273:20: */ var utf8 int32 = SQLITE_UTF8 var rc int32 - rc = Xsqlite3_create_function(tls, db, ts+31128 /* "rtreenode" */, 2, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + rc = Xsqlite3_create_function(tls, db, ts+31634 /* "rtreenode" */, 2, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rtreenode})), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, ts+31138 /* "rtreedepth" */, 1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + rc = Xsqlite3_create_function(tls, db, ts+31644 /* "rtreedepth" */, 1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rtreedepth})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, ts+31149 /* "rtreecheck" */, -1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + rc = Xsqlite3_create_function(tls, db, ts+31655 /* "rtreecheck" */, -1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rtreecheck})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - var c uintptr = RTREE_COORD_REAL32 - rc = Xsqlite3_create_module_v2(tls, db, ts+30872 /* "rtree" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0)) + var c uintptr = uintptr(RTREE_COORD_REAL32) + rc = Xsqlite3_create_module_v2(tls, db, ts+31378 /* "rtree" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { - var c uintptr = RTREE_COORD_INT32 - rc = Xsqlite3_create_module_v2(tls, db, ts+31160 /* "rtree_i32" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0)) + var c uintptr = uintptr(RTREE_COORD_INT32) + rc = Xsqlite3_create_module_v2(tls, db, ts+31666 /* "rtree_i32" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { rc = sqlite3_geopoly_init(tls, db) @@ -155695,7 +158316,7 @@ func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:194250:20 // or sqlite3_rtree_query_callback(). In other words, this routine is the // destructor for an RtreeGeomCallback objecct. This routine is called when // the corresponding SQL function is deleted. -func rtreeFreeCallback(tls *libc.TLS, p uintptr) { /* sqlite3.c:194289:13: */ +func rtreeFreeCallback(tls *libc.TLS, p uintptr) { /* sqlite3.c:197312:13: */ var pInfo uintptr = p if (*RtreeGeomCallback)(unsafe.Pointer(pInfo)).FxDestructor != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pInfo + 16 /* &.xDestructor */))))(tls, (*RtreeGeomCallback)(unsafe.Pointer(pInfo)).FpContext) @@ -155704,7 +158325,7 @@ func rtreeFreeCallback(tls *libc.TLS, p uintptr) { /* sqlite3.c:194289:13: */ } // This routine frees the BLOB that is returned by geomCallback(). -func rtreeMatchArgFree(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:194298:13: */ +func rtreeMatchArgFree(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:197321:13: */ var i int32 var p uintptr = pArg for i = 0; i < (*RtreeMatchArg)(unsafe.Pointer(p)).FnParam; i++ { @@ -155725,7 +158346,7 @@ func rtreeMatchArgFree(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:194298:13: */ // The R-Tree MATCH operator will read the returned BLOB, deserialize // the RtreeMatchArg object, and use the RtreeMatchArg object to figure // out which elements of the R-Tree should be returned by the query. -func geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* sqlite3.c:194321:13: */ +func geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* sqlite3.c:197344:13: */ var pGeomCtx uintptr = Xsqlite3_user_data(tls, ctx) var pBlob uintptr var nBlob Sqlite3_int64 @@ -155753,13 +158374,13 @@ func geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* sql Xsqlite3_result_error_nomem(tls, ctx) rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, ts+28448 /* "RtreeMatchArg" */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{rtreeMatchArgFree}))) + Xsqlite3_result_pointer(tls, ctx, pBlob, ts+28954 /* "RtreeMatchArg" */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{rtreeMatchArgFree}))) } } } // Register a new geometry function for use with the r-tree MATCH operator. -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) int32 { /* sqlite3.c:194359:16: */ +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) int32 { /* sqlite3.c:197382:16: */ var pGeomCtx uintptr // Context object for new user-function // Allocate and populate the context object. @@ -155779,7 +158400,7 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, // Register a new 2nd-generation geometry function for use with the // r-tree MATCH operator. -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) int32 { /* sqlite3.c:194383:16: */ +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) int32 { /* sqlite3.c:197406:16: */ var pGeomCtx uintptr // Context object for new user-function // Allocate and populate the context object. @@ -156232,7 +158853,7 @@ type sqlite3rbu = struct { FnRbu int32 _ [4]byte FpRbuFd uintptr -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ //************* End of rtree.c ********************************************** //************* Begin file icu.c ******************************************** @@ -156633,7 +159254,7 @@ type sqlite3rbu = struct { // #include "sqlite3.h" ** Required for error code definitions ** -type Sqlite3rbu = sqlite3rbu /* sqlite3.c:195610:27 */ +type Sqlite3rbu = sqlite3rbu /* sqlite3.c:198633:27 */ //************* End of sqlite3rbu.h ***************************************** //************* Continuing where we left off in sqlite3rbu.c **************** @@ -156695,7 +159316,7 @@ type Sqlite3rbu = sqlite3rbu /* sqlite3.c:195610:27 */ type RbuFrame1 = struct { FiDbPage U32 FiWalFrame U32 -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ //************* End of sqlite3rbu.h ***************************************** //************* Continuing where we left off in sqlite3rbu.c **************** @@ -156754,7 +159375,7 @@ type RbuFrame1 = struct { // Only valid if STAGE==1. The RBU database name of the table // currently being read. -type RbuFrame = RbuFrame1 /* sqlite3.c:196034:25 */ +type RbuFrame = RbuFrame1 /* sqlite3.c:199057:25 */ type RbuObjIter1 = struct { FpTblIter uintptr FpIdxIter uintptr @@ -156786,9 +159407,9 @@ type RbuObjIter1 = struct { FaIdxCol uintptr FzIdxSql uintptr FpRbuUpdate uintptr -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ -type RbuObjIter = RbuObjIter1 /* sqlite3.c:196035:27 */ +type RbuObjIter = RbuObjIter1 /* sqlite3.c:199058:27 */ type RbuState1 = struct { FeStage int32 _ [4]byte @@ -156803,16 +159424,16 @@ type RbuState1 = struct { _ [4]byte FiOalSz I64 FnPhaseOneStep I64 -} /* sqlite3.c:196036:9 */ +} /* sqlite3.c:199059:9 */ -type RbuState = RbuState1 /* sqlite3.c:196036:25 */ +type RbuState = RbuState1 /* sqlite3.c:199059:25 */ type RbuSpan1 = struct { FzSpan uintptr FnSpan int32 _ [4]byte -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ -type RbuSpan = RbuSpan1 /* sqlite3.c:196037:24 */ +type RbuSpan = RbuSpan1 /* sqlite3.c:199060:24 */ type rbu_vfs = struct { Fbase Sqlite3_vfs FpRealVfs uintptr @@ -156820,9 +159441,9 @@ type rbu_vfs = struct { FpRbu uintptr FpMain uintptr FpMainRbu uintptr -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ -type Rbu_vfs = rbu_vfs /* sqlite3.c:196038:24 */ +type Rbu_vfs = rbu_vfs /* sqlite3.c:199061:24 */ type rbu_file = struct { Fbase Sqlite3_file FpReal uintptr @@ -156841,16 +159462,16 @@ type rbu_file = struct { FpWalFd uintptr FpMainNext uintptr FpMainRbuNext uintptr -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ -type Rbu_file = rbu_file /* sqlite3.c:196039:25 */ +type Rbu_file = rbu_file /* sqlite3.c:199062:25 */ type RbuUpdateStmt1 = struct { FzMask uintptr FpUpdate uintptr FpNext uintptr -} /* sqlite3.c:195610:9 */ +} /* sqlite3.c:198633:9 */ -type RbuUpdateStmt = RbuUpdateStmt1 /* sqlite3.c:196040:30 */ +type RbuUpdateStmt = RbuUpdateStmt1 /* sqlite3.c:199063:30 */ // True for an RBU vacuum handle, or false otherwise. @@ -156869,7 +159490,7 @@ type RbuUpdateStmt = RbuUpdateStmt1 /* sqlite3.c:196040:30 */ // finished, leave *pz pointing to the first character past the end of // the integer. The *pLen parameter holds the length of the string // in *pz and is decremented once for each character in the integer. -func rbuDeltaGetInt(tls *libc.TLS, pz uintptr, pLen uintptr) uint32 { /* sqlite3.c:196330:21: */ +func rbuDeltaGetInt(tls *libc.TLS, pz uintptr, pLen uintptr) uint32 { /* sqlite3.c:199353:21: */ var v uint32 = uint32(0) var c int32 var z uintptr = *(*uintptr)(unsafe.Pointer(pz)) @@ -156892,7 +159513,7 @@ var zValue = [128]int8{ int8(25), int8(26), int8(27), int8(28), int8(29), int8(30), int8(31), int8(32), int8(33), int8(34), int8(35), int8(-1), int8(-1), int8(-1), int8(-1), int8(36), int8(-1), int8(37), int8(38), int8(39), int8(40), int8(41), int8(42), int8(43), int8(44), int8(45), int8(46), int8(47), int8(48), int8(49), int8(50), int8(51), int8(52), int8(53), int8(54), int8(55), int8(56), int8(57), int8(58), int8(59), int8(60), int8(61), int8(62), int8(-1), int8(-1), int8(-1), int8(63), int8(-1), -} /* sqlite3.c:196331:28 */ +} /* sqlite3.c:199354:28 */ // Apply a delta. // @@ -156912,7 +159533,7 @@ var zValue = [128]int8{ // // Refer to the delta_create() documentation above for a description // of the delta file format. -func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, lenDelta int32, zOut uintptr) int32 { /* sqlite3.c:196411:12: */ +func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, lenDelta int32, zOut uintptr) int32 { /* sqlite3.c:199434:12: */ bp := tls.Alloc(12) defer tls.Free(12) *(*uintptr)(unsafe.Pointer(bp)) = zDelta @@ -157002,7 +159623,7 @@ func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, le return -1 } -func rbuDeltaOutputSize(tls *libc.TLS, zDelta uintptr, lenDelta int32) int32 { /* sqlite3.c:196497:12: */ +func rbuDeltaOutputSize(tls *libc.TLS, zDelta uintptr, lenDelta int32) int32 { /* sqlite3.c:199520:12: */ bp := tls.Alloc(12) defer tls.Free(12) *(*uintptr)(unsafe.Pointer(bp)) = zDelta @@ -157027,7 +159648,7 @@ func rbuDeltaOutputSize(tls *libc.TLS, zDelta uintptr, lenDelta int32) int32 { / // arguments must be passed to this function. The first is the blob to // patch and the second the patch to apply. If no error occurs, this // function returns the patched blob. -func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196519:13: */ +func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:199542:13: */ var aDelta uintptr var nDelta int32 var aOrig uintptr @@ -157044,7 +159665,7 @@ func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // Figure out the size of the output nOut = rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, ts+31170 /* "corrupt fossil d..." */, -1) + Xsqlite3_result_error(tls, context, ts+31676 /* "corrupt fossil d..." */, -1) return } @@ -157055,7 +159676,7 @@ func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr nOut2 = rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, ts+31170 /* "corrupt fossil d..." */, -1) + Xsqlite3_result_error(tls, context, ts+31676 /* "corrupt fossil d..." */, -1) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))) } @@ -157070,7 +159691,7 @@ func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // an SQLite error code. Additionally, set output variable *pzErrmsg to // point to a buffer containing an error message. It is the responsibility // of the caller to (eventually) free this buffer using sqlite3_free(). -func prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:196572:12: */ +func prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:199595:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -157088,7 +159709,7 @@ func prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg // If an error has occurred, then set *pzErrmsg to point to a buffer // containing an error message. It is the responsibility of the caller // to eventually free this buffer using sqlite3_free(). -func resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:196594:12: */ +func resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:199617:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -157112,7 +159733,7 @@ func resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) int32 // // If argument zSql is NULL, this function assumes that an OOM has occurred. // In this case SQLITE_NOMEM is returned and *ppStmt set to NULL. -func prepareFreeAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:196617:12: */ +func prepareFreeAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:199640:12: */ var rc int32 if zSql == uintptr(0) { @@ -157127,7 +159748,7 @@ func prepareFreeAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErr // Free the RbuObjIter.azTblCol[] and RbuObjIter.abTblPk[] arrays allocated // by an earlier call to rbuObjIterCacheTableInfo(). -func rbuObjIterFreeCols(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:196639:13: */ +func rbuObjIterFreeCols(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:199662:13: */ var i int32 for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))) @@ -157145,7 +159766,7 @@ func rbuObjIterFreeCols(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:196639:13: // Finalize all statements and free all allocations that are specific to // the current object (table/index pair). -func rbuObjIterClearStatements(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:196659:13: */ +func rbuObjIterClearStatements(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:199682:13: */ var pUp uintptr Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect) @@ -157175,7 +159796,7 @@ func rbuObjIterClearStatements(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:1966 // Clean up any resources allocated as part of the iterator object passed // as the only argument. -func rbuObjIterFinalize(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:196691:13: */ +func rbuObjIterFinalize(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:199714:13: */ rbuObjIterClearStatements(tls, pIter) Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter) Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter) @@ -157189,7 +159810,7 @@ func rbuObjIterFinalize(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:196691:13: // pointing to the next entry. Otherwise, an error code and message is // left in the RBU handle passed as the first argument. A copy of the // error code is returned. -func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:196707:12: */ +func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:199730:12: */ var rc int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc if rc == SQLITE_OK { @@ -157198,7 +159819,7 @@ func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3. if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+31191 /* "DROP TRIGGER IF ..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + ts+31697 /* "DROP TRIGGER IF ..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } if rc == SQLITE_OK { @@ -157270,7 +159891,7 @@ func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3. // // For an rbu vacuum handle, a copy of the first argument is returned if // the second argument is either missing or 0 (not a view). -func rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3.c:196787:13: */ +func rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3.c:199810:13: */ var p uintptr = Xsqlite3_user_data(tls, pCtx) var zIn uintptr @@ -157282,7 +159903,7 @@ func rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -1, uintptr(0)) } } else { - if (libc.Xstrlen(tls, zIn) > uint64(4)) && (libc.Xmemcmp(tls, ts+28361 /* "data" */, zIn, uint64(4)) == 0) { + if (libc.Xstrlen(tls, zIn) > uint64(4)) && (libc.Xmemcmp(tls, ts+28867 /* "data" */, zIn, uint64(4)) == 0) { var i int32 for i = 4; (int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) <= '9'); i++ { } @@ -157300,7 +159921,7 @@ func rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { // pointing to the first entry. Otherwise, an error code and message is // left in the RBU handle passed as the first argument. A copy of the // error code is returned. -func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:196823:12: */ +func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:199846:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -157310,9 +159931,9 @@ func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3 rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter /* &.pTblIter */), (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+31362 /* "SELECT rbu_targe..." */, libc.VaList(bp, func() uintptr { + ts+31868 /* "SELECT rbu_targe..." */, libc.VaList(bp, func() uintptr { if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - return ts + 31512 /* "AND rootpage!=0 ..." */ + return ts + 32018 /* "AND rootpage!=0 ..." */ } return ts + 800 /* "" */ }()))) @@ -157320,7 +159941,7 @@ func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3 if rc == SQLITE_OK { rc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 8 /* &.pIdxIter */), (p + 64 /* &.zErrmsg */), - ts+31553 /* "SELECT name, roo..." */) + ts+32059 /* "SELECT name, roo..." */) } (*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = 1 @@ -157335,7 +159956,7 @@ func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3 // than SQLITE_OK), then this function returns NULL without modifying the // stored error code. In this case it still calls sqlite3_free() on any // printf() parameters associated with %z conversions. -func rbuMPrintf(tls *libc.TLS, p uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:196858:13: */ +func rbuMPrintf(tls *libc.TLS, p uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:199881:13: */ var zSql uintptr = uintptr(0) var ap Va_list _ = ap @@ -157361,7 +159982,7 @@ func rbuMPrintf(tls *libc.TLS, p uintptr, zFmt uintptr, va uintptr) uintptr { /* // If an error occurs, an error code and error message is stored in the // RBU handle. If an error has already occurred when this function is // called, it is a no-op. -func rbuMPrintfExec(tls *libc.TLS, p uintptr, db uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:196883:12: */ +func rbuMPrintfExec(tls *libc.TLS, p uintptr, db uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:199906:12: */ var ap Va_list _ = ap var zSql uintptr @@ -157387,7 +160008,7 @@ func rbuMPrintfExec(tls *libc.TLS, p uintptr, db uintptr, zFmt uintptr, va uintp // error has already occurred when this function is called, return NULL // immediately without attempting the allocation or modifying the stored // error code. -func rbuMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:196910:13: */ +func rbuMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:199933:13: */ var pRet uintptr = uintptr(0) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -157404,7 +160025,7 @@ func rbuMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlit // Allocate and zero the pIter->azTblCol[] and abTblPk[] arrays so that // there is room for at least nCol elements. If an OOM occurs, store an // error code in the RBU handle passed as the first argument. -func rbuAllocateIterArrays(tls *libc.TLS, p uintptr, pIter uintptr, nCol int32) { /* sqlite3.c:196930:13: */ +func rbuAllocateIterArrays(tls *libc.TLS, p uintptr, pIter uintptr, nCol int32) { /* sqlite3.c:199953:13: */ var nByte Sqlite3_int64 = (Sqlite3_int64((((uint64(2) * uint64(unsafe.Sizeof(uintptr(0)))) + uint64(unsafe.Sizeof(int32(0)))) + (uint64(3) * uint64(unsafe.Sizeof(U8(0))))) * uint64(nCol))) var azNew uintptr @@ -157427,7 +160048,7 @@ func rbuAllocateIterArrays(tls *libc.TLS, p uintptr, pIter uintptr, nCol int32) // If an OOM condition is encountered when attempting to allocate memory, // output variable (*pRc) is set to SQLITE_NOMEM before returning. Otherwise, // if the allocation succeeds, (*pRc) is left unchanged. -func rbuStrndup(tls *libc.TLS, zStr uintptr, pRc uintptr) uintptr { /* sqlite3.c:196955:13: */ +func rbuStrndup(tls *libc.TLS, zStr uintptr, pRc uintptr) uintptr { /* sqlite3.c:199978:13: */ var zRet uintptr = uintptr(0) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { @@ -157450,7 +160071,7 @@ func rbuStrndup(tls *libc.TLS, zStr uintptr, pRc uintptr) uintptr { /* sqlite3.c // If the sqlite3_finalize() call indicates that an error occurs, and the // rbu handle error code is not already set, set the error code and error // message accordingly. -func rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { /* sqlite3.c:196980:13: */ +func rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { /* sqlite3.c:200003:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -157500,7 +160121,7 @@ func rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { /* sqlite3.c:196980: // }else{ // return RBU_PK_NONE // } -func rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnum uintptr, piPk uintptr) { /* sqlite3.c:197028:13: */ +func rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnum uintptr, piPk uintptr) { /* sqlite3.c:200051:13: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -157521,7 +160142,7 @@ func rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnum (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */), (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+31678 /* "SELECT (sql LIKE..." */, libc.VaList(bp, zTab))) + ts+32184 /* "SELECT (sql LIKE..." */, libc.VaList(bp, zTab))) if !(((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK) || (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */))) != SQLITE_ROW)) { goto __1 } @@ -157539,7 +160160,7 @@ __2: *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */)), 1) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */ + 1*8), (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+31759 /* "PRAGMA index_lis..." */, libc.VaList(bp+8, zTab))) + Xsqlite3_mprintf(tls, ts+32265 /* "PRAGMA index_lis..." */, libc.VaList(bp+8, zTab))) if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0) { goto __3 } @@ -157557,7 +160178,7 @@ __4: } (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */ + 2*8), (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+31780 /* "SELECT rootpage ..." */, libc.VaList(bp+16, zIdx))) + ts+32286 /* "SELECT rootpage ..." */, libc.VaList(bp+16, zIdx))) if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) { goto __7 } @@ -157581,7 +160202,7 @@ __5: ; (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */ + 3*8), (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+31831 /* "PRAGMA table_inf..." */, libc.VaList(bp+24, zTab))) + Xsqlite3_mprintf(tls, ts+32337 /* "PRAGMA table_inf..." */, libc.VaList(bp+24, zTab))) if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) { goto __10 } @@ -157616,11 +160237,12 @@ __15: goto __14 goto __16 __16: + } // This is a helper function for rbuObjIterCacheTableInfo(). It populates // the pIter->abIndexed[] array. -func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:197112:13: */ +func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:200135:13: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -157630,7 +160252,7 @@ func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, (uint64(unsafe.Sizeof(U8(0))) * uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol))) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+16 /* &pList */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+31852 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + Xsqlite3_mprintf(tls, ts+32358 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*RbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 @@ -157645,7 +160267,7 @@ func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq libc.Xmemset(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, 0x01, (uint64(unsafe.Sizeof(U8(0))) * uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol))) } (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+24 /* &pXInfo */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+31880 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx))) + Xsqlite3_mprintf(tls, ts+32386 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx))) for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pXInfo */)))) { var iCid int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pXInfo */)), 1) if iCid >= 0 { @@ -157678,7 +160300,7 @@ func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq // Return SQLITE_OK if successful, or an SQLite error code otherwise. If // an error does occur, an error code and error message are also left in // the RBU handle. -func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:197166:12: */ +func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:200189:12: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -157695,7 +160317,7 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { / rbuTableType(tls, p, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, (pIter + 72 /* &.eType */), bp+56 /* &iTnum */, (pIter + 108 /* &.iPkTnum */)) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+20702 /* "no such table: %..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+21109 /* "no such table: %..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc @@ -157708,18 +160330,18 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { / // of the input table. Ignore any input table columns that begin with // "rbu_". (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+64 /* &pStmt */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+31909 /* "SELECT * FROM '%..." */, libc.VaList(bp+8, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + Xsqlite3_mprintf(tls, ts+32415 /* "SELECT * FROM '%..." */, libc.VaList(bp+8, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */))) rbuAllocateIterArrays(tls, p, pIter, nCol) } for i = 0; ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (i < nCol); i++ { var zName uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)), i) - if Xsqlite3_strnicmp(tls, ts+31928 /* "rbu_" */, zName, 4) != 0 { + if Xsqlite3_strnicmp(tls, ts+32434 /* "rbu_" */, zName, 4) != 0 { var zCopy uintptr = rbuStrndup(tls, zName, (p + 56 /* &.rc */)) *(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(libc.PostIncInt32(&(*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol, 1))*8)) = zCopy - } else if 0 == Xsqlite3_stricmp(tls, ts+31933 /* "rbu_rowid" */, zName) { + } else if 0 == Xsqlite3_stricmp(tls, ts+32439 /* "rbu_rowid" */, zName) { bRbuRowid = 1 } } @@ -157731,12 +160353,12 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { / (bRbuRowid != (libc.Bool32(((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE)))) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, - ts+31943 /* "table %q %s rbu_..." */, libc.VaList(bp+16, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, + ts+32449 /* "table %q %s rbu_..." */, libc.VaList(bp+16, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, func() uintptr { if bRbuRowid != 0 { - return ts + 31972 /* "may not have" */ + return ts + 32478 /* "may not have" */ } - return ts + 31985 /* "requires" */ + return ts + 32491 /* "requires" */ }())) } @@ -157745,7 +160367,7 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { / // aiTblOrder[] arrays at the same time. if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+64 /* &pStmt */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+31994 /* "PRAGMA table_inf..." */, libc.VaList(bp+32, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + Xsqlite3_mprintf(tls, ts+32500 /* "PRAGMA table_inf..." */, libc.VaList(bp+32, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)))) { var zName uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)), 1) @@ -157759,7 +160381,7 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { / } if i == (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+32016, /* "column missing f..." */ + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+32522, /* "column missing f..." */ libc.VaList(bp+40, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName)) } else { var iPk int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)), 5) @@ -157800,7 +160422,7 @@ func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { / // This function constructs and returns a pointer to a nul-terminated // string containing some SQL clause or list based on one or more of the // column names currently stored in the pIter->azTblCol[] array. -func rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:197276:13: */ +func rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:200299:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -157809,8 +160431,8 @@ func rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* var i int32 for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { var z uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = rbuMPrintf(tls, p, ts+32043 /* "%z%s\"%w\"" */, libc.VaList(bp, zList, zSep, z)) - zSep = ts + 15696 /* ", " */ + zList = rbuMPrintf(tls, p, ts+32549 /* "%z%s\"%w\"" */, libc.VaList(bp, zList, zSep, z)) + zSep = ts + 16160 /* ", " */ } return zList } @@ -157819,7 +160441,7 @@ func rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* // in order, for the current table. Before each column name, add the text // zPre. After each column name, add the zPost text. Use zSeparator as // the separator text (usually ", "). -func rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, zSeparator uintptr, zPost uintptr) uintptr { /* sqlite3.c:197297:13: */ +func rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, zSeparator uintptr, zPost uintptr) uintptr { /* sqlite3.c:200320:13: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -157831,7 +160453,7 @@ func rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { if int32(*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = rbuMPrintf(tls, p, ts+32052 /* "%z%s%s\"%w\"%s" */, libc.VaList(bp, zRet, zSep, zPre, zCol, zPost)) + zRet = rbuMPrintf(tls, p, ts+32558 /* "%z%s%s\"%w\"%s" */, libc.VaList(bp, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -157861,7 +160483,7 @@ func rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, // // Instead of "?" placeholders, the actual WHERE clauses created by // this function contain literal SQL values. -func rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, zWrite uintptr) uintptr { /* sqlite3.c:197342:13: */ +func rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, zWrite uintptr) uintptr { /* sqlite3.c:200365:13: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -157870,25 +160492,25 @@ func rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, if bRowid != 0 { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+72 /* &pMax */, (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+32065 /* "SELECT max(_rowi..." */, libc.VaList(bp, zWrite, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + ts+32571 /* "SELECT max(_rowi..." */, libc.VaList(bp, zWrite, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)))) { var iMax Sqlite3_int64 = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)), 0) - zRet = rbuMPrintf(tls, p, ts+32097 /* " WHERE _rowid_ >..." */, libc.VaList(bp+16, iMax)) + zRet = rbuMPrintf(tls, p, ts+32603 /* " WHERE _rowid_ >..." */, libc.VaList(bp+16, iMax)) } rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */))) } else { - var zOrder uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+800 /* "" */, ts+15696 /* ", " */, ts+32120 /* " DESC" */) - var zSelect uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+32126 /* "quote(" */, ts+32133 /* "||','||" */, ts+6671 /* ")" */) - var zList uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+800 /* "" */, ts+15696 /* ", " */, ts+800 /* "" */) + var zOrder uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+800 /* "" */, ts+16160 /* ", " */, ts+32626 /* " DESC" */) + var zSelect uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+32632 /* "quote(" */, ts+32639 /* "||','||" */, ts+6747 /* ")" */) + var zList uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+800 /* "" */, ts+16160 /* ", " */, ts+800 /* "" */) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+72 /* &pMax */, (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+32141, /* "SELECT %s FROM \"..." */ + ts+32647, /* "SELECT %s FROM \"..." */ libc.VaList(bp+24, zSelect, zWrite, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)))) { var zVal uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)), 0) - zRet = rbuMPrintf(tls, p, ts+32183 /* " WHERE (%s) > (%..." */, libc.VaList(bp+56, zList, zVal)) + zRet = rbuMPrintf(tls, p, ts+32689 /* " WHERE (%s) > (%..." */, libc.VaList(bp+56, zList, zVal)) } rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */))) } @@ -157920,7 +160542,7 @@ func rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, // If the expression cannot be created, NULL is returned. In this case, // the caller has to use an OFFSET clause to extract only the required // rows from the sourct table, just as it does for an RBU update operation. -func XrbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:197409:6: */ +func XrbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:200432:6: */ bp := tls.Alloc(192) defer tls.Free(192) @@ -157951,7 +160573,7 @@ func XrbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)) = uintptr(0) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+176 /* &pXInfo */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+31880 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + Xsqlite3_mprintf(tls, ts+32386 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) __1: if !(((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */))))) { goto __2 @@ -157988,7 +160610,7 @@ __10: zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) goto __7 __6: - zCol = ts + 32203 /* "_rowid_" */ + zCol = ts + 32709 /* "_rowid_" */ __7: ; goto __5 @@ -157997,13 +160619,13 @@ __4: __5: ; - zLhs = rbuMPrintf(tls, p, ts+32211, /* "%z%s \"%w\" COLLAT..." */ + zLhs = rbuMPrintf(tls, p, ts+32717, /* "%z%s \"%w\" COLLAT..." */ libc.VaList(bp+8, zLhs, zSep, zCol, zCollate)) - zOrder = rbuMPrintf(tls, p, ts+32232, /* "%z%s \"rbu_imp_%d..." */ + zOrder = rbuMPrintf(tls, p, ts+32738, /* "%z%s \"rbu_imp_%d..." */ libc.VaList(bp+40, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = rbuMPrintf(tls, p, ts+32268, /* "%z%s quote(\"rbu_..." */ + zSelect = rbuMPrintf(tls, p, ts+32774, /* "%z%s quote(\"rbu_..." */ libc.VaList(bp+80, zSelect, zSep, iCol, zCol)) - zSep = ts + 15696 /* ", " */ + zSep = ts + 16160 /* ", " */ iCol++ goto __1 __2: @@ -158022,7 +160644,7 @@ __11: *(*uintptr)(unsafe.Pointer(bp + 184 /* pSel */)) = uintptr(0) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+184 /* &pSel */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+32295, /* "SELECT %s FROM \"..." */ + Xsqlite3_mprintf(tls, ts+32801, /* "SELECT %s FROM \"..." */ libc.VaList(bp+112, zSelect, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if !(((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 184 /* pSel */))))) { goto __13 @@ -158041,8 +160663,8 @@ __14: goto __16 __17: ; - zVector = rbuMPrintf(tls, p, ts+32343 /* "%z%s%s" */, libc.VaList(bp+136, zVector, zSep, zQuoted)) - zSep = ts + 15696 /* ", " */ + zVector = rbuMPrintf(tls, p, ts+32849 /* "%z%s%s" */, libc.VaList(bp+136, zVector, zSep, zQuoted)) + zSep = ts + 16160 /* ", " */ goto __15 __15: iCol++ @@ -158054,7 +160676,7 @@ __16: if !(!(bFailed != 0)) { goto __18 } - zRet = rbuMPrintf(tls, p, ts+32350 /* "(%s) > (%s)" */, libc.VaList(bp+160, zLhs, zVector)) + zRet = rbuMPrintf(tls, p, ts+32856 /* "(%s) > (%s)" */, libc.VaList(bp+160, zLhs, zVector)) __18: ; __13: @@ -158093,7 +160715,7 @@ index_start_out: // pzImposterCols: ... // pzImposterPk: ... // pzWhere: ... -func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterCols uintptr, pzImposterPk uintptr, pzWhere uintptr, pnBind uintptr) uintptr { /* sqlite3.c:197522:13: */ +func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterCols uintptr, pzImposterPk uintptr, pzWhere uintptr, pnBind uintptr) uintptr { /* sqlite3.c:200545:13: */ bp := tls.Alloc(208) defer tls.Free(208) @@ -158111,7 +160733,7 @@ func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterC if rc == SQLITE_OK { rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+200 /* &pXInfo */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+31880 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + Xsqlite3_mprintf(tls, ts+32386 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for (rc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)))) { @@ -158123,7 +160745,7 @@ func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterC if iCid == -2 { var iSeq int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 0) - zRet = Xsqlite3_mprintf(tls, ts+32362 /* "%z%s(%.*s) COLLA..." */, libc.VaList(bp+8, zRet, zCom, + zRet = Xsqlite3_mprintf(tls, ts+32868 /* "%z%s(%.*s) COLLA..." */, libc.VaList(bp+8, zRet, zCom, (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iSeq)*16)).FnSpan, (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iSeq)*16)).FzSpan, zCollate)) zType = ts + 800 /* "" */ } else { @@ -158137,37 +160759,37 @@ func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterC zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - zCol = ts + 32203 /* "_rowid_" */ + zCol = ts + 32709 /* "_rowid_" */ } else { - zCol = ts + 31933 /* "rbu_rowid" */ + zCol = ts + 32439 /* "rbu_rowid" */ } - zType = ts + 13762 /* "INTEGER" */ + zType = ts + 14226 /* "INTEGER" */ } else { zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, ts+32384 /* "%z%s\"%w\" COLLATE..." */, libc.VaList(bp+48, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, ts+32890 /* "%z%s\"%w\" COLLATE..." */, libc.VaList(bp+48, zRet, zCom, zCol, zCollate)) } if ((*RbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0) || (Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 5) != 0) { var zOrder uintptr = func() uintptr { if bDesc != 0 { - return ts + 32120 /* " DESC" */ + return ts + 32626 /* " DESC" */ } return ts + 800 /* "" */ }() - zImpPK = Xsqlite3_mprintf(tls, ts+32404, /* "%z%s\"rbu_imp_%d%..." */ + zImpPK = Xsqlite3_mprintf(tls, ts+32910, /* "%z%s\"rbu_imp_%d%..." */ libc.VaList(bp+80, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, ts+32425, /* "%z%s\"rbu_imp_%d%..." */ + zImpCols = Xsqlite3_mprintf(tls, ts+32931, /* "%z%s\"rbu_imp_%d%..." */ libc.VaList(bp+120, zImpCols, zCom, nBind, zCol, zType, zCollate)) zWhere = Xsqlite3_mprintf(tls, - ts+32458 /* "%z%s\"rbu_imp_%d%..." */, libc.VaList(bp+168, zWhere, zAnd, nBind, zCol)) + ts+32964 /* "%z%s\"rbu_imp_%d%..." */, libc.VaList(bp+168, zWhere, zAnd, nBind, zCol)) if (((zRet == uintptr(0)) || (zImpPK == uintptr(0))) || (zImpCols == uintptr(0))) || (zWhere == uintptr(0)) { rc = SQLITE_NOMEM } - zCom = ts + 15696 /* ", " */ - zAnd = ts + 23050 /* " AND " */ + zCom = ts + 16160 /* ", " */ + zAnd = ts + 23520 /* " AND " */ nBind++ } @@ -158204,7 +160826,7 @@ func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterC // // For tables with implicit rowids - RBU_PK_EXTERNAL and RBU_PK_NONE, append // the text ", old._rowid_" to the returned value. -func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) uintptr { /* sqlite3.c:197634:13: */ +func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) uintptr { /* sqlite3.c:200657:13: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -158215,11 +160837,11 @@ func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, ts+32482 /* "%z%s%s.\"%w\"" */, libc.VaList(bp, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, ts+32988 /* "%z%s%s.\"%w\"" */, libc.VaList(bp, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, ts+32494 /* "%z%sNULL" */, libc.VaList(bp+32, zList, zS)) + zList = Xsqlite3_mprintf(tls, ts+33000 /* "%z%sNULL" */, libc.VaList(bp+32, zList, zS)) } - zS = ts + 15696 /* ", " */ + zS = ts + 16160 /* ", " */ if zList == uintptr(0) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM break @@ -158228,7 +160850,7 @@ func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) // For a table with implicit rowids, append "old._rowid_" to the list. if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) { - zList = rbuMPrintf(tls, p, ts+32503 /* "%z, %s._rowid_" */, libc.VaList(bp+48, zList, zObj)) + zList = rbuMPrintf(tls, p, ts+33009 /* "%z, %s._rowid_" */, libc.VaList(bp+48, zList, zObj)) } } return zList @@ -158242,24 +160864,24 @@ func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) // Return the string: // // "b = ?1 AND c = ?2" -func rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:197675:13: */ +func rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:200698:13: */ bp := tls.Alloc(80) defer tls.Free(80) var zList uintptr = uintptr(0) if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) { - zList = rbuMPrintf(tls, p, ts+32518 /* "_rowid_ = ?%d" */, libc.VaList(bp, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+1))) + zList = rbuMPrintf(tls, p, ts+33024 /* "_rowid_ = ?%d" */, libc.VaList(bp, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+1))) } else if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL { var zSep uintptr = ts + 800 /* "" */ var i int32 for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = rbuMPrintf(tls, p, ts+32532 /* "%z%sc%d=?%d" */, libc.VaList(bp+8, zList, zSep, i, (i+1))) - zSep = ts + 23050 /* " AND " */ + zList = rbuMPrintf(tls, p, ts+33038 /* "%z%sc%d=?%d" */, libc.VaList(bp+8, zList, zSep, i, (i+1))) + zSep = ts + 23520 /* " AND " */ } } zList = rbuMPrintf(tls, p, - ts+32544 /* "_rowid_ = (SELEC..." */, libc.VaList(bp+40, zList)) + ts+33050 /* "_rowid_ = (SELEC..." */, libc.VaList(bp+40, zList)) } else { var zSep uintptr = ts + 800 /* "" */ @@ -158267,8 +160889,8 @@ func rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sq for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = rbuMPrintf(tls, p, ts+32594 /* "%z%s\"%w\"=?%d" */, libc.VaList(bp+48, zList, zSep, zCol, (i+1))) - zSep = ts + 23050 /* " AND " */ + zList = rbuMPrintf(tls, p, ts+33100 /* "%z%s\"%w\"=?%d" */, libc.VaList(bp+48, zList, zSep, zCol, (i+1))) + zSep = ts + 23520 /* " AND " */ } } } @@ -158280,9 +160902,9 @@ func rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sq // is something wrong with the rbu_control value in the rbu_control value // stored in the (p->nCol+1)'th column. Set the error code and error message // of the RBU handle to something reflecting this. -func rbuBadControlError(tls *libc.TLS, p uintptr) { /* sqlite3.c:197716:13: */ +func rbuBadControlError(tls *libc.TLS, p uintptr) { /* sqlite3.c:200739:13: */ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+32607 /* "invalid rbu_cont..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+33113 /* "invalid rbu_cont..." */, 0) } // Return a nul-terminated string containing the comma separated list of @@ -158300,7 +160922,7 @@ func rbuBadControlError(tls *libc.TLS, p uintptr) { /* sqlite3.c:197716:13: */ // argument and NULL is returned. Or, if an error has already occurred // when this function is called, NULL is returned immediately, without // attempting the allocation or modifying the stored error code. -func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr) uintptr { /* sqlite3.c:197739:13: */ +func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr) uintptr { /* sqlite3.c:200762:13: */ bp := tls.Alloc(112) defer tls.Free(112) @@ -158315,17 +160937,17 @@ func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ { var c int8 = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if int32(c) == 'x' { - zList = rbuMPrintf(tls, p, ts+32594, /* "%z%s\"%w\"=?%d" */ + zList = rbuMPrintf(tls, p, ts+33100, /* "%z%s\"%w\"=?%d" */ libc.VaList(bp, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), (i+1))) - zSep = ts + 15696 /* ", " */ + zSep = ts + 16160 /* ", " */ } else if int32(c) == 'd' { - zList = rbuMPrintf(tls, p, ts+32633, /* "%z%s\"%w\"=rbu_del..." */ + zList = rbuMPrintf(tls, p, ts+33139, /* "%z%s\"%w\"=rbu_del..." */ libc.VaList(bp+32, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), (i+1))) - zSep = ts + 15696 /* ", " */ + zSep = ts + 16160 /* ", " */ } else if int32(c) == 'f' { - zList = rbuMPrintf(tls, p, ts+32663, /* "%z%s\"%w\"=rbu_fos..." */ + zList = rbuMPrintf(tls, p, ts+33169, /* "%z%s\"%w\"=rbu_fos..." */ libc.VaList(bp+72, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), (i+1))) - zSep = ts + 15696 /* ", " */ + zSep = ts + 16160 /* ", " */ } } } @@ -158346,7 +160968,7 @@ func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr // argument and NULL is returned. Or, if an error has already occurred // when this function is called, NULL is returned immediately, without // attempting the allocation or modifying the stored error code. -func rbuObjIterGetBindlist(tls *libc.TLS, p uintptr, nBind int32) uintptr { /* sqlite3.c:197793:13: */ +func rbuObjIterGetBindlist(tls *libc.TLS, p uintptr, nBind int32) uintptr { /* sqlite3.c:200816:13: */ var zRet uintptr = uintptr(0) var nByte Sqlite3_int64 = ((int64(2) * Sqlite3_int64(nBind)) + int64(1)) @@ -158376,26 +160998,26 @@ func rbuObjIterGetBindlist(tls *libc.TLS, p uintptr, nBind int32) uintptr { /* s // this function returns: // // PRIMARY KEY("b", "a" DESC) -func rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:197820:13: */ +func rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:200843:13: */ bp := tls.Alloc(72) defer tls.Free(72) var z uintptr = uintptr(0) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - var zSep uintptr = ts + 32700 /* "PRIMARY KEY(" */ + var zSep uintptr = ts + 33206 /* "PRIMARY KEY(" */ *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)) = uintptr(0) // PRAGMA index_list = (pIter->zTbl) *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */)) = uintptr(0) // PRAGMA index_xinfo = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+56 /* &pXList */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+31852 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + Xsqlite3_mprintf(tls, ts+32358 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)))) { var zOrig uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)), 3) - if (zOrig != 0) && (libc.Xstrcmp(tls, zOrig, ts+17201 /* "pk" */) == 0) { + if (zOrig != 0) && (libc.Xstrcmp(tls, zOrig, ts+17626 /* "pk" */) == 0) { var zIdx uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)), 1) if zIdx != 0 { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+64 /* &pXInfo */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+31880 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx))) + Xsqlite3_mprintf(tls, ts+32386 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx))) } break } @@ -158408,15 +161030,15 @@ func rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sql var zCol uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */)), 2) var zDesc uintptr if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */)), 3) != 0 { - zDesc = ts + 32120 /* " DESC" */ + zDesc = ts + 32626 /* " DESC" */ } else { zDesc = ts + 800 /* "" */ } - z = rbuMPrintf(tls, p, ts+32713 /* "%z%s\"%w\"%s" */, libc.VaList(bp+16, z, zSep, zCol, zDesc)) - zSep = ts + 15696 /* ", " */ + z = rbuMPrintf(tls, p, ts+33219 /* "%z%s\"%w\"%s" */, libc.VaList(bp+16, z, zSep, zCol, zDesc)) + zSep = ts + 16160 /* ", " */ } } - z = rbuMPrintf(tls, p, ts+32724 /* "%z)" */, libc.VaList(bp+48, z)) + z = rbuMPrintf(tls, p, ts+33230 /* "%z)" */, libc.VaList(bp+48, z)) rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */))) } return z @@ -158439,7 +161061,7 @@ func rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sql // // CREATE TABLE rbu_imposter2(c1 TEXT, c2 REAL, id INTEGER) WITHOUT ROWID; // -func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:197879:13: */ +func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:200902:13: */ bp := tls.Alloc(184) defer tls.Free(184) @@ -158456,7 +161078,7 @@ func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlit // This is needed for the argument to "PRAGMA index_xinfo". Set // zIdx to point to a nul-terminated string containing this name. (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+168 /* &pQuery */, (p + 64 /* &.zErrmsg */), - ts+32728 /* "SELECT name FROM..." */) + ts+33234 /* "SELECT name FROM..." */) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */)), 1, tnum) if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */))) { @@ -158465,7 +161087,7 @@ func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlit } if zIdx != 0 { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+176 /* &pXInfo */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+31880 /* "PRAGMA main.inde..." */, libc.VaList(bp, zIdx))) + Xsqlite3_mprintf(tls, ts+32386 /* "PRAGMA main.inde..." */, libc.VaList(bp, zIdx))) } rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */))) @@ -158475,25 +161097,25 @@ func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlit var iCid int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 1) var bDesc int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 3) var zCollate uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 4) - zCols = rbuMPrintf(tls, p, ts+32778 /* "%z%sc%d %s COLLA..." */, libc.VaList(bp+8, zCols, zComma, + zCols = rbuMPrintf(tls, p, ts+33284 /* "%z%sc%d %s COLLA..." */, libc.VaList(bp+8, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) - zPk = rbuMPrintf(tls, p, ts+32800 /* "%z%sc%d%s" */, libc.VaList(bp+48, zPk, zComma, iCid, func() uintptr { + zPk = rbuMPrintf(tls, p, ts+33306 /* "%z%sc%d%s" */, libc.VaList(bp+48, zPk, zComma, iCid, func() uintptr { if bDesc != 0 { - return ts + 32120 /* " DESC" */ + return ts + 32626 /* " DESC" */ } return ts + 800 /* "" */ }())) - zComma = ts + 15696 /* ", " */ + zComma = ts + 16160 /* ", " */ } } - zCols = rbuMPrintf(tls, p, ts+32810 /* "%z, id INTEGER" */, libc.VaList(bp+80, zCols)) + zCols = rbuMPrintf(tls, p, ts+33316 /* "%z, id INTEGER" */, libc.VaList(bp+80, zCols)) rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */))) - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+88, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8333 /* "main" */, 1, tnum)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+88, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8426 /* "main" */, 1, tnum)) rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+32825, /* "CREATE TABLE rbu..." */ + ts+33331, /* "CREATE TABLE rbu..." */ libc.VaList(bp+120, zCols, zPk)) - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+136, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8333 /* "main" */, 0, 0)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+136, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8426 /* "main" */, 0, 0)) } } @@ -158515,7 +161137,7 @@ func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlit // More precisely, the "same schema" means the same columns, types, // collation sequences. For tables that do not have an external PRIMARY // KEY, it also means the same PRIMARY KEY declaration. -func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:197953:13: */ +func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:200976:13: */ bp := tls.Alloc(200) defer tls.Free(200) @@ -158524,7 +161146,7 @@ func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite var zComma uintptr = ts + 800 /* "" */ var zSql uintptr = uintptr(0) var iCol int32 - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8333 /* "main" */, 0, 1)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8426 /* "main" */, 0, 1)) for iCol = 0; ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (iCol < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol); iCol++ { var zPk uintptr = ts + 800 /* "" */ @@ -158532,41 +161154,41 @@ func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite *(*uintptr)(unsafe.Pointer(bp + 192 /* zColl */)) = uintptr(0) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, - (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8333 /* "main" */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp+192 /* &zColl */, uintptr(0), uintptr(0), uintptr(0)) + (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8426 /* "main" */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp+192 /* &zColl */, uintptr(0), uintptr(0), uintptr(0)) if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_IPK) && (*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0) { // If the target table column is an "INTEGER PRIMARY KEY", add // "PRIMARY KEY" to the imposter table column declaration. - zPk = ts + 32887 /* "PRIMARY KEY " */ + zPk = ts + 33393 /* "PRIMARY KEY " */ } - zSql = rbuMPrintf(tls, p, ts+32900, /* "%z%s\"%w\" %s %sCO..." */ + zSql = rbuMPrintf(tls, p, ts+33406, /* "%z%s\"%w\" %s %sCO..." */ libc.VaList(bp+32, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp + 192 /* zColl */)), func() uintptr { if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - return ts + 32927 /* " NOT NULL" */ + return ts + 33433 /* " NOT NULL" */ } return ts + 800 /* "" */ }())) - zComma = ts + 15696 /* ", " */ + zComma = ts + 16160 /* ", " */ } if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_WITHOUT_ROWID { var zPk uintptr = rbuWithoutRowidPK(tls, p, pIter) if zPk != 0 { - zSql = rbuMPrintf(tls, p, ts+32937 /* "%z, %z" */, libc.VaList(bp+88, zSql, zPk)) + zSql = rbuMPrintf(tls, p, ts+33443 /* "%z, %z" */, libc.VaList(bp+88, zSql, zPk)) } } - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+104, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8333 /* "main" */, 1, tnum)) - rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+32944, /* "CREATE TABLE \"rb..." */ + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+104, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8426 /* "main" */, 1, tnum)) + rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+33450, /* "CREATE TABLE \"rb..." */ libc.VaList(bp+136, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, func() uintptr { if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_WITHOUT_ROWID { - return ts + 32976 /* " WITHOUT ROWID" */ + return ts + 33482 /* " WITHOUT ROWID" */ } return ts + 800 /* "" */ }())) - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+160, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8333 /* "main" */, 0, 0)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+160, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8426 /* "main" */, 0, 0)) } } @@ -158579,7 +161201,7 @@ func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite // the target table, plus one (for the rbu_control column), plus one more // (for the rbu_rowid column) if the target table is an implicit IPK or // virtual table. -func rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zCollist uintptr, zRbuRowid uintptr) { /* sqlite3.c:198009:13: */ +func rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zCollist uintptr, zRbuRowid uintptr) { /* sqlite3.c:201032:13: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -158589,12 +161211,12 @@ func rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zCollis (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter + 152 /* &.pTmpInsert */), (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+32991, /* "INSERT INTO %s.'..." */ + ts+33497, /* "INSERT INTO %s.'..." */ libc.VaList(bp, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } -func rbuTmpInsertFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:198027:13: */ +func rbuTmpInsertFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:201050:13: */ var p uintptr = Xsqlite3_user_data(tls, pCtx) var rc int32 = SQLITE_OK var i int32 @@ -158616,7 +161238,7 @@ func rbuTmpInsertFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } } -func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:198057:13: */ +func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:201080:13: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -158626,7 +161248,7 @@ func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp /* &pStmt */, (p + 64 /* &.zErrmsg */), - ts+33048 /* "SELECT trim(sql)..." */) + ts+33554 /* "SELECT trim(sql)..." */) } if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK { var rc2 int32 @@ -158724,7 +161346,7 @@ func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { // Ensure that the SQLite statement handles required to update the // target database object currently indicated by the iterator passed // as the second argument are available. -func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32) int32 { /* sqlite3.c:198157:12: */ +func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32) int32 { /* sqlite3.c:201180:12: */ bp := tls.Alloc(628) defer tls.Free(628) @@ -158736,7 +161358,7 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 var zLimit uintptr = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, ts+33114 /* " LIMIT -1 OFFSET..." */, libc.VaList(bp, nOffset)) + zLimit = Xsqlite3_mprintf(tls, ts+33620 /* " LIMIT -1 OFFSET..." */, libc.VaList(bp, nOffset)) if !(zLimit != 0) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM } @@ -158757,26 +161379,26 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 zBind = rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 624 /* nBind */))) // Create the imposter table used to write to this index. - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+8, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8333 /* "main" */, 0, 1)) - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+40, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8333 /* "main" */, 1, tnum)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+8, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8426 /* "main" */, 0, 1)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+40, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8426 /* "main" */, 1, tnum)) rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+33134, /* "CREATE TABLE \"rb..." */ + ts+33640, /* "CREATE TABLE \"rb..." */ libc.VaList(bp+72, zTbl, *(*uintptr)(unsafe.Pointer(bp + 600 /* zImposterCols */)), *(*uintptr)(unsafe.Pointer(bp + 608 /* zImposterPK */)))) - Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+96, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8333 /* "main" */, 0, 0)) + Xsqlite3_test_control(tls, SQLITE_TESTCTRL_IMPOSTER, libc.VaList(bp+96, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8426 /* "main" */, 0, 0)) // Create the statement to insert index entries (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 624 /* nBind */)) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 136 /* &.pInsert */), (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+33199 /* "INSERT INTO \"rbu..." */, libc.VaList(bp+128, zTbl, zBind))) + Xsqlite3_mprintf(tls, ts+33705 /* "INSERT INTO \"rbu..." */, libc.VaList(bp+128, zTbl, zBind))) } // And to delete index entries if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 144 /* &.pDelete */), (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+33235 /* "DELETE FROM \"rbu..." */, libc.VaList(bp+144, zTbl, *(*uintptr)(unsafe.Pointer(bp + 616 /* zWhere */))))) + Xsqlite3_mprintf(tls, ts+33741 /* "DELETE FROM \"rbu..." */, libc.VaList(bp+144, zTbl, *(*uintptr)(unsafe.Pointer(bp + 616 /* zWhere */))))) } // Create the SELECT statement to read keys in sorted order @@ -158793,7 +161415,7 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 } zSql = Xsqlite3_mprintf(tls, - ts+33269, /* "SELECT %s, 0 AS ..." */ + ts+33775, /* "SELECT %s, 0 AS ..." */ libc.VaList(bp+160, zCollist, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, @@ -158801,9 +161423,9 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 if zStart != 0 { return func() uintptr { if zPart != 0 { - return ts + 33330 /* "AND" */ + return ts + 33836 /* "AND" */ } - return ts + 33334 /* "WHERE" */ + return ts + 33840 /* "WHERE" */ }() } return ts + 800 /* "" */ @@ -158812,21 +161434,21 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 Xsqlite3_free(tls, zStart) } else if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) { zSql = Xsqlite3_mprintf(tls, - ts+33340, /* "SELECT %s, rbu_c..." */ + ts+33846, /* "SELECT %s, rbu_c..." */ libc.VaList(bp+216, zCollist, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { zSql = Xsqlite3_mprintf(tls, - ts+33401, /* "SELECT %s, rbu_c..." */ + ts+33907, /* "SELECT %s, rbu_c..." */ libc.VaList(bp+264, zCollist, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, func() uintptr { if zPart != 0 { - return ts + 33330 /* "AND" */ + return ts + 33836 /* "AND" */ } - return ts + 33334 /* "WHERE" */ + return ts + 33840 /* "WHERE" */ }(), zCollist, zLimit)) } @@ -158851,8 +161473,8 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 var zBindings uintptr = rbuObjIterGetBindlist(tls, p, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol + bRbuRowid)) var zWhere uintptr = rbuObjIterGetWhere(tls, p, pIter) - var zOldlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+8342 /* "old" */) - var zNewlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+8338 /* "new" */) + var zOldlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+8435 /* "old" */) + var zNewlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+8431 /* "new" */) zCollist = rbuObjIterGetCollist(tls, p, pIter) (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol @@ -158864,17 +161486,17 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_VTAB { return ts + 800 /* "" */ } - return ts + 33560 /* "rbu_imp_" */ + return ts + 34066 /* "rbu_imp_" */ }() // Create the INSERT statement to write to the target PK b-tree if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 136 /* &.pInsert */), pz, Xsqlite3_mprintf(tls, - ts+33569, /* "INSERT INTO \"%s%..." */ + ts+34075, /* "INSERT INTO \"%s%..." */ libc.VaList(bp+344, zWrite, zTbl, zCollist, func() uintptr { if bRbuRowid != 0 { - return ts + 33605 /* ", _rowid_" */ + return ts + 34111 /* ", _rowid_" */ } return ts + 800 /* "" */ }(), zBindings))) @@ -158886,28 +161508,28 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 144 /* &.pDelete */), pz, Xsqlite3_mprintf(tls, - ts+33615 /* "DELETE FROM \"%s%..." */, libc.VaList(bp+384, zWrite, zTbl, zWhere))) + ts+34121 /* "DELETE FROM \"%s%..." */, libc.VaList(bp+384, zWrite, zTbl, zWhere))) } if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0) { var zRbuRowid uintptr = ts + 800 /* "" */ if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) { - zRbuRowid = ts + 33643 /* ", rbu_rowid" */ + zRbuRowid = ts + 34149 /* ", rbu_rowid" */ } // Create the rbu_tmp_xxx table and the triggers to populate it. rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, - ts+33655 /* "CREATE TABLE IF ..." */, libc.VaList(bp+408, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, func() uintptr { + ts+34161 /* "CREATE TABLE IF ..." */, libc.VaList(bp+408, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, func() uintptr { if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL { - return ts + 33731 /* ", 0 AS rbu_rowid" */ + return ts + 34237 /* ", 0 AS rbu_rowid" */ } return ts + 800 /* "" */ }(), (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+33748, /* "CREATE TEMP TRIG..." */ + ts+34254, /* "CREATE TEMP TRIG..." */ libc.VaList(bp+440, zWrite, zTbl, zOldlist, zWrite, zTbl, zOldlist, zWrite, zTbl, zNewlist)) @@ -158915,7 +161537,7 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_EXTERNAL) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NONE) { rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+34047, /* "CREATE TEMP TRIG..." */ + ts+34553, /* "CREATE TEMP TRIG..." */ libc.VaList(bp+512, zWrite, zTbl, zNewlist)) } @@ -158929,9 +161551,9 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 var zOrder uintptr = uintptr(0) if bRbuRowid != 0 { if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - zRbuRowid = ts + 34146 /* ",_rowid_ " */ + zRbuRowid = ts + 34652 /* ",_rowid_ " */ } else { - zRbuRowid = ts + 34156 /* ",rbu_rowid" */ + zRbuRowid = ts + 34662 /* ",rbu_rowid" */ } } @@ -158944,20 +161566,20 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 } } if bRbuRowid != 0 { - zOrder = rbuMPrintf(tls, p, ts+32203 /* "_rowid_" */, 0) + zOrder = rbuMPrintf(tls, p, ts+32709 /* "_rowid_" */, 0) } else { - zOrder = rbuObjIterGetPkList(tls, p, pIter, ts+800 /* "" */, ts+15696 /* ", " */, ts+800 /* "" */) + zOrder = rbuObjIterGetPkList(tls, p, pIter, ts+800 /* "" */, ts+16160 /* ", " */, ts+800 /* "" */) } } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter + 128 /* &.pSelect */), pz, Xsqlite3_mprintf(tls, - ts+34167, /* "SELECT %s,%s rbu..." */ + ts+34673, /* "SELECT %s,%s rbu..." */ libc.VaList(bp+536, zCollist, func() uintptr { if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - return ts + 34215 /* "0 AS " */ + return ts + 34721 /* "0 AS " */ } return ts + 800 /* "" */ }(), @@ -158970,7 +161592,7 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 }(), func() uintptr { if zOrder != 0 { - return ts + 19956 /* "ORDER BY" */ + return ts + 21741 /* "ORDER BY" */ } return ts + 800 /* "" */ }(), zOrder, @@ -158999,7 +161621,7 @@ func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32 // // If the zMask string does not specify any columns to update, then this // is not an error. Output variable *ppStmt is set to NULL in this case. -func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, ppStmt uintptr) int32 { /* sqlite3.c:198424:12: */ +func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, ppStmt uintptr) int32 { /* sqlite3.c:201447:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -159050,9 +161672,9 @@ func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, pp var zPrefix uintptr = ts + 800 /* "" */ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType != RBU_PK_VTAB { - zPrefix = ts + 33560 /* "rbu_imp_" */ + zPrefix = ts + 34066 /* "rbu_imp_" */ } - zUpdate = Xsqlite3_mprintf(tls, ts+34221, /* "UPDATE \"%s%w\" SE..." */ + zUpdate = Xsqlite3_mprintf(tls, ts+34727, /* "UPDATE \"%s%w\" SE..." */ libc.VaList(bp, zPrefix, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pUp + 8 /* &.pUpdate */), (p + 64 /* &.zErrmsg */), zUpdate) @@ -159065,7 +161687,7 @@ func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, pp return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc } -func rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) uintptr { /* sqlite3.c:198492:16: */ +func rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) uintptr { /* sqlite3.c:201515:16: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -159088,7 +161710,7 @@ func rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) uin } // Free an RbuState object allocated by rbuLoadState(). -func rbuFreeState(tls *libc.TLS, p uintptr) { /* sqlite3.c:198513:13: */ +func rbuFreeState(tls *libc.TLS, p uintptr) { /* sqlite3.c:201536:13: */ if p != 0 { Xsqlite3_free(tls, (*RbuState)(unsafe.Pointer(p)).FzTbl) Xsqlite3_free(tls, (*RbuState)(unsafe.Pointer(p)).FzDataTbl) @@ -159104,7 +161726,7 @@ func rbuFreeState(tls *libc.TLS, p uintptr) { /* sqlite3.c:198513:13: */ // // If an error occurs, leave an error code and message in the rbu handle // and return NULL. -func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:198531:17: */ +func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:201554:17: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -159120,7 +161742,7 @@ func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:198531:17: */ } *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+8 /* &pStmt */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+34251 /* "SELECT k, v FROM..." */, libc.VaList(bp, p+48 /* &.zStateDb */))) + Xsqlite3_mprintf(tls, ts+34757 /* "SELECT k, v FROM..." */, libc.VaList(bp, p+48 /* &.zStateDb */))) for (*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 0) { case RBU_STATE_STAGE: @@ -159184,7 +161806,7 @@ func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:198531:17: */ // Open the database handle and attach the RBU database as "rbu". If an // error occurs, leave an error code and message in the RBU handle. -func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:198608:13: */ +func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:201631:13: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -159192,31 +161814,31 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:1 (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, 1) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) { - Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8333 /* "main" */, SQLITE_FCNTL_RBUCNT, p) + Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8426 /* "main" */, SQLITE_FCNTL_RBUCNT, p) if (*Sqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - var zFile uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8333 /* "main" */) - (*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+34281 /* "file://%s-vacuum..." */, libc.VaList(bp, zFile, zFile)) + var zFile uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8426 /* "main" */) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+34787 /* "file://%s-vacuum..." */, libc.VaList(bp, zFile, zFile)) } } // If using separate RBU and state databases, attach the state database to // the RBU db handle now. if (*Sqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+34308 /* "ATTACH %Q AS sta..." */, libc.VaList(bp+16, (*Sqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48 /* &.zStateDb */, ts+4439 /* "stat" */, uint64(4)) + rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+34814 /* "ATTACH %Q AS sta..." */, libc.VaList(bp+16, (*Sqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48 /* &.zStateDb */, ts+4515 /* "stat" */, uint64(4)) } else { - libc.Xmemcpy(tls, p+48 /* &.zStateDb */, ts+8333 /* "main" */, uint64(4)) + libc.Xmemcpy(tls, p+48 /* &.zStateDb */, ts+8426 /* "main" */, uint64(4)) } // If it has not already been created, create the rbu_state table - rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+34326 /* "CREATE TABLE IF ..." */, libc.VaList(bp+24, p+48 /* &.zStateDb */)) + rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+34832 /* "CREATE TABLE IF ..." */, libc.VaList(bp+24, p+48 /* &.zStateDb */)) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) { var bOpen int32 = 0 var rc int32 (*Sqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8333 /* "main" */, SQLITE_FCNTL_RBUCNT, p) + rc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8426 /* "main" */, SQLITE_FCNTL_RBUCNT, p) if rc != SQLITE_NOTFOUND { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -159249,11 +161871,11 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:1 return } (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+34392 /* "cannot vacuum wa..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+34898 /* "cannot vacuum wa..." */, 0) } else { var zTarget uintptr var zExtra uintptr = uintptr(0) - if (libc.Xstrlen(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5)) && (0 == libc.Xmemcmp(tls, ts+27531 /* "file:" */, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5))) { + if (libc.Xstrlen(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5)) && (0 == libc.Xmemcmp(tls, ts+28037 /* "file:" */, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5))) { zExtra = ((*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5) for *(*int8)(unsafe.Pointer(zExtra)) != 0 { if int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zExtra, 1)))) == '?' { @@ -159265,13 +161887,13 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:1 } } - zTarget = Xsqlite3_mprintf(tls, ts+34424, /* "file:%s-vactmp?r..." */ - libc.VaList(bp+32, Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8333 /* "main" */), + zTarget = Xsqlite3_mprintf(tls, ts+34930, /* "file:%s-vactmp?r..." */ + libc.VaList(bp+32, Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8426 /* "main" */), func() uintptr { if zExtra == uintptr(0) { return ts + 800 /* "" */ } - return ts + 34456 /* "&" */ + return ts + 34962 /* "&" */ }(), func() uintptr { if zExtra == uintptr(0) { return ts + 800 /* "" */ @@ -159290,40 +161912,40 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:1 if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+34458 /* "rbu_tmp_insert" */, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { + ts+34964 /* "rbu_tmp_insert" */, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rbuTmpInsertFunc})), uintptr(0), uintptr(0)) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, - ts+34473 /* "rbu_fossil_delta" */, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + ts+34979 /* "rbu_fossil_delta" */, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rbuFossilDeltaFunc})), uintptr(0), uintptr(0)) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, - ts+34490 /* "rbu_target_name" */, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { + ts+34996 /* "rbu_target_name" */, -1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rbuTargetNameFunc})), uintptr(0), uintptr(0)) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8333 /* "main" */, SQLITE_FCNTL_RBU, p) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8426 /* "main" */, SQLITE_FCNTL_RBU, p) } - rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+34506 /* "SELECT * FROM sq..." */, 0) + rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+35012 /* "SELECT * FROM sq..." */, 0) // Mark the database file just opened as an RBU target database. If // this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. // This is an error. if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8333 /* "main" */, SQLITE_FCNTL_RBU, p) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8426 /* "main" */, SQLITE_FCNTL_RBU, p) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_NOTFOUND { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+34534 /* "rbu vfs not foun..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+35040 /* "rbu vfs not foun..." */, 0) } } @@ -159345,7 +161967,7 @@ func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:1 // test.db-wal => test.wal // test.db-shm => test.shm // test.db-mj7f3319fa => test.9fa -func rbuFileSuffix3(tls *libc.TLS, zBase uintptr, z uintptr) { /* sqlite3.c:198787:13: */ +func rbuFileSuffix3(tls *libc.TLS, zBase uintptr, z uintptr) { /* sqlite3.c:201810:13: */ } // Return the current wal-index header checksum for the target database @@ -159353,7 +161975,7 @@ func rbuFileSuffix3(tls *libc.TLS, zBase uintptr, z uintptr) { /* sqlite3.c:1987 // // The checksum is store in the first page of xShmMap memory as an 8-byte // blob starting at byte offset 40. -func rbuShmChecksum(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:198808:12: */ +func rbuShmChecksum(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:201831:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -159384,7 +162006,7 @@ func rbuShmChecksum(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:198808:12: */ // object, then the rbu handle is set to DONE state. This occurs if some // other client appends a transaction to the wal file in the middle of // an incremental checkpoint. -func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:198837:13: */ +func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:201860:13: */ // If pState is NULL, then the wal file may not have been opened and // recovered. Running a read-statement here to ensure that doing so @@ -159392,7 +162014,7 @@ func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c if pState == uintptr(0) { (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+34506 /* "SELECT * FROM sq..." */, uintptr(0), uintptr(0), uintptr(0)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+35012 /* "SELECT * FROM sq..." */, uintptr(0), uintptr(0), uintptr(0)) } } @@ -159426,7 +162048,7 @@ func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { var rc2 int32 (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_CAPTURE - rc2 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+34552 /* "PRAGMA main.wal_..." */, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+35058 /* "PRAGMA main.wal_..." */, uintptr(0), uintptr(0), uintptr(0)) if rc2 != SQLITE_INTERNAL { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -159472,7 +162094,7 @@ func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c // Called when iAmt bytes are read from offset iOff of the wal file while // the rbu object is in capture mode. Record the frame number of the frame // being read in the aFrame[] array. -func rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff I64, iAmt int32) int32 { /* sqlite3.c:198921:12: */ +func rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff I64, iAmt int32) int32 { /* sqlite3.c:201944:12: */ var mReq U32 = (U32(((int32(1) << WAL_LOCK_WRITE) | (int32(1) << WAL_LOCK_CKPT)) | (int32(1) << WAL_LOCK_READ0))) var iFrame U32 @@ -159511,7 +162133,7 @@ func rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff I64, iAmt int32) int32 // Called when a page of data is written to offset iOff of the database // file while the rbu handle is in capture mode. Record the page number // of the page being written in the aFrame[] array. -func rbuCaptureDbWrite(tls *libc.TLS, pRbu uintptr, iOff I64) int32 { /* sqlite3.c:198953:12: */ +func rbuCaptureDbWrite(tls *libc.TLS, pRbu uintptr, iOff I64) int32 { /* sqlite3.c:201976:12: */ (*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame + uintptr(((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame-1))*8)).FiDbPage = ((U32(iOff / I64((*Sqlite3rbu)(unsafe.Pointer(pRbu)).Fpgsz))) + U32(1)) return SQLITE_OK } @@ -159519,7 +162141,7 @@ func rbuCaptureDbWrite(tls *libc.TLS, pRbu uintptr, iOff I64) int32 { /* sqlite3 // This is called as part of an incremental checkpoint operation. Copy // a single frame of data from the wal file into the database file, as // indicated by the RbuFrame object. -func rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { /* sqlite3.c:198963:13: */ +func rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { /* sqlite3.c:201986:13: */ var pWal uintptr = (*Rbu_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal var iOff I64 @@ -159535,7 +162157,7 @@ func rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { /* sqlite3.c } // Take an EXCLUSIVE lock on the database file. -func rbuLockDatabase(tls *libc.TLS, p uintptr) { /* sqlite3.c:198981:13: */ +func rbuLockDatabase(tls *libc.TLS, p uintptr) { /* sqlite3.c:202004:13: */ var pReal uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pReal)).FpMethods + 56 /* &.xLock */))))(tls, pReal, SQLITE_LOCK_SHARED) @@ -159549,20 +162171,20 @@ func rbuLockDatabase(tls *libc.TLS, p uintptr) { /* sqlite3.c:198981:13: */ // then reopens the database file (this time in vanilla, non-oal, WAL mode). // If an error occurs, leave an error code and error message in the rbu // handle. -func rbuMoveOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:199021:13: */ +func rbuMoveOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:202044:13: */ bp := tls.Alloc(16) defer tls.Free(16) - var zBase uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8333 /* "main" */) + var zBase uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8426 /* "main" */) var zMove uintptr = zBase var zOal uintptr var zWal uintptr if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8333 /* "main" */) + zMove = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8426 /* "main" */) } - zOal = Xsqlite3_mprintf(tls, ts+34587 /* "%s-oal" */, libc.VaList(bp, zMove)) - zWal = Xsqlite3_mprintf(tls, ts+34594 /* "%s-wal" */, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, ts+35093 /* "%s-oal" */, libc.VaList(bp, zMove)) + zWal = Xsqlite3_mprintf(tls, ts+35100 /* "%s-wal" */, libc.VaList(bp+8, zMove)) if (zWal == uintptr(0)) || (zOal == uintptr(0)) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_NOMEM @@ -159618,7 +162240,7 @@ func rbuMoveOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:199021:13: */ // // If the rbu_control field contains an invalid value, an error code and // message are left in the RBU handle and zero returned. -func rbuStepType(tls *libc.TLS, p uintptr, pzMask uintptr) int32 { /* sqlite3.c:199112:12: */ +func rbuStepType(tls *libc.TLS, p uintptr, pzMask uintptr) int32 { /* sqlite3.c:202135:12: */ var iCol int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnCol // Index of rbu_control column var res int32 = 0 // Return value @@ -159674,7 +162296,7 @@ func rbuStepType(tls *libc.TLS, p uintptr, pzMask uintptr) int32 { /* sqlite3.c: // Argument eType must be one of RBU_INSERT, RBU_DELETE, RBU_IDX_INSERT or // RBU_IDX_DELETE. This function performs the work of a single // sqlite3rbu_step() call for the type of operation specified by eType. -func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:199168:13: */ +func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:202191:13: */ var pIter uintptr = (p + 80 /* &.objiter */) var pVal uintptr var pWriter uintptr @@ -159702,7 +162324,7 @@ func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:199168:1 ((*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0))) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_IPK)) && (*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0)) && (Xsqlite3_column_type(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == SQLITE_NULL) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_MISMATCH - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+27169 /* "datatype mismatc..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+27675 /* "datatype mismatc..." */, 0) return } @@ -159746,7 +162368,7 @@ func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:199168:1 // If no error occurs, SQLITE_OK is returned. Otherwise, an error code // and message is left in the RBU handle and a copy of the error code // returned. -func rbuStep(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199251:12: */ +func rbuStep(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:202274:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -159805,7 +162427,7 @@ func rbuStep(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199251:12: */ // Or, if this is an RBU vacuum, set the schema cookie of the main db // opened by p->dbMain to one more than the schema cookie of the main // db opened by p->dbRbu. -func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:199316:13: */ +func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:202339:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -159820,7 +162442,7 @@ func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:199316:13: */ // var pStmt uintptr at bp+8, 8 (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, dbread, bp+8 /* &pStmt */, (p + 64 /* &.zErrmsg */), - ts+34601 /* "PRAGMA schema_ve..." */) + ts+35107 /* "PRAGMA schema_ve..." */) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { // Coverage: it may be that this sqlite3_step() cannot fail. There // is already a transaction open, so the prepared statement cannot @@ -159833,7 +162455,7 @@ func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:199316:13: */ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */))) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+34623 /* "PRAGMA schema_ve..." */, libc.VaList(bp, (iCookie+1))) + rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+35129 /* "PRAGMA schema_ve..." */, libc.VaList(bp, (iCookie+1))) } } } @@ -159841,7 +162463,7 @@ func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:199316:13: */ // Update the contents of the rbu_state table within the rbu database. The // value stored in the RBU_STATE_STAGE column is eStage. All other values // are determined by inspecting the rbu handle passed as the first argument. -func rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { /* sqlite3.c:199347:13: */ +func rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { /* sqlite3.c:202370:13: */ bp := tls.Alloc(176) defer tls.Free(176) @@ -159858,7 +162480,7 @@ func rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { /* sqlite3.c:199347: rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+168 /* &pInsert */, (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls, - ts+34650, /* "INSERT OR REPLAC..." */ + ts+35156, /* "INSERT OR REPLAC..." */ libc.VaList(bp, p+48, /* &.zStateDb */ RBU_STATE_STAGE, eStage, RBU_STATE_TBL, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, @@ -159896,16 +162518,16 @@ func rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { /* sqlite3.c:199347: // // In short, it copies the value of the specified PRAGMA setting from // dbRbu to dbMain. -func rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { /* sqlite3.c:199408:13: */ +func rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { /* sqlite3.c:202431:13: */ bp := tls.Alloc(32) defer tls.Free(32) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)) = uintptr(0) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+24 /* &pPragma */, (p + 64 /* &.zErrmsg */), - Xsqlite3_mprintf(tls, ts+34808 /* "PRAGMA main.%s" */, libc.VaList(bp, zPragma))) + Xsqlite3_mprintf(tls, ts+35314 /* "PRAGMA main.%s" */, libc.VaList(bp, zPragma))) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)))) { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+34823, /* "PRAGMA main.%s =..." */ + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+35329, /* "PRAGMA main.%s =..." */ libc.VaList(bp+8, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)), 0))) } rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */))) @@ -159915,18 +162537,18 @@ func rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { /* sqlite3.c:199 // The RBU handle passed as the only argument has just been opened and // the state database is empty. If this RBU handle was opened for an // RBU vacuum operation, create the schema in the target db. -func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:199428:13: */ +func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:202451:13: */ bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp /* pSql */)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8 /* pInsert */)) = uintptr(0) - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+34843 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+35349 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pSql */, (p + 64 /* &.zErrmsg */), - ts+34868 /* "SELECT sql FROM ..." */) + ts+35374 /* "SELECT sql FROM ..." */) } for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pSql */))) == SQLITE_ROW) { @@ -159940,12 +162562,12 @@ func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:199428:13: * if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pSql */, (p + 64 /* &.zErrmsg */), - ts+34976 /* "SELECT * FROM sq..." */) + ts+35482 /* "SELECT * FROM sq..." */) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8 /* &pInsert */, (p + 64 /* &.zErrmsg */), - ts+35041 /* "INSERT INTO sqli..." */) + ts+35547 /* "INSERT INTO sqli..." */) } for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pSql */))) == SQLITE_ROW) { @@ -159957,7 +162579,7 @@ func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:199428:13: * (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pInsert */))) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+35085 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+35591 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pSql */))) @@ -159965,7 +162587,7 @@ func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:199428:13: * } // Step the RBU object. -func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199480:16: */ +func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:202503:16: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -159979,8 +162601,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199480:16: // when this handle was opened, create the target database schema. if (((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) { rbuCreateTargetSchema(tls, p) - rbuCopyPragma(tls, p, ts+18263 /* "user_version" */) - rbuCopyPragma(tls, p, ts+17373 /* "application_id" */) + rbuCopyPragma(tls, p, ts+18688 /* "user_version" */) + rbuCopyPragma(tls, p, ts+17798 /* "application_id" */) } for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { @@ -159991,7 +162613,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199480:16: // But the contents can be deleted. if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0) { rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, - ts+35110 /* "DELETE FROM %s.'..." */, libc.VaList(bp, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + ts+35616 /* "DELETE FROM %s.'..." */, libc.VaList(bp, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -160017,10 +162639,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199480:16: rbuSaveState(tls, p, RBU_STAGE_MOVE) rbuIncrSchemaCookie(tls, p) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+15600 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+16064 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+15600 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+16064 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_MOVE } @@ -160104,7 +162726,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199480:16: // Compare strings z1 and z2, returning 0 if they are identical, or non-zero // otherwise. Either or both argument may be NULL. Two NULL values are // considered equal, and NULL is considered distinct from all other values. -func rbuStrCompare(tls *libc.TLS, z1 uintptr, z2 uintptr) int32 { /* sqlite3.c:199609:12: */ +func rbuStrCompare(tls *libc.TLS, z1 uintptr, z2 uintptr) int32 { /* sqlite3.c:202632:12: */ if (z1 == uintptr(0)) && (z2 == uintptr(0)) { return 0 } @@ -160122,7 +162744,7 @@ func rbuStrCompare(tls *libc.TLS, z1 uintptr, z2 uintptr) int32 { /* sqlite3.c:1 // // If an error occurs, an error code and error message are left in the // rbu handle passed as the first argument. -func rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:199625:13: */ +func rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:202648:13: */ if (*RbuState)(unsafe.Pointer(pState)).FzTbl != 0 { var pIter uintptr = (p + 80 /* &.objiter */) @@ -160137,7 +162759,7 @@ func rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:199625 if (rc == SQLITE_OK) && !(int32((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl) != 0) { rc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+35138 /* "rbu_state mismat..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+35644 /* "rbu_state mismat..." */, 0) } if rc == SQLITE_OK { @@ -160152,11 +162774,11 @@ func rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:199625 // If there is a "*-oal" file in the file-system corresponding to the // target database in the file-system, delete it. If an error occurs, // leave an error code and error message in the rbu handle. -func rbuDeleteOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:199658:13: */ +func rbuDeleteOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:202681:13: */ bp := tls.Alloc(8) defer tls.Free(8) - var zOal uintptr = rbuMPrintf(tls, p, ts+34587 /* "%s-oal" */, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + var zOal uintptr = rbuMPrintf(tls, p, ts+35093 /* "%s-oal" */, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { var pVfs uintptr = Xsqlite3_vfs_find(tls, uintptr(0)) @@ -160169,7 +162791,7 @@ func rbuDeleteOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:199658:13: */ // argument. This VFS will be used unless the call to sqlite3rbu_open() // specified a URI with a vfs=? option in place of a target database // file name. -func rbuCreateVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:199674:13: */ +func rbuCreateVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:202697:13: */ bp := tls.Alloc(76) defer tls.Free(76) @@ -160178,7 +162800,7 @@ func rbuCreateVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:199674:13: */ // var zRnd [64]int8 at bp+12, 64 Xsqlite3_randomness(tls, int32(unsafe.Sizeof(int32(0))), bp+8 /* &rnd */) - Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+12 /* &zRnd[0] */, ts+35163 /* "rbu_vfs_%d" */, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* rnd */)))) + Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+12 /* &zRnd[0] */, ts+35669 /* "rbu_vfs_%d" */, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* rnd */)))) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+12 /* &zRnd[0] */, uintptr(0)) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { var pVfs uintptr = Xsqlite3_vfs_find(tls, bp+12 /* &zRnd[0] */) @@ -160190,7 +162812,7 @@ func rbuCreateVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:199674:13: */ // Destroy the private VFS created for the rbu handle passed as the only // argument by an earlier call to rbuCreateVfs(). -func rbuDeleteVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:199694:13: */ +func rbuDeleteVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:202717:13: */ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName != 0 { Xsqlite3rbu_destroy_vfs(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName) (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName = uintptr(0) @@ -160200,7 +162822,7 @@ func rbuDeleteVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:199694:13: */ // This user-defined SQL function is invoked with a single argument - the // name of a table expected to appear in the target database. It returns // the number of auxilliary indexes on the table. -func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:199706:13: */ +func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:202729:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -160217,7 +162839,7 @@ func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { / rc = prepareFreeAndCollectError(tls, db, bp+8 /* &pStmt */, bp+16, /* &zErrmsg */ Xsqlite3_mprintf(tls, - ts+35174 /* "SELECT count(*) ..." */, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + ts+35680 /* "SELECT count(*) ..." */, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrmsg */)), -1) } else { @@ -160249,7 +162871,7 @@ func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { / // sqlite3rbu.nPhaseOneStep is initialized to the sum of (1 + nIndex) * cnt // for all rows in the rbu_count table, where nIndex is the number of // indexes on the corresponding target database table. -func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:199756:13: */ +func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:202779:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -160260,7 +162882,7 @@ func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:199756:13: */ (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-1) (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, - ts+35246 /* "rbu_index_cnt" */, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { + ts+35752 /* "rbu_index_cnt" */, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{rbuIndexCntFunc})), uintptr(0), uintptr(0)) @@ -160268,7 +162890,7 @@ func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:199756:13: */ // occurs, nPhaseOneStep will be left set to -1. if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pStmt */, (p + 64 /* &.zErrmsg */), - ts+35260 /* "SELECT 1 FROM sq..." */) + ts+35766 /* "SELECT 1 FROM sq..." */) } if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) { @@ -160280,7 +162902,7 @@ func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:199756:13: */ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (bExists != 0) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pStmt */, (p + 64 /* &.zErrmsg */), - ts+35317 /* "SELECT sum(cnt *..." */) + ts+35823 /* "SELECT sum(cnt *..." */) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) { (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 0) @@ -160291,7 +162913,7 @@ func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:199756:13: */ } } -func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:199797:19: */ +func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:202820:19: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -160363,7 +162985,7 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0) { if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+35391 /* "cannot update wa..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+35897 /* "cannot update wa..." */, 0) } else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_MOVE { (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_CKPT (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep = 0 @@ -160385,12 +163007,12 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) // transaction is committed in rollback mode) currently stored on // page 1 of the database file. (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = SQLITE_BUSY - (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+35423, /* "database modifie..." */ + (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+35929, /* "database modifie..." */ libc.VaList(bp+8, func() uintptr { if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - return ts + 35455 /* "vacuum" */ + return ts + 35961 /* "vacuum" */ } - return ts + 35462 /* "update" */ + return ts + 35968 /* "update" */ }())) } } @@ -160398,7 +163020,7 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL { var db uintptr = (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+15585 /* "BEGIN" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+16049 /* "BEGIN" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) // Point the object iterator at the first object if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -160412,24 +163034,24 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = RBU_STAGE_DONE } else { if (((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*RbuState)(unsafe.Pointer(pState)).FeStage == 0)) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) { - rbuCopyPragma(tls, p, ts+17988 /* "page_size" */) - rbuCopyPragma(tls, p, ts+17388 /* "auto_vacuum" */) + rbuCopyPragma(tls, p, ts+18413 /* "page_size" */) + rbuCopyPragma(tls, p, ts+17813 /* "auto_vacuum" */) } // Open transactions both databases. The *-oal file is opened or // created at this point. if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, ts+35469 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, ts+35975 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } // Check if the main database is a zipvfs db. If it is, set the upper // level pager to use "journal_mode=off". This prevents it from // generating a large journal using a temp file. if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - var frc int32 = Xsqlite3_file_control(tls, db, ts+8333 /* "main" */, SQLITE_FCNTL_ZIPVFS, uintptr(0)) + var frc int32 = Xsqlite3_file_control(tls, db, ts+8426 /* "main" */, SQLITE_FCNTL_ZIPVFS, uintptr(0)) if frc == SQLITE_OK { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, - db, ts+35485 /* "PRAGMA journal_m..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + db, ts+35991 /* "PRAGMA journal_m..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } } @@ -160456,7 +163078,7 @@ func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) // Allocate and return an RBU handle with all fields zeroed except for the // error code, which is set to SQLITE_MISUSE. -func rbuMisuseError(tls *libc.TLS) uintptr { /* sqlite3.c:199953:19: */ +func rbuMisuseError(tls *libc.TLS) uintptr { /* sqlite3.c:202976:19: */ var pRet uintptr pRet = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Sqlite3rbu{}))) if pRet != 0 { @@ -160467,7 +163089,7 @@ func rbuMisuseError(tls *libc.TLS) uintptr { /* sqlite3.c:199953:19: */ } // Open and return a new RBU handle. -func Xsqlite3rbu_open(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:199966:23: */ +func Xsqlite3rbu_open(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:202989:23: */ if (zTarget == uintptr(0)) || (zRbu == uintptr(0)) { return rbuMisuseError(tls) } @@ -160476,13 +163098,13 @@ func Xsqlite3rbu_open(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintp } // Open a handle to begin or resume an RBU VACUUM operation. -func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) uintptr { /* sqlite3.c:199979:23: */ +func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) uintptr { /* sqlite3.c:203002:23: */ if zTarget == uintptr(0) { return rbuMisuseError(tls) } if zState != 0 { var n int32 = int32(libc.Xstrlen(tls, zState)) - if (n >= 7) && (0 == libc.Xmemcmp(tls, ts+35509 /* "-vactmp" */, (zState+uintptr((n-7))), uint64(7))) { + if (n >= 7) && (0 == libc.Xmemcmp(tls, ts+36015 /* "-vactmp" */, (zState+uintptr((n-7))), uint64(7))) { return rbuMisuseError(tls) } } @@ -160491,7 +163113,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) uintptr } // Return the database handle used by pRbu. -func Xsqlite3rbu_db(tls *libc.TLS, pRbu uintptr, bRbu int32) uintptr { /* sqlite3.c:199997:20: */ +func Xsqlite3rbu_db(tls *libc.TLS, pRbu uintptr, bRbu int32) uintptr { /* sqlite3.c:203020:20: */ var db uintptr = uintptr(0) if pRbu != 0 { db = func() uintptr { @@ -160507,12 +163129,12 @@ func Xsqlite3rbu_db(tls *libc.TLS, pRbu uintptr, bRbu int32) uintptr { /* sqlite // If the error code currently stored in the RBU handle is SQLITE_CONSTRAINT, // then edit any error message string so as to remove all occurrences of // the pattern "rbu_imp_[0-9]*". -func rbuEditErrmsg(tls *libc.TLS, p uintptr) { /* sqlite3.c:200011:13: */ +func rbuEditErrmsg(tls *libc.TLS, p uintptr) { /* sqlite3.c:203034:13: */ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_CONSTRAINT) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg != 0) { var i uint32 var nErrmsg Size_t = libc.Xstrlen(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg) for i = uint32(0); Size_t(i) < (nErrmsg - uint64(8)); i++ { - if libc.Xmemcmp(tls, ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i)), ts+33560 /* "rbu_imp_" */, uint64(8)) == 0 { + if libc.Xmemcmp(tls, ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i)), ts+34066 /* "rbu_imp_" */, uint64(8)) == 0 { var nDel int32 = 8 for (int32(*(*int8)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr((i + uint32(nDel)))))) >= '0') && (int32(*(*int8)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr((i + uint32(nDel)))))) <= '9') { nDel++ @@ -160525,13 +163147,13 @@ func rbuEditErrmsg(tls *libc.TLS, p uintptr) { /* sqlite3.c:200011:13: */ } // Close the RBU handle. -func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:200029:16: */ +func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:203052:16: */ var rc int32 if p != 0 { // Commit the transaction to the *-oal file. if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL) { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+15600 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+16064 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } // Sync the db file if currently doing an incremental checkpoint @@ -160543,7 +163165,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sq rbuSaveState(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL) { - (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+15600 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) + (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+16064 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */)) } // Close any open statement handles. @@ -160555,7 +163177,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sq // specifying the current target and state databases to start a new // vacuum from scratch. if (((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0) { - var rc2 int32 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+35517 /* "DELETE FROM stat..." */, uintptr(0), uintptr(0), uintptr(0)) + var rc2 int32 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+36023 /* "DELETE FROM stat..." */, uintptr(0), uintptr(0), uintptr(0)) if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_DONE) && (rc2 != SQLITE_OK) { (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -160588,13 +163210,13 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sq // Return the total number of key-value operations (inserts, deletes or // updates) that have been performed on the target database since the // current RBU update was started. -func Xsqlite3rbu_progress(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:200092:26: */ +func Xsqlite3rbu_progress(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:203115:26: */ return Sqlite3_int64((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnProgress) } // Return permyriadage progress indications for the two main stages of // an RBU update. -func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uintptr) { /* sqlite3.c:200100:17: */ +func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uintptr) { /* sqlite3.c:203123:17: */ var MAX_PROGRESS int32 = 10000 switch (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage { case RBU_STAGE_OAL: @@ -160627,7 +163249,7 @@ func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uint } // Return the current state of the RBU vacuum or update operation. -func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200135:16: */ +func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:203158:16: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -160645,7 +163267,7 @@ func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200135:16: return int32(0) } -func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200163:16: */ +func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:203186:16: */ var rc int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc if rc == SQLITE_DONE { return SQLITE_OK @@ -160654,7 +163276,7 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200163 if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+15600 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+16064 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0)) } } @@ -160671,19 +163293,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200163 if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == RBU_STAGE_OAL { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+15600 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+16064 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { var zBegin uintptr if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) { - zBegin = ts + 15585 /* "BEGIN" */ + zBegin = ts + 16049 /* "BEGIN" */ } else { - zBegin = ts + 35469 /* "BEGIN IMMEDIATE" */ + zBegin = ts + 35975 /* "BEGIN IMMEDIATE" */ } rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+35469 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+35975 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), uintptr(0)) } } @@ -160750,7 +163372,7 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200163 // relinquished). Finally, calls to xSync() on the target database // file fail with SQLITE_INTERNAL errors. -func rbuUnlockShm(tls *libc.TLS, p uintptr) { /* sqlite3.c:200256:13: */ +func rbuUnlockShm(tls *libc.TLS, p uintptr) { /* sqlite3.c:203279:13: */ if (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 { var xShmLock uintptr = (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock @@ -160765,7 +163387,7 @@ func rbuUnlockShm(tls *libc.TLS, p uintptr) { /* sqlite3.c:200256:13: */ } // -func rbuUpdateTempSize(tls *libc.TLS, pFd uintptr, nNew Sqlite3_int64) int32 { /* sqlite3.c:200272:12: */ +func rbuUpdateTempSize(tls *libc.TLS, pFd uintptr, nNew Sqlite3_int64) int32 { /* sqlite3.c:203295:12: */ var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(pFd)).FpRbu var nDiff I64 = (nNew - (*Rbu_file)(unsafe.Pointer(pFd)).Fsz) *(*I64)(unsafe.Pointer(pRbu + 360 /* &.szTemp */)) += (nDiff) @@ -160783,7 +163405,7 @@ func rbuUpdateTempSize(tls *libc.TLS, pFd uintptr, nNew Sqlite3_int64) int32 { / // for all file descriptors with rbu_file.pDb!=0. If the argument has // rbu_file.pDb!=0, then it is assumed to already be present on the // main list and is only added to the pDb!=0 list. -func rbuMainlistAdd(tls *libc.TLS, p uintptr) { /* sqlite3.c:200290:13: */ +func rbuMainlistAdd(tls *libc.TLS, p uintptr) { /* sqlite3.c:203313:13: */ var pRbuVfs uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs var pIter uintptr @@ -160805,7 +163427,7 @@ func rbuMainlistAdd(tls *libc.TLS, p uintptr) { /* sqlite3.c:200290:13: */ } // Remove an item from the main-db lists. -func rbuMainlistRemove(tls *libc.TLS, p uintptr) { /* sqlite3.c:200312:13: */ +func rbuMainlistRemove(tls *libc.TLS, p uintptr) { /* sqlite3.c:203335:13: */ var pp uintptr Xsqlite3_mutex_enter(tls, (*Rbu_vfs)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs)).Fmutex) for pp = ((*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs + 192 /* &.pMain */); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && (*(*uintptr)(unsafe.Pointer(pp)) != p); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 88 /* &.pMainNext */) { @@ -160830,7 +163452,7 @@ func rbuMainlistRemove(tls *libc.TLS, p uintptr) { /* sqlite3.c:200312:13: */ // // If parameter bRbu is true, only search for file-descriptors with // rbu_file.pDb!=0. -func rbuFindMaindb(tls *libc.TLS, pRbuVfs uintptr, zWal uintptr, bRbu int32) uintptr { /* sqlite3.c:200333:17: */ +func rbuFindMaindb(tls *libc.TLS, pRbuVfs uintptr, zWal uintptr, bRbu int32) uintptr { /* sqlite3.c:203356:17: */ var pDb uintptr Xsqlite3_mutex_enter(tls, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fmutex) if bRbu != 0 { @@ -160845,7 +163467,7 @@ func rbuFindMaindb(tls *libc.TLS, pRbuVfs uintptr, zWal uintptr, bRbu int32) uin } // Close an rbu file. -func rbuVfsClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:200348:12: */ +func rbuVfsClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:203371:12: */ var p uintptr = pFile var rc int32 var i int32 @@ -160873,7 +163495,7 @@ func rbuVfsClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:200348:12: * // Read and return an unsigned 32-bit big-endian integer from the buffer // passed as the only argument. -func rbuGetU32(tls *libc.TLS, aBuf uintptr) U32 { /* sqlite3.c:200381:12: */ +func rbuGetU32(tls *libc.TLS, aBuf uintptr) U32 { /* sqlite3.c:203404:12: */ return ((((U32(*(*U8)(unsafe.Pointer(aBuf))) << 24) + (U32(*(*U8)(unsafe.Pointer(aBuf + 1))) << 16)) + (U32(*(*U8)(unsafe.Pointer(aBuf + 2))) << 8)) + @@ -160882,20 +163504,20 @@ func rbuGetU32(tls *libc.TLS, aBuf uintptr) U32 { /* sqlite3.c:200381:12: */ // Write an unsigned 32-bit value in big-endian format to the supplied // buffer. -func rbuPutU32(tls *libc.TLS, aBuf uintptr, iVal U32) { /* sqlite3.c:200392:13: */ +func rbuPutU32(tls *libc.TLS, aBuf uintptr, iVal U32) { /* sqlite3.c:203415:13: */ *(*U8)(unsafe.Pointer(aBuf)) = (U8((iVal >> 24) & U32(0xFF))) *(*U8)(unsafe.Pointer(aBuf + 1)) = (U8((iVal >> 16) & U32(0xFF))) *(*U8)(unsafe.Pointer(aBuf + 2)) = (U8((iVal >> 8) & U32(0xFF))) *(*U8)(unsafe.Pointer(aBuf + 3)) = (U8((iVal >> 0) & U32(0xFF))) } -func rbuPutU16(tls *libc.TLS, aBuf uintptr, iVal U16) { /* sqlite3.c:200399:13: */ +func rbuPutU16(tls *libc.TLS, aBuf uintptr, iVal U16) { /* sqlite3.c:203422:13: */ *(*U8)(unsafe.Pointer(aBuf)) = (U8((int32(iVal) >> 8) & 0xFF)) *(*U8)(unsafe.Pointer(aBuf + 1)) = (U8((int32(iVal) >> 0) & 0xFF)) } // Read data from an rbuVfs-file. -func rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:200407:12: */ +func rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:203430:12: */ var p uintptr = pFile var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu var rc int32 @@ -160955,7 +163577,7 @@ func rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sq } // Write data to an rbuVfs-file. -func rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:200473:12: */ +func rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:203496:12: */ var p uintptr = pFile var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu var rc int32 @@ -160992,7 +163614,7 @@ func rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst S } // Truncate an rbuVfs-file. -func rbuVfsTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sqlite3.c:200516:12: */ +func rbuVfsTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sqlite3.c:203539:12: */ var p uintptr = pFile if (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_DELETEONCLOSE) != 0) && ((*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0) { var rc int32 = rbuUpdateTempSize(tls, p, size) @@ -161004,7 +163626,7 @@ func rbuVfsTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* } // Sync an rbuVfs-file. -func rbuVfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:200528:12: */ +func rbuVfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:203551:12: */ var p uintptr = pFile if ((*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FeStage == RBU_STAGE_CAPTURE) { if ((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & SQLITE_OPEN_MAIN_DB) != 0 { @@ -161016,7 +163638,7 @@ func rbuVfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c: } // Return the current file-size of an rbuVfs-file. -func rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlite3.c:200542:12: */ +func rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlite3.c:203565:12: */ var p uintptr = pFile var rc int32 rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 48 /* &.xFileSize */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, pSize) @@ -161034,7 +163656,7 @@ func rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqli } // Lock an rbuVfs-file. -func rbuVfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:200563:12: */ +func rbuVfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:203586:12: */ var p uintptr = pFile var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu var rc int32 = SQLITE_OK @@ -161052,19 +163674,19 @@ func rbuVfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c: } // Unlock an rbuVfs-file. -func rbuVfsUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:200585:12: */ +func rbuVfsUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:203608:12: */ var p uintptr = pFile return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 64 /* &.xUnlock */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, eLock) } // Check if another file-handle holds a RESERVED lock on an rbuVfs-file. -func rbuVfsCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* sqlite3.c:200593:12: */ +func rbuVfsCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* sqlite3.c:203616:12: */ var p uintptr = pFile return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, pResOut) } // File control method. For custom operations on an rbuVfs-file. -func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:200601:12: */ +func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:203624:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -161087,7 +163709,7 @@ func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&xControl)))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, SQLITE_FCNTL_ZIPVFS, bp+16 /* &dummy */) if rc == SQLITE_OK { rc = SQLITE_ERROR - (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, ts+35544 /* "rbu/zipvfs setup..." */, 0) + (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, ts+36050 /* "rbu/zipvfs setup..." */, 0) } else if rc == SQLITE_NOTFOUND { (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p (*Rbu_file)(unsafe.Pointer(p)).FpRbu = pRbu @@ -161110,7 +163732,7 @@ func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int if (rc == SQLITE_OK) && (op == SQLITE_FCNTL_VFSNAME) { var pRbuVfs uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs var zIn uintptr = *(*uintptr)(unsafe.Pointer(pArg)) - var zOut uintptr = Xsqlite3_mprintf(tls, ts+35567 /* "rbu(%s)/%z" */, libc.VaList(bp, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + var zOut uintptr = Xsqlite3_mprintf(tls, ts+36073 /* "rbu(%s)/%z" */, libc.VaList(bp, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = SQLITE_NOMEM @@ -161121,28 +163743,29 @@ func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int } // Return the sector-size in bytes for an rbuVfs-file. -func rbuVfsSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:200657:12: */ +func rbuVfsSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:203680:12: */ var p uintptr = pFile return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 88 /* &.xSectorSize */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal) } // Return the device characteristic flags supported by an rbuVfs-file. -func rbuVfsDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:200665:12: */ +func rbuVfsDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:203688:12: */ var p uintptr = pFile return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal) } // Take or release a shared-memory lock. -func rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:200673:12: */ +func rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:203696:12: */ var p uintptr = pFile var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu var rc int32 = SQLITE_OK - if (pRbu != 0) && (((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_OAL) || ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_MOVE)) { - // Magic number 1 is the WAL_CKPT_LOCK lock. Preventing SQLite from - // taking this lock also prevents any checkpoints from occurring. - // todo: really, it's not clear why this might occur, as - // wal_autocheckpoint ought to be turned off. + if (pRbu != 0) && ((((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_OAL) || + ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_MOVE)) || + ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_DONE)) { + // Prevent SQLite from taking a shm-lock on the target file when it + // is supplying heap memory to the upper layer in place of *-shm + // segments. if (ofst == WAL_LOCK_CKPT) && (n == 1) { rc = SQLITE_BUSY } @@ -161151,11 +163774,10 @@ func rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int3 if (pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == RBU_STAGE_CAPTURE) { bCapture = 1 } - if (bCapture == 0) || (0 == (flags & SQLITE_SHM_UNLOCK)) { rc = (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 112 /* &.xShmLock */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, ofst, n, flags) if (bCapture != 0) && (rc == SQLITE_OK) { - *(*U32)(unsafe.Pointer(pRbu + 316 /* &.mLock */)) |= (U32(int32(1) << ofst)) + *(*U32)(unsafe.Pointer(pRbu + 316 /* &.mLock */)) |= (U32(((int32(1) << n) - 1) << ofst)) } } } @@ -161164,7 +163786,7 @@ func rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int3 } // Obtain a pointer to a mapping of a single 32KiB page of the *-shm file. -func rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 { /* sqlite3.c:200709:12: */ +func rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 { /* sqlite3.c:203734:12: */ var p uintptr = pFile var rc int32 = SQLITE_OK var eStage int32 = func() int32 { @@ -161219,13 +163841,13 @@ func rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, i } // Memory barrier. -func rbuVfsShmBarrier(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:200767:13: */ +func rbuVfsShmBarrier(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:203792:13: */ var p uintptr = pFile (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 120 /* &.xShmBarrier */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal) } // The xShmUnmap method. -func rbuVfsShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* sqlite3.c:200775:12: */ +func rbuVfsShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* sqlite3.c:203800:12: */ var p uintptr = pFile var rc int32 = SQLITE_OK var eStage int32 = func() int32 { @@ -161246,7 +163868,7 @@ func rbuVfsShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* sqli } // Open an rbu file handle. -func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:200794:12: */ +func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:203819:12: */ var pRbuVfs uintptr = pVfs var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRealVfs var pFd uintptr = pFile @@ -161278,7 +163900,7 @@ func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags var nCopy Size_t var zCopy uintptr if (*Sqlite3rbu)(unsafe.Pointer(((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu))).FzTarget == uintptr(0) { - zBase = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, ts+8333 /* "main" */) + zBase = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, ts+8426 /* "main" */) zBase = Xsqlite3_filename_wal(tls, zBase) } nCopy = libc.Xstrlen(tls, zBase) @@ -161302,7 +163924,7 @@ func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags } if ((oflags & SQLITE_OPEN_MAIN_DB) != 0) && - (Xsqlite3_uri_boolean(tls, zName, ts+35578 /* "rbu_memory" */, 0) != 0) { + (Xsqlite3_uri_boolean(tls, zName, ts+36084 /* "rbu_memory" */, 0) != 0) { oflags = ((((SQLITE_OPEN_TEMP_DB | SQLITE_OPEN_READWRITE) | SQLITE_OPEN_CREATE) | SQLITE_OPEN_EXCLUSIVE) | SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) @@ -161344,17 +163966,17 @@ var rbuvfs_io_methods = Sqlite3_io_methods{ FxShmLock: 0, // xShmLock FxShmBarrier: 0, // xShmBarrier FxShmUnmap: 0, // xFetch, xUnfetch -} /* sqlite3.c:200801:29 */ +} /* sqlite3.c:203826:29 */ // Delete the file located at zPath. -func rbuVfsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:200906:12: */ +func rbuVfsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:203931:12: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pRealVfs + 48 /* &.xDelete */))))(tls, pRealVfs, zPath, dirSync) } // Test for access permissions. Return true if the requested permission // is available, or false otherwise. -func rbuVfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:200915:12: */ +func rbuVfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:203940:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -161397,13 +164019,13 @@ func rbuVfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResO // Populate buffer zOut with the full canonical pathname corresponding // to the pathname in zPath. zOut is guaranteed to point to a buffer // of at least (DEVSYM_MAX_PATHNAME+1) bytes. -func rbuVfsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:200963:12: */ +func rbuVfsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:203988:12: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pRealVfs + 64 /* &.xFullPathname */))))(tls, pRealVfs, zPath, nOut, zOut) } // Open the dynamic library located at zPath and return a handle. -func rbuVfsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:200977:13: */ +func rbuVfsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:204002:13: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pRealVfs + 72 /* &.xDlOpen */))))(tls, pRealVfs, zPath) } @@ -161411,51 +164033,51 @@ func rbuVfsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlit // Populate the buffer zErrMsg (size nByte bytes) with a human readable // utf-8 string describing the most recent error encountered associated // with dynamic libraries. -func rbuVfsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* sqlite3.c:200987:13: */ +func rbuVfsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* sqlite3.c:204012:13: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer((pRealVfs + 80 /* &.xDlError */))))(tls, pRealVfs, nByte, zErrMsg) } // Return a pointer to the symbol zSymbol in the dynamic library pHandle. -func rbuVfsDlSym(tls *libc.TLS, pVfs uintptr, pArg uintptr, zSym uintptr) uintptr { /* sqlite3.c:200995:13: */ +func rbuVfsDlSym(tls *libc.TLS, pVfs uintptr, pArg uintptr, zSym uintptr) uintptr { /* sqlite3.c:204020:13: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((pRealVfs + 88 /* &.xDlSym */))))(tls, pRealVfs, pArg, zSym) } // Close the dynamic library handle pHandle. -func rbuVfsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:201007:13: */ +func rbuVfsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:204032:13: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pRealVfs + 96 /* &.xDlClose */))))(tls, pRealVfs, pHandle) } // Populate the buffer pointed to by zBufOut with nByte bytes of // random data. -func rbuVfsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:201017:12: */ +func rbuVfsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:204042:12: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pRealVfs + 104 /* &.xRandomness */))))(tls, pRealVfs, nByte, zBufOut) } // Sleep for nMicro microseconds. Return the number of microseconds // actually slept. -func rbuVfsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:201026:12: */ +func rbuVfsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:204051:12: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pRealVfs + 112 /* &.xSleep */))))(tls, pRealVfs, nMicro) } // Return the current time as a Julian Day number in *pTimeOut. -func rbuVfsCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:201034:12: */ +func rbuVfsCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:204059:12: */ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pRealVfs + 120 /* &.xCurrentTime */))))(tls, pRealVfs, pTimeOut) } // No-op. -func rbuVfsGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* sqlite3.c:201042:12: */ +func rbuVfsGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* sqlite3.c:204067:12: */ return 0 } // Deregister and destroy an RBU vfs created by an earlier call to // sqlite3rbu_create_vfs(). -func Xsqlite3rbu_destroy_vfs(tls *libc.TLS, zName uintptr) { /* sqlite3.c:201050:17: */ +func Xsqlite3rbu_destroy_vfs(tls *libc.TLS, zName uintptr) { /* sqlite3.c:204075:17: */ var pVfs uintptr = Xsqlite3_vfs_find(tls, zName) if (pVfs != 0) && ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxOpen == *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32 @@ -161469,7 +164091,7 @@ func Xsqlite3rbu_destroy_vfs(tls *libc.TLS, zName uintptr) { /* sqlite3.c:201050 // Create an RBU VFS named zName that accesses the underlying file-system // via existing VFS zParent. The new object is registered as a non-default // VFS with SQLite before returning. -func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) int32 { /* sqlite3.c:201064:16: */ +func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) int32 { /* sqlite3.c:204089:16: */ var pNew uintptr = uintptr(0) // Newly allocated VFS var rc int32 = SQLITE_OK @@ -161530,17 +164152,17 @@ var vfs_template = Sqlite3_vfs{ FxSleep: 0, // xSleep FxCurrentTime: 0, // xCurrentTime FxGetLastError: 0, // Unimplemented version 3 methods -} /* sqlite3.c:201067:22 */ +} /* sqlite3.c:204092:22 */ // Configure the aggregate temp file size limit for this RBU handle. -func Xsqlite3rbu_temp_size_limit(tls *libc.TLS, pRbu uintptr, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:201142:26: */ +func Xsqlite3rbu_temp_size_limit(tls *libc.TLS, pRbu uintptr, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:204167:26: */ if n >= int64(0) { (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit = n } return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit } -func Xsqlite3rbu_temp_size(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:201149:26: */ +func Xsqlite3rbu_temp_size(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:204174:26: */ return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTemp } @@ -161614,7 +164236,7 @@ var zDbstatSchema = // 9 Size of the page (sum for aggregate) // 10 Database schema being analyzed // 11 aggregate info for each table -*(*[258]int8)(unsafe.Pointer(ts + 35589 /* "CREATE TABLE x( ..." */)) /* sqlite3.c:201218:19 */ +*(*[258]int8)(unsafe.Pointer(ts + 36095 /* "CREATE TABLE x( ..." */)) /* sqlite3.c:204243:19 */ // Forward reference to data structured used in this module type StatTable1 = struct { @@ -161622,10 +164244,10 @@ type StatTable1 = struct { Fdb uintptr FiDb int32 _ [4]byte -} /* sqlite3.c:201236:9 */ +} /* sqlite3.c:204261:9 */ // Forward reference to data structured used in this module -type StatTable = StatTable1 /* sqlite3.c:201236:26 */ +type StatTable = StatTable1 /* sqlite3.c:204261:26 */ type StatCursor1 = struct { Fbase Sqlite3_vtab_cursor FpStmt uintptr @@ -161647,9 +164269,9 @@ type StatCursor1 = struct { FnPayload I64 FiOffset I64 FszPage I64 -} /* sqlite3.c:201237:9 */ +} /* sqlite3.c:204262:9 */ -type StatCursor = StatCursor1 /* sqlite3.c:201237:27 */ +type StatCursor = StatCursor1 /* sqlite3.c:204262:27 */ type StatPage1 = struct { FiPgno U32 _ [4]byte @@ -161665,9 +164287,9 @@ type StatPage1 = struct { FaCell uintptr FiRightChildPg U32 FnMxPayload int32 -} /* sqlite3.c:201237:9 */ +} /* sqlite3.c:204262:9 */ -type StatPage = StatPage1 /* sqlite3.c:201238:25 */ +type StatPage = StatPage1 /* sqlite3.c:204263:25 */ type StatCell1 = struct { FnLocal int32 FiChildPg U32 @@ -161676,12 +164298,12 @@ type StatCell1 = struct { FaOvfl uintptr FnLastOvfl int32 FiOvfl int32 -} /* sqlite3.c:201237:9 */ +} /* sqlite3.c:204262:9 */ -type StatCell = StatCell1 /* sqlite3.c:201239:25 */ +type StatCell = StatCell1 /* sqlite3.c:204264:25 */ // Connect to or create a new DBSTAT virtual table. -func statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:201307:12: */ +func statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:204332:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -161695,7 +164317,7 @@ func statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintp Xsqlite3TokenInit(tls, bp+8 /* &nm */, *(*uintptr)(unsafe.Pointer(argv + 3*8))) iDb = Xsqlite3FindDb(tls, db, bp+8 /* &nm */) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+13011 /* "no such database..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+13424 /* "no such database..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) return SQLITE_ERROR } } else { @@ -161721,7 +164343,7 @@ func statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintp } // Disconnect from or destroy the DBSTAT virtual table. -func statDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:201350:12: */ +func statDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:204375:12: */ Xsqlite3_free(tls, pVtab) return SQLITE_OK } @@ -161734,7 +164356,7 @@ func statDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:201350:12 // 0x02 There is a name=? term in the WHERE clause // 0x04 There is an aggregate=? term in the WHERE clause // 0x08 Output should be ordered by name and path -func statBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:201365:12: */ +func statBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:204390:12: */ var i int32 var iSchema int32 = -1 var iName int32 = -1 @@ -161807,7 +164429,7 @@ func statBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqli } // Open a new DBSTAT cursor. -func statOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:201438:12: */ +func statOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:204463:12: */ var pTab uintptr = pVTab var pCsr uintptr @@ -161824,7 +164446,7 @@ func statOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3 return SQLITE_OK } -func statClearCells(tls *libc.TLS, p uintptr) { /* sqlite3.c:201455:13: */ +func statClearCells(tls *libc.TLS, p uintptr) { /* sqlite3.c:204480:13: */ var i int32 if (*StatPage)(unsafe.Pointer(p)).FaCell != 0 { for i = 0; i < (*StatPage)(unsafe.Pointer(p)).FnCell; i++ { @@ -161836,14 +164458,14 @@ func statClearCells(tls *libc.TLS, p uintptr) { /* sqlite3.c:201455:13: */ (*StatPage)(unsafe.Pointer(p)).FaCell = uintptr(0) } -func statClearPage(tls *libc.TLS, p uintptr) { /* sqlite3.c:201467:13: */ +func statClearPage(tls *libc.TLS, p uintptr) { /* sqlite3.c:204492:13: */ statClearCells(tls, p) Xsqlite3PagerUnref(tls, (*StatPage)(unsafe.Pointer(p)).FpPg) Xsqlite3_free(tls, (*StatPage)(unsafe.Pointer(p)).FzPath) libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(StatPage{}))) } -func statResetCsr(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:201474:13: */ +func statResetCsr(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:204499:13: */ var i int32 Xsqlite3_reset(tls, (*StatCursor)(unsafe.Pointer(pCsr)).FpStmt) for i = 0; i < (int32(uint64(unsafe.Sizeof([32]StatPage{})) / uint64(unsafe.Sizeof(StatPage{})))); i++ { @@ -161856,7 +164478,7 @@ func statResetCsr(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:201474:13: */ } // Resize the space-used counters inside of the cursor -func statResetCounts(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:201487:13: */ +func statResetCounts(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:204512:13: */ (*StatCursor)(unsafe.Pointer(pCsr)).FnCell = 0 (*StatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = 0 (*StatCursor)(unsafe.Pointer(pCsr)).FnUnused = int64(0) @@ -161866,7 +164488,7 @@ func statResetCounts(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:201487:13: */ } // Close a DBSTAT cursor. -func statClose(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:201499:12: */ +func statClose(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:204524:12: */ var pCsr uintptr = pCursor statResetCsr(tls, pCsr) Xsqlite3_finalize(tls, (*StatCursor)(unsafe.Pointer(pCsr)).FpStmt) @@ -161877,7 +164499,7 @@ func statClose(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:201499:12: * // For a single cell on a btree page, compute the number of bytes of // content (payload) stored on that page. That is to say, compute the // number of bytes of content not found on overflow pages. -func getLocalPayload(tls *libc.TLS, nUsable int32, flags U8, nTotal int32) int32 { /* sqlite3.c:201512:12: */ +func getLocalPayload(tls *libc.TLS, nUsable int32, flags U8, nTotal int32) int32 { /* sqlite3.c:204537:12: */ var nLocal int32 var nMinLocal int32 var nMaxLocal int32 @@ -161899,7 +164521,7 @@ func getLocalPayload(tls *libc.TLS, nUsable int32, flags U8, nTotal int32) int32 // Populate the StatPage object with information about the all // cells found on the page currently under analysis. -func statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) int32 { /* sqlite3.c:201537:12: */ +func statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) int32 { /* sqlite3.c:204562:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -162137,7 +164759,7 @@ statPageIsCorrupt: // Populate the pCsr->iOffset and pCsr->szPage member variables. Based on // the current value of pCsr->iPageno. -func statSizeAndOffset(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:201652:13: */ +func statSizeAndOffset(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:204677:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -162164,7 +164786,7 @@ func statSizeAndOffset(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:201652:13: */ // Move a DBSTAT cursor to the next entry. Normally, the next // entry will be the next page, but in aggregated mode (pCsr->isAgg!=0), // the next entry is the next btree. -func statNext(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:201679:12: */ +func statNext(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:204704:12: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -162218,7 +164840,7 @@ __5: if !(!(int32((*StatCursor)(unsafe.Pointer(pCsr)).FisAgg) != 0)) { goto __6 } - (*StatPage)(unsafe.Pointer((pCsr + 24 /* &.aPage */))).FzPath = libc.AssignUintptr(&z, Xsqlite3_mprintf(tls, ts+35847 /* "/" */, 0)) + (*StatPage)(unsafe.Pointer((pCsr + 24 /* &.aPage */))).FzPath = libc.AssignUintptr(&z, Xsqlite3_mprintf(tls, ts+36353 /* "/" */, 0)) if !(z == uintptr(0)) { goto __7 } @@ -162276,9 +164898,9 @@ __14: } (*StatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*StatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*StatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*U32)(unsafe.Pointer((*StatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 35849 /* "overflow" */ + (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 36355 /* "overflow" */ (*StatCursor)(unsafe.Pointer(pCsr)).FzPath = libc.AssignUintptr(&z, Xsqlite3_mprintf(tls, - ts+35858 /* "%s%.3x+%.6x" */, libc.VaList(bp, (*StatPage)(unsafe.Pointer(p)).FzPath, (*StatPage)(unsafe.Pointer(p)).FiCell, iOvfl))) + ts+36364 /* "%s%.3x+%.6x" */, libc.VaList(bp, (*StatPage)(unsafe.Pointer(p)).FzPath, (*StatPage)(unsafe.Pointer(p)).FiCell, iOvfl))) if z == uintptr(0) { return SQLITE_NOMEM } @@ -162327,7 +164949,7 @@ __17: goto __21 } statResetCsr(tls, pCsr) - return Xsqlite3CorruptError(tls, 201767) + return Xsqlite3CorruptError(tls, 204792) __21: ; @@ -162346,7 +164968,7 @@ __23: if !(!(int32((*StatCursor)(unsafe.Pointer(pCsr)).FisAgg) != 0)) { goto __24 } - (*StatPage)(unsafe.Pointer(p + 1*64)).FzPath = libc.AssignUintptr(&z, Xsqlite3_mprintf(tls, ts+35870 /* "%s%.3x/" */, libc.VaList(bp+24, (*StatPage)(unsafe.Pointer(p)).FzPath, (*StatPage)(unsafe.Pointer(p)).FiCell))) + (*StatPage)(unsafe.Pointer(p + 1*64)).FzPath = libc.AssignUintptr(&z, Xsqlite3_mprintf(tls, ts+36376 /* "%s%.3x/" */, libc.VaList(bp+24, (*StatPage)(unsafe.Pointer(p)).FzPath, (*StatPage)(unsafe.Pointer(p)).FiCell))) if !(z == uintptr(0)) { goto __25 } @@ -162389,14 +165011,14 @@ __2: goto __28 __29: // table internal __30: // index internal - (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 35878 /* "internal" */ + (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 36384 /* "internal" */ goto __28 __31: // table leaf __32: // index leaf - (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 35887 /* "leaf" */ + (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 36393 /* "leaf" */ goto __28 __33: - (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 35892 /* "corrupted" */ + (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 36398 /* "corrupted" */ goto __28 __28: ; @@ -162452,7 +165074,7 @@ __26: return rc } -func statEof(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:201836:12: */ +func statEof(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:204861:12: */ var pCsr uintptr = pCursor return int32((*StatCursor)(unsafe.Pointer(pCsr)).FisEof) } @@ -162460,7 +165082,7 @@ func statEof(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:201836:12: */ // Initialize a cursor according to the query plan idxNum using the // arguments in argv[0]. See statBestIndex() for a description of the // meaning of the bits in idxNum. -func statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:201845:12: */ +func statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:204870:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -162500,13 +165122,13 @@ func statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, ar pSql = Xsqlite3_str_new(tls, (*StatTable)(unsafe.Pointer(pTab)).Fdb) Xsqlite3_str_appendf(tls, pSql, - ts+35902, /* "SELECT * FROM (S..." */ + ts+36408, /* "SELECT * FROM (S..." */ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*StatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb+uintptr((*StatCursor)(unsafe.Pointer(pCsr)).FiDb)*32)).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, ts+36057 /* "WHERE name=%Q" */, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, ts+36563 /* "WHERE name=%Q" */, libc.VaList(bp+8, zName)) } if (idxNum & 0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, ts+36071 /* " ORDER BY name" */, 0) + Xsqlite3_str_appendf(tls, pSql, ts+36577 /* " ORDER BY name" */, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -162522,7 +165144,7 @@ func statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, ar return rc } -func statColumn(tls *libc.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:201911:12: */ +func statColumn(tls *libc.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:204936:12: */ var pCsr uintptr = pCursor switch i { case 0: // name @@ -162583,15 +165205,15 @@ func statColumn(tls *libc.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /* return SQLITE_OK } -func statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:201972:12: */ +func statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:204997:12: */ var pCsr uintptr = pCursor *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = Sqlite_int64((*StatCursor)(unsafe.Pointer(pCsr)).FiPageno) return SQLITE_OK } // Invoke this routine to register the "dbstat" virtual table module -func Xsqlite3DbstatRegister(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:201981:20: */ - return Xsqlite3_create_module(tls, db, ts+36086 /* "dbstat" */, uintptr(unsafe.Pointer(&dbstat_module)), uintptr(0)) +func Xsqlite3DbstatRegister(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:205006:20: */ + return Xsqlite3_create_module(tls, db, ts+36592 /* "dbstat" */, uintptr(unsafe.Pointer(&dbstat_module)), uintptr(0)) } var dbstat_module = Sqlite3_module{ // iVersion @@ -162607,7 +165229,7 @@ var dbstat_module = Sqlite3_module{ // iVersion FxEof: 0, // xEof - check for end of scan FxColumn: 0, // xColumn - read data FxRowid: 0, // xShadowName -} /* sqlite3.c:201982:25 */ +} /* sqlite3.c:205007:25 */ //************* End of dbstat.c ********************************************* //************* Begin file dbpage.c ***************************************** @@ -162647,7 +165269,7 @@ var dbstat_module = Sqlite3_module{ // iVersion type DbpageTable1 = struct { Fbase Sqlite3_vtab Fdb uintptr -} /* sqlite3.c:202053:9 */ +} /* sqlite3.c:205078:9 */ //************* End of dbstat.c ********************************************* //************* Begin file dbpage.c ***************************************** @@ -162684,7 +165306,7 @@ type DbpageTable1 = struct { // #include "sqliteInt.h" ** Requires access to internal data structures ** -type DbpageTable = DbpageTable1 /* sqlite3.c:202053:28 */ +type DbpageTable = DbpageTable1 /* sqlite3.c:205078:28 */ type DbpageCursor1 = struct { Fbase Sqlite3_vtab_cursor Fpgno int32 @@ -162693,20 +165315,20 @@ type DbpageCursor1 = struct { FpPage1 uintptr FiDb int32 FszPage int32 -} /* sqlite3.c:202054:9 */ +} /* sqlite3.c:205079:9 */ -type DbpageCursor = DbpageCursor1 /* sqlite3.c:202054:29 */ +type DbpageCursor = DbpageCursor1 /* sqlite3.c:205079:29 */ // Columns // Connect to or create a dbpagevfs virtual table. -func dbpageConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:202081:12: */ +func dbpageConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:205106:12: */ var pTab uintptr = uintptr(0) var rc int32 = SQLITE_OK Xsqlite3_vtab_config(tls, db, SQLITE_VTAB_DIRECTONLY, 0) rc = Xsqlite3_declare_vtab(tls, db, - ts+36093 /* "CREATE TABLE x(p..." */) + ts+36599 /* "CREATE TABLE x(p..." */) if rc == SQLITE_OK { pTab = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(DbpageTable{}))) if pTab == uintptr(0) { @@ -162724,7 +165346,7 @@ func dbpageConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uin } // Disconnect from or destroy a dbpagevfs virtual table. -func dbpageDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:202112:12: */ +func dbpageDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:205137:12: */ Xsqlite3_free(tls, pVtab) return SQLITE_OK } @@ -162735,7 +165357,7 @@ func dbpageDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:202112: // 1 schema=main, pgno=?1 // 2 schema=?1, full table scan // 3 schema=?1, pgno=?2 -func dbpageBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:202125:12: */ +func dbpageBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:205150:12: */ var i int32 var iPlan int32 = 0 @@ -162794,7 +165416,7 @@ func dbpageBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sq } // Open a new dbpagevfs cursor. -func dbpageOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:202180:12: */ +func dbpageOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:205205:12: */ var pCsr uintptr pCsr = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(DbpageCursor{}))) @@ -162811,7 +165433,7 @@ func dbpageOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlit } // Close a dbpagevfs cursor. -func dbpageClose(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:202199:12: */ +func dbpageClose(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:205224:12: */ var pCsr uintptr = pCursor if (*DbpageCursor)(unsafe.Pointer(pCsr)).FpPage1 != 0 { Xsqlite3PagerUnrefPageOne(tls, (*DbpageCursor)(unsafe.Pointer(pCsr)).FpPage1) @@ -162821,14 +165443,14 @@ func dbpageClose(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:202199:12: } // Move a dbpagevfs cursor to the next entry in the file. -func dbpageNext(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:202209:12: */ +func dbpageNext(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:205234:12: */ var rc int32 = SQLITE_OK var pCsr uintptr = pCursor (*DbpageCursor)(unsafe.Pointer(pCsr)).Fpgno++ return rc } -func dbpageEof(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:202216:12: */ +func dbpageEof(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:205241:12: */ var pCsr uintptr = pCursor return (libc.Bool32((*DbpageCursor)(unsafe.Pointer(pCsr)).Fpgno > (*DbpageCursor)(unsafe.Pointer(pCsr)).FmxPgno)) } @@ -162841,7 +165463,7 @@ func dbpageEof(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:202216:12: * // 3 schema=?1, pgno=?2 // // idxStr is not used -func dbpageFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:202231:12: */ +func dbpageFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:205256:12: */ var pCsr uintptr = pCursor var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab var rc int32 @@ -162889,7 +165511,7 @@ func dbpageFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, return rc } -func dbpageColumn(tls *libc.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:202277:12: */ +func dbpageColumn(tls *libc.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:205302:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -162925,13 +165547,13 @@ func dbpageColumn(tls *libc.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { return SQLITE_OK } -func dbpageRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:202308:12: */ +func dbpageRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:205333:12: */ var pCsr uintptr = pCursor *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = Sqlite_int64((*DbpageCursor)(unsafe.Pointer(pCsr)).Fpgno) return SQLITE_OK } -func dbpageUpdate(tls *libc.TLS, pVtab uintptr, argc int32, argv uintptr, pRowid uintptr) int32 { /* sqlite3.c:202314:12: */ +func dbpageUpdate(tls *libc.TLS, pVtab uintptr, argc int32, argv uintptr, pRowid uintptr) int32 { /* sqlite3.c:205339:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -162951,17 +165573,17 @@ func dbpageUpdate(tls *libc.TLS, pVtab uintptr, argc int32, argv uintptr, pRowid rc = SQLITE_OK zErr = uintptr(0) - if !(((*Sqlite3)(unsafe.Pointer((*DbpageTable)(unsafe.Pointer(pTab)).Fdb)).Fflags & SQLITE_Defensive) != 0) { + if !(((*Sqlite3)(unsafe.Pointer((*DbpageTable)(unsafe.Pointer(pTab)).Fdb)).Fflags & uint64(SQLITE_Defensive)) != 0) { goto __1 } - zErr = ts + 36160 /* "read-only" */ + zErr = ts + 36666 /* "read-only" */ goto update_fail __1: ; if !(argc == 1) { goto __2 } - zErr = ts + 36170 /* "cannot delete" */ + zErr = ts + 36676 /* "cannot delete" */ goto update_fail __2: ; @@ -162969,7 +165591,7 @@ __2: if !(Pgno(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) != pgno) { goto __3 } - zErr = ts + 36184 /* "cannot insert" */ + zErr = ts + 36690 /* "cannot insert" */ goto update_fail __3: ; @@ -162982,7 +165604,7 @@ __3: if !(iDb < 0) { goto __4 } - zErr = ts + 36198 /* "no such schema" */ + zErr = ts + 36704 /* "no such schema" */ goto update_fail __4: ; @@ -162990,7 +165612,7 @@ __4: if !(((pgno < Pgno(1)) || (pBt == uintptr(0))) || (pgno > Pgno(int32(Xsqlite3BtreeLastPage(tls, pBt))))) { goto __5 } - zErr = ts + 36213 /* "bad page number" */ + zErr = ts + 36719 /* "bad page number" */ goto update_fail __5: ; @@ -162999,7 +165621,7 @@ __5: (Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))) != szPage)) { goto __6 } - zErr = ts + 36229 /* "bad page value" */ + zErr = ts + 36735 /* "bad page value" */ goto update_fail __6: ; @@ -163031,7 +165653,7 @@ update_fail: // Since we do not know in advance which database files will be // written by the sqlite_dbpage virtual table, start a write transaction // on them all. -func dbpageBegin(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:202385:12: */ +func dbpageBegin(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:205410:12: */ var pTab uintptr = pVtab var db uintptr = (*DbpageTable)(unsafe.Pointer(pTab)).Fdb var i int32 @@ -163045,8 +165667,8 @@ func dbpageBegin(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:202385:12: * } // Invoke this routine to register the "dbpage" virtual table module -func Xsqlite3DbpageRegister(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:202400:20: */ - return Xsqlite3_create_module(tls, db, ts+36244 /* "sqlite_dbpage" */, uintptr(unsafe.Pointer(&dbpage_module)), uintptr(0)) +func Xsqlite3DbpageRegister(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:205425:20: */ + return Xsqlite3_create_module(tls, db, ts+36750 /* "sqlite_dbpage" */, uintptr(unsafe.Pointer(&dbpage_module)), uintptr(0)) } var dbpage_module = Sqlite3_module{ // iVersion @@ -163064,7 +165686,7 @@ var dbpage_module = Sqlite3_module{ // iVersion FxRowid: 0, // xRowid - read data FxUpdate: 0, // xUpdate FxBegin: 0, // xShadowName -} /* sqlite3.c:202401:25 */ +} /* sqlite3.c:205426:25 */ //************* End of dbpage.c ********************************************* //************* Begin file sqlite3session.c ********************************* @@ -163137,7 +165759,7 @@ type Fts5Global1 = struct { FpTok uintptr FpDfltTok uintptr FpCsr uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ //************* End of dbpage.c ********************************************* //************* Begin file sqlite3session.c ********************************* @@ -163202,13 +165824,13 @@ type Fts5Global1 = struct { // Mark a function parameter as unused, to suppress nuisance compiler // warnings. -type Fts5Global = Fts5Global1 /* sqlite3.c:208614:27 */ +type Fts5Global = Fts5Global1 /* sqlite3.c:211770:27 */ type Fts5Colset1 = struct { FnCol int32 FaiCol [1]int32 -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5Colset = Fts5Colset1 /* sqlite3.c:208615:27 */ +type Fts5Colset = Fts5Colset1 /* sqlite3.c:211771:27 */ // ************************************************************************* // @@ -163236,24 +165858,24 @@ type Fts5Config1 = struct { FpTok uintptr FpTokApi uintptr FbLock int32 + FePattern int32 FiCookie int32 Fpgsz int32 FnAutomerge int32 FnCrisisMerge int32 FnUsermerge int32 FnHashSize int32 - _ [4]byte FzRank uintptr FzRankArgs uintptr FpzErrmsg uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // ************************************************************************* // // Interface to code in fts5_config.c. fts5_config.c contains contains code // to parse the arguments passed to the CREATE VIRTUAL TABLE statement. -type Fts5Config = Fts5Config1 /* sqlite3.c:208635:27 */ +type Fts5Config = Fts5Config1 /* sqlite3.c:211791:27 */ // // End of interface to code in fts5_config.c. @@ -163268,7 +165890,7 @@ type Fts5Buffer1 = struct { Fp uintptr Fn int32 FnSpace int32 -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // // End of interface to code in fts5_config.c. @@ -163279,7 +165901,7 @@ type Fts5Buffer1 = struct { // Interface to code in fts5_buffer.c. // Buffer object for the incremental building of string data. -type Fts5Buffer = Fts5Buffer1 /* sqlite3.c:208758:27 */ +type Fts5Buffer = Fts5Buffer1 /* sqlite3.c:211917:27 */ type Fts5PoslistReader1 = struct { Fa uintptr @@ -163289,19 +165911,19 @@ type Fts5PoslistReader1 = struct { FbEof U8 _ [6]byte FiPos I64 -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5PoslistReader = Fts5PoslistReader1 /* sqlite3.c:208794:34 */ +type Fts5PoslistReader = Fts5PoslistReader1 /* sqlite3.c:211953:34 */ -type Fts5PoslistWriter1 = struct{ FiPrev I64 } /* sqlite3.c:208813:9 */ +type Fts5PoslistWriter1 = struct{ FiPrev I64 } /* sqlite3.c:211972:9 */ -type Fts5PoslistWriter = Fts5PoslistWriter1 /* sqlite3.c:208813:34 */ +type Fts5PoslistWriter = Fts5PoslistWriter1 /* sqlite3.c:211972:34 */ // Bucket of terms object used by the integrity-check in offsets=0 mode. -type Fts5Termset1 = struct{ FapHash [512]uintptr } /* sqlite3.c:208835:9 */ +type Fts5Termset1 = struct{ FapHash [512]uintptr } /* sqlite3.c:211994:9 */ // Bucket of terms object used by the integrity-check in offsets=0 mode. -type Fts5Termset = Fts5Termset1 /* sqlite3.c:208835:28 */ +type Fts5Termset = Fts5Termset1 /* sqlite3.c:211994:28 */ // // End of interface to code in fts5_buffer.c. @@ -163334,7 +165956,7 @@ type Fts5Index1 = struct { FpDataVersion uintptr FiStructVersion I64 FpStruct uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // // End of interface to code in fts5_buffer.c. @@ -163345,16 +165967,16 @@ type Fts5Index1 = struct { // Interface to code in fts5_index.c. fts5_index.c contains contains code // to access the data stored in the %_data table. -type Fts5Index = Fts5Index1 /* sqlite3.c:208849:26 */ +type Fts5Index = Fts5Index1 /* sqlite3.c:212008:26 */ type Fts5IndexIter1 = struct { FiRowid I64 FpData uintptr FnData int32 FbEof U8 _ [3]byte -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5IndexIter = Fts5IndexIter1 /* sqlite3.c:208850:30 */ +type Fts5IndexIter = Fts5IndexIter1 /* sqlite3.c:212009:30 */ // // End of interface to code in fts5_varint.c. @@ -163369,7 +165991,7 @@ type Fts5Table1 = struct { Fbase Sqlite3_vtab FpConfig uintptr FpIndex uintptr -} /* sqlite3.c:209049:9 */ +} /* sqlite3.c:212208:9 */ // // End of interface to code in fts5_varint.c. @@ -163380,7 +166002,7 @@ type Fts5Table1 = struct { // Interface to code in fts5_main.c. // Virtual-table object. -type Fts5Table = Fts5Table1 /* sqlite3.c:209049:26 */ +type Fts5Table = Fts5Table1 /* sqlite3.c:212208:26 */ // // End of interface to code in fts5.c. @@ -163397,7 +166019,7 @@ type Fts5Hash1 = struct { FnSlot int32 FpScan uintptr FaSlot uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // // End of interface to code in fts5.c. @@ -163406,7 +166028,7 @@ type Fts5Hash1 = struct { // ************************************************************************* // // Interface to code in fts5_hash.c. -type Fts5Hash = Fts5Hash1 /* sqlite3.c:209076:25 */ +type Fts5Hash = Fts5Hash1 /* sqlite3.c:212234:25 */ // // End of interface to code in fts5_hash.c. @@ -163425,7 +166047,7 @@ type Fts5Storage1 = struct { FnTotalRow I64 FaTotalSize uintptr FaStmt [11]uintptr -} /* sqlite3.c:209132:9 */ +} /* sqlite3.c:212290:9 */ // // End of interface to code in fts5_hash.c. @@ -163436,7 +166058,7 @@ type Fts5Storage1 = struct { // Interface to code in fts5_storage.c. fts5_storage.c contains contains // code to access the data stored in the %_content and %_docsize tables. -type Fts5Storage = Fts5Storage1 /* sqlite3.c:209132:28 */ +type Fts5Storage = Fts5Storage1 /* sqlite3.c:212290:28 */ // // End of interface to code in fts5_storage.c. @@ -163452,7 +166074,7 @@ type Fts5Expr1 = struct { FbDesc int32 FnPhrase int32 FapExprPhrase uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // // End of interface to code in fts5_storage.c. @@ -163461,7 +166083,7 @@ type Fts5Expr1 = struct { // ************************************************************************* // // Interface to code in fts5_expr.c. -type Fts5Expr = Fts5Expr1 /* sqlite3.c:209175:25 */ +type Fts5Expr = Fts5Expr1 /* sqlite3.c:212333:25 */ type Fts5ExprNode1 = struct { FeType int32 FbEof int32 @@ -163473,35 +166095,37 @@ type Fts5ExprNode1 = struct { FnChild int32 _ [4]byte FapChild [1]uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5ExprNode = Fts5ExprNode1 /* sqlite3.c:209176:29 */ +type Fts5ExprNode = Fts5ExprNode1 /* sqlite3.c:212334:29 */ type Fts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr -} /* sqlite3.c:209177:9 */ + FpConfig uintptr + FzErr uintptr + Frc int32 + FnPhrase int32 + FapPhrase uintptr + FpExpr uintptr + FbPhraseToAnd int32 + _ [4]byte +} /* sqlite3.c:212335:9 */ -type Fts5Parse = Fts5Parse1 /* sqlite3.c:209177:26 */ +type Fts5Parse = Fts5Parse1 /* sqlite3.c:212335:26 */ type Fts5Token1 = struct { Fp uintptr Fn int32 _ [4]byte -} /* sqlite3.c:209178:9 */ +} /* sqlite3.c:212336:9 */ -type Fts5Token = Fts5Token1 /* sqlite3.c:209178:26 */ +type Fts5Token = Fts5Token1 /* sqlite3.c:212336:26 */ type Fts5ExprPhrase1 = struct { FpNode uintptr Fposlist Fts5Buffer FnTerm int32 _ [4]byte FaTerm [1]Fts5ExprTerm -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5ExprPhrase = Fts5ExprPhrase1 /* sqlite3.c:209179:31 */ +type Fts5ExprPhrase = Fts5ExprPhrase1 /* sqlite3.c:212337:31 */ type Fts5ExprNearset1 = struct { FnNear int32 _ [4]byte @@ -163509,21 +166133,23 @@ type Fts5ExprNearset1 = struct { FnPhrase int32 _ [4]byte FapPhrase [1]uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5ExprNearset = Fts5ExprNearset1 /* sqlite3.c:209180:32 */ +type Fts5ExprNearset = Fts5ExprNearset1 /* sqlite3.c:212338:32 */ type Fts5PoslistPopulator1 = struct { Fwriter Fts5PoslistWriter FbOk int32 FbMiss int32 -} /* sqlite3.c:209220:9 */ +} /* sqlite3.c:212386:9 */ -type Fts5PoslistPopulator = Fts5PoslistPopulator1 /* sqlite3.c:209220:37 */ +type Fts5PoslistPopulator = Fts5PoslistPopulator1 /* sqlite3.c:212386:37 */ // // End of interface to code in fts5_unicode2.c. // +// This file is automatically generated by Lemon from input grammar +// source file "fts5parse.y". // 2000-05-29 // // The author disclaims copyright to this source code. In place of @@ -163546,8 +166172,6 @@ type Fts5PoslistPopulator = Fts5PoslistPopulator1 /* sqlite3.c:209220:37 */ // // The following is the concatenation of all %include directives from the // input grammar file: -// #include -// #include //*********** Begin %include sections from the grammar *********************** // #include "fts5Int.h" @@ -163565,11 +166189,9 @@ type Fts5PoslistPopulator = Fts5PoslistPopulator1 /* sqlite3.c:209220:37 */ // into sqlite3ParserAlloc(). The default is size_t. //*************** End of %include directives ********************************* -// These constants specify the various numeric values for terminal symbols -// in a format understandable to "makeheaders". This section is blank unless -// "lemon" is run with the "-m" command-line option. -// Begin makeheaders token definitions ************************ -//*************** End makeheaders token definitions ************************** +// These constants specify the various numeric values for terminal symbols. +// Begin token definitions ************************************ +//*************** End token definitions ************************************** // The next sections is a series of control #defines. // various aspects of the generated parser. @@ -163626,7 +166248,7 @@ type Fts5YYMINORTYPE = struct { _ [0]uint64 Ffts5yyinit int32 _ [12]byte -} /* sqlite3.c:209477:3 */ +} /* sqlite3.c:212662:3 */ //************ End control #defines ****************************************** // Define the fts5yytestcase() macro to be a no-op if is not already defined @@ -163699,7 +166321,7 @@ var fts5yy_action = [105]uint8{ /* 80 */ uint8(5), uint8(3), uint8(63), uint8(5), uint8(3), uint8(62), uint8(12), uint8(2), uint8(86), uint8(13), /* 90 */ uint8(9), uint8(30), uint8(10), uint8(10), uint8(54), uint8(57), uint8(75), uint8(78), uint8(78), uint8(53), /* 100 */ uint8(57), uint8(15), uint8(82), uint8(82), uint8(71), -} /* sqlite3.c:209570:31 */ +} /* sqlite3.c:212755:31 */ var fts5yy_lookahead = [121]uint8{ /* 0 */ uint8(16), uint8(17), uint8(18), uint8(19), uint8(20), uint8(22), uint8(22), uint8(24), uint8(24), uint8(17), /* 10 */ uint8(18), uint8(19), uint8(20), uint8(7), uint8(22), uint8(9), uint8(24), uint8(17), uint8(18), uint8(19), @@ -163714,23 +166336,23 @@ var fts5yy_lookahead = [121]uint8{ /* 100 */ uint8(9), uint8(9), uint8(27), uint8(27), uint8(11), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), /* 110 */ uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), /* 120 */ uint8(27), -} /* sqlite3.c:209583:29 */ +} /* sqlite3.c:212768:29 */ var fts5yy_shift_ofst = [35]uint8{ /* 0 */ uint8(44), uint8(44), uint8(44), uint8(44), uint8(44), uint8(44), uint8(51), uint8(77), uint8(43), uint8(12), /* 10 */ uint8(14), uint8(83), uint8(82), uint8(14), uint8(23), uint8(23), uint8(31), uint8(31), uint8(71), uint8(74), /* 20 */ uint8(78), uint8(81), uint8(86), uint8(91), uint8(6), uint8(53), uint8(53), uint8(60), uint8(64), uint8(68), /* 30 */ uint8(53), uint8(87), uint8(92), uint8(53), uint8(93), -} /* sqlite3.c:209601:28 */ +} /* sqlite3.c:212786:28 */ var fts5yy_reduce_ofst = [18]int8{ /* 0 */ int8(-16), int8(-8), int8(0), int8(9), int8(17), int8(25), int8(46), int8(-17), int8(-17), int8(37), /* 10 */ int8(67), int8(4), int8(4), int8(8), int8(4), int8(20), int8(27), int8(38), -} /* sqlite3.c:209610:26 */ +} /* sqlite3.c:212795:26 */ var fts5yy_default = [35]uint8{ /* 0 */ uint8(80), uint8(80), uint8(80), uint8(80), uint8(80), uint8(80), uint8(95), uint8(80), uint8(80), uint8(105), /* 10 */ uint8(80), uint8(110), uint8(110), uint8(80), uint8(110), uint8(110), uint8(80), uint8(80), uint8(80), uint8(80), /* 20 */ uint8(80), uint8(91), uint8(80), uint8(80), uint8(80), uint8(101), uint8(100), uint8(80), uint8(80), uint8(90), /* 30 */ uint8(103), uint8(80), uint8(80), uint8(104), uint8(80), -} /* sqlite3.c:209614:31 */ +} /* sqlite3.c:212799:31 */ //********* End of lemon-generated parsing tables **************************** // The next table maps tokens (terminal symbols) into fallback tokens. @@ -163767,9 +166389,9 @@ type fts5yyStackEntry = struct { Fmajor uint8 _ [6]byte Fminor Fts5YYMINORTYPE -} /* sqlite3.c:209657:1 */ +} /* sqlite3.c:212842:1 */ -type Fts5yyStackEntry = fts5yyStackEntry /* sqlite3.c:209664:33 */ +type Fts5yyStackEntry = fts5yyStackEntry /* sqlite3.c:212849:33 */ // The state of the parser is completely contained in an instance of // the following structure @@ -163778,9 +166400,9 @@ type fts5yyParser = struct { FpParse uintptr Ffts5yystack [100]Fts5yyStackEntry Ffts5yystackEnd uintptr -} /* sqlite3.c:209668:1 */ +} /* sqlite3.c:212853:1 */ -type Fts5yyParser = fts5yyParser /* sqlite3.c:209687:29 */ +type Fts5yyParser = fts5yyParser /* sqlite3.c:212872:29 */ // Datatype of the argument to the memory allocated passed as the // second argument to sqlite3Fts5ParserAlloc() below. This can be changed by @@ -163788,7 +166410,7 @@ type Fts5yyParser = fts5yyParser /* sqlite3.c:209687:29 */ // grammar. // Initialize a new parser that has already been allocated. -func sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { /* sqlite3.c:209835:13: */ +func sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { /* sqlite3.c:213021:13: */ var fts5yypParser uintptr = fts5yypRawParser (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos = fts5yypParser + 16 /* &.fts5yystack */ @@ -163807,7 +166429,7 @@ func sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { /* sqlite3 // Outputs: // A pointer to a parser. This pointer is used in subsequent calls // to sqlite3Fts5Parser and sqlite3Fts5ParserFree. -func sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) uintptr { /* sqlite3.c:209874:13: */ +func sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) uintptr { /* sqlite3.c:213060:13: */ var fts5yypParser uintptr fts5yypParser = (*(*func(*libc.TLS, U64) uintptr)(unsafe.Pointer(&mallocProc)))(tls, U64(unsafe.Sizeof(Fts5yyParser{}))) if fts5yypParser != 0 { @@ -163823,7 +166445,7 @@ func sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) uintptr { /* sqli // 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 fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8, fts5yypminor uintptr) { /* sqlite3.c:209893:13: */ +func fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8, fts5yypminor uintptr) { /* sqlite3.c:213079:13: */ var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse _ = pParse @@ -163881,7 +166503,7 @@ func fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8, // // If there is a destructor routine associated with the token which // is popped from the stack, then call it. -func fts5yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:209952:13: */ +func fts5yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:213138:13: */ var fts5yytos uintptr fts5yytos = libc.PostDecUintptr(&(*Fts5yyParser)(unsafe.Pointer(pParser)).Ffts5yytos, 24) @@ -163889,7 +166511,7 @@ func fts5yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:2099 } // Clear all secondary memory allocations from the parser -func sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:209970:13: */ +func sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:213156:13: */ var pParser uintptr = p for (*Fts5yyParser)(unsafe.Pointer(pParser)).Ffts5yytos > pParser+16 /* &.fts5yystack */ { fts5yy_pop_parser_stack(tls, pParser) @@ -163902,7 +166524,7 @@ func sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:209970:1 // If the fts5YYPARSEFREENEVERNULL macro exists (for example because it // is defined in a %include section of the input grammar) then it is // assumed that the input pointer is never NULL. -func sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { /* sqlite3.c:209987:13: */ +func sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { /* sqlite3.c:213173:13: */ if p == uintptr(0) { return } @@ -163926,7 +166548,7 @@ func sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { /* sqli // Find the appropriate action for a parser given the terminal // look-ahead token iLookAhead. -func fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) uint8 { /* sqlite3.c:210050:25: */ +func fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) uint8 { /* sqlite3.c:213236:25: */ var i int32 if int32(stateno) > Fts5YY_MAX_SHIFT { @@ -163950,7 +166572,7 @@ func fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) ui // Find the appropriate action for a parser given the non-terminal // look-ahead token iLookAhead. -func fts5yy_find_reduce_action(tls *libc.TLS, stateno uint8, iLookAhead uint8) uint8 { /* sqlite3.c:210115:25: */ +func fts5yy_find_reduce_action(tls *libc.TLS, stateno uint8, iLookAhead uint8) uint8 { /* sqlite3.c:213301:25: */ var i int32 i = int32(fts5yy_reduce_ofst[stateno]) @@ -163961,7 +166583,7 @@ func fts5yy_find_reduce_action(tls *libc.TLS, stateno uint8, iLookAhead uint8) u } // The following routine is called if the stack overflows. -func fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:210144:13: */ +func fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:213330:13: */ var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse for (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > fts5yypParser+16 /* &.fts5yystack */ { @@ -163971,7 +166593,7 @@ func fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:21 // stack every overflows //******* Begin %stack_overflow code ***************************************** - sqlite3Fts5ParseError(tls, pParse, ts+36258 /* "fts5: parser sta..." */, 0) + sqlite3Fts5ParseError(tls, pParse, ts+36764 /* "fts5: parser sta..." */, 0) //******* End %stack_overflow code ******************************************* (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse // Suppress warning about unused %extra_argument var @@ -163980,7 +166602,7 @@ func fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:21 // Print tracing information for a SHIFT action // Perform a shift action. -func fts5yy_shift(tls *libc.TLS, fts5yypParser uintptr, fts5yyNewState uint8, fts5yyMajor uint8, fts5yyMinor Fts5Token) { /* sqlite3.c:210187:13: */ +func fts5yy_shift(tls *libc.TLS, fts5yypParser uintptr, fts5yyNewState uint8, fts5yyMajor uint8, fts5yyMinor Fts5Token) { /* sqlite3.c:213373:13: */ var fts5yytos uintptr (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos += 24 if (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd { @@ -164029,7 +166651,7 @@ var fts5yyRuleInfoLhs = [28]uint8{ uint8(24), // (25) phrase ::= STRING star_opt uint8(26), // (26) star_opt ::= STAR uint8(26), // (27) star_opt ::= -} /* sqlite3.c:210228:29 */ +} /* sqlite3.c:213414:29 */ // For rule J, fts5yyRuleInfoNRhs[J] contains the negative of the number // of symbols on the right-hand side of that rule. @@ -164062,7 +166684,7 @@ var fts5yyRuleInfoNRhs = [28]int8{ int8(-2), // (25) phrase ::= STRING star_opt int8(-1), // (26) star_opt ::= STAR int8(0), // (27) star_opt ::= -} /* sqlite3.c:210261:26 */ +} /* sqlite3.c:213447:26 */ // Forward Declaration @@ -164074,7 +166696,7 @@ var fts5yyRuleInfoNRhs = [28]int8{ // if the lookahead token has already been consumed. As this procedure is // only called from one place, optimizing compilers will in-line it, which // means that the extra parameters have no performance impact. -func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, fts5yyLookahead int32, fts5yyLookaheadToken Fts5Token) uint8 { /* sqlite3.c:210304:25: */ +func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, fts5yyLookahead int32, fts5yyLookaheadToken Fts5Token) uint8 { /* sqlite3.c:213490:25: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -164087,19 +166709,6 @@ func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, ft _ = fts5yyLookaheadToken fts5yymsp = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos - // Check that the stack is large enough to grow by a single entry - // if the RHS of the rule is empty. This ensures that there is room - // enough on the stack to push the LHS value - if int32(fts5yyRuleInfoNRhs[fts5yyruleno]) == 0 { - if (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos >= (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd { - fts5yyStackOverflow(tls, fts5yypParser) - // The call to fts5yyStackOverflow() above pops the stack until it is - // empty, causing the main parser loop to exit. So the return value - // is never used and does not matter. - return uint8(0) - } - } - switch fts5yyruleno { // Beginning here are the reduction cases. A typical example // follows: @@ -164297,7 +166906,7 @@ func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, ft // The following code executes when the parse fails // The following code executes when a syntax error first occurs. -func fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int32, fts5yyminor Fts5Token) { /* sqlite3.c:210570:13: */ +func fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int32, fts5yyminor Fts5Token) { /* sqlite3.c:213708:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -164307,14 +166916,14 @@ func fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int32 _ = fts5yymajor // Silence a compiler warning sqlite3Fts5ParseError(tls, - pParse, ts+36286 /* "fts5: syntax err..." */, libc.VaList(bp, fts5yyminor.Fn, fts5yyminor.Fp)) + pParse, ts+36792 /* "fts5: syntax err..." */, libc.VaList(bp, fts5yyminor.Fn, fts5yyminor.Fp)) //*********** End %syntax_error code ***************************************** (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse // Suppress warning about unused %extra_argument variable } // The following is executed when the parser accepts -func fts5yy_accept(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:210592:13: */ +func fts5yy_accept(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:213730:13: */ var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse // Here code is inserted which will be executed whenever the @@ -164343,7 +166952,7 @@ func fts5yy_accept(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:210592:1 // // Outputs: // None. -func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yyminor Fts5Token, pParse uintptr) { /* sqlite3.c:210633:13: */ +func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yyminor Fts5Token, pParse uintptr) { /* sqlite3.c:213771:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -164356,12 +166965,22 @@ func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yy fts5yyact = (*Fts5yyStackEntry)(unsafe.Pointer((*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos)).Fstateno - for ok := true; ok; ok = ((*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > fts5yypParser+16 /* &.fts5yystack */) { + for 1 != 0 { // Exit by "break" fts5yyact = fts5yy_find_shift_action(tls, uint8(fts5yymajor), fts5yyact) if int32(fts5yyact) >= Fts5YY_MIN_REDUCE { - fts5yyact = fts5yy_reduce(tls, fts5yypParser, (uint32(int32(fts5yyact) - Fts5YY_MIN_REDUCE)), fts5yymajor, - fts5yyminor) + var fts5yyruleno uint32 = (uint32(int32(fts5yyact) - Fts5YY_MIN_REDUCE)) // Reduce by this rule + + // Check that the stack is large enough to grow by a single entry + // if the RHS of the rule is empty. This ensures that there is room + // enough on the stack to push the LHS value + if int32(fts5yyRuleInfoNRhs[fts5yyruleno]) == 0 { + if (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos >= (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd { + fts5yyStackOverflow(tls, fts5yypParser) + break + } + } + fts5yyact = fts5yy_reduce(tls, fts5yypParser, fts5yyruleno, fts5yymajor, fts5yyminor) } else if int32(fts5yyact) <= Fts5YY_MAX_SHIFTREDUCE { fts5yy_shift(tls, fts5yypParser, fts5yyact, uint8(fts5yymajor), fts5yyminor) break @@ -164388,7 +167007,7 @@ func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yy // Return the fallback token corresponding to canonical token iToken, or // 0 if iToken has no fallback. -func sqlite3Fts5ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:210807:12: */ +func sqlite3Fts5ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:213989:12: */ _ = iToken return 0 } @@ -164451,7 +167070,7 @@ type CInstIter1 = struct { FiStart int32 FiEnd int32 _ [4]byte -} /* sqlite3.c:210853:9 */ +} /* sqlite3.c:214035:9 */ // 2014 May 31 // @@ -164502,11 +167121,11 @@ type CInstIter1 = struct { // printf("instance starts at %d, ends at %d\n", iter.iStart, iter.iEnd); // } // -type CInstIter = CInstIter1 /* sqlite3.c:210853:26 */ +type CInstIter = CInstIter1 /* sqlite3.c:214035:26 */ // Advance the iterator to the next coalesced phrase instance. Return // an SQLite error code if an error occurs, or SQLITE_OK otherwise. -func fts5CInstIterNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:210870:12: */ +func fts5CInstIterNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:214052:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -164545,7 +167164,7 @@ func fts5CInstIterNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:210870 // Initialize the iterator object indicated by the final parameter to // iterate through coalesced phrase instances in column iCol. -func fts5CInstIterInit(tls *libc.TLS, pApi uintptr, pFts uintptr, iCol int32, pIter uintptr) int32 { /* sqlite3.c:210901:12: */ +func fts5CInstIterInit(tls *libc.TLS, pApi uintptr, pFts uintptr, iCol int32, pIter uintptr) int32 { /* sqlite3.c:214083:12: */ var rc int32 libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(CInstIter{}))) @@ -164576,12 +167195,12 @@ type HighlightContext1 = struct { FnIn int32 FiOff int32 FzOut uintptr -} /* sqlite3.c:210927:9 */ +} /* sqlite3.c:214109:9 */ // ************************************************************************ // // Start of highlight() implementation. -type HighlightContext = HighlightContext1 /* sqlite3.c:210927:33 */ +type HighlightContext = HighlightContext1 /* sqlite3.c:214109:33 */ // Append text to the HighlightContext output string - p->zOut. Argument // z points to a buffer containing n bytes of text to append. If n is @@ -164590,7 +167209,7 @@ type HighlightContext = HighlightContext1 /* sqlite3.c:210927:33 */ // If *pRc is set to any value other than SQLITE_OK when this function is // called, it is a no-op. If an error (i.e. an OOM condition) is encountered, // *pRc is set to an error code before returning. -func fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n int32) { /* sqlite3.c:210950:13: */ +func fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n int32) { /* sqlite3.c:214132:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -164598,7 +167217,7 @@ func fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n int if n < 0 { n = int32(libc.Xstrlen(tls, z)) } - (*HighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, ts+36317 /* "%z%.*s" */, libc.VaList(bp, (*HighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*HighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, ts+36823 /* "%z%.*s" */, libc.VaList(bp, (*HighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*HighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = SQLITE_NOMEM } @@ -164606,7 +167225,7 @@ func fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n int } // Tokenizer callback used by implementation of highlight() function. -func fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:210965:12: */ +func fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:214147:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -164661,7 +167280,7 @@ func fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintp } // Implementation of highlight() function. -func fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:211019:13: */ +func fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:214201:13: */ bp := tls.Alloc(100) defer tls.Free(100) @@ -164672,7 +167291,7 @@ func fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintp var iCol int32 if nVal != 3 { - var zErr uintptr = ts + 36324 /* "wrong number of ..." */ + var zErr uintptr = ts + 36830 /* "wrong number of ..." */ Xsqlite3_result_error(tls, pCtx, zErr, -1) return } @@ -164717,19 +167336,19 @@ type Fts5SFinder1 = struct { _ [4]byte FaFirst uintptr FzDoc uintptr -} /* sqlite3.c:211068:9 */ +} /* sqlite3.c:214250:9 */ // // End of highlight() implementation. // // Context object passed to the fts5SentenceFinderCb() function. -type Fts5SFinder = Fts5SFinder1 /* sqlite3.c:211068:28 */ +type Fts5SFinder = Fts5SFinder1 /* sqlite3.c:214250:28 */ // Add an entry to the Fts5SFinder.aFirst[] array. Grow the array if // necessary. Return SQLITE_OK if successful, or SQLITE_NOMEM if an // error occurs. -func fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) int32 { /* sqlite3.c:211082:12: */ +func fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) int32 { /* sqlite3.c:214264:12: */ if (*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc == (*Fts5SFinder)(unsafe.Pointer(p)).FnFirst { var nNew int32 if (*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc != 0 { @@ -164753,7 +167372,7 @@ func fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) int32 { /* sqli // This function is an xTokenize() callback used by the auxiliary snippet() // function. Its job is to identify tokens that are the first in a sentence. // For each such token, an entry is added to the SFinder.aFirst[] array. -func fts5SentenceFinderCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:211101:12: */ +func fts5SentenceFinderCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:214283:12: */ var rc int32 = SQLITE_OK _ = pToken @@ -164782,7 +167401,7 @@ func fts5SentenceFinderCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken return rc } -func fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32, aSeen uintptr, iCol int32, iPos int32, nToken int32, pnScore uintptr, piPos uintptr) int32 { /* sqlite3.c:211134:12: */ +func fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32, aSeen uintptr, iCol int32, iPos int32, nToken int32, pnScore uintptr, piPos uintptr) int32 { /* sqlite3.c:214316:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -164834,7 +167453,7 @@ func fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32, // Return the value in pVal interpreted as utf-8 text. Except, if pVal // contains a NULL value, return a pointer to a static string zero // bytes in length instead of a NULL pointer. -func fts5ValueToText(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:211183:19: */ +func fts5ValueToText(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:214365:19: */ var zRet uintptr = Xsqlite3_value_text(tls, pVal) if zRet != 0 { return zRet @@ -164843,7 +167462,7 @@ func fts5ValueToText(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:211183: } // Implementation of snippet() function. -func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:211191:13: */ +func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:214373:13: */ bp := tls.Alloc(172) defer tls.Free(172) @@ -164866,7 +167485,7 @@ func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr var nCol int32 if nVal != 5 { - var zErr uintptr = ts + 36374 /* "wrong number of ..." */ + var zErr uintptr = ts + 36880 /* "wrong number of ..." */ Xsqlite3_result_error(tls, pCtx, zErr, -1) return } @@ -165038,17 +167657,17 @@ type Fts5Bm25Data1 = struct { Favgdl float64 FaIDF uintptr FaFreq uintptr -} /* sqlite3.c:211349:9 */ +} /* sqlite3.c:214531:9 */ //********************************************************************** // The first time the bm25() function is called for a query, an instance // of the following structure is allocated and populated. -type Fts5Bm25Data = Fts5Bm25Data1 /* sqlite3.c:211349:29 */ +type Fts5Bm25Data = Fts5Bm25Data1 /* sqlite3.c:214531:29 */ // Callback used by fts5Bm25GetData() to count the number of rows in the // table matched by each individual phrase within the query. -func fts5CountCb(tls *libc.TLS, pApi uintptr, pFts uintptr, pUserData uintptr) int32 { /* sqlite3.c:211361:12: */ +func fts5CountCb(tls *libc.TLS, pApi uintptr, pFts uintptr, pUserData uintptr) int32 { /* sqlite3.c:214543:12: */ var pn uintptr = pUserData _ = pApi _ = pFts @@ -165059,7 +167678,7 @@ func fts5CountCb(tls *libc.TLS, pApi uintptr, pFts uintptr, pUserData uintptr) i // Set *ppData to point to the Fts5Bm25Data object for the current query. // If the object has not already been allocated, allocate and populate it // now. -func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) int32 { /* sqlite3.c:211377:12: */ +func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) int32 { /* sqlite3.c:214559:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -165141,14 +167760,14 @@ func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) } // Implementation of bm25() function. -func fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:211450:13: */ +func fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:214632:13: */ bp := tls.Alloc(28) defer tls.Free(28) - var k1 float64 = 1.2 // Constant "k1" from BM25 formula - var b float64 = 0.75 // Constant "b" from BM25 formula - var rc int32 = SQLITE_OK // Error code - var score float64 = 0.0 // SQL function return value + var k1 float64 = 1.2 // Constant "k1" from BM25 formula + var b float64 = 0.75 // Constant "b" from BM25 formula + var rc int32 // Error code + var score float64 = 0.0 // SQL function return value // var pData uintptr at bp, 8 // Values allocated/calculated once only var i int32 // Iterator variable @@ -165191,32 +167810,30 @@ func fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, n D = float64(*(*int32)(unsafe.Pointer(bp + 24 /* nTok */))) } - // Determine the BM25 score for the current row. - for i = 0; (rc == SQLITE_OK) && (i < (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FnPhrase); i++ { - score = score + (*(*float64)(unsafe.Pointer((*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FaIDF + uintptr(i)*8)) * ((*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + 1.0)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + (k1 * ((float64(1) - b) + ((b * D) / (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).Favgdl)))))) - } - - // If no error has occurred, return the calculated score. Otherwise, - // throw an SQL exception. + // Determine and return the BM25 score for the current row. Or, if an + // error has occurred, throw an exception. if rc == SQLITE_OK { + for i = 0; i < (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FnPhrase; i++ { + score = score + (*(*float64)(unsafe.Pointer((*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FaIDF + uintptr(i)*8)) * ((*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + 1.0)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + (k1 * ((float64(1) - b) + ((b * D) / (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).Favgdl)))))) + } Xsqlite3_result_double(tls, pCtx, (-1.0 * score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } } -func sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:211508:12: */ +func sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:214688:12: */ bp := tls.Alloc(96) defer tls.Free(96) *(*[3]Builtin)(unsafe.Pointer(bp /* aBuiltin */)) = [3]Builtin{ - {FzFunc: ts + 36422 /* "snippet" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct { + {FzFunc: ts + 36928 /* "snippet" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) }{fts5SnippetFunction}))}, - {FzFunc: ts + 36430 /* "highlight" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct { + {FzFunc: ts + 36936 /* "highlight" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) }{fts5HighlightFunction}))}, - {FzFunc: ts + 36440 /* "bm25" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct { + {FzFunc: ts + 36946 /* "bm25" */, FxFunc: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) }{fts5Bm25Function}))}, } @@ -165239,7 +167856,7 @@ type Builtin = struct { FpUserData uintptr FxFunc Fts5_extension_function FxDestroy uintptr -} /* sqlite3.c:211509:3 */ +} /* sqlite3.c:214689:3 */ // 2014 May 31 // @@ -165254,7 +167871,7 @@ type Builtin = struct { // #include "fts5Int.h" -func sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte U32) int32 { /* sqlite3.c:211551:12: */ +func sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte U32) int32 { /* sqlite3.c:214731:12: */ if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) < nByte { var nNew U64 if (*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace != 0 { @@ -165280,7 +167897,7 @@ func sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte U32) // Encode value iVal as an SQLite varint and append it to the buffer object // pBuf. If an OOM error occurs, set the error code in p. -func sqlite3Fts5BufferAppendVarint(tls *libc.TLS, pRc uintptr, pBuf uintptr, iVal I64) { /* sqlite3.c:211575:13: */ +func sqlite3Fts5BufferAppendVarint(tls *libc.TLS, pRc uintptr, pBuf uintptr, iVal I64) { /* sqlite3.c:214755:13: */ if func() int32 { if ((U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + (U32(9))) <= (U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)) { return 0 @@ -165292,21 +167909,21 @@ func sqlite3Fts5BufferAppendVarint(tls *libc.TLS, pRc uintptr, pBuf uintptr, iVa *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), uint64(iVal))) } -func sqlite3Fts5Put32(tls *libc.TLS, aBuf uintptr, iVal int32) { /* sqlite3.c:211580:13: */ +func sqlite3Fts5Put32(tls *libc.TLS, aBuf uintptr, iVal int32) { /* sqlite3.c:214760:13: */ *(*U8)(unsafe.Pointer(aBuf)) = (U8((iVal >> 24) & 0x00FF)) *(*U8)(unsafe.Pointer(aBuf + 1)) = (U8((iVal >> 16) & 0x00FF)) *(*U8)(unsafe.Pointer(aBuf + 2)) = (U8((iVal >> 8) & 0x00FF)) *(*U8)(unsafe.Pointer(aBuf + 3)) = (U8((iVal >> 0) & 0x00FF)) } -func sqlite3Fts5Get32(tls *libc.TLS, aBuf uintptr) int32 { /* sqlite3.c:211587:12: */ +func sqlite3Fts5Get32(tls *libc.TLS, aBuf uintptr) int32 { /* sqlite3.c:214767:12: */ return (int32(((((U32(*(*U8)(unsafe.Pointer(aBuf)))) << 24) + (U32(int32(*(*U8)(unsafe.Pointer(aBuf + 1))) << 16))) + (U32(int32(*(*U8)(unsafe.Pointer(aBuf + 2))) << 8))) + U32(*(*U8)(unsafe.Pointer(aBuf + 3))))) } // Append buffer nData/pData to buffer pBuf. If an OOM error occurs, set // the error code in p. If an error has already occurred when this function // is called, it is a no-op. -func sqlite3Fts5BufferAppendBlob(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData U32, pData uintptr) { /* sqlite3.c:211596:13: */ +func sqlite3Fts5BufferAppendBlob(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData U32, pData uintptr) { /* sqlite3.c:214776:13: */ if nData != 0 { if func() int32 { @@ -165325,7 +167942,7 @@ func sqlite3Fts5BufferAppendBlob(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData // Append the nul-terminated string zStr to the buffer pBuf. This function // ensures that the byte following the buffer data is set to 0x00, even // though this byte is not included in the pBuf->n count. -func sqlite3Fts5BufferAppendString(tls *libc.TLS, pRc uintptr, pBuf uintptr, zStr uintptr) { /* sqlite3.c:211615:13: */ +func sqlite3Fts5BufferAppendString(tls *libc.TLS, pRc uintptr, pBuf uintptr, zStr uintptr) { /* sqlite3.c:214795:13: */ var nStr int32 = int32(libc.Xstrlen(tls, zStr)) sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, (uint32(nStr + 1)), zStr) (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn-- @@ -165337,7 +167954,7 @@ func sqlite3Fts5BufferAppendString(tls *libc.TLS, pRc uintptr, pBuf uintptr, zSt // Like sqlite3Fts5BufferAppendString(), this function ensures that the byte // following the buffer data is set to 0x00, even though this byte is not // included in the pBuf->n count. -func sqlite3Fts5BufferAppendPrintf(tls *libc.TLS, pRc uintptr, pBuf uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:211633:13: */ +func sqlite3Fts5BufferAppendPrintf(tls *libc.TLS, pRc uintptr, pBuf uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:214813:13: */ if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { var zTmp uintptr var ap Va_list @@ -165355,7 +167972,7 @@ func sqlite3Fts5BufferAppendPrintf(tls *libc.TLS, pRc uintptr, pBuf uintptr, zFm } } -func sqlite3Fts5Mprintf(tls *libc.TLS, pRc uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:211654:13: */ +func sqlite3Fts5Mprintf(tls *libc.TLS, pRc uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:214834:13: */ var zRet uintptr = uintptr(0) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { var ap Va_list @@ -165371,26 +167988,26 @@ func sqlite3Fts5Mprintf(tls *libc.TLS, pRc uintptr, zFmt uintptr, va uintptr) ui } // Free any buffer allocated by pBuf. Zero the structure before returning. -func sqlite3Fts5BufferFree(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:211672:13: */ +func sqlite3Fts5BufferFree(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:214852:13: */ Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp) libc.Xmemset(tls, pBuf, 0, uint64(unsafe.Sizeof(Fts5Buffer{}))) } // Zero the contents of the buffer object. But do not free the associated // memory allocation. -func sqlite3Fts5BufferZero(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:211681:13: */ +func sqlite3Fts5BufferZero(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:214861:13: */ (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0 } // Set the buffer to contain nData/pData. If an OOM error occurs, leave an // the error code in p. If an error has already occurred when this function // is called, it is a no-op. -func sqlite3Fts5BufferSet(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData int32, pData uintptr) { /* sqlite3.c:211690:13: */ +func sqlite3Fts5BufferSet(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData int32, pData uintptr) { /* sqlite3.c:214870:13: */ (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0 sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(nData), pData) } -func sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piOff uintptr) int32 { /* sqlite3.c:211700:12: */ +func sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piOff uintptr) int32 { /* sqlite3.c:214880:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -165448,14 +168065,14 @@ func sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piO // Advance the iterator object passed as the only argument. Return true // if the iterator reaches EOF, or false otherwise. -func sqlite3Fts5PoslistReaderNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:211739:12: */ +func sqlite3Fts5PoslistReaderNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:214919:12: */ if sqlite3Fts5PoslistNext64(tls, (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fa, (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fn, (pIter+12 /* &.i */), (pIter+24 /* &.iPos */)) != 0 { (*Fts5PoslistReader)(unsafe.Pointer(pIter)).FbEof = U8(1) } return int32((*Fts5PoslistReader)(unsafe.Pointer(pIter)).FbEof) } -func sqlite3Fts5PoslistReaderInit(tls *libc.TLS, a uintptr, n int32, pIter uintptr) int32 { /* sqlite3.c:211746:12: */ +func sqlite3Fts5PoslistReaderInit(tls *libc.TLS, a uintptr, n int32, pIter uintptr) int32 { /* sqlite3.c:214926:12: */ libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5PoslistReader{}))) (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fa = a (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fn = n @@ -165467,7 +168084,7 @@ func sqlite3Fts5PoslistReaderInit(tls *libc.TLS, a uintptr, n int32, pIter uintp // pBuf, which must be already be large enough to hold the new data. // The previous position written to this list is *piPrev. *piPrev is set // to iPos before returning. -func sqlite3Fts5PoslistSafeAppend(tls *libc.TLS, pBuf uintptr, piPrev uintptr, iPos I64) { /* sqlite3.c:211763:13: */ +func sqlite3Fts5PoslistSafeAppend(tls *libc.TLS, pBuf uintptr, piPrev uintptr, iPos I64) { /* sqlite3.c:214943:13: */ if (iPos & colmask) != (*(*I64)(unsafe.Pointer(piPrev)) & colmask) { *(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(libc.PostIncInt32(&(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn, 1)))) = U8(1) *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), (uint64(iPos >> 32)))) @@ -165477,9 +168094,9 @@ func sqlite3Fts5PoslistSafeAppend(tls *libc.TLS, pBuf uintptr, piPrev uintptr, i *(*I64)(unsafe.Pointer(piPrev)) = iPos } -var colmask I64 = (I64((int64(0x7FFFFFFF))) << 32) /* sqlite3.c:211768:20 */ +var colmask I64 = (I64((int64(0x7FFFFFFF))) << 32) /* sqlite3.c:214948:20 */ -func sqlite3Fts5PoslistWriterAppend(tls *libc.TLS, pBuf uintptr, pWriter uintptr, iPos I64) int32 { /* sqlite3.c:211778:12: */ +func sqlite3Fts5PoslistWriterAppend(tls *libc.TLS, pBuf uintptr, pWriter uintptr, iPos I64) int32 { /* sqlite3.c:214958:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -165496,7 +168113,7 @@ func sqlite3Fts5PoslistWriterAppend(tls *libc.TLS, pBuf uintptr, pWriter uintptr return SQLITE_OK } -func sqlite3Fts5MallocZero(tls *libc.TLS, pRc uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:211789:13: */ +func sqlite3Fts5MallocZero(tls *libc.TLS, pRc uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:214969:13: */ var pRet uintptr = uintptr(0) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { pRet = Xsqlite3_malloc64(tls, uint64(nByte)) @@ -165517,7 +168134,7 @@ func sqlite3Fts5MallocZero(tls *libc.TLS, pRc uintptr, nByte Sqlite3_int64) uint // // It is the responsibility of the caller to eventually free the returned // buffer using sqlite3_free(). If an OOM error occurs, NULL is returned. -func sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) uintptr { /* sqlite3.c:211810:13: */ +func sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) uintptr { /* sqlite3.c:214990:13: */ var zRet uintptr = uintptr(0) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { if nIn < 0 { @@ -165542,7 +168159,7 @@ func sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) uint // * The 10 integer ASCII characters. // * The underscore character "_" (0x5F). // * The unicode "subsitute" character (0x1A). -func sqlite3Fts5IsBareword(tls *libc.TLS, t int8) int32 { /* sqlite3.c:211838:12: */ +func sqlite3Fts5IsBareword(tls *libc.TLS, t int8) int32 { /* sqlite3.c:215018:12: */ bp := tls.Alloc(128) defer tls.Free(128) @@ -165567,13 +168184,13 @@ type Fts5TermsetEntry1 = struct { FnTerm int32 FiIdx int32 FpNext uintptr -} /* sqlite3.c:208835:9 */ +} /* sqlite3.c:211994:9 */ // ************************************************************************ // -type Fts5TermsetEntry = Fts5TermsetEntry1 /* sqlite3.c:211856:33 */ +type Fts5TermsetEntry = Fts5TermsetEntry1 /* sqlite3.c:215036:33 */ -func sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) int32 { /* sqlite3.c:211868:12: */ +func sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) int32 { /* sqlite3.c:215048:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -165582,7 +168199,7 @@ func sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) int32 { /* sqlite3.c:21186 return *(*int32)(unsafe.Pointer(bp /* rc */)) } -func sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr, nTerm int32, pbPresent uintptr) int32 { /* sqlite3.c:211874:12: */ +func sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr, nTerm int32, pbPresent uintptr) int32 { /* sqlite3.c:215054:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -165628,7 +168245,7 @@ func sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr, return *(*int32)(unsafe.Pointer(bp /* rc */)) } -func sqlite3Fts5TermsetFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:211923:13: */ +func sqlite3Fts5TermsetFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:215103:13: */ if p != 0 { var i U32 for i = U32(0); i < (U32((int32(uint64(unsafe.Sizeof([512]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0))))))); i++ { @@ -165660,18 +168277,18 @@ func sqlite3Fts5TermsetFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:211923:13: // Maximum allowed page size -func fts5_iswhitespace(tls *libc.TLS, x int8) int32 { /* sqlite3.c:211965:12: */ +func fts5_iswhitespace(tls *libc.TLS, x int8) int32 { /* sqlite3.c:215145:12: */ return (libc.Bool32(int32(x) == ' ')) } -func fts5_isopenquote(tls *libc.TLS, x int8) int32 { /* sqlite3.c:211969:12: */ +func fts5_isopenquote(tls *libc.TLS, x int8) int32 { /* sqlite3.c:215149:12: */ return (libc.Bool32((((int32(x) == '"') || (int32(x) == '\'')) || (int32(x) == '[')) || (int32(x) == '`'))) } // Argument pIn points to a character that is part of a nul-terminated // string. Return a pointer to the first character following *pIn in // the string that is not a white-space character. -func fts5ConfigSkipWhitespace(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:211978:19: */ +func fts5ConfigSkipWhitespace(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:215158:19: */ var p uintptr = pIn if p != 0 { for fts5_iswhitespace(tls, *(*int8)(unsafe.Pointer(p))) != 0 { @@ -165684,7 +168301,7 @@ func fts5ConfigSkipWhitespace(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c // Argument pIn points to a character that is part of a nul-terminated // string. Return a pointer to the first character following *pIn in // the string that is not a "bareword" character. -func fts5ConfigSkipBareword(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:211991:19: */ +func fts5ConfigSkipBareword(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:215171:19: */ var p uintptr = pIn for sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(p))) != 0 { p++ @@ -165695,17 +168312,17 @@ func fts5ConfigSkipBareword(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:2 return p } -func fts5_isdigit(tls *libc.TLS, a int8) int32 { /* sqlite3.c:211998:12: */ +func fts5_isdigit(tls *libc.TLS, a int8) int32 { /* sqlite3.c:215178:12: */ return (libc.Bool32((int32(a) >= '0') && (int32(a) <= '9'))) } -func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:212004:19: */ +func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:215184:19: */ var p uintptr = pIn switch int32(*(*int8)(unsafe.Pointer(p))) { case 'n': fallthrough case 'N': - if Xsqlite3_strnicmp(tls, ts+7843 /* "null" */, p, 4) == 0 { + if Xsqlite3_strnicmp(tls, ts+7936 /* "null" */, p, 4) == 0 { p = (p + 4) } else { p = uintptr(0) @@ -165788,7 +168405,7 @@ func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:21 // the character immediately following it. Or, if the close-quote is not // found, -1 is returned. If -1 is returned, the buffer is left in an // undefined state. -func fts5Dequote(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:212080:12: */ +func fts5Dequote(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:215260:12: */ var q int8 var iIn int32 = 1 var iOut int32 = 0 @@ -165833,7 +168450,7 @@ func fts5Dequote(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:212080:12: */ // 'xyz' becomes xyz // [pqr] becomes pqr // `mno` becomes mno -func sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:212125:13: */ +func sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:215305:13: */ var quote int8 // Quote character (if any ) quote = *(*int8)(unsafe.Pointer(z)) @@ -165846,11 +168463,11 @@ type Fts5Enum1 = struct { FzName uintptr FeVal int32 _ [4]byte -} /* sqlite3.c:212136:1 */ +} /* sqlite3.c:215316:1 */ -type Fts5Enum = Fts5Enum1 /* sqlite3.c:212140:25 */ +type Fts5Enum = Fts5Enum1 /* sqlite3.c:215320:25 */ -func fts5ConfigSetEnum(tls *libc.TLS, aEnum uintptr, zEnum uintptr, peVal uintptr) int32 { /* sqlite3.c:212142:12: */ +func fts5ConfigSetEnum(tls *libc.TLS, aEnum uintptr, zEnum uintptr, peVal uintptr) int32 { /* sqlite3.c:215322:12: */ var nEnum int32 = int32(libc.Xstrlen(tls, zEnum)) var i int32 var iVal int32 = -1 @@ -165878,14 +168495,14 @@ func fts5ConfigSetEnum(tls *libc.TLS, aEnum uintptr, zEnum uintptr, peVal uintpt // an error occurs, an SQLite error code is returned and an error message // may be left in *pzErr. It is the responsibility of the caller to // eventually free any such error message using sqlite3_free(). -func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCmd uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:212171:12: */ +func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCmd uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:215351:12: */ bp := tls.Alloc(112) defer tls.Free(112) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_OK var nCmd int32 = int32(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, ts+36445 /* "prefix" */, zCmd, nCmd) == 0 { - var nByte int32 = (int32(uint64(unsafe.Sizeof(int32(0))) * FTS5_MAX_PREFIX_INDEXES)) + if Xsqlite3_strnicmp(tls, ts+36951 /* "prefix" */, zCmd, nCmd) == 0 { + var nByte int32 = (int32(uint64(unsafe.Sizeof(int32(0))) * uint64(FTS5_MAX_PREFIX_INDEXES))) var p uintptr var bFirst int32 = 1 if (*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -165911,14 +168528,14 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm break } if (int32(*(*int8)(unsafe.Pointer(p))) < '0') || (int32(*(*int8)(unsafe.Pointer(p))) > '9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36452 /* "malformed prefix..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36958 /* "malformed prefix..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR break } if (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix == FTS5_MAX_PREFIX_INDEXES { *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, - ts+36483 /* "too many prefix ..." */, libc.VaList(bp, FTS5_MAX_PREFIX_INDEXES)) + ts+36989 /* "too many prefix ..." */, libc.VaList(bp, FTS5_MAX_PREFIX_INDEXES)) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR break } @@ -165929,7 +168546,7 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm } if (nPre <= 0) || (nPre >= 1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36516 /* "prefix length ou..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37022 /* "prefix length ou..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR break } @@ -165942,7 +168559,7 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } - if Xsqlite3_strnicmp(tls, ts+36553 /* "tokenize" */, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, ts+37059 /* "tokenize" */, zCmd, nCmd) == 0 { var p uintptr = zArg var nArg Sqlite3_int64 = (Sqlite3_int64(libc.Xstrlen(tls, zArg) + uint64(1))) var azArg uintptr = sqlite3Fts5MallocZero(tls, bp+40 /* &rc */, (int64(uint64(unsafe.Sizeof(uintptr(0))) * uint64(nArg)))) @@ -165951,7 +168568,7 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm if (azArg != 0) && (pSpace != 0) { if (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36562 /* "multiple tokeniz..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37068 /* "multiple tokeniz..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else { for nArg = int64(0); (p != 0) && (*(*int8)(unsafe.Pointer(p)) != 0); nArg++ { @@ -165970,11 +168587,11 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm } } if p == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36595 /* "parse error in t..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37101 /* "parse error in t..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else { *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = sqlite3Fts5GetTokenizer(tls, pGlobal, - azArg, int32(nArg), (pConfig + 104 /* &.pTok */), (pConfig + 112 /* &.pTokApi */), + azArg, int32(nArg), pConfig, pzErr) } } @@ -165985,14 +168602,14 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } - if Xsqlite3_strnicmp(tls, ts+36629 /* "content" */, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, ts+37135 /* "content" */, zCmd, nCmd) == 0 { if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36637 /* "multiple content..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37143 /* "multiple content..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else { if *(*int8)(unsafe.Pointer(zArg)) != 0 { (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent = FTS5_CONTENT_EXTERNAL - (*Fts5Config)(unsafe.Pointer(pConfig)).FzContent = sqlite3Fts5Mprintf(tls, bp+40 /* &rc */, ts+36669 /* "%Q.%Q" */, libc.VaList(bp+8, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*Fts5Config)(unsafe.Pointer(pConfig)).FzContent = sqlite3Fts5Mprintf(tls, bp+40 /* &rc */, ts+37175 /* "%Q.%Q" */, libc.VaList(bp+8, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent = FTS5_CONTENT_NONE } @@ -166000,9 +168617,9 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } - if Xsqlite3_strnicmp(tls, ts+36675 /* "content_rowid" */, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, ts+37181 /* "content_rowid" */, zCmd, nCmd) == 0 { if (*Fts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36689 /* "multiple content..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37195 /* "multiple content..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else { (*Fts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, zArg, -1) @@ -166010,9 +168627,9 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } - if Xsqlite3_strnicmp(tls, ts+36727 /* "columnsize" */, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, ts+37233 /* "columnsize" */, zCmd, nCmd) == 0 { if ((int32(*(*int8)(unsafe.Pointer(zArg))) != '0') && (int32(*(*int8)(unsafe.Pointer(zArg))) != '1')) || (int32(*(*int8)(unsafe.Pointer(zArg + 1))) != 0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36738 /* "malformed column..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37244 /* "malformed column..." */, 0) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else { (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(zArg))) == '1')) @@ -166020,31 +168637,30 @@ func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCm return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } - if Xsqlite3_strnicmp(tls, ts+6791 /* "detail" */, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, ts+6867 /* "detail" */, zCmd, nCmd) == 0 { *(*[4]Fts5Enum)(unsafe.Pointer(bp + 48 /* aDetail */)) = [4]Fts5Enum{ - {FzName: ts + 18368 /* "none" */, FeVal: FTS5_DETAIL_NONE}, - {FzName: ts + 18373 /* "full" */}, - {FzName: ts + 36773 /* "columns" */, FeVal: FTS5_DETAIL_COLUMNS}, + {FzName: ts + 18793 /* "none" */, FeVal: FTS5_DETAIL_NONE}, + {FzName: ts + 18798 /* "full" */}, + {FzName: ts + 37279 /* "columns" */, FeVal: FTS5_DETAIL_COLUMNS}, {}, } if libc.AssignPtrInt32(bp+40 /* rc */, fts5ConfigSetEnum(tls, bp+48 /* &aDetail[0] */, zArg, (pConfig+92 /* &.eDetail */))) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36781 /* "malformed detail..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37287 /* "malformed detail..." */, 0) } return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36812 /* "unrecognized opt..." */, libc.VaList(bp+24, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37318 /* "unrecognized opt..." */, libc.VaList(bp+24, nCmd, zCmd)) return SQLITE_ERROR } // Allocate an instance of the default tokenizer ("simple") at // Fts5Config.pTokenizer. Return SQLITE_OK if successful, or an SQLite error // code if an error occurs. -func fts5ConfigDefaultTokenizer(tls *libc.TLS, pGlobal uintptr, pConfig uintptr) int32 { /* sqlite3.c:212335:12: */ +func fts5ConfigDefaultTokenizer(tls *libc.TLS, pGlobal uintptr, pConfig uintptr) int32 { /* sqlite3.c:215515:12: */ - return sqlite3Fts5GetTokenizer(tls, - pGlobal, uintptr(0), 0, (pConfig + 104 /* &.pTok */), (pConfig + 112 /* &.pTokApi */), uintptr(0)) + return sqlite3Fts5GetTokenizer(tls, pGlobal, uintptr(0), 0, pConfig, uintptr(0)) } // Gobble up the first bareword or quoted word from the input buffer zIn. @@ -166060,7 +168676,7 @@ func fts5ConfigDefaultTokenizer(tls *libc.TLS, pGlobal uintptr, pConfig uintptr) // a no-op (NULL is returned). Otherwise, if an OOM occurs within this // function, *pRc is set to SQLITE_NOMEM before returning. *pRc is *not* // set if a parse error (failed to find close quote) occurs. -func fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintptr, pbQuoted uintptr) uintptr { /* sqlite3.c:212357:19: */ +func fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintptr, pbQuoted uintptr) uintptr { /* sqlite3.c:215535:19: */ var zRet uintptr = uintptr(0) var nIn Sqlite3_int64 = Sqlite3_int64(libc.Xstrlen(tls, zIn)) @@ -166094,20 +168710,20 @@ func fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintptr return zRet } -func fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:212397:12: */ +func fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:215575:12: */ bp := tls.Alloc(16) defer tls.Free(16) var rc int32 = SQLITE_OK - if (0 == Xsqlite3_stricmp(tls, zCol, ts+23877 /* "rank" */)) || - (0 == Xsqlite3_stricmp(tls, zCol, ts+10064 /* "rowid" */)) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36840 /* "reserved fts5 co..." */, libc.VaList(bp, zCol)) + if (0 == Xsqlite3_stricmp(tls, zCol, ts+24335 /* "rank" */)) || + (0 == Xsqlite3_stricmp(tls, zCol, ts+10157 /* "rowid" */)) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37346 /* "reserved fts5 co..." */, libc.VaList(bp, zCol)) rc = SQLITE_ERROR } else if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, ts+36870 /* "unindexed" */) { + if 0 == Xsqlite3_stricmp(tls, zArg, ts+37376 /* "unindexed" */) { *(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*Fts5Config)(unsafe.Pointer(p)).FnCol))) = U8(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36880 /* "unrecognized col..." */, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37386 /* "unrecognized col..." */, libc.VaList(bp+8, zArg)) rc = SQLITE_ERROR } } @@ -166117,7 +168733,7 @@ func fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr, } // Populate the Fts5Config.zContentExprlist string. -func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:212425:12: */ +func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:215603:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -166125,13 +168741,13 @@ func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:21242 *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = SQLITE_OK *(*Fts5Buffer)(unsafe.Pointer(bp + 32 /* buf */)) = Fts5Buffer{} - sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+36911 /* "T.%Q" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(p)).FzContentRowid)) + sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+37417 /* "T.%Q" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*Fts5Config)(unsafe.Pointer(p)).FeContent != FTS5_CONTENT_NONE { for i = 0; i < (*Fts5Config)(unsafe.Pointer(p)).FnCol; i++ { if (*Fts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_EXTERNAL { - sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+36916 /* ", T.%Q" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+37422 /* ", T.%Q" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { - sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+36923 /* ", T.c%d" */, libc.VaList(bp+16, i)) + sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+37429 /* ", T.c%d" */, libc.VaList(bp+16, i)) } } } @@ -166150,7 +168766,7 @@ func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:21242 // returned, *ppOut is set to NULL and an error message may be left in // *pzErr. It is the responsibility of the caller to eventually free any // such error message using sqlite3_free(). -func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int32, azArg uintptr, ppOut uintptr, pzErr uintptr) int32 { /* sqlite3.c:212458:12: */ +func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int32, azArg uintptr, ppOut uintptr, pzErr uintptr) int32 { /* sqlite3.c:215636:12: */ bp := tls.Alloc(76) defer tls.Free(76) @@ -166174,8 +168790,8 @@ func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int (*Fts5Config)(unsafe.Pointer(pRet)).FzName = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -1) (*Fts5Config)(unsafe.Pointer(pRet)).FbColumnsize = 1 (*Fts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && (Xsqlite3_stricmp(tls, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, ts+23877 /* "rank" */) == 0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36931 /* "reserved fts5 ta..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pRet)).FzName)) + if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && (Xsqlite3_stricmp(tls, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, ts+24335 /* "rank" */) == 0) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37437 /* "reserved fts5 ta..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } @@ -166208,7 +168824,7 @@ func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36960 /* "parse error in \"..." */, libc.VaList(bp+8, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+37466 /* "parse error in \"..." */, libc.VaList(bp+8, zOrig)) *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = SQLITE_ERROR } else { if bOption != 0 { @@ -166241,19 +168857,19 @@ func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int var zTail uintptr = uintptr(0) if (*Fts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = ts + 36629 /* "content" */ + zTail = ts + 37135 /* "content" */ } else if (*Fts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = ts + 36980 /* "docsize" */ + zTail = ts + 37486 /* "docsize" */ } if zTail != 0 { (*Fts5Config)(unsafe.Pointer(pRet)).FzContent = sqlite3Fts5Mprintf(tls, - bp+40 /* &rc */, ts+36988 /* "%Q.'%q_%s'" */, libc.VaList(bp+16, (*Fts5Config)(unsafe.Pointer(pRet)).FzDb, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + bp+40 /* &rc */, ts+37494 /* "%Q.'%q_%s'" */, libc.VaList(bp+16, (*Fts5Config)(unsafe.Pointer(pRet)).FzDb, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0)) { - (*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, ts+10064 /* "rowid" */, -1) + (*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, ts+10157 /* "rowid" */, -1) } // Formulate the zContentExprlist text @@ -166269,7 +168885,7 @@ func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int } // Free the configuration object passed as the only argument. -func sqlite3Fts5ConfigFree(tls *libc.TLS, pConfig uintptr) { /* sqlite3.c:212577:13: */ +func sqlite3Fts5ConfigFree(tls *libc.TLS, pConfig uintptr) { /* sqlite3.c:215755:13: */ if pConfig != 0 { var i int32 if (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok != 0 { @@ -166294,7 +168910,7 @@ func sqlite3Fts5ConfigFree(tls *libc.TLS, pConfig uintptr) { /* sqlite3.c:212577 // Call sqlite3_declare_vtab() based on the contents of the configuration // object passed as the only argument. Return SQLITE_OK if successful, or // an SQLite error code if an error occurs. -func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:212604:12: */ +func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:215782:12: */ bp := tls.Alloc(52) defer tls.Free(52) @@ -166302,18 +168918,18 @@ func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 { /* sql *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = SQLITE_OK var zSql uintptr - zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+36999 /* "CREATE TABLE x(" */, 0) + zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+37505 /* "CREATE TABLE x(" */, 0) for i = 0; (zSql != 0) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ { var zSep uintptr = func() uintptr { if i == 0 { return ts + 800 /* "" */ } - return ts + 15696 /* ", " */ + return ts + 16160 /* ", " */ }() - zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+37015 /* "%z%s%Q" */, libc.VaList(bp, zSql, zSep, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+37521 /* "%z%s%Q" */, libc.VaList(bp, zSql, zSep, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) } - zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+37022, /* "%z, %Q HIDDEN, %..." */ - libc.VaList(bp+24, zSql, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, ts+23877 /* "rank" */)) + zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+37528, /* "%z, %Q HIDDEN, %..." */ + libc.VaList(bp+24, zSql, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, ts+24335 /* "rank" */)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3_declare_vtab(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) @@ -166344,7 +168960,7 @@ func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 { /* sql // still returns SQLITE_OK. Or, if the tokenization was abandoned early // because the callback returned another non-zero value, it is assumed // to be an SQLite error code and returned to the caller. -func sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) int32 { /* sqlite3.c:212650:12: */ +func sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) int32 { /* sqlite3.c:215828:12: */ if pText == uintptr(0) { return SQLITE_OK } @@ -166356,7 +168972,7 @@ func sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uint // a comma-separated list of SQL literals followed by a ')' character. // If it actually is this, return a pointer to the ')'. Otherwise, return // NULL to indicate a parse error. -func fts5ConfigSkipArgs(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:212669:19: */ +func fts5ConfigSkipArgs(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:215847:19: */ var p uintptr = pIn for 1 != 0 { @@ -166383,7 +168999,7 @@ func fts5ConfigSkipArgs(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:21266 // + Open parenthesis - "(" // + Zero or more SQL literals in a comma separated list // + Close parenthesis - ")" -func sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzRankArgs uintptr) int32 { /* sqlite3.c:212696:12: */ +func sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzRankArgs uintptr) int32 { /* sqlite3.c:215874:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -166447,13 +169063,13 @@ func sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzRa return *(*int32)(unsafe.Pointer(bp /* rc */)) } -func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVal uintptr, pbBadkey uintptr) int32 { /* sqlite3.c:212755:12: */ +func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVal uintptr, pbBadkey uintptr) int32 { /* sqlite3.c:215933:12: */ bp := tls.Alloc(16) defer tls.Free(16) var rc int32 = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, ts+37048 /* "pgsz" */) { + if 0 == Xsqlite3_stricmp(tls, zKey, ts+37554 /* "pgsz" */) { var pgsz int32 = 0 if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -166463,7 +169079,7 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa } else { (*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } - } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+37053 /* "hashsize" */) { + } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+37559 /* "hashsize" */) { var nHashSize int32 = -1 if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -166473,7 +169089,7 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa } else { (*Fts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } - } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+37062 /* "automerge" */) { + } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+37568 /* "automerge" */) { var nAutomerge int32 = -1 if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -166486,7 +169102,7 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa } (*Fts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } - } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+37072 /* "usermerge" */) { + } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+37578 /* "usermerge" */) { var nUsermerge int32 = -1 if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -166496,7 +169112,7 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa } else { (*Fts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } - } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+37082 /* "crisismerge" */) { + } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+37588 /* "crisismerge" */) { var nCrisisMerge int32 = -1 if SQLITE_INTEGER == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -166512,7 +169128,7 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa } (*Fts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } - } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+23877 /* "rank" */) { + } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+24335 /* "rank" */) { var zIn uintptr = Xsqlite3_value_text(tls, pVal) // var zRank uintptr at bp, 8 @@ -166535,11 +169151,11 @@ func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVa } // Load the contents of the %_config table into memory. -func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32 { /* sqlite3.c:212849:12: */ +func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32 { /* sqlite3.c:216027:12: */ bp := tls.Alloc(52) defer tls.Free(52) - var zSelect uintptr = ts + 37094 /* "SELECT k, v FROM..." */ + var zSelect uintptr = ts + 37600 /* "SELECT k, v FROM..." */ var zSql uintptr *(*uintptr)(unsafe.Pointer(bp + 40 /* p */)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = SQLITE_OK @@ -166562,7 +169178,7 @@ func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32 for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* p */))) { var zK uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* p */)), 0) var pVal uintptr = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* p */)), 1) - if 0 == Xsqlite3_stricmp(tls, zK, ts+37126 /* "version" */) { + if 0 == Xsqlite3_stricmp(tls, zK, ts+37632 /* "version" */) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 48 /* bDummy */)) = 0 @@ -166577,7 +169193,7 @@ func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32 if (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg != 0 { *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, - ts+37134, /* "invalid fts5 fil..." */ + ts+37640, /* "invalid fts5 fil..." */ libc.VaList(bp+16, iVersion, FTS5_CURRENT_VERSION)) } } @@ -166612,7 +169228,7 @@ type Fts5ExprTerm1 = struct { FzTerm uintptr FpIter uintptr FpSynonym uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // 2014 May 31 // @@ -166631,9 +169247,9 @@ type Fts5ExprTerm1 = struct { // All token types in the generated fts5parse.h file are greater than 0. -type Fts5ExprTerm = Fts5ExprTerm1 /* sqlite3.c:212927:29 */ +type Fts5ExprTerm = Fts5ExprTerm1 /* sqlite3.c:216105:29 */ -func sqlite3Fts5ParseError(tls *libc.TLS, pParse uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:213033:13: */ +func sqlite3Fts5ParseError(tls *libc.TLS, pParse uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:216212:13: */ var ap Va_list _ = ap ap = va @@ -166644,12 +169260,12 @@ func sqlite3Fts5ParseError(tls *libc.TLS, pParse uintptr, zFmt uintptr, va uintp _ = ap } -func fts5ExprIsspace(tls *libc.TLS, t int8) int32 { /* sqlite3.c:213043:12: */ +func fts5ExprIsspace(tls *libc.TLS, t int8) int32 { /* sqlite3.c:216222:12: */ return (libc.Bool32((((int32(t) == ' ') || (int32(t) == '\t')) || (int32(t) == '\n')) || (int32(t) == '\r'))) } // Read the first token from the nul-terminated string at *pz. -func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) int32 { /* sqlite3.c:213050:12: */ +func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) int32 { /* sqlite3.c:216229:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -166711,7 +169327,7 @@ func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) } } if int32(*(*int8)(unsafe.Pointer(z2))) == 0 { - sqlite3Fts5ParseError(tls, pParse, ts+37199 /* "unterminated str..." */, 0) + sqlite3Fts5ParseError(tls, pParse, ts+37705 /* "unterminated str..." */, 0) return FTS5_EOF } } @@ -166724,20 +169340,20 @@ func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) { var z2 uintptr if sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z))) == 0 { - sqlite3Fts5ParseError(tls, pParse, ts+37219 /* "fts5: syntax err..." */, libc.VaList(bp, z)) + sqlite3Fts5ParseError(tls, pParse, ts+37725 /* "fts5: syntax err..." */, libc.VaList(bp, z)) return FTS5_EOF } tok = FTS5_STRING for z2 = (z + 1); sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z2))) != 0; z2++ { } (*Fts5Token)(unsafe.Pointer(pToken)).Fn = (int32((int64(z2) - int64(z)) / 1)) - if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 2) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+37250 /* "OR" */, uint64(2)) == 0) { + if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 2) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+37756 /* "OR" */, uint64(2)) == 0) { tok = FTS5_OR } - if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+37253 /* "NOT" */, uint64(3)) == 0) { + if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+37759 /* "NOT" */, uint64(3)) == 0) { tok = FTS5_NOT } - if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+33330 /* "AND" */, uint64(3)) == 0) { + if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+33836 /* "AND" */, uint64(3)) == 0) { tok = FTS5_AND } break @@ -166749,23 +169365,23 @@ func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) return tok } -func fts5ParseAlloc(tls *libc.TLS, t U64) uintptr { /* sqlite3.c:213114:13: */ +func fts5ParseAlloc(tls *libc.TLS, t U64) uintptr { /* sqlite3.c:216293:13: */ return Xsqlite3_malloc64(tls, uint64(Sqlite3_int64(t))) } -func fts5ParseFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:213115:13: */ +func fts5ParseFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:216294:13: */ Xsqlite3_free(tls, p) } -func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, iCol int32, zExpr uintptr, ppNew uintptr, pzErr uintptr) int32 { /* sqlite3.c:213117:12: */ - bp := tls.Alloc(64) - defer tls.Free(64) +func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCol int32, zExpr uintptr, ppNew uintptr, pzErr uintptr) int32 { /* sqlite3.c:216296:12: */ + bp := tls.Alloc(72) + defer tls.Free(72) - // var sParse Fts5Parse at bp, 40 + // var sParse Fts5Parse at bp, 48 - // var token Fts5Token at bp+48, 16 + // var token Fts5Token at bp+56, 16 - *(*uintptr)(unsafe.Pointer(bp + 40 /* z */)) = zExpr + *(*uintptr)(unsafe.Pointer(bp + 48 /* z */)) = zExpr var t int32 // Next token type var pEngine uintptr var pNew uintptr @@ -166773,6 +169389,7 @@ func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, iCol int32, zExpr uintpt *(*uintptr)(unsafe.Pointer(ppNew)) = uintptr(0) *(*uintptr)(unsafe.Pointer(pzErr)) = uintptr(0) libc.Xmemset(tls, bp /* &sParse */, 0, uint64(unsafe.Sizeof(Fts5Parse{}))) + (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FbPhraseToAnd = bPhraseToAnd pEngine = sqlite3Fts5ParserAlloc(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, U64) uintptr }{fts5ParseAlloc}))) if pEngine == uintptr(0) { return SQLITE_NOMEM @@ -166780,8 +169397,8 @@ func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, iCol int32, zExpr uintpt (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpConfig = pConfig for ok := true; ok; ok = (((*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc == SQLITE_OK) && (t != FTS5_EOF)) { - t = fts5ExprGetToken(tls, bp /* &sParse */, bp+40 /* &z */, bp+48 /* &token */) - sqlite3Fts5Parser(tls, pEngine, t, *(*Fts5Token)(unsafe.Pointer(bp + 48 /* token */)), bp /* &sParse */) + t = fts5ExprGetToken(tls, bp /* &sParse */, bp+48 /* &z */, bp+56 /* &token */) + sqlite3Fts5Parser(tls, pEngine, t, *(*Fts5Token)(unsafe.Pointer(bp + 56 /* token */)), bp /* &sParse */) } sqlite3Fts5ParserFree(tls, pEngine, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5ParseFree}))) @@ -166816,6 +169433,7 @@ func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, iCol int32, zExpr uintpt (*Fts5Expr)(unsafe.Pointer(pNew)).FpConfig = pConfig (*Fts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FapPhrase (*Fts5Expr)(unsafe.Pointer(pNew)).FnPhrase = (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FnPhrase + (*Fts5Expr)(unsafe.Pointer(pNew)).FbDesc = 0 (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FapPhrase = uintptr(0) } } else { @@ -166827,8 +169445,88 @@ func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, iCol int32, zExpr uintpt return (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc } +// This function is only called when using the special 'trigram' tokenizer. +// Argument zText contains the text of a LIKE or GLOB pattern matched +// against column iCol. This function creates and compiles an FTS5 MATCH +// expression that will match a superset of the rows matched by the LIKE or +// GLOB. If successful, SQLITE_OK is returned. Otherwise, an SQLite error +// code. +func sqlite3Fts5ExprPattern(tls *libc.TLS, pConfig uintptr, bGlob int32, iCol int32, zText uintptr, pp uintptr) int32 { /* sqlite3.c:216377:12: */ + bp := tls.Alloc(3) + defer tls.Free(3) + + var nText I64 = I64(libc.Xstrlen(tls, zText)) + var zExpr uintptr = Xsqlite3_malloc64(tls, (uint64((nText * int64(4)) + int64(1)))) + var rc int32 = SQLITE_OK + + if zExpr == uintptr(0) { + rc = SQLITE_NOMEM + } else { + // var aSpec [3]int8 at bp, 3 + + var iOut int32 = 0 + var i int32 = 0 + var iFirst int32 = 0 + + if bGlob == 0 { + *(*int8)(unsafe.Pointer(bp /* &aSpec[0] */)) = int8('_') + *(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 1)) = int8('%') + *(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 2)) = int8(0) + } else { + *(*int8)(unsafe.Pointer(bp /* &aSpec[0] */)) = int8('*') + *(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 1)) = int8('?') + *(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 2)) = int8('[') + } + + for I64(i) <= nText { + if (((I64(i) == nText) || + (int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(bp /* &aSpec[0] */))))) || (int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 1))))) || (int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 2)))) { + if (i - iFirst) >= 3 { + var jj int32 + *(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8('"') + for jj = iFirst; jj < i; jj++ { + *(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(zText + uintptr(jj))) + if int32(*(*int8)(unsafe.Pointer(zText + uintptr(jj)))) == '"' { + *(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8('"') + } + } + *(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8('"') + *(*int8)(unsafe.Pointer(zExpr + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8(' ') + } + if int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(bp /* &aSpec[0] */ + 2))) { + i = i + (2) + if int32(*(*int8)(unsafe.Pointer(zText + uintptr((i - 1))))) == '^' { + i++ + } + for (I64(i) < nText) && (int32(*(*int8)(unsafe.Pointer(zText + uintptr(i)))) != ']') { + i++ + } + } + iFirst = (i + 1) + } + i++ + } + if iOut > 0 { + var bAnd int32 = 0 + if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail != FTS5_DETAIL_FULL { + bAnd = 1 + if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE { + iCol = (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol + } + } + *(*int8)(unsafe.Pointer(zExpr + uintptr(iOut))) = int8(0) + rc = sqlite3Fts5ExprNew(tls, pConfig, bAnd, iCol, zExpr, pp, (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg) + } else { + *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0) + } + Xsqlite3_free(tls, zExpr) + } + + return rc +} + // Free the expression node object passed as the only argument. -func sqlite3Fts5ParseNodeFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:213190:13: */ +func sqlite3Fts5ParseNodeFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:216447:13: */ if p != 0 { var i int32 for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(p)).FnChild; i++ { @@ -166840,7 +169538,7 @@ func sqlite3Fts5ParseNodeFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:213190:13 } // Free the expression object passed as the only argument. -func sqlite3Fts5ExprFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:213204:13: */ +func sqlite3Fts5ExprFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:216461:13: */ if p != 0 { sqlite3Fts5ParseNodeFree(tls, (*Fts5Expr)(unsafe.Pointer(p)).FpRoot) Xsqlite3_free(tls, (*Fts5Expr)(unsafe.Pointer(p)).FapExprPhrase) @@ -166848,11 +169546,11 @@ func sqlite3Fts5ExprFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:213204:13: */ } } -func sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) int32 { /* sqlite3.c:213212:12: */ - bp := tls.Alloc(40) - defer tls.Free(40) +func sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) int32 { /* sqlite3.c:216469:12: */ + bp := tls.Alloc(48) + defer tls.Free(48) - // var sParse Fts5Parse at bp, 40 + // var sParse Fts5Parse at bp, 48 libc.Xmemset(tls, bp /* &sParse */, 0, uint64(unsafe.Sizeof(Fts5Parse{}))) @@ -166889,7 +169587,7 @@ func sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) int32 { /* sqlit // Argument pTerm must be a synonym iterator. Return the current rowid // that it points to. -func fts5ExprSynonymRowid(tls *libc.TLS, pTerm uintptr, bDesc int32, pbEof uintptr) I64 { /* sqlite3.c:213252:12: */ +func fts5ExprSynonymRowid(tls *libc.TLS, pTerm uintptr, bDesc int32, pbEof uintptr) I64 { /* sqlite3.c:216509:12: */ var iRet I64 = int64(0) var bRetValid int32 = 0 var p uintptr @@ -166911,7 +169609,7 @@ func fts5ExprSynonymRowid(tls *libc.TLS, pTerm uintptr, bDesc int32, pbEof uintp } // Argument pTerm must be a synonym iterator. -func fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid I64, pBuf uintptr, pa uintptr, pn uintptr) int32 { /* sqlite3.c:213276:12: */ +func fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid I64, pBuf uintptr, pa uintptr, pn uintptr) int32 { /* sqlite3.c:216533:12: */ bp := tls.Alloc(136) defer tls.Free(136) @@ -167075,7 +169773,7 @@ __22: // SQLITE_OK is returned if an error occurs, or an SQLite error code // otherwise. It is not considered an error code if the current rowid is // not a match. -func fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMatch uintptr) int32 { /* sqlite3.c:213359:12: */ +func fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMatch uintptr) int32 { /* sqlite3.c:216616:12: */ bp := tls.Alloc(168) defer tls.Free(168) @@ -167300,11 +169998,11 @@ type Fts5LookaheadReader1 = struct { Fi int32 FiPos I64 FiLookahead I64 -} /* sqlite3.c:213443:9 */ +} /* sqlite3.c:216700:9 */ -type Fts5LookaheadReader = Fts5LookaheadReader1 /* sqlite3.c:213443:36 */ +type Fts5LookaheadReader = Fts5LookaheadReader1 /* sqlite3.c:216700:36 */ -func fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:213454:12: */ +func fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:216711:12: */ (*Fts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*Fts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if sqlite3Fts5PoslistNext64(tls, (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fn, (p+12 /* &.i */), (p+24 /* &.iLookahead */)) != 0 { (*Fts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead = (I64((int64(1))) << 62) @@ -167312,7 +170010,7 @@ func fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:2134 return (libc.Bool32((*Fts5LookaheadReader)(unsafe.Pointer(p)).FiPos == (I64((int64(1))) << 62))) } -func fts5LookaheadReaderInit(tls *libc.TLS, a uintptr, n int32, p uintptr) int32 { /* sqlite3.c:213462:12: */ +func fts5LookaheadReaderInit(tls *libc.TLS, a uintptr, n int32, p uintptr) int32 { /* sqlite3.c:216719:12: */ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Fts5LookaheadReader{}))) (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fa = a (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fn = n @@ -167324,9 +170022,9 @@ type Fts5NearTrimmer1 = struct { Freader Fts5LookaheadReader Fwriter Fts5PoslistWriter FpOut uintptr -} /* sqlite3.c:213473:9 */ +} /* sqlite3.c:216730:9 */ -type Fts5NearTrimmer = Fts5NearTrimmer1 /* sqlite3.c:213473:32 */ +type Fts5NearTrimmer = Fts5NearTrimmer1 /* sqlite3.c:216730:32 */ // The near-set object passed as the first argument contains more than // one phrase. All phrases currently point to the same row. The @@ -167343,7 +170041,7 @@ type Fts5NearTrimmer = Fts5NearTrimmer1 /* sqlite3.c:213473:32 */ // If no error occurs and non-zero (a match) is returned, the position-list // of each phrase object is edited to contain only those entries that // meet the constraint before returning. -func fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) int32 { /* sqlite3.c:213497:12: */ +func fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) int32 { /* sqlite3.c:216754:12: */ bp := tls.Alloc(196) defer tls.Free(196) @@ -167545,7 +170243,7 @@ __29: // If the iterator reaches EOF, set *pbEof to true before returning. If // an error occurs, set *pRc to an error code. If either *pbEof or *pRc // are set, return a non-zero value. Otherwise, return zero. -func fts5ExprAdvanceto(tls *libc.TLS, pIter uintptr, bDesc int32, piLast uintptr, pRc uintptr, pbEof uintptr) int32 { /* sqlite3.c:213596:12: */ +func fts5ExprAdvanceto(tls *libc.TLS, pIter uintptr, bDesc int32, piLast uintptr, pRc uintptr, pbEof uintptr) int32 { /* sqlite3.c:216853:12: */ var iLast I64 = *(*I64)(unsafe.Pointer(piLast)) var iRowid I64 @@ -167565,7 +170263,7 @@ func fts5ExprAdvanceto(tls *libc.TLS, pIter uintptr, bDesc int32, piLast uintptr return 0 } -func fts5ExprSynonymAdvanceto(tls *libc.TLS, pTerm uintptr, bDesc int32, piLast uintptr, pRc uintptr) int32 { /* sqlite3.c:213622:12: */ +func fts5ExprSynonymAdvanceto(tls *libc.TLS, pTerm uintptr, bDesc int32, piLast uintptr, pRc uintptr) int32 { /* sqlite3.c:216879:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -167592,7 +170290,7 @@ func fts5ExprSynonymAdvanceto(tls *libc.TLS, pTerm uintptr, bDesc int32, piLast return *(*int32)(unsafe.Pointer(bp /* bEof */)) } -func fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:213652:12: */ +func fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:216909:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -167649,7 +170347,7 @@ func fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr) // If an error occurs, return an SQLite error code. Otherwise, return // SQLITE_OK. It is not considered an error if some term matches zero // documents. -func fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:213711:12: */ +func fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:216968:12: */ var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear var i int32 @@ -167715,7 +170413,7 @@ func fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* // Otherwise, if this is a DESC iterator, the opposite is returned: // // (iRhs - iLhs) -func fts5RowidCmp(tls *libc.TLS, pExpr uintptr, iLhs I64, iRhs I64) int32 { /* sqlite3.c:213773:12: */ +func fts5RowidCmp(tls *libc.TLS, pExpr uintptr, iLhs I64, iRhs I64) int32 { /* sqlite3.c:217030:12: */ if (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc == 0 { if iLhs < iRhs { @@ -167731,7 +170429,7 @@ func fts5RowidCmp(tls *libc.TLS, pExpr uintptr, iLhs I64, iRhs I64) int32 { /* s return int32(0) } -func fts5ExprSetEof(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:213788:13: */ +func fts5ExprSetEof(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:217045:13: */ var i int32 (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1 (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0 @@ -167740,7 +170438,7 @@ func fts5ExprSetEof(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:213788:13: */ } } -func fts5ExprNodeZeroPoslist(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:213797:13: */ +func fts5ExprNodeZeroPoslist(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:217054:13: */ if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM) { var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear var i int32 @@ -167766,7 +170464,7 @@ func fts5ExprNodeZeroPoslist(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:213797 // This means that if the iteration order is ASC, then numerically larger // rowids are considered larger. Or if it is the default DESC, numerically // smaller rowids are larger. -func fts5NodeCompare(tls *libc.TLS, pExpr uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:213827:12: */ +func fts5NodeCompare(tls *libc.TLS, pExpr uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:217084:12: */ if (*Fts5ExprNode)(unsafe.Pointer(p2)).FbEof != 0 { return -1 } @@ -167785,7 +170483,7 @@ func fts5NodeCompare(tls *libc.TLS, pExpr uintptr, p1 uintptr, p2 uintptr) int32 // SQLITE_OK is returned if an error occurs, or an SQLite error code // otherwise. It is not considered an error code if an iterator reaches // EOF. -func fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:213848:12: */ +func fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:217105:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -167853,7 +170551,7 @@ func fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 // // Return SQLITE_OK if successful, or an SQLite error code if an error // occurs. -func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:213918:12: */ +func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:217175:12: */ var pTerm uintptr = (*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24 /* &.apPhrase */))) + 32 /* &.aTerm */) var rc int32 = SQLITE_OK @@ -167912,7 +170610,7 @@ func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromV return rc } -func fts5ExprNodeTest_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:213983:12: */ +func fts5ExprNodeTest_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:217240:12: */ // As this "NEAR" object is actually a single phrase that consists // of a single term only, grab pointers into the poslist managed by the // fts5_index.c iterator object. This is much faster than synthesizing @@ -167931,7 +170629,7 @@ func fts5ExprNodeTest_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { } // xNext() method for a node of type FTS5_TERM. -func fts5ExprNodeNext_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:214011:12: */ +func fts5ExprNodeNext_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:217268:12: */ var rc int32 var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24 /* &.apPhrase */))) + 32 /* &.aTerm */))).FpIter @@ -167949,7 +170647,7 @@ func fts5ExprNodeNext_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromVal return rc } -func fts5ExprNodeTest_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr) { /* sqlite3.c:214035:13: */ +func fts5ExprNodeTest_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr) { /* sqlite3.c:217292:13: */ var pNext uintptr = *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */))) var i int32 @@ -167965,7 +170663,7 @@ func fts5ExprNodeTest_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr) { /* sqlit (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = (*Fts5ExprNode)(unsafe.Pointer(pNext)).FbNomatch } -func fts5ExprNodeNext_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:214054:12: */ +func fts5ExprNodeNext_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:217311:12: */ var i int32 var iLast I64 = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid @@ -167989,7 +170687,7 @@ func fts5ExprNodeNext_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid } // Argument pNode is an FTS5_AND node. -func fts5ExprNodeTest_AND(tls *libc.TLS, pExpr uintptr, pAnd uintptr) int32 { /* sqlite3.c:214086:12: */ +func fts5ExprNodeTest_AND(tls *libc.TLS, pExpr uintptr, pAnd uintptr) int32 { /* sqlite3.c:217343:12: */ var iChild int32 var iLast I64 = (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FiRowid var rc int32 = SQLITE_OK @@ -168037,7 +170735,7 @@ func fts5ExprNodeTest_AND(tls *libc.TLS, pExpr uintptr, pAnd uintptr) int32 { /* return SQLITE_OK } -func fts5ExprNodeNext_AND(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:214138:12: */ +func fts5ExprNodeNext_AND(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:217395:12: */ var rc int32 = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */))) + 16 /* &.xNext */))))(tls, pExpr, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */))), bFromValid, iFrom) if rc == SQLITE_OK { rc = fts5ExprNodeTest_AND(tls, pExpr, pNode) @@ -168047,7 +170745,7 @@ func fts5ExprNodeNext_AND(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromVali return rc } -func fts5ExprNodeTest_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:214153:12: */ +func fts5ExprNodeTest_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:217410:12: */ var rc int32 = SQLITE_OK var p1 uintptr = *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */))) var p2 uintptr = *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + 1*8)) @@ -168073,7 +170771,7 @@ func fts5ExprNodeTest_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { / return rc } -func fts5ExprNodeNext_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:214181:12: */ +func fts5ExprNodeNext_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:217438:12: */ var rc int32 = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */))) + 16 /* &.xNext */))))(tls, pExpr, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */))), bFromValid, iFrom) if rc == SQLITE_OK { rc = fts5ExprNodeTest_NOT(tls, pExpr, pNode) @@ -168087,7 +170785,7 @@ func fts5ExprNodeNext_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromVali // If pNode currently points to a match, this function returns SQLITE_OK // without modifying it. Otherwise, pNode is advanced until it does point // to a match or EOF is reached. -func fts5ExprNodeTest(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:214202:12: */ +func fts5ExprNodeTest(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:217459:12: */ var rc int32 = SQLITE_OK if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 { switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType { @@ -168140,7 +170838,7 @@ func fts5ExprNodeTest(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sq // // Return an SQLite error code if an error occurs, or SQLITE_OK otherwise. // It is not an error if there are no matches. -func fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:214247:12: */ +func fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:217504:12: */ var rc int32 = SQLITE_OK (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 0 (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0 @@ -168202,7 +170900,7 @@ func fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* s // // Return SQLITE_OK if successful, or an SQLite error code otherwise. It // is not considered an error if the query does not match any documents. -func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bDesc int32) int32 { /* sqlite3.c:214306:12: */ +func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bDesc int32) int32 { /* sqlite3.c:217563:12: */ var pRoot uintptr = (*Fts5Expr)(unsafe.Pointer(p)).FpRoot var rc int32 // Return code @@ -168219,7 +170917,7 @@ func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bD } // If the iterator is not at a real match, skip forward until it is. - for (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbNomatch != 0 { + for ((*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbNomatch != 0) && (rc == SQLITE_OK) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((pRoot + 16 /* &.xNext */))))(tls, p, pRoot, 0, int64(0)) } @@ -168230,7 +170928,7 @@ func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bD // // Return SQLITE_OK if successful, or an SQLite error code otherwise. It // is not considered an error if the query does not match any documents. -func sqlite3Fts5ExprNext(tls *libc.TLS, p uintptr, iLast I64) int32 { /* sqlite3.c:214337:12: */ +func sqlite3Fts5ExprNext(tls *libc.TLS, p uintptr, iLast I64) int32 { /* sqlite3.c:217594:12: */ var rc int32 var pRoot uintptr = (*Fts5Expr)(unsafe.Pointer(p)).FpRoot @@ -168244,15 +170942,15 @@ func sqlite3Fts5ExprNext(tls *libc.TLS, p uintptr, iLast I64) int32 { /* sqlite3 return rc } -func sqlite3Fts5ExprEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:214351:12: */ +func sqlite3Fts5ExprEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:217608:12: */ return (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(p)).FpRoot)).FbEof } -func sqlite3Fts5ExprRowid(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:214355:12: */ +func sqlite3Fts5ExprRowid(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:217612:12: */ return (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(p)).FpRoot)).FiRowid } -func fts5ParseStringFromToken(tls *libc.TLS, pToken uintptr, pz uintptr) int32 { /* sqlite3.c:214359:12: */ +func fts5ParseStringFromToken(tls *libc.TLS, pToken uintptr, pz uintptr) int32 { /* sqlite3.c:217616:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -168262,7 +170960,7 @@ func fts5ParseStringFromToken(tls *libc.TLS, pToken uintptr, pz uintptr) int32 { } // Free the phrase object passed as the only argument. -func fts5ExprPhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:214368:13: */ +func fts5ExprPhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:217625:13: */ if pPhrase != 0 { var i int32 for i = 0; i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; i++ { @@ -168287,7 +170985,7 @@ func fts5ExprPhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:214368:13 // Set the "bFirst" flag on the first token of the phrase passed as the // only argument. -func sqlite3Fts5ParseSetCaret(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:214393:13: */ +func sqlite3Fts5ParseSetCaret(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:217650:13: */ if (pPhrase != 0) && ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm != 0) { (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */))).FbFirst = U8(1) } @@ -168299,7 +170997,7 @@ func sqlite3Fts5ParseSetCaret(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:214 // // If an OOM error occurs, both the pNear and pPhrase objects are freed and // NULL returned. -func sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhrase uintptr) uintptr { /* sqlite3.c:214407:24: */ +func sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhrase uintptr) uintptr { /* sqlite3.c:217664:24: */ var SZALLOC int32 = 8 var pRet uintptr = uintptr(0) @@ -168359,12 +171057,12 @@ type TokenCtx1 = struct { FpPhrase uintptr Frc int32 _ [4]byte -} /* sqlite3.c:214467:9 */ +} /* sqlite3.c:217724:9 */ -type TokenCtx = TokenCtx1 /* sqlite3.c:214467:25 */ +type TokenCtx = TokenCtx1 /* sqlite3.c:217724:25 */ // Callback for tokenizing terms used by ParseTerm(). -func fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:214476:12: */ +func fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:217733:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -168433,12 +171131,12 @@ func fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken uin } // Free the phrase object passed as the only argument. -func sqlite3Fts5ParsePhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:214541:13: */ +func sqlite3Fts5ParsePhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:217798:13: */ fts5ExprPhraseFree(tls, pPhrase) } // Free the phrase object passed as the second argument. -func sqlite3Fts5ParseNearsetFree(tls *libc.TLS, pNear uintptr) { /* sqlite3.c:214548:13: */ +func sqlite3Fts5ParseNearsetFree(tls *libc.TLS, pNear uintptr) { /* sqlite3.c:217805:13: */ if pNear != 0 { var i int32 for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ { @@ -168449,15 +171147,29 @@ func sqlite3Fts5ParseNearsetFree(tls *libc.TLS, pNear uintptr) { /* sqlite3.c:21 } } -func sqlite3Fts5ParseFinished(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:214559:13: */ +func sqlite3Fts5ParseFinished(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:217816:13: */ (*Fts5Parse)(unsafe.Pointer(pParse)).FpExpr = p } +func parseGrowPhraseArray(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:217821:12: */ + if ((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase % 8) == 0 { + var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * (uint64((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase + 8)))) + var apNew uintptr + apNew = Xsqlite3_realloc64(tls, (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase, uint64(nByte)) + if apNew == uintptr(0) { + (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM + return SQLITE_NOMEM + } + (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase = apNew + } + return SQLITE_OK +} + // This function is called by the parser to process a string token. The // string may or may not be quoted. In any case it is tokenized and a // phrase object consisting of all tokens returned. -func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken uintptr, bPrefix int32) uintptr { /* sqlite3.c:214569:23: */ +func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken uintptr, bPrefix int32) uintptr { /* sqlite3.c:217840:23: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -168493,16 +171205,9 @@ func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken } else { if pAppend == uintptr(0) { - if ((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase % 8) == 0 { - var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * (uint64((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase + 8)))) - var apNew uintptr - apNew = Xsqlite3_realloc64(tls, (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase, uint64(nByte)) - if apNew == uintptr(0) { - (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_NOMEM - fts5ExprPhraseFree(tls, (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase) - return uintptr(0) - } - (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase = apNew + if parseGrowPhraseArray(tls, pParse) != 0 { + fts5ExprPhraseFree(tls, (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase) + return uintptr(0) } (*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase++ } @@ -168522,7 +171227,7 @@ func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken // Create a new FTS5 expression by cloning phrase iPhrase of the // expression passed as the second argument. -func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppNew uintptr) int32 { /* sqlite3.c:214630:12: */ +func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppNew uintptr) int32 { /* sqlite3.c:217894:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -168617,17 +171322,17 @@ func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppN // Token pTok has appeared in a MATCH expression where the NEAR operator // is expected. If token pTok does not contain "NEAR", store an error // in the pParse object. -func sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { /* sqlite3.c:214726:13: */ +func sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { /* sqlite3.c:217990:13: */ bp := tls.Alloc(16) defer tls.Free(16) - if ((*Fts5Token)(unsafe.Pointer(pTok)).Fn != 4) || (libc.Xmemcmp(tls, ts+37257 /* "NEAR" */, (*Fts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0) { + if ((*Fts5Token)(unsafe.Pointer(pTok)).Fn != 4) || (libc.Xmemcmp(tls, ts+37763 /* "NEAR" */, (*Fts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0) { sqlite3Fts5ParseError(tls, - pParse, ts+36286 /* "fts5: syntax err..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(pTok)).Fn, (*Fts5Token)(unsafe.Pointer(pTok)).Fp)) + pParse, ts+36792 /* "fts5: syntax err..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(pTok)).Fn, (*Fts5Token)(unsafe.Pointer(pTok)).Fp)) } } -func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p uintptr) { /* sqlite3.c:214734:13: */ +func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p uintptr) { /* sqlite3.c:217998:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -168639,7 +171344,7 @@ func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p var c int8 = *(*int8)(unsafe.Pointer((*Fts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if (int32(c) < '0') || (int32(c) > '9') { sqlite3Fts5ParseError(tls, - pParse, ts+37262 /* "expected integer..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(p)).Fn, (*Fts5Token)(unsafe.Pointer(p)).Fp)) + pParse, ts+37768 /* "expected integer..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(p)).Fn, (*Fts5Token)(unsafe.Pointer(p)).Fp)) return } nNear = ((nNear * 10) + (int32(*(*int8)(unsafe.Pointer((*Fts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - '0')) @@ -168658,7 +171363,7 @@ func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p // // If an OOM error occurs, store an error code in pParse and return NULL. // The old colset object (if any) is not freed in this case. -func fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:214769:19: */ +func fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:218033:19: */ var nCol int32 if p != 0 { nCol = (*Fts5Colset)(unsafe.Pointer(p)).FnCol @@ -168696,7 +171401,7 @@ func fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintp // Allocate and return an Fts5Colset object specifying the inverse of // the colset passed as the second argument. Free the colset passed // as the second argument before returning. -func sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:214810:19: */ +func sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:218074:19: */ var pRet uintptr var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol @@ -168718,7 +171423,7 @@ func sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) uint return pRet } -func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p uintptr) uintptr { /* sqlite3.c:214833:19: */ +func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p uintptr) uintptr { /* sqlite3.c:218097:19: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -168736,7 +171441,7 @@ func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p ui } } if iCol == (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol { - sqlite3Fts5ParseError(tls, pParse, ts+22009 /* "no such column: ..." */, libc.VaList(bp, z)) + sqlite3Fts5ParseError(tls, pParse, ts+22473 /* "no such column: ..." */, libc.VaList(bp, z)) } else { pRet = fts5ParseColset(tls, pParse, pColset, iCol) } @@ -168757,7 +171462,7 @@ func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p ui // Otherwise, a copy of (*pOrig) is made into memory obtained from // sqlite3Fts5MallocZero() and a pointer to it returned. If the allocation // fails, (*pRc) is set to SQLITE_NOMEM and NULL is returned. -func fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) uintptr { /* sqlite3.c:214873:19: */ +func fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) uintptr { /* sqlite3.c:218137:19: */ var pRet uintptr if pOrig != 0 { var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Colset{})) + ((uint64((*Fts5Colset)(unsafe.Pointer(pOrig)).FnCol - 1)) * uint64(unsafe.Sizeof(int32(0)))))) @@ -168772,7 +171477,7 @@ func fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) uintptr { /* sql } // Remove from colset pColset any columns that are not also in colset pMerge. -func fts5MergeColset(tls *libc.TLS, pColset uintptr, pMerge uintptr) { /* sqlite3.c:214890:13: */ +func fts5MergeColset(tls *libc.TLS, pColset uintptr, pMerge uintptr) { /* sqlite3.c:218154:13: */ var iIn int32 = 0 // Next input in pColset var iMerge int32 = 0 // Next input in pMerge var iOut int32 = 0 // Next output slot in pColset @@ -168796,7 +171501,7 @@ func fts5MergeColset(tls *libc.TLS, pColset uintptr, pMerge uintptr) { /* sqlite // its decendents. If (*ppFree) is not NULL, it contains a spare copy // of pColset. This function may use the spare copy and set (*ppFree) to // zero, or it may create copies of pColset using fts5CloneColset(). -func fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pNode uintptr, pColset uintptr, ppFree uintptr) { /* sqlite3.c:214916:13: */ +func fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pNode uintptr, pColset uintptr, ppFree uintptr) { /* sqlite3.c:218180:13: */ if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM) { @@ -168824,7 +171529,7 @@ func fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pNode uintptr, pColset ui } // Apply colset pColset to expression node pExpr and all of its descendents. -func sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pColset uintptr) { /* sqlite3.c:214954:13: */ +func sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pColset uintptr) { /* sqlite3.c:218218:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -168832,14 +171537,14 @@ func sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pCo if (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == FTS5_DETAIL_NONE { (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR (*Fts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_mprintf(tls, - ts+37291 /* "fts5: column que..." */, 0) + ts+37797 /* "fts5: column que..." */, 0) } else { fts5ParseSetColset(tls, pParse, pExpr, pColset, bp /* &pFree */) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp /* pFree */))) } -func fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:214971:13: */ +func fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:218235:13: */ switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType { case FTS5_STRING: { @@ -168890,7 +171595,7 @@ func fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:214971:13: } } -func fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) { /* sqlite3.c:215004:13: */ +func fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) { /* sqlite3.c:218268:13: */ if ((*Fts5ExprNode)(unsafe.Pointer(p)).FeType != FTS5_NOT) && ((*Fts5ExprNode)(unsafe.Pointer(pSub)).FeType == (*Fts5ExprNode)(unsafe.Pointer(p)).FeType) { var nByte int32 = (int32(uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Fts5ExprNode)(unsafe.Pointer(pSub)).FnChild))) libc.Xmemcpy(tls, ((p + 48 /* &.apChild */) + uintptr((*Fts5ExprNode)(unsafe.Pointer(p)).FnChild)*8), pSub+48 /* &.apChild */, uint64(nByte)) @@ -168901,9 +171606,59 @@ func fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) { /* sqlite3.c: } } +// This function is used when parsing LIKE or GLOB patterns against +// trigram indexes that specify either detail=column or detail=none. +// It converts a phrase: +// +// abc + def + ghi +// +// into an AND tree: +// +// abc AND def AND ghi +func fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) uintptr { /* sqlite3.c:218290:21: */ + var nTerm int32 = (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */))))).FnTerm + var ii int32 + var nByte int32 + var pRet uintptr + + nByte = (int32(uint64(unsafe.Sizeof(Fts5ExprNode{})) + (uint64(nTerm) * uint64(unsafe.Sizeof(uintptr(0)))))) + pRet = sqlite3Fts5MallocZero(tls, (pParse + 16 /* &.rc */), int64(nByte)) + if pRet != 0 { + (*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = FTS5_AND + (*Fts5ExprNode)(unsafe.Pointer(pRet)).FnChild = nTerm + fts5ExprAssignXNext(tls, pRet) + (*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-- + for ii = 0; ii < nTerm; ii++ { + var pPhrase uintptr = sqlite3Fts5MallocZero(tls, + (pParse + 16 /* &.rc */), int64(unsafe.Sizeof(Fts5ExprPhrase{}))) + if pPhrase != 0 { + if parseGrowPhraseArray(tls, pParse) != 0 { + fts5ExprPhraseFree(tls, pPhrase) + } else { + *(*uintptr)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr(libc.PostIncInt32(&(*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase, 1))*8)) = pPhrase + (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm = 1 + (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */))).FzTerm = sqlite3Fts5Strndup(tls, + (pParse + 16 /* &.rc */), (*Fts5ExprTerm)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */)))+32 /* &.aTerm */)+uintptr(ii)*32)).FzTerm, -1) + *(*uintptr)(unsafe.Pointer((pRet + 48 /* &.apChild */) + uintptr(ii)*8)) = sqlite3Fts5ParseNode(tls, pParse, FTS5_STRING, + uintptr(0), uintptr(0), sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), pPhrase)) + } + } + } + + if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc != 0 { + sqlite3Fts5ParseNodeFree(tls, pRet) + pRet = uintptr(0) + } else { + sqlite3Fts5ParseNearsetFree(tls, pNear) + } + } + + return pRet +} + // Allocate and return a new expression object. If anything goes wrong (i.e. // OOM error), leave an error code in pParse and return NULL. -func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uintptr, pRight uintptr, pNear uintptr) uintptr { /* sqlite3.c:215019:21: */ +func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uintptr, pRight uintptr, pNear uintptr) uintptr { /* sqlite3.c:218344:21: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -168923,58 +171678,64 @@ func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uint return pLeft } - if eType == FTS5_NOT { - nChild = 2 - } else if (eType == FTS5_AND) || (eType == FTS5_OR) { - nChild = 2 - if (*Fts5ExprNode)(unsafe.Pointer(pLeft)).FeType == eType { - nChild = nChild + ((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild - 1) - } - if (*Fts5ExprNode)(unsafe.Pointer(pRight)).FeType == eType { - nChild = nChild + ((*Fts5ExprNode)(unsafe.Pointer(pRight)).FnChild - 1) - } - } - - nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5ExprNode{})) + (uint64(unsafe.Sizeof(uintptr(0))) * (uint64(nChild - 1))))) - pRet = sqlite3Fts5MallocZero(tls, (pParse + 16 /* &.rc */), nByte) - - if pRet != 0 { - (*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType - (*Fts5ExprNode)(unsafe.Pointer(pRet)).FpNear = pNear - fts5ExprAssignXNext(tls, pRet) - if eType == FTS5_STRING { - var iPhrase int32 - for iPhrase = 0; iPhrase < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; iPhrase++ { - (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(iPhrase)*8)))).FpNode = pRet - if (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(iPhrase)*8)))).FnTerm == 0 { - (*Fts5ExprNode)(unsafe.Pointer(pRet)).FxNext = uintptr(0) - (*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = FTS5_EOF - } + if ((eType == FTS5_STRING) && + ((*Fts5Parse)(unsafe.Pointer(pParse)).FbPhraseToAnd != 0)) && + ((*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */))))).FnTerm > 1) { + pRet = fts5ParsePhraseToAnd(tls, pParse, pNear) + } else { + if eType == FTS5_NOT { + nChild = 2 + } else if (eType == FTS5_AND) || (eType == FTS5_OR) { + nChild = 2 + if (*Fts5ExprNode)(unsafe.Pointer(pLeft)).FeType == eType { + nChild = nChild + ((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild - 1) } - - if (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail != FTS5_DETAIL_FULL { - var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */))) - if (((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != 1) || - ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 1)) || - (((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0) && ((*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */))).FbFirst != 0)) { - - (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR - - (*Fts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_mprintf(tls, - ts+37344, /* "fts5: %s queries..." */ - libc.VaList(bp, func() uintptr { - if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == 1 { - return ts + 37394 /* "phrase" */ - } - return ts + 37257 /* "NEAR" */ - }())) - Xsqlite3_free(tls, pRet) - pRet = uintptr(0) - } + if (*Fts5ExprNode)(unsafe.Pointer(pRight)).FeType == eType { + nChild = nChild + ((*Fts5ExprNode)(unsafe.Pointer(pRight)).FnChild - 1) + } + } + + nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5ExprNode{})) + (uint64(unsafe.Sizeof(uintptr(0))) * (uint64(nChild - 1))))) + pRet = sqlite3Fts5MallocZero(tls, (pParse + 16 /* &.rc */), nByte) + + if pRet != 0 { + (*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType + (*Fts5ExprNode)(unsafe.Pointer(pRet)).FpNear = pNear + fts5ExprAssignXNext(tls, pRet) + if eType == FTS5_STRING { + var iPhrase int32 + for iPhrase = 0; iPhrase < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; iPhrase++ { + (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(iPhrase)*8)))).FpNode = pRet + if (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(iPhrase)*8)))).FnTerm == 0 { + (*Fts5ExprNode)(unsafe.Pointer(pRet)).FxNext = uintptr(0) + (*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = FTS5_EOF + } + } + + if (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail != FTS5_DETAIL_FULL { + var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */))) + if (((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != 1) || + ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 1)) || + (((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0) && ((*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */))).FbFirst != 0)) { + + (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = SQLITE_ERROR + + (*Fts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_mprintf(tls, + ts+37850, /* "fts5: %s queries..." */ + libc.VaList(bp, func() uintptr { + if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == 1 { + return ts + 37900 /* "phrase" */ + } + return ts + 37763 /* "NEAR" */ + }())) + Xsqlite3_free(tls, pRet) + pRet = uintptr(0) + } + } + } else { + fts5ExprAddChildren(tls, pRet, pLeft) + fts5ExprAddChildren(tls, pRet, pRight) } - } else { - fts5ExprAddChildren(tls, pRet, pLeft) - fts5ExprAddChildren(tls, pRet, pRight) } } } @@ -168988,7 +171749,7 @@ func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uint return pRet } -func sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:215097:21: */ +func sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:218429:21: */ var pRet uintptr = uintptr(0) var pPrev uintptr @@ -169032,7 +171793,7 @@ func sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, p return pRet } -func fts5ExprTermPrint(tls *libc.TLS, pTerm uintptr) uintptr { /* sqlite3.c:215161:13: */ +func fts5ExprTermPrint(tls *libc.TLS, pTerm uintptr) uintptr { /* sqlite3.c:218493:13: */ var nByte Sqlite3_int64 = int64(0) var p uintptr var zQuoted uintptr @@ -169068,7 +171829,7 @@ func fts5ExprTermPrint(tls *libc.TLS, pTerm uintptr) uintptr { /* sqlite3.c:2151 return zQuoted } -func fts5PrintfAppend(tls *libc.TLS, zApp uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:215193:13: */ +func fts5PrintfAppend(tls *libc.TLS, zApp uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:218525:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -169079,7 +171840,7 @@ func fts5PrintfAppend(tls *libc.TLS, zApp uintptr, zFmt uintptr, va uintptr) uin zNew = Xsqlite3_vmprintf(tls, zFmt, ap) _ = ap if (zApp != 0) && (zNew != 0) { - var zNew2 uintptr = Xsqlite3_mprintf(tls, ts+6587 /* "%s%s" */, libc.VaList(bp, zApp, zNew)) + var zNew2 uintptr = Xsqlite3_mprintf(tls, ts+6663 /* "%s%s" */, libc.VaList(bp, zApp, zNew)) Xsqlite3_free(tls, zNew) zNew = zNew2 } @@ -169091,7 +171852,7 @@ func fts5PrintfAppend(tls *libc.TLS, zApp uintptr, zFmt uintptr, va uintptr) uin // pointer to a buffer containing that representation. It is the // responsibility of the caller to at some point free the buffer using // sqlite3_free(). -func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr uintptr) uintptr { /* sqlite3.c:215214:13: */ +func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr uintptr) uintptr { /* sqlite3.c:218546:13: */ bp := tls.Alloc(72) defer tls.Free(72) @@ -169101,7 +171862,7 @@ func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr var i int32 var iTerm int32 - zRet = fts5PrintfAppend(tls, zRet, ts+37401 /* "%s " */, libc.VaList(bp, zNearsetCmd)) + zRet = fts5PrintfAppend(tls, zRet, ts+37907 /* "%s " */, libc.VaList(bp, zNearsetCmd)) if zRet == uintptr(0) { return uintptr(0) } @@ -169109,13 +171870,13 @@ func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr var aiCol uintptr = (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset + 4 /* &.aiCol */ var nCol int32 = (*Fts5Colset)(unsafe.Pointer((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset)).FnCol if nCol == 1 { - zRet = fts5PrintfAppend(tls, zRet, ts+37405 /* "-col %d " */, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(aiCol)))) + zRet = fts5PrintfAppend(tls, zRet, ts+37911 /* "-col %d " */, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(aiCol)))) } else { - zRet = fts5PrintfAppend(tls, zRet, ts+37414 /* "-col {%d" */, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(aiCol)))) + zRet = fts5PrintfAppend(tls, zRet, ts+37920 /* "-col {%d" */, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(aiCol)))) for i = 1; i < (*Fts5Colset)(unsafe.Pointer((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset)).FnCol; i++ { - zRet = fts5PrintfAppend(tls, zRet, ts+37423 /* " %d" */, libc.VaList(bp+24, *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)))) + zRet = fts5PrintfAppend(tls, zRet, ts+37929 /* " %d" */, libc.VaList(bp+24, *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)))) } - zRet = fts5PrintfAppend(tls, zRet, ts+37427 /* "} " */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+37933 /* "} " */, 0) } if zRet == uintptr(0) { return uintptr(0) @@ -169123,13 +171884,13 @@ func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr } if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > 1 { - zRet = fts5PrintfAppend(tls, zRet, ts+37430 /* "-near %d " */, libc.VaList(bp+32, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear)) + zRet = fts5PrintfAppend(tls, zRet, ts+37936 /* "-near %d " */, libc.VaList(bp+32, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear)) if zRet == uintptr(0) { return uintptr(0) } } - zRet = fts5PrintfAppend(tls, zRet, ts+37440 /* "--" */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+37946 /* "--" */, 0) if zRet == uintptr(0) { return uintptr(0) } @@ -169137,22 +171898,22 @@ func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ { var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(i)*8)) - zRet = fts5PrintfAppend(tls, zRet, ts+37443 /* " {" */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+37949 /* " {" */, 0) for iTerm = 0; (zRet != 0) && (iTerm < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm); iTerm++ { var zTerm uintptr = (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */) + uintptr(iTerm)*32)).FzTerm - zRet = fts5PrintfAppend(tls, zRet, ts+6587 /* "%s%s" */, libc.VaList(bp+40, func() uintptr { + zRet = fts5PrintfAppend(tls, zRet, ts+6663 /* "%s%s" */, libc.VaList(bp+40, func() uintptr { if iTerm == 0 { return ts + 800 /* "" */ } - return ts + 16003 /* " " */ + return ts + 12479 /* " " */ }(), zTerm)) if (*Fts5ExprTerm)(unsafe.Pointer((pPhrase+32 /* &.aTerm */)+uintptr(iTerm)*32)).FbPrefix != 0 { - zRet = fts5PrintfAppend(tls, zRet, ts+20691 /* "*" */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+21098 /* "*" */, 0) } } if zRet != 0 { - zRet = fts5PrintfAppend(tls, zRet, ts+29969 /* "}" */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+30475 /* "}" */, 0) } if zRet == uintptr(0) { return uintptr(0) @@ -169164,16 +171925,16 @@ func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr var i int32 switch (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType { case FTS5_AND: - zOp = ts + 33330 /* "AND" */ + zOp = ts + 33836 /* "AND" */ break fallthrough case FTS5_NOT: - zOp = ts + 37253 /* "NOT" */ + zOp = ts + 37759 /* "NOT" */ break fallthrough default: - zOp = ts + 37250 /* "OR" */ + zOp = ts + 37756 /* "OR" */ break } @@ -169184,7 +171945,7 @@ func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr Xsqlite3_free(tls, zRet) zRet = uintptr(0) } else { - zRet = fts5PrintfAppend(tls, zRet, ts+37446 /* " [%z]" */, libc.VaList(bp+64, z)) + zRet = fts5PrintfAppend(tls, zRet, ts+37952 /* " [%z]" */, libc.VaList(bp+64, z)) } } } @@ -169192,28 +171953,48 @@ func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr return zRet } -func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* sqlite3.c:215293:13: */ - bp := tls.Alloc(64) - defer tls.Free(64) +func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* sqlite3.c:218625:13: */ + bp := tls.Alloc(80) + defer tls.Free(80) var zRet uintptr = uintptr(0) if (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType == 0 { - return Xsqlite3_mprintf(tls, ts+37452 /* "\"\"" */, 0) + return Xsqlite3_mprintf(tls, ts+37958 /* "\"\"" */, 0) } else if ((*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType == FTS5_STRING) || ((*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType == FTS5_TERM) { var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FpNear var i int32 var iTerm int32 if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset != 0 { - var iCol int32 = *(*int32)(unsafe.Pointer(((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset + 4 /* &.aiCol */))) - zRet = fts5PrintfAppend(tls, zRet, ts+37455 /* "%s : " */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(iCol)*8)))) + var ii int32 + var pColset uintptr = (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset + if (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol > 1 { + zRet = fts5PrintfAppend(tls, zRet, ts+37961 /* "{" */, 0) + } + for ii = 0; ii < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; ii++ { + zRet = fts5PrintfAppend(tls, zRet, ts+6663, /* "%s%s" */ + libc.VaList(bp, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(*(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(ii)*4)))*8)), func() uintptr { + if ii == ((*Fts5Colset)(unsafe.Pointer(pColset)).FnCol - 1) { + return ts + 800 /* "" */ + } + return ts + 12479 /* " " */ + }())) + } + if zRet != 0 { + zRet = fts5PrintfAppend(tls, zRet, ts+37963 /* "%s : " */, libc.VaList(bp+16, func() uintptr { + if (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol > 1 { + return ts + 30475 /* "}" */ + } + return ts + 800 /* "" */ + }())) + } if zRet == uintptr(0) { return uintptr(0) } } if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > 1 { - zRet = fts5PrintfAppend(tls, zRet, ts+37461 /* "NEAR(" */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+37969 /* "NEAR(" */, 0) if zRet == uintptr(0) { return uintptr(0) } @@ -169222,7 +172003,7 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ { var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(i)*8)) if i != 0 { - zRet = fts5PrintfAppend(tls, zRet, ts+16003 /* " " */, 0) + zRet = fts5PrintfAppend(tls, zRet, ts+12479 /* " " */, 0) if zRet == uintptr(0) { return uintptr(0) } @@ -169230,11 +172011,11 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s for iTerm = 0; iTerm < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; iTerm++ { var zTerm uintptr = fts5ExprTermPrint(tls, ((pPhrase + 32 /* &.aTerm */) + uintptr(iTerm)*32)) if zTerm != 0 { - zRet = fts5PrintfAppend(tls, zRet, ts+6587 /* "%s%s" */, libc.VaList(bp+8, func() uintptr { + zRet = fts5PrintfAppend(tls, zRet, ts+6663 /* "%s%s" */, libc.VaList(bp+24, func() uintptr { if iTerm == 0 { return ts + 800 /* "" */ } - return ts + 37467 /* " + " */ + return ts + 37975 /* " + " */ }(), zTerm)) Xsqlite3_free(tls, zTerm) } @@ -169246,7 +172027,7 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s } if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > 1 { - zRet = fts5PrintfAppend(tls, zRet, ts+37471 /* ", %d)" */, libc.VaList(bp+24, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear)) + zRet = fts5PrintfAppend(tls, zRet, ts+37979 /* ", %d)" */, libc.VaList(bp+40, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear)) if zRet == uintptr(0) { return uintptr(0) } @@ -169258,16 +172039,16 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s switch (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType { case FTS5_AND: - zOp = ts + 23050 /* " AND " */ + zOp = ts + 23520 /* " AND " */ break fallthrough case FTS5_NOT: - zOp = ts + 37477 /* " NOT " */ + zOp = ts + 37985 /* " NOT " */ break fallthrough default: - zOp = ts + 37483 /* " OR " */ + zOp = ts + 37991 /* " OR " */ break } @@ -169279,8 +172060,8 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s } else { var e int32 = (*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pExpr + 48 /* &.apChild */) + uintptr(i)*8)))).FeType var b int32 = (libc.Bool32(((e != FTS5_STRING) && (e != FTS5_TERM)) && (e != FTS5_EOF))) - zRet = fts5PrintfAppend(tls, zRet, ts+37488, /* "%s%s%z%s" */ - libc.VaList(bp+32, func() uintptr { + zRet = fts5PrintfAppend(tls, zRet, ts+37996, /* "%s%s%z%s" */ + libc.VaList(bp+48, func() uintptr { if i == 0 { return ts + 800 /* "" */ } @@ -169288,12 +172069,12 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s }(), func() uintptr { if b != 0 { - return ts + 23056 /* "(" */ + return ts + 23526 /* "(" */ } return ts + 800 /* "" */ }(), z, func() uintptr { if b != 0 { - return ts + 6671 /* ")" */ + return ts + 6747 /* ")" */ } return ts + 800 /* "" */ }())) @@ -169309,7 +172090,7 @@ func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* s // The implementation of user-defined scalar functions fts5_expr() (bTcl==0) // and fts5_expr_tcl() (bTcl!=0). -func fts5ExprFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr, bTcl int32) { /* sqlite3.c:215375:13: */ +func fts5ExprFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr, bTcl int32) { /* sqlite3.c:218716:13: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -169321,18 +172102,18 @@ func fts5ExprFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr, bT var rc int32 var i int32 var azConfig uintptr // Array of arguments for Fts5Config - var zNearsetCmd uintptr = ts + 37497 /* "nearset" */ + var zNearsetCmd uintptr = ts + 38005 /* "nearset" */ var nConfig int32 // Size of azConfig[] *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)) = uintptr(0) var iArg int32 = 1 if nArg < 1 { - *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)) = Xsqlite3_mprintf(tls, ts+37505, /* "wrong number of ..." */ + *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)) = Xsqlite3_mprintf(tls, ts+38013, /* "wrong number of ..." */ libc.VaList(bp, func() uintptr { if bTcl != 0 { - return ts + 37546 /* "fts5_expr_tcl" */ + return ts + 38054 /* "fts5_expr_tcl" */ } - return ts + 37560 /* "fts5_expr" */ + return ts + 38068 /* "fts5_expr" */ }())) Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)), -1) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */))) @@ -169351,8 +172132,8 @@ func fts5ExprFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr, bT return } *(*uintptr)(unsafe.Pointer(azConfig)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(azConfig + 1*8)) = ts + 8333 /* "main" */ - *(*uintptr)(unsafe.Pointer(azConfig + 2*8)) = ts + 12632 /* "tbl" */ + *(*uintptr)(unsafe.Pointer(azConfig + 1*8)) = ts + 8426 /* "main" */ + *(*uintptr)(unsafe.Pointer(azConfig + 2*8)) = ts + 13045 /* "tbl" */ for i = 3; iArg < nArg; iArg++ { var z uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(iArg)*8))) *(*uintptr)(unsafe.Pointer(azConfig + uintptr(libc.PostIncInt32(&i, 1))*8)) = func() uintptr { @@ -169370,7 +172151,7 @@ func fts5ExprFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr, bT rc = sqlite3Fts5ConfigParse(tls, pGlobal, db, nConfig, azConfig, bp+8 /* &pConfig */, bp+16 /* &zErr */) if rc == SQLITE_OK { - rc = sqlite3Fts5ExprNew(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)), (*Fts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)))).FnCol, zExpr, bp+24 /* &pExpr */, bp+16 /* &zErr */) + rc = sqlite3Fts5ExprNew(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)), 0, (*Fts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)))).FnCol, zExpr, bp+24 /* &pExpr */, bp+16 /* &zErr */) } if rc == SQLITE_OK { var zText uintptr @@ -169402,18 +172183,18 @@ func fts5ExprFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr, bT sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pExpr */))) } -func fts5ExprFunctionHr(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:215460:13: */ +func fts5ExprFunctionHr(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:218801:13: */ fts5ExprFunction(tls, pCtx, nArg, apVal, 0) } -func fts5ExprFunctionTcl(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:215467:13: */ +func fts5ExprFunctionTcl(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:218808:13: */ fts5ExprFunction(tls, pCtx, nArg, apVal, 1) } // The implementation of an SQLite user-defined-function that accepts a // single integer as an argument. If the integer is an alpha-numeric // unicode code point, 1 is returned. Otherwise 0. -func fts5ExprIsAlnum(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:215480:13: */ +func fts5ExprIsAlnum(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:218821:13: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -169422,21 +172203,21 @@ func fts5ExprIsAlnum(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { / if nArg != 1 { Xsqlite3_result_error(tls, pCtx, - ts+37570 /* "wrong number of ..." */, -1) + ts+38078 /* "wrong number of ..." */, -1) return } libc.Xmemset(tls, bp /* &aArr[0] */, 0, uint64(unsafe.Sizeof([32]U8{}))) - sqlite3Fts5UnicodeCatParse(tls, ts+37621 /* "L*" */, bp /* &aArr[0] */) - sqlite3Fts5UnicodeCatParse(tls, ts+37624 /* "N*" */, bp /* &aArr[0] */) - sqlite3Fts5UnicodeCatParse(tls, ts+37627 /* "Co" */, bp /* &aArr[0] */) + sqlite3Fts5UnicodeCatParse(tls, ts+38129 /* "L*" */, bp /* &aArr[0] */) + sqlite3Fts5UnicodeCatParse(tls, ts+38132 /* "N*" */, bp /* &aArr[0] */) + sqlite3Fts5UnicodeCatParse(tls, ts+38135 /* "Co" */, bp /* &aArr[0] */) iCode = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal))) Xsqlite3_result_int(tls, pCtx, int32(*(*U8)(unsafe.Pointer(bp /* &aArr[0] */ + uintptr(sqlite3Fts5UnicodeCategory(tls, U32(iCode))))))) } -func fts5ExprFold(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:215501:13: */ +func fts5ExprFold(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:218842:13: */ if (nArg != 1) && (nArg != 2) { Xsqlite3_result_error(tls, pCtx, - ts+37630 /* "wrong number of ..." */, -1) + ts+38138 /* "wrong number of ..." */, -1) } else { var iCode int32 var bRemoveDiacritics int32 = 0 @@ -169450,21 +172231,21 @@ func fts5ExprFold(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* s // This is called during initialization to register the fts5_expr() scalar // UDF with the SQLite handle passed as the only argument. -func sqlite3Fts5ExprInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:215523:12: */ +func sqlite3Fts5ExprInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:218864:12: */ bp := tls.Alloc(64) defer tls.Free(64) *(*[4]Fts5ExprFunc)(unsafe.Pointer(bp /* aFunc */)) = [4]Fts5ExprFunc{ - {Fz: ts + 37560 /* "fts5_expr" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { + {Fz: ts + 38068 /* "fts5_expr" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5ExprFunctionHr}))}, - {Fz: ts + 37546 /* "fts5_expr_tcl" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { + {Fz: ts + 38054 /* "fts5_expr_tcl" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5ExprFunctionTcl}))}, - {Fz: ts + 37678 /* "fts5_isalnum" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { + {Fz: ts + 38186 /* "fts5_isalnum" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5ExprIsAlnum}))}, - {Fz: ts + 37691 /* "fts5_fold" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { + {Fz: ts + 38199 /* "fts5_fold" */, Fx: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5ExprFold}))}, } @@ -169487,10 +172268,10 @@ func sqlite3Fts5ExprInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* type Fts5ExprFunc = struct { Fz uintptr Fx uintptr -} /* sqlite3.c:215524:3 */ +} /* sqlite3.c:218865:3 */ // Return the number of phrases in expression pExpr. -func sqlite3Fts5ExprPhraseCount(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:215555:12: */ +func sqlite3Fts5ExprPhraseCount(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:218896:12: */ return func() int32 { if pExpr != 0 { return (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase @@ -169500,7 +172281,7 @@ func sqlite3Fts5ExprPhraseCount(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3 } // Return the number of terms in the iPhrase'th phrase in pExpr. -func sqlite3Fts5ExprPhraseSize(tls *libc.TLS, pExpr uintptr, iPhrase int32) int32 { /* sqlite3.c:215562:12: */ +func sqlite3Fts5ExprPhraseSize(tls *libc.TLS, pExpr uintptr, iPhrase int32) int32 { /* sqlite3.c:218903:12: */ if (iPhrase < 0) || (iPhrase >= (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase) { return 0 } @@ -169509,7 +172290,7 @@ func sqlite3Fts5ExprPhraseSize(tls *libc.TLS, pExpr uintptr, iPhrase int32) int3 // This function is used to access the current position list for phrase // iPhrase. -func sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uintptr) int32 { /* sqlite3.c:215571:12: */ +func sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uintptr) int32 { /* sqlite3.c:218912:12: */ var nRet int32 var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*8)) var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FpNode @@ -169523,7 +172304,7 @@ func sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uint return nRet } -func sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) uintptr { /* sqlite3.c:215591:29: */ +func sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) uintptr { /* sqlite3.c:218932:29: */ var pRet uintptr pRet = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(Fts5PoslistPopulator{})) * uint64((*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)))) if pRet != 0 { @@ -169547,12 +172328,12 @@ type Fts5ExprCtx1 = struct { FpExpr uintptr FaPopulator uintptr FiOff I64 -} /* sqlite3.c:215613:1 */ +} /* sqlite3.c:218954:1 */ -type Fts5ExprCtx = Fts5ExprCtx1 /* sqlite3.c:215618:28 */ +type Fts5ExprCtx = Fts5ExprCtx1 /* sqlite3.c:218959:28 */ // TODO: Make this more efficient! -func fts5ExprColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:215623:12: */ +func fts5ExprColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:218964:12: */ var i int32 for i = 0; i < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; i++ { if *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) == iCol { @@ -169562,7 +172343,7 @@ func fts5ExprColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* s return 0 } -func fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:215631:12: */ +func fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:218972:12: */ var p uintptr = pCtx var pExpr uintptr = (*Fts5ExprCtx)(unsafe.Pointer(p)).FpExpr var i int32 @@ -169597,7 +172378,7 @@ func fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToke return SQLITE_OK } -func sqlite3Fts5ExprPopulatePoslists(tls *libc.TLS, pConfig uintptr, pExpr uintptr, aPopulator uintptr, iCol int32, z uintptr, n int32) int32 { /* sqlite3.c:215666:12: */ +func sqlite3Fts5ExprPopulatePoslists(tls *libc.TLS, pConfig uintptr, pExpr uintptr, aPopulator uintptr, iCol int32, z uintptr, n int32) int32 { /* sqlite3.c:219007:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -169625,7 +172406,7 @@ func sqlite3Fts5ExprPopulatePoslists(tls *libc.TLS, pConfig uintptr, pExpr uintp }{fts5ExprPopulatePoslistsCb}))) } -func fts5ExprClearPoslists(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:215696:13: */ +func fts5ExprClearPoslists(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:219037:13: */ if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_TERM) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == FTS5_STRING) { (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24 /* &.apPhrase */))))).Fposlist.Fn = 0 } else { @@ -169636,7 +172417,7 @@ func fts5ExprClearPoslists(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:215696:1 } } -func fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid I64) int32 { /* sqlite3.c:215707:12: */ +func fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid I64) int32 { /* sqlite3.c:219048:12: */ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = iRowid (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 0 switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType { @@ -169686,12 +172467,12 @@ func fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid I64) int32 { /* return 1 } -func sqlite3Fts5ExprCheckPoslists(tls *libc.TLS, pExpr uintptr, iRowid I64) { /* sqlite3.c:215751:13: */ +func sqlite3Fts5ExprCheckPoslists(tls *libc.TLS, pExpr uintptr, iRowid I64) { /* sqlite3.c:219092:13: */ fts5ExprCheckPoslists(tls, (*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot, iRowid) } // This function is only called for detail=columns tables. -func sqlite3Fts5ExprPhraseCollist(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppCollist uintptr, pnCollist uintptr) int32 { /* sqlite3.c:215758:12: */ +func sqlite3Fts5ExprPhraseCollist(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppCollist uintptr, pnCollist uintptr) int32 { /* sqlite3.c:219099:12: */ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*8)) var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FpNode var rc int32 = SQLITE_OK @@ -169742,7 +172523,7 @@ type Fts5HashEntry1 = struct { FiCol I16 FiPos int32 FiRowid I64 -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ // 2014 August 11 // @@ -169758,14 +172539,14 @@ type Fts5HashEntry1 = struct { // #include "fts5Int.h" -type Fts5HashEntry = Fts5HashEntry1 /* sqlite3.c:215811:30 */ +type Fts5HashEntry = Fts5HashEntry1 /* sqlite3.c:219152:30 */ // Eqivalent to: // // char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } // Allocate a new hash table. -func sqlite3Fts5HashNew(tls *libc.TLS, pConfig uintptr, ppNew uintptr, pnByte uintptr) int32 { /* sqlite3.c:215877:12: */ +func sqlite3Fts5HashNew(tls *libc.TLS, pConfig uintptr, ppNew uintptr, pnByte uintptr) int32 { /* sqlite3.c:219218:12: */ var rc int32 = SQLITE_OK var pNew uintptr @@ -169793,7 +172574,7 @@ func sqlite3Fts5HashNew(tls *libc.TLS, pConfig uintptr, ppNew uintptr, pnByte ui } // Free a hash table object. -func sqlite3Fts5HashFree(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:215907:13: */ +func sqlite3Fts5HashFree(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:219248:13: */ if pHash != 0 { sqlite3Fts5HashClear(tls, pHash) Xsqlite3_free(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot) @@ -169802,7 +172583,7 @@ func sqlite3Fts5HashFree(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:215907:13: } // Empty (but do not delete) a hash table. -func sqlite3Fts5HashClear(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:215918:13: */ +func sqlite3Fts5HashClear(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:219259:13: */ var i int32 for i = 0; i < (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot; i++ { var pNext uintptr @@ -169816,7 +172597,7 @@ func sqlite3Fts5HashClear(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:215918:13 (*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry = 0 } -func fts5HashKey(tls *libc.TLS, nSlot int32, p uintptr, n int32) uint32 { /* sqlite3.c:215932:21: */ +func fts5HashKey(tls *libc.TLS, nSlot int32, p uintptr, n int32) uint32 { /* sqlite3.c:219273:21: */ var i int32 var h uint32 = uint32(13) for i = (n - 1); i >= 0; i-- { @@ -169825,7 +172606,7 @@ func fts5HashKey(tls *libc.TLS, nSlot int32, p uintptr, n int32) uint32 { /* sql return (h % uint32(nSlot)) } -func fts5HashKey2(tls *libc.TLS, nSlot int32, b U8, p uintptr, n int32) uint32 { /* sqlite3.c:215941:21: */ +func fts5HashKey2(tls *libc.TLS, nSlot int32, b U8, p uintptr, n int32) uint32 { /* sqlite3.c:219282:21: */ var i int32 var h uint32 = uint32(13) for i = (n - 1); i >= 0; i-- { @@ -169836,7 +172617,7 @@ func fts5HashKey2(tls *libc.TLS, nSlot int32, b U8, p uintptr, n int32) uint32 { } // Resize the hash table by doubling the number of slots. -func fts5HashResize(tls *libc.TLS, pHash uintptr) int32 { /* sqlite3.c:215954:12: */ +func fts5HashResize(tls *libc.TLS, pHash uintptr) int32 { /* sqlite3.c:219295:12: */ var nNew int32 = ((*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot * 2) var i int32 var apNew uintptr @@ -169866,7 +172647,7 @@ func fts5HashResize(tls *libc.TLS, pHash uintptr) int32 { /* sqlite3.c:215954:12 return SQLITE_OK } -func fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr) int32 { /* sqlite3.c:215982:12: */ +func fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr) int32 { /* sqlite3.c:219323:12: */ var nRet int32 = 0 if (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist != 0 { var pPtr uintptr @@ -169915,7 +172696,7 @@ func fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr) // (bByte || pToken) -> (iRowid,iCol,iPos) // // Or, if iCol is negative, then the value is a delete marker. -func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, iPos int32, bByte int8, pToken uintptr, nToken int32) int32 { /* sqlite3.c:216033:12: */ +func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, iPos int32, bByte int8, pToken uintptr, nToken int32) int32 { /* sqlite3.c:219374:12: */ var iHash uint32 var p uintptr var pPtr uintptr @@ -169986,7 +172767,6 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, }() } - nIncr = nIncr + ((*Fts5HashEntry)(unsafe.Pointer(p)).FnData) } else { // Appending to an existing hash-entry. Check that there is enough @@ -170020,8 +172800,9 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, // If this is a new rowid, append the 4-byte size field for the previous // entry, and the new rowid for this entry. if iRowid != (*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid { + var iDiff U64 = (U64(iRowid) - U64((*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid)) fts5HashAddPoslistSize(tls, pHash, p, uintptr(0)) - *(*int32)(unsafe.Pointer(p + 24 /* &.nData */)) += (sqlite3Fts5PutVarint(tls, (pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)), (uint64(iRowid - (*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid)))) + *(*int32)(unsafe.Pointer(p + 24 /* &.nData */)) += (sqlite3Fts5PutVarint(tls, (pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)), iDiff)) (*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid = iRowid bNew = 1 (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist = (*Fts5HashEntry)(unsafe.Pointer(p)).FnData @@ -170074,7 +172855,7 @@ func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, // Arguments pLeft and pRight point to linked-lists of hash-entry objects, // each sorted in key order. This function merges the two lists into a // single list and returns a pointer to its first element. -func fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:216186:22: */ +func fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:219527:22: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -170120,7 +172901,7 @@ func fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { // in sorted order. The hash table is cleared before returning. It is // the responsibility of the caller to free the elements of the returned // list. -func fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32, ppSorted uintptr) int32 { /* sqlite3.c:216232:12: */ +func fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32, ppSorted uintptr) int32 { /* sqlite3.c:219573:12: */ var nMergeSlot int32 = 32 var ap uintptr var pList uintptr @@ -170162,7 +172943,7 @@ func fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32, } // Query the hash table for a doclist associated with term pTerm/nTerm. -func sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintptr, nTerm int32, ppOut uintptr, pnDoclist uintptr) int32 { /* sqlite3.c:216279:12: */ +func sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintptr, nTerm int32, ppOut uintptr, pnDoclist uintptr) int32 { /* sqlite3.c:219620:12: */ var iHash uint32 = fts5HashKey(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot, pTerm, nTerm) var zKey uintptr = uintptr(0) var p uintptr @@ -170196,20 +172977,20 @@ func sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintpt return SQLITE_OK } -func sqlite3Fts5HashScanInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32) int32 { /* sqlite3.c:216317:12: */ +func sqlite3Fts5HashScanInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32) int32 { /* sqlite3.c:219658:12: */ return fts5HashEntrySort(tls, p, pTerm, nTerm, (p + 24 /* &.pScan */)) } -func sqlite3Fts5HashScanNext(tls *libc.TLS, p uintptr) { /* sqlite3.c:216324:13: */ +func sqlite3Fts5HashScanNext(tls *libc.TLS, p uintptr) { /* sqlite3.c:219665:13: */ (*Fts5Hash)(unsafe.Pointer(p)).FpScan = (*Fts5HashEntry)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(p)).FpScan)).FpScanNext } -func sqlite3Fts5HashScanEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:216329:12: */ +func sqlite3Fts5HashScanEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:219670:12: */ return (libc.Bool32((*Fts5Hash)(unsafe.Pointer(p)).FpScan == uintptr(0))) } -func sqlite3Fts5HashScanEntry(tls *libc.TLS, pHash uintptr, pzTerm uintptr, ppDoclist uintptr, pnDoclist uintptr) { /* sqlite3.c:216333:13: */ +func sqlite3Fts5HashScanEntry(tls *libc.TLS, pHash uintptr, pzTerm uintptr, ppDoclist uintptr, pnDoclist uintptr) { /* sqlite3.c:219674:13: */ var p uintptr if libc.AssignUintptr(&p, (*Fts5Hash)(unsafe.Pointer(pHash)).FpScan) != 0 { var zKey uintptr = ((p) + 1*48) @@ -170435,7 +173216,7 @@ type Fts5Data1 = struct { Fp uintptr Fnn int32 FszLeaf int32 -} /* sqlite3.c:216608:9 */ +} /* sqlite3.c:219949:9 */ // 2014 May 31 // @@ -170643,14 +173424,14 @@ type Fts5Data1 = struct { // many zero bytes. This makes it easier to decode the various record formats // without overreading if the records are corrupt. -type Fts5Data = Fts5Data1 /* sqlite3.c:216608:25 */ +type Fts5Data = Fts5Data1 /* sqlite3.c:219949:25 */ type Fts5DlidxIter1 = struct { FnLvl int32 FiSegid int32 FaLvl [1]Fts5DlidxLvl -} /* sqlite3.c:216609:9 */ +} /* sqlite3.c:219950:9 */ -type Fts5DlidxIter = Fts5DlidxIter1 /* sqlite3.c:216609:30 */ +type Fts5DlidxIter = Fts5DlidxIter1 /* sqlite3.c:219950:30 */ type Fts5DlidxLvl1 = struct { FpData uintptr FiOff int32 @@ -170658,17 +173439,17 @@ type Fts5DlidxLvl1 = struct { FiFirstOff int32 FiLeafPgno int32 FiRowid I64 -} /* sqlite3.c:216609:9 */ +} /* sqlite3.c:219950:9 */ -type Fts5DlidxLvl = Fts5DlidxLvl1 /* sqlite3.c:216610:29 */ +type Fts5DlidxLvl = Fts5DlidxLvl1 /* sqlite3.c:219951:29 */ type Fts5DlidxWriter1 = struct { Fpgno int32 FbPrevValid int32 FiPrev I64 Fbuf Fts5Buffer -} /* sqlite3.c:216611:9 */ +} /* sqlite3.c:219952:9 */ -type Fts5DlidxWriter = Fts5DlidxWriter1 /* sqlite3.c:216611:32 */ +type Fts5DlidxWriter = Fts5DlidxWriter1 /* sqlite3.c:219952:32 */ type Fts5Iter1 = struct { Fbase Fts5IndexIter FpIndex uintptr @@ -170682,18 +173463,18 @@ type Fts5Iter1 = struct { FiSwitchRowid I64 FaFirst uintptr FaSeg [1]Fts5SegIter -} /* sqlite3.c:216612:9 */ +} /* sqlite3.c:219953:9 */ -type Fts5Iter = Fts5Iter1 /* sqlite3.c:216612:25 */ +type Fts5Iter = Fts5Iter1 /* sqlite3.c:219953:25 */ type Fts5PageWriter1 = struct { Fpgno int32 FiPrevPgidx int32 Fbuf Fts5Buffer Fpgidx Fts5Buffer Fterm Fts5Buffer -} /* sqlite3.c:216613:9 */ +} /* sqlite3.c:219954:9 */ -type Fts5PageWriter = Fts5PageWriter1 /* sqlite3.c:216613:31 */ +type Fts5PageWriter = Fts5PageWriter1 /* sqlite3.c:219954:31 */ type Fts5SegIter1 = struct { FpSeg uintptr Fflags int32 @@ -170716,18 +173497,18 @@ type Fts5SegIter1 = struct { FnPos int32 FbDel U8 _ [3]byte -} /* sqlite3.c:216612:9 */ +} /* sqlite3.c:219953:9 */ -type Fts5SegIter = Fts5SegIter1 /* sqlite3.c:216614:28 */ +type Fts5SegIter = Fts5SegIter1 /* sqlite3.c:219955:28 */ type Fts5DoclistIter1 = struct { FaEof uintptr FiRowid I64 FaPoslist uintptr FnPoslist int32 FnSize int32 -} /* sqlite3.c:216615:9 */ +} /* sqlite3.c:219956:9 */ -type Fts5DoclistIter = Fts5DoclistIter1 /* sqlite3.c:216615:32 */ +type Fts5DoclistIter = Fts5DoclistIter1 /* sqlite3.c:219956:32 */ type Fts5SegWriter1 = struct { FiSegid int32 _ [4]byte @@ -170744,9 +173525,9 @@ type Fts5SegWriter1 = struct { Fbtterm Fts5Buffer FiBtPage int32 _ [4]byte -} /* sqlite3.c:216616:9 */ +} /* sqlite3.c:219957:9 */ -type Fts5SegWriter = Fts5SegWriter1 /* sqlite3.c:216616:30 */ +type Fts5SegWriter = Fts5SegWriter1 /* sqlite3.c:219957:30 */ type Fts5Structure1 = struct { FnRef int32 _ [4]byte @@ -170754,38 +173535,38 @@ type Fts5Structure1 = struct { FnSegment int32 FnLevel int32 FaLevel [1]Fts5StructureLevel -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5Structure = Fts5Structure1 /* sqlite3.c:216617:30 */ +type Fts5Structure = Fts5Structure1 /* sqlite3.c:219958:30 */ type Fts5StructureLevel1 = struct { FnMerge int32 FnSeg int32 FaSeg uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5StructureLevel = Fts5StructureLevel1 /* sqlite3.c:216618:35 */ +type Fts5StructureLevel = Fts5StructureLevel1 /* sqlite3.c:219959:35 */ type Fts5StructureSegment1 = struct { FiSegid int32 FpgnoFirst int32 FpgnoLast int32 -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5StructureSegment = Fts5StructureSegment1 /* sqlite3.c:216619:37 */ +type Fts5StructureSegment = Fts5StructureSegment1 /* sqlite3.c:219960:37 */ type Fts5CResult1 = struct { FiFirst U16 FbTermEq U8 _ [1]byte -} /* sqlite3.c:216612:9 */ +} /* sqlite3.c:219953:9 */ -type Fts5CResult = Fts5CResult1 /* sqlite3.c:216729:28 */ +type Fts5CResult = Fts5CResult1 /* sqlite3.c:220070:28 */ -func fts5PutU16(tls *libc.TLS, aOut uintptr, iVal U16) { /* sqlite3.c:216908:13: */ +func fts5PutU16(tls *libc.TLS, aOut uintptr, iVal U16) { /* sqlite3.c:220249:13: */ *(*U8)(unsafe.Pointer(aOut)) = (U8(int32(iVal) >> 8)) *(*U8)(unsafe.Pointer(aOut + 1)) = (U8(int32(iVal) & 0xFF)) } -func fts5GetU16(tls *libc.TLS, aIn uintptr) U16 { /* sqlite3.c:216913:12: */ +func fts5GetU16(tls *libc.TLS, aIn uintptr) U16 { /* sqlite3.c:220254:12: */ return (U16((int32(U16(*(*U8)(unsafe.Pointer(aIn)))) << 8) + int32(*(*U8)(unsafe.Pointer(aIn + 1))))) } @@ -170793,7 +173574,7 @@ func fts5GetU16(tls *libc.TLS, aIn uintptr) U16 { /* sqlite3.c:216913:12: */ // // If an OOM error is encountered, return NULL and set the error code in // the Fts5Index handle passed as the first argument. -func fts5IdxMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:216923:13: */ +func fts5IdxMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:220264:13: */ return sqlite3Fts5MallocZero(tls, (p + 52 /* &.rc */), nByte) } @@ -170811,7 +173592,7 @@ func fts5IdxMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* s // +ve if pRight is smaller than pLeft. In other words: // // res = *pLeft - *pRight -func fts5BufferCompare(tls *libc.TLS, pLeft uintptr, pRight uintptr) int32 { /* sqlite3.c:216955:12: */ +func fts5BufferCompare(tls *libc.TLS, pLeft uintptr, pRight uintptr) int32 { /* sqlite3.c:220296:12: */ var nCmp int32 = func() int32 { if ((*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn) < ((*Fts5Buffer)(unsafe.Pointer(pRight)).Fn) { return (*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn @@ -170832,7 +173613,7 @@ func fts5BufferCompare(tls *libc.TLS, pLeft uintptr, pRight uintptr) int32 { /* }() } -func fts5LeafFirstTermOff(tls *libc.TLS, pLeaf uintptr) int32 { /* sqlite3.c:216961:12: */ +func fts5LeafFirstTermOff(tls *libc.TLS, pLeaf uintptr) int32 { /* sqlite3.c:220302:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -170843,7 +173624,7 @@ func fts5LeafFirstTermOff(tls *libc.TLS, pLeaf uintptr) int32 { /* sqlite3.c:216 } // Close the read-only blob handle, if it is open. -func sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) { /* sqlite3.c:216970:13: */ +func sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) { /* sqlite3.c:220311:13: */ if (*Fts5Index)(unsafe.Pointer(p)).FpReader != 0 { var pReader uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpReader (*Fts5Index)(unsafe.Pointer(p)).FpReader = uintptr(0) @@ -170855,7 +173636,7 @@ func sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) { /* sqlite3.c:216970 // // If an error occurs, NULL is returned and an error left in the // Fts5Index object. -func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:216984:17: */ +func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:220325:17: */ var pRet uintptr = uintptr(0) if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { var rc int32 = SQLITE_OK @@ -170882,7 +173663,7 @@ func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2 if ((*Fts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0)) && (rc == SQLITE_OK) { var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig rc = Xsqlite3_blob_open(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, - (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl, ts+37701 /* "block" */, iRowid, 0, (p + 56 /* &.pReader */)) + (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl, ts+38209 /* "block" */, iRowid, 0, (p + 56 /* &.pReader */)) } // If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls @@ -170897,7 +173678,7 @@ func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2 if rc == SQLITE_OK { var aOut uintptr = uintptr(0) // Read blob data into this buffer var nByte int32 = Xsqlite3_blob_bytes(tls, (*Fts5Index)(unsafe.Pointer(p)).FpReader) - var nAlloc Sqlite3_int64 = (Sqlite3_int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64(nByte)) + FTS5_DATA_PADDING)) + var nAlloc Sqlite3_int64 = (Sqlite3_int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64(nByte)) + uint64(FTS5_DATA_PADDING))) pRet = Xsqlite3_malloc64(tls, uint64(nAlloc)) if pRet != 0 { (*Fts5Data)(unsafe.Pointer(pRet)).Fnn = nByte @@ -170928,11 +173709,11 @@ func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2 // Release a reference to data record returned by an earlier call to // fts5DataRead(). -func fts5DataRelease(tls *libc.TLS, pData uintptr) { /* sqlite3.c:217057:13: */ +func fts5DataRelease(tls *libc.TLS, pData uintptr) { /* sqlite3.c:220398:13: */ Xsqlite3_free(tls, pData) } -func fts5LeafRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:217061:17: */ +func fts5LeafRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:220402:17: */ var pRet uintptr = fts5DataRead(tls, p, iRowid) if pRet != 0 { if ((*Fts5Data)(unsafe.Pointer(pRet)).Fnn < 4) || ((*Fts5Data)(unsafe.Pointer(pRet)).FszLeaf > (*Fts5Data)(unsafe.Pointer(pRet)).Fnn) { @@ -170944,7 +173725,7 @@ func fts5LeafRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:2 return pRet } -func fts5IndexPrepareStmt(tls *libc.TLS, p uintptr, ppStmt uintptr, zSql uintptr) int32 { /* sqlite3.c:217073:12: */ +func fts5IndexPrepareStmt(tls *libc.TLS, p uintptr, ppStmt uintptr, zSql uintptr) int32 { /* sqlite3.c:220414:12: */ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { if zSql != 0 { (*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fdb, zSql, -1, @@ -170959,7 +173740,7 @@ func fts5IndexPrepareStmt(tls *libc.TLS, p uintptr, ppStmt uintptr, zSql uintptr } // INSERT OR REPLACE a record into the %_data table. -func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData int32) { /* sqlite3.c:217095:13: */ +func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData int32) { /* sqlite3.c:220436:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -170970,7 +173751,7 @@ func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData in if (*Fts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig fts5IndexPrepareStmt(tls, p, (p + 64 /* &.pWriter */), Xsqlite3_mprintf(tls, - ts+37707, /* "REPLACE INTO '%q..." */ + ts+38215, /* "REPLACE INTO '%q..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 { return @@ -170987,7 +173768,7 @@ func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData in // Execute the following SQL: // // DELETE FROM %_data WHERE id BETWEEN $iFirst AND $iLast -func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) { /* sqlite3.c:217119:13: */ +func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) { /* sqlite3.c:220460:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -170998,7 +173779,7 @@ func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) { /* sqlite if (*Fts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig var zSql uintptr = Xsqlite3_mprintf(tls, - ts+37758, /* "DELETE FROM '%q'..." */ + ts+38266, /* "DELETE FROM '%q'..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) if fts5IndexPrepareStmt(tls, p, (p+72 /* &.pDeleter */), zSql) != 0 { return @@ -171012,7 +173793,7 @@ func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) { /* sqlite } // Remove all records associated with segment iSegid. -func fts5DataRemoveSegment(tls *libc.TLS, p uintptr, iSegid int32) { /* sqlite3.c:217140:13: */ +func fts5DataRemoveSegment(tls *libc.TLS, p uintptr, iSegid int32) { /* sqlite3.c:220481:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -171022,7 +173803,7 @@ func fts5DataRemoveSegment(tls *libc.TLS, p uintptr, iSegid int32) { /* sqlite3. if (*Fts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig fts5IndexPrepareStmt(tls, p, (p + 88 /* &.pIdxDeleter */), Xsqlite3_mprintf(tls, - ts+37807, /* "DELETE FROM '%q'..." */ + ts+38315, /* "DELETE FROM '%q'..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -171034,7 +173815,7 @@ func fts5DataRemoveSegment(tls *libc.TLS, p uintptr, iSegid int32) { /* sqlite3. // Release a reference to an Fts5Structure object returned by an earlier // call to fts5StructureRead() or fts5StructureDecode(). -func fts5StructureRelease(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:217162:13: */ +func fts5StructureRelease(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:220503:13: */ if (pStruct != 0) && (0 >= (libc.PreDecInt32(&(*Fts5Structure)(unsafe.Pointer(pStruct)).FnRef, 1))) { var i int32 @@ -171045,7 +173826,7 @@ func fts5StructureRelease(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:217162: } } -func fts5StructureRef(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:217173:13: */ +func fts5StructureRef(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:220514:13: */ (*Fts5Structure)(unsafe.Pointer(pStruct)).FnRef++ } @@ -171059,7 +173840,7 @@ func fts5StructureRef(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:217173:13: // If an error occurs, *ppOut is set to NULL and an SQLite error code // returned. Otherwise, *ppOut is set to point to the new object and // SQLITE_OK returned. -func fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie uintptr, ppOut uintptr) int32 { /* sqlite3.c:217189:12: */ +func fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie uintptr, ppOut uintptr) int32 { /* sqlite3.c:220530:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -171151,7 +173932,7 @@ func fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie uin } // -func fts5StructureAddLevel(tls *libc.TLS, pRc uintptr, ppStruct uintptr) { /* sqlite3.c:217280:13: */ +func fts5StructureAddLevel(tls *libc.TLS, pRc uintptr, ppStruct uintptr) { /* sqlite3.c:220621:13: */ if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { var pStruct uintptr = *(*uintptr)(unsafe.Pointer(ppStruct)) var nLevel int32 = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel @@ -171170,7 +173951,7 @@ func fts5StructureAddLevel(tls *libc.TLS, pRc uintptr, ppStruct uintptr) { /* sq // Extend level iLvl so that there is room for at least nExtra more // segments. -func fts5StructureExtendLevel(tls *libc.TLS, pRc uintptr, pStruct uintptr, iLvl int32, nExtra int32, bInsert int32) { /* sqlite3.c:217304:13: */ +func fts5StructureExtendLevel(tls *libc.TLS, pRc uintptr, pStruct uintptr, iLvl int32, nExtra int32, bInsert int32) { /* sqlite3.c:220645:13: */ if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { var pLvl uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iLvl)*16) var aNew uintptr @@ -171193,7 +173974,7 @@ func fts5StructureExtendLevel(tls *libc.TLS, pRc uintptr, pStruct uintptr, iLvl } } -func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:217333:22: */ +func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:220674:22: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -171203,10 +173984,10 @@ func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c: // Configuration cookie var pData uintptr - pData = fts5DataRead(tls, p, FTS5_STRUCTURE_ROWID) + pData = fts5DataRead(tls, p, int64(FTS5_STRUCTURE_ROWID)) if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { // TODO: Do we need this if the leaf-index is appended? Probably... - libc.Xmemset(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0, FTS5_DATA_PADDING) + libc.Xmemset(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0, uint64(FTS5_DATA_PADDING)) (*Fts5Index)(unsafe.Pointer(p)).Frc = fts5StructureDecode(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, (*Fts5Data)(unsafe.Pointer(pData)).Fnn, bp /* &iCookie */, bp+8 /* &pRet */) if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (((*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz == 0) || ((*Fts5Config)(unsafe.Pointer(pConfig)).FiCookie != *(*int32)(unsafe.Pointer(bp /* iCookie */)))) { (*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5ConfigLoad(tls, pConfig, *(*int32)(unsafe.Pointer(bp /* iCookie */))) @@ -171221,7 +174002,7 @@ func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c: return *(*uintptr)(unsafe.Pointer(bp + 8 /* pRet */)) } -func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:217357:12: */ +func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:220698:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -171230,7 +174011,7 @@ func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:217357:12 if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Fts5Index)(unsafe.Pointer(p)).FpDataVersion == uintptr(0) { (*Fts5Index)(unsafe.Pointer(p)).Frc = fts5IndexPrepareStmt(tls, p, (p + 112 /* &.pDataVersion */), - Xsqlite3_mprintf(tls, ts+37847 /* "PRAGMA %Q.data_v..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb))) + Xsqlite3_mprintf(tls, ts+38355 /* "PRAGMA %Q.data_v..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb))) if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 { return int64(0) } @@ -171254,7 +174035,7 @@ func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:217357:12 // If an error occurs, NULL is returned and an error code left in the // Fts5Index handle. If an error has already occurred when this function // is called, it is a no-op. -func fts5StructureRead(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:217388:22: */ +func fts5StructureRead(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:220729:22: */ if (*Fts5Index)(unsafe.Pointer(p)).FpStruct == uintptr(0) { (*Fts5Index)(unsafe.Pointer(p)).FiStructVersion = fts5IndexDataVersion(tls, p) @@ -171271,7 +174052,7 @@ func fts5StructureRead(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:217388:2 return (*Fts5Index)(unsafe.Pointer(p)).FpStruct } -func fts5StructureInvalidate(tls *libc.TLS, p uintptr) { /* sqlite3.c:217427:13: */ +func fts5StructureInvalidate(tls *libc.TLS, p uintptr) { /* sqlite3.c:220768:13: */ if (*Fts5Index)(unsafe.Pointer(p)).FpStruct != 0 { fts5StructureRelease(tls, (*Fts5Index)(unsafe.Pointer(p)).FpStruct) (*Fts5Index)(unsafe.Pointer(p)).FpStruct = uintptr(0) @@ -171285,7 +174066,7 @@ func fts5StructureInvalidate(tls *libc.TLS, p uintptr) { /* sqlite3.c:217427:13: // // If an error occurs, leave an error code in the Fts5Index object. If an // error has already occurred, this function is a no-op. -func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { /* sqlite3.c:217470:13: */ +func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { /* sqlite3.c:220811:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -171333,19 +174114,19 @@ func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { /* sqlite3. } } - fts5DataWrite(tls, p, FTS5_STRUCTURE_ROWID, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn) + fts5DataWrite(tls, p, int64(FTS5_STRUCTURE_ROWID), (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn) sqlite3Fts5BufferFree(tls, bp /* &buf */) } } -func fts5SegmentSize(tls *libc.TLS, pSeg uintptr) int32 { /* sqlite3.c:217525:12: */ +func fts5SegmentSize(tls *libc.TLS, pSeg uintptr) int32 { /* sqlite3.c:220866:12: */ return ((1 + (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast) - (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst) } // Return a copy of index structure pStruct. Except, promote as many // segments as possible to level iPromote. If an OOM occurs, NULL is // returned. -func fts5StructurePromoteTo(tls *libc.TLS, p uintptr, iPromote int32, szPromote int32, pStruct uintptr) { /* sqlite3.c:217534:13: */ +func fts5StructurePromoteTo(tls *libc.TLS, p uintptr, iPromote int32, szPromote int32, pStruct uintptr) { /* sqlite3.c:220875:13: */ var il int32 var is int32 var pOut uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iPromote)*16) @@ -171388,7 +174169,7 @@ func fts5StructurePromoteTo(tls *libc.TLS, p uintptr, iPromote int32, szPromote // // If one or more segments are promoted, the structure object is updated // to reflect this. -func fts5StructurePromote(tls *libc.TLS, p uintptr, iLvl int32, pStruct uintptr) { /* sqlite3.c:217577:13: */ +func fts5StructurePromote(tls *libc.TLS, p uintptr, iLvl int32, pStruct uintptr) { /* sqlite3.c:220918:13: */ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { var iTst int32 var iPromote int32 = -1 @@ -171437,7 +174218,7 @@ func fts5StructurePromote(tls *libc.TLS, p uintptr, iLvl int32, pStruct uintptr) // Advance the iterator passed as the only argument. If the end of the // doclist-index page is reached, return non-zero. -func fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:217628:12: */ +func fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:220969:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -171473,7 +174254,7 @@ func fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:217628:1 } // Advance the iterator passed as the only argument. -func fts5DlidxIterNextR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:217660:12: */ +func fts5DlidxIterNextR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:221001:12: */ var pLvl uintptr = ((pIter + 8 /* &.aLvl */) + uintptr(iLvl)*32) if fts5DlidxLvlNext(tls, pLvl) != 0 { @@ -171494,7 +174275,7 @@ func fts5DlidxIterNextR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FbEof } -func fts5DlidxIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:217680:12: */ +func fts5DlidxIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:221021:12: */ return fts5DlidxIterNextR(tls, p, pIter, 0) } @@ -171507,7 +174288,7 @@ func fts5DlidxIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlit // // When this function is called pIter->iLeafPgno is the page number the // doclist is associated with (the one featuring the term). -func fts5DlidxIterFirst(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:217695:12: */ +func fts5DlidxIterFirst(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:221036:12: */ var i int32 for i = 0; i < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl; i++ { fts5DlidxLvlNext(tls, ((pIter + 8 /* &.aLvl */) + uintptr(i)*32)) @@ -171515,11 +174296,11 @@ func fts5DlidxIterFirst(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:21769 return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FbEof } -func fts5DlidxIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:217704:12: */ +func fts5DlidxIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:221045:12: */ return (libc.Bool32(((*Fts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK) || ((*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FbEof != 0))) } -func fts5DlidxIterLast(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:217708:13: */ +func fts5DlidxIterLast(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221049:13: */ var i int32 // Advance each level to the last entry on the last page @@ -171540,7 +174321,7 @@ func fts5DlidxIterLast(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:2 } // Move the iterator passed as the only argument to the previous entry. -func fts5DlidxLvlPrev(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:217731:12: */ +func fts5DlidxLvlPrev(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:221072:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -171602,7 +174383,7 @@ func fts5DlidxLvlPrev(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:217731:1 return (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof } -func fts5DlidxIterPrevR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:217780:12: */ +func fts5DlidxIterPrevR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:221121:12: */ var pLvl uintptr = ((pIter + 8 /* &.aLvl */) + uintptr(iLvl)*32) if fts5DlidxLvlPrev(tls, pLvl) != 0 { @@ -171625,12 +174406,12 @@ func fts5DlidxIterPrevR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FbEof } -func fts5DlidxIterPrev(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:217803:12: */ +func fts5DlidxIterPrev(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:221144:12: */ return fts5DlidxIterPrevR(tls, p, pIter, 0) } // Free a doclist-index iterator object allocated by fts5DlidxIterInit(). -func fts5DlidxIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:217810:13: */ +func fts5DlidxIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:221151:13: */ if pIter != 0 { var i int32 for i = 0; i < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl; i++ { @@ -171640,7 +174421,7 @@ func fts5DlidxIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:217810:13: * } } -func fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLeafPg int32) uintptr { /* sqlite3.c:217820:22: */ +func fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLeafPg int32) uintptr { /* sqlite3.c:221161:22: */ var pIter uintptr = uintptr(0) var i int32 var bDone int32 = 0 @@ -171682,16 +174463,16 @@ func fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLeaf return pIter } -func fts5DlidxIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:217867:12: */ +func fts5DlidxIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:221208:12: */ return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FiRowid } -func fts5DlidxIterPgno(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:217870:12: */ +func fts5DlidxIterPgno(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:221211:12: */ return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */))).FiLeafPgno } // Load the next leaf page into the segment iterator. -func fts5SegIterNextPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:217877:13: */ +func fts5SegIterNextPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221218:13: */ var pLeaf uintptr var pSeg uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) @@ -171721,7 +174502,7 @@ func fts5SegIterNextPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c // position list size field. Read the varint and return the number of bytes // read. Before returning, set *pnSz to the number of bytes in the position // list, and *pbDel to true if the delete flag is set, or false otherwise. -func fts5GetPoslistSize(tls *libc.TLS, p uintptr, pnSz uintptr, pbDel uintptr) int32 { /* sqlite3.c:217915:12: */ +func fts5GetPoslistSize(tls *libc.TLS, p uintptr, pnSz uintptr, pbDel uintptr) int32 { /* sqlite3.c:221256:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -171750,7 +174531,7 @@ func fts5GetPoslistSize(tls *libc.TLS, p uintptr, pnSz uintptr, pbDel uintptr) i // // Leave Fts5SegIter.iLeafOffset pointing to the first byte of the // position list content (if any). -func fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:217936:13: */ +func fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221277:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -171795,7 +174576,7 @@ func fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c } } -func fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:217965:13: */ +func fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221306:13: */ var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp // Buffer to read data from var iOff int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset @@ -171827,7 +174608,7 @@ func fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3. // accordingly and leaves (Fts5SegIter.iLeafOffset) set to the content of // the first position list. The position list belonging to document // (Fts5SegIter.iRowid). -func fts5SegIterLoadTerm(tls *libc.TLS, p uintptr, pIter uintptr, nKeep int32) { /* sqlite3.c:217998:13: */ +func fts5SegIterLoadTerm(tls *libc.TLS, p uintptr, pIter uintptr, nKeep int32) { /* sqlite3.c:221339:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -171861,7 +174642,7 @@ func fts5SegIterLoadTerm(tls *libc.TLS, p uintptr, pIter uintptr, nKeep int32) { fts5SegIterLoadRowid(tls, p, pIter) } -func fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218031:13: */ +func fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221372:13: */ if ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_REVERSE) != 0 { (*Fts5SegIter)(unsafe.Pointer(pIter)).FxNext = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr) @@ -171883,7 +174664,7 @@ func fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c: // // If an error occurs, Fts5Index.rc is set to an appropriate error code. If // an error has already occurred when this function is called, it is a no-op. -func fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) { /* sqlite3.c:218049:13: */ +func fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) { /* sqlite3.c:221390:13: */ if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { // This happens if the segment is being used as an input to an incremental // merge and all data has already been "trimmed". See function @@ -171924,7 +174705,7 @@ func fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) { /* // aRowidOffset[] and iRowidOffset variables. At this point the iterator // is in its regular state - Fts5SegIter.iLeafOffset points to the first // byte of the position list content associated with said rowid. -func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218097:13: */ +func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221438:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -171939,7 +174720,7 @@ func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq } for 1 != 0 { - *(*I64)(unsafe.Pointer(bp + 8 /* iDelta */)) = int64(0) + *(*U64)(unsafe.Pointer(bp + 8 /* iDelta */)) = uint64(0) if eDetail == FTS5_DETAIL_NONE { // todo @@ -171961,7 +174742,7 @@ func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq break } i = i + (int32(sqlite3Fts5GetVarint(tls, (a + uintptr(i)), bp+8 /* &iDelta */))) - *(*I64)(unsafe.Pointer(pIter + 104 /* &.iRowid */)) += (*(*I64)(unsafe.Pointer(bp + 8 /* iDelta */))) + *(*I64)(unsafe.Pointer(pIter + 104 /* &.iRowid */)) += I64((*(*U64)(unsafe.Pointer(bp + 8 /* iDelta */)))) // If necessary, grow the pIter->aRowidOffset[] array. if iRowidOffset >= (*Fts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { @@ -171983,7 +174764,7 @@ func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sq } // -func fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218150:13: */ +func fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221491:13: */ fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0) @@ -172029,7 +174810,7 @@ func fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sql // Return true if the iterator passed as the second argument currently // points to a delete marker. A delete marker is an entry with a 0 byte // position-list. -func fts5MultiIterIsEmpty(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:218202:12: */ +func fts5MultiIterIsEmpty(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:221543:12: */ var pSeg uintptr = ((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120) return (libc.Bool32((((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0)) && ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos == 0))) } @@ -172037,7 +174818,7 @@ func fts5MultiIterIsEmpty(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sq // Advance iterator pIter to the next entry. // // This version of fts5SegIterNext() is only used by reverse iterators. -func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused uintptr) { /* sqlite3.c:218212:13: */ +func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused uintptr) { /* sqlite3.c:221553:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -172046,7 +174827,7 @@ func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused u if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset > 0 { var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp var iOff int32 - // var iDelta I64 at bp, 8 + // var iDelta U64 at bp, 8 (*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset-- (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = *(*int32)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset)*4)) @@ -172056,7 +174837,7 @@ func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused u iOff = iOff + ((*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos) } sqlite3Fts5GetVarint(tls, (a + uintptr(iOff)), bp /* &iDelta */) - *(*I64)(unsafe.Pointer(pIter + 104 /* &.iRowid */)) -= (*(*I64)(unsafe.Pointer(bp /* iDelta */))) + *(*I64)(unsafe.Pointer(pIter + 104 /* &.iRowid */)) -= I64((*(*U64)(unsafe.Pointer(bp /* iDelta */)))) } else { fts5SegIterReverseNewPage(tls, p, pIter) } @@ -172066,7 +174847,7 @@ func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused u // // This version of fts5SegIterNext() is only used if detail=none and the // iterator is not a reverse direction iterator. -func fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:218246:13: */ +func fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:221587:13: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -172171,7 +174952,7 @@ next_none_eof: // If an error occurs, Fts5Index.rc is set to an appropriate error code. It // is not considered an error if the iterator reaches EOF. If an error has // already occurred when this function is called, it is a no-op. -func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:218318:13: */ +func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:221659:13: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -172276,9 +175057,6 @@ func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) // The following could be done by calling fts5SegIterLoadNPos(). But // this block is particularly performance critical, so equivalent // code is inlined. - // - // Later: Switched back to fts5SegIterLoadNPos() because it supports - // detail=none mode. Not ideal. // var nSz int32 at bp+40, 4 { @@ -172299,7 +175077,7 @@ func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) // Iterator pIter currently points to the first rowid in a doclist. This // function sets the iterator up so that iterates in reverse order through // the doclist. -func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218454:13: */ +func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221791:13: */ var pDlidx uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx var pLast uintptr = uintptr(0) var pgnoLast int32 = 0 @@ -172396,7 +175174,7 @@ func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c: // There is a doclist-index associated with the final term on the current // page. If the current term is the last term on the page, load the // doclist-index from disk and initialize an iterator at (pIter->pDlidx). -func fts5SegIterLoadDlidx(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218540:13: */ +func fts5SegIterLoadDlidx(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:221877:13: */ var iSeg int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FiSegid var bRev int32 = ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_REVERSE) var pLeaf uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf // Current leaf data @@ -172424,7 +175202,7 @@ func fts5SegIterLoadDlidx(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3. // iterator is left pointing to the smallest term in the segment that // is larger than the specified term, even if this term is not on the // current page. -func fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uintptr, nTerm int32) { /* sqlite3.c:218574:13: */ +func fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uintptr, nTerm int32) { /* sqlite3.c:221911:13: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -172660,7 +175438,7 @@ __31: fts5SegIterLoadNPos(tls, p, pIter) } -func fts5IdxSelectStmt(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:218701:21: */ +func fts5IdxSelectStmt(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:222038:21: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -172668,7 +175446,7 @@ func fts5IdxSelectStmt(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:218701:2 var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig fts5IndexPrepareStmt(tls, p, (p + 96 /* &.pIdxSelect */), Xsqlite3_mprintf(tls, - ts+37870, /* "SELECT pgno FROM..." */ + ts+38378, /* "SELECT pgno FROM..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*Fts5Index)(unsafe.Pointer(p)).FpIdxSelect @@ -172679,7 +175457,7 @@ func fts5IdxSelectStmt(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:218701:2 // // If an error occurs, Fts5Index.rc is set to an appropriate error code. If // an error has already occurred when this function is called, it is a no-op. -func fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pSeg uintptr, pIter uintptr) { /* sqlite3.c:218720:13: */ +func fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pSeg uintptr, pIter uintptr) { /* sqlite3.c:222057:13: */ var iPg int32 = 1 var bGe int32 = (flags & FTS5INDEX_QUERY_SCAN) var bDlidx int32 = 0 // True if there is a doclist-index @@ -172749,7 +175527,7 @@ func fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, f // // If an error occurs, Fts5Index.rc is set to an appropriate error code. If // an error has already occurred when this function is called, it is a no-op. -func fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pIter uintptr) { /* sqlite3.c:218803:13: */ +func fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pIter uintptr) { /* sqlite3.c:222140:13: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -172805,7 +175583,7 @@ func fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, f } // Zero the iterator passed as the only argument. -func fts5SegIterClear(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:218862:13: */ +func fts5SegIterClear(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:222199:13: */ sqlite3Fts5BufferFree(tls, (pIter + 88 /* &.term */)) fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf) fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf) @@ -172820,7 +175598,7 @@ func fts5SegIterClear(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:218862:13: */ // in the pIter->aSeg[] array that is (a) not at EOF, and (b) pointing // to a key that is a duplicate of another, higher priority, // segment-iterator in the pSeg->aSeg[] array. -func fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) int32 { /* sqlite3.c:218966:12: */ +func fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) int32 { /* sqlite3.c:222303:12: */ var i1 int32 // Index of left-hand Fts5SegIter var i2 int32 // Index of right-hand Fts5SegIter var iRes int32 @@ -172872,7 +175650,7 @@ func fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) int32 { /* // Move the seg-iter so that it points to the first rowid on page iLeafPgno. // It is an error if leaf iLeafPgno does not exist or contains no rowids. -func fts5SegIterGotoPage(tls *libc.TLS, p uintptr, pIter uintptr, iLeafPgno int32) { /* sqlite3.c:219020:13: */ +func fts5SegIterGotoPage(tls *libc.TLS, p uintptr, pIter uintptr, iLeafPgno int32) { /* sqlite3.c:222357:13: */ if iLeafPgno > (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FpgnoLast { (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8)) @@ -172902,7 +175680,7 @@ func fts5SegIterGotoPage(tls *libc.TLS, p uintptr, pIter uintptr, iLeafPgno int3 // Advance the iterator passed as the second argument until it is at or // past rowid iFrom. Regardless of the value of iFrom, the iterator is // always advanced at least once. -func fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:219058:13: */ +func fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:222395:13: */ var bRev int32 = ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & FTS5_SEGITER_REVERSE) var pDlidx uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx var iLeafPgno int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno @@ -172950,7 +175728,7 @@ func fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { } // Free the iterator object passed as the second argument. -func fts5MultiIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:219112:13: */ +func fts5MultiIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:222449:13: */ if pIter != 0 { var i int32 for i = 0; i < (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg; i++ { @@ -172961,7 +175739,7 @@ func fts5MultiIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:219112:13: * } } -func fts5MultiIterAdvanced(tls *libc.TLS, p uintptr, pIter uintptr, iChanged int32, iMinset int32) { /* sqlite3.c:219123:13: */ +func fts5MultiIterAdvanced(tls *libc.TLS, p uintptr, pIter uintptr, iChanged int32, iMinset int32) { /* sqlite3.c:222460:13: */ var i int32 for i = (((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iChanged) / 2); (i >= iMinset) && ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK); i = (i / 2) { var iEq int32 @@ -172982,7 +175760,7 @@ func fts5MultiIterAdvanced(tls *libc.TLS, p uintptr, pIter uintptr, iChanged int // If non-zero is returned, the caller should call fts5MultiIterAdvanced() // on the iterator instead. That function does the same as this one, except // that it deals with more complicated cases as well. -func fts5MultiIterAdvanceRowid(tls *libc.TLS, pIter uintptr, iChanged int32, ppFirst uintptr) int32 { /* sqlite3.c:219151:12: */ +func fts5MultiIterAdvanceRowid(tls *libc.TLS, pIter uintptr, iChanged int32, ppFirst uintptr) int32 { /* sqlite3.c:222488:12: */ var pNew uintptr = ((pIter + 96 /* &.aSeg */) + uintptr(iChanged)*120) if ((*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid == (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid) || @@ -173022,7 +175800,7 @@ func fts5MultiIterAdvanceRowid(tls *libc.TLS, pIter uintptr, iChanged int32, ppF } // Set the pIter->bEof variable based on the state of the sub-iterators. -func fts5MultiIterSetEof(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:219194:13: */ +func fts5MultiIterSetEof(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:222531:13: */ var pSeg uintptr = ((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120) (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof = (U8(libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf == uintptr(0)))) (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid @@ -173033,7 +175811,7 @@ func fts5MultiIterSetEof(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:219194:13: // If an error occurs, an error code is left in Fts5Index.rc. It is not // considered an error if the iterator reaches EOF, or if it is already at // EOF when this function is called. -func fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iFrom I64) { /* sqlite3.c:219207:13: */ +func fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iFrom I64) { /* sqlite3.c:222544:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -173068,7 +175846,7 @@ func fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iFr } } -func fts5MultiIterNext2(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:219245:13: */ +func fts5MultiIterNext2(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:222582:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -173091,12 +175869,12 @@ func fts5MultiIterNext2(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintp } } -func fts5IterSetOutputs_Noop(tls *libc.TLS, pUnused1 uintptr, pUnused2 uintptr) { /* sqlite3.c:219273:13: */ +func fts5IterSetOutputs_Noop(tls *libc.TLS, pUnused1 uintptr, pUnused2 uintptr) { /* sqlite3.c:222610:13: */ _ = pUnused1 _ = pUnused2 } -func fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) uintptr { /* sqlite3.c:219277:17: */ +func fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) uintptr { /* sqlite3.c:222614:17: */ var pNew uintptr var nSlot int32 // Power of two >= nSeg @@ -173115,7 +175893,7 @@ func fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) uintptr { /* sqlit return pNew } -func fts5PoslistCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:219299:13: */ +func fts5PoslistCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:222636:13: */ _ = pUnused if nChunk > 0 { @@ -173132,21 +175910,21 @@ type PoslistCallbackCtx1 = struct { FpColset uintptr FeState int32 _ [4]byte -} /* sqlite3.c:219311:9 */ +} /* sqlite3.c:222648:9 */ -type PoslistCallbackCtx = PoslistCallbackCtx1 /* sqlite3.c:219311:35 */ +type PoslistCallbackCtx = PoslistCallbackCtx1 /* sqlite3.c:222648:35 */ type PoslistOffsetsCtx1 = struct { FpBuf uintptr FpColset uintptr FiRead int32 FiWrite int32 -} /* sqlite3.c:219318:9 */ +} /* sqlite3.c:222655:9 */ -type PoslistOffsetsCtx = PoslistOffsetsCtx1 /* sqlite3.c:219318:34 */ +type PoslistOffsetsCtx = PoslistOffsetsCtx1 /* sqlite3.c:222655:34 */ // TODO: Make this more efficient! -func fts5IndexColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:219329:12: */ +func fts5IndexColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:222666:12: */ var i int32 for i = 0; i < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; i++ { if *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) == iCol { @@ -173156,7 +175934,7 @@ func fts5IndexColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* return 0 } -func fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:219337:13: */ +func fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:222674:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -173182,7 +175960,7 @@ func fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:219360:13: */ +func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:222697:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -173262,7 +176040,7 @@ func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, } } -func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { /* sqlite3.c:219412:13: */ +func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { /* sqlite3.c:222749:13: */ var nRem int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos // Number of bytes still to come var pData uintptr = uintptr(0) var pChunk uintptr = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)) @@ -173275,7 +176053,7 @@ func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChu var pgno int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno var pgnoSave int32 = 0 - // This function does notmwork with detail=none databases. + // This function does not work with detail=none databases. if ((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fflags & FTS5_SEGITER_REVERSE) == 0 { pgnoSave = (pgno + 1) @@ -173287,6 +176065,9 @@ func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChu fts5DataRelease(tls, pData) if nRem <= 0 { break + } else if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg == uintptr(0) { + (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8)) + return } else { pgno++ pData = fts5LeafRead(tls, p, (((((I64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FiSegid)) << ((FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B) + FTS5_DATA_DLI_B)) + (I64((int64(0))) << (FTS5_DATA_PAGE_B + FTS5_DATA_HEIGHT_B))) + (I64((int64(0))) << (FTS5_DATA_PAGE_B))) + (I64(pgno)))) @@ -173313,7 +176094,7 @@ func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChu // function appends the position list data for the current entry to // buffer pBuf. It does not make a copy of the position-list size // field. -func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, pBuf uintptr) { /* sqlite3.c:219459:13: */ +func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, pBuf uintptr) { /* sqlite3.c:222799:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -173323,7 +176104,7 @@ func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, } return sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), pBuf, (uint32(((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos + FTS5_DATA_ZERO_PADDING) + (*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn))) }()) { - libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0, FTS5_DATA_ZERO_PADDING) + libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0, uint64(FTS5_DATA_ZERO_PADDING)) if pColset == uintptr(0) { fts5ChunkIterate(tls, p, pSeg, pBuf, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, int32) @@ -173353,72 +176134,78 @@ func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, } } -// IN/OUT parameter (*pa) points to a position list n bytes in size. If -// the position list contains entries for column iCol, then (*pa) is set -// to point to the sub-position-list for that column and the number of -// bytes in it returned. Or, if the argument position list does not -// contain any entries for column iCol, return 0. -func fts5IndexExtractCol(tls *libc.TLS, pa uintptr, n int32, iCol int32) int32 { /* sqlite3.c:219495:12: */ +// Parameter pPos points to a buffer containing a position list, size nPos. +// This function filters it according to pColset (which must be non-NULL) +// and sets pIter->base.pData/nData to point to the new position list. +// If memory is required for the new position list, use buffer pIter->poslist. +// Or, if the new position list is a contiguous subset of the input, set +// pIter->base.pData/nData to point directly to it. +// +// This function is a no-op if *pRc is other than SQLITE_OK when it is +// called. If an OOM error is encountered, *pRc is set to SQLITE_NOMEM +// before returning. +func fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos uintptr, nPos int32, pIter uintptr) { /* sqlite3.c:222840:13: */ bp := tls.Alloc(4) defer tls.Free(4) - *(*int32)(unsafe.Pointer(bp /* iCurrent */)) = 0 // Anything before the first 0x01 is col 0 - var p uintptr = *(*uintptr)(unsafe.Pointer(pa)) - var pEnd uintptr = (p + uintptr(n)) // One byte past end of position list - - for iCol > *(*int32)(unsafe.Pointer(bp /* iCurrent */)) { - // Advance pointer p until it points to pEnd or an 0x01 byte that is - // not part of a varint. Note that it is not possible for a negative - // or extremely large varint to occur within an uncorrupted position - // list. So the last byte of each varint may be assumed to have a clear - // 0x80 bit. - for int32(*(*U8)(unsafe.Pointer(p))) != 0x01 { - for (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) & 0x80) != 0 { - } - if p >= pEnd { - return 0 - } - } - *(*uintptr)(unsafe.Pointer(pa)) = libc.PostIncUintptr(&p, 1) - *(*int32)(unsafe.Pointer(bp /* iCurrent */)) = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) - if (*(*int32)(unsafe.Pointer(bp /* iCurrent */)) & 0x80) != 0 { - p-- - p += uintptr(sqlite3Fts5GetVarint32(tls, p, bp /* &iCurrent */)) - } - } - if iCol != *(*int32)(unsafe.Pointer(bp /* iCurrent */)) { - return 0 - } - - // Advance pointer p until it points to pEnd or an 0x01 byte that is - // not part of a varint - for (p < pEnd) && (int32(*(*U8)(unsafe.Pointer(p))) != 0x01) { - for (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) & 0x80) != 0 { - } - } - - return (int32((int64(p) - (int64(*(*uintptr)(unsafe.Pointer(pa))))) / 1)) -} - -func fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos uintptr, nPos int32, pBuf uintptr) { /* sqlite3.c:219532:13: */ - bp := tls.Alloc(8) - defer tls.Free(8) - if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - var i int32 - sqlite3Fts5BufferZero(tls, pBuf) - for i = 0; i < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; i++ { - *(*uintptr)(unsafe.Pointer(bp /* pSub */)) = pPos - var nSub int32 = fts5IndexExtractCol(tls, bp /* &pSub */, nPos, *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4))) - if nSub != 0 { - sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(nSub), *(*uintptr)(unsafe.Pointer(bp /* pSub */))) + var p uintptr = pPos + var aCopy uintptr = p + var pEnd uintptr = (p + uintptr(nPos)) // One byte past end of position list + var i int32 = 0 + *(*int32)(unsafe.Pointer(bp /* iCurrent */)) = 0 + + if ((*Fts5Colset)(unsafe.Pointer(pColset)).FnCol > 1) && (sqlite3Fts5BufferSize(tls, pRc, (pIter+32 /* &.poslist */), uint32(nPos)) != 0) { + return + } + + for 1 != 0 { + for *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) < *(*int32)(unsafe.Pointer(bp /* iCurrent */)) { + i++ + if i == (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol { + (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp + (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn + return + } + } + + // Advance pointer p until it points to pEnd or an 0x01 byte that is + // not part of a varint + for (p < pEnd) && (int32(*(*U8)(unsafe.Pointer(p))) != 0x01) { + for (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) & 0x80) != 0 { + } + } + + if *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) == *(*int32)(unsafe.Pointer(bp /* iCurrent */)) { + if (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol == 1 { + (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = aCopy + (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (int32((int64(p) - int64(aCopy)) / 1)) + return + } + { + libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((pIter + 32 /* &.poslist */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pIter + 32 /* &.poslist */))).Fn)), aCopy, (uint64((int64(p) - int64(aCopy)) / 1))) + *(*int32)(unsafe.Pointer((pIter + 32 /* &.poslist */) + 8 /* &.n */)) += int32(((int64(p) - int64(aCopy)) / 1)) + } + + } + if p == pEnd { + (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp + (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn + return + } + aCopy = libc.PostIncUintptr(&p, 1) + *(*int32)(unsafe.Pointer(bp /* iCurrent */)) = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) + if (*(*int32)(unsafe.Pointer(bp /* iCurrent */)) & 0x80) != 0 { + p-- + p += uintptr(sqlite3Fts5GetVarint32(tls, p, bp /* &iCurrent */)) } } } + } // xSetOutputs callback used by detail=none tables. -func fts5IterSetOutputs_None(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219554:13: */ +func fts5IterSetOutputs_None(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:222900:13: */ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos @@ -173426,7 +176213,7 @@ func fts5IterSetOutputs_None(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sq // xSetOutputs callback used by detail=full and detail=col tables when no // column filters are specified. -func fts5IterSetOutputs_Nocolset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219564:13: */ +func fts5IterSetOutputs_Nocolset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:222910:13: */ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos @@ -173446,7 +176233,7 @@ func fts5IterSetOutputs_Nocolset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { / // xSetOutputs callback used when the Fts5Colset object has nCol==0 (match // against no columns at all). -func fts5IterSetOutputs_ZeroColset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219589:13: */ +func fts5IterSetOutputs_ZeroColset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:222935:13: */ _ = pSeg (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = 0 } @@ -173454,7 +176241,7 @@ func fts5IterSetOutputs_ZeroColset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { // xSetOutputs callback used by detail=col when there is a column filter // and there are 100 or more columns. Also called as a fallback from // fts5IterSetOutputs_Col100 if the column-list spans more than one page. -func fts5IterSetOutputs_Col(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219599:13: */ +func fts5IterSetOutputs_Col(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:222945:13: */ sqlite3Fts5BufferZero(tls, (pIter + 32 /* &.poslist */)) fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset, (pIter + 32 /* &.poslist */)) (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid @@ -173470,7 +176257,7 @@ func fts5IterSetOutputs_Col(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sql // // The last point is to ensure all column numbers are stored as // single-byte varints. -func fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219617:13: */ +func fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:222963:13: */ var a uintptr var pEnd uintptr var iPrev int32 @@ -173532,27 +176319,17 @@ __2: } // xSetOutputs callback used by detail=full when there is a column filter. -func fts5IterSetOutputs_Full(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219657:13: */ - bp := tls.Alloc(8) - defer tls.Free(8) - +func fts5IterSetOutputs_Full(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:223003:13: */ var pColset uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid if ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos) <= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf { // All data is stored on the current page. Populate the output // variables to point into the body of the page object. - *(*uintptr)(unsafe.Pointer(bp /* a */)) = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)) - if (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol == 1 { - (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = fts5IndexExtractCol(tls, bp /* &a */, (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos, *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */)))) - (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = *(*uintptr)(unsafe.Pointer(bp /* a */)) - } else { - var pRc uintptr = ((*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex + 52 /* &.rc */) - sqlite3Fts5BufferZero(tls, (pIter + 32 /* &.poslist */)) - fts5IndexExtractColset(tls, pRc, pColset, *(*uintptr)(unsafe.Pointer(bp /* a */)), (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos, (pIter + 32 /* &.poslist */)) - (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp - (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn - } + var a uintptr = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)) + var pRc uintptr = ((*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex + 52 /* &.rc */) + sqlite3Fts5BufferZero(tls, (pIter + 32 /* &.poslist */)) + fts5IndexExtractColset(tls, pRc, pColset, a, (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos, pIter) } else { // The data is distributed over two or more pages. Copy it into the // Fts5Iter.poslist buffer and then set the output pointer to point @@ -173564,7 +176341,7 @@ func fts5IterSetOutputs_Full(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sq } } -func fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) { /* sqlite3.c:219689:13: */ +func fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) { /* sqlite3.c:223028:13: */ if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { var pConfig uintptr = (*Fts5Index)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex)).FpConfig if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE { @@ -173608,7 +176385,7 @@ func fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) { /* sqlite3 // // The iterator initially points to the first term/rowid entry in the // iterated data. -func fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, pColset uintptr, pTerm uintptr, nTerm int32, iLevel int32, nSegment int32, ppOut uintptr) { /* sqlite3.c:219732:13: */ +func fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, pColset uintptr, pTerm uintptr, nTerm int32, iLevel int32, nSegment int32, ppOut uintptr) { /* sqlite3.c:223071:13: */ var nSeg int32 = 0 // Number of segment-iters in use var iIter int32 = 0 // var iSeg int32 // Used to iterate through segments @@ -173707,7 +176484,7 @@ func fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, pC // Create an Fts5Iter that iterates through the doclist provided // as the second argument. -func fts5MultiIterNew2(tls *libc.TLS, p uintptr, pData uintptr, bDesc int32, ppOut uintptr) { /* sqlite3.c:219831:13: */ +func fts5MultiIterNew2(tls *libc.TLS, p uintptr, pData uintptr, bDesc int32, ppOut uintptr) { /* sqlite3.c:223170:13: */ var pNew uintptr pNew = fts5MultiIterAlloc(tls, p, 2) if pNew != 0 { @@ -173740,7 +176517,7 @@ func fts5MultiIterNew2(tls *libc.TLS, p uintptr, pData uintptr, bDesc int32, ppO // Return true if the iterator is at EOF or if an error has occurred. // False otherwise. -func fts5MultiIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:219871:12: */ +func fts5MultiIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:223210:12: */ return (libc.Bool32(((*Fts5Index)(unsafe.Pointer(p)).Frc != 0) || ((*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof != 0))) } @@ -173748,13 +176525,13 @@ func fts5MultiIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite // Return the rowid of the entry that the iterator currently points // to. If the iterator points to EOF when this function is called the // results are undefined. -func fts5MultiIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:219883:12: */ +func fts5MultiIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:223222:12: */ return (*Fts5SegIter)(unsafe.Pointer((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120)).FiRowid } // Move the iterator to the next entry at or following iMatch. -func fts5MultiIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:219891:13: */ +func fts5MultiIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:223230:13: */ for 1 != 0 { var iRowid I64 fts5MultiIterNext(tls, p, pIter, 1, iMatch) @@ -173773,7 +176550,7 @@ func fts5MultiIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) // Return a pointer to a buffer containing the term associated with the // entry that the iterator currently points to. -func fts5MultiIterTerm(tls *libc.TLS, pIter uintptr, pn uintptr) uintptr { /* sqlite3.c:219910:17: */ +func fts5MultiIterTerm(tls *libc.TLS, pIter uintptr, pn uintptr) uintptr { /* sqlite3.c:223249:17: */ var p uintptr = ((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+1*4)).FiFirst)*120) *(*int32)(unsafe.Pointer(pn)) = (*Fts5SegIter)(unsafe.Pointer(p)).Fterm.Fn return (*Fts5SegIter)(unsafe.Pointer(p)).Fterm.Fp @@ -173786,7 +176563,7 @@ func fts5MultiIterTerm(tls *libc.TLS, pIter uintptr, pn uintptr) uintptr { /* sq // // If an error has already occurred, this function is a no-op. 0 is // returned in this case. -func fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) int32 { /* sqlite3.c:219925:12: */ +func fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) int32 { /* sqlite3.c:223264:12: */ bp := tls.Alloc(252) defer tls.Free(252) @@ -173828,7 +176605,7 @@ func fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) int32 { /* sql } // Discard all data currently cached in the hash-tables. -func fts5IndexDiscardData(tls *libc.TLS, p uintptr) { /* sqlite3.c:219982:13: */ +func fts5IndexDiscardData(tls *libc.TLS, p uintptr) { /* sqlite3.c:223321:13: */ if (*Fts5Index)(unsafe.Pointer(p)).FpHash != 0 { sqlite3Fts5HashClear(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash) @@ -173841,7 +176618,7 @@ func fts5IndexDiscardData(tls *libc.TLS, p uintptr) { /* sqlite3.c:219982:13: */ // // Buffer (pNew/) is guaranteed to be greater // than buffer (pOld/nOld). -func fts5PrefixCompress(tls *libc.TLS, nOld int32, pOld uintptr, pNew uintptr) int32 { /* sqlite3.c:219997:12: */ +func fts5PrefixCompress(tls *libc.TLS, nOld int32, pOld uintptr, pNew uintptr) int32 { /* sqlite3.c:223336:12: */ var i int32 for i = 0; i < nOld; i++ { if int32(*(*U8)(unsafe.Pointer(pOld + uintptr(i)))) != int32(*(*U8)(unsafe.Pointer(pNew + uintptr(i)))) { @@ -173851,7 +176628,7 @@ func fts5PrefixCompress(tls *libc.TLS, nOld int32, pOld uintptr, pNew uintptr) i return i } -func fts5WriteDlidxClear(tls *libc.TLS, p uintptr, pWriter uintptr, bFlush int32) { /* sqlite3.c:220005:13: */ +func fts5WriteDlidxClear(tls *libc.TLS, p uintptr, pWriter uintptr, bFlush int32) { /* sqlite3.c:223344:13: */ var i int32 for i = 0; i < (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx; i++ { @@ -173872,7 +176649,7 @@ func fts5WriteDlidxClear(tls *libc.TLS, p uintptr, pWriter uintptr, bFlush int32 // Grow the pWriter->aDlidx[] array to at least nLvl elements in size. // Any new array elements are zeroed before returning. -func fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) int32 { /* sqlite3.c:220031:12: */ +func fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) int32 { /* sqlite3.c:223370:12: */ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (nLvl >= (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx) { var aDlidx uintptr = Xsqlite3_realloc64(tls, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, (uint64(uint64(unsafe.Sizeof(Fts5DlidxWriter{})) * uint64(nLvl)))) @@ -173891,7 +176668,7 @@ func fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) i // If the current doclist-index accumulating in pWriter->aDlidx[] is large // enough, flush it to disk and return 1. Otherwise discard it and return // zero. -func fts5WriteFlushDlidx(tls *libc.TLS, p uintptr, pWriter uintptr) int32 { /* sqlite3.c:220057:12: */ +func fts5WriteFlushDlidx(tls *libc.TLS, p uintptr, pWriter uintptr) int32 { /* sqlite3.c:223396:12: */ var bFlag int32 = 0 // If there were FTS5_MIN_DLIDX_SIZE or more empty leaf pages written @@ -173913,7 +176690,7 @@ func fts5WriteFlushDlidx(tls *libc.TLS, p uintptr, pWriter uintptr) int32 { /* s // it. // // Fts5SegWriter.btterm currently contains the first term on page iBtPage. -func fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:220081:13: */ +func fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:223420:13: */ var bFlag int32 if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage == 0 { @@ -173946,7 +176723,7 @@ func fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3 // // If an error occurs, an error code is left in Fts5Index.rc. If an error // has already occurred when this function is called, it is a no-op. -func fts5WriteBtreeTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:220110:13: */ +func fts5WriteBtreeTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:223449:13: */ fts5WriteFlushBtree(tls, p, pWriter) if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), (pWriter + 96 /* &.btterm */), nTerm, pTerm) @@ -173956,7 +176733,7 @@ func fts5WriteBtreeTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, // This function is called when flushing a leaf page that contains no // terms at all to disk. -func fts5WriteBtreeNoTerm(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:220126:13: */ +func fts5WriteBtreeNoTerm(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:223465:13: */ // If there were no rowids on the leaf page either and the doclist-index // has already been started, append an 0x00 byte to it. if ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0) && ((*Fts5DlidxWriter)(unsafe.Pointer((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx)).Fbuf.Fn > 0) { @@ -173969,7 +176746,7 @@ func fts5WriteBtreeNoTerm(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnEmpty++ } -func fts5DlidxExtractFirstRowid(tls *libc.TLS, pBuf uintptr) I64 { /* sqlite3.c:220142:12: */ +func fts5DlidxExtractFirstRowid(tls *libc.TLS, pBuf uintptr) I64 { /* sqlite3.c:223481:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -173985,7 +176762,7 @@ func fts5DlidxExtractFirstRowid(tls *libc.TLS, pBuf uintptr) I64 { /* sqlite3.c: // Rowid iRowid has just been appended to the current leaf page. It is the // first on the page. This function appends an appropriate entry to the current // doclist-index. -func fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:220156:13: */ +func fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:223495:13: */ var i int32 var bDone int32 = 0 @@ -174045,7 +176822,7 @@ func fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) } } -func fts5WriteFlushLeaf(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:220216:13: */ +func fts5WriteFlushLeaf(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:223555:13: */ var pPage uintptr = (pWriter + 8 /* &.writer */) var iRowid I64 @@ -174081,14 +176858,14 @@ func fts5WriteFlushLeaf(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3. (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage = U8(1) } -var zero = [4]U8{U8(0x00), U8(0x00), U8(0x00), U8(0x00)} /* sqlite3.c:220217:19 */ +var zero = [4]U8{U8(0x00), U8(0x00), U8(0x00), U8(0x00)} /* sqlite3.c:223556:19 */ // Append term pTerm/nTerm to the segment being written by the writer passed // as the second argument. // // If an error occurs, set the Fts5Index.rc error code. If an error has // already occurred, this function is a no-op. -func fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:220262:13: */ +func fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:223601:13: */ var nPrefix int32 // Bytes of prefix compression for term var pPage uintptr = (pWriter + 8 /* &.writer */) var pPgidx uintptr = (pWriter + 8 /* &.writer */ + 24 /* &.pgidx */) @@ -174164,7 +176941,7 @@ func fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, } // Append a rowid and position-list size field to the writers output. -func fts5WriteAppendRowid(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:220343:13: */ +func fts5WriteAppendRowid(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:223682:13: */ if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { var pPage uintptr = (pWriter + 8 /* &.writer */) @@ -174193,7 +176970,7 @@ func fts5WriteAppendRowid(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) } } -func fts5WriteAppendPoslistData(tls *libc.TLS, p uintptr, pWriter uintptr, aData uintptr, nData int32) { /* sqlite3.c:220376:13: */ +func fts5WriteAppendPoslistData(tls *libc.TLS, p uintptr, pWriter uintptr, aData uintptr, nData int32) { /* sqlite3.c:223715:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -174222,7 +176999,7 @@ func fts5WriteAppendPoslistData(tls *libc.TLS, p uintptr, pWriter uintptr, aData // Flush any data cached by the writer object to the database. Free any // allocations associated with the writer. -func fts5WriteFinish(tls *libc.TLS, p uintptr, pWriter uintptr, pnLeaf uintptr) { /* sqlite3.c:220410:13: */ +func fts5WriteFinish(tls *libc.TLS, p uintptr, pWriter uintptr, pnLeaf uintptr) { /* sqlite3.c:223749:13: */ var i int32 var pLeaf uintptr = (pWriter + 8 /* &.writer */) if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -174246,7 +177023,7 @@ func fts5WriteFinish(tls *libc.TLS, p uintptr, pWriter uintptr, pnLeaf uintptr) Xsqlite3_free(tls, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx) } -func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { /* sqlite3.c:220438:13: */ +func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { /* sqlite3.c:223777:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -174267,7 +177044,7 @@ func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { /* if (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig fts5IndexPrepareStmt(tls, p, (p + 80 /* &.pIdxWriter */), Xsqlite3_mprintf(tls, - ts+37954, /* "INSERT INTO '%q'..." */ + ts+38462, /* "INSERT INTO '%q'..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))) } @@ -174286,7 +177063,7 @@ func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { /* // Iterator pIter was used to iterate through the input segments of on an // incremental merge operation. This function is called if the incremental // merge step has finished but the input has not been completely exhausted. -func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:220485:13: */ +func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:223824:13: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -174355,13 +177132,13 @@ func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:22 sqlite3Fts5BufferFree(tls, bp /* &buf */) } -func fts5MergeChunkCallback(tls *libc.TLS, p uintptr, pCtx uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:220551:13: */ +func fts5MergeChunkCallback(tls *libc.TLS, p uintptr, pCtx uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:223890:13: */ var pWriter uintptr = pCtx fts5WriteAppendPoslistData(tls, p, pWriter, pChunk, nChunk) } // -func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32, pnRem uintptr) { /* sqlite3.c:220563:13: */ +func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32, pnRem uintptr) { /* sqlite3.c:223902:13: */ bp := tls.Alloc(148) defer tls.Free(148) @@ -174520,7 +177297,7 @@ func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32, // Do up to nPg pages of automerge work on the index. // // Return true if any changes were actually made, or false otherwise. -func fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin int32) int32 { /* sqlite3.c:220712:12: */ +func fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin int32) int32 { /* sqlite3.c:224051:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -174570,7 +177347,7 @@ func fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin // // If an error occurs, set the Fts5Index.rc error code. If an error has // already occurred, this function is a no-op. -func fts5IndexAutomerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nLeaf int32) { /* sqlite3.c:220771:13: */ +func fts5IndexAutomerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nLeaf int32) { /* sqlite3.c:224110:13: */ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnAutomerge > 0) { var pStruct uintptr = *(*uintptr)(unsafe.Pointer(ppStruct)) var nWrite U64 // Initial value of write-counter @@ -174587,7 +177364,7 @@ func fts5IndexAutomerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nLeaf int32) } } -func fts5IndexCrisismerge(tls *libc.TLS, p uintptr, ppStruct uintptr) { /* sqlite3.c:220792:13: */ +func fts5IndexCrisismerge(tls *libc.TLS, p uintptr, ppStruct uintptr) { /* sqlite3.c:224131:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -174604,7 +177381,7 @@ func fts5IndexCrisismerge(tls *libc.TLS, p uintptr, ppStruct uintptr) { /* sqlit *(*uintptr)(unsafe.Pointer(ppStruct)) = *(*uintptr)(unsafe.Pointer(bp /* pStruct */)) } -func fts5IndexReturn(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:220810:12: */ +func fts5IndexReturn(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:224149:12: */ var rc int32 = (*Fts5Index)(unsafe.Pointer(p)).Frc (*Fts5Index)(unsafe.Pointer(p)).Frc = SQLITE_OK return rc @@ -174613,14 +177390,14 @@ func fts5IndexReturn(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:220810:12: * type Fts5FlushCtx1 = struct { FpIdx uintptr Fwriter Fts5SegWriter -} /* sqlite3.c:220816:9 */ +} /* sqlite3.c:224155:9 */ -type Fts5FlushCtx = Fts5FlushCtx1 /* sqlite3.c:220816:29 */ +type Fts5FlushCtx = Fts5FlushCtx1 /* sqlite3.c:224155:29 */ // Buffer aBuf[] contains a list of varints, all small enough to fit // in a 32-bit integer. Return the size of the largest prefix of this // list nMax bytes or less in size. -func fts5PoslistPrefix(tls *libc.TLS, aBuf uintptr, nMax int32) int32 { /* sqlite3.c:220827:12: */ +func fts5PoslistPrefix(tls *libc.TLS, aBuf uintptr, nMax int32) int32 { /* sqlite3.c:224166:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -174645,7 +177422,7 @@ func fts5PoslistPrefix(tls *libc.TLS, aBuf uintptr, nMax int32) int32 { /* sqlit // // If an error occurs, set the Fts5Index.rc error code. If an error has // already occurred, this function is a no-op. -func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:220848:13: */ +func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:224187:13: */ bp := tls.Alloc(176) defer tls.Free(176) @@ -174823,7 +177600,7 @@ func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:220848:13: */ } // Flush any data stored in the in-memory hash tables to the database. -func fts5IndexFlush(tls *libc.TLS, p uintptr) { /* sqlite3.c:221002:13: */ +func fts5IndexFlush(tls *libc.TLS, p uintptr) { /* sqlite3.c:224341:13: */ // Unless it is empty, flush the hash table to disk if (*Fts5Index)(unsafe.Pointer(p)).FnPendingData != 0 { @@ -174832,7 +177609,7 @@ func fts5IndexFlush(tls *libc.TLS, p uintptr) { /* sqlite3.c:221002:13: */ } } -func fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) uintptr { /* sqlite3.c:221011:22: */ +func fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) uintptr { /* sqlite3.c:224350:22: */ var pNew uintptr = uintptr(0) var nByte Sqlite3_int64 = Sqlite3_int64(unsafe.Sizeof(Fts5Structure{})) var nSeg int32 = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment @@ -174893,7 +177670,7 @@ func fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) uintptr return pNew } -func sqlite3Fts5IndexOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221073:12: */ +func sqlite3Fts5IndexOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:224412:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -174927,7 +177704,7 @@ func sqlite3Fts5IndexOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221 // This is called to implement the special "VALUES('merge', $nMerge)" // INSERT command. -func sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:221107:12: */ +func sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:224446:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -174952,12 +177729,12 @@ func sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sq return fts5IndexReturn(tls, p) } -func fts5AppendRowid(tls *libc.TLS, p uintptr, iDelta I64, pUnused uintptr, pBuf uintptr) { /* sqlite3.c:221129:13: */ +func fts5AppendRowid(tls *libc.TLS, p uintptr, iDelta I64, pUnused uintptr, pBuf uintptr) { /* sqlite3.c:224468:13: */ _ = pUnused sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), pBuf, iDelta) } -func fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta I64, pMulti uintptr, pBuf uintptr) { /* sqlite3.c:221139:13: */ +func fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta I64, pMulti uintptr, pBuf uintptr) { /* sqlite3.c:224478:13: */ var nData int32 = (*Fts5Iter)(unsafe.Pointer(pMulti)).Fbase.FnData var nByte int32 = (((nData + 9) + 9) + FTS5_DATA_ZERO_PADDING) @@ -174980,11 +177757,11 @@ func fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta I64, pMulti uintptr, pBu *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (nData) } - libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0, FTS5_DATA_ZERO_PADDING) + libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0, uint64(FTS5_DATA_ZERO_PADDING)) } } -func fts5DoclistIterNext(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:221157:13: */ +func fts5DoclistIterNext(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:224496:13: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -175010,24 +177787,29 @@ func fts5DoclistIterNext(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:221157:13: } (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = p + if ((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist + uintptr((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist)) > (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof { + (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = uintptr(0) + } } } -func fts5DoclistIterInit(tls *libc.TLS, pBuf uintptr, pIter uintptr) { /* sqlite3.c:221183:13: */ +func fts5DoclistIterInit(tls *libc.TLS, pBuf uintptr, pIter uintptr) { /* sqlite3.c:224525:13: */ libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5DoclistIter{}))) - (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp - (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof = ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) - fts5DoclistIterNext(tls, pIter) + if (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn > 0 { + (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof = ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + fts5DoclistIterNext(tls, pIter) + } } // Swap the contents of buffer *p1 with that of *p2. -func fts5BufferSwap(tls *libc.TLS, p1 uintptr, p2 uintptr) { /* sqlite3.c:221220:13: */ +func fts5BufferSwap(tls *libc.TLS, p1 uintptr, p2 uintptr) { /* sqlite3.c:224564:13: */ var tmp = *(*Fts5Buffer)(unsafe.Pointer(p1)) *(*Fts5Buffer)(unsafe.Pointer(p1)) = *(*Fts5Buffer)(unsafe.Pointer(p2)) *(*Fts5Buffer)(unsafe.Pointer(p2)) = tmp } -func fts5NextRowid(tls *libc.TLS, pBuf uintptr, piOff uintptr, piRowid uintptr) { /* sqlite3.c:221226:13: */ +func fts5NextRowid(tls *libc.TLS, pBuf uintptr, piOff uintptr, piRowid uintptr) { /* sqlite3.c:224570:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -175044,7 +177826,7 @@ func fts5NextRowid(tls *libc.TLS, pBuf uintptr, piOff uintptr, piRowid uintptr) // This is the equivalent of fts5MergePrefixLists() for detail=none mode. // In this case the buffers consist of a delta-encoded list of rowids only. -func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, p2 uintptr) { /* sqlite3.c:221241:13: */ +func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf uintptr) { /* sqlite3.c:224585:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -175053,9 +177835,12 @@ func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, p2 uintptr) { /* *(*I64)(unsafe.Pointer(bp + 24 /* iRowid1 */)) = int64(0) *(*I64)(unsafe.Pointer(bp + 40 /* iRowid2 */)) = int64(0) var iOut I64 = int64(0) + var p2 uintptr = (aBuf) // var out Fts5Buffer at bp, 16 + _ = nBuf libc.Xmemset(tls, bp /* &out */, 0, uint64(unsafe.Sizeof(Fts5Buffer{}))) + sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), bp /* &out */, (uint32((*Fts5Buffer)(unsafe.Pointer(p1)).Fn + (*Fts5Buffer)(unsafe.Pointer(p2)).Fn))) if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 { return @@ -175090,245 +177875,231 @@ func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, p2 uintptr) { /* sqlite3Fts5BufferFree(tls, bp /* &out */) } -// Buffers p1 and p2 contain doclists. This function merges the content -// of the two doclists together and sets buffer p1 to the result before -// returning. -// -// If an error occurs, an error code is left in p->rc. If an error has -// already occurred, this function is a no-op. -func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, p2 uintptr) { /* sqlite3.c:221288:13: */ - bp := tls.Alloc(144) - defer tls.Free(144) +type PrefixMerger1 = struct { + Fiter Fts5DoclistIter + FiPos I64 + FiOff int32 + _ [4]byte + FaPos uintptr + FpNext uintptr +} /* sqlite3.c:224628:9 */ - if (*Fts5Buffer)(unsafe.Pointer(p2)).Fn != 0 { - var iLastRowid I64 = int64(0) - // var i1 Fts5DoclistIter at bp+16, 32 +type PrefixMerger = PrefixMerger1 /* sqlite3.c:224628:29 */ - // var i2 Fts5DoclistIter at bp+48, 32 - - *(*Fts5Buffer)(unsafe.Pointer(bp /* out */)) = Fts5Buffer{} - *(*Fts5Buffer)(unsafe.Pointer(bp + 88 /* tmp */)) = Fts5Buffer{} - - // The maximum size of the output is equal to the sum of the two - // input sizes + 1 varint (9 bytes). The extra varint is because if the - // first rowid in one input is a large negative number, and the first in - // the other a non-negative number, the delta for the non-negative - // number will be larger on disk than the literal integer value - // was. - // - // Or, if the input position-lists are corrupt, then the output might - // include up to 2 extra 10-byte positions created by interpreting -1 - // (the value PoslistNext64() uses for EOF) as a position and appending - // it to the output. This can happen at most once for each input - // position-list, hence two 10 byte paddings. - if sqlite3Fts5BufferSize(tls, (p+52 /* &.rc */), bp /* &out */, (uint32(((((*Fts5Buffer)(unsafe.Pointer(p1)).Fn+(*Fts5Buffer)(unsafe.Pointer(p2)).Fn)+9)+10)+10))) != 0 { - return +func fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { /* sqlite3.c:224637:13: */ + if (*PrefixMerger)(unsafe.Pointer(p)).Fiter.FaPoslist != 0 { + var pp uintptr = ppHead + for (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*PrefixMerger)(unsafe.Pointer(p)).Fiter.FiRowid > (*PrefixMerger)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).Fiter.FiRowid) { + pp = (*(*uintptr)(unsafe.Pointer(pp)) + 56 /* &.pNext */) } - fts5DoclistIterInit(tls, p1, bp+16 /* &i1 */) - fts5DoclistIterInit(tls, p2, bp+48 /* &i2 */) - - for 1 != 0 { - if (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FiRowid < (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FiRowid { - /* Copy entry from i1 */ - { - { - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 16 /* &i1 */)).FiRowid) - (iLastRowid))))) - } - (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 16 /* &i1 */)).FiRowid - } - - { - libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist, (uint64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnSize))) - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnSize) - } - - fts5DoclistIterNext(tls, bp+16 /* &i1 */) - if (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist == uintptr(0) { - break - } - - } else if (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FiRowid != (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FiRowid { - /* Copy entry from i2 */ - { - { - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid) - (iLastRowid))))) - } - (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid - } - - { - libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist, (uint64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnSize))) - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += ((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnSize) - } - - fts5DoclistIterNext(tls, bp+48 /* &i2 */) - if (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist == uintptr(0) { - break - } - - } else { - // Merge the two position lists. - *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) = int64(0) - *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) = int64(0) - *(*int32)(unsafe.Pointer(bp + 104 /* iOff1 */)) = 0 - *(*int32)(unsafe.Pointer(bp + 120 /* iOff2 */)) = 0 - var a1 uintptr = ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist + uintptr((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnSize)) - var a2 uintptr = ((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist + uintptr((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnSize)) - var nCopy int32 - var aCopy uintptr - - *(*I64)(unsafe.Pointer(bp + 136 /* iPrev */)) = int64(0) - // var writer Fts5PoslistWriter at bp+80, 8 - - libc.Xmemset(tls, bp+80 /* &writer */, 0, uint64(unsafe.Sizeof(Fts5PoslistWriter{}))) - - /* See the earlier comment in this function for an explanation of why - ** corrupt input position lists might cause the output to consume - ** at most 20 bytes of unexpected space. */ - { - { - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid) - (iLastRowid))))) - } - (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid - } - - sqlite3Fts5BufferZero(tls, bp+88 /* &tmp */) - sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), bp+88 /* &tmp */, (uint32((((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist) + 10) + 10))) - if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 { - break - } - - sqlite3Fts5PoslistNext64(tls, a1, (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist, bp+104 /* &iOff1 */, bp+112 /* &iPos1 */) - sqlite3Fts5PoslistNext64(tls, a2, (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist, bp+120 /* &iOff2 */, bp+128 /* &iPos2 */) - - if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) < *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) { - sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */))) - sqlite3Fts5PoslistNext64(tls, a1, (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist, bp+104 /* &iOff1 */, bp+112 /* &iPos1 */) - } else { - sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */))) - sqlite3Fts5PoslistNext64(tls, a2, (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist, bp+120 /* &iOff2 */, bp+128 /* &iPos2 */) - } - if (*(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) >= int64(0)) && (*(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) >= int64(0)) { - for 1 != 0 { - if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) < *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) { - if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) != *(*I64)(unsafe.Pointer(bp + 136 /* iPrev */)) { - sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */))) - } - sqlite3Fts5PoslistNext64(tls, a1, (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist, bp+104 /* &iOff1 */, bp+112 /* &iPos1 */) - if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) < int64(0) { - break - } - } else { - - sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */))) - sqlite3Fts5PoslistNext64(tls, a2, (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist, bp+120 /* &iOff2 */, bp+128 /* &iPos2 */) - if *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) < int64(0) { - break - } - } - } - } - - if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) >= int64(0) { - if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) != *(*I64)(unsafe.Pointer(bp + 136 /* iPrev */)) { - sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */))) - } - aCopy = (a1 + uintptr(*(*int32)(unsafe.Pointer(bp + 104 /* iOff1 */)))) - nCopy = ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist - *(*int32)(unsafe.Pointer(bp + 104 /* iOff1 */))) - } else { - - sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */))) - aCopy = (a2 + uintptr(*(*int32)(unsafe.Pointer(bp + 120 /* iOff2 */)))) - nCopy = ((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist - *(*int32)(unsafe.Pointer(bp + 120 /* iOff2 */))) - } - if nCopy > 0 { - { - libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 88 /* &tmp */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 88 /* &tmp */))).Fn)), aCopy, uint64(nCopy)) - *(*int32)(unsafe.Pointer(bp + 88 /* &tmp */ + 8 /* &.n */)) += (nCopy) - } - - } - - // WRITEPOSLISTSIZE - - if (*Fts5Buffer)(unsafe.Pointer(bp+88 /* &tmp */)).Fn > ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist) { - if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8)) - } - break - } - { - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64((*Fts5Buffer)(unsafe.Pointer(bp+88 /* &tmp */)).Fn * 2)))) - } - - { - libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5Buffer)(unsafe.Pointer(bp+88 /* &tmp */)).Fp, uint64((*Fts5Buffer)(unsafe.Pointer(bp+88 /* &tmp */)).Fn)) - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += ((*Fts5Buffer)(unsafe.Pointer(bp + 88 /* &tmp */)).Fn) - } - - fts5DoclistIterNext(tls, bp+16 /* &i1 */) - fts5DoclistIterNext(tls, bp+48 /* &i2 */) - - if ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist == uintptr(0)) || ((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist == uintptr(0)) { - break - } - - } - } - - if (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist != 0 { - { - { - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 16 /* &i1 */)).FiRowid) - (iLastRowid))))) - } - (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 16 /* &i1 */)).FiRowid - } - - { - libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist, (uint64((int64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaEof) - int64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist)) / 1))) - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += int32(((int64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaEof) - int64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist)) / 1)) - } - - } else if (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist != 0 { - { - { - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid) - (iLastRowid))))) - } - (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid - } - - { - libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist, (uint64((int64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaEof) - int64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist)) / 1))) - *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += int32(((int64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaEof) - int64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist)) / 1)) - } - - } - - sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), p1, (*Fts5Buffer)(unsafe.Pointer(bp /* &out */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp /* &out */)).Fp) - sqlite3Fts5BufferFree(tls, bp+88 /* &tmp */) - sqlite3Fts5BufferFree(tls, bp /* &out */) + (*PrefixMerger)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(pp)) + *(*uintptr)(unsafe.Pointer(pp)) = p } } -func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, pToken uintptr, nToken int32, pColset uintptr, ppIter uintptr) { /* sqlite3.c:221433:13: */ - bp := tls.Alloc(28) - defer tls.Free(28) +func fts5PrefixMergerInsertByPosition(tls *libc.TLS, ppHead uintptr, p uintptr) { /* sqlite3.c:224651:13: */ + if (*PrefixMerger)(unsafe.Pointer(p)).FiPos >= int64(0) { + var pp uintptr = ppHead + for (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*PrefixMerger)(unsafe.Pointer(p)).FiPos > (*PrefixMerger)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).FiPos) { + pp = (*(*uintptr)(unsafe.Pointer(pp)) + 56 /* &.pNext */) + } + (*PrefixMerger)(unsafe.Pointer(p)).FpNext = *(*uintptr)(unsafe.Pointer(pp)) + *(*uintptr)(unsafe.Pointer(pp)) = p + } +} + +// Array aBuf[] contains nBuf doclists. These are all merged in with the +// doclist in buffer p1. +func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBuf uintptr) { /* sqlite3.c:224670:13: */ + bp := tls.Alloc(1072) + defer tls.Free(1072) + + // var aMerger [16]PrefixMerger at bp, 1024 + + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = uintptr(0) + var i int32 + var nOut int32 = 0 + *(*Fts5Buffer)(unsafe.Pointer(bp + 1032 /* out */)) = Fts5Buffer{} + *(*Fts5Buffer)(unsafe.Pointer(bp + 1048 /* tmp */)) = Fts5Buffer{} + var iLastRowid I64 = int64(0) + + // Initialize a doclist-iterator for each input buffer. Arrange them in + // a linked-list starting at pHead in ascending order of rowid. Avoid + // linking any iterators already at EOF into the linked list at all. + + libc.Xmemset(tls, bp /* &aMerger[0] */, 0, (uint64(unsafe.Sizeof(PrefixMerger{})) * (uint64(nBuf + 1)))) + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = (bp /* &aMerger */ + uintptr(nBuf)*64) + fts5DoclistIterInit(tls, p1, (*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) /* &.iter */)) + for i = 0; i < nBuf; i++ { + fts5DoclistIterInit(tls, (aBuf + uintptr(i)*16), (bp /* &aMerger */ + uintptr(i)*64 /* &.iter */)) + fts5PrefixMergerInsertByRowid(tls, bp+1024 /* &pHead */, (bp /* &aMerger */ + uintptr(i)*64)) + nOut = nOut + ((*Fts5Buffer)(unsafe.Pointer(aBuf + uintptr(i)*16)).Fn) + } + if nOut == 0 { + return + } + nOut = nOut + (((*Fts5Buffer)(unsafe.Pointer(p1)).Fn + 9) + (10 * nBuf)) + + // The maximum size of the output is equal to the sum of the + // input sizes + 1 varint (9 bytes). The extra varint is because if the + // first rowid in one input is a large negative number, and the first in + // the other a non-negative number, the delta for the non-negative + // number will be larger on disk than the literal integer value + // was. + // + // Or, if the input position-lists are corrupt, then the output might + // include up to (nBuf+1) extra 10-byte positions created by interpreting -1 + // (the value PoslistNext64() uses for EOF) as a position and appending + // it to the output. This can happen at most once for each input + // position-list, hence (nBuf+1) 10 byte paddings. + if sqlite3Fts5BufferSize(tls, (p+52 /* &.rc */), bp+1032 /* &out */, uint32(nOut)) != 0 { + return + } + + for *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) != 0 { + { + { + *(*int32)(unsafe.Pointer(bp + 1032 /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fn)), (uint64(((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).Fiter.FiRowid) - (iLastRowid))))) + } + (iLastRowid) = (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).Fiter.FiRowid + } + + if ((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FpNext != 0) && (iLastRowid == (*PrefixMerger)(unsafe.Pointer((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FpNext)).Fiter.FiRowid) { + // Merge data from two or more poslists + *(*I64)(unsafe.Pointer(bp + 1064 /* iPrev */)) = int64(0) + var nTmp int32 = FTS5_DATA_ZERO_PADDING + var nMerge int32 = 0 + var pSave uintptr = *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) + var pThis uintptr = uintptr(0) + var nTail int32 = 0 + + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = uintptr(0) + for (pSave != 0) && ((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FiRowid == iLastRowid) { + var pNext uintptr = (*PrefixMerger)(unsafe.Pointer(pSave)).FpNext + (*PrefixMerger)(unsafe.Pointer(pSave)).FiOff = 0 + (*PrefixMerger)(unsafe.Pointer(pSave)).FiPos = int64(0) + (*PrefixMerger)(unsafe.Pointer(pSave)).FaPos = ((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FaPoslist + uintptr((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FnSize)) + sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pSave)).FaPos, (*PrefixMerger)(unsafe.Pointer((pSave))).Fiter.FnPoslist, (pSave + 40 /* &.iOff */), (pSave + 32 /* &.iPos */)) + + nTmp = nTmp + ((*PrefixMerger)(unsafe.Pointer(pSave)).Fiter.FnPoslist + 10) + nMerge++ + fts5PrefixMergerInsertByPosition(tls, bp+1024 /* &pHead */, pSave) + pSave = pNext + } + + if (*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) == uintptr(0)) || ((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FpNext == uintptr(0)) { + (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8)) + break + } + + // See the earlier comment in this function for an explanation of why + // corrupt input position lists might cause the output to consume + // at most nMerge*10 bytes of unexpected space. + if sqlite3Fts5BufferSize(tls, (p+52 /* &.rc */), bp+1048 /* &tmp */, (uint32(nTmp+(nMerge*10)))) != 0 { + break + } + sqlite3Fts5BufferZero(tls, bp+1048 /* &tmp */) + + pThis = *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = (*PrefixMerger)(unsafe.Pointer(pThis)).FpNext + sqlite3Fts5PoslistSafeAppend(tls, bp+1048 /* &tmp */, bp+1064 /* &iPrev */, (*PrefixMerger)(unsafe.Pointer(pThis)).FiPos) + sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pThis)).FaPos, (*PrefixMerger)(unsafe.Pointer((pThis))).Fiter.FnPoslist, (pThis + 40 /* &.iOff */), (pThis + 32 /* &.iPos */)) + + fts5PrefixMergerInsertByPosition(tls, bp+1024 /* &pHead */, pThis) + + for (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FpNext != 0 { + pThis = *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) + if (*PrefixMerger)(unsafe.Pointer(pThis)).FiPos != *(*I64)(unsafe.Pointer(bp + 1064 /* iPrev */)) { + sqlite3Fts5PoslistSafeAppend(tls, bp+1048 /* &tmp */, bp+1064 /* &iPrev */, (*PrefixMerger)(unsafe.Pointer(pThis)).FiPos) + } + sqlite3Fts5PoslistNext64(tls, (*PrefixMerger)(unsafe.Pointer(pThis)).FaPos, (*PrefixMerger)(unsafe.Pointer((pThis))).Fiter.FnPoslist, (pThis + 40 /* &.iOff */), (pThis + 32 /* &.iPos */)) + + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = (*PrefixMerger)(unsafe.Pointer(pThis)).FpNext + fts5PrefixMergerInsertByPosition(tls, bp+1024 /* &pHead */, pThis) + } + + if (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FiPos != *(*I64)(unsafe.Pointer(bp + 1064 /* iPrev */)) { + sqlite3Fts5PoslistSafeAppend(tls, bp+1048 /* &tmp */, bp+1064 /* &iPrev */, (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FiPos) + } + nTail = ((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).Fiter.FnPoslist - (*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FiOff) + + // WRITEPOSLISTSIZE + + if ((*Fts5Buffer)(unsafe.Pointer(bp+1048 /* &tmp */)).Fn + nTail) > (nTmp - FTS5_DATA_ZERO_PADDING) { + if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { + (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8)) + } + break + } + { + *(*int32)(unsafe.Pointer(bp + 1032 /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fn)), (uint64(((*Fts5Buffer)(unsafe.Pointer(bp+1048 /* &tmp */)).Fn + nTail) * 2)))) + } + + { + libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fn)), (*Fts5Buffer)(unsafe.Pointer(bp+1048 /* &tmp */)).Fp, uint64((*Fts5Buffer)(unsafe.Pointer(bp+1048 /* &tmp */)).Fn)) + *(*int32)(unsafe.Pointer(bp + 1032 /* &out */ + 8 /* &.n */)) += ((*Fts5Buffer)(unsafe.Pointer(bp + 1048 /* &tmp */)).Fn) + } + + if nTail > 0 { + { + libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fn)), ((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FaPos + uintptr((*PrefixMerger)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)))).FiOff)), uint64(nTail)) + *(*int32)(unsafe.Pointer(bp + 1032 /* &out */ + 8 /* &.n */)) += (nTail) + } + + } + + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = pSave + for i = 0; i < (nBuf + 1); i++ { + var pX uintptr = (bp /* &aMerger */ + uintptr(i)*64) + if ((*PrefixMerger)(unsafe.Pointer(pX)).Fiter.FaPoslist != 0) && ((*PrefixMerger)(unsafe.Pointer(pX)).Fiter.FiRowid == iLastRowid) { + fts5DoclistIterNext(tls, (pX /* &.iter */)) + fts5PrefixMergerInsertByRowid(tls, bp+1024 /* &pHead */, pX) + } + } + + } else { + // Copy poslist from pHead to output + var pThis uintptr = *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) + var pI uintptr = (pThis /* &.iter */) + { + libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 1032 /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(pI)).FaPoslist, (uint64((*Fts5DoclistIter)(unsafe.Pointer(pI)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(pI)).FnSize))) + *(*int32)(unsafe.Pointer(bp + 1032 /* &out */ + 8 /* &.n */)) += ((*Fts5DoclistIter)(unsafe.Pointer(pI)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(pI)).FnSize) + } + + fts5DoclistIterNext(tls, pI) + *(*uintptr)(unsafe.Pointer(bp + 1024 /* pHead */)) = (*PrefixMerger)(unsafe.Pointer(pThis)).FpNext + fts5PrefixMergerInsertByRowid(tls, bp+1024 /* &pHead */, pThis) + } + } + + sqlite3Fts5BufferFree(tls, p1) + sqlite3Fts5BufferFree(tls, bp+1048 /* &tmp */) + libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(bp+1032 /* &out */)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(bp+1032 /* &out */)).Fn)), 0, uint64(FTS5_DATA_ZERO_PADDING)) + *(*Fts5Buffer)(unsafe.Pointer(p1)) = *(*Fts5Buffer)(unsafe.Pointer(bp + 1032 /* out */)) +} + +func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pToken uintptr, nToken int32, pColset uintptr, ppIter uintptr) { /* sqlite3.c:224813:13: */ + bp := tls.Alloc(32) + defer tls.Free(32) var pStruct uintptr var aBuf uintptr var nBuf int32 = 32 + var nMerge int32 = 1 var xMerge uintptr var xAppend uintptr if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_NONE { xMerge = *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, uintptr, uintptr) + f func(*libc.TLS, uintptr, uintptr, int32, uintptr) }{fts5MergeRowidLists})) xAppend = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, I64, uintptr, uintptr) }{fts5AppendRowid})) } else { + nMerge = (FTS5_MERGE_NLIST - 1) + nBuf = (nMerge * 8) // Sufficient to merge (16^8)==(2^32) lists xMerge = *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, uintptr, uintptr) + f func(*libc.TLS, uintptr, uintptr, int32, uintptr) }{fts5MergePrefixLists})) xAppend = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, I64, uintptr, uintptr) @@ -175348,18 +178119,36 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, pToken uintptr, var pData uintptr // var doclist Fts5Buffer at bp, 16 - *(*int32)(unsafe.Pointer(bp + 24 /* bNewTerm */)) = 1 + *(*int32)(unsafe.Pointer(bp + 28 /* bNewTerm */)) = 1 libc.Xmemset(tls, bp /* &doclist */, 0, uint64(unsafe.Sizeof(Fts5Buffer{}))) + if iIdx != 0 { + *(*int32)(unsafe.Pointer(bp + 24 /* dummy */)) = 0 + var f2 int32 = (FTS5INDEX_QUERY_SKIPEMPTY | FTS5INDEX_QUERY_NOOUTPUT) + *(*U8)(unsafe.Pointer(pToken)) = U8('0') + fts5MultiIterNew(tls, p, pStruct, f2, pColset, pToken, nToken, -1, 0, bp+16 /* &p1 */) + fts5IterSetOutputCb(tls, (p + 52 /* &.rc */), *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) + for ; fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) == 0; fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), bp+24 /* &dummy */) { + var pSeg uintptr = ((*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)) + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).FaFirst+1*4)).FiFirst)*120) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)) + 56 /* &.xSetOutputs */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), pSeg) + if (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FnData != 0 { + (*(*func(*libc.TLS, uintptr, I64, uintptr, uintptr))(unsafe.Pointer(&xAppend)))(tls, p, ((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FiRowid - iLastRowid), *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), bp /* &doclist */) + iLastRowid = (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FiRowid + } + } + fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) + } + + *(*U8)(unsafe.Pointer(pToken)) = (U8('0' + iIdx)) fts5MultiIterNew(tls, p, pStruct, flags, pColset, pToken, nToken, -1, 0, bp+16 /* &p1 */) fts5IterSetOutputCb(tls, (p + 52 /* &.rc */), *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) - for ; fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) == 0; fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), bp+24 /* &bNewTerm */) { + for ; fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) == 0; fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), bp+28 /* &bNewTerm */) { var pSeg uintptr = ((*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)) + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).FaFirst+1*4)).FiFirst)*120) var nTerm int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn var pTerm uintptr = (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)) + 56 /* &.xSetOutputs */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), pSeg) - if *(*int32)(unsafe.Pointer(bp + 24 /* bNewTerm */)) != 0 { + if *(*int32)(unsafe.Pointer(bp + 28 /* bNewTerm */)) != 0 { if (nTerm < nToken) || (libc.Xmemcmp(tls, pToken, pTerm, uint64(nToken)) != 0) { break } @@ -175371,13 +178160,21 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, pToken uintptr, if ((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FiRowid <= iLastRowid) && ((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn > 0) { for i = 0; ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn != 0); i++ { + var i1 int32 = (i * nMerge) + var iStore int32 - if (*Fts5Buffer)(unsafe.Pointer(aBuf+uintptr(i)*16)).Fn == 0 { - fts5BufferSwap(tls, bp /* &doclist */, (aBuf + uintptr(i)*16)) - sqlite3Fts5BufferZero(tls, bp /* &doclist */) - } else { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&xMerge)))(tls, p, bp /* &doclist */, (aBuf + uintptr(i)*16)) - sqlite3Fts5BufferZero(tls, (aBuf + uintptr(i)*16)) + for iStore = i1; iStore < (i1 + nMerge); iStore++ { + if (*Fts5Buffer)(unsafe.Pointer(aBuf+uintptr(iStore)*16)).Fn == 0 { + fts5BufferSwap(tls, bp /* &doclist */, (aBuf + uintptr(iStore)*16)) + sqlite3Fts5BufferZero(tls, bp /* &doclist */) + break + } + } + if iStore == (i1 + nMerge) { + (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(&xMerge)))(tls, p, bp /* &doclist */, nMerge, (aBuf + uintptr(i1)*16)) + for iStore = i1; iStore < (i1 + nMerge); iStore++ { + sqlite3Fts5BufferZero(tls, (aBuf + uintptr(iStore)*16)) + } } } iLastRowid = int64(0) @@ -175387,15 +178184,18 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, pToken uintptr, iLastRowid = (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FiRowid } - for i = 0; i < nBuf; i++ { + for i = 0; i < nBuf; i = i + (nMerge) { + var iFree int32 if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&xMerge)))(tls, p, bp /* &doclist */, (aBuf + uintptr(i)*16)) + (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(&xMerge)))(tls, p, bp /* &doclist */, nMerge, (aBuf + uintptr(i)*16)) + } + for iFree = i; iFree < (i + nMerge); iFree++ { + sqlite3Fts5BufferFree(tls, (aBuf + uintptr(iFree)*16)) } - sqlite3Fts5BufferFree(tls, (aBuf + uintptr(i)*16)) } fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) - pData = fts5IdxMalloc(tls, p, (int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn)) + FTS5_DATA_ZERO_PADDING))) + pData = fts5IdxMalloc(tls, p, (int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn)) + uint64(FTS5_DATA_ZERO_PADDING)))) if pData != 0 { (*Fts5Data)(unsafe.Pointer(pData)).Fp = (pData + 1*16) (*Fts5Data)(unsafe.Pointer(pData)).Fnn = libc.AssignPtrInt32(pData+12 /* &.szLeaf */, (*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn) @@ -175413,7 +178213,7 @@ func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, pToken uintptr, // Indicate that all subsequent calls to sqlite3Fts5IndexWrite() pertain // to the document with rowid iRowid. -func sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid I64) int32 { /* sqlite3.c:221533:12: */ +func sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid I64) int32 { /* sqlite3.c:224950:12: */ // Allocate the hash table if it has not already been allocated if (*Fts5Index)(unsafe.Pointer(p)).FpHash == uintptr(0) { @@ -175433,7 +178233,7 @@ func sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid } // Commit data to disk. -func sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221557:12: */ +func sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:224974:12: */ fts5IndexFlush(tls, p) sqlite3Fts5IndexCloseReader(tls, p) @@ -175444,7 +178244,7 @@ func sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221557: // to the database. Additionally, assume that the contents of the %_data // table may have changed on disk. So any in-memory caches of %_data // records must be invalidated. -func sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221570:12: */ +func sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:224987:12: */ sqlite3Fts5IndexCloseReader(tls, p) fts5IndexDiscardData(tls, p) fts5StructureInvalidate(tls, p) @@ -175455,7 +178255,7 @@ func sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221 // The %_data table is completely empty when this function is called. This // function populates it with the initial structure objects for each index, // and the initial version of the "averages" record (a zero-byte blob). -func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221583:12: */ +func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:225000:12: */ bp := tls.Alloc(40) defer tls.Free(40) @@ -175464,7 +178264,7 @@ func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:22158 fts5StructureInvalidate(tls, p) fts5IndexDiscardData(tls, p) libc.Xmemset(tls, bp /* &s */, 0, uint64(unsafe.Sizeof(Fts5Structure{}))) - fts5DataWrite(tls, p, FTS5_AVERAGES_ROWID, ts+800 /* "" */, 0) + fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), ts+800 /* "" */, 0) fts5StructureWrite(tls, p, bp /* &s */) return fts5IndexReturn(tls, p) } @@ -175474,7 +178274,7 @@ func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:22158 // // If successful, set *pp to point to the new object and return SQLITE_OK. // Otherwise, set *pp to NULL and return an SQLite error code. -func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:221600:12: */ +func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:225017:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -175485,13 +178285,13 @@ func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uint if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK { (*Fts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit = FTS5_WORK_UNIT - (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl = sqlite3Fts5Mprintf(tls, bp+8 /* &rc */, ts+38011 /* "%s_data" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl = sqlite3Fts5Mprintf(tls, bp+8 /* &rc */, ts+38519 /* "%s_data" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) if ((*Fts5Index)(unsafe.Pointer(p)).FzDataTbl != 0) && (bCreate != 0) { *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sqlite3Fts5CreateTable(tls, - pConfig, ts+28361 /* "data" */, ts+38019 /* "id INTEGER PRIMA..." */, 0, pzErr) + pConfig, ts+28867 /* "data" */, ts+38527 /* "id INTEGER PRIMA..." */, 0, pzErr) if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sqlite3Fts5CreateTable(tls, pConfig, ts+12628, /* "idx" */ - ts+38054, /* "segid, term, pgn..." */ + *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sqlite3Fts5CreateTable(tls, pConfig, ts+13041, /* "idx" */ + ts+38562, /* "segid, term, pgn..." */ 1, pzErr) } if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK { @@ -175508,7 +178308,7 @@ func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uint } // Close a handle opened by an earlier call to sqlite3Fts5IndexOpen(). -func sqlite3Fts5IndexClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221641:12: */ +func sqlite3Fts5IndexClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:225058:12: */ var rc int32 = SQLITE_OK if p != 0 { @@ -175529,7 +178329,7 @@ func sqlite3Fts5IndexClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221641 // Argument p points to a buffer containing utf-8 text that is n bytes in // size. Return the number of bytes in the nChar character prefix of the // buffer, or 0 if there are less than nChar characters in total. -func sqlite3Fts5IndexCharlenToBytelen(tls *libc.TLS, p uintptr, nByte int32, nChar int32) int32 { /* sqlite3.c:221664:12: */ +func sqlite3Fts5IndexCharlenToBytelen(tls *libc.TLS, p uintptr, nByte int32, nChar int32) int32 { /* sqlite3.c:225081:12: */ var n int32 = 0 var i int32 for i = 0; i < nChar; i++ { @@ -175556,7 +178356,7 @@ func sqlite3Fts5IndexCharlenToBytelen(tls *libc.TLS, p uintptr, nByte int32, nCh // pIn is a UTF-8 encoded string, nIn bytes in size. Return the number of // unicode characters in the string. -func fts5IndexCharlen(tls *libc.TLS, pIn uintptr, nIn int32) int32 { /* sqlite3.c:221691:12: */ +func fts5IndexCharlen(tls *libc.TLS, pIn uintptr, nIn int32) int32 { /* sqlite3.c:225108:12: */ var nChar int32 = 0 var i int32 = 0 for i < nIn { @@ -175578,7 +178378,7 @@ func fts5IndexCharlen(tls *libc.TLS, pIn uintptr, nIn int32) int32 { /* sqlite3. // If the operation is a delete, it must be called (at least) once for each // unique token in the document with an iCol value less than zero. The iPos // argument is ignored for a delete. -func sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pToken uintptr, nToken int32) int32 { /* sqlite3.c:221713:12: */ +func sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pToken uintptr, nToken int32) int32 { /* sqlite3.c:225130:12: */ var i int32 // Used to iterate through indexes var rc int32 = SQLITE_OK // Return code var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig @@ -175602,7 +178402,7 @@ func sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pTo // Open a new iterator to iterate though all rowid that match the // specified token or token prefix. -func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int32, flags int32, pColset uintptr, ppIter uintptr) int32 { /* sqlite3.c:221749:12: */ +func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int32, flags int32, pColset uintptr, ppIter uintptr) int32 { /* sqlite3.c:225166:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -175613,7 +178413,8 @@ func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int3 // If the QUERY_SCAN flag is set, all other flags must be clear. if sqlite3Fts5BufferSize(tls, (p+52 /* &.rc */), bp /* &buf */, (uint32(nToken+1))) == 0 { - var iIdx int32 = 0 // Index to search + var iIdx int32 = 0 // Index to search + var iPrefixIdx int32 = 0 // +1 prefix index if nToken != 0 { libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp + 1), pToken, uint64(nToken)) } @@ -175631,9 +178432,13 @@ func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int3 if (flags & FTS5INDEX_QUERY_PREFIX) != 0 { var nChar int32 = fts5IndexCharlen(tls, pToken, nToken) for iIdx = 1; iIdx <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix; iIdx++ { - if *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix + uintptr((iIdx-1))*4)) == nChar { + var nIdxChar int32 = *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix + uintptr((iIdx-1))*4)) + if nIdxChar == nChar { break } + if nIdxChar == (nChar + 1) { + iPrefixIdx = iIdx + } } } @@ -175649,8 +178454,7 @@ func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int3 } else { // Scan multiple terms in the main index var bDesc int32 = (libc.Bool32((flags & FTS5INDEX_QUERY_DESC) != 0)) - *(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp)) = U8('0') - fts5SetupPrefixIter(tls, p, bDesc, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (nToken + 1), pColset, bp+16 /* &pRet */) + fts5SetupPrefixIter(tls, p, bDesc, iPrefixIdx, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (nToken + 1), pColset, bp+16 /* &pRet */) fts5IterSetOutputCb(tls, (p + 52 /* &.rc */), *(*uintptr)(unsafe.Pointer(bp + 16 /* pRet */))) if (*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -175675,7 +178479,7 @@ func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int3 // Return true if the iterator passed as the only argument is at EOF. // Move to the next matching rowid. -func sqlite3Fts5IterNext(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:221831:12: */ +func sqlite3Fts5IterNext(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:225250:12: */ var pIter uintptr = pIndexIter fts5MultiIterNext(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pIter, 0, int64(0)) @@ -175683,7 +178487,7 @@ func sqlite3Fts5IterNext(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c } // Move to the next matching term/rowid. Used by the fts5vocab module. -func sqlite3Fts5IterNextScan(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:221841:12: */ +func sqlite3Fts5IterNextScan(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:225260:12: */ var pIter uintptr = pIndexIter var p uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex @@ -175703,26 +178507,32 @@ func sqlite3Fts5IterNextScan(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlit // Move to the next matching rowid that occurs at or after iMatch. The // definition of "at or after" depends on whether this iterator iterates // in ascending or descending rowid order. -func sqlite3Fts5IterNextFrom(tls *libc.TLS, pIndexIter uintptr, iMatch I64) int32 { /* sqlite3.c:221865:12: */ +func sqlite3Fts5IterNextFrom(tls *libc.TLS, pIndexIter uintptr, iMatch I64) int32 { /* sqlite3.c:225284:12: */ var pIter uintptr = pIndexIter fts5MultiIterNextFrom(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pIter, iMatch) return fts5IndexReturn(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex) } // Return the current term. -func sqlite3Fts5IterTerm(tls *libc.TLS, pIndexIter uintptr, pn uintptr) uintptr { /* sqlite3.c:221874:19: */ +func sqlite3Fts5IterTerm(tls *libc.TLS, pIndexIter uintptr, pn uintptr) uintptr { /* sqlite3.c:225293:19: */ bp := tls.Alloc(4) defer tls.Free(4) // var n int32 at bp, 4 var z uintptr = fts5MultiIterTerm(tls, pIndexIter, bp /* &n */) + *(*int32)(unsafe.Pointer(pn)) = (*(*int32)(unsafe.Pointer(bp /* n */)) - 1) - return (z + 1) + return func() uintptr { + if z != 0 { + return (z + 1) + } + return uintptr(0) + }() } // Close an iterator opened by an earlier call to sqlite3Fts5IndexQuery(). -func sqlite3Fts5IterClose(tls *libc.TLS, pIndexIter uintptr) { /* sqlite3.c:221884:13: */ +func sqlite3Fts5IterClose(tls *libc.TLS, pIndexIter uintptr) { /* sqlite3.c:225304:13: */ if pIndexIter != 0 { var pIter uintptr = pIndexIter var pIndex uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex @@ -175735,13 +178545,13 @@ func sqlite3Fts5IterClose(tls *libc.TLS, pIndexIter uintptr) { /* sqlite3.c:2218 // // Parameter anSize must point to an array of size nCol, where nCol is // the number of user defined columns in the FTS table. -func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize uintptr) int32 { /* sqlite3.c:221899:12: */ +func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize uintptr) int32 { /* sqlite3.c:225319:12: */ var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnCol var pData uintptr *(*I64)(unsafe.Pointer(pnRow)) = int64(0) libc.Xmemset(tls, anSize, 0, (uint64(unsafe.Sizeof(I64(0))) * uint64(nCol))) - pData = fts5DataRead(tls, p, FTS5_AVERAGES_ROWID) + pData = fts5DataRead(tls, p, int64(FTS5_AVERAGES_ROWID)) if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && ((*Fts5Data)(unsafe.Pointer(pData)).Fnn != 0) { var i int32 = 0 var iCol int32 @@ -175757,15 +178567,15 @@ func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize // Replace the current "averages" record with the contents of the buffer // supplied as the second argument. -func sqlite3Fts5IndexSetAverages(tls *libc.TLS, p uintptr, pData uintptr, nData int32) int32 { /* sqlite3.c:221923:12: */ +func sqlite3Fts5IndexSetAverages(tls *libc.TLS, p uintptr, pData uintptr, nData int32) int32 { /* sqlite3.c:225343:12: */ - fts5DataWrite(tls, p, FTS5_AVERAGES_ROWID, pData, nData) + fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), pData, nData) return fts5IndexReturn(tls, p) } // Return the total number of blocks this module has read from the %_data // table since it was created. -func sqlite3Fts5IndexReads(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221933:12: */ +func sqlite3Fts5IndexReads(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:225353:12: */ return (*Fts5Index)(unsafe.Pointer(p)).FnRead } @@ -175774,7 +178584,7 @@ func sqlite3Fts5IndexReads(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221933 // // Return SQLITE_OK if successful, or an SQLite error code if an error // occurs. -func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /* sqlite3.c:221944:12: */ +func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /* sqlite3.c:225364:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -175787,7 +178597,7 @@ func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /* sqlite3Fts5Put32(tls, bp /* &aCookie[0] */, iNew) rc = Xsqlite3_blob_open(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl, - ts+37701 /* "block" */, FTS5_STRUCTURE_ROWID, 1, bp+8 /* &pBlob */) + ts+38209 /* "block" */, int64(FTS5_STRUCTURE_ROWID), 1, bp+8 /* &pBlob */) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pBlob */)), bp /* &aCookie[0] */, 4, 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pBlob */))) @@ -175796,7 +178606,7 @@ func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /* return rc } -func sqlite3Fts5IndexLoadConfig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221964:12: */ +func sqlite3Fts5IndexLoadConfig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:225384:12: */ var pStruct uintptr pStruct = fts5StructureRead(tls, p) fts5StructureRelease(tls, pStruct) @@ -175810,7 +178620,7 @@ func sqlite3Fts5IndexLoadConfig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:2 // functionality. // Return a simple checksum value based on the arguments. -func sqlite3Fts5IndexEntryCksum(tls *libc.TLS, iRowid I64, iCol int32, iPos int32, iIdx int32, pTerm uintptr, nTerm int32) U64 { /* sqlite3.c:221981:12: */ +func sqlite3Fts5IndexEntryCksum(tls *libc.TLS, iRowid I64, iCol int32, iPos int32, iIdx int32, pTerm uintptr, nTerm int32) U64 { /* sqlite3.c:225401:12: */ var i int32 var ret U64 = U64(iRowid) ret = ret + ((ret << 3) + U64(iCol)) @@ -175830,7 +178640,7 @@ func sqlite3Fts5IndexEntryCksum(tls *libc.TLS, iRowid I64, iCol int32, iPos int3 // contain zero terms. // 2) All leaves of pSeg between iNoRowid and iLast (inclusive) exist and // contain zero rowids. -func fts5IndexIntegrityCheckEmpty(tls *libc.TLS, p uintptr, pSeg uintptr, iFirst int32, iNoRowid int32, iLast int32) { /* sqlite3.c:222199:13: */ +func fts5IndexIntegrityCheckEmpty(tls *libc.TLS, p uintptr, pSeg uintptr, iFirst int32, iNoRowid int32, iLast int32) { /* sqlite3.c:225619:13: */ var i int32 // Now check that the iter.nEmpty leaves following the current leaf @@ -175849,7 +178659,7 @@ func fts5IndexIntegrityCheckEmpty(tls *libc.TLS, p uintptr, pSeg uintptr, iFirst } } -func fts5IntegrityCheckPgidx(tls *libc.TLS, p uintptr, pLeaf uintptr) { /* sqlite3.c:222220:13: */ +func fts5IntegrityCheckPgidx(tls *libc.TLS, p uintptr, pLeaf uintptr) { /* sqlite3.c:225640:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -175908,7 +178718,7 @@ func fts5IntegrityCheckPgidx(tls *libc.TLS, p uintptr, pLeaf uintptr) { /* sqlit sqlite3Fts5BufferFree(tls, bp+32 /* &buf2 */) } -func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /* sqlite3.c:222270:13: */ +func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /* sqlite3.c:225690:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -175924,7 +178734,7 @@ func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /* fts5IndexPrepareStmt(tls, p, bp+24 /* &pStmt */, Xsqlite3_mprintf(tls, - ts+38098, /* "SELECT segid, te..." */ + ts+38606, /* "SELECT segid, te..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) // Iterate through the b-tree hierarchy. @@ -176077,7 +178887,7 @@ func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /* // checksum does not match. Return SQLITE_OK if all checks pass without // error, or some other SQLite error code if another error (e.g. OOM) // occurs. -func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64) int32 { /* sqlite3.c:222415:12: */ +func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64, bUseCksum int32) int32 { /* sqlite3.c:225835:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -176134,6 +178944,7 @@ func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64) int32 { } else { (*Fts5Buffer)(unsafe.Pointer(bp + 16 /* &poslist */)).Fn = 0 fts5SegiterPoslist(tls, p, ((*(*uintptr)(unsafe.Pointer(bp /* pIter */)) + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIter */)))).FaFirst+1*4)).FiFirst)*120), uintptr(0), bp+16 /* &poslist */) + sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), bp+16 /* &poslist */, uint32(4), ts+38692 /* "\x00\x00\x00\x00" */) for 0 == sqlite3Fts5PoslistNext64(tls, (*Fts5Buffer)(unsafe.Pointer(bp+16 /* &poslist */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp+16 /* &poslist */)).Fn, bp+32 /* &iOff */, bp+40 /* &iPos */) { var iCol int32 = (int32(*(*I64)(unsafe.Pointer(bp + 40 /* iPos */)) >> 32)) var iTokOff int32 = (int32(*(*I64)(unsafe.Pointer(bp + 40 /* iPos */)) & int64(0x7FFFFFFF))) @@ -176143,7 +178954,7 @@ func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64) int32 { } fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp /* pIter */))) - if ((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (cksum != cksum2) { + if (((*Fts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK) && (bUseCksum != 0)) && (cksum != cksum2) { (*Fts5Index)(unsafe.Pointer(p)).Frc = (SQLITE_CORRUPT | (int32(1) << 8)) } @@ -176160,7 +178971,7 @@ func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64) int32 { // Decode a segment-data rowid from the %_data table. This function is // the opposite of macro FTS5_SEGMENT_ROWID(). -func fts5DecodeRowid(tls *libc.TLS, iRowid I64, piSegid uintptr, pbDlidx uintptr, piHeight uintptr, piPgno uintptr) { /* sqlite3.c:222506:13: */ +func fts5DecodeRowid(tls *libc.TLS, iRowid I64, piSegid uintptr, pbDlidx uintptr, piHeight uintptr, piPgno uintptr) { /* sqlite3.c:225927:13: */ *(*int32)(unsafe.Pointer(piPgno)) = (int32(iRowid & ((I64(int64(1)) << FTS5_DATA_PAGE_B) - int64(1)))) iRowid >>= FTS5_DATA_PAGE_B @@ -176173,7 +178984,7 @@ func fts5DecodeRowid(tls *libc.TLS, iRowid I64, piSegid uintptr, pbDlidx uintptr *(*int32)(unsafe.Pointer(piSegid)) = (int32(iRowid & ((I64(int64(1)) << FTS5_DATA_ID_B) - int64(1)))) } -func fts5DebugRowid(tls *libc.TLS, pRc uintptr, pBuf uintptr, iKey I64) { /* sqlite3.c:222525:13: */ +func fts5DebugRowid(tls *libc.TLS, pRc uintptr, pBuf uintptr, iKey I64) { /* sqlite3.c:225946:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -176188,23 +178999,23 @@ func fts5DebugRowid(tls *libc.TLS, pRc uintptr, pBuf uintptr, iKey I64) { /* sql fts5DecodeRowid(tls, iKey, bp+32 /* &iSegid */, bp+36 /* &bDlidx */, bp+40 /* &iHeight */, bp+44 /* &iPgno */) if *(*int32)(unsafe.Pointer(bp + 32 /* iSegid */)) == 0 { - if iKey == FTS5_AVERAGES_ROWID { - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38184 /* "{averages} " */, 0) + if iKey == int64(FTS5_AVERAGES_ROWID) { + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38697 /* "{averages} " */, 0) } else { - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38196 /* "{structure}" */, 0) + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38709 /* "{structure}" */, 0) } } else { - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38208, /* "{%ssegid=%d h=%d..." */ + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38721, /* "{%ssegid=%d h=%d..." */ libc.VaList(bp, func() uintptr { if *(*int32)(unsafe.Pointer(bp + 36 /* bDlidx */)) != 0 { - return ts + 38234 /* "dlidx " */ + return ts + 38747 /* "dlidx " */ } return ts + 800 /* "" */ }(), *(*int32)(unsafe.Pointer(bp + 32 /* iSegid */)), *(*int32)(unsafe.Pointer(bp + 40 /* iHeight */)), *(*int32)(unsafe.Pointer(bp + 44 /* iPgno */)))) } } -func fts5DebugStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, p uintptr) { /* sqlite3.c:222543:13: */ +func fts5DebugStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, p uintptr) { /* sqlite3.c:225964:13: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -176214,13 +179025,13 @@ func fts5DebugStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, p uintptr) { / for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(p)).FnLevel; iLvl++ { var pLvl uintptr = ((p + 24 /* &.aLevel */) + uintptr(iLvl)*16) sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, - ts+38241 /* " {lvl=%d nMerge=..." */, libc.VaList(bp, iLvl, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg)) + ts+38754 /* " {lvl=%d nMerge=..." */, libc.VaList(bp, iLvl, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg)) for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg; iSeg++ { var pSeg uintptr = ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSeg)*12) - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38268, /* " {id=%d leaves=%..." */ + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38781, /* " {id=%d leaves=%..." */ libc.VaList(bp+24, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast)) } - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+29969 /* "}" */, 0) + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+30475 /* "}" */, 0) } } @@ -176229,7 +179040,7 @@ func fts5DebugStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, p uintptr) { / // Arguments pBlob/nBlob contain a serialized Fts5Structure object. This // function appends a human-readable representation of the same object // to the buffer passed as the second argument. -func fts5DecodeStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, nBlob int32) { /* sqlite3.c:222572:13: */ +func fts5DecodeStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, nBlob int32) { /* sqlite3.c:225993:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -176251,7 +179062,7 @@ func fts5DecodeStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr // Arguments pBlob/nBlob contain an "averages" record. This function // appends a human-readable representation of record to the buffer passed // as the second argument. -func fts5DecodeAverages(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, nBlob int32) { /* sqlite3.c:222597:13: */ +func fts5DecodeAverages(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, nBlob int32) { /* sqlite3.c:226018:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -176262,8 +179073,8 @@ func fts5DecodeAverages(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, // var iVal U64 at bp+16, 8 i = i + (int32(sqlite3Fts5GetVarint(tls, (pBlob + uintptr(i)), bp+16 /* &iVal */))) - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38291 /* "%s%d" */, libc.VaList(bp, zSpace, int32(*(*U64)(unsafe.Pointer(bp + 16 /* iVal */))))) - zSpace = ts + 16003 /* " " */ + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38804 /* "%s%d" */, libc.VaList(bp, zSpace, int32(*(*U64)(unsafe.Pointer(bp + 16 /* iVal */))))) + zSpace = ts + 12479 /* " " */ } } @@ -176272,7 +179083,7 @@ func fts5DecodeAverages(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, // after either the input buffer is exhausted or a 0 value is read. // // The return value is the number of bytes read from the input buffer. -func fts5DecodePoslist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n int32) int32 { /* sqlite3.c:222620:12: */ +func fts5DecodePoslist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n int32) int32 { /* sqlite3.c:226041:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -176281,7 +179092,7 @@ func fts5DecodePoslist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n in // var iVal int32 at bp+8, 4 iOff = iOff + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iOff)), bp+8 /* &iVal */)) - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+37423 /* " %d" */, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* iVal */)))) + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+37929 /* " %d" */, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* iVal */)))) } return iOff } @@ -176292,7 +179103,7 @@ func fts5DecodePoslist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n in // pBuf. // // The return value is the number of bytes read from the input buffer. -func fts5DecodeDoclist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n int32) int32 { /* sqlite3.c:222638:12: */ +func fts5DecodeDoclist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n int32) int32 { /* sqlite3.c:226059:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -176301,7 +179112,7 @@ func fts5DecodeDoclist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n in if n > 0 { iOff = int32(sqlite3Fts5GetVarint(tls, a, bp+32 /* &iDocid */)) - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38296 /* " id=%lld" */, libc.VaList(bp, *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */)))) + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38809 /* " id=%lld" */, libc.VaList(bp, *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */)))) } for iOff < n { // var nPos int32 at bp+40, 4 @@ -176309,9 +179120,9 @@ func fts5DecodeDoclist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n in // var bDel int32 at bp+44, 4 iOff = iOff + (fts5GetPoslistSize(tls, (a + uintptr(iOff)), bp+40 /* &nPos */, bp+44 /* &bDel */)) - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38305 /* " nPos=%d%s" */, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(bp + 40 /* nPos */)), func() uintptr { + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38818 /* " nPos=%d%s" */, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(bp + 40 /* nPos */)), func() uintptr { if *(*int32)(unsafe.Pointer(bp + 44 /* bDel */)) != 0 { - return ts + 20691 /* "*" */ + return ts + 21098 /* "*" */ } return ts + 800 /* "" */ }())) @@ -176326,7 +179137,7 @@ func fts5DecodeDoclist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n in iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, (a + uintptr(iOff)), bp+48 /* &iDelta */))) *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */)) += *(*I64)(unsafe.Pointer(bp + 48 /* iDelta */)) - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38296 /* " id=%lld" */, libc.VaList(bp+24, *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */)))) + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38809 /* " id=%lld" */, libc.VaList(bp+24, *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */)))) } } @@ -176344,7 +179155,7 @@ func fts5DecodeDoclist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n in // no-op. If an OOM or other error occurs within this function, *pRc is // set to an SQLite error code before returning. The final state of buffer // pBuf is undefined in this case. -func fts5DecodeRowidList(tls *libc.TLS, pRc uintptr, pBuf uintptr, pData uintptr, nData int32) { /* sqlite3.c:222676:13: */ +func fts5DecodeRowidList(tls *libc.TLS, pRc uintptr, pBuf uintptr, pData uintptr, nData int32) { /* sqlite3.c:226097:13: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -176362,18 +179173,18 @@ func fts5DecodeRowidList(tls *libc.TLS, pRc uintptr, pBuf uintptr, pData uintptr i++ if (i < nData) && (int32(*(*U8)(unsafe.Pointer(pData + uintptr(i)))) == 0x00) { i++ - zApp = ts + 38316 /* "+" */ + zApp = ts + 38829 /* "+" */ } else { - zApp = ts + 20691 /* "*" */ + zApp = ts + 21098 /* "*" */ } } - sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38318 /* " %lld%s" */, libc.VaList(bp, iRowid, zApp)) + sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38831 /* " %lld%s" */, libc.VaList(bp, iRowid, zApp)) } } // The implementation of user-defined scalar function fts5_decode(). -func fts5DecodeFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:222707:13: */ +func fts5DecodeFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:226128:13: */ bp := tls.Alloc(192) defer tls.Free(192) @@ -176475,7 +179286,7 @@ __5: goto __7 } sqlite3Fts5BufferAppendPrintf(tls, bp+64 /* &rc */, bp+48, /* &s */ - ts+38326 /* " %d(%lld)" */, libc.VaList(bp, (*Fts5DlidxLvl)(unsafe.Pointer(bp+88 /* &lvl */)).FiLeafPgno, (*Fts5DlidxLvl)(unsafe.Pointer(bp+88 /* &lvl */)).FiRowid)) + ts+38839 /* " %d(%lld)" */, libc.VaList(bp, (*Fts5DlidxLvl)(unsafe.Pointer(bp+88 /* &lvl */)).FiLeafPgno, (*Fts5DlidxLvl)(unsafe.Pointer(bp+88 /* &lvl */)).FiRowid)) goto __6 __6: fts5DlidxLvlNext(tls, bp+88 /* &lvl */) @@ -176488,7 +179299,7 @@ __3: if !(*(*int32)(unsafe.Pointer(bp + 68 /* iSegid */)) == 0) { goto __8 } - if !(iRowid == FTS5_AVERAGES_ROWID) { + if !(iRowid == int64(FTS5_AVERAGES_ROWID)) { goto __10 } fts5DecodeAverages(tls, bp+64 /* &rc */, bp+48 /* &s */, a, n) @@ -176530,7 +179341,7 @@ __16: (*Fts5Buffer)(unsafe.Pointer(bp + 136 /* &term */)).Fn = *(*int32)(unsafe.Pointer(bp + 164 /* nKeep */)) sqlite3Fts5BufferAppendBlob(tls, bp+64 /* &rc */, bp+136 /* &term */, uint32(*(*int32)(unsafe.Pointer(bp + 156 /* nAppend */))), (a + uintptr(iOff))) sqlite3Fts5BufferAppendPrintf(tls, - bp+64 /* &rc */, bp+48 /* &s */, ts+38336 /* " term=%.*s" */, libc.VaList(bp+16, (*Fts5Buffer)(unsafe.Pointer(bp+136 /* &term */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+136 /* &term */)).Fp)) + bp+64 /* &rc */, bp+48 /* &s */, ts+38849 /* " term=%.*s" */, libc.VaList(bp+16, (*Fts5Buffer)(unsafe.Pointer(bp+136 /* &term */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+136 /* &term */)).Fp)) iOff = iOff + (*(*int32)(unsafe.Pointer(bp + 156 /* nAppend */))) // Figure out where the doclist for this term ends @@ -176569,7 +179380,7 @@ __12: if !(n < 4) { goto __21 } - sqlite3Fts5BufferSet(tls, bp+64 /* &rc */, bp+48 /* &s */, 7, ts+38347 /* "corrupt" */) + sqlite3Fts5BufferSet(tls, bp+64 /* &rc */, bp+48 /* &s */, 7, ts+38860 /* "corrupt" */) goto decode_out goto __22 __21: @@ -176691,7 +179502,7 @@ __39: iOff1 = iOff1 + (*(*int32)(unsafe.Pointer(bp + 188 /* nByte */))) sqlite3Fts5BufferAppendPrintf(tls, - bp+64 /* &rc */, bp+48 /* &s */, ts+38336 /* " term=%.*s" */, libc.VaList(bp+32, (*Fts5Buffer)(unsafe.Pointer(bp+168 /* &term1 */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+168 /* &term1 */)).Fp)) + bp+64 /* &rc */, bp+48 /* &s */, ts+38849 /* " term=%.*s" */, libc.VaList(bp+32, (*Fts5Buffer)(unsafe.Pointer(bp+168 /* &term1 */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+168 /* &term1 */)).Fp)) iOff1 = iOff1 + (fts5DecodeDoclist(tls, bp+64 /* &rc */, bp+48 /* &s */, (a + uintptr(iOff1)), (iEnd - iOff1))) goto __32 __33: @@ -176720,19 +179531,19 @@ __41: } // The implementation of user-defined scalar function fts5_rowid(). -func fts5RowidFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:222916:13: */ +func fts5RowidFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:226337:13: */ var zArg uintptr if nArg == 0 { - Xsqlite3_result_error(tls, pCtx, ts+38355 /* "should be: fts5_..." */, -1) + Xsqlite3_result_error(tls, pCtx, ts+38868 /* "should be: fts5_..." */, -1) } else { zArg = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal))) - if 0 == Xsqlite3_stricmp(tls, zArg, ts+38392 /* "segment" */) { + if 0 == Xsqlite3_stricmp(tls, zArg, ts+38905 /* "segment" */) { var iRowid I64 var segid int32 var pgno int32 if nArg != 3 { Xsqlite3_result_error(tls, pCtx, - ts+38400 /* "should be: fts5_..." */, -1) + ts+38913 /* "should be: fts5_..." */, -1) } else { segid = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) pgno = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + 2*8))) @@ -176741,7 +179552,7 @@ func fts5RowidFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { } } else { Xsqlite3_result_error(tls, pCtx, - ts+38447 /* "first arg to fts..." */, -1) + ts+38960 /* "first arg to fts..." */, -1) } } } @@ -176752,15 +179563,15 @@ func fts5RowidFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { // // If successful, SQLITE_OK is returned. If an error occurs, some other // SQLite error code is returned instead. -func sqlite3Fts5IndexInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:222955:12: */ +func sqlite3Fts5IndexInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:226376:12: */ var rc int32 = Xsqlite3_create_function(tls, - db, ts+38491 /* "fts5_decode" */, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + db, ts+39004 /* "fts5_decode" */, 2, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5DecodeFunction})), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = Xsqlite3_create_function(tls, - db, ts+38503 /* "fts5_decode_none" */, 2, + db, ts+39016 /* "fts5_decode_none" */, 2, SQLITE_UTF8, db, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5DecodeFunction})), uintptr(0), uintptr(0)) @@ -176768,14 +179579,14 @@ func sqlite3Fts5IndexInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:222955 if rc == SQLITE_OK { rc = Xsqlite3_create_function(tls, - db, ts+38520 /* "fts5_rowid" */, -1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + db, ts+39033 /* "fts5_rowid" */, -1, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5RowidFunction})), uintptr(0), uintptr(0)) } return rc } -func sqlite3Fts5IndexReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:222976:12: */ +func sqlite3Fts5IndexReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226397:12: */ if fts5IndexDataVersion(tls, p) != (*Fts5Index)(unsafe.Pointer(p)).FiStructVersion { fts5StructureInvalidate(tls, p) @@ -176802,16 +179613,16 @@ func sqlite3Fts5IndexReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:222976 // structures should not be corrupt. Otherwise, true. If it is false, extra // assert() conditions in the fts5 code are activated - conditions that are // only true if it is guaranteed that the fts5 database is not corrupt. -var Xsqlite3_fts5_may_be_corrupt int32 = 1 /* sqlite3.c:223008:16 */ +var Xsqlite3_fts5_may_be_corrupt int32 = 1 /* sqlite3.c:226429:16 */ type Fts5Auxdata1 = struct { FpAux uintptr FpPtr uintptr FxDelete uintptr FpNext uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5Auxdata = Fts5Auxdata1 /* sqlite3.c:223011:28 */ +type Fts5Auxdata = Fts5Auxdata1 /* sqlite3.c:226432:28 */ type Fts5Auxiliary1 = struct { FpGlobal uintptr FzFunc uintptr @@ -176819,9 +179630,9 @@ type Fts5Auxiliary1 = struct { FxFunc Fts5_extension_function FxDestroy uintptr FpNext uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5Auxiliary = Fts5Auxiliary1 /* sqlite3.c:223012:30 */ +type Fts5Auxiliary = Fts5Auxiliary1 /* sqlite3.c:226433:30 */ type Fts5Cursor1 = struct { Fbase Sqlite3_vtab_cursor FpNext uintptr @@ -176850,35 +179661,35 @@ type Fts5Cursor1 = struct { FnInstAlloc int32 FnInstCount int32 FaInst uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5Cursor = Fts5Cursor1 /* sqlite3.c:223013:27 */ +type Fts5Cursor = Fts5Cursor1 /* sqlite3.c:226434:27 */ type Fts5FullTable1 = struct { Fp Fts5Table FpStorage uintptr FpGlobal uintptr FpSortCsr uintptr -} /* sqlite3.c:223014:9 */ +} /* sqlite3.c:226435:9 */ -type Fts5FullTable = Fts5FullTable1 /* sqlite3.c:223014:30 */ +type Fts5FullTable = Fts5FullTable1 /* sqlite3.c:226435:30 */ type Fts5Sorter1 = struct { FpStmt uintptr FiRowid I64 FaPoslist uintptr FnIdx int32 FaIdx [1]int32 -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5Sorter = Fts5Sorter1 /* sqlite3.c:223015:27 */ +type Fts5Sorter = Fts5Sorter1 /* sqlite3.c:226436:27 */ type Fts5TokenizerModule1 = struct { FzName uintptr FpUserData uintptr Fx Fts5_tokenizer FxDestroy uintptr FpNext uintptr -} /* sqlite3.c:208614:9 */ +} /* sqlite3.c:211770:9 */ -type Fts5TokenizerModule = Fts5TokenizerModule1 /* sqlite3.c:223016:36 */ +type Fts5TokenizerModule = Fts5TokenizerModule1 /* sqlite3.c:226437:36 */ // NOTES ON TRANSACTIONS: // @@ -176912,21 +179723,21 @@ type Fts5TokenizerModule = Fts5TokenizerModule1 /* sqlite3.c:223016:36 */ type Fts5TransactionState = struct { FeState int32 FiSavepoint int32 -} /* sqlite3.c:223049:1 */ +} /* sqlite3.c:226470:1 */ type Fts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 _ [4]byte -} /* sqlite3.c:223106:1 */ +} /* sqlite3.c:226527:1 */ // Return true if pTab is a contentless table. -func fts5IsContentless(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:223290:12: */ +func fts5IsContentless(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:226711:12: */ return (libc.Bool32((*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FeContent == FTS5_CONTENT_NONE)) } // Delete a virtual table handle allocated by fts5InitVtab(). -func fts5FreeVtab(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:223297:13: */ +func fts5FreeVtab(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:226718:13: */ if pTab != 0 { sqlite3Fts5IndexClose(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex) sqlite3Fts5StorageClose(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage) @@ -176936,13 +179747,13 @@ func fts5FreeVtab(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:223297:13: */ } // The xDisconnect() virtual table method. -func fts5DisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:223309:12: */ +func fts5DisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:226730:12: */ fts5FreeVtab(tls, pVtab) return SQLITE_OK } // The xDestroy() virtual table method. -func fts5DestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:223317:12: */ +func fts5DestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:226738:12: */ var pTab uintptr = pVtab var rc int32 = sqlite3Fts5DropAll(tls, (*Fts5Table)(unsafe.Pointer(pTab)).FpConfig) if rc == SQLITE_OK { @@ -176960,7 +179771,7 @@ func fts5DestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:223317 // argv[1] -> database name // argv[2] -> table name // argv[...] -> "column name" and other module argument fields. -func fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:223337:12: */ +func fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:226758:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -177018,11 +179829,11 @@ func fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc i // The xConnect() and xCreate() methods for the virtual table. All the // work is done in function fts5InitVtab(). -func fts5ConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:223403:12: */ +func fts5ConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:226824:12: */ return fts5InitVtab(tls, 0, db, pAux, argc, argv, ppVtab, pzErr) } -func fts5CreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:223413:12: */ +func fts5CreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:226834:12: */ return fts5InitVtab(tls, 1, db, pAux, argc, argv, ppVtab, pzErr) } @@ -177031,13 +179842,25 @@ func fts5CreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv // Set the SQLITE_INDEX_SCAN_UNIQUE flag in pIdxInfo->flags. Unless this // extension is currently being used by a version of SQLite too old to // support index-info flags. In that case this function is a no-op. -func fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) { /* sqlite3.c:223439:13: */ +func fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) { /* sqlite3.c:226860:13: */ { *(*int32)(unsafe.Pointer(pIdxInfo + 80 /* &.idxFlags */)) |= (SQLITE_INDEX_SCAN_UNIQUE) } } +func fts5UsePatternMatch(tls *libc.TLS, pConfig uintptr, p uintptr) int32 { /* sqlite3.c:226871:12: */ + + if ((*Fts5Config)(unsafe.Pointer(pConfig)).FePattern == FTS5_PATTERN_GLOB) && (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_GLOB) { + return 1 + } + if ((*Fts5Config)(unsafe.Pointer(pConfig)).FePattern == FTS5_PATTERN_LIKE) && + ((int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_LIKE) || (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_GLOB)) { + return 1 + } + return 0 +} + // Implementation of the xBestIndex method for FTS5 tables. Within the // WHERE constraint, it searches for the following: // @@ -177066,7 +179889,9 @@ func fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) { /* sqlite3.c:223439:13 // // Match against table column: "m" // Match against rank column: "r" -// Match against other column: "" +// Match against other column: "M" +// LIKE against other column: "L" +// GLOB against other column: "G" // Equality constraint against the rowid: "=" // A < or <= against the rowid: "<" // A > or >= against the rowid: ">" @@ -177095,9 +179920,9 @@ func fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) { /* sqlite3.c:223439:13 // * An == rowid constraint: cost=10.0 // // Costs are not modified by the ORDER BY clause. -func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* sqlite3.c:223509:12: */ - bp := tls.Alloc(8) - defer tls.Free(8) +func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* sqlite3.c:226949:12: */ + bp := tls.Alloc(16) + defer tls.Free(16) var pTab uintptr = pVTab var pConfig uintptr = (*Fts5Table)(unsafe.Pointer(pTab)).FpConfig @@ -177116,11 +179941,11 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* if (*Fts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { (*Fts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, - ts+38531 /* "recursively defi..." */, 0) + ts+39044 /* "recursively defi..." */, 0) return SQLITE_ERROR } - idxStr = Xsqlite3_malloc(tls, (((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint * 6) + 1)) + idxStr = Xsqlite3_malloc(tls, (((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint * 8) + 1)) if idxStr == uintptr(0) { return SQLITE_NOMEM } @@ -177147,23 +179972,34 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* } *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('r') bSeenRank = 1 - } else { + } else if iCol >= 0 { bSeenMatch = 1 - *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('m') - if iCol < nCol { - Xsqlite3_snprintf(tls, 6, (idxStr + uintptr(iIdxStr)), ts+6629 /* "%d" */, libc.VaList(bp, iCol)) - idxStr += uintptr(libc.Xstrlen(tls, (idxStr + uintptr(iIdxStr)))) + *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('M') + Xsqlite3_snprintf(tls, 6, (idxStr + uintptr(iIdxStr)), ts+6705 /* "%d" */, libc.VaList(bp, iCol)) + idxStr += uintptr(libc.Xstrlen(tls, (idxStr + uintptr(iIdxStr)))) - } } (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1) (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1) } - } else if ((((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0) && (bSeenEq == 0)) && - (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ)) && (iCol < 0) { - *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('=') - bSeenEq = 1 - (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1) + } else if (*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0 { + if ((iCol >= 0) && (iCol < nCol)) && (fts5UsePatternMatch(tls, pConfig, p) != 0) { + + *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = func() int8 { + if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == FTS5_PATTERN_LIKE { + return int8('L') + } + return int8('G') + }() + Xsqlite3_snprintf(tls, 6, (idxStr + uintptr(iIdxStr)), ts+6705 /* "%d" */, libc.VaList(bp+8, iCol)) + idxStr += uintptr(libc.Xstrlen(tls, (idxStr + uintptr(iIdxStr)))) + (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1) + + } else if ((bSeenEq == 0) && (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == SQLITE_INDEX_CONSTRAINT_EQ)) && (iCol < 0) { + *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('=') + bSeenEq = 1 + (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1) + } } } @@ -177246,7 +180082,7 @@ func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* return SQLITE_OK } -func fts5NewTransaction(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:223640:12: */ +func fts5NewTransaction(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:227084:12: */ var pCsr uintptr for pCsr = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext { if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab == pTab { @@ -177257,7 +180093,7 @@ func fts5NewTransaction(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:223640 } // Implementation of xOpen method. -func fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:223651:12: */ +func fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:227095:12: */ var pTab uintptr = pVTab var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig var pCsr uintptr = uintptr(0) // New cursor object @@ -177283,7 +180119,7 @@ func fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqli return rc } -func fts5StmtType(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:223677:12: */ +func fts5StmtType(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:227121:12: */ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_SCAN { if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FbDesc != 0 { return FTS5_STMT_SCAN_DESC @@ -177296,11 +180132,11 @@ func fts5StmtType(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:223677:12: * // This function is called after the cursor passed as the only argument // is moved to point at a different row. It clears all cached data // specific to the previous row stored by the cursor object. -func fts5CsrNewrow(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:223689:13: */ +func fts5CsrNewrow(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:227133:13: */ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) |= (((FTS5CSR_REQUIRE_CONTENT | FTS5CSR_REQUIRE_DOCSIZE) | FTS5CSR_REQUIRE_INST) | FTS5CSR_REQUIRE_POSLIST) } -func fts5FreeCursorComponents(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:223698:13: */ +func fts5FreeCursorComponents(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:227142:13: */ var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab var pData uintptr var pNext uintptr @@ -177343,7 +180179,7 @@ func fts5FreeCursorComponents(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:223698 // Close the cursor. For additional information see the documentation // on the xClose method of the virtual table interface. -func fts5CloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:223742:12: */ +func fts5CloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:227186:12: */ if pCursor != 0 { var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab var pCsr uintptr = pCursor @@ -177360,7 +180196,7 @@ func fts5CloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:223742 return SQLITE_OK } -func fts5SorterNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:223758:12: */ +func fts5SorterNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:227202:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -177404,7 +180240,7 @@ func fts5SorterNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:223758:12: // Set the FTS5CSR_REQUIRE_RESEEK flag on all FTS5_PLAN_MATCH cursors // open on table pTab. -func fts5TripCursors(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:223801:13: */ +func fts5TripCursors(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:227245:13: */ var pCsr uintptr for pCsr = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext { if ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_MATCH) && @@ -177424,7 +180260,7 @@ func fts5TripCursors(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:223801:13: */ // // Return SQLITE_OK if successful or if no reseek was required, or an // error code if an error occurred. -func fts5CursorReseek(tls *libc.TLS, pCsr uintptr, pbSkip uintptr) int32 { /* sqlite3.c:223824:12: */ +func fts5CursorReseek(tls *libc.TLS, pCsr uintptr, pbSkip uintptr) int32 { /* sqlite3.c:227268:12: */ var rc int32 = SQLITE_OK if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_REQUIRE_RESEEK)) != 0 { @@ -177453,7 +180289,7 @@ func fts5CursorReseek(tls *libc.TLS, pCsr uintptr, pbSkip uintptr) int32 { /* sq // Return SQLITE_OK if nothing goes wrong. SQLITE_OK is returned // even if we reach end-of-file. The fts5EofMethod() will be called // subsequently to determine whether or not an EOF was hit. -func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:223856:12: */ +func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:227300:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -177512,7 +180348,7 @@ func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:223856: return rc } -func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:223909:12: */ +func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:227353:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -177528,7 +180364,7 @@ func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt u rc = SQLITE_NOMEM } else { rc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1, - SQLITE_PREPARE_PERSISTENT, bp+8 /* &pRet */, uintptr(0)) + uint32(SQLITE_PREPARE_PERSISTENT), bp+8 /* &pRet */, uintptr(0)) if rc != SQLITE_OK { *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, ts+824 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb))) } @@ -177540,7 +180376,7 @@ func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt u return rc } -func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:223938:12: */ +func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:227382:12: */ bp := tls.Alloc(56) defer tls.Free(56) @@ -177569,11 +180405,11 @@ func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int3 // // If SQLite a built-in statement cache, this wouldn't be a problem. rc = fts5PrepareStatement(tls, (pSorter /* &.pStmt */), pConfig, - ts+38570, /* "SELECT rowid, ra..." */ + ts+39083, /* "SELECT rowid, ra..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, func() uintptr { if zRankArgs != 0 { - return ts + 15696 /* ", " */ + return ts + 16160 /* ", " */ } return ts + 800 /* "" */ }(), @@ -177585,9 +180421,9 @@ func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int3 }(), func() uintptr { if bDesc != 0 { - return ts + 38625 /* "DESC" */ + return ts + 39138 /* "DESC" */ } - return ts + 38630 /* "ASC" */ + return ts + 39143 /* "ASC" */ }())) (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter @@ -177607,7 +180443,7 @@ func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int3 return rc } -func fts5CursorFirst(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:223990:12: */ +func fts5CursorFirst(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:227434:12: */ var rc int32 var pExpr uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr rc = sqlite3Fts5ExprFirst(tls, pExpr, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid, bDesc) @@ -177622,7 +180458,7 @@ func fts5CursorFirst(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int // MATCH expression that begins with a '*' character. The remainder of // the text passed to the MATCH operator are used as the special query // parameters. -func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr) int32 { /* sqlite3.c:224007:12: */ +func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr) int32 { /* sqlite3.c:227451:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -177638,13 +180474,13 @@ func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr) (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = FTS5_PLAN_SPECIAL - if (n == 5) && (0 == Xsqlite3_strnicmp(tls, ts+38634 /* "reads" */, z, n)) { + if (n == 5) && (0 == Xsqlite3_strnicmp(tls, ts+39147 /* "reads" */, z, n)) { (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = I64(sqlite3Fts5IndexReads(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) - } else if (n == 2) && (0 == Xsqlite3_strnicmp(tls, ts+6773 /* "id" */, z, n)) { + } else if (n == 2) && (0 == Xsqlite3_strnicmp(tls, ts+6849 /* "id" */, z, n)) { (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { // An unrecognized directive. Return an error message. - (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+38640 /* "unknown special ..." */, libc.VaList(bp, n, z)) + (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+39153 /* "unknown special ..." */, libc.VaList(bp, n, z)) rc = SQLITE_ERROR } @@ -177654,7 +180490,7 @@ func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr) // Search for an auxiliary function named zName that can be used with table // pTab. If one is found, return a pointer to the corresponding Fts5Auxiliary // structure. Otherwise, if no such function exists, return NULL. -func fts5FindAuxiliary(tls *libc.TLS, pTab uintptr, zName uintptr) uintptr { /* sqlite3.c:224042:22: */ +func fts5FindAuxiliary(tls *libc.TLS, pTab uintptr, zName uintptr) uintptr { /* sqlite3.c:227486:22: */ var pAux uintptr for pAux = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpAux; pAux != 0; pAux = (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpNext { @@ -177667,7 +180503,7 @@ func fts5FindAuxiliary(tls *libc.TLS, pTab uintptr, zName uintptr) uintptr { /* return uintptr(0) } -func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:224054:12: */ +func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:227498:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -177679,11 +180515,11 @@ func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:2240 var zRankArgs uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - var zSql uintptr = sqlite3Fts5Mprintf(tls, bp+16 /* &rc */, ts+38668 /* "SELECT %s" */, libc.VaList(bp, zRankArgs)) + var zSql uintptr = sqlite3Fts5Mprintf(tls, bp+16 /* &rc */, ts+39181 /* "SELECT %s" */, libc.VaList(bp, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1, - SQLITE_PREPARE_PERSISTENT, bp+24 /* &pStmt */, uintptr(0)) + uint32(SQLITE_PREPARE_PERSISTENT), bp+24 /* &pStmt */, uintptr(0)) Xsqlite3_free(tls, zSql) if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == SQLITE_OK { @@ -177711,7 +180547,7 @@ func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:2240 pAux = fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+38678 /* "no such function..." */, libc.VaList(bp+8, zRank)) + (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+39191 /* "no such function..." */, libc.VaList(bp+8, zRank)) *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = SQLITE_ERROR } } @@ -177720,7 +180556,7 @@ func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:2240 return *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) } -func fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank uintptr) int32 { /* sqlite3.c:224105:12: */ +func fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank uintptr) int32 { /* sqlite3.c:227549:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -177743,21 +180579,21 @@ func fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank uin *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) |= (FTS5CSR_FREE_ZRANK) } else if rc == SQLITE_ERROR { (*Sqlite3_vtab)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, - ts+38699 /* "parse error in r..." */, libc.VaList(bp, z)) + ts+39212 /* "parse error in r..." */, libc.VaList(bp, z)) } } else { if (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank != 0 { (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*Fts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = ts + 36440 /* "bm25" */ + (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = ts + 36946 /* "bm25" */ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } return rc } -func fts5GetRowidLimit(tls *libc.TLS, pVal uintptr, iDefault I64) I64 { /* sqlite3.c:224142:12: */ +func fts5GetRowidLimit(tls *libc.TLS, pVal uintptr, iDefault I64) I64 { /* sqlite3.c:227586:12: */ if pVal != 0 { var eType int32 = Xsqlite3_value_numeric_type(tls, pVal) if eType == SQLITE_INTEGER { @@ -177776,7 +180612,7 @@ func fts5GetRowidLimit(tls *libc.TLS, pVal uintptr, iDefault I64) I64 { /* sqlit // 1. Full-text search using a MATCH operator. // 2. A by-rowid lookup. // 3. A full-table scan. -func fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, nVal int32, apVal uintptr) int32 { /* sqlite3.c:224163:12: */ +func fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, nVal int32, apVal uintptr) int32 { /* sqlite3.c:227607:12: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -177798,6 +180634,8 @@ func fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintp var pzErr uintptr var zText uintptr + var bGlob int32 + var zText1 uintptr pTab = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab pConfig = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig pCsr = pCursor @@ -177814,7 +180652,7 @@ func fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintp goto __1 } (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, - ts+38531 /* "recursively defi..." */, 0) + ts+39044 /* "recursively defi..." */, 0) return SQLITE_ERROR __1: ; @@ -177838,14 +180676,18 @@ __3: switch int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1))))) { case 'r': goto __7 - case 'm': + case 'M': goto __8 - case '=': + case 'L': goto __9 - case '<': + case 'G': goto __10 - default: + case '=': goto __11 + case '<': + goto __12 + default: + goto __13 } goto __6 __7: @@ -177854,15 +180696,11 @@ __7: __8: zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))) if !(zText == uintptr(0)) { - goto __12 + goto __14 } zText = ts + 800 /* "" */ -__12: +__14: ; - - if !((int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) <= '9')) { - goto __13 - } iCol = 0 __15: iCol = ((iCol * 10) + (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) - '0')) @@ -177875,11 +180713,6 @@ __16: goto __17 __17: ; - goto __14 -__13: - iCol = (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol -__14: - ; if !(int32(*(*int8)(unsafe.Pointer(zText))) == '*') { goto __18 @@ -177892,7 +180725,7 @@ __14: goto __19 __18: pzErr = (pTab /* &.p */ /* &.base */ + 16 /* &.zErrMsg */) - rc = sqlite3Fts5ExprNew(tls, pConfig, iCol, zText, bp+8 /* &pExpr */, pzErr) + rc = sqlite3Fts5ExprNew(tls, pConfig, 0, iCol, zText, bp+8 /* &pExpr */, pzErr) if !(rc == SQLITE_OK) { goto __20 } @@ -177912,12 +180745,49 @@ __19: goto __6 __9: +__10: + bGlob = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(idxStr + uintptr((iIdxStr - 1))))) == 'G')) + zText1 = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))) + iCol = 0 +__22: + iCol = ((iCol * 10) + (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) - '0')) + iIdxStr++ + goto __23 +__23: + if (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) <= '9') { + goto __22 + } + goto __24 +__24: + ; + if !(zText1 != 0) { + goto __25 + } + rc = sqlite3Fts5ExprPattern(tls, pConfig, bGlob, iCol, zText1, bp+8 /* &pExpr */) +__25: + ; + if !(rc == SQLITE_OK) { + goto __26 + } + rc = sqlite3Fts5ExprAnd(tls, (pCsr + 64 /* &.pExpr */), *(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */))) + *(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */)) = uintptr(0) +__26: + ; + if !(rc != SQLITE_OK) { + goto __27 + } + goto filter_out +__27: + ; + goto __6 + +__11: pRowidEq = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)) goto __6 -__10: +__12: pRowidLe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)) goto __6 -__11: +__13: ; pRowidGe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)) goto __6 @@ -177948,25 +180818,25 @@ __5: // sqlite3_index_constraint.omit flag clear for range constraints // on the rowid field. if !(pRowidEq != 0) { - goto __22 + goto __28 } pRowidLe = libc.AssignUintptr(&pRowidGe, pRowidEq) -__22: +__28: ; if !(bDesc != 0) { - goto __23 + goto __29 } (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = fts5GetRowidLimit(tls, pRowidLe, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = fts5GetRowidLimit(tls, pRowidGe, ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))) - goto __24 -__23: + goto __30 +__29: (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = fts5GetRowidLimit(tls, pRowidLe, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = fts5GetRowidLimit(tls, pRowidGe, ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))) -__24: +__30: ; if !((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr != 0) { - goto __25 + goto __31 } // If pSortCsr is non-NULL, then this call is being made as part of // processing for a "... MATCH ORDER BY rank" query (ePlan is @@ -177976,51 +180846,51 @@ __24: // fts5CursorFirstSorted() above. if !((*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FbDesc != 0) { - goto __27 + goto __33 } (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiFirstRowid (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiLastRowid - goto __28 -__27: + goto __34 +__33: (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiLastRowid (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiFirstRowid -__28: +__34: ; (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = FTS5_PLAN_SOURCE (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FpExpr rc = fts5CursorFirst(tls, pTab, pCsr, bDesc) - goto __26 -__25: + goto __32 +__31: if !((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr != 0) { - goto __29 + goto __35 } rc = fts5CursorParseRank(tls, pConfig, pCsr, pRank) if !(rc == SQLITE_OK) { - goto __31 + goto __37 } if !(bOrderByRank != 0) { - goto __32 + goto __38 } (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = FTS5_PLAN_SORTED_MATCH rc = fts5CursorFirstSorted(tls, pTab, pCsr, bDesc) - goto __33 -__32: + goto __39 +__38: (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = FTS5_PLAN_MATCH rc = fts5CursorFirst(tls, pTab, pCsr, bDesc) -__33: +__39: ; -__31: +__37: ; - goto __30 -__29: + goto __36 +__35: if !((*Fts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0)) { - goto __34 + goto __40 } *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, - ts+38732 /* "%s: table does n..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) + ts+39245 /* "%s: table does n..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = SQLITE_ERROR - goto __35 -__34: + goto __41 +__40: // This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup // by rowid (ePlan==FTS5_PLAN_ROWID). (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = func() int32 { @@ -178032,26 +180902,26 @@ __34: rc = sqlite3Fts5StorageStmt(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, fts5StmtType(tls, pCsr), (pCsr + 56 /* &.pStmt */), (pTab /* &.p */ /* &.base */ + 16 /* &.zErrMsg */)) if !(rc == SQLITE_OK) { - goto __36 + goto __42 } if !((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == FTS5_PLAN_ROWID) { - goto __37 + goto __43 } Xsqlite3_bind_value(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 1, pRowidEq) - goto __38 -__37: + goto __44 +__43: Xsqlite3_bind_int64(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 1, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid) Xsqlite3_bind_int64(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 2, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid) -__38: +__44: ; rc = fts5NextMethod(tls, pCursor) +__42: + ; +__41: + ; __36: ; -__35: - ; -__30: - ; -__26: +__32: ; filter_out: @@ -178062,7 +180932,7 @@ filter_out: // This is the xEof method of the virtual table. SQLite calls this // routine to find out if it has reached the end of a result set. -func fts5EofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:224341:12: */ +func fts5EofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:227799:12: */ var pCsr uintptr = pCursor return func() int32 { if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_EOF)) != 0 { @@ -178073,7 +180943,7 @@ func fts5EofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:224341:1 } // Return the rowid that the cursor currently points to. -func fts5CursorRowid(tls *libc.TLS, pCsr uintptr) I64 { /* sqlite3.c:224349:12: */ +func fts5CursorRowid(tls *libc.TLS, pCsr uintptr) I64 { /* sqlite3.c:227807:12: */ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 { return (*Fts5Sorter)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter)).FiRowid @@ -178087,7 +180957,7 @@ func fts5CursorRowid(tls *libc.TLS, pCsr uintptr) I64 { /* sqlite3.c:224349:12: // retrieve the rowid for the current row of the result set. fts5 // exposes %_content.rowid as the rowid for the virtual table. The // rowid should be written to *pRowid. -func fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:224367:12: */ +func fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:227825:12: */ var pCsr uintptr = pCursor var ePlan int32 = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan @@ -178117,7 +180987,7 @@ func fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* // // If argument bErrormsg is true and an error occurs, an error message may // be left in sqlite3_vtab.zErrMsg. -func fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) int32 { /* sqlite3.c:224398:12: */ +func fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) int32 { /* sqlite3.c:227856:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -178161,7 +181031,7 @@ func fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) int32 { /* sql return rc } -func fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:224437:13: */ +func fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:227895:13: */ var ap Va_list _ = ap // ... printf arguments ap = va @@ -178183,7 +181053,7 @@ func fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { / // The commands implemented by this function are documented in the "Special // INSERT Directives" section of the documentation. It should be updated if // more commands are added to this function. -func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) int32 { /* sqlite3.c:224460:12: */ +func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) int32 { /* sqlite3.c:227918:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -178191,30 +181061,31 @@ func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) var rc int32 = SQLITE_OK *(*int32)(unsafe.Pointer(bp /* bError */)) = 0 - if 0 == Xsqlite3_stricmp(tls, ts+38768 /* "delete-all" */, zCmd) { + if 0 == Xsqlite3_stricmp(tls, ts+39281 /* "delete-all" */, zCmd) { if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { fts5SetVtabError(tls, pTab, - ts+38779 /* "'delete-all' may..." */, 0) + ts+39292 /* "'delete-all' may..." */, 0) rc = SQLITE_ERROR } else { rc = sqlite3Fts5StorageDeleteAll(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage) } - } else if 0 == Xsqlite3_stricmp(tls, ts+38859 /* "rebuild" */, zCmd) { + } else if 0 == Xsqlite3_stricmp(tls, ts+39372 /* "rebuild" */, zCmd) { if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NONE { fts5SetVtabError(tls, pTab, - ts+38867 /* "'rebuild' may no..." */, 0) + ts+39380 /* "'rebuild' may no..." */, 0) rc = SQLITE_ERROR } else { rc = sqlite3Fts5StorageRebuild(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage) } - } else if 0 == Xsqlite3_stricmp(tls, ts+17968 /* "optimize" */, zCmd) { + } else if 0 == Xsqlite3_stricmp(tls, ts+18393 /* "optimize" */, zCmd) { rc = sqlite3Fts5StorageOptimize(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage) - } else if 0 == Xsqlite3_stricmp(tls, ts+38923 /* "merge" */, zCmd) { + } else if 0 == Xsqlite3_stricmp(tls, ts+39436 /* "merge" */, zCmd) { var nMerge int32 = Xsqlite3_value_int(tls, pVal) rc = sqlite3Fts5StorageMerge(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, nMerge) - } else if 0 == Xsqlite3_stricmp(tls, ts+38929 /* "integrity-check" */, zCmd) { - rc = sqlite3Fts5StorageIntegrity(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage) + } else if 0 == Xsqlite3_stricmp(tls, ts+39442 /* "integrity-check" */, zCmd) { + var iArg int32 = Xsqlite3_value_int(tls, pVal) + rc = sqlite3Fts5StorageIntegrity(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iArg) } else { rc = sqlite3Fts5IndexLoadConfig(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex) if rc == SQLITE_OK { @@ -178231,7 +181102,7 @@ func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) return rc } -func fts5SpecialDelete(tls *libc.TLS, pTab uintptr, apVal uintptr) int32 { /* sqlite3.c:224515:12: */ +func fts5SpecialDelete(tls *libc.TLS, pTab uintptr, apVal uintptr) int32 { /* sqlite3.c:227974:12: */ var rc int32 = SQLITE_OK var eType1 int32 = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) if eType1 == SQLITE_INTEGER { @@ -178241,7 +181112,7 @@ func fts5SpecialDelete(tls *libc.TLS, pTab uintptr, apVal uintptr) int32 { /* sq return rc } -func fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr, piRowid uintptr) { /* sqlite3.c:224528:13: */ +func fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr, piRowid uintptr) { /* sqlite3.c:227987:13: */ var rc int32 = *(*int32)(unsafe.Pointer(pRc)) if rc == SQLITE_OK { rc = sqlite3Fts5StorageContentInsert(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, piRowid) @@ -178264,7 +181135,7 @@ func fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr, // 2. The "new" rowid. // 3. Values for each of the nCol matchable columns. // 4. Values for the two hidden columns ( and "rank"). -func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, pRowid uintptr) int32 { /* sqlite3.c:224558:12: */ +func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, pRowid uintptr) int32 { /* sqlite3.c:228017:12: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -178286,7 +181157,7 @@ func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, p // A "special" INSERT op. These are handled separately. var z uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))*8))) if ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL) && - (0 == Xsqlite3_stricmp(tls, ts+18507 /* "delete" */, z)) { + (0 == Xsqlite3_stricmp(tls, ts+18932 /* "delete" */, z)) { *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = fts5SpecialDelete(tls, pTab, apVal) } else { *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = fts5SpecialInsert(tls, pTab, z, *(*uintptr)(unsafe.Pointer(apVal + uintptr(((2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)+1))*8))) @@ -178311,12 +181182,12 @@ func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, p // This is not suported. if (eType0 == SQLITE_INTEGER) && (fts5IsContentless(tls, pTab) != 0) { (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, - ts+38945, /* "cannot %s conten..." */ + ts+39458, /* "cannot %s conten..." */ libc.VaList(bp, func() uintptr { if nArg > 1 { - return ts + 21910 /* "UPDATE" */ + return ts + 22311 /* "UPDATE" */ } - return ts + 38982 /* "DELETE from" */ + return ts + 39495 /* "DELETE from" */ }(), (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = SQLITE_ERROR } else if nArg == 1 { @@ -178366,7 +181237,7 @@ func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, p } // Implementation of xSync() method. -func fts5SyncMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224684:12: */ +func fts5SyncMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:228143:12: */ var rc int32 var pTab uintptr = pVtab @@ -178378,7 +181249,7 @@ func fts5SyncMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224684:12 } // Implementation of xBegin() method. -func fts5BeginMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224698:12: */ +func fts5BeginMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:228157:12: */ fts5NewTransaction(tls, pVtab) return SQLITE_OK @@ -178387,7 +181258,7 @@ func fts5BeginMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224698:1 // Implementation of xCommit() method. This is a no-op. The contents of // the pending-terms hash-table have already been flushed into the database // by fts5SyncMethod(). -func fts5CommitMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224709:12: */ +func fts5CommitMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:228168:12: */ _ = pVtab // Call below is a no-op for NDEBUG builds return SQLITE_OK @@ -178395,7 +181266,7 @@ func fts5CommitMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224709: // Implementation of xRollback(). Discard the contents of the pending-terms // hash-table. Any changes made to the database are reverted by SQLite. -func fts5RollbackMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224719:12: */ +func fts5RollbackMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:228178:12: */ var rc int32 var pTab uintptr = pVtab @@ -178403,46 +181274,46 @@ func fts5RollbackMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:22471 return rc } -func fts5ApiUserData(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:224729:13: */ +func fts5ApiUserData(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:228188:13: */ var pCsr uintptr = pCtx return (*Fts5Auxiliary)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux)).FpUserData } -func fts5ApiColumnCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:224734:12: */ +func fts5ApiColumnCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:228193:12: */ var pCsr uintptr = pCtx return (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig)).FnCol } -func fts5ApiColumnTotalSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:224739:12: */ +func fts5ApiColumnTotalSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:228198:12: */ var pCsr uintptr = pCtx var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab return sqlite3Fts5StorageSize(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iCol, pnToken) } -func fts5ApiRowCount(tls *libc.TLS, pCtx uintptr, pnRow uintptr) int32 { /* sqlite3.c:224749:12: */ +func fts5ApiRowCount(tls *libc.TLS, pCtx uintptr, pnRow uintptr) int32 { /* sqlite3.c:228208:12: */ var pCsr uintptr = pCtx var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab return sqlite3Fts5StorageRowCount(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, pnRow) } -func fts5ApiTokenize(tls *libc.TLS, pCtx uintptr, pText uintptr, nText int32, pUserData uintptr, xToken uintptr) int32 { /* sqlite3.c:224755:12: */ +func fts5ApiTokenize(tls *libc.TLS, pCtx uintptr, pText uintptr, nText int32, pUserData uintptr, xToken uintptr) int32 { /* sqlite3.c:228214:12: */ var pCsr uintptr = pCtx var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab return sqlite3Fts5Tokenize(tls, (*Fts5Table)(unsafe.Pointer(pTab)).FpConfig, FTS5_TOKENIZE_AUX, pText, nText, pUserData, xToken) } -func fts5ApiPhraseCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:224768:12: */ +func fts5ApiPhraseCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:228227:12: */ var pCsr uintptr = pCtx return sqlite3Fts5ExprPhraseCount(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) } -func fts5ApiPhraseSize(tls *libc.TLS, pCtx uintptr, iPhrase int32) int32 { /* sqlite3.c:224773:12: */ +func fts5ApiPhraseSize(tls *libc.TLS, pCtx uintptr, iPhrase int32) int32 { /* sqlite3.c:228232:12: */ var pCsr uintptr = pCtx return sqlite3Fts5ExprPhraseSize(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase) } -func fts5ApiColumnText(tls *libc.TLS, pCtx uintptr, iCol int32, pz uintptr, pn uintptr) int32 { /* sqlite3.c:224778:12: */ +func fts5ApiColumnText(tls *libc.TLS, pCtx uintptr, iCol int32, pz uintptr, pn uintptr) int32 { /* sqlite3.c:228237:12: */ var rc int32 = SQLITE_OK var pCsr uintptr = pCtx if (fts5IsContentless(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab) != 0) || @@ -178459,7 +181330,7 @@ func fts5ApiColumnText(tls *libc.TLS, pCtx uintptr, iCol int32, pz uintptr, pn u return rc } -func fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn uintptr) int32 { /* sqlite3.c:224801:12: */ +func fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn uintptr) int32 { /* sqlite3.c:228260:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -178516,7 +181387,7 @@ func fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn u // Ensure that the Fts5Cursor.nInstCount and aInst[] variables are populated // correctly for the current view. Return SQLITE_OK if successful, or an // SQLite error code otherwise. -func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:224853:12: */ +func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:228312:12: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -178598,7 +181469,7 @@ func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:224853 return *(*int32)(unsafe.Pointer(bp /* rc */)) } -func fts5ApiInstCount(tls *libc.TLS, pCtx uintptr, pnInst uintptr) int32 { /* sqlite3.c:224925:12: */ +func fts5ApiInstCount(tls *libc.TLS, pCtx uintptr, pnInst uintptr) int32 { /* sqlite3.c:228384:12: */ var pCsr uintptr = pCtx var rc int32 = SQLITE_OK if (((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_REQUIRE_INST)) == 0) || @@ -178608,7 +181479,7 @@ func fts5ApiInstCount(tls *libc.TLS, pCtx uintptr, pnInst uintptr) int32 { /* sq return rc } -func fts5ApiInst(tls *libc.TLS, pCtx uintptr, iIdx int32, piPhrase uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:224935:12: */ +func fts5ApiInst(tls *libc.TLS, pCtx uintptr, iIdx int32, piPhrase uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:228394:12: */ var pCsr uintptr = pCtx var rc int32 = SQLITE_OK if (((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (FTS5CSR_REQUIRE_INST)) == 0) || @@ -178624,11 +181495,11 @@ func fts5ApiInst(tls *libc.TLS, pCtx uintptr, iIdx int32, piPhrase uintptr, piCo return rc } -func fts5ApiRowid(tls *libc.TLS, pCtx uintptr) Sqlite3_int64 { /* sqlite3.c:224964:22: */ +func fts5ApiRowid(tls *libc.TLS, pCtx uintptr) Sqlite3_int64 { /* sqlite3.c:228423:22: */ return fts5CursorRowid(tls, pCtx) } -func fts5ColumnSizeCb(tls *libc.TLS, pContext uintptr, tflags int32, pUnused uintptr, nUnused int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:224968:12: */ +func fts5ColumnSizeCb(tls *libc.TLS, pContext uintptr, tflags int32, pUnused uintptr, nUnused int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:228427:12: */ var pCnt uintptr = pContext _ = pUnused _ = nUnused @@ -178640,7 +181511,7 @@ func fts5ColumnSizeCb(tls *libc.TLS, pContext uintptr, tflags int32, pUnused uin return SQLITE_OK } -func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:224985:12: */ +func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:228444:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -178698,7 +181569,7 @@ func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) } // Implementation of the xSetAuxdata() method. -func fts5ApiSetAuxdata(tls *libc.TLS, pCtx uintptr, pPtr uintptr, xDelete uintptr) int32 { /* sqlite3.c:225038:12: */ +func fts5ApiSetAuxdata(tls *libc.TLS, pCtx uintptr, pPtr uintptr, xDelete uintptr) int32 { /* sqlite3.c:228497:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -178736,7 +181607,7 @@ func fts5ApiSetAuxdata(tls *libc.TLS, pCtx uintptr, pPtr uintptr, xDelete uintpt return SQLITE_OK } -func fts5ApiGetAuxdata(tls *libc.TLS, pCtx uintptr, bClear int32) uintptr { /* sqlite3.c:225073:13: */ +func fts5ApiGetAuxdata(tls *libc.TLS, pCtx uintptr, bClear int32) uintptr { /* sqlite3.c:228532:13: */ var pCsr uintptr = pCtx var pData uintptr var pRet uintptr = uintptr(0) @@ -178758,7 +181629,7 @@ func fts5ApiGetAuxdata(tls *libc.TLS, pCtx uintptr, bClear int32) uintptr { /* s return pRet } -func fts5ApiPhraseNext(tls *libc.TLS, pUnused uintptr, pIter uintptr, piCol uintptr, piOff uintptr) { /* sqlite3.c:225093:13: */ +func fts5ApiPhraseNext(tls *libc.TLS, pUnused uintptr, pIter uintptr, piCol uintptr, piOff uintptr) { /* sqlite3.c:228552:13: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -178780,7 +181651,7 @@ func fts5ApiPhraseNext(tls *libc.TLS, pUnused uintptr, pIter uintptr, piCol uint } } -func fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:225115:12: */ +func fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:228574:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -178789,7 +181660,13 @@ func fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintpt var rc int32 = fts5CsrPoslist(tls, pCsr, iPhrase, (pIter /* &.a */), bp /* &n */) if rc == SQLITE_OK { - (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp /* n */)))) + + (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = func() uintptr { + if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 { + return ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp /* n */)))) + } + return uintptr(0) + }() *(*int32)(unsafe.Pointer(piCol)) = 0 *(*int32)(unsafe.Pointer(piOff)) = 0 fts5ApiPhraseNext(tls, pCtx, pIter, piCol, piOff) @@ -178797,7 +181674,7 @@ func fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintpt return rc } -func fts5ApiPhraseNextColumn(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol uintptr) { /* sqlite3.c:225133:13: */ +func fts5ApiPhraseNextColumn(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol uintptr) { /* sqlite3.c:228593:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -178830,7 +181707,7 @@ func fts5ApiPhraseNextColumn(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol u } } -func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr) int32 { /* sqlite3.c:225163:12: */ +func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr) int32 { /* sqlite3.c:228623:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -178855,7 +181732,13 @@ func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter rc = sqlite3Fts5ExprPhraseCollist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, (pIter /* &.a */), bp /* &n */) } if rc == SQLITE_OK { - (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp /* n */)))) + + (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = func() uintptr { + if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 { + return ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp /* n */)))) + } + return uintptr(0) + }() *(*int32)(unsafe.Pointer(piCol)) = 0 fts5ApiPhraseNextColumn(tls, pCtx, pIter, piCol) } @@ -178864,7 +181747,13 @@ func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter rc = fts5CsrPoslist(tls, pCsr, iPhrase, (pIter /* &.a */), bp+4 /* &n */) if rc == SQLITE_OK { - (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp + 4 /* n */)))) + + (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = func() uintptr { + if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa != 0 { + return ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp + 4 /* n */)))) + } + return uintptr(0) + }() if *(*int32)(unsafe.Pointer(bp + 4 /* n */)) <= 0 { *(*int32)(unsafe.Pointer(piCol)) = -1 } else if int32(*(*uint8)(unsafe.Pointer((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa))) == 0x01 { @@ -178899,10 +181788,10 @@ var sFts5Api = Fts5ExtensionApi{ FxPhraseNext: 0, FxPhraseFirstColumn: 0, FxPhraseNextColumn: 0, -} /* sqlite3.c:225211:31 */ +} /* sqlite3.c:228673:31 */ // Implementation of API function xQueryPhrase(). -func fts5ApiQueryPhrase(tls *libc.TLS, pCtx uintptr, iPhrase int32, pUserData uintptr, xCallback uintptr) int32 { /* sqlite3.c:225237:12: */ +func fts5ApiQueryPhrase(tls *libc.TLS, pCtx uintptr, iPhrase int32, pUserData uintptr, xCallback uintptr) int32 { /* sqlite3.c:228699:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -178936,14 +181825,14 @@ func fts5ApiQueryPhrase(tls *libc.TLS, pCtx uintptr, iPhrase int32, pUserData ui return rc } -func fts5ApiInvoke(tls *libc.TLS, pAux uintptr, pCsr uintptr, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:225274:13: */ +func fts5ApiInvoke(tls *libc.TLS, pAux uintptr, pCsr uintptr, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:228736:13: */ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux = pAux (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((pAux + 24 /* &.xFunc */))))(tls, uintptr(unsafe.Pointer(&sFts5Api)), pCsr, context, argc, argv) (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux = uintptr(0) } -func fts5CursorFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:225287:19: */ +func fts5CursorFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:228749:19: */ var pCsr uintptr for pCsr = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext { if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId == iCsrId { @@ -178953,7 +181842,7 @@ func fts5CursorFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { / return pCsr } -func fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:225295:13: */ +func fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:228757:13: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -178966,7 +181855,7 @@ func fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { pCsr = fts5CursorFromCsrid(tls, (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpGlobal, iCsrId) if (pCsr == uintptr(0)) || ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 0) { - var zErr uintptr = Xsqlite3_mprintf(tls, ts+38994 /* "no such cursor: ..." */, libc.VaList(bp, iCsrId)) + var zErr uintptr = Xsqlite3_mprintf(tls, ts+39507 /* "no such cursor: ..." */, libc.VaList(bp, iCsrId)) Xsqlite3_result_error(tls, context, zErr, -1) Xsqlite3_free(tls, zErr) } else { @@ -178976,7 +181865,7 @@ func fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // Given cursor id iId, return a pointer to the corresponding Fts5Table // object. Or NULL If the cursor id does not exist. -func sqlite3Fts5TableFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:225324:18: */ +func sqlite3Fts5TableFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:228786:18: */ var pCsr uintptr pCsr = fts5CursorFromCsrid(tls, pGlobal, iCsrId) if pCsr != 0 { @@ -178998,7 +181887,7 @@ func sqlite3Fts5TableFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintp // for phrase 0. The second (same disclaimer) contains the size of position // list 1. And so on. There is no size field for the final position list, // as it can be derived from the total size of the blob. -func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 { /* sqlite3.c:225351:12: */ +func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 { /* sqlite3.c:228813:12: */ bp := tls.Alloc(68) defer tls.Free(68) @@ -179062,7 +181951,7 @@ func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 { /* sqlit // This is the xColumn method, called by SQLite to request a value from // the row that the supplied cursor currently points to. -func fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:225408:12: */ +func fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:228870:12: */ var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig var pCsr uintptr = pCursor @@ -179102,7 +181991,7 @@ func fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) // This routine implements the xFindFunction method for the FTS3 // virtual table. -func fts5FindFunctionMethod(tls *libc.TLS, pVtab uintptr, nUnused int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:225461:12: */ +func fts5FindFunctionMethod(tls *libc.TLS, pVtab uintptr, nUnused int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:228923:12: */ var pTab uintptr = pVtab var pAux uintptr @@ -179121,12 +182010,12 @@ func fts5FindFunctionMethod(tls *libc.TLS, pVtab uintptr, nUnused int32, zName u } // Implementation of FTS5 xRename method. Rename an fts5 table. -func fts5RenameMethod(tls *libc.TLS, pVtab uintptr, zName uintptr) int32 { /* sqlite3.c:225486:12: */ +func fts5RenameMethod(tls *libc.TLS, pVtab uintptr, zName uintptr) int32 { /* sqlite3.c:228948:12: */ var pTab uintptr = pVtab return sqlite3Fts5StorageRename(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, zName) } -func sqlite3Fts5FlushToDisk(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:225494:12: */ +func sqlite3Fts5FlushToDisk(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:228956:12: */ fts5TripCursors(tls, pTab) return sqlite3Fts5StorageSync(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage) } @@ -179134,7 +182023,7 @@ func sqlite3Fts5FlushToDisk(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:22 // The xSavepoint() method. // // Flush the contents of the pending-terms table to disk. -func fts5SavepointMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:225504:12: */ +func fts5SavepointMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:228966:12: */ _ = iSavepoint // Call below is a no-op for NDEBUG builds return sqlite3Fts5FlushToDisk(tls, pVtab) @@ -179143,7 +182032,7 @@ func fts5SavepointMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { // The xRelease() method. // // This is a no-op. -func fts5ReleaseMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:225515:12: */ +func fts5ReleaseMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:228977:12: */ _ = iSavepoint // Call below is a no-op for NDEBUG builds return sqlite3Fts5FlushToDisk(tls, pVtab) @@ -179152,7 +182041,7 @@ func fts5ReleaseMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { / // The xRollbackTo() method. // // Discard the contents of the pending terms table. -func fts5RollbackToMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:225526:12: */ +func fts5RollbackToMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:228988:12: */ var pTab uintptr = pVtab _ = iSavepoint // Call below is a no-op for NDEBUG builds @@ -179161,7 +182050,7 @@ func fts5RollbackToMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 } // Register a new auxiliary function with global context pGlobal. -func fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, xFunc Fts5_extension_function, xDestroy uintptr) int32 { /* sqlite3.c:225537:12: */ +func fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, xFunc Fts5_extension_function, xDestroy uintptr) int32 { /* sqlite3.c:228999:12: */ var pGlobal uintptr = pApi var rc int32 = Xsqlite3_overload_function(tls, (*Fts5Global)(unsafe.Pointer(pGlobal)).Fdb, zName, -1) if rc == SQLITE_OK { @@ -179192,7 +182081,7 @@ func fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr // Register a new tokenizer. This is the implementation of the // fts5_api.xCreateTokenizer() method. -func fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, pTokenizer uintptr, xDestroy uintptr) int32 { /* sqlite3.c:225576:12: */ +func fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, pTokenizer uintptr, xDestroy uintptr) int32 { /* sqlite3.c:229038:12: */ var pGlobal uintptr = pApi var pNew uintptr var nName Sqlite3_int64 // Size of zName and its \0 terminator @@ -179221,7 +182110,7 @@ func fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData u return rc } -func fts5LocateTokenizer(tls *libc.TLS, pGlobal uintptr, zName uintptr) uintptr { /* sqlite3.c:225611:28: */ +func fts5LocateTokenizer(tls *libc.TLS, pGlobal uintptr, zName uintptr) uintptr { /* sqlite3.c:229073:28: */ var pMod uintptr = uintptr(0) if zName == uintptr(0) { @@ -179239,7 +182128,7 @@ func fts5LocateTokenizer(tls *libc.TLS, pGlobal uintptr, zName uintptr) uintptr // Find a tokenizer. This is the implementation of the // fts5_api.xFindTokenizer() method. -func fts5FindTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, ppUserData uintptr, pTokenizer uintptr) int32 { /* sqlite3.c:225632:12: */ +func fts5FindTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, ppUserData uintptr, pTokenizer uintptr) int32 { /* sqlite3.c:229094:12: */ var rc int32 = SQLITE_OK var pMod uintptr @@ -179255,7 +182144,7 @@ func fts5FindTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, ppUserData ui return rc } -func sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nArg int32, ppTok uintptr, ppTokApi uintptr, pzErr uintptr) int32 { /* sqlite3.c:225653:12: */ +func sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nArg int32, pConfig uintptr, pzErr uintptr) int32 { /* sqlite3.c:229115:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -179271,29 +182160,40 @@ func sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nArg if pMod == uintptr(0) { rc = SQLITE_ERROR - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+39015 /* "no such tokenize..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azArg)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+39528 /* "no such tokenize..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azArg)))) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pMod + 16 /* &.x */ /* &.xCreate */))))(tls, (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, (azArg + 1*8), func() int32 { - if nArg != 0 { - return (nArg - 1) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pMod + 16 /* &.x */ /* &.xCreate */))))(tls, + (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, func() uintptr { + if azArg != 0 { + return (azArg + 1*8) + } + return uintptr(0) + }(), func() int32 { + if nArg != 0 { + return (nArg - 1) + } + return 0 + }(), (pConfig + 104 /* &.pTok */)) + (*Fts5Config)(unsafe.Pointer(pConfig)).FpTokApi = (pMod + 16 /* &.x */) + if rc != SQLITE_OK { + if pzErr != 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+39550 /* "error in tokeniz..." */, 0) } - return 0 - }(), ppTok) - *(*uintptr)(unsafe.Pointer(ppTokApi)) = (pMod + 16 /* &.x */) - if (rc != SQLITE_OK) && (pzErr != 0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+39037 /* "error in tokeniz..." */, 0) + } else { + (*Fts5Config)(unsafe.Pointer(pConfig)).FePattern = sqlite3Fts5TokenizerPattern(tls, + (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).Fx.FxCreate, (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok) } } if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(ppTokApi)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(ppTok)) = uintptr(0) + (*Fts5Config)(unsafe.Pointer(pConfig)).FpTokApi = uintptr(0) + (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok = uintptr(0) } return rc } -func fts5ModuleDestroy(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:225685:13: */ +func fts5ModuleDestroy(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:229152:13: */ var pTok uintptr var pNextTok uintptr var pAux uintptr @@ -179319,28 +182219,28 @@ func fts5ModuleDestroy(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:225685:13: */ Xsqlite3_free(tls, pGlobal) } -func fts5Fts5Func(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:225705:13: */ +func fts5Fts5Func(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:229172:13: */ var pGlobal uintptr = Xsqlite3_user_data(tls, pCtx) var ppApi uintptr _ = nArg - ppApi = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(apArg)), ts+39068 /* "fts5_api_ptr" */) + ppApi = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(apArg)), ts+39581 /* "fts5_api_ptr" */) if ppApi != 0 { *(*uintptr)(unsafe.Pointer(ppApi)) = (pGlobal /* &.api */) } } // Implementation of fts5_source_id() function. -func fts5SourceIdFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apUnused uintptr) { /* sqlite3.c:225721:13: */ +func fts5SourceIdFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apUnused uintptr) { /* sqlite3.c:229188:13: */ _ = nArg _ = apUnused - Xsqlite3_result_text(tls, pCtx, ts+39081 /* "fts5: 2020-08-14..." */, -1, libc.UintptrFromInt32(-1)) + Xsqlite3_result_text(tls, pCtx, ts+39594 /* "fts5: 2021-03-12..." */, -1, libc.UintptrFromInt32(-1)) } // Return true if zName is the extension on one of the shadow tables used // by this module. -func fts5ShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:225735:12: */ +func fts5ShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:229202:12: */ var i uint32 for i = uint32(0); uint64(i) < (uint64(unsafe.Sizeof(azName2)) / uint64(unsafe.Sizeof(uintptr(0)))); i++ { if Xsqlite3_stricmp(tls, zName, azName2[i]) == 0 { @@ -179351,10 +182251,10 @@ func fts5ShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:225735:12 } var azName2 = [5]uintptr{ - ts + 39172 /* "config" */, ts + 36629 /* "content" */, ts + 28361 /* "data" */, ts + 36980 /* "docsize" */, ts + 12628, /* "idx" */ -} /* sqlite3.c:225736:21 */ + ts + 39685 /* "config" */, ts + 37135 /* "content" */, ts + 28867 /* "data" */, ts + 37486 /* "docsize" */, ts + 13041, /* "idx" */ +} /* sqlite3.c:229203:21 */ -func fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:225746:12: */ +func fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:229213:12: */ var rc int32 var pGlobal uintptr = uintptr(0) @@ -179375,7 +182275,7 @@ func fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:225746:12: */ (*Fts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxFindTokenizer = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32 }{fts5FindTokenizer})) - rc = Xsqlite3_create_module_v2(tls, db, ts+39179 /* "fts5" */, uintptr(unsafe.Pointer(&fts5Mod)), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5ModuleDestroy}))) + rc = Xsqlite3_create_module_v2(tls, db, ts+39692 /* "fts5" */, uintptr(unsafe.Pointer(&fts5Mod)), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5ModuleDestroy}))) if rc == SQLITE_OK { rc = sqlite3Fts5IndexInit(tls, db) } @@ -179393,13 +182293,13 @@ func fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:225746:12: */ } if rc == SQLITE_OK { rc = Xsqlite3_create_function(tls, - db, ts+39179 /* "fts5" */, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { + db, ts+39692 /* "fts5" */, 1, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5Fts5Func})), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { rc = Xsqlite3_create_function(tls, - db, ts+39184 /* "fts5_source_id" */, 0, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { + db, ts+39697 /* "fts5_source_id" */, 0, SQLITE_UTF8, p, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{fts5SourceIdFunc})), uintptr(0), uintptr(0)) } @@ -179437,7 +182337,7 @@ var fts5Mod = Sqlite3_module{ /* xRelease */ FxRelease: 0, /* xRollbackTo */ FxRollbackTo: 0, /* xShadowName */ FxShadowName: 0, -} /* sqlite3.c:225747:31 */ +} /* sqlite3.c:229214:31 */ // The following functions are used to register the module with SQLite. If // this module is being built as part of the SQLite core (SQLITE_CORE is @@ -179446,7 +182346,7 @@ var fts5Mod = Sqlite3_module{ // Or, if this module is being built as a loadable extension, // sqlite3Fts5Init() is omitted and the two standard entry points // sqlite3_fts_init() and sqlite3_fts5_init() defined instead. -func Xsqlite3Fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:225855:20: */ +func Xsqlite3Fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:229322:20: */ return fts5Init(tls, db) } @@ -179454,7 +182354,7 @@ func Xsqlite3Fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:225855:20: // Fts5Storage.pInsertDocsize - if they have not already been prepared. // Return SQLITE_OK if successful, or an SQLite error code if an error // occurs. -func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:225913:12: */ +func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:229380:12: */ bp := tls.Alloc(216) defer tls.Free(216) @@ -179465,20 +182365,20 @@ func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, p if *(*uintptr)(unsafe.Pointer((p + 40 /* &.aStmt */) + uintptr(eStmt)*8)) == uintptr(0) { *(*[11]uintptr)(unsafe.Pointer(bp + 128 /* azStmt */)) = [11]uintptr{ - ts + 39199, /* "SELECT %s FROM %..." */ - ts + 39267, /* "SELECT %s FROM %..." */ - ts + 39336, /* "SELECT %s FROM %..." */ // LOOKUP + ts + 39712, /* "SELECT %s FROM %..." */ + ts + 39780, /* "SELECT %s FROM %..." */ + ts + 39849, /* "SELECT %s FROM %..." */ // LOOKUP - ts + 39369, /* "INSERT INTO %Q.'..." */ // INSERT_CONTENT - ts + 39408, /* "REPLACE INTO %Q...." */ // REPLACE_CONTENT - ts + 39448, /* "DELETE FROM %Q.'..." */ // DELETE_CONTENT - ts + 39487, /* "REPLACE INTO %Q...." */ // REPLACE_DOCSIZE - ts + 39528, /* "DELETE FROM %Q.'..." */ // DELETE_DOCSIZE + ts + 39882, /* "INSERT INTO %Q.'..." */ // INSERT_CONTENT + ts + 39921, /* "REPLACE INTO %Q...." */ // REPLACE_CONTENT + ts + 39961, /* "DELETE FROM %Q.'..." */ // DELETE_CONTENT + ts + 40000, /* "REPLACE INTO %Q...." */ // REPLACE_DOCSIZE + ts + 40041, /* "DELETE FROM %Q.'..." */ // DELETE_DOCSIZE - ts + 39567, /* "SELECT sz FROM %..." */ // LOOKUP_DOCSIZE + ts + 40080, /* "SELECT sz FROM %..." */ // LOOKUP_DOCSIZE - ts + 39609, /* "REPLACE INTO %Q...." */ // REPLACE_CONFIG - ts + 39649, /* "SELECT %s FROM %..." */ // SCAN + ts + 40122, /* "REPLACE INTO %Q...." */ // REPLACE_CONFIG + ts + 40162, /* "SELECT %s FROM %..." */ // SCAN } var pC uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig var zSql uintptr = uintptr(0) @@ -179555,7 +182455,7 @@ func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, p return rc } -func fts5ExecPrintf(tls *libc.TLS, db uintptr, pzErr uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:226016:12: */ +func fts5ExecPrintf(tls *libc.TLS, db uintptr, pzErr uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:229483:12: */ var rc int32 var ap Va_list _ = ap // ... printf arguments @@ -179577,79 +182477,79 @@ func fts5ExecPrintf(tls *libc.TLS, db uintptr, pzErr uintptr, zFormat uintptr, v // Drop all shadow tables. Return SQLITE_OK if successful or an SQLite error // code otherwise. -func sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:226044:12: */ +func sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:229511:12: */ bp := tls.Alloc(80) defer tls.Free(80) var rc int32 = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), - ts+39672, /* "DROP TABLE IF EX..." */ + ts+40185, /* "DROP TABLE IF EX..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) { rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), - ts+39776, /* "DROP TABLE IF EX..." */ + ts+40289, /* "DROP TABLE IF EX..." */ libc.VaList(bp+48, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) } if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL) { rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), - ts+39814, /* "DROP TABLE IF EX..." */ + ts+40327, /* "DROP TABLE IF EX..." */ libc.VaList(bp+64, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } -func fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail uintptr, zName uintptr) { /* sqlite3.c:226068:13: */ +func fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail uintptr, zName uintptr) { /* sqlite3.c:229535:13: */ bp := tls.Alloc(40) defer tls.Free(40) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { *(*int32)(unsafe.Pointer(pRc)) = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), - ts+39852, /* "ALTER TABLE %Q.'..." */ + ts+40365, /* "ALTER TABLE %Q.'..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } -func sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) int32 { /* sqlite3.c:226082:12: */ +func sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) int32 { /* sqlite3.c:229549:12: */ bp := tls.Alloc(4) defer tls.Free(4) var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5StorageSync(tls, pStorage) - fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+28361 /* "data" */, zName) - fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+12628 /* "idx" */, zName) - fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+39172 /* "config" */, zName) + fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+28867 /* "data" */, zName) + fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+13041 /* "idx" */, zName) + fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+39685 /* "config" */, zName) if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+36980 /* "docsize" */, zName) + fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+37486 /* "docsize" */, zName) } if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+36629 /* "content" */, zName) + fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+37135 /* "content" */, zName) } return *(*int32)(unsafe.Pointer(bp /* rc */)) } // Create the shadow table named zPost, with definition zDefn. Return // SQLITE_OK if successful, or an SQLite error code otherwise. -func sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDefn uintptr, bWithout int32, pzErr uintptr) int32 { /* sqlite3.c:226102:12: */ +func sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDefn uintptr, bWithout int32, pzErr uintptr) int32 { /* sqlite3.c:229569:12: */ bp := tls.Alloc(72) defer tls.Free(72) var rc int32 *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)) = uintptr(0) - rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, bp+64 /* &zErr */, ts+39894, /* "CREATE TABLE %Q...." */ + rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, bp+64 /* &zErr */, ts+40407, /* "CREATE TABLE %Q...." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, func() uintptr { if bWithout != 0 { - return ts + 32976 /* " WITHOUT ROWID" */ + return ts + 33482 /* " WITHOUT ROWID" */ } return ts + 800 /* "" */ }())) if *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)) != 0 { *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, - ts+39924, /* "fts5: error crea..." */ + ts+40437, /* "fts5: error crea..." */ libc.VaList(bp+40, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */))) } @@ -179662,7 +182562,7 @@ func sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDefn // // If successful, set *pp to point to the new object and return SQLITE_OK. // Otherwise, set *pp to NULL and return an SQLite error code. -func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:226137:12: */ +func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:229604:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -179691,27 +182591,27 @@ func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCre } else { var i int32 var iOff int32 - Xsqlite3_snprintf(tls, nDefn, zDefn, ts+39968 /* "id INTEGER PRIMA..." */, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, ts+40481 /* "id INTEGER PRIMA..." */, 0) iOff = int32(libc.Xstrlen(tls, zDefn)) for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ { - Xsqlite3_snprintf(tls, (nDefn - iOff), (zDefn + uintptr(iOff)), ts+39991 /* ", c%d" */, libc.VaList(bp, i)) + Xsqlite3_snprintf(tls, (nDefn - iOff), (zDefn + uintptr(iOff)), ts+40504 /* ", c%d" */, libc.VaList(bp, i)) iOff = iOff + (int32(libc.Xstrlen(tls, (zDefn + uintptr(iOff))))) } - rc = sqlite3Fts5CreateTable(tls, pConfig, ts+36629 /* "content" */, zDefn, 0, pzErr) + rc = sqlite3Fts5CreateTable(tls, pConfig, ts+37135 /* "content" */, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) { rc = sqlite3Fts5CreateTable(tls, - pConfig, ts+36980 /* "docsize" */, ts+39997 /* "id INTEGER PRIMA..." */, 0, pzErr) + pConfig, ts+37486 /* "docsize" */, ts+40510 /* "id INTEGER PRIMA..." */, 0, pzErr) } if rc == SQLITE_OK { rc = sqlite3Fts5CreateTable(tls, - pConfig, ts+39172 /* "config" */, ts+40029 /* "k PRIMARY KEY, v" */, 1, pzErr) + pConfig, ts+39685 /* "config" */, ts+40542 /* "k PRIMARY KEY, v" */, 1, pzErr) } if rc == SQLITE_OK { - rc = sqlite3Fts5StorageConfigValue(tls, p, ts+37126 /* "version" */, uintptr(0), FTS5_CURRENT_VERSION) + rc = sqlite3Fts5StorageConfigValue(tls, p, ts+37632 /* "version" */, uintptr(0), FTS5_CURRENT_VERSION) } } @@ -179723,7 +182623,7 @@ func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCre } // Close a handle opened by an earlier call to sqlite3Fts5StorageOpen(). -func sqlite3Fts5StorageClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226203:12: */ +func sqlite3Fts5StorageClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:229670:12: */ var rc int32 = SQLITE_OK if p != 0 { var i int32 @@ -179742,12 +182642,12 @@ type Fts5InsertCtx1 = struct { FpStorage uintptr FiCol int32 FszCol int32 -} /* sqlite3.c:226218:9 */ +} /* sqlite3.c:229685:9 */ -type Fts5InsertCtx = Fts5InsertCtx1 /* sqlite3.c:226218:30 */ +type Fts5InsertCtx = Fts5InsertCtx1 /* sqlite3.c:229685:30 */ // Tokenization callback used when inserting tokens into the FTS index. -func fts5StorageInsertCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:226228:12: */ +func fts5StorageInsertCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:229695:12: */ var pCtx uintptr = pContext var pIdx uintptr = (*Fts5Storage)(unsafe.Pointer((*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FpStorage)).FpIndex _ = iUnused1 @@ -179764,7 +182664,7 @@ func fts5StorageInsertCallback(tls *libc.TLS, pContext uintptr, tflags int32, pT // If a row with rowid iDel is present in the %_content table, add the // delete-markers to the FTS index necessary to delete it. Do not actually // remove the %_content row at this time though. -func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:226251:12: */ +func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:229718:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -179806,9 +182706,16 @@ func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintpt f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32 }{fts5StorageInsertCallback}))) *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((iCol-1))*8)) -= (I64((*Fts5InsertCtx)(unsafe.Pointer(bp + 8 /* &ctx */)).FszCol)) + if *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((iCol-1))*8)) < int64(0) { + rc = (SQLITE_CORRUPT | (int32(1) << 8)) + } } } - (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow-- + if (rc == SQLITE_OK) && ((*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow < int64(1)) { + rc = (SQLITE_CORRUPT | (int32(1) << 8)) + } else { + (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow-- + } rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pSeek */))) if rc == SQLITE_OK { @@ -179823,7 +182730,7 @@ func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintpt // // If there is no %_docsize table (as happens if the columnsize=0 option // is specified when the FTS5 table is created), this function is a no-op. -func fts5StorageInsertDocsize(tls *libc.TLS, p uintptr, iRowid I64, pBuf uintptr) int32 { /* sqlite3.c:226309:12: */ +func fts5StorageInsertDocsize(tls *libc.TLS, p uintptr, iRowid I64, pBuf uintptr) int32 { /* sqlite3.c:229783:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -179850,7 +182757,7 @@ func fts5StorageInsertDocsize(tls *libc.TLS, p uintptr, iRowid I64, pBuf uintptr // // Return SQLITE_OK if successful, or an SQLite error code if an error // occurs. -func fts5StorageLoadTotals(tls *libc.TLS, p uintptr, bCache int32) int32 { /* sqlite3.c:226339:12: */ +func fts5StorageLoadTotals(tls *libc.TLS, p uintptr, bCache int32) int32 { /* sqlite3.c:229813:12: */ var rc int32 = SQLITE_OK if (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid == 0 { rc = sqlite3Fts5IndexGetAverages(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, (p + 24 /* &.nTotalRow */), (*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize) @@ -179864,7 +182771,7 @@ func fts5StorageLoadTotals(tls *libc.TLS, p uintptr, bCache int32) int32 { /* sq // // Return SQLITE_OK if successful, or an SQLite error code if an error // occurs. -func fts5StorageSaveTotals(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226355:12: */ +func fts5StorageSaveTotals(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:229829:12: */ bp := tls.Alloc(20) defer tls.Free(20) @@ -179888,7 +182795,7 @@ func fts5StorageSaveTotals(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226355 } // Remove a row from the FTS table. -func sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:226377:12: */ +func sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:229851:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -179929,7 +182836,7 @@ func sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) } // Delete all entries in the FTS5 index. -func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226418:12: */ +func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:229892:12: */ bp := tls.Alloc(48) defer tls.Free(48) @@ -179941,12 +182848,12 @@ func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c: // Delete the contents of the %_data and %_docsize tables. rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), - ts+40046, /* "DELETE FROM %Q.'..." */ + ts+40559, /* "DELETE FROM %Q.'..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) { rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), - ts+40096, /* "DELETE FROM %Q.'..." */ + ts+40609, /* "DELETE FROM %Q.'..." */ libc.VaList(bp+32, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)) } @@ -179956,12 +182863,12 @@ func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c: rc = sqlite3Fts5IndexReinit(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = sqlite3Fts5StorageConfigValue(tls, p, ts+37126 /* "version" */, uintptr(0), FTS5_CURRENT_VERSION) + rc = sqlite3Fts5StorageConfigValue(tls, p, ts+37632 /* "version" */, uintptr(0), FTS5_CURRENT_VERSION) } return rc } -func sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226449:12: */ +func sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:229923:12: */ bp := tls.Alloc(44) defer tls.Free(44) @@ -180025,15 +182932,15 @@ func sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:22 return *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) } -func sqlite3Fts5StorageOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226504:12: */ +func sqlite3Fts5StorageOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:229978:12: */ return sqlite3Fts5IndexOptimize(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex) } -func sqlite3Fts5StorageMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:226508:12: */ +func sqlite3Fts5StorageMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:229982:12: */ return sqlite3Fts5IndexMerge(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, nMerge) } -func sqlite3Fts5StorageReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226512:12: */ +func sqlite3Fts5StorageReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:229986:12: */ return sqlite3Fts5IndexReset(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex) } @@ -180044,7 +182951,7 @@ func sqlite3Fts5StorageReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:2265 // // If the %_docsize table does not exist, SQLITE_MISMATCH is returned. In // this case the user is required to provide a rowid explicitly. -func fts5StorageNewRowid(tls *libc.TLS, p uintptr, piRowid uintptr) int32 { /* sqlite3.c:226525:12: */ +func fts5StorageNewRowid(tls *libc.TLS, p uintptr, piRowid uintptr) int32 { /* sqlite3.c:229999:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -180066,7 +182973,7 @@ func fts5StorageNewRowid(tls *libc.TLS, p uintptr, piRowid uintptr) int32 { /* s } // Insert a new row into the FTS content table. -func sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, piRowid uintptr) int32 { /* sqlite3.c:226546:12: */ +func sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, piRowid uintptr) int32 { /* sqlite3.c:230020:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -180098,7 +183005,7 @@ func sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, pi } // Insert new entries into the FTS index and %_docsize table. -func sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRowid I64) int32 { /* sqlite3.c:226581:12: */ +func sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRowid I64) int32 { /* sqlite3.c:230055:12: */ bp := tls.Alloc(36) defer tls.Free(36) @@ -180143,7 +183050,7 @@ func sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRow return *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) } -func fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) int32 { /* sqlite3.c:226624:12: */ +func fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) int32 { /* sqlite3.c:230098:12: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -180151,7 +183058,7 @@ func fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var zSql uintptr var rc int32 - zSql = Xsqlite3_mprintf(tls, ts+40125, /* "SELECT count(*) ..." */ + zSql = Xsqlite3_mprintf(tls, ts+40638, /* "SELECT count(*) ..." */ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = SQLITE_NOMEM @@ -180178,13 +183085,13 @@ type Fts5IntegrityCtx1 = struct { Fcksum U64 FpTermset uintptr FpConfig uintptr -} /* sqlite3.c:226652:9 */ +} /* sqlite3.c:230126:9 */ // Context object used by sqlite3Fts5StorageIntegrity(). -type Fts5IntegrityCtx = Fts5IntegrityCtx1 /* sqlite3.c:226652:33 */ +type Fts5IntegrityCtx = Fts5IntegrityCtx1 /* sqlite3.c:230126:33 */ // Tokenization callback used by integrity check. -func fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:226666:12: */ +func fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:230140:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -180250,18 +183157,20 @@ func fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32, // table. Return SQLITE_OK if they do, or SQLITE_CORRUPT if not. Return // some other SQLite error code if an error occurs while attempting to // determine this. -func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226736:12: */ +func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) int32 { /* sqlite3.c:230210:12: */ bp := tls.Alloc(64) defer tls.Free(64) var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig - var rc int32 // Return code - var aColSize uintptr // Array of size pConfig->nCol - var aTotalSize uintptr // Array of size pConfig->nCol + var rc int32 = SQLITE_OK // Return code + var aColSize uintptr // Array of size pConfig->nCol + var aTotalSize uintptr // Array of size pConfig->nCol // var ctx Fts5IntegrityCtx at bp, 40 // var pScan uintptr at bp+40, 8 + var bUseCksum int32 + libc.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(Fts5IntegrityCtx{}))) (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpConfig = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig aTotalSize = Xsqlite3_malloc64(tls, (uint64(uint64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) * (uint64(unsafe.Sizeof(int32(0))) + uint64(unsafe.Sizeof(I64(0))))))) @@ -180271,88 +183180,92 @@ func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c: aColSize = (aTotalSize + uintptr((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*8) libc.Xmemset(tls, aTotalSize, 0, (uint64(unsafe.Sizeof(I64(0))) * uint64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))) - // Generate the expected index checksum based on the contents of the - // %_content table. This block stores the checksum in ctx.cksum. - rc = fts5StorageGetStmt(tls, p, FTS5_STMT_SCAN, bp+40 /* &pScan */, uintptr(0)) - if rc == SQLITE_OK { - var rc2 int32 - for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */))) { - var i int32 - (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiRowid = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), 0) - (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol = 0 - if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = sqlite3Fts5StorageDocsize(tls, p, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiRowid, aColSize) - } - if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE) { - rc = sqlite3Fts5TermsetNew(tls, (bp /* &ctx */ + 24 /* &.pTermset */)) - } - for i = 0; (rc == SQLITE_OK) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ { - if *(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - continue - } - (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol = i + bUseCksum = (libc.Bool32(((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL) || + (((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_EXTERNAL) && (iArg != 0)))) + if bUseCksum != 0 { + // Generate the expected index checksum based on the contents of the + // %_content table. This block stores the checksum in ctx.cksum. + rc = fts5StorageGetStmt(tls, p, FTS5_STMT_SCAN, bp+40 /* &pScan */, uintptr(0)) + if rc == SQLITE_OK { + var rc2 int32 + for SQLITE_ROW == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */))) { + var i int32 + (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiRowid = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), 0) (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol = 0 - if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS { + if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { + rc = sqlite3Fts5StorageDocsize(tls, p, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiRowid, aColSize) + } + if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_NONE) { rc = sqlite3Fts5TermsetNew(tls, (bp /* &ctx */ + 24 /* &.pTermset */)) } - if rc == SQLITE_OK { - var zText uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), (i + 1)) - var nText int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), (i + 1)) - rc = sqlite3Fts5Tokenize(tls, pConfig, - FTS5_TOKENIZE_DOCUMENT, - zText, nText, - bp, /* &ctx */ - *(*uintptr)(unsafe.Pointer(&struct { - f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32 - }{fts5StorageIntegrityCallback}))) + for i = 0; (rc == SQLITE_OK) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ { + if *(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { + continue + } + (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol = i + (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol = 0 + if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS { + rc = sqlite3Fts5TermsetNew(tls, (bp /* &ctx */ + 24 /* &.pTermset */)) + } + if rc == SQLITE_OK { + var zText uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), (i + 1)) + var nText int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), (i + 1)) + rc = sqlite3Fts5Tokenize(tls, pConfig, + FTS5_TOKENIZE_DOCUMENT, + zText, nText, + bp, /* &ctx */ + *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32 + }{fts5StorageIntegrityCallback}))) + } + if ((rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0)) && ((*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol != *(*int32)(unsafe.Pointer(aColSize + uintptr(i)*4))) { + rc = (SQLITE_CORRUPT | (int32(1) << 8)) + } + *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) += (I64((*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol)) + if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS { + sqlite3Fts5TermsetFree(tls, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset) + (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset = uintptr(0) + } } - if ((rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0)) && ((*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol != *(*int32)(unsafe.Pointer(aColSize + uintptr(i)*4))) { + sqlite3Fts5TermsetFree(tls, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset) + (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset = uintptr(0) + + if rc != SQLITE_OK { + break + } + } + rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */))) + if rc == SQLITE_OK { + rc = rc2 + } + } + + // Test that the "totals" (sometimes called "averages") record looks Ok + if rc == SQLITE_OK { + var i int32 + rc = fts5StorageLoadTotals(tls, p, 0) + for i = 0; (rc == SQLITE_OK) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ { + if *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8)) != *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) { rc = (SQLITE_CORRUPT | (int32(1) << 8)) } - *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) += (I64((*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol)) - if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == FTS5_DETAIL_COLUMNS { - sqlite3Fts5TermsetFree(tls, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset) - (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset = uintptr(0) - } - } - sqlite3Fts5TermsetFree(tls, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset) - (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset = uintptr(0) - - if rc != SQLITE_OK { - break } } - rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */))) - if rc == SQLITE_OK { - rc = rc2 - } - } - // Test that the "totals" (sometimes called "averages") record looks Ok - if rc == SQLITE_OK { - var i int32 - rc = fts5StorageLoadTotals(tls, p, 0) - for i = 0; (rc == SQLITE_OK) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ { - if *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8)) != *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) { + // Check that the %_docsize and %_content tables contain the expected + // number of rows. + if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL) { + *(*I64)(unsafe.Pointer(bp + 48 /* nRow */)) = int64(0) + rc = fts5StorageCount(tls, p, ts+37135 /* "content" */, bp+48 /* &nRow */) + if (rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp + 48 /* nRow */)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow) { rc = (SQLITE_CORRUPT | (int32(1) << 8)) } } - } - - // Check that the %_docsize and %_content tables contain the expected - // number of rows. - if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL) { - *(*I64)(unsafe.Pointer(bp + 48 /* nRow */)) = int64(0) - rc = fts5StorageCount(tls, p, ts+36629 /* "content" */, bp+48 /* &nRow */) - if (rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp + 48 /* nRow */)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow) { - rc = (SQLITE_CORRUPT | (int32(1) << 8)) - } - } - if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) { - *(*I64)(unsafe.Pointer(bp + 56 /* nRow */)) = int64(0) - rc = fts5StorageCount(tls, p, ts+36980 /* "docsize" */, bp+56 /* &nRow */) - if (rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp + 56 /* nRow */)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow) { - rc = (SQLITE_CORRUPT | (int32(1) << 8)) + if (rc == SQLITE_OK) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) { + *(*I64)(unsafe.Pointer(bp + 56 /* nRow */)) = int64(0) + rc = fts5StorageCount(tls, p, ts+37486 /* "docsize" */, bp+56 /* &nRow */) + if (rc == SQLITE_OK) && (*(*I64)(unsafe.Pointer(bp + 56 /* nRow */)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow) { + rc = (SQLITE_CORRUPT | (int32(1) << 8)) + } } } @@ -180360,7 +183273,7 @@ func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c: // verify, amongst other things, that it matches the checksum generated by // inspecting the index itself. if rc == SQLITE_OK { - rc = sqlite3Fts5IndexIntegrityCheck(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).Fcksum) + rc = sqlite3Fts5IndexIntegrityCheck(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).Fcksum, bUseCksum) } Xsqlite3_free(tls, aTotalSize) @@ -180369,7 +183282,7 @@ func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c: // Obtain an SQLite statement handle that may be used to read data from the // %_content table. -func sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:226838:12: */ +func sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:230318:12: */ var rc int32 rc = fts5StorageGetStmt(tls, p, eStmt, pp, pzErrMsg) @@ -180383,7 +183296,7 @@ func sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, p // Release an SQLite statement handle obtained via an earlier call to // sqlite3Fts5StorageStmt(). The eStmt parameter passed to this function // must match that passed to the sqlite3Fts5StorageStmt() call. -func sqlite3Fts5StorageStmtRelease(tls *libc.TLS, p uintptr, eStmt int32, pStmt uintptr) { /* sqlite3.c:226862:13: */ +func sqlite3Fts5StorageStmtRelease(tls *libc.TLS, p uintptr, eStmt int32, pStmt uintptr) { /* sqlite3.c:230342:13: */ if *(*uintptr)(unsafe.Pointer((p + 40 /* &.aStmt */) + uintptr(eStmt)*8)) == uintptr(0) { Xsqlite3_reset(tls, pStmt) @@ -180393,7 +183306,7 @@ func sqlite3Fts5StorageStmtRelease(tls *libc.TLS, p uintptr, eStmt int32, pStmt } } -func fts5StorageDecodeSizeArray(tls *libc.TLS, aCol uintptr, nCol int32, aBlob uintptr, nBlob int32) int32 { /* sqlite3.c:226879:12: */ +func fts5StorageDecodeSizeArray(tls *libc.TLS, aCol uintptr, nCol int32, aBlob uintptr, nBlob int32) int32 { /* sqlite3.c:230359:12: */ var i int32 var iOff int32 = 0 for i = 0; i < nCol; i++ { @@ -180411,7 +183324,7 @@ func fts5StorageDecodeSizeArray(tls *libc.TLS, aCol uintptr, nCol int32, aBlob u // // An SQLite error code is returned if an error occurs, or SQLITE_OK // otherwise. -func sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid I64, aCol uintptr) int32 { /* sqlite3.c:226900:12: */ +func sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid I64, aCol uintptr) int32 { /* sqlite3.c:230380:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -180439,7 +183352,7 @@ func sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid I64, aCol uintpt return rc } -func sqlite3Fts5StorageSize(tls *libc.TLS, p uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:226926:12: */ +func sqlite3Fts5StorageSize(tls *libc.TLS, p uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:230406:12: */ var rc int32 = fts5StorageLoadTotals(tls, p, 0) if rc == SQLITE_OK { *(*I64)(unsafe.Pointer(pnToken)) = int64(0) @@ -180457,7 +183370,7 @@ func sqlite3Fts5StorageSize(tls *libc.TLS, p uintptr, iCol int32, pnToken uintpt return rc } -func sqlite3Fts5StorageRowCount(tls *libc.TLS, p uintptr, pnRow uintptr) int32 { /* sqlite3.c:226944:12: */ +func sqlite3Fts5StorageRowCount(tls *libc.TLS, p uintptr, pnRow uintptr) int32 { /* sqlite3.c:230424:12: */ var rc int32 = fts5StorageLoadTotals(tls, p, 0) if rc == SQLITE_OK { // nTotalRow being zero does not necessarily indicate a corrupt @@ -180474,7 +183387,7 @@ func sqlite3Fts5StorageRowCount(tls *libc.TLS, p uintptr, pnRow uintptr) int32 { } // Flush any data currently held in-memory to disk. -func sqlite3Fts5StorageSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226961:12: */ +func sqlite3Fts5StorageSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:230441:12: */ var rc int32 = SQLITE_OK var iLastRowid I64 = Xsqlite3_last_insert_rowid(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).Fdb) if (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid != 0 { @@ -180488,12 +183401,12 @@ func sqlite3Fts5StorageSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:22696 return rc } -func sqlite3Fts5StorageRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226975:12: */ +func sqlite3Fts5StorageRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:230455:12: */ (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 return sqlite3Fts5IndexRollback(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex) } -func sqlite3Fts5StorageConfigValue(tls *libc.TLS, p uintptr, z uintptr, pVal uintptr, iVal int32) int32 { /* sqlite3.c:226980:12: */ +func sqlite3Fts5StorageConfigValue(tls *libc.TLS, p uintptr, z uintptr, pVal uintptr, iVal int32) int32 { /* sqlite3.c:230460:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -180548,13 +183461,13 @@ var aAsciiTokenChar = [128]uint8{ uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // 0x50..0x5F uint8(0), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), // 0x60..0x6F uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // 0x70..0x7F -} /* sqlite3.c:227033:22 */ +} /* sqlite3.c:230513:22 */ -type AsciiTokenizer1 = struct{ FaTokenChar [128]uint8 } /* sqlite3.c:227044:9 */ +type AsciiTokenizer1 = struct{ FaTokenChar [128]uint8 } /* sqlite3.c:230524:9 */ -type AsciiTokenizer = AsciiTokenizer1 /* sqlite3.c:227044:31 */ +type AsciiTokenizer = AsciiTokenizer1 /* sqlite3.c:230524:31 */ -func fts5AsciiAddExceptions(tls *libc.TLS, p uintptr, zArg uintptr, bTokenChars int32) { /* sqlite3.c:227049:13: */ +func fts5AsciiAddExceptions(tls *libc.TLS, p uintptr, zArg uintptr, bTokenChars int32) { /* sqlite3.c:230529:13: */ var i int32 for i = 0; *(*int8)(unsafe.Pointer(zArg + uintptr(i))) != 0; i++ { if (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) & 0x80) == 0 { @@ -180564,12 +183477,12 @@ func fts5AsciiAddExceptions(tls *libc.TLS, p uintptr, zArg uintptr, bTokenChars } // Delete a "ascii" tokenizer. -func fts5AsciiDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:227065:13: */ +func fts5AsciiDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:230545:13: */ Xsqlite3_free(tls, p) } // Create an "ascii" tokenizer. -func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:227072:12: */ +func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:230552:12: */ var rc int32 = SQLITE_OK var p uintptr = uintptr(0) _ = pUnused @@ -180585,9 +183498,9 @@ func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, libc.Xmemcpy(tls, p /* &.aTokenChar */, uintptr(unsafe.Pointer(&aAsciiTokenChar)), uint64(unsafe.Sizeof(aAsciiTokenChar))) for i = 0; (rc == SQLITE_OK) && (i < nArg); i = i + (2) { var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40157 /* "tokenchars" */) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40670 /* "tokenchars" */) { fts5AsciiAddExceptions(tls, p, zArg, 1) - } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40168 /* "separators" */) { + } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40681 /* "separators" */) { fts5AsciiAddExceptions(tls, p, zArg, 0) } else { rc = SQLITE_ERROR @@ -180604,7 +183517,7 @@ func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, return rc } -func asciiFold(tls *libc.TLS, aOut uintptr, aIn uintptr, nByte int32) { /* sqlite3.c:227113:13: */ +func asciiFold(tls *libc.TLS, aOut uintptr, aIn uintptr, nByte int32) { /* sqlite3.c:230593:13: */ var i int32 for i = 0; i < nByte; i++ { var c int8 = *(*int8)(unsafe.Pointer(aIn + uintptr(i))) @@ -180616,7 +183529,7 @@ func asciiFold(tls *libc.TLS, aOut uintptr, aIn uintptr, nByte int32) { /* sqlit } // Tokenize some text using the ascii tokenizer. -func fts5AsciiTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:227125:12: */ +func fts5AsciiTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:230605:12: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -180695,7 +183608,7 @@ type Unicode61Tokenizer1 = struct { _ [4]byte FaiException uintptr FaCategory [32]uint8 -} /* sqlite3.c:227240:9 */ +} /* sqlite3.c:230720:9 */ // ************************************************************************* // @@ -180705,11 +183618,11 @@ type Unicode61Tokenizer1 = struct { // from the sqlite3 source file utf.c. If this file is compiled as part // of the amalgamation, they are not required. -type Unicode61Tokenizer = Unicode61Tokenizer1 /* sqlite3.c:227240:35 */ +type Unicode61Tokenizer = Unicode61Tokenizer1 /* sqlite3.c:230720:35 */ // Values for eRemoveDiacritic (must match internals of fts5_unicode2.c) -func fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars int32) int32 { /* sqlite3.c:227257:12: */ +func fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars int32) int32 { /* sqlite3.c:230737:12: */ var rc int32 = SQLITE_OK var n int32 = int32(libc.Xstrlen(tls, z)) var aNew uintptr @@ -180764,7 +183677,7 @@ func fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars i } // Return true if the p->aiException[] array contains the value iCode. -func fts5UnicodeIsException(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:227307:12: */ +func fts5UnicodeIsException(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:230787:12: */ if (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException > 0 { var a uintptr = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException var iLo int32 = 0 @@ -180786,7 +183699,7 @@ func fts5UnicodeIsException(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sq } // Delete a "unicode61" tokenizer. -func fts5UnicodeDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:227331:13: */ +func fts5UnicodeDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:230811:13: */ if pTok != 0 { var p uintptr = pTok Xsqlite3_free(tls, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException) @@ -180796,7 +183709,7 @@ func fts5UnicodeDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:227331:13: */ return } -func unicodeSetCategories(tls *libc.TLS, p uintptr, zCat uintptr) int32 { /* sqlite3.c:227341:12: */ +func unicodeSetCategories(tls *libc.TLS, p uintptr, zCat uintptr) int32 { /* sqlite3.c:230821:12: */ var z uintptr = zCat for *(*int8)(unsafe.Pointer(z)) != 0 { @@ -180816,7 +183729,7 @@ func unicodeSetCategories(tls *libc.TLS, p uintptr, zCat uintptr) int32 { /* sql } // Create a "unicode61" tokenizer. -func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:227359:12: */ +func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:230839:12: */ var rc int32 = SQLITE_OK // Return code var p uintptr = uintptr(0) // New tokenizer object @@ -180827,7 +183740,7 @@ func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32 } else { p = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Unicode61Tokenizer{}))) if p != 0 { - var zCat uintptr = ts + 40179 /* "L* N* Co" */ + var zCat uintptr = ts + 40692 /* "L* N* Co" */ var i int32 libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Unicode61Tokenizer{}))) @@ -180840,7 +183753,7 @@ func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32 // Search for a "categories" argument for i = 0; (rc == SQLITE_OK) && (i < nArg); i = i + (2) { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40188 /* "categories" */) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40701 /* "categories" */) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8)) } } @@ -180851,18 +183764,18 @@ func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32 for i = 0; (rc == SQLITE_OK) && (i < nArg); i = i + (2) { var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40199 /* "remove_diacritic..." */) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40712 /* "remove_diacritic..." */) { if (((int32(*(*int8)(unsafe.Pointer(zArg))) != '0') && (int32(*(*int8)(unsafe.Pointer(zArg))) != '1')) && (int32(*(*int8)(unsafe.Pointer(zArg))) != '2')) || (*(*int8)(unsafe.Pointer(zArg + 1)) != 0) { rc = SQLITE_ERROR } else { (*Unicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = (int32(*(*int8)(unsafe.Pointer(zArg))) - '0') } - } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40157 /* "tokenchars" */) { + } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40670 /* "tokenchars" */) { rc = fts5UnicodeAddExceptions(tls, p, zArg, 1) - } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40168 /* "separators" */) { + } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40681 /* "separators" */) { rc = fts5UnicodeAddExceptions(tls, p, zArg, 0) - } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40188 /* "categories" */) { + } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40701 /* "categories" */) { // no-op } else { rc = SQLITE_ERROR @@ -180884,12 +183797,12 @@ func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32 // Return true if, for the purposes of tokenizing with the tokenizer // passed as the first argument, codepoint iCode is considered a token // character (not a separator). -func fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:227439:12: */ +func fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:230919:12: */ return (int32(*(*uint8)(unsafe.Pointer((p + 160 /* &.aCategory */) + uintptr(sqlite3Fts5UnicodeCategory(tls, U32(iCode)))))) ^ fts5UnicodeIsException(tls, p, iCode)) } -func fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:227446:12: */ +func fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:230926:12: */ var p uintptr var rc int32 var a uintptr @@ -181143,7 +184056,7 @@ type PorterTokenizer1 = struct { Ftokenizer Fts5_tokenizer FpTokenizer uintptr FaBuf [128]int8 -} /* sqlite3.c:227558:9 */ +} /* sqlite3.c:231038:9 */ // ************************************************************************* // @@ -181152,10 +184065,10 @@ type PorterTokenizer1 = struct { // Any tokens larger than this (in bytes) are passed through without // stemming. -type PorterTokenizer = PorterTokenizer1 /* sqlite3.c:227558:32 */ +type PorterTokenizer = PorterTokenizer1 /* sqlite3.c:231038:32 */ // Delete a "porter" tokenizer. -func fts5PorterDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:227568:13: */ +func fts5PorterDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:231048:13: */ if pTok != 0 { var p uintptr = pTok if (*PorterTokenizer)(unsafe.Pointer(p)).FpTokenizer != 0 { @@ -181166,7 +184079,7 @@ func fts5PorterDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:227568:13: */ } // Create a "porter" tokenizer. -func fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:227581:12: */ +func fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:231061:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -181174,7 +184087,7 @@ func fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, pp var rc int32 = SQLITE_OK var pRet uintptr *(*uintptr)(unsafe.Pointer(bp /* pUserdata */)) = uintptr(0) - var zBase uintptr = ts + 40217 /* "unicode61" */ + var zBase uintptr = ts + 40730 /* "unicode61" */ if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -181215,9 +184128,9 @@ type PorterContext1 = struct { FpCtx uintptr FxToken uintptr FaBuf uintptr -} /* sqlite3.c:227617:9 */ +} /* sqlite3.c:231097:9 */ -type PorterContext = PorterContext1 /* sqlite3.c:227617:30 */ +type PorterContext = PorterContext1 /* sqlite3.c:231097:30 */ type PorterRule1 = struct { FzSuffix uintptr @@ -181227,15 +184140,15 @@ type PorterRule1 = struct { FzOutput uintptr FnOutput int32 _ [4]byte -} /* sqlite3.c:227624:9 */ +} /* sqlite3.c:231104:9 */ -type PorterRule = PorterRule1 /* sqlite3.c:227624:27 */ +type PorterRule = PorterRule1 /* sqlite3.c:231104:27 */ -func fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) int32 { /* sqlite3.c:227659:12: */ +func fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) int32 { /* sqlite3.c:231139:12: */ return (libc.Bool32((((((int32(c) == 'a') || (int32(c) == 'e')) || (int32(c) == 'i')) || (int32(c) == 'o')) || (int32(c) == 'u')) || ((bYIsVowel != 0) && (int32(c) == 'y')))) } -func fts5PorterGobbleVC(tls *libc.TLS, zStem uintptr, nStem int32, bPrevCons int32) int32 { /* sqlite3.c:227665:12: */ +func fts5PorterGobbleVC(tls *libc.TLS, zStem uintptr, nStem int32, bPrevCons int32) int32 { /* sqlite3.c:231145:12: */ var i int32 var bCons int32 = bPrevCons @@ -181256,12 +184169,12 @@ func fts5PorterGobbleVC(tls *libc.TLS, zStem uintptr, nStem int32, bPrevCons int } // porter rule condition: (m > 0) -func fts5Porter_MGt0(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227682:12: */ +func fts5Porter_MGt0(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:231162:12: */ return libc.BoolInt32(!(!(fts5PorterGobbleVC(tls, zStem, nStem, 0) != 0))) } // porter rule condition: (m > 1) -func fts5Porter_MGt1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227687:12: */ +func fts5Porter_MGt1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:231167:12: */ var n int32 n = fts5PorterGobbleVC(tls, zStem, nStem, 0) if (n != 0) && (fts5PorterGobbleVC(tls, (zStem+uintptr(n)), (nStem-n), 1) != 0) { @@ -181271,7 +184184,7 @@ func fts5Porter_MGt1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlit } // porter rule condition: (m = 1) -func fts5Porter_MEq1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227697:12: */ +func fts5Porter_MEq1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:231177:12: */ var n int32 n = fts5PorterGobbleVC(tls, zStem, nStem, 0) if (n != 0) && (0 == fts5PorterGobbleVC(tls, (zStem+uintptr(n)), (nStem-n), 1)) { @@ -181281,7 +184194,7 @@ func fts5Porter_MEq1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlit } // porter rule condition: (*o) -func fts5Porter_Ostar(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227707:12: */ +func fts5Porter_Ostar(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:231187:12: */ if ((int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 'w') || (int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 'x')) || (int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 'y') { return 0 } else { @@ -181299,14 +184212,14 @@ func fts5Porter_Ostar(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqli } // porter rule condition: (m > 1 and (*S or *T)) -func fts5Porter_MGt1_and_S_or_T(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227724:12: */ +func fts5Porter_MGt1_and_S_or_T(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:231204:12: */ return (libc.Bool32(((int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 's') || (int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 't')) && (fts5Porter_MGt1(tls, zStem, nStem) != 0))) } // porter rule condition: (*v*) -func fts5Porter_Vowel(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227731:12: */ +func fts5Porter_Vowel(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:231211:12: */ var i int32 for i = 0; i < nStem; i++ { if fts5PorterIsVowel(tls, *(*int8)(unsafe.Pointer(zStem + uintptr(i))), (libc.Bool32(i > 0))) != 0 { @@ -181321,13 +184234,13 @@ func fts5Porter_Vowel(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqli // // GENERATED CODE STARTS HERE (mkportersteps.tcl) -func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:227747:12: */ +func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:231227:12: */ var ret int32 = 0 var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) { case 'a': - if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40227 /* "al" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40740 /* "al" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2) } @@ -181335,11 +184248,11 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'c': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40230 /* "ance" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40743 /* "ance" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4) } - } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40235 /* "ence" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40748 /* "ence" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4) } @@ -181347,7 +184260,7 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'e': - if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40240 /* "er" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40753 /* "er" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2) } @@ -181355,7 +184268,7 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'i': - if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40243 /* "ic" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40756 /* "ic" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2) } @@ -181363,11 +184276,11 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'l': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40246 /* "able" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40759 /* "able" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4) } - } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40251 /* "ible" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40764 /* "ible" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4) } @@ -181375,19 +184288,19 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'n': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40256 /* "ant" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40769 /* "ant" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } - } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40260 /* "ement" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40773 /* "ement" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 5) } - } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40266 /* "ment" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40779 /* "ment" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4) } - } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40271 /* "ent" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40784 /* "ent" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -181395,11 +184308,11 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'o': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40275 /* "ion" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40788 /* "ion" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1_and_S_or_T(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } - } else if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40279 /* "ou" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + } else if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40792 /* "ou" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2) } @@ -181407,7 +184320,7 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 's': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40282 /* "ism" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40795 /* "ism" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -181415,11 +184328,11 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 't': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40286 /* "ate" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40799 /* "ate" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } - } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40290 /* "iti" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40803 /* "iti" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -181427,7 +184340,7 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'u': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40294 /* "ous" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40807 /* "ous" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -181435,7 +184348,7 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'v': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40298 /* "ive" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40811 /* "ive" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -181443,7 +184356,7 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'z': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40302 /* "ize" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40815 /* "ize" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -181454,30 +184367,30 @@ func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli return ret } -func fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:227881:12: */ +func fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:231361:12: */ var ret int32 = 0 var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) { case 'a': - if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40306 /* "at" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+40286 /* "ate" */, uint64(3)) + if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40819 /* "at" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+40799 /* "ate" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 2) + 3) ret = 1 } break case 'b': - if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40309 /* "bl" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+40312 /* "ble" */, uint64(3)) + if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40822 /* "bl" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+40825 /* "ble" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 2) + 3) ret = 1 } break case 'i': - if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40316 /* "iz" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+40302 /* "ize" */, uint64(3)) + if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40829 /* "iz" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+40815 /* "ize" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 2) + 3) ret = 1 } @@ -181487,143 +184400,143 @@ func fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sq return ret } -func fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:227915:12: */ +func fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:231395:12: */ var ret int32 = 0 var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) { case 'a': - if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40319 /* "ational" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { + if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40832 /* "ational" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40286 /* "ate" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40799 /* "ate" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3) } - } else if (nBuf > 6) && (0 == libc.Xmemcmp(tls, ts+40327 /* "tional" */, (aBuf+uintptr((nBuf-6))), uint64(6))) { + } else if (nBuf > 6) && (0 == libc.Xmemcmp(tls, ts+40840 /* "tional" */, (aBuf+uintptr((nBuf-6))), uint64(6))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-6)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 6))), ts+40334 /* "tion" */, uint64(4)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 6))), ts+40847 /* "tion" */, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 6) + 4) } } break case 'c': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40339 /* "enci" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40852 /* "enci" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40235 /* "ence" */, uint64(4)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40748 /* "ence" */, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 4) } - } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40344 /* "anci" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40857 /* "anci" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40230 /* "ance" */, uint64(4)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40743 /* "ance" */, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 4) } } break case 'e': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40349 /* "izer" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40862 /* "izer" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40302 /* "ize" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40815 /* "ize" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 3) } } break case 'g': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40354 /* "logi" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40867 /* "logi" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+17306 /* "log" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+17731 /* "log" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 3) } } break case 'l': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40359 /* "bli" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40872 /* "bli" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+40312 /* "ble" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+40825 /* "ble" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 3) + 3) } - } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40363 /* "alli" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40876 /* "alli" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40227 /* "al" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40740 /* "al" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 2) } - } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40368 /* "entli" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40881 /* "entli" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40271 /* "ent" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40784 /* "ent" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3) } - } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40374 /* "eli" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40887 /* "eli" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+40378 /* "e" */, uint64(1)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+40891 /* "e" */, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 3) + 1) } - } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40380 /* "ousli" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40893 /* "ousli" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40294 /* "ous" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40807 /* "ous" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3) } } break case 'o': - if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40386 /* "ization" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { + if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40899 /* "ization" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40302 /* "ize" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40815 /* "ize" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3) } - } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40394 /* "ation" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40907 /* "ation" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40286 /* "ate" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40799 /* "ate" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3) } - } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40400 /* "ator" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40913 /* "ator" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40286 /* "ate" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40799 /* "ate" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 3) } } break case 's': - if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40405 /* "alism" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40918 /* "alism" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40227 /* "al" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40740 /* "al" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2) } - } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40411 /* "iveness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { + } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40924 /* "iveness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40298 /* "ive" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40811 /* "ive" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3) } - } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40419 /* "fulness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { + } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40932 /* "fulness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40427 /* "ful" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40940 /* "ful" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3) } - } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40431 /* "ousness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { + } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40944 /* "ousness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40294 /* "ous" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40807 /* "ous" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3) } } break case 't': - if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40439 /* "aliti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40952 /* "aliti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40227 /* "al" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40740 /* "al" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2) } - } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40445 /* "iviti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40958 /* "iviti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40298 /* "ive" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40811 /* "ive" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3) } - } else if (nBuf > 6) && (0 == libc.Xmemcmp(tls, ts+40451 /* "biliti" */, (aBuf+uintptr((nBuf-6))), uint64(6))) { + } else if (nBuf > 6) && (0 == libc.Xmemcmp(tls, ts+40964 /* "biliti" */, (aBuf+uintptr((nBuf-6))), uint64(6))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-6)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 6))), ts+40312 /* "ble" */, uint64(3)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 6))), ts+40825 /* "ble" */, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 6) + 3) } } @@ -181633,22 +184546,22 @@ func fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli return ret } -func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:228062:12: */ +func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:231542:12: */ var ret int32 = 0 var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) { case 'a': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40458 /* "ical" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40971 /* "ical" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40243 /* "ic" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40756 /* "ic" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 2) } } break case 's': - if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40463 /* "ness" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { + if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40976 /* "ness" */, (aBuf+uintptr((nBuf-4))), uint64(4))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4) } @@ -181656,21 +184569,21 @@ func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 't': - if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40468 /* "icate" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40981 /* "icate" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40243 /* "ic" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40756 /* "ic" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2) } - } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40474 /* "iciti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40987 /* "iciti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40243 /* "ic" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40756 /* "ic" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2) } } break case 'u': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40427 /* "ful" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40940 /* "ful" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) } @@ -181678,7 +184591,7 @@ func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'v': - if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40480 /* "ative" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40993 /* "ative" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 5) } @@ -181686,9 +184599,9 @@ func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli break case 'z': - if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40486 /* "alize" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { + if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40999 /* "alize" */, (aBuf+uintptr((nBuf-5))), uint64(5))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40227 /* "al" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40740 /* "al" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2) } } @@ -181698,18 +184611,18 @@ func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqli return ret } -func fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:228128:12: */ +func fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:231608:12: */ var ret int32 = 0 var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) { case 'e': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40492 /* "eed" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+41005 /* "eed" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 { - libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+40496 /* "ee" */, uint64(2)) + libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+41009 /* "ee" */, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 3) + 2) } - } else if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40499 /* "ed" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { + } else if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+41012 /* "ed" */, (aBuf+uintptr((nBuf-2))), uint64(2))) { if fts5Porter_Vowel(tls, aBuf, (nBuf-2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2) ret = 1 @@ -181718,7 +184631,7 @@ func fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sql break case 'n': - if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40502 /* "ing" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { + if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+41015 /* "ing" */, (aBuf+uintptr((nBuf-3))), uint64(3))) { if fts5Porter_Vowel(tls, aBuf, (nBuf-3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3) ret = 1 @@ -181735,7 +184648,7 @@ func fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sql // // -func fts5PorterStep1A(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) { /* sqlite3.c:228165:13: */ +func fts5PorterStep1A(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) { /* sqlite3.c:231645:13: */ var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf)) if int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 1))))) == 's' { if int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) == 'e' { @@ -181751,7 +184664,7 @@ func fts5PorterStep1A(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) { /* sqlite3.c } } -func fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iStart int32, iEnd int32) int32 { /* sqlite3.c:228183:12: */ +func fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iStart int32, iEnd int32) int32 { /* sqlite3.c:231663:12: */ bp := tls.Alloc(4) defer tls.Free(4) @@ -181845,7 +184758,7 @@ pass_through: } // Tokenize using the porter tokenizer. -func fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:228252:12: */ +func fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:231732:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -181861,33 +184774,249 @@ func fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags i }{fts5PorterCb}))) } -// Register all built-in tokenizers with FTS5. -func sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:228272:12: */ - bp := tls.Alloc(96) - defer tls.Free(96) +// ************************************************************************* +// +// Start of trigram implementation. +type TrigramTokenizer1 = struct{ FbFold int32 } /* sqlite3.c:231752:9 */ - *(*[3]BuiltinTokenizer)(unsafe.Pointer(bp /* aBuiltin */)) = [3]BuiltinTokenizer{ - {FzName: ts + 40217 /* "unicode61" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { +// ************************************************************************* +// +// Start of trigram implementation. +type TrigramTokenizer = TrigramTokenizer1 /* sqlite3.c:231752:33 */ + +// Free a trigram tokenizer. +func fts5TriDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:231760:13: */ + Xsqlite3_free(tls, p) +} + +// Allocate a trigram tokenizer. +func fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:231767:12: */ + var rc int32 = SQLITE_OK + var pNew uintptr = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(TrigramTokenizer{}))) + _ = pUnused + if pNew == uintptr(0) { + rc = SQLITE_NOMEM + } else { + var i int32 + (*TrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = 1 + for i = 0; (rc == SQLITE_OK) && (i < nArg); i = i + (2) { + var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8)) + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+41019 /* "case_sensitive" */) { + if ((int32(*(*int8)(unsafe.Pointer(zArg))) != '0') && (int32(*(*int8)(unsafe.Pointer(zArg))) != '1')) || (*(*int8)(unsafe.Pointer(zArg + 1)) != 0) { + rc = SQLITE_ERROR + } else { + (*TrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(zArg))) == '0')) + } + } else { + rc = SQLITE_ERROR + } + } + if rc != SQLITE_OK { + fts5TriDelete(tls, pNew) + pNew = uintptr(0) + } + } + *(*uintptr)(unsafe.Pointer(ppOut)) = pNew + return rc +} + +// Trigram tokenizer tokenize routine. +func fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:231805:12: */ + bp := tls.Alloc(32) + defer tls.Free(32) + + var p uintptr = pTok + var rc int32 = SQLITE_OK + // var aBuf [32]int8 at bp, 32 + + var zIn uintptr = pText + var zEof uintptr = (zIn + uintptr(nText)) + var iCode U32 + + _ = unusedFlags + for 1 != 0 { + var zOut uintptr = bp /* aBuf */ + var iStart int32 = (int32((int64(zIn) - int64(pText)) / 1)) + var zNext uintptr + + iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))) + if iCode >= U32(0xc0) { + iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))]) + for (zIn != zEof) && ((int32(*(*uint8)(unsafe.Pointer(zIn))) & 0xc0) == 0x80) { + iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))))) + } + if ((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE)) { + iCode = U32(0xFFFD) + } + } + + if iCode == U32(0) { + break + } + zNext = zIn + if zIn < zEof { + if (*TrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { + iCode = U32(sqlite3Fts5UnicodeFold(tls, int32(iCode), 0)) + } + { + if iCode < U32(0x00080) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8((U8(iCode & U32(0xFF)))) + } else if iCode < U32(0x00800) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xC0 + int32((U8((iCode >> 6) & U32(0x1F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } else if iCode < U32(0x10000) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xE0 + int32((U8((iCode >> 12) & U32(0x0F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } else { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xF0 + int32((U8((iCode >> 18) & U32(0x07)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 12) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } + } + + iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))) + if iCode >= U32(0xc0) { + iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))]) + for (zIn != zEof) && ((int32(*(*uint8)(unsafe.Pointer(zIn))) & 0xc0) == 0x80) { + iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))))) + } + if ((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE)) { + iCode = U32(0xFFFD) + } + } + + if iCode == U32(0) { + break + } + } else { + break + } + if zIn < zEof { + if (*TrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { + iCode = U32(sqlite3Fts5UnicodeFold(tls, int32(iCode), 0)) + } + { + if iCode < U32(0x00080) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8((U8(iCode & U32(0xFF)))) + } else if iCode < U32(0x00800) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xC0 + int32((U8((iCode >> 6) & U32(0x1F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } else if iCode < U32(0x10000) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xE0 + int32((U8((iCode >> 12) & U32(0x0F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } else { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xF0 + int32((U8((iCode >> 18) & U32(0x07)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 12) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } + } + + iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))) + if iCode >= U32(0xc0) { + iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))]) + for (zIn != zEof) && ((int32(*(*uint8)(unsafe.Pointer(zIn))) & 0xc0) == 0x80) { + iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))))) + } + if ((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE)) { + iCode = U32(0xFFFD) + } + } + + if iCode == U32(0) { + break + } + if (*TrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { + iCode = U32(sqlite3Fts5UnicodeFold(tls, int32(iCode), 0)) + } + { + if iCode < U32(0x00080) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8((U8(iCode & U32(0xFF)))) + } else if iCode < U32(0x00800) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xC0 + int32((U8((iCode >> 6) & U32(0x1F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } else if iCode < U32(0x10000) { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xE0 + int32((U8((iCode >> 12) & U32(0x0F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } else { + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xF0 + int32((U8((iCode >> 18) & U32(0x07)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 12) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F)))))) + *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F)))))) + } + } + + } else { + break + } + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&xToken)))(tls, pCtx, 0, bp /* &aBuf[0] */, (int32(int64((zOut - bp /* &aBuf[0] */) / 1))), iStart, (int32(int64(((uintptr(iStart) + zOut) - bp /* &aBuf[0] */) / 1)))) + if rc != SQLITE_OK { + break + } + zIn = zNext + } + + return rc +} + +// Argument xCreate is a pointer to a constructor function for a tokenizer. +// pTok is a tokenizer previously created using the same method. This function +// returns one of FTS5_PATTERN_NONE, FTS5_PATTERN_LIKE or FTS5_PATTERN_GLOB +// indicating the style of pattern matching that the tokenizer can support. +// In practice, this is: +// +// "trigram" tokenizer, case_sensitive=1 - FTS5_PATTERN_GLOB +// "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE +// all other tokenizers - FTS5_PATTERN_NONE +func sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) int32 { /* sqlite3.c:231865:12: */ + if xCreate == *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 + }{fts5TriCreate})) { + var p uintptr = pTok + if (*TrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { + return FTS5_PATTERN_LIKE + } + return FTS5_PATTERN_GLOB + } + return FTS5_PATTERN_NONE +} + +// Register all built-in tokenizers with FTS5. +func sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:231879:12: */ + bp := tls.Alloc(128) + defer tls.Free(128) + + *(*[4]BuiltinTokenizer)(unsafe.Pointer(bp /* aBuiltin */)) = [4]BuiltinTokenizer{ + {FzName: ts + 40730 /* "unicode61" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{fts5UnicodeCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5UnicodeDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32 }{fts5UnicodeTokenize}))}}, - {FzName: ts + 40506 /* "ascii" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 41034 /* "ascii" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{fts5AsciiCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5AsciiDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32 }{fts5AsciiTokenize}))}}, - {FzName: ts + 40512 /* "porter" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { + {FzName: ts + 41040 /* "porter" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 }{fts5PorterCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5PorterDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32 }{fts5PorterTokenize}))}}, + {FzName: ts + 41047 /* "trigram" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32 + }{fts5TriCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5TriDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct { + f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32 + }{fts5TriTokenize}))}}, } var rc int32 = SQLITE_OK // Return code var i int32 // To iterate through builtin functions - for i = 0; (rc == SQLITE_OK) && (i < (int32(uint64(unsafe.Sizeof([3]BuiltinTokenizer{})) / uint64(unsafe.Sizeof(BuiltinTokenizer{}))))); i++ { + for i = 0; (rc == SQLITE_OK) && (i < (int32(uint64(unsafe.Sizeof([4]BuiltinTokenizer{})) / uint64(unsafe.Sizeof(BuiltinTokenizer{}))))); i++ { rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 8 /* &.xCreateTokenizer */))))(tls, pApi, (*BuiltinTokenizer)(unsafe.Pointer(bp /* &aBuiltin */ +uintptr(i)*32)).FzName, pApi, @@ -181901,7 +185030,7 @@ func sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c: type BuiltinTokenizer = struct { FzName uintptr Fx Fts5_tokenizer -} /* sqlite3.c:228273:3 */ +} /* sqlite3.c:231880:3 */ // 2012-05-25 // @@ -181924,7 +185053,7 @@ type BuiltinTokenizer = struct { // SMALL LETTER E WITH DIAERESIS" - return 65 ("LATIN SMALL LETTER // E"). The resuls of passing a codepoint that corresponds to an // uppercase letter are undefined. -func fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) int32 { /* sqlite3.c:228327:12: */ +func fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) int32 { /* sqlite3.c:231935:12: */ bp := tls.Alloc(378) defer tls.Free(378) @@ -181995,7 +185124,7 @@ func fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) int32 { /* sq // Return true if the argument interpreted as a unicode codepoint // is a diacritical modifier character. -func sqlite3Fts5UnicodeIsdiacritic(tls *libc.TLS, c int32) int32 { /* sqlite3.c:228394:12: */ +func sqlite3Fts5UnicodeIsdiacritic(tls *libc.TLS, c int32) int32 { /* sqlite3.c:232002:12: */ var mask0 uint32 = uint32(0x08029FDF) var mask1 uint32 = uint32(0x000361F8) if (c < 768) || (c > 817) { @@ -182014,7 +185143,7 @@ func sqlite3Fts5UnicodeIsdiacritic(tls *libc.TLS, c int32) int32 { /* sqlite3.c: // // The results are undefined if the value passed to this function // is less than zero. -func sqlite3Fts5UnicodeFold(tls *libc.TLS, c int32, eRemoveDiacritic int32) int32 { /* sqlite3.c:228413:12: */ +func sqlite3Fts5UnicodeFold(tls *libc.TLS, c int32, eRemoveDiacritic int32) int32 { /* sqlite3.c:232021:12: */ var ret int32 = c @@ -182075,7 +185204,7 @@ type TableEntry = struct { FiCode uint16 Fflags uint8 FnRange uint8 -} /* sqlite3.c:228431:16 */ +} /* sqlite3.c:232039:16 */ var aEntry = [163]TableEntry{ {FiCode: uint16(65), Fflags: uint8(14), FnRange: uint8(26)}, {FiCode: uint16(181), Fflags: uint8(64), FnRange: uint8(1)}, {FiCode: uint16(192), Fflags: uint8(14), FnRange: uint8(23)}, @@ -182133,7 +185262,7 @@ var aEntry = [163]TableEntry{ {FiCode: uint16(42878), Fflags: uint8(1), FnRange: uint8(10)}, {FiCode: uint16(42891), FnRange: uint8(1)}, {FiCode: uint16(42893), Fflags: uint8(74), FnRange: uint8(1)}, {FiCode: uint16(42896), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(42912), Fflags: uint8(1), FnRange: uint8(10)}, {FiCode: uint16(42922), Fflags: uint8(72), FnRange: uint8(1)}, {FiCode: uint16(65313), Fflags: uint8(14), FnRange: uint8(26)}, -} /* sqlite3.c:228435:5 */ +} /* sqlite3.c:232043:5 */ var aiOff = [77]uint16{ uint16(1), uint16(2), uint16(8), uint16(15), uint16(16), uint16(26), uint16(28), uint16(32), uint16(37), uint16(38), uint16(40), uint16(48), uint16(63), uint16(64), uint16(69), uint16(71), @@ -182145,9 +185274,9 @@ var aiOff = [77]uint16{ uint16(65408), uint16(65410), uint16(65415), uint16(65424), uint16(65436), uint16(65439), uint16(65450), uint16(65462), uint16(65472), uint16(65476), uint16(65478), uint16(65480), uint16(65482), uint16(65488), uint16(65506), uint16(65511), uint16(65514), uint16(65521), uint16(65527), uint16(65528), uint16(65529), -} /* sqlite3.c:228492:31 */ +} /* sqlite3.c:232100:31 */ -func sqlite3Fts5UnicodeCatParse(tls *libc.TLS, zCat uintptr, aArray uintptr) int32 { /* sqlite3.c:228549:12: */ +func sqlite3Fts5UnicodeCatParse(tls *libc.TLS, zCat uintptr, aArray uintptr) int32 { /* sqlite3.c:232157:12: */ *(*U8)(unsafe.Pointer(aArray)) = U8(1) switch int32(*(*int8)(unsafe.Pointer(zCat))) { case 'C': @@ -182344,7 +185473,7 @@ func sqlite3Fts5UnicodeCatParse(tls *libc.TLS, zCat uintptr, aArray uintptr) int var aFts5UnicodeBlock = [17]U16{ U16(0), U16(1471), U16(1753), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1763), U16(1765), -} /* sqlite3.c:228667:12 */ +} /* sqlite3.c:232275:12 */ var aFts5UnicodeMap = [1765]U16{ U16(0), U16(32), U16(33), U16(36), U16(37), U16(40), U16(41), U16(42), U16(43), U16(44), U16(45), U16(46), U16(48), U16(58), U16(60), U16(63), U16(65), U16(91), U16(92), U16(93), @@ -182523,7 +185652,7 @@ var aFts5UnicodeMap = [1765]U16{ U16(62406), U16(62432), U16(62464), U16(62528), U16(62530), U16(62713), U16(62720), U16(62784), U16(62800), U16(62971), U16(63045), U16(63104), U16(63232), U16(0), U16(42710), U16(42752), U16(46900), U16(46912), U16(47133), U16(63488), U16(1), U16(32), U16(256), U16(0), U16(65533), -} /* sqlite3.c:228671:12 */ +} /* sqlite3.c:232279:12 */ var aFts5UnicodeData = [1765]U16{ U16(1025), U16(61), U16(117), U16(55), U16(117), U16(54), U16(50), U16(53), U16(57), U16(53), U16(49), U16(85), U16(333), U16(85), U16(121), U16(85), U16(841), U16(54), U16(53), U16(50), @@ -182702,9 +185831,9 @@ var aFts5UnicodeData = [1765]U16{ U16(186), U16(570), U16(2042), U16(58), U16(5850), U16(154), U16(2010), U16(154), U16(794), U16(2266), U16(378), U16(2266), U16(3738), U16(39), U16(39), U16(39), U16(39), U16(39), U16(39), U16(17351), U16(34), U16(3074), U16(7692), U16(63), U16(63), -} /* sqlite3.c:228850:12 */ +} /* sqlite3.c:232458:12 */ -func sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode U32) int32 { /* sqlite3.c:229030:12: */ +func sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode U32) int32 { /* sqlite3.c:232638:12: */ var iRes int32 = -1 var iHi int32 var iLo int32 @@ -182744,7 +185873,7 @@ func sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode U32) int32 { /* sqlite3.c:2 return 9 } -func sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { /* sqlite3.c:229061:13: */ +func sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { /* sqlite3.c:232669:13: */ var i int32 = 0 var iTbl int32 = 0 for i < 128 { @@ -182755,6 +185884,7 @@ func sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { /* } iTbl++ } + *(*U8)(unsafe.Pointer(aAscii)) = U8(0) // 0x00 is never a token character } // 2015 May 30 @@ -182775,7 +185905,7 @@ func sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { /* // This is a copy of the sqlite3GetVarint32() routine from the SQLite core. // Except, this version does handle the single byte case that the core // version depends on being handled before its function is called. -func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 { /* sqlite3.c:229097:12: */ +func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 { /* sqlite3.c:232707:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -182850,7 +185980,7 @@ func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 { /* sqli // 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 sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:229175:11: */ +func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:232785:11: */ var a U32 var b U32 var s U32 @@ -182880,7 +186010,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c a = a | (U32(*(*uint8)(unsafe.Pointer(p)))) // a: p0<<14 | p2 (unmasked) if !((a & U32(0x80)) != 0) { - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) b = b & (U32(0x7f)) b = (b << 7) a = a | (b) @@ -182889,13 +186019,13 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c } // CSE1 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) // b: p1<<14 | p3 (unmasked) if !((b & U32(0x80)) != 0) { - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); a = (a << 7) @@ -182909,7 +186039,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) // moved CSE1 up // a &= (0x7f<<14)|(0x7f); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) s = a // s: p0<<14 | p2 (masked) @@ -182940,7 +186070,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c if !((b & U32(0x80)) != 0) { // we can skip this cause it was (effectively) done above in calc'ing s // b &= (0x7f<<28)|(0x7f<<14)|(0x7f); - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) a = (a << 7) a = a | (b) s = (s >> 18) @@ -182954,7 +186084,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // a: p2<<28 | p4<<14 | p6 (unmasked) if !((a & U32(0x80)) != 0) { a = a & (SLOT_4_2_0) - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 7) a = a | (b) s = (s >> 11) @@ -182963,7 +186093,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c } // CSE2 from below - a = a & (SLOT_2_0) + a = a & (U32(SLOT_2_0)) p++ b = (b << 14) b = b | (U32(*(*uint8)(unsafe.Pointer(p)))) @@ -182986,7 +186116,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // moved CSE2 up // a &= (0x7f<<29)|(0x7f<<15)|(0xff); - b = b & (SLOT_2_0) + b = b & (U32(SLOT_2_0)) b = (b << 8) a = a | (b) @@ -183026,7 +186156,7 @@ func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c // 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 fts5PutVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:229369:26: */ +func fts5PutVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:232979:26: */ bp := tls.Alloc(10) defer tls.Free(10) @@ -183072,7 +186202,7 @@ __3: return n } -func sqlite3Fts5PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:229394:12: */ +func sqlite3Fts5PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:233004:12: */ if v <= uint64(0x7f) { *(*uint8)(unsafe.Pointer(p)) = (uint8(v & uint64(0x7f))) return 1 @@ -183085,7 +186215,7 @@ func sqlite3Fts5PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c: return fts5PutVarint64(tls, p, v) } -func sqlite3Fts5GetVarintLen(tls *libc.TLS, iVal U32) int32 { /* sqlite3.c:229408:12: */ +func sqlite3Fts5GetVarintLen(tls *libc.TLS, iVal U32) int32 { /* sqlite3.c:233018:12: */ if iVal < (U32(int32(1) << 14)) { return 2 @@ -183145,7 +186275,7 @@ type Fts5VocabTable1 = struct { FpGlobal uintptr FeType int32 FbBusy uint32 -} /* sqlite3.c:229461:9 */ +} /* sqlite3.c:233071:9 */ // 2015 May 08 // @@ -183185,7 +186315,7 @@ type Fts5VocabTable1 = struct { // #include "fts5Int.h" -type Fts5VocabTable = Fts5VocabTable1 /* sqlite3.c:229461:31 */ +type Fts5VocabTable = Fts5VocabTable1 /* sqlite3.c:233071:31 */ type Fts5VocabCursor1 = struct { Fbase Sqlite3_vtab_cursor FpStmt uintptr @@ -183205,9 +186335,9 @@ type Fts5VocabCursor1 = struct { FiInstPos I64 FiInstOff int32 _ [4]byte -} /* sqlite3.c:229462:9 */ +} /* sqlite3.c:233072:9 */ -type Fts5VocabCursor = Fts5VocabCursor1 /* sqlite3.c:229462:32 */ +type Fts5VocabCursor = Fts5VocabCursor1 /* sqlite3.c:233072:32 */ // Bits for the mask used as the idxNum value by xBestIndex/xFilter. @@ -183215,7 +186345,7 @@ type Fts5VocabCursor = Fts5VocabCursor1 /* sqlite3.c:229462:32 */ // FTS5_VOCAB_XXX constant. If successful, set *peType to the output // value and return SQLITE_OK. Otherwise, set *pzErr to an error message // and return SQLITE_ERROR. -func fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uintptr) int32 { /* sqlite3.c:229521:12: */ +func fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uintptr) int32 { /* sqlite3.c:233131:12: */ bp := tls.Alloc(12) defer tls.Free(12) @@ -183223,14 +186353,14 @@ func fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uint var zCopy uintptr = sqlite3Fts5Strndup(tls, bp+8 /* &rc */, zType, -1) if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == SQLITE_OK { sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, ts+40519 /* "col" */) == 0 { + if Xsqlite3_stricmp(tls, zCopy, ts+41055 /* "col" */) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL - } else if Xsqlite3_stricmp(tls, zCopy, ts+40523 /* "row" */) == 0 { + } else if Xsqlite3_stricmp(tls, zCopy, ts+41059 /* "row" */) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_ROW - } else if Xsqlite3_stricmp(tls, zCopy, ts+40527 /* "instance" */) == 0 { + } else if Xsqlite3_stricmp(tls, zCopy, ts+41063 /* "instance" */) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_INSTANCE } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+40536 /* "fts5vocab: unkno..." */, libc.VaList(bp, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+41072 /* "fts5vocab: unkno..." */, libc.VaList(bp, zCopy)) *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = SQLITE_ERROR } Xsqlite3_free(tls, zCopy) @@ -183240,14 +186370,14 @@ func fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uint } // The xDisconnect() virtual table method. -func fts5VocabDisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:229550:12: */ +func fts5VocabDisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:233160:12: */ var pTab uintptr = pVtab Xsqlite3_free(tls, pTab) return SQLITE_OK } // The xDestroy() virtual table method. -func fts5VocabDestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:229559:12: */ +func fts5VocabDestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:233169:12: */ var pTab uintptr = pVtab Xsqlite3_free(tls, pTab) return SQLITE_OK @@ -183272,24 +186402,24 @@ func fts5VocabDestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:2 // argv[3] -> name of fts5 tables database // argv[4] -> name of fts5 table // argv[5] -> type of fts5vocab table -func fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:229586:12: */ +func fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:233196:12: */ bp := tls.Alloc(36) defer tls.Free(36) *(*[3]uintptr)(unsafe.Pointer(bp + 8 /* azSchema */)) = [3]uintptr{ - ts + 40570, /* "CREATE TABlE voc..." */ - ts + 40610, /* "CREATE TABlE voc..." */ - ts + 40645, /* "CREATE TABlE voc..." */ + ts + 41106, /* "CREATE TABlE voc..." */ + ts + 41146, /* "CREATE TABlE voc..." */ + ts + 41181, /* "CREATE TABlE voc..." */ } var pRet uintptr = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = SQLITE_OK // Return code var bDb int32 - bDb = (libc.Bool32(((argc == 6) && (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4))) && (libc.Xmemcmp(tls, ts+24978 /* "temp" */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0))) + bDb = (libc.Bool32(((argc == 6) && (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4))) && (libc.Xmemcmp(tls, ts+25484 /* "temp" */, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0))) if (argc != 5) && (bDb == 0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+40688 /* "wrong number of ..." */, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+41224 /* "wrong number of ..." */, 0) *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = SQLITE_ERROR } else { var nByte int32 // Bytes of space to allocate @@ -183342,11 +186472,11 @@ func fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv // The xConnect() and xCreate() methods for the virtual table. All the // work is done in function fts5VocabInitVtab(). -func fts5VocabConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:229648:12: */ +func fts5VocabConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:233258:12: */ return fts5VocabInitVtab(tls, db, pAux, argc, argv, ppVtab, pzErr) } -func fts5VocabCreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:229658:12: */ +func fts5VocabCreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:233268:12: */ return fts5VocabInitVtab(tls, db, pAux, argc, argv, ppVtab, pzErr) } @@ -183360,7 +186490,7 @@ func fts5VocabCreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, // // are interpreted. Less-than and less-than-or-equal are treated // identically, as are greater-than and greater-than-or-equal. -func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int32 { /* sqlite3.c:229681:12: */ +func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int32 { /* sqlite3.c:233291:12: */ var i int32 var iTermEq int32 = -1 var iTermGe int32 = -1 @@ -183428,7 +186558,7 @@ func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int } // Implementation of xOpen method. -func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:229743:12: */ +func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:233353:12: */ bp := tls.Alloc(80) defer tls.Free(80) @@ -183441,11 +186571,11 @@ func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { (*Sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, - ts+40721 /* "recursive defini..." */, libc.VaList(bp, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + ts+41257 /* "recursive defini..." */, libc.VaList(bp, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return SQLITE_ERROR } zSql = sqlite3Fts5Mprintf(tls, bp+64, /* &rc */ - ts+40752, /* "SELECT t.%Q FROM..." */ + ts+41288, /* "SELECT t.%Q FROM..." */ libc.VaList(bp+16, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = Xsqlite3_prepare_v2(tls, (*Fts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -1, bp+72 /* &pStmt */, uintptr(0)) @@ -183469,7 +186599,7 @@ func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* *(*uintptr)(unsafe.Pointer(bp + 72 /* pStmt */)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == SQLITE_OK { (*Sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, - ts+40803 /* "no such fts5 tab..." */, libc.VaList(bp+48, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + ts+41339 /* "no such fts5 tab..." */, libc.VaList(bp+48, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = SQLITE_ERROR } } else { @@ -183495,7 +186625,7 @@ func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* return *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) } -func fts5VocabResetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:229811:13: */ +func fts5VocabResetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:233421:13: */ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Frowid = int64(0) sqlite3Fts5IterClose(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter) (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter = uintptr(0) @@ -183507,7 +186637,7 @@ func fts5VocabResetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:229811:13: // Close the cursor. For additional information see the documentation // on the xClose method of the virtual table interface. -func fts5VocabCloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:229825:12: */ +func fts5VocabCloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:233435:12: */ var pCsr uintptr = pCursor fts5VocabResetCursor(tls, pCsr) sqlite3Fts5BufferFree(tls, (pCsr + 88 /* &.term */)) @@ -183516,7 +186646,7 @@ func fts5VocabCloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:2 return SQLITE_OK } -func fts5VocabInstanceNewTerm(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:229834:12: */ +func fts5VocabInstanceNewTerm(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:233444:12: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -183547,7 +186677,7 @@ func fts5VocabInstanceNewTerm(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c: return *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) } -func fts5VocabInstanceNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:229856:12: */ +func fts5VocabInstanceNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:233466:12: */ var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail var rc int32 = SQLITE_OK var pIter uintptr = (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter @@ -183576,7 +186706,7 @@ func fts5VocabInstanceNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:229 } // Advance the cursor to the next row in the table. -func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:229888:12: */ +func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:233498:12: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -183716,7 +186846,7 @@ func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:22 } // This is the xFilter implementation for the virtual table. -func fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnused uintptr, nUnused int32, apVal uintptr) int32 { /* sqlite3.c:230014:12: */ +func fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnused uintptr, nUnused int32, apVal uintptr) int32 { /* sqlite3.c:233624:12: */ var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab var pCsr uintptr = pCursor var eType int32 = (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType @@ -183787,12 +186917,12 @@ func fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnused // This is the xEof method of the virtual table. SQLite calls this // routine to find out if it has reached the end of a result set. -func fts5VocabEofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:230085:12: */ +func fts5VocabEofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:233695:12: */ var pCsr uintptr = pCursor return (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof } -func fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:230090:12: */ +func fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:233700:12: */ var pCsr uintptr = pCursor var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail var eType int32 = (*Fts5VocabTable)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FeType @@ -183865,16 +186995,16 @@ func fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol in // This is the xRowid method. The SQLite core calls this routine to // retrieve the rowid for the current row of the result set. The // rowid should be written to *pRowid. -func fts5VocabRowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:230162:12: */ +func fts5VocabRowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:233772:12: */ var pCsr uintptr = pCursor *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Frowid return SQLITE_OK } -func sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:230171:12: */ +func sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:233781:12: */ var p uintptr = pGlobal - return Xsqlite3_create_module_v2(tls, db, ts+40829 /* "fts5vocab" */, uintptr(unsafe.Pointer(&fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, ts+41365 /* "fts5vocab" */, uintptr(unsafe.Pointer(&fts5Vocab)), p, uintptr(0)) } var fts5Vocab = Sqlite3_module{ @@ -183891,7 +187021,7 @@ var fts5Vocab = Sqlite3_module{ /* xEof */ FxEof: 0, /* xColumn */ FxColumn: 0, /* xRowid */ FxRowid: 0, -} /* sqlite3.c:230172:31 */ +} /* sqlite3.c:233782:31 */ //************* End of fts5.c *********************************************** //************* Begin file stmt.c ******************************************* @@ -183924,7 +187054,7 @@ var fts5Vocab = Sqlite3_module{ type stmt_vtab = struct { Fbase Sqlite3_vtab Fdb uintptr -} /* sqlite3.c:230244:9 */ +} /* sqlite3.c:233854:9 */ //************* End of fts5.c *********************************************** //************* Begin file stmt.c ******************************************* @@ -183954,7 +187084,7 @@ type stmt_vtab = struct { // stmt_vtab is a subclass of sqlite3_vtab which will // serve as the underlying representation of a stmt virtual table -type Stmt_vtab = stmt_vtab /* sqlite3.c:230244:26 */ +type Stmt_vtab = stmt_vtab /* sqlite3.c:233854:26 */ // stmt_cursor is a subclass of sqlite3_vtab_cursor which will // serve as the underlying representation of a cursor that scans @@ -183964,12 +187094,12 @@ type stmt_cursor = struct { Fdb uintptr FpStmt uintptr FiRowid Sqlite3_int64 -} /* sqlite3.c:230254:9 */ +} /* sqlite3.c:233864:9 */ // stmt_cursor is a subclass of sqlite3_vtab_cursor which will // serve as the underlying representation of a cursor that scans // over rows of the result -type Stmt_cursor = stmt_cursor /* sqlite3.c:230254:28 */ +type Stmt_cursor = stmt_cursor /* sqlite3.c:233864:28 */ // The stmtConnect() method is invoked to create a new // stmt_vtab that describes the stmt virtual table. @@ -183982,7 +187112,7 @@ type Stmt_cursor = stmt_cursor /* sqlite3.c:230254:28 */ // // (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the // result set of queries against stmt will look like. -func stmtConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:230275:12: */ +func stmtConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:233885:12: */ var pNew uintptr var rc int32 @@ -183990,7 +187120,7 @@ func stmtConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintp rc = Xsqlite3_declare_vtab(tls, db, - ts+40839 /* "CREATE TABLE x(s..." */) + ts+41375 /* "CREATE TABLE x(s..." */) if rc == SQLITE_OK { pNew = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Stmt_vtab{}))) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -184004,13 +187134,13 @@ func stmtConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintp } // This method is the destructor for stmt_cursor objects. -func stmtDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:230315:12: */ +func stmtDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:233925:12: */ Xsqlite3_free(tls, pVtab) return SQLITE_OK } // Constructor for a new stmt_cursor object. -func stmtOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:230323:12: */ +func stmtOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:233933:12: */ var pCur uintptr pCur = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Stmt_cursor{}))) if pCur == uintptr(0) { @@ -184023,13 +187153,13 @@ func stmtOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:2 } // Destructor for a stmt_cursor. -func stmtClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:230336:12: */ +func stmtClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:233946:12: */ Xsqlite3_free(tls, cur) return SQLITE_OK } // Advance a stmt_cursor to its next row of output. -func stmtNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:230345:12: */ +func stmtNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:233955:12: */ var pCur uintptr = cur (*Stmt_cursor)(unsafe.Pointer(pCur)).FiRowid++ (*Stmt_cursor)(unsafe.Pointer(pCur)).FpStmt = Xsqlite3_next_stmt(tls, (*Stmt_cursor)(unsafe.Pointer(pCur)).Fdb, (*Stmt_cursor)(unsafe.Pointer(pCur)).FpStmt) @@ -184038,7 +187168,7 @@ func stmtNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:230345:12: */ // Return values of columns for the row at which the stmt_cursor // is currently pointing. -func stmtColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:230356:12: */ +func stmtColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:233966:12: */ var pCur uintptr = cur switch i { case STMT_COLUMN_SQL: @@ -184096,7 +187226,7 @@ func stmtColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sql // Return the rowid for the current row. In this implementation, the // rowid is the same as the output value. -func stmtRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:230403:12: */ +func stmtRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:234013:12: */ var pCur uintptr = cur *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = (*Stmt_cursor)(unsafe.Pointer(pCur)).FiRowid return SQLITE_OK @@ -184104,7 +187234,7 @@ func stmtRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c: // Return TRUE if the cursor has been moved off of the last // row of output. -func stmtEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:230413:12: */ +func stmtEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:234023:12: */ var pCur uintptr = cur return (libc.Bool32((*Stmt_cursor)(unsafe.Pointer(pCur)).FpStmt == uintptr(0))) } @@ -184113,7 +187243,7 @@ func stmtEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:230413:12: */ // to the first row of output. This method is always called at least // once prior to any call to stmtColumn() or stmtRowid() or // stmtEof(). -func stmtFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:230424:12: */ +func stmtFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:234034:12: */ var pCur uintptr = pVtabCursor (*Stmt_cursor)(unsafe.Pointer(pCur)).FpStmt = uintptr(0) (*Stmt_cursor)(unsafe.Pointer(pCur)).FiRowid = int64(0) @@ -184124,7 +187254,7 @@ func stmtFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr // that uses the stmt virtual table. This routine needs to create // a query plan for each invocation and compute an estimated cost for that // plan. -func stmtBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:230441:12: */ +func stmtBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:234051:12: */ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(500) (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(500) return SQLITE_OK @@ -184143,945 +187273,950 @@ var stmtModule = Sqlite3_module{ // xCreate FxEof: 0, // xEof - check for end of scan FxColumn: 0, // xColumn - read data FxRowid: 0, // xShadowName -} /* sqlite3.c:230454:23 */ +} /* sqlite3.c:234064:23 */ -func Xsqlite3StmtVtabInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:230483:20: */ +func Xsqlite3StmtVtabInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:234093:20: */ var rc int32 = SQLITE_OK - rc = Xsqlite3_create_module(tls, db, ts+40911 /* "sqlite_stmt" */, uintptr(unsafe.Pointer(&stmtModule)), uintptr(0)) + rc = Xsqlite3_create_module(tls, db, ts+41447 /* "sqlite_stmt" */, uintptr(unsafe.Pointer(&stmtModule)), uintptr(0)) return rc } //************* End of stmt.c *********************************************** // Return the source-id for this library -func Xsqlite3_sourceid(tls *libc.TLS) uintptr { /* sqlite3.c:230516:23: */ - return ts + 40923 /* "2020-08-14 13:23..." */ +func Xsqlite3_sourceid(tls *libc.TLS) uintptr { /* sqlite3.c:234126:23: */ + return ts + 41459 /* "2021-03-12 15:10..." */ } //************************* End of sqlite3.c ***************************** func init() { - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 16 /* .xStep */)) = jsonArrayStep // sqlite3.c:188003:7: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 24 /* .xFinal */)) = jsonArrayFinal // sqlite3.c:188003:24: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 32 /* .xValue */)) = jsonArrayValue // sqlite3.c:188003:41: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 56 /* .xStep */)) = jsonObjectStep // sqlite3.c:188005:7: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 64 /* .xFinal */)) = jsonObjectFinal // sqlite3.c:188005:24: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 72 /* .xValue */)) = jsonObjectValue // sqlite3.c:188005:41: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 0 /* .xStep */)) = geopolyBBoxStep // sqlite3.c:194216:8: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 8 /* .xFinal */)) = geopolyBBoxFinal // sqlite3.c:194216:25: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 24 /* .xSFunc */)) = renameColumnFunc // sqlite3.c:107540:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 96 /* .xSFunc */)) = renameTableFunc // sqlite3.c:107541:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 168 /* .xSFunc */)) = renameTableTest // sqlite3.c:107542:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 24 /* .xSFunc */)) = versionFunc // sqlite3.c:118977:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 96 /* .xSFunc */)) = versionFunc // sqlite3.c:118978:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 168 /* .xSFunc */)) = versionFunc // sqlite3.c:118979:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 240 /* .xSFunc */)) = soundexFunc // sqlite3.c:118985:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 312 /* .xSFunc */)) = loadExt // sqlite3.c:118988:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 384 /* .xSFunc */)) = loadExt // sqlite3.c:118989:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 456 /* .xSFunc */)) = compileoptionusedFunc // sqlite3.c:118995:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 528 /* .xSFunc */)) = compileoptiongetFunc // sqlite3.c:118996:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 600 /* .xSFunc */)) = versionFunc // sqlite3.c:118998:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 672 /* .xSFunc */)) = versionFunc // sqlite3.c:118999:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 744 /* .xSFunc */)) = versionFunc // sqlite3.c:119000:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 816 /* .xSFunc */)) = versionFunc // sqlite3.c:119002:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 888 /* .xSFunc */)) = trimFunc // sqlite3.c:119005:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 960 /* .xSFunc */)) = trimFunc // sqlite3.c:119006:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1032 /* .xSFunc */)) = trimFunc // sqlite3.c:119007:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1104 /* .xSFunc */)) = trimFunc // sqlite3.c:119008:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1176 /* .xSFunc */)) = trimFunc // sqlite3.c:119009:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1248 /* .xSFunc */)) = trimFunc // sqlite3.c:119010:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1320 /* .xSFunc */)) = minmaxFunc // sqlite3.c:119011:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1464 /* .xSFunc */)) = minmaxStep // sqlite3.c:119013:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1472 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:119013:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1480 /* .xValue */)) = minMaxValue // sqlite3.c:119013:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1536 /* .xSFunc */)) = minmaxFunc // sqlite3.c:119015:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1680 /* .xSFunc */)) = minmaxStep // sqlite3.c:119017:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1688 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:119017:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1696 /* .xValue */)) = minMaxValue // sqlite3.c:119017:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1752 /* .xSFunc */)) = typeofFunc // sqlite3.c:119019:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1824 /* .xSFunc */)) = lengthFunc // sqlite3.c:119020:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1896 /* .xSFunc */)) = instrFunc // sqlite3.c:119021:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1968 /* .xSFunc */)) = printfFunc // sqlite3.c:119022:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2040 /* .xSFunc */)) = unicodeFunc // sqlite3.c:119023:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2112 /* .xSFunc */)) = charFunc // sqlite3.c:119024:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2184 /* .xSFunc */)) = absFunc // sqlite3.c:119025:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2256 /* .xSFunc */)) = roundFunc // sqlite3.c:119027:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2328 /* .xSFunc */)) = roundFunc // sqlite3.c:119028:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2400 /* .xSFunc */)) = upperFunc // sqlite3.c:119030:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2472 /* .xSFunc */)) = lowerFunc // sqlite3.c:119031:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2544 /* .xSFunc */)) = hexFunc // sqlite3.c:119032:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2616 /* .xSFunc */)) = versionFunc // sqlite3.c:119033:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2688 /* .xSFunc */)) = randomFunc // sqlite3.c:119034:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2760 /* .xSFunc */)) = randomBlob // sqlite3.c:119035:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2832 /* .xSFunc */)) = nullifFunc // sqlite3.c:119036:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2904 /* .xSFunc */)) = versionFunc // sqlite3.c:119037:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2976 /* .xSFunc */)) = sourceidFunc // sqlite3.c:119038:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3048 /* .xSFunc */)) = errlogFunc // sqlite3.c:119039:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3120 /* .xSFunc */)) = quoteFunc // sqlite3.c:119040:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3192 /* .xSFunc */)) = last_insert_rowid // sqlite3.c:119041:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3264 /* .xSFunc */)) = changes // sqlite3.c:119042:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3336 /* .xSFunc */)) = total_changes // sqlite3.c:119043:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3408 /* .xSFunc */)) = replaceFunc // sqlite3.c:119044:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3480 /* .xSFunc */)) = zeroblobFunc // sqlite3.c:119045:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3552 /* .xSFunc */)) = substrFunc // sqlite3.c:119046:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3624 /* .xSFunc */)) = substrFunc // sqlite3.c:119047:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3696 /* .xSFunc */)) = sumStep // sqlite3.c:119048:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3704 /* .xFinalize */)) = sumFinalize // sqlite3.c:119048:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3712 /* .xValue */)) = sumFinalize // sqlite3.c:119048:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3720 /* .xInverse */)) = sumInverse // sqlite3.c:119048:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3768 /* .xSFunc */)) = sumStep // sqlite3.c:119049:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3776 /* .xFinalize */)) = totalFinalize // sqlite3.c:119049:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3784 /* .xValue */)) = totalFinalize // sqlite3.c:119049:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3792 /* .xInverse */)) = sumInverse // sqlite3.c:119049:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3840 /* .xSFunc */)) = sumStep // sqlite3.c:119050:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3848 /* .xFinalize */)) = avgFinalize // sqlite3.c:119050:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3856 /* .xValue */)) = avgFinalize // sqlite3.c:119050:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3864 /* .xInverse */)) = sumInverse // sqlite3.c:119050:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3912 /* .xSFunc */)) = countStep // sqlite3.c:119051:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3920 /* .xFinalize */)) = countFinalize // sqlite3.c:119051:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3928 /* .xValue */)) = countFinalize // sqlite3.c:119051:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3936 /* .xInverse */)) = countInverse // sqlite3.c:119051:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3984 /* .xSFunc */)) = countStep // sqlite3.c:119053:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3992 /* .xFinalize */)) = countFinalize // sqlite3.c:119053:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4000 /* .xValue */)) = countFinalize // sqlite3.c:119053:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4008 /* .xInverse */)) = countInverse // sqlite3.c:119053:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4056 /* .xSFunc */)) = groupConcatStep // sqlite3.c:119055:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4064 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:119055:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4072 /* .xValue */)) = groupConcatValue // sqlite3.c:119055:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4080 /* .xInverse */)) = groupConcatInverse // sqlite3.c:119055:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4128 /* .xSFunc */)) = groupConcatStep // sqlite3.c:119057:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4136 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:119057:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4144 /* .xValue */)) = groupConcatValue // sqlite3.c:119057:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4152 /* .xInverse */)) = groupConcatInverse // sqlite3.c:119057:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4184 /* .pUserData */)) = uintptr(unsafe.Pointer(&globInfo)) // sqlite3.c:119060:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4200 /* .xSFunc */)) = likeFunc // sqlite3.c:119060:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4256 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:119065:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4272 /* .xSFunc */)) = likeFunc // sqlite3.c:119065:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4328 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:119066:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4344 /* .xSFunc */)) = likeFunc // sqlite3.c:119066:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4560 /* .xSFunc */)) = versionFunc // sqlite3.c:119073:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4632 /* .xSFunc */)) = versionFunc // sqlite3.c:119074:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 8 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22948:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 24 /* .xSFunc */)) = juliandayFunc // sqlite3.c:22948:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 80 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22949:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 96 /* .xSFunc */)) = dateFunc // sqlite3.c:22949:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 152 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22950:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 168 /* .xSFunc */)) = timeFunc // sqlite3.c:22950:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 224 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22951:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 240 /* .xSFunc */)) = datetimeFunc // sqlite3.c:22951:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 296 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22952:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 312 /* .xSFunc */)) = strftimeFunc // sqlite3.c:22952:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 384 /* .xSFunc */)) = ctimeFunc // sqlite3.c:22953:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 456 /* .xSFunc */)) = ctimestampFunc // sqlite3.c:22954:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 528 /* .xSFunc */)) = cdateFunc // sqlite3.c:22955:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 16 /* .xFunc */)) = jsonRemoveFunc // sqlite3.c:187973:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 40 /* .xFunc */)) = jsonArrayFunc // sqlite3.c:187974:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 64 /* .xFunc */)) = jsonArrayLengthFunc // sqlite3.c:187975:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 88 /* .xFunc */)) = jsonArrayLengthFunc // sqlite3.c:187976:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 112 /* .xFunc */)) = jsonExtractFunc // sqlite3.c:187977:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 136 /* .xFunc */)) = jsonSetFunc // sqlite3.c:187978:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 160 /* .xFunc */)) = jsonObjectFunc // sqlite3.c:187979:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 184 /* .xFunc */)) = jsonPatchFunc // sqlite3.c:187980:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 208 /* .xFunc */)) = jsonQuoteFunc // sqlite3.c:187981:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 232 /* .xFunc */)) = jsonRemoveFunc // sqlite3.c:187982:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 256 /* .xFunc */)) = jsonReplaceFunc // sqlite3.c:187983:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 280 /* .xFunc */)) = jsonSetFunc // sqlite3.c:187984:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 304 /* .xFunc */)) = jsonTypeFunc // sqlite3.c:187985:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 328 /* .xFunc */)) = jsonTypeFunc // sqlite3.c:187986:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 352 /* .xFunc */)) = jsonValidFunc // sqlite3.c:187987:39: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 0 /* .xFunc */)) = geopolyAreaFunc // sqlite3.c:194198:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 24 /* .xFunc */)) = geopolyBlobFunc // sqlite3.c:194199:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 48 /* .xFunc */)) = geopolyJsonFunc // sqlite3.c:194200:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 72 /* .xFunc */)) = geopolySvgFunc // sqlite3.c:194201:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 96 /* .xFunc */)) = geopolyWithinFunc // sqlite3.c:194202:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 120 /* .xFunc */)) = geopolyContainsPointFunc // sqlite3.c:194203:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 144 /* .xFunc */)) = geopolyOverlapFunc // sqlite3.c:194204:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 168 /* .xFunc */)) = geopolyDebugFunc // sqlite3.c:194205:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 192 /* .xFunc */)) = geopolyBBoxFunc // sqlite3.c:194206:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 216 /* .xFunc */)) = geopolyXformFunc // sqlite3.c:194207:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 240 /* .xFunc */)) = geopolyRegularFunc // sqlite3.c:194208:8: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 264 /* .xFunc */)) = geopolyCcwFunc // sqlite3.c:194209:8: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 8 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonEachModule)) // sqlite3.c:188012:31: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 24 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonTreeModule)) // sqlite3.c:188013:31: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 16 /* .xStep */)) = jsonArrayStep // sqlite3.c:191026:7: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 24 /* .xFinal */)) = jsonArrayFinal // sqlite3.c:191026:24: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 32 /* .xValue */)) = jsonArrayValue // sqlite3.c:191026:41: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 56 /* .xStep */)) = jsonObjectStep // sqlite3.c:191028:7: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 64 /* .xFinal */)) = jsonObjectFinal // sqlite3.c:191028:24: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 72 /* .xValue */)) = jsonObjectValue // sqlite3.c:191028:41: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 0 /* .xStep */)) = geopolyBBoxStep // sqlite3.c:197239:8: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 8 /* .xFinal */)) = geopolyBBoxFinal // sqlite3.c:197239:25: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 24 /* .xSFunc */)) = renameColumnFunc // sqlite3.c:108694:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 96 /* .xSFunc */)) = renameTableFunc // sqlite3.c:108695:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 168 /* .xSFunc */)) = renameTableTest // sqlite3.c:108696:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 240 /* .xSFunc */)) = dropColumnFunc // sqlite3.c:108697:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 24 /* .xSFunc */)) = versionFunc // sqlite3.c:120473:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 96 /* .xSFunc */)) = versionFunc // sqlite3.c:120474:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 168 /* .xSFunc */)) = versionFunc // sqlite3.c:120475:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 240 /* .xSFunc */)) = soundexFunc // sqlite3.c:120481:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 312 /* .xSFunc */)) = loadExt // sqlite3.c:120484:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 384 /* .xSFunc */)) = loadExt // sqlite3.c:120485:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 456 /* .xSFunc */)) = compileoptionusedFunc // sqlite3.c:120491:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 528 /* .xSFunc */)) = compileoptiongetFunc // sqlite3.c:120492:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 600 /* .xSFunc */)) = versionFunc // sqlite3.c:120494:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 672 /* .xSFunc */)) = versionFunc // sqlite3.c:120495:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 744 /* .xSFunc */)) = versionFunc // sqlite3.c:120496:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 816 /* .xSFunc */)) = versionFunc // sqlite3.c:120498:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 888 /* .xSFunc */)) = trimFunc // sqlite3.c:120501:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 960 /* .xSFunc */)) = trimFunc // sqlite3.c:120502:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1032 /* .xSFunc */)) = trimFunc // sqlite3.c:120503:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1104 /* .xSFunc */)) = trimFunc // sqlite3.c:120504:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1176 /* .xSFunc */)) = trimFunc // sqlite3.c:120505:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1248 /* .xSFunc */)) = trimFunc // sqlite3.c:120506:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1320 /* .xSFunc */)) = minmaxFunc // sqlite3.c:120507:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1464 /* .xSFunc */)) = minmaxStep // sqlite3.c:120509:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1472 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:120509:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1480 /* .xValue */)) = minMaxValue // sqlite3.c:120509:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1536 /* .xSFunc */)) = minmaxFunc // sqlite3.c:120511:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1680 /* .xSFunc */)) = minmaxStep // sqlite3.c:120513:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1688 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:120513:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1696 /* .xValue */)) = minMaxValue // sqlite3.c:120513:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1752 /* .xSFunc */)) = typeofFunc // sqlite3.c:120515:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1824 /* .xSFunc */)) = lengthFunc // sqlite3.c:120516:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1896 /* .xSFunc */)) = instrFunc // sqlite3.c:120517:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1968 /* .xSFunc */)) = printfFunc // sqlite3.c:120518:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2040 /* .xSFunc */)) = unicodeFunc // sqlite3.c:120519:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2112 /* .xSFunc */)) = charFunc // sqlite3.c:120520:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2184 /* .xSFunc */)) = absFunc // sqlite3.c:120521:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2256 /* .xSFunc */)) = roundFunc // sqlite3.c:120523:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2328 /* .xSFunc */)) = roundFunc // sqlite3.c:120524:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2400 /* .xSFunc */)) = upperFunc // sqlite3.c:120526:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2472 /* .xSFunc */)) = lowerFunc // sqlite3.c:120527:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2544 /* .xSFunc */)) = hexFunc // sqlite3.c:120528:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2616 /* .xSFunc */)) = versionFunc // sqlite3.c:120529:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2688 /* .xSFunc */)) = randomFunc // sqlite3.c:120530:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2760 /* .xSFunc */)) = randomBlob // sqlite3.c:120531:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2832 /* .xSFunc */)) = nullifFunc // sqlite3.c:120532:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2904 /* .xSFunc */)) = versionFunc // sqlite3.c:120533:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2976 /* .xSFunc */)) = sourceidFunc // sqlite3.c:120534:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3048 /* .xSFunc */)) = errlogFunc // sqlite3.c:120535:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3120 /* .xSFunc */)) = quoteFunc // sqlite3.c:120536:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3192 /* .xSFunc */)) = last_insert_rowid // sqlite3.c:120537:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3264 /* .xSFunc */)) = changes // sqlite3.c:120538:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3336 /* .xSFunc */)) = total_changes // sqlite3.c:120539:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3408 /* .xSFunc */)) = replaceFunc // sqlite3.c:120540:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3480 /* .xSFunc */)) = zeroblobFunc // sqlite3.c:120541:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3552 /* .xSFunc */)) = substrFunc // sqlite3.c:120542:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3624 /* .xSFunc */)) = substrFunc // sqlite3.c:120543:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3696 /* .xSFunc */)) = substrFunc // sqlite3.c:120544:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3768 /* .xSFunc */)) = substrFunc // sqlite3.c:120545:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3840 /* .xSFunc */)) = sumStep // sqlite3.c:120546:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3848 /* .xFinalize */)) = sumFinalize // sqlite3.c:120546:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3856 /* .xValue */)) = sumFinalize // sqlite3.c:120546:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3864 /* .xInverse */)) = sumInverse // sqlite3.c:120546:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3912 /* .xSFunc */)) = sumStep // sqlite3.c:120547:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3920 /* .xFinalize */)) = totalFinalize // sqlite3.c:120547:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3928 /* .xValue */)) = totalFinalize // sqlite3.c:120547:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3936 /* .xInverse */)) = sumInverse // sqlite3.c:120547:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3984 /* .xSFunc */)) = sumStep // sqlite3.c:120548:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3992 /* .xFinalize */)) = avgFinalize // sqlite3.c:120548:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4000 /* .xValue */)) = avgFinalize // sqlite3.c:120548:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4008 /* .xInverse */)) = sumInverse // sqlite3.c:120548:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4056 /* .xSFunc */)) = countStep // sqlite3.c:120549:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4064 /* .xFinalize */)) = countFinalize // sqlite3.c:120549:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4072 /* .xValue */)) = countFinalize // sqlite3.c:120549:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4080 /* .xInverse */)) = countInverse // sqlite3.c:120549:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4128 /* .xSFunc */)) = countStep // sqlite3.c:120551:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4136 /* .xFinalize */)) = countFinalize // sqlite3.c:120551:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4144 /* .xValue */)) = countFinalize // sqlite3.c:120551:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4152 /* .xInverse */)) = countInverse // sqlite3.c:120551:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4200 /* .xSFunc */)) = groupConcatStep // sqlite3.c:120553:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4208 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:120553:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4216 /* .xValue */)) = groupConcatValue // sqlite3.c:120553:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4224 /* .xInverse */)) = groupConcatInverse // sqlite3.c:120553:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4272 /* .xSFunc */)) = groupConcatStep // sqlite3.c:120555:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4280 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:120555:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4288 /* .xValue */)) = groupConcatValue // sqlite3.c:120555:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4296 /* .xInverse */)) = groupConcatInverse // sqlite3.c:120555:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4328 /* .pUserData */)) = uintptr(unsafe.Pointer(&globInfo)) // sqlite3.c:120558:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4344 /* .xSFunc */)) = likeFunc // sqlite3.c:120558:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4400 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:120563:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4416 /* .xSFunc */)) = likeFunc // sqlite3.c:120563:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4472 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:120564:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4488 /* .xSFunc */)) = likeFunc // sqlite3.c:120564:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4704 /* .xSFunc */)) = signFunc // sqlite3.c:120607:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4776 /* .xSFunc */)) = versionFunc // sqlite3.c:120608:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4848 /* .xSFunc */)) = versionFunc // sqlite3.c:120609:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 8 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23221:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 24 /* .xSFunc */)) = juliandayFunc // sqlite3.c:23221:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 80 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23222:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 96 /* .xSFunc */)) = dateFunc // sqlite3.c:23222:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 152 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23223:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 168 /* .xSFunc */)) = timeFunc // sqlite3.c:23223:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 224 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23224:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 240 /* .xSFunc */)) = datetimeFunc // sqlite3.c:23224:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 296 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:23225:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 312 /* .xSFunc */)) = strftimeFunc // sqlite3.c:23225:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 384 /* .xSFunc */)) = ctimeFunc // sqlite3.c:23226:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 456 /* .xSFunc */)) = ctimestampFunc // sqlite3.c:23227:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 528 /* .xSFunc */)) = cdateFunc // sqlite3.c:23228:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 16 /* .xFunc */)) = jsonRemoveFunc // sqlite3.c:190996:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 40 /* .xFunc */)) = jsonArrayFunc // sqlite3.c:190997:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 64 /* .xFunc */)) = jsonArrayLengthFunc // sqlite3.c:190998:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 88 /* .xFunc */)) = jsonArrayLengthFunc // sqlite3.c:190999:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 112 /* .xFunc */)) = jsonExtractFunc // sqlite3.c:191000:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 136 /* .xFunc */)) = jsonSetFunc // sqlite3.c:191001:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 160 /* .xFunc */)) = jsonObjectFunc // sqlite3.c:191002:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 184 /* .xFunc */)) = jsonPatchFunc // sqlite3.c:191003:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 208 /* .xFunc */)) = jsonQuoteFunc // sqlite3.c:191004:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 232 /* .xFunc */)) = jsonRemoveFunc // sqlite3.c:191005:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 256 /* .xFunc */)) = jsonReplaceFunc // sqlite3.c:191006:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 280 /* .xFunc */)) = jsonSetFunc // sqlite3.c:191007:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 304 /* .xFunc */)) = jsonTypeFunc // sqlite3.c:191008:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 328 /* .xFunc */)) = jsonTypeFunc // sqlite3.c:191009:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 352 /* .xFunc */)) = jsonValidFunc // sqlite3.c:191010:39: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 0 /* .xFunc */)) = geopolyAreaFunc // sqlite3.c:197221:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 24 /* .xFunc */)) = geopolyBlobFunc // sqlite3.c:197222:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 48 /* .xFunc */)) = geopolyJsonFunc // sqlite3.c:197223:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 72 /* .xFunc */)) = geopolySvgFunc // sqlite3.c:197224:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 96 /* .xFunc */)) = geopolyWithinFunc // sqlite3.c:197225:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 120 /* .xFunc */)) = geopolyContainsPointFunc // sqlite3.c:197226:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 144 /* .xFunc */)) = geopolyOverlapFunc // sqlite3.c:197227:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 168 /* .xFunc */)) = geopolyDebugFunc // sqlite3.c:197228:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 192 /* .xFunc */)) = geopolyBBoxFunc // sqlite3.c:197229:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 216 /* .xFunc */)) = geopolyXformFunc // sqlite3.c:197230:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 240 /* .xFunc */)) = geopolyRegularFunc // sqlite3.c:197231:8: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 264 /* .xFunc */)) = geopolyCcwFunc // sqlite3.c:197232:8: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 8 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonEachModule)) // sqlite3.c:191035:31: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 24 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonTreeModule)) // sqlite3.c:191036:31: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 8 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, int32) int32 - }{posixOpen})) // sqlite3.c:33936:21: - *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 32 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{libc.Xclose})) // sqlite3.c:33939:21: + }{posixOpen})) // sqlite3.c:34244:21: + *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 32 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{libc.Xclose})) // sqlite3.c:34247:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 56 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32) int32 - }{libc.Xaccess})) // sqlite3.c:33942:21: + }{libc.Xaccess})) // sqlite3.c:34250:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 80 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, Size_t) uintptr - }{libc.Xgetcwd})) // sqlite3.c:33945:21: + }{libc.Xgetcwd})) // sqlite3.c:34253:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 104 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 - }{libc.Xstat})) // sqlite3.c:33948:21: + }{libc.Xstat})) // sqlite3.c:34256:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 128 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, uintptr) int32 - }{libc.Xfstat})) // sqlite3.c:33961:21: + }{libc.Xfstat})) // sqlite3.c:34269:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 152 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, X__off64_t) int32 - }{libc.Xftruncate})) // sqlite3.c:33965:21: + }{libc.Xftruncate})) // sqlite3.c:34273:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 176 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, int32, uintptr) int32 - }{libc.Xfcntl})) // sqlite3.c:33968:21: + }{libc.Xfcntl})) // sqlite3.c:34276:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 200 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, uintptr, Size_t) Ssize_t - }{libc.Xread})) // sqlite3.c:33971:21: + }{libc.Xread})) // sqlite3.c:34279:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 272 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, uintptr, Size_t) Ssize_t - }{libc.Xwrite})) // sqlite3.c:33988:21: + }{libc.Xwrite})) // sqlite3.c:34296:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 344 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, X__mode_t) int32 - }{libc.Xfchmod})) // sqlite3.c:34007:21: + }{libc.Xfchmod})) // sqlite3.c:34315:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 392 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr) int32 - }{libc.Xunlink})) // sqlite3.c:34017:21: + }{libc.Xunlink})) // sqlite3.c:34325:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 416 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 - }{openDirectory})) // sqlite3.c:34020:25: + }{openDirectory})) // sqlite3.c:34328:25: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 440 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, X__mode_t) int32 - }{libc.Xmkdir})) // sqlite3.c:34023:21: + }{libc.Xmkdir})) // sqlite3.c:34331:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 464 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr) int32 - }{libc.Xrmdir})) // sqlite3.c:34026:21: + }{libc.Xrmdir})) // sqlite3.c:34334:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 488 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, int32, X__uid_t, X__gid_t) int32 - }{libc.Xfchown})) // sqlite3.c:34030:21: - *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 512 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) X__uid_t }{libc.Xgeteuid})) // sqlite3.c:34037:21: + }{libc.Xfchown})) // sqlite3.c:34338:21: + *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 512 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) X__uid_t }{libc.Xgeteuid})) // sqlite3.c:34345:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 536 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, Size_t, int32, int32, int32, X__off64_t) uintptr - }{libc.Xmmap})) // sqlite3.c:34044:21: + }{libc.Xmmap})) // sqlite3.c:34352:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 560 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, Size_t) int32 - }{libc.Xmunmap})) // sqlite3.c:34051:21: + }{libc.Xmunmap})) // sqlite3.c:34359:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 584 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, Size_t, Size_t, int32, uintptr) uintptr - }{libc.Xmremap})) // sqlite3.c:34058:21: - *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 608 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{unixGetpagesize})) // sqlite3.c:34065:21: + }{libc.Xmremap})) // sqlite3.c:34366:21: + *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 608 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{unixGetpagesize})) // sqlite3.c:34373:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 632 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr, Size_t) Ssize_t - }{libc.Xreadlink})) // sqlite3.c:34072:21: + }{libc.Xreadlink})) // sqlite3.c:34380:21: *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 656 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, uintptr) int32 - }{libc.Xlstat})) // sqlite3.c:34079:22: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 32 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 40 /* .xOpen */)) = unixOpen // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 48 /* .xDelete */)) = unixDelete // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 56 /* .xAccess */)) = unixAccess // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 64 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 72 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 80 /* .xDlError */)) = unixDlError // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 88 /* .xDlSym */)) = unixDlSym // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 96 /* .xDlClose */)) = unixDlClose // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 104 /* .xRandomness */)) = unixRandomness // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 112 /* .xSleep */)) = unixSleep // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 120 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 128 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 136 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 144 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 152 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41438:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 160 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41438:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 200 /* .pAppData */)) = uintptr(unsafe.Pointer(&nolockIoFinder)) // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 208 /* .xOpen */)) = unixOpen // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 216 /* .xDelete */)) = unixDelete // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 224 /* .xAccess */)) = unixAccess // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 232 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 240 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 248 /* .xDlError */)) = unixDlError // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 256 /* .xDlSym */)) = unixDlSym // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 264 /* .xDlClose */)) = unixDlClose // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 272 /* .xRandomness */)) = unixRandomness // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 280 /* .xSleep */)) = unixSleep // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 288 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 296 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 304 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 312 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 320 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41440:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 328 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41440:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 368 /* .pAppData */)) = uintptr(unsafe.Pointer(&dotlockIoFinder)) // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 376 /* .xOpen */)) = unixOpen // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 384 /* .xDelete */)) = unixDelete // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 392 /* .xAccess */)) = unixAccess // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 400 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 408 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 416 /* .xDlError */)) = unixDlError // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 424 /* .xDlSym */)) = unixDlSym // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 432 /* .xDlClose */)) = unixDlClose // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 440 /* .xRandomness */)) = unixRandomness // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 448 /* .xSleep */)) = unixSleep // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 456 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 464 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 472 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 480 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 488 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41441:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 496 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41441:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 536 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 544 /* .xOpen */)) = unixOpen // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 552 /* .xDelete */)) = unixDelete // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 560 /* .xAccess */)) = unixAccess // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 568 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 576 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 584 /* .xDlError */)) = unixDlError // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 592 /* .xDlSym */)) = unixDlSym // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 600 /* .xDlClose */)) = unixDlClose // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 608 /* .xRandomness */)) = unixRandomness // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 616 /* .xSleep */)) = unixSleep // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 624 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 632 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 640 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 648 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 656 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 664 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41442:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 24 /* .xSFunc */)) = row_numberStepFunc // sqlite3.c:151777:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 32 /* .xFinalize */)) = row_numberValueFunc // sqlite3.c:151777:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 40 /* .xValue */)) = row_numberValueFunc // sqlite3.c:151777:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 48 /* .xInverse */)) = noopStepFunc // sqlite3.c:151777:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 56 /* .zName */)) = uintptr(unsafe.Pointer(&row_numberName)) // sqlite3.c:151777:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 96 /* .xSFunc */)) = dense_rankStepFunc // sqlite3.c:151778:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 104 /* .xFinalize */)) = dense_rankValueFunc // sqlite3.c:151778:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 112 /* .xValue */)) = dense_rankValueFunc // sqlite3.c:151778:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 120 /* .xInverse */)) = noopStepFunc // sqlite3.c:151778:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 128 /* .zName */)) = uintptr(unsafe.Pointer(&dense_rankName)) // sqlite3.c:151778:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 168 /* .xSFunc */)) = rankStepFunc // sqlite3.c:151779:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 176 /* .xFinalize */)) = rankValueFunc // sqlite3.c:151779:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 184 /* .xValue */)) = rankValueFunc // sqlite3.c:151779:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 192 /* .xInverse */)) = noopStepFunc // sqlite3.c:151779:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 200 /* .zName */)) = uintptr(unsafe.Pointer(&rankName)) // sqlite3.c:151779:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 240 /* .xSFunc */)) = percent_rankStepFunc // sqlite3.c:151780:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 248 /* .xFinalize */)) = percent_rankValueFunc // sqlite3.c:151780:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 256 /* .xValue */)) = percent_rankValueFunc // sqlite3.c:151780:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 264 /* .xInverse */)) = percent_rankInvFunc // sqlite3.c:151780:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 272 /* .zName */)) = uintptr(unsafe.Pointer(&percent_rankName)) // sqlite3.c:151780:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 312 /* .xSFunc */)) = cume_distStepFunc // sqlite3.c:151781:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 320 /* .xFinalize */)) = cume_distValueFunc // sqlite3.c:151781:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 328 /* .xValue */)) = cume_distValueFunc // sqlite3.c:151781:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 336 /* .xInverse */)) = cume_distInvFunc // sqlite3.c:151781:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 344 /* .zName */)) = uintptr(unsafe.Pointer(&cume_distName)) // sqlite3.c:151781:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 384 /* .xSFunc */)) = ntileStepFunc // sqlite3.c:151782:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 392 /* .xFinalize */)) = ntileValueFunc // sqlite3.c:151782:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 400 /* .xValue */)) = ntileValueFunc // sqlite3.c:151782:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 408 /* .xInverse */)) = ntileInvFunc // sqlite3.c:151782:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 416 /* .zName */)) = uintptr(unsafe.Pointer(&ntileName)) // sqlite3.c:151782:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 456 /* .xSFunc */)) = last_valueStepFunc // sqlite3.c:151783:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 464 /* .xFinalize */)) = last_valueFinalizeFunc // sqlite3.c:151783:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 472 /* .xValue */)) = last_valueValueFunc // sqlite3.c:151783:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 480 /* .xInverse */)) = last_valueInvFunc // sqlite3.c:151783:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 488 /* .zName */)) = uintptr(unsafe.Pointer(&last_valueName)) // sqlite3.c:151783:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 528 /* .xSFunc */)) = nth_valueStepFunc // sqlite3.c:151784:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 536 /* .xFinalize */)) = nth_valueFinalizeFunc // sqlite3.c:151784:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 544 /* .xValue */)) = noopValueFunc // sqlite3.c:151784:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 552 /* .xInverse */)) = noopStepFunc // sqlite3.c:151784:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 560 /* .zName */)) = uintptr(unsafe.Pointer(&nth_valueName)) // sqlite3.c:151784:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 600 /* .xSFunc */)) = first_valueStepFunc // sqlite3.c:151785:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 608 /* .xFinalize */)) = first_valueFinalizeFunc // sqlite3.c:151785:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 616 /* .xValue */)) = noopValueFunc // sqlite3.c:151785:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 624 /* .xInverse */)) = noopStepFunc // sqlite3.c:151785:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 632 /* .zName */)) = uintptr(unsafe.Pointer(&first_valueName)) // sqlite3.c:151785:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 672 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151786:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 680 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151786:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 688 /* .xValue */)) = noopValueFunc // sqlite3.c:151786:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 696 /* .xInverse */)) = noopStepFunc // sqlite3.c:151786:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 704 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:151786:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 744 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151787:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 752 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151787:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 760 /* .xValue */)) = noopValueFunc // sqlite3.c:151787:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 768 /* .xInverse */)) = noopStepFunc // sqlite3.c:151787:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 776 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:151787:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 816 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151788:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 824 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151788:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 832 /* .xValue */)) = noopValueFunc // sqlite3.c:151788:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 840 /* .xInverse */)) = noopStepFunc // sqlite3.c:151788:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 848 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:151788:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 888 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151789:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 896 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151789:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 904 /* .xValue */)) = noopValueFunc // sqlite3.c:151789:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 912 /* .xInverse */)) = noopStepFunc // sqlite3.c:151789:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 920 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:151789:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 960 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151790:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 968 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151790:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 976 /* .xValue */)) = noopValueFunc // sqlite3.c:151790:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 984 /* .xInverse */)) = noopStepFunc // sqlite3.c:151790:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 992 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:151790:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1032 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151791:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1040 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151791:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1048 /* .xValue */)) = noopValueFunc // sqlite3.c:151791:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1056 /* .xInverse */)) = noopStepFunc // sqlite3.c:151791:5: - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1064 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:151791:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&attach_func)) + 24 /* .xSFunc */)) = attachFunc // sqlite3.c:109918:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 16 /* .xConnect */)) = bytecodevtabConnect // sqlite3.c:97036:21: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 24 /* .xBestIndex */)) = bytecodevtabBestIndex // sqlite3.c:97037:21: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 32 /* .xDisconnect */)) = bytecodevtabDisconnect // sqlite3.c:97038:21: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 48 /* .xOpen */)) = bytecodevtabOpen // sqlite3.c:97040:21: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 56 /* .xClose */)) = bytecodevtabClose // sqlite3.c:97041:21: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 64 /* .xFilter */)) = bytecodevtabFilter // sqlite3.c:97042:21: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 72 /* .xNext */)) = bytecodevtabNext // sqlite3.c:97043:21: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 80 /* .xEof */)) = bytecodevtabEof // sqlite3.c:97044:21: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 88 /* .xColumn */)) = bytecodevtabColumn // sqlite3.c:97045:21: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 96 /* .xRowid */)) = bytecodevtabRowid // sqlite3.c:97046:21: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 8 /* .xCreate */)) = dbpageConnect // sqlite3.c:202403:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 16 /* .xConnect */)) = dbpageConnect // sqlite3.c:202404:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 24 /* .xBestIndex */)) = dbpageBestIndex // sqlite3.c:202405:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 32 /* .xDisconnect */)) = dbpageDisconnect // sqlite3.c:202406:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 40 /* .xDestroy */)) = dbpageDisconnect // sqlite3.c:202407:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 48 /* .xOpen */)) = dbpageOpen // sqlite3.c:202408:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 56 /* .xClose */)) = dbpageClose // sqlite3.c:202409:5: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 64 /* .xFilter */)) = dbpageFilter // sqlite3.c:202410:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 72 /* .xNext */)) = dbpageNext // sqlite3.c:202411:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 80 /* .xEof */)) = dbpageEof // sqlite3.c:202412:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 88 /* .xColumn */)) = dbpageColumn // sqlite3.c:202413:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 96 /* .xRowid */)) = dbpageRowid // sqlite3.c:202414:5: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 104 /* .xUpdate */)) = dbpageUpdate // sqlite3.c:202415:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 112 /* .xBegin */)) = dbpageBegin // sqlite3.c:202416:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 8 /* .xCreate */)) = statConnect // sqlite3.c:201984:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 16 /* .xConnect */)) = statConnect // sqlite3.c:201985:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 24 /* .xBestIndex */)) = statBestIndex // sqlite3.c:201986:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 32 /* .xDisconnect */)) = statDisconnect // sqlite3.c:201987:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 40 /* .xDestroy */)) = statDisconnect // sqlite3.c:201988:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 48 /* .xOpen */)) = statOpen // sqlite3.c:201989:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 56 /* .xClose */)) = statClose // sqlite3.c:201990:5: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 64 /* .xFilter */)) = statFilter // sqlite3.c:201991:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 72 /* .xNext */)) = statNext // sqlite3.c:201992:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 80 /* .xEof */)) = statEof // sqlite3.c:201993:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 88 /* .xColumn */)) = statColumn // sqlite3.c:201994:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 96 /* .xRowid */)) = statRowid // sqlite3.c:201995:5: - *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 0 /* .xMalloc */)) = sqlite3MemMalloc // sqlite3.c:23831:6: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 8 /* .xFree */)) = sqlite3MemFree // sqlite3.c:23832:6: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 16 /* .xRealloc */)) = sqlite3MemRealloc // sqlite3.c:23833:6: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 24 /* .xSize */)) = sqlite3MemSize // sqlite3.c:23834:6: - *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 32 /* .xRoundup */)) = sqlite3MemRoundup // sqlite3.c:23835:6: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 40 /* .xInit */)) = sqlite3MemInit // sqlite3.c:23836:6: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 48 /* .xShutdown */)) = sqlite3MemShutdown // sqlite3.c:23837:6: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 16 /* .xInit */)) = pcache1Init // sqlite3.c:50956:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 24 /* .xShutdown */)) = pcache1Shutdown // sqlite3.c:50957:5: - *(*func(*libc.TLS, int32, int32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 32 /* .xCreate */)) = pcache1Create // sqlite3.c:50958:5: - *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 40 /* .xCachesize */)) = pcache1Cachesize // sqlite3.c:50959:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 48 /* .xPagecount */)) = pcache1Pagecount // sqlite3.c:50960:5: - *(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 56 /* .xFetch */)) = pcache1Fetch // sqlite3.c:50961:5: - *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 64 /* .xUnpin */)) = pcache1Unpin // sqlite3.c:50962:5: - *(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 72 /* .xRekey */)) = pcache1Rekey // sqlite3.c:50963:5: - *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 80 /* .xTruncate */)) = pcache1Truncate // sqlite3.c:50964:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 88 /* .xDestroy */)) = pcache1Destroy // sqlite3.c:50965:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 96 /* .xShrink */)) = pcache1Shrink // sqlite3.c:50966:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&detach_func)) + 24 /* .xSFunc */)) = detachFunc // sqlite3.c:109898:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoFinder)) + 0)) = dotlockIoFinderImpl // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 8 /* .xClose */)) = dotlockClose // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 56 /* .xLock */)) = dotlockLock // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 64 /* .xUnlock */)) = dotlockUnlock // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 72 /* .xCheckReservedLock */)) = dotlockCheckReservedLock // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:38870:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 8 /* .xCreate */)) = fts5CreateMethod // sqlite3.c:225749:25: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 16 /* .xConnect */)) = fts5ConnectMethod // sqlite3.c:225750:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 24 /* .xBestIndex */)) = fts5BestIndexMethod // sqlite3.c:225751:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 32 /* .xDisconnect */)) = fts5DisconnectMethod // sqlite3.c:225752:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 40 /* .xDestroy */)) = fts5DestroyMethod // sqlite3.c:225753:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 48 /* .xOpen */)) = fts5OpenMethod // sqlite3.c:225754:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 56 /* .xClose */)) = fts5CloseMethod // sqlite3.c:225755:25: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 64 /* .xFilter */)) = fts5FilterMethod // sqlite3.c:225756:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 72 /* .xNext */)) = fts5NextMethod // sqlite3.c:225757:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 80 /* .xEof */)) = fts5EofMethod // sqlite3.c:225758:25: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 88 /* .xColumn */)) = fts5ColumnMethod // sqlite3.c:225759:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 96 /* .xRowid */)) = fts5RowidMethod // sqlite3.c:225760:25: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 104 /* .xUpdate */)) = fts5UpdateMethod // sqlite3.c:225761:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 112 /* .xBegin */)) = fts5BeginMethod // sqlite3.c:225762:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 120 /* .xSync */)) = fts5SyncMethod // sqlite3.c:225763:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 128 /* .xCommit */)) = fts5CommitMethod // sqlite3.c:225764:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 136 /* .xRollback */)) = fts5RollbackMethod // sqlite3.c:225765:25: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 144 /* .xFindFunction */)) = fts5FindFunctionMethod // sqlite3.c:225766:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 152 /* .xRename */)) = fts5RenameMethod // sqlite3.c:225767:25: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 160 /* .xSavepoint */)) = fts5SavepointMethod // sqlite3.c:225768:25: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 168 /* .xRelease */)) = fts5ReleaseMethod // sqlite3.c:225769:25: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 176 /* .xRollbackTo */)) = fts5RollbackToMethod // sqlite3.c:225770:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 184 /* .xShadowName */)) = fts5ShadowName // sqlite3.c:225771:25: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 8 /* .xCreate */)) = fts5VocabCreateMethod // sqlite3.c:230174:25: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 16 /* .xConnect */)) = fts5VocabConnectMethod // sqlite3.c:230175:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 24 /* .xBestIndex */)) = fts5VocabBestIndexMethod // sqlite3.c:230176:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 32 /* .xDisconnect */)) = fts5VocabDisconnectMethod // sqlite3.c:230177:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 40 /* .xDestroy */)) = fts5VocabDestroyMethod // sqlite3.c:230178:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 48 /* .xOpen */)) = fts5VocabOpenMethod // sqlite3.c:230179:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 56 /* .xClose */)) = fts5VocabCloseMethod // sqlite3.c:230180:25: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 64 /* .xFilter */)) = fts5VocabFilterMethod // sqlite3.c:230181:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 72 /* .xNext */)) = fts5VocabNextMethod // sqlite3.c:230182:25: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 80 /* .xEof */)) = fts5VocabEofMethod // sqlite3.c:230183:25: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 88 /* .xColumn */)) = fts5VocabColumnMethod // sqlite3.c:230184:25: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 96 /* .xRowid */)) = fts5VocabRowidMethod // sqlite3.c:230185:25: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 8 /* .xCreate */)) = geopolyCreate // sqlite3.c:194165:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 16 /* .xConnect */)) = geopolyConnect // sqlite3.c:194166:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 24 /* .xBestIndex */)) = geopolyBestIndex // sqlite3.c:194167:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 32 /* .xDisconnect */)) = rtreeDisconnect // sqlite3.c:194168:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 40 /* .xDestroy */)) = rtreeDestroy // sqlite3.c:194169:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 48 /* .xOpen */)) = rtreeOpen // sqlite3.c:194170:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 56 /* .xClose */)) = rtreeClose // sqlite3.c:194171:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 64 /* .xFilter */)) = geopolyFilter // sqlite3.c:194172:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 72 /* .xNext */)) = rtreeNext // sqlite3.c:194173:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 80 /* .xEof */)) = rtreeEof // sqlite3.c:194174:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 88 /* .xColumn */)) = geopolyColumn // sqlite3.c:194175:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 96 /* .xRowid */)) = rtreeRowid // sqlite3.c:194176:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 104 /* .xUpdate */)) = geopolyUpdate // sqlite3.c:194177:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 112 /* .xBegin */)) = rtreeBeginTransaction // sqlite3.c:194178:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 120 /* .xSync */)) = rtreeEndTransaction // sqlite3.c:194179:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 128 /* .xCommit */)) = rtreeEndTransaction // sqlite3.c:194180:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 136 /* .xRollback */)) = rtreeEndTransaction // sqlite3.c:194181:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 144 /* .xFindFunction */)) = geopolyFindFunction // sqlite3.c:194182:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 152 /* .xRename */)) = rtreeRename // sqlite3.c:194183:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 160 /* .xSavepoint */)) = rtreeSavepoint // sqlite3.c:194184:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 184 /* .xShadowName */)) = rtreeShadowName // sqlite3.c:194187:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 16 /* .xConnect */)) = jsonEachConnect // sqlite3.c:187905:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 24 /* .xBestIndex */)) = jsonEachBestIndex // sqlite3.c:187906:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 32 /* .xDisconnect */)) = jsonEachDisconnect // sqlite3.c:187907:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 48 /* .xOpen */)) = jsonEachOpenEach // sqlite3.c:187909:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 56 /* .xClose */)) = jsonEachClose // sqlite3.c:187910:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 64 /* .xFilter */)) = jsonEachFilter // sqlite3.c:187911:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 72 /* .xNext */)) = jsonEachNext // sqlite3.c:187912:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 80 /* .xEof */)) = jsonEachEof // sqlite3.c:187913:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 88 /* .xColumn */)) = jsonEachColumn // sqlite3.c:187914:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 96 /* .xRowid */)) = jsonEachRowid // sqlite3.c:187915:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 16 /* .xConnect */)) = jsonEachConnect // sqlite3.c:187933:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 24 /* .xBestIndex */)) = jsonEachBestIndex // sqlite3.c:187934:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 32 /* .xDisconnect */)) = jsonEachDisconnect // sqlite3.c:187935:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 48 /* .xOpen */)) = jsonEachOpenTree // sqlite3.c:187937:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 56 /* .xClose */)) = jsonEachClose // sqlite3.c:187938:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 64 /* .xFilter */)) = jsonEachFilter // sqlite3.c:187939:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 72 /* .xNext */)) = jsonEachNext // sqlite3.c:187940:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 80 /* .xEof */)) = jsonEachEof // sqlite3.c:187941:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 88 /* .xColumn */)) = jsonEachColumn // sqlite3.c:187942:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 96 /* .xRowid */)) = jsonEachRowid // sqlite3.c:187943:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 8 /* .xClose */)) = memdbClose // sqlite3.c:47941:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 16 /* .xRead */)) = memdbRead // sqlite3.c:47942:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 24 /* .xWrite */)) = memdbWrite // sqlite3.c:47943:3: - *(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 32 /* .xTruncate */)) = memdbTruncate // sqlite3.c:47944:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 40 /* .xSync */)) = memdbSync // sqlite3.c:47945:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 48 /* .xFileSize */)) = memdbFileSize // sqlite3.c:47946:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 56 /* .xLock */)) = memdbLock // sqlite3.c:47947:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 64 /* .xUnlock */)) = memdbLock // sqlite3.c:47948:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 80 /* .xFileControl */)) = memdbFileControl // sqlite3.c:47950:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 96 /* .xDeviceCharacteristics */)) = memdbDeviceCharacteristics // sqlite3.c:47952:3: - *(*func(*libc.TLS, uintptr, Sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 136 /* .xFetch */)) = memdbFetch // sqlite3.c:47957:3: - *(*func(*libc.TLS, uintptr, Sqlite3_int64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 144 /* .xUnfetch */)) = memdbUnfetch // sqlite3.c:47958:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 40 /* .xOpen */)) = memdbOpen // sqlite3.c:47924:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 56 /* .xAccess */)) = memdbAccess // sqlite3.c:47926:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 64 /* .xFullPathname */)) = memdbFullPathname // sqlite3.c:47927:3: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 72 /* .xDlOpen */)) = memdbDlOpen // sqlite3.c:47928:3: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 80 /* .xDlError */)) = memdbDlError // sqlite3.c:47929:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 88 /* .xDlSym */)) = memdbDlSym // sqlite3.c:47930:3: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 96 /* .xDlClose */)) = memdbDlClose // sqlite3.c:47931:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 104 /* .xRandomness */)) = memdbRandomness // sqlite3.c:47932:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 112 /* .xSleep */)) = memdbSleep // sqlite3.c:47933:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 128 /* .xGetLastError */)) = memdbGetLastError // sqlite3.c:47935:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 136 /* .xCurrentTimeInt64 */)) = memdbCurrentTimeInt64 // sqlite3.c:47936:3: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoFinder)) + 0)) = nolockIoFinderImpl // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 8 /* .xClose */)) = nolockClose // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 56 /* .xLock */)) = nolockLock // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 64 /* .xUnlock */)) = nolockUnlock // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 72 /* .xCheckReservedLock */)) = nolockCheckReservedLock // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:38860:1: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoFinder)) + 0)) = posixIoFinderImpl // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 8 /* .xClose */)) = unixClose // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 56 /* .xLock */)) = unixLock // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 64 /* .xUnlock */)) = unixUnlock // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 72 /* .xCheckReservedLock */)) = unixCheckReservedLock // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 104 /* .xShmMap */)) = unixShmMap // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:38850:1: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 16 /* .xConnect */)) = pragmaVtabConnect // sqlite3.c:128295:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 24 /* .xBestIndex */)) = pragmaVtabBestIndex // sqlite3.c:128296:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 32 /* .xDisconnect */)) = pragmaVtabDisconnect // sqlite3.c:128297:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 48 /* .xOpen */)) = pragmaVtabOpen // sqlite3.c:128299:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 56 /* .xClose */)) = pragmaVtabClose // sqlite3.c:128300:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 64 /* .xFilter */)) = pragmaVtabFilter // sqlite3.c:128301:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 72 /* .xNext */)) = pragmaVtabNext // sqlite3.c:128302:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 80 /* .xEof */)) = pragmaVtabEof // sqlite3.c:128303:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 88 /* .xColumn */)) = pragmaVtabColumn // sqlite3.c:128304:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 96 /* .xRowid */)) = pragmaVtabRowid // sqlite3.c:128305:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 8 /* .xClose */)) = rbuVfsClose // sqlite3.c:200803:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 16 /* .xRead */)) = rbuVfsRead // sqlite3.c:200804:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 24 /* .xWrite */)) = rbuVfsWrite // sqlite3.c:200805:5: - *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 32 /* .xTruncate */)) = rbuVfsTruncate // sqlite3.c:200806:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 40 /* .xSync */)) = rbuVfsSync // sqlite3.c:200807:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 48 /* .xFileSize */)) = rbuVfsFileSize // sqlite3.c:200808:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 56 /* .xLock */)) = rbuVfsLock // sqlite3.c:200809:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 64 /* .xUnlock */)) = rbuVfsUnlock // sqlite3.c:200810:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 72 /* .xCheckReservedLock */)) = rbuVfsCheckReservedLock // sqlite3.c:200811:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 80 /* .xFileControl */)) = rbuVfsFileControl // sqlite3.c:200812:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 88 /* .xSectorSize */)) = rbuVfsSectorSize // sqlite3.c:200813:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 96 /* .xDeviceCharacteristics */)) = rbuVfsDeviceCharacteristics // sqlite3.c:200814:5: - *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 104 /* .xShmMap */)) = rbuVfsShmMap // sqlite3.c:200815:5: - *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 112 /* .xShmLock */)) = rbuVfsShmLock // sqlite3.c:200816:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 120 /* .xShmBarrier */)) = rbuVfsShmBarrier // sqlite3.c:200817:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 128 /* .xShmUnmap */)) = rbuVfsShmUnmap // sqlite3.c:200818:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 8 /* .xCreate */)) = rtreeCreate // sqlite3.c:191518:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 16 /* .xConnect */)) = rtreeConnect // sqlite3.c:191519:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 24 /* .xBestIndex */)) = rtreeBestIndex // sqlite3.c:191520:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 32 /* .xDisconnect */)) = rtreeDisconnect // sqlite3.c:191521:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 40 /* .xDestroy */)) = rtreeDestroy // sqlite3.c:191522:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 48 /* .xOpen */)) = rtreeOpen // sqlite3.c:191523:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 56 /* .xClose */)) = rtreeClose // sqlite3.c:191524:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 64 /* .xFilter */)) = rtreeFilter // sqlite3.c:191525:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 72 /* .xNext */)) = rtreeNext // sqlite3.c:191526:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 80 /* .xEof */)) = rtreeEof // sqlite3.c:191527:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 88 /* .xColumn */)) = rtreeColumn // sqlite3.c:191528:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 96 /* .xRowid */)) = rtreeRowid // sqlite3.c:191529:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 104 /* .xUpdate */)) = rtreeUpdate // sqlite3.c:191530:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 112 /* .xBegin */)) = rtreeBeginTransaction // sqlite3.c:191531:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 120 /* .xSync */)) = rtreeEndTransaction // sqlite3.c:191532:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 128 /* .xCommit */)) = rtreeEndTransaction // sqlite3.c:191533:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 136 /* .xRollback */)) = rtreeEndTransaction // sqlite3.c:191534:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 152 /* .xRename */)) = rtreeRename // sqlite3.c:191536:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 160 /* .xSavepoint */)) = rtreeSavepoint // sqlite3.c:191537:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 184 /* .xShadowName */)) = rtreeShadowName // sqlite3.c:191540:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 8 /* .xUserData */)) = fts5ApiUserData // sqlite3.c:225213:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 16 /* .xColumnCount */)) = fts5ApiColumnCount // sqlite3.c:225214:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 24 /* .xRowCount */)) = fts5ApiRowCount // sqlite3.c:225215:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 32 /* .xColumnTotalSize */)) = fts5ApiColumnTotalSize // sqlite3.c:225216:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 40 /* .xTokenize */)) = fts5ApiTokenize // sqlite3.c:225217:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 48 /* .xPhraseCount */)) = fts5ApiPhraseCount // sqlite3.c:225218:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 56 /* .xPhraseSize */)) = fts5ApiPhraseSize // sqlite3.c:225219:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 64 /* .xInstCount */)) = fts5ApiInstCount // sqlite3.c:225220:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 72 /* .xInst */)) = fts5ApiInst // sqlite3.c:225221:3: - *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 80 /* .xRowid */)) = fts5ApiRowid // sqlite3.c:225222:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 88 /* .xColumnText */)) = fts5ApiColumnText // sqlite3.c:225223:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 96 /* .xColumnSize */)) = fts5ApiColumnSize // sqlite3.c:225224:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 104 /* .xQueryPhrase */)) = fts5ApiQueryPhrase // sqlite3.c:225225:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 112 /* .xSetAuxdata */)) = fts5ApiSetAuxdata // sqlite3.c:225226:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 120 /* .xGetAuxdata */)) = fts5ApiGetAuxdata // sqlite3.c:225227:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 128 /* .xPhraseFirst */)) = fts5ApiPhraseFirst // sqlite3.c:225228:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 136 /* .xPhraseNext */)) = fts5ApiPhraseNext // sqlite3.c:225229:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 144 /* .xPhraseFirstColumn */)) = fts5ApiPhraseFirstColumn // sqlite3.c:225230:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 152 /* .xPhraseNextColumn */)) = fts5ApiPhraseNextColumn // sqlite3.c:225231:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 8 /* .xClose */)) = memjrnlClose // sqlite3.c:97386:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 16 /* .xRead */)) = memjrnlRead // sqlite3.c:97387:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 24 /* .xWrite */)) = memjrnlWrite // sqlite3.c:97388:3: - *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 32 /* .xTruncate */)) = memjrnlTruncate // sqlite3.c:97389:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 40 /* .xSync */)) = memjrnlSync // sqlite3.c:97390:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 48 /* .xFileSize */)) = memjrnlFileSize // sqlite3.c:97391:3: - *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 0 /* .xMutexInit */)) = noopMutexInit // sqlite3.c:26064:5: - *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 8 /* .xMutexEnd */)) = noopMutexEnd // sqlite3.c:26065:5: - *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 16 /* .xMutexAlloc */)) = noopMutexAlloc // sqlite3.c:26066:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 24 /* .xMutexFree */)) = noopMutexFree // sqlite3.c:26067:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 32 /* .xMutexEnter */)) = noopMutexEnter // sqlite3.c:26068:5: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 40 /* .xMutexTry */)) = noopMutexTry // sqlite3.c:26069:5: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 48 /* .xMutexLeave */)) = noopMutexLeave // sqlite3.c:26070:5: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 0 /* .aggregate_context */)) = Xsqlite3_aggregate_context // sqlite3.c:124372:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 8 /* .aggregate_count */)) = Xsqlite3_aggregate_count // sqlite3.c:124374:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 16 /* .bind_blob */)) = Xsqlite3_bind_blob // sqlite3.c:124378:3: - *(*func(*libc.TLS, uintptr, int32, float64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 24 /* .bind_double */)) = Xsqlite3_bind_double // sqlite3.c:124379:3: - *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 32 /* .bind_int */)) = Xsqlite3_bind_int // sqlite3.c:124380:3: - *(*func(*libc.TLS, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 40 /* .bind_int64 */)) = Xsqlite3_bind_int64 // sqlite3.c:124381:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 48 /* .bind_null */)) = Xsqlite3_bind_null // sqlite3.c:124382:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 56 /* .bind_parameter_count */)) = Xsqlite3_bind_parameter_count // sqlite3.c:124383:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 64 /* .bind_parameter_index */)) = Xsqlite3_bind_parameter_index // sqlite3.c:124384:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 72 /* .bind_parameter_name */)) = Xsqlite3_bind_parameter_name // sqlite3.c:124385:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 80 /* .bind_text */)) = Xsqlite3_bind_text // sqlite3.c:124386:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 88 /* .bind_text16 */)) = Xsqlite3_bind_text16 // sqlite3.c:124387:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 96 /* .bind_value */)) = Xsqlite3_bind_value // sqlite3.c:124388:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 104 /* .busy_handler */)) = Xsqlite3_busy_handler // sqlite3.c:124389:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 112 /* .busy_timeout */)) = Xsqlite3_busy_timeout // sqlite3.c:124390:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 120 /* .changes */)) = Xsqlite3_changes // sqlite3.c:124391:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 128 /* .close */)) = Xsqlite3_close // sqlite3.c:124392:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 136 /* .collation_needed */)) = Xsqlite3_collation_needed // sqlite3.c:124393:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 144 /* .collation_needed16 */)) = Xsqlite3_collation_needed16 // sqlite3.c:124394:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 152 /* .column_blob */)) = Xsqlite3_column_blob // sqlite3.c:124395:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 160 /* .column_bytes */)) = Xsqlite3_column_bytes // sqlite3.c:124396:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 168 /* .column_bytes16 */)) = Xsqlite3_column_bytes16 // sqlite3.c:124397:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 176 /* .column_count */)) = Xsqlite3_column_count // sqlite3.c:124398:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 184 /* .column_database_name */)) = Xsqlite3_column_database_name // sqlite3.c:124399:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 192 /* .column_database_name16 */)) = Xsqlite3_column_database_name16 // sqlite3.c:124400:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 200 /* .column_decltype */)) = Xsqlite3_column_decltype // sqlite3.c:124401:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 208 /* .column_decltype16 */)) = Xsqlite3_column_decltype16 // sqlite3.c:124402:3: - *(*func(*libc.TLS, uintptr, int32) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 216 /* .column_double */)) = Xsqlite3_column_double // sqlite3.c:124403:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 224 /* .column_int */)) = Xsqlite3_column_int // sqlite3.c:124404:3: - *(*func(*libc.TLS, uintptr, int32) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 232 /* .column_int64 */)) = Xsqlite3_column_int64 // sqlite3.c:124405:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 240 /* .column_name */)) = Xsqlite3_column_name // sqlite3.c:124406:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 248 /* .column_name16 */)) = Xsqlite3_column_name16 // sqlite3.c:124407:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 256 /* .column_origin_name */)) = Xsqlite3_column_origin_name // sqlite3.c:124408:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 264 /* .column_origin_name16 */)) = Xsqlite3_column_origin_name16 // sqlite3.c:124409:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 272 /* .column_table_name */)) = Xsqlite3_column_table_name // sqlite3.c:124410:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 280 /* .column_table_name16 */)) = Xsqlite3_column_table_name16 // sqlite3.c:124411:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 288 /* .column_text */)) = Xsqlite3_column_text // sqlite3.c:124412:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 296 /* .column_text16 */)) = Xsqlite3_column_text16 // sqlite3.c:124413:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 304 /* .column_type */)) = Xsqlite3_column_type // sqlite3.c:124414:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 312 /* .column_value */)) = Xsqlite3_column_value // sqlite3.c:124415:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 320 /* .commit_hook */)) = Xsqlite3_commit_hook // sqlite3.c:124416:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 328 /* .complete */)) = Xsqlite3_complete // sqlite3.c:124417:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 336 /* .complete16 */)) = Xsqlite3_complete16 // sqlite3.c:124418:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 344 /* .create_collation */)) = Xsqlite3_create_collation // sqlite3.c:124419:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 352 /* .create_collation16 */)) = Xsqlite3_create_collation16 // sqlite3.c:124420:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 360 /* .create_function */)) = Xsqlite3_create_function // sqlite3.c:124421:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 368 /* .create_function16 */)) = Xsqlite3_create_function16 // sqlite3.c:124422:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 376 /* .create_module */)) = Xsqlite3_create_module // sqlite3.c:124423:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 384 /* .data_count */)) = Xsqlite3_data_count // sqlite3.c:124424:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 392 /* .db_handle */)) = Xsqlite3_db_handle // sqlite3.c:124425:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 400 /* .declare_vtab */)) = Xsqlite3_declare_vtab // sqlite3.c:124426:3: - *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 408 /* .enable_shared_cache */)) = Xsqlite3_enable_shared_cache // sqlite3.c:124427:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 416 /* .errcode */)) = Xsqlite3_errcode // sqlite3.c:124428:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 424 /* .errmsg */)) = Xsqlite3_errmsg // sqlite3.c:124429:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 432 /* .errmsg16 */)) = Xsqlite3_errmsg16 // sqlite3.c:124430:3: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_callback, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 440 /* .exec */)) = Xsqlite3_exec // sqlite3.c:124431:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 448 /* .expired */)) = Xsqlite3_expired // sqlite3.c:124433:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 456 /* .finalize */)) = Xsqlite3_finalize // sqlite3.c:124437:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 464 /* .free */)) = Xsqlite3_free // sqlite3.c:124438:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 472 /* .free_table */)) = Xsqlite3_free_table // sqlite3.c:124439:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 480 /* .get_autocommit */)) = Xsqlite3_get_autocommit // sqlite3.c:124440:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 488 /* .get_auxdata */)) = Xsqlite3_get_auxdata // sqlite3.c:124441:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 496 /* .get_table */)) = Xsqlite3_get_table // sqlite3.c:124442:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 512 /* .interruptx */)) = Xsqlite3_interrupt // sqlite3.c:124444:3: - *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 520 /* .last_insert_rowid */)) = Xsqlite3_last_insert_rowid // sqlite3.c:124445:3: - *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 528 /* .libversion */)) = Xsqlite3_libversion // sqlite3.c:124446:3: - *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 536 /* .libversion_number */)) = Xsqlite3_libversion_number // sqlite3.c:124447:3: - *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 544 /* .malloc */)) = Xsqlite3_malloc // sqlite3.c:124448:3: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 552 /* .mprintf */)) = Xsqlite3_mprintf // sqlite3.c:124449:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 560 /* .open */)) = Xsqlite3_open // sqlite3.c:124450:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 568 /* .open16 */)) = Xsqlite3_open16 // sqlite3.c:124451:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 576 /* .prepare */)) = Xsqlite3_prepare // sqlite3.c:124452:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 584 /* .prepare16 */)) = Xsqlite3_prepare16 // sqlite3.c:124453:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 592 /* .profile */)) = Xsqlite3_profile // sqlite3.c:124454:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 600 /* .progress_handler */)) = Xsqlite3_progress_handler // sqlite3.c:124455:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 608 /* .realloc */)) = Xsqlite3_realloc // sqlite3.c:124456:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 616 /* .reset */)) = Xsqlite3_reset // sqlite3.c:124457:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 624 /* .result_blob */)) = Xsqlite3_result_blob // sqlite3.c:124458:3: - *(*func(*libc.TLS, uintptr, float64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 632 /* .result_double */)) = Xsqlite3_result_double // sqlite3.c:124459:3: - *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 640 /* .result_error */)) = Xsqlite3_result_error // sqlite3.c:124460:3: - *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 648 /* .result_error16 */)) = Xsqlite3_result_error16 // sqlite3.c:124461:3: - *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 656 /* .result_int */)) = Xsqlite3_result_int // sqlite3.c:124462:3: - *(*func(*libc.TLS, uintptr, I64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 664 /* .result_int64 */)) = Xsqlite3_result_int64 // sqlite3.c:124463:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 672 /* .result_null */)) = Xsqlite3_result_null // sqlite3.c:124464:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 680 /* .result_text */)) = Xsqlite3_result_text // sqlite3.c:124465:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 688 /* .result_text16 */)) = Xsqlite3_result_text16 // sqlite3.c:124466:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 696 /* .result_text16be */)) = Xsqlite3_result_text16be // sqlite3.c:124467:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 704 /* .result_text16le */)) = Xsqlite3_result_text16le // sqlite3.c:124468:3: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 712 /* .result_value */)) = Xsqlite3_result_value // sqlite3.c:124469:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 720 /* .rollback_hook */)) = Xsqlite3_rollback_hook // sqlite3.c:124470:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 728 /* .set_authorizer */)) = Xsqlite3_set_authorizer // sqlite3.c:124471:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 736 /* .set_auxdata */)) = Xsqlite3_set_auxdata // sqlite3.c:124472:3: - *(*func(*libc.TLS, int32, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 744 /* .xsnprintf */)) = Xsqlite3_snprintf // sqlite3.c:124473:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 752 /* .step */)) = Xsqlite3_step // sqlite3.c:124474:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 760 /* .table_column_metadata */)) = Xsqlite3_table_column_metadata // sqlite3.c:124475:3: - *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 768 /* .thread_cleanup */)) = Xsqlite3_thread_cleanup // sqlite3.c:124477:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 776 /* .total_changes */)) = Xsqlite3_total_changes // sqlite3.c:124481:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 784 /* .trace */)) = Xsqlite3_trace // sqlite3.c:124482:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 792 /* .transfer_bindings */)) = Xsqlite3_transfer_bindings // sqlite3.c:124484:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 800 /* .update_hook */)) = Xsqlite3_update_hook // sqlite3.c:124488:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 808 /* .user_data */)) = Xsqlite3_user_data // sqlite3.c:124489:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 816 /* .value_blob */)) = Xsqlite3_value_blob // sqlite3.c:124490:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 824 /* .value_bytes */)) = Xsqlite3_value_bytes // sqlite3.c:124491:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 832 /* .value_bytes16 */)) = Xsqlite3_value_bytes16 // sqlite3.c:124492:3: - *(*func(*libc.TLS, uintptr) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 840 /* .value_double */)) = Xsqlite3_value_double // sqlite3.c:124493:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 848 /* .value_int */)) = Xsqlite3_value_int // sqlite3.c:124494:3: - *(*func(*libc.TLS, uintptr) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 856 /* .value_int64 */)) = Xsqlite3_value_int64 // sqlite3.c:124495:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 864 /* .value_numeric_type */)) = Xsqlite3_value_numeric_type // sqlite3.c:124496:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 872 /* .value_text */)) = Xsqlite3_value_text // sqlite3.c:124497:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 880 /* .value_text16 */)) = Xsqlite3_value_text16 // sqlite3.c:124498:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 888 /* .value_text16be */)) = Xsqlite3_value_text16be // sqlite3.c:124499:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 896 /* .value_text16le */)) = Xsqlite3_value_text16le // sqlite3.c:124500:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 904 /* .value_type */)) = Xsqlite3_value_type // sqlite3.c:124501:3: - *(*func(*libc.TLS, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 912 /* .vmprintf */)) = Xsqlite3_vmprintf // sqlite3.c:124502:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 920 /* .overload_function */)) = Xsqlite3_overload_function // sqlite3.c:124511:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 928 /* .prepare_v2 */)) = Xsqlite3_prepare_v2 // sqlite3.c:124516:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 936 /* .prepare16_v2 */)) = Xsqlite3_prepare16_v2 // sqlite3.c:124517:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 944 /* .clear_bindings */)) = Xsqlite3_clear_bindings // sqlite3.c:124518:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 952 /* .create_module_v2 */)) = Xsqlite3_create_module_v2 // sqlite3.c:124523:3: - *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 960 /* .bind_zeroblob */)) = Xsqlite3_bind_zeroblob // sqlite3.c:124528:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 968 /* .blob_bytes */)) = Xsqlite3_blob_bytes // sqlite3.c:124529:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 976 /* .blob_close */)) = Xsqlite3_blob_close // sqlite3.c:124530:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, Sqlite_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 984 /* .blob_open */)) = Xsqlite3_blob_open // sqlite3.c:124531:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 992 /* .blob_read */)) = Xsqlite3_blob_read // sqlite3.c:124532:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1000 /* .blob_write */)) = Xsqlite3_blob_write // sqlite3.c:124533:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1008 /* .create_collation_v2 */)) = Xsqlite3_create_collation_v2 // sqlite3.c:124534:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1016 /* .file_control */)) = Xsqlite3_file_control // sqlite3.c:124535:3: - *(*func(*libc.TLS, int32) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1024 /* .memory_highwater */)) = Xsqlite3_memory_highwater // sqlite3.c:124536:3: - *(*func(*libc.TLS) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1032 /* .memory_used */)) = Xsqlite3_memory_used // sqlite3.c:124537:3: - *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1040 /* .mutex_alloc */)) = Xsqlite3_mutex_alloc // sqlite3.c:124545:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1048 /* .mutex_enter */)) = Xsqlite3_mutex_enter // sqlite3.c:124546:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1056 /* .mutex_free */)) = Xsqlite3_mutex_free // sqlite3.c:124547:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1064 /* .mutex_leave */)) = Xsqlite3_mutex_leave // sqlite3.c:124548:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1072 /* .mutex_try */)) = Xsqlite3_mutex_try // sqlite3.c:124549:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1080 /* .open_v2 */)) = Xsqlite3_open_v2 // sqlite3.c:124551:3: - *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1088 /* .release_memory */)) = Xsqlite3_release_memory // sqlite3.c:124552:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1096 /* .result_error_nomem */)) = Xsqlite3_result_error_nomem // sqlite3.c:124553:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1104 /* .result_error_toobig */)) = Xsqlite3_result_error_toobig // sqlite3.c:124554:3: - *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1112 /* .sleep */)) = Xsqlite3_sleep // sqlite3.c:124555:3: - *(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1120 /* .soft_heap_limit */)) = Xsqlite3_soft_heap_limit // sqlite3.c:124556:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1128 /* .vfs_find */)) = Xsqlite3_vfs_find // sqlite3.c:124557:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1136 /* .vfs_register */)) = Xsqlite3_vfs_register // sqlite3.c:124558:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1144 /* .vfs_unregister */)) = Xsqlite3_vfs_unregister // sqlite3.c:124559:3: - *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1152 /* .xthreadsafe */)) = Xsqlite3_threadsafe // sqlite3.c:124564:3: - *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1160 /* .result_zeroblob */)) = Xsqlite3_result_zeroblob // sqlite3.c:124565:3: - *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1168 /* .result_error_code */)) = Xsqlite3_result_error_code // sqlite3.c:124566:3: - *(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1176 /* .test_control */)) = Xsqlite3_test_control // sqlite3.c:124567:3: - *(*func(*libc.TLS, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1184 /* .randomness */)) = Xsqlite3_randomness // sqlite3.c:124568:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1192 /* .context_db_handle */)) = Xsqlite3_context_db_handle // sqlite3.c:124569:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1200 /* .extended_result_codes */)) = Xsqlite3_extended_result_codes // sqlite3.c:124574:3: - *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1208 /* .limit */)) = Xsqlite3_limit // sqlite3.c:124575:3: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1216 /* .next_stmt */)) = Xsqlite3_next_stmt // sqlite3.c:124576:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1224 /* .sql */)) = Xsqlite3_sql // sqlite3.c:124577:3: - *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1232 /* .status */)) = Xsqlite3_status // sqlite3.c:124578:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1240 /* .backup_finish */)) = Xsqlite3_backup_finish // sqlite3.c:124583:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1248 /* .backup_init */)) = Xsqlite3_backup_init // sqlite3.c:124584:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1256 /* .backup_pagecount */)) = Xsqlite3_backup_pagecount // sqlite3.c:124585:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1264 /* .backup_remaining */)) = Xsqlite3_backup_remaining // sqlite3.c:124586:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1272 /* .backup_step */)) = Xsqlite3_backup_step // sqlite3.c:124587:3: - *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1280 /* .compileoption_get */)) = Xsqlite3_compileoption_get // sqlite3.c:124589:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1288 /* .compileoption_used */)) = Xsqlite3_compileoption_used // sqlite3.c:124590:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1296 /* .create_function_v2 */)) = Xsqlite3_create_function_v2 // sqlite3.c:124595:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1304 /* .db_config */)) = Xsqlite3_db_config // sqlite3.c:124596:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1312 /* .db_mutex */)) = Xsqlite3_db_mutex // sqlite3.c:124597:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1320 /* .db_status */)) = Xsqlite3_db_status // sqlite3.c:124598:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1328 /* .extended_errcode */)) = Xsqlite3_extended_errcode // sqlite3.c:124599:3: - *(*func(*libc.TLS, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1336 /* .log */)) = Xsqlite3_log // sqlite3.c:124600:3: - *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1344 /* .soft_heap_limit64 */)) = Xsqlite3_soft_heap_limit64 // sqlite3.c:124601:3: - *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1352 /* .sourceid */)) = Xsqlite3_sourceid // sqlite3.c:124602:3: - *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1360 /* .stmt_status */)) = Xsqlite3_stmt_status // sqlite3.c:124603:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1368 /* .strnicmp */)) = Xsqlite3_strnicmp // sqlite3.c:124604:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1376 /* .unlock_notify */)) = Xsqlite3_unlock_notify // sqlite3.c:124606:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1384 /* .wal_autocheckpoint */)) = Xsqlite3_wal_autocheckpoint // sqlite3.c:124611:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1392 /* .wal_checkpoint */)) = Xsqlite3_wal_checkpoint // sqlite3.c:124612:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1400 /* .wal_hook */)) = Xsqlite3_wal_hook // sqlite3.c:124613:3: - *(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1408 /* .blob_reopen */)) = Xsqlite3_blob_reopen // sqlite3.c:124619:3: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1416 /* .vtab_config */)) = Xsqlite3_vtab_config // sqlite3.c:124620:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1424 /* .vtab_on_conflict */)) = Xsqlite3_vtab_on_conflict // sqlite3.c:124621:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1432 /* .close_v2 */)) = Xsqlite3_close_v2 // sqlite3.c:124622:3: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1440 /* .db_filename */)) = Xsqlite3_db_filename // sqlite3.c:124623:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1448 /* .db_readonly */)) = Xsqlite3_db_readonly // sqlite3.c:124624:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1456 /* .db_release_memory */)) = Xsqlite3_db_release_memory // sqlite3.c:124625:3: - *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1464 /* .errstr */)) = Xsqlite3_errstr // sqlite3.c:124626:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1472 /* .stmt_busy */)) = Xsqlite3_stmt_busy // sqlite3.c:124627:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1480 /* .stmt_readonly */)) = Xsqlite3_stmt_readonly // sqlite3.c:124628:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1488 /* .stricmp */)) = Xsqlite3_stricmp // sqlite3.c:124629:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1496 /* .uri_boolean */)) = Xsqlite3_uri_boolean // sqlite3.c:124630:3: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1504 /* .uri_int64 */)) = Xsqlite3_uri_int64 // sqlite3.c:124631:3: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1512 /* .uri_parameter */)) = Xsqlite3_uri_parameter // sqlite3.c:124632:3: - *(*func(*libc.TLS, int32, uintptr, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1520 /* .xvsnprintf */)) = Xsqlite3_vsnprintf // sqlite3.c:124633:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1528 /* .wal_checkpoint_v2 */)) = Xsqlite3_wal_checkpoint_v2 // sqlite3.c:124634:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1536 /* .auto_extension */)) = Xsqlite3_auto_extension // sqlite3.c:124636:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1544 /* .bind_blob64 */)) = Xsqlite3_bind_blob64 // sqlite3.c:124637:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr, uint8) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1552 /* .bind_text64 */)) = Xsqlite3_bind_text64 // sqlite3.c:124638:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1560 /* .cancel_auto_extension */)) = Xsqlite3_cancel_auto_extension // sqlite3.c:124639:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1568 /* .load_extension */)) = Xsqlite3_load_extension // sqlite3.c:124640:3: - *(*func(*libc.TLS, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1576 /* .malloc64 */)) = Xsqlite3_malloc64 // sqlite3.c:124641:3: - *(*func(*libc.TLS, uintptr) Sqlite3_uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1584 /* .msize */)) = Xsqlite3_msize // sqlite3.c:124642:3: - *(*func(*libc.TLS, uintptr, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1592 /* .realloc64 */)) = Xsqlite3_realloc64 // sqlite3.c:124643:3: - *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1600 /* .reset_auto_extension */)) = Xsqlite3_reset_auto_extension // sqlite3.c:124644:3: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1608 /* .result_blob64 */)) = Xsqlite3_result_blob64 // sqlite3.c:124645:3: - *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr, uint8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1616 /* .result_text64 */)) = Xsqlite3_result_text64 // sqlite3.c:124646:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1624 /* .strglob */)) = Xsqlite3_strglob // sqlite3.c:124647:3: + }{libc.Xlstat})) // sqlite3.c:34387:22: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 32 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 40 /* .xOpen */)) = unixOpen // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 48 /* .xDelete */)) = unixDelete // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 56 /* .xAccess */)) = unixAccess // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 64 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 72 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 80 /* .xDlError */)) = unixDlError // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 88 /* .xDlSym */)) = unixDlSym // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 96 /* .xDlClose */)) = unixDlClose // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 104 /* .xRandomness */)) = unixRandomness // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 112 /* .xSleep */)) = unixSleep // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 120 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 128 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 136 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 144 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 152 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41854:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 160 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41854:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 200 /* .pAppData */)) = uintptr(unsafe.Pointer(&nolockIoFinder)) // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 208 /* .xOpen */)) = unixOpen // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 216 /* .xDelete */)) = unixDelete // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 224 /* .xAccess */)) = unixAccess // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 232 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 240 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 248 /* .xDlError */)) = unixDlError // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 256 /* .xDlSym */)) = unixDlSym // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 264 /* .xDlClose */)) = unixDlClose // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 272 /* .xRandomness */)) = unixRandomness // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 280 /* .xSleep */)) = unixSleep // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 288 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 296 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 304 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 312 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 320 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41856:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 328 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41856:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 368 /* .pAppData */)) = uintptr(unsafe.Pointer(&dotlockIoFinder)) // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 376 /* .xOpen */)) = unixOpen // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 384 /* .xDelete */)) = unixDelete // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 392 /* .xAccess */)) = unixAccess // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 400 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 408 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 416 /* .xDlError */)) = unixDlError // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 424 /* .xDlSym */)) = unixDlSym // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 432 /* .xDlClose */)) = unixDlClose // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 440 /* .xRandomness */)) = unixRandomness // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 448 /* .xSleep */)) = unixSleep // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 456 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 464 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 472 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 480 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 488 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41857:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 496 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41857:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 536 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 544 /* .xOpen */)) = unixOpen // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 552 /* .xDelete */)) = unixDelete // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 560 /* .xAccess */)) = unixAccess // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 568 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 576 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 584 /* .xDlError */)) = unixDlError // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 592 /* .xDlSym */)) = unixDlSym // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 600 /* .xDlClose */)) = unixDlClose // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 608 /* .xRandomness */)) = unixRandomness // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 616 /* .xSleep */)) = unixSleep // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 624 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 632 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 640 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 648 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 656 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 664 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41858:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 24 /* .xSFunc */)) = row_numberStepFunc // sqlite3.c:154436:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 32 /* .xFinalize */)) = row_numberValueFunc // sqlite3.c:154436:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 40 /* .xValue */)) = row_numberValueFunc // sqlite3.c:154436:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 48 /* .xInverse */)) = noopStepFunc // sqlite3.c:154436:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 56 /* .zName */)) = uintptr(unsafe.Pointer(&row_numberName)) // sqlite3.c:154436:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 96 /* .xSFunc */)) = dense_rankStepFunc // sqlite3.c:154437:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 104 /* .xFinalize */)) = dense_rankValueFunc // sqlite3.c:154437:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 112 /* .xValue */)) = dense_rankValueFunc // sqlite3.c:154437:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 120 /* .xInverse */)) = noopStepFunc // sqlite3.c:154437:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 128 /* .zName */)) = uintptr(unsafe.Pointer(&dense_rankName)) // sqlite3.c:154437:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 168 /* .xSFunc */)) = rankStepFunc // sqlite3.c:154438:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 176 /* .xFinalize */)) = rankValueFunc // sqlite3.c:154438:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 184 /* .xValue */)) = rankValueFunc // sqlite3.c:154438:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 192 /* .xInverse */)) = noopStepFunc // sqlite3.c:154438:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 200 /* .zName */)) = uintptr(unsafe.Pointer(&rankName)) // sqlite3.c:154438:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 240 /* .xSFunc */)) = percent_rankStepFunc // sqlite3.c:154439:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 248 /* .xFinalize */)) = percent_rankValueFunc // sqlite3.c:154439:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 256 /* .xValue */)) = percent_rankValueFunc // sqlite3.c:154439:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 264 /* .xInverse */)) = percent_rankInvFunc // sqlite3.c:154439:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 272 /* .zName */)) = uintptr(unsafe.Pointer(&percent_rankName)) // sqlite3.c:154439:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 312 /* .xSFunc */)) = cume_distStepFunc // sqlite3.c:154440:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 320 /* .xFinalize */)) = cume_distValueFunc // sqlite3.c:154440:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 328 /* .xValue */)) = cume_distValueFunc // sqlite3.c:154440:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 336 /* .xInverse */)) = cume_distInvFunc // sqlite3.c:154440:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 344 /* .zName */)) = uintptr(unsafe.Pointer(&cume_distName)) // sqlite3.c:154440:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 384 /* .xSFunc */)) = ntileStepFunc // sqlite3.c:154441:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 392 /* .xFinalize */)) = ntileValueFunc // sqlite3.c:154441:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 400 /* .xValue */)) = ntileValueFunc // sqlite3.c:154441:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 408 /* .xInverse */)) = ntileInvFunc // sqlite3.c:154441:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 416 /* .zName */)) = uintptr(unsafe.Pointer(&ntileName)) // sqlite3.c:154441:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 456 /* .xSFunc */)) = last_valueStepFunc // sqlite3.c:154442:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 464 /* .xFinalize */)) = last_valueFinalizeFunc // sqlite3.c:154442:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 472 /* .xValue */)) = last_valueValueFunc // sqlite3.c:154442:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 480 /* .xInverse */)) = last_valueInvFunc // sqlite3.c:154442:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 488 /* .zName */)) = uintptr(unsafe.Pointer(&last_valueName)) // sqlite3.c:154442:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 528 /* .xSFunc */)) = nth_valueStepFunc // sqlite3.c:154443:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 536 /* .xFinalize */)) = nth_valueFinalizeFunc // sqlite3.c:154443:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 544 /* .xValue */)) = noopValueFunc // sqlite3.c:154443:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 552 /* .xInverse */)) = noopStepFunc // sqlite3.c:154443:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 560 /* .zName */)) = uintptr(unsafe.Pointer(&nth_valueName)) // sqlite3.c:154443:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 600 /* .xSFunc */)) = first_valueStepFunc // sqlite3.c:154444:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 608 /* .xFinalize */)) = first_valueFinalizeFunc // sqlite3.c:154444:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 616 /* .xValue */)) = noopValueFunc // sqlite3.c:154444:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 624 /* .xInverse */)) = noopStepFunc // sqlite3.c:154444:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 632 /* .zName */)) = uintptr(unsafe.Pointer(&first_valueName)) // sqlite3.c:154444:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 672 /* .xSFunc */)) = noopStepFunc // sqlite3.c:154445:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 680 /* .xFinalize */)) = noopValueFunc // sqlite3.c:154445:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 688 /* .xValue */)) = noopValueFunc // sqlite3.c:154445:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 696 /* .xInverse */)) = noopStepFunc // sqlite3.c:154445:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 704 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:154445:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 744 /* .xSFunc */)) = noopStepFunc // sqlite3.c:154446:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 752 /* .xFinalize */)) = noopValueFunc // sqlite3.c:154446:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 760 /* .xValue */)) = noopValueFunc // sqlite3.c:154446:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 768 /* .xInverse */)) = noopStepFunc // sqlite3.c:154446:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 776 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:154446:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 816 /* .xSFunc */)) = noopStepFunc // sqlite3.c:154447:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 824 /* .xFinalize */)) = noopValueFunc // sqlite3.c:154447:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 832 /* .xValue */)) = noopValueFunc // sqlite3.c:154447:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 840 /* .xInverse */)) = noopStepFunc // sqlite3.c:154447:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 848 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:154447:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 888 /* .xSFunc */)) = noopStepFunc // sqlite3.c:154448:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 896 /* .xFinalize */)) = noopValueFunc // sqlite3.c:154448:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 904 /* .xValue */)) = noopValueFunc // sqlite3.c:154448:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 912 /* .xInverse */)) = noopStepFunc // sqlite3.c:154448:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 920 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:154448:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 960 /* .xSFunc */)) = noopStepFunc // sqlite3.c:154449:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 968 /* .xFinalize */)) = noopValueFunc // sqlite3.c:154449:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 976 /* .xValue */)) = noopValueFunc // sqlite3.c:154449:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 984 /* .xInverse */)) = noopStepFunc // sqlite3.c:154449:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 992 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:154449:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1032 /* .xSFunc */)) = noopStepFunc // sqlite3.c:154450:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1040 /* .xFinalize */)) = noopValueFunc // sqlite3.c:154450:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1048 /* .xValue */)) = noopValueFunc // sqlite3.c:154450:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1056 /* .xInverse */)) = noopStepFunc // sqlite3.c:154450:5: + *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1064 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:154450:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&attach_func)) + 24 /* .xSFunc */)) = attachFunc // sqlite3.c:111076:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 16 /* .xConnect */)) = bytecodevtabConnect // sqlite3.c:97883:21: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 24 /* .xBestIndex */)) = bytecodevtabBestIndex // sqlite3.c:97884:21: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 32 /* .xDisconnect */)) = bytecodevtabDisconnect // sqlite3.c:97885:21: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 48 /* .xOpen */)) = bytecodevtabOpen // sqlite3.c:97887:21: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 56 /* .xClose */)) = bytecodevtabClose // sqlite3.c:97888:21: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 64 /* .xFilter */)) = bytecodevtabFilter // sqlite3.c:97889:21: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 72 /* .xNext */)) = bytecodevtabNext // sqlite3.c:97890:21: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 80 /* .xEof */)) = bytecodevtabEof // sqlite3.c:97891:21: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 88 /* .xColumn */)) = bytecodevtabColumn // sqlite3.c:97892:21: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 96 /* .xRowid */)) = bytecodevtabRowid // sqlite3.c:97893:21: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 8 /* .xCreate */)) = dbpageConnect // sqlite3.c:205428:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 16 /* .xConnect */)) = dbpageConnect // sqlite3.c:205429:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 24 /* .xBestIndex */)) = dbpageBestIndex // sqlite3.c:205430:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 32 /* .xDisconnect */)) = dbpageDisconnect // sqlite3.c:205431:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 40 /* .xDestroy */)) = dbpageDisconnect // sqlite3.c:205432:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 48 /* .xOpen */)) = dbpageOpen // sqlite3.c:205433:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 56 /* .xClose */)) = dbpageClose // sqlite3.c:205434:5: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 64 /* .xFilter */)) = dbpageFilter // sqlite3.c:205435:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 72 /* .xNext */)) = dbpageNext // sqlite3.c:205436:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 80 /* .xEof */)) = dbpageEof // sqlite3.c:205437:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 88 /* .xColumn */)) = dbpageColumn // sqlite3.c:205438:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 96 /* .xRowid */)) = dbpageRowid // sqlite3.c:205439:5: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 104 /* .xUpdate */)) = dbpageUpdate // sqlite3.c:205440:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 112 /* .xBegin */)) = dbpageBegin // sqlite3.c:205441:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 8 /* .xCreate */)) = statConnect // sqlite3.c:205009:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 16 /* .xConnect */)) = statConnect // sqlite3.c:205010:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 24 /* .xBestIndex */)) = statBestIndex // sqlite3.c:205011:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 32 /* .xDisconnect */)) = statDisconnect // sqlite3.c:205012:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 40 /* .xDestroy */)) = statDisconnect // sqlite3.c:205013:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 48 /* .xOpen */)) = statOpen // sqlite3.c:205014:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 56 /* .xClose */)) = statClose // sqlite3.c:205015:5: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 64 /* .xFilter */)) = statFilter // sqlite3.c:205016:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 72 /* .xNext */)) = statNext // sqlite3.c:205017:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 80 /* .xEof */)) = statEof // sqlite3.c:205018:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 88 /* .xColumn */)) = statColumn // sqlite3.c:205019:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 96 /* .xRowid */)) = statRowid // sqlite3.c:205020:5: + *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 0 /* .xMalloc */)) = sqlite3MemMalloc // sqlite3.c:24111:6: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 8 /* .xFree */)) = sqlite3MemFree // sqlite3.c:24112:6: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 16 /* .xRealloc */)) = sqlite3MemRealloc // sqlite3.c:24113:6: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 24 /* .xSize */)) = sqlite3MemSize // sqlite3.c:24114:6: + *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 32 /* .xRoundup */)) = sqlite3MemRoundup // sqlite3.c:24115:6: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 40 /* .xInit */)) = sqlite3MemInit // sqlite3.c:24116:6: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 48 /* .xShutdown */)) = sqlite3MemShutdown // sqlite3.c:24117:6: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 16 /* .xInit */)) = pcache1Init // sqlite3.c:51388:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 24 /* .xShutdown */)) = pcache1Shutdown // sqlite3.c:51389:5: + *(*func(*libc.TLS, int32, int32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 32 /* .xCreate */)) = pcache1Create // sqlite3.c:51390:5: + *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 40 /* .xCachesize */)) = pcache1Cachesize // sqlite3.c:51391:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 48 /* .xPagecount */)) = pcache1Pagecount // sqlite3.c:51392:5: + *(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 56 /* .xFetch */)) = pcache1Fetch // sqlite3.c:51393:5: + *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 64 /* .xUnpin */)) = pcache1Unpin // sqlite3.c:51394:5: + *(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 72 /* .xRekey */)) = pcache1Rekey // sqlite3.c:51395:5: + *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 80 /* .xTruncate */)) = pcache1Truncate // sqlite3.c:51396:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 88 /* .xDestroy */)) = pcache1Destroy // sqlite3.c:51397:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 96 /* .xShrink */)) = pcache1Shrink // sqlite3.c:51398:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&detach_func)) + 24 /* .xSFunc */)) = detachFunc // sqlite3.c:111056:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoFinder)) + 0)) = dotlockIoFinderImpl // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 8 /* .xClose */)) = dotlockClose // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 56 /* .xLock */)) = dotlockLock // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 64 /* .xUnlock */)) = dotlockUnlock // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 72 /* .xCheckReservedLock */)) = dotlockCheckReservedLock // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:39230:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 8 /* .xCreate */)) = fts5CreateMethod // sqlite3.c:229216:25: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 16 /* .xConnect */)) = fts5ConnectMethod // sqlite3.c:229217:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 24 /* .xBestIndex */)) = fts5BestIndexMethod // sqlite3.c:229218:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 32 /* .xDisconnect */)) = fts5DisconnectMethod // sqlite3.c:229219:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 40 /* .xDestroy */)) = fts5DestroyMethod // sqlite3.c:229220:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 48 /* .xOpen */)) = fts5OpenMethod // sqlite3.c:229221:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 56 /* .xClose */)) = fts5CloseMethod // sqlite3.c:229222:25: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 64 /* .xFilter */)) = fts5FilterMethod // sqlite3.c:229223:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 72 /* .xNext */)) = fts5NextMethod // sqlite3.c:229224:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 80 /* .xEof */)) = fts5EofMethod // sqlite3.c:229225:25: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 88 /* .xColumn */)) = fts5ColumnMethod // sqlite3.c:229226:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 96 /* .xRowid */)) = fts5RowidMethod // sqlite3.c:229227:25: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 104 /* .xUpdate */)) = fts5UpdateMethod // sqlite3.c:229228:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 112 /* .xBegin */)) = fts5BeginMethod // sqlite3.c:229229:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 120 /* .xSync */)) = fts5SyncMethod // sqlite3.c:229230:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 128 /* .xCommit */)) = fts5CommitMethod // sqlite3.c:229231:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 136 /* .xRollback */)) = fts5RollbackMethod // sqlite3.c:229232:25: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 144 /* .xFindFunction */)) = fts5FindFunctionMethod // sqlite3.c:229233:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 152 /* .xRename */)) = fts5RenameMethod // sqlite3.c:229234:25: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 160 /* .xSavepoint */)) = fts5SavepointMethod // sqlite3.c:229235:25: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 168 /* .xRelease */)) = fts5ReleaseMethod // sqlite3.c:229236:25: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 176 /* .xRollbackTo */)) = fts5RollbackToMethod // sqlite3.c:229237:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 184 /* .xShadowName */)) = fts5ShadowName // sqlite3.c:229238:25: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 8 /* .xCreate */)) = fts5VocabCreateMethod // sqlite3.c:233784:25: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 16 /* .xConnect */)) = fts5VocabConnectMethod // sqlite3.c:233785:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 24 /* .xBestIndex */)) = fts5VocabBestIndexMethod // sqlite3.c:233786:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 32 /* .xDisconnect */)) = fts5VocabDisconnectMethod // sqlite3.c:233787:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 40 /* .xDestroy */)) = fts5VocabDestroyMethod // sqlite3.c:233788:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 48 /* .xOpen */)) = fts5VocabOpenMethod // sqlite3.c:233789:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 56 /* .xClose */)) = fts5VocabCloseMethod // sqlite3.c:233790:25: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 64 /* .xFilter */)) = fts5VocabFilterMethod // sqlite3.c:233791:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 72 /* .xNext */)) = fts5VocabNextMethod // sqlite3.c:233792:25: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 80 /* .xEof */)) = fts5VocabEofMethod // sqlite3.c:233793:25: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 88 /* .xColumn */)) = fts5VocabColumnMethod // sqlite3.c:233794:25: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 96 /* .xRowid */)) = fts5VocabRowidMethod // sqlite3.c:233795:25: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 8 /* .xCreate */)) = geopolyCreate // sqlite3.c:197188:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 16 /* .xConnect */)) = geopolyConnect // sqlite3.c:197189:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 24 /* .xBestIndex */)) = geopolyBestIndex // sqlite3.c:197190:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 32 /* .xDisconnect */)) = rtreeDisconnect // sqlite3.c:197191:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 40 /* .xDestroy */)) = rtreeDestroy // sqlite3.c:197192:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 48 /* .xOpen */)) = rtreeOpen // sqlite3.c:197193:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 56 /* .xClose */)) = rtreeClose // sqlite3.c:197194:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 64 /* .xFilter */)) = geopolyFilter // sqlite3.c:197195:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 72 /* .xNext */)) = rtreeNext // sqlite3.c:197196:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 80 /* .xEof */)) = rtreeEof // sqlite3.c:197197:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 88 /* .xColumn */)) = geopolyColumn // sqlite3.c:197198:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 96 /* .xRowid */)) = rtreeRowid // sqlite3.c:197199:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 104 /* .xUpdate */)) = geopolyUpdate // sqlite3.c:197200:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 112 /* .xBegin */)) = rtreeBeginTransaction // sqlite3.c:197201:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 120 /* .xSync */)) = rtreeEndTransaction // sqlite3.c:197202:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 128 /* .xCommit */)) = rtreeEndTransaction // sqlite3.c:197203:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 136 /* .xRollback */)) = rtreeEndTransaction // sqlite3.c:197204:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 144 /* .xFindFunction */)) = geopolyFindFunction // sqlite3.c:197205:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 152 /* .xRename */)) = rtreeRename // sqlite3.c:197206:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 160 /* .xSavepoint */)) = rtreeSavepoint // sqlite3.c:197207:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 184 /* .xShadowName */)) = rtreeShadowName // sqlite3.c:197210:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 16 /* .xConnect */)) = jsonEachConnect // sqlite3.c:190928:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 24 /* .xBestIndex */)) = jsonEachBestIndex // sqlite3.c:190929:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 32 /* .xDisconnect */)) = jsonEachDisconnect // sqlite3.c:190930:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 48 /* .xOpen */)) = jsonEachOpenEach // sqlite3.c:190932:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 56 /* .xClose */)) = jsonEachClose // sqlite3.c:190933:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 64 /* .xFilter */)) = jsonEachFilter // sqlite3.c:190934:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 72 /* .xNext */)) = jsonEachNext // sqlite3.c:190935:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 80 /* .xEof */)) = jsonEachEof // sqlite3.c:190936:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 88 /* .xColumn */)) = jsonEachColumn // sqlite3.c:190937:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 96 /* .xRowid */)) = jsonEachRowid // sqlite3.c:190938:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 16 /* .xConnect */)) = jsonEachConnect // sqlite3.c:190956:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 24 /* .xBestIndex */)) = jsonEachBestIndex // sqlite3.c:190957:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 32 /* .xDisconnect */)) = jsonEachDisconnect // sqlite3.c:190958:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 48 /* .xOpen */)) = jsonEachOpenTree // sqlite3.c:190960:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 56 /* .xClose */)) = jsonEachClose // sqlite3.c:190961:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 64 /* .xFilter */)) = jsonEachFilter // sqlite3.c:190962:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 72 /* .xNext */)) = jsonEachNext // sqlite3.c:190963:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 80 /* .xEof */)) = jsonEachEof // sqlite3.c:190964:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 88 /* .xColumn */)) = jsonEachColumn // sqlite3.c:190965:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 96 /* .xRowid */)) = jsonEachRowid // sqlite3.c:190966:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 8 /* .xClose */)) = memdbClose // sqlite3.c:48361:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 16 /* .xRead */)) = memdbRead // sqlite3.c:48362:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 24 /* .xWrite */)) = memdbWrite // sqlite3.c:48363:3: + *(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 32 /* .xTruncate */)) = memdbTruncate // sqlite3.c:48364:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 40 /* .xSync */)) = memdbSync // sqlite3.c:48365:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 48 /* .xFileSize */)) = memdbFileSize // sqlite3.c:48366:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 56 /* .xLock */)) = memdbLock // sqlite3.c:48367:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 64 /* .xUnlock */)) = memdbLock // sqlite3.c:48368:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 80 /* .xFileControl */)) = memdbFileControl // sqlite3.c:48370:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 96 /* .xDeviceCharacteristics */)) = memdbDeviceCharacteristics // sqlite3.c:48372:3: + *(*func(*libc.TLS, uintptr, Sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 136 /* .xFetch */)) = memdbFetch // sqlite3.c:48377:3: + *(*func(*libc.TLS, uintptr, Sqlite3_int64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 144 /* .xUnfetch */)) = memdbUnfetch // sqlite3.c:48378:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 40 /* .xOpen */)) = memdbOpen // sqlite3.c:48344:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 56 /* .xAccess */)) = memdbAccess // sqlite3.c:48346:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 64 /* .xFullPathname */)) = memdbFullPathname // sqlite3.c:48347:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 72 /* .xDlOpen */)) = memdbDlOpen // sqlite3.c:48348:3: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 80 /* .xDlError */)) = memdbDlError // sqlite3.c:48349:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 88 /* .xDlSym */)) = memdbDlSym // sqlite3.c:48350:3: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 96 /* .xDlClose */)) = memdbDlClose // sqlite3.c:48351:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 104 /* .xRandomness */)) = memdbRandomness // sqlite3.c:48352:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 112 /* .xSleep */)) = memdbSleep // sqlite3.c:48353:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 128 /* .xGetLastError */)) = memdbGetLastError // sqlite3.c:48355:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 136 /* .xCurrentTimeInt64 */)) = memdbCurrentTimeInt64 // sqlite3.c:48356:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoFinder)) + 0)) = nolockIoFinderImpl // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 8 /* .xClose */)) = nolockClose // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 56 /* .xLock */)) = nolockLock // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 64 /* .xUnlock */)) = nolockUnlock // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 72 /* .xCheckReservedLock */)) = nolockCheckReservedLock // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:39220:1: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoFinder)) + 0)) = posixIoFinderImpl // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 8 /* .xClose */)) = unixClose // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 56 /* .xLock */)) = unixLock // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 64 /* .xUnlock */)) = unixUnlock // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 72 /* .xCheckReservedLock */)) = unixCheckReservedLock // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 104 /* .xShmMap */)) = unixShmMap // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:39210:1: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 16 /* .xConnect */)) = pragmaVtabConnect // sqlite3.c:130019:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 24 /* .xBestIndex */)) = pragmaVtabBestIndex // sqlite3.c:130020:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 32 /* .xDisconnect */)) = pragmaVtabDisconnect // sqlite3.c:130021:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 48 /* .xOpen */)) = pragmaVtabOpen // sqlite3.c:130023:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 56 /* .xClose */)) = pragmaVtabClose // sqlite3.c:130024:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 64 /* .xFilter */)) = pragmaVtabFilter // sqlite3.c:130025:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 72 /* .xNext */)) = pragmaVtabNext // sqlite3.c:130026:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 80 /* .xEof */)) = pragmaVtabEof // sqlite3.c:130027:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 88 /* .xColumn */)) = pragmaVtabColumn // sqlite3.c:130028:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 96 /* .xRowid */)) = pragmaVtabRowid // sqlite3.c:130029:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 8 /* .xClose */)) = rbuVfsClose // sqlite3.c:203828:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 16 /* .xRead */)) = rbuVfsRead // sqlite3.c:203829:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 24 /* .xWrite */)) = rbuVfsWrite // sqlite3.c:203830:5: + *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 32 /* .xTruncate */)) = rbuVfsTruncate // sqlite3.c:203831:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 40 /* .xSync */)) = rbuVfsSync // sqlite3.c:203832:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 48 /* .xFileSize */)) = rbuVfsFileSize // sqlite3.c:203833:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 56 /* .xLock */)) = rbuVfsLock // sqlite3.c:203834:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 64 /* .xUnlock */)) = rbuVfsUnlock // sqlite3.c:203835:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 72 /* .xCheckReservedLock */)) = rbuVfsCheckReservedLock // sqlite3.c:203836:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 80 /* .xFileControl */)) = rbuVfsFileControl // sqlite3.c:203837:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 88 /* .xSectorSize */)) = rbuVfsSectorSize // sqlite3.c:203838:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 96 /* .xDeviceCharacteristics */)) = rbuVfsDeviceCharacteristics // sqlite3.c:203839:5: + *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 104 /* .xShmMap */)) = rbuVfsShmMap // sqlite3.c:203840:5: + *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 112 /* .xShmLock */)) = rbuVfsShmLock // sqlite3.c:203841:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 120 /* .xShmBarrier */)) = rbuVfsShmBarrier // sqlite3.c:203842:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 128 /* .xShmUnmap */)) = rbuVfsShmUnmap // sqlite3.c:203843:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 8 /* .xCreate */)) = rtreeCreate // sqlite3.c:194541:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 16 /* .xConnect */)) = rtreeConnect // sqlite3.c:194542:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 24 /* .xBestIndex */)) = rtreeBestIndex // sqlite3.c:194543:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 32 /* .xDisconnect */)) = rtreeDisconnect // sqlite3.c:194544:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 40 /* .xDestroy */)) = rtreeDestroy // sqlite3.c:194545:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 48 /* .xOpen */)) = rtreeOpen // sqlite3.c:194546:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 56 /* .xClose */)) = rtreeClose // sqlite3.c:194547:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 64 /* .xFilter */)) = rtreeFilter // sqlite3.c:194548:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 72 /* .xNext */)) = rtreeNext // sqlite3.c:194549:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 80 /* .xEof */)) = rtreeEof // sqlite3.c:194550:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 88 /* .xColumn */)) = rtreeColumn // sqlite3.c:194551:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 96 /* .xRowid */)) = rtreeRowid // sqlite3.c:194552:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 104 /* .xUpdate */)) = rtreeUpdate // sqlite3.c:194553:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 112 /* .xBegin */)) = rtreeBeginTransaction // sqlite3.c:194554:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 120 /* .xSync */)) = rtreeEndTransaction // sqlite3.c:194555:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 128 /* .xCommit */)) = rtreeEndTransaction // sqlite3.c:194556:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 136 /* .xRollback */)) = rtreeEndTransaction // sqlite3.c:194557:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 152 /* .xRename */)) = rtreeRename // sqlite3.c:194559:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 160 /* .xSavepoint */)) = rtreeSavepoint // sqlite3.c:194560:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 184 /* .xShadowName */)) = rtreeShadowName // sqlite3.c:194563:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 8 /* .xUserData */)) = fts5ApiUserData // sqlite3.c:228675:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 16 /* .xColumnCount */)) = fts5ApiColumnCount // sqlite3.c:228676:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 24 /* .xRowCount */)) = fts5ApiRowCount // sqlite3.c:228677:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 32 /* .xColumnTotalSize */)) = fts5ApiColumnTotalSize // sqlite3.c:228678:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 40 /* .xTokenize */)) = fts5ApiTokenize // sqlite3.c:228679:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 48 /* .xPhraseCount */)) = fts5ApiPhraseCount // sqlite3.c:228680:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 56 /* .xPhraseSize */)) = fts5ApiPhraseSize // sqlite3.c:228681:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 64 /* .xInstCount */)) = fts5ApiInstCount // sqlite3.c:228682:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 72 /* .xInst */)) = fts5ApiInst // sqlite3.c:228683:3: + *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 80 /* .xRowid */)) = fts5ApiRowid // sqlite3.c:228684:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 88 /* .xColumnText */)) = fts5ApiColumnText // sqlite3.c:228685:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 96 /* .xColumnSize */)) = fts5ApiColumnSize // sqlite3.c:228686:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 104 /* .xQueryPhrase */)) = fts5ApiQueryPhrase // sqlite3.c:228687:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 112 /* .xSetAuxdata */)) = fts5ApiSetAuxdata // sqlite3.c:228688:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 120 /* .xGetAuxdata */)) = fts5ApiGetAuxdata // sqlite3.c:228689:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 128 /* .xPhraseFirst */)) = fts5ApiPhraseFirst // sqlite3.c:228690:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 136 /* .xPhraseNext */)) = fts5ApiPhraseNext // sqlite3.c:228691:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 144 /* .xPhraseFirstColumn */)) = fts5ApiPhraseFirstColumn // sqlite3.c:228692:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 152 /* .xPhraseNextColumn */)) = fts5ApiPhraseNextColumn // sqlite3.c:228693:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 8 /* .xClose */)) = memjrnlClose // sqlite3.c:98238:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 16 /* .xRead */)) = memjrnlRead // sqlite3.c:98239:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 24 /* .xWrite */)) = memjrnlWrite // sqlite3.c:98240:3: + *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 32 /* .xTruncate */)) = memjrnlTruncate // sqlite3.c:98241:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 40 /* .xSync */)) = memjrnlSync // sqlite3.c:98242:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 48 /* .xFileSize */)) = memjrnlFileSize // sqlite3.c:98243:3: + *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 0 /* .xMutexInit */)) = noopMutexInit // sqlite3.c:26344:5: + *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 8 /* .xMutexEnd */)) = noopMutexEnd // sqlite3.c:26345:5: + *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 16 /* .xMutexAlloc */)) = noopMutexAlloc // sqlite3.c:26346:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 24 /* .xMutexFree */)) = noopMutexFree // sqlite3.c:26347:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 32 /* .xMutexEnter */)) = noopMutexEnter // sqlite3.c:26348:5: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 40 /* .xMutexTry */)) = noopMutexTry // sqlite3.c:26349:5: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 48 /* .xMutexLeave */)) = noopMutexLeave // sqlite3.c:26350:5: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 0 /* .aggregate_context */)) = Xsqlite3_aggregate_context // sqlite3.c:126092:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 8 /* .aggregate_count */)) = Xsqlite3_aggregate_count // sqlite3.c:126094:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 16 /* .bind_blob */)) = Xsqlite3_bind_blob // sqlite3.c:126098:3: + *(*func(*libc.TLS, uintptr, int32, float64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 24 /* .bind_double */)) = Xsqlite3_bind_double // sqlite3.c:126099:3: + *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 32 /* .bind_int */)) = Xsqlite3_bind_int // sqlite3.c:126100:3: + *(*func(*libc.TLS, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 40 /* .bind_int64 */)) = Xsqlite3_bind_int64 // sqlite3.c:126101:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 48 /* .bind_null */)) = Xsqlite3_bind_null // sqlite3.c:126102:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 56 /* .bind_parameter_count */)) = Xsqlite3_bind_parameter_count // sqlite3.c:126103:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 64 /* .bind_parameter_index */)) = Xsqlite3_bind_parameter_index // sqlite3.c:126104:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 72 /* .bind_parameter_name */)) = Xsqlite3_bind_parameter_name // sqlite3.c:126105:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 80 /* .bind_text */)) = Xsqlite3_bind_text // sqlite3.c:126106:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 88 /* .bind_text16 */)) = Xsqlite3_bind_text16 // sqlite3.c:126107:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 96 /* .bind_value */)) = Xsqlite3_bind_value // sqlite3.c:126108:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 104 /* .busy_handler */)) = Xsqlite3_busy_handler // sqlite3.c:126109:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 112 /* .busy_timeout */)) = Xsqlite3_busy_timeout // sqlite3.c:126110:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 120 /* .changes */)) = Xsqlite3_changes // sqlite3.c:126111:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 128 /* .close */)) = Xsqlite3_close // sqlite3.c:126112:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 136 /* .collation_needed */)) = Xsqlite3_collation_needed // sqlite3.c:126113:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 144 /* .collation_needed16 */)) = Xsqlite3_collation_needed16 // sqlite3.c:126114:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 152 /* .column_blob */)) = Xsqlite3_column_blob // sqlite3.c:126115:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 160 /* .column_bytes */)) = Xsqlite3_column_bytes // sqlite3.c:126116:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 168 /* .column_bytes16 */)) = Xsqlite3_column_bytes16 // sqlite3.c:126117:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 176 /* .column_count */)) = Xsqlite3_column_count // sqlite3.c:126118:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 184 /* .column_database_name */)) = Xsqlite3_column_database_name // sqlite3.c:126119:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 192 /* .column_database_name16 */)) = Xsqlite3_column_database_name16 // sqlite3.c:126120:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 200 /* .column_decltype */)) = Xsqlite3_column_decltype // sqlite3.c:126121:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 208 /* .column_decltype16 */)) = Xsqlite3_column_decltype16 // sqlite3.c:126122:3: + *(*func(*libc.TLS, uintptr, int32) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 216 /* .column_double */)) = Xsqlite3_column_double // sqlite3.c:126123:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 224 /* .column_int */)) = Xsqlite3_column_int // sqlite3.c:126124:3: + *(*func(*libc.TLS, uintptr, int32) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 232 /* .column_int64 */)) = Xsqlite3_column_int64 // sqlite3.c:126125:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 240 /* .column_name */)) = Xsqlite3_column_name // sqlite3.c:126126:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 248 /* .column_name16 */)) = Xsqlite3_column_name16 // sqlite3.c:126127:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 256 /* .column_origin_name */)) = Xsqlite3_column_origin_name // sqlite3.c:126128:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 264 /* .column_origin_name16 */)) = Xsqlite3_column_origin_name16 // sqlite3.c:126129:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 272 /* .column_table_name */)) = Xsqlite3_column_table_name // sqlite3.c:126130:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 280 /* .column_table_name16 */)) = Xsqlite3_column_table_name16 // sqlite3.c:126131:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 288 /* .column_text */)) = Xsqlite3_column_text // sqlite3.c:126132:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 296 /* .column_text16 */)) = Xsqlite3_column_text16 // sqlite3.c:126133:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 304 /* .column_type */)) = Xsqlite3_column_type // sqlite3.c:126134:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 312 /* .column_value */)) = Xsqlite3_column_value // sqlite3.c:126135:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 320 /* .commit_hook */)) = Xsqlite3_commit_hook // sqlite3.c:126136:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 328 /* .complete */)) = Xsqlite3_complete // sqlite3.c:126137:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 336 /* .complete16 */)) = Xsqlite3_complete16 // sqlite3.c:126138:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 344 /* .create_collation */)) = Xsqlite3_create_collation // sqlite3.c:126139:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 352 /* .create_collation16 */)) = Xsqlite3_create_collation16 // sqlite3.c:126140:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 360 /* .create_function */)) = Xsqlite3_create_function // sqlite3.c:126141:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 368 /* .create_function16 */)) = Xsqlite3_create_function16 // sqlite3.c:126142:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 376 /* .create_module */)) = Xsqlite3_create_module // sqlite3.c:126143:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 384 /* .data_count */)) = Xsqlite3_data_count // sqlite3.c:126144:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 392 /* .db_handle */)) = Xsqlite3_db_handle // sqlite3.c:126145:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 400 /* .declare_vtab */)) = Xsqlite3_declare_vtab // sqlite3.c:126146:3: + *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 408 /* .enable_shared_cache */)) = Xsqlite3_enable_shared_cache // sqlite3.c:126147:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 416 /* .errcode */)) = Xsqlite3_errcode // sqlite3.c:126148:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 424 /* .errmsg */)) = Xsqlite3_errmsg // sqlite3.c:126149:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 432 /* .errmsg16 */)) = Xsqlite3_errmsg16 // sqlite3.c:126150:3: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_callback, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 440 /* .exec */)) = Xsqlite3_exec // sqlite3.c:126151:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 448 /* .expired */)) = Xsqlite3_expired // sqlite3.c:126153:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 456 /* .finalize */)) = Xsqlite3_finalize // sqlite3.c:126157:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 464 /* .free */)) = Xsqlite3_free // sqlite3.c:126158:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 472 /* .free_table */)) = Xsqlite3_free_table // sqlite3.c:126159:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 480 /* .get_autocommit */)) = Xsqlite3_get_autocommit // sqlite3.c:126160:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 488 /* .get_auxdata */)) = Xsqlite3_get_auxdata // sqlite3.c:126161:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 496 /* .get_table */)) = Xsqlite3_get_table // sqlite3.c:126162:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 512 /* .interruptx */)) = Xsqlite3_interrupt // sqlite3.c:126164:3: + *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 520 /* .last_insert_rowid */)) = Xsqlite3_last_insert_rowid // sqlite3.c:126165:3: + *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 528 /* .libversion */)) = Xsqlite3_libversion // sqlite3.c:126166:3: + *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 536 /* .libversion_number */)) = Xsqlite3_libversion_number // sqlite3.c:126167:3: + *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 544 /* .malloc */)) = Xsqlite3_malloc // sqlite3.c:126168:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 552 /* .mprintf */)) = Xsqlite3_mprintf // sqlite3.c:126169:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 560 /* .open */)) = Xsqlite3_open // sqlite3.c:126170:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 568 /* .open16 */)) = Xsqlite3_open16 // sqlite3.c:126171:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 576 /* .prepare */)) = Xsqlite3_prepare // sqlite3.c:126172:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 584 /* .prepare16 */)) = Xsqlite3_prepare16 // sqlite3.c:126173:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 592 /* .profile */)) = Xsqlite3_profile // sqlite3.c:126174:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 600 /* .progress_handler */)) = Xsqlite3_progress_handler // sqlite3.c:126175:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 608 /* .realloc */)) = Xsqlite3_realloc // sqlite3.c:126176:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 616 /* .reset */)) = Xsqlite3_reset // sqlite3.c:126177:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 624 /* .result_blob */)) = Xsqlite3_result_blob // sqlite3.c:126178:3: + *(*func(*libc.TLS, uintptr, float64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 632 /* .result_double */)) = Xsqlite3_result_double // sqlite3.c:126179:3: + *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 640 /* .result_error */)) = Xsqlite3_result_error // sqlite3.c:126180:3: + *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 648 /* .result_error16 */)) = Xsqlite3_result_error16 // sqlite3.c:126181:3: + *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 656 /* .result_int */)) = Xsqlite3_result_int // sqlite3.c:126182:3: + *(*func(*libc.TLS, uintptr, I64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 664 /* .result_int64 */)) = Xsqlite3_result_int64 // sqlite3.c:126183:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 672 /* .result_null */)) = Xsqlite3_result_null // sqlite3.c:126184:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 680 /* .result_text */)) = Xsqlite3_result_text // sqlite3.c:126185:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 688 /* .result_text16 */)) = Xsqlite3_result_text16 // sqlite3.c:126186:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 696 /* .result_text16be */)) = Xsqlite3_result_text16be // sqlite3.c:126187:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 704 /* .result_text16le */)) = Xsqlite3_result_text16le // sqlite3.c:126188:3: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 712 /* .result_value */)) = Xsqlite3_result_value // sqlite3.c:126189:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 720 /* .rollback_hook */)) = Xsqlite3_rollback_hook // sqlite3.c:126190:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 728 /* .set_authorizer */)) = Xsqlite3_set_authorizer // sqlite3.c:126191:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 736 /* .set_auxdata */)) = Xsqlite3_set_auxdata // sqlite3.c:126192:3: + *(*func(*libc.TLS, int32, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 744 /* .xsnprintf */)) = Xsqlite3_snprintf // sqlite3.c:126193:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 752 /* .step */)) = Xsqlite3_step // sqlite3.c:126194:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 760 /* .table_column_metadata */)) = Xsqlite3_table_column_metadata // sqlite3.c:126195:3: + *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 768 /* .thread_cleanup */)) = Xsqlite3_thread_cleanup // sqlite3.c:126197:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 776 /* .total_changes */)) = Xsqlite3_total_changes // sqlite3.c:126201:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 784 /* .trace */)) = Xsqlite3_trace // sqlite3.c:126202:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 792 /* .transfer_bindings */)) = Xsqlite3_transfer_bindings // sqlite3.c:126204:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 800 /* .update_hook */)) = Xsqlite3_update_hook // sqlite3.c:126208:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 808 /* .user_data */)) = Xsqlite3_user_data // sqlite3.c:126209:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 816 /* .value_blob */)) = Xsqlite3_value_blob // sqlite3.c:126210:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 824 /* .value_bytes */)) = Xsqlite3_value_bytes // sqlite3.c:126211:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 832 /* .value_bytes16 */)) = Xsqlite3_value_bytes16 // sqlite3.c:126212:3: + *(*func(*libc.TLS, uintptr) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 840 /* .value_double */)) = Xsqlite3_value_double // sqlite3.c:126213:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 848 /* .value_int */)) = Xsqlite3_value_int // sqlite3.c:126214:3: + *(*func(*libc.TLS, uintptr) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 856 /* .value_int64 */)) = Xsqlite3_value_int64 // sqlite3.c:126215:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 864 /* .value_numeric_type */)) = Xsqlite3_value_numeric_type // sqlite3.c:126216:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 872 /* .value_text */)) = Xsqlite3_value_text // sqlite3.c:126217:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 880 /* .value_text16 */)) = Xsqlite3_value_text16 // sqlite3.c:126218:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 888 /* .value_text16be */)) = Xsqlite3_value_text16be // sqlite3.c:126219:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 896 /* .value_text16le */)) = Xsqlite3_value_text16le // sqlite3.c:126220:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 904 /* .value_type */)) = Xsqlite3_value_type // sqlite3.c:126221:3: + *(*func(*libc.TLS, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 912 /* .vmprintf */)) = Xsqlite3_vmprintf // sqlite3.c:126222:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 920 /* .overload_function */)) = Xsqlite3_overload_function // sqlite3.c:126231:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 928 /* .prepare_v2 */)) = Xsqlite3_prepare_v2 // sqlite3.c:126236:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 936 /* .prepare16_v2 */)) = Xsqlite3_prepare16_v2 // sqlite3.c:126237:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 944 /* .clear_bindings */)) = Xsqlite3_clear_bindings // sqlite3.c:126238:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 952 /* .create_module_v2 */)) = Xsqlite3_create_module_v2 // sqlite3.c:126243:3: + *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 960 /* .bind_zeroblob */)) = Xsqlite3_bind_zeroblob // sqlite3.c:126248:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 968 /* .blob_bytes */)) = Xsqlite3_blob_bytes // sqlite3.c:126249:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 976 /* .blob_close */)) = Xsqlite3_blob_close // sqlite3.c:126250:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, Sqlite_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 984 /* .blob_open */)) = Xsqlite3_blob_open // sqlite3.c:126251:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 992 /* .blob_read */)) = Xsqlite3_blob_read // sqlite3.c:126252:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1000 /* .blob_write */)) = Xsqlite3_blob_write // sqlite3.c:126253:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1008 /* .create_collation_v2 */)) = Xsqlite3_create_collation_v2 // sqlite3.c:126254:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1016 /* .file_control */)) = Xsqlite3_file_control // sqlite3.c:126255:3: + *(*func(*libc.TLS, int32) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1024 /* .memory_highwater */)) = Xsqlite3_memory_highwater // sqlite3.c:126256:3: + *(*func(*libc.TLS) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1032 /* .memory_used */)) = Xsqlite3_memory_used // sqlite3.c:126257:3: + *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1040 /* .mutex_alloc */)) = Xsqlite3_mutex_alloc // sqlite3.c:126265:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1048 /* .mutex_enter */)) = Xsqlite3_mutex_enter // sqlite3.c:126266:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1056 /* .mutex_free */)) = Xsqlite3_mutex_free // sqlite3.c:126267:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1064 /* .mutex_leave */)) = Xsqlite3_mutex_leave // sqlite3.c:126268:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1072 /* .mutex_try */)) = Xsqlite3_mutex_try // sqlite3.c:126269:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1080 /* .open_v2 */)) = Xsqlite3_open_v2 // sqlite3.c:126271:3: + *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1088 /* .release_memory */)) = Xsqlite3_release_memory // sqlite3.c:126272:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1096 /* .result_error_nomem */)) = Xsqlite3_result_error_nomem // sqlite3.c:126273:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1104 /* .result_error_toobig */)) = Xsqlite3_result_error_toobig // sqlite3.c:126274:3: + *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1112 /* .sleep */)) = Xsqlite3_sleep // sqlite3.c:126275:3: + *(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1120 /* .soft_heap_limit */)) = Xsqlite3_soft_heap_limit // sqlite3.c:126276:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1128 /* .vfs_find */)) = Xsqlite3_vfs_find // sqlite3.c:126277:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1136 /* .vfs_register */)) = Xsqlite3_vfs_register // sqlite3.c:126278:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1144 /* .vfs_unregister */)) = Xsqlite3_vfs_unregister // sqlite3.c:126279:3: + *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1152 /* .xthreadsafe */)) = Xsqlite3_threadsafe // sqlite3.c:126284:3: + *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1160 /* .result_zeroblob */)) = Xsqlite3_result_zeroblob // sqlite3.c:126285:3: + *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1168 /* .result_error_code */)) = Xsqlite3_result_error_code // sqlite3.c:126286:3: + *(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1176 /* .test_control */)) = Xsqlite3_test_control // sqlite3.c:126287:3: + *(*func(*libc.TLS, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1184 /* .randomness */)) = Xsqlite3_randomness // sqlite3.c:126288:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1192 /* .context_db_handle */)) = Xsqlite3_context_db_handle // sqlite3.c:126289:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1200 /* .extended_result_codes */)) = Xsqlite3_extended_result_codes // sqlite3.c:126294:3: + *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1208 /* .limit */)) = Xsqlite3_limit // sqlite3.c:126295:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1216 /* .next_stmt */)) = Xsqlite3_next_stmt // sqlite3.c:126296:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1224 /* .sql */)) = Xsqlite3_sql // sqlite3.c:126297:3: + *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1232 /* .status */)) = Xsqlite3_status // sqlite3.c:126298:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1240 /* .backup_finish */)) = Xsqlite3_backup_finish // sqlite3.c:126303:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1248 /* .backup_init */)) = Xsqlite3_backup_init // sqlite3.c:126304:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1256 /* .backup_pagecount */)) = Xsqlite3_backup_pagecount // sqlite3.c:126305:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1264 /* .backup_remaining */)) = Xsqlite3_backup_remaining // sqlite3.c:126306:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1272 /* .backup_step */)) = Xsqlite3_backup_step // sqlite3.c:126307:3: + *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1280 /* .compileoption_get */)) = Xsqlite3_compileoption_get // sqlite3.c:126309:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1288 /* .compileoption_used */)) = Xsqlite3_compileoption_used // sqlite3.c:126310:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1296 /* .create_function_v2 */)) = Xsqlite3_create_function_v2 // sqlite3.c:126315:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1304 /* .db_config */)) = Xsqlite3_db_config // sqlite3.c:126316:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1312 /* .db_mutex */)) = Xsqlite3_db_mutex // sqlite3.c:126317:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1320 /* .db_status */)) = Xsqlite3_db_status // sqlite3.c:126318:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1328 /* .extended_errcode */)) = Xsqlite3_extended_errcode // sqlite3.c:126319:3: + *(*func(*libc.TLS, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1336 /* .log */)) = Xsqlite3_log // sqlite3.c:126320:3: + *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1344 /* .soft_heap_limit64 */)) = Xsqlite3_soft_heap_limit64 // sqlite3.c:126321:3: + *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1352 /* .sourceid */)) = Xsqlite3_sourceid // sqlite3.c:126322:3: + *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1360 /* .stmt_status */)) = Xsqlite3_stmt_status // sqlite3.c:126323:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1368 /* .strnicmp */)) = Xsqlite3_strnicmp // sqlite3.c:126324:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1376 /* .unlock_notify */)) = Xsqlite3_unlock_notify // sqlite3.c:126326:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1384 /* .wal_autocheckpoint */)) = Xsqlite3_wal_autocheckpoint // sqlite3.c:126331:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1392 /* .wal_checkpoint */)) = Xsqlite3_wal_checkpoint // sqlite3.c:126332:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1400 /* .wal_hook */)) = Xsqlite3_wal_hook // sqlite3.c:126333:3: + *(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1408 /* .blob_reopen */)) = Xsqlite3_blob_reopen // sqlite3.c:126339:3: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1416 /* .vtab_config */)) = Xsqlite3_vtab_config // sqlite3.c:126340:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1424 /* .vtab_on_conflict */)) = Xsqlite3_vtab_on_conflict // sqlite3.c:126341:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1432 /* .close_v2 */)) = Xsqlite3_close_v2 // sqlite3.c:126342:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1440 /* .db_filename */)) = Xsqlite3_db_filename // sqlite3.c:126343:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1448 /* .db_readonly */)) = Xsqlite3_db_readonly // sqlite3.c:126344:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1456 /* .db_release_memory */)) = Xsqlite3_db_release_memory // sqlite3.c:126345:3: + *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1464 /* .errstr */)) = Xsqlite3_errstr // sqlite3.c:126346:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1472 /* .stmt_busy */)) = Xsqlite3_stmt_busy // sqlite3.c:126347:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1480 /* .stmt_readonly */)) = Xsqlite3_stmt_readonly // sqlite3.c:126348:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1488 /* .stricmp */)) = Xsqlite3_stricmp // sqlite3.c:126349:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1496 /* .uri_boolean */)) = Xsqlite3_uri_boolean // sqlite3.c:126350:3: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1504 /* .uri_int64 */)) = Xsqlite3_uri_int64 // sqlite3.c:126351:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1512 /* .uri_parameter */)) = Xsqlite3_uri_parameter // sqlite3.c:126352:3: + *(*func(*libc.TLS, int32, uintptr, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1520 /* .xvsnprintf */)) = Xsqlite3_vsnprintf // sqlite3.c:126353:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1528 /* .wal_checkpoint_v2 */)) = Xsqlite3_wal_checkpoint_v2 // sqlite3.c:126354:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1536 /* .auto_extension */)) = Xsqlite3_auto_extension // sqlite3.c:126356:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1544 /* .bind_blob64 */)) = Xsqlite3_bind_blob64 // sqlite3.c:126357:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr, uint8) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1552 /* .bind_text64 */)) = Xsqlite3_bind_text64 // sqlite3.c:126358:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1560 /* .cancel_auto_extension */)) = Xsqlite3_cancel_auto_extension // sqlite3.c:126359:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1568 /* .load_extension */)) = Xsqlite3_load_extension // sqlite3.c:126360:3: + *(*func(*libc.TLS, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1576 /* .malloc64 */)) = Xsqlite3_malloc64 // sqlite3.c:126361:3: + *(*func(*libc.TLS, uintptr) Sqlite3_uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1584 /* .msize */)) = Xsqlite3_msize // sqlite3.c:126362:3: + *(*func(*libc.TLS, uintptr, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1592 /* .realloc64 */)) = Xsqlite3_realloc64 // sqlite3.c:126363:3: + *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1600 /* .reset_auto_extension */)) = Xsqlite3_reset_auto_extension // sqlite3.c:126364:3: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1608 /* .result_blob64 */)) = Xsqlite3_result_blob64 // sqlite3.c:126365:3: + *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr, uint8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1616 /* .result_text64 */)) = Xsqlite3_result_text64 // sqlite3.c:126366:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1624 /* .strglob */)) = Xsqlite3_strglob // sqlite3.c:126367:3: *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1632 /* .value_dup */)) = *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr) uintptr - }{Xsqlite3_value_dup})) // sqlite3.c:124649:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1640 /* .value_free */)) = Xsqlite3_value_free // sqlite3.c:124650:3: - *(*func(*libc.TLS, uintptr, U64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1648 /* .result_zeroblob64 */)) = Xsqlite3_result_zeroblob64 // sqlite3.c:124651:3: - *(*func(*libc.TLS, uintptr, int32, Sqlite3_uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1656 /* .bind_zeroblob64 */)) = Xsqlite3_bind_zeroblob64 // sqlite3.c:124652:3: - *(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1664 /* .value_subtype */)) = Xsqlite3_value_subtype // sqlite3.c:124654:3: - *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1672 /* .result_subtype */)) = Xsqlite3_result_subtype // sqlite3.c:124655:3: - *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1680 /* .status64 */)) = Xsqlite3_status64 // sqlite3.c:124657:3: - *(*func(*libc.TLS, uintptr, uintptr, uint32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1688 /* .strlike */)) = Xsqlite3_strlike // sqlite3.c:124658:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1696 /* .db_cacheflush */)) = Xsqlite3_db_cacheflush // sqlite3.c:124659:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1704 /* .system_errno */)) = Xsqlite3_system_errno // sqlite3.c:124661:3: - *(*func(*libc.TLS, uintptr, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1712 /* .trace_v2 */)) = Xsqlite3_trace_v2 // sqlite3.c:124663:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1720 /* .expanded_sql */)) = Xsqlite3_expanded_sql // sqlite3.c:124664:3: - *(*func(*libc.TLS, uintptr, Sqlite3_int64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1728 /* .set_last_insert_rowid */)) = Xsqlite3_set_last_insert_rowid // sqlite3.c:124666:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1736 /* .prepare_v3 */)) = Xsqlite3_prepare_v3 // sqlite3.c:124668:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1744 /* .prepare16_v3 */)) = Xsqlite3_prepare16_v3 // sqlite3.c:124669:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1752 /* .bind_pointer */)) = Xsqlite3_bind_pointer // sqlite3.c:124670:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1760 /* .result_pointer */)) = Xsqlite3_result_pointer // sqlite3.c:124671:3: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1768 /* .value_pointer */)) = Xsqlite3_value_pointer // sqlite3.c:124672:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1776 /* .vtab_nochange */)) = Xsqlite3_vtab_nochange // sqlite3.c:124674:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1784 /* .value_nochange */)) = Xsqlite3_value_nochange // sqlite3.c:124675:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1792 /* .vtab_collation */)) = Xsqlite3_vtab_collation // sqlite3.c:124676:3: - *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1800 /* .keyword_count */)) = Xsqlite3_keyword_count // sqlite3.c:124678:3: - *(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1808 /* .keyword_name */)) = Xsqlite3_keyword_name // sqlite3.c:124679:3: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1816 /* .keyword_check */)) = Xsqlite3_keyword_check // sqlite3.c:124680:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1824 /* .str_new */)) = Xsqlite3_str_new // sqlite3.c:124681:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1832 /* .str_finish */)) = Xsqlite3_str_finish // sqlite3.c:124682:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1840 /* .str_appendf */)) = Xsqlite3_str_appendf // sqlite3.c:124683:3: - *(*func(*libc.TLS, uintptr, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1848 /* .str_vappendf */)) = Xsqlite3_str_vappendf // sqlite3.c:124684:3: - *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1856 /* .str_append */)) = Xsqlite3_str_append // sqlite3.c:124685:3: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1864 /* .str_appendall */)) = Xsqlite3_str_appendall // sqlite3.c:124686:3: - *(*func(*libc.TLS, uintptr, int32, int8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1872 /* .str_appendchar */)) = Xsqlite3_str_appendchar // sqlite3.c:124687:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1880 /* .str_reset */)) = Xsqlite3_str_reset // sqlite3.c:124688:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1888 /* .str_errcode */)) = Xsqlite3_str_errcode // sqlite3.c:124689:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1896 /* .str_length */)) = Xsqlite3_str_length // sqlite3.c:124690:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1904 /* .str_value */)) = Xsqlite3_str_value // sqlite3.c:124691:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1912 /* .create_window_function */)) = Xsqlite3_create_window_function // sqlite3.c:124693:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1928 /* .stmt_isexplain */)) = Xsqlite3_stmt_isexplain // sqlite3.c:124701:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1936 /* .value_frombind */)) = Xsqlite3_value_frombind // sqlite3.c:124702:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1944 /* .drop_modules */)) = Xsqlite3_drop_modules // sqlite3.c:124705:3: - *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1952 /* .hard_heap_limit64 */)) = Xsqlite3_hard_heap_limit64 // sqlite3.c:124710:3: - *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1960 /* .uri_key */)) = Xsqlite3_uri_key // sqlite3.c:124711:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1968 /* .filename_database */)) = Xsqlite3_filename_database // sqlite3.c:124712:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1976 /* .filename_journal */)) = Xsqlite3_filename_journal // sqlite3.c:124713:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1984 /* .filename_wal */)) = Xsqlite3_filename_wal // sqlite3.c:124714:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1992 /* .create_filename */)) = Xsqlite3_create_filename // sqlite3.c:124716:3: - *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2000 /* .free_filename */)) = Xsqlite3_free_filename // sqlite3.c:124717:3: - *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2008 /* .database_file_object */)) = Xsqlite3_database_file_object // sqlite3.c:124718:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 0)) = Xsqlite3Fts5Init // sqlite3.c:161074:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 8)) = Xsqlite3RtreeInit // sqlite3.c:161080:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 16)) = Xsqlite3DbpageRegister // sqlite3.c:161083:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 24)) = Xsqlite3DbstatRegister // sqlite3.c:161086:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 32)) = sqlite3TestExtInit // sqlite3.c:161088:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 40)) = Xsqlite3Json1Init // sqlite3.c:161090:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 48)) = Xsqlite3StmtVtabInit // sqlite3.c:161093:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 56)) = Xsqlite3VdbeBytecodeVtabInit // sqlite3.c:161096:3: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statGetFuncdef)) + 24 /* .xSFunc */)) = statGet // sqlite3.c:108483:3: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statInitFuncdef)) + 24 /* .xSFunc */)) = statInit // sqlite3.c:108041:3: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statPushFuncdef)) + 24 /* .xSFunc */)) = statPush // sqlite3.c:108331:3: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 16 /* .xConnect */)) = stmtConnect // sqlite3.c:230457:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 24 /* .xBestIndex */)) = stmtBestIndex // sqlite3.c:230458:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 32 /* .xDisconnect */)) = stmtDisconnect // sqlite3.c:230459:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 48 /* .xOpen */)) = stmtOpen // sqlite3.c:230461:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 56 /* .xClose */)) = stmtClose // sqlite3.c:230462:3: - *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 64 /* .xFilter */)) = stmtFilter // sqlite3.c:230463:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 72 /* .xNext */)) = stmtNext // sqlite3.c:230464:3: - *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 80 /* .xEof */)) = stmtEof // sqlite3.c:230465:3: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 88 /* .xColumn */)) = stmtColumn // sqlite3.c:230466:3: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 96 /* .xRowid */)) = stmtRowid // sqlite3.c:230467:3: - *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 40 /* .xOpen */)) = rbuVfsOpen // sqlite3.c:201074:5: - *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 48 /* .xDelete */)) = rbuVfsDelete // sqlite3.c:201075:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 56 /* .xAccess */)) = rbuVfsAccess // sqlite3.c:201076:5: - *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 64 /* .xFullPathname */)) = rbuVfsFullPathname // sqlite3.c:201077:5: - *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 72 /* .xDlOpen */)) = rbuVfsDlOpen // sqlite3.c:201080:5: - *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 80 /* .xDlError */)) = rbuVfsDlError // sqlite3.c:201081:5: - *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 88 /* .xDlSym */)) = rbuVfsDlSym // sqlite3.c:201082:5: - *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 96 /* .xDlClose */)) = rbuVfsDlClose // sqlite3.c:201083:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 104 /* .xRandomness */)) = rbuVfsRandomness // sqlite3.c:201088:5: - *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 112 /* .xSleep */)) = rbuVfsSleep // sqlite3.c:201089:5: - *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 120 /* .xCurrentTime */)) = rbuVfsCurrentTime // sqlite3.c:201090:5: - *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 128 /* .xGetLastError */)) = rbuVfsGetLastError // sqlite3.c:201091:5: + }{Xsqlite3_value_dup})) // sqlite3.c:126369:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1640 /* .value_free */)) = Xsqlite3_value_free // sqlite3.c:126370:3: + *(*func(*libc.TLS, uintptr, U64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1648 /* .result_zeroblob64 */)) = Xsqlite3_result_zeroblob64 // sqlite3.c:126371:3: + *(*func(*libc.TLS, uintptr, int32, Sqlite3_uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1656 /* .bind_zeroblob64 */)) = Xsqlite3_bind_zeroblob64 // sqlite3.c:126372:3: + *(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1664 /* .value_subtype */)) = Xsqlite3_value_subtype // sqlite3.c:126374:3: + *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1672 /* .result_subtype */)) = Xsqlite3_result_subtype // sqlite3.c:126375:3: + *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1680 /* .status64 */)) = Xsqlite3_status64 // sqlite3.c:126377:3: + *(*func(*libc.TLS, uintptr, uintptr, uint32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1688 /* .strlike */)) = Xsqlite3_strlike // sqlite3.c:126378:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1696 /* .db_cacheflush */)) = Xsqlite3_db_cacheflush // sqlite3.c:126379:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1704 /* .system_errno */)) = Xsqlite3_system_errno // sqlite3.c:126381:3: + *(*func(*libc.TLS, uintptr, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1712 /* .trace_v2 */)) = Xsqlite3_trace_v2 // sqlite3.c:126383:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1720 /* .expanded_sql */)) = Xsqlite3_expanded_sql // sqlite3.c:126384:3: + *(*func(*libc.TLS, uintptr, Sqlite3_int64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1728 /* .set_last_insert_rowid */)) = Xsqlite3_set_last_insert_rowid // sqlite3.c:126386:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1736 /* .prepare_v3 */)) = Xsqlite3_prepare_v3 // sqlite3.c:126388:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1744 /* .prepare16_v3 */)) = Xsqlite3_prepare16_v3 // sqlite3.c:126389:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1752 /* .bind_pointer */)) = Xsqlite3_bind_pointer // sqlite3.c:126390:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1760 /* .result_pointer */)) = Xsqlite3_result_pointer // sqlite3.c:126391:3: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1768 /* .value_pointer */)) = Xsqlite3_value_pointer // sqlite3.c:126392:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1776 /* .vtab_nochange */)) = Xsqlite3_vtab_nochange // sqlite3.c:126394:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1784 /* .value_nochange */)) = Xsqlite3_value_nochange // sqlite3.c:126395:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1792 /* .vtab_collation */)) = Xsqlite3_vtab_collation // sqlite3.c:126396:3: + *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1800 /* .keyword_count */)) = Xsqlite3_keyword_count // sqlite3.c:126398:3: + *(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1808 /* .keyword_name */)) = Xsqlite3_keyword_name // sqlite3.c:126399:3: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1816 /* .keyword_check */)) = Xsqlite3_keyword_check // sqlite3.c:126400:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1824 /* .str_new */)) = Xsqlite3_str_new // sqlite3.c:126401:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1832 /* .str_finish */)) = Xsqlite3_str_finish // sqlite3.c:126402:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1840 /* .str_appendf */)) = Xsqlite3_str_appendf // sqlite3.c:126403:3: + *(*func(*libc.TLS, uintptr, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1848 /* .str_vappendf */)) = Xsqlite3_str_vappendf // sqlite3.c:126404:3: + *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1856 /* .str_append */)) = Xsqlite3_str_append // sqlite3.c:126405:3: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1864 /* .str_appendall */)) = Xsqlite3_str_appendall // sqlite3.c:126406:3: + *(*func(*libc.TLS, uintptr, int32, int8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1872 /* .str_appendchar */)) = Xsqlite3_str_appendchar // sqlite3.c:126407:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1880 /* .str_reset */)) = Xsqlite3_str_reset // sqlite3.c:126408:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1888 /* .str_errcode */)) = Xsqlite3_str_errcode // sqlite3.c:126409:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1896 /* .str_length */)) = Xsqlite3_str_length // sqlite3.c:126410:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1904 /* .str_value */)) = Xsqlite3_str_value // sqlite3.c:126411:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1912 /* .create_window_function */)) = Xsqlite3_create_window_function // sqlite3.c:126413:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1928 /* .stmt_isexplain */)) = Xsqlite3_stmt_isexplain // sqlite3.c:126421:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1936 /* .value_frombind */)) = Xsqlite3_value_frombind // sqlite3.c:126422:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1944 /* .drop_modules */)) = Xsqlite3_drop_modules // sqlite3.c:126425:3: + *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1952 /* .hard_heap_limit64 */)) = Xsqlite3_hard_heap_limit64 // sqlite3.c:126430:3: + *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1960 /* .uri_key */)) = Xsqlite3_uri_key // sqlite3.c:126431:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1968 /* .filename_database */)) = Xsqlite3_filename_database // sqlite3.c:126432:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1976 /* .filename_journal */)) = Xsqlite3_filename_journal // sqlite3.c:126433:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1984 /* .filename_wal */)) = Xsqlite3_filename_wal // sqlite3.c:126434:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1992 /* .create_filename */)) = Xsqlite3_create_filename // sqlite3.c:126436:3: + *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2000 /* .free_filename */)) = Xsqlite3_free_filename // sqlite3.c:126437:3: + *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2008 /* .database_file_object */)) = Xsqlite3_database_file_object // sqlite3.c:126438:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2016 /* .txn_state */)) = Xsqlite3_txn_state // sqlite3.c:126440:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 0)) = Xsqlite3Fts5Init // sqlite3.c:164014:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 8)) = Xsqlite3RtreeInit // sqlite3.c:164020:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 16)) = Xsqlite3DbpageRegister // sqlite3.c:164023:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 24)) = Xsqlite3DbstatRegister // sqlite3.c:164026:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 32)) = sqlite3TestExtInit // sqlite3.c:164028:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 40)) = Xsqlite3Json1Init // sqlite3.c:164030:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 48)) = Xsqlite3StmtVtabInit // sqlite3.c:164033:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 56)) = Xsqlite3VdbeBytecodeVtabInit // sqlite3.c:164036:3: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statGetFuncdef)) + 24 /* .xSFunc */)) = statGet // sqlite3.c:109638:3: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statInitFuncdef)) + 24 /* .xSFunc */)) = statInit // sqlite3.c:109196:3: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statPushFuncdef)) + 24 /* .xSFunc */)) = statPush // sqlite3.c:109486:3: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 16 /* .xConnect */)) = stmtConnect // sqlite3.c:234067:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 24 /* .xBestIndex */)) = stmtBestIndex // sqlite3.c:234068:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 32 /* .xDisconnect */)) = stmtDisconnect // sqlite3.c:234069:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 48 /* .xOpen */)) = stmtOpen // sqlite3.c:234071:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 56 /* .xClose */)) = stmtClose // sqlite3.c:234072:3: + *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 64 /* .xFilter */)) = stmtFilter // sqlite3.c:234073:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 72 /* .xNext */)) = stmtNext // sqlite3.c:234074:3: + *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 80 /* .xEof */)) = stmtEof // sqlite3.c:234075:3: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 88 /* .xColumn */)) = stmtColumn // sqlite3.c:234076:3: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 96 /* .xRowid */)) = stmtRowid // sqlite3.c:234077:3: + *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 40 /* .xOpen */)) = rbuVfsOpen // sqlite3.c:204099:5: + *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 48 /* .xDelete */)) = rbuVfsDelete // sqlite3.c:204100:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 56 /* .xAccess */)) = rbuVfsAccess // sqlite3.c:204101:5: + *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 64 /* .xFullPathname */)) = rbuVfsFullPathname // sqlite3.c:204102:5: + *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 72 /* .xDlOpen */)) = rbuVfsDlOpen // sqlite3.c:204105:5: + *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 80 /* .xDlError */)) = rbuVfsDlError // sqlite3.c:204106:5: + *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 88 /* .xDlSym */)) = rbuVfsDlSym // sqlite3.c:204107:5: + *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 96 /* .xDlClose */)) = rbuVfsDlClose // sqlite3.c:204108:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 104 /* .xRandomness */)) = rbuVfsRandomness // sqlite3.c:204113:5: + *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 112 /* .xSleep */)) = rbuVfsSleep // sqlite3.c:204114:5: + *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 120 /* .xCurrentTime */)) = rbuVfsCurrentTime // sqlite3.c:204115:5: + *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 128 /* .xGetLastError */)) = rbuVfsGetLastError // sqlite3.c:204116:5: } -var ts1 = "COMPILER=gcc-8.3.0\x00DEFAULT_PAGE_SIZE=1024\x00ENABLE_BYTECODE_VTAB\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_JSON1\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_STMTVTAB\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MUTEX_NOOP\x00SOUNDEX\x00TEMP_STORE=1\x00TEST\x00THREADSAFE=1\x003.33.0\x00BINARY\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00local time unavailable\x00second\x00minute\x00hour\x00day\x00month\x00year\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00%04d-%02d-%02d %02d:%02d:%02d\x00%02d:%02d:%02d\x00%04d-%02d-%02d\x00%02d\x00%06.3f\x00%03d\x00%.16g\x00%04d\x00julianday\x00date\x00time\x00datetime\x00strftime\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x000123456789ABCDEF0123456789abcdef\x00-x0\x00X0\x00%\x00NaN\x00Inf\x00\x00NULL\x00(NULL)\x00.\x00thstndrd\x00%s\x00922337203685477580\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00\x00AutoCommit\x00\x00Transaction\x00\x00SorterNext\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\x00Once\x00\x00If\x00\x00Not\x00r[P2]= !r[P1]\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]\x00IfNotOpen\x00if( !csr[P1] ) goto P2\x00IfNoHope\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)\x00Or\x00r[P3]=(r[P1] || r[P2])\x00And\x00r[P3]=(r[P1] && r[P2])\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\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\x00DecrJumpZero\x00if (--r[P1])==0 goto P2\x00IncrVacuum\x00\x00VNext\x00\x00Init\x00Start at P2\x00PureFunc\x00r[P3]=func(r[P2@NP])\x00Function\x00r[P3]=func(r[P2@NP])\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\x00AddImm\x00r[P1]=r[P1]+P2\x00RealAffinity\x00\x00Cast\x00affinity(r[P1])\x00Permutation\x00\x00Compare\x00r[P1@P3] <-> r[P2@P3]\x00IsTrue\x00r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4\x00Offset\x00r[P3] = sqlite_offset(P1)\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\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]\x00SorterOpen\x00\x00BitNot\x00r[P2]= ~r[P1]\x00SequenceTest\x00if( cursor[P1].ctr++ ) pc = P2\x00OpenPseudo\x00P3 columns in r[P2]\x00String8\x00r[P2]='P4'\x00Close\x00\x00ColumnsUsed\x00\x00SeekHit\x00seekHit=P2\x00Sequence\x00r[P2]=cursor[P1].ctr++\x00NewRowid\x00r[P2]=rowid\x00Insert\x00intkey=r[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\x00SeekEnd\x00\x00IdxInsert\x00key=r[P2]\x00SorterInsert\x00key=r[P2]\x00IdxDelete\x00key=r[P2@P3]\x00DeferredSeek\x00Move P3 to P1.rowid if needed\x00IdxRowid\x00r[P2]=rowid\x00FinishSeek\x00\x00Destroy\x00\x00Clear\x00\x00ResetSorter\x00\x00CreateBtree\x00r[P2]=root iDb=P1 flags=P3\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\x00Real\x00r[P2]=P4\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)\x00AggInverse\x00accum=r[P3] inverse(r[P2@P5])\x00AggStep\x00accum=r[P3] step(r[P2@P5])\x00AggStep1\x00accum=r[P3] step(r[P2@P5])\x00AggValue\x00r[P3]=value N=P2\x00AggFinal\x00accum=r[P1] N=P2\x00Expire\x00\x00CursorLock\x00\x00CursorUnlock\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\x00Trace\x00\x00CursorHint\x00\x00ReleaseReg\x00release r[P1@P2] mask P3\x00Noop\x00\x00Explain\x00\x00Abortable\x00\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00NONE\x00SHARED\x00RESERVED\x00PENDING\x00EXCLUSIVE\x00ERROR\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00TEST WR-LOCK %d %d %d (unix)\n\x00LOCK %d %s was %s(%s,%d) pid=%d (unix)\n\x00LOCK %d %s ok (already held) (unix)\n\x00LOCK %d %s %s (unix)\n\x00ok\x00failed\x00UNLOCK %d %d was %d(%d,%d) pid=%d (unix)\n\x00CLOSE %-3d\n\x00TEST WR-LOCK %d %d %d (dotlock)\n\x00UNLOCK %d %d was %d pid=%d (dotlock)\n\x00READ %-3d %5d %7lld %llu\n\x00WRITE %-3d %5d %7lld %llu\n\x00OPENDIR %-3d %s\n\x00SYNC %-3d\n\x00full_fsync\x00DIRSYNC %s (have_fullfsync=%d fullsync=%d)\n\x00%s-shm\x00readonly_shm\x00SHM-LOCK shmid-%d, pid-%d got %03x,%03x\n\x00OPEN %-3d %s\n\x00psow\x00unix-excl\x00%s.lock\x00SQLITE_TMPDIR\x00TMPDIR\x00/var/tmp\x00/usr/tmp\x00/tmp\x00%s/etilqs_%llx%c\x00modeof\x00OPENX %-3d %s 0%o\n\x00fsync\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00SQLite format 3\x00:memory:\x00@ \x00\n\x00invalid page number %d\x002nd reference to page %d\x00Failed to read ptrmap key=%d\x00Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)\x00failed to get page %d\x00freelist leaf count too big on page %d\x00%s is %d but should be %d\x00size\x00overflow list length\x00Page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00On tree page %u cell %d: \x00On page %u at right child: \x00Offset %d out of range %d..%d\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %d bytes reported as %d on page %u\x00Main freelist: \x00max rootpage (%d) disagrees with header (%d)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %d is never used\x00Pointer map page %d is referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00IF \x00r[P2] = (%s)\x00if %s goto P2\x00@P\x00+1\x00%d\x00%d..%d\x00@NP\x00..P3\x00; %s\x00k(%d\x00B\x00,%s%s%s\x00N.\x00)\x00%.18s-%s\x00%s(%d)\x00%lld\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00?\x008\x0016LE\x0016BE\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00cannot change %s wal mode from within a transaction\x00into\x00out of\x00database table is locked: %s\x00-- %s\x00statement aborts at %d: [%s] %s\x00out of memory\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00cannot open value of type %s\x00null\x00real\x00integer\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00CREATE TABLE x(addr INT,opcode TEXT,p1 INT,p2 INT,p3 INT,p4 TEXT,p5 INT,comment TEXT,subprog TEXT,stmt HIDDEN);\x00CREATE TABLE x(type TEXT,schema TEXT,name TEXT,wr INT,subprog TEXT,stmt HIDDEN);\x00table\x00index\x00(FK)\x00stmt-pointer\x00argument to %s() is not a valid SQL statement\x00tables_used\x00bytecode\x00main\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to likelihood() must be a constant between 0.0 and 1.0\x00not authorized to use function: %s\x00non-deterministic functions\x00%.*s() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %.*s()\x00no such function: %.*s\x00wrong number of arguments to function %.*s()\x00FILTER may not be used with non-aggregate %.*s()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00a GROUP BY clause is required before HAVING\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x000\x00too many arguments on function %T\x00unsafe use of %s()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00first_entry_in(%d)\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00return address\x00Result of SELECT %u\x00RHS of IN operator\x00%sLIST SUBQUERY %d\x00CORRELATED \x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x00Init subquery result\x00Init EXISTS result\x001\x00begin IN expr\x00end IN expr\x000x\x00hex literal too big: %s%s\x00generated column loop on \"%s\"\x00%s.rowid\x00%s.%s\x00misuse of aggregate: %s()\x00unknown function: %s()\x00r[%d]=%s.%s\x00rowid\x00RAISE() may only be used within a trigger-program\x00B\x00C\x00D\x00E\x00sqlite_\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1)=NULL \x00there is already another table or index with this name: %s\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d) WHERE type = 'table' AND name = %Q\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00cannot rename columns of %s \"%s\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q) AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00error in %s %s%s: %s\x00 after rename\x00\"%w\"\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00%s.expr(%d)\x00sqlite\\_%\x00Analysis for %s.%s\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s %T cannot reference objects in database %s\x00%s cannot use variables\x00authorizer malfunction\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00usesStmtJournal=%d\x00sqlite_temp_schema\x00sqlite_schema\x00sqlite_temp_master\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00table %T already exists\x00there is already an index named %s\x00too many columns on %s\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00INTEGER\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00unsupported use of NULLS %s\x00FIRST\x00LAST\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00CREATE%s INDEX %.*s\x00 UNIQUE\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00a JOIN clause is required before %s\x00ON\x00USING\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00text\x00blob\x00integer overflow\x00%.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!.20e\x00 \x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\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\x00coalesce\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00UPSERT constraint goes first\x00trigger count\x00defer IPK REPLACE until last\x00uniqueness check for ROWID\x00Skip upsert subroutine\x00prep index %s\x00%s column %d\x00for %s\x00bypass recheck\x00Do IPK REPLACE\x00sqlite3_extension_init\x00unable to open shared library [%s]\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00so\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00fkid\x00file\x00busy\x00log\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\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\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00lock_status\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00onoffalseyestruextrafull\x00exclusive\x00normal\x00none\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00w\x00a\x00s\x00sissii\x00utf8\x00utf16le\x00utf16be\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00issisii\x00issisi\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00siX\x00*** in database %s ***\n\x00NULL value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00non-unique entry in index \x00wrong # of entries in index \x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00unknown\x00closed\x00ss\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unlocked\x00shared\x00reserved\x00pending\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00malformed database schema (%s)\x00%z - %s\x00create \x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown or unsupported join type: %T %T%s%T\x00RIGHT and FULL OUTER JOINs are not currently supported\x00naturaleftouterightfullinnercross\x00a NATURAL join may not have an ON or USING clause\x00cannot have both ON and USING clauses in the same join\x00cannot join using column %s - column not present in both tables\x00OFFSET\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00column%d\x00%.*z:%u\x00LIMIT counter\x00OFFSET counter\x00LIMIT+OFFSET\x00cannot use window functions in recursive queries\x00Queue table\x00SETUP\x00recursive aggregate queries not supported\x00RECURSIVE STEP\x00SCAN %d CONSTANT ROW%s\x00S\x00%s clause should come after %s not before\x00ORDER BY\x00LIMIT\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00Jump ahead if LIMIT reached\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00left SELECT\x00LEFT\x00right SELECT\x00RIGHT\x00Output routine for A\x00Output routine for B\x00eof-A subroutine\x00eof-B subroutine\x00A-lt-B subroutine\x00A-eq-B subroutine\x00A-gt-B subroutine\x00no such index: %s\x00'%s' is not a function\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00subquery_%u\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00unsafe use of virtual table \"%s\"\x00*\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00SCAN TABLE %s%s%s\x00 USING COVERING INDEX \x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %u\x00materialize \"%s\"\x00MATERIALIZE %u\x00end %s\x00inner-loop subroutine\x00end inner-loop subroutine\x00clear abort flag\x00DISTINCT\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\x00indicate accumulator empty\x00RIGHT PART OF ORDER BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00trigger %T already exists\x00cannot create trigger on system table\x00cannot create %s trigger on view: %S\x00BEFORE\x00AFTER\x00cannot create INSTEAD OF trigger on table: %S\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00abort\x00rollback\x00fail\x00ignore\x00default\x00n/a\x00Start: %s.%s (%s %s%s%s ON %s)\x00UPDATE\x00INSERT\x00DELETE\x00-- TRIGGER %s\x00End: %s.%s\x00Call: %s.%s\x00fkey\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00Begin DO UPDATE of UPSERT\x00End DO UPDATE of UPSERT\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00ATTACH %Q AS vacuum_db\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO vacuum_db.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM vacuum_db.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO vacuum_db.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00 SUBQUERY %u\x00 TABLE %s\x00 AS %s\x00PRIMARY KEY\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00=\x00>? AND rowid<\x00 USING INTEGER PRIMARY KEY (rowid%s?)\x00 VIRTUAL TABLE INDEX %d:%s\x00begin skip-scan on %s\x00init LEFT JOIN no-match flag\x00next row of %s\x00NULL-scan pass ctr\x00If NULL-scan 2nd pass\x00If NULL-scan 1st pass\x00MULTI-INDEX OR\x00INDEX %d\x00record LEFT JOIN hit\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00next skip-scan on %s\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00row_number\x00dense_rank\x00rank\x00percent_rank\x00cume_dist\x00ntile\x00last_value\x00nth_value\x00first_value\x00lead\x00lag\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00call flush_partition\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00parser stack overflow\x00unknown table option: %.*s\x00set list\x00near \"%T\": syntax error\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\x00incomplete input\x00unrecognized token: \"%.*s\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00SQLITE_OK\x00SQLITE_ERROR\x00SQLITE_ERROR_SNAPSHOT\x00SQLITE_INTERNAL\x00SQLITE_PERM\x00SQLITE_ABORT\x00SQLITE_ABORT_ROLLBACK\x00SQLITE_BUSY\x00SQLITE_BUSY_RECOVERY\x00SQLITE_BUSY_SNAPSHOT\x00SQLITE_LOCKED\x00SQLITE_LOCKED_SHAREDCACHE\x00SQLITE_NOMEM\x00SQLITE_READONLY\x00SQLITE_READONLY_RECOVERY\x00SQLITE_READONLY_CANTINIT\x00SQLITE_READONLY_ROLLBACK\x00SQLITE_READONLY_DBMOVED\x00SQLITE_READONLY_DIRECTORY\x00SQLITE_INTERRUPT\x00SQLITE_IOERR\x00SQLITE_IOERR_READ\x00SQLITE_IOERR_SHORT_READ\x00SQLITE_IOERR_WRITE\x00SQLITE_IOERR_FSYNC\x00SQLITE_IOERR_DIR_FSYNC\x00SQLITE_IOERR_TRUNCATE\x00SQLITE_IOERR_FSTAT\x00SQLITE_IOERR_UNLOCK\x00SQLITE_IOERR_RDLOCK\x00SQLITE_IOERR_DELETE\x00SQLITE_IOERR_NOMEM\x00SQLITE_IOERR_ACCESS\x00SQLITE_IOERR_CHECKRESERVEDLOCK\x00SQLITE_IOERR_LOCK\x00SQLITE_IOERR_CLOSE\x00SQLITE_IOERR_DIR_CLOSE\x00SQLITE_IOERR_SHMOPEN\x00SQLITE_IOERR_SHMSIZE\x00SQLITE_IOERR_SHMLOCK\x00SQLITE_IOERR_SHMMAP\x00SQLITE_IOERR_SEEK\x00SQLITE_IOERR_DELETE_NOENT\x00SQLITE_IOERR_MMAP\x00SQLITE_IOERR_GETTEMPPATH\x00SQLITE_IOERR_CONVPATH\x00SQLITE_CORRUPT\x00SQLITE_CORRUPT_VTAB\x00SQLITE_NOTFOUND\x00SQLITE_FULL\x00SQLITE_CANTOPEN\x00SQLITE_CANTOPEN_NOTEMPDIR\x00SQLITE_CANTOPEN_ISDIR\x00SQLITE_CANTOPEN_FULLPATH\x00SQLITE_CANTOPEN_CONVPATH\x00SQLITE_CANTOPEN_SYMLINK\x00SQLITE_PROTOCOL\x00SQLITE_EMPTY\x00SQLITE_SCHEMA\x00SQLITE_TOOBIG\x00SQLITE_CONSTRAINT\x00SQLITE_CONSTRAINT_UNIQUE\x00SQLITE_CONSTRAINT_TRIGGER\x00SQLITE_CONSTRAINT_FOREIGNKEY\x00SQLITE_CONSTRAINT_CHECK\x00SQLITE_CONSTRAINT_PRIMARYKEY\x00SQLITE_CONSTRAINT_NOTNULL\x00SQLITE_CONSTRAINT_COMMITHOOK\x00SQLITE_CONSTRAINT_VTAB\x00SQLITE_CONSTRAINT_FUNCTION\x00SQLITE_CONSTRAINT_ROWID\x00SQLITE_MISMATCH\x00SQLITE_MISUSE\x00SQLITE_NOLFS\x00SQLITE_AUTH\x00SQLITE_FORMAT\x00SQLITE_RANGE\x00SQLITE_NOTADB\x00SQLITE_ROW\x00SQLITE_NOTICE\x00SQLITE_NOTICE_RECOVER_WAL\x00SQLITE_NOTICE_RECOVER_ROLLBACK\x00SQLITE_WARNING\x00SQLITE_WARNING_AUTOINDEX\x00SQLITE_DONE\x00SQLITE_UNKNOWN(%d)\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\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\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00mode\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00private\x00ro\x00rw\x00rwc\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00[0]\x00JSON path error near '%q'\x00json_%s() needs an odd number of arguments\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%d]\x00.%.*s\x00$\x00json\x00json_array\x00json_array_length\x00json_extract\x00json_insert\x00json_object\x00json_patch\x00json_quote\x00json_remove\x00json_replace\x00json_set\x00json_type\x00json_valid\x00json_group_array\x00json_group_object\x00json_each\x00json_tree\x00%s_node\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00);\x00,%.*s REAL\x00,%.*s INT\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00Mapping (%lld -> %lld) missing from %s table\x00%_rowid\x00%_parent\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00END\x00wrong number of arguments to function rtreecheck()\x00[\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql LIKE 'create virtual%%'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00table %q %s rbu_rowid column\x00may not have\x00requires\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00 NOT NULL\x00%z, %z\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00 WITHOUT ROWID\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00AND\x00WHERE\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00, _rowid_\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00, 0 AS rbu_rowid\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x000 AS \x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file://%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00file:%s-vactmp?rbu_memory=1%s%s\x00&\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00database modified during rbu %s\x00vacuum\x00update\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00CREATE TABLE x( name TEXT, path TEXT, pageno INTEGER, pagetype TEXT, ncell INTEGER, payload INTEGER, unused INTEGER, mx_payload INTEGER, pgoffset INTEGER, pgsize INTEGER, schema TEXT HIDDEN, aggregate BOOLEAN HIDDEN)\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00CREATE TABLE x(pgno INTEGER PRIMARY KEY, data BLOB, schema HIDDEN)\x00read-only\x00cannot delete\x00cannot insert\x00no such schema\x00bad page number\x00bad page value\x00sqlite_dbpage\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00snippet\x00highlight\x00bm25\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00columns\x00malformed detail=... directive\x00unrecognized option: \"%.*s\"\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00fts5: %s queries are not supported (detail!=full)\x00phrase\x00%s \x00-col %d \x00-col {%d\x00 %d\x00} \x00-near %d \x00--\x00 {\x00 [%z]\x00\"\"\x00%s : \x00NEAR(\x00 + \x00, %d)\x00 NOT \x00 OR \x00%s%s%z%s\x00nearset\x00wrong number of arguments to function %s\x00fts5_expr_tcl\x00fts5_expr\x00wrong number of arguments to function fts5_isalnum\x00L*\x00N*\x00Co\x00wrong number of arguments to function fts5_fold\x00fts5_isalnum\x00fts5_fold\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00{averages} \x00{structure}\x00{%ssegid=%d h=%d pgno=%d}\x00dlidx \x00 {lvl=%d nMerge=%d nSeg=%d\x00 {id=%d leaves=%d..%d}\x00%s%d\x00 id=%lld\x00 nPos=%d%s\x00+\x00 %lld%s\x00 %d(%lld)\x00 term=%.*s\x00corrupt\x00should be: fts5_rowid(subject, ....)\x00segment\x00should be: fts5_rowid('segment', segid, pgno))\x00first arg to fts5_rowid() must be 'segment'\x00fts5_decode\x00fts5_decode_none\x00fts5_rowid\x00recursively defined fts5 content table\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00DESC\x00ASC\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%s: table does not support scanning\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00cannot %s contentless fts5 table: %s\x00DELETE from\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f\x00config\x00fts5\x00fts5_source_id\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x00CREATE TABLE x(sql,ncol,ro,busy,nscan,nsort,naidx,nstep,reprep,run,mem)\x00sqlite_stmt\x002020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f\x00" +var ts1 = "COMPILER=gcc-7.5.0\x00DEFAULT_PAGE_SIZE=1024\x00ENABLE_BYTECODE_VTAB\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_JSON1\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_STMTVTAB\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MUTEX_NOOP\x00SOUNDEX\x00TEMP_STORE=1\x00TEST\x00THREADSAFE=1\x003.35.0\x00BINARY\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00local time unavailable\x00second\x00minute\x00hour\x00day\x00month\x00year\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00%04d-%02d-%02d %02d:%02d:%02d\x00%02d:%02d:%02d\x00%04d-%02d-%02d\x00%02d\x00%06.3f\x00%03d\x00%.16g\x00%04d\x00julianday\x00date\x00time\x00datetime\x00strftime\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x000123456789ABCDEF0123456789abcdef\x00-x0\x00X0\x00%\x00NaN\x00Inf\x00\x00NULL\x00(NULL)\x00.\x00thstndrd\x00%s\x00922337203685477580\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00\x00AutoCommit\x00\x00Transaction\x00\x00SorterNext\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\x00Once\x00\x00If\x00\x00Not\x00r[P2]= !r[P1]\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]\x00IfNotOpen\x00if( !csr[P1] ) goto P2\x00IfNoHope\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)\x00Or\x00r[P3]=(r[P1] || r[P2])\x00And\x00r[P3]=(r[P1] && r[P2])\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\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\x00DecrJumpZero\x00if (--r[P1])==0 goto P2\x00IncrVacuum\x00\x00VNext\x00\x00Init\x00Start at P2\x00PureFunc\x00r[P3]=func(r[P2@NP])\x00Function\x00r[P3]=func(r[P2@NP])\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]\x00ChngCntRow\x00output=r[P1]\x00ResultRow\x00output=r[P1@P2]\x00CollSeq\x00\x00AddImm\x00r[P1]=r[P1]+P2\x00RealAffinity\x00\x00Cast\x00affinity(r[P1])\x00Permutation\x00\x00Compare\x00r[P1@P3] <-> r[P2@P3]\x00IsTrue\x00r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4\x00Offset\x00r[P3] = sqlite_offset(P1)\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\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]\x00SorterOpen\x00\x00BitNot\x00r[P2]= ~r[P1]\x00SequenceTest\x00if( cursor[P1].ctr++ ) pc = P2\x00OpenPseudo\x00P3 columns in r[P2]\x00String8\x00r[P2]='P4'\x00Close\x00\x00ColumnsUsed\x00\x00SeekScan\x00Scan-ahead up to P1 rows\x00SeekHit\x00set P2<=seekHit<=P3\x00Sequence\x00r[P2]=cursor[P1].ctr++\x00NewRowid\x00r[P2]=rowid\x00Insert\x00intkey=r[P3] data=r[P2]\x00RowCell\x00\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\x00SeekEnd\x00\x00IdxInsert\x00key=r[P2]\x00SorterInsert\x00key=r[P2]\x00IdxDelete\x00key=r[P2@P3]\x00DeferredSeek\x00Move P3 to P1.rowid if needed\x00IdxRowid\x00r[P2]=rowid\x00FinishSeek\x00\x00Destroy\x00\x00Clear\x00\x00ResetSorter\x00\x00CreateBtree\x00r[P2]=root iDb=P1 flags=P3\x00SqlExec\x00\x00ParseSchema\x00\x00LoadAnalysis\x00\x00DropTable\x00\x00DropIndex\x00\x00DropTrigger\x00\x00IntegrityCk\x00\x00RowSetAdd\x00rowset(P1)=r[P2]\x00Param\x00\x00Real\x00r[P2]=P4\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)\x00AggInverse\x00accum=r[P3] inverse(r[P2@P5])\x00AggStep\x00accum=r[P3] step(r[P2@P5])\x00AggStep1\x00accum=r[P3] step(r[P2@P5])\x00AggValue\x00r[P3]=value N=P2\x00AggFinal\x00accum=r[P1] N=P2\x00Expire\x00\x00CursorLock\x00\x00CursorUnlock\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\x00Trace\x00\x00CursorHint\x00\x00ReleaseReg\x00release r[P1@P2] mask P3\x00Noop\x00\x00Explain\x00\x00Abortable\x00\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00NONE\x00SHARED\x00RESERVED\x00PENDING\x00EXCLUSIVE\x00ERROR\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00TEST WR-LOCK %d %d %d (unix)\n\x00LOCK %d %s was %s(%s,%d) pid=%d (unix)\n\x00LOCK %d %s ok (already held) (unix)\n\x00LOCK %d %s %s (unix)\n\x00ok\x00failed\x00UNLOCK %d %d was %d(%d,%d) pid=%d (unix)\n\x00CLOSE %-3d\n\x00TEST WR-LOCK %d %d %d (dotlock)\n\x00UNLOCK %d %d was %d pid=%d (dotlock)\n\x00READ %-3d %5d %7lld %llu\n\x00WRITE %-3d %5d %7lld %llu\n\x00OPENDIR %-3d %s\n\x00SYNC %-3d\n\x00full_fsync\x00DIRSYNC %s (have_fullfsync=%d fullsync=%d)\n\x00%s-shm\x00readonly_shm\x00SHM-LOCK shmid-%d, pid-%d got %03x,%03x\n\x00OPEN %-3d %s\n\x00psow\x00unix-excl\x00%s.lock\x00SQLITE_TMPDIR\x00TMPDIR\x00/var/tmp\x00/usr/tmp\x00/tmp\x00%s/etilqs_%llx%c\x00modeof\x00OPENX %-3d %s 0%o\n\x00fsync\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00SQLite format 3\x00:memory:\x00@ \x00\n\x00invalid page number %d\x002nd reference to page %d\x00Failed to read ptrmap key=%d\x00Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)\x00failed to get page %d\x00freelist leaf count too big on page %d\x00%s is %d but should be %d\x00size\x00overflow list length\x00Page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00On tree page %u cell %d: \x00On page %u at right child: \x00Offset %d out of range %d..%d\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %d bytes reported as %d on page %u\x00Main freelist: \x00max rootpage (%d) disagrees with header (%d)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %d is never used\x00Pointer map page %d is referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00IF \x00r[P2] = (%s)\x00if %s goto P2\x00@P\x00+1\x00%d\x00%d..%d\x00@NP\x00..P3\x00; %s\x00k(%d\x00B\x00,%s%s%s\x00N.\x00)\x00%.18s-%s\x00%s(%d)\x00%lld\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00?\x008\x0016LE\x0016BE\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00cannot change %s wal mode from within a transaction\x00into\x00out of\x00database table is locked: %s\x00-- %s\x00statement aborts at %d: [%s] %s\x00out of memory\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00cannot open value of type %s\x00null\x00real\x00integer\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00CREATE TABLE x(addr INT,opcode TEXT,p1 INT,p2 INT,p3 INT,p4 TEXT,p5 INT,comment TEXT,subprog TEXT,stmt HIDDEN);\x00CREATE TABLE x(type TEXT,schema TEXT,name TEXT,wr INT,subprog TEXT,stmt HIDDEN);\x00table\x00index\x00(FK)\x00stmt-pointer\x00argument to %s() is not a valid SQL statement\x00tables_used\x00bytecode\x00main\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00true\x00false\x00the \".\" operator\x00second argument to likelihood() must be a constant between 0.0 and 1.0\x00not authorized to use function: %s\x00non-deterministic functions\x00%.*s() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %.*s()\x00no such function: %.*s\x00wrong number of arguments to function %.*s()\x00FILTER may not be used with non-aggregate %.*s()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00a GROUP BY clause is required before HAVING\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x000\x00too many arguments on function %T\x00unsafe use of %s()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00_ROWID_\x00ROWID\x00OID\x00first_entry_in(%d)\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00return address\x00Result of SELECT %u\x00RHS of IN operator\x00%sLIST SUBQUERY %d\x00CORRELATED \x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x00Init subquery result\x00Init EXISTS result\x001\x00begin IN expr\x00end IN expr\x000x\x00hex literal too big: %s%s\x00generated column loop on \"%s\"\x00%s.rowid\x00%s.%s\x00misuse of aggregate: %s()\x00unknown function: %s()\x00r[%d]=%s.%s\x00rowid\x00RAISE() may only be used within a trigger-program\x00B\x00C\x00D\x00E\x00sqlite_\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q)=NULL \x00there is already another table or index with this name: %s\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename') THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00cannot %s %s \"%s\"\x00drop column from\x00rename columns of\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q) AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00error in %s %s%s%s: %s\x00 \x00\"%w\"\x00%.*s%s\x00cannot drop %s column: \"%s\"\x00PRIMARY KEY\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00%s.expr(%d)\x00sqlite\\_%\x00Analysis for %s.%s\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00usesStmtJournal=%d\x00sqlite_temp_schema\x00sqlite_schema\x00sqlite_temp_master\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00table %T already exists\x00there is already an index named %s\x00sqlite_returning\x00cannot use RETURNING in a trigger\x00too many columns on %s\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00INTEGER\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00unsupported use of NULLS %s\x00FIRST\x00LAST\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00CREATE%s INDEX %.*s\x00 UNIQUE\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00a JOIN clause is required before %s\x00ON\x00USING\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00text\x00blob\x00integer overflow\x00%.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!.20e\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\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\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00glob\x00coalesce\x00sign\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00trigger count\x00defer IPK REPLACE until last\x00uniqueness check for ROWID\x00prep index %s\x00%s column %d\x00for %s\x00bypass recheck\x00Do IPK REPLACE\x00sqlite3_extension_init\x00unable to open shared library [%s]\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00so\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00fkid\x00file\x00busy\x00log\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\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\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00lock_status\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00onoffalseyestruextrafull\x00exclusive\x00normal\x00none\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00w\x00a\x00s\x00sissii\x00utf8\x00utf16le\x00utf16be\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00issisii\x00issisi\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00siX\x00*** in database %s ***\n\x00NULL value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00non-unique entry in index \x00wrong # of entries in index \x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00unknown\x00closed\x00ss\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unlocked\x00shared\x00reserved\x00pending\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00error in %s %s after %s: %s\x00rename\x00drop column\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown or unsupported join type: %T %T%s%T\x00RIGHT and FULL OUTER JOINs are not currently supported\x00naturaleftouterightfullinnercross\x00a NATURAL join may not have an ON or USING clause\x00cannot have both ON and USING clauses in the same join\x00cannot join using column %s - column not present in both tables\x00OFFSET\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00column%d\x00%.*z:%u\x00LIMIT counter\x00OFFSET counter\x00LIMIT+OFFSET\x00cannot use window functions in recursive queries\x00Queue table\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00SCAN %d CONSTANT ROW%s\x00S\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00Jump ahead if LIMIT reached\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00left SELECT\x00LEFT\x00right SELECT\x00RIGHT\x00Output routine for A\x00Output routine for B\x00eof-A subroutine\x00eof-B subroutine\x00A-lt-B subroutine\x00A-eq-B subroutine\x00A-gt-B subroutine\x00no such index: %s\x00'%s' is not a function\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00subquery_%u\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00unsafe use of virtual table \"%s\"\x00*\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00SCAN TABLE %s%s%s\x00 USING COVERING INDEX \x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %u\x00materialize \"%s\"\x00MATERIALIZE %u\x00end %s\x00inner-loop subroutine\x00end inner-loop subroutine\x00clear abort flag\x00DISTINCT\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\x00indicate accumulator empty\x00RIGHT PART OF ORDER BY\x00ORDER BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00trigger %T already exists\x00cannot create trigger on system table\x00cannot create %s trigger on view: %S\x00BEFORE\x00AFTER\x00cannot create INSTEAD OF trigger on table: %S\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00%s RETURNING is not available on virtual tables\x00DELETE\x00UPDATE\x00abort\x00rollback\x00fail\x00ignore\x00default\x00n/a\x00Start: %s.%s (%s %s%s%s ON %s)\x00INSERT\x00-- TRIGGER %s\x00End: %s.%s\x00Call: %s.%s\x00fkey\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00Begin DO UPDATE of UPSERT\x00End DO UPDATE of UPSERT\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00ATTACH %Q AS vacuum_db\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO vacuum_db.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM vacuum_db.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO vacuum_db.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00 SUBQUERY %u\x00 TABLE %s\x00 AS %s\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00=\x00>? AND rowid<\x00 USING INTEGER PRIMARY KEY (rowid%s?)\x00 VIRTUAL TABLE INDEX %d:%s\x00begin skip-scan on %s\x00init LEFT JOIN no-match flag\x00next row of %s\x00NULL-scan pass ctr\x00If NULL-scan 2nd pass\x00If NULL-scan 1st pass\x00MULTI-INDEX OR\x00INDEX %d\x00record LEFT JOIN hit\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00next skip-scan on %s\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00row_number\x00dense_rank\x00rank\x00percent_rank\x00cume_dist\x00ntile\x00last_value\x00nth_value\x00first_value\x00lead\x00lag\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00call flush_partition\x00%s clause should come after %s not before\x00LIMIT\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00parser stack overflow\x00unknown table option: %.*s\x00set list\x00near \"%T\": syntax error\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\x00incomplete input\x00unrecognized token: \"%.*s\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00SQLITE_OK\x00SQLITE_ERROR\x00SQLITE_ERROR_SNAPSHOT\x00SQLITE_INTERNAL\x00SQLITE_PERM\x00SQLITE_ABORT\x00SQLITE_ABORT_ROLLBACK\x00SQLITE_BUSY\x00SQLITE_BUSY_RECOVERY\x00SQLITE_BUSY_SNAPSHOT\x00SQLITE_LOCKED\x00SQLITE_LOCKED_SHAREDCACHE\x00SQLITE_NOMEM\x00SQLITE_READONLY\x00SQLITE_READONLY_RECOVERY\x00SQLITE_READONLY_CANTINIT\x00SQLITE_READONLY_ROLLBACK\x00SQLITE_READONLY_DBMOVED\x00SQLITE_READONLY_DIRECTORY\x00SQLITE_INTERRUPT\x00SQLITE_IOERR\x00SQLITE_IOERR_READ\x00SQLITE_IOERR_SHORT_READ\x00SQLITE_IOERR_WRITE\x00SQLITE_IOERR_FSYNC\x00SQLITE_IOERR_DIR_FSYNC\x00SQLITE_IOERR_TRUNCATE\x00SQLITE_IOERR_FSTAT\x00SQLITE_IOERR_UNLOCK\x00SQLITE_IOERR_RDLOCK\x00SQLITE_IOERR_DELETE\x00SQLITE_IOERR_NOMEM\x00SQLITE_IOERR_ACCESS\x00SQLITE_IOERR_CHECKRESERVEDLOCK\x00SQLITE_IOERR_LOCK\x00SQLITE_IOERR_CLOSE\x00SQLITE_IOERR_DIR_CLOSE\x00SQLITE_IOERR_SHMOPEN\x00SQLITE_IOERR_SHMSIZE\x00SQLITE_IOERR_SHMLOCK\x00SQLITE_IOERR_SHMMAP\x00SQLITE_IOERR_SEEK\x00SQLITE_IOERR_DELETE_NOENT\x00SQLITE_IOERR_MMAP\x00SQLITE_IOERR_GETTEMPPATH\x00SQLITE_IOERR_CONVPATH\x00SQLITE_CORRUPT\x00SQLITE_CORRUPT_VTAB\x00SQLITE_NOTFOUND\x00SQLITE_FULL\x00SQLITE_CANTOPEN\x00SQLITE_CANTOPEN_NOTEMPDIR\x00SQLITE_CANTOPEN_ISDIR\x00SQLITE_CANTOPEN_FULLPATH\x00SQLITE_CANTOPEN_CONVPATH\x00SQLITE_CANTOPEN_SYMLINK\x00SQLITE_PROTOCOL\x00SQLITE_EMPTY\x00SQLITE_SCHEMA\x00SQLITE_TOOBIG\x00SQLITE_CONSTRAINT\x00SQLITE_CONSTRAINT_UNIQUE\x00SQLITE_CONSTRAINT_TRIGGER\x00SQLITE_CONSTRAINT_FOREIGNKEY\x00SQLITE_CONSTRAINT_CHECK\x00SQLITE_CONSTRAINT_PRIMARYKEY\x00SQLITE_CONSTRAINT_NOTNULL\x00SQLITE_CONSTRAINT_COMMITHOOK\x00SQLITE_CONSTRAINT_VTAB\x00SQLITE_CONSTRAINT_FUNCTION\x00SQLITE_CONSTRAINT_ROWID\x00SQLITE_MISMATCH\x00SQLITE_MISUSE\x00SQLITE_NOLFS\x00SQLITE_AUTH\x00SQLITE_FORMAT\x00SQLITE_RANGE\x00SQLITE_NOTADB\x00SQLITE_ROW\x00SQLITE_NOTICE\x00SQLITE_NOTICE_RECOVER_WAL\x00SQLITE_NOTICE_RECOVER_ROLLBACK\x00SQLITE_WARNING\x00SQLITE_WARNING_AUTOINDEX\x00SQLITE_DONE\x00SQLITE_UNKNOWN(%d)\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\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\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00mode\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00private\x00ro\x00rw\x00rwc\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00[0]\x00JSON path error near '%q'\x00json_%s() needs an odd number of arguments\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%d]\x00.%.*s\x00$\x00json\x00json_array\x00json_array_length\x00json_extract\x00json_insert\x00json_object\x00json_patch\x00json_quote\x00json_remove\x00json_replace\x00json_set\x00json_type\x00json_valid\x00json_group_array\x00json_group_object\x00json_each\x00json_tree\x00%s_node\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00);\x00,%.*s REAL\x00,%.*s INT\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00Mapping (%lld -> %lld) missing from %s table\x00%_rowid\x00%_parent\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00END\x00wrong number of arguments to function rtreecheck()\x00[\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql LIKE 'create virtual%%'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00table %q %s rbu_rowid column\x00may not have\x00requires\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00 NOT NULL\x00%z, %z\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00 WITHOUT ROWID\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00AND\x00WHERE\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00, _rowid_\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00, 0 AS rbu_rowid\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x000 AS \x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file://%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00file:%s-vactmp?rbu_memory=1%s%s\x00&\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00database modified during rbu %s\x00vacuum\x00update\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00CREATE TABLE x( name TEXT, path TEXT, pageno INTEGER, pagetype TEXT, ncell INTEGER, payload INTEGER, unused INTEGER, mx_payload INTEGER, pgoffset INTEGER, pgsize INTEGER, schema TEXT HIDDEN, aggregate BOOLEAN HIDDEN)\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00CREATE TABLE x(pgno INTEGER PRIMARY KEY, data BLOB, schema HIDDEN)\x00read-only\x00cannot delete\x00cannot insert\x00no such schema\x00bad page number\x00bad page value\x00sqlite_dbpage\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00snippet\x00highlight\x00bm25\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00columns\x00malformed detail=... directive\x00unrecognized option: \"%.*s\"\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00fts5: %s queries are not supported (detail!=full)\x00phrase\x00%s \x00-col %d \x00-col {%d\x00 %d\x00} \x00-near %d \x00--\x00 {\x00 [%z]\x00\"\"\x00{\x00%s : \x00NEAR(\x00 + \x00, %d)\x00 NOT \x00 OR \x00%s%s%z%s\x00nearset\x00wrong number of arguments to function %s\x00fts5_expr_tcl\x00fts5_expr\x00wrong number of arguments to function fts5_isalnum\x00L*\x00N*\x00Co\x00wrong number of arguments to function fts5_fold\x00fts5_isalnum\x00fts5_fold\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00{averages} \x00{structure}\x00{%ssegid=%d h=%d pgno=%d}\x00dlidx \x00 {lvl=%d nMerge=%d nSeg=%d\x00 {id=%d leaves=%d..%d}\x00%s%d\x00 id=%lld\x00 nPos=%d%s\x00+\x00 %lld%s\x00 %d(%lld)\x00 term=%.*s\x00corrupt\x00should be: fts5_rowid(subject, ....)\x00segment\x00should be: fts5_rowid('segment', segid, pgno))\x00first arg to fts5_rowid() must be 'segment'\x00fts5_decode\x00fts5_decode_none\x00fts5_rowid\x00recursively defined fts5 content table\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00DESC\x00ASC\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%s: table does not support scanning\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00cannot %s contentless fts5 table: %s\x00DELETE from\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2021-03-12 15:10:09 acd63062eb06748bfe9e4886639e4f2b54ea6a496a83f10716abbaba4115500b\x00config\x00fts5\x00fts5_source_id\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00ascii\x00porter\x00trigram\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x00CREATE TABLE x(sql,ncol,ro,busy,nscan,nsort,naidx,nstep,reprep,run,mem)\x00sqlite_stmt\x002021-03-12 15:10:09 acd63062eb06748bfe9e4886639e4f2b54ea6a496a83f10716abbaba4115500b\x00" var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data diff --git a/speedtest1/main_linux_amd64.go b/speedtest1/main_linux_amd64.go index 660e49a..52210f7 100644 --- a/speedtest1/main_linux_amd64.go +++ b/speedtest1/main_linux_amd64.go @@ -1,4 +1,4 @@ -// Code generated by 'ccgo -export-defines "" -o speedtest1/main_linux_amd64.go -trace-translation-units testdata/sqlite-src-3330000/test/speedtest1.c -Itestdata/sqlite-amalgamation-3330000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_UNIX=1', DO NOT EDIT. +// Code generated by 'ccgo -export-defines "" -o speedtest1/main_linux_amd64.go -trace-translation-units testdata/sqlite-src-3350000/test/speedtest1.c -Itestdata/sqlite-amalgamation-3350000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_OS_UNIX=1', DO NOT EDIT. package main @@ -308,6 +308,7 @@ const ( SQLITE_IOERR_CLOSE = 4106 SQLITE_IOERR_COMMIT_ATOMIC = 7690 SQLITE_IOERR_CONVPATH = 6666 + SQLITE_IOERR_CORRUPTFS = 8458 SQLITE_IOERR_DATA = 8202 SQLITE_IOERR_DELETE = 2570 SQLITE_IOERR_DELETE_NOENT = 5898 @@ -446,7 +447,7 @@ const ( SQLITE_SHM_SHARED = 4 SQLITE_SHM_UNLOCK = 1 SQLITE_SOUNDEX = 1 - SQLITE_SOURCE_ID = "2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f" + SQLITE_SOURCE_ID = "2021-03-12 15:10:09 acd63062eb06748bfe9e4886639e4f2b54ea6a496a83f10716abbaba4115500b" SQLITE_STATUS_MALLOC_COUNT = 9 SQLITE_STATUS_MALLOC_SIZE = 5 SQLITE_STATUS_MEMORY_USED = 0 @@ -483,7 +484,7 @@ const ( SQLITE_TESTCTRL_INTERNAL_FUNCTIONS = 17 SQLITE_TESTCTRL_ISINIT = 23 SQLITE_TESTCTRL_ISKEYWORD = 16 - SQLITE_TESTCTRL_LAST = 29 + SQLITE_TESTCTRL_LAST = 31 SQLITE_TESTCTRL_LOCALTIME_FAULT = 18 SQLITE_TESTCTRL_NEVER_CORRUPT = 20 SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD = 19 @@ -497,7 +498,9 @@ const ( SQLITE_TESTCTRL_RESERVE = 14 SQLITE_TESTCTRL_RESULT_INTREAL = 27 SQLITE_TESTCTRL_SCRATCHMALLOC = 17 + SQLITE_TESTCTRL_SEEK_COUNT = 30 SQLITE_TESTCTRL_SORTER_MMAP = 24 + SQLITE_TESTCTRL_TRACEFLAGS = 31 SQLITE_TESTCTRL_VDBE_COVERAGE = 21 SQLITE_TEXT = 3 SQLITE_THREADSAFE = 1 @@ -507,14 +510,17 @@ const ( SQLITE_TRACE_ROW = 0x04 SQLITE_TRACE_STMT = 0x01 SQLITE_TRANSACTION = 22 + SQLITE_TXN_NONE = 0 + SQLITE_TXN_READ = 1 + SQLITE_TXN_WRITE = 2 SQLITE_UPDATE = 23 SQLITE_UTF16 = 4 SQLITE_UTF16BE = 3 SQLITE_UTF16LE = 2 SQLITE_UTF16_ALIGNED = 8 SQLITE_UTF8 = 1 - SQLITE_VERSION = "3.33.0" - SQLITE_VERSION_NUMBER = 3033000 + SQLITE_VERSION = "3.35.0" + SQLITE_VERSION_NUMBER = 3035000 SQLITE_VTAB_CONSTRAINT_SUPPORT = 1 SQLITE_VTAB_DIRECTONLY = 3 SQLITE_VTAB_INNOCUOUS = 2 @@ -541,11 +547,14 @@ const ( X_BITS_BYTESWAP_H = 1 X_BITS_FLOATN_COMMON_H = 0 X_BITS_FLOATN_H = 0 + X_BITS_G_CONFIG_H = 1 + X_BITS_LIBIO_H = 1 X_BITS_POSIX_OPT_H = 1 X_BITS_PTHREADTYPES_ARCH_H = 1 X_BITS_PTHREADTYPES_COMMON_H = 1 X_BITS_STDINT_INTN_H = 1 X_BITS_STDIO_LIM_H = 1 + X_BITS_SYSMACROS_H = 1 X_BITS_TYPESIZES_H = 1 X_BITS_TYPES_H = 1 X_BITS_TYPES_LOCALE_T_H = 1 @@ -563,11 +572,62 @@ const ( X_GCC_WCHAR_T = 0 X_GETOPT_CORE_H = 1 X_GETOPT_POSIX_H = 1 + X_G_BUFSIZ = 8192 + X_G_HAVE_MMAP = 1 + X_G_HAVE_MREMAP = 1 + X_G_HAVE_ST_BLKSIZE = 0 + X_G_IO_IO_FILE_VERSION = 0x20001 X_IOFBF = 0 X_IOLBF = 1 X_IONBF = 2 - X_IO_EOF_SEEN = 0x0010 - X_IO_ERR_SEEN = 0x0020 + X_IOS_APPEND = 8 + X_IOS_ATEND = 4 + X_IOS_BIN = 128 + X_IOS_INPUT = 1 + X_IOS_NOCREATE = 32 + X_IOS_NOREPLACE = 64 + X_IOS_OUTPUT = 2 + X_IOS_TRUNC = 16 + X_IO_BAD_SEEN = 0x4000 + X_IO_BOOLALPHA = 0200000 + X_IO_BUFSIZ = 8192 + X_IO_CURRENTLY_PUTTING = 0x800 + X_IO_DEC = 020 + X_IO_DELETE_DONT_CLOSE = 0x40 + X_IO_DONT_CLOSE = 0100000 + X_IO_EOF_SEEN = 0x10 + X_IO_ERR_SEEN = 0x20 + X_IO_FIXED = 010000 + X_IO_FLAGS2_MMAP = 1 + X_IO_FLAGS2_NOTCANCEL = 2 + X_IO_FLAGS2_USER_WBUF = 8 + X_IO_HAVE_ST_BLKSIZE = 0 + X_IO_HEX = 0100 + X_IO_INTERNAL = 010 + X_IO_IN_BACKUP = 0x100 + X_IO_IS_APPENDING = 0x1000 + X_IO_IS_FILEBUF = 0x2000 + X_IO_LEFT = 02 + X_IO_LINE_BUF = 0x200 + X_IO_LINKED = 0x80 + X_IO_MAGIC = 0xFBAD0000 + X_IO_MAGIC_MASK = 0xFFFF0000 + X_IO_NO_READS = 4 + X_IO_NO_WRITES = 8 + X_IO_OCT = 040 + X_IO_RIGHT = 04 + X_IO_SCIENTIFIC = 04000 + X_IO_SHOWBASE = 0200 + X_IO_SHOWPOINT = 0400 + X_IO_SHOWPOS = 02000 + X_IO_SKIPWS = 01 + X_IO_STDIO = 040000 + X_IO_TIED_PUT_GET = 0x400 + X_IO_UNBUFFERED = 2 + X_IO_UNIFIED_JUMPTABLES = 1 + X_IO_UNITBUF = 020000 + X_IO_UPPERCASE = 01000 + X_IO_USER_BUF = 1 X_IO_USER_LOCK = 0x8000 X_LFS64_ASYNCHRONOUS_IO = 1 X_LFS64_LARGEFILE = 1 @@ -575,6 +635,7 @@ const ( X_LFS_ASYNCHRONOUS_IO = 1 X_LFS_LARGEFILE = 1 X_LP64 = 1 + X_OLD_STDIO_MAGIC = 0xFABC0000 X_POSIX2_CHAR_TERM = 200809 X_POSIX2_C_BIND = 200809 X_POSIX2_C_DEV = 200809 @@ -651,6 +712,7 @@ const ( X_STDARG_H = 0 X_STDC_PREDEF_H = 1 X_STDIO_H = 1 + X_STDIO_USES_IOSTREAM = 0 X_STDLIB_H = 1 X_STRINGS_H = 1 X_STRING_H = 1 @@ -658,6 +720,7 @@ const ( X_SYS_CDEFS_H = 1 X_SYS_SELECT_H = 1 X_SYS_SIZE_T_H = 0 + X_SYS_SYSMACROS_H = 1 X_SYS_TYPES_H = 1 X_THREAD_SHARED_TYPES_H = 1 X_T_SIZE = 0 @@ -677,6 +740,7 @@ const ( X_WCHAR_T_H = 0 X_XBS5_LP64_OFF64 = 1 X_XBS5_LPBIG_OFFBIG = -1 + X_XOPEN_CRYPT = 1 X_XOPEN_ENH_I18N = 1 X_XOPEN_LEGACY = 1 X_XOPEN_REALTIME = 1 @@ -1156,6 +1220,14 @@ const ( /* confname.h:71:1: */ _SC_THREAD_ROBUST_PRIO_PROTECT = 248 ) +// This is the structure from the libstdc++ codecvt class. +const ( /* libio.h:180:1: */ + __codecvt_ok = 0 + __codecvt_partial = 1 + __codecvt_error = 2 + __codecvt_noconv = 3 +) + // In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. // are already defined. // BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. @@ -1206,7 +1278,7 @@ type wchar_t = int32 /* :15:24 */ // A program for performance testing. // // The available command-line options are described below: -var zHelp = *(*[2146]int8)(unsafe.Pointer(ts /* "Usage: %s [--opt..." */)) /* speedtest1.c:6:19 */ +var zHelp = *(*[2206]int8)(unsafe.Pointer(ts /* "Usage: %s [--opt..." */)) /* speedtest1.c:6:19 */ // Define the standard macros for the user, // if this invocation was from the user program. @@ -1361,7 +1433,7 @@ type sqlite3_callback = uintptr /* sqlite3.h:338:13 */ // for their own use. The pMethods entry is a pointer to an // [sqlite3_io_methods] object that defines methods for performing // I/O operations on the open file. -type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:683:9 */ +type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:684:9 */ // CAPI3REF: Result Codes // KEYWORDS: {result code definitions} @@ -1472,7 +1544,7 @@ type sqlite3_file1 = struct{ pMethods uintptr } /* sqlite3.h:683:9 */ // for their own use. The pMethods entry is a pointer to an // [sqlite3_io_methods] object that defines methods for performing // I/O operations on the open file. -type sqlite3_file = sqlite3_file1 /* sqlite3.h:683:29 */ +type sqlite3_file = sqlite3_file1 /* sqlite3.h:684:29 */ type sqlite3_io_methods1 = struct { iVersion int32 _ [4]byte @@ -1494,7 +1566,7 @@ type sqlite3_io_methods1 = struct { xShmUnmap uintptr xFetch uintptr xUnfetch uintptr -} /* sqlite3.h:683:9 */ +} /* sqlite3.h:684:9 */ // CAPI3REF: OS Interface File Virtual Methods Object // @@ -1588,7 +1660,7 @@ type sqlite3_io_methods1 = struct { // fails to zero-fill short reads might seem to work. However, // failure to zero-fill short reads will eventually lead to // database corruption. -type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:782:35 */ +type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:783:35 */ // CAPI3REF: OS Interface Object // @@ -1781,7 +1853,7 @@ type sqlite3_vfs1 = struct { xSetSystemCall uintptr xGetSystemCall uintptr xNextSystemCall uintptr -} /* sqlite3.h:1367:9 */ +} /* sqlite3.h:1368:9 */ // CAPI3REF: OS Interface Object // @@ -1950,8 +2022,8 @@ type sqlite3_vfs1 = struct { // or all of these interfaces to be NULL or for their behavior to change // from one release to the next. Applications must not attempt to access // any of these methods if the iVersion of the VFS is less than 3. -type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1367:28 */ -type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1368:14 */ +type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1368:28 */ +type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1369:14 */ // CAPI3REF: Memory Allocation Routines // @@ -2023,7 +2095,7 @@ type sqlite3_mem_methods1 = struct { xInit uintptr xShutdown uintptr pAppData uintptr -} /* sqlite3.h:1665:9 */ +} /* sqlite3.h:1666:9 */ // CAPI3REF: Memory Allocation Routines // @@ -2086,7 +2158,7 @@ type sqlite3_mem_methods1 = struct { // // SQLite will never invoke xInit() more than once without an intervening // call to xShutdown(). -type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1665:36 */ +type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1666:36 */ // CAPI3REF: Constants Defining Special Destructor Behavior // @@ -2100,7 +2172,7 @@ type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1665:36 */ // // The typedef is necessary to work around problems in certain // C++ compilers. -type sqlite3_destructor_type = uintptr /* sqlite3.h:5621:14 */ +type sqlite3_destructor_type = uintptr /* sqlite3.h:5635:14 */ // The interface to the virtual-table mechanism is currently considered // to be experimental. The interface might change in incompatible ways. @@ -2115,7 +2187,7 @@ type sqlite3_vtab1 = struct { nRef int32 _ [4]byte zErrMsg uintptr -} /* sqlite3.h:6689:9 */ +} /* sqlite3.h:6754:9 */ // The interface to the virtual-table mechanism is currently considered // to be experimental. The interface might change in incompatible ways. @@ -2125,7 +2197,7 @@ type sqlite3_vtab1 = struct { // interface fixed, support it indefinitely, and remove this comment. // Structures used by the virtual table interface -type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6689:29 */ +type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6754:29 */ type sqlite3_index_info1 = struct { nConstraint int32 _ [4]byte @@ -2144,12 +2216,12 @@ type sqlite3_index_info1 = struct { idxFlags int32 _ [4]byte colUsed sqlite3_uint64 -} /* sqlite3.h:6690:9 */ +} /* sqlite3.h:6755:9 */ -type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6690:35 */ -type sqlite3_vtab_cursor1 = struct{ pVtab uintptr } /* sqlite3.h:6691:9 */ +type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6755:35 */ +type sqlite3_vtab_cursor1 = struct{ pVtab uintptr } /* sqlite3.h:6756:9 */ -type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6691:36 */ +type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6756:36 */ type sqlite3_module1 = struct { iVersion int32 _ [4]byte @@ -2176,9 +2248,9 @@ type sqlite3_module1 = struct { xRelease uintptr xRollbackTo uintptr xShadowName uintptr -} /* sqlite3.h:6689:9 */ +} /* sqlite3.h:6754:9 */ -type sqlite3_module = sqlite3_module1 /* sqlite3.h:6692:31 */ +type sqlite3_module = sqlite3_module1 /* sqlite3.h:6757:31 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -2286,7 +2358,7 @@ type sqlite3_index_constraint = struct { usable uint8 _ [2]byte iTermOffset int32 -} /* sqlite3.h:6690:9 */ +} /* sqlite3.h:6755:9 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -2392,7 +2464,7 @@ type sqlite3_index_orderby = struct { iColumn int32 desc uint8 _ [3]byte -} /* sqlite3.h:6690:9 */ +} /* sqlite3.h:6755:9 */ // CAPI3REF: Virtual Table Indexing Information // KEYWORDS: sqlite3_index_info @@ -2498,7 +2570,7 @@ type sqlite3_index_constraint_usage = struct { argvIndex int32 omit uint8 _ [3]byte -} /* sqlite3.h:6690:9 */ +} /* sqlite3.h:6755:9 */ // CAPI3REF: Mutex Methods Object // @@ -2573,7 +2645,7 @@ type sqlite3_mutex_methods1 = struct { xMutexLeave uintptr xMutexHeld uintptr xMutexNotheld uintptr -} /* sqlite3.h:7524:9 */ +} /* sqlite3.h:7589:9 */ // CAPI3REF: Mutex Methods Object // @@ -2638,7 +2710,7 @@ type sqlite3_mutex_methods1 = struct { // called, but only if the prior call to xMutexInit returned SQLITE_OK. // If xMutexInit fails in any way, it is expected to clean up after itself // prior to returning. -type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7524:38 */ +type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7589:38 */ // CAPI3REF: Custom Page Cache Object // @@ -2651,7 +2723,7 @@ type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7524:38 */ type sqlite3_pcache_page1 = struct { pBuf uintptr pExtra uintptr -} /* sqlite3.h:8277:9 */ +} /* sqlite3.h:8344:9 */ // CAPI3REF: Custom Page Cache Object // @@ -2661,7 +2733,7 @@ type sqlite3_pcache_page1 = struct { // of this object as parameters or as their return value. // // See [sqlite3_pcache_methods2] for additional information. -type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8277:36 */ +type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8344:36 */ // CAPI3REF: Application Defined Page Cache. // KEYWORDS: {page cache} @@ -2835,7 +2907,7 @@ type sqlite3_pcache_methods21 = struct { xTruncate uintptr xDestroy uintptr xShrink uintptr -} /* sqlite3.h:8442:9 */ +} /* sqlite3.h:8509:9 */ // CAPI3REF: Application Defined Page Cache. // KEYWORDS: {page cache} @@ -2994,7 +3066,7 @@ type sqlite3_pcache_methods21 = struct { // free up as much of heap memory as possible. The page cache implementation // is not obligated to free any memory, but well-behaved implementations should // do their best. -type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8442:40 */ +type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8509:40 */ // This is the obsolete pcache_methods object that has now been replaced // by sqlite3_pcache_methods2. This object is not used by SQLite. It is @@ -3011,12 +3083,12 @@ type sqlite3_pcache_methods1 = struct { xRekey uintptr xTruncate uintptr xDestroy uintptr -} /* sqlite3.h:8465:9 */ +} /* sqlite3.h:8532:9 */ // This is the obsolete pcache_methods object that has now been replaced // by sqlite3_pcache_methods2. This object is not used by SQLite. It is // retained in the header file for backwards compatibility only. -type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8465:39 */ +type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8532:39 */ // CAPI3REF: Database Snapshot // KEYWORDS: {snapshot} {sqlite3_snapshot} @@ -3036,7 +3108,7 @@ type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8465:39 */ // version of the database file so that it is possible to later open a new read // transaction that sees that historical version of the database rather than // the most recent version. -type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9512:9 */ +type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9589:9 */ // CAPI3REF: Database Snapshot // KEYWORDS: {snapshot} {sqlite3_snapshot} @@ -3056,7 +3128,7 @@ type sqlite3_snapshot1 = struct{ hidden [48]uint8 } /* sqlite3.h:9512:9 */ // version of the database file so that it is possible to later open a new read // transaction that sees that historical version of the database rather than // the most recent version. -type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9514:3 */ +type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9591:3 */ // CAPI3REF: Flags for sqlite3_deserialize() // @@ -3100,7 +3172,7 @@ type sqlite3_rtree_geometry1 = struct { aParam uintptr pUser uintptr xDelUser uintptr -} /* sqlite3.h:9839:9 */ +} /* sqlite3.h:9916:9 */ // CAPI3REF: Flags for sqlite3_deserialize() // @@ -3137,7 +3209,7 @@ type sqlite3_rtree_geometry1 = struct { // // -type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9839:39 */ +type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9916:39 */ type sqlite3_rtree_query_info1 = struct { pContext uintptr nParam int32 @@ -3157,13 +3229,13 @@ type sqlite3_rtree_query_info1 = struct { eWithin int32 rScore sqlite3_rtree_dbl apSqlParam uintptr -} /* sqlite3.h:9840:9 */ +} /* sqlite3.h:9917:9 */ -type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9840:41 */ +type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9917:41 */ // The double-precision datatype used by RTree depends on the // SQLITE_RTREE_INT_ONLY compile-time option. -type sqlite3_rtree_dbl = float64 /* sqlite3.h:9848:18 */ +type sqlite3_rtree_dbl = float64 /* sqlite3.h:9925:18 */ // Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. @@ -3218,7 +3290,7 @@ type Fts5ExtensionApi1 = struct { xPhraseNext uintptr xPhraseFirstColumn uintptr xPhraseNextColumn uintptr -} /* sqlite3.h:11634:9 */ +} /* sqlite3.h:11724:9 */ // Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. @@ -3251,22 +3323,22 @@ type Fts5ExtensionApi1 = struct { // Virtual table implementations may overload SQL functions by implementing // the sqlite3_module.xFindFunction() method. -type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11634:33 */ +type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11724:33 */ type Fts5PhraseIter1 = struct { a uintptr b uintptr -} /* sqlite3.h:11636:9 */ +} /* sqlite3.h:11726:9 */ -type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11636:31 */ +type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11726:31 */ -type fts5_extension_function = uintptr /* sqlite3.h:11638:14 */ +type fts5_extension_function = uintptr /* sqlite3.h:11728:14 */ type fts5_tokenizer1 = struct { xCreate uintptr xDelete uintptr xTokenize uintptr -} /* sqlite3.h:12097:9 */ +} /* sqlite3.h:12187:9 */ -type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12097:31 */ +type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12187:31 */ // Flags that may be passed as the third argument to xTokenize() @@ -3286,7 +3358,7 @@ type fts5_api1 = struct { xCreateTokenizer uintptr xFindTokenizer uintptr xCreateFunction uintptr -} /* sqlite3.h:12133:9 */ +} /* sqlite3.h:12223:9 */ // Flags that may be passed as the third argument to xTokenize() @@ -3300,51 +3372,9 @@ type fts5_api1 = struct { // ************************************************************************ // // FTS5 EXTENSION REGISTRATION API -type fts5_api = fts5_api1 /* sqlite3.h:12133:25 */ +type fts5_api = fts5_api1 /* sqlite3.h:12223:25 */ -// The tag name of this struct is _G_fpos_t to preserve historic -// C++ mangled names for functions taking fpos_t arguments. -// That name should not be used in new code. -type _G_fpos_t = struct { - __pos int64 - __state struct { - __count int32 - __value struct{ __wch uint32 } - } -} /* __fpos_t.h:10:9 */ - -// bits/types.h -- definitions of __*_t types underlying *_t types. -// Copyright (C) 2002-2018 Free Software Foundation, Inc. -// This file is part of the GNU C Library. -// -// The GNU C Library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// The GNU C Library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with the GNU C Library; if not, see -// . - -// Never include this file directly; use instead. - -// The tag name of this struct is _G_fpos64_t to preserve historic -// C++ mangled names for functions taking fpos_t and/or fpos64_t -// arguments. That name should not be used in new code. -type _G_fpos64_t = struct { - __pos int64 - __state struct { - __count int32 - __value struct{ __wch uint32 } - } -} /* __fpos64_t.h:10:9 */ - -type _IO_FILE = struct { +type _IO_FILE1 = struct { _flags int32 _ [4]byte _IO_read_ptr uintptr @@ -3369,28 +3399,50 @@ type _IO_FILE = struct { _ [4]byte _lock uintptr _offset int64 - _codecvt uintptr - _wide_data uintptr - _freeres_list uintptr - _freeres_buf uintptr + __pad1 uintptr + __pad2 uintptr + __pad3 uintptr + __pad4 uintptr __pad5 size_t _mode int32 _unused2 [20]int8 } /* __FILE.h:4:1 */ // The opaque type of streams. This is the definition used elsewhere. -type FILE = _IO_FILE /* FILE.h:7:25 */ +type FILE = _IO_FILE1 /* FILE.h:7:25 */ -// These macros are used by bits/stdio.h and internal headers. +type _G_fpos_t = struct { + __pos int64 + __state struct { + __count int32 + __value struct{ __wch uint32 } + } +} /* _G_config.h:30:3 */ +type _G_fpos64_t = struct { + __pos int64 + __state struct { + __count int32 + __value struct{ __wch uint32 } + } +} /* _G_config.h:35:3 */ -// Many more flag bits are defined internally. +// A streammarker remembers a position in a buffer. -type off_t = int64 /* stdio.h:65:19 */ +type _IO_marker = struct { + _next uintptr + _sbuf uintptr + _pos int32 + _ [4]byte +} /* __FILE.h:4:1 */ -type ssize_t = int64 /* stdio.h:77:19 */ +type _IO_FILE = _IO_FILE1 /* libio.h:314:25 */ + +type off_t = int64 /* stdio.h:59:19 */ + +type ssize_t = int64 /* stdio.h:71:19 */ // The type of the second argument to `fgetpos' and `fsetpos'. -type fpos_t = _G_fpos64_t /* stdio.h:86:20 */ +type fpos_t = _G_fpos64_t /* stdio.h:80:21 */ // In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. // are already defined. @@ -3624,11 +3676,6 @@ type idtype_t = uint32 /* waitflags.h:57:3 */ // configurations support _Float128x or, as of GCC 7, have compiler // support for a type meeting the requirements for _Float128x. -// Defined to 1 if the corresponding _FloatN type is not binary compatible -// with the corresponding ISO C type in the current compilation unit as -// opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built -// in glibc. - // Defined to 1 if any _FloatN or _FloatNx types that are not // ABI-distinct are however distinct types at the C language level (so // for the purposes of __builtin_types_compatible_p and _Generic). @@ -3729,28 +3776,29 @@ type u_long = uint64 /* types.h:36:18 */ type quad_t = int64 /* types.h:37:18 */ type u_quad_t = uint64 /* types.h:38:20 */ type fsid_t = struct{ __val [2]int32 } /* types.h:39:18 */ -type loff_t = int64 /* types.h:42:18 */ -type ino_t = uint64 /* types.h:49:19 */ +type loff_t = int64 /* types.h:44:18 */ -type dev_t = uint64 /* types.h:59:17 */ +type ino_t = uint64 /* types.h:50:19 */ -type gid_t = uint32 /* types.h:64:17 */ +type dev_t = uint64 /* types.h:60:17 */ -type mode_t = uint32 /* types.h:69:18 */ +type gid_t = uint32 /* types.h:65:17 */ -type nlink_t = uint64 /* types.h:74:19 */ +type mode_t = uint32 /* types.h:70:18 */ -type uid_t = uint32 /* types.h:79:17 */ +type nlink_t = uint64 /* types.h:75:19 */ -type pid_t = int32 /* types.h:97:17 */ +type uid_t = uint32 /* types.h:80:17 */ -type id_t = uint32 /* types.h:103:16 */ +type pid_t = int32 /* types.h:98:17 */ -type daddr_t = int32 /* types.h:114:19 */ -type caddr_t = uintptr /* types.h:115:19 */ +type id_t = uint32 /* types.h:104:16 */ -type key_t = int32 /* types.h:121:17 */ +type daddr_t = int32 /* types.h:115:19 */ +type caddr_t = uintptr /* types.h:116:19 */ + +type key_t = int32 /* types.h:122:17 */ // bits/types.h -- definitions of __*_t types underlying *_t types. // Copyright (C) 2002-2018 Free Software Foundation, Inc. @@ -3844,7 +3892,7 @@ type time_t = int64 /* time_t.h:7:18 */ // Timer ID returned by `timer_create'. type timer_t = uintptr /* timer_t.h:7:19 */ -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -3927,9 +3975,9 @@ type timer_t = uintptr /* timer_t.h:7:19 */ // A null pointer constant. // Old compatibility names for C types. -type ulong = uint64 /* types.h:148:27 */ -type ushort = uint16 /* types.h:149:28 */ -type uint = uint32 /* types.h:150:22 */ +type ulong = uint64 /* types.h:149:27 */ +type ushort = uint16 /* types.h:150:28 */ +type uint = uint32 /* types.h:151:22 */ // These size-specific names are used by some of the inet code. @@ -3978,12 +4026,12 @@ type int64_t = int64 /* stdint-intn.h:27:19 */ // For GCC 2.7 and later, we can use specific type-size attributes. -type u_int8_t = uint32 /* types.h:177:1 */ -type u_int16_t = uint32 /* types.h:178:1 */ -type u_int32_t = uint32 /* types.h:179:1 */ -type u_int64_t = uint32 /* types.h:180:1 */ +type u_int8_t = uint32 /* types.h:178:1 */ +type u_int16_t = uint32 /* types.h:179:1 */ +type u_int32_t = uint32 /* types.h:180:1 */ +type u_int64_t = uint32 /* types.h:181:1 */ -type register_t = int32 /* types.h:182:13 */ +type register_t = int32 /* types.h:183:13 */ // A set of signals to be blocked, unblocked, or waited for. type sigset_t = struct{ __val [16]uint64 } /* sigset_t.h:7:20 */ @@ -4059,14 +4107,12 @@ type fd_set = struct{ __fds_bits [16]int64 } /* select.h:70:5 */ // Sometimes the fd_set member is assumed to have this type. type fd_mask = int64 /* select.h:77:19 */ -// Define some inlines helping to catch common problems. - -type blksize_t = int64 /* types.h:202:21 */ +type blksize_t = int64 /* types.h:212:21 */ // Types from the Large File Support interface. -type blkcnt_t = int64 /* types.h:222:22 */ // Type to count number of disk blocks. -type fsblkcnt_t = uint64 /* types.h:226:24 */ // Type to count file system blocks. -type fsfilcnt_t = uint64 /* types.h:230:24 */ // Type to count file system inodes. +type blkcnt_t = int64 /* types.h:232:22 */ // Type to count number of disk blocks. +type fsblkcnt_t = uint64 /* types.h:236:24 */ // Type to count file system blocks. +type fsfilcnt_t = uint64 /* types.h:240:24 */ // Type to count file system inodes. // Now add the thread types. // Declaration of common pthread types for all architectures. @@ -4443,6 +4489,8 @@ type locale_t = uintptr /* locale_t.h:24:20 */ // The X/Open Unix extensions are available. +// Encryption is present. + // The enhanced internationalization capabilities according to XPG4.2 // are present. @@ -4734,7 +4782,7 @@ type locale_t = uintptr /* locale_t.h:24:20 */ // Never include this file directly; use instead. -// Copyright (C) 1989-2018 Free Software Foundation, Inc. +// Copyright (C) 1989-2017 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -4819,15 +4867,15 @@ type locale_t = uintptr /* locale_t.h:24:20 */ // The Single Unix specification says that some more types are // available here. -type useconds_t = uint32 /* unistd.h:255:22 */ +type useconds_t = uint32 /* unistd.h:258:22 */ -type intptr_t = int64 /* unistd.h:267:20 */ +type intptr_t = int64 /* unistd.h:270:20 */ -type socklen_t = uint32 /* unistd.h:274:21 */ +type socklen_t = uint32 /* unistd.h:277:21 */ // Define some macros helping to catch buffer overflows. -type u64 = sqlite3_uint64 /* speedtest1.c:66:24 */ +type u64 = sqlite3_uint64 /* speedtest1.c:67:24 */ // State structure for a Hash hash in progress type HashContext1 = struct { @@ -4836,10 +4884,10 @@ type HashContext1 = struct { j uint8 s [256]uint8 r [32]uint8 -} /* speedtest1.c:71:9 */ +} /* speedtest1.c:72:9 */ // State structure for a Hash hash in progress -type HashContext = HashContext1 /* speedtest1.c:71:28 */ +type HashContext = HashContext1 /* speedtest1.c:72:28 */ // All global state is held in this structure type Global = struct { @@ -4857,6 +4905,8 @@ type Global = struct { szTest int32 nRepeat int32 doCheckpoint int32 + nReserve int32 + _ [4]byte zWR uintptr zNN uintptr zPK uintptr @@ -4869,21 +4919,21 @@ type Global = struct { hashFile uintptr hash HashContext _ [5]byte -} /* speedtest1.c:81:8 */ +} /* speedtest1.c:82:8 */ // All global state is held in this structure -var g Global /* speedtest1.c:107:3: */ +var g Global /* speedtest1.c:109:3: */ // Return " TEMP" or "", as appropriate for creating a table. -func isTemp(tls *libc.TLS, N int32) uintptr { /* speedtest1.c:111:19: */ +func isTemp(tls *libc.TLS, N int32) uintptr { /* speedtest1.c:113:19: */ if g.eTemp >= N { - return ts + 2146 /* " TEMP" */ + return ts + 2206 /* " TEMP" */ } - return ts + 2152 /* "" */ + return ts + 2212 /* "" */ } // Print an error message and exit -func fatal_error(tls *libc.TLS, zMsg uintptr, va uintptr) { /* speedtest1.c:116:13: */ +func fatal_error(tls *libc.TLS, zMsg uintptr, va uintptr) { /* speedtest1.c:118:13: */ var ap va_list _ = ap ap = va @@ -4900,18 +4950,18 @@ func fatal_error(tls *libc.TLS, zMsg uintptr, va uintptr) { /* speedtest1.c:116: // Initialize a new hash. iSize determines the size of the hash // in bits and should be one of 224, 256, 384, or 512. Or iSize // can be zero to use the default hash size of 256 bits. -func HashInit(tls *libc.TLS) { /* speedtest1.c:135:13: */ +func HashInit(tls *libc.TLS) { /* speedtest1.c:137:13: */ var k uint32 g.hash.i = uint8(0) g.hash.j = uint8(0) for k = uint32(0); k < uint32(256); k++ { - *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(k))) = uint8(k) + *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 3 /* &.s */) + uintptr(k))) = uint8(k) } } // Make consecutive calls to the HashUpdate function to add new content // to the hash -func HashUpdate(tls *libc.TLS, aData uintptr, nData uint32) { /* speedtest1.c:146:13: */ +func HashUpdate(tls *libc.TLS, aData uintptr, nData uint32) { /* speedtest1.c:148:13: */ var t uint8 var i uint8 = g.hash.i var j uint8 = g.hash.j @@ -4920,10 +4970,10 @@ func HashUpdate(tls *libc.TLS, aData uintptr, nData uint32) { /* speedtest1.c:14 libc.Xfwrite(tls, aData, uint64(1), uint64(nData), g.hashFile) } for k = uint32(0); k < nData; k++ { - j = uint8(int32(j) + (int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i)))) + int32(*(*uint8)(unsafe.Pointer(aData + uintptr(k)))))) - t = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(j))) - *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(j))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i))) - *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i))) = t + j = uint8(int32(j) + (int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 3 /* &.s */) + uintptr(i)))) + int32(*(*uint8)(unsafe.Pointer(aData + uintptr(k)))))) + t = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 3 /* &.s */) + uintptr(j))) + *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 3 /* &.s */) + uintptr(j))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 3 /* &.s */) + uintptr(i))) + *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 3 /* &.s */) + uintptr(i))) = t i++ } g.hash.i = i @@ -4932,7 +4982,7 @@ func HashUpdate(tls *libc.TLS, aData uintptr, nData uint32) { /* speedtest1.c:14 // After all content has been added, invoke HashFinal() to compute // the final hash. The hash result is stored in g.hash.r[]. -func HashFinal(tls *libc.TLS) { /* speedtest1.c:170:13: */ +func HashFinal(tls *libc.TLS) { /* speedtest1.c:172:13: */ var k uint32 var t uint8 var i uint8 @@ -4941,12 +4991,12 @@ func HashFinal(tls *libc.TLS) { /* speedtest1.c:170:13: */ j = g.hash.j for k = uint32(0); k < uint32(32); k++ { i++ - t = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i))) + t = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 3 /* &.s */) + uintptr(i))) j = uint8(int32(j) + (int32(t))) - *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(j))) - *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(j))) = t - t = uint8(int32(t) + (int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i)))))) - *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 259 /* &.r */) + uintptr(k))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(t))) + *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 3 /* &.s */) + uintptr(i))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 3 /* &.s */) + uintptr(j))) + *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 3 /* &.s */) + uintptr(j))) = t + t = uint8(int32(t) + (int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 3 /* &.s */) + uintptr(i)))))) + *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 259 /* &.r */) + uintptr(k))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 3 /* &.s */) + uintptr(t))) } } @@ -4955,7 +5005,7 @@ func HashFinal(tls *libc.TLS) { /* speedtest1.c:170:13: */ // Return the value of a hexadecimal digit. Return -1 if the input // is not a hex digit. -func hexDigitValue(tls *libc.TLS, c int8) int32 { /* speedtest1.c:194:12: */ +func hexDigitValue(tls *libc.TLS, c int8) int32 { /* speedtest1.c:196:12: */ if (int32(c) >= '0') && (int32(c) <= '9') { return (int32(c) - '0') } @@ -4972,7 +5022,7 @@ func hexDigitValue(tls *libc.TLS, c int8) int32 { /* speedtest1.c:194:12: */ // SQLite // Interpret zArg as an integer value, possibly with suffixes. -func integerValue(tls *libc.TLS, zArg uintptr) int32 { /* speedtest1.c:210:12: */ +func integerValue(tls *libc.TLS, zArg uintptr) int32 { /* speedtest1.c:212:12: */ var v sqlite3_int64 = int64(0) var i int32 var isNeg int32 = 0 @@ -5006,7 +5056,7 @@ func integerValue(tls *libc.TLS, zArg uintptr) int32 { /* speedtest1.c:210:12: * } } if v > int64(0x7fffffff) { - fatal_error(tls, ts+2153 /* "parameter too la..." */, 0) + fatal_error(tls, ts+2213 /* "parameter too la..." */, 0) } return func() int32 { if isNeg != 0 { @@ -5021,19 +5071,19 @@ var aMult = [9]struct { iMult int32 _ [4]byte }{ - {zSuffix: ts + 2190 /* "KiB" */, iMult: 1024}, - {zSuffix: ts + 2194 /* "MiB" */, iMult: (1024 * 1024)}, - {zSuffix: ts + 2198 /* "GiB" */, iMult: ((1024 * 1024) * 1024)}, - {zSuffix: ts + 2202 /* "KB" */, iMult: 1000}, - {zSuffix: ts + 2205 /* "MB" */, iMult: 1000000}, - {zSuffix: ts + 2208 /* "GB" */, iMult: 1000000000}, - {zSuffix: ts + 2211 /* "K" */, iMult: 1000}, - {zSuffix: ts + 2213 /* "M" */, iMult: 1000000}, - {zSuffix: ts + 2215 /* "G" */, iMult: 1000000000}, -} /* speedtest1.c:212:53 */ + {zSuffix: ts + 2250 /* "KiB" */, iMult: 1024}, + {zSuffix: ts + 2254 /* "MiB" */, iMult: (1024 * 1024)}, + {zSuffix: ts + 2258 /* "GiB" */, iMult: ((1024 * 1024) * 1024)}, + {zSuffix: ts + 2262 /* "KB" */, iMult: 1000}, + {zSuffix: ts + 2265 /* "MB" */, iMult: 1000000}, + {zSuffix: ts + 2268 /* "GB" */, iMult: 1000000000}, + {zSuffix: ts + 2271 /* "K" */, iMult: 1000}, + {zSuffix: ts + 2273 /* "M" */, iMult: 1000000}, + {zSuffix: ts + 2275 /* "G" */, iMult: 1000000000}, +} /* speedtest1.c:214:53 */ // Return the current wall-clock time, in milliseconds -func speedtest1_timestamp(tls *libc.TLS) sqlite3_int64 { /* speedtest1.c:255:15: */ +func speedtest1_timestamp(tls *libc.TLS) sqlite3_int64 { /* speedtest1.c:257:15: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -5053,10 +5103,10 @@ func speedtest1_timestamp(tls *libc.TLS) sqlite3_int64 { /* speedtest1.c:255:15: return *(*sqlite3_int64)(unsafe.Pointer(bp /* t */)) } -var clockVfs uintptr = uintptr(0) /* speedtest1.c:259:22 */ +var clockVfs uintptr = uintptr(0) /* speedtest1.c:261:22 */ // Return a pseudo-random unsigned integer -func speedtest1_random(tls *libc.TLS) uint32 { /* speedtest1.c:277:14: */ +func speedtest1_random(tls *libc.TLS) uint32 { /* speedtest1.c:279:14: */ g.x = ((g.x >> 1) ^ ((uint32(1) + ^(g.x & uint32(1))) & 0xd0000001)) g.y = ((g.y * uint32(1103515245)) + uint32(12345)) return (g.x ^ g.y) @@ -5064,7 +5114,7 @@ func speedtest1_random(tls *libc.TLS) uint32 { /* speedtest1.c:277:14: */ // Map the value in within the range of 1...limit into another // number in a way that is chatic and invertable. -func swizzle(tls *libc.TLS, in uint32, limit uint32) uint32 { /* speedtest1.c:286:10: */ +func swizzle(tls *libc.TLS, in uint32, limit uint32) uint32 { /* speedtest1.c:288:10: */ var out uint32 = uint32(0) for limit != 0 { out = ((out << 1) | (in & uint32(1))) @@ -5075,7 +5125,7 @@ func swizzle(tls *libc.TLS, in uint32, limit uint32) uint32 { /* speedtest1.c:28 } // Round up a number so that it is a power of two minus one -func roundup_allones(tls *libc.TLS, limit uint32) uint32 { /* speedtest1.c:298:10: */ +func roundup_allones(tls *libc.TLS, limit uint32) uint32 { /* speedtest1.c:300:10: */ var m uint32 = uint32(1) for m < limit { m = ((m << 1) + uint32(1)) @@ -5090,7 +5140,7 @@ func roundup_allones(tls *libc.TLS, limit uint32) uint32 { /* speedtest1.c:298:1 // Example: // // speedtest1_numbername(123) -> "one hundred twenty three" -func speedtest1_numbername(tls *libc.TLS, n uint32, zOut uintptr, nOut int32) int32 { /* speedtest1.c:312:5: */ +func speedtest1_numbername(tls *libc.TLS, n uint32, zOut uintptr, nOut int32) int32 { /* speedtest1.c:314:5: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -5098,7 +5148,7 @@ func speedtest1_numbername(tls *libc.TLS, n uint32, zOut uintptr, nOut int32) in if n >= uint32(1000000000) { i = i + (speedtest1_numbername(tls, (n / uint32(1000000000)), (zOut + uintptr(i)), (nOut - i))) - sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2217 /* " billion" */, 0) + sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2277 /* " billion" */, 0) i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i))))) n = (n % uint32(1000000000)) } @@ -5107,7 +5157,7 @@ func speedtest1_numbername(tls *libc.TLS, n uint32, zOut uintptr, nOut int32) in *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ') } i = i + (speedtest1_numbername(tls, (n / uint32(1000000)), (zOut + uintptr(i)), (nOut - i))) - sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2226 /* " million" */, 0) + sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2286 /* " million" */, 0) i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i))))) n = (n % uint32(1000000)) } @@ -5116,7 +5166,7 @@ func speedtest1_numbername(tls *libc.TLS, n uint32, zOut uintptr, nOut int32) in *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ') } i = i + (speedtest1_numbername(tls, (n / uint32(1000)), (zOut + uintptr(i)), (nOut - i))) - sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2235 /* " thousand" */, 0) + sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2295 /* " thousand" */, 0) i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i))))) n = (n % uint32(1000)) } @@ -5124,7 +5174,7 @@ func speedtest1_numbername(tls *libc.TLS, n uint32, zOut uintptr, nOut int32) in if (i != 0) && (i < (nOut - 1)) { *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ') } - sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2245 /* "%s hundred" */, libc.VaList(bp, ones[(n/uint32(100))])) + sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2305 /* "%s hundred" */, libc.VaList(bp, ones[(n/uint32(100))])) i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i))))) n = (n % uint32(100)) } @@ -5132,7 +5182,7 @@ func speedtest1_numbername(tls *libc.TLS, n uint32, zOut uintptr, nOut int32) in if (i != 0) && (i < (nOut - 1)) { *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ') } - sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2256 /* "%s" */, libc.VaList(bp+8, tens[(n/uint32(10))])) + sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2316 /* "%s" */, libc.VaList(bp+8, tens[(n/uint32(10))])) i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i))))) n = (n % uint32(10)) } @@ -5140,27 +5190,27 @@ func speedtest1_numbername(tls *libc.TLS, n uint32, zOut uintptr, nOut int32) in if (i != 0) && (i < (nOut - 1)) { *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ') } - sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2256 /* "%s" */, libc.VaList(bp+16, ones[n])) + sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2316 /* "%s" */, libc.VaList(bp+16, ones[n])) i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i))))) } if i == 0 { - sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2259 /* "zero" */, 0) + sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2319 /* "zero" */, 0) i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i))))) } return i } -var ones = [20]uintptr{ts + 2259 /* "zero" */, ts + 2264 /* "one" */, ts + 2268 /* "two" */, ts + 2272 /* "three" */, ts + 2278 /* "four" */, ts + 2283, /* "five" */ - ts + 2288 /* "six" */, ts + 2292 /* "seven" */, ts + 2298 /* "eight" */, ts + 2304 /* "nine" */, ts + 2309 /* "ten" */, ts + 2313 /* "eleven" */, ts + 2320, /* "twelve" */ - ts + 2327 /* "thirteen" */, ts + 2336 /* "fourteen" */, ts + 2345 /* "fifteen" */, ts + 2353 /* "sixteen" */, ts + 2361, /* "seventeen" */ - ts + 2371 /* "eighteen" */, ts + 2380 /* "nineteen" */} /* speedtest1.c:313:21 */ -var tens = [10]uintptr{ts + 2152 /* "" */, ts + 2309 /* "ten" */, ts + 2389 /* "twenty" */, ts + 2396 /* "thirty" */, ts + 2403, /* "forty" */ - ts + 2409 /* "fifty" */, ts + 2415 /* "sixty" */, ts + 2421 /* "seventy" */, ts + 2429 /* "eighty" */, ts + 2436 /* "ninety" */} /* speedtest1.c:317:21 */ +var ones = [20]uintptr{ts + 2319 /* "zero" */, ts + 2324 /* "one" */, ts + 2328 /* "two" */, ts + 2332 /* "three" */, ts + 2338 /* "four" */, ts + 2343, /* "five" */ + ts + 2348 /* "six" */, ts + 2352 /* "seven" */, ts + 2358 /* "eight" */, ts + 2364 /* "nine" */, ts + 2369 /* "ten" */, ts + 2373 /* "eleven" */, ts + 2380, /* "twelve" */ + ts + 2387 /* "thirteen" */, ts + 2396 /* "fourteen" */, ts + 2405 /* "fifteen" */, ts + 2413 /* "sixteen" */, ts + 2421, /* "seventeen" */ + ts + 2431 /* "eighteen" */, ts + 2440 /* "nineteen" */} /* speedtest1.c:315:21 */ +var tens = [10]uintptr{ts + 2212 /* "" */, ts + 2369 /* "ten" */, ts + 2449 /* "twenty" */, ts + 2456 /* "thirty" */, ts + 2463, /* "forty" */ + ts + 2469 /* "fifty" */, ts + 2475 /* "sixty" */, ts + 2481 /* "seventy" */, ts + 2489 /* "eighty" */, ts + 2496 /* "ninety" */} /* speedtest1.c:319:21 */ // Start a new test case -var zDots = *(*[72]int8)(unsafe.Pointer(ts + 2443 /* "..................." */)) /* speedtest1.c:368:19 */ +var zDots = *(*[72]int8)(unsafe.Pointer(ts + 2503 /* "..................." */)) /* speedtest1.c:370:19 */ -func speedtest1_begin_test(tls *libc.TLS, iTestNum int32, zTestName uintptr, va uintptr) { /* speedtest1.c:370:6: */ +func speedtest1_begin_test(tls *libc.TLS, iTestNum int32, zTestName uintptr, va uintptr) { /* speedtest1.c:372:6: */ bp := tls.Alloc(64) defer tls.Free(64) @@ -5177,9 +5227,9 @@ func speedtest1_begin_test(tls *libc.TLS, iTestNum int32, zTestName uintptr, va n = NAMEWIDTH } if g.bSqlOnly != 0 { - libc.Xprintf(tls, ts+2515 /* "/* %4d - %s%.*s ..." */, libc.VaList(bp, iTestNum, zName, (NAMEWIDTH-n), uintptr(unsafe.Pointer(&zDots)))) + libc.Xprintf(tls, ts+2575 /* "/* %4d - %s%.*s ..." */, libc.VaList(bp, iTestNum, zName, (NAMEWIDTH-n), uintptr(unsafe.Pointer(&zDots)))) } else { - libc.Xprintf(tls, ts+2535 /* "%4d - %s%.*s " */, libc.VaList(bp+32, iTestNum, zName, (NAMEWIDTH-n), uintptr(unsafe.Pointer(&zDots)))) + libc.Xprintf(tls, ts+2595 /* "%4d - %s%.*s " */, libc.VaList(bp+32, iTestNum, zName, (NAMEWIDTH-n), uintptr(unsafe.Pointer(&zDots)))) libc.Xfflush(tls, libc.Xstdout) } sqlite3.Xsqlite3_free(tls, zName) @@ -5190,17 +5240,17 @@ func speedtest1_begin_test(tls *libc.TLS, iTestNum int32, zTestName uintptr, va } // Complete a test case -func speedtest1_end_test(tls *libc.TLS) { /* speedtest1.c:399:6: */ +func speedtest1_end_test(tls *libc.TLS) { /* speedtest1.c:401:6: */ bp := tls.Alloc(16) defer tls.Free(16) var iElapseTime sqlite3_int64 = (speedtest1_timestamp(tls) - g.iStart) if g.doCheckpoint != 0 { - speedtest1_exec(tls, ts+2549 /* "PRAGMA wal_check..." */, 0) + speedtest1_exec(tls, ts+2609 /* "PRAGMA wal_check..." */, 0) } if !(g.bSqlOnly != 0) { *(*sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 24 /* &.iTotal */)) += (iElapseTime) - libc.Xprintf(tls, ts+2572 /* "%4d.%03ds\n" */, libc.VaList(bp, (int32(iElapseTime/int64(1000))), (int32(iElapseTime%int64(1000))))) + libc.Xprintf(tls, ts+2632 /* "%4d.%03ds\n" */, libc.VaList(bp, (int32(iElapseTime/int64(1000))), (int32(iElapseTime%int64(1000))))) } if g.pStmt != 0 { sqlite3.Xsqlite3_finalize(tls, g.pStmt) @@ -5209,31 +5259,31 @@ func speedtest1_end_test(tls *libc.TLS) { /* speedtest1.c:399:6: */ } // Report end of testing -func speedtest1_final(tls *libc.TLS) { /* speedtest1.c:413:6: */ +func speedtest1_final(tls *libc.TLS) { /* speedtest1.c:415:6: */ bp := tls.Alloc(48) defer tls.Free(48) if !(g.bSqlOnly != 0) { - libc.Xprintf(tls, ts+2583 /* " TOTAL%.*s..." */, libc.VaList(bp, (NAMEWIDTH-5), uintptr(unsafe.Pointer(&zDots)), + libc.Xprintf(tls, ts+2643 /* " TOTAL%.*s..." */, libc.VaList(bp, (NAMEWIDTH-5), uintptr(unsafe.Pointer(&zDots)), (int32(g.iTotal/int64(1000))), (int32(g.iTotal%int64(1000))))) } if g.bVerify != 0 { var i int32 - libc.Xprintf(tls, ts+2611 /* "Verification Has..." */, libc.VaList(bp+32, g.nResByte)) - HashUpdate(tls, ts+2636 /* "\n" */, uint32(1)) + libc.Xprintf(tls, ts+2671 /* "Verification Has..." */, libc.VaList(bp+32, g.nResByte)) + HashUpdate(tls, ts+2696 /* "\n" */, uint32(1)) HashFinal(tls) for i = 0; i < 24; i++ { - libc.Xprintf(tls, ts+2638 /* "%02x" */, libc.VaList(bp+40, int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 259 /* &.r */) + uintptr(i)))))) + libc.Xprintf(tls, ts+2698 /* "%02x" */, libc.VaList(bp+40, int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3136 /* &.hash */ + 259 /* &.r */) + uintptr(i)))))) } if (g.hashFile != 0) && (g.hashFile != libc.Xstdout) { libc.Xfclose(tls, g.hashFile) } - libc.Xprintf(tls, ts+2636 /* "\n" */, 0) + libc.Xprintf(tls, ts+2696 /* "\n" */, 0) } } // Print an SQL statement to standard output -func printSql(tls *libc.TLS, zSql uintptr) { /* speedtest1.c:436:13: */ +func printSql(tls *libc.TLS, zSql uintptr) { /* speedtest1.c:438:13: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -5242,27 +5292,27 @@ func printSql(tls *libc.TLS, zSql uintptr) { /* speedtest1.c:436:13: */ n-- } if g.bExplain != 0 { - libc.Xprintf(tls, ts+2643 /* "EXPLAIN " */, 0) + libc.Xprintf(tls, ts+2703 /* "EXPLAIN " */, 0) } - libc.Xprintf(tls, ts+2652 /* "%.*s;\n" */, libc.VaList(bp, n, zSql)) + libc.Xprintf(tls, ts+2712 /* "%.*s;\n" */, libc.VaList(bp, n, zSql)) if (g.bExplain != 0) && - (((sqlite3.Xsqlite3_strglob(tls, ts+2659 /* "CREATE *" */, zSql) == 0) || - (sqlite3.Xsqlite3_strglob(tls, ts+2668 /* "DROP *" */, zSql) == 0)) || - (sqlite3.Xsqlite3_strglob(tls, ts+2675 /* "ALTER *" */, zSql) == 0)) { - libc.Xprintf(tls, ts+2652 /* "%.*s;\n" */, libc.VaList(bp+16, n, zSql)) + (((sqlite3.Xsqlite3_strglob(tls, ts+2719 /* "CREATE *" */, zSql) == 0) || + (sqlite3.Xsqlite3_strglob(tls, ts+2728 /* "DROP *" */, zSql) == 0)) || + (sqlite3.Xsqlite3_strglob(tls, ts+2735 /* "ALTER *" */, zSql) == 0)) { + libc.Xprintf(tls, ts+2712 /* "%.*s;\n" */, libc.VaList(bp+16, n, zSql)) } } // Shrink memory used, if appropriate and if the SQLite version is capable // of doing so. -func speedtest1_shrink_memory(tls *libc.TLS) { /* speedtest1.c:456:6: */ +func speedtest1_shrink_memory(tls *libc.TLS) { /* speedtest1.c:458:6: */ if g.bMemShrink != 0 { sqlite3.Xsqlite3_db_release_memory(tls, g.db) } } // Run SQL -func speedtest1_exec(tls *libc.TLS, zFormat uintptr, va uintptr) { /* speedtest1.c:463:6: */ +func speedtest1_exec(tls *libc.TLS, zFormat uintptr, va uintptr) { /* speedtest1.c:465:6: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -5278,10 +5328,10 @@ func speedtest1_exec(tls *libc.TLS, zFormat uintptr, va uintptr) { /* speedtest1 *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) = uintptr(0) var rc int32 = sqlite3.Xsqlite3_exec(tls, g.db, zSql, uintptr(0), uintptr(0), bp+24 /* &zErrMsg */) if *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) != 0 { - fatal_error(tls, ts+2683 /* "SQL error: %s\n%s..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)), zSql)) + fatal_error(tls, ts+2743 /* "SQL error: %s\n%s..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)), zSql)) } if rc != SQLITE_OK { - fatal_error(tls, ts+2701 /* "exec error: %s\n" */, libc.VaList(bp+16, sqlite3.Xsqlite3_errmsg(tls, g.db))) + fatal_error(tls, ts+2761 /* "exec error: %s\n" */, libc.VaList(bp+16, sqlite3.Xsqlite3_errmsg(tls, g.db))) } } sqlite3.Xsqlite3_free(tls, zSql) @@ -5291,7 +5341,7 @@ func speedtest1_exec(tls *libc.TLS, zFormat uintptr, va uintptr) { /* speedtest1 // Run SQL and return the first column of the first row as a string. The // returned string is obtained from sqlite_malloc() and must be freed by // the caller. -func speedtest1_once(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* speedtest1.c:485:6: */ +func speedtest1_once(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* speedtest1.c:487:6: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -5309,12 +5359,12 @@ func speedtest1_once(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* sp } else { var rc int32 = sqlite3.Xsqlite3_prepare_v2(tls, g.db, zSql, -1, bp+16 /* &pStmt */, uintptr(0)) if rc != 0 { - fatal_error(tls, ts+2717 /* "SQL error: %s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db))) + fatal_error(tls, ts+2777 /* "SQL error: %s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db))) } if sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))) == SQLITE_ROW { var z uintptr = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 0) if z != 0 { - zResult = sqlite3.Xsqlite3_mprintf(tls, ts+2256 /* "%s" */, libc.VaList(bp+8, z)) + zResult = sqlite3.Xsqlite3_mprintf(tls, ts+2316 /* "%s" */, libc.VaList(bp+8, z)) } } sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))) @@ -5325,7 +5375,7 @@ func speedtest1_once(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* sp } // Prepare an SQL statement -func speedtest1_prepare(tls *libc.TLS, zFormat uintptr, va uintptr) { /* speedtest1.c:512:6: */ +func speedtest1_prepare(tls *libc.TLS, zFormat uintptr, va uintptr) { /* speedtest1.c:514:6: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -5344,14 +5394,14 @@ func speedtest1_prepare(tls *libc.TLS, zFormat uintptr, va uintptr) { /* speedte } rc = sqlite3.Xsqlite3_prepare_v2(tls, g.db, zSql, -1, (uintptr(unsafe.Pointer(&g)) + 8 /* &.pStmt */), uintptr(0)) if rc != 0 { - fatal_error(tls, ts+2717 /* "SQL error: %s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db))) + fatal_error(tls, ts+2777 /* "SQL error: %s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db))) } } sqlite3.Xsqlite3_free(tls, zSql) } // Run an SQL statement previously prepared -func speedtest1_run(tls *libc.TLS) { /* speedtest1.c:532:6: */ +func speedtest1_run(tls *libc.TLS) { /* speedtest1.c:534:6: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -5368,7 +5418,7 @@ func speedtest1_run(tls *libc.TLS) { /* speedtest1.c:532:6: */ for i = 0; i < n; i++ { var z uintptr = sqlite3.Xsqlite3_column_text(tls, g.pStmt, i) if z == uintptr(0) { - z = ts + 2732 /* "nil" */ + z = ts + 2792 /* "nil" */ } len = int32(libc.Xstrlen(tls, z)) if g.bVerify != 0 { @@ -5376,7 +5426,7 @@ func speedtest1_run(tls *libc.TLS) { /* speedtest1.c:532:6: */ // var zPrefix [2]uint8 at bp, 2 *(*uint8)(unsafe.Pointer(bp /* &zPrefix[0] */)) = uint8('\n') - *(*uint8)(unsafe.Pointer(bp /* &zPrefix[0] */ + 1)) = uint8(*(*int8)(unsafe.Pointer(ts + 2736 /* "-IFTBN" */ + uintptr(eType)))) + *(*uint8)(unsafe.Pointer(bp /* &zPrefix[0] */ + 1)) = uint8(*(*int8)(unsafe.Pointer(ts + 2796 /* "-IFTBN" */ + uintptr(eType)))) if g.nResByte != 0 { HashUpdate(tls, bp /* &zPrefix[0] */, uint32(2)) } else { @@ -5386,7 +5436,7 @@ func speedtest1_run(tls *libc.TLS) { /* speedtest1.c:532:6: */ // Omit the value of floating-point results from the verification // hash. The only thing we record is the fact that the result was // a floating-point value. - *(*u64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 104 /* &.nResByte */)) += (uint64(2)) + *(*u64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 112 /* &.nResByte */)) += (uint64(2)) } else if eType == SQLITE_BLOB { var nBlob int32 = sqlite3.Xsqlite3_column_bytes(tls, g.pStmt, i) var iBlob int32 @@ -5394,22 +5444,22 @@ func speedtest1_run(tls *libc.TLS) { /* speedtest1.c:532:6: */ var aBlob uintptr = sqlite3.Xsqlite3_column_blob(tls, g.pStmt, i) for iBlob = 0; iBlob < nBlob; iBlob++ { - *(*uint8)(unsafe.Pointer(bp + 2 /* &zChar[0] */)) = uint8(*(*int8)(unsafe.Pointer(ts + 2743 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer(aBlob + uintptr(iBlob)))) >> 4))))) - *(*uint8)(unsafe.Pointer(bp + 2 /* &zChar[0] */ + 1)) = uint8(*(*int8)(unsafe.Pointer(ts + 2743 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer(aBlob + uintptr(iBlob)))) & 15))))) + *(*uint8)(unsafe.Pointer(bp + 2 /* &zChar[0] */)) = uint8(*(*int8)(unsafe.Pointer(ts + 2803 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer(aBlob + uintptr(iBlob)))) >> 4))))) + *(*uint8)(unsafe.Pointer(bp + 2 /* &zChar[0] */ + 1)) = uint8(*(*int8)(unsafe.Pointer(ts + 2803 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer(aBlob + uintptr(iBlob)))) & 15))))) HashUpdate(tls, bp+2 /* &zChar[0] */, uint32(2)) } - *(*u64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 104 /* &.nResByte */)) += (u64((nBlob * 2) + 2)) + *(*u64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 112 /* &.nResByte */)) += (u64((nBlob * 2) + 2)) } else { HashUpdate(tls, z, uint32(len)) - *(*u64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 104 /* &.nResByte */)) += (u64(len + 2)) + *(*u64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 112 /* &.nResByte */)) += (u64(len + 2)) } } if (uint64(g.nResult + len)) < (uint64(unsafe.Sizeof([3000]int8{})) - uint64(2)) { if g.nResult > 0 { - *(*int8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 116 /* &.zResult */) + uintptr(libc.PostIncInt32(&g.nResult, 1)))) = int8(' ') + *(*int8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 124 /* &.zResult */) + uintptr(libc.PostIncInt32(&g.nResult, 1)))) = int8(' ') } - libc.Xmemcpy(tls, ((uintptr(unsafe.Pointer(&g)) + 116 /* &.zResult */) + uintptr(g.nResult)), z, (uint64(len + 1))) - *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 112 /* &.nResult */)) += (len) + libc.Xmemcpy(tls, ((uintptr(unsafe.Pointer(&g)) + 124 /* &.zResult */) + uintptr(g.nResult)), z, (uint64(len + 1))) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 120 /* &.nResult */)) += (len) } } } @@ -5426,7 +5476,7 @@ func speedtest1_run(tls *libc.TLS) { /* speedtest1.c:532:6: */ } // The sqlite3_trace() callback function -func traceCallback(tls *libc.TLS, NotUsed uintptr, zSql uintptr) { /* speedtest1.c:599:13: */ +func traceCallback(tls *libc.TLS, NotUsed uintptr, zSql uintptr) { /* speedtest1.c:601:13: */ bp := tls.Alloc(16) defer tls.Free(16) @@ -5434,17 +5484,17 @@ func traceCallback(tls *libc.TLS, NotUsed uintptr, zSql uintptr) { /* speedtest1 for (n > 0) && ((int32(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1))))) == ';') || ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0)) { n-- } - libc.Xfprintf(tls, libc.Xstderr, ts+2652 /* "%.*s;\n" */, libc.VaList(bp, n, zSql)) + libc.Xfprintf(tls, libc.Xstderr, ts+2712 /* "%.*s;\n" */, libc.VaList(bp, n, zSql)) } // Substitute random() function that gives the same random // sequence on each run, for repeatability. -func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* speedtest1.c:608:13: */ +func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* speedtest1.c:610:13: */ sqlite3.Xsqlite3_result_int64(tls, context, sqlite3_int64(speedtest1_random(tls))) } // Estimate the square root of an integer -func est_square_root(tls *libc.TLS, x int32) int32 { /* speedtest1.c:617:12: */ +func est_square_root(tls *libc.TLS, x int32) int32 { /* speedtest1.c:619:12: */ var y0 int32 = (x / 2) var y1 int32 var n int32 @@ -5459,7 +5509,7 @@ func est_square_root(tls *libc.TLS, x int32) int32 { /* speedtest1.c:617:12: */ } // The main and default testset -func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ +func testset_main(tls *libc.TLS) { /* speedtest1.c:696:6: */ bp := tls.Alloc(2568) defer tls.Free(2568) @@ -5476,11 +5526,11 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sz = libc.AssignInt32(&n, (g.szTest * 500)) *(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */)) = int8(0) maxb = int32(roundup_allones(tls, uint32(sz))) - speedtest1_begin_test(tls, 100, ts+2760 /* "%d INSERTs into ..." */, libc.VaList(bp, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) - speedtest1_exec(tls, ts+2802, /* "CREATE%s TABLE t..." */ + speedtest1_begin_test(tls, 100, ts+2820 /* "%d INSERTs into ..." */, libc.VaList(bp, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) + speedtest1_exec(tls, ts+2862, /* "CREATE%s TABLE z..." */ libc.VaList(bp+8, isTemp(tls, 9), g.zNN, g.zNN, g.zNN)) - speedtest1_prepare(tls, ts+2860 /* "INSERT INTO t1 V..." */, libc.VaList(bp+40, n)) + speedtest1_prepare(tls, ts+2920 /* "INSERT INTO z1 V..." */, libc.VaList(bp+40, n)) for i = 1; i <= n; i++ { x1 = swizzle(tls, uint32(i), uint32(maxb)) speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{}))) @@ -5489,16 +5539,16 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 3, bp+568 /* &zNum[0] */, -1, uintptr(0)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) n = sz - speedtest1_begin_test(tls, 110, ts+2913 /* "%d ordered INSER..." */, libc.VaList(bp+48, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 110, ts+2973 /* "%d ordered INSER..." */, libc.VaList(bp+48, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_exec(tls, - ts+2950, /* "CREATE%s TABLE t..." */ + ts+3010, /* "CREATE%s TABLE z..." */ libc.VaList(bp+56, isTemp(tls, 5), g.zNN, g.zPK, g.zNN, g.zNN, g.zWR)) - speedtest1_prepare(tls, ts+3013 /* "INSERT INTO t2 V..." */, libc.VaList(bp+104, n)) + speedtest1_prepare(tls, ts+3073 /* "INSERT INTO z2 V..." */, libc.VaList(bp+104, n)) for i = 1; i <= n; i++ { x1 = swizzle(tls, uint32(i), uint32(maxb)) speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{}))) @@ -5507,16 +5557,16 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 3, bp+568 /* &zNum[0] */, -1, uintptr(0)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) n = sz - speedtest1_begin_test(tls, 120, ts+3058 /* "%d unordered INS..." */, libc.VaList(bp+112, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 120, ts+3118 /* "%d unordered INS..." */, libc.VaList(bp+112, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_exec(tls, - ts+3097, /* "CREATE%s TABLE t..." */ + ts+3157, /* "CREATE%s TABLE t..." */ libc.VaList(bp+120, isTemp(tls, 3), g.zNN, g.zPK, g.zNN, g.zNN, g.zWR)) - speedtest1_prepare(tls, ts+3160 /* "INSERT INTO t3 V..." */, libc.VaList(bp+168, n)) + speedtest1_prepare(tls, ts+3220 /* "INSERT INTO t3 V..." */, libc.VaList(bp+168, n)) for i = 1; i <= n; i++ { x1 = swizzle(tls, uint32(i), uint32(maxb)) speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{}))) @@ -5525,15 +5575,15 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 3, bp+568 /* &zNum[0] */, -1, uintptr(0)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) n = 25 - speedtest1_begin_test(tls, 130, ts+3205 /* "%d SELECTS, nume..." */, libc.VaList(bp+176, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 130, ts+3265 /* "%d SELECTS, nume..." */, libc.VaList(bp+176, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_prepare(tls, - ts+3244 /* "SELECT count(*),..." */, libc.VaList(bp+184, n)) + ts+3304 /* "SELECT count(*),..." */, libc.VaList(bp+184, n)) for i = 1; i <= n; i++ { if ((i - 1) % g.nRepeat) == 0 { x1 = (speedtest1_random(tls) % uint32(maxb)) @@ -5543,15 +5593,15 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) n = 10 - speedtest1_begin_test(tls, 140, ts+3349 /* "%d SELECTS, LIKE..." */, libc.VaList(bp+192, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 140, ts+3409 /* "%d SELECTS, LIKE..." */, libc.VaList(bp+192, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_prepare(tls, - ts+3377 /* "SELECT count(*),..." */, libc.VaList(bp+200, n)) + ts+3437 /* "SELECT count(*),..." */, libc.VaList(bp+200, n)) for i = 1; i <= n; i++ { if ((i - 1) % g.nRepeat) == 0 { x1 = (speedtest1_random(tls) % uint32(maxb)) @@ -5563,15 +5613,15 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, (len + 1), uintptr(0)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) n = 10 - speedtest1_begin_test(tls, 142, ts+3472 /* "%d SELECTS w/ORD..." */, libc.VaList(bp+208, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 142, ts+3532 /* "%d SELECTS w/ORD..." */, libc.VaList(bp+208, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_prepare(tls, - ts+3505 /* "SELECT a, b, c F..." */, libc.VaList(bp+216, n)) + ts+3565 /* "SELECT a, b, c F..." */, libc.VaList(bp+216, n)) for i = 1; i <= n; i++ { if ((i - 1) % g.nRepeat) == 0 { x1 = (speedtest1_random(tls) % uint32(maxb)) @@ -5583,15 +5633,15 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, (len + 1), uintptr(0)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) n = 10 // g.szTest/5; - speedtest1_begin_test(tls, 145, ts+3569 /* "%d SELECTS w/ORD..." */, libc.VaList(bp+224, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 145, ts+3629 /* "%d SELECTS w/ORD..." */, libc.VaList(bp+224, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_prepare(tls, - ts+3612 /* "SELECT a, b, c F..." */, libc.VaList(bp+232, n)) + ts+3672 /* "SELECT a, b, c F..." */, libc.VaList(bp+232, n)) for i = 1; i <= n; i++ { if ((i - 1) % g.nRepeat) == 0 { x1 = (speedtest1_random(tls) % uint32(maxb)) @@ -5603,25 +5653,25 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, (len + 1), uintptr(0)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 150, ts+3685 /* "CREATE INDEX fiv..." */, 0) - speedtest1_exec(tls, ts+3709 /* "BEGIN;" */, 0) - speedtest1_exec(tls, ts+3716 /* "CREATE UNIQUE IN..." */, 0) - speedtest1_exec(tls, ts+3750 /* "CREATE INDEX t1c..." */, 0) - speedtest1_exec(tls, ts+3777 /* "CREATE UNIQUE IN..." */, 0) - speedtest1_exec(tls, ts+3811 /* "CREATE INDEX t2c..." */, 0) - speedtest1_exec(tls, ts+3843 /* "CREATE INDEX t3b..." */, 0) - speedtest1_exec(tls, ts+3873 /* "COMMIT;" */, 0) + speedtest1_begin_test(tls, 150, ts+3745 /* "CREATE INDEX fiv..." */, 0) + speedtest1_exec(tls, ts+3769 /* "BEGIN;" */, 0) + speedtest1_exec(tls, ts+3776 /* "CREATE UNIQUE IN..." */, 0) + speedtest1_exec(tls, ts+3810 /* "CREATE INDEX t1c..." */, 0) + speedtest1_exec(tls, ts+3837 /* "CREATE UNIQUE IN..." */, 0) + speedtest1_exec(tls, ts+3871 /* "CREATE INDEX t2c..." */, 0) + speedtest1_exec(tls, ts+3903 /* "CREATE INDEX t3b..." */, 0) + speedtest1_exec(tls, ts+3933 /* "COMMIT;" */, 0) speedtest1_end_test(tls) n = (sz / 5) - speedtest1_begin_test(tls, 160, ts+3881 /* "%d SELECTS, nume..." */, libc.VaList(bp+240, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 160, ts+3941 /* "%d SELECTS, nume..." */, libc.VaList(bp+240, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_prepare(tls, - ts+3918 /* "SELECT count(*),..." */, libc.VaList(bp+248, n)) + ts+3978 /* "SELECT count(*),..." */, libc.VaList(bp+248, n)) for i = 1; i <= n; i++ { if ((i - 1) % g.nRepeat) == 0 { x1 = (speedtest1_random(tls) % uint32(maxb)) @@ -5631,15 +5681,15 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) n = (sz / 5) - speedtest1_begin_test(tls, 161, ts+4023 /* "%d SELECTS, nume..." */, libc.VaList(bp+256, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 161, ts+4083 /* "%d SELECTS, nume..." */, libc.VaList(bp+256, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_prepare(tls, - ts+4055 /* "SELECT count(*),..." */, libc.VaList(bp+264, n)) + ts+4115 /* "SELECT count(*),..." */, libc.VaList(bp+264, n)) for i = 1; i <= n; i++ { if ((i - 1) % g.nRepeat) == 0 { x1 = (speedtest1_random(tls) % uint32(maxb)) @@ -5649,15 +5699,15 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) n = (sz / 5) - speedtest1_begin_test(tls, 170, ts+4160 /* "%d SELECTS, text..." */, libc.VaList(bp+272, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 170, ts+4220 /* "%d SELECTS, text..." */, libc.VaList(bp+272, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_prepare(tls, - ts+4194 /* "SELECT count(*),..." */, libc.VaList(bp+280, n)) + ts+4254 /* "SELECT count(*),..." */, libc.VaList(bp+280, n)) for i = 1; i <= n; i++ { if ((i - 1) % g.nRepeat) == 0 { x1 = swizzle(tls, uint32(i), uint32(maxb)) @@ -5666,42 +5716,42 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, len, uintptr(0)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) n = sz - speedtest1_begin_test(tls, 180, ts+4306 /* "%d INSERTS with ..." */, libc.VaList(bp+288, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 180, ts+4366 /* "%d INSERTS with ..." */, libc.VaList(bp+288, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_exec(tls, - ts+4336, /* "CREATE%s TABLE t..." */ + ts+4396, /* "CREATE%s TABLE t..." */ libc.VaList(bp+296, isTemp(tls, 1), g.zNN, g.zPK, g.zNN, g.zNN, g.zWR)) - speedtest1_exec(tls, ts+4407 /* "CREATE INDEX t4b..." */, 0) - speedtest1_exec(tls, ts+4433 /* "CREATE INDEX t4c..." */, 0) - speedtest1_exec(tls, ts+4459 /* "INSERT INTO t4 S..." */, 0) - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+4467 /* "CREATE INDEX t4b..." */, 0) + speedtest1_exec(tls, ts+4493 /* "CREATE INDEX t4c..." */, 0) + speedtest1_exec(tls, ts+4519 /* "INSERT INTO t4 S..." */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) n = sz - speedtest1_begin_test(tls, 190, ts+4491 /* "DELETE and REFIL..." */, libc.VaList(bp+344, n)) - speedtest1_exec(tls, ts+4519 /* "DELETE FROM t2;" */, 0) - speedtest1_exec(tls, ts+4535 /* "INSERT INTO t2 S..." */, 0) + speedtest1_begin_test(tls, 190, ts+4551 /* "DELETE and REFIL..." */, libc.VaList(bp+344, n)) + speedtest1_exec(tls, ts+4579 /* "DELETE FROM z2;" */, 0) + speedtest1_exec(tls, ts+4595 /* "INSERT INTO z2 S..." */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 200, ts+4568 /* "VACUUM" */, 0) - speedtest1_exec(tls, ts+4568 /* "VACUUM" */, 0) + speedtest1_begin_test(tls, 200, ts+4628 /* "VACUUM" */, 0) + speedtest1_exec(tls, ts+4628 /* "VACUUM" */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 210, ts+4575 /* "ALTER TABLE ADD ..." */, 0) - speedtest1_exec(tls, ts+4609 /* "ALTER TABLE t2 A..." */, 0) - speedtest1_exec(tls, ts+4649 /* "SELECT sum(d) FR..." */, 0) + speedtest1_begin_test(tls, 210, ts+4635 /* "ALTER TABLE ADD ..." */, 0) + speedtest1_exec(tls, ts+4669 /* "ALTER TABLE z2 A..." */, 0) + speedtest1_exec(tls, ts+4709 /* "SELECT sum(d) FR..." */, 0) speedtest1_end_test(tls) n = (sz / 5) - speedtest1_begin_test(tls, 230, ts+4671 /* "%d UPDATES, nume..." */, libc.VaList(bp+352, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 230, ts+4731 /* "%d UPDATES, nume..." */, libc.VaList(bp+352, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_prepare(tls, - ts+4708 /* "UPDATE t2 SET d=..." */, libc.VaList(bp+360, n)) + ts+4768 /* "UPDATE z2 SET d=..." */, libc.VaList(bp+360, n)) for i = 1; i <= n; i++ { x1 = (speedtest1_random(tls) % uint32(maxb)) x2 = (((speedtest1_random(tls) % uint32(10)) + (uint32(sz / 5000))) + x1) @@ -5709,35 +5759,35 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) n = sz - speedtest1_begin_test(tls, 240, ts+4767 /* "%d UPDATES of in..." */, libc.VaList(bp+368, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 240, ts+4827 /* "%d UPDATES of in..." */, libc.VaList(bp+368, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_prepare(tls, - ts+4797 /* "UPDATE t2 SET d=..." */, libc.VaList(bp+376, n)) + ts+4857 /* "UPDATE z2 SET d=..." */, libc.VaList(bp+376, n)) for i = 1; i <= n; i++ { x1 = ((speedtest1_random(tls) % uint32(sz)) + uint32(1)) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 250, ts+4841 /* "One big UPDATE o..." */, libc.VaList(bp+384, sz)) - speedtest1_exec(tls, ts+4882 /* "UPDATE t2 SET d=..." */, 0) + speedtest1_begin_test(tls, 250, ts+4901 /* "One big UPDATE o..." */, libc.VaList(bp+384, sz)) + speedtest1_exec(tls, ts+4942 /* "UPDATE z2 SET d=..." */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 260, ts+4902 /* "Query added colu..." */, 0) - speedtest1_exec(tls, ts+4649 /* "SELECT sum(d) FR..." */, 0) + speedtest1_begin_test(tls, 260, ts+4962 /* "Query added colu..." */, 0) + speedtest1_exec(tls, ts+4709 /* "SELECT sum(d) FR..." */, 0) speedtest1_end_test(tls) n = (sz / 5) - speedtest1_begin_test(tls, 270, ts+4935 /* "%d DELETEs, nume..." */, libc.VaList(bp+392, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 270, ts+4995 /* "%d DELETEs, nume..." */, libc.VaList(bp+392, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_prepare(tls, - ts+4972 /* "DELETE FROM t2 W..." */, libc.VaList(bp+400, n)) + ts+5032 /* "DELETE FROM z2 W..." */, libc.VaList(bp+400, n)) for i = 1; i <= n; i++ { x1 = ((speedtest1_random(tls) % uint32(maxb)) + uint32(1)) x2 = (((speedtest1_random(tls) % uint32(10)) + (uint32(sz / 5000))) + x1) @@ -5745,41 +5795,41 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) n = sz - speedtest1_begin_test(tls, 280, ts+5026 /* "%d DELETEs of in..." */, libc.VaList(bp+408, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 280, ts+5086 /* "%d DELETEs of in..." */, libc.VaList(bp+408, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_prepare(tls, - ts+5056 /* "DELETE FROM t3 W..." */, libc.VaList(bp+416, n)) + ts+5116 /* "DELETE FROM t3 W..." */, libc.VaList(bp+416, n)) for i = 1; i <= n; i++ { x1 = ((speedtest1_random(tls) % uint32(sz)) + uint32(1)) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 290, ts+5095 /* "Refill two %d-ro..." */, libc.VaList(bp+424, sz)) - speedtest1_exec(tls, ts+5134 /* "REPLACE INTO t2(..." */, 0) - speedtest1_exec(tls, ts+5178 /* "REPLACE INTO t3(..." */, 0) + speedtest1_begin_test(tls, 290, ts+5155 /* "Refill two %d-ro..." */, libc.VaList(bp+424, sz)) + speedtest1_exec(tls, ts+5194 /* "REPLACE INTO z2(..." */, 0) + speedtest1_exec(tls, ts+5238 /* "REPLACE INTO t3(..." */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 300, ts+5222 /* "Refill a %d-row ..." */, libc.VaList(bp+432, sz)) - speedtest1_exec(tls, ts+4519 /* "DELETE FROM t2;" */, 0) + speedtest1_begin_test(tls, 300, ts+5282 /* "Refill a %d-row ..." */, libc.VaList(bp+432, sz)) + speedtest1_exec(tls, ts+4579 /* "DELETE FROM z2;" */, 0) speedtest1_exec(tls, - ts+5263 /* "INSERT INTO t2(a..." */, 0) + ts+5323 /* "INSERT INTO z2(a..." */, 0) speedtest1_exec(tls, - ts+5328 /* "INSERT INTO t2(a..." */, 0) + ts+5388 /* "INSERT INTO z2(a..." */, 0) speedtest1_end_test(tls) n = (sz / 5) - speedtest1_begin_test(tls, 310, ts+5393 /* "%d four-ways joi..." */, libc.VaList(bp+440, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) + speedtest1_begin_test(tls, 310, ts+5453 /* "%d four-ways joi..." */, libc.VaList(bp+440, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) speedtest1_prepare(tls, - ts+5412 /* "SELECT t1.c FROM..." */, 0) + ts+5472 /* "SELECT z1.c FROM..." */, 0) for i = 1; i <= n; i++ { x1 = ((speedtest1_random(tls) % uint32(sz)) + uint32(1)) x2 = (((speedtest1_random(tls) % uint32(10)) + x1) + uint32(4)) @@ -5787,13 +5837,13 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 320, ts+5525 /* "subquery in resu..." */, libc.VaList(bp+448, n)) + speedtest1_begin_test(tls, 320, ts+5585 /* "subquery in resu..." */, libc.VaList(bp+448, n)) speedtest1_prepare(tls, - ts+5548 /* "SELECT sum(a), m..." */, 0) + ts+5608 /* "SELECT sum(a), m..." */, 0) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (est_square_root(tls, g.szTest) * 50)) speedtest1_run(tls) speedtest1_end_test(tls) @@ -5801,11 +5851,11 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sz = libc.AssignInt32(&n, (g.szTest * 700)) *(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */)) = int8(0) maxb = int32(roundup_allones(tls, (uint32(sz / 3)))) - speedtest1_begin_test(tls, 400, ts+5666 /* "%d REPLACE ops o..." */, libc.VaList(bp+456, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) - speedtest1_exec(tls, ts+5691, /* "CREATE%s TABLE t..." */ + speedtest1_begin_test(tls, 400, ts+5726 /* "%d REPLACE ops o..." */, libc.VaList(bp+456, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) + speedtest1_exec(tls, ts+5751, /* "CREATE%s TABLE t..." */ libc.VaList(bp+464, isTemp(tls, 9), g.zNN)) - speedtest1_prepare(tls, ts+5739 /* "REPLACE INTO t5 ..." */, libc.VaList(bp+480, n)) + speedtest1_prepare(tls, ts+5799 /* "REPLACE INTO t5 ..." */, libc.VaList(bp+480, n)) for i = 1; i <= n; i++ { x1 = swizzle(tls, uint32(i), uint32(maxb)) speedtest1_numbername(tls, uint32(i), bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{}))) @@ -5813,10 +5863,10 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 2, bp+568 /* &zNum[0] */, -1, uintptr(0)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 410, ts+5783 /* "%d SELECTS on an..." */, libc.VaList(bp+488, n)) - speedtest1_prepare(tls, ts+5804 /* "SELECT b FROM t5..." */, libc.VaList(bp+496, n)) + speedtest1_begin_test(tls, 410, ts+5843 /* "%d SELECTS on an..." */, libc.VaList(bp+488, n)) + speedtest1_prepare(tls, ts+5864 /* "SELECT b FROM t5..." */, libc.VaList(bp+496, n)) for i = 1; i <= n; i++ { x1 = swizzle(tls, uint32(i), uint32(maxb)) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(sqlite3_int64(x1))) @@ -5827,17 +5877,17 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sz = libc.AssignInt32(&n, (g.szTest * 700)) *(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */)) = int8(0) maxb = int32(roundup_allones(tls, (uint32(sz / 3)))) - speedtest1_begin_test(tls, 500, ts+5846 /* "%d REPLACE on TE..." */, libc.VaList(bp+504, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) - speedtest1_exec(tls, ts+5868, /* "CREATE%s TABLE t..." */ + speedtest1_begin_test(tls, 500, ts+5906 /* "%d REPLACE on TE..." */, libc.VaList(bp+504, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) + speedtest1_exec(tls, ts+5928, /* "CREATE%s TABLE t..." */ libc.VaList(bp+512, isTemp(tls, 9), g.zNN, func() uintptr { if sqlite3.Xsqlite3_libversion_number(tls) >= 3008002 { - return ts + 5915 /* "WITHOUT ROWID" */ + return ts + 5975 /* "WITHOUT ROWID" */ } - return ts + 2152 /* "" */ + return ts + 2212 /* "" */ }())) - speedtest1_prepare(tls, ts+5929 /* "REPLACE INTO t6 ..." */, libc.VaList(bp+536, n)) + speedtest1_prepare(tls, ts+5989 /* "REPLACE INTO t6 ..." */, libc.VaList(bp+536, n)) for i = 1; i <= n; i++ { x1 = swizzle(tls, uint32(i), uint32(maxb)) speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{}))) @@ -5845,10 +5895,10 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, -1, uintptr(0)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 510, ts+5973 /* "%d SELECTS on a ..." */, libc.VaList(bp+544, n)) - speedtest1_prepare(tls, ts+5997 /* "SELECT b FROM t6..." */, libc.VaList(bp+552, n)) + speedtest1_begin_test(tls, 510, ts+6033 /* "%d SELECTS on a ..." */, libc.VaList(bp+544, n)) + speedtest1_prepare(tls, ts+6057 /* "SELECT b FROM t6..." */, libc.VaList(bp+552, n)) for i = 1; i <= n; i++ { x1 = swizzle(tls, uint32(i), uint32(maxb)) speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{}))) @@ -5856,23 +5906,23 @@ func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */ speedtest1_run(tls) } speedtest1_end_test(tls) - speedtest1_begin_test(tls, 520, ts+6039 /* "%d SELECT DISTIN..." */, libc.VaList(bp+560, n)) - speedtest1_exec(tls, ts+6058 /* "SELECT DISTINCT ..." */, 0) - speedtest1_exec(tls, ts+6085 /* "SELECT DISTINCT ..." */, 0) + speedtest1_begin_test(tls, 520, ts+6099 /* "%d SELECT DISTIN..." */, libc.VaList(bp+560, n)) + speedtest1_exec(tls, ts+6118 /* "SELECT DISTINCT ..." */, 0) + speedtest1_exec(tls, ts+6145 /* "SELECT DISTINCT ..." */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 980, ts+6112 /* "PRAGMA integrity..." */, 0) - speedtest1_exec(tls, ts+6112 /* "PRAGMA integrity..." */, 0) + speedtest1_begin_test(tls, 980, ts+6172 /* "PRAGMA integrity..." */, 0) + speedtest1_exec(tls, ts+6172 /* "PRAGMA integrity..." */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 990, ts+6135 /* "ANALYZE" */, 0) - speedtest1_exec(tls, ts+6135 /* "ANALYZE" */, 0) + speedtest1_begin_test(tls, 990, ts+6195 /* "ANALYZE" */, 0) + speedtest1_exec(tls, ts+6195 /* "ANALYZE" */, 0) speedtest1_end_test(tls) } // A testset for common table expressions. This exercises code // for views, subqueries, co-routines, etc. -func testset_cte(tls *libc.TLS) { /* speedtest1.c:1144:6: */ +func testset_cte(tls *libc.TLS) { /* speedtest1.c:1146:6: */ bp := tls.Alloc(32) defer tls.Free(32) @@ -5887,37 +5937,37 @@ func testset_cte(tls *libc.TLS) { /* speedtest1.c:1144:6: */ } else { zPuz = azPuzzle[2] } - speedtest1_begin_test(tls, 100, ts+6143 /* "Sudoku with recu..." */, 0) + speedtest1_begin_test(tls, 100, ts+6203 /* "Sudoku with recu..." */, 0) speedtest1_prepare(tls, - ts+6174 /* "WITH RECURSIVE\n ..." */, 0) + ts+6234 /* "WITH RECURSIVE\n ..." */, 0) sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, zPuz, -1, uintptr(0)) speedtest1_run(tls) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 200, ts+6978 /* "Sudoku with VALU..." */, 0) + speedtest1_begin_test(tls, 200, ts+7038 /* "Sudoku with VALU..." */, 0) speedtest1_prepare(tls, - ts+7006 /* "WITH RECURSIVE\n ..." */, 0) + ts+7066 /* "WITH RECURSIVE\n ..." */, 0) sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, zPuz, -1, uintptr(0)) speedtest1_run(tls) speedtest1_end_test(tls) rSpacing = (5.0 / float64(g.szTest)) - speedtest1_begin_test(tls, 300, ts+7818 /* "Mandelbrot Set w..." */, libc.VaList(bp, rSpacing)) + speedtest1_begin_test(tls, 300, ts+7878 /* "Mandelbrot Set w..." */, libc.VaList(bp, rSpacing)) speedtest1_prepare(tls, - ts+7849 /* "WITH RECURSIVE \n..." */, 0) + ts+7909 /* "WITH RECURSIVE \n..." */, 0) sqlite3.Xsqlite3_bind_double(tls, g.pStmt, 1, (rSpacing * .05)) sqlite3.Xsqlite3_bind_double(tls, g.pStmt, 2, rSpacing) speedtest1_run(tls) speedtest1_end_test(tls) nElem = (10000 * g.szTest) - speedtest1_begin_test(tls, 400, ts+8445 /* "EXCEPT operator ..." */, libc.VaList(bp+8, nElem)) + speedtest1_begin_test(tls, 400, ts+8505 /* "EXCEPT operator ..." */, libc.VaList(bp+8, nElem)) speedtest1_prepare(tls, - ts+8482, /* "WITH RECURSIVE \n..." */ + ts+8542, /* "WITH RECURSIVE \n..." */ libc.VaList(bp+16, nElem, nElem)) speedtest1_run(tls) speedtest1_end_test(tls) @@ -5926,19 +5976,19 @@ func testset_cte(tls *libc.TLS) { /* speedtest1.c:1144:6: */ var azPuzzle = [3]uintptr{ // Easy - ts + 8713, /* "534...9..67.195...." */ + ts + 8773, /* "534...9..67.195...." */ // Medium - ts + 8795, /* "53....9..6..195...." */ + ts + 8855, /* "53....9..6..195...." */ // Hard - ts + 8877, /* "53.......6..195...." */ -} /* speedtest1.c:1145:21 */ + ts + 8937, /* "53.......6..195...." */ +} /* speedtest1.c:1147:21 */ // Compute a pseudo-random floating point ascii number. -func speedtest1_random_ascii_fp(tls *libc.TLS, zFP uintptr) { /* speedtest1.c:1297:6: */ +func speedtest1_random_ascii_fp(tls *libc.TLS, zFP uintptr) { /* speedtest1.c:1299:6: */ bp := tls.Alloc(24) defer tls.Free(24) @@ -5950,11 +6000,11 @@ func speedtest1_random_ascii_fp(tls *libc.TLS, zFP uintptr) { /* speedtest1.c:12 z = -z } y = y / (10) - sqlite3.Xsqlite3_snprintf(tls, 100, zFP, ts+8959 /* "%d.%de%d" */, libc.VaList(bp, y, z, (x%200))) + sqlite3.Xsqlite3_snprintf(tls, 100, zFP, ts+9019 /* "%d.%de%d" */, libc.VaList(bp, y, z, (x%200))) } // A testset for floating-point numbers. -func testset_fp(tls *libc.TLS) { /* speedtest1.c:1310:6: */ +func testset_fp(tls *libc.TLS) { /* speedtest1.c:1312:6: */ bp := tls.Alloc(272) defer tls.Free(272) @@ -5965,11 +6015,11 @@ func testset_fp(tls *libc.TLS) { /* speedtest1.c:1310:6: */ // var zFP2 [100]int8 at bp+172, 100 n = (g.szTest * 5000) - speedtest1_begin_test(tls, 100, ts+8968 /* "Fill a table wit..." */, libc.VaList(bp, (n*2))) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) - speedtest1_exec(tls, ts+8999, /* "CREATE%s TABLE t..." */ + speedtest1_begin_test(tls, 100, ts+9028 /* "Fill a table wit..." */, libc.VaList(bp, (n*2))) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) + speedtest1_exec(tls, ts+9059, /* "CREATE%s TABLE z..." */ libc.VaList(bp+8, isTemp(tls, 1), g.zNN, g.zNN)) - speedtest1_prepare(tls, ts+9040 /* "INSERT INTO t1 V..." */, libc.VaList(bp+32, n)) + speedtest1_prepare(tls, ts+9100 /* "INSERT INTO z1 V..." */, libc.VaList(bp+32, n)) for i = 1; i <= n; i++ { speedtest1_random_ascii_fp(tls, bp+72 /* &zFP1[0] */) speedtest1_random_ascii_fp(tls, bp+172 /* &zFP2[0] */) @@ -5977,12 +6027,12 @@ func testset_fp(tls *libc.TLS) { /* speedtest1.c:1310:6: */ sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 2, bp+172 /* &zFP2[0] */, -1, uintptr(0)) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) n = ((g.szTest / 25) + 2) - speedtest1_begin_test(tls, 110, ts+9082 /* "%d range queries" */, libc.VaList(bp+40, n)) - speedtest1_prepare(tls, ts+9099 /* "SELECT sum(b) FR..." */, 0) + speedtest1_begin_test(tls, 110, ts+9142 /* "%d range queries" */, libc.VaList(bp+40, n)) + speedtest1_prepare(tls, ts+9159 /* "SELECT sum(b) FR..." */, 0) for i = 1; i <= n; i++ { speedtest1_random_ascii_fp(tls, bp+72 /* &zFP1[0] */) speedtest1_random_ascii_fp(tls, bp+172 /* &zFP2[0] */) @@ -5992,17 +6042,17 @@ func testset_fp(tls *libc.TLS) { /* speedtest1.c:1310:6: */ } speedtest1_end_test(tls) - speedtest1_begin_test(tls, 120, ts+9147 /* "CREATE INDEX thr..." */, 0) - speedtest1_exec(tls, ts+3709 /* "BEGIN;" */, 0) - speedtest1_exec(tls, ts+9172 /* "CREATE INDEX t1a..." */, 0) - speedtest1_exec(tls, ts+9199 /* "CREATE INDEX t1b..." */, 0) - speedtest1_exec(tls, ts+9226 /* "CREATE INDEX t1a..." */, 0) - speedtest1_exec(tls, ts+3873 /* "COMMIT;" */, 0) + speedtest1_begin_test(tls, 120, ts+9207 /* "CREATE INDEX thr..." */, 0) + speedtest1_exec(tls, ts+3769 /* "BEGIN;" */, 0) + speedtest1_exec(tls, ts+9232 /* "CREATE INDEX t1a..." */, 0) + speedtest1_exec(tls, ts+9259 /* "CREATE INDEX t1b..." */, 0) + speedtest1_exec(tls, ts+9286 /* "CREATE INDEX t1a..." */, 0) + speedtest1_exec(tls, ts+3933 /* "COMMIT;" */, 0) speedtest1_end_test(tls) n = ((g.szTest / 3) + 2) - speedtest1_begin_test(tls, 130, ts+9256 /* "%d indexed range..." */, libc.VaList(bp+48, n)) - speedtest1_prepare(tls, ts+9099 /* "SELECT sum(b) FR..." */, 0) + speedtest1_begin_test(tls, 130, ts+9316 /* "%d indexed range..." */, libc.VaList(bp+48, n)) + speedtest1_prepare(tls, ts+9159 /* "SELECT sum(b) FR..." */, 0) for i = 1; i <= n; i++ { speedtest1_random_ascii_fp(tls, bp+72 /* &zFP1[0] */) speedtest1_random_ascii_fp(tls, bp+172 /* &zFP2[0] */) @@ -6013,21 +6063,21 @@ func testset_fp(tls *libc.TLS) { /* speedtest1.c:1310:6: */ speedtest1_end_test(tls) n = (g.szTest * 5000) - speedtest1_begin_test(tls, 140, ts+9281 /* "%d calls to roun..." */, libc.VaList(bp+56, n)) - speedtest1_exec(tls, ts+9301 /* "SELECT sum(round..." */, 0) + speedtest1_begin_test(tls, 140, ts+9341 /* "%d calls to roun..." */, libc.VaList(bp+56, n)) + speedtest1_exec(tls, ts+9361 /* "SELECT sum(round..." */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 150, ts+9344 /* "%d printf() call..." */, libc.VaList(bp+64, (n*4))) + speedtest1_begin_test(tls, 150, ts+9404 /* "%d printf() call..." */, libc.VaList(bp+64, (n*4))) speedtest1_exec(tls, - ts+9362 /* "WITH c(fmt) AS (..." */, 0) + ts+9422 /* "WITH c(fmt) AS (..." */, 0) speedtest1_end_test(tls) } // Generate two numbers between 1 and mx. The first number is less than // the second. Usually the numbers are near each other but can sometimes // be far apart. -func twoCoords(tls *libc.TLS, p1 int32, p2 int32, mx uint32, pX0 uintptr, pX1 uintptr) { /* speedtest1.c:1383:13: */ +func twoCoords(tls *libc.TLS, p1 int32, p2 int32, mx uint32, pX0 uintptr, pX1 uintptr) { /* speedtest1.c:1385:13: */ var d uint32 var x0 uint32 var x1 uint32 @@ -6056,13 +6106,13 @@ func twoCoords(tls *libc.TLS, p1 int32, p2 int32, mx uint32, pX0 uintptr, pX1 ui // Is the same as saying: // // SELECT count(*) FROM rt1 WHERE y1>=10 AND y0<=20; -func xsliceGeometryCallback(tls *libc.TLS, p uintptr, nCoord int32, aCoord uintptr, pRes uintptr) int32 { /* speedtest1.c:1412:12: */ +func xsliceGeometryCallback(tls *libc.TLS, p uintptr, nCoord int32, aCoord uintptr, pRes uintptr) int32 { /* speedtest1.c:1414:12: */ *(*int32)(unsafe.Pointer(pRes)) = (libc.Bool32((*(*float64)(unsafe.Pointer(aCoord + 3*8)) >= *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).aParam))) && (*(*float64)(unsafe.Pointer(aCoord + 2*8)) <= *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).aParam + 1*8))))) return SQLITE_OK } // A testset for the R-Tree virtual table -func testset_rtree(tls *libc.TLS, p1 int32, p2 int32) { /* speedtest1.c:1427:6: */ +func testset_rtree(tls *libc.TLS, p1 int32, p2 int32) { /* speedtest1.c:1429:6: */ bp := tls.Alloc(224) defer tls.Free(224) @@ -6087,11 +6137,11 @@ func testset_rtree(tls *libc.TLS, p1 int32, p2 int32) { /* speedtest1.c:1427:6: mxCoord = uint32(15000) mxRowid = libc.AssignUint32(&n, (uint32(g.szTest * 500))) - speedtest1_begin_test(tls, 100, ts+9457 /* "%d INSERTs into ..." */, libc.VaList(bp, n)) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) - speedtest1_exec(tls, ts+9483 /* "CREATE VIRTUAL T..." */, 0) + speedtest1_begin_test(tls, 100, ts+9517 /* "%d INSERTs into ..." */, libc.VaList(bp, n)) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) + speedtest1_exec(tls, ts+9543 /* "CREATE VIRTUAL T..." */, 0) speedtest1_prepare(tls, - ts+9542 /* "INSERT INTO rt1(..." */, 0) + ts+9602 /* "INSERT INTO rt1(..." */, 0) for i = uint32(1); i <= n; i++ { twoCoords(tls, p1, p2, mxCoord, bp+200 /* &x0 */, bp+204 /* &x1 */) twoCoords(tls, p1, p2, mxCoord, bp+208 /* &y0 */, bp+212 /* &y1 */) @@ -6105,106 +6155,106 @@ func testset_rtree(tls *libc.TLS, p1 int32, p2 int32) { /* speedtest1.c:1427:6: sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 7, int32(*(*uint32)(unsafe.Pointer(bp + 220 /* z1 */)))) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 101, ts+9608 /* "Copy from rtree ..." */, 0) - speedtest1_exec(tls, ts+9643 /* "CREATE TABLE t1(..." */, 0) - speedtest1_exec(tls, ts+9701 /* "INSERT INTO t1 S..." */, 0) + speedtest1_begin_test(tls, 101, ts+9668 /* "Copy from rtree ..." */, 0) + speedtest1_exec(tls, ts+9703 /* "CREATE TABLE z1(..." */, 0) + speedtest1_exec(tls, ts+9761 /* "INSERT INTO z1 S..." */, 0) speedtest1_end_test(tls) n = (uint32(g.szTest * 200)) - speedtest1_begin_test(tls, 110, ts+9734 /* "%d one-dimension..." */, libc.VaList(bp+8, n)) - speedtest1_prepare(tls, ts+9777 /* "SELECT count(*) ..." */, 0) + speedtest1_begin_test(tls, 110, ts+9794 /* "%d one-dimension..." */, libc.VaList(bp+8, n)) + speedtest1_prepare(tls, ts+9837 /* "SELECT count(*) ..." */, 0) iStep = (mxCoord / n) for i = uint32(0); i < n; i++ { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep))) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep))) speedtest1_run(tls) - *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) + *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+124 /* &.zResult */) } speedtest1_end_test(tls) if g.bVerify != 0 { n = (uint32(g.szTest * 200)) - speedtest1_begin_test(tls, 111, ts+9826 /* "Verify result fr..." */, 0) - speedtest1_prepare(tls, ts+9873 /* "SELECT count(*) ..." */, 0) + speedtest1_begin_test(tls, 111, ts+9886 /* "Verify result fr..." */, 0) + speedtest1_prepare(tls, ts+9933 /* "SELECT count(*) ..." */, 0) iStep = (mxCoord / n) for i = uint32(0); i < n; i++ { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep))) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep))) speedtest1_run(tls) - if *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) != libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) { - fatal_error(tls, ts+9921, /* "Count disagree s..." */ - libc.VaList(bp+16, i, (i*iStep), ((i+uint32(1))*iStep), *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)), libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */))) + if *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) != libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+124 /* &.zResult */) { + fatal_error(tls, ts+9981, /* "Count disagree s..." */ + libc.VaList(bp+16, i, (i*iStep), ((i+uint32(1))*iStep), *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)), libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+124 /* &.zResult */))) } } speedtest1_end_test(tls) } n = (uint32(g.szTest * 200)) - speedtest1_begin_test(tls, 120, ts+9963 /* "%d one-dimension..." */, libc.VaList(bp+56, n)) - speedtest1_prepare(tls, ts+10004 /* "SELECT count(*) ..." */, 0) + speedtest1_begin_test(tls, 120, ts+10023 /* "%d one-dimension..." */, libc.VaList(bp+56, n)) + speedtest1_prepare(tls, ts+10064 /* "SELECT count(*) ..." */, 0) iStep = (mxCoord / n) for i = uint32(0); i < n; i++ { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep))) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep))) speedtest1_run(tls) - *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) + *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+124 /* &.zResult */) } speedtest1_end_test(tls) if g.bVerify != 0 { n = (uint32(g.szTest * 200)) - speedtest1_begin_test(tls, 121, ts+10053 /* "Verify result fr..." */, 0) - speedtest1_prepare(tls, ts+10098 /* "SELECT count(*) ..." */, 0) + speedtest1_begin_test(tls, 121, ts+10113 /* "Verify result fr..." */, 0) + speedtest1_prepare(tls, ts+10158 /* "SELECT count(*) ..." */, 0) iStep = (mxCoord / n) for i = uint32(0); i < n; i++ { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep))) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep))) speedtest1_run(tls) - if *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) != libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) { - fatal_error(tls, ts+9921, /* "Count disagree s..." */ - libc.VaList(bp+64, i, (i*iStep), ((i+uint32(1))*iStep), *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)), libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */))) + if *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) != libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+124 /* &.zResult */) { + fatal_error(tls, ts+9981, /* "Count disagree s..." */ + libc.VaList(bp+64, i, (i*iStep), ((i+uint32(1))*iStep), *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)), libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+124 /* &.zResult */))) } } speedtest1_end_test(tls) } n = (uint32(g.szTest * 200)) - speedtest1_begin_test(tls, 125, ts+10146 /* "%d custom geomet..." */, libc.VaList(bp+104, n)) - sqlite3.Xsqlite3_rtree_geometry_callback(tls, g.db, ts+10182 /* "xslice" */, *(*uintptr)(unsafe.Pointer(&struct { + speedtest1_begin_test(tls, 125, ts+10206 /* "%d custom geomet..." */, libc.VaList(bp+104, n)) + sqlite3.Xsqlite3_rtree_geometry_callback(tls, g.db, ts+10242 /* "xslice" */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 }{xsliceGeometryCallback})), uintptr(0)) - speedtest1_prepare(tls, ts+10189 /* "SELECT count(*) ..." */, 0) + speedtest1_prepare(tls, ts+10249 /* "SELECT count(*) ..." */, 0) iStep = (mxCoord / n) for i = uint32(0); i < n; i++ { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep))) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep))) speedtest1_run(tls) - if *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) != libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) { - fatal_error(tls, ts+9921, /* "Count disagree s..." */ - libc.VaList(bp+112, i, (i*iStep), ((i+uint32(1))*iStep), *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)), libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */))) + if *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) != libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+124 /* &.zResult */) { + fatal_error(tls, ts+9981, /* "Count disagree s..." */ + libc.VaList(bp+112, i, (i*iStep), ((i+uint32(1))*iStep), *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)), libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+124 /* &.zResult */))) } } speedtest1_end_test(tls) n = (uint32(g.szTest * 400)) - speedtest1_begin_test(tls, 130, ts+10243 /* "%d three-dimensi..." */, libc.VaList(bp+152, n)) + speedtest1_begin_test(tls, 130, ts+10303 /* "%d three-dimensi..." */, libc.VaList(bp+152, n)) speedtest1_prepare(tls, - ts+10286 /* "SELECT count(*) ..." */, 0) + ts+10346 /* "SELECT count(*) ..." */, 0) iStep = (mxCoord / n) for i = uint32(0); i < n; i++ { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep))) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep))) speedtest1_run(tls) - *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) + *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+124 /* &.zResult */) } speedtest1_end_test(tls) n = (uint32(g.szTest * 500)) - speedtest1_begin_test(tls, 140, ts+10379 /* "%d rowid queries" */, libc.VaList(bp+160, n)) - speedtest1_prepare(tls, ts+10396 /* "SELECT * FROM rt..." */, 0) + speedtest1_begin_test(tls, 140, ts+10439 /* "%d rowid queries" */, libc.VaList(bp+160, n)) + speedtest1_prepare(tls, ts+10456 /* "SELECT * FROM rt..." */, 0) for i = uint32(1); i <= n; i++ { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(i)) speedtest1_run(tls) @@ -6212,8 +6262,8 @@ func testset_rtree(tls *libc.TLS, p1 int32, p2 int32) { /* speedtest1.c:1427:6: speedtest1_end_test(tls) n = (uint32(g.szTest * 50)) - speedtest1_begin_test(tls, 150, ts+10426 /* "%d UPDATEs using..." */, libc.VaList(bp+168, n)) - speedtest1_prepare(tls, ts+10449 /* "UPDATE rt1 SET x..." */, 0) + speedtest1_begin_test(tls, 150, ts+10486 /* "%d UPDATEs using..." */, libc.VaList(bp+168, n)) + speedtest1_prepare(tls, ts+10509 /* "UPDATE rt1 SET x..." */, 0) for i = uint32(1); i <= n; i++ { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(((i * uint32(251)) % mxRowid) + uint32(1)))) speedtest1_run(tls) @@ -6221,20 +6271,20 @@ func testset_rtree(tls *libc.TLS, p1 int32, p2 int32) { /* speedtest1.c:1427:6: speedtest1_end_test(tls) n = (uint32(g.szTest * 5)) - speedtest1_begin_test(tls, 155, ts+10497 /* "%d UPDATEs using..." */, libc.VaList(bp+176, n)) + speedtest1_begin_test(tls, 155, ts+10557 /* "%d UPDATEs using..." */, libc.VaList(bp+176, n)) speedtest1_prepare(tls, - ts+10538 /* "UPDATE rt1 SET x..." */, 0) + ts+10598 /* "UPDATE rt1 SET x..." */, 0) iStep = (mxCoord / n) for i = uint32(0); i < n; i++ { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep))) speedtest1_run(tls) - *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) + *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+124 /* &.zResult */) } speedtest1_end_test(tls) n = (uint32(g.szTest * 50)) - speedtest1_begin_test(tls, 160, ts+10600 /* "%d DELETEs using..." */, libc.VaList(bp+184, n)) - speedtest1_prepare(tls, ts+10623 /* "DELETE FROM rt1 ..." */, 0) + speedtest1_begin_test(tls, 160, ts+10660 /* "%d DELETEs using..." */, libc.VaList(bp+184, n)) + speedtest1_prepare(tls, ts+10683 /* "DELETE FROM rt1 ..." */, 0) for i = uint32(1); i <= n; i++ { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(((i * uint32(257)) % mxRowid) + uint32(1)))) speedtest1_run(tls) @@ -6242,24 +6292,24 @@ func testset_rtree(tls *libc.TLS, p1 int32, p2 int32) { /* speedtest1.c:1427:6: speedtest1_end_test(tls) n = (uint32(g.szTest * 5)) - speedtest1_begin_test(tls, 165, ts+10651 /* "%d DELETEs using..." */, libc.VaList(bp+192, n)) - speedtest1_prepare(tls, ts+10692 /* "DELETE FROM rt1 ..." */, 0) + speedtest1_begin_test(tls, 165, ts+10711 /* "%d DELETEs using..." */, libc.VaList(bp+192, n)) + speedtest1_prepare(tls, ts+10752 /* "DELETE FROM rt1 ..." */, 0) iStep = (mxCoord / n) for i = uint32(0); i < n; i++ { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep))) speedtest1_run(tls) - *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) + *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+124 /* &.zResult */) } speedtest1_end_test(tls) - speedtest1_begin_test(tls, 170, ts+10734 /* "Restore deleted ..." */, 0) - speedtest1_exec(tls, ts+10781 /* "INSERT OR IGNORE..." */, 0) + speedtest1_begin_test(tls, 170, ts+10794 /* "Restore deleted ..." */, 0) + speedtest1_exec(tls, ts+10841 /* "INSERT OR IGNORE..." */, 0) speedtest1_end_test(tls) } // A testset that does key/value storage on tables with many columns. // This is the kind of workload generated by ORMs such as CoreData. -func testset_orm(tls *libc.TLS) { /* speedtest1.c:1612:6: */ +func testset_orm(tls *libc.TLS) { /* speedtest1.c:1614:6: */ bp := tls.Alloc(2016) defer tls.Free(2016) @@ -6272,13 +6322,13 @@ func testset_orm(tls *libc.TLS) { /* speedtest1.c:1612:6: */ // var zNum [2000]int8 at bp+16, 2000 nRow = libc.AssignUint32(&n, (uint32(g.szTest * 250))) - speedtest1_begin_test(tls, 100, ts+10824 /* "Fill %d rows" */, libc.VaList(bp, n)) + speedtest1_begin_test(tls, 100, ts+10884 /* "Fill %d rows" */, libc.VaList(bp, n)) speedtest1_exec(tls, - ts+10837 /* "BEGIN;CREATE TAB..." */, 0) + ts+10897 /* "BEGIN;CREATE TAB..." */, 0) speedtest1_prepare(tls, - ts+14737 /* "INSERT INTO ZLOO..." */, 0) + ts+14797 /* "INSERT INTO ZLOO..." */, 0) for i = uint32(0); i < n; i++ { x1 = speedtest1_random(tls) speedtest1_numbername(tls, (x1 % uint32(1000)), bp+16 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{}))) @@ -6298,20 +6348,20 @@ func testset_orm(tls *libc.TLS) { /* speedtest1.c:1612:6: */ fallthrough case 'B': sqlite3.Xsqlite3_bind_text64(tls, g.pStmt, (int32(j + uint32(2))), bp+16 /* &zNum[0] */, uint64(len), - uintptr(0), SQLITE_UTF8) + uintptr(0), uint8(SQLITE_UTF8)) break } } speedtest1_run(tls) } - speedtest1_exec(tls, ts+3873 /* "COMMIT;" */, 0) + speedtest1_exec(tls, ts+3933 /* "COMMIT;" */, 0) speedtest1_end_test(tls) n = (uint32(g.szTest * 250)) - speedtest1_begin_test(tls, 110, ts+17981 /* "Query %d rows by..." */, libc.VaList(bp+8, n)) + speedtest1_begin_test(tls, 110, ts+18041 /* "Query %d rows by..." */, libc.VaList(bp+8, n)) speedtest1_prepare(tls, - ts+18004 /* "SELECT ZCYANBASE..." */, 0) + ts+18064 /* "SELECT ZCYANBASE..." */, 0) for i = uint32(0); i < n; i++ { x1 = (speedtest1_random(tls) % nRow) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1)) @@ -6322,10 +6372,10 @@ func testset_orm(tls *libc.TLS) { /* speedtest1.c:1612:6: */ var zType = // Types for all non-PK columns, in order -*(*[120]int8)(unsafe.Pointer(ts + 20757 /* "IBBIIITIVVITBTBF..." */)) /* speedtest1.c:1617:21 */ +*(*[120]int8)(unsafe.Pointer(ts + 20817 /* "IBBIIITIVVITBTBF..." */)) /* speedtest1.c:1619:21 */ // -func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1879:6: */ +func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1881:6: */ bp := tls.Alloc(2032) defer tls.Free(2032) @@ -6339,9 +6389,9 @@ func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1879:6: */ speedtest1_exec(tls, - ts+20877 /* "BEGIN;CREATE TAB..." */, 0) + ts+20937 /* "BEGIN;CREATE TAB..." */, 0) for jj = 1; jj <= 3; jj++ { - speedtest1_prepare(tls, ts+21205 /* "INSERT INTO t%d ..." */, libc.VaList(bp, jj)) + speedtest1_prepare(tls, ts+21265 /* "INSERT INTO t%d ..." */, libc.VaList(bp, jj)) for ii = 0; ii < NROW; ii++ { var x1 int32 = (int32(speedtest1_random(tls) % uint32(NROW))) speedtest1_numbername(tls, uint32(x1), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{}))) @@ -6352,23 +6402,23 @@ func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1879:6: */ } speedtest1_exec(tls, - ts+21240 /* "CREATE INDEX i1 ..." */, 0) + ts+21300 /* "CREATE INDEX i1 ..." */, 0) - speedtest1_begin_test(tls, 100, ts+21323 /* "speed4p-join1" */, 0) + speedtest1_begin_test(tls, 100, ts+21383 /* "speed4p-join1" */, 0) speedtest1_prepare(tls, - ts+21337 /* "SELECT * FROM t1..." */, 0) + ts+21397 /* "SELECT * FROM z1..." */, 0) speedtest1_run(tls) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 110, ts+21404 /* "speed4p-join2" */, 0) + speedtest1_begin_test(tls, 110, ts+21464 /* "speed4p-join2" */, 0) speedtest1_prepare(tls, - ts+21418 /* "SELECT * FROM t1..." */, 0) + ts+21478 /* "SELECT * FROM z1..." */, 0) speedtest1_run(tls) speedtest1_end_test(tls) - speedtest1_begin_test(tls, 120, ts+21477 /* "speed4p-view1" */, 0) + speedtest1_begin_test(tls, 120, ts+21537 /* "speed4p-view1" */, 0) for jj = 1; jj <= 3; jj++ { - speedtest1_prepare(tls, ts+21491 /* "SELECT * FROM v%..." */, libc.VaList(bp+8, jj)) + speedtest1_prepare(tls, ts+21551 /* "SELECT * FROM v%..." */, libc.VaList(bp+8, jj)) for ii = 0; ii < NROW2; ii = ii + (3) { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (ii * 3)) speedtest1_run(tls) @@ -6376,9 +6426,9 @@ func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1879:6: */ } speedtest1_end_test(tls) - speedtest1_begin_test(tls, 130, ts+21525 /* "speed4p-table1" */, 0) + speedtest1_begin_test(tls, 130, ts+21585 /* "speed4p-table1" */, 0) for jj = 1; jj <= 3; jj++ { - speedtest1_prepare(tls, ts+21540 /* "SELECT * FROM t%..." */, libc.VaList(bp+16, jj)) + speedtest1_prepare(tls, ts+21600 /* "SELECT * FROM t%..." */, libc.VaList(bp+16, jj)) for ii = 0; ii < NROW2; ii = ii + (3) { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (ii * 3)) speedtest1_run(tls) @@ -6386,9 +6436,9 @@ func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1879:6: */ } speedtest1_end_test(tls) - speedtest1_begin_test(tls, 140, ts+21525 /* "speed4p-table1" */, 0) + speedtest1_begin_test(tls, 140, ts+21585 /* "speed4p-table1" */, 0) for jj = 1; jj <= 3; jj++ { - speedtest1_prepare(tls, ts+21540 /* "SELECT * FROM t%..." */, libc.VaList(bp+24, jj)) + speedtest1_prepare(tls, ts+21600 /* "SELECT * FROM t%..." */, libc.VaList(bp+24, jj)) for ii = 0; ii < NROW2; ii = ii + (3) { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (ii * 3)) speedtest1_run(tls) @@ -6396,37 +6446,37 @@ func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1879:6: */ } speedtest1_end_test(tls) - speedtest1_begin_test(tls, 150, ts+21574 /* "speed4p-subselec..." */, 0) + speedtest1_begin_test(tls, 150, ts+21634 /* "speed4p-subselec..." */, 0) speedtest1_prepare(tls, - ts+21593 /* "SELECT (SELECT t..." */, 0) + ts+21653 /* "SELECT (SELECT t..." */, 0) for jj = 0; jj < NROW2; jj++ { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 3)) speedtest1_run(tls) } speedtest1_end_test(tls) - speedtest1_begin_test(tls, 160, ts+21708 /* "speed4p-rowid-up..." */, 0) - speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0) - speedtest1_prepare(tls, ts+21729 /* "UPDATE t1 SET i=..." */, 0) + speedtest1_begin_test(tls, 160, ts+21768 /* "speed4p-rowid-up..." */, 0) + speedtest1_exec(tls, ts+2856 /* "BEGIN" */, 0) + speedtest1_prepare(tls, ts+21789 /* "UPDATE z1 SET i=..." */, 0) for jj = 0; jj < NROW2; jj++ { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, jj) speedtest1_run(tls) } - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) speedtest1_end_test(tls) - speedtest1_exec(tls, ts+21764 /* "CREATE TABLE t5(..." */, 0) - speedtest1_begin_test(tls, 170, ts+21812 /* "speed4p-insert-i..." */, 0) - speedtest1_exec(tls, ts+21834 /* "INSERT OR IGNORE..." */, 0) + speedtest1_exec(tls, ts+21824 /* "CREATE TABLE t5(..." */, 0) + speedtest1_begin_test(tls, 170, ts+21872 /* "speed4p-insert-i..." */, 0) + speedtest1_exec(tls, ts+21894 /* "INSERT OR IGNORE..." */, 0) speedtest1_end_test(tls) speedtest1_exec(tls, - ts+21879 /* "CREATE TABLE log..." */, 0) + ts+21939 /* "CREATE TABLE log..." */, 0) - speedtest1_begin_test(tls, 180, ts+22369 /* "speed4p-trigger1" */, 0) - speedtest1_prepare(tls, ts+22386 /* "INSERT INTO t4 V..." */, 0) + speedtest1_begin_test(tls, 180, ts+22429 /* "speed4p-trigger1" */, 0) + speedtest1_prepare(tls, ts+22446 /* "INSERT INTO t4 V..." */, 0) for jj = 0; jj < NROW2; jj++ { speedtest1_numbername(tls, uint32(jj), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{}))) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, jj) @@ -6438,8 +6488,8 @@ func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1879:6: */ // Note: Of the queries, only half actually update a row. This property // was copied over from speed4p.test, where it was probably introduced // inadvertantly. - speedtest1_begin_test(tls, 190, ts+22422 /* "speed4p-trigger2" */, 0) - speedtest1_prepare(tls, ts+22439 /* "UPDATE t4 SET i ..." */, 0) + speedtest1_begin_test(tls, 190, ts+22482 /* "speed4p-trigger2" */, 0) + speedtest1_prepare(tls, ts+22499 /* "UPDATE t4 SET i ..." */, 0) for jj = 1; jj <= (NROW2 * 2); jj = jj + (2) { speedtest1_numbername(tls, (uint32(jj * 2)), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{}))) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 2)) @@ -6450,14 +6500,14 @@ func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1879:6: */ speedtest1_end_test(tls) // Note: Same again. - speedtest1_begin_test(tls, 200, ts+22485 /* "speed4p-trigger3" */, 0) - speedtest1_prepare(tls, ts+22502 /* "DELETE FROM t4 W..." */, 0) + speedtest1_begin_test(tls, 200, ts+22545 /* "speed4p-trigger3" */, 0) + speedtest1_prepare(tls, ts+22562 /* "DELETE FROM t4 W..." */, 0) for jj = 1; jj <= (NROW2 * 2); jj = jj + (2) { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 2)) speedtest1_run(tls) } speedtest1_end_test(tls) - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) // The following block contains the same tests as the above block that // tests triggers, with one crucial difference: no triggers are defined. @@ -6465,9 +6515,9 @@ func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1879:6: */ // is the amount of time taken to compile and execute the trigger programs. speedtest1_exec(tls, - ts+22534 /* "DROP TABLE t4;DR..." */, 0) - speedtest1_begin_test(tls, 210, ts+22639 /* "speed4p-notrigge..." */, 0) - speedtest1_prepare(tls, ts+22386 /* "INSERT INTO t4 V..." */, 0) + ts+22594 /* "DROP TABLE t4;DR..." */, 0) + speedtest1_begin_test(tls, 210, ts+22699 /* "speed4p-notrigge..." */, 0) + speedtest1_prepare(tls, ts+22446 /* "INSERT INTO t4 V..." */, 0) for jj = 0; jj < NROW2; jj++ { speedtest1_numbername(tls, uint32(jj), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{}))) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, jj) @@ -6475,8 +6525,8 @@ func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1879:6: */ speedtest1_run(tls) } speedtest1_end_test(tls) - speedtest1_begin_test(tls, 210, ts+22658 /* "speed4p-notrigge..." */, 0) - speedtest1_prepare(tls, ts+22439 /* "UPDATE t4 SET i ..." */, 0) + speedtest1_begin_test(tls, 210, ts+22718 /* "speed4p-notrigge..." */, 0) + speedtest1_prepare(tls, ts+22499 /* "UPDATE t4 SET i ..." */, 0) for jj = 1; jj <= (NROW2 * 2); jj = jj + (2) { speedtest1_numbername(tls, (uint32(jj * 2)), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{}))) sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 2)) @@ -6485,18 +6535,18 @@ func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1879:6: */ speedtest1_run(tls) } speedtest1_end_test(tls) - speedtest1_begin_test(tls, 220, ts+22677 /* "speed4p-notrigge..." */, 0) - speedtest1_prepare(tls, ts+22502 /* "DELETE FROM t4 W..." */, 0) + speedtest1_begin_test(tls, 220, ts+22737 /* "speed4p-notrigge..." */, 0) + speedtest1_prepare(tls, ts+22562 /* "DELETE FROM t4 W..." */, 0) for jj = 1; jj <= (NROW2 * 2); jj = jj + (2) { sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 2)) speedtest1_run(tls) } speedtest1_end_test(tls) - speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0) + speedtest1_exec(tls, ts+2966 /* "COMMIT" */, 0) } // A testset used for debugging speedtest1 itself. -func testset_debug1(tls *libc.TLS) { /* speedtest1.c:2081:6: */ +func testset_debug1(tls *libc.TLS) { /* speedtest1.c:2083:6: */ bp := tls.Alloc(2032) defer tls.Free(2032) @@ -6512,7 +6562,7 @@ func testset_debug1(tls *libc.TLS) { /* speedtest1.c:2081:6: */ x1 = swizzle(tls, i, n) x2 = swizzle(tls, x1, n) speedtest1_numbername(tls, x1, bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{}))) - libc.Xprintf(tls, ts+22696 /* "%5d %5d %5d %s\n" */, libc.VaList(bp, i, x1, x2, bp+32 /* &zNum[0] */)) + libc.Xprintf(tls, ts+22756 /* "%5d %5d %5d %s\n" */, libc.VaList(bp, i, x1, x2, bp+32 /* &zNum[0] */)) } } @@ -6555,15 +6605,15 @@ func testset_debug1(tls *libc.TLS) { /* speedtest1.c:2081:6: */ // POSIX Standard: 2.10 Symbolic Constants // Attempt to display I/O stats on Linux using /proc/PID/io -func displayLinuxIoStats(tls *libc.TLS, out uintptr) { /* speedtest1.c:2102:13: */ +func displayLinuxIoStats(tls *libc.TLS, out uintptr) { /* speedtest1.c:2104:13: */ bp := tls.Alloc(224) defer tls.Free(224) var in uintptr // var z [200]int8 at bp+24, 200 - sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+24 /* &z[0] */, ts+22712 /* "/proc/%d/io" */, libc.VaList(bp, libc.Xgetpid(tls))) - in = libc.Xfopen(tls, bp+24 /* &z[0] */, ts+22724 /* "rb" */) + sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+24 /* &z[0] */, ts+22772 /* "/proc/%d/io" */, libc.VaList(bp, libc.Xgetpid(tls))) + in = libc.Xfopen(tls, bp+24 /* &z[0] */, ts+22784 /* "rb" */) if in == uintptr(0) { return } @@ -6575,7 +6625,7 @@ func displayLinuxIoStats(tls *libc.TLS, out uintptr) { /* speedtest1.c:2102:13: }{}))); i++ { var n int32 = int32(libc.Xstrlen(tls, aTrans[i].zPattern)) if libc.Xstrncmp(tls, aTrans[i].zPattern, bp+24 /* &z[0] */, uint64(n)) == 0 { - libc.Xfprintf(tls, out, ts+22727 /* "-- %-28s %s" */, libc.VaList(bp+8, aTrans[i].zDesc, (bp+24 /* &z */ +uintptr(n)))) + libc.Xfprintf(tls, out, ts+22787 /* "-- %-28s %s" */, libc.VaList(bp+8, aTrans[i].zDesc, (bp+24 /* &z */ +uintptr(n)))) break } } @@ -6587,26 +6637,26 @@ var aTrans = [7]struct { zPattern uintptr zDesc uintptr }{ - {zPattern: ts + 22739 /* "rchar: " */, zDesc: ts + 22747 /* "Bytes received b..." */}, - {zPattern: ts + 22773 /* "wchar: " */, zDesc: ts + 22781 /* "Bytes sent to wr..." */}, - {zPattern: ts + 22804 /* "syscr: " */, zDesc: ts + 22812 /* "Read() system ca..." */}, - {zPattern: ts + 22833 /* "syscw: " */, zDesc: ts + 22841 /* "Write() system c..." */}, - {zPattern: ts + 22863 /* "read_bytes: " */, zDesc: ts + 22876 /* "Bytes rcvd from ..." */}, - {zPattern: ts + 22901 /* "write_bytes: " */, zDesc: ts + 22915 /* "Bytes sent to st..." */}, - {zPattern: ts + 22938 /* "cancelled_write_..." */, zDesc: ts + 22962 /* "Cancelled write ..." */}, -} /* speedtest1.c:2112:7 */ + {zPattern: ts + 22799 /* "rchar: " */, zDesc: ts + 22807 /* "Bytes received b..." */}, + {zPattern: ts + 22833 /* "wchar: " */, zDesc: ts + 22841 /* "Bytes sent to wr..." */}, + {zPattern: ts + 22864 /* "syscr: " */, zDesc: ts + 22872 /* "Read() system ca..." */}, + {zPattern: ts + 22893 /* "syscw: " */, zDesc: ts + 22901 /* "Write() system c..." */}, + {zPattern: ts + 22923 /* "read_bytes: " */, zDesc: ts + 22936 /* "Bytes rcvd from ..." */}, + {zPattern: ts + 22961 /* "write_bytes: " */, zDesc: ts + 22975 /* "Bytes sent to st..." */}, + {zPattern: ts + 22998 /* "cancelled_write_..." */, zDesc: ts + 23022 /* "Cancelled write ..." */}, +} /* speedtest1.c:2114:7 */ -func xCompileOptions(tls *libc.TLS, pCtx uintptr, nVal int32, azVal uintptr, azCol uintptr) int32 { /* speedtest1.c:2138:12: */ +func xCompileOptions(tls *libc.TLS, pCtx uintptr, nVal int32, azVal uintptr, azCol uintptr) int32 { /* speedtest1.c:2144:12: */ bp := tls.Alloc(8) defer tls.Free(8) - libc.Xprintf(tls, ts+22985 /* "-- Compile optio..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azVal)))) + libc.Xprintf(tls, ts+23045 /* "-- Compile optio..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azVal)))) return SQLITE_OK } -func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143:5: */ - bp := tls.Alloc(568) - defer tls.Free(568) +func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2149:5: */ + bp := tls.Alloc(576) + defer tls.Free(576) var doAutovac int32 = 0 // True for --autovacuum var cacheSize int32 = 0 // Desired cache size. 0 means default @@ -6627,7 +6677,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143 var nThread int32 = 0 // --threads value var mmapSize int32 = 0 // How big of a memory map to use var memDb int32 = 0 // --memdb. Use an in-memory database - var zTSet uintptr = ts + 23008 /* "main" */ // Which --testset torun + var zTSet uintptr = ts + 23068 /* "main" */ // Which --testset torun var doTrace int32 = 0 // True for --trace var zEncoding uintptr = uintptr(0) // --utf16be or --utf16le var zDbName uintptr = uintptr(0) // Name of the test database @@ -6635,21 +6685,21 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143 var pHeap uintptr = uintptr(0) // Allocated heap space var pLook uintptr = uintptr(0) // Allocated lookaside space var pPCache uintptr = uintptr(0) // Allocated storage for pcache - // var iCur int32 at bp+560, 4 + // var iCur int32 at bp+568, 4 - // var iHi int32 at bp+564, 4 + // var iHi int32 at bp+572, 4 // Stats values, current and "highwater" var i int32 // Loop counter var rc int32 // API return code // Display the version of SQLite being tested - libc.Xprintf(tls, ts+23013, /* "-- Speedtest1 fo..." */ + libc.Xprintf(tls, ts+23073, /* "-- Speedtest1 fo..." */ libc.VaList(bp, sqlite3.Xsqlite3_libversion(tls), sqlite3.Xsqlite3_sourceid(tls))) // Process command-line arguments - g.zWR = ts + 2152 /* "" */ - g.zNN = ts + 2152 /* "" */ - g.zPK = ts + 23048 /* "UNIQUE" */ + g.zWR = ts + 2212 /* "" */ + g.zNN = ts + 2212 /* "" */ + g.zPK = ts + 23108 /* "UNIQUE" */ g.szTest = 100 g.nRepeat = 1 for i = 1; i < argc; i++ { @@ -6658,156 +6708,161 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143 for ok := true; ok; ok = (int32(*(*int8)(unsafe.Pointer(z))) == '-') { z++ } - if libc.Xstrcmp(tls, z, ts+23055 /* "autovacuum" */) == 0 { + if libc.Xstrcmp(tls, z, ts+23115 /* "autovacuum" */) == 0 { doAutovac = 1 - } else if libc.Xstrcmp(tls, z, ts+23066 /* "cachesize" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23126 /* "cachesize" */) == 0 { if i >= (argc - 1) { - fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23136 /* "missing argument..." */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } i++ cacheSize = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) - } else if libc.Xstrcmp(tls, z, ts+23100 /* "exclusive" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23160 /* "exclusive" */) == 0 { doExclusive = 1 - } else if libc.Xstrcmp(tls, z, ts+23110 /* "checkpoint" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23170 /* "checkpoint" */) == 0 { g.doCheckpoint = 1 - } else if libc.Xstrcmp(tls, z, ts+23121 /* "explain" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23181 /* "explain" */) == 0 { g.bSqlOnly = 1 g.bExplain = 1 - } else if libc.Xstrcmp(tls, z, ts+23129 /* "heap" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23189 /* "heap" */) == 0 { if i >= (argc - 2) { - fatal_error(tls, ts+23134 /* "missing argument..." */, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23194 /* "missing argument..." */, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } nHeap = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*8))) mnHeap = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+2))*8))) i = i + (2) - } else if libc.Xstrcmp(tls, z, ts+23159 /* "incrvacuum" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23219 /* "incrvacuum" */) == 0 { doIncrvac = 1 - } else if libc.Xstrcmp(tls, z, ts+23170 /* "journal" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23230 /* "journal" */) == 0 { if i >= (argc - 1) { - fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23136 /* "missing argument..." */, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } zJMode = *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8)) - } else if libc.Xstrcmp(tls, z, ts+23178 /* "key" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23238 /* "key" */) == 0 { if i >= (argc - 1) { - fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23136 /* "missing argument..." */, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } zKey = *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8)) - } else if libc.Xstrcmp(tls, z, ts+23182 /* "lookaside" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23242 /* "lookaside" */) == 0 { if i >= (argc - 2) { - fatal_error(tls, ts+23134 /* "missing argument..." */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23194 /* "missing argument..." */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } nLook = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*8))) szLook = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+2))*8))) i = i + (2) - } else if libc.Xstrcmp(tls, z, ts+23192 /* "memdb" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23252 /* "memdb" */) == 0 { memDb = 1 - } else if libc.Xstrcmp(tls, z, ts+23198 /* "multithread" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23258 /* "multithread" */) == 0 { sqlite3.Xsqlite3_config(tls, SQLITE_CONFIG_MULTITHREAD, 0) - } else if libc.Xstrcmp(tls, z, ts+23210 /* "nomemstat" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23270 /* "nomemstat" */) == 0 { sqlite3.Xsqlite3_config(tls, SQLITE_CONFIG_MEMSTATUS, libc.VaList(bp+56, 0)) - } else if libc.Xstrcmp(tls, z, ts+23220 /* "mmap" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23280 /* "mmap" */) == 0 { if i >= (argc - 1) { - fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23136 /* "missing argument..." */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } mmapSize = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8))) - } else if libc.Xstrcmp(tls, z, ts+23225 /* "nosync" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23285 /* "nosync" */) == 0 { noSync = 1 - } else if libc.Xstrcmp(tls, z, ts+23232 /* "notnull" */) == 0 { - g.zNN = ts + 23240 /* "NOT NULL" */ - } else if libc.Xstrcmp(tls, z, ts+23249 /* "output" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23292 /* "notnull" */) == 0 { + g.zNN = ts + 23300 /* "NOT NULL" */ + } else if libc.Xstrcmp(tls, z, ts+23309 /* "output" */) == 0 { if i >= (argc - 1) { - fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23136 /* "missing argument..." */, libc.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } i++ - if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ts+23256 /* "-" */) == 0 { + if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ts+23316 /* "-" */) == 0 { g.hashFile = libc.Xstdout } else { - g.hashFile = libc.Xfopen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ts+23258 /* "wb" */) + g.hashFile = libc.Xfopen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ts+23318 /* "wb" */) if g.hashFile == uintptr(0) { - fatal_error(tls, ts+23261 /* "cannot open \"%s\"..." */, libc.VaList(bp+80, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23321 /* "cannot open \"%s\"..." */, libc.VaList(bp+80, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } } - } else if libc.Xstrcmp(tls, z, ts+23291 /* "pagesize" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23351 /* "pagesize" */) == 0 { if i >= (argc - 1) { - fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+88, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23136 /* "missing argument..." */, libc.VaList(bp+88, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } pageSize = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8))) - } else if libc.Xstrcmp(tls, z, ts+23300 /* "pcache" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23360 /* "pcache" */) == 0 { if i >= (argc - 2) { - fatal_error(tls, ts+23134 /* "missing argument..." */, libc.VaList(bp+96, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23194 /* "missing argument..." */, libc.VaList(bp+96, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } nPCache = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*8))) szPCache = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+2))*8))) doPCache = 1 i = i + (2) - } else if libc.Xstrcmp(tls, z, ts+23307 /* "primarykey" */) == 0 { - g.zPK = ts + 23318 /* "PRIMARY KEY" */ - } else if libc.Xstrcmp(tls, z, ts+23330 /* "repeat" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23367 /* "primarykey" */) == 0 { + g.zPK = ts + 23378 /* "PRIMARY KEY" */ + } else if libc.Xstrcmp(tls, z, ts+23390 /* "repeat" */) == 0 { if i >= (argc - 1) { - fatal_error(tls, ts+23134 /* "missing argument..." */, libc.VaList(bp+104, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23194 /* "missing argument..." */, libc.VaList(bp+104, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } g.nRepeat = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*8))) i = i + (1) - } else if libc.Xstrcmp(tls, z, ts+23337 /* "reprepare" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23397 /* "reprepare" */) == 0 { g.bReprepare = 1 - } else if libc.Xstrcmp(tls, z, ts+23347 /* "serialized" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23407 /* "serialized" */) == 0 { sqlite3.Xsqlite3_config(tls, SQLITE_CONFIG_SERIALIZED, 0) - } else if libc.Xstrcmp(tls, z, ts+23358 /* "singlethread" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23418 /* "singlethread" */) == 0 { sqlite3.Xsqlite3_config(tls, SQLITE_CONFIG_SINGLETHREAD, 0) - } else if libc.Xstrcmp(tls, z, ts+23371 /* "sqlonly" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23431 /* "sqlonly" */) == 0 { g.bSqlOnly = 1 - } else if libc.Xstrcmp(tls, z, ts+23379 /* "shrink-memory" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23439 /* "shrink-memory" */) == 0 { g.bMemShrink = 1 - } else if libc.Xstrcmp(tls, z, ts+23393 /* "size" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23453 /* "size" */) == 0 { if i >= (argc - 1) { - fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23136 /* "missing argument..." */, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } g.szTest = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8))) - } else if libc.Xstrcmp(tls, z, ts+23398 /* "stats" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23458 /* "stats" */) == 0 { showStats = 1 - } else if libc.Xstrcmp(tls, z, ts+23404 /* "temp" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23464 /* "temp" */) == 0 { if i >= (argc - 1) { - fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+120, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23136 /* "missing argument..." */, libc.VaList(bp+120, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } i++ if ((int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))) < '0') || (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))) > '9')) || (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) + 1))) != 0) { - fatal_error(tls, ts+23409 /* "argument to --te..." */, 0) + fatal_error(tls, ts+23469 /* "argument to --te..." */, 0) } g.eTemp = (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))) - '0') - } else if libc.Xstrcmp(tls, z, ts+23462 /* "testset" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23522 /* "testset" */) == 0 { if i >= (argc - 1) { - fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+128, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23136 /* "missing argument..." */, libc.VaList(bp+128, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } zTSet = *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8)) - } else if libc.Xstrcmp(tls, z, ts+23470 /* "trace" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23530 /* "trace" */) == 0 { doTrace = 1 - } else if libc.Xstrcmp(tls, z, ts+23476 /* "threads" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23536 /* "threads" */) == 0 { if i >= (argc - 1) { - fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+136, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + fatal_error(tls, ts+23136 /* "missing argument..." */, libc.VaList(bp+136, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) } nThread = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8))) - } else if libc.Xstrcmp(tls, z, ts+23484 /* "utf16le" */) == 0 { - zEncoding = ts + 23484 /* "utf16le" */ - } else if libc.Xstrcmp(tls, z, ts+23492 /* "utf16be" */) == 0 { - zEncoding = ts + 23492 /* "utf16be" */ - } else if libc.Xstrcmp(tls, z, ts+23500 /* "verify" */) == 0 { + } else if libc.Xstrcmp(tls, z, ts+23544 /* "utf16le" */) == 0 { + zEncoding = ts + 23544 /* "utf16le" */ + } else if libc.Xstrcmp(tls, z, ts+23552 /* "utf16be" */) == 0 { + zEncoding = ts + 23552 /* "utf16be" */ + } else if libc.Xstrcmp(tls, z, ts+23560 /* "verify" */) == 0 { g.bVerify = 1 HashInit(tls) - } else if libc.Xstrcmp(tls, z, ts+23507 /* "without-rowid" */) == 0 { - g.zWR = ts + 5915 /* "WITHOUT ROWID" */ - g.zPK = ts + 23318 /* "PRIMARY KEY" */ - } else if (libc.Xstrcmp(tls, z, ts+23521 /* "help" */) == 0) || (libc.Xstrcmp(tls, z, ts+23526 /* "?" */) == 0) { - libc.Xprintf(tls, uintptr(unsafe.Pointer(&zHelp)), libc.VaList(bp+144, *(*uintptr)(unsafe.Pointer(argv)))) + } else if libc.Xstrcmp(tls, z, ts+23567 /* "reserve" */) == 0 { + if i >= (argc - 1) { + fatal_error(tls, ts+23136 /* "missing argument..." */, libc.VaList(bp+144, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) + } + g.nReserve = libc.Xatoi(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8))) + } else if libc.Xstrcmp(tls, z, ts+23575 /* "without-rowid" */) == 0 { + g.zWR = ts + 5975 /* "WITHOUT ROWID" */ + g.zPK = ts + 23378 /* "PRIMARY KEY" */ + } else if (libc.Xstrcmp(tls, z, ts+23589 /* "help" */) == 0) || (libc.Xstrcmp(tls, z, ts+23594 /* "?" */) == 0) { + libc.Xprintf(tls, uintptr(unsafe.Pointer(&zHelp)), libc.VaList(bp+152, *(*uintptr)(unsafe.Pointer(argv)))) libc.Xexit(tls, 0) } else { - fatal_error(tls, ts+23528, /* "unknown option: ..." */ - libc.VaList(bp+152, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(argv)))) + fatal_error(tls, ts+23596, /* "unknown option: ..." */ + libc.VaList(bp+160, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(argv)))) } } else if zDbName == uintptr(0) { zDbName = *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) } else { - fatal_error(tls, ts+23569, /* "surplus argument..." */ - libc.VaList(bp+168, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(argv)))) + fatal_error(tls, ts+23637, /* "surplus argument..." */ + libc.VaList(bp+176, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(argv)))) } } if zDbName != uintptr(0) { @@ -6816,50 +6871,53 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143 if nHeap > 0 { pHeap = libc.Xmalloc(tls, uint64(nHeap)) if pHeap == uintptr(0) { - fatal_error(tls, ts+23612 /* "cannot allocate ..." */, libc.VaList(bp+184, nHeap)) + fatal_error(tls, ts+23680 /* "cannot allocate ..." */, libc.VaList(bp+192, nHeap)) } - rc = sqlite3.Xsqlite3_config(tls, SQLITE_CONFIG_HEAP, libc.VaList(bp+192, pHeap, nHeap, mnHeap)) + rc = sqlite3.Xsqlite3_config(tls, SQLITE_CONFIG_HEAP, libc.VaList(bp+200, pHeap, nHeap, mnHeap)) if rc != 0 { - fatal_error(tls, ts+23642 /* "heap configurati..." */, libc.VaList(bp+216, rc)) + fatal_error(tls, ts+23710 /* "heap configurati..." */, libc.VaList(bp+224, rc)) } } if doPCache != 0 { if (nPCache > 0) && (szPCache > 0) { pPCache = libc.Xmalloc(tls, (uint64(sqlite3_int64(nPCache) * sqlite3_int64(szPCache)))) if pPCache == uintptr(0) { - fatal_error(tls, ts+23673, /* "cannot allocate ..." */ - libc.VaList(bp+224, (sqlite3_int64(nPCache)*sqlite3_int64(szPCache)))) + fatal_error(tls, ts+23741, /* "cannot allocate ..." */ + libc.VaList(bp+232, (sqlite3_int64(nPCache)*sqlite3_int64(szPCache)))) } } - rc = sqlite3.Xsqlite3_config(tls, SQLITE_CONFIG_PAGECACHE, libc.VaList(bp+232, pPCache, szPCache, nPCache)) + rc = sqlite3.Xsqlite3_config(tls, SQLITE_CONFIG_PAGECACHE, libc.VaList(bp+240, pPCache, szPCache, nPCache)) if rc != 0 { - fatal_error(tls, ts+23707 /* "pcache configura..." */, libc.VaList(bp+256, rc)) + fatal_error(tls, ts+23775 /* "pcache configura..." */, libc.VaList(bp+264, rc)) } } if nLook >= 0 { - sqlite3.Xsqlite3_config(tls, SQLITE_CONFIG_LOOKASIDE, libc.VaList(bp+264, 0, 0)) + sqlite3.Xsqlite3_config(tls, SQLITE_CONFIG_LOOKASIDE, libc.VaList(bp+272, 0, 0)) } sqlite3.Xsqlite3_initialize(tls) // Open the database and the input file if sqlite3.Xsqlite3_open(tls, func() uintptr { if memDb != 0 { - return ts + 23740 /* ":memory:" */ + return ts + 23808 /* ":memory:" */ } return zDbName }(), (uintptr(unsafe.Pointer(&g)) /* &.db */)) != 0 { - fatal_error(tls, ts+23749 /* "Cannot open data..." */, libc.VaList(bp+280, zDbName)) + fatal_error(tls, ts+23817 /* "Cannot open data..." */, libc.VaList(bp+288, zDbName)) } if (nLook > 0) && (szLook > 0) { pLook = libc.Xmalloc(tls, (uint64(nLook * szLook))) - rc = sqlite3.Xsqlite3_db_config(tls, g.db, SQLITE_DBCONFIG_LOOKASIDE, libc.VaList(bp+288, pLook, szLook, nLook)) + rc = sqlite3.Xsqlite3_db_config(tls, g.db, SQLITE_DBCONFIG_LOOKASIDE, libc.VaList(bp+296, pLook, szLook, nLook)) if rc != 0 { - fatal_error(tls, ts+23780 /* "lookaside config..." */, libc.VaList(bp+312, rc)) + fatal_error(tls, ts+23848 /* "lookaside config..." */, libc.VaList(bp+320, rc)) } } + if g.nReserve > 0 { + sqlite3.Xsqlite3_file_control(tls, g.db, uintptr(0), SQLITE_FCNTL_RESERVE_BYTES, (uintptr(unsafe.Pointer(&g)) + 72 /* &.nReserve */)) + } // Set database connection options - sqlite3.Xsqlite3_create_function(tls, g.db, ts+23816 /* "random" */, 0, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { + sqlite3.Xsqlite3_create_function(tls, g.db, ts+23884 /* "random" */, 0, SQLITE_UTF8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr) }{randomFunc})), uintptr(0), uintptr(0)) if doTrace != 0 { @@ -6868,41 +6926,41 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143 }{traceCallback})), uintptr(0)) } if memDb > 0 { - speedtest1_exec(tls, ts+23823 /* "PRAGMA temp_stor..." */, 0) + speedtest1_exec(tls, ts+23891 /* "PRAGMA temp_stor..." */, 0) } if mmapSize > 0 { - speedtest1_exec(tls, ts+23848 /* "PRAGMA mmap_size..." */, libc.VaList(bp+320, mmapSize)) + speedtest1_exec(tls, ts+23916 /* "PRAGMA mmap_size..." */, libc.VaList(bp+328, mmapSize)) } - speedtest1_exec(tls, ts+23868 /* "PRAGMA threads=%..." */, libc.VaList(bp+328, nThread)) + speedtest1_exec(tls, ts+23936 /* "PRAGMA threads=%..." */, libc.VaList(bp+336, nThread)) if zKey != 0 { - speedtest1_exec(tls, ts+23886 /* "PRAGMA key('%s')" */, libc.VaList(bp+336, zKey)) + speedtest1_exec(tls, ts+23954 /* "PRAGMA key('%s')" */, libc.VaList(bp+344, zKey)) } if zEncoding != 0 { - speedtest1_exec(tls, ts+23903 /* "PRAGMA encoding=..." */, libc.VaList(bp+344, zEncoding)) + speedtest1_exec(tls, ts+23971 /* "PRAGMA encoding=..." */, libc.VaList(bp+352, zEncoding)) } if doAutovac != 0 { - speedtest1_exec(tls, ts+23922 /* "PRAGMA auto_vacu..." */, 0) + speedtest1_exec(tls, ts+23990 /* "PRAGMA auto_vacu..." */, 0) } else if doIncrvac != 0 { - speedtest1_exec(tls, ts+23946 /* "PRAGMA auto_vacu..." */, 0) + speedtest1_exec(tls, ts+24014 /* "PRAGMA auto_vacu..." */, 0) } if pageSize != 0 { - speedtest1_exec(tls, ts+23977 /* "PRAGMA page_size..." */, libc.VaList(bp+352, pageSize)) + speedtest1_exec(tls, ts+24045 /* "PRAGMA page_size..." */, libc.VaList(bp+360, pageSize)) } if cacheSize != 0 { - speedtest1_exec(tls, ts+23997 /* "PRAGMA cache_siz..." */, libc.VaList(bp+360, cacheSize)) + speedtest1_exec(tls, ts+24065 /* "PRAGMA cache_siz..." */, libc.VaList(bp+368, cacheSize)) } if noSync != 0 { - speedtest1_exec(tls, ts+24018 /* "PRAGMA synchrono..." */, 0) + speedtest1_exec(tls, ts+24086 /* "PRAGMA synchrono..." */, 0) } if doExclusive != 0 { - speedtest1_exec(tls, ts+24041 /* "PRAGMA locking_m..." */, 0) + speedtest1_exec(tls, ts+24109 /* "PRAGMA locking_m..." */, 0) } if zJMode != 0 { - speedtest1_exec(tls, ts+24071 /* "PRAGMA journal_m..." */, libc.VaList(bp+368, zJMode)) + speedtest1_exec(tls, ts+24139 /* "PRAGMA journal_m..." */, libc.VaList(bp+376, zJMode)) } if g.bExplain != 0 { - libc.Xprintf(tls, ts+24094 /* ".explain\n.echo o..." */, 0) + libc.Xprintf(tls, ts+24162 /* ".explain\n.echo o..." */, 0) } for ok1 := true; ok1; ok1 = *(*int8)(unsafe.Pointer(zTSet)) != 0 { var zThisTest uintptr = zTSet @@ -6911,42 +6969,42 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143 *(*int8)(unsafe.Pointer(zComma)) = int8(0) zTSet = (zComma + uintptr(1)) } else { - zTSet = ts + 2152 /* "" */ + zTSet = ts + 2212 /* "" */ } if (g.iTotal > int64(0)) || (zComma != uintptr(0)) { - libc.Xprintf(tls, ts+24113 /* " Begin tes..." */, libc.VaList(bp+376, zThisTest)) + libc.Xprintf(tls, ts+24181 /* " Begin tes..." */, libc.VaList(bp+384, zThisTest)) } - if libc.Xstrcmp(tls, zThisTest, ts+23008 /* "main" */) == 0 { + if libc.Xstrcmp(tls, zThisTest, ts+23068 /* "main" */) == 0 { testset_main(tls) - } else if libc.Xstrcmp(tls, zThisTest, ts+24140 /* "debug1" */) == 0 { + } else if libc.Xstrcmp(tls, zThisTest, ts+24208 /* "debug1" */) == 0 { testset_debug1(tls) - } else if libc.Xstrcmp(tls, zThisTest, ts+24147 /* "orm" */) == 0 { + } else if libc.Xstrcmp(tls, zThisTest, ts+24215 /* "orm" */) == 0 { testset_orm(tls) - } else if libc.Xstrcmp(tls, zThisTest, ts+24151 /* "cte" */) == 0 { + } else if libc.Xstrcmp(tls, zThisTest, ts+24219 /* "cte" */) == 0 { testset_cte(tls) - } else if libc.Xstrcmp(tls, zThisTest, ts+24155 /* "fp" */) == 0 { + } else if libc.Xstrcmp(tls, zThisTest, ts+24223 /* "fp" */) == 0 { testset_fp(tls) - } else if libc.Xstrcmp(tls, zThisTest, ts+24158 /* "trigger" */) == 0 { + } else if libc.Xstrcmp(tls, zThisTest, ts+24226 /* "trigger" */) == 0 { testset_trigger(tls) - } else if libc.Xstrcmp(tls, zThisTest, ts+24166 /* "rtree" */) == 0 { + } else if libc.Xstrcmp(tls, zThisTest, ts+24234 /* "rtree" */) == 0 { testset_rtree(tls, 6, 147) } else { fatal_error(tls, - ts+24172, /* "unknown testset:..." */ - libc.VaList(bp+384, zThisTest)) + ts+24240, /* "unknown testset:..." */ + libc.VaList(bp+392, zThisTest)) } if *(*int8)(unsafe.Pointer(zTSet)) != 0 { var zSql uintptr var zObj uintptr - speedtest1_begin_test(tls, 999, ts+24241 /* "Reset the databa..." */, 0) + speedtest1_begin_test(tls, 999, ts+24309 /* "Reset the databa..." */, 0) for 1 != 0 { zObj = speedtest1_once(tls, - ts+24260 /* "SELECT name FROM..." */, 0) + ts+24328 /* "SELECT name FROM..." */, 0) if zObj == uintptr(0) { break } - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+24330 /* "DROP TABLE main...." */, libc.VaList(bp+392, zObj)) + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+24398 /* "DROP TABLE main...." */, libc.VaList(bp+400, zObj)) speedtest1_exec(tls, zSql, 0) sqlite3.Xsqlite3_free(tls, zSql) sqlite3.Xsqlite3_free(tls, zObj) @@ -6954,11 +7012,11 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143 for 1 != 0 { zObj = speedtest1_once(tls, - ts+24351 /* "SELECT name FROM..." */, 0) + ts+24419 /* "SELECT name FROM..." */, 0) if zObj == uintptr(0) { break } - zSql = sqlite3.Xsqlite3_mprintf(tls, ts+24330 /* "DROP TABLE main...." */, libc.VaList(bp+400, zObj)) + zSql = sqlite3.Xsqlite3_mprintf(tls, ts+24398 /* "DROP TABLE main...." */, libc.VaList(bp+408, zObj)) speedtest1_exec(tls, zSql, 0) sqlite3.Xsqlite3_free(tls, zSql) sqlite3.Xsqlite3_free(tls, zObj) @@ -6969,7 +7027,7 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143 speedtest1_final(tls) if showStats != 0 { - sqlite3.Xsqlite3_exec(tls, g.db, ts+24421 /* "PRAGMA compile_o..." */, *(*uintptr)(unsafe.Pointer(&struct { + sqlite3.Xsqlite3_exec(tls, g.db, ts+24489 /* "PRAGMA compile_o..." */, *(*uintptr)(unsafe.Pointer(&struct { f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 }{xCompileOptions})), uintptr(0), uintptr(0)) } @@ -6977,26 +7035,26 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143 // Database connection statistics printed after both prepared statements // have been finalized if showStats != 0 { - sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_LOOKASIDE_USED, bp+560 /* &iCur */, bp+564 /* &iHi */, 0) - libc.Xprintf(tls, ts+24444 /* "-- Lookaside Slo..." */, libc.VaList(bp+408, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 564 /* iHi */)))) - sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_LOOKASIDE_HIT, bp+560 /* &iCur */, bp+564 /* &iHi */, 0) - libc.Xprintf(tls, ts+24489 /* "-- Successful lo..." */, libc.VaList(bp+424, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */)))) - sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE, bp+560 /* &iCur */, bp+564 /* &iHi */, 0) - libc.Xprintf(tls, ts+24525 /* "-- Lookaside siz..." */, libc.VaList(bp+432, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */)))) - sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL, bp+560 /* &iCur */, bp+564 /* &iHi */, 0) - libc.Xprintf(tls, ts+24561 /* "-- Lookaside OOM..." */, libc.VaList(bp+440, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */)))) - sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_CACHE_USED, bp+560 /* &iCur */, bp+564 /* &iHi */, 0) - libc.Xprintf(tls, ts+24597 /* "-- Pager Heap Us..." */, libc.VaList(bp+448, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)))) - sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_CACHE_HIT, bp+560 /* &iCur */, bp+564 /* &iHi */, 1) - libc.Xprintf(tls, ts+24639 /* "-- Page cache hi..." */, libc.VaList(bp+456, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)))) - sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_CACHE_MISS, bp+560 /* &iCur */, bp+564 /* &iHi */, 1) - libc.Xprintf(tls, ts+24675 /* "-- Page cache mi..." */, libc.VaList(bp+464, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)))) - sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_CACHE_WRITE, bp+560 /* &iCur */, bp+564 /* &iHi */, 1) - libc.Xprintf(tls, ts+24711 /* "-- Page cache wr..." */, libc.VaList(bp+472, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)))) - sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_SCHEMA_USED, bp+560 /* &iCur */, bp+564 /* &iHi */, 0) - libc.Xprintf(tls, ts+24747 /* "-- Schema Heap U..." */, libc.VaList(bp+480, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)))) - sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_STMT_USED, bp+560 /* &iCur */, bp+564 /* &iHi */, 0) - libc.Xprintf(tls, ts+24789 /* "-- Statement Hea..." */, libc.VaList(bp+488, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)))) + sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_LOOKASIDE_USED, bp+568 /* &iCur */, bp+572 /* &iHi */, 0) + libc.Xprintf(tls, ts+24512 /* "-- Lookaside Slo..." */, libc.VaList(bp+416, *(*int32)(unsafe.Pointer(bp + 568 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 572 /* iHi */)))) + sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_LOOKASIDE_HIT, bp+568 /* &iCur */, bp+572 /* &iHi */, 0) + libc.Xprintf(tls, ts+24557 /* "-- Successful lo..." */, libc.VaList(bp+432, *(*int32)(unsafe.Pointer(bp + 572 /* iHi */)))) + sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE, bp+568 /* &iCur */, bp+572 /* &iHi */, 0) + libc.Xprintf(tls, ts+24593 /* "-- Lookaside siz..." */, libc.VaList(bp+440, *(*int32)(unsafe.Pointer(bp + 572 /* iHi */)))) + sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL, bp+568 /* &iCur */, bp+572 /* &iHi */, 0) + libc.Xprintf(tls, ts+24629 /* "-- Lookaside OOM..." */, libc.VaList(bp+448, *(*int32)(unsafe.Pointer(bp + 572 /* iHi */)))) + sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_CACHE_USED, bp+568 /* &iCur */, bp+572 /* &iHi */, 0) + libc.Xprintf(tls, ts+24665 /* "-- Pager Heap Us..." */, libc.VaList(bp+456, *(*int32)(unsafe.Pointer(bp + 568 /* iCur */)))) + sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_CACHE_HIT, bp+568 /* &iCur */, bp+572 /* &iHi */, 1) + libc.Xprintf(tls, ts+24707 /* "-- Page cache hi..." */, libc.VaList(bp+464, *(*int32)(unsafe.Pointer(bp + 568 /* iCur */)))) + sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_CACHE_MISS, bp+568 /* &iCur */, bp+572 /* &iHi */, 1) + libc.Xprintf(tls, ts+24743 /* "-- Page cache mi..." */, libc.VaList(bp+472, *(*int32)(unsafe.Pointer(bp + 568 /* iCur */)))) + sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_CACHE_WRITE, bp+568 /* &iCur */, bp+572 /* &iHi */, 1) + libc.Xprintf(tls, ts+24779 /* "-- Page cache wr..." */, libc.VaList(bp+480, *(*int32)(unsafe.Pointer(bp + 568 /* iCur */)))) + sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_SCHEMA_USED, bp+568 /* &iCur */, bp+572 /* &iHi */, 0) + libc.Xprintf(tls, ts+24815 /* "-- Schema Heap U..." */, libc.VaList(bp+488, *(*int32)(unsafe.Pointer(bp + 568 /* iCur */)))) + sqlite3.Xsqlite3_db_status(tls, g.db, SQLITE_DBSTATUS_STMT_USED, bp+568 /* &iCur */, bp+572 /* &iHi */, 0) + libc.Xprintf(tls, ts+24857 /* "-- Statement Hea..." */, libc.VaList(bp+496, *(*int32)(unsafe.Pointer(bp + 568 /* iCur */)))) } sqlite3.Xsqlite3_close(tls, g.db) @@ -7004,16 +7062,16 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143 // Global memory usage statistics printed after the database connection // has closed. Memory usage should be zero at this point. if showStats != 0 { - sqlite3.Xsqlite3_status(tls, SQLITE_STATUS_MEMORY_USED, bp+560 /* &iCur */, bp+564 /* &iHi */, 0) - libc.Xprintf(tls, ts+24831 /* "-- Memory Used (..." */, libc.VaList(bp+496, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 564 /* iHi */)))) - sqlite3.Xsqlite3_status(tls, SQLITE_STATUS_MALLOC_COUNT, bp+560 /* &iCur */, bp+564 /* &iHi */, 0) - libc.Xprintf(tls, ts+24876 /* "-- Outstanding A..." */, libc.VaList(bp+512, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 564 /* iHi */)))) - sqlite3.Xsqlite3_status(tls, SQLITE_STATUS_PAGECACHE_OVERFLOW, bp+560 /* &iCur */, bp+564 /* &iHi */, 0) - libc.Xprintf(tls, ts+24921 /* "-- Pcache Overfl..." */, libc.VaList(bp+528, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 564 /* iHi */)))) - sqlite3.Xsqlite3_status(tls, SQLITE_STATUS_MALLOC_SIZE, bp+560 /* &iCur */, bp+564 /* &iHi */, 0) - libc.Xprintf(tls, ts+24966 /* "-- Largest Alloc..." */, libc.VaList(bp+544, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */)))) - sqlite3.Xsqlite3_status(tls, SQLITE_STATUS_PAGECACHE_SIZE, bp+560 /* &iCur */, bp+564 /* &iHi */, 0) - libc.Xprintf(tls, ts+25008 /* "-- Largest Pcach..." */, libc.VaList(bp+552, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */)))) + sqlite3.Xsqlite3_status(tls, SQLITE_STATUS_MEMORY_USED, bp+568 /* &iCur */, bp+572 /* &iHi */, 0) + libc.Xprintf(tls, ts+24899 /* "-- Memory Used (..." */, libc.VaList(bp+504, *(*int32)(unsafe.Pointer(bp + 568 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 572 /* iHi */)))) + sqlite3.Xsqlite3_status(tls, SQLITE_STATUS_MALLOC_COUNT, bp+568 /* &iCur */, bp+572 /* &iHi */, 0) + libc.Xprintf(tls, ts+24944 /* "-- Outstanding A..." */, libc.VaList(bp+520, *(*int32)(unsafe.Pointer(bp + 568 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 572 /* iHi */)))) + sqlite3.Xsqlite3_status(tls, SQLITE_STATUS_PAGECACHE_OVERFLOW, bp+568 /* &iCur */, bp+572 /* &iHi */, 0) + libc.Xprintf(tls, ts+24989 /* "-- Pcache Overfl..." */, libc.VaList(bp+536, *(*int32)(unsafe.Pointer(bp + 568 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 572 /* iHi */)))) + sqlite3.Xsqlite3_status(tls, SQLITE_STATUS_MALLOC_SIZE, bp+568 /* &iCur */, bp+572 /* &iHi */, 0) + libc.Xprintf(tls, ts+25034 /* "-- Largest Alloc..." */, libc.VaList(bp+552, *(*int32)(unsafe.Pointer(bp + 572 /* iHi */)))) + sqlite3.Xsqlite3_status(tls, SQLITE_STATUS_PAGECACHE_SIZE, bp+568 /* &iCur */, bp+572 /* &iHi */, 0) + libc.Xprintf(tls, ts+25076 /* "-- Largest Pcach..." */, libc.VaList(bp+560, *(*int32)(unsafe.Pointer(bp + 572 /* iHi */)))) } if showStats != 0 { @@ -7027,5 +7085,5 @@ func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143 return 0 } -var ts1 = "Usage: %s [--options] DATABASE\nOptions:\n --autovacuum Enable AUTOVACUUM mode\n --cachesize N Set the cache size to N\n --checkpoint Run PRAGMA wal_checkpoint after each test case\n --exclusive Enable locking_mode=EXCLUSIVE\n --explain Like --sqlonly but with added EXPLAIN keywords\n --heap SZ MIN Memory allocator uses SZ bytes & min allocation MIN\n --incrvacuum Enable incremenatal vacuum mode\n --journal M Set the journal_mode to M\n --key KEY Set the encryption key to KEY\n --lookaside N SZ Configure lookaside for N slots of SZ bytes each\n --memdb Use an in-memory database\n --mmap SZ MMAP the first SZ bytes of the database file\n --multithread Set multithreaded mode\n --nomemstat Disable memory statistics\n --nosync Set PRAGMA synchronous=OFF\n --notnull Add NOT NULL constraints to table columns\n --output FILE Store SQL output in FILE\n --pagesize N Set the page size to N\n --pcache N SZ Configure N pages of pagecache each of size SZ bytes\n --primarykey Use PRIMARY KEY instead of UNIQUE where appropriate\n --repeat N Repeat each SELECT N times (default: 1)\n --reprepare Reprepare each statement upon every invocation\n --serialized Set serialized threading mode\n --singlethread Set single-threaded mode - disables all mutexing\n --sqlonly No-op. Only show the SQL that would have been run.\n --shrink-memory Invoke sqlite3_db_release_memory() frequently.\n --size N Relative test size. Default=100\n --stats Show statistics at the end\n --temp N N from 0 to 9. 0: no temp table. 9: all temp tables\n --testset T Run test-set T (main, cte, rtree, orm, fp, debug)\n --trace Turn on SQL tracing\n --threads N Use up to N threads for sorting\n --utf16be Set text encoding to UTF-16BE\n --utf16le Set text encoding to UTF-16LE\n --verify Run additional verification steps.\n --without-rowid Use WITHOUT ROWID where appropriate\n\x00 TEMP\x00\x00parameter too large - max 2147483648\x00KiB\x00MiB\x00GiB\x00KB\x00MB\x00GB\x00K\x00M\x00G\x00 billion\x00 million\x00 thousand\x00%s hundred\x00%s\x00zero\x00one\x00two\x00three\x00four\x00five\x00six\x00seven\x00eight\x00nine\x00ten\x00eleven\x00twelve\x00thirteen\x00fourteen\x00fifteen\x00sixteen\x00seventeen\x00eighteen\x00nineteen\x00twenty\x00thirty\x00forty\x00fifty\x00sixty\x00seventy\x00eighty\x00ninety\x00.......................................................................\x00/* %4d - %s%.*s */\n\x00%4d - %s%.*s \x00PRAGMA wal_checkpoint;\x00%4d.%03ds\n\x00 TOTAL%.*s %4d.%03ds\n\x00Verification Hash: %llu \x00\n\x00%02x\x00EXPLAIN \x00%.*s;\n\x00CREATE *\x00DROP *\x00ALTER *\x00SQL error: %s\n%s\n\x00exec error: %s\n\x00SQL error: %s\n\x00nil\x00-IFTBN\x000123456789abcdef\x00%d INSERTs into table with no index\x00BEGIN\x00CREATE%s TABLE t1(a INTEGER %s, b INTEGER %s, c TEXT %s);\x00INSERT INTO t1 VALUES(?1,?2,?3); -- %d times\x00COMMIT\x00%d ordered INSERTS with one index/PK\x00CREATE%s TABLE t2(a INTEGER %s %s, b INTEGER %s, c TEXT %s) %s\x00INSERT INTO t2 VALUES(?1,?2,?3); -- %d times\x00%d unordered INSERTS with one index/PK\x00CREATE%s TABLE t3(a INTEGER %s %s, b INTEGER %s, c TEXT %s) %s\x00INSERT INTO t3 VALUES(?1,?2,?3); -- %d times\x00%d SELECTS, numeric BETWEEN, unindexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(c) FROM t1\n WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, LIKE, unindexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(c) FROM t1\n WHERE c LIKE ?1; -- %d times\x00%d SELECTS w/ORDER BY, unindexed\x00SELECT a, b, c FROM t1 WHERE c LIKE ?1\n ORDER BY a; -- %d times\x00%d SELECTS w/ORDER BY and LIMIT, unindexed\x00SELECT a, b, c FROM t1 WHERE c LIKE ?1\n ORDER BY a LIMIT 10; -- %d times\x00CREATE INDEX five times\x00BEGIN;\x00CREATE UNIQUE INDEX t1b ON t1(b);\x00CREATE INDEX t1c ON t1(c);\x00CREATE UNIQUE INDEX t2b ON t2(b);\x00CREATE INDEX t2c ON t2(c DESC);\x00CREATE INDEX t3bc ON t3(b,c);\x00COMMIT;\x00%d SELECTS, numeric BETWEEN, indexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM t1\n WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, numeric BETWEEN, PK\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM t2\n WHERE a BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, text BETWEEN, indexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM t1\n WHERE c BETWEEN ?1 AND (?1||'~'); -- %d times\x00%d INSERTS with three indexes\x00CREATE%s TABLE t4(\n a INTEGER %s %s,\n b INTEGER %s,\n c TEXT %s\n) %s\x00CREATE INDEX t4b ON t4(b)\x00CREATE INDEX t4c ON t4(c)\x00INSERT INTO t4 SELECT * FROM t1\x00DELETE and REFILL one table\x00DELETE FROM t2;\x00INSERT INTO t2 SELECT * FROM t1;\x00VACUUM\x00ALTER TABLE ADD COLUMN, and query\x00ALTER TABLE t2 ADD COLUMN d DEFAULT 123\x00SELECT sum(d) FROM t2\x00%d UPDATES, numeric BETWEEN, indexed\x00UPDATE t2 SET d=b*2 WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d UPDATES of individual rows\x00UPDATE t2 SET d=b*3 WHERE a=?1; -- %d times\x00One big UPDATE of the whole %d-row table\x00UPDATE t2 SET d=b*4\x00Query added column after filling\x00%d DELETEs, numeric BETWEEN, indexed\x00DELETE FROM t2 WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d DELETEs of individual rows\x00DELETE FROM t3 WHERE a=?1; -- %d times\x00Refill two %d-row tables using REPLACE\x00REPLACE INTO t2(a,b,c) SELECT a,b,c FROM t1\x00REPLACE INTO t3(a,b,c) SELECT a,b,c FROM t1\x00Refill a %d-row table using (b&1)==(a&1)\x00INSERT INTO t2(a,b,c)\n SELECT a,b,c FROM t1 WHERE (b&1)==(a&1);\x00INSERT INTO t2(a,b,c)\n SELECT a,b,c FROM t1 WHERE (b&1)<>(a&1);\x00%d four-ways joins\x00SELECT t1.c FROM t1, t2, t3, t4\n WHERE t4.a BETWEEN ?1 AND ?2\n AND t3.a=t4.b\n AND t2.a=t3.b\n AND t1.c=t2.c\x00subquery in result set\x00SELECT sum(a), max(c),\n avg((SELECT a FROM t2 WHERE 5+t2.b=t1.b) AND rowid0\n AND NOT EXISTS (\n SELECT 1\n FROM digits AS lp\n WHERE z.z = substr(s, ((ind-1)/9)*9 + lp, 1)\n OR z.z = substr(s, ((ind-1)%%9) + (lp-1)*9 + 1, 1)\n OR z.z = substr(s, (((ind-1)/3) %% 3) * 3\n + ((ind-1)/27) * 27 + lp\n + ((lp-1) / 3) * 6, 1)\n )\n )\nSELECT s FROM x WHERE ind=0;\x00Sudoku with VALUES 'digits'\x00WITH RECURSIVE\n input(sud) AS (VALUES(?1)),\n digits(z,lp) AS (VALUES('1',1),('2',2),('3',3),('4',4),('5',5),\n ('6',6),('7',7),('8',8),('9',9)),\n x(s, ind) AS (\n SELECT sud, instr(sud, '.') FROM input\n UNION ALL\n SELECT\n substr(s, 1, ind-1) || z || substr(s, ind+1),\n instr( substr(s, 1, ind-1) || z || substr(s, ind+1), '.' )\n FROM x, digits AS z\n WHERE ind>0\n AND NOT EXISTS (\n SELECT 1\n FROM digits AS lp\n WHERE z.z = substr(s, ((ind-1)/9)*9 + lp, 1)\n OR z.z = substr(s, ((ind-1)%%9) + (lp-1)*9 + 1, 1)\n OR z.z = substr(s, (((ind-1)/3) %% 3) * 3\n + ((ind-1)/27) * 27 + lp\n + ((lp-1) / 3) * 6, 1)\n )\n )\nSELECT s FROM x WHERE ind=0;\x00Mandelbrot Set with spacing=%f\x00WITH RECURSIVE \n xaxis(x) AS (VALUES(-2.0) UNION ALL SELECT x+?1 FROM xaxis WHERE x<1.2),\n yaxis(y) AS (VALUES(-1.0) UNION ALL SELECT y+?2 FROM yaxis WHERE y<1.0),\n m(iter, cx, cy, x, y) AS (\n SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis\n UNION ALL\n SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m \n WHERE (x*x + y*y) < 4.0 AND iter<28\n ),\n m2(iter, cx, cy) AS (\n SELECT max(iter), cx, cy FROM m GROUP BY cx, cy\n ),\n a(t) AS (\n SELECT group_concat( substr(' .+*#', 1+min(iter/7,4), 1), '') \n FROM m2 GROUP BY cy\n )\nSELECT group_concat(rtrim(t),x'0a') FROM a;\x00EXCEPT operator on %d-element tables\x00WITH RECURSIVE \n t1(x) AS (VALUES(2) UNION ALL SELECT x+2 FROM t1 WHERE x<%d),\n t2(y) AS (VALUES(3) UNION ALL SELECT y+3 FROM t2 WHERE y<%d)\nSELECT count(x), avg(x) FROM (\n SELECT x FROM t1 EXCEPT SELECT y FROM t2 ORDER BY 1\n);\x00534...9..67.195....98....6.8...6...34..8.3..1....2...6.6....28....419..5...28..79\x0053....9..6..195....98....6.8...6...34..8.3..1....2...6.6....28....419..5....8..79\x0053.......6..195....98....6.8...6...34..8.3..1....2...6.6....28....419..5....8..79\x00%d.%de%d\x00Fill a table with %d FP values\x00CREATE%s TABLE t1(a REAL %s, b REAL %s);\x00INSERT INTO t1 VALUES(?1,?2); -- %d times\x00%d range queries\x00SELECT sum(b) FROM t1 WHERE a BETWEEN ?1 AND ?2\x00CREATE INDEX three times\x00CREATE INDEX t1a ON t1(a);\x00CREATE INDEX t1b ON t1(b);\x00CREATE INDEX t1ab ON t1(a,b);\x00%d indexed range queries\x00%d calls to round()\x00SELECT sum(round(a,2)+round(b,4)) FROM t1;\x00%d printf() calls\x00WITH c(fmt) AS (VALUES('%%g'),('%%e'),('%%!g'),('%%.20f'))SELECT sum(printf(fmt,a)) FROM t1, c\x00%d INSERTs into an r-tree\x00CREATE VIRTUAL TABLE rt1 USING rtree(id,x0,x1,y0,y1,z0,z1)\x00INSERT INTO rt1(id,x0,x1,y0,y1,z0,z1)VALUES(?1,?2,?3,?4,?5,?6,?7)\x00Copy from rtree to a regular table\x00CREATE TABLE t1(id INTEGER PRIMARY KEY,x0,x1,y0,y1,z0,z1)\x00INSERT INTO t1 SELECT * FROM rt1\x00%d one-dimensional intersect slice queries\x00SELECT count(*) FROM rt1 WHERE x0>=?1 AND x1<=?2\x00Verify result from 1-D intersect slice queries\x00SELECT count(*) FROM t1 WHERE x0>=?1 AND x1<=?2\x00Count disagree step %d: %d..%d. %d vs %d\x00%d one-dimensional overlap slice queries\x00SELECT count(*) FROM rt1 WHERE y1>=?1 AND y0<=?2\x00Verify result from 1-D overlap slice queries\x00SELECT count(*) FROM t1 WHERE y1>=?1 AND y0<=?2\x00%d custom geometry callback queries\x00xslice\x00SELECT count(*) FROM rt1 WHERE id MATCH xslice(?1,?2)\x00%d three-dimensional intersect box queries\x00SELECT count(*) FROM rt1 WHERE x1>=?1 AND x0<=?2 AND y1>=?1 AND y0<=?2 AND z1>=?1 AND z0<=?2\x00%d rowid queries\x00SELECT * FROM rt1 WHERE id=?1\x00%d UPDATEs using rowid\x00UPDATE rt1 SET x0=x0+100, x1=x1+100 WHERE id=?1\x00%d UPDATEs using one-dimensional overlap\x00UPDATE rt1 SET x0=x0-100, x1=x1-100 WHERE y1>=?1 AND y0<=?1+5\x00%d DELETEs using rowid\x00DELETE FROM rt1 WHERE id=?1\x00%d DELETEs using one-dimensional overlap\x00DELETE FROM rt1 WHERE y1>=?1 AND y0<=?1+5\x00Restore deleted entries using INSERT OR IGNORE\x00INSERT OR IGNORE INTO rt1 SELECT * FROM t1\x00Fill %d rows\x00BEGIN;CREATE TABLE ZLOOKSLIKECOREDATA ( ZPK INTEGER PRIMARY KEY, ZTERMFITTINGHOUSINGCOMMAND INTEGER, ZBRIEFGOBYDODGERHEIGHT BLOB, ZCAPABLETRIPDOORALMOND BLOB, ZDEPOSITPAIRCOLLEGECOMET INTEGER, ZFRAMEENTERSIMPLEMOUTH INTEGER, ZHOPEFULGATEHOLECHALK INTEGER, ZSLEEPYUSERGRANDBOWL TIMESTAMP, ZDEWPEACHCAREERCELERY INTEGER, ZHANGERLITHIUMDINNERMEET VARCHAR, ZCLUBRELEASELIZARDADVICE VARCHAR, ZCHARGECLICKHUMANEHIRE INTEGER, ZFINGERDUEPIZZAOPTION TIMESTAMP, ZFLYINGDOCTORTABLEMELODY BLOB, ZLONGFINLEAVEIMAGEOIL TIMESTAMP, ZFAMILYVISUALOWNERMATTER BLOB, ZGOLDYOUNGINITIALNOSE FLOAT, ZCAUSESALAMITERMCYAN BLOB, ZSPREADMOTORBISCUITBACON FLOAT, ZGIFTICEFISHGLUEHAIR INTEGER, ZNOTICEPEARPOLICYJUICE TIMESTAMP, ZBANKBUFFALORECOVERORBIT TIMESTAMP, ZLONGDIETESSAYNATURE FLOAT, ZACTIONRANGEELEGANTNEUTRON BLOB, ZCADETBRIGHTPLANETBANK TIMESTAMP, ZAIRFORGIVEHEADFROG BLOB, ZSHARKJUSTFRUITMOVIE VARCHAR, ZFARMERMORNINGMIRRORCONCERN BLOB, ZWOODPOETRYCOBBLERBENCH VARCHAR, ZHAFNIUMSCRIPTSALADMOTOR INTEGER, ZPROBLEMCLUBPOPOVERJELLY FLOAT, ZEIGHTLEADERWORKERMOST TIMESTAMP, ZGLASSRESERVEBARIUMMEAL BLOB, ZCLAMBITARUGULAFAJITA BLOB, ZDECADEJOYOUSWAVEHABIT FLOAT, ZCOMPANYSUMMERFIBERELF INTEGER, ZTREATTESTQUILLCHARGE TIMESTAMP, ZBROWBALANCEKEYCHOWDER FLOAT, ZPEACHCOPPERDINNERLAKE FLOAT, ZDRYWALLBEYONDBROWNBOWL VARCHAR, ZBELLYCRASHITEMLACK BLOB, ZTENNISCYCLEBILLOFFICER INTEGER, ZMALLEQUIPTHANKSGLUE FLOAT, ZMISSREPLYHUMANLIVING INTEGER, ZKIWIVISUALPRIDEAPPLE VARCHAR, ZWISHHITSKINMOTOR BLOB, ZCALMRACCOONPROGRAMDEBIT VARCHAR, ZSHINYASSISTLIVINGCRAB VARCHAR, ZRESOLVEWRISTWRAPAPPLE VARCHAR, ZAPPEALSIMPLESECONDHOUSING BLOB, ZCORNERANCHORTAPEDIVER TIMESTAMP, ZMEMORYREQUESTSOURCEBIG VARCHAR, ZTRYFACTKEEPMILK TIMESTAMP, ZDIVERPAINTLEATHEREASY INTEGER, ZSORTMISTYQUOTECABBAGE BLOB, ZTUNEGASBUFFALOCAPITAL BLOB, ZFILLSTOPLAWJOYFUL FLOAT, ZSTEELCAREFULPLATENUMBER FLOAT, ZGIVEVIVIDDIVINEMEANING INTEGER, ZTREATPACKFUTURECONVERT VARCHAR, ZCALMLYGEMFINISHEFFECT INTEGER, ZCABBAGESOCKEASEMINUTE BLOB, ZPLANETFAMILYPUREMEMORY TIMESTAMP, ZMERRYCRACKTRAINLEADER BLOB, ZMINORWAYPAPERCLASSY TIMESTAMP, ZEAGLELINEMINEMAIL VARCHAR, ZRESORTYARDGREENLET TIMESTAMP, ZYARDOREGANOVIVIDJEWEL TIMESTAMP, ZPURECAKEVIVIDNEATLY FLOAT, ZASKCONTACTMONITORFUN TIMESTAMP, ZMOVEWHOGAMMAINCH VARCHAR, ZLETTUCEBIRDMEETDEBATE TIMESTAMP, ZGENENATURALHEARINGKITE VARCHAR, ZMUFFINDRYERDRAWFORTUNE FLOAT, ZGRAYSURVEYWIRELOVE FLOAT, ZPLIERSPRINTASKOREGANO INTEGER, ZTRAVELDRIVERCONTESTLILY INTEGER, ZHUMORSPICESANDKIDNEY TIMESTAMP, ZARSENICSAMPLEWAITMUON INTEGER, ZLACEADDRESSGROUNDCAREFUL FLOAT, ZBAMBOOMESSWASABIEVENING BLOB, ZONERELEASEAVERAGENURSE INTEGER, ZRADIANTWHENTRYCARD TIMESTAMP, ZREWARDINSIDEMANGOINTENSE FLOAT, ZNEATSTEWPARTIRON TIMESTAMP, ZOUTSIDEPEAHENCOUNTICE TIMESTAMP, ZCREAMEVENINGLIPBRANCH FLOAT, ZWHALEMATHAVOCADOCOPPER FLOAT, ZLIFEUSELEAFYBELL FLOAT, ZWEALTHLINENGLEEFULDAY VARCHAR, ZFACEINVITETALKGOLD BLOB, ZWESTAMOUNTAFFECTHEARING INTEGER, ZDELAYOUTCOMEHORNAGENCY INTEGER, ZBIGTHINKCONVERTECONOMY BLOB, ZBASEGOUDAREGULARFORGIVE TIMESTAMP, ZPATTERNCLORINEGRANDCOLBY TIMESTAMP, ZCYANBASEFEEDADROIT INTEGER, ZCARRYFLOORMINNOWDRAGON TIMESTAMP, ZIMAGEPENCILOTHERBOTTOM FLOAT, ZXENONFLIGHTPALEAPPLE TIMESTAMP, ZHERRINGJOKEFEATUREHOPEFUL FLOAT, ZCAPYEARLYRIVETBRUSH FLOAT, ZAGEREEDFROGBASKET VARCHAR, ZUSUALBODYHALIBUTDIAMOND VARCHAR, ZFOOTTAPWORDENTRY VARCHAR, ZDISHKEEPBLESTMONITOR FLOAT, ZBROADABLESOLIDCASUAL INTEGER, ZSQUAREGLEEFULCHILDLIGHT INTEGER, ZHOLIDAYHEADPONYDETAIL INTEGER, ZGENERALRESORTSKYOPEN TIMESTAMP, ZGLADSPRAYKIDNEYGUPPY VARCHAR, ZSWIMHEAVYMENTIONKIND BLOB, ZMESSYSULFURDREAMFESTIVE BLOB, ZSKYSKYCLASSICBRIEF VARCHAR, ZDILLASKHOKILEMON FLOAT, ZJUNIORSHOWPRESSNOVA FLOAT, ZSIZETOEAWARDFRESH TIMESTAMP, ZKEYFAILAPRICOTMETAL VARCHAR, ZHANDYREPAIRPROTONAIRPORT VARCHAR, ZPOSTPROTEINHANDLEACTOR BLOB);\x00INSERT INTO ZLOOKSLIKECOREDATA(ZPK,ZAIRFORGIVEHEADFROG,ZGIFTICEFISHGLUEHAIR,ZDELAYOUTCOMEHORNAGENCY,ZSLEEPYUSERGRANDBOWL,ZGLASSRESERVEBARIUMMEAL,ZBRIEFGOBYDODGERHEIGHT,ZBAMBOOMESSWASABIEVENING,ZFARMERMORNINGMIRRORCONCERN,ZTREATPACKFUTURECONVERT,ZCAUSESALAMITERMCYAN,ZCALMRACCOONPROGRAMDEBIT,ZHOLIDAYHEADPONYDETAIL,ZWOODPOETRYCOBBLERBENCH,ZHAFNIUMSCRIPTSALADMOTOR,ZUSUALBODYHALIBUTDIAMOND,ZOUTSIDEPEAHENCOUNTICE,ZDIVERPAINTLEATHEREASY,ZWESTAMOUNTAFFECTHEARING,ZSIZETOEAWARDFRESH,ZDEWPEACHCAREERCELERY,ZSTEELCAREFULPLATENUMBER,ZCYANBASEFEEDADROIT,ZCALMLYGEMFINISHEFFECT,ZHANDYREPAIRPROTONAIRPORT,ZGENENATURALHEARINGKITE,ZBROADABLESOLIDCASUAL,ZPOSTPROTEINHANDLEACTOR,ZLACEADDRESSGROUNDCAREFUL,ZIMAGEPENCILOTHERBOTTOM,ZPROBLEMCLUBPOPOVERJELLY,ZPATTERNCLORINEGRANDCOLBY,ZNEATSTEWPARTIRON,ZAPPEALSIMPLESECONDHOUSING,ZMOVEWHOGAMMAINCH,ZTENNISCYCLEBILLOFFICER,ZSHARKJUSTFRUITMOVIE,ZKEYFAILAPRICOTMETAL,ZCOMPANYSUMMERFIBERELF,ZTERMFITTINGHOUSINGCOMMAND,ZRESORTYARDGREENLET,ZCABBAGESOCKEASEMINUTE,ZSQUAREGLEEFULCHILDLIGHT,ZONERELEASEAVERAGENURSE,ZBIGTHINKCONVERTECONOMY,ZPLIERSPRINTASKOREGANO,ZDECADEJOYOUSWAVEHABIT,ZDRYWALLBEYONDBROWNBOWL,ZCLUBRELEASELIZARDADVICE,ZWHALEMATHAVOCADOCOPPER,ZBELLYCRASHITEMLACK,ZLETTUCEBIRDMEETDEBATE,ZCAPABLETRIPDOORALMOND,ZRADIANTWHENTRYCARD,ZCAPYEARLYRIVETBRUSH,ZAGEREEDFROGBASKET,ZSWIMHEAVYMENTIONKIND,ZTRAVELDRIVERCONTESTLILY,ZGLADSPRAYKIDNEYGUPPY,ZBANKBUFFALORECOVERORBIT,ZFINGERDUEPIZZAOPTION,ZCLAMBITARUGULAFAJITA,ZLONGFINLEAVEIMAGEOIL,ZLONGDIETESSAYNATURE,ZJUNIORSHOWPRESSNOVA,ZHOPEFULGATEHOLECHALK,ZDEPOSITPAIRCOLLEGECOMET,ZWEALTHLINENGLEEFULDAY,ZFILLSTOPLAWJOYFUL,ZTUNEGASBUFFALOCAPITAL,ZGRAYSURVEYWIRELOVE,ZCORNERANCHORTAPEDIVER,ZREWARDINSIDEMANGOINTENSE,ZCADETBRIGHTPLANETBANK,ZPLANETFAMILYPUREMEMORY,ZTREATTESTQUILLCHARGE,ZCREAMEVENINGLIPBRANCH,ZSKYSKYCLASSICBRIEF,ZARSENICSAMPLEWAITMUON,ZBROWBALANCEKEYCHOWDER,ZFLYINGDOCTORTABLEMELODY,ZHANGERLITHIUMDINNERMEET,ZNOTICEPEARPOLICYJUICE,ZSHINYASSISTLIVINGCRAB,ZLIFEUSELEAFYBELL,ZFACEINVITETALKGOLD,ZGENERALRESORTSKYOPEN,ZPURECAKEVIVIDNEATLY,ZKIWIVISUALPRIDEAPPLE,ZMESSYSULFURDREAMFESTIVE,ZCHARGECLICKHUMANEHIRE,ZHERRINGJOKEFEATUREHOPEFUL,ZYARDOREGANOVIVIDJEWEL,ZFOOTTAPWORDENTRY,ZWISHHITSKINMOTOR,ZBASEGOUDAREGULARFORGIVE,ZMUFFINDRYERDRAWFORTUNE,ZACTIONRANGEELEGANTNEUTRON,ZTRYFACTKEEPMILK,ZPEACHCOPPERDINNERLAKE,ZFRAMEENTERSIMPLEMOUTH,ZMERRYCRACKTRAINLEADER,ZMEMORYREQUESTSOURCEBIG,ZCARRYFLOORMINNOWDRAGON,ZMINORWAYPAPERCLASSY,ZDILLASKHOKILEMON,ZRESOLVEWRISTWRAPAPPLE,ZASKCONTACTMONITORFUN,ZGIVEVIVIDDIVINEMEANING,ZEIGHTLEADERWORKERMOST,ZMISSREPLYHUMANLIVING,ZXENONFLIGHTPALEAPPLE,ZSORTMISTYQUOTECABBAGE,ZEAGLELINEMINEMAIL,ZFAMILYVISUALOWNERMATTER,ZSPREADMOTORBISCUITBACON,ZDISHKEEPBLESTMONITOR,ZMALLEQUIPTHANKSGLUE,ZGOLDYOUNGINITIALNOSE,ZHUMORSPICESANDKIDNEY)VALUES(?1,?26,?20,?93,?8,?33,?3,?81,?28,?60,?18,?47,?109,?29,?30,?104,?86,?54,?92,?117,?9,?58,?97,?61,?119,?73,?107,?120,?80,?99,?31,?96,?85,?50,?71,?42,?27,?118,?36,?2,?67,?62,?108,?82,?94,?76,?35,?40,?11,?88,?41,?72,?4,?83,?102,?103,?112,?77,?111,?22,?13,?34,?15,?23,?116,?7,?5,?90,?57,?56,?75,?51,?84,?25,?63,?37,?87,?114,?79,?38,?14,?10,?21,?48,?89,?91,?110,?69,?45,?113,?12,?101,?68,?105,?46,?95,?74,?24,?53,?39,?6,?64,?52,?98,?65,?115,?49,?70,?59,?32,?44,?100,?55,?66,?16,?19,?106,?43,?17,?78);\x00Query %d rows by rowid\x00SELECT ZCYANBASEFEEDADROIT,ZJUNIORSHOWPRESSNOVA,ZCAUSESALAMITERMCYAN,ZHOPEFULGATEHOLECHALK,ZHUMORSPICESANDKIDNEY,ZSWIMHEAVYMENTIONKIND,ZMOVEWHOGAMMAINCH,ZAPPEALSIMPLESECONDHOUSING,ZHAFNIUMSCRIPTSALADMOTOR,ZNEATSTEWPARTIRON,ZLONGFINLEAVEIMAGEOIL,ZDEWPEACHCAREERCELERY,ZXENONFLIGHTPALEAPPLE,ZCALMRACCOONPROGRAMDEBIT,ZUSUALBODYHALIBUTDIAMOND,ZTRYFACTKEEPMILK,ZWEALTHLINENGLEEFULDAY,ZLONGDIETESSAYNATURE,ZLIFEUSELEAFYBELL,ZTREATPACKFUTURECONVERT,ZMEMORYREQUESTSOURCEBIG,ZYARDOREGANOVIVIDJEWEL,ZDEPOSITPAIRCOLLEGECOMET,ZSLEEPYUSERGRANDBOWL,ZBRIEFGOBYDODGERHEIGHT,ZCLUBRELEASELIZARDADVICE,ZCAPABLETRIPDOORALMOND,ZDRYWALLBEYONDBROWNBOWL,ZASKCONTACTMONITORFUN,ZKIWIVISUALPRIDEAPPLE,ZNOTICEPEARPOLICYJUICE,ZPEACHCOPPERDINNERLAKE,ZSTEELCAREFULPLATENUMBER,ZGLADSPRAYKIDNEYGUPPY,ZCOMPANYSUMMERFIBERELF,ZTENNISCYCLEBILLOFFICER,ZIMAGEPENCILOTHERBOTTOM,ZWESTAMOUNTAFFECTHEARING,ZDIVERPAINTLEATHEREASY,ZSKYSKYCLASSICBRIEF,ZMESSYSULFURDREAMFESTIVE,ZMERRYCRACKTRAINLEADER,ZBROADABLESOLIDCASUAL,ZGLASSRESERVEBARIUMMEAL,ZTUNEGASBUFFALOCAPITAL,ZBANKBUFFALORECOVERORBIT,ZTREATTESTQUILLCHARGE,ZBAMBOOMESSWASABIEVENING,ZREWARDINSIDEMANGOINTENSE,ZEAGLELINEMINEMAIL,ZCALMLYGEMFINISHEFFECT,ZKEYFAILAPRICOTMETAL,ZFINGERDUEPIZZAOPTION,ZCADETBRIGHTPLANETBANK,ZGOLDYOUNGINITIALNOSE,ZMISSREPLYHUMANLIVING,ZEIGHTLEADERWORKERMOST,ZFRAMEENTERSIMPLEMOUTH,ZBIGTHINKCONVERTECONOMY,ZFACEINVITETALKGOLD,ZPOSTPROTEINHANDLEACTOR,ZHERRINGJOKEFEATUREHOPEFUL,ZCABBAGESOCKEASEMINUTE,ZMUFFINDRYERDRAWFORTUNE,ZPROBLEMCLUBPOPOVERJELLY,ZGIVEVIVIDDIVINEMEANING,ZGENENATURALHEARINGKITE,ZGENERALRESORTSKYOPEN,ZLETTUCEBIRDMEETDEBATE,ZBASEGOUDAREGULARFORGIVE,ZCHARGECLICKHUMANEHIRE,ZPLANETFAMILYPUREMEMORY,ZMINORWAYPAPERCLASSY,ZCAPYEARLYRIVETBRUSH,ZSIZETOEAWARDFRESH,ZARSENICSAMPLEWAITMUON,ZSQUAREGLEEFULCHILDLIGHT,ZSHINYASSISTLIVINGCRAB,ZCORNERANCHORTAPEDIVER,ZDECADEJOYOUSWAVEHABIT,ZTRAVELDRIVERCONTESTLILY,ZFLYINGDOCTORTABLEMELODY,ZSHARKJUSTFRUITMOVIE,ZFAMILYVISUALOWNERMATTER,ZFARMERMORNINGMIRRORCONCERN,ZGIFTICEFISHGLUEHAIR,ZOUTSIDEPEAHENCOUNTICE,ZSPREADMOTORBISCUITBACON,ZWISHHITSKINMOTOR,ZHOLIDAYHEADPONYDETAIL,ZWOODPOETRYCOBBLERBENCH,ZAIRFORGIVEHEADFROG,ZBROWBALANCEKEYCHOWDER,ZDISHKEEPBLESTMONITOR,ZCLAMBITARUGULAFAJITA,ZPLIERSPRINTASKOREGANO,ZRADIANTWHENTRYCARD,ZDELAYOUTCOMEHORNAGENCY,ZPURECAKEVIVIDNEATLY,ZPATTERNCLORINEGRANDCOLBY,ZHANDYREPAIRPROTONAIRPORT,ZAGEREEDFROGBASKET,ZSORTMISTYQUOTECABBAGE,ZFOOTTAPWORDENTRY,ZRESOLVEWRISTWRAPAPPLE,ZDILLASKHOKILEMON,ZFILLSTOPLAWJOYFUL,ZACTIONRANGEELEGANTNEUTRON,ZRESORTYARDGREENLET,ZCREAMEVENINGLIPBRANCH,ZWHALEMATHAVOCADOCOPPER,ZGRAYSURVEYWIRELOVE,ZBELLYCRASHITEMLACK,ZHANGERLITHIUMDINNERMEET,ZCARRYFLOORMINNOWDRAGON,ZMALLEQUIPTHANKSGLUE,ZTERMFITTINGHOUSINGCOMMAND,ZONERELEASEAVERAGENURSE,ZLACEADDRESSGROUNDCAREFUL FROM ZLOOKSLIKECOREDATA WHERE ZPK=?1;\x00IBBIIITIVVITBTBFBFITTFBTBVBVIFTBBFITFFVBIFIVBVVVBTVTIBBFFIVIBTBTVTTFTVTVFFIITIFBITFTTFFFVBIIBTTITFTFFVVVFIIITVBBVFFTVVB\x00BEGIN;CREATE TABLE t1(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TABLE t2(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TABLE t3(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE VIEW v1 AS SELECT rowid, i, t FROM t1;CREATE VIEW v2 AS SELECT rowid, i, t FROM t2;CREATE VIEW v3 AS SELECT rowid, i, t FROM t3;\x00INSERT INTO t%d VALUES(NULL,?1,?2)\x00CREATE INDEX i1 ON t1(t);CREATE INDEX i2 ON t2(t);CREATE INDEX i3 ON t3(t);COMMIT;\x00speed4p-join1\x00SELECT * FROM t1, t2, t3 WHERE t1.oid = t2.oid AND t2.oid = t3.oid\x00speed4p-join2\x00SELECT * FROM t1, t2, t3 WHERE t1.t = t2.t AND t2.t = t3.t\x00speed4p-view1\x00SELECT * FROM v%d WHERE rowid = ?\x00speed4p-table1\x00SELECT * FROM t%d WHERE rowid = ?\x00speed4p-subselect1\x00SELECT (SELECT t FROM t1 WHERE rowid = ?1),(SELECT t FROM t2 WHERE rowid = ?1),(SELECT t FROM t3 WHERE rowid = ?1)\x00speed4p-rowid-update\x00UPDATE t1 SET i=i+1 WHERE rowid=?1\x00CREATE TABLE t5(t TEXT PRIMARY KEY, i INTEGER);\x00speed4p-insert-ignore\x00INSERT OR IGNORE INTO t5 SELECT t, i FROM t1\x00CREATE TABLE log(op TEXT, r INTEGER, i INTEGER, t TEXT);CREATE TABLE t4(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TRIGGER t4_trigger1 AFTER INSERT ON t4 BEGIN INSERT INTO log VALUES('INSERT INTO t4', new.rowid, new.i, new.t);END;CREATE TRIGGER t4_trigger2 AFTER UPDATE ON t4 BEGIN INSERT INTO log VALUES('UPDATE OF t4', new.rowid, new.i, new.t);END;CREATE TRIGGER t4_trigger3 AFTER DELETE ON t4 BEGIN INSERT INTO log VALUES('DELETE OF t4', old.rowid, old.i, old.t);END;BEGIN;\x00speed4p-trigger1\x00INSERT INTO t4 VALUES(NULL, ?1, ?2)\x00speed4p-trigger2\x00UPDATE t4 SET i = ?1, t = ?2 WHERE rowid = ?3\x00speed4p-trigger3\x00DELETE FROM t4 WHERE rowid = ?1\x00DROP TABLE t4;DROP TABLE log;VACUUM;CREATE TABLE t4(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);BEGIN;\x00speed4p-notrigger1\x00speed4p-notrigger2\x00speed4p-notrigger3\x00%5d %5d %5d %s\n\x00/proc/%d/io\x00rb\x00-- %-28s %s\x00rchar: \x00Bytes received by read():\x00wchar: \x00Bytes sent to write():\x00syscr: \x00Read() system calls:\x00syscw: \x00Write() system calls:\x00read_bytes: \x00Bytes rcvd from storage:\x00write_bytes: \x00Bytes sent to storage:\x00cancelled_write_bytes: \x00Cancelled write bytes:\x00-- Compile option: %s\n\x00main\x00-- Speedtest1 for SQLite %s %.48s\n\x00UNIQUE\x00autovacuum\x00cachesize\x00missing argument on %s\n\x00exclusive\x00checkpoint\x00explain\x00heap\x00missing arguments on %s\n\x00incrvacuum\x00journal\x00key\x00lookaside\x00memdb\x00multithread\x00nomemstat\x00mmap\x00nosync\x00notnull\x00NOT NULL\x00output\x00-\x00wb\x00cannot open \"%s\" for writing\n\x00pagesize\x00pcache\x00primarykey\x00PRIMARY KEY\x00repeat\x00reprepare\x00serialized\x00singlethread\x00sqlonly\x00shrink-memory\x00size\x00stats\x00temp\x00argument to --temp should be integer between 0 and 9\x00testset\x00trace\x00threads\x00utf16le\x00utf16be\x00verify\x00without-rowid\x00help\x00?\x00unknown option: %s\nUse \"%s -?\" for help\n\x00surplus argument: %s\nUse \"%s -?\" for help\n\x00cannot allocate %d-byte heap\n\x00heap configuration failed: %d\n\x00cannot allocate %lld-byte pcache\n\x00pcache configuration failed: %d\n\x00:memory:\x00Cannot open database file: %s\n\x00lookaside configuration failed: %d\n\x00random\x00PRAGMA temp_store=memory\x00PRAGMA mmap_size=%d\x00PRAGMA threads=%d\x00PRAGMA key('%s')\x00PRAGMA encoding=%s\x00PRAGMA auto_vacuum=FULL\x00PRAGMA auto_vacuum=INCREMENTAL\x00PRAGMA page_size=%d\x00PRAGMA cache_size=%d\x00PRAGMA synchronous=OFF\x00PRAGMA locking_mode=EXCLUSIVE\x00PRAGMA journal_mode=%s\x00.explain\n.echo on\n\x00 Begin testset \"%s\"\n\x00debug1\x00orm\x00cte\x00fp\x00trigger\x00rtree\x00unknown testset: \"%s\"\nChoices: cte debug1 fp main orm rtree trigger\n\x00Reset the database\x00SELECT name FROM main.sqlite_master WHERE sql LIKE 'CREATE %%TABLE%%'\x00DROP TABLE main.\"%w\"\x00SELECT name FROM temp.sqlite_master WHERE sql LIKE 'CREATE %%TABLE%%'\x00PRAGMA compile_options\x00-- Lookaside Slots Used: %d (max %d)\n\x00-- Successful lookasides: %d\n\x00-- Lookaside size faults: %d\n\x00-- Lookaside OOM faults: %d\n\x00-- Pager Heap Usage: %d bytes\n\x00-- Page cache hits: %d\n\x00-- Page cache misses: %d\n\x00-- Page cache writes: %d\n\x00-- Schema Heap Usage: %d bytes\n\x00-- Statement Heap Usage: %d bytes\n\x00-- Memory Used (bytes): %d (max %d)\n\x00-- Outstanding Allocations: %d (max %d)\n\x00-- Pcache Overflow Bytes: %d (max %d)\n\x00-- Largest Allocation: %d bytes\n\x00-- Largest Pcache Allocation: %d bytes\n\x00" +var ts1 = "Usage: %s [--options] DATABASE\nOptions:\n --autovacuum Enable AUTOVACUUM mode\n --cachesize N Set the cache size to N\n --checkpoint Run PRAGMA wal_checkpoint after each test case\n --exclusive Enable locking_mode=EXCLUSIVE\n --explain Like --sqlonly but with added EXPLAIN keywords\n --heap SZ MIN Memory allocator uses SZ bytes & min allocation MIN\n --incrvacuum Enable incremenatal vacuum mode\n --journal M Set the journal_mode to M\n --key KEY Set the encryption key to KEY\n --lookaside N SZ Configure lookaside for N slots of SZ bytes each\n --memdb Use an in-memory database\n --mmap SZ MMAP the first SZ bytes of the database file\n --multithread Set multithreaded mode\n --nomemstat Disable memory statistics\n --nosync Set PRAGMA synchronous=OFF\n --notnull Add NOT NULL constraints to table columns\n --output FILE Store SQL output in FILE\n --pagesize N Set the page size to N\n --pcache N SZ Configure N pages of pagecache each of size SZ bytes\n --primarykey Use PRIMARY KEY instead of UNIQUE where appropriate\n --repeat N Repeat each SELECT N times (default: 1)\n --reprepare Reprepare each statement upon every invocation\n --reserve N Reserve N bytes on each database page\n --serialized Set serialized threading mode\n --singlethread Set single-threaded mode - disables all mutexing\n --sqlonly No-op. Only show the SQL that would have been run.\n --shrink-memory Invoke sqlite3_db_release_memory() frequently.\n --size N Relative test size. Default=100\n --stats Show statistics at the end\n --temp N N from 0 to 9. 0: no temp table. 9: all temp tables\n --testset T Run test-set T (main, cte, rtree, orm, fp, debug)\n --trace Turn on SQL tracing\n --threads N Use up to N threads for sorting\n --utf16be Set text encoding to UTF-16BE\n --utf16le Set text encoding to UTF-16LE\n --verify Run additional verification steps.\n --without-rowid Use WITHOUT ROWID where appropriate\n\x00 TEMP\x00\x00parameter too large - max 2147483648\x00KiB\x00MiB\x00GiB\x00KB\x00MB\x00GB\x00K\x00M\x00G\x00 billion\x00 million\x00 thousand\x00%s hundred\x00%s\x00zero\x00one\x00two\x00three\x00four\x00five\x00six\x00seven\x00eight\x00nine\x00ten\x00eleven\x00twelve\x00thirteen\x00fourteen\x00fifteen\x00sixteen\x00seventeen\x00eighteen\x00nineteen\x00twenty\x00thirty\x00forty\x00fifty\x00sixty\x00seventy\x00eighty\x00ninety\x00.......................................................................\x00/* %4d - %s%.*s */\n\x00%4d - %s%.*s \x00PRAGMA wal_checkpoint;\x00%4d.%03ds\n\x00 TOTAL%.*s %4d.%03ds\n\x00Verification Hash: %llu \x00\n\x00%02x\x00EXPLAIN \x00%.*s;\n\x00CREATE *\x00DROP *\x00ALTER *\x00SQL error: %s\n%s\n\x00exec error: %s\n\x00SQL error: %s\n\x00nil\x00-IFTBN\x000123456789abcdef\x00%d INSERTs into table with no index\x00BEGIN\x00CREATE%s TABLE z1(a INTEGER %s, b INTEGER %s, c TEXT %s);\x00INSERT INTO z1 VALUES(?1,?2,?3); -- %d times\x00COMMIT\x00%d ordered INSERTS with one index/PK\x00CREATE%s TABLE z2(a INTEGER %s %s, b INTEGER %s, c TEXT %s) %s\x00INSERT INTO z2 VALUES(?1,?2,?3); -- %d times\x00%d unordered INSERTS with one index/PK\x00CREATE%s TABLE t3(a INTEGER %s %s, b INTEGER %s, c TEXT %s) %s\x00INSERT INTO t3 VALUES(?1,?2,?3); -- %d times\x00%d SELECTS, numeric BETWEEN, unindexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(c) FROM z1\n WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, LIKE, unindexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(c) FROM z1\n WHERE c LIKE ?1; -- %d times\x00%d SELECTS w/ORDER BY, unindexed\x00SELECT a, b, c FROM z1 WHERE c LIKE ?1\n ORDER BY a; -- %d times\x00%d SELECTS w/ORDER BY and LIMIT, unindexed\x00SELECT a, b, c FROM z1 WHERE c LIKE ?1\n ORDER BY a LIMIT 10; -- %d times\x00CREATE INDEX five times\x00BEGIN;\x00CREATE UNIQUE INDEX t1b ON z1(b);\x00CREATE INDEX t1c ON z1(c);\x00CREATE UNIQUE INDEX t2b ON z2(b);\x00CREATE INDEX t2c ON z2(c DESC);\x00CREATE INDEX t3bc ON t3(b,c);\x00COMMIT;\x00%d SELECTS, numeric BETWEEN, indexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM z1\n WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, numeric BETWEEN, PK\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM z2\n WHERE a BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, text BETWEEN, indexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM z1\n WHERE c BETWEEN ?1 AND (?1||'~'); -- %d times\x00%d INSERTS with three indexes\x00CREATE%s TABLE t4(\n a INTEGER %s %s,\n b INTEGER %s,\n c TEXT %s\n) %s\x00CREATE INDEX t4b ON t4(b)\x00CREATE INDEX t4c ON t4(c)\x00INSERT INTO t4 SELECT * FROM z1\x00DELETE and REFILL one table\x00DELETE FROM z2;\x00INSERT INTO z2 SELECT * FROM z1;\x00VACUUM\x00ALTER TABLE ADD COLUMN, and query\x00ALTER TABLE z2 ADD COLUMN d DEFAULT 123\x00SELECT sum(d) FROM z2\x00%d UPDATES, numeric BETWEEN, indexed\x00UPDATE z2 SET d=b*2 WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d UPDATES of individual rows\x00UPDATE z2 SET d=b*3 WHERE a=?1; -- %d times\x00One big UPDATE of the whole %d-row table\x00UPDATE z2 SET d=b*4\x00Query added column after filling\x00%d DELETEs, numeric BETWEEN, indexed\x00DELETE FROM z2 WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d DELETEs of individual rows\x00DELETE FROM t3 WHERE a=?1; -- %d times\x00Refill two %d-row tables using REPLACE\x00REPLACE INTO z2(a,b,c) SELECT a,b,c FROM z1\x00REPLACE INTO t3(a,b,c) SELECT a,b,c FROM z1\x00Refill a %d-row table using (b&1)==(a&1)\x00INSERT INTO z2(a,b,c)\n SELECT a,b,c FROM z1 WHERE (b&1)==(a&1);\x00INSERT INTO z2(a,b,c)\n SELECT a,b,c FROM z1 WHERE (b&1)<>(a&1);\x00%d four-ways joins\x00SELECT z1.c FROM z1, z2, t3, t4\n WHERE t4.a BETWEEN ?1 AND ?2\n AND t3.a=t4.b\n AND z2.a=t3.b\n AND z1.c=z2.c\x00subquery in result set\x00SELECT sum(a), max(c),\n avg((SELECT a FROM z2 WHERE 5+z2.b=z1.b) AND rowid0\n AND NOT EXISTS (\n SELECT 1\n FROM digits AS lp\n WHERE z.z = substr(s, ((ind-1)/9)*9 + lp, 1)\n OR z.z = substr(s, ((ind-1)%%9) + (lp-1)*9 + 1, 1)\n OR z.z = substr(s, (((ind-1)/3) %% 3) * 3\n + ((ind-1)/27) * 27 + lp\n + ((lp-1) / 3) * 6, 1)\n )\n )\nSELECT s FROM x WHERE ind=0;\x00Sudoku with VALUES 'digits'\x00WITH RECURSIVE\n input(sud) AS (VALUES(?1)),\n digits(z,lp) AS (VALUES('1',1),('2',2),('3',3),('4',4),('5',5),\n ('6',6),('7',7),('8',8),('9',9)),\n x(s, ind) AS (\n SELECT sud, instr(sud, '.') FROM input\n UNION ALL\n SELECT\n substr(s, 1, ind-1) || z || substr(s, ind+1),\n instr( substr(s, 1, ind-1) || z || substr(s, ind+1), '.' )\n FROM x, digits AS z\n WHERE ind>0\n AND NOT EXISTS (\n SELECT 1\n FROM digits AS lp\n WHERE z.z = substr(s, ((ind-1)/9)*9 + lp, 1)\n OR z.z = substr(s, ((ind-1)%%9) + (lp-1)*9 + 1, 1)\n OR z.z = substr(s, (((ind-1)/3) %% 3) * 3\n + ((ind-1)/27) * 27 + lp\n + ((lp-1) / 3) * 6, 1)\n )\n )\nSELECT s FROM x WHERE ind=0;\x00Mandelbrot Set with spacing=%f\x00WITH RECURSIVE \n xaxis(x) AS (VALUES(-2.0) UNION ALL SELECT x+?1 FROM xaxis WHERE x<1.2),\n yaxis(y) AS (VALUES(-1.0) UNION ALL SELECT y+?2 FROM yaxis WHERE y<1.0),\n m(iter, cx, cy, x, y) AS (\n SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis\n UNION ALL\n SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m \n WHERE (x*x + y*y) < 4.0 AND iter<28\n ),\n m2(iter, cx, cy) AS (\n SELECT max(iter), cx, cy FROM m GROUP BY cx, cy\n ),\n a(t) AS (\n SELECT group_concat( substr(' .+*#', 1+min(iter/7,4), 1), '') \n FROM m2 GROUP BY cy\n )\nSELECT group_concat(rtrim(t),x'0a') FROM a;\x00EXCEPT operator on %d-element tables\x00WITH RECURSIVE \n z1(x) AS (VALUES(2) UNION ALL SELECT x+2 FROM z1 WHERE x<%d),\n z2(y) AS (VALUES(3) UNION ALL SELECT y+3 FROM z2 WHERE y<%d)\nSELECT count(x), avg(x) FROM (\n SELECT x FROM z1 EXCEPT SELECT y FROM z2 ORDER BY 1\n);\x00534...9..67.195....98....6.8...6...34..8.3..1....2...6.6....28....419..5...28..79\x0053....9..6..195....98....6.8...6...34..8.3..1....2...6.6....28....419..5....8..79\x0053.......6..195....98....6.8...6...34..8.3..1....2...6.6....28....419..5....8..79\x00%d.%de%d\x00Fill a table with %d FP values\x00CREATE%s TABLE z1(a REAL %s, b REAL %s);\x00INSERT INTO z1 VALUES(?1,?2); -- %d times\x00%d range queries\x00SELECT sum(b) FROM z1 WHERE a BETWEEN ?1 AND ?2\x00CREATE INDEX three times\x00CREATE INDEX t1a ON z1(a);\x00CREATE INDEX t1b ON z1(b);\x00CREATE INDEX t1ab ON z1(a,b);\x00%d indexed range queries\x00%d calls to round()\x00SELECT sum(round(a,2)+round(b,4)) FROM z1;\x00%d printf() calls\x00WITH c(fmt) AS (VALUES('%%g'),('%%e'),('%%!g'),('%%.20f'))SELECT sum(printf(fmt,a)) FROM z1, c\x00%d INSERTs into an r-tree\x00CREATE VIRTUAL TABLE rt1 USING rtree(id,x0,x1,y0,y1,z0,z1)\x00INSERT INTO rt1(id,x0,x1,y0,y1,z0,z1)VALUES(?1,?2,?3,?4,?5,?6,?7)\x00Copy from rtree to a regular table\x00CREATE TABLE z1(id INTEGER PRIMARY KEY,x0,x1,y0,y1,z0,z1)\x00INSERT INTO z1 SELECT * FROM rt1\x00%d one-dimensional intersect slice queries\x00SELECT count(*) FROM rt1 WHERE x0>=?1 AND x1<=?2\x00Verify result from 1-D intersect slice queries\x00SELECT count(*) FROM z1 WHERE x0>=?1 AND x1<=?2\x00Count disagree step %d: %d..%d. %d vs %d\x00%d one-dimensional overlap slice queries\x00SELECT count(*) FROM rt1 WHERE y1>=?1 AND y0<=?2\x00Verify result from 1-D overlap slice queries\x00SELECT count(*) FROM z1 WHERE y1>=?1 AND y0<=?2\x00%d custom geometry callback queries\x00xslice\x00SELECT count(*) FROM rt1 WHERE id MATCH xslice(?1,?2)\x00%d three-dimensional intersect box queries\x00SELECT count(*) FROM rt1 WHERE x1>=?1 AND x0<=?2 AND y1>=?1 AND y0<=?2 AND z1>=?1 AND z0<=?2\x00%d rowid queries\x00SELECT * FROM rt1 WHERE id=?1\x00%d UPDATEs using rowid\x00UPDATE rt1 SET x0=x0+100, x1=x1+100 WHERE id=?1\x00%d UPDATEs using one-dimensional overlap\x00UPDATE rt1 SET x0=x0-100, x1=x1-100 WHERE y1>=?1 AND y0<=?1+5\x00%d DELETEs using rowid\x00DELETE FROM rt1 WHERE id=?1\x00%d DELETEs using one-dimensional overlap\x00DELETE FROM rt1 WHERE y1>=?1 AND y0<=?1+5\x00Restore deleted entries using INSERT OR IGNORE\x00INSERT OR IGNORE INTO rt1 SELECT * FROM z1\x00Fill %d rows\x00BEGIN;CREATE TABLE ZLOOKSLIKECOREDATA ( ZPK INTEGER PRIMARY KEY, ZTERMFITTINGHOUSINGCOMMAND INTEGER, ZBRIEFGOBYDODGERHEIGHT BLOB, ZCAPABLETRIPDOORALMOND BLOB, ZDEPOSITPAIRCOLLEGECOMET INTEGER, ZFRAMEENTERSIMPLEMOUTH INTEGER, ZHOPEFULGATEHOLECHALK INTEGER, ZSLEEPYUSERGRANDBOWL TIMESTAMP, ZDEWPEACHCAREERCELERY INTEGER, ZHANGERLITHIUMDINNERMEET VARCHAR, ZCLUBRELEASELIZARDADVICE VARCHAR, ZCHARGECLICKHUMANEHIRE INTEGER, ZFINGERDUEPIZZAOPTION TIMESTAMP, ZFLYINGDOCTORTABLEMELODY BLOB, ZLONGFINLEAVEIMAGEOIL TIMESTAMP, ZFAMILYVISUALOWNERMATTER BLOB, ZGOLDYOUNGINITIALNOSE FLOAT, ZCAUSESALAMITERMCYAN BLOB, ZSPREADMOTORBISCUITBACON FLOAT, ZGIFTICEFISHGLUEHAIR INTEGER, ZNOTICEPEARPOLICYJUICE TIMESTAMP, ZBANKBUFFALORECOVERORBIT TIMESTAMP, ZLONGDIETESSAYNATURE FLOAT, ZACTIONRANGEELEGANTNEUTRON BLOB, ZCADETBRIGHTPLANETBANK TIMESTAMP, ZAIRFORGIVEHEADFROG BLOB, ZSHARKJUSTFRUITMOVIE VARCHAR, ZFARMERMORNINGMIRRORCONCERN BLOB, ZWOODPOETRYCOBBLERBENCH VARCHAR, ZHAFNIUMSCRIPTSALADMOTOR INTEGER, ZPROBLEMCLUBPOPOVERJELLY FLOAT, ZEIGHTLEADERWORKERMOST TIMESTAMP, ZGLASSRESERVEBARIUMMEAL BLOB, ZCLAMBITARUGULAFAJITA BLOB, ZDECADEJOYOUSWAVEHABIT FLOAT, ZCOMPANYSUMMERFIBERELF INTEGER, ZTREATTESTQUILLCHARGE TIMESTAMP, ZBROWBALANCEKEYCHOWDER FLOAT, ZPEACHCOPPERDINNERLAKE FLOAT, ZDRYWALLBEYONDBROWNBOWL VARCHAR, ZBELLYCRASHITEMLACK BLOB, ZTENNISCYCLEBILLOFFICER INTEGER, ZMALLEQUIPTHANKSGLUE FLOAT, ZMISSREPLYHUMANLIVING INTEGER, ZKIWIVISUALPRIDEAPPLE VARCHAR, ZWISHHITSKINMOTOR BLOB, ZCALMRACCOONPROGRAMDEBIT VARCHAR, ZSHINYASSISTLIVINGCRAB VARCHAR, ZRESOLVEWRISTWRAPAPPLE VARCHAR, ZAPPEALSIMPLESECONDHOUSING BLOB, ZCORNERANCHORTAPEDIVER TIMESTAMP, ZMEMORYREQUESTSOURCEBIG VARCHAR, ZTRYFACTKEEPMILK TIMESTAMP, ZDIVERPAINTLEATHEREASY INTEGER, ZSORTMISTYQUOTECABBAGE BLOB, ZTUNEGASBUFFALOCAPITAL BLOB, ZFILLSTOPLAWJOYFUL FLOAT, ZSTEELCAREFULPLATENUMBER FLOAT, ZGIVEVIVIDDIVINEMEANING INTEGER, ZTREATPACKFUTURECONVERT VARCHAR, ZCALMLYGEMFINISHEFFECT INTEGER, ZCABBAGESOCKEASEMINUTE BLOB, ZPLANETFAMILYPUREMEMORY TIMESTAMP, ZMERRYCRACKTRAINLEADER BLOB, ZMINORWAYPAPERCLASSY TIMESTAMP, ZEAGLELINEMINEMAIL VARCHAR, ZRESORTYARDGREENLET TIMESTAMP, ZYARDOREGANOVIVIDJEWEL TIMESTAMP, ZPURECAKEVIVIDNEATLY FLOAT, ZASKCONTACTMONITORFUN TIMESTAMP, ZMOVEWHOGAMMAINCH VARCHAR, ZLETTUCEBIRDMEETDEBATE TIMESTAMP, ZGENENATURALHEARINGKITE VARCHAR, ZMUFFINDRYERDRAWFORTUNE FLOAT, ZGRAYSURVEYWIRELOVE FLOAT, ZPLIERSPRINTASKOREGANO INTEGER, ZTRAVELDRIVERCONTESTLILY INTEGER, ZHUMORSPICESANDKIDNEY TIMESTAMP, ZARSENICSAMPLEWAITMUON INTEGER, ZLACEADDRESSGROUNDCAREFUL FLOAT, ZBAMBOOMESSWASABIEVENING BLOB, ZONERELEASEAVERAGENURSE INTEGER, ZRADIANTWHENTRYCARD TIMESTAMP, ZREWARDINSIDEMANGOINTENSE FLOAT, ZNEATSTEWPARTIRON TIMESTAMP, ZOUTSIDEPEAHENCOUNTICE TIMESTAMP, ZCREAMEVENINGLIPBRANCH FLOAT, ZWHALEMATHAVOCADOCOPPER FLOAT, ZLIFEUSELEAFYBELL FLOAT, ZWEALTHLINENGLEEFULDAY VARCHAR, ZFACEINVITETALKGOLD BLOB, ZWESTAMOUNTAFFECTHEARING INTEGER, ZDELAYOUTCOMEHORNAGENCY INTEGER, ZBIGTHINKCONVERTECONOMY BLOB, ZBASEGOUDAREGULARFORGIVE TIMESTAMP, ZPATTERNCLORINEGRANDCOLBY TIMESTAMP, ZCYANBASEFEEDADROIT INTEGER, ZCARRYFLOORMINNOWDRAGON TIMESTAMP, ZIMAGEPENCILOTHERBOTTOM FLOAT, ZXENONFLIGHTPALEAPPLE TIMESTAMP, ZHERRINGJOKEFEATUREHOPEFUL FLOAT, ZCAPYEARLYRIVETBRUSH FLOAT, ZAGEREEDFROGBASKET VARCHAR, ZUSUALBODYHALIBUTDIAMOND VARCHAR, ZFOOTTAPWORDENTRY VARCHAR, ZDISHKEEPBLESTMONITOR FLOAT, ZBROADABLESOLIDCASUAL INTEGER, ZSQUAREGLEEFULCHILDLIGHT INTEGER, ZHOLIDAYHEADPONYDETAIL INTEGER, ZGENERALRESORTSKYOPEN TIMESTAMP, ZGLADSPRAYKIDNEYGUPPY VARCHAR, ZSWIMHEAVYMENTIONKIND BLOB, ZMESSYSULFURDREAMFESTIVE BLOB, ZSKYSKYCLASSICBRIEF VARCHAR, ZDILLASKHOKILEMON FLOAT, ZJUNIORSHOWPRESSNOVA FLOAT, ZSIZETOEAWARDFRESH TIMESTAMP, ZKEYFAILAPRICOTMETAL VARCHAR, ZHANDYREPAIRPROTONAIRPORT VARCHAR, ZPOSTPROTEINHANDLEACTOR BLOB);\x00INSERT INTO ZLOOKSLIKECOREDATA(ZPK,ZAIRFORGIVEHEADFROG,ZGIFTICEFISHGLUEHAIR,ZDELAYOUTCOMEHORNAGENCY,ZSLEEPYUSERGRANDBOWL,ZGLASSRESERVEBARIUMMEAL,ZBRIEFGOBYDODGERHEIGHT,ZBAMBOOMESSWASABIEVENING,ZFARMERMORNINGMIRRORCONCERN,ZTREATPACKFUTURECONVERT,ZCAUSESALAMITERMCYAN,ZCALMRACCOONPROGRAMDEBIT,ZHOLIDAYHEADPONYDETAIL,ZWOODPOETRYCOBBLERBENCH,ZHAFNIUMSCRIPTSALADMOTOR,ZUSUALBODYHALIBUTDIAMOND,ZOUTSIDEPEAHENCOUNTICE,ZDIVERPAINTLEATHEREASY,ZWESTAMOUNTAFFECTHEARING,ZSIZETOEAWARDFRESH,ZDEWPEACHCAREERCELERY,ZSTEELCAREFULPLATENUMBER,ZCYANBASEFEEDADROIT,ZCALMLYGEMFINISHEFFECT,ZHANDYREPAIRPROTONAIRPORT,ZGENENATURALHEARINGKITE,ZBROADABLESOLIDCASUAL,ZPOSTPROTEINHANDLEACTOR,ZLACEADDRESSGROUNDCAREFUL,ZIMAGEPENCILOTHERBOTTOM,ZPROBLEMCLUBPOPOVERJELLY,ZPATTERNCLORINEGRANDCOLBY,ZNEATSTEWPARTIRON,ZAPPEALSIMPLESECONDHOUSING,ZMOVEWHOGAMMAINCH,ZTENNISCYCLEBILLOFFICER,ZSHARKJUSTFRUITMOVIE,ZKEYFAILAPRICOTMETAL,ZCOMPANYSUMMERFIBERELF,ZTERMFITTINGHOUSINGCOMMAND,ZRESORTYARDGREENLET,ZCABBAGESOCKEASEMINUTE,ZSQUAREGLEEFULCHILDLIGHT,ZONERELEASEAVERAGENURSE,ZBIGTHINKCONVERTECONOMY,ZPLIERSPRINTASKOREGANO,ZDECADEJOYOUSWAVEHABIT,ZDRYWALLBEYONDBROWNBOWL,ZCLUBRELEASELIZARDADVICE,ZWHALEMATHAVOCADOCOPPER,ZBELLYCRASHITEMLACK,ZLETTUCEBIRDMEETDEBATE,ZCAPABLETRIPDOORALMOND,ZRADIANTWHENTRYCARD,ZCAPYEARLYRIVETBRUSH,ZAGEREEDFROGBASKET,ZSWIMHEAVYMENTIONKIND,ZTRAVELDRIVERCONTESTLILY,ZGLADSPRAYKIDNEYGUPPY,ZBANKBUFFALORECOVERORBIT,ZFINGERDUEPIZZAOPTION,ZCLAMBITARUGULAFAJITA,ZLONGFINLEAVEIMAGEOIL,ZLONGDIETESSAYNATURE,ZJUNIORSHOWPRESSNOVA,ZHOPEFULGATEHOLECHALK,ZDEPOSITPAIRCOLLEGECOMET,ZWEALTHLINENGLEEFULDAY,ZFILLSTOPLAWJOYFUL,ZTUNEGASBUFFALOCAPITAL,ZGRAYSURVEYWIRELOVE,ZCORNERANCHORTAPEDIVER,ZREWARDINSIDEMANGOINTENSE,ZCADETBRIGHTPLANETBANK,ZPLANETFAMILYPUREMEMORY,ZTREATTESTQUILLCHARGE,ZCREAMEVENINGLIPBRANCH,ZSKYSKYCLASSICBRIEF,ZARSENICSAMPLEWAITMUON,ZBROWBALANCEKEYCHOWDER,ZFLYINGDOCTORTABLEMELODY,ZHANGERLITHIUMDINNERMEET,ZNOTICEPEARPOLICYJUICE,ZSHINYASSISTLIVINGCRAB,ZLIFEUSELEAFYBELL,ZFACEINVITETALKGOLD,ZGENERALRESORTSKYOPEN,ZPURECAKEVIVIDNEATLY,ZKIWIVISUALPRIDEAPPLE,ZMESSYSULFURDREAMFESTIVE,ZCHARGECLICKHUMANEHIRE,ZHERRINGJOKEFEATUREHOPEFUL,ZYARDOREGANOVIVIDJEWEL,ZFOOTTAPWORDENTRY,ZWISHHITSKINMOTOR,ZBASEGOUDAREGULARFORGIVE,ZMUFFINDRYERDRAWFORTUNE,ZACTIONRANGEELEGANTNEUTRON,ZTRYFACTKEEPMILK,ZPEACHCOPPERDINNERLAKE,ZFRAMEENTERSIMPLEMOUTH,ZMERRYCRACKTRAINLEADER,ZMEMORYREQUESTSOURCEBIG,ZCARRYFLOORMINNOWDRAGON,ZMINORWAYPAPERCLASSY,ZDILLASKHOKILEMON,ZRESOLVEWRISTWRAPAPPLE,ZASKCONTACTMONITORFUN,ZGIVEVIVIDDIVINEMEANING,ZEIGHTLEADERWORKERMOST,ZMISSREPLYHUMANLIVING,ZXENONFLIGHTPALEAPPLE,ZSORTMISTYQUOTECABBAGE,ZEAGLELINEMINEMAIL,ZFAMILYVISUALOWNERMATTER,ZSPREADMOTORBISCUITBACON,ZDISHKEEPBLESTMONITOR,ZMALLEQUIPTHANKSGLUE,ZGOLDYOUNGINITIALNOSE,ZHUMORSPICESANDKIDNEY)VALUES(?1,?26,?20,?93,?8,?33,?3,?81,?28,?60,?18,?47,?109,?29,?30,?104,?86,?54,?92,?117,?9,?58,?97,?61,?119,?73,?107,?120,?80,?99,?31,?96,?85,?50,?71,?42,?27,?118,?36,?2,?67,?62,?108,?82,?94,?76,?35,?40,?11,?88,?41,?72,?4,?83,?102,?103,?112,?77,?111,?22,?13,?34,?15,?23,?116,?7,?5,?90,?57,?56,?75,?51,?84,?25,?63,?37,?87,?114,?79,?38,?14,?10,?21,?48,?89,?91,?110,?69,?45,?113,?12,?101,?68,?105,?46,?95,?74,?24,?53,?39,?6,?64,?52,?98,?65,?115,?49,?70,?59,?32,?44,?100,?55,?66,?16,?19,?106,?43,?17,?78);\x00Query %d rows by rowid\x00SELECT ZCYANBASEFEEDADROIT,ZJUNIORSHOWPRESSNOVA,ZCAUSESALAMITERMCYAN,ZHOPEFULGATEHOLECHALK,ZHUMORSPICESANDKIDNEY,ZSWIMHEAVYMENTIONKIND,ZMOVEWHOGAMMAINCH,ZAPPEALSIMPLESECONDHOUSING,ZHAFNIUMSCRIPTSALADMOTOR,ZNEATSTEWPARTIRON,ZLONGFINLEAVEIMAGEOIL,ZDEWPEACHCAREERCELERY,ZXENONFLIGHTPALEAPPLE,ZCALMRACCOONPROGRAMDEBIT,ZUSUALBODYHALIBUTDIAMOND,ZTRYFACTKEEPMILK,ZWEALTHLINENGLEEFULDAY,ZLONGDIETESSAYNATURE,ZLIFEUSELEAFYBELL,ZTREATPACKFUTURECONVERT,ZMEMORYREQUESTSOURCEBIG,ZYARDOREGANOVIVIDJEWEL,ZDEPOSITPAIRCOLLEGECOMET,ZSLEEPYUSERGRANDBOWL,ZBRIEFGOBYDODGERHEIGHT,ZCLUBRELEASELIZARDADVICE,ZCAPABLETRIPDOORALMOND,ZDRYWALLBEYONDBROWNBOWL,ZASKCONTACTMONITORFUN,ZKIWIVISUALPRIDEAPPLE,ZNOTICEPEARPOLICYJUICE,ZPEACHCOPPERDINNERLAKE,ZSTEELCAREFULPLATENUMBER,ZGLADSPRAYKIDNEYGUPPY,ZCOMPANYSUMMERFIBERELF,ZTENNISCYCLEBILLOFFICER,ZIMAGEPENCILOTHERBOTTOM,ZWESTAMOUNTAFFECTHEARING,ZDIVERPAINTLEATHEREASY,ZSKYSKYCLASSICBRIEF,ZMESSYSULFURDREAMFESTIVE,ZMERRYCRACKTRAINLEADER,ZBROADABLESOLIDCASUAL,ZGLASSRESERVEBARIUMMEAL,ZTUNEGASBUFFALOCAPITAL,ZBANKBUFFALORECOVERORBIT,ZTREATTESTQUILLCHARGE,ZBAMBOOMESSWASABIEVENING,ZREWARDINSIDEMANGOINTENSE,ZEAGLELINEMINEMAIL,ZCALMLYGEMFINISHEFFECT,ZKEYFAILAPRICOTMETAL,ZFINGERDUEPIZZAOPTION,ZCADETBRIGHTPLANETBANK,ZGOLDYOUNGINITIALNOSE,ZMISSREPLYHUMANLIVING,ZEIGHTLEADERWORKERMOST,ZFRAMEENTERSIMPLEMOUTH,ZBIGTHINKCONVERTECONOMY,ZFACEINVITETALKGOLD,ZPOSTPROTEINHANDLEACTOR,ZHERRINGJOKEFEATUREHOPEFUL,ZCABBAGESOCKEASEMINUTE,ZMUFFINDRYERDRAWFORTUNE,ZPROBLEMCLUBPOPOVERJELLY,ZGIVEVIVIDDIVINEMEANING,ZGENENATURALHEARINGKITE,ZGENERALRESORTSKYOPEN,ZLETTUCEBIRDMEETDEBATE,ZBASEGOUDAREGULARFORGIVE,ZCHARGECLICKHUMANEHIRE,ZPLANETFAMILYPUREMEMORY,ZMINORWAYPAPERCLASSY,ZCAPYEARLYRIVETBRUSH,ZSIZETOEAWARDFRESH,ZARSENICSAMPLEWAITMUON,ZSQUAREGLEEFULCHILDLIGHT,ZSHINYASSISTLIVINGCRAB,ZCORNERANCHORTAPEDIVER,ZDECADEJOYOUSWAVEHABIT,ZTRAVELDRIVERCONTESTLILY,ZFLYINGDOCTORTABLEMELODY,ZSHARKJUSTFRUITMOVIE,ZFAMILYVISUALOWNERMATTER,ZFARMERMORNINGMIRRORCONCERN,ZGIFTICEFISHGLUEHAIR,ZOUTSIDEPEAHENCOUNTICE,ZSPREADMOTORBISCUITBACON,ZWISHHITSKINMOTOR,ZHOLIDAYHEADPONYDETAIL,ZWOODPOETRYCOBBLERBENCH,ZAIRFORGIVEHEADFROG,ZBROWBALANCEKEYCHOWDER,ZDISHKEEPBLESTMONITOR,ZCLAMBITARUGULAFAJITA,ZPLIERSPRINTASKOREGANO,ZRADIANTWHENTRYCARD,ZDELAYOUTCOMEHORNAGENCY,ZPURECAKEVIVIDNEATLY,ZPATTERNCLORINEGRANDCOLBY,ZHANDYREPAIRPROTONAIRPORT,ZAGEREEDFROGBASKET,ZSORTMISTYQUOTECABBAGE,ZFOOTTAPWORDENTRY,ZRESOLVEWRISTWRAPAPPLE,ZDILLASKHOKILEMON,ZFILLSTOPLAWJOYFUL,ZACTIONRANGEELEGANTNEUTRON,ZRESORTYARDGREENLET,ZCREAMEVENINGLIPBRANCH,ZWHALEMATHAVOCADOCOPPER,ZGRAYSURVEYWIRELOVE,ZBELLYCRASHITEMLACK,ZHANGERLITHIUMDINNERMEET,ZCARRYFLOORMINNOWDRAGON,ZMALLEQUIPTHANKSGLUE,ZTERMFITTINGHOUSINGCOMMAND,ZONERELEASEAVERAGENURSE,ZLACEADDRESSGROUNDCAREFUL FROM ZLOOKSLIKECOREDATA WHERE ZPK=?1;\x00IBBIIITIVVITBTBFBFITTFBTBVBVIFTBBFITFFVBIFIVBVVVBTVTIBBFFIVIBTBTVTTFTVTVFFIITIFBITFTTFFFVBIIBTTITFTFFVVVFIIITVBBVFFTVVB\x00BEGIN;CREATE TABLE z1(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TABLE z2(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TABLE t3(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE VIEW v1 AS SELECT rowid, i, t FROM z1;CREATE VIEW v2 AS SELECT rowid, i, t FROM z2;CREATE VIEW v3 AS SELECT rowid, i, t FROM t3;\x00INSERT INTO t%d VALUES(NULL,?1,?2)\x00CREATE INDEX i1 ON z1(t);CREATE INDEX i2 ON z2(t);CREATE INDEX i3 ON t3(t);COMMIT;\x00speed4p-join1\x00SELECT * FROM z1, z2, t3 WHERE z1.oid = z2.oid AND z2.oid = t3.oid\x00speed4p-join2\x00SELECT * FROM z1, z2, t3 WHERE z1.t = z2.t AND z2.t = t3.t\x00speed4p-view1\x00SELECT * FROM v%d WHERE rowid = ?\x00speed4p-table1\x00SELECT * FROM t%d WHERE rowid = ?\x00speed4p-subselect1\x00SELECT (SELECT t FROM z1 WHERE rowid = ?1),(SELECT t FROM z2 WHERE rowid = ?1),(SELECT t FROM t3 WHERE rowid = ?1)\x00speed4p-rowid-update\x00UPDATE z1 SET i=i+1 WHERE rowid=?1\x00CREATE TABLE t5(t TEXT PRIMARY KEY, i INTEGER);\x00speed4p-insert-ignore\x00INSERT OR IGNORE INTO t5 SELECT t, i FROM z1\x00CREATE TABLE log(op TEXT, r INTEGER, i INTEGER, t TEXT);CREATE TABLE t4(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TRIGGER t4_trigger1 AFTER INSERT ON t4 BEGIN INSERT INTO log VALUES('INSERT INTO t4', new.rowid, new.i, new.t);END;CREATE TRIGGER t4_trigger2 AFTER UPDATE ON t4 BEGIN INSERT INTO log VALUES('UPDATE OF t4', new.rowid, new.i, new.t);END;CREATE TRIGGER t4_trigger3 AFTER DELETE ON t4 BEGIN INSERT INTO log VALUES('DELETE OF t4', old.rowid, old.i, old.t);END;BEGIN;\x00speed4p-trigger1\x00INSERT INTO t4 VALUES(NULL, ?1, ?2)\x00speed4p-trigger2\x00UPDATE t4 SET i = ?1, t = ?2 WHERE rowid = ?3\x00speed4p-trigger3\x00DELETE FROM t4 WHERE rowid = ?1\x00DROP TABLE t4;DROP TABLE log;VACUUM;CREATE TABLE t4(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);BEGIN;\x00speed4p-notrigger1\x00speed4p-notrigger2\x00speed4p-notrigger3\x00%5d %5d %5d %s\n\x00/proc/%d/io\x00rb\x00-- %-28s %s\x00rchar: \x00Bytes received by read():\x00wchar: \x00Bytes sent to write():\x00syscr: \x00Read() system calls:\x00syscw: \x00Write() system calls:\x00read_bytes: \x00Bytes rcvd from storage:\x00write_bytes: \x00Bytes sent to storage:\x00cancelled_write_bytes: \x00Cancelled write bytes:\x00-- Compile option: %s\n\x00main\x00-- Speedtest1 for SQLite %s %.48s\n\x00UNIQUE\x00autovacuum\x00cachesize\x00missing argument on %s\n\x00exclusive\x00checkpoint\x00explain\x00heap\x00missing arguments on %s\n\x00incrvacuum\x00journal\x00key\x00lookaside\x00memdb\x00multithread\x00nomemstat\x00mmap\x00nosync\x00notnull\x00NOT NULL\x00output\x00-\x00wb\x00cannot open \"%s\" for writing\n\x00pagesize\x00pcache\x00primarykey\x00PRIMARY KEY\x00repeat\x00reprepare\x00serialized\x00singlethread\x00sqlonly\x00shrink-memory\x00size\x00stats\x00temp\x00argument to --temp should be integer between 0 and 9\x00testset\x00trace\x00threads\x00utf16le\x00utf16be\x00verify\x00reserve\x00without-rowid\x00help\x00?\x00unknown option: %s\nUse \"%s -?\" for help\n\x00surplus argument: %s\nUse \"%s -?\" for help\n\x00cannot allocate %d-byte heap\n\x00heap configuration failed: %d\n\x00cannot allocate %lld-byte pcache\n\x00pcache configuration failed: %d\n\x00:memory:\x00Cannot open database file: %s\n\x00lookaside configuration failed: %d\n\x00random\x00PRAGMA temp_store=memory\x00PRAGMA mmap_size=%d\x00PRAGMA threads=%d\x00PRAGMA key('%s')\x00PRAGMA encoding=%s\x00PRAGMA auto_vacuum=FULL\x00PRAGMA auto_vacuum=INCREMENTAL\x00PRAGMA page_size=%d\x00PRAGMA cache_size=%d\x00PRAGMA synchronous=OFF\x00PRAGMA locking_mode=EXCLUSIVE\x00PRAGMA journal_mode=%s\x00.explain\n.echo on\n\x00 Begin testset \"%s\"\n\x00debug1\x00orm\x00cte\x00fp\x00trigger\x00rtree\x00unknown testset: \"%s\"\nChoices: cte debug1 fp main orm rtree trigger\n\x00Reset the database\x00SELECT name FROM main.sqlite_master WHERE sql LIKE 'CREATE %%TABLE%%'\x00DROP TABLE main.\"%w\"\x00SELECT name FROM temp.sqlite_master WHERE sql LIKE 'CREATE %%TABLE%%'\x00PRAGMA compile_options\x00-- Lookaside Slots Used: %d (max %d)\n\x00-- Successful lookasides: %d\n\x00-- Lookaside size faults: %d\n\x00-- Lookaside OOM faults: %d\n\x00-- Pager Heap Usage: %d bytes\n\x00-- Page cache hits: %d\n\x00-- Page cache misses: %d\n\x00-- Page cache writes: %d\n\x00-- Schema Heap Usage: %d bytes\n\x00-- Statement Heap Usage: %d bytes\n\x00-- Memory Used (bytes): %d (max %d)\n\x00-- Outstanding Allocations: %d (max %d)\n\x00-- Pcache Overflow Bytes: %d (max %d)\n\x00-- Largest Allocation: %d bytes\n\x00-- Largest Pcache Allocation: %d bytes\n\x00" var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data